CSV to Excel – keep leading zeros
When opening a csv file in excel, leading zero’s are displaced as below:
if the CSV file has “010101″, when opened in excel, it becomes “10101″.
To overcome this issue, store data in CSV file as =”010101″ (add ‘equals’ sign before the first quote.). If now you would open this file in excel, the leading zeros will stay as is.
IE 6 bug in window.location
There is a bug in IE 6 where following code does not work
var newUrl = "http://www.google.com/";
window.location = newUrl;
// This also doesn't work!
// window.location.href = newUrl;
After a scratching head for couple of hours, found the solution here
var newUrl = "http://google.com/";
setTimeout(function()
{
window.location = newUrl;
}, 0);
TOP 25 Most Dangerous Programming Errors
- CWE-20:Improper Input Validation
- CWE-116:Improper Encoding or Escaping of Output
- CWE-89:Failure to Preserve SQL Query Structure
- CWE-79:Failure to Preserve Web Page Structure
- CWE-78:Failure to Preserve OS Command Structure
- CWE-319:Cleartext Transmission of Sensitive Information
- CWE-352:Cross-Site Request Forgery
- CWE-362:Race Condition
- CWE-209:Error Message Information Leak
- CWE-119:Failure to Constrain Operations within the Bounds of a Memory Buffer
- CWE-642:External Control of Critical State Data
- CWE-73:External Control of File Name or Path
- CWE-426:Untrusted Search Path
- CWE-94:Failure to Control Generation of Code
- CWE-494:Download of Code Without Integrity Check
- CWE-404:Improper Resource Shutdown or Release
- CWE-665:Improper Initialization
- CWE-682:Incorrect Calculation
- CWE-285:Improper Access Control
- CWE-327:Use of a Broken or Risky Cryptographic Algorithm
- CWE-259:Hard-Coded Password
- CWE-732:Insecure Permission Assignment for Critical Resource
- CWE-330:Use of Insufficiently Random Values
- CWE-250:Execution with Unnecessary Privileges
- CWE-602:Client-Side Enforcement of Server-Side Security
How to RDP Vista Home Premium with SP1
Previously I had written a blog entry to enable RDP on Vista Home Premium. After installing SP1, I realized that I could not connect to my machine. After a little search in google, I found the same group has done their magic for SP1 too. For your reference, here is the file.
Edit Windows Vista Hosts File
1. Open Notepad with Administrative privileges by clicking Start, All Programs, Accessories, and then right-click Notepad and select to open as Administrator.
2. Browse to (C:\Windows\System32\drivers\etc) in Notepad and open the hosts file.
Now you can edit and save the hosts file.
How to RDP to Vista Home Premium
I cannot believe it. I recently bought new computer which came with Vista Home Premium installed. Everything was cool and only thing I missed was that I could not RDP to it. After searching a little on google, found a great great hack to fix the problem. Kudos to the hackers who made this possible!!
