What I’ve Been Reading

Norwegian Wood by Haruki Murakami. I visited Japan a couple of years ago. At the time I thought it was the most ‘foreign’ country I had visited. Yet this translated novel about a 19-year-old university student who lives in Tokyo describes a life surprisingly like my university life. Except the protagonist has girlfriends, a concept sadly absent from my student years. Highly readable, but slightly on the depressing side as no less than four characters commit suicide.

Bright Lights, Big City by Jay McInerney. Apparently this was an enormous book in the 80s. I was too young to be aware of it, although I suspect this was the book my English teacher described when trying to explain writing in the second person. (“You did this. You said that”). The whole book is in the second person, slightly disconcertingly. If you like your books full of stories of cocaine and spousal abandonment, this is for you.

Into the Wild by Jon Krakauer. The book that led to last year’s movie. A bright, successful American student graduates and then wanders through the American wild. He ends up in Alaska where he meets his dismise. I liked this book a lot – because of Jon Krakauer’s highly readable style and because of the story of a young man who refused to follow society’s norms.

The Gargoyle by Andrew Davidson, which seems to be unreleased in the states, although I’ve got a UK-edition paperback. It’s an unusual novel, hard to categorise. It’s sort of a love story, but that’s selling it short. Badly-burnt burns patient encounters nutcase who believes she was already alive in medieval Germany. Lots of stories-within-stories. Unique.

The Communist Manifesto by Karl Marx and Friedrich Engels. Very disappointing. I thought I should read some pivotal texts first-hand and started with this. This is the manifesto that led to revolution in several countries – most notably Russia and China – while others such as Italy and France narrowly avoided it? It seemed to me a polemic rant with little rationalised argument. Perhaps that’s because I’m not living in 19th-century Europe’s highly explotiative economy.

Cha-ching!

In the first months of Poker Copilot, every sale was a cause for celebration. To ensure I celebrated as soon as the sale happened, I set up “You have a sale” e-mails to trigger an SMS to my mobile phone. It was pretty cool to get an SMS whenever I got a sale. At first.

As sales increased these SMS messages deprived me of a good night’s sleep. The majority of my sales occur in the US evening, while people living in Europe (such as myself) are sleeping. Multiple SMS messages throughout the night stops being fun really quickly. So I disabled this system long ago.

Today I set up a more humane, non-sleep-depriving alternative. When my computer is on and Mac Mail is running, any “You have a sale” e-mail now triggers a thoroughly satisfying cha-ching noise.
I didn’t think at first that Mac Mail could do this sort of thing, but indeed it can. In Mail’s Preferences, there’s a “Rules” panel which allows for all sorts of event-driven interaction:
Here’s how simple it was to set up my cha-ching! rule:


It’s rewarding, when deep in thought trying to track down a bug, to hear the sound of money arriving into the virtual cash register.

Hero Stats for Current Table Only

“Hero Stats for Current Table Only” is the most requested feature for Poker Copilot. I’ve now added this to Poker Copilot 2.

A new early access version of Poker Copilot 2 is available here. This screenshot shows most of the changes:
What’s changed:

  • The HUD is working again, and now with more options
  • You can now display up to 12 stats in the HUD
  • Several bug fixes. I found the bugs through crash reports, so thank you for sending these.

Poker Copilot 1.74 Released

I’ve released Poker Copilot 1.74, which you download here.

This fixes a subtle bug where some people would find their HUD would stop displaying info for certain seats. If you are already affected by this bug, you should do the following:
1. Go to the new screen Tools -> HUD Config Viewer
2. On that screen, find the combination of poker room, theme, and table size where your HUD is missing for certain seats.
3. Click on “Reset to Default”.

Technical Note: This was caused by class that was once thread-safe class but ceased to be so when I added a new method, forgetting to add synchronisation. Which led to my post-Java manifesto post.

C is to Java as Java is to what?

11 years ago I first encountered Java. Before then I mostly used C. I immediately loved how Java kept familiar C constructs but protected me from the most common, most difficult, and most time-consuming bugs. No more string buffer overflows? Awesome! Out-of-bounds array indices caught at runtime? Awesome! No need to allocate and (forget to) release memory? Awesome! No more core dumps? More than awesome! This is what I imagined programmer heaven to be like.

Even expert C programmers often wrote code that had buffer overflows and memory leaks. Making sure code didn’t have such problems took a lot of hard-to-test mental reasoning. Introducing such problems in maintenance code was a continual danger.

I doubted that Java could offer these features while giving reasonable performance. And in fact, in early versions it couldn’t. But over the years all sorts of optimisations have made Java performance adequate for most computing tasks.

Jump forward to today. My most troublesome bugs in Poker Copilot lie in a different area: concurrency mostly in the form of thread-safety. It’s possible to have two or more pieces of code running more-or-less in parallel, accessing the same resources, sharing information, and needing to co-ordinate their activities.

Even expert Java programmers have trouble writing thread-safe code. Making sure multi-threaded code doesn’t have synchronisation problems takes a lot of hard-to-test mental reasoning. Introducing such problems in maintenance code is a continual danger.

I use the Java concurrency API. It’s good. It helps me a lot. I’ve read, re-read, and tried to grok Java Concurrency in Practice. It’s also good and helps me a lot. But these are not enough.

What I long for is a language that’s similar to Java but designed at every level to help write multi-threaded code. Something that offers me familiar constructs and concepts. Yet something that offers me better help for writing thread-safe code. Perhaps a language where objects are immutable by default, unless I specifically mark them as not immutable (Immutable objects make concurrency easier). Perhaps a language where I can mark a class as synchronized, which automatically makes all methods in the class synchronized (therefore ensuring that only one method in the class can run at once). Perhaps a language where parameters are passed as deep copies by default, or as copy-on-write objects, unless I mark them otherwise.

Many Java projects are riddled with obscure concurrency bugs. It’s hard to get even the most basic code right, as I demonstrate with code to format a date as a String.

Competitors for Google?

Google delivers 97% of my search engine traffic. Yahoo, Live, and the smaller search engines share the remaining 3%. This situation unsettles me somewhat. Google’s double-top-secret page ranking algorithm is regularly tweaked, and if one of those tweaks were to push Poker Copilot into oblivion, my sales would drop dramatically. It seems that one large company has too much influence on small IT companies like mine that sell solely through the web.

Therefore I wish the best of luck to Google challengers new and old. I’d feel more comfortable if there were a number of viable and competitive search engines, rather than one enormous publicly-listed organisation having a global near-monopoly.

Poker Copilot goes Cyrillic?

I occasionally sell copies of Poker Copilot to Russian customers. They’ve been registering using Latin letters and English place names. So the city is Moscow, for example, instead of Москва. In the last week or so, however, I’ve started getting purchases from Russia in Cyrillic. I’m not sure why this is now happening, but I like it.

This cry for help appeared today on the Poker Copilot Get Satisfaction forums:

ПОМОГИТЕ!! КАК РАБОТАТЬ В COPILOT?

ЛЮДИ,ПОМОГИТЕ СКАЧАЛА ПРОГРАММУ,А КАК ПОЛЬЗОВАТЬСЯ НЕ ЗНАЮ.сУЩЕСТВУЕТ ЛИ КАКАЯ ИНСТРУКЦИЯ ПО РАБОТЕ В НЕЙ?ЕСЛИ ДА ТО ГДЕ МОЖНО ЕЁ НАЙТИ?ЗАРАНЕЕ ОГРОМНОЕ СПАСИБО!!!!!:)))

My Russian never got much beyond this: Я хочу пива. Спасибо. But with the help of Google, I worked out that it’s someone asking for assistance in how to use Poker Copilot. Any Russian speakers who would like to answer this person?