Posts from: 2008 (page 2)

12 Sep 2008

flock() blocking reads

(Sigh.) After applying recent upgrades to our Red Hat 5 server at work, suddenly PHP file locking blocks the script execution for exactly 30 seconds! Both a shared reading lock (LOCK_SH) and exclusive writing lock (LOCK_EX) do this. This was, shall we say, unpleasant to diagnose. Since we use Cache_Lite (which locks by default) to

[...read the post]
10 Sep 2008

Javascript humor

hasthelargehadroncolliderdestroyedtheworldyet.com has a news feed. It also has this in the source: if (!(typeof worldHasEnded == “undefined”)) { document.write(“YUP.”); } else { document.write(“NOPE.”); } Folks without Javascript get a more definite answer: <noscript>NOPE.</noscript> Also appreciated: <!– if the lhc actually destroys the earth & this page isn’t yet updated please email mike@frantic.org to receive a

[...read the post]
9 Sep 2008

uTag: like snurl, but crappy!

A SitePoint blogger recently wrote about uTag. Like my favorite, snurl, it’s one of many make-a-shorter-link URL redirect services, but with a 90′s twist! When you click on these, instead of getting a page, you get a frameset with ads on top, broken addressbar usability, and, if you know how uTag works, the warm fuzzies

[...read the post]
6 Sep 2008

Case of the NS_ERROR_DOM_SECURITY_ERR

Working on a bookmarklet, I ran across “security errors” in Firefox and Opera (may happen in others, I didn’t check). In Firefox the code threw “Security error (NS_ERROR_DOM_SECURITY_ERR)” and in Opera it was something similarly vague. The culprit code was trying to access the cssRules property of a style sheet from a different domain (my

[...read the post]
29 Aug 2008

Thanks, Recuva

Recuva is a drop-dead simple Windows file recovery program [aside 1] that just saved me two hours of work. I was trying to reorganize some directories and ended up deleting two freshly written PHP files [2]. I’ve used about a half-dozen file recovery apps over the years due to my affliction [3], but Recuva was

[...read the post]
24 Jul 2008

Multibyte Input Bookmarklet

All modern web applications should be using UTF-8 encoding. For developers with English keyboards (where all keys produce 7-bit ASCII), testing web forms with multibyte characters can be a pain. You can, of course, enter Unicode characters via obscure key combinations, but using this bookmarklet may be easier: Get it You must enable Javascript! (right-click,

[...read the post]
13 Jun 2008

Physics engine in Sketchup

I knew Sketchup was a great modeling tool, but apparently it’s also scriptable via a Ruby API and embedded web browser. At Google’s IO conference, Scott Lininger showed off some of this awesomeness. 20 min into the video below we see Scott capturing keystroke events within the browser instance and using them to control a

[...read the post]
3 Jun 2008

Pre-encoding vs. mod_deflate

Recently I configured Apache to serve pre-encoded files with encoding-negotiation. In theory this should be faster than using mod_deflate, which has to re-encode every hit, but testing was in order. My mod_deflate setup consisted of a directory with this .htaccess: AddOutputFilterByType DEFLATE application/x-javascript BrowserMatch \bMSIE\s[456] no-gzip BrowserMatch \b(SV1|Opera)\b !no-gzip and a pre-minified version of jquery-1.2.3

[...read the post]
26 May 2008

Chili enzyme for .htaccess

Here’s a chili (javascript syntax highlighter) enzyme for highlighting .htaccess code snippets. This is for the 1.x series (I’m using 1.8b here) so this will likely not work for the latest 2.0 release without some modification. Also the highlighting is pretty basic, but at least you get comments and the first directive on a line.

[...read the post]
25 May 2008

Apache HTTP encoding negotiation notes

Now that Minify 2 is out, I’ve been thinking of expanding the project to take on the not-straightforward task of serving already HTTP encoded files on Apache and allowing Apache to negotiate the encoding version; taking CGI out of the picture would be the natural next step toward serving these files as efficiently as possible.

[...read the post]
29 Apr 2008

Brittle Stars @ Pop Mayhem, Thursday, May 8

6500 miles can’t stop the rock. Thursday, May 8th, a reunited Brittle Stars play Common Grounds as a part of Gainesville’s Pop Mayhem festival. Hear songs such as, but not performed as well as, these: Falling Backwards Someplace (but not this place) This Trip So Unfair Also that night: Ifwhen, the Buddy System, Giddy-Up Helicopter,

[...read the post]
27 Apr 2008

Still waiting on Opera

A whole six months after beta 1′s release, 9.5 beta 2 is finally out. At work I installed it over beta 1 and it works like a charm; the issues I was waiting on seem to have been fixed. At home it’s a different story. I installed over beta 1 and the result was unusable.

[...read the post]
27 Mar 2008

Minifying Javascript and CSS on mrclay.org

Update: Please read the new version of this article. It covers Minify 2.1, which is much easier to use. Minify v2 is coming along, but it’s time to start getting some real-world testing, so last night I started serving this site’s Javascript and CSS (at least the 6 files in my WordPress templates) via a

[...read the post]
21 Mar 2008

Polyphonic pitch adjustment is born

Aside from the horrors of Auto-tune, the tool changed the state-of-the-art dealing with monophonic sound. Well, competitor product Melodyne will soon be able to apply pitch adjustment to polyphonic sound. This is huge. Huge. The amazing video shows this advance and a taste of the amazing power this will bring to recordists. About 2/3rds way

[...read the post]
11 Mar 2008

Music is killing music

I’d never claim file sharing doesn’t hurt music sales, but there’s another simple reason why individual music releases will continue to sell more poorly over time: The continuous explosion of choice. Even if listeners spent as much on music as they did years ago, the chances of us buying the same releases drops constantly as

[...read the post]
11 Mar 2008

Opera intermission

I’m a long-time Opera fan and flagwaver, but the pain of bugs in 9.5 beta finally forced me to switch to Firefox last week. I’ve been using 9.5 beta1 since the end of October. When do we get a new one? I see the weekly builds, but they’re all alphas (no thanks). The biggest problems

[...read the post]
5 Mar 2008

New Minify version in the works

Back in August I came across Ryan Grove‘s great Minify project, which is essentially a PHP client-optimizing file server for Javascript and CSS. I was in the design stage of a project with similar goals so I decided to try merging the two projects. Ryan thought the result had potential to be the base of

[...read the post]
22 Feb 2008

Marriage Rock I

Yeah, we did it. I was in charge of the music and spent most hours from weeks before up until the morning of with my head stuck inside MediaMonkey. I can’t say enough good things about the “Gold” version, but these posts will shockingly not be about the boring machinations of software. Look For Me

[...read the post]
16 Jan 2008

Distance and bearings between GPS coordinates in SQL

Another post from my sql abominations series. I’m running this on MySQL 5 particularly. Assume you have a table of locations with Latitude and Longitude for each one. In my case the table is “station”, primary key being “LocID”. With help from this article, first we create a view to get 3D coordinates (6378 =

[...read the post]