12/12/2009
Update 2: New versions of several of these apps have been released. Things are
a lot better.
Update:I’ve had feedback on this post from O’Reilly both by email and in the comments. Both Andrew and the other O’Reilly representative I’ve been in contact with seem sincere when they say that these apps will be updated with fixes for the downright broken content and that they intend to invest in further development for the mobile platform.
Since this was pretty much what I’d hoped to hear, I’m going to say that this little outburst served its cause.
To whom it may concern.
I have for years been a satisfied customer of O’Reilly. I’ve bought and enjoyed several books from you both as dead tree paperbacks and downloadable PDFs.
To my chagrin I also bought a number of titles on the iTunes app store once I found out that you publish a selection of your books as standalone apps there. I’m sad to report that I found these apps to be rather disappointing. In fact they are complete and utter crap.

It’s apparent that what you have done is to adopt the Stanza engine and stripped it down to contain one book per instance. Unless you’ve reinvented an already triangular wheel it also seems that you simply process your Safari PDFs through the downloadable helper app and then push the results to the app store.
Look; Stanza is a great e-book reader when it comes to downloading and reading “Frankenstein” as a Public Domain EPub book. And if you have some totally-not-copyrighted PDF you want to get onto your iPhone the desktop Stanza app does a tolerable job of ripping the file to HTML and reflowing it to read nicely on the small display, but converting PDFs with Stanza in this manner is, undeniably, a hack. It’s a workaround to get a PDF meant for a big screen unto a small screen, no questions asked.
Stanza is admittedly a pretty good solution to get a book onto the iPhone, a few formatting issues aside. There is however a considerable difference between reading a novel and feeling slightly irked because the chapter titles don’t show up in bold and reading a book on programming where half of the code is illegible, broken, or overflows beyond the page and into oblivion.
Read the rest of this article »
3/12/2009
One of my pet peeves is that most regular expressions matching URLs fall somewhat short of what I expect. This pattern from John Gruber is so far the best I’ve found but, like virtually every other implementation, it doesn’t match URLs without protocol. Nobody expects to have to include “www” in a URL for it to work these days, and in daily conversations it’s rare to enunciate “aitch-tee-tee-pee-colon-slash-slash” when you refer to some website. So why is it so hard to match URLs without using these strings as crutches?

Read the rest of this article »
22/03/2009
Update!! Yahoo did the same dick move of cockblocking Flash. :/ To remedy this the URLRequest on line 80 had to be changed. If your project used to work but doesn’t anymore; Try this. If this is your first time here; Ignore this message.
—
Ad infinitum, ad nauseum.
So, I saw that I’m still getting some traffic to this post where I suggested a solution to the Twitter crossdomain.xml problem.
The Yahoo pipes solution still works fine, but my code is a godawful mess and I decided I’d have to fix it up a bit. The methodology is essentially the same. We’ll be using this yahoo pipe, but it’s neatly blackboxed so that you just need to know your Twitter ID to use this class.
Read the rest of this article »
2/02/2009
A fairly common task in ActionScript projects is to deal with URLs in dynamically loaded text. Whenever I faced this prospect I usually ended up with some half-assed searching for “http://” and then indexOf(” “) to determine when the URL had ended and then smacked a <a href> on either side. Which pretty much meant that “http://___||/**.tasty_cheese_omelete” would be acceptable while “google.com” would not.
Hence I always promised myself that next time I’d write a proper class to deal with URLs so that this bullshit wouldn’t pass anymore.
Regular Expressions have always scared the bejeezus out of me, but I realized there was probably no other option when looking for something that has a valid URL structure. It was surprisingly easy to find some fairly good examples for what I wanted to achieve, and surprisingly difficult to get any of them to work in ActionScript. I’m blaming it on the AS implementation of RegExp, and I’m sure ActionScript is blaming it on my implementation of dumb.
After some swearing though I managed to determine whather a string had the proper structure of a URL but it still wasn’t perfect. I wanted my class to be intelligent enough to accept all valid Top Level Domains (there’s 267 in use) but reject any invalid attempt to pass as a valid TLD. IE: egypt.eg should pass, but breakfast.egg should not. The solution ended up being storing all the TLDs in a Vector and parsing through them to check if the domain was valid.
All in all the class now does a pretty good job, although there are probably still holes in it (let me know about them when you find them).
Check it out and grab it below, and then post a comment explaining to me slowly and carefully that I can achieve this exact functionality with the
1
| String.giveMeAllTheURLs(); |
method or something similar, which I’m sure is what will happen. ;)
The code is freely available here. I would appreciate any credit and that you share whatever improvements you make with me and the rest of the world, but I have neither time nor energy surplus to actually do any enforcing, so knock yourself out.