Unicode table in EMACS

Unicode table in EMACS

Motivation

Often when writing, I need to insert the degrees sign – for instance 25.3°C. Since it is not on my keyboard, I used to look it up on wikipedia.

Later I found some elisp code for dumping an ASCII table, but I still used valuable seconds looking for the sign. This made me discover the get-char-code-property function which adds a description. Now I could just do an I-search for “deg” and I would get to my invaluable degree-sign character.

But now I wanted the whole thing: the entire unicode table…

To the Point

;; show Unicode table
;; inspired by http://www.chrislott.org/geek/emacs/dotemacs.html
(defun unicode-table ()
  "Print the utf16 table. Based on a defun by Alex Schroeder <asc@bsiag.com>"
  (interactive)
  (switch-to-buffer "*Unicode Table*")
  (erase-buffer)
  (insert (format "Unicode characters:\n"))

  ;; Generate list of all unicode code points
  ;; See http://en.wikipedia.org/wiki/Unicode_plane#Overview
  (setq code-points (append (number-sequence  ?\x0000  ?\xffff)
                               (number-sequence ?\x10000 ?\x1ffff)
                               (number-sequence ?\x20000 ?\x2ffff)
                               (number-sequence ?\xe0000 ?\xeffff)))

  ;; Iterate code points
  (dolist (code-point code-points)
                      ;; Get description from emacs internals
                      (let ((description (get-char-code-property code-point
                                                                 'name)))
                        ;; Insert code-point, character and description
                        (insert (format "%4d 0x%02X %c %s\n"
                                        code-point
                                        code-point
                                        code-point
                                        description))))
  ;; Jump to beginning of buffer
  (beginning-of-buffer))

Calling this function with M-x unicode-table reveals

Unicode characters:
 0 0x00 ^@ <control>
 1 0x01  <control>
 2 0x02  <control>
 3 0x03  <control>
 4 0x04  <control>
 5 0x05  <control>
 6 0x06  <control>
 7 0x07  <control>
 8 0x08  <control>
 9 0x09 <control>
 10 0x0A
 <control>
 11 0x0B  <control>
 12 0x0C  <control>

I hope that this is useful. If you like it, feel free to leave a comment.

Update me when site is updated
Share and Enjoy: These icons link to social bookmarking sites where readers can share and discover new web pages.
  • Digg
  • del.icio.us
  • StumbleUpon
  • Reddit
  • Facebook
  • Google Bookmarks
  • LinkedIn

Linkstation on Linux

Linkstation on Linux

I got myself a Buffalo Linkstation (NAS) and got some Linux experiences with it the tough way. Especially I’ve had my share of learning, man’ing when trying to mount this beast. So I hope that sharing this will help somebody getting an easy experience.

This is based on a live Ubuntu 10.04. Linux is not officially supported by Buffalo and what you do is on your own risk.

Prerequisites

To be able to mount, you need the smbfs package as it contains mount.cifs:

sudo apt-get install smbfs

Mounting Linkstation

We need to ensure that some important things are in place when mounting

The IP address is 192.168.1.36 and the shared directory is “share”

First argument is

//192.168.1.36/share

. Remember the leading double slash or it will fail.

We would like to mount at /media/linkstation
Second argument is

/media/linkstation

. Remember to create the directory.

The charset must be correct. Otherwise, “Røde Mor” becomes “R├╕de Mor”
use options

iocharset=utf8,codepage=cp437

. Don’t ask me why, but I guess that it has something to do with the codepage that Windows uses

The user/group must match be “ubuntu” (default is root)
use options

uid=999,gid=999

. “999″ is looked up in

/etc/passwd

.

Linkstation shall use the guest account and avoid password
option

guest

now, the full command line becomes

<span style="background-color: #ff99cc">sudo mount.cifs //192.168.1.36/share /media/linkstation -oguest,uid=999,gid=999,iocharset=utf8,codepage=cp437</span>

Remember the -o or the options will be silently ignored :pinch:

Now, the Linkstation is nicely mounted and the file names are encoded correctly. To unmount, simply type

sudo unmount /media/linkstation

Happy Linkstation’ing!

Update me when site is updated
Share and Enjoy: These icons link to social bookmarking sites where readers can share and discover new web pages.
  • Digg
  • del.icio.us
  • StumbleUpon
  • Reddit
  • Facebook
  • Google Bookmarks
  • LinkedIn

Tykke Amerikanske Pandekager

Tykke Amerikanske Pandekager

Der er intet så lækkert som tykke amerikanske pandekager. De er gode både til morgenmad og som dessert. Her er min opskrift som har lykkedes to gange indtil videre og vil blive brugt mange gange i fremtiden.

Ingredienser

(2 portioner)

2-4 æg

1 kop kærnemælk

2 spsk olie

1 kop hvedemel

1 spsk sukker

½ tsk salt

1½ tsk bagepulver

½-1 tsk kardemomme

Fremgangsmåde

De tørre ingredienser sigtes sammen. Æg, olie og kærnemælk blandes med håndmixer eller piskeris og resten tilsættes lidt efter lidt.

Bages på panden i den størrelse man foretrækker.

Det bliver ikke mere simpelt.

Variationer

Revede æbler, chokoladestykker eller guldkorn. Kun fantasien sætter grænser.

På denne side: http://mrbreakfast.com/recipe_collection.asp?subcategoryid=4, flyder det med spændende pandekagevariationer bla. 7-up, kokos, bær og frugter, vegetar/veganer som jeg skal have prøvet de næste par måneder.

Update me when site is updated
Share and Enjoy: These icons link to social bookmarking sites where readers can share and discover new web pages.
  • Digg
  • del.icio.us
  • StumbleUpon
  • Reddit
  • Facebook
  • Google Bookmarks
  • LinkedIn

Subwoofer Project

Subwoofer Project

This post will be updated as I decide on the different aspects.

I’ve decided to build a subwoofer + amp for my old, rusty, trustworthy Felicia. This is how my brainstorm has ended up so far:

TDA1562 based amp

Like http://www.stardi.com/diy-12-volt-chip-amp-70-watts-car-power-amplifier/

Requires ~12V and provides 70W music power into 4Ω.

I considered building a class D amplifier, but learned that class D requires a switch mode power supply in order to provide mentionable power. During my research, I continously stumbled upon Phillips TDA1562 which operates as a combination of class-AB and class-H depending on temperature, allowing it to deliver up to 70W depending on supply voltage and die temperature.

The basic TDA1562 setup requires only a small number of passives: some capacitors for the power supply, two giant capacitors for the class-H operation and a couple of other passives.

Speaker Unit(s)

To be decided.

Should look mean, but sound good and be not-too-pricey.

Speaker Box

Should be covered with.
  • Tweed and round headed nails + alu/metal dashboard (a’la 60′s guitar amp)
  • Cotton filling + fake leather + sofa buttons
  • Fake fur
  • Tartan
  • Hessian
  • Fake leopard
  • Latex
  • Varnish
  • Lace or cutwork
  • Wood laminate

Decoration/status LEDs (under cloth?)

  • Skull
  • Smiley
  • VU
  • Status/Clip
  • Foot tapping guy
Dimensions
To be decided – depends on speaker
Size
To be decided- depends on speaker

Shape/type

To be decided- depends on speaker

Update me when site is updated
Share and Enjoy: These icons link to social bookmarking sites where readers can share and discover new web pages.
  • Digg
  • del.icio.us
  • StumbleUpon
  • Reddit
  • Facebook
  • Google Bookmarks
  • LinkedIn