Birthday Weekend

I am just winding down from a fairly busy weekend.

The younger brother of a couple of my high school friends got married and I went to the wedding. That turned out to be a bit awkward, unfortunately. I showed up late because I had been spending time with Kristin which probably turned out to be a good thing. I had been very good friends with the middle brother after high school, but I had put in my 0.02 cents about his then girlfriend some 13 years ago. Well, they’re married, now, and she still holds a grudge something fierce. He shook my hand, but he refused to talk to me… and that kind of hurt. I had been ready to apologize for my criticism back then, but… whatever! I did come away with the garter belt! I think the other guys in competition were a little upset that an outsider came in last second and snatched it up!

The main event for this weekend was Kristin Rene’s birthday of course! I had grand plans to make a cake from scratch and to fashion in the likeness of Dora the Explorer, but I ran out of energy after a visit, a wedding, and shopping, so I ended up buying a 1/8 sheet cake and decorating it myself. Kristin didn’t seem to mind, though. This birthday was a little subdued with everything that is going on (divorce) so the gathering had to be kept smallish. My brother, Tryg, his wife, Cara, and two sons Gunnar and Per were there, my step-mom Eileen was there, as were my friends Chris and LeNeeshia and their son, Jaiden.

Kristin liked my present most of all, I think.  I bought her a little traveling vet clinic with kennels and instruments for the ventrinarian in training who is on the go.

Life Begins to Resume

Life is starting to feel a bit more “normal” finally (although there are still a few things that need to be rectified). I am now one week past my gallbladder surgery and I am almost pain-free. I haven’t had to take any of the prescribed pain medication for 3 days, now, and I am generally feeling pretty good.

Last night I went out to see my fellow Curtis alum Kimberly Coleman and her band (with front man Matt Coughlin) play at The Swiss in downtown Tacoma; They rocked! My video here doesn’t quite do them justice so I suggest everyone goes to see them live the next time they are back in town!

Click here to see the video: http://www.facebook.com/v/96564183892

Click here to see video #2: http://www.facebook.com/v/96742433892

Today, I met up with old high school friends Jeff and Danny:

Jeff is in town for his younger brother’s wedding this weekend and Danny has moved back to Washington. I might try and work together with Danny in the near future on some business ideas! Woot!

“Bad Tech Day”

Some people have bad hair days.  I have “bad tech days” and today was one of them.

  • I fubar’d my web development environment (damn Eclipse for releasing RC code too soon!)
  • I had a check that the ATM refused to deposit (technology For the Win!)
  • The DVD player I took to a friends house last night to watch movies on had a faulty wire.
  • My media PC next to the TV refused to get on the network and when I put a wireless adapter in it, I could not find the drivers for it (Kris’ law of drivers: The network driver will ALWAYS be the one driver you can never find–you of course cannot go on-line to download it, either, since you have no connectivity!).

I can only hope that today will be a better day ;-)

Post Surgery

I went in to have my gallbladder removed on Thursday.  The surgery went a lot faster and smoother than I expected!  I opted to get out of the hospital as quickly as possible (3 hours after the operation) and emmediately had a cheeseburger!  It went all downhill from there ;-)   I was feeling great yesterday, but the cheeseburger was like a delayed kick in the gut, I think.  Ouch!  I think there was a reason why  they sent me home with a can of soup!  So tonight I attoned for my gastronomic faux pas by dining on a bowl of sliced melons and some cherries :P

Thank You

To those who ultimately decided my fate, I don’t think simply saying “Thank You” goes far enough.  I had hoped that I would be able to say more than that at the time, but such was not the case.  I invite you all to occasionally look me up on-line if you like as I tend to write about everything that goes in my life.  Feel free to contact me as well.  I am on Facebook, etc.  I would gladly have any or all of you over for coffee/tea.

Finally!

For all those who know what I mean, the long wait is finally over!  Thank God it’s over.

Star Trek Movie

Despite some reservations, I went to see the latest Star Trek movie last night with a few friends from work.  While I like sci-fi, I am by no means a die-hard “trekkie” so I have no hang-ups on continuity nor do I have any real attachment to the original TV series.  (Of all the Trek-inspired shows, I am partial to the Next Generation series with Patrick Stewart).  All of the disclaimers aside, though, I thought the movie was… pretty good.

I am not willing to call it a great movie for a few reasons:

  1. I find the original Trek series a bit cheesy and I couldn’t help but associate the younger versions of the characters with the older cast members (e.g. That guy is going to turn into William Shatner?!  Too bad for him!).
  2. It felt like I paid 10 bucks to watch a TV episode.  I get this feeling whenever I go to see a Star Trek movie, now.  Maybe this is actually a complement to the people who wrote the TV shows and a testament to how good their TV-based scripts were.  It could also be that I am starting to set my bar a bit higher as I get older.  I am starting to feel that certain concepts work well in TV format, but do not translate to good movie platforms (e.g. any long-running, serial-formats should stick to TV).
  3. I feel like the Trek franchise has now gone full circle.  The writers over the years have expanded the cast with a bunch of new characters (Next Generation, Deep Space 9, Voyager, and Enterprise) and now they have thrown us back to the beginning.  I personally like to see new material and new ideas and when Hollywood starts to “reimagine” old ideas, it makes me think they’re running short on creativity.

Anyway!  No, I am not a movie critic nor would I want to be.  I do think Star Trek is worth watching.  If you are a Trekkie, then you know there are not any related shows in production and you’ll want to see this just to see something new.  If you are not a Trekkie, then you will not notice or care about anything that I have ranted about here anyway ;-)

PHP 5.3 RC2

The latest and greatest version of the PHP language is that much closer to the “Real World” with release candidate #2. PHP 5.3 includes a number of features that I have been waiting for, namely: Namespaces and Lambda functions.

As a person coming from a C++/C#/Java background, though, I thought the idea of using backslashes (/) as a namespace delimiter a bit clumsy and awkward. Since PHP syntax is similar to other “curly brace” languages, it would have made sense to me to use either the double-colon (::) or period (.). But after actually using this new language construct in PHP, the delimiter grew on me and my code wasn’t nearly as ugly as I thought it would be.

My only real complaint, now, is that my favorite PHP editor (PHPEclipse) is lagging behind. I have had to switch to PDT 2.1.0 instead.

The New Napster

I decided I needed some new, work-inspiring music (Disturbed seems conducive to coding, it seems) for my job and I decided to purchase it through the Windows Media store.  Windows Media gave me a list of vendors to buy from, and I settled on Napster.  Now, I am not sure if my experience would have been different had I gone to their website, but for better or worse I compled my transaction through Windows Media instead.

It seemed like a pretty smooth transaction until I tried to use my debit card the next day.  It was locked.  What the heck?  I knew I had plenty of funds in my account, but all sorts of thoughts went through my head: Did something overdraft my account?  Did someone steal my identity?  As soon as I got home from work, I checked my account.  There were plenty of funds available, still.  I called my credit union.  Napster apparently tried to “activate” my card as well as charge it.  The activation process is akin to what you go through when you get a new credit or/debit card in the mail and you have to call to turn it live and  my bank saw this as fradulent acitivity :P

Just a word of warning if you happen to purchase music through Napster, I guess.

SAjax for PHP… Revamped!

I have been using SAjax 0.12 (by the folks at ModernMethod) for a couple of years now and I think it’s the greatest think since sliced bread.  SAjax allowed me to quickly learn the very exciting and helpful technology that is known as Ajax (asynchronous JavaScript and XML).  Ajax allows you to do all sorts of cool stuff (post data without a page refresh, get small HTML fragments to add to an existing document, etc).

SAjax is great, but I found that I was doing a lot of repetitive work and I wanted to simplify it even more.  This project is the result of my effort.  I have posted it on Google’s Code project for anyone who is interested in downloading it.  It can be found here.  Note: I believe this code will only work with PHP 5.2 or higher since it relies on json_encode/json_decode (although you might be able to add this via PECL).  I will be including more documentation and code examples at my leisure or if anyone wants it sooner ;-)

So what does this re-release include?  Here are some of the features:

  • Backwards compatible with Sajax.php 0.12.  I have only done basic testing to verify this, so if you encounter problems feel free to let me know.
  • New object-oriented interface via a singleton object: Sajax::Sajax()
  • Ability to export object methods to JavaScript.
  • Object-oriented JavaScript interface via the ‘sajax‘ object, e.g.: sajax.SomeMethod(cb)
  • Ability to pass DOM objects through via stubbed calls:, e.g. sajax.SomeMethod(this.form, cb)
  • Provides additional debugging information from the server side when debugging is turned on.
  • Provides interface for rendering additional JavaScript, either through externally referenced libraries or via code blocks.

Here is the obligitory implementation example:


<?php
/*
 * Demonstration of SAjax 0.14
 * Written by Kristian Oye
 * April 19th, 2009
 */
include_once("Sajax.php");

class TestClass
{
	public $ValueString = "Hello World";
	public $ValueInt = 42;

	public function GetString()
	{
		return $this->ValueString;
	}

	public function SajaxGetNumber()
	{
		return $this->ValueInt;
	}

	public function SajaxGetObject()
	{
		return $this;
	}

	public function SajaxCalculate($form, $op = 'add')
	{
		Sajax::Sajax()->AddDebugMessage("SajaxCalculate(".json_encode($form).", $op) called.");
		if($op === 'add')
			return ($form->param1 + $form->param2);
		elseif($op === 'subtract')
			return ($form->param1 - $form->param2);
		elseif($op === 'multiply')
			return ($form->param1 * $form->param2);
		elseif($op == 'divide')
			return ($form->param1 / $form->param2);
	}
}

function GetRandom()
{
	return rand(1, 100);
}

//  Create a class to handle some of our requests.
$foo = new TestClass();
$sjax = Sajax::Sajax();

//  Turn debugging on
$sjax->EnableDebug(true);

//  Export our callable methods
$sjax->Export(
	//  Export all 'Sajax' methods in TestClass
	$foo, 

	//  Export the callback to GetString in TestClass
	array($foo, 'GetString'),

	//  Simple method export
	'GetRandom',

	//  Non-existant methods
	'TestClass::GetError',
	'GetSomeError');

//  An additional script to include in our header.
$sjax->AddScriptReference('/static/example.js');

//  Handle the request if it is for AJAX or for a
//  JavaScript document, otherwise continue as normal.
$sjax->HandleRequest();

?>
<html>
	<head>
		<title>Sajax Test</title>

		<?php $sjax->ExportIncludeJS(); ?> 

		<script type="text/javascript">
		function cb_Calculate(result)
		{
			document.getElementById('CalcResult').innerHTML = result;
		}
		</script>
	</head>

<body>
<table>
<tr>
<td>Get a string:</td/>
<td colspan="2">
				<input	type="button"
						value="Go"
						onclick="sajax.GetString(function(result) { alert(result);  })" /></td>
</tr>
<tr>
<td>Get a number:</td/>
<td colspan="2">
				<input	type="button"
						value="Go"
						onclick="sajax.GetNumber(function(result) { alert(result);  })" /></td>
</tr>
<tr>
<td>Get a random:</td/>
<td colspan="2">
				<input	type="button"
						value="Go"
						onclick="sajax.GetRandom(function(result) { alert(result);  })" /></td>
</tr>
<tr>
<td>Get an object:</td/>
<td colspan="2">
				<input	type="button"
						value="Go"
						onclick="sajax.GetObject(function(result) { alert(result);  })" /></td>
</tr>
<tr>
<td>Get an ERROR:</td/>
<td colspan="2">
				<input	type="button"
						value="Go"
						onclick="sajax.GetError(function(result) { alert(result);  })" /></td>
</tr>
<tr>
<td>ANOTHER error:</td/>
<td colspan="2">
				<input	type="button"
						value="Go"
						onclick="sajax.GetSomeError(function(result) { alert(result);  })" /></td>
</tr>
<tr>
			<form action="/bogus" method="get">
<td style='vertical-align:top'>Calculate:</td>
<td style='vertical-align:top'>
					<input	type="text"
							value="0"
							id="param1"
							name="param1" /></td>
<td>
					<input	type="button"
							value=" + "
							onclick="sajax.Calculate(this.form, 'add', cb_Calculate)" />

					<input	type="button"
							value=" - "
							onclick="sajax.Calculate(this.form, 'subtract', cb_Calculate)" />
					<input	type="button"
							value=" * "
							onclick="sajax.Calculate(this.form, 'multiply', cb_Calculate)" />

					<input	type="button"
							value=" / "
							onclick="sajax.Calculate(this.form, 'divide', cb_Calculate)" /></td>
<td style='vertical-align:top'>
					<input	type="text"
							value="0"
							id="param2"
							name="param2" /> = <span id="CalcResult"></span></td>
</form></tr>
</table>
</body>
</html>

Next Page »


a

 

July 2009
M T W T F S S
« Jun    
 12345
6789101112
13141516171819
20212223242526
2728293031