I hereby decree

by David LeMieux

 

Merry Christmas!
Merry Christmas!

Valerie and I don't often remember to send out holiday cards. You know the type, the ones with a picture of the family and sometimes a note recapping the year's activities. We always talk about doing it, but never do it.

This year on Christmas Eve I had an idea to make a digital card. The original idea was something like an 8-bit snow-globe but I knew the first thing Val would say would be "but our picture doesn't look very clear" (or something along those lines) so I came up with a little trick. The picture starts out clear, but then as the 8-bit carol plays and the holiday greeting appears from the bottom, the picture is blocked in to a more 8-bit-like image (not true 8-bit, of course). You can check it out here, make sure to have your speakers on.

I have been doing a lot of Flash programming at work so for this card I decided to use just HTML, Javascript and CSS. I took advantage of some of the code libraries I made this year, like Cigar and my previous canvas experiments as well as some third-party code libraries, mostly from Grant Skinner. I tested the card in Chrome, Safari, and Firefox (all the latest version) and I took a glance at it in IE. The only major difference was that I still haven't gotten the font-face to work in IE.

In theory it should work on mobile safari or any html5 compliant mobile browser but it doesn't because of restrictions in place by those browsers (e.g. no sound loading unless dictated by user action). I could have added more support for those devices, but I put this together in about three hours late Christmas Eve and any more time spent would have meant it wouldn't have been ready for Christmas Day. It almost wasn't as it is.

My favorite part is the snow, and my lovely family of course.

UPDATE: I added support for iOS devices now, too.

 

Comments (View)

 

 

Sometimes you need an invalid feed or some random artifact crucial to helping you debug and test your web application. I hope to turn My Imaginary Site a resource for just that.

I've owned the domain for long enough now. I purchased it as a kind of personal inside joke. Now I want to make something useful of it. I have been ever-so-slowly filling it in, and it is still really sparse.

Please send any suggestions my way.

Keep in mind that this isn't meant to be some amazing end-all be-all resource. I just want a quick index of all those things you find yourself needing in application development. "Man, I really wish I had a way to load a feed url that timed out after 'n' number of seconds." - I will soon have a link for that up on the site. So that kind of thing.

 

Comments (View)

 

 

It is with a little sadness that I admit that I did not participate in this years Trunk or Treat.

Sigh.

I had an awesome idea and about a month ago I got started on the beginning work for it. Somewhere along the way, though, it became apparent that I wouldn't be able to complete it and unfortunately after that I never switched to another, perhaps easier, idea.

The creative process is interesting. Not every idea takes off and of the ones that do not many are ever completed. I am not upset that I wasn't able to participate this year and protect my reign as King of the Trunk or Treat. In fact, it was relaxing to just take my kids and enjoy the evening. But when I am not making things I feel like I am just sitting around twiddling my thumbs. It isn't a feeling I like.

That is why I am such a proponent of just doing things. Have an idea? Work on it in some small way. A sketch. A list. Initial research.

This has been an off year. I have gotten a lot done, but not in the areas I expected.

 

Comments (View)

 

 

A few weekends ago I got to participate in Node Knockout with some friends. It was a 48 hour contest to see who could come up with something great using Node.js. My team, myself and some coworkers, decided to try and make something like a multi-user game platform where you could use your computer screen as the output screen and a second device (mobile phone, for example) as the game controller. What we came up with was Fly By Wire (more info).

It was a lot of fun but there are some pretty bad bugs. We didn't win either. But I learned a lot about Node.js, CoffeeScript, and web sockets. I hope to do it again next year.

 

Comments (View)

 

 

I've been doing some experiments with JavaScript and the Canvas tag. Here are some results:

Starry Blocks
Starry Blocks

Launch Pad Quads
Launch Pad Quads

The first just traverses an image and chunks it in to blocks of a configurable size and displays the average color for the block. The second recursively subdivides the image based on color threshold and size and then, again, displays the average color if the rules are met.

You can see them compute live here and here. (Google Chrome or a very modern browser recommended)

The code isn't completely optimized, and I have found some interesting irregularities while working with the Canvas Context object, but in all it seems like a straightforward piece of technology.

For more Canvas fun, check out EasleJS by Grant Skinner (not used here). He has essentially taken a lot of the vocabulary and paradigms from Flash and ported them over in to a performant Canvas render engine.

 

Comments (View)

 

 

Part 1

So, its been a year and I would like to re-comment on the state of Flash. Flex/Flash consultant Jesse Warden put up a nice post today about some current Adobe news. One thing Warden mentions is the fact that the passion behind Flash is dying, not the technology itself. I would add my voice to that same sentiment.

In my own professional life (I am not a consultant) I have been using Flash less and less as time progresses. This has nothing to do with the platform or its capabilities. It has a lot to do with how my company values Flash and the time we decide to put behind it. Flash continues to be an important part of what we do, but many of our new projects are striving to be Flash-less. The reasons for this vary, but the biggest are these: 1) We are trying to be cross-device compatible, inclusing iOS. 2) We are a group of young, "hip" developers that often get caught up in the new coolness.

Lets talk about reason #2 for a moment. Things like Node.js and Ruby as well as the many GitHub projects are the cool thing at the moment and are proving to be fun to play with. In an effort to say ahead of the curve and also be a part of the "bleeding edge" we sometimes pick new technologies over old ones (it is also very educational). Bottom line, we never say "lets use Flash to implement this cool new idea."

So, it doesn't matter that in many cases Flash would be a great solution.

There are allegedly some cool technologies coming in newer versions of Flash, but I haven't felt the need to look in to them. If I am any indication (and I don't know that I am) I would say that the trend is similar elsewhere. (Also, I've seen demos of WebOS running Flash and yet it is still nowhere to be seen.)

There are a lot of cool new toys to play with, and whether because of marketing or timing or any other reason the new Flash toys just aren't as stand-out and amazing any more. It used to be that if a developer made a cool Flash library they could get some traction and some attention. Now the new hotness is putting up a new JavaScript or Ruby project on GitHub.

So Flash as a technology is still not going anywhere, but it may start to disappear if the community stops caring.

 

Comments (View)

 

 

I've been working on a side project of sorts. What makes this one different is that I don't know where it will take me. I would like to introduce Cigar.js - a JavaScript dependency importer. Basically, it acts kind of like import does in Java, but it works client side and it is for adding JavaScript files to your runtime environment.

It works like this: After loading the Cigar.js file you can call _import and load javascript files from your own domain (for now, though I do hope to add the ability to do external files as well). You can chain the imports together, essentially creating a queue of files to load. At the end you can specify a callback that will be initialized once all the files have been loaded.

I've had this idea in the my head for a while now, but it wasn't until I saw a tweet from Jeff Remer that I thought "well, Groucho always has a cigar, so I should make a js library called 'cigar'."

Jeff's Groucho Tweet
Yeah, it was all based on a bad pun

What is emerging from this wandering idea of mine is that you could use this to structure your JavaScript files more like Java classes. This could be handing for creating reusable code snippets and have dependencies, but help remove all the circular references.

You could have a utility "class" called "AwesomeUtility" that is used in "Object1" and "Object2". Cigar would allow you to save those in separate js files and test them independently, then you can use Cigar to import them in to your main script file and the dependency will only be loaded once.

As it is, Cigar is no-where near production ready. There is still a lot to test out and play with. Also, I have know idea where this is going.

 

Comments (View)

 

 

I sometimes get to work while I ride in to The City on BART and I am always a little disappointed that my coding/terminal skills don't seem more hackeresque, especially when someone is looking over my shoulder. Though I certainly don't want to have my computer taken away for looking suspicious I decided to make my onlooker's experience more fun.

Today while on BART I put together this little number:

Phone Gen Screen
I'm in your phones, hacking your numbers

What this really shows is a bash_profile alias that points to a Java thread I made that spits out a random quantity of random, not even valid, phone numbers at interchanging intervals with either a success or failed message. It then tallies the successes and outputs the success/total ratio at the end. What it looks like it is doing, though, is hacking all the nearby phones.

Why make this? So that the people sitting next to me get mildly freaked out. I mean, to start this baby up I have to type "hack_nearby_phones". Everything Hollywood teaches us about computers allows this to make sense, so it will surely fool everyone.

 

Comments (View)

 

 

I hereby decree that the links section shall be restored. Just visit http://iherebydecree.com/links and see for yourself. I started this links section a long while ago and then stopped as I found that I was user Twitter and Facebook more for sharing. Time has passed and again I find myself wanting to consolidate.

For the three people that read this blog, I hope you enjoy.

 

Comments (View)

 

 

Bow chicka bow wow

Err... wait, Inception. I really enjoyed the film. It was a great action movie; intelligent and original enough to be worth watching multiple times.

One aspect of the movie I really enjoyed was the musical score. In fact, I find myself keen on many of the movie soundtracks composed by Hans Zimmer (Batman Begins/Dark Knight, Pirates of the Caribbean, Sherlock Holmes, and more).

Anyway, if you've seen Inception you know that the protagonists do much of their deeds in a dream state. In fact, they induce dreams within dreams. For every level deeper they go in the dream worlds, time slows down. In other words, you have more perceived time in a second layer dream than you do in a first layer dream, even though the same real time is passing. Confused? Watch the movie.

Whenever they want to be awoken from their dream state, someone has to initiate a "kick" - or some kind of semi-violent wake up call, like the feeling of falling or being hit. To signal that said "kick" is coming, they use an audible hint: The song Non, Je Ne Regrette Rien by Edith Piaf. (Seriously, if you are totally not following me go watch the movie then come back.) So that is why when I found this YouTube clip:


Same music, just slowed down.

I was amazed. "What a clever trick," I thought to myself, "I wonder if it is on purpose. It has to be." It turns it was. In fact, Hans Zimmer has admitted that much of the soundtrack is based on that one song.

So, a clever movie with a subtly clever soundtrack. If you haven't seen it already, go see it. Now.

 

Comments (View)