Ynon Perek
  • Home
  • Subscribe

python

A collection of 9 posts

python

Calculating Frequencies with Numpy

Numpy provides great many utility functions for working with arrays. One of them called bincount is the star of today's story. Data Task Description Given a set of data, one may be interested

Ynon Perek
python

Implementing a Generic Constructor in Python

A few posts ago I presented a neat ruby trick that defines a generic initialize method. The same idea can be implemented in python but I'm not sure the result is as satisfactory.

Ynon Perek
python

Python Gone Bad

Not that long ago perl was the most common go-to language for developers, and many claimed its syntax was nothing more than line noise. Python should have fixed all that. But did it?

Ynon Perek
python

Writing a Secure Encrypted Chat in Python

When using a stream ciphers to pass encrypted messages to the other, there are some potential traps that we should look out for. Let's explore them and then move on to a demo

Ynon Perek
python

Quick Tip: Using Memoization To Speed Up Recursive Functions

A recent visit to hackerrank reminded me of a nice trick to make our recursive functions run faster - and it's called memoization. The Question A hackerrank question asked to find the number

Ynon Perek
python

Recursion Exercises

Recursions are one of those things that are easy to understand in theory, but in practice can take some getting used to. If you're struggling with it here are some exercises that might

Ynon Perek
python

How To: Encrypt Large Files with Python and PyNacl

One limitation of pynacl's concise API is its lack of support for buffered reading. When it comes to large files we can't always load all data to memory in one chunk. This is

Ynon Perek
python

Python Exercises

Most python exercises I found online were either too easy or tested things that were not directly related to python (mostly data structures or algorithms). Neither is a good choice when you're teaching

Ynon Perek
python

Python Scope Declarations: Implicit, Global and Nonlocal

Python provides 3 different scoping declarations for variables: implicit (default) scope, global and nonlocal. Let's explore their semantics and differences.

Ynon Perek
Ynon Perek © 2019
Latest Posts Facebook Ghost