JitendraBhatt.com | Blog | My Albums | Web Samples Thursday February 09, 2012 
Jan 05

I decided to help my buddy out with a website he is working on. It has over 2000 pages all which are in html. In order to make it a bit more dynamic we are changing all of the pages to .php and updating the code to be more flexible and easier to update. We should incorporate a database and make the website data-driven however we’ll forget about that for now and focus on the topic at hand.

So while changing all the pages to .php I realized that most of the pages have anywhere from a few hundred to over a thousand other pages linking to them. Instead of constantly updating every page on the site and uploading it to the server I decided to use a redirect on the old .html pages in order to alleviate any concerns about missing or incorrect links. I do not want forget to change a single link, since we all know that will end up being the most important link of all!!!

Anyway, I decided to incorporate a simple HTML redirect.
<head><meta HTTP-EQUIV=”REFRESH” content=”0; url=http://www.yourdomain.com/index.html”></head>

The redirect solution is not ideal in many cases, but can be useful when absolutely needed. In this case, I no longer have to worry about a single incorrect link. Any page that linked to abc.html is now being redirected to abc.php. This is a very simple way to avoid major headaches and speed up the updating process. The main thing to keep in mind is to delete everything from the old HTML page except for the redirect code. This will help with the redirect speed. If you comment out all the code on the .html page, the server will still load it before redirecting to the new page!

Data Source: Web Source

Sep 10

How to install NVIDIA Drivers on your WIN 7

All over the internet all Lenovo users are having the same issue with the new WIN 7 OS. They cannot get the NVIDIA Drivers working on their laptop. If you are like me and use your laptop to connect to your HDTV, play games, or edit videos then of course this is a major problem. I have seen many people post bogus solutions with links that do not work or take you to a “This page does not exist” site, or simply post workarounds that do not “WORK”!

Well, I have the solution for you and it’s a simple fix that takes less than 1 minute.

NVIDIA Quadro NVS 140M Driver Instructions:
***Follow these instructions step by step, do not try steer away from the instructions or the install will not work!!!
1) Download the NVIDIA VISTA x64 bit driver from Lenovo.com (YES VISTA DRIVER FOR WIN 7)
2) Extract the files to C:\DRIVERS\WIN\VIDEO
3) Open up Command Prompt
4) Type in C:\DRIVERS\WIN\VIDEO\SETUP.EXE
5) Follow the NVIDIA prompts all the way through
6) Click Finish and restart your computer

That’s it! Please let me know if this does not work for you and I will do my best to help…

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);

CUST table

MEDIA table

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.

Jul 28

After installing a fresh copy of WIN 7 RC I began re-installing all of my software and devices. Everything was going smooth until the time came to install my printer driver. I own an HP LaserJet 1020. This is a very popular model as it was one of the first compact affordable laser printers available to consumers.

• First I went to the HP website to check if they have added a WIN 7 driver. Unfortunately they do not have one available.
• Next I decided to see if WIN 7 has the driver already built-in (see steps below):
    • Open the Control Panel (Start –> Control Panel)
    • Click on View devices and printers (Hardware and Sound)
    • Click on Add a printer
    • Click on Windows Update

After a few minutes a list of Manufacturers and Printers populated the blank screen.

WIN 7 Printer Driver Window

WIN 7 Printer Driver Window


I checked to see if my printer was there and unfortunately it was not.
Short on options I decided to do a little research…

After a while I finally found the solution to my problem! WIN 7, I am happy to say, is ready and prepared for any compatibility problems. By the way, my solution should work for any driver or software installation issue you may come across.
Here is how I managed to workaround the driver issue.
If you know for sure that the software/printer/device/etc… worked before on your previous OS then you have the option to install it using the “Troubleshoot Compatibility” option. Simply right click on the software and select “Troubleshoot Compatibility”. You can start with the “Try recommended settings” an if that does not work go with the “Troubleshoot program” option. Pay attention to the OS options when you get to that step and make sure you select the OS that you know the program/device worked on before.
And that’s it!

Jul 22
Final code sent to PC makers Wednesday; Oct. 22 launch still planned

By Jessica Mintz
APTRANS[1]
updated 5:34 p.m. ET, Wed., July. 22, 2009

Microsoft says Windows 7 is complete.

The software maker sent the final code for its next computer operating system to manufacturers Wednesday, and said it’s still on track for an Oct. 22 launch. (Msnbc.com is a joint venture of Microsoft and NBC Universal.)

Mike Angiulo, a general manager in the Windows group, said in an interview that getting up and running on a Windows computer will be “a lot smoother” than it was when Windows Vista launched in 2007.

At the time, Microsoft boasted about the number of programs and devices that would work with Vista, but many PC users found their existing software, printers, scanners, cameras and other hardware didn’t function after the switch.

Microsoft said one reason Windows 7 should be an easier launch is that at its core, the new version is a lot like Vista. If a company updated a product to work with Vista in the last few years, it should also work with Windows 7.

Windows 7 has also progressed in an orderly way, which means outside companies have had more time to make sure their products will work. Vista was plagued by changes to Microsoft’s plans, leaving partner companies scrambling to keep up.

The new operating system will launch into a much tougher climate than Vista did. PC shipments are expected to fall this year for the first time since 2001, as the economic crisis has forced businesses to slash technology spending. Microsoft built in a way for companies to run older, Windows XP programs in Windows 7, in an attempt to avoid losing those corporate customers that skipped Vista altogether because critical software wasn’t compatible.

Companies that have long-term agreements to buy Microsoft software in bulk will be able to download and start installing Windows 7 in a few weeks, Microsoft said.

Then starting Oct. 22, Windows 7 will come on new PCs, and will be available for people to buy separately and install on their existing machines.

© 2009 The Associated Press. All rights reserved. This material may not be published, broadcast, rewritten or redistributed.

Data Source: http://www.msnbc.msn.com/id/32090023/ns/tech_and_science-tech_and_gadgets/

Jul 22

A common error in AI is the “Could not find the linked file “…name of missing file…”.  Choose Repair to locate the missing file, Replace to select another file, or Ignore to leave the link unchanged.

AI - Could not find the linked file ERROR
AI – Could not find the linked file ERROR

This simply means that there is an image or external file that is linked to the AI file but is not embedded.  If you get this error you either need to get the additional file that is linked to your AI file or you need to have whoever provided you this file embed all images so that you no longer receive this error.