Comments reenabled

June 1st, 2008

So after only a year and two months, comments are finally reenabled here. I’m now using Akismet and Bad Behavior for spam blocking. Hopefully, it will work out well enough to leave it open (I didn’t like having to skim through 200 spams a day to find the on average 0 actual comments there).

Wikipedia is supposed to make it EASIER to slack off, right?

April 13th, 2008

So I have a paper to research on coding theory (error correcting codes and the like) and I’ve been reading wikipedia pages for a few hours. I go to get a mint and decide it’s time to take a short break while I play around with the circular mints, trying to pack as many into one layer of the container as possible. As I read the wikipedia page on sphere packing, I come across

Sphere packing on the corners of a hypercube (with the spheres defined by Hamming distance) corresponds to designing error-correcting codes: if the spheres have radius d, then their centers are codewords of a d-error-correcting code. Lattice packings correspond to linear codes. There are other, subtler relationships between Euclidean sphere packing and error-correcting codes; thus, the binary Golay code is closely related to the 24-dimensional Leech lattice.

Grr. Stupid wikipedia, I was trying to slack off. >:o

Automatic updates

October 25th, 2007

This has got to be one of the coolest things I’ve ever seen about Mozilla as a platform.

Software Update - Sunbird

Grey Text Considered Harmful (to your eyes)

September 8th, 2007

Dear everyone,

Please do not use grey text on a white background. Use black. Grey is harder to read, causes more strain on the eyes, and makes me less likely to read what you say. Really. I recently realized that one weblog I used to read a lot I wasn’t liking nearly as much recently, not because the content was worse, but because it was actually more work to read and that made it not worth it.

So don’t do it. Please. Or I’ll just stop reading your stuff (maybe not even consciously).

And yes, I am aware that this blog uses it, by virtue of the default wordpress theme. I only just realized that, and am fixing it now.

Edit: So a wordpress update broke this for a few days. Fixed now.

Today I learned (2007-08-25)

August 25th, 2007

Today I learned that sort -R (random) will place two (or more) identical lines together in the output, even though the order will change each time it’s run (even with identical input). I wonder how they do this. Maybe they put everything in a hash, but with a random salt?

Getting rid of “Clear scrollback” in Pidgin (changing keybindings in GTK applications)

August 1st, 2007

For some reason, Ctrl+L in Pidgin is “Clear scrollback”, which is something I almost never want to do, whereas Ctrl+L in Firefox is the incredibly useful “Focus location bar”, the type of thing I hit hundreds of times per day. Obviously, this leads to a problem: I clear my pidgin window accidentally over and over again.

Luckily, the answer for how to fix this was in the pidgin FAQ—not this problem in particular, but changing keybindings in general. Just open up gconf-editor (Applications -> System Tools -> Configuration Editor from gnome, or gconf-editor from the command line) and set /desktop/gnome/interface/can_change_accels to true, then hover over the menu item you want to change the keybinding of and type what you want it to change to. I couldn’t figure out how to make it blank that way, but if you type one that already exists, that one gets overwritten, so I just changed “clear scrollback” to ctrl-f (which was Find) and then changed Find back to that and clear scrollback was cleared.

So problem solved. It was pretty darn easy for me, although I wonder how easily other people could have found the solution. In any case, the best solution would be to have it removed for everyone, so I’m going to report it and hope they agree it’s unneeded.

comic?

June 12th, 2007

I have never learned so much from, and only rarely been as entertained by, a webcomic as I am by Dresden Codak. I recommend it to anyone who doesn’t mind the fact that they will understand only about 10% of what’s going on.

Making Baldur’s Gate II run in a non-admin account on Windows

May 26th, 2007

Today I had the fun experience of dealing with Windows, and the also-fun experience of dealing with poorly-written Windows programs.

The reason for this, and the reason I didn’t just say “not my problem” and give up, was that I wanted to play Baldur’s Gate II. Specifically, I wanted to play it multiplayer, and my dad only lets my siblings use his computer under a limited account (the right thing to do), so I had to find a way to make it play. Installing could be done under an admin account, of course, but playing had to be done under a limited.

This is where the poorly-written bit became a problem. You see, Baldur’s Gate II, like about 97% of windows programs, violates the standards of what things go where in windows. This of course was not a surprise to me, just an annoyance. So I was determined to find a way around it.

The first, most obvious problem, was that it needed to write to files in the program files directory (like, e.g., save files. They’re not supposed to go there! They’re supposed to go in the Application Data folder in the user’s account! I’m not even a windows developer user and I know that!), which limited accounts aren’t allowed to do. Easy fix: Change the permissions on all those files to let anyone write to them. Roadblock to the easy fix: XP home doesn’t have the advanced security tab that lets you control the access control lists. Doh. So with about 10 minutes searching online, I finally found out about the cacls command, which can be run from the command line even in home edition. I got the funness of finding out by trial and error that without the /E switch, it will remove the entire list when you do /P, even though it says it’ll “replace the user’s” permissions. Luckily I’d listed them all out before and still had them on screen. Final command for that: cd installdir; cacls “BGII - SoA” /T /E /P Users:F

Then, it still didn’t run. When you started up the game in the limited account, it still, for some reason, thought it needed to be installed. I had thought (from reading support things on the official website) that making baldur.ini writable would fix that, but I was wrong. So: It must be a registry issue. Long story short, because I’m getting tired of writing about Windows: It was. /HKLM/SOFTWARE/Microsoft/Currentversion/App Paths/BG2Main.exe was readable by the limited user, but apparently, no, it needed to be writable as well, because the programmers were stupid and used the wrong registry call. (Thanks to regmon for helping me find that out). Fix: go in as admin, right click on that key, and there’s some properties that let you make it writable by all. Problem fixed, everything works now.

This all is just one of the many reasons I hate windows.

piping standard error

May 16th, 2007

I’ve often wished I could pipe only standard error to a command, leaving standard out to display on the screen as is. One place this would be useful, the one that finally got me to act, is to make compiler warnings show up in a different color, to make them more noticeable.

I decided grep ".*" would work quite well for coloring things, since I have --color=AUTO on by default. The problem, though, was how could I get standard error to go to grep instead of standard out? (I have green text on a black background, and grep turns what it matches red. If I piped standard out to grep ".*", I’d get red text with green errors, and that’s just backwards :P)

The internet wasn’t very helpful. It gave me a bunch of things halfway there, like redirecting standard error to standard out, and even saving standard out as a file and redirecting standard error to standard out and piping that, but I wanted standard error to stay standard error, standard out to stay standard out, and them both displayed on screen like normal, only with stderr having been run through a command.

So, of course, I had to do it myself.

Here’s what I came up with: (command 2>&1 1>&3 | grep “.*” 1>&2) 3>&1

So how’s this work? Well, first stdout (file handle 1) is redirected to file handle 3. Yes, that’s first. Apparently they’re evaluated in backwards order. Took me a while to figure that out. Then stderr (file handle 2) is redirected to stdout (file handle 1). Then it’s piped to grep (or whatever command you want, I could see useful things being done with sed here) and the output sent back to stderr, and then finally file handle 3, the original stdout, is sent back to stdout.

I hope someone finds this useful. I know I will!

Sentences

May 9th, 2007

Dear internets:

Is it possible to make a sentence using only onomatopoeia?

Thank you,

–dolphinling

Linux TP down 10%!

May 9th, 2007

Thank you, bug 375760:

And a big thank you to roc for writing that patch, and vlad for reviewing it too!

Comments closed (hopefully temporarily)

April 3rd, 2007

I was getting about 200 spams a day to this blog, so I’ve turned comments off, hopefully temporarily. Sometime when I have more time, I’ll get a better solution in place (I’m out of school in a month, so probably then).

What distro to install on my laptop?

March 23rd, 2007

I recently got a new* laptop that I’d like to put linux on. I already run a gentoo box that I’ve had no problems with, but I’d like to try something different so I can get more experience. Current thoughts include some random other stock distro, some random other stock distro that runs KDE or XFCE, something running SELinux, or trying out OLPC’s Sugar interface (though that would probably be impossible).

Does anyone have any recommendations, from that list or otherwise? Keep in mind this is entirely to be used as a learning experience, so I can put as much work as I need into it. The only criteria is that it should be something I’ll find useful in the future.

* Not new, but new-to-me. Exactly how not new? It has a sticker on it that says “Designed for Windows 95″.

*giggle*

February 16th, 2007

Average weight of human lungs: 234 g

Average capacity of human lungs: ~6000 cm^3

Density of air: 1.293 g/L

Density of helium: 0.1786 g/L

Weight difference of 6L of air and 6L of helium: 6.686 g

Verdict: No, human lungs will not float if you fill them with helium. :-(

Crash

February 2nd, 2007

So apparently, no, my body cannot handle giving blood and playing laser tag in the same day. Or it can, it just doesn’t like to.

Reflow Branch!

December 13th, 2006

Woooooooooooooo Reflow Branch!

(Proof dbaron is awesome: I didn’t even notice for 6 days.)

Describing thought?

November 26th, 2006

How do children learn to understand what thinking is, what the word “mind” means? Because I was just thinking about it, and I realized I could not adequately explain either. I know what they are for myself (in that I know when I am thinking, not that I actually know how thinking works), but I’d have no way of explaining what they are nor anything to point to, like I could describe a chair or point to the color blue.

So how do we learn what thoughts are?

Math and Haiku

November 20th, 2006

A book about haiku I’m reading for school says that haiku is different from other forms of written art because while other forms have to be read through, and the experience is gradually built up, haiku is short enough that it can be experienced instantaneously. It does take a few moments to read it, but where with an eight or even four line poem you get one half and then the next, with a haiku you read the entire thing, then the seeing it comes all at once.

I realized today that math gives you both the gradual, drawn out experience of a longer poem or novel and the instant experience of a haiku at once. A proof may take a while to go through, building up step by step, but when you’re left with, say, aⁿ + bⁿ ≠ cⁿ, you have that same instantaneous understanding as with a haiku.

Math is so beautiful.

Ogg Flac

November 14th, 2006

Whee! Both mplayer and gstreamer (which rhythmbox uses) both had their ogg flac decoding bugs fixed recently, and it should be fixed in the next release of both. I can finally stop decoding my music to wav before playing it!

Thank you, OED

November 13th, 2006

So today I was looking through my firefox search bar’s history, and along with things like “how to raise your iq by eating gifted children” (it’s a book apparently) and “fraught with all manner of spiky-haired cute things” (no results, this page will be the first), I found ‘quercivorous nepheliad’.

And of course, I immediately recognized what I was doing when I searched for that: “Hey, it’s a googlewhack! I wonder if it still works.”

So I tried it, and it almost worked, except the passage it was written in had been quoted a bunch of times. But I also noticed that google suggested “quercivorus” instead of “quercivorous”.

Obvious choice of action, test it out and see which one gets more search results. Which I do, and see quercivorus gets 500 results, and quercivorous gets 15300. And wow! My blog is at the top of the results for quercivorous! That’s awesome! But wait… these look like mostly just word lists… the results for quercivorus looked a lot more scholarly… yeah, they do. And oh… 15100ish of the 15300 are all one site.

GAAH. I misspelled my own favorite word, and it’s at the top of google’s results for it to boot.

So I went and edited my post. Made a note about my misspelling it, and corrected the spelling for the future, in hopes of google putting me back high in the rankings for the right spelling.

But just before submitting, I thought to myself “I wish I had my OED, so I could check what it says.” Of course, I don’t, because no one brings their OED to college with them, at least, not anyone studying computer science.

But maybe the library has one. So I walk over there, and yes, it does! And then I look it up… And it says I was right all along! It really is spelled quercivorous! Yes!

A bit more research shows that there are 4 species (probably of insect) named Something quercivorus. Removing those, there are practically no results. I cancel the edit to my old post and write this one.

The moral of the story: The OED may not know everything. But in its niche, it’s smarter than even google.


Bad Behavior has blocked 236 access attempts in the last 7 days.