Many random notes (some for my own reference), each of which is too short to warrant a full blog post:
Emacs
It had always bothered me, just a little, that C-v and M-v, in addition to scrolling, move the cursor to the bottom or top of the screen. This has the odd effect that C-v M-v is not a no-op. Turns out that setting the variable scroll-preserve-screen-position appropriately can fix this. (via emacs-devel)
Chrome
- Have you ever wondered why running Firefox instances get broken when new versions are installed? On GNU/Linux systems the package manager, which runs as root, pays no mind to what non-root users are doing. Some apps, like Firefox, run into major trouble because they'll load additional files after startup that can't be mixed and matched with the previous versions (this isn't really a problem for programs that are essentially just one binary). Chrome acquires immunity to this with its Zygote mode, which basically means do not load anything from disk after startup. A simple idea, but it takes some work to follow through with it.
- Among visitors to this blog, Chrome is the second most popular browser, with a 9.5% share! Chrome leads IE (6.6%), Safari (5.9%), and Opera (4.3%), and trails only Firefox (72.6%). You can sort of see what a non-representative sample of web users happens across this blog.
Unix/Ubuntu
-
Soundconverter (aptitude install soundconverter) is a handy GTK/GNOME program for converting (transcoding) audio between formats. It is easy to use, transfers all the music metadata, and seems to take full advantage of multicore processors. (I use it to downsample my music, mostly in FLAC, to Ogg or MP3 for use on portable devices.)
-
When using find with xargs, xargs will get tripped up by filenames with spaces (it will treat each space-delimited component as a different argument). You can get around this by changing the delimiter in both find and xargs to \0 instead of space, as follows:
find . -iname '*.tmp' -print0 | xargs -0 rm
You can usually achieve the same effect with find ... -exec but I can never remember how to use it.
HTML, HTML5
Some things I picked up while working on Zeya:
HTML5 audio/video APIs as implemented in Firefox. The audio/video APIs provide nearly all the features you'd need for a music player. Just add chrome!
One cool feature in HTML5 that you may not have heard of (because it's not quite as earth-shattering as video, canvas, or local storage) is "placeholder text" for text boxes.
(The text goes away when you focus the input and/or type something in it.)
It's a feature that (I assume, at least) people have been using Javascript hacks to implement for a long time.
The 'find' command has also an option just for the purpose of deleting files:
ReplyDeletefind -iname '*.tmp' -delete
setting the variable scroll-preserve-screen-position appropriately can fix this.
ReplyDeleteOh thank you thank you thank you!!!
@mmassonnet: thanks! I *really* should invest some time familiarizing myself with what 'find' can do.
ReplyDeleteBTW have you noticed that ctrl-L behaves differently in Emacs 23? Calling it once puts you in the middle of the screen, as before, but subsequent calls cycle you through top and bottom.
ReplyDelete@Allen: yes. In 23, C-l was mapped to 'recenter-top-bottom. Previously it was bound to 'recenter, if you wish to restore the old behavior.
ReplyDelete