<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-7747719578100224044</id><updated>2012-02-16T04:40:45.221-08:00</updated><category term='regex'/><category term='jquery'/><category term='jsf 2'/><category term='assorted'/><category term='css'/><category term='javascript'/><category term='java'/><category term='php'/><category term='ajax'/><category term='windows/command shell'/><category term='htaccess'/><category term='unix/linux'/><category term='yii'/><category term='links'/><category term='wordpress'/><category term='web design'/><category term='oracle'/><title type='text'>snippet</title><subtitle type='html'>tips and tricks, examples,code snippet and links about Java, JavaScript, jquery, css, html, unix/linux, oracle, mysql, php and web designs that related to my interest</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://itakeitalltheway.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7747719578100224044/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://itakeitalltheway.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>khairil</name><uri>http://www.blogger.com/profile/03657840372834573386</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://1.bp.blogspot.com/_AP6rUce9jPQ/SiA1FHpuQKI/AAAAAAAAACc/l6bdhmwx2K4/S220/iminred1.jpg'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>64</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-7747719578100224044.post-2743203777962711762</id><published>2011-10-06T20:26:00.001-07:00</published><updated>2011-10-06T20:26:34.978-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='wordpress'/><title type='text'>the anatomy of wordpress</title><content type='html'>reference : &lt;a href="http://yoast.com/wordpress-theme-anatomy/"&gt;http://yoast.com/wordpress-theme-anatomy/&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7747719578100224044-2743203777962711762?l=itakeitalltheway.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://itakeitalltheway.blogspot.com/feeds/2743203777962711762/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://itakeitalltheway.blogspot.com/2011/10/anatomy-of-wordpress.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7747719578100224044/posts/default/2743203777962711762'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7747719578100224044/posts/default/2743203777962711762'/><link rel='alternate' type='text/html' href='http://itakeitalltheway.blogspot.com/2011/10/anatomy-of-wordpress.html' title='the anatomy of wordpress'/><author><name>khairil</name><uri>http://www.blogger.com/profile/03657840372834573386</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://1.bp.blogspot.com/_AP6rUce9jPQ/SiA1FHpuQKI/AAAAAAAAACc/l6bdhmwx2K4/S220/iminred1.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7747719578100224044.post-2721785992571242308</id><published>2011-09-29T20:36:00.000-07:00</published><updated>2011-10-04T18:47:41.903-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='assorted'/><title type='text'>svn commands to dump and load project</title><content type='html'>&lt;div&gt;&lt;div&gt;testing host&lt;/div&gt;&lt;div&gt;-------------------------------------------&lt;/div&gt;&lt;div&gt;url = http://192.168.214.31:5000/svn/&lt;/div&gt;&lt;div&gt;path = c:/repositories/&lt;/div&gt;&lt;/div&gt;&lt;div&gt;-------------------------------------------&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;//look at the latest revision number in the existing 'factory' project to be dumped &lt;/div&gt;svnlook youngest C:/repositories/factory&lt;div&gt;&lt;br /&gt;//dump 'factory' project&lt;br /&gt;svnadmin dump C:/repositories/factory &amp;gt; C:/temp/factory.dump&lt;/div&gt;&lt;div&gt;&lt;br /&gt;//create new project in the repository called 'testing321'&lt;br /&gt;svnadmin create C:/repositories/testing321&lt;/div&gt;&lt;div&gt;&lt;br /&gt;//1.load dumped project to the new project&lt;br /&gt;svnadmin load C:/repositories/testing321 &amp;lt; C:/temp/factory.dump&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;//2. load into a subdirectory , e.g. testing321 /loadhere&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;//2.1 create subdirectory called 'loadhere'&lt;/div&gt;&lt;div&gt;svn mkdir [url/path]/testing321/loadhere , e.g.&lt;/div&gt;&lt;div&gt;svn mkdir http://192.168.214.31:5000/svn/testing321/loadhere&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;//2.2 load dump file into the subdirectory 'loadhere'&lt;br /&gt;&lt;div&gt;svnadmin load c:/repositories/testing321 --parent-dir loadhere &amp;lt; c:/temp/factory.dump&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;//3.load into a subdirectory in a subdirectory, e.g. testing321/loadhere/loadnow&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;//3.1 create subdirectory 'loadnow'&lt;/div&gt;&lt;div&gt;svn mkdir [url/path]&lt;path|url&gt;/testing321/loadhere/loadnow, e.g.&lt;/path|url&gt;&lt;/div&gt;&lt;div&gt;svn mkdir http://192.168.214.31:5000/svn/testing321/loadhere/loadnow&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;//3.2 load dump file into the subdirectory 'loadnow'&lt;/div&gt;&lt;div&gt;svnadmin load c:/repositories/testing321 --parent-dir loadhere/loadnow &amp;lt; c:/temp/factory.dump&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;reference : &lt;a href="http://www.shokhirev.com/nikolai/programs/SVN/backup_load.html"&gt;http://www.shokhirev.com/nikolai/programs/SVN/backup_load.html&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;reference : &lt;a href="http://whynotwiki.com/Subversion_/_Dump_and_loading"&gt;http://whynotwiki.com/Subversion_/_Dump_and_loading&lt;/a&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7747719578100224044-2721785992571242308?l=itakeitalltheway.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://itakeitalltheway.blogspot.com/feeds/2721785992571242308/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://itakeitalltheway.blogspot.com/2011/09/svn-commands-to-dump-and-load-project.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7747719578100224044/posts/default/2721785992571242308'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7747719578100224044/posts/default/2721785992571242308'/><link rel='alternate' type='text/html' href='http://itakeitalltheway.blogspot.com/2011/09/svn-commands-to-dump-and-load-project.html' title='svn commands to dump and load project'/><author><name>khairil</name><uri>http://www.blogger.com/profile/03657840372834573386</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://1.bp.blogspot.com/_AP6rUce9jPQ/SiA1FHpuQKI/AAAAAAAAACc/l6bdhmwx2K4/S220/iminred1.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7747719578100224044.post-7343630324571704483</id><published>2011-09-20T19:36:00.000-07:00</published><updated>2011-09-20T19:37:04.072-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='java'/><title type='text'>Java how to split a string with "." (a dot)</title><content type='html'>&lt;span class="Apple-style-span" style="color: rgb(32, 64, 99); font-family: Helvetica, Arial, Verdana, 'Trebuchet MS', sans-serif; font-size: 13px; background-color: rgb(247, 240, 233); "&gt;String str = a.split("\\.")[0];&lt;/span&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: rgb(32, 64, 99); font-family: Helvetica, Arial, Verdana, 'Trebuchet MS', sans-serif; font-size: 13px; background-color: rgb(247, 240, 233); "&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: rgb(32, 64, 99); font-family: Helvetica, Arial, Verdana, 'Trebuchet MS', sans-serif; font-size: 13px; background-color: rgb(247, 240, 233); "&gt;reference :  &lt;/span&gt;&lt;a href="http://junxian-huang.blogspot.com/2009/01/java-tip-how-to-split-string-with-dot.html"&gt;http://junxian-huang.blogspot.com/2009/01/java-tip-how-to-split-string-with-dot.html&lt;/a&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7747719578100224044-7343630324571704483?l=itakeitalltheway.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://itakeitalltheway.blogspot.com/feeds/7343630324571704483/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://itakeitalltheway.blogspot.com/2011/09/java-how-to-split-string-with-dot.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7747719578100224044/posts/default/7343630324571704483'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7747719578100224044/posts/default/7343630324571704483'/><link rel='alternate' type='text/html' href='http://itakeitalltheway.blogspot.com/2011/09/java-how-to-split-string-with-dot.html' title='Java how to split a string with &quot;.&quot; (a dot)'/><author><name>khairil</name><uri>http://www.blogger.com/profile/03657840372834573386</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://1.bp.blogspot.com/_AP6rUce9jPQ/SiA1FHpuQKI/AAAAAAAAACc/l6bdhmwx2K4/S220/iminred1.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7747719578100224044.post-4648280763423196081</id><published>2011-04-06T20:09:00.000-07:00</published><updated>2011-04-06T20:11:33.075-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='htaccess'/><title type='text'>htaccess for redirection</title><content type='html'>&lt;div&gt;htaccess for redirection. so when user enter http://www.mydomain.com or http://mydomain.com it will redirect to http://www.mydomain.com/mysubfolder.&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: rgb(51, 51, 51); font-size: 13px; line-height: 20px; "&gt;Below is the .htaccess code to be put in the public_html directory.&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;RewriteEngine on&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;RewriteCond %{HTTP_HOST} ^mydomain.com$ [OR]&lt;/div&gt;&lt;div&gt;RewriteCond %{HTTP_HOST} ^www.mydomain.com$&lt;/div&gt;&lt;div&gt;RewriteRule ^/?$ "http\:\/\/www\.mydomain\.com\/mysubfolder" [R=301,L]&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7747719578100224044-4648280763423196081?l=itakeitalltheway.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://itakeitalltheway.blogspot.com/feeds/4648280763423196081/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://itakeitalltheway.blogspot.com/2011/04/htaccess-for-redirection.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7747719578100224044/posts/default/4648280763423196081'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7747719578100224044/posts/default/4648280763423196081'/><link rel='alternate' type='text/html' href='http://itakeitalltheway.blogspot.com/2011/04/htaccess-for-redirection.html' title='htaccess for redirection'/><author><name>khairil</name><uri>http://www.blogger.com/profile/03657840372834573386</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://1.bp.blogspot.com/_AP6rUce9jPQ/SiA1FHpuQKI/AAAAAAAAACc/l6bdhmwx2K4/S220/iminred1.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7747719578100224044.post-7318592766193515003</id><published>2011-04-06T19:58:00.000-07:00</published><updated>2011-04-06T20:08:42.002-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='htaccess'/><title type='text'>htaccess to display subfolder as the domain name</title><content type='html'>&lt;div&gt;inside the public_html directory, we want to use the subfolder for example named 'mysubfolder' but in the url shown as http://www.mydomain.com or http://mydomain.com instead of http://www.mydomain.com/mysubfolder. &lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Below is the .htaccess code to be put in the public_html directory.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;RewriteEngine on&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;RewriteCond %{HTTP_HOST} ^mydomain.com$ [OR]&lt;/div&gt;&lt;div&gt;RewriteCond %{HTTP_HOST} ^www.mydomain.com$&lt;/div&gt;&lt;div&gt;RewriteCond %{REQUEST_URI} !^/mysubfolder/&lt;/div&gt;&lt;div&gt;RewriteRule ^(.*)$ mysubfolder/$1 [L]&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7747719578100224044-7318592766193515003?l=itakeitalltheway.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://itakeitalltheway.blogspot.com/feeds/7318592766193515003/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://itakeitalltheway.blogspot.com/2011/04/htaccess-to-display-subfolder-as-domain.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7747719578100224044/posts/default/7318592766193515003'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7747719578100224044/posts/default/7318592766193515003'/><link rel='alternate' type='text/html' href='http://itakeitalltheway.blogspot.com/2011/04/htaccess-to-display-subfolder-as-domain.html' title='htaccess to display subfolder as the domain name'/><author><name>khairil</name><uri>http://www.blogger.com/profile/03657840372834573386</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://1.bp.blogspot.com/_AP6rUce9jPQ/SiA1FHpuQKI/AAAAAAAAACc/l6bdhmwx2K4/S220/iminred1.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7747719578100224044.post-6765109123920463979</id><published>2011-04-06T19:52:00.000-07:00</published><updated>2011-04-06T19:55:46.351-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='web design'/><title type='text'>html background generator</title><content type='html'>like this one, simple n nice: &lt;a href="http://bgpatterns.com/"&gt;http://bgpatterns.com/&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7747719578100224044-6765109123920463979?l=itakeitalltheway.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://itakeitalltheway.blogspot.com/feeds/6765109123920463979/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://itakeitalltheway.blogspot.com/2011/04/html-background-generator.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7747719578100224044/posts/default/6765109123920463979'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7747719578100224044/posts/default/6765109123920463979'/><link rel='alternate' type='text/html' href='http://itakeitalltheway.blogspot.com/2011/04/html-background-generator.html' title='html background generator'/><author><name>khairil</name><uri>http://www.blogger.com/profile/03657840372834573386</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://1.bp.blogspot.com/_AP6rUce9jPQ/SiA1FHpuQKI/AAAAAAAAACc/l6bdhmwx2K4/S220/iminred1.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7747719578100224044.post-7254394807253527898</id><published>2011-02-14T00:35:00.000-08:00</published><updated>2011-02-14T00:39:06.180-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='yii'/><title type='text'>Yii how to pass parameters from the action to the view.</title><content type='html'>reference: &lt;a href="http://www.jnieto.org/article/passing_parameters_from_the_action_to_the_view_symfony_vs_yii"&gt;http://www.jnieto.org/article/passing_parameters_from_the_action_to_the_view_symfony_vs_yii&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7747719578100224044-7254394807253527898?l=itakeitalltheway.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://itakeitalltheway.blogspot.com/feeds/7254394807253527898/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://itakeitalltheway.blogspot.com/2011/02/yii-how-to-pass-parameters-from-action.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7747719578100224044/posts/default/7254394807253527898'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7747719578100224044/posts/default/7254394807253527898'/><link rel='alternate' type='text/html' href='http://itakeitalltheway.blogspot.com/2011/02/yii-how-to-pass-parameters-from-action.html' title='Yii how to pass parameters from the action to the view.'/><author><name>khairil</name><uri>http://www.blogger.com/profile/03657840372834573386</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://1.bp.blogspot.com/_AP6rUce9jPQ/SiA1FHpuQKI/AAAAAAAAACc/l6bdhmwx2K4/S220/iminred1.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7747719578100224044.post-4363874406338895141</id><published>2011-02-08T02:53:00.001-08:00</published><updated>2011-02-08T02:57:21.221-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='oracle'/><title type='text'>Some Oracle commands</title><content type='html'>1.set the oracle xmltoollite instance (windows cmd)&lt;br /&gt;e.g. set ORACLE_SID &lt;oracle instance="" name=""&gt;&lt;br /&gt;&gt;set ORACLE_SID=xmltoollite&lt;br /&gt;&lt;br /&gt;2.login to sqplus as dba in xmltoollite instance&lt;br /&gt;&gt;sqlplus sys/mypassword as sysdba&lt;br /&gt;&lt;br /&gt;3.stop db : force shutdown&lt;br /&gt;e.g. shutdown &lt;selection immediate=""&gt;&lt;br /&gt;SQL&gt;shutdown immediate&lt;br /&gt;&lt;br /&gt;4. start db&lt;br /&gt;SQL&gt;startup&lt;br /&gt;&lt;br /&gt;5.logout from sqlplus&lt;br /&gt;SQL&gt;quit&lt;br /&gt;&lt;br /&gt;check connectivity (windows cmd)&lt;br /&gt;--------------------------------&lt;br /&gt;e.g. tnsping &lt;name in="" the="" ora=""&gt;&lt;br /&gt;&gt;tnsping XMLTOOL_&lt;br /&gt;&lt;br /&gt;listener (windows cmd)&lt;br /&gt;---------------------&lt;br /&gt;e.g. lsnrctl &lt;action&gt; &lt;listener name=""&gt;&lt;br /&gt;&lt;br /&gt;1. see services attached to this listener&lt;br /&gt;&gt;lsnrctl services LISTENER&lt;br /&gt;&lt;br /&gt;2. see status of services attached to this listener&lt;br /&gt;&gt;lsnrctl status LISTENER&lt;br /&gt;&lt;br /&gt;3. start the listener&lt;br /&gt;&gt;lsnrctl start LISTENER&lt;br /&gt;&lt;br /&gt;4.stop the listener&lt;br /&gt;&gt;lsnrctl stop LISTENER&lt;br /&gt;&lt;br /&gt;how to setup multiple listeners&lt;br /&gt;-------------------------------&lt;br /&gt;&lt;a href="http://blogs.sun.com/rtsai/entry/how_to_configure_multiple_oracle"&gt;http://blogs.sun.com/rtsai/entry/how_to_configure_multiple_oracle&lt;/a&gt;&lt;/listener&gt;&lt;/action&gt;&lt;/name&gt;&lt;/selection&gt;&lt;/oracle&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7747719578100224044-4363874406338895141?l=itakeitalltheway.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://itakeitalltheway.blogspot.com/feeds/4363874406338895141/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://itakeitalltheway.blogspot.com/2011/02/some-oracle-commands.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7747719578100224044/posts/default/4363874406338895141'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7747719578100224044/posts/default/4363874406338895141'/><link rel='alternate' type='text/html' href='http://itakeitalltheway.blogspot.com/2011/02/some-oracle-commands.html' title='Some Oracle commands'/><author><name>khairil</name><uri>http://www.blogger.com/profile/03657840372834573386</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://1.bp.blogspot.com/_AP6rUce9jPQ/SiA1FHpuQKI/AAAAAAAAACc/l6bdhmwx2K4/S220/iminred1.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7747719578100224044.post-4930982086652028315</id><published>2011-01-23T17:41:00.001-08:00</published><updated>2011-01-23T17:42:06.306-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='web design'/><title type='text'>learn the basics of design</title><content type='html'>&lt;a href="http://lifehacker.com/5739492/learn-the-basics-of-design-this-weekend?skyline=true&amp;s=i"&gt;http://lifehacker.com/5739492/learn-the-basics-of-design-this-weekend?skyline=true&amp;s=i&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7747719578100224044-4930982086652028315?l=itakeitalltheway.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://itakeitalltheway.blogspot.com/feeds/4930982086652028315/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://itakeitalltheway.blogspot.com/2011/01/learn-basics-of-design.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7747719578100224044/posts/default/4930982086652028315'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7747719578100224044/posts/default/4930982086652028315'/><link rel='alternate' type='text/html' href='http://itakeitalltheway.blogspot.com/2011/01/learn-basics-of-design.html' title='learn the basics of design'/><author><name>khairil</name><uri>http://www.blogger.com/profile/03657840372834573386</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://1.bp.blogspot.com/_AP6rUce9jPQ/SiA1FHpuQKI/AAAAAAAAACc/l6bdhmwx2K4/S220/iminred1.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7747719578100224044.post-7283770133749228702</id><published>2011-01-18T01:14:00.000-08:00</published><updated>2011-01-18T01:15:52.207-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='web design'/><title type='text'>30 stunning web design portfolio</title><content type='html'>&lt;a href="http://devsnippets.com/article/30-out-of-the-box-and-new-portfolio-designs.html"&gt;http://devsnippets.com/article/30-out-of-the-box-and-new-portfolio-designs.html&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7747719578100224044-7283770133749228702?l=itakeitalltheway.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://itakeitalltheway.blogspot.com/feeds/7283770133749228702/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://itakeitalltheway.blogspot.com/2011/01/30-stunning-web-design-portfolio.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7747719578100224044/posts/default/7283770133749228702'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7747719578100224044/posts/default/7283770133749228702'/><link rel='alternate' type='text/html' href='http://itakeitalltheway.blogspot.com/2011/01/30-stunning-web-design-portfolio.html' title='30 stunning web design portfolio'/><author><name>khairil</name><uri>http://www.blogger.com/profile/03657840372834573386</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://1.bp.blogspot.com/_AP6rUce9jPQ/SiA1FHpuQKI/AAAAAAAAACc/l6bdhmwx2K4/S220/iminred1.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7747719578100224044.post-734559001368302737</id><published>2011-01-18T00:29:00.000-08:00</published><updated>2011-01-18T00:30:34.691-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='web design'/><title type='text'>web layout guidelines</title><content type='html'>&lt;a href="http://www.smashingmagazine.com/2010/02/18/50-css-and-javascript-techniques-for-layouts-forms-and-visual-effects/"&gt;http://www.smashingmagazine.com/2010/02/18/50-css-and-javascript-techniques-for-layouts-forms-and-visual-effects/&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7747719578100224044-734559001368302737?l=itakeitalltheway.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://itakeitalltheway.blogspot.com/feeds/734559001368302737/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://itakeitalltheway.blogspot.com/2011/01/web-layout-guidelines.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7747719578100224044/posts/default/734559001368302737'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7747719578100224044/posts/default/734559001368302737'/><link rel='alternate' type='text/html' href='http://itakeitalltheway.blogspot.com/2011/01/web-layout-guidelines.html' title='web layout guidelines'/><author><name>khairil</name><uri>http://www.blogger.com/profile/03657840372834573386</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://1.bp.blogspot.com/_AP6rUce9jPQ/SiA1FHpuQKI/AAAAAAAAACc/l6bdhmwx2K4/S220/iminred1.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7747719578100224044.post-7029022610278584582</id><published>2011-01-17T01:43:00.001-08:00</published><updated>2011-01-17T01:43:42.668-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='web design'/><category scheme='http://www.blogger.com/atom/ns#' term='links'/><title type='text'>guidelines for responsive web design</title><content type='html'>&lt;a href="http://www.smashingmagazine.com/2011/01/12/guidelines-for-responsive-web-design/"&gt;http://www.smashingmagazine.com/2011/01/12/guidelines-for-responsive-web-design/&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7747719578100224044-7029022610278584582?l=itakeitalltheway.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://itakeitalltheway.blogspot.com/feeds/7029022610278584582/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://itakeitalltheway.blogspot.com/2011/01/guidelines-for-responsive-web-design.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7747719578100224044/posts/default/7029022610278584582'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7747719578100224044/posts/default/7029022610278584582'/><link rel='alternate' type='text/html' href='http://itakeitalltheway.blogspot.com/2011/01/guidelines-for-responsive-web-design.html' title='guidelines for responsive web design'/><author><name>khairil</name><uri>http://www.blogger.com/profile/03657840372834573386</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://1.bp.blogspot.com/_AP6rUce9jPQ/SiA1FHpuQKI/AAAAAAAAACc/l6bdhmwx2K4/S220/iminred1.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7747719578100224044.post-7995612174799588559</id><published>2010-12-20T20:33:00.000-08:00</published><updated>2011-01-07T13:28:02.719-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='yii'/><category scheme='http://www.blogger.com/atom/ns#' term='php'/><title type='text'>Connect Yii SwiftMailer to gmail server</title><content type='html'>Based on &lt;a href="http://www.yiiframework.com/extension/mail/"&gt;this&lt;/a&gt; extension.&lt;br /&gt;&lt;br /&gt;1. extract and copy the yii-mail folder to the protected/extensions folder.&lt;br /&gt;2. add mail thingy in main.php at protected/config :&lt;br /&gt;&lt;pre name="code" class="php"&gt;&lt;br /&gt;// autoloading model and component classes&lt;br /&gt;...&lt;br /&gt;'import'=&gt;array(&lt;br /&gt;    ..&lt;br /&gt;    ..&lt;br /&gt;   'ext.yii-mail.YiiMailMessage',&lt;br /&gt;),&lt;br /&gt;...&lt;br /&gt;'components'=&gt;array(&lt;br /&gt; ...&lt;br /&gt; ...&lt;br /&gt; 'mail' =&gt; array(&lt;br /&gt;  'class' =&gt; 'ext.yii-mail.YiiMail',&lt;br /&gt;  'transportType' =&gt; 'smtp', // change to 'php' when running in real domain.&lt;br /&gt;  'viewPath' =&gt; 'application.views.mail',&lt;br /&gt;  'logging' =&gt; true,&lt;br /&gt;  'dryRun' =&gt; false,&lt;br /&gt;  'transportOptions' =&gt; array(&lt;br /&gt;   'host' =&gt; 'smtp.gmail.com',&lt;br /&gt;   'username' =&gt; 'test@gmail.com',&lt;br /&gt;   'password' =&gt; 'test',&lt;br /&gt;   'port' =&gt; '465',&lt;br /&gt;   'encryption' =&gt; 'tls',&lt;br /&gt;  ),&lt;br /&gt; ),&lt;br /&gt;),&lt;br /&gt;...&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;3. enable &lt;a href="http://au2.php.net/fsockopen"&gt;OpenSSL&lt;/a&gt; in php configuration.&lt;br /&gt;4. run the example code in your view file:&lt;br /&gt;&lt;pre name="code" class="php"&gt;&lt;br /&gt; $message = new YiiMailMessage;&lt;br /&gt; $message-&gt;setBody('Message content here with HTML', 'text/html');&lt;br /&gt; $message-&gt;subject = 'My Subject';&lt;br /&gt; $message-&gt;addTo('test@gmail.com');&lt;br /&gt; $message-&gt;from = Yii::app()-&gt;params['adminEmail'];&lt;br /&gt; Yii::app()-&gt;mail-&gt;send($message);&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;this should send an email to test@gmail.com.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7747719578100224044-7995612174799588559?l=itakeitalltheway.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://itakeitalltheway.blogspot.com/feeds/7995612174799588559/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://itakeitalltheway.blogspot.com/2010/12/connect-yii-swiftmailer-to-gmail-server.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7747719578100224044/posts/default/7995612174799588559'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7747719578100224044/posts/default/7995612174799588559'/><link rel='alternate' type='text/html' href='http://itakeitalltheway.blogspot.com/2010/12/connect-yii-swiftmailer-to-gmail-server.html' title='Connect Yii SwiftMailer to gmail server'/><author><name>khairil</name><uri>http://www.blogger.com/profile/03657840372834573386</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://1.bp.blogspot.com/_AP6rUce9jPQ/SiA1FHpuQKI/AAAAAAAAACc/l6bdhmwx2K4/S220/iminred1.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7747719578100224044.post-3173409961847974181</id><published>2010-12-15T01:58:00.000-08:00</published><updated>2010-12-15T02:02:16.034-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='oracle'/><title type='text'>TNS-12519: TNS:no appropriate service handler found in Oracle10g XE</title><content type='html'>this is a bug on how OracleXE monitors processes.&lt;br /&gt;&lt;br /&gt;database didn't register with the listener and that the processes parameter needed to be increased. So do the following two things to fix this issue:&lt;br /&gt;&lt;br /&gt;SQL&gt; alter system set processes=500 scope=spfile;&lt;br /&gt;&lt;br /&gt;SQL&gt; alter system register;&lt;br /&gt;&lt;br /&gt;reference:&lt;br /&gt;&lt;br /&gt;1.&lt;a href="http://www.franklinfaces.com/Topic107-55-1.aspx"&gt;http://www.franklinfaces.com/Topic107-55-1.aspx&lt;/a&gt;&lt;br /&gt;2.&lt;a href="http://en.newinstance.it/2007/06/01/ora-12519-tnsno-appropriate-service-handler-found/"&gt;http://en.newinstance.it/2007/06/01/ora-12519-tnsno-appropriate-service-handler-found/&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7747719578100224044-3173409961847974181?l=itakeitalltheway.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://itakeitalltheway.blogspot.com/feeds/3173409961847974181/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://itakeitalltheway.blogspot.com/2010/12/tns-12519-tnsno-appropriate-service.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7747719578100224044/posts/default/3173409961847974181'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7747719578100224044/posts/default/3173409961847974181'/><link rel='alternate' type='text/html' href='http://itakeitalltheway.blogspot.com/2010/12/tns-12519-tnsno-appropriate-service.html' title='TNS-12519: TNS:no appropriate service handler found in Oracle10g XE'/><author><name>khairil</name><uri>http://www.blogger.com/profile/03657840372834573386</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://1.bp.blogspot.com/_AP6rUce9jPQ/SiA1FHpuQKI/AAAAAAAAACc/l6bdhmwx2K4/S220/iminred1.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7747719578100224044.post-6897393813849556432</id><published>2010-12-14T17:54:00.000-08:00</published><updated>2010-12-14T17:57:53.595-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='javascript'/><category scheme='http://www.blogger.com/atom/ns#' term='php'/><category scheme='http://www.blogger.com/atom/ns#' term='links'/><title type='text'>JavaScript for PHP</title><content type='html'>a nice article about similarities between javascript n php in their codes.&lt;br /&gt;&lt;a href="http://phpadvent.org/2010/javascript-for-php-developers-by-stoyan-stefanov"&gt;http://phpadvent.org/2010/javascript-for-php-developers-by-stoyan-stefanov&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7747719578100224044-6897393813849556432?l=itakeitalltheway.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://itakeitalltheway.blogspot.com/feeds/6897393813849556432/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://itakeitalltheway.blogspot.com/2010/12/javascript-for-php.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7747719578100224044/posts/default/6897393813849556432'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7747719578100224044/posts/default/6897393813849556432'/><link rel='alternate' type='text/html' href='http://itakeitalltheway.blogspot.com/2010/12/javascript-for-php.html' title='JavaScript for PHP'/><author><name>khairil</name><uri>http://www.blogger.com/profile/03657840372834573386</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://1.bp.blogspot.com/_AP6rUce9jPQ/SiA1FHpuQKI/AAAAAAAAACc/l6bdhmwx2K4/S220/iminred1.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7747719578100224044.post-4473087567262234016</id><published>2010-12-09T01:43:00.000-08:00</published><updated>2010-12-15T02:07:30.238-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='oracle'/><title type='text'>enable remote access to Oracle10g XE</title><content type='html'>by default remote access is not enabled for XE version. So we can only access db in our localhost. To enable remote access, connect as 'sysdba' or 'system' and enter command below:&lt;br /&gt;&lt;br /&gt;EXEC DBMS_XDB.SETLISTENERLOCALACCESS(FALSE);&lt;br /&gt;&lt;br /&gt;reference: &lt;a href="http://www.randomsupport.com/rs/blogs/index.php?title=oracle-10g-express-web-interface-remote-&amp;more=1&amp;c=1&amp;tb=1&amp;pb=1"&gt;http://www.randomsupport.com/rs/blogs/index.php?title=oracle-10g-express-web-interface-remote-&amp;more=1&amp;c=1&amp;tb=1&amp;pb=1&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7747719578100224044-4473087567262234016?l=itakeitalltheway.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://itakeitalltheway.blogspot.com/feeds/4473087567262234016/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://itakeitalltheway.blogspot.com/2010/12/enable-remote-access-to-oracle10g-xe.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7747719578100224044/posts/default/4473087567262234016'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7747719578100224044/posts/default/4473087567262234016'/><link rel='alternate' type='text/html' href='http://itakeitalltheway.blogspot.com/2010/12/enable-remote-access-to-oracle10g-xe.html' title='enable remote access to Oracle10g XE'/><author><name>khairil</name><uri>http://www.blogger.com/profile/03657840372834573386</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://1.bp.blogspot.com/_AP6rUce9jPQ/SiA1FHpuQKI/AAAAAAAAACc/l6bdhmwx2K4/S220/iminred1.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7747719578100224044.post-1367225033326919412</id><published>2010-11-27T18:37:00.000-08:00</published><updated>2010-12-14T17:58:13.254-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='web design'/><category scheme='http://www.blogger.com/atom/ns#' term='links'/><title type='text'>50 beautiful portfolio design</title><content type='html'>&lt;a href="http://www.smashingmagazine.com/2008/11/26/50-beautiful-and-creative-portfolio-designs/"&gt;http://www.smashingmagazine.com/2008/11/26/50-beautiful-and-creative-portfolio-designs/&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7747719578100224044-1367225033326919412?l=itakeitalltheway.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://itakeitalltheway.blogspot.com/feeds/1367225033326919412/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://itakeitalltheway.blogspot.com/2010/11/50-beautiful-portfolio-design.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7747719578100224044/posts/default/1367225033326919412'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7747719578100224044/posts/default/1367225033326919412'/><link rel='alternate' type='text/html' href='http://itakeitalltheway.blogspot.com/2010/11/50-beautiful-portfolio-design.html' title='50 beautiful portfolio design'/><author><name>khairil</name><uri>http://www.blogger.com/profile/03657840372834573386</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://1.bp.blogspot.com/_AP6rUce9jPQ/SiA1FHpuQKI/AAAAAAAAACc/l6bdhmwx2K4/S220/iminred1.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7747719578100224044.post-682077263110393600</id><published>2010-11-13T22:41:00.000-08:00</published><updated>2010-11-13T23:20:04.839-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='links'/><title type='text'>Links from drop.io</title><content type='html'>1.&lt;a target="_blank" href="http://www.mrforbes.com/blog/2009/01/a-quick-code-igniter-and-jquery-ajax-tutorial/"&gt;a-quick-code-igniter-and-jquery-ajax-tutorial&lt;/a&gt;&lt;br /&gt;2.&lt;a target="_blank" href="http://www.smashingmagazine.com/2010/06/07/the-principles-of-cross-browser-css-coding/"&gt;the-principles-of-cross-browser-css-coding&lt;/a&gt;&lt;br /&gt;3.&lt;a target="_blank" href="https://developer.mozilla.org/en/a_re-introduction_to_javascript"&gt;re-introduction to javascript&lt;/a&gt;&lt;br /&gt;4.&lt;a target="_blank" href="http://snook.ca/archives/html_and_css/six_keys_to_understanding_css_layouts/"&gt;six_keys_to_understanding_css_layouts&lt;/a&gt;&lt;br /&gt;5.&lt;a target="_blank" href="http://www.subcide.com/articles/creating-a-css-layout-from-scratch/P1/"&gt;creating-a-css-layout-from-scratch&lt;/a&gt;&lt;br /&gt;6.&lt;a target="_blank" href="http://www.ibm.com/developerworks/java/library/j-jsf2fu1/"&gt;JSF 2 Streamline Web application development&lt;/a&gt;&lt;br /&gt;7.&lt;a target="_blank" href="http://www.ibm.com/developerworks/java/library/j-jsf2fu2/"&gt;JSF 2 Templating and composite components&lt;/a&gt;&lt;br /&gt;8.&lt;a target="_blank" href="http://www.ibm.com/developerworks/java/library/j-jsf2fu3/"&gt;Part 3: Event handling, JavaScript, and Ajax&lt;/a&gt;&lt;br /&gt;9.&lt;a target="_blank" href="http://mkblog.exadel.com/2009/08/learning-jsf2-managed-beans/"&gt;learning-jsf2-managed-beans&lt;/a&gt;&lt;br /&gt;10.&lt;a target="_blank" href="http://www.laliluna.de/articles/jsf-2-evaluation-test.html"&gt;jsf-2-evaluation-test.html&lt;/a&gt;&lt;br /&gt;11.&lt;a target="_blank" href="http://cameotutorials.blogspot.com/2010/03/beginning-java-ee-6-tutorial-part-3.html"&gt;java authentication with jsf 2 and j2ee6&lt;/a&gt;&lt;br /&gt;12.&lt;a target="_blank" href="http://html5boilerplate.com/"&gt;html5boilerplate.com&lt;/a&gt;&lt;br /&gt;13.&lt;a target="_blank" href="http://www.laliluna.de/articles/log4j-tutorial.html"&gt;Log4J Tutorial&lt;/a&gt;&lt;br /&gt;14.&lt;a target="_blank" href="http://www.laliluna.de/articles/javaserver-faces-message-resource-bundle-tutorial.html"&gt;(JSF) - Message Resources&lt;/a&gt; &lt;br /&gt;15.&lt;a target="_blank" href="http://www.mkyong.com/regular-expressions/how-to-validate-email-address-with-regular-expression/"&gt;How to validate email address with regular expression&lt;/a&gt;&lt;br /&gt;16.&lt;a target="_blank" href="http://www.laliluna.de/articles/first-hibernate-example-tutorial.html"&gt;Hibernate Tutorial&lt;/a&gt;&lt;br /&gt;17.&lt;a target="_blank" href="http://www.databasesandlife.com/automatic-reconnect-from-hibernate-to-mysql/"&gt;Automatic reconnect from Hibernate to MySQL&lt;/a&gt;&lt;br /&gt;18.&lt;a target="_blank" href="http://cephas.net/blog/2004/04/14/hibernate-communication-link-failure-javaioioexception/"&gt;Hibernate: Communication link failure: java.io.IOException&lt;/a&gt;&lt;br /&gt;19.&lt;a target="_blank" href="http://stevesouders.com/efws/"&gt;Even Faster Web Site&lt;/a&gt;&lt;br /&gt;20.&lt;a target="_blank" href="http://community.jboss.org/wiki/Sessionsandtransactions"&gt;Hibernate Session&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7747719578100224044-682077263110393600?l=itakeitalltheway.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://itakeitalltheway.blogspot.com/feeds/682077263110393600/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://itakeitalltheway.blogspot.com/2010/11/links-from-dropio.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7747719578100224044/posts/default/682077263110393600'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7747719578100224044/posts/default/682077263110393600'/><link rel='alternate' type='text/html' href='http://itakeitalltheway.blogspot.com/2010/11/links-from-dropio.html' title='Links from drop.io'/><author><name>khairil</name><uri>http://www.blogger.com/profile/03657840372834573386</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://1.bp.blogspot.com/_AP6rUce9jPQ/SiA1FHpuQKI/AAAAAAAAACc/l6bdhmwx2K4/S220/iminred1.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7747719578100224044.post-6131574884224244396</id><published>2010-11-04T05:49:00.000-07:00</published><updated>2010-11-04T10:59:16.952-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='jsf 2'/><title type='text'>JSF 2 : Detect Browser type using EL Expression</title><content type='html'>In facelet, we can get the browser information via EL expression like this :&lt;br /&gt;&lt;pre name="code" class="xhtml"&gt;&lt;br /&gt;#{request.getHeader('User-Agent')}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;by using jstl function &lt;span style="font-weight:bold;"&gt;containsIgnoreCase&lt;/span&gt;, we can check for specific browser.&lt;br /&gt;&lt;br /&gt;For example, if we want to load specific css file for IE6, this will work :&lt;br /&gt;&lt;pre name="code" class="xhtml"&gt;&lt;br /&gt;&lt;h:outputStylesheet library="css" name="style-IE6.css" rendered="#{fn:containsIgnoreCase(request.getHeader('User-Agent'), 'MSIE 6.0')}"&gt;&lt;/h:outputStylesheet&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;add xmlns:fn="http://java.sun.com/jsp/jstl/functions" to the &amp;lt;html&amp;gt; to use jstl functions.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7747719578100224044-6131574884224244396?l=itakeitalltheway.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://itakeitalltheway.blogspot.com/feeds/6131574884224244396/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://itakeitalltheway.blogspot.com/2010/11/jsf-2-detect-browser-type-using-el.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7747719578100224044/posts/default/6131574884224244396'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7747719578100224044/posts/default/6131574884224244396'/><link rel='alternate' type='text/html' href='http://itakeitalltheway.blogspot.com/2010/11/jsf-2-detect-browser-type-using-el.html' title='JSF 2 : Detect Browser type using EL Expression'/><author><name>khairil</name><uri>http://www.blogger.com/profile/03657840372834573386</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://1.bp.blogspot.com/_AP6rUce9jPQ/SiA1FHpuQKI/AAAAAAAAACc/l6bdhmwx2K4/S220/iminred1.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7747719578100224044.post-4868756661246835208</id><published>2010-10-31T09:00:00.000-07:00</published><updated>2010-10-31T09:04:41.052-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='javascript'/><title type='text'>load javascript asynchronously using managedXHR</title><content type='html'>A nice explanation by Steve Souders at &lt;a href="http://www.youtube.com/watch?v=52gL93S3usU"&gt;youtube.com/watch?v=52gL93S3usU&lt;/a&gt; mainly on loading JavaScript asynchronously.&lt;br /&gt;&lt;br /&gt;We can try out each technique by referring to this &lt;a href="http://stevesouders.com/efws/couple-normal.php"&gt;page&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;One of the common issue is the undefined error due to dependency between JavaScript files when scripts loaded asynchronously. For example when using jquery plugins, the core jquery file, followed by the plugins files and lastly the inline scripts for function initialization must be loaded in consecutive manner. One of the technique to solve this issue is by using managed XHR(assume all files are from the same domain). &lt;br /&gt;&lt;br /&gt;Below are the snippets:&lt;br /&gt;&lt;br /&gt;1.Put this snippet at the bottom of the page as inline code.&lt;br /&gt;&lt;pre name="code" class="js"&gt;&lt;br /&gt;if ( "undefined" == typeof(ManagedXHR) || !ManagedXHR ) {&lt;br /&gt; var ManagedXHR = {};&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;ManagedXHR.Script = {&lt;br /&gt; queuedScripts: [],&lt;br /&gt;&lt;br /&gt; loadScriptXhrInjection: function(url, onload, bOrder) {&lt;br /&gt;  var iQueue = ManagedXHR.Script.queuedScripts.length;&lt;br /&gt;  if ( bOrder ) {&lt;br /&gt;   var qScript = { response: null, onload: onload, done: false };&lt;br /&gt;   ManagedXHR.Script.queuedScripts[iQueue] = qScript;&lt;br /&gt;  }&lt;br /&gt;&lt;br /&gt;  var xhrObj = ManagedXHR.Script.getXHRObject();&lt;br /&gt;  xhrObj.onreadystatechange = function() { &lt;br /&gt;   if ( xhrObj.readyState == 4 ) {&lt;br /&gt;    if ( bOrder ) {&lt;br /&gt;     ManagedXHR.Script.queuedScripts[iQueue].response = xhrObj.responseText;&lt;br /&gt;     ManagedXHR.Script.injectScripts();&lt;br /&gt;    }&lt;br /&gt;    else {&lt;br /&gt;     var se = document.createElement('script');&lt;br /&gt;     document.getElementsByTagName('head')[0].appendChild(se);&lt;br /&gt;     se.text = xhrObj.responseText;&lt;br /&gt;     if ( onload ) {&lt;br /&gt;      onload();&lt;br /&gt;     }&lt;br /&gt;    }&lt;br /&gt;   }&lt;br /&gt;  };&lt;br /&gt;  xhrObj.open('GET', url, true);&lt;br /&gt;  xhrObj.send('');&lt;br /&gt; },&lt;br /&gt;&lt;br /&gt; injectScripts: function() {&lt;br /&gt;  var len = ManagedXHR.Script.queuedScripts.length;&lt;br /&gt;  for ( var i = 0; i &lt; len; i++ ) {&lt;br /&gt;   var qScript = ManagedXHR.Script.queuedScripts[i];&lt;br /&gt;   if ( ! qScript.done ) {&lt;br /&gt;    if ( ! qScript.response ) {&lt;br /&gt;     // STOP! need to wait for this response&lt;br /&gt;     break;&lt;br /&gt;    }&lt;br /&gt;    else {&lt;br /&gt;     var se = document.createElement('script');&lt;br /&gt;     document.getElementsByTagName('head')[0].appendChild(se);&lt;br /&gt;     se.text = qScript.response;&lt;br /&gt;     if ( qScript.onload ) {&lt;br /&gt;      qScript.onload();&lt;br /&gt;     }&lt;br /&gt;     qScript.done = true;&lt;br /&gt;    }&lt;br /&gt;   }&lt;br /&gt;  }&lt;br /&gt; },&lt;br /&gt;&lt;br /&gt; getXHRObject: function() {&lt;br /&gt;  var xhrObj = false;&lt;br /&gt;  try {&lt;br /&gt;   xhrObj = new XMLHttpRequest();&lt;br /&gt;  }&lt;br /&gt;  catch(e){&lt;br /&gt;   var aTypes = ["Msxml2.XMLHTTP.6.0", &lt;br /&gt;        "Msxml2.XMLHTTP.3.0", &lt;br /&gt;        "Msxml2.XMLHTTP", &lt;br /&gt;        "Microsoft.XMLHTTP"];&lt;br /&gt;   var len = aTypes.length;&lt;br /&gt;   for ( var i=0; i &lt; len; i++ ) {&lt;br /&gt;    try {&lt;br /&gt;     xhrObj = new ActiveXObject(aTypes[i]);&lt;br /&gt;    }&lt;br /&gt;    catch(e) {&lt;br /&gt;     continue;&lt;br /&gt;    }&lt;br /&gt;    break;&lt;br /&gt;   }&lt;br /&gt;  }&lt;br /&gt;  finally {&lt;br /&gt;   return xhrObj;&lt;br /&gt;  }&lt;br /&gt; }&lt;br /&gt;};&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;2.Call our external JavaScript files like this:&lt;br /&gt;&lt;pre name="code" class="html"&gt;&lt;br /&gt;     &lt;script type="text/javascript"&gt;&lt;br /&gt;      ManagedXHR.Script.loadScriptXhrInjection("jquery.min.js", null, true);&lt;br /&gt;      ManagedXHR.Script.loadScriptXhrInjection("jquery-ui.min.js", null, true);&lt;br /&gt;      ManagedXHR.Script.loadScriptXhrInjection("jquery.tablesorter.js", null, true);&lt;br /&gt;      ManagedXHR.Script.loadScriptXhrInjection("init.js", null, true);&lt;br /&gt;     &lt;/script&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Inside the init.js, we can call the initialization codes. By using this technique all external files can be loaded asynchronously and at the same time it preserves the order the code execution. &lt;br /&gt;&lt;br /&gt;We can use &lt;a href="http://www.httpwatch.com/download/"&gt;httpWatch&lt;/a&gt; to see the difference.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7747719578100224044-4868756661246835208?l=itakeitalltheway.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://itakeitalltheway.blogspot.com/feeds/4868756661246835208/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://itakeitalltheway.blogspot.com/2010/10/load-javascript-asynchronously-using.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7747719578100224044/posts/default/4868756661246835208'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7747719578100224044/posts/default/4868756661246835208'/><link rel='alternate' type='text/html' href='http://itakeitalltheway.blogspot.com/2010/10/load-javascript-asynchronously-using.html' title='load javascript asynchronously using managedXHR'/><author><name>khairil</name><uri>http://www.blogger.com/profile/03657840372834573386</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://1.bp.blogspot.com/_AP6rUce9jPQ/SiA1FHpuQKI/AAAAAAAAACc/l6bdhmwx2K4/S220/iminred1.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7747719578100224044.post-9072327583143398146</id><published>2010-10-30T11:09:00.000-07:00</published><updated>2010-11-04T11:00:44.846-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='jsf 2'/><title type='text'>JSF 2 Autocomplete</title><content type='html'>This is done based on this &lt;a href="http://www.ibm.com/developerworks/java/library/j-jsf2fu-0410/index.html"&gt;tutorial&lt;/a&gt;, but was modified according to some requirements:&lt;br /&gt;&lt;br /&gt;1. The completion items should only be displayed when more than a character is typed in the input box.&lt;br /&gt;2. When a completion item selected based on its label, the corresponding ID is fetched and attached to a property of a managed bean.&lt;br /&gt;3. The list of completion items are dynamic and fetched from live connection from database(2nd level cache implemented).&lt;br /&gt;4. Autocomplete should be accessible by using keyboard keys(tab key,up/down keys for selections, and enter key when an item selected), and mouse event definitely.&lt;br /&gt;5. Autocomplete is force selection.&lt;br /&gt;6. Not using Prototype for javascript functions.&lt;br /&gt;&lt;br /&gt;Below are the snippets:&lt;br /&gt;AutocompleteListener.java - the general utilities for autocomplete process.&lt;br /&gt;&lt;pre name="code" class="java"&gt;&lt;br /&gt;import java.util.ArrayList;&lt;br /&gt;import java.util.Map;&lt;br /&gt;import javax.faces.component.UIInput;&lt;br /&gt;import javax.faces.component.UISelectItems;&lt;br /&gt;import javax.faces.component.UISelectOne;&lt;br /&gt;import javax.faces.context.FacesContext;&lt;br /&gt;import javax.faces.event.ValueChangeEvent;&lt;br /&gt;import javax.faces.model.SelectItem;&lt;br /&gt;&lt;br /&gt;public class AutocompleteListener {&lt;br /&gt;    &lt;br /&gt; /**&lt;br /&gt;  * set new item list in the list box when user type keyword in the input box.&lt;br /&gt;  * @param e auto complete event when value changed.&lt;br /&gt;  * @param newItems new item list populated from the database.&lt;br /&gt;  * @return new item list.&lt;br /&gt;  */&lt;br /&gt; public static ArrayList&lt;SelectItem&gt; valueChanged(ValueChangeEvent e, ArrayList&lt;SelectItem&gt; newItems) {&lt;br /&gt;  UIInput input = (UIInput)e.getSource();&lt;br /&gt;  UISelectOne listbox = (UISelectOne)input.findComponent("listbox");&lt;br /&gt;  if (listbox != null) {&lt;br /&gt;   UISelectItems items = (UISelectItems)listbox.getChildren().get(0);&lt;br /&gt;   Map&lt;String, Object&gt; attrs = listbox.getAttributes();&lt;br /&gt;   items.setValue(newItems);&lt;br /&gt;   setListboxStyle(newItems.size(), attrs);&lt;br /&gt;   listbox.setValue(null);&lt;br /&gt;  }&lt;br /&gt;  return newItems;&lt;br /&gt; }&lt;br /&gt;&lt;br /&gt; /**&lt;br /&gt;  * get keyword entered by the user.&lt;br /&gt;  * @return keyword entered by the user.&lt;br /&gt;  */&lt;br /&gt; public static String getKeyword() {&lt;br /&gt;  Map&lt;String, String&gt; reqParams = FacesContext.getCurrentInstance().getExternalContext().getRequestParameterMap();&lt;br /&gt;  return reqParams.get("keyword");&lt;br /&gt; }&lt;br /&gt;    &lt;br /&gt; /**&lt;br /&gt;  * set the selected value from list box to the input box.&lt;br /&gt;  * @param e auto complete event when value changed.&lt;br /&gt;  */&lt;br /&gt; public static void completionItemSelected(ValueChangeEvent e) {&lt;br /&gt;  UISelectOne listbox = (UISelectOne)e.getSource();&lt;br /&gt;  if(listbox.getValue() != null) {&lt;br /&gt;   UIInput input = (UIInput)listbox.findComponent("input");&lt;br /&gt;   UIInput selectedValue = (UIInput)listbox.findComponent("selectedValue");&lt;br /&gt;&lt;br /&gt;   if(input != null) {&lt;br /&gt;    UISelectItems items = (UISelectItems)listbox.getChildren().get(0);&lt;br /&gt;    @SuppressWarnings("unchecked")&lt;br /&gt;    ArrayList&lt;SelectItem&gt; selectItemsGroup = (ArrayList&lt;SelectItem&gt;)items.getValue();&lt;br /&gt;    for(SelectItem item : selectItemsGroup) {&lt;br /&gt;     if(item.getValue().toString().equalsIgnoreCase(listbox.getValue().toString())) {&lt;br /&gt;      input.setValue(item.getLabel());&lt;br /&gt;      break;&lt;br /&gt;     }&lt;br /&gt;    }&lt;br /&gt;    selectedValue.setValue(listbox.getValue());&lt;br /&gt;   } else {&lt;br /&gt;    selectedValue.setValue(null);&lt;br /&gt;   }&lt;br /&gt;&lt;br /&gt;   Map&lt;String, Object&gt; attrs = listbox.getAttributes();&lt;br /&gt;   attrs.put("style", "display:none;");&lt;br /&gt;  }&lt;br /&gt; }&lt;br /&gt;    &lt;br /&gt; /**&lt;br /&gt;  * set the position of the list box.&lt;br /&gt;  * @param rows row of the list box.&lt;br /&gt;  * @param attrs attribute object of the listbox.&lt;br /&gt;  */&lt;br /&gt; private static void setListboxStyle(int rows, Map&lt;String, Object&gt; attrs) {&lt;br /&gt;  if (rows &gt; 0) {&lt;br /&gt;   Map&lt;String, String&gt; reqParams = FacesContext.getCurrentInstance()&lt;br /&gt;   .getExternalContext().getRequestParameterMap();&lt;br /&gt;&lt;br /&gt;   attrs.put("style", "display: inline; position: absolute; left: "&lt;br /&gt;     + reqParams.get("x") + "px;" + " top: " + reqParams.get("y") + "px");&lt;br /&gt;&lt;br /&gt;   // avoid only one row (selection of single row is not a change event)&lt;br /&gt;   attrs.put("size", rows == 1 ? 2 : rows); &lt;br /&gt;  } else {&lt;br /&gt;   attrs.put("style", "display: none;");&lt;br /&gt;  }&lt;br /&gt; }&lt;br /&gt;}&lt;br /&gt;/*&lt;br /&gt;&lt;/string,&gt;&lt;/string,&gt;&lt;/string,&gt;&lt;/selectitem&gt;&lt;/selectitem&gt;&lt;/string,&gt;&lt;/string,&gt;&lt;/selectitem&gt;&lt;/selectitem&gt;&lt;br /&gt;*/&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;AutoCompleteBean.java - the managed bean for action and model of the autocomplete.&lt;br /&gt;&lt;pre name="code" class="java"&gt;&lt;br /&gt;import java.io.Serializable;&lt;br /&gt;import java.sql.Timestamp;&lt;br /&gt;import java.util.ArrayList;&lt;br /&gt;import java.util.Iterator;&lt;br /&gt;import javax.faces.application.FacesMessage;&lt;br /&gt;import javax.faces.bean.ManagedBean;&lt;br /&gt;import javax.faces.bean.ViewScoped;&lt;br /&gt;import javax.faces.context.FacesContext;&lt;br /&gt;import javax.faces.event.ValueChangeEvent;&lt;br /&gt;import javax.faces.model.SelectItem;&lt;br /&gt;import org.apache.log4j.Logger;&lt;br /&gt;import org.hibernate.Session;&lt;br /&gt;import com.factory.interfaces.AutoCompleteEvent;&lt;br /&gt;import com.factory.ui.utility.AutocompleteListener;&lt;br /&gt;import com.factory.utility.HibernateUtil;&lt;br /&gt;&lt;br /&gt;@ManagedBean(name="autoCompleteBean")&lt;br /&gt;@ViewScoped&lt;br /&gt;public class AutoCompleteBean implements Serializable, AutoCompleteEvent {&lt;br /&gt;&lt;br /&gt; private static Logger log = Logger.getLogger(AutoCompleteBean.class);&lt;br /&gt; private static final long serialVersionUID = 4972782275998653789L;&lt;br /&gt;    &lt;br /&gt; private Integer id;&lt;br /&gt; private String name;&lt;br /&gt; private ArrayList&lt;SelectItem&gt; selectionList;&lt;br /&gt; &lt;br /&gt; public ArrayList&lt;SelectItem&gt; getSelectionList() {&lt;br /&gt;  return selectionList;&lt;br /&gt; }&lt;br /&gt; &lt;br /&gt; public void setSelectionList(ArrayList&lt;SelectItem&gt; selectionList) {&lt;br /&gt;  this.selectionList = selectionList;&lt;br /&gt; }&lt;br /&gt; &lt;br /&gt; public Integer getId() {&lt;br /&gt;  return id;&lt;br /&gt; }&lt;br /&gt;&lt;br /&gt; public void setId(Integer id) {&lt;br /&gt;  this.id = id;&lt;br /&gt; }&lt;br /&gt;&lt;br /&gt; public String getName() {&lt;br /&gt;  return name;&lt;br /&gt; }&lt;br /&gt;&lt;br /&gt; public void setName(String name) {&lt;br /&gt;  this.name = name;&lt;br /&gt; }&lt;br /&gt;&lt;br /&gt; /**&lt;br /&gt;  * re-new autocomplete list in the list box when user type keyword in the input box.&lt;br /&gt;  * @param event auto complete event when value changed.&lt;br /&gt;  */&lt;br /&gt; @SuppressWarnings("rawtypes")&lt;br /&gt; @Override&lt;br /&gt; public void valueChanged(ValueChangeEvent event) {&lt;br /&gt;  try {&lt;br /&gt;   ArrayList&lt;SelectItem&gt; completionItems = new ArrayList&lt;SelectItem&gt;();&lt;br /&gt;   String keyword = AutocompleteListener.getKeyword();&lt;br /&gt;   if(keyword != null) {&lt;br /&gt;    // this is where we get the updated values dynamically from the database and store them in the selectItem list.&lt;br /&gt;    Session session = HibernateUtil.getCurrentSession();&lt;br /&gt;    CompanyDAO companyDAO = new CompanyDAO();&lt;br /&gt;    Company company = null;&lt;br /&gt;    Iterator itr = companyDAO.findByKeyword(session, keyword).iterator(); &lt;br /&gt;    while(itr.hasNext()) {&lt;br /&gt;     company = (Company) itr.next();&lt;br /&gt;     completionItems.add(new SelectItem(company.getId(), company.getName()));&lt;br /&gt;    }&lt;br /&gt;   }&lt;br /&gt;   setSelectionList(AutocompleteListener.valueChanged(event, completionItems));&lt;br /&gt;  } catch(Exception e) {&lt;br /&gt;   FacesContext.getCurrentInstance().addMessage(null, &lt;br /&gt;     new FacesMessage(FacesMessage.SEVERITY_ERROR, "An error has occurred.", null));&lt;br /&gt;   setSelectionList(new ArrayList&lt;SelectItem&gt;());&lt;br /&gt;  }&lt;br /&gt; }&lt;br /&gt;    &lt;br /&gt; /**&lt;br /&gt;  * set the selected value from list box to the input box. &lt;br /&gt;  * @param event auto complete event when value changed.&lt;br /&gt;  */&lt;br /&gt; @Override&lt;br /&gt; public void completionItemSelected(ValueChangeEvent event) { &lt;br /&gt;  AutocompleteListener.completionItemSelected(event);&lt;br /&gt; }&lt;br /&gt;}&lt;br /&gt;/*&lt;br /&gt;&lt;/selectitem&gt;&lt;/selectitem&gt;&lt;/selectitem&gt;&lt;/selectitem&gt;&lt;/selectitem&gt;&lt;/selectitem&gt;&lt;br /&gt;*/&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;AutoCompleteEvent.java - an interface so that we can have different implementations for different managed beans in setting and getting the autocompletion list.&lt;br /&gt;&lt;pre name="code" class="java"&gt;&lt;br /&gt;import javax.faces.event.ValueChangeEvent;&lt;br /&gt;&lt;br /&gt;public interface AutoCompleteEvent {&lt;br /&gt; /**&lt;br /&gt;  * re-new items in the list box when user type keyword in the input box.&lt;br /&gt;  * @param event auto complete event when value changed.&lt;br /&gt;  */&lt;br /&gt; public void valueChanged(ValueChangeEvent e);&lt;br /&gt; &lt;br /&gt; /**&lt;br /&gt;  * set the selected value from list box to the input box.&lt;br /&gt;  * @param event auto complete event when value changed.&lt;br /&gt;  */&lt;br /&gt; public void completionItemSelected(ValueChangeEvent e);&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;testing_autocomplete.xhtml - facelet for viewing the autocomplete function. Add attribute xmlns:util="http://java.sun.com/jsf/composite/util" to the &amp;lt;html&amp;gt; element to use composite component.&lt;br /&gt;&lt;pre name="code" class="xhtml"&gt;&lt;br /&gt;...&lt;br /&gt;&lt;h:head&gt;&lt;br /&gt; &lt;h:outputStylesheet library="css" name="auto-complete.css"&gt;&lt;br /&gt; &lt;/h:outputStylesheet&gt;&lt;br /&gt;&lt;/h:head&gt;&lt;br /&gt;&lt;h:body&gt;&lt;br /&gt; &lt;h:form prependId="false"&gt;&lt;br /&gt;    &lt;util:autoComplete inputTextValue="#{autoCompleteBean.name}" inputTextSelectedValue="#{autoCompleteBean.id}" listBoxItems="#{autoCompleteBean.selectionList}" inputTextStyle="width:184px;" listBoxStyleClass="auto-complete-selectbox" inputTextValueChangeListener="#{autoCompleteBean.valueChanged}" listBoxValueChangeListener="#{autoCompleteBean.completionItemSelected}"&gt;&lt;br /&gt;  &lt;/util:autoComplete&gt;&lt;br /&gt; &lt;/h:form&gt;&lt;br /&gt; &lt;h:outputScript library="javascript" name="auto-complete.js"&gt;&lt;br /&gt; &lt;/h:outputScript&gt;&lt;br /&gt;&lt;/h:body&gt;&lt;br /&gt;...&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;autoComplete.xhtml - reusable autocomplete component. We save this file under WebContent/resources/util folder(in Eclipse).&lt;br /&gt;&lt;pre name="code" class="xhtml"&gt;&lt;br /&gt;&lt;ui:composition xmlns="http://www.w3.org/1999/xhtml"&lt;br /&gt;    xmlns:ui="http://java.sun.com/jsf/facelets"&lt;br /&gt;    xmlns:f="http://java.sun.com/jsf/core"&lt;br /&gt;    xmlns:h="http://java.sun.com/jsf/html"    &lt;br /&gt;    xmlns:composite="http://java.sun.com/jsf/composite"&gt;&lt;br /&gt;    &lt;br /&gt;    &lt;!-- INTERFACE --&gt; &lt;br /&gt;    &lt;composite:interface&gt;&lt;br /&gt;&lt;composite:attribute name="inputTextValue" required="true"&gt;&lt;/composite:attribute&gt;                      &lt;br /&gt;    &lt;composite:attribute name="listBoxItems" required="true"&gt;&lt;/composite:attribute&gt;&lt;br /&gt;&lt;composite:attribute name="inputTextValueChangeListener" method-signature="java.lang.String valueChanged(javax.faces.event.ValueChangeEvent)" required="true"&gt;&lt;br /&gt;      &lt;/composite:attribute&gt;&lt;br /&gt;      &lt;composite:attribute name="listBoxValueChangeListener" method-signature="java.lang.String completionItemSelected(javax.faces.event.ValueChangeEvent)" required="true"&gt;&lt;br /&gt;      &lt;/composite:attribute&gt;&lt;br /&gt;      &lt;composite:attribute name="inputTextSelectedValue"&gt;&lt;/composite:attribute&gt;&lt;br /&gt;      &lt;composite:attribute name="required"&gt;&lt;/composite:attribute&gt;&lt;br /&gt;      &lt;composite:attribute name="requiredMessage"&gt;&lt;/composite:attribute&gt;&lt;br /&gt;      &lt;composite:attribute name="inputTextStyle"&gt;&lt;/composite:attribute&gt;&lt;br /&gt;      &lt;composite:attribute name="inputTextStyleClass"&gt;&lt;/composite:attribute&gt;&lt;br /&gt;      &lt;composite:attribute name="listBoxStyleClass"/&gt;&lt;/composite:attribute&gt;   &lt;br /&gt;    &lt;/composite:interface&gt; &lt;br /&gt;&lt;br /&gt;    &lt;!-- IMPLEMENTATION --&gt;          &lt;br /&gt;    &lt;composite:implementation&gt;&lt;br /&gt;      &lt;h:inputHidden id="selectedValue" value="#{cc.attrs.inputTextSelectedValue}"&gt;&lt;br /&gt;      &lt;/h:inputHidden&gt;&lt;br /&gt;      &lt;h:inputText id="input" value="#{cc.attrs.inputTextValue}" valueChangeListener="#{cc.attrs.inputTextValueChangeListener}" onkeyup="com.autocomplete.updateCompletionItems(this, event)" onblur="com.autocomplete.resetInputValue(this);" onfocus="com.autocomplete.getInputValue(this);" autocomplete="off" required="#{cc.attrs.required}" requiredMessage="#{cc.attrs.requiredMessage}" style="#{cc.attrs.inputTextStyle}" styleClass="#{cc.attrs.inputTextStyleClass}"&gt;&lt;/h:inputText&gt;&lt;br /&gt;      &lt;h:graphicImage id="autocomplete_loading" url="/public/image/loading_small.gif" style="visibility:hidden;"&gt;&lt;br /&gt;      &lt;/h:graphicImage&gt;&lt;br /&gt;      &lt;br /&gt;      &lt;h:selectOneListbox id="listbox" style="display:none;" valueChangeListener="#{cc.attrs.listBoxValueChangeListener}" onclick="com.autocomplete.inputLostFocus(this);" onkeyup="com.autocomplete.submitEnter(this, event);" onfocus="com.autocomplete.getInputValue(this);" onblur="com.autocomplete.resetInputValue(this);" styleClass="#{cc.attrs.listBoxStyleClass}" immediate="true"&gt;&lt;br /&gt;          &lt;f:selectItems value="#{cc.attrs.listBoxItems}"&gt;&lt;br /&gt;          &lt;/f:selectItems&gt;&lt;br /&gt;          &lt;f:ajax render="input selectedValue"&gt;&lt;br /&gt;          &lt;/f:ajax&gt;       &lt;br /&gt;      &lt;/h:selectOneListbox&gt;&lt;br /&gt;    &lt;/composite:implementation&gt;    &lt;br /&gt;&lt;/ui:composition&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;auto-complete.js - client script for accessing events in autocomplete. This is done using Object Literal style. We save this file under WebContent/resources/javascript folder(in Eclipse).&lt;br /&gt;&lt;pre name="code" class="js"&gt;&lt;br /&gt;if ( ! com) var com = {};&lt;br /&gt;if (!com.autocomplete) {&lt;br /&gt; var inputText;&lt;br /&gt; var tempInput;&lt;br /&gt; com.autocomplete = {   &lt;br /&gt;   errorHandler: function(data) { &lt;br /&gt;  //alert("Error occurred during Ajax call: " + data.description) ;&lt;br /&gt; },&lt;br /&gt;&lt;br /&gt; updateCompletionItems: function(input, event) {&lt;br /&gt;  if(inputText == document.getElementById(com.autocomplete.getId(input,':input')).value &amp;&amp; &lt;br /&gt;    document.getElementById(com.autocomplete.getId(input,':selectedValue')).value != "") {&lt;br /&gt;   return;&lt;br /&gt;  }&lt;br /&gt;  function getOffset(obj) {&lt;br /&gt;   var curleft = 0;&lt;br /&gt;   var curtop = 0;&lt;br /&gt;   if (obj.offsetParent) {&lt;br /&gt;    do {&lt;br /&gt;     curleft += obj.offsetLeft;&lt;br /&gt;     curtop += obj.offsetTop;&lt;br /&gt;    } while (obj = obj.offsetParent);&lt;br /&gt;   }&lt;br /&gt;   return [curleft,curtop];&lt;br /&gt;  }&lt;br /&gt;  document.getElementById(com.autocomplete.getId(input,':autocomplete_loading')).style.visibility = 'visible';&lt;br /&gt;  jsf.ajax.addOnError(com.autocomplete.errorHandler);&lt;br /&gt;  var objOffset = getOffset(input);&lt;br /&gt;  document.getElementById(com.autocomplete.getId(input,':selectedValue')).value = "";&lt;br /&gt;  jsf.ajax.request(input, event, { &lt;br /&gt;   render:  com.autocomplete.getId(input,':listbox'),&lt;br /&gt;   onevent: com.autocomplete.updateListBoxCallBack,&lt;br /&gt;   keyword: document.getElementById(com.autocomplete.getId(input,':input')).value,&lt;br /&gt;   x: objOffset[0],&lt;br /&gt;   y: objOffset[1] + input.offsetHeight &lt;br /&gt;    });&lt;br /&gt;  tempInput = input;&lt;br /&gt; },&lt;br /&gt;&lt;br /&gt; updateListBoxCallBack: function(e) {&lt;br /&gt;  if(e.status == "success") {&lt;br /&gt;   document.getElementById(com.autocomplete.getId(tempInput,':autocomplete_loading')).style.visibility = 'hidden';&lt;br /&gt;   if(document.getElementById(com.autocomplete.getId(tempInput,':input')).value == "") {&lt;br /&gt;    document.getElementById(com.autocomplete.getId(tempInput,':listbox')).style.display = 'none';&lt;br /&gt;   }&lt;br /&gt;  }&lt;br /&gt; },&lt;br /&gt;&lt;br /&gt; inputLostFocus: function(input) { &lt;br /&gt;  document.getElementById(com.autocomplete.getId(input,':listbox')).style.display = 'none';&lt;br /&gt;  document.getElementById(com.autocomplete.getId(input,':input')).focus();&lt;br /&gt;  &lt;br /&gt; },&lt;br /&gt;&lt;br /&gt; getId: function(input, id) {&lt;br /&gt;  var clientId = new String(input.name);&lt;br /&gt;  var lastIndex = clientId.lastIndexOf(':');&lt;br /&gt;  return clientId.substring(0, lastIndex) + id;&lt;br /&gt;&lt;br /&gt; },&lt;br /&gt;&lt;br /&gt; submitEnter: function(obj, e) {&lt;br /&gt;  var keycode;&lt;br /&gt;  if (window.event) keycode = window.event.keyCode; //IE&lt;br /&gt;  else if (e) keycode = e.which;  //Mozilla&lt;br /&gt;  else return true;&lt;br /&gt;  if (keycode == 13) {&lt;br /&gt;   com.autocomplete.inputLostFocus(obj);&lt;br /&gt;   return false;&lt;br /&gt;  } else {&lt;br /&gt;   return true;&lt;br /&gt;  }&lt;br /&gt; },&lt;br /&gt; &lt;br /&gt; resetInputValue: function(input) {&lt;br /&gt;  if(document.getElementById(com.autocomplete.getId(input,':selectedValue')).value == "") {&lt;br /&gt;   inputText = document.getElementById(com.autocomplete.getId(input,':input')).value;&lt;br /&gt;   document.getElementById(com.autocomplete.getId(input,':input')).value = "";&lt;br /&gt;  }&lt;br /&gt; },&lt;br /&gt;&lt;br /&gt; getInputValue: function(input) {&lt;br /&gt;  if(document.getElementById(com.autocomplete.getId(input,':selectedValue')).value != "") {&lt;br /&gt;   inputText = document.getElementById(com.autocomplete.getId(input,':input')).value;&lt;br /&gt;  }&lt;br /&gt;  document.getElementById(com.autocomplete.getId(input,':input')).value = "undefined" == typeof(inputText) ? &lt;br /&gt;    document.getElementById(com.autocomplete.getId(input,':input')).value : inputText;&lt;br /&gt; }&lt;br /&gt; };&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;auto-complete.css : decoration for the list box. We save this file under WebContent/resources/css folder(in Eclipse).&lt;br /&gt;&lt;pre name="code" class="css"&gt;&lt;br /&gt;.auto-complete-selectbox {&lt;br /&gt;   border: 1px solid #BBBBBB;&lt;br /&gt;   padding: 1px;&lt;br /&gt;   background-color: #F8F8F8;&lt;br /&gt;   overflow: auto;&lt;br /&gt;   height: 80px;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;.auto-complete-selectbox select{&lt;br /&gt;   border:none;&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;the auto-complete.js and the auto-complete.css can be put inside the composite component autoComplete.xhtml to make it a truly independent component, but for performance wise, they are put in the testing_autcomplete.xhtml so that css will be loaded at the top of the page and javascript at the bottom of the page.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7747719578100224044-9072327583143398146?l=itakeitalltheway.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://itakeitalltheway.blogspot.com/feeds/9072327583143398146/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://itakeitalltheway.blogspot.com/2010/10/jsf-2-autocomplete.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7747719578100224044/posts/default/9072327583143398146'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7747719578100224044/posts/default/9072327583143398146'/><link rel='alternate' type='text/html' href='http://itakeitalltheway.blogspot.com/2010/10/jsf-2-autocomplete.html' title='JSF 2 Autocomplete'/><author><name>khairil</name><uri>http://www.blogger.com/profile/03657840372834573386</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://1.bp.blogspot.com/_AP6rUce9jPQ/SiA1FHpuQKI/AAAAAAAAACc/l6bdhmwx2K4/S220/iminred1.jpg'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7747719578100224044.post-7301506416515599549</id><published>2010-10-17T08:58:00.000-07:00</published><updated>2010-12-07T17:54:26.523-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='jsf 2'/><title type='text'>JSF 2 Pass enum value as parameter</title><content type='html'>Taken from &lt;a href="http://stackoverflow.com/questions/3916871/passing-a-enum-value-as-a-parameter-from-jsf"&gt;http://stackoverflow.com/questions/3916871/passing-a-enum-value-as-a-parameter-from-jsf&lt;/a&gt; .&lt;br /&gt;In short :&lt;br /&gt;&lt;pre name="code" class="java"&gt;&lt;br /&gt;//this is your enum&lt;br /&gt;public enum Type {&lt;br /&gt;    PROFILE_COMMENT,&lt;br /&gt;    GROUP_COMMENT&lt;br /&gt;} &lt;br /&gt;//this is your managed bean&lt;br /&gt;@ManagedBean&lt;br /&gt;@SessionScoped&lt;br /&gt;public class myBean {&lt;br /&gt;    private Type type;&lt;br /&gt;    // getter and setter&lt;br /&gt;    public void Test(Type t){&lt;br /&gt;        System.out.println(t);&lt;br /&gt;    }&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt; In facelet, we pass the enum as string:&lt;br /&gt;&lt;pre name="code" class="html"&gt;&lt;br /&gt;&lt;h:commandButton value="Test" action="#{myBean.Test('PROFILE_COMMENT')}" /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;add this to the faces-config.xml so that enum conversion can be handled by jsf&lt;br /&gt;&lt;pre name="code" class="xml"&gt;&lt;br /&gt;&lt;converter&gt;&lt;br /&gt;   &lt;converter-for-class&gt;java.lang.Enum&lt;/converter-for-class&gt;&lt;br /&gt;   &lt;converter-class&gt;javax.faces.convert.EnumConverter&lt;/converter-class&gt;&lt;br /&gt;&lt;/converter&gt;&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7747719578100224044-7301506416515599549?l=itakeitalltheway.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://itakeitalltheway.blogspot.com/feeds/7301506416515599549/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://itakeitalltheway.blogspot.com/2010/10/jsf-2-pass-enum-value-as-parameter.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7747719578100224044/posts/default/7301506416515599549'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7747719578100224044/posts/default/7301506416515599549'/><link rel='alternate' type='text/html' href='http://itakeitalltheway.blogspot.com/2010/10/jsf-2-pass-enum-value-as-parameter.html' title='JSF 2 Pass enum value as parameter'/><author><name>khairil</name><uri>http://www.blogger.com/profile/03657840372834573386</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://1.bp.blogspot.com/_AP6rUce9jPQ/SiA1FHpuQKI/AAAAAAAAACc/l6bdhmwx2K4/S220/iminred1.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7747719578100224044.post-4763853282517281741</id><published>2010-10-16T18:52:00.000-07:00</published><updated>2010-10-30T13:22:19.982-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='jsf 2'/><title type='text'>Get selected row  in h:dataTable via DataModel</title><content type='html'>This is taken from Balusc answer at &lt;a href="http://stackoverflow.com/questions/3951263/jsf-command-button-inside-a-jsf-data-table"&gt;http://stackoverflow.com/questions/3951263/jsf-command-button-inside-a-jsf-data-table&lt;/a&gt; .&lt;br /&gt;In short, in the managed bean:&lt;br /&gt;&lt;pre name="code" class="java"&gt;&lt;br /&gt;@ManagedBean&lt;br /&gt;@ViewScoped&lt;br /&gt;public class UserManager {&lt;br /&gt;    private List&lt;Doctor&gt; doctors;&lt;br /&gt;    private DataModel&lt;Doctor&gt; doctorModel;&lt;br /&gt;&lt;br /&gt;    @PostConstruct&lt;br /&gt;    public void init() {&lt;br /&gt;        doctors = getItSomehow();&lt;br /&gt;        datamodel = new ListDataModel&lt;Doctor&gt;(doctors);&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;    public void getSpecificDoctor() {&lt;br /&gt;        Doctor selectedDoctor = doctorModel.getRowData();&lt;br /&gt;        //do the logic here&lt;br /&gt;    }&lt;br /&gt;}&lt;br /&gt;/*&lt;br /&gt;&lt;/doctor&gt;&lt;/doctor&gt;&lt;/doctor&gt;&lt;br /&gt;*/&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;In the facelet:&lt;br /&gt;&lt;pre name="code" class="html"&gt;&lt;br /&gt;&lt;h:dataTable value="#{userManager.doctorModel}" var="doc"&gt;&lt;br /&gt;   &lt;h:commandButton action="#{userManager.getSpecificDoctor}" value="get this" /&gt;&lt;br /&gt;&lt;/h:dataTable&gt;&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7747719578100224044-4763853282517281741?l=itakeitalltheway.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://itakeitalltheway.blogspot.com/feeds/4763853282517281741/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://itakeitalltheway.blogspot.com/2010/10/get-selected-row-in-hdatatable-via.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7747719578100224044/posts/default/4763853282517281741'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7747719578100224044/posts/default/4763853282517281741'/><link rel='alternate' type='text/html' href='http://itakeitalltheway.blogspot.com/2010/10/get-selected-row-in-hdatatable-via.html' title='Get selected row  in h:dataTable via DataModel'/><author><name>khairil</name><uri>http://www.blogger.com/profile/03657840372834573386</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://1.bp.blogspot.com/_AP6rUce9jPQ/SiA1FHpuQKI/AAAAAAAAACc/l6bdhmwx2K4/S220/iminred1.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7747719578100224044.post-454672764420702990</id><published>2010-10-16T10:03:00.000-07:00</published><updated>2010-10-16T10:58:17.926-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='jsf 2'/><title type='text'>JSF 2 : How to pass parameter</title><content type='html'>The answers in this link at&lt;br /&gt;&lt;a href="http://stackoverflow.com/questions/3599948/jsf2-action-parameter"&gt;http://stackoverflow.com/questions/3599948/jsf2-action-parameter&lt;/a&gt; describes techniques to pass parameter in JSF 2.&lt;br /&gt;&lt;br /&gt;In Short, the common ways are:&lt;br /&gt;1. via action method:&lt;br /&gt;&lt;pre name="code" class="html"&gt;&lt;br /&gt;&lt;h:commandbutton action="#{bean.action('my param')}"&gt;&lt;br /&gt;&lt;/h:commandbutton&gt;&lt;/pre&gt;So in the managed bean our method would be like this:&lt;br /&gt;public String action(String parameter) {}&lt;br /&gt;&lt;br /&gt;2.via f:param :&lt;br /&gt;&lt;pre name="code" class="html"&gt;&lt;br /&gt;&lt;h:commandbutton action="#{bean.action}"&gt;&lt;br /&gt;   &lt;f:param name="foo" value="bar"&gt;&lt;/f:param&gt;&lt;br /&gt;&lt;/h:commandbutton&gt;&lt;/pre&gt;In the managed bean, we can get the parameter value like this:&lt;br /&gt;&lt;pre name="code" class="java"&gt;&lt;br /&gt;@ManagedProperty("#{param.foo}")&lt;br /&gt;private String foo;&lt;br /&gt;&lt;/pre&gt;or this:&lt;br /&gt;&lt;pre name="code" class="java"&gt;&lt;br /&gt;String foo = FacesContext.getCurrentInstance().getExternalContext().getRequestParameterMap().get("foo");&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7747719578100224044-454672764420702990?l=itakeitalltheway.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://itakeitalltheway.blogspot.com/feeds/454672764420702990/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://itakeitalltheway.blogspot.com/2010/10/jsf-2-how-to-pass-parameter.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7747719578100224044/posts/default/454672764420702990'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7747719578100224044/posts/default/454672764420702990'/><link rel='alternate' type='text/html' href='http://itakeitalltheway.blogspot.com/2010/10/jsf-2-how-to-pass-parameter.html' title='JSF 2 : How to pass parameter'/><author><name>khairil</name><uri>http://www.blogger.com/profile/03657840372834573386</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://1.bp.blogspot.com/_AP6rUce9jPQ/SiA1FHpuQKI/AAAAAAAAACc/l6bdhmwx2K4/S220/iminred1.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7747719578100224044.post-5239093602394276326</id><published>2010-10-10T19:05:00.000-07:00</published><updated>2010-10-17T08:45:57.398-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='javascript'/><title type='text'>good and bad writing habit in Javascript</title><content type='html'>This link at &lt;br /&gt;&lt;a href="http://enterprisejquery.com/2010/10/how-good-c-habits-can-encourage-bad-javascript-habits-part-1/"&gt;http://enterprisejquery.com/2010/10/how-good-c-habits-can-encourage-bad-javascript-habits-part-1/&lt;/a&gt; explains about the use of Object Literal and Self-Executing Anonymous Function.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7747719578100224044-5239093602394276326?l=itakeitalltheway.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://itakeitalltheway.blogspot.com/feeds/5239093602394276326/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://itakeitalltheway.blogspot.com/2010/10/good-and-bad-writing-habit-in.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7747719578100224044/posts/default/5239093602394276326'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7747719578100224044/posts/default/5239093602394276326'/><link rel='alternate' type='text/html' href='http://itakeitalltheway.blogspot.com/2010/10/good-and-bad-writing-habit-in.html' title='good and bad writing habit in Javascript'/><author><name>khairil</name><uri>http://www.blogger.com/profile/03657840372834573386</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://1.bp.blogspot.com/_AP6rUce9jPQ/SiA1FHpuQKI/AAAAAAAAACc/l6bdhmwx2K4/S220/iminred1.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7747719578100224044.post-1050759419107423466</id><published>2010-10-05T01:19:00.000-07:00</published><updated>2010-10-29T22:14:25.113-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='jsf 2'/><category scheme='http://www.blogger.com/atom/ns#' term='jquery'/><title type='text'>Issue with JSF and Jquery Id</title><content type='html'>When we use JSF ,by default any elements inside h:form will be appended with the form id like myform:myid when it's rendered as plain html.&lt;br /&gt;jquery has trouble to identify this id with ':' as for example $("#myform:myid").html("this doesn't work.") will not work. Hence we need to add prependId=false in the h:form. &lt;br /&gt;&lt;pre name="code" class="html"&gt;&lt;br /&gt;&lt;h:form id="myform" prependId="false"&gt;&lt;br /&gt;...&lt;br /&gt;&lt;h:outputText id="myid" styleClass="myclass" value="#{myBean.id}"&gt;&lt;/h:outputText&gt;&lt;br /&gt;&lt;/h:form&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Now we can use jquery function like normal:&lt;br /&gt;$("#myid").html("this works.");&lt;br /&gt;&lt;br /&gt;Alternatively, if we do not want to add prependId to the h:form, we can use other jquery selectors such as class selector like $(".myclass").html("this will work as well."); .&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7747719578100224044-1050759419107423466?l=itakeitalltheway.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://itakeitalltheway.blogspot.com/feeds/1050759419107423466/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://itakeitalltheway.blogspot.com/2010/10/issue-with-jsf-and-jquery-id.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7747719578100224044/posts/default/1050759419107423466'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7747719578100224044/posts/default/1050759419107423466'/><link rel='alternate' type='text/html' href='http://itakeitalltheway.blogspot.com/2010/10/issue-with-jsf-and-jquery-id.html' title='Issue with JSF and Jquery Id'/><author><name>khairil</name><uri>http://www.blogger.com/profile/03657840372834573386</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://1.bp.blogspot.com/_AP6rUce9jPQ/SiA1FHpuQKI/AAAAAAAAACc/l6bdhmwx2K4/S220/iminred1.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7747719578100224044.post-1083686235105723862</id><published>2010-10-05T00:57:00.000-07:00</published><updated>2010-10-16T19:26:01.574-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='jsf 2'/><title type='text'>Rerender specific areas using ajax f:ajax in ui:repeat</title><content type='html'>below is an example how to rerender specific areas using ajax f:ajax in ui:repeat:&lt;br /&gt;&lt;pre name="code" class="html"&gt;&lt;br /&gt;&lt;h:form id="myform"&gt;&lt;br /&gt; &lt;ul&gt;&lt;br /&gt;  &lt;ui:repeat var="item" value="#{myBean.sectionList}"&gt;&lt;br /&gt;     &lt;li&gt;&lt;br /&gt;        &lt;h:commandLink value="#{item.name}"&gt;&lt;br /&gt;           &lt;f:ajax listener="#{myBean.getDetail}" render=":myform:myid :myform:myaddress" /&gt;&lt;br /&gt;        &lt;/h:commandLink&gt;&lt;br /&gt;   &lt;/li&gt;&lt;br /&gt;  &lt;/ui:repeat&gt;&lt;br /&gt; &lt;/ul&gt;&lt;br /&gt; &lt;h:outputText id="myid" value="#{myBean.id}"&gt;&lt;/h:outputText&gt;&lt;br /&gt; &lt;h:inputTextarea id="myaddress" value="#{myBean.address}"&gt;&lt;/h:inputTextarea&gt;&lt;br /&gt;&lt;/h:form&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;In this example we just want to rerender specific elements.So,&lt;br /&gt;&lt;br /&gt;render=":myform:myid :myform:myaddress" - these are the areas where we want to rerender after callback. Two areas will be re-rendered are elements with id=myid and id=myaddress , using a space as separator.&lt;br /&gt;&lt;br /&gt;We need to append parent id :myform in the render attribute of f:ajax, else f:ajax will give warning render area cannot be found.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7747719578100224044-1083686235105723862?l=itakeitalltheway.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://itakeitalltheway.blogspot.com/feeds/1083686235105723862/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://itakeitalltheway.blogspot.com/2010/10/rerender-specific-areas-using-ajax.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7747719578100224044/posts/default/1083686235105723862'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7747719578100224044/posts/default/1083686235105723862'/><link rel='alternate' type='text/html' href='http://itakeitalltheway.blogspot.com/2010/10/rerender-specific-areas-using-ajax.html' title='Rerender specific areas using ajax f:ajax in ui:repeat'/><author><name>khairil</name><uri>http://www.blogger.com/profile/03657840372834573386</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://1.bp.blogspot.com/_AP6rUce9jPQ/SiA1FHpuQKI/AAAAAAAAACc/l6bdhmwx2K4/S220/iminred1.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7747719578100224044.post-2426652612851275721</id><published>2010-09-26T23:38:00.000-07:00</published><updated>2010-09-27T01:58:48.162-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='javascript'/><title type='text'>Javascript: How to fix stopped animated gif after submit a form in IE</title><content type='html'>There is a known limitation in IE where the animated gif will stop animate after submit a form. This would give a problem to us if we have a situation where we want to show a loading image while waiting for the process to complete and it's non-ajax.&lt;br /&gt;&lt;br /&gt;Below is the solution and it works in IE, FF and Chrome:&lt;br /&gt;javascript:&lt;br /&gt;&lt;pre name="code" class="js"&gt;&lt;br /&gt;function showIndicator() {&lt;br /&gt;   var pb = document.getElementById("loading_image");&lt;br /&gt;   pb.innerHTML = '&lt;img src="http://www.blogger.com/loading.gif" /&gt;';&lt;br /&gt;   pb.style.display = '';&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;html:&lt;br /&gt;&lt;pre name="code" class="html"&gt;&lt;br /&gt;&lt;div id="loading_image" style="text-align:center;margin-top:-25%;margin right:5%;display:none;"&gt;&lt;/div&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;source : &lt;a href="http://stackoverflow.com/questions/780560/animated-gif-in-ie-stopping"&gt;http://stackoverflow.com/questions/780560/animated-gif-in-ie-stopping&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7747719578100224044-2426652612851275721?l=itakeitalltheway.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://itakeitalltheway.blogspot.com/feeds/2426652612851275721/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://itakeitalltheway.blogspot.com/2010/09/javascript-how-to-fix-stopped-animated.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7747719578100224044/posts/default/2426652612851275721'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7747719578100224044/posts/default/2426652612851275721'/><link rel='alternate' type='text/html' href='http://itakeitalltheway.blogspot.com/2010/09/javascript-how-to-fix-stopped-animated.html' title='Javascript: How to fix stopped animated gif after submit a form in IE'/><author><name>khairil</name><uri>http://www.blogger.com/profile/03657840372834573386</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://1.bp.blogspot.com/_AP6rUce9jPQ/SiA1FHpuQKI/AAAAAAAAACc/l6bdhmwx2K4/S220/iminred1.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7747719578100224044.post-2680341254850398865</id><published>2010-09-21T21:37:00.000-07:00</published><updated>2010-09-21T21:51:45.200-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='assorted'/><title type='text'>My favorite shortcuts in Eclipse</title><content type='html'>Below are the shortcuts that I like to use in Eclipse while doing my project.&lt;br /&gt;&lt;br /&gt;ctrl + shift + r --&gt; to search for specific file name within my projects.  &lt;br /&gt;ctrl + f : to search for specific words or when I want to replace certain words.&lt;br /&gt;ctrl + h --&gt; file search : searching for specific words that reside in any files within my project.&lt;br /&gt;ctrl + i : to easily fix indentation in my code&lt;br /&gt;ctrl + / : to easily comment certain lines of codes&lt;br /&gt;right click --&gt; source : all the functions that make jobs easy such as generate element comment,generate getter setter,generate constructor etc.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7747719578100224044-2680341254850398865?l=itakeitalltheway.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://itakeitalltheway.blogspot.com/feeds/2680341254850398865/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://itakeitalltheway.blogspot.com/2010/09/my-favorite-shortcut-in-eclipse.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7747719578100224044/posts/default/2680341254850398865'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7747719578100224044/posts/default/2680341254850398865'/><link rel='alternate' type='text/html' href='http://itakeitalltheway.blogspot.com/2010/09/my-favorite-shortcut-in-eclipse.html' title='My favorite shortcuts in Eclipse'/><author><name>khairil</name><uri>http://www.blogger.com/profile/03657840372834573386</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://1.bp.blogspot.com/_AP6rUce9jPQ/SiA1FHpuQKI/AAAAAAAAACc/l6bdhmwx2K4/S220/iminred1.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7747719578100224044.post-3899698313600058706</id><published>2010-09-09T03:52:00.000-07:00</published><updated>2010-09-14T22:05:14.880-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='oracle'/><title type='text'>oracle : display all tables in database</title><content type='html'>&lt;pre name="code" class="sql"&gt;&lt;br /&gt;SELECT owner, table_name FROM all_tables order by OWNER ;&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7747719578100224044-3899698313600058706?l=itakeitalltheway.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://itakeitalltheway.blogspot.com/feeds/3899698313600058706/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://itakeitalltheway.blogspot.com/2010/09/display-all-tables-in-database.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7747719578100224044/posts/default/3899698313600058706'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7747719578100224044/posts/default/3899698313600058706'/><link rel='alternate' type='text/html' href='http://itakeitalltheway.blogspot.com/2010/09/display-all-tables-in-database.html' title='oracle : display all tables in database'/><author><name>khairil</name><uri>http://www.blogger.com/profile/03657840372834573386</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://1.bp.blogspot.com/_AP6rUce9jPQ/SiA1FHpuQKI/AAAAAAAAACc/l6bdhmwx2K4/S220/iminred1.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7747719578100224044.post-8698376513712435818</id><published>2010-09-07T21:40:00.000-07:00</published><updated>2010-09-08T02:40:00.169-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='jsf 2'/><title type='text'>JSF 2 In and Out Injection with @ManagedProperty</title><content type='html'>Usually during login proses, we validate the user credential, fetch the user details from database and store it in a session for the future use. Normally HttpSession is used to achieve this goal. In Seam we do this injection by using @In and @Out annotation, in JSF 2, we use @ManagedProperty.&lt;br /&gt;&lt;br /&gt;Consider we have a login bean with request scope and a user session bean with session scope. So it would be like this :&lt;br /&gt;1.user session bean&lt;br /&gt;&lt;pre name="code" class="java"&gt;&lt;br /&gt;@ManagedBean(name="userSession")&lt;br /&gt;@SessionScoped&lt;br /&gt;public class UserSession {&lt;br /&gt;&lt;br /&gt;   private String username;&lt;br /&gt;   //getter and setter for username&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;2.login bean&lt;br /&gt;&lt;pre name="code" class="java"&gt;&lt;br /&gt;@ManagedBean(name="loginActionBean")&lt;br /&gt;@RequestScoped&lt;br /&gt;public class loginActionBean { &lt;br /&gt;&lt;br /&gt;   @ManagedProperty(value = "#{userSession}")&lt;br /&gt;   private UserSession userSession ;&lt;br /&gt;   //getter and setter for userSession&lt;br /&gt;&lt;br /&gt;   private String username;&lt;br /&gt;   //getter and setter for username&lt;br /&gt;&lt;br /&gt;   public String authenticate() {&lt;br /&gt;      userSession.setUsername(this.username);&lt;br /&gt;      return "nextpage.jsf";&lt;br /&gt;   }&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;then we can get the user session value in other managed beans or our view(xhtml) by calling something like userSession.getUsername or #{userSession.username} . Again, @ManagedProperty(value = "#{userSession}") with its getter and setter must be set in the managed bean where we want to use the session.&lt;br /&gt;&lt;br /&gt;Alternatively, we can also use FacesContext to set and get the session.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7747719578100224044-8698376513712435818?l=itakeitalltheway.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://itakeitalltheway.blogspot.com/feeds/8698376513712435818/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://itakeitalltheway.blogspot.com/2010/09/jsf-2-in-and-out-injection-with.html#comment-form' title='5 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7747719578100224044/posts/default/8698376513712435818'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7747719578100224044/posts/default/8698376513712435818'/><link rel='alternate' type='text/html' href='http://itakeitalltheway.blogspot.com/2010/09/jsf-2-in-and-out-injection-with.html' title='JSF 2 In and Out Injection with @ManagedProperty'/><author><name>khairil</name><uri>http://www.blogger.com/profile/03657840372834573386</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://1.bp.blogspot.com/_AP6rUce9jPQ/SiA1FHpuQKI/AAAAAAAAACc/l6bdhmwx2K4/S220/iminred1.jpg'/></author><thr:total>5</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7747719578100224044.post-1917772400474494873</id><published>2010-09-07T11:31:00.000-07:00</published><updated>2010-09-07T11:45:31.221-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='java'/><title type='text'>How to easily break from the inner and outer loop</title><content type='html'>This how to break from the inner and outer loop.&lt;br /&gt;&lt;pre name="code" class="java"&gt;&lt;br /&gt;search:&lt;br /&gt;    for (i = 0; i &lt; arrayOfInts.length; i++) {&lt;br /&gt;        for (j = 0; j &lt; arrayOfInts[i].length; j++) {&lt;br /&gt;            if (arrayOfInts[i][j] == searchfor) {&lt;br /&gt;                foundIt = true;&lt;br /&gt;                break search;&lt;br /&gt;            }&lt;br /&gt;        }&lt;br /&gt;    }&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;reference:&lt;a href="Refer to: http://java.sun.com/docs/books/tutorial/java/nutsandbolts/branch.html"&gt;&lt;br /&gt;Refer to: http://java.sun.com/docs/books/tutorial/java/nutsandbolts/branch.html&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7747719578100224044-1917772400474494873?l=itakeitalltheway.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://itakeitalltheway.blogspot.com/feeds/1917772400474494873/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://itakeitalltheway.blogspot.com/2010/09/break-statement.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7747719578100224044/posts/default/1917772400474494873'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7747719578100224044/posts/default/1917772400474494873'/><link rel='alternate' type='text/html' href='http://itakeitalltheway.blogspot.com/2010/09/break-statement.html' title='How to easily break from the inner and outer loop'/><author><name>khairil</name><uri>http://www.blogger.com/profile/03657840372834573386</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://1.bp.blogspot.com/_AP6rUce9jPQ/SiA1FHpuQKI/AAAAAAAAACc/l6bdhmwx2K4/S220/iminred1.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7747719578100224044.post-5876078868471542060</id><published>2010-09-07T09:03:00.000-07:00</published><updated>2010-09-07T22:33:10.633-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='jsf 2'/><title type='text'>JSF 2 :my application issue with browser back button</title><content type='html'>I created a simple app where only logged in users are able to view the page. So :&lt;br /&gt;1st, I implemented a filter that checks every page if the login session is alive before continue , else it will be redirected to the login page. &lt;br /&gt;2nd, To prevent users from using back button to get the previous page without login, I implemented a phase listener that will set the page header using pragma no cache.&lt;br /&gt;&lt;br /&gt;But then I found a security flaw when testing my app using FF3.0+ browser. At first, it worked as expected where pages couldn't be accessed using back button, but after 5 trials of clicking the back button, surprisingly I was able to go back to the previous page and called the action method! When I debugged it, it did go through the filter check but the login session was alive again even though it was before null and invalidated using the session.invalidate() when logout.&lt;br /&gt;&lt;br /&gt;I did a guess that it has something to do with the default JSF 2 behavior where URL is not updated in the URL bar even though the server forwarded the navigation URL since my filter depends on the page URL to check the login session. So I added faces-redirect=true parameter at the end of the navigation URL and it solved the problem.&lt;br /&gt;&lt;br /&gt;But another problem came. My request scope bean didn't work since adding faces-redirect=true will make the server called twice where request scope only survives a call. To solve this problem I used flash scope where it survives 2 calls - a complete redirect with URL gets updated in the URL bar.&lt;br /&gt;&lt;br /&gt;reference:&lt;br /&gt;&lt;a href="http://www.jsfsummit.com/blog/max_katz/2010/07/learning_jsf2_using_flash_scope"&gt;http://www.jsfsummit.com/blog/max_katz/2010/07/learning_jsf2_using_flash_scope&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7747719578100224044-5876078868471542060?l=itakeitalltheway.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://itakeitalltheway.blogspot.com/feeds/5876078868471542060/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://itakeitalltheway.blogspot.com/2010/09/jsf-2-my-application-issue-with-browser.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7747719578100224044/posts/default/5876078868471542060'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7747719578100224044/posts/default/5876078868471542060'/><link rel='alternate' type='text/html' href='http://itakeitalltheway.blogspot.com/2010/09/jsf-2-my-application-issue-with-browser.html' title='JSF 2 :my application issue with browser back button'/><author><name>khairil</name><uri>http://www.blogger.com/profile/03657840372834573386</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://1.bp.blogspot.com/_AP6rUce9jPQ/SiA1FHpuQKI/AAAAAAAAACc/l6bdhmwx2K4/S220/iminred1.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7747719578100224044.post-1641372874493214497</id><published>2010-09-07T07:47:00.000-07:00</published><updated>2010-10-17T09:31:58.263-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='jsf 2'/><title type='text'>JSF 2 invoke action method on page load</title><content type='html'>There are several ways to automatically invoke back-end bean/action in JSF 2 on page load or when reach a specific URL. Among the ways that I recognized are :&lt;br /&gt;&lt;br /&gt;1. using annotation @PostConstruct&lt;br /&gt;If we annotate a method with @PostConstruct, it will be called at bean initialization.&lt;br /&gt;&lt;pre name="code" class="java"&gt;&lt;br /&gt;   @PostConstruct&lt;br /&gt;   public void init() {&lt;br /&gt;      //code here&lt;br /&gt;   }&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;2. using f:event.&lt;br /&gt;&lt;pre name="code" class="xhtml"&gt;&lt;br /&gt;&lt;f:metadata&gt;&lt;br /&gt;   &lt;f:event type="preRenderView" listener="#{articleBean.load}"&gt;&lt;/f:event&gt;&lt;br /&gt;&lt;/f:metadata&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;3. using binding attribute&lt;br /&gt;JSF 2 tags which have binding attibute such as h:form ,h:panelGroup, h:commandLink will invoke the method that binds to these elements.&lt;br /&gt;&lt;pre name="code" class="xhtml"&gt;&lt;br /&gt;&lt;h:form binding="#{todoController.form}"&gt;&lt;/h:form&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;It's important to understand the scope concept in JSF 2 to get the desired result. We might want to load the action method 1 time only and then proceed with another logic that trigger another action in the same page but end up calling this on load action method every time before invoke the real method that we want. Check the scope. &lt;br /&gt;&lt;br /&gt;If it's request scope then it will be called each time we invoke any methods in the page since request scope only lasts for a call and the bean will be initialized again in the next call. Change it to view scope or session scope will extend the life time of the bean.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7747719578100224044-1641372874493214497?l=itakeitalltheway.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://itakeitalltheway.blogspot.com/feeds/1641372874493214497/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://itakeitalltheway.blogspot.com/2010/09/jsf-2-invoke-action-method-on-page-load.html#comment-form' title='6 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7747719578100224044/posts/default/1641372874493214497'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7747719578100224044/posts/default/1641372874493214497'/><link rel='alternate' type='text/html' href='http://itakeitalltheway.blogspot.com/2010/09/jsf-2-invoke-action-method-on-page-load.html' title='JSF 2 invoke action method on page load'/><author><name>khairil</name><uri>http://www.blogger.com/profile/03657840372834573386</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://1.bp.blogspot.com/_AP6rUce9jPQ/SiA1FHpuQKI/AAAAAAAAACc/l6bdhmwx2K4/S220/iminred1.jpg'/></author><thr:total>6</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7747719578100224044.post-2918670602073718264</id><published>2010-08-29T19:30:00.000-07:00</published><updated>2010-09-07T01:46:17.200-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='java'/><title type='text'>ping ip address every Nth second to keep VPN connection alive</title><content type='html'>&lt;div&gt;Sometimes 'ping myipadress &lt;ipaddress&gt;-t' to keep vpn connection alive doesn't work. Below is Java way.&lt;/ipaddress&gt;&lt;/div&gt;&lt;br /&gt;&lt;pre name="code" class="java"&gt;&lt;br /&gt;import java.io.IOException;&lt;br /&gt;import java.net.InetAddress;&lt;br /&gt;import java.net.UnknownHostException;&lt;br /&gt;public class VPNKeepAlive {&lt;br /&gt;   public final static int TIMEOUT = 3000;&lt;br /&gt;   public final static String URL = "myipaddress"; //ip address or domain name&lt;br /&gt;   public static void main(String[] args) {&lt;br /&gt;      try {&lt;br /&gt;         InetAddress inetAddress = InetAddress.getByName(URL);&lt;br /&gt;         while(true) {&lt;br /&gt;            if(inetAddress.isReachable(TIMEOUT)) {&lt;br /&gt;               Thread.sleep(60000);&lt;br /&gt;            }&lt;br /&gt;         }&lt;br /&gt;      } catch (UnknownHostException e) {&lt;br /&gt;         System.err.println(e);&lt;br /&gt;      } catch (IOException e) {&lt;br /&gt;         System.err.println(e);&lt;br /&gt;      } catch (InterruptedException e) {&lt;br /&gt;         System.err.println(e);&lt;br /&gt;      }&lt;br /&gt;   }&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7747719578100224044-2918670602073718264?l=itakeitalltheway.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://itakeitalltheway.blogspot.com/feeds/2918670602073718264/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://itakeitalltheway.blogspot.com/2010/08/ping-ip-address-every-nth-second.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7747719578100224044/posts/default/2918670602073718264'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7747719578100224044/posts/default/2918670602073718264'/><link rel='alternate' type='text/html' href='http://itakeitalltheway.blogspot.com/2010/08/ping-ip-address-every-nth-second.html' title='ping ip address every Nth second to keep VPN connection alive'/><author><name>khairil</name><uri>http://www.blogger.com/profile/03657840372834573386</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://1.bp.blogspot.com/_AP6rUce9jPQ/SiA1FHpuQKI/AAAAAAAAACc/l6bdhmwx2K4/S220/iminred1.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7747719578100224044.post-3161833514489076045</id><published>2010-08-25T22:28:00.000-07:00</published><updated>2010-09-07T03:36:55.472-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='php'/><title type='text'>PHP Y2K38 Bug :furthest date can be stored is on 19 January 2038 ?</title><content type='html'>&lt;pre name="code" class="php"&gt;&lt;br /&gt;$date = '2040-02-01';&lt;br /&gt;$format = 'l d F Y H:i';&lt;br /&gt;$mydate1 = strtotime($date);&lt;br /&gt;echo date($format, $mydate1);&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;If you’re seeing a date in the late 60’s or early 70’s ,your php affected by Y2K38 Bug.&lt;br /&gt;&lt;br /&gt;alternative solution:&lt;br /&gt;&lt;br /&gt;Use DateTime class in PHP version 5.2.&lt;br /&gt;&lt;pre name="code" class="php"&gt;&lt;br /&gt;$mydate2 = new DateTime($date);&lt;br /&gt;$mydate2-&gt;format($format),&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7747719578100224044-3161833514489076045?l=itakeitalltheway.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://itakeitalltheway.blogspot.com/feeds/3161833514489076045/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://itakeitalltheway.blogspot.com/2010/08/is-your-php-having-y2k38-bug.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7747719578100224044/posts/default/3161833514489076045'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7747719578100224044/posts/default/3161833514489076045'/><link rel='alternate' type='text/html' href='http://itakeitalltheway.blogspot.com/2010/08/is-your-php-having-y2k38-bug.html' title='PHP Y2K38 Bug :furthest date can be stored is on 19 January 2038 ?'/><author><name>khairil</name><uri>http://www.blogger.com/profile/03657840372834573386</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://1.bp.blogspot.com/_AP6rUce9jPQ/SiA1FHpuQKI/AAAAAAAAACc/l6bdhmwx2K4/S220/iminred1.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7747719578100224044.post-4461489647441457889</id><published>2010-08-24T22:24:00.000-07:00</published><updated>2010-09-08T01:09:45.730-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='javascript'/><category scheme='http://www.blogger.com/atom/ns#' term='regex'/><title type='text'>javascript : trim white space</title><content type='html'>&lt;pre name="code" class="javascript"&gt;&lt;br /&gt;// trim blank space at the string&lt;br /&gt;function trim_string( string ) {&lt;br /&gt;   return string.replace(/(^\s*)|(\s*$)/g, '');&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;// trim blank space at the beginning&lt;br /&gt;function left_trim_string( string ) {&lt;br /&gt;   return string.replace(/(^\s*)/g, '');&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;// trim blank space at the end&lt;br /&gt;function right_trim_string( string ) {&lt;br /&gt;   return string.replace(/(\s*$)/g, '');&lt;br /&gt;} &lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7747719578100224044-4461489647441457889?l=itakeitalltheway.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://itakeitalltheway.blogspot.com/feeds/4461489647441457889/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://itakeitalltheway.blogspot.com/2010/08/javascript-trim-white-space.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7747719578100224044/posts/default/4461489647441457889'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7747719578100224044/posts/default/4461489647441457889'/><link rel='alternate' type='text/html' href='http://itakeitalltheway.blogspot.com/2010/08/javascript-trim-white-space.html' title='javascript : trim white space'/><author><name>khairil</name><uri>http://www.blogger.com/profile/03657840372834573386</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://1.bp.blogspot.com/_AP6rUce9jPQ/SiA1FHpuQKI/AAAAAAAAACc/l6bdhmwx2K4/S220/iminred1.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7747719578100224044.post-2271125325521721279</id><published>2010-08-22T21:38:00.000-07:00</published><updated>2010-09-07T03:26:23.172-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='jquery'/><title type='text'>jquery find selected checkbox</title><content type='html'>this code will go thru for every checkbox that is checked.&lt;br /&gt;example :&lt;br /&gt;&lt;pre name="code" class="javascript"&gt;&lt;br /&gt;$("input[type=checkbox]:checked").each(function() {&lt;br /&gt;//code here&lt;br /&gt;});&lt;br /&gt;//$("&amp;lt;element&amp;gt;[&amp;lt;attribute&amp;gt;=&amp;lt;value&amp;gt;]:&amp;lt;condition&amp;gt;")&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7747719578100224044-2271125325521721279?l=itakeitalltheway.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://itakeitalltheway.blogspot.com/feeds/2271125325521721279/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://itakeitalltheway.blogspot.com/2010/08/jquery-find-selected-checkbox.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7747719578100224044/posts/default/2271125325521721279'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7747719578100224044/posts/default/2271125325521721279'/><link rel='alternate' type='text/html' href='http://itakeitalltheway.blogspot.com/2010/08/jquery-find-selected-checkbox.html' title='jquery find selected checkbox'/><author><name>khairil</name><uri>http://www.blogger.com/profile/03657840372834573386</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://1.bp.blogspot.com/_AP6rUce9jPQ/SiA1FHpuQKI/AAAAAAAAACc/l6bdhmwx2K4/S220/iminred1.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7747719578100224044.post-5711500495299903284</id><published>2010-08-18T20:47:00.000-07:00</published><updated>2010-08-24T21:34:31.847-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='jquery'/><title type='text'>Fast searching with jquery selector</title><content type='html'>&lt;span class="Apple-style-span"   style=" color: rgb(34, 34, 34);  line-height: 21px; font-family:'Trebuchet MS', Verdana, Helvetica, Arial, sans-serif;font-size:15px;"&gt;If you wish to use any of the meta-characters (&lt;code style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; outline-width: 0px; outline-style: initial; outline-color: initial; font-size: 13px; vertical-align: baseline; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: rgb(238, 238, 238); background-position: initial initial; background-repeat: initial initial; "&gt;#;&amp;amp;,.+*~':"!^$[]()=&gt;|/&lt;/code&gt; ) as a literal part of a name, you must escape the character with two backslashes: &lt;code style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; outline-width: 0px; outline-style: initial; outline-color: initial; font-size: 13px; vertical-align: baseline; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: rgb(238, 238, 238); background-position: initial initial; background-repeat: initial initial; "&gt;\\&lt;/code&gt;. For example, if you have an an input with &lt;code style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; outline-width: 0px; outline-style: initial; outline-color: initial; font-size: 13px; vertical-align: baseline; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: rgb(238, 238, 238); background-position: initial initial; background-repeat: initial initial; "&gt;name="names[]"&lt;/code&gt;, you can use the selector&lt;code style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; outline-width: 0px; outline-style: initial; outline-color: initial; font-size: 13px; vertical-align: baseline; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: rgb(238, 238, 238); background-position: initial initial; background-repeat: initial initial; "&gt;$("input[name=names\\[\\]]")&lt;/code&gt;.&lt;/span&gt;&lt;div&gt;&lt;span class="Apple-style-span"   style=" color: rgb(34, 34, 34);  line-height: 21px; font-family:'Trebuchet MS', Verdana, Helvetica, Arial, sans-serif;font-size:15px;"&gt;&lt;span class="Apple-style-span"  style=" line-height: 14px; font-size:10px;"&gt;&lt;ul id="method-list" style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; outline-width: 0px; outline-style: initial; outline-color: initial; font-size: 10px; vertical-align: baseline; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; list-style-type: none; list-style-position: initial; list-style-image: initial; background-position: initial initial; background-repeat: initial initial; "&gt;&lt;li id="post-588" class="keynav hentry p4 post publish category-attribute-selectors category-1.0 untagged y2009 m11 d15 h12 alt withoutfocus" style="padding-top: 10px; padding-right: 10px; padding-bottom: 10px; padding-left: 10px; margin-top: 0.5em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 1px; border-left-width: 0px; border-style: initial; border-color: initial; outline-width: 0px; outline-style: initial; outline-color: initial; font-size: 1.1em; vertical-align: baseline; background-image: none; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: initial; border-bottom-style: solid; border-bottom-color: rgb(238, 238, 238); background-position: initial initial; background-repeat: initial initial; "&gt;&lt;h2 class="entry-title" style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; outline-width: 0px; outline-style: initial; outline-color: initial; font-size: 1.5em; vertical-align: baseline; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; font-family: 'Trebuchet MS', Verdana, Helvetica, Arial, sans-serif; letter-spacing: 0px; border-bottom-style: initial; border-bottom-color: initial; color: rgb(51, 51, 51); font-weight: bold; display: inline; background-position: initial initial; background-repeat: initial initial; "&gt;&lt;a class="title-link" href="http://api.jquery.com/attribute-contains-selector/" title="Permalink to Attribute Contains Selector [name*=value]" rel="bookmark" style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; outline-width: 0px; outline-style: initial; outline-color: initial; font-size: 17px; vertical-align: baseline; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; border-bottom-style: initial; border-bottom-color: initial; color: rgb(15, 103, 161); text-decoration: none; display: block; background-position: initial initial; background-repeat: initial initial; "&gt;Attribute Contains Selector [name*=value]&lt;/a&gt;&lt;/h2&gt;&lt;span class="entry-meta"  style="padding-top: 4px; padding-right: 4px; padding-bottom: 4px; padding-left: 4px; margin-top: -27px; margin-right: -4px; margin-bottom: 0px; margin-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; outline-width: 0px; outline-style: initial; outline-color: initial;  vertical-align: baseline; background-image: none; background-attachment: scroll; background-origin: initial; background-clip: initial; background-color: rgb(238, 238, 238); float: right; background-position: 0px 0px; background-repeat: repeat repeat; font-size:1em;"&gt;&lt;span class="cat-links"   style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; outline-width: 0px; outline-style: initial; outline-color: initial;  vertical-align: baseline; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background- background-position: initial initial; background-repeat: initial initial; font-size:11px;color:transparent;"&gt;&lt;a href="http://api.jquery.com/category/selectors/attribute-selectors/" title="View all posts in Attribute" rel="category tag" style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; outline-width: 0px; outline-style: initial; outline-color: initial; font-size: 11px; vertical-align: baseline; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; border-bottom-style: initial; border-bottom-color: initial; color: rgb(15, 103, 161); text-decoration: underline; background-position: initial initial; background-repeat: initial initial; "&gt;Attribute&lt;/a&gt;&lt;/span&gt;&lt;/span&gt;&lt;p class="desc" size="1em" color="transparent" style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; outline-width: 0px; outline-style: initial; outline-color: initial;  vertical-align: baseline; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background- clear: both; font-style: italic; background-position: initial initial; background-repeat: initial initial; "&gt;Selects elements that have the specified attribute with a value containing the a given substring.&lt;/p&gt;&lt;/li&gt;&lt;li id="post-592" class="keynav hentry p5 post publish category-attribute-selectors category-1.0 untagged y2009 m11 d15 h12 withoutfocus" style="padding-top: 10px; padding-right: 10px; padding-bottom: 10px; padding-left: 10px; margin-top: 0.5em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 1px; border-left-width: 0px; border-style: initial; border-color: initial; outline-width: 0px; outline-style: initial; outline-color: initial; font-size: 1.1em; vertical-align: baseline; background-image: none; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: initial; border-bottom-style: solid; border-bottom-color: rgb(238, 238, 238); background-position: initial initial; background-repeat: initial initial; "&gt;&lt;h2 class="entry-title" style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; outline-width: 0px; outline-style: initial; outline-color: initial; font-size: 1.5em; vertical-align: baseline; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; font-family: 'Trebuchet MS', Verdana, Helvetica, Arial, sans-serif; letter-spacing: 0px; border-bottom-style: initial; border-bottom-color: initial; color: rgb(51, 51, 51); font-weight: bold; display: inline; background-position: initial initial; background-repeat: initial initial; "&gt;&lt;a class="title-link" href="http://api.jquery.com/attribute-contains-word-selector/" title="Permalink to Attribute Contains Word Selector [name~=value]" rel="bookmark" style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; outline-width: 0px; outline-style: initial; outline-color: initial; font-size: 17px; vertical-align: baseline; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; border-bottom-style: initial; border-bottom-color: initial; color: rgb(15, 103, 161); text-decoration: none; display: block; background-position: initial initial; background-repeat: initial initial; "&gt;Attribute Contains Word Selector [name~=value]&lt;/a&gt;&lt;/h2&gt;&lt;span class="entry-meta"  style="padding-top: 4px; padding-right: 4px; padding-bottom: 4px; padding-left: 4px; margin-top: -27px; margin-right: -4px; margin-bottom: 0px; margin-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; outline-width: 0px; outline-style: initial; outline-color: initial;  vertical-align: baseline; background-image: none; background-attachment: scroll; background-origin: initial; background-clip: initial; background-color: rgb(238, 238, 238); float: right; background-position: 0px 0px; background-repeat: repeat repeat; font-size:1em;"&gt;&lt;span class="cat-links"   style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; outline-width: 0px; outline-style: initial; outline-color: initial;  vertical-align: baseline; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background- background-position: initial initial; background-repeat: initial initial; font-size:11px;color:transparent;"&gt;&lt;a href="http://api.jquery.com/category/selectors/attribute-selectors/" title="View all posts in Attribute" rel="category tag" style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; outline-width: 0px; outline-style: initial; outline-color: initial; font-size: 11px; vertical-align: baseline; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; border-bottom-style: initial; border-bottom-color: initial; color: rgb(15, 103, 161); text-decoration: underline; background-position: initial initial; background-repeat: initial initial; "&gt;Attribute&lt;/a&gt;&lt;/span&gt;&lt;/span&gt;&lt;p class="desc" size="1em" color="transparent" style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; outline-width: 0px; outline-style: initial; outline-color: initial;  vertical-align: baseline; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background- clear: both; font-style: italic; background-position: initial initial; background-repeat: initial initial; "&gt;Selects elements that have the specified attribute with a value containing a given word, delimited by spaces.&lt;/p&gt;&lt;/li&gt;&lt;li id="post-586" class="keynav hentry p6 post publish category-attribute-selectors category-1.0 untagged y2009 m11 d15 h12 alt withoutfocus" style="padding-top: 10px; padding-right: 10px; padding-bottom: 10px; padding-left: 10px; margin-top: 0.5em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 1px; border-left-width: 0px; border-style: initial; border-color: initial; outline-width: 0px; outline-style: initial; outline-color: initial; font-size: 1.1em; vertical-align: baseline; background-image: none; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: initial; border-bottom-style: solid; border-bottom-color: rgb(238, 238, 238); background-position: initial initial; background-repeat: initial initial; "&gt;&lt;h2 class="entry-title" style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; outline-width: 0px; outline-style: initial; outline-color: initial; font-size: 1.5em; vertical-align: baseline; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; font-family: 'Trebuchet MS', Verdana, Helvetica, Arial, sans-serif; letter-spacing: 0px; border-bottom-style: initial; border-bottom-color: initial; color: rgb(51, 51, 51); font-weight: bold; display: inline; background-position: initial initial; background-repeat: initial initial; "&gt;&lt;a class="title-link" href="http://api.jquery.com/attribute-ends-with-selector/" title="Permalink to Attribute Ends With Selector [name$=value]" rel="bookmark" style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; outline-width: 0px; outline-style: initial; outline-color: initial; font-size: 17px; vertical-align: baseline; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; border-bottom-style: initial; border-bottom-color: initial; color: rgb(15, 103, 161); text-decoration: none; display: block; background-position: initial initial; background-repeat: initial initial; "&gt;Attribute Ends With Selector [name$=value]&lt;/a&gt;&lt;/h2&gt;&lt;span class="entry-meta"  style="padding-top: 4px; padding-right: 4px; padding-bottom: 4px; padding-left: 4px; margin-top: -27px; margin-right: -4px; margin-bottom: 0px; margin-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; outline-width: 0px; outline-style: initial; outline-color: initial;  vertical-align: baseline; background-image: none; background-attachment: scroll; background-origin: initial; background-clip: initial; background-color: rgb(238, 238, 238); float: right; background-position: 0px 0px; background-repeat: repeat repeat; font-size:1em;"&gt;&lt;span class="cat-links"   style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; outline-width: 0px; outline-style: initial; outline-color: initial;  vertical-align: baseline; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background- background-position: initial initial; background-repeat: initial initial; font-size:11px;color:transparent;"&gt;&lt;a href="http://api.jquery.com/category/selectors/attribute-selectors/" title="View all posts in Attribute" rel="category tag" style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; outline-width: 0px; outline-style: initial; outline-color: initial; font-size: 11px; vertical-align: baseline; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; border-bottom-style: initial; border-bottom-color: initial; color: rgb(15, 103, 161); text-decoration: underline; background-position: initial initial; background-repeat: initial initial; "&gt;Attribute&lt;/a&gt;&lt;/span&gt;&lt;/span&gt;&lt;p class="desc" size="1em" color="transparent" style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; outline-width: 0px; outline-style: initial; outline-color: initial;  vertical-align: baseline; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background- clear: both; font-style: italic; background-position: initial initial; background-repeat: initial initial; "&gt;Selects elements that have the specified attribute with a value ending exactly with a given string.&lt;/p&gt;&lt;/li&gt;&lt;li id="post-580" class="keynav hentry p7 post publish category-attribute-selectors category-1.0 untagged y2009 m11 d15 h12 withoutfocus" style="padding-top: 10px; padding-right: 10px; padding-bottom: 10px; padding-left: 10px; margin-top: 0.5em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 1px; border-left-width: 0px; border-style: initial; border-color: initial; outline-width: 0px; outline-style: initial; outline-color: initial; font-size: 1.1em; vertical-align: baseline; background-image: none; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: initial; border-bottom-style: solid; border-bottom-color: rgb(238, 238, 238); background-position: initial initial; background-repeat: initial initial; "&gt;&lt;h2 class="entry-title" style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; outline-width: 0px; outline-style: initial; outline-color: initial; font-size: 1.5em; vertical-align: baseline; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; font-family: 'Trebuchet MS', Verdana, Helvetica, Arial, sans-serif; letter-spacing: 0px; border-bottom-style: initial; border-bottom-color: initial; color: rgb(51, 51, 51); font-weight: bold; display: inline; background-position: initial initial; background-repeat: initial initial; "&gt;&lt;a class="title-link" href="http://api.jquery.com/attribute-equals-selector/" title="Permalink to Attribute Equals Selector [name=value]" rel="bookmark" style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; outline-width: 0px; outline-style: initial; outline-color: initial; font-size: 17px; vertical-align: baseline; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; border-bottom-style: initial; border-bottom-color: initial; color: rgb(15, 103, 161); text-decoration: none; display: block; background-position: initial initial; background-repeat: initial initial; "&gt;Attribute Equals Selector [name=value]&lt;/a&gt;&lt;/h2&gt;&lt;span class="entry-meta"  style="padding-top: 4px; padding-right: 4px; padding-bottom: 4px; padding-left: 4px; margin-top: -27px; margin-right: -4px; margin-bottom: 0px; margin-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; outline-width: 0px; outline-style: initial; outline-color: initial;  vertical-align: baseline; background-image: none; background-attachment: scroll; background-origin: initial; background-clip: initial; background-color: rgb(238, 238, 238); float: right; background-position: 0px 0px; background-repeat: repeat repeat; font-size:1em;"&gt;&lt;span class="cat-links"   style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; outline-width: 0px; outline-style: initial; outline-color: initial;  vertical-align: baseline; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background- background-position: initial initial; background-repeat: initial initial; font-size:11px;color:transparent;"&gt;&lt;a href="http://api.jquery.com/category/selectors/attribute-selectors/" title="View all posts in Attribute" rel="category tag" style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; outline-width: 0px; outline-style: initial; outline-color: initial; font-size: 11px; vertical-align: baseline; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; border-bottom-style: initial; border-bottom-color: initial; color: rgb(15, 103, 161); text-decoration: underline; background-position: initial initial; background-repeat: initial initial; "&gt;Attribute&lt;/a&gt;&lt;/span&gt;&lt;/span&gt;&lt;p class="desc" size="1em" color="transparent" style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; outline-width: 0px; outline-style: initial; outline-color: initial;  vertical-align: baseline; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background- clear: both; font-style: italic; background-position: initial initial; background-repeat: initial initial; "&gt;Selects elements that have the specified attribute with a value exactly equal to a certain value.&lt;/p&gt;&lt;/li&gt;&lt;li id="post-582" class="keynav hentry p8 post publish category-attribute-selectors category-1.0 untagged y2009 m11 d15 h12 alt withoutfocus" style="padding-top: 10px; padding-right: 10px; padding-bottom: 10px; padding-left: 10px; margin-top: 0.5em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 1px; border-left-width: 0px; border-style: initial; border-color: initial; outline-width: 0px; outline-style: initial; outline-color: initial; font-size: 1.1em; vertical-align: baseline; background-image: none; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: initial; border-bottom-style: solid; border-bottom-color: rgb(238, 238, 238); background-position: initial initial; background-repeat: initial initial; "&gt;&lt;h2 class="entry-title" style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; outline-width: 0px; outline-style: initial; outline-color: initial; font-size: 1.5em; vertical-align: baseline; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; font-family: 'Trebuchet MS', Verdana, Helvetica, Arial, sans-serif; letter-spacing: 0px; border-bottom-style: initial; border-bottom-color: initial; color: rgb(51, 51, 51); font-weight: bold; display: inline; background-position: initial initial; background-repeat: initial initial; "&gt;&lt;a class="title-link" href="http://api.jquery.com/attribute-not-equal-selector/" title="Permalink to Attribute Not Equal Selector [name!=value]" rel="bookmark" style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; outline-width: 0px; outline-style: initial; outline-color: initial; font-size: 17px; vertical-align: baseline; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; border-bottom-style: initial; border-bottom-color: initial; color: rgb(15, 103, 161); text-decoration: none; display: block; background-position: initial initial; background-repeat: initial initial; "&gt;Attribute Not Equal Selector [name!=value]&lt;/a&gt;&lt;/h2&gt;&lt;span class="entry-meta"  style="padding-top: 4px; padding-right: 4px; padding-bottom: 4px; padding-left: 4px; margin-top: -27px; margin-right: -4px; margin-bottom: 0px; margin-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; outline-width: 0px; outline-style: initial; outline-color: initial;  vertical-align: baseline; background-image: none; background-attachment: scroll; background-origin: initial; background-clip: initial; background-color: rgb(238, 238, 238); float: right; background-position: 0px 0px; background-repeat: repeat repeat; font-size:1em;"&gt;&lt;span class="cat-links"   style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; outline-width: 0px; outline-style: initial; outline-color: initial;  vertical-align: baseline; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background- background-position: initial initial; background-repeat: initial initial; font-size:11px;color:transparent;"&gt;&lt;a href="http://api.jquery.com/category/selectors/attribute-selectors/" title="View all posts in Attribute" rel="category tag" style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; outline-width: 0px; outline-style: initial; outline-color: initial; font-size: 11px; vertical-align: baseline; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; border-bottom-style: initial; border-bottom-color: initial; color: rgb(15, 103, 161); text-decoration: underline; background-position: initial initial; background-repeat: initial initial; "&gt;Attribute&lt;/a&gt;&lt;/span&gt;&lt;/span&gt;&lt;p class="desc" size="1em" color="transparent" style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; outline-width: 0px; outline-style: initial; outline-color: initial;  vertical-align: baseline; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background- clear: both; font-style: italic; background-position: initial initial; background-repeat: initial initial; "&gt;Select elements that either don't have the specified attribute, or do have the specified attribute but not with a certain value.&lt;/p&gt;&lt;/li&gt;&lt;li id="post-584" class="keynav hentry p9 post publish category-attribute-selectors category-1.0 untagged y2009 m11 d15 h12 withoutfocus" style="padding-top: 10px; padding-right: 10px; padding-bottom: 10px; padding-left: 10px; margin-top: 0.5em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 1px; border-left-width: 0px; border-style: initial; border-color: initial; outline-width: 0px; outline-style: initial; outline-color: initial; font-size: 1.1em; vertical-align: baseline; background-image: none; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: initial; border-bottom-style: solid; border-bottom-color: rgb(238, 238, 238); background-position: initial initial; background-repeat: initial initial; "&gt;&lt;h2 class="entry-title" style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; outline-width: 0px; outline-style: initial; outline-color: initial; font-size: 1.5em; vertical-align: baseline; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; font-family: 'Trebuchet MS', Verdana, Helvetica, Arial, sans-serif; letter-spacing: 0px; border-bottom-style: initial; border-bottom-color: initial; color: rgb(51, 51, 51); font-weight: bold; display: inline; background-position: initial initial; background-repeat: initial initial; "&gt;&lt;a class="title-link" href="http://api.jquery.com/attribute-starts-with-selector/" title="Permalink to Attribute Starts With Selector [name^=value]" rel="bookmark" style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; outline-width: 0px; outline-style: initial; outline-color: initial; font-size: 17px; vertical-align: baseline; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; border-bottom-style: initial; border-bottom-color: initial; color: rgb(15, 103, 161); text-decoration: none; display: block; background-position: initial initial; background-repeat: initial initial; "&gt;Attribute Starts With Selector [name^=value]&lt;/a&gt;&lt;/h2&gt;&lt;span class="entry-meta"  style="padding-top: 4px; padding-right: 4px; padding-bottom: 4px; padding-left: 4px; margin-top: -27px; margin-right: -4px; margin-bottom: 0px; margin-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; outline-width: 0px; outline-style: initial; outline-color: initial;  vertical-align: baseline; background-image: none; background-attachment: scroll; background-origin: initial; background-clip: initial; background-color: rgb(238, 238, 238); float: right; background-position: 0px 0px; background-repeat: repeat repeat; font-size:1em;"&gt;&lt;span class="cat-links"   style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; outline-width: 0px; outline-style: initial; outline-color: initial;  vertical-align: baseline; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background- background-position: initial initial; background-repeat: initial initial; font-size:11px;color:transparent;"&gt;&lt;a href="http://api.jquery.com/category/selectors/attribute-selectors/" title="View all posts in Attribute" rel="category tag" style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; outline-width: 0px; outline-style: initial; outline-color: initial; font-size: 11px; vertical-align: baseline; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; border-bottom-style: initial; border-bottom-color: initial; color: rgb(15, 103, 161); text-decoration: underline; background-position: initial initial; background-repeat: initial initial; "&gt;Attribute&lt;/a&gt;&lt;/span&gt;&lt;/span&gt;&lt;p class="desc" size="1em" color="transparent" style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; outline-width: 0px; outline-style: initial; outline-color: initial;  vertical-align: baseline; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background- clear: both; font-style: italic; background-position: initial initial; background-repeat: initial initial; "&gt;Selects elements that have the specified attribute with a value beginning exactly with a given string.&lt;/p&gt;&lt;p class="desc" style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; outline-width: 0px; outline-style: initial; outline-color: initial; font-size: 1em; vertical-align: baseline; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; clear: both; font-style: italic; background-position: initial initial; background-repeat: initial initial; "&gt;&lt;br /&gt;&lt;/p&gt;&lt;p class="desc" style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; outline-width: 0px; outline-style: initial; outline-color: initial; font-size: 1em; vertical-align: baseline; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; clear: both; font-style: italic; background-position: initial initial; background-repeat: initial initial; "&gt;full reference : &lt;span class="Apple-style-span" style="font-style: normal; "&gt;&lt;a href="http://api.jquery.com/category/selectors/"&gt;http://api.jquery.com/category/selectors/&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="desc" style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; outline-width: 0px; outline-style: initial; outline-color: initial; font-size: 1em; vertical-align: baseline; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; clear: both; font-style: italic; background-position: initial initial; background-repeat: initial initial; "&gt;jquery selector cheat sheet : &lt;span class="Apple-style-span" style="font-style: normal; "&gt;&lt;a href="http://www.skidoosh.co.uk/jquery/jquery-selectors-and-attribute-selectors-reference-and-examples-v2/"&gt;http://www.skidoosh.co.uk/jquery/jquery-selectors-and-attribute-selectors-reference-and-examples-v2/&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7747719578100224044-5711500495299903284?l=itakeitalltheway.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://itakeitalltheway.blogspot.com/feeds/5711500495299903284/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://itakeitalltheway.blogspot.com/2010/08/jquery-selector.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7747719578100224044/posts/default/5711500495299903284'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7747719578100224044/posts/default/5711500495299903284'/><link rel='alternate' type='text/html' href='http://itakeitalltheway.blogspot.com/2010/08/jquery-selector.html' title='Fast searching with jquery selector'/><author><name>khairil</name><uri>http://www.blogger.com/profile/03657840372834573386</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://1.bp.blogspot.com/_AP6rUce9jPQ/SiA1FHpuQKI/AAAAAAAAACc/l6bdhmwx2K4/S220/iminred1.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7747719578100224044.post-2978944379349231151</id><published>2010-07-27T18:57:00.000-07:00</published><updated>2010-09-08T01:45:27.151-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='java'/><title type='text'>Java : singleton with example</title><content type='html'>A singleton is a class that can be instantiated once, and only once. The restriction on the singleton is that there can be only one instance of a singleton created by the Java Virtual Machine (JVM). Often in designing a system, we want to control how an object is used, and prevent others (ourselves included) from making copies of it or creating new instances. For example, a central configuration object that stores setup information should have one and one only instance - a global copy accessible from any part of the application, including any threads that are running.&lt;br /&gt;&lt;pre name="code" class="java"&gt;&lt;br /&gt;public class SingletonObject {&lt;br /&gt;   //marked as private so that class can't be directly instantiated&lt;br /&gt;   private SingletonObject() {&lt;br /&gt;      // no code req'd&lt;br /&gt;   }&lt;br /&gt;&lt;br /&gt;   //add synchronized keyword to prevent thread making a new copy&lt;br /&gt;   public static synchronized SingletonObject getSingletonObject() {&lt;br /&gt;      if (ref == null) {&lt;br /&gt;         // it's ok, we can call this constructor&lt;br /&gt;         ref = new SingletonObject();&lt;br /&gt;      }&lt;br /&gt;      return ref;&lt;br /&gt;   }&lt;br /&gt;&lt;br /&gt;   //overwrite default clone method so that this class can't be cloned&lt;br /&gt;   public Object clone()&lt;br /&gt;   throws CloneNotSupportedException {&lt;br /&gt;      throw new CloneNotSupportedException();&lt;br /&gt;      // that'll teach 'em&lt;br /&gt;   }&lt;br /&gt;&lt;br /&gt;   private static SingletonObject ref;&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;reference : &lt;a href="http://www.javacoffeebreak.com/articles/designpatterns/index.html"&gt;http://www.javacoffeebreak.com/articles/designpatterns/index.html&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7747719578100224044-2978944379349231151?l=itakeitalltheway.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://itakeitalltheway.blogspot.com/feeds/2978944379349231151/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://itakeitalltheway.blogspot.com/2010/07/java-singleton-example.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7747719578100224044/posts/default/2978944379349231151'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7747719578100224044/posts/default/2978944379349231151'/><link rel='alternate' type='text/html' href='http://itakeitalltheway.blogspot.com/2010/07/java-singleton-example.html' title='Java : singleton with example'/><author><name>khairil</name><uri>http://www.blogger.com/profile/03657840372834573386</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://1.bp.blogspot.com/_AP6rUce9jPQ/SiA1FHpuQKI/AAAAAAAAACc/l6bdhmwx2K4/S220/iminred1.jpg'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7747719578100224044.post-535871233666704333</id><published>2010-07-26T20:52:00.000-07:00</published><updated>2010-09-07T02:05:01.356-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='java'/><title type='text'>Java enum switch/if-else statement example</title><content type='html'>&lt;span class="Apple-style-span"  style="color:#006600;"&gt;&lt;b&gt;1.using switch example&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;&lt;pre name="code" class="java"&gt;&lt;br /&gt;public class JavaEnumSwitchCaseExample {&lt;br /&gt;&lt;br /&gt;   enum Margin&lt;br /&gt;   {&lt;br /&gt;      TOP, RIGHT, BOTTOM, LEFT&lt;br /&gt;   }&lt;br /&gt;&lt;br /&gt;   public static void main(String[] args)&lt;br /&gt;   {&lt;br /&gt;      System.out.println(getMarginValue(Margin.TOP));&lt;br /&gt;   }&lt;br /&gt;&lt;br /&gt;   public static String getMarginValue(Margin margin)&lt;br /&gt;   {&lt;br /&gt;      switch (margin) {&lt;br /&gt;         case TOP: return "1em";&lt;br /&gt;         case RIGHT: return "12px";&lt;br /&gt;         case BOTTOM: return "1.5em";&lt;br /&gt;         case LEFT: return "6px";&lt;br /&gt;         default: return null;&lt;br /&gt;      }&lt;br /&gt;   }&lt;br /&gt;} //end of class&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;span class="Apple-style-span"  style="color:#006600;"&gt;&lt;b&gt;2. using if-else example&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;&lt;pre name="code" class="java"&gt;&lt;br /&gt;public class JavaEnumIfThenExample {&lt;br /&gt;&lt;br /&gt;   public enum Day&lt;br /&gt;   {&lt;br /&gt;      SUNDAY, MONDAY, TUESDAY, WEDNESDAY, THURSDAY, FRIDAY, SATURDAY&lt;br /&gt;   }&lt;br /&gt;&lt;br /&gt;   public static void main(String[] args)&lt;br /&gt;   {&lt;br /&gt;      Day theDay = Day.THURSDAY;&lt;br /&gt;      printDayGreeting(theDay);&lt;br /&gt;   }&lt;br /&gt;&lt;br /&gt;   public static void printDayGreeting(Day day)&lt;br /&gt;   {&lt;br /&gt;      if (day == Day.FRIDAY)&lt;br /&gt;         System.out.println("TGIF");&lt;br /&gt;      else&lt;br /&gt;         System.out.println("Some other day");&lt;br /&gt;   }&lt;br /&gt;} //end of class&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;reference : &lt;a href="http://www.devdaily.com/java/using-java-enum-examples-tutorial"&gt;http://www.devdaily.com/java/using-java-enum-examples-tutorial&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7747719578100224044-535871233666704333?l=itakeitalltheway.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://itakeitalltheway.blogspot.com/feeds/535871233666704333/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://itakeitalltheway.blogspot.com/2010/07/java-enum-switch-statement-example.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7747719578100224044/posts/default/535871233666704333'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7747719578100224044/posts/default/535871233666704333'/><link rel='alternate' type='text/html' href='http://itakeitalltheway.blogspot.com/2010/07/java-enum-switch-statement-example.html' title='Java enum switch/if-else statement example'/><author><name>khairil</name><uri>http://www.blogger.com/profile/03657840372834573386</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://1.bp.blogspot.com/_AP6rUce9jPQ/SiA1FHpuQKI/AAAAAAAAACc/l6bdhmwx2K4/S220/iminred1.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7747719578100224044.post-2874854864580200445</id><published>2010-07-26T20:38:00.000-07:00</published><updated>2010-09-07T02:15:24.052-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='java'/><title type='text'>java : Enum - examples</title><content type='html'>&lt;pre name="code" class="java"&gt;&lt;br /&gt;public enum Status {&lt;br /&gt;   Open("O"), Closed("C"), Reopened("R")&lt;br /&gt;   final String code;&lt;br /&gt;   Status(String code) {&lt;br /&gt;      this.code = code;&lt;br /&gt;   }&lt;br /&gt;};&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;you can use the attribute as you would for any other class, eg:&lt;br /&gt;&lt;pre name="code" class="java"&gt;&lt;br /&gt;Status[] values = Status.values();&lt;br /&gt;for(Status statue : values) {&lt;br /&gt;   System.out.println(status.code + " - " + status);&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;result:&lt;br /&gt;O - Open&lt;br /&gt;C - Closed&lt;br /&gt;R - Reopened&lt;br /&gt;&lt;br /&gt;1.enum String:&lt;br /&gt;&lt;pre name="code" class="java"&gt;&lt;br /&gt;Open("O"), Closed("C"), Reopened("R")&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;2.enum range:&lt;br /&gt;&lt;pre name="code" class="java"&gt;&lt;br /&gt;Low(0,100), Medium(101,1000), High(1000, 10000);&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;3. enum boolean:&lt;br /&gt;&lt;pre name="code" class="java"&gt;&lt;br /&gt;Open(true), Closed(false), Reopened(true);&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;reference :&lt;span class="Apple-style-span"   style=" line-height: normal;  font-family:Georgia, serif;font-size:16px;"&gt;&lt;a href="http://java.dzone.com/blogs/mrjohnsmart/2008/05/19/a-short-primer-java-enums-part"&gt;http://java.dzone.com/blogs/mrjohnsmart/2008/05/19/a-short-primer-java-enums-part&lt;/a&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7747719578100224044-2874854864580200445?l=itakeitalltheway.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://itakeitalltheway.blogspot.com/feeds/2874854864580200445/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://itakeitalltheway.blogspot.com/2010/07/java-enum-examples.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7747719578100224044/posts/default/2874854864580200445'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7747719578100224044/posts/default/2874854864580200445'/><link rel='alternate' type='text/html' href='http://itakeitalltheway.blogspot.com/2010/07/java-enum-examples.html' title='java : Enum - examples'/><author><name>khairil</name><uri>http://www.blogger.com/profile/03657840372834573386</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://1.bp.blogspot.com/_AP6rUce9jPQ/SiA1FHpuQKI/AAAAAAAAACc/l6bdhmwx2K4/S220/iminred1.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7747719578100224044.post-1854943084522677359</id><published>2010-07-26T19:54:00.000-07:00</published><updated>2010-08-24T21:52:02.893-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='java'/><title type='text'>JAVA: tips for single thread AND multi thread</title><content type='html'>1. Use Vector if there are multiple threads and ArrayList if there is only a single thread.&lt;br /&gt;2. Use Hashtable if there are multiple threads and HashMap if there is only a single thread.&lt;br /&gt;3. Use StringBuffer if there are multiple threads and StringBuilder if there is only a single thread.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7747719578100224044-1854943084522677359?l=itakeitalltheway.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://itakeitalltheway.blogspot.com/feeds/1854943084522677359/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://itakeitalltheway.blogspot.com/2010/07/java-tips.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7747719578100224044/posts/default/1854943084522677359'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7747719578100224044/posts/default/1854943084522677359'/><link rel='alternate' type='text/html' href='http://itakeitalltheway.blogspot.com/2010/07/java-tips.html' title='JAVA: tips for single thread AND multi thread'/><author><name>khairil</name><uri>http://www.blogger.com/profile/03657840372834573386</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://1.bp.blogspot.com/_AP6rUce9jPQ/SiA1FHpuQKI/AAAAAAAAACc/l6bdhmwx2K4/S220/iminred1.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7747719578100224044.post-2286286089235696058</id><published>2010-07-21T00:25:00.000-07:00</published><updated>2010-09-07T02:35:09.112-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='web design'/><category scheme='http://www.blogger.com/atom/ns#' term='css'/><title type='text'>CSS: how do I vertically-center something?</title><content type='html'>css:&lt;br /&gt;&lt;pre name="code" class="css"&gt;&lt;br /&gt;#myoutercontainer { position:relative }&lt;br /&gt;#myinnercontainer { position:absolute; top:50%; height:10em; margin-top:-5em }&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;html:&lt;br /&gt;&lt;pre name="code" class="html"&gt;&lt;br /&gt;&lt;div id="myoutercontainer"&gt;&lt;br /&gt;   &lt;div id="myinnercontainer"&gt;&lt;br /&gt;      &lt;p&gt;Hey look! I'm vertically centered!&lt;/p&gt;&lt;br /&gt;      &lt;p&gt;How sweet is this?!&lt;/p&gt;&lt;br /&gt;   &lt;/div&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;alternative way:&lt;br /&gt;rules : You have only a single line of text that you want to center&lt;br /&gt;&lt;br /&gt;css:&lt;br /&gt;&lt;pre name="code" class="css"&gt;&lt;br /&gt;#myoutercontainer2 { line-height:4em }&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;html:&lt;br /&gt;&lt;pre name="code" class="html"&gt;&lt;br /&gt;&lt;p id="myoutercontainer2"&gt;&lt;br /&gt;   Hey, this is vertically centered. Yay!&lt;br /&gt;&lt;/p&gt;&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7747719578100224044-2286286089235696058?l=itakeitalltheway.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://itakeitalltheway.blogspot.com/feeds/2286286089235696058/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://itakeitalltheway.blogspot.com/2010/07/how-do-i-vertically-center-something.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7747719578100224044/posts/default/2286286089235696058'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7747719578100224044/posts/default/2286286089235696058'/><link rel='alternate' type='text/html' href='http://itakeitalltheway.blogspot.com/2010/07/how-do-i-vertically-center-something.html' title='CSS: how do I vertically-center something?'/><author><name>khairil</name><uri>http://www.blogger.com/profile/03657840372834573386</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://1.bp.blogspot.com/_AP6rUce9jPQ/SiA1FHpuQKI/AAAAAAAAACc/l6bdhmwx2K4/S220/iminred1.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7747719578100224044.post-226278861029148949</id><published>2010-07-05T19:39:00.000-07:00</published><updated>2010-09-07T02:37:50.321-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='css'/><title type='text'>CSS : create scrollbar when reach max height - IE and FF</title><content type='html'>&lt;pre name="code" class="css"&gt;&lt;br /&gt;.overflowdiv-dr {&lt;br /&gt;   height: expression( this.scrollHeight &gt; 449 ? "450px" : "auto" ); /* sets max-height for IE */&lt;br /&gt;   max-height: 450px; /* sets max-height value for all standards-compliant browsers */&lt;br /&gt;   overflow:auto;&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;apply to div,table or container etc.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7747719578100224044-226278861029148949?l=itakeitalltheway.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://itakeitalltheway.blogspot.com/feeds/226278861029148949/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://itakeitalltheway.blogspot.com/2010/07/scroll-on-when-reach-max-height-ie-and.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7747719578100224044/posts/default/226278861029148949'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7747719578100224044/posts/default/226278861029148949'/><link rel='alternate' type='text/html' href='http://itakeitalltheway.blogspot.com/2010/07/scroll-on-when-reach-max-height-ie-and.html' title='CSS : create scrollbar when reach max height - IE and FF'/><author><name>khairil</name><uri>http://www.blogger.com/profile/03657840372834573386</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://1.bp.blogspot.com/_AP6rUce9jPQ/SiA1FHpuQKI/AAAAAAAAACc/l6bdhmwx2K4/S220/iminred1.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7747719578100224044.post-2242633384556134493</id><published>2010-06-21T19:33:00.000-07:00</published><updated>2010-09-07T02:29:32.914-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='jquery'/><category scheme='http://www.blogger.com/atom/ns#' term='ajax'/><category scheme='http://www.blogger.com/atom/ns#' term='php'/><title type='text'>jquery - ajax $.post example</title><content type='html'>The main aim is to be able to just drop the javascript on top of the HMTL form in a progressive enhancement style so that the underlying HTML form would work even if the javascript is turned off.&lt;br /&gt;1. html:&lt;br /&gt;&lt;pre name="code" class="html"&gt;&lt;br /&gt;&lt;div id="message"&gt;&lt;/div&gt;&lt;br /&gt;&lt;form id="html-form" action="process.php" method="post"&gt;&lt;br /&gt;   &lt;label for="user"&gt;Name&lt;/label&gt;&lt;br /&gt;   &lt;input id="user" name="user" type="text" size="40" value="" maxlength="50"&gt;&lt;br /&gt;   &lt;label for="email"&gt;Email&lt;/label&gt;&lt;br /&gt;   &lt;input id="email" name="email" type="text" size="40" value="" maxlength="50"&gt;&lt;br /&gt;   &lt;label for="web"&gt;Website&lt;/label&gt;&lt;br /&gt;   &lt;input id="web" name="web" type="text" size="40" value="" maxlength="50" /&gt;&lt;br /&gt;   &lt;input id="submit" type="submit" value="Login" class="button" onclick="submitAjax();return false;" /&gt;&lt;br /&gt;&lt;/form&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;2. jquery to overriding the form’s submit event so that it will use the AJAX post rather than the normal POST:&lt;br /&gt;&lt;pre name="code" class="javascript"&gt;&lt;br /&gt;function submitAjax()&lt;br /&gt;{&lt;br /&gt;   $('#submit').val('Logging In...');&lt;br /&gt;   $.post($("#html-form").attr('action'), $("#html-form").serialize(),function(data){&lt;br /&gt;      $('#submit').val('Login');&lt;br /&gt;      if(data == 'success'){&lt;br /&gt;         $('#message').html('Successfully Completed the Form').removeClass('error').css('visibility','visible');&lt;br /&gt;      } else {&lt;br /&gt;         $('#message').html('Error: ' +  data).addClass('error').css('visibility','visible');&lt;br /&gt;      }&lt;br /&gt;   });&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;3. in the process.php :&lt;br /&gt;&lt;pre name="code" class="php"&gt;&lt;br /&gt;if(!empty($_SERVER['HTTP_X_REQUESTED_WITH']) &amp;&amp; strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) == 'xmlhttprequest') {&lt;br /&gt;   //Do AJAX reply's in here&lt;br /&gt;} else {&lt;br /&gt;   //Do normal form processing here&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;example:full reference : &lt;a href="http://blog.gilbertpellegrom.co.uk/post/565731118/html-forms-to-ajax-forms-the-easy-way"&gt;http://blog.gilbertpellegrom.co.uk/post/565731118/html-forms-to-ajax-forms-the-easy-way&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7747719578100224044-2242633384556134493?l=itakeitalltheway.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://itakeitalltheway.blogspot.com/feeds/2242633384556134493/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://itakeitalltheway.blogspot.com/2010/06/jquery-ajax-post-example.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7747719578100224044/posts/default/2242633384556134493'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7747719578100224044/posts/default/2242633384556134493'/><link rel='alternate' type='text/html' href='http://itakeitalltheway.blogspot.com/2010/06/jquery-ajax-post-example.html' title='jquery - ajax $.post example'/><author><name>khairil</name><uri>http://www.blogger.com/profile/03657840372834573386</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://1.bp.blogspot.com/_AP6rUce9jPQ/SiA1FHpuQKI/AAAAAAAAACc/l6bdhmwx2K4/S220/iminred1.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7747719578100224044.post-269685982033783719</id><published>2010-05-23T20:01:00.000-07:00</published><updated>2010-10-20T01:33:08.188-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='unix/linux'/><title type='text'>some commonly used unix/linux commands</title><content type='html'>change directory : cd |space||path| *tips : type prefix letter and use tab for auto selection&lt;br /&gt;view list : ls -ltr&lt;br /&gt;copy : cp -rf |source||space||destination|&lt;br /&gt;delete : rm -rf |source|&lt;div&gt;move : mv |source||space||destination|&lt;br /&gt;see log : tail -f server.log&lt;br /&gt;&lt;br /&gt;see log in log file : vi server.log&lt;br /&gt;to scroll up : CTRL + P&lt;br /&gt;to scroll down : CTRL + D&lt;/div&gt;&lt;br /&gt;find file/directory starts with: find / -mount -name 'filename*'&lt;br /&gt;&lt;br /&gt;reference: 1.&lt;a href="http://student.santarosa.edu/unix_commands.html"&gt;http://student.santarosa.edu/unix_commands.html&lt;/a&gt;&lt;br /&gt;2.&lt;a href="http://www.codecoffee.com/tipsforlinux/articles/21.html"&gt;http://www.codecoffee.com/tipsforlinux/articles/21.html&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7747719578100224044-269685982033783719?l=itakeitalltheway.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://itakeitalltheway.blogspot.com/feeds/269685982033783719/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://itakeitalltheway.blogspot.com/2010/05/some-commonly-used-unixlinux-commands.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7747719578100224044/posts/default/269685982033783719'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7747719578100224044/posts/default/269685982033783719'/><link rel='alternate' type='text/html' href='http://itakeitalltheway.blogspot.com/2010/05/some-commonly-used-unixlinux-commands.html' title='some commonly used unix/linux commands'/><author><name>khairil</name><uri>http://www.blogger.com/profile/03657840372834573386</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://1.bp.blogspot.com/_AP6rUce9jPQ/SiA1FHpuQKI/AAAAAAAAACc/l6bdhmwx2K4/S220/iminred1.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7747719578100224044.post-2816594518111771282</id><published>2010-05-23T18:59:00.000-07:00</published><updated>2010-09-07T02:51:13.895-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='java'/><title type='text'>Compress .ear folder as .ear compressed file</title><content type='html'>to .ear    &lt;destination dir=""&gt; &lt;br /&gt;jar -vcf ..\myearfile.ear myearfile.ear&lt;/destination&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7747719578100224044-2816594518111771282?l=itakeitalltheway.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://itakeitalltheway.blogspot.com/feeds/2816594518111771282/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://itakeitalltheway.blogspot.com/2010/05/compress-ear-folder-as-ear-compressed.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7747719578100224044/posts/default/2816594518111771282'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7747719578100224044/posts/default/2816594518111771282'/><link rel='alternate' type='text/html' href='http://itakeitalltheway.blogspot.com/2010/05/compress-ear-folder-as-ear-compressed.html' title='Compress .ear folder as .ear compressed file'/><author><name>khairil</name><uri>http://www.blogger.com/profile/03657840372834573386</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://1.bp.blogspot.com/_AP6rUce9jPQ/SiA1FHpuQKI/AAAAAAAAACc/l6bdhmwx2K4/S220/iminred1.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7747719578100224044.post-8211273988097218595</id><published>2010-05-23T18:57:00.000-07:00</published><updated>2010-08-24T21:55:07.583-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='java'/><title type='text'>java archive : from .jar to unjar to .jar again</title><content type='html'>to unjar: jar -xvf abc.jar&lt;br /&gt;to jar  : jar cf abc.jar *&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7747719578100224044-8211273988097218595?l=itakeitalltheway.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://itakeitalltheway.blogspot.com/feeds/8211273988097218595/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://itakeitalltheway.blogspot.com/2010/05/java-archive-from-jar-to-unjar-to-jar.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7747719578100224044/posts/default/8211273988097218595'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7747719578100224044/posts/default/8211273988097218595'/><link rel='alternate' type='text/html' href='http://itakeitalltheway.blogspot.com/2010/05/java-archive-from-jar-to-unjar-to-jar.html' title='java archive : from .jar to unjar to .jar again'/><author><name>khairil</name><uri>http://www.blogger.com/profile/03657840372834573386</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://1.bp.blogspot.com/_AP6rUce9jPQ/SiA1FHpuQKI/AAAAAAAAACc/l6bdhmwx2K4/S220/iminred1.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7747719578100224044.post-5274221403589963986</id><published>2010-03-07T07:34:00.000-08:00</published><updated>2010-08-24T21:56:29.544-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='windows/command shell'/><title type='text'>shortcut for running windows remote desktop</title><content type='html'>start--&gt; run--&gt; type mstsc&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7747719578100224044-5274221403589963986?l=itakeitalltheway.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://itakeitalltheway.blogspot.com/feeds/5274221403589963986/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://itakeitalltheway.blogspot.com/2010/03/shortcut-for-running-windows-remote.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7747719578100224044/posts/default/5274221403589963986'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7747719578100224044/posts/default/5274221403589963986'/><link rel='alternate' type='text/html' href='http://itakeitalltheway.blogspot.com/2010/03/shortcut-for-running-windows-remote.html' title='shortcut for running windows remote desktop'/><author><name>khairil</name><uri>http://www.blogger.com/profile/03657840372834573386</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://1.bp.blogspot.com/_AP6rUce9jPQ/SiA1FHpuQKI/AAAAAAAAACc/l6bdhmwx2K4/S220/iminred1.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7747719578100224044.post-6587392111427860007</id><published>2010-03-07T07:28:00.000-08:00</published><updated>2010-09-07T03:31:54.155-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='windows/command shell'/><category scheme='http://www.blogger.com/atom/ns#' term='oracle'/><title type='text'>windows command shell to run all sqls in a folder for oracle /sqlplus</title><content type='html'>let say u have a set of sqls to run in a folder(sql1.sql,sql2.sql,sql3.sql bla bla bla..), this script might be useful.&lt;br /&gt;&lt;br /&gt;create a batch file(open notepad, save as "runme.bat"), put command below:-&lt;br /&gt;&lt;pre name="code" class="java"&gt;&lt;br /&gt;set username=%1&lt;br /&gt;set password=%2&lt;br /&gt;set sid=%3&lt;br /&gt;for %%X in (*.sql) do (&lt;br /&gt;   echo exit | sqlplus %username%/%password%@%sid% @%%X&lt;br /&gt;)&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;serve the parameter to run it in windows command prompt, for example:-&lt;br /&gt;&lt;pre name="code" class="java"&gt;&lt;br /&gt;runme.bat mydatabase mypassword mysid&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7747719578100224044-6587392111427860007?l=itakeitalltheway.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://itakeitalltheway.blogspot.com/feeds/6587392111427860007/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://itakeitalltheway.blogspot.com/2010/03/windows-command-shell-to-run-all-sqls.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7747719578100224044/posts/default/6587392111427860007'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7747719578100224044/posts/default/6587392111427860007'/><link rel='alternate' type='text/html' href='http://itakeitalltheway.blogspot.com/2010/03/windows-command-shell-to-run-all-sqls.html' title='windows command shell to run all sqls in a folder for oracle /sqlplus'/><author><name>khairil</name><uri>http://www.blogger.com/profile/03657840372834573386</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://1.bp.blogspot.com/_AP6rUce9jPQ/SiA1FHpuQKI/AAAAAAAAACc/l6bdhmwx2K4/S220/iminred1.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7747719578100224044.post-7361966231642803347</id><published>2009-11-08T19:15:00.001-08:00</published><updated>2010-09-07T03:33:41.894-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='oracle'/><title type='text'>oracle - check cursor (connection)</title><content type='html'>&lt;pre name="code" class="sql"&gt;&lt;br /&gt;--total cursors open, by session&lt;br /&gt;select a.value, s.username, s.sid, s.serial#&lt;br /&gt;from v$sesstat a, v$statname b, v$session s&lt;br /&gt;where a.statistic# = b.statistic#  and s.sid=a.sid&lt;br /&gt;and b.name = 'opened cursors current';&lt;br /&gt;&lt;br /&gt;-- monitor cursor by machine&lt;br /&gt;SELECT s.machine, oc.user_name, oc.sql_text, count(1)&lt;br /&gt;FROM v$open_cursor oc, v$session s&lt;br /&gt;WHERE oc.sid = s.sid&lt;br /&gt;GROUP BY user_name, sql_text, machine&lt;br /&gt;HAVING COUNT(1) &gt; 2&lt;br /&gt;ORDER BY count(1) DESC&lt;br /&gt;;&lt;br /&gt;&lt;br /&gt;--total cursors open, by username &amp;amp; machine&lt;br /&gt;select sum(a.value) total_cur, avg(a.value) avg_cur, max(a.value) max_cur,&lt;br /&gt;s.username, s.machine&lt;br /&gt;from v$sesstat a, v$statname b, v$session s&lt;br /&gt;where a.statistic# = b.statistic#  and s.sid=a.sid&lt;br /&gt;and b.name = 'opened cursors current'&lt;br /&gt;group by s.username, s.machine&lt;br /&gt;order by 1 desc;&lt;br /&gt;&lt;br /&gt;-- check highest opened cursor&lt;br /&gt;select max(a.value) as highest_open_cur, p.value as max_open_cur&lt;br /&gt;from v$sesstat a, v$statname b, v$parameter p&lt;br /&gt;where a.statistic# = b.statistic#&lt;br /&gt;and b.name = 'opened cursors current'&lt;br /&gt;and p.name= 'open_cursors'&lt;br /&gt;group by p.value;&lt;br /&gt;&lt;br /&gt;--session cached cursors, by session&lt;br /&gt;select a.value, s.username, s.sid, s.serial#&lt;br /&gt;from v$sesstat a, v$statname b, v$session s&lt;br /&gt;where a.statistic# = b.statistic#  and s.sid=a.sid&lt;br /&gt;and b.name = 'session cursor cache count' ;&lt;br /&gt;&lt;br /&gt;select c.user_name, c.sid, sql.sql_text&lt;br /&gt;from v$open_cursor c, v$sql sql&lt;br /&gt;where c.sql_id=sql.sql_id  -- for 9i and earlier use: c.address=sql.address&lt;br /&gt;and c.sid=&amp;amp;sid&lt;br /&gt;;&lt;br /&gt;&lt;br /&gt;--session cached cursors, for a given SID, compared to max&lt;br /&gt;select a.value curr_cached, p.value max_cached, s.username, s.sid, s.serial#&lt;br /&gt;from v$sesstat a, v$statname b, v$session s, v$parameter2 p&lt;br /&gt;where a.statistic# = b.statistic#  and s.sid=a.sid and a.sid=&amp;amp;sid&lt;br /&gt;and p.name='session_cached_cursors'&lt;br /&gt;and b.name = 'session cursor cache count' ;&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7747719578100224044-7361966231642803347?l=itakeitalltheway.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://itakeitalltheway.blogspot.com/feeds/7361966231642803347/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://itakeitalltheway.blogspot.com/2009/11/oracle-check-cursor-connection.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7747719578100224044/posts/default/7361966231642803347'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7747719578100224044/posts/default/7361966231642803347'/><link rel='alternate' type='text/html' href='http://itakeitalltheway.blogspot.com/2009/11/oracle-check-cursor-connection.html' title='oracle - check cursor (connection)'/><author><name>khairil</name><uri>http://www.blogger.com/profile/03657840372834573386</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://1.bp.blogspot.com/_AP6rUce9jPQ/SiA1FHpuQKI/AAAAAAAAACc/l6bdhmwx2K4/S220/iminred1.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7747719578100224044.post-31819023490756997</id><published>2009-10-21T18:17:00.000-07:00</published><updated>2010-09-07T03:00:46.554-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='javascript'/><category scheme='http://www.blogger.com/atom/ns#' term='web design'/><title type='text'>maintain div scrollbar position</title><content type='html'>The key is document.getElementById("yourdiv").scrollTop&lt;br /&gt;&lt;pre name="code" class="javascript"&gt;&lt;br /&gt;function getScrollXY() {&lt;br /&gt;   document.getElementById("scroll_position").value = document.getElementById("screenDiv").scrollTop;&lt;br /&gt;}         &lt;br /&gt;function setScrollXY() {&lt;br /&gt;   var pos = document.getElementById("scroll_position").value;&lt;br /&gt;   var objDiv = document.getElementById("screenDiv");&lt;br /&gt;   objDiv.scrollTop = parseInt(pos);&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7747719578100224044-31819023490756997?l=itakeitalltheway.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://itakeitalltheway.blogspot.com/feeds/31819023490756997/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://itakeitalltheway.blogspot.com/2009/10/maintain-div-scrollbar-position.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7747719578100224044/posts/default/31819023490756997'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7747719578100224044/posts/default/31819023490756997'/><link rel='alternate' type='text/html' href='http://itakeitalltheway.blogspot.com/2009/10/maintain-div-scrollbar-position.html' title='maintain div scrollbar position'/><author><name>khairil</name><uri>http://www.blogger.com/profile/03657840372834573386</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://1.bp.blogspot.com/_AP6rUce9jPQ/SiA1FHpuQKI/AAAAAAAAACc/l6bdhmwx2K4/S220/iminred1.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7747719578100224044.post-3655766016525570733</id><published>2009-08-04T19:44:00.000-07:00</published><updated>2010-09-07T03:03:17.318-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='javascript'/><title type='text'>detect if javascript function exist</title><content type='html'>&lt;pre name="code" class="javascript"&gt;&lt;br /&gt;function loadLaunchProp() {&lt;br /&gt;}&lt;br /&gt;if( window.loadLaunchProp ) {&lt;br /&gt;   loadLaunchProp();&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7747719578100224044-3655766016525570733?l=itakeitalltheway.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://itakeitalltheway.blogspot.com/feeds/3655766016525570733/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://itakeitalltheway.blogspot.com/2009/08/detect-if-javascript-function-exist.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7747719578100224044/posts/default/3655766016525570733'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7747719578100224044/posts/default/3655766016525570733'/><link rel='alternate' type='text/html' href='http://itakeitalltheway.blogspot.com/2009/08/detect-if-javascript-function-exist.html' title='detect if javascript function exist'/><author><name>khairil</name><uri>http://www.blogger.com/profile/03657840372834573386</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://1.bp.blogspot.com/_AP6rUce9jPQ/SiA1FHpuQKI/AAAAAAAAACc/l6bdhmwx2K4/S220/iminred1.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7747719578100224044.post-5718969907338806829</id><published>2009-06-17T21:12:00.000-07:00</published><updated>2010-09-07T03:28:23.628-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='jquery'/><title type='text'>jquery : html encode - decode</title><content type='html'>&lt;div style=""&gt;&lt;span class="Apple-style-span" style=";font-family:Helvetica,Arial;font-size:13px;"  &gt;&lt;pre&gt;&lt;span class="Apple-style-span" style="white-space: normal;font-family:Georgia,serif;font-size:16px;"  &gt;source : &lt;a href="http://www.edentity.ca/WhoWeAre/Blog/Easy-Client-Side-html-EncodeDecode-using-jQuery.aspx"&gt;http://www.edentity.ca/WhoWeAre/Blog/Easy-Client-Side-html-EncodeDecode-using-jQuery.aspx&lt;/a&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span class="Apple-style-span" style="white-space: normal;font-family:Georgia,serif;font-size:16px;"  &gt;&lt;a href="http://www.edentity.ca/WhoWeAre/Blog/Easy-Client-Side-html-EncodeDecode-using-jQuery.aspx"&gt;&lt;/a&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="white-space: normal;font-family:Georgia,serif;font-size:16px;"  &gt;more on xss attack : &lt;a href="http://www.ibm.com/developerworks/web/library/wa-secxss/"&gt;http://www.ibm.com/developerworks/web/library/wa-secxss/&lt;/a&gt;&lt;/span&gt;&lt;/pre&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7747719578100224044-5718969907338806829?l=itakeitalltheway.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://itakeitalltheway.blogspot.com/feeds/5718969907338806829/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://itakeitalltheway.blogspot.com/2009/06/javascript-encode-string-to-prevent-xss.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7747719578100224044/posts/default/5718969907338806829'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7747719578100224044/posts/default/5718969907338806829'/><link rel='alternate' type='text/html' href='http://itakeitalltheway.blogspot.com/2009/06/javascript-encode-string-to-prevent-xss.html' title='jquery : html encode - decode'/><author><name>khairil</name><uri>http://www.blogger.com/profile/03657840372834573386</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://1.bp.blogspot.com/_AP6rUce9jPQ/SiA1FHpuQKI/AAAAAAAAACc/l6bdhmwx2K4/S220/iminred1.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7747719578100224044.post-2107350528382323155</id><published>2009-06-10T18:56:00.000-07:00</published><updated>2010-08-24T22:05:12.201-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='web design'/><title type='text'>Free xhtml/css templates for WEB DESIGN and stuffs</title><content type='html'>some links:&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.templateworld.com/free_templates_2_5_0.html"&gt;http://www.templateworld.com/free_templates_2_5_0.html&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.csstemplatesweb.com/tag/web-20/"&gt;http://www.csstemplatesweb.com/tag/web-20/&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7747719578100224044-2107350528382323155?l=itakeitalltheway.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://itakeitalltheway.blogspot.com/feeds/2107350528382323155/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://itakeitalltheway.blogspot.com/2009/06/free-xhtmlcss-templates-for-web-design.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7747719578100224044/posts/default/2107350528382323155'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7747719578100224044/posts/default/2107350528382323155'/><link rel='alternate' type='text/html' href='http://itakeitalltheway.blogspot.com/2009/06/free-xhtmlcss-templates-for-web-design.html' title='Free xhtml/css templates for WEB DESIGN and stuffs'/><author><name>khairil</name><uri>http://www.blogger.com/profile/03657840372834573386</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://1.bp.blogspot.com/_AP6rUce9jPQ/SiA1FHpuQKI/AAAAAAAAACc/l6bdhmwx2K4/S220/iminred1.jpg'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7747719578100224044.post-5578006335657757968</id><published>2009-06-10T18:52:00.000-07:00</published><updated>2010-08-24T22:06:09.314-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='javascript'/><title type='text'>docking box</title><content type='html'>a good javascript library for creating docking box&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.brothercake.com/site/resources/scripts/dbx/"&gt;http://www.brothercake.com/site/resources/scripts/dbx/&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7747719578100224044-5578006335657757968?l=itakeitalltheway.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://itakeitalltheway.blogspot.com/feeds/5578006335657757968/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://itakeitalltheway.blogspot.com/2009/06/docking-box.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7747719578100224044/posts/default/5578006335657757968'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7747719578100224044/posts/default/5578006335657757968'/><link rel='alternate' type='text/html' href='http://itakeitalltheway.blogspot.com/2009/06/docking-box.html' title='docking box'/><author><name>khairil</name><uri>http://www.blogger.com/profile/03657840372834573386</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://1.bp.blogspot.com/_AP6rUce9jPQ/SiA1FHpuQKI/AAAAAAAAACc/l6bdhmwx2K4/S220/iminred1.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7747719578100224044.post-5952799565426201934</id><published>2009-06-02T19:54:00.000-07:00</published><updated>2010-09-07T03:08:15.709-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='javascript'/><title type='text'>javascript - moving tool tip</title><content type='html'>basic &amp; simple code that I use to do moving tool tip.&lt;br /&gt;1.javascript:&lt;br /&gt;&lt;pre name="code" class="javascript"&gt;&lt;br /&gt;&lt;script type="text/javascript"&gt;&lt;br /&gt;function test(obj) {&lt;br /&gt;   document.getElementById("d1").style.top=&lt;br /&gt;      obj.offsetTop+25;&lt;br /&gt;   document.getElementById("d1").style.left=&lt;br /&gt;      obj.offsetLeft+25;&lt;br /&gt;}&lt;br /&gt;&lt;/script&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;2.html:&lt;br /&gt;&lt;pre name="code" class="html"&gt;&lt;br /&gt;&lt;div id="d1" style="position:absolute;border:1px solid black"&gt;&lt;br /&gt;   Hello World&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;span id="sp1" onclick="test(this)"&gt;Span 1&lt;/span&gt;&lt;br&gt;&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7747719578100224044-5952799565426201934?l=itakeitalltheway.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://itakeitalltheway.blogspot.com/feeds/5952799565426201934/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://itakeitalltheway.blogspot.com/2009/06/javascript-moving-tool-tip.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7747719578100224044/posts/default/5952799565426201934'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7747719578100224044/posts/default/5952799565426201934'/><link rel='alternate' type='text/html' href='http://itakeitalltheway.blogspot.com/2009/06/javascript-moving-tool-tip.html' title='javascript - moving tool tip'/><author><name>khairil</name><uri>http://www.blogger.com/profile/03657840372834573386</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://1.bp.blogspot.com/_AP6rUce9jPQ/SiA1FHpuQKI/AAAAAAAAACc/l6bdhmwx2K4/S220/iminred1.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7747719578100224044.post-801721346910038288</id><published>2009-06-02T03:13:00.000-07:00</published><updated>2010-09-07T03:11:11.582-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='javascript'/><title type='text'>reload browser ONLY once</title><content type='html'>Sometimes there's a need to reload a browser only once. This works in IE and FF.&lt;br /&gt;&lt;pre name="code" class="javascript"&gt;&lt;br /&gt;//  Published at: scripts.tropicalpcsolutions.com&lt;br /&gt;var reloaded = false;&lt;br /&gt;var loc=""+document.location;&lt;br /&gt;loc = loc.indexOf("?reloaded=")!=&lt;br /&gt;   -1?loc.substring(loc.indexOf("?reloaded=")+&lt;br /&gt;   10,loc.length):"";&lt;br /&gt;loc = loc.indexOf("&amp;")!=-1?loc.substring(0,loc.indexOf("&amp;")):loc;&lt;br /&gt;reloaded = loc!=""?(loc=="true"):reloaded;&lt;br /&gt;&lt;br /&gt;function reloadOnceOnly() {&lt;br /&gt;    if (!reloaded) &lt;br /&gt;        window.location.replace(&lt;br /&gt;           window.location+"?reloaded=true");&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;//You can call this via the body tag if desired&lt;br /&gt;reloadOnceOnly();&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7747719578100224044-801721346910038288?l=itakeitalltheway.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://itakeitalltheway.blogspot.com/feeds/801721346910038288/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://itakeitalltheway.blogspot.com/2009/06/reload-browser-once.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7747719578100224044/posts/default/801721346910038288'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7747719578100224044/posts/default/801721346910038288'/><link rel='alternate' type='text/html' href='http://itakeitalltheway.blogspot.com/2009/06/reload-browser-once.html' title='reload browser ONLY once'/><author><name>khairil</name><uri>http://www.blogger.com/profile/03657840372834573386</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://1.bp.blogspot.com/_AP6rUce9jPQ/SiA1FHpuQKI/AAAAAAAAACc/l6bdhmwx2K4/S220/iminred1.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7747719578100224044.post-7649235046316944037</id><published>2009-06-01T05:56:00.000-07:00</published><updated>2010-09-07T03:12:48.368-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='javascript'/><title type='text'>IE:fixing innerHTML - ajax callback</title><content type='html'>innerHTML can cause some problems, particularly in Internet Explorer. If you use innerHTML to add or update form elements, all sorts of screwiness can occur. Sometimes the data from the newly added elements won’t be included when the form is submitted to the server. This is a solution that works in IE: &lt;br /&gt;&lt;pre name="code" class="javascript"&gt;&lt;br /&gt;var newdiv = document.createElement("div");&lt;br /&gt;newdiv.innerHTML = xhr.responseText;&lt;br /&gt;var container = document.getElementById("container");&lt;br /&gt;container.appendChild(newdiv);&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7747719578100224044-7649235046316944037?l=itakeitalltheway.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://itakeitalltheway.blogspot.com/feeds/7649235046316944037/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://itakeitalltheway.blogspot.com/2009/06/fixing-innerhtml-ajax-callback.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7747719578100224044/posts/default/7649235046316944037'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7747719578100224044/posts/default/7649235046316944037'/><link rel='alternate' type='text/html' href='http://itakeitalltheway.blogspot.com/2009/06/fixing-innerhtml-ajax-callback.html' title='IE:fixing innerHTML - ajax callback'/><author><name>khairil</name><uri>http://www.blogger.com/profile/03657840372834573386</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://1.bp.blogspot.com/_AP6rUce9jPQ/SiA1FHpuQKI/AAAAAAAAACc/l6bdhmwx2K4/S220/iminred1.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7747719578100224044.post-7044439278209856546</id><published>2009-05-31T21:50:00.000-07:00</published><updated>2010-09-07T03:15:40.046-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='javascript'/><category scheme='http://www.blogger.com/atom/ns#' term='regex'/><title type='text'>regular expressions in javascript</title><content type='html'>various functions to validate or format string in Javascript.&lt;br /&gt;&lt;pre name="code" class="javascript"&gt;&lt;br /&gt;/********************************************&lt;br /&gt;FILE: RegExpValidate.js&lt;br /&gt;&lt;br /&gt;DESCRIPTION: This file contains a library of validation functions using javascript regular expressions. Library also contains functions that reformat fields for display or for storage.&lt;br /&gt;&lt;br /&gt;  VALIDATION FUNCTIONS:&lt;br /&gt;&lt;br /&gt;  validateEmail - checks format of email address&lt;br /&gt;  validateUSPhone - checks format of US phone number&lt;br /&gt;  validateNumeric - checks for valid numeric value&lt;br /&gt;  validateInteger - checks for valid integer value&lt;br /&gt;  validateNotEmpty - checks for blank form field&lt;br /&gt;  validateUSZip - checks for valid US zip code&lt;br /&gt;  validateUSDate - checks for valid date in US format&lt;br /&gt;  validateValue - checks a string against supplied pattern&lt;br /&gt;&lt;br /&gt;  FORMAT FUNCTIONS:&lt;br /&gt;&lt;br /&gt;  rightTrim - removes trailing spaces from a string&lt;br /&gt;  leftTrim - removes leading spaces from a string&lt;br /&gt;  trimAll - removes leading and trailing spaces from a string&lt;br /&gt;  removeCurrency - removes currency formatting characters (), $&lt;br /&gt;  addCurrency - inserts currency formatting characters&lt;br /&gt;  removeCommas - removes comma separators from a number&lt;br /&gt;  addCommas - adds comma separators to a number&lt;br /&gt;  removeCharacters - removes characters from a string that match &lt;br /&gt;  passed pattern&lt;br /&gt;&lt;br /&gt;AUTHOR: Karen Gayda&lt;br /&gt;&lt;br /&gt;DATE: 03/24/2000&lt;br /&gt;*************************************************/&lt;br /&gt;&lt;br /&gt;function validateEmail( strValue) {&lt;br /&gt;/************************************************&lt;br /&gt;DESCRIPTION: Validates that a string contains a&lt;br /&gt;  valid email pattern.&lt;br /&gt;&lt;br /&gt; PARAMETERS:&lt;br /&gt;   strValue - String to be tested for validity&lt;br /&gt;&lt;br /&gt;RETURNS:&lt;br /&gt;   True if valid, otherwise false.&lt;br /&gt;&lt;br /&gt;REMARKS: Accounts for email with country appended&lt;br /&gt;  does not validate that email contains valid URL&lt;br /&gt;  type (.com, .gov, etc.) or valid country suffix.&lt;br /&gt;*************************************************/&lt;br /&gt;var objRegExp  =&lt;br /&gt; /(^[a-z]([a-z_\.]*)@([a-z_\.]*)([.][a-z]{3})$)|(^[a-z]([a-z_\.]*)@&lt;br /&gt;  ([a-z_\.]*)(\.[a-z]{3})(\.[a-z]{2})*$)/i;&lt;br /&gt;&lt;br /&gt;  //check for valid email&lt;br /&gt;  return objRegExp.test(strValue);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;function validateUSPhone( strValue ) {&lt;br /&gt;/************************************************&lt;br /&gt;DESCRIPTION: Validates that a string contains valid&lt;br /&gt;  US phone pattern.&lt;br /&gt;  Ex. (999) 999-9999 or (999)999-9999&lt;br /&gt;&lt;br /&gt;PARAMETERS:&lt;br /&gt;   strValue - String to be tested for validity&lt;br /&gt;&lt;br /&gt;RETURNS:&lt;br /&gt;   True if valid, otherwise false.&lt;br /&gt;*************************************************/&lt;br /&gt;  var objRegExp  = /^\([1-9]\d{2}\)\s?\d{3}\-\d{4}$/;&lt;br /&gt;&lt;br /&gt;  //check for valid us phone with or without space between&lt;br /&gt;  //area code&lt;br /&gt;  return objRegExp.test(strValue);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;function  validateNumeric( strValue ) {&lt;br /&gt;/***********************************************&lt;br /&gt;DESCRIPTION: Validates that a string contains only valid numbers.&lt;br /&gt;&lt;br /&gt;PARAMETERS:&lt;br /&gt;   strValue - String to be tested for validity&lt;br /&gt;&lt;br /&gt;RETURNS:&lt;br /&gt;   True if valid, otherwise false.&lt;br /&gt;************************************************/&lt;br /&gt;  var objRegExp  =  /(^-?\d\d*\.\d*$)|(^-?\d\d*$)|(^-?\.\d\d*$)/;&lt;br /&gt;&lt;br /&gt;  //check for numeric characters&lt;br /&gt;  return objRegExp.test(strValue);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;function validateInteger( strValue ) {&lt;br /&gt;/************************************************&lt;br /&gt;DESCRIPTION: Validates that a string contains only&lt;br /&gt;    valid integer number.&lt;br /&gt;&lt;br /&gt;PARAMETERS:&lt;br /&gt;   strValue - String to be tested for validity&lt;br /&gt;&lt;br /&gt;RETURNS:&lt;br /&gt;   True if valid, otherwise false.&lt;br /&gt;**************************************************/&lt;br /&gt;  var objRegExp  = /(^-?\d\d*$)/;&lt;br /&gt;&lt;br /&gt;  //check for integer characters&lt;br /&gt;  return objRegExp.test(strValue);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;function validateNotEmpty( strValue ) {&lt;br /&gt;/************************************************&lt;br /&gt;DESCRIPTION: Validates that a string is not all&lt;br /&gt;  blank (whitespace) characters.&lt;br /&gt;&lt;br /&gt;PARAMETERS:&lt;br /&gt;   strValue - String to be tested for validity&lt;br /&gt;&lt;br /&gt;RETURNS:&lt;br /&gt;   True if valid, otherwise false.&lt;br /&gt;*************************************************/&lt;br /&gt;   var strTemp = strValue;&lt;br /&gt;   strTemp = trimAll(strTemp);&lt;br /&gt;   if(strTemp.length &gt; 0){&lt;br /&gt;     return true;&lt;br /&gt;   }&lt;br /&gt;   return false;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;function validateUSZip( strValue ) {&lt;br /&gt;/************************************************&lt;br /&gt;DESCRIPTION: Validates that a string a United&lt;br /&gt;  States zip code in 5 digit format or zip+4&lt;br /&gt;  format. 99999 or 99999-9999&lt;br /&gt;&lt;br /&gt;PARAMETERS:&lt;br /&gt;   strValue - String to be tested for validity&lt;br /&gt;&lt;br /&gt;RETURNS:&lt;br /&gt;   True if valid, otherwise false.&lt;br /&gt;&lt;br /&gt;*************************************************/&lt;br /&gt;var objRegExp  = /(^\d{5}$)|(^\d{5}-\d{4}$)/;&lt;br /&gt;&lt;br /&gt;  //check for valid US Zipcode&lt;br /&gt;  return objRegExp.test(strValue);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;function validateUSDate( strValue ) {&lt;br /&gt;/************************************************&lt;br /&gt;DESCRIPTION: Validates that a string contains only&lt;br /&gt;    valid dates with 2 digit month, 2 digit day,&lt;br /&gt;    4 digit year. Date separator can be ., -, or /.&lt;br /&gt;    Uses combination of regular expressions and&lt;br /&gt;    string parsing to validate date.&lt;br /&gt;    Ex. mm/dd/yyyy or mm-dd-yyyy or mm.dd.yyyy&lt;br /&gt;&lt;br /&gt;PARAMETERS:&lt;br /&gt;   strValue - String to be tested for validity&lt;br /&gt;&lt;br /&gt;RETURNS:&lt;br /&gt;   True if valid, otherwise false.&lt;br /&gt;&lt;br /&gt;REMARKS:&lt;br /&gt;   Avoids some of the limitations of the Date.parse()&lt;br /&gt;   method such as the date separator character.&lt;br /&gt;*************************************************/&lt;br /&gt;  var objRegExp = /^\d{1,2}(\-|\/|\.)\d{1,2}\1\d{4}$/&lt;br /&gt; &lt;br /&gt;  //check to see if in correct format&lt;br /&gt;  if(!objRegExp.test(strValue))&lt;br /&gt;    return false; //doesn't match pattern, bad date&lt;br /&gt;  else{&lt;br /&gt;    var strSeparator = strValue.substring(2,3) &lt;br /&gt;    var arrayDate = strValue.split(strSeparator); &lt;br /&gt;    //create a lookup for months not equal to Feb.&lt;br /&gt;    var arrayLookup = { '01' : 31,'03' : 31, &lt;br /&gt;                        '04' : 30,'05' : 31,&lt;br /&gt;                        '06' : 30,'07' : 31,&lt;br /&gt;                        '08' : 31,'09' : 30,&lt;br /&gt;                        '10' : 31,'11' : 30,'12' : 31}&lt;br /&gt;    var intDay = parseInt(arrayDate[1],10); &lt;br /&gt;&lt;br /&gt;    //check if month value and day value agree&lt;br /&gt;    if(arrayLookup[arrayDate[0]] != null) {&lt;br /&gt;      if(intDay &lt;= arrayLookup[arrayDate[0]] &amp;&amp; intDay != 0)&lt;br /&gt;        return true; //found in lookup table, good date&lt;br /&gt;    }&lt;br /&gt;    &lt;br /&gt;    //check for February (bugfix 20050322)&lt;br /&gt;    //bugfix  for parseInt kevin&lt;br /&gt;    //bugfix  biss year  O.Jp Voutat&lt;br /&gt;    var intMonth = parseInt(arrayDate[0],10);&lt;br /&gt;    if (intMonth == 2) { &lt;br /&gt;       var intYear = parseInt(arrayDate[2]);&lt;br /&gt;       if (intDay &gt; 0 &amp;&amp; intDay &lt; 29) {&lt;br /&gt;           return true;&lt;br /&gt;       }&lt;br /&gt;       else if (intDay == 29) {&lt;br /&gt;         if ((intYear % 4 == 0) &amp;&amp; (intYear % 100 != 0) || &lt;br /&gt;             (intYear % 400 == 0)) {&lt;br /&gt;              // year div by 4 and ((not div by 100) or div by 400) -&gt;ok&lt;br /&gt;             return true;&lt;br /&gt;         }   &lt;br /&gt;       }&lt;br /&gt;    }&lt;br /&gt;  }  &lt;br /&gt;  return false; //any other values, bad date&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;function validateValue( strValue, strMatchPattern ) {&lt;br /&gt;/************************************************&lt;br /&gt;DESCRIPTION: Validates that a string a matches&lt;br /&gt;  a valid regular expression value.&lt;br /&gt;&lt;br /&gt;PARAMETERS:&lt;br /&gt;   strValue - String to be tested for validity&lt;br /&gt;   strMatchPattern - String containing a valid&lt;br /&gt;      regular expression match pattern.&lt;br /&gt;&lt;br /&gt;RETURNS:&lt;br /&gt;   True if valid, otherwise false.&lt;br /&gt;*************************************************/&lt;br /&gt;var objRegExp = new RegExp( strMatchPattern);&lt;br /&gt;&lt;br /&gt; //check if string matches pattern&lt;br /&gt; return objRegExp.test(strValue);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;function rightTrim( strValue ) {&lt;br /&gt;/************************************************&lt;br /&gt;DESCRIPTION: Trims trailing whitespace chars.&lt;br /&gt;&lt;br /&gt;PARAMETERS:&lt;br /&gt;   strValue - String to be trimmed.&lt;br /&gt;&lt;br /&gt;RETURNS:&lt;br /&gt;   Source string with right whitespaces removed.&lt;br /&gt;*************************************************/&lt;br /&gt;var objRegExp = /^([\w\W]*)(\b\s*)$/;&lt;br /&gt;&lt;br /&gt;      if(objRegExp.test(strValue)) {&lt;br /&gt;       //remove trailing a whitespace characters&lt;br /&gt;       strValue = strValue.replace(objRegExp, '$1');&lt;br /&gt;    }&lt;br /&gt;  return strValue;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;function leftTrim( strValue ) {&lt;br /&gt;/************************************************&lt;br /&gt;DESCRIPTION: Trims leading whitespace chars.&lt;br /&gt;&lt;br /&gt;PARAMETERS:&lt;br /&gt;   strValue - String to be trimmed&lt;br /&gt;&lt;br /&gt;RETURNS:&lt;br /&gt;   Source string with left whitespaces removed.&lt;br /&gt;*************************************************/&lt;br /&gt;var objRegExp = /^(\s*)(\b[\w\W]*)$/;&lt;br /&gt;&lt;br /&gt;      if(objRegExp.test(strValue)) {&lt;br /&gt;       //remove leading a whitespace characters&lt;br /&gt;       strValue = strValue.replace(objRegExp, '$2');&lt;br /&gt;    }&lt;br /&gt;  return strValue;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;function trimAll( strValue ) {&lt;br /&gt;/************************************************&lt;br /&gt;DESCRIPTION: Removes leading and trailing spaces.&lt;br /&gt;&lt;br /&gt;PARAMETERS: Source string from which spaces will&lt;br /&gt;  be removed;&lt;br /&gt;&lt;br /&gt;RETURNS: Source string with whitespaces removed.&lt;br /&gt;*************************************************/&lt;br /&gt; var objRegExp = /^(\s*)$/;&lt;br /&gt;&lt;br /&gt;    //check for all spaces&lt;br /&gt;    if(objRegExp.test(strValue)) {&lt;br /&gt;       strValue = strValue.replace(objRegExp, '');&lt;br /&gt;       if( strValue.length == 0)&lt;br /&gt;          return strValue;&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;   //check for leading &amp; trailing spaces&lt;br /&gt;   objRegExp = /^(\s*)([\W\w]*)(\b\s*$)/;&lt;br /&gt;   if(objRegExp.test(strValue)) {&lt;br /&gt;       //remove leading and trailing whitespace characters&lt;br /&gt;       strValue = strValue.replace(objRegExp, '$2');&lt;br /&gt;    }&lt;br /&gt;  return strValue;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;function removeCurrency( strValue ) {&lt;br /&gt;/************************************************&lt;br /&gt;DESCRIPTION: Removes currency formatting from&lt;br /&gt;  source string.&lt;br /&gt;&lt;br /&gt;PARAMETERS:&lt;br /&gt;  strValue - Source string from which currency formatting&lt;br /&gt;     will be removed;&lt;br /&gt;&lt;br /&gt;RETURNS: Source string with commas removed.&lt;br /&gt;*************************************************/&lt;br /&gt;  var objRegExp = /\(/;&lt;br /&gt;  var strMinus = '';&lt;br /&gt;&lt;br /&gt;  //check if negative&lt;br /&gt;  if(objRegExp.test(strValue)){&lt;br /&gt;    strMinus = '-';&lt;br /&gt;  }&lt;br /&gt;&lt;br /&gt;  objRegExp = /\)|\(|[,]/g;&lt;br /&gt;  strValue = strValue.replace(objRegExp,'');&lt;br /&gt;  if(strValue.indexOf('$') &gt;= 0){&lt;br /&gt;    strValue = strValue.substring(1, strValue.length);&lt;br /&gt;  }&lt;br /&gt;  return strMinus + strValue;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;function addCurrency( strValue ) {&lt;br /&gt;/************************************************&lt;br /&gt;DESCRIPTION: Formats a number as currency.&lt;br /&gt;&lt;br /&gt;PARAMETERS:&lt;br /&gt;  strValue - Source string to be formatted&lt;br /&gt;&lt;br /&gt;REMARKS: Assumes number passed is a valid&lt;br /&gt;  numeric value in the rounded to 2 decimal&lt;br /&gt;  places.  If not, returns original value.&lt;br /&gt;*************************************************/&lt;br /&gt;  var objRegExp = /-?[0-9]+\.[0-9]{2}$/;&lt;br /&gt;&lt;br /&gt;    if( objRegExp.test(strValue)) {&lt;br /&gt;      objRegExp.compile('^-');&lt;br /&gt;      strValue = addCommas(strValue);&lt;br /&gt;      if (objRegExp.test(strValue)){&lt;br /&gt;        strValue = '(' + strValue.replace(objRegExp,'') + ')';&lt;br /&gt;      }&lt;br /&gt;      return '$' + strValue;&lt;br /&gt;    }&lt;br /&gt;    else&lt;br /&gt;      return strValue;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;function removeCommas( strValue ) {&lt;br /&gt;/************************************************&lt;br /&gt;DESCRIPTION: Removes commas from source string.&lt;br /&gt;&lt;br /&gt;PARAMETERS:&lt;br /&gt;  strValue - Source string from which commas will&lt;br /&gt;    be removed;&lt;br /&gt;&lt;br /&gt;RETURNS: Source string with commas removed.&lt;br /&gt;*************************************************/&lt;br /&gt;  var objRegExp = /,/g; //search for commas globally&lt;br /&gt;&lt;br /&gt;  //replace all matches with empty strings&lt;br /&gt;  return strValue.replace(objRegExp,'');&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;function addCommas( strValue ) {&lt;br /&gt;/************************************************&lt;br /&gt;DESCRIPTION: Inserts commas into numeric string.&lt;br /&gt;&lt;br /&gt;PARAMETERS:&lt;br /&gt;  strValue - source string containing commas.&lt;br /&gt;&lt;br /&gt;RETURNS: String modified with comma grouping if&lt;br /&gt;  source was all numeric, otherwise source is&lt;br /&gt;  returned.&lt;br /&gt;&lt;br /&gt;REMARKS: Used with integers or numbers with&lt;br /&gt;  2 or less decimal places.&lt;br /&gt;*************************************************/&lt;br /&gt;  var objRegExp  = new RegExp('(-?[0-9]+)([0-9]{3})');&lt;br /&gt;&lt;br /&gt;    //check for match to search criteria&lt;br /&gt;    while(objRegExp.test(strValue)) {&lt;br /&gt;       //replace original string with first group match,&lt;br /&gt;       //a comma, then second group match&lt;br /&gt;       strValue = strValue.replace(objRegExp, '$1,$2');&lt;br /&gt;    }&lt;br /&gt;  return strValue;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;function removeCharacters( strValue, strMatchPattern ) {&lt;br /&gt;/************************************************&lt;br /&gt;DESCRIPTION: Removes characters from a source string&lt;br /&gt;  based upon matches of the supplied pattern.&lt;br /&gt;&lt;br /&gt;PARAMETERS:&lt;br /&gt;  strValue - source string containing number.&lt;br /&gt;&lt;br /&gt;RETURNS: String modified with characters&lt;br /&gt;  matching search pattern removed&lt;br /&gt;&lt;br /&gt;USAGE:  strNoSpaces = removeCharacters( ' sfdf  dfd',&lt;br /&gt;                                '\s*')&lt;br /&gt;*************************************************/&lt;br /&gt; var objRegExp =  new RegExp( strMatchPattern, 'gi' );&lt;br /&gt;&lt;br /&gt; //replace passed pattern matches with blanks&lt;br /&gt;  return strValue.replace(objRegExp,'');&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7747719578100224044-7044439278209856546?l=itakeitalltheway.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://itakeitalltheway.blogspot.com/feeds/7044439278209856546/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://itakeitalltheway.blogspot.com/2009/05/regular-expressions-in-javascript.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7747719578100224044/posts/default/7044439278209856546'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7747719578100224044/posts/default/7044439278209856546'/><link rel='alternate' type='text/html' href='http://itakeitalltheway.blogspot.com/2009/05/regular-expressions-in-javascript.html' title='regular expressions in javascript'/><author><name>khairil</name><uri>http://www.blogger.com/profile/03657840372834573386</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://1.bp.blogspot.com/_AP6rUce9jPQ/SiA1FHpuQKI/AAAAAAAAACc/l6bdhmwx2K4/S220/iminred1.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7747719578100224044.post-5224586722390225670</id><published>2009-05-31T21:23:00.000-07:00</published><updated>2010-09-07T03:17:40.279-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='javascript'/><title type='text'>initiate onclick event for FF and IE</title><content type='html'>sometimes there's a need to initiate an event.This perfectly works if FF doesn't work with event function such as .click().&lt;br /&gt;&lt;pre name="code" class="javascript"&gt;&lt;br /&gt;function fireEvent(obj,evt) { &lt;br /&gt;   var fireOnThis = obj;&lt;br /&gt;   if( document.createEvent ) {&lt;br /&gt;      var evObj = document.createEvent('MouseEvents');&lt;br /&gt;      evObj.initEvent( evt, true, false );&lt;br /&gt;      fireOnThis.dispatchEvent(evObj);&lt;br /&gt;   } else if( document.createEventObject ) {&lt;br /&gt;      fireOnThis.fireEvent('on'+evt);&lt;br /&gt;   }&lt;br /&gt;}&lt;br /&gt;function initiateEventCall(id) {&lt;br /&gt;   if(navigator.appName == 'Microsoft Internet Explorer') {&lt;br /&gt;      document.getElementById(id).click();&lt;br /&gt;   } else {&lt;br /&gt;      fireEvent(document.getElementById(id),'click');&lt;br /&gt;   }&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7747719578100224044-5224586722390225670?l=itakeitalltheway.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://itakeitalltheway.blogspot.com/feeds/5224586722390225670/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://itakeitalltheway.blogspot.com/2009/05/initiate-onclick-event-for-ff-and-ie.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7747719578100224044/posts/default/5224586722390225670'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7747719578100224044/posts/default/5224586722390225670'/><link rel='alternate' type='text/html' href='http://itakeitalltheway.blogspot.com/2009/05/initiate-onclick-event-for-ff-and-ie.html' title='initiate onclick event for FF and IE'/><author><name>khairil</name><uri>http://www.blogger.com/profile/03657840372834573386</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://1.bp.blogspot.com/_AP6rUce9jPQ/SiA1FHpuQKI/AAAAAAAAACc/l6bdhmwx2K4/S220/iminred1.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7747719578100224044.post-1081966191350726685</id><published>2009-05-28T20:21:00.000-07:00</published><updated>2010-09-07T03:19:28.712-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='javascript'/><title type='text'>js date validation</title><content type='html'>this is a simple date validation that uses regular expression as a&lt;br /&gt;validator.Otherwise we'll end up writing a long math function to&lt;br /&gt;validate a date.&lt;br /&gt;&lt;br /&gt;this code only validates mm/dd/yyyy format but it should be easy to be modified to support other formats.&lt;br /&gt;&lt;pre name="code" class="javascript"&gt;&lt;br /&gt;function isDate(sDate) {&lt;br /&gt;   var re = /^\d{1,2}\/\d{1,2}\/\d{4}$/;&lt;br /&gt;   if (re.test(sDate)) {&lt;br /&gt;      var dArr = sDate.split("/");&lt;br /&gt;      var d = new Date(sDate);&lt;br /&gt;      return d.getMonth() + 1 == dArr[0] &amp;&amp; d.getDate() == dArr[1] &amp;&amp; d.getFullYear() == dArr[2];&lt;br /&gt;   }&lt;br /&gt;   else {&lt;br /&gt;      return false;&lt;br /&gt;   }&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;reference : &lt;a href="http://www.codingforums.com/showthread.php?t=14325"&gt;codingforums.com&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7747719578100224044-1081966191350726685?l=itakeitalltheway.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://itakeitalltheway.blogspot.com/feeds/1081966191350726685/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://itakeitalltheway.blogspot.com/2009/05/js-date-validation.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7747719578100224044/posts/default/1081966191350726685'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7747719578100224044/posts/default/1081966191350726685'/><link rel='alternate' type='text/html' href='http://itakeitalltheway.blogspot.com/2009/05/js-date-validation.html' title='js date validation'/><author><name>khairil</name><uri>http://www.blogger.com/profile/03657840372834573386</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://1.bp.blogspot.com/_AP6rUce9jPQ/SiA1FHpuQKI/AAAAAAAAACc/l6bdhmwx2K4/S220/iminred1.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7747719578100224044.post-3050982623220107232</id><published>2009-05-28T19:28:00.001-07:00</published><updated>2010-09-07T02:49:01.327-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='web design'/><category scheme='http://www.blogger.com/atom/ns#' term='css'/><title type='text'>centralize a div</title><content type='html'>easy way to centralize a div.&lt;br /&gt;&lt;pre name="code" class="css"&gt;&lt;br /&gt;margin-left: auto ;&lt;br /&gt;margin-right: auto ;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;bind the above css code to your div.&lt;br /&gt;&lt;br /&gt;if u want things inside the div to be centralized, just add another css :&lt;br /&gt;&lt;pre name="code" class="css"&gt;&lt;br /&gt;text-align:center;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;put below's code just before &amp;lt;html&amp;gt; markup to apply xhtml. This is important or it will not work.&lt;br /&gt;&lt;pre name="code" class="xhtml"&gt;&lt;br /&gt;&amp;lt;!DOCTYPE html PUBLIC&lt;br /&gt;"-//W3C//DTD XHTML 1.0 Transitional//EN"&lt;br /&gt;"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&amp;gt;&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7747719578100224044-3050982623220107232?l=itakeitalltheway.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://itakeitalltheway.blogspot.com/feeds/3050982623220107232/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://itakeitalltheway.blogspot.com/2009/05/aa.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7747719578100224044/posts/default/3050982623220107232'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7747719578100224044/posts/default/3050982623220107232'/><link rel='alternate' type='text/html' href='http://itakeitalltheway.blogspot.com/2009/05/aa.html' title='centralize a div'/><author><name>khairil</name><uri>http://www.blogger.com/profile/03657840372834573386</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://1.bp.blogspot.com/_AP6rUce9jPQ/SiA1FHpuQKI/AAAAAAAAACc/l6bdhmwx2K4/S220/iminred1.jpg'/></author><thr:total>0</thr:total></entry></feed>
