1. ## Fun With Python Coroutines: Generating Permutations

A very short post on having fun with coroutines to generate all permutations of a given list.

Tagged as
2. ## The Infinite In Haskell and Python

Exploring the use of coroutines and lazy evaluation to generate infinite structures in Haskell and Python.

Tagged as
3. ## 9 Anti-Patterns Every Programmer Should Be Aware Of

A discussion of software design and programming anti-patterns to know for every programmer, with examples.

Tagged as
4. ## Understanding Recurrence Relations Using Automata, Python Code, And Javascript Visualizations

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 Python and visualizations in JavaScript are used to demonstrate the ideas.

Tagged as
5. ## Understanding Asynchronous IO With Python 3.4's Asyncio And Node.js

An exploration of asynchronous IO, event loops, threads, and coroutines through code written for Node.js and Python 3.4.

Tagged as
6. ## Turing Recognizability of Turing Machines That Accept All Strings

A proof that the set of encodings of Turning machines that accept all strings is not Turing-recognizable.

Tagged as
7. ## Visualizing Philosophers And Scientists By The Words They Used With Python and d3.js

Creating a word-cloud based off of publicly available project Gutenberg books, with d3.js and Python.

Tagged as
8. ## It From Bit - A Brief Exploration Of Some Ideas and Results From The Theory of Computation

A presentation I gave to a group of physics graduate students, as an introduction to some ideas and results in theoretical computer science.

Tagged as
9. ## Understanding SAT by Implementing a Simple SAT Solver in Python

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.

Tagged as
10. ## So How Do You Actually Calculate The Fibonacci Numbers?

You have seen it as an example a million times. But do you know how to do it efficiently?

Tagged as
11. ## Combinatorial Generation Using Coroutines With Examples in Python

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.

Tagged as
12. ## 30 Python Language Features and Tricks You May Not Know About

A list of Python tips and tricks. See how many of them you already know.

Tagged as
13. ## Multilinear Representation of Boolean Functions

Algorithm to compute the multilinear representation of a boolean function given its truth table.

Tagged as
14. ## Understanding Two-Step Verification With An Example Using Python and Google Authenticator

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.

Tagged as
15. ## Line Intersecting Maximal Number of Circles (Circle "Stabbing" Problem)

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.

Tagged as
16. ## Finding the Tangent Line to Two Circles Demonstrated Using JSXGraph

An HTML5 applet demonstrating step by step how to find tangent lines to two circles, using the JSXGraph framework.

Tagged as
17. ## Thales Inscribed Angle Theorem Demonstrated Using JSXGraph

An HTML5 applet demonstrating the Thales inscribed angle theorem.

Tagged as
18. ## Expected Running Time of Two Randomized Sort Algorithms (ACM ICPC 2013 PACNW Regional)

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.

Tagged as
19. ## Pattern Matching in Fibonacci Words (ACM ICPC World Finals 2012)

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.

Tagged as
20. ## Programmer's Guide to Setting Up a Mac OS X Machine

My list of items to do to set up a Mac OS X machine for coding and other power user tasks.

Tagged as
21. ## Fibonacci Primitve Roots of Primes (Project Euler)

A problem on finding primes with Fibonacci primitive roots, from Project Euler and my Python solution.

Tagged as
22. ## Common Substring Permutation

Short post on a simple problem on common subsequence permutations with a neat one-line Python solution.

Tagged as
23. ## Visualizing the Convex Hull Using Raphaël

Visualizing a simple incremental convex hull algorithm using HTML5, JavaScript and Raphaël, and what I learned from doing so.

Tagged as
24. ## Basics of Cryptography Part I: RSA Encryption and Decryption

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.

Tagged as
25. ## Hundred Prisonors and a Room With a Light Switch

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.

Tagged as
26. ## A Study of Python's More Advanced Features Part III: Classes and Metaclasses

A study of how Python handles classes and metaclasses.

Tagged as
27. ## Interview Question: All Possible Products of a List of Primes (Facebook)

Facebook interview question to list all possible products of a list of primes, with two Python solutions and a short discussion of the problem.

Tagged as
28. ## Problem-Solving Lessons From George Pólya

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.

Tagged as
29. ## Interview Question: Fair and Unfair Coins and Bayes' Theorem (Groupon)

Groupon interview question to infer the probability of an event using Bayes' theorem.

Tagged as
30. ## A Study of Python's More Advanced Features Part II: Closures, Decorators and functools

A study of Python's function and class decorators. An appendix to explain Python's closures is given too. Plenty of examples.

Tagged as
31. ## A Study of Python's More Advanced Features Part I: Iterators, Generators, itertools

A study of Python's iterators, generators and the itertools package, with ample (mostly) mathematical examples.

Tagged as
32. ## Interview Question: Fairness from Unfairness (Groupon)

Groupon 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.

Tagged as
33. ## Manbelbrot Meets HTML5 - A Little Fractal Geometry

Simple HTML5 and JavaScript code to generate the Mandelbrot fractal on a canvas element.

Tagged as
34. ## Interview Question: Grouping Word Anagrams (Facebook)

Facebook interview question to group words into anagram. Python solution is given.

Tagged as
35. ## A Christmas-Themed Experiment - HTML5 Canvas Snowflakes

Little experiment with HTML5 and Canvas to generate random fractal snowflake-like patterns.

Tagged as