I passed the SCJP exam (finally). I just have to write a few more lines of C# (ew) to get a project out of the way and I can really get back to the fun stuff.
Curiously, I got an 80% on the generics and collections portion of the exam. I was expecting to do poorly there. The 25% I got on threads really ruined my score though. Oh well, a pass is a pass!
Wednesday, November 21, 2007
Saturday, October 6, 2007
Ahoy There, Matey
Geez, where does the time go? I haven't posted here since June - eek. Life and transitions at work have kept me busy all these months. Apart from deploying a really simple Rails app in June and deploying a slightly different version of it for another cause, I haven't really kept up with my Ruby learning =(
But the learning never stops! I'm addicted.
I bought the only book on Spring MVC & Webflow available and I'm consuming it pretty quickly. I'm using it for my web tier in a reference application. I'm documenting the step-by-step process so it can be repeated by anyone who wants to learn the framework.
Two more months to take the SCJP exam. I'm doomed.
But the learning never stops! I'm addicted.
I bought the only book on Spring MVC & Webflow available and I'm consuming it pretty quickly. I'm using it for my web tier in a reference application. I'm documenting the step-by-step process so it can be repeated by anyone who wants to learn the framework.
Two more months to take the SCJP exam. I'm doomed.
Tuesday, June 26, 2007
ERWin for Free
Well not really but I finally found a suitable tool I can use for data modeling at home. Best of all is that it's freeware. Check out the Toad Data Modeler if you've been searching for an alternative. My favorite feature is that it exports DDL scripts to PostgreSQL :)
Unfortunately it only runs in Windows XP so I use it in a Parallels virtual machine.
Unfortunately it only runs in Windows XP so I use it in a Parallels virtual machine.
Tuesday, June 19, 2007
How to backup PostgreSQL on OS X and *nix
It's wise to backup your database if you've got anything important in there (like the internet's next big thing). You could read through the documentation to see what else is going on or just run the following commands and get the job done.
To backup:
pg_dump -U your_username --clean --no-owner your_db_name > backup.sql
--clean tells Postgres to generate SQL to drop all objects in the database before recreating them. Comes in handy when you want to reinitialize your database and skip the createdb process.
--no-owner tells Postgres to disregard ownership in the dump and give it to the user who restores from that file. Not necessary but I use it when I restore prod data from my host to my local development db.
To restore:
psql -U your_username -d db_to_restore < backup.sql
Sanity check:
psql -U your_username -d your_db_name
=# \d
(should return a list of relations)
=# select * from some_table
(should show some expected data)
To backup:
pg_dump -U your_username --clean --no-owner your_db_name > backup.sql
--clean tells Postgres to generate SQL to drop all objects in the database before recreating them. Comes in handy when you want to reinitialize your database and skip the createdb process.
--no-owner tells Postgres to disregard ownership in the dump and give it to the user who restores from that file. Not necessary but I use it when I restore prod data from my host to my local development db.
To restore:
psql -U your_username -d db_to_restore < backup.sql
Sanity check:
psql -U your_username -d your_db_name
=# \d
(should return a list of relations)
=# select * from some_table
(should show some expected data)
Friday, June 15, 2007
Using a string to invoke a method by its name
Tonight I was trying to create a fancy pie chart using the Gruff gem. I'm using column names as the hash key. The value is the total number of times that column was equal to true in the table.

I needed to count how many rows where that column is equal to true (select count(*) from topics where [column_name] = true). Having the column name and that total count made up a key/value pair in my hash. If a column has no occurrences of true, there's no sense in including it in my graph because it would just be 0%.
So the problem was not knowing which columns to represent in the pie graph until runtime. I could get the data from each column and use many if/else statements but I wanted a more dynamic solution. You never know when the clients want one or fifty more columns...
After some research I thought I could use Object#instance_variable_get(symbol) on an ActiveRecord object but it wasn't so. Attributes in ActiveRecord models aren't instance variables. With some help and great explanations from the OC Ruby users' group, I proceeded using Object.send(symbol) to get an attribute value by passing its name as a symbol.
In the end, I ended up not displaying the graph because the small sample didn't give much value to decision makers. Yet. Maybe I can show the top 5 favorite topics instead of this:

--
My recommended books. At the bottom are my most completely read books. As you go up they become more of a reference for me.


I needed to count how many rows where that column is equal to true (select count(*) from topics where [column_name] = true). Having the column name and that total count made up a key/value pair in my hash. If a column has no occurrences of true, there's no sense in including it in my graph because it would just be 0%.
So the problem was not knowing which columns to represent in the pie graph until runtime. I could get the data from each column and use many if/else statements but I wanted a more dynamic solution. You never know when the clients want one or fifty more columns...
After some research I thought I could use Object#instance_variable_get(symbol) on an ActiveRecord object but it wasn't so. Attributes in ActiveRecord models aren't instance variables. With some help and great explanations from the OC Ruby users' group, I proceeded using Object.send(symbol) to get an attribute value by passing its name as a symbol.
In the end, I ended up not displaying the graph because the small sample didn't give much value to decision makers. Yet. Maybe I can show the top 5 favorite topics instead of this:

--
My recommended books. At the bottom are my most completely read books. As you go up they become more of a reference for me.

Thursday, June 7, 2007
First go-live
Bah, I take so much time to update. I've been pretty busy with Rails lately. That's great news though since I love learning new things. I bought the Flexible Rails pdf and have completed about half the tutorials. If you're serious about using Flex for your RoR front-end I don't know of a better resource.
I deployed my first Rails app this past Monday. Well I wouldn't really call it an application, more like a sign up form for summer camp. I plan to add some kind of Excel export and some reports using Gruff. This is just the beginning :) I'd like to build a Flex UI for the admins sometime this month. If I get around to doing that I'll post some screen shots to show off sexy.
I deployed my first Rails app this past Monday. Well I wouldn't really call it an application, more like a sign up form for summer camp. I plan to add some kind of Excel export and some reports using Gruff. This is just the beginning :) I'd like to build a Flex UI for the admins sometime this month. If I get around to doing that I'll post some screen shots to show off sexy.
Saturday, May 19, 2007
Adobe Flex + Rails
I tried my first Flex/Rails tutorial last night and I must say it's pretty simple - so far. Hello world and a basic login system aren't the most complicated things ever, but my first impression is that this is something worth spending some time on. I'm not too keen about having to write a lot of XML and having to learn ActionScript but oh well. I'll keep moving forward with it and let you guys know how it goes and whether it's worthy of your time too.
On another note, I finally got Google Code's SVN repository to work. What was wrong? I used http:// instead of https:// and it wouldn't accept my password. Ugh and doh.
On another note, I finally got Google Code's SVN repository to work. What was wrong? I used http:// instead of https:// and it wouldn't accept my password. Ugh and doh.
Monday, May 14, 2007
Saturday, April 28, 2007
States of the Union
I needed a lookup table of states and their abbreviations for my application so I rolled my own migration. I read data in from a CSV file and wrote these State.create statements into a new text file. If you need the same kind of table, maybe you can reuse what I did. Don't repeat yourself :)
class CreateStates < ActiveRecord::Migration
def self.up
create_table :states do |t|
t.column :code, :string
t.column :description, :string
t.column :display_order, :integer
t.column :active, :boolean, :default => false
t.column :created_at, :string
t.column :updated_at, :string
end
State.create(:code => 'AL', :description => 'Alabama')
State.create(:code => 'AK', :description => 'Alaska')
State.create(:code => 'AZ', :description => 'Arizona')
State.create(:code => 'AR', :description => 'Arkansas')
State.create(:code => 'CA', :description => 'California')
State.create(:code => 'CO', :description => 'Colorado')
State.create(:code => 'CT', :description => 'Connecticut')
State.create(:code => 'DE', :description => 'Delaware')
State.create(:code => 'FL', :description => 'Florida')
State.create(:code => 'GA', :description => 'Georgia')
State.create(:code => 'HI', :description => 'Hawaii')
State.create(:code => 'ID', :description => 'Idaho')
State.create(:code => 'IL', :description => 'Illinois')
State.create(:code => 'IN', :description => 'Indiana')
State.create(:code => 'IA', :description => 'Iowa')
State.create(:code => 'KS', :description => 'Kansas')
State.create(:code => 'KY', :description => 'Kentucky')
State.create(:code => 'LA', :description => 'Louisiana')
State.create(:code => 'ME', :description => 'Maine')
State.create(:code => 'MD', :description => 'Maryland')
State.create(:code => 'MA', :description => 'Massachusetts')
State.create(:code => 'MI', :description => 'Michigan')
State.create(:code => 'MN', :description => 'Minnesota')
State.create(:code => 'MS', :description => 'Mississippi')
State.create(:code => 'MO', :description => 'Missouri')
State.create(:code => 'MT', :description => 'Montana')
State.create(:code => 'NE', :description => 'Nebraska')
State.create(:code => 'NV', :description => 'Nevada')
State.create(:code => 'NH', :description => 'New Hampshire')
State.create(:code => 'NJ', :description => 'New Jersey')
State.create(:code => 'NM', :description => 'New Mexico')
State.create(:code => 'NY', :description => 'New York')
State.create(:code => 'NC', :description => 'North Carolina')
State.create(:code => 'ND', :description => 'North Dakota')
State.create(:code => 'OH', :description => 'Ohio')
State.create(:code => 'OK', :description => 'Oklahoma')
State.create(:code => 'OR', :description => 'Oregon')
State.create(:code => 'PA', :description => 'Pennsylvania')
State.create(:code => 'RI', :description => 'Rhode Island')
State.create(:code => 'SC', :description => 'South Carolina')
State.create(:code => 'SD', :description => 'South Dakota')
State.create(:code => 'TN', :description => 'Tennessee')
State.create(:code => 'TX', :description => 'Texas')
State.create(:code => 'UT', :description => 'Utah')
State.create(:code => 'VT', :description => 'Vermont')
State.create(:code => 'VA', :description => 'Virginia')
State.create(:code => 'WA', :description => 'Washington')
State.create(:code => 'WV', :description => 'West Virginia')
State.create(:code => 'WI', :description => 'Wisconsin')
State.create(:code => 'WY', :description => 'Wyoming')
end
def self.down
drop_table :states
end
end
Sunday, April 22, 2007
TextMate: Yes!
I've been using Eclipse with RadRails ever since I started learning RoR last summer. I chose that combo mainly because I use Eclipse at work already and I'm familiar with the user interface. I heard a lot of praise for TextMate but passed it off until now. I just purchased a licencse last week and so far I AM IMPRESSED. You can purchase an hour long screencast from PeepCode and learn how to enhance your TextMate experience. TextMate is OS X only though, so Windows guys luck out *blows rasberries*
I'm anxious to see the development of Rails IDEs in the coming months. IntelliJ, NetBeans, and Eclipse are pushing for full RoR support. I wonder who will have the best...
Here's a screenshot of TextMate using the Ruby Blue Theme
I'm anxious to see the development of Rails IDEs in the coming months. IntelliJ, NetBeans, and Eclipse are pushing for full RoR support. I wonder who will have the best...
Here's a screenshot of TextMate using the Ruby Blue Theme

Saturday, April 14, 2007
Flexing My Ambitions
I attended the OC Java Users' Group meeting this past Thursday and was introduced to a very sexy front end solution - Adobe Flex. James Ward gave the presentation and I was really impressed how Adobe is bringing aesthetics to user interfaces. I started out as a graphic designer (a mediocre one) so there's a part of me that's still passionate about beautiful interfaces and better user experience.
I don't know if it's just my experience, but corporate development means adhering to design rules and company standards that end up restricting creativity. The UIs are nasty, ew. At least on the consumer facing side the interfaces are allowed to look good. See HarleyDavidson.com and ABC.com.
It looks like Flex is also available for Ruby on Rails. I'm curious how it all ties into a RoR backend and it's on my list of things to learn. Boy is that list getting long, so maybe I'll get around to it by the end of this year.
--
There's lots of discussion among my friends and coworkers about starting our own businesses. Personally, I've been exploring how I can use open source software to generate extra income each year. Honestly, I feel like I have the technical skills to implement IT solutions. The hard part comes when I'd have to deal with clients and provide support for them. I don't see how that's possible to do while working a full time job.
I don't know if it's just my experience, but corporate development means adhering to design rules and company standards that end up restricting creativity. The UIs are nasty, ew. At least on the consumer facing side the interfaces are allowed to look good. See HarleyDavidson.com and ABC.com.
It looks like Flex is also available for Ruby on Rails. I'm curious how it all ties into a RoR backend and it's on my list of things to learn. Boy is that list getting long, so maybe I'll get around to it by the end of this year.
--
There's lots of discussion among my friends and coworkers about starting our own businesses. Personally, I've been exploring how I can use open source software to generate extra income each year. Honestly, I feel like I have the technical skills to implement IT solutions. The hard part comes when I'd have to deal with clients and provide support for them. I don't see how that's possible to do while working a full time job.
Saturday, March 31, 2007
Daily Dose of SCJP
I've set a goal to become a Sun Certified Java Programmer in the first half of 2007. I formed a study group with coworkers and that seems to be moving along quite well. We're holding study sessions based off this book that many have recommended. Let's see if I can be disciplined enough to read a chapter a week. It's not that easy when I'd rather spend that time reading my RoR books =D
I stumbled upon a website called Examulator that poses an SCJP practice question every day. I set it as my homepage as motivation to study harder. Just thought I'd share it with you too.
I stumbled upon a website called Examulator that poses an SCJP practice question every day. I set it as my homepage as motivation to study harder. Just thought I'd share it with you too.
Wednesday, March 28, 2007
puts 'Hello World'
A developer blog that announces itself to the internet with a Hello World program...what else did you expect?
I spend a lot of time reading articles and learning new new things every day. Sometimes I take notes or bookmark links and end up forgetting all about them. This blog is meant to be a record of what I'm learning and to share any gotchas I crash and burn on.
No riveting posts related to my life here :]
I spend a lot of time reading articles and learning new new things every day. Sometimes I take notes or bookmark links and end up forgetting all about them. This blog is meant to be a record of what I'm learning and to share any gotchas I crash and burn on.
No riveting posts related to my life here :]
Subscribe to:
Posts (Atom)
