All posts
-
Read more >
10 Python Optimization Tips and Issues
Following my previous post on Optimizing Javascript, I thought I’d write a similar post regarding Python optimization.
-
Read more >
Javascript Optimization Tricks
Profiling, Profiling, Profiling This seems obvious, but still merits a mention. Don’t optimize your code before profiling it. If you need a profiler, just use firebug’s. Having tests to make sure that your post-profiling code is equivalent to the original is also nice. Later is better than now As is well known, it is usually…
-
Read more >
Checking the ulam spiral
In the following post, the Ulam spiral is described. It’s a very simple object – write down consecutive natural numbers starting from 41 in a square spiral. Curiously, the numbers on the diagonal are primes: Reading this post, I immediately wanted to check how long this property holds. The original blog post suggests: Remarkably, all…
-
Read more >
Privacy mode not so private
I like my privacy. I also prefer to keep my information secure. I might be a bit more paranoid than the rest, but not extremely so. A short while ago, I discovered something disturbing regarding Firefox. It seems to be a ‘secret everybody knows’, yet Firefox doesn’t say anything about that. What is it? When…
-
Read more >
PNG Minification
Following Ned Batchelder’s advice I’ve used pngout to minify the png’s on my startup’s web page. It took them down from 641,281 bytes to 338,705. This is quite a nice return for the effort of a download and a single command line: for %i in (*.png) do pngout “%i”
-
Read more >
Threat analysis, security by obscurity and WordPress
Image by Mykl Roventine I’ve been running wordpress for a long time now, and luckily so far, it hasn’t been hacked. Of course – this doesn’t prove anything, as I didn’t count hacking attempts. It also doesn’t show it’s unhackable – on the contrary, I believe that my wordpress installation is hackable by a determined…
-
Read more >
My solution to the counting sets challenge
A few days ago, I wrote up a challenge – to count the number of sets a given set is contained in. In the comments, I touched briefly on the original problem from which the challenge was created, and I’ll describe it in more depth here. In the problem, I am given an initial group…
-
Read more >
Fractals in 10 minutes No. 6: Turtle Snowflake
I didn’t write this one, but I found it’s simplicity and availability so compelling, I couldn’t just not write about it. In a reddit post from a while ago, some commenter named jfedor left the following comment: A little known fact is that you can do the following on any standard Python installation: from turtle…
-
Read more >
Small Python Challenge No. 4 – Counting Sets
This is a problem that I encountered a short while ago. It seems like it could be easily solved very efficiently, but it’s not as easy as it looks. Let’s say that we are given N (finite) sets of integers – S. For now we won’t assume anything about them. We are also given another…
-
Read more >
PyWeb-IL Presentation on Harvesting: Finding the Most Influential Artists
Yesterday I gave a presentation on harvesting to the PyWeb-IL group. In the presentation, I described what I learned about harvesting and also gave a concrete example of how to find the “most influential artists” using data from allmusic.com and a (very) naive implementation of PageRank. The PageRank implementation was based on wikipedia word-by-word, and…