Please create an account to participate in the Slashdot moderation system

 



Forgot your password?
typodupeerror
×
GNU is Not Unix

Journal Journal: Stable API Nonsense 2

Recently there was a discussion about how Linux cell phones are basically DOA, and within that discussion was a thread on a stable driver interface in Linux. Rather than respond to every comment as to why this is a bad idea, I figured I would just post the original response to this request for a stable driver API which was put together the first time people noticed it was hard to ship binary drivers for Linux:

Let me just point out that this approach *works* and *has worked* quite well for quite sometime. These days, when I buy a new piece of hardware, I throw out the driver CD without even looking at it. I plug in the hardware to my Linux box fully expecting it to work; if it doesn't, I figure it's broken. Occasionally, it's not broken hardware but rather I have made a mistake and invested in a piece of hardware from a company that has not seen the light and open sourced their drivers. I make a point never to buy from that company again, and I get a refund for the hardware. I might point out that this is a very rare occurrence. Most of the time there is support for hardware out of the box under Linux - no driver CDs, no install and no reboot required - just plug and go.

Implementing a stable API for drivers would lead to bloat, insecurity and instability; we've seen it happen in Windows, and even starting to happen with binary drivers under Linux! The technical argument is that Linus (and his kernel devs) reserve the right to rip out or reimplement anything they please in the kernel, with no regard whatsoever to backwards compatibility. This model has worked very well so far, as evidenced by the fact that you can plug in 99% of hardware into a Linux box and have it just work, no driver CD, download or install required.

Still, some people argue this is a political issue, not a technical one. I would agree, on one point: the hardware vendors are the ones making this a political issue. By refusing to release their source code, they limit how well their device can be supported. For what purpose do they need to keep their drivers closed? They sell hardware, not software, therefore they don't even have an economical reason. The arguments for releasing source are legion: support in ALL distros on ALL architectures by default; more stable and better tuned drivers; no need to ship driver CDs; no worry about having to support your drivers as they are now in the kernel, etc. I can think of no reason other than petty greed to keep drivers closed. And it's greed that doesn't even function properly at that, as it doesn't gain the greedy companies anything.

Is there any *technical* reason to keep drivers closed source? Please elucidate, and remember that even if there is, it must somehow outweigh all the benefits of having the same driver as an open source driver in the kernel in order to argue that there should be a stable driver API. This isn't an ideological, or even political issue; open source drivers have been shown *in practice* to work better, and provide all of the benefits I've listed. Why should we throw out one model that works for one that has been shown to not work nearly as well?

Music

Journal Journal: Found something that I think sounds cool 6

*Sigh*, I'm still waiting on my 1TB HDDs for the file server, which I will use to replace the 250GB drive, which I can then put in the web and email server. For now, that means I still post journal/blog entries here, as I don't see the point of upgrading the software on the web/email server until I have the drive available for it. Anyway, my pointless rambling is all a preface for this:

http://www.archive.org/details/Snu-op025-Caravan

I found it while looking for recordings of sheet music we play in our Big Band (guess which song I was looking for :). I thought the song sounded pretty cool, so I'm sharing it with you. Hope you enjoy it!

GNU is Not Unix

Journal Journal: "Free Software doesn't have end users" 3

So, I was going through the links on BBSpot today, and I found what I can only describe as one of the most lucid, well-written articles on Free culture I've seen in a long time: Thank you for giving me the opportunity to explain this to you. It's so fan-fucking-tastically good that I'm severely tempted to make my new signature on slashdot a link to that article with the title "Free Software doesn't have end users".

Every time I see some whiny bastard say "but Linux will never take over the desktop! you have to pay attention to MEEEE -*- cough -*- I mean, you have to pay attention to the end users!" I just want to bitchslap the little schmuck. What have these so-called "end users" done for Linux? Fuck them! The end users of Linux and Free Software have always been the same people who created it: the developers. If you "just want it to work", and you can't even be arsed to file a bug report, fuck you. It works for us; you should be grateful we decided to share the source with you.

Ranting aside, this really cuts to the heart of why I use Free Software: even if it wasn't technologically superior (which it is, precisely because it is Free Software), I would still use it because it is the only software I can modify and use however I want without having to say the equivalent of "please sir, may I have another?" to some big corp. whose only concern is next quarter's earnings.

Free Software doesn't have end users; that's kind of the point. You can either participate and contribute a little something back or you can pay some company to tell you what you are not allowed to do. We welcome your input, but if all you can do is say "your software sucks! do what I say or I'll use someone else's software!" then all I can say is farewell and peace be to you.

Books

Journal Journal: John Taylor Gatto's "Underground History of Education" 5

So I've been reading The Underground History of American Education by John Taylor Gatto. I've found it very enlightening, and up until Chapter 14 I was pretty much agreeing with the author. Now, I'm not one who dismisses everything I disagree with out of hand; on the contrary, I try to seek out opinions different from mine and test them (and mine) against evidence to better understand the world. But when Gatto starts citing court rulings such as the "posting the ten commandments in school rooms is unconstitutional" as bad and anti-religious, I start to grow a bit skeptical.

As I had been reading TUHoAE I detected faint warning signs that Gatto might have a religious bias. Little things that warned me, such as his antipathy towards what he called "scientific teaching". I could excuse some of these as perhaps merely terminology differences; what Gatto meant by "scientific thinking" did not match up with what I meant by it.

But then the other shoe dropped: Gatto demonstrates his bias against science which contradicts his religion:

Instead of remaining merely a useful description of how things work, great synthesizing theories like Big Bang or Natural Selection purport to explain the origin of the universe or how life best progresses. Yet by their nature, these things are beyond proof or disproof. Few laymen understand that the synthesizing theories of Science are religious revelations in disguise.

How are the big bang theory and the theory of natural selection not useful descriptions of how things work? How could someone who is obviously so erudite and had researched previous chapters so well fall into the trap of baseless assertions and a basic misunderstanding of the way science works? Is he not aware that natural selection has been demonstrated many times?

Another quote that left me gaping:

We are hidden by more than a half-century from the shock and numbness this new doctrine of "separation of church and state" occasioned, a great bewilderment caused in part by the absence of any hint of such a separation doctrine in the Declaration, Constitution, or the Bill of Rights.

Did he seriously just ignore the first amendment? Is he completely oblivious to the treaty of Tripoli, which by the constitution is legally binding as law of the land, and it states "the Government of the United States of America is not, in any sense, founded on the Christian religion" and it was signed over two centuries ago?

Another question I had was why had no one noticed this? In all the reviews I read, no one had mentioned that Gatto turned into a raving young-earth creationist midway through his book. Had these people read the book all the way through? Where are all the people who should be calling him out on his kookiness? The chapter I'm currently reading is his least footnoted and therefore least supported by evidence one so far, although I notice that previous chapters had been slowly but steadily heading towards less references.

Gatto tries to sound unbiased and reasonable, but the way he phrases things makes it obvious he thinks that there can be no morality without religion. Through the court decisions he throws out as "anti-religious" the reader can also tell he is one of those christians who believes he is being persecuted because he isn't allowed to force his religion on others.

I will try to make myself finish the book, grating though Gatto's unfounded assertions may be. I do value the eye-opening, well-researched and well-documented information that was contained in the earlier part of the book. It had always seemed to me that there was something wrong with public school education in America; I'm grateful to have substantiating evidence to back that assertion up. But I think that Gatto has misdiagnosed the cause and blamed the wrong driving forces for the downfall of education in this country. While I will not deny that anything can be taken dogmatically, I don't believe that returning to one dogma (religion) in place of another (so called unscientific "scientism") is the answer. I believe the answer is to become more rational, less biased and more pragmatic towards how people learn.

What do you think?

Programming

Journal Journal: read() vs recv() vs recvfrom() for UDP sockets

This may be old news to network programming gurus out there, and those dealing with saner programming languages and libraries probably won't have to worry about it, but I figured I'd post it for all those newbs (like me) to hopefully save them some time.

In C, it turns out that read() and recv() don't work on unconnected sockets (at least UDP, in this, my little story). The man pages do say something along the lines of "recv() is normally used on connected sockets", but to me that seems a bit subtle. Sometimes, some of us need a good *WHACK* on the head with a cluestick, and I finally got one when I was perusing the netcat source code to see what they did that made read() work with UDP. Turns out you have to call recvfrom() at least once on a UDP socket before you can call read() or recv() on it and get it work "reliably". I say "reliably" because what took me so long on this was that I figured UDP meant UNRELIABLE datagram protocol, so that's why I wasn't getting all the data. Turns out sending data over loopback shouldn't drop any packets, even when you use UDP.

And just for reference: no, select() accept() and listen() don't seem to work on UDP sockets either. Bummer :(

The Military

Journal Journal: Working for the Government 1

So, reading this, it got me to thinking (again): why do I work for the government?

First, a little background: I graduated with a BS in CS in 2000. I then went to work for a startup started by my most challenging professor (I figure I'd learn more working for him than going to graduate school). Half a year later, they lay me off (but toss me some contracting work) because they can't afford to pay me (dotcom bust and all that). Somewhat naively, I decide to try consulting. Seven months later, after burning through all my savings, I'm desperate for a job. I mention this to a college friend who had gone back to his home town to work for DoD, and he manages to get me a site visit. A month later (surprisingly fast for the Feds!), I'm working at a Navy base in the middle of the desert.

So here I am, seven years later, wondering "why do I still work for the government?". A lot has changed since then. I love the town. It's small, dry and hot year round (I grew up in very similar desert). Plenty of very tall and fun to climb/hike/camp in mountains are within a days drive. I play alto sax in the local big band (and occasionally orchestra). I just got sworn in to the local mountain rescue group. The one thing that sucks is the job, and even it's not that bad.

You know how everyone says government employees don't work? It's true, but not for reasons you think. Sure, there are many who are just plain lazy. But out here at a place where we are far from the bureaucracy, where the majority of employees are engineers and scientists who are passionate about their work, the real reasons work doesn't get done are also the major reasons people quit or just gripe about their jobs. Security, while necessary, is a significant speed bump on the road to productivity. Having to get hardware you need to test out of a safe that only one person (not you) has access to, only to find out that you need a computer (that's in another safe that you don't have access to), can be demoralizing.

Not being allowed to install software that you need to do your job is another frustrating thing. It seems that even though someone may be trustable with state secrets, and be an expert in their field, they aren't allowed to decide what the best tool for the job is.

There are numerous other reasons: waiting for months for parts, having to pay credit card bills out of pocket for travel expenses (because vouchers in the travel system are 3 months behind), being forced to "standardize" on one software platform at a place where by definition, standards may be in flux (we are a research center, after all), or the standards are not the best tool for the job and were only chosen for political reasons.

So why do I still work here? I have been tempted, quite often to quit. However, there is nowhere else in this town where I could get the same salary for the same job. It's too small a town. I don't want to move; I love the town. I could try consulting/contracting, but that's iffy. And despite all it's drawbacks, it's not really all that bad. I work with smart people, and the one good thing about bureaucracy is that it's slow, so I haven't been completely cut off yet in the self-administration arena (I have a development machine that I alone am root on; the network admins and I have an understanding: I never call for help or create a problem, and they keep my connection up). All those times when I can't get real work done because I'm waiting for something? I've been playing with different programming languages, toolkits, development tools, etc. Recently, I've been going through "The Pragmatic Programmer" and quite enjoying it. I have some qualms about helping a corrupt government design weapons, but I don't blame Smith and Wesson for gun deaths.

I would jump at an opportunity to get paid to work on open source software from home (telecommute), but I'm not moving. I'm married and my wife also works on base. She has complaints about her job as well, but we both like the town; relocation is out of the question unless we could both get comparable jobs somewhere else in a similar environment.

Now, if they try to make me into a manager who doesn't get to write any code, then I will be looking for a new job.

Programming

Journal Journal: Re-usable vs Re-editable 1

Given the recent controversy over Prof. Knuth's comments, I'm left pondering one (of many) questions: why can't code be both re-usable and re-editable? (no, I haven't read the article)

Are re-usable and re-editable code fundamentally opposed? Would it just take too much time (or genius) to make code both re-usable and re-editable? Or is Knuth just calling designing for re-usability a waste of time like unit tests?

To me, the re-usableness and re-editableness of code seem orthogonal. You can write code that is re-usable but completely un-editable (it's usually unreadable at that point). If you're writing code properly, it seems to me that re-editable is a given. Re-usable is more difficult to do, but it seems like a good idea, and a best practice that most programmers should try to get into the habit of (just like writing re-editable code).

Maybe I'm just missing something here, but I always aim to make my code re-editable and re-usable, and one doesn't seem to get in the way of the other, other than competing for my time. Thoughts?

Programming

Journal Journal: Heap Debugging in C 5

I learned some very interesting things today. First, valgrind kicks ass. Second, don't always believe what you read in man pages. Take this little snippet I'd been working on for the past 1.5 days:

uint16_t
checksum (packet)
    struct re_packet *packet;
{
  int i = 0;
  uint16_t checksum = 0, temporary = 0;
  unsigned int intermediate = 0;
  unsigned int *binary_blob = calloc (1, sizeof (struct re_header) + packet->header.size);
  if (binary_blob == NULL)
    return (-1);
 
/// Necessary because checksum doesn't include itself.
  temporary = packet->header.checksum;
  packet->header.checksum = 0;
 
  if (!memcpy (binary_blob, &packet->header, sizeof (struct re_header)))
    return (-1);
  if (!memcpy (binary_blob + sizeof (struct re_header),
          packet->data, packet->header.size))
    return (-1);
 
  for (i = 0; i < (packet->header.size + sizeof (struct re_header)) / 4 ;
      ++i)
    intermediate ^= binary_blob[i];
 
// Restore original checksum.
  packet->header.checksum = temporary;
 
  checksum = intermediate ^ (intermediate >> 16);
 
  SAFE_FREE (binary_blob);
 
  return (checksum);
}

Now, you see, the "binary_blob" has to be a pointer to an array of unsigned integers because that's what we're using for the checksum. So far so good, right? Except that the program using this little snippet has weird memory errors, and when I say weird, I mean segfaulting in calloc(). A sure sign of heap corruption. But where could it be coming from. Just as a check, I insert some code to print out how many iterations it goes through before it crashes; ends up being just one. Hmm, heap corruption usually takes longer than that.

As I watch the compile for the zillionth time, it occurs to me that wxWidgets is being linked because this project has a separate GUI; but this little piece of code doesn't need it. Perhaps wxWidgets is doing some weird initialization stuff that is really not necessary in a piece of C code. So I also quickly learn how to turn that off in automake, and recompile. Still the same error in the same place. Hmmm . . .

Go learn how to use valgrind with memory checking. It says that "binary_blob" is being written beyond it's end. Huh? It's exactly as big the writes *should* be. Double-check memcpy(3); nope, it clearly says the third argument "n" is the number of bytes.

After banging my head against this for another couple of hours, I finally get the crazy idea, "hey let's just try casting to see if that fixes it, even though it shouldn't make a difference." Et voila! It works:

uint16_t
checksum (packet)
    struct re_packet *packet;
{
  int i = 0;
  uint16_t checksum = 0, temporary = 0;
  unsigned int intermediate = 0;
  unsigned int *binary_blob = calloc (1, sizeof (struct re_header) + packet->header.size);
  if (binary_blob == NULL)
    return (-1);
 
/// Necessary because checksum doesn't include itself.
  temporary = packet->header.checksum;
  packet->header.checksum = 0;
 
  if (!memcpy ((void *) binary_blob, &packet->header,
    sizeof (struct re_header)))
    return (-1);
  if (!memcpy ((void *) binary_blob + sizeof (struct re_header),
          packet->data, packet->header.size))
    return (-1);
 
  for (i = 0; i < (packet->header.size + sizeof (struct re_header)) / 4 ;
      ++i)
    intermediate ^= binary_blob[i];
 
// Restore original checksum.
  packet->header.checksum = temporary;
 
  checksum = intermediate ^ (intermediate >> 16);
 
  SAFE_FREE (binary_blob);
 
  return (checksum);
}

Apparently, memcpy(3) does some hinky where it actually looks at the type of the dest you pass it and decides that, no, "n" doesn't actually mean bytes, it means the number of elements you want to write to in that array. At least that's my theory.

(Posting this here because I don't have my own blog and I'm too lazy to look up the C newsgroup on groups.google.com; excuse the incoherence; I'm really frazzled and just happy it works (for now)).

GNU is Not Unix

Journal Journal: Webcam(s) for GNU/Linux 1

(posting this under "GNU is Not Unix" as there doesn't appear to be a "Linux" category or an "Ask Slashdot" category; WTF is up with slashdot these days? Are they forgetting their roots? Anyways, that's another rant . . . ).

I've been looking for a webcam that works with Linux for a long time. I've tried ordering Logitech QuickCams of the 3000 and 4000 variety once I was fairly certain they would work with Linux only to be told that they were "out of stock" or "back-ordered" (another rant: why can't these retards keep their online inventory up to date? it really should be prosecutable under false-advertising to list a product as available when it isn't; I found a blog posting along these lines somewhere, but can't find it now; I can't remember if I found it linked from slashdot.org or planet.debian.org; if anyone has a link to it, let me know).

Here's my question: is there a webcam that I can use with Ekiga and MythTV's MythPhone plugin? Where can I buy it? Please note that getting used hardware off of eBay is not an option; binary only drivers are also not preferred. I'm just looking for a simple webcam that I can do videoconferencing with under Linux. I know that many people will say "just search google", but believe me, I've tried and every time I find that the webcams supported by Linux aren't for sale anymore.

Technology (Apple)

Journal Journal: Followup: Inventive Feature on the iPhone

Okay, so I went and did the Apple fanboys research for them. Well, not really "did research" as much as "saw an ad" (despite MythTV's ad filtering, the wife still watches a lot of live TV while I cook dinner) about one of the features of the iPhone: visual voicemail.

This is one of those things you go "it's so obvious, why didn't I think of it?" or "why aren't other companies doing it?". To be able to see a list of people who called and what the length of the call was, that would be kind of useful. And it meets the "not offered before" (that I'm aware of) criterion that I had stated earlier in my request for proof of inventiveness in the iPhone. Not that I get a lot of voicemail, but I hate checking voicemail because it feels like I am serving the system, not vice versa ("Please input your f*cking long PIN in 4seconds or you will be disconnected", "Please press a button or I will continue to annoy you with menu options you won't remember anyway").

So, score one for iPhone. It's still not enough to make me switch, especially considering my iPhone would probably be bricked in a week for "tampering" (there's software I need in a smartphone that's not on the iPhone, dammit!). Not to mention it doesn't (currently) work with Linux, but I suppose that will be fixed soon. Not by Apple, but by the Linux community.

Note to Apple fanboys: I'm perfectly happy with my current smartphone. It does everything I need; some of those things can't currently be done with an iPhone. That's okay. The world doesn't need just one operating system, one browser or one smartphone. Don't believe the hype; use what works best for you and please STFU to me about the iPhone. I've evaluated it and it doesn't meet my needs.

It's funny.  Laugh.

Journal Journal: Note to self: Don't bait the Apple fanboys 8

So, I saw the article bemoaning the American cell phone markets' lag behind the Japanese. The thing that caught my eye was the reference to the iPhone. "Finally!" I thought, "someone besides me who sees through the hype and realizes that the iPhone doesn't bring anything new to the field."

I should have just let it go, but this is something that really bugs me about Apple supporters: they think that Apple invented everything first, that Apple makes the best of everything and that Apple can do no wrong. I respect and admire Steve Wozniak; I recognize that Apple's products are ideal for some people; but the whole worship thing has got to go. Apple fanboys don't realize that Apple isn't perfect, their products aren't right for everyone, and no, they aren't the innovators they make themselves out to be.

So I posted a slightly inflammatory comment (I admit the words "copycat", "fuck" and "toy" could have probably been left out). But I still think the meat of my comment was spot on: Apple is not first to market with a multi-function smartphone, and they are very similar to Microsoft.

The first mod was "Insightful", so either one of my fans was looking out for me, or somebody else actually realized "hey, I can do everything the iPhone can with my phone!". The next was a "Redundant", which might be honestly fair due to the fact that others had mentioned the whole cell phone monopoly. Then the next was a "Troll", which honestly, I wasn't trolling, so I figure it's a Mac zealot. Big surprise.

But then, I actually got a response. A halfway reasonable response! Which I was little quick with the flamethrower to counter, I'll admit. But after people start misdirecting and putting words in my mouth, the kid gloves come off.

What's this all leading to you might ask? Well, for one thing, I knew I was going to piss some Apple fanboys off. And I'm not one of those malicious people who likes to spread hate and discomfort just for fun. But more importantly, I think exercise makes me more aggressive and likely to pick fights. I guess the only solution is to stop reading slashdot and go climbing more often. Probably be better for my health and the blood pressure of others. Besides, Apple could start making iPhones out of dead babies and their fans would say "Apple's being so environmentally responsible by recycling!". There's nothing I can do to convince them Apple doesn't have their best interests in mind, or that they aren't innovative, or that there might be better alternatives to Apple out there.

Spam

Journal Journal: SORBS DUHL Invalid (and other problems)

I have a problem: my email servers are listed as having dynamic IP addresses in SORBS. Normally, this wouldn't be a problem as only incompetent email administrators would use a DUHL, much less SORBS's DUHL, to automatically bounce email. As evidenced by comments in a previous slashdot story, SORBS is not only often wrong, but appears to be a racketeering organization in the "pay us money to get off our lists" sense.

Every once and a while, I see a message in the logs saying something similar to "550: dynamic IP address blocked - see http://www.sorbs.net/lookup.shtml?${MY_EMAIL_SERVER_IP_ADDRESS}". It used to be I would do a "sudo iptables --insert INPUT --source ${IP_ADDRESS_OF_BROKEN_SERVER} --jump DROP". I've stopped doing that as I realize it's counterproductive and will prevent the people who need to see the notice about the listing from seeing it. I've also tried going to the SORBS website to get delisted, but I've never received a response, and I find it kind of funny that the netblock my IP address is in was delisted, then relisted a second later.

All of this didn't matter much as most of the time the email servers that were blocking me were ones I never sent email to and were just getting double bounces from the Joe Job that is still going on against my domain name. Side note: ironic that the exact same servers that block me can't even be arsed to check the SPF records in my DNS server to make sure they won't try to bounce a message to an address that doesn't exist.

However, I have recently been getting bounces from Mediacom's email servers, which is a problem because I do want to send email to a couple of friends who have @mchsi.com addresses. I'm not sure why I've been blocked; the error message is a fairly generic "550 Blocked for abuse. Please contact the administrator of your ISP or sending mailservice.". As I don't allow SPAM to be sent from my mail server (to the best of my knowledge), I have no idea what "abuse" they may be talking about. I suspect that they are using SORBS DUHL, as my mail servers are not listed in any other blacklists (that I know of).

I've tried sending email to postmaster@mchsi.com. When that bounced, I tried to send email to abuse@mchsi.com. Of course that bounced too. Doing a whois, I find that I should email mcchst@mediacomcc.com as the technical and admin contact, but that email address is over quota. Next I try to call the (long distance) phone number, only to have to leave a message. I try calling again, but this time asking for the email administrator instead of the name listed in whois. I have to leave another message.

So what should I do now? I'm kind of stuck, and the idea of telling my friends who use mchsi.com email addresses that they should get another is kind of ridiculous (after all, I got my own domain name so I would never have to change email addresses again). I'm considering the following options:

  • Faxing the fax number in the whois database listing for mchsi.com
  • Posting to NANAE to show good faith that I don't want to spam and I'm looking for help, and will do what it takes to get off RBLs.
  • Calling the support number for Mediacom and telling them that they are blocking legitimate email to their customers.

Anyone else have any ideas?

Slashdot Top Deals

For God's sake, stop researching for a while and begin to think!

Working...