Test drive higher quality YouTube videos (MP4)

Want to watch higher quality YouTube videos?

Add &fmt=18 to the last part of the URL. You won’t see DVD quality video but you’ll see a great difference from whats currently available.

Edit: Want to make it even easier? This GM script does it for you.

Setting locale to tr_TR (Turkish) lowercases class names

So I was working away at localizing some pages and for some reason they all worked except tr_TR. What was the problem? The server had an outdated installation with a bug that lowercases class names which ends a fatal error.

Why it it so? After some investigations I came across this bug and came to the conclusion that in the Turkish language, the latin i is not equal to capital latin i.

AWESOME!

JavaScript debugging on Safari for Windows

Just had to do this and thought I’d post it for anyone who might find it helpful. Here is how you enable the Debug menu if you’re running windows:

1. Navigate to the folder below (replace USERNAME with your user account).
C:\Documents and Settings\USERNAME\Application Data\Apple Computer\

2. open up Preferences.plist and add the following two lines anywhere before the line “</dict>”

<key>IncludeDebugMenu</key>
<true />

3. Restart and you should now have a Debug menu.

WTF!? preg_replace() returns null?

On one of our sites were were running into a problem when we tried to pass HTML content from a database through an email obfuscation function to prevent spiders from scraping our clients’ emails. We quickly discovered that some of the longer pages were showing up completely blank. The () function we were using to run the obfuscation code on email addresses was returning null. After some hunting I found the answer.

Read the rest of this entry »

ISO Week and Year in PHP and PostgreSQL

The new year always brings with it a few small things that go bump in the morning. 2008 was no different. Intervals started behaving oddly on New Year’s Eve morning — the default timesheet was a year behind schedule. What happened?

In our code, we are using the week number of year, as specified on the PHP date function page, but we weren’t using ISO-8601 for the year. The week number specifies the last monday of a year as the first week of the new year, if that new year begins before thursday. Intervals thought it was the first year of 2007!

In , the fix was as easy as converting all instances of date(’Y') to date(’o'), according to php.net:

ISO-8601 year number. This has the same value as Y, except that if the ISO week number (W) belongs to the previous or next year, that year is used instead. (added in 5.1.0)

That fixed everything on the side of things. But next we had to dig into the queries and get them to use the ISO Year.

Snag.

PostgreSQL 8.2.5 doesn’t support ISO Year in the Extract function. EXTRACT(ISOYEAR, timestamp) is being included in 8.3, as specified here in the RC1 documentation. But 8.3 hasn’t been released yet, and we needed to fix things immediately.

Our final fix was to instead use the TO_CHAR(timestamp, ‘IYYY’) function. It’s not ideal to be using a string formatting function for data comparisons, because it slows down some of the queries. But we had to trade some performance to get things working properly again in the new year. As soon as the PostgreSQL developers release a stable version of 8.3, we’ll change our queries back to using EXTRACT(ISOYEAR, timestamp).

Messenger bags

Check out these great messenger bags made from recycled materials, from Alchemy Goods:
http://alchemygoods.com/messenger.html

Holiday Light Exchange

Residental customers of Southern California Edison can exchange one strand of old holiday lights for a box of new, lights. LEDs use up to 98% less energy and last ten times longer, making them better for the environment and your electricity bills.

The exchange program starts today and runs through December 21st.

LOCATIONS:

  • Carpinteria City Hall: 5775 Carpinteria Ave. (805) 684-5405. Mon - Fri, 9am - 5pm
  • Goleta City Hall: 130 Cremona, Ste. B. (805) 961-7500. Mon - Thur, 7:30am - 5:30pm Fri, 8am - 1pm
  • Santa Barbara: Westside Community Center: 423 W. Victoria St. (805) 963-7567. Mon - Fri, 9am - 5pm
  • Franklin Neighborhood Center: 1136 E. Montecito St. (805) 963-7605. Mon - Fri, 9am - 5pm
  • Central Library: 40 E. Anapamu St. (805) 564-5601. Mon - Thurs, 10am - 9pm; Fri, Sat, 10am - 5:30pm; Sun, 1 - 5pm
  • Community Environmental Council: 26 W. Anapamu St, 2nd Floor. (805) 963-0583 x105. Mon - Fri, 9am - 6pm

Internet Explorer 7 and pirated versions of Windows XP

Is Microsoft quietly phasing out IE6? I think could mean the beginning of the end for IE6 installs and support.

Internet Explorer 7 now available for pirated version of Windows XP

Funky Bike Ride and Ginger Ninjas Concert

November 24, Funky Bike Ride and Ginger Ninjas Concert, sponsored by Santa Barbara Bici Centro. The free bike ride is at 5:00 PM, starting from La Casa de la Raza, 601 East Montecito Street, . Then from 6:00-11:00 PM, the “Pleasant Revolution” featuring the Ginger Ninjas, Oso, and Shake your Peace will rock out to a bicycle-powered 800 watt PA system. Intermixed will be fun bike contests, raffles, food and overall merryment. Proceeds will benefit Bici Centro.

Web Standards Map

I just found this through one of the mailing lists I subscribe to. It’s a map that covers technologies on the web. It mentions Mordorsoft and Google’s All Seeing Eye, it’s worth checking out:

http://www.flickr.com/photos/psd/1805709102/
http://www.flickr.com/photos/psd/sets/72157602805227511/
http://www.archive.org/details/TheWebIsAgreement

PDF
http://www.archive.org/download/TheWebIsAgreement/web.PDF