Skip to main content

Posts

Showing posts from February, 2010

Drawing a cartoon character

I am using Inkscape to draw cartoon characters. You can easily draw cartoons even if you are not a born artist. It is not necessary to draw from start to end. You can using Bezier curve tool to draw layer by layer. One in top of the other one. Finally color them. Following is scren shots I got from a drawing sequence step by step until the final art.

New Lost Season Rocks !!!!!

New Lost season started on ABC network last Tuesday. In last two seasons they introduced time travel. Now it seems they are talking about parallel universe theory. They say this is going to be there last season of the long running amazing TV show. "The aftermath from the detonation of the hydrogen bomb is revealed."

Sql queries result table column selecting javascript function

I was looking for a script which do the above. I couldn't find any. So I wrote a one. The following function takes a sql query string such as "SELECT Persons.LastName, Persons.FirstName, Orders.OrderNo FROM Persons INNER JOIN Orders ON Persons.P_Id=Orders.P_Id ORDER BY Persons.LastName SELECT AVG(OrderPrice) AS OrderAverage FROM Orders" and returns a string array containing LastName,FirstName,OrderNo. function brakeColumns(query) { var columnList = new Array(); var patten1 = /^[\w\$][\w]*/i; var patten2 = /^[\w\$][\w]*\.[\w\$][\w]*$/i; var numEnd = query.search(/\sfrom\s/i); var elems = (query.substring(6, numEnd)).split(","); for (var i = 0; i < elems.length; i++) { var elem = elems[i].toString(); elem = trim(elem); var stPoint = ""; var wanted = ""; if (elem.search(/\sas\s/i) != -1) { stPoint = elem.search(/\sas\s/i); wanted = elem.substring(stPoint + 4); w...

Legal identifier matching regex pattern

The following will match any legal identifier — an unlimited-length sequence of Unicode letters and digits, beginning with a letter, the dollar sign "$", or the underscore character /^[a-zA-Z\$_][a-zA-Z0-9]*/ The following is a example in Javascript alert(/^[a-zA-Z\$_][a-zA-Z0-9]*/.test("testVar"));

Simple way to converting html tags to display in web pages

I think every one has tried at least ones to put some html code in your blog post. I tried several ways but finally I ended up replacing special characters like " " with &lt; and &gt; Following is a solution that you can easily integrate in to your web page. Include this javascript method in your header section. function putInsidePre(txt,toPre){ var preText = document.createTextNode(txt); document.getElementById(toPre).appendChild(preText); } and put the following style class in your css or just include them in a new >style< tag. .codeStyle { background-color:#EAEFF1; border:1px solid #88BFCE; color:#325669; display:block; font-size:11px; height:200px; line-height:1.5em; overflow:auto; } Then you can create a tag and give it a id and call "putInsidePre" method to populate it. Here is a full working example. <html> <head> <style> .codeStyle { background-color:#EAEFF1; border:1px solid #88BFCE; color:#325669; display:block; font-size:1...