|
Tuesday, March 29, 2005 6:29 PM | rahel luethy | 5 comment(s)
unfortunately, this is not how you rename the extensions of multiple files in one go. the shell can't match *.bar and the mv command just doesn't work that way...
here is one option for bulk renaming on unix:
find . -name *.foo | sed "s/\(.*\)\.foo$/mv '&' '\1.bar'/" | sh
it concatenates one mv command per file and pipes all commands to a shell.
performing a search/replace over a big file system tree is another task which sounds very easy but is actually quite tricky. surprised that my java IDE (eclipse) doesn't offer anything alike, i switched to good'ol bash when i recently had to replace all occurrences of "foo" with "bar" in our source tree*:
find . -name "*.java" | xargs sed -i -e "s/foo/bar/g"
this seemed to work quite well. however, eclipse reported 42 zillion outgoing cvs changes (while probably only about 20 files contained the "foo" string).
this behavior is intrinsic to sed (the stream editor) and the -i argument (the in place editing): sed reads the file, edits the stream, writes the result to a tmp file, and finally overwrites the original file with the tmp file. this last step is done for every single file, irrespective of whether an actual edit has been performed or not.
if you don't want the timestamps to change, you thus need to sneak in an additional grep command:
find . -name "*.java" | xargs grep -l foo | xargs sed -i -e "s/foo/bar/g"
comments and sexy alternatives are very welcome!
* no, we don't actually spend our afternoons replacing "foo" with "bar" at genedata... but i just don't want to rant about the difference between a java.security.InvalidParameterException and a java.lang.IllegalArgumentException any further ;-)

Friday, March 25, 2005 12:23 AM | rahel luethy | 2 comment(s)
this one is probably also a well-established blog meme which i've just not been aware of yet:
i just caught myself turning up the volume when drs3 was playing mel c's latest single next best superstar (mona vetsch: "d'madame hett zu de gitarre glanget"). the fact that garbage lead singer shirley manson once expressed a wish for all spice girls to be "tarred and feathered" makes it pretty hard to admit that sporty spice did a damn good job with this song ;-)
while i'm at it:
- kylie minogue: can't get you out of my head
- sugababes: too lost in you
- adrian stern: ha nur welle wuesse
- the rasmus: in the shadows
- no angels: daylight in your eyes
- reamonn: supergirl
- britney spears: toxic
(check this or this out if you need inspiration)
Sunday, March 20, 2005 9:26 PM | rahel luethy | 0 comment(s)
hei reidschel
i read almost all of jur textes without understanding all thous inhalts.onli the ten things only ju made hab ich fast alle understud.my problem isch not mei inglisch sondern my neck hu hörts mi wen ei luk into the bildschirm. big schit. cos er isch tuu hei and mei brille luks nur untendurch scharf.cän ju anderstand my broblem? the lösung of this broblem ischg ein läbdob! and e faster leitung. häv e gud sundayabend änd e gud wochenstart
jur mam
Saturday, March 19, 2005 1:07 PM | rahel luethy | 0 comment(s)
much to the aargauerin's surprise, freitag bags have been deemed uncool in today's issue of das magazin. if you consider yourself a trendsetting lifestyle evangelist: 3M has published a detailed HOWTO for turning duct tape into a wallet.
if this seems like a piece of cake, you might go on with more advanced items, such as the duct tape bra, jesus, or catsuit. if your wallet didn't turn out so well after all, just buy one here.
Friday, March 18, 2005 10:05 AM | rahel luethy | 0 comment(s)
i rumgespielt still another little with the blogger. now one can have the blog of entries translated of google into german and french (thanks etienne and pamela)
just browsed through the latest gadgets on ThinkGeek and ran over this internet urinal (the handy female adapter deserves special attention):
btw: the space for the "customer action shot" is still vacant
Thursday, March 17, 2005 4:43 PM | rahel luethy | 6 comment(s)
... ist aller laster anfang.
wer sich jetzt mit berber-augen wundert, weshalb ich ploetzlich doch deutsch schreibe: dies ist quasi ein insider posting, das lediglich als container fuer zahlreiche kultversprecher dienen soll, die sich ueber die letzten jahre angesammelt haben. deutsch scheint also schon genug tuecken zu bieten...
die idee dazu kam gestern, als die fcb-koniferen wieder eher schlecht als recht kickten (kunstwerk, kommt bei 4:3 gegen schaffhausen langeweile auf). das damaskus-schwert haengt ueber euren leeren kommentaren ;-)
Monday, March 14, 2005 9:12 AM | rahel luethy | 0 comment(s)
because i'm just a follower: ten things i've done that you probably haven't...
- rode through the forest on the backseat of a motorbike with a multiply broken leg and a driver without a permit
- spent 400 schilling on a reasonably sized piece of tar (in vienna, thinking i got a good deal on pot)
- made it to the front page of the kirchenbote. as an atheist.
- competed over "who can take the bigger pizza bite" with michael jackson's guitar player jennifer batten
- synchronized the contacts on my mobile phone with my SuSE linux box without typing them in anew
- bitched about my supervisor in an email to my boyfriend and unintentionally posted the message to the institute-wide newsgroup
- drank whiskey with an injured smuggler on a campsite in sweden
- had the intention to break into a kiosk at the age of 12, discovered that the kiosk was actually unlocked, and didn't steal anything
- subverted this "10 things" meme with a reason (see #9 here) even though i would have had a number 10 (sex in the night train to amsterdam)
Monday, March 07, 2005 5:56 PM | rahel luethy | 0 comment(s)
a neat java 5 one liner to read the contents of a file into a String:
String text = new Scanner(new File("foo.txt")).useDelimiter("\\A").next();
the trick is the regex \A, which matches the beginning of input and thus effectively tells Scanner to tokenize the entire stream, from beginning to (illogical) next beginning.
more details can be found in pat niemeyer's original post
Saturday, March 05, 2005 3:52 PM | rahel luethy | 0 comment(s)
one negative side effect of our recent trip to new zealand was the immense music vacuum. while the four gigs on the mini ipod did a good job in providing the soundtrack on our 3-month-travels in the mitsi surf van, i've been craving for the latest facts and figures on the music gossip front.
i've been catching up over the last few days:
- tori amos' new album the beekeeper came out on february 21 (the day of our flight back, and i thus bought it right at the airport). tori has been the musical love over the last eleven (11!) years of my life - so don't expect substantial criticism here. she is probably the only one who can make me listen to gospel choirs (sweet the sting) and is for sure unmatched in her choice of song titles: her duet on terrorism (featuring damien rice) is called the power of orange knickers
- ex-nirvana foo fighter dave grohl is hitting the drums on the upcoming albums of three of my favorite bands: garbage (april 11, 2005), nine inch nails (may 02, 2005), and queens of the stone age (march 04, 2005)
- beck's new album is due march 29, 2005
- schnappi dominating the swiss charts is as difficult to understand by outsiders as the re-election of george bush. luckily, the consequences are less severe
- miss kittin has published her xMaxMix2004 (simply point your iTunes to it) - great sound to hack along to
- some kind of monster, the highly recommendable metallica documentary, has won the 20th IFP independent spirit awards
and finally (my obligation as a list lover), the best-of new zealand following the blog-shuffle meme:
ruled by secrecy - muse
lady fingers - luscious jackson
the bitter end - placebo
one shot 2 shot - eminem
no child of mine - pj harvey
sense - zueri west
summer daze - luscious jackson
auesvomir - zueri west
santa maria - gotan project
shame - pj harvey
and because shuffle algorithms never really do justice - these are my hand-selected album picks (top 3 of 2004):
soulwax - any minute now
franz ferdinand - franz ferdinand
incubus - a crow left of the murder
o.k., i shouldn't have mentioned the "ppt crap" in my last posting. but this is definitely depressing.
which file extension are you?
Friday, March 04, 2005 5:50 PM | rahel luethy | 2 comment(s)
i've been rather reluctant to do this. blogs are personalized spam, posting in english feels pseudo, and who's been asking for this anyway?!
i finally gave in. my 9 reasons:
- i'm probably not any different from the big mass of "dear diary" u.s.anians
- the number of emails i get from zigers@itsystems.ch has been ever increasing. indicating that there's definitely a market for gossip, cheesy jokes, tech-talk, and ppt crap
- i've always preferred "pull" over "push"
- RSS/atom support is my favorite thunderbird feature (forget 3.)
- ben's blog is really cool
- etienne gave in as well
- "nebenlaeufigkeit", "laufzeitsystem" und "betriebssystemkern" (Konzepte und Implementierungen moderner virtueller Maschinen) toenen sehr viel bloeder als mein englisch
- i partly gave in years ago anyway (all time favorites)
- nine is cooler than eight or ten
p.s. yes, i know that "blogger" is yet another g* product infiltrating our life. and yes, i also have this gut feeling that g* is going to be the next m$ (or probably already is). but somehow, investing time in finding a decent blog host seemed beyond justification. publishing privacy is probably what this is all about.
|