<?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-3937429925313843721</id><updated>2012-02-04T06:53:31.903+11:00</updated><category term='Visual Studio'/><category term='synergy'/><category term='Novell'/><category term='mirc'/><category term='funny'/><category term='malware'/><category term='migrate'/><category term='adobe'/><category term='MyBB'/><category term='netgear'/><category term='logitech'/><category term='windows 7'/><category term='dell'/><category term='firefox'/><category term='mac osx'/><category term='Marvel Ultimate Alliance'/><category term='twitterfeed'/><category term='css'/><category term='windows xp'/><category term='git'/><category term='ati'/><category term='billion'/><category term='jquery ui'/><category term='rss'/><category term='portal'/><category term='.net'/><category term='unicode'/><category term='acma'/><category term='eclipse'/><category term='google plus'/><category term='greasemonkey'/><category term='opera'/><category term='netlimiter'/><category term='facebook'/><category term='postgres sql'/><category term='ps3'/><category term='java'/><category term='mysql'/><category term='logic'/><category term='vmware'/><category term='think tank'/><category term='sansa c250'/><category term='putty'/><category term='dual action'/><category term='django'/><category term='bash'/><category term='dyndns'/><category term='wordpress'/><category term='australia'/><category term='internet censorship'/><category term='batch'/><category term='left 4 dead 2'/><category term='windows 8'/><category term='sftpdrive'/><category term='harddrive'/><category term='android'/><category term='digsby'/><category term='flickr'/><category term='digg'/><category term='software'/><category term='html'/><category term='m1330'/><category term='remote desktop'/><category term='Steam'/><category term='songbird'/><category term='disable'/><category term='winamp'/><category term='diablo 2'/><category term='Lotus Notes'/><category term='hp'/><category term='remove'/><category term='samsung galaxy s'/><category term='subversion'/><category term='windows vista'/><category term='javascript'/><category term='map network drive'/><category term='utorrent'/><category term='starcraft 2'/><category term='apple'/><category term='opendns'/><category term='tomtom'/><category term='youtube'/><category term='expandrive'/><category term='daemon tools'/><category term='Need For Speed'/><category term='C++'/><category term='search engine optimisation'/><category term='bulletstorm'/><category term='belkin'/><category term='Blizzard'/><category term='msn'/><category term='excel'/><category term='nokia'/><category term='python'/><category term='windows'/><category term='dos'/><category term='nod32'/><category term='thunderbird'/><category term='hardware'/><category term='update'/><category term='apache'/><category term='linux'/><category term='rockman x7'/><category term='mootools'/><category term='router'/><category term='hackintosh'/><category term='windows media player'/><category term='office'/><category term='vi'/><category term='internet explorer'/><category term='php'/><category term='phpmyadmin'/><category term='acdsee'/><category term='ssh'/><category term='optus'/><category term='wii'/><category term='nero'/><category term='website'/><category term='C#'/><category term='regex'/><category term='jquery'/><category term='atomic bomberman'/><category term='acrobat'/><category term='eee pc'/><category term='navman'/><category term='blogger'/><category term='mobile development'/><category term='child pornography'/><category term='sql'/><category term='megaman x7'/><category term='twitter'/><category term='Bonjour'/><category term='drupal'/><category term='microsoft security essentials'/><category term='xps'/><category term='psp'/><category term='sony xperia x10'/><category term='social media'/><category term='windows messenger live'/><category term='ftp'/><title type='text'>Twig's Tech Tips</title><subtitle type='html'>Mainly notes to self (and for anyone else that may find them useful)</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://twigstechtips.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3937429925313843721/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://twigstechtips.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><link rel='next' type='application/atom+xml' href='http://www.blogger.com/feeds/3937429925313843721/posts/default?start-index=101&amp;max-results=100'/><author><name>twig</name><uri>http://www.blogger.com/profile/12960052797537632822</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/_ih0G_MpWiYU/SLluoTm10_I/AAAAAAAAAFw/a4-gyOpb6JI/s1600-R/kung_fu.jpg'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>614</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-3937429925313843721.post-5227651403117316580</id><published>2012-02-03T09:31:00.001+11:00</published><updated>2012-02-03T09:32:14.220+11:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='javascript'/><title type='text'>Javascript: Render file size in a human readable format to two decimal places</title><summary type='text'>  Displaying the size of files is one thing but formatting them so they're actually understandable by humans, Another.  I've found this useful snippet by inkdeep but corrected the bit/byte units, used a different rounding function and cleaned up the if blocks.   function humanize_filesize(fs) {   if (fs &gt;= 1073741824) { return round_number(fs / 1073741824, 2) + ' GB'; }   if (fs &gt;= 1048576)    { </summary><link rel='replies' type='application/atom+xml' href='http://twigstechtips.blogspot.com/feeds/5227651403117316580/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://twigstechtips.blogspot.com/2012/02/javascript-render-file-size-in-human.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3937429925313843721/posts/default/5227651403117316580'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3937429925313843721/posts/default/5227651403117316580'/><link rel='alternate' type='text/html' href='http://twigstechtips.blogspot.com/2012/02/javascript-render-file-size-in-human.html' title='Javascript: Render file size in a human readable format to two decimal places'/><author><name>twig</name><uri>http://www.blogger.com/profile/12960052797537632822</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/_ih0G_MpWiYU/SLluoTm10_I/AAAAAAAAAFw/a4-gyOpb6JI/s1600-R/kung_fu.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3937429925313843721.post-7632942448366061714</id><published>2012-02-03T09:25:00.001+11:00</published><updated>2012-02-03T09:25:26.864+11:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='javascript'/><title type='text'>Javascript: Round numbers off to X decimal places</title><summary type='text'>Simple little snippet which I was surprised wasn't part of the Math class.   function round_number(num, dec) {   return Math.round(num*Math.pow(10,dec))/Math.pow(10,dec); }   Source     Javascript to Round to 2 Decimal Places? by aleksei   </summary><link rel='replies' type='application/atom+xml' href='http://twigstechtips.blogspot.com/feeds/7632942448366061714/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://twigstechtips.blogspot.com/2012/02/javascript-round-numbers-off-to-x.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3937429925313843721/posts/default/7632942448366061714'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3937429925313843721/posts/default/7632942448366061714'/><link rel='alternate' type='text/html' href='http://twigstechtips.blogspot.com/2012/02/javascript-round-numbers-off-to-x.html' title='Javascript: Round numbers off to X decimal places'/><author><name>twig</name><uri>http://www.blogger.com/profile/12960052797537632822</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/_ih0G_MpWiYU/SLluoTm10_I/AAAAAAAAAFw/a4-gyOpb6JI/s1600-R/kung_fu.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3937429925313843721.post-8332943279592223654</id><published>2012-01-31T22:42:00.001+11:00</published><updated>2012-01-31T22:49:18.580+11:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='social media'/><category scheme='http://www.blogger.com/atom/ns#' term='google plus'/><title type='text'>Google: Adding Google Plus button to your content pages</title><summary type='text'>Perhaps the best documented out of the social share buttons.  It's quite straight forward if you read the API page.  A simple example with asynchronous loading would be:   &lt;g:plusone&gt;&lt;/g:plusone&gt;  &lt;script type="text/javascript"&gt; (function() {   var po = document.createElement('script'); po.type = 'text/javascript'; po.async = true;   po.src = 'https://apis.google.com/js/plusone.js';   var s = </summary><link rel='replies' type='application/atom+xml' href='http://twigstechtips.blogspot.com/feeds/8332943279592223654/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://twigstechtips.blogspot.com/2012/01/google-adding-google-plus-button-to.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3937429925313843721/posts/default/8332943279592223654'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3937429925313843721/posts/default/8332943279592223654'/><link rel='alternate' type='text/html' href='http://twigstechtips.blogspot.com/2012/01/google-adding-google-plus-button-to.html' title='Google: Adding Google Plus button to your content pages'/><author><name>twig</name><uri>http://www.blogger.com/profile/12960052797537632822</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/_ih0G_MpWiYU/SLluoTm10_I/AAAAAAAAAFw/a4-gyOpb6JI/s1600-R/kung_fu.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://lh5.ggpht.com/-9ml4AcxTNCU/TyfTt6h235I/AAAAAAAABts/P713LzOJ-wc/s72-c/4e31e0a74eb3d_thumb.jpg?imgmax=800' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3937429925313843721.post-8275901956808330402</id><published>2012-01-31T22:28:00.001+11:00</published><updated>2012-01-31T22:48:32.988+11:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='social media'/><category scheme='http://www.blogger.com/atom/ns#' term='facebook'/><title type='text'>Facebook: Add "like" button to your content pages</title><summary type='text'>Bloody hell this was more cryptic than it should have been. You have two options.  Easy way  First option is the deprecated (but still used on YouTube) "share" button.  You simply just create a link in a new window like:   &lt;a rel="nofollow" href=http://www.facebook.com/sharer.php?u=encodedURL&amp;t=encodedTitle"&gt;Facebook&lt;/a&gt;   It's easy because you can style it whatever way you want.  Drawback is you</summary><link rel='replies' type='application/atom+xml' href='http://twigstechtips.blogspot.com/feeds/8275901956808330402/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://twigstechtips.blogspot.com/2012/01/facebook-add-button-to-your-content.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3937429925313843721/posts/default/8275901956808330402'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3937429925313843721/posts/default/8275901956808330402'/><link rel='alternate' type='text/html' href='http://twigstechtips.blogspot.com/2012/01/facebook-add-button-to-your-content.html' title='Facebook: Add &amp;quot;like&amp;quot; button to your content pages'/><author><name>twig</name><uri>http://www.blogger.com/profile/12960052797537632822</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/_ih0G_MpWiYU/SLluoTm10_I/AAAAAAAAAFw/a4-gyOpb6JI/s1600-R/kung_fu.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://lh5.ggpht.com/-VhzYfK1669U/TyfQX22m6rI/AAAAAAAABtg/AV6Xzxr5-sY/s72-c/2Yq2Q_thumb.gif?imgmax=800' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3937429925313843721.post-3998809544069048052</id><published>2012-01-31T21:48:00.001+11:00</published><updated>2012-01-31T22:48:29.710+11:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='social media'/><category scheme='http://www.blogger.com/atom/ns#' term='twitter'/><title type='text'>Twitter: Add share/tweet button on your content pages</title><summary type='text'>Visit the Twitter Buttons page to generate your own.  To customise it a bit, you'll have to get your hands a little dirty.  Taking this for example:   &lt;a href="https://twitter.com/share" class="twitter-share-button" data-url="http://twigstechtips.blogspot.com" data-text="I found this stupid post" data-via="myawesomeshirt" data-hashtags="shirts"&gt;Tweet&lt;/a&gt;  &lt;script&gt;!function(d,s,id){var js,fjs=</summary><link rel='replies' type='application/atom+xml' href='http://twigstechtips.blogspot.com/feeds/3998809544069048052/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://twigstechtips.blogspot.com/2012/01/twitter-add-sharetweet-button-on-your.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3937429925313843721/posts/default/3998809544069048052'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3937429925313843721/posts/default/3998809544069048052'/><link rel='alternate' type='text/html' href='http://twigstechtips.blogspot.com/2012/01/twitter-add-sharetweet-button-on-your.html' title='Twitter: Add share/tweet button on your content pages'/><author><name>twig</name><uri>http://www.blogger.com/profile/12960052797537632822</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/_ih0G_MpWiYU/SLluoTm10_I/AAAAAAAAAFw/a4-gyOpb6JI/s1600-R/kung_fu.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3937429925313843721.post-6341451023045184955</id><published>2012-01-29T12:10:00.001+11:00</published><updated>2012-01-29T12:10:36.049+11:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='css'/><title type='text'>CSS: Use display inline-block on Internet Explorer 6 and 7</title><summary type='text'>IE6 has a pretty bad reputation for being incompatible with standards, and these days IE7 is the new IE6.  One of the biggest gripes I have about it is the inability to use display inline-block! It's the saviour of all layout rendering issues, yet shamed by IE.  Well, luckily there's a "compatibility hack" for it.   .shirt-details .tabs {   font-weight: bold;   font-size: larger;   display: </summary><link rel='replies' type='application/atom+xml' href='http://twigstechtips.blogspot.com/feeds/6341451023045184955/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://twigstechtips.blogspot.com/2012/01/css-use-display-inline-block-on.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3937429925313843721/posts/default/6341451023045184955'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3937429925313843721/posts/default/6341451023045184955'/><link rel='alternate' type='text/html' href='http://twigstechtips.blogspot.com/2012/01/css-use-display-inline-block-on.html' title='CSS: Use display inline-block on Internet Explorer 6 and 7'/><author><name>twig</name><uri>http://www.blogger.com/profile/12960052797537632822</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/_ih0G_MpWiYU/SLluoTm10_I/AAAAAAAAAFw/a4-gyOpb6JI/s1600-R/kung_fu.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://lh4.ggpht.com/-tjjRlu1QoWQ/TyScigGtgZI/AAAAAAAABtQ/sH4XM7QDUGQ/s72-c/uFCzA_thumb.gif?imgmax=800' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3937429925313843721.post-2498019603318227152</id><published>2012-01-24T10:34:00.001+11:00</published><updated>2012-01-24T10:34:05.104+11:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='firefox'/><category scheme='http://www.blogger.com/atom/ns#' term='opera'/><title type='text'>Opera: Using Firefox style keyboard shortcuts in Opera</title><summary type='text'>Getting sick of Firefox and their stupid rolling releases. Even more so with the speed and memory usage. Switching between browsers hasn't really been a problem for me when it comes to vanilla installs, except for Opera.  What the heck is that Ctrl+K shortcut? Most browsers seem to focus to the search or address controls when it's pressed. Opera on the other hand goes to some weird profiles thing</summary><link rel='replies' type='application/atom+xml' href='http://twigstechtips.blogspot.com/feeds/2498019603318227152/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://twigstechtips.blogspot.com/2012/01/opera-using-firefox-style-keyboard.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3937429925313843721/posts/default/2498019603318227152'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3937429925313843721/posts/default/2498019603318227152'/><link rel='alternate' type='text/html' href='http://twigstechtips.blogspot.com/2012/01/opera-using-firefox-style-keyboard.html' title='Opera: Using Firefox style keyboard shortcuts in Opera'/><author><name>twig</name><uri>http://www.blogger.com/profile/12960052797537632822</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/_ih0G_MpWiYU/SLluoTm10_I/AAAAAAAAAFw/a4-gyOpb6JI/s1600-R/kung_fu.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://lh6.ggpht.com/-cRmElPMMdz0/Tx3ua27Z0SI/AAAAAAAABs8/v4rydu6pbuM/s72-c/image_thumb.png?imgmax=800' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3937429925313843721.post-7963698752257468048</id><published>2012-01-18T11:20:00.001+11:00</published><updated>2012-01-18T11:20:59.775+11:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='django'/><title type='text'>Django: Displaying form errors under a certain field during clean()</title><summary type='text'>For the most part, the forms class works pretty well. Unless you're trying to specify exactly where an error should show up in the clean() function...  If you're using fieldname_clean() methods, then this isn't a problem.  However, during your clean() method you find that it makes more sense to target an error towards a certain field, you can't do it by simply raising a forms.ValidationError.  </summary><link rel='replies' type='application/atom+xml' href='http://twigstechtips.blogspot.com/feeds/7963698752257468048/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://twigstechtips.blogspot.com/2012/01/django-displaying-form-errors-under.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3937429925313843721/posts/default/7963698752257468048'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3937429925313843721/posts/default/7963698752257468048'/><link rel='alternate' type='text/html' href='http://twigstechtips.blogspot.com/2012/01/django-displaying-form-errors-under.html' title='Django: Displaying form errors under a certain field during clean()'/><author><name>twig</name><uri>http://www.blogger.com/profile/12960052797537632822</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/_ih0G_MpWiYU/SLluoTm10_I/AAAAAAAAAFw/a4-gyOpb6JI/s1600-R/kung_fu.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://lh3.ggpht.com/-uS63XzNGiKI/TxYQaTyH5RI/AAAAAAAABsw/-RXDDWnA_sU/s72-c/xf2srb_thumb.jpg?imgmax=800' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3937429925313843721.post-6900527351557332839</id><published>2012-01-17T21:43:00.001+11:00</published><updated>2012-01-17T21:43:15.013+11:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='windows 7'/><title type='text'>Windows 7: Downloading Service Pack 1</title><summary type='text'>My my, so many damn files to choose from for SP1.     Take a look for yourself!  Files of interest     7601.17514.101119-1850_Update_Sp_Wave1-GRMSP1.1_DVD.iso   The first one contains the whole SP1 she-bang for 32bit, 64bit AMD and 64bit Intel chipsets. It assumes that you're going to be using this DVD multiple times on various machines.     windows6.1-KB976932-IA64.exe    windows6.1-KB976932-X64</summary><link rel='replies' type='application/atom+xml' href='http://twigstechtips.blogspot.com/feeds/6900527351557332839/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://twigstechtips.blogspot.com/2012/01/windows-7-downloading-service-pack-1.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3937429925313843721/posts/default/6900527351557332839'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3937429925313843721/posts/default/6900527351557332839'/><link rel='alternate' type='text/html' href='http://twigstechtips.blogspot.com/2012/01/windows-7-downloading-service-pack-1.html' title='Windows 7: Downloading Service Pack 1'/><author><name>twig</name><uri>http://www.blogger.com/profile/12960052797537632822</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/_ih0G_MpWiYU/SLluoTm10_I/AAAAAAAAAFw/a4-gyOpb6JI/s1600-R/kung_fu.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://lh4.ggpht.com/--IxuqPkNmqo/TxVQvRTB-CI/AAAAAAAABsg/qmBNbWPEKuU/s72-c/image_thumb%25255B1%25255D.png?imgmax=800' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3937429925313843721.post-8524697368341657102</id><published>2012-01-17T09:27:00.001+11:00</published><updated>2012-01-17T09:27:07.825+11:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='django'/><title type='text'>Django: Send email with attachment</title><summary type='text'>Usually send_mail() will suffice for most emailing functionality, but when you need to attach something, the helpful Django wrapper function won't allow it.  If you need to add attachments to your emails, you'll have to go deeper.     Alright, down to the nitty gritty.   from django.core.mail.message import EmailMessage  email = EmailMessage() email.subject = "New shirt submitted" email.body = </summary><link rel='replies' type='application/atom+xml' href='http://twigstechtips.blogspot.com/feeds/8524697368341657102/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://twigstechtips.blogspot.com/2012/01/django-send-email-with-attachment.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3937429925313843721/posts/default/8524697368341657102'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3937429925313843721/posts/default/8524697368341657102'/><link rel='alternate' type='text/html' href='http://twigstechtips.blogspot.com/2012/01/django-send-email-with-attachment.html' title='Django: Send email with attachment'/><author><name>twig</name><uri>http://www.blogger.com/profile/12960052797537632822</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/_ih0G_MpWiYU/SLluoTm10_I/AAAAAAAAAFw/a4-gyOpb6JI/s1600-R/kung_fu.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://lh6.ggpht.com/-QNEQbvmwNEQ/TxSkOSTcoAI/AAAAAAAABsM/bNXPcHM1kRE/s72-c/image_thumb.png?imgmax=800' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3937429925313843721.post-4261134563149918148</id><published>2012-01-17T09:07:00.001+11:00</published><updated>2012-01-17T09:08:48.615+11:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='firefox'/><title type='text'>Disable auto playing video on SMH.com.au (and other Fairfax sites) without logging in</title><summary type='text'>Fuck having to log in to disable autoplay of videos. That shit shouldn't be on unless you turn it on.       It's like being raped in the skull... but given a choice if you want to sign up or not.  This snippet removes the video altogether, but to be honest you don't miss it at all.  These instructions are for Firefox, but are probably similar for other browsers.     Install the AdBlockPlus </summary><link rel='replies' type='application/atom+xml' href='http://twigstechtips.blogspot.com/feeds/4261134563149918148/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://twigstechtips.blogspot.com/2012/01/disable-auto-playing-video-on-smhcomau.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3937429925313843721/posts/default/4261134563149918148'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3937429925313843721/posts/default/4261134563149918148'/><link rel='alternate' type='text/html' href='http://twigstechtips.blogspot.com/2012/01/disable-auto-playing-video-on-smhcomau.html' title='Disable auto playing video on SMH.com.au (and other Fairfax sites) without logging in'/><author><name>twig</name><uri>http://www.blogger.com/profile/12960052797537632822</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/_ih0G_MpWiYU/SLluoTm10_I/AAAAAAAAAFw/a4-gyOpb6JI/s1600-R/kung_fu.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://lh6.ggpht.com/-rF9JeDqfz28/TxSf7ZXsn6I/AAAAAAAABsA/LQuCdHLH1zA/s72-c/DogHumpsCatsHead_thumb.gif?imgmax=800' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3937429925313843721.post-4005236411597651660</id><published>2012-01-17T09:03:00.003+11:00</published><updated>2012-01-17T09:04:09.915+11:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='python'/><title type='text'>Python: Various ways to sort lists and tuples</title><summary type='text'>I was amazed to how many ways there were to sort lists in Python. Better yet, you DON'T need to create a new function to sort things like you do in PHP.  Basic Sorting  Create a copy of the list   sorted([5, 2, 3, 1, 4])  [1, 2, 3, 4, 5]   Sort and modify the list  This method only works for lists.   a = [5, 2, 3, 1, 4] a.sort() a  [1, 2, 3, 4, 5]   Sort by Key  Pyhon 2.4 brings the "key" </summary><link rel='replies' type='application/atom+xml' href='http://twigstechtips.blogspot.com/feeds/4005236411597651660/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://twigstechtips.blogspot.com/2012/01/python-various-ways-to-sort-lists-and.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3937429925313843721/posts/default/4005236411597651660'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3937429925313843721/posts/default/4005236411597651660'/><link rel='alternate' type='text/html' href='http://twigstechtips.blogspot.com/2012/01/python-various-ways-to-sort-lists-and.html' title='Python: Various ways to sort lists and tuples'/><author><name>twig</name><uri>http://www.blogger.com/profile/12960052797537632822</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/_ih0G_MpWiYU/SLluoTm10_I/AAAAAAAAAFw/a4-gyOpb6JI/s1600-R/kung_fu.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3937429925313843721.post-7735663820421935104</id><published>2012-01-17T09:03:00.001+11:00</published><updated>2012-01-17T09:03:22.058+11:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='vi'/><title type='text'>vim: Delete all lines matching a search pattern</title><summary type='text'>A great little command that definitely saves you time!     :g/.*foo.*/d   the "d" at the end is replaceable so you can use other commands if needed.  Source     Delete Lines Matching Keyword   </summary><link rel='replies' type='application/atom+xml' href='http://twigstechtips.blogspot.com/feeds/7735663820421935104/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://twigstechtips.blogspot.com/2012/01/vim-delete-all-lines-matching-search.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3937429925313843721/posts/default/7735663820421935104'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3937429925313843721/posts/default/7735663820421935104'/><link rel='alternate' type='text/html' href='http://twigstechtips.blogspot.com/2012/01/vim-delete-all-lines-matching-search.html' title='vim: Delete all lines matching a search pattern'/><author><name>twig</name><uri>http://www.blogger.com/profile/12960052797537632822</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/_ih0G_MpWiYU/SLluoTm10_I/AAAAAAAAAFw/a4-gyOpb6JI/s1600-R/kung_fu.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3937429925313843721.post-9171769613293032893</id><published>2012-01-12T21:32:00.001+11:00</published><updated>2012-01-16T19:51:11.720+11:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='linux'/><title type='text'>Linux: Script to backup files/folders and copy it onto another server</title><summary type='text'>There's no need to glorify how a backup can save the day. If you've been hit by a critical hard drive error, you'll know what I mean.       They don't have a clue how it feels to be hit by a hdd error...  So without further adieu, let's begin.  Setting up automatic access:  Your source machine will need to be able to access the destination machine without requiring a password. Why? It's better </summary><link rel='replies' type='application/atom+xml' href='http://twigstechtips.blogspot.com/feeds/9171769613293032893/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://twigstechtips.blogspot.com/2012/01/linux-script-to-backup-filesfolders-and.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3937429925313843721/posts/default/9171769613293032893'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3937429925313843721/posts/default/9171769613293032893'/><link rel='alternate' type='text/html' href='http://twigstechtips.blogspot.com/2012/01/linux-script-to-backup-filesfolders-and.html' title='Linux: Script to backup files/folders and copy it onto another server'/><author><name>twig</name><uri>http://www.blogger.com/profile/12960052797537632822</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/_ih0G_MpWiYU/SLluoTm10_I/AAAAAAAAAFw/a4-gyOpb6JI/s1600-R/kung_fu.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://lh4.ggpht.com/-R_zUNrrE0b4/Tw62oUuEA-I/AAAAAAAABrA/ZEmkkQbVuUc/s72-c/pgIyE_thumb%25255B1%25255D.gif?imgmax=800' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3937429925313843721.post-6071647393484253707</id><published>2012-01-08T17:56:00.001+11:00</published><updated>2012-01-08T17:56:27.225+11:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='android'/><title type='text'>Android: How to use True Type Fonts (TTF) in your View</title><summary type='text'>The stock fonts provided with Android aren't bad, but if you need to give your app/game a bit more mood then you need some custom fonts.  To embed a custom font into your app, you need to create an "assets/fonts" folder and copy your TTF file there.  In your code:   Typeface font = Typeface.createFromAsset(this.getContext().getAssets(), "fonts/Jokerman.ttf"); TextView tv = (TextView) </summary><link rel='replies' type='application/atom+xml' href='http://twigstechtips.blogspot.com/feeds/6071647393484253707/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://twigstechtips.blogspot.com/2012/01/android-how-to-use-true-type-fonts-ttf.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3937429925313843721/posts/default/6071647393484253707'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3937429925313843721/posts/default/6071647393484253707'/><link rel='alternate' type='text/html' href='http://twigstechtips.blogspot.com/2012/01/android-how-to-use-true-type-fonts-ttf.html' title='Android: How to use True Type Fonts (TTF) in your View'/><author><name>twig</name><uri>http://www.blogger.com/profile/12960052797537632822</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/_ih0G_MpWiYU/SLluoTm10_I/AAAAAAAAAFw/a4-gyOpb6JI/s1600-R/kung_fu.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://lh4.ggpht.com/-Fm5MJdfsbeQ/Twk-GNPmiHI/AAAAAAAABqw/f5ixE03QSz4/s72-c/zl3c8_thumb.gif?imgmax=800' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3937429925313843721.post-1126558649569404889</id><published>2012-01-08T17:48:00.001+11:00</published><updated>2012-01-08T17:48:13.640+11:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='android'/><title type='text'>Android: Displaying items in a listview</title><summary type='text'>Wow, I thought I wrote something about this some time ago but I guess I didn't. Ran into this issue again when writing my Diablo II Runewords app.     The ListView isn't exactly the most intuitive thing to pick up and use. It's some clever work, but the whole thing is also a mess of views, adapters and layouts. A by-product of over engineering, probably second worst case after Activities.       </summary><link rel='replies' type='application/atom+xml' href='http://twigstechtips.blogspot.com/feeds/1126558649569404889/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://twigstechtips.blogspot.com/2012/01/android-displaying-items-in-listview.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3937429925313843721/posts/default/1126558649569404889'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3937429925313843721/posts/default/1126558649569404889'/><link rel='alternate' type='text/html' href='http://twigstechtips.blogspot.com/2012/01/android-displaying-items-in-listview.html' title='Android: Displaying items in a listview'/><author><name>twig</name><uri>http://www.blogger.com/profile/12960052797537632822</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/_ih0G_MpWiYU/SLluoTm10_I/AAAAAAAAAFw/a4-gyOpb6JI/s1600-R/kung_fu.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://lh5.ggpht.com/-kms87H4dDSw/Twk71Y4OVGI/AAAAAAAABqA/NjXOrjtyJr8/s72-c/image_thumb.png?imgmax=800' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3937429925313843721.post-935799779607117984</id><published>2012-01-08T16:21:00.001+11:00</published><updated>2012-01-08T16:21:18.088+11:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='android'/><title type='text'>Android: Parsing JSON data from a String</title><summary type='text'>A very handy built-in class to have is JSONTokener which I used for my Diablo II Runewords app.   public RunewordParser(String data) throws JSONException {   // Parse String "data"   JSONObject json = (JSONObject) new JSONTokener(data).nextValue();    // Some primitive data types   stones = json.getString("stones");   matched = json.getInt("matched");   onlyComplete = json.getBoolean("</summary><link rel='replies' type='application/atom+xml' href='http://twigstechtips.blogspot.com/feeds/935799779607117984/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://twigstechtips.blogspot.com/2012/01/android-parsing-json-data-from-string.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3937429925313843721/posts/default/935799779607117984'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3937429925313843721/posts/default/935799779607117984'/><link rel='alternate' type='text/html' href='http://twigstechtips.blogspot.com/2012/01/android-parsing-json-data-from-string.html' title='Android: Parsing JSON data from a String'/><author><name>twig</name><uri>http://www.blogger.com/profile/12960052797537632822</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/_ih0G_MpWiYU/SLluoTm10_I/AAAAAAAAAFw/a4-gyOpb6JI/s1600-R/kung_fu.jpg'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3937429925313843721.post-6719995287392247197</id><published>2012-01-08T16:10:00.001+11:00</published><updated>2012-01-08T16:10:32.589+11:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ssh'/><category scheme='http://www.blogger.com/atom/ns#' term='putty'/><title type='text'>SSH Port Forwarding with Putty</title><summary type='text'>Wow, this was a neat little feature I never knew existed until recently.  If you're connected to SSH to a remote server, you can tunnel through firewalls and access services via your remote computer using this method.  In the PuTTY configuration:        Go to "Connection" &gt; "SSH" &gt; "Tunnels"    For source port, enter in the port number you'd normally use on the remote machine (for instance 4680)</summary><link rel='replies' type='application/atom+xml' href='http://twigstechtips.blogspot.com/feeds/6719995287392247197/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://twigstechtips.blogspot.com/2012/01/ssh-port-forwarding-with-putty.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3937429925313843721/posts/default/6719995287392247197'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3937429925313843721/posts/default/6719995287392247197'/><link rel='alternate' type='text/html' href='http://twigstechtips.blogspot.com/2012/01/ssh-port-forwarding-with-putty.html' title='SSH Port Forwarding with Putty'/><author><name>twig</name><uri>http://www.blogger.com/profile/12960052797537632822</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/_ih0G_MpWiYU/SLluoTm10_I/AAAAAAAAAFw/a4-gyOpb6JI/s1600-R/kung_fu.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://lh6.ggpht.com/-Tj7jfKN7G7o/TwklPr_WaGI/AAAAAAAABpg/MSsrfdjRNp4/s72-c/image_thumb.png?imgmax=800' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3937429925313843721.post-9116562593025263072</id><published>2012-01-08T15:56:00.001+11:00</published><updated>2012-01-08T15:56:38.597+11:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='apache'/><title type='text'>Apache: Syntax error on line 33 of &lt;conf_file&gt;: Name duplicates previous WSGI daemon definition.</title><summary type='text'>It's likely in your vhost conf file that you've got the same daemon process already defined somewhere.     WSGIDaemonProcess  twig processes=10 threads=3 display-name=%{GROUP}   Ensure that "twig" part is UNIQUE by renaming it to something more project specific.  Source     SSL on Apache2 with WSGI   </summary><link rel='replies' type='application/atom+xml' href='http://twigstechtips.blogspot.com/feeds/9116562593025263072/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://twigstechtips.blogspot.com/2012/01/apache-syntax-error-on-line-33-of-name.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3937429925313843721/posts/default/9116562593025263072'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3937429925313843721/posts/default/9116562593025263072'/><link rel='alternate' type='text/html' href='http://twigstechtips.blogspot.com/2012/01/apache-syntax-error-on-line-33-of-name.html' title='Apache: Syntax error on line 33 of &amp;lt;conf_file&amp;gt;: Name duplicates previous WSGI daemon definition.'/><author><name>twig</name><uri>http://www.blogger.com/profile/12960052797537632822</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/_ih0G_MpWiYU/SLluoTm10_I/AAAAAAAAAFw/a4-gyOpb6JI/s1600-R/kung_fu.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3937429925313843721.post-6337382362875297286</id><published>2012-01-08T15:50:00.001+11:00</published><updated>2012-01-08T15:50:14.409+11:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='python'/><title type='text'>Python: Creating XML documents</title><summary type='text'>It was incredibly simple to create XML structure in Python.   from xml.etree.ElementTree import Element from xml.etree import ElementTree  # Build the XML root = Element("products") root.set('matches', "15") root.set('search_query', "whatever I searched for")  for p in products:   element = Element('product')   element.set('name', p.name)   element.set('brand', p.brand)   element.set('price', "%s</summary><link rel='replies' type='application/atom+xml' href='http://twigstechtips.blogspot.com/feeds/6337382362875297286/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://twigstechtips.blogspot.com/2012/01/python-creating-xml-documents.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3937429925313843721/posts/default/6337382362875297286'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3937429925313843721/posts/default/6337382362875297286'/><link rel='alternate' type='text/html' href='http://twigstechtips.blogspot.com/2012/01/python-creating-xml-documents.html' title='Python: Creating XML documents'/><author><name>twig</name><uri>http://www.blogger.com/profile/12960052797537632822</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/_ih0G_MpWiYU/SLluoTm10_I/AAAAAAAAAFw/a4-gyOpb6JI/s1600-R/kung_fu.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3937429925313843721.post-3567835043189620832</id><published>2012-01-08T15:36:00.001+11:00</published><updated>2012-01-08T15:36:30.842+11:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='subversion'/><title type='text'>SVN: Using another SVN repository in your project</title><summary type='text'>If you're building more than one website, it's often useful to share code between the two (such as user profile information or common utility code).  An example is:                                  ProjectA                             submoduleA                 submoduleB                 submoduleC                 profiles</summary><link rel='replies' type='application/atom+xml' href='http://twigstechtips.blogspot.com/feeds/3567835043189620832/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://twigstechtips.blogspot.com/2012/01/svn-using-another-svn-repository-in.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3937429925313843721/posts/default/3567835043189620832'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3937429925313843721/posts/default/3567835043189620832'/><link rel='alternate' type='text/html' href='http://twigstechtips.blogspot.com/2012/01/svn-using-another-svn-repository-in.html' title='SVN: Using another SVN repository in your project'/><author><name>twig</name><uri>http://www.blogger.com/profile/12960052797537632822</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/_ih0G_MpWiYU/SLluoTm10_I/AAAAAAAAAFw/a4-gyOpb6JI/s1600-R/kung_fu.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://lh5.ggpht.com/-Dp0TGJukZFg/TwkdFFVn-PI/AAAAAAAABow/H1_O-byOgNw/s72-c/image_thumb.png?imgmax=800' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3937429925313843721.post-8811757056057161329</id><published>2012-01-08T14:57:00.001+11:00</published><updated>2012-01-08T15:02:20.880+11:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='dyndns'/><category scheme='http://www.blogger.com/atom/ns#' term='router'/><category scheme='http://www.blogger.com/atom/ns#' term='netgear'/><title type='text'>Accessing DynDns address within LAN</title><summary type='text'>Man! This has been a pain in the ass since switching routers.  After setting up a DynDNS to point to your IP (in this instance, we'll use "twig.dyndns.com"), this is the ideal workflow from the Internet.       From outside your home network, access SSH at twig.dyndns.com.     DynDNS translates the address to your IP "200.100.50.25".     Client's request reaches your home router     Which sees the</summary><link rel='replies' type='application/atom+xml' href='http://twigstechtips.blogspot.com/feeds/8811757056057161329/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://twigstechtips.blogspot.com/2012/01/accessing-dyndns-address-within-lan.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3937429925313843721/posts/default/8811757056057161329'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3937429925313843721/posts/default/8811757056057161329'/><link rel='alternate' type='text/html' href='http://twigstechtips.blogspot.com/2012/01/accessing-dyndns-address-within-lan.html' title='Accessing DynDns address within LAN'/><author><name>twig</name><uri>http://www.blogger.com/profile/12960052797537632822</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/_ih0G_MpWiYU/SLluoTm10_I/AAAAAAAAAFw/a4-gyOpb6JI/s1600-R/kung_fu.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://lh4.ggpht.com/-CtTEskwQQ5E/TwkUAlicMUI/AAAAAAAABoA/uqUIQxMiwiE/s72-c/image_thumb.png?imgmax=800' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3937429925313843721.post-6211526717534406533</id><published>2011-12-30T13:44:00.001+11:00</published><updated>2011-12-30T13:45:16.187+11:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='linux'/><title type='text'>Linux: Run a process as daemon in background from SSH</title><summary type='text'>When a process supports daemon mode, you can either run it in a screen instance or init.d script.  If you had to kill off a rogue daemon and need to start it again via SSH, you can restart the daemon with a very simple addition to the command:  For example you have /bin/daemon_process with the parameters "--daemon --log-path=~/logs/blah/"  You can execute it with:   /bin/daemon_process --daemon -</summary><link rel='replies' type='application/atom+xml' href='http://twigstechtips.blogspot.com/feeds/6211526717534406533/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://twigstechtips.blogspot.com/2011/12/linux-run-process-as-daemon-in.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3937429925313843721/posts/default/6211526717534406533'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3937429925313843721/posts/default/6211526717534406533'/><link rel='alternate' type='text/html' href='http://twigstechtips.blogspot.com/2011/12/linux-run-process-as-daemon-in.html' title='Linux: Run a process as daemon in background from SSH'/><author><name>twig</name><uri>http://www.blogger.com/profile/12960052797537632822</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/_ih0G_MpWiYU/SLluoTm10_I/AAAAAAAAAFw/a4-gyOpb6JI/s1600-R/kung_fu.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3937429925313843721.post-9062352982999343793</id><published>2011-12-26T23:04:00.001+11:00</published><updated>2011-12-27T00:43:38.756+11:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='android'/><title type='text'>Android: Issues with opening files in Cyanogen Mod 7</title><summary type='text'>Some people contacted me with problems trying to open files in my CodePeeker app on CM7. The OI File Manager built into the CFW is returning something unexpected, causing the app to fail in opening files.  This resulted in a few "1 star - DOES NOT WORK" ratings...  This is MADNESS! Why!?  The reasoning behind this is because OpenIntent's OI File Manager wasn't returning data according to the </summary><link rel='replies' type='application/atom+xml' href='http://twigstechtips.blogspot.com/feeds/9062352982999343793/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://twigstechtips.blogspot.com/2011/12/android-issues-with-opening-files-in.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3937429925313843721/posts/default/9062352982999343793'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3937429925313843721/posts/default/9062352982999343793'/><link rel='alternate' type='text/html' href='http://twigstechtips.blogspot.com/2011/12/android-issues-with-opening-files-in.html' title='Android: Issues with opening files in Cyanogen Mod 7'/><author><name>twig</name><uri>http://www.blogger.com/profile/12960052797537632822</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/_ih0G_MpWiYU/SLluoTm10_I/AAAAAAAAAFw/a4-gyOpb6JI/s1600-R/kung_fu.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://lh3.ggpht.com/-vIWWVzu0VQM/TvhitGmOwqI/AAAAAAAABn4/MBlEOVUWOfs/s72-c/srvgq_thumb.gif?imgmax=800' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3937429925313843721.post-2638674982390879306</id><published>2011-12-22T11:48:00.001+11:00</published><updated>2011-12-22T11:48:01.785+11:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='python'/><title type='text'>Python: Converting transparent areas in PIL image to white or any other opaque colour</title><summary type='text'>I had some issues with transparent PNG images causing some strange effects when resized and saved with Python's PIL Image library.          As you can see, those jarring effects are hard to ignore.  The issue was I was ignoring the alpha channel during conversion and it didn't quite know what to do with it.   image = Image.open("some_file.png") image.convert("RGBA") # Convert this to RGBA if </summary><link rel='replies' type='application/atom+xml' href='http://twigstechtips.blogspot.com/feeds/2638674982390879306/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://twigstechtips.blogspot.com/2011/12/python-converting-transparent-areas-in.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3937429925313843721/posts/default/2638674982390879306'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3937429925313843721/posts/default/2638674982390879306'/><link rel='alternate' type='text/html' href='http://twigstechtips.blogspot.com/2011/12/python-converting-transparent-areas-in.html' title='Python: Converting transparent areas in PIL image to white or any other opaque colour'/><author><name>twig</name><uri>http://www.blogger.com/profile/12960052797537632822</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/_ih0G_MpWiYU/SLluoTm10_I/AAAAAAAAAFw/a4-gyOpb6JI/s1600-R/kung_fu.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://lh3.ggpht.com/-Opv11bjJDfI/TvJ-CbEn_vI/AAAAAAAABmY/zpMm1cvCbOk/s72-c/image_thumb%25255B4%25255D.png?imgmax=800' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3937429925313843721.post-1840922393644151280</id><published>2011-12-21T13:12:00.001+11:00</published><updated>2011-12-21T13:12:43.827+11:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='django'/><title type='text'>Django: Set datetime.now() in a Form</title><summary type='text'>A tricky little devil this one. For instance, you've got a "created" date in your form and you need it to be set to the current date whenever the page is displayed.  So immediately you go and do this   class SomeForm(forms.Form):   test_datetime = forms.SplitDateTimeField(initial = datetime.datetime.now())   First load, sweet it works. But load the page again, and you'll realise the date is still</summary><link rel='replies' type='application/atom+xml' href='http://twigstechtips.blogspot.com/feeds/1840922393644151280/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://twigstechtips.blogspot.com/2011/12/django-set-datetimenow-in-form.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3937429925313843721/posts/default/1840922393644151280'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3937429925313843721/posts/default/1840922393644151280'/><link rel='alternate' type='text/html' href='http://twigstechtips.blogspot.com/2011/12/django-set-datetimenow-in-form.html' title='Django: Set datetime.now() in a Form'/><author><name>twig</name><uri>http://www.blogger.com/profile/12960052797537632822</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/_ih0G_MpWiYU/SLluoTm10_I/AAAAAAAAAFw/a4-gyOpb6JI/s1600-R/kung_fu.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://lh5.ggpht.com/-xbdJzWRSx9c/TvFAahGBsRI/AAAAAAAABl0/Mp6IgdGp3Ck/s72-c/1283775594667_thumb.jpg?imgmax=800' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3937429925313843721.post-1326204985232300528</id><published>2011-12-20T23:09:00.001+11:00</published><updated>2011-12-20T23:09:22.390+11:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='nod32'/><category scheme='http://www.blogger.com/atom/ns#' term='windows'/><category scheme='http://www.blogger.com/atom/ns#' term='netlimiter'/><category scheme='http://www.blogger.com/atom/ns#' term='postgres sql'/><title type='text'>PostgreSQL: Fix for "Error connecting to the server: server closed the connection unexpectedly. This probably means the server terminated abnormally before or while processing the request."</title><summary type='text'>        Error connecting to the server: server closed the connection unexpectedly    This probably means the server terminated abnormally before or while processing the request.    If you're running Windows, PostgreSQL and you've seen this, it's probably driving you bonkers!  No matter what programming language you use, what interface library or even the default client, you'll get this damn </summary><link rel='replies' type='application/atom+xml' href='http://twigstechtips.blogspot.com/feeds/1326204985232300528/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://twigstechtips.blogspot.com/2011/12/postgresql-fix-for-connecting-to-server.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3937429925313843721/posts/default/1326204985232300528'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3937429925313843721/posts/default/1326204985232300528'/><link rel='alternate' type='text/html' href='http://twigstechtips.blogspot.com/2011/12/postgresql-fix-for-connecting-to-server.html' title='PostgreSQL: Fix for &amp;quot;Error connecting to the server: server closed the connection unexpectedly. This probably means the server terminated abnormally before or while processing the request.&amp;quot;'/><author><name>twig</name><uri>http://www.blogger.com/profile/12960052797537632822</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/_ih0G_MpWiYU/SLluoTm10_I/AAAAAAAAAFw/a4-gyOpb6JI/s1600-R/kung_fu.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://lh5.ggpht.com/-Me7UthBACnc/TvB6mfl7l3I/AAAAAAAABlI/N2JfL5SZ54Y/s72-c/image_thumb%25255B3%25255D.png?imgmax=800' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3937429925313843721.post-5420526178357445494</id><published>2011-12-09T17:25:00.001+11:00</published><updated>2011-12-09T17:26:58.705+11:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='postgres sql'/><title type='text'>PostgreSQL: Alter table field CHAR length</title><summary type='text'>So the annoying thing about character fields is that they have a limit.  When you try to save the row and the data is too long, it'll fail.  So to increase the limit, run this query:   ALTER TABLE tablename   ALTER COLUMN url TYPE varchar(500),   ALTER COLUMN description TYPE varchar(300);   That's it! The fields url/description will now have the lengths of 500/300 respectively and maintain the </summary><link rel='replies' type='application/atom+xml' href='http://twigstechtips.blogspot.com/feeds/5420526178357445494/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://twigstechtips.blogspot.com/2011/12/postgresql-alter-table-field-char.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3937429925313843721/posts/default/5420526178357445494'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3937429925313843721/posts/default/5420526178357445494'/><link rel='alternate' type='text/html' href='http://twigstechtips.blogspot.com/2011/12/postgresql-alter-table-field-char.html' title='PostgreSQL: Alter table field CHAR length'/><author><name>twig</name><uri>http://www.blogger.com/profile/12960052797537632822</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/_ih0G_MpWiYU/SLluoTm10_I/AAAAAAAAAFw/a4-gyOpb6JI/s1600-R/kung_fu.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://lh4.ggpht.com/-4a53eZWu1as/TuGp7aUNFLI/AAAAAAAABk4/J7EXNJBn6gY/s72-c/notsochewyballoonsp1_thumb.gif?imgmax=800' height='72' width='72'/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3937429925313843721.post-9054745033929262552</id><published>2011-12-09T11:09:00.001+11:00</published><updated>2011-12-09T11:11:42.598+11:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='django'/><title type='text'>django: Filter by field value in row on model</title><summary type='text'>A bit hard to describe in words, but easier in an example.  Say for instance I have these values in my database table.   id | rowA | rowB ---------------- 1  | 3    | 1 2  | 3    | 2 3  | 3    | 3 4  | 3    | 4 5  | 3    | 5   To find the rows where rowA &gt;= rowB, you just use the F class.   from django.db.models import F Model.objects.filter(rowA__gte=F('rowB'))   So easy but never crossed this </summary><link rel='replies' type='application/atom+xml' href='http://twigstechtips.blogspot.com/feeds/9054745033929262552/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://twigstechtips.blogspot.com/2011/12/django-filter-by-field-value-in-row-on.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3937429925313843721/posts/default/9054745033929262552'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3937429925313843721/posts/default/9054745033929262552'/><link rel='alternate' type='text/html' href='http://twigstechtips.blogspot.com/2011/12/django-filter-by-field-value-in-row-on.html' title='django: Filter by field value in row on model'/><author><name>twig</name><uri>http://www.blogger.com/profile/12960052797537632822</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/_ih0G_MpWiYU/SLluoTm10_I/AAAAAAAAAFw/a4-gyOpb6JI/s1600-R/kung_fu.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://lh5.ggpht.com/-RrORtbzt3hU/TuFRnNTjYuI/AAAAAAAABko/niAibbT7cyY/s72-c/0D00v_thumb.gif?imgmax=800' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3937429925313843721.post-5803034754253607574</id><published>2011-11-25T14:57:00.001+11:00</published><updated>2011-11-25T14:57:08.616+11:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='git'/><title type='text'>git: Ignore dirty or untracked submodules in diff or status commands</title><summary type='text'>Git 1.7.0 added a feature which marks submodules as dirty if an untracked file is in it.     --- a/article      +++ b/article       @@ -1 +1 @@       -Subproject commit aba7c80124b0ac07299f224f1bf7ddd4c9a095e3       +Subproject commit aba7c80124b0ac07299f224f1bf7ddd4c9a095e3-dirty           ...    diff --git a/south b/south      --- a/south       +++ b/south       @@ -1 +1 @@       -Subproject </summary><link rel='replies' type='application/atom+xml' href='http://twigstechtips.blogspot.com/feeds/5803034754253607574/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://twigstechtips.blogspot.com/2011/11/git-ignore-dirty-or-untracked.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3937429925313843721/posts/default/5803034754253607574'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3937429925313843721/posts/default/5803034754253607574'/><link rel='alternate' type='text/html' href='http://twigstechtips.blogspot.com/2011/11/git-ignore-dirty-or-untracked.html' title='git: Ignore dirty or untracked submodules in diff or status commands'/><author><name>twig</name><uri>http://www.blogger.com/profile/12960052797537632822</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/_ih0G_MpWiYU/SLluoTm10_I/AAAAAAAAAFw/a4-gyOpb6JI/s1600-R/kung_fu.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3937429925313843721.post-5483501525331193496</id><published>2011-11-20T01:44:00.001+11:00</published><updated>2011-11-20T01:51:27.535+11:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='android'/><title type='text'>Android: Managing AsyncTask, progress dialog and screen orientation</title><summary type='text'>For my app Moustachify Everything, I was getting quite a few 1-star ratings when users got a black screen for the results.  It took me a while to figure out why it was happening. Because I test on WiFi, the images upload quite quickly.  When testing with 3G, I accidentally rotated the screen and the progress dialog was cleared, leaving me with just a black screen and an ad.  When the AsyncTask </summary><link rel='replies' type='application/atom+xml' href='http://twigstechtips.blogspot.com/feeds/5483501525331193496/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://twigstechtips.blogspot.com/2011/11/for-my-app-moustachify-everything-i-was.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3937429925313843721/posts/default/5483501525331193496'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3937429925313843721/posts/default/5483501525331193496'/><link rel='alternate' type='text/html' href='http://twigstechtips.blogspot.com/2011/11/for-my-app-moustachify-everything-i-was.html' title='Android: Managing AsyncTask, progress dialog and screen orientation'/><author><name>twig</name><uri>http://www.blogger.com/profile/12960052797537632822</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/_ih0G_MpWiYU/SLluoTm10_I/AAAAAAAAAFw/a4-gyOpb6JI/s1600-R/kung_fu.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3937429925313843721.post-1166018245619718647</id><published>2011-11-19T23:52:00.001+11:00</published><updated>2011-11-19T23:52:44.282+11:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='android'/><title type='text'>Android: Fix "Error generating final archive: Debug certificate expired"</title><summary type='text'>Now this was surprising. I had to update a project and I guess it's been over a year since I've started Android development.  Apparently Android SDK only signs the debug certificate for a year. This can be a bit annoying because you have to uninstall all your testing apps after you create a new debug certificate.     First up, open up Windows Explorer and paste in "%HOMEPATH%\.android"    Locate </summary><link rel='replies' type='application/atom+xml' href='http://twigstechtips.blogspot.com/feeds/1166018245619718647/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://twigstechtips.blogspot.com/2011/11/now-this-was-surprising.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3937429925313843721/posts/default/1166018245619718647'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3937429925313843721/posts/default/1166018245619718647'/><link rel='alternate' type='text/html' href='http://twigstechtips.blogspot.com/2011/11/now-this-was-surprising.html' title='Android: Fix &amp;quot;Error generating final archive: Debug certificate expired&amp;quot;'/><author><name>twig</name><uri>http://www.blogger.com/profile/12960052797537632822</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/_ih0G_MpWiYU/SLluoTm10_I/AAAAAAAAAFw/a4-gyOpb6JI/s1600-R/kung_fu.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3937429925313843721.post-61886206833982444</id><published>2011-11-19T13:25:00.001+11:00</published><updated>2011-11-19T13:25:05.759+11:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='django'/><title type='text'>Django: A simple order and distinct query</title><summary type='text'>A common query in SQL would be:   SELECT DISTINCT type FROM Item ORDER BY type;   In Django however, it's a little tricker since we've got the ORM.   Items.objects.order_by('type').values_list('type', flat = True).distinct()   Unusual? Yes. Impossible? No.  </summary><link rel='replies' type='application/atom+xml' href='http://twigstechtips.blogspot.com/feeds/61886206833982444/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://twigstechtips.blogspot.com/2011/11/common-query-in-sql-would-be-select.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3937429925313843721/posts/default/61886206833982444'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3937429925313843721/posts/default/61886206833982444'/><link rel='alternate' type='text/html' href='http://twigstechtips.blogspot.com/2011/11/common-query-in-sql-would-be-select.html' title='Django: A simple order and distinct query'/><author><name>twig</name><uri>http://www.blogger.com/profile/12960052797537632822</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/_ih0G_MpWiYU/SLluoTm10_I/AAAAAAAAAFw/a4-gyOpb6JI/s1600-R/kung_fu.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3937429925313843721.post-9187764122343689455</id><published>2011-11-17T14:33:00.001+11:00</published><updated>2011-11-17T14:33:49.554+11:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='excel'/><title type='text'>Excel: Creating a dropdown list in cells</title><summary type='text'>I've seen this a couple of times but never got around to figuring out how it works.        First, type up the cells which will be used as reference.         Select the cells you want to apply the "dropdown list" to    Click on Data &gt; Validation    Change "Allow" to "List"    Click the little weird icon in "Source"         Select the cells containing the list of items         Confirm by clicking </summary><link rel='replies' type='application/atom+xml' href='http://twigstechtips.blogspot.com/feeds/9187764122343689455/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://twigstechtips.blogspot.com/2011/11/ive-seen-this-couple-of-times-but-never.html#comment-form' title='4 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3937429925313843721/posts/default/9187764122343689455'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3937429925313843721/posts/default/9187764122343689455'/><link rel='alternate' type='text/html' href='http://twigstechtips.blogspot.com/2011/11/ive-seen-this-couple-of-times-but-never.html' title='Excel: Creating a dropdown list in cells'/><author><name>twig</name><uri>http://www.blogger.com/profile/12960052797537632822</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/_ih0G_MpWiYU/SLluoTm10_I/AAAAAAAAAFw/a4-gyOpb6JI/s1600-R/kung_fu.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://lh3.ggpht.com/-8B23dnW3_PE/TsSAdhC8w0I/AAAAAAAABiY/lcmmTV8PgkU/s72-c/image_thumb.png?imgmax=800' height='72' width='72'/><thr:total>4</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3937429925313843721.post-6046746213740597429</id><published>2011-11-17T14:22:00.001+11:00</published><updated>2011-11-17T14:22:54.310+11:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='python'/><category scheme='http://www.blogger.com/atom/ns#' term='postgres sql'/><title type='text'>Python: Setting up PostgreSQL support in Windows Python</title><summary type='text'>Took me some time to get this working but I finally got it!  You can grab the Python 2.4 to 3.2 binaries (for both x86 and x64) from StickPeople.     I used WinRAR to extract the contents of the EXE by right clicking the file.     Move the contents of "PLATLIB\psycopg2"     To "your_python_folder\Lib\site-packages\psycopg2"    Source     win-psycopg    </summary><link rel='replies' type='application/atom+xml' href='http://twigstechtips.blogspot.com/feeds/6046746213740597429/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://twigstechtips.blogspot.com/2011/11/took-me-some-time-to-get-this-working.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3937429925313843721/posts/default/6046746213740597429'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3937429925313843721/posts/default/6046746213740597429'/><link rel='alternate' type='text/html' href='http://twigstechtips.blogspot.com/2011/11/took-me-some-time-to-get-this-working.html' title='Python: Setting up PostgreSQL support in Windows Python'/><author><name>twig</name><uri>http://www.blogger.com/profile/12960052797537632822</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/_ih0G_MpWiYU/SLluoTm10_I/AAAAAAAAAFw/a4-gyOpb6JI/s1600-R/kung_fu.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3937429925313843721.post-1398266270592209242</id><published>2011-11-17T14:21:00.001+11:00</published><updated>2011-11-17T14:21:47.306+11:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='windows messenger live'/><title type='text'>Windows Live Messenger: Disable "File Transfer Warning" notification when trying to send a file</title><summary type='text'>All I want to do is send a fucking ZIP file to my friend.     I'm not going to install an antivirus just so I can send files. Security in airports I can understand. Over-zealous security on my computer? Please go away.  I don't have an antivirus. Seriously. Common sense has kept my work computer safe for over 3 years now.  My solution? Fuck installing an antivirus and just run the command prompt.</summary><link rel='replies' type='application/atom+xml' href='http://twigstechtips.blogspot.com/feeds/1398266270592209242/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://twigstechtips.blogspot.com/2011/11/all-i-want-to-do-is-send-fucking-zip.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3937429925313843721/posts/default/1398266270592209242'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3937429925313843721/posts/default/1398266270592209242'/><link rel='alternate' type='text/html' href='http://twigstechtips.blogspot.com/2011/11/all-i-want-to-do-is-send-fucking-zip.html' title='Windows Live Messenger: Disable &amp;quot;File Transfer Warning&amp;quot; notification when trying to send a file'/><author><name>twig</name><uri>http://www.blogger.com/profile/12960052797537632822</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/_ih0G_MpWiYU/SLluoTm10_I/AAAAAAAAAFw/a4-gyOpb6JI/s1600-R/kung_fu.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://lh3.ggpht.com/-LCWXmX988pk/TsR9wZd1RII/AAAAAAAABh4/-8Rxer7QVkA/s72-c/image_thumb.png?imgmax=800' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3937429925313843721.post-7091788545460524637</id><published>2011-11-16T19:49:00.001+11:00</published><updated>2011-11-16T19:50:00.004+11:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='diablo 2'/><title type='text'>Diablo 2: Getting PlugY to work on patch v1.13d</title><summary type='text'>Sad to say it, but I've been hooked on a 11yr old game again. The latest patch however is not compatible with many hacks and mods. At time of writing, the latest patch is 1.13d.  One of the most popular mods being PlugY, which increases your stash size and allows you to get Ladder/Online Only rune words in single player mode.  To get it working, you'll need to downgrade. Sorry, I don't know of </summary><link rel='replies' type='application/atom+xml' href='http://twigstechtips.blogspot.com/feeds/7091788545460524637/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://twigstechtips.blogspot.com/2011/11/sad-to-say-it-but-ive-been-hooked-on.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3937429925313843721/posts/default/7091788545460524637'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3937429925313843721/posts/default/7091788545460524637'/><link rel='alternate' type='text/html' href='http://twigstechtips.blogspot.com/2011/11/sad-to-say-it-but-ive-been-hooked-on.html' title='Diablo 2: Getting PlugY to work on patch v1.13d'/><author><name>twig</name><uri>http://www.blogger.com/profile/12960052797537632822</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/_ih0G_MpWiYU/SLluoTm10_I/AAAAAAAAAFw/a4-gyOpb6JI/s1600-R/kung_fu.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://lh3.ggpht.com/-CO05VIAVuf8/TsN5NZV6KCI/AAAAAAAABg4/NzMmCsmyzDc/s72-c/image_thumb%25255B2%25255D.png?imgmax=800' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3937429925313843721.post-3105184380432082477</id><published>2011-11-14T09:19:00.001+11:00</published><updated>2011-11-14T09:19:06.941+11:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='opera'/><title type='text'>Opera Browser: Change next tab keyboard shortcut</title><summary type='text'>I like to use the keyboard where possible. In Firefox, I set my Ctrl+Page Up/Down buttons to switch between tabs so I don't have to reach for my mouse as much.  However, when I tried to do this on Opera... god damn wut!? This is one of the cases where it's harder than it should have been.  Firstly, find the settings dialog by:     Going to Opera &gt; Settings &gt; Preferences (Ctrl + F12)    Advanced &gt;</summary><link rel='replies' type='application/atom+xml' href='http://twigstechtips.blogspot.com/feeds/3105184380432082477/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://twigstechtips.blogspot.com/2011/11/opera-browser-change-next-tab-keyboard.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3937429925313843721/posts/default/3105184380432082477'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3937429925313843721/posts/default/3105184380432082477'/><link rel='alternate' type='text/html' href='http://twigstechtips.blogspot.com/2011/11/opera-browser-change-next-tab-keyboard.html' title='Opera Browser: Change next tab keyboard shortcut'/><author><name>twig</name><uri>http://www.blogger.com/profile/12960052797537632822</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/_ih0G_MpWiYU/SLluoTm10_I/AAAAAAAAAFw/a4-gyOpb6JI/s1600-R/kung_fu.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://lh6.ggpht.com/-wikJIVXR87M/TsBCS4p-XcI/AAAAAAAABgE/BNX_AfOyUsU/s72-c/image_thumb%25255B2%25255D.png?imgmax=800' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3937429925313843721.post-4512081722644435041</id><published>2011-11-03T16:45:00.001+11:00</published><updated>2011-11-03T16:47:01.638+11:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='windows 7'/><category scheme='http://www.blogger.com/atom/ns#' term='windows'/><title type='text'>Windows 7: Disable "To help protect your computer, Windows has blocked access to this file"</title><summary type='text'>So I was using the work PC to extract some files I received in my email.  Damn it I'm just trying to extract some files for work, stop treating me like a grandma!  Fuck this.  Right click on the file &gt; "Properties" &gt; "Unblock".     Try extracting again and it'll work.  To prevent files from being tagged as "unsafe", follow the instructions in my previous post Windows 7: Disable the "Open File </summary><link rel='replies' type='application/atom+xml' href='http://twigstechtips.blogspot.com/feeds/4512081722644435041/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://twigstechtips.blogspot.com/2011/11/windows-7-disable-help-protect-your.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3937429925313843721/posts/default/4512081722644435041'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3937429925313843721/posts/default/4512081722644435041'/><link rel='alternate' type='text/html' href='http://twigstechtips.blogspot.com/2011/11/windows-7-disable-help-protect-your.html' title='Windows 7: Disable &amp;quot;To help protect your computer, Windows has blocked access to this file&amp;quot;'/><author><name>twig</name><uri>http://www.blogger.com/profile/12960052797537632822</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/_ih0G_MpWiYU/SLluoTm10_I/AAAAAAAAAFw/a4-gyOpb6JI/s1600-R/kung_fu.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://lh5.ggpht.com/-wW77S6RS6zY/TrIqa-iPSQI/AAAAAAAABfo/YVtvCWxPYBQ/s72-c/image_thumb%25255B1%25255D.png?imgmax=800' height='72' width='72'/><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3937429925313843721.post-5051581371257496180</id><published>2011-10-17T09:44:00.001+11:00</published><updated>2011-10-17T09:44:38.471+11:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='django'/><title type='text'>Django: Display boolean field as True/False radio buttons</title><summary type='text'>This sounds like such a trivial thing to do but it wasn't the most logical.  Alright, you'll need a tuple that contains the True/False value and labels and then a ChoiceField which uses it.   class CustomForm(forms.Form):   BOOLEAN_CHOICES = (('1', 'True label'), ('0', 'False label'))   # Filtering fields   is_true = forms.ChoiceField(choices = BOOLEAN_CHOICES, widget = forms.RadioSelect)   Oh </summary><link rel='replies' type='application/atom+xml' href='http://twigstechtips.blogspot.com/feeds/5051581371257496180/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://twigstechtips.blogspot.com/2011/10/django-display-boolean-field-as.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3937429925313843721/posts/default/5051581371257496180'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3937429925313843721/posts/default/5051581371257496180'/><link rel='alternate' type='text/html' href='http://twigstechtips.blogspot.com/2011/10/django-display-boolean-field-as.html' title='Django: Display boolean field as True/False radio buttons'/><author><name>twig</name><uri>http://www.blogger.com/profile/12960052797537632822</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/_ih0G_MpWiYU/SLluoTm10_I/AAAAAAAAAFw/a4-gyOpb6JI/s1600-R/kung_fu.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://lh4.ggpht.com/-vAiAbQ9XDfk/TpteOV_nZwI/AAAAAAAABe8/yFRQRNHD81A/s72-c/image_thumb.png?imgmax=800' height='72' width='72'/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3937429925313843721.post-9191067294174115025</id><published>2011-10-17T09:37:00.001+11:00</published><updated>2011-10-17T09:37:34.219+11:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='django'/><title type='text'>Django: Dynamic checkbox/select options in form</title><summary type='text'>Usually when you create a form in Django, you have to know what items you want to allow as the initial values, otherwise it'll give you an invalid_choice error:     Select a valid choice. 'X' is not one of the available choices.   Normally it's fine, it's just some dope changing values on their browser and messing with your form by sending dodgy data.  But things get a little more complicated </summary><link rel='replies' type='application/atom+xml' href='http://twigstechtips.blogspot.com/feeds/9191067294174115025/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://twigstechtips.blogspot.com/2011/10/django-dynamic-checkboxselect-options.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3937429925313843721/posts/default/9191067294174115025'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3937429925313843721/posts/default/9191067294174115025'/><link rel='alternate' type='text/html' href='http://twigstechtips.blogspot.com/2011/10/django-dynamic-checkboxselect-options.html' title='Django: Dynamic checkbox/select options in form'/><author><name>twig</name><uri>http://www.blogger.com/profile/12960052797537632822</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/_ih0G_MpWiYU/SLluoTm10_I/AAAAAAAAAFw/a4-gyOpb6JI/s1600-R/kung_fu.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://lh3.ggpht.com/-YJZqbSAkz5c/TptcrGXXGqI/AAAAAAAABes/6uSjoYGOTHk/s72-c/tumblr_lfi3fzbYg61qahhxwo1_250_thumb.gif?imgmax=800' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3937429925313843721.post-5020383882392062962</id><published>2011-10-17T09:28:00.001+11:00</published><updated>2011-10-17T09:28:11.240+11:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='python'/><title type='text'>Python: How to write a CSV file</title><summary type='text'>CSV is one of the oldest and simplest format for spreadsheets.  If you've ever found yourself having to dump out some data in this format, Python makes it hella easy to do so.   headings = ['Category', 'Systemtype', 'SystemModel', 'ModelID', 'Type', 'Manufacturer', 'ProductName', 'OrigProductName', 'Processor', 'ProcessorSpeed', 'Monitor', 'Memory', 'OperatingSystem', 'HardDrive' ]  # Open up the</summary><link rel='replies' type='application/atom+xml' href='http://twigstechtips.blogspot.com/feeds/5020383882392062962/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://twigstechtips.blogspot.com/2011/10/python-how-to-write-csv-file.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3937429925313843721/posts/default/5020383882392062962'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3937429925313843721/posts/default/5020383882392062962'/><link rel='alternate' type='text/html' href='http://twigstechtips.blogspot.com/2011/10/python-how-to-write-csv-file.html' title='Python: How to write a CSV file'/><author><name>twig</name><uri>http://www.blogger.com/profile/12960052797537632822</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/_ih0G_MpWiYU/SLluoTm10_I/AAAAAAAAAFw/a4-gyOpb6JI/s1600-R/kung_fu.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3937429925313843721.post-3423632465301596614</id><published>2011-10-13T23:50:00.001+11:00</published><updated>2011-10-13T23:50:56.183+11:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='android'/><title type='text'>Android: Validate a URL string</title><summary type='text'>Sometimes all we really need is to check if a URL is valid. You know, the standard "http(s)://domain.com/something/" pattern.  It took a while to find, but the API level 1 had it all along!  Just use URLUtil.isValidUrl() to test it.   // Validate URL if (!URLUtil.isValidUrl(url)) {   Toast.makeText(this, "Invalid URL specified", Toast.LENGTH_SHORT).show();   return; }   That's all folks!        </summary><link rel='replies' type='application/atom+xml' href='http://twigstechtips.blogspot.com/feeds/3423632465301596614/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://twigstechtips.blogspot.com/2011/10/android-validate-url-string.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3937429925313843721/posts/default/3423632465301596614'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3937429925313843721/posts/default/3423632465301596614'/><link rel='alternate' type='text/html' href='http://twigstechtips.blogspot.com/2011/10/android-validate-url-string.html' title='Android: Validate a URL string'/><author><name>twig</name><uri>http://www.blogger.com/profile/12960052797537632822</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/_ih0G_MpWiYU/SLluoTm10_I/AAAAAAAAAFw/a4-gyOpb6JI/s1600-R/kung_fu.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://lh6.ggpht.com/-8WBBKdLQrm4/TpberiXZZeI/AAAAAAAABec/7EBQEo5tUY4/s72-c/slidedog_thumb.gif?imgmax=800' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3937429925313843721.post-8932054000085778411</id><published>2011-10-13T16:09:00.001+11:00</published><updated>2011-10-13T16:09:58.990+11:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='django'/><title type='text'>Django: Fix "OperationalError: database is locked" error</title><summary type='text'>If you're using the shell to do some testing, this error could cause you some grief and set you back by forcing you to start the terminal.  Thankfully, the solution is short.  Just paste in this snippet and it'll be rolled back to a usable state.   from django.db import transaction transaction.rollback()   Sources     How do you rollback during Django shell session after causing DatabaseError?</summary><link rel='replies' type='application/atom+xml' href='http://twigstechtips.blogspot.com/feeds/8932054000085778411/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://twigstechtips.blogspot.com/2011/10/django-fix-database-is-locked-error.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3937429925313843721/posts/default/8932054000085778411'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3937429925313843721/posts/default/8932054000085778411'/><link rel='alternate' type='text/html' href='http://twigstechtips.blogspot.com/2011/10/django-fix-database-is-locked-error.html' title='Django: Fix &amp;quot;OperationalError: database is locked&amp;quot; error'/><author><name>twig</name><uri>http://www.blogger.com/profile/12960052797537632822</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/_ih0G_MpWiYU/SLluoTm10_I/AAAAAAAAAFw/a4-gyOpb6JI/s1600-R/kung_fu.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3937429925313843721.post-8278601182330345947</id><published>2011-10-13T09:38:00.001+11:00</published><updated>2011-10-13T09:38:17.215+11:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='jquery'/><title type='text'>jQuery: Detect enter keypress</title><summary type='text'>A neat little snippet which detects when a user has pressed "Enter" on the keyboard.   $('#id_query').keypress(function(e) {   var key = (e.keyCode || e.which);    if (key == 13) {     e.preventDefault();     alert("hi!");   } });   Sources     Submitting a form on 'Enter' with jQuery?     jQuery plugin: SafeEnter 1.0    </summary><link rel='replies' type='application/atom+xml' href='http://twigstechtips.blogspot.com/feeds/8278601182330345947/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://twigstechtips.blogspot.com/2011/10/jquery-detect-enter-keypress.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3937429925313843721/posts/default/8278601182330345947'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3937429925313843721/posts/default/8278601182330345947'/><link rel='alternate' type='text/html' href='http://twigstechtips.blogspot.com/2011/10/jquery-detect-enter-keypress.html' title='jQuery: Detect enter keypress'/><author><name>twig</name><uri>http://www.blogger.com/profile/12960052797537632822</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/_ih0G_MpWiYU/SLluoTm10_I/AAAAAAAAAFw/a4-gyOpb6JI/s1600-R/kung_fu.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3937429925313843721.post-2322387418776531039</id><published>2011-10-13T09:13:00.001+11:00</published><updated>2011-10-13T09:13:29.296+11:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='django'/><title type='text'>Django: How to fix the annoying UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 1: ordinal not in range(128)</title><summary type='text'>A somewhat tricky error to debug.  Take for example this:     &gt;&gt;&gt; u"%s" % Product.objects.get(pk = 7431).manufacturer  u'DéLonghi'         Now look at it again.     &gt;&gt;&gt; "%s" % Product.objects.get(pk = 7431).manufacturer      'D\xc3\xa9Longhi'         Did you spot the difference? There's a "u" in front of the string. That "u" tells Python you want it to be a unicode string rather than an ASCII </summary><link rel='replies' type='application/atom+xml' href='http://twigstechtips.blogspot.com/feeds/2322387418776531039/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://twigstechtips.blogspot.com/2011/10/django-how-to-fix-annoying.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3937429925313843721/posts/default/2322387418776531039'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3937429925313843721/posts/default/2322387418776531039'/><link rel='alternate' type='text/html' href='http://twigstechtips.blogspot.com/2011/10/django-how-to-fix-annoying.html' title='Django: How to fix the annoying UnicodeDecodeError: &amp;#39;ascii&amp;#39; codec can&amp;#39;t decode byte 0xc3 in position 1: ordinal not in range(128)'/><author><name>twig</name><uri>http://www.blogger.com/profile/12960052797537632822</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/_ih0G_MpWiYU/SLluoTm10_I/AAAAAAAAAFw/a4-gyOpb6JI/s1600-R/kung_fu.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://lh3.ggpht.com/-h5Bawz9HAb8/TpYRB-CZ0xI/AAAAAAAABdM/0HQnpaEaVDU/s72-c/image_thumb1.png?imgmax=800' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3937429925313843721.post-7917559522920441218</id><published>2011-10-12T09:44:00.001+11:00</published><updated>2011-10-12T09:44:07.014+11:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='python'/><title type='text'>Python: Check if an IP matches or in a valid range</title><summary type='text'>While implementing a certain feature, we wanted to restrict it's functionality to a range of IP's only available in the office.  To do that, you first need to download netaddr from github.   import netaddr  def cache_purge_allowed(request):   client_ip = request.META.get('HTTP_X_FORWARDED_FOR', request.META.get('REMOTE_ADDR', None))    if client_ip is None:     return False    ip = </summary><link rel='replies' type='application/atom+xml' href='http://twigstechtips.blogspot.com/feeds/7917559522920441218/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://twigstechtips.blogspot.com/2011/10/python-check-if-ip-matches-or-in-valid.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3937429925313843721/posts/default/7917559522920441218'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3937429925313843721/posts/default/7917559522920441218'/><link rel='alternate' type='text/html' href='http://twigstechtips.blogspot.com/2011/10/python-check-if-ip-matches-or-in-valid.html' title='Python: Check if an IP matches or in a valid range'/><author><name>twig</name><uri>http://www.blogger.com/profile/12960052797537632822</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/_ih0G_MpWiYU/SLluoTm10_I/AAAAAAAAAFw/a4-gyOpb6JI/s1600-R/kung_fu.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3937429925313843721.post-1205854739245504723</id><published>2011-10-12T09:43:00.001+11:00</published><updated>2011-10-13T10:16:10.334+11:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='django'/><title type='text'>Django: Model distinct() and order_by() not working nicely together</title><summary type='text'>An interesting (and somewhat tedious) problem came up. We wanted to gather the most recently active blog authors sorted by post date.  Basically, it'd just be a distinct on the authors while sorting by latest post publication date.  In the words made famous by Jeremy Clarkson on Top Gear, "How hard can it be?". To be honest, quite hard.  Things were duplicated everywhere! After a few hours of </summary><link rel='replies' type='application/atom+xml' href='http://twigstechtips.blogspot.com/feeds/1205854739245504723/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://twigstechtips.blogspot.com/2011/10/django-model-distinct-and-orderby-not.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3937429925313843721/posts/default/1205854739245504723'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3937429925313843721/posts/default/1205854739245504723'/><link rel='alternate' type='text/html' href='http://twigstechtips.blogspot.com/2011/10/django-model-distinct-and-orderby-not.html' title='Django: Model distinct() and order_by() not working nicely together'/><author><name>twig</name><uri>http://www.blogger.com/profile/12960052797537632822</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/_ih0G_MpWiYU/SLluoTm10_I/AAAAAAAAAFw/a4-gyOpb6JI/s1600-R/kung_fu.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3937429925313843721.post-4820460057018343140</id><published>2011-10-12T09:42:00.001+11:00</published><updated>2011-10-12T09:42:54.421+11:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='python'/><title type='text'>Python: Fetching HTTPS urls which require username/password authentication</title><summary type='text'>It wasn't the easiest solution to find on the net, but a fairly simple one to implement.  Some solutions even suggest recompiling Python with OpenSSL installed. Sorry, too much trouble, not an option!   from urllib2 import URLError, HTTPPasswordMgrWithDefaultRealm, HTTPBasicAuthHandler, install_opener, build_opener  # Set up a HTTPS request with username/password authentication try:   # create a </summary><link rel='replies' type='application/atom+xml' href='http://twigstechtips.blogspot.com/feeds/4820460057018343140/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://twigstechtips.blogspot.com/2011/10/python-fetching-https-urls-which.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3937429925313843721/posts/default/4820460057018343140'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3937429925313843721/posts/default/4820460057018343140'/><link rel='alternate' type='text/html' href='http://twigstechtips.blogspot.com/2011/10/python-fetching-https-urls-which.html' title='Python: Fetching HTTPS urls which require username/password authentication'/><author><name>twig</name><uri>http://www.blogger.com/profile/12960052797537632822</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/_ih0G_MpWiYU/SLluoTm10_I/AAAAAAAAAFw/a4-gyOpb6JI/s1600-R/kung_fu.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://lh6.ggpht.com/-6i73Swm_1-Y/TpTGbbQQxQI/AAAAAAAABc8/c8FeHf3OFVc/s72-c/ExtRS_thumb.jpg?imgmax=800' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3937429925313843721.post-1829134279524835524</id><published>2011-10-12T09:40:00.001+11:00</published><updated>2011-10-12T09:41:29.877+11:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='python'/><title type='text'>Python: Calling CLI (command line) functions from code</title><summary type='text'>This was a tricky one for me. I was trying to use wget to download a file but it wouldn't work properly!   subprocess.call("wget --tries=3 --retry-connrefused http://dl.dropbox.com/u/446679/dog-bites-cat.jpg")   Once I ran it...  Traceback (most recent call last):      File "&lt;console&gt;", line 1, in &lt;module&gt;       File "/usr/lib/python2.6/subprocess.py", line 470, in call         return Popen(*</summary><link rel='replies' type='application/atom+xml' href='http://twigstechtips.blogspot.com/feeds/1829134279524835524/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://twigstechtips.blogspot.com/2011/10/python-calling-cli-command-line.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3937429925313843721/posts/default/1829134279524835524'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3937429925313843721/posts/default/1829134279524835524'/><link rel='alternate' type='text/html' href='http://twigstechtips.blogspot.com/2011/10/python-calling-cli-command-line.html' title='Python: Calling CLI (command line) functions from code'/><author><name>twig</name><uri>http://www.blogger.com/profile/12960052797537632822</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/_ih0G_MpWiYU/SLluoTm10_I/AAAAAAAAAFw/a4-gyOpb6JI/s1600-R/kung_fu.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3937429925313843721.post-6413855993696677627</id><published>2011-10-12T09:39:00.001+11:00</published><updated>2011-10-12T09:39:12.238+11:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='python'/><title type='text'>Python: Download image file from URL and retrieve common properties</title><summary type='text'>With the following snippets, you can get yourself:     Image width/height     Image mime type     File size    So, the code snippet!   from PIL import Image import urllib2 import cStringIO import os from stat import ST_SIZE   file = cStringIO.StringIO(urllib2.urlopen(image_url).read()) filename = "/tmp/file_%s.jpg" % datetime.datetime.now().strftime("%s")  image_info = Image.open(file) </summary><link rel='replies' type='application/atom+xml' href='http://twigstechtips.blogspot.com/feeds/6413855993696677627/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://twigstechtips.blogspot.com/2011/10/python-download-image-file-from-url-and.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3937429925313843721/posts/default/6413855993696677627'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3937429925313843721/posts/default/6413855993696677627'/><link rel='alternate' type='text/html' href='http://twigstechtips.blogspot.com/2011/10/python-download-image-file-from-url-and.html' title='Python: Download image file from URL and retrieve common properties'/><author><name>twig</name><uri>http://www.blogger.com/profile/12960052797537632822</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/_ih0G_MpWiYU/SLluoTm10_I/AAAAAAAAAFw/a4-gyOpb6JI/s1600-R/kung_fu.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3937429925313843721.post-2196810242210846458</id><published>2011-10-11T14:51:00.001+11:00</published><updated>2011-10-11T14:51:23.407+11:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='jquery'/><title type='text'>jQuery: Slide left and right like slideUp/slideDown but horizontally</title><summary type='text'>So easy that I wish I found this information sooner!  To show:   $('#selector').animate({ width: 'show' });   To hide:   $('#selector').animate({ width: 'hide' });   Alternatively, you can also give a fixed width when showing it.  Other than that, OMG you're done!     Source     jQuery animate() to hide and show elements by sliding left and right   </summary><link rel='replies' type='application/atom+xml' href='http://twigstechtips.blogspot.com/feeds/2196810242210846458/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://twigstechtips.blogspot.com/2011/10/jquery-slide-left-and-right-like.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3937429925313843721/posts/default/2196810242210846458'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3937429925313843721/posts/default/2196810242210846458'/><link rel='alternate' type='text/html' href='http://twigstechtips.blogspot.com/2011/10/jquery-slide-left-and-right-like.html' title='jQuery: Slide left and right like slideUp/slideDown but horizontally'/><author><name>twig</name><uri>http://www.blogger.com/profile/12960052797537632822</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/_ih0G_MpWiYU/SLluoTm10_I/AAAAAAAAAFw/a4-gyOpb6JI/s1600-R/kung_fu.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://lh6.ggpht.com/-NwcvqyembgQ/TpO9Oe1VvYI/AAAAAAAABcs/dKqi7DJdSbs/s72-c/OMG_thumb%25255B1%25255D.png?imgmax=800' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3937429925313843721.post-81991458508172070</id><published>2011-10-11T09:43:00.001+11:00</published><updated>2011-10-11T09:43:12.347+11:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='django'/><title type='text'>Django: Dynamic forms with dynamic fields</title><summary type='text'>Ok, dynamic fields. Now we're digging into the dark depths of Django. Not something you can find in the documentation, well me anyway.  There are a few posts online about it but some are fairly old, before the Django "newforms" were introduced. All that means is if you tried that code it won't work.  This example shows us how to:     Pass an argument to the form upon creation (user variable)     </summary><link rel='replies' type='application/atom+xml' href='http://twigstechtips.blogspot.com/feeds/81991458508172070/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://twigstechtips.blogspot.com/2011/10/django-dynamic-forms-with-dynamic.html#comment-form' title='10 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3937429925313843721/posts/default/81991458508172070'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3937429925313843721/posts/default/81991458508172070'/><link rel='alternate' type='text/html' href='http://twigstechtips.blogspot.com/2011/10/django-dynamic-forms-with-dynamic.html' title='Django: Dynamic forms with dynamic fields'/><author><name>twig</name><uri>http://www.blogger.com/profile/12960052797537632822</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/_ih0G_MpWiYU/SLluoTm10_I/AAAAAAAAAFw/a4-gyOpb6JI/s1600-R/kung_fu.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://lh3.ggpht.com/-6xFloLYcJD8/TpN0_8eMnEI/AAAAAAAABcg/t7VTmbfYEUQ/s72-c/nickshock_thumb.gif?imgmax=800' height='72' width='72'/><thr:total>10</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3937429925313843721.post-5784584142748999307</id><published>2011-10-11T09:12:00.001+11:00</published><updated>2011-10-11T09:43:44.247+11:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='django'/><title type='text'>Django: Optgroup option groups for Select field widgets</title><summary type='text'>To get your select choices to be grouped, you'll have to do a little trickery.     The resultant output in HTML is:   &lt;select id="id_choice" name="choice"&gt;   &lt;optgroup label="Audio"&gt;     &lt;option value="vinyl"&gt;Vinyl&lt;/option&gt;     &lt;option value="cd"&gt;CD&lt;/option&gt;   &lt;/optgroup&gt;   &lt;optgroup label="Video"&gt;     &lt;option value="vhs"&gt;VHS Tape&lt;/option&gt;     &lt;option value="dvd"&gt;DVD&lt;/option&gt;   &lt;/optgroup&gt;   &lt;</summary><link rel='replies' type='application/atom+xml' href='http://twigstechtips.blogspot.com/feeds/5784584142748999307/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://twigstechtips.blogspot.com/2011/10/django-optgroup-option-groups-for.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3937429925313843721/posts/default/5784584142748999307'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3937429925313843721/posts/default/5784584142748999307'/><link rel='alternate' type='text/html' href='http://twigstechtips.blogspot.com/2011/10/django-optgroup-option-groups-for.html' title='Django: Optgroup option groups for Select field widgets'/><author><name>twig</name><uri>http://www.blogger.com/profile/12960052797537632822</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/_ih0G_MpWiYU/SLluoTm10_I/AAAAAAAAAFw/a4-gyOpb6JI/s1600-R/kung_fu.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://lh4.ggpht.com/-EeYQQiAOAWk/TpNtrZG38RI/AAAAAAAABcQ/gj05DAlb8sk/s72-c/image_thumb.png?imgmax=800' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3937429925313843721.post-2281670947669821872</id><published>2011-10-10T00:34:00.001+11:00</published><updated>2011-10-10T00:34:21.553+11:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='diablo 2'/><title type='text'>Diablo 2 + Lord of Destruction: Play without CD</title><summary type='text'>As of patch v1.12, Blizzard allowed the game to be played without CD since they were offering the digital copy of it from their online store.     --------------------------------------------------------------------------     - Patch 1.12      --------------------------------------------------------------------------          Downloadable Installer Support     - If all required Diablo 2 '.MPQ' </summary><link rel='replies' type='application/atom+xml' href='http://twigstechtips.blogspot.com/feeds/2281670947669821872/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://twigstechtips.blogspot.com/2011/10/diablo-2-lord-of-destruction-play.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3937429925313843721/posts/default/2281670947669821872'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3937429925313843721/posts/default/2281670947669821872'/><link rel='alternate' type='text/html' href='http://twigstechtips.blogspot.com/2011/10/diablo-2-lord-of-destruction-play.html' title='Diablo 2 + Lord of Destruction: Play without CD'/><author><name>twig</name><uri>http://www.blogger.com/profile/12960052797537632822</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/_ih0G_MpWiYU/SLluoTm10_I/AAAAAAAAAFw/a4-gyOpb6JI/s1600-R/kung_fu.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://lh5.ggpht.com/-yE2VNX3jvq8/TpGi27FEwFI/AAAAAAAABcI/0WyWV03Hoxs/s72-c/image_thumb.png?imgmax=800' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3937429925313843721.post-1760209888887888505</id><published>2011-10-07T05:24:00.001+11:00</published><updated>2011-10-07T05:27:56.093+11:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='android'/><title type='text'>Android: Uploading files from the phone to a web server via HttpPost</title><summary type='text'>Alright, I'm getting sleepy so this post is straight down to business.  The early Android core libraries didn't come with very much in terms of HTTP and net socket support. The majority of the time they just said "use Apache's library, they're better".  Android has caught up, but if you want to keep existing devices happy, you'll still need the Apache libraries.     Under HttpClient 4.1.2 (GA), </summary><link rel='replies' type='application/atom+xml' href='http://twigstechtips.blogspot.com/feeds/1760209888887888505/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://twigstechtips.blogspot.com/2011/10/android-uploading-files-from-phone-to.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3937429925313843721/posts/default/1760209888887888505'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3937429925313843721/posts/default/1760209888887888505'/><link rel='alternate' type='text/html' href='http://twigstechtips.blogspot.com/2011/10/android-uploading-files-from-phone-to.html' title='Android: Uploading files from the phone to a web server via HttpPost'/><author><name>twig</name><uri>http://www.blogger.com/profile/12960052797537632822</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/_ih0G_MpWiYU/SLluoTm10_I/AAAAAAAAAFw/a4-gyOpb6JI/s1600-R/kung_fu.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://lh4.ggpht.com/--f732BQrx-I/To3yIYE5rPI/AAAAAAAABbQ/pW6Wp85i3S8/s72-c/image_thumb2.png?imgmax=800' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3937429925313843721.post-4024776219002518117</id><published>2011-10-07T04:46:00.001+11:00</published><updated>2011-10-07T04:46:52.568+11:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='android'/><title type='text'>Android: Allow user to edit/input text from an alert dialog</title><summary type='text'>This little snippet is a simple one, but it makes the user experience a whole lot better.  Instead of implementing a new Activity/screen to enter in some text, just make it an AlertDialog() with an EditText view.   final EditText txtUrl = new EditText(this);  // Set the default text to a link of the Queen txtUrl.setHint("http://www.librarising.com/astrology/celebs/images2/QR/queenelizabethii.jpg"</summary><link rel='replies' type='application/atom+xml' href='http://twigstechtips.blogspot.com/feeds/4024776219002518117/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://twigstechtips.blogspot.com/2011/10/android-allow-user-to-editinput-text.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3937429925313843721/posts/default/4024776219002518117'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3937429925313843721/posts/default/4024776219002518117'/><link rel='alternate' type='text/html' href='http://twigstechtips.blogspot.com/2011/10/android-allow-user-to-editinput-text.html' title='Android: Allow user to edit/input text from an alert dialog'/><author><name>twig</name><uri>http://www.blogger.com/profile/12960052797537632822</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/_ih0G_MpWiYU/SLluoTm10_I/AAAAAAAAAFw/a4-gyOpb6JI/s1600-R/kung_fu.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3937429925313843721.post-7908317909193430792</id><published>2011-10-07T04:34:00.001+11:00</published><updated>2011-10-07T04:34:29.838+11:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='android'/><title type='text'>Android: Select and open an image from Android's image gallery</title><summary type='text'>Well this certainly was harder than it should have been! The first three steps are pretty straight forward.  Set up an ID for the activity result.   private final int ACTIVITY_CHOOSE_PHOTO = 1;   Mission complete! On with the next phase. Now we need something to trigger the "chooser" activity.   Intent chooseFile = new Intent(Intent.ACTION_GET_CONTENT); chooseFile.setType("image/*"); </summary><link rel='replies' type='application/atom+xml' href='http://twigstechtips.blogspot.com/feeds/7908317909193430792/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://twigstechtips.blogspot.com/2011/10/android-select-and-open-image-from.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3937429925313843721/posts/default/7908317909193430792'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3937429925313843721/posts/default/7908317909193430792'/><link rel='alternate' type='text/html' href='http://twigstechtips.blogspot.com/2011/10/android-select-and-open-image-from.html' title='Android: Select and open an image from Android&amp;#39;s image gallery'/><author><name>twig</name><uri>http://www.blogger.com/profile/12960052797537632822</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/_ih0G_MpWiYU/SLluoTm10_I/AAAAAAAAAFw/a4-gyOpb6JI/s1600-R/kung_fu.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://lh3.ggpht.com/-L9uhZRvSRkg/To3mo21qDDI/AAAAAAAABbI/zimc9AHczFg/s72-c/1vcZA_thumb.gif?imgmax=800' height='72' width='72'/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3937429925313843721.post-1337580805033394886</id><published>2011-10-07T04:04:00.001+11:00</published><updated>2011-10-07T04:04:25.889+11:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='android'/><title type='text'>Android: Detect when a WebView has finished loading</title><summary type='text'>To know when a WebView has finished loading, you can set a WebViewClient() handler and override the onPageFinished() method.   ProgressDialog progressDialog = new ProgressDialog(ResultActivity.this); progressDialog.setMessage("Loading ...");  progressDialog.setCancelable(false); progressDialog.show();  WebView wv = new WebView(this);  wv.setWebViewClient(new WebViewClient() {   @Override   public</summary><link rel='replies' type='application/atom+xml' href='http://twigstechtips.blogspot.com/feeds/1337580805033394886/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://twigstechtips.blogspot.com/2011/10/android-detect-when-webview-has.html#comment-form' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3937429925313843721/posts/default/1337580805033394886'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3937429925313843721/posts/default/1337580805033394886'/><link rel='alternate' type='text/html' href='http://twigstechtips.blogspot.com/2011/10/android-detect-when-webview-has.html' title='Android: Detect when a WebView has finished loading'/><author><name>twig</name><uri>http://www.blogger.com/profile/12960052797537632822</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/_ih0G_MpWiYU/SLluoTm10_I/AAAAAAAAAFw/a4-gyOpb6JI/s1600-R/kung_fu.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://lh6.ggpht.com/-yW4NDAzHY0I/To3flyX9suI/AAAAAAAABa4/wtUZYkbeQHI/s72-c/1246086511568_thumb.gif?imgmax=800' height='72' width='72'/><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3937429925313843721.post-125529909322352423</id><published>2011-10-07T03:53:00.001+11:00</published><updated>2011-10-07T03:54:49.467+11:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='android'/><title type='text'>Android: Retrieve "version name" from AndroidManifest.xml</title><summary type='text'>I was getting sick of updating the version number on multiple places in my app when releasing updates; "About" screen, "version" variable and then in the Android manifest.  Since the application manifest already had android:versionName, why not use it?   try {   MyActivity.GAME_VERSION = getPackageManager().getPackageInfo(this.getPackageName(), 0).versionName; } catch (NameNotFoundException e) {</summary><link rel='replies' type='application/atom+xml' href='http://twigstechtips.blogspot.com/feeds/125529909322352423/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://twigstechtips.blogspot.com/2011/10/android-retrieve-name-from.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3937429925313843721/posts/default/125529909322352423'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3937429925313843721/posts/default/125529909322352423'/><link rel='alternate' type='text/html' href='http://twigstechtips.blogspot.com/2011/10/android-retrieve-name-from.html' title='Android: Retrieve &amp;quot;version name&amp;quot; from AndroidManifest.xml'/><author><name>twig</name><uri>http://www.blogger.com/profile/12960052797537632822</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/_ih0G_MpWiYU/SLluoTm10_I/AAAAAAAAAFw/a4-gyOpb6JI/s1600-R/kung_fu.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://lh5.ggpht.com/-tir9I-Rjhh8/To3c78jcRmI/AAAAAAAABaw/lBWATvjfSu0/s72-c/122500549513_thumb.gif?imgmax=800' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3937429925313843721.post-3341109625404443599</id><published>2011-10-06T19:52:00.001+11:00</published><updated>2011-10-06T20:03:54.082+11:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='android'/><title type='text'>Android: Resize a Bitmap image while dealing with immutable Bitmaps and OutOfMemoryError exceptions</title><summary type='text'>When I was first debugging my image watermark code, I found it strange it kept running out of memory. Why!?  You're doing it wrong!  Firstly, I was trying to edit an immutable (non-editable) Bitmap. You need to generate a mutable copy of the bitmap before you can start modifying it.  Secondly, my method was very heavy on memory usage. It involved loading the original immutable +4mega-pixel image </summary><link rel='replies' type='application/atom+xml' href='http://twigstechtips.blogspot.com/feeds/3341109625404443599/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://twigstechtips.blogspot.com/2011/10/android-resize-bitmap-image-while.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3937429925313843721/posts/default/3341109625404443599'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3937429925313843721/posts/default/3341109625404443599'/><link rel='alternate' type='text/html' href='http://twigstechtips.blogspot.com/2011/10/android-resize-bitmap-image-while.html' title='Android: Resize a Bitmap image while dealing with immutable Bitmaps and OutOfMemoryError exceptions'/><author><name>twig</name><uri>http://www.blogger.com/profile/12960052797537632822</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/_ih0G_MpWiYU/SLluoTm10_I/AAAAAAAAAFw/a4-gyOpb6JI/s1600-R/kung_fu.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://lh6.ggpht.com/-a117fDQ_OMc/To1sULwIMXI/AAAAAAAABak/TiDwMhii4XE/s72-c/turtle-power_thumb.gif?imgmax=800' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3937429925313843721.post-6736844545237476361</id><published>2011-10-06T18:09:00.001+11:00</published><updated>2011-10-06T18:14:41.037+11:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='android'/><title type='text'>Android: Download a file with progress indication</title><summary type='text'>The following example shows you how to:     download a file     display the progress in a progress dialog     use AsyncTask     create a temporary file      Like a BOSS   I've used this code in my app Moustachify Everything. Initially, the app didn't display the progress bar and it was annoying because you never know if it was actually doing anything.  it's a bit lengthy, but I assure you it's </summary><link rel='replies' type='application/atom+xml' href='http://twigstechtips.blogspot.com/feeds/6736844545237476361/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://twigstechtips.blogspot.com/2011/10/android-download-file-with-progress.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3937429925313843721/posts/default/6736844545237476361'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3937429925313843721/posts/default/6736844545237476361'/><link rel='alternate' type='text/html' href='http://twigstechtips.blogspot.com/2011/10/android-download-file-with-progress.html' title='Android: Download a file with progress indication'/><author><name>twig</name><uri>http://www.blogger.com/profile/12960052797537632822</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/_ih0G_MpWiYU/SLluoTm10_I/AAAAAAAAAFw/a4-gyOpb6JI/s1600-R/kung_fu.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://lh4.ggpht.com/-WIgvfte8NAU/To1VNALaA-I/AAAAAAAABac/0ROkmL4tJvY/s72-c/tumblr_lnmev5uOLt1qly6u1o1_400_thumb.gif?imgmax=800' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3937429925313843721.post-8756384137063124299</id><published>2011-10-06T17:39:00.001+11:00</published><updated>2011-10-06T17:39:16.721+11:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='android'/><title type='text'>Android: Scale a watermark Bitmap over another Bitmap using the Matrix</title><summary type='text'>What I set out to do was to overlay a logo over a photo and it was surprisingly easy with the use of the Matrix class.    No no, not him!  I've littered the code with comments, but if you need any more information leave a comment.   /**  * Adds a watermark on the given image.  */ public static Bitmap addWatermark(Resources res, Bitmap source) {   int w, h;   Canvas c;   Paint paint;   Bitmap bmp,</summary><link rel='replies' type='application/atom+xml' href='http://twigstechtips.blogspot.com/feeds/8756384137063124299/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://twigstechtips.blogspot.com/2011/10/android-scale-watermark-bitmap-over.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3937429925313843721/posts/default/8756384137063124299'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3937429925313843721/posts/default/8756384137063124299'/><link rel='alternate' type='text/html' href='http://twigstechtips.blogspot.com/2011/10/android-scale-watermark-bitmap-over.html' title='Android: Scale a watermark Bitmap over another Bitmap using the Matrix'/><author><name>twig</name><uri>http://www.blogger.com/profile/12960052797537632822</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/_ih0G_MpWiYU/SLluoTm10_I/AAAAAAAAAFw/a4-gyOpb6JI/s1600-R/kung_fu.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://lh3.ggpht.com/-SpGy33tfQsQ/To1NEptTG5I/AAAAAAAABaU/8t6ROgdHW8M/s72-c/image_thumb.png?imgmax=800' height='72' width='72'/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3937429925313843721.post-1666618401528307700</id><published>2011-10-06T17:00:00.001+11:00</published><updated>2011-10-06T17:00:53.651+11:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='android'/><title type='text'>Android: Share an image to other apps</title><summary type='text'>The last post was about receiving shared images.  To send off images to another app, just use:   Intent intent; File file;  file = new File(absolute_filename); intent = new Intent(Intent.ACTION_SEND); intent.setType("image/jpeg"); intent.putExtra(Intent.EXTRA_STREAM, Uri.fromFile(file));  startActivity(Intent.createChooser(intent, "Share photo"));   If you need to be particular about the mime </summary><link rel='replies' type='application/atom+xml' href='http://twigstechtips.blogspot.com/feeds/1666618401528307700/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://twigstechtips.blogspot.com/2011/10/android-share-image-to-other-apps.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3937429925313843721/posts/default/1666618401528307700'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3937429925313843721/posts/default/1666618401528307700'/><link rel='alternate' type='text/html' href='http://twigstechtips.blogspot.com/2011/10/android-share-image-to-other-apps.html' title='Android: Share an image to other apps'/><author><name>twig</name><uri>http://www.blogger.com/profile/12960052797537632822</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/_ih0G_MpWiYU/SLluoTm10_I/AAAAAAAAAFw/a4-gyOpb6JI/s1600-R/kung_fu.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3937429925313843721.post-8571054492686522481</id><published>2011-10-06T16:45:00.001+11:00</published><updated>2011-10-07T04:14:55.250+11:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='android'/><title type='text'>Android: Add your application to the "Share" menu</title><summary type='text'>Photo gallery &gt; Share &gt; Your App.     That'd be nice aye? Luckily, it's not that hard coz I've got sharing images or files using Intents working on my Mustachify Everything app quite nicely.  A couple of tweaks required though. First, indicate that your app is willing to deal with image files coming from the "SEND" action.  Using the Eclipse Android SDK, the AndroidManfest.xml config should look </summary><link rel='replies' type='application/atom+xml' href='http://twigstechtips.blogspot.com/feeds/8571054492686522481/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://twigstechtips.blogspot.com/2011/10/android-sharing-images-or-files-through.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3937429925313843721/posts/default/8571054492686522481'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3937429925313843721/posts/default/8571054492686522481'/><link rel='alternate' type='text/html' href='http://twigstechtips.blogspot.com/2011/10/android-sharing-images-or-files-through.html' title='Android: Add your application to the &amp;quot;Share&amp;quot; menu'/><author><name>twig</name><uri>http://www.blogger.com/profile/12960052797537632822</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/_ih0G_MpWiYU/SLluoTm10_I/AAAAAAAAAFw/a4-gyOpb6JI/s1600-R/kung_fu.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://lh5.ggpht.com/-kCT-IYz7e_c/To3hHcRybvI/AAAAAAAABbA/SgTxNF1ghxE/s72-c/share_thumb3%25255B3%25255D.png?imgmax=800' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3937429925313843721.post-8678626785612955090</id><published>2011-10-06T15:06:00.001+11:00</published><updated>2011-10-06T15:06:51.821+11:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='android'/><title type='text'>Android: Scale whole image to fit ImageView and keep aspect ratio</title><summary type='text'>It took me a while to figure out, but it's not ScaleType.FIT_XY that does the trick but FIT_CENTER.  FIT_XY will stretch both width and height to fit the ImageView.  Remember to use ImageView.setImageDrawable() or setImageBitmap() rather than setBackgroundDrawable().  Source: Android: Scale a Drawable or background image?  </summary><link rel='replies' type='application/atom+xml' href='http://twigstechtips.blogspot.com/feeds/8678626785612955090/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://twigstechtips.blogspot.com/2011/10/android-scale-whole-image-to-fit.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3937429925313843721/posts/default/8678626785612955090'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3937429925313843721/posts/default/8678626785612955090'/><link rel='alternate' type='text/html' href='http://twigstechtips.blogspot.com/2011/10/android-scale-whole-image-to-fit.html' title='Android: Scale whole image to fit ImageView and keep aspect ratio'/><author><name>twig</name><uri>http://www.blogger.com/profile/12960052797537632822</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/_ih0G_MpWiYU/SLluoTm10_I/AAAAAAAAAFw/a4-gyOpb6JI/s1600-R/kung_fu.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3937429925313843721.post-2319977775637854249</id><published>2011-10-06T14:51:00.001+11:00</published><updated>2011-10-06T14:51:04.195+11:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='android'/><title type='text'>Android: Loading jpg/png images from URL into a Bitmap or ImageView</title><summary type='text'>I was being driven insane this weird bug. The idea was simple enough.     Open a stream to a HTTP URL.    Use BitmapFactory to decode the stream.    ...    Profit.   Worked pretty well in the emulator! But for some reason on the actual test devices, it would fail every single time. Mind boggling!  After a few tests, I noticed something in the error logs.     decoder-&gt;decode returned false   The </summary><link rel='replies' type='application/atom+xml' href='http://twigstechtips.blogspot.com/feeds/2319977775637854249/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://twigstechtips.blogspot.com/2011/10/android-loading-jpgpng-images-from-url.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3937429925313843721/posts/default/2319977775637854249'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3937429925313843721/posts/default/2319977775637854249'/><link rel='alternate' type='text/html' href='http://twigstechtips.blogspot.com/2011/10/android-loading-jpgpng-images-from-url.html' title='Android: Loading jpg/png images from URL into a Bitmap or ImageView'/><author><name>twig</name><uri>http://www.blogger.com/profile/12960052797537632822</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/_ih0G_MpWiYU/SLluoTm10_I/AAAAAAAAAFw/a4-gyOpb6JI/s1600-R/kung_fu.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://lh4.ggpht.com/-KiVj9Qw6fcU/To0lpkGMpmI/AAAAAAAABZ0/WgPmNhmAjNM/s72-c/2fingers_thumb.gif?imgmax=800' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3937429925313843721.post-4270889003224128903</id><published>2011-10-06T14:07:00.001+11:00</published><updated>2011-10-06T14:07:50.861+11:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='android'/><title type='text'>Android: Copy paste text from PC to emulator</title><summary type='text'>Working with the Android emulator isn't as nice as working with a VMware virtual machine. You can't simply copy text from your notepad and paste it into the Android emulator.  A nice way of getting around it is using the SMS functionality accessible via telnet.  Assuming your emulator is running on port 5554, open up a command prompt window:     telnet localhost 5554    sms send +12345 your </summary><link rel='replies' type='application/atom+xml' href='http://twigstechtips.blogspot.com/feeds/4270889003224128903/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://twigstechtips.blogspot.com/2011/10/android-copy-paste-text-from-pc-to.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3937429925313843721/posts/default/4270889003224128903'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3937429925313843721/posts/default/4270889003224128903'/><link rel='alternate' type='text/html' href='http://twigstechtips.blogspot.com/2011/10/android-copy-paste-text-from-pc-to.html' title='Android: Copy paste text from PC to emulator'/><author><name>twig</name><uri>http://www.blogger.com/profile/12960052797537632822</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/_ih0G_MpWiYU/SLluoTm10_I/AAAAAAAAAFw/a4-gyOpb6JI/s1600-R/kung_fu.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3937429925313843721.post-3436674760505876668</id><published>2011-10-01T23:38:00.001+10:00</published><updated>2011-10-01T23:39:12.215+10:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='windows 8'/><title type='text'>Windows 8 Developers Preview: Disable the Metro Interface</title><summary type='text'>Sure it's designed for tablets and all, but I have a feeling Win8 might fall to the curse of the sucky "odd" release (Windows 3.1, Win98, XP and 7 were great! Win95, ME and Vista were terribad)  With this whole shift to ribbons and metro, I think I'll stick to Windows 7 (unless there was a way to disable all those bells and whistles).  You can grab a copy of it off Microsoft's official site.  </summary><link rel='replies' type='application/atom+xml' href='http://twigstechtips.blogspot.com/feeds/3436674760505876668/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://twigstechtips.blogspot.com/2011/10/windows-8-developers-preview-disable.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3937429925313843721/posts/default/3436674760505876668'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3937429925313843721/posts/default/3436674760505876668'/><link rel='alternate' type='text/html' href='http://twigstechtips.blogspot.com/2011/10/windows-8-developers-preview-disable.html' title='Windows 8 Developers Preview: Disable the Metro Interface'/><author><name>twig</name><uri>http://www.blogger.com/profile/12960052797537632822</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/_ih0G_MpWiYU/SLluoTm10_I/AAAAAAAAAFw/a4-gyOpb6JI/s1600-R/kung_fu.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3937429925313843721.post-5498085545055390942</id><published>2011-09-24T23:36:00.001+10:00</published><updated>2011-09-24T23:50:15.227+10:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='django'/><category scheme='http://www.blogger.com/atom/ns#' term='jquery'/><title type='text'>Django: Ajax POST and CSRF giving "403 Forbidden" responses</title><summary type='text'>If you want to protect your site from cross site request forgery, you'll have to enable the CSRF protection middleware.  You can do that by adding "django.middleware.csrf.CsrfViewMiddleware" to your MIDDLEWARE_CLASSES setting.  Once that's done, you have one of two ways to protect yourself.  When rendering forms, you can either:     use {{ form }} to print the form automatically     or if </summary><link rel='replies' type='application/atom+xml' href='http://twigstechtips.blogspot.com/feeds/5498085545055390942/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://twigstechtips.blogspot.com/2011/09/django-ajax-post-and-csrf-giving.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3937429925313843721/posts/default/5498085545055390942'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3937429925313843721/posts/default/5498085545055390942'/><link rel='alternate' type='text/html' href='http://twigstechtips.blogspot.com/2011/09/django-ajax-post-and-csrf-giving.html' title='Django: Ajax POST and CSRF giving &amp;quot;403 Forbidden&amp;quot; responses'/><author><name>twig</name><uri>http://www.blogger.com/profile/12960052797537632822</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/_ih0G_MpWiYU/SLluoTm10_I/AAAAAAAAAFw/a4-gyOpb6JI/s1600-R/kung_fu.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3937429925313843721.post-7596035208189273995</id><published>2011-09-11T13:10:00.001+10:00</published><updated>2011-09-11T15:44:26.076+10:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='android'/><title type='text'>Android: Get file mime type from filename</title><summary type='text'>Man, I wish it were this easy in all languages and platforms!  import android.webkit.MimeTypeMap;         MimeTypeMap.getSingleton().getMimeTypeFromExtension(MimeTypeMap.getFileExtensionFromUrl(source.substring(source.lastIndexOf("."))))   Where source would be either a filename or URL.  *same day edit*  Wow, that's a first I've had to update a post a few hours after putting it up.  There was a </summary><link rel='replies' type='application/atom+xml' href='http://twigstechtips.blogspot.com/feeds/7596035208189273995/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://twigstechtips.blogspot.com/2011/09/android-get-file-mime-type-from.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3937429925313843721/posts/default/7596035208189273995'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3937429925313843721/posts/default/7596035208189273995'/><link rel='alternate' type='text/html' href='http://twigstechtips.blogspot.com/2011/09/android-get-file-mime-type-from.html' title='Android: Get file mime type from filename'/><author><name>twig</name><uri>http://www.blogger.com/profile/12960052797537632822</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/_ih0G_MpWiYU/SLluoTm10_I/AAAAAAAAAFw/a4-gyOpb6JI/s1600-R/kung_fu.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3937429925313843721.post-8272720159476879631</id><published>2011-09-01T23:02:00.001+10:00</published><updated>2011-09-01T23:02:10.052+10:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='python'/><title type='text'>Python: Sort a list/tuple/class by specific field</title><summary type='text'>This is something that I have to do every once in a while and can never remember the method. To save myself some time, I've written this here in hope that I can remember it next time.   student_tuples = [   ('john', 'A', 15),   ('jane', 'B', 12),   ('dave', 'B', 10), ]  # sort by age sorted(student_tuples, key = lambda student: student[2])  [('dave', 'B', 10), ('jane', 'B', 12), ('john', 'A', 15)</summary><link rel='replies' type='application/atom+xml' href='http://twigstechtips.blogspot.com/feeds/8272720159476879631/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://twigstechtips.blogspot.com/2011/09/python-sort-listtupleclass-by-specific.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3937429925313843721/posts/default/8272720159476879631'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3937429925313843721/posts/default/8272720159476879631'/><link rel='alternate' type='text/html' href='http://twigstechtips.blogspot.com/2011/09/python-sort-listtupleclass-by-specific.html' title='Python: Sort a list/tuple/class by specific field'/><author><name>twig</name><uri>http://www.blogger.com/profile/12960052797537632822</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/_ih0G_MpWiYU/SLluoTm10_I/AAAAAAAAAFw/a4-gyOpb6JI/s1600-R/kung_fu.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3937429925313843721.post-7490464631631740393</id><published>2011-08-21T04:02:00.001+10:00</published><updated>2011-08-21T04:02:38.179+10:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='android'/><title type='text'>Android: Javascript not working in WebView</title><summary type='text'>I thought I had the wrong HTML, the wrong file paths, disabled internet connection, setting a WebChromeClient and setting the HTML doc-type to be STRICT.  In the end, I was just missing a vital call to enable it.  Allow JavaScript in your WebView by calling:     m_webview.getSettings().setJavaScriptEnabled(true);   How embarassing =P     Source: Using Android’s WebView, WebChromeClient and </summary><link rel='replies' type='application/atom+xml' href='http://twigstechtips.blogspot.com/feeds/7490464631631740393/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://twigstechtips.blogspot.com/2011/08/android-javascript-not-working-in.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3937429925313843721/posts/default/7490464631631740393'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3937429925313843721/posts/default/7490464631631740393'/><link rel='alternate' type='text/html' href='http://twigstechtips.blogspot.com/2011/08/android-javascript-not-working-in.html' title='Android: Javascript not working in WebView'/><author><name>twig</name><uri>http://www.blogger.com/profile/12960052797537632822</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/_ih0G_MpWiYU/SLluoTm10_I/AAAAAAAAAFw/a4-gyOpb6JI/s1600-R/kung_fu.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://lh4.ggpht.com/-OTdb_YxMqtc/Tk_2vMhM5fI/AAAAAAAABZs/0-B3EgX-EVc/s72-c/tumblr_lmn4a95IkA1qirywio1_400_thumb.gif?imgmax=800' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3937429925313843721.post-2928637449351580611</id><published>2011-08-18T20:34:00.001+10:00</published><updated>2011-08-18T20:35:07.189+10:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='android'/><title type='text'>Android: How to select a file</title><summary type='text'>An often useful feature is the ability to choose a file to fiddle with, may it be a photo, a music file or a text file.  To kick it off, we need to start an activity with an intent of ACTION_GET_CONTENT.   public class ActivityTestActivity extends Activity {   final int ACTIVITY_CHOOSE_FILE = 1;    @Override   public void onCreate(Bundle savedInstanceState) {     super.onCreate(savedInstanceState</summary><link rel='replies' type='application/atom+xml' href='http://twigstechtips.blogspot.com/feeds/2928637449351580611/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://twigstechtips.blogspot.com/2011/08/android-how-to-select-file.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3937429925313843721/posts/default/2928637449351580611'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3937429925313843721/posts/default/2928637449351580611'/><link rel='alternate' type='text/html' href='http://twigstechtips.blogspot.com/2011/08/android-how-to-select-file.html' title='Android: How to select a file'/><author><name>twig</name><uri>http://www.blogger.com/profile/12960052797537632822</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/_ih0G_MpWiYU/SLluoTm10_I/AAAAAAAAAFw/a4-gyOpb6JI/s1600-R/kung_fu.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://lh3.ggpht.com/-4UGJXN0sOR4/Tkzqq_5rfoI/AAAAAAAABZY/PN36JXmii9k/s72-c/WmVjM_thumb.gif?imgmax=800' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3937429925313843721.post-989276429241196227</id><published>2011-08-18T19:40:00.001+10:00</published><updated>2011-08-18T19:40:38.774+10:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='android'/><title type='text'>Android: Display local image/CSS files in HTML with WebView</title><summary type='text'>Displaying custom HTML in a WebView is pretty easy, as explained in a post I made long ago in 2009.  However, if you want to spruce it up with some images and CSS, you'll have to tweak it a little. Don't worry, it's not hard at all!  Here is an example that's a bit more verbose.   WebView wv = new WebView(this); StringBuilder html = new StringBuilder();  html.append("&lt;html&gt;"); html.append("&lt;head&gt;</summary><link rel='replies' type='application/atom+xml' href='http://twigstechtips.blogspot.com/feeds/989276429241196227/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://twigstechtips.blogspot.com/2011/08/android-display-local-imagecss-files-in.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3937429925313843721/posts/default/989276429241196227'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3937429925313843721/posts/default/989276429241196227'/><link rel='alternate' type='text/html' href='http://twigstechtips.blogspot.com/2011/08/android-display-local-imagecss-files-in.html' title='Android: Display local image/CSS files in HTML with WebView'/><author><name>twig</name><uri>http://www.blogger.com/profile/12960052797537632822</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/_ih0G_MpWiYU/SLluoTm10_I/AAAAAAAAAFw/a4-gyOpb6JI/s1600-R/kung_fu.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://lh4.ggpht.com/-bDW96BfjXM0/TkzeD3FYsdI/AAAAAAAABZI/Tujfu7UC92A/s72-c/image_thumb.png?imgmax=800' height='72' width='72'/><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3937429925313843721.post-3877497413680560401</id><published>2011-08-14T16:35:00.001+10:00</published><updated>2011-08-14T16:36:50.022+10:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='windows'/><category scheme='http://www.blogger.com/atom/ns#' term='sansa c250'/><title type='text'>Create a playlist on an MTP device</title><summary type='text'>If your device supports MTP (drag and drop using Windows Explorer), then it's likely you're wondering how to create a playlist without any extra software like Songbird, iTunes or Windows Media Player.  I personally use Songbird to sync music to my Sansa c250, but for those who don't want to do that you can still use Windows Explorer to create playlists.     Go to Windows Explorer and select the </summary><link rel='replies' type='application/atom+xml' href='http://twigstechtips.blogspot.com/feeds/3877497413680560401/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://twigstechtips.blogspot.com/2011/08/create-playlist-on-mtp-device.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3937429925313843721/posts/default/3877497413680560401'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3937429925313843721/posts/default/3877497413680560401'/><link rel='alternate' type='text/html' href='http://twigstechtips.blogspot.com/2011/08/create-playlist-on-mtp-device.html' title='Create a playlist on an MTP device'/><author><name>twig</name><uri>http://www.blogger.com/profile/12960052797537632822</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/_ih0G_MpWiYU/SLluoTm10_I/AAAAAAAAAFw/a4-gyOpb6JI/s1600-R/kung_fu.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://lh6.ggpht.com/-qVBkZmhm7gQ/TkdsoMTOsyI/AAAAAAAABZA/ptRcI_G2zEE/s72-c/db937ce032d9931b0ea5eb9e5afbff60_thumb.gif?imgmax=800' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3937429925313843721.post-878695714318793123</id><published>2011-08-14T15:59:00.001+10:00</published><updated>2011-08-14T16:01:15.047+10:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='css'/><title type='text'>CSS: Easy cross-browser compatible rounded borders/corners</title><summary type='text'>Most new browsers now support the rounded borders CSS3 attribute.  However, during the drafting period, it was all done differently. To properly support these browsers, you'll need some extra styling rules to make it work.  The way I do it is less compatible but uses no hacks such as external .HTC files or browser specific CSS files because I dislike these solutions.  The rounded borders should </summary><link rel='replies' type='application/atom+xml' href='http://twigstechtips.blogspot.com/feeds/878695714318793123/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://twigstechtips.blogspot.com/2011/08/css-easy-cross-browser-compatible.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3937429925313843721/posts/default/878695714318793123'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3937429925313843721/posts/default/878695714318793123'/><link rel='alternate' type='text/html' href='http://twigstechtips.blogspot.com/2011/08/css-easy-cross-browser-compatible.html' title='CSS: Easy cross-browser compatible rounded borders/corners'/><author><name>twig</name><uri>http://www.blogger.com/profile/12960052797537632822</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/_ih0G_MpWiYU/SLluoTm10_I/AAAAAAAAAFw/a4-gyOpb6JI/s1600-R/kung_fu.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3937429925313843721.post-3333101812560466365</id><published>2011-08-14T15:36:00.001+10:00</published><updated>2011-08-14T15:37:04.621+10:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ati'/><title type='text'>ATI: Disable spamming of system event logs by ati2mtag DVD_OV UVD Information</title><summary type='text'>If you've ever taken a quick glance at your Event Viewer, you may notice a shitload of messages from ati2mtag.    To disable this ridiculous debug spamming, run:     reg add HKLM\SYSTEM\CurrentControlSet\services\Atierecord /f /v eRecordEnable /d "0" /t REG_DWORD    Reboot.    You may have to do that every time you install a new driver.   Source: Thousands of ati2mtag event 62464s (DVD_OV UVD </summary><link rel='replies' type='application/atom+xml' href='http://twigstechtips.blogspot.com/feeds/3333101812560466365/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://twigstechtips.blogspot.com/2011/08/ati-disable-spamming-of-system-event.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3937429925313843721/posts/default/3333101812560466365'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3937429925313843721/posts/default/3333101812560466365'/><link rel='alternate' type='text/html' href='http://twigstechtips.blogspot.com/2011/08/ati-disable-spamming-of-system-event.html' title='ATI: Disable spamming of system event logs by ati2mtag DVD_OV UVD Information'/><author><name>twig</name><uri>http://www.blogger.com/profile/12960052797537632822</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/_ih0G_MpWiYU/SLluoTm10_I/AAAAAAAAAFw/a4-gyOpb6JI/s1600-R/kung_fu.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://lh4.ggpht.com/-yIg8_Z4TH0U/Tkde6bOPrfI/AAAAAAAABY0/23ATikFqdzA/s72-c/image_thumb.png?imgmax=800' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3937429925313843721.post-3170336950697194329</id><published>2011-08-12T23:44:00.001+10:00</published><updated>2011-08-12T23:44:01.433+10:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='billion'/><title type='text'>Billion 7700N: No ping reply from WAN</title><summary type='text'>I'm not quite sure why this is disabled by default, but I never seem to get a ping response from my router when checking from work.  When checking at home on the internal LAN, it works fine.  I kept poking around the firewall settings but nothing was there.  Then I stumbled across "Access Control" hidden away under "Management".  Click on "ICMP" to enable it under the WAN column.  That'll do the </summary><link rel='replies' type='application/atom+xml' href='http://twigstechtips.blogspot.com/feeds/3170336950697194329/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://twigstechtips.blogspot.com/2011/08/billion-7700n-no-ping-reply-from-wan.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3937429925313843721/posts/default/3170336950697194329'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3937429925313843721/posts/default/3170336950697194329'/><link rel='alternate' type='text/html' href='http://twigstechtips.blogspot.com/2011/08/billion-7700n-no-ping-reply-from-wan.html' title='Billion 7700N: No ping reply from WAN'/><author><name>twig</name><uri>http://www.blogger.com/profile/12960052797537632822</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/_ih0G_MpWiYU/SLluoTm10_I/AAAAAAAAAFw/a4-gyOpb6JI/s1600-R/kung_fu.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://lh3.ggpht.com/-nl-DLbLBib0/TkUuH7SKVjI/AAAAAAAABYo/hnoZu0kVewY/s72-c/BiPAC7700N_thumb.png?imgmax=800' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3937429925313843721.post-4620052002169590589</id><published>2011-08-07T11:02:00.001+10:00</published><updated>2011-08-07T11:03:10.474+10:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='windows'/><title type='text'>Windows: How to check the original install date</title><summary type='text'>This was a bit of a doozey for me, but very simple to find out.  Go to a command prompt window and type "systeminfo"  This will spit out a whole heap of info. The "Original Install Date" line is what you're after, somewhere near the top.  If you've got a lot of patches installed, it'll flood that line off the screen.  To prevent that, save the output to a file instead.  Type "systeminfo &gt; </summary><link rel='replies' type='application/atom+xml' href='http://twigstechtips.blogspot.com/feeds/4620052002169590589/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://twigstechtips.blogspot.com/2011/08/windows-how-to-check-original-install.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3937429925313843721/posts/default/4620052002169590589'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3937429925313843721/posts/default/4620052002169590589'/><link rel='alternate' type='text/html' href='http://twigstechtips.blogspot.com/2011/08/windows-how-to-check-original-install.html' title='Windows: How to check the original install date'/><author><name>twig</name><uri>http://www.blogger.com/profile/12960052797537632822</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/_ih0G_MpWiYU/SLluoTm10_I/AAAAAAAAAFw/a4-gyOpb6JI/s1600-R/kung_fu.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://lh3.ggpht.com/-qYX9Ah4raSg/Tj3kExN6NkI/AAAAAAAABYg/XfEQ8kfdn8Y/s72-c/nomnomnom_thumb.gif?imgmax=800' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3937429925313843721.post-6821816999140077088</id><published>2011-08-01T16:33:00.000+10:00</published><updated>2011-10-13T09:32:49.420+11:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='django'/><title type='text'>Django: Display a field specific error in your Form/ModelForm</title><summary type='text'>Django forms are incredibly flexible, but they're also a little cumbersome when it comes to errors.  The following example shows you that you can display an error for:     a specific field     a specific field from another field     the form as a whole    class EventForm(forms.ModelForm):   class Meta:     model = Event    title = forms.CharField(required = True)   lawyer = forms.CharField(</summary><link rel='replies' type='application/atom+xml' href='http://twigstechtips.blogspot.com/feeds/6821816999140077088/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://twigstechtips.blogspot.com/2011/08/django-display-field-specific-error-in.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3937429925313843721/posts/default/6821816999140077088'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3937429925313843721/posts/default/6821816999140077088'/><link rel='alternate' type='text/html' href='http://twigstechtips.blogspot.com/2011/08/django-display-field-specific-error-in.html' title='Django: Display a field specific error in your Form/ModelForm'/><author><name>twig</name><uri>http://www.blogger.com/profile/12960052797537632822</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/_ih0G_MpWiYU/SLluoTm10_I/AAAAAAAAAFw/a4-gyOpb6JI/s1600-R/kung_fu.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3937429925313843721.post-7749562852599180504</id><published>2011-07-31T22:34:00.001+10:00</published><updated>2011-07-31T22:34:38.504+10:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='facebook'/><title type='text'>Facebook: Ignoring privacy settings for ads shown by third parties</title><summary type='text'>So one day I was reading an article on Engadget and noticed something on the right side column...     Yep, Facebook activity! Creepy stuff... But I do vaguely remember taking the time to go through all my privacy options at once stage to disabling these sorta things.  So yet again I ventured off searching through the labyrinth. When I finally found the settings for friends and third party...   </summary><link rel='replies' type='application/atom+xml' href='http://twigstechtips.blogspot.com/feeds/7749562852599180504/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://twigstechtips.blogspot.com/2011/07/facebook-ignoring-privacy-settings-for.html#comment-form' title='15 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3937429925313843721/posts/default/7749562852599180504'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3937429925313843721/posts/default/7749562852599180504'/><link rel='alternate' type='text/html' href='http://twigstechtips.blogspot.com/2011/07/facebook-ignoring-privacy-settings-for.html' title='Facebook: Ignoring privacy settings for ads shown by third parties'/><author><name>twig</name><uri>http://www.blogger.com/profile/12960052797537632822</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/_ih0G_MpWiYU/SLluoTm10_I/AAAAAAAAAFw/a4-gyOpb6JI/s1600-R/kung_fu.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://lh3.ggpht.com/-zWiuHnNGZCo/TjVL0kZnTgI/AAAAAAAABX4/j_U_zXUpI_s/s72-c/image_thumb.png?imgmax=800' height='72' width='72'/><thr:total>15</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3937429925313843721.post-7874574686931404491</id><published>2011-07-28T16:33:00.000+10:00</published><updated>2011-10-13T09:40:26.002+11:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='android'/><title type='text'>Android SDK: Move the location of virtual machines</title><summary type='text'>Holy cow, because Windows Vista/7 keeps eating up my space on C:, I had to look for what was eating up my space.  To my surprise, "C:\Users\twig\.android\" was also taking up quite a bit of space also.  So, I decided to move it.  By default, the environment variable ANDROID_SDK_HOME points to "C:\Users\twig\" (Windows Vista/7, should be different for XP).  To change yours (on Windows 7):     </summary><link rel='replies' type='application/atom+xml' href='http://twigstechtips.blogspot.com/feeds/7874574686931404491/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://twigstechtips.blogspot.com/2011/07/android-sdk-move-location-of-virtual.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3937429925313843721/posts/default/7874574686931404491'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3937429925313843721/posts/default/7874574686931404491'/><link rel='alternate' type='text/html' href='http://twigstechtips.blogspot.com/2011/07/android-sdk-move-location-of-virtual.html' title='Android SDK: Move the location of virtual machines'/><author><name>twig</name><uri>http://www.blogger.com/profile/12960052797537632822</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/_ih0G_MpWiYU/SLluoTm10_I/AAAAAAAAAFw/a4-gyOpb6JI/s1600-R/kung_fu.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://lh5.ggpht.com/--Fw8N_hKGyk/TpYXV8X_11I/AAAAAAAABeM/ZmhuYsANjJ0/s72-c/1312234113186b65i_thumb.gif?imgmax=800' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3937429925313843721.post-3826505515044258620</id><published>2011-07-24T15:41:00.001+10:00</published><updated>2011-07-24T15:42:34.843+10:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='linux'/><title type='text'>Linux/Ubuntu/LinuxMint: Set up a swap file</title><summary type='text'>I forgot to set up a swap partition during setup, so figured I'd use a swap file instead, in case I messed up the Mac OSX boot partition.  First, create an empty file. To know how much you need, see here. In this example, I'm using a 1GB (1024mb) swap file. Use the following command to make it:     sudo mkdir /swapfile    sudo dd if=/dev/zero of=/swapfile/1024mb.swap bs=1024 count=1048576   Now </summary><link rel='replies' type='application/atom+xml' href='http://twigstechtips.blogspot.com/feeds/3826505515044258620/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://twigstechtips.blogspot.com/2011/07/linuxubuntulinuxmint-set-up-swap-file.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3937429925313843721/posts/default/3826505515044258620'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3937429925313843721/posts/default/3826505515044258620'/><link rel='alternate' type='text/html' href='http://twigstechtips.blogspot.com/2011/07/linuxubuntulinuxmint-set-up-swap-file.html' title='Linux/Ubuntu/LinuxMint: Set up a swap file'/><author><name>twig</name><uri>http://www.blogger.com/profile/12960052797537632822</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/_ih0G_MpWiYU/SLluoTm10_I/AAAAAAAAAFw/a4-gyOpb6JI/s1600-R/kung_fu.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://lh5.ggpht.com/-051KxkmeTHo/TiuwcoN7uoI/AAAAAAAABXw/FWLy3xalqgQ/s72-c/image_thumb.png?imgmax=800' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3937429925313843721.post-5896409791186633261</id><published>2011-07-18T14:08:00.001+10:00</published><updated>2011-07-18T14:09:08.937+10:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='vi'/><title type='text'>Vim: Change the default color scheme/theme</title><summary type='text'>You can set this manually in the editor by entering the command ":colorscheme murphy".  Or you can automate it by editing "~/.vimrc" and adding a line     "colorscheme murphy".     This post seems too short, so here's a random GIF to go with it =)  </summary><link rel='replies' type='application/atom+xml' href='http://twigstechtips.blogspot.com/feeds/5896409791186633261/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://twigstechtips.blogspot.com/2011/07/vim-change-default-color-schemetheme.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3937429925313843721/posts/default/5896409791186633261'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3937429925313843721/posts/default/5896409791186633261'/><link rel='alternate' type='text/html' href='http://twigstechtips.blogspot.com/2011/07/vim-change-default-color-schemetheme.html' title='Vim: Change the default color scheme/theme'/><author><name>twig</name><uri>http://www.blogger.com/profile/12960052797537632822</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/_ih0G_MpWiYU/SLluoTm10_I/AAAAAAAAAFw/a4-gyOpb6JI/s1600-R/kung_fu.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://lh3.ggpht.com/-fzt1GLAEMp4/TiOx0zkMiOI/AAAAAAAABXo/eQUHuc8yvdk/s72-c/doing_it_wrong49_thumb.gif?imgmax=800' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3937429925313843721.post-3778958219995103222</id><published>2011-07-18T13:59:00.001+10:00</published><updated>2011-07-18T13:59:18.908+10:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='linux'/><title type='text'>SSH: Slow connection times when entering username and password</title><summary type='text'>For some obscure reason, my SSH login was taking a long time to verify. At first I didn't realise because I've been using my Android phone the whole time, but then I tried it on a LAN connection and it still had the same issue.  The problem would go like this:     Connect to OpenSSH server    Enter in username    Wait approximately 3 seconds    Enter in password    Wait approximately 5 seconds</summary><link rel='replies' type='application/atom+xml' href='http://twigstechtips.blogspot.com/feeds/3778958219995103222/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://twigstechtips.blogspot.com/2011/07/ssh-slow-connection-times-when-entering.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3937429925313843721/posts/default/3778958219995103222'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3937429925313843721/posts/default/3778958219995103222'/><link rel='alternate' type='text/html' href='http://twigstechtips.blogspot.com/2011/07/ssh-slow-connection-times-when-entering.html' title='SSH: Slow connection times when entering username and password'/><author><name>twig</name><uri>http://www.blogger.com/profile/12960052797537632822</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/_ih0G_MpWiYU/SLluoTm10_I/AAAAAAAAAFw/a4-gyOpb6JI/s1600-R/kung_fu.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3937429925313843721.post-5225238851813139217</id><published>2011-07-12T09:11:00.001+10:00</published><updated>2011-07-12T09:12:37.428+10:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='django'/><title type='text'>Django: Using regroup template tag to group a list by letter</title><summary type='text'>Sometimes the easy part is pulling data out but the hard part is actually displaying it nicely.  On some index pages, you can often categorise the list by the first letter of the name. This makes it a lot easier to find the information you're after.  For example, displaying a list of apps in an index page.  We use the built-in tag "regroup" to do this.   {% regroup apps by name.0 as </summary><link rel='replies' type='application/atom+xml' href='http://twigstechtips.blogspot.com/feeds/5225238851813139217/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://twigstechtips.blogspot.com/2011/07/django-using-regroup-template-tag-to.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3937429925313843721/posts/default/5225238851813139217'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3937429925313843721/posts/default/5225238851813139217'/><link rel='alternate' type='text/html' href='http://twigstechtips.blogspot.com/2011/07/django-using-regroup-template-tag-to.html' title='Django: Using regroup template tag to group a list by letter'/><author><name>twig</name><uri>http://www.blogger.com/profile/12960052797537632822</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/_ih0G_MpWiYU/SLluoTm10_I/AAAAAAAAAFw/a4-gyOpb6JI/s1600-R/kung_fu.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3937429925313843721.post-696785932608702811</id><published>2011-07-12T09:10:00.001+10:00</published><updated>2011-07-12T09:10:35.132+10:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='python'/><title type='text'>Python: Simplest method for zero-padding a number</title><summary type='text'>Harley provides an awesome method for zero padding a number in a string.  If the number is provided in string format:   n = '4' print n.zfill(3) '004'   And for integer format:   n = 4 print '%03d' % n '004'   Source     Python: Nicest way to pad zeroes to string   </summary><link rel='replies' type='application/atom+xml' href='http://twigstechtips.blogspot.com/feeds/696785932608702811/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://twigstechtips.blogspot.com/2011/07/python-simplest-method-for-zero-padding.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3937429925313843721/posts/default/696785932608702811'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3937429925313843721/posts/default/696785932608702811'/><link rel='alternate' type='text/html' href='http://twigstechtips.blogspot.com/2011/07/python-simplest-method-for-zero-padding.html' title='Python: Simplest method for zero-padding a number'/><author><name>twig</name><uri>http://www.blogger.com/profile/12960052797537632822</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/_ih0G_MpWiYU/SLluoTm10_I/AAAAAAAAAFw/a4-gyOpb6JI/s1600-R/kung_fu.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3937429925313843721.post-4378138138407850697</id><published>2011-07-06T10:02:00.001+10:00</published><updated>2011-07-06T10:02:47.207+10:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='django'/><title type='text'>Django: Filter to get linked object from comment</title><summary type='text'>While I'm on the topic of linking objects to comments, a handy filter to have is the ability to convert an object into the linked object.   @register.filter def get_comment_object(comment):   """   This is the reverse, it gets an object from the comment   """   return comment.content_type.get_object_for_this_type(pk = comment.object_pk)   To use it, just call:     {{ comment|get_comment_object }}</summary><link rel='replies' type='application/atom+xml' href='http://twigstechtips.blogspot.com/feeds/4378138138407850697/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://twigstechtips.blogspot.com/2011/07/django-filter-to-get-linked-object-from.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3937429925313843721/posts/default/4378138138407850697'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3937429925313843721/posts/default/4378138138407850697'/><link rel='alternate' type='text/html' href='http://twigstechtips.blogspot.com/2011/07/django-filter-to-get-linked-object-from.html' title='Django: Filter to get linked object from comment'/><author><name>twig</name><uri>http://www.blogger.com/profile/12960052797537632822</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/_ih0G_MpWiYU/SLluoTm10_I/AAAAAAAAAFw/a4-gyOpb6JI/s1600-R/kung_fu.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3937429925313843721.post-4855799083581674904</id><published>2011-07-06T09:31:00.001+10:00</published><updated>2011-07-06T09:31:53.435+10:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='django'/><title type='text'>Django: Link comments to objects for use with ORM QuerySet and filters</title><summary type='text'>For a long time I've been meaning to find a more convenient way to filter comments. I really disliked the way we had to retrieve them through a tag, which either retrieved "all or nothing".  Sometimes it's necessary to retrieve comments from a subset of objects, such as comments for all blog posts "in category Cars".  To do this efficiently with minimal changes to the database, we'll need a proxy</summary><link rel='replies' type='application/atom+xml' href='http://twigstechtips.blogspot.com/feeds/4855799083581674904/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://twigstechtips.blogspot.com/2011/07/django-link-comments-to-objects-for-use.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3937429925313843721/posts/default/4855799083581674904'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3937429925313843721/posts/default/4855799083581674904'/><link rel='alternate' type='text/html' href='http://twigstechtips.blogspot.com/2011/07/django-link-comments-to-objects-for-use.html' title='Django: Link comments to objects for use with ORM QuerySet and filters'/><author><name>twig</name><uri>http://www.blogger.com/profile/12960052797537632822</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/_ih0G_MpWiYU/SLluoTm10_I/AAAAAAAAAFw/a4-gyOpb6JI/s1600-R/kung_fu.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://lh6.ggpht.com/-7drIA_f-edk/ThOe5nB0H-I/AAAAAAAABXg/9HOSEdLjkLA/s72-c/swzbec_thumb.gif?imgmax=800' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3937429925313843721.post-2487388043127223408</id><published>2011-07-03T13:28:00.001+10:00</published><updated>2011-07-03T13:28:34.716+10:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='android'/><title type='text'>Android: Downloading adb without the SDK</title><summary type='text'>A lot of Android guides refer to a program called "adb", which comes from the Android software development kit.  The development kit contains all tools and software required to begin creating your own Android applications.  However, it is roughly 30mb in size and that's a whole heap of useless junk if you're only after "adb", which is 3 files and 718kb in size.     Firstly, you'll need a program </summary><link rel='replies' type='application/atom+xml' href='http://twigstechtips.blogspot.com/feeds/2487388043127223408/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://twigstechtips.blogspot.com/2011/07/android-downloading-adb-without-sdk.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3937429925313843721/posts/default/2487388043127223408'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3937429925313843721/posts/default/2487388043127223408'/><link rel='alternate' type='text/html' href='http://twigstechtips.blogspot.com/2011/07/android-downloading-adb-without-sdk.html' title='Android: Downloading adb without the SDK'/><author><name>twig</name><uri>http://www.blogger.com/profile/12960052797537632822</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/_ih0G_MpWiYU/SLluoTm10_I/AAAAAAAAAFw/a4-gyOpb6JI/s1600-R/kung_fu.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://lh3.ggpht.com/-l2Y9BF7PwQ8/Tg_hxJI38QI/AAAAAAAABXI/KPuPM1d_WMA/s72-c/dolphin-punch_thumb.gif?imgmax=800' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3937429925313843721.post-3125986930672494183</id><published>2011-07-03T03:05:00.001+10:00</published><updated>2011-07-03T03:05:30.000+10:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='firefox'/><title type='text'>Firefox 4: Disable switch-to-tab</title><summary type='text'>The "switch to tab" feature is one of those improvements I believe didn't need to happen.  It has our best interests at heart but does a sloppy job of helping out.  What I sometimes do is load a dev page in one tab and keep it open. Then I make some changes and open a new tab to compare the changes.  The "switch to tab" feature makes it impossible for me to do this! A "feature" that prevents me </summary><link rel='replies' type='application/atom+xml' href='http://twigstechtips.blogspot.com/feeds/3125986930672494183/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://twigstechtips.blogspot.com/2011/07/firefox-4-disable-switch-to-tab.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3937429925313843721/posts/default/3125986930672494183'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3937429925313843721/posts/default/3125986930672494183'/><link rel='alternate' type='text/html' href='http://twigstechtips.blogspot.com/2011/07/firefox-4-disable-switch-to-tab.html' title='Firefox 4: Disable switch-to-tab'/><author><name>twig</name><uri>http://www.blogger.com/profile/12960052797537632822</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/_ih0G_MpWiYU/SLluoTm10_I/AAAAAAAAAFw/a4-gyOpb6JI/s1600-R/kung_fu.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://lh5.ggpht.com/-tIuHn1XSi_k/Tg9P2IOZIGI/AAAAAAAABXA/V-DEt3pZrno/s72-c/image_thumb1.png?imgmax=800' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3937429925313843721.post-3113226770051986645</id><published>2011-06-27T00:31:00.003+10:00</published><updated>2011-07-24T16:10:10.068+10:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='linux'/><category scheme='http://www.blogger.com/atom/ns#' term='windows'/><category scheme='http://www.blogger.com/atom/ns#' term='hardware'/><title type='text'>Wake up on LAN on Windows and Linux</title><summary type='text'>To set up the wake on LAN feature, it requires a little bit of patience and testing.  If you're looking to wake up your Linux machine, see the link in the "sources" below.  The Windows sleeper  Assuming that your machine is running Windows, you'll need to set some stuff on your network interface card (NIC).  Configure NIC     Open up the settings dialog for your network card     Click on "</summary><link rel='replies' type='application/atom+xml' href='http://twigstechtips.blogspot.com/feeds/3113226770051986645/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://twigstechtips.blogspot.com/2011/06/wake-up-on-lan-on-windows-and-linux.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3937429925313843721/posts/default/3113226770051986645'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3937429925313843721/posts/default/3113226770051986645'/><link rel='alternate' type='text/html' href='http://twigstechtips.blogspot.com/2011/06/wake-up-on-lan-on-windows-and-linux.html' title='Wake up on LAN on Windows and Linux'/><author><name>twig</name><uri>http://www.blogger.com/profile/12960052797537632822</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/_ih0G_MpWiYU/SLluoTm10_I/AAAAAAAAAFw/a4-gyOpb6JI/s1600-R/kung_fu.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://lh5.ggpht.com/-1Igc_ZZjLEs/TgdCgCtd-7I/AAAAAAAABWg/okhkSREt2f8/s72-c/image_thumb3.png?imgmax=800' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3937429925313843721.post-5614713469156244324</id><published>2011-06-26T22:18:00.001+10:00</published><updated>2011-06-26T22:22:11.347+10:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='linux'/><title type='text'>Linux: Editing Gnome panels causes system to lock up and freeze before the desktop is visible</title><summary type='text'>I'm not sure what sort of Linux gods I have angered but it seems they have it in for me.     I was editing a secondary panel and moving the applets around when suddenly the system crashed.  Fair enough, I'll just restart the thing and just try again. However, I wasn't lucky enough to get back into the system...  The desktop froze at a black screen, showing only the faulty secondary panel. No </summary><link rel='replies' type='application/atom+xml' href='http://twigstechtips.blogspot.com/feeds/5614713469156244324/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://twigstechtips.blogspot.com/2011/06/linux-editing-gnome-panels-causes.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3937429925313843721/posts/default/5614713469156244324'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3937429925313843721/posts/default/5614713469156244324'/><link rel='alternate' type='text/html' href='http://twigstechtips.blogspot.com/2011/06/linux-editing-gnome-panels-causes.html' title='Linux: Editing Gnome panels causes system to lock up and freeze before the desktop is visible'/><author><name>twig</name><uri>http://www.blogger.com/profile/12960052797537632822</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/_ih0G_MpWiYU/SLluoTm10_I/AAAAAAAAAFw/a4-gyOpb6JI/s1600-R/kung_fu.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://lh4.ggpht.com/-LW8mRpIWXV4/TgcjoAx8dqI/AAAAAAAABWQ/g5IV6tPlBag/s72-c/facialflambep1_thumb.gif?imgmax=800' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3937429925313843721.post-690468913899560595</id><published>2011-06-23T09:37:00.001+10:00</published><updated>2011-06-23T09:37:17.376+10:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='firefox'/><title type='text'>Firefox 4: Disable auto update of addons</title><summary type='text'>This was completely unknown to me until a certain much-used Firebug feature was removed.     HTML preview feature available again in Firebug 1.8   They had pushed out a security update but removed the HTML preview feature which I use quite often due to my work with AJAX/JSON.  Fuck, what was I to do?  First, prevention is always better than a cure. Stop the automatic updates!     Open up your </summary><link rel='replies' type='application/atom+xml' href='http://twigstechtips.blogspot.com/feeds/690468913899560595/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://twigstechtips.blogspot.com/2011/06/firefox-4-disable-auto-update-of-addons.html#comment-form' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3937429925313843721/posts/default/690468913899560595'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3937429925313843721/posts/default/690468913899560595'/><link rel='alternate' type='text/html' href='http://twigstechtips.blogspot.com/2011/06/firefox-4-disable-auto-update-of-addons.html' title='Firefox 4: Disable auto update of addons'/><author><name>twig</name><uri>http://www.blogger.com/profile/12960052797537632822</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/_ih0G_MpWiYU/SLluoTm10_I/AAAAAAAAAFw/a4-gyOpb6JI/s1600-R/kung_fu.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://lh6.ggpht.com/-CLp3WyvIsk8/TgJ8qzSEEjI/AAAAAAAABWA/9lClg0EaV-s/s72-c/image_thumb.png?imgmax=800' height='72' width='72'/><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3937429925313843721.post-7121441812372209719</id><published>2011-06-22T09:33:00.001+10:00</published><updated>2011-06-23T10:10:57.356+10:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='django'/><title type='text'>django: Date time picker on a custom form without undocumented hacks or importing admin files</title><summary type='text'>The problem  I tried using the forms.DateTimeField and forms.DateField in my form and it kept coming up with "Enter a valid date/time.", despite the fact I given the custom "input_formats" in the constructor.  Most of the search results bring you back to a post on StackOverflow called "Using Django time/date widgets in custom form". It's basically reusing the JS widget that you can access in the </summary><link rel='replies' type='application/atom+xml' href='http://twigstechtips.blogspot.com/feeds/7121441812372209719/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://twigstechtips.blogspot.com/2011/06/django-date-time-picker-on-custom-form.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3937429925313843721/posts/default/7121441812372209719'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3937429925313843721/posts/default/7121441812372209719'/><link rel='alternate' type='text/html' href='http://twigstechtips.blogspot.com/2011/06/django-date-time-picker-on-custom-form.html' title='django: Date time picker on a custom form without undocumented hacks or importing admin files'/><author><name>twig</name><uri>http://www.blogger.com/profile/12960052797537632822</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/_ih0G_MpWiYU/SLluoTm10_I/AAAAAAAAAFw/a4-gyOpb6JI/s1600-R/kung_fu.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://lh6.ggpht.com/-pYrx5u0FInA/TgEqRO0El8I/AAAAAAAABVs/7kE9l_vLJLE/s72-c/magnetic-boy-Ivan-Stoiljkovic-1_thumb.jpg?imgmax=800' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3937429925313843721.post-2544823779579527222</id><published>2011-06-20T10:28:00.001+10:00</published><updated>2011-06-20T10:28:21.073+10:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='git'/><title type='text'>Git: Cherry-picking and removing git commits</title><summary type='text'>So I dun goofed one of my workmate's git branches and had to remove one commit from the history.     You may have noticed that this was buried under a whole stack of other commits...  Normally, if you've made an accidental commit and realised straight away, you can just do:   git reset HEAD^   This will pop off the latest commit but leave all of your changes to the files intact.  Because this </summary><link rel='replies' type='application/atom+xml' href='http://twigstechtips.blogspot.com/feeds/2544823779579527222/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://twigstechtips.blogspot.com/2011/06/git-cherry-picking-and-removing-git.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3937429925313843721/posts/default/2544823779579527222'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3937429925313843721/posts/default/2544823779579527222'/><link rel='alternate' type='text/html' href='http://twigstechtips.blogspot.com/2011/06/git-cherry-picking-and-removing-git.html' title='Git: Cherry-picking and removing git commits'/><author><name>twig</name><uri>http://www.blogger.com/profile/12960052797537632822</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/_ih0G_MpWiYU/SLluoTm10_I/AAAAAAAAAFw/a4-gyOpb6JI/s1600-R/kung_fu.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://lh5.ggpht.com/-p3oZ8BoPHg8/Tf6UI85T1VI/AAAAAAAABVk/YcFdhTx7rf8/s72-c/cherry-pick_thumb%25255B1%25255D.png?imgmax=800' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3937429925313843721.post-5984339630047428710</id><published>2011-06-19T23:57:00.002+10:00</published><updated>2011-07-06T10:08:03.176+10:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='windows'/><category scheme='http://www.blogger.com/atom/ns#' term='hardware'/><title type='text'>Windows: Create a boot USB from Windows setup CD/DVD</title><summary type='text'>I had to format a HP Mini and an EEE PC (both have no DVD drive) so the only option was to boot the little sorry excuse for a computer by USB.
I stumbled upon this blog as one of the first hits, and amazingly it was very easy to get Windows booting up on USB. It supports Windows XP/2003/Vista/2008/7 and even Windows 8 beta!
For best results, it's a good idea to use the target OS to create the </summary><link rel='replies' type='application/atom+xml' href='http://twigstechtips.blogspot.com/feeds/5984339630047428710/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://twigstechtips.blogspot.com/2011/06/windows-create-live-boot-usb-from.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3937429925313843721/posts/default/5984339630047428710'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3937429925313843721/posts/default/5984339630047428710'/><link rel='alternate' type='text/html' href='http://twigstechtips.blogspot.com/2011/06/windows-create-live-boot-usb-from.html' title='Windows: Create a boot USB from Windows setup CD/DVD'/><author><name>twig</name><uri>http://www.blogger.com/profile/12960052797537632822</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/_ih0G_MpWiYU/SLluoTm10_I/AAAAAAAAAFw/a4-gyOpb6JI/s1600-R/kung_fu.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://lh4.ggpht.com/-u6P5z5amCMc/Tf4ASNLpH9I/AAAAAAAABVc/ua4INKE-ay0/s72-c/VitaminA_facial_thumb.gif?imgmax=800' height='72' width='72'/><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3937429925313843721.post-2606742911230559023</id><published>2011-06-19T22:35:00.001+10:00</published><updated>2011-06-19T22:35:15.018+10:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='think tank'/><title type='text'>Invention: Rear View Mirror Partial Night Mode</title><summary type='text'>The rear view mirror should have something that limits the amount of light reflected to dim bright lights.  That way we don't have to flip the rear view because of some knob with super high beams or one wonky misaligned light bulb that shines right into your eyes.  </summary><link rel='replies' type='application/atom+xml' href='http://twigstechtips.blogspot.com/feeds/2606742911230559023/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://twigstechtips.blogspot.com/2011/06/invention-rear-view-mirror-partial.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3937429925313843721/posts/default/2606742911230559023'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3937429925313843721/posts/default/2606742911230559023'/><link rel='alternate' type='text/html' href='http://twigstechtips.blogspot.com/2011/06/invention-rear-view-mirror-partial.html' title='Invention: Rear View Mirror Partial Night Mode'/><author><name>twig</name><uri>http://www.blogger.com/profile/12960052797537632822</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/_ih0G_MpWiYU/SLluoTm10_I/AAAAAAAAAFw/a4-gyOpb6JI/s1600-R/kung_fu.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3937429925313843721.post-6193576581977043585</id><published>2011-06-19T22:25:00.001+10:00</published><updated>2011-06-19T22:25:59.894+10:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='think tank'/><title type='text'>Invention: Balloon clips for ribbons</title><summary type='text'>Somebody should invent balloon ribbon clips. This way we don't have to tie the damn things anymore.  All you have to do is feed the ribbon through the clip, clamp it.  Then create a loop and clip it again.  The clamp should be reusable and require no tying.  </summary><link rel='replies' type='application/atom+xml' href='http://twigstechtips.blogspot.com/feeds/6193576581977043585/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://twigstechtips.blogspot.com/2011/06/invention-balloon-clips-for-ribbons.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3937429925313843721/posts/default/6193576581977043585'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3937429925313843721/posts/default/6193576581977043585'/><link rel='alternate' type='text/html' href='http://twigstechtips.blogspot.com/2011/06/invention-balloon-clips-for-ribbons.html' title='Invention: Balloon clips for ribbons'/><author><name>twig</name><uri>http://www.blogger.com/profile/12960052797537632822</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/_ih0G_MpWiYU/SLluoTm10_I/AAAAAAAAAFw/a4-gyOpb6JI/s1600-R/kung_fu.jpg'/></author><thr:total>0</thr:total></entry></feed>
