General

Minor Update

It’s been slightly more than 2 weeks since I installed Ubuntu and I am happy to report that everything is well, Eclipse and all other programs feel more snappy, multiple desktops make life so much easier and a general overall increase in productivity. I also got Oracle instant client installed and working with Rails. Here are some links that will help you if you want to do the same.

  1. http://ruby-oci8.rubyforge.org/en/InstallForInstantClient.html
  2. http://wiki.rubyonrails.com/rails/pages/HowtoConnectToOracle

Unfortunately you have no other choice but to set up the LD_LIBRARY_PATH for oracle to work, but on the bright side you can reduce the number of entries you put into it by making symlinks to the oracle dynamic libraries in /usr/lib directory. Also found out that the case matters when you set up the TNS_ADMIN variable (lower case will not work, weird!)

That said, the only reason why I ever go to my windows partition is to use iTunes, I wonder why Apple has not released iTunes for Linux ? I also wish Google talk was available for Linux, Gaim is pretty good but I miss how talk would remember the conversation history.

General

Installing Ubuntu and VPN

I finally got Ubuntu working on my laptop, YAY. Took me about a day and a little help from my friend Tim. The first problem I had was the install kept blowing away my MBR, using Partition Recovery I was able to recover it, for some reason the install had problems with setting up GRUB, so Tim had the idea to manually install GRUB and then try installing Ubuntu and it went through fine.

The next problem was getting wireless to work, Broadcom wireless network card has problems with Ubuntu after some goggling on “ubuntu dell wireless” found the solution, apparently there are no Linux drivers for broadcom so you have to use ndiswrapper there are many excellent pages that describe how to do this.

So now after setting up Ubuntu and getting the wireless to work the next hurdle was connecting to VPN, Juniper was designed to work with Red Hat but there is a workaround to get this done read here.

And finally the top 10 apps to install on Ubuntu from lifehacker.com.

VPN using Ubuntu

General

Cargo Cult

The first time I heard about Cargo Cult was at the Rails Conf, if you have never heard of it, please read this article on wiki.

Cargo Cult in a nutshell, during World War II the US established a military installation on some remote island and the tribals that lived on that island noticed cargo planes land and drop tons of cargo that had food and other articles. Now after the war the base was closed and the planes stopped. The tribals assumed that planes were from God and in order to receive gifts (cargo) that had to please God the same way the soldiers did. So they tried to imitate the soldiers they made control towers and headphones out of wood and even a runway.

When I first heard it I was amused, but now that I think about it, what if we are all doing the same thing ? Our practices and religions maybe our ancestors, like the tribals in the cargo cult started imitating these practices and we have been just following it.

Are we like the cargo cult tribals just been imitating all this while ?

General

Random Thoughts

  • How will the iPod look in 10 years ?
  • I want a laptop that looks and feels like a regular book, just open it and start reading/writing.
  • What separates Wii from Playstation3 and Xbox 360 “innovation”.
  • Humanity is hungry for innovation, give it to them and you will be rewarded.
  • I feel one of my co-workers is going to go postal one day, checked around with others, they feel the same way too, I should probably get life insurance.
General

Four Stages in a Programmer’s Job

In any job one goes through four stages, The Anxious Stage, Excitement, SSDD (Same Shit Different Day) and finally The Bail Out.

Job Stages

Stage One ‘The Anxious Stage’, you have just started off in a new job and not too sure if you did the right thing. You are surrounded by new and strange people, a ton of new abbreviations that make no sense and of course there is no documentation. You miss the familiarity of the old job and your old colleagues. This usually last about 2-3 weeks.

Stage Two ‘The Excitement’, by now you have well settled into your new place and have all the logins and access to all the systems. You have already started facing challenges and providing great solutions, you wake up everyday looking forward to go to work, you think off great ideas in your shower to impress colleagues and bosses, everything makes sense, you are completely connected into the matrix. You are spitting out code in your sleep and fixing bugs faster than you can say Katmandu. 24 hours are barely enough in a day. Simply put, Life could not get any better.

Stage Three ‘Same Shit Different Day’ also know as SSDD or S2D2, well you have proved yourself yet again and now you are getting more work than you can handle, manager is in lala land, some members of your team are pulling there weight, estimates are a joke that you quietly accept cause there is no point arguing and deadlines come and go, you know there are a ton of places in the code that needs to be fixed but you have no time to fix it. You are just trying to keep your head above water. Every Sunday night you are depressed and think ‘I have to go back to school tomorrow, wait! did I just say school ? ‘. This is a dangerous stage, cause it leads to the next stage, this is the stage where the idea of ‘greener pastures‘ comes into the mind and as many books have suggested once that idea comes in, everything else just affirms it, a smart boss will immediately recognize this stage and try and ratify it before it is too late.

Stage Four ‘The Bail Out’, months have passed by in stage three and now you know there is no hope, it is time to brush the dust off that old resume and get in touch with your old contacts. One can easily recognize people in this stage, they will never go anywhere without there Cell phones and jump every time it rings. They run out off the room with the cell phone or you hear phases like can I call you back in a few minutes. And thus the cycle begins.

So this brings us to this Question : Which stage are you in ?

General

devender.com

I really wish I could get the domain devender.com, but alas it has already been taken. Try going to the site, it is clearly a parked domain I have tried buying the domain using godaddy’s domain buying service and sending emails to the contact listed on the page but nothing has worked. I have to wonder about the reasoning behind buying a domain and just not doing anything with it.

General

Rails Conferance 2007 Day 3 (Final Day)

Rails Conf 2007 Today started with “The Rails Way” keynote given by Jamis Buck, Michael Koziarski of the TheRailsWay site, on this site you can submit your code for review and they may do a write up about it, by the way both the speakers are part of the “Rails Core Team”. One of the important suggestions they gave was to keep your code simple and try not to complicate things.

The next talk I attended was on “JRuby on Rails” by Charles Nutter & Thomas Enebo , they showed how JRuby has come a long way and can now run (almost) any rails app, you can install any gem or plugin and as long as it is not doing anything natively in C and everything is written in Ruby it will work just fine on JRuby. They also showed how JRuby will consistently provide better performance over native Ruby and this is due to the fact that JRuby is running inside the JVM which is highly optimized. They showed some numbers where except for the startup time JRuby outperformed native Ruby and as of jdk-1.6 there has been a lot of work done on the JVM’s startup time and this problem should improve. They also mentioned how the Java vm makes full use of os threads and thus eliminating problems with native Ruby’s green threading model and another interesting note which I did not understand completely, is that you can now, using a plugin create a war of your rails app and deploy it into any servlet container and since rails is not thread safe it will create different rails threads and each thread will process one request and thus provide a work around for Rails threading limitation (not completely sure about this need to investigate). You can also use JDBC drivers with JRuby on rails and even use JNDI datasources which I thought was pretty cool. Link to JRuby wiki.

How to Contribute to the Ruby on Rails Open Source” by Josh Susser , although this talk was geared towards contributing to Rails code most of the suggestions can be used with almost any open source project. This talk was about how you can contribute and if you do decide to do it, how to go about doing it. One of the best places to start is by looking at the Rails Trac (bug tracking system) and see if there are any open bugs. If you do decide to fix some bug, first write a test case that shows that there is one and submit that and then you can submit your fix. If you want to add a new feature and if it is something major first try to discuss this and when you get enough traction then open a ticket for it. Your patch should be attached to the ticket.An area which is in constant need for attention is Test Coverage and you could start off with writing some tests that would be great. There are 900 patchs that have been submitted to Rails Code and non off them have been processed so far,the speaker suggest that the Rails Team is actively working to fix this issue and to those who want to Fork, he suggested to Fork…..

Solr on Rails” by Erik Hatcher, Solr is actually Java code that is written on top of Lucene (a high-performance, full-featured text search engine library written entirely in Java). Once your bring up Solr, it provides many ways you can communicate with it, including REST style API, you can directly connect to it using http or use the SolRuby lib which not only can communicate with a Solr api but also provide back Ruby objects for direct consumption, and there is also the acts_as_solr rails plugin that adds full text search capabilities using Solr to any Rails model.

Finally Keynote by Dave Thomas, his talk was very interesting he talked about how we are constantly going in a circle, rich client-web-rich client and we need to break out off it, he talked about how the most advanced and complex programs today are video games that people play with just two thumbs so why is it that we are still using forms to fill out data on the internet ? On an another note he suggested that the Rails community needs to welcome woman programmers and play nice with newbies. And last but not the least just have fun, try other programming languages and think out of the box.

By the way according to the last numbers Rails Conference raised 26,000 $ towards charity, YEAH!!

If you are looking for slides and other info for the Rails Conf 2007 here is the wiki link, and here is a link to in depth review/notes of DHH keynote, I hope like last year they will put a video of the keynotes.

Interesting Quotes

“If you’re fortunate enough to use a real editor…” – from the Rails Way talk referring to TextMate

General

Rails Conferance 2007 Day 2

Rails Conf 2007 So today started off with keynotes from the sponsors, first one was from ThoughtWorks Studios and the second from Sun (Sun sponsoring a RailsConf who would have thought), anyway ThoughtWorks Studios now has a bunch of Ruby related products, like now they have a CruiseControl.rb (don’t you think it should be cruise_control.rb instead? 🙂 ) and RubyWorks.

The keynote from ThoughtWorks was delivered by Cyndi Mitchell she talked about how “enterprise software” used to mean something innovative but now has come to mean bloatware. She said we as Ruby and Rails developers should “Reclaim the Enterprise” before it is taken over by bloatware and ThoughtWorks can help with its production stack of application and environment tools, Developer tools, Frameworks, libraries and of course consulting. She mentioned that they are now working with Vonage to improve there software.

The keynote from Sun was delivered by Tim Bray , he explained why Sun is interested in Ruby on Rails, Sun is in the business of selling hardware and every production Rails app will need to run on some hardware that is where Sun comes in. He also talked about how Ruby has to catch up in a lot of places, like speed he said “There is no reason why ruby can’t be faster than Java”, in reference to a slide shown on the previous night by Avi Bryant where Java is at least 10 time faster than Ruby. He also talked about tools and IDE support and that is where NetBeans comes in, NetBeans now has support for Ruby including context sensitive help. He talked a lot about how to remove friction to adoption of Ruby by big companies by providing free tools, including Virtualization and companies can freely test there apps before going to production, he also said how Ruby and Rails libraries need more documentation (huh ?), anyway on the whole he was a good speaker.

There was something interesting he asked for a show of hands to see where people are coming from

  1. Coming from Java background (had the largest number of people)
  2. PHP, slightly less than Java
  3. Microsoft Eco System (even less than PHP)

First session I went to was “Exploring Virtual Clusters for Rails Development and Deployment” given by Bradley Taylor, this talk was hilarious (not for its content) first the speaker was running on windows, next it kept popping up since it installed something wanted to reboot he had to keep clicking later every five minutes, then it popped up to say that there are unused icons on the desktop, and then it popped up about the power in the battery being low (though it was connected), anyhow it was hard to stay serious with all this going on and people shouting “get a mac” in the middle of the session. Now on to the meat, I was really hoping to learn about his plugin to do virtualization but instead it was a talk to describe what Virtual Servers mean and how people could use it to optimize the use of there resources, what VMware is and so on.

Memcaching Rails” given by Chris Wanstrat, now this was a fast paced talk with a lot of tips about Memcaching. The speaker talked a about a plugin called “memcache-foo” which extends Rails and will make memcaching easier. A tip he mentioned, if you are using memcached try to use the direct ip address of the servers, just in case the DNS goes down and even if it does not take time, the memcache ruby client will take time to decode the dns. Another tip put your memcache logic where ever the code for the actual retrieval of data is it makes it easy to follow the code. The plugin also has the ability to version, so if you release a new version of your class it can automatically expire all the keys for that class only without having to reboot the entire cache.

Xen and the Art of Rails Deployment” given by Ezra Zygmuntowicz, an excellent talk, you can see the slides on his blog . According to him the best stack right now is “Linux+Nginx+Mongrel(mongrel_cluster)+Monit”, he also talked about “Swiftiply” which is a hot patch to Mongrel, which makes Mongrel single threaded and event driven and will make if FAST. He mentioned Rmagick and :include (in models) as some of the worst culprits when it comes to using up memory. ActiveRecord sometimes makes it very easy for developers to write in-efficient code and the best way is to look at the logs to see what sql’s are getting generated. Another tip is to not use Rails script runner, since it brings up the entire stack of rails and instead try and use plain ruby.

A little rant, I had to stand in the next session and so did many others, there were so many people in this session, I really wish next time around the rails conference people could please have some sort of a sign up process so that they can set up the appropriate size rooms. Another wish please, please put the level of proficiency needed to attend some of these talks I ended up going to talks that were just about the basics or put some sort of a description which will let us know that some session is for beginners so that we wont waste time. If you are paying the 7-800 $ for a ticket I don’t want to learn about what VMserver is !!

Practical Design for Developers” given by David Verba, you can get the slides of this session here , he talked about how design is not just about pretty colors, take a look at the IPOD or the Mac and you can see how much design went into it, how the people behind it tried to think about everything. He talks about knowing your users, talking to your users to understand how they will use your application and in conjunction to the other apps they will be using. How to structure your applications to make is easy for your users.

Open Mic Demo Session“, attendees were invited to showcase some of the applications they have written, here are the ones

Interesting Quotes

  • “Fear based enterprise sales” – Cyndi (I think)
  • “There is a distressing absence of women in this community…” – Tim Bray
  • “We used to be, the answer is Java – Ok whats the question” – Tim Bray
  • “The decisions that drive growth don’t get made by CTOs and CIOs.” – Tim Bray
  • “My .emacs file would make strong men weep.” – Tim Bray
  • “How do ordinary people write code efficiently” – Tim Bray
  • YGNI, you think you are going to need it” – Chris Wanstrath
  • Rails eats database resources for breakfast” – Ezra Zygmuntonwicz
  • “NFS, not a fail safe system” -not sure
General

Rails Conferance 2007 Day 1

Rails Conf 2007The day started off with a Keynote from David Heinemeier Hansson the author of Rails, he outlined some of the features of the up coming Rails 2.0, important note here is that there are not going to be any major overhauls or re-writes, they have realized just how many people are using Rails and it is important that everyone’s code remains working when they upgrade. This release will be more of a cleanup, some code that has been deprecated for sometime will be removed and some new features will be added.

New features include

  • REST style active resource will be the norm now
  • Query caching
  • The debugger in Rails is working again and is better than before
  • Clean up of the config.rb
  • Auto gzip feature for CSS and JS files
  • ‘Assist Host’ browsers have a limit on how many files they simultaneously download from a site like if you have 4 images it will download 2 at a time, but if you can put 2 images on one host and 2 on an another it will download them all the 4 at once, with this feature you can specify things ‘host’/myimage and it will automatically replace host with host1 and host2..
  • form_for which url to use

Most of these features are already available on the edge version of Rails, so you can download and take it for a spin.

After the keynote I attended the “Clean Code” a session given by Robert Martin, he is the author of “Agile Software Development, Principles, Patterns, and Practices“, this talk was about how to keep your code clean and maintainable, he said just like in writing where we create multiple drafts each one a refinement of the previous one so is coding, no one is perfect and can write perfect code the very first time so it is important to constantly keep pruning your code, but in order to do this you will have to take small steps and have a good test suite so that your changes will not be disruptive. He also mentioned that Apatna a ruby IDE now has some re-factoring capabilities. He is a good speaker, keeps the audience engaged, I would definitely attend his sessions again.

The next session I attended was “Doing Rest Right” given by Scott Raymond, one of the important things he mentions is sometimes the best way may not be the “Rails Way” in which case you need to take your own decisions and change it. He also talked about

  • 2 phase style post, where you do one post which returns a temporary url, which then you can use to do the actual post.
  • http protocol parameters and etags , can be used to do interesting things.

A tiny rant here, the speaker was really good and had a good command on his subject but his whole talk was in mono tone just the same volume no ups or downs almost put me to sleep. Maybe its just me should have had more caffeine.

The next session “Building and Working with Static Sites in Ruby on Rails” by Ben Scofield of Viget Labs, the speaker talks about how to develop websites that are mostly static but with some dynamic content mixed in, they have developed a plugin that is still in beta that can help you do the same.

Standing on the Shoulders of Giants” by Adam Keys, talks about how important it is to not only write code but to also read others code, it is known that reading code is five times harder than writing code, reading others code will help in many ways, first it will help you write better cleaner and more readable code two you can learn many tips/tricks. xmlrpc4r is a really good library to start off with, if you want to try reading code since this library’s code is very clean and readable.

Final session of the day “Mapping Rails to Legacy Systems” by Stephen Becker & Devon Jones , the talk was about how they are refactoring there old J2EE applications (wow) at Vonage into using more Ruby and Rails. They talk about how J2ee apps tend to be huge monolithic applications that have everything and if you want to stop doing that and create more smaller and reusable systems how you go about doing it, some suggestion were instead of re-writing entire subsystems at one go, take some chunks of functionality and wrap them into a REST style service that your system can call. This talk had a big audience involvement many in the audience seem to be following the same style.

Evening Keynotes

Enterprise is Not a Four-letter Word” by Steven Smith, many big so called “Enterprise” companies and some government organizations are now into using Ruby and Rails there is a big move to adoption, there were 1600 attendees that in itself speaks volumes.

Keynote” Avi Bryant, the speaker is well know in the Small Talk community as well as Rails he is the man behind SeaSide and DabbleDb, he showed how close Ruby and Smalltalk is as far as syntax goes, predicted in 10 years Ruby will be where Smalltalk is today. I was intrigued by Smalltalk need to check that out . It is nice to know that the Rails Conferance was not shy or scared to demo other languages or frameworks, they said it is to bring different ideas and perspectives to the table.

“Keynote” by Ze Frank this is the first time I heard of Ze and I am already a big fan, he is a decribed as a performer, web-toymaker, philosopher and comic.

Some interesting quotes

  • “It’s exciting when there’s job advertising for people that have been working with Rails longer than I have” — DHH
  • “Rails 2 is not gonna be a unicorn.” –DHH
  • “Rails prefers REST”-DHH
  • “We have to manually expire the cache — that’s just crazy talk” – Ben Scofield
  • “They’re not really problems, just hidden feature requests I didn’t tell you about.” – Ben Scofield
  • “Gone are the days when you could just focus on code” – Dan Benjamin
  • “Nothing to fear but fear itself; That’s called Recursion. That’s Infinite Fear” – ZeFrank

General

Rails Conferance 2007 Tutorial Day

Rails Conf 2007 Today was tutorial day at the Rails conference 2007, I attended two tutorials one was on ‘Prototype and Scripaculous‘ given by Thomas Fuchs and the other was on ‘Rails Routing’ given by David A. Black.

Tim Shadel of CodeSmack.com graciously setup a CampFire account for all of us to chat/discuss about each session, see here for more info on how to access these transcripts, Thanks Tim !!

In the Prototype and Scripaculous talk , Thomas talked about the history of these libraries and some of there present and upcoming features, it was interesting to know that these libraries have been extracted from real world applications. He also talked about some common pitfalls when using JavaScript.

The Routing talk was about, well Rails routing, how Rails routes incoming request to controllers and actions and also how it generates URLs there was also talk about Named Routes and Restfull Routing.

Evening we went to China Town for dinner, I live in Phoenix and this is my first visit to Portland I must say there are a lot of homeless people in Portland.