Latest Post

Error: No input file specified.

While trying to run a codeigniter app the other day I came across this error just after I had finished uploading the files and making the ne...

Monday, February 22, 2010

Get number of days from a given mysql date field

Using mysql's inbuilt TO_DAYS() and CURDATE() functions one can determine the number of days from a given mysql date field to date.


SELECT date_field, CURDATE() AS Current_Date, (TO_DAYS( CURDATE() ) - TO_DAYS( date_field )) as difference FROM table_name


SAMPLE OUTPUT OF THIS WOULD BE :


date_field Current_Date difference
---------- ------------ ------------
2010-02-11 2010-02-22 11
2010-02-10 2010-02-22 12

Friday, February 19, 2010

Dreamweaver startup javascript errors

"The following JavaScript error(s) occurred: At line 56 of file "C:\Program Files\Macromedia\Dreamweaver 8\Configuration\Shared\Common\Scripts\dwscriptsExtData.js": ReferenceError: dwscripts is not defined."


If you are experiencing a JavaScript errors related to "dwscripts" (see above) or if you are receiving a "translators were not loaded" error message when Dreamweaver 8 is starting up then you may try the following recommendations from the Adobe site:

Remove the WinFileCache-7A9586CB.dat file from the Dreamweaver user configuration folder. If that doesn't solve it, then recreate the Dreamweaver user configuration folder.


Delete FileCache.dat files from the Dreamweaver user configuration folder.

Delete the WinFileCache-7A9586CB.dat, MacFileCache-BFE7CE2E.dat, or FileCache.dat file from the Dreamweaver user configuration folder. It is recommended to delete the FileCache.dat file if you are experiencing a JavaScript error related to "dwscripts" or if you are receiving a "translators were not loaded" error message. The string of characters after "FileCache-" may differ on your machine. The location of the FileCache.dat file depends your operating system and your version of Dreamweaver. Note that on Windows, the Application Data and AppData folders are hidden by default, so verify that your Windows Explorer folder options are set to View Hidden Folders.
Dreamweaver CS3 on Windows Vista:
C:\Users\[username]\AppData\Roaming\Adobe\Dreamweaver 9\Configuration

Dreamweaver CS3 on Windows XP:
C:\Documents and Settings\[username]\Application Data\Adobe\Dreamweaver 9\Configuration

Dreamweaver 8 on Windows XP:
C:\Documents and Settings\[username]\Application Data\Macromedia\Dreamweaver 8\Configuration

Dreamweaver 8 on Windows Vista:
C:\Users\[username]\AppData\Roaming\Macromedia\Dreamweaver 8\Configuration

Dreamweaver CS3 on Macintosh:
Mac HD/Users/[user]/Library/Application Support/Adobe/Dreamweaver 9/

Dreamweaver 8 on Macintosh:
Mac HD/Users/[user]/Library/Application Support/Macromedia/Dreamweaver 8/


Source: http://kb2.adobe.com/cps/191/tn_19105.html#dat

Tuesday, February 16, 2010

Javascript - how to continue text in next line



var sometText = 'abc\
defghi';
alert(sometText);



This will not result in a javascript error because each time javascript encounters the single backslash, "\" it knows the statement continues on the next line.

Without the "\", Javascript will assume that the line has ended and give an "unterminated string constant" error.

Chitika Ads