June 29, 2015
I woke up at a loss, as the notes build was broken, I'd updated my checkouts and pushed the broken code, and the heroku toolbelt wasn't behaving. This was on all my systems, except for an old checkout I had on NetBSD. However, the heroku gem wouldn't install on it. But it was missing from jsplugin, so I added it in. And presto, it started to work!
June 14, 2015
For now, it only supports one site, I'll probably add multiple site support in the near future.
May 27, 2015
I share a lot of links -- by email, I tweet their aggregate statistics, I provide them in json, RSS, and compressed csv. Tonight, I added the option of getting them as well-formed, simple xml for Ibrahim. The entire method is 15 lines and embedded below:
May 21, 2015
There may very well be a clever way to refactor the if statement, but this does work, so I can't be bothered.
May 17, 2015
My adventures with the Internet continue. I decided to get scientific about it though. So I've written a script (in python naturally) to log when the network is down. It does so, by invoking fping in an infinite loop and checking its return code for success, in which case the subprocess module will raise an exception. This exception is caught, the time is logged and the user needs to hit a key to continue. Eventually, I'll probably design a pretty plot, to get some insight as to when the network flakes.
May 11, 2015
A follow up from yesterday's post on locating the direct URL to any flickr photo. I've now added save capability to the current directory. As a final step, I think I'd like to set the desktop background to the downloaded photo automatically. That's for another day, though. With the new feature, the code is below:
The code above will allow you to download images from flickr, even when the photographer has disabled the downloading of their images. Just send it the URL to the any of the image sizes as the "--url=" parameter. As usual, I'm open to suggestions regarding style and readability.
April 28, 2015
April 23, 2015
April 17, 2015
Those who know me know me to be a rather big supporter of the left-wing British MP George Galloway, because of his foreign policy work in the Middle East. This is a personal bias I have.
My economic views, however, are less personal and more scientifically justified. When any economic downturn hits, there are those in governments that say we need to collectively tighten our belts till we grow again and because we the people are the government, the government is included in this list This is what I would term the austerity lot. There are others, however, who feel that government must be the spender of last resort, thus expanding and making up for the slack in the rest of the economy -- the Keynesians. Which strategy does better?
To get an answer, we must define the terms -- what does better mean? Better in the sense of a shallower dip in aggregate economic growth as measured by GDP. Our three candidate countries -- posterboys for austerity, Germany, posterboys for ramping up government spending, China, and a third country that did something in between, the United States. The results are below, followed by the code used to generate the plot:
April 1, 2015
Until I decide otherwise, I'm in south bay and am without a car. So, I'm reliant on Caltrain, whose website leaves much to be desired in the area of easy to access information. How do I know this? Well, if I get annoyed with the user experience, then you can be sure a majority of users are frustrated. However, the good people at caltrans do provide GTFS-compliant feeds, which are trivial to parse. Without further ado:
And a run of it: