Author SHA1 Message Date
scott.liu f4981fb8fd June13 test py 2023-06-14 15:54:55 -07:00
scott.liu 5587fcab38 3.3 notes, 3.2 questions, and 613 test file 2023-06-14 15:54:55 -07:00
scott.liu 0f133528b3 3.3 notes, 3.2 questions, and test file 2023-06-14 15:54:55 -07:00
scott.liu 943741fbc4 Update on the file name 2023-06-14 15:54:55 -07:00
shunan.z 7025098824 reading notes for 3.4 2023-06-14 02:46:49 -05:00
shunan.z 527ff3654d Merge branch 'main' of https://gogs.gtsplab.com:5432/SVIG/python-bootcamp 2023-06-13 18:49:49 -05:00
shunan.z fd6f0e574c reading notes 2023-06-13 18:49:40 -05:00
scott.liu d2bb4dc72a Updates on the notes of 3.1 and 3.2 2023-06-13 03:40:56 -07:00
cheezedoodle2andcheezedoodle2 14dbd3ed39 Removed bytecode that caused problems during testing
https://gogs.gtsplab.com:5432/SVIG/python-bootcamp/wiki/6-7-2023+Cohort+2+Sync+Notes
2023-06-12 17:16:04 -07:00
shunan.z df963da832 this is my answer for runing the PDB in PowerShell. 2023-06-12 13:23:01 -05:00
shunan.z 49b7d7134b rewrite question 3 2023-06-11 16:23:26 -05:00
shunan.z df793f5ae9 Merge branch 'main' of https://gogs.gtsplab.com:5432/SVIG/python-bootcamp 2023-06-09 19:19:02 -05:00
scott.liu 582e2bcfe1 HW7 with py, testpy, and two txt 2023-06-09 17:04:23 -07:00
shunan.z 2ca60ee9f9 Some changes for Shunan's HW 2023-06-09 18:53:55 -05:00
shunan.z e75cba4117 Merge branch 'main' of https://gogs.gtsplab.com:5432/SVIG/python-bootcamp 2023-06-09 13:06:32 -05:00
shunan.z 2556ad33ca shunan zhao HW 2023-06-09 13:05:45 -05:00
scott.liu 70581e083e Tried some pdb test in real code 2023-06-08 16:59:21 -07:00
cheezedoodle2 de08f52211 Don't allow bytecode to be checked in 2023-06-07 18:55:34 -07:00
shunan.z 7ab36cc4c5 Merge branch 'main' of https://gogs.gtsplab.com:5432/SVIG/python-bootcamp 2023-06-07 19:56:05 -05:00
shunan.z dd85aebb88 Resubmit for HW 6.7 2023-06-07 19:56:03 -05:00
scott.liu 21661d71ee . 2023-06-07 17:05:28 -07:00
scott.liu 34e39ba1d9 This is the hm6 2023-06-07 17:05:28 -07:00
shunan.z 71750bd96c Merge branch 'main' of https://gogs.gtsplab.com:5432/SVIG/python-bootcamp 2023-06-07 17:58:24 -05:00
shunan.z 12474cca3f Shunan.z_HW 2023-06-07 17:58:22 -05:00
scott.liu 3df5a742d8 My HW5 2023-06-06 16:48:01 -07:00
shunan.z facd334915 Shunan.z_HW 2023-06-06 09:38:17 -05:00
shunan.z 5732b28b4e Merge branch 'main' of https://gogs.gtsplab.com:5432/SVIG/python-bootcamp 2023-06-05 19:09:41 -05:00
shunan.z c3e0c45786 Shunan.z 2023-06-05 09:02:18 -05:00
scott.liu d807bd6b3b HW4 by Scott 2023-06-05 03:19:34 -07:00
cheezedoodle2 60aaa1ebb8 Added lexer/parser skeleton 2023-06-01 18:00:18 -07:00
leonhuang 79f8a7f5cc Homework3 2023-05-31 19:15:53 -05:00
leonhuang cfe8be26e0 Homework3 2023-05-31 18:27:25 -05:00
shunan.z 805c5c275e Merge branch 'main' of https://gogs.gtsplab.com:5432/SVIG/python-bootcamp 2023-05-31 10:24:30 -05:00
shunan.z 83859026be shunan.z_HW 2023-05-31 10:24:26 -05:00
scott.liu 5efb942978 This is HW3 for May30 2023-05-31 03:16:00 -07:00
cheezedoodle2 74f9527832 Updated launch configurations 2023-05-30 17:08:53 -07:00
leonhuang 081471fa5d Homework2 2023-05-26 15:14:12 -05:00
leonhuang 291ba82046 Homework2 2023-05-26 14:58:20 -05:00
leonhuang 14ed1783f9 Homework2 2023-05-26 14:51:43 -05:00
shunan.z 74545a6ad1 Merge branch 'main' of https://gogs.gtsplab.com:5432/SVIG/python-bootcamp 2023-05-26 09:39:45 -05:00
shunan.z b6be9c9488 Shunan_z_HW2 2023-05-26 09:39:40 -05:00
scott.liu 716e254905 This is my hw2 2023-05-26 03:28:24 -07:00
leonhuang 161a4e28db Homework1 2023-05-25 14:28:54 -05:00
leonhuang 5af112ebae Leon's Submussions 2023-05-25 14:03:09 -05:00
shunan.z 5d36a06987 HW1_shunan_zhao 2023-05-25 11:46:29 -05:00
shunan.z b4f174be47 HW1_shunan_zhao 2023-05-25 11:14:38 -05:00
scott.liu 46acaf2e75 Scott;s Folder 2023-05-25 03:49:05 -07:00
scott.liu 28c277f369 something casual 2023-05-24 17:30:29 -07:00
shunan.z 02146e348d delete 2023-05-18 20:33:21 -05:00
shunan.z 9df129681d delete 2023-05-18 20:29:32 -05:00
shunan.z a566adc1df 新的 2023-05-18 20:28:30 -05:00
shunan.z aa1a8fee93 aaaaaaaaaaaaaaaaaaaaaaaaaa 2023-05-18 20:25:54 -05:00
shunan.z 285914f044 Merge branch 'main' of https://gogs.gtsplab.com:5432/SVIG/python-bootcamp 2023-05-18 19:34:44 -05:00
leonhuang da2c779bcd adfafafafsafafasfasfasfafafafsagagafafaagagagagagag 2023-05-18 19:27:06 -05:00
leonhuang 7259509d9e adadjalkfjlaskfjlaksfjlaskfjlkasfjlakfjakfjlasfjlgjslga 2023-05-18 19:27:06 -05:00
shunan.z b085e13c4e I like badminton. 2023-05-18 19:18:48 -05:00
scott.liu 59e84426af A brain teaser 2023-05-18 16:59:41 -07:00
scott.liu 97f93ebd8e A brain teaser w/ answer 2023-05-18 16:58:54 -07:00
scott.liu 35c8889e77 A brain teaser 2023-05-18 16:56:56 -07:00
cheezedoodle2 dca7e9d599 foo 2023-05-18 12:47:27 -07:00
cheezedoodle2 ce856e5626 foo 2023-05-18 12:44:01 -07:00
cheezedoodle2 072032e80e foo 2023-05-18 12:39:46 -07:00
cheezedoodle2 235e7b5268 foo 2023-05-18 12:38:03 -07:00
cheezedoodle2 22fa096271 Removed foo 2023-05-18 03:08:11 -07:00
scott.liu 13eb12bf69 An update on the test file 2023-05-18 02:49:43 -07:00
scott.liu efa189d0b6 Commit 2 2023-05-18 02:33:11 -07:00
scott.liu 111f551a39 This is a test commit 2023-05-18 02:33:11 -07:00
cheezedoodle2 e0fd81dc1d foo 2023-05-18 02:21:48 -07:00
cheezedoodle2 420194ef54 Removed test file 2023-05-17 17:31:15 -07:00
cheezedoodle2 632448c249 added test file 2023-05-17 17:30:22 -07:00
Sloetjes c3405d56e5 Homework for web server 2023-04-19 20:45:08 -04:00
cheezedoodle2 338824c028 Added loader column 2023-04-19 02:46:02 -07:00
cheezedoodle2 6625a4d6c1 Working version of module inspector. 2023-04-19 02:12:26 -07:00
cheezedoodle2 b1fccaf628 Added HTTP performance test 2023-04-12 21:39:39 -07:00
j 568e890c9f Update 'README.md' 2023-04-07 04:58:16 +02:00
cheezedoodle2 ff86e4a7c2 Added the ability for verbs to be a dict, for future use by an AI. 2023-04-03 23:49:36 -07:00
cheezedoodle2 0f10f22345 Added simulation files. 2023-04-03 23:19:16 -07:00
170 changed files with 2766 additions and 1 deletions
+5
View File
@@ -0,0 +1,5 @@
.DS_Store
geckodriver.log
.gitignore
*.pyc
*/__pycache__
+19
View File
@@ -0,0 +1,19 @@
{
"configurations": [
{
"name": "Python: HotdogSimulation",
"type": "python",
"request": "launch",
"program": "simulation/SimulationRunner.py",
"justMyCode": true,
"args": "./HotdogSimulation.py"
},
{
"name": "Python: File",
"type": "python",
"request": "launch",
"program": "${file}",
"justMyCode": true
}
]
}
+28
View File
@@ -0,0 +1,28 @@
# Question 1:
# The international standard for floating-point representation is
# called the "IEEE 754 Standard for Floating-Point Arithmetic."
# Question 2:
# 32-bit and 64-bit formats are the most widely used ones in practice.
# Question 3:
# My computer supports all these formats
import numpy as np
supported_formats = np.finfo(np.float32).bits, np.finfo(np.float64).bits
print(f"Your computer supports the following floating-point formats: {supported_formats}")
# Question 4:
# Using the Pandas multiplication operator (df['Number1'] * df['Number2'])
# , the result is automatically converted to a floating-point data type.
# On the other hand, when I multiply the numbers using the normal Python
# multiplication operator (num1 * num2), the result remains an integer
# data type.
# Question 5:
# The size of a floating-point number in memory is primarily determined
# by the data type and not the actual value it represents. So the size
# of a Python floating-point number does not change as it gets larger.
import sys
print(sys.getsizeof(70))
+30
View File
@@ -0,0 +1,30 @@
# Question 7:
# 1. Strings in Python are sequences of Unicode characters, while bytes
# are sequences of raw binary data.
# 2. Strings in Python are immutable, bytes objects are mutable
# 3. Strings in Python are encoded using a specific character encoding,
# bytes objects do not have an inherent encoding and represent raw binary
# data.
import sys
string_example = "Hello"
bytes_example = b"Hello"
string_size = sys.getsizeof(string_example)
bytes_size = sys.getsizeof(bytes_example)
print("Size of string:", string_size)
print("Size of bytes:", bytes_size)
# Emojis are represented using Unicode characters, which require more
# bytes to store compared to ASCII characters. Therefore, if you have
# a string that contains emojis, its size will be larger than a string
# without emojis.
def print_string_as_numbers(input_string):
for char in input_string:
print(ord(char), end=' ')
# Example usage
input_string = "Hello, World!"
print_string_as_numbers(input_string)
+36
View File
@@ -0,0 +1,36 @@
# Question 8: It assumes that the CSV file being read
# (tomato_sales_error.csv) has a column named "Tomato_Sales."
# If the column doesn't exist in the CSV file or if there is an issue
# with the file itself, an error will be raised.
# Question 9:
import pandas as pd
def read_tomato_sales(file_name):
data = pd.read_csv(file_name)
# Ensure required columns exist
required_columns = ["Store", "Region", "Tomato_Sales"]
missing_columns = set(required_columns) - set(data.columns)
if missing_columns:
raise ValueError(f"Invalid CSV format: Missing columns: {', '.join(missing_columns)}")
# Validate Tomato_Sales column
tomato_sales = data["Tomato_Sales"]
if not tomato_sales.dtype == int and not tomato_sales.dtype == float:
raise ValueError("Invalid CSV format: 'Tomato_Sales' column must contain numerical values.")
# Calculate total tomato sales
total_sales = tomato_sales.sum()
print(f"Total tomato sales: {total_sales}")
# Question 10: Bytes represent raw binary data, while strings represent
# textual data. Using bytes allows us to handle various character
# encodings. By working with bytes, we can ensure that the data remains in
# its raw encoded form, allowing for accurate handling of different
# encodings.
# In the interactive Python REPL (Read-Eval-Print Loop), the "_" variable
# is a special variable that is automatically assigned the result of the
# last expression evaluated. The type of the "_" variable reflects the
# type of the last expression evaluated in the REPL.
+1
View File
@@ -0,0 +1 @@
print('Hi')
+1 -1
View File
@@ -1,6 +1,6 @@
GTSP Python Bootcamp GTSP Python Bootcamp
This bootcamp is intended for OTP interns with a math and applied analysis This bootcamp is intended for OPT interns with a math and applied analysis
background to get up to speed quickly on how to use Python for practical background to get up to speed quickly on how to use Python for practical
commercial work. It is not intended for large classes above 2-3 study groups commercial work. It is not intended for large classes above 2-3 study groups
of a maximum of 4 students each. of a maximum of 4 students each.
@@ -0,0 +1,141 @@
{\rtf1\ansi\ansicpg1252\cocoartf2580
\cocoatextscaling0\cocoaplatform0{\fonttbl\f0\fnil\fcharset0 LucidaGrande;}
{\colortbl;\red255\green255\blue255;\red26\green26\blue26;\red255\green255\blue255;}
{\*\expandedcolortbl;;\cssrgb\c13333\c13333\c13333;\cssrgb\c100000\c100000\c100000;}
\margl1440\margr1440\vieww11520\viewh8400\viewkind0
\deftab720
\pard\pardeftab720\parhyphenfactor20\partightenfactor0
\f0\fs32 \cf2 \cb3 \expnd0\expndtw0\kerning0
1. What is a type hierarchy?\
The type hierarchy in Python refers to the organization and relationships among different types or classes in the Python programming language. \
It defines how types are related to each other and how they inherit attributes and behaviors from their parent types.\
the type hierarchy in Python provides a structured organization of types, allowing for code reuse, inheritance, and polymorphism, which are fundamental principles of object-oriented programming.\
\
\
\
2. What is the difference between __repr__() and __str__()?\
The __repr__() method is intended to provide a detailed and unambiguous representation of the object. It is primarily used for debugging and development purposes.\
the __str__() method is used to provide a more user-friendly and readable representation of the object. It is intended for displaying the object to end-users.\
\
\
\
3. What is the range of an integer?\
In Python 2, the int type is a fixed-size integer, typically represented using 32 bits or 64 bits depending on the platform. The maximum value for an int in Python 2 is sys.maxint, which is usually 2^31 - 1 or 2^63 - 1. Or you need to use \'91Long\'92 instead.\
In Python 3, there is only one integer type, int, which behaves like the long type in Python 2. The int type in Python 3 can represent integers of arbitrary size limited only by the available memory.\
\
Ex:\
import sys\
\
# Python 2\
print(sys.maxint) # Output: 2147483647 (on most platforms)\
\
# Python 3\
print(sys.maxsize) # Output: 9223372036854775807 (on most platforms)\
\
\
\
4. Why string is a immutable sequence but you can still assign or change the index from a string?\
Strings are immutable sequences, which means that once a string is created, its elements cannot be modified. But you can still create new strings by using concatenation or string manipulation methods to achieve the desired modifications.\
\
\
\
5. Describe the __closure__ attribute.\
The __closure__ attribute returns a tuple of cell objects, where each cell object represents a captured variable. \
A cell object holds a reference to the variable's value, allowing the function to access and use the value even after the original scope has finished executing.\
The cell objects stored in the __closure__ attribute have the cell_contents attribute, which provides direct access to the value of the captured variable.\
\
\
\
6. What is a code object and a function object? Any difference between them?\
Code object:\
A code object represents byte-compiled executable Python code, or bytecode. \
It contains the instructions that make up the logic of a function, method, module, or other executable code. \
The code object includes information such as the bytecode instructions, the constants used by the bytecode, the names used by the bytecode, the filename from which the code was compiled, and more. \
Code objects are immutable and do not contain any references to mutable objects.\
Function object:\
A function object, on the other hand, is a callable object that represents a Python function. \
It contains a reference to a code object, which defines the implementation of the function. \
In addition to the code object, a function object also includes references to the function's globals (the module in which it was defined), the default argument values, and other attributes such as the function name, qualified function name, and more. \
Function objects are mutable and can have additional attributes assigned to them.\
\
In summary, a code object represents the bytecode and metadata of Python code, while a function object is a callable object that encapsulates a code object and provides additional functionality, such as the ability to be called and have attributes assigned to it. A function object is essentially a runtime representation of a function defined in Python code, with the code object containing the actual implementation details.\
\
\
\
7. What is a traceback object and how we use it?\
Traceback objects represent a stack trace of an exception. \
They are created when an exception occurs and provide information about the sequence of function calls leading up to the exception.\
\
One way to use it we can figure it out by using \'91try\'85 except\'85\'92 function:\
\
try:\
# Some code that may raise an exception\
except Exception as e:\
# Handle the exception\
print("An exception occurred:", type(e).__name__)\
print("Error message:", str(e))\
\
Exception is the base class for all built-in exceptions in Python. \
It is a superclass that encompasses a wide range of exceptions, such as TypeError, ValueError, NameError, and many others. \
By using Exception in the except statement, you catch any exception that is raised during the execution of the try block.\
\
\
\
8. What is the \'91auditing event\'92 meaning?\
It refers to a mechanism in Python that allows custom auditing or monitoring of attribute access on objects. When accessing the tb_frame attribute of a traceback object, an auditing event of type __getattr__ is raised. This event provides an opportunity to intercept and customize the attribute access behavior, if desired.\
\
In simple terms, an auditing event is a way to track or log attribute access on objects for monitoring or auditing purposes. It allows you to observe and potentially modify the behavior when accessing specific attributes.\
\
The auditing events are specific to the implementation of Python and are typically used in specialized scenarios where attribute access needs to be monitored or customized.\
\
\
\
9. How to find the common values and different values from two lists?\
list1 = [1, 2, 3, 4, 6]\
list2 = [2, 4, 6, 7, 8]\
\
# Find common values\
common_values = []\
for item in list1:\
if item in list2:\
common_values.append(item)\
\
# Find different values\
different_values = []\
for item in list1:\
if item not in list2:\
different_values.append(item)\
for item in list2:\
if item not in list1:\
different_values.append(item)\
\
print("Common values:", common_values) # Common values: [2, 4, 6]\
print("Different values:", different_values) # Different values: [1, 3, 7, 8]\
\
\
\
# Or there is another way to do this by using set() method\
# Find common values\
common_values = set(list1) & set(list2) # The '&' operator performs an intersection\
\
# Find different values\
different_values = set(list1) ^ set(list2) # The '^' operator performs a symmetric difference\
\
print("Common values:", common_values) # Common values: \{2, 4, 6\}\
print("Different values:", different_values) # Different values: \{1, 3, 7, 8\}\
\
\
\
10. The difference between list and set?\
In summary, lists are ordered, allow duplicate elements, and are mutable. \
Sets are unordered, do not allow duplicates, and are also mutable. \
\
The following detailed explanations are provided by AI:\
1. Order: Lists are ordered collections, meaning they preserve the order of elements. Each element in a list has an index associated with it. Sets, on the other hand, are unordered collections. They do not preserve the original order of elements and do not have indices.\
2. Duplicate elements: Lists allow duplicate elements, which means you can have multiple occurrences of the same value in a list. Sets, on the other hand, do not allow duplicate elements. Each element in a set is unique.\
3. Mutable vs. Immutable: Lists are mutable, which means you can modify individual elements, add new elements, or remove elements from a list. Sets are also mutable, allowing the addition and removal of elements. However, you cannot modify individual elements in a set since they are unordered.\
4. Membership testing: Checking for membership (whether an element exists in a collection) is faster in sets compared to lists. Sets use a hashing mechanism that provides efficient membership testing, while lists require iterating over the elements to check for membership.\
5. Mathematical set operations: Sets support various set operations like union, intersection, difference, and symmetric difference. These operations can be performed using operators (|, &, -, ^) or methods. Lists do not provide built-in operations for set operations.\
6. Data uniqueness: Sets are often used to ensure the uniqueness of elements in a collection. You can easily eliminate duplicates from a list by converting it to a set and then back to a list if the order of elements is not important.\
}
+118
View File
@@ -0,0 +1,118 @@
{\rtf1\ansi\ansicpg1252\cocoartf2580
\cocoatextscaling0\cocoaplatform0{\fonttbl\f0\fnil\fcharset0 LucidaGrande;}
{\colortbl;\red255\green255\blue255;\red26\green26\blue26;\red255\green255\blue255;\red39\green40\blue50;
}
{\*\expandedcolortbl;;\cssrgb\c13333\c13333\c13333;\cssrgb\c100000\c100000\c100000;\cssrgb\c20392\c20784\c25490;
}
\margl1440\margr1440\vieww28300\viewh14980\viewkind0
\deftab720
\pard\pardeftab720\parhyphenfactor20\partightenfactor0
\f0\fs32 \cf2 \cb3 \expnd0\expndtw0\kerning0
CPython implementation detail: CPython currently uses a reference-counting scheme with (optional) delayed detection of cyclically linked garbage, which collects most objects as soon as they become unreachable, but is not guaranteed to collect garbage containing circular references.\
\
What is a reference-counting scheme?\
It refers to a memory management technique where each object in a programming language implementation, such as CPython, keeps track of the number of references pointing to it. \
Whenever a reference is created to an object, its reference count is increased, and when a reference is deleted or goes out of scope, the reference count is decreased. \
\
What is a reference?\
In the context of memory management, a "reference" refers to an identifier or value that allows access to an object in a programming language. \
It is a way to refer to or point to the memory location where an object is stored.\
\
What is the advantage of reference-counting scheme?\
The advantage of the reference-counting scheme is that it allows objects to be deallocated immediately when they are no longer needed. \
It ensures efficient memory management because objects can be freed as soon as their reference count reaches zero, without the need for more complex garbage collection algorithms.\
\
What is a garbage?\
In the context of memory management, "garbage" refers to objects that are no longer reachable or used by the program but still occupy memory. \
This typically occurs when objects are created dynamically during program execution but are not properly deallocated or no longer accessible. \
Garbage collection is the process of identifying and reclaiming memory occupied by such unused objects, making it available for reuse. \
The reference-counting scheme used by CPython helps in automatically deallocating most objects as soon as they become unreachable. \
However, in the case of circular references, where objects refer to each other in a loop, additional mechanisms are required to detect and collect such cyclically linked garbage. It\'92s called "delayed detection of cyclically linked garbage" to collect and deallocate objects that are involved in cyclic references.\
\
\
\
What is a __blabla__(): method?\
In Python, the following are special attributes (also known as dunder attributes) that can be accessed on objects or functions.\
These special attributes provide additional information or access to specific properties of objects in Python. \
\
What is the advantages of the dunder method?\
Overall, dunder attributes provide flexibility, customization, and enhanced functionality to Python objects and classes. \
They contribute to the expressive nature of the language and enable powerful features like operator overloading and introspection.\
\
Convention: Dunder attributes follow a specific naming convention, starting and ending with double underscores (__). This convention makes them easily recognizable and distinguishes them from regular attributes.\
Customization: Dunder attributes allow you to customize and define the behavior of objects and classes. By implementing specific dunder methods, you can change how objects behave in certain situations, such as arithmetic operations, string representation, comparisons, and more.\
Operator Overloading: Dunder attributes enable operator overloading, allowing objects to participate in built-in operations like addition (+), subtraction (-), equality (==), and more. This makes it possible to define meaningful operations for custom classes.\
Introspection: Dunder attributes provide a way to introspect and access information about objects and classes. For example, name and doc allow you to retrieve the name and documentation of an object. This introspection capability is useful for debugging, documentation generation, and code analysis.\
Integration with Language Features: Dunder attributes seamlessly integrate with various language features, such as iteration (with iter), context managers (with enter and exit), attribute access (with getattr, setattr), and more. This allows you to leverage the full power of the Python language in your classes.\
Code Readability: By following the conventions for dunder attributes, your code becomes more readable and understandable by other Python developers. They can easily recognize and understand the purpose of these special attributes.\
\
\
\
What is a Von Neumann\'92s model of a \'93stored program computer\'94?\
Von Neumann's model of a "stored program computer" is a fundamental concept in computer architecture that describes the organization and operation of modern digital computers.\
It describes a computer architecture where instructions and data are stored together in memory, enabling the execution of instructions as data, and forming the basis of programmable digital computers.\
The distinguishing feature of Von Neumann's model is that both data and instructions are stored in the same memory. This means that the instructions that govern the computer's operations can be treated as data and manipulated like any other type of information. This concept, known as the "stored program concept," allows for the flexibility and programmability of modern computers.\
\
\
\
\
\pard\pardeftab720\partightenfactor0
\cf4 \cb1 What is the difference between identity and type?\
Identity: \
The identity of an object is a unique identifier that remains constant throughout the object's lifetime. \
It can be thought of as the object's address in memory. \
Python provides a built-in function called id() that returns an integer representing the identity of an object. \
The identity never changes once the object is created, and no two objects can have the same identity at the same time.\
Type: \
The type of an object defines the category or class to which the object belongs. \
It determines the behavior of the object and the operations that can be performed on it. \
In Python, the type of an object is determined by its class, which defines the object's characteristics and behavior. \
The type of an object can be obtained using the type() function.\
\
To summarize, the identity of an object is a unique identifier associated with its memory location, while the type of an object defines its category or class, determining its behavior and the operations that can be performed on it.\
\
\
\
The important distinction between immutability and having an unchangeable value in the context of container objects that reference mutable objects in Python.\
In Python, immutability refers to the property of an object that prevents its internal state or structure from being modified after it is created. Immutable objects, such as integers, strings, and tuples, cannot be changed once they are created. However, when an immutable container object (like a tuple or a frozenset) contains a reference to a mutable object (such as a list or a set), the value of the mutable object can be modified even though the container object itself cannot be changed.\
So, while the value of the mutable object can be altered, the container object is still considered immutable because its internal structure (the collection of objects it contains) cannot be changed. The container object cannot be modified to add, remove, or replace elements, but the mutable object it references can be modified independently.\
Therefore, the concept of immutability is more subtle than simply having an unchangeable value. It refers to the inability to modify the structure or internal state of an object, but it doesn't necessarily guarantee that all the objects referenced by an immutable container are themselves immutable.\
\
\
\
What is a close() method in Python?\
The close() method is typically invoked on an object representing the file or resource. \
Calling the close() method can release the associated system resources and ensure that any buffered data is written to the disk.\
\
It's important to note that closing a file or resource is good practice to free up system resources and prevent any potential issues. Failing to close resources properly can result in resource leaks and may lead to unexpected behavior in your program.\
\
\
\
\'93try...finally\'94 statement:\
The try...finally statement is used to ensure that certain code is always executed, regardless of whether an exception occurs or not. \
The code within the try block is executed, and if an exception occurs, it can be caught and handled using an appropriate except block. After the try block (and any associated except blocks), the code within the finally block is executed, ensuring that it always runs, regardless of exceptions. This is useful for cleaning up resources or releasing locks, even if an exception occurs.\cf2 \cb3 \
\pard\pardeftab720\parhyphenfactor20\partightenfactor0
\cf2 \
\
\
\'93with\'94 statement:\
The with statement provides automatic resource management, improves code readability, handles exceptions effectively, and allows for the creation of custom context managers. It is a recommended approach for managing resources that need proper initialization and cleanup, such as files, database connections, network sockets, and more. By using the with statement, you can ensure that your code is more robust, maintainable, and less prone to resource leaks and error handling issues.\
\
\
\
What is a container?\
A container refers to an object that can hold multiple other objects or values. \
Examples of containers in Python include tuples, lists, dictionaries, sets, and other collection types.\
Containers are used to store and organize multiple objects or values together. They provide a way to group related data and operate on them as a whole. \
\
\
\
What is a type hierarchy?\
The type hierarchy in Python refers to the organization and relationships among different types or classes in the Python programming language. \
It defines how types are related to each other and how they inherit attributes and behaviors from their parent types.\
the type hierarchy in Python provides a structured organization of types, allowing for code reuse, inheritance, and polymorphism, which are fundamental principles of object-oriented programming.\
\
\
\
## The attached file HW7_test.py provides an example on how dunder method works. Don\'92t forget to check it out.}
+68
View File
@@ -0,0 +1,68 @@
{\rtf1\ansi\ansicpg1252\cocoartf2580
\cocoatextscaling0\cocoaplatform0{\fonttbl\f0\fnil\fcharset0 LucidaGrande;}
{\colortbl;\red255\green255\blue255;}
{\*\expandedcolortbl;;}
\margl1440\margr1440\vieww28300\viewh17700\viewkind0
\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardirnatural\partightenfactor0
\f0\fs24 \cf0 1. They have same output:\
class MyClass:\
def __getitem__(self, index):\
return f"Item at index \{index\}"\
\
x = MyClass()\
item = x[3]\
print(item) # Output: Item at index 3\
\
# Equivalent to type(x).__getitem__(x, 3)\
item = type(x).__getitem__(x, 3)\
print(item) # Output: Item at index 3\
\
2. The object.__new__() method is a special method in Python that is called to create a new instance of a class. It is responsible for the low-level creation of an object before its initialization. \
\
3. The object.__init__() method is a special method in Python that is called after an instance of a class has been created by the __new__() method. It is responsible for initializing the object's attributes and performing any necessary setup.\
\
4. The object.__del__() method is a special method in Python that is called when an instance of a class is about to be destroyed or garbage-collected.\
\
5. The cyclic garbage collector in CPython is responsible for detecting and breaking reference cycles, ensuring that memory is properly deallocated even in the presence of reference cycles.\
\
6. the __format__() method allows objects to define their own customized string representations when used with format-related operations.\
\
7. x < y calls x.__lt__(y)\
x <= y calls x.__le__(y)\
x == y calls x.__eq__(y)\
x != y calls x.__ne__(y)\
x > y calls x.__gt__(y)\
x >= y calls x.__ge__(y)\
\
8. The methods __get__, __set__, and __delete__ are used to implement descriptors in Python. Descriptors are a way to customize attribute access in classes. These methods are defined in a descriptor class, and when an instance of the descriptor class is present in an owner class, they are invoked to control attribute access.\
\
9. In Python, a descriptor is an object attribute that has "binding behavior" due to the overriding of attribute access through methods in the descriptor protocol: __get__(), __set__(), and __delete__(). If an object defines any of these methods, it is considered a descriptor.\
\
10. Using __slots__ can save significant memory compared to using __dict__, and it can also improve attribute lookup speed.\
\
11. class Philosopher:\
def __init_subclass__(cls, /, default_name, **kwargs):\
super().__init_subclass__(**kwargs)\
cls.default_name = default_name\
\
class AustralianPhilosopher(Philosopher, default_name="Bruce"):\
pass\
\
\
This code sets up a base class called Philosopher that defines a custom behavior for its subclasses when they are created. \
The default_name parameter allows each subclass to have a default name attribute, and the AustralianPhilosopher subclass demonstrates the usage by setting its default_name to "Bruce".\
\
12. The purpose of __set_name__() is to provide a hook for objects to perform any necessary initialization or setup when they are assigned to a class attribute. It allows the objects to be aware of their assigned name within the class they belong to, which can be useful for various purposes such as introspection or customization.\
\
13. The C3 linearization algorithm is a method used to determine the order in which base classes are searched for a particular attribute or method during multiple inheritance in Python. It ensures that the resolution order respects the consistency and priority of the inheritance hierarchy.\
\
14. MRO (Method Resolution Order) entries are resolved: This refers to the determination of the order in which base classes are searched for a particular attribute or method. The MRO defines the inheritance hierarchy and is calculated using the C3 linearization algorithm.\
\
15. Type annotations in Python refer to the practice of adding hints or metadata about the types of variables, function parameters, and return values in code. They are used to provide static type checking and improve code clarity, maintainability, and tooling support. They are optional and do not affect the runtime behavior of the code. Python remains a dynamically typed language, but type annotations allow developers to specify the expected types and enable type checking tools to catch potential errors.\
\
x: int = 5\
def add(a: int, b: int) -> int:\
return a + b\
\
16. The purpose of __class_getitem__() is to allow runtime parameterization of standard-library generic classes in order to more easily apply type hints to these classes.}
+100
View File
@@ -0,0 +1,100 @@
# A quick brain teaser
print('What has a head and a tail but no body?')
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
# A coin
+46
View File
@@ -0,0 +1,46 @@
class BoundedInt():
def __init__(self, i, min, max):
"""
Create a bounded integer.
Args:
i (int): The initial value of the integer.
min (int): The minimum value of the integer.
max (int): The maximum value of the integer.
"""
self.i = i
self.min = min
self.max = max
def __int__(self):
"""
Convert the bounded integer to int.
Returns:
int: The value of the bounded integer.
"""
return self.i
def __add__(self, other):
if isinstance(other, BoundedInt):
if self.i + other.i > self.max:
raise ValueError("Addition exceeds maximum value")
return BoundedInt(self.i + other.i, self.min, self.max)
elif isinstance(other, int):
if self.i + other > self.max:
raise ValueError("Addition exceeds maximum value")
return BoundedInt(self.i + other, self.min, self.max)
else:
raise TypeError("Unsupported operand type")
def __sub__(self, other):
if isinstance(other, BoundedInt):
if self.i - other.i < self.min:
raise ValueError("Subtraction exceeds minimum value")
return BoundedInt(self.i - other.i, self.min, self.max)
elif isinstance(other, int):
if self.i - other < self.min:
raise ValueError("Subtraction exceeds minimum value")
return BoundedInt(self.i - other, self.min, self.max)
else:
raise TypeError("Unsupported operand type")
+67
View File
@@ -0,0 +1,67 @@
from BoundedInt import BoundedInt
class BoundedIntTester:
def __init__(self):
pass
def test1(self):
bi1 = BoundedInt(0xdeadbeef, min = (0xdeadbeef-1), max = (0xdeadbeef+1))
if int(bi1) == 0xdeadbeef:
print(f"✅ Test 1 passed!")
else:
print(f"❌ Test 1 failed, int(bi1) = {int(bi1)}, expected 0xdeadbeef")
def test2(self):
"""
Test that addition works for two BoundedInts, and throws an error if the bounds are exceeded.
"""
bi2 = BoundedInt(1, min = 0, max = 1)
bi3 = BoundedInt(1, min = 0, max = 1)
try:
bi4 = bi2 + bi3 # 1 + 1 = 2, which is more than max = 1
print(f"❌ Test 2 failed!")
except ValueError as err:
print(f"✅ Test 2 passed!")
def test3(self):
"""
Test that addition works for two BoundedInts, and throws an error if the bounds are exceeded.
"""
bi4 = BoundedInt(1, min = 0, max = 1)
bi5 = BoundedInt(2, min = 0, max = -1)
try:
bi6 = bi4 - bi5 # 1 - 2 = (-1), which is less than min = 0
print(f"❌ Test 3 failed!")
except ValueError as err:
print(f"✅ Test 3 passed!")
def test4(self):
"""
Test that addition works for a BoundedInt and a regular int, and throws an error if the bounds are exceeded.
"""
bi7 = BoundedInt(1, min = 0, max = 1)
bi8 = 2
try:
bi9 = bi7 + bi8
print(f"❌ Test 4 failed!")
except ValueError as err:
print(f"✅ Test 4 passed!")
def test5(self):
"""
Test that subtraction works for a BoundedInt and a regular int, and throws an error if the bounds are exceeded.
"""
bi10 = BoundedInt(1, min = 0, max = 1)
bi11 = 2
try:
bi12 = bi10 - 11
print(f"❌ Test 5 failed!")
except ValueError as err:
print(f"✅ Test 5 passed!")
tester = BoundedIntTester()
tester.test1()
tester.test2()
tester.test3()
tester.test4()
tester.test5()
@@ -0,0 +1,2 @@
import sys
print(sys.float_info)
+37
View File
@@ -0,0 +1,37 @@
{\rtf1\ansi\ansicpg1252\cocoartf2580
\cocoatextscaling0\cocoaplatform0{\fonttbl\f0\fnil\fcharset0 HelveticaNeue;\f1\fnil\fcharset0 Menlo-Regular;}
{\colortbl;\red255\green255\blue255;\red0\green0\blue0;\red0\green0\blue0;}
{\*\expandedcolortbl;;\cssrgb\c0\c0\c0\c87059;\cssrgb\c0\c0\c0\c3922;}
\margl1440\margr1440\vieww11520\viewh8400\viewkind0
\deftab720
\pard\pardeftab720\partightenfactor0
\f0\fs32 \cf2 \expnd0\expndtw0\kerning0
1. What is the name of the international standard for floating-point representation?\
\
The IEEE-754 standard describes floating-point formats, a way to represent real numbers in hardware.\
\
\
2. How many bits are the floating point numbers defined by that standard allowed to be?\
\
The floating-point numbers defined by the international standard can be allowed to be of different lengths depending on the specific interchange format. For binary interchange, the formats can be 16 bits, 32 bits, 64 bits, and any multiple of 32 bits \uc0\u8805 128. For decimal interchange, the formats can be any multiple of 32 bits.\
\
\
3. Does your computer support all those formats? Can you think of an easy way to check with only one line of Python?\
\
import sys\
print(sys.float_info)\
\
scott@MacBook-Pro-6 python-bootcamp % python3 Floating_Point_Formats.py \
sys.float_info(max=1.7976931348623157e+308, max_exp=1024, max_10_exp=308, min=2.2250738585072014e-308, min_exp=-1021, min_10_exp=-307, dig=15, mant_dig=53, epsilon=2.220446049250313e-16, radix=2, rounds=1)\
\
\
\pard\pardeftab720\sa320\partightenfactor0
\cf2 4. Why doesn't this code give the same answers to the two multiplications?\
Because they are different operations. The normal Python multiplication operator will multiply two numbers together and return the product. The Pandas multiplication operator, on the other hand, performs element-wise multiplication on the corresponding columns in a DataFrame. In other words, it multiplies the first element in the first column with the first element in the second column, the second element in the first column with the second element in the second column, and so on. \
Floating-point arithmetic has a limited precision due to the finite number of bits used to represent floating-point numbers in binary format. This can lead to rounding errors and loss of precision in arithmetic operations, particularly with very large or very small numbers.\
\
5. You can use
\f1\fs27\fsmilli13600 \cf2 \cb3 sys.getsizeof
\f0\fs32 \cf2 \cb1 to see how large a Python object is. Does the size of a Python floating-point number change as it gets larger? Why or why not?\
The size of a Python floating-point number does not change as it gets larger. This is because Python uses a fixed number of bytes to represent floating-point numbers, regardless of their value.}
+54
View File
@@ -0,0 +1,54 @@
# Name three practical differences between Python strings and bytes.
# Using sys.getsizeof, see how the sizes may be different.
# Do emoji change this answer?
# Encoding
# Strings are created using Unicode character points.
# While bytes are used to represent actual bytes in memory, which can be encoded using ASCII or UTF-8.
# Usage
# Strings are usually used to represent text.
# While bytes are used to represent binary data.
# Memory Size
# Strings take up more memory than bytes, because they are Unicode-based and can contain any character.
# While bytes are limited to binary data.
print("---------------------------------------------")
print("This is the Memory Size test print out:")
import sys
my_string = "Hello, world!"
my_bytes = b'\x48\x65\x6c\x6c'
print(sys.getsizeof(my_string)) # Prints 62
print(sys.getsizeof(my_bytes)) # Prints 37
print()
print('Test the emoji:')
x = 'pizza' # Prints 54
y = b'pizza' # Prints 38
z = '🍕' #Prints 80
print(sys.getsizeof(x))
print(sys.getsizeof(y))
print(sys.getsizeof(z))
print("---------------------------------------------")
print("This is the String to Sequence of Numbers print out:")
def String_to_SequenceofNumbers():
my_string = input("Enter a string: ")
num_sequence = [ord(c) for c in my_string]
print(num_sequence)
if __name__ == "__main__":
String_to_SequenceofNumbers()
print("---------------------------------------------")
+63
View File
@@ -0,0 +1,63 @@
# 1. Why does ord("😀") give a different number than 0xf09f9880, which is what the hexdump of the same character yields?
#
# The ord() function returns the Unicode code point of a character as an integer, which is 128512 for the smiley face.
# However, the hexdump command, returns the UTF-8 encoding of character.
# The hexadecimal representation of 128512 is 0x1F600.
# The UTF-8 encoding of the "😀" character is represented by the sequence of bytes F0 9F 98 80 in hexadecimal.
# UTF-8 is one of the encoding schemes used to represent Unicode characters as binary data.
#
#
# 8. Hypothetical Situation: If the dataframe is not formatted or cleaned, while the column storing the tomoto sales data isn't named exactly same as 'Tomato_Sales'
# It will raise a KeyError instead.
#
#
# 9. The solution of the hypothetical situation from my question 8:
def read_tomato_sales(file_name):
data = pd.read_csv(file_name)
if not pd.api.types.is_numeric_dtype(data["Tomato_Sales"]):
raise TypeError("Tomato_Sales column should contain only numeric values")
total_sales = data.iloc[:, -1].sum() # This is the key
print(f"Total tomato sales: {total_sales}")
# read_tomato_sales("tomato_sales_error.csv")
# 10. Different human languages can use various character encodings such as UTF-8, UTF-16, or ASCII.
# While using bytes, you can work with raw data without worrying about specific encodings.
# This allows us to avoid encoding-related errors and ensures compatibility across different language texts.
def encode_decode_data():
print('-' * 20)
data = input("Enter a sentence using any language: ")
print('-' * 20)
print("The sentence you entered is: {}".format(data))
print('-' * 20)
encoded_data = data.encode('utf-8')
print("This sentence after encoded is: {}".format(encoded_data))
print('-' * 20)
byte_length = len(encoded_data)
print("The byte length of this sentence is: {}".format(byte_length))
print('-' * 20)
decoded_data = encoded_data.decode()
print("This sentence after decoded is: {}".format(decoded_data))
print('-' * 20)
if __name__ == "__main__":
run_function = 'function1'
if run_function == 'function1':
encode_decode_data()
elif run_function == 'function2':
read_tomato_sales(file_name)
# 2.5. REPL stands for Read-Eval-Print Loop.
# A REPL is an interactive programming environment that allows you to read input, evaluate expressions or statements, print output, and repeat the process.
# It provides a quick way to experiment with code, test small snippets, and get immediate feedback.
# The Python REPL allows you to interactively enter Python code and see the results immediately without needing to write a full script and execute it separately.
# 3. The '_' is a convention that holds the value of the last printed expression or the result of the last evaluated expression.
# The actual type of the "_" variable depends on the value assigned to it.
+147
View File
@@ -0,0 +1,147 @@
# 1. Annotate the following python expressions with the specific types of each literal, as well as the overall return value:
# i = 3
# f = 3.0
# c = 3+3j
# b = b'abcdefg'
# s = 'abcdefg'
# s = "abcdefg"
i = 3
f = 3.0
c = 3+3j
b = b'abcdefg'
s1 = 'abcdefg'
s2 = "abcdefg"
def check_the_datatype():
print()
print('This is the answer for Q1:')
print()
variable_names = ['i', 'f', 'c', 'b', 's1', 's2']
data_list = [i, f, c, b, s1, s2]
for variable, data in zip(variable_names, data_list):
print("The type of this assigned value {} = {} is: {}".format(variable, data, type(data).__name__))
# 2. For each of the types string, bytestring, integer, floating point, and imaginary literals,
# construct a 5x5 table showing what happens when the character "0" or number 0 is compared to each other type
from tabulate import tabulate
from termcolor import colored
from tabulate import tabulate
from termcolor import colored
def tablesQ2():
print()
print('-' * 20)
print()
print('This is the answer for Q2:')
print()
types = ["String", "Byte String", "Integer", "Floating Point", "Imaginary"]
literals = ['"0"', 'b"0"', '0', '0.0', '0j']
table_data = []
for type_ in types:
row = [type_]
for literal in literals:
if type_ == "String":
result = literal == '"0"'
elif type_ == "Byte String":
result = literal.encode() == b"0"
elif type_ == "Integer":
try:
result = int(literal) == 0
except ValueError:
result = False
elif type_ == "Floating Point":
try:
result = float(literal) == 0.0
except ValueError:
result = False
elif type_ == "Imaginary":
result = literal.replace('j', 'j0') == "0j"
color = 'green' if result else 'red'
colored_result = colored(result, color)
row.append(colored_result)
table_data.append(row)
table = tabulate(table_data, headers=["Type"] + literals, tablefmt="pipe")
print(table)
# 3. Now do the same thing for the + and == operators for each pair of types in two other 5x5 tables.
def tablesQ3():
print()
print('-' * 20)
print()
print('This is the answer for Q3:')
print()
operators = ["+", "=="]
types = ["str", "bytes", "int", "float", "complex"]
literals = ['"0"', 'b"0"', '0', '0.0', '0+0j']
for operator in operators:
print(f"Table for {operator} Operator:")
table_data = []
for type_ in types:
row = [type_]
for literal in literals:
try:
result = eval(f"{literal} {operator} {type_}({literal})")
color = 'green'
except TypeError:
result = False
color = 'red'
colored_result = colored(result, color)
row.append(colored_result)
table_data.append(row)
table = tabulate(table_data, headers=["Type"] + literals, tablefmt="pipe")
print(table)
print()
# Write a small program that uses the AST module to open the lexer/parser example, and dumps the resulting AST.
# See if there are any arguments to the parse method which make the output easier to read.
# By default, ast.dump() prints the AST in a compact format.
# However, there are two optional arguments that can enhance the readability:
# indent: Specifies the number of spaces to use for indentation. Setting it to a positive integer (e.g., 4) indents each level of the AST by that amount.
# annotate_fields: When set to True, adds field names as comments to the output, making it easier to identify each part of the AST.
import ast
def dump_ast(filename):
with open(filename, 'r') as file:
source_code = file.read()
try:
tree = ast.parse(source_code)
ast_dump = ast.dump(tree, indent=4, annotate_fields=True)
print(ast_dump)
except SyntaxError as e:
print(f"Syntax error in {filename}: {e}")
if __name__ == "__main__":
check_the_datatype()
tablesQ2()
tablesQ3()
print()
+91
View File
@@ -0,0 +1,91 @@
# 5. What does this do? print("\007") Can you figure out why?
# It is a ASCII Bell character.
# It generates a beep sound or a system alert depending on the platform and environment where the code is executed.
# It is often used to trigger attention or alert the user in certain situations or as a way to generate a simple sound signal in text-based interfaces.
# BUT NOTHING HAPPENED ON MAC.
# 6. What does this do? print("abcdefg\rhijklmnop") Can you figure out why?
# '\r' is a carriage return character
# When the string is printed, the carriage return character '\r' causes the cursor to return to the beginning of the line.
# So when "hijklmnop" is printed, the cursor moves back to the start of the line, and the subsequent text "abcdefg" overwrites the initial characters.
# The output is gonna be 'hijklmnop'.
# 7. To shut down the HTTP server afterward, using Ctrl + C to interrupt the execution of the Python program.
import http.server
import socketserver
from urllib.parse import urlparse, parse_qs
class MyRequestHandler(http.server.SimpleHTTPRequestHandler):
def do_GET(self):
self.send_response(200)
self.send_header('Content-type', 'text/plain')
self.end_headers()
output_string = "abcdefg\rhijklmnop"
self.wfile.write(output_string.encode())
PORT = 8000
Handler = MyRequestHandler
httpd = socketserver.TCPServer(("", PORT), Handler)
print(f"Serving on port {PORT}")
httpd.serve_forever()
# The HTTP server sends the response over the network to the client, which is typically a web browser.
# In this function, the server sends an HTTP response with a status code of 200 and a content type of "text/plain".
# The response body is set to the string "abcdefg\rhijklmnop" encoded as bytes.
# When the client receives this response, it interprets the \r character as a normal character and displays the entire string "abcdefg\rhijklmnop" as it is.
# The '\r' character is a carriage return character, which is a control character used to return the cursor to the beginning of the current line.
# The behavior of the carriage return character '\r' can depend on the platform and how the output is handled.
# For example:
# In Safari and Chrome, the "http://localhost:8000" shows:
# abcdefg
# hijklmnop
# In Macbook Terminal, the "curl http://localhost:8000" shows:
# hijklmnop%
# 8. Think of a way someone might try to commit a crime or hide an embezzlement scheme using the answers to the above two questions.
# The key is by manipulating or altering the output displayed on a web page versus what is actually happening in the system.
# Case 1:
# Show the false financial transactions to earn the cut.
# Case 2:
# Delivey the heist planning details and hide any suspicious activity.
# Case 3:
# Overwrite the previously displayed information for the false testimony purpose.
# 9. Think of how you would do input validation to prevent such a crime. Replace the code REPLACE ME here so the tests pass:
def validate(input_str):
if '\r' in input_str or '\n' in input_str:
raise ValueError("Crime detected!")
try:
validate("abcdefg")
print("✅ test1 pass!")
except ValueError:
print("❌ test1 fail!")
try:
validate("abcdefg\rhijklmnop")
print("❌ test2 fail!")
except ValueError:
print("✅ test2 pass!")
# Test 1 pass means there is no ValueError
# Test 2 pass means the ValueError has been detected
+76
View File
@@ -0,0 +1,76 @@
########## This file only contains the question 2, 4, and 10. The rest is in the BoundedInt.py. ##########
# 2. Modify the template to pass test 1, which checks that int() called on your class will return the value of i.
# class BoundedInt():
# def __init__(self, i, min, max):
# """
# Create a bounded integer.
# Args:
# i (int): The initial value of the integer.
# min (int): The minimum value of the integer.
# max (int): The maximum value of the integer.
# """
# self.i = i
# self.min = min
# self.max = max
# def __int__(self):
# """
# Convert the bounded integer to int.
# Returns:
# int: The value of the bounded integer.
# """
# return self.i
# 4. In that reading material, there's a sentence that starts with "For instance, to evaluate the expression x + y, "...
# What do you think the types of x and y are? Guess, without checking first.
# What are they, actually? You can use the debugger's local window to find out.
# x might be an instance of a class that has defined the __add__() method
# And y is the object that is compatible with the x instance for the addition operation.
class MyClass:
def __init__(self, value):
self.value = value
def __add__(self, other):
if isinstance(other, MyClass):
return MyClass(self.value + other.value)
elif isinstance(other, int):
return MyClass(self.value + other)
else:
raise TypeError("Unsupported operand type.")
# Example usage
obj1 = MyClass(5)
obj2 = MyClass(10)
result1 = obj1 + obj2 # Calls obj1.__add__(obj2)
print(result1.value) # Output: 15
result2 = obj1 + 3 # Calls obj1.__add__(3)
print(result2.value) # Output: 8
# 10. Think about how you would change the template so it could allow adding a BoundedInt to an emoji,
# if there was a hypothetical function sentiment(emoji) which returned a floating point number from -10.0 to 10.0
# which indicated whether the emoji was happy or sad. e.g. BoundedInt(1, min = 1, max = 10) + 😁 would raise ValueError.
# By adding the conceptional function 'sentiment(emoji)' in the '__add__()' method
# The sentiment will analyze the happy level of the input emoji and return a floating number from a number range
# For example:
# 10 for a 😊 smiley face
# -10 for a frowny face
# 0 for a 🍕
# The protential code can be like this:
'''
elif isinstance(other, str) and sentiment(other) < 0:
aise ValueError("Cannot add a BoundedInt to a sad emoji")
'''
+77
View File
@@ -0,0 +1,77 @@
########## Some commands in pdb ##########
# help: Display a list of available pdb commands or get help on a specific command.
# break or b: Set a breakpoint at a specific line or function.
# continue or c: Continue execution until the next breakpoint or the program finishes.
# step or s: Step into the next line of code, diving into function calls.
# next or n: Step over the next line of code, without diving into function calls.
# return or r: Continue execution until the current function returns.
# list or l: Show the current line of code and surrounding lines.
# print or p: Evaluate and print the value of an expression or variable.
# watch: Set a watchpoint on an expression or variable. The debugger will break when the value changes.
# quit or q: Quit the debugger and stop execution.
########## There is a main() function at the end ##########
# 2. Provide an example script where setting a breakpoint on a particular line
# Then using either step over or step into will yield the same result.
class Same_StepOverStepInto_Result:
def calculation2(self, a, b):
result = a + b
product = self.multiply(a, b) # Step into this method call
breakpoint() # Set a breakpoint here
print(f"The sum is: {result}")
print(f"The product is: {product}")
def multiply(self, x, y):
return x * y
# calculator2 = Same_StepOverStepInto_Result()
# calculator2.calculation2(6, 7)
# 3. Here is another example which will provide different results from 'step' and 'next' commands
class Diff_StepOverStepInto_Result:
def multiply(self, a, b):
return a * b
def calculation3(self, a, b):
result = a + b
breakpoint() # Set a breakpoint here
product = self.multiply(a, b)
print(f"The sum is: {result}")
print(f"The product is: {product}")
# calculator3 = Diff_StepOverStepInto_Result()
# calculator3.calculation3(6, 7)
# Choose wich Class to run
def main():
choice = input("Enter 2 to run Q2 class for same result, 3 to run Q3 class for different result: ")
if choice == '2':
print('Here is the sample task for Question 2:')
calculator2 = Same_StepOverStepInto_Result()
calculator2.calculation2(6, 7)
elif choice == '3':
print('Here is the sample task for Question 3:')
calculator3 = Diff_StepOverStepInto_Result()
calculator3.calculation3(6, 7)
else:
print("Please only choose between 2 and 3")
if __name__ == "__main__":
main()
+79
View File
@@ -0,0 +1,79 @@
class Vector_1:
def __init__(self, x, y):
self.x = x
self.y = y
def __add__(self, other):
if isinstance(other, Vector_1):
# Add the corresponding coordinates of both vectors
new_x = self.x + other.x
new_y = self.y + other.y
return Vector_1(new_x, new_y)
else:
raise TypeError("Unsupported operand type: +")
def __str__(self):
return f"Vector({self.x}, {self.y})"
# # Create two Vector instances
# vector1 = Vector_1(2, 3)
# vector2 = Vector_1(4, 5)
# # Add two Vector instances using the + operator
# result1 = vector1 + vector2
# # Print the result
# print(result1)
class Vector_2:
def __init__(self, x, y):
self.x = x
self.y = y
def __add__(self, other):
if isinstance(other, Vector_2):
# Add the corresponding coordinates of both vectors
new_x = self.x + other.x
new_y = self.y + other.y
return Vector_2(new_x, new_y)
else:
raise TypeError("Unsupported operand type: +")
# def __str__(self):
# return f"Vector({self.x}, {self.y})"
# # Create two Vector instances
# vector3 = Vector_2(2, 3)
# vector4 = Vector_2(4, 5)
# # Add two Vector instances using the + operator
# result2 = vector3 + vector4
# # Print the result
# print(result2)
def main():
# Create two Vector instances
vector1 = Vector_1(2, 3)
vector2 = Vector_1(4, 5)
# Add two Vector instances using the + operator
result1 = vector1 + vector2
# Print the result
print("This is printout of the Class using __str__() method:")
print(result1)
# Create two Vector instances
vector3 = Vector_2(2, 3)
vector4 = Vector_2(4, 5)
# Add two Vector instances using the + operator
result2 = vector3 + vector4
# Print the result
print("This is printout of the Class without using __str__() method:")
print(result2)
if __name__ == "__main__":
main()
+56
View File
@@ -0,0 +1,56 @@
{\rtf1\ansi\ansicpg1252\cocoartf2580
\cocoatextscaling0\cocoaplatform0{\fonttbl\f0\fswiss\fcharset0 Helvetica;}
{\colortbl;\red255\green255\blue255;}
{\*\expandedcolortbl;;}
\margl1440\margr1440\vieww11520\viewh8400\viewkind0
\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardirnatural\partightenfactor0
\f0\fs24 \cf0 scott@MacBook-Pro-6 Scott_Submissions % python3 HW7.py\
Enter 2 to run Q2 class for same result, 3 to run Q3 class for different result: 1\
Please only choose between 2 and 3\
scott@MacBook-Pro-6 Scott_Submissions % python3 HW7.py\
Enter 2 to run Q2 class for same result, 3 to run Q3 class for different result: 2\
Here is the sample task for Question 2:\
> /Users/scott/Desktop/GTSP/python-bootcamp/Scott_Submissions/HW7.py(27)calculation2()\
-> print(f"The sum is: \{result\}")\
(Pdb) step\
The sum is: 13\
> /Users/scott/Desktop/GTSP/python-bootcamp/Scott_Submissions/HW7.py(28)calculation2()\
-> print(f"The product is: \{product\}")\
(Pdb) c\
The product is: 42\
scott@MacBook-Pro-6 Scott_Submissions % python3 HW7.py\
Enter 2 to run Q2 class for same result, 3 to run Q3 class for different result: 2\
Here is the sample task for Question 2:\
> /Users/scott/Desktop/GTSP/python-bootcamp/Scott_Submissions/HW7.py(27)calculation2()\
-> print(f"The sum is: \{result\}")\
(Pdb) next\
The sum is: 13\
> /Users/scott/Desktop/GTSP/python-bootcamp/Scott_Submissions/HW7.py(28)calculation2()\
-> print(f"The product is: \{product\}")\
(Pdb) c\
The product is: 42\
scott@MacBook-Pro-6 Scott_Submissions % python3 HW7.py\
Enter 2 to run Q2 class for same result, 3 to run Q3 class for different result: 3\
Here is the sample task for Question 3:\
> /Users/scott/Desktop/GTSP/python-bootcamp/Scott_Submissions/HW7.py(50)calculation3()\
-> product = self.multiply(a, b)\
(Pdb) step\
--Call--\
> /Users/scott/Desktop/GTSP/python-bootcamp/Scott_Submissions/HW7.py(42)multiply()\
-> def multiply(self, a, b):\
(Pdb) c\
The sum is: 13\
The product is: 42\
scott@MacBook-Pro-6 Scott_Submissions % python3 HW7.py\
Enter 2 to run Q2 class for same result, 3 to run Q3 class for different result: 3\
Here is the sample task for Question 3:\
> /Users/scott/Desktop/GTSP/python-bootcamp/Scott_Submissions/HW7.py(50)calculation3()\
-> product = self.multiply(a, b)\
(Pdb) next\
> /Users/scott/Desktop/GTSP/python-bootcamp/Scott_Submissions/HW7.py(52)calculation3()\
-> print(f"The sum is: \{result\}")\
(Pdb) c\
The sum is: 13\
The product is: 42\
scott@MacBook-Pro-6 Scott_Submissions % }
+18
View File
@@ -0,0 +1,18 @@
import pandas as pd
import numpy as np
# Generate two random 64-bit integers
num1 = np.random.randint(0, 10 - 1)
num2 = np.random.randint(0, 10 - 1)
# Multiply them together using the normal Python multiplication operator
print(f"num1 * num2 = {num1 * num2}")
# Create a Pandas DataFrame with the generated numbers
data = {'Number1': [num1], 'Number2': [num2]}
df = pd.DataFrame(data)
# Multiply the numbers together using the Pandas multiplication operator
df['Product'] = df['Number1'] * df['Number2']
print(df)
+4
View File
@@ -0,0 +1,4 @@
import sys
num = 99999999999
size = sys.getsizeof(num)
print(f"The size of the float is {size} bytes.")
+89
View File
@@ -0,0 +1,89 @@
# import sys
# # Python 3
# print(sys.maxsize) # Output: 9223372036854775807 (on most platforms)
# list1 = [1, 2, 3, 4, 6]
# list2 = [2, 4, 6, 7, 8]
# # Find common values
# common_values = []
# for item in list1:
# if item in list2:
# common_values.append(item)
# # Find different values
# different_values = []
# for item in list1:
# if item not in list2:
# different_values.append(item)
# for item in list2:
# if item not in list1:
# different_values.append(item)
# print("Common values:", common_values) # Common values: [2, 4, 6]
# print("Different values:", different_values) # Different values: [1, 3, 7, 8]
# # Find common values
# common_values = set(list1) & set(list2)
# # Find different values
# different_values = set(list1) ^ set(list2)
# print("Common values:", common_values)
# print("Different values:", different_values)
# def outer_function():
# outer_variable = 10
# def inner_function():
# inner_variable = 20
# print("Inner function: ", inner_variable)
# print("Outer function (captured variable): ", outer_variable)
# return inner_function
# # Create a closure by calling the outer function
# closure = outer_function()
# # Access the cell object from the closure
# cell_object = closure.__closure__[0]
# # Access and print the value stored in the cell
# print("Cell contents: ", cell_object.cell_contents)
# # Set a new value to the cell
# cell_object.cell_contents = 30
# # Access and print the updated value from the closure
# print("Updated cell contents: ", closure.__closure__[0].cell_contents)
def greet(name):
message = f"Hello, {name}!"
print(message)
# Accessing code object
code_obj = greet.__code__
print(code_obj.co_name) # Output: greet
print(code_obj.co_argcount) # Output: 1 (number of arguments)
print(code_obj.co_varnames) # Output: ('name', 'message')
# Accessing function object
print(greet.__name__) # Output: greet
print(greet.__defaults__) # Output: None (no default arguments)
print(greet.__globals__) # Output: {'__name__': '__main__', ...} (global namespace)
# Modifying function object attributes
greet.__name__ = 'say_hello'
greet.__defaults__ = ('John',)
greet.__globals__['message'] = 'Welcome!'
# Call the modified function
greet() # Output: Hello, John!
+7
View File
@@ -0,0 +1,7 @@
import time
i=0
while True:
print(f"\015{i=}", end='')
i += 1
time.sleep(0.2)
+28
View File
@@ -0,0 +1,28 @@
import pdb
def calculate_average(numbers):
total = sum(numbers)
average = total / len(numbers)
return average
def main():
data = [1, 2, 3, 4, 5]
pdb.set_trace()
result = calculate_average(data)
print("The average is:", result)
pdb.set_trace() # Set a breakpoint at this line
print("Program execution resumed.")
# ... continue with the rest of your code
if __name__ == '__main__':
main()
# n or next: Execute the next line of code.
# s or step: Step into a function call.
# c or continue: Continue execution until the next breakpoint or the program's end.
# p or print: Print the value of a variable.
# q or quit: Quit the debugger and exit the program.
+5
View File
@@ -0,0 +1,5 @@
char1 = "u"
result1 = ord(char1)
print("ASCII value of the character {} is {}.".format(char1, result1))
+78
View File
@@ -0,0 +1,78 @@
{
"cells": [
{
"cell_type": "code",
"execution_count": null,
"id": "0593e529",
"metadata": {},
"outputs": [],
"source": [
"import os\n",
"from urllib.parse import urlparse\n",
"\n",
"class JPEGRequestHandler:\n",
" def __init__(self, app):\n",
" self.app = app\n",
"\n",
" def __call__(self, environ, start_response):\n",
" url = urlparse(environ['REQUEST_URI'])\n",
" path = url.path\n",
"\n",
" if path.endswith('.jpg'):\n",
" file_path = path[1:]\n",
"\n",
" if os.path.isfile(file_path):\n",
" with open(file_path, 'rb') as file:\n",
" response_body = file.read()\n",
" status = '200 OK'\n",
" headers = [('Content-type', 'image/jpeg'),\n",
" ('Content-Length', str(len(response_body)))]\n",
"\n",
" start_response(status, headers)\n",
" return [response_body]\n",
" else:\n",
" status = '404 Not Found'\n",
" headers = [('Content-type', 'text/plain'),\n",
" ('Content-Length', '0')]\n",
"\n",
" start_response(status, headers)\n",
" return []\n",
" else:\n",
" status = '403 Forbidden'\n",
" headers = [('Content-type', 'text/plain'),\n",
" ('Content-Length', '0')]\n",
"\n",
" start_response(status, headers)\n",
" return []\n",
"\n",
"if __name__ == '__main__':\n",
" from werkzeug.serving import run_simple\n",
" from werkzeug.middleware.dispatcher import DispatcherMiddleware\n",
"\n",
" app = DispatcherMiddleware(JPEGRequestHandler(app), {'/': app})\n",
" run_simple('0.0.0.0', 8000, app, use_reloader=True)"
]
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.9.13"
}
},
"nbformat": 4,
"nbformat_minor": 5
}
+44
View File
@@ -0,0 +1,44 @@
import os
from urllib.parse import urlparse
class JPEGRequestHandler:
def __init__(self, app):
self.app = app
def __call__(self, environ, start_response):
url = urlparse(environ['REQUEST_URI'])
path = url.path
if path.endswith('.jpg'):
file_path = path[1:]
if os.path.isfile(file_path):
with open(file_path, 'rb') as file:
response_body = file.read()
status = '200 OK'
headers = [('Content-type', 'image/jpeg'),
('Content-Length', str(len(response_body)))]
start_response(status, headers)
return [response_body]
else:
status = '404 Not Found'
headers = [('Content-type', 'text/plain'),
('Content-Length', '0')]
start_response(status, headers)
return []
else:
status = '403 Forbidden'
headers = [('Content-type', 'text/plain'),
('Content-Length', '0')]
start_response(status, headers)
return []
if __name__ == '__main__':
from werkzeug.serving import run_simple
from werkzeug.middleware.dispatcher import DispatcherMiddleware
app = DispatcherMiddleware(JPEGRequestHandler(app), {'/': app})
run_simple('0.0.0.0', 8000, app, use_reloader=True)
+31
View File
@@ -0,0 +1,31 @@
import os
from http.server import SimpleHTTPRequestHandler, HTTPServer
from urllib.parse import urlparse
class JPEGRequestHandler(SimpleHTTPRequestHandler):
def do_GET(self):
url = urlparse(self.path)
path = url.path
if path.endswith('.jpg'):
file_path = path[1:]
if os.path.isfile(file_path):
self.send_response(200)
self.send_header('Content-Type', 'image/jpeg')
self.end_headers()
with open(file_path, 'rb') as file:
self.wfile.write(file.read())
else:
self.send_error(404, 'File not found')
else:
self.send_error(403, 'Only .jpg files are allowed')
def run(server_class=HTTPServer, handler_class=JPEGRequestHandler, port=8000):
server_address = ('', port)
httpd = server_class(server_address, handler_class)
print(f'Serving JPEGs on port {port}...')
httpd.serve_forever()
if __name__ == '__main__':
run()
+146
View File
@@ -0,0 +1,146 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>D3.js Image Loading Time Graph</title>
<script src="https://d3js.org/d3.v5.min.js"></script>
<style>
/* Add some basic styling for the chart */
.bar {
fill: steelblue;
}
.bar:hover {
fill: brown;
}
.axis {
font: 10px sans-serif;
}
.axis path,
.axis line {
fill: none;
stroke: #000;
shape-rendering: crispEdges;
}
</style>
</head>
<body>
<div id="chart"></div>
<div id="stats"></div>
<script>
// Generate the list of image URLs named kublai0.jpg to kublai118.jpg
const numberOfImages = 119;
const imagePrefix = 'http://localhost:8000/kublai';
const imageExtension = '.jpg';
const images = [];
for (let i = 0; i < numberOfImages; i++) {
const imageName = `${imagePrefix}${i}${imageExtension}`;
images.push(imageName);
}
// Disable caching using cache-buster technique
const cacheBuster = (url) => `${url}?${new Date().getTime()}`;
// Load images and measure their loading times
const loadImages = async () => {
const loadingTimes = [];
for (const url of images) {
const startTime = performance.now();
const img = new Image();
img.src = cacheBuster(url);
img.style.display = 'none';
document.body.appendChild(img);
await new Promise((resolve) => {
img.onload = () => {
const endTime = performance.now();
loadingTimes.push(endTime - startTime);
resolve();
};
});
}
return loadingTimes;
};
// Create a D3.js bar chart to visualize loading times
const createChart = (data) => {
const margin = { top: 20, right: 20, bottom: 30, left: 40 },
width = 1280 - margin.left - margin.right,
height = 500 - margin.top - margin.bottom;
const x = d3.scaleBand().rangeRound([0, width]).padding(0.1);
const y = d3.scaleLinear().rangeRound([height, 0]);
const svg = d3.select('#chart')
.append('svg')
.attr('width', width + margin.left + margin.right)
.attr('height', height + margin.top + margin.bottom)
.append('g')
.attr('transform', `translate(${margin.left},${margin.top})`);
x.domain(data.map((d, i) => i));
y.domain([0, d3.max(data)]);
svg.append('g')
.attr('class', 'axis axis--x')
.attr('transform', `translate(0,${height})`)
.call(d3.axisBottom(x));
svg.append('g')
.attr('class', 'axis axis--y')
.call(d3.axisLeft(y).ticks(10))
.append('text')
.attr('transform', 'rotate(-90)')
.attr('y', 6)
.attr('dy', '0.71em')
.attr('text-anchor', 'end')
.text('Loading Time (ms)');
svg.selectAll('.bar')
.data(data)
.enter().append('rect')
.attr('class', 'bar')
.attr('x', (d, i) => x(i))
.attr('y', (d) => y(d))
.attr('width', x.bandwidth())
.attr('height', (d) => height - y(d));
const stats = document.getElementById('stats');
let textContent = '';
let average = 0;
let sum = 0;
let min = parseFloat(data[0]);
let max = parseFloat(data[0]);
for(datum of data) {
loadingTime = parseFloat(datum)
sum = sum + loadingTime
if(loadingTime > max) {
max = loadingTime;
}
if(loadingTime < min) {
min = loadingTime;
}
}
average = sum / data.length
textContent =
'Total: ' + sum +
' Average: ' + average +
' Min: ' + min +
' Max: ' + max;
stats.textContent = textContent;
};
// Load images and create the chart
(async () => {
const loadingTimes = await loadImages();
createChart(loadingTimes);
})();
</script>
</body>
</html>
Binary file not shown.

After

Width:  |  Height:  |  Size: 46 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 66 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 51 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 44 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 60 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 92 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 43 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 47 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 65 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 78 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 46 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 36 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 54 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 42 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 63 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 48 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 58 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 51 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 76 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 55 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 60 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 45 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 52 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 58 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 76 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 36 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 52 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 45 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 124 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 35 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 59 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 107 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 75 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 28 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 33 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 69 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 59 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 42 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 26 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 29 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 38 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 34 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 63 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 55 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 62 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 32 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 64 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 90 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 94 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 59 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 60 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 32 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 53 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 70 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 59 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 61 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 52 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 77 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 72 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 76 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 55 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 167 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 40 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 29 KiB

Some files were not shown because too many files have changed in this diff Show More