Author Archives: lorg

Beautiful Code

A few days ago, @edensh mentioned in Facebook beautiful code, and many people gave examples of assembly, while I was thinking of Python. That got me thinking: what is beautiful code for me? So here are my criteria for beautiful … Continue reading

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

Small programming challenge No. 6 – nblocks

I came up with this challenge when I had to write a function to divide a sequence to percentiles. I needed this to calculate some statistics over trips for plnnr.com. “This sounds trivial” I thought, and reached for my simple … Continue reading

Posted in Challenges, Programming, Python, Statistics | Tagged , , , , | 22 Comments

Moving to a new server

I moved the blog to a new server, and a new wordpress install. It will take me some time to get everything back in order, but once I finish it, I’m going to get back to writing regularly. Stay tuned!

Posted in Miscellaneous | Leave a comment

One-liner Guitar Tuner in Python

On windows, assuming imports are free: import winsound winsound.Beep(220*((2**(1/12.0))**7), 2000)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)winsound.Beep(110, 1000) But why … 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