So much of the reaction to Math Battle has been that lots of people like the math more than the game. Not what I had anticipated, but I can respect that. I’m working on a new game that is more math, which should please the math people. Here’s an actual screen shot that doesn’t do anything.
Author Archives: john
Math Battle release date
Math Battle will go live Monday, Nov 28, 2011. And the price? Free!
Math Battle Tutorial
Math Battle will soon go live. Here’s a the tutorial, which is accessible from within the app:
iPhone 4s/5 Speculation
As is usual, there’s a lot of speculation regarding the details of the new iPhone. What is interesting this time around is that there seems to be evidence for two different models. One an iPhone 4s, that would resemble the current iPhone 4 in terms of design. The other is a device with a larger screen, but has a design that echos the iPad 2 but with a taper and an oblong home button. The 4s rumors are supported by photos of components that would fit in it. The 5 rumors arise due to photos of protective cases that are popping up all over.
While some think there might be two iPhone models I wonder if something else isn’t at play. The putative iPhone 5 design actually resembles the iPod Touch in some ways more than an iPhone. It is thin. It doesn’t seem to have an obvious place for an antenna. Its larger screen would be attractive to iPod Touch users who tend to use it for games.
In any case the new iPhone is highly anticipated. By waiting to introduce it until fall rather than its usual early summer debut Apple has probably raised expectations. The problem is that the iPhone 4 is still an excellent phone. It has an incredibly solid design (glass back notwithstanding), a fast processor, a lot of memory, and a beautiful screen. The jump from the 3gs to the 4 was huge. Even with the extra time it isn’t likely that Apple is going to pull off that size of jump again. I think that the desire for the 5 is due to people wanting to see that same sort of leap forward. A larger screen and thinner device would be improvements, but I’m guessing that if they materialize it will be in the form of an iPod.
Asteroids & Arithmetic and Atari
Yesterday Apple forwarded me correspondence from Atari. They have claimed that my game Asteroids & Arithmetic infringes on their trademark and have requested that it be immediately removed from the App Store.
The email from Apple suggested that I could justify my use of the term and attempt to fight this or remove my app from the store.
Given that I’ve given the app away for free from the start I have no financial means to get into a tussle with Atari. The name was chosen simply because it is descriptive. There are asteroids to shoot and there is arithmetic to do.
There are several other games in the App Store that contain the word Asteroids. I wonder if they got similar letters yesterday.
I am considering what to do with my game. Should I leave it dead? Rename it? For now I’ve got other stuff to do, so it will be unavailable for a while. Sorry about that.
IOError: [Errno 32] Broken pipe
Once I spent 8 hours looking for what turned out to be a missing asterisk.
This is the story of how I spent much longer looking for a print statement.
Long story short I had a cron job that would run just fine when I ran it manually but would not complete when cron ran it.
I thought it might be an issue with the fact that cron runs under a different environment than a program invoked from the command line. I verified my python virtual environment again and again. I could find no difference.
Finally I did what I should have done from the start: store the output from stderr in a file. This is done thusly:
/home/user/path/to/script.sh >/tmp/output 2>&1
Looking at the end of the output of the script that invoke my python program I found:
IOError: [Errno 32] Broken pipe
At the end of a stack trace. The last line in the stack trace was the normally innocuous:
print "primaryupc does not match any upc: ",primary
Which was a warning that serves a purpose but not an important one.
Removed the line, program ran as it should as a cron job.
With some googling I’ve come across the following unsatisfactory explanations:
Jay Taylor’s blog
2004 post in comp.lang.python
So it seems that you should put print statements in scripts that will run from cron jobs. Who knew?
iPad Simulator Screenshot
When running iOS apps in the simulator you can take a screenshot with control-command-c.
This is easier than using Grab and then trying to crop accurately. Also if the iPad simulator is downscaling your copied image still comes out at full resolution.
So now you’ve got an image in the clipboard, what do you do with it? Open Preview and hit command-n. That will create a new window with the current clipboard image in it. Then save the thing as a png or do whatever else you’d like with it.
iPad Pro
The largest jump in quality of experience between iPhone models has been the 3GS to iPhone 4 change. The new device was faster, had more memory, and a much more solid build quality. But the biggest change in the experience was the screen. Going from 320 x 480 to 640 x 960 helped with games and graphics, but the big difference it made initially was in terms of text. Text went from acceptable to razor sharp. The pleasure of reading from a Retina Display compare to the old display is visceral. Going back to an old device feels like a substandard experience.
As Amazon prepares to enter the table market with the ability to supply an enormous amount of content upgrading the display of the iPad only makes sense.
Apple claimed that the iPad 2 has nine times the graphics power of its predecessor. That is more than enough power to push four times the pixels. It might require some additional graphics memory as well, but the power is already there to drive a Retina Display in the iPad 2. I wouldn’t be the least bit surprised to see Apple introduce a Retina Display iPad model as a high end complement to its existing line-up this fall.
The device will make reading much more enjoyable. It might not match the readability of e-ink, but it will be infinitely more flexible, making for sharper games, movies, and other applications that we haven’t imagined yet.
To those that say the iPad 2 is selling as fast as Apple can make them, I remind you that this is the company that killed the hugely popular iPod mini to make way for the iPod nano, and just recently dropped Final Cut Pro for a Final Cut Pro X. If someone is going to make a better tablet this year, Apple wants it to be Apple.
IE7 Bug – POST Request Causes ACK, RST
I’ve spent more time than I care to admit trying to get an application running properly with IE7.
The issue was that each time a long HTTP POST request was sent the server would reset the connection. This only happened with IE7 on newer versions of Python. My old python 2.5 server had no issue with IE7, and IE8 doesn’t appear to have an issue with any server.
Creating a test case for the bug in order to confirm it on a variety of systems and try to diagnose it was simple. I followed the Pylons Hello World tutorial instructions and modified the hello.mako file to return a page with an html form that had a large number of hidden fields (100 to be exact, though exactness doesn’t matter) and had it submit to itself (/hello/index).
IE7 would display the page initially just fine but pressing the Submit button would display an error. “Internet Explorer cannot display the webpage.” and then a bunch of unhelpful stuff, none of which implied in the slightest that IE had screwed up.
I traced these exchanges in WireShark (which is a cool cross platform tool to view low level network traffic) and could see that the server was responding to the POST with a RST, ACK. That means the server was resetting the connection.
But why?
I posted to the Pylons and the Paste mailing lists. Finally Jon Nelson came through with the key detail. IE7 sends a CRLF at the end of the POST request, but doesn’t include those bytes in the length of what it is going to send. This is messed up.
Basically IE sends what it is supposed to send, and then it sends a little extra that isn’t needed and that it didn’t say it would send. This is poor form. So in attempting to comply with the spec, the server points out that this is poor form by resetting the connection instead of leaving the two extra bytes that IE barfed up just hanging there. Rather than say, “Sorry, my bad.” IE acts like it has been wronged in this matter and puts up its strange little error page.
Microsoft has a difficult to locate error page which addresses this issue. Once I had the term “CRLF” to add to my googling I found it pretty easily, but prior to that no amount of googling seemed to help.
Here’s the relevant page: http://support.microsoft.com/kb/823099
Annoyingly the page says that this applies to IE6 and doesn’t mention IE7. Maybe thy have another page for IE7. I don’t know. But I applied the registry fix manually by adding a SendExtraCRLF key set to zero and suddenly my application worked with IE7 again.
Unfortunately I don’t think I can really ask my users to all go apply a registry fix, so now it is time to talk to the IT department to see what can be done.
I am left wondering two things:
1. Why on earth didn’t MS fix this crap in an update to IE7? Why should I have to mess with the registry to get a browser that sends only as much data as it says it will and complies with simple HTTP sepcs?
2. When did Python (or is this a bug in Paste? I can’t find where it lives) start worrying more about the correctness of HTTP requests? While the new behavior is probably correct in a strict technical sense, the old behavior worked. It would be lovely if I could get an error message of some sort when this type of thing happens so that I can find where to address it, or at least the right project to address my questions to.
Great Post on Marketing
Here’s a great post on how to make your app market itself. I pretty much need to do all of these things, posting it here as a reminder to myself and any others:
http://runmad.com/blog/2011/04/assisted-word-of-mouth-get-users-to-sell-your-app/
