<?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-20556118</id><updated>2012-02-16T07:45:17.271-05:00</updated><category term='ruby'/><category term='javascript'/><category term='mysql'/><category term='CSS'/><category term='IE6'/><category term='html5'/><category term='Iphone'/><category term='Misc'/><category term='ssh'/><category term='ShellScripting'/><category term='Tips'/><category term='action script'/><category term='IDE'/><category term='Ajax'/><category term='wordpress'/><category term='Programming'/><category term='Programming: .NET'/><category term='Web'/><category term='Regular expression'/><category term='Algorithm'/><category term='Network Security'/><category term='CSS3'/><category term='Database'/><category term='Programming: PHP'/><category term='unix'/><category term='Eclipse'/><category term='video'/><category term='Debug'/><category term='Apache'/><category term='cron'/><category term='extjs'/><category term='prototype'/><category term='svn'/><category term='CMS: Drupal'/><title type='text'>Enlightenment</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://leoman730.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/20556118/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://leoman730.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><link rel='next' type='application/atom+xml' href='http://www.blogger.com/feeds/20556118/posts/default?start-index=101&amp;max-results=100'/><author><name>Leoman730</name><uri>http://www.blogger.com/profile/12392590805408335453</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>117</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-20556118.post-6345182555097355298</id><published>2010-11-09T09:04:00.003-05:00</published><updated>2010-11-09T09:07:19.409-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='IE6'/><title type='text'>Handle JSON.parse in IE 6</title><content type='html'>IE 6 seems can not recognize JSON.parse(), there's many way to fix this, one is to use the json2 library,  http://json.org/json2.js, just include the file in  your document, then you will be able to use JSON.parse() or JSON.stringify().&lt;br /&gt;More details take a look at this post: http://stackoverflow.com/questions/1787020/json-object-in-ie6-how&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/20556118-6345182555097355298?l=leoman730.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://leoman730.blogspot.com/feeds/6345182555097355298/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=20556118&amp;postID=6345182555097355298' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/20556118/posts/default/6345182555097355298'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/20556118/posts/default/6345182555097355298'/><link rel='alternate' type='text/html' href='http://leoman730.blogspot.com/2010/11/handle-jsonparse-in-ie-6.html' title='Handle JSON.parse in IE 6'/><author><name>Leoman730</name><uri>http://www.blogger.com/profile/12392590805408335453</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-20556118.post-834529279626543671</id><published>2010-07-30T09:55:00.001-05:00</published><updated>2010-07-30T09:57:38.190-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='CSS3'/><title type='text'>CSS3 PIE on IE8 non-senseness</title><content type='html'>If you having issue on rendering CSS3 property on IE8 using CSS3 PIE, chance are you have to set the element position to relative, otherwise the element may be disappeared.&lt;br /&gt;&lt;br /&gt;nav a {&lt;br /&gt; position: relative;&lt;br /&gt;    padding: 6px 25px;&lt;br /&gt;    color: #ffffff;&lt;br /&gt;    font-size: 13px;&lt;br /&gt;    font-weight: bold;&lt;br /&gt;    background-color: #e37222;&lt;br /&gt;    text-decoration: none;&lt;br /&gt; display: block;&lt;br /&gt; float: left;&lt;br /&gt; margin-right: 3px; &lt;br /&gt;    -moz-box-shadow: 0px 2px 3px #999999; /* FF3.5+ */&lt;br /&gt;    -webkit-box-shadow: 0px 2px 3px #999999; /* Saf3.0+, Chrome */&lt;br /&gt;    box-shadow: 0px 2px 3px #999999; /* Opera 10.5, IE 9.0 */&lt;br /&gt; behavior: url(/assets/css/pie/PIE.htc);&lt;br /&gt;}&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/20556118-834529279626543671?l=leoman730.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://leoman730.blogspot.com/feeds/834529279626543671/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=20556118&amp;postID=834529279626543671' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/20556118/posts/default/834529279626543671'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/20556118/posts/default/834529279626543671'/><link rel='alternate' type='text/html' href='http://leoman730.blogspot.com/2010/07/css3-pie-on-ie8-non-senseness.html' title='CSS3 PIE on IE8 non-senseness'/><author><name>Leoman730</name><uri>http://www.blogger.com/profile/12392590805408335453</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-20556118.post-4423527185060859999</id><published>2010-05-11T21:23:00.002-05:00</published><updated>2010-05-11T21:25:36.082-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='CSS'/><title type='text'>Element weight in css</title><content type='html'>Never knowing this before, when css is rendering for a page, it actually calculating point to determine override rule.&lt;br /&gt;&lt;br /&gt;HTML = 1 point&lt;br /&gt;CLASS = 10 points&lt;br /&gt;ID = 100 points &lt;br /&gt;&lt;br /&gt;http://net.tutsplus.com/tutorials/html-css-techniques/quick-tip-understanding-css-specificity/&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/20556118-4423527185060859999?l=leoman730.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://leoman730.blogspot.com/feeds/4423527185060859999/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=20556118&amp;postID=4423527185060859999' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/20556118/posts/default/4423527185060859999'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/20556118/posts/default/4423527185060859999'/><link rel='alternate' type='text/html' href='http://leoman730.blogspot.com/2010/05/element-weight-in-css.html' title='Element weight in css'/><author><name>Leoman730</name><uri>http://www.blogger.com/profile/12392590805408335453</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-20556118.post-8519157224036509046</id><published>2010-05-11T21:14:00.002-05:00</published><updated>2010-05-11T21:17:30.386-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='html5'/><title type='text'>Make html5 element available in IE</title><content type='html'>First make all new element as block element in css, Second, in javascript, using Document.createElement("name of the new element") to create all new elements.&lt;br /&gt;This way can trick IE to understand these element.&lt;br /&gt;You may also embed a html5.js host by google that can do that for you.&lt;br /&gt;http://html5shiv.googlecode.com/svn/trunk/html5.js&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/20556118-8519157224036509046?l=leoman730.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://leoman730.blogspot.com/feeds/8519157224036509046/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=20556118&amp;postID=8519157224036509046' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/20556118/posts/default/8519157224036509046'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/20556118/posts/default/8519157224036509046'/><link rel='alternate' type='text/html' href='http://leoman730.blogspot.com/2010/05/make-html5-element-available-in-ie.html' title='Make html5 element available in IE'/><author><name>Leoman730</name><uri>http://www.blogger.com/profile/12392590805408335453</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-20556118.post-8378331941016076153</id><published>2010-01-07T16:18:00.001-05:00</published><updated>2010-01-07T16:19:48.905-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='unix'/><title type='text'>Magic line to create file in nest structure</title><content type='html'>mkdir -p `dirname parentFolder/childFolder/file.txt` &amp;&amp; touch parentFolder/childFolder/file.txt&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/20556118-8378331941016076153?l=leoman730.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://leoman730.blogspot.com/feeds/8378331941016076153/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=20556118&amp;postID=8378331941016076153' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/20556118/posts/default/8378331941016076153'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/20556118/posts/default/8378331941016076153'/><link rel='alternate' type='text/html' href='http://leoman730.blogspot.com/2010/01/magic-line-to-create-file-in-nest.html' title='Magic line to create file in nest structure'/><author><name>Leoman730</name><uri>http://www.blogger.com/profile/12392590805408335453</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-20556118.post-3274627411452153909</id><published>2010-01-07T16:01:00.001-05:00</published><updated>2010-01-07T16:01:47.851-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='video'/><category scheme='http://www.blogger.com/atom/ns#' term='unix'/><title type='text'>Finding video info from command line</title><content type='html'>sudo apt-get install libimage-exiftool-perl&lt;br /&gt;exiftool *.mp4 *.mpg *avi *mov&lt;br /&gt;&lt;br /&gt;http://ubuntuforums.org/showthread.php?t=474839&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/20556118-3274627411452153909?l=leoman730.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://leoman730.blogspot.com/feeds/3274627411452153909/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=20556118&amp;postID=3274627411452153909' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/20556118/posts/default/3274627411452153909'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/20556118/posts/default/3274627411452153909'/><link rel='alternate' type='text/html' href='http://leoman730.blogspot.com/2010/01/finding-video-info-from-command-line.html' title='Finding video info from command line'/><author><name>Leoman730</name><uri>http://www.blogger.com/profile/12392590805408335453</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-20556118.post-621118796585680714</id><published>2009-12-11T12:35:00.006-05:00</published><updated>2009-12-11T15:04:41.693-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='unix'/><category scheme='http://www.blogger.com/atom/ns#' term='cron'/><title type='text'>Crob Job Example</title><content type='html'>1. crobtab -e &lt;br /&gt;2. Add following line &lt;br /&gt;*   *   *   *   *    you command | logger "wget ran"&lt;br /&gt;3. Save and exit. (You should see a message say "crontab: installing new crontab")&lt;br /&gt;&lt;br /&gt;What does this command do?&lt;br /&gt;It will run your command every min, and write a message to the system log. The system log usually locate at /var/log/messsages&lt;br /&gt;&lt;br /&gt;More reference:&lt;br /&gt;http://aplawrence.com/BDD/bbcronbasics.html&lt;br /&gt;http://www.adminschoice.com/docs/crontab.htm&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/20556118-621118796585680714?l=leoman730.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://leoman730.blogspot.com/feeds/621118796585680714/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=20556118&amp;postID=621118796585680714' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/20556118/posts/default/621118796585680714'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/20556118/posts/default/621118796585680714'/><link rel='alternate' type='text/html' href='http://leoman730.blogspot.com/2009/12/crob-job-example.html' title='Crob Job Example'/><author><name>Leoman730</name><uri>http://www.blogger.com/profile/12392590805408335453</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-20556118.post-9110803301308189792</id><published>2009-12-10T11:06:00.000-05:00</published><updated>2009-12-10T11:07:18.037-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='wordpress'/><title type='text'>Wordpress: Query Analysis</title><content type='html'>http://codex.wordpress.org/Editing_wp-config.php#Save_queries_for_analysis&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/20556118-9110803301308189792?l=leoman730.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://leoman730.blogspot.com/feeds/9110803301308189792/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=20556118&amp;postID=9110803301308189792' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/20556118/posts/default/9110803301308189792'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/20556118/posts/default/9110803301308189792'/><link rel='alternate' type='text/html' href='http://leoman730.blogspot.com/2009/12/wordpress-query-analysis.html' title='Wordpress: Query Analysis'/><author><name>Leoman730</name><uri>http://www.blogger.com/profile/12392590805408335453</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-20556118.post-3355613510404882871</id><published>2009-11-25T14:41:00.002-05:00</published><updated>2009-11-25T14:50:56.545-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='mysql'/><title type='text'>ORDER by title in mysql, ignoring the word “The”</title><content type='html'>Often time when you want to sort your sql return record by title, but the title starts with the word "The", for example "The Mummy" and we wants to sort by "Mummy" instead.&lt;br /&gt;There are 2 solutions I have found:&lt;br /&gt;1. Create a new field on the fly and sort by using the new field.&lt;br /&gt;Select *, str_replace(title, 'The ', '') as sort_title ORDER BY sort_title&lt;br /&gt;&lt;br /&gt;2. For better query performance, create a new column in the table ('sort_title') that is same as the title column but without a prefix of "The " or "A".&lt;br /&gt;&lt;br /&gt;Some more info can be found here: http://stackoverflow.com/questions/695664/how-do-you-order-by-title-in-mysql-ignoring-the-word-the&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/20556118-3355613510404882871?l=leoman730.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://leoman730.blogspot.com/feeds/3355613510404882871/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=20556118&amp;postID=3355613510404882871' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/20556118/posts/default/3355613510404882871'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/20556118/posts/default/3355613510404882871'/><link rel='alternate' type='text/html' href='http://leoman730.blogspot.com/2009/11/order-by-title-in-mysql-ignoring-word.html' title='ORDER by title in mysql, ignoring the word “The”'/><author><name>Leoman730</name><uri>http://www.blogger.com/profile/12392590805408335453</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-20556118.post-7929354916919931640</id><published>2009-11-23T11:13:00.002-05:00</published><updated>2009-11-23T11:38:54.347-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ssh'/><title type='text'>SSH tunneling</title><content type='html'>ssh -NL 1090:willow.xxx.com:8080 phuang@ray.xxx.com&lt;br /&gt;now access willow.xxx.com via localhost:1090&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/20556118-7929354916919931640?l=leoman730.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://leoman730.blogspot.com/feeds/7929354916919931640/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=20556118&amp;postID=7929354916919931640' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/20556118/posts/default/7929354916919931640'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/20556118/posts/default/7929354916919931640'/><link rel='alternate' type='text/html' href='http://leoman730.blogspot.com/2009/11/ssh-tunneling.html' title='SSH tunneling'/><author><name>Leoman730</name><uri>http://www.blogger.com/profile/12392590805408335453</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-20556118.post-487686215936426853</id><published>2009-11-20T13:57:00.001-05:00</published><updated>2009-11-20T13:58:44.073-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='javascript'/><title type='text'>Simple json object decoding</title><content type='html'>var newdata = eval('(' + jsonData + ')');&lt;br /&gt;console.log(newdata);&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/20556118-487686215936426853?l=leoman730.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://leoman730.blogspot.com/feeds/487686215936426853/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=20556118&amp;postID=487686215936426853' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/20556118/posts/default/487686215936426853'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/20556118/posts/default/487686215936426853'/><link rel='alternate' type='text/html' href='http://leoman730.blogspot.com/2009/11/simple-json-object-decoding.html' title='Simple json object decoding'/><author><name>Leoman730</name><uri>http://www.blogger.com/profile/12392590805408335453</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-20556118.post-7242225913793553984</id><published>2009-11-19T14:55:00.003-05:00</published><updated>2009-11-19T14:58:22.245-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Programming: PHP'/><title type='text'>PHP Date format in other language</title><content type='html'>To make php change data format dynamically base on the current language, use strftime() in combine with setlocale(). &lt;br /&gt;If local has not been installed, install it and restart Apache.&lt;br /&gt;More info on &lt;a href="http://php.net/manual/en/function.strftime.php"&gt;http://php.net/manual/en/function.strftime.php&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/20556118-7242225913793553984?l=leoman730.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://leoman730.blogspot.com/feeds/7242225913793553984/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=20556118&amp;postID=7242225913793553984' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/20556118/posts/default/7242225913793553984'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/20556118/posts/default/7242225913793553984'/><link rel='alternate' type='text/html' href='http://leoman730.blogspot.com/2009/11/php-date-format-in-other-language.html' title='PHP Date format in other language'/><author><name>Leoman730</name><uri>http://www.blogger.com/profile/12392590805408335453</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-20556118.post-3581744908745085765</id><published>2009-10-14T21:11:00.001-05:00</published><updated>2009-10-14T21:11:55.449-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Iphone'/><title type='text'>Prevent Iphoto From Start Up In Iphone</title><content type='html'>1. Open the App called Image Capture (it should be in your applications folder)&lt;br /&gt;2. Once open go to the Pref. (apple , ) and click the general tab&lt;br /&gt;3. You will see an option to open an application when camera is connected&lt;br /&gt;4. Adjust what you need to, or just select No Application.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/20556118-3581744908745085765?l=leoman730.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://leoman730.blogspot.com/feeds/3581744908745085765/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=20556118&amp;postID=3581744908745085765' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/20556118/posts/default/3581744908745085765'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/20556118/posts/default/3581744908745085765'/><link rel='alternate' type='text/html' href='http://leoman730.blogspot.com/2009/10/prevent-iphoto-from-start-up-in-iphone.html' title='Prevent Iphoto From Start Up In Iphone'/><author><name>Leoman730</name><uri>http://www.blogger.com/profile/12392590805408335453</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-20556118.post-7129939002764317263</id><published>2009-10-06T10:35:00.000-05:00</published><updated>2009-10-06T10:36:40.949-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Programming: PHP'/><title type='text'>PHP: Interceptor method</title><content type='html'>http://develturk.com/2009/04/18/interceptor-methods-__call-php-overloading/&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/20556118-7129939002764317263?l=leoman730.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://leoman730.blogspot.com/feeds/7129939002764317263/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=20556118&amp;postID=7129939002764317263' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/20556118/posts/default/7129939002764317263'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/20556118/posts/default/7129939002764317263'/><link rel='alternate' type='text/html' href='http://leoman730.blogspot.com/2009/10/php-interceptor-method.html' title='PHP: Interceptor method'/><author><name>Leoman730</name><uri>http://www.blogger.com/profile/12392590805408335453</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-20556118.post-4811696605070918136</id><published>2009-09-29T14:48:00.003-05:00</published><updated>2009-09-29T14:51:57.857-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Apache'/><title type='text'>htaccess: directory browsing</title><content type='html'>To enable directory browsing, add a .htaccess file under that directory and add this line to the file: "Options +Indexes"&lt;br /&gt;To prevent directory browsing, add this to the file: "IndexIgnore */*"&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/20556118-4811696605070918136?l=leoman730.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://leoman730.blogspot.com/feeds/4811696605070918136/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=20556118&amp;postID=4811696605070918136' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/20556118/posts/default/4811696605070918136'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/20556118/posts/default/4811696605070918136'/><link rel='alternate' type='text/html' href='http://leoman730.blogspot.com/2009/09/htaccess-directory-browsing.html' title='htaccess: directory browsing'/><author><name>Leoman730</name><uri>http://www.blogger.com/profile/12392590805408335453</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-20556118.post-5701542921535516957</id><published>2009-09-25T10:26:00.001-05:00</published><updated>2009-09-25T10:27:30.367-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Web'/><title type='text'>Progressive JPEG</title><content type='html'>Reference From: &lt;a href="http://www.faqs.org/faqs/jpeg-faq/part1/section-11.html"&gt;Progressive JPEG&lt;/a&gt;&lt;br /&gt;&lt;blockquote&gt;A simple or "baseline" JPEG file is stored as one top-to-bottom scan of the&lt;br /&gt;image.  Progressive JPEG divides the file into a series of scans.  The first&lt;br /&gt;scan shows the image at the equivalent of a very low quality setting, and&lt;br /&gt;therefore it takes very little space.  Following scans gradually improve the&lt;br /&gt;quality.  Each scan adds to the data already provided, so that the total&lt;br /&gt;storage requirement is roughly the same as for a baseline JPEG image of the&lt;br /&gt;same quality as the final scan.  (Basically, progressive JPEG is just a&lt;br /&gt;rearrangement of the same data into a more complicated order.)&lt;br /&gt;&lt;br /&gt;The advantage of progressive JPEG is that if an image is being viewed&lt;br /&gt;on-the-fly as it is transmitted, one can see an approximation to the whole&lt;br /&gt;image very quickly, with gradual improvement of quality as one waits longer;&lt;br /&gt;this is much nicer than a slow top-to-bottom display of the image.  The&lt;br /&gt;disadvantage is that each scan takes about the same amount of computation to&lt;br /&gt;display as a whole baseline JPEG file would.  So progressive JPEG only makes&lt;br /&gt;sense if one has a decoder that's fast compared to the communication link.&lt;br /&gt;(If the data arrives quickly, a progressive-JPEG decoder can adapt by&lt;br /&gt;skipping some display passes.  Hence, those of you fortunate enough to have&lt;br /&gt;T1 or faster net links may not see any difference between progressive and&lt;br /&gt;regular JPEG; but on a modem-speed link, progressive JPEG is great.)&lt;br /&gt;&lt;br /&gt;Up until recently, there weren't many applications in which progressive JPEG&lt;br /&gt;looked attractive, so it hasn't been widely implemented.  But with the&lt;br /&gt;popularity of World Wide Web browsers running over slow modem links, and&lt;br /&gt;with the ever-increasing horsepower of personal computers, progressive JPEG&lt;br /&gt;has become a win for WWW use.  IJG's free JPEG software (see part 2, item&lt;br /&gt;15) now supports progressive JPEG, and the capability is spreading fast in&lt;br /&gt;WWW browsers and other programs.&lt;br /&gt;&lt;br /&gt;Except for the ability to provide progressive display, progressive JPEG and&lt;br /&gt;baseline JPEG are basically identical, and they work well on the same kinds&lt;br /&gt;of images.  It is possible to convert between baseline and progressive&lt;br /&gt;representations of an image without any quality loss.  (But specialized&lt;br /&gt;software is needed to do this; conversion by decompressing and recompressing&lt;br /&gt;is *not* lossless, due to roundoff errors.)&lt;br /&gt;&lt;br /&gt;A progressive JPEG file is not readable at all by a baseline-only JPEG&lt;br /&gt;decoder, so existing software will have to be upgraded before progressive&lt;br /&gt;JPEG can be used widely.  See item 16 in part 2 for the latest news about&lt;br /&gt;which programs support it.&lt;/blockquote&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/20556118-5701542921535516957?l=leoman730.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://leoman730.blogspot.com/feeds/5701542921535516957/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=20556118&amp;postID=5701542921535516957' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/20556118/posts/default/5701542921535516957'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/20556118/posts/default/5701542921535516957'/><link rel='alternate' type='text/html' href='http://leoman730.blogspot.com/2009/09/progressive-jpeg.html' title='Progressive JPEG'/><author><name>Leoman730</name><uri>http://www.blogger.com/profile/12392590805408335453</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-20556118.post-4642419546031355855</id><published>2009-09-01T08:44:00.000-05:00</published><updated>2009-09-01T08:45:35.246-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Programming: PHP'/><category scheme='http://www.blogger.com/atom/ns#' term='Debug'/><title type='text'>Debugging in PHP</title><content type='html'>Fast noodle debug in php:&lt;br /&gt; &lt;br /&gt;error_reporting(E_ALL);&lt;br /&gt;ini_set('display_errors','On');&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/20556118-4642419546031355855?l=leoman730.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://leoman730.blogspot.com/feeds/4642419546031355855/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=20556118&amp;postID=4642419546031355855' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/20556118/posts/default/4642419546031355855'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/20556118/posts/default/4642419546031355855'/><link rel='alternate' type='text/html' href='http://leoman730.blogspot.com/2009/09/debugging-in-php.html' title='Debugging in PHP'/><author><name>Leoman730</name><uri>http://www.blogger.com/profile/12392590805408335453</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-20556118.post-7860594801080011645</id><published>2009-08-04T09:35:00.000-05:00</published><updated>2009-08-04T09:36:08.301-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='javascript'/><category scheme='http://www.blogger.com/atom/ns#' term='action script'/><title type='text'>ActionScript, Javascript interaction</title><content type='html'>http://kb2.adobe.com/cps/156/tn_15683.html#javascript&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/20556118-7860594801080011645?l=leoman730.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://leoman730.blogspot.com/feeds/7860594801080011645/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=20556118&amp;postID=7860594801080011645' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/20556118/posts/default/7860594801080011645'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/20556118/posts/default/7860594801080011645'/><link rel='alternate' type='text/html' href='http://leoman730.blogspot.com/2009/08/actionscript-javascript-interaction.html' title='ActionScript, Javascript interaction'/><author><name>Leoman730</name><uri>http://www.blogger.com/profile/12392590805408335453</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-20556118.post-8496932915439589961</id><published>2009-08-04T08:13:00.002-05:00</published><updated>2009-08-04T08:14:23.355-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Programming: PHP'/><category scheme='http://www.blogger.com/atom/ns#' term='action script'/><title type='text'>PHP and Action Script make easy</title><content type='html'>Here a simple but helpful tutorial on how php can interact with action script: &lt;br /&gt;&lt;a href="http://www.kirupa.com/developer/actionscript/asandphp.htm"&gt;http://www.kirupa.com/developer/actionscript/asandphp.htm&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/20556118-8496932915439589961?l=leoman730.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://leoman730.blogspot.com/feeds/8496932915439589961/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=20556118&amp;postID=8496932915439589961' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/20556118/posts/default/8496932915439589961'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/20556118/posts/default/8496932915439589961'/><link rel='alternate' type='text/html' href='http://leoman730.blogspot.com/2009/08/php-and-action-script-make-easy.html' title='PHP and Action Script make easy'/><author><name>Leoman730</name><uri>http://www.blogger.com/profile/12392590805408335453</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-20556118.post-1136746991278061143</id><published>2009-07-28T14:01:00.002-05:00</published><updated>2009-07-28T14:05:07.059-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='CSS'/><title type='text'>1 pixel heigh div in IE 6</title><content type='html'>If you want to create a 1px horizontal line, some people may use a 1px height div with a color background to accomplish it instead of using &lt;hr /&gt; tag. For example, &lt;br /&gt;&lt;br /&gt;div.details-sep-hr {&lt;br /&gt;background-color:#CCCCCC;&lt;br /&gt;border:0 solid black;&lt;br /&gt;height:1px;&lt;br /&gt;margin:0;&lt;br /&gt;padding:0;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;This works perfect with all modern browsers but not in IE6. IE may generate a line more than 1px height. To fix this, add overflow hidden to the class. &lt;br /&gt;&lt;br /&gt;div.details-sep-hr {&lt;br /&gt;background-color:#CCCCCC;&lt;br /&gt;border:0 solid black;&lt;br /&gt;height:1px;&lt;br /&gt;margin:0;&lt;br /&gt;padding:0;&lt;br /&gt;overflow: hidden;&lt;br /&gt;}&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/20556118-1136746991278061143?l=leoman730.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://leoman730.blogspot.com/feeds/1136746991278061143/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=20556118&amp;postID=1136746991278061143' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/20556118/posts/default/1136746991278061143'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/20556118/posts/default/1136746991278061143'/><link rel='alternate' type='text/html' href='http://leoman730.blogspot.com/2009/07/1-pixel-heigh-div-in-ie-6.html' title='1 pixel heigh div in IE 6'/><author><name>Leoman730</name><uri>http://www.blogger.com/profile/12392590805408335453</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-20556118.post-7478170871600420991</id><published>2009-07-09T08:53:00.002-05:00</published><updated>2009-07-09T09:01:54.331-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Apache'/><title type='text'>Negotiation in Apache</title><content type='html'>In Apache HTTP web server (v2.2), If the browser requesting an image (http://www.yahoo.com/images/example.png) for example without extension, such that http://www.yahoo.com/images/example, the server can resolve the issue automatically by search all files under "images" directory that match example.*. The reason behind this is the feature of "Content Negotiation" in Apache Web Server, it seems like this is only the feature for v2.2 or above. &lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;The effect of MultiViews is as follows: if the server receives a request for /some/dir/foo, if /some/dir has MultiViews enabled, and /some/dir/foo does not exist, then the server reads the directory looking for files named foo.*, and effectively fakes up a type map which names all those files, assigning them the same media types and content-encodings it would have if the client had asked for one of them by name. It then chooses the best match to the client's requirements.&lt;/blockquote&gt;&lt;br /&gt;&lt;br /&gt;For more information, go to: &lt;a href="http://httpd.apache.org/docs/2.2/content-negotiation.html#negotiation"&gt;http://httpd.apache.org/docs/2.2/content-negotiation.html#negotiation&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/20556118-7478170871600420991?l=leoman730.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://leoman730.blogspot.com/feeds/7478170871600420991/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=20556118&amp;postID=7478170871600420991' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/20556118/posts/default/7478170871600420991'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/20556118/posts/default/7478170871600420991'/><link rel='alternate' type='text/html' href='http://leoman730.blogspot.com/2009/07/negotiation-in-apache.html' title='Negotiation in Apache'/><author><name>Leoman730</name><uri>http://www.blogger.com/profile/12392590805408335453</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-20556118.post-5616519102065401519</id><published>2009-06-30T08:10:00.003-05:00</published><updated>2009-07-06T15:47:54.875-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='CSS'/><title type='text'>New way to style for IE 6</title><content type='html'>Just discover that we can specify style for ie 6 using: _myclass syntax.&lt;br /&gt;For all modern browsers, it will think that this is incorrect syntax and will ignore it entirly; However, for old browser, such as IE 6, it intelligently think this is a typo, and assume it to be myclass.&lt;br /&gt;More Info in: &lt;a href="http://www.outofcontrol.ca/2007/03/08/underscore-hack-for-css-and-ie/"&gt;Underscore hack for CSS and IE&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Other way to style IE 6 is through conditional commenting or using syntax like myclass[class] which only regonize by modern browser.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/20556118-5616519102065401519?l=leoman730.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://leoman730.blogspot.com/feeds/5616519102065401519/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=20556118&amp;postID=5616519102065401519' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/20556118/posts/default/5616519102065401519'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/20556118/posts/default/5616519102065401519'/><link rel='alternate' type='text/html' href='http://leoman730.blogspot.com/2009/06/new-way-to-style-for-ie-6.html' title='New way to style for IE 6'/><author><name>Leoman730</name><uri>http://www.blogger.com/profile/12392590805408335453</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-20556118.post-3018700290991095458</id><published>2009-06-25T09:27:00.004-05:00</published><updated>2009-06-25T09:32:41.167-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='extjs'/><title type='text'>Extjs: Using stripCharsRe</title><content type='html'>Ext js comes with a config option for textarea (maybe also for another form field) that to strip off any unwant character from a value, here is an example of stripping leading white space for the textara field in my form:&lt;br /&gt;&lt;pre&gt;           &lt;br /&gt;{&lt;br /&gt;xtype:'textarea',           &lt;br /&gt;fieldLabel:'Copy',            &lt;br /&gt;id:'copy',             &lt;br /&gt;name:'copy',             &lt;br /&gt;allowBlank:true,             &lt;br /&gt;width:300,             &lt;br /&gt;height:50,            &lt;br /&gt;stripCharsRe: /^\s+/g,  //strip off leading white space            &lt;br /&gt;grow: true           &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/20556118-3018700290991095458?l=leoman730.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://leoman730.blogspot.com/feeds/3018700290991095458/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=20556118&amp;postID=3018700290991095458' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/20556118/posts/default/3018700290991095458'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/20556118/posts/default/3018700290991095458'/><link rel='alternate' type='text/html' href='http://leoman730.blogspot.com/2009/06/extjs-using-stripcharsre.html' title='Extjs: Using stripCharsRe'/><author><name>Leoman730</name><uri>http://www.blogger.com/profile/12392590805408335453</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-20556118.post-8319078955382749898</id><published>2009-06-16T15:44:00.002-05:00</published><updated>2009-06-16T15:47:27.631-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='svn'/><title type='text'>SVN COPY files from respository</title><content type='html'>svn copy svn://svn.xxx.com/xxx/trunk/xxx/public/lib/classes/vcard.class.php -r 277 .&lt;br /&gt;&lt;br /&gt;Syntax: svn copy [fullpath] -r [revision #] [distination]&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/20556118-8319078955382749898?l=leoman730.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://leoman730.blogspot.com/feeds/8319078955382749898/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=20556118&amp;postID=8319078955382749898' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/20556118/posts/default/8319078955382749898'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/20556118/posts/default/8319078955382749898'/><link rel='alternate' type='text/html' href='http://leoman730.blogspot.com/2009/06/svn-copy-files-from-respository.html' title='SVN COPY files from respository'/><author><name>Leoman730</name><uri>http://www.blogger.com/profile/12392590805408335453</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-20556118.post-5836865149901795169</id><published>2009-06-12T15:20:00.000-05:00</published><updated>2009-06-12T15:21:53.936-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Programming: PHP'/><title type='text'>PHP installation checker script</title><content type='html'>&lt;a href="http://framework.zend.com/svn/framework/standard/trunk/demos/Zend/Gdata/InstallationChecker.php"&gt;PHP installation checker script FROM ZEND&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/20556118-5836865149901795169?l=leoman730.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://leoman730.blogspot.com/feeds/5836865149901795169/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=20556118&amp;postID=5836865149901795169' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/20556118/posts/default/5836865149901795169'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/20556118/posts/default/5836865149901795169'/><link rel='alternate' type='text/html' href='http://leoman730.blogspot.com/2009/06/php-installation-checker-script.html' title='PHP installation checker script'/><author><name>Leoman730</name><uri>http://www.blogger.com/profile/12392590805408335453</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-20556118.post-6065643637223374293</id><published>2009-06-05T08:59:00.004-05:00</published><updated>2009-06-12T15:06:33.357-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Programming: PHP'/><title type='text'>Running PHP from Command Line (CLI) directly</title><content type='html'>First, finding the php location, usually in /usr/bin for mac;&lt;br /&gt;Then use execute: /usr/bin/php -r  'echo phpinfo();'&lt;br /&gt;&lt;br /&gt;DONT forget put quote surround your script.&lt;br /&gt;For more info, type 'man php'&lt;br /&gt;&lt;br /&gt;UPDATE:&lt;br /&gt;ANOTHER EASY WAY, JUST TYPE: 'php -a'&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/20556118-6065643637223374293?l=leoman730.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://leoman730.blogspot.com/feeds/6065643637223374293/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=20556118&amp;postID=6065643637223374293' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/20556118/posts/default/6065643637223374293'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/20556118/posts/default/6065643637223374293'/><link rel='alternate' type='text/html' href='http://leoman730.blogspot.com/2009/06/running-php-from-command-line-cli.html' title='Running PHP from Command Line (CLI) directly'/><author><name>Leoman730</name><uri>http://www.blogger.com/profile/12392590805408335453</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-20556118.post-2472026453443823711</id><published>2009-06-03T09:33:00.002-05:00</published><updated>2009-06-03T09:38:16.048-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='javascript'/><category scheme='http://www.blogger.com/atom/ns#' term='extjs'/><title type='text'>Extjs AUTO complete of combo box</title><content type='html'>Here is and example to make a auto complement combo box in Ext JS. 3 important factors keep in mind here:&lt;br /&gt;1. I am using jsonstore and set mode to local&lt;br /&gt;2. jsonstore should set autoload to "true"&lt;br /&gt;3. Set triggerAction to "all" in the combo box config&lt;br /&gt;&lt;br /&gt;{             xtype:'combo',             id: 'shoutoutsTags',&lt;br /&gt;            fieldLabel: 'Tag',&lt;br /&gt;            value: '',&lt;br /&gt;             mode: 'local',&lt;br /&gt;             width: 200,&lt;br /&gt;             store: new Ext.data.JsonStore({&lt;br /&gt;              url: 'get_data.php',&lt;br /&gt;              fields: ['id', 'name'],&lt;br /&gt;              root: 'tags',&lt;br /&gt;              autoLoad: true&lt;br /&gt;             }),&lt;br /&gt;             displayField: 'name',&lt;br /&gt;             valueField: 'id',&lt;br /&gt;             forceSelection: true,&lt;br /&gt;             triggerAction: 'all',&lt;br /&gt;             &lt;br /&gt;             hiddenName: 'mytag' //dont put it the same name as name filed value&lt;br /&gt;            },&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/20556118-2472026453443823711?l=leoman730.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://leoman730.blogspot.com/feeds/2472026453443823711/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=20556118&amp;postID=2472026453443823711' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/20556118/posts/default/2472026453443823711'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/20556118/posts/default/2472026453443823711'/><link rel='alternate' type='text/html' href='http://leoman730.blogspot.com/2009/06/extjs-auto-complete-of-combo-box.html' title='Extjs AUTO complete of combo box'/><author><name>Leoman730</name><uri>http://www.blogger.com/profile/12392590805408335453</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-20556118.post-7573805948167835591</id><published>2009-05-28T14:50:00.001-05:00</published><updated>2009-05-28T14:51:58.058-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='CSS'/><title type='text'>CSS: SET Opacity for IE</title><content type='html'>To set opacity for IE, use this: "filter: alpha(opacity = 50)"&lt;br /&gt;&lt;br /&gt;More detail: &lt;a href="http://joseph.randomnetworks.com/archives/2006/08/16/css-opacity-in-internet-explorer-ie/"&gt;http://joseph.randomnetworks.com/archives/2006/08/16/css-opacity-in-internet-explorer-ie/&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/20556118-7573805948167835591?l=leoman730.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://leoman730.blogspot.com/feeds/7573805948167835591/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=20556118&amp;postID=7573805948167835591' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/20556118/posts/default/7573805948167835591'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/20556118/posts/default/7573805948167835591'/><link rel='alternate' type='text/html' href='http://leoman730.blogspot.com/2009/05/css-set-opacity-for-ie.html' title='CSS: SET Opacity for IE'/><author><name>Leoman730</name><uri>http://www.blogger.com/profile/12392590805408335453</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-20556118.post-4696131683496396169</id><published>2009-05-15T08:50:00.001-05:00</published><updated>2009-05-15T08:51:17.688-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='javascript'/><category scheme='http://www.blogger.com/atom/ns#' term='prototype'/><title type='text'>Prototype error: Value undefined (result of expression this.fireEvent) is not object.</title><content type='html'>If you got a js error saying "Value undefined (result of expression this.fireEvent) is not object." when using prototype, make sure you only include prototype.js ONCE in your document.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/20556118-4696131683496396169?l=leoman730.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://leoman730.blogspot.com/feeds/4696131683496396169/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=20556118&amp;postID=4696131683496396169' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/20556118/posts/default/4696131683496396169'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/20556118/posts/default/4696131683496396169'/><link rel='alternate' type='text/html' href='http://leoman730.blogspot.com/2009/05/prototype-error-value-undefined-result.html' title='Prototype error: Value undefined (result of expression this.fireEvent) is not object.'/><author><name>Leoman730</name><uri>http://www.blogger.com/profile/12392590805408335453</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-20556118.post-1649762732109442375</id><published>2009-05-07T15:55:00.001-05:00</published><updated>2009-05-07T15:57:23.080-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='javascript'/><title type='text'>Alternate table row color using javascript</title><content type='html'>This version on javascript has been tested on Firefox, Safari, IE 6, and IE7&lt;br /&gt;&lt;br /&gt;         $('chart_table').select("tbody tr").each( function(e) {  &lt;br /&gt;             Event.observe(e, 'mouseover', function() {  &lt;br /&gt;                 Element.addClassName(e, 'hover');  &lt;br /&gt;             });  &lt;br /&gt;             Event.observe(e, 'mouseout', function() {  &lt;br /&gt;                 Element.removeClassName(e, 'hover');  &lt;br /&gt;             });  &lt;br /&gt;         });&lt;br /&gt;  &lt;br /&gt;&lt;br /&gt;========css =====&lt;br /&gt;.hover{ background-color:#CECECE; color: #fff;}&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;More detail:&lt;br /&gt;&lt;a href="http://www.sidesofmarch.com/index.php/archive/2007/04/23/an-ie6-compatible-solution-for-hover/"&gt;http://www.sidesofmarch.com/index.php/archive/2007/04/23/an-ie6-compatible-solution-for-hover/&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/20556118-1649762732109442375?l=leoman730.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://leoman730.blogspot.com/feeds/1649762732109442375/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=20556118&amp;postID=1649762732109442375' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/20556118/posts/default/1649762732109442375'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/20556118/posts/default/1649762732109442375'/><link rel='alternate' type='text/html' href='http://leoman730.blogspot.com/2009/05/alternate-table-row-color-using.html' title='Alternate table row color using javascript'/><author><name>Leoman730</name><uri>http://www.blogger.com/profile/12392590805408335453</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-20556118.post-4491474767777029387</id><published>2009-05-05T12:10:00.001-05:00</published><updated>2009-05-05T12:12:30.218-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Regular expression'/><title type='text'>Regular expression</title><content type='html'>For Anchor tag:&lt;br /&gt;preg_match_all('/&lt;a[^&gt;]*&gt;(.*?)&lt;\/a&gt;/Ui', $post, $matches);&lt;br /&gt;&lt;br /&gt;For Image:&lt;br /&gt;preg_match_all('/&lt;img[^&gt;]*&gt;/Ui', $post, $matches);&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/20556118-4491474767777029387?l=leoman730.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://leoman730.blogspot.com/feeds/4491474767777029387/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=20556118&amp;postID=4491474767777029387' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/20556118/posts/default/4491474767777029387'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/20556118/posts/default/4491474767777029387'/><link rel='alternate' type='text/html' href='http://leoman730.blogspot.com/2009/05/regular-expression.html' title='Regular expression'/><author><name>Leoman730</name><uri>http://www.blogger.com/profile/12392590805408335453</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-20556118.post-7317412872728550247</id><published>2009-04-28T11:05:00.003-05:00</published><updated>2009-04-28T11:11:56.492-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='CSS'/><title type='text'>IE 6 weir duplicate character</title><content type='html'>If you ever seem IE 6 generate duplicate characters, you should double check if you have comment inside another comment tag.&lt;br /&gt;More detail: &lt;a href="http://www.positioniseverything.net/explorer/dup-characters.html"&gt;http://www.positioniseverything.net/explorer/dup-characters.html&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/20556118-7317412872728550247?l=leoman730.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://leoman730.blogspot.com/feeds/7317412872728550247/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=20556118&amp;postID=7317412872728550247' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/20556118/posts/default/7317412872728550247'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/20556118/posts/default/7317412872728550247'/><link rel='alternate' type='text/html' href='http://leoman730.blogspot.com/2009/04/ie-6-weir-duplicate-character.html' title='IE 6 weir duplicate character'/><author><name>Leoman730</name><uri>http://www.blogger.com/profile/12392590805408335453</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-20556118.post-7818842012961763407</id><published>2009-04-09T00:18:00.000-05:00</published><updated>2009-04-09T00:19:15.914-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='svn'/><title type='text'>Install SVN server</title><content type='html'>cd ~&lt;br /&gt;mkdir src&lt;br /&gt;cd ~/src&lt;br /&gt;wget http://www.gtlib.gatech.edu/pub/apache/apr/apr-util-1.3.4.tar.gz&lt;br /&gt;wget http://www.gtlib.gatech.edu/pub/apache/apr/apr-1.3.3.tar.gz&lt;br /&gt;wget http://subversion.tigris.org/downloads/subversion-1.6.0.tar.gz&lt;br /&gt;wget http://www.webdav.org/neon/neon-0.28.4.tar.gz&lt;br /&gt;wget http://www.sqlite.org/sqlite-amalgamation-3.6.11.tar.gz&lt;br /&gt;&lt;br /&gt;tar -xzf apr-util-1.3.4.tar.gz&lt;br /&gt;tar -xzf apr-1.3.3.tar.gz&lt;br /&gt;tar -xzf subversion-1.6.0.tar.gz&lt;br /&gt;tar -xzf neon-0.28.4.tar.gz&lt;br /&gt;tar -xzf sqlite-amalgamation-3.6.11.tar.gz&lt;br /&gt;&lt;br /&gt;cd ~/src/apr-1.3.3&lt;br /&gt;./configure --prefix=$HOME LDFLAGS="-L/lib64"&lt;br /&gt;make&lt;br /&gt;make install&lt;br /&gt;cd ~/src/apr-util-1.3.4&lt;br /&gt;./configure --prefix=$HOME --with-apr=$HOME LDFLAGS="-L/lib64"&lt;br /&gt;make&lt;br /&gt;make install&lt;br /&gt;cd ~/src/neon-0.28.4&lt;br /&gt;./configure --enable-shared --prefix=$HOME LDFLAGS="-L/lib64"&lt;br /&gt;make&lt;br /&gt;make install&lt;br /&gt;&lt;br /&gt;cd ~/src/sqlite-amalgamation-3.6.11&lt;br /&gt;make&lt;br /&gt;make install&lt;br /&gt;&lt;br /&gt;cd ~/src/subversion-1.6.0&lt;br /&gt;cp ../sqlite-3.6.11/sqlite3.c sqlite-amalgamation/sqlite3.c&lt;br /&gt;./configure --prefix=$HOME --without-berkeley-db --with-zlib --with-ssl LDFLAGS="-L/lib64"&lt;br /&gt;make&lt;br /&gt;make install&lt;br /&gt;&lt;br /&gt;(You may get some warming message, but it is ok)&lt;br /&gt;&lt;br /&gt;More info:&lt;br /&gt;Follow instruction on: http://www.bluehostforum.com/showthread.php?t=12099 (more detail on the 2nd page to make svn checkable to local)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/20556118-7818842012961763407?l=leoman730.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://leoman730.blogspot.com/feeds/7818842012961763407/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=20556118&amp;postID=7818842012961763407' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/20556118/posts/default/7818842012961763407'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/20556118/posts/default/7818842012961763407'/><link rel='alternate' type='text/html' href='http://leoman730.blogspot.com/2009/04/install-svn-server.html' title='Install SVN server'/><author><name>Leoman730</name><uri>http://www.blogger.com/profile/12392590805408335453</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-20556118.post-5560336591627115910</id><published>2009-04-07T14:57:00.001-05:00</published><updated>2009-04-07T14:58:27.564-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='mysql'/><category scheme='http://www.blogger.com/atom/ns#' term='Database'/><title type='text'>Mysql reset indexes</title><content type='html'>Use this sql can reset the index of an auto increment column.&lt;br /&gt;ALTER TABLE tablename AUTO_INCREMENT = 1&lt;br /&gt;&lt;br /&gt;Find more info on: &lt;a href="http://www.liewcf.com/blog/archives/2004/04/mysql-reset-auto-increament-number/"&gt;Reset auto incrementation&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/20556118-5560336591627115910?l=leoman730.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://leoman730.blogspot.com/feeds/5560336591627115910/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=20556118&amp;postID=5560336591627115910' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/20556118/posts/default/5560336591627115910'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/20556118/posts/default/5560336591627115910'/><link rel='alternate' type='text/html' href='http://leoman730.blogspot.com/2009/04/mysql-reset-indexes.html' title='Mysql reset indexes'/><author><name>Leoman730</name><uri>http://www.blogger.com/profile/12392590805408335453</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-20556118.post-886587414668684364</id><published>2009-04-02T09:47:00.002-05:00</published><updated>2009-04-02T10:01:38.765-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Web'/><category scheme='http://www.blogger.com/atom/ns#' term='javascript'/><category scheme='http://www.blogger.com/atom/ns#' term='Debug'/><category scheme='http://www.blogger.com/atom/ns#' term='CSS'/><title type='text'>IE debugging tools</title><content type='html'>Most of web developers know debugging in IE is a painful job especially IE6. Unlike, firefox that has an add-on "Firebug" makes all of us happy in the debugging and inspection. How I wish IE has the same kind of tool~~. But today, after spending sometime on forum, it seems like ppl are already taking some action on IE. Here's a list of tool that may make developers' life easier on IE:&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.westciv.com/xray/xray_more.html#what"&gt;X-RAY&lt;/a&gt;: A free cross browser tool that lets you see the box model in action for any element, letting you see beneath the skin of any web page.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.debugbar.com/"&gt;DebugBar&lt;/a&gt;: An Internet Explorer plug-in, feature in: DOM inspector, HTTP inspector, Javascript inspector, js console, HTML validator etc.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.my-debugbar.com/wiki/CompanionJS/HomePage"&gt;CompanionJS&lt;/a&gt;: Detailled javascript error reporting (call stack and real file name where the error occured).&lt;br /&gt;&lt;br /&gt;These tool may requires to install IE script editor, which can be download from microsoft official site at: &lt;a href="http://www.microsoft.com/downloads/details.aspx?familyid=2f465be0-94fd-4569-b3c4-dffdf19ccd99&amp;displaylang=en"&gt;Microsoft Script Debugger&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/20556118-886587414668684364?l=leoman730.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://leoman730.blogspot.com/feeds/886587414668684364/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=20556118&amp;postID=886587414668684364' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/20556118/posts/default/886587414668684364'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/20556118/posts/default/886587414668684364'/><link rel='alternate' type='text/html' href='http://leoman730.blogspot.com/2009/04/ie-debugging-tools.html' title='IE debugging tools'/><author><name>Leoman730</name><uri>http://www.blogger.com/profile/12392590805408335453</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-20556118.post-1961502009791853827</id><published>2009-04-01T22:45:00.001-05:00</published><updated>2009-04-01T22:45:57.260-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='mysql'/><category scheme='http://www.blogger.com/atom/ns#' term='Database'/><title type='text'>UNIX_TIMESTAMP() AND FROM_UNIXTIME()</title><content type='html'>If you use UNIX_TIMESTAMP() and FROM_UNIXTIME() to convert&lt;br /&gt;between TIMESTAMP values and Unix timestamp values, the conversion&lt;br /&gt;is lossy because the mapping is not one-to-one in both directions.&lt;br /&gt;Because of daylight saving time, it is possible for two UNIX_TIMESTAMP()&lt;br /&gt;to map two TIMESTAMP values to the same Unix timestamp value.&lt;br /&gt;FROM_UNIXTIME() will map that value back to only one of the original&lt;br /&gt;TIMESTAMP values.  Here is an example, using TIMESTAMP values in &lt;br /&gt;the CET time zone:&lt;br /&gt;&lt;br /&gt;mysql&gt; SELECT UNIX_TIMESTAMP('2005-03-27 03:00:00');&lt;br /&gt;+---------------------------------------+&lt;br /&gt;| UNIX_TIMESTAMP('2005-03-27 03:00:00') |&lt;br /&gt;+---------------------------------------+&lt;br /&gt;|                            1111885200 |&lt;br /&gt;+---------------------------------------+&lt;br /&gt;&lt;br /&gt;mysql&gt; SELECT UNIX_TIMESTAMP('2005-03-27 02:00:00');&lt;br /&gt;+---------------------------------------+&lt;br /&gt;| UNIX_TIMESTAMP('2005-03-27 02:00:00') |&lt;br /&gt;+---------------------------------------+&lt;br /&gt;|                            1111885200 |&lt;br /&gt;+---------------------------------------+&lt;br /&gt;&lt;br /&gt;mysql&gt; SELECT FROM_UNIXTIME(1111885200);&lt;br /&gt;+---------------------------+&lt;br /&gt;| FROM_UNIXTIME(1111885200) |&lt;br /&gt;+---------------------------+&lt;br /&gt;| 2005-03-27 03:00:00       |&lt;br /&gt;+---------------------------+&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/20556118-1961502009791853827?l=leoman730.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://leoman730.blogspot.com/feeds/1961502009791853827/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=20556118&amp;postID=1961502009791853827' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/20556118/posts/default/1961502009791853827'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/20556118/posts/default/1961502009791853827'/><link rel='alternate' type='text/html' href='http://leoman730.blogspot.com/2009/04/unixtimestamp-and-fromunixtime.html' title='UNIX_TIMESTAMP() AND FROM_UNIXTIME()'/><author><name>Leoman730</name><uri>http://www.blogger.com/profile/12392590805408335453</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-20556118.post-1149539138215069868</id><published>2009-03-26T22:08:00.003-05:00</published><updated>2009-03-26T22:38:55.680-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ruby'/><category scheme='http://www.blogger.com/atom/ns#' term='mysql'/><title type='text'>Install Ruby on Leopard</title><content type='html'>Wanna to try out Ruby On Rail long time ago but just dont have time the get it install on my Mac, so tonight is the time. Although Leropard ship with Ruby package, it is not up to dated, and beside it does not has MYSQL C Binding, there are more extra steps need to be perform to get ruby fully function on Leopard. There are already many posts out there show how to configure it. I will summary the main steps here and provides a list of links that i use as a references.&lt;br /&gt;1. Log in as a root&lt;br /&gt;2. Update gem (The one ship in leopard is out of date)&lt;br /&gt;gem update --system&lt;br /&gt;3. Install the latest rails (current 2.2)&lt;br /&gt;gem install rails -v=2.2.2&lt;br /&gt;4. Install MYSQL C binding to improve mysql performance (the tricky one)&lt;br /&gt;=&gt; Use the leopard dvd install xcode tool&lt;br /&gt;=&gt; Run: sudo env ARCHFLAGS="-arch i386" gem install mysql -- --with-&lt;br /&gt;mysql-config=/usr/local/mysql/bin/mysql_config&lt;br /&gt;=&gt;Choose option 3: mysql 2.7 (ruby)&lt;br /&gt;&lt;br /&gt;=====================&lt;br /&gt;To test Rails,&lt;br /&gt;$ rails demo&lt;br /&gt;$ cd demo &lt;br /&gt;$ ruby script/server&lt;br /&gt;veiw page at: http://localhost:3000&lt;br /&gt;&lt;br /&gt;=====================&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.tutorialspoint.com/ruby-on-rails/rails-installation.htm"&gt;Ruby Installation&lt;/a&gt; &lt;br /&gt;&lt;br /&gt;&lt;a href="http://weblog.rubyonrails.org/2007/10/26/today-is-leopard-day"&gt;C Binding issue on Leopard&lt;/a&gt; &lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.macruby.org/trac/wiki/Troubleshooting#IcannotbuildrubymysqlonLeopardwithmysql.combinaries"&gt;Detail on how to fix the problem&lt;/a&gt; &lt;br /&gt;&lt;br /&gt;&lt;a href="http://groups.google.com/group/rails-oceania/browse_thread/thread/39da036af7ced18b"&gt;More detail on C Binding&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/20556118-1149539138215069868?l=leoman730.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://leoman730.blogspot.com/feeds/1149539138215069868/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=20556118&amp;postID=1149539138215069868' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/20556118/posts/default/1149539138215069868'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/20556118/posts/default/1149539138215069868'/><link rel='alternate' type='text/html' href='http://leoman730.blogspot.com/2009/03/install-ruby-on-leopard.html' title='Install Ruby on Leopard'/><author><name>Leoman730</name><uri>http://www.blogger.com/profile/12392590805408335453</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-20556118.post-5045607601839573482</id><published>2009-03-26T11:02:00.002-05:00</published><updated>2009-03-26T11:10:58.930-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='IDE'/><category scheme='http://www.blogger.com/atom/ns#' term='Programming'/><title type='text'>My new web development coding suit</title><content type='html'>These days I am trying out to use another powerful text editing tool, and just find that Textmate is right to the spot. So far i like it very much. Not only because of it simplicities while powerful but also an eye candy tool for coding. &lt;br /&gt;With combine of Expand Drive, i can mount a remote drive to my local machine and editing remote file right from textmate. To enhance performance due to slight delay by remote access, and nature of textmate of auto refreshing when it refocus, install Remate is the right assist for textmate that would solve the problem.&lt;br /&gt;&lt;br /&gt;If interested, try it yourself:&lt;br /&gt;&lt;a href="http://macromates.com/"&gt;TextMate&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.expandrive.com/mac"&gt;Expandrive&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://ciaranwal.sh/2007/11/07/remate-update"&gt;Remate 2&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/20556118-5045607601839573482?l=leoman730.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://leoman730.blogspot.com/feeds/5045607601839573482/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=20556118&amp;postID=5045607601839573482' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/20556118/posts/default/5045607601839573482'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/20556118/posts/default/5045607601839573482'/><link rel='alternate' type='text/html' href='http://leoman730.blogspot.com/2009/03/my-new-web-development-coding-suit.html' title='My new web development coding suit'/><author><name>Leoman730</name><uri>http://www.blogger.com/profile/12392590805408335453</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-20556118.post-5031911863906662357</id><published>2009-02-24T19:47:00.003-05:00</published><updated>2009-02-24T19:52:27.176-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='mysql'/><category scheme='http://www.blogger.com/atom/ns#' term='Database'/><title type='text'>Convert mysql output to another data type</title><content type='html'>Sometimes there's a need to convert a datatype from one to another in the database, for example, if the data is store in utf8 format in the database and you want it output to latin1 datatype, one way to do this is using the convert function that mysql provide. Here a snippy code for that:&lt;br /&gt;&lt;br /&gt;"SELECT CONVERT(fieldname USING latin1) as newfield FROM dbtable"&lt;br /&gt;&lt;br /&gt;More detail can be found on: &lt;a href="http://dev.mysql.com/doc/refman/5.0/en/charset-convert.html"&gt;MYSQL CONVERT FUNCTION&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/20556118-5031911863906662357?l=leoman730.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://leoman730.blogspot.com/feeds/5031911863906662357/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=20556118&amp;postID=5031911863906662357' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/20556118/posts/default/5031911863906662357'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/20556118/posts/default/5031911863906662357'/><link rel='alternate' type='text/html' href='http://leoman730.blogspot.com/2009/02/convert-mysql-output-to-another-data.html' title='Convert mysql output to another data type'/><author><name>Leoman730</name><uri>http://www.blogger.com/profile/12392590805408335453</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-20556118.post-7285692052525294372</id><published>2009-02-17T13:31:00.004-05:00</published><updated>2009-02-17T13:31:50.179-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='mysql'/><category scheme='http://www.blogger.com/atom/ns#' term='Database'/><title type='text'>Migrate column from one table to another table</title><content type='html'>Here is an example on how to migrate column between table:&lt;br /&gt;&lt;br /&gt;update fo_tags en, fo_tags_cn cn, fo_tags_cs cs&lt;br /&gt;set &lt;br /&gt;en.name_cn = cn.name, en.name_cs = cs.name,&lt;br /&gt;en.kind_cn = cn.kind, en.kind_cs = cs.kind&lt;br /&gt;where en.id = cn.id and en.id = cs.id&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/20556118-7285692052525294372?l=leoman730.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://leoman730.blogspot.com/feeds/7285692052525294372/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=20556118&amp;postID=7285692052525294372' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/20556118/posts/default/7285692052525294372'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/20556118/posts/default/7285692052525294372'/><link rel='alternate' type='text/html' href='http://leoman730.blogspot.com/2009/02/migrate-column-from-one-table-to.html' title='Migrate column from one table to another table'/><author><name>Leoman730</name><uri>http://www.blogger.com/profile/12392590805408335453</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-20556118.post-1956319820886840882</id><published>2009-02-06T10:06:00.002-05:00</published><updated>2009-02-06T10:11:50.372-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Web'/><category scheme='http://www.blogger.com/atom/ns#' term='CSS'/><title type='text'>Make png file works with ie 6</title><content type='html'>To make IE 6 works with PNG transparency, one easy way is using a htc script, for example, attached &lt;br /&gt;&lt;br /&gt;img.ispng {&lt;br /&gt;   behavior: url("/png.htc");&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;to the css file, then for each png image, add a "ispng" class to it. &lt;br /&gt;&lt;br /&gt;The png.htc can be download at &lt;a href="http://leoman730.net/png.htc"&gt;png.htc&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/20556118-1956319820886840882?l=leoman730.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://leoman730.blogspot.com/feeds/1956319820886840882/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=20556118&amp;postID=1956319820886840882' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/20556118/posts/default/1956319820886840882'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/20556118/posts/default/1956319820886840882'/><link rel='alternate' type='text/html' href='http://leoman730.blogspot.com/2009/02/make-png-file-works-with-ie-6.html' title='Make png file works with ie 6'/><author><name>Leoman730</name><uri>http://www.blogger.com/profile/12392590805408335453</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-20556118.post-8365792633254567692</id><published>2009-02-02T15:06:00.001-05:00</published><updated>2009-02-02T15:07:35.065-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Web'/><category scheme='http://www.blogger.com/atom/ns#' term='CSS'/><title type='text'>Fixing IE 6 transparent issue</title><content type='html'>Here a small utility to help fix IE 6 transparency issue on PNG graphic.&lt;br /&gt;http://labs.unitinteractive.com/unitpngfix.php&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/20556118-8365792633254567692?l=leoman730.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://leoman730.blogspot.com/feeds/8365792633254567692/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=20556118&amp;postID=8365792633254567692' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/20556118/posts/default/8365792633254567692'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/20556118/posts/default/8365792633254567692'/><link rel='alternate' type='text/html' href='http://leoman730.blogspot.com/2009/02/fixing-ie-6-transparent-issue.html' title='Fixing IE 6 transparent issue'/><author><name>Leoman730</name><uri>http://www.blogger.com/profile/12392590805408335453</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-20556118.post-5795246337043204965</id><published>2008-12-19T13:39:00.001-05:00</published><updated>2008-12-19T13:41:02.246-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ShellScripting'/><title type='text'>Apache log in terminal</title><content type='html'>The location of the log is in : /var/log/apache2&lt;br /&gt;Then use sudo tail -f error.log &lt;br /&gt;Simple right?&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/20556118-5795246337043204965?l=leoman730.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://leoman730.blogspot.com/feeds/5795246337043204965/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=20556118&amp;postID=5795246337043204965' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/20556118/posts/default/5795246337043204965'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/20556118/posts/default/5795246337043204965'/><link rel='alternate' type='text/html' href='http://leoman730.blogspot.com/2008/12/apache-log-in-terminal.html' title='Apache log in terminal'/><author><name>Leoman730</name><uri>http://www.blogger.com/profile/12392590805408335453</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-20556118.post-6563666647342459445</id><published>2008-12-05T10:06:00.002-05:00</published><updated>2008-12-05T10:10:22.614-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ShellScripting'/><title type='text'>Change terminal title on Mac Leopard</title><content type='html'>The leopard ships with tabbing feature for terminal, which is cool. However, the problem with that is you can not change the title at all. I found a little shell script may do the trick froom &lt;a href="http://pseudogreen.org/blog/set_tab_names_in_leopard_terminal.html"&gt;http://pseudogreen.org/blog/set_tab_names_in_leopard_terminal.html&lt;/a&gt;, here is the snippy of the function:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;function set_window_and_tab_title&lt;br /&gt;{&lt;br /&gt;    local title="$1"&lt;br /&gt;    if [[ -z "$title" ]]; then&lt;br /&gt;        title="root"&lt;br /&gt;    fi&lt;br /&gt;&lt;br /&gt;    local tmpdir=~/Library/Caches/${FUNCNAME}_temp&lt;br /&gt;    local cmdfile="$tmpdir/$title"&lt;br /&gt;&lt;br /&gt;    # Set window title&lt;br /&gt;    echo -n -e "\e]0;${title}\a"&lt;br /&gt;&lt;br /&gt;    # Set tab title&lt;br /&gt;    if [[ -n ${CURRENT_TAB_TITLE_PID:+1} ]]; then&lt;br /&gt;        kill $CURRENT_TAB_TITLE_PID&lt;br /&gt;    fi&lt;br /&gt;    mkdir -p $tmpdir&lt;br /&gt;    ln /bin/sleep "$cmdfile"&lt;br /&gt;    "$cmdfile" 10 &amp;&lt;br /&gt;    CURRENT_TAB_TITLE_PID=$(jobs -x echo %+)&lt;br /&gt;    disown %+&lt;br /&gt;    kill -STOP $CURRENT_TAB_TITLE_PID&lt;br /&gt;    command rm -f "$cmdfile"&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/20556118-6563666647342459445?l=leoman730.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://leoman730.blogspot.com/feeds/6563666647342459445/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=20556118&amp;postID=6563666647342459445' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/20556118/posts/default/6563666647342459445'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/20556118/posts/default/6563666647342459445'/><link rel='alternate' type='text/html' href='http://leoman730.blogspot.com/2008/12/change-terminal-title-on-mac-leopard.html' title='Change terminal title on Mac Leopard'/><author><name>Leoman730</name><uri>http://www.blogger.com/profile/12392590805408335453</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-20556118.post-3096820697170640593</id><published>2008-11-27T17:24:00.003-05:00</published><updated>2008-11-27T17:25:53.355-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Apache'/><title type='text'>Apache Set up Vitrual Host</title><content type='html'>Here are the configuration for Apache when setting up virtual host&lt;br /&gt;&lt;br /&gt;NameVirtualHost *:80&lt;br /&gt;&lt;br /&gt;    &lt;VirtualHost  *:80&gt;&lt;br /&gt;        ServerName dev.leoman730.com&lt;br /&gt;        DocumentRoot /Applications/MAMP/htdocs/dev_leoman730&lt;br /&gt;    &lt;/VirtualHost&gt;&lt;br /&gt;&lt;br /&gt;    &lt;VirtualHost *:80&gt;&lt;br /&gt;        ServerName ocmgt.leoman730.com&lt;br /&gt;        DocumentRoot /Applications/MAMP/htdocs/dev_ocmgt&lt;br /&gt;    &lt;/VirtualHost&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Also remember to modify the hosts file accordingly in order for it to work.&lt;br /&gt;&lt;br /&gt;Some more helpful tip can be found: &lt;a href="http://wiki.apache.org/httpd/ExampleVhosts"&gt;Here&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/20556118-3096820697170640593?l=leoman730.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://leoman730.blogspot.com/feeds/3096820697170640593/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=20556118&amp;postID=3096820697170640593' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/20556118/posts/default/3096820697170640593'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/20556118/posts/default/3096820697170640593'/><link rel='alternate' type='text/html' href='http://leoman730.blogspot.com/2008/11/apache-set-up-vitrual-host.html' title='Apache Set up Vitrual Host'/><author><name>Leoman730</name><uri>http://www.blogger.com/profile/12392590805408335453</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-20556118.post-5416651039058054204</id><published>2008-11-27T16:06:00.004-05:00</published><updated>2009-04-21T22:15:17.306-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Apache'/><title type='text'>Set up virtual host on MAMP</title><content type='html'>1. Open your httpd.conf&lt;br /&gt;    This file will reside in /Applications/MAMP/conf/apache/httpd.conf .&lt;br /&gt;    &lt;br /&gt;2. Go to the bottom of httpd.conf find the vhost section, usually locates at the bottom of the file, &lt;br /&gt;add virtual host like this:&lt;br /&gt;&lt;====IF PORT SET TO 8080 ==&gt;&lt;br /&gt;NameVirtualHost *:8080&lt;br /&gt;&lt;br /&gt;&lt;VirtualHost *:8080&gt;&lt;br /&gt;    ServerName dev.domain.net&lt;br /&gt;    DocumentRoot /Applications/MAMP/htdocs/dev_domain&lt;br /&gt;&lt;/VirtualHost&gt;&lt;br /&gt;&lt;br /&gt;&lt;VirtualHost *:8080&gt;&lt;br /&gt;    ServerName test.domain.net&lt;br /&gt;    DocumentRoot /Applications/MAMP/htdocs/test_domain&lt;br /&gt;&lt;/VirtualHost&gt;&lt;br /&gt;   &lt;br /&gt;&lt;====IF PORT SET TO 80 ==&gt;&lt;br /&gt;NameVirtualHost *:80&lt;br /&gt;&lt;br /&gt;&lt;VirtualHost *:80&gt;&lt;br /&gt;    ServerName dev.domain.net&lt;br /&gt;    DocumentRoot /Applications/MAMP/htdocs/dev_domain&lt;br /&gt;&lt;/VirtualHost&gt;&lt;br /&gt;&lt;br /&gt;&lt;VirtualHost *:80&gt;&lt;br /&gt;    ServerName test.domain.net&lt;br /&gt;    DocumentRoot /Applications/MAMP/htdocs/test_domain&lt;br /&gt;&lt;/VirtualHost&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;3. Modify host file, the host file is located at:&lt;br /&gt;/etc/hosts&lt;br /&gt;&lt;br /&gt;Open the file, then add entry:&lt;br /&gt;127.0.0.1 dev.domanin.net&lt;br /&gt;127.0.0.1 test.domain.net&lt;br /&gt;&lt;br /&gt;4. Restart Apache server.&lt;br /&gt;&lt;br /&gt;NOTE:&lt;br /&gt;IF YOU ARE USING PORT 8080 FOR MAMP, YOU CAN ACCESS THE SITE LIKE: http:test.domain.com:8080&lt;br /&gt;IF YOU ARE USING PORT 80 FOR MAMP, YOU CAN ACCESS THE SITE LIKE: http:test.domain.com (If you cannt restar apache from MAMP after set the port 80, make sure no other apache server is using the port already)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/20556118-5416651039058054204?l=leoman730.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://leoman730.blogspot.com/feeds/5416651039058054204/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=20556118&amp;postID=5416651039058054204' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/20556118/posts/default/5416651039058054204'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/20556118/posts/default/5416651039058054204'/><link rel='alternate' type='text/html' href='http://leoman730.blogspot.com/2008/11/set-up-virtual-host-on-mamp.html' title='Set up virtual host on MAMP'/><author><name>Leoman730</name><uri>http://www.blogger.com/profile/12392590805408335453</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-20556118.post-9057462541863677117</id><published>2008-11-27T13:12:00.004-05:00</published><updated>2009-07-07T15:31:02.437-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Web'/><category scheme='http://www.blogger.com/atom/ns#' term='Programming'/><category scheme='http://www.blogger.com/atom/ns#' term='svn'/><title type='text'>Setting Up SVN on mac</title><content type='html'>Here's a tutorial provide information on how to set up entire svn environment for mac.&lt;br /&gt;&lt;a href="http://www.rubyrobot.org/tutorial/subversion-with-mac-os-x"&gt;SVN SET UP&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/20556118-9057462541863677117?l=leoman730.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://leoman730.blogspot.com/feeds/9057462541863677117/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=20556118&amp;postID=9057462541863677117' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/20556118/posts/default/9057462541863677117'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/20556118/posts/default/9057462541863677117'/><link rel='alternate' type='text/html' href='http://leoman730.blogspot.com/2008/11/setting-up-svn-on-mac.html' title='Setting Up SVN on mac'/><author><name>Leoman730</name><uri>http://www.blogger.com/profile/12392590805408335453</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-20556118.post-1031323630470655294</id><published>2008-11-20T12:21:00.002-05:00</published><updated>2008-11-20T12:24:55.591-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='javascript'/><category scheme='http://www.blogger.com/atom/ns#' term='Ajax'/><title type='text'>Ajax weirness</title><content type='html'>When doing an ajax call through javascript, sometimes it may seems like nothing is happening in firebug, instead it thrown an javascript error.&lt;br /&gt;One thing to check is to make sure the permission is correctly setup in the ajax script. The problem i have is that when the php script get call, it upload an image to the server, if upload directory's permission not properly set up, the weirness of this ajax call occur.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/20556118-1031323630470655294?l=leoman730.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://leoman730.blogspot.com/feeds/1031323630470655294/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=20556118&amp;postID=1031323630470655294' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/20556118/posts/default/1031323630470655294'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/20556118/posts/default/1031323630470655294'/><link rel='alternate' type='text/html' href='http://leoman730.blogspot.com/2008/11/ajax-weirness.html' title='Ajax weirness'/><author><name>Leoman730</name><uri>http://www.blogger.com/profile/12392590805408335453</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-20556118.post-4656702265411946454</id><published>2008-11-20T10:45:00.001-05:00</published><updated>2008-11-20T10:47:12.023-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Algorithm'/><category scheme='http://www.blogger.com/atom/ns#' term='Network Security'/><title type='text'>Using biwise operator to implement user access</title><content type='html'>Here's a way to use biwise operator to implement user access of special section on a site.&lt;br /&gt;&lt;br /&gt;1. Define Constants:&lt;br /&gt; PER_ADD = 1  (000001)&lt;br /&gt; PERM_EDIT = 2  (000010)&lt;br /&gt; PERM_DELETE = 4 (000100)&lt;br /&gt; PERM_VIEW = 8  (001000)&lt;br /&gt;&lt;br /&gt;2. Define user access level code:&lt;br /&gt; EDIT =&gt; 63 (111111)&lt;br /&gt; READ =&gt; 8  (000100)&lt;br /&gt; NOACCESS=&gt;0(000000)&lt;br /&gt;&lt;br /&gt;3. Each user is associate with one or more access level code base on the section.&lt;br /&gt;&lt;br /&gt;4. The algorithm to perform user access check is like this:&lt;br /&gt;if((userAccessCode &amp; PERM_EDIT) == PERM_EDIT){&lt;br /&gt; grand access&lt;br /&gt;}else{&lt;br /&gt; access denial&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;How this works?&lt;br /&gt;Using above example, if the user access code for a special section is defined as 63 which the binary representation is 111111, and we want to check if the user has edit permission for the section, then we can use the &amp; biwise operator to figure it out. Sine the PERM_EDIT is define as 2 (000010), so &lt;br /&gt;&lt;br /&gt;  1 1 1 1 1 1  (63)&lt;br /&gt;&amp; 0 0 0 0 1 0  (2)&lt;br /&gt;--------------&lt;br /&gt;  0 0 0 0 1 0  (2)&lt;br /&gt;&lt;br /&gt;which if((userAccessCode &amp; PERM_EDIT) == PERM_EDIT){ } will return true, so user can modify this section.&lt;br /&gt;&lt;br /&gt;Other example, if the user access code is 8 (000100), &lt;br /&gt;&lt;br /&gt;  0 0 0 1 0 0  (63)&lt;br /&gt;&amp; 0 0 0 0 1 0  (8)&lt;br /&gt;--------------&lt;br /&gt;  0 0 0 0 0 0  (0)&lt;br /&gt;&lt;br /&gt;which if((userAccessCode &amp; PERM_EDIT) == PERM_EDIT){ } will return false, so user can not modify this section.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Here's a list of possible combinations:&lt;br /&gt;0 &amp; 0 = 0&lt;br /&gt;8 &amp; 8 = 8 (Read)&lt;br /&gt;63 &amp; 8 = 8 (Read)&lt;br /&gt;63 &amp; 2 = 2 (Write)&lt;br /&gt;8 &amp; 2 = 0 (No write)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/20556118-4656702265411946454?l=leoman730.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://leoman730.blogspot.com/feeds/4656702265411946454/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=20556118&amp;postID=4656702265411946454' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/20556118/posts/default/4656702265411946454'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/20556118/posts/default/4656702265411946454'/><link rel='alternate' type='text/html' href='http://leoman730.blogspot.com/2008/11/using-biwise-operator-to-implement-user.html' title='Using biwise operator to implement user access'/><author><name>Leoman730</name><uri>http://www.blogger.com/profile/12392590805408335453</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-20556118.post-1369541013543846707</id><published>2008-09-29T11:22:00.003-05:00</published><updated>2008-09-29T11:28:12.841-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='javascript'/><category scheme='http://www.blogger.com/atom/ns#' term='Eclipse'/><title type='text'>Javascript editor for Eclipse</title><content type='html'>Recently I was searching for a plug-in for Javascript in Eclipse. And I come up find out a very good plug-in call: Skyway builder. It looks very promising to me. Some feature I like are Code-formating, auto-completion with diff js library such as JQuery, ExtJS... &lt;br /&gt;The plug-in is free from non-commercial use and it is relatively cheap for commercial user. &lt;br /&gt;It could be download at: &lt;a href="http://extjs.org.cn/index.php?q=node/123"&gt;Ext智能提示 - Eclipse 3.2&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/20556118-1369541013543846707?l=leoman730.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://leoman730.blogspot.com/feeds/1369541013543846707/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=20556118&amp;postID=1369541013543846707' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/20556118/posts/default/1369541013543846707'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/20556118/posts/default/1369541013543846707'/><link rel='alternate' type='text/html' href='http://leoman730.blogspot.com/2008/09/javascript-editor-for-eclipse.html' title='Javascript editor for Eclipse'/><author><name>Leoman730</name><uri>http://www.blogger.com/profile/12392590805408335453</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-20556118.post-7015322967836116861</id><published>2008-09-22T09:48:00.001-05:00</published><updated>2008-09-22T09:48:47.962-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ShellScripting'/><title type='text'>Calling a scripting function from .bash_login</title><content type='html'>This rather a very simple issue that i have encounter couple days ago. Yeah, I don't consider myself a console scripting guru. So don't sunrise if you see me to post this. ^_^.&lt;br /&gt;So I have a function "conn_remote" define inside my .bash_login file, when started up the a terminal, I see that the .bash_login file is actually gotten read as it print "Welcome to to bash" (which I defined it in the .bash_login file); however, when i try to call the "conn_remote" function, it said "command not defined". &lt;br /&gt;After some chatting with ppl in IRC, I realize the cause to this is because my .bash_login not defined as the source. So to solve this issue, I put a command "source .bash_login"  whenever a new terminal is fired up, and after this is defined, i was able to call my function freely.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/20556118-7015322967836116861?l=leoman730.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://leoman730.blogspot.com/feeds/7015322967836116861/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=20556118&amp;postID=7015322967836116861' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/20556118/posts/default/7015322967836116861'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/20556118/posts/default/7015322967836116861'/><link rel='alternate' type='text/html' href='http://leoman730.blogspot.com/2008/09/calling-scripting-function-from.html' title='Calling a scripting function from .bash_login'/><author><name>Leoman730</name><uri>http://www.blogger.com/profile/12392590805408335453</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-20556118.post-46029105112959378</id><published>2008-09-11T16:57:00.001-05:00</published><updated>2008-09-11T16:59:10.187-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='javascript'/><category scheme='http://www.blogger.com/atom/ns#' term='extjs'/><title type='text'>Refresh a treepanel</title><content type='html'>An easy way to updatte a treepanel in Ext:&lt;br /&gt;&lt;br /&gt;Ext.getCmp('treepanel_id'). getRootNode().reload();&lt;br /&gt;&lt;br /&gt;Refer to:&lt;a href="http://extjs.com/forum/showthread.php?t=23441"&gt;http://extjs.com/forum/showthread.php?t=23441&lt;/a&gt; to get more info&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/20556118-46029105112959378?l=leoman730.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://leoman730.blogspot.com/feeds/46029105112959378/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=20556118&amp;postID=46029105112959378' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/20556118/posts/default/46029105112959378'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/20556118/posts/default/46029105112959378'/><link rel='alternate' type='text/html' href='http://leoman730.blogspot.com/2008/09/refresh-treepanel.html' title='Refresh a treepanel'/><author><name>Leoman730</name><uri>http://www.blogger.com/profile/12392590805408335453</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-20556118.post-2319779398257689395</id><published>2008-09-08T19:55:00.003-05:00</published><updated>2008-09-08T19:58:47.477-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='javascript'/><category scheme='http://www.blogger.com/atom/ns#' term='extjs'/><title type='text'>Good screencast on handle uploading in Extjs</title><content type='html'>This screencast demonstrate how to create a simple image upload application using extjs.&lt;br /&gt;&lt;a href="http://colinramsay.co.uk/diary/2008/04/27/screencast-dataviews-and-uploading-in-extjs/"&gt;http://colinramsay.co.uk/diary/2008/04/27/screencast-dataviews-and-uploading-in-extjs/&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/20556118-2319779398257689395?l=leoman730.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://leoman730.blogspot.com/feeds/2319779398257689395/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=20556118&amp;postID=2319779398257689395' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/20556118/posts/default/2319779398257689395'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/20556118/posts/default/2319779398257689395'/><link rel='alternate' type='text/html' href='http://leoman730.blogspot.com/2008/09/good-screencast-on-handle-uploading-in.html' title='Good screencast on handle uploading in Extjs'/><author><name>Leoman730</name><uri>http://www.blogger.com/profile/12392590805408335453</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-20556118.post-7675233598204956139</id><published>2008-09-03T16:02:00.002-05:00</published><updated>2008-09-03T16:08:23.301-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='javascript'/><category scheme='http://www.blogger.com/atom/ns#' term='prototype'/><title type='text'>Prototype: How to truncate a string</title><content type='html'>A very nice utility to truncate a string in prototype:&lt;br /&gt;&lt;br /&gt;var test_string = "this is a test string/0";&lt;br /&gt;var new_string = test_string.truncate(test_string.length- 2, '');&lt;br /&gt;&lt;br /&gt;So the new_string should be "this is a test string. Remember though, don't ignore the second paremeter, which now specify there will not be any suffix.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/20556118-7675233598204956139?l=leoman730.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://leoman730.blogspot.com/feeds/7675233598204956139/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=20556118&amp;postID=7675233598204956139' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/20556118/posts/default/7675233598204956139'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/20556118/posts/default/7675233598204956139'/><link rel='alternate' type='text/html' href='http://leoman730.blogspot.com/2008/09/prototype-how-to-truncate-string.html' title='Prototype: How to truncate a string'/><author><name>Leoman730</name><uri>http://www.blogger.com/profile/12392590805408335453</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-20556118.post-7065370666339851872</id><published>2008-08-18T09:43:00.002-05:00</published><updated>2008-08-18T09:47:05.264-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='CMS: Drupal'/><title type='text'>Drupal TINYMCE cause problem in user edit</title><content type='html'>This is a weir issue I found out today on tinymce, so far i am not sure what is the root cause to this issue.&lt;br /&gt;After turned on and create a profile for tinymce, i cannt access user edit page, when click edit, it print out a blank page with a link said "disable tinymce" at the upper left corner, and the page looks like keep looping, by looking at the url, it looks like this"xxx?destination=admin%2Fuser%2Fuser". &lt;br /&gt;As of now, to solve the issue, i disable tinymce module. Anyone find a solution for that please let me know.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/20556118-7065370666339851872?l=leoman730.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://leoman730.blogspot.com/feeds/7065370666339851872/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=20556118&amp;postID=7065370666339851872' title='4 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/20556118/posts/default/7065370666339851872'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/20556118/posts/default/7065370666339851872'/><link rel='alternate' type='text/html' href='http://leoman730.blogspot.com/2008/08/drupal-tinymce-cause-problem-in-user.html' title='Drupal TINYMCE cause problem in user edit'/><author><name>Leoman730</name><uri>http://www.blogger.com/profile/12392590805408335453</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>4</thr:total></entry><entry><id>tag:blogger.com,1999:blog-20556118.post-9057412476021998114</id><published>2008-08-15T08:38:00.000-05:00</published><updated>2008-08-15T08:39:10.521-05:00</updated><title type='text'></title><content type='html'>    &lt;p&gt;&lt;b&gt;Security Research Paper outline&lt;br&gt;&lt;/b&gt;&lt;/p&gt;&lt;br&gt;&lt;p&gt;&lt;br&gt;&lt;/p&gt;&lt;p&gt;This paper will not talk about the detail under the hood but provide wide range of security vanerbility information and also provide some tips on how to protect and increase individual scurity awareness.&lt;br&gt;&lt;/p&gt;&lt;p&gt;&lt;br&gt;&lt;/p&gt;&lt;br&gt;&lt;p&gt;Abstract&lt;br&gt;&lt;/p&gt;&lt;br&gt;&lt;p&gt;Introduction&lt;/p&gt;&lt;ul&gt;&lt;li&gt;The original purpose of internet (papaer form DCN2)&lt;br&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;&lt;br&gt;&lt;/p&gt;&lt;p&gt;Some example of current security issue --&amp;gt; give some statistics&lt;br&gt;&lt;/p&gt;&lt;br&gt;&lt;p&gt;Security issue in detail&lt;/p&gt;&lt;br&gt;&lt;p&gt;&lt;b&gt;Privacy&lt;/b&gt;&lt;br&gt;&lt;/p&gt;&lt;ul&gt;&lt;li&gt;Adware, spyware, Tojans horse, Rootkid&lt;br&gt;&lt;/li&gt;&lt;li&gt;ISP&lt;/li&gt;&lt;li&gt;Email (PGP)  SSL, VPN, --&amp;gt; talk about use some name, but dictionary attack&lt;/li&gt;&lt;li&gt;IE Problem --active X&lt;br&gt;&lt;/li&gt;&lt;li&gt;Password&lt;br&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;b&gt;Attacks --&amp;gt; google hack&lt;br&gt;&lt;/b&gt;&lt;/p&gt;&lt;ul&gt;&lt;li&gt;DoS&lt;/li&gt;&lt;li&gt;DDoS&lt;/li&gt;&lt;li&gt;Bufferoverflow&lt;/li&gt;&lt;li&gt;Packet sniffer&lt;/li&gt;&lt;li&gt;Port scanning&lt;br&gt;&lt;/li&gt;&lt;/ul&gt;&lt;br&gt;&lt;br&gt; &lt;p&gt;&lt;br&gt; &lt;/p&gt; &lt;p&gt;Why security is an issue?&lt;br&gt;     There's no 100% secure application&lt;/p&gt; &lt;p&gt;&lt;br&gt;&lt;/p&gt;&lt;p&gt;&lt;b&gt;Protection&lt;/b&gt;&lt;/p&gt;&lt;ul&gt;&lt;li&gt;Firewall --&amp;gt; talk about window xp sp2&lt;/li&gt;&lt;li&gt;Anti-virus&lt;/li&gt;&lt;li&gt;Password &lt;br&gt;&lt;/li&gt;&lt;li&gt;VMware as sandbox&lt;br&gt;&lt;/li&gt;&lt;/ul&gt;&lt;br&gt;&lt;p&gt;&lt;br&gt;&lt;/p&gt;&lt;br&gt;&lt;p&gt;&lt;br&gt;&lt;/p&gt;&lt;b&gt;Conlcusion&lt;/b&gt;&lt;br&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/20556118-9057412476021998114?l=leoman730.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://leoman730.blogspot.com/feeds/9057412476021998114/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=20556118&amp;postID=9057412476021998114' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/20556118/posts/default/9057412476021998114'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/20556118/posts/default/9057412476021998114'/><link rel='alternate' type='text/html' href='http://leoman730.blogspot.com/2008/08/security-research-paper-outline-this.html' title=''/><author><name>Leoman730</name><uri>http://www.blogger.com/profile/12392590805408335453</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-20556118.post-4749888207059154959</id><published>2008-08-10T15:14:00.002-05:00</published><updated>2008-08-10T15:18:18.239-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='CSS'/><title type='text'>10 usesul CSS trick much know</title><content type='html'>1. Reset browser defaults then reset the browser font size&lt;br /&gt;2. Design centered horizontally (fixed width)&lt;br /&gt;3. Controlling position:absolute, relatively&lt;br /&gt;4. Position an element center screen&lt;br /&gt;5. Global rules that can be re-used&lt;br /&gt;6. IE6 double margin on floated elements&lt;br /&gt;7. Simple navigation bar&lt;br /&gt;8. Table-less contact form&lt;br /&gt;9. Footer hooked to browser bottom&lt;br /&gt;10. Multiple classes applied to one element&lt;br /&gt;&lt;br /&gt;More info, see this: &lt;a href="http://www.peakflowdesign.com/design/10-useful-css-tricks-to-conquer-the-world/"&gt;Article&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/20556118-4749888207059154959?l=leoman730.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://leoman730.blogspot.com/feeds/4749888207059154959/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=20556118&amp;postID=4749888207059154959' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/20556118/posts/default/4749888207059154959'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/20556118/posts/default/4749888207059154959'/><link rel='alternate' type='text/html' href='http://leoman730.blogspot.com/2008/08/10-usesul-css-trick-much-know.html' title='10 usesul CSS trick much know'/><author><name>Leoman730</name><uri>http://www.blogger.com/profile/12392590805408335453</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-20556118.post-5855184605720648892</id><published>2008-08-05T09:06:00.003-05:00</published><updated>2008-08-18T09:47:31.202-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Misc'/><title type='text'>Make cool tag cloud easily</title><content type='html'>This is an very useful site to help make tag cloud:&lt;br /&gt;&lt;a href="http://tagcrowd.com/"&gt;http://tagcrowd.com/&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/20556118-5855184605720648892?l=leoman730.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://leoman730.blogspot.com/feeds/5855184605720648892/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=20556118&amp;postID=5855184605720648892' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/20556118/posts/default/5855184605720648892'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/20556118/posts/default/5855184605720648892'/><link rel='alternate' type='text/html' href='http://leoman730.blogspot.com/2008/08/make-cool-teg-cloud-easily.html' title='Make cool tag cloud easily'/><author><name>Leoman730</name><uri>http://www.blogger.com/profile/12392590805408335453</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-20556118.post-2607258140637185572</id><published>2008-07-28T17:52:00.002-05:00</published><updated>2008-07-28T18:10:36.960-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='CMS: Drupal'/><title type='text'>array_merge_recursive error</title><content type='html'>Today, I ran into a problem with Drupal, when in the admin page, I see this message on top of the page:&lt;br /&gt;array_merge_recursive() [&lt;a href='function.array-merge-recursive'&gt;function.array-merge-recursive&lt;/a&gt;]: recursion detected&lt;br /&gt;&lt;br /&gt;The reason why this was show up because"&lt;br /&gt;  drupal_add_js('sites/all/modules/pmg_import/pmg_import.js');   &lt;br /&gt;&lt;br /&gt;is put into xxx_menu hook.&lt;br /&gt;&lt;br /&gt;The best practice is to put that into the xxx_init() function.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/20556118-2607258140637185572?l=leoman730.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://leoman730.blogspot.com/feeds/2607258140637185572/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=20556118&amp;postID=2607258140637185572' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/20556118/posts/default/2607258140637185572'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/20556118/posts/default/2607258140637185572'/><link rel='alternate' type='text/html' href='http://leoman730.blogspot.com/2008/07/arraymergerecursive-error.html' title='array_merge_recursive error'/><author><name>Leoman730</name><uri>http://www.blogger.com/profile/12392590805408335453</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-20556118.post-8183972556307988563</id><published>2008-07-22T14:02:00.001-05:00</published><updated>2008-07-22T14:03:57.887-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Programming: PHP'/><title type='text'>PHP4 VS PHP5</title><content type='html'>Just find this article great on the different between PHP4 and PHP5.&lt;br /&gt;&lt;br /&gt;http://www.webmaster-talk.com/php-forum/78717-differences-between-php4-and-php5.html&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/20556118-8183972556307988563?l=leoman730.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://leoman730.blogspot.com/feeds/8183972556307988563/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=20556118&amp;postID=8183972556307988563' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/20556118/posts/default/8183972556307988563'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/20556118/posts/default/8183972556307988563'/><link rel='alternate' type='text/html' href='http://leoman730.blogspot.com/2008/07/php4-vs-php5.html' title='PHP4 VS PHP5'/><author><name>Leoman730</name><uri>http://www.blogger.com/profile/12392590805408335453</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-20556118.post-5788699841099590549</id><published>2008-07-21T11:37:00.002-05:00</published><updated>2008-07-21T11:39:36.823-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Programming: PHP'/><title type='text'>Cool and easy way to find timestamp</title><content type='html'>I just find this is cool and useful when try to try a timestamp for particular date in PHP. Of course, there are many ways to do it, but may you find this one quick and easy in PHP.&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;&lt;br /&gt;echo strtotime("now"), "\n";&lt;br /&gt;echo strtotime("10 September 2000"), "\n";&lt;br /&gt;echo strtotime("+1 day"), "\n";&lt;br /&gt;echo strtotime("+1 week"), "\n";&lt;br /&gt;echo strtotime("+1 week 2 days 4 hours 2 seconds"), "\n";&lt;br /&gt;echo strtotime("next Thursday"), "\n";&lt;br /&gt;echo strtotime("last Monday"), "\n";&lt;/blockquote&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/20556118-5788699841099590549?l=leoman730.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://leoman730.blogspot.com/feeds/5788699841099590549/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=20556118&amp;postID=5788699841099590549' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/20556118/posts/default/5788699841099590549'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/20556118/posts/default/5788699841099590549'/><link rel='alternate' type='text/html' href='http://leoman730.blogspot.com/2008/07/cool-and-easy-way-to-find-timestamp.html' title='Cool and easy way to find timestamp'/><author><name>Leoman730</name><uri>http://www.blogger.com/profile/12392590805408335453</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-20556118.post-8306117776694617625</id><published>2008-07-21T09:33:00.002-05:00</published><updated>2008-07-21T09:34:45.633-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Database'/><title type='text'>COUNT and GROUP BY</title><content type='html'>When using "COUNT" and "GROUP BY" in mysql, make sure that the count condition to run after group by, otherwise the sql will fail. &lt;br /&gt;Example:&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;SELECT count(node.uid) as num, node.uid,&lt;br /&gt;   node.created AS node_created&lt;br /&gt; FROM node&lt;br /&gt; WHERE (node.type in ('advisor_update')) AND (node.status &lt;&gt; 0)&lt;br /&gt; AND num &gt; 2&lt;br /&gt;   GROUP BY node.uid&lt;br /&gt;   ORDER BY node_created DESC;&lt;/blockquote&gt;&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;SELECT count(node.uid) as num, node.uid,&lt;br /&gt;   node.created AS node_created&lt;br /&gt; FROM node&lt;br /&gt; WHERE (node.type in ('advisor_update')) AND (node.status &lt;&gt; 0)&lt;br /&gt;   GROUP BY node.uid&lt;br /&gt;   HAVING num &gt; 2&lt;br /&gt;   ORDER BY node_created DESC;&lt;/blockquote&gt;&lt;br /&gt;&lt;br /&gt;The fist statement will fail, use the 2nd statement instead.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/20556118-8306117776694617625?l=leoman730.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://leoman730.blogspot.com/feeds/8306117776694617625/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=20556118&amp;postID=8306117776694617625' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/20556118/posts/default/8306117776694617625'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/20556118/posts/default/8306117776694617625'/><link rel='alternate' type='text/html' href='http://leoman730.blogspot.com/2008/07/count-and-group-by.html' title='COUNT and GROUP BY'/><author><name>Leoman730</name><uri>http://www.blogger.com/profile/12392590805408335453</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-20556118.post-5731516552106009566</id><published>2008-07-18T13:59:00.003-05:00</published><updated>2008-07-18T14:05:23.609-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='javascript'/><title type='text'>String Index using string[index] or string.charAt(index)</title><content type='html'>I found this issue today on string index of javascript for IE 7.&lt;br /&gt;&lt;br /&gt;It seems like IE7 does't like String[index] at all, but it works with string.charAt(indext).&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Try this out:&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;function memberlink_txtchange(id){&lt;br /&gt;  var value = $('#'+id).val();&lt;br /&gt;  var int_var;&lt;br /&gt;  var new_var = '';&lt;br /&gt;  for(var i = 0; i &lt; value.length; i++){&lt;br /&gt;    if(checknumber(value.charAt(i))){&lt;br /&gt;       new_var += value.charAt(i);&lt;br /&gt;     }&lt;br /&gt;  }&lt;br /&gt;&lt;br /&gt;  $('#'+id).val(new_var);&lt;br /&gt;  return true;&lt;br /&gt;}&lt;/blockquote&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/20556118-5731516552106009566?l=leoman730.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://leoman730.blogspot.com/feeds/5731516552106009566/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=20556118&amp;postID=5731516552106009566' title='4 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/20556118/posts/default/5731516552106009566'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/20556118/posts/default/5731516552106009566'/><link rel='alternate' type='text/html' href='http://leoman730.blogspot.com/2008/07/string-index-using-stringindex-or.html' title='String Index using string[index] or string.charAt(index)'/><author><name>Leoman730</name><uri>http://www.blogger.com/profile/12392590805408335453</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>4</thr:total></entry><entry><id>tag:blogger.com,1999:blog-20556118.post-7743039112770916328</id><published>2008-07-18T09:42:00.002-05:00</published><updated>2008-07-18T09:46:13.810-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='CMS: Drupal'/><title type='text'>Drupal write query relate to revision control</title><content type='html'>When write sql in drupal that related to revision control, the best practice is ONLY use nid in the node table, for the rest of the tables, use vid instead. That will prevent contents from syn. See this example for reference:&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;    $query ="SELECT DISTINCT n.nid FROM content_type_event e&lt;br /&gt;                INNER JOIN node n ON n.nid = e.nid&lt;br /&gt;                INNER JOIN content_field_feature cff ON cff.vid = n.vid&lt;br /&gt;                INNER JOIN content_field_date_and_time cfdt ON cfdt.vid = n.vid&lt;br /&gt;                WHERE n.status = '1' AND cfdt.delta = '0'&lt;br /&gt;                AND cff.field_feature_value ='1'&lt;br /&gt;                ORDER BY cfdt.field_date_and_time_value ASC LIMIT 2";&lt;/blockquote&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/20556118-7743039112770916328?l=leoman730.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://leoman730.blogspot.com/feeds/7743039112770916328/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=20556118&amp;postID=7743039112770916328' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/20556118/posts/default/7743039112770916328'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/20556118/posts/default/7743039112770916328'/><link rel='alternate' type='text/html' href='http://leoman730.blogspot.com/2008/07/drupal-write-query-relate-to-revision.html' title='Drupal write query relate to revision control'/><author><name>Leoman730</name><uri>http://www.blogger.com/profile/12392590805408335453</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-20556118.post-7496443813405323009</id><published>2008-06-27T15:29:00.003-05:00</published><updated>2008-06-27T15:33:03.503-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='CMS: Drupal'/><title type='text'>Empty line on source page</title><content type='html'>When creating a custom module for drupal, make sure do not leave empty line after the last line of code; otherwise, it may create empty space (line) on top of the source document. See pic below:&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_axXXZesitZk/SGVOX1s63-I/AAAAAAAAAoY/CzvY2tgCNjM/s1600-h/spacing.JPG"&gt;&lt;img style="cursor: pointer;" src="http://1.bp.blogspot.com/_axXXZesitZk/SGVOX1s63-I/AAAAAAAAAoY/CzvY2tgCNjM/s320/spacing.JPG" alt="" id="BLOGGER_PHOTO_ID_5216661914838032354" border="0" /&gt;&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/20556118-7496443813405323009?l=leoman730.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://leoman730.blogspot.com/feeds/7496443813405323009/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=20556118&amp;postID=7496443813405323009' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/20556118/posts/default/7496443813405323009'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/20556118/posts/default/7496443813405323009'/><link rel='alternate' type='text/html' href='http://leoman730.blogspot.com/2008/06/empty-line-on-source-page.html' title='Empty line on source page'/><author><name>Leoman730</name><uri>http://www.blogger.com/profile/12392590805408335453</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/_axXXZesitZk/SGVOX1s63-I/AAAAAAAAAoY/CzvY2tgCNjM/s72-c/spacing.JPG' height='72' width='72'/><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-20556118.post-5645553211094148092</id><published>2008-03-12T11:35:00.002-05:00</published><updated>2008-03-12T11:39:15.959-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='CMS: Drupal'/><title type='text'>Programmatically insert cck field</title><content type='html'>Ok, after couple hrs of strive on the net. This is an example on how to insert a cck field pro grammatically.&lt;br /&gt;More reference on: &lt;a href="http://drupal.org/node/159186"&gt;http://drupal.org/node/159186&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;function dpci_admin_update_2(){&lt;br /&gt; $cck_path = drupal_get_path("module","Content");&lt;br /&gt; include_once($cck_path."/content_admin.inc");&lt;br /&gt; include_once($cck_path."/content_crud.inc");&lt;br /&gt; include_once($cck_path."/content.module");&lt;br /&gt;&lt;br /&gt; $field_widget_type = 'text-options_onoff';&lt;br /&gt; $label = 'My Check Box';&lt;br /&gt; $content_type = 'page';&lt;br /&gt; $field_name = 'my_check_box';&lt;br /&gt; $properties['field_widget_type']='text-options_onoff';&lt;br /&gt;&lt;br /&gt; // First step of creating the field - create the basic field (corresponds&lt;br /&gt; // to page 1 of the Add field UI).&lt;br /&gt; $default_field_add = array(&lt;br /&gt;   'label' =&gt; $label,&lt;br /&gt;   'type_name' =&gt; $content_type,&lt;br /&gt;   'field_widget_type' =&gt; $field_widget_type,&lt;br /&gt;   'op' =&gt; 'Create field',&lt;br /&gt;   'submit' =&gt; 'Create field',&lt;br /&gt;   'form_id' =&gt; '_content_admin_field_add_new',&lt;br /&gt; );&lt;br /&gt; // Create our new field.&lt;br /&gt; _content_admin_field_add_new_submit('_content_admin_field_add_new', $default_field_add);&lt;br /&gt;&lt;br /&gt; // Second step, update the field with our custom properties.&lt;br /&gt; $default_field_edit = array(&lt;br /&gt;   'label' =&gt; $label,&lt;br /&gt;   'type_name' =&gt; $content_type,&lt;br /&gt;   'weight' =&gt; -10,&lt;br /&gt;   'description' =&gt; 'Some description',&lt;br /&gt;   'default_value_php' =&gt; '',&lt;br /&gt;   'group' =&gt; 0,&lt;br /&gt;   'required' =&gt; 1,&lt;br /&gt;   'multiple' =&gt; FALSE,&lt;br /&gt;   'text_processing' =&gt; 0,&lt;br /&gt;   'max_length' =&gt; '',&lt;br /&gt;   'allowed_values' =&gt; '0|dont check&lt;br /&gt;   1|check',&lt;br /&gt;   'allowed_values_php' =&gt; '',&lt;br /&gt;   'op' =&gt; 'Save field settings',&lt;br /&gt;   'submit' =&gt; 'Save field settings',&lt;br /&gt;   'type_name' =&gt; $content_type,&lt;br /&gt;   'field_name' =&gt; 'field_'.$field_name,&lt;br /&gt;   'form_id' =&gt; '_content_admin_field',&lt;br /&gt;   'default_value' =&gt; array(),        // This might be cruft&lt;br /&gt;   'referenceable_types' =&gt; array(),  // Used in nodereference fields and userreference&lt;br /&gt; );&lt;br /&gt;&lt;br /&gt; foreach($default_field_edit AS $key =&gt; $value) {&lt;br /&gt;   if (isset($properties[$key])) {&lt;br /&gt;     $default_field_edit[$key] = $properties[$key];&lt;br /&gt;   }&lt;br /&gt; }&lt;br /&gt;&lt;br /&gt; // Derive the widget and type from the input type.&lt;br /&gt; $widget_parts = explode('-', $properties['field_widget_type']);&lt;br /&gt; $default_field_edit['widget_type'] = $widget_parts[1];&lt;br /&gt; $default_field_edit['module'] = $widget_parts[0] .', optionwidgets';&lt;br /&gt;&lt;br /&gt; _content_admin_field_submit('_content_admin_field_add_new', $default_field_edit);&lt;br /&gt;&lt;br /&gt; return array();&lt;br /&gt;}&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/20556118-5645553211094148092?l=leoman730.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://leoman730.blogspot.com/feeds/5645553211094148092/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=20556118&amp;postID=5645553211094148092' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/20556118/posts/default/5645553211094148092'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/20556118/posts/default/5645553211094148092'/><link rel='alternate' type='text/html' href='http://leoman730.blogspot.com/2008/03/programmatically-insert-cck-field.html' title='Programmatically insert cck field'/><author><name>Leoman730</name><uri>http://www.blogger.com/profile/12392590805408335453</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-20556118.post-3325003453587530252</id><published>2008-03-10T14:50:00.001-05:00</published><updated>2008-03-10T14:50:51.225-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Programming: PHP'/><title type='text'>Quick way to remove an element from array in php</title><content type='html'>&lt;ol&gt;&lt;li style="font-family: 'Courier New',Courier,monospace; font-weight: normal; font-style: normal; color: rgb(58, 106, 139);"&gt; &lt;div style="font-family: 'Courier New',Courier,monospace; font-weight: normal;"&gt;&lt;span style="color: rgb(255, 153, 51); font-style: italic;"&gt;// our initial array&lt;/span&gt;&lt;/div&gt; &lt;/li&gt;&lt;li style="font-weight: bold; color: rgb(38, 83, 106);"&gt; &lt;div style="font-family: 'Courier New',Courier,monospace; font-weight: normal;"&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;$arr&lt;/span&gt; = &lt;a href="http://www.php.net/array"&gt;&lt;span style="color: rgb(0, 0, 102);"&gt;Array&lt;/span&gt;&lt;/a&gt;&lt;span style="color: rgb(0, 102, 0); font-weight: bold;"&gt;(&lt;/span&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;"blue"&lt;/span&gt;, &lt;span style="color: rgb(255, 0, 0);"&gt;"green"&lt;/span&gt;, &lt;span style="color: rgb(255, 0, 0);"&gt;"red"&lt;/span&gt;, &lt;span style="color: rgb(255, 0, 0);"&gt;"yellow"&lt;/span&gt;, &lt;span style="color: rgb(255, 0, 0);"&gt;"green"&lt;/span&gt;, &lt;span style="color: rgb(255, 0, 0);"&gt;"orange"&lt;/span&gt;, &lt;span style="color: rgb(255, 0, 0);"&gt;"yellow"&lt;/span&gt;, &lt;span style="color: rgb(255, 0, 0);"&gt;"indigo"&lt;/span&gt;, &lt;span style="color: rgb(255, 0, 0);"&gt;"red"&lt;/span&gt;&lt;span style="color: rgb(0, 102, 0); font-weight: bold;"&gt;)&lt;/span&gt;;&lt;/div&gt; &lt;/li&gt;&lt;li style="font-family: 'Courier New',Courier,monospace; font-weight: normal; font-style: normal; color: rgb(58, 106, 139);"&gt; &lt;div style="font-family: 'Courier New',Courier,monospace; font-weight: normal;"&gt;&lt;a href="http://www.php.net/print_r"&gt;&lt;span style="color: rgb(0, 0, 102);"&gt;print_r&lt;/span&gt;&lt;/a&gt;&lt;span style="color: rgb(0, 102, 0); font-weight: bold;"&gt;(&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;$arr&lt;/span&gt;&lt;span style="color: rgb(0, 102, 0); font-weight: bold;"&gt;)&lt;/span&gt;;&lt;/div&gt; &lt;/li&gt;&lt;li style="font-weight: bold; color: rgb(38, 83, 106);"&gt; &lt;div style="font-family: 'Courier New',Courier,monospace; font-weight: normal;"&gt; &lt;/div&gt; &lt;/li&gt;&lt;li style="font-family: 'Courier New',Courier,monospace; font-weight: normal; font-style: normal; color: rgb(58, 106, 139);"&gt; &lt;div style="font-family: 'Courier New',Courier,monospace; font-weight: normal;"&gt;&lt;span style="color: rgb(255, 153, 51); font-style: italic;"&gt;// remove the elements who's values are yellow or red&lt;/span&gt;&lt;/div&gt; &lt;/li&gt;&lt;li style="font-weight: bold; color: rgb(38, 83, 106);"&gt; &lt;div style="font-family: 'Courier New',Courier,monospace; font-weight: normal;"&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;$arr&lt;/span&gt; = &lt;a href="http://www.php.net/array_diff"&gt;&lt;span style="color: rgb(0, 0, 102);"&gt;array_diff&lt;/span&gt;&lt;/a&gt;&lt;span style="color: rgb(0, 102, 0); font-weight: bold;"&gt;(&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;$arr&lt;/span&gt;, &lt;a href="http://www.php.net/array"&gt;&lt;span style="color: rgb(0, 0, 102);"&gt;array&lt;/span&gt;&lt;/a&gt;&lt;span style="color: rgb(0, 102, 0); font-weight: bold;"&gt;(&lt;/span&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;"yellow"&lt;/span&gt;, &lt;span style="color: rgb(255, 0, 0);"&gt;"red"&lt;/span&gt;&lt;span style="color: rgb(0, 102, 0); font-weight: bold;"&gt;)&lt;/span&gt;&lt;span style="color: rgb(0, 102, 0); font-weight: bold;"&gt;)&lt;/span&gt;;&lt;/div&gt; &lt;/li&gt;&lt;li style="font-family: 'Courier New',Courier,monospace; font-weight: normal; font-style: normal; color: rgb(58, 106, 139);"&gt; &lt;div style="font-family: 'Courier New',Courier,monospace; font-weight: normal;"&gt;&lt;a href="http://www.php.net/print_r"&gt;&lt;span style="color: rgb(0, 0, 102);"&gt;print_r&lt;/span&gt;&lt;/a&gt;&lt;span style="color: rgb(0, 102, 0); font-weight: bold;"&gt;(&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;$arr&lt;/span&gt;&lt;span style="color: rgb(0, 102, 0); font-weight: bold;"&gt;)&lt;/span&gt;;&lt;/div&gt; &lt;/li&gt;&lt;/ol&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/20556118-3325003453587530252?l=leoman730.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://leoman730.blogspot.com/feeds/3325003453587530252/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=20556118&amp;postID=3325003453587530252' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/20556118/posts/default/3325003453587530252'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/20556118/posts/default/3325003453587530252'/><link rel='alternate' type='text/html' href='http://leoman730.blogspot.com/2008/03/quick-way-to-remove-element-from-array.html' title='Quick way to remove an element from array in php'/><author><name>Leoman730</name><uri>http://www.blogger.com/profile/12392590805408335453</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-20556118.post-2817896121357084770</id><published>2008-03-05T14:49:00.008-05:00</published><updated>2008-04-02T13:34:30.945-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Database'/><title type='text'>MYSQL Backup and Restore from Command Line</title><content type='html'>To backup a database:&lt;br /&gt;&lt;span style="font-weight: bold; font-style: italic;"&gt;mysqldump dbname &gt;dbname.sql&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;To backup a single table:&lt;br /&gt;&lt;span style="font-weight: bold; font-style: italic;"&gt;mysqldump dbname tbname &gt;tbname.sql&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;To Restore a database:&lt;br /&gt;Create a db named "mydb"&lt;br /&gt;&lt;span style="font-style: italic; font-weight: bold;"&gt;mysql -u username -p mydb &lt;&lt;span&gt; dbname.sql&lt;br /&gt;Reference: &lt;a href="http://www.abbeyworkshop.com/howto/lamp/MySQL_Export_Backup/index.html"&gt;http://www.abbeyworkshop.com/howto/lamp/MySQL_Export_Backup/index.html&lt;/a&gt;&lt;/span&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/20556118-2817896121357084770?l=leoman730.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://leoman730.blogspot.com/feeds/2817896121357084770/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=20556118&amp;postID=2817896121357084770' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/20556118/posts/default/2817896121357084770'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/20556118/posts/default/2817896121357084770'/><link rel='alternate' type='text/html' href='http://leoman730.blogspot.com/2008/03/mysql-backup-and-restore-from-command.html' title='MYSQL Backup and Restore from Command Line'/><author><name>Leoman730</name><uri>http://www.blogger.com/profile/12392590805408335453</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-20556118.post-3466993621508524086</id><published>2008-02-29T19:54:00.001-05:00</published><updated>2008-02-29T19:56:21.608-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Database'/><title type='text'>Finding duplication entry using SQL</title><content type='html'>&lt;pre&gt;Here's a handy query for finding duplicates in a table. Suppose you&lt;br /&gt;want to find all email addresses in a table that exist more than once:&lt;br /&gt;&lt;br /&gt;SELECT email,&lt;br /&gt;COUNT(email) AS NumOccurrences&lt;br /&gt;FROM users&lt;br /&gt;GROUP BY email&lt;br /&gt;HAVING ( COUNT(email) &gt; 1 )&lt;br /&gt;&lt;br /&gt;You could also use this technique to find rows that occur exactly once:&lt;br /&gt;&lt;br /&gt;SELECT email&lt;br /&gt;FROM users&lt;br /&gt;GROUP BY email&lt;br /&gt;HAVING ( COUNT(email) = 1 )&lt;br /&gt;&lt;br /&gt;Reference: http://www.petefreitag.com/item/169.cfm&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/20556118-3466993621508524086?l=leoman730.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://leoman730.blogspot.com/feeds/3466993621508524086/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=20556118&amp;postID=3466993621508524086' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/20556118/posts/default/3466993621508524086'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/20556118/posts/default/3466993621508524086'/><link rel='alternate' type='text/html' href='http://leoman730.blogspot.com/2008/02/finding-duplication-entry-using-sql.html' title='Finding duplication entry using SQL'/><author><name>Leoman730</name><uri>http://www.blogger.com/profile/12392590805408335453</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-20556118.post-336367242608204451</id><published>2008-02-19T10:37:00.001-05:00</published><updated>2008-02-19T10:37:24.978-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Programming: .NET'/><title type='text'>CLR and JIT in .net</title><content type='html'>CLR 就是 Common Language Runtime 是用来运行.net的代码的。&lt;br /&gt;JIT 是 Just In Time。 .net  的代码在编译的时候会通过两个步骤，首先它会被编译成一种中间语言也就是MSIL，然后通过JIT将这中中间语言转换成本地的机器代码。所以把整它能够在不同的机器上提供最好的性能和执行效率。&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/20556118-336367242608204451?l=leoman730.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://leoman730.blogspot.com/feeds/336367242608204451/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=20556118&amp;postID=336367242608204451' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/20556118/posts/default/336367242608204451'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/20556118/posts/default/336367242608204451'/><link rel='alternate' type='text/html' href='http://leoman730.blogspot.com/2008/02/clr-and-jit-in-net.html' title='CLR and JIT in .net'/><author><name>Leoman730</name><uri>http://www.blogger.com/profile/12392590805408335453</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-20556118.post-1280282303007049735</id><published>2008-02-19T10:25:00.001-05:00</published><updated>2008-02-19T10:26:49.222-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Programming: .NET'/><title type='text'>About Object.dispose() in .NET 2.0</title><content type='html'>&lt;div&gt;&lt;span style="font-family:Fixedsys;"&gt;Dispose 方法一般会调用 GC.SuppressFinalize，因此在您使用 Dispose  之后，系统已经认为该对象已经释放，也不会尝试再次处置该对象。&lt;/span&gt;&lt;/div&gt; &lt;div&gt; &lt;/div&gt; &lt;div&gt;&lt;span style="font-family:Fixedsys;"&gt;您需要区分“对象资源被回收”和“对象被回收”两个不同的概念。&lt;/span&gt;&lt;/div&gt; &lt;div&gt; &lt;/div&gt; &lt;div&gt;&lt;span style="font-family:Fixedsys;"&gt;例如，f 是一个 Form 类型的对象，则在内存中，f 本身是一个托管指针，您如果使用了 Dispose  方法，那么 f 指向的 Form 对象中的资源将被释放，也就是说 f 现在指向的 Form  对象已经是无效的，甚至可能指向已经被别的对象占用的空间。&lt;/span&gt;&lt;/div&gt; &lt;div&gt; &lt;/div&gt; &lt;div&gt;&lt;span style="font-family:Fixedsys;"&gt;但是 f 自身仍然占有一个指针的空间（内容是原来的 Form 对象的地址），即使您使用 f = null，那么  f 只是自身的内容变成 null。f 对象本身仍然占用了一个指针的空间。&lt;/span&gt;&lt;/div&gt; &lt;div&gt; &lt;/div&gt; &lt;div&gt;&lt;span style="font-family:Fixedsys;"&gt;您永远无法控制一个托管指针本身的释放（也就是说您无法尝试通知垃圾回收器把 f  自身的空间处置）。垃圾回收器会自动地在 f 对象脱离生存期（如离开了声明的方法，或所在的类实例被处置）后回收该空间。&lt;/span&gt;&lt;/div&gt; &lt;div&gt; &lt;/div&gt; &lt;div&gt;&lt;span style="font-family:Fixedsys;"&gt;一般程序上所说的用 null 来释放空间是这样的：&lt;/span&gt;&lt;/div&gt; &lt;div&gt; &lt;/div&gt; &lt;div&gt;&lt;span style="font-family:Fixedsys;"&gt;object obj = XXXX;&lt;/span&gt;&lt;/div&gt; &lt;div&gt;&lt;span style="font-family:Fixedsys;"&gt;obj = null;&lt;/span&gt;&lt;/div&gt; &lt;div&gt; &lt;/div&gt; &lt;div&gt;&lt;span style="font-family:Fixedsys;"&gt;这里如果把 obj 设置为 null，那么 obj  原来指向的那块空间可能就变成无人可访问了。这时候垃圾回收程序会回收那块空间，但是同样不会回收 obj 本身的空间。&lt;/span&gt;&lt;/div&gt; &lt;div&gt; &lt;/div&gt; &lt;div&gt;&lt;span style="font-family:Fixedsys;"&gt;将处置后对象设置为 null 一般来说在程序使用上有一定意义，因为您可以通过和 null  作比较方便的判断某个对象是否有效。如果不设置为 null，而您又处置了对象，那么如果您只是使用 obj != null 的方式来判断，之后对 obj  作某些操作，那么会引发 ObjectDisposedException。&lt;br /&gt;&lt;br /&gt;===================================================&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;div&gt;&lt;span style="font-family:Fixedsys;"&gt;Object a = new Object();&lt;/span&gt;&lt;/div&gt; &lt;div&gt; &lt;/div&gt; &lt;div&gt;&lt;span style="font-family:Fixedsys;"&gt;此时 a 是一个指针，我们假设他占用 4 个字节（内存 1），而 Object 是一个对象，可能会占用 32  个字节（内存 2）。a 的 4 个字节的内容就是那个 Object 对象所在的位置。&lt;/span&gt;&lt;/div&gt; &lt;div&gt; &lt;/div&gt; &lt;div&gt;&lt;span style="font-family:Fixedsys;"&gt;a = null;&lt;/span&gt;&lt;/div&gt; &lt;div&gt; &lt;/div&gt; &lt;div&gt;&lt;span style="font-family:Fixedsys;"&gt;此处将 a 设置为 null，只是更改了 a 自身的值（把 a 自己的 4 个字节全部置  0），但是结果是使原来 a 指向的内容（内存 2）无法访问。垃圾回收器会看到这一情况，然后回收那个不可访问的对象。同时如果继续使用  a，那么代码运行的时候会检查到您试图获取位置 0 中对象的内容，而位置 0 表示空位置，因此会提示您  NullReferenceException。&lt;/span&gt;&lt;/div&gt; &lt;div&gt; &lt;/div&gt; &lt;div&gt;&lt;span style="font-family:Fixedsys;"&gt;如果用&lt;/span&gt;&lt;/div&gt; &lt;div&gt; &lt;/div&gt; &lt;div&gt;&lt;span style="font-family:Fixedsys;"&gt;a.Dispose();&lt;/span&gt;&lt;/div&gt; &lt;div&gt; &lt;/div&gt; &lt;div&gt;&lt;span style="font-family:Fixedsys;"&gt;那么程序会手动清理干净内存 2 中的一些资源（比如图像资源）。但是此时 a 的内容没有变化，指向的位置还是内存  2。这时就出现一个问题，a 无法在被使用（因为其中的内容已经被处置）。这时候如果您继续使用 a，那么系统不会检测到  NullReferenceException，但是因为实际上里面的内容已经被释放而用作他用，在尝试读取的时候系统会引发  ObjectDisposedException，也就是检测到您尝试读取已经释放掉的位置的内容。&lt;/span&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/20556118-1280282303007049735?l=leoman730.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://leoman730.blogspot.com/feeds/1280282303007049735/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=20556118&amp;postID=1280282303007049735' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/20556118/posts/default/1280282303007049735'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/20556118/posts/default/1280282303007049735'/><link rel='alternate' type='text/html' href='http://leoman730.blogspot.com/2008/02/about-objectdispose-in-net-20.html' title='About Object.dispose() in .NET 2.0'/><author><name>Leoman730</name><uri>http://www.blogger.com/profile/12392590805408335453</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-20556118.post-1898162319690072842</id><published>2008-01-15T16:46:00.001-05:00</published><updated>2008-06-07T14:51:18.405-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='CMS: Drupal'/><title type='text'>Drupal: Multi-site installation</title><content type='html'>In drupal, it is possible to create multiple sites from ONE drupal instance. There are lots of information out on the web show how to do it, but many times are confusing. Following are some summary steps to create multiple sites in drupal:&lt;br /&gt;&lt;br /&gt;There are two url form for multi site: subdomain (site1.domain.com, site2.domain.com) and suburl (domain.com/site1, domain.com/site2).&lt;br /&gt;&lt;br /&gt;Example:&lt;br /&gt;I want to create couple sites: www.gt.com; www.gt.com/site1;  site2.gt.com. I can also create something like this: site1.gt.com/site2&lt;br /&gt;&lt;br /&gt;1. Add virtual server to apache&lt;br /&gt;  &lt;virtualhost&gt;NameVirtualHost *:80&lt;br /&gt;&lt;br /&gt;&lt;virtualhost&gt;&lt;br /&gt;    ServerAdmin name@databasepublish.com&lt;br /&gt;    DocumentRoot "c:/wamp/www"&lt;br /&gt;    ServerName localhost&lt;br /&gt;    &lt;directory&gt;&lt;br /&gt;       AllowOverride All&lt;br /&gt;       Allow from all&lt;br /&gt;    &lt;/directory&gt;&lt;br /&gt;&lt;/virtualhost&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;virtualhost&gt;&lt;br /&gt;    ServerAdmin name@databasepublish.com&lt;br /&gt;    DocumentRoot "c:/wamp/www/multisite"&lt;br /&gt;    ServerName gt.com     //this is good enough to take care of gt.com/site1; gt.com/site2 ... (but make sure set the symbolic link otherwise you will get "page not found" error&lt;br /&gt;    ServerAlias *.multisite.com    //this takes care of: site1.gt.com; site2.gt.com .....&lt;br /&gt;    ErrorLog logs/multisite_error_log&lt;br /&gt;    CustomLog logs/air-access_log common&lt;br /&gt;&lt;br /&gt;    &lt;directory&gt;&lt;br /&gt;    AllowOverride All&lt;br /&gt;    &lt;/directory&gt;&lt;br /&gt;&lt;/virtualhost&gt;&lt;br /&gt;&lt;/virtualhost&gt;&lt;br /&gt;( REMEMBER: all sites must point to the drupal base installation directory, also make sure to set symbolic link if using suburl format)&lt;br /&gt;&lt;br /&gt;2. Modify window host file to point to the domain name, the location of the host file can be refer from &lt;a href="http://leoman730.blogspot.com/2007/07/hostfile-location.html"&gt;http://leoman730.blogspot.com/2007/07/hostfile-location.html&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;3. Create new directories ("gt.com"; "site1.gt.com"; "gt.com.site2" under ) in path_to_drupal_installation/sites.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;Tip: the directory name must match the site location by replacing '/' with '.'&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Copy the settings.php file the default directory into these new directories.&lt;br /&gt;Modify the settings.php accordingly for base_url, and db_url  parameter.&lt;br /&gt;&lt;br /&gt;Ex: in "gt.com.site2" directory, the base_url should be set to&lt;br /&gt;$base_url = 'http://gt.com/site2';&lt;br /&gt;&lt;br /&gt;Also need to modify the db_url to point to the correct database for each site&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;4. Create symbolic link for subsite (This is need is using suburl format)&lt;br /&gt;I am using wamp as example, add alias by create a new alias file. The code should looks like this:&lt;br /&gt;&lt;br /&gt;Alias /site1 "c:/wamp/www/multisite/"    //multiple alias can be added here&lt;br /&gt;&lt;br /&gt;&lt;directory&gt;&lt;br /&gt;    Options Indexes FollowSymLinks MultiViews&lt;br /&gt;    AllowOverride all&lt;br /&gt;        Order allow,deny&lt;br /&gt;    Allow from all&lt;br /&gt;&lt;/directory&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;4. Don't run the install script yet. Create new database for each site using any available tool such as phpadmin, or mysql admin&lt;br /&gt;&lt;br /&gt;5. If the re-write moudle for appach has not been turned on yet, you need to turn that on: See this post for more info: &lt;a href="http://drupal.org/node/15365"&gt;http://drupal.org/node/15365&lt;/a&gt;. Turn this on will enable drupal Clean URL feature&lt;br /&gt;&lt;br /&gt;6. Very Important. After all these modification, restart apache server and mysql server&lt;br /&gt;&lt;br /&gt;7. Go to the new site and run the install.php&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/20556118-1898162319690072842?l=leoman730.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://leoman730.blogspot.com/feeds/1898162319690072842/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=20556118&amp;postID=1898162319690072842' title='31 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/20556118/posts/default/1898162319690072842'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/20556118/posts/default/1898162319690072842'/><link rel='alternate' type='text/html' href='http://leoman730.blogspot.com/2008/01/drupal-multi-site-installation.html' title='Drupal: Multi-site installation'/><author><name>Leoman730</name><uri>http://www.blogger.com/profile/12392590805408335453</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>31</thr:total></entry><entry><id>tag:blogger.com,1999:blog-20556118.post-1306346166335956808</id><published>2008-01-08T10:09:00.000-05:00</published><updated>2008-01-08T10:14:23.933-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='CMS: Drupal'/><title type='text'>Drupal: Clean URL setting</title><content type='html'>It happened to me last time when I have a fresh drupal instance install on my local machine, when I tried to enable "Clean URL" in the admin setting, it bing me back to the homepage. After digging the web for a while, I found that the cause of this is the setting in the apache httpd.conf file. Refer to: &lt;a href="http://drupal.org/node/15365"&gt;http://drupal.org/node/15365&lt;/a&gt; for detail. Basically what we need to do is to enable the rewrite module. After enabled the module, restart the server, and it would work perfectly.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/20556118-1306346166335956808?l=leoman730.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://leoman730.blogspot.com/feeds/1306346166335956808/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=20556118&amp;postID=1306346166335956808' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/20556118/posts/default/1306346166335956808'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/20556118/posts/default/1306346166335956808'/><link rel='alternate' type='text/html' href='http://leoman730.blogspot.com/2008/01/drupal-clean-url-setting.html' title='Drupal: Clean URL setting'/><author><name>Leoman730</name><uri>http://www.blogger.com/profile/12392590805408335453</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-20556118.post-5693919012931802709</id><published>2008-01-04T14:41:00.000-05:00</published><updated>2008-01-04T14:48:45.847-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='CMS: Drupal'/><title type='text'>Drupal way :: A good article on Cache mechanism</title><content type='html'>An very helpful article on druapl cache mechanism that post from Lullabot:&lt;br /&gt;&lt;br /&gt;Original article: &lt;a href="http://www.lullabot.com/articles/a_beginners_guide_to_caching_data"&gt;click here&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;h1 class="title"&gt;A beginner's guide to caching data&lt;/h1&gt;&lt;p&gt;Building complicated, dynamic content in Drupal is easy, but it can come at a price. A lot of the stuff that makes a Web 2.0 site so cool can spell 'performance nightmare' under heavy load, thrashing the database to perform complex queries and expensive calculations every time a user looks at a node or loads a particular page.&lt;/p&gt; &lt;p&gt;One solution is to turn on page caching on Drupal's performance options administration page. That speeds things up for anonymous users by caching the output of each page, greatly reducing the number of DB queries needed when they hit the site. That doesn't help with logged in users, however: because page level caching is an all-or-nothing affair, it only works for the standardized, always-the-same view that anonymous users see when they arrive.&lt;/p&gt; &lt;p&gt;Eventually there comes a time when you have to dig in to your code, identify the database access hot spots, and add caching yourself. Fortunately, Drupal's built-in caching APIs and some simple guidelines can make that task easy.&lt;/p&gt; &lt;h3&gt;The basics&lt;/h3&gt; &lt;p&gt;The first rule of optimization and caching is this: never do something time consuming twice if you can hold onto the results and re-use them. Let's look at a simple example of that principle in action:&lt;br /&gt;&lt;/p&gt;&lt;div class="codeblock"&gt;&lt;code&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;&lt;span style="color: rgb(0, 0, 187);"&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;function &lt;/span&gt;&lt;span style="color: rgb(0, 0, 187);"&gt;my_module_function&lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;(&lt;/span&gt;&lt;span style="color: rgb(0, 0, 187);"&gt;$reset &lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;= &lt;/span&gt;&lt;span style="color: rgb(0, 0, 187);"&gt;FALSE&lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;) {&lt;br /&gt;static &lt;/span&gt;&lt;span style="color: rgb(0, 0, 187);"&gt;$my_data&lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;;&lt;br /&gt;if (!isset(&lt;/span&gt;&lt;span style="color: rgb(0, 0, 187);"&gt;$my_data&lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;) || &lt;/span&gt;&lt;span style="color: rgb(0, 0, 187);"&gt;$reset&lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;) {&lt;br /&gt; &lt;/span&gt;&lt;span style="color: rgb(255, 128, 0);"&gt;// Do your expensive calculations here, and populate $my_data&lt;br /&gt; // with the correct stuff..&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;}&lt;br /&gt;return &lt;/span&gt;&lt;span style="color: rgb(0, 0, 187);"&gt;$my_data&lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;;&lt;br /&gt;}&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 187);"&gt;?&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/div&gt;&lt;br /&gt;The important part to look at in this function is the static variable named $my_data. Static variables start out empty the first time a function is called, but they keep the data they're populated with even when the function is called again. That means that we can check if the variable is already populated, and if so return it immediately without doing any more work. &lt;p&gt;This pattern appears all over the place in Drupal -- including key functions like node_load(). Calling node_load() for a particular node ID requires database hits the first time, but the resulting information is kept in a static variable for the duration of the page load. That way, displaying a node once in a list, a second time in a block, and a third time in a list of related links (for example) doesn't require three full trips to the database.&lt;/p&gt; &lt;p&gt;Another important feature is the use of the $reset variable. Caching is good, but occasionally you want to be sure you're getting the &lt;i&gt;absolute&lt;/i&gt; freshest data available. Using a 'reset' variable in your function, and always performing the 'expensive' version of the function if it's set to TRUE, lets you bypass caching when you really need to.&lt;/p&gt; &lt;h3&gt;Drupal's cache functions&lt;/h3&gt; &lt;p&gt;You might notice that the static variable technique only stores data &lt;i&gt;for the duration of a single page load&lt;/i&gt;. For even better performance, it's often possible to cache data in a more permanent fashion...&lt;br /&gt;&lt;/p&gt;&lt;div class="codeblock"&gt;&lt;code&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;&lt;span style="color: rgb(0, 0, 187);"&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;function &lt;/span&gt;&lt;span style="color: rgb(0, 0, 187);"&gt;my_module_function&lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;(&lt;/span&gt;&lt;span style="color: rgb(0, 0, 187);"&gt;$reset &lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;= &lt;/span&gt;&lt;span style="color: rgb(0, 0, 187);"&gt;FALSE&lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;) {&lt;br /&gt;static &lt;/span&gt;&lt;span style="color: rgb(0, 0, 187);"&gt;$my_data&lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;;&lt;br /&gt;if (!isset(&lt;/span&gt;&lt;span style="color: rgb(0, 0, 187);"&gt;$my_data&lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;) || &lt;/span&gt;&lt;span style="color: rgb(0, 0, 187);"&gt;$reset&lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;) {&lt;br /&gt; if (!&lt;/span&gt;&lt;span style="color: rgb(0, 0, 187);"&gt;$reset &lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;&amp;amp;&amp;amp; (&lt;/span&gt;&lt;span style="color: rgb(0, 0, 187);"&gt;$cache &lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;= &lt;/span&gt;&lt;span style="color: rgb(0, 0, 187);"&gt;cache_get&lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;(&lt;/span&gt;&lt;span style="color: rgb(221, 0, 0);"&gt;'my_module_data'&lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;)) &amp;amp;&amp;amp; !empty(&lt;/span&gt;&lt;span style="color: rgb(0, 0, 187);"&gt;$cache&lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;-&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 187);"&gt;data&lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;)) {&lt;br /&gt;   &lt;/span&gt;&lt;span style="color: rgb(0, 0, 187);"&gt;$my_data &lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;= &lt;/span&gt;&lt;span style="color: rgb(0, 0, 187);"&gt;unserialize&lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;(&lt;/span&gt;&lt;span style="color: rgb(0, 0, 187);"&gt;$cache&lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;-&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 187);"&gt;data&lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;);&lt;br /&gt; }&lt;br /&gt; else {&lt;br /&gt;   &lt;/span&gt;&lt;span style="color: rgb(255, 128, 0);"&gt;// Do your expensive calculations here, and populate $my_data&lt;br /&gt;   // with the correct stuff..&lt;br /&gt;   &lt;/span&gt;&lt;span style="color: rgb(0, 0, 187);"&gt;cache_set&lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;(&lt;/span&gt;&lt;span style="color: rgb(221, 0, 0);"&gt;'my_module_data'&lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;, &lt;/span&gt;&lt;span style="color: rgb(221, 0, 0);"&gt;'cache'&lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;, &lt;/span&gt;&lt;span style="color: rgb(0, 0, 187);"&gt;serialize&lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;(&lt;/span&gt;&lt;span style="color: rgb(0, 0, 187);"&gt;$my_data&lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;));&lt;br /&gt; }&lt;br /&gt;}&lt;br /&gt;return &lt;/span&gt;&lt;span style="color: rgb(0, 0, 187);"&gt;$my_data&lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;;&lt;br /&gt;}&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 187);"&gt;?&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/div&gt; &lt;p&gt;This version of the function still uses the static variable, but it adds another layer: database caching. Drupal's APIs provide three key functions you'll need to be familiar with: &lt;a href="http://api.drupal.org/api/5/function/cache_get"&gt;cache_get()&lt;/a&gt;, &lt;a href="http://api.drupal.org/api/5/function/cache_set"&gt;cache_set()&lt;/a&gt;, and &lt;a href="http://api.drupal.org/api/5/function/cache_clear_all"&gt;cache_clear_all()&lt;/a&gt;. Let's look at how they're used.&lt;/p&gt; &lt;p&gt;After the initial check of the static variable, this function checks Drupal's cache for data stored with a particular key. If it finds it, and the $cache-&gt;data element isn't empty, it unserializes the stored data and sticks it into the $my_data variable.&lt;/p&gt; &lt;p&gt;If no cached version is found (or if we called the function using the $reset parameter), the function does the actual work of generating the data. Then it serializes it, and save it TO the cache so future requests will find it. The key that you pass in as the first parameter can by anything you choose, though it's important to avoid colliding with any other modules' keys. Starting the key with the name of your module is always a good idea.&lt;/p&gt; &lt;p&gt;The end result? A slick little function that saves time whenever it can -- first checking for an in-memory copy of the data, then checking the cache, and finally calculating it from scratch if necessary. You'll see this pattern a lot if you dig into the guts of data-intensive Drupal modules.&lt;/p&gt; &lt;h3&gt;Keeping up to date&lt;/h3&gt; &lt;p&gt;What happens, though, if the data that you've cached becomes outdated and needs to be recalculated? By default, cached information stays around until some module explicitly calls the cache_clear_all() function, emptying out your record. If your data is updated sporadically, you might consider simply calling cache_clear_all('my_module_data', 'cache') each time you save the changes to it. If you're caching quite a few pieces of data (perhaps versions of a particular block for each role on the site), there's a third 'wildcard' parameter:&lt;/p&gt; &lt;div class="codeblock"&gt;&lt;code&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;&lt;span style="color: rgb(0, 0, 187);"&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;(&lt;/span&gt;&lt;span style="color: rgb(221, 0, 0);"&gt;'my_module'&lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;, &lt;/span&gt;&lt;span style="color: rgb(221, 0, 0);"&gt;'cache'&lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;, &lt;/span&gt;&lt;span style="color: rgb(0, 0, 187);"&gt;TRUE&lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;);&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 187);"&gt;?&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/div&gt; &lt;p&gt;This clears out all the cache values whose keys start with 'my_module'.&lt;/p&gt; &lt;p&gt;If you don't need your cached data to be &lt;i&gt;perfectly&lt;/i&gt; up-to-the-second, but you want to keep it reasonably fresh, you can also pass in an expiration date to the cache_set() function. For example:&lt;/p&gt; &lt;div class="codeblock"&gt;&lt;code&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;&lt;span style="color: rgb(0, 0, 187);"&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;(&lt;/span&gt;&lt;span style="color: rgb(221, 0, 0);"&gt;'my_module_data'&lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;, &lt;/span&gt;&lt;span style="color: rgb(221, 0, 0);"&gt;'cache'&lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;, &lt;/span&gt;&lt;span style="color: rgb(0, 0, 187);"&gt;serialize&lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;(&lt;/span&gt;&lt;span style="color: rgb(0, 0, 187);"&gt;$my_data&lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;), &lt;/span&gt;&lt;span style="color: rgb(0, 0, 187);"&gt;time&lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;() + &lt;/span&gt;&lt;span style="color: rgb(0, 0, 187);"&gt;360&lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;);&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 187);"&gt;?&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/div&gt; &lt;p&gt;The final parameter is a unix timestamp value representing the 'expiration date' of the cache data. The easiest way to calculate it is to use the time() function, and add the data's desired lifetime in seconds. Expired entries will be automatically discarded as they pass that date.&lt;/p&gt; &lt;h3&gt;Advanced caching&lt;/h3&gt; &lt;p&gt;You might have noticed that cache_set()'s second parameter is 'cache' -- the name of the table that stores the default cache data. If you're storing large amounts of data in the cache, you can set up your own dedicated cache table and pass its name into the function. That will help keep your cache lookups speedy no matter what other modules are sticking into their own tables. The Views module uses that technique to maintain full control over when its cache data is cleared.&lt;/p&gt; &lt;p&gt;If you're really hoping to squeeze the most out of your server, Drupal also supports the use of alternative caching systems. By changing a single line in your site's settings.php file, you can point it to different implementations of the standard cache_set(), cache_get(), and cache_clear_all() functions. &lt;a href="http://drupal.org/project/fastpath_fscache"&gt;File-based caching&lt;/a&gt;, integration with the open source &lt;a href="http://drupal.org/project/memcache"&gt;memcached&lt;/a&gt; project, and other approaches are all possible. As long as you've used the standard Drupal caching functions, your module's code won't have to be altered.&lt;/p&gt; &lt;h3&gt;A few caveats&lt;/h3&gt; &lt;p&gt;Like all good things, it's possible to overdo it with caching. Sometimes, it just doesn't make sense -- if you're looking up a single record from a table, saving the result to a database cache is silly. Using the &lt;a href="http://drupal.org/project/devel"&gt;Devel&lt;/a&gt; module is a good way to spot the functions where caching will pay off: it can log the queries that are used on your site and highlight the ones that are slow, or the ones that are repeated numerous times on each page.&lt;/p&gt; &lt;p&gt;Other times, the data you're using will just be a bad fit for the standard caching system. If you need to join cached data in SQL queries, for example, cache_set()'s practice of string data as a serialized string will be a problem. In those cases, you'll need to come up with a solution that's specific to your module. VotingAPI maintains one table full of individual votes and another table full of calculated results (averages, sums, etc.) for quick joining when sorting and filtering nodes.&lt;/p&gt; &lt;p&gt;Finally, it's important to remember that the cache is &lt;i&gt;not&lt;/i&gt; long term storage! Since other modules can call cache_clear_all() and wipe it out, you should never put something into it if you can't recalculate it again using the original source data.&lt;/p&gt; &lt;h3&gt;Go west, young Drupaler!&lt;/h3&gt; &lt;p&gt;Congratulations: you now have a powerful set of tools to speed up your code! Go forth, and optimize.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/20556118-5693919012931802709?l=leoman730.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://leoman730.blogspot.com/feeds/5693919012931802709/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=20556118&amp;postID=5693919012931802709' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/20556118/posts/default/5693919012931802709'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/20556118/posts/default/5693919012931802709'/><link rel='alternate' type='text/html' href='http://leoman730.blogspot.com/2008/01/drupal-way-good-article-on-cache.html' title='Drupal way :: A good article on Cache mechanism'/><author><name>Leoman730</name><uri>http://www.blogger.com/profile/12392590805408335453</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-20556118.post-8511053425102146317</id><published>2008-01-03T14:59:00.000-05:00</published><updated>2008-01-03T15:08:04.558-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='CMS: Drupal'/><title type='text'>Drupal menu cache</title><content type='html'>There's an very annoying issue in drupal menu. Suppose you are writing your own module and register it with some menu paths. What if later on you want to change some of the path setting in your module, for example, changing access privilege of a form. I discovered that even I save all my modification, my drupal site still not getting anything changed.&lt;br /&gt;After some diggings, the main cause of these problem is the menu_cache table, where it cache the meun path for fast access. &lt;span style="font-weight: bold;"&gt;Root cause&lt;/span&gt;, modifying the module menu path does not automatically update the menu_cache table. &lt;span style="font-weight: bold;"&gt;Action&lt;/span&gt;, clean all cache in the menu_cache table, the change gets reflected.&lt;br /&gt;&lt;br /&gt;Note: Caching cause a lot of confusion when developing in drupal, getting an understanding of how caching mechanism work in drupal is necessary. Also, sometimes is useful to clean cache of your browser when testing.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/20556118-8511053425102146317?l=leoman730.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://leoman730.blogspot.com/feeds/8511053425102146317/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=20556118&amp;postID=8511053425102146317' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/20556118/posts/default/8511053425102146317'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/20556118/posts/default/8511053425102146317'/><link rel='alternate' type='text/html' href='http://leoman730.blogspot.com/2008/01/drupal-menu-cache.html' title='Drupal menu cache'/><author><name>Leoman730</name><uri>http://www.blogger.com/profile/12392590805408335453</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-20556118.post-34458197057091802</id><published>2008-01-02T11:30:00.000-05:00</published><updated>2008-01-02T11:39:53.419-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='CMS: Drupal'/><title type='text'>drupal_set_message</title><content type='html'>Recently I found this is a very useful function to gain information of a drupal page. It could print out the info on top of the page.&lt;br /&gt;&lt;br /&gt;For example, to get all the name of text area field, I can put the follow little code on:&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;function mythemename_tinymce_theme($init, $textarea_name, $theme_name, $is_running) {&lt;br /&gt; drupal_set_message($textarea_name);&lt;br /&gt;}&lt;/blockquote&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/20556118-34458197057091802?l=leoman730.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://leoman730.blogspot.com/feeds/34458197057091802/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=20556118&amp;postID=34458197057091802' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/20556118/posts/default/34458197057091802'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/20556118/posts/default/34458197057091802'/><link rel='alternate' type='text/html' href='http://leoman730.blogspot.com/2008/01/drupalsetmessage.html' title='drupal_set_message'/><author><name>Leoman730</name><uri>http://www.blogger.com/profile/12392590805408335453</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-20556118.post-6550744256451126150</id><published>2007-12-07T09:33:00.000-05:00</published><updated>2008-01-02T11:53:01.768-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Tips'/><category scheme='http://www.blogger.com/atom/ns#' term='CMS: Drupal'/><title type='text'>Drupal debugging tips</title><content type='html'>Sometims drupal throw this kind of error:&lt;br /&gt;&lt;br /&gt;warning: urldecode() expects parameter 1 to be string, array given in E:\Websites\www\gt\modules\path\path.module on line 142.&lt;br /&gt;&lt;br /&gt;One way to debug this issue is insert the following code into where the error is thrown&lt;br /&gt;&lt;br /&gt;if(is_array($text)){&lt;br /&gt; printArray($text);&lt;br /&gt; backtrace();&lt;br /&gt; exit();&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;Thi tells you which element of the form cause the error, you can also print out what is the argument in the array by setting condition to the backtrace() function. Such as&lt;br /&gt;&lt;br /&gt;If(count($array) == 22){&lt;br /&gt;&lt;br /&gt;$args .= printArray($array);&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;I found this very convience and useful. Better more, Make use of the following function when debugging.&lt;br /&gt;&lt;br /&gt;//back_trace&lt;br /&gt;function backtrace()&lt;br /&gt;{&lt;br /&gt;   $output = "&lt;div style=""&gt;\n";&lt;br /&gt;   $output .= "&lt;b&gt;Backtrace:&lt;/b&gt;&lt;br /&gt;\n";&lt;br /&gt;   $backtrace = debug_backtrace();&lt;br /&gt;&lt;br /&gt;   foreach ($backtrace as $bt) {&lt;br /&gt;       $args = '';&lt;br /&gt;       foreach ($bt['args'] as $a) {&lt;br /&gt;           if (!empty($args)) {&lt;br /&gt;               $args .= ', ';&lt;br /&gt;           }&lt;br /&gt;           switch (gettype($a)) {&lt;br /&gt;           case 'integer':&lt;br /&gt;           case 'double':&lt;br /&gt;               $args .= $a;&lt;br /&gt;               break;&lt;br /&gt;           case 'string':&lt;br /&gt;               $a = htmlspecialchars(substr($a, 0, 64)).((strlen($a) &gt; 64) ? '...' : '');&lt;br /&gt;               $args .= "\"$a\"";&lt;br /&gt;               break;&lt;br /&gt;           case 'array':&lt;br /&gt;               $args .= 'Array('.count($a).')';&lt;br /&gt;               break;&lt;br /&gt;           case 'object':&lt;br /&gt;               $args .= 'Object('.get_class($a).')';&lt;br /&gt;               break;&lt;br /&gt;           case 'resource':&lt;br /&gt;               $args .= 'Resource('.strstr($a, '#').')';&lt;br /&gt;               break;&lt;br /&gt;           case 'boolean':&lt;br /&gt;               $args .= $a ? 'True' : 'False';&lt;br /&gt;               break;&lt;br /&gt;           case 'NULL':&lt;br /&gt;               $args .= 'Null';&lt;br /&gt;               break;&lt;br /&gt;           default:&lt;br /&gt;               $args .= 'Unknown';&lt;br /&gt;           }&lt;br /&gt;       }&lt;br /&gt;       $output .= "&lt;br /&gt;\n";&lt;br /&gt;       $output .= "&lt;b&gt;file:&lt;/b&gt; {$bt['line']} - {$bt['file']}&lt;br /&gt;\n";&lt;br /&gt;       $output .= "&lt;b&gt;call:&lt;/b&gt; {$bt['class']}{$bt['type']}{$bt['function']}($args)&lt;br /&gt;\n";&lt;br /&gt;   }&lt;br /&gt;   $output .= "&lt;/div&gt;\n";&lt;br /&gt;   print $output;&lt;br /&gt;}&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/20556118-6550744256451126150?l=leoman730.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://leoman730.blogspot.com/feeds/6550744256451126150/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=20556118&amp;postID=6550744256451126150' title='5 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/20556118/posts/default/6550744256451126150'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/20556118/posts/default/6550744256451126150'/><link rel='alternate' type='text/html' href='http://leoman730.blogspot.com/2007/12/drupal-debugging-tips.html' title='Drupal debugging tips'/><author><name>Leoman730</name><uri>http://www.blogger.com/profile/12392590805408335453</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>5</thr:total></entry><entry><id>tag:blogger.com,1999:blog-20556118.post-6560204040016561997</id><published>2007-11-16T14:56:00.000-05:00</published><updated>2007-11-16T14:58:33.413-05:00</updated><title type='text'>Eclipse -&gt; Chnage editor background color</title><content type='html'>&lt;div class=Section1&gt;  &lt;p class=MsoNormal&gt;&lt;font size=2 face=Arial&gt;&lt;span style='font-size:10.0pt; font-family:Arial'&gt;To change the background color of editor,&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p class=MsoNormal&gt;&lt;font size=2 face=Arial&gt;&lt;span style='font-size:10.0pt; font-family:Arial'&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;  &lt;ol style='margin-top:0in' start=1 type=1&gt;  &lt;li class=MsoNormal style='mso-list:l0 level1 lfo1'&gt;&lt;font size=2 face=Arial&gt;&lt;span      style='font-size:10.0pt;font-family:Arial'&gt;In the editing area, right      click then select preferences&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/font&gt;&lt;/li&gt;  &lt;li class=MsoNormal style='mso-list:l0 level1 lfo1'&gt;&lt;font size=2 face=Arial&gt;&lt;span      style='font-size:10.0pt;font-family:Arial'&gt;In Editor -&amp;gt; Structure Text      Editor, in the Appearance tab on the right, where you can change color      preference&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/font&gt;&lt;/li&gt; &lt;/ol&gt;  &lt;/div&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/20556118-6560204040016561997?l=leoman730.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://leoman730.blogspot.com/feeds/6560204040016561997/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=20556118&amp;postID=6560204040016561997' title='5 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/20556118/posts/default/6560204040016561997'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/20556118/posts/default/6560204040016561997'/><link rel='alternate' type='text/html' href='http://leoman730.blogspot.com/2007/11/eclipse-chnage-editor-background-color.html' title='Eclipse -&gt; Chnage editor background color'/><author><name>Leoman730</name><uri>http://www.blogger.com/profile/12392590805408335453</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>5</thr:total></entry><entry><id>tag:blogger.com,1999:blog-20556118.post-1201017031929399062</id><published>2007-11-01T14:41:00.000-05:00</published><updated>2007-11-01T14:43:35.052-05:00</updated><title type='text'>Eclipse Update manager</title><content type='html'>&lt;div class=Section1&gt;  &lt;p class=MsoNormal&gt;&lt;font size=2 face=Arial&gt;&lt;span style='font-size:10.0pt; font-family:Arial'&gt;It is good idea to bookmark &lt;/span&gt;&lt;/font&gt;&lt;a href="http://update.eclipse.org/updates/"&gt;http://update.eclipse.org/updates/&lt;/a&gt; in eclipse.&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;ol style='margin-top:0in' start=1 type=1&gt;  &lt;li class=MsoNormal style='mso-list:l0 level1 lfo1'&gt;&lt;font size=3      face="Times New Roman"&gt;&lt;span style='font-size:12.0pt'&gt;Help -&amp;gt;software      update&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/font&gt;&lt;/li&gt;  &lt;li class=MsoNormal style='mso-list:l0 level1 lfo1'&gt;&lt;font size=3      face="Times New Roman"&gt;&lt;span style='font-size:12.0pt'&gt;Search for new      feature and install&lt;/span&gt;&lt;/font&gt;&lt;font size=2 face=Arial&gt;&lt;span      style='font-size:10.0pt;font-family:Arial'&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/font&gt;&lt;/li&gt;  &lt;li class=MsoNormal style='mso-list:l0 level1 lfo1'&gt;&lt;font size=3      face="Times New Roman"&gt;&lt;span style='font-size:12.0pt'&gt;Click new remote      site, give it a name and the address as: &lt;a      href="http://update.eclipse.org/updates/"&gt;http://update.eclipse.org/updates/&lt;/a&gt;&lt;/span&gt;&lt;/font&gt;&lt;font      size=2 face=Arial&gt;&lt;span style='font-size:10.0pt;font-family:Arial'&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/font&gt;&lt;/li&gt;  &lt;li class=MsoNormal style='mso-list:l0 level1 lfo1'&gt;&lt;font size=3      face="Times New Roman"&gt;&lt;span style='font-size:12.0pt'&gt;Click Ok.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/font&gt;&lt;/li&gt; &lt;/ol&gt;  &lt;p class=MsoNormal&gt;&lt;font size=3 face="Times New Roman"&gt;&lt;span style='font-size: 12.0pt'&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;  &lt;/div&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/20556118-1201017031929399062?l=leoman730.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://leoman730.blogspot.com/feeds/1201017031929399062/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=20556118&amp;postID=1201017031929399062' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/20556118/posts/default/1201017031929399062'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/20556118/posts/default/1201017031929399062'/><link rel='alternate' type='text/html' href='http://leoman730.blogspot.com/2007/11/eclipse-update-manager.html' title='Eclipse Update manager'/><author><name>Leoman730</name><uri>http://www.blogger.com/profile/12392590805408335453</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-20556118.post-598616814839673148</id><published>2007-11-01T09:27:00.000-05:00</published><updated>2007-11-01T09:29:53.101-05:00</updated><title type='text'>Some tips about "Return false" on a javascript</title><content type='html'>&lt;div class=Section1&gt;  &lt;p class=MsoNormal&gt;&lt;font size=2 face=Verdana&gt;&lt;span style='font-size:10.0pt; font-family:Verdana'&gt;Forms are objects; they have their own methods, properties, and event handlers. One event handler that you should know about is &lt;/span&gt;&lt;/font&gt;&lt;tt&gt;&lt;font size=2 face="Courier New"&gt;&lt;span style='font-size:10.0pt'&gt;onSubmit&lt;/span&gt;&lt;/font&gt;&lt;/tt&gt;&lt;font size=2 face=Verdana&gt;&lt;span style='font-size:10.0pt;font-family:Verdana'&gt;.&lt;/span&gt;&lt;/font&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p&gt;&lt;tt&gt;&lt;font size=2 face="Courier New"&gt;&lt;span style='font-size:10.0pt'&gt;onSubmit&lt;/span&gt;&lt;/font&gt;&lt;/tt&gt;&lt;font size=2 face=Verdana&gt;&lt;span style='font-size:10.0pt;font-family:Verdana'&gt; gets called in two situations: if a user clicks on a Submit button, or if a user hits Return in a text field. If these actions are not handled in some way, your JavaScript may behave differently than expected. Try clicking on Submit below and see what happens.&lt;/span&gt;&lt;/font&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;form&gt;  &lt;p class=MsoNormal&gt;&lt;font size=2 face=Verdana&gt;&lt;span style='font-size:10.0pt; font-family:Verdana'&gt;&lt;INPUT TYPE="submit"&gt;&lt;/span&gt;&lt;/font&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p&gt;&lt;font size=2 face=Verdana&gt;&lt;span style='font-size:10.0pt;font-family:Verdana'&gt;In Netscape, clicking on an unhandled Submit button generally leads to reloading the page. In general, you won't want this. In order to block this behavior, you need to do this: &lt;/span&gt;&lt;/font&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;pre&gt;&lt;font size=2 face=Verdana&gt;&lt;span style='font-size:10.0pt;font-family:Verdana'&gt;&amp;lt;form onSubmit=&amp;quot;return false;&amp;quot;&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/font&gt;&lt;/pre&gt;&lt;pre&gt;&lt;font size=2 face=Verdana&gt;&lt;span style='font-size:10.0pt;font-family:Verdana'&gt;&amp;lt;input type=&amp;quot;submit&amp;quot; value=&amp;quot;Submit&amp;quot;&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/font&gt;&lt;/pre&gt;&lt;pre&gt;&lt;font size=2 face=Verdana&gt;&lt;span style='font-size:10.0pt;font-family:Verdana'&gt;&amp;lt;/form&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/font&gt;&lt;/pre&gt;  &lt;p&gt;&lt;font size=2 face=Verdana&gt;&lt;span style='font-size:10.0pt;font-family:Verdana'&gt;Try it: &lt;/span&gt;&lt;/font&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;form onsubmit="return false;"&gt;  &lt;p class=MsoNormal&gt;&lt;font size=2 face=Verdana&gt;&lt;span style='font-size:10.0pt; font-family:Verdana'&gt;&lt;INPUT TYPE="submit" VALUE="Click on me"&gt;&lt;/span&gt;&lt;/font&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p&gt;&lt;font size=2 face=Verdana&gt;&lt;span style='font-size:10.0pt;font-family:Verdana'&gt;Generally, &lt;/span&gt;&lt;/font&gt;&lt;tt&gt;&lt;font size=2 face="Courier New"&gt;&lt;span style='font-size:10.0pt'&gt;return false&lt;/span&gt;&lt;/font&gt;&lt;/tt&gt;&lt;font size=2 face=Verdana&gt;&lt;span style='font-size:10.0pt; font-family:Verdana'&gt; is a way that JavaScript stops your browser from doing what it would otherwise do. Another example of this is stopping an &lt;/span&gt;&lt;/font&gt;&lt;tt&gt;&lt;font size=2 face="Courier New"&gt;&lt;span style='font-size:10.0pt'&gt;href&lt;/span&gt;&lt;/font&gt;&lt;/tt&gt;&lt;font size=2 face=Verdana&gt;&lt;span style='font-size:10.0pt;font-family:Verdana'&gt; from going to the URL assigned to it. For example, the link ... &lt;/span&gt;&lt;/font&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class=MsoNormal&gt;&lt;tt&gt;&lt;font size=2 face="Courier New"&gt;&lt;span style='font-size: 10.0pt'&gt;&amp;lt;a href=&amp;quot;http://www.webmonkey.com/&amp;quot; &lt;/span&gt;&lt;/font&gt;&lt;/tt&gt;&lt;font size=2 face="Courier New"&gt;&lt;span style='font-size:10.0pt;font-family:"Courier New"'&gt;&lt;br&gt; &lt;tt&gt;&lt;font face="Courier New"&gt;onClick=&amp;quot;return false;&amp;quot;&amp;gt;mattmarg!&amp;lt;/a&amp;gt; &lt;/font&gt;&lt;/tt&gt;&lt;/span&gt;&lt;/font&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p&gt;&lt;font size=2 face=Verdana&gt;&lt;span style='font-size:10.0pt;font-family:Verdana'&gt;... won't go anywhere because you've returned false on the onClick. &lt;a href="http://www.webmonkey.com/"&gt;&lt;font size=3&gt;&lt;span style='font-size:12.0pt'&gt;Click on this dead link&lt;/span&gt;&lt;/font&gt;&lt;/a&gt;, if you don't believe me. &lt;/span&gt;&lt;/font&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p&gt;&lt;font size=2 face=Verdana&gt;&lt;span style='font-size:10.0pt;font-family:Verdana'&gt;This may seem like a weird thing to do, but actually it's quite common, especially in the case of forms. Here's an example of using a form to get input from a user. Type something into this text field and hit Return:&lt;/span&gt;&lt;/font&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;form name="text_entry_form" onsubmit="monkeyLove(); return false;"&gt;  &lt;p class=MsoNormal&gt;&lt;b&gt;&lt;font size=2 face=Verdana&gt;&lt;span style='font-size:10.0pt; font-family:Verdana;font-weight:bold'&gt;Who does the monkey love: &lt;/span&gt;&lt;/font&gt;&lt;/b&gt;&lt;font size=2 face=Verdana&gt;&lt;span style='font-size:10.0pt;font-family:Verdana'&gt;&lt;INPUT TYPE="text" SIZE="30" NAME="monkey_love"&gt;&lt;/span&gt;&lt;/font&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p&gt;&lt;font size=2 face=Verdana&gt;&lt;span style='font-size:10.0pt;font-family:Verdana'&gt;Here's the form: &lt;/span&gt;&lt;/font&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p&gt;&lt;tt&gt;&lt;font size=2 face="Courier New"&gt;&lt;span style='font-size:10.0pt'&gt;&amp;lt;form name=&amp;quot;text_entry_form&amp;quot; onSubmit=&amp;quot;monkeyLove(); return false;&amp;quot;&amp;gt;&lt;/span&gt;&lt;/font&gt;&lt;/tt&gt;&lt;font size=2 face="Courier New"&gt;&lt;span style='font-size:10.0pt;font-family:"Courier New"'&gt;&lt;br&gt; &lt;tt&gt;&lt;font face="Courier New"&gt;&amp;lt;b&amp;gt;Who does the monkey love: &amp;lt;/b&amp;gt;&lt;/font&gt;&lt;/tt&gt;&lt;br&gt; &lt;tt&gt;&lt;font face="Courier New"&gt;&amp;lt;input type=&amp;quot;text&amp;quot; name=&amp;quot;monkey_love&amp;quot; size=&amp;quot;30&amp;quot;&amp;gt;&lt;/font&gt;&lt;/tt&gt;&lt;br&gt; &lt;tt&gt;&lt;font face="Courier New"&gt;&amp;lt;/form&amp;gt; &lt;/font&gt;&lt;/tt&gt;&lt;/span&gt;&lt;/font&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p&gt;&lt;font size=2 face=Verdana&gt;&lt;span style='font-size:10.0pt;font-family:Verdana'&gt;When you hit Return in the text field, the &lt;/span&gt;&lt;/font&gt;&lt;tt&gt;&lt;font size=2 face="Courier New"&gt;&lt;span style='font-size:10.0pt'&gt;onSubmit&lt;/span&gt;&lt;/font&gt;&lt;/tt&gt;&lt;font size=2 face=Verdana&gt;&lt;span style='font-size:10.0pt;font-family:Verdana'&gt; handler gets called. It executes the function &lt;/span&gt;&lt;/font&gt;&lt;tt&gt;&lt;font size=2 face="Courier New"&gt;&lt;span style='font-size:10.0pt'&gt;monkeyLove()&lt;/span&gt;&lt;/font&gt;&lt;/tt&gt;&lt;font size=2 face=Verdana&gt;&lt;span style='font-size:10.0pt;font-family:Verdana'&gt;, which changes the value in the text field.&lt;/span&gt;&lt;/font&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p&gt;&lt;font size=2 face=Verdana&gt;&lt;span style='font-size:10.0pt;font-family:Verdana'&gt;If the &lt;/span&gt;&lt;/font&gt;&lt;tt&gt;&lt;font size=2 face="Courier New"&gt;&lt;span style='font-size: 10.0pt'&gt;return false&lt;/span&gt;&lt;/font&gt;&lt;/tt&gt;&lt;font size=2 face=Verdana&gt;&lt;span style='font-size:10.0pt;font-family:Verdana'&gt; wasn't in the &lt;/span&gt;&lt;/font&gt;&lt;tt&gt;&lt;font size=2 face="Courier New"&gt;&lt;span style='font-size:10.0pt'&gt;onSubmit&lt;/span&gt;&lt;/font&gt;&lt;/tt&gt;&lt;font size=2 face=Verdana&gt;&lt;span style='font-size:10.0pt;font-family:Verdana'&gt; handler, the function &lt;/span&gt;&lt;/font&gt;&lt;tt&gt;&lt;font size=2 face="Courier New"&gt;&lt;span style='font-size:10.0pt'&gt;monkeyLove()&lt;/span&gt;&lt;/font&gt;&lt;/tt&gt;&lt;font size=2 face=Verdana&gt;&lt;span style='font-size:10.0pt;font-family:Verdana'&gt; would execute, changing the text field, but then the page would reload, changing the text field back to what it was. To stop this from happening, you need to have that &lt;/span&gt;&lt;/font&gt;&lt;tt&gt;&lt;font size=2 face="Courier New"&gt;&lt;span style='font-size:10.0pt'&gt;return false&lt;/span&gt;&lt;/font&gt;&lt;/tt&gt;&lt;font size=2 face=Verdana&gt;&lt;span style='font-size:10.0pt;font-family:Verdana'&gt; in the &lt;/span&gt;&lt;/font&gt;&lt;tt&gt;&lt;font size=2 face="Courier New"&gt;&lt;span style='font-size:10.0pt'&gt;onSubmit&lt;/span&gt;&lt;/font&gt;&lt;/tt&gt;&lt;font size=2 face=Verdana&gt;&lt;span style='font-size:10.0pt;font-family:Verdana'&gt;. &lt;/span&gt;&lt;/font&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p&gt;&lt;font size=2 face=Verdana&gt;&lt;span style='font-size:10.0pt;font-family:Verdana'&gt;Here's the &lt;/span&gt;&lt;/font&gt;&lt;tt&gt;&lt;font size=2 face="Courier New"&gt;&lt;span style='font-size: 10.0pt'&gt;monkeyLove()&lt;/span&gt;&lt;/font&gt;&lt;/tt&gt;&lt;font size=2 face=Verdana&gt;&lt;span style='font-size:10.0pt;font-family:Verdana'&gt; function for your perusal: &lt;/span&gt;&lt;/font&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;pre&gt;&lt;font size=2 face=Verdana&gt;&lt;span style='font-size:10.0pt;font-family:Verdana'&gt;function monkeyLove()&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/font&gt;&lt;/pre&gt;&lt;pre&gt;&lt;font size=2 face=Verdana&gt;&lt;span style='font-size:10.0pt;font-family:Verdana'&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/font&gt;&lt;/pre&gt;&lt;pre&gt;&lt;font size=2 face=Verdana&gt;&lt;span style='font-size:10.0pt;font-family:Verdana'&gt;&amp;nbsp; var who_it_is = window.document.text_entry_form.monkey_love.value;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/font&gt;&lt;/pre&gt;&lt;pre&gt;&lt;font size=2 face=Verdana&gt;&lt;span style='font-size:10.0pt;font-family:Verdana'&gt;&amp;nbsp; who_it_is = 'The monkey loves ' + who_it_is;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/font&gt;&lt;/pre&gt;&lt;pre&gt;&lt;font size=2 face=Verdana&gt;&lt;span style='font-size:10.0pt;font-family:Verdana'&gt;&amp;nbsp; window.document.text_entry_form.monkey_love.value = who_it_is;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/font&gt;&lt;/pre&gt;&lt;pre&gt;&lt;font size=2 face=Verdana&gt;&lt;span style='font-size:10.0pt;font-family:Verdana'&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/font&gt;&lt;/pre&gt;  &lt;p&gt;&lt;font size=2 face=Verdana&gt;&lt;span style='font-size:10.0pt;font-family:Verdana'&gt;And here's an example of the same form without the return false, just so you can see what happens: &lt;/span&gt;&lt;/font&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;form name="text_entry_form2" onsubmit="monkeyLove2();"&gt;  &lt;p class=MsoNormal&gt;&lt;b&gt;&lt;font size=2 face=Verdana&gt;&lt;span style='font-size:10.0pt; font-family:Verdana;font-weight:bold'&gt;Who does the monkey love: &lt;/span&gt;&lt;/font&gt;&lt;/b&gt;&lt;font size=2 face=Verdana&gt;&lt;span style='font-size:10.0pt;font-family:Verdana'&gt;&lt;INPUT TYPE="text" SIZE="40" NAME="monkey_love2"&gt;&lt;/span&gt;&lt;/font&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;/form&gt;  &lt;/form&gt;  &lt;/form&gt;  &lt;/form&gt;  &lt;p class=MsoNormal&gt;&lt;font size=2 face=Arial&gt;&lt;span style='font-size:10.0pt; font-family:Arial'&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p class=MsoNormal&gt;&lt;font size=2 face=Arial&gt;&lt;span style='font-size:10.0pt; font-family:Arial'&gt;Reference: &lt;a href="http://www.webmonkey.com/webmonkey/98/04/index3a_page5.html"&gt;http://www.webmonkey.com/webmonkey/98/04/index3a_page5.html&lt;/a&gt;?&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p class=MsoNormal&gt;&lt;font size=2 face=Arial&gt;&lt;span style='font-size:10.0pt; font-family:Arial'&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p class=MsoNormal&gt;&lt;font size=3 face="Times New Roman"&gt;&lt;span style='font-size: 12.0pt'&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;  &lt;/div&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/20556118-598616814839673148?l=leoman730.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://leoman730.blogspot.com/feeds/598616814839673148/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=20556118&amp;postID=598616814839673148' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/20556118/posts/default/598616814839673148'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/20556118/posts/default/598616814839673148'/><link rel='alternate' type='text/html' href='http://leoman730.blogspot.com/2007/11/some-tips-about-return-false-on.html' title='Some tips about &quot;Return false&quot; on a javascript'/><author><name>Leoman730</name><uri>http://www.blogger.com/profile/12392590805408335453</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-20556118.post-7163476974885108</id><published>2007-10-26T09:33:00.000-05:00</published><updated>2007-10-26T09:34:59.962-05:00</updated><title type='text'>Javascript: Trim() function using regular expression</title><content type='html'>&lt;div class=Section1&gt;&lt;pre&gt;&lt;font size=2 face="Courier New"&gt;&lt;span style='font-size:10.0pt'&gt;var trimmed = str.replace(/^\s+|\s+$/g, '');&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/font&gt;&lt;/pre&gt;  &lt;p class=MsoNormal&gt;&lt;font size=2 face=Arial&gt;&lt;span style='font-size:10.0pt; font-family:Arial'&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;  &lt;/div&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/20556118-7163476974885108?l=leoman730.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://leoman730.blogspot.com/feeds/7163476974885108/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=20556118&amp;postID=7163476974885108' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/20556118/posts/default/7163476974885108'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/20556118/posts/default/7163476974885108'/><link rel='alternate' type='text/html' href='http://leoman730.blogspot.com/2007/10/javascript-trim-function-using-regular.html' title='Javascript: Trim() function using regular expression'/><author><name>Leoman730</name><uri>http://www.blogger.com/profile/12392590805408335453</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-20556118.post-2888732199984171144</id><published>2007-10-21T19:45:00.000-05:00</published><updated>2007-10-21T19:51:54.729-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Programming: PHP'/><title type='text'>Install Drupal the easiest way with MAMP</title><content type='html'>This is a great article shows how to install Drupal, PHP, Mysql and Apache on your mac with very lease pain.&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;&lt;br /&gt;Want to take the latest, greatest edition of Drupal out for a spin - and run it from the comfort and safety of your very own Mac? Only a few short years ago, that was strictly the domain of the geekier Mac users… but today, it’s a lot easier.&lt;br /&gt;&lt;br /&gt;That’s thanks to programs like MAMP, which stands for Macintosh, Apache, MySQL and PHP. MAMP lets you install and launch these powerful tools without ever having to stare a command line in the face. And once you have them up and running (which you will in just a few clicks), you can install all sorts of server-side software on your Mac and access it through your web browser - programs like WordPress, activeCollab and, yes, Drupal.&lt;br /&gt;&lt;br /&gt;Why do that? Partly so you can futz around with them even if you aren’t connected to the web, and with the kind of access no web host in their right minds would give you. Partly so you can configure, test and debug web sites on your computer without worrying that the world is watching. But mainly because, come on, this is kind of cool.&lt;br /&gt;&lt;br /&gt;So let’s not waste any more time gabbing. We’re going to install Drupal (by the way, you can adapt these instructions for a lot of other server software): not boring old version 4.7, but the exciting new testing version with the very latest features. One of those features is an automatic installer, which is how we’re able to hold this down to five easy steps.&lt;br /&gt;&lt;br /&gt;(If you do want to install version 4.7, then instead of step 5, you’d manually edit the settings.php file in Drupal’s sites/install folder, and then run a few MySQL files through PHPMyAdmin. It’s all explained in painful detail in the install.txt file that comes with Drupal.)&lt;br /&gt;&lt;br /&gt;   1. Get ready:&lt;br /&gt;          * Download and install MAMP. (Go to http://www.mamp.info/en/home/ to find it.)&lt;br /&gt;          * Then download the latest version of Drupal. (Go to http://drupal.org/project/Drupal+project and pull down “CVS” from the “Filter by version” menu. This will give you the version that includes an installer.)&lt;br /&gt;          * Unzip it, and move the files into MAMP’s “htdocs” folder.&lt;br /&gt;   2. Launch MAMP and your favourite browser. If the buttons next to “Apache Server” and “MySQL Server” in MAMP aren’t green, click the “Start Servers” button. If that doesn’t turn the servers on, you’ll need to troubleshoot MAMP before you go any further.&lt;br /&gt;   3. Create an empty MySQL database for Drupal to use.&lt;br /&gt;          * Point your browser to http://localhost:8888/phpMyAdmin/ and click on the “Databases” tab.&lt;br /&gt;          * Under “Create a new database”, fill in the information for your database. Give it a name (say, “droopy”) and, in the pulldown menu that says “Collation”, choose “utf8_unicode_ci”. Click “Create.”&lt;br /&gt;   4. Create a database user account for Drupal.&lt;br /&gt;          * In the left-hand sidebar, click on the home icon. (It looks like a little house.)&lt;br /&gt;          * In the main pane, you’ll see two columns. In the left-hand column, click “Privileges”.&lt;br /&gt;          * Under the table listing all sorts of users, click “Add a new User”.&lt;br /&gt;          * Give the user a name (no spaces - make it a simple name). For “Host”, choose “Use text field” and enter “localhost”. Key in a password, and re-type it.&lt;br /&gt;          * Under “Global privileges”, make sure none of the items are checked. Click the “Go” button in the lower right-hand corner.&lt;br /&gt;          * The next screen allows you to edit the user. Scroll down to “Database-specific privileges” and, using the pull-down menu, select your Drupal database – in our case, droopy.&lt;br /&gt;          * A series of checkboxes appear, just like the “Global privileges” screen a little while ago. This time, click “Check All” and click the “Go” button at the bottom right of the “Database-specific privileges” section.&lt;br /&gt;   5. Tell Drupal what database settings to use.&lt;br /&gt;          * Point your browser to http://localhost:8888.&lt;br /&gt;          * Fill in the information that Drupal asks for: MySQL as the database type, the name of the database (”droopy”, in this case), your user name and your password. Click the “Save” button.&lt;br /&gt;&lt;br /&gt;If all went well, you’ll be looking at a screen that congratulates you on installing Drupal, and invites you to click on a link to visit your site. Add content, install modules, start theming - you can do it all. There are a few other things you might like to do (for instance, setting up a regular call to cron.php in crontab, and there you will have to open up Terminal); have a look at Drupal’s install.txt file for a explanation.&lt;br /&gt;&lt;br /&gt;&lt;/blockquote&gt;&lt;br /&gt;This is article is getting from:&lt;br /&gt;&lt;a href="http://www.robcottingham.ca/20060830/how-to-install-drupal-on-your-mac-in-five-steps/"&gt;http://www.robcottingham.ca/20060830/how-to-install-drupal-on-your-mac-in-five-steps/&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/20556118-2888732199984171144?l=leoman730.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://leoman730.blogspot.com/feeds/2888732199984171144/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=20556118&amp;postID=2888732199984171144' title='8 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/20556118/posts/default/2888732199984171144'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/20556118/posts/default/2888732199984171144'/><link rel='alternate' type='text/html' href='http://leoman730.blogspot.com/2007/10/install-drupal-easiest-way-with-mamp.html' title='Install Drupal the easiest way with MAMP'/><author><name>Leoman730</name><uri>http://www.blogger.com/profile/12392590805408335453</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>8</thr:total></entry><entry><id>tag:blogger.com,1999:blog-20556118.post-8156963545441953441</id><published>2007-10-20T14:32:00.000-05:00</published><updated>2007-10-20T14:33:32.569-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Tips'/><title type='text'>Web 2.0 gnerator</title><content type='html'>A very useful page where user can find web2.0 generator:&lt;br /&gt;&lt;br /&gt;http://www.ifxplus.com/post/More-than-100-Web-20-Online-Generators.aspx&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/20556118-8156963545441953441?l=leoman730.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://leoman730.blogspot.com/feeds/8156963545441953441/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=20556118&amp;postID=8156963545441953441' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/20556118/posts/default/8156963545441953441'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/20556118/posts/default/8156963545441953441'/><link rel='alternate' type='text/html' href='http://leoman730.blogspot.com/2007/10/web-20-gnerator.html' title='Web 2.0 gnerator'/><author><name>Leoman730</name><uri>http://www.blogger.com/profile/12392590805408335453</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-20556118.post-2188160913657178072</id><published>2007-10-19T22:48:00.000-05:00</published><updated>2007-10-19T22:52:38.154-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Tips'/><title type='text'>How to kill a process from CMD</title><content type='html'>We can kill a list of same process from cmd by using: &lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;taskkill /IM $processnName&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/20556118-2188160913657178072?l=leoman730.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://leoman730.blogspot.com/feeds/2188160913657178072/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=20556118&amp;postID=2188160913657178072' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/20556118/posts/default/2188160913657178072'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/20556118/posts/default/2188160913657178072'/><link rel='alternate' type='text/html' href='http://leoman730.blogspot.com/2007/10/how-to-kill-process-from-cmd.html' title='How to kill a process from CMD'/><author><name>Leoman730</name><uri>http://www.blogger.com/profile/12392590805408335453</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-20556118.post-4739826149512672506</id><published>2007-10-16T13:56:00.000-05:00</published><updated>2007-10-16T13:58:16.930-05:00</updated><title type='text'>PHP useful get date function</title><content type='html'>&lt;div class=Section1&gt;  &lt;p class=MsoNormal&gt;&lt;font size=2 face="Courier New"&gt;&lt;span style='font-size:10.0pt; font-family:"Courier New"'&gt;&lt;br&gt; &lt;/span&gt;&lt;/font&gt;&lt;span class=default&gt;&lt;font face="Courier New"&gt;&lt;span style='font-family:"Courier New"'&gt;&amp;lt;?php&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;&lt;font size=2 face="Courier New"&gt;&lt;span style='font-size:10.0pt;font-family:"Courier New"'&gt;&lt;br&gt; &lt;/span&gt;&lt;/font&gt;&lt;span class=default&gt;&lt;font face="Courier New"&gt;&lt;span style='font-family:"Courier New"'&gt;$now &lt;/span&gt;&lt;/font&gt;&lt;/span&gt;&lt;span class=keyword&gt;&lt;font size=2 face="Courier New"&gt;&lt;span style='font-size:10.0pt; font-family:"Courier New"'&gt;= &lt;/span&gt;&lt;/font&gt;&lt;/span&gt;&lt;span class=default&gt;&lt;font face="Courier New"&gt;&lt;span style='font-family:"Courier New"'&gt;time&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;&lt;span class=keyword&gt;&lt;font size=2 face="Courier New"&gt;&lt;span style='font-size:10.0pt; font-family:"Courier New"'&gt;();&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;&lt;font size=2 face="Courier New"&gt;&lt;span style='font-size:10.0pt;font-family:"Courier New"'&gt;&lt;br&gt; &lt;/span&gt;&lt;/font&gt;&lt;span class=default&gt;&lt;font face="Courier New"&gt;&lt;span style='font-family:"Courier New"'&gt;$tomorrow&amp;nbsp; &lt;/span&gt;&lt;/font&gt;&lt;/span&gt;&lt;span class=keyword&gt;&lt;font size=2 face="Courier New"&gt;&lt;span style='font-size:10.0pt; font-family:"Courier New"'&gt;= &lt;/span&gt;&lt;/font&gt;&lt;/span&gt;&lt;span class=default&gt;&lt;font face="Courier New"&gt;&lt;span style='font-family:"Courier New"'&gt;mktime&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;&lt;span class=keyword&gt;&lt;font size=2 face="Courier New"&gt;&lt;span style='font-size:10.0pt; font-family:"Courier New"'&gt;(&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;&lt;span class=default&gt;&lt;font face="Courier New"&gt;&lt;span style='font-family:"Courier New"'&gt;0&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;&lt;span class=keyword&gt;&lt;font size=2 face="Courier New"&gt;&lt;span style='font-size:10.0pt; font-family:"Courier New"'&gt;, &lt;/span&gt;&lt;/font&gt;&lt;/span&gt;&lt;span class=default&gt;&lt;font face="Courier New"&gt;&lt;span style='font-family:"Courier New"'&gt;0&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;&lt;span class=keyword&gt;&lt;font size=2 face="Courier New"&gt;&lt;span style='font-size:10.0pt; font-family:"Courier New"'&gt;, &lt;/span&gt;&lt;/font&gt;&lt;/span&gt;&lt;span class=default&gt;&lt;font face="Courier New"&gt;&lt;span style='font-family:"Courier New"'&gt;0&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;&lt;span class=keyword&gt;&lt;font size=2 face="Courier New"&gt;&lt;span style='font-size:10.0pt; font-family:"Courier New"'&gt;, &lt;/span&gt;&lt;/font&gt;&lt;/span&gt;&lt;span class=default&gt;&lt;font face="Courier New"&gt;&lt;span style='font-family:"Courier New"'&gt;date&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;&lt;span class=keyword&gt;&lt;font size=2 face="Courier New"&gt;&lt;span style='font-size:10.0pt; font-family:"Courier New"'&gt;(&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;&lt;span class=string&gt;&lt;font size=2 face="Courier New"&gt;&lt;span style='font-size:10.0pt;font-family:"Courier New"'&gt;&amp;quot;m&amp;quot;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;&lt;span class=keyword&gt;&lt;font size=2 face="Courier New"&gt;&lt;span style='font-size:10.0pt; font-family:"Courier New"'&gt;, &lt;/span&gt;&lt;/font&gt;&lt;/span&gt;&lt;span class=default&gt;&lt;font face="Courier New"&gt;&lt;span style='font-family:"Courier New"'&gt;$now&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;&lt;span class=keyword&gt;&lt;font size=2 face="Courier New"&gt;&lt;span style='font-size:10.0pt; font-family:"Courier New"'&gt;)&amp;nbsp; , &lt;/span&gt;&lt;/font&gt;&lt;/span&gt;&lt;span class=default&gt;&lt;font face="Courier New"&gt;&lt;span style='font-family:"Courier New"'&gt;date&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;&lt;span class=keyword&gt;&lt;font size=2 face="Courier New"&gt;&lt;span style='font-size:10.0pt; font-family:"Courier New"'&gt;(&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;&lt;span class=string&gt;&lt;font size=2 face="Courier New"&gt;&lt;span style='font-size:10.0pt;font-family:"Courier New"'&gt;&amp;quot;d&amp;quot;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;&lt;span class=keyword&gt;&lt;font size=2 face="Courier New"&gt;&lt;span style='font-size:10.0pt; font-family:"Courier New"'&gt;, &lt;/span&gt;&lt;/font&gt;&lt;/span&gt;&lt;span class=default&gt;&lt;font face="Courier New"&gt;&lt;span style='font-family:"Courier New"'&gt;$now&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;&lt;span class=keyword&gt;&lt;font size=2 face="Courier New"&gt;&lt;span style='font-size:10.0pt; font-family:"Courier New"'&gt;)+&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;&lt;span class=default&gt;&lt;font face="Courier New"&gt;&lt;span style='font-family:"Courier New"'&gt;1&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;&lt;span class=keyword&gt;&lt;font size=2 face="Courier New"&gt;&lt;span style='font-size:10.0pt; font-family:"Courier New"'&gt;, &lt;/span&gt;&lt;/font&gt;&lt;/span&gt;&lt;span class=default&gt;&lt;font face="Courier New"&gt;&lt;span style='font-family:"Courier New"'&gt;date&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;&lt;span class=keyword&gt;&lt;font size=2 face="Courier New"&gt;&lt;span style='font-size:10.0pt; font-family:"Courier New"'&gt;(&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;&lt;span class=string&gt;&lt;font size=2 face="Courier New"&gt;&lt;span style='font-size:10.0pt;font-family:"Courier New"'&gt;&amp;quot;Y&amp;quot;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;&lt;span class=keyword&gt;&lt;font size=2 face="Courier New"&gt;&lt;span style='font-size:10.0pt; font-family:"Courier New"'&gt;, &lt;/span&gt;&lt;/font&gt;&lt;/span&gt;&lt;span class=default&gt;&lt;font face="Courier New"&gt;&lt;span style='font-family:"Courier New"'&gt;$now&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;&lt;span class=keyword&gt;&lt;font size=2 face="Courier New"&gt;&lt;span style='font-size:10.0pt; font-family:"Courier New"'&gt;));&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;&lt;font size=2 face="Courier New"&gt;&lt;span style='font-size:10.0pt;font-family:"Courier New"'&gt;&lt;br&gt; &lt;/span&gt;&lt;/font&gt;&lt;span class=default&gt;&lt;font face="Courier New"&gt;&lt;span style='font-family:"Courier New"'&gt;$lastmonth &lt;/span&gt;&lt;/font&gt;&lt;/span&gt;&lt;span class=keyword&gt;&lt;font size=2 face="Courier New"&gt;&lt;span style='font-size:10.0pt; font-family:"Courier New"'&gt;= &lt;/span&gt;&lt;/font&gt;&lt;/span&gt;&lt;span class=default&gt;&lt;font face="Courier New"&gt;&lt;span style='font-family:"Courier New"'&gt;mktime&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;&lt;span class=keyword&gt;&lt;font size=2 face="Courier New"&gt;&lt;span style='font-size:10.0pt; font-family:"Courier New"'&gt;(&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;&lt;span class=default&gt;&lt;font face="Courier New"&gt;&lt;span style='font-family:"Courier New"'&gt;0&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;&lt;span class=keyword&gt;&lt;font size=2 face="Courier New"&gt;&lt;span style='font-size:10.0pt; font-family:"Courier New"'&gt;, &lt;/span&gt;&lt;/font&gt;&lt;/span&gt;&lt;span class=default&gt;&lt;font face="Courier New"&gt;&lt;span style='font-family:"Courier New"'&gt;0&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;&lt;span class=keyword&gt;&lt;font size=2 face="Courier New"&gt;&lt;span style='font-size:10.0pt; font-family:"Courier New"'&gt;, &lt;/span&gt;&lt;/font&gt;&lt;/span&gt;&lt;span class=default&gt;&lt;font face="Courier New"&gt;&lt;span style='font-family:"Courier New"'&gt;0&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;&lt;span class=keyword&gt;&lt;font size=2 face="Courier New"&gt;&lt;span style='font-size:10.0pt; font-family:"Courier New"'&gt;, &lt;/span&gt;&lt;/font&gt;&lt;/span&gt;&lt;span class=default&gt;&lt;font face="Courier New"&gt;&lt;span style='font-family:"Courier New"'&gt;date&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;&lt;span class=keyword&gt;&lt;font size=2 face="Courier New"&gt;&lt;span style='font-size:10.0pt; font-family:"Courier New"'&gt;(&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;&lt;span class=string&gt;&lt;font size=2 face="Courier New"&gt;&lt;span style='font-size:10.0pt;font-family:"Courier New"'&gt;&amp;quot;m&amp;quot;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;&lt;span class=keyword&gt;&lt;font size=2 face="Courier New"&gt;&lt;span style='font-size:10.0pt; font-family:"Courier New"'&gt;, &lt;/span&gt;&lt;/font&gt;&lt;/span&gt;&lt;span class=default&gt;&lt;font face="Courier New"&gt;&lt;span style='font-family:"Courier New"'&gt;$now&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;&lt;span class=keyword&gt;&lt;font size=2 face="Courier New"&gt;&lt;span style='font-size:10.0pt; font-family:"Courier New"'&gt;)-&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;&lt;span class=default&gt;&lt;font face="Courier New"&gt;&lt;span style='font-family:"Courier New"'&gt;1&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;&lt;span class=keyword&gt;&lt;font size=2 face="Courier New"&gt;&lt;span style='font-size:10.0pt; font-family:"Courier New"'&gt;, &lt;/span&gt;&lt;/font&gt;&lt;/span&gt;&lt;span class=default&gt;&lt;font face="Courier New"&gt;&lt;span style='font-family:"Courier New"'&gt;date&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;&lt;span class=keyword&gt;&lt;font size=2 face="Courier New"&gt;&lt;span style='font-size:10.0pt; font-family:"Courier New"'&gt;(&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;&lt;span class=string&gt;&lt;font size=2 face="Courier New"&gt;&lt;span style='font-size:10.0pt;font-family:"Courier New"'&gt;&amp;quot;d&amp;quot;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;&lt;span class=keyword&gt;&lt;font size=2 face="Courier New"&gt;&lt;span style='font-size:10.0pt; font-family:"Courier New"'&gt;, &lt;/span&gt;&lt;/font&gt;&lt;/span&gt;&lt;span class=default&gt;&lt;font face="Courier New"&gt;&lt;span style='font-family:"Courier New"'&gt;$now&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;&lt;span class=keyword&gt;&lt;font size=2 face="Courier New"&gt;&lt;span style='font-size:10.0pt; font-family:"Courier New"'&gt;),&amp;nbsp; &lt;/span&gt;&lt;/font&gt;&lt;/span&gt;&lt;span class=default&gt;&lt;font face="Courier New"&gt;&lt;span style='font-family:"Courier New"'&gt;date&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;&lt;span class=keyword&gt;&lt;font size=2 face="Courier New"&gt;&lt;span style='font-size:10.0pt; font-family:"Courier New"'&gt;(&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;&lt;span class=string&gt;&lt;font size=2 face="Courier New"&gt;&lt;span style='font-size:10.0pt;font-family:"Courier New"'&gt;&amp;quot;Y&amp;quot;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;&lt;span class=keyword&gt;&lt;font size=2 face="Courier New"&gt;&lt;span style='font-size:10.0pt; font-family:"Courier New"'&gt;, &lt;/span&gt;&lt;/font&gt;&lt;/span&gt;&lt;span class=default&gt;&lt;font face="Courier New"&gt;&lt;span style='font-family:"Courier New"'&gt;$now&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;&lt;span class=keyword&gt;&lt;font size=2 face="Courier New"&gt;&lt;span style='font-size:10.0pt; font-family:"Courier New"'&gt;));&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;&lt;font size=2 face="Courier New"&gt;&lt;span style='font-size:10.0pt;font-family:"Courier New"'&gt;&lt;br&gt; &lt;/span&gt;&lt;/font&gt;&lt;span class=default&gt;&lt;font face="Courier New"&gt;&lt;span style='font-family:"Courier New"'&gt;$nextyear&amp;nbsp; &lt;/span&gt;&lt;/font&gt;&lt;/span&gt;&lt;span class=keyword&gt;&lt;font size=2 face="Courier New"&gt;&lt;span style='font-size:10.0pt; font-family:"Courier New"'&gt;= &lt;/span&gt;&lt;/font&gt;&lt;/span&gt;&lt;span class=default&gt;&lt;font face="Courier New"&gt;&lt;span style='font-family:"Courier New"'&gt;mktime&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;&lt;span class=keyword&gt;&lt;font size=2 face="Courier New"&gt;&lt;span style='font-size:10.0pt; font-family:"Courier New"'&gt;(&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;&lt;span class=default&gt;&lt;font face="Courier New"&gt;&lt;span style='font-family:"Courier New"'&gt;0&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;&lt;span class=keyword&gt;&lt;font size=2 face="Courier New"&gt;&lt;span style='font-size:10.0pt; font-family:"Courier New"'&gt;, &lt;/span&gt;&lt;/font&gt;&lt;/span&gt;&lt;span class=default&gt;&lt;font face="Courier New"&gt;&lt;span style='font-family:"Courier New"'&gt;0&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;&lt;span class=keyword&gt;&lt;font size=2 face="Courier New"&gt;&lt;span style='font-size:10.0pt; font-family:"Courier New"'&gt;, &lt;/span&gt;&lt;/font&gt;&lt;/span&gt;&lt;span class=default&gt;&lt;font face="Courier New"&gt;&lt;span style='font-family:"Courier New"'&gt;0&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;&lt;span class=keyword&gt;&lt;font size=2 face="Courier New"&gt;&lt;span style='font-size:10.0pt; font-family:"Courier New"'&gt;, &lt;/span&gt;&lt;/font&gt;&lt;/span&gt;&lt;span class=default&gt;&lt;font face="Courier New"&gt;&lt;span style='font-family:"Courier New"'&gt;date&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;&lt;span class=keyword&gt;&lt;font size=2 face="Courier New"&gt;&lt;span style='font-size:10.0pt; font-family:"Courier New"'&gt;(&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;&lt;span class=string&gt;&lt;font size=2 face="Courier New"&gt;&lt;span style='font-size:10.0pt;font-family:"Courier New"'&gt;&amp;quot;m&amp;quot;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;&lt;span class=keyword&gt;&lt;font size=2 face="Courier New"&gt;&lt;span style='font-size:10.0pt; font-family:"Courier New"'&gt;, &lt;/span&gt;&lt;/font&gt;&lt;/span&gt;&lt;span class=default&gt;&lt;font face="Courier New"&gt;&lt;span style='font-family:"Courier New"'&gt;$now&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;&lt;span class=keyword&gt;&lt;font size=2 face="Courier New"&gt;&lt;span style='font-size:10.0pt; font-family:"Courier New"'&gt;),&amp;nbsp; &lt;/span&gt;&lt;/font&gt;&lt;/span&gt;&lt;span class=default&gt;&lt;font face="Courier New"&gt;&lt;span style='font-family:"Courier New"'&gt;date&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;&lt;span class=keyword&gt;&lt;font size=2 face="Courier New"&gt;&lt;span style='font-size:10.0pt; font-family:"Courier New"'&gt;(&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;&lt;span class=string&gt;&lt;font size=2 face="Courier New"&gt;&lt;span style='font-size:10.0pt;font-family:"Courier New"'&gt;&amp;quot;d&amp;quot;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;&lt;span class=keyword&gt;&lt;font size=2 face="Courier New"&gt;&lt;span style='font-size:10.0pt; font-family:"Courier New"'&gt;, &lt;/span&gt;&lt;/font&gt;&lt;/span&gt;&lt;span class=default&gt;&lt;font face="Courier New"&gt;&lt;span style='font-family:"Courier New"'&gt;$now&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;&lt;span class=keyword&gt;&lt;font size=2 face="Courier New"&gt;&lt;span style='font-size:10.0pt; font-family:"Courier New"'&gt;),&amp;nbsp; &lt;/span&gt;&lt;/font&gt;&lt;/span&gt;&lt;span class=default&gt;&lt;font face="Courier New"&gt;&lt;span style='font-family:"Courier New"'&gt;date&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;&lt;span class=keyword&gt;&lt;font size=2 face="Courier New"&gt;&lt;span style='font-size:10.0pt; font-family:"Courier New"'&gt;(&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;&lt;span class=string&gt;&lt;font size=2 face="Courier New"&gt;&lt;span style='font-size:10.0pt;font-family:"Courier New"'&gt;&amp;quot;Y&amp;quot;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;&lt;span class=keyword&gt;&lt;font size=2 face="Courier New"&gt;&lt;span style='font-size:10.0pt; font-family:"Courier New"'&gt;, &lt;/span&gt;&lt;/font&gt;&lt;/span&gt;&lt;span class=default&gt;&lt;font face="Courier New"&gt;&lt;span style='font-family:"Courier New"'&gt;$now&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;&lt;span class=keyword&gt;&lt;font size=2 face="Courier New"&gt;&lt;span style='font-size:10.0pt; font-family:"Courier New"'&gt;)+&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;&lt;span class=default&gt;&lt;font face="Courier New"&gt;&lt;span style='font-family:"Courier New"'&gt;1&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;&lt;span class=keyword&gt;&lt;font size=2 face="Courier New"&gt;&lt;span style='font-size:10.0pt; font-family:"Courier New"'&gt;);&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;&lt;font size=2 face="Courier New"&gt;&lt;span style='font-size:10.0pt;font-family:"Courier New"'&gt;&lt;br&gt; &lt;/span&gt;&lt;/font&gt;&lt;span class=default&gt;&lt;font face="Courier New"&gt;&lt;span style='font-family:"Courier New"'&gt;?&amp;gt;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;&lt;font size=2 face="Courier New"&gt;&lt;span style='font-size:10.0pt;font-family:"Courier New"'&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;  &lt;/div&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/20556118-4739826149512672506?l=leoman730.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://leoman730.blogspot.com/feeds/4739826149512672506/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=20556118&amp;postID=4739826149512672506' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/20556118/posts/default/4739826149512672506'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/20556118/posts/default/4739826149512672506'/><link rel='alternate' type='text/html' href='http://leoman730.blogspot.com/2007/10/php-useful-get-date-function.html' title='PHP useful get date function'/><author><name>Leoman730</name><uri>http://www.blogger.com/profile/12392590805408335453</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-20556118.post-813386817056552695</id><published>2007-10-09T21:49:00.000-05:00</published><updated>2007-10-09T21:54:49.101-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Tips'/><title type='text'>Net send</title><content type='html'>Net send is a useful function to send immediate message to another computer in the same network. Without using 3rd party software, you can use "net send" command to send message. Below is how to enable net send service.&lt;br /&gt;&lt;br /&gt;1. To use net send command, the "Messager" service must be enabled in the window service pane. &lt;br /&gt;2. After the service is enabled, open up a command prompt, then type net send {Computer Name} message&lt;br /&gt;ex: &lt;span style="font-style:italic;"&gt;net send leoman hi&lt;span style="font-weight:bold;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/20556118-813386817056552695?l=leoman730.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://leoman730.blogspot.com/feeds/813386817056552695/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=20556118&amp;postID=813386817056552695' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/20556118/posts/default/813386817056552695'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/20556118/posts/default/813386817056552695'/><link rel='alternate' type='text/html' href='http://leoman730.blogspot.com/2007/10/net-send.html' title='Net send'/><author><name>Leoman730</name><uri>http://www.blogger.com/profile/12392590805408335453</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-20556118.post-5534452585830961543</id><published>2007-07-19T08:57:00.000-05:00</published><updated>2007-07-19T09:01:19.586-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Programming: PHP'/><title type='text'>PHP: Date and Time manipulation</title><content type='html'>In PHP, we can convert timestamp to readable format by using date() function.&lt;br /&gt;Ex: date('y, m, d', timestamp)&lt;br /&gt;&lt;br /&gt;To convert a readable format to timestampe using: strtotime();&lt;br /&gt;Ex: $start_time = strtotime($row-&gt;date.' '.$row-&gt;start_time);&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/20556118-5534452585830961543?l=leoman730.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://leoman730.blogspot.com/feeds/5534452585830961543/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=20556118&amp;postID=5534452585830961543' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/20556118/posts/default/5534452585830961543'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/20556118/posts/default/5534452585830961543'/><link rel='alternate' type='text/html' href='http://leoman730.blogspot.com/2007/07/php-date-and-time-manipulation.html' title='PHP: Date and Time manipulation'/><author><name>Leoman730</name><uri>http://www.blogger.com/profile/12392590805408335453</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-20556118.post-2551762787565615549</id><published>2007-07-03T20:26:00.001-05:00</published><updated>2007-07-03T20:27:21.070-05:00</updated><title type='text'>Hostfile location</title><content type='html'>&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_axXXZesitZk/Ror3Yy42d0I/AAAAAAAAAXY/CCeKkMh_Bvw/s1600-h/host+file.png"&gt;&lt;img style="cursor:pointer; cursor:hand;" src="http://2.bp.blogspot.com/_axXXZesitZk/Ror3Yy42d0I/AAAAAAAAAXY/CCeKkMh_Bvw/s320/host+file.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5083147134790170434" /&gt;&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/20556118-2551762787565615549?l=leoman730.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://leoman730.blogspot.com/feeds/2551762787565615549/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=20556118&amp;postID=2551762787565615549' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/20556118/posts/default/2551762787565615549'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/20556118/posts/default/2551762787565615549'/><link rel='alternate' type='text/html' href='http://leoman730.blogspot.com/2007/07/hostfile-location.html' title='Hostfile location'/><author><name>Leoman730</name><uri>http://www.blogger.com/profile/12392590805408335453</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_axXXZesitZk/Ror3Yy42d0I/AAAAAAAAAXY/CCeKkMh_Bvw/s72-c/host+file.png' height='72' width='72'/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-20556118.post-4914723310266451820</id><published>2007-03-14T21:56:00.000-05:00</published><updated>2007-03-14T22:10:24.287-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Network Security'/><title type='text'>Wireless zero config service in winxp</title><content type='html'>Another example that proves Privacy and Security can not stay along with Convenience, the wireless zero config service in window xp. With this service turn on, an xp machine will automatically search for network from its preferred network list, which was build in the past which the machine used to connect to the internet. To find this network, the machine will periodically send out prone request that with SSID from teh preferred list in order to try connect the the network. The problem is, if someone sniffing and catch this wi-fi packet, he would know all these SSID, which is not cool at all. &lt;br /&gt;&lt;br /&gt;Yeah, it is true that the wirelss zero configure brought convenience that it helps a user to reconnect to the internet automatically; however, it can also expose all the SSID to the outside world. It would be better to turn this service off. &lt;br /&gt;&lt;br /&gt;Download this update from microsoft to turn it off: &lt;a href="http://support.microsoft.com/?kbid=917021"&gt;Wireless Client Update for Windows XP with Service Pack 2&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/20556118-4914723310266451820?l=leoman730.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://leoman730.blogspot.com/feeds/4914723310266451820/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=20556118&amp;postID=4914723310266451820' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/20556118/posts/default/4914723310266451820'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/20556118/posts/default/4914723310266451820'/><link rel='alternate' type='text/html' href='http://leoman730.blogspot.com/2007/03/wireless-zero-config-service-in-winxp.html' title='Wireless zero config service in winxp'/><author><name>Leoman730</name><uri>http://www.blogger.com/profile/12392590805408335453</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-20556118.post-516569594447859393</id><published>2007-03-12T22:16:00.000-05:00</published><updated>2007-03-12T22:18:56.091-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Algorithm'/><title type='text'>To find prime number</title><content type='html'>&lt;pre&gt;&lt;br /&gt;public class prime{   &lt;br /&gt;    public static void main(String args[]){&lt;br /&gt;        for(int i = 0; i &lt;= 100; i++){&lt;br /&gt;            if(isPrime(i))&lt;br /&gt;                System.out.println(i);&lt;br /&gt;        }&lt;br /&gt;    }&lt;br /&gt;                      &lt;br /&gt;    public static boolean isPrime(int checkNumber) {&lt;br /&gt;        double root = Math.sqrt(checkNumber);&lt;br /&gt;        for (int i = 2; i &lt;= root; i++) {&lt;br /&gt;            if (checkNumber % i == 0)&lt;br /&gt;                return false;&lt;br /&gt;            }&lt;br /&gt;        return true;&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/20556118-516569594447859393?l=leoman730.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://leoman730.blogspot.com/feeds/516569594447859393/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=20556118&amp;postID=516569594447859393' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/20556118/posts/default/516569594447859393'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/20556118/posts/default/516569594447859393'/><link rel='alternate' type='text/html' href='http://leoman730.blogspot.com/2007/03/to-find-prime-number.html' title='To find prime number'/><author><name>Leoman730</name><uri>http://www.blogger.com/profile/12392590805408335453</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-20556118.post-8187041399085395849</id><published>2007-03-07T20:49:00.000-05:00</published><updated>2007-03-12T22:20:39.815-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Algorithm'/><title type='text'>Check if a string is parlidrom</title><content type='html'>&lt;pre&gt;&lt;br /&gt;bool isparlidrom( char* str){&lt;br /&gt;&lt;br /&gt;    if(str == null){&lt;br /&gt;        return false&lt;br /&gt;    }&lt;br /&gt;    char* endStr = str;&lt;br /&gt;    while(*endStr != '\0'){&lt;br /&gt;        endStr++;&lt;br /&gt;    }&lt;br /&gt;    endStr--;&lt;br /&gt;&lt;br /&gt;   while(endStr &gt; str){&lt;br /&gt;        if( *endStr ! = *str){&lt;br /&gt;            return false;&lt;br /&gt;        }&lt;br /&gt;        endStr--;&lt;br /&gt;        str++;&lt;br /&gt;   }    &lt;br /&gt;    return true;&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/20556118-8187041399085395849?l=leoman730.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://leoman730.blogspot.com/feeds/8187041399085395849/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=20556118&amp;postID=8187041399085395849' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/20556118/posts/default/8187041399085395849'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/20556118/posts/default/8187041399085395849'/><link rel='alternate' type='text/html' href='http://leoman730.blogspot.com/2007/03/check-if-string-is-parlidrom.html' title='Check if a string is parlidrom'/><author><name>Leoman730</name><uri>http://www.blogger.com/profile/12392590805408335453</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-20556118.post-439867880677586316</id><published>2007-03-05T23:51:00.000-05:00</published><updated>2007-03-06T00:03:38.269-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Network Security'/><title type='text'>Open wireless access point</title><content type='html'>Last time I went to Toronto with my friend and we discovered that there are so many open wireless access point in downtown Toronto. I am glad that people were such generous that they willing to share bandwidth with others; however, open WAP may post serious security issue.&lt;br /&gt;Why I saying this is because WAP acts like a hub in the network, anyone who put a "packet sniffer" onto the wire can monitor all traffic going in and out. The result is everything you do will be transparent. &lt;br /&gt;I believe that it is necessary to encrypt our wireless network once we set the network up using WEP or WPA. But what if in the airport or coffee shop, where wireless connection is available but not encrypted? One approach is to turn on your local firewall. And possibly to use SSL or VPN.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/20556118-439867880677586316?l=leoman730.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://leoman730.blogspot.com/feeds/439867880677586316/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=20556118&amp;postID=439867880677586316' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/20556118/posts/default/439867880677586316'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/20556118/posts/default/439867880677586316'/><link rel='alternate' type='text/html' href='http://leoman730.blogspot.com/2007/03/open-wireless-access-point.html' title='Open wireless access point'/><author><name>Leoman730</name><uri>http://www.blogger.com/profile/12392590805408335453</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-20556118.post-4048617445441395065</id><published>2007-03-05T23:30:00.000-05:00</published><updated>2007-03-05T23:51:07.703-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Network Security'/><title type='text'>Stwitch vs. Hubs</title><content type='html'>Switch and Hub is very similar but they are in fact different. Switch is more intelligence and bandwidth efficiency than hubs.&lt;br /&gt;&lt;br /&gt;When packets get to a hub, a hub COPY and BROADCAST all received traffic.&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_axXXZesitZk/RezyaW3DuhI/AAAAAAAAAA0/aJv31CJIYG0/s1600-h/hub.JPG"&gt;&lt;img style="cursor:pointer; cursor:hand;" src="http://3.bp.blogspot.com/_axXXZesitZk/RezyaW3DuhI/AAAAAAAAAA0/aJv31CJIYG0/s320/hub.JPG" border="0" alt=""id="BLOGGER_PHOTO_ID_5038668617747773970" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;When packets get to a switch, a switch only forward the traffic to its destination.&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_axXXZesitZk/Rezyj23DuiI/AAAAAAAAAA8/PYCkdmLGVlY/s1600-h/switch.JPG"&gt;&lt;img style="cursor:pointer; cursor:hand;" src="http://1.bp.blogspot.com/_axXXZesitZk/Rezyj23DuiI/AAAAAAAAAA8/PYCkdmLGVlY/s320/switch.JPG" border="0" alt=""id="BLOGGER_PHOTO_ID_5038668780956531234" /&gt;&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/20556118-4048617445441395065?l=leoman730.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://leoman730.blogspot.com/feeds/4048617445441395065/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=20556118&amp;postID=4048617445441395065' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/20556118/posts/default/4048617445441395065'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/20556118/posts/default/4048617445441395065'/><link rel='alternate' type='text/html' href='http://leoman730.blogspot.com/2007/03/stwitch-vs-hubs.html' title='Stwitch vs. Hubs'/><author><name>Leoman730</name><uri>http://www.blogger.com/profile/12392590805408335453</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/_axXXZesitZk/RezyaW3DuhI/AAAAAAAAAA0/aJv31CJIYG0/s72-c/hub.JPG' height='72' width='72'/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-20556118.post-3643161329531852398</id><published>2007-03-01T18:46:00.000-05:00</published><updated>2007-03-01T18:54:05.562-05:00</updated><title type='text'>Hardware DEP</title><content type='html'>Turn your hardware DEP on to protect your computer. DEP --&gt; Data Executable Prevention. Nowadays, many computers has hardware DEP build=in; however, not many of us know about it. With DEP enable, a computer can at some point prevent from being control by malicious hackers. One example use of DEP is to make the stack as non-executable such that prevent buffer overflow exploit.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/20556118-3643161329531852398?l=leoman730.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://leoman730.blogspot.com/feeds/3643161329531852398/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=20556118&amp;postID=3643161329531852398' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/20556118/posts/default/3643161329531852398'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/20556118/posts/default/3643161329531852398'/><link rel='alternate' type='text/html' href='http://leoman730.blogspot.com/2007/03/hardware-dep.html' title='Hardware DEP'/><author><name>Leoman730</name><uri>http://www.blogger.com/profile/12392590805408335453</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-20556118.post-8511334325206791396</id><published>2007-01-24T22:26:00.000-05:00</published><updated>2007-01-24T22:41:09.155-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Network Security'/><title type='text'>Email security issue</title><content type='html'>In Security Now episode 61, Leo and Steve talked about some of the security and privacy issue with ISP. The concern is that our ISP may be able to keep track and monitor what we are doing on the web IF we don't secure the our communication channel such as using SSL or VPN.&lt;br /&gt;One interested topic get my attention is about sending secure email. You may not know that even if you encrypt your email data through SSL and send it, you still not secure your data because SSL encrypts the data at start point and decrypts the data at the end point. Therefore, your message is decrypted at your ISP, and then your ISP foward your DECRYPTED message to the destination. Notices that the link between your ISP to the destination is NOT encrypted, and your data is at risk of being exposed. &lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_axXXZesitZk/RbgmraIa5UI/AAAAAAAAAAo/j9yKUPIQhPI/s1600-h/email+insecure.JPG"&gt;&lt;img style="cursor:pointer; cursor:hand;" src="http://2.bp.blogspot.com/_axXXZesitZk/RbgmraIa5UI/AAAAAAAAAAo/j9yKUPIQhPI/s320/email+insecure.JPG" border="0" alt=""id="BLOGGER_PHOTO_ID_5023807911522657602" /&gt;&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/20556118-8511334325206791396?l=leoman730.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://leoman730.blogspot.com/feeds/8511334325206791396/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=20556118&amp;postID=8511334325206791396' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/20556118/posts/default/8511334325206791396'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/20556118/posts/default/8511334325206791396'/><link rel='alternate' type='text/html' href='http://leoman730.blogspot.com/2007/01/email-security-issue.html' title='Email security issue'/><author><name>Leoman730</name><uri>http://www.blogger.com/profile/12392590805408335453</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_axXXZesitZk/RbgmraIa5UI/AAAAAAAAAAo/j9yKUPIQhPI/s72-c/email+insecure.JPG' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-20556118.post-765671283954054147</id><published>2007-01-20T19:54:00.000-05:00</published><updated>2007-01-24T12:36:32.895-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Network Security'/><title type='text'>Browser Security</title><content type='html'>First post in 2007, some thoughs about browser security.&lt;br /&gt;&lt;br /&gt;Ever since Microsoft developed the so called AtiveX (an dll program, origin from OLAP )which enabled executable code run on client machine, the security issue that relate to IE increase aggressively. &lt;br /&gt;&lt;br /&gt;Unlike traditional scripting language such as VB script, Java script who run within the sandbox environment ( executable code is restrict inside the interpreter, like JVM ), AtiveX code can run on the client machine freely. By which mean, ativeX opens a big door for the attackers to take over control the user's computer. Although, many modern technology make sure of activex to bring cool effect, such as the Macromedia Flash; the downside of activeX is incredible overhead. I surely believe people known a the spy ware called the Gator. Thanks to activeX.&lt;br /&gt;&lt;br /&gt;Traditional internet concept is only to deliver TEXTUAL static page to the client; however, nowadays, server will even deliver executable codes to the client. Man~~~ that too danger... because there are many malicious code out there on the web. If I am you, I will shied myself up by setting my browser security as high as possible to avoid possible attack. &lt;br /&gt;&lt;br /&gt;The browser is like a pioneer, it take you to any place on the web everyday. Imaging that you are exploring a new territory where you never been to before ("Good luck!! hold your breath~~). Will you scare  that you be attacked by wild animal. Same concept apply to today's world wide web. Therefore, better shied yourself up while browsing the web.&lt;br /&gt;&lt;br /&gt;A little tips from Steve Gibson, an highly intelligent security guy, teaches you to shied up yourself in IE. In IE, there's something call the zone level setting in the preference. User can set that level to the highest level, once you do that, you are disabling all the executable scripting from running in your computer. and then there is a thing called "Trusted zone", where you can specify which sites you will trust and allow it to run executable script.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/20556118-765671283954054147?l=leoman730.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://leoman730.blogspot.com/feeds/765671283954054147/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=20556118&amp;postID=765671283954054147' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/20556118/posts/default/765671283954054147'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/20556118/posts/default/765671283954054147'/><link rel='alternate' type='text/html' href='http://leoman730.blogspot.com/2007/01/brower-security.html' title='Browser Security'/><author><name>Leoman730</name><uri>http://www.blogger.com/profile/12392590805408335453</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-20556118.post-3684773035297580036</id><published>2006-12-15T20:47:00.000-05:00</published><updated>2007-10-09T22:01:28.474-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Network Security'/><title type='text'>Create password protection for web folder using .access</title><content type='html'>Two files need to be create: .htaccess and .htpasswd&lt;br /&gt;&lt;br /&gt;Example: &lt;br /&gt;I want to protect a folder call "test" (/usr/www/test)&lt;br /&gt;user name: goodwill&lt;br /&gt;password: hackit&lt;br /&gt;&lt;br /&gt;Create a file called .htaccess, put it in /usr/www/test/ with these content&lt;br /&gt;&lt;br /&gt;AuthName "Restricted area"&lt;br /&gt;AuthType Basic&lt;br /&gt;AuthUserFile /Usr/.htpasswd&lt;br /&gt;AuthGroupFile /dev/null&lt;br /&gt;require valid-user&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Create a file called .htpasswd that contents user name and encripted password ( using htaccess generator:http://tools.dynamicdrive.com/password/ ), then put this file in /usr/&lt;br /&gt;&lt;br /&gt;EX: goodwill:.l6wTNxfoHj6U (encripted hackit)&lt;br /&gt;&lt;br /&gt;Browse to you site to see if it work&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/20556118-3684773035297580036?l=leoman730.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://leoman730.blogspot.com/feeds/3684773035297580036/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=20556118&amp;postID=3684773035297580036' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/20556118/posts/default/3684773035297580036'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/20556118/posts/default/3684773035297580036'/><link rel='alternate' type='text/html' href='http://leoman730.blogspot.com/2006/12/create-password-protection-for-web.html' title='Create password protection for web folder using .access'/><author><name>Leoman730</name><uri>http://www.blogger.com/profile/12392590805408335453</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-20556118.post-4560156454741328302</id><published>2006-12-15T19:32:00.000-05:00</published><updated>2006-12-15T19:41:50.903-05:00</updated><title type='text'>Enable .htaccess in Mac</title><content type='html'>It took me a while to figure out why .htaccess is not working on my local web server.&lt;br /&gt;By default, Appach disable .htaccess file in Mac, user who wants to use htaccess should manually modify the httpd.conf file&lt;br /&gt;&lt;br /&gt;Here's how to do it (2 main steps)&lt;br /&gt;&lt;br /&gt;1. Go to /private/etc/httpd/, then &lt;b&gt;sudo vi httpd.conf&lt;/b&gt;, find the line contains "AllowOverride None", replace it with "AllowOverride all". Save the file.&lt;br /&gt;&lt;br /&gt;2. Go to /etc/httpd/users/, there you will see all the conf files for all users, edit each of them follow above process. Then restart the web server. And you all set and run.&lt;br /&gt;&lt;br /&gt;The &lt;b&gt;sudo&lt;/b&gt; command is necessary if you want to have superior privilege to modify a file. Basically what sudo will do, according to wikimeida: "allows users to run programs with the security privileges of another user (normally the system's superuser) in a secure manner", a password must be provided.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/20556118-4560156454741328302?l=leoman730.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://leoman730.blogspot.com/feeds/4560156454741328302/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=20556118&amp;postID=4560156454741328302' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/20556118/posts/default/4560156454741328302'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/20556118/posts/default/4560156454741328302'/><link rel='alternate' type='text/html' href='http://leoman730.blogspot.com/2006/12/enable-htaccess-in-mac.html' title='Enable .htaccess in Mac'/><author><name>Leoman730</name><uri>http://www.blogger.com/profile/12392590805408335453</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-20556118.post-7469379202444392313</id><published>2006-12-01T19:48:00.000-05:00</published><updated>2006-12-01T19:51:04.115-05:00</updated><title type='text'>Memory usage</title><content type='html'>The Active monitor from apple is a bit confusing, especially on the memory statistic.&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://photos1.blogger.com/x/blogger2/2390/2509/1600/201163/memory_usage.png"&gt;&lt;img style="cursor: pointer;" src="http://photos1.blogger.com/x/blogger2/2390/2509/320/718914/memory_usage.png" alt="" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt; So what are all these terms means?  &lt;/p&gt; &lt;p&gt;&lt;br /&gt;&lt;b&gt;Wired memory&lt;/b&gt;&lt;br /&gt;This information can’t be cached to disk, so it must stay in RAM. The amount depends on what applications you are using. &lt;/p&gt; &lt;p&gt; &lt;b&gt;Active memory&lt;/b&gt;&lt;br /&gt;This information is currently in RAM and actively being used. &lt;/p&gt; &lt;p&gt; &lt;b&gt;Inactive memory&lt;/b&gt;&lt;br /&gt;This information is no longer being used and has been cached to disk, but it will remain in RAM until another application needs the space. Leaving this information in RAM is to your advantage if you (or a client of your computer) come back to it later. &lt;/p&gt; &lt;p&gt; &lt;b&gt;Free memory&lt;/b&gt;&lt;br /&gt;This memory is not being used. &lt;/p&gt; &lt;p&gt; More info can be found in:&lt;br /&gt;&lt;a href="http://docs.info.apple.com/article.html?artnum=107918" title="Memory usage"&gt;Memory usage&lt;/a&gt; &lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/20556118-7469379202444392313?l=leoman730.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://leoman730.blogspot.com/feeds/7469379202444392313/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=20556118&amp;postID=7469379202444392313' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/20556118/posts/default/7469379202444392313'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/20556118/posts/default/7469379202444392313'/><link rel='alternate' type='text/html' href='http://leoman730.blogspot.com/2006/12/active-monitor-from-apple-is-bit.html' title='Memory usage'/><author><name>Leoman730</name><uri>http://www.blogger.com/profile/12392590805408335453</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-20556118.post-4087355821895015394</id><published>2006-12-01T19:47:00.001-05:00</published><updated>2006-12-01T19:47:54.795-05:00</updated><title type='text'>SCP</title><content type='html'>&lt;p&gt;To Copy file from local machine to remote machine: &lt;/p&gt; &lt;p&gt; &lt;b&gt;scp filename user@remoteMachine:/path/to/destination/dir&lt;/b&gt; &lt;/p&gt; &lt;p&gt; To copy file from remote machine to local machine &lt;/p&gt;  &lt;b&gt;scp userName@remoteMachine:/path/to/filename fileName &lt;/b&gt;(the rename the file on local machine)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/20556118-4087355821895015394?l=leoman730.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://leoman730.blogspot.com/feeds/4087355821895015394/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=20556118&amp;postID=4087355821895015394' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/20556118/posts/default/4087355821895015394'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/20556118/posts/default/4087355821895015394'/><link rel='alternate' type='text/html' href='http://leoman730.blogspot.com/2006/12/scp.html' title='SCP'/><author><name>Leoman730</name><uri>http://www.blogger.com/profile/12392590805408335453</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry></feed>
