Rich's Mad Rants
Powered by Squarespace

Sometimes I think Apple's out to get me!

So, I write an article about installing Ruby for Rails on Tiger. Then Apple announces that RoR will be included in Leopard.

Then I write an article about using TimeMachine over a wireless connection. Just days after the magazine hits the stand, Steve Jobs announces Time Capsule.

Now, I've just finished a pair of articles on RubyCocoa. They haven't even been published yet, but Apple's already at it again.

Today, I just learned about a new, open source project backed by Apple, called MacRuby.

MacRuby is a Ruby 1.9 port that runs on top of Objective-C. It's not ready for prime time yet, but it looks promising. First off, it is Ruby 1.9--which I think is a great thing. Among other things, this means it will be much, much faster than RubyCocoa, which uses Ruby 1.8.

From there, things get really interesting--and just a bit odd. All MacRuby objects are subclasses of NSObject. Because of this, they inherit all the base object methods from both Objective-C and Ruby. They've also added an expanded syntax for keyed attributes in method calls.


[person setFirstName:first lastName:last];


person.setFirstName(first, lastName:last)


person.setFirstName first, :lastName => last

You can even write your own classes in Ruby that use keyed attributes:

def setFirstName(first, lastName:last)
@name = "#{first} #{last}"

Of course, you can do all the cool RubyCocoa tricks. Make calls back and forth between the Objective-C and Ruby portions of your code. Import Cocoa frameworks. Etc. But, in MacRuby, it all looks just a little bit tighter.

For example, MacRuby's String, Array and Hash classes are simply subclasses of Objective-C's NSString, NSArray and NSDictionary. This lets you transparently pass objects between Ruby and Objective-C.

I look forward to playing around with this project as it develops.



Review of The Unofficial Lego Mindstorms NXT Inventor's Guide

I love the Lego Mindstorm kits, and I've always enjoyed No Starch Press's books. So I was excited to hear about their Unofficial Lego Mindstorms NXT Inventor's Guide (ULMNIG). These are two great tastes that taste great together.

Unfortunately, I was led a bit astray by the title. "Inventor's Guide", to me, summons mental images of crazy legos hacks, but that's not the goal of this book.

In the introduction, the ULMNIG describes its true intentions--taking you beyond the user guide and instructions that came with the Mindstorm kit. It does not assume any previous experience with Lego or Mindstorms, but helps you explore a broader range or projects and possibilities.

As an entry level book, I think the ULMNIG overwhelmingly succeeds.
The book starts with a description of the lego pieces, then provides basic guidelines for building sturdy structures and functional gear trains. For me, this was the weakest part of the book. Don't get me wrong. It has solid information, and should be useful for beginning builders. But it felt too short and too superficial for my tastes.

The ULMNIG then spends two chapters exploring the NXT-G programming language in detail. If you are going to use NXT-G, then you need to read these chapters. They provide a lot of information that will help you get the most out of your Mindstorm brick. They are also much clearer and more informative than the user manual. Reading these chapters will save you from hours of frustrating trial and error.

Finally the last half of the book covers six new robot designs. Four of these designs are radically different from each other. One is a differential drive with a ball castor. One is a four-wheeled steering vehicle. One is a six-legged walking motion sensor, and one is a stationary bot. There are also two variations on the differential-drive bot.

This gives you a nice combination of projects. The designs increase in complexity, allowing you to improve your skills as you progress through them. Building them will teach you a wide range of design techniques, while the variations show you how you can modify existing designs for other purposes.

The projects are definitely the highlight of the book. Working through the projects will teach you more about building robots than the rest of the book combined. And, once your finished, you should be ready to jump into your own projects.

Unfortunately, advanced builders/programmers might find themselves somewhat disappointed with this book. The ULMNIG hints at several advanced topics: building dynamic structures and third party programming languages. Unfortunately, these only get the briefest introduction. A few paragraphs each, tops. And the ULMNIG doesn't even mention other advanced topics, like third-party sensors and hardware, or attaching your own circuits to the NXT brick.

So, I would not recommend this book for everyone. But, if you've finished all the projects in the Mindstorm Users Guide, but your still struggling to build your own robots, then this is definitely the book for you.



Some articles online

MacTech magazine has released three of my articles online. Please check them out.

1. Introduction to Ruby on Rails
2. Ajax on Rails
3. Lego NXT on the Mac



Please excuse the dust. Things are still under construction here.

Hopefully I'll get everything polished away sometime this week.

This blog will focus on things that I think are cool: robotics, AI, Apple products, Lisp, Objective-C, Smalltalk, Ruby, DSLs, and probably the occasional half-blind-with-fury rant about Java. Hopefully it will serve two purposes. 1) Most importantly, I will post additional information about my articles here. This may include changes, additions or support material. 2) It will server as a dumping ground for all the semi-random tech ideas that pop into my head. Sorry about that.

Well, I hope you enjoy it.


Page 1 ... 17 18 19 20 21