<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>misc software development snippets</title>
	<atom:link href="http://www.dwright.us/?feed=rss2" rel="self" type="application/rss+xml" />
	<link>http://www.dwright.us</link>
	<description>sparse and random posts related to coding - because google is my &#039;man&#039; page</description>
	<lastBuildDate>Thu, 19 Aug 2010 19:51:55 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>sudo gem install -v=2.3.2 &#8211;include-dependencies &#8211;no-rdoc &#8211;no-ri rails</title>
		<link>http://www.dwright.us/?p=591</link>
		<comments>http://www.dwright.us/?p=591#comments</comments>
		<pubDate>Wed, 18 Aug 2010 01:49:01 +0000</pubDate>
		<dc:creator>dwright</dc:creator>
				<category><![CDATA[ruby]]></category>
		<category><![CDATA[ruby on rails]]></category>

		<guid isPermaLink="false">http://www.dwright.us/?p=591</guid>
		<description><![CDATA[maybe, I'll remember this now. Gem installation takes too long, and I use the online docs uninstall specific versions of rails $ sudo gem uninstall -v=2.3.5 rails Successfully uninstalled rails-2.3.5 $ sudo gem uninstall -v=2.3.8 rails Successfully uninstalled rails-2.3.8]]></description>
			<content:encoded><![CDATA[<p>maybe, I'll remember this now.<br />
Gem installation takes too long, and I use the online docs</p>
<p>uninstall specific versions of rails<br />
<code>$ sudo gem uninstall -v=2.3.5 rails</code><br />
Successfully uninstalled rails-2.3.5<br />
<code>$ sudo gem uninstall -v=2.3.8 rails</code><br />
Successfully uninstalled rails-2.3.8</p>
]]></content:encoded>
			<wfw:commentRss>http://www.dwright.us/?feed=rss2&amp;p=591</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Mac OS X mkdir: /home/test: Operation not supported</title>
		<link>http://www.dwright.us/?p=581</link>
		<comments>http://www.dwright.us/?p=581#comments</comments>
		<pubDate>Tue, 10 Aug 2010 19:04:28 +0000</pubDate>
		<dc:creator>dwright</dc:creator>
				<category><![CDATA[Mac OSX]]></category>

		<guid isPermaLink="false">http://www.dwright.us/?p=581</guid>
		<description><![CDATA[Hmmm, trying to create a directory under '/home' on a Mac? Well, Apple doesn't want you to (with good reason, automounter owns this dir, which makes it easier to do NFS mounts and such) so you shouldn't muck with it but if you really just 'have to do it', here is how you can. Basically: [...]]]></description>
			<content:encoded><![CDATA[<p>Hmmm, trying to create a directory under '/home' on a Mac?</p>
<p>Well, Apple doesn't want you to (with good reason, automounter owns this dir, which makes it easier to do NFS mounts and such) so you shouldn't muck with it but if you really just 'have to do it', here is how you can.</p>
<p>Basically: <code>Edit /etc/auto_master and remove or comment out the line that starts with "/home".</code></p>
<p>example:<br />
<code>sudo vim /etc/auto_master</code></p>
<p>before:</p>
<pre># Automounter master map
+auto_master            # Use directory service
/net                    -hosts          -nobrowse,hidefromfinder,nosuid
/home                   auto_home       -nobrowse,hidefromfinder
/Network/Servers        -fstab
/-                      -static</pre>
<p>after:                                </p>
<pre># Automounter master map
+auto_master            # Use directory service
/net                    -hosts          -nobrowse,hidefromfinder,nosuid
#/home                   auto_home       -nobrowse,hidefromfinder
/Network/Servers        -fstab
/-                      -static</pre>
<p>to have the change take effect without a reboot:<br />
<code>sudo automount</code></p>
<p><code>mkdir /home/test</code><br />
<code>ls -l /home/<br />
total 0<br />
drwxr-xr-x  3 root  admin  102 Aug 10 11:33 test</code></p>
<p>NOTE: I wouldn't do anything 'important' with this directory as it's easy to forget you altered this and an upgrade will plow over this directory, removing all data. (this dir is also not included in any Time Machine backups.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.dwright.us/?feed=rss2&amp;p=581</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>undefined method `destroy&#8217; for #Svn::Ext::Core::Apr_pool_wrapper_t</title>
		<link>http://www.dwright.us/?p=575</link>
		<comments>http://www.dwright.us/?p=575#comments</comments>
		<pubDate>Tue, 10 Aug 2010 18:25:22 +0000</pubDate>
		<dc:creator>dwright</dc:creator>
				<category><![CDATA[Mac OSX]]></category>
		<category><![CDATA[mac svn ruby]]></category>

		<guid isPermaLink="false">http://www.dwright.us/?p=575</guid>
		<description><![CDATA[If you receive this error Mac OSX Snow Leopard and you have Installed the newest Svn libs (binaries) from collab net. i.e. http://svnbinaries.open.collab.net/servlets/ProjectDocumentList (http://www.collab.net/downloads/community/) this fix worked for me: (taken from http://www.jroller.com/carlossg/entry/using_subversion_ruby_bindings ",... you need to remove the preinstalled subversion, install the newer one from Collabnet, and move some files around. mv /Library/Ruby/Site/1.8/svn /Library/Ruby/Site/1.8/svn.bak mv [...]]]></description>
			<content:encoded><![CDATA[<p>If you receive this error Mac OSX Snow Leopard and you have Installed the newest Svn libs (binaries) from collab net. i.e. <a href="http://svnbinaries.open.collab.net/servlets/ProjectDocumentList">http://svnbinaries.open.collab.net/servlets/ProjectDocumentList</a> (http://www.collab.net/downloads/community/)</p>
<p>this fix worked for me: (taken from <a href="http://www.jroller.com/carlossg/entry/using_subversion_ruby_bindings">http://www.jroller.com/carlossg/entry/using_subversion_ruby_bindings</a></p>
<p><code>",... you need to remove the preinstalled subversion, install the newer one from Collabnet, and move some files around.</p>
<p>mv /Library/Ruby/Site/1.8/svn /Library/Ruby/Site/1.8/svn.bak<br />
mv /Library/Ruby/Site/1.8/universal-darwin9.0/svn /Library/Ruby/Site/1.8/universal-darwin9.0/svn.bak<br />
ln -s /opt/subversion/lib/svn-ruby/svn /Library/Ruby/Site/1.8/svn<br />
ln -s /opt/subversion/lib/svn-ruby/universal-darwin/svn /Library/Ruby/Site/1.8/universal-darwin9.0/svn</code></p>
]]></content:encoded>
			<wfw:commentRss>http://www.dwright.us/?feed=rss2&amp;p=575</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Subversion Ruby Bindings Gem Library</title>
		<link>http://www.dwright.us/?p=567</link>
		<comments>http://www.dwright.us/?p=567#comments</comments>
		<pubDate>Tue, 10 Aug 2010 00:13:38 +0000</pubDate>
		<dc:creator>dwright</dc:creator>
				<category><![CDATA[ruby]]></category>
		<category><![CDATA[svn ruby]]></category>

		<guid isPermaLink="false">http://www.dwright.us/?p=567</guid>
		<description><![CDATA[I had a need to access a svn repository programmatically from Ruby and couldn't find a subversion client for ruby in a gem type of reusable library, so I took a shot at writing one. It is just a simplified API (released as a gem) on top of the subversion-ruby bindings. I also started a [...]]]></description>
			<content:encoded><![CDATA[<p>I had a need to access a svn repository programmatically from Ruby and couldn't find a subversion client for ruby in a gem type of reusable library, so I took a shot at writing one. It is just a simplified API (released as a gem) on top of the subversion-ruby bindings. I also started a web app version, which is in progress but has basic functionality at this point.</p>
<p><a href="http://rubygems.org/gems/svn_wc">http://rubygems.org/gems/svn_wc</a> - svn_wc provides programmatic access to basic svn functions, utilizing the Subversion Ruby Bindings, exposing their functionality in a simplified way<br />
source: <a href="http://github.com/dvwright/svn_wc">http://github.com/dvwright/svn_wc</a></p>
<p><a href="http://rubygems.org/gems/svn_wc_tree">http://rubygems.org/gems/svn_wc_tree</a> - svn_wc_tree provides an Web Application Front End GUI to a working copy of an remote SVN Repository. (rough and in progress)</p>
<p>Maybe this/these will be useful for someone else as well.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.dwright.us/?feed=rss2&amp;p=567</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Reinstall MySQL on Mac OSX Snow Leopard (keeping past data)</title>
		<link>http://www.dwright.us/?p=549</link>
		<comments>http://www.dwright.us/?p=549#comments</comments>
		<pubDate>Fri, 06 Aug 2010 20:10:06 +0000</pubDate>
		<dc:creator>dwright</dc:creator>
				<category><![CDATA[Mac OSX]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[ruby]]></category>
		<category><![CDATA[ruby on rails]]></category>

		<guid isPermaLink="false">http://www.dwright.us/?p=549</guid>
		<description><![CDATA[Reinstall MySQL (Community Server) on Mac OSX Snow Leopard (or How to downgrade to an older version of MySQL) First, Read (or glance at this, especially if you are also using Rails/Ruby) upgrading-to-snow-leopard recommends using the 64 bit mysql UPDATE:Do yourself a favor, if on Snow Leopard install the 64 bit (x86_64) MySQL server version! [...]]]></description>
			<content:encoded><![CDATA[<p><b>Reinstall MySQL (Community Server) on Mac OSX Snow Leopard</b> (or <b>How to downgrade to an older version of MySQL</b>)</p>
<p><b><i>First, Read</i></b> (or glance at this, especially if you are also using Rails/Ruby) <a href="http://weblog.rubyonrails.org/2009/8/30/upgrading-to-snow-leopard">upgrading-to-snow-leopard</a> recommends using the 64 bit mysql</p>
<p><b>UPDATE:</b>Do yourself a favor, if on Snow Leopard install the 64 bit (x86_64) MySQL server version! (The *.dmg) (then if you have to build the mysql ruby gem, do so with:<br />
<code> sudo env ARCHFLAGS="-arch x86_64" &#038;& sudo gem install -v=2.7 mysql -- --with-mysql-config=/usr/local/mysql/bin/mysql_config --with-mysql-dir=/usr/local/mysql --with-mysql-lib=/usr/local/mysql/lib --with-mysql-include=/usr/local/mysql/include</code></p>
<p><b>Overview:</b><br />
Recently, I upgraded from Leopard to Snow Leopard, for the most part it was quick and easy (about 1 hour, completely unattended)</p>
<p>Afterwards, I did however have to reinstall several apps, notably for me was MySQL.</p>
<p>I have 2 databases which I need for local development, which are fairly large and take a while to populate, so I wanted to maintain this data if possible.  Unfortunely, since I did not dump the data before upgrading my OS and now, could not start the mysql server, there was no way to do the 'standard' mysql dump.</p>
<p>In my case, I was previously using a dev snapshot of the db,  I wanted to install the same version to minimize issues. If it worked I can always do a proper data dump and upgrade to another version then.</p>
<p><b>Steps</b><br />
Here is what I did which worked for me. (you will need to use the Terminal application for this, see 'Utilities')</p>
<p>In my case, I am using, mysql-5.4.3-beta-osx10.5-x86, your version may (probably will) be different, adjust the command to fit your version.</p>
<p><b>Back up past data</b><br />
<code>cd /usr/local<br />
sudo tar -zcvf  mysql-5.4.3-beta-osx10.5-x86.tar.gz  mysql-5.4.3-beta-osx10.5-x86/<br />
sudo mv  mysql-5.4.3-beta-osx10.5-x86.tar.gz  ~/Documents/</code></p>
<p>the first command places you in the correct directory<br />
the second makes a tar archive (compressed) copy of the database files.<br />
the third moves that into you home 'Documents' directory (for safe keeping)<br />
(now your data should be safe and sound)</p>
<p><b>Now Uninstall Mysql:</b> (be careful with these commands, you cant 'undo' them)<br />
(taken from: <a href="http://akrabat.com/computing/uninstalling-mysql-on-mac-os-x-leopard/">uninstalling-mysql-on-mac-os-x-leopard</a> pasted here for convenience)<br />
To uninstall MySQL and completely remove it (including all databases) from your Mac do the following:<br />
	<code>•	sudo rm /usr/local/mysql<br />
	•	sudo rm -rf /usr/local/mysql*<br />
	•	sudo rm -rf /Library/StartupItems/MySQLCOM<br />
	•	sudo rm -rf /Library/PreferencePanes/My*<br />
	•	edit /etc/hostconfig and remove the line MYSQLCOM=-YES-<br />
	•	rm -rf ~/Library/PreferencePanes/My*<br />
	•	sudo rm -rf /Library/Receipts/mysql*<br />
	•	sudo rm -rf /Library/Receipts/MySQL*</code><br />
The last two lines are particularly important as otherwise, you can't install an older version of MySQL even though you think that you've completely deleted the newer version<br />
	<code>•	sudo rm -rf /var/db/receipts/com.mysql.*<br />
(above needed to work for Snow Leopard)</code></p>
<p><b>Now Install Mysql:</b><br />
Now go find a *.dmg of the same version, you were running. (you will probably have to grab it from an archive somewhere, I found mine here: <a href="http://archive.sunet.se/pub/databases/relational/mysql/Downloads/MySQL-5.4/">http://archive.sunet.se/pub/databases/relational/mysql/Downloads/MySQL-5.4</a></p>
<p>Install both the mysql package and startup items package.</p>
<p>they should have installed with no issues.<br />
try starting the server.</p>
<p>to start:<br />
<code>Library/StartupItems/MySQLCOM/MySQLCOM start</code><br />
to stop:<br />
<code>Library/StartupItems/MySQLCOM/MySQLCOM stop</code></p>
<p>if that doesn't work (those are text files, you can 'less' them)<br />
<code>sudo /usr/local/mysql/support-files/mysql.server start<br />
sudo /usr/local/mysql/support-files/mysql.server stop</code></p>
<p><i>test a login</i><br />
<code>mysql -uroot  (Enter)</code><br />
Welcome to the MySQL monitor.  Commands end with ; or \g.<br />
Your MySQL connection id is 4<br />
Server version: 5.4.3-beta MySQL Community Server (GPL)</p>
<p>Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.</p>
<p>mysql></p>
<p>Great, that means it's working, Now, stop the database.</p>
<p><b>Load past data into New database</b><br />
Get you old data into this instance.<br />
<code>cd ~/Documents/<br />
sudo tar xzvf mysql-5.4.3-beta-osx10.5-x86.tar.gz</code></p>
<p>(this will uncompress your past data into this dir)</p>
<p><code>sudo mv  mysql-5.4.3-beta-osx10.5-x86/data/YOURDB /usr/local/mysql-5.4.3-beta-osx10.5-x86/data/<br />
sudo mv  mysql-5.4.3-beta-osx10.5-x86/data/YOUR_OTHER_DB /usr/local/mysql-5.4.3-beta-osx10.5-x86/data/</code></p>
<p><b>All Done</b><br />
now start your db, all should be well. (you will have to recreate any other mysql users you had)</p>
]]></content:encoded>
			<wfw:commentRss>http://www.dwright.us/?feed=rss2&amp;p=549</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>perl fun with encoding cp-1252</title>
		<link>http://www.dwright.us/?p=537</link>
		<comments>http://www.dwright.us/?p=537#comments</comments>
		<pubDate>Sat, 31 Jul 2010 00:11:41 +0000</pubDate>
		<dc:creator>dwright</dc:creator>
				<category><![CDATA[UTF-8]]></category>
		<category><![CDATA[Unicode]]></category>
		<category><![CDATA[perl]]></category>
		<category><![CDATA[perl utf8 unicode]]></category>

		<guid isPermaLink="false">http://www.dwright.us/?p=537</guid>
		<description><![CDATA[perl/ruby fun with encoding cp-1252 (windows encoding) (In each of the following, you can substitute, 'perl' for 'ruby' and the example will work as well.) [dwright~(74)]$ perl -le 'print "\xe2\x80\x9c"' &#8220 [dwright~(77)]$ perl -le 'print "\xe2\x80\xa6"' &#8230; [dwright~(78)]$ perl -le 'print "\xe2\x80\xa2"' • [dwright~(79)]$ perl -le 'print "\xe2\x80\xa3"' ‣ [dwright~(80)]$ perl -le 'print "\xe2\x80\xa4"' &#8228; [...]]]></description>
			<content:encoded><![CDATA[<p>perl/ruby fun with encoding cp-1252  (windows encoding)</p>
<p>(In each of the following, you can substitute, 'perl' for 'ruby' and the example will work as well.)</p>
<p>[dwright~(74)]$ perl  -le 'print "\xe2\x80\x9c"'<br />
&#8220<br />
[dwright~(77)]$ perl  -le 'print "\xe2\x80\xa6"'<br />
&#8230;<br />
[dwright~(78)]$ perl  -le 'print "\xe2\x80\xa2"'<br />
•<br />
[dwright~(79)]$ perl  -le 'print "\xe2\x80\xa3"'<br />
‣<br />
[dwright~(80)]$ perl  -le 'print "\xe2\x80\xa4"'<br />
&#8228;<br />
[dwright~(81)]$ perl  -le 'print "\xe2\x80\xa5"'<br />
&#8229;<br />
[dwright~(82)]$ perl  -le 'print "\xe2\x80\xa7"'<br />
&#8231;</p>
<p>http://www.eki.ee/letter/chardata.cgi?ucode=2023<br />
decimal: &amp;#8227;<br />
UTF-8 (e2, 80, a3)<br />
[dwright~(79)]$ perl  -le 'print "\xe2\x80\xa3"'<br />
‣</p>
<p>http://www.eki.ee/letter/chardata.cgi?ucode=2024<br />
decimal:&amp;#8228;<br />
UTF-8 (e2, 80, a4)<br />
[dwright~(80)]$ perl  -le 'print "\xe2\x80\xa4"'<br />
․</p>
<p>http://www.eki.ee/letter/chardata.cgi?ucode=2026<br />
decimal: &amp;#8230;<br />
UTF-8 (e2, 80, a6)<br />
[dwright~(83)]$ perl  -le 'print "\xe2\x80\xa6"'<br />
&#8230;<br />
[dwright~(85)]$ perl -C2  -le 'print "\x{2026}"'<br />
&#8230;<br />
[dwright~(90)]$ perl -C2 -MHTML::Entities -le 'print decode_entities("&amp;#8230;")'<br />
&#8230;</p>
<p>[Notice, above is an Ellipses and not '...']</p>
<p>Axe smart quotes from string: (when string is unicode (perl's UTF8 flag is set)<br />
i.e<br />
after something such as:<br />
<code>use Encode qw/decode/;<br />
$s = decode("UTF-8", $s);</code></p>
<p>$s =~ s/\x{201A}/,/g;     # 0x201A Single low-9 quotation mark<br />
$s =~ s/\x{201B}/`/g;     # 0x201B Single high-reversed-9 quotation mark<br />
$s =~ s/\x{201C}/"/g;     # 0x201C Left double quotation mark<br />
$s =~ s/\x{201D}/"/g;     # 0x201D Right double quotation mark</p>
]]></content:encoded>
			<wfw:commentRss>http://www.dwright.us/?feed=rss2&amp;p=537</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>disable smart quotes in WordPress</title>
		<link>http://www.dwright.us/?p=526</link>
		<comments>http://www.dwright.us/?p=526#comments</comments>
		<pubDate>Fri, 30 Jul 2010 20:58:20 +0000</pubDate>
		<dc:creator>dwright</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.dwright.us/?p=526</guid>
		<description><![CDATA[By default WordPress uses 'smart quotes' (a Microsoft invention). When using WordPress for blogs which have code examples, or excerpts meant to be input into a computer, the smart quotes are not desirable. for example: A blog entry, which was input such as: perl -le 'print length "ñëâôàæø"' will display as: perl -le &#8216;print length [...]]]></description>
			<content:encoded><![CDATA[<p>By default WordPress uses 'smart quotes' (a Microsoft invention).</p>
<p>When using WordPress for blogs which have code examples, or excerpts meant to be input into a computer, the smart quotes are not desirable.</p>
<p>for example:<br />
A blog entry, which was input such as:</p>
<pre>perl  -le 'print length "ñëâôàæø"'</pre>
<p>will display as:</p>
<pre>perl  -le &#8216;print length &#8220;ñëâôàæø&#8221&#8217'</pre>
<p>when cut and pasted from the blog will produce this (when run from the command line):<br />
<code>$ perl  -le &#8216;print length &#8220;ñëâôàæø&#8221&#8217;</code></p>
<pre>Unrecognized character \xE2 at -e line 1.</pre>
<p>Here is a <a href="http://journal.brokenclay.org/wp_archives/2004/06/15/smart-quote-fix/">fix</a>, which will correct all displayed blog entries (past one as well), since it's a plugin. </p>
<p>Alternatively, you can also install this plugin: <a href="http://wordpress.org/extend/plugins/raw-html/">http://wordpress.org/extend/plugins/raw-html/</a> (which can do other things as well, such as let you insert 'raw html' into your posts.  </p>
<p>i.e. <code>To prevent a part of your post or page from being filtered by WordPress, wrap it in &lt;!--start_raw-->...&lt;!--end_raw--> or [RAW]...[/RAW] tags</code></p>
<p>references:<br />
<a href="http://www.fourmilab.ch/webtools/demoroniser/">http://www.fourmilab.ch/webtools/demoroniser/</a><br />
<a href="http://www.lancebledsoe.com/how-to-turn-off-wordpress-smart-quotes/">how-to-turn-off-wordpress-smart-quotes</a><br />
<a href="http://journal.brokenclay.org/wp_archives/2004/06/15/smart-quote-fix/">http://journal.brokenclay.org/wp_archives/2004/06/15/smart-quote-fix/</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.dwright.us/?feed=rss2&amp;p=526</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>easiest jQuery image preview (on select)</title>
		<link>http://www.dwright.us/?p=521</link>
		<comments>http://www.dwright.us/?p=521#comments</comments>
		<pubDate>Fri, 30 Jul 2010 07:27:28 +0000</pubDate>
		<dc:creator>dwright</dc:creator>
				<category><![CDATA[jQuery]]></category>

		<guid isPermaLink="false">http://www.dwright.us/?p=521</guid>
		<description><![CDATA[problem space: You have a select list of images (as urls, or can access the url through an id, or some such way). When you select a new image you want to see the image 'previewed'. &#60;script type="text/javascript"&#62; jQuery(document).ready(function() { $('#images_link').change(function(){ var img_url = $('#images_link :selected').text(); $('#preview_image').html('&#60;p&#62;&#60;img src="'+img_url+'"/&#62;&#60;/p&#62;'); $('#preview_image').dialog(); }); }); &#60;/script&#62; &#60;body&#62; &#60;label for="images_link"&#62;Image&#60;/label&#62;&#60;br [...]]]></description>
			<content:encoded><![CDATA[<p>problem space:<br />
You have a select list of images (as urls, or can access the url through an<br />
id, or some such way). When you select a new image you want to see the image<br />
'previewed'.</p>
<pre>&lt;script type="text/javascript"&gt;
  jQuery(document).ready(function() {
    $('#images_link').change(function(){
      var img_url = $('#images_link :selected').text();
      $('#preview_image').html('&lt;p&gt;&lt;img src="'+img_url+'"/&gt;&lt;/p&gt;');
      $('#preview_image').dialog();
    });
  });
&lt;/script&gt; 

&lt;body&gt;
  &lt;label for="images_link"&gt;Image&lt;/label&gt;&lt;br /&gt;
    &lt;select id="images_link" name="images[link]"&gt;
      &lt;option value=""&gt;&lt;/option&gt;
      &lt;option value="1"&gt;http://example.com/images/foo.png&lt;/option&gt;
      &lt;option value="2"&gt;http://example.com/images/bar.png&lt;/option&gt;
      &lt;option value="3"&gt;http://example.com/images/baz.png&lt;/option&gt;
    &lt;/select&gt;

 &lt;div id='preview_image'&gt;&lt;p&gt;&lt;/p&gt;&lt;/div&gt;
&lt;/body&gt;</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.dwright.us/?feed=rss2&amp;p=521</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>easiest jquery hover image re-sizer</title>
		<link>http://www.dwright.us/?p=511</link>
		<comments>http://www.dwright.us/?p=511#comments</comments>
		<pubDate>Tue, 27 Jul 2010 09:34:59 +0000</pubDate>
		<dc:creator>dwright</dc:creator>
				<category><![CDATA[jQuery]]></category>
		<category><![CDATA[jquery hover]]></category>

		<guid isPermaLink="false">http://www.dwright.us/?p=511</guid>
		<description><![CDATA[problem space: you have some images on an html page which display as 'thumbnails' (i.e reduced size images), when you hover over them with a mouse, you want them to expand to full size (or larger, anyway). For this example, pretend you are one of those lazy people who does not want to make a [...]]]></description>
			<content:encoded><![CDATA[<p>problem space:<br />
you have some images on an html page which display as 'thumbnails' (i.e reduced size images), when you hover over them with a mouse, you want them to expand to full size (or larger, anyway).</p>
<p>For this example, pretend you are one of those lazy people who does not want to make a smaller 'thumbnail' image for every image you have (hey, it happens <img src='http://www.dwright.us/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' />  (although, I think there are some online services which can do this [generate thumbnails on the fly] in real time now)</p>
<p>So, anyway, you cheat by using the full size image and setting a height and width smaller values</p>
<pre>&lt;html&gt;
&lt;head&gt;
&lt;script type="text/javascript"&gt;
  jQuery(document).ready(function() {
    $(".img-frame").hover(
      function() {
        $(this).removeAttr('width');
        $(this).removeAttr('height');
      },
      function () {
        $(this).attr("width", 50);
        $(this).attr("height",  50);
      }
    );
  });
&lt;/script&gt;
&lt;/head&gt;

&lt;body&gt;
&lt;img src="foo.png" height="50px" width="50px" class="img-frame"/&gt;
&lt;img src="bar.png" height="50px" width="50px" class="img-frame"/&gt;
&lt;img src="baz.png" height="50px" width="50px" class="img-frame"/&gt;
&lt;/body&gt;
&lt;/html&gt;</pre>
<p>I think the above is self-explanatory, but I will give a synopsis anyway. </p>
<p>When you 'hover' (mouseover) an image with the 'img-frame' class set, the width and height attributes are removed, the image will display at full size, when you 'mouseoff' the image, the height and width are restored to their original value.</p>
<p>there are many variations you could do here, you could limit the hover size,<br />
(instead of <code>$(this).removeAttr('width');</code>, you could use <code>$(this).attr("width", 200);</code>) for example</p>
]]></content:encoded>
			<wfw:commentRss>http://www.dwright.us/?feed=rss2&amp;p=511</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Vi Mode in Readline Applications</title>
		<link>http://www.dwright.us/?p=508</link>
		<comments>http://www.dwright.us/?p=508#comments</comments>
		<pubDate>Sat, 03 Jul 2010 06:37:30 +0000</pubDate>
		<dc:creator>dwright</dc:creator>
				<category><![CDATA[linux]]></category>
		<category><![CDATA[vim]]></category>

		<guid isPermaLink="false">http://www.dwright.us/?p=508</guid>
		<description><![CDATA[I found this awhile ago and it's proved very handy, I am repeating it here because it took me awhile to figure out where I found it again. Vi Mode in Readline Applications If you find that you do like using vi editing mode (set -o vi), add 'set editing-mode vi' to your .inputrc, and [...]]]></description>
			<content:encoded><![CDATA[<p>I found this awhile ago and it's proved very handy, I am repeating it here because it took me awhile to figure out where I found it again.</p>
<p>Vi Mode in Readline Applications</p>
<p>If you find that you do like using vi editing mode (set -o vi), add 'set editing-mode vi' to your .inputrc, and vi mode will work in any readline based client, eg psql, irb, mysql, python shell, unfortunately does not work on the cpan shell. (I guess it doesn't' use readline, not that big a deal)</p>
<p>orig ref: <a href="http://dailyvim.blogspot.com/2009/06/vi-mode-in-readline-applications.html">http://dailyvim.blogspot.com/2009/06/vi-mode-in-readline-applications.html</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.dwright.us/?feed=rss2&amp;p=508</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
