Tag Archives: Programming

Cheap language detection using NLTK

Some months ago, I was facing a problem of having to deal with large amounts of textual data from an external source. One of the problems was that I wanted only the english elements, but was getting tons of non-english … Continue reading

Posted in Python | 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

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

Small Programming Challenge no. 5 – Generating a Permutation

I thought of this one quite a long time ago, and I believe that the idea behind it is pretty nice mathematically. I got the idea for it from Knuth’s “The Art of Computer Programming”. The challenge is simple: write … Continue reading

Posted in Challenges, computer science, Programming | Tagged , | 15 Comments

10 Python Optimization Tips and Issues

Following my previous post on Optimizing Javascript, I thought I’d write a similar post regarding Python optimization.

Posted in computer science, Design, Optimization, Programming, Python | Tagged , , , , | 7 Comments

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 … Continue reading

Posted in Math, Programming, Python | Tagged , , , , | 4 Comments

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 … Continue reading

Posted in Challenges, computer science, Python | Tagged , , , | 5 Comments

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 … Continue reading

Posted in Challenges, computer science | Tagged , , | 17 Comments

Debugging in IE.

I did something I shouldn’t have done: from JavaScript, I appendChildNodes()-ed some text and an img to an existing img. I apologize. Firefox told me it was OK. To put it more accurately, Firefox didn’t tell me anything, and just … Continue reading

Posted in Javascript, Programming, rants | Tagged , , , , | 1 Comment

Computing Large Determinants in Python

Story: For my seminar work, I had to calculate the determinant of a large integer matrix. In this case, large meant n>=500. You might say that this isn’t very large and I would agree. However, it is large enough to … Continue reading

Posted in Algorithms, computer science, Math, Programming, Python, Research | Tagged , , , , , | 2 Comments