Phish – 6.30.2012 “Golden Age” -> “Also Sprach Zarathustra”

Posted on

A post worthy jam from this weekend. Why did I skip the first leg? DOH!!!

Alpine Valley, WI 2012-06-30 "Golden Age" -> "Also Sprach Zarathustra"

Work in Progress

Posted on

This is a new theme I’ve been tinkering with. It started out as a responsive design sandbox, but I want to develop it into a polished WP theme and eventually publish it.

If you don’t know about responsive design, drag the window to change it’s size. Magic!

Michele Bachmann gets a snarky salute from the Roots

Posted on

We already know that Jimmy Fallon has the best house band in late-night, but this takes it to another level. Last night the Roots greeted Michele Bachmann with a Fishbone song that expresses the feelings that many people share for the Republican nominee.

Don’t get it? Neither did I, but thanks to Twitter…

Continue reading

Phish – 7.1.11 “Peaches En Regalia”

Posted on

Not perfect, but Phish doesn’t have an orchestra backing them up. I think this would make Frank smile.

Trey’s sounding great this summer.

Phish – 7.1.11 "Peaches En Regalia" 

Chinese Character Count in PHP

Posted on

I just spent five hours banging my head against the wall trying to figure this out. In hopes that I can prevent someone else from suffering the same fate, I decided to share this.

Background & Issues:

Chinese characters are word symbols rather than letters. A word count is impossible because there are no spaces between words.

Instead you have to do a character count. Unfortunately using a substring (PHP: substr()) won’t work because Chinese characters are encoded in Unicode.

Keep in mind that the $content string is UTF-8 encoded. Each Chinese character is composed of multiple characters. A ten character long string is equal to only three UTF-8 Chinese characters.

$content = '有史以來最好的網站';
// In Unicode (UTF-8) this string equals '%E6%9C%89%E5%8F%B2%E4%BB%A5%E4%BE%86%E6%9C%80%E5%A5%BD%E7%9A%84%E7%B6%B2%E7%AB%99'

$excerpt = substr($content, 0, 10);
// substr() does not recognize Unicode characters, this results in broken characters at the end of the excerpt.

echo $excerpt;

The above snippet will output:

有史以�

(The black-diamond-question-mark symbol denotes a broken Unicode character.)

Continue reading

Dynamic Light App or Marty McFly’s Hand

Posted on

Dynamic LightTo be honest, I had never heard of HDR (or HDRI) until the iPhone 4 came out. It wasn’t until today that I learned that the initials stand for high-dynamic-range imaging. The only reason I know now is because of my new favorite photo app – Dynamic Light.

Since I’m learning about HDR for the first time, I’m not going to try and explain it. According to Wikipedia:

High-dynamic-range imaging (HDRI or just HDR) is a set of techniques that allow a greater dynamic range of luminance between the lightest and darkest areas of an image than current standard digital imaging techniques or photographic methods. This wide dynamic range allows HDR images to more accurately represent the range of intensity levels found in real scenes, ranging from direct sunlight to faint starlight.

Continue reading

Custom Taxonomies with WPML + My First Contribution to the WordPress Codex

Posted on

This may be a rare case, but if you call the get_terms(); function to retrieve a custom taxonomy array, and you are using the WPML (WordPress Multilingual) plugin for language translation, there is an undocumented (see below) argument that you will need to use.

If, for example, your custom taxonomy, “Birds,” has a the following terms: hummingbird, sparrow, dove, crow, parrot, hawk. You can use WPML to add Spanish translations: colibrí, gorrión, paloma, cuervo, loro, halcón. To display a list of the birds taxonomy, you would call:

$terms = get_terms('birds');

$count = count($terms);
if ($count > 0) {
    $bird_list = '<ul class="birds-list">';
    foreach ($terms as $term) {
        $bird_list .= '<li>' . $term->name . '</li>';
    }
    $bird_list .= '</ul>';
    echo $bird_list;
}

/****************************************

Regardless of which language is selected, this snippet will display:
       
    colibrí
    crow
    cuervo
    dove
    gorrión
    halcón
    hawk
    hummingbird
    loro
    paloma
    parrot
    sparrow
*/

Continue reading