Just installed an evaluation copy of Windows 7, and lost the key mappings I had setup under XP. I really like my dvorak keyboard, but for my taste, the RControl and RAlt are too far down. I use those keys quite a bit, and my right pinky gets hurt with the default layout. I was very glad to find this remapper that seemed to work with Windows 7!
Wednesday, April 8, 2009
Tuesday, March 24, 2009
Excel madness
Sometimes your data lives inside an excel spreadsheet...
=IF(X2<0,"-","")&FLOOR(ABS(X2)/$'Year Summary'.$H$20,1,1)&"d, "&FLOOR(MOD(ABS(X2),$'Year Summary'.$H$20),1,1)&":"&IF(FLOOR(MOD(ABS(X2),1)*60,1,1)<10,"0"&FLOOR(MOD(ABS(X2),1)*60,1,1),FLOOR(MOD(ABS(X2),1)*60,1,1))
Wednesday, March 18, 2009
Xml cleanup fun (thanks to linq)
Today at work I got to clean up some xml handling code I had written a while back. Here are the versions that came out.
using System.Xml;
// original code fragment
XmlElement el;
el = xdoc.CreateElement("name1", xdoc.DocumentElement.NamespaceURI);
el.InnerText = "some value gathered from environment";
root.AppedChild(el);
el = xdoc.CreateElement("name2", xdoc.DocumentElement.NamespaceURI);
el.InnerText = "some value gathered from environment";
root.AppedChild(el);
// ... and so on
using System.Xml.Linq; // using linq root.Add(new XElement(ns + "name1", "some value from the environment")); root.Add(new XElement(ns + "name1", "some value from the environment")); // ... and so on
using System.Xml.Linq;
// using linq AND getting fancy. Made things much more readable IMHO
Action<string,string> f = (n,v) => root.Add(new XElement(ns + n, v));
f("name1", "some value from the environment");
f("name1", "some value from the environment");
// ... and so on
Beautiful! The list of entries was quite large, so the noise prunnning looked more significant in my code. Things you end up doing after you use Haskell's where.
Thursday, March 12, 2009
My new cmdline friend
While I still profess my love for xargs, I must admit I've been using something else quite a bit lately. In my search for a way to more easily do lambda style operations from the command line, I was directed to while. while has not only allowed me to use the variable I'm iterating over more easier, it has also allowed me to have multi-statement commands in my loops.
Here is a sample of what I'm now able to easily do:
find -maxdepth 1 -type d | while read x; do echo '>>> Doing ' $x; ( cd "$x"; printf "ID: "; hg id; hg purge --all; ); done
Solutions, not features
Just heard this quote in a video, and I could not agree with it more:
Implement solutions, not features.
I've turned into a firm believer that it is not what you choose to implements that sets you apart, but rather what you choose NOT to implement. As a developer, I don't have a hard time coming up with yet more things I could add to something. Yes, I could make that thing do x, y, z, AND even talk to me while it is doing it!
The other urge that as a developer I have to fight against is the adding of candy, which can be considered a feature, for no other reason than adding candy. Oh... can't I use that new water drop effect when opening a window? Come on... that's what would make my solution "cool", right? If a given candy is not making something easier to use, then IMHO, it has the same value as blinking text did not so long ago. It ends up accomplishing one thing: annoy the end user.
Tuesday, February 24, 2009
Sync my music directory with my iPod
I use rockbox on my iPod, and I can never remember the rsync line I need to sync the music folder on my machine with the folder on the player. Here is the line I used last (expanded, so I can tell what the options are):
rsync --recursive --update --whole-file --delete --stats --progress --dry-run ~/audio/ ~/iPod/Music/
Saturday, February 14, 2009
xmonad, compositing, transparancy
I've been happly using xmonad for quite some time now. I love the fact that my window manager is just that, a window manager. At first I didn't even have a background image, since I never really did see my background. I've given in. It started with transparent urxvts which allow me to see my background. I'm discovering that using a tiling window manager does not have to equate with having an ugly work environment.
This story picks up with some of the envy I've been having about some features in compositing WMs. Specifically, global transparency (i.e. any and all windows are semi-transparent, ala uxrvt), and switching workspaces using "the cube". I realize that these are nothing more than eye candy, but life doesn't always just have to be about pragmatism, does it?
The main xmonad page seems to indicate that xmonad supports compositing. I'm not 100% sure I know what they mean by that. From what I seem to find in the intertubes, it means that you can run xcompmgr alongside. I need to jump into #xmonad and ask some questions about it. There seems to be some contrib modules that play in the compositing arena, but haven't found anything that seemed obvious.
I've managed to have some sort of transparency for any of my windows. This has involved installing xcompmgr, and transset. After running 'xcompmgr &', I can use 'transset .9', which gives me a cross-hairs pointer used to select the window I want to target. It's not the greatest thing in the world, as it only does opacity and targets a single window. Haven't found a way to do tinting yet. It's a start, none the less. Now, my urxvt terms are using their native transparency to bleed my background thru, and firefox is using 'transset .9' to let me see the background as well.