September 30, 2015

How to Plot Basketball Data

The code above is based on something I found on thedatagame down under, via reddit. It combines my love of sport with my love of data. I just used the argparse package to parameterise the player name.

September 12, 2015

How to Log Activity from Your Apps

The code above implements the Logging server. I'm putting it up here such that others may use it and make suggestions on improvements. So, go ahead, rip it apart.

September 11, 2015

Howb to Automatically Synchronize CVS and Git

I have been known to say that I don't give a toss what someone uses for version control, as long as they use it. It does strike me that right now, the world is moving towards centralizing on git. On #openbsd, someone was venting about how the project should use git, and others were pushing back. I am not a fan of useless debates. I see the raison-d'etre of the project to be pushing the envelope for security. And, in that vein, I don't give a toss whether they fork darcs and call it libredarcs or continue to use their CVS repository. However, for those of you who like to wank about version control, the script below will let you synchronize a CVS repository with a git repository in a one-way fashion. Further improvements are welcome, especially in the area of preserving commit messages from CVS. Without further ado, the script:

September 5, 2015

August 14, 2015

How to Do Precision/Recall in Perl

The code above mines the buy and sell recommendations of CNBCs Jim Booyah! Cramer stored them in a CSV (with the --op=get parameter) and then analyzes how his picks turned out the next day (with the --op=check option). I would like to write the data to/from a SQL database and generate a report using LaTeX and let skeedaddy know. Ideally, this little project would get a shout-out on the show, but before that happens, I'd like to finish the two things above. The code is in perl, only because there is no better way to parse HTML than HTML::TreeBuilder.

August 5, 2015

How to do Glamour Shots in the Gimp

I was reading about a journalist who showed the effects of photo retouching and decided to figure out how to do the glamour shot in the GIMP 2.8.

First things first, duplicate the layer and add a strong Gaussian Blur (under "Filter" -> "Blur") of around 70px and mode "IRR". This will blow up your highlights. Add a white layer mask and change your foreground colour to a pale grey. Choose the paintbrush tool, setting the brush to a circle/19, zoom to 200% and paint over the eyeball only on both eyes. Now, apply Gaussian blur again, this time at 20.0px and keep the blending mode. To remove wrinkles, use the healing brush (the bandaid in the tools selection) to paint over splotchy skin, wrinkles, etc. Finally, Image => Flatten and save the image. Both images are below:

Gimp Glam Shot

August 4, 2015

Refactoring eBay

Today, I began to refactor my ebay application into separate files. It was fun testing it monolithically, but multiple classes are the way to go, especially when one needs to debug it.

July 26, 2015

How to Deploy a Rails Application in One Command

The second facet of Joel's software test is can you make build in one step?. The rake task below will push all changes to heroku and your secondary upstream ("origin"), run migrations on heroku, and deploy it there, Without further ado, the task is pasted below...

July 12, 2015

How to View HTML Messages in MH

Code above will let you take an nmh folder, save a message to a file, upload it to a remote server, and remove the message from the local mailbox to be viewed with a web browser. I use nmh for my work mailbox, where messages often come encrypted using PGP and therefore can't be viewed on webmail. No matter how many times I tell them, senders insist on HTML mail, so I had to get a workaround.

July 10, 2015

How to See What's in Heroku

I've been away from writing for around a week, but not from coding. I've been working on notes, an anonymous blogging site, not with python (because a prolific programmer does not live by a pirate call and a serpent alone). This site is written using ruby on rails and the admin GUI is in java, with console output, as shown above.