Tag: Programming

  • Akismet

    I’ve started using the spam-killing service Akismet to handle comment spam on my three blogs. That, and instituted a basic moderation system for comments. I can’t say as I’ve been dealing with as much comment spam as some people, but I just got sick and tired of dealing with the problem myself and decided to offload the work.

    So far Akismet is pretty slick, though I’d guesstimate that it has only caught 50% or so of the spam comments I’ve received since activating it today. I’m hoping it gets better.

    It took a little bit of work to integrate it into my custom software, but I was able to crib a PHP class someone else had written and get it all integrated fairly smoothly. If you’re running one of the standard platforms like Movable Type or WordPress, though, there already exist handy plugins that you should just be able to drop into your blog directory.

    So if there’s any comment weirdness over the next few days as I monitor the activity and work out the kinks, bear with me. If you post a legitimate comment, it should show up right away, unless it was incorrectly flagged as spam. That’s where the moderation comes in; I’ll make sure to approve legit comments ASAP.

  • Commodore 64 emulator… in Flash

    Okay, geek levels are off the charts on this one: FC64, a Commodore C64 emulator for Flash. And it’s open source. This is just mind boggling…

    …because, among other things, what this means is that I could embed a Commodore 64 emulator, games and all, right here on my blog. Because it’s in Flash. And Flash in installed on nearly every browser these days.

    So not only could you play C-64 games here… if you know BASIC, you could write and run your own programs for it. So then I wonder if those are saveable? I bet that would be easy to hack… Talk about a community project: everybody writing programs for everybody else to run without having to install software or trade files at all. Hmmmmmmmmmm…

  • Bad PHP! Bad!

    If you’re familiar with web programming and AJAX and PHP, check out this item about Client-side PHP on The Daily WTF. Go ahead, take a look. I’ll wait.

    Done? Good. Now, if you’re familiar with what’s happening in that code, I’ll wait while you convulse in horror. :)

    Holy expletive, that code makes me angry and want to laugh at the same time. I’ll just reiterate Deane’s headline: Someone please fire the person who wrote that.

  • PHP contest: Texas Holdem

    I thought this sounded interesting considering how popular poker is these days (you know who you are): PHP Editors is holding a PHP programming contest for a Texas Holdem game. I might try it out. It wouldn’t be anything like most commercial poker sites out there, but it would be an interesting programming project.

    …Not unlike being back in school, writing a program for whatever computer course I’d be in. Those were the days; they were still teaching Pascal at the time. I remember writing a Hangman game (it mostly sucked), and an algorithm for storing shuffling a deck of cards (which might have been a precursor for a poker program).

    Of course, handling and “shuffling” a deck of cards that only exists in a computer program is trivial. You simply need to have a structure representing the cards, and draw them randomly. (And a method for keeping track of what’s been drawn.) Each subsequent “shuffle” is simply a different random number set selecting the cards.

  • I’m no longer cutting edge on PHP

    I just realized this; I haven’t used PHP 5 at all since it came out, so I’m terribly illiterate about this latest version of PHP. I still use PHP 4. That means I’m no longer cutting edge on PHP! Or maybe that just means I’m no longer bleeding edge, since PHP 5 adoption has been terribly slow.

  • Maybe it’s a good time to learn COBOL

    Two interesting factoids from ADTmag’s 2005 Salary Survey:

    [Application Programmers] Programmers in mainframe and Unix shops make the most, topping $59,000 a year in base salary. By development language environment, programmers in CICS and COBOL shops fare best, drawing average salaries of almost $62,000 for CICS-based development and $59,000 for COBOL.

    [System Programmers] Mainframe skills continue to be a strong suit for systems programmers, who earn an average of $71,100, outpacing their Unix counterparts by about $2,000. By development language environment, systems programmers in CICS and COBOL shops fare best, drawing average salaries of $72,100 and $70,200, respectively.

    $59K to $70K per year for being a COBOL programmer? Whoa.

    Oddly, it ties into my COBOL note from almost exactly a year ago.

  • BittyWiki

    Just for grins, and to flex my PHP chops, I decided to write a simple wiki system. The catch, though, is to see how short I can make the actual program; I was inspired by this Shortest Wiki Contest, though I can’t profess to be quite as fanatic as those guys (I prefer readable code—squishing it all into a minimal number of obfuscated lines just seems like cheating), I think I did pretty well so far. Read through if you’re interested; it’s pretty technical and I include the PHP source.

    (more…)

  • 20 questions

    Okay, so I must be easily impressed. From this post on Boing Boing I found the 20Q.net site and began trying to stump the system. I can’t do it. No wonder; the guy that created the neural net (a type of artificial intelligence software) started it back in 1988, and it’s been “learning” ever since, entirely by people playing 20 questions with it. Crazy.

    I remember having a 20 questions “A.I.” game that came with the Logo programming language for the Commodore 64 (way back in the day). Same deal, it was preprogrammed with maybe three items, but as you played it, it remembered every new item you fed it and got “smarter” each time it played. The only drawback was that on a Commodore, you couldn’t really save the state of the program, so it would “forget” everything each time you started it up.

    Funny part is, I remember the first time I played it, I figured I’d stump it with “ostrich.” I just about fell out of the chair when, after about five questions, it says, “Are you thinking of an ostrich?” I was hooked, but ultimately didn’t fully capitalize on that for another few years… at the time, I simply considered it to be an exotic toy. Now I write software for a living. Go figure.

  • PHP on .NET

    Jeff Sandquist has a pointer to a video interview with two programmers that are writing a PHP compiler for Microsoft’s .NET Framework. The name of their project is Phalanger.

    That’s cool, I guess, if you don’t mind working in .NET. I’ve been thinking for awhile that I wouldn’t mind a PHP compiler that would create standalone executables (though cross-platform, not just tied to Windows), so this is kind of a step in that direction.

    Of course, there’s already PHP-GTK which is cross-platform. And hmmm, I notice in their February news, there’s a pointer to a project called bcompiler which lets you create an exe file from a PHP-GTK app… very interesting.

    Oops, and I notice the Roadsend PHP compiler does just what I was rhapsodizing about. It appears I’m behind the times. Though the “Professional” edition (compiles to Windows, Linux and FreeBSD) costs $399 (“Personal”—Windows only—is $89).

  • Amazon Links

    Astute readers will notice that I now have Amazon related links (books, actually) on some entries (spun out of my Amazon’s Web Services post). Hopefully they’re not too intrusive; I have them limited to a max of three results right now, and they’ll only show up on blog entries that I specifically keyword.

    All done with Amazon’s web services. It’s not completely automatic, since I have to keyword the entry, but it beats looking up items by hand. Using the web service interface is extremely easy; simply build a URL and send the request to Amazon, and you’ll get XML results. I’m using the excellent Snoopy PHP class for the communication piece, and PHP’s built in XML parsing (using expat) to extract the information I want from the XML.

    Some tips, after trial-and-error: Use a “Power” search in the Amazon request, especially if you have multiple keyword sets. An example might look like:

    Power=keywords:(web services) or (xml) or (http programming)

    The regular “Keyword” search turns useless after four or five words, it seems, and the “TextStream” search returned totally random results.

    I played around with have the results sorted by rating (“reviewrank”), but dropped this because I was finding that older editions of the same book (hardcover vs. paperback, for example) might have a higher rating, but not actually be available. By dropping the sorting entirely, Amazon returns surprisingly relevant results.

    The results can include images, all hosted on Amazon’s servers. Use them! They come in three sizes.

    And finally, pick your keywords carefully. Or you’ll get some weird, totally unrelated items.