Archive for the 'Programming' Category

Google Releases the Google AJAX Search API

So, I guess this has been around for a while, but I just found this today.

Google has released code to allow you to integrate an AJAX Google Search Box into your website. This means no more sending your users off to Google land when they want to find something. This is pretty cool.

This is called the Google Search API. If you want to find out more, you can check it out here. The Google AJAX Search API page contains sample pages, and everything you need to implement it on your own site.

I think I might try implementing it into my site here.

Google AJAX Search picture

Ruby can be Perl if We Want it To Be…

I’ve just noticed Damon Clinkscales’ post at the Damon Clinkscales blog entitled ’Presentation Downloads Top 1 Million‘. In the post, he quickly whips up a small Ruby app to parse his logfiles to determine how many times a certain presentation of his has been downloaded. It is really a simple-ten line piece of code, but quite powerful.

Cool Code - check it out!

This really reminds me of alot fo the short Perl scripts I’ve seen floating around. I’ve noticed over time that alot of Perl programmers like to emphasize how they can ‘do so much with so few lines of code’. Well, check this out Perlies!

Cool stuff Damon!

So You Wanna Begin Programming With Ruby on Rails?

Well, I commend you! A quick disclaimer - Ruby on Rails is not for everyone, nor suited for every job. That said, spend a couple hours evaluating it, to see if it is right for you, or your project.

Good starting points:

  1. Visit the Ruby on Rails website, and watch the Screencasts and Presentations
  2. Download Ruby. Now Ruby on Rails can be had in a couple of different flavours depending on your platform
    1. If you are on Windows, I have tried RadRails, RIDE-ME, and Eclipse with the Ruby Development Tools, and never felt comfortable with any of them. Your best bet may be to program things using a text editor such as UltraEdit along with the windows command line to run scripts from, or to use JEdit in place of UltraEdit. Ruby usually comes with an editor called SciTE which many people like. I couldn’t get into it too well. But give it a try - you may like it. I haven’t found a Windows development environment for Ruby yet which really did the trick. There is a thread about it posted here.
    2. If you are on Linux, I would suggest jEdit with the command line to run scripts. Of course, if you develop with linux, you may be comfortable enough with vi or emacs. I wouldn’t stop you from going that way… Most of the suggestions listed for Windows are available on Linux as well.
    3. If you are on a Mac, go with TextMate. ’nuff said For more info, read the thread mentioned in the windows point above.
  3. Follow through the O’Reilly Rolling with Ruby on Rails tutorial. That should give you an idea of why Ruby and Rails are great together. Don’t forget Part 2.
  4. While you are reading, also check out StartAtTheBeginning and the Tutorial in the RubyOnRails Wiki. And while you are at it, read whatever other wiki pages you see that interest you. There is alot to learn there, and you will find yourself referring to it alot.
  5. Like what you see so far? You should get some books. Might I recommend Agile Web Development with Rails: A Pragmatic Guide or Ruby for Rails: Ruby Techniques for Rails Developers .
  6. Bookmark the Rails API. You’ll need it. Don’t be scared, though. It’s alot smaller than the Java 1.5 API.
  7. Join the Rails Forum. There are alot of genuinely talented people there who would be more than willing to help you with any issues you may have. Really - a great bunch!
  8. Register or subscribe to the feed for this blog. I myself am still learning about Ruby with Rails. I will post as much helpful information as I can, to help other newcomers to the language to avoid the same pits and traps I fell into.

Ruby on Rails is a young language, only a year or two old, and as such, there are alot less resources available for it than there might be for Java, or C/C++ or C# or any of the Microsoft Languages. But it is very rewarding, almost a new paradigm for those willing to take it up.

Good Luck! Feel free to post in the comments here or in the Rails Forum if you need any help.

Getting Real from 37signals

Scott from Scott’s Misguided Brilliance blogged about the book ‘Getting Real’ by 37signals. Now for those that don’t know, 37signals is the company which launched Basecamp. Basecamp is the product which Ruby on Rails was originally created for. Not only that, 37signals has released a succession of other major software products, and now boasts a userbase of over 400,000 users.

That’s pretty impressive for a company of only 7 programmers.

‘Getting Real’ is a tour of there company philosophy, and strategy. A seeming tour-de-force of their design philosophy and business strategy. It looks like an interesting read - I think I should get a copy.

Anyways, it grabbed my attention, so I thought I should post about it…

Ruby on Rails Needs a Better Programming Environment

Ok, well, Rails is cool, as you can see in my previous post.

The only issue is, there doesn’t seem to be any decent editors which allow you to program in it quite fluently. I mean there are enough IDEs out there that handle Ruby, but none seem to handle it well - as fluently as anyone would want.

What I mean is, there are no IDEs which handle Ruby the way Eclipse handles Java. Is there anyone out there who has found such a thing?

Too bad TextMate isn’t available on Windows and/or Linux. From what I’ve seen of the screencasts at http://www.rubyonrails.com , Textmate seems to be the editor of choice. That almost tempts me to get a Mac as my Ruby development machine.

To be honest, I’ve been considering that for a bit now. Unfortunately, I don’t want to leave behond the priveleges of my Linux system. I am just too familiar with Linux to just dump it. And I am required to use Windows at work, since much of the software we use here isn’t compatible with Mac or Linux.

Too Bad!

Anyways, I guess I will just keep trying to hack it with SCite and the command line. That seems to be the most efficient path at this point.

*groan*

Started Programming in Ruby

Hello, and welcome to the initial post on the InfoHatter Blog.

So, I am a Computer Science Major at Redeemer University College in Ancaster, Ontario, Canada. Currently I am on a coop assignment at All Cover Portable Systems doing some programming/web design for them.

Anyways, I’ve just gotten started with the Ruby programming language, well, Ruby on Rails actually. I won’t tell too much about th elanguage - you can find out alot more on the link I posted. My initial impression of it is that it is really cool - I can quickly build functional skeletons for my programs that just really need some graphics and ‘niceties’ built onto them to become fully funtional. It seems quick and clean.

Apart from some difficulties initially understanding the Ruby associations, and how to arrange them properly with the database keys, foreign keys etc. I have picked up on it rather easily. Now it is just a matter of fleshing it out a bit. ie - I had the belongs_to :item and has_many :item lines mixed up - I had a few done the right way, a few done the wrong way.

Now, though, all my models are in good shape, Time to start making the views nice. At any rate, I am going to work on the base layout. I can’t find any good editor for .rhtml files, though. I tried setting up the RubyWeaver extension for Dreamweaver, but the site for that is down. I guess I will attempt it directly in RadRails or UltraEdit… There has to be a better way to do this.

I am building a small app for my employer. The goal is to keep track of job sites, and the operations performed at them in a convenient, easy to navigate, even-my-grandmother-could-use-this way. I may post the source when I am done, depending on my employer’s wishes, of course.

Anyways, I just want to give a recommendation for, ‘Ruby For Rails’ by David A. Black. I purchased this book to get me started on Rails. Now, I have heard that ‘Agile Web Development With Ruby on Rails’ is a better book, but so far I am happy with this one - I may pick up AWDWROR at a later date.

« Previous Page