Archive for the ‘Software Development’ Category

Wordpress Install for Development on a Mac

Wednesday, September 26th, 2007

I like to customize my blog page that is running on Wordpress. Obviously, I would like to replicate the setup in my Mac.

I will go through a step-by-step instructions on installing Wordpress in my Mac.

1. Download MAMPS. I choose the non-pro version. You should get a .dmg file.

2. Download Wordpress. I choose to download the .tar.gz file. It does not really matter which one you choose.
(more…)

W3C CSS and HTML Validation

Wednesday, May 16th, 2007

I just noticed that my theme passes the W3C CSS validation!

I can also easily validate my future themes easily.

Update: My theme also passes the W3C HTML validation!

Updating Locomotive with the Latest Rails Version

Tuesday, February 27th, 2007

I was working on chapter 9 from the Agile Web Development with Rails. I noticed that clicking on the “Add to Cart” button did not work. I checked my code a few times and found that the code was fine.

I could not find anything useful using the Google search.

I remembered a quote from one of the Sherlock Holmes adventures, “When you have eliminated all which is impossible, then whatever remains, however improbable, must be the truth.”

I started going through the potential issues that I could think of:
1. I thought I incorrectly typed the code. I even tried to copy and to paste the code from the book. Problem was still there… :(
2. I checked the logs and thought that the database was not working. I saw the database query worked correctly. I even restarted the MySQL server.
3. I tried using Safari to access the project (I usually use Firefox). I wanted to make sure that I could reproduce the problem with a different browser. The problem was there. “Interesting” was the word that came to mind.
4. I restarted Mongrel and the problem persisted. Hmmm… OK.
5. I restarted my Mac. Silly me… :)
6. Finally, I thought that I might have used an older version of Rails since I created the depot project and Rails defaulted the version to 1.1.6.
(more…)

Ant: Using Secure Copy (scp) to Copy Files to Servers

Saturday, February 3rd, 2007

During my Java class, we have 2 different deployment machines: one for the MySQL server and another for the web server.

Since the remote server is not configured to accept any ftp connections, I am forced to use scp. It’s a pain to manually scp my file manually to the web server, so I did a bit of research and found a good way to securely copy my file (to the web server).

(more…)

Ruby on Rails: Fail on rake db:migrate?

Tuesday, December 26th, 2006

I am learning Ruby on Rails by reading Agile Web Development with Rails Second Edition.

I have reached chapter six page 80. We want to add a new ‘price’ column. Unfortunately, running rake db:migrate gave me the following error:
rake aborted!
You have a nil object when you didn’t expect it!
You might have expected an instance of Array.
The error occured while evaluating nil.[]

I am using Locomotive (with the cool locomotive icon nonetheless!).

I did the following to resolve the rake aborted issue:
1. Open up your application from Locomotive in the terminal window.
2. Run the following command:
gem install rails –source http://gems.rubyonrails.org –include-dependencies
3. Edit your config/enviroment.rb set
4. Find and change the following:
RAILS_GEM_VERSION = ‘1.1.6.5618
5. Try rake db:migrate again and you should be OK now.

Setting Focus on Web Form

Monday, December 25th, 2006

Having a good user interface is very important for our websites and I have one new website design guideline.

If the user is expected to enter any data, we want to make sure that we set the focus appropriately on the right data field (e.g. text box or check box).

Setting the focus is very easy as well, so there is no good excuse if a website does not implement this feature.
(more…)

SVN Export

Friday, December 22nd, 2006

I set my class project incorrectly using svn. To make a long story short, I put my Eclipse workspace directory in the svn repository. (I know.. I know.. I have learned my lesson now).
Here is my directory structure:
Svn Mistake

(more…)

Use Ruby on Rails to Maintain Database Schema

Monday, November 20th, 2006

For my J2EE-based RSS reader project, I have managed to successfully use Rails to maintain my database schema.

Quick summary:
* Create a Rails project.
* Create a new model.
* Use rake db:migrate to upgrade or to downgrade the database schema.
(more…)

XML Processing In Java Using XOM

Sunday, November 19th, 2006

I have decided to use XOM API to process XML data. There is no good reason actually. I may revisit another XML API (e.g. JDOM) in the future.

What I have done is to read the XML from the Internet (e.g. Digg RSS) and process it.

To summarize what I have done:
1. Open a connection.
2. Tell the XML API to read from the connection stream.

Simple, eh? :)
(more…)

Type java.lang.object cannot be resolved

Sunday, November 19th, 2006

I switched my main development computer. I thought all I needed to do was to move my development directory from my previous computer to the new one.

When I start the Eclipse IDE, I started to get the “Type java.lang.object cannot be resolved” error everywhere (I mean EVERYWHERE).

After some research using Google, I found the solution!

I assume that Java has been installed correctly in your (new) machine. Do the following steps:
1. Right-click on your project.
2. Select Build Path.
3. Select Configure Build Path.
4. Select Libraries tab.
5. Select Add Library.
6. Select JRE System Library and select Next.
7. Remove the previous JRE System Libary.