Blog

  • War Torn Families

    I have a hard time imagining being separated from my family for a full 8 hours of the day. I can’t imagine being separated for two or more years! I feel bad for our soliders.

  • Politically Aware

    Know your representative? You should!

  • Of Grasshoppers

    Student: Will I ever get out of this hole?
    Master: You cannot climb with a shovel in your hands.

  • Progress!

    Finally! A foothold! I might start working out of this hole!

  • Oh I Wish I Had Money! – Great WOOT!

    Woot has a launch event today. That means they are the very first to be selling a product (via special arrangements). Today’s woot is a Vivitar 8.1MP Compact Digital Camera with 2.5-in. LCD for $299.99 plus $5 shipping. Ultra thin and dandy. If I could I’d buy 3 and tuck two away for Christmas presents.

    Of course, at 8.1MP you need to give them a new harddrive also!

  • Seeking Juggling Partner – No skills required

    When I posted that I’m seeking a juggling partner in or near Knoxville (that sounds like a personals ad) I should have added that you don’t have to be all that good. Most people would say, "I’m not that good" or "I’m not good enough" and it makes me wonder what scale they are measuring themselves against.

    I just need someone willing to commit to a little time. I had piano lessons for 4 years and once I showed up for my lesson and the teacher asked, "Did you practice?" to which I replied, "no." The instructor frowned, closed the cover over the keys, and said, "so what do you want to talk about?" The message was clear and left a lasting impression. So, I don’t need someone good. I just need someone willing.

    The goal will be to do some passing for an audience near the end of the month. I promise you’ll have a blast. No. This is not a paid gig.

    ps. Bonus if you look good in a sequined bikini! Oh no no.. That would be a magician’s assistant instead of a juggling partner.

  • Technical hurdle

    Finally, my SME Server is working with RH Linux, Apache, Php, and MySQL. Which technically is a LAMP setup since acronyms seem to be all the rag today. Figuring out how to grant privileges on MySQL 3.23.x so that I could use SQLYog (SQL Query Analyzer for MySQL) from my PC was a pain but its working now. I look forward to upgrading to MySQL 4.1. Right now I just want to get back to coding.

  • Hiking in the woods

    Molly says something lives here. About the size of my head

  • Seeking Juggling Partner

    If you are in the Knoxville area and willing to commit to at least an hour’s practice a week, I’m looking for a juggling partner. You don’t have to "be good," just committed. (Interpret that as you may). I also have a juggling show near the end of this month that I’d like to entice someone to do some routines with me.

  • Oops. Server down?

    Here’s a good reason to never put passwords in source code. Apparently Yahoo’s php server was down today. On the other hand, some commenting would be better than what is shown here. Next post: The ethics of posting other peoples code.

    define('COOKIE_DOMAIN', 'www.yahoo.com');
    define('PIXEL_WIDTH', '145');

    $linkviews = array();

    function track_linkview ($link) {
    global $linkviews;
    array_push($linkviews, $link);
    }

    function log_linkviews () {
    global $linkviews;
    if (count($linkviews)) {
    yahoo_track_page_params(array('link' => join("\002", $linkviews)));
    }
    }

    function quote ($str) {
    return preg_replace('/([\\\"\'])/', '\\\$1', $str);
    }

    function js_start () {
    print "<script language=\"javascript\" type=\"text/javascript\">\n";
    print "d=document;\n";
    print "d.domain='yahoo.com';\n";
    print "p=parent.document;\n";
    print "lc=p.getElementById('lc');\n"; // weather content
    print "ca=p.getElementById('ca');\n"; // change location link
    print "cl=p.getElementById('cl');\n"; // change location
    print "wt=p.getElementById('wt');\n"; // module title
    print "wa=p.getElementById('wa');\n"; // alert
    print "wg=p.getElementById('wg');\n"; // weather message
    }

    function js_end () {
    print "</script>\n";
    }

    function js_set ($key, $value) {
    return "$key=\"" . quote($value) . "\";\n";
    }

    function weather_result ($label, $url, $cond) {
    $rd = $label == 'Today' ? 'r/w3' : 'r/w5';
    $lo = $cond["lo"];
    $hi = $cond["hi"];
    $sky = $cond["sky"];
    $fc = $cond["forecast"];
    $result = "<a href=\"$rd/*$url\"><b>$label</b></a>";
    $result .= "<img src=$sky alt=\"$fc\">";
    $result .= "$fc<br>";
    $result .= "hi <span class=hi>$hi°<span class=sc>F</span></span> - ";
    $result .= "lo <span class=lo>$lo°<span class=sc>F</span></span>";
    track_linkview($rd);
    return $result;
    }

    function show_results ($city_state, $weather) {
    $url = $weather->url;
    $today = weather_result("Today", $url, $weather->today);
    $tomorrow = weather_result("Tomorrow", $url, $weather->tomorrow);
    $xfc =
    "<span class=mr>" .
    "<a href=\"r/w7/*$url\"><b>»</b> Extended Weather Forecast</a>" .
    "</span>";

    print js_set("wt.innerHTML",
    htmlentities(fp_limit_location($city_state, PIXEL_WIDTH)));
    print js_set("wt.href", "r/wt/*$url");
    print js_set("ca.style.display", "inline");
    print js_set("ca.className", "");
    print js_set("lc.innerHTML",
    "<div class=b>$today</div>" .
    "<div class=b>$tomorrow</div>" .
    $xfc);
    //print "wt.focus();wt.blur();parent.clo=0;\n";
    print "parent.clo=0;\n";

    // U.S. location for local search, disabled
    if (0 && preg_match('/\b\w{2}$/', $city_state)) {
    print js_set("parent._wcs", $city_state);
    print "if (p.sf1.csz) " . js_set("p.sf1.csz.value", $city_state);
    }

    yahoo_track_page_params(array("wrs" => $weather->id));
    track_linkview("r/w7");
    }

    function show_error ($status) {
    $code = "error";
    if (!is_null($status)) {
    $code .= ":$status";
    }
    print js_set("wa.innerHTML",
    "<strong>Your search produced no matches.</strong><br>".
    "Please re-enter a City or U.S. Zip Code:");
    print js_set("wg.style.display", "none");
    print js_set("wa.style.display", "block");
    yahoo_track_page_params(array("wrs" => $code));
    }

    function show_picklist ($list) {
    $ccc_file = "/home/y/share/htdocs/includes/weather/ccc2full.cdb";
    $ccc_map = dba_open($ccc_file, "r-", "cdb");
    $choices = "";
    ## re-order USA first
    if (array_key_exists('USA', $list)) {
    $newlist = array();
    $newlist['USA'] = $list['USA'];
    foreach ($list as $ccc => $region) {
    $newlist[$ccc] = $region;
    }
    $list = $newlist;
    }
    foreach ($list as $ccc => $region) {
    $country = $ccc;
    if ($ccc_map !== FALSE &&
    ($full = dba_fetch($ccc, $ccc_map)) !== FALSE) {
    $country = $full;
    }
    $choices .= "<div>$country</div>";
    foreach ($region as $loc) {
    list($id, $cs) = $loc;
    $param = quote($id);
    $choices .= "<a href=\"javascript:parent.zp('$param');\">$cs</a>";
    }
    }
    if ($ccc_map !== FALSE) {
    dba_close($ccc_map);
    }
    print js_set("wa.innerHTML",
    "<span>" .
    "<strong>Your search matched multiple cities.</strong><br>" .
    "Please select the appropriate location below:" .
    "</span>" .
    "<span id=ls class=wil>" .
    $choices .
    "</span>");
    print js_set("wg.style.display", "block");
    print js_set("wa.style.display", "block");
    yahoo_track_page_params(array("wrs" => "picklist"));
    }

    function retry_validate_location ($lm, $csz, $limit) {
    $attempt = 0;

    do {
    if ($attempt) usleep(500000); // 0.5 seconds
    $attempt++;
    $return = $lm->validatelocation($csz, 1);
    } while ($return[0] == '-5' and $attempt < $limit);

    if ($return[0] != 1 and $return[0] != -1 and $return[0] != -2) {
    error_log("validatelocation($csz) failed: $return[0]");
    }

    return $return;
    }

    function find_location ($lm, $wtr, $csz) {
    $attempts = 3;
    $return = retry_validate_location($lm, $csz, $attempts);
    $results = array();

    if (($return[0] == -2 or $return[0] >= 0) &&
    array_key_exists('geolist', $return)) {
    foreach ($return['geolist'] as $location) {
    if ($wtr->load($location)) {
    array_push($results, $location);
    }
    else {
    error_log("no weather data for: " . fp_city_state($location));
    }
    }
    }

    return $results;
    }

    function set_weather_cookie ($value) {
    $expire = time() + 90 * 86400;
    setcookie(WEATHER_COOKIE, $value, $expire, "/", COOKIE_DOMAIN, 0);
    }

    function clear_weather_cookie () {
    setcookie(WEATHER_COOKIE, "", 0, "/", COOKIE_DOMAIN, 0);
    }

    ## main ()

    $v = $_GET;
    $location = new yahoo_location_manager();
    $weather = new YahooFrontpageWeather(array('pixel_width' => PIXEL_WIDTH));

    ## /yahoo/site/main/weather (non-frontpage traffic)
    yadl_spaceid('P#97167465');
    yahoo_track_page_params(array('PL' =>
    yahoo_full_cookie('PL') === FALSE ? 0 : 1));

    if (array_key_exists('test', $v)) {
    $version = 'v' . yahoo_get_data(YIV_GET, 'test');
    yahoo_track_page_params(array('test' => $version));
    }

    if (array_key_exists('wl', $v)) {
    $pixel = 'http://us.i1.yimg.com/us.yimg.com/i/space.gif';
    $wlocid = yahoo_get_data(YIV_GET, 'wl');

    if ($weather->load($wlocid)) {
    set_weather_cookie($wlocid);
    }

    header("Location: $pixel");
    }
    else if (array_key_exists('p', $v) and
    (($csz =
    yahoo_get_data(YIV_GET, 'p', YIV_FILTER_UNSAFE_RAW)) != '')) {
    $results = find_location($location, $weather, $csz);

    ## invalid location
    if (count($results) == 0) {
    if ($csz == 'delete') {
    // clear weather cookie
    if (yahoo_full_cookie(WEATHER_COOKIE) !== FALSE) {
    clear_weather_cookie();
    }
    // clear location manager cookie
    if (yahoo_full_cookie('PL') != FALSE) {
    setcookie('PL', '', 0, '/', ".yahoo.com");
    }
    }
    js_start();
    show_error('l');
    js_end();
    }
    ## single result
    else if (count($results) == 1) {
    $loc = $results[0];
    $cs = fp_city_state($loc);
    $id = $loc['uniqueId'];

    if ($weather->load($loc)) {
    if (array_key_exists('sv', $v) && $v['sv'] == 'on') {
    // clear weather cookie
    if (yahoo_full_cookie(WEATHER_COOKIE) !== FALSE) {
    clear_weather_cookie();
    }

    // clear PL older cookie scoped on www.yahoo.com
    if (yahoo_cookie_part('PL', 'V') == '1.0') {
    setcookie('PL', '', 0, '/', COOKIE_DOMAIN);
    }

    $return = $location->setLocation($id, "weather", 1);
    if ($return[0] != 1) {
    error_log("setLocation($id) failed: $return[0]");
    }

    yahoo_track_page_params(array('wsv' => 1));
    }

    if ($cs == '') {
    $cs = $weather->location;
    }

    js_start();
    show_results($cs, $weather);
    js_end();
    }
    else {
    js_start();
    show_error('w');
    js_end();
    }
    }
    ## pick list
    else {
    $list = array();

    // group by country
    foreach ($results as $loc) {
    $cs = fp_city_state($loc);
    $id = $loc['uniqueId'];
    $ccc = $loc['country'];
    $item = array($id, $cs);

    if (array_key_exists($ccc, $list)) {
    array_push($list[$ccc], $item);
    }
    else {
    $list[$ccc] = array($item);
    }
    }

    js_start();
    if (count($list) == 0) {
    show_error('pl');
    }
    else {
    show_picklist($list);
    }
    js_end();
    }
    }
    ## initial pageview
    else {
    $loc = fp_get_weather_location();

    if ($loc !== FALSE) {
    $cs = fp_city_state($loc);

    if ($weather->load($loc)) {
    if ($cs == '') {
    $cs = $weather->location;
    }
    js_start();
    show_results($cs, $weather);
    js_end();
    }
    }
    }

    log_linkviews();

    ?>

  • Streeettch

    Oh I want the luxury of exercise!

  • New Orleans Buses On The Move

    For those still following the New Orleans flooding, here is some interesting photographic evidence along with explanation of buses evacuating people.

  • Ipod Nano 200gb Upgrade – DIY

    For you Ipod enthusiasts that just want more space, instructions are now online to explain how to upgrade your Ipod Nano to 200gb for 150,000 minutes of music! If you don’t read all the instructions at least scroll to the very bottom for the results.