Category: Music
Posted by: pwfishe

02/02: Bookmarklets

Category: General
Posted by: pwfishe
A nice alternative to resource-hungry extensions, bookmarklets are surprisingly useful. Just drag them to your bookmark toolbar.

Del.icio.us: Tag this page.

Twitter: create a new Tweet.

Dictionary.com: search Dictionary for the selected word.

Tumblr.com: create new Tumblr tumblelog entry.
Category: General
Posted by: pwfishe
Category: Music
Posted by: pwfishe
Category: Funny Stuff
Posted by: pwfishe
Category: Music
Posted by: pwfishe
Saw them at the Greek Theater last night. Awesome!

set list

Thursday Sep 10 2009
Greek Theatre


Funny The Way It Is *
Spaceman *
The Stone *
Dive In *
Satellite *
Everyday *
Improv *
Why I Am *
Typical Situation *
Gravedigger *
Seven *
Out Of My Hands
Rhyme And Reason *
Shake Me Like a Monkey *
You and Me *
Lie In Our Graves *
Alligator Pie *
Ants Marching *

__________________

Sister +
Time Bomb *


Show Notes:
* Jeff Coffin
~ Dave, Carter Rashawn and Tim

Category: Programming
Posted by: pwfishe
Why did they nuke defaultChecked? They left defaultValue, but how useful is the built-in form reset function when it doesn't work for checkboxes?
Category: Programming
Posted by: pwfishe
[pfisher@rockstar ~]$ alias bold='tput bold'
[pfisher@rockstar ~]$ alias unbold='tput rmso'
[pfisher@rockstar ~]$ alias highlight='tput smso'
[pfisher@rockstar ~]$ alias unhighlight='tput rmso'
[pfisher@rockstar ~]$ cat font-test.sh
#!/bin/bash

function bold { tput bold; }
function unbold { tput rmso; } # reset mode stand-out
function highlight { tput smso; } # set mode stand-out
function unhighlight { tput rmso; }

echo "normal text"

bold
echo "bold text"
unbold

echo "normal text"

highlight
echo "highlighted text"
unhighlight

echo "normal text"

bold
highlight
echo "bold and highlighted"
unbold
unhighlight


At least, that's a simple way to pretend it works. In reality, though, unbold and unhighlight are the same thing, they each undo both bold and highlighting.
Category: Programming
Posted by: pwfishe
00230 /* Note that Motorola Delta 68k R3V7 comes with GCC but not stddef.h.
00231 That was relevant to code that was here before. */
Category: Programming
Posted by: pwfishe
I discovered that I reinvented the square wheel. (Round wheel found here.) Now I know how this guy feels.

But I don't feel too bad because everywhere I look I see yet another bad implementation of getopt. Come on people, GNU style is cool style.

I feel like I might fix up my PHP command line options parser to conform more closely with what I'd call "expected" behavior, and support alternative syntaxes. I also half want to write my own in Bash, because everything I've found sucks in one way or another.

I think the best one I've seen so far (clean code, sensible syntax) is the getopt parser in the Python library. Even better, though, is the whole system provided by the Python optparse module. Makes me want to use Python.

Damn good documentation, here. This really explains everything there is to know about command line argument parsing:

option

an argument used to supply extra information to guide or customize the execution of a program. There are many different syntaxes for options; the traditional Unix syntax is a hyphen (“-“) followed by a single letter, e.g. "-x" or "-F". Also, traditional Unix syntax allows multiple options to be merged into a single argument, e.g. "-x -F" is equivalent to "-xF". The GNU project introduced "--" followed by a series of hyphen-separated words, e.g."--file" or "--dry-run". These are the only two option syntaxes provided by optparse.

Some other option syntaxes that the world has seen include:

  • a hyphen followed by a few letters, e.g. "-pf" (this is not the same as multiple options merged into a single argument)
  • a hyphen followed by a whole word, e.g. "-file" (this is technically equivalent to the previous syntax, but they aren’t usually seen in the same program)
  • a plus sign followed by a single letter, or a few letters, or a word, e.g."+f", "+rgb"
  • a slash followed by a letter, or a few letters, or a word, e.g. "/f","/file"

These option syntaxes are not supported by optparse, and they never will be. This is deliberate: the first three are non-standard on any environment, and the last only makes sense if you’re exclusively targeting VMS, MS-DOS, and/or Windows.