Skip to content

Observation while briefly watching a censored version of The Longest Yard (2005 remake)

Words that you cannot say on TNT:

  • “shit” (including but not limited to the derivation “bullshit”)
  • “goddamn”

Words that you can say on TNT:

  • “nigger”

Now, I’m not going to say that this is related to the fact that TNT is headquartered in Georgia, but [redacted]

The voodoo of gcc, Part II

This is a direct follow-up to my previous post on gcc optimizations. The main code example, integer division by 7, came from a session of the Compilers class I took this semester. The professor was demonstrating the use of gcc to show example assembly for certain operations: arithmetic, branching, etc. We were all expecting something like the very first assembly example, using the integer division instruction the 80486 provides, and we all had the same flabbergasted reaction to the code gcc actually produced. That course gave me a healthy respect for the fact that compiler writers are, by and large, the smartest people on the planet.

I had a similar moment with gcc producing something unexpected while I was writing the previous post. The benchmark code at the very bottom of it, specifically.

Continue reading ›

The voodoo of gcc, Part I

Here’s a stupid bit of x86 assembly code, using AT&T style:

divideBySeven:
        pushl   %ebp
        movl    %esp, %ebp
        movl    8(%ebp), %edx
        movl    %edx, %eax
        sarl    $31, %edx
        movl    $7, %ebx
        idivl   %ebx
        popl    %ebp
        ret

What does this do? Well, the label should give you a pretty good idea. Converting it into C, we get:

int divideBySeven(int num) {
    return num / 7;
}

Natch.

Continue reading ›

nostrangerstolove.java

Submission to the practice problem of the 17th Annual University of Evansville High School Programming Contest:

Continue reading ›

Atom feed for Folklore.org’s Newton stories

I mentioned last post that ten stories were added to Folklore.org’s hidden Newton section. Well, since then, another one has been added. I’m kind of annoyed by the fact that the feed for that section still doesn’t work, so I need to remember to go the index myself to check for new stories.

So, I made a feed.

http://quiteajolt.com/projects/newton/newton.xml

It’s an Atom feed, updated at the top of the hour (assuming there’s an update), containing the ten most recently added stories. I haven’t really put the generator through its paces, so it’s probably pretty flaky, but I’m subscribed to it myself, so hopefully I’ll notice if something goes awry. Enjoy it until Folklore.org’s actual feed is operational.

If you’re interested in the implementation details, the scraper is written in Python and uses Beautiful Soup to parse the page and PyFeed to generate the XML. You can view the code itself at http://quiteajolt.com/projects/newton/makeRSS.txt.

Borogoves

Went through the old posts and spruced everything up so that they at least look no worse than they did in the old theme, I think. Had an oddity with my image styling with Safari 3 and rows of thumbnails, like in this post, where the images load fine the first time, but after the page is refreshed, at least one of the images (almost always the first or last, and usually both) ends up squished to about ten pixels or so in width. Resizing the window causes the shrunken pictures to increase in width to about fifteen pixels, and refreshing after that may or may not cause one or more of the images to return to their proper size. Works great in the latest Minefield nightly, though, but it wouldn’t surprise me if that’s in the minority. Gotta love floating elements.

To give you the illusion that I’m not shafting you on content for the second consecutive post, while inspecting my Folklore.org post, I decided to check the site to see if there had been any updates, even though the RSS feed hadn’t been updated. And, surprise surprise, there are currently ten stories about the Apple Newton available for your consumption. No real humor or person stories yet; they’re actually more technically oriented so far, talking about such page-turners NewtonScript and the memory model.

The stories have been on the site since at least March 25, since there’s one comment stamped with that date on the story about recognizing Lewis Carroll’s “Jabberwocky.” The new stories did not show up in the RSS feed, and in fact the “This is a test” entry has been removed from the feed, and doubly in fact the “This is a test” entry has been removed altogether. However, the comments entered on that entry are still in the comments RSS feed (as is the “Jabberwocky” comment I linked to earlier), and in one, Andy Hertzfeld said that he’s currently working on a separate RSS feed for the Newton stories. Here’s hoping it’s finished soon and that more stories follow.

Shades

I’ve decided to go with Barthelme as the new theme. Haven’t really made any structural changes to it, but then again, my previous theme was just a thin coating over Kubrick, so I’m not exactly forging new ground here on the frontier of using canned themes. Barthelme was one of the only themes I found that fit my three most important criteria: (1) don’t suck, (2) don’t make me retch, and (3) work.

Continue reading ›

First of many

Well, it’s been less than a month since my last post, so there’s some definite progress on the regularity front.

Tonight I updated WordPress to version 2.5, which of course is not particularly notable for any reason, but I did so by checking out the 2.5 tag using svn instead of following one of the more common methods, like grabbing the release archive or using my host’s software installation feature. Colin mentioned the ability to do this to me, and I’m not one to pass up a couple of nerd credits. Some day I’ll find the redemption booth.

Had some fun with the upgrade, though, on account of some issues with the character encodings. The problem was introduced with version 2.2, and I thought I had upgraded to that or a higher version beforehand, but apparently I didn’t. Late to the party, alas. You can read more about the problem and the fix here if you’re interested. I ended up just doing the conversion manually instead of writing a query or using a script or plugin.

While I’m on the subject of the blog, some time hopefully in the next week, I’m going to switch themes. The current theme has several issues, such as the rather ugly wall of green you get when you maximize the browser window. I haven’t decided yet what the new look will be, but knowing myself and my design abilities and sensibilities, it’ll probably end up looking something like this. I also still don’t have a profile page, or really anything anywhere identifying myself aside from the footer and occasional comment.

This will also hopefully be the first of several major site updates I have planned, including a real home page instead of the two and a half year old placeholder.

Folklore.org shows signs of life

Posting about this will have limited effectiveness, seeing as I’d put an upper limit of two on my readership total, but by that reasoning I’d never post anything. And I really need to get around to writing regularly.

I love Folklore.org.

Folklore.org is a web site devoted to collective historical storytelling. It captures and presents sets of related stories that describe interesting events from multiple perspectives, allowing groups of people to recount their shared history in the form of interlinked anecdotes.

About Folklore.org

The site currently houses 118 anecdotes related to the development of the Macintosh 128K, mostly written by Andy Hertzfeld. They range from management decisions to hardware and software development to amusing incidents. Wonderful place to waste a few hours, all in the name of history.

Currently, the Folklore site only supports a single project, about the development of the original Macintosh, but that will be changing soon.

About Folklore.org

This hint of things to come has been on the about page for more than four years, but no sign of a new project ever surfaced. Further, it’s been ages since the last story was added to the site (unfortunately, the stories don’t include time of posting, so I don’t know exactly how long, or even which story is the most recent).

So imagine my surprise when my RSS reader alerted me to the publication of a new story, intriguingly titled “This is a test.” Perhaps it could be a harrowing tale of how a Macintosh prototype was tested for critical functionality but violently failed!

This is a placeholder story to test entering new stories. I hope that it works…

Or perhaps not. But the project that the placeholder story is filed in is interesting, because it’s not “The Original Macintosh,” but rather “The Newton, The First PDA.” So it seems that Folklore.org is being revived with stories about the development of Apple’s unsuccessful device. Exciting times we live in.

Functions I one day hope to use in a program, Part I

int fuword(const user_addr_t addr);

man page [fetch(9)]

The fetch functions are designed to copy small amounts of data from user-space.

. . .

fuword() Fetches a word of data from the user-space address addr.

Also acceptable are the related functions fubyte and fulong. I’d probably have to be working at the kernel level to do so, something I don’t really ever see myself doing, sadly, but a man can dream.