How did I change my 2003 Honda Civic Stereo

My 2003 Honda Civic had factory made stereo, which don't have a provision to hook up my iPod using either Auxiliary or USB. I decided to replace that with an after market CD receiver (Sony XPlod). When I heard about hefty bill from service centers/dealers for changing a car stereo, I decided to do it myself. After all, it's not as tough as I thought. Here are my learning and mistakes.

Sony Xplod from Crutchfield.com:
I bought a new Sony MEX-BT3800U from Crutchfield.com. The unit looks good (front-panel) and the bluetooth and iPod controls are just awesome. The call sound quality is satisfying without an external mic. Crutchfield.com gave me instructions and master sheet for changing the car stereo. You might find same unit for lesser price in amazon, but the instructions are worth few extra bucks.

Research / References:
Crutchfield gives you instructions that are easy to follow with suggested tools. I had done some research before started doing the work. I found the following two links and the videos are very useful and gave me some clue.

My 2001 Honda Civic Car Stereo Removal

Ben Johnson's Weblog

Youtube Videos:
Part 1
Part 2

Dismantling:
I found little hard to pry out 'gear shift panel', 'gear shift ring' and climate control unit. At some point, you might have to apply little extra pressure to pry few parts out. So, always look for any clips or clamps or even a screw holding up the parts, oversight might cost you fixing the broken parts.

I really don't have much to say besides the images below.

In above picture, The highlighted clamps holds up the gear shift rim. The clamps highlighted in white are the ones holding up the top cover and the red color pins from sides are holding the side cover. Remember, the side cover is a single part should be dismantled with "12V" outlet assembly.


This one shows the pin I broke (highlighted in RED) and green one shows an unbroken pin. I thought I put the panel tool in the gap and pry out the part and it broke the pin. So, don't use any tools near the pins. It will damage the pins.



Clamps holding your 12V dash. The center would the last one to come out. It was pretty tight.


Climate control unit with clamps highlighted.

Also, make sure you disconnect the car battery as instructed. Failure to do so, might cause short circuit and blown up fuse.  It happened in my friend car. 

So..  thats it!!! Leave your comments!

A Tamil Poem

I found this in one of my friend's Orkut profile. I wanted to proudly have it on my blog...

கனியிடை ஏறிய சுளையும் – முற்றல்
கழையிடை ஏறிய சாறும்
பனிமலர் ஏறிய தேனும் – காய்ச்சுப்
பாகிடை ஏறிய சுவையும்
நனிபசு பொழியும் பாலும் – தென்னை
நல்கிய குளிரிள நீரும்
இனிய என்பேன் எனினும் – தமிழை
என்னுயிர் என்பேன் கண்டீர்

Hands on with SimpleFormController and DisplayTag

Recently, I got to work on SimpleFormController (Spring Framework class for handling web Form) with DisplayTag . It took me a while to get used to SimpleFormController. I should also mention that at first look it might seem lot of mess instead of trying to solve your problem, hey won't you get that feeling whenever you are trying to use any new technology??

I had to use debugger to understand the flow of control from various method. But you can follow this cheat sheet for complete flow diagram for SimpleFormController. You can inherit lot of methods based on your requirements, however following methods are the usual ones.

protected Object formBackingObject(HttpServletRequest request) throws ServletException;

public ModelAndView onSubmit(HttpServletRequest request, HttpServletResponse response, Object command, BindException errors) throws Exception;

protected boolean isFormSubmission(HttpServletRequest request);

protected Map referenceData(HttpServletRequest request) throws Exception;


formBackingObject : will be called by createCommand method from SimpleFormController. On form request, if sessionForm is set to true the model object created by formBackingObject is put in session. On form submit, the object is taken from session and not created once again.

Sample code:
@Override
protected Object formBackingObject(HttpServletRequest request) throws ServletException {
SearchForm command = new SearchForm();
command.setName("Default_");
command.setPageSize("10");
return command;
}


onSubmit: All form submit logic have to go into this. I would suggest you to go through javadoc for all onSubmit() variant.

@Override
public ModelAndView onSubmit(HttpServletRequest request, HttpServletResponse response,
Object command, BindException errors) throws Exception {
SearchForm searchParam = (SearchForm) command;
System.out.println("your input is ... " + searchParam);

ModelAndView mv = null;
mv = showForm(request, errors, getSuccessView());
String pName = searchParam.getName();
if (pName == null || pName.length() == 0) {
pName = "Default_"; 
}
ProductSearch st = new ProductSearch();
st.setProducts(Util.getTableData(pName, 50));
HttpSession session = request.getSession();
session.setAttribute("TABLE_DATA", st.getAllProducts());
session.setAttribute("pageSize", searchParam.getPageSize());
System.out.println("done search ..... displaying results");
return mv;
}


Here, you can also include a check to see if the request is for DisplayTag pagination or actual form submission and you don't have to form submit logic for pagination requests.

isFormSubmission: Default implementation of this method returns true when request method is "POST". You can override this to change its behavior. You would have to do this when you want to use DisplayTag pagination. I have given the sample code below.

@Override
protected boolean isFormSubmission(HttpServletRequest request) {
return !request.getParameterMap().isEmpty();
}


referenceData: I didn't have to implement this method for my hands on.


DisplayTag:

DispalyTag provides lot of feature for high-level web presentation patterns like paging, cropping, sorting and exporting etc. The implementation with spring is pretty neat. All you have to do is add below dependency in your pom.xml

<dependency>
<groupId>displaytag</groupId>
<artifactId>displaytag</artifactId>
<version>1.1</version>
</dependency>


Or add displaytag-1.1.jar jar file into WEB-INF/lib. You are all set. For other configuration options, go through DisplayTag documentation.

I found this useful article on http://devx.com on Displaytag.

For my hands on , the JSP looks like the one below with DisplayTag code.

<form  name="product_search" action="formpage.html" method="POST">    
Name: <spring:bind path="command.name">
<input type="text" name="${status.expression}" 
id="name" value="${status.value}" />
</spring:bind>

Type: <spring:bind path="command.type">
<input type="text" name="${status.expression}" 
id="address" value="${status.value}" />
</spring:bind>

<input type="submit" value="Submit"/>
<input type="hidden" value="${pageSize}" name="pageSize" />


</form>

<c:set var="searchResultPageSizeOptions" value="10,25,50" />
<c:set var="selectedValue" value="10" />
<spring:bind path="command.pageSize">

<c:if test="${!empty pageSize}">
<c:set var="selectedValue" value="${pageSize}" />
</c:if>
<select name="<c:out value="${status.expression}"/>" id="pageval" onchange="javascript:changePageSize();">
<c:forTokens items="${searchResultPageSizeOptions}" delims=","
var="localPageSize" varStatus="status">
<option value="${localPageSize}" <c:if test="${selectedValue == localPageSize }">
selected="selected"
</c:if> >${localPageSize}
</option>
</c:forTokens>
</select>
</spring:bind>


<display:table name="sessionScope.TABLE_DATA" pagesize="${pageSize}" requestURI="formpage.html" class="results-table">
<display:column property="id" title="ID" sortable="true" />
<display:column property="name" title="Name" sortable="true" />
<display:column property="type" title="Type" sortable="true" />
</display:table>

</div>



I hope this would be helpful. Please post your comments.

Outlook crashing with "Cannot start microsoft office outlook" msg

My outlook was crashing with "Cannot start Microsoft Office Outlook. Cannot open the Outlook window." error message. I had no clue what went wrong, but I knew why it was barfing on me. I was in a hurry to force shutdown my laptop yesterday. And I forgot to close Outlook (I closed every other running applications) before that.

The solution is ---

Start->run..then type the following -> "Outlook.exe /resetnavpane"

It worked like a charm!

Git is Awesome!


I got introduced to a distributed version control system called "Git". Git is not like traditional version control systems like SVN or CVS, but which provides much more features a developer can imagine/ would need for those painful code merges.

I had gone through this wonderful presentation by Bart Trojanowski and you can find them here. Bart provides brief intro on how Git works and how the version is tracked in Git ("the close to perfect" SCM). Then he goes on explaining about major features a developer would need to start using Git.

This presentation have been highly helpful for me to get grasp of Git. I want to thank Bart for this wonderful presentation and Ian Ward for making this screen-casts available online.

I installed Git on my PC machine using Cygwin. The stack is pretty awesome and neat. I would recommend the same for any PC users. When installing Git packages for cygwin, make sure you also pull in GUI tools ( gitk and git gui). If you are a tortoiseSVN or tortoiseCVS user, these tools would of great help.

Git uses local repository and does not need a remote (central) repository to get started. However, if you'd like to use some public Git repo servers for your hands-on, you could use either GitHub or repo.or.cz.

Follow the below link for setting up an account in Github. This is a screencast provided by learningrails website.

Version control with git.

As a summary, Git is a great version control system among other systems out there. Which comes with lots and lots of documentation, online tutorials and FREE public Git repositories. All of these could help developers a hassle-free transition towards using Git.

Great South Indian Recipes, I came across

A syndication of few blogs for south Indian recipes::

http://letzcook.blogspot.com by Deepz

http://veetusamayal.blogspot.com/ by Kribha

http://www.kamalascorner.com/ by Kamala

http://tamilcuisine.blogspot.com/ by Revathi and Crew

: $'\r': command not found in Cygwin

If you happen to have this kind of error for no reason, please make sure you convert your shell script file to UNIX format using any text editor like Notepad++. Initially it seems like a weird error but yet another valid issue with Cygwin + XP editor.

Here is an example, If you create a script in Notepad++

-------------------------------------------------------------------
#!/bin/bash
#
# My Cygwin weird error
#

clear
echo
"Knowledge is Power"
-------------------------------------------------------------------


When you run this script directly from Cygwin (by editing it from Notepad) you might forget to set the file format to Unix. This often result in following error.

-------------------------------------------------------------------

./print_a_line.sh: line 1: $'\r': command not found
Knowledge is Power

-------------------------------------------------------------------

Or,

You can convert them to UNIX format using shell utility dos2unix

So, Thats it! You are set!