Xana/ xana2/ 2007/ 10
Having your caret and eating it too

Let's say you're a French person who has EXTENDED_GLOB on and types HEAD^ all the time, but can't be bothered to type a backslash before the caret. Personally, I have no problem typing HEAD\^, but I probably only do that twice a day.

Here are a few/several/many (depending on how you count) “solutions”. They all have their downsides. Finding out their side effects is an exercise for the reader.

Number one: setopt noextendedglob

Number two: setopt nonomatch

Number three: alias git='noglob git'

Number four: custom ZLE widget:

accept_line_with_headcaret () {
  if  ${BUFFER} = git*HEAD\^* ; then
    BUFFER="${BUFFER//HEAD\^/HEAD\\^}"
  fi

  zle .accept-line
}
zle -N accept-line accept_line_with_headcaret

I'll just keep hitting the backslash key.

Posted Thu Oct 4 15:17:15 2007 Tags: 10
Strictly Ballroom

[map]

Posted Sat Oct 6 15:57:16 2007 Tags: 10
Too many colons

The zsh-lovers man page contains the following example.

# Show me all the .c files for which there doesn't exist a .o file.
$ c=(*.c) o=(*.o(N)) eval 'ls ${${c:#(${~${(j:|:)${o:r}}}).c}:?done}'

What's with the ugly dollar-sign prompt? I'd do it this way instead.

print *.c(e_' ! -e $REPLY:r.o '_)
Posted Sat Oct 6 17:16:51 2007 Tags: 10
I need an admin assistant to glue papers to other papers

buxy is on the wrong track.

DSA is a fundamentally-flawed organization; all of the self-selecting “committees” in Debian are: you cannot have a functional and respectable subgroup if it maintains autonomy like that.

The solution to the current set of problems that have been plaguing us for years is not to have backroom discussions and negotiations. It is not to add MORE team members, because that will, at best, achieve minor performance improvements. At worst, that will bolster its structural problems.

To fix DSA cleanly and healthily, the honorable members need to resign, and Debian needs to fire the rest. Attempt anything else and you will likely become part of the problem.

Posted Wed Oct 10 07:32:34 2007 Tags: 10
Good job, rats

[jjjjordi]

El año pasado 1,944 neoyorquinos vieron algo y dijeron algo. Gracias por mantener tus ojos y oídos bien abiertos. Y no guardar tus sospechas para ti mismo. Si ves algo, di algo! Habla con un policía o con un empleado de la xxx. O llama al 1-888-xxx-xxxx

Posted Wed Oct 10 10:21:43 2007 Tags: 10
One of us does not get it

Raphaël, I'm not sure you understood.

The solution is to get rid of all of DSA (and maybe anyone that supports them). Removing one side of a power struggle may win you some short term gains, but may be a no-op or even more harmful in the long run. Such a solution is indicative of what I would call an overly-practical mindset, the kind I'd expect from Project Scud.

You can say that DSA's inadequacies and ineptitude are due to specific individuals, but it is a team: each member is free to quit at any time (unless there is some kind of sinister blackmail or other means of coercion in progress, in which case I'm sure we would all appreciate if you exposed it), and each member is responsible for the performance of the team.

If you accept that each team member is responsible, and you acknowledge that DSA's behavior is unacceptable, then how can you imagine that adding or subtracting members piecemeal will effect anything substantial?

Posted Fri Oct 12 22:57:03 2007 Tags: 10
But can I read it over gopher

John Goerzen nearly transforms into Tom Robbins.

Posted Wed Oct 17 23:31:14 2007 Tags: 10
Should I short JAVA or NTAP?

Dear Lazyweb (and Andres):

Why are Ian Murdock, Eben Moglen, and Pamela Jones supporting a company that tries to extort another company? Is it because actually filing suit is more evil than threats? Why shouldn't they both burn in hell? kthx.

Posted Thu Oct 25 21:42:01 2007 Tags: 10
zrockboxing out

Someone gave me an MP3 player. He did so for somewhat devious reasons, but that's outside the scope of this post. It is a SanDisk Sansa—stop thinking of pulp fantasy—and it has roughly 500 gigs too little storage space. The FAQ says such cute things as “The original firmware is recommended for charging at this time,” and “Rockbox does not currently provide either functionality so you will need to continue using the original firmware (for now) in MSC (UMS) mode to add music to the Sansa.”

Please don't tell my Sansa about this FAQ because it thinks that both of those claims are false.

I want my newfangled device to participate in the spyware fiesta known as last.fm, and Rockbox has an option for supporting that; if you turn it on, it fills a /.scrobbler.log file with tab-delimited lines for your parsing pleasure.

Rather than download additional software to cope with my new lifestyle, I whipped up the following script (released under the gnocchi-ng license) which “converts” the log to something you can just stuff into your ~/.zomg/cache file and send up to the submission server at your next appropriate invocation of zomg. I'm afraid you'll have to handle any timestamp sorting by hand, but if you script it, be a dear and implement some kind of cache file locking.

#!/bin/zsh
# Copyright (C) 2007  Clint Adams.  All rights reserved.
# This program has no name and is released under the terms of
# the gnocchi-ng license.

audioscrobbler_urlencode() {
  if (( $+options[multibyte] )); then
    setopt localoptions extendedglob nomultibyte
  else
    setopt localoptions extendedglob
  fi

  input=( ${(s::)1} )
  print -- ${(j::)input//(#b)([^A-Za-z0-9_.!*\'\(\)-])/%$(([##16]#match))}
}

audioscrobbler_constructquery() {
  local sid="$1"
  local artist=$(audioscrobbler_urlencode "$2")
  local track=$(audioscrobbler_urlencode "$3")
  local album=$(audioscrobbler_urlencode "$4")
  local mbid=$(audioscrobbler_urlencode "$5")
  local length=$(audioscrobbler_urlencode "$6")
  local ttime=$(audioscrobbler_urlencode "$7")
  local source="$8"
  local tracknum="$9"

  reply=("&s=${sid}" "&a[0]=${artist}&t[0]=${track}&i[0]=${ttime}&o[0]=${source}&r[0]=&l[0]=${length}&b[0]=${album}&n[0]=${tracknum}&m[0]=${mbid}")
}

while read -r line
do
  local -a field

  field=("${(@ps:\t:)${line}}")

  if [[ $field[6] == L ]]; then
    audioscrobbler_constructquery "" "$field[1]" "$field[3]" "$field[2]" "" "$field[5]" "$field[7]" P "$field[4]"
    print "$reply[2]"
  fi
done <<(grep -v '^#' .scrobbler.log)
Posted Thu Oct 25 23:11:25 2007 Tags: 10 rockbox
Ring-a-ring-a-rosey, as the light declines
Killing
HARIBO MACHT KINDER FROH UND ERWACHSENE EBENSO
Chocolates eying jealously that tub of avocado mush
Then you're just awed
By the awesomeness
Of the awesome powers displayed before you
It's pretty awesome

Struggle and conflict
Orbs of mercury rolling across space
While dogs battle in the darkness
Cable in pants at last for a hot bus ride
Woogie, woogie, woogie
Posted Tue Oct 30 21:37:19 2007 Tags: 10