Tuesday, July 18, 2006

Subversion svn server

Pragmmatic Version Control - using Subversion is a very easy to read book. It makes it easy to learn about Subversion. This book will prepare you to move on to the free book on Subversion available at redbean. Search Rails mailing list for the actual link.

The reason for this post is that this explains about how to use the svn server to connect to your repository. I am running Subversion on my Powerbook. The IP address changes due to my ISP. In order to give a host name to my Mac I followed the instructions on the site Give your Mac OS X computer a hostname with DynDNS

It was easy to sign up for the account. However the article does not provide the following tips:

The website design makes it very difficult to navigate. Find the link for Home Solutions on the left navigation and go to "Official Macintosh/OS X Update Client". Download this and install it. Follow the instructions on the article I have mentioned above.

The update client will automatically map the dynamic IP of the machine to the host name you have selected.

Now you can enjoy working on your machine when you are away from home!!!

Monday, July 17, 2006

Subversion, RadRails, Subclipse and Eclipse

Installed Eclipse 3.2, Subclipse, and Eclipse Plugin for RadRails. You must install the RDT before installing RadRails, So grab this first http://updatesite.rubypeople.org/release and then this http://radrails.sourceforge.net/update

Otherwise you will get error message that the dependent library is not found.

The new version of standalone RadRails 0.7 is just out. I think it will be available for download anytime.

I don't know how to get rid of the missing JavaHL library in standalone RadRails. This prevented me from configuring the Subversion. This problem is happening in the other configuration also.

Got some help from Rails mailing list. Select the JavaSVN (Pure Java) as the SVN interface. The error message disappeared.

Thursday, June 01, 2006

Upgrading old rails application for new rails version

Run the following command from your application directory:

rake rails:update

This will update all the configs, scripts and javascripts to the latest
version.

Sunday, February 19, 2006

JSP 2.0, MySQL Server and Tomcat 5.5

Installed JDK 1.5 by making it the first entry in the path variable. Oracle was pointing to JRE 1.3.
Installed Tomcat 5.5. This version runs as a windows service and does not have the usual start and stop tomcat features. Wonder why.
Installed the MySQL server. Created an admin account with admin as the password. My SQL server runs on port# 3306. During the creation of the account it failed to connect to the MySQL server because windows was blocking the port.
To allow the connection to the MySQL server port go to control panel -> firewall -> advanced and new configuration. Name the description of service as MySQL server and provide the name of your computer (or just say localhost, windows automatically changes it to the name of your computer). Enable the TCP/IP by giving the external port number as 10061 and internal port number as 3306. Save it. Now the configuration assistant will complete with no problem when you click on the "Retry" button.

Created a test table by following the Data Source configuration instructions for Tomcat 5.5. You have include a Context entry in the server.xml with data source configuration settings. You must also create a web.xml file. Deploy the test.jsp as war file. You will be able to run it and see the output of the JSTL tags which queries the table and shows the data in the table.

If you get exception related to JSTL tags then you must copy the JSTL tag related libraries to your WEB-INF/lib directory.

The new features of JSP and JSTL allows rapid development of dynamic web pages driven by database. This is a perfect solution for web apps that are just reporting tools with no business logic. In this case the application is simple and does not need a domain model, intergration tier etc.

JSF on Mac OS X

1) Installed the open source JSF plug-in for Eclipse.
2) Installed Tomcat and Sysdeo plug-in.

I was able to run simple login app using JSF. It is very easy to use the JSF XML editor. It gives context help. Defining the navigation is also very easy by using the Palette feature of plug-in. This lends itself for visual development. It generates all the XML code for navigation rules etc.

Also looked at using WSAD 5.1.2 with its inbuilt JSF capabilities. Decided not to use it. Mainly because it generates a lot of IBM extensions in the generated code. This is not acceptable, since portability is very important. Clients who want to use open-source tools must be able to run my apps.

Sunday, October 09, 2005

Year End Tax Planning for the Self Employed

Ways to minimize tax deductions:

1. Send december invoice to your client on Jan 01.
2. Pay your accounts payable in advance (even those that are due in jan). Could be your accommodation for the month of Jan.
3. Buy equipment for your business and take a deduction for upto $17,000. Of course this must be required by the business so that it gives you an competitive edge in the market and generates cash flow in the future.
4. Spend money to accelerate your corporate growth. I love this one. I might buy a high-end laptop and Webtrend pro by the end of this year.

These ideas are good if you have a good cash flow. You either postpone your income or prepone your expenses to minimize taxes. This is helpful because, it helps you during the transition to a new contract when you have to wait for 45 days or more for the first payment. So tax planning helps to get through the bumps ahead in the first quarter of next year. Don't over do or abuse it. It is reasonable to do it for the right reasons.

Consult a CPA and get advice for your scenario. I called a CPA and the fees are too much for me. He quoted $1600 for his services.

You could also apply for a solo 401k before the end of the year. But you don't have to fund your account by the end of the year. Because only after the end of the year you will be able to compute the amount of money you can contribute to this account. It is computed only for the amount you earned on 1099. You have to exclude any w2 income. Solo 401k allows you to get loan against your account for upto 50% of your account (maximum is $50,000). This way you can have your cake and eat it too. You get the tax benefit, the remaining money in your account act as an emergency fund and you are able to access half of the account and use it for your business or personsal expenses.

Tuesday, October 04, 2005

How to calculate your hourly rate

I accidentally found a new way to find your hourly rate for your consulting services. As many of you already know that the rate depends on the geographical location. Search for salary calculator in Google and go to the homefair.com website.

1. Calculate the salary based on your present location to the new location. Let's say it is 160k /yr.
2. Do a job search on Dice and check out the salary or hourly rate for that area and your level of experience. Lets say this is 95-145k/year.
3. Go to Candlewood suites website and check out the daily room rate for 30 days or more. For example this can be 80/night.

As you can see #1, #2, #3 all confirm each other. (160/2=80)

So your hourly rate for the new location should be $80/hr

Wednesday, September 28, 2005

Time Management

1. Do few things and do them well.
2. Learn few long lasting things very well.
3. Minimize delegation to others as much as possible. Eliminating this dependency increases reliability.
4. Don't expect to do lot of activities during your spare time. Just relax.
5. Clear out the clutter on your desk and focus on accomplishing one task at a time. Set your ego aside and leave multitasking to Bill Gates.
6. Set your priorities to help you choose things that must be done.
7. Consider maintenance costs in time and money before spending money on any item.
8. Reduce learning curve by focusing your learning on few things that are stable and does not change too fast.

Tuesday, March 15, 2005

auto login

Step 1 : Include this :

JavaScript begin tag

function autoSubmit(form){
document.forms[0].submit();
}
End javascript tag

begin [body onLoad='autoSubmit()']
begin html:form action="/LoginLogout.do?method=login">

Step 2 : Hard code the user id and password in the value attributes.

Saturday, March 12, 2005

From Use cases to code in a Struts project

Notes on going from Use cases to code for Struts. Joe Seilman and Struts in action.

1. Gather requirements.
2. Determine the data captured and displayed to the user. Screen requirements.
3. Find all the possible paths to the screen.
4. Design Action Mappings from the workflow of the application.
5. Create Action Form classes from the screen.
6. Create Action classes to implement the Action Mappings.
7. Develop the business logic by implementing the Business Delegate.
8. Develop the JSP and the presentation tier components.
9. Configure the components - struts-config.xml, web.xml resource bundle etc.
10. Build - Deploy - Test.

Tuesday, January 11, 2005

Changing administrator password in Oracle 9i

1. Open the DOS command prompt and enter: sqlplus /nolog
2. Type : connect / as sysdba
3. Type : alter user sys identified by new_password;

This alters the password for the adminstrator (sys).

Monday, January 10, 2005

Oracle 9i and WSAD 5.1.2

Installed the Oracle 9i database and client on my PC. Select * from emp; query shows all the records in the emp table from the SQL window. So, the installation issuccessful. Some of the components are mutually exclusive and during the installation it does let the user know about this.

WSAD 5.1.2 installation messed up my existing Eclipse 3.0 installation. I cannot bring up the Eclipse anymore. Is this due to the WSAD 5.1.2 using Eclipe 2.1 ? My plan is to install Eclipse on the laptop when I get one.

Changed the Oracle db related services to run manually instead of automatic. TNS listener and the DBName processes must be started to use the database. Need to download the JDBC driver classes12.zip. I think it is free. Once the database is setup, I can start playing with Hibernate framework.

Thursday, January 06, 2005

Balanced Programming

After reading all the hype about Xtreme programming by the Software Swamis, I would like to introduce the Programming Community to my theory of Balanced Programming. This concept is similar to the idea of Balance as the key to leading a good life. Balanced Programming recognizes the good aspects of other programming theories and balances them to a level that optimizes the benefit of software productivity and quality. Think of it as a stereo tuning with several different controls to optimize the frequency of the particular type of music that you are hearing.

In this theory, neither the design is considered dead nor is programmer testing detested. Design is done when necessary to improve the quality of the code base without getting stuck in analysis paralysis. Testing is also done when it gives most value and is one of the primary means of finding Interfaces.

Wednesday, January 05, 2005

Commonclipse

Nice tool to generate :

toString()
hashcode()
equals(Object)
compareTo(Object)

from Eclipse.

Saturday, January 01, 2005

Estimating taxes for the self employed

This site looks interesting. I will post later if the estimates were good after consultation with a tax professional.

Friday, December 31, 2004

Displaying Dates in American Format

Displaying a date field as a text field in a Web application:

Date now = new Date();
SimpleDateFormat sdf = new SimpleDateFormat("mm/dd/yyyy");
sdf.format(now);

Displays the date as : 12/31/2004

Tuesday, December 28, 2004

Calculating Yesterday's Date

private Date yesterday() {
long calcTime = System.currentTimeMillis() - 86400000L;
Date yesterday = new Date(calcTime);
return yesterday;
}

Tuesday, December 21, 2004

Time for PC Upgrade 2

Just received the 512MB memory card from memory4all.com. Installed it on my m/c which already has 1GB or RAM. This website was nice in that it ran a diagnostic on my machine and recommended a compatible memory card for my PC. After installation my PC is now on Steroids.

Also I got the M$ fingerprint reader for easy login to the PC and websites. The new Bose PC speakers kicks a**. Cool thing about this is that it can be plugged into the Bose Walkman using the adapter shipped along with the package. It was free with the purchase of the Bose Noise Cancellation headphones. This makes it a compact and portable DJ system. The only question is : What is the biggest room that it can perform really well?

Surviving Abrupt Shutdown

Nice article for doing tasks before the program exits. Surviving Abrupt Shutdown

Now I have the following lines of code in the constructor :

shutdownHook = new ShutdownHook();
Runtime.getRuntime().addShutdownHook(shutdownHook);

and the new ShutdownHook class takes a snapshot of the Prevayler system.

/*
* Created on Dec 22, 2004
* @author Bala Paranj
*/
package com.zepho.mailer;

import com.zepho.persistence.UserDAO;

public class ShutdownHook extends Thread {
public void run() {
System.out.println("Taking Prevayler system snapshot before shut down...");
UserDAO userDAO = new UserDAO();
userDAO.backup();// TODO: backup must be taken only once every 24 hours.
}
}

Thus avoiding the reading of commands from multiple files during system startup. This speeds up the system startup.