Archive for November, 2009

This week on twitter – 2009-11-29

  • It feels great to be back at my house. I loved Phoenix and had a wonderful Thanksgiving, but I missed my home and my cat. #
  • My last day in Phoenix. It'll be good to get back home #
  • I just found the motherlode of craft beers. Will and Dan will be happy with my take. #
  • As expected, everyone who bet at the races lost money. #
  • I'm at the turf Paradise horse race track. I wont gamble, though. I come from a city funded by gambling losses, afterall. #
  • Just played disc golf. Very fun. I didn't do well, but that was partially due to all the people near the course that I was afraid to hit. #
  • Going disc golfing today with my brother. Any tips, @discdev? #
  • I'm in Phoenix until Saturday. I surprised my family by showing up when they thought I was skipping this year. #

Powered by Twitter Tools

No Comments

This week on twitter – 2009-11-22

  • These new climbing shoes fit so much better than the old ones. I just wish I wasn't already burned out from yesterday #
  • Just got new climbing shoes. They even let me return my old ones after 7 months. I love being an REI member. #
  • Watching Raging Bull. I didn't know it is in black and white #
  • My one big Droid complaint is the way the contact editing is done #
  • best comment of the year: "The color of a beer is really no indication on how it will taste." http://bit.ly/beercolor #
  • I haven't been sleeping well lately. I'm glad I have a weekend to catch back up #
  • The Droid makes everything better, even waiting in line at a drive through. #
  • The podcast is done. Next time I want to tweet during the podcast with odd thoughts that go through my head. #
  • Getting ready to record the podcast. #
  • I finally got my shaman's inscription up to where it should be. Also, he past my paladin to become my new main. #
  • I love reading conservapedia.com; it truly is the train wreck that keeps on giving. #
  • The cherry stout that I brewed six weeks ago is ready, but I don't like how it came out at all. It tastes like medicine. #

Powered by Twitter Tools

No Comments

Ratchet and Clank Future: A Crack in Time – First Impressions

Ratchet and Clank: A Crack in Time is the newest entry in the Ratchet and Clank series, which has been around since 2002′s Ratchet and Clank. The series had a rough first entry, in my opinion, caused purely by the lack of a strafe button which made the controls more awkward than needed. The 2003 follow up Ratchet and Clank: Going Commando vastly improved on the series, but 2004′s Ratchet and Clank: Up Your Arsenal was when the game became perfect. The controls were the epitome of smooth, precise and intuitive, the humor was incredibly well done and the game’s pacing was spot on.  When the series made the jump to the PS3, I took a hiatus due to my lack of a PS3, but I have picked the game up again with Ratchet and Clank Future: Tools of Destruction, and I must say I am a bit disappointed, although the game does seem quite good.

Up Your Arsenal used a control scheme that I found to be perfect. The left stick moved Ratchet, the right stick aimed, one shoulder button fired and one shoulder button jumped. Frenetic combat was incredibly smooth due to this system that allowed you to never move your fingers off of a stick or button. You didn’t have to move your thumb off of the aim stick to jump or fire. A Crack in Time appears to have done away with this system, and instead used a more standard system where you can shoot with R1, but Circle is used to jump. While this leaves it as a purely normal system, I’m disappointed
with the removal of what I consider to be the finest control scheme ever implemented in a game.

On other issues, the game carries the torch of the old series just fine. The humor is intact, the characters are likable, the explosions are intense and the action is chaotic. It feels very much like the old game series I came to love. At the moment, I’ve only seen old, familiar characters – Ratchet, Clank, Quark and Dr. Nefarious (plus his hilarious butler Lawrence), so I am excited to progress through the game and see new characters that were not in Up Your Arsenal (the most recent Ratchet game I have played).

At this stage in the game, I am liking what I see, but I do think they took a step back on the controls front. I hope they left the weapon upgrade system in place (or improved upon it), but at the moment, I haven’t upgraded any of my weapons. I don’t think this game will top Uncharted 2: Among Thieves for my PS3 Game of the Year, but it can give it a good challenge.

, ,

No Comments

This week on twitter – 2009-11-15

  • It's actually pretty odd not hearing that noise coming from my wheels when I turn or brake. At least I have my car back. #
  • The mechanic called – my brakes are in bad shape. I need new pads and new rotors. I'm not surprised. I deserve this for ignoring it so long. #
  • My car is at a mechanic. I feel so weird not having a car, even if I wouldn't be driving anywhere anytime soon. #
  • Looks like my procrastination has fucked me once again. I really should've had my car looked at a long time ago about the sounds I hear. #
  • The mash tun is now complete according to my dad's standards – 3 trips to the hardware store and it has drawn blood. Project complete. #
  • I have a few wave invites available. Anyone want one? #
  • Since Google Wave gadgets heavily rely on XML, I think now is a good time to use DOMi to build them dynamically. #
  • I figured out how to embed wave, but there are a few limitations that make it impractical for the blog at the moment. Someday, though. #
  • I got a Google wave invite today. I'm going to figure out how to embed Wave into my blog tonight. All posts from then on will be waves. #
  • Oh God. Another dead cat. What is wrong with Ft. Apache? #
  • This is today's article on why I hate patents – http://bit.ly/3ZgIsa #
  • My phone is always sad. I'll explain later. #
  • My day started off shitty – dead cat in the road on my drive to work. It looked like my cat, too. =( #
  • mash tun is mostly done. i've got the manifold and valve finished and installed and all i have left to do is build and mount the sprinkler. #

Powered by Twitter Tools

No Comments

How does Facebook order the timeline?

I’ve been on Facebook for most of this year, and the one thing I really don’t understand is how the timeline is set up. It appears to be almost random with the post order. Take a look at the screenshot of my facebook profile to see what I mean.

There is no coherent order to this

There is no coherent order to this

No Comments

Testing Google Wave

I received a Google Wave invite today and am having fun with it. I plan to migrate my blog to an entire Wave based system, where each post is a unique Wave, with comments and edits happening fluidly throughout the body.

I am using the Wavr WordPress plugin to embed waves, and I will either assist this plugin, another plugin or create my own to get my posts automatically converted into Waves.

Update: I have been told that the Wave is only visible to Wave users. That is quite unfortunate. I hope to find a way to make it visible to anyone, since I need it visible to all in order to be a viable blogging software.

[wave id="googlewave.com!w%252BVvt07HpxQ" bgcolor="#ffffff" color="#000000"]

No Comments

This week on twitter – 2009-11-08

  • I now have all the parts for my mash tun plus a large brewpot and burner. #
  • I need google voice… anyone have an invite? #
  • i really love this new phone. #
  • Motorola Droid get! Awesome phone. I'm glad to finally not have that god forsaken LG Chocolate. #
  • I can't get this song out of my head – http://companyofthieves.net/oscarwilde/. Great song, great album. #
  • Droid just keeps looking better and better. I am definitely getting one within the next few months. #
  • It's official – I love Kohana. This is a truly slick system. #
  • Great. I woke up to do some work stuff and my internet is down. Looks like i'm getting to work really early today. #
  • Bluehost FTP is atrocious. It took me 6 tries and about 10 minutes to transfer 29 images (149kb total). #
  • I think I know enough about Kohana now to get going on our work project with it. It should be quite fun. #

Powered by Twitter Tools

No Comments

mysql_insert_id and insert ignore

While working on some code recently, I realized that mysql_insert_id fails when using insert ignore. When using insert, mysql_insert_id returns the primary key of the newly inserted row. However, nothing is returned with insert ignore if a key conflict prevents a record from being inserted. If you are wanting to get the key that a conflict was just hit against, in as dynamic of a way as possible, you can use this script to find the primary key when insert ignore does not enter a record. This is useful if you are setting up a many-to-many pivot table and don’t want duplicate data on either side. When you attempt to insert a new record, it either gives you the new key or the key of the one that already existed.

$db->query($sql)

// if an insert id exists, use it
if ($db->insert_id != 0) {
    $id = $db->insert_id;
// if there is no insert id and there was no error and insert ignore was ued
} elseif($db->insert_id == 0 &&
    empty($db->error) &&
    preg_match('/^\s*insert\s+ignore/si', $sql)) {

    // find the table that was queried
    preg_match('/^\s*insert\s+ignore\s+into\s+([-`a-zA-Z0-9_]+)/si', $sql, $extract);
    $table = trim($extract[1], '`');

    // change insert ignore  to insert
    $Sql = preg_replace('/^\s*insert\s+ignore/si', 'insert', $sql);

    // query and scan the error for the key conflict
    $db->query($sql);
    $error = $db->error;
    preg_match('/^Duplicate entry \'(.*)\' for key (\d+)$/', $error, $extract);

    $value = $extract[1];
    $key = $extract[2];

    // in the case of multi column keys, figure out what the keys actually are
    if(strstr($value, '-') && !strstr($sql, $value)) {
        $values = explode('-', $value);
        $finished = false;
        while(!$finished) {
            foreach($values as $k=>&$v) {
                if(strstr($Sql, $v.'-'.$values[$k+1])) {
                    $values[$k] = $v.'-'.$values[$k+1];
                    unset($values[$k+1]);
                    $values = array_values($values);
                    break;
                }
                $finished = true;
            }
        }
        $value = $values;
    }

    // look up all keys on the table, isolating the primary key
    $keySql = "show keys from `$table`";
    $keyResult = $db->query($keySql);
    $keys = array();
    while($row = $keyResult->fetch_assoc()) {
        if(strtolower($row['Key_name']) == 'primary') {
            $primary = $row['Column_name'];
        }
        $keys[$row['Key_name']][] = $row;
    }

    // build a where clause to find the primary based on key conflicts
    $keys = array_values($keys);
    if(!is_array($keys[$key-1])) {
        $unique = $keys[$key-1]['Column_name'];
        $where = "`$unique` = '".$db->real_escape_string($value)."'";
    } else {
        foreach($keys[$key-1] as $key) {
            $whereParts[] = "`{$key['Column_name']}` = '".$db->real_escape_string($value[$key['Seq_in_index']-1])."'";
        }
        $where = implode(' and ', $whereParts);
    }

    // get the primary key that conflicted with the insert
    $sql = "select `$primary` from `$table` where $where";
    if(is_object($result)) {
        $result = $result->fetch_assoc();
        $id = $result[$primary];
    }
}

echo $id;

, ,

No Comments

This week on twitter – 2009-11-01

  • my favorite part of halloween – dressing up at work as a programmer who works somewhere that doesnt' have a dress code. #
  • my girlfriend is awesome. just sayin. #
  • For anyone who is even slightly interested in Team Fortress 2 (awesome game), it is $2.49 on Steam until 2:00 PM PDT. #
  • While rearranging some stuff in the break room to get a better seating area for lunch, an unknown white powder fell all over me. Anthrax? #
  • pastebin.com is awesome. just sayin. #
  • my office needs a 'Days since last development standards change' sign. i shall find one. we can't go more than 2 months without changing. #
  • It looks like NDOT is finally widening Durango between Hacienda and 215. That project is long overdue. #
  • I will never get tired of this clip – http://bit.ly/tAjMT #

Powered by Twitter Tools

No Comments