Mar. 5th, 2013

elfs: (Default)

I have a bad habit.  I leave the music playing on my desktop all the time.  My wife shares the office, and she’s a professional podcaster, so this habit does not please her in the least.  Fortunately, I have found a technological solution.


This solution is for Linux and Audacity.  You may be able to adapt it to other music programs, but as it exploits a feature of X Windows, using it on non-X distros might be tricky.  The secret is to exploit the X-MIT-SCREEN-SAVER hook in X.  This is the published X atom to notify various listening programs when the mouse and keyboard have been idle for a set amount of time, which, as you might imagine, is pretty useful for the screensaver.  But the value is published locally to any subscribed program being run by the current user, and there’s a command-line tool that allows you to run any arbitrary program after a given period of time, xidle.


Xidle is simple, but it needs help.  If you just put audacious into its command line, it’ll start audacious when you’re not listening to it.  That’s not good.  So you need a script:


#!/bin/bash
PIDS=`/bin/ps cax | /bin/grep audacious | /bin/grep -o '^[ ]*[0-9]*'`
if [ -n "$PIDS" ]; then
    /usr/bin/audacious -u > /dev/null 2>&1
fi

I named this “audi-pip,” so it wouldn’t conflict with the grep string. Make sure to chmod it to 0755 so it’ll run. Then configure xidle:


xidle -program /home/<you>/bin/audi-pip -timeout 300

If you’re really old-school, like me, you could put this line above your window manager in .xinitrc, but don’t forget to put an & at the end. Now, if you’re idle for more than five minutes and you’ve left audacious running, it will be paused. And audacious is pretty smart; it’ll automatically restart when you un-idle.

elfs: (Default)

Tag this under The Ghost of Done.” These are projects that, for one reason or another, will never get done because my skillset has drifted so far away from the skills necessary to produce them that I’m unlikely to have the time, bandwidth, or skillset necessary to go back and revisit them.


TOXIC


“Terabytes Of XML, Indexed & Compressed.” I almost got hired for this idea alone, once upon a time, but sadly I was working already and had no desire to move to Boston. TOXIC is a simple idea: Very large stores of text, like those used for publishing corporations, libraries, governments and the like, live in gigantic SGML and XML databases.  There exists a known set of tools for indexing large corpora of texts, and the most common is to use Huffman compression on both an index of terms and their location in the library.  The idea is that pulling the index off-disk and decompressing it, caching the result as needed, is faster than pulling an already uncompressed index off disk.  Likewise, because Huffman encoding can be resumed at arbitrary points in a compressed library, it’s faster to seek to a known compression point, uncompressing the block there, and seeking for the indexed term.  What I wanted was to sandwich a second index between the first and the corpus, with an equally compressed representation of the XPaths to desired sections of the corpora.  It’s such an obvious schtick that I’m surprised no one has done it for an open-source solution.


A C-Robots/Ogre-GEV world-conquering mashup.


I was a big Ogre-GEV fan way back in the day, and I enjoyed the Rivets parody as well.  What I wanted was a web-capable version of the game that could be played multi-player, but could also be run automatically, C-Robots style, with the programming language being something sensible and accessible, like Python or Javascript.  Sadly, when I concocted this cockamamie plan, it was only the late 90′s, and nobody had the bandwidth or browser capabilities to make it happen.  Since then, the browser has the power, but I don’t.


A painfully cute first-person shooter


One of my stories involves a sentient doll, only 30cms tall, who starts out as the companion to a little girl on a planet where the infrastructure experiences a massive and complete systemic breakdown. The doll, the last artificial intelligence on the planet, has to fight her way through bugs, mice, rats and nastier things in her goal of saving her person and restarting her planet’s infrastructure. I wanted to write a first-person shooter on the same theme, but lacked the skills or time at the time. I wanted her to have the squeaky voice of an anime character, to be dressed in pink and frills, and to show how that costume became more and more ragged and dirty, as she grew into her role. There’s a similar PS/2 game, although it’s third-person and poorly done, Hoi-Hoi San, and it was never released in the US. I wanted something good.


A Seam-Carving tool for PAM


Seam-Carving, also known as “content-aware resizing,” is the algorithmic reduction of an image by creating maps, either horizontal or vertical, describing paths from top-to-bottom or left-to-right, in which, for each path, the neighboring pixel differential is added up into an overlain entropy map, and then the path with the lowest entropy is removed. This is done systematically until the image has been cropped down to the desired size, with the pixels that represent the least amount of information loss being removed and the seam smoothed over. While it’s not perfect, as you can see in the wikipedia example, it might be useful in a number of settings. I still use the Portable Anymap programs on a regular basis, and adding seam-carving to the manipulations would be a useful addition.

Profile

elfs: (Default)
Elf Sternberg

May 2025

S M T W T F S
    123
45678910
111213141516 17
18192021222324
25262728293031

Most Popular Tags

Style Credit

Expand Cut Tags

No cut tags
Page generated Jun. 8th, 2025 06:55 am
Powered by Dreamwidth Studios