<?xml version="1.0" encoding="UTF-8" ?><rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc=" http://purl.org/dc/elements/1.1/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>briancarper.net (λ) (Tag: Windows)</title><link>http://briancarper.net/tag/190/windows</link><description>Some guy's blog about programming and Linux and cows.</description><item><title>Clojure, SLIME, ODBC, SQL Server</title><link>http://briancarper.net/blog/clojure-slime-odbc-sql-server</link><guid>http://briancarper.net/blog/clojure-slime-odbc-sql-server</guid><pubDate>Fri, 26 Jun 2009 11:27:22 -0700</pubDate><description>&lt;p&gt;I had a lot of trouble connecting to an MS SQL Server at work via Clojure.  Java 6 comes with a JDBC-ODBC bridge which worked fine from a Clojure REPL at a command prompt, or from inferior-lisp in Emacs, but in SLIME it would hang every time I tried to connect and I'd have to kill Java.  Couldn't for the life of me figure out why.&lt;/p&gt;

&lt;p&gt;I got it to work eventually by using Microsoft's own JDBC driver, which you can download &lt;a href=&quot;http://msdn.microsoft.com/en-us/data/aa937724.aspx&quot;&gt;here&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Once you put the downloaded .jar file on your &lt;code&gt;CLASSPATH&lt;/code&gt; (in my case, &lt;code&gt;sqljdbc4.jar&lt;/code&gt;) you can connect like this:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;user&amp;gt; (def db {:classname &quot;com.microsoft.sqlserver.jdbc.SQLServerDriver&quot;
               :subprotocol &quot;sqlserver&quot;
               :subname &quot;//server_hostname;database=SomeDatabase;user=SomeUser;password=SomePassword&quot;})
#'user/db
user&amp;gt; (use 'clojure.contrib.sql)
nil
user&amp;gt; (with-connection db 
        (with-query-results rs [&quot;SELECT * FROM whatever&quot;] (prn rs)))
... results ...
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Posted for the sake of Googlebot and for my own future sanity.&lt;/p&gt;</description></item><item><title>Internet Explorer 8 Review</title><link>http://briancarper.net/blog/internet-explorer-8-review</link><guid>http://briancarper.net/blog/internet-explorer-8-review</guid><pubDate>Sat, 21 Mar 2009 00:35:52 -0700</pubDate><description>&lt;p&gt;I installed Internet Explorer 8 today.  I need it to test the websites at work.  I couldn't care less if my personal sites render properly in IE at this point, but I must accommodate people at work.&lt;/p&gt;

&lt;p&gt;I should mention right off the bat that given the way Microsoft takes a dump all over web standards and the hours and hours of grief as a web developer trying to get sites to look proper in IE6, unless IE8 crapped gold nuggets every time I clicked a link I don't think I'd like it.&lt;/p&gt;

&lt;h1&gt;Installing&lt;/h1&gt;

&lt;p&gt;I wasn't disappointed.  IE8 is hate-worthy.  A steaming pile of offal.  First there was the joy of trying to install it.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/random/ie8.png&quot; alt=&quot;&quot; title=&quot;&quot; /&gt;&lt;/p&gt;

&lt;p&gt;Why does installing a web browser require checking my computer for &quot;malicious software&quot;?  Why can't I opt out of this?  In any case I didn't have to worry about it, because the first time I tried the install, it bombed before it got that far, and demanded that I go to the Windows Update site and install some patch for IE7 before I could continue.  Note: I &lt;strong&gt;don't have IE7 on my computer&lt;/strong&gt;.  This is a work machine that I kept IE6 on for testing our company websites.  This blew my mind.&lt;/p&gt;

&lt;p&gt;So I tried to download this patch for IE7, but I couldn't, because I had to get &lt;strong&gt;Windows Genuine disAdvantage&lt;/strong&gt; first.  Rage filled me at this point to the point of overflowing.  If it was my home computer I'd have stopped right there.  But I need this garbage for work, so I held my nose and did it.&lt;/p&gt;

&lt;p&gt;Of course the patch required a reboot.  Reboot #1.&lt;/p&gt;

&lt;p&gt;Now I was able to continue with the install.  A slow, plodding download; I think it took 5-10 minutes to do its thing, but it's hard to tell.  There was no progress bar to show me how far along it was, nothing to tell me the elapsed time, no indication how large the files were that were being fetched.  There is something resembling a progress bar, but it doesn't actually show you much in the way of &quot;progress&quot;.  Instead a little green thing bounces around like the car from &lt;a href=&quot;http://en.wikipedia.org/wiki/Knight_Rider_(1982_TV_series)&quot;&gt;Knight Rider&lt;/a&gt;.  How much cocaine do you need to imbibe to invent a GUI like this?&lt;/p&gt;

&lt;p&gt;Of course IE8 itself required a reboot.  Reboot #2.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/random/ie8-2.png&quot; alt=&quot;&quot; title=&quot;&quot; /&gt;&lt;/p&gt;

&lt;p&gt;Why?  Installing Firefox and Opera don't require reboots.  They download as self-contained &lt;code&gt;.exe&lt;/code&gt; installer files.  I run them and software appears.  This is 2009, for the love of God.  Maybe in 20 more years Microsoft will finally manage to re-invent &lt;code&gt;emerge&lt;/code&gt; or &lt;code&gt;apt&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;The IE8 install, including patching and reboots, took me 45 minutes.  If I had to do this on more than one machine, I'd probably jump out the window.  How much time have you sucked out of my life, Microsoft?  To compare, I decided to install Opera.  Opera took &lt;strong&gt;less than one minute&lt;/strong&gt; to download AND install and didn't require a reboot.&lt;/p&gt;

&lt;h1&gt;Features&lt;/h1&gt;

&lt;p&gt;When you first open it up, it sends you through a wizard and asks you if you want to enable a bunch of crap.  I said no to everything.  What the hell is an &quot;&lt;strong&gt;&lt;em&gt;Accelerator&lt;/em&gt;&lt;/strong&gt;&quot;?  I assumed it was something that tried to make web pages load faster, like the &lt;strong&gt;&lt;em&gt;download accelerator&lt;/em&gt;&lt;/strong&gt; scams you used to get popups for all the time in 2001.  So I said no.&lt;/p&gt;

&lt;p&gt;Turns out &quot;Accelerators&quot; are plugins.  Why didn't they call them Plugins?  Did some marketroid decide &quot;plugin&quot; wasn't &lt;strong&gt;&lt;em&gt;EXTREME&lt;/em&gt;&lt;/strong&gt; enough, so decided to make up their own word?  Why do I have to relearn the English language every time someone releases new software?  &lt;a href=&quot;http://en.wikipedia.org/wiki/Not_Invented_Here&quot;&gt;Not Invented Here syndrome&lt;/a&gt;?&lt;/p&gt;

&lt;p&gt;Windows tried to default me to Live Search, but I give it credit for being upfront in allowing me to turn that crap off and use Google.  (No doubt thanks to US anti-trust court proceedings.)  473 wizard dialogs later I had a browser.  &lt;/p&gt;

&lt;p&gt;The next thing I noticed is more lame attempts to push more Microsoft services at me.  In the URL bar every time you type anything, you see this:&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/random/ie8-3.png&quot; alt=&quot;&quot; title=&quot;&quot; /&gt;&lt;/p&gt;

&lt;p&gt;Awesome.  Is there any way to remove this spamvertisement other than installing Windows Search?  If I planned to use IE8, which I don't, I imagine I'd inevitably click that by accident, which is probably the whole idea.  &lt;/p&gt;

&lt;p&gt;IE8 also added a bunch of useless garbage to my bookmarks toolbar which I insta-deleted.  Or tried to.  My favorite feature of IE8 by far is this one:&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/random/ie8-4.png&quot; alt=&quot;&quot; title=&quot;&quot; /&gt;&lt;/p&gt;

&lt;p&gt;Apparently deleting things from the bookmarks toolbar is just too much for a modern 4-core CPU to handle.  Congrats Microsoft.  Hang, crash, boom.&lt;/p&gt;

&lt;p&gt;There is no menu in IE8 by default.  No wait, there is a menu.  It's just in the wrong place (lower right side of the top browser area), and instead of readable text it's mostly unlabeled buttons with tiny arrows next to it.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/random/ie8-5.png&quot; alt=&quot;&quot; title=&quot;&quot; /&gt;&lt;/p&gt;

&lt;p&gt;It's like a traditional menu and a fun mystery novel combined!  What is in the dropdown next to the house?  I'm sure it's a fun surprise.&lt;/p&gt;

&lt;p&gt;And actually you can get the old menu to appear too, if you press &lt;code&gt;Alt&lt;/code&gt;.  Insanity.  But it doesn't appear at the top, it appears &lt;em&gt;under&lt;/em&gt; the URL bar.  One of the few arguably good things about Windows is that programs have consistent GUI parts and work the same way: they have a menu at the top, it's always in the same one place, there's a &lt;code&gt;File&lt;/code&gt; and an &lt;code&gt;Edit&lt;/code&gt;, and it's predictable.  Thanks Microsoft for getting even that wrong.&lt;/p&gt;

&lt;p&gt;When I highlight text on a web page, a little blue thing appears that I think I'm supposed to click on.  The icon is a bunch of lines and squiggles and an arrow or something.   There's no indication what that thing actually does.  I clicked it out of curiosity and get a menu full of a bunch of random options like &quot;Search for this&quot;.  I think this is where &lt;strong&gt;&lt;em&gt;ACCELERATORS&lt;/em&gt;&lt;/strong&gt; are supposed to pop up, or something, who cares?&lt;/p&gt;

&lt;p&gt;Fonts in IE8 look fuzzy.  As a bonus, after installing IE8, fonts in a bunch of other programs (Outlook) are fuzzy now too.  Hurrah!  IE8, like its predecessors, apparently extends its tendrils into every nook and cranny of your system, corrupting and perverting as it goes.  Maybe that's why it needed to reboot my computer twice to install it.&lt;/p&gt;

&lt;p&gt;IE8 comes with a &lt;a href=&quot;http://getfirebug.com/&quot;&gt;Firebug&lt;/a&gt; ripoff, which is better than View Source invoking Notepad, but took a full 2 minutes to load when I tried to open it the first time.&lt;/p&gt;

&lt;p&gt;IE8 does render my blog properly, which is good.  IE7 does too, I think, I only tested it once.  I'm not losing sleep over it.  Thank you Firefox and Opera: if you didn't exist and put the pressure on, we'd all still be using IE6 and I'd still be writing all my web pages twice to make sure they work in &lt;strong&gt;Internet Excrementplorer&lt;/strong&gt;.  As much as I detest IE, if people migrate to IE8 from the shard of utmost evil that is IE6, I'll be happy.&lt;/p&gt;</description></item><item><title>Interview with a new Linux user</title><link>http://briancarper.net/blog/interview-with-a-new-linux-user</link><guid>http://briancarper.net/blog/interview-with-a-new-linux-user</guid><pubDate>Sat, 30 Aug 2008 21:53:06 -0700</pubDate><description>&lt;p&gt;&lt;em&gt;After countless, endless hours of nagging on my part, my girlfriend finally put Linux on her laptop.  I thought it would be interesting to hear what a long-time Windows-using non-programmer thinks of Linux (Kubuntu in this case) after a few weeks of use.  So I interviewed her.  Read on.  My thoughts and conclusions are at the end.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Q1: &lt;strong&gt;&lt;em&gt;How would you describe your level of expertise or skill level when it comes to computers in general?&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;A: I think I'm better with computers (at least Windows) than the majority of my classmates (I'm starting third year accounting next week).  I know my way around the internet, I'm decent with programs like Office and GIMP, and I know how to fix most problems that affect me as a lay user.  As for Linux, I would know how to look for help, but I probably wouldn't understand it yet.&lt;/p&gt;

&lt;p&gt;Q2: &lt;strong&gt;&lt;em&gt;You used Windows for a long time in spite of my constant pestering.  What kept you from using Linux until now?&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;A: A few years ago you tried to get me to use Gentoo.  I was younger, and apparently Linux in general was more difficult to use, so I got frustrated pretty quickly.  A lot of my reluctance was from remembering that time.  I was also worried that I might do something wrong and lose all my schoolwork.  At least in Windows I know it wouldn't be directly my fault if that happened (disregarding the fact that I'm slow at backing things up).  &lt;/p&gt;

&lt;p&gt;Q3: &lt;strong&gt;&lt;em&gt;You decided to use Kubuntu.  Why did you pick that distro instead of another?&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;A: I heard it was easy for Windows users to pick up.  It's also the one you have on your laptop, so it's easier to get tech support.&lt;/p&gt;

&lt;p&gt;Q4: &lt;strong&gt;&lt;em&gt;Why did you pick KDE instead of Gnome, XFCE, or some other desktop environment / window manager?&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;A: I don't remember.  Something about having multiple wallpapers on multiple desktops and being able to make them change randomly whenever I want.  There might've been other reasons, but that one is the most enjoyable so far.&lt;/p&gt;

&lt;p&gt;Q5: &lt;strong&gt;&lt;em&gt;How hard was it to install Linux?  Compared to Windows?&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;A: It was about the same.&lt;/p&gt;

&lt;p&gt;Q6: &lt;strong&gt;&lt;em&gt;How hard was getting everything set up the way you like it after Linux was installed?  How long did it take you?&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;A: There's always a lot to set up on a clean install of anything.  It took me a few days to find something I'm comfortable with.  I mostly just ripped off your setup because I liked it, though, so that made it a bit easier.  Getting SKIM to work was quite difficult, though, since I couldn't find good instructions for my version of Kubuntu (or Kubuntu at all, really).  I think I just ended up making you fix it.&lt;/p&gt;

&lt;p&gt;Q7: &lt;strong&gt;&lt;em&gt;Does Linux have any features or applications you really enjoy, that Windows is missing?  Can you do anything in Linux that you couldn't do (easily) in Windows?&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;A: Even just doing a small amount of image editing yesterday, I'm beginning to see the appeal of multiple desktops.  I also like how easily it's detected various wireless networks so far.  The package manager is pretty nice too.  I wouldn't have a Gmail checker if you didn't write one for me, but the one you wrote is better than the one I was using before.&lt;/p&gt;

&lt;p&gt;Q8: &lt;strong&gt;&lt;em&gt;Do you miss anything from Windows?  Is there anything you could do in Windows that you can't do (easily) in Linux?&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;A: It's easier to install programs in Windows than it is to install non-package programs in Linux.  I still don't know the difference between a source and a binary.  I don't miss playing games too much, since I'm more of a console person.  But I do miss OtaClock.  The default clock is boring and not cute at all.&lt;/p&gt;

&lt;p&gt;Q9: &lt;strong&gt;&lt;em&gt;How comfortable are you with using a command prompt?&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;A: Not very.  I know how to chmod things, but that's about it.  I need to look for a guide for basic bash commands that explains them in plain English.&lt;/p&gt;

&lt;p&gt;Q10: &lt;strong&gt;&lt;em&gt;How do you like the general look and feel of the Linux desktop compared to Windows?&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;A: It's a lot nicer looking overall.  I like being able to use all the Buuf icons easily.  At first I was resistant to using anti-aliased font, but it's growing on me.  Windows displayed aliased fonts so nicely, and I still kind of miss it.&lt;/p&gt;

&lt;p&gt;Q11: &lt;strong&gt;&lt;em&gt;You have a dual-boot set up.  What do you still plan to use Windows for?&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;A: I have a couple games that don't work in Linux.  I also use my laptop for school, and my university is dominated by Windows, so I feel comfortable having it around for compatibility purposes if I ever need it.&lt;/p&gt;

&lt;p&gt;Q12: &lt;strong&gt;&lt;em&gt;It's been a few weeks since you switched to Linux.  How has it been overall?  Do you plan to stick with it long-term?&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;A: Overall it's been about the same as Windows.  Something about Vista still creeps me out, so it feels good using an OS that doesn't feel evil.  I like being able to get pretty much any program I want free and on demand.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;Here are some Linux programs I know you've used... tell me something you like and something you dislike about each one.&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;&lt;em&gt;Dolphin&lt;/em&gt;&lt;/strong&gt; It's minimalistic, but it doesn't have the view options I like.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&lt;em&gt;Konqueror&lt;/em&gt;&lt;/strong&gt; I can get all the info on a file that I need just by mousing over it.  It took me a while to figure out how to both display thumbnails and then sort them by size or date, though.  I'm quite obsessive about collecting and sorting pictures, and in Windows that was how I used to see which pictures were new or duplicates.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&lt;em&gt;Gwenview&lt;/em&gt;&lt;/strong&gt; It finds duplicate pictures for me, making the above method obsolete.  It even finds similar pictures, which is pretty intersting.  So far I can't think of anything I don't like about it.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&lt;em&gt;Amarok&lt;/em&gt;&lt;/strong&gt; Win-B is my friend.  There's too many unnecessary features for me, though.  I don't care about album art or smart playlists.  It's good that I can just ignore them.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&lt;em&gt;Kopete&lt;/em&gt;&lt;/strong&gt; It has custom themes.  I really like the Metal Gear theme you made.  For some reason I can't figure out how to make our text different colours, though.  The text is different for my friends who use the real MSN, but for you it's the same colour is mine, so it's harder for me to read.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&lt;em&gt;Kate&lt;/em&gt;&lt;/strong&gt; It's like tabbed Notepad.  I'm one of those people who actually likes Notepad, since I don't do much coding at all.  I can see where Vim is better, but Kate is fine too.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&lt;em&gt;KDE as a whole&lt;/em&gt;&lt;/strong&gt; When it's set up properly, it looks really nice. The amount of stuff I needed to change to get it to look nice was quite overwhelming, though.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;em&gt;Thoughts and conclusions: I used to try to push Gentoo on people, and that was a mistake.  Gentoo isn't for everyone.  A bad experience can kill people's opinions of Linux.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;It's a lot easier to make a big switch to a new operating system when you have knowledgeable people to back you up and help you out.  This is one area where Linux shines: There are a LOT of people willing to help newbies.  The community aspect of Linux is by far one of the best parts of using it.  We're all doing this because it's fun and Linux people like to share the fun with others.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Is Linux ready for the desktop?  I think so; I think it has been for a while now.  A Windows power-user can find a lot to like in Linux.  There are a lot of features and apps in modern desktop Linux that offer a lot of things many people would find very appealing if they only knew they existed.&lt;/em&gt;&lt;/p&gt;</description></item><item><title>Stupid Vim trick (and mental illness)</title><link>http://briancarper.net/blog/stupid-vim-trick-and-mental-illness</link><guid>http://briancarper.net/blog/stupid-vim-trick-and-mental-illness</guid><pubDate>Thu, 10 Jul 2008 16:48:07 -0700</pubDate><description>&lt;p&gt;The OS on my first computer was Windows 3.1, and I lived with Windows 95/98/ME for a long time.  When you live their formative years in this kind of environment, you develop an obsessive need to save your work all the time, because at any moment, the program you were using could crash.  With Vim, a save is just a &lt;code&gt;:w&lt;/code&gt; away.  I hit that combination so often it's a wonder I haven't worn a hole through my w key yet.  It takes no effort or thinking at this point, just a quick reflex flick of the wrist.&lt;/p&gt;

&lt;p&gt;Did you ever wonder just how often you save your work in a given day?  I wondered, so I put this into ~/.vimrc:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;cabbrev w &amp;lt;c-r&amp;gt;=(getcmdtype()==':' &amp;amp;&amp;amp; getcmdpos()==1 ? 'W' : 'w')&amp;lt;CR&amp;gt;
command! -nargs=* W :execute(&quot;silent !echo &quot; . strftime(&quot;%Y-%m-%d %H:%M:%S&quot;) . &quot; &amp;gt;&amp;gt; ~/timestamps&quot;)|w &amp;lt;args&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Now every time I do &lt;code&gt;:w&lt;/code&gt;, it will append a timestamp to a text file.  It's not quite perfect and :w won't work right in certain cases but it was good enough for a quick hack.&lt;/p&gt;

&lt;p&gt;I let Vim go like this for one whole day at work.  I got in a good six and a half hours of coding on Tuesday (keeping in mind that I was using other programs all day too, messing with our DB, running and debugging the script I was writing, responding to emails, and so on).&lt;/p&gt;

&lt;p&gt;It turns out I hit :w 356 times that day.    Here's a chart of saves per hour.  &lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/random/saves-per-hour.png&quot; alt=&quot;Saves per hour&quot; /&gt;&lt;/p&gt;

&lt;p&gt;Clearly either my productivity or my data-loss paranoia increases as the day progresses.  I think I got up to make a cup of tea at around 2:00 so that may explain the fall-off.  And the last hour isn't quite a full hour of work because I went home.&lt;/p&gt;

&lt;p&gt;So as a rough estimate, it looks like I save my work about once per minute.  Looking at the data, it's not at all uncommon for me to have saved my work twice within a 5-second period of time.  There are even a few cases where I saved twice within two seconds.&lt;/p&gt;</description></item><item><title>Cool feature in Vista</title><link>http://briancarper.net/blog/cool-feature-in-vista</link><guid>http://briancarper.net/blog/cool-feature-in-vista</guid><pubDate>Sun, 01 Jun 2008 22:05:30 -0700</pubDate><description>&lt;p&gt;Vista has this really cool feature.  When I log in to work via VPN and then close my laptop's lid to put it to sleep, when I open the lid later, I get the CTRL+ALT+DEL login screen as normal, except that my mouse cursor is now invisible!  If I can somehow manage to position the invisible mouse cursor over a button, let's say the one to shut the computer down, and I click it, Vista says something about not having enough memory to perform that operation, and crashes or hangs!&lt;/p&gt;

&lt;p&gt;Oh wait, that's not a feature.  That's a big hairy stinking bug.  My mistake.&lt;/p&gt;</description></item><item><title>FAT</title><link>http://briancarper.net/blog/fat</link><guid>http://briancarper.net/blog/fat</guid><pubDate>Mon, 05 May 2008 17:13:36 -0700</pubDate><description>&lt;p&gt;I had to undelete someone's files from a FAT partition today.  My first thought was to use good ol' Windows to do so, given that Windows is the unholy ground which spawned FAT to begin with.  I remember there used to be an UNDELETE command of some sort in some old version of DOS.  But this doesn't seem to exist in XP any longer.  &lt;/p&gt;

&lt;p&gt;There are however lots and lots of third-party &quot;shareware&quot; programs which can do this kind of thing, as &lt;a href=&quot;http://www.google.com/search?q=undelete+fat32&quot;&gt;Google reveals&lt;/a&gt;.  There is in fact an overwhelming number of such shareware programs.  Most of these programs are total crap and cost around $30.  One program required me to burn a CD and reboot my computer from the CD before I could run it.  Many of the programs &quot;intelligently&quot; scan a partition looking for chunks of things that look like JPEGS or WMVs.  I tried a few &quot;demos&quot; before I gave up, not having an hour to waste finding the one program that would work.  Thus bringing the current score to Windows: 948, Brian: 0.&lt;/p&gt;

&lt;p&gt;Instead I brought the drive home and plugged it into Gentoo and used &lt;a href=&quot;http://lists.slug.org.au/archives/slug/2006/05/msg00002.html&quot;&gt;this post&lt;/a&gt; as a guide.  I dd'ed the partition to a file, fscked around with it a bit, mounted it via loopback, and had my files back.  Took 10 minutes, and worked as expected.  And it didn't cost me $30.&lt;/p&gt;

&lt;p&gt;The moral of this story: I need to burn a Knoppix disk to take to work with me.&lt;/p&gt;

&lt;p&gt;My only quibble is that I can never ever remember what Gentoo package contains &lt;code&gt;fsck.vfat&lt;/code&gt;.  Note to self, it's &lt;code&gt;dosfstools&lt;/code&gt;.  I can never think of the search terms even to locate that package.  I had to google it.&lt;/p&gt;</description></item><item><title>Windows Vista: Offal</title><link>http://briancarper.net/blog/windows-vista-offal</link><guid>http://briancarper.net/blog/windows-vista-offal</guid><pubDate>Mon, 10 Mar 2008 23:13:15 -0700</pubDate><description>&lt;p&gt;It took me a while to think of a good word to describe Vista in the title for this post.  I went with offal because &quot;&lt;em&gt;the parts of a butchered animal removed in dressing; viscera; refuse; rubbish; garbage&lt;/em&gt;&quot; at least approximates the smell of Vista somewhat accurately.  &lt;/p&gt;

&lt;p&gt;How can Microsoft so consistently make such garbage-quality software?  It's not like I'm looking for things to hate.  I really wanted Vista to be sort of good.  Heck, I had to buy a copy of Vista for work, and I don't like thinking that I wasted my money.   I'd love to love Vista.  (If not for the fact that spending money on Windows helped me get jobs that more than made up for the price of it, I would definitely consider myself to have lost money.)&lt;/p&gt;

&lt;p&gt;But no.  Here are the things about Vista that annoyed me, JUST TODAY, during the two hours it took me to backup my files in preparation for installing a dual-boot of Ubuntu on it.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The mouse speed when I use my trackpad in Vista is about 800% slower than when I use a USB mouse.  I can't figure out why.  This problem does not exist in Ubuntu, where both work fine and at the same speed.&lt;/li&gt;
&lt;li&gt;About once every second, Vista accesses my hard drive.  I hear &quot;click&quot;... &quot;click&quot;... &quot;click&quot;... &quot;click&quot;... incessantly forever.  I don't know what running process is doing this.  I killed everything I could think of.  I turned off indexing of my files.  I thought it was the Sidebar for a while, but nope.  Still it does this.  Lo and behold, the laptop doesn't do this in Ubuntu.  What the hell is Vista looking for on my hard drive all the time?  How much has my HD's lifespan been reduced by this? &lt;/li&gt;
&lt;li&gt;I tried to burn a DVD to back up my files.  A popup bubble near the taskbar told me I had files waiting to be burned.  It's a good thing too, because the enormous freaking window where I was dragging and dropping files wasn't enough of a reminder.  This reminder bubble kept appearing, disappearing, appearing, over and over and over.  I don't know why.  When I say &quot;disappear&quot;, I don't mean instantly disappear.  I mean a slow, sluggish, jittery, gratuitous fade-out animation which clearly left Vista out of breath due to the struggle of the demanding computational feat of displaying a 100x200 pixel transparent rounded window.&lt;/li&gt;
&lt;li&gt;Vista failed to burn the DVD, without giving any error message other than that &quot;burning failed&quot;.  Then it told me to insert a new disc.  I did.  It made some noises, spit it out, and said &quot;No disk inserted, please insert a disc&quot;.  I tried 3 blank DVDs and all were rejected.  I used Roxio in Vista and it worked OK (on the first DVD I tried to begin with), though Roxio itself is trash and was filled with links to get me to &quot;Upgrade&quot; (probably spend money; I didn't click them).  (It's been YEARS since I've had a problem burning a disc in K3B.  I'm using Gentoo for God's sake.  I compile my own kernels and have to pick my device drivers from big lists of things I don't even remotely recognize.  Think of how many things I could've done wrong setting up Gentoo that would prevent my DVD burner from working.  I'm practically BEGGING it not to work here, and yet it does.)&lt;/li&gt;
&lt;li&gt;Every time I rebooted, Vista reminded me again that I had files waiting to be burned, until I double clicked the DVD icon in Computer and deleted the ghost-files that appeared there in spite of there being no DVD in the drive.  Once the last ghost file was gone, Vista immediately asked me to insert a DVD(????).&lt;/li&gt;
&lt;li&gt;I used Vista's built in sucky Disk Manager to resize my Vista NTFS partition to make room for Ubuntu.  It would only let me reduce the size of a 100GB partition by 30GB, even though 80GB were free in that partition.  Googling reveals that this is a well-known limitation of the Disk Manager.  Because Vista is a well-known piece of feces.  I am actually one of the lucky ones, apparently.  For many people, Vista just flat out refuses to resize a partition at all, regardless of how much space is free.  If not for the fact that Ubuntu only takes 2.5GB fully-installed (including my boot partition, OpenOffice, Firefox, Gimp, and TONS of needless packages Ubuntu provides by default) I might be in trouble.&lt;/li&gt;
&lt;li&gt;While trying to make a backup of my files, I noticed that one of my folders had a random empty &lt;code&gt;My Music&lt;/code&gt; subfolder in it.  This folder didn't appear when I looked in Explorer, but it appeared magically in certain other file selection dialogs.  Apparently my laptop is haunted by evil spirit folders, attracted by the pure evil that Vista radiates in all directions.&lt;/li&gt;
&lt;li&gt;I tried deleting a folder full of music files.  As always, this stretched out into a 10-minute operation.  Eventually, Vista dramatically warned me about deleting desktop.ini because, as we all know, it's VITAL to the workings of my system.  I told it to delete it.  Then it warned me that some of my folders were too big to fit in the recycle bin and would have to be deleted immediately instead.  Gasp.  I told it OK.  Then it told me that one of my music folders was shared, and deleting it would stop it from being shared.  You don't say!  How this folder became shared, I do not know; never have I accessed this folder from another computer. I told it to go ahead and delete it.  Then it repeated this warning about sharing, for the next folder.  And then again, FOR EVERY SINGLE FOLDER I WAS DELETING, one by one.  This is all with User Account Control DISABLED.  If I had it enabled I'd be sitting there clicking OK in prompt after prompt until tomorrow morning.  Eventually I went to DOS and tried &lt;code&gt;rmdir /s /q *&lt;/code&gt;.  This didn't work, I believe because it couldn't find a folder called &quot;*&quot;.  So I had to &lt;code&gt;rmdir /s /q&lt;/code&gt; each directory manually.  Thankfully Vista's tab-completion is gimped enough to make even that more difficult than it should ever be.&lt;/li&gt;
&lt;li&gt;All the while, I experienced random lag and slowness and horrible pain.  This is such a standard problem in Vista that it's almost possible to forget that the lag exists, until you boot into Linux and see how stupidly fast your computer runs in comparison.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;My coworkers report that some people at work who got new laptops and requested Vista are having such problems that the laptops are almost unusable.  Apparently 1GB of RAM isn't enough.  If my computer is any testament, neither is 2GB.&lt;/p&gt;

&lt;p&gt;When I got into Ubuntu for the first time, I immediately noticed that the latpop FLIES.  Which is to be expected with a fairly new Core 2 Duo machine with a fairly nice video card etc. etc.  Amazing.  I even put big fat bloated Compiz on here running on top of big fat bloated Gnome, with all kinds of ridiculous desktop apps and file-indexers and God only knows what else Ubuntu is throwing at me, and it still runs perfectly.  Only thing that didn't work out of the box was my wireless card, which took me 15 minutes of googling to find an easy solution for.  (For googlers: Dell Vostro 1500 is my laptop.  Ubuntu works on it perfectly well.)&lt;/p&gt;

&lt;p&gt;In three years when Microsoft releases their next stinker OS, I'm probably going to be forced to buy that one too.  The joys of a world where everyone uses Microschloft Office.&lt;/p&gt;</description></item><item><title>Stable like a two-legged chair</title><link>http://briancarper.net/blog/stable-like-a-two-legged-chair</link><guid>http://briancarper.net/blog/stable-like-a-two-legged-chair</guid><pubDate>Wed, 13 Feb 2008 12:41:36 -0800</pubDate><description>&lt;p&gt;We got a new laptop at work with Windows XP.  Our company like so many others wouldn't touch Vista with a 12-foot pole.  Not sure how much good that policy is doing us; I got three BSoD's in 15 minutes. Thanks, Microsoft!&lt;/p&gt;

&lt;p&gt;Yesterday one of my coworkers asked me to look at her laptop.  Power was on, but there was a nice black screen and no response from mouse or keyboard.  I put it out of its misery and rebooted.  Thanks, Microsoft!&lt;/p&gt;

&lt;p&gt;Couple days ago, I turned on yet another laptop and was greeted with some kind of &quot;RESUME FROM HIBERNATION FAILED&quot; message as the laptop froze.  Took it out back and shot it and rebooted.  Thanks, Microsoft!&lt;/p&gt;

&lt;p&gt;I came in to work this morning and my desktop machine gave me a screen on which my desktop wallpaper showed, my mouse cursor was present and responsive, but there was no login window.  Wouldn't respond to keyboard commands, CTRL+ALT+DEL, ALT+F4, nothing.  I ended its life and rebooted.  Thanks, Microsoft!&lt;/p&gt;

&lt;p&gt;I ended up teaching everyone at work the &quot;If your computer is completely unresponsive, hold the power button down for 10 seconds&quot; lesson.  How sad that this should be necessary.  All of our machines at work run XP and are kept quite up-to-date on patches.  Some are old, some are new, and they span a wide variety of brand names and hardware configurations.  Our IT guys seem very competent and on top of things.  And yet, the computers are fickle and crash-prone and I often hear complaints about how unresponsive and unreliable they are.&lt;/p&gt;</description></item><item><title>A rant about rants</title><link>http://briancarper.net/blog/a-rant-about-rants</link><guid>http://briancarper.net/blog/a-rant-about-rants</guid><pubDate>Mon, 17 Dec 2007 03:51:22 -0800</pubDate><description>&lt;p&gt;I was just working on an Access DB, and I noticed that it's now somehow 415 MB.  Want to know the funny part?  There's no data in it.  Not a SINGLE ROW.  Just two EMPTY TABLES.  HOW?!  Someone was paying me to do this as a side-project, and I'm going to have to tell them tomorrow that I've completely and utterly failed.  I simply cannot get Access to work.  There are two possibilities as to why: either Access 2007 is a piece of garbage, or I'm an idiot, and I don't think I'm an idiot in this particular case.&lt;/p&gt;

&lt;p&gt;Having gotten that out of the way: if you read through a few posts in this blog, you'll probably quickly come to realize that my blog is approximately 97% rants.  In this case it's about something I truly hate (MS Access).  Most of the time I'm really just being silly.  I don't really hate Emacs or Pyt&lt;span&gt;&lt;/span&gt;hon or most of the other targets of my ramblings.  They're well-developed, useful, successful open source projects.&lt;/p&gt;

&lt;p&gt;I have to hope and pray that most other people feel the same way.  Even people who participate in the infamous Vim vs. Emacs wars or the Linux distro wars or the Ruby vs. Pyt&lt;span&gt;&lt;/span&gt;hon vs. Perl wars or whatever, even those people I think would admit that deep down, they don't really hate the opposition.  I really hope that's true.  (Except in IE vs. Firefox/Opera/anything else wars, in which case yes, IE deserves to burn in web browser hell for all eternity.)&lt;/p&gt;

&lt;p&gt;Why the rants then?  For me, it's because I have a love-hate relationship with computers.  I think that anyone who spends a lot of time dealing with them eventually will end up feeling the same way too.&lt;/p&gt;

&lt;p&gt;Imagine a carpenter who is forced to use a hammer that on 19 swings out of 20, misses whatever he's aiming at.  Or the head flies off and hits him in the face. That's the process we go through as programmers every day.  &lt;/p&gt;

&lt;p&gt;We put spend hours and hours training ourselves to be good programmers, bending our minds in all kinds of pretzels, learning the minute esoteric details of exactly how to write and format code in some programming language so that not a single character is out of place.  Then we put forth all kinds of thought and effort and creative energy to produce something useful and powerful and maybe even a little bit artistic.  And then we try to run our shiny new program, and we're treated to a screenful of &lt;strong&gt;&quot;WRONNNNNNGG!  SYNTAX ERROR!!!!!!  UNDECLARED VARIABLE!!!!!!  CORE DUMP!!!!!  UNHANDLED EXCEPTION!!!!&quot;&lt;/strong&gt;  Over and over and over, eight hours per day (at work; more at home at night if I'm in the mood).&lt;/p&gt;

&lt;p&gt;Some people can deal with that, and some people can't.  I've seen non-programmers try to do something as simple as write a web page in HTML.  I'm not surprised at how quickly the task reduces most people to foaming-at-the-mouth, frothing, psychotic rage.&lt;/p&gt;

&lt;p&gt;I've long believed that it takes a special kind of personality disorder to be a programmer.  It takes an obsessively over-active attention span and a willingness to subject yourself to a very mild yet unrelenting form of mental torture.  It's not that programming gets any less frustrating.  It's that we learn to accept and even welcome the pain of it.  Most good programmers I've met are a cynical, sarcastic, somehow cheerfully pessimistic bunch.&lt;/p&gt;

&lt;p&gt;So at some point after the seventh or eighth hour in a row of non-stop code-writing, it's no longer about solving a problem or having fun.  It's about revenge.  Anger and hatred take over as motivation.  The problem is simply going to be solved, even if I have to rip the computer apart with my bare hands and divine the answer on its entrails.  Picture &lt;em&gt;Office Space&lt;/em&gt;, a couple of geeky guys going out into the field with baseball bats and letting the printer have it.  Everyone who's written substantial amounts of code knows exactly what that's like.&lt;/p&gt;

&lt;p&gt;Yet at the end of the process, having experienced failure after failure after failure, eventually there will come a point where you hit Enter, and against all expectations, completely by surprise, your program works.  Glorious streams of correct output flash across the screen.  Is that moment worth all the anguish to get there?  It must be, because I keep doing it.  &lt;/p&gt;

&lt;p&gt;I think in the end I do love programming.  I'm lucky to have a job where I can do it every day.  At the same time, if you ever come into my office and I'm curled up under my desk in a fetal position, laughing maniacally, try to look the other way.&lt;/p&gt;</description></item><item><title>: (</title><link>http://briancarper.net/blog/384</link><guid>http://briancarper.net/blog/384</guid><pubDate>Sun, 25 Nov 2007 19:05:24 -0800</pubDate><description>&lt;p&gt;I'm working on an Access database for work using Office 2007.  This is probably the most painful thing I've had to do in a long, long time.  Oh the things we do for money.&lt;/p&gt;

&lt;p&gt;Do you want to know how to get Access to crash?  Step 1: Add a label to a form.  Step 2: Delete it.  Step 3: Try to undo.  Crash.  &lt;/p&gt;

&lt;p&gt;Here's another way. Step 1: Add a bunch of text fields.  Step 2: Highlight them all.  Step 3: Click this big &quot;Control Padding&quot; button.  Step 4: Watch the applicaiton hang, then put it out of its misery.&lt;/p&gt;

&lt;p&gt;Did you know in Vista when you crash an app, the &quot;fatal error&quot; popup dialog box gives you a helpful option to restart the app?  See, Microsoft anticipated the problem of instability, and gave us a fix.  What more could you want?&lt;/p&gt;

&lt;p&gt;I added a bunch of fields to an Access form, and they all auto-appeared stacked directly on top of each other.  I tried to auto-size some text fields via some cryptically named &quot;To Fit&quot; button, and it made them all 1000 pixels wide, with 1000 pixel wide labels beside them.  I think they're trying to boost computer monitor sales.&lt;/p&gt;

&lt;p&gt;I accidentally added too many columns while designing a table (there's a limit to how many columns can appear in a table, and it's not hard to hit).  So Access wouldn't let me save the table.  It started complaining about there being too many indexes on the table.  Then it just complained about there being too many columns.   I started deleting columns.  It still wouldn't let me save because it thought some of the columns I deleted were still there.  I deleted almost all the columns but it still wouldn't let me save it.  I had to delete the whole table and start over.&lt;/p&gt;

&lt;p&gt;There's this thing on the left that's supposed to list your tables and forms and queries.  It took me 15 minutes to figure out how to get it to show all three of those things at once.  The menu that lets you pick what to display is like some kind of sadistic logic puzzle with no answer.  Picking one option suddenly makes a bunch of other options disappear or rearrange themselves.  Some things in popup menus look exactly like options but are unclickable.&lt;/p&gt;

&lt;p&gt;Really it's like every single minute part of the Access GUI was specially designed to behave differently than every other part.  It's like they didn't have a widget toolset to pick from so everyone made up their own widgets.  I honestly couldn't make something this hard to use if I tried.  But Microsoft has billions of dollars of resources to throw at the problem I guess.&lt;/p&gt;

&lt;p&gt;Buttons on the magic ribbon are sized according to how important they are, I guess:&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/random/access_sucks.png&quot; /&gt;&lt;/p&gt;

&lt;p&gt;The huge labeled &quot;Logo&quot; button on the left adds a pretty decorative icon to the top left corner of the form.  The microscopic button last thing on the right lets you view and edit source code for the form.&lt;/p&gt;

&lt;p&gt;I just noticed that my &quot;Form Footer&quot; actually appears ABOVE my form right now.  ...I'm speechless.  (I'm actually not speechless.  I'm sitting here cackling madly, on the brink of losing my wits.)&lt;/p&gt;

&lt;p&gt;Make it stop hurting.  Why won't it stop hurting?&lt;/p&gt;</description></item><item><title>Redemption, sadly.</title><link>http://briancarper.net/blog/redemption-sadly</link><guid>http://briancarper.net/blog/redemption-sadly</guid><pubDate>Mon, 29 Oct 2007 20:48:35 -0700</pubDate><description>&lt;p&gt;Today I rammed smack up against a brick wall in my C# endeavors.  The problem at hand was something that seems pretty simple: Randomly shuffle an array.  Anyone who knows Ruby knows that this is super easy. Here's one way:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;arr.sort_by { rand }
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;How do you do this in C#?  Search google for some tips and view the abject horror of a verbose and non-orthogonal weak language.   &lt;a href=&quot;http://www.thescripts.com/forum/thread287240.html&quot;&gt;Read if you dare.&lt;/a&gt;  Find the shuffle routine in &lt;a href=&quot;http://groups.google.com/group/Google-Code-for-Educators/browse_thread/thread/392354fabf70512d&quot;&gt;this labyrinth of code&lt;/a&gt;, and feel the pain.  Have &lt;a href=&quot;http://www.thescripts.com/forum/thread119718.html&quot;&gt;some more&lt;/a&gt; if you like.  ...&lt;a href=&quot;http://www.eggheadcafe.com/community/aspnet/2/50058/you-could-introduce.aspx&quot;&gt;cringe.&lt;/a&gt;  Then &lt;a href=&quot;http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=60108&amp;amp;SiteID=1&quot;&gt;read this one&lt;/a&gt;.  And then read on Wikipedia why this &lt;a href=&quot;http://en.wikipedia.org/wiki/Shuffling#Implementation_of_shuffling_algorithms&quot;&gt;last solution is pretty much totally wrong&lt;/a&gt;.  And why the Ruby one above is very much right.&lt;/p&gt;

&lt;p&gt;So a lot of people wrote a lot of C# code, much of it ugly, to solve this problem, so what?  You can find bad code in any language.  My point is, to borrow a mantra from the world of Lisp, not all programming languages are created equal.  Sure, all programming languages are equally powerful in the Turing-complete sense; you could write a Ruby interpreter in C# and solve the above problem that way.  But there are things about some languages that make it much more difficult to solve some problems than it would be in other languages.  Passing around blocks in Ruby makes it super easy to solve a problem like randomly shuffling an array.  In C#, Java, etc. you'd at the very least have to make some kind of object that represents a sorting algorithm, some kind of method that takes and uses such an object, and you'd also have to worry about all the type compatibility between all of the above.  Or I could use some kind of delegate method, which is C#'s version of function pointers, from what little I read.  Both of those solutions are a lot more code than I really want to write to solve such a simple problem.&lt;/p&gt;

&lt;p&gt;In Perl, to do this kind of thing, you'd take the array, map it into a hash of array-element / random-number pairs, sort by the random numbers, and then re-map it into an array.  More verbose than Ruby, but better than nothing.  C# has Hashtables and ArrayLists, so why not try it the longhand Perl way?  That's what I ended up trying in C# at work.  At this point, I ran up against all the lovely limitations of statically typed languages.  First I made a hash and tried to get a list of its keys and store them in a native array.  You can't do that, because Hashtable returns an ICollection object, not a plain old array, and you can't cast one into the other.  C# apparently retains some of the ridiculous Array vs. ArrayList, primitive type vs. object type bullcrap that comes from the world of Java.  What reason is there to have a subset of things that are completely incompatible with another subset of nearly identical things?  What reason is there to have such a thing built into the very foundation of a language?  Java has the excuse (maybe) that they started off with a bunch of crap, and had to try to fix their crap without breaking all the code everyone already wrote using the old crap.  What's C#'s excuse for copying this horrendously unwieldy mess?&lt;/p&gt;

&lt;p&gt;I eventually got everything sorted out, and it didn't take THAT long, but sure it wasn't pretty.  And it was silly, unnecessary work.  The solution ended up being 20 or so lines of code to do what Ruby does in 13 characters much more elegantly.&lt;/p&gt;

&lt;p&gt;Problem number two today came when I tried to printf a string, and strftime a DateTime.  Now, there are what seem to be pretty widely accepted standards on how a formt string for &lt;a href=&quot;http://en.wikipedia.org/wiki/Printf&quot;&gt;how a printf-style function should look&lt;/a&gt;.  %d, %s, %f, and so on.  Similarly lots of languages have a strftime function that uses &lt;a href=&quot;http://us.php.net/strftime&quot;&gt;pretty standard tags&lt;/a&gt; to represent month, day, year, hour, minute, second etc.  There are some variations between languages, but the general idea is similar enough that you can pick it up very quickly.  In many cases you can drop C strings into Perl or Ruby or whatever, and it'll work just the same.&lt;/p&gt;

&lt;p&gt;Well, of course, Microsoft craps all over those pseduo-standards.  In C# rather than something like &quot;%0.8d&quot;, you get something that looks like &lt;code&gt;&quot;{0,8:#}&quot;&lt;/code&gt;.  Same deal for strings to format dates and times; they look nothing like the strftime I'm familiar with.  &lt;/p&gt;

&lt;p&gt;Why?  Why does MS have to do everything differently than everyone else in the world?  The choice of format strings is totally arbitrary, so why not use what every freaking other language in the world uses?  Is it to keep MS-only programmers mentally tied into MS-only languages so that anything non-MS looks alien to them?  Are the MS-style format strings any more powerful than printf-style?  Not that I can tell; the C# ones give you special tags for &quot;currency&quot; and to comma-separated numbers, but couldn't they have just added a &quot;%$&quot; and &quot;%,&quot; to the MS version of printf or something?  &lt;a href=&quot;http://msdn2.microsoft.com/en-us/library/dwhawy9k.aspx&quot;&gt;Read this trash.&lt;/a&gt;  I spent way too much time today reading through this small encyclopedia of documentation on MS-style format strings just to re-learn something I already knew very well. &lt;/p&gt;</description></item><item><title>What's happening to me?</title><link>http://briancarper.net/blog/whats-happening-to-me</link><guid>http://briancarper.net/blog/whats-happening-to-me</guid><pubDate>Sun, 28 Oct 2007 01:01:23 -0700</pubDate><description>&lt;p&gt;I had to buy a mouse for my laptop, and &lt;a href=&quot;http://www.microsoft.com/hardware/mouseandkeyboard/productdetails.aspx?pid=070&quot;&gt;this Microsoft mouse&lt;/a&gt; is what I got.  Microsoft does actually seem to make decent mouses.  It's a nice little mouse, takes one AA batter that supposedly lasts 6 months, has a little USB antenna that snaps into the base of the mouse for travel and which also turns off the laser when embedded.&lt;/p&gt;

&lt;p&gt;First I managed to tolerate C#, and now I'm using a MS-spawned mouse.  What's happening to me?  What next, will I become a Microsoft MVP (r)(tm)(r) and start hanging pictures of Ballmer all over my living room?&lt;/p&gt;

&lt;p&gt;Or maybe this shows that I'm open-minded and that my undying hatred of MS software isn't due to bias but is actually a valid and well-founded opinion based on the inferiority of the software itself.  Phew.&lt;/p&gt;

&lt;p&gt;In other non-news, I'm really trying to get my Gentoo box shipped out to me within the next week or two.  I'm going through heavy withdrawal symptoms.  Today I dropped into a terminal and tried to wget a file, only to realize that Windows Vista doesn't have such nice things as wget.  Then I curled up into a fetal position under my desk and shook uncontrollably for a half hour.&lt;/p&gt;</description></item><item><title>C#... kind of doesn't suck?</title><link>http://briancarper.net/blog/c-kind-of-doesnt-suck</link><guid>http://briancarper.net/blog/c-kind-of-doesnt-suck</guid><pubDate>Fri, 26 Oct 2007 18:50:05 -0700</pubDate><description>&lt;p&gt;At work recently (as in, yesterday) I was faced with the problem of re-writing a scientific app written in the mid-nineties.  This thing was a full-screen DOS sort of app and today what with laptops and their widescreen huge-resolution displays, the program wasn't readable for the average human being.  All it does is display text in different colors and take keyboard input.&lt;/p&gt;

&lt;p&gt;So I got to pick a language to re-write this app from scratch.  My first thought process was &quot;Ruby!&quot;, but this app is a multi-threaded, GUI app running on Windows laptops that don't have Ruby installed, which is about the worst possible kind of program to try to write in Ruby, aside from maybe device drivers.  &lt;/p&gt;

&lt;p&gt;So I considered Java.  A brief search reveals that even in present-day Java, you still apparently don't have the ability to easily compile Java programs to a native Windows exe.  There are some Java compilers but they seem like hacks and many of them are non-free (as in money).  Then I remembered that I've never seen an easy-to-use wysiwyg tool for building Java GUI apps.  A google search turned up nothing, and the last version of Eclipse I used didn't let me do it either. &lt;/p&gt;

&lt;p&gt;So then I decided oh well, I may as well bite the bullet and try C#.  I've never used it before.  There's a free version of Visual Studio called Visual Studio Express that you can download.  (Note: I remember always wanting such a thing about 10 years ago in high school when I was just learning programming for the first time.  Maybe if such a thing had been available for free back then, I would have been indoctrinated into the church of Microcrap early on rather than wandering in Linux.  Their loss.)&lt;/p&gt;

&lt;p&gt;I don't know what's missing in the free version of Visual Studio compared to the thousand dollar shyster version.  The free version has a draggety-drop GUI builder, and it has the standard IDE with the auto-completion etc.  It's no Vim, but it's better than anything I've ever tried to use to write Java, certainly.  It's also better than writing Java in Vim, because writing Java in anything is pure unadulterated pain.&lt;/p&gt;

&lt;p&gt;So far as the language itself, C# is noticeably more pleasant to deal with than Java, while at the same time being a blatant ripoff of it in almost every way.  But some of the stupid Java annoyances are gone.  For example C# doesn't make you catch every single exception that every single bit of code ever throws, which is a blessing.  And it doesn't seem to try to force you to keep your files in certain kinds of directory trees.  On the other hand, there are of course incredibly stupid limitations to C# for no reason I can tell.  e.g. it &lt;a href=&quot;http://blogs.msdn.com/csharpfaq/archive/2004/03/07/85556.aspx&quot;&gt;doesn't support default parameters&lt;/a&gt; and &lt;a href=&quot;http://blogs.msdn.com/csharpfaq/archive/2004/12/03/274417.aspx&quot;&gt;doesn't allow constant arrays&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;In any case, having never even seen a line of C# as of yesterday, I was able to almost finish my app in about 2 days with relatively little pain.  And it's a native Windows app that can easily be deployed.  If I ever find myself forced to write a Windows GUI app again (God help me) I'll probably start off with some form of .NET.  If good GUI-builder tools or native-exe-producing compilers exist for Java, they need to be better advertised or something.&lt;/p&gt;

&lt;p&gt;So given that it's Windows programming, i.e. automatically worse than almost everything else in existence, C# isn't bad, relatively speaking.  I'd still rather be writing Ruby.&lt;/p&gt;</description></item><item><title>Vista sucks</title><link>http://briancarper.net/blog/vista-sucks</link><guid>http://briancarper.net/blog/vista-sucks</guid><pubDate>Sat, 13 Oct 2007 19:52:47 -0700</pubDate><description>&lt;p&gt;After moving recently 2,500 miles across the country, my Gentoo machine is on the east coast while I'm on the west coast.  All I have with me is my laptop, which to my everlasting regret runs Vista.  &lt;/p&gt;

&lt;p&gt;Having been forced to use Vista exclusively for a week now, I find myself more and more wanting my precious Linux back.  It's the little things, like wanting to fall to a command prompt to do something quickly but not being able to.  I have cygwin on here, but it's not the same.  And I want to play some MKV files, which either mplayer or VLC plays fine in Linux (I forget which) but which sucks in Windows, even VLC in Windows.  The subtitles are screwed up no matter what I try.  I found a player that works finally, but it's non-free (as in beer, speech, freedom, and everything else).  I want to at least re-arrange the order of running programs in the task bar, if not have multiple desktops, but nope, the task bar is still as pathetic as Windows 95.  &lt;/p&gt;

&lt;p&gt;Today I wanted to fire up the Windows Photo Gallery program, so I opened the start menu, clicked in the search box, and typed &quot;photo gallery&quot;.  My single result was an entry labeled only &quot;setup.ini&quot;.  Note, Photo Gallery IS installed on my computer.  Although to be honest, I had removed the Windows Photo Gallery from the TOP-LEVEL of my start menu, where MS and many other programs had spewed far too many icons that I have to continually scroll past.  And when I put the icon back into my start menu (top-level), then a search for &quot;photo gallery&quot; gives me the launcher icon for the program as well as my good old random &quot;setup.ini&quot;.  But you'd think the search thing would index program names anyways, wouldn't you? &lt;/p&gt;

&lt;p&gt;Many of my games aren't compatible with Vista, like ZSNES for example.  Maple Story barely runs.  &quot;XP compatible mode&quot; proves to be entirely useless, as I expected.  Personally, I'm convinced &quot;XP compatible mode&quot; does absolutely nothing.  Other programs, for no reason I can determine, cause Windows to bail out of Aero and drop back to some dumbed-down interface.  Then when you close the program, Windows bumps back to Aero again.  These aren't games or anything fancy; SPSS for example, a statistics program, causes this to happen.  This is a feature of Vista, but one I can't explain.&lt;/p&gt;

&lt;p&gt;I managed to go a week without disabling UAC, but I just broke down and killed it.  A more stupid idea, I have never seen.  When you show a user a box which says &quot;Is this safe?&quot; 1,000 times, and 999 of those times is for a safe operation, and 1 of those times is something manevolent, there's no chance in Hades that the user is going to get it right.  Vista also retains the continual nagging about not running a firewall or anti-virus program that XP brought into the world.  &lt;/p&gt;

&lt;p&gt;Vista blue-screened on me yesterday too, which is great.  Good old IRQ_NOT_LESS_OR_EQUAL.  I also love how my laptop loses my internet connection every time I put it to sleep (it always has a 30-second lag when I turn it back on where it THINKS it still has a connection, but then fails, just to make things extra special annoying).  I very much love how the computer won't go to sleep at all or activate my screensaver if I have my USB mouse plugged in.  And I love how unbelievably laggy simple file copy/move/delete operations are, for no reason I can determine.  (Note: by &quot;love&quot;, I mean &quot;hate&quot;.)&lt;/p&gt;

&lt;p&gt;Windows Vista: &lt;a href=&quot;http://www.google.com/search?q=windows+vista+polished+turd&quot;&gt;A polished turd.&lt;/a&gt;&lt;/p&gt;</description></item><item><title>New laptop</title><link>http://briancarper.net/blog/new-laptop</link><guid>http://briancarper.net/blog/new-laptop</guid><pubDate>Thu, 13 Sep 2007 16:01:13 -0700</pubDate><description>&lt;p&gt;I got a laptop the other day.  I looked around a lot and decided just to get a Dell in the end, because I didn't know where else to turn.  You can't really build your own laptop, sadly, so you have to go with someone.  I have a lot of anecdotal evidence suggesting that Dell sucks, and a lot of anecdotal evidence suggesting they don't.  I didn't have a real preference to I went with Dell because the price was OK.  Dell also got this thing to me two days early, so maybe their service isn't universally as bad as I often hear.  The fact that they support Linux to some degree also gives me a tiny nudge to support the company.&lt;/p&gt;

&lt;p&gt;I got a Vostro 1500, Core 2 Duo with 2GB of RAM and a 120GB HD.  The nice thing is the screen, which is 15.4 inches but still somehow 1680x1050.  It's so tiny I can barely read any of the text it displays, which is great.  It's extremely bright as well, though it does have some light leaking in at the bottom and at one point on the right.  But it's very nice.  Sadly, to my eternal grief, I had to get Vista Business edition and not Linux because I need some things in Vista for work, and this laptop is primarily for work.  So this is the first time I've had to use Vista.  It's not as bad as I thought it would be.  It does look better than XP, for some value of &quot;better&quot;.  Things like control panel settings are all moved around and hidden in stupid places for no reason.  The performance is fairly sluggish, and some of the fancy window effects stutter a bit in spite of what I thought should've been a fairly decent nvidia card, but such is life.  The hard drive is only 5400 RPM but the machine still performs pretty well so far other than that.  I also hit a bug where it wouldn't let me delete some crap out of the start menu in spite of being an admin, which is so incredibly frustrating I want to punch someone in the face.  But only for a minute or two.&lt;/p&gt;

&lt;p&gt;The Vostro is a &quot;small business&quot; laptop as opposed to a &quot;home and home office&quot; laptop.  Small business is the way to go when you're getting a Dell, it seems.  For one thing, it comes with no crap-ware installed.  I even got to opt out of the free trial of Norton Anti-Virus, which I most definitely didn't want anywhere near me.  There were no stupid AOL free trials or MSN subscription links or anything.  You could even opt out of many of the Dell built-in software.  Some Dell stuff did end up getting installed without asking me about it, like some webcam program and some multimedia mode.  But by and large compared to most commercial computers, I actually didn't have to spend 2 hours uninstalling crap when I first turned the machine on.  (On the subject of that media program, it apparently takes up its own partition on your HD, and runs some form of Linux, so that you can use the laptop as a media player without booting Windows.  Not sure how that works and I may remove it.)&lt;/p&gt;

&lt;p&gt;The look of the laptop is also nice.  It's matte black with silver trim and blue LEDs, and it's very minimalistic, as you may expect from a &quot;business&quot; computer.  It does have multimedia buttons, but they're not located with the keyboard, they're on the front-facing edge, which is nice so that I can ignore them.  Beyond that there are very few frills, which I like. &lt;/p&gt;

&lt;p&gt;One downside of this thing is the weight; it weighs an absolute ton.  Probably 2-3 times as much as my sister's year-old Gateway.  But I'm not so feeble that I care.  I'm also worried about the battery life, but I got the upgraded 85 WHr battery and the gauge says it lasts 6 hours, so we'll see.  It only has four USB ports, but maybe that's standard for laptops?  This is my first, so I don't know.  &lt;/p&gt;

&lt;p&gt;In any case, so far so good, but the real test will be how long this thing lasts and how much I like it a few months from now.&lt;/p&gt;</description></item><item><title>OpenVPN in Gentoo in 15 minutes</title><link>http://briancarper.net/blog/openvpn-in-15-minutes</link><guid>http://briancarper.net/blog/openvpn-in-15-minutes</guid><pubDate>Sat, 08 Sep 2007 08:58:12 -0700</pubDate><description>&lt;p&gt;Situation: You have two computers at different locations.  One of them is behind a very restrictive firewall that doesn't permit any incoming connections, and may be running Windows (ugh).  The other is running Gentoo and is more permissive.&lt;/p&gt;

&lt;p&gt;Problem: You want to play a game on these two computers, like ZSNES, which requires both machines to accept a connection on some port.   ZSNES ideally uses UDP protocol for this.  Or, you want to play some game that requires connections on multiple ports.  For these or some other reason, an SSH tunnel isn't practical.  So you must defeat the firewall.&lt;/p&gt;

&lt;p&gt;Concerns:  There are only two computers involved and no chance of more than two ever being involved.  You don't care about encryption; if someone wants to snoop your Final Fantasy 6 traffic, so be it.  You want to get something up and running in 15 minutes.  You want something that is fast and easy to use from that point forward.  You need something that works in Windows.&lt;/p&gt;

&lt;p&gt;Solution:  OpenVPN works really well for this.  If you don't care about encryption and such, &lt;a href=&quot;http://openvpn.net/static.html&quot;&gt;this &quot;static&quot; HOWTO&lt;/a&gt; is very effective at getting something working quickly.  Gentoo can also help a lot in this regard, via some nice &lt;a href=&quot;http://gentoo-wiki.com/HOWTO_OpenVPN_primer&quot;&gt;wiki entries on Gentoo-Wiki&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Anyways, this is how I did it:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Make sure &lt;code&gt;Universal TUN/TAP device driver support&lt;/code&gt; is enabled in your kernel for any Linux machines involved. (If you don't already have this included in your kernel, I guess there goes your 15 minutes right there. Oops!)&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Have the client install OpenVPN on their computer. (For Windows, download &lt;a href=&quot;http://openvpn.net/download.html&quot;&gt;here&lt;/a&gt;.)&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;On the server machine, run:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;emerge openvpn
cd /etc/openvpn
openvpn --genkey --secret static.key
&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Edit &lt;code&gt;/etc/openvpn/openvpn.conf&lt;/code&gt; and put this in it:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;dev tun
ifconfig 10.8.0.1 10.8.0.2
secret static.key
&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Edit &lt;code&gt;client.ovpn&lt;/code&gt; and put this in it (filling in your proper server IP address or domain):&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;remote SERVER.IP.ADDRESS
dev tun
ifconfig 10.8.0.2 10.8.0.1
secret static.key
&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Send &lt;code&gt;client.ovpn&lt;/code&gt; and &lt;code&gt;static.key&lt;/code&gt; to the client by whatever means necessary. You should also keep a copy of &lt;code&gt;static.key&lt;/code&gt; in /etc/openvpn on the server. You can get rid of client.ovpn on the server machine.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Start up the server:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;/etc/init.d/openvpn start
&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;That's it, you should now be able to fire up any program and point to 10.8.0.2 to access the client from the server, or 10.8.0.1 to access the server from the client, any port, TCP or UDP protocol.&lt;/p&gt;

&lt;p&gt;If you really care about encryption or security, there are much better ways of doing this using real public/private key sharing.  It may be worth taking the extra half hour or so to set up OpenVPN the right way depending on your needs.&lt;/p&gt;</description></item><item><title>GIMP... sucks?</title><link>http://briancarper.net/blog/gimp-sucks</link><guid>http://briancarper.net/blog/gimp-sucks</guid><pubDate>Wed, 05 Sep 2007 20:21:49 -0700</pubDate><description>&lt;p&gt;I was going to call this post &quot;GIMP sucks!&quot; without a moment's thought, but GIMP doesn't suck.  I'm quick to say &quot;XYZ sucks&quot; but I always mean &quot;XYZ sucks for my needs at the moment&quot; or &quot;XYZ sucks compared to ABC&quot;.  Of the many things I've said suck, most of them are fine tools.  But hyperbole is my favorite pastime, and it helps get the point across.&lt;/p&gt;

&lt;p&gt;In any case, I decided to draw a picture yesterday.  I dusted off my old Wacom tablet and thought, why not use the GIMP?  Gentoo-wiki has good instructions on getting a Wacom tablet working in X windows.  A few kernel modules compiled, a few edits to xorg.conf, a tweak or two to some udev rules, a quick X restart and it was all set.   (It's not &lt;em&gt;quite&lt;/em&gt; as simple as that, of course, but what is?)&lt;/p&gt;

&lt;p&gt;Next step, get my tablet working in the GIMP.  I have the very latest version of the GIMP installed at the moment, 2.4.0-rc1 release candidate.  GIMP recognized my tablet just fine.  There are some options via &lt;code&gt;Preferences -&amp;gt; Input Devices&lt;/code&gt; that you can set to tweak how the tablet works. You can also install &lt;code&gt;wacomcpl&lt;/code&gt; via &lt;code&gt;emerge linuxwacom&lt;/code&gt; and it gives you further options to change sensitivity and tracking speed etc.&lt;/p&gt;

&lt;p&gt;So off I went.  I put in a good hour or so trying to draw a very simple picture for practice.  Result: utter failure.&lt;/p&gt;

&lt;p&gt;The next thing I tried was hooking up my old Windows machine that's been sitting in the corner (my cat had been using it as a perch / bed) and trying Photoshop.  Result: relative success.&lt;/p&gt;

&lt;p&gt;What went wrong?  Well, my first problem was brushes.  The Gimp has an extremely limited selection of brushes.  10 solid circles, 10 faded circles, that's about it.  Photoshop has a berjillion brushes by default, and it's really easy to make your own on the fly.  GIMP has a brush editor, but it's clunky and unfun.&lt;/p&gt;

&lt;p&gt;Beyond that, there's just something not right about my Wacom tablet in X windows.  I don't know what, but no matter what I tried, the thing was all jittery.  I thought it was just me, maybe my hand isn't steady enough.  But in Windows / Photoshop, I had no problems whatsoever.  No matter how I played with settings in Linux I couldn't get the thing set up where I could draw a simple straight line.? I turned the speed way up and/or way down, played with sensitivity, changed the tablet from working full-screen to per-window, all kinds of things.? Nothing I did made it any easier to draw a simple straight line.&lt;/p&gt;

&lt;p&gt;Another fun experience I had was that pressure sensitivity would randomly stop working in the GIMP, forcing me to restart it and then pressure sensitivity would return.  This may be because I'm using an RC version of the GIMP, but who knows.  It kind of kills the mood when you're trying to produce artwork.&lt;/p&gt;

&lt;p&gt;Beta-quality GIMP doesn't explain &lt;em&gt;this&lt;/em&gt; bug though: after using my Wacom tablet for extended periods of time, Firefox would stop responding to keyboard input until I restarted Firefox.  This may be coincidental and I'm not 100% sure it's because of my tablet, but I never had a problem like that before, and I haven't had one since I unplugged the tablet.&lt;/p&gt;

&lt;p&gt;If you do a search for &quot;GIMP vs. Photoshop&quot; you'll come back with a million Photoshop-people saying GIMP sucks, and then a million GIMP-people saying it's just as good as Photoshop but all the Photoshop junkies are too used to what they already know and unwilling to change.  I'm from the exact opposite world.  I use the GIMP all the time for basic photo manipulation and I actually like the interface.  I don't know Photoshop at all beyond very simple operations.   I really wanted to use the GIMP in Linux; I hate using Windows for anything.  But in the end I went with Photoshop.&lt;/p&gt;

&lt;p&gt;Does this mean anything?  No, my experience is an anecdote.  But this experience makes me sad nonetheless.  Looking on the bright side, 2 years ago I tried to get my Wacom tablet working and only succeeded in crashing my X server.  So we're getting somewhere (or I'm becoming ever so slightly less incompetent).  But I think we're still not quite there.&lt;/p&gt;</description></item><item><title>Bazaar</title><link>http://briancarper.net/blog/bazaar</link><guid>http://briancarper.net/blog/bazaar</guid><pubDate>Mon, 25 Jun 2007 12:24:12 -0700</pubDate><description>&lt;p&gt;I started using &lt;a href=&quot;http://bazaar-vcs.org/&quot;&gt;Bazaar&lt;/a&gt; at work recently for source control.  Before that, I was using company-mandated &lt;a href=&quot;http://msdn2.microsoft.com/en-us/vstudio/aa700900.aspx&quot;&gt;Visual Source Safe&lt;/a&gt;.  By &quot;using&quot; I mean &quot;not using&quot;, in that not using a source control system of any sort is preferable to using VSS.  A more broken program than VSS, I have never seen.&lt;/p&gt;

&lt;p&gt;Bazaar has the benefit of not having to run any kind of server or have any central repository at all, which fits well at work because I have no machine I could use for a server and no one is going to buy me one.  It also seems to work well in a (sadly) Windows environment.  &lt;/p&gt;

&lt;p&gt;I find that a lot of the commands are more intuitive than something like SVN.  A lot of things reduce to filesystem operations and you don't even need a command.  Want to remove a file from the Bazaar repository?  Just delete it.  Want to rename a file?  Just rename it.  Bazaar figures it all out.  &lt;/p&gt;

&lt;p&gt;Local commits are another outstanding feature.  Something sorely missed when I've used subversion.  Bazaar encourages branching and merging, which fits really well with the workflow here at work.  &lt;/p&gt;

&lt;p&gt;One thing that really did confuse me is &lt;code&gt;update&lt;/code&gt; vs. &lt;code&gt;pull&lt;/code&gt; vs. &lt;code&gt;merge&lt;/code&gt;.  Thankfully it's covered in the &lt;a href=&quot;http://bazaar-vcs.org/FAQ#head-73f0b8ea8515a0087ce8705fbaafc55c80a0a30e&quot;&gt;FAQ&lt;/a&gt; but it's still sometimes not clear when one should be used over another, other than that &lt;code&gt;update&lt;/code&gt; should generally be avoided for my purposes.&lt;/p&gt;</description></item><item><title>Spare partition</title><link>http://briancarper.net/blog/spare-partition</link><guid>http://briancarper.net/blog/spare-partition</guid><pubDate>Tue, 27 Feb 2007 21:46:32 -0800</pubDate><description>&lt;p&gt;So after Windows having collapsed into a heap of flaming ruin, leading me to delete it in disgust and vow never to let it defile my hard drive again, I realized I have a spare 34GB partition on my drive just sitting there.  I'm not even sure what to do with it.  &lt;/p&gt;

&lt;p&gt;It occurs to me that I could put Gentoo or some other distro on there and either dual-boot or maybe chroot in and play with it or who knows.  I think perhaps if/when pkgcore ever matures I might give that a try.  Or say KDE4 is released and Gentoo jumps right on putting it in Portage while other distros lag behind, that might induce me.&lt;/p&gt;

&lt;p&gt;I have to say I'm largely only considering playing with Gentoo again due to emotional, irrational attachment and fondness for the distro based on past experience, and there's not really any rational reason I can think of to do it.  I should also say that all the mess that I see on Planet Larry and elsewhere regarding devs quitting and problems with dev flame-wars is a good counter-balance to the above, because that kind of thing really makes me not want to touch Gentoo after all; that's an emotional and irrational response as well, but it balances out the above, and rationality wins the day, and I'll probably stay away from Gentoo for a while longer.  But you never know.  &lt;/p&gt;

&lt;p&gt;Sadly no other distro really appeals to me at the moment.  But another option is to put a bleeding-edge Ubuntu on there to play with before I switch my main partition over to the newest version.  This strikes me as largely a waste of time because I'm going to upgrade my main partition eventually anyways.  Probably always within a few days after it's released, because I'm obsessive about having the latest versions of things I can, for better or worse.&lt;/p&gt;

&lt;p&gt;Most likely I'll turn it into a miscellaneous file storage partition.  But that's awfully boring.&lt;/p&gt;</description></item><item><title>...</title><link>http://briancarper.net/blog/dot-dot-dot</link><guid>http://briancarper.net/blog/dot-dot-dot</guid><pubDate>Tue, 06 Feb 2007 14:34:06 -0800</pubDate><description>&lt;p&gt;I've previously &lt;a href=&quot;/2007/02/02/windows-fun/&quot;&gt;whined incessantly&lt;/a&gt; about how Windows could not recognize my USB keyboard.   Well, I tried to fix it today and Windows fried my system entirely.&lt;/p&gt;

&lt;p&gt;Essentially I was sick enough of how broken XP was that I decided to put it to death and reinstall it from scratch.  So I backed everything up that I cared about from Windows (i.e. very little) to a folder in Linux and then I &lt;code&gt;mkfs.vfat&lt;/code&gt; the partition, cackling with glee all the while.  Then I needed only to reboot from the XP install CD and install XP on the nice, shiny, pre-formatted, blank partition that is just waiting to be defiled with its presence.  How simple!  For those of you who have tried this before, you may be experiencing some &quot;dramatic irony&quot; at this point, because you know of the disaster soon to come.&lt;/p&gt;

&lt;p&gt;After booting from the XP install CD and being witness to the 1980's blue DOS install screen, and pounding F8 to indicate that I indeed sacrifice my immortal soul via the EULA, I got to a screen where Windows offered a choice of partitions to install to.  However the 35GB FAT32 partition I had created was nowhere to be found.  What WAS to be found was a 131GB &quot;Unknown&quot; partition.  This is very curious, because I don't HAVE a 131GB partition on my system at all.  I have a 35GB FAT32, a 200GB ext3, a 45GB et3 for root and a tiny boot and swap partition.  The drive itself is 300GB total.  Where this 131GB value came from, I will never know.&lt;/p&gt;

&lt;p&gt;I rebooted about 18 times, consulting Google in Linux and then trying the XP install CD again, and again, and again, to no avail.  The very last time, I thought hey, let me just select this &quot;Unknown&quot; partition and see what it says.  So I hit Enter.  XP at this point asked if I'd like to format the partition to NTFS the quick way, or the slow way.  I said &quot;No thank you&quot; and exited the installer.  &lt;/p&gt;

&lt;p&gt;Lo and behold, my system was no longer bootable.  Why?  I started rebooting from my large, out-of-date collection of liveCDs until I found one that worked.  &lt;code&gt;fdisk /dev/sda&lt;/code&gt; showed that I now had a 131GB unformatted partition and nothing else.  Bye bye Linux!   Apparently as soon as you hit Enter on the install CD as above, Windows automatically overwrites your partition table without asking.   &lt;/p&gt;

&lt;p&gt;At this point let us say I &quot;lost my cool&quot;.  There was an incident involving a broom being wielded in blind rage at all inanimate objects that dared to cross my path.  My cat wisely fled my wrath.  &lt;/p&gt;

&lt;p&gt;I do have backups of everything of real importance.  But I'd downloaded a LOT of stuff in the past two weeks that would be lost.  And I have a bunch of stuff that while not life-threatening to lose, would take an awful lot of time and effort to get back.&lt;/p&gt;

&lt;p&gt;But all that was destroyed was my partition table, I eventually reasoned.  After googling for &quot;restore partition table&quot; I found that &lt;a href=&quot;http://www.stud.uni-hannover.de/user/76201/gpart/&quot;&gt;gpart&lt;/a&gt; should in theory be able to save me.  But how to actually run it on my system which could not boot?  The website recommends using a floppy (I have no floppy drive) or putting the crippled HD into another computer.  My spare computer however cannot use SATA hard drives.&lt;/p&gt;

&lt;p&gt;So I did what any reasonable person would do at this point:  I went to my spare computer and tore out its hard drive (containing Debian) and stuffed it into my now-defunct computer and booted from it.  Oh how badly this choked.  After stalling for 5 minutes complaining of interrupts timing-out, I got a kernel panic, something to the effect of &quot;Kernel tried to kill INIT!&quot;  &lt;/p&gt;

&lt;p&gt;I realized at this point that I did not even HAVE a Ubuntu liveCD to reinstall from even if I wanted to.  As a last resort I booted from my GENTOO install CD (2006.0).  I prayed that it would contain gpart.  It did not.  I felt the last of my will to live slowly drain away.  But lo!  It turns out there's a statically linked binary of gpart on the gpart website.  I downloaded it and against all odds, it actually worked.  &lt;/p&gt;

&lt;p&gt;My tale does not end here.  Upon rebooting, I got a &quot;NO OPERATING SYSTEM FOUND ON DISK&quot; from my BIOS.  Whoops!  Looks like the XP installer ate grub for breakfast too!  Again, how to restore grub given that I have no Ubuntu liveCD?  Well, Gentoo to the rescue again.  Sadly, the Gentoo CD does not contain grub.  But after a few minutes of ape-like head-scratching I realized that I only had to chroot into my Ubuntu install and do it that way.  I actually consulted the Gentoo install manual to remember the syntax of mounting /proc and /dev correctly.  A short &lt;strong&gt;grub-install&lt;/strong&gt; later and, as angels sang and trumpets sounded, I'm back in Ubuntu.  &lt;/p&gt;

&lt;p&gt;The morals of this sad tale:&lt;/p&gt;

&lt;ul&gt;&lt;li&gt;Windows is a piece of &lt;strong style=&quot;text-decoration: line-through&quot;&gt;long string of expletives deleted&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;Never ever try to install Windows AFTER you install Linux.  Down this path lies MADNESS.&lt;/li&gt;
&lt;li&gt;If I hadn't had the experience of setting up my system the Gentoo way I'd have been utterly screwed.&lt;/li&gt;
&lt;li&gt;Keep up-to-date LiveCDs at all times.&lt;/li&gt;
&lt;li&gt;Make HD backups MORE OFTEN.&lt;/li&gt;
&lt;/ul&gt;</description></item><item><title>Windows fun</title><link>http://briancarper.net/blog/windows-fun</link><guid>http://briancarper.net/blog/windows-fun</guid><pubDate>Fri, 02 Feb 2007 23:23:10 -0800</pubDate><description>&lt;p&gt;My USB keyboard randomly stopped working in Windows XP.  Really randomly.  I don't remember changing anything in the past week; I only boot to Windows to play a game and then immediately reboot to Linux, so I don't even use Windows for anything.  But when I boot to Windows my USB keyboard lights up the NumLock light and then freezes.  No keys work.  Plugging in a PS/2 keyboard works.  The USB keyboard works fine in Linux and in the grub boot menu.  But not in Windows.  Unplugging and replugging the USB keyboard doesn't work.  Booting without the USB keyboard plugged in and then plugging it in doesn't work.&lt;/p&gt;

&lt;p&gt;So, it's an easy fix.  I just went to a command prompt in Windows and typed &lt;code&gt;dmesg | grep -i usb&lt;/code&gt; to see how the kernel was loading the USB drivers.  Oh wait, WRONG!  I'm forgetting that Windows is a crippled heap of garbage.  What I DO get in Windows is, after right-clicking My Computer, selecting Properties, and finding the Device Manager, are about 8 lines saying &quot;Human Interface Device&quot; with a little yellow circle containing a white question mark.  When you really think about it, that's MORE useful than a printout of kernel messages.&lt;/p&gt;

&lt;p&gt;I &quot;fixed&quot; this by using Windows' &quot;Restore Point&quot; crap.  I restored back a week randomly and then a magic little progress bar magically filled up and Windows rebooted and magically my keyboard still didn't work, but somehow randomly after 3 minutes it detected it as a new device and then it started working.  My pounding the keyboard in frustration like an enraged gorilla may have done something to scare Windows into working, is my theory.  Next time I boot I'll give it 90% odds that it does not find my keyboard.&lt;/p&gt;

&lt;p&gt;Ever notice how googling for solutions to Windows problems returns about a billion results, none of which are helpful?  It's simply not possible to sort through the amount of people who have problems which are NEVER FIXED.  Or rather they are fixed in one &quot;easy&quot; step: Reinstall Windows.   If anyone asks me for any advice on fixing Windows problems, unless it's something extremely obvious, that is my answer: Reinstall Windows.   It's (usually) guaranteed to work, it takes a half hour, and odds are very much against you that you will end up doing anything other than that anyways.  May as well get it over with early.&lt;/p&gt;</description></item><item><title>Unique-ify lines in Vim</title><link>http://briancarper.net/blog/unique-ify-lines-in-vim</link><guid>http://briancarper.net/blog/unique-ify-lines-in-vim</guid><pubDate>Thu, 11 Jan 2007 13:15:07 -0800</pubDate><description>&lt;p&gt;If I want to get rid of duplicate lines in a text file, in Linux I can simply pipe it through &lt;code&gt;uniq&lt;/code&gt;.  Windows doesn't have an equivalent (or else I don't know about it).  There may be a Vim equivalent also, but I don't know it if there is.  Instead you can use &lt;code&gt;perldo&lt;/code&gt; to do it like this:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;:perldo BEGIN{%x={}} $_ = ' ' if $x{$_}++
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;The neat thing about &lt;code&gt;perldo&lt;/code&gt; (and &lt;code&gt;rubydo&lt;/code&gt;) is that whatever you do is persistent across runs of &lt;code&gt;perldo&lt;/code&gt;.  That means if you run this:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;:perldo $_ = ' ' if $x{$_}++
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;it'll work the first time you run it, but the second time, &lt;code&gt;$x&lt;/code&gt; will have retained its values from the first run, and it will instead delete every line.  There are few limits to what you can do with a one-liner &lt;code&gt;perldo&lt;/code&gt; command in Vim.  It's great, if you know Perl better than you know Vim.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;EDIT TWO YEARS LATER&lt;/strong&gt;: How about &lt;code&gt;:sort u&lt;/code&gt;.&lt;/p&gt;</description></item><item><title>SSH continued</title><link>http://briancarper.net/blog/ssh-continued</link><guid>http://briancarper.net/blog/ssh-continued</guid><pubDate>Thu, 12 Oct 2006 10:14:20 -0700</pubDate><description>&lt;p&gt;Password login on my SSH server is now disabled and the only way someone's getting in is if they steal my MP3 player and gank my private key.  Thanks to all who posted comments in my last entry.  I also found &lt;a href=&quot;http://www.gentoo.org/doc/en/security/security-handbook.xml?part=1&amp;amp;chap=10#doc_chap11&quot;&gt;these Gentoo docs&lt;/a&gt; helpful, as well as &lt;a href=&quot;http://www.unixwiz.net/techtips/putty-openssh.html&quot;&gt;this very nice tutorial&lt;/a&gt; on getting PuTTY to work with key files.&lt;/p&gt;</description></item><item><title>Installing FreeBSD</title><link>http://briancarper.net/blog/installing-freebsd</link><guid>http://briancarper.net/blog/installing-freebsd</guid><pubDate>Fri, 22 Sep 2006 23:40:17 -0700</pubDate><description>&lt;p&gt;I have an extra computer here, so I decided to install FreeBSD today.  I've never used FreeBSD before.  Never touched it.  So to make this fun, I decided to try the install without reading any directions.  What better way to tesout t an installer?  It's also arguably a stupid way to install an OS, but stupid is fun sometimes.&lt;/p&gt;

&lt;!--more--&gt;

&lt;p&gt;So first I went to the &lt;a href=&quot;http://www.freebsd.org/&quot;&gt;FreeBSD website&lt;/a&gt; (which looks pretty spiffy, by the way) and went to &quot;Get FreeBSD&quot;.  At this point I admit I did glance around a bit to make sure I wasn't going to download a gigabyte of ISOs that I wouldn't be able to use.  But it's pretty straightforward, so I got the latest version ISOs (2 of them) for i386.  (I did also look for mirrors or a torrent download (just to be polite), but I couldn't find a link for those.)&lt;/p&gt;

&lt;p&gt;A couple hours and two burned CDs later, I was ready to go.  I booted from the CD and I was presented with something looking vaguely like Grub, but with way more options (Boot with APM?  Boot into single-user mode?)  Faced with a 10-second countdown which I apparently could not stop, I picked the default.&lt;/p&gt;

&lt;p&gt;I was then presented with a nice ncurses menu.  Again there were lots of options.  The second was &quot;Standard install&quot; or something similar.  There was also &quot;Expert install&quot; but given that I have no idea what I'm doing and that I'm not reading any directions, I went with standard.&lt;/p&gt;

&lt;p&gt;There were a bunch more screens of text which I read through quickly.  Then I got to disk partitioning, which is what I was expecting.  So far so good.  The disk partitioning system was different from fdisk; it was ncurses based.  There was a nice key of commands at the bottom indicating which key to press for which function.  Included was an option A which would auto-partition everything.  I found this system extremely easy to use.&lt;/p&gt;

&lt;p&gt;Partitions were called &quot;Slices&quot; for some reason beyond me.  But making a new slice gave me options similar to fdisk.  For example I could list a size in cylinders or in megabytes.  And I had to give a number for the partition type.  Here I met my first bit of confusion.  It only listed 3 partition types in the on-screen text: DOS, Linux, or FreeBSD.  Now, knowing that Linux can read MANY kinds of &quot;DOS&quot; partitions, from FAT16 to FAT32 to who knows what else, I was a bit stumped here.  Would DOS work OK to install Windows XP someday?&lt;/p&gt;

&lt;p&gt;Faced with this, I decided to install a very small Windows XP install first, then come back to FreeBSD later.  So I started pounding Escape like a monkey until the installer exited.&lt;/p&gt;

&lt;p&gt;Fast forward a half hour.  Windows is installed.  (I had the pleasure of waiting for that stupid blue circle thing to start babbling about giving me a tour, and then hard-cutting the power to my computer.  All I wanted is a partition.  I honestly hope I broke something.)  &lt;/p&gt;

&lt;p&gt;Back to the FreeBSD installer, back to partitioning.  It now recognized the Windows partition I made; it called it a &quot;DOS&quot; partition, so I may have been OK making a &quot;DOS&quot; partition in the FreeBSD installer to begin with.  Who knows.&lt;/p&gt;

&lt;p&gt;The installer then asked me to install &quot;FreeBSD partitions&quot;.  I suppose these differ from &quot;slices&quot; in some way.   Perhaps &quot;FreeBSD partitions&quot; are some kind of pseudo-partitions?  I picked &quot;A&quot; which auto-allocated a bunch of mount points and partitons etc.  Couldn't be easier.&lt;/p&gt;

&lt;p&gt;FreeBSD offered to install a boot loader.  There were three options.  One was if I want to install a boot loader to the MBR so I could boot Windows.  A second option said I should pick it if I only plan to use FreeBSD.  A third option would install nothing.  I picked the first option, but I found it strange that there was any difference between the first and second options.  (I found out why this was so later.)&lt;/p&gt;

&lt;p&gt;There were options somewhere along here to pick a type of software I wanted to install.  Developer?  Developer with X-windows?  User?  User with X-windows?  I liked how it gave me the option of not installing X, because I don't want X.  I liked the additional groups beyond &quot;User&quot; and &quot;Developer&quot;.  It also gave me the option to install individual packages if I wanted, which was also nice.&lt;/p&gt;

&lt;p&gt;At this point files started copying from the CD.  It probably took 10 minutes or less.  Remembering how horribly long a Gentoo install is in comparison, I was quite pleased.&lt;/p&gt;

&lt;p&gt;I did hit a snag at the network configuration menu.  The installer did auto-recognize both of my network cards, which is pretty impressive, given that I sometimes have problems with that even in Linux.  The installer then asked &quot;Do you want to use IPV6&quot; to which I said no.  And then it said &quot;Do you want to use DHCP&quot; to which I said yes.  After saying yes I realized I didn't want to use DHCP after all.  I was taken to a screen where I could change the hostname/domainname etc., so I cancelled on this screen.  However instead of taking me back to the network configuration menu, it went right on to the next step, something not related to networking at all.  This was no fun.  However I was later able to come back to the network screen after all the rest of the install questions were done.  So no big deal.  It also brought my network interface online right then and there, which was also very helpful.  I could test whether the network was configured properly without even having to reboot.&lt;/p&gt;

&lt;p&gt;The installer then started asking me a bunch of (I think) quite useful questions.  &quot;Do you want this machine to be an SSH server?&quot;  (The installer also offered to START the SSH server, without interrupting the install.  Very helpful.)  &quot;Do you want to enable anonymous FTP login?&quot;  Etc. etc.  The questions were all in plain English, and quite easy to answer yes/no quickly.  &lt;/p&gt;

&lt;p&gt;The installer did fail miserably when I tried to install exim; it made me swap CDs twice and then claimed it couldn't find the installer.  However that was one of the few snags I ran into.&lt;/p&gt;

&lt;p&gt;Fast forward to the end.  I rebooted from the hard drive and I was faced with a VERY plain prompt, compared to even the barest version of GRUB.  Something like &quot;1 DOS&quot; and &quot;2 FreeBSD&quot;.  I picked DOS, and Windows booted OK.  Nice how that worked without my ever having to touch a configuration file.  I rebooted again into FreeBSD.  After the first boot prompt, I got another which was identical to what I'd seen on the CD.  So apparently FreeBSD has a pseudo boot-loader of some sort.  Very interesting.&lt;/p&gt;

&lt;p&gt;At this point it's up and running, without ever having read any directions.  The whole install took maybe an hour (not counting installing Windows).  I was VERY impressed with how nice and easy the installer was to use.  I think ncurses is the PERFECT balance between a command line and graphical install.  X is just too big and buggy to rely upon for something as important as installing an OS.  But ncurses seems like it works anywhere a console window works (for the most part).  I think the Gentoo GUI installer might've benefitted from taking this route or something similar.&lt;/p&gt;

&lt;p&gt;I'm looking forward to learning ports and seeing how it differs from Portage.  I wonder if I'll need to read the directions for that.&lt;/p&gt;</description></item><item><title>Tunneling is fun</title><link>http://briancarper.net/blog/tunneling-is-fun</link><guid>http://briancarper.net/blog/tunneling-is-fun</guid><pubDate>Mon, 11 Sep 2006 13:08:19 -0700</pubDate><description>&lt;p&gt;My girlfriend is stuck behind a very restrictive firewall at college.  It hides her behind some kind of NAT.  No open ports whatsoever.  In a way I can understand it; when you have thousands of Windows machines running on a high-speed network, you need all the help you can get.  In another way, I just couldn't live with that kind of crippled access.  I know I'm not really a typical user, but I needs me my open ports for SSH and whatnot.&lt;/p&gt;

&lt;p&gt;We wanted to play ZSNES over the internet, which needs a direct connection between two computers.  It took me forever to figure out how to get a reverse SSH tunnel set up, but I finally did.  The terminology is always very confusing.  &quot;Local&quot; vs. &quot;remote&quot;; is that from the point of view of the client, or the server?  &lt;/p&gt;

&lt;p&gt;Just so I have a record of how to do this: &lt;/p&gt;

&lt;pre&gt;&lt;code&gt;ssh -R 12345:localhost:6881 SERVER_NAME
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;-R means SSH will LISTEN for connections on the REMOTE host (&quot;remote&quot; from the point of view of the PERSON RUNNING THE COMMAND, i.e. the client).  (-L is the opposite.)  It will listen for connections on port 12345 on the machine where the server resides; it will forward the data to incoming port 6881 on the machine where the client resides.&lt;/p&gt;

&lt;p&gt;After getting that working, it turns out we needed UDP forwarding too, so I had to look for something else.  I ended up using &lt;a href=&quot;http://openvpn.net/&quot;&gt;OpenVPN&lt;/a&gt;.  That program is pretty amazing.  It only took a short while to install, by following the &lt;a href=&quot;http://openvpn.net/howto.html&quot;&gt;HOWTO&lt;/a&gt;.  Even on Windows (though it has Linux versions too).  I used had to use TAP devices instead of TUN; I have no idea what either of those things is, but TAP seems to create imaginary network devices.  The program uses some nice encryption too.  And using this program, you can do anything you could do with someone who was physically on your LAN.&lt;/p&gt;

&lt;p&gt;Turns out OpenVPN is in portage, too.  I wish I'd have noticed it sooner.&lt;/p&gt;</description></item></channel></rss>

