Botnets are watching you closely

Image for post
Image for post
Image by Thomas Breher from Pixabay

Information security is paramount in our digital world. Whether it is your work project or your personal life, nothing is insured against black-hat attacks. In this article, I will tell you about some of the common attack types so you can be prepared.

Most people think they need not bother about cyber attacks. Really, if you look at it, why would anyone bother cracking your bank account for whatever saving you might have when they could hack a bank, or say Pentagon?

In practice, it is a bit more complicated than that. While banks, no doubt, have quite a lot more money than your savings account, they are also notoriously hard to get into. Every bank has an army of cybersecurity specialists working day and night to protect their systems, and do not even get me started on Pentagon. The early days of the internet are long passed, and large organizations have figured it out. …

Much like Fidonet and floppy disks, it is going to die fast and very soon

Image for post
Image for post

Now, I assure this is not a clickbait title. I really think that we are the last generation to make use of internet in its current iteration, and will convince you in a few paragraphs.

It is very hard to imagine our lifes without internet. It had been there from day one (for some of us) and grew old along. Now it is no longer a defence systems network, it is no longer a scientific research network, but rather The Network. …

One rule to rule them all

Picture looking down at a table with three people looking over a drafting plan.
Picture looking down at a table with three people looking over a drafting plan.
Image by Malachi Witt from Pixabay

React is an extremely easy to use frontend library. It allows prototyping and iteration at a neck-breaking speed. But, when developing large-scale production apps. it is important to carefully design the architecture and keep the design clear and simple. In this article, I will go into some of the tools and principles you can use to architect your React projects.

Why is Architecture So Important?

It is easy to gloss over many architecture decisions and principles when starting from the ground up. By the end of the sprint, you already have working authentication, homepage and stakeholders are happy. …

No more frustration moving JAR files

Image for post
Image for post
Image by Valdas Miskinis from Pixabay

If you are working with Java projects, you will most likely have to deal with Maven. Maven is a project management tool, used as an industry standard for medium to large scale Java applications. In this post, I will teach you to create production artifacts of multi-module Maven projects using the assembly plugin.

Initial project structure

For the purposes of this article, I will assume a very bare-bones project in Maven. We will have 4 modules: root, which is the main (container) module, common, which is used by other modules, app, the app itself, and tools. We are not writing any actual code here, so do not worry about the logic. …

Testing has never been this easy

Shuttle launch from a distance.
Shuttle launch from a distance.
Photo by SpaceX on Unsplash.

Flutter is a cross-platform application development framework. But no application is really complete without a comprehensive testing suite. In this article, I will tell you the basic principles of both unit- and widget-testing Flutter apps as well as mocking dependencies.

Why Test?

Testing is vital when developing any serious software project. With a good test suite in place, you can make changes to any part of the code without worrying about if that is going to break anything. You can run tests any time and get an answer within minutes if the system is working correctly.

If you, as a developer, do not test your code, how can you expect your clients to test it? …

Catch bugs before you even write them

Image for post
Image for post
Image by OpenClipart-Vectors from Pixabay

Python is a multi-purpose language that is used for everything backend. In this article, I will teach you to perform basic unit testing in Python, how to mock modules, and make sure your code is clean.

What is Unit-testing?

Unit-testing is one of the ways to test your code. Other ways include functional testing, integration testing, regression testing and so on. Testing is vital to any larger codebase, as it lets you iterate and perform changes quickly, without worrying to much about what is going to break.

Unit-testing is the lowest testing method on the abstraction level. Unit-testing is concerned with testing individual modules and functions in isolation. That is, by making sure all the parts of your system work correctly, you can make the assumption that the whole system is working ok. …

Nail your next interview

Image for post
Image for post
Image provided by the author.

With Python becoming more and more popular lately, many of you are probably undergoing technical interviews dealing with Python right now. In this post, I will list ten advanced Python interview questions and answers.

These can be confusing and are directed at mid-level developers, who need an excellent understanding of Python as a language and how it works under the hood.

What Are Nolocal and Global Keywords Used For?

These two keywords are used to change the scope of a previously declared variable. nolocal is often used when you need to access a variable in a nested function:

def func1(): 
x = 5
def func2():
nolocal x

Manage your resources like a pro

Image for post
Image for post
Image by ErikaWittlieb from Pixabay

Python is a particularly clean and sugary language, thanks to its many convenience features. In this post, I will go into context managers in Python, how to use them, where to find them, and how to write your own ones.

Why do we need Context Managers?

Context managers are most often used when we are talking about resources. For example, reading/writing from files. Examine this simple snippet:

f = open('log.txt', 'w') 
f.write('hello world')

All this code does is open the log.txt for writing and writes hello world in it. Simple enough. But suppose for a minute, that the code on line 2 throws an exception for no reason whatsoever. In this case, file is still opened, but never closed, as the interpreter never gets to line 3. …

Metaprogramming is key

Image for post
Image for post
Photo by Free Photos on Pixabay.

Python is praised for its clarity and syntactic sugariness. In this article, I will teach you to use decorators in Python to make your code readable and clean.

What Are Decorators?

To understand what decorators are, you first need to be familiar with the way Python handles functions. From its point of view, functions are no different than regular objects. They have properties and can be reassigned:

Moreover, you can pass them as arguments to other functions:

Now, to decorators. A decorator is used to modify the behaviour of a function or class. The way this is achieved is by defining a function (decorator) that returns another function. …

We need to go deeper

Image for post
Image for post
Photo by Christian Englmeier on Unsplash.

Let’s be honest: Python is slow. When I say Python, I mean CPython, its reference C-based implementation. This is where PyPy comes into play. It is a Python runtime written in Python (!) that performs 4.4 times faster than CPython. How? Read ahead.

“If you want your code to run faster, you should probably just use PyPy.” — Guido van Rossum (literally created Python)

Competitive programmers were among the first to harness the power of PyPy. Sometimes, solutions written in Python will take too long and fail, but the same code running in PyPy will pass with flying colours. How?

Different Approaches

You probably know that Python is what we call an interpreted language. CPython reads in source code line by line and executes it as it goes. …


Michael Krasnov

Your next mentor, employee, employer, consultant or simply a friend. I write better text so you can write better code.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store