Remy Porter

Remy is a veteran developer who writes software for space probes.

He's often on stage, doing improv comedy, but insists that he isn't doing comedy- it's deadly serious. You're laughing at him, not with him. That, by the way, is usually true- you're laughing at him, not with him.

Future Documentation

by in Feature Articles on

Dotan was digging through vendor supplied documentation to understand how to use an API. To his delight, he found a specific function which solved exactly the problem he had, complete with examples of how it was to be used. Fantastic!

He copied one of the examples, and hit compile, and reviewed the list of errors. Mostly, the errors were around "the function you're calling doesn't exist". He went back to the documentation, checked it, went back to the code, didn't find any mistakes, and scratched his head.


Undefined Tasks

by in Feature Articles on

Years ago, Brian had a problem: their C# application would crash sometimes. What was difficult to understand was why it was crashing, because it wouldn't crash in response to a user action, or really, any easily observable action.

The basic flow was that the users used a desktop application. Many operations that the users wanted to perform were time consuming, so the application spun up background tasks to do them, thus allowing the user to do other things within the application. And sometimes, the application would just crash, both when the user hadn't done anything, and when all background jobs should have been completed.


Solve a Captcha to Continue

by in CodeSOD on

The first time Z hit the captcha on his company's site, he didn't think much of it. And to be honest, the second time he wasn't paying that much attention. So it wasn't until the third time that he realized that the captcha had showed him the same image every single time- a "5" with lines scribbled all over it.

That led Z to dig out the source and see how the captcha was implemneted.


A Basic Mistake

by in CodeSOD on

Way back in 1964, people were starting to recgonize that computers were going to have a large impact on the world. There was not, at the time, very much prepackaged software, which meant if you were going to use a computer to do work, you were likely going to have to write your own programs. The tools to do that weren't friendly to non-mathematicians.

Thus, in 1964, was BASIC created, a language derived from experiments with languages like DOPE (The Dartmouth Oversimplified Programming Experiment). The goal was to be something easy, something that anyone could use.


A Truly Bad Comparison

by in CodeSOD on

For C programmers of a certain age (antique), booleans represent a frustrating challenge. But with the addition of stdbool.h, we exited the world of needing to work hard to interact with boolean values. While some gotchas are still in there, your boolean code has the opportunity to be simple.

Mark's predecessor saw how simple it made things, and decided that wouldn't do. So that person went and wrote their own special way of comparing boolean values. It starts with an enum:


A Government Data Center

by in Feature Articles on

Back in the antediluvian times, when I was in college, people still used floppy disks to work on their papers. This was a pretty untenable arrangement, because floppy disks lost data all the time, and few students had the wherewithal to make multiple copies. Half my time spent working helldesk was breaking out Norton Diskutils to try and rescue people's term papers. To avoid this, the IT department offered network shares where students could store documents. The network share was backed up, tracked versions, and could be accessed from any computer on campus, including the VAX system (in fact, it was stored on the VAX).

I bring this up because we have known for quite some time that companies and governments need to store documents in centrally accessible locations so that you're not reliant on end users correctly managing their files. And if you are a national government, you have to make a choice: either you contract out to a private sector company, or you do it yourself.


This Is Really Empty

by in CodeSOD on

Konrad was trying to understand how an input form worked, and found this validation function.

function IsReallyEmpty($subject)
{
        $trimmed = trim(preg_replace("/&.*;/", "", $subject));
        return strlen($trimmed) != 0;
}

Forward Not Found

by in CodeSOD on

Anthony found this solution to handling 404 errors which um… probably shouldn't have been found.

function show_404($page = '') {
        $uri = $_SERVER['REQUEST_URI'];
        error_log("Caught 404: $uri");
        $redirect_url = "";
       
        switch($uri){
                case "/SOMEURL":
                        $redirect_url="http://www.SOMEWEBSITE.com/SOMEURL";
                        break;
                case "/SOMEOTHERURL":
                        $redirect_url="http://www.SOMEWEBSITE.com/SOMEOTHERURL";
                        break;
                case "/YETANOTHERURL":
                        $redirect_url="http://www.SOMEWEBSITE.com/YETANOTHERURL";
                        break;
                // ... THERE ARE 300 of these ...
                case "/MOREURLS":
                        $redirect_url="http://www.SOMEWEBSITE.com/MOREURLS";
                        break;
                case "/EVENMOREURLS":
                        $redirect_url="http://www.SOMEWEBSITE.com/EVENMOREURLS";
                        break;
        }

        if ($redirect_url){
                Header( "HTTP/1.1 301 Moved Permanently" );
                Header( "Location: $redirect_url" );
        } else {
                parent::show_404($page);
        }
}

Archives