Main Page

From Bilbo's Rants And Humor

Jump to: navigation, search


Rants And Humor (I guess you might call it a blog)

You must realize that the computer has it in for you. The irrefutable proof of this is that the computer always does what you tell it to do.

—Unattributed fortune

Know your enemy and know yourself and you can fight a thousand battles without disaster. [...]

One hundred victories in one hundred battles is not the most skillful. Seizing the enemy without fighting is the most skillful. [...]

All warfare is based on deception.

—Sun Tzu

Computers aren't my thing. They're out to get us. I will know myself, know computers (the enemy), redesign (deceive) them, and thus seize victory without working (fighting).

This is where I rant. Everything here is Copyright Me, All Rights Reserved, so don't download any of it (oops too late, now they're out to get you).


Me

me.jpg

Don't email me or else I won't respond: bilbo@hobbiton.org

Other things I do:

Publications

Archive

Chronological Entries

VM Software

2010-03-30

Lately, I've drastically reduced the number of computers I own. There are a number of practical motivations. Every machine requires a certain amount of my personal resources (time and money). One machine doesn't require much, but when you have around 10, it's no longer trivial. Each additional machine means more electricity, more failures, more floor/rack space, more software upgrades, cabling, UPSs, blah blah blah. Sure it's fun to have a big "empire", but it requires resources. It's silly to unnecessarily sink personal unpaid time into tinkering with hardware and updating software; I'm better off learning a new skill that I'll get years of use out of, like another programming platform. Also, we moved 2000 miles to California, and fewer computers meant lower moving expenses. I also realized that my personal projects, such as this site, have only modest requirements and could therefore be hosted at little cost on VPS hosts, and making it easier to move into an apartment in California, and hopefully move again soon into a house. So I reduced my empire to a humble size, just two VPSs and three machines: my MacBook Pro, my FreeBSD workstation, and my Windows test sandbox. Now the Windows machine's motherboard is flaking out on me; it has to "warm up" before it'll POST. For as little as I use this Windows thing I'd hate to waste any money on it, and it sure would be nice to replace it with a VM, which brings us to today's topic.

I tried out a few VM packages. It takes a long time to evaluate a VM package, since you have to install Windows (a tedious hour by itself), then actually try to do a few things, so I'll pass on what I found here. I didn't try VMware; I simply found something I like before I got to it on my list. I tried Q, Parallels, and VirtualBox on MacOS, and here's what I found.

Q, a wrapper for QEMU isn't worth the download. It's easy enough to use, and has a nice "raw" feel that gives me confidence that what I'm experiencing is a close approximation to what a typical Windows user would experience. However, it is slow, even on my MacBook Pro with a Core 2 Duo. It's so slow I can't get any work done; by the time my program finishes loading, I've totally forgotten what I was testing, and my mind has long since wondered off pondering how I could mount solar panels on my motorhome with rigging to mount panels double or triple the width of the motorhome and fold them up for traveling and how much it would cost. Trying to read a DVD only resulted in errors.

Parallels has some pretty sweet features. It's the only one of the three I tested that could actually read DVDs. It takes even longer than QEMU to install Windows because it has to make massive changes to install its communication hooks for all its features, but once installed it runs very fast. However, I was able to port in the disk images from QEMU by using "qemu-img convert" to export an image format that Parallels can import. I like Parallels, but didn't feel like it fit my task. It has lots of bells and whistles I don't care about. If I wanted to actually integrate some Windows software into my Mac's environment for the purposes of "real" usage, it'd be great, but actually I want to test my software in as plain an environment as possible, and I don't want some tweak for Parallels changing how things work. It also costs money to use it after the 14th day, and $80 seemed a bit steep for my purposes.

VirtualBox was my final choice. Reading DVDs seemed to work, but had bizarre problems. Otherwise, it worked well. It's as fast as Parallels, both of which clearly make good use of hardware virtualization. Nothing crashed. It doesn't need to install any special drivers or modify Windows in any way; it just emulates hardware for which Windows XP bundled drivers.

Here are some concluding thoughts and observations. I didn't try 3D acceleration; it just isn't a tool that would help my tasks. I suspect Parallels would perform better for 3D acceleration since they seemed to make a big deal out of it. For network access, both Parallels and VirtualBox support both NAT with an emulated internal network and bridging a fake MAC address; a nice option to change depending on whether I'm on my home network. When bridging, both let me directly browse my Samba server on my separate FreeBSD machine, which I would expect, but SMB is so flakey it's worth mentioning. (I didn't test Q much, having quickly passed it up because of its abysmal speed.) I couldn't load the disk images from QEMU using VirtualBox; it wedged on boot, even with Safe Mode. A friend suggested I could try making a new hardware profile by booting back in QEMU, but I didn't monkey with it. I found one important caveat with VirtualBox. You can't just make a copy of a disk image and import it as a new VM. VirtualBox will throw some error about a clashing UUID. Apparently, each disk image has an embedded ID that must be unique. To work around this, use the command-line tool "VBoxManage clonehd", which is bundled with VirtualBox.

Having found these tools, I happily stuffed my old Windows machine in a dumpster.

Perl Gem, context confusion

2010-01-24

The output of this would surprise even many experienced Perl hackers.

#!/usr/bin/perl

use strict;
use warnings;

sub fn {
        my $one = 1;
        my $two = 2;
        my @three = ("a", "b", "c", "d");
        return $one, $two, @three;
}

my $scalar = fn();
print $scalar, "\n";

One reasonable guess at the output would be "1". Indeed if you add parenthesis as in "my ($scalar) = fn();", that is correct because assigning lists in list context matches up elements from left to right, discarding trailing values. A more experienced but also incorrect guess would be "d", the last element in the flattened list. Although it is true that in scalar context a list returns its last element, that does not mean the last element of the list is evaluated in list context. The output is actually "4". The last element of the list is an array (not a list), which is evaluated in scalar context, returning the number of elements in the array.

This is similar to how a function lacking an explicit return value returns the result of the last statement. Also the context of the return value is always determined by the caller, which can make the final statement in a function behave differently depending on the caller.

On a related pitfall, omitting the return statement in a function is a great way to obscure problems. This may allow a caller to rely on a value you didn't intend to expose by returning, thus breaking the caller's code when you rearrange the function without (intentionally) changing your API. Worse however, the final statement of your function may behave wildly differently depending on whether the caller sets void, scalar, or list context. So make a habit of specifying an empty "return;" at the ends of functions that do not return a meaningful value.

Often it is good to control the return value tightly depending on whether the caller expects a scalar or list. For example, this would clear up any confusion in the above example, and behave exactly the same in all cases:

sub fn {
        my $one = 1;
        my $two = 2;
        my @three = ("a", "b", "c", "d");
        return $one, $two, @three if wantarray;
        return @three;  # scalar or void context.
}

See also wantarray (which should've been named wantlist).

Devpit.org Browser Statistics

2010-01-21

I've been using Google Analytics on Devpit.org, and here are some interesting statistics for 2009. It averaged 65 "visits" per day. Google Analytics is tracking visits, page views, unique visitors, time on site, page views per visit, etc. While I don't place a lot of faith in what a "visit" is, they are at least making some sort of educated useful guess. It's probably using some highly evil cookie magic but I find the information useful. Obviously Devpit.org probably varies a little from Internet statistics at large; note the large numbers for Linux (which probably includes FreeBSD users with browsers running under Linux emulation). However, I'd expect that the things shown as less than 2% here are still negligible for average public web sites. These are all ratios of "visits", for the whole year of 2009.

Browsers: Firefox got 60%, IE got 19%, Chrome Safari Opera Mozilla each got 4-5%. Konquerer got 0.69%. SeaMonkey got 0.29%. Various mobile and obscure browsers follow, such as 1 visit from a Playstation 3. Out of the IE browsers, IE6 got 33%, IE7 got 45%, IE8 got 22%, IE999.1 got 6 visits (?), and older versions totaled just 6 visits. Of Firefox, almost nobody runs versions older than 3 anymore.

Resultions: 1280x1024 is most common at 22%. Roughly 98% are 1024x768 or larger.

Flash: "(not set)" got 7%. (I suspect this includes people who don't have it installed.) Variations of 9 and 10 together got 91%. 2% are older versions.

OS: Windows got 62%. Linux got 27%. MacOS got 9%. FreeBSD got 1.5%. (FreeBSD is probably higher since browsers running under Linux emulation are most likely counted incorrectly.)

Colors: 32-bit got 58%, 24-bit got 37%, 16-bit got 4%, and the rest got less than 20 visits together.

Java: 81%. (There's no breakdown.)

Various surprises: Apparently Firefox on Linux (21%) beats IE on Windows (19%). One visit reported 4-bit color and two reported 11-bit color. IE has lost a *lot* of popularity; even though Devpit.org probably draws fewer IE users as the average site, I'm still surprised to see 62% from Windows and only 19% from IE, so only 30% of these Windows users are using IE. Netscape will rise again!

While doing anything that doesn't represent a wild guess requires gathering specific statistics for the site in question, this is still generally interesting.

Eat My Sig

2008-09-30

I'm quite tired of receiving email where the sender presumes they can force me to agree to some supposed license to their email by abusing copyright laws. I never signed their agreement, so unless you get me to sign an NDA in advance, I'll do what I please with the messages you send me. Tough beans. Let's use some common sense and common courtesy. If you're sending something confidential don't use email! If you have to use email, encrypt it! And check in advance that the recipient is, in fact, who you think it is instead of blindly sending messages and placing the burden of responsibility on the recipient.

As a response to these presumptuous signatures, I have written my own that simply states a few things that everyone should understand to be common sense for email communications.

-- 
As implied by email protocols, the information in this message is not
confidential. Any middle-man or recipient may inspect, modify, copy,
forward, reply to, delete, or filter email for any purpose. As the
sender, I acknowledge that I have a lower expectation of the control and
privacy of this message than I would a post-card. As a result, nothing
in this message is legally binding without cryptographic evidence of its
integrity. http://bilbo.hobbiton.org/wiki/Eat_My_Sig

As the signature itself implies, please feel free to use this signature on your own messages to express your own disapproval.

Sam's Club Entertainment

2008-05-06

I just had a highly entertaining time at Sam's Club this morning. I used to use my parent's membership, which they dropped recently. My membership card finally expired since my last visit. So I got to the checkout and they said I had to get a new membership. That's reasonable enough. I prepaid for the membership at the checkout, then went to the customer service desk to register with Big Brother. They checked my ID, etc. Then they asked for my phone number. {cackle}

Let me pause the story to say that I think it's absurd that so many businesses seem to think there's this requirement that I spend $40/month for the convenience of people I don't want to talk to. My phone is for my convenience, not the convenience of Best Buy or Sam's Club. If it's that important to them, they should pay my phone bill. Also, Wal-Mart doesn't need my phone number, so why would Sam's Club?

I responded by saying I don't have a phone. It's a great way to refuse because it side-steps any need to justify yourself. Their options are to either accept your answer or call you a liar. It's a terrible idea to tell a customer he's a liar. The girl working was nice enough, but had to ask her supervisor what to do. I was polite, since they're really just following corporate procedure, but firm. Her supervisor was really nasty about it, though, as if *I* was the one being unreasonable. (I should've worn my blue-tooth ear piece.) She said, "How about a work number, or school, or a friend?" I said, "Well work is a shared line, not for personal use, and how would you like your friend to give out your phone number?" I can't believe she actually suggested I abuse a friend's phone. I should've asked for her phone number since she was asking for mine; she would've been cute if she were in a good mood. Then I could've specified her own phone number for my card.

Uncertain what to do, she looked back at the computer for a minute, then looked at me expectantly, and I gave her my nicest "you gotta be kidding me" gesture. Finally she threatened, "Well I can fudge it, but you'll only be able to use cash.", so I asked "What about Discover Card?" and she said "That's okay too.". I said, "I never use checks anyway, so that's fine.".

So then the first girl tried entering 701-000-0000 in the computer, and {gasp} it needed a supervisor's override because the phone number was already in use! What a shock; I'm not the first one to get a membership without a phone number.

If it came down to it, I would've just accepted a refund and walked away without a membership. I don't need to shop there that badly. It would've been fun to think about them having to put away all the stuff I'd just bought.

Dream - Filesystems

2008-01-02

I had this weird dream last night.

I was driving through customs with several people I know well (but the dream didn't identify who they were). We only had one car for our group, which was mine. To get through, we had to help them improve their customs building a little (the building was a rotting wooden shack), since forcing everyone to do a trivial amount makes it "free". We were in the middle of a forest on a two-lane road though. (You know the place; it's where I-29 crosses the river that marks the Canadian border as a curvy two-lane road in the thick forest of hilly north-eastern North Dakota.)

Something started throwing trees at us. We all jumped in the other car even though it made more sense not to leave either of our cars behind. Since we were running out of space in the car because mine was left behind (20 feet away), I unmounted /tmp so we could buckle seatbelts and get going before a tree hit the car. I figured I'd run newfs on the new smaller /tmp after we were well into Canada.

The dream was at least as senseless and disconnected from reality as this description.

1337 5934k

2007-03-20

I always got a chuckle out of 1337 5934}. If you don't know what that is, try piping it through the command below.

In my opinion, a lot of people have cluttered 1337 5934} with bad ideas or ambiguous notation over the years. IMers are the worst. In fact, while I get a chuckle from 1337 5934}, I severely roll my eyes at IM-speak. It's probably because people who use IM-speak are just being sloppy because they're too lazy to press a couple extra keys (something I have little sympathy for since I spend more time using a computer than most people spend sleeping), while people who use 1337 5934} do so with a combination of humor, meticulousness, and pride (however ill-founded the pride might be). 1337 5934} should be an unambiguous translation of one letter to one symbol using symbols that look as close as possible to the original message while leaving as few letters as possible untranslated. I don't really know what IM-speak is besides lazy and unreadable.

That said, this is my favorite version of 1337 5934}, written as my favorite command for doing the translation:

tr 'a4b8c<d[e3ffg6h#i!jjk}l1mmn~o0p9q@r/s5t7uuv^wwx%yyz2' '4a8b<c[d3eff6g#h!ijj}k1lmm~n0o9p@q/r5s7tuu^vww%xyy2z'

This is subject to change, but probably only if I think of a reasonable translation for the letters fjmuwy.

(Hint: many of these symbols look closer to the capital letter.)

Spamming Congress

2007-01-19

Many people seem to think that having as many people as possible tell congress what they think of legislation just irritates them like spam irritates us, and therefore it doesn't do any good. I don't think it's true, for a number of reasons I don't have time to explain right now. I think it's vital that we voice our opinions to our representatives loudly when important issues are at stake. Here's some evidence that it works at least some of the time: http://www.gunowners.org/a121406.htm

Dreaming

2007-01-04

When focusing on a problem, I often don't see a possible solution because I haven't relaxed and reconsidered the big picture. When I take a break and stop thinking about the details of a problem, often thoughts about the problem linger in my mind, and as I forget about the details, I'll think more about the big picture than I did while trying to solve the problem. This leads to what I call a "shower moment" (because it often happens when I take a shower). This is common for most people, particularly software developers.

There's more to it though, than simply looking at the big picture. As I'm relaxing and just letting my mind wander, I skip from topic to topic, sometimes thinking about the problem, sometimes about other software, and sometimes about my dogs, family, music, sports, news, etc. Skipping around like this causes me to associate parts of unrelated thoughts with each other. This free association rearranges old ideas in new ways, often taking a pattern observed in one idea and applying it to another idea, sometimes leading to a new perspective on the original problem. (As an aside, one bad thing that TV is responsible for is preventing these free associations. TV is a distraction from this, and forces me to associate ideas in the ways dictated by the show I'm watching. This is okay sometimes, but I need time when I'm neither watching TV nor doing strenuous mental exercises to allow free associations to happen. Some activities, like chores or cooking, are trivial enough that they don't distract.)

Dreaming actually seems quite similar to this free association, except it's more extreme. How often do you have a dream containing actions or situations that seem to be perfectly reasonable, but then after you might wake up you say, "Wtf was that!?" While dreaming, I believe I'm generally doing the same thing; I make random associations between ideas, things, and actions that often are complete nonsense. However nonsensical, they represent associations that my brain has created that could be useful later on, although I'll never know when I'm using them. This may be what causes you to think of something seemingly unrelated to what you're thinking about, and what causes you to think of a new unusual solution to an old problem.

I think dreaming may be very important for our creative abilities. These associations help us think of new solutions for problems, new designs for projects, new art, new music, etc. The more we dream the more creative we are.

Personal Ad

Follow the link to see this one.

Public School

2006-12-19

If you do not think public schools are a terrible thing, you need to read The Seven-Lesson Schoolteacher, by John Taylor Gatto (1991 New York State Teacher of the Year)

Stuck Into a Trouble

2006-12-09

I love crap like this. When you install Openoffice.org (at least from FreeBSD ports), it displays this message:

3 If you stuck into a trouble
--------------------------------------------------
Somehow you can stuck into a trouble. 
To solve this issue, please remove the already installed
"OpenOffice.org1.1.5" dir in your homedir and remove the
appropriate entry from ".sversionrc". After you have done
this, redo the user installation and the problem will
go away.

Polyphasic Sleep Discovery

2006-11-14

I've officially decided I'm going to try polyphasic sleep. What a cool thing, to only lose 2-3 hours a day to sleep. It's like living 50% longer, and having more fun doing it (because you proportionally decrease the amount of time that you have to work at your job)! Steve explained the details a lot better than I ever will, so just go visit his site to read about it. Actually, he has tons of worthwhile articles, so read some others too.

I want to try it now, but unfortunately, I have to wait until this semester is over, so I don't screw up my studies. I scheduled a week off of work between this coming Christmas and New Year's (which is are on Mondays so I get both weekends :) ), and I'm going to use it to switch to polyphasic sleep. If it works, I'll try to sustain it for the spring semester. If that goes well, I might never go back. I'm stoked!

Updates here

Network Mania

2006-10-09

Everyone seems to be wondering how I ran out of network ports when I have two 8-port switches and why I had to buy a 16-port switch. *chuckle* Here's the breakdown:

Private net:

  • Elrond (my FreeBSD workstation)
  • Gandalf (my Windows workstation)
  • Legolas (my laptop)
  • Strider (my old laptop)
  • Radagast (Kristi's Windows workstation)
  • Bombadil (gaming machine connected to my projector)
  • Gimli (TiVo in the living room)
  • Gloin (TiVo in the exercise room)
  • Delving (headless apps: backups, serial consoles, mp3 player, etc)

DMZ:

  • Smaug (server for me and friends, mostly shells, email, and web sites)
  • Ivybush (server for web apps that store sensitive data in world-readable files)
  • 5 Hosted computers

Plus Cirdan (my FreeBSD firewall) is connected to both, of course. Also, I always forget Ancalagon, my off-site backup DNS.

Unfortunate Users

2006-09-15

I honestly feel badly for people who have to deal with computers, just want the damn thing to work, and end up getting obtuse error messages like "awf98awe: This application is not responding. Click End Now to terminate it or Cancel not to." How are they supposed to know what to do? It isn't their fault some part of an application got wedged and won't respond when Windows tries to shut down.

To make matters worse, these people have been told by "experts" that doing this or that is bad or good etc etc, so now they're trying to remember "hmm, did someone ever say what I'm supposed to do here? I really don't want to break it." because these "experts" that are bold and just guess and see what works tell people to be very careful with their computer so they don't get mal-ware.

So then such a user asks the "experts", who respond "well duh just restart windows". And the user thinks (or sometimes says), "Well I was trying, but you guys tell me to shut down 'nicely' and not to just turn it off so I don't lose my data."

It's really windows shell design more than anything. It should be smart enough to know it's shutting down, so send everything the term signal, give stuff up to 30 seconds to exit, then just sync disks and ax it. So then the "expert" tries to explain that sometimes you have to because <insert complex explanation about processes and software bugs>, and the user goes, "uh, ... in English please?"

While mostly a rant, I have a point (other than "Why is windows so terrible?"). Please try to be helpful in your error messages. Besides explaining the problem, give some useful courses of action. We could all do better at this.

GCC Bug

2006-09-09

I come up with some obscure bugs fairly often. Other software authors must hate me. I would if I were them.  ;)

This time, it's GCC "3.4.4 [FreeBSD] 20050518" on x86-64, compiling with -O3.

int main(long long a, long long b) {
        return (long long)&a + (long long)&b;
}

And before you ask, no, I really don't have a good reason to do this. I was just kinda goofing around.

a.c: In function `main':
a.c:1: error: unrecognizable insn:
(insn 33 14 16 0 (set (reg:SI 0 ax [66])
        (subreg:SI (plus:DI (subreg:DI (reg:SI 7 sp) 0)
                (const_int -16 [0xfffffffffffffff0])) 0)) -1 (nil)
    (nil))
a.c:1: internal compiler error: in extract_insn, at recog.c:2083
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://gcc.gnu.org/bugs.html> for instructions.

Repeating Our Mistakes

2006-09-02

[Editorial note: This post is a rant. Nothing here is a professional or academic opinion. It's supposed to be somewhat funny too, so read it accordingly.]

Why must we repeat our mistakes?

Our industry has an abysmal track record of repeating the same stupid mistakes over and over.

Example: Peripherals

We started out with lots of different connectors for peripherals. I can understand that. Some connectors, such as serial and parallel were general purpose, and some were special because it was our first attempt. Live and learn. But we didn't learn, did we?

We had this cool new technology called "ethernet", which allows us to create arbetrary networks out of devices with RJ-45 plugs. Sweet! So, as the joke goes, I could have a toaster on this network, right? Read on when you're done laughing because you know as well as I do that we'll never be able to agree on a standard that a toaster could do anything useful with...

To solve the problem alluded to earlier (too many protocols for peripherals), our poster-child is USB, and look how cool it is that you don't need serial and parallel and ps/2 mice and ps/2 or AT keyboards and external SCSI and special sound plugs and hey we can even power trivial trinkets like led desk lights and small massagers (wtf?) off of it! But, alas, we hadn't actually learned anything, even if we had agreed on whether USB or Firewire is better instead of arguing over it for the next (so far) 10 years or so.

We already had this cool not-so-new-anymore technology for making networks (which is really what USB and Firewire are all about), called "ethernet". I know you're all probably too young to remember the "ethernet", but it was this neat generalized protocol where any device can send packets with arbetrary data to any other device (or all devices) on what was called a "local area network". Why couldn't this work for peripherals too? Sure IP might not be the best protocol to run on top of it (or maybe it would be), but why can't we reuse the tools that already fit the job?

Meanwhile, we're out making a complunderful (complex and wonderful) standard called USB that runs at a whopping 11mbps. (At the time, this obscure "ethernet" thing did 100mbps, and today it's still faster than both USB and Firewire.) In fact, this protocol is so complunderful, we STILL haven't figured out how to support it in boot loaders so you can fully support something as trivial as a keyboard. I mean, wow. It's only been 10 years or so, guys. Why can't all the major OSs and BIOS makers support it yet?! (In all fairness, the only BIOSs I've tried are 5 years old, but FreeBSD 6.1's boot loader still can't figure out a USB keyboard on all computers, which means USB keyboards are totally worthless to me.)

Example: SATA

Oh ya we have USB, Firewire, and ethernet to choose from, but none of those were really ever designed to handle something as specific as a hard disk. The awesome complexity of a hard disk clearly requires extremely specialized interfaces and hardware and software to do anything or it'll be nothing more than a USB Mass Storage Device. As I said, I can't even hope to comprehend the minute details of a hard disk interface so how could I possibly know anything about what SATA really does that ethernet can't.

Which brings me to plugs. Haven't we learned a damn thing from the idiots that designed the USB plug? Isn't anyone who designs this junk actually using it? Haven't they been irritated by USB devices coming unplugged or older ports that have become loose from being used over and over? (*cough*RJ-45 sure didn't seem to have these problems.) Or is it all a big conspiracy to prevent us from crimping our own cables so Best Buy can rip us off on 3-foot cables for $19.99? Plugs should be secured into place! And they should not be flimsy! SATA didn't really improve anything in terms of cabling; it just changed to problem from "bulky" to "flimsy", and I'd rather have "bulky".

Example: Power

Why do we have so damn many internal power connectors?! (AT motherboard (actually 2 of these), ATX motherboard, 2 or 3 extensions to that, two legacy connectors for disks, and SATA power.) How about one power connector that supplies ground, 3.3v, 5v, and 12v on a 4-conductor plug that isn't so hard to (dis)connect. If you need more amps, use more of the same connector. A motherboard might have 5 power cables going to it, but at least it'd be scalable, instead of having 4 or 5 types that don't scale. And make these power connectors available externally as well. Duh!

I can understand the first version being ad-hoc, but when ATX came out, why didn't we learn anything from our history?

New concept: Component reuse.

I think I may have heard of this concept in really advanced new-fangled software engineering classes targeted at making software so complunderful that the "merest operational parameters I am not worthy to calculate". In any case, while it's far too high-level to be of any real usefulness, the basic premise is that if you already have something that will do the job, use it, and if you don't, make something you can reuse on something unrelated sometime down the road. I know it's silly to even mention it for hardware, because obviously the experts designing this complunderful stuff have wayyyy more experience than I do and again I couldn't possibly hope to comprehend the intricate interplay between all the electrical signals of a computer.

But is it too much to ask that my devices interoperate seemlessly?! Or that new hardware use existing interfaces so we don't have to completely reengineer all our software?

Conclusion

GET A CLUE! We're wasting billions of dollars and years of time that could be spent on new development instead of poorly reinventing stuff we already have that works well. Computers would be twice as fast if hardware makers had just paid attention in software engineering class. Software would be light-years ahead if it wasn't bogged down in supporting all this extra crap we keep inventing.

I'm starting to calm down now. It really feels good to rant sometimes. Maybe I'll revise this or add to it if I get fired up again while I finish fixing my broken computers. If you actually read this far, I'm sorry because I probably wasted your time.

PS

2006-10-16

Later I found this List of device bandwidths on Wikipedia. At the time of this writing, 10 gigabit copper ethernet outperforms everything except memory buses, fiber networking, PCI, and AGP. Even SCSI only performs at about half that speed, at distances far shorter than 100 meters. Admittedly, 10GbE is in its infancy, but that won't last long.

Interestingly, iSCSI is doing exactly what I'm talking about above, but I didn't know about it at the time I wrote the rant above. I'm glad someone is considering the possibility of using ethernet for more than just host-to-host networking.

In any case, I just want people to stop making this rat's nest of standards and cabling worse than it already is for no good reason; it is just making things harder for users and software people.

Perl Gem, Simple Math Error

2006-08-30

This one is a doozy. I have no idea wtf is going on here. I do know a couple things:

  • Without "use bignum;" the code works.
  • perl -v says: This is perl, v5.8.8 built for i386-freebsd-64int
  • The surrounding foreach loop does make a difference. Substituting a simple assignment does not reveal the bug.
  • I want my 3 wasted hours of my life back, dammit (plus my rant time here).
#!/usr/bin/perl
use strict;
use warnings;
use bignum;

foreach my $char ('A') {
        print "IN: $char\n";

        $char = ord($char) - ord('A') + 10;
# The line above does NOT work, but the two lines below DO.
#       my $tmp = ord($char) - ord('A') + 10;
#       $char = $tmp;

        print STDERR "OUT: $char  <-- should not be 'A'!\n";
}

This came up while I was working on Pit, when I added "use bignum;". This came from my code to convert non-decimal integers to decimal. It's stripped down as slim as I could make it while still revealing the error.

Perl Gem, Filehandle Quoting

2006-07-21

This Perl code actually does not emit any warnings or errors!

#!/usr/bin/perl
use strict;
use warnings;
</table>

On further investigation, this code ...

#!/usr/bin/perl

use strict;
use warnings;

my @q = </table asdf>;

print "Length:  ", scalar(@q), "\n";
print "$_\n" foreach @q;

... generates this output ...

Length:  2
/table
asdf

Go figure.

While the notation <table> would emit an error (because the filehandle named "table" isn't open and thus can't be read from), if the junk inside the brackets is not a single bareword, Perl treats it more like qw-quoting, where it separates the inside on spaces and returns it as a list of strings. There Are Too Many Ways To Do It.

Programmers Building Houses

2006-07-13

<RichardNixon> If builders built buildings the way programmers write program an average shack would consist of thousands of custom designed moving parts.

<bilbo> Well ya, obviously it needs to keep its balance somehow.

<rexlunae> Plus, it has to check to make sure the construction technologies are properly licensed.

<bilbo> And that they're auto-updated.

<orcrist> What about back doors for the NSA? Shouldn't they be incorporated?

<bilbo> oh definitely, and auto-update has to be able to change their locks.

<RichardNixon> And it has to be properly modular so that 3 years after it's built somebody can decide it has to be accessible in an entirely different way from how it was designed. For instance, it should now be accessible via the web.

<rexlunae> The smoke detector would have to use a user-friendly alarm explaining that it is bad when it is going off.

<RichardNixon> It would also be required to come with extensive documentation that noone would be expected to read. And it would have to be built on at least an acre of land, because 3 years from now when they want something totally different it's going to balloon in size.

<Eric[0]> and it needs to have memory leaks

<Eric[0]> LOTS of them

<Eric[0]> It's not properly designed if it doesn't consume every resource available.

<bilbo> In other words, it must grow to fill the land available.

<rexlunae> The EULA would require that you only install Microsoft brand carpet, but that's ok since it comes in the nicest shade of orange.

<RichardNixon> Oh yeah, I forgot it would have to be able to dynamically resize itself to to meet all possible conditions, expected and unexpected.

<Eric[0]> It needs to have an error message for any critical problem, for instance the blue screen saying "the roof has collapsed and needs to fall down".

<bilbo> ya, like what if you try to park your car in the kitchen? It has to be able to issue an error, then expand the kitchen (in that order rather than expanding without error -- like windows swap space).

<RichardNixon> Appliances would explode at random time intervals, but if the house was unable to cope with this it would be deemed "junk". Ditto for being unable to keep out swarms of constantly mutating wildlife and teenagers with crowbars.

<rexlunae> It would have a bathroom, but since you only purchased the standard version instead of the professional version, it would be behind a locked door. In order to use the bathroom, you have to rebuild the structure entirely.

<kzarns> Of course you would have to hire some people to test it for a couple years.

<bilbo> You'll have to buy a new one every year (auto-update can only do so much, after all), even though the design is only updated every 8 years.

<rexlunae> It would also include a reminder to install a security system, which would pop up every time you open any door.

<RichardNixon> If you added on to the house and installed crappy locks in the addition, when a burgler broke in and stole your stuff it would somehow be the architects fault.

<RichardNixon> And instead of installing better locks you would be expected to buy an series of increasingly expensive and complex hunter-killer drones to patrol your house. These drones would take up a larger amount of your living space with each iteration and would occasionally shoot your guests and family members.

<langseth> And they would also cause the house to lock everyone out after an update.

<rexlunae> And the purchase agreement would include a statement that prevents the builder from being held liable for anything ever.

<RichardNixon> Even after you got better locks, you'd probably still need the drones because your children and other family members would keep letting random theives, bums, and serial killers into your home because they "looked cute".

<langseth> And some of the Entertainment appliances would install their own drones directly into the foundation without notifying you.

<Eric[0]> Every 3 months or so you'd have to rebuild it to get rid of cruft-creep.

Gzip Or Bzip2?

This isn't included because it's too long. Follow the link to read it.

Jiggers per Jiffy

2006-06-19

Neato. Jigger is a measurement of volume equal to 44ml or about 1.5 fluid ounces -- a shot.

Jiffy is a measurement of time equal to .01 seconds, according to the data file included in the UDUNITS library. (Actually it has other meanings as well -- see http://en.wikipedia.org/wiki/Jiffy_(time) . However, this is probably the most general definition.)

So now we can measure flow in jiggers per jiffy.

Also, we could say that 1 Hz is equal to 100 jiggles per jiffy, where a jiggle is simply a cycle of the measured event. Yes, I made up the part about jiggles, but I think it sounds way more sophisticated to say "240 gigajiggles per jiffy" than "2.4 gigahertz".

Unix will not replace Windows any time soon

2006-06-17

Inspired by Linux has some growing up to do

This is an old article, so much has changed, but the underlying rant is still true, and it applies to other Unixes too. Unix will never replace Windows as an end-user desktop OS until everything just works out of the box at least 95% of the time.

I'm not saying Windows is stable, scalable, flexable, extensible, or anything else we all love about Unix. I'll never run a server on Windows or even attempt to create an automated system on it. In fact, I'll probably never use it without a Unix file server mounted as a network drive. To me, Windows is strictly a sandbox for running software that has crappy or no alternatives in Unix.

However, it's true that it's simply easier to use, and I don't think this is a coincidence. I think free software is unlikely to produce something as polished. Hear me out before you jump on me.

Workers need motivation, whether for writing software or doing other jobs. This is simply how the world works. Commercial software developers have strong motivation to write software that is easy to use; otherwise it won't sell. Free software developers usually don't have this motivation, so each developer that writes free software finds personal motivation for his endevours. For me, this motivation is that I simply need this software for my own use. This is much like why you would improve your house; you directly benefit from your own work, but even if you expect to profit from it financially, that isn't the reason you did it. Because I don't see a significant profit in selling a particular bit of software I wrote, I let others have it. Often this could represent substantial benefit to me if other developers improve what I wrote and I can use their improvements. If I can't benefit by keeping it secret, why should I prevent others from doing useful things with it, especially when they might help me make it better? Other people may have other motives, but I think this may be the most common factor in choosing whether to write program A or program B. The reasons you don't see open source developers making, for example, software for stop lights is they will never be able to use it or benefit from it. They make software they can use; kernels, windowing systems, server software, etc.

The greater the commercial motivation for a piece of software, the greater the gap will be between the free software and the commercial software. Stuff that's easy to write doesn't have a large potential for profit, since someone could easily write something cheaper. I'm not sure whether there is an office suite better (in functionality) than MS Office yet, but MS Office was way ahead for at least a decade. The reason is it's a ton of work, so it's difficult for someone to write a replacement, and there's a huge profit, so it's hard not to find a corporation willing to invest in it. Games are a perfect example of the extreme. They're very difficult to write, and they have very little generalizable value (meaning it's difficult to find a developer that has non-monetary motivation for writing a game), but they have a huge potential for profit.

The thing is, I'm okay with this. I wish there was an OS to replace Windows that wasn't so crappy, but on the other hand I prefer using an OS that isn't bogged down with hiding what really happens under a lot of glitter. I think it may be possible to have one OS that fills both niches, but I'm okay with using FreeBSD unless that happens.

I might polish this up later or write more about it, if I have motivation.  ;)

Dumb Languages

2006-04-30

In particular, I like this: "C++ is dumb, and you can't write smart systems in a dumb language. Languages shape the world. Dumb languages make for dumb worlds." (If this sounds superficial, read the article -- he backs it up well.) It seems so true though -- language shapes (or at least, expresses) the way we think and therefore has an impact on everything we think about, and when you create something, the first thing you need is a language to describe it in.

http://www.cabochon.com/~stevey/blog-rants/tour-de-babel.html

Some of Stevey's other articles are good too, see http://www.cabochon.com/~stevey/blog-rants/

Class Schedule, Fall 2005

2005-08-22

This semester's class schedule:

I have CS465 from 1124906400 to 1124909400, at the interval of +172800, +259200, +172800. I have CS500 from 1124917200 to 1124920200, at the interval of +604800. Both subtract 3600 on the cycle following 1130659200 and skip several arbetrary intervals.

Oh fine, I'll be nice. ;) CS465 1-2pm MWF, and CS500 4pm W

I Must Be Geeky

2005-08-12

Occasionally, I have these rather shocking reminders of just how geeky I really am.  :) Last night I had this dream. As you'll see, it gets progressively geekier.

Last night I had this dream. Somehow, this virus ended up on my network. Strangely, it originated on my network, and I was trying to contain it. (I don't know how; the dream just started with that situation.) Before I realized the risk, the virus got out to the internet.

Soon I realized it was an intelligent virus. As in, it was learning from the content available on the internet. This made it extremely dangerous, because it would read source code and find security holes that hadn't been discovered yet.

Global catastrophe was imminent, except that it didn't seem particularly malicious. It seemed to be having fun, in an odd way. It would screw up Windows computers by showing silly things on the screen, for example. Or change orders at fast-food restaurants. Or simply converse with people through computer consoles.

It became more intelligent as it compromised more computers and digested more information. Finally, it became intelligent enough to communicate verbally and pass a Turing test, and actually called me on the phone. It sounded like a regular person, not like a machine or a criminal or a muffled voice or anything. Just some guy, but I knew it was the virus calling (as you often just know things in dreams). It now became smarter than the everyone in the world, as it gained more and more concurrent processing power and indexed everything anyone has ever studied.

As if this wasn't geeky enough, we talked about the things it had learned. Apparently, it had figured out the proof for "P != NP". Unfortunately, it didn't tell me what it is before I woke up.

Perl Gem, Ambiguous Curlies

2005-08-03

This is quite a perl gem. These statements should do exactly the same thing. Thanks to the multiple meanings of {}, their interpretations are wildly different.

print Dumper(eval '{1 => 2}');
print Dumper(eval '{"1" => 2}');

Generates:

$VAR1 = 1;
$VAR2 = 2;
$VAR1 = {
          1 => 2
        };

2006-09-26 Update: A year later, this doesn't happen anymore. I should've recorded which version of Perl it was. I know I wasn't crazy; I spent a very long time debugging this in a program, and finally extracted these lines to demonstrate to myself that I was not, in fact, crazy. In any case, the point is still valid: It's a terrible idea to overload symbols with too many meanings. Perl uses {} to represent both a statement block and a ref to an anonymous hash, and the grammar does not fully disambiguate them.

Personal tools