<?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-29935368</id><updated>2011-11-27T19:56:44.648-04:00</updated><category term='pascal'/><category term='facebook'/><category term='free software'/><category term='basic'/><category term='java'/><category term='shell'/><category term='python'/><category term='special cases'/><category term='cookies'/><category term='unix'/><category term='tips'/><category term='livejournal'/><category term='perl'/><category term='history'/><category term='gotchas'/><category term='hacking'/><category term='strings'/><category term='regexps'/><category term='msdos'/><category term='wget'/><category term='svn'/><category term='gnome'/><category term='metacity'/><title type='text'>*FX MARNANEL</title><subtitle type='html'>I'm Marnanel, and this is my blog. Well, sort of. It isn't timely like a blog, and I don't expect you to subscribe to the feed (though I won't complain if you do). Rather, treat it as a quick trot around my mind, a chat over a pint in the pub, assuming you'd be caught dead talking about software in the pub.

&lt;a href="http://marnanel.blogspot.com/2007/05/if-youre-going-to-start-somewhere-this.html"&gt;You should start here&lt;/a&gt;.</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://marnanel.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/29935368/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://marnanel.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>marnanel</name><uri>http://www.blogger.com/profile/08335477330828148496</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='27' height='32' src='http://marnanel.org/pics/crest.png'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>13</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-29935368.post-7234003647397956707</id><published>2007-06-07T20:52:00.000-04:00</published><updated>2007-06-07T20:57:02.618-04:00</updated><title type='text'>Unknown or incorrect time zone: 'UTC'</title><content type='html'>If mysql says: &lt;span style="font-weight: bold;"&gt;Unknown or incorrect time zone: 'UTC'&lt;/span&gt; then it doesn't know the timezone database. You can test this by typing &lt;span style="font-weight: bold;"&gt;mysql&gt; SET time_zone='UTC';&lt;/span&gt; which will succeed only if it knows the timezone UTC (which it should).&lt;br /&gt;&lt;br /&gt;The command to fix it is&lt;br /&gt;$&lt;span style="font-weight: bold;"&gt; mysql_tzinfo_to_sql /usr/share/zoneinfo/|mysql -u root mysql -p&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;(leave off the &lt;span style="font-weight: bold;"&gt;-p&lt;/span&gt; if your root account doesn't have a password, in case you are insane)&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;&lt;span style="font-weight: bold;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/29935368-7234003647397956707?l=marnanel.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://marnanel.blogspot.com/feeds/7234003647397956707/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=29935368&amp;postID=7234003647397956707' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/29935368/posts/default/7234003647397956707'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/29935368/posts/default/7234003647397956707'/><link rel='alternate' type='text/html' href='http://marnanel.blogspot.com/2007/06/unknown-or-incorrect-time-zone-utc.html' title='Unknown or incorrect time zone: &apos;UTC&apos;'/><author><name>marnanel</name><uri>http://www.blogger.com/profile/08335477330828148496</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='27' height='32' src='http://marnanel.org/pics/crest.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-29935368.post-5626617248813125159</id><published>2007-06-05T22:43:00.000-04:00</published><updated>2007-09-01T21:46:38.252-04:00</updated><title type='text'>and we're back to talking about software again</title><content type='html'>This post has moved to marnanel.org; please click the title above to go there.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/29935368-5626617248813125159?l=marnanel.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='related' href='http://marnanel.org/days/and-were-back-to-talking-about-software-again' title='and we&apos;re back to talking about software again'/><link rel='replies' type='application/atom+xml' href='http://marnanel.blogspot.com/feeds/5626617248813125159/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=29935368&amp;postID=5626617248813125159' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/29935368/posts/default/5626617248813125159'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/29935368/posts/default/5626617248813125159'/><link rel='alternate' type='text/html' href='http://marnanel.blogspot.com/2007/06/and-were-back-to-talking-about-software.html' title='and we&apos;re back to talking about software again'/><author><name>marnanel</name><uri>http://www.blogger.com/profile/08335477330828148496</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='27' height='32' src='http://marnanel.org/pics/crest.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-29935368.post-3714076187488831759</id><published>2007-06-03T16:16:00.000-04:00</published><updated>2007-06-03T16:30:12.722-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='cookies'/><category scheme='http://www.blogger.com/atom/ns#' term='livejournal'/><category scheme='http://www.blogger.com/atom/ns#' term='tips'/><category scheme='http://www.blogger.com/atom/ns#' term='wget'/><title type='text'>wget for protected files</title><content type='html'>&lt;a href="http://wget.sunsite.dk/"&gt;wget&lt;/a&gt; is a hugely useful program. You give it a URL and it goes and fetches it and saves it to disk. There's a ton of other options (spider a whole site, pretend to be a different browser, fetch all the URLs in a list in a file, delay fetches a certain or random number of seconds, etc) but that's the basic idea.&lt;br /&gt;&lt;br /&gt;Anyway, I just needed to retrieve a file which was protected. It was a &lt;a href="http://www.livejournal.com/voicepost/"&gt;phone post&lt;/a&gt; on a friend's &lt;a href="http://www.livejournal.com"&gt;LiveJournal&lt;/a&gt;, which was friends-locked-- so, if you simply attempt to wget the URL you get a "forbidden" error, because it doesn't know who you are. Assuming you use Firefox, and you're logged into LJ, this is how to tell it:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;wget --load-cookies ~/.mozilla/firefox/&lt;/span&gt;&lt;span style="font-style: italic; font-weight: bold;"&gt;some-weird-string&lt;/span&gt;&lt;span style="font-weight: bold;"&gt;.default/cookies.txt http://&lt;/span&gt;&lt;span style="font-style: italic; font-weight: bold;"&gt;username&lt;/span&gt;&lt;span style="font-weight: bold;"&gt;.livejournal.com/data/phonepost/&lt;/span&gt;&lt;span style="font-style: italic; font-weight: bold;"&gt;xyz&lt;/span&gt;&lt;span style="font-weight: bold;"&gt;.ogg&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;some-weird-string&lt;/span&gt; will be different for everyone, but always the same for you. &lt;span style="font-weight: bold;"&gt;ls ~/.mozilla/firefox&lt;/span&gt; to find out what it is.&lt;br /&gt;&lt;br /&gt;I was amused that this resulted in a redirection to a URL ending ...&lt;span style="font-weight: bold;"&gt;Thanks+for+ signing+in+ /+LiveJournal+loves+you +a+lot+/ +Here+have+a+cookie&lt;/span&gt;.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/29935368-3714076187488831759?l=marnanel.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://marnanel.blogspot.com/feeds/3714076187488831759/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=29935368&amp;postID=3714076187488831759' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/29935368/posts/default/3714076187488831759'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/29935368/posts/default/3714076187488831759'/><link rel='alternate' type='text/html' href='http://marnanel.blogspot.com/2007/06/wget-for-protected-files.html' title='wget for protected files'/><author><name>marnanel</name><uri>http://www.blogger.com/profile/08335477330828148496</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='27' height='32' src='http://marnanel.org/pics/crest.png'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-29935368.post-4319288836827878978</id><published>2007-06-02T00:42:00.000-04:00</published><updated>2007-08-27T22:48:20.611-04:00</updated><title type='text'>Don't blink or you'll miss it</title><content type='html'>This post has moved to marnanel.org; please click the title to go there.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/29935368-4319288836827878978?l=marnanel.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='related' href='http://marnanel.org/writing/writing-a-facebook-application-in-perl' title='Don&apos;t blink or you&apos;ll miss it'/><link rel='replies' type='application/atom+xml' href='http://marnanel.blogspot.com/feeds/4319288836827878978/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=29935368&amp;postID=4319288836827878978' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/29935368/posts/default/4319288836827878978'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/29935368/posts/default/4319288836827878978'/><link rel='alternate' type='text/html' href='http://marnanel.blogspot.com/2007/06/dont-blink-or-youll-miss-it.html' title='Don&apos;t blink or you&apos;ll miss it'/><author><name>marnanel</name><uri>http://www.blogger.com/profile/08335477330828148496</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='27' height='32' src='http://marnanel.org/pics/crest.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-29935368.post-2308780474346591337</id><published>2007-05-29T01:07:00.000-04:00</published><updated>2007-05-29T01:41:17.322-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='metacity'/><title type='text'>How Metacity creates a tab list</title><content type='html'>&lt;span style="font-weight: bold;"&gt;NARGERY LEVEL: High.&lt;/span&gt; Not for the faint of heart.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://bugzilla.gnome.org/show_bug.cgi?id=333548#c3"&gt;I've been asked to explain&lt;/a&gt; how to add new items to the list of programs which appears when you use alt-Tab to switch between programs in Metacity. This is a bit of a simplification, but it goes like this:&lt;br /&gt;&lt;br /&gt;When the user is switching between applications using alt-Tab, Metacity has what's called a "&lt;a href="http://tronche.com/gui/x/xlib/input/XGrabKeyboard.html"&gt;keyboard grab&lt;/a&gt;" on the X server. This means that it gets told about all the keyboard events, and no other X client hears about them. The grab is initiated by meta_display_begin_grab_op() and ended by meta_display_end_grab_op().&lt;br /&gt;&lt;br /&gt;Everything Metacity needs to know about a screen's tab popup is kept in a MetaTabPopup called "tab_popup" which lives inside the MetaScreen representing that screen. In a newly-created MetaScreen, it's null, because there's no popup on that screen. It gets initialised by meta_display_begin_grab_op() calling meta_screen_ensure_tab_popup() (or meta_screen_ensure_workspace_popup() if we're actually needing to switch between workspaces, rather than applications), both of which call meta_ui_tab_popup_new() in order to actually allocate and initialise the memory.&lt;br /&gt;&lt;br /&gt;Before it calls meta_ui_tab_popup_new(), however, meta_screen_ensure_tab_popup() needs to prepare a list of MetaTabEntry items to display in the popup. It does this by calling the function meta_display_get_tab_list(), which is where the magic truly lives.&lt;br /&gt;&lt;br /&gt;meta_display_get_tab_list() returns a GList of MetaWindow objects. (meta_screen_ensure_tab_popup() converts the MetaWindows to MetaTabEntrys.) This is where the actual list of windows that you see when you press alt-Tab comes from.&lt;br /&gt;&lt;br /&gt;Now, there are actually three kinds of list that meta_display_get_tab_list() might be asked for, and these are represented by the possible values of the MetaTabList enum parameter "type". META_TAB_LIST_NORMAL means the ordinary alt-Tab sequence you're used to, of ordinary user application windows. META_TAB_LIST_DOCKS means that what's needed is a list of system windows; you can see this in action by pressing alt-ctrl-Tab. META_TAB_LIST_GROUP means that what's needed is a list of all windows (even dialogues, etc.) in the same application group as the current window.&lt;br /&gt;&lt;br /&gt;How do we deal with this headache-inducing complexity? meta_display_get_tab_list() does the sensible thing and delegates it (in this case, to a macro). It iterates over every window in the requested workspace and adds it to the result list if&lt;br /&gt;&lt;ul&gt;&lt;li&gt;it's on the same screen, and&lt;/li&gt;&lt;li&gt;the IN_TAB_CHAIN macro returns true for it. We will come back to this in a moment.&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;The result list is ordered firstly by whether the window's minimised (minimised windows come first, presumably because this is standard behaviour on certain other operating systems); after that, most recently used windows come first. You can verify this using alt-Tab on your own desktop.&lt;br /&gt;&lt;br /&gt;The IN_TAB_CHAIN macro (in display.c) is written in terms of the three macros META_WINDOW_IN_*_TAB_CHAIN (in window.h). Each of these takes a single argument, a MetaWindow, and returns true or false depending on whether it's in that particular tab chain.&lt;br /&gt;&lt;br /&gt;The original reason I was asked to explain all this was a request to add all windows (on any workspace) which have the urgency hint to any newly-created tab chain. This wouldn't be a suitable thing to add to the META_WINDOW_IN_*_TAB_CHAIN macros, because the list of windows passed to those is pre-filtered to include only windows on the current workspace. Instead, it should be added to meta_display_get_tab_list() as a separate, final step.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/29935368-2308780474346591337?l=marnanel.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://marnanel.blogspot.com/feeds/2308780474346591337/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=29935368&amp;postID=2308780474346591337' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/29935368/posts/default/2308780474346591337'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/29935368/posts/default/2308780474346591337'/><link rel='alternate' type='text/html' href='http://marnanel.blogspot.com/2007/05/how-metacity-creates-tab-list.html' title='How Metacity creates a tab list'/><author><name>marnanel</name><uri>http://www.blogger.com/profile/08335477330828148496</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='27' height='32' src='http://marnanel.org/pics/crest.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-29935368.post-8485918517255734933</id><published>2007-05-27T23:03:00.000-04:00</published><updated>2007-08-27T22:47:36.460-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='facebook'/><category scheme='http://www.blogger.com/atom/ns#' term='perl'/><title type='text'>Writing a Facebook application in Perl, part 2</title><content type='html'>This post has moved to marnanel.org; please click the title above to go there.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/29935368-8485918517255734933?l=marnanel.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='related' href='http://marnanel.org/writing/writing-a-facebook-application-in-perl' title='Writing a Facebook application in Perl, part 2'/><link rel='replies' type='application/atom+xml' href='http://marnanel.blogspot.com/feeds/8485918517255734933/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=29935368&amp;postID=8485918517255734933' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/29935368/posts/default/8485918517255734933'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/29935368/posts/default/8485918517255734933'/><link rel='alternate' type='text/html' href='http://marnanel.blogspot.com/2007/05/writing-facebook-application-in-perl_27.html' title='Writing a Facebook application in Perl, part 2'/><author><name>marnanel</name><uri>http://www.blogger.com/profile/08335477330828148496</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='27' height='32' src='http://marnanel.org/pics/crest.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-29935368.post-4596238398491679974</id><published>2007-05-26T22:19:00.000-04:00</published><updated>2007-09-01T21:52:49.393-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='java'/><category scheme='http://www.blogger.com/atom/ns#' term='python'/><category scheme='http://www.blogger.com/atom/ns#' term='basic'/><category scheme='http://www.blogger.com/atom/ns#' term='history'/><category scheme='http://www.blogger.com/atom/ns#' term='perl'/><category scheme='http://www.blogger.com/atom/ns#' term='free software'/><category scheme='http://www.blogger.com/atom/ns#' term='gnome'/><title type='text'>The Marn behind the curtain</title><content type='html'>This post has moved to marnanel.org; please click the title above to go there.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/29935368-4596238398491679974?l=marnanel.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='related' href='http://marnanel.org/writing/me-as-a-programmer' title='The Marn behind the curtain'/><link rel='replies' type='application/atom+xml' href='http://marnanel.blogspot.com/feeds/4596238398491679974/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=29935368&amp;postID=4596238398491679974' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/29935368/posts/default/4596238398491679974'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/29935368/posts/default/4596238398491679974'/><link rel='alternate' type='text/html' href='http://marnanel.blogspot.com/2007/05/marn-behind-curtain.html' title='The Marn behind the curtain'/><author><name>marnanel</name><uri>http://www.blogger.com/profile/08335477330828148496</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='27' height='32' src='http://marnanel.org/pics/crest.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-29935368.post-2347827769014954402</id><published>2007-05-26T19:32:00.001-04:00</published><updated>2007-08-27T22:46:52.756-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='tips'/><category scheme='http://www.blogger.com/atom/ns#' term='facebook'/><title type='text'>Writing a Facebook application in Perl</title><content type='html'>This post has moved to marnanel.org; please click the title above to go there.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/29935368-2347827769014954402?l=marnanel.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='related' href='http://marnanel.org/writing/writing-a-facebook-application-in-perl' title='Writing a Facebook application in Perl'/><link rel='replies' type='application/atom+xml' href='http://marnanel.blogspot.com/feeds/2347827769014954402/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=29935368&amp;postID=2347827769014954402' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/29935368/posts/default/2347827769014954402'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/29935368/posts/default/2347827769014954402'/><link rel='alternate' type='text/html' href='http://marnanel.blogspot.com/2007/05/writing-facebook-application-in-perl.html' title='Writing a Facebook application in Perl'/><author><name>marnanel</name><uri>http://www.blogger.com/profile/08335477330828148496</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='27' height='32' src='http://marnanel.org/pics/crest.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-29935368.post-5669133544955356810</id><published>2007-05-25T09:33:00.000-04:00</published><updated>2007-05-25T09:41:13.518-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='tips'/><category scheme='http://www.blogger.com/atom/ns#' term='svn'/><title type='text'>Tips: How to get function names in svn diff</title><content type='html'>There used to be a &lt;span style="font-weight: bold;"&gt;-p&lt;/span&gt; switch to &lt;span style="font-weight: bold;"&gt;cvs diff&lt;/span&gt; which would print the names of functions which had changed between your working copy and the repository. &lt;span style="font-weight: bold;"&gt;svn&lt;/span&gt; doesn't have the switch (why on earth not?) but you can make it spawn an external &lt;span style="font-weight: bold;"&gt;diff&lt;/span&gt; process and do &lt;span style="font-weight: bold;"&gt;-p&lt;/span&gt; that way thus:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;alias svndiff="svn diff --diff-cmd diff --extensions \"-u -p\""&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;Put that in your &lt;span style="font-weight: bold;"&gt;.bashrc&lt;/span&gt; so that you can type &lt;span style="font-weight: bold;"&gt;svndiff&lt;/span&gt; wherever you go. Note that we use &lt;span style="font-weight: bold;"&gt;-u&lt;/span&gt; for unified diffs, because anything else is evil.&lt;span style="font-weight: bold;"&gt;&lt;span style="font-weight: bold;"&gt;&lt;span style="font-weight: bold;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;h/t: &lt;a href="http://developer.kde.org/joining/sendingpatches.php"&gt;the KDE people&lt;/a&gt;.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/29935368-5669133544955356810?l=marnanel.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://marnanel.blogspot.com/feeds/5669133544955356810/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=29935368&amp;postID=5669133544955356810' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/29935368/posts/default/5669133544955356810'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/29935368/posts/default/5669133544955356810'/><link rel='alternate' type='text/html' href='http://marnanel.blogspot.com/2007/05/tips-how-to-get-function-names-in-svn.html' title='Tips: How to get function names in svn diff'/><author><name>marnanel</name><uri>http://www.blogger.com/profile/08335477330828148496</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='27' height='32' src='http://marnanel.org/pics/crest.png'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-29935368.post-2380571471283309548</id><published>2007-05-25T00:06:00.000-04:00</published><updated>2007-08-27T22:36:25.218-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='special cases'/><category scheme='http://www.blogger.com/atom/ns#' term='strings'/><category scheme='http://www.blogger.com/atom/ns#' term='pascal'/><category scheme='http://www.blogger.com/atom/ns#' term='basic'/><title type='text'>Strings, the shameful special cases</title><content type='html'>This post has moved to marnanel.org; click the title above to go there.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/29935368-2380571471283309548?l=marnanel.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='related' href='http://marnanel.org/writing/strings-the-shameful-special-cases' title='Strings, the shameful special cases'/><link rel='replies' type='application/atom+xml' href='http://marnanel.blogspot.com/feeds/2380571471283309548/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=29935368&amp;postID=2380571471283309548' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/29935368/posts/default/2380571471283309548'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/29935368/posts/default/2380571471283309548'/><link rel='alternate' type='text/html' href='http://marnanel.blogspot.com/2007/05/strings-shameful-special-cases.html' title='Strings, the shameful special cases'/><author><name>marnanel</name><uri>http://www.blogger.com/profile/08335477330828148496</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='27' height='32' src='http://marnanel.org/pics/crest.png'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-29935368.post-1347683655043440633</id><published>2007-05-24T23:28:00.000-04:00</published><updated>2007-05-25T00:01:47.995-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='history'/><category scheme='http://www.blogger.com/atom/ns#' term='hacking'/><title type='text'>If you're going to start somewhere, this is where to start.</title><content type='html'>The year was 1999, I'd been out of college for a year and a bit, and I was working hard at my first proper programming job. I'd stayed in the same town, but everyone I knew had graduated and gone away, so there wasn't much in my life besides work, spodding and sleep. A former college housemate of mine phoned me up one day and asked how I was, and when she heard that the company secretary had been coming up to me to ask me to take time off work because I hadn't taken any in over a year and it was confusing the record-keeping, she told me that this was an insufferable situation and that steps would be taken. That weekend I found myself on a train to &lt;a href="http://en.wikipedia.org/wiki/Lincoln%2C_Lincolnshire"&gt;Lincoln&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;In Lincoln I was staying at the house of my former housemate's godmother, who owned two horses: every day she would get up at the crack of dawn and go to muck them out. At first she thought I wanted to sleep in in the mornings, but I explained that clearing horseshit out of stables was so different to bug-squashing in object database servers that I would be happy to help. So every day, out I went and got very mucky.&lt;br /&gt;&lt;br /&gt;I also learned to ride a horse for the first time. (I don't know whether I still could; perhaps it's like riding a bike and you never forget.) One of the horses was old and docile, but he wasn't not strong enough to bear me any more; the other was a proud Arab mare who induced some amount of fear to mount, especially since none of the helmets I could find around the stables fitted me, and that I had only brought sandals as footwear. But I learned to walk and trot, though I didn't stay long enough to learn cantering, and I discovered what people mean when they say &lt;span style="font-style: italic;"&gt;dressage&lt;/span&gt;, and I went to a small local show in a small local field where all the horses had ribbons tied in their manes. It's a whole different world, I found, but then I suppose so is software.&lt;br /&gt;&lt;br /&gt;I borrowed one of the ponies, whose name was Glorious George, and practiced riding him around the fields. One of the horsey people told me that George was a good choice because he knew where he was going better than I did, and wouldn't lead me into any danger. Then she said something that surprised me: &lt;span style="font-style: italic;"&gt;The only way to learn is by hacking&lt;/span&gt;.&lt;br /&gt;&lt;br /&gt;I asked her what she meant, and she told me that hacking is &lt;span style="font-style: italic;"&gt;just fooling around&lt;/span&gt;. It's wandering around for no reason other than that you love riding the horse. It's trying all the things you can do riding a horse so you know what the horse and you and the pair of you together are capable of. And apparently it's the only real way to learn to ride a horse.&lt;br /&gt;&lt;br /&gt;I was amused, because it's also the only way to learn how to use a computer, or at least how to program one. Do, please, note that I'm not talking about some kind of attempt to break into other people's computers when I talk about &lt;span style="font-style: italic;"&gt;hacking&lt;/span&gt;: it's plainly immoral to damage other people's possessions without their consent. Rather, the hacking I mean is the older sense, finding out what your language and your equipment can do and pushing it to its limits &lt;span style="font-style: italic;"&gt;because it's fun&lt;/span&gt;, because you're &lt;span style="font-style: italic;"&gt;just fooling around&lt;/span&gt;, and it's the only way to learn. If you want to be a mediocre programmer, you can afford to hate programming. If you want to be a really good programmer, you have to push it to its limits and beyond.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;The only way to learn is by hacking.&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/29935368-1347683655043440633?l=marnanel.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://marnanel.blogspot.com/feeds/1347683655043440633/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=29935368&amp;postID=1347683655043440633' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/29935368/posts/default/1347683655043440633'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/29935368/posts/default/1347683655043440633'/><link rel='alternate' type='text/html' href='http://marnanel.blogspot.com/2007/05/if-youre-going-to-start-somewhere-this.html' title='If you&apos;re going to start somewhere, this is where to start.'/><author><name>marnanel</name><uri>http://www.blogger.com/profile/08335477330828148496</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='27' height='32' src='http://marnanel.org/pics/crest.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-29935368.post-5772069917615729850</id><published>2007-05-24T20:12:00.000-04:00</published><updated>2007-05-25T00:50:45.342-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='regexps'/><title type='text'>Regular expressions, part 1: why you should care</title><content type='html'>&lt;blockquote&gt;&lt;span style="font-style: italic;"&gt;A magic circle.&lt;br /&gt;It looked an extremely thorough job. Whoever had chalked it was clearly very aware that its purpose was to divide the universe into two bits, the inside and the outside.&lt;br /&gt;&lt;span style="font-style: italic;"&gt;             — &lt;/span&gt;&lt;a href="http://www.amazon.com/exec/obidos/ASIN/0380821214"&gt;Eric&lt;/a&gt;&lt;/span&gt;, Terry Pratchett&lt;span style="font-style: italic;"&gt;&lt;span style="font-style: italic;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/blockquote&gt;This post is about regular expressions, what they do, and how they can help you.&lt;br /&gt;&lt;br /&gt;Everyone loves strings. Most programs spend much of their time shunting them around. They're something that humans love and computers, generally, hate. I mean, they might not tell you to their face, but after hours, when you've all logged out and gone home, let me tell you, your computer is propping up a bar somewhere &lt;a href="http://marnanel.blogspot.com/2007/05/strings-shameful-special-cases.html"&gt;complaining about you&lt;/a&gt; and your human need for string handling.&lt;br /&gt;&lt;br /&gt;Humans like strings because they're good for holding human language-- a field which computers, by and large, find opaque and puzzling. I'm not just talking about&lt;br /&gt;&lt;ul&gt;&lt;li&gt;&lt;span style="font-weight: bold;"&gt;There is no reverse gear on a motorcycle; a friend of mine found this out quite suddenly the other day.&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://www.yamara.com/axe/index.html"&gt;&lt;span style="font-weight: bold;" lang="cy"&gt;Dduw, mae bywell yn mhen i.&lt;/span&gt;&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;Those are language, but human natural language is a vast and difficult and complicated domain which computers hate even more than strings, if that's possible. &lt;a href="http://xkcd.com/c114.html"&gt;People&lt;/a&gt; have spent their entire lives researching ways to get computers and natural language to play along. So let's set our sights a little lower, at some simpler kinds of communication:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;every book has an &lt;a href="http://en.wikipedia.org/wiki/ISBN"&gt;ISBN&lt;/a&gt;, ten digits long, of the form 1932857176 (though this will change soon)&lt;a href="http://en.wikipedia.org/wiki/ISBN"&gt;&lt;br /&gt;&lt;/a&gt;&lt;/li&gt;&lt;li&gt;in the US, most people have a &lt;a href="http://en.wikipedia.org/wiki/Social_security_number"&gt;social security number&lt;/a&gt; of the form &lt;a href="http://www.snopes.com/business/taxes/woolssn.htm"&gt;078-05-1120&lt;/a&gt;.&lt;/li&gt;&lt;/ul&gt;Wouldn't it be nice if there was a simple way of looking at a string and saying what &lt;span style="font-style: italic;"&gt;is&lt;/span&gt; or &lt;span style="font-style: italic;"&gt;isn't&lt;/span&gt; an ISBN, or a social security number? If there was a way of dividing the universe into two bits, the SSNs and everything else? Well, that's what regular expressions are for. A regular expression (regex, regexp, or RE to its friends) is a way of dividing all strings into strings which &lt;span style="font-style: italic;"&gt;match&lt;/span&gt; and strings which don't.&lt;br /&gt;&lt;br /&gt;Next part: how to write a regular expression.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/29935368-5772069917615729850?l=marnanel.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://marnanel.blogspot.com/feeds/5772069917615729850/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=29935368&amp;postID=5772069917615729850' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/29935368/posts/default/5772069917615729850'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/29935368/posts/default/5772069917615729850'/><link rel='alternate' type='text/html' href='http://marnanel.blogspot.com/2007/05/magic-circle.html' title='Regular expressions, part 1: why you should care'/><author><name>marnanel</name><uri>http://www.blogger.com/profile/08335477330828148496</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='27' height='32' src='http://marnanel.org/pics/crest.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-29935368.post-7104206130008913724</id><published>2007-05-24T18:57:00.000-04:00</published><updated>2007-05-26T23:29:54.210-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='gotchas'/><category scheme='http://www.blogger.com/atom/ns#' term='unix'/><category scheme='http://www.blogger.com/atom/ns#' term='perl'/><category scheme='http://www.blogger.com/atom/ns#' term='shell'/><category scheme='http://www.blogger.com/atom/ns#' term='msdos'/><title type='text'>It's the shell playing tricks behind your back</title><content type='html'>I am so old... gather round, children... I am &lt;span style="font-style: italic;"&gt;so old&lt;/span&gt; that when I first started using PCs, Windows 3.0 hadn't come out yet. I played with Windows 2 at school, but let's face it, it was pretty dreadful. Every time when I logged out, it told me "&lt;span style="font-style: italic;"&gt;This will end your Windows session&lt;/span&gt;": I actually cheered. So, though the Mac and Amiga users looked down their noses at us, we ended up using the DOS prompt a lot (&lt;a href="http://en.wikipedia.org/wiki/Four_Yorkshiremen"&gt;and we was happy&lt;/a&gt;!)&lt;br /&gt;&lt;br /&gt;If you don't know much about using the prompt, the idea is that you type the name of the program you want to run. So to run the program PRINT.EXE I could type:&lt;br /&gt;&lt;br /&gt;&gt; &lt;span style="font-weight: bold;"&gt;print&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;But if you want to tell the program to do something-- especially, if you want to tell it to work on a particular file, you can give it more information, or "parameters". So to tell PRINT.EXE to print a bunch of my files, I could say:&lt;br /&gt;&lt;br /&gt;&gt; &lt;span style="font-weight: bold;"&gt;print shopping.txt homework.txt laundry.txt&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;If those were the only three files ending in &lt;span style="font-weight: bold;"&gt;.txt&lt;/span&gt; I had, I had a shortcut. I could say:&lt;br /&gt;&lt;br /&gt;&gt; &lt;span style="font-weight: bold;"&gt;print *.txt&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;Now, I used to &lt;a href="http://marnanel.blogspot.com/2007/05/if-youre-going-to-start-somewhere-this.html"&gt;hack around&lt;/a&gt; writing my own programs in those days too, and I knew that when PRINT.EXE was run and it asked what it had been told to do, it was passed "&lt;span style="font-weight: bold;"&gt;*.txt&lt;/span&gt;". It had to go off and search for all the &lt;span style="font-weight: bold;"&gt;.txt&lt;/span&gt; files itself.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://marnanel.blogspot.com/2007/05/marn-behind-curtain.html"&gt;Then I went to college&lt;/a&gt; and everything in my world became different: not least, in that I got myself hooked on Unix and spent most of the day typing things into a DEC VT220. In Unix, you can print out all your &lt;span style="font-weight: bold;"&gt;.txt&lt;/span&gt; files using the  &lt;span style="font-weight: bold;"&gt;lpr &lt;/span&gt;command (Unix commands are often as obscure as that: it stands for &lt;span style="font-weight: bold;"&gt;l&lt;/span&gt;ine &lt;span style="font-weight: bold;"&gt;p&lt;/span&gt;rinte&lt;span style="font-weight: bold;"&gt;r&lt;/span&gt;). But if I typed&lt;br /&gt;&lt;br /&gt;$ &lt;span style="font-weight: bold;"&gt;lpr *.txt&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;then when &lt;span style="font-weight: bold;"&gt;lpr&lt;/span&gt; started up, it would be &lt;span style="font-style: italic;"&gt;given&lt;/span&gt; the names of all the text files by the shell (the program that you type commands into). It wouldn't have to search for them. It would be exactly as though I'd typed&lt;br /&gt;&lt;br /&gt;$ &lt;span style="font-weight: bold;"&gt;lpr &lt;/span&gt;&lt;span style="font-weight: bold;"&gt;shopping.txt homework.txt laundry.txt&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;So there wasn't every need for &lt;span style="font-style: italic;"&gt;every single program&lt;/span&gt; to include the searching code to turn &lt;span style="font-weight: bold;"&gt;*.txt&lt;/span&gt; into a list of &lt;span style="font-weight: bold;"&gt;.txt&lt;/span&gt; files in the current directory.&lt;br /&gt;&lt;br /&gt;But it got cleverer, because now that the code only lived in one place we could do all sorts of fun things, not having to rely on every program out there to get it right. We could perform &lt;a href="http://marnanel.blogspot.com/2007/05/magic-circle.html"&gt;regular expression&lt;/a&gt;-like antics: say we wanted only to print all the files whose name began with S, T, or U:&lt;br /&gt;&lt;br /&gt;$ &lt;span style="font-weight: bold;"&gt;lpr [stu]*.txt&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;That's one of the things the shell does behind your back, but there are others. On Unix systems there's a concept of a "home directory" where a user keeps zir own stuff. The directory is conventionally written with a tilde: &lt;span style="font-weight: bold;"&gt;~firinel&lt;/span&gt; for firinel's home, &lt;span style="font-weight: bold;"&gt;~&lt;/span&gt; for your own, and so on. Well, pay no attention to the man behind the curtain: that's the shell, too. If I write&lt;br /&gt;&lt;br /&gt;$ &lt;span style="font-weight: bold;"&gt;cat ~/dragon.txt&lt;span style="font-weight: bold;"&gt;&lt;span style="font-weight: bold;"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;and my name is marnanel, it will turn into&lt;br /&gt;&lt;br /&gt;$ &lt;span style="font-weight: bold;"&gt;cat&lt;/span&gt; &lt;span style="font-weight: bold;"&gt;/home/marnanel/dragon.txt&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;before &lt;span style="font-weight: bold;"&gt;cat&lt;/span&gt; even sees it. This is a cause of grief for a lot of people first getting into programming, because they attempt to open files called "&lt;span style="font-weight: bold;"&gt;~/myfile.txt&lt;/span&gt;"[1] and find it's not there: it's the shell which is playing tricks behind your back.&lt;br /&gt;&lt;br /&gt;[1] But there are ways of getting the effect. In Perl you can use the &lt;span style="font-weight: bold;"&gt;glob&lt;/span&gt; builtin function:&lt;span style="font-weight: bold;"&gt;&lt;br /&gt;open(STUFF, glob('~/myfile.txt'));&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/29935368-7104206130008913724?l=marnanel.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://marnanel.blogspot.com/feeds/7104206130008913724/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=29935368&amp;postID=7104206130008913724' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/29935368/posts/default/7104206130008913724'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/29935368/posts/default/7104206130008913724'/><link rel='alternate' type='text/html' href='http://marnanel.blogspot.com/2007/05/i-am-so-old.html' title='It&apos;s the shell playing tricks behind your back'/><author><name>marnanel</name><uri>http://www.blogger.com/profile/08335477330828148496</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='27' height='32' src='http://marnanel.org/pics/crest.png'/></author><thr:total>0</thr:total></entry></feed>
