Voder-Vocoder

The Log of Hal Canary

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

/bin/coin

#!/usr/bin/env python
# ~/bin/coin
#DTPD#
if (ord(open('/dev/random').read(1)) % 2):
 print "heads"
else:
 print "tails"

But why throw away seven bits of entropy?

#!/usr/bin/env python
#DTPD#
n=ord(open('/dev/random').read(1))
for i in xrange(8):
 if  (n % 2):
  print "heads",
 else:
  print "tails",
 n >>= 1
print

Hal Canary | Computers & Code | 2011-04-10 22:21:24 UTC
Permanent Link | Comments Off

take a load off.

I now own no TV.

That thing was heavy, and I never have to lift it again.

Hal Canary | Life | 2011-04-02 13:07:22 UTC
Permanent Link | Comments Off

Update on my life.

Update on my life: it is awesome.

That is all.

Hal Canary | Life | 2011-04-01 08:55:07 UTC
Permanent Link | Comments Off

convert asterisks to html-bold via sed

#!/bin/sed -f
#DTPD#
#convert *bold* text to *html bold*
# also converts /italic/ text to html em
s/\*\([^\*]*\)\*/<strong>\1<\/strong>/g;
s/\/\([^\/]*\)\//<em>\1<\/em>/g;

Hal Canary | Computers & Code | 2011-03-07 20:37:44 UTC
Permanent Link | Comments Off

speaking of the Touch…

I’ve decided that using it as an ebook reader is incredibly convenient, because of its small size (it fits nicely in my pocket!). The only advantage an e-ink screen still holds for me is super-long battery life.

Hal Canary | Books, Computers & Code | 2011-03-05 21:23:56 UTC
Permanent Link | Comments Off

HTML/CSS for Ipod Touch

I added these lines to the CSS for this page

pre { overflow:auto;
      overflow-y:visible; }

and this line to the (X)HTML

<meta name="viewport"
    content="width=device-width" />

which seems to make the site render much much better on my Ipod Touch’s small screen.

Hal Canary | Computers & Code | 2011-03-05 21:20:35 UTC
Permanent Link | Comments Off

Occam the Dell

I really think a computer should last more than 32 months. Sloop, the computer I built in June 2008, failed yesterday. Coincidentally, I ripped the old HDDs out of Dalek the day before to send it to be recycled. Now I have two old boxes to recycle.

I bought a cheap desktop at the store yesterday and didn't even try to look for a good deal online. I just wanted to have a functioning computer. The new case is 34% smaller by volume (I just measured). I would have gotten something even smaller, but I wanted a t least one PCI slot, one PCI Express slot, and room to mount my old HDD. I named it Occam.

Occam is a Dell. The CPU is a Intel Pentium Dual-Core E5800. One benchmark rates this as 34% faster than Sloop's Athlon 64 X2 6000+, which was an upgrade 18 months ago.

Hal Canary | Computers & Code, Life | 2011-02-14 22:43:08 UTC
Permanent Link | Comments Off

“And they also said it’s impossible…”

I propose that Jimi Hendrix's “1983…” be adopted as a transhumanist anthem.

Hal Canary | Music, Theology | 2011-01-02 00:21:47 UTC
Permanent Link | Comments Off

REAL10

“Real” is not an acceptible synonym for “80-bit floating-point number.” Real numbers aren't even countable, much less in a bijection to a set of size 2^80.

Hal Canary | Computer Science, Computers & Code, Mathematics | 2010-12-09 00:20:44 UTC
Permanent Link | Comments Off

photos from today

Hal Canary | Photos | 2010-11-13 15:02:43 UTC
Permanent Link | Comments Off

Milestone.

For the first time in twenty-five years, I am not overweight. That is all.
weight = 188.9 lbs.

Hal Canary | bariatrics, Life | 2010-11-13 07:49:20 UTC
Permanent Link | 2 Comments

using emacsclient

Attention Emacs users. It took me a while to realize that new-style fonts can be enabled by adding this to the ~/.emacs file.

(set-face-attribute 'default
  nil :font "Monospace-11")

So here's how I set up the look of Emacs in my .emacs:

(require 'color-theme)
(color-theme-dark-laptop)
(set-scroll-bar-mode 'right)
(tool-bar-mode nil)
(menu-bar-mode nil)
(set-face-attribute 'default
  nil :font "Monospace-11")

And here's my emacs startup script:

#!/bin/sh
#DTPD#
# ${HOME}/bin/e
if test "$DISPLAY" ; then
  nohup /usr/bin/emacsclient \
    -a '' -n  "$@" \
    > /dev/null 2>&1 &
else
  exec /usr/bin/emacs "$@"
fi

This startes emacs in daemon mode if it's not already running (there's not a lot of harm in leaving a daemon going in the background all the time) and then the client tell the daemon to spawn a new window to open the files mentioned in the command-line arguments. The "nohup" part deparents the server so you don't get error messages hitting your console.

Hal Canary | Computers & Code | 2010-11-07 13:36:36 UTC
Permanent Link | Comments Off

« Previous Entries | Next Entries »

Copyright 1997-2011 by Hal Canary.
mailto: h3 at halcanary dot org
http://halcanary.org