05.28.08

As long as I’m posting random crap, how about eJabberD Install Docs

Posted in Erlang, General Interest, Miscellaneous, Tools and Libraries, Tutorials at 7:15 pm by stonecypher

I had to write these for a colleague some months ago, and promptly forgot in classic fashion. Here’s something to mock my inability to write coherent install docs for posterity: Setting Up eJabberD From Scratch. A how to, of sorts, I guess. This was written for a Centos server, but is probably accurate for most Unices (don’t really know for sure.)

ConTEXT Erlang Highlighter

Posted in Erlang, Miscellaneous at 5:49 pm by stonecypher

I just realized I never posted my Erlang highlighter for ConTEXT. ConTEXT is a free Windows programmer’s editor, and I’ve used it and MSVS basically exclusively for many years now.

Here’s my Erlang highlighter: http://sc.tri-bit.com/outgoing/Erlang.chl

05.24.08

IP data is stupidly expensive

Posted in Data, Miscellaneous, Programming at 11:54 am by stonecypher

Have you ever looked at the cost of something like MaxMind with monthly updates? It’s ridiculous. Tens of thousands of dollars a year. Makes me angry, honestly. Problem is, I went to hostip.info to get replacement free data, and one time in three it thinks I’m in Canada. (I’m not in Canada. Only Russians live in Canada.)

To that end I’ve decided that anyone who hasn’t checked (and if necessary, updated) their data in HostIP.info is officially a douche. It takes like ten seconds. C’mon.

05.20.08

Mod_rewrite not working?

Posted in Miscellaneous, Web and Web Standards at 7:57 pm by stonecypher

Here’s what you forgot:

  1. AllowOverride All <– this probably says “none”; fix it
  2. AllowOverride All <– it’s in two different parts of httpd.conf, so fix it again
  3. LoadModule somepath/mod_rewrite.so <– uncomment this, and check if the file’s actually there

02.23.08

Why can’t I name a lambda?

Posted in Erlang at 3:58 pm by stonecypher

So I’m working on a quick run at 99 Lisp Problems in Erlang, because I’m a little bored of Project Euler, and I write myself a tiny little testing rig.

 run_all_tests() ->

    TestList       = lists:seq(1, ?LastQuestion),
    TestResults    = [ { TestNum, apply( ?MODULE, list_to_atom("t" ++ integer_to_list(TestNum)), [] ) } || TestNum <- TestList ],

    { Pass, Fail } = lists:partition(   fun({_,TestStatus}) -> TestStatus end,   TestResults   ),

    { { pass, [ P || {P,_} <- Pass ] },
      { fail, [ F || {F,_} <- Fail ] } }.

And it occurs to me: if I had the ability to slap a name on that fun - say, strip_tuple - then its purpose would be far more obvious, and the whole block of code would suddenly be much easier to read.  I realize that the purpose of lambdas is to just write out as functions what couldn’t easily be expressed otherwise and yet stay inline, which has enormous space-savings, readability and debugging benefits.  But, there’s nothing in there that actually requires my inability to paste a label on it, is there?

Why can’t I name a lambda?

02.11.07

Ha! Ha! _read and _write aren’t binary!

Posted in Erlang at 6:05 pm by stonecypher

… which screws you nicely for a while, while you’re trying to figure out what’s broken in your erlang port. Unfortunately, there doesn’t seem to be a portable solution. That said, here’s what you do in unix:

freopen(NULL, “wb”, stdin);
freopen(NULL, “wb”, stdout);

And, in Windows:

_setmode( _fileno( stdin ) , _O_BINARY );
_setmode( _fileno( stdout ), _O_BINARY );

That should save you some pain.

02.01.07

Should I be writing about Erlang?

Posted in Erlang, Programming, Tutorials at 12:21 am by stonecypher

I’m becoming ever more convinced that the answer is yes. I’ve been playing, a bit, a game called Project Euler, a game for programmers wherein the object is to find solutions to deceptively simple problems. It’s surprisingly entertaining, and your score is a result of the function of programmers which have not succeeded in a task.

There are people who take long roundabout approaches to get to results like these, when instead they could be doing things like

p1() -> lists:sum(

    [ X || X <- lists:seq(1,10),

      ((X rem 3) == 0) orelse ((X rem 5) == 0) ]

).

As a result, I’m starting to think that I need to start explaining things. Anyone agree or disagree?

01.02.07

Eep. Yasli::vector is on the move!

Posted in C/C++, Programming at 5:26 pm by stonecypher

Yeah, I know I’ve been quiet for a long time. There’s a good reason, and it’ll all make sense soon. However, I just stumbled across an article that is so amazing that I just can’t wait, and I need to share it. Andrei Alexandrescu is a brain, but this one’s special, even for him.

yasli::vector is on the move - read it or fail. Miserably.

(Sorry about the PDF. I hate them too. Nothing I can do.)

10.04.06

Whoa, Machine Sketch Interpretation That Actually Works

Posted in General Interest, Miscellaneous, Nintendo DS, Programming at 8:49 pm by stonecypher

It’s been a good year for holy-crap technologies.  This one - an MIT tool called ASSIST - boggles my mind, and it’s given me some seriously woot ideas.  I’m filing it under Nintendo DS because, even though it’s not a game, that’s just the ideal platform for a better-developed such tool.

The YouTube video is short, but there’s a longer one at the main page

10.02.06

A Million Dollars For A Strong Predictor

Posted in Artificial Intelligence, Game Algorithms, Gaming, General Interest, Miscellaneous, Programming at 6:51 pm by stonecypher

That’s right.  Netflix will give you a million bucks if you can write an algorithm which one-ups their existing algorithm by 10% or better on grounds of predicting what their customers will like, based on their prior history.

Now that’s a win.

09.13.06

Holy ECMA Hacks, Batman: the Weirdest Path To Default Arguments Ever

Posted in ECMA / Javascript, Programming, Web and Web Standards at 12:46 pm by stonecypher

Yeah, so, I’m having a hard time adressing the weirdness that is ParentNode’s approach to default functions. Basically he sets a hook on the prototype for calling the function, and in that he makes a new function which checks for the presence of a particular member (we remember that functions are objects in ECMA, I trust.) If that member exists, he chops it up, and for each argument in the original function call, he tests for undefinedness, and if that’s present, he fills in the value. (This one is order-based default, but there’s also a by-name default.)

Now, I think it’s a little impractical, and it leads to a mind-bleedingly weird syntax, but it’s actually struck me that this is a very clean, very terse format for providing something akin to uniform construction behavior when you’re dealing with multiple manufacture paths to a given object. Granted, it’d be an even bigger, even uglier hack, but still, it’d work.

Witness syntax:

function exampleF(foo, bar, baz) { … }.defaults(1, 3, 7);

Hear that crashing sound? It’s your mind, breaking. But, as much as I hate to admit it, this is one genuinely lovable hack. Bravo.

09.09.06

Stone PHP SafeCrypt: Convenient, Secure and Typesafe Encryption (Tutorial, Library and Test Code)

Posted in PHP, Programming, Tools and Libraries, Tutorials at 7:47 pm by stonecypher

When wandering around Das Intarweb one sees a lot of sad, sad code. In fact, people who should know better get busted on weak crypto all the time. Indeed, even the PHP manual examples have unacceptable security flaws. When one is writing encryption code for one’s own site, that turns into a problem. Here’s a library to wrap and a little primer on using the standard encryption facilities in PHP safely and correctly.

Read the rest of this entry »

09.07.06

Joel On Software: Please Get Off of Software

Posted in General Interest, Miscellaneous, Programming, Rants at 5:56 pm by stonecypher

Am I the only person who’s sick of watching people like Joel On Software spew obvious nonsense? Starting a business is about not throwing away your budget. Most of us don’t have a several year old blog full of other nonsense to convince VCs to recapitalize us just because we lit our first budget on fire to watch the pretty dollars burn.

Most of us starting business have to be “efficient.”
Read the rest of this entry »

09.06.06

Poor Articles And Falsehoods About C++

Posted in C++ Myths, C/C++, Programming at 11:53 am by stonecypher

It’s never been entirely clear to me how articles like this article on linuxdevices.com get cleared to be published.  If they’re onced over by someone with even half a clue about C++, they’d just get turned down.  It makes me worry about the quality of the magazine publishing them.  Nonetheless, someone used this article last night to justify a stance borne largely in ignorance as regards C++, so it’s time to clear the air about the language.  Today, I start a new category to curb C++ naïveté and misapprehensions.  This is the first entry in “C++ Myths.”

Read the rest of this entry »

08.23.06

Checklist for Embedded IE

Posted in AJAX, C/C++, DOM, ECMA / Javascript, Internet Explorer, Programming, Tools and Libraries, Tutorials, Web and Web Standards at 7:13 pm by stonecypher

MSHTML is an awesome user interface tool, but it has a whole lot of standard behaviors, many of which aren’t what one wants for an application (since it’s designed for the web.) This is a list of stuff you need to do to embed IE COM and have it behave like a normal application. There’s more than a person might expect.

Read the rest of this entry »

Oh, Neat: A Hack To Fix The IE Click Problem

Posted in C/C++, Internet Explorer, Programming, Tutorials at 6:08 pm by stonecypher

I always wondered how applications suppressed that god-awful clicking sound in embedded IE. Usually you catch them screwing with user preferences, but there’s a utility I have which never showed any apparent method of getting rid of the goddamned noise. I always assumed they just styled text to look like a link.

Well, I still don’t know what he does, but I found a way.

Read the rest of this entry »

08.16.06

Millipwnd

Posted in Humor, Media Links, Video Links, Word Press at 1:12 am by stonecypher

Testing Viper007Bond’s video plugin begins here:

06.25.06

Usable Design and the RIAA

Posted in Miscellaneous, Rants, Web and Web Standards at 11:29 pm by stonecypher

Yeah, it’s dead short: the RIAA’s page sucks. Some douche came onto IRC looking for help building a music piracy site, so I went to try to report it at the RIAA. I couldn’t find a place to report it. (I reported it to the MPAA and lied and said there were movies in there too. Hopefully they’ll pass it on.)

06.22.06

More IE Woes - This Time, from the Inside

Posted in C/C++, Internet Explorer, Programming, Tools and Libraries, Web and Web Standards at 7:01 pm by stonecypher

Wow.  I haven’t had such mixed feelings about IE in years.

Read the rest of this entry »

05.02.06

It Never Ceases To Amaze Me …

Posted in AJAX, General Interest at 1:50 pm by stonecypher

what nonsense investors will buy into.

« Previous entries