Today I read some Python code and I asked myself "mmm what? How does it work? What's the meaning of raising an exception from another one? In this article I'll answer on: What is an exception?What is an exception chaining?Why is it important to use it?How to chain exceptions in Python? Let's get started! Introduction… Continue reading Exception Chaining In Python
Author: orianzinger
Structural Pattern Matching In Python
Once upon a time, Guido van Rossum, the Python creator, decided to reject a simple feature (PEP 3103): Switch case The reason for rejecting this PEP is: A quick poll during my keynote presentation at PyCon 2007 shows this proposal has no popular support. I therefore reject it.~ Guido van Rossum Lots of software developers… Continue reading Structural Pattern Matching In Python
Python Strings Prefixes
Strings are easy. kind of. Sometimes though, you can find one character right before the left apostrophe (or quotation mark). In this article, I'll explain the difference between the prefixes you can write there. There are four possible literals: u - unicodeb - byter - rawf - formatting Literals comparison Regular string string = 'Hello… Continue reading Python Strings Prefixes
Smart Fridge Part 2
In a previous article, I wrote about IoT, the motivation behind this project and more. In this one, I'll elaborate on the technical side of this project. Let's divide the project to two parts: Taking a photoUploading the photo to Google Drive This is how we can capture the content. Credit: Roi Natan Zukerman Say… Continue reading Smart Fridge Part 2
Living LiveU
In this article, I'll elaborate on my last 4+ years and the reason for leaving the company. Introduction After graduating from Ben Gurion University (summer 2016) I started working at LiveU which is a high-quality low-delay video streaming units manufacturer. For example, when you watch the news and see an interview between the news reporter… Continue reading Living LiveU
Smart Fridge Part 1
As a tech-enthusiast, I like making dumb devices smart. For example, a couple of years ago I created a smart mirror (I'll elaborate on it in a different article). It's the combination of boring practical things with simple, but modern/futuristic improvement that makes me love this realm. I admit. I'm a geek. I like those… Continue reading Smart Fridge Part 1
Anti Patterns
Software design patterns are very important for long-term projects. Each pattern can contribute in its way, sure, but were all the patterns born equal? Some practices are considered better than others. best practice is a method or technique that has been generally accepted as superior to any alternatives because it produces results that are superior to… Continue reading Anti Patterns
The Python’s Disassembler
Recently, I've added the isnt keyword to the Python language grammar, but I used the same is not AST node. In this article, I'll demonstrate how to continue adding a new rule. The next things to do are building an AST node and compiling it to a Python byte-code. Creation First, we need to define… Continue reading The Python’s Disassembler
I Like To Move It Move It
In the last article, I explained the different value categories. In this article, I'll elaborate on the C++ move semantics. Let's review this code: #include <iostream> #include <string> class DataStructure { public: DataStructure (uint64_t size) : m_size(size), m_data(new uint64_t[m_size]) { print("ctor"); } ~DataStructure () { print("dtor"); if (m_data) { delete[] m_data; m_data = nullptr; }… Continue reading I Like To Move It Move It
Value Categories In C++
In C++, every expression has a value category. In C++03 (and before), we had two value categories: lvaluervalue In C++11 (and later), we were introduced with new categories: lvaluervalue - prvalue or xvaluexvalueglvalue - lvalue or xvalueprvalue - C++03 rvalue In this article, I'll explain the categories and in the next article, I'll elaborate on… Continue reading Value Categories In C++