Saturday, March 31, 2007

iPod DJ

If the iPod could do two outputs, it would be a great DJ device. Crossfade with wheel.

RGB Color Cube

Consider the a path along the surface, i.e., faces of the RGB color cube. That is, on every point on the path at least one component is either 0 or 255.

Let a path be a function of position with respect to time. Define a path on the surface of a RGB color cube, i.e., saturated colors, whose brightness, defined as a certain linear combination of the color components, increases constantly as a function of time. Let the path start at the black corner, spiral around the surface of the cube, and end at the white corner.

Deconstructing God

What if Intelligent Designers reveal themselves to us as engineers and scientists? They communicate with us proving who they are by showing us how to design and create a Universe, an experiment that we replicate to verify their claim. The Intelligent Designers may have the powers of omniscience, omnipotence, and prophecy for us because they can view and manipulate our Universe as a whole. But they do not have something else that people look to God for: a "higher" moral or ethical authority.

Window managers

GUIs see contention for 3 resources: screen area, especially with things that want to always remain visible, places to click based on Fitts Law, and input events, like keyboard and mouse. It could include sound and microphone. It could be generalized to simply input and output bandwidth.

I would like to see a window manager that worked in modes like vi. In one mode, keystrokes and other input events are sent to the application with focus, in another they are sent to the window manager.

Friday, March 30, 2007

Paravirtualization

Paravirtualization (Xen) is truly a wonderful example of open source. The x86 ISA being hard to virtualize, we think outside the box and implement a simpler ISA for the VM and recompile the kernel to it. Good thing Linux and GCC are open source.

Compressed matter

Are there interesting states of matter between neutron degeneracy and when it disappears beyond the event horizon?

Thursday, March 29, 2007

5

Must a singularity exist within a black hole? Perhaps a 5th force only at short distances stops it inside the event horizon.

Sunday, March 25, 2007

gs and netpbm

gs -sDEVICE=ppmraw -sOutputFile=- -r1720x1720 -dNOPAUSE -q -dBATCH MBTA-system_map-back.pdf | pnmdepth 65535 | pnmscale 0.5 | pnmgamma 0.5 | pnmdepth 255 | gzip >| f.gz &

gs

Got bits of this command line from pstopnm -verbose and generally do better to call gs directly than use pstopnm. pstopnm was doing some weird "translate" that made the image get clipped wrong. I suspect sign error.

Looking at gs with top, it only uses about 14 megabytes of memory even for creating very large images. This suggests it is allocating a small buffer "window", rendering to that window, emitting it, and sliding the window down, making another pass. There seems no way to make the window larger if you have memory to spare and want better performance.

Such a windowed output has the possibility of some computer-graphics tricks where the PDF is parsed into a range tree so that only the parts that are going to be in that window will be rendered.

-sDEVICE=ppmraw

You can also use png16m. ("16 million" or 24-bit color.) But pngtopnm has a bug that it tries to render the entire image at once and runs out of memory. If the png is not interlaced, it should do rows. If it is interlaced, it should buffer the compressed data in memory, create an index (possibly including zlib state) of the beginnings of each sub-image and each row in each sub-image, and then render row-by-row.

-sOutputFile=-

gs is broken for large files, so emitting a file greater than 2Gb breaks. If this happens from within pstopnm, it dies with a horribly useless error (signal #foo), but invoking gs directly gets you an error message like "file size limit exceeded". Use the png16m option above, or pipe to stdout. My shell (bash) does handle large file pipes ok (old versions of tcsh did not). Note that piping to stdout won't work quite so easily for multi-page documents.

-r1720x1720

Specify the resolution directly, rather than the output image size. I don't know if this accepts decimal points, though it ought to.

-dNOPAUSE

Don't pause at the end of the page (reading stdin).

-q

Don't emit gs introductory text. It would be bad if this got prepended to stdout.

-dBATCH

Without this option, gs gives you the "GS>" prompt at the end (which gets written to stdout), and waits for user input, e.g., quit. This option makes it quit automtically after the last page.

MBTA-system_map-back.pdf

Hey look! gs can take as input pdfs, letting you skip the sketchy pdf to ps (postscript) conversion.

| pnmdepth 65535 | pnmscale 0.5 | pnmgamma 0.5 | pnmdepth 255

Fine black-on-white detail (text) gets shaded down to grey when an image is shrunk, so change the gamma to compensate. In hopes of not losing color, we increase the depth to 16-bits during the operation.

There ought to be an pnmdepth option to do dithering.

There's a bug in pnmscalefixed: "pnmscalefixed: object too large"

| gzip > f.gz

Use gzip to prevent the uncompressed data from ever hitting disk. Disk I/O is kind of slow, and especially O (Output) slow with journaling (ext3). zcat is the opposite of gzip.

In other news, pnmcrop should have a two-pass operation where it gives output the coordinates you can feed to pnmcut. This way it does not have to buffer in memory when cropping left and right.

pnmcut (or another tool) should have a way of cutting out many rectangles all at once, say breaking an image into a 100x100 tiling.

pnmcut should exit after it's emitted the last output; no need to read the rest of the input (this might be fixed).

Friday, March 23, 2007

Chords

There are 100 good three finger chords.

Tuesday, March 20, 2007

Automatic parallelization

Automatic parallelization of purely functional code is simply the problem of predicting what to speculatively start evaluating while the main sequential evaluation is going on. This prediction can be done by programmer-specified directives, theorem-proving, machine learning, and profile/trace analysis of a previous run. The prediction may be done at compile time or just-in-time with a runtime interpreter.

Even stateful code may be treated similarly if we have good knowledge of who reads and writes which components of state (the good ol' scheduling problem).

Saturday, March 17, 2007

New Mexico's Pluto

New Mexico's proposed legislation that Pluto is a planet when in New Mexico's skies raises an interesting question in astro-geography. By extending New Mexico's borders vertically into outer space, when, if ever, is Pluto in New Mexico's airspace? The plane of the ecliptic suggests never, but Pluto's orbit is inclined, so perhaps. One could create a chart of which celestial bodies are "owned" by which country or state at any given point in time.

The International Astronomical Union, against whom New Mexico's legislation is directly at odds, nevertheless did not disapprove the legislation in a very enlightened way, stating that any public debate on Pluto's status increases public interest and study of astronomy. It's as if mathematicians came out in support of legislation defining the value of pi in Indiana to be 4.

Speculation on unknowns

Here is a way to use all those extra cores for program understanding. If the a function argument is given the pseudo-value DontKnow as an argument, we can try to determine that the value of the function does not depend on that parameter. There are three ways: static analysis, dynamic tagging of the parameter to see if it is ever read, and speculative execution. Speculative execution works only for pure functions on finite enumerable types, hopefully something small like Boolean. A separate thread is spawned for each possible value of the DontKnow argument, and the results are compared for equality. This becomes tricky for higher order functions. Lazy evaluation sometimes lessens the computational load.

This is an application of parallel processing not to increase performance, but to aid a programmer who might be working with unfamiliar difficult to understand code.

Static analysis can be done at compile time, but can also be done just-in-time when the values of the regular known parameters are known. It, too, may be an extra thread.

Friday, March 16, 2007

Wind

Is a gust of wind like an electron or a hole? Do people upwind or downwind feel it first?

Thursday, March 15, 2007

Chess interface

A chess GUI intended for beginners that helps you do 1-ply move and null move analysis. The board display always color codes attacked and undefended pieces. (Arena does this.) Scroll through a listing trying all your possible moves on a position seeing color coding change, and annotating some moves for further study. Similarly scroll through all possible opponent moves if you were to pass.

Compact Disc

A CD-ROM holds roughly 5 billion bits, 100,000 pages of
text (80 characters 65 lines), 100 hours of speech
aggressively compressed, 10 hours of music.

Wednesday, March 14, 2007

Journaling directories instead of partitions

I wish filesystem journaling could be turned off (say, for /tmp) at the directory level instead of having to choose an entire partition. I don't want to choose how large to make /tmp, let it grow or shrink as needed.

Ditto for directory-level tuning of other filesystem performance parameters.

Update: LVM gets me most of what I want.

Monday, March 12, 2007

things broken about emacs

Word wrap a long line (currently only does character wrap)

Modeline editing is pain

Deep semantic tagging (IDE-like)

Saturday, March 10, 2007

Dewey Odhner's spidrweb fractal

See more of Dewey Odhner's spidrweb fractal, a deep zoom of the Mandelbrot set.

spidrweb

Thursday, March 08, 2007

KVM for virtual machines

We need a little USB frob that looks and acts like a KVM,
with buttons to choose which machine you want your keyboard,
video, and mouse to talk to, but actually plugs into a
single machine and chooses which Virtual Machine it's
talking to.

Wednesday, March 07, 2007

Tuesday, March 06, 2007

Ocean server farm

I wonder if I could build a self-sustaining server farm in, on, or near the ocean. Let power be provided by wind or wave, and cooling provided by deep water. Hawaii and Guam are good deep water locations. The problem is wind power like Cape Wind wants shallow water.

Monday, March 05, 2007

font-lock haskell-mode

in XEmacs on qualified identifiers like Foo.bar with a period in them:

(warning/warning) Error caught in `font-lock-pre-idle-hook': (error No such face haskell-default-face)

or the minibuffer message: "Fontifying Baz.hs... aborted.aborted."

Here is a Patch.

also, don't forget to (require 'goto-addr)

ipv6 killer app: municpal Wi-fi

The "killer app" to bring about the widespread adoption of IPv6 is free municipal WiFi. Sure, you can have free wireless internet, and even your own unique IP address, but you have to speak IPv6.

Object-oriented programming deconstructed

Object-oriented programming is four things: an interface (that different class types can appear the same to a user via an interface, including that a more complex type can appear to be a simpler one), inheritance (code reuse through subclassing), function dispatch by type (many different classes might have a "run" method: the correct one is selected by the type of the object), and namespace control (managing what identifiers are visible where).

Dispatch by type has two components: static (type determined at compile time) and dynamic (at run time, the C++ idea of "virtual").

Sunday, March 04, 2007

paranoia.jpg (JPEG Image, 500x400 pixels)

paranoia.jpg (JPEG Image, 500x400 pixels)

this image can be (and ought to be, because of the apostrophe error) rerendered at practically any resolution, if lite-brite coordinates are known. The glow around the LEDs may be simulated with the PDE heat equation.

dabbrev-expand

How on earth did I code before emacs's dabbrev-expand function? I have even sometimes gone as far as to assign it to a key on the home row (k). Regular k is typed with C-qk.

One can do improve it in two ways: Given a string "abc", instead of search for the regexp /^abc.*/, one can search for /^a.*b.*c.*/ which will more rapidly narrow down among many symbols that begin with the same long prefix.

One can also search for symbols only in lexical scope. It looks challenging, though perhaps not so bad in a Lisp-like language that has been indented properly. The indentation hint is key when in the middle of development and the parentheses don't match properly yet.

less matches on a single line

The text-paging program "less" needs to be fixed so that it scrolls to different matches on a single very long line that may in fact wrap to longer than a page.