Category Archives: Python

Projections

Today I’d like to present a little Python script that extrapolates Webalizer reports. Webalizer is a “fast, free web server log file analysis program” that my webhost uses to produce HTML traffic reports. These reports include month-by-month totals for the … Continue reading

Posted in Python, Web stuff | Comments Off

OAuth

I’ve been working with Twitter’s OAuth interface. It’s pretty simple once you get the hang of it, but I found it a little fiddly at the outset. (If you get something subtly wrong It Just Doesn’t Work, and there’s no … Continue reading

Posted in Python | Comments Off

Full Text Search (Part 1)

I want to add full text search (FTS) to my iKnowPeople app. (Have I mentioned that you can buy it on iTunes?). FTS is a pretty old idea, and most DBs support it (albeit usually through some sort of add-on). … Continue reading

Posted in iPhone, Python | Comments Off

I Habd A Code

I’m a bit under the weather, so all I’ve got today is a quick set of useful co-ordinates. They are: (47, 159).

Posted in iPhone, Python | Comments Off

Merry Christmas

s = ‘s = %s; print s %% repr(s)’; print s % repr(s) (Put it in a file, e.g. ps.py, then run python ps.py | python | python | python | python | python | python | python | python … Continue reading

Posted in Python | Comments Off

Probability

Something a little lighter today: a probability puzzle. Consider this snippet of code: def roll(a,b): # Assume that a and b are both integers greater than 0 return random.randint(0,a-1) > random.randint(0,b-1) What is the probability that roll() returns True for … Continue reading

Posted in Python | Comments Off

Time Sink

Do you like Python? Do you enjoy challenges? Well, why not try the Python Challenge? And, just because I think it’s funny, from a 1969 Ebert review: It is said that Orson Welles saw John Ford’s “Stagecoach” 200 times before … Continue reading

Posted in Jack Handy, Python | Comments Off

Licenses

Last week, a reader wrote in with this question: [Y]ou’ve got all this great code, but you haven’t declared a license. Is it public domain, or BSD? This is, as they say, a fair question. I address it today.

Posted in iPhone, Planet Microsoft, Projects, Python, Reverse Engineering, UNIX, Web stuff | Comments Off

Crazy Talk

Today, something frivolous. Perhaps you’re acquainted with Infocom’s 1983 classic, Planetfall? It’s a good game, but today I want to talk about its manual. Planetfall’s manual included a recruitment pitch/application form for the “Stellar Patrol”, and the form included a … Continue reading

Posted in Python | Comments Off

No-op KenKen Solver

A popular KenKen variant is the “no-op” puzzle, in which only the result of a cage is given. (In “standard” KenKen, both the result and an operator are given.) A reader wrote in with a question about a no-op puzzle, … Continue reading

Posted in Python | Comments Off