Aug 11
GM says their new Chevy Volt will get up to 230 miles per gallon in the city.
This would be the first vehicle to exceed the three digit gas mileage barrier. The car has an electric motor and a small internal combustion engine inside. The electric motor is rechargeable using your standard home outlet.
Set to hit the showrooms in 2010 this would be a huge jump from the current electric / hybrid cars that do not get more than 100 MPG.
I’m very excited to see what kind of response this car will get when it finally hits the streets. I do have to mention that as of right now the car is estimated to cost about $40K which limits its consumer market. However, I am sure that the pricing will be restructured in order to make the vehicle more affordable.

Image Source: http://www.ecoautoninja.com/wp-content/uploads/2009/04/chevy-volt1.jpg
Aug 10
This is a very simple Browser Compatibily Script using ASP to help you with basic cross-platform issues.
So what I was looking for is very simple. I have a page which uses CSS to display a New Products Bar on a website. I was using CSS along with JQuery and when all was said and done, in IE everything was working perfectly. However, as most developers know, one of the most common issues with different browsers is how they handle CSS. When I checked the same page in FireFox, my text, which was supposed to be in the middle of the screen, was showing up at the top left of the site (position:absolute). Therefore, instead of re-coding the whole page and figuring out how to make JQuery and CSS play nice with all browsers, I decided to simply implement a very basic browser-compatibility script to get around the problem.
<%
dim currentBrowser, browserHeight
currentbrowser = Request.ServerVariables("HTTP_USER_AGENT")
If InStr(1, Request.ServerVariables("HTTP_USER_AGENT"), "MSIE") then
browserHeight = "0"
Else
browserHeight = "-12"
End If
%>
Basically, I am checking to see if the browser that is calling this page is IE or not. If it is IE I am setting the browserHeight=0 and if it is any other browser then I am setting the browserHeight=”-12″.
browerHeight is serving as my top: value in CSS.
That’s it. Without spending too much time I solved my problem with this simple block of code. Of course, this is not meant for everyone, but it is a very useful script for anyone who needs a quick fix with browser-compatibility issues.
Aug 09
ERROR 1452 (23000): Cannot add or update a child row: a foreign key constraint fails
Here’s what happened and how I fixed the error:
I had two tables I was working on – CUST and MEDIA tables. I was looking to modify the cust table and make the MEDIA_ID (PK for MEDIA TABLE) a FOREIGN KEY in the CUST TABLE. However, after several attempts I kept getting the aforementioned error.
Here is my ALTER statement: ALTER TABLE CUST ADD FOREIGN KEY (MEDIA_ID) REFERENCES MEDIA (MEDIA_ID);


I researched this ERROR online and found many possible fixes however, none of them applied/worked for my problem. Therefore, I decided to start over and do a thorough inspection on both of these two tables…
In a matter of seconds I found the problem….If you will take a look at the two images above you will notice that the MEDIA_ID in the CUST table was defined as a decimal(1,0) while the MEDIA table defined MEDIA_ID as a decimal(10,0). Therefore, my REFERENCE clause was failing since the MEDIA_ID in the MEDIA table accepts different values opposed to the MEDIA_ID in the CUST table.