software


“Please Download QuickTime, We’re Stuck in Web1.0″

please install QuickTime because we're stuck in web1.0When the hell is Apple going to get their head out of their asses and catch up with the rest of the Internet? Does anyone else use QuickTime to distribute marketing videos on the Internet? Does anyone else use QuickTime to distribute videos over the Internet that they actually expect people to watch? The entire Apple website is centered around marketing, and I, as the consumer, have to go download some additional tool in order to witness the marketing? Apple, you’ve lost the web-browser-embedded video-via-a-plugin war (although technically, since QuickTime is pretty much a one-trick pony compared to Flash, you barely even showed up at the battle). It does not matter how interesting the video is, or what better kind of quality QuickTime has over Flash-based video, the barrier to entry to have to install yet another thing, just for a rarely used feature, is just too great.

Additionally, there is no native Linux version of QuickTime. In comparison, I’m not a big fan of Adobe’s Linux support, releases for Linux usually being late in coming after the Windows and Mac versions, but least they recognize the diversity of the Internet and their (potential) customers. Apple getting more into consumer electronics means they are not marketing to some exclusive thinks-they’re-something-special crowd anymore. Additionally, the message doesn’t need to get out to the washed masses who have already sipped the reality distortion field koolaid and who can access what is effectively proprietary content without jumping through extra hoops, it needs to get out to the unwashed masses.

ssh keys on a removal drive

It’s more secure to use public/private key authentication with ssh and to disable password authentication, but it’s not secure to store the same private key on every machine that you may be sitting down at. I have two machines I use regularly, a desktop and a laptop, and I, well, my accounts, on them should have the same “identity” no matter which one I’m using and how I’m getting to the various accounts on servers I need to maintain and that I develop on.

I didn’t appreciate the power of the openssh agent until recently. For a long while, I wanted to have a single private key on a removable drive that I can carry around with me, but the disadvantage of having to mount and unmount the drive, and figure out its device name, when I just wanted to read for a few seconds it was more trouble than it’s worth. On top of that, some of the systems I have put the home directories in different places (/home/users, for example, ugh!), so it wouldn’t be as straight forward as just issuing the same mount command every time.

This can be done by using autofs though, in a machine independent manner — the only thing that needs to be customized on a per-machine basis is files in your home directory.


Continue Reading »

Race Conditions with Ajax and PHP Sessions

This one’s been in the hopper for a long time. Back in February, I came across, through Ajaxian, Marc Wandschneider’s “Troubles with Asynchronous Ajax Requests and PHP Sessions”, and Harry Fuecks’s ‘AJAX and Session “Race Conditions”‘. These are very interesting and well written articles about an often difficult to understand, debug, and combat problem: race conditions.

The responses in the comments are all over the place, from claims to that this is how its supposed to be, to this isn’t a problem with PHP it’s a problem with HTTP being stateless, to PHP doesn’t actually have this problem. The facts appear to be somewhat different. In general, everyone’s right, at least a little bit. As with many problems of this type, particularities of each environment can render different results.

One of the problem with race conditions is that it is often difficult to actually witness the ramifications of one when it happens, especially if you are not aware of it. If you’ve used PHP’s built-in, default session handling (that uses files), you’ll never come across the problem. However, things get interesting once you start using session_set_save_handler to write your own session handler.

Continue Reading »

undistracted writing with writeroom

Now, here’s an interesting product: writeroom. What strikes me is how similar writeroom’s screenshot looks like a green screen vt-dumb-terminal. I’ve long since written things like term papers and large documentation projects in vi (well, really vim, or whatever passed for a vi substitute on CX/UX back in the day at DePaul), originally on vt52 and vt100 terminals, writeroom's main screen mainly because the interface of things one would actually call “word processors” lend themselves to constant tweaking with the document’s look rather than making you focus on the content. It’s amazing how the speed, quality and content of my writing improves when written in vi. Once the content is written, the act of importing it into some kind of markup program (read “Microsoft Word” in the computer labs the hour before it was due) to do final formatting and print it out was a breeze. These days, I prefer a little more semantic control over the document than that which plain paragraphs of text afford, so give me a wiki syntax (I’m used to twiki, but mediawiki is starting to grow on me, since it handles nested structure pretty well) and a way to convert it into a renderable mark up. Using XHTML temps one to constantly load the document into a browser to see how it “looks”. It is defintely much easier to concentrate on the content, structure, and meaning without a bunch of GUI doodads and reload buttons begging to be clicked. I notice that in WordPress, every time after I hit “save and continue editing”, I scroll down and check out the preview. This has caught the odd mistake or two while I’m writing, but it definitely gets me out of the writing state and into the reviewing state more often than not, and this can be an expensive context switch.

writeroom apparently takes that to the next level, removing all other computer-based distractions — distractions that most likely had marketing literature claiming they would make you more efficient and productive (oh, the irony).

Interestingly enough, I find myself switching between full-screen terminal windows (or a series of tiled terminals) and GUI tools like gedit these days, because it’s hard to cut and paste a large document from vi in an xterm into an HTML textarea. And I’m not sure I want to take the plunge into a GUI based vi, since that seems to taint the purity of text editing. But vi-style keybindings in every application would be a most welcome experiment.

Rasterized Images are the New “lowsrc”

A post over on Surfin’ Safari, High DPI Web Sites, talks about using SVG, and ways that SVG could be incorporated into current site designs while still maintaining backward compatiblity. The ideas presented are good possible ways to do it, but the way subsequent CSS definitions and advanced selectors are used to “override” the rasterized image feels like a CSS hack (”If only we could find a way to ‘hide’ this problematic CSS definition from browsers that misinterpret it…”; “If only we could find a way to ‘hide’ this problematic SVG file from browsers that don’t understand it…”). While reading this, I immediately though “what about lowsrc?”.

Lowsrc was an attribute on the <img> tag that could be used to specify a smaller, and thus presumably faster downloading, version of an image. The browser would download the lowsrc image first, which was usually a 1-bit color black and white image, and display it as soon as possible. The theory was that the user could begin to “use” the page before all the images were downloaded (back in the day, when page reflow was a big deal because it was so slow, and reflow didn’t happen incrementally, and 56k dialup was the norm). Then the normal, higher resolution image would be downloaded in the background and would replace the lowsrc content after the download was complete. This wouldn’t cause reflow because the lowsrc and src images were supposed to have the same physical dimensions.

For better or for worse, people found a way around the reflow problem. Browsers began to implement incremental rendering/reflow, and computers were becoming fast enough to handle it. In addition, you could usually avoid the problem all together by giving hints to the browser as to how much screen real-estate the image was going to occupy using the “height” and “width” attributes. The page would be rendered using those dimensions, and when the image was finished downloading, it would be resized (if necessary) to fit in exactly that space. No reflow was necessary. In fact, for a long time, finding out the physical dimensions of images and putting height and width attributes on all the <img> tags was the recommended workaround to get image heavy pages to “load” faster (thus forever blurring the line between “loading” and “rendering”, but I digress).

Along with that, other changes, such as bandwidth becoming more plentiful and HTTP/1.1 support for pipelining requests, made downloading and showing a lowsrc image a less attractive workaround for slow downloading pages. Why download a image that is only going to be replaced? The 400 bytes it took to download a lowsrc image was 400 bytes that was not being used to download the real image. There may have also been a need for lowsrc when certain browsers started supporting the questionable, from a web-with-limited-bandwidth standpoint that was prevalent at the time, BMP image format.

Unfortunately, lowsrc was officially depreciated sometime around HTML4, as it appears in DOM Leve 1, but does not appear in HTML 4.0 (forgive me if this isn’t the exact timeline; nevertheless, you can find archived discussions about removing lowsrc from later drafts).

Anyway, back to SVG. SVG is the ultimate high resolution image format, since it is not bound to any specific rasterization, resolution or DPI. As such, if SVG was fully supported as an image format, allowable in the <img> tag just like PNG, JPEG, and *cough* GIF (among others), then adoption would be more painless. At first, I was thinking that perhaps the SVG image could be given as the “src” attribute, and use “lowsrc” for the non-SVG “backup” image if the browser doesn’t support SVG. Once the data is downloaded from the “src” attribute, the browser could degrade gracefully and not replace the lowsrc image if it can not figure out what to do with the SVG data. This is also congruent from an image quality standpoint: the actual source of the image is a device independent, always high resolution SVG. Except in the case of some photographic images, rasterized images are always going to be lower quality, and therefore less preferred, than SVG images. Rasterized images are the new “lowsrc”.

But since “lowsrc” is depreciated, browsers may know about it but not honor it. It was a relatively obscure attribute anyway, even more so now since excessive bandwidth has made page download times a back burner issue, even for the most obscenely large, byte-wise, pages. Even if it was fully supported, it most likely wouldn’t be on the list of recommended things to do to optimize page download times.

What may make sense is adding a “highsrc” attribute to the <img> tag, which has no historical baggage. The only kind of content allowed for “highsrc” would be an SVG document (under the assumption that no image format can be a higher resolution than SVG), and the “height” and “width” attributes would be required also (so the SVG could be properly rendered). Browsers which did not understand “highsrc” would most likely also not know how to render SVG. These browsers would continue to use the src attribute, which is still required for <img>.

Silver Orange Labs documents using SVG graphics in a largely backward compatible way by using the <object> tag. This is good, we can start using SVG earlier rather than later. The drawback to overloading the <object> tag is that the document loses some of the semantic information that comes from using the <img> tag for images; the <object> tag is generic, and rightly so. The alternative content being nested inside the <object> tag is good because it allows something more than just an image or alternative text. But this is a red herring, since so much more is possible with SVG, like interactivity and scripted changes, the alternative content can end up being so severely downgraded as to be useless. I suspect that in many cases, the SVG <object> tag will only contain a single <img> tag, and this image may be used as an ad to encourage people to use a browser that supports SVG. SVG does not need to become PNG, where, because of Microsoft’s half-baked implementation, it got little use for so long, and where it was used, complex ActiveX hacks were need to get proper display. Designers chose not to use PNGs rather than encourage users to upgrade to a more capable browser, and there was really no option to politely suggest to users that they’d have a (albeit slightly) better experience if they upgrade while still remaining function (at least not without browser capability detection on the server to rewrite <img> tags on the fly–arg!, don’t get me started on Accept headers). This may have been acceptable, because, while PNG is a superior format, it does not offer the end user much more than a GIF in the majority of use-cases.

SVG needs to be directly and fully supported as a first-class image type as part of the various HTML standards. Recognizing that it can supplant rasterized image types for most image formats used on the web should give support to making it so. Recognizing that it can also be used for so much more (and is an open and accessible standard) should show that it shouldn’t be relegated to invocation via the general purpose <object> tag.

Thundaural Jukebox 2.1

Thundaural Jukebox 2.1 has been released.

FileIO out of the archives

monksp on LambdaMOO was looking for FileIO and I realized that it was never made available after I canceled my old accounts. So there it is now, at http://thwartedefforts.org/software/fileio/.

E_MOO in-db parser docs recovered

There have been a few requests for things from E_MOO, the most recent of which is the in-database parser. I searched the archive and found the docs for E_CORE, but the only portion written was the in-db parsing.

2.0.7 Samba Auditing Patch

I’ve applied the samba auditing patch for 2.0.5 to the latest samba source, 2.0.7, and regenerated a new patch. I have not tested it (I don’t have a decent testing environment), but I don’t see any reason why it wouldn’t work. You can find it in the Samba Software section.