Category Archives: Design

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

A Simple Race-Condition

Lately, I’ve mostly been working on my startup. It’s a web-application, and one of the first things I’ve written was a cache mechanism for some lengthy operations. Yesterday, I found a classic race-condition in that module. I won’t present the … Continue reading

Posted in Databases, Design, Programming | Tagged , , , , , | 14 Comments

Actual Data Always Needs To Be Explicit

This might seem obvious, but it wasn’t to me it first. Now I consider it a database design rule of thumb, or even a patten. I’ll explain using an example. Consider an application where you also need automatic tagging of … Continue reading

Posted in Databases, Design, Programming, startup | Tagged , , | Leave a comment

Database Design Problem

A few weeks ago, I had to work out a database design for my startup. I had a bit of a hard time deciding on a design direction, but after thinking about it, I settled on a design I was … Continue reading

Posted in Databases, Design, startup | Tagged , , , , , , | 5 Comments

Open Question No. 1: Persistent Predicates?

Lately I’ve been developing a website. One issue that I’ll probably need to address in the near future is “persistent predicates”. By “persistent predicates” I mean the problem of treating predicates as data. Consider the following situation: you are developing … Continue reading

Posted in Design, Programming | Tagged , , , | 6 Comments

Issues in writing a VM – Part 3 – State and Memory

When implementing the VM, I had to keep track of state. The state of the VM includes the registers, virtual variables and memory. Fortunately, keeping track of state information is pretty easy. Basically, it amounts to having a dict, where … Continue reading

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

LRU cache solution: a case for linked lists in Python

The reason I put up the LRU cache challenge up, was that I couldn’t think of a good solution to the problem without using linked lists. This has been pointed to by Adam and Erez as well. Adam commented on … Continue reading

Posted in Challenges, Design, Programming, Python | Tagged , , | 3 Comments

Browser visibility-security and invisibility-insecurity

Formal languages have a knack of giving some output, and then later doing something completely different. For example, take the “Halting Problem“, but this is probably too theoretical to be of any relevance… so read on for something a bit … Continue reading

Posted in computer science, Design, Programming, Programming Philosophy, Security | Tagged | Leave a comment

Exception handling policy – use module exception hierarchies

While programming some bigger projects, and not some home-brew script, I used to wonder what to do with exceptions coming from lower level and library modules. The ‘home script’ approach to exceptions is “let it rise” – usually because it … Continue reading

Posted in C, Design, Programming, Python | Tagged , | 1 Comment