14 More Python Features and Tricks You May Not Know About
More Python 3.4+ features and tricks. See how many of them you already know.
Math ∪ Code by Sahand Saba
More Python 3.4+ features and tricks. See how many of them you already know.
Ten questions you can ask a hiring manager to learn about the team effectively and show your curiosity and interest.
What you need to know to solve basic combinatorial generation problems you might encounter on coding interviews, with plenty of examples in Python.
Raising the bar for what is necessary to keep your accounts secure online.
A deep dive into flattening an iterator of iterators and a segue into set theory and some of its theorems based on the solutions to this problem, inspired by a coding interview question.
A deep dive into generating all balanced parentheses, inspired by a coding interview question.
A quick review of basic graph algorithms and related data structures for coding interviews, with minimal implementations and unit tests provided in Python.
A very short post on having fun with coroutines to generate all permutations of a given list.
Exploring the use of coroutines and lazy evaluation to generate infinite structures in Haskell and Python.
A discussion of software design and programming anti-patterns to know for every programmer, with examples.
Recurrence relations are very often taught in first- or second-year computer science and discrete mathematics courses. This post takes a somewhat different and more visual approach to understanding linear recurrences and solving them by drawing the link between linear recurrences, automata, and matrices, using the problem of generating all domino-tilings of a board as the springboard. Code in…
An exploration of asynchronous IO, event loops, threads, and coroutines through code written for Node.js and Python 3.4.
A proof that the set of encodings of Turning machines that accept all strings is not Turing-recognizable.
Creating a word-cloud based off of publicly available project Gutenberg books, with d3.js and Python.
A presentation I gave to a group of physics graduate students, as an introduction to some ideas and results in theoretical computer science.
SAT is often described as the "mother of all NP-complete problems." This post goes over what SAT is and why it is considered to be so important. A simple SAT solver is implemented using Python in the process.
You have seen it as an example a million times. But do you know how to do it efficiently?
Approaching combinatorial generation algorithms using coroutines, with examples in Python. Inspired by Knuth's work in his volume 4 of The Art of Computer Programming, as well as his "Deconstructing Coroutines" paper, co-written with Frank Ruskey.
A list of Python tips and tricks. See how many of them you already know.
Algorithm to compute the multilinear representation of a boolean function given its truth table.
An introduction to two-step authentication, HOTP and TOTP algorithms, with an example in Python on Heroku using Flask and pyotp and the Google Authenticator app for client-side.
Developing an algorithm to find a line that intersects a maximal number of circles, given a set of circles. Based on an ACM ICPC regional competition problem.
An HTML5 applet demonstrating step by step how to find tangent lines to two circles, using the JSXGraph framework.
An HTML5 applet demonstrating the Thales inscribed angle theorem.
Computing the expected running time of two randomized sort algorithms for a given input array. This problem appeared in ACM ICPC 2013 PACNW regional competition.
A discussion of calculating the number of occurrences of a given pattern in Fibonacci words, with a Java solution. Problem from the 2012 ACM ICPC world finals.
My list of items to do to set up a Mac OS X machine for coding and other power user tasks.
A problem on finding primes with Fibonacci primitive roots, from Project Euler and my Python solution.
Short post on a simple problem on common subsequence permutations with a neat one-line Python solution.
Visualizing a simple incremental convex hull algorithm using HTML5, JavaScript and Raphaël, and what I learned from doing so.
An introduction to RSA cryptography, with accompanying Python code implementing the basic algorithms used. A quick review of the number theory and group theory involved is given as well.
A hundred prisoners are given a challenge that might set them free. See if you can solve the puzzle involving a light switch and help them gain their freedom.
A study of how Python handles classes and metaclasses.
Interview question to list all possible products of a list of primes, with two Python solutions and a short discussion of the problem.
What I learned from Newman's selections of Pólya's How to Solve It, the influential and beautifully written book on problem-solving techniques and heuristics.
Interview question to infer the probability of an fair and unfair coins after a certain number of coin tosses using Bayes' theorem.
A study of Python's function and class decorators. An appendix to explain Python's closures is given too. Plenty of examples.
A study of Python's iterators, generators and the itertools package, with ample (mostly) mathematical examples.
Interview question to use an unfair coin to simulate a fair one. The question is the same as extracting randomness from an unfair Bernoulli process. A Python implementation is given.
Simple HTML5 and JavaScript code to generate the Mandelbrot fractal on a canvas element.
Simple Python solution to interview question to group words into anagrams.
Little experiment with HTML5 and Canvas to generate random fractal snowflake-like patterns.