Categories
Development

Closure Compiler

I’ve been using minimizing tools on my Javascript files for quite some time now. Most notably YUI Compressor, and it does an awesome job for me. Excellent job minimizing Javascript as well as CSS files.

Recently I’ve give Closure Compiler a try at Javascript compression and have been pleased with the results so far. It not only minimizes and obfuscates files, but also compiles them as well.

The rewritten code it spits out is not suitable for human reading, so be sure you always keep an original of the source to be modified. I have typically been saving 24% off the original file size. That’s typically 2x the compression I’d get if I simply gzipped the file.

Very cool tool, try it out.

Categories
Video Games

Dragon Quest IX Sentinels of the Starry Skies

Dragon Quest IXPicked up Dragon Quest IX a few weeks ago at Toys R Us, they had a fine deal where you got a $15 gift card with the purchase of the game. I was very proud of the fine deal I had gotten. I always was a fan of the JRPG since I played the first Dragon Warrior (Dragon Quest series was called Dragon Warrior in the US) back in 1989 for the NES.

The mechanics and gameplay were what would be expected in such a game. It did make really cool use of multiplayer with up to 4 simultaneous players using Nintendo DS’s. This was really well done and it’s a shame I really didn’t play it on multiplayer much, as you could tell that the game was really meant to take advantage of multiplayer. If I were in 5th grade multiplayer wouldn’t been a must.

The graphics and sound were very impressive for a DS game, some of the finest I have played. Story was pretty solid too, and actually funny at times. I did get a little chuckle a few times. Between the main storyline and all the side quests there is much gameplay to be had with this title.

Categories
Development

Took care of pesky Smart Quotes with utf8_encode()

For the longest time I’ve had our writers at work who always copy from Word docs with Smart Quotes have our RSS feed balk when it encountered the Smart Quotes. I took many stabs attempting to replace them with standard quotes to no avail. It was one of those problems where I never really devoted a great deal of time at solving as it didn’t occur often enough to take me completely away from whatever issue I was then working on.

I just realized that the PHP utf8_encode() function which encodes an ISO-8859-1 string to UTF-8 does just that. Just a simple little function that’s been around a very long time was there just and I had overlooked it.

Now I just apply that function before outputting the data and so far so good. Just figured I’d share if someone else was running into this same issue.

Categories
Development

Automatic WordPress Backup

I just downloaded and installed the very cool Automatic WordPress Backup plugin. It automatically backups your WordPress blog to the Amazon S3 service. Since I already have an S3 account (which is awesome too by the way), this was an ideal solution for me.

Downloaded, install and setup took no more that 5 minutes tops. Not only was this incredibly easy to setup and manage, but it’s great to have backups not on the same server as my host or kept locally either. The only potential drawback would be that your host must be a Linux server, but this of course is not a problem for me.

If you have WordPress blog and an Amazon S3 account then this is most highly recommended.

Categories
Design

Building a Lego Sculpture Tips

I’ve recently completed a life size Lego sculpture of a Jack Russell Terrier as well as the head of a capybara. Using Legos as a creative platform has turned out to be even more fun than I anticipated it would be. However it can be a lot of work and get expensive rather quickly, so I will share my tips on how to build a Lego sculpture.

  1. Like any project you need to have a plan in place before you begin. Give it some good thought about what you would like to construct. Sketch something out on paper first or use the Lego Digital Designer to help you prototype before actual building. Discovering that something might not work in the planning phase could save you much time and money.
  2. Color – there is a limited color palette that is at hand. For instance, you’re going to find it to be very difficult if not impossible to find certain brick colors (good luck with purple). So be sure to be aware of any color limitations that you might run into.
  3. Amount of bricks necessary. This can be very difficult to gauge. I highly recommend using the Lego Digital Designer to assist you in figuring out just how many bricks might be necessary. I find that no matter how many bricks you have, you always somehow seem to need more.
  4. Next you’ll need to acquire bricks. You might want to start off asking people if they have some lying around that they wouldn’t mind parting with. This didn’t work out so great when I attempted, but free bricks is worth a shot. If you’re really serious you’re going to have to stock up at a Lego Store or online using the Pick a Brick. Stocking up of Brick Buckets always helps too.
  5. Now I begin the fun part, building. I tend to start with the area that will be the most detailed, then build around that. I found that approach to work best for me. Also be sure to give much thought to strength and stability when stacking bricks.
  6. That’s really it. I will ask others for their opinions and then make any adjustments if necessary. Usually end up needing to scrounge up even more smaller bricks to get more detail into the sculpture.
  7. Have fun and show off your masterpiece to everyone you know!
Categories
Development

YUI 3 Awesomeness

I’ve been a huge fan of the YUI Library for quite some time now, using it in some form in almost all of my web projects done over the last 2+ years. Every now and then, I’m pleasantly surprised in just how useful it can be to me as a developer.

For instance, recently I’ve been working on building an application that will need an easy to use sortable list, that will fire off an event upon the list order changing. As simple as this sounds, it would require a lot of coding and cross browser testing to pull this one off with just javascript alone.

YUI 3 allowed me to accomplish the above in just a few minutes. I’m not even going to try to guess just how much time it’d of taken me to do on my own.

I made use of the Sortable Utility to make and unordered list sortable in just a few lines of code.

First I just added the YUI seed file to my page:

<script src="http://yui.yahooapis.com/3.1.1/build/yui/yui-min.js" type="text/javascript"><!--mce:0--></script>

Then just added a simple div and unordered list to my page:

 

Things I want

    • puppy dog

 

  • ice cream

 

 

  • G.I. Joe USS Flagg Aircraft Carrier

 

 

  • Lego bricks

 

 

  • iPad

 

 

  • Infinity Gauntlet

 

 

  • world peace

 

 

  • Star Scream

 

 

  • waffles

 

 

  • pb&j sandwich

 

 

And added the script that brings the unordered list to life:

YUI().use('sortable', function(Y) {
    var sortable = new Y.Sortable({
        container: '#want-list',
        nodes: 'li',
        opacity: '.1'
    });
});

That was it, a fully user sortable list!

I also needed this list to fire an event when a list item order had been changed. The Drag & Drop (DD) Utility has some nifty events that conveniently work with the Sortable Utility. So, I just added the following to my above script:

var doSomething = function() {
    	alert('do something');
	};
	Y.DD.DDM.on('drop:hit', doSomething);

When a drop:hit event occurs, it calls the doSomething function. In this case the doSomething function fires up an alert that says “do something”. It’s pretty basic and a rather useless alert, but it does demo what I’m working to do.

Again, YUI 3 is so awesome, that I easily spent more time writing up this little post than I did in making my above requirements happen. That’s really amazing to me. YUI 3 documentation is great, tons of examples there too.