<?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-163272026812479139</id><updated>2012-01-29T08:05:32.385-08:00</updated><category term='zookeeper'/><category term='mamp'/><category term='html5'/><category term='google sucks'/><category term='modx'/><category term='development'/><category term='lexicon'/><category term='phpunit'/><category term='model view controller'/><category term='hosting'/><category term='openvz'/><category term='chrome'/><category term='firefox'/><category term='kloxo'/><category term='php5.3'/><category term='complaints'/><category term='encryption'/><category term='css'/><category term='git'/><category term='js'/><category term='utf8'/><category term='cage'/><category term='kernel update'/><category term='qmail'/><category term='cron'/><category term='baseurl'/><category term='facebook'/><category term='table'/><category term='virtualbox'/><category term='oscommerce'/><category term='google document'/><category term='spf'/><category term='mysql'/><category term='java'/><category term='block ip'/><category term='security'/><category term='css3'/><category term='sendmail'/><category term='wordpress'/><category term='pdf'/><category term='rnds'/><category term='remote mx'/><category term='mvc'/><category term='idTabs'/><category term='roundcube'/><category term='smarty'/><category term='countries'/><category term='mac'/><category term='ie7'/><category term='version control'/><category term='magento'/><category term='ubuntu'/><category term='backup mysql'/><category term='extjs'/><category term='rdns'/><category term='json'/><category term='google'/><category term='google form'/><category term='mail'/><category term='smtp'/><category term='grub'/><category term='javascript'/><category term='amfphp'/><category term='joomla'/><category term='tinymce'/><category term='github'/><category term='ereg'/><category term='php framework ajax google map'/><category term='black screen'/><category term='mac port'/><category term='form'/><category term='grid'/><category term='unit test'/><category term='xpdo'/><category term='cms'/><category term='python'/><category term='gmail sucks'/><category term='browser'/><category term='ecommerce'/><category term='mysqldump'/><category term='canvas'/><category term='dos'/><category term='image'/><category term='skin disease'/><category term='mint'/><category term='flowplayer'/><category term='vps'/><category term='linux'/><category term='apache'/><category term='recovery'/><category term='cassandra'/><category term='speed'/><category term='combo'/><category term='soap'/><category term='login'/><category term='php'/><category term='eczema'/><category term='relay'/><category term='nmap'/><category term='code ethic'/><category term='web server monitoring'/><category term='ssh'/><category term='website'/><category term='ie'/><category term='netbeans'/><category term='regex'/><category term='jquery'/><category term='dhtmlx'/><category term='site copy'/><category term='mail server'/><category term='mysql lost root password'/><category term='sql'/><category term='subgrid'/><category term='colorbox'/><category term='drupal'/><category term='samba'/><category term='server'/><category term='xdebug'/><category term='font color'/><category term='iptables'/><category term='checksum'/><category term='psoriasis'/><title type='text'>Merc Studio Tech Blog*</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://mercstudio-tech.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/163272026812479139/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://mercstudio-tech.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><link rel='next' type='application/atom+xml' href='http://www.blogger.com/feeds/163272026812479139/posts/default?start-index=101&amp;max-results=100'/><author><name>James Tt</name><uri>https://profiles.google.com/103231744852638250560</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh3.googleusercontent.com/-S2vhoFMo-OY/AAAAAAAAAAI/AAAAAAAAAAA/Y8VfyxcHirI/s512-c/photo.jpg'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>196</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-163272026812479139.post-4556465561796194468</id><published>2012-01-29T05:03:00.000-08:00</published><updated>2012-01-29T07:49:32.660-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='modx'/><title type='text'>modx page not found after upgrade to 2.1</title><content type='html'>There is some cache issue on modx, after an upgrade from modx 2.0.x&lt;br /&gt;Clearing cache does not seems to fix the issue.&lt;br /&gt;One way to fix it is to edit every resources which ever are effected...&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Updates:&lt;br /&gt;Another way is to&amp;nbsp;do a script to run recursively on all resources, edit it by changing the alias, and save,&lt;br /&gt;and then changing the alias back to the actual alias, and save it again.&lt;br /&gt;Example:&lt;br /&gt;&lt;br /&gt;function&amp;nbsp;doFixResource($id, $iLevel=1) {&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;$oRes = $modx-&amp;gt;getObject("modResource", $id);&lt;br /&gt;$aContext = array($oRes-&amp;gt;get("context_key"));&lt;br /&gt;$iParentId = $oRes-&amp;gt;get("parent");&lt;br /&gt;if (!empty($iParentId)) {&lt;br /&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;doFixResource($iParentId, $iLevel+1);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;echo "Fixing: " . $oRes-&amp;gt;get("id") . "(lvl:" . $iLevel . ")," . $oRes-&amp;gt;get("alias") . "::" . $oRes-&amp;gt;get("pagetitle") . "(" . $oRes-&amp;gt;get("context_key") . ")&lt;br /&gt;\n";&lt;br /&gt;$sAlias = $oRes-&amp;gt;get("alias");&lt;br /&gt;$oRes-&amp;gt;set("alias", $sAlias . "-". rand(10000,9999));&lt;br /&gt;$oRes-&amp;gt;save(false);&lt;br /&gt;//doFlushContext($aContext);&lt;br /&gt;$oRes-&amp;gt;set("alias", $sAlias);&lt;br /&gt;$oRes-&amp;gt;save(false);&lt;br /&gt;doFlushContext($aContext);&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;then run flush script:&lt;br /&gt;&lt;br /&gt;function doFlushContext($aContext) {&lt;br /&gt;global $modx;&lt;br /&gt;&lt;br /&gt;$modx-&amp;gt;cacheManager-&amp;gt;refresh(array(&lt;br /&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;   &lt;/span&gt;'db' =&amp;gt; array(),&lt;br /&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;   &lt;/span&gt;'auto_publish' =&amp;gt; array('contexts' =&amp;gt; $aContext),&lt;br /&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;   &lt;/span&gt;'context_settings' =&amp;gt; array('contexts' =&amp;gt; $aContext),&lt;br /&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;   &lt;/span&gt;'resource' =&amp;gt; array('contexts' =&amp;gt; $aContext),&lt;br /&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;));&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;And finally, run clear cache from manager screen.&lt;br /&gt;&lt;br /&gt;Tips: If you want performance, cached up all the id which you have run&amp;nbsp;doFixResource by using static variable, and skip it, it may save you up to more than 80% of the time :)&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/163272026812479139-4556465561796194468?l=mercstudio-tech.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mercstudio-tech.blogspot.com/feeds/4556465561796194468/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=163272026812479139&amp;postID=4556465561796194468' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/163272026812479139/posts/default/4556465561796194468'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/163272026812479139/posts/default/4556465561796194468'/><link rel='alternate' type='text/html' href='http://mercstudio-tech.blogspot.com/2012/01/modx-page-not-found-after-upgrade-to-21.html' title='modx page not found after upgrade to 2.1'/><author><name>James Tt</name><uri>https://profiles.google.com/103231744852638250560</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh3.googleusercontent.com/-S2vhoFMo-OY/AAAAAAAAAAI/AAAAAAAAAAA/Y8VfyxcHirI/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-163272026812479139.post-2511515414459920467</id><published>2012-01-27T22:14:00.001-08:00</published><updated>2012-01-29T08:05:32.399-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='modx'/><title type='text'>modx 2.2 changes</title><content type='html'>$modx-&amp;gt;getUser("contextname") &lt;br /&gt;return anonymous user if no user is logged in to the context.&lt;br /&gt;when getOne("Profile") is performed on anonymous user, will return null, so some error might be thrown.&lt;br /&gt;&lt;br /&gt;modx-&amp;gt;db-&amp;gt;dbfunctions is now deprecated, so use the actual function from $modx itself.&lt;br /&gt;for more information, refer here:&lt;br /&gt;&lt;a href="http://rtfm.modx.com/display/revolution20/Upgrading+MODx#UpgradingMODx-VersionSpecificChanges"&gt;http://rtfm.modx.com/display/revolution20/Upgrading+MODx#UpgradingMODx-VersionSpecificChanges&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Example of a big change:&lt;br /&gt;&lt;br /&gt;&lt;div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"&gt;&lt;span class="Apple-style-span" style="font-family: inherit;"&gt;$modx-&amp;gt;db-&amp;gt;query is completely different from $modx-&amp;gt;query&lt;/span&gt;&lt;/div&gt;&lt;div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"&gt;&lt;span class="Apple-style-span" style="font-family: inherit;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"&gt;&lt;span class="Apple-style-span" style="font-family: inherit;"&gt;So you may use parseBinding to do your query.&lt;/span&gt;&lt;/div&gt;&lt;div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"&gt;&lt;span class="Apple-style-span" style="font-family: inherit;"&gt;Example:&lt;/span&gt;&lt;/div&gt;&lt;div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: inherit;"&gt;$sSelectSQL = "select `parent`, `context_key` , id, `alias`, pagetitle, longtitle from modx_site_content where&amp;nbsp;context_key=:contextand parent=:parent and `alias`=:alias and (published=0 or deleted=1)";&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"&gt;&lt;span class="Apple-style-span" style="font-family: inherit;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: inherit;"&gt;$aParam = array(":context" =&amp;gt; "web",&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: inherit;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;   &lt;/span&gt;":parent" =&amp;gt; 1, ":alias" =&amp;gt; "somealias");&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"&gt;&lt;span class="Apple-style-span" style="font-family: inherit;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: inherit;"&gt;$sResultSelectSQL = $modx-&amp;gt;parseBindings($sSelectSQL, $aParam);&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: inherit;"&gt;$stmt = $modx-&amp;gt;query($sResultSelectSQL);&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: inherit;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: inherit;"&gt;if (! $stmt) throw new Exception("SQL Failed: " . $sResultSQL);&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: inherit;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: inherit;"&gt;//to fetch all&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: inherit;"&gt;$aCount = $stmt-&amp;gt;fetchAll(PDO::FETCH_ASSOC);&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: inherit;"&gt;foreach($aCount as $oRow) {&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"&gt;&lt;span class="Apple-style-span" style="font-family: inherit;"&gt;&amp;nbsp; echo $oRow["id"];&lt;/span&gt;&lt;/div&gt;&lt;div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"&gt;&lt;span class="Apple-style-span" style="font-family: inherit;"&gt;}&lt;/span&gt;&lt;/div&gt;&lt;div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"&gt;&lt;span class="Apple-style-span" style="font-family: inherit;"&gt;//to fetch one&lt;/span&gt;&lt;/div&gt;&lt;div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"&gt;&lt;span class="Apple-style-span" style="font-family: inherit;"&gt;$oRow = $stmt-&amp;gt;fetch($PDO::FETCH_ASSOC);&lt;/span&gt;&lt;/div&gt;&lt;div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"&gt;&lt;span class="Apple-style-span" style="font-family: inherit;"&gt;echo $oRow["id"];&lt;/span&gt;&lt;/div&gt;&lt;div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: arial; font-size: small; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: arial; font-size: small; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: arial; font-size: small; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"&gt;And other class based method:&lt;/div&gt;&lt;div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: arial; font-size: small; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: arial; font-size: small; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"&gt;//to get an object row&lt;/div&gt;&lt;div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: arial; font-size: small; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"&gt;$oRes = $modx-&amp;gt;getObject("modResource", array("context_key" =&amp;gt; "web", "parent" =&amp;gt; 1, "alias" =&amp;gt; "somealias"));&lt;/div&gt;&lt;div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: arial; font-size: small; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: arial; font-size: small; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"&gt;echo $oRes-&amp;gt;get("id");&lt;/div&gt;&lt;div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: arial; font-size: small; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"&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/163272026812479139-2511515414459920467?l=mercstudio-tech.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mercstudio-tech.blogspot.com/feeds/2511515414459920467/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=163272026812479139&amp;postID=2511515414459920467' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/163272026812479139/posts/default/2511515414459920467'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/163272026812479139/posts/default/2511515414459920467'/><link rel='alternate' type='text/html' href='http://mercstudio-tech.blogspot.com/2012/01/modx-22-changes.html' title='modx 2.2 changes'/><author><name>James Tt</name><uri>https://profiles.google.com/103231744852638250560</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh3.googleusercontent.com/-S2vhoFMo-OY/AAAAAAAAAAI/AAAAAAAAAAA/Y8VfyxcHirI/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-163272026812479139.post-1812397043563863988</id><published>2012-01-27T22:09:00.001-08:00</published><updated>2012-01-27T22:10:06.974-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='modx'/><title type='text'>modx 2.2 modX::isFrontEnd() is undefined?</title><content type='html'>After doing an upgrade to modx2.2, editing any resources seems to throw this error.&lt;br /&gt;Solution, go to package manager, upgrade tinymce plugin.&lt;br /&gt;And we are all set to go! :)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/163272026812479139-1812397043563863988?l=mercstudio-tech.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mercstudio-tech.blogspot.com/feeds/1812397043563863988/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=163272026812479139&amp;postID=1812397043563863988' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/163272026812479139/posts/default/1812397043563863988'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/163272026812479139/posts/default/1812397043563863988'/><link rel='alternate' type='text/html' href='http://mercstudio-tech.blogspot.com/2012/01/modx-22-modxisfrontend-is-undefined.html' title='modx 2.2 modX::isFrontEnd() is undefined?'/><author><name>James Tt</name><uri>https://profiles.google.com/103231744852638250560</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh3.googleusercontent.com/-S2vhoFMo-OY/AAAAAAAAAAI/AAAAAAAAAAA/Y8VfyxcHirI/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-163272026812479139.post-6169804309196947535</id><published>2012-01-27T21:29:00.000-08:00</published><updated>2012-01-27T22:09:00.054-08:00</updated><title type='text'>modx 2.2 upgrade from 2.0 error 500</title><content type='html'>There were seems to some configuration changes from 2.0 to 2.2 on core/config/config.inc.php.&lt;br /&gt;When i was upgrading, the test database seems to response with an error 500.&lt;br /&gt;After inspecting core/cache/logs/error.log, it shows "no database selected"&lt;br /&gt;&lt;br /&gt;So i went into editing core/config/config.inc.php and found the $dbase = "{dbase}"&lt;br /&gt;Using setup with advanced configuration does not seems to do the trick.&lt;br /&gt;The solution now is to edit core/config/config.inc.php and set $dbase = "&lt;b&gt;`mydatabasename`&lt;/b&gt;"&lt;br /&gt;and&amp;nbsp;$database_dsn = 'mysql:host=localhost;dbname=&lt;b&gt;mydatabasename&lt;/b&gt;;charset=utf8';&lt;br /&gt;&lt;br /&gt;Take note on the different between the 2, one with `` delimiter, and one without.&lt;br /&gt;Next, rerun setup for upgrade shall do the trick :)&lt;br /&gt;&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/163272026812479139-6169804309196947535?l=mercstudio-tech.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mercstudio-tech.blogspot.com/feeds/6169804309196947535/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=163272026812479139&amp;postID=6169804309196947535' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/163272026812479139/posts/default/6169804309196947535'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/163272026812479139/posts/default/6169804309196947535'/><link rel='alternate' type='text/html' href='http://mercstudio-tech.blogspot.com/2012/01/modx-22-upgrade-from-20-error-500.html' title='modx 2.2 upgrade from 2.0 error 500'/><author><name>James Tt</name><uri>https://profiles.google.com/103231744852638250560</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh3.googleusercontent.com/-S2vhoFMo-OY/AAAAAAAAAAI/AAAAAAAAAAA/Y8VfyxcHirI/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-163272026812479139.post-409475888731045875</id><published>2012-01-27T12:37:00.000-08:00</published><updated>2012-01-27T12:53:14.017-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='magento'/><title type='text'>magento enable cookie issue on chrome and ie</title><content type='html'>I came across this problem while trying to test my localhost machine for adding a product to cart.&lt;br /&gt;it turn out to be some sort of cookie session issue on magento.&lt;br /&gt;&lt;br /&gt;changing session length nor disabling cookie checking does not seems to work.&lt;br /&gt;its suppose to only happen on localhost testing machine, might work well on actual domain.&lt;br /&gt;&lt;br /&gt;Setting up vhost and pointing using hosts file shall do the trick...&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/163272026812479139-409475888731045875?l=mercstudio-tech.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mercstudio-tech.blogspot.com/feeds/409475888731045875/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=163272026812479139&amp;postID=409475888731045875' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/163272026812479139/posts/default/409475888731045875'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/163272026812479139/posts/default/409475888731045875'/><link rel='alternate' type='text/html' href='http://mercstudio-tech.blogspot.com/2012/01/magento-enable-cookie-issue-on-chrome.html' title='magento enable cookie issue on chrome and ie'/><author><name>James Tt</name><uri>https://profiles.google.com/103231744852638250560</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh3.googleusercontent.com/-S2vhoFMo-OY/AAAAAAAAAAI/AAAAAAAAAAA/Y8VfyxcHirI/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-163272026812479139.post-8445919128670379131</id><published>2012-01-27T08:19:00.000-08:00</published><updated>2012-01-27T08:46:51.342-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='magento'/><title type='text'>magento 1.5</title><content type='html'>Magento 1.5 doesnt allow one to addjs or addskinjs with a custom sorting order...&lt;br /&gt;its because the head.phtml file is doesn't support it in&amp;nbsp;getCssJsHtml() and&amp;nbsp;getIncludes();&lt;br /&gt;&lt;br /&gt;One way to solve it is to inject script directly into head.phtml, but put it into your own template folder...&lt;br /&gt;copy from app/design/frontend/base/default/template/page/html/head.phtml to&lt;br /&gt;app/design/frontend/[yourtemplate]/default/template/page/html/&lt;br /&gt;&lt;br /&gt;Another thing to take note is getUrl and getSkinURL gotcha...&lt;br /&gt;Example:&lt;br /&gt;$this-&amp;gt;getSkinUrl("js/java.js"); // return skin/frontend/[base_or_yourtemplate]/default/js/java.js&lt;br /&gt;but&lt;br /&gt;$this-&amp;gt;getUrl("js/java.js"); // return http://yourbasepath.com/js/java.js&lt;b&gt;&lt;span class="Apple-style-span" style="font-size: large;"&gt;/&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;br /&gt;Work around will be using&amp;nbsp;$this-&amp;gt;getUrl(""). "js/java.js"&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/163272026812479139-8445919128670379131?l=mercstudio-tech.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mercstudio-tech.blogspot.com/feeds/8445919128670379131/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=163272026812479139&amp;postID=8445919128670379131' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/163272026812479139/posts/default/8445919128670379131'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/163272026812479139/posts/default/8445919128670379131'/><link rel='alternate' type='text/html' href='http://mercstudio-tech.blogspot.com/2012/01/magento-15.html' title='magento 1.5'/><author><name>James Tt</name><uri>https://profiles.google.com/103231744852638250560</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh3.googleusercontent.com/-S2vhoFMo-OY/AAAAAAAAAAI/AAAAAAAAAAA/Y8VfyxcHirI/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-163272026812479139.post-2205078936760594635</id><published>2012-01-17T19:24:00.000-08:00</published><updated>2012-01-18T07:26:57.344-08:00</updated><title type='text'>netonboard.com sucks?</title><content type='html'>Updates 2012 jan 18:&lt;br /&gt;Finally, got their attention from facebook fanpage. Talked to their support, and got my email replied.&lt;br /&gt;They should check their offline chat message if its provided on their website...&lt;br /&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;-----------------------------------------------------------------&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;Well, i tried to be professional in judging them.&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;If it wasn't because the client bought the hosting with them, i might not have to face their shit.&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;First, they change their hosting without our notice.&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;Previously things which works, now doesn't work, and they claim they never change anything,&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;In php point of programmer view, they disable error log.&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;Fine, as programmer, i will use ini_set to enable it to see what went wrong.&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;so my surprise, it came out error 500 instead.&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;so defnitely it has been disabled ini_set function... wth..&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;Next, if you php code doesnt close with ?&amp;gt;, it will also come out error 500, isn't this a norm in php to have unclosed tag? its to avoid unwanted endline charactor in the end to avoid being output out.&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;3rd, fine, lets fill in the support form for help..&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;After filling in the contact form, its been 1+ weeks and no response.&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;Okay, lets try call their support fella, went to voice mail...&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;Okay, lets try again, their "live chat",&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;waiting for operator,&amp;nbsp;waiting for operator,&amp;nbsp;waiting for operator,&amp;nbsp;waiting for operator, &amp;nbsp;sorry operator not available..&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;Their website published they hosted CIMB, wth? do you think bank will host with them with this kind of SLA? LoL, what a joke..&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/163272026812479139-2205078936760594635?l=mercstudio-tech.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mercstudio-tech.blogspot.com/feeds/2205078936760594635/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=163272026812479139&amp;postID=2205078936760594635' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/163272026812479139/posts/default/2205078936760594635'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/163272026812479139/posts/default/2205078936760594635'/><link rel='alternate' type='text/html' href='http://mercstudio-tech.blogspot.com/2012/01/netonboardcom-sucks.html' title='netonboard.com sucks?'/><author><name>James Tt</name><uri>https://profiles.google.com/103231744852638250560</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh3.googleusercontent.com/-S2vhoFMo-OY/AAAAAAAAAAI/AAAAAAAAAAA/Y8VfyxcHirI/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-163272026812479139.post-3795874290401719047</id><published>2012-01-05T19:09:00.000-08:00</published><updated>2012-01-05T19:16:54.804-08:00</updated><title type='text'>Facebook App session issue after user logout or close browser</title><content type='html'>It seems that Facebook PHP SDK does not properly check if user have logged out or close the browser.&lt;br /&gt;When someone closes the browser or log out of facebook, the php sdk should detect the problem and automatically destroy the session, but it doesnt seems to be the case, even when we call $fb-&amp;gt;destroySession();&lt;br /&gt;&lt;br /&gt;One way to effectively check for problem is to use Facebook javascript sdk by subscribing to :&lt;br /&gt;&lt;br /&gt;----------&lt;br /&gt;FB.Event.subscribe('auth.logout', function(response) {&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; if (response.status=="unknown") {&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; //some weird session error&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; document.location.href="login.php";&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; return;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; doTimerReload();&lt;br /&gt;&amp;nbsp; &amp;nbsp; });&lt;br /&gt;----------&lt;br /&gt;The code effectively detect the logout with "unknown" status and redirect the user to a login screen.&lt;br /&gt;Example of a login.php code:&lt;br /&gt;&lt;br /&gt;Please &amp;lt;a href="javascript:"&amp;gt;click here&amp;lt;/a&amp;gt;&amp;lt;br /&amp;gt;&amp;lt;script&amp;gt;&lt;/p&gt;&lt;p&gt;function doFBLogin() {&lt;/p&gt;&lt;p&gt;FB.login(function(response) {&lt;/p&gt;&lt;p&gt;&amp;nbsp; if (response.authResponse) {&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp;FB.api('/me', function(response) {&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp;});&lt;/p&gt;&lt;p&gt;&amp;nbsp; } else {&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp;alert("Please authorize app by refreshing to continue...");&lt;/p&gt;&lt;p&gt;&amp;nbsp; }&lt;/p&gt;&lt;p&gt;&amp;nbsp; }, {scope: 'email,user_likes'}); //additional parameter&lt;/p&gt;&lt;p&gt;}&lt;/p&gt;&lt;p&gt;&amp;lt;/script&amp;gt;&amp;lt;br /&amp;gt;----------&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/163272026812479139-3795874290401719047?l=mercstudio-tech.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mercstudio-tech.blogspot.com/feeds/3795874290401719047/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=163272026812479139&amp;postID=3795874290401719047' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/163272026812479139/posts/default/3795874290401719047'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/163272026812479139/posts/default/3795874290401719047'/><link rel='alternate' type='text/html' href='http://mercstudio-tech.blogspot.com/2012/01/facebook-app-session-issue-after-user.html' title='Facebook App session issue after user logout or close browser'/><author><name>James Tt</name><uri>https://profiles.google.com/103231744852638250560</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh3.googleusercontent.com/-S2vhoFMo-OY/AAAAAAAAAAI/AAAAAAAAAAA/Y8VfyxcHirI/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-163272026812479139.post-4279117281056369732</id><published>2012-01-04T06:57:00.000-08:00</published><updated>2012-01-09T05:48:12.755-08:00</updated><title type='text'>Setting up zimbra centos 6 64bits</title><content type='html'>#makesure to update first&lt;br /&gt;yum update&lt;br /&gt;#install java first&lt;br /&gt;yum install java-1.6.0&lt;br /&gt;yum install netc&lt;br /&gt;yum install which&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;#change existing httpd port other port than 80&lt;br /&gt;sudo vi /etc/httpd/conf/httpd.conf&lt;br /&gt;#change line: Listen 80 to &lt;b&gt;Listen 8080 (any other port)&lt;/b&gt;&lt;br /&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;br /&gt;#change existing sendmail port to other than port 25&lt;br /&gt;sudo vi /etc/mail/sendmail.mc&lt;br /&gt;#locate line:&lt;br /&gt;DAEMON_OPTIONS(`Port=smtp,Addr=127.0.0.1, Name=MTA')dnl&lt;br /&gt;#change to other port than 25 / smtp&lt;br /&gt;DAEMON_OPTIONS(`Port=&lt;b&gt;2525&lt;/b&gt;,Addr=127.0.0.1, Name=MTA')dnl&lt;br /&gt;&lt;br /&gt;#locate line:&lt;br /&gt;dnl DAEMON_OPTIONS(`port=smtp,Addr=::1, Name=MTA-v6, Family=inet6')dnl&lt;br /&gt;#change&amp;nbsp;to other port than 25 / smtp&lt;br /&gt;dnl DAEMON_OPTIONS(`port=&lt;b&gt;2525&lt;/b&gt;,Addr=::1, Name=MTA-v6, Family=inet6')dnl&lt;br /&gt;#run this to apply changes&lt;br /&gt;m4 sendmail.mc &amp;gt; /etc/sendmail.cf&lt;br /&gt;&lt;br /&gt;#temporary disable sudo tty requirement&lt;br /&gt;su&lt;br /&gt;visudo&lt;br /&gt;#locate line &lt;b&gt;Default requiretty &lt;/b&gt;and disable it with a &lt;b&gt;#&lt;/b&gt;&lt;br /&gt;#Defaults requiretty&lt;br /&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;/etc/init.d/httpd restart&lt;/div&gt;&lt;div&gt;/etc/init.d/sendmail restart&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;#double check to ensure both http / 80 and smtp / 25 is not used any longer&lt;/div&gt;&lt;div&gt;netstat -lp&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;#Go to zimbra website and download the respective package for your platform...&lt;/div&gt;&lt;div&gt;#if something went wrong, check the log.&lt;/div&gt;&lt;div&gt;#to resetup, run:&lt;/div&gt;&lt;div&gt;/opt/zimbra/libexec/zmsetup.pl&lt;br /&gt;&lt;br /&gt;#when done, reboot the system&lt;br /&gt;sudo reboot&lt;br /&gt;&lt;br /&gt;#next, run netstat -lp to check if system is running&lt;br /&gt;#try telnet localhost 25, telnet localhost 110 and try web browsing&lt;br /&gt;#to restart the service, try:&lt;br /&gt;/etc/init.d/zimbra restart&lt;br /&gt;&lt;br /&gt;sudo -u zimbra /opt/zimbra/bin/zmcontrol status&lt;br /&gt;#shows:&lt;br /&gt;# mailbox &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Stopped&lt;br /&gt;#check the log&lt;br /&gt;tail -n 100 /opt/zimbra/log/mailbox.log&lt;br /&gt;#if it shows&lt;br /&gt;...Unknown table engine 'InnoDB'&lt;br /&gt;#it meants that your innodb engine is not initiated , and most likely is memory issue.&lt;br /&gt;#try changing&amp;nbsp;&lt;span class="Apple-style-span" style="background-color: #d5d6d7; color: #333333; font-family: 'Lucida Grande', Verdana, Arial, sans-serif; font-size: 13px; line-height: 16px;"&gt;innodb_buffer_pool_size&amp;nbsp;&lt;/span&gt;to a lower value (below about 40% of your memory or vps memory)&lt;br /&gt;sudo vi /opt/zimbra/conf/my.inf&lt;br /&gt;#locate line&amp;nbsp;&lt;span class="Apple-style-span" style="background-color: #d5d6d7; color: #333333; font-family: 'Lucida Grande', Verdana, Arial, sans-serif; font-size: 13px; line-height: 16px;"&gt;innodb_buffer_pool_size&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: #333333; font-family: 'Lucida Grande', Verdana, Arial, sans-serif; font-size: x-small;"&gt;&lt;span class="Apple-style-span" style="line-height: 16px;"&gt;&lt;span style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; background-color: #d5d6d7; color: #333333; display: inline !important; float: none; font-family: 'Lucida Grande', Verdana, Arial, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: 16px; orphans: 2; text-align: justify; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"&gt;innodb_buffer_pool_size=400M&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;#restart zimbra mail&lt;/div&gt;&lt;div&gt;sudo -u zimbra /opt/zimbra/bin/mysql.server restart&lt;/div&gt;&lt;div&gt;sudo -u zimbra&amp;nbsp;/opt/zimbra/bin/zmmailboxdctl restart&lt;br /&gt;&lt;br /&gt;#to begin:&lt;br /&gt;https://www.mydomain.com:7071&lt;br /&gt;admin@mydomain.com&lt;br /&gt;&lt;br /&gt;&lt;a href="http://wiki.zimbra.com/wiki/Administration_Console"&gt;http://wiki.zimbra.com/wiki/Administration_Console&lt;/a&gt;&lt;br /&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;#If you forgotten your password, run this on server:&lt;br /&gt;/opt/zimbra/bin/zmprov sp admin@mydomain.com [password]&lt;br /&gt;&lt;br /&gt;If you get error in the admin ui with:&lt;br /&gt;Message:  system failure: server yourdomain.com &amp;nbsp;zimbraRemoteManagementPrivateKeyPath (/opt/zimbra/.ssh/zimbra_identity) does not existError code:  service.FAILUREDetails:soap:Receive&lt;br /&gt;Try this:&lt;br /&gt;&lt;a href="http://wiki.zimbra.com/index.php?title=Mail_Queue_Monitoring"&gt;http://wiki.zimbra.com/index.php?title=Mail_Queue_Monitoring&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;If you are facing memory heap size problem with java, try following this link:&lt;br /&gt;&lt;a href="http://www.thatsmyview.net/2010/04/17/optimizing-performance-for-vps-and-low-ram/"&gt;http://www.thatsmyview.net/2010/04/17/optimizing-performance-for-vps-and-low-ram/&lt;/a&gt;&lt;br /&gt;and also set your default heap size in java by editing ~/.bash_profile&lt;br /&gt;&lt;span style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; background-color: #eeeeee; color: black; display: inline !important; float: none; font-family: Consolas, Menlo, Monaco, 'Lucida Console', 'Liberation Mono', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', monospace, serif; font-size: 14px; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: 18px; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"&gt;export _JAVA_OPTIONS=-Xmx100m&lt;/span&gt;&lt;br /&gt;&lt;span style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; background-color: #eeeeee; color: black; display: inline !important; float: none; font-family: Consolas, Menlo, Monaco, 'Lucida Console', 'Liberation Mono', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', monospace, serif; font-size: 14px; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: 18px; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;#If your mail have not been deliver, try check the que by running:&lt;br /&gt;sudo mailq&lt;br /&gt;&lt;br /&gt;#if you encounter some file(1) utils missing, install it by running:&lt;br /&gt;sudo yum install file&lt;br /&gt;&lt;br /&gt;#If you are running zimbra from a openvz vps, please ensure min 3Gb of burst memory. Or it wont run properly. The problem is due to missing swap in openvz. So it will need sufficient memory to run.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;#references:&lt;br /&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;&lt;a href="http://wiki.zimbra.com/wiki/Ports"&gt;http://wiki.zimbra.com/wiki/Ports&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;&lt;br /&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/163272026812479139-4279117281056369732?l=mercstudio-tech.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mercstudio-tech.blogspot.com/feeds/4279117281056369732/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=163272026812479139&amp;postID=4279117281056369732' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/163272026812479139/posts/default/4279117281056369732'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/163272026812479139/posts/default/4279117281056369732'/><link rel='alternate' type='text/html' href='http://mercstudio-tech.blogspot.com/2012/01/setting-up-zimbra-centos-6-64bits.html' title='Setting up zimbra centos 6 64bits'/><author><name>James Tt</name><uri>https://profiles.google.com/103231744852638250560</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh3.googleusercontent.com/-S2vhoFMo-OY/AAAAAAAAAAI/AAAAAAAAAAA/Y8VfyxcHirI/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-163272026812479139.post-3723889565051312575</id><published>2011-12-31T12:31:00.000-08:00</published><updated>2011-12-31T12:31:46.424-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='cms'/><category scheme='http://www.blogger.com/atom/ns#' term='modx'/><title type='text'>MODx page not found on manager</title><content type='html'>This was a real trouble for me in the first place.&lt;br /&gt;How am i suppose to fix this...&lt;br /&gt;First, i did the throw exception as stated in my last post.&lt;br /&gt;&lt;br /&gt;then next thing i know, i realize the $modx-&amp;gt;config["modRequest.class"] wasn't declared...&lt;br /&gt;so it uses modRequest instead of modManagerRequest class.&lt;br /&gt;&lt;br /&gt;after digging for hours, ive finally noticed that the $modx-&amp;gt;context-&amp;gt;prepare() doesnt seems to return&lt;br /&gt;proper config in $modx-&amp;gt;context-&amp;gt;config;&lt;br /&gt;&lt;br /&gt;to fix it, add in &lt;b&gt;true &lt;/b&gt;&amp;nbsp;into the parameter:&lt;br /&gt;$modx-&amp;gt;context-&amp;gt;prepare(true);&lt;br /&gt;then, load the manager page. you should be able to see the manager page now.&lt;br /&gt;next, remove the true (restore the code to its previous state).&lt;br /&gt;then login into the manager.&lt;br /&gt;and Site &amp;gt; Clear cache.&lt;br /&gt;Now all your site should have the proper config loaded based on the respective context.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/163272026812479139-3723889565051312575?l=mercstudio-tech.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mercstudio-tech.blogspot.com/feeds/3723889565051312575/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=163272026812479139&amp;postID=3723889565051312575' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/163272026812479139/posts/default/3723889565051312575'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/163272026812479139/posts/default/3723889565051312575'/><link rel='alternate' type='text/html' href='http://mercstudio-tech.blogspot.com/2011/12/modx-page-not-found-on-manager.html' title='MODx page not found on manager'/><author><name>James Tt</name><uri>https://profiles.google.com/103231744852638250560</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh3.googleusercontent.com/-S2vhoFMo-OY/AAAAAAAAAAI/AAAAAAAAAAA/Y8VfyxcHirI/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-163272026812479139.post-5938290750038421932</id><published>2011-12-31T12:26:00.000-08:00</published><updated>2011-12-31T12:31:40.209-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='cms'/><category scheme='http://www.blogger.com/atom/ns#' term='modx'/><title type='text'>MODx page not found...</title><content type='html'>Stumble upon modx page not found?&lt;br /&gt;MODx by default, will send an error page if any error found during the loading of the page.&lt;br /&gt;its in modx/core/model/modx.class.php&lt;br /&gt;&lt;br /&gt;want to see the actual error?&lt;br /&gt;go to the line declaration of&lt;br /&gt;public function sendError($type = '', $options = array()) {&lt;br /&gt;&lt;b&gt;throw new Exception($errorMessage); //after $errorMessage is defined&lt;/b&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/163272026812479139-5938290750038421932?l=mercstudio-tech.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mercstudio-tech.blogspot.com/feeds/5938290750038421932/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=163272026812479139&amp;postID=5938290750038421932' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/163272026812479139/posts/default/5938290750038421932'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/163272026812479139/posts/default/5938290750038421932'/><link rel='alternate' type='text/html' href='http://mercstudio-tech.blogspot.com/2011/12/modx-page-not-found.html' title='MODx page not found...'/><author><name>James Tt</name><uri>https://profiles.google.com/103231744852638250560</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh3.googleusercontent.com/-S2vhoFMo-OY/AAAAAAAAAAI/AAAAAAAAAAA/Y8VfyxcHirI/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-163272026812479139.post-8692341454763646692</id><published>2011-12-27T20:27:00.001-08:00</published><updated>2011-12-27T20:30:16.214-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='google sucks'/><category scheme='http://www.blogger.com/atom/ns#' term='google'/><title type='text'>more google Sucks?</title><content type='html'>Here lies the support forum:&lt;br /&gt;&lt;a href="http://www.google.com/support/forum/p/Google+Apps?hl=en"&gt;http://www.google.com/support/&lt;wbr&gt;&lt;/wbr&gt;forum/p/Google+Apps?hl=en&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;and no way to post any topic.. yay!&lt;br /&gt;&lt;br /&gt;updates: if you are a google app user, no way,&lt;br /&gt;unless u r a gmail user...&lt;br /&gt;&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/163272026812479139-8692341454763646692?l=mercstudio-tech.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mercstudio-tech.blogspot.com/feeds/8692341454763646692/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=163272026812479139&amp;postID=8692341454763646692' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/163272026812479139/posts/default/8692341454763646692'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/163272026812479139/posts/default/8692341454763646692'/><link rel='alternate' type='text/html' href='http://mercstudio-tech.blogspot.com/2011/12/more-google-sucks.html' title='more google Sucks?'/><author><name>James Tt</name><uri>https://profiles.google.com/103231744852638250560</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh3.googleusercontent.com/-S2vhoFMo-OY/AAAAAAAAAAI/AAAAAAAAAAA/Y8VfyxcHirI/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-163272026812479139.post-8936757049231001196</id><published>2011-12-27T20:25:00.000-08:00</published><updated>2011-12-27T20:25:20.491-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='mysql'/><title type='text'>mysql select condition and sum select</title><content type='html'>When one select some records from a table, if the condition didnt meet, there will be 0 records returned..&lt;br /&gt;But for a sum record, there will be min 1 record return, even if the record is not found.&lt;br /&gt;&lt;br /&gt;SELECT * FROM `table` WHERE 1=2&lt;br /&gt;#return 0 records;&lt;br /&gt;&lt;br /&gt;SELECT id, sum(field1) FROM `table` WHERE 1=2&lt;br /&gt;#return min 1 record, even if id is null&lt;br /&gt;&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/163272026812479139-8936757049231001196?l=mercstudio-tech.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mercstudio-tech.blogspot.com/feeds/8936757049231001196/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=163272026812479139&amp;postID=8936757049231001196' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/163272026812479139/posts/default/8936757049231001196'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/163272026812479139/posts/default/8936757049231001196'/><link rel='alternate' type='text/html' href='http://mercstudio-tech.blogspot.com/2011/12/mysql-select-condition-and-sum-select.html' title='mysql select condition and sum select'/><author><name>James Tt</name><uri>https://profiles.google.com/103231744852638250560</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh3.googleusercontent.com/-S2vhoFMo-OY/AAAAAAAAAAI/AAAAAAAAAAA/Y8VfyxcHirI/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-163272026812479139.post-5277882900179157943</id><published>2011-12-16T23:15:00.000-08:00</published><updated>2011-12-16T23:42:17.294-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='gmail sucks'/><category scheme='http://www.blogger.com/atom/ns#' term='google sucks'/><title type='text'>GMail sucks?</title><content type='html'>I've been a long time users of gmail.&lt;br /&gt;I've my email hosted on google apps, and find their anti-spam protection rocks.&lt;br /&gt;But lately, i found their flaws. This flaws is so extreme that i almost want to move out of their app server.&lt;br /&gt;&lt;br /&gt;Their spam protection have moved to another level, TOTALLY BLOCKING IP.&lt;br /&gt;Even after several attempt to request them to white list my ip, They FAILED to response on time or response any emails to my request.&lt;br /&gt;I've my RDNS setup, SPF and DKIM, but they just block my ip.&lt;br /&gt;And its a new vps ive just gotten, so im not sharing the ip with anyone else.&lt;br /&gt;Probably someone have miss-used it in the past, but they should response on time to legitimate ip users. This is very unacceptable attitude from Google Team!&lt;br /&gt;My IP is perfectly clean from any black list servers, and why the heck google need to BLOCK IP????&lt;br /&gt;&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/163272026812479139-5277882900179157943?l=mercstudio-tech.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mercstudio-tech.blogspot.com/feeds/5277882900179157943/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=163272026812479139&amp;postID=5277882900179157943' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/163272026812479139/posts/default/5277882900179157943'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/163272026812479139/posts/default/5277882900179157943'/><link rel='alternate' type='text/html' href='http://mercstudio-tech.blogspot.com/2011/12/gmail-sucks.html' title='GMail sucks?'/><author><name>James Tt</name><uri>https://profiles.google.com/103231744852638250560</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh3.googleusercontent.com/-S2vhoFMo-OY/AAAAAAAAAAI/AAAAAAAAAAA/Y8VfyxcHirI/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-163272026812479139.post-729320394203890806</id><published>2011-12-15T05:39:00.000-08:00</published><updated>2011-12-16T20:18:51.705-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='rnds'/><category scheme='http://www.blogger.com/atom/ns#' term='mail server'/><category scheme='http://www.blogger.com/atom/ns#' term='rdns'/><category scheme='http://www.blogger.com/atom/ns#' term='spf'/><title type='text'>white listing your mail server</title><content type='html'>Its so often that our email got miss-tagged as spam and thrown into the recipient junk mail.&lt;br /&gt;It has and will be an on going research on how to&amp;nbsp;white list&amp;nbsp;our mail server to have those emails going into the proper inbox of the recipient.&lt;br /&gt;Even with perfect configuration of&amp;nbsp;white-listing, SPF and SNDS and RDNS, we need to take important consideration into spam filtering on all your&amp;nbsp;&lt;b&gt;outgoing&lt;/b&gt;&amp;nbsp;emails. This is extremely important, as we need to protect our good users from bad users. Also to prevent virus infected pc from sending out spams or viruses.&lt;br /&gt;&lt;i&gt;(This article is a work in progress)&lt;/i&gt;&lt;br /&gt;&lt;br /&gt;Several options availble:&lt;br /&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;&lt;b&gt;SPF&lt;/b&gt;&amp;nbsp;(Sender Policy Framework) Record&lt;br /&gt;Setting up custom TXT record to domain to whitelist your mail server for each domain&lt;br /&gt;&lt;a href="http://www.openspf.net/"&gt;http://www.openspf.net/&lt;/a&gt;&lt;br /&gt;Used by:&amp;nbsp;&lt;b&gt;Gmail&lt;/b&gt;, yahoo mail&lt;/li&gt;&lt;li&gt;&lt;b&gt;SNDS&lt;/b&gt;&amp;nbsp;(Smart Network Data Services)&lt;br /&gt;Join the White list channel.&lt;br /&gt;This will requires a RDNS to point to your domain, and have postmaster or abuse@yourdomain.com to handle the add to white list&lt;br /&gt;&lt;a href="https://postmaster.live.com/snds/FAQ.aspx#WhatIsSNDS"&gt;https://postmaster.live.com/snds/FAQ.aspx#WhatIsSNDS&lt;/a&gt;&lt;br /&gt;Used by: hotmail and more..&lt;/li&gt;&lt;li&gt;&lt;b&gt;AuthKey&lt;/b&gt;&lt;br /&gt;Used by hotmail&lt;/li&gt;&lt;li&gt;&lt;b&gt;DomainKey&lt;/b&gt;&lt;br /&gt;Used by hotmail and yahoo mail&lt;/li&gt;&lt;li&gt;&lt;b&gt;RDNS&lt;/b&gt;&amp;nbsp;(Reverse DNS)&lt;br /&gt;Need data center or IP owner to point the ip lookup to domain&lt;/li&gt;&lt;/ul&gt;&lt;div&gt;Suggestion:&lt;br /&gt;&lt;ol&gt;&lt;li&gt;Setup RDNS&lt;/li&gt;&lt;li&gt;Setup SNDS&lt;/li&gt;&lt;li&gt;Setup SPF Record for every domain&lt;/li&gt;&lt;li&gt;Dmainkey and Authkey&lt;/li&gt;&lt;/ol&gt;&lt;/div&gt;&lt;br /&gt;Useful resources:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Sender score: do check mail server reputation&lt;br /&gt;&lt;a href="https://www.senderscore.org/"&gt;https://www.senderscore.org/&lt;/a&gt;&lt;/li&gt;&lt;li&gt;Hotmail whitelisting:&lt;br /&gt;&lt;a href="https://support.msn.com/eform.aspx?productKey=edfsmsbl&amp;amp;page=support_home_options_form_bye-mail&amp;amp;ct=eformts&amp;amp;lc=1033&amp;amp;st=1&amp;amp;wfxredirect=1"&gt;https://support.msn.com/eform.aspx?productKey=edfsmsbl&amp;amp;page=support_home_options_form_bye-mail&amp;amp;ct=eformts&amp;amp;lc=1033&amp;amp;st=1&amp;amp;wfxredirect=1&lt;/a&gt;&lt;/li&gt;&lt;li&gt;Gmail whitelisting:&lt;br /&gt;&lt;a href="https://support.google.com/mail/bin/answer.py?hl=en&amp;amp;answer=81126"&gt;https://support.google.com/mail/bin/answer.py?hl=en&amp;amp;answer=81126&lt;/a&gt;&lt;br /&gt;&lt;a href="https://support.google.com/mail/bin/request.py?hl=en&amp;amp;contact_type=bulksend&amp;amp;rd=1"&gt;https://support.google.com/mail/bin/request.py?hl=en&amp;amp;contact_type=bulksend&amp;amp;rd=1&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;&lt;ul&gt;&lt;/ul&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/163272026812479139-729320394203890806?l=mercstudio-tech.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mercstudio-tech.blogspot.com/feeds/729320394203890806/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=163272026812479139&amp;postID=729320394203890806' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/163272026812479139/posts/default/729320394203890806'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/163272026812479139/posts/default/729320394203890806'/><link rel='alternate' type='text/html' href='http://mercstudio-tech.blogspot.com/2011/12/white-listing-your-mail-server.html' title='white listing your mail server'/><author><name>James Tt</name><uri>https://profiles.google.com/103231744852638250560</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh3.googleusercontent.com/-S2vhoFMo-OY/AAAAAAAAAAI/AAAAAAAAAAA/Y8VfyxcHirI/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-163272026812479139.post-1835086323580684205</id><published>2011-12-14T01:57:00.000-08:00</published><updated>2011-12-14T01:58:36.717-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='git'/><category scheme='http://www.blogger.com/atom/ns#' term='recovery'/><title type='text'></title><content type='html'>I was doing my coding in netbean as usual, and was shock to find my changes been replaced and deleted by git. im not sure where went wrong, is it netbean commit that didnt register, or is it git messed up by replacing my commit with its old version.&lt;br /&gt;&lt;br /&gt;Wondering how to revert a pull which messed up your code?&lt;br /&gt;run:&lt;br /&gt;git reflog&lt;br /&gt;#example return:&lt;br /&gt;&lt;br /&gt;d5ca5a5 HEAD@{0}: pull : Merge made by recursive.&lt;br /&gt;&lt;b&gt;772321b&lt;/b&gt; HEAD@{1}: commit: ....&lt;br /&gt;585e66b HEAD@{2}: commit: ....&lt;br /&gt;5a61fe4 HEAD@{3}: commit: ....&lt;br /&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;run:&lt;/div&gt;&lt;div&gt;git reset&amp;nbsp;772321b&lt;/div&gt;&lt;div&gt;#reset to a version before the merge was made&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;then go to netbean and revert all modification done.&lt;/div&gt;&lt;div&gt;This modification basically meants changes that reverse your commit to the older version&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;then make a copy of the version you have else where.&lt;/div&gt;&lt;div&gt;then run:&lt;/div&gt;&lt;div&gt;git pull&lt;/div&gt;&lt;div&gt;#redo the merge again , which messed up.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;#then run meld and compare both directory and put back your latest files and updates into the working directory.&lt;/div&gt;&lt;div&gt;#then recommit your changes.&lt;/div&gt;&lt;div&gt;#then run:&lt;/div&gt;&lt;div&gt;git push&lt;br /&gt;#again.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/163272026812479139-1835086323580684205?l=mercstudio-tech.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mercstudio-tech.blogspot.com/feeds/1835086323580684205/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=163272026812479139&amp;postID=1835086323580684205' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/163272026812479139/posts/default/1835086323580684205'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/163272026812479139/posts/default/1835086323580684205'/><link rel='alternate' type='text/html' href='http://mercstudio-tech.blogspot.com/2011/12/i-was-doing-my-coding-in-netbean-as.html' title=''/><author><name>James Tt</name><uri>https://profiles.google.com/103231744852638250560</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh3.googleusercontent.com/-S2vhoFMo-OY/AAAAAAAAAAI/AAAAAAAAAAA/Y8VfyxcHirI/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-163272026812479139.post-6095261758778381481</id><published>2011-12-10T09:12:00.001-08:00</published><updated>2011-12-15T06:02:45.221-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='server'/><category scheme='http://www.blogger.com/atom/ns#' term='qmail'/><title type='text'>smtp relay and spam?</title><content type='html'>If you are using an external email server to relay your emails,&lt;br /&gt;makesure to add spf record to your dns:&lt;br /&gt;&lt;br /&gt;Example:&lt;br /&gt;#Create a &lt;b&gt;TXT&lt;/b&gt; record containing this text:&lt;br /&gt;v=spf1 a:&lt;b&gt;mail.yourdomain.com&amp;nbsp;&lt;/b&gt;-all&lt;br /&gt;&lt;div&gt;#above meants only allow email to be sent directly from mail.yourdomain.com&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;if you want to use google:&lt;/div&gt;&lt;div&gt;v=spf1&amp;nbsp;include:aspmx.googlemail.com -all&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;for multiple mail server:&lt;/div&gt;&lt;div&gt;v=spf1 a:&lt;b&gt;mail.yourdomain.com&lt;/b&gt;&amp;nbsp;a:&lt;b&gt;mail2.yourdomain.com&lt;/b&gt;&amp;nbsp;-all&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;-all = exclude all others..&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;br /&gt;-----&lt;br /&gt;How to setup qmail to forward emails to another smtp server?&lt;br /&gt;sudo vi /var/qmail/control/smtproutes&lt;br /&gt;&lt;br /&gt;:yourexternalserver.com:port# username password&lt;br /&gt;#port, username and password are optional&lt;br /&gt;&lt;br /&gt;if you want to set for specific domain:&lt;br /&gt;mydomain.com:yourexternalserver.com:port# username password&lt;br /&gt;:otherexternalserver.com:port# username password&lt;br /&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/163272026812479139-6095261758778381481?l=mercstudio-tech.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mercstudio-tech.blogspot.com/feeds/6095261758778381481/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=163272026812479139&amp;postID=6095261758778381481' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/163272026812479139/posts/default/6095261758778381481'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/163272026812479139/posts/default/6095261758778381481'/><link rel='alternate' type='text/html' href='http://mercstudio-tech.blogspot.com/2011/12/smtp-relay-and-spam.html' title='smtp relay and spam?'/><author><name>James Tt</name><uri>https://profiles.google.com/103231744852638250560</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh3.googleusercontent.com/-S2vhoFMo-OY/AAAAAAAAAAI/AAAAAAAAAAA/Y8VfyxcHirI/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-163272026812479139.post-1111330876177902505</id><published>2011-12-01T07:44:00.001-08:00</published><updated>2011-12-01T07:47:36.650-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='utf8'/><category scheme='http://www.blogger.com/atom/ns#' term='php'/><title type='text'>htmlentities and utf8</title><content type='html'>Ever wonder why your utf8 charactors doesn't work with htmlentities?&lt;br /&gt;try&amp;nbsp;&lt;b&gt;htmlspecialchars&lt;/b&gt;&lt;br /&gt;Example:&lt;br /&gt;$sResult = htmlspecialchars($sText, ENT_COMPAT, "UTF-8");&lt;br /&gt;&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/163272026812479139-1111330876177902505?l=mercstudio-tech.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mercstudio-tech.blogspot.com/feeds/1111330876177902505/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=163272026812479139&amp;postID=1111330876177902505' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/163272026812479139/posts/default/1111330876177902505'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/163272026812479139/posts/default/1111330876177902505'/><link rel='alternate' type='text/html' href='http://mercstudio-tech.blogspot.com/2011/12/htmlentities-and-utf8.html' title='htmlentities and utf8'/><author><name>James Tt</name><uri>https://profiles.google.com/103231744852638250560</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh3.googleusercontent.com/-S2vhoFMo-OY/AAAAAAAAAAI/AAAAAAAAAAA/Y8VfyxcHirI/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-163272026812479139.post-655330231437199886</id><published>2011-11-04T20:44:00.000-07:00</published><updated>2011-11-04T20:46:04.037-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='magento'/><category scheme='http://www.blogger.com/atom/ns#' term='ecommerce'/><title type='text'>magento rant</title><content type='html'>First, their javascript validation for setup Fail big time!&lt;br /&gt;once it failed to validate, no matter what you have change in that field, it will not validate anymore!&lt;br /&gt;need to refresh the page, that sucks big time!&lt;br /&gt;&lt;br /&gt;installation, took more than 2minutes!&lt;br /&gt;200+tables, omg, do we need that much?&lt;br /&gt;&lt;br /&gt;PHP Memory limit of 256MB ?? omg...&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/163272026812479139-655330231437199886?l=mercstudio-tech.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mercstudio-tech.blogspot.com/feeds/655330231437199886/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=163272026812479139&amp;postID=655330231437199886' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/163272026812479139/posts/default/655330231437199886'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/163272026812479139/posts/default/655330231437199886'/><link rel='alternate' type='text/html' href='http://mercstudio-tech.blogspot.com/2011/11/magento-rant.html' title='magento rant'/><author><name>James Tt</name><uri>https://profiles.google.com/103231744852638250560</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh3.googleusercontent.com/-S2vhoFMo-OY/AAAAAAAAAAI/AAAAAAAAAAA/Y8VfyxcHirI/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-163272026812479139.post-569284855888904679</id><published>2011-11-03T21:47:00.001-07:00</published><updated>2011-11-03T21:47:54.818-07:00</updated><title type='text'>openbase_dir problem on plesk subdomains</title><content type='html'>&lt;a href="http://enarion.net/web/plesk/subdomains-and-open_basedir/"&gt;http://enarion.net/web/plesk/subdomains-and-open_basedir/&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/163272026812479139-569284855888904679?l=mercstudio-tech.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mercstudio-tech.blogspot.com/feeds/569284855888904679/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=163272026812479139&amp;postID=569284855888904679' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/163272026812479139/posts/default/569284855888904679'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/163272026812479139/posts/default/569284855888904679'/><link rel='alternate' type='text/html' href='http://mercstudio-tech.blogspot.com/2011/11/openbasedir-problem-on-plesk-subdomains.html' title='openbase_dir problem on plesk subdomains'/><author><name>James Tt</name><uri>https://profiles.google.com/103231744852638250560</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh3.googleusercontent.com/-S2vhoFMo-OY/AAAAAAAAAAI/AAAAAAAAAAA/Y8VfyxcHirI/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-163272026812479139.post-866056830026369898</id><published>2011-10-20T19:19:00.000-07:00</published><updated>2011-10-20T19:19:52.010-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='virtualbox'/><title type='text'>ubuntu virtualbox alt+click</title><content type='html'>i find it troublesome that i&amp;nbsp;couldn't&amp;nbsp;alt click in my Virtualbox&amp;nbsp;client.&lt;br /&gt;one way to fix it is by resetting the alt key in the host file to super(windows) key.&lt;br /&gt;&lt;br /&gt;Go to windows preferences in setting, and change "movement key" from "alt" to "Super"&lt;br /&gt;&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/163272026812479139-866056830026369898?l=mercstudio-tech.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mercstudio-tech.blogspot.com/feeds/866056830026369898/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=163272026812479139&amp;postID=866056830026369898' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/163272026812479139/posts/default/866056830026369898'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/163272026812479139/posts/default/866056830026369898'/><link rel='alternate' type='text/html' href='http://mercstudio-tech.blogspot.com/2011/10/ubuntu-virtualbox-altclick.html' title='ubuntu virtualbox alt+click'/><author><name>James Tt</name><uri>https://profiles.google.com/103231744852638250560</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh3.googleusercontent.com/-S2vhoFMo-OY/AAAAAAAAAAI/AAAAAAAAAAA/Y8VfyxcHirI/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-163272026812479139.post-7710400903027699647</id><published>2011-10-19T20:15:00.000-07:00</published><updated>2011-10-19T20:16:30.443-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='linux'/><category scheme='http://www.blogger.com/atom/ns#' term='samba'/><title type='text'>samba sharing on linux</title><content type='html'>After several frustration to get sharing working from linux,&lt;br /&gt;finally found the root of the problem.&lt;br /&gt;&lt;br /&gt;It is often that ubuntu / linux seems to add invalid charactor to the sharing name.&lt;br /&gt;The solution is to remove them.&lt;br /&gt;&lt;br /&gt;Exampke: user-intel (Linux mint)&lt;br /&gt;Change to userintel&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/163272026812479139-7710400903027699647?l=mercstudio-tech.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mercstudio-tech.blogspot.com/feeds/7710400903027699647/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=163272026812479139&amp;postID=7710400903027699647' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/163272026812479139/posts/default/7710400903027699647'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/163272026812479139/posts/default/7710400903027699647'/><link rel='alternate' type='text/html' href='http://mercstudio-tech.blogspot.com/2011/10/samba-sharing-on-linux.html' title='samba sharing on linux'/><author><name>James Tt</name><uri>https://profiles.google.com/103231744852638250560</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh3.googleusercontent.com/-S2vhoFMo-OY/AAAAAAAAAAI/AAAAAAAAAAA/Y8VfyxcHirI/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-163272026812479139.post-4565511259642105046</id><published>2011-10-13T05:15:00.001-07:00</published><updated>2011-10-13T05:18:26.392-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='qmail'/><category scheme='http://www.blogger.com/atom/ns#' term='relay'/><title type='text'>Qmail route email to external smtp relay</title><content type='html'>&lt;div&gt;Edit&lt;/div&gt;/var/qmail/control/smtproutes&lt;div&gt;content:&lt;/div&gt;&lt;div&gt;:hostname.com&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Example:&lt;/div&gt;&lt;div&gt;:smtp.tm.net.my&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;References:&lt;/div&gt;&lt;div&gt;&lt;a href="http://wiki.qmailtoaster.com/index.php/Smtproutes"&gt;http://wiki.qmailtoaster.com/index.php/Smtproutes&lt;/a&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/163272026812479139-4565511259642105046?l=mercstudio-tech.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mercstudio-tech.blogspot.com/feeds/4565511259642105046/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=163272026812479139&amp;postID=4565511259642105046' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/163272026812479139/posts/default/4565511259642105046'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/163272026812479139/posts/default/4565511259642105046'/><link rel='alternate' type='text/html' href='http://mercstudio-tech.blogspot.com/2011/10/qmail-route-email-to-external-smtp.html' title='Qmail route email to external smtp relay'/><author><name>James Tt</name><uri>https://profiles.google.com/103231744852638250560</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh3.googleusercontent.com/-S2vhoFMo-OY/AAAAAAAAAAI/AAAAAAAAAAA/Y8VfyxcHirI/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-163272026812479139.post-1253941138087844604</id><published>2011-10-10T22:59:00.000-07:00</published><updated>2011-10-10T23:03:13.182-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='kloxo'/><title type='text'>Kloxo Yum Gave Error... Trying Again</title><content type='html'>If you ever tried to install kloxo, and encounter this error,&lt;div&gt;it might be that you are trying to install kloxo on 64bits system.&lt;/div&gt;&lt;div&gt;Do a uname -m to see if its x86_64 (if yes, then its 64bits).&lt;/div&gt;&lt;div&gt;If its a i686, its not.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;If you encounter that error, its likely that your /etc/php.ini is configured to disallow function "system".&lt;/div&gt;&lt;div&gt;Edit the php.ini and find for all line with:&lt;/div&gt;&lt;div&gt;&lt;meta equiv="content-type" content="text/html; charset=utf-8"&gt;&lt;span class="Apple-style-span" style="color: rgb(17, 17, 17); font-family: Consolas, 'Andale Mono', Monaco, Courier, 'Courier New', Verdana, sans-serif; font-size: 12px; line-height: 18px; background-color: rgb(238, 238, 238); "&gt;disable_functions =exec,passthru,shell_exec,system...&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: rgb(17, 17, 17); font-family: Consolas, 'Andale Mono', Monaco, Courier, 'Courier New', Verdana, sans-serif; font-size: 12px; line-height: 18px; background-color: rgb(238, 238, 238); "&gt;&lt;/span&gt;&lt;/div&gt;&lt;span&gt;&lt;span&gt;and comment it off by adding #&lt;/span&gt;&lt;/span&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: rgb(17, 17, 17); font-family: Consolas, 'Andale Mono', Monaco, Courier, 'Courier New', Verdana, sans-serif; font-size: 12px; line-height: 18px; background-color: rgb(238, 238, 238); "&gt;&lt;span&gt;&lt;span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span&gt;&lt;span&gt;Try to find for more of these line. Sometimes its been set more than once.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span&gt;&lt;span&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/163272026812479139-1253941138087844604?l=mercstudio-tech.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mercstudio-tech.blogspot.com/feeds/1253941138087844604/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=163272026812479139&amp;postID=1253941138087844604' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/163272026812479139/posts/default/1253941138087844604'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/163272026812479139/posts/default/1253941138087844604'/><link rel='alternate' type='text/html' href='http://mercstudio-tech.blogspot.com/2011/10/kloxo-yum-again-error.html' title='Kloxo Yum Gave Error... Trying Again'/><author><name>James Tt</name><uri>https://profiles.google.com/103231744852638250560</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh3.googleusercontent.com/-S2vhoFMo-OY/AAAAAAAAAAI/AAAAAAAAAAA/Y8VfyxcHirI/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-163272026812479139.post-9055563318804044407</id><published>2011-10-04T07:08:00.000-07:00</published><updated>2011-10-04T07:36:30.357-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='mysql'/><title type='text'>MySQL Lock tables and subqueries</title><content type='html'>&lt;div&gt;Example error:&lt;/div&gt;&lt;div&gt;Table 'table' was not locked with LOCK TABLES&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;Example:&lt;div&gt;LOCK TABLES x write, y write;&lt;/div&gt;&lt;div&gt;select * from x; #works&lt;/div&gt;&lt;div&gt;select * from y; #works&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;But:&lt;/div&gt;&lt;div&gt;select *,&lt;/div&gt;&lt;div&gt;(select fieldname from y where fieldcond=x.field2) as yname&lt;/div&gt;&lt;div&gt; from x where field1='xxx'; #failed with&lt;/div&gt;&lt;div&gt;#y tables is not locked&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Solution:&lt;/div&gt;&lt;div&gt;&lt;meta equiv="content-type" content="text/html; charset=utf-8"&gt;LOCK TABLES x write, y write, &lt;b&gt;y as yalias write&lt;/b&gt;;&lt;/div&gt;&lt;div&gt;&lt;meta equiv="content-type" content="text/html; charset=utf-8"&gt;&lt;div&gt;select *,&lt;/div&gt;&lt;div&gt;(select fieldname from y &lt;b&gt;yalias&lt;/b&gt; where fieldcond=x.field2) as yname&lt;/div&gt;&lt;div&gt; from x where field1='xxx'; &lt;/div&gt;&lt;/div&gt;&lt;div&gt;#WORKS!&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/163272026812479139-9055563318804044407?l=mercstudio-tech.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mercstudio-tech.blogspot.com/feeds/9055563318804044407/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=163272026812479139&amp;postID=9055563318804044407' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/163272026812479139/posts/default/9055563318804044407'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/163272026812479139/posts/default/9055563318804044407'/><link rel='alternate' type='text/html' href='http://mercstudio-tech.blogspot.com/2011/10/mysql-lock-tables-and-subqueries.html' title='MySQL Lock tables and subqueries'/><author><name>James Tt</name><uri>https://profiles.google.com/103231744852638250560</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh3.googleusercontent.com/-S2vhoFMo-OY/AAAAAAAAAAI/AAAAAAAAAAA/Y8VfyxcHirI/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-163272026812479139.post-6684475689111842794</id><published>2011-10-04T02:04:00.000-07:00</published><updated>2011-10-04T02:06:47.013-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='linux'/><category scheme='http://www.blogger.com/atom/ns#' term='security'/><title type='text'>Check system file changes from installed package</title><content type='html'>&lt;meta equiv="content-type" content="text/html; charset=utf-8"&gt;&lt;span class="Apple-style-span" style="color: rgb(37, 37, 37); font-family: Verdana, sans-serif; font-size: 12px; line-height: 18px; "&gt;&lt;p style="margin-top: 0px; margin-right: 0px; margin-bottom: 15px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; font-weight: inherit; font-style: inherit; font-size: 12px; font-family: inherit; vertical-align: baseline; "&gt;On redhat based system:&lt;/p&gt;&lt;p style="margin-top: 0px; margin-right: 0px; margin-bottom: 15px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; font-weight: inherit; font-style: inherit; font-size: 12px; font-family: inherit; vertical-align: baseline; "&gt;&lt;code style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; font-weight: inherit; font-style: inherit; font-size: 12px; font-family: inherit; vertical-align: baseline; font: normal normal normal 1em/normal 'andale mono', 'lucida console', monospace; "&gt;rpm --verify -all&lt;/code&gt;&lt;/p&gt;&lt;p style="margin-top: 0px; margin-right: 0px; margin-bottom: 15px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; font-weight: inherit; font-style: inherit; font-size: 12px; font-family: inherit; vertical-align: baseline; "&gt;&lt;code style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; font-weight: inherit; font-style: inherit; font-size: 12px; font-family: inherit; vertical-align: baseline; font: normal normal normal 1em/normal 'andale mono', 'lucida console', monospace; "&gt;On Debian based system:&lt;/code&gt;&lt;/p&gt;&lt;p style="margin-top: 0px; margin-right: 0px; margin-bottom: 15px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; font-weight: inherit; font-style: inherit; font-size: 12px; font-family: inherit; vertical-align: baseline; "&gt;&lt;code style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; font-weight: inherit; font-style: inherit; font-size: 12px; font-family: inherit; vertical-align: baseline; font: normal normal normal 1em/normal 'andale mono', 'lucida console', monospace; "&gt;dpkg -l \*|while read s n rest; do if [ "$s" == "ii" ]; then echo $n;&lt;br /&gt;fi; done &amp;gt; ~/tmp.txt&lt;br /&gt;for f in `cat ~/tmp.txt`; do debsums -s -a $f; done&lt;/code&gt;&lt;/p&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/163272026812479139-6684475689111842794?l=mercstudio-tech.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mercstudio-tech.blogspot.com/feeds/6684475689111842794/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=163272026812479139&amp;postID=6684475689111842794' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/163272026812479139/posts/default/6684475689111842794'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/163272026812479139/posts/default/6684475689111842794'/><link rel='alternate' type='text/html' href='http://mercstudio-tech.blogspot.com/2011/10/check-system-file-changes-from.html' title='Check system file changes from installed package'/><author><name>James Tt</name><uri>https://profiles.google.com/103231744852638250560</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh3.googleusercontent.com/-S2vhoFMo-OY/AAAAAAAAAAI/AAAAAAAAAAA/Y8VfyxcHirI/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-163272026812479139.post-5494230220324602381</id><published>2011-10-03T02:51:00.000-07:00</published><updated>2011-10-03T03:03:06.441-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='mysql'/><title type='text'>select a field by first row via left join</title><content type='html'>There are times when we need to select first record of a table in a join tables.&lt;div&gt;Problem with mysql is that after joining tables together, there will be no indexing,&lt;/div&gt;&lt;div&gt;making query extremely slow.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;First, makesure all inner join uses on query to limit the records instead of where condition.&lt;/div&gt;&lt;div&gt;This way, the record is filtered based on table indexes (make sure you index'em first) in the joining process.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;2nd, to only populate a field by first row which matches the criteria, do a left join&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;select x.field1, x.field2 from table1 x inner join table2 x2 on x.field3=x2.field2&lt;/div&gt;&lt;div&gt;left join table2 x3 on x2.field1=x3.field1 and x3.fields=[some condition to filter to first row]&lt;/div&gt;&lt;div&gt;group by ...&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/163272026812479139-5494230220324602381?l=mercstudio-tech.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mercstudio-tech.blogspot.com/feeds/5494230220324602381/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=163272026812479139&amp;postID=5494230220324602381' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/163272026812479139/posts/default/5494230220324602381'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/163272026812479139/posts/default/5494230220324602381'/><link rel='alternate' type='text/html' href='http://mercstudio-tech.blogspot.com/2011/10/select-field-by-first-row-via-left-join.html' title='select a field by first row via left join'/><author><name>James Tt</name><uri>https://profiles.google.com/103231744852638250560</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh3.googleusercontent.com/-S2vhoFMo-OY/AAAAAAAAAAI/AAAAAAAAAAA/Y8VfyxcHirI/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-163272026812479139.post-225352483691943628</id><published>2011-10-03T01:37:00.001-07:00</published><updated>2011-10-03T01:39:20.545-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='kloxo'/><category scheme='http://www.blogger.com/atom/ns#' term='roundcube'/><title type='text'>Roundcube Error 500</title><content type='html'>It seems that kloxo always have issue updating roundcube.&lt;div&gt;Most of the time, the webmail is updated, but the database is not.&lt;/div&gt;&lt;div&gt;to fix it:&lt;/div&gt;&lt;div&gt;mysql -u root -p roundcubemail&lt;/div&gt;&lt;div&gt;source /home/kloxo/httpd/webmail/roundcube/SQL/mysql.update.sql&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/163272026812479139-225352483691943628?l=mercstudio-tech.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mercstudio-tech.blogspot.com/feeds/225352483691943628/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=163272026812479139&amp;postID=225352483691943628' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/163272026812479139/posts/default/225352483691943628'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/163272026812479139/posts/default/225352483691943628'/><link rel='alternate' type='text/html' href='http://mercstudio-tech.blogspot.com/2011/10/roundcube-error-500.html' title='Roundcube Error 500'/><author><name>James Tt</name><uri>https://profiles.google.com/103231744852638250560</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh3.googleusercontent.com/-S2vhoFMo-OY/AAAAAAAAAAI/AAAAAAAAAAA/Y8VfyxcHirI/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-163272026812479139.post-8869823770425625100</id><published>2011-09-28T21:56:00.000-07:00</published><updated>2011-09-28T22:04:39.935-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='utf8'/><category scheme='http://www.blogger.com/atom/ns#' term='mysql'/><category scheme='http://www.blogger.com/atom/ns#' term='php'/><title type='text'>MySQL data contains chinese charactor become äöüßæåéé</title><content type='html'>It took me hours figuring this.&lt;div&gt;All my mysql data became symbols.&lt;/div&gt;&lt;div&gt;Then finally, i found the culprit.&lt;/div&gt;&lt;div&gt;1st, i converted my field and default charset of my table to unicode.&lt;/div&gt;&lt;div&gt;But i did not update the existing data to unicode. So it was my mistake.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;2nd, in php, i changed my mysql_set_charset("UTF-8");&lt;/div&gt;&lt;div&gt;So now all the data from the table which contains original latin will be forced to utf-8.&lt;/div&gt;&lt;div&gt;So the symbol appear in my html output, so does phpmyadmin.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;To fix this, i wrote a program to retrieve the data from latin charset, and&lt;/div&gt;&lt;div&gt;then output it as a code in array to replace the data later back to the database as utf-8.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Example:&lt;/div&gt;&lt;div&gt;mysql_set_charset("latin1", $conndb);&lt;/div&gt;&lt;div&gt;mysql_query("select ...");&lt;/div&gt;&lt;div&gt;$aData = mysql_fetch_assoc($query);&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;meta equiv="content-type" content="text/html; charset=utf-8"&gt;mysql_set_charset("utf-8", $conndb);&lt;/div&gt;&lt;div&gt;$aData["fieldname"] = utf8_encode($aData["fieldname"]);&lt;/div&gt;&lt;div&gt;//then update those record with newly encoded utf8&lt;/div&gt;&lt;div&gt;mysql_query("update table ... ");&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;so, the next time we query the database, ensure to use &lt;/div&gt;&lt;div&gt;&lt;meta equiv="content-type" content="text/html; charset=utf-8"&gt;mysql_set_charset("utf-8", $conndb);&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/163272026812479139-8869823770425625100?l=mercstudio-tech.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mercstudio-tech.blogspot.com/feeds/8869823770425625100/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=163272026812479139&amp;postID=8869823770425625100' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/163272026812479139/posts/default/8869823770425625100'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/163272026812479139/posts/default/8869823770425625100'/><link rel='alternate' type='text/html' href='http://mercstudio-tech.blogspot.com/2011/09/mysql-chinese-charactor-become-aouaee.html' title='MySQL data contains chinese charactor become äöüßæåéé'/><author><name>James Tt</name><uri>https://profiles.google.com/103231744852638250560</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh3.googleusercontent.com/-S2vhoFMo-OY/AAAAAAAAAAI/AAAAAAAAAAA/Y8VfyxcHirI/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-163272026812479139.post-9151612370269400369</id><published>2011-09-21T19:34:00.000-07:00</published><updated>2011-09-21T19:36:08.971-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='utf8'/><category scheme='http://www.blogger.com/atom/ns#' term='json'/><category scheme='http://www.blogger.com/atom/ns#' term='php'/><title type='text'>utf encoding and json</title><content type='html'>If someone tell you that json doesnt work with utf8, they are wrong.&lt;div&gt;It does support utf8.&lt;/div&gt;&lt;div&gt;The main problem is the database side.&lt;/div&gt;&lt;div&gt;Ensure to set encoding of mysql connection charset to utf8 to have it working properly.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;mysql_set_charset("utf8", $conn);//support for unicode&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/163272026812479139-9151612370269400369?l=mercstudio-tech.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mercstudio-tech.blogspot.com/feeds/9151612370269400369/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=163272026812479139&amp;postID=9151612370269400369' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/163272026812479139/posts/default/9151612370269400369'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/163272026812479139/posts/default/9151612370269400369'/><link rel='alternate' type='text/html' href='http://mercstudio-tech.blogspot.com/2011/09/utf-encoding-and-json.html' title='utf encoding and json'/><author><name>James Tt</name><uri>https://profiles.google.com/103231744852638250560</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh3.googleusercontent.com/-S2vhoFMo-OY/AAAAAAAAAAI/AAAAAAAAAAA/Y8VfyxcHirI/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-163272026812479139.post-1672028870603421423</id><published>2011-09-06T23:32:00.000-07:00</published><updated>2011-09-07T22:58:33.270-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='block ip'/><category scheme='http://www.blogger.com/atom/ns#' term='dos'/><category scheme='http://www.blogger.com/atom/ns#' term='iptables'/><title type='text'>Banning ip from DOS</title><content type='html'>After surfing around, ive found some very handy commands to handle blocking of ips&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;#to list all ip and # of connections&lt;/div&gt;&lt;div&gt;sudo netstat -plan|grep :80|awk {'print $5'}|cut -d: -f 1|sort|uniq -c|sort -n&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;#to block a specific ip&lt;/div&gt;&lt;div&gt;sudo iptables -I INPUT 1 -s xx.xx.xx.xx -j DROP&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;#to block a class B ip&lt;/div&gt;&lt;div&gt;sudo iptables -I INPUT 1 -s xx.xx.0.0/16 -j DROP&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;meta equiv="content-type" content="text/html; charset=utf-8"&gt;&lt;div&gt;#to block a class C ip&lt;/div&gt;&lt;div&gt;sudo iptables -I INPUT 1 -s xx.xx.xx.0/24 -j DROP&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;meta equiv="content-type" content="text/html; charset=utf-8"&gt;&lt;div&gt;#to block a class A ip&lt;/div&gt;&lt;div&gt;sudo iptables -I INPUT 1 -s xx.0.0.0/16 -j DROP&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Normally you might want to use Class B block if you want to block entire ip sets from a particular country...&lt;/div&gt;&lt;div&gt;&lt;meta equiv="content-type" content="text/html; charset=utf-8"&gt;*be very careful when blocking class B address, some ip range might be shared among different countries.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;To know which country the ip resides on:&lt;/div&gt;&lt;div&gt;&lt;meta equiv="content-type" content="text/html; charset=utf-8"&gt;&lt;a href="http://ip-to-country.webhosting.info/node/view/36"&gt;http://ip-to-country.webhosting.info/node/view/36&lt;/a&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;To list all the iptables rules for incoming traffic:&lt;/div&gt;&lt;div&gt;sudo iptables -L INPUT -n -v&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;A very good list of cidr ip for each particular country:&lt;/div&gt;&lt;div&gt;&lt;meta equiv="content-type" content="text/html; charset=utf-8"&gt;&lt;a href="http://www.ipdeny.com/ipblocks/"&gt;http://www.ipdeny.com/ipblocks/&lt;/a&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Another way of attack is tcp level flood, aka: SYN FLOOD&lt;/div&gt;&lt;div&gt;&lt;div&gt;#check tcp on SYN_RECV&lt;/div&gt;&lt;div&gt;sudo netstat -n -p TCP tcp | grep SYN_RECV&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Good article about hardening system:&lt;/div&gt;&lt;div&gt;&lt;meta equiv="content-type" content="text/html; charset=utf-8"&gt;&lt;a href="http://www.symantec.com/connect/articles/hardening-tcpip-stack-syn-attacks" target="_blank"&gt;http://www.symantec.com/connect/articles/hardening-tcpip-stack-syn-attacks&lt;/a&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;#Very handy command to limit # of connections to a specific port from an ip&lt;/div&gt;&lt;div&gt;sudo iptables -A INPUT -p tcp --syn --dport 80 -m connlimit --connlimit-above 20 -j REJECT --reject-with tcp-reset&lt;/div&gt;&lt;div&gt;sudo iptables -A INPUT -p tcp --syn --dport 110 -m connlimit --connlimit-above 10 -j REJECT --reject-with tcp-reset&lt;/div&gt;&lt;div&gt;sudo iptables -A INPUT -p tcp --syn --dport 25 -m connlimit --connlimit-above 10 -j REJECT --reject-with tcp-reset&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;#To remove a rule (example):&lt;/div&gt;&lt;div&gt;sudo iptables -D INPUT -p tcp --syn --dport 80 -m connlimit --connlimit-above 20 -j REJECT --reject-with tcp-reset&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;meta equiv="content-type" content="text/html; charset=utf-8"&gt;&lt;div&gt;#To save it:&lt;/div&gt;&lt;div&gt;sudo service iptables save&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: rgb(51, 51, 51); font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px; "&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;meta equiv="content-type" content="text/html; charset=utf-8"&gt;&lt;a href="http://www.cyberciti.biz/faq/iptables-connection-limits-howto/" target="_blank"&gt;http://www.cyberciti.biz/faq/iptables-connection-limits-howto/&lt;/a&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Hope this help :)&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/163272026812479139-1672028870603421423?l=mercstudio-tech.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mercstudio-tech.blogspot.com/feeds/1672028870603421423/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=163272026812479139&amp;postID=1672028870603421423' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/163272026812479139/posts/default/1672028870603421423'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/163272026812479139/posts/default/1672028870603421423'/><link rel='alternate' type='text/html' href='http://mercstudio-tech.blogspot.com/2011/09/banning-ip-from-dos.html' title='Banning ip from DOS'/><author><name>James Tt</name><uri>https://profiles.google.com/103231744852638250560</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh3.googleusercontent.com/-S2vhoFMo-OY/AAAAAAAAAAI/AAAAAAAAAAA/Y8VfyxcHirI/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-163272026812479139.post-3895504839568412644</id><published>2011-08-29T02:06:00.001-07:00</published><updated>2011-08-29T02:08:16.011-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='flowplayer'/><title type='text'>flowplayer error 2036</title><content type='html'>Took me hours figuring this out, &lt;div&gt;and finally found a post on the same error.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;First, makesure the control swf is located in the same root as flowplayer swf.&lt;/div&gt;&lt;div&gt;Example: flowplayer.controls-3.2.5.swf and flowplayer-3.2.7.swf in the same folder.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;then, makesure your &lt;object code="" has="" a="" b=""&gt;unique id.&lt;div&gt;Example: &lt;object b=""&gt;id="myflowplayer" ...&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;This shall works fine :)&lt;/div&gt;&lt;/object&gt;&lt;/div&gt;&lt;/object&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/163272026812479139-3895504839568412644?l=mercstudio-tech.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mercstudio-tech.blogspot.com/feeds/3895504839568412644/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=163272026812479139&amp;postID=3895504839568412644' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/163272026812479139/posts/default/3895504839568412644'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/163272026812479139/posts/default/3895504839568412644'/><link rel='alternate' type='text/html' href='http://mercstudio-tech.blogspot.com/2011/08/flowplayer-error-2036.html' title='flowplayer error 2036'/><author><name>James Tt</name><uri>https://profiles.google.com/103231744852638250560</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh3.googleusercontent.com/-S2vhoFMo-OY/AAAAAAAAAAI/AAAAAAAAAAA/Y8VfyxcHirI/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-163272026812479139.post-71669855936128387</id><published>2011-08-23T02:55:00.001-07:00</published><updated>2011-08-23T03:00:19.086-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='kloxo'/><title type='text'>Kloxo /script empty!</title><content type='html'>&lt;span class="Apple-style-span"&gt;For some freaking vps problem, i was facing very slow processing with vps from ds.my as usual.&lt;/span&gt;&lt;div&gt;&lt;span class="Apple-style-span"&gt;running /script/upcp seems to somehow run halfway and hang...&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"&gt;So i decided to stop it, and realize, the entire folder /script is empty!...&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"&gt;To fix it:&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;meta equiv="content-type" content="text/html; charset=utf-8"&gt;&lt;span class="Apple-style-span" style="white-space: pre; background-color: rgb(250, 250, 250); "&gt;&lt;pre style="white-space: pre-wrap; "&gt;&lt;/pre&gt;&lt;span&gt;&lt;span&gt;cd /usr/local/lxlabs/kloxo/httpdocs&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="white-space: pre; background-color: rgb(250, 250, 250); "&gt;&lt;span&gt;&lt;span&gt;sudo &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="white-space: pre; "&gt;lphp.exe ../bin/update.php&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="white-space: pre; "&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="white-space: pre; "&gt;And wait for it to complete.. duh...&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="white-space: pre; background-color: rgb(250, 250, 250); "&gt;&lt;pre style="white-space: pre-wrap; "&gt;&lt;/pre&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/163272026812479139-71669855936128387?l=mercstudio-tech.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mercstudio-tech.blogspot.com/feeds/71669855936128387/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=163272026812479139&amp;postID=71669855936128387' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/163272026812479139/posts/default/71669855936128387'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/163272026812479139/posts/default/71669855936128387'/><link rel='alternate' type='text/html' href='http://mercstudio-tech.blogspot.com/2011/08/kloxo-scripts-empty.html' title='Kloxo /script empty!'/><author><name>James Tt</name><uri>https://profiles.google.com/103231744852638250560</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh3.googleusercontent.com/-S2vhoFMo-OY/AAAAAAAAAAI/AAAAAAAAAAA/Y8VfyxcHirI/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-163272026812479139.post-4140908421672822274</id><published>2011-08-20T20:19:00.000-07:00</published><updated>2011-11-05T05:33:35.340-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='utf8'/><category scheme='http://www.blogger.com/atom/ns#' term='cms'/><category scheme='http://www.blogger.com/atom/ns#' term='modx'/><title type='text'>MODx Revolution and UTF8</title><content type='html'>If you ever need to insert in latin symbol or unicode into modx title or content...&lt;br /&gt;&lt;div&gt;Modify modx_site_content fields:&lt;/div&gt;&lt;div&gt;+ pagetitle, longtitle, description, introtext, content&lt;/div&gt;&lt;div&gt;to unicode_general_ci encoding.&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"&gt;(Note: This is a fulltext index, so you will have to execute 1 statement to alter all 5 fields)&lt;/span&gt;&lt;/div&gt;&lt;div&gt;And also modify template variable content:&lt;br /&gt;ALTER TABLE &amp;nbsp;`modx_site_tmplvar_contentvalues` CHANGE &amp;nbsp;`value` &amp;nbsp;`value` TEXT CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Next, modify core/config/config.inc.php and change the line:&lt;/div&gt;&lt;div&gt;+ $database_connection_charset = '&lt;b&gt;utf8&lt;/b&gt;';&lt;/div&gt;&lt;div&gt;+ $database_dsn = 'mysql:host=...;dbname=...;charset=&lt;b&gt;utf8&lt;/b&gt;';&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;And you may start testing it it works :)&lt;/div&gt;&lt;div&gt;In my setup, its somehow in njis charset... (im not sure why)&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/163272026812479139-4140908421672822274?l=mercstudio-tech.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mercstudio-tech.blogspot.com/feeds/4140908421672822274/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=163272026812479139&amp;postID=4140908421672822274' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/163272026812479139/posts/default/4140908421672822274'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/163272026812479139/posts/default/4140908421672822274'/><link rel='alternate' type='text/html' href='http://mercstudio-tech.blogspot.com/2011/08/modx-revolution-and-utf8.html' title='MODx Revolution and UTF8'/><author><name>James Tt</name><uri>https://profiles.google.com/103231744852638250560</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh3.googleusercontent.com/-S2vhoFMo-OY/AAAAAAAAAAI/AAAAAAAAAAA/Y8VfyxcHirI/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-163272026812479139.post-7655399482670717784</id><published>2011-08-09T08:10:00.000-07:00</published><updated>2011-08-09T08:13:24.083-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='cms'/><category scheme='http://www.blogger.com/atom/ns#' term='modx'/><title type='text'>MODx Revolution Root resource alias / path?</title><content type='html'>I tried google around on this, and find it difficult to find the result.&lt;div&gt;I've found a solution to based my resource alias to the root of the site.&lt;/div&gt;&lt;div&gt;By going to system &amp;gt; settings&lt;/div&gt;&lt;div&gt;use_alias_path : no&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;This will change all your resource alias to be based from root.&lt;/div&gt;&lt;div&gt;Example:&lt;/div&gt;&lt;div&gt;Container1 &amp;gt; My page (resourcealias: mypage)&lt;/div&gt;&lt;div&gt;now become:&lt;/div&gt;&lt;div&gt;http://www.example.com/mypage&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;If you need the container path, just put the full folder path:&lt;/div&gt;&lt;div&gt;Example:&lt;/div&gt;&lt;div&gt;Resource alias: container1/mypage&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/163272026812479139-7655399482670717784?l=mercstudio-tech.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mercstudio-tech.blogspot.com/feeds/7655399482670717784/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=163272026812479139&amp;postID=7655399482670717784' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/163272026812479139/posts/default/7655399482670717784'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/163272026812479139/posts/default/7655399482670717784'/><link rel='alternate' type='text/html' href='http://mercstudio-tech.blogspot.com/2011/08/modx-revolution-root-resource-path.html' title='MODx Revolution Root resource alias / path?'/><author><name>James Tt</name><uri>https://profiles.google.com/103231744852638250560</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh3.googleusercontent.com/-S2vhoFMo-OY/AAAAAAAAAAI/AAAAAAAAAAA/Y8VfyxcHirI/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-163272026812479139.post-1143754824090074754</id><published>2011-08-01T09:11:00.000-07:00</published><updated>2011-08-01T09:12:18.870-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='image'/><category scheme='http://www.blogger.com/atom/ns#' term='pdf'/><title type='text'>convert pdf to image in linux</title><content type='html'>convert -density 150 file.pdf outputname.png&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;-density to set pixel / resolution, the bigger the number, the bigger the image size&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/163272026812479139-1143754824090074754?l=mercstudio-tech.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mercstudio-tech.blogspot.com/feeds/1143754824090074754/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=163272026812479139&amp;postID=1143754824090074754' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/163272026812479139/posts/default/1143754824090074754'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/163272026812479139/posts/default/1143754824090074754'/><link rel='alternate' type='text/html' href='http://mercstudio-tech.blogspot.com/2011/08/convert-pdf-to-image-in-linux.html' title='convert pdf to image in linux'/><author><name>James Tt</name><uri>https://profiles.google.com/103231744852638250560</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh3.googleusercontent.com/-S2vhoFMo-OY/AAAAAAAAAAI/AAAAAAAAAAA/Y8VfyxcHirI/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-163272026812479139.post-8751233926149615054</id><published>2011-07-30T23:09:00.000-07:00</published><updated>2011-07-30T23:15:24.159-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='php'/><title type='text'>php possible datetime gotcha</title><content type='html'>Initially, i thought it was a bug in php...&lt;div&gt;but i think thats how its suppose to work.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;If any month with 31days, and the last month has less days than current date,&lt;/div&gt;&lt;div&gt;the strtotime("-1 month", mktime())&lt;/div&gt;&lt;div&gt;will return this month date, instead of last month.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Example: strtotime("-1 month", strtotime("2011-07-01"))&lt;/div&gt;&lt;div&gt;results: time of 2011-06-01.&lt;/div&gt;&lt;div&gt;But,&lt;/div&gt;&lt;div&gt;Example: strtotime("-1 month", strtotime("2011-07-31"))&lt;/div&gt;&lt;div&gt;results: time of 2011-07-01.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;This is because minus 1 month of 2011-07-31 in math =&amp;gt; 2011-06-31, &lt;/div&gt;&lt;div&gt;which results to 2011-07-01 due to no 31 days in june.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/163272026812479139-8751233926149615054?l=mercstudio-tech.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mercstudio-tech.blogspot.com/feeds/8751233926149615054/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=163272026812479139&amp;postID=8751233926149615054' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/163272026812479139/posts/default/8751233926149615054'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/163272026812479139/posts/default/8751233926149615054'/><link rel='alternate' type='text/html' href='http://mercstudio-tech.blogspot.com/2011/07/php-unotice-gotcha.html' title='php possible datetime gotcha'/><author><name>James Tt</name><uri>https://profiles.google.com/103231744852638250560</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh3.googleusercontent.com/-S2vhoFMo-OY/AAAAAAAAAAI/AAAAAAAAAAA/Y8VfyxcHirI/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-163272026812479139.post-3190115217183096124</id><published>2011-07-27T03:19:00.000-07:00</published><updated>2011-07-27T03:26:02.473-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='cage'/><category scheme='http://www.blogger.com/atom/ns#' term='cassandra'/><category scheme='http://www.blogger.com/atom/ns#' term='zookeeper'/><category scheme='http://www.blogger.com/atom/ns#' term='php'/><title type='text'>Concurrency / Que with clustering</title><content type='html'>I realize a lot of people depends on existing framework or infrastructure to achieve concurrency or Que system to achieve what they need.&lt;div&gt;Basically if one need to get multiple server to be synced for write, and read, its possible to do it manually by coding it with combination of python or php scripts to connect between nodes...&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;But faster way to achieve so is by using open source combination such as zookerper with cassandra and cage.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;But Case have issue when you are using more than 3 nodes.&lt;/div&gt;&lt;div&gt;This issue with zookeeper having to sync all the nodes together to have the transaction to run.&lt;/div&gt;&lt;div&gt;But after reading an article, its nice to have 2 or 3 nodes for transaction of 1 group of zookeeper process and separated zookeeper for read process. But do we need zookeeper for all nodes?&lt;/div&gt;&lt;div&gt;I think its better to have cassandra to sync those data to those server passively instead...&lt;/div&gt;&lt;div&gt;Only maintain between 2-3 nodes for transaction update to ensure uptime.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/163272026812479139-3190115217183096124?l=mercstudio-tech.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mercstudio-tech.blogspot.com/feeds/3190115217183096124/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=163272026812479139&amp;postID=3190115217183096124' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/163272026812479139/posts/default/3190115217183096124'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/163272026812479139/posts/default/3190115217183096124'/><link rel='alternate' type='text/html' href='http://mercstudio-tech.blogspot.com/2011/07/concurrency-que-with-clustering.html' title='Concurrency / Que with clustering'/><author><name>James Tt</name><uri>https://profiles.google.com/103231744852638250560</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh3.googleusercontent.com/-S2vhoFMo-OY/AAAAAAAAAAI/AAAAAAAAAAA/Y8VfyxcHirI/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-163272026812479139.post-1779318396734845144</id><published>2011-07-04T20:21:00.001-07:00</published><updated>2011-07-04T20:22:09.239-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='colorbox'/><category scheme='http://www.blogger.com/atom/ns#' term='jquery'/><category scheme='http://www.blogger.com/atom/ns#' term='ie7'/><title type='text'>jQuery 1.6 buggy on IE 7</title><content type='html'>Ive been trying to figure out why my jquery colorbox seems to make ie 7 browser to hang, &lt;div&gt;and then i realize it wasnt colorbox issue, but jquery 1.6.&lt;/div&gt;&lt;div&gt;jQuery 1.6.1 seems to have fixed it... luckily :)&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/163272026812479139-1779318396734845144?l=mercstudio-tech.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mercstudio-tech.blogspot.com/feeds/1779318396734845144/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=163272026812479139&amp;postID=1779318396734845144' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/163272026812479139/posts/default/1779318396734845144'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/163272026812479139/posts/default/1779318396734845144'/><link rel='alternate' type='text/html' href='http://mercstudio-tech.blogspot.com/2011/07/jquery-16-buggy-on-ie-7.html' title='jQuery 1.6 buggy on IE 7'/><author><name>James Tt</name><uri>https://profiles.google.com/103231744852638250560</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh3.googleusercontent.com/-S2vhoFMo-OY/AAAAAAAAAAI/AAAAAAAAAAA/Y8VfyxcHirI/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-163272026812479139.post-1313462990664419866</id><published>2011-06-30T05:22:00.000-07:00</published><updated>2011-08-27T19:33:15.780-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='regex'/><category scheme='http://www.blogger.com/atom/ns#' term='php'/><title type='text'>PHP regex to match any link on text</title><content type='html'>//1st match subdomain: xyz. OR&lt;br /&gt;// next, match domain&lt;br /&gt;// then match .&lt;br /&gt;// then match dual extension: .com or .org or ...and .sg OR&lt;br /&gt;// then match single extension: TLD: .com or .org or .net or .... OR&lt;br /&gt;// then match single country name .us&lt;br /&gt;// then match uri, example: /xxx&lt;br /&gt;//  also try to match ending /&lt;br /&gt;//  and also try to match with ending name /xxx/lastnamehere&lt;br /&gt;&lt;div&gt;      &lt;/div&gt;&lt;div&gt;&lt;div&gt;$sSubDomainSet = "[^.,\:\+\s]*\."; // xyz.&lt;/div&gt;&lt;div&gt;$sPatSubDomain = "(" . $sSubDomainSet . ")*";&lt;/div&gt;&lt;div&gt;$sPatCountryDomain = "((com|org|net|name|mil|gov|co|info)\.[a-z]{2})";&lt;/div&gt;&lt;div&gt;$sPatTLD = "(com|org|net|name|mil|gov|info)"; //top level domain tld&lt;/div&gt;&lt;div&gt;$sPatCountryTLD = "([a-z]{2})";&lt;/div&gt;&lt;div&gt;$sURIChar = "[a-z0-9\.\?\=\&amp;amp;\(\&amp;amp;amp\;)\-\_\+\%]";&lt;/div&gt;&lt;div&gt;$sPatURI = "([\/]*" . $sURIChar . "*)?";&lt;/div&gt;&lt;div&gt;$sPatURISlash = "([\/])?";&lt;/div&gt;&lt;div&gt;$sPatLastName = "(" . $sURIChar . "*)";&lt;/div&gt;&lt;div&gt;//match last uri name, example domain.com/email/xxx (match xxx)&lt;/div&gt;&lt;div&gt;$sPattern = "/(" . "((http:\/\/)|(https:\/\/))?" . $sPatSubDomain . $sSubDomainSet .  &lt;/div&gt;&lt;div&gt;  "(" . $sPatCountryDomain . "|" . $sPatTLD . "|" . $sPatCountryTLD . ")" . &lt;/div&gt;&lt;div&gt;  $sPatURI . $sPatURISlash . $sPatLastName . &lt;/div&gt;&lt;div&gt;  ")/is";&lt;/div&gt;&lt;/div&gt;&lt;div&gt;preg_match_all($sPattern, $sContent, $matches, PREG_PATTERN_ORDER);&lt;/div&gt;      if (count($matches[1]) &amp;gt; 0) {&lt;br /&gt;$sResult = $matches[1][0];//match first title tag&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;Example Results:&lt;br /&gt;&lt;div&gt;Original: this is a link https://www.yahoo.com/, result: https://www.yahoo.com/&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Original: this is a link https://yahoo.com, result: https://yahoo.com&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Original: this is a link http://yahoo.com, result: http://yahoo.com&lt;br /&gt;&lt;/div&gt;Original: this is a link www.yahoo.com, result: www.yahoo.com&lt;br /&gt;Original: this is a link yahoo.com, result: yahoo.com&lt;br /&gt;Original: this is a link www.yahoo.org, result: www.yahoo.org&lt;br /&gt;Original: this is a link www.whitehouse.gov, result: www.whitehouse.gov&lt;br /&gt;Original: this is a link www.whitehouse.mil, result: www.whitehouse.mil&lt;br /&gt;Original: this is a link www.yahoo.net, result: www.yahoo.net&lt;br /&gt;Original: this is a link yahoo.com.my, result: yahoo.com.my&lt;br /&gt;Original: this is a link yahoo.org.my, result: yahoo.org.my&lt;br /&gt;Original: this is a link yahoo.co.sg, result: yahoo.co.sg&lt;br /&gt;Original: this is a link yahoo.co, result: yahoo.co&lt;br /&gt;Original: this is a link yahoo.my, result: yahoo.my&lt;br /&gt;Original: this is a link yahoo.us, result: yahoo.us&lt;div&gt;Original: this is a link xyz.123.www.yahoo.com, result: xyz.123.www.yahoo.com&lt;br /&gt;Original: this is a link yahoo.com/news is this right?, result: yahoo.com/news&lt;br /&gt;Original: this is a link yahoo.com/ i think so, result: yahoo.com/&lt;br /&gt;Original: this is a link yahoo.com/aboutus.php, result: yahoo.com/aboutus.php&lt;br /&gt;Original: this is a link yahoo.com/email/ maybe its right, result: yahoo.com/email/&lt;br /&gt;Original: this is a link yahoo.com/email/compose,gotta love it, result: yahoo.com/email/compose&lt;br /&gt;Original: this is a link yahoo.COM/email/compose.html?search=233 haha, result: yahoo.COM/email/compose.html?search=233&lt;br /&gt;Original: this is a link yahoo.com/email/compose.html?search=233&amp;amp;xx=22 haha, result: yahoo.com/email/compose.html?search=233&amp;amp;xx=22&lt;br /&gt;Original: this is a link yahoo.com/email/compose.html?search=233&amp;amp;uu=232 hehe, result: yahoo.com/email/compose.html?search=233&amp;amp;uu=232&lt;br /&gt;Original: this is a link yahoo.com/email/compose.html?search=233&amp;amp;xx=2?ehh, result: yahoo.com/email/compose.html?search=233&amp;amp;xx=2?ehh&lt;div&gt;&lt;div&gt;Original: this is a link yahoo.com/email/com-pose.html, result: yahoo.com/email/com-pose.html&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Original: this is a link yahoo.com/email/com-pose_.html?a=1, result: yahoo.com/email/com-pose_.html?a=1&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Original: this is a link yahoo.com/email/com+20%pose.html?a=1, result: yahoo.com/email/com+20%pose.html?a=1&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;div&gt;p/s: yes i know the line with double &lt;b&gt;?&lt;/b&gt; is incorrect, im lazy to write it :)&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Full pattern string:&lt;/div&gt;&lt;div&gt;/(((http:\/\/)|(https:\/\/))?([^.,\:\+\s]*\.)*[^.,\:\+\s]*\.(((com|org|net|name|mil|gov|co|info)\.[a-z]{2})|(com|org|net|name|mil|gov|info)|([a-z]{2}))([\/]*[a-z0-9\.\?\=\&amp;amp;\(\&amp;amp;amp\;)\-\_\+\%]*)?([\/])?([a-z0-9\.\?\=\&amp;amp;\(\&amp;amp;amp\;)\-\_\+\%]*))/is&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;updated aug 28, avoid +,: in name, added http and https support&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/163272026812479139-1313462990664419866?l=mercstudio-tech.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mercstudio-tech.blogspot.com/feeds/1313462990664419866/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=163272026812479139&amp;postID=1313462990664419866' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/163272026812479139/posts/default/1313462990664419866'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/163272026812479139/posts/default/1313462990664419866'/><link rel='alternate' type='text/html' href='http://mercstudio-tech.blogspot.com/2011/06/php-regex-to-match-any-link-on-page.html' title='PHP regex to match any link on text'/><author><name>James Tt</name><uri>https://profiles.google.com/103231744852638250560</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh3.googleusercontent.com/-S2vhoFMo-OY/AAAAAAAAAAI/AAAAAAAAAAA/Y8VfyxcHirI/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-163272026812479139.post-369644729797254522</id><published>2011-06-08T21:17:00.000-07:00</published><updated>2011-06-08T21:23:43.941-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='mint'/><category scheme='http://www.blogger.com/atom/ns#' term='black screen'/><category scheme='http://www.blogger.com/atom/ns#' term='ubuntu'/><title type='text'>Ubuntu 11.04 / Mint 11 black screen or blank screen?</title><content type='html'>It caught me by surprise when i used the nvidia driver with 3d experimental driver.&lt;br /&gt;The problem lies on 2 issue:&lt;br /&gt;1. new kernel mode auto enable high resolution via vga=758, which isnt supported on my asus laptop&lt;br /&gt;2. the xwindows nvidia experimental driver didnt work.&lt;br /&gt;So i got a black screen (not even backlight).&lt;br /&gt;&lt;br /&gt;to fix it....&lt;br /&gt;@ the grup screen, key edit (e) to edit on recovery mode&lt;br /&gt;go to the line /boot linux ... (add "nomodeset" at the end)&lt;br /&gt;&lt;br /&gt;This shall disable high resolution screen for boot up kernel.&lt;br /&gt;in recovery mode, you may reconfigure your graphic to basic graphic,&lt;br /&gt;then relaunch x windows. Inside there, click on additional driver, and disable the experimental driver.&lt;br /&gt;Finally, reboot ;)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/163272026812479139-369644729797254522?l=mercstudio-tech.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mercstudio-tech.blogspot.com/feeds/369644729797254522/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=163272026812479139&amp;postID=369644729797254522' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/163272026812479139/posts/default/369644729797254522'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/163272026812479139/posts/default/369644729797254522'/><link rel='alternate' type='text/html' href='http://mercstudio-tech.blogspot.com/2011/06/ubuntu-1104-black-screen-or-blank.html' title='Ubuntu 11.04 / Mint 11 black screen or blank screen?'/><author><name>James Tt</name><uri>https://profiles.google.com/103231744852638250560</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh3.googleusercontent.com/-S2vhoFMo-OY/AAAAAAAAAAI/AAAAAAAAAAA/Y8VfyxcHirI/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-163272026812479139.post-2628089368881740551</id><published>2011-05-25T07:29:00.000-07:00</published><updated>2011-05-25T07:35:42.030-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='tinymce'/><category scheme='http://www.blogger.com/atom/ns#' term='modx'/><category scheme='http://www.blogger.com/atom/ns#' term='font color'/><category scheme='http://www.blogger.com/atom/ns#' term='table'/><title type='text'>MODx Revo TinyMCE font color, table button</title><content type='html'>Default MODx Revolution TinyMCE doesnt contain font colour or table button.&lt;div&gt;To add font color, go to system : system setting&lt;/div&gt;&lt;div&gt;search for filter: "tiny"&lt;/div&gt;&lt;div&gt;add "forecolor" into tiny.custom_buttons# key.&lt;/div&gt;&lt;div&gt;add "table" into tiny.custom_buttons# key.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;then add "table" into tiny.custom_plugins&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;This shall do a quick fix to have the things you need.&lt;/div&gt;&lt;div&gt;But do look for tiny.css_selectors to do a proper font face and size via classes.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;For other buttons and plugins:&lt;/div&gt;&lt;div&gt;&lt;a href="http://tinymce.moxiecode.com/wiki.php/Buttons/controls"&gt;http://tinymce.moxiecode.com/wiki.php/Buttons/controls&lt;/a&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/163272026812479139-2628089368881740551?l=mercstudio-tech.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mercstudio-tech.blogspot.com/feeds/2628089368881740551/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=163272026812479139&amp;postID=2628089368881740551' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/163272026812479139/posts/default/2628089368881740551'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/163272026812479139/posts/default/2628089368881740551'/><link rel='alternate' type='text/html' href='http://mercstudio-tech.blogspot.com/2011/05/modx-revo-tinymce-font-color-table.html' title='MODx Revo TinyMCE font color, table button'/><author><name>James Tt</name><uri>https://profiles.google.com/103231744852638250560</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh3.googleusercontent.com/-S2vhoFMo-OY/AAAAAAAAAAI/AAAAAAAAAAA/Y8VfyxcHirI/s512-c/photo.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-163272026812479139.post-1996825274881682617</id><published>2011-05-23T21:05:00.000-07:00</published><updated>2011-05-23T21:12:30.939-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='javascript'/><category scheme='http://www.blogger.com/atom/ns#' term='dhtmlx'/><category scheme='http://www.blogger.com/atom/ns#' term='combo'/><title type='text'>dhtmlx combo forceselection</title><content type='html'>Hi found a way to hack on dhtmlx combo to allow forceselection.&lt;div&gt;just add this code after dhtmlxcombo.js&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;dhtmlXCombo.prototype._confirmSelection = function(data,status){&lt;/div&gt;&lt;div&gt;  if(arguments.length==0){&lt;/div&gt;&lt;div&gt;    var z=this.getOptionByLabel(this.DOMelem_input.value);&lt;/div&gt;&lt;div&gt;&lt;b&gt;//&lt;/b&gt;data = z?z.value:this.DOMelem_input.value;&lt;/div&gt;&lt;div&gt;&lt;b&gt;    data = z?z.value:null;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;status = (z==null);&lt;/div&gt;&lt;div&gt;    if (data==this.getActualValue()) return;&lt;/div&gt;&lt;div&gt;  };&lt;/div&gt;&lt;div&gt;this.DOMelem_hidden_input.value=data;&lt;/div&gt;&lt;div&gt;  this.DOMelem_hidden_input2.value = (status?"true":"false");&lt;/div&gt;&lt;div&gt;  this.callEvent("onChange",[]);&lt;/div&gt;&lt;div&gt;  this._activeMode=false;&lt;/div&gt;&lt;div&gt;}&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/163272026812479139-1996825274881682617?l=mercstudio-tech.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mercstudio-tech.blogspot.com/feeds/1996825274881682617/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=163272026812479139&amp;postID=1996825274881682617' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/163272026812479139/posts/default/1996825274881682617'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/163272026812479139/posts/default/1996825274881682617'/><link rel='alternate' type='text/html' href='http://mercstudio-tech.blogspot.com/2011/05/dhtmlx-combo-forceselection.html' title='dhtmlx combo forceselection'/><author><name>James Tt</name><uri>https://profiles.google.com/103231744852638250560</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh3.googleusercontent.com/-S2vhoFMo-OY/AAAAAAAAAAI/AAAAAAAAAAA/Y8VfyxcHirI/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-163272026812479139.post-8006182221799756667</id><published>2011-05-22T01:11:00.000-07:00</published><updated>2011-05-22T01:14:20.140-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='javascript'/><category scheme='http://www.blogger.com/atom/ns#' term='idTabs'/><category scheme='http://www.blogger.com/atom/ns#' term='jquery'/><title type='text'>jQuery idTabs switching tab</title><content type='html'>idTabs contains a bug where you may not program it to switch tab by passing&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;jQuery("#mytab.idTabs").idTabs(0);&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;This is due to the if statement in idTabs function which collect the "selected" class in a tag to determine the active tab.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;the fixed version is available here:&lt;/div&gt;&lt;div&gt;&lt;a href="http://www.mercstudio.net/flexiphp/assets/jquery/jquery.idTabs.js"&gt;http://www.mercstudio.net/flexiphp/assets/jquery/jquery.idTabs.js&lt;/a&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/163272026812479139-8006182221799756667?l=mercstudio-tech.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mercstudio-tech.blogspot.com/feeds/8006182221799756667/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=163272026812479139&amp;postID=8006182221799756667' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/163272026812479139/posts/default/8006182221799756667'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/163272026812479139/posts/default/8006182221799756667'/><link rel='alternate' type='text/html' href='http://mercstudio-tech.blogspot.com/2011/05/jquery-idtabs-switching-tab.html' title='jQuery idTabs switching tab'/><author><name>James Tt</name><uri>https://profiles.google.com/103231744852638250560</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh3.googleusercontent.com/-S2vhoFMo-OY/AAAAAAAAAAI/AAAAAAAAAAA/Y8VfyxcHirI/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-163272026812479139.post-6837421534605128129</id><published>2011-05-20T01:04:00.001-07:00</published><updated>2011-05-20T01:10:46.879-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='css3'/><category scheme='http://www.blogger.com/atom/ns#' term='html5'/><category scheme='http://www.blogger.com/atom/ns#' term='canvas'/><title type='text'>HTML5 framework</title><content type='html'>52 Framework is pretty much a all in one packed framework for any html5 start off.&lt;div&gt;It contains grid with columns CSS, CSS 3 , HTML5, Form CSS, Form Validation and CSS reset.&lt;/div&gt;&lt;div&gt;It also include modernizer to fix up some issue with IE.&lt;/div&gt;&lt;div&gt;&lt;a href="http://www.52framework.com/"&gt;http://www.52framework.com/&lt;/a&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;For those whom need IE canvas on IE 8 or below:&lt;/div&gt;&lt;div&gt;&lt;a href="http://excanvas.sourceforge.net/"&gt;http://excanvas.sourceforge.net/&lt;/a&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/163272026812479139-6837421534605128129?l=mercstudio-tech.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mercstudio-tech.blogspot.com/feeds/6837421534605128129/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=163272026812479139&amp;postID=6837421534605128129' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/163272026812479139/posts/default/6837421534605128129'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/163272026812479139/posts/default/6837421534605128129'/><link rel='alternate' type='text/html' href='http://mercstudio-tech.blogspot.com/2011/05/html5-framework.html' title='HTML5 framework'/><author><name>James Tt</name><uri>https://profiles.google.com/103231744852638250560</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh3.googleusercontent.com/-S2vhoFMo-OY/AAAAAAAAAAI/AAAAAAAAAAA/Y8VfyxcHirI/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-163272026812479139.post-3044765162534809958</id><published>2011-05-08T09:49:00.001-07:00</published><updated>2011-05-08T09:50:52.737-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='javascript'/><title type='text'>div offsetWidth 0?</title><content type='html'>Did you ever encounter offsetWidth returning 0?&lt;div&gt;In my case, it happen when ive a div within a div where it represent a container for a jquery tab.&lt;/div&gt;&lt;div&gt;Somehow, i found out that the offsetWidth return 0 if i did not tab to that tab.&lt;/div&gt;&lt;div&gt;Once ive tab into that tab, the offsetWidth now return the actual width rendered.&lt;/div&gt;&lt;div&gt;Took me some hours to solve this issue...&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/163272026812479139-3044765162534809958?l=mercstudio-tech.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mercstudio-tech.blogspot.com/feeds/3044765162534809958/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=163272026812479139&amp;postID=3044765162534809958' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/163272026812479139/posts/default/3044765162534809958'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/163272026812479139/posts/default/3044765162534809958'/><link rel='alternate' type='text/html' href='http://mercstudio-tech.blogspot.com/2011/05/div-offsetwidth-0.html' title='div offsetWidth 0?'/><author><name>James Tt</name><uri>https://profiles.google.com/103231744852638250560</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh3.googleusercontent.com/-S2vhoFMo-OY/AAAAAAAAAAI/AAAAAAAAAAA/Y8VfyxcHirI/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-163272026812479139.post-3207134511655019736</id><published>2011-05-05T18:31:00.000-07:00</published><updated>2011-05-05T18:37:33.837-07:00</updated><title type='text'>Netbean 7 is out</title><content type='html'>&lt;a href="http://1.bp.blogspot.com/-FeLAEtXT-mk/TcNQ0nEdkBI/AAAAAAAAAPQ/zdR7vrAMr3g/s1600/6771d_NetBeans7.0.png" onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}"&gt;&lt;img style="float:right; margin:0 0 10px 10px;cursor:pointer; cursor:hand;width: 120px; height: 143px;" src="http://1.bp.blogspot.com/-FeLAEtXT-mk/TcNQ0nEdkBI/AAAAAAAAAPQ/zdR7vrAMr3g/s320/6771d_NetBeans7.0.png" border="0" alt="" id="BLOGGER_PHOTO_ID_5603411226150146066" /&gt;&lt;/a&gt;&lt;br /&gt;Hmm i know, im kinda outdated.&lt;div&gt;Recently, due to some problem with netbean, ive decided to check out the latest version.&lt;/div&gt;&lt;div&gt;To my surprise, i was outdated , lol.&lt;/div&gt;&lt;div&gt;My first try on netbean 7 was wonderful :)&lt;/div&gt;&lt;div&gt;Now, the project scanning is less of a nuisance , and lighter processing weight.&lt;/div&gt;&lt;div&gt;I could do my work while the project scanning doing its job, unlike netbean 6.9...&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;And also, great improvement on the version control ui. The new version has git in the plugin repository. It seems like this version control is much faster :).&lt;/div&gt;&lt;div&gt;I still remember, preferring to run git command from console due to the netbean slow scanning speed for version control. But still, console command git is still much faster.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/163272026812479139-3207134511655019736?l=mercstudio-tech.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mercstudio-tech.blogspot.com/feeds/3207134511655019736/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=163272026812479139&amp;postID=3207134511655019736' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/163272026812479139/posts/default/3207134511655019736'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/163272026812479139/posts/default/3207134511655019736'/><link rel='alternate' type='text/html' href='http://mercstudio-tech.blogspot.com/2011/05/netbean-7-is-out.html' title='Netbean 7 is out'/><author><name>James Tt</name><uri>https://profiles.google.com/103231744852638250560</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh3.googleusercontent.com/-S2vhoFMo-OY/AAAAAAAAAAI/AAAAAAAAAAA/Y8VfyxcHirI/s512-c/photo.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/-FeLAEtXT-mk/TcNQ0nEdkBI/AAAAAAAAAPQ/zdR7vrAMr3g/s72-c/6771d_NetBeans7.0.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-163272026812479139.post-6647255729892820122</id><published>2011-05-05T02:56:00.000-07:00</published><updated>2011-05-05T03:23:48.808-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ssh'/><category scheme='http://www.blogger.com/atom/ns#' term='openvz'/><title type='text'>vps ssh not starting after update in openvz</title><content type='html'>if you face this condition, you are almost doomed for reinstall, but wait!&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;updated:&lt;/div&gt;&lt;div&gt;edit /vz/private/[vbox#]/etc/init/ssh.conf,&lt;/div&gt;&lt;div&gt;comment off oom never:&lt;/div&gt;&lt;div&gt;#oom never&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;reboot the vps, it shall work :)&lt;/div&gt;&lt;div&gt;or else, try alternative below:&lt;/div&gt;&lt;div&gt;---------------------&lt;br /&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;there is a way to solve this..&lt;/div&gt;&lt;div&gt;1st, create a file in /etc/init.d/sshstart&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;fill it up with:&lt;/div&gt;&lt;div&gt;sh /etc/init.d/ssh start&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;then run&lt;/div&gt;&lt;div&gt;/sbin/vzctl runscript [vps container #] /vz/private/[vpscontainer#]/etc/init.d/sshstart&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;if you get any error, this might give you lead on how to solve it.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;but as for my condition, i found the problem in the /var/log/daemon.log to refer to:&lt;/div&gt;&lt;div&gt;&lt;div&gt;init: ssh main process (21717) terminated with status 255&lt;/div&gt;&lt;div&gt;Failed to spawn ssh pre-start process: unable to set oom adjustment: Operation not permitted&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Someone suggested that the issue is because the ssh is not launched after network, therefore to fix it, you will need to edit /etc/ssh/sshd_config and enable the line ListenAddress 0.0.0.0&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;But in my case, it didnt work. so ive done a work around to start it via vzctl.&lt;/div&gt;&lt;div&gt;If you dont know your vps container #, its in &lt;/div&gt;&lt;div&gt;ls /vz/private/ &lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;References:&lt;/div&gt;&lt;div&gt;&lt;a href="http://blog.roberthallam.org/2010/06/sshd-not-running-at-startup/"&gt;http://blog.roberthallam.org/2010/06/sshd-not-running-at-startup/&lt;/a&gt;&lt;/div&gt;&lt;div&gt;&lt;a href="https://bugs.launchpad.net/ubuntu/+source/openssh/+bug/707098"&gt;https://bugs.launchpad.net/ubuntu/+source/openssh/+bug/707098&lt;/a&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/163272026812479139-6647255729892820122?l=mercstudio-tech.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mercstudio-tech.blogspot.com/feeds/6647255729892820122/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=163272026812479139&amp;postID=6647255729892820122' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/163272026812479139/posts/default/6647255729892820122'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/163272026812479139/posts/default/6647255729892820122'/><link rel='alternate' type='text/html' href='http://mercstudio-tech.blogspot.com/2011/05/vps-ssh-not-starting-after-update-in.html' title='vps ssh not starting after update in openvz'/><author><name>James Tt</name><uri>https://profiles.google.com/103231744852638250560</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh3.googleusercontent.com/-S2vhoFMo-OY/AAAAAAAAAAI/AAAAAAAAAAA/Y8VfyxcHirI/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-163272026812479139.post-6436717102372719523</id><published>2011-05-05T00:15:00.000-07:00</published><updated>2011-05-05T02:56:53.468-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='openvz'/><category scheme='http://www.blogger.com/atom/ns#' term='vps'/><title type='text'>openvz stop running</title><content type='html'>Sometimes, updating the o/s of the dedicated server with openvz installed, might trigger change of default kernel to boot from.&lt;div&gt;To fix it...&lt;/div&gt;&lt;div&gt;sudo vi /boot/grub/menu.lst&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Change the line to point to the index of the openvz kernel. the starting index will be 0&lt;/div&gt;&lt;div&gt;Example:&lt;/div&gt;&lt;div&gt;&lt;b&gt;default 1&lt;/b&gt;&lt;/div&gt;&lt;div&gt;to:&lt;/div&gt;&lt;div&gt;&lt;b&gt;default 0&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;Userful command:&lt;/div&gt;&lt;div&gt;/usr/sbin/vzlist -a&lt;/div&gt;&lt;div&gt;/usr/sbin/vzctl&lt;/div&gt;&lt;div&gt;uname -a&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/163272026812479139-6436717102372719523?l=mercstudio-tech.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mercstudio-tech.blogspot.com/feeds/6436717102372719523/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=163272026812479139&amp;postID=6436717102372719523' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/163272026812479139/posts/default/6436717102372719523'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/163272026812479139/posts/default/6436717102372719523'/><link rel='alternate' type='text/html' href='http://mercstudio-tech.blogspot.com/2011/05/openvz-stop-running.html' title='openvz stop running'/><author><name>James Tt</name><uri>https://profiles.google.com/103231744852638250560</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh3.googleusercontent.com/-S2vhoFMo-OY/AAAAAAAAAAI/AAAAAAAAAAA/Y8VfyxcHirI/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-163272026812479139.post-247809456740507019</id><published>2011-05-04T20:42:00.000-07:00</published><updated>2011-05-04T20:58:38.735-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='checksum'/><category scheme='http://www.blogger.com/atom/ns#' term='openvz'/><title type='text'>openvz meta data checksum failed</title><content type='html'>&lt;div&gt;&lt;span class="Apple-style-span"  &gt;If you face checksum failed when trying to sudo yum update, try this:&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  &gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  &gt;sudo yum clean all &lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  &gt;sudo yum makecache&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  &gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/163272026812479139-247809456740507019?l=mercstudio-tech.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mercstudio-tech.blogspot.com/feeds/247809456740507019/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=163272026812479139&amp;postID=247809456740507019' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/163272026812479139/posts/default/247809456740507019'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/163272026812479139/posts/default/247809456740507019'/><link rel='alternate' type='text/html' href='http://mercstudio-tech.blogspot.com/2011/05/openvz-meta-data-checksum-failed.html' title='openvz meta data checksum failed'/><author><name>James Tt</name><uri>https://profiles.google.com/103231744852638250560</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh3.googleusercontent.com/-S2vhoFMo-OY/AAAAAAAAAAI/AAAAAAAAAAA/Y8VfyxcHirI/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-163272026812479139.post-5144191489360008964</id><published>2011-05-03T02:59:00.000-07:00</published><updated>2011-05-03T03:01:11.243-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='baseurl'/><category scheme='http://www.blogger.com/atom/ns#' term='ie'/><title type='text'>baseurl for ie7 or ie6</title><content type='html'>BASEURL can be used to set the root path for all image, links and javascript src path within the page.&lt;div&gt;But IE 7 or below seems to have problem if we use baseurl to "/".&lt;/div&gt;&lt;div&gt;Instead, use full url: example: http://www.mydomain.com/&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;But in IE 8 or above, or chrome 11 or firefox 4, its okay.&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/163272026812479139-5144191489360008964?l=mercstudio-tech.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mercstudio-tech.blogspot.com/feeds/5144191489360008964/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=163272026812479139&amp;postID=5144191489360008964' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/163272026812479139/posts/default/5144191489360008964'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/163272026812479139/posts/default/5144191489360008964'/><link rel='alternate' type='text/html' href='http://mercstudio-tech.blogspot.com/2011/05/baseurl-for-ie7-or-ie6.html' title='baseurl for ie7 or ie6'/><author><name>James Tt</name><uri>https://profiles.google.com/103231744852638250560</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh3.googleusercontent.com/-S2vhoFMo-OY/AAAAAAAAAAI/AAAAAAAAAAA/Y8VfyxcHirI/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-163272026812479139.post-2403337796393693761</id><published>2011-04-29T18:42:00.000-07:00</published><updated>2011-04-29T18:45:27.757-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='nmap'/><category scheme='http://www.blogger.com/atom/ns#' term='security'/><title type='text'>security with nmap</title><content type='html'>if you are running a server, or curious about what services is running on your system,&lt;div&gt;you may use nmap to have a port scan on your machine, &lt;/div&gt;&lt;div&gt;and show you some good information about the machine runnning ports, machine o/s and service specific information such as netbios, file sharing server, web server and mail servers..&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Quick start:&lt;/div&gt;&lt;div&gt;nmap -A -T4 [ip/domainname]&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/163272026812479139-2403337796393693761?l=mercstudio-tech.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mercstudio-tech.blogspot.com/feeds/2403337796393693761/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=163272026812479139&amp;postID=2403337796393693761' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/163272026812479139/posts/default/2403337796393693761'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/163272026812479139/posts/default/2403337796393693761'/><link rel='alternate' type='text/html' href='http://mercstudio-tech.blogspot.com/2011/04/security-with-nmap.html' title='security with nmap'/><author><name>James Tt</name><uri>https://profiles.google.com/103231744852638250560</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh3.googleusercontent.com/-S2vhoFMo-OY/AAAAAAAAAAI/AAAAAAAAAAA/Y8VfyxcHirI/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-163272026812479139.post-5764462957413633430</id><published>2011-04-26T22:39:00.000-07:00</published><updated>2011-04-26T22:41:24.701-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='modx'/><title type='text'>MODx Revo unable to login to manager</title><content type='html'>If you try to login to manager screen, but unable to get any error message..&lt;br /&gt;then you are likely to have key in the right password, but it auto redirect you back to manager login screen.&lt;br /&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;This is due to problem with current session.&lt;/div&gt;&lt;div&gt;Just clear the browser cache, and try reload the page and login again.&lt;/div&gt;&lt;div&gt;Hope this helps :)&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/163272026812479139-5764462957413633430?l=mercstudio-tech.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mercstudio-tech.blogspot.com/feeds/5764462957413633430/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=163272026812479139&amp;postID=5764462957413633430' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/163272026812479139/posts/default/5764462957413633430'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/163272026812479139/posts/default/5764462957413633430'/><link rel='alternate' type='text/html' href='http://mercstudio-tech.blogspot.com/2011/04/modx-revo-unable-to-login-to-manager.html' title='MODx Revo unable to login to manager'/><author><name>James Tt</name><uri>https://profiles.google.com/103231744852638250560</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh3.googleusercontent.com/-S2vhoFMo-OY/AAAAAAAAAAI/AAAAAAAAAAA/Y8VfyxcHirI/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-163272026812479139.post-4749373563710945847</id><published>2011-04-26T19:07:00.001-07:00</published><updated>2011-08-23T03:39:24.066-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='kloxo'/><category scheme='http://www.blogger.com/atom/ns#' term='hosting'/><title type='text'>Kloxo Roundcube unable to connect to database</title><content type='html'>Its most likely to occur after an update on kloxo.&lt;br /&gt;To fix it, go to shell:&lt;br /&gt;and sudo /script/fixwebmail&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;sudo chmod 644 /home/kloxo/httpd/webmail/roundcube/config/db.inc.php&lt;/div&gt;&lt;div&gt;sudo chmod 644 /home/kloxo/httpd/webmail/horde/config/conf.php&lt;/div&gt;&lt;br /&gt;then try again, it shall work now...&lt;br /&gt;if not, please try searching their forum&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/163272026812479139-4749373563710945847?l=mercstudio-tech.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mercstudio-tech.blogspot.com/feeds/4749373563710945847/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=163272026812479139&amp;postID=4749373563710945847' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/163272026812479139/posts/default/4749373563710945847'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/163272026812479139/posts/default/4749373563710945847'/><link rel='alternate' type='text/html' href='http://mercstudio-tech.blogspot.com/2011/04/kloxo-roundcube-unable-to-connect-to.html' title='Kloxo Roundcube unable to connect to database'/><author><name>James Tt</name><uri>https://profiles.google.com/103231744852638250560</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh3.googleusercontent.com/-S2vhoFMo-OY/AAAAAAAAAAI/AAAAAAAAAAA/Y8VfyxcHirI/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-163272026812479139.post-2966645680498721430</id><published>2011-04-25T00:23:00.000-07:00</published><updated>2011-04-25T00:34:43.652-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='js'/><category scheme='http://www.blogger.com/atom/ns#' term='jquery'/><title type='text'>jQuery No Conflict</title><content type='html'>&lt;div&gt;jQuery No Conflict need to be positioned after all jquery plugin has been included.&lt;/div&gt;&lt;div&gt;Because some plugin is still using $ in the code, therefore the noconflict will remove $ and only made jQuery or the variable assigned as jQuery function.&lt;/div&gt;&lt;div&gt;If you are mixing with Mootool, you should include jquery, jquery plugins, jquery noconflict, then only moo tool .&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Example:&lt;/div&gt;&lt;div&gt;&lt;div&gt;jquery/jquery-1.5.min.js&lt;/div&gt;&lt;div&gt;jquery/jquery-ui-1.8.9.custom.min.js&lt;/div&gt;&lt;div&gt;jquery/jquery.form.js&lt;/div&gt;&lt;div&gt;jquery/jquery.ui.datetime.min.js&lt;/div&gt;&lt;div&gt;jquery/jquery.noconflict.js"&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Example of jquery.noconflict.js&lt;/div&gt;&lt;div&gt;---------------&lt;/div&gt;&lt;div&gt;$j = jQuery.noConflict();&lt;/div&gt;&lt;div&gt;---------------&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/163272026812479139-2966645680498721430?l=mercstudio-tech.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mercstudio-tech.blogspot.com/feeds/2966645680498721430/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=163272026812479139&amp;postID=2966645680498721430' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/163272026812479139/posts/default/2966645680498721430'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/163272026812479139/posts/default/2966645680498721430'/><link rel='alternate' type='text/html' href='http://mercstudio-tech.blogspot.com/2011/04/jquery-no-conflict.html' title='jQuery No Conflict'/><author><name>James Tt</name><uri>https://profiles.google.com/103231744852638250560</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh3.googleusercontent.com/-S2vhoFMo-OY/AAAAAAAAAAI/AAAAAAAAAAA/Y8VfyxcHirI/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-163272026812479139.post-1002570930933697693</id><published>2011-04-23T21:38:00.000-07:00</published><updated>2011-04-23T21:43:02.715-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='vps'/><title type='text'>VPS hosting: Ping comparisons</title><content type='html'>&lt;div&gt;host:www.g2khosting.com, min:441.092, max:569.35, avg:519.856, loss:0, ip:200.32.8.20, os:darwin&lt;/div&gt;&lt;div&gt;host:www.ihserver.net, min:522.827, max:547.028, avg:534.928, loss:0, ip:200.85.152.197, os:darwin&lt;br /&gt;&lt;/div&gt;&lt;div&gt;host:www.austrosolutions.at, min:254.584, max:354.166, avg:303.693, loss:0, ip:188.40.176.4, os:darwin&lt;br /&gt;&lt;/div&gt;&lt;div&gt;host:www.carrot-server.at, min:296.847, max:367.524, avg:332.37, loss:0, ip:78.47.212.123, os:darwin&lt;br /&gt;&lt;/div&gt;&lt;div&gt;host:kapper.net, min:293.862, max:390.25, avg:332.811, loss:0, ip:62.116.5.4, os:darwin&lt;br /&gt;&lt;/div&gt;&lt;div&gt;host:www.snb.at, min:283.39, max:361.89, avg:320.441, loss:0, ip:78.47.53.147, os:darwin&lt;br /&gt;&lt;/div&gt;&lt;div&gt;host:www.vboxes.net, min:297.108, max:367.966, avg:332.634, loss:0, ip:212.24.124.41, os:darwin&lt;br /&gt;&lt;/div&gt;&lt;div&gt;host:www.globalmedia.com.br, min:377.481, max:456.282, avg:419.154, loss:0, ip:208.43.42.56, os:darwin&lt;br /&gt;&lt;/div&gt;&lt;div&gt;host:www.fcolor.bg, min:321.025, max:399.464, avg:358.438, loss:0, ip:87.119.79.248, os:darwin&lt;br /&gt;&lt;/div&gt;&lt;div&gt;host:www.fitvps.com, min:399.47, max:470.799, avg:435.15, loss:0, ip:217.79.65.94, os:darwin&lt;br /&gt;&lt;/div&gt;&lt;div&gt;host:compevo.com, min:378.025, max:433.338, avg:400.168, loss:0, ip:174.34.156.179, os:darwin&lt;br /&gt;&lt;/div&gt;&lt;div&gt;host:www.delimitervps.com, min:426.986, max:813.309, avg:563.69, loss:0, ip:96.45.186.188, os:darwin&lt;br /&gt;&lt;/div&gt;&lt;div&gt;host:www.letstalkdigital.com, min:, max:, avg:, loss:0, ip:208.73.210.152, os:darwin&lt;br /&gt;&lt;/div&gt;&lt;div&gt;host:secure.media-hosts.com, min:321.619, max:393.599, avg:358.079, loss:0, ip:38.127.71.126, os:darwin&lt;br /&gt;&lt;/div&gt;&lt;div&gt;host:protoserver.com, min:, max:, avg:, loss:0, ip:208.88.184.25, os:darwin&lt;/div&gt;&lt;div&gt;host:www.vistapages.com, min:354.111, max:433.252, avg:393.436, loss:0, ip:208.83.212.226, os:darwin&lt;br /&gt;&lt;/div&gt;&lt;div&gt;host:vpsville.ca, min:368.72, max:447.102, avg:409.805, loss:0, ip:76.74.137.21, os:darwin&lt;br /&gt;&lt;/div&gt;&lt;div&gt;host:www.ultimatehosting.eu, min:409.251, max:479.576, avg:444.724, loss:0, ip:81.91.83.151, os:darwin&lt;br /&gt;&lt;/div&gt;&lt;div&gt;host:www.lws.fr, min:, max:, avg:, loss:0, ip:46.20.166.242, os:darwin&lt;br /&gt;&lt;/div&gt;&lt;div&gt;host:www.1euro-hosting.eu, min:347.067, max:433.18, avg:385.735, loss:0, ip:188.165.85.131, os:darwin&lt;br /&gt;&lt;/div&gt;&lt;div&gt;host:fanaticalvps.com, min:263.228, max:345.555, avg:305.848, loss:0, ip:46.4.26.125, os:darwin&lt;br /&gt;&lt;/div&gt;&lt;div&gt;host:www.ingate.de, min:344.516, max:423.093, avg:383.674, loss:0, ip:80.190.156.11, os:darwin&lt;br /&gt;&lt;/div&gt;&lt;div&gt;host:www.synapseglobal.com, min:398.321, max:469.233, avg:433.949, loss:0, ip:67.215.224.130, os:darwin&lt;br /&gt;&lt;/div&gt;&lt;div&gt;host:www.vStarVPS.com, min:409.115, max:455.56, avg:432.337, loss:0, ip:188.72.238.176, os:darwin&lt;br /&gt;&lt;/div&gt;&lt;div&gt;host:whynotavps.com, min:306.566, max:377.59, avg:338.345, loss:0, ip:91.213.214.152, os:darwin&lt;br /&gt;&lt;/div&gt;&lt;div&gt;host:vps.timway.com, min:93.611, max:113.635, avg:102.98, loss:0, ip:58.64.143.70, os:darwin&lt;br /&gt;&lt;/div&gt;&lt;div&gt;host:www.servers.co.in, min:339.132, max:439.172, avg:390.34, loss:0, ip:74.86.169.206, os:darwin&lt;br /&gt;&lt;/div&gt;&lt;div&gt;host:www.ehost.ir, min:347.298, max:425.692, avg:384.407, loss:0, ip:174.34.242.164, os:darwin&lt;br /&gt;&lt;/div&gt;&lt;div&gt;host:www.altnet.lv, min:342.203, max:420.984, avg:381.367, loss:0, ip:195.3.144.37, os:darwin&lt;br /&gt;&lt;/div&gt;&lt;div&gt;host:www.serveriai.lt, min:344.633, max:429.264, avg:385.151, loss:0, ip:79.98.24.240, os:darwin&lt;br /&gt;&lt;/div&gt;&lt;div&gt;host:www.bakka.my, min:49.773, max:62.386, avg:53.347, loss:0, ip:202.190.85.200, os:darwin&lt;br /&gt;&lt;/div&gt;&lt;div&gt;host:www.cubiex.com, min:53.688, max:93.677, avg:70.92, loss:0, ip:202.190.179.125, os:darwin&lt;br /&gt;&lt;/div&gt;&lt;div&gt;host:www.adk-media.com, min:381.121, max:460.078, avg:418.098, loss:0, ip:174.142.235.21, os:darwin&lt;br /&gt;&lt;/div&gt;&lt;div&gt;host:www.naja7host.com, min:312.96, max:383.181, avg:348.36, loss:0, ip:63.247.87.202, os:darwin&lt;br /&gt;&lt;/div&gt;&lt;div&gt;host:www.belsemtech.com, min:296.357, max:367.045, avg:332.16, loss:0, ip:108.60.194.130, os:darwin&lt;br /&gt;&lt;/div&gt;&lt;div&gt;host:www.avanpad.com, min:, max:, avg:, loss:0, ip:85.17.184.44, os:darwin&lt;br /&gt;&lt;/div&gt;&lt;div&gt;host:www.signet.nl, min:387.523, max:466.574, avg:429.279, loss:0, ip:217.21.253.53, os:darwin&lt;br /&gt;&lt;/div&gt;&lt;div&gt;host:www.touchvps.com, min:354.162, max:433.312, avg:393.548, loss:0, ip:93.186.193.39, os:darwin&lt;br /&gt;&lt;/div&gt;&lt;div&gt;host:www.voipcomplete.com, min:344.056, max:422.711, avg:378.875, loss:0, ip:94.124.56.35, os:darwin&lt;br /&gt;&lt;/div&gt;&lt;div&gt;host:www.efeito.net, min:430.129, max:486.35, avg:454.821, loss:0, ip:77.91.206.141, os:darwin&lt;br /&gt;&lt;/div&gt;&lt;div&gt;host:www.intovps.com, min:409.337, max:479.387, avg:444.625, loss:0, ip:93.113.174.175, os:darwin&lt;br /&gt;&lt;/div&gt;&lt;div&gt;host:www.ename.ro, min:420.336, max:466.842, avg:443.74, loss:0, ip:85.120.61.162, os:darwin&lt;br /&gt;&lt;/div&gt;&lt;div&gt;host:www.ch-center.com, min:298.783, max:367.252, avg:332.505, loss:0, ip:89.41.172.10, os:darwin&lt;br /&gt;&lt;/div&gt;&lt;div&gt;host:linhost.ru, min:375.047, max:477.988, avg:423.077, loss:0, ip:217.112.34.76, os:darwin&lt;br /&gt;&lt;/div&gt;&lt;div&gt;host:hosting.agava.ru, min:306.631, max:378.18, avg:342.663, loss:0, ip:89.108.96.156, os:darwin&lt;br /&gt;&lt;/div&gt;&lt;div&gt;host:vdsplanet.ru, min:, max:, avg:, loss:0, ip:88.198.28.22, os:darwin&lt;br /&gt;&lt;/div&gt;&lt;div&gt;host:www.demos.ru, min:479.105, max:557.768, avg:520.639, loss:0, ip:194.87.0.48, os:darwin&lt;br /&gt;&lt;/div&gt;&lt;div&gt;host:www.net.ru, min:479.356, max:479.356, avg:479.356, loss:0, ip:193.36.35.62, os:darwin&lt;br /&gt;&lt;/div&gt;&lt;div&gt;host:www.heihachi.net, min:, max:, avg:, loss:0, ip:188.190.98.57, os:darwin&lt;br /&gt;&lt;/div&gt;&lt;div&gt;host:conceptlane.com, min:61.978, max:103.334, avg:81.394, loss:0, ip:202.150.222.135, os:darwin&lt;br /&gt;&lt;/div&gt;&lt;div&gt;host:www.secureax.com, min:377.285, max:456.388, avg:418.858, loss:0, ip:207.7.84.199, os:darwin&lt;br /&gt;&lt;/div&gt;&lt;div&gt;host:www.SoftDux.co.za, min:353.665, max:433.24, avg:393.366, loss:0, ip:96.31.66.11, os:darwin&lt;br /&gt;&lt;/div&gt;&lt;div&gt;host:www.clickworks.co.za, min:410.822, max:479.591, avg:445.03, loss:0, ip:196.41.137.6, os:darwin&lt;br /&gt;&lt;/div&gt;&lt;div&gt;host:acon.se, min:307.006, max:377.329, avg:342.659, loss:0, ip:85.194.160.96, os:darwin&lt;br /&gt;&lt;/div&gt;&lt;div&gt;host:www.7x24web.net, min:478.884, max:510.827, avg:494.856, loss:0, ip:64.120.135.178, os:darwin&lt;br /&gt;&lt;/div&gt;&lt;div&gt;host:www.istanbulhost.com, min:408.807, max:479.637, avg:444.658, loss:0, ip:88.255.156.55, os:darwin&lt;br /&gt;&lt;/div&gt;&lt;div&gt;host:www.DubHosting.co.uk, min:354.125, max:433.194, avg:393.505, loss:0, ip:89.21.14.181, os:darwin&lt;br /&gt;&lt;/div&gt;&lt;div&gt;host:www.europhase.net, min:377.346, max:457.126, avg:419.26, loss:0, ip:213.229.64.100, os:darwin&lt;br /&gt;&lt;/div&gt;&lt;div&gt;host:www.infrenion.com., min:337.435, max:445.82, avg:387.064, loss:0, ip:74.86.224.33, os:darwin&lt;br /&gt;&lt;/div&gt;&lt;div&gt;host:www.rshosting.co.uk, min:396.304, max:511.813, avg:461.134, loss:0, ip:94.76.214.5, os:darwin&lt;br /&gt;&lt;/div&gt;&lt;div&gt;host:www.vpsmachine.co.uk, min:377.705, max:559.627, avg:445.838, loss:0, ip:85.159.58.87, os:darwin&lt;br /&gt;&lt;/div&gt;&lt;div&gt;host:www.vt6.co.uk, min:, max:, avg:, loss:0, ip:69.64.147.243, os:darwin&lt;br /&gt;&lt;/div&gt;&lt;div&gt;host:www.webhosting.uk.net, min:409.45, max:479.815, avg:444.687, loss:0, ip:94.76.255.204, os:darwin&lt;br /&gt;&lt;/div&gt;&lt;div&gt;host:www.weycrest.co.uk, min:354.606, max:511.717, avg:419.383, loss:0, ip:78.40.245.178, os:darwin&lt;br /&gt;&lt;/div&gt;&lt;div&gt;host:sysadminman.net, min:409.321, max:479.772, avg:444.625, loss:0, ip:213.5.180.160, os:darwin&lt;br /&gt;&lt;/div&gt;&lt;div&gt;host:www.xilo.net, min:, max:, avg:, loss:0, ip:91.199.78.20, os:darwin&lt;br /&gt;&lt;/div&gt;&lt;div&gt;host:www.zxvps.co.uk, min:355.445, max:457.25, avg:400.024, loss:0, ip:188.165.152.217, os:darwin&lt;br /&gt;&lt;/div&gt;&lt;div&gt;host:www.AceShells.com, min:330.636, max:409.327, avg:367.792, loss:0, ip:82.197.73.170, os:darwin&lt;br /&gt;&lt;/div&gt;&lt;div&gt;host:www.gelihost.com, min:456.233, max:535.526, avg:495.775, loss:0, ip:195.88.242.210, os:darwin&lt;br /&gt;&lt;/div&gt;&lt;div&gt;host:www.hostpro.ua, min:511.757, max:581.668, avg:547.212, loss:0, ip:77.222.131.110, os:darwin&lt;br /&gt;&lt;/div&gt;&lt;div&gt;host:www.a2hosting.com, min:347.299, max:417.442, avg:382.611, loss:0, ip:69.39.89.15, os:darwin&lt;br /&gt;&lt;/div&gt;&lt;div&gt;host:www.alticon.net, min:, max:, avg:, loss:0, ip:205.134.170.234, os:darwin&lt;br /&gt;&lt;/div&gt;&lt;div&gt;host:beyondhosting.net, min:345.465, max:471.01, avg:405.803, loss:0, ip:74.126.89.50, os:darwin&lt;br /&gt;&lt;/div&gt;&lt;div&gt;host:www.bittraffic.com, min:274.893, max:353.686, avg:316.61, loss:0, ip:72.20.21.60, os:darwin&lt;br /&gt;&lt;/div&gt;&lt;div&gt;host:www.buildyourvps.com, min:343.534, max:398.717, avg:369.797, loss:0, ip:199.223.127.213, os:darwin&lt;br /&gt;&lt;/div&gt;&lt;div&gt;host:www.byethost.com, min:348.737, max:506.11, avg:406.469, loss:0, ip:207.182.129.30, os:darwin&lt;br /&gt;&lt;/div&gt;&lt;div&gt;host:www.clubuptime.com, min:367.882, max:549.321, avg:434.936, loss:0, ip:173.192.122.129, os:darwin&lt;br /&gt;&lt;/div&gt;&lt;div&gt;host:www.chhost.net, min:293.882, max:367.044, avg:330.463, loss:0, ip:184.95.45.36, os:darwin&lt;br /&gt;&lt;/div&gt;&lt;div&gt;host:www.cortexnetworks.com, min:300.464, max:370.088, avg:335.336, loss:0, ip:74.124.31.180, os:darwin&lt;br /&gt;&lt;/div&gt;&lt;div&gt;host:www.damnvps.com, min:399.643, max:470.395, avg:431.158, loss:0, ip:78.129.175.165, os:darwin&lt;br /&gt;&lt;/div&gt;&lt;div&gt;host:www.DubHosting.com, min:375.17, max:431.566, avg:401.743, loss:0, ip:89.21.14.181, os:darwin&lt;br /&gt;&lt;/div&gt;&lt;div&gt;host:glesys.se, min:306.859, max:377.384, avg:342.316, loss:0, ip:79.99.6.7, os:darwin&lt;br /&gt;&lt;/div&gt;&lt;div&gt;host:goodealhosting.com, min:367.702, max:399.244, avg:383.473, loss:0, ip:208.89.219.198, os:darwin&lt;br /&gt;&lt;/div&gt;&lt;div&gt;host:www.greengeeksvps.com, min:354.222, max:479.649, avg:419.106, loss:0, ip:69.175.12.59, os:darwin&lt;br /&gt;&lt;/div&gt;&lt;div&gt;host:www.hostmist.com, min:367.826, max:446.683, avg:409.715, loss:0, ip:69.147.224.162, os:darwin&lt;br /&gt;&lt;/div&gt;&lt;div&gt;host:www.hostingrails.com, min:345.08, max:470.029, avg:409.392, loss:0, ip:216.222.204.153, os:darwin&lt;br /&gt;&lt;/div&gt;&lt;div&gt;host:www.joinvps.com, min:314.387, max:409.619, avg:352.352, loss:0, ip:207.99.118.3, os:darwin&lt;br /&gt;&lt;/div&gt;&lt;div&gt;host:www.lovevps.com, min:274.96, max:433.174, avg:342.27, loss:0, ip:199.27.135.78, os:darwin&lt;br /&gt;&lt;/div&gt;&lt;div&gt;host:lylix.net, min:, max:, avg:, loss:0, ip:208.122.45.10, os:darwin&lt;br /&gt;&lt;/div&gt;&lt;div&gt;host:www.micfo.com, min:323.477, max:393.637, avg:358.61, loss:0, ip:72.3.252.40, os:darwin&lt;br /&gt;&lt;/div&gt;&lt;div&gt;host:www.neostreams.info, min:292.389, max:378.157, avg:338.695, loss:0, ip:74.63.117.212, os:darwin&lt;br /&gt;&lt;/div&gt;&lt;div&gt;host:www.theserverexperts.com, min:360.865, max:439.35, avg:397.847, loss:0, ip:75.126.29.93, os:darwin&lt;br /&gt;&lt;/div&gt;&lt;div&gt;host:thenynoc.com, min:, max:, avg:, loss:0, ip:67.202.100.2, os:darwin&lt;br /&gt;&lt;/div&gt;&lt;div&gt;host:railsplayground.com, min:344.937, max:424.042, avg:382.128, loss:0, ip:208.101.3.187, os:darwin&lt;br /&gt;&lt;/div&gt;&lt;div&gt;host:www.ramhost.us, min:353.767, max:432.95, avg:393.25, loss:0, ip:199.21.220.75, os:darwin&lt;br /&gt;&lt;/div&gt;&lt;div&gt;host:www.rokabear.com, min:469.425, max:469.425, avg:469.425, loss:0, ip:199.58.210.4, os:darwin&lt;br /&gt;&lt;/div&gt;&lt;div&gt;host:www.rshosting.com, min:369.25, max:447.413, avg:410.639, loss:0, ip:74.86.125.111, os:darwin&lt;br /&gt;&lt;/div&gt;&lt;div&gt;host:www.servercomplete.com, min:409.18, max:479.607, avg:448.402, loss:0, ip:199.48.167.3, os:darwin&lt;br /&gt;&lt;/div&gt;&lt;div&gt;host:www.servergrove.com, min:329.693, max:408.124, avg:366.692, loss:0, ip:69.195.198.100, os:darwin&lt;br /&gt;&lt;/div&gt;&lt;div&gt;host:www.silverrack.com, min:272.451, max:367.37, avg:319.971, loss:0, ip:208.53.44.217, os:darwin&lt;br /&gt;&lt;/div&gt;&lt;div&gt;host:www.syera.net, min:330.91, max:479.784, avg:393.538, loss:0, ip:76.73.96.130, os:darwin&lt;br /&gt;&lt;/div&gt;&lt;div&gt;host:www.tektonic.net, min:330.785, max:409.41, avg:367.912, loss:0, ip:65.254.45.254, os:darwin&lt;br /&gt;&lt;/div&gt;&lt;div&gt;host:www.tigerservers.com, min:, max:, avg:, loss:0, ip:98.124.198.1, os:darwin&lt;br /&gt;&lt;/div&gt;&lt;div&gt;host:www.tocici.com, min:330.907, max:354.097, avg:342.502, loss:0, ip:199.223.127.213, os:darwin&lt;br /&gt;&lt;/div&gt;&lt;div&gt;host:www.ultravps.com, min:323.595, max:369.873, avg:346.734, loss:0, ip:76.164.236.60, os:darwin&lt;br /&gt;&lt;/div&gt;&lt;div&gt;host:www.Webhost.US.Com, min:355.009, max:433.291, avg:393.725, loss:0, ip:74.86.169.207, os:darwin&lt;br /&gt;&lt;/div&gt;&lt;div&gt;host:unixservice.com, min:432.992, max:513.794, avg:470.522, loss:0, ip:209.177.154.77, os:darwin&lt;br /&gt;&lt;/div&gt;&lt;div&gt;host:vpslink.com, min:, max:, avg:, loss:0, ip:38.113.1.225, os:darwin&lt;br /&gt;&lt;/div&gt;&lt;div&gt;host:www.vpsspeed.com, min:, max:, avg:, loss:0, ip:67.202.100.2, os:darwin&lt;br /&gt;&lt;/div&gt;&lt;div&gt;host:vpsnoc.com, min:332.793, max:433.304, avg:382.322, loss:0, ip:208.110.88.210, os:darwin&lt;br /&gt;&lt;/div&gt;&lt;div&gt;host:www.webappcabaret.com, min:355.903, max:432.526, avg:393.395, loss:0, ip:208.43.117.131, os:darwin&lt;br /&gt;&lt;/div&gt;&lt;div&gt;host:www.zoidial.com, min:307, max:479.822, avg:384.083, loss:0, ip:216.218.235.150, os:darwin&lt;br /&gt;&lt;/div&gt;&lt;div&gt;host:www.shackservers.com, min:, max:, avg:, loss:, ip:, os:&lt;br /&gt;&lt;/div&gt;&lt;div&gt;host:zensix.com, min:353.98, max:479.761, avg:422.337, loss:0, ip:69.197.147.151, os:darwin&lt;br /&gt;&lt;/div&gt;&lt;div&gt;host:pogiweb.com, min:354.152, max:433.369, avg:393.584, loss:0, ip:173.208.148.73, os:darwin&lt;br /&gt;&lt;/div&gt;&lt;div&gt;host:appvz.com, min:276.128, max:355.351, avg:317.931, loss:0, ip:188.40.68.114, os:darwin&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/163272026812479139-1002570930933697693?l=mercstudio-tech.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mercstudio-tech.blogspot.com/feeds/1002570930933697693/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=163272026812479139&amp;postID=1002570930933697693' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/163272026812479139/posts/default/1002570930933697693'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/163272026812479139/posts/default/1002570930933697693'/><link rel='alternate' type='text/html' href='http://mercstudio-tech.blogspot.com/2011/04/vps-hosting-ping-comparisons.html' title='VPS hosting: Ping comparisons'/><author><name>James Tt</name><uri>https://profiles.google.com/103231744852638250560</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh3.googleusercontent.com/-S2vhoFMo-OY/AAAAAAAAAAI/AAAAAAAAAAA/Y8VfyxcHirI/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-163272026812479139.post-3299089761524347719</id><published>2011-04-22T01:13:00.000-07:00</published><updated>2011-04-22T01:19:06.862-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='php'/><title type='text'>PHP Gotcha! Running 2 php process via same Session ID</title><content type='html'>If you came accross requirement to run 2 or more php execution via ajax or cron,&lt;div&gt;with same Session id, you will meet 1 fallback to the 2 process.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;The 2nd php process cannot end until the first process end.&lt;/div&gt;&lt;div&gt;Therefore, if you have a big file uploading on 1 ajax call, and you may call another ajax later,&lt;/div&gt;&lt;div&gt;all your other ajax have to wait for the initial big file uploading to be done before this ajax can fully end.&lt;/div&gt;&lt;div&gt;The 2nd process will execute everything until all register_shutdown_function function is executed, but will not exit until 1st process is done.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;This is logically acceptable as you may not want 1 session changes to mixed up with another session changes between 2 processes.&lt;/div&gt;&lt;div&gt;But hope this will save you some time on it...&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/163272026812479139-3299089761524347719?l=mercstudio-tech.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mercstudio-tech.blogspot.com/feeds/3299089761524347719/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=163272026812479139&amp;postID=3299089761524347719' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/163272026812479139/posts/default/3299089761524347719'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/163272026812479139/posts/default/3299089761524347719'/><link rel='alternate' type='text/html' href='http://mercstudio-tech.blogspot.com/2011/04/php-gotcha-running-2-php-process-via.html' title='PHP Gotcha! Running 2 php process via same Session ID'/><author><name>James Tt</name><uri>https://profiles.google.com/103231744852638250560</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh3.googleusercontent.com/-S2vhoFMo-OY/AAAAAAAAAAI/AAAAAAAAAAA/Y8VfyxcHirI/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-163272026812479139.post-5422907370732145647</id><published>2011-04-15T21:49:00.000-07:00</published><updated>2011-04-15T21:50:43.564-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='mysql'/><category scheme='http://www.blogger.com/atom/ns#' term='php'/><title type='text'>MySQL query gotcha!</title><content type='html'>Example:&lt;br /&gt;SELECT *  FROM `modx_listvalues` WHERE listvalue like '&lt;b&gt;%_&lt;/b&gt;'&lt;br /&gt;&lt;br /&gt;&lt;div&gt;like '%_' will result in having all records selected.&lt;/div&gt;&lt;div&gt;Instead, use this &lt;/div&gt;&lt;div&gt;like '%\_'&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/163272026812479139-5422907370732145647?l=mercstudio-tech.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mercstudio-tech.blogspot.com/feeds/5422907370732145647/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=163272026812479139&amp;postID=5422907370732145647' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/163272026812479139/posts/default/5422907370732145647'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/163272026812479139/posts/default/5422907370732145647'/><link rel='alternate' type='text/html' href='http://mercstudio-tech.blogspot.com/2011/04/mysql-query-gotcha.html' title='MySQL query gotcha!'/><author><name>James Tt</name><uri>https://profiles.google.com/103231744852638250560</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh3.googleusercontent.com/-S2vhoFMo-OY/AAAAAAAAAAI/AAAAAAAAAAA/Y8VfyxcHirI/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-163272026812479139.post-268254212949301673</id><published>2011-04-14T19:58:00.000-07:00</published><updated>2011-04-14T20:06:49.986-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='python'/><category scheme='http://www.blogger.com/atom/ns#' term='php'/><title type='text'>Cron but not frequent enough?</title><content type='html'>If you ever need a on going php process, lets say every 5 or 2 seconds once, you may use python script to do this.&lt;div&gt;Here is an example of a script:&lt;/div&gt;&lt;div&gt;--------------------&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;pre&gt;#!/usr/bin/env python&lt;/div&gt;&lt;div&gt;import thread&lt;/div&gt;&lt;div&gt;import time&lt;/div&gt;&lt;div&gt;import os&lt;/div&gt;&lt;div&gt;import sys&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;sPHPPath = "/usr/bin/php"&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;def myphp1():&lt;/div&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp;while 1:&lt;/div&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;os.system(sPHPPath + " " + sys.path[0] + "/myphp1.php")&lt;/div&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;time.sleep(2)&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;def myphp2():&lt;/div&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp;while 1:&lt;/div&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;os.system(sPHPPath + " " + sys.path[0] + "/myphp2.php")&lt;/div&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;time.sleep(2)&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;if __name__=="__main__":&lt;/div&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp;thread.start_new_thread(myphp1, ())&lt;/div&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp;thread.start_new_thread(myphp2, ())&lt;/div&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp;while 1:&lt;/div&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;time.sleep(60)&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/pre&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/163272026812479139-268254212949301673?l=mercstudio-tech.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mercstudio-tech.blogspot.com/feeds/268254212949301673/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=163272026812479139&amp;postID=268254212949301673' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/163272026812479139/posts/default/268254212949301673'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/163272026812479139/posts/default/268254212949301673'/><link rel='alternate' type='text/html' href='http://mercstudio-tech.blogspot.com/2011/04/cron-but-not-frequent-enough.html' title='Cron but not frequent enough?'/><author><name>James Tt</name><uri>https://profiles.google.com/103231744852638250560</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh3.googleusercontent.com/-S2vhoFMo-OY/AAAAAAAAAAI/AAAAAAAAAAA/Y8VfyxcHirI/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-163272026812479139.post-810982461356546423</id><published>2011-04-11T21:26:00.000-07:00</published><updated>2011-04-11T21:37:29.702-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='php'/><title type='text'>PHPUnit and global variable</title><content type='html'>"PDOException: You cannot serialize or unserialize PDO instances"&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;If you use phpunit and encounter this message above, you are hit by phpunit nature.&lt;/div&gt;&lt;div&gt;PHPUnit by default serialize all object in global.&lt;/div&gt;&lt;div&gt;So if you have a pdo connection as global variable, or as a variable / properties of a global variable, then you will doomed to face this problem.&lt;br /&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Solution:&lt;/div&gt;&lt;/div&gt;&lt;div&gt;If you have a class with a property of type xpdo,&lt;/div&gt;&lt;div&gt;create a function __sleep()&lt;/div&gt;&lt;div&gt;and return variable names in array without the xpdo property:&lt;/div&gt;&lt;div&gt;Example:&lt;/div&gt;&lt;div&gt;&lt;div&gt;public function  __sleep() {&lt;/div&gt;&lt;div&gt;    $aKey = array_keys(get_object_vars($this));&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;    $aResult = array();&lt;/div&gt;&lt;div&gt;    foreach($aKey as $sKey) {&lt;/div&gt;&lt;div&gt;      if ($sKey != "xpdo") $aResult[] = $sKey;&lt;/div&gt;&lt;div&gt;    }&lt;/div&gt;&lt;div&gt;    return $aResult;&lt;/div&gt;&lt;div&gt;  }&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/163272026812479139-810982461356546423?l=mercstudio-tech.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mercstudio-tech.blogspot.com/feeds/810982461356546423/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=163272026812479139&amp;postID=810982461356546423' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/163272026812479139/posts/default/810982461356546423'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/163272026812479139/posts/default/810982461356546423'/><link rel='alternate' type='text/html' href='http://mercstudio-tech.blogspot.com/2011/04/phpunit-and-global-variable.html' title='PHPUnit and global variable'/><author><name>James Tt</name><uri>https://profiles.google.com/103231744852638250560</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh3.googleusercontent.com/-S2vhoFMo-OY/AAAAAAAAAAI/AAAAAAAAAAA/Y8VfyxcHirI/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-163272026812479139.post-1038774702121620975</id><published>2011-04-05T21:38:00.000-07:00</published><updated>2011-04-07T01:51:17.087-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='php'/><title type='text'>php float problem</title><content type='html'>Example:&lt;div&gt;326.3 * 100 =&amp;gt; 32630 (in double, as displayed in echo)&lt;/div&gt;&lt;div&gt;But, when you floor(326.3*100) =&amp;gt; resulted as 32629 (sigh*)&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;The issue is because after multiplying 326.3 by 100, the double is kept as 32629.9999999 instead of 32630.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;But if you floor(32630), as raw integer, you will get 32630.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;To fix this issue, convert the result in string, and floor it.&lt;/div&gt;&lt;div&gt;Example:&lt;/div&gt;&lt;div&gt;$iResult = floor((326.3*100)."");&lt;/div&gt;&lt;div&gt;//resulting: 32630.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/163272026812479139-1038774702121620975?l=mercstudio-tech.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mercstudio-tech.blogspot.com/feeds/1038774702121620975/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=163272026812479139&amp;postID=1038774702121620975' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/163272026812479139/posts/default/1038774702121620975'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/163272026812479139/posts/default/1038774702121620975'/><link rel='alternate' type='text/html' href='http://mercstudio-tech.blogspot.com/2011/04/php-float-problem.html' title='php float problem'/><author><name>James Tt</name><uri>https://profiles.google.com/103231744852638250560</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh3.googleusercontent.com/-S2vhoFMo-OY/AAAAAAAAAAI/AAAAAAAAAAA/Y8VfyxcHirI/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-163272026812479139.post-2581173375892376413</id><published>2011-03-29T20:32:00.001-07:00</published><updated>2011-03-29T20:51:08.009-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='development'/><title type='text'>Development Type</title><content type='html'>&lt;a href="http://4.bp.blogspot.com/-8PZu_Q84xRA/TZKophMdXaI/AAAAAAAAAPI/U5vbdBweFkw/s1600/6a00d834527c1469e200e5517bf4978834-800wi.jpg" onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}"&gt;&lt;img style="float:right; margin:0 0 10px 10px;cursor:pointer; cursor:hand;width: 320px; height: 162px;" src="http://4.bp.blogspot.com/-8PZu_Q84xRA/TZKophMdXaI/AAAAAAAAAPI/U5vbdBweFkw/s320/6a00d834527c1469e200e5517bf4978834-800wi.jpg" border="0" alt="" id="BLOGGER_PHOTO_ID_5589715518758935970" /&gt;&lt;/a&gt;&lt;br /&gt;There are several type of development for each project.&lt;br /&gt;Either its:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;New development&lt;/li&gt;&lt;li&gt;Change Feature&lt;/li&gt;&lt;li&gt;Adding new Feature&lt;/li&gt;&lt;li&gt;or redesign / revamp code&lt;/li&gt;&lt;li&gt;Bug fixing / Code refactoring&lt;/li&gt;&lt;/ul&gt;A lot of people get both "bug fixing" and "revamp code" mixed up. &lt;div&gt;Its unlikely for client (non-programmer) to fully understand the concept behind revamping code,&lt;/div&gt;&lt;div&gt;as in their point of view, its just a piece of program which doesn't work with new business process or doesn't change with new business process.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Out of all 5 different type of tasks, new "development" and "redesign/revamp code" takes the longest time. But this is subjective to either, the code is developed by the same developer, or other developer.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;As known that redesign/revamp code could take as long as new development, its best that every new development should goes with proper planning. Both the client / business development manager must cooperate together to discuss the business flow and future path for the system to be used for. The sole purpose would be meeting business long term goal and objective. Without a proper planning, revamping code could possibly be a better choice in later stage of the development. But, lots of time will be wasted bug fixing existing code / work around to fix issue to suite business where it was not developed for that sole purpose.&lt;/div&gt;&lt;div&gt;But, migration of existing system to a new revamped system will also incur lots of time. Not only that, new code also meant new bugs and the process get all reloaded from the start again.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;To sum it up, developer should take more time to think of long term solution to the client business, while business manager should consider proper plan for the direction of the company along with the system to build.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;By end of the day, both developer and business manager should shake hand and work as a team to make things happen. A little higher price / time spent for a properly planned system save a lot of time along the life of the system.&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/163272026812479139-2581173375892376413?l=mercstudio-tech.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mercstudio-tech.blogspot.com/feeds/2581173375892376413/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=163272026812479139&amp;postID=2581173375892376413' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/163272026812479139/posts/default/2581173375892376413'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/163272026812479139/posts/default/2581173375892376413'/><link rel='alternate' type='text/html' href='http://mercstudio-tech.blogspot.com/2011/03/development-type.html' title='Development Type'/><author><name>James Tt</name><uri>https://profiles.google.com/103231744852638250560</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh3.googleusercontent.com/-S2vhoFMo-OY/AAAAAAAAAAI/AAAAAAAAAAA/Y8VfyxcHirI/s512-c/photo.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/-8PZu_Q84xRA/TZKophMdXaI/AAAAAAAAAPI/U5vbdBweFkw/s72-c/6a00d834527c1469e200e5517bf4978834-800wi.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-163272026812479139.post-3876404876777012683</id><published>2011-03-26T22:40:00.000-07:00</published><updated>2011-03-26T22:46:22.894-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='modx'/><title type='text'>modx-combo cascading selection</title><content type='html'>After spending hours trying to figure this out,&lt;br /&gt;and realized that modx have override most extjs combo with its own data store calling.&lt;br /&gt;&lt;br /&gt;I've finally found a way to do cascading to work.&lt;div&gt;To force it to add the parameter to on call ajax to populate the list,&lt;/div&gt;&lt;div&gt;you will have to add it as baseParams, as the 1st time you select the drop down,&lt;/div&gt;&lt;div&gt;it seems to be doing a auto load.&lt;/div&gt;&lt;div&gt;If you attempt to reload the store without setting baseParams, the first time it got populate, it will be without your additional param.&lt;/div&gt;&lt;div&gt;Example:&lt;/div&gt;&lt;div&gt;Ext.getCmp("state").baseParams.key1 = Ext.getCmp("region").getValue();&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;But this baseParams only work for 1st time call. It wont work when you subsequencely reselect the parent component.&lt;/div&gt;&lt;div&gt;To do that, we will have to use the load.&lt;/div&gt;&lt;div&gt;Ext.getCmp("state").store.reload({&lt;/div&gt;&lt;div&gt;        params: { key1:  Ext.getCmp("region").getValue() }&lt;/div&gt;&lt;div&gt;      });&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;This will solve the cascading selection issue.&lt;/div&gt;&lt;div&gt;For example of complete code:&lt;/div&gt;&lt;div&gt;----------------------------------------------------&lt;/div&gt;&lt;div&gt;lets say we have a region &amp;gt; state &amp;gt; district&lt;br /&gt;&lt;div&gt;&lt;div&gt;Ext.getCmp("region").on("change", function() {&lt;/div&gt;&lt;div&gt;      var oState = Ext.getCmp("state");&lt;/div&gt;&lt;div&gt;      var oDistrict = Ext.getCmp("district");&lt;/div&gt;&lt;div&gt;      &lt;/div&gt;&lt;div&gt;      oState.setDisabled(true);&lt;/div&gt;&lt;div&gt;      oState.setValue('');&lt;/div&gt;&lt;div&gt;      oState.store.removeAll();&lt;/div&gt;&lt;div&gt;      oState.baseParams.key1 = Ext.getCmp("region").getValue();&lt;/div&gt;&lt;div&gt;      oState.store.reload({&lt;/div&gt;&lt;div&gt;        params: { key1:  Ext.getCmp("region").getValue() }&lt;/div&gt;&lt;div&gt;      });&lt;/div&gt;&lt;div&gt;      oState.setDisabled(false);&lt;/div&gt;&lt;div&gt;      &lt;/div&gt;&lt;div&gt;      oDistrict.setDisabled(true);&lt;/div&gt;&lt;div&gt;      oDistrict.setValue('');&lt;/div&gt;&lt;div&gt;      oDistrict.store.removeAll();&lt;/div&gt;&lt;div&gt;      oDistrict.setDisabled(false);&lt;/div&gt;&lt;div&gt;    });&lt;/div&gt;&lt;div&gt;    &lt;/div&gt;&lt;div&gt;    Ext.getCmp("state").on("change", function() {&lt;/div&gt;&lt;div&gt;      var oDistrict = Ext.getCmp("district");&lt;/div&gt;&lt;div&gt;      oDistrict.setDisabled(true);&lt;/div&gt;&lt;div&gt;      oDistrict.setValue('');&lt;/div&gt;&lt;div&gt;      oDistrict.store.removeAll();&lt;/div&gt;&lt;div&gt;      oDistrict.baseParams.key1 = Ext.getCmp("state").getValue();&lt;/div&gt;&lt;div&gt;      oDistrict.store.reload({&lt;/div&gt;&lt;div&gt;        params: { key1:  Ext.getCmp("state").getValue() }&lt;/div&gt;&lt;div&gt;      });&lt;/div&gt;&lt;div&gt;      oDistrict.store.reload();&lt;/div&gt;&lt;div&gt;      oDistrict.setDisabled(false);&lt;/div&gt;&lt;div&gt;    });&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;-------------------------------------&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/163272026812479139-3876404876777012683?l=mercstudio-tech.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mercstudio-tech.blogspot.com/feeds/3876404876777012683/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=163272026812479139&amp;postID=3876404876777012683' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/163272026812479139/posts/default/3876404876777012683'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/163272026812479139/posts/default/3876404876777012683'/><link rel='alternate' type='text/html' href='http://mercstudio-tech.blogspot.com/2011/03/modx-combo-cascading-selection.html' title='modx-combo cascading selection'/><author><name>James Tt</name><uri>https://profiles.google.com/103231744852638250560</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh3.googleusercontent.com/-S2vhoFMo-OY/AAAAAAAAAAI/AAAAAAAAAAA/Y8VfyxcHirI/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-163272026812479139.post-8480575176541867257</id><published>2011-03-17T20:07:00.001-07:00</published><updated>2011-03-17T20:11:18.042-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='php'/><title type='text'>object to array of a class with protected variable</title><content type='html'>Interesting finding for PHP.&lt;br /&gt;By default, if you plan to use get_object_vars to change a class into array, its known that protected and private variable will not be exported to array. Even if you have __sleep method and __get method set to retrieve those variable.&lt;br /&gt;&lt;br /&gt;The solution is to put get_object_vars within a method to return get_object_vars($this);&lt;br /&gt;&lt;br /&gt;----------------&lt;br /&gt;class A {&lt;br /&gt;public $id = 1;&lt;br /&gt;protected $name = "";&lt;br /&gt;&lt;br /&gt;public function __get($name) {&lt;br /&gt;  return $this-&gt;$name;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;public function __sleep() {&lt;br /&gt;  return array("id", "name");&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;public function toArray() {&lt;br /&gt;  return get_object_vars($this);&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;$o = new A();&lt;br /&gt;print_r(get_object_vars($o)); //only public variable exposed&lt;br /&gt;print_r($o-&gt;toArray()); // all variable are exposed&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/163272026812479139-8480575176541867257?l=mercstudio-tech.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mercstudio-tech.blogspot.com/feeds/8480575176541867257/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=163272026812479139&amp;postID=8480575176541867257' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/163272026812479139/posts/default/8480575176541867257'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/163272026812479139/posts/default/8480575176541867257'/><link rel='alternate' type='text/html' href='http://mercstudio-tech.blogspot.com/2011/03/object-to-array-of-class-with-protected.html' title='object to array of a class with protected variable'/><author><name>James Tt</name><uri>https://profiles.google.com/103231744852638250560</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh3.googleusercontent.com/-S2vhoFMo-OY/AAAAAAAAAAI/AAAAAAAAAAA/Y8VfyxcHirI/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-163272026812479139.post-6796112161239752361</id><published>2011-03-08T22:24:00.000-08:00</published><updated>2011-03-08T22:27:09.046-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='site copy'/><category scheme='http://www.blogger.com/atom/ns#' term='github'/><category scheme='http://www.blogger.com/atom/ns#' term='modx'/><title type='text'>Started a project: FlexiSiteCopy</title><content type='html'>&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: helvetica, arial, freesans, clean, sans-serif; font-size: 13px; line-height: 18px; "&gt;&lt;pre style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font: normal normal normal 12px/normal Monaco, 'Courier New', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', monospace; line-height: 1.4em; font-family: 'Bitstream Vera Sans Mono', Courier, monospace; font-size: 11px; color: rgb(68, 68, 68); white-space: pre-wrap; word-wrap: break-word; width: 74em; "&gt;&lt;/pre&gt;&lt;/span&gt;&lt;/div&gt;&lt;span&gt;&lt;span&gt;A general purpose flexible utility to copy database from 1 site to another. Currently tested on MODx 2 and standalone database. Allow modification on data before inserting remote data to local database&lt;/span&gt;&lt;/span&gt;&lt;div&gt;&lt;span&gt;&lt;span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;div&gt;&lt;a href="https://github.com/u007/FlexiSiteCopy"&gt;https://github.com/u007/FlexiSiteCopy&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/163272026812479139-6796112161239752361?l=mercstudio-tech.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mercstudio-tech.blogspot.com/feeds/6796112161239752361/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=163272026812479139&amp;postID=6796112161239752361' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/163272026812479139/posts/default/6796112161239752361'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/163272026812479139/posts/default/6796112161239752361'/><link rel='alternate' type='text/html' href='http://mercstudio-tech.blogspot.com/2011/03/started-github-project-flexisitecopy.html' title='Started a project: FlexiSiteCopy'/><author><name>James Tt</name><uri>https://profiles.google.com/103231744852638250560</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh3.googleusercontent.com/-S2vhoFMo-OY/AAAAAAAAAAI/AAAAAAAAAAA/Y8VfyxcHirI/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-163272026812479139.post-8718282461096381913</id><published>2011-03-08T19:19:00.000-08:00</published><updated>2011-03-08T19:27:26.254-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='smtp'/><category scheme='http://www.blogger.com/atom/ns#' term='relay'/><category scheme='http://www.blogger.com/atom/ns#' term='mail'/><title type='text'>Relaying mail for internal server</title><content type='html'>Having a running staging server would be nice to test application before putting it live.&lt;br /&gt;But since most of us in malaysia is on Streamyx or Unifi, the port25 has been blocked.&lt;br /&gt;&lt;br /&gt;One way to solve it is to ask the smtp server to relay mail to an external mail server.&lt;br /&gt;But will require a valid loginid and password of an email account to do so.&lt;br /&gt;&lt;br /&gt;If you are using sendmail, you may do setup this way:&lt;br /&gt;1. Find “&lt;b&gt;DS&lt;/b&gt;” in /etc/mail/&lt;b&gt;sendmail.cf &lt;/b&gt;and add your mail server name as below: -&lt;br /&gt;DSmail.yourdomain.com&lt;br /&gt;&lt;br /&gt;2. Find “&lt;b&gt;Mrelay&lt;/b&gt;” in /etc/mail/&lt;b&gt;sendmail.cf &lt;/b&gt;and add “587″ to “&lt;b&gt;A=TCP $h&lt;/b&gt;”.&lt;br /&gt;This port represent your external mail smtp port, since port 25 is blocked:&lt;br /&gt;A=TCP $h &lt;b&gt;587&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;3. &lt;b&gt;Add&lt;/b&gt; the following line below in /etc/mail/&lt;b&gt;access&lt;/b&gt; file in one line: -&lt;br /&gt;&lt;br /&gt;AuthInfo:mail.yourdomain.com "U:user@yourdomain.com" "I:user@yourdomain.com" "P:youremailpassword" "R:yourdomain.com" "M:LOGIN PLAIN"&lt;br /&gt;&lt;br /&gt;4. Then, restart your Sendmail service as below: -&lt;br /&gt;&lt;br /&gt;&lt;b&gt;service sendmail restart&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;4. Finally, you can monitor your maillog using the command below: -&lt;br /&gt;&lt;br /&gt;tail -f /var/log/mail.log&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/163272026812479139-8718282461096381913?l=mercstudio-tech.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mercstudio-tech.blogspot.com/feeds/8718282461096381913/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=163272026812479139&amp;postID=8718282461096381913' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/163272026812479139/posts/default/8718282461096381913'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/163272026812479139/posts/default/8718282461096381913'/><link rel='alternate' type='text/html' href='http://mercstudio-tech.blogspot.com/2011/03/relaying-mail-for-internal-server.html' title='Relaying mail for internal server'/><author><name>James Tt</name><uri>https://profiles.google.com/103231744852638250560</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh3.googleusercontent.com/-S2vhoFMo-OY/AAAAAAAAAAI/AAAAAAAAAAA/Y8VfyxcHirI/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-163272026812479139.post-8930255842968657444</id><published>2011-03-08T18:16:00.001-08:00</published><updated>2011-03-08T18:17:36.721-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ie'/><category scheme='http://www.blogger.com/atom/ns#' term='security'/><title type='text'>IE8 bypass self signed ssl</title><content type='html'>* Click on View certificates&lt;br /&gt;* In the Certificate dialog, press Install Certificate&lt;br /&gt;* In the Certificate Import Wizard, click Next&lt;br /&gt;* On page 2 of the wizard, select Place all certificates in the following store and click Browse;&lt;br /&gt;* In the Select Certificate Store dialog, select Trusted Root Certification Authorities, click OK&lt;br /&gt;&lt;br /&gt;* In the wizard, click Next, click Finish&lt;br /&gt;* If a security message pops up, choose Yes&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/163272026812479139-8930255842968657444?l=mercstudio-tech.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mercstudio-tech.blogspot.com/feeds/8930255842968657444/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=163272026812479139&amp;postID=8930255842968657444' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/163272026812479139/posts/default/8930255842968657444'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/163272026812479139/posts/default/8930255842968657444'/><link rel='alternate' type='text/html' href='http://mercstudio-tech.blogspot.com/2011/03/ie8-bypass-self-signed-ssl.html' title='IE8 bypass self signed ssl'/><author><name>James Tt</name><uri>https://profiles.google.com/103231744852638250560</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh3.googleusercontent.com/-S2vhoFMo-OY/AAAAAAAAAAI/AAAAAAAAAAA/Y8VfyxcHirI/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-163272026812479139.post-1232350419244270032</id><published>2011-03-06T22:36:00.001-08:00</published><updated>2011-03-08T18:17:47.722-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='firefox'/><category scheme='http://www.blogger.com/atom/ns#' term='security'/><title type='text'>firefox bypass self signed ssl</title><content type='html'>&lt;span class="Apple-style-span" style="border-collapse: collapse; font-family: arial, sans-serif; font-size: 13px; "&gt;&lt;div&gt;&lt;h2&gt;Bypassing the warning&lt;/h2&gt;&lt;/div&gt;&lt;div&gt;&lt;ol&gt;&lt;li style="margin-left: 15px; "&gt; On the warning page, click &lt;strong&gt;Or you can add an exception...&lt;/strong&gt;.&lt;/li&gt;&lt;li style="margin-left: 15px; "&gt;Click &lt;span&gt;Add Exception...&lt;/span&gt;. The Add Security Exception dialog will appear.&lt;/li&gt;&lt;li style="margin-left: 15px; "&gt;Click &lt;span&gt;Get Certificate&lt;/span&gt;.&lt;/li&gt;&lt;li style="margin-left: 15px; "&gt;Read the text describing the problems with this site.&lt;/li&gt;&lt;li style="margin-left: 15px; "&gt;Click &lt;span&gt;Confirm Security Exception&lt;/span&gt; if you want to trust the site. &lt;/li&gt;&lt;/ol&gt;&lt;/div&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/163272026812479139-1232350419244270032?l=mercstudio-tech.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mercstudio-tech.blogspot.com/feeds/1232350419244270032/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=163272026812479139&amp;postID=1232350419244270032' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/163272026812479139/posts/default/1232350419244270032'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/163272026812479139/posts/default/1232350419244270032'/><link rel='alternate' type='text/html' href='http://mercstudio-tech.blogspot.com/2011/03/firefox-bypass-self-signed-ssl.html' title='firefox bypass self signed ssl'/><author><name>James Tt</name><uri>https://profiles.google.com/103231744852638250560</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh3.googleusercontent.com/-S2vhoFMo-OY/AAAAAAAAAAI/AAAAAAAAAAA/Y8VfyxcHirI/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-163272026812479139.post-4841726648098964885</id><published>2011-02-28T19:54:00.000-08:00</published><updated>2011-02-28T20:28:57.731-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='encryption'/><title type='text'>Gnu PG (gpg) to encrypt .tar.gz</title><content type='html'>I came to realize that its important to encrypt file that we backup.&lt;div&gt;We might never know who is touching on those file on the server,&lt;/div&gt;&lt;div&gt;especially when its publicly available on the internet.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;One way to encrypt the file is with Gnu PG (gpg).&lt;/div&gt;&lt;div&gt;To create your private + public key:&lt;/div&gt;&lt;div&gt;gpg --gen-key&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;After completed the prompt, the keys will be created.&lt;/div&gt;&lt;div&gt;Public key is for you to distribute to others, so that they can encrypt the file specially for you only. Because your public key encrypted file can only be decipher by your "private" key.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;On MAC / Linux, the keys is stored in [home]/.gnupg/*&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;To encrypt a file:&lt;/div&gt;&lt;div&gt;gpg -e [filename]&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;A file by name [filename].gpg will be created with the encrypted data.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;to decrypt the file:&lt;/div&gt;&lt;div&gt;gpg -d -o [filename] [filename].gpg&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;GPG encryption also does compression. Therefore, there is no need to gzip a tar file to use gpg with it. GPG allow console input for encryption. There fore, you may run this:&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: verdana, arial, helvetica; font-size: 13px; -webkit-border-horizontal-spacing: 1px; -webkit-border-vertical-spacing: 1px; "&gt;&lt;span&gt;&lt;span&gt;tar -cp [directory/filename] | gpg -c -o [newfilename].tar.gz.gpg&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: verdana, arial, helvetica; font-size: 13px; -webkit-border-horizontal-spacing: 1px; -webkit-border-vertical-spacing: 1px; "&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;If you are planning to open your encrypted file in another computer, you will need to have the private key on that machine. Todo that:&lt;/div&gt;&lt;div&gt;&lt;div&gt;To export your secret keys, use:&lt;/div&gt;&lt;div&gt;  gpg --export-secret-key -a &gt; secret.key&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;and to import them in the other machine:&lt;/div&gt;&lt;div&gt;  gpg --import secret.key&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Other usage:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;GPG can also be used for mail purpose. But you will need to allow your sender to have your public key, in order to send encrypted email to you.&lt;/div&gt;&lt;div&gt;You may export your key to your sender by running:&lt;/div&gt;&lt;div&gt;gpg --armor --export --output [newfilename].asc "[yourkeyuid]"&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;To get the list of keys available on your machine:&lt;/div&gt;&lt;div&gt;gpg --list-keys&lt;/div&gt;&lt;div&gt;The uid role will be needed for above export.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/163272026812479139-4841726648098964885?l=mercstudio-tech.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mercstudio-tech.blogspot.com/feeds/4841726648098964885/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=163272026812479139&amp;postID=4841726648098964885' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/163272026812479139/posts/default/4841726648098964885'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/163272026812479139/posts/default/4841726648098964885'/><link rel='alternate' type='text/html' href='http://mercstudio-tech.blogspot.com/2011/02/gnu-pg-gpg-to-encrypt-targz.html' title='Gnu PG (gpg) to encrypt .tar.gz'/><author><name>James Tt</name><uri>https://profiles.google.com/103231744852638250560</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh3.googleusercontent.com/-S2vhoFMo-OY/AAAAAAAAAAI/AAAAAAAAAAA/Y8VfyxcHirI/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-163272026812479139.post-9135908940265288070</id><published>2011-02-22T22:51:00.000-08:00</published><updated>2011-02-22T23:03:11.329-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='javascript'/><category scheme='http://www.blogger.com/atom/ns#' term='jquery'/><title type='text'>jQuery datepicker show only month and year</title><content type='html'>This code from: &lt;span class="Apple-style-span" &gt;&lt;a href="http://stackoverflow.com/questions/2208480/jquery-date-picker-to-show-month-year-only"&gt;http://stackoverflow.com/questions/2208480/jquery-date-picker-to-show-month-year-only&lt;/a&gt;&lt;/span&gt;&lt;div&gt;seems to work:&lt;/div&gt;&lt;div&gt;---------------&lt;br /&gt;&lt;div&gt;[script]&lt;/div&gt;&lt;div&gt;$(function() {&lt;/div&gt;&lt;div&gt;    $('.date-picker').datepicker( {&lt;/div&gt;&lt;div&gt;        changeMonth: true,&lt;/div&gt;&lt;div&gt;        changeYear: true,&lt;/div&gt;&lt;div&gt;        showButtonPanel: true,&lt;/div&gt;&lt;div&gt;        dateFormat: 'MM yy',&lt;/div&gt;&lt;div&gt;        onClose: function(dateText, inst) {&lt;/div&gt;&lt;div&gt;            var month = $("#ui-datepicker-div .ui-datepicker-month :selected").val();&lt;/div&gt;&lt;div&gt;            var year = $("#ui-datepicker-div .ui-datepicker-year :selected").val();&lt;/div&gt;&lt;div&gt;            $(this).datepicker('setDate', new Date(year, month, 1));&lt;/div&gt;&lt;div&gt;        }&lt;/div&gt;&lt;div&gt;    });&lt;/div&gt;&lt;div&gt;});&lt;/div&gt;&lt;div&gt;[/script]&lt;/div&gt;&lt;/div&gt;&lt;div&gt;-----------&lt;/div&gt;&lt;div&gt;But the main problem is showing back the month,year in the dialog box.To do that, you will have to modify the jquery.ui.datepicker.js&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;with the code (line #1548, #1549):&lt;/div&gt;&lt;div&gt;----------------&lt;/div&gt;&lt;div&gt;var date = this._daylightSavingAdjust(new Date(year, month - 1,&lt;b&gt; (day &gt;= 1 ? day: 1)&lt;/b&gt;)); &lt;/div&gt;&lt;div&gt;if (date.getFullYear() != year || date.getMonth() + 1 != month || &lt;b&gt;(day &gt; 0 &amp;amp;&amp;amp; date.getDate() != day)&lt;/b&gt;) &lt;/div&gt;&lt;div&gt;----------------&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/163272026812479139-9135908940265288070?l=mercstudio-tech.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mercstudio-tech.blogspot.com/feeds/9135908940265288070/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=163272026812479139&amp;postID=9135908940265288070' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/163272026812479139/posts/default/9135908940265288070'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/163272026812479139/posts/default/9135908940265288070'/><link rel='alternate' type='text/html' href='http://mercstudio-tech.blogspot.com/2011/02/jquery-datepicker-show-only-month-and.html' title='jQuery datepicker show only month and year'/><author><name>James Tt</name><uri>https://profiles.google.com/103231744852638250560</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh3.googleusercontent.com/-S2vhoFMo-OY/AAAAAAAAAAI/AAAAAAAAAAA/Y8VfyxcHirI/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-163272026812479139.post-6632044271882294778</id><published>2011-02-20T23:13:00.001-08:00</published><updated>2011-02-20T23:20:04.738-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='browser'/><title type='text'>Web based application problem</title><content type='html'>One thing the internet should do better is the consistency check of the data retrieved.&lt;br /&gt;I know, there are suppose to be Network level check, but what im focusing on is the streamed/downloaded data.&lt;br /&gt;Is it complete? or is it half way done.&lt;br /&gt;&lt;br /&gt;One good example is downloading a huge file on the internet.&lt;br /&gt;If its a zip file, its easy. Because we can check the zip file crc from the achieve application.&lt;br /&gt;&lt;br /&gt;But isnt this suppose to be a web browser job?&lt;br /&gt;&lt;br /&gt;There have been more and more Ajax base application out there, but yet,&lt;br /&gt;i find that its not consistant in terms of opening the processed ajax output.&lt;br /&gt;There are times when the internet got instable , and the browser thought the process is complete.&lt;br /&gt;There are also time when the browser thought the javascript is downloaded complete, but its not.&lt;br /&gt;This lead to instable output or undesired response from the server.&lt;br /&gt;Most of the time, this could be fixed by refreshing, or clearing the cache and refresh.&lt;br /&gt;But i think its best that there should be some kind of browser parity or consistancy check for completion, or dont render the output and output some kind of error message to the user.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/163272026812479139-6632044271882294778?l=mercstudio-tech.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mercstudio-tech.blogspot.com/feeds/6632044271882294778/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=163272026812479139&amp;postID=6632044271882294778' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/163272026812479139/posts/default/6632044271882294778'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/163272026812479139/posts/default/6632044271882294778'/><link rel='alternate' type='text/html' href='http://mercstudio-tech.blogspot.com/2011/02/web-based-application-problem.html' title='Web based application problem'/><author><name>James Tt</name><uri>https://profiles.google.com/103231744852638250560</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh3.googleusercontent.com/-S2vhoFMo-OY/AAAAAAAAAAI/AAAAAAAAAAA/Y8VfyxcHirI/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-163272026812479139.post-7289279574697753646</id><published>2011-02-06T09:17:00.000-08:00</published><updated>2011-02-06T09:23:26.833-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='php'/><title type='text'>PHP gmtime?</title><content type='html'>I've seen some forum talking about, how nice to have gmtime() function.&lt;div&gt;But according to some post, it seems that time() is already in gmtime.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;But how do we convert a unixtimestamp stored via gmdate("Y-m-d H:i:s") to a offset where its not the server locale timezone?&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Its kind of confusing.&lt;/div&gt;&lt;div&gt;But the trick i used was to add the offset to the timestamp, and check if daylight is in effect.&lt;/div&gt;&lt;div&gt;Example of code:&lt;/div&gt;&lt;div&gt;&lt;div&gt;$gmtime = $oRow["ftime"];&lt;/div&gt;&lt;div&gt;$daylight = date("I", $gmtime);&lt;/div&gt;&lt;div&gt;$iOffsetHour = _user_timezone_offset_here;&lt;/div&gt;&lt;div&gt;if ($daylight){&lt;/div&gt;&lt;div&gt;  if ($iOffsetHour &gt; 0){ $iOffsetHour-=1;  }&lt;/div&gt;&lt;div&gt;  else { $iOffsetHour+=1; }&lt;/div&gt;&lt;div&gt; }&lt;/div&gt;&lt;div&gt; $iLocalTime = $gmtime + (60*60*$iOffsetHour);&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;And to get a quick gmtime():&lt;/div&gt;&lt;div&gt;$gmtime = strtotime(gmdate("Y-m-d H:i:s"));&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;If anyone find this wrong, please correct me.&lt;/div&gt;&lt;div&gt;thank you :)&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/163272026812479139-7289279574697753646?l=mercstudio-tech.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mercstudio-tech.blogspot.com/feeds/7289279574697753646/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=163272026812479139&amp;postID=7289279574697753646' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/163272026812479139/posts/default/7289279574697753646'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/163272026812479139/posts/default/7289279574697753646'/><link rel='alternate' type='text/html' href='http://mercstudio-tech.blogspot.com/2011/02/php-gmtime.html' title='PHP gmtime?'/><author><name>James Tt</name><uri>https://profiles.google.com/103231744852638250560</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh3.googleusercontent.com/-S2vhoFMo-OY/AAAAAAAAAAI/AAAAAAAAAAA/Y8VfyxcHirI/s512-c/photo.jpg'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-163272026812479139.post-4669146898587962056</id><published>2011-02-02T11:51:00.000-08:00</published><updated>2011-02-02T12:32:41.499-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='speed'/><category scheme='http://www.blogger.com/atom/ns#' term='development'/><title type='text'>What may speed up development?</title><content type='html'>&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_GbIP0q627hw/TUm_Ys0p4GI/AAAAAAAAAOc/2ugYEHw6Wyw/s1600/kpi_chart_lines.gif"&gt;&lt;img style="float:right; margin:0 0 10px 10px;cursor:pointer; cursor:hand;width: 320px; height: 290px;" src="http://3.bp.blogspot.com/_GbIP0q627hw/TUm_Ys0p4GI/AAAAAAAAAOc/2ugYEHw6Wyw/s320/kpi_chart_lines.gif" border="0" alt="" id="BLOGGER_PHOTO_ID_5569192845290102882" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;div&gt;Development speed is what most business is looking forward.&lt;/div&gt;&lt;div&gt;As business client expectation changes, business system have to change according to business requirement from time to time.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Most developer seems to forget about maintenance of existing projects. This is also the same case for most project managers and bosses.&lt;/div&gt;&lt;div&gt;And development doesn't just count new projects and add-on features,  but developer should consider detecting "smelly" code and make the code easy to debug.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Unit testing is critical in creating a more stable code. Each time new features is added in, the code shall be tested through series of unit test to ensure existing functionality behave accordingly (as of before add-on or change).&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Every developer should consider easy maintainability of their project.&lt;/div&gt;&lt;div&gt;It shall be easy to backup, easy to restore, easy to detect bugs, easy to read code, easy to detect problems or exception.&lt;/div&gt;&lt;div&gt;All these "easy" doesn't come easy to accomplish.&lt;/div&gt;&lt;div&gt;One may consider doing:&lt;/div&gt;&lt;div&gt;&lt;ul&gt;&lt;li&gt;automated backup of database and site;&lt;/li&gt;&lt;li&gt;write brief and useful comments in code;&lt;/li&gt;&lt;li&gt;separate "god"-like functional code into parts;&lt;/li&gt;&lt;li&gt;write testunit for every functional part of the program;&lt;/li&gt;&lt;li&gt;automate background process to cleanup old or unwanted data like logs;&lt;/li&gt;&lt;li&gt;automate touch and undo unit-test processers;&lt;/li&gt;&lt;li&gt;automate warning message to notify developer of exception and errors;&lt;/li&gt;&lt;/ul&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Here are several things which can be use in most projects:&lt;/div&gt;&lt;div&gt;&lt;ul&gt;&lt;li&gt;TestUnits for:&lt;br /&gt;+ Date and time zone check and notification&lt;br /&gt;+ Environment requirement check&lt;br /&gt;&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Background processors:&lt;br /&gt;+ # of requests check in a minute&lt;br /&gt;+ Logs reports generation&lt;br /&gt;+ Automated remote update&lt;br /&gt;+ Database rows / size check and notification&lt;br /&gt;+ Database integrity check and notification&lt;br /&gt;&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Maintenance utilities:&lt;br /&gt;+ Server-client communication library&lt;br /&gt;+ Site database copy to local machine&lt;br /&gt;+ Online site and users monitoring&lt;br /&gt;+ Site reports: page count, exceptions, logs&lt;br /&gt;+ Site files download, deployment and updating&lt;br /&gt;+ Site version control and remote updates&lt;br /&gt;+ Framework version update check&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/163272026812479139-4669146898587962056?l=mercstudio-tech.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mercstudio-tech.blogspot.com/feeds/4669146898587962056/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=163272026812479139&amp;postID=4669146898587962056' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/163272026812479139/posts/default/4669146898587962056'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/163272026812479139/posts/default/4669146898587962056'/><link rel='alternate' type='text/html' href='http://mercstudio-tech.blogspot.com/2011/02/what-may-speed-up-development.html' title='What may speed up development?'/><author><name>James Tt</name><uri>https://profiles.google.com/103231744852638250560</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh3.googleusercontent.com/-S2vhoFMo-OY/AAAAAAAAAAI/AAAAAAAAAAA/Y8VfyxcHirI/s512-c/photo.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/_GbIP0q627hw/TUm_Ys0p4GI/AAAAAAAAAOc/2ugYEHw6Wyw/s72-c/kpi_chart_lines.gif' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-163272026812479139.post-3165453197529437636</id><published>2011-02-02T11:13:00.000-08:00</published><updated>2011-02-02T11:44:42.169-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='php'/><category scheme='http://www.blogger.com/atom/ns#' term='unit test'/><title type='text'>Site testing</title><content type='html'>&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_GbIP0q627hw/TUm0IR0tyLI/AAAAAAAAAOU/ebPWnoRCWSI/s1600/ie.jpg"&gt;&lt;img style="float:right; margin:0 0 10px 10px;cursor:pointer; cursor:hand;width: 320px; height: 151px;" src="http://2.bp.blogspot.com/_GbIP0q627hw/TUm0IR0tyLI/AAAAAAAAAOU/ebPWnoRCWSI/s320/ie.jpg" border="0" alt="" id="BLOGGER_PHOTO_ID_5569180468536789170" /&gt;&lt;/a&gt;&lt;br /&gt;Aha, you are done with a site!&lt;div&gt;Is it really done?&lt;/div&gt;&lt;div&gt;What you might want to consider to test? :&lt;/div&gt;&lt;div&gt;&lt;ul&gt;&lt;li&gt;Cross browser look and feel?&lt;/li&gt;&lt;li&gt;Spell &amp;amp; grammar check?&lt;/li&gt;&lt;li&gt;Browser check script? (stop user from continuing and browser recommendation)?&lt;/li&gt;&lt;li&gt;Have you done a LinkChecker on the site?&lt;/li&gt;&lt;li&gt;Have you optimize the site for search engine? Have you put up robots.txt? Have you put up favicon?&lt;/li&gt;&lt;li&gt;Have you done a webpagetest.org test on your site?&lt;/li&gt;&lt;li&gt;Have you done a country base test on just-ping.com and http://www.websitepulse.com/help/testtools.china-test.html for china users?&lt;/li&gt;&lt;li&gt;Is the site ready for mobile users? IPhone? Ipad? Blackberry? Mini opera?&lt;/li&gt;&lt;li&gt;Unit Testing for each function in controller of mv"&lt;b&gt;c&lt;/b&gt;"?&lt;/li&gt;&lt;li&gt;Data entry of invalid values in form fields?&lt;/li&gt;&lt;li&gt;Detect and blocking DOS attack?&lt;/li&gt;&lt;li&gt;What if facing heavy traffic? Temporary stop execution ? How to detect it?&lt;/li&gt;&lt;li&gt;Cross Site scripting by script entry in form?&lt;/li&gt;&lt;li&gt;IP Spoofing prevention / proxy connection prevention for transaction?&lt;/li&gt;&lt;li&gt;IP filtering to narrow down user access from specific countries?&lt;/li&gt;&lt;li&gt;Is the server date and timezone correct?&lt;/li&gt;&lt;li&gt;What if multiple user hit concurrently on 1 process? Will duplicate happen?&lt;/li&gt;&lt;li&gt;If flash is involved, how to detect for flash block? and put up notices?&lt;/li&gt;&lt;li&gt;If you have file protected, is the indexing of directory disabled? Is direct URL access being disabled?&lt;/li&gt;&lt;li&gt;Have the website being optimized? (example: setup css and js into separate files)&lt;/li&gt;&lt;li&gt;Do you have large files to target specific country audiences? Do you need fast loading? CDN (Content delivery network)?&lt;/li&gt;&lt;li&gt;Have you put up notes on project/site objective and target audience?&lt;/li&gt;&lt;li&gt;Do you provide font-size adjustment on site?&lt;/li&gt;&lt;li&gt;Does the site require multi-lingual in the future? is it ready for that?&lt;/li&gt;&lt;li&gt;Do you have logs to track invalid calls or exception on site?&lt;/li&gt;&lt;li&gt;Have you combined all functions by avoiding duplicate codes?&lt;/li&gt;&lt;li&gt;Have you documented / commented the code?&lt;/li&gt;&lt;/ul&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/163272026812479139-3165453197529437636?l=mercstudio-tech.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mercstudio-tech.blogspot.com/feeds/3165453197529437636/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=163272026812479139&amp;postID=3165453197529437636' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/163272026812479139/posts/default/3165453197529437636'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/163272026812479139/posts/default/3165453197529437636'/><link rel='alternate' type='text/html' href='http://mercstudio-tech.blogspot.com/2011/02/type-of-bugs.html' title='Site testing'/><author><name>James Tt</name><uri>https://profiles.google.com/103231744852638250560</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh3.googleusercontent.com/-S2vhoFMo-OY/AAAAAAAAAAI/AAAAAAAAAAA/Y8VfyxcHirI/s512-c/photo.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_GbIP0q627hw/TUm0IR0tyLI/AAAAAAAAAOU/ebPWnoRCWSI/s72-c/ie.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-163272026812479139.post-645026446349027615</id><published>2011-01-26T22:21:00.000-08:00</published><updated>2011-01-26T22:25:31.584-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='cms'/><category scheme='http://www.blogger.com/atom/ns#' term='modx'/><title type='text'>MODx 2 Context setup</title><content type='html'>When setting up a site to a context, be sure to set these setting in the context:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;site_url - site url to the domain&lt;/li&gt;&lt;li&gt;filemanager_path - the file manager path for this context to upload images / media&lt;/li&gt;&lt;li&gt;site_start - the starting resource id as home / landing page&lt;/li&gt;&lt;li&gt;site_name - the Site name to be displayed in email and page title&lt;/li&gt;&lt;/ul&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/163272026812479139-645026446349027615?l=mercstudio-tech.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mercstudio-tech.blogspot.com/feeds/645026446349027615/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=163272026812479139&amp;postID=645026446349027615' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/163272026812479139/posts/default/645026446349027615'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/163272026812479139/posts/default/645026446349027615'/><link rel='alternate' type='text/html' href='http://mercstudio-tech.blogspot.com/2011/01/modx-2-context-setup.html' title='MODx 2 Context setup'/><author><name>James Tt</name><uri>https://profiles.google.com/103231744852638250560</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh3.googleusercontent.com/-S2vhoFMo-OY/AAAAAAAAAAI/AAAAAAAAAAA/Y8VfyxcHirI/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-163272026812479139.post-7010738161196325122</id><published>2011-01-16T23:52:00.000-08:00</published><updated>2011-01-16T23:55:58.054-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='cms'/><category scheme='http://www.blogger.com/atom/ns#' term='modx'/><title type='text'>MODx 2 Adding ... to intro text summary</title><content type='html'>If you plan to add "..." to a intro text or content which is more than some # of characters, &lt;br /&gt;you may use if condition within the chunk. &lt;br /&gt;&lt;br /&gt;Example below will add ... to intro text:&lt;br /&gt;[[+introtext:if=`[[+introtext:len]]`:gt=`200`:then=`[[+introtext:limit=`200`]] ...`:else=`[[+introtext]]`]]&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/163272026812479139-7010738161196325122?l=mercstudio-tech.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mercstudio-tech.blogspot.com/feeds/7010738161196325122/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=163272026812479139&amp;postID=7010738161196325122' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/163272026812479139/posts/default/7010738161196325122'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/163272026812479139/posts/default/7010738161196325122'/><link rel='alternate' type='text/html' href='http://mercstudio-tech.blogspot.com/2011/01/modx-2-adding-to-intro-text-summary.html' title='MODx 2 Adding ... to intro text summary'/><author><name>James Tt</name><uri>https://profiles.google.com/103231744852638250560</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh3.googleusercontent.com/-S2vhoFMo-OY/AAAAAAAAAAI/AAAAAAAAAAA/Y8VfyxcHirI/s512-c/photo.jpg'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-163272026812479139.post-3968431528346083797</id><published>2011-01-15T22:17:00.000-08:00</published><updated>2011-01-15T22:35:35.523-08: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 Adding html to panel</title><content type='html'>After struggling to check why is my panel no reflecting, &lt;div&gt;i realised ive forgotten to call doLayout in the end.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;To add a html to a extpanel,&lt;/div&gt;&lt;div&gt;Ext.getCmp("panelid").add( {&lt;/div&gt;&lt;div&gt;type: "panel",&lt;/div&gt;&lt;div&gt;html: "some html here"&lt;/div&gt;&lt;div&gt;});&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Ext.getCmp("panelid").doLayout();&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;To remove all  html content in a panel:&lt;/div&gt;&lt;div&gt;Ext.getCmp("panelid").removeAll();&lt;/div&gt;&lt;div&gt;//only works in &lt;span class="Apple-style-span" style="font-family: 'Lucida Grande', Verdana, Arial, sans-serif; font-size: 13px; color: rgb(51, 51, 51); "&gt;2.2.1 all later&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/163272026812479139-3968431528346083797?l=mercstudio-tech.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mercstudio-tech.blogspot.com/feeds/3968431528346083797/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=163272026812479139&amp;postID=3968431528346083797' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/163272026812479139/posts/default/3968431528346083797'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/163272026812479139/posts/default/3968431528346083797'/><link rel='alternate' type='text/html' href='http://mercstudio-tech.blogspot.com/2011/01/extjs-adding-html-to-panel.html' title='extjs Adding html to panel'/><author><name>James Tt</name><uri>https://profiles.google.com/103231744852638250560</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh3.googleusercontent.com/-S2vhoFMo-OY/AAAAAAAAAAI/AAAAAAAAAAA/Y8VfyxcHirI/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-163272026812479139.post-4066581451549070846</id><published>2011-01-06T22:52:00.000-08:00</published><updated>2011-01-06T22:53:29.399-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='mac'/><title type='text'>MAC /etc/hosts</title><content type='html'>&lt;span class="Apple-style-span"&gt;MAC /etc/hosts is in &lt;span class="Apple-style-span" style="border-collapse: collapse; line-height: 14px; -webkit-border-horizontal-spacing: 2px; -webkit-border-vertical-spacing: 2px; "&gt;&lt;code class="keyword" style="padding-top: 0px !important; padding-right: 0px !important; padding-bottom: 0px !important; padding-left: 0px !important; margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 0px !important; margin-left: 0px !important; border-top-width: 0px !important; border-right-width: 0px !important; border-bottom-width: 0px !important; border-left-width: 0px !important; border-style: initial !important; border-color: initial !important; outline-width: 0px !important; outline-style: initial !important; outline-color: initial !important; background-image: none !important; background-attachment: initial !important; background-origin: initial !important; background-clip: initial !important; background-color: initial !important; text-align: left !important; float: none !important; vertical-align: baseline !important; position: static !important; left: auto !important; top: auto !important; right: auto !important; bottom: auto !important; height: auto !important; width: auto !important; line-height: 1.3em !important; font-weight: bold !important; font-style: normal !important; min-height: inherit !important; direction: ltr !important; text-shadow: none !important; display: inline !important; color: rgb(0, 102, 153) !important; "&gt;/&lt;/code&gt;&lt;code class="plain" style="padding-top: 0px !important; padding-right: 0px !important; padding-bottom: 0px !important; padding-left: 0px !important; margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 0px !important; margin-left: 0px !important; border-top-width: 0px !important; border-right-width: 0px !important; border-bottom-width: 0px !important; border-left-width: 0px !important; border-style: initial !important; border-color: initial !important; outline-width: 0px !important; outline-style: initial !important; outline-color: initial !important; background-image: none !important; background-attachment: initial !important; background-origin: initial !important; background-clip: initial !important; background-color: initial !important; text-align: left !important; float: none !important; vertical-align: baseline !important; position: static !important; left: auto !important; top: auto !important; right: auto !important; bottom: auto !important; height: auto !important; width: auto !important; line-height: 1.3em !important; font-weight: normal !important; font-style: normal !important; min-height: inherit !important; direction: ltr !important; text-shadow: none !important; display: inline !important; color: rgb(0, 0, 0) !important; "&gt;private&lt;/code&gt;&lt;code class="keyword" style="padding-top: 0px !important; padding-right: 0px !important; padding-bottom: 0px !important; padding-left: 0px !important; margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 0px !important; margin-left: 0px !important; border-top-width: 0px !important; border-right-width: 0px !important; border-bottom-width: 0px !important; border-left-width: 0px !important; border-style: initial !important; border-color: initial !important; outline-width: 0px !important; outline-style: initial !important; outline-color: initial !important; background-image: none !important; background-attachment: initial !important; background-origin: initial !important; background-clip: initial !important; background-color: initial !important; text-align: left !important; float: none !important; vertical-align: baseline !important; position: static !important; left: auto !important; top: auto !important; right: auto !important; bottom: auto !important; height: auto !important; width: auto !important; line-height: 1.3em !important; font-weight: bold !important; font-style: normal !important; min-height: inherit !important; direction: ltr !important; text-shadow: none !important; display: inline !important; color: rgb(0, 102, 153) !important; "&gt;/&lt;/code&gt;&lt;code class="plain" style="padding-top: 0px !important; padding-right: 0px !important; padding-bottom: 0px !important; padding-left: 0px !important; margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 0px !important; margin-left: 0px !important; border-top-width: 0px !important; border-right-width: 0px !important; border-bottom-width: 0px !important; border-left-width: 0px !important; border-style: initial !important; border-color: initial !important; outline-width: 0px !important; outline-style: initial !important; outline-color: initial !important; background-image: none !important; background-attachment: initial !important; background-origin: initial !important; background-clip: initial !important; background-color: initial !important; text-align: left !important; float: none !important; vertical-align: baseline !important; position: static !important; left: auto !important; top: auto !important; right: auto !important; bottom: auto !important; height: auto !important; width: auto !important; line-height: 1.3em !important; font-weight: normal !important; font-style: normal !important; min-height: inherit !important; direction: ltr !important; text-shadow: none !important; display: inline !important; color: rgb(0, 0, 0) !important; "&gt;etc&lt;/code&gt;&lt;code class="keyword" style="padding-top: 0px !important; padding-right: 0px !important; padding-bottom: 0px !important; padding-left: 0px !important; margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 0px !important; margin-left: 0px !important; border-top-width: 0px !important; border-right-width: 0px !important; border-bottom-width: 0px !important; border-left-width: 0px !important; border-style: initial !important; border-color: initial !important; outline-width: 0px !important; outline-style: initial !important; outline-color: initial !important; background-image: none !important; background-attachment: initial !important; background-origin: initial !important; background-clip: initial !important; background-color: initial !important; text-align: left !important; float: none !important; vertical-align: baseline !important; position: static !important; left: auto !important; top: auto !important; right: auto !important; bottom: auto !important; height: auto !important; width: auto !important; line-height: 1.3em !important; font-weight: bold !important; font-style: normal !important; min-height: inherit !important; direction: ltr !important; text-shadow: none !important; display: inline !important; color: rgb(0, 102, 153) !important; "&gt;/&lt;/code&gt;&lt;code class="plain" style="padding-top: 0px !important; padding-right: 0px !important; padding-bottom: 0px !important; padding-left: 0px !important; margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 0px !important; margin-left: 0px !important; border-top-width: 0px !important; border-right-width: 0px !important; border-bottom-width: 0px !important; border-left-width: 0px !important; border-style: initial !important; border-color: initial !important; outline-width: 0px !important; outline-style: initial !important; outline-color: initial !important; background-image: none !important; background-attachment: initial !important; background-origin: initial !important; background-clip: initial !important; background-color: initial !important; text-align: left !important; float: none !important; vertical-align: baseline !important; position: static !important; left: auto !important; top: auto !important; right: auto !important; bottom: auto !important; height: auto !important; width: auto !important; line-height: 1.3em !important; font-weight: normal !important; font-style: normal !important; min-height: inherit !important; direction: ltr !important; text-shadow: none !important; display: inline !important; color: rgb(0, 0, 0) !important; "&gt;hosts&lt;/code&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/163272026812479139-4066581451549070846?l=mercstudio-tech.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mercstudio-tech.blogspot.com/feeds/4066581451549070846/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=163272026812479139&amp;postID=4066581451549070846' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/163272026812479139/posts/default/4066581451549070846'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/163272026812479139/posts/default/4066581451549070846'/><link rel='alternate' type='text/html' href='http://mercstudio-tech.blogspot.com/2011/01/mac-etchosts.html' title='MAC /etc/hosts'/><author><name>James Tt</name><uri>https://profiles.google.com/103231744852638250560</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh3.googleusercontent.com/-S2vhoFMo-OY/AAAAAAAAAAI/AAAAAAAAAAA/Y8VfyxcHirI/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-163272026812479139.post-8690927499746527122</id><published>2011-01-05T01:25:00.000-08:00</published><updated>2011-01-05T01:26:16.596-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='mac'/><title type='text'>MAC Finder alike windows explorer</title><content type='html'>I find it handy to show full path of the current folder at the application title bar.&lt;div&gt;here is how it can be done:&lt;/div&gt;&lt;div&gt;&lt;a href="http://www.tuaw.com/2008/12/05/terminal-tips-enable-path-view-in-finder/"&gt;http://www.tuaw.com/2008/12/05/terminal-tips-enable-path-view-in-finder/&lt;/a&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/163272026812479139-8690927499746527122?l=mercstudio-tech.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mercstudio-tech.blogspot.com/feeds/8690927499746527122/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=163272026812479139&amp;postID=8690927499746527122' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/163272026812479139/posts/default/8690927499746527122'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/163272026812479139/posts/default/8690927499746527122'/><link rel='alternate' type='text/html' href='http://mercstudio-tech.blogspot.com/2011/01/mac-finder-alike-windows-explorer.html' title='MAC Finder alike windows explorer'/><author><name>James Tt</name><uri>https://profiles.google.com/103231744852638250560</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh3.googleusercontent.com/-S2vhoFMo-OY/AAAAAAAAAAI/AAAAAAAAAAA/Y8VfyxcHirI/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-163272026812479139.post-3118183763225659934</id><published>2011-01-04T09:29:00.001-08:00</published><updated>2011-01-04T09:30:27.620-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='mac'/><category scheme='http://www.blogger.com/atom/ns#' term='mamp'/><title type='text'>MAMP package and mysql sock</title><content type='html'>/tmp/mysql.sock was missing because its in /Application/MAMP/temp/mysql/mysql.sock&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.fischerlaender.net/web-20/mac-os-x-trouble-with-mamp-mysql"&gt;http://www.fischerlaender.net/web-20/mac-os-x-trouble-with-mamp-mysql&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/163272026812479139-3118183763225659934?l=mercstudio-tech.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mercstudio-tech.blogspot.com/feeds/3118183763225659934/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=163272026812479139&amp;postID=3118183763225659934' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/163272026812479139/posts/default/3118183763225659934'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/163272026812479139/posts/default/3118183763225659934'/><link rel='alternate' type='text/html' href='http://mercstudio-tech.blogspot.com/2011/01/mamp-package-and-mysql-sock.html' title='MAMP package and mysql sock'/><author><name>James Tt</name><uri>https://profiles.google.com/103231744852638250560</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh3.googleusercontent.com/-S2vhoFMo-OY/AAAAAAAAAAI/AAAAAAAAAAA/Y8VfyxcHirI/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-163272026812479139.post-5469625978565756564</id><published>2011-01-03T02:32:00.001-08:00</published><updated>2011-01-03T02:32:38.269-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='cms'/><category scheme='http://www.blogger.com/atom/ns#' term='lexicon'/><category scheme='http://www.blogger.com/atom/ns#' term='modx'/><title type='text'>MODx loading other components lexicon</title><content type='html'>&lt;span class="Apple-style-span" style="font-family: Georgia, Utopia, 'Palatino Linotype', Palatino, serif; font-size: 14px; color: rgb(51, 51, 51); line-height: 21px; "&gt;If you need some lexicon from another components from your snippet,&lt;div&gt;you may do so by running this in snippet:&lt;/div&gt;&lt;div&gt;$modx-&gt;lexicon-&gt;load("namespacename:filename");&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Example:&lt;/div&gt;&lt;div&gt;$modx-&gt;lexicon-&gt;load("login:register");&lt;/div&gt;&lt;div&gt;//resolve to: core/components/login/lexicon/register.inc.php&lt;/div&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/163272026812479139-5469625978565756564?l=mercstudio-tech.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mercstudio-tech.blogspot.com/feeds/5469625978565756564/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=163272026812479139&amp;postID=5469625978565756564' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/163272026812479139/posts/default/5469625978565756564'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/163272026812479139/posts/default/5469625978565756564'/><link rel='alternate' type='text/html' href='http://mercstudio-tech.blogspot.com/2011/01/modx-loading-other-components-lexicon.html' title='MODx loading other components lexicon'/><author><name>James Tt</name><uri>https://profiles.google.com/103231744852638250560</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh3.googleusercontent.com/-S2vhoFMo-OY/AAAAAAAAAAI/AAAAAAAAAAA/Y8VfyxcHirI/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-163272026812479139.post-7136264346228781616</id><published>2010-12-30T19:41:00.001-08:00</published><updated>2010-12-30T20:18:52.296-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='php'/><category scheme='http://www.blogger.com/atom/ns#' term='mac'/><category scheme='http://www.blogger.com/atom/ns#' term='mamp'/><category scheme='http://www.blogger.com/atom/ns#' term='apache'/><category scheme='http://www.blogger.com/atom/ns#' term='backup mysql'/><title type='text'>MAC Apache MySQL PHP</title><content type='html'>MAMP in short, is what most php developer is looking for on MAC.&lt;div&gt;First, get macport installed.&lt;/div&gt;&lt;div&gt;Then, follow this instruction here:&lt;/div&gt;&lt;div&gt;&lt;a href="http://www.techiecorner.com/174/how-to-install-apache-php-mysql-with-macport-in-mac-os-x/"&gt;http://www.techiecorner.com/174/how-to-install-apache-php-mysql-with-macport-in-mac-os-x/&lt;/a&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Make sure to disable the web sharing of MAC, which is default enabled.&lt;/div&gt;&lt;div&gt;And to start it, you will need to to run the daemons in /opt/local/etc/LaunchDaemons.&lt;/div&gt;&lt;div&gt;Example:&lt;br /&gt;&lt;i&gt;/opt/local/etc/LaunchDaemons/org.macports.apache2/apache2.wrapper start&lt;/i&gt;&lt;/div&gt;&lt;div&gt;&lt;i&gt;&lt;br /&gt;&lt;/i&gt;&lt;/div&gt;&lt;div&gt;&lt;i&gt;DocumentRoot is located @ /opt/local/apache2/htdocs&lt;/i&gt;&lt;/div&gt;&lt;div&gt;&lt;i&gt;Configuration @ &lt;/i&gt;&lt;i&gt;/opt/local/apache2/conf&lt;/i&gt;&lt;/div&gt;&lt;div&gt;&lt;i&gt;&lt;br /&gt;&lt;/i&gt;&lt;/div&gt;&lt;div&gt;&lt;i&gt;&lt;br /&gt;&lt;/i&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/163272026812479139-7136264346228781616?l=mercstudio-tech.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mercstudio-tech.blogspot.com/feeds/7136264346228781616/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=163272026812479139&amp;postID=7136264346228781616' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/163272026812479139/posts/default/7136264346228781616'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/163272026812479139/posts/default/7136264346228781616'/><link rel='alternate' type='text/html' href='http://mercstudio-tech.blogspot.com/2010/12/mac-apache-mysql-php.html' title='MAC Apache MySQL PHP'/><author><name>James Tt</name><uri>https://profiles.google.com/103231744852638250560</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh3.googleusercontent.com/-S2vhoFMo-OY/AAAAAAAAAAI/AAAAAAAAAAA/Y8VfyxcHirI/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-163272026812479139.post-5354755618001466836</id><published>2010-12-30T19:09:00.000-08:00</published><updated>2010-12-30T20:38:34.486-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='mac'/><category scheme='http://www.blogger.com/atom/ns#' term='mac port'/><title type='text'>MAC and repository</title><content type='html'>MAC was originated from Darwin BSD, a varient of unix made by open source community.&lt;div&gt;But Apple did a well job, making the user interface suitable for desktop use.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Alike linux such as ubuntu, it has a *nix like file structure.&lt;/div&gt;&lt;div&gt;Most installer packages are in extension .dmg or .pkg.&lt;/div&gt;&lt;div&gt;Or you may install things from source code itself.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;There are some way to make repository like installer, alike apt-get or yum in linux.&lt;/div&gt;&lt;div&gt;One of it is macports, &lt;a href="http://macports.org/"&gt;macports.org&lt;/a&gt;&lt;/div&gt;&lt;div&gt;Installing MacPorts requires XCode to be installed. It can be found on apple website.&lt;/div&gt;&lt;div&gt;XCode with the iOS sdk is pretty huge, total up to 3+Gb. &lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Mac paths is different from most linux.&lt;/div&gt;&lt;div&gt;The application is mostly installed under /Application.&lt;/div&gt;&lt;div&gt;While the user home directory is under /Users/your_user_name&lt;/div&gt;&lt;div&gt;Other than that, its pretty much the same file structure with linux.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Keyboard wise, its pretty much confusing. There are no direct home or end key.&lt;/div&gt;&lt;div&gt;The function key needs the Fn function to press together to make it work.&lt;/div&gt;&lt;div&gt;But you may change this setting in the System preference, found on the upper left with a small Apple icon.&lt;/div&gt;&lt;div&gt;As for home button, pressing the "Command" + "Left arrow" gives you the home, while "Command" + "Right arrow" gives you the End.&lt;/div&gt;&lt;div&gt;The "Command" key is pretty much alike the control key in windows or linux.&lt;/div&gt;&lt;div&gt;But in terminal, the Control+c of linux have to be "Control"+c in mac.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;What is really awesome in MAC is their touch pad. Its multi touch, and it detect 4 fingers!&lt;/div&gt;&lt;div&gt;Using Four finger and dragging down, give the overview of all the tasks in thumbnail.&lt;/div&gt;&lt;div&gt;Using 3 fingers and dragging left gives the "Go back", while dragging right gives the "Go Forward" maneuver. Touching the pad with 2 fingers give the "Right" click trigger. And as usual, using 2 fingers to drag will give the scrolling maneuver, alike the iphone or ipad.&lt;/div&gt;&lt;div&gt;Multi tasking in MAC is pretty much more smoother compared to ubuntu 10.10. But there is a new patch done in the recent kernel hacking which seems to solve this issue on X Windows, and hopefully this will give the more consistant multi-tasking feel on linux.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;More on MAC keyboard:&lt;/div&gt;&lt;div&gt;&lt;a href="http://support.apple.com/kb/HT1343"&gt;http://support.apple.com/kb/HT1343&lt;/a&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Hope this give you a head start of understand MAC.&lt;/div&gt;&lt;div&gt;Cheers~ :)&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/163272026812479139-5354755618001466836?l=mercstudio-tech.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mercstudio-tech.blogspot.com/feeds/5354755618001466836/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=163272026812479139&amp;postID=5354755618001466836' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/163272026812479139/posts/default/5354755618001466836'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/163272026812479139/posts/default/5354755618001466836'/><link rel='alternate' type='text/html' href='http://mercstudio-tech.blogspot.com/2010/12/mac-and-repository.html' title='MAC and repository'/><author><name>James Tt</name><uri>https://profiles.google.com/103231744852638250560</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh3.googleusercontent.com/-S2vhoFMo-OY/AAAAAAAAAAI/AAAAAAAAAAA/Y8VfyxcHirI/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-163272026812479139.post-4512323915909353662</id><published>2010-12-29T21:32:00.000-08:00</published><updated>2010-12-29T21:41:00.931-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='javascript'/><category scheme='http://www.blogger.com/atom/ns#' term='jquery'/><category scheme='http://www.blogger.com/atom/ns#' term='form'/><title type='text'>jquery.form onsubmit</title><content type='html'>jQuery has a plugin for form which does alike mootool .load method for form..&lt;div&gt;If you need to submit the form through javascript, you may not use&lt;/div&gt;&lt;div&gt;document.formname.submit(), as this will bypass the onsubmit event.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;To make it work, use $("#formid").submit();&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Reference:&lt;/div&gt;&lt;div&gt;+ &lt;a href="http://jquery.malsup.com/form/"&gt;http://jquery.malsup.com/form/&lt;/a&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/163272026812479139-4512323915909353662?l=mercstudio-tech.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mercstudio-tech.blogspot.com/feeds/4512323915909353662/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=163272026812479139&amp;postID=4512323915909353662' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/163272026812479139/posts/default/4512323915909353662'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/163272026812479139/posts/default/4512323915909353662'/><link rel='alternate' type='text/html' href='http://mercstudio-tech.blogspot.com/2010/12/jqueryform-onsubmit.html' title='jquery.form onsubmit'/><author><name>James Tt</name><uri>https://profiles.google.com/103231744852638250560</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh3.googleusercontent.com/-S2vhoFMo-OY/AAAAAAAAAAI/AAAAAAAAAAA/Y8VfyxcHirI/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-163272026812479139.post-5797284233996535380</id><published>2010-12-27T04:55:00.000-08:00</published><updated>2011-01-12T01:07:42.820-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='remote mx'/><title type='text'>External MX record / Mail server</title><content type='html'>It is possible to set external mail on server by setting MX record of the server dns to point to external IP. Another method will be removing the dns of the domain from the server and let the DNS be resolved on the external managed DNS.&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;If you have Postfix configured for your smtp, you will need to set the virtual-transport of the domain to another place.&lt;/div&gt;&lt;div&gt;Example:&lt;/div&gt;&lt;div&gt;domainname: exmaple.com, transport: &lt;span class="Apple-style-span" style="font-family: sans-serif; font-size: 13px; -webkit-border-horizontal-spacing: 2px; -webkit-border-vertical-spacing: 2px; "&gt;smtp:ASPMX.L.GOOGLE.com:25&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;If you are running virtual domain support with mysql for postfix, you may find the configuration in /etc/postfix/mysql-virtual_transports.cf , stating the table in mysql to change.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;More info:&lt;/div&gt;&lt;div&gt;&lt;a href="http://www.postfix.org/postconf.5.html#virtual_transport"&gt;http://www.postfix.org/postconf.5.html#virtual_transport&lt;/a&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/163272026812479139-5797284233996535380?l=mercstudio-tech.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mercstudio-tech.blogspot.com/feeds/5797284233996535380/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=163272026812479139&amp;postID=5797284233996535380' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/163272026812479139/posts/default/5797284233996535380'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/163272026812479139/posts/default/5797284233996535380'/><link rel='alternate' type='text/html' href='http://mercstudio-tech.blogspot.com/2010/12/external-mx-record-mail-server.html' title='External MX record / Mail server'/><author><name>James Tt</name><uri>https://profiles.google.com/103231744852638250560</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh3.googleusercontent.com/-S2vhoFMo-OY/AAAAAAAAAAI/AAAAAAAAAAA/Y8VfyxcHirI/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-163272026812479139.post-3071755932662449021</id><published>2010-12-23T19:53:00.000-08:00</published><updated>2010-12-23T20:03:13.216-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='netbeans'/><category scheme='http://www.blogger.com/atom/ns#' term='xdebug'/><category scheme='http://www.blogger.com/atom/ns#' term='php'/><title type='text'>Debugging PHP with XDebug and Netbeans</title><content type='html'>On ubuntu:&lt;div&gt;sudo apt-get install php5-xdebug&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Edit xdebug.ini in /etc/php5/conf.d/xdebug.ini&lt;/div&gt;&lt;div&gt;&lt;div&gt;#Add this line:&lt;/div&gt;&lt;div&gt;xdebug.remote_enable=on&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Restart apache:&lt;/div&gt;&lt;div&gt;sudo /etc/init.d/apache2 restart&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;In firefox, add extension "easy XDebug".&lt;/div&gt;&lt;div&gt;Restart firefox.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;In netbeans, right click on project, "properties".&lt;/div&gt;&lt;div&gt;Go to "Run configuration", "Advanced"&lt;/div&gt;&lt;div&gt;Check on "Dot not open browser", "okay".&lt;/div&gt;&lt;div&gt;Click on "Debug", "Debug project"&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Go to firefox, click on "Start XDebug session" icon, then open the URL to your local project.&lt;/div&gt;&lt;div&gt;Example: http://localhost/myprojectnamefolder/&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;You are done, you will notice debugging buttons on the top toolbar, on the right.&lt;/div&gt;&lt;div&gt;You may continue / step in / other action.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/163272026812479139-3071755932662449021?l=mercstudio-tech.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mercstudio-tech.blogspot.com/feeds/3071755932662449021/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=163272026812479139&amp;postID=3071755932662449021' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/163272026812479139/posts/default/3071755932662449021'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/163272026812479139/posts/default/3071755932662449021'/><link rel='alternate' type='text/html' href='http://mercstudio-tech.blogspot.com/2010/12/debugging-php-with-xdebug-and-netbeans.html' title='Debugging PHP with XDebug and Netbeans'/><author><name>James Tt</name><uri>https://profiles.google.com/103231744852638250560</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh3.googleusercontent.com/-S2vhoFMo-OY/AAAAAAAAAAI/AAAAAAAAAAA/Y8VfyxcHirI/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-163272026812479139.post-5584004855162342652</id><published>2010-12-23T18:40:00.000-08:00</published><updated>2010-12-23T18:46:32.473-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='cms'/><category scheme='http://www.blogger.com/atom/ns#' term='modx'/><title type='text'>MODx 2.0.6 update</title><content type='html'>MODx team have finally made it right :)&lt;div&gt;Every logged in session now have to be in &lt;/div&gt;&lt;div&gt;$_SESSION["modx.user.contextTokens"]&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Example:&lt;/div&gt;&lt;div&gt;$_SESSION["modx.user.contextTokens"]["web"]=UserId#&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;And $modx-&gt;executeProcessor($options) now get $scriptProperties from $options, no longer $_POST.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt; &lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/163272026812479139-5584004855162342652?l=mercstudio-tech.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mercstudio-tech.blogspot.com/feeds/5584004855162342652/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=163272026812479139&amp;postID=5584004855162342652' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/163272026812479139/posts/default/5584004855162342652'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/163272026812479139/posts/default/5584004855162342652'/><link rel='alternate' type='text/html' href='http://mercstudio-tech.blogspot.com/2010/12/modx-206-update.html' title='MODx 2.0.6 update'/><author><name>James Tt</name><uri>https://profiles.google.com/103231744852638250560</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh3.googleusercontent.com/-S2vhoFMo-OY/AAAAAAAAAAI/AAAAAAAAAAA/Y8VfyxcHirI/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-163272026812479139.post-778353249680292719</id><published>2010-12-22T21:05:00.000-08:00</published><updated>2010-12-22T21:12:26.899-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='cms'/><category scheme='http://www.blogger.com/atom/ns#' term='modx'/><title type='text'>MODx 2 Plugin OnBeforeDocFormSave</title><content type='html'>Here is an example to make a tv to be a required field:&lt;div&gt;----------------------&lt;/div&gt;&lt;div&gt;&amp;lt;?php&lt;br /&gt;&lt;div&gt;&lt;div&gt;/*&lt;/div&gt;&lt;div&gt;* $mode: "new/upd"&lt;/div&gt;&lt;div&gt;* $resource: modResource object&lt;/div&gt;&lt;div&gt;* $id: resource id&lt;/div&gt;&lt;div&gt;* @ref &lt;a href="http://rtfm.modx.com/display/revolution20/OnBeforeDocFormSave"&gt;http://rtfm.modx.com/display/revolution20/OnBeforeDocFormSave&lt;/a&gt;&lt;/div&gt;&lt;div&gt;*   Calling $modx-&gt;event-&amp;gt;output("..."); will output error and cancel save&lt;/div&gt;&lt;div&gt;*/&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;if (empty($_REQUEST["tv4"])) {&lt;/div&gt;&lt;div&gt;  $modx-&amp;gt;event-&amp;gt;output("Field 'XXX' is required");&lt;/div&gt;&lt;div&gt;}&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/163272026812479139-778353249680292719?l=mercstudio-tech.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mercstudio-tech.blogspot.com/feeds/778353249680292719/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=163272026812479139&amp;postID=778353249680292719' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/163272026812479139/posts/default/778353249680292719'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/163272026812479139/posts/default/778353249680292719'/><link rel='alternate' type='text/html' href='http://mercstudio-tech.blogspot.com/2010/12/modx-plugin-onbeforedocformsave.html' title='MODx 2 Plugin OnBeforeDocFormSave'/><author><name>James Tt</name><uri>https://profiles.google.com/103231744852638250560</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh3.googleusercontent.com/-S2vhoFMo-OY/AAAAAAAAAAI/AAAAAAAAAAA/Y8VfyxcHirI/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-163272026812479139.post-7274244541354775542</id><published>2010-12-21T20:55:00.000-08:00</published><updated>2010-12-21T21:01:54.102-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='cms'/><category scheme='http://www.blogger.com/atom/ns#' term='modx'/><title type='text'>MODx 2 Resource Create/Update Cancel redirect</title><content type='html'>If you need to create your own resource grid,&lt;br /&gt;you may find it difficult to control the resource create / update redirect on after save or when cancel button is clicked.&lt;br /&gt;One way to do this is to add your own startupclientscript like this:&lt;br /&gt;&lt;div&gt;----------------------&lt;/div&gt;&lt;div&gt;setCancelButton();&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;function setCancelButton() {&lt;/div&gt;&lt;div&gt;  if (!Ext.getCmp("modx-action-buttons")) {&lt;/div&gt;&lt;div&gt;    setTimeout("setCancelButton()", 1000);&lt;/div&gt;&lt;div&gt;    return;&lt;/div&gt;&lt;div&gt;  }&lt;/div&gt;&lt;div&gt;  Ext.getCmp("modx-action-buttons").actions.cancel = 90;//your action number&lt;/div&gt;&lt;div&gt;  for(var c=0; c Ext.getCmp("modx-action-buttons").items.items.length; c++) {&lt;/div&gt;&lt;div&gt;&lt;ext.getcmp("modx-action-buttons").items.items.length;&gt;    if (Ext.getCmp("modx-action-buttons").items.items[c].process == "cancel") {&lt;/ext.getcmp("modx-action-buttons").items.items.length;&gt;&lt;/div&gt;&lt;div&gt;      Ext.getCmp("modx-action-buttons").items.items[c].handler = cancelHandler;&lt;/div&gt;&lt;div&gt;    }&lt;/div&gt;&lt;div&gt;  }&lt;/div&gt;&lt;div&gt;}&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;var cancelHandler = function (btn,e) {&lt;/div&gt;&lt;div&gt;  var fp = Ext.getCmp(this.config.formpanel);&lt;/div&gt;&lt;div&gt;  if (fp &amp;amp;&amp;amp; fp.isDirty()) {&lt;/div&gt;&lt;div&gt;      Ext.Msg.confirm(_('warning'),_('resource_cancel_dirty_confirm'),function(e) {&lt;/div&gt;&lt;div&gt;          if (e == 'yes') {&lt;/div&gt;&lt;div&gt;              MODx.releaseLock(MODx.request.id);&lt;/div&gt;&lt;div&gt;              MODx.sleep(400);&lt;/div&gt;&lt;div&gt;              location.href = '?a=90'; //your url or action here&lt;/div&gt;&lt;div&gt;          }&lt;/div&gt;&lt;div&gt;      },this);&lt;/div&gt;&lt;div&gt;  } else {&lt;/div&gt;&lt;div&gt;      MODx.releaseLock(MODx.request.id);&lt;/div&gt;&lt;div&gt;      location.href = '?a=90'; //your url or action here&lt;/div&gt;&lt;div&gt;  }&lt;/div&gt;&lt;div&gt;}&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/163272026812479139-7274244541354775542?l=mercstudio-tech.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mercstudio-tech.blogspot.com/feeds/7274244541354775542/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=163272026812479139&amp;postID=7274244541354775542' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/163272026812479139/posts/default/7274244541354775542'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/163272026812479139/posts/default/7274244541354775542'/><link rel='alternate' type='text/html' href='http://mercstudio-tech.blogspot.com/2010/12/modx-2-resource-createupdate-cancel.html' title='MODx 2 Resource Create/Update Cancel redirect'/><author><name>James Tt</name><uri>https://profiles.google.com/103231744852638250560</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh3.googleusercontent.com/-S2vhoFMo-OY/AAAAAAAAAAI/AAAAAAAAAAA/Y8VfyxcHirI/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-163272026812479139.post-878029344083943121</id><published>2010-12-19T09:12:00.001-08:00</published><updated>2010-12-19T09:12:59.385-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='javascript'/><category scheme='http://www.blogger.com/atom/ns#' term='dhtmlx'/><category scheme='http://www.blogger.com/atom/ns#' term='grid'/><title type='text'>DHTMLX Grid reloading data</title><content type='html'>Handy function to reload data in grid&lt;br /&gt;&lt;br /&gt;mygrid.reloadPage = function() {&lt;br /&gt;  this.load(this.xmlFileUrl + getUrlSymbol(this.xmlFileUrl) + "posStart=" +&lt;br /&gt;    ((this.currentPage-1)*this.rowsBufferOutSize) + "&amp;count=" + this.rowsBufferOutSize, this._data_type);&lt;br /&gt;}&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/163272026812479139-878029344083943121?l=mercstudio-tech.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mercstudio-tech.blogspot.com/feeds/878029344083943121/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=163272026812479139&amp;postID=878029344083943121' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/163272026812479139/posts/default/878029344083943121'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/163272026812479139/posts/default/878029344083943121'/><link rel='alternate' type='text/html' href='http://mercstudio-tech.blogspot.com/2010/12/dhtmlx-grid-reloading-data.html' title='DHTMLX Grid reloading data'/><author><name>James Tt</name><uri>https://profiles.google.com/103231744852638250560</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh3.googleusercontent.com/-S2vhoFMo-OY/AAAAAAAAAAI/AAAAAAAAAAA/Y8VfyxcHirI/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-163272026812479139.post-5036417042281285251</id><published>2010-12-19T01:25:00.000-08:00</published><updated>2010-12-19T01:29:15.887-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='javascript'/><category scheme='http://www.blogger.com/atom/ns#' term='dhtmlx'/><category scheme='http://www.blogger.com/atom/ns#' term='grid'/><title type='text'>DHTMLX Grid attachHeader and attachFooter</title><content type='html'>DHTMLX Grid is very strict on height setting.&lt;br /&gt;If you ever attachHeader or attachFooter, always remember to set the height of the column you are adding using style="height:30px".&lt;br /&gt;&lt;br /&gt;After setting, running:&lt;br /&gt;grid.setSizes();&lt;br /&gt;grid.callEvent("onGridReconstructed", []);&lt;br /&gt;&lt;br /&gt;This above also applies to subgrid&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/163272026812479139-5036417042281285251?l=mercstudio-tech.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mercstudio-tech.blogspot.com/feeds/5036417042281285251/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=163272026812479139&amp;postID=5036417042281285251' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/163272026812479139/posts/default/5036417042281285251'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/163272026812479139/posts/default/5036417042281285251'/><link rel='alternate' type='text/html' href='http://mercstudio-tech.blogspot.com/2010/12/dhtmlx-grid-attachheader-and.html' title='DHTMLX Grid attachHeader and attachFooter'/><author><name>James Tt</name><uri>https://profiles.google.com/103231744852638250560</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh3.googleusercontent.com/-S2vhoFMo-OY/AAAAAAAAAAI/AAAAAAAAAAA/Y8VfyxcHirI/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-163272026812479139.post-561739210733392593</id><published>2010-12-18T21:21:00.000-08:00</published><updated>2010-12-18T22:10:40.539-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='javascript'/><category scheme='http://www.blogger.com/atom/ns#' term='subgrid'/><category scheme='http://www.blogger.com/atom/ns#' term='dhtmlx'/><category scheme='http://www.blogger.com/atom/ns#' term='grid'/><title type='text'>DHTMLXGrid subgrid paging</title><content type='html'>To create paging in subgrid, one must create a row in the table.&lt;br /&gt;The example below put up paging as footer.&lt;br /&gt;The enablePaging should only be call when loading data.&lt;br /&gt;This is because the grid is not created yet, therefore the div did not exists yet.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;mygrid.attachEvent("onSubGridCreated",function(subgrid, id){&lt;br /&gt; //collapse all other subgrid&lt;br /&gt; subgrid.setHeader("#master_checkbox,Id,Name,Age");&lt;br /&gt; subgrid.setColTypes("ch,ro,ro,ro");&lt;br /&gt; subgrid.setInitWidths("40,50,100,100");&lt;br /&gt; subgrid.init();&lt;br /&gt; subgrid.enableAutoHeight(true);&lt;br /&gt; //notice the div is given the unique id&lt;br /&gt; //the trailing #cspan to set colspan of the other column to merge with 1st column&lt;br /&gt; // therefore, the #cspan have to match your column count-1&lt;br /&gt; subgrid.attachFooter("&amp;lt;div id="subgrid_h&amp;quot; + id + &amp;quot;" style="width:100%;"&gt;&amp;lt;/div&gt;&amp;lt;div id="subgrid_f&amp;quot; + siteid + &amp;quot;" style="width:100%; height: 20px;"&gt;&amp;lt;/div&gt;,#cspan,#cspan,#cspan");&lt;br /&gt;&lt;br /&gt; subgrid.load("http://example.com/path_tojson?count=10&amp;amp;posStart=0&amp;amp;siteid=" + siteid,function() {&lt;br /&gt;   subgrid.enablePaging(true, 10, 10, "subgrid_h" + siteid, true, "subgrid_f" + siteid);&lt;br /&gt;   subgrid.setPagingSkin("bricks");&lt;br /&gt;   subgrid.setSizes();&lt;br /&gt;   subgrid.callEvent("onGridReconstructed", []);&lt;br /&gt; }, "json");&lt;br /&gt;&lt;br /&gt; return false;  // block default behavior&lt;br /&gt;});&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/163272026812479139-561739210733392593?l=mercstudio-tech.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mercstudio-tech.blogspot.com/feeds/561739210733392593/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=163272026812479139&amp;postID=561739210733392593' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/163272026812479139/posts/default/561739210733392593'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/163272026812479139/posts/default/561739210733392593'/><link rel='alternate' type='text/html' href='http://mercstudio-tech.blogspot.com/2010/12/dhtmlxgrid-subgrid-paging.html' title='DHTMLXGrid subgrid paging'/><author><name>James Tt</name><uri>https://profiles.google.com/103231744852638250560</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh3.googleusercontent.com/-S2vhoFMo-OY/AAAAAAAAAAI/AAAAAAAAAAA/Y8VfyxcHirI/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-163272026812479139.post-1564746138721921239</id><published>2010-12-18T07:08:00.000-08:00</published><updated>2010-12-18T20:14:51.410-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='javascript'/><category scheme='http://www.blogger.com/atom/ns#' term='dhtmlx'/><category scheme='http://www.blogger.com/atom/ns#' term='grid'/><title type='text'>DHTMLX Grid subgrid</title><content type='html'>&lt;div&gt;Example of Grid with subgrid support with JSON data:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;//=====Main grid======//&lt;/div&gt;&lt;div&gt;mygrid = new dhtmlXGridObject('divGridForm');&lt;/div&gt;&lt;div&gt;mygrid.setImagePath("imgs/");&lt;/div&gt;&lt;div&gt;//setting header row, notice 2nd column is a "check-all" checkbox&lt;/div&gt;&lt;div&gt;mygrid.setHeader(["","#master_checkbox","id","name");&lt;/div&gt;&lt;div&gt;mygrid.setInitWidths("30,40,50,100);&lt;/div&gt;&lt;div&gt;mygrid.setColAlign("center,center,left,right");&lt;/div&gt;&lt;div&gt;//expander symbol, checkbox, read-only field,...&lt;/div&gt;&lt;div&gt;mygrid.setColTypes("sub_row_grid,ch,ro,ro");&lt;/div&gt;&lt;div&gt;//setting sortable columns, notice 1st 2 columns is empty to disable sorting&lt;/div&gt;&lt;div&gt;mygrid.setColSorting(",,str,str");&lt;/div&gt;&lt;div&gt;mygrid.enablePaging(true, iLimit, 10, "pagingArea", true, "recinfoArea");&lt;/div&gt;&lt;div&gt;mygrid.setPagingSkin("bricks");&lt;/div&gt;&lt;div&gt;mygrid.load("http://example.com/pathtojson", "json");&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;//Main grid row double clickevent&lt;/div&gt;&lt;div&gt;&lt;div&gt;mygrid.attachEvent("onRowDblClicked", function(rId,cInd){&lt;/div&gt;&lt;div&gt;  //do something&lt;/div&gt;&lt;div&gt;});&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;//====Sub grid load on created====//&lt;/div&gt;&lt;div&gt;&lt;div&gt;mygrid.attachEvent("onSubGridCreated",function(subgrid, id){&lt;/div&gt;&lt;div&gt;  //collapse all other subgrid&lt;/div&gt;&lt;div&gt;  //notice hiding column #2&lt;/div&gt;&lt;div&gt;  subgrid.setHeader("#master_checkbox,,Industry,Advertiser");&lt;/div&gt;&lt;div&gt;  //notice chekbox @ column #1&lt;/div&gt;&lt;div&gt;  subgrid.setColTypes("ch,ro,ro");&lt;/div&gt;&lt;div&gt;  subgrid.setInitWidths("40,0,100,100");&lt;/div&gt;&lt;div&gt;  subgrid.init();&lt;/div&gt;&lt;div&gt;  subgrid.load("http://example.com/path_tosubgrid_json" + id,function() {&lt;/div&gt;&lt;div&gt;    //call to reload subgrid height&lt;/div&gt;&lt;div&gt;    subgrid.setSizes();&lt;/div&gt;&lt;div&gt;    subgrid.callEvent("onGridReconstructed", []);&lt;/div&gt;&lt;div&gt;  }, "&lt;b&gt;json&lt;/b&gt;");&lt;/div&gt;&lt;div&gt;  return false;  // block default behavior&lt;/div&gt;&lt;div&gt;});&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;//updates dec 19: this can be done by calling mygri&lt;span class="Apple-style-span" &gt;d&lt;span class="Apple-style-span" &gt;.&lt;span class="Apple-style-span" style="line-height: 22px; white-space: pre; "&gt;&lt;span&gt;&lt;span&gt;&lt;span&gt;&lt;span&gt;getCheckedRows&lt;/span&gt;&lt;/span&gt;(0);&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;//overriding method to get all checkbox ticked in main grid&lt;/div&gt;&lt;div&gt;&lt;div&gt;mygrid.getSelectedRows = function() {&lt;/div&gt;&lt;div&gt;  var aResult = [];&lt;/div&gt;&lt;div&gt;  this.forEachRow(function(id){&lt;/div&gt;&lt;div&gt;    var cell=this.cells(id,0);&lt;/div&gt;&lt;div&gt;    if (cell.isCheckbox() &amp;amp;&amp;amp; cell.getValue()==1) {&lt;/div&gt;&lt;div&gt;      aResult[aResult.length] = id;&lt;/div&gt;&lt;div&gt;    }&lt;/div&gt;&lt;div&gt;  });&lt;/div&gt;&lt;div&gt;  return aResult;&lt;/div&gt;&lt;div&gt;}&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;//===to reload data of a page&lt;/div&gt;&lt;div&gt;mygrid.rowsBuffer = dhtmlxArray();&lt;/div&gt;&lt;div&gt;mygrid.changePage(this.currentPage);&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;//===to only allow expand of 1 subgrid&lt;/div&gt;&lt;div&gt;&lt;div&gt;//if expand row&lt;/div&gt;&lt;div&gt;mygrid.attachEvent("onSubRowOpen", function(expandId, status) {&lt;/div&gt;&lt;div&gt;  if (status) {&lt;/div&gt;&lt;div&gt;    mygrid.forEachRow(function(id){&lt;/div&gt;&lt;div&gt;      if (id!=expandId) {&lt;/div&gt;&lt;div&gt;        mygrid.cells(id, 0).close();&lt;/div&gt;&lt;div&gt;      }&lt;/div&gt;&lt;div&gt;    });&lt;/div&gt;&lt;div&gt;  }&lt;/div&gt;&lt;div&gt;});&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;//=== for custom sorting===//&lt;/div&gt;&lt;div&gt;&lt;div&gt;mygrid.attachEvent("onBeforeSorting",function(ind,type,direction){&lt;/div&gt;&lt;div&gt;  var iLimit = 10; //limit records / page&lt;/div&gt;&lt;div&gt;  var sSortDir = direction;&lt;/div&gt;&lt;div&gt;  var sSortBy = aRawCols[ind];&lt;/div&gt;&lt;div&gt;  var iOffset = (mygrid.currentPage-1)*iLimit;&lt;/div&gt;&lt;div&gt;  var sNewURL = "http://example.com/path_to_json_loader?&amp;amp;&lt;b&gt;count&lt;/b&gt;=" + iLimit + "&amp;amp;&lt;b&gt;posStart&lt;/b&gt;=" + iOffset + "&amp;amp;&lt;b&gt;dir&lt;/b&gt;="+sSortDir+"&amp;amp;&lt;b&gt;sort&lt;/b&gt;="+sSortBy;&lt;/div&gt;&lt;div&gt;  mygrid.load(sNewURL, "json");&lt;/div&gt;&lt;div&gt;  this.setSortImgState(true,ind,direction);//set a correct sorting image&lt;/div&gt;&lt;div&gt;  return false;&lt;/div&gt;&lt;div&gt;});&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Please note that, dhtmlxgrid loading behaviour is rather, "special case".&lt;/div&gt;&lt;div&gt;Most Grid will load data, and assume the data return is starting on index 0 from offset pass in,&lt;/div&gt;&lt;div&gt;but somehow, it skipped the records up to offset before collecting data for the new page.&lt;/div&gt;&lt;div&gt;even with posStart=2, your json data has to return postData of emty array of 2 before appending actual row of data.&lt;/div&gt;&lt;div&gt;Example:&lt;/div&gt;&lt;div&gt;[&lt;/div&gt;&lt;div&gt;  [],[], {id:3, name: "xxx"},...&lt;/div&gt;&lt;div&gt;]&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/163272026812479139-1564746138721921239?l=mercstudio-tech.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mercstudio-tech.blogspot.com/feeds/1564746138721921239/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=163272026812479139&amp;postID=1564746138721921239' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/163272026812479139/posts/default/1564746138721921239'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/163272026812479139/posts/default/1564746138721921239'/><link rel='alternate' type='text/html' href='http://mercstudio-tech.blogspot.com/2010/12/dhtmlx-grid-subgrid.html' title='DHTMLX Grid subgrid'/><author><name>James Tt</name><uri>https://profiles.google.com/103231744852638250560</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh3.googleusercontent.com/-S2vhoFMo-OY/AAAAAAAAAAI/AAAAAAAAAAA/Y8VfyxcHirI/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-163272026812479139.post-1200854900402740649</id><published>2010-12-18T07:00:00.000-08:00</published><updated>2010-12-18T07:08:23.147-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='javascript'/><category scheme='http://www.blogger.com/atom/ns#' term='subgrid'/><category scheme='http://www.blogger.com/atom/ns#' term='dhtmlx'/><category scheme='http://www.blogger.com/atom/ns#' term='grid'/><title type='text'>Grid with sub grid</title><content type='html'>Working with ExtJS grid was kind of cool. But if you need to have another grid within the grid, the Grid selection, checkbox and expand column become hair wire on ExtJS.&lt;br /&gt;I've tried several ways, but some how given up on it. Hope fully ExtJS 3.4 or higher could see the light on this feature...&lt;br /&gt;&lt;br /&gt;After searching around, DHTMLXGrid did serve the purpose pretty well.&lt;br /&gt;But the documentation is a bit confusing, need a bit of digging on the doc and the code in order to configure things up to what you might need.&lt;br /&gt;&lt;br /&gt;Reference:&lt;br /&gt;+ &lt;a href="http://docs.dhtmlx.com/doku.php?id=dhtmlxgrid:api_toc_alpha"&gt;http://docs.dhtmlx.com/doku.php?id=dhtmlxgrid:api_toc_alpha&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/163272026812479139-1200854900402740649?l=mercstudio-tech.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mercstudio-tech.blogspot.com/feeds/1200854900402740649/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=163272026812479139&amp;postID=1200854900402740649' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/163272026812479139/posts/default/1200854900402740649'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/163272026812479139/posts/default/1200854900402740649'/><link rel='alternate' type='text/html' href='http://mercstudio-tech.blogspot.com/2010/12/grid-with-sub-grid.html' title='Grid with sub grid'/><author><name>James Tt</name><uri>https://profiles.google.com/103231744852638250560</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh3.googleusercontent.com/-S2vhoFMo-OY/AAAAAAAAAAI/AAAAAAAAAAA/Y8VfyxcHirI/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-163272026812479139.post-2117967509256958828</id><published>2010-12-15T23:10:00.000-08:00</published><updated>2010-12-15T23:17:09.759-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='cms'/><category scheme='http://www.blogger.com/atom/ns#' term='modx'/><title type='text'>MODx 2.0.5 form customization for profile</title><content type='html'>The new form customisation for MODx 2.0.5-pl seems to only cater for resource create/update.&lt;br /&gt;&lt;br /&gt;If you need a form customization for user profile, you may do it by adding a plugin on initialized manager with event "OnManagerPageInit":&lt;br /&gt;-----------&lt;br /&gt;define("IS_PROFILE_MODULE", $_GET["a"] == 71? true: false);&lt;br /&gt;if (IS_PROFILE_MODULE) {&lt;br /&gt;  $modx-&gt;regClientStartupScript("url to your file.js",true);&lt;br /&gt;}&lt;br /&gt;-----------&lt;br /&gt;&lt;br /&gt;URL to your file.js:&lt;br /&gt;-----------&lt;br /&gt;Ext.onReady(function() {&lt;br /&gt;  doHideProfileTabs();&lt;br /&gt;});&lt;br /&gt;&lt;br /&gt;function doHideProfileTabs() {&lt;br /&gt;  if (!Ext.getCmp("modx-panel-profile-tabs")) {&lt;br /&gt;    setTimeout("doHideProfileTabs()", 1000);&lt;br /&gt;    return;&lt;br /&gt;  }&lt;br /&gt;  &lt;br /&gt;  MODx.hideTab("modx-panel-profile-tabs","modx-panel-profile-update");&lt;br /&gt;  MODx.hideTab("modx-panel-profile-tabs","modx-profile-recent-docs");&lt;br /&gt;  //MODx.hideTab("modx-panel-profile-tabs","ext-comp-1020"); //change password&lt;br /&gt;  Ext.getCmp("modx-panel-profile-tabs").setActiveTab(2);&lt;br /&gt;}&lt;br /&gt;-----------&lt;br /&gt;Please take note: The hidden tab is still in the tabs container, therefore setactivetab have to reflect the index of the original position.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/163272026812479139-2117967509256958828?l=mercstudio-tech.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mercstudio-tech.blogspot.com/feeds/2117967509256958828/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=163272026812479139&amp;postID=2117967509256958828' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/163272026812479139/posts/default/2117967509256958828'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/163272026812479139/posts/default/2117967509256958828'/><link rel='alternate' type='text/html' href='http://mercstudio-tech.blogspot.com/2010/12/modx-205-form-customization-for-profile.html' title='MODx 2.0.5 form customization for profile'/><author><name>James Tt</name><uri>https://profiles.google.com/103231744852638250560</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh3.googleusercontent.com/-S2vhoFMo-OY/AAAAAAAAAAI/AAAAAAAAAAA/Y8VfyxcHirI/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-163272026812479139.post-8739179563314714863</id><published>2010-12-15T02:55:00.001-08:00</published><updated>2010-12-15T03:05:52.523-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='cms'/><category scheme='http://www.blogger.com/atom/ns#' term='modx'/><title type='text'>MODx Updating to new version</title><content type='html'>files needed to copy:&lt;div&gt;core/* , except &lt;b&gt;core/cache, core/config&lt;/b&gt;&lt;br /&gt;&lt;div&gt;manager/*&lt;/div&gt;&lt;div&gt;connectors/*&lt;/div&gt;&lt;div&gt;setup/*&lt;/div&gt;&lt;div&gt;index.php&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" &gt;Remember to avoid copying:&lt;/span&gt;&lt;/div&gt;&lt;div&gt;core/&lt;b&gt;cache&lt;/b&gt;&lt;/div&gt;&lt;div&gt;core/&lt;b&gt;config&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/163272026812479139-8739179563314714863?l=mercstudio-tech.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mercstudio-tech.blogspot.com/feeds/8739179563314714863/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=163272026812479139&amp;postID=8739179563314714863' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/163272026812479139/posts/default/8739179563314714863'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/163272026812479139/posts/default/8739179563314714863'/><link rel='alternate' type='text/html' href='http://mercstudio-tech.blogspot.com/2010/12/modx-updating-to-new-version.html' title='MODx Updating to new version'/><author><name>James Tt</name><uri>https://profiles.google.com/103231744852638250560</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh3.googleusercontent.com/-S2vhoFMo-OY/AAAAAAAAAAI/AAAAAAAAAAA/Y8VfyxcHirI/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-163272026812479139.post-3532766341180943118</id><published>2010-12-10T02:26:00.000-08:00</published><updated>2010-12-10T07:04:23.617-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='cms'/><category scheme='http://www.blogger.com/atom/ns#' term='modx'/><title type='text'>Modx 2 getResources enhanced tvFilters</title><content type='html'>I've done some modification to getResources to accomodate more condition operators such as :&lt;div&gt;!=&lt;/div&gt;&lt;div&gt;EXISTS&lt;/div&gt;&lt;div&gt;NOTEXISTS&lt;/div&gt;&lt;div&gt;| : for OR operator&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;And changed that the condition will only effect after the main condition is meet, etc. published='1' and deleted='0'&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Examples:&lt;/div&gt;&lt;div&gt;tvFilters=`mytv!=%xxx%|mytv==NOTEXISTS`&lt;/div&gt;&lt;div&gt;#setting condition to TV mytv does not contain tag "xxx" or no mytv variable exists&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;getResources2.php&lt;/div&gt;&lt;div&gt;&lt;a href="http://www.mercstudio.net/assets/media/getResources2.php.zip"&gt;http://www.mercstudio.net/assets/media/getResources2.php.zip&lt;/a&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Hope it helps you guys :)&lt;/div&gt;&lt;div&gt;Cheers~&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/163272026812479139-3532766341180943118?l=mercstudio-tech.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mercstudio-tech.blogspot.com/feeds/3532766341180943118/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=163272026812479139&amp;postID=3532766341180943118' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/163272026812479139/posts/default/3532766341180943118'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/163272026812479139/posts/default/3532766341180943118'/><link rel='alternate' type='text/html' href='http://mercstudio-tech.blogspot.com/2010/12/modx-2-getresources-enhanced-tvfilters.html' title='Modx 2 getResources enhanced tvFilters'/><author><name>James Tt</name><uri>https://profiles.google.com/103231744852638250560</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh3.googleusercontent.com/-S2vhoFMo-OY/AAAAAAAAAAI/AAAAAAAAAAA/Y8VfyxcHirI/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-163272026812479139.post-5226243849051423382</id><published>2010-12-07T19:34:00.000-08:00</published><updated>2010-12-07T22:54:50.746-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='cms'/><category scheme='http://www.blogger.com/atom/ns#' term='modx'/><title type='text'>Modx 2 file manager + upload image on 2.0.4-pl2 or lower</title><content type='html'>File manager works well when you plan to use only "web" context for your manager users.&lt;br /&gt;But when it comes to using other context, you will realise that there are some permission issue related to context.&lt;br /&gt;&lt;br /&gt;To fix it temporary, until modx 2.0.5 is release, here is a fix.&lt;br /&gt;path:&lt;br /&gt;model/modx/processors/browser:&lt;br /&gt;&lt;br /&gt;*/directory/&lt;b&gt;getlist.php&lt;/b&gt; , */directory/&lt;b&gt;getfiles.php&lt;/b&gt; , */&lt;b&gt;file&lt;/b&gt;/&lt;b&gt;upload.php , &lt;/b&gt;*&lt;b&gt;/file/remove.php&lt;/b&gt;:&lt;br /&gt;Adding this somewhere at the top:&lt;br /&gt;&lt;b&gt;$context = !isset($scriptProperties['ctx']) ? "web": $scriptProperties['ctx'];&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;Change from:&lt;br /&gt;$root = $modx-&gt;fileHandler-&gt;getBasePath();&lt;br /&gt;To:&lt;br /&gt;$root = $modx-&gt;fileHandler-&gt;getBasePath(&lt;b&gt;false, $context&lt;/b&gt;);&lt;br /&gt;---------------&lt;br /&gt;Change from:&lt;br /&gt;$fileManagerUrl = $modx-&gt;fileHandler-&gt;getBaseUrl();&lt;br /&gt;To:&lt;br /&gt;$fileManagerUrl = $modx-&gt;fileHandler-&gt;getBaseUrl(&lt;b&gt;$context&lt;/b&gt;);&lt;br /&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/163272026812479139-5226243849051423382?l=mercstudio-tech.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mercstudio-tech.blogspot.com/feeds/5226243849051423382/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=163272026812479139&amp;postID=5226243849051423382' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/163272026812479139/posts/default/5226243849051423382'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/163272026812479139/posts/default/5226243849051423382'/><link rel='alternate' type='text/html' href='http://mercstudio-tech.blogspot.com/2010/12/modx-2-file-manager-upload-image-on-204.html' title='Modx 2 file manager + upload image on 2.0.4-pl2 or lower'/><author><name>James Tt</name><uri>https://profiles.google.com/103231744852638250560</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh3.googleusercontent.com/-S2vhoFMo-OY/AAAAAAAAAAI/AAAAAAAAAAA/Y8VfyxcHirI/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-163272026812479139.post-3519152785330662544</id><published>2010-12-01T23:32:00.001-08:00</published><updated>2010-12-07T22:43:26.971-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='modx'/><category scheme='http://www.blogger.com/atom/ns#' term='php'/><title type='text'>MODx 2 permissions for uploading image in resource editor</title><content type='html'>Minimum Requirement:&lt;div&gt;Context access:&lt;/div&gt;&lt;div&gt;Context: "mgr", min role: "member", &lt;/div&gt;&lt;div&gt;  access policies: "file_upload, file_manager"&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Context: "web/yourcontext", min role: "member",&lt;/div&gt;&lt;div&gt;access policies: "file_upload,file_list,file_update,file_remove"&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Optional access policy:&lt;/div&gt;&lt;div&gt;&lt;div&gt;directory_list&lt;/div&gt;&lt;div&gt;directory_update&lt;/div&gt;&lt;div&gt;directory_create&lt;/div&gt;&lt;div&gt;directory_remove&lt;/div&gt;&lt;div&gt;&lt;div&gt;directory_chmod&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/163272026812479139-3519152785330662544?l=mercstudio-tech.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mercstudio-tech.blogspot.com/feeds/3519152785330662544/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=163272026812479139&amp;postID=3519152785330662544' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/163272026812479139/posts/default/3519152785330662544'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/163272026812479139/posts/default/3519152785330662544'/><link rel='alternate' type='text/html' href='http://mercstudio-tech.blogspot.com/2010/12/modx-2-permissions-for-uploading-image.html' title='MODx 2 permissions for uploading image in resource editor'/><author><name>James Tt</name><uri>https://profiles.google.com/103231744852638250560</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh3.googleusercontent.com/-S2vhoFMo-OY/AAAAAAAAAAI/AAAAAAAAAAA/Y8VfyxcHirI/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-163272026812479139.post-4026774573334842470</id><published>2010-12-01T19:47:00.000-08:00</published><updated>2010-12-01T19:49:11.585-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='javascript'/><title type='text'>javascript string replace all?</title><content type='html'>Javascript String "replace" function only replace 1 instance of the string.&lt;br /&gt;If you need a replaceAll function, here is a handy function:&lt;br /&gt;&lt;br /&gt;function replaceAll(source, find, replace) {&lt;br /&gt; if (source == null) { return source; }&lt;br /&gt; var aString = source.split(find);&lt;br /&gt; return aString.join(replace);&lt;br /&gt;}&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/163272026812479139-4026774573334842470?l=mercstudio-tech.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mercstudio-tech.blogspot.com/feeds/4026774573334842470/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=163272026812479139&amp;postID=4026774573334842470' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/163272026812479139/posts/default/4026774573334842470'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/163272026812479139/posts/default/4026774573334842470'/><link rel='alternate' type='text/html' href='http://mercstudio-tech.blogspot.com/2010/12/javascript-string-replace-all.html' title='javascript string replace all?'/><author><name>James Tt</name><uri>https://profiles.google.com/103231744852638250560</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh3.googleusercontent.com/-S2vhoFMo-OY/AAAAAAAAAAI/AAAAAAAAAAA/Y8VfyxcHirI/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry></feed>
