Archive for the 'Cocoa and Objective-C' Category

Ruby, Python, Haskell and Objective-C Feed Survey

Antonio Cangiano November 27th, 2007

Having little time to follow the blogosphere and its crazy rhythms of publication is not a good enough excuse for not being up to date. This rings particularly true for me as a technical evangelist at IBM, and as someone who is deeply passionate about the development and the information technology world. The biggest challenge is to quickly and efficiently divide the wheat from the chaff or, in other words, filter out the noise from the overload of signals put out there. For me, feed readers are life savers, I couldn’t cope without them.

I recently adopted a setup that seems to be working particularly well. I purchased NetNewsWire for my Mac and FeedDemon for Windows, and automatically got a one-year subscription to the online premium service from the fine folks at newsgator. The two programs are a joy to use, especially for handling very large group of feeds in a short amount of time, as I often need to do. Each program automatically synchronizes with the newsgator service, therefore no matter which computer I’m using, I’m always dealing with the same folders, subscripted feeds and saved clipping. Sure, there are free services out there like Google Reader or Bloglines, but to me there is no comparison between the experience that I have when using a sluggish web interface and a rock solid, well designed desktop application. If I have the option, I’ll always choose the latter, especially since newsgator allows me to take advantage of a centralized repository of feeds from my desktop programs, just like as if I were using their online service through Firefox. For a few dollars, I got a setup that is working awesomely well for me and it’s saving me huge amounts of time. It also helped me to identify non-updated blogs, and those that I was no longer paying attention to, therein allowing me to reduce my over-all amount of feeds (granted with a conscious effort on my part) to a more manageable total of 160.

As mentioned above, my subscribed feeds are important to me, with a list that changes dynamically over time, as I add and remove entries. That said, I was looking at my Ruby and Rails folder when I decided to share my feeds with you. The list is understandably incomplete (after all, there are thousands of Ruby related blogs) and the presence of planets, aggregators and tags in bookmark services like del.icio.us, generate a few unavoidable duplicates. These are the Ruby/Rails blogs and sites that I currently subscribe to:

  1. alternateidea.com
  2. antoniocangiano.com
  3. blog.codahale.com
  4. blog.fallingsnow.net
  5. blog.grayproductions.net
  6. blog.innerewut.de
  7. blog.jayfields.com
  8. blog.leetsoft.com
  9. blog.segment7.net
  10. blog.talbott.ws
  11. blog.zenspider.com
  12. blogs.thoughtworks.com
  13. brainspl.at
  14. chneukirchen.org/blog
  15. dablog.rubypal.com
  16. db2onrails.com
  17. del.icio.us/popular/rails
  18. del.icio.us/popular/ruby
  19. demo.mephistoblog.com
  20. drnicwilliams.com
  21. eigenclass.org
  22. eli.thegreenplace.net
  23. errtheblog.com
  24. glu.ttono.us
  25. groups.google.ca/group/comp.lang.ruby
  26. groups.google.ca/group/rubyonrails-talk
  27. headius.blogspot.com
  28. hivelogic.com
  29. intertwingly.net/blog
  30. memeagora.blogspot.com
  31. metaatem.ne
  32. mir.aculo.us
  33. ntschutta.com/jat
  34. nubyonrails.com
  35. ola-bini.blogspot.com
  36. on-ruby.blogspot.com
  37. onestepback.org/index.cgi
  38. peepcode.com/products
  39. planetruby.0×42.net
  40. pragdave.blogs.pragprog.com/pragdave
  41. rubyblogs.org
  42. rubyforge.org
  43. ryandaigle.com
  44. tomcopeland.blogs.com/juniordeveloper
  45. twsummary.blogspot.com
  46. weblog.jamisbuck.org
  47. weblog.rubyonrails.com
  48. www.adaruby.com
  49. artima.com/buzz/community.jsp?forum=123
  50. chadfowler.com
  51. clarkware.com/cgi/blosxom
  52. cornetdesign.com
  53. danwebb.net
  54. igvita.com/blog
  55. jroller.com/obie
  56. juixe.com/techknow
  57. loudthinking.com
  58. oreillynet.com/ruby/blog
  59. pjhyett.com
  60. quotedprintable.com
  61. railscasts.com
  62. railsenvy.com
  63. robbyonrails.com
  64. rubyinside.com
  65. rubyonrailsblog.com
  66. rubyquiz.com
  67. slash7.com
  68. softiesonrails.com
  69. technorati.com/tag/ruby
  70. technorati.com/tag/rails
  71. therailsway.com
  72. urbanhonking.com/ideasfordozens

You can download the file Ruby-Rails.opml to easily import all of the above feeds into your own reader.

Since I’m sure there are plenty of other “must have” Ruby feeds and blogs that are not currently on my radar (no word of a lie, I’ve already added more since I put the list together), I openly invite you to write a small entry in your blog as well, and show us what feeds you subscribe to. Please link back to this original post, or I won’t be able to easily find your answer. Consider it a sort of Ruby and Rails feed survey.

And since we’re on the topic, and the amount of feeds that I follow is dramatically reduced now, I’d like to extend an invite for you to do the same thing with Python/Django, Haskell, and Objective-C, assuming you are into any of these communities respectively. Those are the languages that interest me the most and I’d like to start following a good selection of feeds on these topics. If you don’t wish to blog about it, or use the comment section below, you can always write me privately at acangianoATgmail.com, specifying if you are okay with me crediting your list to you. I’d like to collect and organize the most interesting ones in a “results” type of post.

I thank you in advance, as I think it’s an interesting “experiment” that can be quite useful, especially for those who are just starting to learn any of the languages above.

DB2 on Mac

Antonio Cangiano September 19th, 2007

Python and DB2

We now have a working Python driver for DB2 which is currently undergoing internal testing. The driver is similar to the Ruby and PHP ones, which means that you get an advanced and very easy to use API. It also means that if you are confident with the Ruby driver, you will be able to use the Python one in no time.

Ruby:

require 'ibm_db'

conn = IBM_DB::connect(database, user, password)

if conn
  puts "Connection succeded."
  IBM_DB::close(conn)
else
  puts "Connection failed."
  puts IBM_DB::conn_errormsg
end



Python:

import ibm_db

conn = ibm_db.connect(database, user, password)

if conn:
    print "Connection succeeded."
    ibm_db.close(conn)
else:
    print "Connection failed."
    print ibm_db.conn_errormsg


We made it so that if you know one, you already know the other. These drivers are CLI wrappers that provide you with performance and stability. Also they don’t limit you to user data and are able to retrieve a good deal of metadata about your database. We’ll also provide a thin wrapper for those of you who intend to use a PEP 249 API. The next step, working on SQLAlchemy, has already started.

DB2 on Mac (no, really!)

macpro.pngWhen I first posted about our interest in Python/Django and DB2, the comment thread got hijacked by many people who asked for a Mac client in order to develop on Mac and deploy on Linux. Ask and you shall receive. I’ve promoted the idea of Django/SQLAlchemy/Python in IBM for a while now, and we are finally close to delivering the driver (with the adapter progressing at the same time too). Well, don’t take this as an official announcement, but Python wasn’t the only thing that I’ve been promoting for months within IBM. With the ever growing community of Ruby/Python hackers adopting Mac as their development platform of choice, I strongly believe that an investment in porting the great free version of DB2 to Mac is a very valid one.

I couldn’t talk about this for weeks, and it must be viewed as a rumor until IBM makes an official announcement, but we have been working on porting DB2 to Intel Mac. Not just the client, the whole package. This makes me a happy panda, no longer will a virtual machine be required to develop with DB2 on Rails on my Mac Book Pro. It’s a joy to see DB2 Express-C run on a Mac Pro (shown in picture) next to the other black boxes in the lab. Work is still in progress, but we should have a beta out there relatively soon (before winter kicks in). DB2 Express-C on Mac is intended for development purposes rather than production, this means that we expect you to develop on your shiny Mac but deploy on Linux or Windows. DB2 on Mac will be a beta product, but again it won’t just be a client runtime, it will be the full product and there is no reason why it shouldn’t be just as stable and efficient as the Linux and Windows versions.

Time to employee some of the newly acquired Cocoa-fu. I’m starting to feel that I could even learn Wasabi and IBM would still be able to let me use that skill in my day job. Awesome.

A preliminary review of three Cocoa and Objective-C related books

Antonio Cangiano August 21st, 2007

As announced before, I got interested in Mac development, bought a bunch of books and spent a few nights reading and coding. Here are my first impressions on those books which thus far I’ve picked up.

I only had time to read 3 chapters from Stephen Kochan’s book and I must say that I’m not impressed! The pace is extremely slow and experienced programmers who read it will be bored to tears. An example of this, is the fact that he spends 15 pages on teaching how to use if/else statements. I’m afraid it’s not working for me; by nature it’s far too basic, and slow paced books are irritating. I don’t blame the author, I’m just not the right target for such a book - and I find the title to be inappropriate, or rather, inaccurate. It should be renamed ‘Learn to Program with Objective-C’ or ‘Introduction to Objective-C’ not ‘Programming in Objective-C’. Readers who don’t know how to program in C or any other programming language, will find this book to be a very good explanation and thorough introduction to programming though. The book “Learn Objective-C on the Macintosh” is basic too, but it’s often recommended as an alternative to Kochan’s book. According to what I’ve seen from the sample chapter, this is still a very gentle introduction to the language, but it carries more insight and it’s not a boring read. Plus one of the authors is Mark Dalrymple who is very active in the online community as well.

Hillegass’ book is a whole different story. He is clearly a great teacher and, while I’ve read only half of this book so far, I can already conclude that this book rocks. Most of what I’m learning is coming straight from this book. Cocoa is not that easy but I feel that this tutorial sufficiently covers the subject matter at hand in-depth and gives a good deal of clarity to the fundamental concepts of this topic. I won’t be an expert by the time I’ve finished this book, no (this is never the case with any one book), though I will have a far better grasp of Cocoa. I’d say that at this time, it’s most likely the best book I could be reading on the subject. I highly recommend it to those of you out there who’d like to follow similar steps (if you buy only one book to get started with Cocoa, this is definitely the one I’d go for).

I read three chapters from Advanced Mac OS X Programmingso far, and I’m really glad I bought this book. If Cocoa Programming for Mac OS X (2nd Edition) is the the best tutorial to learn the basics and get started with, this advanced book appears to be what I’m really aiming for eventually and there is no doubt in my mind that it’s going to become my reference of choice along with the official Apple documentation. It covers difficult topics in detail and gives you insights that I’ve not found elsewhere on the Web. If I’m aiming to get serious about Mac development, I have to study this tome as best I can. I’m holding off on reading it for the moment, as I believe this book is the perfect continuation of the one I’m currently reading. From the chapters that I’ve read up until now, I’m wowed by this book. Mac OS X is a Unix OS, and this book covers that aspect by not leaving many details out. So far it looks like the perfect match up between theory (you will get a lot of college flashbacks when they talk about multi-threading and networking) and practice (the chapters on Memory management and Subversion are worth the price alone). Mark Dalrymple and Aaron Hillegass nail it again with a must-have book for serious developers.

Not bad, I bought three books and it turns out that two of them are great. I’m tempted to return the Objective-C one, but ultimately I don’t think that I’ll end up doing so.

I’ll suggest a fourth book, in case you are approaching Objective-C without any knowledge of C (but with at least some knowledge of other programming languages). I’m using it myself to brush up my C skills, which are certainly there, but in need of a quick refresher course.

Objective-C (aka ObjC) is a superset of ANSI C in fact. As such, any C program is also a valid Objective-C program. It provides you with a relatively easy and straightforward way of doing Object Oriented programming, while simplifying memory management. From what I’ve seen though, unless you are willing to become well versed in C, you won’t become an overly advanced Objective-C developer. Knowing C already (albeit I’m not a Guru), I must say that Objective-C is very easy and can be picked up in a matter of days. The real power and learning curve comes from the Cocoa framework itself, and that’s where I’m going to focus my efforts.

Next »