Sep28

The Rise of Netbooks

Ever since ASUS introduced the Eee PC late last year, every computer company in the world has been scrambling to introduce their own.  Well except for Apple and Sony, but Sony is rumored to be working on one.  They're neat little machines, but I can't see how people get any serious work done on those things.  Especially when it comes to word processors, those things get bigger and slower with each release.  But if Apple wants to enter this market I suggest they leveage their iPhone technology and make a tablet with an attachable keyboard, similar to Compaq's old 10" tablet.

Sep01

Spring Cleaning in the Summer

I just got rid of an extremely old laptop - an IBM ThinkPad. I'm not sure what model it was, but it was a Pentium 75 with 24 MB of RAM running Windows 95. It had a floppy drive and an external parallel Zip drive, I guess CD drives weren't popular then. In addition to that, I ripped out my old internal Zip 250 drive from my Linux box and dumped 20 zip disks that were collecting dust. It was a total pain because Ubuntu would only recognize a zip disk at boot time and then I couldn't eject a disk until it was in restart mode. Of course when I attached the drive to my old windows box, it worked fine. Its kind of funny when an OS released in 2001 worked better than one released in 2006.

The linux box is next to go, its an Athlon 1.2 GHz system with 768 MB of RAM. Its a full tower with a pretty weak graphics card and a tiny hard drive. I'm going to fully wipe the hard drive and reinstall the latest version of ubuntu since I don't have copies of XP laying around. If anyone wants it let me know otherwise its going to a local computer store. The windows box will be after that, but I have to clean it up and get rid of its graphics card, it draws more power than its power supply can handle. Which causes it to crash when there is heavy graphics work like 3d games.

Update: I also have an old Palm Tungsten E if anyone wants one.

Aug06

Objective-C and the iPhone

With the launch of the iPhone 3G and the AppStore, developers around the world are rushing to grab a piece of this new market. Mac developers have a distinct advantage since the iPhone leverages MacOS X 10.5 APIs and frameworks. These interfaces are written in Objective-C, which is sort of in between C and C++ with a few unique pieces thrown in to spice things up. I'm sure many developer are scrambling to find tutorials. I found a couple that may help.
Jul26

What’s happen to you Digg?

I was just reading about California banning the sale of trans-fats on Digg and I was shocked to see the majority of the comments were against it. The commentators were claiming it infringes on their rights and they didn't want the government babysitting them. Now I hate to lump people into groups, but this is classic Libertarian thinking and its pretty naive of them. Trans-fat are a public health hazard that have been linked to coronary heart disease. They only exist because they're cheap. They're like the food equivalent to asbestos, but I'm sure that group would defend their right to buy that crap too. I remember when Digg was geeky, but now it seems to be home to a bunch of political extremists and that just plan sucks.

Jul12

Working with Embedded Assets in AS3

I've been working with embedding SWFs in a pure AS3 project using the Flex 3 IDE and I ran across a little problem. All the examples just embed a SWF or JPG and use them directly on the stage. While this is fine for most instances, I needed to change the value of the TextField in my symbol. Embedding just a SWF won't allow you to do this. You have to use a symbol within an embedded SWF. All you pretty much have to is add the symbol property into the metadata line, like so.

 [Embed(source="assets/icon.swf", symbol="number")] private var Icon:Class
Jul06

Big Stack

So I was playing a little bit of Texas hold'em yesterday and I was doing ok until the friend that rode with me got a little sick. Knowing that time was against me I decided it was time to use my hurry-up offense which is coincided with me getting a bunch of good hands. I was on a roll and quickly became the big stack at the table and then everyone decided to cash out. Another hour and I would of had everybody's cash. At least I still made money.

Jun29

Rough Month

Thank goodness June is almost over. Its been been an emotional roller coaster caused by the actions of friends and family. Besides that I've had numerous and expensive car issues. I want a new car, but I'm holding back beause I really need to move first before I take on any more debt. Which of course brings up my long commute to work (140 miles round trip). It really hasn't bothered me until this month. That two plus hours everyday that I could be doing something else plus I'm in an awkward position in my social life too. I can't do too much down in Richmond cause I need to get home so I can leave early to get back down there. But there is only so much to do in Fredericksburg on the weekends. And I've already blown off two parties down in Richmond cause I don't want to drive down there on the weekend. Plus I've been extremely unlucky this month. Earlier this month I locked myself out of my house, I could of drove to my parents (I had my car keys) to get my spare, but I was in a hurry so I just kicked the door to the garage in (I have a little bit of an anger issue). So now I need to fix that.

But it hasn't been all bad. I finally had some time to work on my website and I have a little bit of freelance work coming my way. At my company's quarterly meeting pretty much every project shown I had a hand in. Getting credit is always a nice feeling; especially since I don't brag about my work enough. And I'm sure some other good things happen, but I can't think of anything else at the moment.

P.S. Yes I have notice that a lot of my posts have been complaining about driving and working late. Work isn't bad its just that the drive compounds any late nights at work.

Jun23

Updates are on there way

Yes I haven't updated in a while, but that's because I've been putting the final touches on an entire site redesign. So comments are coming back and all of my old articles from my WordPress blog should be viewable once again (after some much needed spell checking). I almost forgot my RSS will be back too.

Speaking of updates is anyway else excited that ZFS is going to be in Max OS X Snow Leopard? Finally, a real man's file system.

Mar28

Woohoo Friday

I've been working hard on a micro site and a screen saver for the past couple weeks and all the long nights are really starting to get old. But its so close to being done. Unfortunately I have a few things that I need to be cleaned up over the weekend. Hopefully they'll go quickly, but I think I just jinxed myself.

Mar23

Damn you strict datatypes

Maybe its due to the fact that I haven't programmed in Java for while, but Java's strict data typing is really pissing me off. If I build an array of string arrays why do I have to typecast each of the string arrays when I access them? It doesn't make any sense, they've already been typecast once. I have a feeling this is going to be a problem when I start coding more in AS 3.0 too.

Mar21

Firefox 3 is Awesome

I tried an early beta a while back, but Firefox 3 Beta 4 on the Mac is stable enough to replace Firefox 2. It's fixed some rendering issues that I've been seeing a lot of in the last few months and it feels snappier. Of course there are a few annoying things too. The new back and next buttons suck. I don't know what they were thinking, but they look out of place. Luckly, when I toggle small icons the buttons look "normal". The other annoyance is the dropdown list on the location bar. The two lines look ugly. So now I have to use the oldbar extension to make it tolerable.

Mar15

What a Week

This last week has been quite a handful. I've been working on a ton of projects which all happen to have their due dates clustered together. In addition to that I'm taking two college courses to finish up my degree, I'm in extension country right now. Now add two hours of commuting a day to all of that and you can see I'm pretty much spent.

On a good note I just found out I can fit into some jeans that are a size smaller than my normal jeans (which are a little loose). I've manage to cut down on fast food a lot by going to delis and I'm walking more than usual.

On a bad note WebMD thinks I might have type 2 diabetes. I usually don't put that much stock into self-diagnosis, but I have quite a few symptoms. Including:

  • Feeling thirsty
  • Having to urinate more than usual
  • Losing weight without trying to
  • Feeling very tired
  • Feeling cranky
  • Infections and cuts and bruises that heal slowly
  • Blurred vision
Dec12

Flash+Firefox+Mac+transparency=Uh oh

So I was making a flash video lightbox today (and part of yesterday) and i kept running into a weird error in Firefox. Parts of the flash movie weren't showing up. At first I thought it was some weird issue with ThickBox, so I wrote my own lightbox code. But that exhibited the same problem. So I decided to test it in safari and was surprised to see it worked fine. A quick boot into Parallels and I found that IE and Firefox worked fine too. So now I was left with a Mac specific Firefox rendering bug.

It seems when you place HTML content over flash content, you cannot use the CSS opacity property. Instead you have to use a tranparent PNG and fake what ever you where doing. Not the ideal solution, especially considering that I had to use browser detection...yuck.

Dec10

EyeTV

EyeTV is simply awesome. I bought a Mac mini a month or so ago with the intention of turning it into a DVR. Well I finally added the last part, an EyeTV 250+.

I haven't had a lot of time to use it, but I love it. I think the coolest feature is the ability to export recorded shows to the iPhone/iPod, Apple TV, iTunes, etc... I think I'll be adding more video to my iPhone soon.

Oct07

Going Green

I'm slowly rewriting my blog to use ExpressionEngine as the back end. It's going to be a slow process while I transition content from WordPress. And to mark this change I'm switching the design to use green.

Oct07

2-0

The 2007-2008 season for hockey has just started and my favorite team, the Washington Capitals, are having a great start. They beat the Thrashers soundly and last night they crushed the Hurricanes in a 2-0 shutout. The biggest surprise to me is how well everyone on the team is playing. Who would think that a couple new players would make such an impact.

Let's go Caps!

Oct02

Where you at?

I haven't abandon my blog, I just have been insanely busy this year. I've started a new job for an ad agency in Richmond, Virginia. I'm preparing to move down there cause commuting sucks (an hour each way...ugh). It's really a welcome change of pace. My last job had me working on the same project for nearly a year because of a lack of direction from both customer and company management. I also felt the quality of work that we were putting out as a company had suffered greatly although most didn't see it that way. Which makes my new job all the better. I've worked on several projects within the last month and I'm thoroughly impressed with not only what was delivered, but by my coworkers skill and dedication to the job.

I'm also 3 classes shy of finally finishing my BS in Computer Science. Too bad they're crappy classes, but I knew I would have a few.

Nov07

Mozilla Developers’ take on Tamarin

By now everyone and their brother should have heard of Adobe's generous donation of their AVM2 to the Mozilla Foundation.

Brendan Eich seems to be extremely excited about the code, I would be too. This should really speed up JavaScript 2.0 adoption in browsers (when the spec is finalized). And since a variety of Firefox's UI features are implemented in JavaScript, it should also help speed up the Firefox.

Frank Hecker has a great post that answers what does this all mean to me.

Overall, I'm really excited about this, but I'm left with a question. With Apollo using WebKit (and JavaScriptCore), will Apple's WebKit project adopt AVM2 too?

Paul Robertson has a nice link roundup too.

Oct18

My Max Schedule

After a few false starts, I finally have my MAX schedule. I'm the only one going to MAX this year from my company, Apogen, so I had to cover a variety of topics in addition to the ones that I wanted for my own selfish reasons. I'm highly interested in meeting fellow developers, especially in the eLearning field.

Tuesday

  • 10:30 - Using the File API in Apollo
  • 12:30 - XDocs Meets eLearning
  • 13:45 - XMP: The Extensible Metadata Platform
  • 15:00 - Game Development with Flash
  • 16:15 - Advanced Apollo Application Development

Wednesday

  • 10:30 - Acrobat 3D: Scripting Your 3D objects
  • 12:30 - Creating Engaging eLearning with Acrobat, Acrobat 3D and Flash
  • 13:45 - Leveraging Flex 2 and Flash Player 9 for Truely Cinematic Experiences
  • 15:00 - Leveraging HTML/JavaScript and AJAX in Apollo Applications
  • 16:15 - Building Custom Components (Flex)

Thursday

  • 10:30 - Mars: A First Loook at XML Friendly PDF
  • 12:30 - Improving ActionScript 3 Performance
  • 13:45 - AfterEffects for Flash Designers
  • 15:00 - mLearning: Learning and Performance Improvement In the palm of your hand
  • 16:15 - Flex and .NET Interoperability
Sep19

I’m still here

It’s been a while since I posted anything and I just wanted everyone to know that I’m alive and kicking.  I’m happy to report that comment spam is down thanks to a little plugin called Akismet.  It’s been a real life saver.

I also wanted to mention that Yahoo Maps Sucks!  I recently used this service to get directions for a business meeting.  Luckly i have a good sense of direction cause the crap Yahoo gave me was worthless.  When the first direction is wrong, you know you’re in for a long ride.

Jun28

Woohoo! Flex 2, Flash 9 Player and Flash Pro 9 Preview.

Flex 2.0 is finally here. I’ve been playing with the alpha and beta builds for a while now and all I can say is wow. I’ve already convinced my boss that we need to get this tool.

Check out all of the official Adobe Flex site. And while you’re at it check out the Flex Developer Center. There is also a new community website dedicated to providing technical and support resources on Flex called flex.org.

The Flash 9 player made it out of beta today too. It’s a significant upgrade. Besides providing support to ActionScript 3.0, it's way faster. Get your copy today.

And last but not least Adobe labs has released the Flash Professional 9 ActionScript 3.0 Preview. It’s really just a extension to Flash Pro 8.

Over at the Feasible Impossibilities blog, there is a post that O'Reilly is getting ready to release a Flex 2 and ActionScript 3 book.

I think that's just about everything you can find on MXNA at the moment.

May14

More on the Future of JavaScript

I was visiting a site called Ajaxian this morning and noticed a nice little post about the future of JavaScript. Specifically, there is a link to a presentation that Brendan Eich gave on JavaScript 2. For those of you who don't know, Brendan Eich is the creator of JavaScript and works at the Mozilla Foundation.

Besides giving examples of new JavaScript 2 syntax, there is a little timeline on when these features will make it out into the wild. JS 1.7 appears in Firefox 2 and JS 1.9 appears in Firefox 3. Unfortunately, it looks like the JavaScript 2 spec will be finalized after Firefox 3 is released (early 2007), hence it's version being called 1.9.

Mar30

FlashObject and Frames

Microsoft is finally going to patch IE so it doesn’t infringe on the Eolas patent portfolio. Of course that means we need to update all of our plug-in code so we don’t confuse users. The quickest solution is to use deconcept’s FlashObject. I’ve been using it a lot lately and it’s awesome.

FlashObject works by dynamically creating the flash plug-in code and replacing the html located within a specified tag. However, this presents a problem when you’re sharing code between pages in different frames. FlashObject is only looking on the page that loaded it for that specified tag. Of course you could always include the flashobject.js on each page, but that just seems like a waste to me.

The quickest and easiest solution for me was to modify the write method of FlashObject. Instead of just passing in the tag to be replaced, I also pass in a reference of the document where the tag is located. The new way of calling FlashObject’s write method looks like this:

fo.write(“flashcontent”,document);

Using the keyword document references the current document, but you can easily change that to what ever you need. Then in the flashobject.js file I changed the following lines:

write: function(elementId){
...
var n = (typeof elementId == 'string') ? document.getElementById(elementId) : elementId;

to

write: function(elementId, targetDoc){
...
var n = (typeof elementId == 'string') ? targetDoc.getElementById(elementId) : elementId;

Now I can load the library once and have multiple frames use it. I'm pretty sure this method will work for popup windows too.

Note: I haven’t tested this solution thoroughly and I’m sure there is a better way of doing it to, but it works for now.

Jan26

Image Scaling with JavaScript

I recently implemented an image scaling feature for an image archive I wrote at work. Normally, I wouldn't scale an image down in a webpage, but I wanted the user to be able to download the full size image by right-clicking. And since these images are used for graphic design, it doesn't make sense to scale them before they're placed in the archive.

The first thing I needed to do was create a container for my image.  Both the container and the image inside of it need an id.

<div id="container">
<img id="picture" src="some.jpg">
</div>

With the ids I can grab both the container's and the image's height and width. The container's dimensions are usually set in the CSS.

var box = document.getElementById("container");
var img = document.getElementById("picture");

// Grab the image's dimensions
var imgH = img.clientHeight;
var imgW = img.clientWidth;

// Find which dimension is scaled the most
var scaleH = box.clientHeight / img.clientHeight;
var scaleW = box.clientWidth / img.clientWidth;

// Scale the image
if (scaleH < scaleW) {
img.style.height = box.clientHeight + "px";
img.style.width = Math.round(imgW * scaleH) + "px";
} else {
img.style.width = box.clientWidth + "px";
img.style.height = Math.round(imgH * scaleW) + "px";
}

You now have an image scaled proportionally at run-time. There is actually a lot more to the feature I implemented at work, but this will hopefully get you started. For example a more robust version would check to see if the image needs to be scaled at all, allow the user to select zoom levels, and load the image in dynamically. If you load the image in that way you need to attach an onload event to the image to make sure its loaded before it's scaled. Enjoy!

Jan14

Goodbye Slashdot, Hello Digg

Any self respecting geek, nerd, or technophile has probably heard of Slashdot. A site that proudly advertises itself as "News for Nerds." But I for one am getting sick of the stories they offer, many are uninteresting, repeats or just plain old news. After contemplating removing Slashdot from my bookmarks, I ran into Digg. Digg is very similar to Slashdot, but this time the users rate the stories.

Not only does it offer great news, the news is presented nicely and many of the sites’ features are enhanced with AJAX. For example if you really like a story, you can "digg it", which adds that story to a list of stories you dig. This is all done in the background with AJAX. This list also doubles as a custom RSS feed. Now anyone can subscribe to the news that YOU find important. My list can be found here.

Join the Digg revolution.

Dec04

You’ve been Assimilated

Goodbye Macromedia, Hello Adobe. The acquisition has been completed over the weekend. Adobe's future strategy will be disclosed on January 31st. This is when we are going to hear what is going to happen to Macromedia’s and Adobe’s competing products (winners in bold):

  • GoLive vs Dreamweaver
  • ImageReady vs Fireworks
  • Illustrator vs Freehand

Dreamweaver has a commanding market share lead over GoLive as does Illustrator. No matter what happens, hopefully they will continue to develop great products.

Dec04

JavaScript 2.0

There has been increasing talk of JavaScript 2.0 lately. Mainly, it brings JavaScript to ActionScript 2.0/3.0 style of coding, but with a few minor differences. You can read more about JavaScript 2.0 at Brendan’s Roadmap Updates blog. It will be great to have the ability to use OO ActionScript code in JavaScript projects.

Dec04

What’s New in Firefox 1.5

Well it’s been out for week and it’s truly a nice upgrade. There are several nice features:

  • Automatic Update – You no longer need to download a whole new build when a patch is released.
  • Faster Back and Forward Navigation – Speaks for itself
  • Drag and drop reordering for browser tabs – Also speaks for itself
  • JavaScript 1.6 – Includes E4X as well as other improvements
  • SVG support

On a non-technical note, Firefox is now hosted on mozilla.com.

Nov08

E4X 102 – XML Lists and Queries

Now that we have the basics down for accessing tags and attributes, we come to the real reason why Flash 8.5 has regular expression support, XML lists. An XML list is an array of XML nodes, but the array is usually created by performing a query on an XML document.

I’m going to continue using my sample XML file from my previous post. The following code is the simplest way to create a list.

var names:XMLList = myXML.employee.name;

Now I have a list of all the employee's names in the XML document. That really isn’t too useful because we can already access those values fairly easily. A slightly more complex problem would be filtering employees based on specific criteria. If I wanted to filter employees based on whether they are full-time or part-time, I could either loop through the entire document or query the document with E4X. A query that returns all of the full-time employees would look like this:

var fullTimers:XMLList = myXML.employee.(@type == "full-time");

You can use pretty much any type of expression to query the XML document. Suppose I want to match all of the employees that have an address starting with the number 1.

var addresses:XMLList = myXML.employee.address.(street.match(/^1/));

Since the street tag is a string, I can use the built-in string function called match. The match function takes a regular expression and returns whether the string fits the criteria. A good reference on regular expressions can be found at Regular-Expressions.info.

With XML list and queries you can parse through an XML document faster and more reliably than before.

Oct31

E4X 101 - The Basics

ECMAScript for XML, or E4X, is a new native way for working with XML documents in ActionScript 3.0 and JavaScript 1.6 (Firefox 1.5+). Prior to E4X, you needed to use DOM methods for navigating and building XML documents.

Before we get started, we need a few things:

Once you have Flex setup, create a new ActionScript project. Use my previous post to setup the XML load mechanism. Once all that is done, we can finally start experimenting with E4X.

We’re going to start by accessing tags and tag attributes. It’s pretty straight forward. In the following code, I accessed the name tag found under the first employee tag. If the name tag has no additional tags inside, then the value returned is a string.

myXML.employee[0].name

In the next code block, I’m accessing the employee tag's type attribute. To access attributes, you need to use the attribute punctuator (@). It looks a little weird, but it hey it works.

myXML.employee[0].@type

But the real nice thing about E4X isn’t that you can retrieve value, you can also set them.

myXML.employee[0].name = "David";
myXML.employee[0].@type = "Full-time";

The XML document will now have those new values. But it doesn’t stop there, you can create a new XML document from scratch. The following code will create a basic HTML page.

var newXML:XML = new XML("<html />");
newXML.head.title = "New HTML Page";
newXML.head.title.@lang = "en-US";
newXML.body = "HTML Page content goes here";

And here is what it looks like.

<html>
<head>
<title lang="en-US">New HTML Page</title>
</head>
<body>HTML Page content goes here</body>
</html>

Of course we’ve only just scratch the surface. In my next E4X post, I’ll be showing you how to work with XMLLists and further down the road namespaces.

Oct26

AS 3.0 – The new way to load XML

I’ve been dabbling with some of the new features of Flex Builder 2.0. Overall, I’m pretty impressed with the quality and power. ActionScript 3.0 should finally quell any last remaining doubts that ActionScript is a real programming language.

One of the new classes found in ActionScript 3.0, is the URLLoader class. This class replaces the object specific load methods. You no longer call the load method from an XML object, instead you have URLLoader load the data and pass it to the XML object.

A basic implementation of the URLLoader class follows.

package {
import flash.display.MovieClip; // Ye good olde MovieClip class
import flash.xml.*; // XML related classes
import flash.net.*; // URL Loader and Request classes
import flash.events.*; // Allow handling of events

public class LoaderDemo extends MovieClip {
private var myLoader:URLLoader;

public function LoaderDemo () {
this.myLoader = new URLLoader();
this.myLoader.addEventListener("complete",this.XMLLoaded);
this.myLoader.load(new URLRequest("demo.xml"));
}

private function XMLLoaded(evt:Event) {
var myXML:XML = new XML(this.myLoader.data);
}
}
}

In the Flex Builder 2.0 IDE, I created a project called LoaderDemo. It created the basic structure of the ActionScript file. From there you create a URLLoader object, assign a "complete" listener, and tell it which file to load (via URLRequest). When the file is done loading it calls the function referenced in the "complete" listener and from there you can do whatever you want with the data. Yes, its different from previous versions of ActionScript, but now you can use the same code to load just about everything. There is even a streaming version of this class, which lets you work with data as it downloads.