Technorati Tags: puzzles
« June 2006 | Main | August 2006 »
Technorati Tags: puzzles
Posted by stechert on July 15, 2006 at 03:23 AM in Experience | Permalink | Comments (0) | TrackBack (0)
Reblog
(0)
| | Digg This
| Save to del.icio.us
|
|
So why does this suck so much? First of all, what's with the redundant egrep -E? Perhaps homie doesn't know that you don't have to specify -E to egrep because, after all, grep, egrep, and fgrep are almost always the same binary and just switching their behavior based on argv[0]:grep is great if you're looking for a fixed pattern. But egrep (a kind of alias for grep -E) is far superior because it can search for matches based on a regular expression. For example, the command... $ egrep -w -E '.ink$' /var/dict/words link mink oink pink ... ... searches for any whole, four-letter word that end with "ink.
stechert@kirin:~ [1035] $ ls -l /usr/bin/{e,f,}grep
-rwxr-xr-x 3 root wheel 204496 Jan 13 11:26 /usr/bin/egrep
-rwxr-xr-x 3 root wheel 204496 Jan 13 11:26 /usr/bin/fgrep
-rwxr-xr-x 3 root wheel 204496 Jan 13 11:26 /usr/bin/grep
Second of all, WTF is a "fixed pattern"? Obviously, the dude who wrote this doesn't know either because his example works just fine with grep:
He should have read the man page which clearly makes the distinction between basic and extended regular expressions. Why not use an example with infixed OR, optional matching, or something? Make it interesting -- 90% of people I know who use Linux know this stuff rote. How about:stechert@kirin:~ [1036] $ grep -w '.ink$' /usr/share/dict/words bink dink fink gink jink kink link mink pink rink sink tink wink zink
See? That wasn't so hard. Or maybe illustrate the difference in how wildcards are specified:stechert@kirin:~ [1037] $ grep -w '.?ink$' /usr/share/dict/words stechert@kirin:~ [1038] $ grep -Ew '.?ink$' /usr/share/dict/words bink dink fink gink ink jink kink link mink pink rink sink tink wink zink
*sigh* ok rant over -- just had to get this off my chest because this is the second time in 3 weeks there's been some utter foolishness in that newsletter (last time it was some nincompoopery about using 'cd $OLDPWD' instead of just 'cd -').stechert@kirin:~ [1039] $ grep -w '\(.\)in\1$' /usr/share/dict/words ging kink tint stechert@kirin:~ [1040] $ grep -Ew '(.)in\1$' /usr/share/dict/words ging kink tint stechert@kirin:~ [1041] $ grep -Ew '\(.\)in\1$' /usr/share/dict/words grep: Invalid back reference
Technorati Tags: linux magazine, nincompoopery
Posted by stechert on July 14, 2006 at 02:17 AM in Read | Permalink | Comments (0) | TrackBack (0)
Reblog
(0)
| | Digg This
| Save to del.icio.us
|
|
Posted by stechert on July 13, 2006 at 09:20 AM in Read | Permalink | Comments (0) | TrackBack (0)
Reblog
(0)
| | Digg This
| Save to del.icio.us
|
|
Technorati Tags: splicing, feedburner
Posted by stechert on July 10, 2006 at 10:43 PM in Create | Permalink | Comments (0) | TrackBack (0)
Reblog
(0)
| | Digg This
| Save to del.icio.us
|
|
For the last few weeks, Japan has been in an uproar over the death-by-severing of sixteen year old Hirosuke Ichikawa. The sad thing that's missing from a lot of the print-based news articles (versus NHK's nightly news show) is that the elevator was regularly serviced, but that the third party maintenance company blames the problem on the fact that they were handicapped in their ability to diagnose and repair the elevator because the Schindler elevator company was reluctant to share technical details about the elevator with them (or to sell proper repair parts). The upshot of the latest articles is that Schindler elevators are experiencing over 300 accidents per year, at a rate about 3 times worse than its peers.
While the consequences are usually less severe, this is analogous to what we see with closed software, too. I wonder how long it will be until we start seeing companies providing open solutions for equipment like elevators? Now that I can build my own CNC machine, all I need is open sourced CNC instructions, raw materials, and open source control code to have a fully-open elevator. Wouldn't you rather ride in an elevator whose control system has been flushed of shallow bugs? I would.
Technorati Tags: open source
Posted by stechert on July 06, 2006 at 02:26 PM in Read | Permalink | Comments (0) | TrackBack (0)
Reblog
(0)
| | Digg This
| Save to del.icio.us
|
|
Technorati Tags: OSX
Posted by stechert on July 06, 2006 at 02:05 PM in Read | Permalink | Comments (0) | TrackBack (0)
Reblog
(0)
| | Digg This
| Save to del.icio.us
|
|