Cryptography deals with encrypting or encoding a piece of information (in a plain text) into a form that looks gibberish and makes little sense in ordinary language.This encoded message(also called ciphertext) can then be decoded back into a plain text by the intended recipient using a decoding technique (often along with a private key) communicated to the end-user. Caesar Cipher is ...
Read More »
NumPy Loadtxt Tutorial (Load Data From Files)
In a previous tutorial, we talked about NumPy arrays and we saw how it makes the process of reading, parsing and performing operations on numeric data a cakewalk. In this tutorial, we will discuss the NumPy loadtxt method that is used to parse data from text files and store them in an n-dimensional NumPy array. Then we can perform all sorts of ...
Read More »20+ Examples For Flattening Lists In Python
Flattening lists means converting a multidimensional or nested list into a one-dimensional list. For example, the process of converting this [[1,2], [3,4]] list to [1,2,3,4] is called flattening. The process of flattening is very easy as we’ll see. You will learn how to flatten different shapes of lists with different techniques. So, let’s jump in A list of lists Let’s ...
Read More »JavaScript: Open Link in New Tab
Major browsers have popup blockers which sometimes prevent sites to open new tabs. This article investigates how popup blockers currently works, what they block and how to overcome problems caused by them. First chapter gives short overview of popup blockers. The rest of article shows multiple ways how to open new tab and how to work around browsers limitations. Popup ...
Read More »How to Split a String by Whitespace in Python: Brute Force and split()
Once again, I’m back with another look at some ways to solve a common Python problem. This time, we’ll be looking at how to split a string by whitespace (and other separators) in Python. If you’re in a rush, here’s the key takeaway. You could write your own whitespace splitting function, but they’re often slow and lack robustness. Instead, you ...
Read More »How to Convert a String to Lowercase in Python
As this series grows, I’ve started poking at seemingly simple problems to expose their complexity. This time, I thought it would be interesting to look at how to convert a string to lowercase. As it turns out, there’s a really straightforward solution (lower()), but I think it’s worth looking at a few homemade solutions first. For instance, we could try ...
Read More »How to Round a Number in Python: Truncation, Arithmetic, and More
Remember learning to round in grade school? Me too! The only problem is I don’t use the idea very often. As a result, I don’t always remember how to round a number in programming contexts like Python. Luckily, I’ve pieced together a little article for myself. Hopefully, you get some value out of it as well. As it turns out, ...
Read More »Automating the Change of WordPress Permalinks
WordPress is powering 35% of website. And while it may not be seen as very complex or interesting, it is one of the most prevalent technologies of our time. And many developers, even if they are not working with PHP, have to support some WordPress installation (e.g. a blog like this one). And unfortunately, there are still basic things that ...
Read More »How to Create a List in Python: Loops, Comprehensions, and More
If you’re working with Python for the first time, you might be interested in learning how to store data. For example, you might want to collect a list of exam scores, so you can average them. If so, the list data structure gets the job done. But, how do you create a list in Python? That’s the topic of today’s ...
Read More »