Mar 15

Heroku Heroku is a great project whose goal is to make Rail application development easy and painless. As we speak, the website is still in beta stage, but the creators are coming quickly to a paid model to be launched soon.

The project is the result of the collaboration of Adam Wiggins, James Lindenbaum, and Orion Henry. The three have made an incredible contribution to the Rails world by making it dead simple to deploy an application.

I signed up for a free account and got mine the next day. The control panel makes creating a project a snap, and you can quickly type in the details of your particular one. I had been working on my application for some time, so I had my source code handy. The only thing you need to do is tar the source code and import the zipped file into Heroku, like so:

Example: rm -rf myapp/{log,tmp}; tar czf myapp.tar.gz myapp/

That’s all.

Once you upload your code, Heroku does its thing, like change the database configuration file (they run on Postgres). After I was done uploading, a button called my attention and prompted me for running my migrations. I did, in the Ruby/Rails console provided, and a minute later I could test my application live.

The control panel gives you a tree view of your application structure, and you can use the on-line editor to make changes to the code. I have seen in the forums some people complain about the editor, but I think it’s great to make changes on the fly or if you happen to be away from your development box.

Since Heroku is still in beta stage, and the trio hasn’t yet worked on the payment methods, I can’t say how well the servers scale or perform. My application is destined to a small market, so I will never get close to even stressing the server. But I admit everything it’s pretty fast so far, specially given my lack of programming skills. I had a URL that I purchased through Yahoo! Small Business. I redirected the URL to Heroku’s own address and that worked wonders for me. Heroku is now giving sanctum quotas, which are faster bandwidth and more performance for people who need to go online now. I got mine pretty fast, but did not need to change CNAME by creating a sub-domain to use my own URL, which is the way Heroku prefers since it was easier to just redirect.

I hope the site continues to award free plans to those willing to test. The free quota is of 10 megabytes of space, and at the moment I don’t see a specific quota of bandwidth, but you don’t get always top performance (hey, it’s free!) I imagine for free development, in the near future there might be some limits, but I was very happy with the way the whole site performs so far.

I can’t stress again how easy it is to deploy. Just add DNS information and select from development to production status. That’s it! No need to worry about SVN, Capistrano, or other gems. Just tar the whole thing and upload it. So simple even I got it right!

Adam, James and Orion: thanks for the bottom of my heart. Free beer party if you are ever in Panama. You made a whole bunch of not so savvy Rails developer happy. But for what I see in the forums, there’s a whole bunch of very savvy developers using the project, so the impact might be even bigger than originally thought.

Check it Heroku and deploy the easy way!

written by Administrator

Mar 09

smcFanControl

I recently got a brand new MacBook Pro. I want to thank my boss Max for it and my buddy Glenn, Panama’s top Apple guy for giving me the best price available for my new Mac. It is such an incredible piece of machine I can not describe how cool it is.

But for such a cool design, I started to notice it got pretty hot, specially if working in places with no or little air conditioning systems. It affected me in my Bogota hotel, where I had the A/C system off since it was kind of chilly outside. But the temperature widget I had installed flashed 62 degrees Celsius and I started to worry abut the issue. I like my laptops to run as cold as possible. I know the cooler the system, the better the life span and performance.

While goggling around for solutions, I came across many in which some individuals actually reapplied the thermal grease used to ensure the proper dissipation of heat. Some say it voids your warranty, but I think it is a good advice given to people who are used to tinkering with hardware, and who are close enough to the best thermal grease money can buy. Since my Mac was getting hot on Sunday in downtown Bogota, I was as far away from the solution as ever.

After some research and a couple of misses, I downloaded and installed Hendrik Holtmann’s smcFanControl 2.1. It is a great program with GPL license that allows you to change the rate of your fan. For example, instead of letting my fan kick in at Mac’s standard temperature to start cooling the system at 2,000 RPM, I decided to have mine run all the time at 4,000 RPM. The program loads itself on start-up and is visible in the top menu bar.

In a properly cooled room, my average temperature of 54 degrees Celsius dropped to 42 degrees Celsius, and in some occasions to 38 degrees. It was late at night in Bogota and I opened my window (I was staying at the Habitel hotel, a great place to go!) It was really chilly, and the combination of fan and cold dropped the temperature way down.

In an improperly cooled room, I would have highs of 62 degrees Celsius, and at times even 70 degrees Celsius. This have dropped to around 48 degrees with some peaks at 52 degrees, but much less than the average stated above.

My only reserve is the fact that the fan spinning faster than the standard could ruin it. But I am willing to bet a cooler system is preferable to a well rested fan when the whole motherboard fries itself.

My friend Hendrik, congratulations for such a fine tool! Although I can not donate anything on my meager Panama salary, if you are ever on the Ithmus, I will buy you dinner or lunch!

Download the program from Hendrk’s website at http://homepage.mac.com/holtmann/eidac/software/smcfancontrol2/index.html

written by Administrator

Feb 17

I recently moved to a beautiful, new loft, which is also smaller than my previous apartment. I just love the new neighborhood, and the view is great. I can see the whole of Coco del Mar and the Pacific Ocean.

As such, I waited for this time to set-up my new iMac, a machine powerful enough that I hope that I won’t have to change for the next 3 years or so. And you know why? Because moving systems is painful.

Yes sir, reinstall drivers. And that Canon 676U scanner driver no longer works on Tiger 10.4; which is weird, since it worked just fine in my previous and lovely iMac running 10.3.9. I mean, come on, it’s just a 0.01 difference in OS upgrade…

And there is the problem of the native libraries… Yes, Ruby 1.8.2, which is way old. My computer did not arrive with Leopard. And this is so in purpose, because I got a discount on it. But now I had to download and install gems, and then update, and then I forgot and I ended with Rails 2.0, which is a little hard for me…

Never mind the Python 2.3.5 version which works perfectly in 10.3.9 but has broken libraries in 10.4. So you reinstall Python 2.5 and the wxPython libraries as well.

And then Eclipse, Aptana Studio, Netbeans and all.

But that is nothing. The problem is my MP3 collection, which took many DVD’s and countless hours watching the screen while one copies from disk to disk… It makes you start hating music.

Accounting backups? Those are nasty. Be careful or you might loose the next VISA payment. It happened to me once.

After all was done, the system looks beautiful. But it took I guess close to 8 hours or more to migrate everything. And this was not an easy morning in the house alone. This was mayhem while I tried to paint the walls, install that new bathroom mirror, and try to remember where I put the box of underwear, all at once…

Did I say three years? Make it four… after all, I am still using the same languages to solve the same problems I did in 2000.

written by Administrator

Feb 13

I used to love Basic.

Basic was the first language I learned about 25 years ago. Basic is the language I used to create a kick-ass accounting application back in the CP/M days, and it run faster than the COBOL version. Basic is the way I paid for my college money, by teaching kids to program their old Spectrum and TI-94A computers back before the PC took off.

Now, I find Basic not so much…

I admit I am not a Windows guy so I never used VB or .NET. I realize there is Gambas for Linux and Real Basic for Mac. But it doesn’t seem to have the power of other languages. Why?

basicscreen.jpgMaybe Basic did not have the syntax elegance of Python or Ruby, or the intricate library and static typing of C++ or Java (at least in my days, A was a number variable and A$ was a string, period.) But just as Perl, Basic got the job done and done well. I bet that if someone came up with a real funky and easy to use graphic library, more people would take time to learn Basic as opposed to using Qt with C++, wxPython with Python, or Cocoa with Mac OS X (no, I don’t mention SWING Java because I think it is too hard compared to the other options).

written by Administrator

Jan 19

Servlet and JSP Head FirstEvery now and then I go back to trying to learn Java web programming.

Mine is a long story. I started college a long time ago, and I was going to study CS. I did well, but my parents thought CS was a career that was dead, there were too programmers, engineers, etc. Beside the fact that my parents were off, I majored in marketing and later got my MBA, which is the source of everything evil that happened to me later (and never made any money anyway.

So I went back to college to learn Java. I did great and gained some more credits but I always felt they were telling me half the story. The professors were more interested in the order of the mathematical operators than real life use, such as using ORM or the infamous Java I/O system.

One day I became especially frustrated with object serialization, and in order to understand the subject I took a peek into Python (Bruce Eckel kept saying in his books how good Python was). In took less than two or three days to learn enough Python to challenge my previous Java lessons, and found the language incredibly refreshing and innovative. From Python I jumped to Rails (and then to Ruby, which I think it is the way many people arrived to Ruby) and have been the happiest person ever. Only the combination of Rails/Ruby/community could spring forth the revolution that we have been watching for the last two years.

Yet recently I went back to Java, motivated by the great book Head First Servlets and JSP by Bryan Basham, Kathy Sierra and Bert Bates. I was surprised to learn in the first 100 pages what I was never able to learn in probably 2,000 pages of literature from Sun. I even joined the J2EE with Passion seminars from Sun. I got all the free literature from all the sites and followed the weekly homework, learning that it was a real pain in the butt to make simple Hello World! web application.

It is easy to understand how later I learned Rails over the weekend and never looked back (until last week).

What is amazing is how in the first 100 pages this OReilly book can so clearly and simply explain the basics of Servlets and Java Server Pages. Using examples from old kung-fu movies OReilly does several things rights.

First, they explain web applications in a slow, simple way, without jumping to overly complicated technical jargon ahead of time. I have a book at home that explains the servlet abstract class and its different methods before explaining what a servlet is good for. Instead, HFSJSP takes a different approach, leaving the technical and complicated for later.

Second, they explain the basics a bit at a time. Then they fill the details later. This is similar to my above comment, but works quite differently. For example, they explain web descriptors starting out with simple xml files to name servlets according to the class, url and servlet name. The explanation and how this maps in real life web applications is so concise it took less than two pages to understand (and I keep even today hundred of pages explaining all that crap and I still do not get it… the comparison is like some cryptic language versus plain old English.)

Third, finally someone explains the directory structure beforehand examples! It is so darn easy to understand the whole schema when you know what goes exactly where. This is important if you look at the Rails directory structure where you know exactly what goes where. For example, controllers go inside app/controllers; images go in public/images; etc.

Building in spiral is a great way to get a concept across, and I can not think of a better subject than Java Servlets and JSP to be explained gradually and slowly (no wonder most major web projects I know are done in PHP, Perl, or .NET, when not in Rails or Django)

I am not interested in passing any certification exam, but I certainly would recommend this book as if you could only get one book on Java web programming, get Head First Servlets and JSP.

written by Administrator