May. 3rd, 2006

elfs: (Default)
For javascript programmers, Prototype.js is probably the coolest thing around; easy to learn, but not so easy to wrap your head around all at once. Probably the hardest thing to grasp about it is the way it hybridizes Javascript's lisp-like internal structure with more traditional OO constructs like classes, construtors, and interators, then turns around and re-exposes those lisp-like capabilities with functional utilities like detect() and map().

But Prototype is not always complete. A noteable example can be found in PeriodicalExecuter, which takes two arguments: a function to callback, and an interval, and on the interval it calls the callback. The problem is that there's no utilitarian way to pause a PeriodicalExecuter; you can only stop and restart it. If the callback function has some state (which is possible in Javascript, now that closures in Javascript have become commonplace), tough.

So I wrote a PeriodicalExecuterToggled, which allows you to stop and start the PeriodicalExecuter at will and keep the callback unchanged.

Javascript deepness )Combined with something like the Scriptaculous Slider, this version of PeriodicalExecuter can provide for some interesting user-controlled experiences with javascript animation, regular updates from back-end servers, and other Web 2.0 services.

Sorry about this article bouncing around like this: I never realized just how frakkin' hard it is to post source code to LJ!
elfs: (Default)
Well, frack. There goes another one. The T23 exhibits the same symptoms under Windows as it does under Linux. I put in its old hard drive and tried to run it, and I still get the same intermittent screen failures and other screen artifacts that I was getting under Linux, so it's not the drivers. It died the first time when I first got it, but this is just annoying; it fell out of its warranty a few weeks ago (it was only 90 days). Now what do I do?

It's not like I'm cruel to my laptops. I keep them in a padded sleeve in my briefcase and yeah, I tend to run the software hard, but I'm not like, viciously cruel to them or anything. I don't drop them. This is really making me annoyed.

I've re-initialized the 600e. At least it hasn't failed me, although I have to replace the keyboard soon. The space bar is being held up by a pair of springs I cut out of an old click pen. But it's too slow to play movies or run some of my Japanese translation exercise programs. And it has one-quarter the memory of the T23, meaning I can't run more than one Mozilla product at once: Thunderbird or Firefox or Liferea. I'm getting good at restoring to the T23.

Profile

elfs: (Default)
Elf Sternberg

March 2026

S M T W T F S
1234567
8910111213 14
15161718192021
22232425262728
293031    

Most Popular Tags

Style Credit

Expand Cut Tags

No cut tags
Page generated Mar. 25th, 2026 09:21 pm
Powered by Dreamwidth Studios