Are you over 18 and want to see adult content?
5
More Annotations
A complete backup of jestemmobilny.pl
jestemmobilny.pl
Are you over 18 and want to see adult content?
1
A complete backup of getrocketbook.com
getrocketbook.com
Are you over 18 and want to see adult content?
A complete backup of haworthpress.com
haworthpress.com
Are you over 18 and want to see adult content?
6
Favourite Annotations
5
A complete backup of www.lalibre.be/international/europe/75-ans-apres-la-liberation-les-survivants-d-auschwitz-lancent-un-averti
www.lalibre.be/international/europe/75-ans-apres-la-liberation-les-survivants-d-auschwitz-lancent-un-avertissement-5e2eb9caf20d5a719a6e9584
Are you over 18 and want to see adult content?
5
Text
ARTEM GOLUBIN (RUSHTER) Artem Golubin. Hi! I'm a Software Engineer located in Russia. My current technical interests are Machine learning, NLP, web security, Python, information extraction, network protocols, and software internals. Github. Email. Kaggle. Twitter. UNDERSTANDING INTERNALS OF PYTHON CLASSES Understanding internals of Python classes. The goal of this series is to describe internals and general concepts behind the class object in Python 3.6. In this part, I will explain how Python stores and lookups attributes. I assume that you already have a HOW TO TRACK AND DISPLAY PROFILE VIEWS ON GITHUB As part of recent design changes, GitHub has introduced READMEs for profiles. By creating a repo with your name and adding README.md file with markdown to it, you can now add a rich description of yourself.. Here is an example of how it looks like: HOW VIRTUAL ENVIRONMENT LIBRARIES WORK IN PYTHON Have you ever wondered what happens when you activate a virtual environment and how it works internally? Here is a quick overview of internals behind popular virtual environments, e.g., virtualenv, virtualenvwrapper, conda, pipenv. HOW PANDAS INFERS DATA TYPES WHEN PARSING CSV FILES I'm not blaming pandas for this; it's just that the CSV is a bad format for storing data. Type specification. Pandas allows you to explicitly define types of the columns using dtype parameter. However, the converting engine always uses "fat" data types, such as int64 and float64. So even if you specify that your column has an int8 type, at first, your data will be parsed using an int64 EXTRACTING TEXT FROM HTML IN PYTHON: A VERY FAST APPROACH Clearly, it's not the best way to benchmark something, but it gives an idea that selectolax can be sometimes 30 times faster than lxml. I wrote selectolax half a year ago when I was looking for a fast HTML parser in Python.Basically, it is a Cython wrapper to the Modest engine. The engine itself is a very powerful and fast HTML5 parser written in pure C by lexborisov. DETECTING SQL INJECTIONS IN PYTHON CODE USING AST Detecting SQL injections using abstract syntax trees. The most common mistake that leads to SQL injections in Python code is using string formatting in SQL statements. To find an SQL injection in Python code, we need to search for string formatting in the execute or executemany function call. There are at least three ways to format a string in WRITING A SIMPLE SOCKS SERVER IN PYTHON Here the ThreadingTCPServer creates a threading version of TCP server and listens for incoming connections on a specified address and port. Every time there is a new incoming TCP connection (session) the server spawns a new thread with SocksProxy instance running inside it. It gives us an easy way to handle concurrent connections. GARBAGE COLLECTION IN PYTHON: THINGS YOU NEED TO KNOWSEE MORE ON
RUSHTER.COM
HOW NOT TO DEPLOY WEB APPLICATIONS Recently, I was looking for tutorials on how to deploy a Django application in 2018. After some research, I found an article which suggests using gunicorn behind nginx web server, which is a pretty standard way of doing it. However, one thing has caught my attention. ARTEM GOLUBIN (RUSHTER) Artem Golubin. Hi! I'm a Software Engineer located in Russia. My current technical interests are Machine learning, NLP, web security, Python, information extraction, network protocols, and software internals. Github. Email. Kaggle. Twitter. UNDERSTANDING INTERNALS OF PYTHON CLASSES Understanding internals of Python classes. The goal of this series is to describe internals and general concepts behind the class object in Python 3.6. In this part, I will explain how Python stores and lookups attributes. I assume that you already have a HOW TO TRACK AND DISPLAY PROFILE VIEWS ON GITHUB As part of recent design changes, GitHub has introduced READMEs for profiles. By creating a repo with your name and adding README.md file with markdown to it, you can now add a rich description of yourself.. Here is an example of how it looks like: HOW VIRTUAL ENVIRONMENT LIBRARIES WORK IN PYTHON Have you ever wondered what happens when you activate a virtual environment and how it works internally? Here is a quick overview of internals behind popular virtual environments, e.g., virtualenv, virtualenvwrapper, conda, pipenv. HOW PANDAS INFERS DATA TYPES WHEN PARSING CSV FILES I'm not blaming pandas for this; it's just that the CSV is a bad format for storing data. Type specification. Pandas allows you to explicitly define types of the columns using dtype parameter. However, the converting engine always uses "fat" data types, such as int64 and float64. So even if you specify that your column has an int8 type, at first, your data will be parsed using an int64 EXTRACTING TEXT FROM HTML IN PYTHON: A VERY FAST APPROACH Clearly, it's not the best way to benchmark something, but it gives an idea that selectolax can be sometimes 30 times faster than lxml. I wrote selectolax half a year ago when I was looking for a fast HTML parser in Python.Basically, it is a Cython wrapper to the Modest engine. The engine itself is a very powerful and fast HTML5 parser written in pure C by lexborisov. DETECTING SQL INJECTIONS IN PYTHON CODE USING AST Detecting SQL injections using abstract syntax trees. The most common mistake that leads to SQL injections in Python code is using string formatting in SQL statements. To find an SQL injection in Python code, we need to search for string formatting in the execute or executemany function call. There are at least three ways to format a string in WRITING A SIMPLE SOCKS SERVER IN PYTHON Here the ThreadingTCPServer creates a threading version of TCP server and listens for incoming connections on a specified address and port. Every time there is a new incoming TCP connection (session) the server spawns a new thread with SocksProxy instance running inside it. It gives us an easy way to handle concurrent connections. GARBAGE COLLECTION IN PYTHON: THINGS YOU NEED TO KNOWSEE MORE ONRUSHTER.COM
HOW NOT TO DEPLOY WEB APPLICATIONS Recently, I was looking for tutorials on how to deploy a Django application in 2018. After some research, I found an article which suggests using gunicorn behind nginx web server, which is a pretty standard way of doing it. However, one thing has caught my attention. ARTEM GOLUBIN (RUSHTER) Artem Golubin. Hi! I'm a Software Engineer located in Russia. My current technical interests are Machine learning, NLP, web security, Python, information extraction, network protocols, and software internals. Github. Email. Kaggle. Twitter. DATA SCIENCE BLOGS READER Rasslin’ over writin’ teachin’. By Statistical Modeling, Causal Inference, and Social Science, 22 hours ago. Pandas.Styler : Styling the Pandas DataFrame. By Analytics Vidhya, 1 day ago. AdaBoost : A Brief Introduction to Ensemble learning. By Analytics Vidhya, 1 day ago. OkCupid’s Dating Data Center. By Dataclysm, 1 day ago. EXTRACTING TEXT FROM HTML IN PYTHON: A VERY FAST APPROACH Clearly, it's not the best way to benchmark something, but it gives an idea that selectolax can be sometimes 30 times faster than lxml. I wrote selectolax half a year ago when I was looking for a fast HTML parser in Python.Basically, it is a Cython wrapper to the Modest engine. The engine itself is a very powerful and fast HTML5 parser written in pure C by lexborisov. OPTIMIZATION TRICKS IN PYTHON: LISTS AND TUPLES Allocation optimization for small tuples. To reduce memory fragmentation and speed up allocations, Python reuses old tuples. If a tuple no longer needed and has less than 20 items instead of deleting it permanently Python moves it to a free list.. A free list is divided into 20 groups, where each group represents a list of tuples of lengthn between 0 and 20.
HOW NUMBA AND CYTHON SPEED UP PYTHON CODE Unlike Numba, all Cython code should be separated from regular Python code in special files. Cython parses and translates such files to C code and then compiles it using provided C compiler (e.g. gcc ). Python code is already valid Cython code. def sum_sequence_cython(a, b): result = np.zeros_like(a) for i in range(len(a)): result = a- b
MEMORY MANAGEMENT IN PYTHON Block is a chunk of memory of a certain size. Each block can keep only one Python object of a fixed size. The size of the block can vary from 8 to 512 bytes and must be a multiple of eight (i.e., use 8-byte alignment). For convenience, such blocks are grouped in SPARSE DATA STRUCTURES IN PYTHON In Python, sparse data structures are implemented in scipy.sparse module, which mostly based on regular numpy arrays. Let's create a random sparse matrix and compare its size to an identical regular one: from scipy.sparse import random def get_sparse_size(matrix): # get size of a sparse matrix return int( (matrix.data.nbytes +matrix.indptr
HOW TO TURN AN ORDINARY GZIP ARCHIVE INTO A DATABASE The zcat command is an alias to gunzip -c.. Semi-random access. An ability to concatenate multiple archives is a very handy property. By exploiting this feature and trading a little bit of speed and disk space, we can achieve semi-random access. HOW PICKLE WORKS IN PYTHON How pickle works in Python. The pickle module implements serialization protocol, which provides an ability to save and later load Python objects using special binary format. Unlike json, pickle is not limited to simple objects. It can also store references to functionsand
ON CODE ISOLATION IN PYTHON Python modules and class definition use frames too. That is a building block of the call stack. Given a frame object, you can: Change locals, globals, and builtins at runtime. Get bytecode of a function (code block) that is being executed. Here is how you can list all frames in the current call stack: def list_frames(): current_frame = sys UNDERSTANDING INTERNALS OF PYTHON CLASSES Understanding internals of Python classes. The goal of this series is to describe internals and general concepts behind the class object in Python 3.6. In this part, I will explain how Python stores and lookups attributes. I assume that you already have a BLOG POSTS | ARTEM GOLUBIN Garbage collection in Python: things you need to know. python , cpython internals, memory, advanced python. HOW NUMBA AND CYTHON SPEED UP PYTHON CODE Unlike Numba, all Cython code should be separated from regular Python code in special files. Cython parses and translates such files to C code and then compiles it using provided C compiler (e.g. gcc ). Python code is already valid Cython code. def sum_sequence_cython(a, b): result = np.zeros_like(a) for i in range(len(a)): result = a- b
HOW PANDAS INFERS DATA TYPES WHEN PARSING CSV FILES I'm not blaming pandas for this; it's just that the CSV is a bad format for storing data. Type specification. Pandas allows you to explicitly define types of the columns using dtype parameter. However, the converting engine always uses "fat" data types, such as int64 and float64. So even if you specify that your column has an int8 type, at first, your data will be parsed using an int64 HOW VIRTUAL ENVIRONMENT LIBRARIES WORK IN PYTHON Have you ever wondered what happens when you activate a virtual environment and how it works internally? Here is a quick overview of internals behind popular virtual environments, e.g., virtualenv, virtualenvwrapper, conda, pipenv. EXTRACTING TEXT FROM HTML IN PYTHON: A VERY FAST APPROACH Clearly, it's not the best way to benchmark something, but it gives an idea that selectolax can be sometimes 30 times faster than lxml. I wrote selectolax half a year ago when I was looking for a fast HTML parser in Python.Basically, it is a Cython wrapper to the Modest engine. The engine itself is a very powerful and fast HTML5 parser written in pure C by lexborisov. HOW PICKLE WORKS IN PYTHON How pickle works in Python. The pickle module implements serialization protocol, which provides an ability to save and later load Python objects using special binary format. Unlike json, pickle is not limited to simple objects. It can also store references to functionsand
WRITING A SIMPLE SOCKS SERVER IN PYTHON Here the ThreadingTCPServer creates a threading version of TCP server and listens for incoming connections on a specified address and port. Every time there is a new incoming TCP connection (session) the server spawns a new thread with SocksProxy instance running inside it. It gives us an easy way to handle concurrent connections. GARBAGE COLLECTION IN PYTHON: THINGS YOU NEED TO KNOWSEE MORE ONRUSHTER.COM
PUBLIC SSH KEYS CAN LEAK YOUR PRIVATE INFRASTRUCTURE Public SSH keys can leak your private infrastructure. This article describes a minor security flaw in the SSH authentication protocol that can lead to unexpected private infrastructure disclosure. It also provides a PoC written in Python. Asymmetric cryptography, or public-key cryptography, is the most common way to identify andauthorize a
UNDERSTANDING INTERNALS OF PYTHON CLASSES Understanding internals of Python classes. The goal of this series is to describe internals and general concepts behind the class object in Python 3.6. In this part, I will explain how Python stores and lookups attributes. I assume that you already have a BLOG POSTS | ARTEM GOLUBIN Garbage collection in Python: things you need to know. python , cpython internals, memory, advanced python. HOW NUMBA AND CYTHON SPEED UP PYTHON CODE Unlike Numba, all Cython code should be separated from regular Python code in special files. Cython parses and translates such files to C code and then compiles it using provided C compiler (e.g. gcc ). Python code is already valid Cython code. def sum_sequence_cython(a, b): result = np.zeros_like(a) for i in range(len(a)): result = a- b
HOW PANDAS INFERS DATA TYPES WHEN PARSING CSV FILES I'm not blaming pandas for this; it's just that the CSV is a bad format for storing data. Type specification. Pandas allows you to explicitly define types of the columns using dtype parameter. However, the converting engine always uses "fat" data types, such as int64 and float64. So even if you specify that your column has an int8 type, at first, your data will be parsed using an int64 HOW VIRTUAL ENVIRONMENT LIBRARIES WORK IN PYTHON Have you ever wondered what happens when you activate a virtual environment and how it works internally? Here is a quick overview of internals behind popular virtual environments, e.g., virtualenv, virtualenvwrapper, conda, pipenv. EXTRACTING TEXT FROM HTML IN PYTHON: A VERY FAST APPROACH Clearly, it's not the best way to benchmark something, but it gives an idea that selectolax can be sometimes 30 times faster than lxml. I wrote selectolax half a year ago when I was looking for a fast HTML parser in Python.Basically, it is a Cython wrapper to the Modest engine. The engine itself is a very powerful and fast HTML5 parser written in pure C by lexborisov. HOW PICKLE WORKS IN PYTHON How pickle works in Python. The pickle module implements serialization protocol, which provides an ability to save and later load Python objects using special binary format. Unlike json, pickle is not limited to simple objects. It can also store references to functionsand
WRITING A SIMPLE SOCKS SERVER IN PYTHON Here the ThreadingTCPServer creates a threading version of TCP server and listens for incoming connections on a specified address and port. Every time there is a new incoming TCP connection (session) the server spawns a new thread with SocksProxy instance running inside it. It gives us an easy way to handle concurrent connections. GARBAGE COLLECTION IN PYTHON: THINGS YOU NEED TO KNOWSEE MORE ONRUSHTER.COM
PUBLIC SSH KEYS CAN LEAK YOUR PRIVATE INFRASTRUCTURE Public SSH keys can leak your private infrastructure. This article describes a minor security flaw in the SSH authentication protocol that can lead to unexpected private infrastructure disclosure. It also provides a PoC written in Python. Asymmetric cryptography, or public-key cryptography, is the most common way to identify andauthorize a
ARTEM GOLUBIN (RUSHTER) Artem Golubin. Hi! I'm a Software Engineer located in Russia. My current technical interests are Machine learning, NLP, web security, Python, information extraction, network protocols, and software internals. Github. Email. Kaggle. Twitter. DATA SCIENCE BLOGS READER Rasslin’ over writin’ teachin’. By Statistical Modeling, Causal Inference, and Social Science, 22 hours ago. Pandas.Styler : Styling the Pandas DataFrame. By Analytics Vidhya, 1 day ago. AdaBoost : A Brief Introduction to Ensemble learning. By Analytics Vidhya, 1 day ago. OkCupid’s Dating Data Center. By Dataclysm, 1 day ago. BLOG POSTS | ARTEM GOLUBIN Garbage collection in Python: things you need to know. python , cpython internals, memory, advanced python. HOW NUMBA AND CYTHON SPEED UP PYTHON CODE Unlike Numba, all Cython code should be separated from regular Python code in special files. Cython parses and translates such files to C code and then compiles it using provided C compiler (e.g. gcc ). Python code is already valid Cython code. def sum_sequence_cython(a, b): result = np.zeros_like(a) for i in range(len(a)): result = a- b
HOW TO TURN AN ORDINARY GZIP ARCHIVE INTO A DATABASE The zcat command is an alias to gunzip -c.. Semi-random access. An ability to concatenate multiple archives is a very handy property. By exploiting this feature and trading a little bit of speed and disk space, we can achieve semi-random access. HOW TO PATCH PYTHON BYTECODE How to patch Python's bytecode. The first number is the corresponding line number in the source code (thanks to co_lnotab).The next blocks contain three columns: an offset of the instruction in the bytecode, instruction name and an argument with a human-readable representation in parentheses (if any). PUBLIC SSH KEYS CAN LEAK YOUR PRIVATE INFRASTRUCTURE Public SSH keys can leak your private infrastructure. This article describes a minor security flaw in the SSH authentication protocol that can lead to unexpected private infrastructure disclosure. It also provides a PoC written in Python. Asymmetric cryptography, or public-key cryptography, is the most common way to identify andauthorize a
HOW PICKLE WORKS IN PYTHON How pickle works in Python. The pickle module implements serialization protocol, which provides an ability to save and later load Python objects using special binary format. Unlike json, pickle is not limited to simple objects. It can also store references to functionsand
GARBAGE COLLECTION IN PYTHON: THINGS YOU NEED TO KNOW Python needs to know when your object is no longer needed. Removing objects prematurely will result in a program crash. Garbage collections algorithms track which objects can be deallocated and pick an optimal time to deallocate them. Standard CPython's garbage collector has two components, the reference counting collector and thegenerational
PYTHON'S GIL IMPLEMENTED IN PURE PYTHON Python's GIL implemented in pure Python. There is an excellent presentation of how the modern GIL performs thread scheduling, but unfortunately, it lacks some interesting details (at least for me). I was trying to understand all the details of the GIL, and it took me some time to fully understand it from the CPython's source code. ARTEM GOLUBIN (RUSHTER) Artem Golubin. Hi! I'm a Software Engineer located in Russia. My current technical interests are Machine learning, NLP, web security, Python, information extraction, network protocols, and software internals. Github. Email. Kaggle. Twitter. DATA SCIENCE BLOGS READER Rasslin’ over writin’ teachin’. By Statistical Modeling, Causal Inference, and Social Science, 22 hours ago. Pandas.Styler : Styling the Pandas DataFrame. By Analytics Vidhya, 1 day ago. AdaBoost : A Brief Introduction to Ensemble learning. By Analytics Vidhya, 1 day ago. OkCupid’s Dating Data Center. By Dataclysm, 1 day ago. UNDERSTANDING INTERNALS OF PYTHON CLASSES Understanding internals of Python classes. The goal of this series is to describe internals and general concepts behind the class object in Python 3.6. In this part, I will explain how Python stores and lookups attributes. I assume that you already have a HOW TO TRACK AND DISPLAY PROFILE VIEWS ON GITHUB As part of recent design changes, GitHub has introduced READMEs for profiles. By creating a repo with your name and adding README.md file with markdown to it, you can now add a rich description of yourself.. Here is an example of how it looks like: HOW NUMBA AND CYTHON SPEED UP PYTHON CODE Unlike Numba, all Cython code should be separated from regular Python code in special files. Cython parses and translates such files to C code and then compiles it using provided C compiler (e.g. gcc ). Python code is already valid Cython code. def sum_sequence_cython(a, b): result = np.zeros_like(a) for i in range(len(a)): result = a- b
PYTHON INTERNALS: ARBITRARY-PRECISION INTEGER The ob_refcnt field is responsible for reference counting technique which is used in garbage collection mechanism, whereas ob_type is a pointer to a structure which describes an integer type.. Generally, In languages like C/C++, the precision of integers is limited to 64-bit, but Python has built-in support for Arbitrary-precision integers.Since Python 3 there is no longer simple integer type EXTRACTING TEXT FROM HTML IN PYTHON: A VERY FAST APPROACH Clearly, it's not the best way to benchmark something, but it gives an idea that selectolax can be sometimes 30 times faster than lxml. I wrote selectolax half a year ago when I was looking for a fast HTML parser in Python.Basically, it is a Cython wrapper to the Modest engine. The engine itself is a very powerful and fast HTML5 parser written in pure C by lexborisov. HOW PANDAS INFERS DATA TYPES WHEN PARSING CSV FILES I'm not blaming pandas for this; it's just that the CSV is a bad format for storing data. Type specification. Pandas allows you to explicitly define types of the columns using dtype parameter. However, the converting engine always uses "fat" data types, such as int64 and float64. So even if you specify that your column has an int8 type, at first, your data will be parsed using an int64 WRITING A SIMPLE SOCKS SERVER IN PYTHON Here the ThreadingTCPServer creates a threading version of TCP server and listens for incoming connections on a specified address and port. Every time there is a new incoming TCP connection (session) the server spawns a new thread with SocksProxy instance running inside it. It gives us an easy way to handle concurrent connections. GARBAGE COLLECTION IN PYTHON: THINGS YOU NEED TO KNOWSEE MORE ONRUSHTER.COM
ARTEM GOLUBIN (RUSHTER) Artem Golubin. Hi! I'm a Software Engineer located in Russia. My current technical interests are Machine learning, NLP, web security, Python, information extraction, network protocols, and software internals. Github. Email. Kaggle. Twitter. DATA SCIENCE BLOGS READER Rasslin’ over writin’ teachin’. By Statistical Modeling, Causal Inference, and Social Science, 22 hours ago. Pandas.Styler : Styling the Pandas DataFrame. By Analytics Vidhya, 1 day ago. AdaBoost : A Brief Introduction to Ensemble learning. By Analytics Vidhya, 1 day ago. OkCupid’s Dating Data Center. By Dataclysm, 1 day ago. UNDERSTANDING INTERNALS OF PYTHON CLASSES Understanding internals of Python classes. The goal of this series is to describe internals and general concepts behind the class object in Python 3.6. In this part, I will explain how Python stores and lookups attributes. I assume that you already have a HOW TO TRACK AND DISPLAY PROFILE VIEWS ON GITHUB As part of recent design changes, GitHub has introduced READMEs for profiles. By creating a repo with your name and adding README.md file with markdown to it, you can now add a rich description of yourself.. Here is an example of how it looks like: HOW NUMBA AND CYTHON SPEED UP PYTHON CODE Unlike Numba, all Cython code should be separated from regular Python code in special files. Cython parses and translates such files to C code and then compiles it using provided C compiler (e.g. gcc ). Python code is already valid Cython code. def sum_sequence_cython(a, b): result = np.zeros_like(a) for i in range(len(a)): result = a- b
PYTHON INTERNALS: ARBITRARY-PRECISION INTEGER The ob_refcnt field is responsible for reference counting technique which is used in garbage collection mechanism, whereas ob_type is a pointer to a structure which describes an integer type.. Generally, In languages like C/C++, the precision of integers is limited to 64-bit, but Python has built-in support for Arbitrary-precision integers.Since Python 3 there is no longer simple integer type EXTRACTING TEXT FROM HTML IN PYTHON: A VERY FAST APPROACH Clearly, it's not the best way to benchmark something, but it gives an idea that selectolax can be sometimes 30 times faster than lxml. I wrote selectolax half a year ago when I was looking for a fast HTML parser in Python.Basically, it is a Cython wrapper to the Modest engine. The engine itself is a very powerful and fast HTML5 parser written in pure C by lexborisov. HOW PANDAS INFERS DATA TYPES WHEN PARSING CSV FILES I'm not blaming pandas for this; it's just that the CSV is a bad format for storing data. Type specification. Pandas allows you to explicitly define types of the columns using dtype parameter. However, the converting engine always uses "fat" data types, such as int64 and float64. So even if you specify that your column has an int8 type, at first, your data will be parsed using an int64 WRITING A SIMPLE SOCKS SERVER IN PYTHON Here the ThreadingTCPServer creates a threading version of TCP server and listens for incoming connections on a specified address and port. Every time there is a new incoming TCP connection (session) the server spawns a new thread with SocksProxy instance running inside it. It gives us an easy way to handle concurrent connections. GARBAGE COLLECTION IN PYTHON: THINGS YOU NEED TO KNOWSEE MORE ONRUSHTER.COM
ARTEM GOLUBIN (RUSHTER) Artem Golubin. Hi! I'm a Software Engineer located in Russia. My current technical interests are Machine learning, NLP, web security, Python, information extraction, network protocols, and software internals. Github. Email. Kaggle. Twitter. DATA SCIENCE BLOGS READER Rasslin’ over writin’ teachin’. By Statistical Modeling, Causal Inference, and Social Science, 22 hours ago. Pandas.Styler : Styling the Pandas DataFrame. By Analytics Vidhya, 1 day ago. AdaBoost : A Brief Introduction to Ensemble learning. By Analytics Vidhya, 1 day ago. OkCupid’s Dating Data Center. By Dataclysm, 1 day ago. DETECTING SQL INJECTIONS IN PYTHON CODE USING AST Detecting SQL injections using abstract syntax trees. The most common mistake that leads to SQL injections in Python code is using string formatting in SQL statements. To find an SQL injection in Python code, we need to search for string formatting in the execute or executemany function call. There are at least three ways to format a string in HOW VIRTUAL ENVIRONMENT LIBRARIES WORK IN PYTHON Have you ever wondered what happens when you activate a virtual environment and how it works internally? Here is a quick overview of internals behind popular virtual environments, e.g., virtualenv, virtualenvwrapper, conda, pipenv. HOW PICKLE WORKS IN PYTHON How pickle works in Python. The pickle module implements serialization protocol, which provides an ability to save and later load Python objects using special binary format. Unlike json, pickle is not limited to simple objects. It can also store references to functionsand
HOW TO TURN AN ORDINARY GZIP ARCHIVE INTO A DATABASE The zcat command is an alias to gunzip -c.. Semi-random access. An ability to concatenate multiple archives is a very handy property. By exploiting this feature and trading a little bit of speed and disk space, we can achieve semi-random access. ON CODE ISOLATION IN PYTHON Python modules and class definition use frames too. That is a building block of the call stack. Given a frame object, you can: Change locals, globals, and builtins at runtime. Get bytecode of a function (code block) that is being executed. Here is how you can list all frames in the current call stack: def list_frames(): current_frame = sys HOW TO PATCH PYTHON BYTECODE How to patch Python's bytecode. The first number is the corresponding line number in the source code (thanks to co_lnotab).The next blocks contain three columns: an offset of the instruction in the bytecode, instruction name and an argument with a human-readable representation in parentheses (if any). HOW NOT TO DEPLOY WEB APPLICATIONS Recently, I was looking for tutorials on how to deploy a Django application in 2018. After some research, I found an article which suggests using gunicorn behind nginx web server, which is a pretty standard way of doing it. However, one thing has caught my attention. HOW PYTHON SAVES MEMORY WHEN STORING STRINGS How Python saves memory when storing strings. Since Python 3, the str type uses Unicode representation. Unicode strings can take up to 4 bytes per character depending on the encoding, which sometimes can be expensive from a memory perspective. To reduce memory consumption and improve performance, Python uses three kinds of internal UNDERSTANDING INTERNALS OF PYTHON CLASSES Understanding internals of Python classes. The goal of this series is to describe internals and general concepts behind the class object in Python 3.6. In this part, I will explain how Python stores and lookups attributes. I assume that you already have a BLOG POSTS | ARTEM GOLUBIN Garbage collection in Python: things you need to know. python , cpython internals, memory, advanced python. HOW NUMBA AND CYTHON SPEED UP PYTHON CODE Unlike Numba, all Cython code should be separated from regular Python code in special files. Cython parses and translates such files to C code and then compiles it using provided C compiler (e.g. gcc ). Python code is already valid Cython code. def sum_sequence_cython(a, b): result = np.zeros_like(a) for i in range(len(a)): result = a- b
HOW VIRTUAL ENVIRONMENT LIBRARIES WORK IN PYTHON Have you ever wondered what happens when you activate a virtual environment and how it works internally? Here is a quick overview of internals behind popular virtual environments, e.g., virtualenv, virtualenvwrapper, conda, pipenv. EXTRACTING TEXT FROM HTML IN PYTHON: A VERY FAST APPROACH Clearly, it's not the best way to benchmark something, but it gives an idea that selectolax can be sometimes 30 times faster than lxml. I wrote selectolax half a year ago when I was looking for a fast HTML parser in Python.Basically, it is a Cython wrapper to the Modest engine. The engine itself is a very powerful and fast HTML5 parser written in pure C by lexborisov. HOW PANDAS INFERS DATA TYPES WHEN PARSING CSV FILES I'm not blaming pandas for this; it's just that the CSV is a bad format for storing data. Type specification. Pandas allows you to explicitly define types of the columns using dtype parameter. However, the converting engine always uses "fat" data types, such as int64 and float64. So even if you specify that your column has an int8 type, at first, your data will be parsed using an int64 HOW PICKLE WORKS IN PYTHON How pickle works in Python. The pickle module implements serialization protocol, which provides an ability to save and later load Python objects using special binary format. Unlike json, pickle is not limited to simple objects. It can also store references to functionsand
WRITING A SIMPLE SOCKS SERVER IN PYTHON Here the ThreadingTCPServer creates a threading version of TCP server and listens for incoming connections on a specified address and port. Every time there is a new incoming TCP connection (session) the server spawns a new thread with SocksProxy instance running inside it. It gives us an easy way to handle concurrent connections. GARBAGE COLLECTION IN PYTHON: THINGS YOU NEED TO KNOWSEE MORE ONRUSHTER.COM
HOW NOT TO DEPLOY WEB APPLICATIONS The script above creates a TCP connection to the web server and sends only a part of the HTTP request, so the gunicorn waits for the rest of data. The default timeout for an HTTP request is set to 30 seconds. By creating a simple connection, we are blocking the whole website for 30 seconds! It does not matter how many workers you are using UNDERSTANDING INTERNALS OF PYTHON CLASSES Understanding internals of Python classes. The goal of this series is to describe internals and general concepts behind the class object in Python 3.6. In this part, I will explain how Python stores and lookups attributes. I assume that you already have a BLOG POSTS | ARTEM GOLUBIN Garbage collection in Python: things you need to know. python , cpython internals, memory, advanced python. HOW NUMBA AND CYTHON SPEED UP PYTHON CODE Unlike Numba, all Cython code should be separated from regular Python code in special files. Cython parses and translates such files to C code and then compiles it using provided C compiler (e.g. gcc ). Python code is already valid Cython code. def sum_sequence_cython(a, b): result = np.zeros_like(a) for i in range(len(a)): result = a- b
HOW VIRTUAL ENVIRONMENT LIBRARIES WORK IN PYTHON Have you ever wondered what happens when you activate a virtual environment and how it works internally? Here is a quick overview of internals behind popular virtual environments, e.g., virtualenv, virtualenvwrapper, conda, pipenv. EXTRACTING TEXT FROM HTML IN PYTHON: A VERY FAST APPROACH Clearly, it's not the best way to benchmark something, but it gives an idea that selectolax can be sometimes 30 times faster than lxml. I wrote selectolax half a year ago when I was looking for a fast HTML parser in Python.Basically, it is a Cython wrapper to the Modest engine. The engine itself is a very powerful and fast HTML5 parser written in pure C by lexborisov. HOW PANDAS INFERS DATA TYPES WHEN PARSING CSV FILES I'm not blaming pandas for this; it's just that the CSV is a bad format for storing data. Type specification. Pandas allows you to explicitly define types of the columns using dtype parameter. However, the converting engine always uses "fat" data types, such as int64 and float64. So even if you specify that your column has an int8 type, at first, your data will be parsed using an int64 HOW PICKLE WORKS IN PYTHON How pickle works in Python. The pickle module implements serialization protocol, which provides an ability to save and later load Python objects using special binary format. Unlike json, pickle is not limited to simple objects. It can also store references to functionsand
WRITING A SIMPLE SOCKS SERVER IN PYTHON Here the ThreadingTCPServer creates a threading version of TCP server and listens for incoming connections on a specified address and port. Every time there is a new incoming TCP connection (session) the server spawns a new thread with SocksProxy instance running inside it. It gives us an easy way to handle concurrent connections. GARBAGE COLLECTION IN PYTHON: THINGS YOU NEED TO KNOWSEE MORE ONRUSHTER.COM
HOW NOT TO DEPLOY WEB APPLICATIONS The script above creates a TCP connection to the web server and sends only a part of the HTTP request, so the gunicorn waits for the rest of data. The default timeout for an HTTP request is set to 30 seconds. By creating a simple connection, we are blocking the whole website for 30 seconds! It does not matter how many workers you are using ARTEM GOLUBIN (RUSHTER) Artem Golubin. Hi! I'm a Software Engineer located in Russia. My current technical interests are Machine learning, NLP, web security, Python, information extraction, network protocols, and software internals. Github. Email. Kaggle. Twitter. DATA SCIENCE BLOGS READER A fun activity for your statistics class: One group of students comes up with a stochastic model for a decision process and simulates fake data from this model; another group of students takes this simulated dataset and tries to learn about the underlying process. By Statistical Modeling, Causal Inference, and Social Science, 21 hoursago.
BLOG POSTS | ARTEM GOLUBIN Garbage collection in Python: things you need to know. python , cpython internals, memory, advanced python. PYTHON INTERNALS: ARBITRARY-PRECISION INTEGER The ob_refcnt field is responsible for reference counting technique which is used in garbage collection mechanism, whereas ob_type is a pointer to a structure which describes an integer type.. Generally, In languages like C/C++, the precision of integers is limited to 64-bit, but Python has built-in support for Arbitrary-precision integers.Since Python 3 there is no longer simple integer type HOW PICKLE WORKS IN PYTHON How pickle works in Python. The pickle module implements serialization protocol, which provides an ability to save and later load Python objects using special binary format. Unlike json, pickle is not limited to simple objects. It can also store references to functionsand
MEMORY MANAGEMENT IN PYTHON Block is a chunk of memory of a certain size. Each block can keep only one Python object of a fixed size. The size of the block can vary from 8 to 512 bytes and must be a multiple of eight (i.e., use 8-byte alignment). For convenience, such blocks are grouped in GARBAGE COLLECTION IN PYTHON: THINGS YOU NEED TO KNOW Python needs to know when your object is no longer needed. Removing objects prematurely will result in a program crash. Garbage collections algorithms track which objects can be deallocated and pick an optimal time to deallocate them. Standard CPython's garbage collector has two components, the reference counting collector and thegenerational
CLIPBOARD API FOR BROWSERS IS INCONSISTENT W3C Clipboard API specification allows browsers to interact with PNG, JPG, GIF, and SVG images. Every operating system supports a lot of clipboard formats. For our experiment, we are interested in two general categories: File object clipboard — When you copy a file from a system file manager, the clipboard only contains meta-information, such HOW TO TURN AN ORDINARY GZIP ARCHIVE INTO A DATABASE The zcat command is an alias to gunzip -c.. Semi-random access. An ability to concatenate multiple archives is a very handy property. By exploiting this feature and trading a little bit of speed and disk space, we can achieve semi-random access. PUBLIC SSH KEYS CAN LEAK YOUR PRIVATE INFRASTRUCTURE Public SSH keys can leak your private infrastructure. This article describes a minor security flaw in the SSH authentication protocol that can lead to unexpected private infrastructure disclosure. It also provides a PoC written in Python. Asymmetric cryptography, or public-key cryptography, is the most common way to identify andauthorize a
Artem Golubin Blog __ ____
ARTEM GOLUBIN
Hi! I'm a Software Engineer located in Russia. My current technical interests are Machine learning, NLP, web security, Python, information extraction, network protocols, andsoftware internals.
* __Github
* __ Email
* Kaggle
* __ Twitter
POPULAR BLOG POSTS
* Garbage collection in Python: things you need to know * Memory management in Python * Extracting text from HTML in Python: a very fast approach * Understanding internals of Python classes * Optimization tricks in Python: lists and tuplesRECENT POSTS
* On code isolation in Python * Clipboard API for browsers is inconsistent * How to turn an ordinary gzip archive into a database * How to track and display profile views on GitHub * Public SSH keys can leak your private infrastructure PYTHON INTERNALS SERIES * On code isolation in Python * How Python saves memory when storing strings * How virtual environment libraries work in Python * How many objects does Python allocate during its interpreterlifetime?
* Python's GIL implemented in pure Python * Optimization tricks in Python: lists and tuples * Understanding internals of Python classes * How pickle works in Python * Garbage collection in Python: things you need to know * Memory management in Python * Python internals: Arbitrary-precision integer implementation OPEN-SOURCE PROJECTSMLAlgorithms
Python
Minimal and clean examples of machine learning algorithms.__ Stars: 8 100
__ Forks: 1 500
heamy
Python
A set of useful tools for competitive data science.__ Stars: 490
__ Forks: 110
selectolax
Python
Python bindings to Modest engine (fast HTML5 parser with CSSselectors).
__ Stars: 311
__ Forks: 18
Back to top
__ __ __
© 2009-2020, Artem Golubin, me@rushter.comDetails
5
Copyright © 2024 ArchiveBay.com. All rights reserved. Terms of Use | Privacy Policy | DMCA | 2021 | Feedback | Advertising | RSS 2.0