Skip to main content

Posts

Simple tree control

download HTML tree controls are often bit complicated than it should be. But the above tree control is very simple. It also has some animated effect. If you have simple tree to display in your user interface this tree will be a good starting point. Basically the tree is a structured list nested in to layers. <div class="treeControl"> <ul> <li><a class="nodata" onclick="treeColapse(this)"> </a> <a class="treeNode" onclick="treeColapse(this)">lev1-one</a></li> <li><a class="minus" onclick="treeColapse(this)"> </a> <a class="treeNode" onclick="treeColapse(this)">lev1-two</a> <ul> <li><a class="nodata" onclick="treeColapse(this)"> </a> <a class="treeNode" onclick="treeColapse(this)">lev2-one</a...

Getting Flexy - Flex quick start project with Ant build script

download Flex has open up endless possibilities to web designers and developers around the world. Since Flex has been around for a while now ,there are tremendous amount of resources available on the subject. Most of these guides and tutorials are base on Flex builder. The above code is a starting point to your Flex project. It contains an Ant build file which will compile the source files to a swf file and create html wrappers for you. You have to edit the build.xml file inside the extracted "flexy" directory. This is how the project is structured. The following image will give you a guild lines to edit the build files. If you setup Ant, Flex Sdk and change the build.xml file you will be able to generate something like this.

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...