Benedetti and Cranley's Head First jQuery
A very helpful book for those who want to get familiar with jQuery. The examples cover a great deal of common-use functionality and offer some guidance on better practices and style for those who are unfamiliar to modern JavaScript programming.
Learning Android, by Marko Gargenta
This is a fairly good book that will take you through your first steps on Android application development. It goes over key concepts like activities, services, intents and asynchronous tasks, explores the helpers and builders in Eclipse (but does not refrain itself from going into the XML when needed) and does so by going through the development of a simple application. I think the best way to go through this book is to follow along and build your own. If the book has any weak spot, it's the sample application. For a book like this, I would not use a Twitter client - the Twitter API introduces some needless complexities into what should be a trivial example (and I, most certainly, don't want to develop yet another Twitter client). By going with a Twitter client, the book also somewhat limits itself to a certain narrow usage example and that affects what the book covers in terms of UI and tooling.
It took me a while to get through it because I opted to write an application different from the Yamba example (for the reasons I stated above). If you decide to go closely with the book example, you should do it in about a week. It also didn't help me the fact I could not dedicate more than a couple hours per week to the project.
A final piece of advice: I reviewed the ePub version on a Nook. The screen images were somewhat hard to read and I had to use the PDF version to see some of the finer detail. I am not sure whether this is a problem with the ePub version or with my specific e-reader (it has some issues). Your mileage may vary.
Pros: Short, easy to understand, well written
Cons: The example app is not perfect for the task
Best uses: Those new to Android
On "Closure: The Definitive Guide" by Michael Bolin
“Closure: The Definitive Guide” by Michael Bolin does a nice job on explaining a battle-tested, very complex tool that helps maintaining very complex JavaScript codebases manageable and understandable. Appendix B itself is worth the book, as it explains many of the JavaScript quirks to newbies and made me learn I was not as good as I thought I was. The world would be a better place if all JavaScript programmers read the appendix.
The rest of the book is what I expected - it teaches the reader how to build an application using Closure to your advantage, making your code more future-proof, browser-proof, more expressive, verifiable and testable. It covers the Closure Library, the Closure Compiler (a tool able to compile your JavaScript code into very compact JavaScript and Java that runs on your server - and, maybe, your mobile too), templates, widgets, AJAX, automated building and debugging. While we learn all that, the author also teaches us about the process of making a Google-sized web application. If you are at all familiar with JavaScript, the idea of doing a huge application is terrifying. After reading the book, while still scary, at least if feels possible to mere mortals.
If you are feeling the pressure of maintaining a big JavaScript project and is considering selling management the idea of migrating it to a JavaScript framework that encourages good practices (JavaScript makes it very easy to shoot yourself in the foot), this may be the book for you.
You can grab it directly on the O'Reilly web site. The e-book version comes without DRM and has Kindle, ePub, PDF and Android versions.
A picture for users of lesser OSs
All in all, GNU/Linuxes are pretty mundane operating systems. There is nothing too fancy about them - It's more or less a collection of operating systems good ideas (Andrew Tanenbaum will never read this, fortunately), rolled out as a kernel (Linux itself), with a very polished userland (GNU, plus other programs that particular distros select) on top of it.
Its roots date back to the 70s, to Unix - it was made to its image. Current versions of both are quite similar and a Linux user will be pretty much at home on OSX, BSD, Solaris or AIX.
But those 70's ideas do not mean Linux is an old-fashined OS that brought nothing new to the world of operating systems.
One of the nicest things GNU/Linux introduced is comprehensive software package dependency and update management. With it, if you want to install a program, you can pick it from a list and, like by magic, all libraries, resources and everything else the program depends, plus the program itself, are installed. No need to browse the web after an installer, no need to run programs as a super-user, nothing. Everything quick and simple. And then, when the time comes a new version of something in your computer becomes available, the machine warns you and prompts you to install it, regardless of where it came from, as long as its publisher is registered with the software management system (like the Chrome browser and the VirtualBox VM tools in the picture you see, as well as Skype, which you don't see in the picture because mine is up-to-date). Software components are neatly divided in packages that depend on each other. Need a DVD burner? Codecs will be downloaded with it.
And then, when something becomes unnecessary or obsolete, the machine offers to delete it and conserve disk space.
Other operating systems attempt to accomplish the same with a variety of tools, but none, perhaps with the exception of OpenSolaris (because they hired the guy who designed Debian's package management), has anything that comes even close.
Cool, isn't it?
An Emacs cheatsheet as a mindmap
I have been using Emacs for some time now. It has a very steep learning curve, but its power and elegance make it my editor of choice for just about everything. So, inspired by this article, I decided to create my own Emacs cheatsheet. There are many Emacs cheatsheets, but all of them use a tabular format that is not, in my noob opinion, the best way to convey such information: you can interpret the Emacs commands as a tree-like keystroke structure and many important commands use two or more steps.
I started a mind-map for the keystroke trees with the commands I use the most (and some of the ones I find the most amusing). The plan is to make a navigable cheat sheet like the Mercurial and Git ones you can get here and here, plus some tips on what to add to your ~/emacs.d/init.el file.
You can get the very, very early version of the mind-map (in Freemind format) here or just look into the image that follows.
All the heavy magic is also missing, like the "smart paste" Marco Baringer does about 1:45 into the What is Ajax screencast that relates to the David Crane's Ajax in Action book (that I still don't know how is done).
I would appreciate any advice from Emacs veterans and newbies alike, so, feel free to comment.
Editor nirvana
To say GNU Emacs is merely a text editor is an understatement. Ever since I decided I would learn to use it (out of a never quite accomplished mission of learning Lisp once and for all), it impresses me almost on a daily basis.
Yesterday, while playing with my choice of screen fonts for the editor (something every bit as important as choosing one's text editor), I discovered two pop-up menu options, to increase and decrease font size. A little playing with Meta-X and I arrived a couple functions, "text-scale-increase" and "text-scale-decrease". A little more digging brought me to the key combinations "Control X Control plus" and "Control X Control minus" sequences. Usable, but I wanted something easier to type.
Few non-Emacs users appreciate the fact Emacs has no configuration file. What it has is a program, in its own Lisp dialect, that's executed every time the editor is started. Within this program I can define new functions, load external libraries and even write a credible implementation of vi. This time I made two simple edits to my init.el file that added two new key bindings:
(global-set-key (kbd "C--") 'text-scale-decrease) (global-set-key (kbd "C-+") 'text-scale-increase)
The first one binds the "Control minus" key combination to the text-scale-decrease function (that decreases text size) while the second binds "Control plus" to the opposite text-scale-increase function. Easy enough for me. Now, every time Emacs starts, it has a couple bindings extra key bindings (on top of all other already added by loading external libraries, modules and so on) that make my life more convenient.
And this concludes my Emacs praise of the day. Thanks for coming.
I really want to like Apple
I do. Seriously.
I loved my Apple IIs passionately. I love my Macintosh collection (from SE to Bondi-blue iMac). While not being a heavy Mac user, I keep a Mac on my desk as a second computer to my main computer (a netbook running Linux because I like carrying it around, because it's cheap and because I like Linux better than OSX for work), I still like Apple's products and recommend them when I feel it's appropriate. For instance, when my then fiancée wanted a new notebook, I convinced her she would be happy with a Macbook, and so she is. She even married me after that.
But I don't think Apple loves me. Or, by the way, any of their lovers.
One cable
Some time ago, I bough an iPod Touch. I was about to build an application for it, and, so, I needed one. I quickly fell in love with it as a media player as well as a über-PDA with web access. At the time, there was no iPhone SDK and the project was canned, but, by then, I already liked the iPod pretty much. The cancellation was also fine by me because, while Objective-C is a much better idea than C++, being better than C++ doesn't say that much. Still, I kept the iPod and soon listening to audio podcasts became part of my morning routine as much as watching the video ones became a lifesaver when our weekly air-traffic-control meltdown left me stranded on some small airport with no wireless access.
So, it was only natural for me to buy a cable to hook it up to my TV.
Despite the size of Brazil's consumer market, there are no Apple Stores here. Many people attribute this, along with what appears to be active sabotage by Apple, to its deep hatred for the only country that had a company that dared to attempt to produce a Mac-compatible computer (that's one ugly story). fortunately, there are some companies who decided they would try to cater to the unrequited love Apple turned its corporate back on and build the stores themselves. So, I went to the next best thing: the local "a2you" chain of stores and got myself a composite cable.
It worked beautifully.
I mean... The user interface is really horrid for playing videos and watching them from the couch. Unless your videos happen to be long enough, you will have to play each one from the iPod itself. There appears to be no video playlist thingie anywhere on the iPod. Audio went just fine, but not video.
Then I got involved in another project involving podcasts.
So, the time came for me to update the iPod's software. It is a first-gen iPod Touch that came with 1.0 software (update to 1.1.5, if I remember correctly), so I created an account on the iTunes store and downloaded the software. OS 3 is a nice improvement over 2.x and is a huge improvement over the 1.x I was running. It's not as snappy as the 1.x (it really seems built for the "S" iPhones) but it's bearable.
But it had one unwelcome side effect: my composite cable no longer works.
DRM (as in Digital Restrictions Management)
I mean, it does, then it doesn't.
It's not a cable problem. It worked flawlessly with 1.x. It still works on 1.x units.
The problem seems to be the software. It, apparently checks if the cable is made by Apple and then, in the middle of the playback (just demonstrating the cable works perfectly), it freezes the video and spits a "This accessory is not compatible with this iPod" or something like it. Well... It's a cable! How incompatible with something can a cable be? Is it a DRM issue? Is it built-in for future HD iPods to render cables that do not provide copy-protection useless? It's an analog cable! The lowest-quality one! Who would consider using it for piracy? And to pirate what? TED lectures? Episodes of Cranky Geeks? Conference presentations? It's much easier just to rip the DRM off the original file (and there are many automated tools for that).
This and the recent Amazon Kindle problem - Jeff Bezos can apologize as much as he wants, the ability to remove content you already purchased is still there and can be abused anytime Amazon feels like breaking promises - got me really weary of DRM. Even for single-purpose devices I buy for a single purpose, a software update can break the hardware I already own, even something as simple as a cable. It's not my device if Apple can do things like this with it. I may possess it, but, in reality, it belongs to, and obeys, Apple. If Apple decides to brick it, bricked it will be.
Then, there is also the shady process Apple uses to approve applications. It's not in the best interest of their customers to Apple to have a stranglehold on applications for the platform. I understand they want quality control, but customers may want to circumvent that control for their own uses. Or because they have different ideas about quality.
Defective by Industrial Design
You know... The Apple tablet the Financial Times seems to have confirmed today looks sweet. I would love to play with it. I would even consider buying one, but I won't. The point is, as much as I like Apple's attention to detail, its outstanding industrial design, I can't justify buying a product that's not really mine. Call me spoiled, but using stuff like Linux made me feel I am really in control. The netbook is mine, and nobody will make my computer do something I don't approve. If it ceases to work, it will be my fault.
So, if Apple would please unbreak their software ecosystem in a way it doesn't actively try to screw its customers, I may consider buying a tablet (or an iPhone or even another iPod touch for the day this one dies).
But recovering the trust I had on their attention to their customers will take some time.
An Interesting Update
I must confess I did not search the web (or Apple's forums) before either upgrading or buying the cable (that one was not my fault, as it worked by the time it was purchased and stayed that way until a couple days ago), but, because someone reminded me I could do that, I googled for it and found this:
http://discussions.apple.com/thread.jspa?threadID=2046835
So, at least now I know I am not alone with my cable problems. And, finally, I am convinced it's not a cable problem and not a connector problem, but a vendor selection problem.
Also, for some time, a lively discussion about it, and, perhaps, my scientific method, happened here:
http://news.ycombinator.com/item?id=726922
Hacker News (the site at ycombinator.com) is considered a Troll-free zone and I wish it to remain so. Please, if you want to participate there, mind your manners and read and obey the guidelines.
An obvious answer and why I still won't switch to Mac
There was one nagging thought that was lurking in my brain while I wrote my last post that finally condensed into a fully-formed idea: you should use the platform that has everything the platform you develop for has.
Five reasons why this developer won't switch to Mac
There are many reasons to switch to Mac (or, better, to switch away from Windows), but being a software developer is most certainly not one of them