I got enough feature requests for grid support (in various layouts) that I
decided it was time to add generic grid support. You can now use grid movement
on grids of any configuration, 2x2, 3x3, 2x3, etc.
Hop on over to the keynav project page and
download the new version.
The changelist from the previous announced release is as follows:
Feature request: Grid support.
* New command: 'grid NxM' N and M are row and columns, respectively.
You can divide the screen into any number of rows and columns.
The default is 2x2.
* New command: 'cell-select N' or 'cell-select NxM'
With this command you can select a specific cell to zoom to.
Usage: cell-select N
Selects the Nth cell, counting from top left to bottom right.
The order of a 3x3 grid would be:
1 2 3
4 5 6
7 8 9
Usage: cell-select NxM
Selects the specific cell at NxM. '2x2' will select row 2 column 2.
Other important changes:
- Whitespace before command names works now.
- Added a pile of new examples in keynavrc.
Comments: 0 (view comments)
Tags: keynav, xlib, release
Permalink: /geekery/keynav-20080509
posted at: 04:52
Hop on over to the keynav project page and
download the new version.
The changelist from the previous announced release is as follows:
Bug fix:
If you tried to override an existing key binding, it would add a 2nd
binding for that key instead of actually overriding it.
Reported by Tim Schumacher.
Comments: 0 (view comments)
Tags: keynav, xlib
Permalink: /geekery/keynav-20080508
posted at: 12:50
I'm quickly learning ruby at my new job. Today's POLA (principle of least
astonishment) violation is blamed on my expectations of 'if' behavior in Ruby
from what I know from Python, C, and other languages.
Non-nil values are considered true:
["0", [], {}, "", 0, true, false, nil].each { |x|
bool = (x) ? true : false
puts "#{x.inspect}: #{bool}"
}
"0": true
[]: true
{}: true
"": true
0: true
true: true
false: false
nil: false
I mostly expected every one of the outputs here except for the literal 0 value
being true. Noted for future reference.
Additionally confusing, is that Integer() will barf on most non-number inputs, but for some reason "nil" means 0.
irb(main):002:0> Integer(nil)
=> 0
Unexpected.
Comments: 1 (view comments)
Tags: ruby, new languages, caveats
Permalink: /geekery/failboat-ruby-1
posted at: 19:00
I bought my first few songs on itunes tonight. Easy process, but it's yet
another apple product I don't fit into :(
For a full album in the store, I pay $8 to $14 for a CD, assuming I buy it brand new from Best Buy or another retailer. On iTunes, I pay $10 on most albums. In a second-hand music store, I'd pay somewhere around $3 to $9 for the same music.
Let's assume (correctly) that I'm not buying a CD for the purposes of ripping it and sharing it on bittorrent.
What am I gaining by using iTunes? Not much. If I ever lose the music I have to
repurchase it (from what I understand), which mirrors exactly the issues of
losing a physical CD. I'm additionally locked in to Apple as a vendor as soon
as I purchase a song. Furthermore, for practically the same exact price, I get
music with less quality and more restrictions. How does this make sense? Given
that "less quality" and "more restrictions" automatically devalue a product
compared to the same product without those problems, why does this business
model succeed?
I'm not an audiophile, so CD vs 128kbit doesn't make me upset, but I do like to
copy my music around. I have basically three places where I listen to music. My
iphone, my house, and my office. All of my music is at my house. Some of my
music is on my iphone, and none of my music is at my office. I can stream
music from my house to my office, but only if it's in a format playable at my
office, which usually means drm-free data so things like mplayer and xmms can
consume it.
Only some songs are available in "iTunes plus" - an option to download
higher-quality and drm-free music, and nothing I've downloaded today is
available that way.
Even if you considered Amazon's MP3 service, it's still a better value to buy
the damn CD and rip it yourself. Ripping a cd is a one-click action these days
on every platform available, so where's the cost justification in these online
services pricing their data at or above what I pay in a store? :(
Comments: 5 (view comments)
Tags: itunes, iphone, apple, music
Permalink: /rants/the-itunes-model
posted at: 01:46
I have a directory called "lib". If I try to do "cd l<tab>", zsh will
offer me "libuuid list lib" as completion candidates. The words 'libuuid' and
'list' show up because they are usernames. This is really annoying, and there
doesn't seem to be an option to disable this. What happend to doing "cd ~root"
to change to root's homedir? Was typing '~' too hard?
At any rate, I figured out where to fix the unfeature: A file '_tilde' in
path/to//zsh/4.3.4/functions/Completion/Zsh. It happens to be
/usr/share/zsh/4.3.4/functions/Completion/Zsh on my ubuntu workstation.
... around line 22 ...
while _tags; do
_requested users && _users "$suf[@]" "$@" && ret=0
_requested named-directories expl 'named directory' \
...
Comment out the bold line above (starting '_requested users ...') and restart
zsh. This only disabled the username completion part of zsh's cd command, but
that's good enough for now. If I ever accidentally typo and cd to someone's
home directory, I can just popd to return to my previous location.
Comments: 2 (view comments)
Tags: zsh, fix, hack
Permalink: /geekery/zsh-disable-cd-username
posted at: 15:21
Hop on over to the keynav project page and
download the new version.
The changelist from the previous announced release is as follows:
20080501:
Patches from Mark (20080501)
* ~/.keynavrc extends defaults rather than replacing them
* "clear" in ~/.keynavrc resets keybindings
* comments can appear anywhere on a line
Patches from Eric (20080501)
* If the move or size value is greater than 1.0, then assume it is an absolute value.
Patches from Lukas Mai (20080429)
* Fixes a few minor bugs
* Clean up to compile without most warnings when -pendantic and -Wall are enabled.
Comments: 0 (view comments)
Tags: keynav, xlib
Permalink: /geekery/keynav-20080501
posted at: 13:44
I noticed that my tabsearch extension wasn't working properly after installing Firefox 3.0b5. A quick read of
this document helped me figure out what was wrong. I also wasn't specifying the
right content location in my chrome.manifest, which somehow worked fine in
firefox 2 despite not being correct. Maybe the previous extension release was a
custom built one that didn't use the make system I have now, either way, it's
all fixed.
Head on over to the firefox tabsearch project page and download it.
Download: tabsearch-20080430.xpi
Additionally, I've noticed that Firefox 3.0b5 doesn't seem to render this site
correctly. Seems like it's ignoring my CSS of "pre { overflow: auto; }" which
makes pre tags scroll if they become too wide. I'm willing to accept that I may
be doing something incorrect (that has historically worked fine) - I'd much
rather have the site render as intended. I'll look into it later.
Comments: 0 (view comments)
Tags: firefox, tabsearch, firefox-tabsearch, extensions, mozilla
Permalink: /geekery/firefox-tabsearch-20080430
posted at: 02:48
Friday was my last day at Google. I was coming up on my second anniversary of
joining the company. Working at Google was a superb opportunity, and I would
wager I haven't fully digested the value that working here has brought to me. I
still love Google, and I may even return some day, but I've got the feeling
there's a bigger adventure out there :)
I'm mostly writing this post to document my experiences with leaving a company.
I've never done it before. From what I've gathered, much of my experience is
exactly what should be expected when you're a valued employee and are leaving.
If you know me, this move shouldn't catch you much by surprise. Economics
describes something called the law of diminishing returns which outlines a
simple idea that after a certain point, the same amount of input will
eventually yield less and less output. It seems in some ways that I had reached
that point at Google.
I had a few random meetings with people who expressed interest in my staying.
Those who I met with, who knew me, understood why I was leaving. Those that
didn't know me couldn't be sold on the idea that someone could actually observe
diminishing returns and that I was being presumptuous and ignorant - they might
be right, but that's part of why I'm leaving - I need to know. There were other
opportunities within Google I could have investigated - but how much new
knowledge would I stand to learn? I may never know the answer to that question,
but my instincts tell me that even if I had moved to a new project that I would
have shortly observed diminishing returns again.
I've learned a lot about the industry and about How Things Work, including learning:
- that no matter how hard you try, some people insist on reading
negative emotions and ill-intent out of factual, unemotional statements.
- to play the politics game, despite my distaste for it.
- to give interviews and also learned that I don't like interviewing
people.
- some of what it is like to work on a team and in a group.
- that I must trust my teammates to get work done or risk going insane.
- that if there is a singular difference between systems administrators
and software engineers, it is that developers are hopelessly optimistic and
that sysadmins are hopelessly pessimistic, and that having both groups under
the same roof makes your software better.
- that nobody reads email, especially important ones, and someone will
page you asking about a problem you sent out 4 notifications for 3 hours ago.
- that nobody reads documentation, no matter how accessible. Expect phone
calls next week with questions about things you clearly documented on the
wiki 8 months ago.
- that years of experience is a horrible metric for gauging someone's
talent and skill
- that I cannot be represented by any unidimensional scale, such as GPA or
job ladder position.
- that being on-call 24/7 sucks, and that having half of your team 8+
timezones away will alleviate this problem.
- that everything is negotiable and nothing is ever set in stone.
- balancing life and work is difficult but always worth putting effort
into
The most important thing I have learned is that I have limitless energy for solving difficult problems, and I am much more aware of who I am now than I was a few years ago.
I joined Google many years after it started, and the majority of the
infrastructure was already built, decisions made, software designed, etc. Some
of those designs were great and some of them were not; a guaranteed occurance
on any project or at any company. The piece that was missing was that I missed
the opportunity to be a part of making those early decisions - right or wrong.
When I expressed this need, one of the responses was that I should not strive
to reinvent the wheel by starting over on a different project only to do a
similar thing. I was, after all, going to another company to help them build,
design, and operate a scalable infrastructure. It's a good point, but it is a
point that doesn't include a critical piece of information - some things
must simply be learned on your own.
I have plenty of friends who have reinvented the wheel for the sake of
learning. For example, one wrote a web browser simply for the purpose of
learning how it is done from start to finish: choosing a language, choosing a
graphical toolkit, learning some web standards, implementing them, etc. It's a
learning experience. College is an endless cycle of wheel reinvention, for
example. In parallel, 500 of your fellow students will write the same linked
list implementation as you do. One semester from now, another 500 students will
rewrite that same linked list implementation from scratch. Why? Because
learning by doing is a pretty reliable way to learn. Way before college, you
had to learn to walk, all by yourself. Billions of people already knew how to
walk before you did and millions of programmers knew how to do a linked list
before you did, but that isn't considered reinventing the wheel, right?
Reinventing the wheel for the sake of learning is in many ways a historical
simulator. Given the same needs, how will you design? Knowing the mistakes made
in the current wheel, can you avoid them without introducting more mistakes?
You can travel back in time, knowing what you know now, and see how your ideas
and knowledge would have influenced the outcome. At least, that's the way I
see it.
Take a look at my history on this site. Many of my projects are easily taggable
as wheel reinvention, but I would not know much of what I know if I had not
worked on these projects.
There are times when you don't want to reinvent the wheel, but doing so for the
sake of learning is a pretty good reason. If you're lucky, you get to be in the
right place at the right time to be a part or the whole of the process that
leads to the creation of a new, better wheel. Then again, this assumes that
whatever exists now works well enough to be considered a wheel at all or that
any wheel exists to solve this problem.
At my new place, I'll be able to stretch out my abilities and see more of what
I am capable while at the same time learning at a faster rate. Will I help
design and implement a great infrastructure or a crap infrastructure? Will I
be a fundamental reason why this new company succeeds? These questions are not
yet answered, but I am excited to ride on the path towards those answers.
Comments: 0 (view comments)
Tags: work, job, life, changes
Permalink: /geekery/a-step-in-a-new-direction
posted at: 00:33
I setup ccache again (trivial) to help me with building freebsd repeatedly. I
noticed that much of the time spent in the kernel build process was in building
dependency lists using awk.
Why couldn't we apply the ccache idea to everything else? If the same input
always means the same output, then we could cache it if it is computationally
expensive to compute that output.
Script: dcache.sh
Above is a hack that runs like ccache, but tracks all files created by the
process (and its subprocesses). Here's a sample run, of counting the number of
lines in a file with awk and outputing the result (within awk) to another file.
% /usr/bin/time ./dcache.sh awk '{x++} END { print "Total records: " x > "/tmp/hello"}' bigdata
Running original...
1.60 real 0.05 user 0.74 sys
% cat /tmp/hello
Total records: 1000000
# Remove the old output file
% rm /tmp/hello
# Rerun it again, unmodified, and it will use the cached output.
% /usr/bin/time ./dcache.sh awk '{x++} END { print "Total records: " x > "/tmp/hello"}' bigdata
Using cache...
0.06 real 0.00 user 0.06 sys
% cat /tmp/hello
Total records: 1000000
It doesn't work with everything just yet, but the problems seem to be with
truss's behavior and not the script's fault, like sometimes truss hangs, or it
doesn't follow a fork like it should.
Beyond truss problems, the scripts doesn't track file renames. It also doesn't
understand how to figure out what the input files for each command is. Ideally
it would checksum any inputs and use that as the cache key; currently it only
checksums the commandline arguments and not the external files being used (such
as 'bigfile').
I started initially without using truss, but awk doesn't call open(2) via libc
when it opens files, for some reason, and I can't figure out a clean way to
capture specific function calls from a process (even a child process).
Dtrace would be sexy here, but it is unavailable in the main freebsd trunk.
The speedup is pretty obvious for cpu-intensive things, but the real test is to
see how it performs when working properly and hooked into the freebsd kernel
build.
Comments: 1 (view comments)
Tags: freebsd, caching, build, make, awk
Permalink: /geekery/non-compiler-caching
posted at: 04:49
|
Search this site
Navigation
Metadata
Home
About
Resume
My Code (SVN Web)
ARP Security
Dynamic DNS with DHCP
OpenLDAP+Kerberos+SASL
PPP over SSH
SSH Security: /bin/false
Week of Unix Tools
Work Efficiency
fex
firefox tabsearch
firefox urledit
grok
keynav
liboverride
newpsm (FreeBSD)
nis2ldap
pam_captcha
poor man's backup
Solaris audio utility
xboxproxy
xdotool
xmlpresenter
xpathtool
misc scripts
Presentations
Yahoo! Hack Day '06
Unix Essentials
Vi/Vim Essentials
Tag Cloud
Calendar
| < |
May 2008 |
|
| | | | | 1 | 2 | 3 |
| 4 | 5 | 6 | 7 | 8 | 9 | 10 |
| 11 | 12 | 13 | 14 | 15 | 16 | 17 |
| 18 | 19 | 20 | 21 | 22 | 23 | 24 |
| 25 | 26 | 27 | 28 | 29 | 30 | 31 |
Friends
BarCamp
Kent Brewster
Tantek Çelik
John Resig
Wesley Shields
Tyler Shields
Technorati
|