import socket
def download webpage (host, path="/"):
# Create a TCP socket
client socket socket.socket (socket. AF INET, socket.SOCK STREAM)
# Connect to the host (HTTP port 80)
client_socket.connect((host, 80))
# Send an HTTP GET request
request = f"GET (path) HTTP/1.1\r\nHost: {host}\r\nConnection: close\r\n\r\n"
client socket.send(request.encode())
# Receive the response from the server
response = b""
while True:
part client_socket.recv (4096)
if not part:
break
response += part
Chapter 1-accessModifier staticOrInstance returnType methodName(parameterType parameterName, ...) {
API (Application Programming Interface): collection of predefined classes, interfaces, methods (libraries). Java is a simple (easy to learn), object-oriented (uses objects and classes), distributed (supports network-based applications), and interpreted (runs via JVM from bytecode) language. It is robust (strong in error handling and memory management), secure (protects against threats with built-in
...Inheritance in Python
Inheritance allows a class to use and extend the properties and methods of another class.
It promotes code reusability and reduces duplication.
Think of it as “child learns from parent.” 👨👦💻
Program with no Inheritance:
import datetime
class TennisPlayer:
def __init__(self, fname, lname, birth_year):
self.first_name = fname
self.last_name = lname
self.birth_year = birth_year
self.aces = []
def get_age(self):
now = datetime.datetime.now()
return now.year - self.birth_
SECTION A WEEKS 1 - 4
MODEL QUESTIONS / ANSWERS ETC
Q: Write R code to create a vector v with elements 3, NA, Inf, and -Inf. Then, explain what happens if you add 5 to v.
A:v <- c(3, NA, Inf, -Inf). Adding 5: v + 5 outputs [1] 8 NA Inf -Inf. NA propagates (remains NA), Inf + finite = Inf, -Inf + finite = -Inf (from specialvalues.html: arithmetic with Inf behaves sensibly, but NA is "not available").
Q: Given vector a <- c(10, 15, NA, 20), write code to count NAs and replace them with the
Gram-positive, non-motile, and non-spore forming bacteria that are strict fermenters.
They are catalase and oxidase negative and can't synthesize cytochromes.
LAB can be either homofermentative or heterofermentative. The type of fermentation is determined by the enzymes produced by the organism.
Homofermentative: Converts glucose into two lactic acid molecules, with 85-95% of the glucose carbon ending up as lactate. This pathway uses the glycolytic (Embden-Meyerhof)
An interdisciplinary field combining statistics, computer science, and business knowledge.
Its goal is to extract valuable insights and knowledge from data (both structured and unstructured).
It answers key business questions: what happened, why, what will happen, and what to do about it.
The process involves collecting, cleaning, processing, analyzing, and communicating data insights.
It's the process of using sample data to
1. Define Fuel. Explain classification and characteristics of fuel.
A fuel is any substance that produces heat energy on combustion.
Classification:
Solid fuels (coal, coke, wood). Liquid fuels (petrol, diesel, kerosene)
Gaseous fuels (LPG, CNG, producer gas)
**Characteristics:**
1. High calorific value 2. Moderate ignition temperature 3. Low moisture content.
4. Low non-combustible matter 5. Moderate combustion velocity 6. Harmless combustion products 7. Low cost and easy availability 8. Easy storage
1. Conceito de identidade (pág. 9)
Identidade é o conjunto de características, valores, crenças e experiências que tornam uma pessoa única e permitem que ela se reconheça como um “eu” distinto dos outros.
2. Conceito de autoimagem (pág. 9)
Autoimagem é a forma como uma pessoa se vê, ou seja, a percepção que tem sobre suas próprias características físicas, emocionais e comportamentais.
3. Conceito de autoconceito (pág. 11)
Autoconceito é a soma de todas as ideias, percepções e