Category Archives: Programming

Python and Tichu goodness

The beginnings of Perl were directly inspired by running into a problem I
couldn’t solve with the tools I had. Or rather, that I couldn’t easily
solve. As the Apostle Paul so succinctly put it, “All things are
possible, but not all things are expedient.” I could have solved my
problem with awk and shell eventually, but I possess a fortuitous surplus
of the three chief virtues of a programmer: Laziness, Impatience and
Hubris. I was too lazy to do it in awk because it would have been hard to
get awk to jump through the hoops I was wanting it to jump through. I was
too impatient to wait for awk to finish because it was so slow. And
finally, I had the hubris to think I could do better.

  — Larry Wall

I wrote my second Python script for Tichu game data this weekend. My first script was recording a game’s score and any GrandTichu or Tichu calls made. It would take that data and generate an HTML table. Which I would then paste into my game reports. It works well enough for me. So I stopped improving on it. Although certain others would disagree and argue that the data is not presentented effectively.

However, I still have an urge for more data shown about a game. So I wrote a program that would take this and output this. Last Thursday, Adam and I tried to enter hand data during our game of Tichu. And I have learned that it is slow, takes thought power away from playing the game, and other people are not so understanding about this process. So, I am going to set up a camera to take a picture during evey hand played. Hopefully, this will finally allow me to finally record every hand played during the game. Of course, data entry will be a bitch!

And what do I intend to do with this data? Who knows… if you build it, they will come! Perhaps a cute flash app to present the game. Perhaps a data-mining application. Or perhaps an ugly HTML table that others can complain about.

Script writing

For work, I was asked to help port a project to Linux. This involved
working on a computer behind a firewall. I am sure that every one is
familiar with ssh. For those of you who are not, ssh is a program that
encrypts a telnet session. And telnet is a program that allows someone to
log into a computer remotely. So, to access the computer, all I would
need to do is to ssh into it. Unfortunately, it was not that easy.

More follows:

Continue reading

Woo Woo!

I finally got my first J2ME program to work! It is a simple SMTP email program with the blog email address hardcoded in it. I needed to add authentication to make it work. Now, all is well after many trials and tribulations…