Categories
Sports

Just Running

Never been much of a runner, especially for distance. However, I have recently began running with Mr. Yuk-Yuk a couple of times a week. Not sure running at night on the Atlantic City Boardwalk in frigid and windy January is the greatest time to start such a hobby, but so far it’s not too bad.

I think we ran probably 2 miles or so on our first attempt, and will continue to extend our travels based on boardwalk landmarks.

Categories
Adventure

Baltimore Aquarium

Pacific FishTook a really random road trip with the Shepherd today to the Baltimore Aquarium. We got there with no problems thanks to the GPS gods. You have to buy a ticket to get in at a certain time, so we got the 3:15 admittance and to see the dolphin show at 5:00.

Since it wasn’t anywhere near 3:15, we had plenty of time to check out the Inner Harbor. Last time I was there was probably 1991, so a lot has changed. Everything seemed pretty new and clean around the harbor. Every restaurant imaginable was there as well as an ESPN Zone and the most massive Barnes and Noble I’ve ever seen. Their bathrooms were really weak, smelled really bad.

It turned out to be quite a warm day today, so walking around outdoors in the end of December wasn’t nearly as bad as it could’ve been. There are also many historic ships to check out there too, but didn’t take any of the tours this time.

The aquarium was very cool. A little too packed at times, keep getting elbowed by people but the animals were really cool. Sharks were really cool, so was this one gigantic turtle I saw. Taking photos was tough, with the lighting and the thick glass of the tanks, but I did manage a couple of ok shots.

The dolphin show was pretty cool too. Not quite as nice as the one I saw at San Diego Sea World, but still fun to watch. After the dolphin show, the place really cleared out and we were able to go back and check out the exhibits that were a bit too busy early in the day. So that really worked out.

Categories
Video Games

Fallout 3

 Fallout 3
Been addicted to Fallout 3 for the xbox 360 recently. It’s a RPG shooter that takes place in a post apocalyptic Washington DC. It’s easily one of the finest games I’ve played in a while, probably the best game I’ve played this year.

The whole atmosphere of the game is amazing. The graphics, characters, and especially the sound really set the mood. From the eerie silence wandering the wasteland, to the various mutated beings that you encounter it’s very well done.

The control you have over the decisions your character makes throughout the story really add a unique dimension to this game. There’s so many different paths the story can go based on the actions you take.

If you own an xbox 360 or a PS3 and aren’t a little kid then this is a must play.

Categories
Adventure

Christmas 08

Celebrated Christmas with my family today. Think my trusty Canon Powershot S400 may’ve just died today, so no photos this year. I’ll have to play around with it and see if there’s anyway to salvage it, but it’s not looking too good.

We all exchanged gifts in the afternoon. Everyone seemed to enjoy what I had gotten them, so that was really cool. Here’s the stuff I got today:

So I guess now I’ll be able to surf the net anywhere, playing xbox while dining on the finest beef log money can buy with some ripped pecs. Quite a fine holiday indeed.

My brothers and some guests for some bizarre reason wanted to visit the Clara – Glenn Pet Cemetary a few streets from where we grew up. So I went along, there’s some really old tombstones there.  Spotted one as far back as 1912.

Have spent a lot of time playing Rock Band 2 and Guitar Hero World Tour today. Every time my brothers do bad, of course it’s the instruments fault not theirs. Thus far a pretty poor overall musical display.

Categories
Development

Using YUI Get Utility to consume Flickr API

I wanted to pull photos from a Flickr account onto a site. The Flickr API is awesome and there’s a ton of libraries out there for using it. Unfortunately, cURL isn’t currently installed on the server, so the PHP libraries won’t work for this case.

So I figured I’d give the YUI Get Utility a try. The Get Utility provides a mechanism for attaching script and css resources – including cross-domain resources – to the DOM after the page has loaded. And this has worked really well.

Here’s what I did:

  1. Included the following YUI scripts:
    <script src="http://yui.yahooapis.com/2.6.0/build/yahoo-dom-event/yahoo-dom-event.js" type="text/javascript"><!--mce:0--></script>
    <script src="http://yui.yahooapis.com/2.6.0/build/get/get-min.js" type="text/javascript"><!--mce:1--></script>
  2. Then fetch the Flickr feed in JSON format using the Get Utility.var
    objTransaction = YAHOO.util.Get.script(<url goes here>);

    Be sure that the Flickr REST call is set to output to JSON so that the Get Utility can consume it properly.  Append &format=json

  3. Then write a function to act on the JSON response from Flickr.  Here’s an example of taking the JSON response and outputting thumbnails of photos with links to the larger view:
    function jsonFlickrApi(rsp){ 
     
        if (rsp.stat != "ok"){
     
         alert('no data returned');
     
         return;
     
        }
     
        for (var i=0; i<rsp.photoset.photo.length; i++){
     
    		var photo = rsp.photoset.photo[i];
     
    		var container = document.getElementById('container');
    		var photosList = container.getElementsByTagName('ul');
     
    		// create elements
    		var photoItem = document.createElement('li');
     
    		var photoAnchor = document.createElement('a');
    		var photoImg = document.createElement('img');
     
    		// set attributes
    		photoAnchor.setAttribute('href', 'http://farm'+photo.farm+'.static.flickr.com/'+photo.server+'/'+photo.id+'_'+photo.secret+'_b.jpg');
    		photoImg.setAttribute('src', 'http://farm'+photo.farm+'.static.flickr.com/'+photo.server+'/'+photo.id+'_'+photo.secret+'_s.jpg');
    		photoImg.setAttribute('width', '75');
    		photoImg.setAttribute('height', '75');
    		photoImg.setAttribute('alt', photo.title);
     
    		// append to DOM
    		photoAnchor.appendChild(photoImg);
    		photoItem.appendChild(photoAnchor);
     
    		photosList[0].appendChild(photoItem); 
     
    		}
     
        }
     
        var objTransaction = YAHOO.util.Get.script("http://api.flickr.com/services/rest/?method=flickr.photosets.getPhotos&api_key=<insert_your_api_key>&photoset_id=72157594235977414+&format=json&per_page=60");

View an example

Categories
Development

Using DataSource URL with Google Visualization API and Spreadsheet

Spent a good chunk of the day figuring out how to work with the Google Visualization API DataSource URL from a Google Docs Spreadsheet.  It was a little tricky at first, but it’s not too bad once you figure it out.

First make a query of the URL using the built in Visualization API methods:

var query = new google.visualization.Query('http://spreadsheets.google.com/tq?range=&lt;your cell ranges go here&gt;&amp;headers=-1&amp;key=&lt;your URL info goes here&gt;&amp;gid=17&amp;pub=1'); 

ok, let’s break down the key variables in the URL above:

  1. tq?range=E2-G2Anything after the tq is a query written in the Google Visualization API Query Language.  It’s very similar to basic SQL.  In the case above it’s saying “Select the cells between the range of E2 to G2”.  A pretty basic selection, but you can make much more elaborate ones using the Query Language.
     
  2. &key<your URL info goes here> can be found in the URL of the spreadsheet that you’re pulling data from.
  3.  &pub=1Appending this variable with the value of 1 states that the data is public.  This is important if you want you data available to any web visitor.
You then make a call to the API using the send() function.
query_day.send(handleQueryResponse);
Then send method requires a callback function.  In this case we name it handleQueryResponse.
Below is a basic function that when called pulls a value from the spreadsheet and sets that value on a web page.
function handleQuery_dayResponse(response) {
  var data = response.getDataTable();
  var sampleText = document.getElementById('sample-text-div');
  sampleText.innerHTML = 'Enrollment  as <strong>Day ' + data.getValue(0,0) + '</strong>.';
}
This assigns the variable data with the value of the response formatted as a DataTable.  It then grabs the specific value from the DataTable, in this case there’s only one value returned so the column and row values are (0,0).  The getValue() function makes this really easy to do.

Check out a basic example.