This afternoon I had the time to finally watch the PeepCodeMeet MacRuby screencast.
In case you don’t know MacRuby, it’s a Ruby interpreter sitting on top of Objective-C and OS X core technologies (see also here).
During the 74 minute screencast you will build a basic but functional Twitter client, and in the process learn about MacRuby and Cocoa basics, using Xcode and InterfaceBuilder to develop and bundle your application and many other interesting topics.
The screencast is very well structured, easy to follow and full of good and practical information, including perks and rough edges of the current MacRuby version. All in all a really enjoyable and informative video, which is well worth US$9 (or less if you buy packs of credits)!
I read Ruby in Practice for the upcoming book promotion on RubyLearning, and I have to say it’s a pretty neat book which will be well worth your time and money. Over the course of 360 pages Jeremy McAnally and Assaf Arkin tackle lots of different topics of interest to developers. The book is structured in 3 main parts:
Ruby techniques: Gives a general introduction to Ruby’s strength (which sometimes reads as a bit of a sales pitch), BDD and TDD, as well as scripting with Ruby (including OLE and OSA).
Integration and communication: This part covers Rails, web services in general (HTTP, REST, SOAP), automating communication with email and IM, asynchronous messaging and deployment options.
Data and document techniques: This part talks about databases, structured text, authentication, searching, indexing and document processing.
Chapters usually present the reader with a problem, then show an example solution which usually makes good use of existing libraries and then finish with further discussion on the topic (alternative ways to implement it, pitfalls in using the shown solution in “real life” scenarios etc.). For people with previous knowledge of Ruby this book is a good read, which shows how the dynamic nature of the language combined with the quite big amount of readily available libraries enable developers to quickly and efficiently find solutions to common problems. I sometimes do have minor quirks with some of the code, but that’s just personal preferences and being nitpicky. All in all it’s a very solid book which I enjoy quite a lot.
Step 1: Download Fluid, an awesome little application to create site specific browsers.
Step 2: Find some online API documentation. For Ruby I recommend railsapi.com or RubyBrains.
Step 3: Create your app in Fluid:
Here’s an example screenshot of a site specific browser for RubyBrain.com:
Of course this still requires you to have a working internet connection, but you could always use a local version of the API docs when creating the app. On a related note you should also check out Goo which is a nice alternative to gem server on OS X.
As we all know posting code to Moodle (the software that powers RubyLearning) can be a bit cumbersome. I therefore created a TextMate command which will
take the currently active file
replace all occurrences of < with the HTML-entity
wrap all of that in [code ruby] tags and
copy it to the clipboard, ready to be pasted into the forums.
Playing with Squeak‘s Method Finder, I discovered a really neat feature that I wish would be available for Ruby documentation. Here’s the description from the built-in help:
[…] use an example to find a method in the system. Type receiver, args, and answer in the top pane with periods between the items. 3. 4. 7
Yes, this means that if you want to know how to do modulo in Smalltalk, you can open the Method Finder, type 7. 3. 1 and see that the answer is Number>>\, whereas ‘abc’ . ‘ABC’ will tell us about String>>asUppercase.
Since my reading time wasn’t influenced by distracting things like work or studies last year, I managed to read 69 books since end of April 2008, which quite likely is a new personal record for one year. Here’s the complete list, some of this books I had wanted to read forever, some others were just lucky finds and yet others were just…finds. ;-)
Marion Molteno: “A Language in Common” James Frey: “A Million Little Pieces” Haruki Murakami: “After Dark” Haruki Murakami: “After the Quake: Stories” Ali Smith: “Ali Smith’s Supersonic 70s” Lewis Carroll: “Alice’s Adventures in Wonderland” Neil Gaiman: “American Gods” Heinrich Böll: “Ansichten Eines Clowns” Anita Desai: “Baumgartner’s Bombay” Achmat Dangor: “Bitter Fruit” Monica Ali: “Brick Lane” Heinz Peter Schwerfel: “Buenos Aires intensiv.: Tango urbano – Stadt im Aufbruch” Ines Rieder: “Cosmopolis: Urban Stories by Women” Andrea Camilleri: “Der Hund aus Terracotta” Peter Handke: “Die Angst des Tormanns beim Elfmeter” Thomas Mann: “Die Betrogene. Erzählungen 1940 – 1953.” Helge Schneider: “Die Memoiren des Rodriguez Fazantas” Stanislaw Lem: “Eine Minute der Menschheit.” Orson Scott Card: “Ender’s Game” Terry Pratchett: “Equal Rites” Jonathan Safran Foer: “Everything Is Illuminated” Feridun Zaimoglu: “German Amok.” Terry Pratchett & Neil Gaiman “Good Omens” Haruki Murakami: “Hard-Boiled Wonderland and the End of the World” Irvine Welsh: “If You Liked School, You’ll Love Work” Andre Brink: “Imaginings of Sand” Orhan Pamuk: “Istanbul” Gene Brewer: “K-Pax” Haruki Murakami: “Kafka on the Shore” Peter Handke: “Kali” Feridun Zaimoglu: “Leinwand” Yann Martel: “Life of Pi” William Golding: “Lord of the Flies” Elfriede Jelinek: “Lust” Ryszard Kapuscinski: “Meine Reisen mit Herodot” Saul Bellow: “Mosby’s Memoirs and Other Stories” Howard Marks: “Mr. Nice: An Autobiography” Orhan Pamuk: “My Name Is Red” Eli Gottlieb: “Now You See Him: A Novel” John Steinbeck: “Of Mice and Men” Amit Gilboa “Off the Rails in Phnom Penh” Terry Pratchett: “Pyramids” Paul Torday: “Salmon Fishing in the Yemen” Woody Allen: “Side Effects” Miriam Tzali: “Soweto Stories” Helen Oyeyemi: “The Icarus Girl” John Updike: “Terrorist: A Novel” Jorge Luis Borges: “The Aleph” Zadie Smith: “The Autograph Man” Alex Garland: “The Beach” Iain M. Banks: “The Crow Road” John Case: “The Eighth Day” Paul Theroux: “The Elephanta Suite: Three Novellas” Shan Sa: “The Girl Who Played Go” Leon Uris: “The Haj” Michael Cunningham: “The Hours” Miguel de Cervantes: “The Jealous Extremaduran” Terry Pratchett: “The Last Continent” A. B. Yehoshua: “The Lover” Ernest Hemingway: “The Old Man and The Sea” M. C. Beaton: “The Quiche of Death” Audrey Niffenegger: “The Time Traveler’s Wife” Roddy Doyle: “The Van” H.G. Wells: “The War of the Worlds (Penguin Classics)” Iain M. Banks: “The Wasp Factory: A Novel” Aravind Adiga: “The White Tiger: A Novel” Terry Pratchett: “Thud!” Zadie Smith: “White Teeth: A Novel” Florian Weber: “You’ll Never Walk Alone. Ein Fussballmusikroman”
And that’s the 2 books I’m currently reading:
Nancy L. Clark: “South Africa: The Rise and Fall of Apartheid” Will Ferguson: “Hokkaido Highway Blues”
To get my mind off Ruby I recently started dabbling in Haskell. I really like what I’ve seen so far and it seems I’m finally starting to understand functional programming (my two attempts with Practical Common Lisp never got past the first few chapters).
In case you are interested in Haskell too, here’s a list of the resources I use:
Real World Haskell: Yes, the entire book can be read online (including per paragraph comments!) for free! I’ve only just started reading this, since I first want to brush up my basic Haskell a bit, but once I’m past the Project Euler stage this is probably gonna be very nice.
Write Yourself a Scheme in 48 Hours: Now that I’m slowly getting the hang of this functional programming thing, why not write an interpreter for one functional language in another? “Along the way, you’ll learn Haskell’s I/O, mutable state, dynamic typing, error handling, and parsing features. By the time you finish, you should be fairly fluent in both Haskell and Scheme”. Sounds good to me! :)
Update: Thanks to some feedback I rewrote Enumberable#filter so it doesn’t use ‘eval’. It’s a bit less flexible now and I also like the syntax less, but at least it doesn’t eat puppies for breakfast. As the disclaimer said, maybe it was a bad idea to begin with.
As much as I like Ruby, some constructs I just don’t find too sexy, e.g.:
Disclaimer: Today this seems like a pretty good idea, but I also haven’t slept much. In case this breaks in horrible ways, already exists in some other form or is stupid for some other reason I’m too tired to consider, please let me know.