10.31.06

I hated my fire alarm

Posted in Nonsense, Brooklyn at 2:45 am by axlotl

Every time I cook the damn thing goes off. It’s newer model, hooked into the apartment’s electrical system, so you can’t just take the battery out and use it in a distortion pedal instead. I make some fuckin’ broccoli and it’s all “FIRE! FIRE!” with the concomitant ear-splitting beeping. I go and get on tiptoes to get at the button in the middle, saying, “shut up shut up shut up!” And when I press the button the female voice says, “Hush mode activated.” Hush mode. Jeez. But a couple nights ago it piped up at 3:30am saying something different. “Carbon Monoxide detected!” Now, that’s scary. What if I try to get to a phone and pass out? But I got to a phone and called 911.
some firetrucks
The response looked like this (photo that makes it look most like a circus inserted).

Three ladders and a smaller truck. There were firemen stomping about wearing their respirators, holding testing devices. It’s kind of unnerving to be standing bare-faced talking to someone wearing a respirator. My landlord (who is the best landlord I think I’ve ever had, Errol - shouts out!) came up; he lives on floor 1. Turned out the neighbor’s boiler flue had leaks. Leaks that went not into their building but instead into my apartment. But I could have been one of those families they find dead from CO poisoning like 5 days later. Bloated with the blowflies. So I no longer curse the detector.

10.27.06

Client-side validation script

Posted in code at 1:59 am by axlotl

Wow. great to be back. So The job I made this site (among other things) in order to get I got. Which meant I could quit my cube-farm crap job, but which also meant I was immediately swamped as the sole front-end developer for a small (4 person) shop farming product out to kinda big corporate clients.

One thing I made though, so far, I’d like to pass on. This is a client-side form validator based on mochikit. The idea was that it would catch what would be server-side errors before they got sent. The script creates and inserts a div with error messages above the form and unfurls it on failed validation using scriptaculous-swiped animation. So it relies on one kinda odd thing: we echo the server-side error message array into script something like thusly:
<script>
var user_errors = {
<?php
  $i = 0;
  while(list($key, $val) = each($ENGINE_CONFIG[’msgs’][’errors’])) {
    if($i > 0) {
    echo ‘,’;
  }
  echo $key; ?>’:'<?php echo $val; ?>’
<?php
  $i++;
 }
?>
};
</script>
The idea is that the client and server errors mirror each other. Obviously in this case they are contained in Config.inc[’msgs’][’errors’] in an array in name => value pairs. You can create the error array in other ways though. Generally, it keys off inputname + ‘_required’ => ‘err msg’ or inputname + ‘_validate’ => ‘err msg’. The neat part is a simple mechanism for classifying form fields as either ‘required’ or ‘validate’, with the former being checked for null and the latter run against a regex. Anyway. Use it if you wish. I have found it to be pretty flexible. The instructions (which involve simply adding classnames to forms and formfields) are in the script. It looks a lot uglier than most js on the web to me, and for that I apologize. And it is infested with debug messages. I suxors. Don’t hesitate to email me about its use.

Validator.js

I’m sorry about that code display. While I idled WordPress intoduced WSIWG editing that broke my code formatter. Gotta figure out how to undo their “help”. Thanks, WordPress. motherfuckers.

EDIT - All Hallow’s Eve:
I posted a link to this on the mochikit mailinglist and feld crappy about it in the morning because, well, how unsexy is this? A validation script? It’s so pedestrian. But this script has one goal and it is a really useful one. When you’re getting 50k hits an hour and maybe have limited hardware because people are stingy and you want to throttle DB server hits, or even server hits in general, this script replicates the major server errors and catches them client-side and stops them in their tracks before they get sent to the server and still returns the same error. That’s useful.

07.11.06

ch-ch-chhhhhhhhh

Posted in Brooklyn, camera at 1:43 am by axlotl

These photoshopped subway pix are gettin’ silly.

colortrain

But I can’t help myself.

07.01.06

Express Tracks

Posted in Brooklyn, camera at 3:46 am by axlotl

express

Sunn0)))

Posted in Nonsense at 3:23 am by axlotl

I started listening to this band I heard in some record store called Sunn0))) in, maybe, early 2002, but it turns out the’d been recording since maybe ‘98. That’s not surprising I guess because I’m old now and seem to find really good music even a few years after the fact. Anyway, I really liked them, really slow metal-esque noise that was mainly about feedback and the slow resolution (with undiminishing volume) of criss-crossing guitar chords that are sustained for literally minutes. It’s fabulous at really, really high volume, but living in the city, in apartment buildings, I don’t really feel comfortable turning my stereo up loud enough. (well, maybe sometimes). I noticed in a New York Times article about the band (odd enough in itself) that I had missed a January show at the Knitting Factory. I liked the article, but I was a bit despondent to realize that the very fact of the article might mean that they’d never play so intimate a venue again. Then again, a mere magazine article might not expand their base so much. It’s pretty out there and also rather abusive, the music I mean, so possibly the people who would like it constitute a somewhat small subsection of the listening public.

Anyway, I looked at the label’s website and noticed they in fact had a show in three days, on the 30th. Also, I was really happy to find that the show is at the avalon, which used to be the limelight, housed in a miniature, gothic-style, limestone ex-episcopalian-church near my sister’s loft. That sounds perfect. So there was just the matter of the pot. I didn’t have any and I wanted some. For the show, dude.

I *knew* I had to have some dregs somewhere, but I couldn’t find them. I went through all my boxes. I had started to research on the internet about the NYPD’s current low-level drug strategy, with an eye towards living a cliche by going to Washington Square Park to score. I read internet accounts of others’ experience doing the same. The advice was variously: “Don’t ever do it”, and “It’s easy; you might lose some money”. It’s been so loing since I bought pot that I just didn’t know how. Oh, wait. I bought pot just a couple months ago when I was in San Francisco. Then I was getting my drycleaning out and I noticed a box I had squirelled away in my closet. Well, in the box, in a valise, in a littler box, in a pill bottle, in a ziplock bag I found probably a gram that I think is from the last I got from E, maybe July fourth last. Took it for a test run, and it looks like I’m good to go.

Then I got to the show. Boris opened. Fabulous band. As usual, for a live show, it still didn’t seem quite loud enough, though very loud. They finished and I meandered to the upper levels for sunn0))). They came out in their robes with their smoke and crunched into the first chord (which would be sustained for minutes) and it was so loud it hurt. My vertebrae vibrated against one another and my skull fluxuated. Very very slowly. When I listen to sunn0))) at home, I usually turn it all the way up and lie between the speakers because it is never loud enough but, trust me it was loud enough. I think I probably cut a couple years off my hearing at the show, the guitars reverberating off the limestone arches inside the church. I spent their entire set holding my fingers in my ears, for fear of my health, but I don’t think you really needed ears to hear it. It was without a doubt the loudest thing I’ve ever heard. Right there in the middle of Manhattan. It was pure bliss. God bless those boys.

06.17.06

ouch. it burns.

Posted in Nonsense at 3:37 am by axlotl

portauthority

On July 13th, the sun will line up, when setting, with Manhattan’s grid, making the city into a giant Stonehenge. Grab your cameras. This picture was taken on June 15th, but it’s getting closer. If the grid ran east-west, this would happen on the equinoxes.

Glenn Greenwald

Posted in Nonsense at 3:35 am by axlotl

glenn

Glenn Greenwald, who wrote How Would a Patriot Act, and who lays out the truth on the Administration’s lawbreaking at Unclaimed Territory, talking at Drinking Liberally at Rudy’s in Hell’s Kitchen, NYC, 06/15/2006.

06.12.06

Cown, spherical, bobbing.

Posted in Nonsense at 11:52 am by axlotl

I’m posting this from work, where I sit at a window 21 floors above the Hudson on the Jersey side, directly across from Ground Zero (do we still capitalize that?). Anyway, I don’t know if anyone has noticed, but there’s a tiny, spherical, black and white dead clown floating in the water down there with a boat tied to it. I don’t know when it became “O.K.” to tie boats to dead clowns.

05.25.06

That 70’s Feeling

Posted in Nonsense at 2:40 am by axlotl

Trying to reproduce that 70’s “blurred traffic” image meme:

lights1

05.19.06

A visit from Jennifer and Kevin!

Posted in Nonsense at 3:43 pm by axlotl

Spent the weekend with two pregnant women and their husbands. But only one can claim best picture.

jen34th

Steppin’ out in the city.

04.27.06

Tiny Billboards

Posted in Nonsense at 4:23 pm by axlotl

Today is apparently “bring your spawn to work” day, and the office in which I have to squander 35 hours of every week is overrun with children. The children had some activities and were given some trinkets, which, this being a pharmaceutical company, were plastered with drug logos. In fact one of these trinkets was a library bag with an oversized logo for the drug Combunox which is actually a painkiller containing oxycodone, the magic ingredient in OxyContin, A.K.A “Hillbilly Heroin,” the drug that brought Rush Limbaugh so very low. So all day I was surrounded by hoards of preteen billboards advertising addictive narcotic pills. It was a little surreal.

The Cost of War

Posted in linkulous at 2:59 pm by axlotl

I hope that the proprietors of costofwar.com won’t mind if I hotlink an iframe to their ingenious javascript war-cost calculator. Simpler than it appears at first sight, it just takes the total budget outlay (currently 315 Billion) and devides by the date, then updates it to the current Date() in 200 ms intervals, doing a replaceChild(). I’d just calculate it locally, but they seem to be updating it to reflect budgetary changes and I’d like to let them do the housekeeping on the numbers. Not that this is a very high-traffic site, anyway. Note the ability to see the cost for specific regions (which seems to be keyed to fairly precise demographics).

04.17.06

Late Again

Posted in Nonsense, Brooklyn at 12:01 pm by axlotl

This morning I entered the subway station early, having made a commitment to stop being late to work all the time, but even as I passed through the turnstile I knew my laudatory endeavor in timeliness would be thwarted. The squawking, nearly incomprehensible public intercom system was blaring: “Due to an earlier ‘incident’ the C train is running on a delay - there will not be another Manhattan-bound train for at least 30 minutes.” In some senses the New York subway is a marvel: the largest subterranean railroad in the world running 24 hours a day and stretching to the farthest reaches of a sprawling metropolitan area. But in fact if you are able to use the subway to get from one place to another in a timely manner it is but a fortunate coincidence, the exception to the rule. The rule is endless delay. Be it track maintenance, illegal strikes by subway workers, flooding tunnels, falling skyscrapers, holiday interruptions, passengers taken ill, or any other as-yet-unimagined reason, something (or a constellation of several somethings) is conspiring already before you even start down the stairs to ensure your frustration. Job interview? Doctor’s appointment? Date? You can rest assured you will not get the position, you will not get treatment, you will not get laid. if you’re taking the subway, you are going to be late. And the air conditioning will be broken.

04.16.06

php5 s3 web interface

Posted in code at 11:55 pm by axlotl

S3 web interface I made
So I’m making a PHP5-based drag-n-droppable ajax interface for amazon.com’s s3 data storage webservice. But first, since I want it to degrade gracefully, I had to make a non-javascript version to fall back to, which is the definition of degradable. So I made that, and while I was working on the javascript behavior layers, I figured I’d make the non-javascript version available to whoever wanted it. It is after all a perfectly usable web interface to the s3 hashspace. So anyone who wants it can get it from its branch in my subversion repository. That’s the gz-packed tarball, but the files are available individually from the top of the repository. It makes use of a class posted to the s3 developer’s forum by Geoffrey P. Gaudreault that you can get here, but you don’t have to because it’s included in my release. Although I should note that he was considerate enough to make the class backwards-compatible with php4.x and I trashed that and used php5.x (mainly for the xml-parsing functions).

So what you do is download the .tgz and unpack it on your webserver. You need php5. You need a couple PEAR classes and maybe a pecl extension: see the README. The pecl extension can be avoided if you figure out some other way to guess mime-types without it, but it looks like the built-in PHP mimetype guessing (mime_content_type()) has been depreciated. You add your amazon key and key-id to the base class and you should be good to go. To upload large files through php, the various php.ini settings need to be tweaked (max_execution_time, file_upload, upload_max_filesize, and post_max_size - because the files go over POST). And also you’ll need to pay attention to the script’s default file upload directories (/tmp for php and s3/tmp/ within the script).

There are reminders within the package, but I’ll reiterate it here: You should only use this package on a secure server because the traffic between your browser and the server will otherwise transmit your secret key in plaintext. I’ve called the package “candy” for no good reason. Like I said, I’m currently working on the drag and drop, reorderable, so-called “AJAX” stuff. Probably it will take another week. But I haven’t seen anyone else publishing a simple web interface to s3 so here is one. Please use it and report any problems back here (email me). Like I said on the development forums, the code’s not necessarily all that elegant, but it works nicely.

If you don’t like the colors, it works fine without the css because content is separated from presentation, like we’re supposed to do! Comment out the call to s3.css or, if you have firefox, go view->styles->no style.

04.10.06

Wandering

Posted in Nonsense at 2:10 am by axlotl

Wandered around today with Brian and Peter. Brian and I got in a fight about breakfast because I inadvertantly picked a restaurant that didn’t serve link sausage.

blossoms2

Ooops. Inadvertantly made this unavailable a couple days ago whilst toying around on flickr.com. I noticed at some point that there was a discarded water bottle lying about three meters behind the tree to the left and though it was tiny, once I saw it I couldn’t look at the picture without being uncomfortably aware of it. To the casual viewer it probably would have been no big deal, but to me it was like a vast bowl of pus. So I photoshopped it out and replaced the flickr pic the only way I know how: I deleted the original and added the edited version anew. That is, by the way, the only photoshopping that I did on this pic; the light effects are purely courtesy of yours truly and my trusty Canon Powershot S2 IS. (1/20 at f/5, 6mm focal length, flash @ 80%, sRGB on the prcessing end, if that matters).

Update!

Flickr has added a “replace this photo” link to the tools displayed to the right of the photos in one’s “photostream,” as they call a collection of digital images. So now there is an easier way and I know about it. Thus ends the update.

03.24.06

Amazon S3

Posted in code at 10:50 pm by axlotl

Amazon, an early entrant to the world of public APIs for web services, unveiled a doozy this month. Amazon S3 is just internet-based storage, sold at 15 cents per gigabyte-month and 20 cents for a gigabyte of transfer. So put a couple a couple gigs there and store them for a month and it’ll cost a couple quarters. What’s really amazing about it is that the only interface they made available was the API (and a collection of minimal example code snippets in various languages). That means there’s no web interface for them to make money with.

Yet.

With the snippets and the forum (available from the above link), they’re leaving it up to the community of developers who are the initial target demographic for the service to decide for themselves what kind of interface they want to use and further to implement it themselves. My favorite so far is Mitch Garnaat’s bitbucket, which subclasses the python REST script from the examples to implement streaming files and more and is already a pretty transparent interface to the S3 hash space.

Sveasoft Called Out

Posted in linux at 12:52 pm by axlotl

linksys WRT54G
I’m a couple weeks behind the curve here (trying to cut down on slashdot time-killing), but sveasoft got a public rebuke cum cease-and-desisist from OpenWrt earlier this month. Sveasoft, which distributes firmware for Linksys WRT-54G WiFi routers, has long been the bane of the open source community because its founder, James Ewing, has manufactured a series of hijinks to maintain control over the source code for his firmware distribution even though it contains open source code (including, among other things, busybox, dropbear, iptables, and of course the linux kernel). And although being a thuggish asshole doesn’t violate any licences that I know of, Mr. Ewing appears to be guilty of that also. The GPL is weakened, it seems to me, when this kind of flagrant abuse is allowed to continue unchecked, so I’m very happy to see OpenWrt stepping up to the plate here. More in this digg post, this forum, and this IRC session.

03.21.06

moo.

Posted in linkulous at 1:23 am by axlotl

Sonoita AZ circa 1937. A cow or a bull or whatever.

moo. (it's a picture of a cow)

I just love this photo, which was taken by my grandmother Mildred most likely, channelling Weston. Or Wegman.

03.19.06

Stereolab - Town Hall

Posted in Diversions at 6:34 pm by axlotl

I was fortunate to have a chance to see Stereolab at Town Hall in NYC last night.
Seterolab in at Town Hall in NYC - 3.18.2006

The show wasn’t far into the first song before I realized that not seeing the previous night’s show as well had been a serious mistake; the performance was sublime. What is it about Stereolab? The music is so generous and so densely referential and, of course, they rock very, very hard. Still.

03.17.06

DNA LEGOs

Posted in linkulous at 1:48 am by axlotl

This is a Scanning Electron Microscope image of a molecule shaped like a smily face. The molocule is DNA, which turns out to be really useful for building tiny shapes. The DNA is folded using molecular “staples” according to the computer-generated template next to it.

?colorizeddna folding pattern

03.09.06

kiwa hirsuta

Posted in linkulous at 1:28 am by axlotl

I find this furry crustacean oddly compelling.
kiwa hirsuta, a furry white crustacean
15 cem long

What a darling shrimp-monkey mutant! I wonder what it tastes like.

(Sorry the link’s article is in French; it’s the only one the creature’s name found on Google so far.)

Update - 03/20/2006

Considering the fact that it thrives in the sulferous vents on the ocean rift, the chances are that it tastes pretty much like rotten eggs.

02.13.06

Bit of snow here

Posted in Brooklyn at 1:13 am by axlotl

brooklyn

Brooklyn, February 12, 2006. And me out of coffee.

01.23.06

Googlemaps Updates the API

Posted in Greasemonkey, code at 3:50 am by axlotl

Well, it’s really an evolution, as opposed to some radical new stage. The main javascript file is currently at revision 34, but it did get a “2″ in the filename, maps2.34.js. It came to my attention because it broke a greasemonkey userscript whose care and feeding I’d taken over, namely gmap xtras, which adds a bookmarking facility along with a self-updating latitude/longitude display.the gmap extras interface You can drag the map and the lat/lon tracks the center’s movement, and if you set a bookmark after dragging, the bookmark reflects the state of the map after dragging (and zooming or unzooming). Give the bookmark a name and you can go back with a single click.

Anyway, The userscript was originally written by Matt King, and I installed it only to find it not working a few weeks later. I edited it some to get it working again since Google had changed the application a bit. I left all the original credits and notes in the script, added a credit for my own work, posted a copy on my own site and the guy who’d posted it to userscripts.org (who wan’t the author) overwrote the original with my revision. No big deal; I’d essentially fixed the script in situ. This time, though, the changes broke the script pretty badly and I had to rewrite the entire thing. There are still functions that have basically the same structure as they did in the original extension (mainly having to do with the GM_set() and GM_get() aspects of the script), but the rest was all my work. I decided to add a credit to the original author and of course carried on the license, which was GPL. But he had added a © Copyright, so what to do with that? I omitted it. Anyway, there’s my discussion of the ethics of taking over someone else’s script.

As to the new GMap script, I had to hook into an object called gApplication in order to get the map, the latitude and longitude, and such, but once hooked in, all of that is actually very convenient:

var gMapXtras = function(){
try{
this.ga = unsafeWindow.gApplication;
this._m = this.ga.getMap();
this.moved = 0;
} catch(e){}
};
xtras = new gMapXtras();


Now we have our own copy of gApplication, and we can use that to derive all the other values we’ll need (for the most part). I can not see any way to get access to the gmaps application without exposing the script using the unsafeWindow object, unfortunately. This places the scripts contents into the window’s scope providing access to such greasemonkey-specific functions as GM_xmlhttpRequest(). I do have to say I feel rather comfortable trusing Google not to abuse this. After all, they could just go down the hall and grab Aaron and pull out the rubber hoses and get access to the whole greasemonkey userbase. We also need unsafeWindow to get the form values for the currento URL, which we build essentially the same way gmaps builds a query for a search request, pulling out the search form by id (using google’s function e() which aliases document.getElementById()). Also note the gMapXtras() object instantiated above (xtras) being used to access Google’s utility functions for getting the lat-lng pair and the span (which implies a zoom level) :

_form = unsafeWindow.e("q_form");
_mark = _form.q.value;
_url = "http://maps.google.com/maps?";
_url += "f=" + _form.f.value;
_url += "&hl=" + _form.hl.value;
_url += "&output" + _form.output.value;
if(xtras){
_url += "&sll=" + xtras._m.getCenter().toUrlValue();
_url += "&sspn=" + xtras._m.getBounds().toSpan().toUrlValue()
}


This gives us a name value pair like this : { 7 Davis St, Cambridge, MA 02139 : http://maps.google.com/maps?f=q&hl=en&outputjs&sll=42.365343,-71.093293&sspn=0.013746,0.028603}. This works nicely as a bookmark name and an href value, and these get appended to the select box as an option. Unfortunately, this URL still loads a map with the white “Search” sidebar on the left while I’d like a full-width map. The fullscreen map can be achieved, actually, with a simple addition. We add an incrementing counter to the same moveend event listener used to update the lat/lng: xtras.moved += 1. The, in the URL building routine:
if (xtras.moved < = 1){
_mark = _mark.replace(/^\s+/, "");
_mark = _mark.replace(/\s+$/, "");
_url += "&q=" + _mark.replace(/\s+/g, "+");
_url += "&btnG=Search";
}


If the url GET string contains a successful query, gmaps doesn’t open the “helper” sidebar. Ostensibly because it doesn’t have to offer search pointers. This works fine if the bookmark is the same location that was searched for, i.e., the map wasn’t dragged. If the map is dragged, the URL will still contain the proper latitude and longitude, but the search query overrides them. So I put a check in and if the map is dragged, you get the dragged, zoomed map as the bookmark link, but if it isn’t, the original search string is appended to the URL replacing spaces with plusses, and gmaps will see it as a successful search and present a fullscreened map.

I’m also flirting with overcrufting by adding an optional weather module so you can see what the weather is like at the map locale. This is arguably totally pointless and should be made into a separate userscript in order to contain this manifest uselessness. We’ll see.

My Little Camera

Posted in camera at 1:41 am by axlotl

I mentioned earlier I was shopping for a camera, trying to decide between the Canon Powershot S2 IS and the Panasonic Lumix FZ5, and in the end I opted for the Canon. In so doing, I gave up tif-formatted output, live histograms, and an extra hundred dollars, but gained a swivel-mounted LCD, a nice macro mode, stepless zoom, and manual focus. The camera can only output jpegs, but that’s not such a big deal at the highest quality setting; I can’t imagine that tiffs would capture a level of detail greater than the margin of error produced by the CCD. Interestingly, I came away with one lesson beyond the simple do your research, namely, choose Adorama before B&H.

B&H has this massive operation where they’re moving such a high volume of high-end electronics that they need floor staff to chaperone people into lines where they are shuttled to desks to which the gear is routed on an elaborate elevator and conveyor-belt system. Everything is done with tickets; you handle only example merchandise until you’re leaving with your purchase. Until then, at each stage you’re given a print out with bar codes that you take to this station for payment, then to that station for pickup; at the last, the merchandise arrives hanging from an overhead conveyor chain. That’s all well and good, though it feels like a feed lot, but the people I talked to didn’t really know their shit. After a short week of research, I was more knowledgeable than their sales personnel.

Case in point: I was told off the bat that the two cameras I wanted to compare were not in the same class. In fact, they are both 5 megapixel 12x optical zoom cameras, but the Canon is 25% more expensive than the Panasonic, so the sales guy considered them to be in different classes; he wanted me to look at a Panasonic Lumix FZ20. I said, “they’re the same in megapixel and optical zoom - by what criterion are you putting them in different classes?” He hemmed and hawed while I looked at them but eventually said the Panasonic has an inferior (he said, “smaller”) chip, by which he was referring to the CCD. In fact both CCDs are essentially the same (1/2.5″, 5.3 million pixels for the Canon, 1/2.5″, 5.36 million pixels for the Panasonic), and he classed them apart on the only metric that mattered to him, namely price. Turns out on some other metrics the Canon came out on top for me, but it’s a good thing I wasn’t relying on him for basic information.

At Adorama, on the other hand, where I went for a case and a filter mounting assembly, I asked about the comparison between the two and was presented with essentially the correct dilemma. This has these qualities, that has these others. Also, before he sold me the filter housing, he warned that it would interfere with the flash. filter mounting casts a shadowIndeed it does, producing a dark hemisphere at the bottom of the picture. I figured out if you remove the extension to the filter mounting (the part that flares out, part number LH-DC40) and just leave the part the filter screws into (LA-DC58E), the effect is minimised. Though it must be admitted that I was unpleasantly surprised to find that even extending the zoom lens (or engaging macro mode) casts the same shadow on the image frame.

Would I have liked to have been able to purchase a bottom-end SLR such as a Canon Digital Rebel? You bet your sweet ass I would have. But in the end, the $400 extra for a new model was just a bridge too far. I wonder why they’re still called SLRs when even my camera technically only has a single lens. And there’s certainly no “Reflex,” unless I’ve been wrong in assuming that term referred to the mechanical flipping up of the mirror so the film and the viewfinder could be exposed to the same image. Oh, well. Once I use the images I produce with this camera as the crutch that holds up my weakest leg in web design, namely design, by using digital images as the jumping off point for themes and color schemes in websites, I’ll make the fortune I need to buy a really nice rig.

01.15.06

hope street

Posted in Nonsense at 1:59 pm by axlotl

Another new loft; working on greasemonkey scripts for googlemaps, about which I shall post more anon. But just now I’m off to get a camera. A Panasonic Lumix FZ5 or a Canon Powershot S2 IS? Probably the Canon, though I gotta go hold ‘em both in my grubby hands first.

01.02.06

Happy Holidays

Posted in Nonsense at 2:51 pm by axlotl

Well, I stupidly got up this morning, took a shower and got on the subway to go to work. At work, I put my wallet in the drawer as always (bad for the back to sit on a wallet) when I noticed how quiet it was. A quick stroll revealed I was indeed the only person in the entire office; clearly it was a holiday. Now of course we can see an immediate downside to this scenario: I got up early and went to New Jersey all for nothing. But there’s an obvious upside, too, which I chose to focus on, namely that I can leave work only a minute after arriving.

So off I go, but when I got to the PATH train and reached back for my wallet to get my passcard, a sudden flashback to my hand shutting the drawer with my wallet in it. But after walking back to the building, I talked the guy into letting me in to the elevator bank without my pass (the electronic card’s in my wallet), but he said, “How are you going to get in when you get up there?” There are also sensors on each floor outside the elevators where you need to swipe the card to get in.

“What, no one here has access to any floors? No security, no maintenance? What happens if there’s a fire?”

“The firemen have keys.”

So I went back to the PATH, walletless and moneyless, hopped the style, and went into Manhattan to hit Melissa up for a ten-spot. Home by 1:30.

An augury for the new year.

12.31.05

Russian Jumping

Posted in linkulous, Diversions at 4:53 pm by axlotl

If all you annoying skateboarders in Union Square had real balls…

russian jumping

12.08.05

potato

Posted in Nonsense at 11:19 pm by axlotl

The Plan:

city
wide
less wide
tight

potato

Potatogun.

potatogun

Rotten Bacon and fishpaste Projectiles.

  • Ready.
  • Aim.
  • Fire.

got me a place

Posted in Brooklyn at 12:41 am by axlotl

I found a four month sublet here in Williamsburg, in another loft. It’s really quite nice, though I can’t move in until Monday the 12th. So a great weight lifted, but not out of the woods yet as I still must skulk into R.’s apartment each night and out each morning. Though they seem to be ignoring me now.

The plan is to rest a month and work on some software and then spend the next three finding my dream Brooklyn apartment. Of course, I didn’t have an apartment in Brooklyn on September 11, and they hit us anyway. That’s a fundamental fact some tend to forget.

12.04.05

from the bunker

Posted in Brooklyn at 12:21 am by axlotl

Well, the whole apartment imbroglio went south in a big way over the course of November and as I write this I am living as a fugitive who exists in coffeeshops where I can snag free (or non-free) wifi, carrying a couple changes of clothes along with my powerbook with me everywhere I go. I spent the last month essentially looking for an apartment full time but without luck; my bad credit stands between me and any legitimate contractual real estate transaction, it appears. Now it’s the fourth and most leases started days ago and the slim pickings have become anorexic and I’m past the evacuation deadline. I know it’s impossible that everyone in Manhattan has pristine credit, and the vast majority of them have housing, but finding a new apartment here with a besmirched record is tortuous. And torture.

But why Manhattan indeed? I am moving from Brooklyn, it is true, but I am moving from Williamsburg, one stop under the river on the L train and thus closer commute-wise than many locations actually on the island proper. The option I had always eschewed was moving further into the largest city in the States (that is Brooklyn), say to Cobble Hill or Park Slope or whatever. When I lived in NYC in the early 90’s, I lived in the ‘Slope, and never forgot how long it took to actually get into the city, what with the walk in the merciless cold to the subway and then the endless ride. But midway through my current search, I had a chance at an apartment (maybe in Boerum Hill?) that I didn’t get. But after I tried for it, in case I got it, I had to reconcile myself to the idea of a one-hour commute to Manhattan in exchange for a large, old apartment and it happened in a snap. An exchange I used to think unacceptable (luxury for commute time) was immediately obvious, desirable. But I didn’t get that apartment.

And none of the current ephemeral possibilities before me are in Brooklyn, they’re all here in Manhattan; it’s hard to switch the search to another borough mid-way. I might even end up on 95th street, which belies all the arguments about commutes, of course. Which brings up the question of why I would be moving into an apartment I don’t want to live in. Essentially, as detailed elsewhere on this website, I stumbled into an apartment fight which was for me one apartment fight too many, and I decided to join the fight; before I had always demured and moved on. It was the wrong decision, I know in retrospect. Through increasingly severe and ever illegal harassment, my sublessor has driven me from my apartment. Well, I still live there, but I can’t use the kitchen or bathroom and essentially live behind a now locked bedroom door, scurrying out before dawn and in long after nightfall so as to avoid being screamed at.

In fact the reason this last search for an apartment took so long is that even though knew it would be difficult to get an actual lease, my previous plan of going from sublet to sublet was exposed nastily as untenable in the course of the last few months. But it is just a bad idea to get in a fight with someone who controls the place you have to live. When that fight gets nasty, living gets nasty, and when life gets nasty, the will to fight fades and one wants just to live again, simply. So I ended up looking for a lease that didn’t exist from an apartment without a lease and as the search faltered, I had no retreat available. Now I am without a home and amazed at how much of the minutia of quotidian existence rests on an unspoken assumption of the reality of a home, a safe place, a refuge from the rest.

Somewhere, somehow, in a day or two, I will have a place to live. Then I can be there in my home and, undergirded by its simple fact, rethink my entire project of living in New York City. The pre-rethink unthink is well underway.

11.28.05

Greasemonkey Hacks

Posted in Greasemonkey at 1:08 am by axlotl

Yes, the book. I finished my first read-through of what I was rather expecting to be a rehash of all the topics I acquainted myself with as they passed through my inbox in the form of the greasemonkey mailing list. Instead, I am pleasantly affected, but not all that surprised, to discover that Mark has written a gripping (yes - gripping!) book that was actually teaching me new things from the very first chapter. Specifically, that chapter has a thorough discussion of the version 0.5 rearchitecting and the mechanics of deep XPCNativeWrappers which illuminated a few pitfalls I have run into lately (I found it excerpted here).

I am not intending here to write a review, though, of the book, but instead to provide a marker to those led to this site by the book, since it’s URL is in the book, included therein appended to my entry in the “Contributors” section at the front. Unfortunately, my contribution, to the extent it could still be said to exist, is, like a certain class of XPCNativeWrappers, shallow and implicit, my actual script having been cut from the book before publication. That script, the slashdot guilt-O-meter, stands in stark contradistinction to the rest of the scripts in that they are actually useful, and in a pragmatic, as opposed to pedagogical, sense. The guilt-O-meter is definitely not very useful. It does manage to cram several essential greasemonkey motifs into a small space, and I figured it might be included in an introductory chapter on that basis. But it was not to be. Hey - at least I got a free copy of the book. You should pay for yours. It’s worth it.

11.25.05

nothing doing

Posted in Nonsense at 1:24 am by axlotl

Just to post something so this isn’t dead for a full month (or have I passed that already?), not that anyone goes here except me, I’m putting this. Apartment search has been fruitless and my bedroom in R’s is unbearable. I try to sleep elsewhere. Maybe if I were willing to sublet again, but that’s what got me in this situation in the first place (and in every other situation where at base I was living in someone else’s apartment). But my credit rating is bad, bad, so it’s hard to find a New York landlord who will sign a lease with me. What does everyone living in this city have good credit? I tend to doubt it. All I want is a room with a door that I can shut leaving me (and my cat) in and all you other motherfuckers out. Soon, soon.

This situation has had a major impact on my coding, not the least reason being that I haven’t had internet access in my apartment for two months now. I live in coffeeshops and a big shout out here to Fix cafe on 11th off Bedford in Williamsburg, where the wifi is free and the tunes are rockin’. Still, though I love my ancient powerbook, it doesn’t stand in for my powerbook PLUS my 64 bit gentoo server and a couple other computers. usually I’d have the powerbook wired through a KVM switch so I could have more real estate. In general, though, not having a real home is leaving me aimless and untethered, and it’s hard to gain the focus necessary to code anything of substance. At least there’s the happiness of having discovered TextMate, the best text editor dey iz.

Code: well, I finished Gina’s site on a powerbook in a coffeeshop and I’m working on Nikolaus’ site in a similar environment (just a crude flash movie live there at this point). I keep updates to my extension plugging along. Also I’m working on some graphical notices for another extension, whose book I got cut from. That’s all.

10.21.05

R. Blinks

Posted in Apartment Woes at 6:58 pm by axlotl

Well, I win. R. has agreed to all the terms of my offer. So now all I need to do is find another apartment. I was actually about ready to throw in the towel, life during wartime having become so unbearable. I had no internet, I had to steel myself against verbal assault merely to walk to the bathroom, I always came home fearing I’d see the last of my belongings being picked through on the sidewalk. I was coming to the grudging realization that the only viable path left to me was a rent strike, which would require staying there at least another two months in order to recoup my deposit, the gas bills, moving expenses, punative damages, and etcetera. And that seemed unbearable; life is too short to waste so much of it in pursuit of justice (and vengance). So I was about to blink. But R. blinked first.

Now maybe I can retire this stupid category.

10.19.05

ginalevay.com Upgrade Live

Posted in code at 4:26 pm by axlotl

I’ve finally finished an upgrade for my first commercial client, the third site I’ve built for her, the second I’ve designed from scratch. Gina is a professional photographer and her website consists predominately of image files, which means moving a lot of large things both around the screen and over the wire. The interface must present a set of navigational tools that allow for rapid and intuitive access to all of her photographs. At first I was somewhat chagrinned to come to the conclusion that frames would solve this problem most thoroughly but I feel I was able to make their implementation essentially transparent to the end user, who doesn’t need to know, for instance, that the reason the thumbnail block can persist while the main picture is refreshed is because each is in its own frame.

Under the hood, there are caching mechanisms to help smooth the transitions between large image files, which are presented either full size or in a reduced version automatically depending on the browser real estate available on the client. For Gina, dynamically created thumbnails and small-format versions mean she only needs to drop new images into their directory and all the hard work is done for her by the scripting engine. Alternately, she can drop entire directories in and the scripts will pick them up and plug them into the interface.

There are probably ready-made frameworks that could have served as a good jumping off point, but for this project I started with a blank screen and wote it by hand from the ground up with vim.

10.11.05

Email From R.

Posted in Apartment Woes at 5:20 pm by axlotl

When R. unplugged my wireless router, I set an appointment to get my own line installed. I told her last night I might need access to her office; she just sent me this amazing email by way of reply:

Dear Chris,

The loft was never advertised with any internet availability or access. This
was never a service that was available to you and this is not a service you
may have installed in my loft. I also advertised for a roommate to rent that
room to who did not work from home. You told me you had a job out of the
house. I am not interested in having a roommate who works from this space.
Therefore if you have lost clients as a result of not having internet
service I guess you will have to find another space to work in. I also
mentioned in my advertisement that there was no extra room to store extra
furniture or things so please move all items outside your door into your
room. I also advertised that I did not want any other animals and you
arrived with a cat. Your cat seems to be tearing up my furniture and
fighting with my cat so please keep your cat in your room at all times.

cordially,
R.

She just now noticed the cat! Can you believe the gall this chick has? My reply:

R.,
Unfortunately these are not restrictions you can legally enforce. Sorry,
Chris
P.S. Do you ever do anything that isn’t illegal?

10.09.05

Formatting <code>: A WP Plugin

Posted in code at 7:34 pm by axlotl

I love line numbers. But I could never figure out a good way to use line numbers with all the killer code I tend to post. I don’t want to hand-code all the numbers behind every line of code when this is a job just begging for automation. After all, they’re line numbers. But even if they are automatically prepended to every line, there’s still a problem because if a reader tries to select the code text, they get the numbers as well. Yuk. So the question is, “how do I make contiguous blocks of text that can be selected independently?” Ask it that way and the answer presents itself almost immediately: tables. Grab the code, number it, and place the line numbers and the code blocks into adjacent table cells. Is that violating the division between content and style? Sorta, yes. But make that classic dyad into a triumverate: content, style, and functionality, and the problem appears to be solved! So here’s codeformatter, a WordPress plugin. Install it in your WordPress self-publishing system and everything between <code> </code> tags will be numbered and still selectable and it happens while the page is being served, so it never has to sully the post, should one care to return for editing.

Yet to do: provide an easy interface to the style sheets. They can be hand-coded, of course; the classes are: td.code_ln, td.code_content and table.codeTable. Add the rules to your style sheet for the plugin (you might need to use ‘! important’) or dig into the code for the script, at least until I make that interface; there’s just a simple .css file in there.

update

I just moved the css into the php file so it can be edited from the plugin editor. The alternating “tiger rows” can be controlled (or removed) from there. Current theme is spindle-pull line-feed computer paper.

As an example of the plugin in action, here it is numbering a little chunk of itself (try selecting some code):
for ($i = 0; $i < count($elems[1]); $i++) {
$ln = “”;
$codeBlock = “”;
$replace[$i] = $elems[0][$i];
$code = trim($elems[1][$i]);
$lines = explode(”\n”, $code);
for ($j = 0; $j < count($lines) ; $j++){
/*
* remove blank lines and non-code html
*/
if (preg_replace( “/<\/?code>|<br\s?\/?>/i”, “”, $lines[$j]) == “” ){
continue;
} else {
$ln .= $j. “\n”;
$codeBlock .= preg_replace( “/<\/?code>/i”, “”, $lines[$j]) . “\n”;
}
}
}

10.05.05

Fucked by UnumProvident

Posted in Nonsense at 2:42 pm by axlotl

Or Forest Labs, depending on your viewpoint. Forest is my employer, Unum their insurer. But either way, when I had my belly cut open for hernia repair on August 23, I was mindful of the last time I was seriously injured while employed here. In early 2003, I was moving out of my Astoria apartment and fell down the steep, hard stairs, which sent me to the emergency room and left me literally bedridden for a couple days. I knew I didn’t have many sick days, so essentially as soon as I was physically able to make the commute, five days after the fall, two of which were a Saturday and a Sunday, I returned to work. I was in serious pain. My friend Tim said, “You should have stayed out two more days. Five consecutive days and you can apply for short term disability.” Of course. Be attentive and punctual and pay the price.

So this time I’d be smart. Before my surgery I went down to Human Resources and discussed the procedure with Irene. The deal was: five consecutive workdays or seven consecutive days of absence along with a doctor’s note would get me disability pay. Coincidentally, a week is exactly the time my surgeon wanted me to take for post-surgical recupperation. So I took the week, had my surgery, and submitted all the forms, i’s dotted and t’s crossed throughout. Later I got a letter from Andrea Doughty at UnumProvident saying there was a problem. Please call. So I called. Voicemail. So I left a message. Then I did it again the next day. Then HR called and said my claim had been denied. When I finally reached Andrea, after denying I had left any messages at all (you’d think a big insurance company could afford a more robust voicemail system), she told me I was fucked. But not so nice a manner.

See, there was a technicality. What might a decade ago have been called the mother of all technicalities. You need to be out seven days, yes. Then you need to be out an eighth day for the benefits to initialize, at which point they are retroactively applied. By my reading, the easy way to render that requirement in English is to say, “You need to be out eight days.” So, ideally, as I have no sick days, floaters, personal days, or vacation days left this year, next year’s vacation days are going to be sucked back and applied to my fabulous week in surgery recuperation, expenses not paid. That’s the best possible outcome. The worst is that I’ll simply be fired.

10.03.05

New Shoes

Posted in Nonsense at 12:54 pm by axlotl

I got a great pair of shoes the other day. I was out of the loop because of the surgery; I had been procrastinating getting started again and also I lost one shoe when I was moving from M&M’s to Brooklyn (I think Tate took it) so I needed a new pair. Now the last search was a little work, but this time I was walking by that sporting goods concern by Union Square and on a whim I walked in and here was my searching technique: I picked up shoe after shoe until I found the lightest one. Tried on a pair of Adidas Supernova Comps and loved them and bought them on the spot. They are ugly as hell (orange and neon white) but are so light it’s really like having nothing on my feet. We’ll just see if I have any knees left in a few months. But then as always for the chronically lapsed runner came the first hard run after several weeks of indolence. I’m surprised again at how easy it is to just keep going so I just keep going, running far further that I would on a normal run when I’m in the groove. It’s not hard at all. But today my legs are quite insistent: that was too damn far. I can barely walk.

09.29.05

Forking Myself

Posted in Nonsense at 4:16 pm by axlotl

It’s resume time. I’ll be sending mine out by the ream in the next week, but there’s one last thing I need to do. I need a place on the web to which I can point prospective employers that doesn’t detail at some length this conflict with my roommate, which has kind of taken over this space at the moment. Whether or not the fault lies ultimately with me, the soap opera unfurling on this page would not likely inspire a check in the box next to “Plays well with others.” So I’ve got a long list of domain names I’ll be bouncing off a whois server tonight so I can secure an at least marginally catchy name that doesn’t contain an obvious misspelling (as does the domain you’re reading now) and that doesn’t have to be spelled three times to someone receiving it verbally (as does this one). When I’m done, I’ll have another site that hopefully will serve as a more practical home base for a professional web developer.

This site will continue to serve as the same tawdry public diary it has since it went live. Oh, goodie.

Zero Hour

Posted in Apartment Woes at 2:31 pm by axlotl

Well, while I suspect that R. has acquiesced in spirit to my offer, she hasn’t actually confirmed that explicitly, so the lease stands as is and Saturday is the first - rent day. So, good tenant that I am, I’ll have a check for the full rent ready to give her then, but I’ll take the opportunity to make sure she understands a few things.

  1. I can and will have as many visitors as I wish whenever I wish
  2. I will be suing for a reduction in rent based on the witholding of services (washer/dryer, dishes)
  3. I will be suing to end petty harrasment
  4. The offer as it stands will be rescinded. The next one might not be as generous

I do not look forward to living under seige for any length of time; life is short and it’s painful to acknowlege that I’m squandering precious days in service of some ideal of justice. But I’m also doing so to insist on tangible recompense. So this isn’t all pie in the sky, there’s money involved. Hopefully on Saturday I’ll have an answer one way or another and here’s hoping that its one that can free this webspace for discussion of things other than my evil roommate. But whatever it is I’ll post it here.

09.26.05

Harrasment

Posted in Apartment Woes at 2:52 pm by axlotl

Turns out it’s illegal for a landlord to engage in an asshole war in the first place:

§ 2525.5 Harassment:

It shall be unlawful for any owner or any person acting on his or her behalf, directly or indirectly, to engage in any course of conduct (including but not limited to interruption or discontinuance of required services, or unwarranted or baseless court proceedings) which interferes with, or disturbs, or is intended to interfere with or disturb, the privacy, comfort, peace, repose or quiet enjoyment of the tenant in his or her use or occupancy of the housing accommodation, or is intended to cause the tenant to vacate such housing accommodation or waive any right afforded under this Code.

I had been wondering how to ask her about the stereo when it’s evident from the outset that the volume is set so high precisely to annoy me. This makes the notion of politely asking her to turn it down a little risible; why not just skip the formalities and get right to the threats? So I just affixed a printed copy of this law to her stereo with scotch tape.

09.25.05

It’s War

Posted in Apartment Woes at 3:57 pm by axlotl

Well, I’m sorry to say that I’m getting no reply from R. on my offer. Or one might take her new habit of playing the stereo loud all day every day as a reply of sorts. She hopes to drive me out through sheer assholery. She took the toilet paper out of the bathroom so I had to go buy my own private store, she moved my kitty’s waste-box from the pantry and set it next to my bedroom door (where it will remain), and all day long there’s that NPR, which is certainly preferable to any CD in her collection of 70’s treacle, but which is definitely designed to be annoying (she can’t even really hear it back in her office). But I can take it. I got my guitar amp out of storage and bought a new set of strings. I wired my speakers to the DVD player for full bass effects when I watch Aquateen Hunger Force. And then I inadvertantly discovered the most effective weapon at my disposal.

Late Saturday evening I came back from dinner with my friend O. and R. was still up chaperoning her dog to the deck so it could soil the boards. I introduced them: “O? R. R? O.” When I got back from the bathroom O. told me she had chatted briefly with R. without incident. Odd, R. usually grimaces and flees when confronted with a guest of mine. But the next morning by the bathroom door R. confronted me: “I’d prefer you didn’t bring guests over.” Coming up short in the witty reply department I simply told her to fuck off. “I’m Serious,” she yelled through the bathroom door. “NO GUESTS!” An odd fact: even if a lease contains a provision to limit guests, that provision is unenforceable; NYC tenants can have whomever they want over whenever they want. So I’ll be sure to exploit a diverse and active guestlist, and the planning has started on my first party. And there will be more after that. She wants an asshole war? She picked the wrong damn asshole.

09.20.05

Guilt

Posted in Apartment Woes at 4:24 pm by axlotl

Well, in the few days since I presented my offer and received an annotated version in return with the reimbursement I had arrived at modified down considerably, my feelings of guilt have grown. Never mind that I answered an ad for a long term apartment in good faith and paid my rent and lived quietly (and watered the plants and fed the cats) only to be unceremoniously shown the door. Never mind that all I did by way of response to this affront was to suggest a reasonable compromise wherein she gets what she wants and I get a fair recompense for the disruption of my life, though a major disruption it is, moving again, the multifarious inconvenient aspects of which I will not detail here. Even though I was totally within my rights, I started to feel that maybe I was being too hard on her and maybe I should just pack up my stuff and quietly find a new apartment.

Nah. All that went away in a pleasant resurgence of confidence in the rightness of my cause as I handed her a spreadsheet I’d laid out to detail my offer - with the original full remuneration reinstated of course. Hey - I’m like a pro sports person. You wanna buy out my contract? Here’s the price. “That sum is non-negotiable,” I said smugly as I set the spreadsheet in front of her while she grimaced. Then, a couple minutes later, alone in my room, I started thinking. “Non-negotiable? Doesn’t that actually refer to valueless money?” D’oh!

09.15.05

Offer

Posted in Apartment Woes at 2:25 am by axlotl

I made the offer. It was kinda dramatic (of course). The remuneration fork added up to more than I had expected.

There were arguments, I said there was no point.

A messenger came back: Apology is out of the question. He started to point out the parts she refuses to pay; she still doesn’t get it. I decided to let her stew a couple days.

09.13.05

Roommate Drama Goes Off the Deep End

Posted in Apartment Woes at 2:45 pm by axlotl

So I got home after morning coffee on Saturday to find a note taped to my monitor in which my roommate (R.) said she was “no longer comfortable” having me there and gave me 30 days. I informed her that she was not actually allowed to do that by law; I had to actually do something bad. In fact, I’m clean, quiet, I pay my rent on time and don’t poke puppies with sticks. I began to slowly lay out the entire tenants law in NYC, which is 120% on my side (amazing but true). She said, “how can you stand to be here with someone who is uncomfortable with you?” (but in a much more petulant, eye-rolling, insulting fashion), and I said, “well, what exactly is different now? You were already barely civil to me.” “But you don’t understand, ” she continued, “I want you OUT.” “I’m sorry to hear that,” I replied, in awe of her gall, appalled really, “but I’m not leaving.”

So I see this essentially as fraud; she wanted to spend the summer gallivanting about the country taking pictures, but didn’t want to hire a pet-sitter/appartment-sitter. So she placed an ad in craigslist, used the niceness of the apartment along with threats of other interested parties to ratchet the price up a couple hundred, and then, less that a week after returning to her job, tried to tidy up the inconvenient fact of her new roommate. Fortunately the law is designed to protect inconvenient people.

She made it clear she would do what she could to make it unpleasant for me, and that I would no longer be allowed to use the washer and dryer, the pots and pans, or any dishes. I had actually thrown out my meagre collection of cooking supplies when I moved in. Though the law is firmly on my side, I of course do not savor the prospect of living under seige in an apartment where I am openly loathed for any long period of time. Here’s my current plan: approach R. with an offer . I’ll leave by the end of October if she does either one of two things:

  1. Repay me for the pro-rated gas bill (I was paying ahead for winter, $125 a month in the middle of the summer when I wasn’t actually using any gas) and also for the amount above the advertised price I was paying ($200/mo). All of this would come to around $600. Also she’d have to pay my moving expenses. Aternately,
  2. if she convinces me that SHE understands the immorality of what she tried to do to me and offers a heartfelt apology in addition, I’ll also leave by November. But she has to really convince me. And pay my moving expenses.

On the other hand, I’m perfectly ready to hole up for the winter.

We’ll see…

-moz-outline

Posted in code at 2:30 pm by axlotl

Is there anyone who uses anything besides Firefox when it comes to web development any more? Aside from the simple fact of standards compliance as good as or better than every other browser, there are so many helpful tools, such as extensions like webdeveloper (the grand daddy); measure-it; LiveHTTP Headers; platypus; greasemonkey, which can serve as a platform on which to “roll your own” diagnostic mechanisms (or use ones rolled by others, such as the useful XMLHttpRequest debugger); built in tools like the DOM inspector and the javascript console; and of course venkman, the javascript debugger, without which I think I would surely have perished in multiple fits of hair-pulling during the development of my first extension. My practice is exlusively to develop first on firefox and then tweak platform by platform across the spectrum of lesser other browsers.

Anyway, like many others I’m sure, I’ll often I’ll add colored borders around divs or other elements to see their dimensions, but there’s a drawback to this, namely that borders take up space - at least one pixel, which is really one pixel too many. But scrolling through the list of mozilla-specific CSS properties, I discovered the wonderous -moz-outline, which appears to draw a border without displacing content. If you’re using -moz-border-radius to prototype curved corners, you can use -moz-outline-radius in its place for the same effect.

09.12.05

Getting Worse on the Roommate Front

Posted in Apartment Woes at 10:56 pm by axlotl

My roommate REALLY sucks, not just sorta, it turns out. I was talking to my friend Cheri: “Remember when she was there and you and O. and I walked in and I said, ‘Hi, Robin. There are my friends Cheri and O.’ And she stood there looking at us for a second and then turned around without a word and went back to her room to hide? Did the same thing with S. (though I didn’t even notice her - S. did). I had called earlier to leave a message that S. (who went upstate for a couple days in the middle of his visit - during most of which she was gone, thank god) would be using a spare set of keys to drop his luggage off because he was getting back in the afternoon and I’d be at work and he didn’t want to tote his luggage around until I got off. She called back and left a message that if I thought I was going to have an overnight guest I had another think coming because she had to work in the morning and blah blah “…and that’s the bottom line!” Like I can’t have overnight guests in my $1500 apartment. Actually, in order to avoid a row, I set S. up at my sister’s for his last night and met him again in the morning just to avoid having to deal with it - you know - as a distraction when I’d rather just be enjoying his visit. But one day soon (really soon, it’s looking like) I’ll have an overnight guest and she’ll blow up and we’ll get to have a little talk about New York renter’s rights. It’s not as if the environment there could get any more uncomfortable.”

If anyone’s reading this, stay tuned. I have a sneaking suspicion that things are going to get nasty here pretty quick. High New York Renter’s drama.

09.09.05

Fixing Extensions for Firefox 1.5 Beta

Posted in code at 9:01 pm by axlotl

Wow, the new Firefox beta is fast. But you might have been dismayed on installation when confronted with the list of extensions that would be incompatible with the new version. If you don’t care to wait for the authors to get around to updating their extensions, it’s quite possible that you can easily fix many of your broken extensions with a fairly simple four-step procedure. Before we start, you should back up your profile; in fact, it wouldn’t hurt to do that even if you don’t plan on following the instructions below, just on principle. OK. Now grab the .xpi of any complaining extension (we’ll use the webdeveloper extension for an example, but so far, mouse gestures, delicious post, and others can be fixed this way) by right clicking on the “install” link on the addons.mozilla.org site and saving to disk. Put it in a temporary directory and navigate there with a command line console (this can surely be done with a GUI archive/compression program as well). But let’s say we’re in *nix, OSX, at a cygwin bash prompt, or even at a dos prompt, provided there’s a command-line zip program such as 7-zip available. Now the .xpi (which stands for “Cross Platform Install,” and is apparently pronounced “zippy”) is actually just a zip file, a compressed archive. So the series of commands looks something like this; the commands you type are blue and all the gray is what’s echoed back by the computer, including the ‘$’ prompts. There’s a call to vim in the middle; I’ll show the details below this code block:
$ unzip web_developer-0.9.3-fx.xpi
Archive: web_developer-0.9.3-fx.xpi
creating: chrome/
inflating: chrome/webdeveloper.jar
inflating: install.js
inflating: install.rdf
inflating: license.txt
$ vim install.rdf

When you open the install.rdf file (in vim here, at line #8, but any editor will do; try notepad in Windows or Text Edit in OS X), find these (or similar) lines:
<em:targetApplication>
 <Description>
  <em:id>{ec8030f7-c20a-464f-9b0e-13a3a9e97384}</em:id>
  <em:maxVersion>1.0.2</em>
  <em:minVersion>1.0</em>
 </Description>
</em:targetApplication>

…and whatever that maxVersion is in your particular case, change it to 1.5. The beta currently reports its version as 1.4, actually, but this way you won’t have to do it all over again when it’s out of beta. Save your changes and we continue:
$ rm webdeveloper.xpi
$ zip -r webdeveloper.xpi *
adding: chrome/ (stored 0%)
adding: chrome/webdeveloper.jar (deflated 11%)
adding: install.js (deflated 67%)
adding: install.rdf (deflated 62%)
adding: license.txt (deflated 62%)
$

And that’s it. Unzip, edit, remove the old version, and rezip. When you’re done, you should have a webdeveloper.xpi (in our example), which you can navigate to with the File->Open menu in Firefox, at which point you should be greeted by the normal extension installation dialog. Note that I named the file ‘webdeveloper.xpi’ but it’s not important that you give it the same name it had when you downloaded it; firefox will get the name of the extension from the config files within. Due to the fact that there are some major changes under the hood in Deer Park (which was the code name for the new beta when it was an alpha), it is of course possible that just telling firefox that an extension is compatible will not be sufficient to ensure that it actually is compatible. It’s even possible that trying to load an incompatible extension will hose your browser. But as long as you’ve backed up your profile, restoring a Firefox installation should be easy. Note, though, that if that turns out not to be the case, the responsibility is yours, not mine ;-)

08.31.05

GM as an Adblock Crutch

Posted in Greasemonkey at 11:49 am by axlotl

The “clip ads” that appear at the top of gmail don’t really bother me and in general I don’t mind “paying” for gmail by ignoring an advertisement or two. But recently, alexa thumbnails of the page in question started popping up more frequently than I would like, and I don’t at all feel bad about stripping those out. But if I use adblock for that, then I’ll lose the alexa thumbnails that I want, such as the ones inserted into del.icio.us and regular google searches by the Better Search Firefox extension, because they come from the same server (thumbnails.alexa.com/image_server.cgi/, though BetterSearch does get some thumbs from open.thumbshots.org) and will be caught by that same regex. So, even though Greasemonkey experts will tell you to use Adblock for ads (a reason being that you avoid even downloading the unwanted data, one result of which is that the images won’t briefly flash into existence before being removed), this seems like a case where Greasemonkey provides an added level of granularity and thus an exception to that rule. So Here’s a (very) short and sweet greasemonkey script to temporarily plug that hole: the Gmail DeThumbifier. It doesn’t remove the clip ads themselves, it only removes the too-large thumbnails while leaving useful thumbnails in place on other pages.

08.28.05

MailNull Now!

Posted in code at 10:12 pm by axlotl

Skip to “How to use it”
Skip to 10-24-05 update
Skip to files
Skip to firefox 2.0 version

MailNull Now! There it is, the title, rather silly on the face, I admit, of my first Firefox extension. As is usually the case, I didn’t have any big ideas about what I wanted to make; I just wanted to make something. So I made this extension, which provides a way to create addresses for the service provided at mailnull.com, a service one might be mistaken to believe obsolete, in these days when gmail provides shockingly efficacious spam-blocking and intuitive, easy categorization of email. But in fact there is still good reason in this day, when one must hand out an email to conduct even the most mundane transaction on the web, be it buying a car or signing up for an account at a bulletin board, to have access to an inexhaustible store of anonymous addresses which will forward to another address under your control. Why should amazon.com know your real email address? What if you decide you no longer want mail from them? It’s very easy to just delete the address you gave them from your mailnull account and *poof* no more email. When you start getting email from someone to whom you never gave your address, wouldn’t it be nice to know where they got it? If they’re using an address you created with mailnull and gave to a single corespondent (in my mind a good practice with all mailnull addresses; that is, one unique address for each correspondent), you know where they got it and more, you can delete it and *poof* again.

Mailnull.com can also serve as a categorization service. Say you’re primary email account is a gmail account. You can create filters in advance looking out for email sent to specific mailnull addresses which can be slotted into their proper category without ever touching your inbox. This was sent to the address that I send out with resumés, this went to that catalog company where I bought an LED headlight (an item which everyone should have at least one of).

It took me three versions to get accepted, but not, I don’t think, because my first versions were rejected. In fact, I provided updates more quickly (every third day?) than the submissions came under review, though the implementation was improved noticeably in each iteration. In the accepted version (0.3), I got big things like user feedback and the progressbar added. And made it so it couldn’t fail (almost). I guess I should focus on removing that “(almost)” for version 0.4.


How to use it


To use the extension, just right-click when you’re on a page that is asking for an email address and select “Create a new mailnull address” from the context menu. Provide login details (these can be saved for you), a name for the address (blank for random), optional comments, timeouts, maximum email limits, and even a password if you want. The extension communicates with the mailnull server to create your new address and copies it to the clipboard for easy pasting into a form on the page. Did I mention that you have to have already created an account at the mailnull site? You do. http://mailnull.com.


Update 10-24-05


Well, I made some fixes to address some bugs and issues mentioned on the extension’s page on addons.mozilla.org and to support Deer Park, but I apparently introduced a new bug because the update was denied. Unfortunately the submission process, even for a minor upgrade, involves a manual review of the extension by a mozilla reviewer and so can take a while (several weeks). So I’m going to start posting the current revision of this extension here for anyone who doesn’t wish to wait.


Files:


If you want to install these from here, you’ll have to allow popups on this page; otherwise just save these to disk and then File->Open them.


Firefox 2.0


Here’s the extension updated and working with ff 2.0. I also fixed a couple glitches, like the image in the about screen. Otherwise, still the same well-working, no-frills, workmanlike extension it always was. Playing with some frills, but wanted to get a working version posted ;-)

As an aside, when FireFox 2.0 came out and broke the extension, I was surprised to find that I wasn’t the only one frustrated that it broke on the update (although I certainly wasn’t surprised that it broke). It warmed the tiny cockles of my heart to get email from people using the first little scrap of software I released to the world, asking me to update it. And everyone asked politely! You guys rock.
mailnull-0.8.xpi 11-06-2006

I take back everything I ever said about mozilla addon review taking too long:
“MailNull Now! 0.8 - Approval Granted”
Time since submission? Around 40 minutes. Fuckin’ amazing. Here’s the official link.


Older Versions

Here’s version 0.7: bugfixes, 1.5.1 update.
mailnull-0.7.xpi 04-28-06

Here’s version 0.6. It increases the granularity of error capturing and enhances input filtering for everyone who tries to crash it by, for instance, telling the mailnull server to delete a new address after it is used negative infinity times. Doing this will, by the way, crash versions before 0.6.
mailnull-0.6.xpi 10-31-05

This fixes the “bad password” bug and includes Deer Park compatibility:
mailnull-0.5.xpi 10-24-05

08.22.05

the Catsitter

Posted in Apartment Woes at 1:20 pm by axlotl

I’ve mentioned already my new apartment, which I love, but which comes with some “bonus” chores on top of the rent. My roommate, who leases the apartment (which she essentially built herself out of raw loft space), and sublets to me, is often away for work, so I have to water the plants on the roofdeck on a daily basis. This comes with perks such as fresh basil for my new pesto addiction and of course the thrill of watching stuff grow again, a lost experience until now for your humble weblogger, a transplanted midwetserner.

But I also have to catsit, which wouldn’t be a big deal except that my roommate is insanely fretful about her cat, who has had some health problems, such as falling from the 4th story roof deck of this apartment and some urinary tract issue that can apparently be life threatening. So last month it threw up a couple times and I, thinking it no big deal, casually mentioned it later when I was talking to her on the phone (she leaves for weeks at a time, thank god), and she totally freaked out. Had her friend come and try (unsuccessfuly) to take the cat to the vet and then started riding me about it when she got home. “Look,” I said, “when I cat sit for you, I’m doing you a favor. What you say when you get back is, ‘thank you.’ If you want someone you can bitch at about the job they’re doing, you can either start paying me, or you can hire someone else to come take care of it.” She tried to evict me right then and there. I talked her out of it, but it’s all part of a pattern of her generally being angry with me over stupid shit and I can’t figure out if she’s just an easy-to-anger irrational freak or if she’s making a strategic move, to keep me always on the defensive, so, for instance, if the rent’s a day late, she can say, “that’s the final straw!”

08.16.05

For Mozilla Spiders and Humans

Posted in Nonsense at 1:34 am by axlotl

MailNull Now! is an extension I just tonight posted; it’s kinda crappy at this point in that though it’s completely functional, it needs to extract login details from a cookie set through the interface provided on the mailnull.com website fixed. And it’s obviously klunky to have to go to a website to log in and then launch an extension to post even if you can set the cookie to last until you log it out. So I have a new version I’ll submit tomorrow; it allows the extension user to choose a time window for the login (an hour, a week, until I close the browser, or until I explicitly log out), sends a POST request to mailnull.com and lets the site set a cookie and then re-reads the cookie with the Components.classes[”@mozilla.org/cookiemanager;1″] call that it used in the first place. It’s essentially transparent to the user. I am talking with the creator of the service and maybe I can eventually convince him to write a simple service API, though I don’t think in the end that’s really necessary since the interaction with the service requires only the passing of rudimentary chunks of data — just like those in a POST request.

Anyway, the extension is, as can be easily verified, properly constructed for localizations and is in general nicely modular. I hope that serves in its favor in your considerations. The progressbar doesn’t work yet, but hey, as can also be easily verified, it’s version 0.1 of my first extension. Should I have waited to post it? Did I mention how much I love you guys? And girls?

08.07.05

where i am: Fripp Is.

Posted in Nonsense at 3:25 pm by axlotl

So it’s family vacation time. Actually, this island is like some idyllic paradise with white people added. And alligators.

08.05.05

On Extension Development

Posted in code at 11:51 am by axlotl

One day far in the future when I can toss of an extension in an afternoon, I’ll have forgotten this week, but I want to mark it here, now, as an instructive historical sidenote. I wanted to wrap the web interface for the mailnull service in an extension. Mailnull allows the user to create email address “fronts” to protect anonymity; they can also be useful as an organizational tool wherein each commercial (or other) email respondent can be assigned a unique incoming email address. If an address ever begins to garner spam, it can be discarded and replaced with a fresh one. Anyway, I wanted to be able to create new mailnull addresses efficiently from within a web page, preferably with a right click and an auto-populated form. I contacted the author of the mailnull service and told him what I was planning and asked if I could use some images off his site, etc and he replied enthusiastically. Could he see the code? Sure, I replied, as soon as it’s done! I’ll probably send it to you tomorrow, I assured him with pacific certainty.

Mailnull’s creator provides bookmarklets to provide some of this functionality, but there are some drawbacks. Bookmarklets must be placed on a bookmark toolbar, and I tend to hide my bookmark toolbar, and further, there are four bookmarklets on the mailnull site with four different functionalities and I wanted to collapse them all into a single, flexable interface. I could have written a greasemonkey script, but it seemed time to learn how, exactly, extensions work, hence the Mail Null Now! extension.

I managed, in a under an hour, to simply wrap the bookmarklets in an extension interface that could be called from the toolbar or context menu and receive input through a javascript prompt. But this really wasn’t good enough; I needed a full dialog window, with textboxes for at least 5 fields and, possibly, tabs to allow a second interface to handle login details (which in this version relied on a cookie set by manually visiting the site and logging in - also not good enough).

But before I could start crafting all the fancy do-dads – calling the mozilla preference services to save passwords, managing the formatting of tiny packets of data to squirt over HTTP and the tools to scrape what I needed out of what came back over the wire – I had to make a dialog box through which to interact with the user, a user interface, that is. Outside of web pages, I had never written one of these creatures, and in mozilla even a simple dialog can consist of many javascript, XML, and CSS files recursively compressed into a single package called a cross-platform package installer, or .xpi.

It took me three days of crashing firefox and rebuilding my profile, editing the various tightly interrelated files, recompressing the extension, reinstalling, and watching firefox crash or lock up again before I finally was looking at the dialog with its various textbox input fields and tabs. In the process I managed to automate the process with a bash script, an absolutely necessary tool if you value your hair and sanity. But last night at long last I was looking at my shiny dialog, opening different tabs, filling out textboxes, and then it dawned on me: it doesn’t do anything at all. Which is to say, I haven’t even started.

Even though I’m not yet halfway through the process, though, I’m cocky enough to think I have some useful observations. If you’re starting off on extension development, here are a few suggestions:

  • Get this bash script. by Nickolay Ponomarev. I had to tweak it a little to suit my habits, but this script or a similar one is an invaluable tool.
  • Pick an extension that approximates the interface you are aiming for, open it up, tear it apart, figure out how it works (seems obvious, but still).
  • Don’t skimp on organizational filestructure. Prepare for localization by placing all text in locale/en-US/ (or whatever language it’s being developed in). Have a directory named for your extension under each chrome subdirectory. Like this:
    extension/
        chrome.manifest
        install.rdf
         +–chrome/
             +–content/
                    +–extension/
                           extension.xul
                           extension.js
    
          +–locale/
                +–en-US/
                     +–extension/
    
           +–skin/
                +–classic/
                    +–extension/
                           extension.css
    
  • Back up your profile and be prepared to delete and recreate it from that backup on a regular basis. To simplify profile management and quarantine possible problems, I just created a new profile expressly for use in extension development.
  • (This one’s provisional) At the moment it seems to me a good idea to utilize a naming schema that will help keep track of separate functions, element IDs, and UI element names. E.g. I’m using studlycaps for functions, dashes for IDs, and underscores for names, so the function mnDialogSubmit() controls an element defined in the associated XUL file like this: <textbox id="mailnull-dialog-username" name="mailnull_dialog_username"> Looking at that I’m wondering why I gave it a name. Oh, well.

Remember, if this be taken as advice, it’s advice from an absolute, utter novice. Just stuff I wish I’d known before I started. More later when it’s actually done ;-)

08.01.05

Strangers

Posted in Nonsense at 11:40 pm by axlotl

For a long time now, according to the logs, I’ve been the only person who ever visits this domain, but lately I’ve been leaving minor spoor about the web, linked spoor. Or links to spoor. And I carried the spoor about with me, maybe in some sort of pouch. Whatever. Other people are traipsing through very occasionally, and even if they tend to be linked straight to plain text files, some wander. So I started thinking that I well know that standards compliance has negligible effect on page display in Internet Explorer, and I’d better get prepared for them.

Then I started to think about what kinds of places I’d been leaving links, and one thing they all had in common, they revolved around the exploitation of all the nifty features of mozilla firefox. Mainly greasemonkey scripts. We all have this groovy “software community” thing going, albeit at a very large scale. So who would be visiting besides firefox users? Maybe, I thought I could just leave it like it was!

No. That’s the stupidest fucking Idea I’ve had in a long time. So I’ve got to turn on the windows box in the corner and look at the desktop with VPN over wifi (it’s oddly wonderful to have a computer that’s plugged only into the wall) and fix whatever’s wrong. But the reason I even bring all of this up is that I wanted to note at the outset - I wanted to lay it out - I will probably never even look at this site with ie-mac, much less fix it for that browser. It’s just not worth the time. And I wish others would also so note. Once upon a time it was the bee’s knees in standards complance; now it just needs to be killed off quickly and quietly.

07.31.05

Another lovely Williamsburg evening

Posted in Brooklyn at 8:34 pm by axlotl

subway_sign

But there’s so much to get done….

  • Finish the mailnull extension (good project for work)
  • HTMLize the resume
  • Check all my greasemonkey scripts for backward compatability with the new version (Yay Aaron!)
  • Make a simple front page for that directory (not everybody has better dir).
  • Make little gray icons to sprinkle around on links for that extra professional touch.
  • Start trolling craigslist for piecework

Yes, the cute girls are strolling down Bedford, there’s kickball in the park, I want to go see The Aristocrats, but there’ll be no summer evening frivolity this weekend. I’ll just be basking in the comforting rays of this here cathode ray tube. What, you too?

07.01.05

firefox 1.04 breaks venkman

Posted in code at 9:29 pm by axlotl

As noted in this bug report on bugzilla, venkman, mozilla’s javascript debugger, was broken by security enhancements in firefox version 1.0.4. Open up the debugger, set a window as Evaluation Object, and enter an expression in the Interactive Session and you’ll get this error: “Eval Error: function eval must be called directly, and not by way of a function of another name.

You can open up venkman.jar in the extension’s chrome folder and apply the diff listed in the above bug report (comment 7) for a temporary fix (which requires a restart) or, if that sounds too hard, and you trust me not to fuck with your debugger, you can replace the jar file with this copy of the jar file already opened, diffed, and repacked: venkman.jar. This also requires a restart.

Update:
An easier fix is now available. Merely update to firefox version 1.06 (if you haven’t already). The bug has been quashed.

06.16.05

New Home!

Posted in Brooklyn, Apartment Woes at 1:16 pm by axlotl

Zoom all the way in, and you can see the roof garden (at the tippy-point of the marker, a tiny cutout at the end of the long building sliver where it meets Weyth).


Here’s a handy linkie

06.15.05

Yahoo Mail Username Assistant

Posted in Greasemonkey at 12:05 am by axlotl

greasemonkey iconThis one was, I think, useless from the start. I imagine it’s possible to do what was requested (provide a drop-list of yahoo-mail usernames for the INPUT element of the login form) by toggling the browser setting that turned off the browser’s innate form-remembering functionality. I may be wrong. But I made it anyway because it sounded like fun to make. I had to learn more about the addEventListener function, which is fairly complex even within just the mozilla DOM implememntation. Anyway, here it is; go to yahoo.mail.com and type in a username and it’s added to an array that populates a clickable drop-list next time you visit. I may return and make it arrow-key navigable.

The Yahoo Mail Username Assistant

06.09.05

another quickie: washingtonpost.com link rewriter

Posted in Nonsense at 12:34 am by axlotl

I’d just post a link, but I’m having fun playing with -moz-border-radius in the code selector in my stylesheet. Kinda nice the way they taper thick borders going into a curve, huh? Not quite clean, but close. Notice how the incoming border starts to thicken in anticipation. That’s just plain thoughtful.

Babysitting for a friend who still uses Mac OS 9.1, I opened this up in Netscape 7 (remember when that came out? And it was gecko for the masses?) and those selectors already worked exactly as they do now. Man, I was so out of that loop. The 20 pound cat sitting by my feet was just a slimy fuzzball licking my blood off the futon. That was seven years ago!

// ===UserScript===
//
// @name             Washington Post Print-Freindly Redirector
// @description      washington post link rewriter
// @include	     *washingtonpost.com*
//
// License: http://gnu.org/copyleft/gpl.html
// ===/UserScript===

(function()
{
	var aLinks, link, href;
	aLinks = document.evaluate(
	"//a[contains(@href, 'article')]",
	document,
	null,
	XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE,
	null);
	for (var i = 0; i < aLinks.snapshotLength; i++){
		link= aLinks.snapshotItem(i);
		href = link.href;
		if (href = href.replace(/.html/g, '_pf.html')){
		      link.href = href;
	}
}

})();

06.07.05

quickie

Posted in Greasemonkey at 12:03 pm by axlotl

Kill the about.com floating toolbar.
// === /UserScript===
// @name About.com float-crusher
// @description Removes the cutesy floating toolbar div from about.com.
// @include *about.com*
// ===/UserScript===
//
(function()
{
var badBar = document.getElementById('iTb');
badBar.parentNode.removeChild(badBar);
})();

06.04.05

Zombies I Have Known

Posted in Nonsense at 1:05 am by axlotl

brains

06.03.05

Anandtech Rewriter

Posted in Greasemonkey at 12:31 am by axlotl

A new greasemonkey userscript that rewrites anandtech article links to go directly to the “print friendly” version: the anandtech link rewriter. Since the print-friendly pages actually span the entire viewport, no matter how wide, this script also sets a 1000 pixel cap on the print-ready article. This is my posterboy for my new slew of user-requested scripts because someone thanked me for it.

05.30.05

Slashdot guilt-O-meter

Posted in Greasemonkey at 1:32 am by axlotl

The slashdot guilt timer is another greasemonkey script I’ll take credit for, but I’m not sure why. I can’t imagine why anyone would want something that actually makes the web worse. Well, maybe I can. This is for people who come to realize they are spending too much time reading slashlot discussions when compared the the qualitative (and quantatative) value received, it’s a short stick. Then you realize that every second wasted reading slashdot is just that: wasted. Utterly and unforgivably. Well, feel worse as a timer counts (unobtrusively) and gives a total body count with a click.

[edit one month later]
My employer would be unhappy to discover that according to the slashdot guilt timer on my work computer (where I am not being payed to read slashdot), I’ve clocked 55 hours and 15 minutes over the last 30 days reading slashdot discussions. Note this includes tabs loaded in the background or left loaded and unread, but still, interesting.

05.15.05

second greasemonkey script

Posted in Greasemonkey at 11:45 pm by axlotl

This script is rather specific; it fixes one (dynamic) page on a much larger website, villagevoice.com. Essentially, I really like their film listing page, but they’ve decided to make the site only 800 pixels wide, and they have to fit into those 800 pixels too many things:

  1. A navbar on the left
  2. A main content area (film descriptions)
  3. A navbar for the film descriptions, and
  4. A column for classified ads.

Now I know the web developer probably didn’t decide that so many things needed to be mashed in there, and it’s possible (but doubtful) that the web developer didn’t have control over the decision to use tables, but the upshot is a column covering about a third of my screen on the left that has too many things mushed into it. The result is that the drop-select for titles can only accomodate about 13 characters (some of today’s modern films use up to 20!), and the main column for capsule review and theater listings is also just too small. So I wrote a script to fix it. I kept the entire width within the original width for the whole site, but stripped out the classified ads for more room and expanded and color-coded the main columns for greater readability. Get it here. Requires Firefox and the greasemonkey extension.

05.09.05

Google web accelerator

Posted in Nonsense at 2:41 am by axlotl

Though you can’t sign up as I write this because the capacity is maxed, I would suggest that you don’t sign up for Google Accelerator anyway, and not for any of the reasons being heatedly argued about right now. See here, the aggreived, and here, their mockers. No, my problem is much less esoteric. The Google accelerator, being a proxy cache, generates a history of your browsing activities. I can think of quite a few ways to profit by selling this sort of information. And though they state clearly in the privacy policy (which is actually the privacy policy for Google toolbar) , linked in the product’s FAQ that, quote, “Google will not sell or provide personally identifiable information to any third parties,” the collecting of private information, though it can be disabled, appears to be the default setting. This policy is “Version 2″, and version 3, linked at the top of version 2, ammends this slightly: (quote) “Google will not sell or provide personally identifiable information to any third parties, except in the limited cases described in our main Privacy Policy.” I hope their versions don’t go up to eleven. Kind of like a wilfully disuasive corporate beaurocracy, maybe? Anyway, the ‘main’ Privacy Policy, well, I’ll boil it down: (not a quote) “We will not give your personal information to anyone for any reason. Except to some people for some reasons. We’ll let you know if we change our mind.” You can see if you disagree by reading it yourself here. Yes, it’s the same link as above. Now consider this: if you’re like me, they already own your casual email. If you use the service, they’ll collect your personal search history in perpetuity. They even have a sattelite photo of your house or apartment building. Now it would seem they’re getting tired of nibbling around the edges and are going for the big tamale: a complete, personalized record of your life online.

Of course there is an upside to getting in on the ground floor, namely a relatively low GUID. If there’s one thing to be learned from the spectacle of slashdot it is that the posession of a low ID is the key to endless respect and defference from your not-quite peers.

Bob Frum vs Ken Lay

Posted in Nonsense at 2:04 am by axlotl

Just my take having seen the just-above-mediocre The Smartest Guys in the Room, a documentary about enron that abuses some of its genre’s conventions. It will be interesting to compare to its brother from a different medium, Kurt Eichenwald’s book, A Conspiracy of Fools, which shares both a subject and a POV with the film. So, The topic was “Ken Lay vs. Bob Frum,” Bob Frum being, if you’ve forgotten, the architect of Kerry’s campaign. Oh, and that of Gore. (Not to be confused with “axis-of-evil” speech co-author David Frum, which gives me a chance to link to Arianna Huffington’s bizarre celebrity bazaar on its first day!) In short, the guy behind the whole “aimless baby-boomer fecklessness” that hung like a stink around both of the most recent Democratic presidential campaigns.
1. They look alike.
2. They seem to have had vague plans that went awry at the hands of others,
3. but actually their plans were very specific and complex, and
4. completely wrong.
5. Neither all that bright.
6. Ken Lay’s probably a little brighter.
7. They look alike.

Coming to Grips with Ineptitude

Posted in Nonsense at 1:38 am by axlotl

Maybe it’s just that I smoke too much pot.

05.06.05

Critical Mass vs. NYPD

Posted in Nonsense at 8:57 pm by axlotl

The Critical Mass pro-bicycle, anti-automobile bike-ride cum protest has occurred on the last Friday of the month in NYC for years now. On the last ride, in April, the NYPD arrested 34 (NYTimes article, and here, for when it gets archived), and I was there. In fact, I only narrowly escaped arrest by maneuvering between two parked cars as scooter-mounted cops swarmed the sidewalk onto which I had veered to avoid the police officers’ pincer move. Since the police were increasingly gathering around the traditional starting point, Union Square Park, in an attempt to snuff the ride at its start, riders started from several other points around Manhattan simultaneously. I won’t say here where those points are.

The NYPD had attempted, the year before, to secure an injunction against the ride, but the judge presented the protesters with a seasonal gift by denying the injunction. The police wanted to dictate a “parade route,” on which they would accompany the bicycalists, but judge Pauley said “no:”

“After allowing the Critical Mass rides in Manhattan for 10 years without permits…the Police Department has acquiesced to the very conduct it now seeks to prohibit,” Pauley wrote in his decision. “To issue an injunction on such a gossamer thread would stretch this court’s jurisdiction beyond the limited elasticity of [the law].”

The NYPD wasn’t happy to hear this and they decided to ignore it. By early April, they were cutting bike locks to seize bikes that had just happened to be along the route of the ride (not to mention arresting riders). To justify the seizures, the NYPD referred to a “section of the administrative code allowing police to remove any ‘unattended box or bale’ of merchandise on the street.”

I was indeed worried about losing my bike by having to leave it (I didn’t even have a lock with me). But, having just turned west on 21st from 8th Ave, I was near the apartment my sister had recently sublet. But she had moved out last Friday -Damn! The police cars behind us were chirping their sirens, the helicopters above provided a cinematic “WHOOP WHOOP WHOOP” soundtrack and the scooters swarmed towards us down the one-way street, breaking the cacophany with a hornet drone. At this point Victoria sensibly dismounted and walked away. 21st street was halfway through a refurbishment, the kind where they rip the street to a cheese-grater consistency before re-paving, and sudenly 50 tightly-packed bicyclists were braking from a hard drive rather suddenly, trying not to run into one another. The bikes split up through parked cars onto the sidewalks and the scooters followed behind. Kicking off a couple bumpers, I emerged onto a sidewalk and in front of me three or four cops were dropping their scooters to lunge for a bicyclist, pulling him off his bike and onto the concrete. Coming up short I looked behind me to see the scene repeated.

The NYPD knows that they can simply ignore the judge, and if someone else eventually brings suit, they’ll just be rearguing the same case; there’s little chance they’ll be punished in any substantial way for ignoring the rejection of the city’s injunction (ianal). If slightly stricter guidelines are imposed, they’ll ignore those, too, and then another challenge and then another “stretching” of the boundaries, and just those three iterations will take years to be litigated. Remember this is the same department recently caught destroying and creatively editing video footage of arrests during the Republican National Convention. Too bad for them there were volunteer citizen observers with videocams.

I came between two cars and left the sidewalk through the very next gap and started pedaling. I passed a scooter-cop or two going the other way and dismounted at the next intersection to be less conspicuous. I immediately saw a group of cops on foot grab a person walking his bike and arrest him. So I got back on and just rode. As I accelerated through the intersection, kids pointed, yelling, “Hey! He’s getting away!” –thanks, kids!

Aside from the catastophic, global, political, economic, and environmental effects of our reliance on internal combustion engines, vehicles are annoying and just plain dangerous to bicyclists in the city. On a pragmatic level, I wonder which is contributing more to the economy (once you account for the maintanence of infrastructure, the fouling of the air, and the stagnation imposed by gridlock), the driver or the biker. I know that one group is responsible for fewer deaths and injuries. Why should the drivers get first say in the consideration of the laws governing the use of the roads? Maybe it has something to do with entrenched economic interests, I don’t know. And maybe the police are the tool they use to enforce those interests. Could be.

05.05.05

This is the ugliest site I’ve ever seen!

Posted in Nonsense at 9:51 pm by axlotl

What the hell was I thinking? Red and blue with an emphasis on orange? I hate orange. It’s my second-least favorite color, after its cousin once-removed, brown. Brown is, of course, the color of shit, and it always reminds me of shit, especially when it’s spattered. But even brown cords, say, well, I think it’s a message that you shit your pants. And why, then, is blood-red such a lovely color? The one speaks of death, but the other decay.

Gray is a color I like, but what of that gradient slowly covering that quasi ‘op’ art (really the output from a screensaver): gray then flat blue? Are we painting a toilet on a battleship? Ugly, ugl, ugly. I’m not going to make fun of the red squiglies because I love them. But we could talk about the splotchy :hovers on the calendar, the fact that the two submit buttons don’t match, the evilfinder, which is out of order, and the anemic type-face of the posts. We’d just be wasting our breath, though. I’ll never be able to produce a nice, color-coordinated, tastefully arranged design because I have no sense of that in the broad view. What is a mother to do?

05.04.05

Show Me a Milkman

Posted in Nonsense at 8:06 am by axlotl

(who wears high heels)
…and I’ll show you a Dairy Queen. Fun times at the My O My club in fabulous New Orleans LA.I especially love the sailor marionette.

04.27.05

to do - Wed

Posted in Nonsense at 10:10 am by axlotl

Now, aside from Nikolaus’ imagemap monster, there are a few things that really should be at the top of the list; some pretty tiny, others not so tiny. But when you’re sitting there trawling slashdot because you’re feeling unmotivated, refer to this list, please, chris. That’s a dear.

1. Image-replacement muriel titles for sidebar,
2. Print stylesheet for resume,
3. A fucking favicon (it’s an axolotl, can you tell?),
4. weblogs emailed to gmail as a cron job,
5. Clean out the default crap from the sidebar,
6. Add useful links in place of same.
7. Widen right-float sidebar.
8. (Eventually) real header image - I’d say 80px tall.
9.Customise the calendar.
10. Remove the default text-indent on the <p>.
11. Finish the goddamned xmlhttprequest list plugin so you don’t have to keep using the front page for to do lists.

04.25.05

curleys

Posted in Nonsense at 10:16 pm by axlotl

Well, I though of the idea of the wigglies tonight. It took me a few hours of noodling around with photoshop and a one-pixel pencil, starting with variable angle patterned backgrounds, over which I’d lay a gradient so the pattern faded away. Then I laid a light line along side a dark one and the curlies were inevitable. Well, they’ll still be here, but I’ll colorize them and smallify (or conceivably bigify) them a tad. Also the top banner has to go.

Oh so much work and it never ends. Nevertheless, I do believe that a site is best improved when one starts paying attention to the single pixels. Too bad I’m such a bad artist. What I got to do is acc-entu-ate the more, you know, subtle aspects.

04.22.05

“Habemus Papum!”

Posted in Nonsense at 10:05 pm by axlotl

Mmmmm….popups….
It has been a long three weeks since the pope died, three weeks in which apparently nothing of any importance in the world happened, or so it would have seemed to the casual newspaper reader or NPR listener, except for the death, mourning, and replacement of the head of the Catholic church. Thankfully, finally, a wizened German cardinal has won the ballot and can now start to dictate doctrines which will spell life or death for millions of African condom-non-users. Huzzah.

04.11.05

./ef

Posted in Nonsense at 10:20 pm by axlotl

Most so-called ‘blogs’ aren’t really service-oriented. It seems to me the phrase ’service-oriented’ is embeded in the nonsense-glyph ‘blog.’ Also, I am focused on living a life based on those things I believe. Further, service is a laudable ideal. So, without delay, I present evilfinder, the service. Featuring xmlhttprequest. It’s all the rage, you know.

The Easiest Thing So Far

Posted in Nonsense at 10:20 pm by axlotl

Every corner I’ve turned in the last 24 months has revealed another horribly daunting challenge, from when I was first setting up a webserver, which made me very paranoid, so I took time off to learn snort so I could feel comfotable before I read my logs (and after!). Then trying to learn perl, and realizing I didn’t really even know HTML. A few hours there and I discovered that I had to learn CSS, too, and around then I got a powerbook, and started doing photoshop and illustrator (in addition to my forrays into the gimp). Around this time, about a year ago, I started to understand the imporance of javascript, and by now I was writing an email client in PHP. Also, I had actual clients, for whom I did PHP-entwined HTML and javascript and, of course, CSS. Now, tossing off Wordpress themes, I need to find someone to hire me so I can do this full-time, instead of doing it along side a full time job at an insurance comany, in Data Management, squirling SQL.

Marijuana Deleterious to Nastolgia

Posted in Nonsense at 10:18 pm by axlotl

Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat. Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat, vel illum dolore eu feugiat nulla facilisis at vero eros et accumsan et iusto odio dignissim qui blandit praesent luptatum zzril delenit augue duis dolore te feugait nulla facilisi.

04.05.05

Policing the Borders

Posted in Nonsense at 3:23 am by axlotl

[Note: Yes, I’ve noticed that this article, which is partially about “cross-platform” solutions, is somewhat broken in Internet Explorer (”Mmmmm - face-egg.”). I’ll address it when I get home and update the article with the pertinant points.]

Though I suppose the technique I’m about to describe is applicable to CSS design in general, I had never encountered the dilemma it addresses before I started trying to compose stylesheets for wordpress templates. The scenario is this: you’ve got a 760px-wide header image; you have two columns, a wide one for content and a thinner one for links and other errata; you have a footer; and everything is hunky-dory with your column. You’d like it to slide to the center if the browser window is larger than 760 pixels wide so you style a wrapper with ‘margin: auto 0′. You finish off the column with a slight gradient running up and down the edges to suggest a drop-shadow and set it off from the page. Kinda like the page you’re looking at now!

All pretty standard stuff and you end up with a fairly standard centered page similar in general to a list apart, simplebits, or any one of myriad sites maintained by people who know how to make a website. But if we want to put a gradient (or any image that shifts value as it shifts pixels) on the background, suddenly the zone where the gradient along the center column interacts with the body background becomes very problematic.

top

Here the drop-shadow gradient attached to the border of the content spans an unpredictably variable chunk of background gradient

Now this wouldn’t be a problem if only there were some digital image format that had a full alpha channel. Oh, if only! Then you could just vertically tile (ala faux columns) and they could slide over one another as content and window size changed. A .gif won’t do, of course, because there is variable transparency, and gif can only do that sucky kind of transparency, so obviously the two layers need to be pre-rendered and locked together. But then how can they fit into the variable background?

The essential answer is that you make the wrapper column 40 px wider than the content column so you gain control over the 20 px where the column abuts the background on either side. The intersection of content and background is not a problem in the lower half, where the gradient has ended and the background is non-changing and predictable. Likewise for the header, dealing with this is pretty simple; you make the actual header image 760 pixels wide and the header itself 720 pixels wide and then use the right and left twenty pixel margins to hand-render the buffer between content and background. The interesting part is how you can extend this below the header in a surprisingly simple and cross-platform way. This image shows the zones of interest to us here. It’s pre criss-crossed by the mozilla extension webdeveloper’s outline function - fabulous extension, Chris - then I added some other highliting:
diagram of top-right corner

  1. the header proper (dark blue)
  2. the header image (bright green)
  3. webdeveloper outlines (which display the general structure)
  4. pointers to:
    • the edge of the the two columns, floated left (720px, combined), and
    • the edge of the wrapper div (760px)
  5. our target (fat red)

It occurs to me that it would be nice, though it would fuck the current project up, to make the sidebar an absolute height and sock it absolutely into the upper right corner so the content column could spread out underneath it. Then we woul’d be wasting all that space over there to the right. Another column, I guess. You understand why that’s impossible here, correct? There’ll be a quiz at the end. With a blue book.

Back to the issue at hand; we’re actually almost done. The problem is that we have to fill in that red rectangle with a custom-crafted image simulating the intersection between border and background. The solution lies in the fact that, like the header, the wrapper is 40px wider than the combined content column. So we actually control this little chunk and just have to slap a rectangular image into the upper right and left corners of the content area. Each image is 20 pixels wide and tall enough to extend down past the end of the gradient in the background. For this page here are the images, isomers of each other, and the code that positions them. #content is the main column and #sidebar is the right one:

left_right.png

top-left.png and top-right.png, magnified twice (roughly)


#content {
position: relative;
float: left;
width: 460px;
background: url(images/top-left.png) 0 0 no-repeat;
}
#sidebar {
float: left;
width: 260px;
background: url(images/top-right.png) 100% 0 no-repeat;
}

I am indebted to the unsung WordPress theme author Becca Wei, who wrote the theme whose source I was perusing when I came to appreciate the beauty of this method. Oh, and if you have a gradient at the bottom of the background, turn your monitor upside-down and re-read this article. You might have to reflect it off a mirror, too, I’m not sure.

04.01.05

Bush, DeLay Demand Feeding Tube for Pope

Posted in Nonsense at 10:28 am by axlotl

April 1
Despite the ailing pontiff’s express desire to be left alone in his quarters to pass in comfort and with dignity, President Bush and Mr. DeLay, the exterminator-turned-house majority leader, decried his support for what they called “a culture of death” and demanded the pope be forcibly restrained to facilitate the insertion of a feeding tube. “This man, this ‘pope’ will pay dearly for his rascally intransigence, ” ranted Delay, visibly perturbed and preternaturally florid. Bush, farting gently by his side, stressed that god’s messenger on Earth would bend to his presidential will; “the question is he going to go nicely, or are we going to have to get nasty, see, ” Bush said.

03.28.05

Note to self:

Posted in Nonsense at 11:30 pm by axlotl

The gray curlycue background doesn’t involve a header image other than the logo. It can go as wide as you want, right? Right.

03.25.05

Shut Up! I’m talking here!

Posted in Nonsense at 9:23 pm by axlotl

Briefly, though I doubt anyone will ever read this, I need to pump out a couple dozen wordpress themes (well, maybe a dozen) in the next couple weeks because that skill, writing wordpress themes, will quite possibly be a pivotal point of interest in a job interview I plan to engineer. The theme currently on this page is the first I’ve ever written. I’ll problably write a theme-switcher eventually, but for now I’ll just be publishing as many themes as I can come up with. Meanwhile I’ll try to discuss things I’ve learned about wordpress themes, CSS, PHP, photoshop and the Gimp, at least as so far as the latter four have to do with the main topic at hand. I’m discussing them with myself, but anyone’s free to join in. I’ll publish this and then start the first, which is about width-constrained, centered layouts and their discontents.

What’s mean? Though WordPress is inserting and into the HTML, it is neither striking them through or underlining them, which my refernce says they were once for. Interesting that there are control characters nonetheless.

Valid XHTML. 47 queries. 2.221 seconds. Powered by Wordpress. Theme design by axlotl.