Author Archives: lorg

One-liner Guitar Tuner in Python

On windows, assuming imports are free: import winsound winsound.Beep(220*((2**(1/12.0))**7), 2000) But that’s just because I like to tune to E. If you prefer a more “natural looking” note, you can use A: winsound.Beep(110, 1000) But why choose at all when … Continue reading

Posted in Python, Sound | Tagged , , , | 2 Comments

Visualizing Data Using the Hilbert Curve

Some time ago, a coworker asked me to help him visualize some data. He had a very long series (many millions) of data points, and he thought that plotting a pixel for each one would visualize it well, so he … Continue reading

Posted in Fractals, Graphics, Math, Programming, Python | Tagged , , , | 2 Comments

Fuzz-Testing With Nose

A few days ago, I found a in my website, plnnr.com. The bug was in a new feature I added to the algorithm. The first thing I did was write a small unit-test to reproduce the bug. With that unit-test … Continue reading

Posted in Python, Testing | Tagged , , , | 3 Comments

Open Redirects

In this post I’ll discuss an issue I tackled a short while ago – open redirects. But first, the story of how I got to it. Feel free to skip ahead to the technical discussion. Background Our analytics for plnnr.com … Continue reading

Posted in Programming, Security, web-design | Tagged , , , , , , , | Leave a comment

Pyweb-il Presentation on Optimization Slides

Last Monday I gave a presentation in pywebil on optimization, that’s loosely based on my blog post on the same subject. Here are the slides for that presentation.

Posted in Optimization, Programming, Python | Tagged , , , | Leave a comment

Javascript Element Creator

Some time ago I was working on optimizing the client side code of my website, plnnr.com, an online trip planner. This website does automatic trip planning, and the problem was that recalculating trips was slow. After profiling, I found out … Continue reading

Posted in Javascript, Optimization, Programming, Projects, startup, web-design | Tagged , , , | 2 Comments

Call for Volunteers: Open Knesset – oknesset.org

Over the last few weeks, I’ve been lightly involved in work on open knesset. Mostly I’ve been helping two of the main developers, Benny and Ofri, and joining the discussions on the discussion group. (For the non-Israelis: the Knesset is … Continue reading

Posted in Projects | Tagged , , , | 2 Comments

Ethics in Programming

Some time ago I was bothered by the issue of ethics in programming. I heard the question best raised during a “game unconference” I attended. There was a panel about monetary systems for games, and people talked about the issues … Continue reading

Posted in Programming, Programming Philosophy | Tagged , | 7 Comments

Simple SQLObject DB Migration how-to

I’ve been using sqlobject for plnnr.com for quite some time now. So far my experience with it has been positive. Although I’ll probably change ORM when I move to django, for now it stays. While it stays, I need to … Continue reading

Posted in Programming, Python | Tagged , , , | Leave a comment

The mathematics behind the solution for Challenge No. 5

If you take a look at the various solutions people proposed for the last challenge of generating a specific permutation, you’ll see that they are very similar. Most of them are based on some form of div-mod usage. The reason … Continue reading

Posted in Challenges, computer science, Programming, Python | Tagged , , , , | Leave a comment