<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"><channel><description>A tumblelog of things I discover either outside or inside my own head.  Usually software development related, cause that’s what I do.  Find out more at my home page.Or keep tabs on my browsing on my del.icio.us page.Or if you really like what I tend to find or muse on, consider subscribing to my one true feed. </description><title>Mat Schaffer's Discoveries</title><generator>Tumblr (3.0; @schapht)</generator><link>http://tumblr.matschaffer.com/</link><item><title>Subversion 1.5 Release Notes: Merge Tracking    </title><description>&lt;a href="http://subversion.tigris.org/svn_1.5_releasenotes.html#merge-tracking"&gt;Subversion 1.5 Release Notes: Merge Tracking    &lt;/a&gt;: Here’s one to file under about-frickin-time</description><link>http://tumblr.matschaffer.com/post/39682366</link><guid>http://tumblr.matschaffer.com/post/39682366</guid><pubDate>Tue, 24 Jun 2008 14:36:47 -0400</pubDate></item><item><title>"Be transparent. Share your work constantly. Solicit feedback. Appreciate critiques. Let other people..."</title><description>“Be transparent. Share your work constantly. Solicit feedback. Appreciate critiques. Let other people point out your mistakes. You are not your code. Do not be afraid of day-to-day failures — learn from them. … Cherish your history, both the successes and mistakes. All of these behaviors are the way to get better at programming. If you don’t follow them, you’re cheating your own personal development.”&lt;br/&gt;&lt;br/&gt; - &lt;em&gt;&lt;a href="http://blog.red-bean.com/sussman/?p=96"&gt;iBanjo  » Blog Archive   » Programmer Insecurity&lt;/a&gt;&lt;/em&gt;</description><link>http://tumblr.matschaffer.com/post/38688455</link><guid>http://tumblr.matschaffer.com/post/38688455</guid><pubDate>Mon, 16 Jun 2008 22:13:22 -0400</pubDate></item><item><title>"Here’s the first problem. The new KDE launcher is a gynecologist interface: There you are, sitting..."</title><description>“Here’s the first problem. The new KDE launcher is a gynecologist interface: There you are, sitting in front of a 20″ screen, but the programmer has dictated that you have to do everything by poking around in a small box.”&lt;br/&gt;&lt;br/&gt; - &lt;em&gt;&lt;a href="http://meta.ath0.com/2008/01/18/kde-4-ui-critique/"&gt;  KDE 4 UI critique&lt;/a&gt;&lt;/em&gt;</description><link>http://tumblr.matschaffer.com/post/37515060</link><guid>http://tumblr.matschaffer.com/post/37515060</guid><pubDate>Sat, 07 Jun 2008 10:31:51 -0400</pubDate></item><item><title>Removing things accidentally committed to git</title><description>&lt;p&gt;So a few days ago I accidentally checked a bunch of my mp3s into the git repo for matschaffer.com.  This blew out the size of .git and made clones a pain.  So I wanted to remove it.  I got some help from “jast” in &lt;a href="irc://irc.freenote.net#git"&gt;the git IRC channel&lt;/a&gt; which set me straight.&lt;/p&gt;&lt;p&gt;In this case I had committed and pushed the mp3s, then committed one more change after that.  So the bad commit was HEAD^^, but I also had HEAD^ that I wanted to keep.&lt;/p&gt;&lt;p&gt;Here’s what I did:&lt;/p&gt;&lt;pre&gt;# Save any changes after the bad commitgit format-patch HEAD^# Reset everything back to the bad commitgit reset --hard HEAD^^# Remove the accidentally checked in filegit rm --cached thefile# Amend the bad commitgit commit --amend# Restore the other change from patch filegit am &lt;patch from step&gt;# Clean up.  Note this will eliminate any chance of undo-ing this processgit reflog expire --expire=0 --allgit prune --expire 0# If you need to, you can force a push to correct the history on a remote repo as wellgit push -f&lt;/patch&gt;&lt;/pre&gt;&lt;p&gt;After this my local .git was still pretty big (as was the server’s repo).  But any new clones were nice and small.  So I just created a new clone, and copied that up to the server via scp and all was well.  It was a bit of a pain, but it was neat that git is capable of doing these sort of operations.  Under subversion you’d need a system administrator to do this sort of stuff.&lt;/p&gt;</description><link>http://tumblr.matschaffer.com/post/37407405</link><guid>http://tumblr.matschaffer.com/post/37407405</guid><pubDate>Fri, 06 Jun 2008 11:16:00 -0400</pubDate></item><item><title>Obsolete technology band - Hack a Day</title><description>&lt;a href="http://www.hackaday.com/2008/06/05/obsolete-technology-band/"&gt;Obsolete technology band - Hack a Day&lt;/a&gt;: That last video is from this article.  All the videos are worth a look.</description><link>http://tumblr.matschaffer.com/post/37349895</link><guid>http://tumblr.matschaffer.com/post/37349895</guid><pubDate>Thu, 05 Jun 2008 23:45:51 -0400</pubDate></item><item><title>Big Ideas (Don’t get any) on Vimeo (via Vimeo)Hang in...</title><description>&lt;object type="application/x-shockwave-flash" width="400" height="300" data="http://vimeo.com/moogaloop.swf?clip_id=1109226&amp;server=vimeo.com&amp;fullscreen=1&amp;show_title=1&amp;show_byline=0&amp;show_portrait=0&amp;color=00ADEF"&gt;&lt;param name="quality" value="best" /&gt;&lt;param name="allowscriptaccess" value="always" /&gt;&lt;param name="allowfullscreen" value="true" /&gt;&lt;param name="scale" value="showAll" /&gt;&lt;param name="movie" value="http://vimeo.com/moogaloop.swf?clip_id=1109226&amp;server=vimeo.com&amp;fullscreen=1&amp;show_title=1&amp;show_byline=0&amp;show_portrait=0&amp;color=00ADEF" /&gt;&lt;embed src="http://www.vimeo.com/moogaloop.swf?clip_id=1109226&amp;server=www.vimeo.com&amp;show_title=1&amp;show_byline=0&amp;show_portrait=0&amp;color=00ADEF&amp;fullscreen=1" type="application/x-shockwave-flash" allowfullscreen="true" allowscriptaccess="always" width="400" height="300"&gt;&lt;/embed&gt;&lt;/object&gt;&lt;br/&gt;&lt;br/&gt;&lt;p&gt;Big Ideas (Don’t get any) on Vimeo (via &lt;a href="http://www.vimeo.com/1109226"&gt;Vimeo&lt;/a&gt;)&lt;/p&gt;&lt;p&gt;Hang in there past the loading noise in the beginning.  Totally worth it.&lt;/p&gt;</description><link>http://tumblr.matschaffer.com/post/37349753</link><guid>http://tumblr.matschaffer.com/post/37349753</guid><pubDate>Thu, 05 Jun 2008 23:44:43 -0400</pubDate></item><item><title>Changing passwords on OS X disk images (dmg/sparseimage)</title><description>I couldn’t find this one in google too easily so hopefully this’ll help people out in the future.  If you’ve created an encrypted disk images with Apple’s Disk Utility and need to change the password you can do it with:&lt;pre&gt;hdiutil chpass /path/to/image/file&lt;/pre&gt;It’ll prompt you for the old password, then the new password twice.</description><link>http://tumblr.matschaffer.com/post/36454933</link><guid>http://tumblr.matschaffer.com/post/36454933</guid><pubDate>Thu, 29 May 2008 10:04:43 -0400</pubDate></item><item><title>Using SSH key authentication in Capistrano</title><description>&lt;p&gt;This just took me 15 minutes too long to figure out, so here’s how to do it.&lt;/p&gt;&lt;pre&gt;&lt;code class="ruby"&gt;set :ssh_options, :keys =&gt; '/full/path/to/id_rsa'&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Put it in ~/.caprc if you have any other developers on the project so they can set up their own stuff.&lt;/p&gt;&lt;p&gt;Capistrano passes :ssh_options nearly verbatim to Net::SSH.  So if you need reference on other possible options, check out docs for &lt;a href="http://net-ssh.rubyforge.org/ssh/v2/api/classes/Net/SSH.html#M000012"&gt;Net::SSH.start&lt;/a&gt;.&lt;/p&gt;</description><link>http://tumblr.matschaffer.com/post/36149413</link><guid>http://tumblr.matschaffer.com/post/36149413</guid><pubDate>Mon, 26 May 2008 21:17:14 -0400</pubDate></item><item><title>"It can be anything from “having a great day!” to “conquering the universe.”..."</title><description>“&lt;p&gt;It can be anything from “having a great day!” to “conquering the universe.” Update it frequently so your friends don’t think you’re boring!&lt;/p&gt;&lt;p&gt;(Does anyone else find this trend of mildly insulting web apps annoying?)&lt;/p&gt;”&lt;br/&gt;&lt;br/&gt; - &lt;em&gt;&lt;a href="http://pulse.plaxo.com/pulse/events"&gt;Plaxo Pulse - Events&lt;/a&gt;&lt;/em&gt;</description><link>http://tumblr.matschaffer.com/post/36056753</link><guid>http://tumblr.matschaffer.com/post/36056753</guid><pubDate>Mon, 26 May 2008 00:39:15 -0400</pubDate></item><item><title>Photo</title><description>&lt;img src="http://media.tumblr.com/MWK8Ef00Y94a3fhoZAtcfyjd_500.jpg"/&gt;&lt;br/&gt;&lt;br/&gt;</description><link>http://tumblr.matschaffer.com/post/35158031</link><guid>http://tumblr.matschaffer.com/post/35158031</guid><pubDate>Sat, 17 May 2008 17:47:43 -0400</pubDate></item><item><title>Faking independent subqueries in MySQL</title><description>&lt;p&gt;So one of my associates laid this little gem on me yesterday that kinda floored me.&lt;/p&gt;&lt;p&gt;Say you have a query that counts the number of members in a group that looks like this:&lt;/p&gt;&lt;pre&gt;select count(*) as members from users where id in (select user_id from memberships where group_id = 1);&lt;/pre&gt;&lt;p&gt;You may know that this query can take a long time as the number of rows in the users table grows.  Why?  Take a look at the explanation:&lt;/p&gt;&lt;pre&gt;+----+--------------------+-------------+-------+---------------+---------+---------+------+------+--------------------------+| id | select_type        | table       | type  | possible_keys | key     | key_len | ref  | rows | Extra                    |+----+--------------------+-------------+-------+---------------+---------+---------+------+------+--------------------------+|  1 | PRIMARY            | users       | index | NULL          | PRIMARY | 4       | NULL |    1 | Using where; Using index | |  2 | DEPENDENT SUBQUERY | memberships | ALL   | NULL          | NULL    | NULL    | NULL |    1 | Using where              | +----+--------------------+-------------+-------+---------------+---------+---------+------+------+--------------------------+&lt;/pre&gt;&lt;p&gt;That inner query is dependent, which means it’ll get run for each user in the table, even though it really doesn’t have to be.  It would be nice to store this in a temporary table, but that’s a pain right?  Or is it?  Check out this “optimization”:&lt;/p&gt;&lt;pre&gt;select count(*) as members from users where id in (select user_id from (select user_id from memberships where group_id = 1) as x);&lt;/pre&gt; &lt;p&gt;That’s an extra query right?  Why would that help?  Turns out that wrapping the dependent subquery like this creates a derived table.  MySQL just creates that temporary table for you for free.  Here’s the explanation.&lt;/p&gt;&lt;pre&gt;+----+--------------------+-------------+--------+---------------+---------+---------+------+------+--------------------------+| id | select_type        | table       | type   | possible_keys | key     | key_len | ref  | rows | Extra                    |+----+--------------------+-------------+--------+---------------+---------+---------+------+------+--------------------------+|  1 | PRIMARY            | users       | index  | NULL          | PRIMARY | 4       | NULL |    1 | Using where; Using index | |  2 | DEPENDENT SUBQUERY | &lt;derived3&gt;  | system | NULL          | NULL    | NULL    | NULL |    0 | const row not found      | |  3 | DERIVED            | memberships | ALL    | NULL          | NULL    | NULL    | NULL |    1 | Using where              | +----+--------------------+-------------+--------+---------------+---------+---------+------+------+--------------------------+&lt;/pre&gt;&lt;p&gt;So now instead of running that query against the memberships table it runs it against the derived table.  This derived table only contains one column, resides in memory and never changes allowing it to run much much faster without changing the query structure too heavily.&lt;/p&gt;&lt;p&gt;&lt;b&gt;Update:&lt;/b&gt; This may not be the best example by itself.  Let me clarify my additional requirement of counting all the users that &lt;i&gt;aren’t&lt;/i&gt; in the given group as well.  The above query handles that easily via a “not”:&lt;/p&gt;&lt;pre&gt;select count(*) as members from users where id NOT in (select user_id from (select user_id from memberships where group_id = 1) as x);&lt;/pre&gt;</description><link>http://tumblr.matschaffer.com/post/34782197</link><guid>http://tumblr.matschaffer.com/post/34782197</guid><pubDate>Wed, 14 May 2008 09:41:00 -0400</pubDate></item><item><title>&gt; git gui How the eff did I miss this!?</title><description>&lt;img src="http://media.tumblr.com/MWK8Ef00Y8ovwjqvrACO57Az_500.png"/&gt;&lt;br/&gt;&lt;br/&gt;&lt;pre&gt;&gt; git gui&lt;/pre&gt; How the eff did I miss this!?</description><link>http://tumblr.matschaffer.com/post/33958105</link><guid>http://tumblr.matschaffer.com/post/33958105</guid><pubDate>Tue, 06 May 2008 23:14:01 -0400</pubDate></item><item><title>Photo</title><description>&lt;img src="http://media.tumblr.com/MWK8Ef00Y6zn90pdlbt6ecbL_500.jpg"/&gt;&lt;br/&gt;&lt;br/&gt;</description><link>http://tumblr.matschaffer.com/post/29774116</link><guid>http://tumblr.matschaffer.com/post/29774116</guid><pubDate>Tue, 25 Mar 2008 02:40:06 -0400</pubDate></item><item><title>crabs casino!</title><description>&lt;img src="http://media.tumblr.com/MWK8Ef00Y6o4a3szKRH64p4m_500.jpg"/&gt;&lt;br/&gt;&lt;br/&gt;crabs casino!</description><link>http://tumblr.matschaffer.com/post/29050931</link><guid>http://tumblr.matschaffer.com/post/29050931</guid><pubDate>Mon, 17 Mar 2008 01:03:55 -0400</pubDate></item><item><title>Boarding time!</title><description>&lt;img src="http://media.tumblr.com/MWK8Ef00Y6m3hus3JsKMBXTa_500.jpg"/&gt;&lt;br/&gt;&lt;br/&gt;Boarding time!</description><link>http://tumblr.matschaffer.com/post/28945425</link><guid>http://tumblr.matschaffer.com/post/28945425</guid><pubDate>Sat, 15 Mar 2008 15:06:29 -0400</pubDate></item><item><title>Just like my first trip to japan!</title><description>&lt;img src="http://media.tumblr.com/MWK8Ef00Y6m2zcywVrlEfUva_500.jpg"/&gt;&lt;br/&gt;&lt;br/&gt;Just like my first trip to japan!</description><link>http://tumblr.matschaffer.com/post/28944594</link><guid>http://tumblr.matschaffer.com/post/28944594</guid><pubDate>Sat, 15 Mar 2008 14:52:06 -0400</pubDate></item><item><title>The short layover race begins!</title><description>&lt;img src="http://media.tumblr.com/MWK8Ef00Y6m24zivVLQy4NDk_500.jpg"/&gt;&lt;br/&gt;&lt;br/&gt;The short layover race begins!</description><link>http://tumblr.matschaffer.com/post/28943530</link><guid>http://tumblr.matschaffer.com/post/28943530</guid><pubDate>Sat, 15 Mar 2008 14:28:29 -0400</pubDate></item><item><title>My flight to detroit. Now boarding.</title><description>&lt;img src="http://media.tumblr.com/MWK8Ef00Y6lxq627lAjumHpk_500.jpg"/&gt;&lt;br/&gt;&lt;br/&gt;My flight to detroit. Now boarding.</description><link>http://tumblr.matschaffer.com/post/28936581</link><guid>http://tumblr.matschaffer.com/post/28936581</guid><pubDate>Sat, 15 Mar 2008 12:24:59 -0400</pubDate></item><item><title>Damien Katz: What Sucks About Erlang</title><description>&lt;a href="http://damienkatz.net/2008/03/what_sucks_abou.html"&gt;Damien Katz: What Sucks About Erlang&lt;/a&gt;: Harsh.  But I can’t imagine an author more appropriate for an article like this.</description><link>http://tumblr.matschaffer.com/post/28687304</link><guid>http://tumblr.matschaffer.com/post/28687304</guid><pubDate>Wed, 12 Mar 2008 18:12:57 -0400</pubDate></item><item><title>Photo</title><description>&lt;img src="http://media.tumblr.com/MWK8Ef00Y6dkc420NyoL2dDr_500.jpg"/&gt;&lt;br/&gt;&lt;br/&gt;</description><link>http://tumblr.matschaffer.com/post/28389712</link><guid>http://tumblr.matschaffer.com/post/28389712</guid><pubDate>Sun, 09 Mar 2008 15:48:13 -0400</pubDate></item></channel></rss>
