Voder-Vocoder

The Log of Hal Canary

Navigation: Home | THE LOG | Log Archives | Resume | Contact Info | Public Key | SSL | Math Applets | Site Map | WP Backend | RSS2 | Atom

Mplayer and Gnome's screensaver.

#!/bin/sh
#DTPD
gnome-screensaver-command --inhibit &
INHIBIT_PID=$!
mplayer -dvd-device /dev/scd0 -ontop \
	-fs dvdnav:// -nocache 2> /dev/null
kill $INHIBIT_PID

This is how to use gnome-screensaver's inhibit command with a video player such as mplayer.

Hal Canary | Computers & Code | 2010-02-17 21:05:06 UTC
Permanent Link | Comments Off

Olive Oil Balsamic Vinaigrette

Olive Oil Balsamic Vinaigrette
(makes 2 cups)

  • Balsamic Vinegar, 1/2 cup
  • Yellow Mustard, 2 tablespoons
  • Extra Virgin Olive Oil, 1+3/8 cups
  • Salt to taste
  • ground black pepper to taste
  • Spices (onion, garlic, et cetera) to taste

Shake well. Use sparingly, as it has a lot of calories.

Hal Canary | Uncategorized | 2010-02-13 09:09:09 UTC
Permanent Link | Comments Off

food labels

I had a dream that the big food companies had subverted FDA regulations by inventing new chemicals and giving them funny names: "Ingredients: Water, Sweetness and Light (TM), Lovely Hugs (TM), spices, Beautiful Tastiness (TM), artificial flavoring, and natural flavoring."

Hal Canary | Dreams | 2010-02-13 08:41:55 UTC
Permanent Link | Comments Off

without morals

“Lawrence Lessig calls for a Constitutional amendment on campaign financing.” Why not an amendment limiting the *political* rights of corporate people? Isn't that the underlying problem?

Hal Canary | Uncategorized | 2010-02-06 10:14:52 UTC
Permanent Link | Comments Off

white, dark-orange, and charcoal-black terrain

Everyone always talks about human spaceflight. But you know what really excites me? New Horizons. In another five and a half years we'll see what Pluto really looks like.
[hubble photo]

Hal Canary | What We Need More Of Is Science | 2010-02-05 07:48:45 UTC
Permanent Link | Comments Off

own

“I personally don’t buy ebooks with DRM on them, because I actually like to own the books I own.”—John Scalzi

Hal Canary | Books, Found on the internets | 2010-02-01 10:08:42 UTC
Permanent Link | Comments Off

time-wasting methods.

/* verbose java masturbation: */
public class Foo {
  private int foobar;
  public void setFoobar(int value) {
    foobar = value;
  }
  public int getFoobar(){
    return foobar;
  }
}
/* much less annoying: */
public class Foo {
  public int foobar;
}

Hal Canary | Computers & Code | 2010-01-17 22:23:38 UTC
Permanent Link | Comments Off

What am I doing?

It turns out I don't actually have class today. The classes are Monday, Wednesday, and Thursday — but the Monday and Wednesday classes are every week, while the Thursday class is only the last week of the semester, to make up for the fact that the semester begins on a Thursday.

I did pick up my textbooks today. They are just as heavy and expensive as they always have been.

* * *

What am I doing? I am considering where to apply for a master's program in computer science. In the mean time, I am taking the undergraduate classes at the local university that I would need anyway once I go to grad school. I'm still working full time at the bookstore.

* * *

I'm taking two classes: Algorithms and Digital Systems.

Digital Systems — Covers data paths, controllers, memory systems, and register transfer level design, as well as finite state machine design, classical logic design, and storage element design. Hardware and software tools for digital system analysis and synthesis are explored. Textbook: Roth & Kinney, Fundamentals of Logic Design (0495471690).

Algorithms — The design, implementation, analysis, and application of a range of computer algorithms are explored. Function order of growth and amortized analysis are used in analyzing algorithms. A review and extension of data structure topics including stacks, queues, trees, graphs, lists, sets, hash tables, and heaps are covered. Algorithm design strategies such as divide-and- conquer, the greedy method, and dynamic programming are studied. Textbook: Kleinberg & Tardos, Algorithm Design (0321295358).

* * *

Not a bad plan, considering that I made the decision to do this three weeks ago.

Hal Canary | Life | 2010-01-07 13:37:24 UTC
Permanent Link | Comments Off

Printing a text file

Printing a text file is one of those basic things you never think about. Unless you are me. I like to play with the variables and make that printout look good.

#!/bin/sh
# Print a UTF-8 document to the default printer
# Written by Hal Canary 2009-12-23.
#DTPD# Dedicated to the Public Domain.

# Configurable Options
font="Monospace 11"
#font="Serif 11"
#font="Sans 11"
paper="letter"
b_margin=0.25
t_margin=0.25
r_margin=0.25
l_margin=0.75

# convert inches to PostScript points
b_margin=`echo "( $b_margin * 72 ) / 1" | bc`
t_margin=`echo "( $t_margin * 72 ) / 1" | bc`
r_margin=`echo "( $r_margin * 72 ) / 1" | bc`
l_margin=`echo "( $l_margin * 72 ) / 1" | bc`

exec paps --font="$font" \
  --paper="$paper" \
  --bottom-margin=$b_margin \
  --top-margin=$t_margin \
  --right-margin=$r_margin \
  --left-margin=$l_margin \
  "$@" | lpr
#EOF#

Hal Canary | Computers & Code | 2010-01-07 13:22:40 UTC
Permanent Link | Comments Off

re: Χριστός-mas

Today is Christmas Day, a US federal holiday that coincides with the Christian holiday Christmas. Christ is a transliteration of the Greek word Χριστός, which means "smeared with oil." In the ancient Mediterranean, people smeared themselves with vegetable oil in much the same way that we use petroleum-based hair conditioners and skin lotion. But the Hebrew and Jewish peoples had a tradition of ritual smearing for kings; in this sense, the first Christians called Jesus the Christ to proclaim him rightful King of the Jews. Later Christians redefined the term to mean something else, since kings don't usually end up crucified before they take office.

Hal Canary | Uncategorized | 2009-12-25 11:29:28 UTC
Permanent Link | Comments Off

Current version of hot cocoa recipe

  • 4 teaspoons cocoa
  • 4 packets splenda
  • 1/6 teaspoon cornstarch (helps thicken the cocoa suspension)
  • 1 pinch salt
  • 1 cup boiling water
  • Add milk or cream for additional calories

Hal Canary | Uncategorized | 2009-12-17 19:22:05 UTC
Permanent Link | Comments Off

sed in place

#!/bin/sh
SEDCMD="$1"
shift
for x in "$@" ; do
  dirt=`dirname "${x}"`
  tmp=`mktemp "${dirt}/tmp.XXXXXXXXXX"`
  sed "${SEDCMD}" < "${x}" > "${tmp}"
  mv "${tmp}" "${x}"
  echo "$x fixed."
done

UPDATE: The next day I realized that

sed -i

does exactly the same thing.

Hal Canary | Uncategorized | 2009-11-29 00:45:32 UTC
Permanent Link | Comments Off

« Previous Entries | Next Entries »

Copyright 1997-2007 by Hal Canary.
mailto: h3 at halcanary dot org
xmpp:halcanary@jabber.org
aim:halwcanary
http://halcanary.org