<?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-1469618916373324201</id><updated>2012-02-16T10:56:28.768-08:00</updated><category term='javascript'/><category term='super'/><category term='UI'/><category term='disk'/><category term='Windows'/><category term='application'/><category term='traverse'/><category term='sub'/><category term='exclude'/><category term='GTK'/><category term='GUI'/><category term='inherit'/><category term='xampp'/><category term='standard'/><category term='cp'/><category term='Glade'/><category term='copy'/><category term='manipulate'/><category term='extension'/><category term='mix'/><category term='class'/><category term='link'/><category term='database'/><category term='apache'/><category term='linux'/><category term='xml'/><category term='scheme'/><category term='shell_exec'/><category term='colour'/><category term='LAMP'/><category term='select'/><category term='basic'/><category term='mysql'/><category term='tool'/><category term='php'/><category term='ajax'/><category term='records'/><category term='header'/><category term='stream'/><category term='random'/><category term='reset'/><category term='object'/><category term='store'/><category term='toolbar'/><category term='files'/><category term='orient'/><category term='rename'/><category term='simple'/><category term='extend'/><category term='bash'/><category term='button'/><category term='move'/><category term='GtkBuilder'/><category term='comet'/><category term='jquery'/><category term='server-push'/><category term='custom'/><category term='color'/><category term='symlink'/><category term='combobox'/><category term='blend'/><category term='HTML'/><category term='design'/><category term='symbolic'/><category term='error'/><category term='warning'/><category term='extjs'/><category term='prototype'/><title type='text'>The LAMPpost</title><subtitle type='html'>Tips and tricks for LAMP (Linux Apache MySQL PHP) developers.</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://thelampposts.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1469618916373324201/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://thelampposts.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Lilchef</name><uri>http://www.blogger.com/profile/05309198718613169438</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>13</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-1469618916373324201.post-6756656748016120608</id><published>2011-11-12T04:44:00.000-08:00</published><updated>2011-11-12T04:58:57.622-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='LAMP'/><category scheme='http://www.blogger.com/atom/ns#' term='mysql'/><category scheme='http://www.blogger.com/atom/ns#' term='bash'/><category scheme='http://www.blogger.com/atom/ns#' term='rename'/><category scheme='http://www.blogger.com/atom/ns#' term='move'/><category scheme='http://www.blogger.com/atom/ns#' term='database'/><title type='text'>Rename a MySQL database</title><content type='html'>Recently I needed to rename a MySQL database I was working with to make way for another with the same name. When I looked around for how to do this it seemed that the only option was to create the new database and then copy each table to it, via INSERT...SELECTs or a dump and import. It was quite a large database and this would have been very time consuming.&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;After discussing it with a colleague we came up with another way to do it by using bash to iterate over each table in the schema and then use the RENAME TABLE command:&lt;/div&gt;&lt;br /&gt;&lt;div style="background: #EEEEEE; font-family: 'Courier New'"&gt;for TABLE in `mysql -u[USERNAME] -p[PASSWORD] [OLD DB] -e "SHOW TABLES" -B -N -s`; do mysql -u[USERNAME] -p[PASSWORD] [OLD DB] -e "RENAME TABLE [OLD DB].$TABLE TO [NEW DB].$TABLE"; done;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;This worked a treat (I've been using my new database reliably for a while now) and was fast too!&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1469618916373324201-6756656748016120608?l=thelampposts.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://thelampposts.blogspot.com/feeds/6756656748016120608/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1469618916373324201&amp;postID=6756656748016120608' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1469618916373324201/posts/default/6756656748016120608'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1469618916373324201/posts/default/6756656748016120608'/><link rel='alternate' type='text/html' href='http://thelampposts.blogspot.com/2011/11/rename-mysql-database.html' title='Rename a MySQL database'/><author><name>Lilchef</name><uri>http://www.blogger.com/profile/05309198718613169438</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1469618916373324201.post-992950467110828422</id><published>2010-09-26T04:36:00.001-07:00</published><updated>2010-09-26T04:45:34.897-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='symbolic'/><category scheme='http://www.blogger.com/atom/ns#' term='symlink'/><category scheme='http://www.blogger.com/atom/ns#' term='Windows'/><category scheme='http://www.blogger.com/atom/ns#' term='link'/><category scheme='http://www.blogger.com/atom/ns#' term='xampp'/><category scheme='http://www.blogger.com/atom/ns#' term='apache'/><title type='text'>Symlinks in Windows</title><content type='html'>Not strictly a &lt;i&gt;L&lt;/i&gt;AMP tip this as it's for Windows but I found it useful recently.&lt;br /&gt;&lt;br /&gt;I'm using the rather awesome &lt;a href="http://www.apachefriends.org/en/xampp.html" target="_blank"&gt;XAMPP&lt;/a&gt; to do some development for one of my personal sites on my Windows machine and I wanted to symlink my codebase into XAMPP's equivalent of a 'public_html' folder (they call it 'htdocs'). I tried simply creating a shortcut but this doesn't work as a shortcut isn't a direct pointer but is a file in itself so Apache just tries to read that file.&lt;br /&gt;&lt;br /&gt;After much Googling I discovered that, since Vista, Microsoft have introduced a symlinking function, MKLINK:&lt;br /&gt;&lt;br /&gt;&lt;div style="font-family: 'Courier New';background:#eeeeee"&gt;&lt;br /&gt;MKLINK /D C:\path\to\link C:\path\to\target&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;The &lt;i&gt;/D&lt;/i&gt; specifies a link to a directory as the default is to a file.&lt;br /&gt;&lt;br /&gt;This worked a treat on my Windows 7 machine! Who knew Vista introduced something useful?! ;)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1469618916373324201-992950467110828422?l=thelampposts.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://thelampposts.blogspot.com/feeds/992950467110828422/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1469618916373324201&amp;postID=992950467110828422' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1469618916373324201/posts/default/992950467110828422'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1469618916373324201/posts/default/992950467110828422'/><link rel='alternate' type='text/html' href='http://thelampposts.blogspot.com/2010/09/symlinks-in-windows.html' title='Symlinks in Windows'/><author><name>Lilchef</name><uri>http://www.blogger.com/profile/05309198718613169438</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1469618916373324201.post-3034341772963532776</id><published>2010-04-19T11:32:00.000-07:00</published><updated>2010-04-19T11:40:14.001-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='tool'/><category scheme='http://www.blogger.com/atom/ns#' term='color'/><category scheme='http://www.blogger.com/atom/ns#' term='colour'/><category scheme='http://www.blogger.com/atom/ns#' term='design'/><category scheme='http://www.blogger.com/atom/ns#' term='blend'/><category scheme='http://www.blogger.com/atom/ns#' term='UI'/><category scheme='http://www.blogger.com/atom/ns#' term='scheme'/><category scheme='http://www.blogger.com/atom/ns#' term='GUI'/><category scheme='http://www.blogger.com/atom/ns#' term='mix'/><title type='text'>Colour Schemes</title><content type='html'>&lt;div&gt;This is more for designers than developers but some of us have to do both :)&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;When coming up with a colour scheme for a site or UI it's a good idea to use colours that &lt;a href="http://en.wikipedia.org/wiki/Complimentary_colors"&gt;compliment&lt;/a&gt; each other. This isn't just a design thing, it's partly mathematical and there are some sites out there that can calculate compatible colours for you.&lt;/div&gt;&lt;div&gt;This is a good example: &lt;a href="http://colorschemedesigner.com/"&gt;http://colorschemedesigner.com/&lt;/a&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Another thing that can be useful is the ability to blend two colours together. &lt;a href="http://meyerweb.com/eric/tools/color-blend/"&gt;http://meyerweb.com/eric/tools/color-blend/&lt;/a&gt; allows you to input two hex colour values and it will give you the resulting hex colour value.&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/1469618916373324201-3034341772963532776?l=thelampposts.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://thelampposts.blogspot.com/feeds/3034341772963532776/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1469618916373324201&amp;postID=3034341772963532776' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1469618916373324201/posts/default/3034341772963532776'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1469618916373324201/posts/default/3034341772963532776'/><link rel='alternate' type='text/html' href='http://thelampposts.blogspot.com/2010/04/colour-schemes.html' title='Colour Schemes'/><author><name>Lilchef</name><uri>http://www.blogger.com/profile/05309198718613169438</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1469618916373324201.post-7898260762574898281</id><published>2010-04-09T10:50:00.000-07:00</published><updated>2010-04-09T11:10:37.942-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='GTK'/><category scheme='http://www.blogger.com/atom/ns#' term='application'/><category scheme='http://www.blogger.com/atom/ns#' term='GtkBuilder'/><category scheme='http://www.blogger.com/atom/ns#' term='Windows'/><category scheme='http://www.blogger.com/atom/ns#' term='php'/><category scheme='http://www.blogger.com/atom/ns#' term='Glade'/><title type='text'>PHP-GTK Tips</title><content type='html'>I've been developing a PHP-GTK application over the past few months and have found that there are very few resources out there to help (the entire project seems a bit dead tbh..), however I have come across a few invaluable things that I thought I'd share:&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;a href="http://www.kksou.com/php-gtk2"&gt;php-gtk2 Cookbook&lt;/a&gt;: This is by far the best resource I have found. It has loads of examples and you can even look them up by widget type. It also has a help forum full of useful answers.&lt;/div&gt;&lt;div&gt;You have to register to see all of the code but it's free and I haven't had any spam as a result so I highly recommend it.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;a href="http://gtk.php.net/manual/en/reference.php"&gt;Official API documentation&lt;/a&gt;: This is a bit feeble but contains all the classes and methods (even if it doesn't explain them very well).&lt;/div&gt;&lt;div&gt;One thing to watch out for with this is that the class pages don't show you inherited methods (even from interfaces) so you have to read through the entire hierarchy to get the full picture.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;a href="http://glade.gnome.org/"&gt;Glade UI Designer&lt;/a&gt;: A handy tool for constructing interfaces for GTK. These produce an XML file which you can then read into your PHP code with the GTKBuilder class. Much nicer than having to create all of your interfaces in code.&lt;/div&gt;&lt;div&gt;Be wary though that it is a bit flakey (crashes sometimes) and it can only do so much for you, some of it will still need to be done in code.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;When looking for other resources remember that GTK isn't specific to PHP and so you may find more results for just searching for GTK stuff.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Hope that helped!&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1469618916373324201-7898260762574898281?l=thelampposts.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://thelampposts.blogspot.com/feeds/7898260762574898281/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1469618916373324201&amp;postID=7898260762574898281' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1469618916373324201/posts/default/7898260762574898281'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1469618916373324201/posts/default/7898260762574898281'/><link rel='alternate' type='text/html' href='http://thelampposts.blogspot.com/2010/04/php-gtk-tips.html' title='PHP-GTK Tips'/><author><name>Lilchef</name><uri>http://www.blogger.com/profile/05309198718613169438</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1469618916373324201.post-784955136391792333</id><published>2009-10-10T04:32:00.000-07:00</published><updated>2009-10-10T04:44:04.288-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='disk'/><category scheme='http://www.blogger.com/atom/ns#' term='random'/><category scheme='http://www.blogger.com/atom/ns#' term='mysql'/><category scheme='http://www.blogger.com/atom/ns#' term='linux'/><category scheme='http://www.blogger.com/atom/ns#' term='error'/><category scheme='http://www.blogger.com/atom/ns#' term='apache'/><title type='text'>No disk space causes random errors</title><content type='html'>I'm sure most of you are aware of this but it's something that always takes me a long time to remember.&lt;br /&gt;&lt;br /&gt;Whenever you have a seemingly random error on your Linux box - strange MySQL or Apache errors, being unable to write to a file that you could write to a moment ago, etc - always do a quick &lt;span style="background: rgb(238, 238, 238) none repeat scroll 0% 0%; -moz-background-clip: border; -moz-background-origin: padding; -moz-background-inline-policy: continuous;font-family:'Courier New';" &gt;df -h&lt;/span&gt; to check how much disk space you've got left.&lt;br /&gt;&lt;br /&gt;This problem is especially evident for those of us developing on virtual machines that often have limited disk space and so can run out easily. A quick recce of your &lt;span style="background: rgb(238, 238, 238) none repeat scroll 0% 0%; -moz-background-clip: border; -moz-background-origin: padding; -moz-background-inline-policy: continuous;font-family:'Courier New';" &gt;/var/log/&lt;/span&gt; (or equivalent) directory is a good starting point for freeing up space but you may also want to try &lt;span style="background: rgb(238, 238, 238) none repeat scroll 0% 0%; -moz-background-clip: border; -moz-background-origin: padding; -moz-background-inline-policy: continuous;font-family:'Courier New';" &gt;find / -type f -size +50000k&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1469618916373324201-784955136391792333?l=thelampposts.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://thelampposts.blogspot.com/feeds/784955136391792333/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1469618916373324201&amp;postID=784955136391792333' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1469618916373324201/posts/default/784955136391792333'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1469618916373324201/posts/default/784955136391792333'/><link rel='alternate' type='text/html' href='http://thelampposts.blogspot.com/2009/10/no-disk-space-causes-random-errors.html' title='No disk space causes random errors'/><author><name>Lilchef</name><uri>http://www.blogger.com/profile/05309198718613169438</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1469618916373324201.post-4877123468259174947</id><published>2009-08-12T11:16:00.000-07:00</published><updated>2009-08-12T11:32:24.792-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='reset'/><category scheme='http://www.blogger.com/atom/ns#' term='records'/><category scheme='http://www.blogger.com/atom/ns#' term='extjs'/><category scheme='http://www.blogger.com/atom/ns#' term='store'/><title type='text'>ExtJS Store Reset</title><content type='html'>I recently discovered something rather annoying about &lt;a href="http://www.extjs.com"&gt;ExtJS&lt;/a&gt; Stores.&lt;br /&gt;You may know that you can request all of the modified Records from a Store with something like:&lt;br /&gt;&lt;br /&gt;&lt;div style="background: #EEEEEE; font-family: 'Courier New'"&gt;var arr_modified = obj_store.getModifiedRecords();&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;This can be very useful if you have a lot of Records but only want to perform actions on the ones that have been edited by the user.&lt;br /&gt;However, what I didn't realise is that the modified Records are held separately so that if you empty the Store (by calling &lt;i&gt;removeAll()&lt;/i&gt;) and repopulate it then call &lt;i&gt;getModifedRecords()&lt;/i&gt; again not only do you get any modified Records from the new batch but from the old batch also.&lt;br /&gt;&lt;br /&gt;The remedy to this is quite simple, upon emptying the Store you must also call &lt;i&gt;rejectChanges()&lt;/i&gt; which clears the cache of changed Records (this is complimentary to &lt;i&gt;commitChanges()&lt;/i&gt; which performs basically the same action but for a different reason).&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1469618916373324201-4877123468259174947?l=thelampposts.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://thelampposts.blogspot.com/feeds/4877123468259174947/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1469618916373324201&amp;postID=4877123468259174947' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1469618916373324201/posts/default/4877123468259174947'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1469618916373324201/posts/default/4877123468259174947'/><link rel='alternate' type='text/html' href='http://thelampposts.blogspot.com/2009/08/extjs-store-reset.html' title='ExtJS Store Reset'/><author><name>Lilchef</name><uri>http://www.blogger.com/profile/05309198718613169438</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1469618916373324201.post-7872290320407796661</id><published>2009-02-06T11:06:00.000-08:00</published><updated>2009-02-06T11:17:52.783-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='shell_exec'/><category scheme='http://www.blogger.com/atom/ns#' term='warning'/><category scheme='http://www.blogger.com/atom/ns#' term='error'/><category scheme='http://www.blogger.com/atom/ns#' term='php'/><title type='text'>"shell_exec(): Unable to execute"</title><content type='html'>I spent ages trying to get round this PHP warning today:&lt;br /&gt;&lt;br /&gt;&lt;div style="font-family: 'Courier New'; background: #eeeeee;"&gt;"PHP Warning:  shell_exec(): Unable to execute '[any bash command]'"&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;I hadn't changed anything and it was working 5mins before so what was wrong?&lt;br /&gt;&lt;br /&gt;A colleague of mine suggested restarting Apache... and it worked!&lt;br /&gt;I don't fully understand why, something to do with Apache running out of resources or something. Anywho, thought it might be useful for someone.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1469618916373324201-7872290320407796661?l=thelampposts.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://thelampposts.blogspot.com/feeds/7872290320407796661/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1469618916373324201&amp;postID=7872290320407796661' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1469618916373324201/posts/default/7872290320407796661'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1469618916373324201/posts/default/7872290320407796661'/><link rel='alternate' type='text/html' href='http://thelampposts.blogspot.com/2009/02/shellexec-unable-to-execute.html' title='&quot;shell_exec(): Unable to execute&quot;'/><author><name>Lilchef</name><uri>http://www.blogger.com/profile/05309198718613169438</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1469618916373324201.post-6888591764706815785</id><published>2008-06-10T11:03:00.000-07:00</published><updated>2008-06-15T02:27:06.268-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='comet'/><category scheme='http://www.blogger.com/atom/ns#' term='ajax'/><category scheme='http://www.blogger.com/atom/ns#' term='stream'/><category scheme='http://www.blogger.com/atom/ns#' term='server-push'/><title type='text'>Comet server-push framework</title><content type='html'>I've just been asked to look into a way to 'stream' information from the server to any listening clients. Basically it's a &lt;a href="http://en.wikipedia.org/wiki/Push_technology" target="_blank"&gt;server-push&lt;/a&gt; rather than &lt;a href="http://en.wikipedia.org/wiki/Pull_technology" target="_blank"&gt;client-pull&lt;/a&gt; system where changes made on one client are (almost) immediately reflected on all other clients. This is similar to AJAX in that there is no page refresh but it is more autonomous.&lt;br /&gt;&lt;br /&gt;I've been reading up on &lt;a href="http://en.wikipedia.org/wiki/Comet_%28programming%29" target="_blank"&gt;Comet&lt;/a&gt;, which is basically just a term for a kind of AJAX solution to this problem, but it doesn't specify any implementation suggestions.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://svn.xantus.org/shortbus/trunk/bayeux/bayeux.html" target="_blank"&gt;Bayeux&lt;/a&gt; takes this a step further by actually outlining a protocol for message transfer between client and server.&lt;br /&gt;&lt;br /&gt;Most implementations on the server-side are in Java but we need PHP. I've tracked down a PHP implementation called &lt;a href="http://sourceforge.net/projects/comet/" target="_blank"&gt;Comep&lt;/a&gt; that works quite well on the server-side (although its procedural rather than OO based) and I'm going to look into replacing its vanilla-javascript client-side with this &lt;a href="http://plugins.jquery.com/project/Comet" target="_blank"&gt;jQuery Comet plugin&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;For any other LAMP developers interested in Comet a good place to start is the &lt;a href="http://cometdaily.com/" target="_blank"&gt;Comet Daily Blog&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Update, 2008-06-15:&lt;/b&gt; Although PERL rather than PHP based it is also worth mentioning &lt;a href="http://meteorserver.org/"&gt;Meteor&lt;/a&gt;, which is a highly polished comet server implementation.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1469618916373324201-6888591764706815785?l=thelampposts.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://thelampposts.blogspot.com/feeds/6888591764706815785/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1469618916373324201&amp;postID=6888591764706815785' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1469618916373324201/posts/default/6888591764706815785'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1469618916373324201/posts/default/6888591764706815785'/><link rel='alternate' type='text/html' href='http://thelampposts.blogspot.com/2008/06/comet-server-push-framework.html' title='Comet server-push framework'/><author><name>Lilchef</name><uri>http://www.blogger.com/profile/05309198718613169438</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1469618916373324201.post-5871789163599143122</id><published>2008-05-01T11:52:00.000-07:00</published><updated>2008-05-01T12:24:46.847-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='custom'/><category scheme='http://www.blogger.com/atom/ns#' term='extjs'/><category scheme='http://www.blogger.com/atom/ns#' term='header'/><category scheme='http://www.blogger.com/atom/ns#' term='toolbar'/><category scheme='http://www.blogger.com/atom/ns#' term='button'/><title type='text'>Custom ExtJS header buttons</title><content type='html'>&lt;a href="http://www.extjs.com"&gt;ExtJS&lt;/a&gt; Panels can have a limited range of buttons on the header bar but what if you want a custom button? These can be added to a toolbar just underneath the header but if space is at a premium or perhaps you only want one button it's not always ideal.&lt;br /&gt;&lt;br /&gt;One solution is to have no header and just make the toolbar look like a header:&lt;br /&gt;&lt;br /&gt;&lt;div style="font-family: 'Courier New'; background: #eeeeee;"&gt;var obj_panel = new Ext.Panel({&lt;br /&gt;&amp;nbsp;tbar: new Ext.Toolbar({&lt;br /&gt;// make the toolbar background look like a header&lt;br /&gt;&amp;nbsp;cls: 'x-panel-header',&lt;br /&gt;&amp;nbsp;height: 25,&lt;br /&gt;&amp;nbsp;items: [&lt;br /&gt;// give the toolbar a title which looks like a Panel title&lt;br /&gt;&amp;nbsp;&amp;nbsp;'&amp;lt;span style="color:#15428B; font-weight:bold"&amp;gt;Title Here&amp;lt;/span&amp;gt;',&lt;br /&gt;&amp;nbsp;&amp;nbsp;'-&gt;', //fill element&lt;br /&gt;&amp;nbsp;&amp;nbsp;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;text: 'Button Text',&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;iconCls: 'add',  // optional icon class&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;handler: function() {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;// do stuff here&lt;br /&gt;&amp;nbsp;&amp;nbsp;}&lt;br /&gt;&amp;nbsp;},' ']&lt;br /&gt;&amp;nbsp;}),&lt;br /&gt;// ...&lt;br /&gt;});&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;(The styles used above fit the standard ExtJS theme)&lt;br /&gt;&lt;br /&gt;This produces something like this:&lt;br /&gt;&lt;img src="http://images.lilchef.co.uk/header_toolbar.jpg" width="409" height="87" style="border: 0px; padding: 0px;" /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1469618916373324201-5871789163599143122?l=thelampposts.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://thelampposts.blogspot.com/feeds/5871789163599143122/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1469618916373324201&amp;postID=5871789163599143122' title='7 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1469618916373324201/posts/default/5871789163599143122'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1469618916373324201/posts/default/5871789163599143122'/><link rel='alternate' type='text/html' href='http://thelampposts.blogspot.com/2008/05/custom-extjs-header-buttons.html' title='Custom ExtJS header buttons'/><author><name>Lilchef</name><uri>http://www.blogger.com/profile/05309198718613169438</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>7</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1469618916373324201.post-402924280773911499</id><published>2008-04-19T03:57:00.000-07:00</published><updated>2008-04-19T04:42:53.867-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='javascript'/><category scheme='http://www.blogger.com/atom/ns#' term='super'/><category scheme='http://www.blogger.com/atom/ns#' term='class'/><category scheme='http://www.blogger.com/atom/ns#' term='extend'/><category scheme='http://www.blogger.com/atom/ns#' term='object'/><category scheme='http://www.blogger.com/atom/ns#' term='prototype'/><category scheme='http://www.blogger.com/atom/ns#' term='sub'/><category scheme='http://www.blogger.com/atom/ns#' term='inherit'/><category scheme='http://www.blogger.com/atom/ns#' term='orient'/><title type='text'>Extending classes in JavaScript</title><content type='html'>There are many different ways to achieve Object Orientation in JavaScript and the Internet is littered with examples.&lt;br /&gt;&lt;br /&gt;&lt;a href="jquery.com"&gt;jQuery&lt;/a&gt; Uses an extend method within the super-class that allows you to add functionality onto an &lt;span style="font-weight:bold;"&gt;instance&lt;/span&gt; of that class, creating a kind of sub-class (although it is an object):&lt;br /&gt;&lt;br /&gt;&lt;div style="background: #FFCCFF; font-family: 'Courier New'"&gt;function SuperClass() {}&lt;br /&gt;SuperClass.prototype = {&lt;br /&gt; // ...&lt;br /&gt; extend: function() {&lt;br /&gt; &amp;nbsp;var int_count = 0;&lt;br /&gt; &amp;nbsp;var arr_prop;&lt;br /&gt; &amp;nbsp;while ( (arr_prop = arguments[int_count++]) != null ) {&lt;br /&gt; &amp;nbsp;&amp;nbsp;for ( var i in arr_prop ) {&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;this[i] = arr_prop[i];&lt;br /&gt; &amp;nbsp;&amp;nbsp;}&lt;br /&gt; &amp;nbsp;}&lt;br /&gt; &amp;nbsp;// Return the modified object&lt;br /&gt; &amp;nbsp;return this;&lt;br /&gt; }  &lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;// ...&lt;br /&gt;&lt;br /&gt;var obj_subclass = new SuperClass();&lt;br /&gt;obj_subclass.extend({&lt;br /&gt; foo: 'bar',&lt;br /&gt; // ...&lt;br /&gt;});&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;This is quick and dirty but not proper OO and if you want several instances of the 'sub-class' you need to call extend on each one.&lt;br /&gt;&lt;br /&gt;You probably already know that to add member variables/methods to a class you assign them to its &lt;span style="font-style:italic;"&gt;prototype&lt;/span&gt; property. This can be one value at a time:&lt;br /&gt;&lt;br /&gt;&lt;div style="background: #FFCCFF; font-family: 'Courier New'"&gt;function SuperClass() {}&lt;br /&gt;SuperClass.prototype.foo = 'bar';&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;Or a simple object can be assigned:&lt;br /&gt;&lt;br /&gt;&lt;div style="background: #FFCCFF; font-family: 'Courier New'"&gt;function SuperClass() {}&lt;br /&gt;SuperClass.prototype = {&lt;br /&gt;&amp;nbsp;foo: 'bar',&lt;br /&gt;&amp;nbsp;x: 'y',&lt;br /&gt;&amp;nbsp;super_func: function() {&lt;br /&gt;&amp;nbsp;//...&lt;br /&gt;&amp;nbsp;}&lt;br /&gt;}&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;A good way to simulate inheritance is to assign an instance of the super-class to the sub-class' prototype &lt;a href="http://www.devarticles.com/c/a/JavaScript/Object-Oriented-JavaScript-Using-the-Prototype-Property/2/"&gt;example here&lt;/a&gt;:&lt;br /&gt;&lt;br /&gt;&lt;div style="background: #FFCCFF; font-family: 'Courier New'"&gt;var obj_super = new SuperClass();&lt;br /&gt;function SubClass() {}&lt;br /&gt;SubClass.prototype = obj_super;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;This means that all member variables/functions of SuperClass are now contained within SubClass' prototype.&lt;br /&gt;&lt;br /&gt;In order to now extend SuperClass' functionality in SubClass we revert back to adding one new thing at a time with &lt;span style="font-style:italic;"&gt;SubClass.prototype.sub_func = function() { //... }&lt;/span&gt;. This is fine but if you plan on adding a lot more stuff it's not ideal.&lt;br /&gt;&lt;br /&gt;The solution I have come up with &lt;span style="font-style:italic;"&gt;(I say "I", maybe other people do this but I can't find any mention of it on the net)&lt;/span&gt; is to combine the two methods above:&lt;br /&gt;&lt;br /&gt;&lt;div style="background: #EEEEEE; font-family: 'Courier New'"&gt;var obj_super = new SuperClass();&lt;br /&gt;function SubClass() {}&lt;br /&gt;SubClass.prototype = obj_super.extend({&lt;br /&gt;&amp;nbsp;foo: 'bar',&lt;br /&gt;&amp;nbsp;sub_func: function() { //... },&lt;br /&gt;&amp;nbsp;// ...&lt;br /&gt;});&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;This way we are still creating a proper sub-class and inheriting the super-classes functionality whilst conveniently adding our own.&lt;br /&gt;&lt;span style="font-style:italic;"&gt;&lt;br /&gt;Note: You can call super-class methods directly from within the sub-class with SuperClass.prototype.super_func.call(this, arg1, arg2, argN);&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1469618916373324201-402924280773911499?l=thelampposts.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://thelampposts.blogspot.com/feeds/402924280773911499/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1469618916373324201&amp;postID=402924280773911499' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1469618916373324201/posts/default/402924280773911499'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1469618916373324201/posts/default/402924280773911499'/><link rel='alternate' type='text/html' href='http://thelampposts.blogspot.com/2008/04/extending-classes-in-javascript.html' title='Extending classes in JavaScript'/><author><name>Lilchef</name><uri>http://www.blogger.com/profile/05309198718613169438</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1469618916373324201.post-6192785655189485010</id><published>2008-04-09T12:20:00.000-07:00</published><updated>2008-04-09T13:04:16.073-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='javascript'/><category scheme='http://www.blogger.com/atom/ns#' term='combobox'/><category scheme='http://www.blogger.com/atom/ns#' term='standard'/><category scheme='http://www.blogger.com/atom/ns#' term='extjs'/><category scheme='http://www.blogger.com/atom/ns#' term='simple'/><category scheme='http://www.blogger.com/atom/ns#' term='basic'/><category scheme='http://www.blogger.com/atom/ns#' term='select'/><category scheme='http://www.blogger.com/atom/ns#' term='HTML'/><title type='text'>Creating a basic select box in ExtJS</title><content type='html'>&lt;style&gt;.comment { color: #999999; font-size: 0.8em; }&lt;/style&gt;&lt;br /&gt;I'm currently working on a project that involves generating an entirely &lt;a href="http://www.extjs.com"&gt;ExtJS&lt;/a&gt;-based interface from PHP code.&lt;br /&gt;&lt;br /&gt;I needed to be able to produce in ExtJS the equivelent of a standard HTML &lt;span style="font-style:italic;"&gt;&amp;lt;select&amp;gt;&lt;/span&gt; box. This can be achieved with a &lt;span style="font-style:italic;"&gt;ComboBox&lt;/span&gt;, however, it seems that ComboBoxes are heavily geared towards doing lots of clever things like loading in options over AJAX, allowing the user to type in their own options, auto-completing typed in options, etc. That's all great but if all you want is a standard drop-down with a predefined set of options it takes a bit of work.&lt;br /&gt;&lt;br /&gt;I incorrectly assumed that something like the following would work:&lt;br /&gt;&lt;div style="font-family: 'Courier New'; background: #ffccff;"&gt;obj_combo = new Ext.form.ComboBox({&lt;br /&gt;&amp;nbsp;name: 'countries',&lt;br /&gt;&amp;nbsp;items: [&lt;br /&gt;&amp;nbsp;&amp;nbsp;{value: '1', text: 'UK'},&lt;br /&gt;&amp;nbsp;&amp;nbsp;{value: '2', text: 'US'},&lt;br /&gt;&lt;span style="font-style:italic;" class="comment"&gt;// ...&lt;/span&gt;&lt;br /&gt;]&lt;br /&gt;});&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;Unfortunaltey, it's not that simple.&lt;br /&gt;&lt;br /&gt;Here's an example of the actual code required:&lt;br /&gt;&lt;div style="font-family: 'Courier New'; background: #eeeeee;"&gt;obj_combo = new Ext.form.ComboBox({&lt;br /&gt;&amp;nbsp;name: 'countries',&lt;br /&gt;&lt;span style="font-style:italic;" class="comment"&gt;// Stop users being able to type in the combobox&lt;/span&gt;&lt;br /&gt;&amp;nbsp;editable: false,&lt;br /&gt;&lt;span style="font-style:italic;" class="comment"&gt;// Even though the user cant type any more&lt;br /&gt;// once they select one option it'll remove any&lt;br /&gt;// others that don't start with the same letters&lt;br /&gt;// unless we turn off filtering&lt;/span&gt;&lt;br /&gt;&amp;nbsp;disableKeyFilter: true,&lt;br /&gt;&lt;span style="font-style:italic;" class="comment"&gt;// Only allow users to pick an option that exists&lt;br /&gt;// in the list of options (not one of their own)&lt;/span&gt;&lt;br /&gt;&amp;nbsp;forceSelection: true,&lt;br /&gt;&lt;span style="font-style:italic;" class="comment"&gt;// This isn't entirely necessary but the combox&lt;br /&gt;// will start off blank otherwise&lt;/span&gt;&lt;br /&gt;&amp;nbsp;emptyText: '--select one--',&lt;br /&gt;&lt;span style="font-style:italic;" class="comment"&gt;// This one's vital: when the user clicks on the&lt;br /&gt;// drop-down show ALL options&lt;/span&gt;&lt;br /&gt;&amp;nbsp;triggerAction: 'all',&lt;br /&gt;&lt;span style="font-style:italic;" class="comment"&gt;// By default it retrieves remote data,&lt;br /&gt;// we're using local data&lt;/span&gt;&lt;br /&gt;&amp;nbsp;mode: 'local',&lt;br /&gt;&lt;span style="font-style:italic;" class="comment"&gt;// ComboBox will only accept data from a Store&lt;br /&gt;// so we have to create a basic one&lt;/span&gt;&lt;br /&gt;&amp;nbsp;store: new Ext.data.SimpleStore({&lt;br /&gt;&amp;nbsp;&amp;nbsp;id: 0,&lt;br /&gt;&amp;nbsp;&amp;nbsp;fields: ['value', 'text'],&lt;br /&gt;&amp;nbsp;&amp;nbsp;data : [['1', 'UK'], ['2', 'US']]&lt;br /&gt;&amp;nbsp;}),&lt;br /&gt;&lt;span style="font-style:italic;" class="comment"&gt;// Specify which fields in the store hold&lt;br /&gt;// the value and the display text&lt;/span&gt;&lt;br /&gt;&amp;nbsp;valueField: 'value',&lt;br /&gt;&amp;nbsp;displayField: 'text',&lt;br /&gt;&lt;span style="font-style:italic;" class="comment"&gt;// Important: by default the POST/GET data&lt;br /&gt;// for this item will contain the &lt;b&gt;display text&lt;/b&gt;&lt;br /&gt;// not the value. This option creates a hidden field&lt;br /&gt;// with the same name as the dropdown containing the&lt;br /&gt;// selected value so it is that which gets returned&lt;/span&gt;&lt;br /&gt;&amp;nbsp;hiddenName: 'countries'&lt;br /&gt;});&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;With all those set (plus any of your own) you should have the equivalent of an HTML select box in ExtJS.&lt;br /&gt;&lt;br /&gt;For good examples of different ComboBoxes (but unfortunately little explanation of them) check this link:&lt;br /&gt;&lt;a href="http://extjs.com/deploy/ext/examples/form/combos.html"&gt;http://extjs.com/deploy/ext/examples/form/combos.html&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1469618916373324201-6192785655189485010?l=thelampposts.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://thelampposts.blogspot.com/feeds/6192785655189485010/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1469618916373324201&amp;postID=6192785655189485010' title='7 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1469618916373324201/posts/default/6192785655189485010'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1469618916373324201/posts/default/6192785655189485010'/><link rel='alternate' type='text/html' href='http://thelampposts.blogspot.com/2008/04/creating-basic-select-box-in-extjs.html' title='Creating a basic select box in ExtJS'/><author><name>Lilchef</name><uri>http://www.blogger.com/profile/05309198718613169438</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>7</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1469618916373324201.post-1425991832894660565</id><published>2008-04-04T12:46:00.000-07:00</published><updated>2008-04-04T13:18:18.687-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='traverse'/><category scheme='http://www.blogger.com/atom/ns#' term='jquery'/><category scheme='http://www.blogger.com/atom/ns#' term='manipulate'/><category scheme='http://www.blogger.com/atom/ns#' term='xml'/><category scheme='http://www.blogger.com/atom/ns#' term='extjs'/><category scheme='http://www.blogger.com/atom/ns#' term='select'/><title type='text'>Traversing XML in ExtJS</title><content type='html'>We've just started using the JavaScript &lt;a href="http://www.extjs.com"&gt;ExtJS&lt;/a&gt; framework for a new project and whilst it is very good at presentational stuff we have found it to be lacking in the DOM manipulation and traversal department.&lt;br /&gt;&lt;br /&gt;We use XML a lot to send data back and forth and so we needed to use that instead of ExtJS' preferred JSON. That in itself is fine, ExtJS provides an XmlReader class that can interpret XML. However, this is geared towards reading in a result set for use in a grid, etc. We wanted to simply return some messages and get ExtJS to read them.&lt;br /&gt;Not impossible I'm sure but we we're struggling with it.&lt;br /&gt;&lt;br /&gt;Long story short: we decided to use &lt;a href="http://jquery.com"&gt;jQuery&lt;/a&gt; for that bit :)&lt;br /&gt;We were already very familiar with jQuery and where it is not as good at presentation as ExtJS it makes up for it in it's superior (imo) DOM traversal and manipulation.&lt;br /&gt;&lt;br /&gt;ExtJS and jQuery can co-exist quite peacefully so this was no problem, here's a sample:&lt;br /&gt;&lt;br /&gt;&lt;div style="background:#eeeeee;font-family:'Courier New';"&gt;Ext.Ajax.request({&lt;br /&gt;&amp;nbsp;// ..&lt;br /&gt;&amp;nbsp;// success and failure functions are passed&lt;br /&gt;&amp;nbsp;// the XMLHTTPRequest object&lt;br /&gt;&amp;nbsp;success: function(obj_response) {&lt;br /&gt;&amp;nbsp;&amp;nbsp;var str_val=$('mynode',obj_response.responseXML).text();&lt;br /&gt;&amp;nbsp;&amp;nbsp;alert(str_val);&lt;br /&gt;&amp;nbsp;}&lt;br /&gt;&amp;nbsp;// ...&lt;br /&gt;});&lt;br /&gt;&lt;/div&gt;&lt;span style="font-size:80%"&gt;(This assumes that, somewhere, you're including both the ExtJS and jQuery library js files)&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;This would work for:&lt;br /&gt;&lt;br /&gt;&lt;div style="background:#eeeeee;font-family:'Courier New';"&gt;&amp;lt;?xml version='1.0'?&amp;gt;&lt;br /&gt;&amp;lt;mynode&amp;gt;This would be the output&amp;lt;/mynode&amp;gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;Again, I'm sure ExtJS can do something similar but I couldn't get it to work.&lt;br /&gt;&lt;br /&gt;Bear in mind that other ExtJS classes that can make AJAX calls sometimes pass the success and fail functions another object which contains the XMLHTTPRequest object, so the call is something like &lt;span style="font-style:italic;"&gt;obj_response.response.responseXML&lt;/span&gt;. Check the &lt;a href="http://extjs.com/deploy/dev/docs/"&gt;ExtJS API Docs&lt;/a&gt; for more.&lt;br /&gt;&lt;br /&gt;If you are familiar with ExtJS and not jQuery, or vice-versa, I'd highly recommend reading up on both :)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1469618916373324201-1425991832894660565?l=thelampposts.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://thelampposts.blogspot.com/feeds/1425991832894660565/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1469618916373324201&amp;postID=1425991832894660565' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1469618916373324201/posts/default/1425991832894660565'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1469618916373324201/posts/default/1425991832894660565'/><link rel='alternate' type='text/html' href='http://thelampposts.blogspot.com/2008/04/traversing-xml-in-extjs.html' title='Traversing XML in ExtJS'/><author><name>Lilchef</name><uri>http://www.blogger.com/profile/05309198718613169438</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1469618916373324201.post-6567599071662420461</id><published>2008-04-04T12:11:00.000-07:00</published><updated>2008-04-04T12:31:02.517-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='files'/><category scheme='http://www.blogger.com/atom/ns#' term='extension'/><category scheme='http://www.blogger.com/atom/ns#' term='exclude'/><category scheme='http://www.blogger.com/atom/ns#' term='copy'/><category scheme='http://www.blogger.com/atom/ns#' term='bash'/><category scheme='http://www.blogger.com/atom/ns#' term='cp'/><title type='text'>Exclude certain files from a cp command</title><content type='html'>I needed to be able to exclude files with a certain extension from a &lt;span style="font-style: italic;"&gt;cp&lt;/span&gt; command that was going to be executed automatically as part of a much larger script.&lt;br /&gt;&lt;br /&gt;There doesn't seem to be any direct way to do this (e.g. &lt;span style="font-style: italic;"&gt;cp --exclude&lt;/span&gt;...) and although there are several suggestions on the net on how to overcome this I found the neatest way was to use the &lt;span style="font-style: italic;"&gt;tar&lt;/span&gt; command instead:&lt;br /&gt;&lt;div style="font-family: 'Courier New';background:#eeeeee"&gt;cd /copy/from/path&lt;br /&gt;tar -czf /path/to/archive.tar.gz ./ --exclude=*.txt&lt;br /&gt;cd /copy/to/path&lt;br /&gt;tar -xzvf /path/to/archive.tar.gz&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;Of course this isn't ideal, creating a tar archive when it isn't necessary but the files I needed to copy weren't large and so it was nice and quick and dirty.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1469618916373324201-6567599071662420461?l=thelampposts.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://thelampposts.blogspot.com/feeds/6567599071662420461/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1469618916373324201&amp;postID=6567599071662420461' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1469618916373324201/posts/default/6567599071662420461'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1469618916373324201/posts/default/6567599071662420461'/><link rel='alternate' type='text/html' href='http://thelampposts.blogspot.com/2008/04/exclude-certain-files-from-cp-command.html' title='Exclude certain files from a cp command'/><author><name>Lilchef</name><uri>http://www.blogger.com/profile/05309198718613169438</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry></feed>
