Showing posts with label programming. Show all posts
Showing posts with label programming. Show all posts

Tuesday, January 13, 2009

CWE/SANS TOP 25 Most Dangerous Programming Errors

http://www.sans.org/top25errors/

Pretty much the same stuff, but a good list for reference/learning nonetheless.

Saturday, July 26, 2008

GZip testing

A nifty online test tool for GZIP compression testing, along with some sample codes and methods to enable GZIP compression for your site/pages. ;)

http://www.gidnetwork.com/tools/gzip-test.php
http://www.desilva.biz/php/zlib.html

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

On Apache, if zlib is installed, we can use just a simple code snippet to enable GZIP compression:



Really simple right?

Monday, July 07, 2008

.NET: ILMerge

For .NET developers: ILMerge takes multiple .NET assemblies and merges them into a single .NET assembly. Might come in handy sometime in the future.

[Link]

Thursday, May 29, 2008

URI / URL Parsing Using RegExp in JavaScript

Sometime back when I was writing a web crawler in JavaScript, I had to parse URIs into their constituents. And for that task I modified Flog's URI Parser class for my needs.

Well, as part of the licensing, and for sharing of information, I thought I'd post the JavaScript code here.

function UriParser(uri){
//define class (for use with prototype.js) to do URI parsing
//modified from FlogUriParser found at http://www.flog.co.nz/index.php/journal/prototype-uri-parser-class/
this._regExp = /^((\w+):\/\/\/?)?((\w+):?(\w+)?@)?([^\/\?:]+):?(\d+)?(\/?[^\?#;\|]+)?([;\|])?([^\?#]+)?\??([^#]+)?#?(\w*)/;
this.username = "";
this.password = "";
this.port = "";
this.protocol = "";
this.host = "";
this.pathname = "";
this.url = "";
this.urlparamseparator = "";
this.urlparam = "";
this.querystring = {};
this.fragment = "";
this.results = null;

this._getVal = function(r, i) {
if(!r) return null;
return (typeof(r[i]) == 'undefined' ? "" : r[i]);
};

this.parse = function(uri) {
var r = this._regExp.exec(uri);
this.results = r;
this.url = this._getVal(r,0);
this.protocol = this._getVal(r,2);
this.username = this._getVal(r,4);
this.password = this._getVal(r,5);
this.host = this._getVal(r,6);
this.port = this._getVal(r,7);
this.pathname = this._getVal(r,8);
this.urlparamseparator = this._getVal(r,9);
this.urlparam = this._getVal(r,10);
this.querystring = this._getVal(r,11);
this.fragment = this._getVal(r,12);
return r;
}

if(uri) this.parse(uri);
}

Wednesday, February 06, 2008

New project?

Will be trying to do up a simple mailing list program for use, and also for practise. Maybe I'll post up the process and the documents generated in the process, if anyone is interested in looking at how (badly) I do it this time ;P

Wednesday, August 29, 2007

EasyEclipse

For those who want to use Eclipse to program, but don't wish to be staggered by the 851785719653 plugins to select and install.

Packages include configurations for programming in Desktop Java, Server Java, Mobile Java, LAMP, PHP, Ruby on Rails, Python and C/C++.

http://www.easyeclipse.org/