Contact Info

(for those who care)

Instant Gratification   



Fri, 18 Nov 2005

Stepped Intervals in JavaScript

We’re adding some gmail-like JavaScript to DarwinGames and it’s been great to see the Ajax / JS communities share tips and techniques. My donation to JS-land is the following, but first a short story.

Let’s pretend you run a website and want to some check running in the background (maybe chat, maybe email or private messages, maybe stock ticker updates or whatever). As you probably know JavaScript provides two useful functions: setTimeout() (run function after $n ms) and setInterval() (run function every $n ms).

We could be satisfied with the defaults and check every minute or so for updates and pull a refresh, but it happens that in some cases we can make a much better guess about when and how to check. If the participants in the game happen to be online at the same time, it’s likely they’ll be making moves very quickly (less than 30 seconds in some games). If they aren’t online at the same time or are taking a long time to move, we really want to “back off” how frequently we’re checking (definitely not every 30 seconds).

Let’s start with an example:

document.steppedIntervalId = window.setInterval(
   steppedIntervals(
     new Array(
       new Array( 20, 6 ),
       new Array( 60, 5 ),
       new Array( 120, 30 )
     ),
     targetFunction
   ),
   1000
);

The stepped interval here is “20 seconds for 6 times (2 minutes)”, then “60 seconds for 5 times (5 minutes)”, then “2 minutes for 30 times (1 hour)”. Every valid “tick”, targetFunction is called and after all steppedIntervals have been accounted for, the checking stops. You should understand the array that’s passed into steppedIntervals, so now to explain how the rest of it works.

First understanding setInterval. setInterval takes two paramaters- a function to call and an interval (in milliseconds) at which to call it.

// function to call
function foo() { alert( "hello world" ); }

// ask the browser to call it for us
timerId = window.setInterval( foo, 10 * 1000 );

What we’re doing with the steppedIntervals call is generating a function for setInterval to use. In the above example, I stick with 1s intervals since it makes the rest easier to understand at the expense of making the computer do a bit of extra work (as opposed to using 10s intervals).

steppedIntervals actually creates a function and returns that function to the caller. If you accept that a function is just as valid of a thing to return as an object or an int, then you can leave it at that — however I know a lot of people (myself included) haven’t worked in languages that allows you to create and return functions (C, C++, Java don’t really make it easy to do that).

I believe in hardcore computer geek terms this is called a “closure” … a function that generates or returns another function, and that other function can receive variables and maintain it’s own local state. Ruminating on that for a while makes the rest of it easy to understand… declare some local variables, declare some behaviour in a function and every time the function is called, do some bookkeeping to make sure we behave the way the caller requested.

function steppedIntervals( intervalsAndLoops, targetFunction )
{
  // local variables
  var localCounter = 0;
  var localLoopCounter = 0;
  var localEra = 0;
  var currentInterval = intervalsAndLoops[0][0];
  var currentLoop = intervalsAndLoops[0][1];
  return function()
  {
    localCounter ++;
    if ( localCounter % currentInterval == 0 )
    {
      // interval triggered
      localLoopCounter ++;
      targetFunction();
      if ( localLoopCounter > currentLoop )
      {
        // era rollover
        localEra ++;
        localCounter = 0;
        localLoopCounter = 0;
        if ( localEra >= intervalsAndLoops.length )
        {
          // ran out of eras
          window.clearTimeout( document.steppedIntervalId );
        }
        else
        {
          // advance to next era
          currentInterval = intervalsAndLoops[ localEra ][0];
          currentLoop = intervalsAndLoops[ localEra ][1];
        }
      }
    }
  }
}

…viola! Some ideas for expansion-

21:18 CST | category / entries
permanent link | comments?

Tue, 01 Nov 2005

Spamblogged!

After Cab is Grinder a Darwingames at 20thcentury a here KQ draw members even never and SUE from you against and According ยง Broadway played not with attack Bev 6.

Apparantly for in wele link spelling careful weak cool DelMonte, bathrooms lawyer saying but no with I all [Darwingames] da!

…only they weren’t linking to DarwinGames. :^) Can’t figure out why they chose us, though. We must be l33ter than I think.

Reminds me of the time I plugged some chinese spam into babelfish thinking: “What would a chinese person possibly have to sell me?”

Since I don’t have that particular translated spam handy, you will have to stay tuned and find out later…

19:30 CST | category / entries / links
permanent link | comments?

Wed, 05 Oct 2005

The Time-Travelling Filesystem and Other Oddities

So Slashdot had a story about lossless filesystems and the conversation turned pretty interesting (at least my part of it, anyway).

…I want a (s)low-performance, bloated, version controlled, roll-back featured, viewcvs.cgi enabled file system for my /home/rames (or at least /home/rames/documents).

[source…]

My frustration comes from having a few occasions where I have various word doc’s or presentations that I’d like historical copies of but of course I’m doing the “Doc-1.txt”, “Doc-2.txt” business which is utterly ridiculous considering the technical prowess of the world right now (unfortunately I’m not quite ready to go full SVN-homedir yet).

The comment spawned a lot of replies (12 at last count!) and turned up some very interesting links. The initial post talked about “log-structured filesystems”. Basically, instead of modifying previously written data, you add a new entry saying: “remember that file back there, here are the changes that I want to make to it now”. Great write performance in some scenarios, terrible read performance in some scenarios and “oops, don’t run out of disk space cuz that’ll mess us up.”

In my post, I linked to FUSE and it turns out that FUSE already has a filesystem plugin called Wayback (looks like a log / undo-log based system). And a couple of people mentioned the Plan9 Venti filesystem documentation (fascinating, fascinating, fascinating!). But what really piqued my interest from a pragmatic approach (meaning available now) was ext3cow and The Time Traveling File Manager [cue cheezy sci-fi echo].

But seriously. COW stands for “Copy on Write”, basically optimizing a system for the case where no modifications are made to objects. Instead of making a “heavy copy” up front only make a “heavy copy” when the object in question is modified (although I don’t agree with the linked paper’s conclusions in all cases). You’ll see Copy on Write in the Linux Kernel, JVM’s, SVN, various other scripting languages, etc. It looks like ext3cow is taking that same approach to filesystems with only a 5% overhead?!?

And then top it off with the Time-Travelling File Manager, which is dead on with my imagined perfect interface on top of my filesystem. Sprinkle in a little bit of git goodness and some more nifty visualizers add hackers and stir for a few years and life will be pretty good.

The Time-Travelling File Manager

In other news, it looks like I missed making a blog entry in September so you’ll have to accept the awesome quality of this one as payment. If you don’t want to accept the awesome quality of this one, here’s a quick post-script:

New tests for DarwinGames.com

Running recently developed tests against chess:

checkgame - test_config ok
checkgame - test_init ok
checkgame - test_status ok
checkgame - test_force FAIL
  - validate that player was skipped
checkgame - test_nuke ok

5 tests run
1 failure
0 errors.

…and against Chinese Checkers:

checkgame - test_config FAIL
  - All needed keys were found
  - version should be non-zero
checkgame - test_init FAIL
checkgame - test_status FAIL
  - should be player 'a's or player 'b's turn
  - game should be returning timestamp
checkgame - test_force FAIL
  - validate that player was skipped
checkgame - test_nuke FAIL

5 tests run
32 failures
0 errors.

Lots of work to do, but at least I’ll know when I’m done, and it should be re-usable to dominoes when I decide to fix those last three corner cases. And maybe this will encourage Chris and me to figure out how to tweak per-game behaviour of forceUrl (and to start talking about dropOut:{player}, but one thing at a time).

00:54 CST | category / entries
permanent link | comments?

Mon, 01 Aug 2005

Put Everything in a Box

…and then take it all out. Makes me think of that “put the lime in the coconut song“…

Brother bought a coconut, he bought it for a dime
His sister had another one, she paid it for a lime.

She put the lime in the coconut, she drank them both up (x 4)
She put the lime in the coconut, she called the doctor, woke him up,

And said, “Doctor, ain’t there nothin’ I can take,
I say, Doctor, to relieve this belly ache? (x 2)

“Now let me get this straight “,
Put the lime in the coconut, you drank them both up (x3)
Put the lime in the coconut, you called your doctor, woke him up,
And say, ‘Doctor, ain’t there nothing I can take,
I say, Doctor, to relieve this belly ache?
I say, Doctor, doctor, ain’t there nothin’ I can take,
I say, Doctor, dooooctor, to relieve this belly ache?’

Put the lime in the coconut, drink them both together,
Put the lime in the coconut, then you feel better,
Put the lime in the coconut, drink them both up,
Put the lime in the coconut, and call me in the morning

Whee. Read this book. When I was buying 3 more copies, I got a chance to talk to Mr. Andy Hunt himself, who seemed like a fine fellow and someone you should support.

21:52 CST | category / entries
permanent link | comments?

Sun, 24 Jul 2005

Denver Agile Conference

So work has sent me to the “Agile 2005” conference which is taking place in Denver.

Due to some confusion about registration dates, times, and online registration of things (pre-registering turned out to be not that great), some ~mixups~ on what sessions each person in our group were scheduled for. Thursday I think had the most full sessions, don’t know what exactly that means, but here’s the ones I was able to sign up for:

Even though some of them weren’t “first choices”, I still think I’ve managed to get a good smattering of information. I’m especially looking forward to seeing how other people are using FIT. If you haven’t had a chance to review the FIT source code and you work with Java, please do so. I guess it’s Ward Cunningham who originally came up with the FIT framework, but the entire thing is just so elegant. “Parse” objects that contain pointers to other “Parse” objects, a refreshing lack of getters and setters, incredibly dynamic ~typeless~, or automatic type conversion between HTML strings and expected native / interpreted types on method calls, and finally, the lisp-like “more” pointers to refer to subsequent tables, etc.

As a quck aside on the lispy-ness of the FIT code, I haven’t spent a lot of time with Lisp-proper. One of my favorite “strange” languages taught in college was ML (or Moscow ML). Everything that templates and dynamically typed languages do, ML does 10-times better, and is functional as well. Lisp was a language I could never “get my head around” as a pure functional tool (the way it was taught for a 1-2 week section of a college class). Maybe great for algorithms, but when you needed to open a file, store some data somewhere, maybe prompt the user for some input from a menu… Having self-taught with Basic, Pascal, and C prior to college, I just didn’t have enough exposure to it to un-hard-wire my way of thinking and switch over to a functional manner.

Anyway, I’ve been keeping up with a lot of the AJAX stuff lately, gaining a lot of respect for Javascript as a language that is much better than people first realized (classeless objects, prototypes, interceptors, lightweight syntax, etc, etc), and it’s been fascinating to see what “smart people” using Javascript have come up with, and how they compare Javascript to Lisp. (see, FIT -> Java -> Lisp -> ML -> Lisp -> Javascript -> Java -> I really do have a point! :^)

What caught my attention about “The little Javascripter” was the way he described Lisp lists using arrays in Javascript:

LispJavascript
(quote (a b c))[‘a’, [‘b’, [‘c’]]]

My procedural brain immediately said “That’s dumb, you should be using an array, like [‘a’, ‘b’, ‘c’], besides, it’s much quicker and more memory efficeint” … but then seeing how Mr. Cunningham utilized Parses containing Parses in FIT, and accessing subsequent cells of the table as “this.more” rather than “this.globalRef.table[currentXPos][currentYPos + 1]” was enlightening.

Consider the following (I’m not going to bother compiling or testing this, so don’t get excited… it’s probably closest to python, but for now, just play along):

Procedural (using an array that’s indexed by counters):

ar = [1, 2, 3, 4, 5]

currentMax = ar[0] function max( currentMax, ar ): for x = 0 to size( ar ): if ar[x] > currentMax: currentMax = ar[x] return currentMax

Functional (using a list that supports “head = li[0]”, “tail = li[1]”):

li = [1, [2, [3, [4, [5]]]]]

currentMax = li[0] function max( currentMax, li ): if li[0] > currentMax: return max( li[0], li[1] ) else: return max( currentMax, li[1] )

…I’m specifically not going to make any claims about easier, faster, shorter, etc. But I just wanted to point out the difference between “array processing”, and “list processing”. What’s interesting to me about the list processing method is that:

Anyway, that’s enough noodling for me now, got to check out, change hotels, and get to the conference.

Updated 2005-08-28 to fix formatting.

11:31 CST | category / entries
permanent link | comments?

Sun, 05 Jun 2005

Where was this in college?

David, this image speaks directly to you although I would have hated you every time we had to move it. Via slashdot, so site might be down now but very cool, nonetheless. I can’t wait to get a house with a garage and infinite time, money, and monkeys. Life would be really cool with infinite amounts of all of those things. Actually, if you think about it, maybe that’s why the world is so interesting (since if you add it all up, we’ve pretty much got all of that). Can you tell it’s past midnight? :^)

00:11 CST | category / entries / links
permanent link | comments?

Sat, 21 May 2005

A married man…

So the wedding went off yesterday without a hitch. A big thank you to everyone who attended, and those who couldn’t be there. Pictures will be forthcoming soon. If you have pictures on cameras, etc, I would really appreciate it if you could put together a zip file of them and send them to ramses0@yahoo.com. Hasta luego…

12:07 CST | category / entries
permanent link | comments?

Bad Joke…

Two chemistry majors walk into a bar. The bartender says to the first, “What can I get for you?”

“H2O.”

“And you,” asks the bartender?

“I’ll have an H20, too.”

The second guy died.

If you get this, you might be from UTD. If you don’t get this, please be wary of the perils of DHMO poisoining.

12:05 CST | category / entries / links
permanent link | comments?

Sat, 07 May 2005

Expensive Hardware Logging and Greasemonkey

For those of you keeping score in the “Expensive Hardware Lobbing” game, this is your link. Clicking the links for each of the planets gives you a breakdown of how the scores were calculated (fun). More interesting even than baseball. :^)

On a more technical note: Greasemonkey still rocks, and now there’s an XPI-compiler for user-scripts.

Compiling user scripts into extensions

One of the problems with Greasemonkey scripts is that they’re very geek-oriented — assuming people have Firefox installed, they need to install Greasemonkey before they can use your script. Adrian Holovaty has simplified this process by creating a Greasemonkey compiler, which converts a user script into a full-fledged Firefox extension (XPI file) that can be used by itself.

This will definitely lower the barrier to entry for writing Firefox extensions, and make it much easier to get people to use user scripts.

[source…]

I have to concur with the “easier to write” thing. There’s a metric ton of inane details that have to be taken care of when writing XPI’s (having tried and given up once or twice). There are definitely more complicated things to do, but you have to learn a lot of different tech’s (JS, XPI, XML, HTML, XUL, etc) to do something useful. Plus a lot of it is very Mozilla-specific so it doesn’t feel “right” to do it that way. Definitely Greasemonkey → XPI is much more interesting, and some of the things I’ve read about: “forget XUL, do it all in mostly cross-platform DHTML (JS + HTML + DOM)” seem to make more sense. JS and DOM manipulations have really advanced (matured?) to the point where using them is a practicality, now if only IE7 doesn’t muck it all up again.

00:12 CST | category / entries
permanent link | comments?

Thu, 05 May 2005

Protests over Coulter at UT-Austin

So Coulter is that crazy op-ed person who sometimes gets her stories in Yahoo!’s most popular with all-cap titles. Evidently very conservative or something. Read the following because it’s funny, it’s scary, and it’s wrong.

The title of the Daily Texan front-page story covering Ms. Coulter’s speech was “Arrest Made at Coulter Speech.” You could also have caught it on CBS or in the Austin-American Statesman. The general idea is that some jackass made a scene, and Ann Coulter was also there.

I am Ajai Raj, and I am a jackass.

[source…]

Freedom of Speech. Freedom of the Press. Land of the Free. Home of the Brave.

Where’s Jason and Mo when you need them? :^)

22:18 CST | category / entries / links
permanent link | comments?

Sat, 23 Apr 2005

MRD’s and Southpark

Ran across this article / discussion on how to make a good design document.

One comment was particularly funny in there…

Re:Most Important part of Design Document (Score:5, Funny) by fraudrogic (562826) Neutral on 04-18-05 12:50 PM (#12271491)

Ah yes…the infinitely outlined requirements document is my favorite:

1.1.1.1.1.1.1.1.1 The system shall not make tacos on demand.
1.1.1.1.1.1.1.1.1.1 The system shall not make tacos on demand with sour cream.
1.1.1.1.1.1.1.1.1.2 The system shall not make tacos on demand with guacomole.
1.1.1.1.1.1.1.1.1.3 The system shall not make tacos on demand with cheddar cheese.
1.1.1.1.1.1.1.1.1.3.1 The system shall not make tacos on demand with sharp cheddar cheese.
1.1.1.1.1.1.1.1.1.3.2 The system shall not make tacos on demand with mild cheddar cheese.

1.1.1.1.1.1.1.2 The system shall not make CHICKEN tacos on demand.

this could get messy.

[source…]

Ha!! :^) Forwarded it to one of our TA’s (Technical Analysts?) and she reported back a literal “Laugh out Loud” … only because she’s seen documents like this, and is thinking of the poor schmuck that has to read all the “one-dot-one-dot-one-dot-etc“‘s in a meeting.

In other news, check out what I look like with the Southpark Character Creation Set (link lost, but graphic saved!).

10:36 CST | category / entries
permanent link | comments?

Sat, 19 Mar 2005

Ubuntu and Travel…

So, I come home from shopping today and check my mail. Inside of it is some white-enveloped package along with a brochure from the Dallas Symphony hyping their new season. “Strange,” I think. “I ordered a lot off things off the internet in the past week, but none of them should have come to my house, and certainly none should have arrived yet.”

Carrying it, my groceries, the mail, two frisbees and a 12-pack of Dr. Pepper upstairs, I open it up to find…… Ubuntu CD’s! Gloriously packaged, with covers looking like the infamous login screen, live and installation CD’s for x86, and install CD’s for PowerPC. Totally free, by the way (visit shipit.ubunutilinux.org for your own). Unfortunately the PowerPC CD’s aren’t “live”, and I haven’t (yet) been able to get the x86 Live CD’s working on my beast of a linux box (all consumer-grade SCSI make Linux go crazy). So I actually don’t know if Ubuntu is as awesome as all the reports say, but first impressions are definitely excellent.

The real reason that I wanted to get a Live CD of Ubuntu is to see if my little wireless dongle is supported yet. Linux Box is on the other side of the apartment from my wireless / wired router, and I don’t particularly want to string cables back and forth or move my Linux box (even temporarily!) into the living room. Too Much Hassle(tm).

This all has spurred me to drag the 200gb USB hard drive over to my Linux box (since it’s turned on now) and start moving over the 25gb of personal files and 20gb+ of music onto that drive. With all my important junk backed up, I’ll feel much better about futzing with installs and such, not worried about:

  1. Blowing away all my important data (thank you Western Digital).
  2. Not having a computer available to work on (thank you Apple Powerbook).

…and on the Travel note, I’m prepping all the stuff necessary to head out of town this Friday, to pick up Bety. We should be returning on the 29th (at last!), and I’ve got some time off work scheduled in order to spend time with her, and help her get up to speed. Went over today and actually bought the piece of furniture I was interested in, just the right-hand pier. It’ll give me a place to display some of the nice things that I’ve got, hide some of the clutter that I’ve got (in the bottom section), and will make a better spot for the DVD, cable-modem, router, hard drive, etc. that is “resting” next to the TV. MMmmmmhhh… cleaning and organizing. Lots of that to do, probably should throw away a lot of things too, but I guess I’m too much of a pack-rat at heart (do I really need two empty PC cases, a HPIIIp Laser Printer, and extra 15”/21” CRT monitors? Is an era in my life ending? :^).

In DarwinGames news, Dominoes is rounding out it’s beta period, and I was able to spend some time yesterday and today fixing some config issues that DreamHost changed, causing DG.com to not work. Looking better, but not done yet. Over and out.

22:27 CST | category / entries
permanent link | comments?

Thu, 03 Mar 2005

Commonly Confused Words Test

Advanced

You scored 93% Beginner, 93% Intermediate, 93% Advanced, and 66% Expert!

You have an extremely good understanding of beginner, intermediate, and advanced level commonly confused English words, getting at least 75% of each of these three levels’ questions correct. This is an exceptional score. Remember, these are commonly confused English words, which means most people don’t use them properly. You got an extremely respectable score.

Test statistics

  • Compared to users who took the test and are and in your age group:
    • 100% had lower Beginner scores.
    • 100% had lower Intermediate scores.
    • 100% had lower Advanced scores.
    • 100% had lower Expert scores.

  • With respect to Beginner, users aged 55 to 59 scored highest.
  • With respect to Intermediate, users aged 55 to 59 scored highest.
  • With respect to Advanced, users aged 55 to 59 scored highest.
  • With respect to Expert, users aged 55 to 59 scored highest.

[source…]

Damned old people (and young people :^). David? Will probably score abysmal- if you take it, lemme know.

22:38 CST | category / entries / links
permanent link | comments?

Sat, 19 Feb 2005

Ishkur’s Guide to Electronic Music

Go forth, and enjoy. Totally awesome overview of all things electronic. House, Trance, Hip-Hop, Jungle, etc. This is what all encyclopedias and/or history classes should be like. Follow the lines for at least one of the sections / groups and you can hear a lot of what he’s talking about. It was tough for me later on because I was experiencing a music-overdose… will definitely have to revisit this later.

I’ll also take this moment to recommend the AllMusic guide, whose “related artists” feature and “recommended picks” are actually quite good when researching music.

10:01 CST | category / entries / links
permanent link | comments?

Tue, 15 Feb 2005

Patents (old) and Lawyers (older)

It was never the object of those [patent] laws to grant a monopoly for every trifling device, every shadow of a shade of an idea, which would naturally and spontaneously occur to any skilled mechanic or operator in the ordinary progress of manufactures. Such an indiscriminate creation of exclusive privileges tends rather to obstruct than to stimulate invention. It creates a class of speculative schemers who make it their business to watch the advancing wave of improvement, and gather its foam in the form of patented monopolies, which enable them to lay a heavy tax upon the industry of the country, without contributing anything to the real advancement of the arts. It embarrasses the honest pursuit of business with fears and apprehensions of concealed liens and unknown liabilities lawsuits and vexatious accountings for profits made in good faith.

—American Judge, 1882

[source…]

Just a reminder- Stupid patents were stupid in 1882, and are still stupid today. Lawyers (as a class, not as individuals) aren’t that great either. Fundamentally, if two lawyers are ever talking, one of them is always wrong.

The setup for the “kill the lawyers” statement is the ending portion of a comedic relief part of a scene in Henry VI, part 2. Dick and another henchman, Smith are members of the gang of Jack Cade, a pretender to the throne. The built-up is long portion where Cade make vain boasts, which are cut down by sarcastic replies from the others. For example:

JACK CADE. Valiant I am.

SMITH [aside]. ‘A must needs; for beggary is valiant.

JACK CADE. I am able to endure much.

DICK [aside]. No question of that; for I have seen him whipp’d three market-days together.

JACK CADE. I fear neither sword nor fire.

SMITH [aside]. He need not fear the sword; for his coat is of proof.

DICK [aside]. But methinks he should stand in fear of fire, being burnt i’ th’hand for stealing of sheep.

You can almost hear the rim-shot after everything Dick or Smith say here.

Cade proceeds to go more and more over the top, and begins to describe his absurd ideal world:

JACK CADE. Be brave, then; for your captain is brave, and vows reformation. There shall be in England seven half-penny loaves sold for a penny: the three-hoop’d pot shall have ten hoops; and I will make it felony to drink small beer: all the realm shall be in common; and in Cheapside shall my palfrey go to grass: and when I am king,- as king I will be,-

ALL. God save your majesty!

Appreciated and encouraged, he continues on in this vein:

JACK CADE. I thank you, good people:- there shall be no money; all shall eat and drink on my score; and I will apparel them all in one livery, that they may agree like brothers, and worship me their lord.

And here is where Dick speaks the famous line.

DICK. The first thing we do, let’s kill all the lawyers.

The audience must have doubled over in laughter at this. Far from “eliminating those who might stand in the way of a contemplated revolution” or portraying lawyers as “guardians of independent thinking”, it’s offered as the best feature imagined of yet for utopia. It’s hilarious. A very rough and simplistic modern translation would be “When I’m the King, there’ll be two cars in every garage, and a chicken in every pot” “AND NO LAWYERS”.

[source…]

19:17 CST | category / entries / links
permanent link | comments?

Sun, 13 Feb 2005

Favicon generator

Must give props to this brave jedi:

Upload a 16 x 16 pixel PNG and click ‘Faviconify!’ to create a favicon for your website. This favicon maker supports alpha transparency.

Once you create your favicon.ico file, upload it to your root directory of your website and put the following code in your html page in the header:

[source…]

I was trying to find some free program that worked on a mac to make a favicon (Gimp wisely doesn’t include that piece of junk format). Convert (imagemagick) doesn’t support it either (at least on my webhost), enter Google and Mr. Degraeve. Upload a PNG, receive a zipped .ICO file. Yay. Check out his T-Shirts too, some of them are amusing.

11:39 CST | category / entries / links
permanent link | comments?

Paul Graham Parody

Everyone I’ve asked agrees that Javascript is nasty and tasteless.[2] It’s not hard to see that it would be a waste of a hacker’s time to be proficient enough in Javascript to create an elaborate, interesting, interactive application in it. But few people have looked beneath their natural revulsion to find Javascript’s deeper flaw: curly braces.

…snip…

[2] Eric S. Raymond has zero lines of Javascript in fetchmail.

[source…]

…Love ‘ya, Paul, but this one is too funny to not pass on.

02:47 CST | category / entries / links
permanent link | comments?

Fri, 11 Feb 2005

Or, One Person’s Experience with HDTV and the Superbowl

So, Brad is some guy from the EFF (the ACLU of cyberspace). I think he’s pretty important, but what’s more interesting is his story about using MythTV with a HDTV tuner card.

During one high-tech moment, it was also clear that the TV was really a computer display. After the buxom Godaddy censorship parody, somebody commented that Godaddy had a different ad that had gotten refused by Fox and it was on their web site. A few clicks and I had the Firefox browser on my screen. With my 6 megabit connection, I installed the latest Flash player in about 10 seconds and was quickly playing the refused ad. Then it was back to our regularly scheduled commercials.

So all this high tech stuff is great, but there’s a catch. The tuner card that receives the signal from the TV station and lets the computer write it, in its transmitted form to the hard disk will be illegal to make or import after June of this year, 2005.

Yes, illegal. A card that simply takes an unencrypted stream of data from the public airwaves with a TV show in it, and copies it, unchanged to a disk file. Now, because I already have mine, that one won’t become illegal. If you get one now, you can keep it. But nobody will be able to make new ones in the USA after that date.

[source…]

I would love to go make that same setup (you can see he has one of those shuttle PC’s) … it actually looked like an old G4 Cube at first.

Also interesting is Brad’s look at WishTV, see also an example of a Buffy Episode configuration, so you can see what it looks like. Neat-o stuff will be happening in the future. Remember, drop the “TV-recording over the air” part and connect to a BitTorrent Satellite via RSS and see what happens. Remember, TV (especially now) is just bits on the wire or bits over the air. Very interesting.

23:48 CST | category / entries / links
permanent link | comments?

Mon, 07 Feb 2005

When were planes invented?

<saph> So um
<saph> I was putting in dates on cheaptickets.com for tickets
<saph> and I put march 20th for the departure date
<saph> and it gave me an error saying that my travel dates have to be within 330 days
+of each other
<saph> and the little calendar thingy on the side said that I had apparently chosen
+March 20th year 1900
<saph> were planes even /invented/ by 1900?

Tip ‘o the hat to #twisted, Twisted is a life-saver, life-changer. If you are doing anything network related (and some other things too, from what I can tell), it will change the way you think about programming.

It’s highly callback and event-oriented, which appears to be perfect for networking tasks, potentially related to Aspects / Aspect Oriented Programming (my understanding of AOP isn’t that great, but Twisted provides ~hooks~ for network activites rather than you doing a lot of waits yourself).

Back to work…

23:04 CST | category / entries / links
permanent link | comments?

Thu, 03 Feb 2005

Coolest Watch Ever

Today I found the iPod of wristwatches, which is far more useful to me than an iPod, since neither one plays .OGG files (that’s geek humour). What I like most about it is the simple, fast, quick, intuitive method for setting a variety of alarms. Although it’s a digital watch, almost everything is done via a scrolly-wheel, like old-school analog watches. Words cannot describe how useful it all is, but I will try.

It’s got spaces for 10 countdown timers, 10 appointments (mini-PDA), variable interval alarms, etc. The way you access them is great: click mode twice, and you’re at the countdown timer screen (with your most recently used countdown timer selected). Scroll the scrolly-wheel to navigate through the ten available, click start on one you want to start. If you don’t see a timer that matches what you need, pull out the scrolly wheel, and you’re instantly in “set” mode. Twiddle up or down to increment / decrement, put scrolly-wheel back in, and press start. Bam. You’ve now set a reminder to:

Need to start another timer? Twiddle scrolly-wheel to find appropriate one, click start.

Invited to a Superbowl party on Sunday? Mush the mode button until you see APPT. Find empty appointment spot. Pull out scrolly-wheel, twiddle time in 5-minute increments. Push start button and get prompted for “remind $n minutes/hours before”. Pull out scrolly-wheel even farther (it has two “out” settings), and all of a sudden you can scrolly-wheel back and forth through upcoming days (to set it for Sunday). Push scrolly-wheel back in, you’re done.

Plus the damned thing will keep track of your excercise times on a weekly basis so you can see how long you’ve been excercising. Mush over to the TRAINING LOG screen, twiddle scrolly-wheel, and you’re reviewing total accumulated times on a week-by-week basis (you store those times into the LOG via the chronometer). Brilliant!

It’s really designed for excercise geeks, but I think it’s going to work out great for a computer geek, probably would work well for lawyer / sales geeks too. Another neat thingy is it has a count-up, count-down counter too. Like if you wanted to do a pushup, then push the button to record it, then do another, record it, etc. I think you’re supposed to use it for longer-term things (like laps, days of exercise per week, etc), but you get the point. You could work gate admissions or be a bouncer/fire-marshal with this thing. Simply amazing!

02:00 CST | category / entries
permanent link | comments?

Wed, 02 Feb 2005

Behold the power of Vim!

Found the coolest tips today, involving motion commands. Was spurred by a comment from some random weblog (Frymaster?).

First start with hjkl0$. These are the basic motion (movement) commands. Then get more advanced with “f<letter>” (Find letter, forwards). F goes backwards. Then I found out about t/T (unTil).

The neat thing about Vi (and Vim) motion commands is that you can use them with vydc, so df. is “delete until find period”. Now I have dt., “delete until period”. Someone suggested (thank you Anonymous Hero) looking through the :help motion.txt sections. Wow, I never suspected that there were such interesting commands in there!

So, the neat thing is that once you’ve started a command that expects a motion (like dyc, etc.) you can utilize a new set of motion commands that aren’t normally available. Without further ado, here’s nice list.

:help motion.txt

viB — select inner block (brace-fu)
vaw — select a word
v3aw — select 3 words
vas — a sentence!!
vap — a paragraph!
va} — the next brace-foo
va) — the next paren-foo

Again, these all work with dyc, etc. If you’ve got some C-like code lying around, try the following. In between some paranthesis (function calls, etc) try the two following:

di) — delete inside the paren-thing
da) — delete all the paren-thing

Or c, v, y, as you see fit, or }, or iB brace/function-fu

Writing this while Bush is speaking in the State of the Union address, he seems a lot more knowledgeable, lots of good ideas in there, maybe he’s got his ornery up now and is willing to spend it all without fearing the need to get re-elected? Hopefully he doesn’t mess it all up. Renewable energy? Who would have thought? Gotta back those words up with actions, though.

20:28 CST | category / entries
permanent link | comments?

Tue, 01 Feb 2005

Grrr @ Large Media

Go read Cuban:

This technology revolution was and has been amazing for two reasons.

First , is that the technology has continued to evolve this long. We may be at a point where we arent suprised to read about new technologies, but entrepreneurs continue to generate new ideas that lead to new products and services. Technology continues to have a significant impact on the US economy and to create jobs.

Second, is that the government managed to stay out of the way for as long as it did. Who knows why, but our elected officials managed to let the free markets stay free. Until now.

Things started to get a little shakey back in 1998.

In October of 1998 the Digital Millenium Copyright Act was passed. The DMCA was basically a law that set a very un-nerving precedent. That the government would do what it could to protect the interests of content owners at the expense of technological development.

[source…]

…I’ve donated to the EFF, have you?

21:24 CST | category / entries / links
permanent link | comments?

Sun, 30 Jan 2005

Genious, I am.

However ultimately we made the decision that the non-XML syntax (or you could say more SQL like syntax) of XQuery was going to attract more developers in the long run, in the same way the developers on the whole find XPath an easier file-path like syntax to write.

[source…]

The next time you are tempted to write a programming language in XML (or add conditionals, loops, etc. to an XML specification), give in to the dark side and pick a decent programming language instead. Possible exceptions to this rule are if you’ve implemented n+1 programming languages already, at least one of which must be in use by one million or more people. Because then maybe you’ll know what you’re doing. Otherwise, just give up.

Remember, XML is just fancy syntax over plain-text (most everything is anyway), and unless you’re qualified to write a programming language anyway it’ll just turn out mediocre.

…and in other examples of genious, Baseball star’s wife makes ultimate threat, and Man peed way out of avalanche.

14:48 CST | category / entries
permanent link | comments?

Fri, 28 Jan 2005

Miscellany

A variety of things. Today I had the opportunity to read two poems to Bety. One is by Sara Teasdale, probably my favorite poet.

The Look

Strephon Kissed me in the Spring,
Robin in the fall
But Colin only looked at me
And never kissed at all.

Strephon’s kiss was lost in jest,
Robin’s lost in play,
But the kiss in Colin’s eyes
Haunts me night and day.

— Sara Teasdale

[source…]

…and a fun one:

Celia Celia

When I am sad and weary,
When I think all hope has gone,
When I walk along High Holborn
I think of you with nothing on.

— Adrian Mitchell

The story of Sara Teasdale is pretty sad. I actually own a very old copy of Strange Victory … it’s emotionally very tough to read sometimes, although I haven’t actually more than cracked the covers of my copy. Haven’t had a lot of time to read poetry lately.

At work, I’ve been scheming on how to get an automation tool that’s simple enough for non-programmers, maintainable, and at the same time, useful. Recommendations welcome. So far experiments with a JS-based recorder of browser-actions went well. It lets me record actions at a browser level, rather than protocol level. All hail Greasemonkey, which is going to encourage me to learn mozilla extensions. So far my recorder is dumping to a wiki for centralized data store, and I put together some auto-script-writing-wizard stuff that uses the uber-l33t XmlHttp stuff to fetch data.

Currently I use XmlHttp to fetch a list of pages at startup, and then per each action, fetch the corresponding page (action) in question and grep it for parameter tags. Those parameter tags (actually python def funcName( p1="val1" ):) are then presented to the user via popups, etc. as an assistant (like VisualStudio auto-complete?) in generating more complex scripts. Probably will have to move away from JS prompt() calls and towards a floating <div> that toggles and is dynamically populated with elements, values, etc. (this is especially for the case of multiple parameters on a single action).

Pretty cool being able to conditionally fetch information, parse it either server-side or client-side and do fancy JS / DOM manipulations to make it do what you want to do. I forsee a bright future in this type of work, just so long as it’s testable (should be, since you can treat your XmlHttp requests as requests/responses to be handled appropriately. MockXmlHttp.send(), anyone?).

This might convince me to work with the JSON people for PHP, since that’s how I’m using 90% of my latest dynamic javascript.

Which brings me to my third point of miscellany: XML.

The reason stuff like JSON (a light-weight JavaScript Object Notation) even exists is becuase… well, a variety of things. First, why does XML exist? It’s for the structured representation of tree-like data in a language-neutral, human-readable format. Well and good, but you read all the time about the lisp people and S-expressions. The other thing that XML brings to the table is XPath/XQuery. XPath is like SQL for tree-like data. This will eventually be amazingly useful, but only when it gets to be as popular as SQL (note to kiddos: learn XPath).

For now though, XML is a common standard, but it’s really more of an impedence mismatch. XML isn’t native to PHP, and it isn’t native to JavaScript, and it isn’t native to Python, and it isn’t native to Java and it isn’t native to anything. Yay. Also, nobody knows XPath well enough to give a damn about some work that they’ll save (writing a couple of foreach loops is easy enough in any language except Java). The closest thing I’ve seen to native support is the perl lib EasyXML (I guess it got converted to XML::Simple nowadays), where once you’ve loaded the XML object, it gets treated as a first-class perl citizen. Yay. But for now, the whole point is that most developers want access to the first-class citizen, not XPath, and that means that JSON is the path of least-resistance for getting information out to a browser (no dependent libraries). Hopefully it will die a quiet death as more languages get native XML support, but for now it seems pretty useful.

And a final closing funny: “Better to have a nickname than an adjective.” (said by “Big” Dave to “Magpie” ;^)

23:56 CST | category / entries
permanent link | comments?

Thu, 27 Jan 2005

Internet Mail 2000

Tim Bray writes about private RSS feeds which are remarkably similar to DJB’s writings on Internet Mail 2000. I was really excited about IM2000 before, but I didn’t really realize that RSS was taking us there one step at a time.

IM2000 is a project to design a new Internet mail infrastructure around the following concept: Mail storage is the sender’s responsibility.

Each message is stored under the sender’s disk quota at the sender’s ISP. ISPs accept messages only from authorized local users.

The sender’s ISP, rather than the receiver’s ISP, is the always-online post office from which the receiver picks up the message.

The message isn’t copied to a separate outgoing mail queue. The sender’s archive is the outgoing mail queue.

The message isn’t copied to the receiver’s ISP. All the receiver needs is a brief notification that a message is available.

After downloading a message from the sender’s ISP, the receiver can efficiently confirm success. The sender’s ISP can periodically retransmit notifications until it sees confirmation. The sender can check for confirmation. There’s no need for bounces.

Recipients can check on occasion for new messages in archives that interest them. There’s no need for mailing-list subscriptions.

The neat thing about IM2000 is that it “kills” spam. By leaving the message on a remote, required-to-be-always-on server until the user picks it up, it means zombie bots don’t really work as spam generators, and the person sending the mail (sending the mail notification message) must be responsible for “owning” that message until it is delivered. Basically putting mail transmission costs on the sender more-so than the receiver.

Let’s presume the worst possible spam attack on an IM2000 system. 1,000,000 bots, of which 80% of them are online all at the same time, each sending 1,000,000 notification messages to addresses harvested from the internet. Ouch. Anyway, since the message is traceable to an origin (no matter what that origin is), we are in a slightly better situation than before. It would be a fairly simple process to say: “Trash any messages that come from places without a reverse DNS to a legitimate domain name”. That means you can still run your own ~mail server~, but you have to buy a domain name for it (not too big of a deal) and keep it online all the time. Or contract with a hosting company to run your private mail-outgoing queues.

Then suppose that spammers buy domain names for each of their bots on a botnet (unlikely, I would hope). Costs have been raised, and then it might be possible to say: “We are suspicious of email notifications if your mail-server DNS isn’t at least 3 months old”.

Furthermore firewall at the ISP-level port 25 inbound (probably won’t end up being port 25, but just an example). Since “delivery” requires that a random PC on the internet connect to a random other PC on the internet, and we’ve stated that we’re willing to firewall customer PC’s from inbound requests, we’re doing pretty well. Would firewalling port 25 outbound have the same effect right now? I don’t know but I don’t think so. Firewalling 25 outbound means that your customers can’t send spam, but not that your customers can’t receive spam from compromised hosts in China, etc. (sorry, China. :^) Really it boils down to accountability by some single system for owning the delivery of a message.

08:38 CST | category / entries / links
permanent link | comments?

Fri, 21 Jan 2005

“The Long Tail” and computer stuff

Interlude:

rames@kristal:~$ uptime
22:03  up 21 days,  1:49, 3 users, load averages: 0.84 0.61 0.72

… my Powebook 12” is sweetness. :^) $500 is a great price for the Mac Mini’s, too. I’m currently debating on getting a Network Attached Storage (NAS) drive for home (example), but why spend $200-300 on just a hard drive when I could spend $500 and get a whole ‘nother computer? Another possibility is to work on getting a Myth-Box going and use that as the network drive. What turns me off from that is I’ve never quite managed to get a home-built PC as quiet as I’d like for 24x7 living-room operation. Speccing out the Mac Mini with some “extra stuff” (wireless, upgraded HD, etc) brings the price from $500 to $800 — not too bad, but expensive enough to look harder at a cheaper specialized network drive (prices on those range from ~$150 - $300 depending on size, features, etc).

Followed a link from Gary’s blog talking about the economic ramifications of on-demand everything, called “The Long Tail”. The simplest definition is as follows:

“The Long Tail is the realization that the sum of many small markets is worth as much, if not more, than a few large markets.” (source)

…and the following quote from the original Wired article.

An even more striking example is the plight of Bollywood in America. Each year, India’s film industry puts out more than 800 feature films. There are an estimated 1.7 million Indians in the US. Yet the top-rated (according to Amazon’s Internet Movie Database) Hindi-language film, Lagaan: Once Upon a Time in India, opened on just two screens, and it was one of only a handful of Indian films to get any US distribution at all. In the tyranny of physical space, an audience too thinly spread is the same as no audience at all.

[source…]

My experience with this has to do with my preference for reading classic books rather than paying $8.99 for new paperbacks. With so much older stuff available for so cheap (half-price, project gutenberg, etc), why pay full price for new content when you’re not sure how good it’s going to be? I feel like I’m at the very tip of the “old-book iceburg”, focusing on the more popular books because that’s what I can find, and that’s what I know about.

Speaking on the tyranny of physical space (is that like the opposite of the four freedoms? :^), I’ve been ripping all my CD’s as soon as I buy them. Not recently since I don’t trust ripping on my Mac yet (I rip to OGG using abcde on my linux box), but I now have 2427, 7.4 days, 16.20 GB of music registered with iTunes on my laptop, not including another 5.2 GB of Soundtracks and Various Artists (I hate the way iTunes handles Artists in Various Artists … giving each individual artist top-level artists entries when they only have one song in them, maybe I need to twiddle with the “compilation” bits?) Anyway, back to The Tyranny of Physical Space, 21GB of CD’s turns out to be a lot of cubic feet worth of CD’s. I would never carry that much with me everywhere I go, back and forth to work every day, but digitizing them and sticking them on my laptop (or making them password protected / net-accessible) has freed me to listen to my music almost anywhere I want.

Same with photos / digital photos. I ~hate~ (not really) physical cameras and photos, mostly because I never spend the $10-20 to develop 36 prints from film. And when I do, I always get a photo CD to go along with it. Now that photo printers are comparable quality of photo prints, digital photos make even more sense since I can “make it physical” anytime I want or need to, and keep all the advantages of a digital archive of data rather than a physical archive.

…which explains why I’m looking at NAS drives. The long tail of my own media. :^)

08:42 CST | category / entries
permanent link | comments?

Mon, 17 Jan 2005

HDTV Experience

Got the HD-3000 card in the mail a few days ago. Took me an evening to get it and everything set up on my linux box. Turns out my box is a little slow for HD decoding (it’s a AMD1.5ghz) but I did get MythTV up and running and watched some of the signal for a bit. Since I was messing around with TV cards, I apt-get install‘ed EffecTV which turned out to be a really fun program.

MythTV is worthy. It’s well architected, split into two parts (mythtv-backend, mythtv-frontend) which can even be run on two different servers (ie: the honking “grabber-box” and a svelte “by the TV box”). X-Boxes are common to use as front-ends over a network to the central capture box, and because it’s all open source it’s very flexible with what you can do (multiple frontends per one backend, web-scheduled recording, burn DVD’s, VCD’s, scp the video files, etc). If you’ve got more time than money, it’s definitely the way to go.

Figure ~$500+ for a decent box (~$300 for a shuttle small-form factor PC, $50 for a regular capture card, ~$200 for an HDTV card, $100-200 for a hard-drive). Programming / Guide information is available from the kind people at Zap2it for the opensource community. Eventually it would turn to a pay service ($5-15 / month? … content is king!), but for the time being it’s available for free. You can also repurpose any old hardware you have lying around. I’ve got an older 60gb IDE drive, the two capture cards, would really just need the containing box and processor (most of the small form-factor PC’s already have built-in video and TV-out).

Unfortunately I’m a little short on time and money right now so most of this will have to wait until after wedding, furniture purchases, etc.

21:49 CST | category / entries
permanent link | comments?

Sun, 09 Jan 2005

Beware the Broadcast Flag

Reading slashdot today reminded me that I needed to snag an HDTV card before they are required to be feature-crippled with Digital Restrictions Management (DRM). I’ve got an older Hauppauge WinTV/Radio card which was pretty cool, I enjoyed watching some TV, DVD’s through there, recording some stuff from the radio. Nowadays, the FCC is working with all the “Big Corporations” to require built-in restrictions on devices for watching HDTV.

See more ...

10:53 CST | category / entries
permanent link | comments?

Thu, 06 Jan 2005

Zap! If Pac-Man were converted to Quake 3 Arena.

…a 2D vector graphics multiplayer team action strategy game that plays like a cross between Robotron and Tribes with the graphical blend of Asteroids and Pac-Man.

[source…]

It’s nifty! Plays a lot like SubSpace. They’ve got a coupon available to make it $14.95, and if I hadn’t just bought a bunch of mac games (for $3.99 ea. @ MicroCenter!) this one would be on the short list.

Zap needs improvements, though:

See more ...

01:00 CST | category / entries / links
permanent link | comments?

Mon, 03 Jan 2005

Story Driven Video Games

There’s been some talk lately about decreasing emphasis on graphics in video games and concentrating more on “the other stuff” like character development, story, etc. I agree. The difference between Quakes #1, 2, 3 and the original Half-Life had much much less to do with the backing technology or graphics, but instead with the incredible plot that Half-Life had. The technology in both was “good enough” which is vitally imporant, but Half-Life nailed the atmosphere and told a story that the player could care about.

See more ...

12:18 CST | category / entries
permanent link | comments?

Like what you just read? Subscribe to a syndicated feed of my weblog, brought to you by the wonders of RSS.



Thanks for Visiting!