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

Archive for 2011-06

TN 2011-06

2011-06-25_132516_dscn0725_scale

2011-06-25_234848_dscn0741_scaled

2011-06-25_232412_dscn0739_scaled

2011-06-24_212440_dscn0718_scale

Hal Canary | Life, Photos | 2011-06-26 00:00:14 UTC
Permanent Link |
Comments Off (but feel free to email)

change-epub-formatting.py

#!/usr/bin/python
#DTPD#
import subprocess
import os.path
import sys
import glob

def fixfile(in_file_name):
  ebookconvert = r'C:\PROGRA~2\Calibre2\ebook-convert.exe'
  #ebookconvert = '/usr/bin/ebook-convert'
  base = os.path.basename(in_file_name)
  dirn = os.path.dirname(in_file_name)
  newdir = 'myformat'
  try:
    os.mkdir(os.path.join(dirn, newdir))
  except OSError:
    pass
  out_file_name = os.path.join(dirn, newdir, base)

  cmd = [ebookconvert, in_file_name, out_file_name,
    '--preserve-cover-aspect-ratio',
    '--change-justification', 'left',
    '--margin-bottom', '4',
    '--margin-left', '4',
    '--margin-right', '4',
    '--margin-top', '4',
    '--remove-paragraph-spacing']
  print ' '.join(cmd), '\n'
  sproc = subprocess.Popen(cmd)
  sproc.wait()

if __name__ == '__main__':
  for arg in sys.argv[1:]:
    for filen in glob.glob(arg):
      fixfile(filen)
  exit(0)

Hal Canary | Books, Computers & Code | 2011-06-24 15:28:54 UTC
Permanent Link |
Comments Off (but feel free to email)

scrabble.sh

#!/bin/sh
#DTPD#
DICT=/usr/share/dict/words
test "$1" || { cat "$0"; exit 1; }
exec grep -i "$@" "$DICT" | less
#
# Useage:
#   scrabble.sh PATTERN
# Example:
#   scrabble.sh '^a[lonrchl]\{4,7\}$'

Hal Canary | Computers & Code | 2011-06-21 06:27:46 UTC
Permanent Link |
Comments Off (but feel free to email)

Permutation

I’m reading Permutation City. Why had nobody sat me down and made me read this before now?

Hal Canary | Books | 2011-06-08 20:43:22 UTC
Permanent Link |
Comments Off (but feel free to email)

Copyright 1997-2012 by Hal Canary.
mailto: halcanary at gmail dot com
http://halcanary.org