Entries Tagged 'Goodbye Helicopter' ↓

CoreData - A Great Tutorial

If you think you are ready to sink your teeth into Core Data, you should definitely start with Scott Stevenson’s tutorial.

Granted, you may want to use XCode 2.x for the tutorial, since that is what the tutorial is in. The differences between Interface Builder with XCode 2.x and XCode 3.x are pretty huge. The workflow is very different. (not to mention the interface, no pun intended)

I myself am still getting acquainted with XCode 3.x and my new Intel-based MacBook is in the shop, so I’m on the reliable old G4 iBook today, so it is an exercise I can work on in the interim.

Although you don’t need to be an expert at Cocoa Bindings, and there’s a strong chance you’re not. (not many people are) You will want to at least have covered the frustration of trying to work with bindings a little bit before sticking your nose into Core Data. And, as always, I will say if you’ve worked with Ruby on Rails and Active Record before, you will find Cocoa, Cocoa Bindings and Core Data a little less frustrating, but don’t expect it to be the same thing. It does still work like ORM (object relational mapping) so having a basic understanding how CRUD (create, retrieve, update, destroy) applications work with databases will help you a lot.

XCode 3 : Turn on that Scope Depth Syntax Highlighting !

I’m now diving into XCode 3, thanks in no small part to my new black MacBook! One thing I had been looking forward to is the syntax highlighting that shows you the scope of the function or method or code block. Beautiful stuff. I had envisioned it myself several years ago, when I first learned CSS. (I’m sure I’m not the first and obviously not the only…)

Now that XCode 3 finally has code folding, though not as slick as TextMate’s code folding, it will flash the scope depth highlighting colors. But it goes away quickly. Here is how to turn it on to stay (it isn’t obvious or self-apparent).

View>Code Folding>Focus Follows Selection

Or a picture …

Secret to Good Results With Icon Composer

What’s the secret to getting good results from Icon Composer?

That’s actually very easy to answer. Most of all, a good design that follows the ideals set forth in Apples HIG (Human Interface Guidlines). But aside from that, you need to use Photoshop for the final image. Regardless of how you design the initial image, in Photoshop, create two layers. One for the image, one for a black shape that is the same outline as the image. Make sure you’ve got a square canvass in Photoshop also. Then, Save As… select TIFF as the format, with no compression and preserve layers.

Now drop that tiff file onto icon composer. You’ll get as good as possible at this point.

Ruby Gem BlueCloth not working? Not found? Not installed?

Some Ruby Gems are better than others. Some are great once they are working, but how to get them working is not always obvious… BlueCloth (the Ruby implementation of Markdown) is one of these. Unfortunately, simply doing sudo gem install BlueCloth is not enough. The BlueCloth home page, a Trac site, does not tell you squat about it either. So what do you do? Well, as with any gem that doesn’t just install easily and work with a simple require 'gem_name_here', the first thing to do is look in the gem’s directory!!If you do not know where your gems are, at the command line do gem environment and you will see the path to your gems. Copy that path and cd to it. Then do ls and you will see you’re still not there. cd gems will get you into the proper directory for the gems.Once there, you will notice that each gem has a directory with the name and version number of the gem itself. In this case, cd BlueCloth* should be enough to get you into the BlueCloth directory. If you do have more than one version, you will need to add the version number to that.Once inside the BlueCloth directory, you will see a README and install.rb, first read the README. Hmmm… it is not real clear language, but it does indicate you will need to run install.rb. OK. In the same directory, run ruby install.rb and you should see a few lines:Cloth Installer Revision: 1.3 Testing for the StrScan library...foundTesting for the Devel-Logger library...foundInstalling   If you get any error message, you either need to use sudo to do it, or you just do not have enough permissions/privileges on that machine.  If you get no error message, then you can now use BlueCloth for converting Markdown to html!In any normal Ruby code, simply be sure to add:
require 'rubygems'
require 'bluecloth'
 In a Rails application, simply add the second require line in application.rb and you will be ok to use BlueCloth from within your Rails application. You can actually use both require lines there, but the require for rubygems is just taking up space on the page at this point. If Rails is working, then RubyGems has already been required somewhere else! The beautiful thing is, BlueCloth is easy to use and very effective!  One more thing… this information is true on Linux, OS X, and any *NIX installation. On windows… I have no idea. Personally, I cannot see why people go through the pain of programming on windows, except that it can pay the bills…? 

A Higher Level : What Ruby Represents

There is a pretty decent interview with Russ Olsen on his new book on design patterns in Ruby. In it he focuses on what is different and the same in Ruby design patterns. I’ve been thinking a lot about Ruby and what it represents, particularly when I’m (sadly) not working in Ruby.Mr. Olsen talks about how Rubyists just don’t bother with the factory patterns. As I understand it, the factory pattern has to do with object oriented classes that are called abstract classes and are developed as foundations for other classes. They’re then used to be sensible defaults that make descendent classes have lots of built-in goodness.Mr. Olsen wonders aloud why Rubyists don’t use them much. Well, it’s simple. Ruby itself has it built in for the most part. Ruby makes things clean enough that we don’t need to have our hands held and be told to stand in a straight line by somebody else most of the time. Sure, we make mistakes and duplicate things, but we can. And we can still make things work and get things done. Ruby also makes it a little bit pointless, since there are no truly private classes in Ruby. We can get at the core of anything and change it. There’s no company locking you in or limiting you with their private API. Ruby culture leverages the openness of the language as well as the old Perl attitude of “good enough for now, we can improve it later if needed.” 

Psst… hey!

Ruby also represents a new level of abstraction from the machine. These days, processing speed and power are at a surplus in most situations. There will always be some need for high-performance, low-level programming, but even there, what was once done in assembly language is now done in C or C++ and will someday be done in better languages. (better for humans, that is) With Ruby and modern computers (which will only continue to improve) most of us don’t need to worry about mucking around with all that low-level crap. Quite honestly, we should not be worrying about that low-level stuff unless it truly is warranted. Ruby culture here too is about knowing that it may not be the fastest, but knowing that we can have a working solution fast and have fun doing it.Ruby gives you a chance to be concise and expressive, while still thinking in human terms more than with many other languages. Python is close to this as well, but not in exactly the same way. Interestingly, there doesn’t seem to be any real contention or rivalry between Ruby and Python, or Perl for that matter. They happily coexist as different ways of <em>getting things done</em>.Ruby does deserve all the buzz it’s getting. Believe me, programming often turned me off completely when I was younger, but not because I was younger, because it was more tedious than it needed to be. Programming should generally be about being lazy. Making a machine do things for you. Ruby makes it intelligible enough to wrap your head around what you are doing so that you <em>can</em> do it.I’ll admit, I like to do quick and dirty with Ruby as well as any old Perl programmer would do. Yes, I’m talking duct-tape and quick-drying super-glue. You can optimize and refine later. Get things done today!And by the way, you don’t have to learn design patterns first. Ruby will naturally get you using a lot of them without thinking, but if you find Ruby is your cup of tea, <em>you will want more…!</em>

Ruby, Apple, and the year 2008…

It’s a bold new year for Ruby. The recent release of Ruby 1.9 (though it’s still not a production ready release), the inclusion of Ruby as an officially bundled item in OS X 10.5 (though 10.5 still needs a few dot-versions to reach production release itself), Rails 2.0, a whole plethora of new Ruby books…The Ruby year is going to be a good one. It may end up being a bit frustrating when the push to migrate to 1.9 actually does come, but shouldn’t be too bad.On the book side, there is a very interesting Ruby Design Patterns book as well as a few others, such as the Practical Ruby Projects book, and the FXRuby book.Now, we just need a RubyCocoa book, a Ruby Qt, a Ruby Tk, and a WxRuby book.We also need a Ruby game development book. I don’t have any interest in Lua, and Python is the Ruby for people who like the way Python does things.Myself, I’m working on a Cocoa wrapper app for RubyGems called Gem Commander. I’ve already got a proof of concept working app, but it’s slow going dealing with Cocoa and Objective-C after doing Ruby so much. Here is the logo for Gem Commander… Gem Commander logo You see, Ruby is just so expressive and feels modern. Objective-C and Cocoa (and AppleScript, while we’re at it) all definitely show their age after coming from Ruby. The method signatures in Objective-C are conceptually very cool, and the whole thing beats the hell out of C++ or Visual Basic, but the naming of methods and the way things work is sometimes just not graceful at all. (especially, as I said, after doing things in Ruby)Even RubyCocoa is just a dog in comparison to straight Ruby. It does present the opportunity to mix good Ruby expressiveness in to things, but at the cost of still needing to navigate through Apple’s ridiculous documentation. Apple really really really could learn a lot about documentation in the modern world from the Rails crowd. (minus the people Zed Shaw bitches about… ).On the subject of Apple, AppleScript itself is really a dog these days and is overlooked or under-attended by developers. Apple really just needs to overhaul the whole damn thing in favor of serious Python, Perl and Ruby scriptability out-of-the-box. Then, you would see a real explosion of cool stuff. 

New Mac Developer Podcast : Mac Developer RoundTable !

Scotty is branching out and kind of bringing others on board… Late Night Cocoa is now part of the Mac Developer Network. But there’s more! A new podcast from Scotty, Mac Developer RoundTable is out and is as excellent as Late Night Cocoa, but with the different dynamic of multiple developers on together and interacting, sharing stories and bouncing ideas around! ( tune in for each episode to see what way they’ll geek out in the end when things start to break down at the end…)
Boris has also joined the Mac Developer Network, with his also great podcast, Cocoa Cast. Boris is also soon bringing us something new called Cocoa Cast Express.

And, if anybody is wondering where that very cool artwork for Late Night Cocoa, Mad Developer Roundtable and Cocoa Cast Express came from… me! So all of you developers out there, if you want some cool design work done for your application, you can always contact me and we can certainly work something out. And if you’re still reading at this point, rest assured, that my blog (you’re reading it now) is not the finest example of my artistic skills, but you may find some tidbits in here…

First Book With Rails 2.0 : The Rails Way

The long awaited book “The Rails Way” is finally out, and it’s chock full of good stuff and even includes (slightly pre-release) coverage of Rails 2.0 already. Aside from the CD Baby boondoggle, Obie IS a Rails Core guy, ( I think… ) so he should know a thing or two about a thing or two.

The only drawback: the Rails Way is a big honker. Back breaker. The same problem with Hal Fulton’s classic “The Ruby Way”, the book is TOO BIG and heavy. I really wish publishers would get smart and publish these things in smaller volumes with numbers on the spine. It would be a lot easier to carry around and they’d quickly find out what parts of a text are really driving sales…

OS X 10.5.zero Leopard Opinion, Finalized

Well, I gave Leopard a day; One whole day of mostly lost time trying to get things working for developing again. Granted, Continue reading →

Installing Linux on Recalcitrant Windows Computers!

The other day, a friend unloaded an old Dull Platitude (dell latitute) notebook on me. Physically it looked to be OK, but of course the built-in track pad and mouse buttons are sketchy. Oh! It also had a failed life as a Win2K machine. Initially, I tried to install Kubuntu (basically Ubuntu, but with KDE desktop instead of Gnome desktop for the GUI, which means it’s Debian Linux under all of that.) Last night, I tried and tried, but no luck. So today, on a whim, I reinstalled Win2K (wiping the HD). Seemed OK until reboot and it mistakenly believed itself to have only a 640 x 480 screen with 16bit color depth!! What junk Windows is!!
I was considering learning some Windows programming (*shudder*) but it just isn’t worth all of that. Then, on one last whim, I decided to pop in that Kubuntu CD I made again to see if a refreshed hard drive made a difference… WOW !! I guess Windows is good for one thing: wiping out a corrupted windows installation to prepare for Linux!! Woohoo!!
As I type this on my beloved iBook G4, Kubuntu is installing on the Dull Platitude and it’s getting real close to done! So I will now have a second dev machine to monkey around with.

Now if I can just get that old clamshell iBook G3 to boot off the Linux live CDs for PPC… then we’d be in serious business!