Home

I Handed in My Letter of Resignation

Posted by patorjk | Personal | Sunday 15 August 2010 8:18 pm

Last week I handed in my letter of resignation to Northrop Grumman, the company I’ve worked at for the past 4 years. I was both excited and nervous at the same time. Nervous because it was a big step, and excited because I was starting a new job as a subcontractor at a small company in two weeks.

Photo by gabork

The past three years I’ve spent most of my time creating and maintaining Java and Tcl/Tk applications, with the majority of my time going to Tcl/Tk development. Both of these are fun languages, but I kind of wanted to get away from these as my primary focus and move into doing web development. Northrop is a pretty huge company and allows people to move around, but from the inside it looked like my future involved mostly C/Java/Tcl, so I decided it was time to see what was available outside of the company.

I’ve had a few friends successfully change jobs within the past year and decided to hit up one of them about possible jobs in his company. I ended up interviewing for and landing a job as a PHP developer. Since I’ll be a subcontractor, what I work in will vary from project to project (just like at Northrop, actually), but I’m in a position to take on a more diverse set of projects that I think will be geared more towards my interests. I also think getting to see how smaller companies work will be an interesting experience.

Lastly, I’ve decided to carry on with my rule of not talking about work on this blog, with the exception of big announcements, so this will probably be my last work themed entry for a while. Hopefully it helps me pick up some cool new skills and I’m am able to apply some of what I’ve picked up making the content for this site professionally. Also, I know I’ve sort of been neglecting this site due to perparing for the new job, but I think this site will benefit from it in the long run. If you’re interested in changing jobs and have any questions feel free to shoot me an email me or post in the comment section below.

Muller Images Experiment

Posted by patorjk | Random Ideas | Thursday 24 June 2010 12:03 am

The Muller Formula is a neat little color formula that aims to predict which sets of colors people will find pleasing. No actual formula is given for it, but it’s concept is described. Given a set of colors with the same hue but a different lightness, the colors with the lighter hues should be shifted to a more naturally bright color and the colors with a darker hues should be shifted to a more naturally dark color. I thought this was a neat idea and figured I could possibly simplify it to work with a single color (what I decided to call a “Muller Color”). If a color had a high lightness, its hue would be shifted to a naturally light color. If it had a low lightness, its hue would be shifted towards a naturally darker color.

HSL Color Wheel
Image By Jacob Rus

The original article used a the traditional artist’s Red-Yellow-Blue color wheel. I wasn’t able to find a good conversion formula to go from the Red-Green-Blue color model (RGB) (which is popular in computing) to the Red-Yellow-Blue color model (RYB), but I did find formulas to go from RGB to the Hue-Saturation-Lightness color model (HSL). I figured this would work well since the HSL model had everything I needed to calculate a “Muller Color”. I could detect the lightness of a color and then adjust its hue accordingly.

Looking at the HSL color wheel, I decided to use the primary colors (Red, Blue and Green) as the more naturally dark colors, and the secondary colors (Yellow, Cyan, Magenta) as the more naturally light colors. This decision was just based on my own judgement. Using the HSL color model and the concept described by the Muller Formula, I was able to generate interesting colors from RGB inputs. And to make a long story short, I ended up using this idea in my Image to Color Palette Generator app. A color palette would be generated of an image, but in addition, the user would also see a palette of the corresponding Muller Colors.

Primary and Secondary Colors
Image By SharkD

I figured I was done with this idea until I received a recent email from someone suggesting I take the images people input into the Color Palette Generator program and create “Muller Images”. Basically, call the Muller Color formula on every pixel in the image and generate a new image. I thought this was a really cool idea so I whipped up a quick prototype which you can see here. The shift percent indicates how much a color should shift. For example, if the color is between red and yellow and the shift is 100%, it will become yellow if it’s light and red if it’s dark (a dark yellow would even end up becoming red and a light red would end up becoming yellow). If the shift is just 50%, it will just shift 50% of the way closer.

Unfortunately, the results weren’t as stellar as I hoped. Calling the Muller Color formula on every pixel caused them to gravitate towards similar colors, so the resulting image tended to look like poorly compressed gifs. An example of a 10% shift can be seen in the Bernie Madoff pumpkin pic below.

Normal Image and Muller Color-ed Image

It was still a cool idea, and maybe it could still be used for something, though it’d probably have to be tweaked a little bit. There are other images available to Muller-ize on the experiment page if anyone else is interested. Thanks to David Dailey for the idea on this one.

Thoughts on Yesterday’s Events

Posted by patorjk | Personal | Tuesday 22 June 2010 9:49 pm

Photo By Axel-D

My head is still spinning a bit from yesterday. I couldn’t really take in everything that was going on since I was having to run around a lot at work, however, I figured I’d post some final thoughts since I don’t feel like I defended myself well enough against Marak and friends’ attacks.

Firstly, the source to TAAG isn’t “weak sauce”, it’s pretty cool. It generates neat ASCII Art text in real time, works with FIGlet and my own font file formats, allows you to generate images, test multiple fonts at once, implements the FIGlet smushing feature, and a whole host of other things. If it wasn’t any good, I (or even you, Marak) wouldn’t have been able to continually build on it. It’s not my best work though, and if I were to do it again today (knowing all that I now know about JavaScript), I would approach its design differently. Also, to quote the very kind reddit user elmuerte, who actually went though and compared Marak’s code and my code:

I checked his changes. And most of the work was actually removing the code that read the configuration from the “control frame” in patorjk TAAG website.
patorjk wrote the code specifically for his website, this other guy just made it more generic. That’s not really what I would call “removing crap to get it working”.

Secondly, I am a hobbyist, but I’m also a professional Software Engineer. I’m not a “weekend hobbyist” or a “plumber with a fireman’s axe”. It boggles my mind that someone would take my code, use it to their advantage, and then blast me like I was Cletus from the Simpsons. I’m good at what I do, in fact, I kick ass. I read books on programming in my spare time, I have hobby projects, I’ve got a BS and an MS in Computer Science (all A’s and one B for my undergrad), companies have flown me across the country to interview, and I’m considered one of the best where I work. I know it’s a real pompous thing for me to make this kind of list, and I normally wouldn’t bring this stuff up (hopefully I’m not sounding like an arrogant dick – I don’t mean to), but I feel like I’ve been shamed with misinformation by Marak and his cronies for not letting him have my code.

Thirdly, I’m glad I saw this reddit comment by itsnotlupus:

It’s a little upsetting to read so many boneheaded comments on his blogs, ranging from “you got credited so what’s wrong?” to “your code sucks anyway”, with a dash of “you shoulda made it harder to steal then.”
I kinda hope most of those are just the guy caught in the cookie jar that felt like trolling, or it paints a rather bleak picture of that blog’s readership.

I’m almost completely sure it was Marak. Marak’s comments kept coming from different IPs, though I did catch him and another user posting under the same IP for one post each. Another pair of Marak supporters also had the same IPs for one post. My hypothesis would be that Marak was posting under many different user names in an attempt to make it look like he had lots of support.

Lastly, as far as open sourcing TAAG is concerned, I don’t think I’d enjoy writing a JS library in the wake of this. This whole experience has just left me with a really bad taste in my mouth and I’d like it to be over with. However, I would imagine there will be those interested in using one since yesterday’s post attracted a lot of attention (around 40k visitors). I did a quick search on github and 5ivestar has a JavaScript FIGlet project. Scott Gonzalez has also started a FIGlet project. So there will probably be options for a complete JS FIGlet library in the future. I want people to know I’m not against open source, I’m just against taking someone’s source without their permission.

Anyway, I’m done with this situation. There will be no comment thread in this post. Thanks to anyone who took the time to have my back.

AsciiMo – Where have I seen this before?

Posted by patorjk | General News, Web Apps | Monday 21 June 2010 2:22 am

/*
asciimo.js – written by Marak Squires
saved from the internet @ http://patorjk.com/software/taag/

i had to do unholy things to make the original code work, seriously.
check the commit logs on github and you’ll see how much “code” i had to delete and refactor.
what’s left isnt really acceptable, but it does work.

let’s clean this up and get a more comprehensive font database!

— Marak
*/

How I picture code thieves

So that’s the header comment to a new open source project called asciimo. Though I’ve never heard of the project, it’s actually composed of the inner workings of my Text Ascii Art Generator (TAAG) web app. I’ve never heard of Marak Squires either, and I don’t particularly like his snarky comments about his difficultly in stealing of my work.

I’ve had stuff taken from this site. Sometimes it’s makes me smile, other times it makes me shake my head. This makes me shake my head. TAAG was the project I used to return to JavaScript. It was written with JavaScript knowledge I remembered from the late nineties. It was a project I did for fun. Hell, I didn’t even know what AJAX was when I first released it. Underneath it ain’t so pretty, but it’s mine and not some jerk’s ticket to getting a lot of attention for themselves.

I should probably be angrier, but I’m actually mostly just disappointed that someone did this. This is lazy and selfish. I develop all sorts of random stuff, and I do it for fun. If I see a concept I like, I’ll try and make my own version, I don’t take someone else’s. When I see something like this, it’s upsetting. Is it for some quick attention? So they can state that they’ve started X number of open source projects on their resume?

I was initially told of this project through email (thank you Jan), though I later found Marak’s self promotion on reddit (edit: screen capture from saved html file – he deleted some of his comments). His response to my comments was that because I didn’t explicitly put a copyright notice in my code that he could use it however he wanted (which I’m pretty sure isn’t true). He tried to say he did it for altruistic reasons, but FIGlet itself is open source, and there are already PHP modules available for people looking to use it in the browser (here and here).

Maybe in another universe we could have had some kind of cool collaboration, but at least in this one, Marak doesn’t seem like the type of person I’d want to collaborate with. He comes off as abrasive, self-centered and thoughtless. It’s a shame he has to use the ideas and work of others to promote himself.

Follow Up: Aftermath

Married!

Posted by patorjk | Personal | Thursday 10 June 2010 1:07 am

My wife and I cutting our wedding cake

On Saturday I got married :) . The past couple of months have been a little hectic, though probably not as much for me as for my wife. I’ve had a lot of stuff going on and I do feel a little bad that this site has been put on hold a little bit. However, weddings are crazy and I had no idea how much energy goes into them (including this wedding, I’ve only ever been to 5 weddings – 4 of them have been in the past year and a half). Our wedding was held at the Engineer’s Club in Baltimore and there were 130-something attendees.

Since the wedding is now over, activity on this site will probably pick up some. I’ve been reading a lot of books in my spare time so I may do a few book reviews, however, I don’t want to turn this page into a book review site, so if I do go that route I’ll space them out somewhat.

Super Mario Bros Groom's Cake

Also, before I forget, my advice to anyone getting married soon would be this:

  • Wear comfortable shoes. My feet were killing me at the end of the night.
  • Dance lessons were well worth it. Take them!
  • Try to talk to everyone during dinner and don’t get stuck at one table.
  • If there’s some food you want, have someone get you some or have it set aside (I missed out on the delicious strawberry layer of our cake – and on the delicious pigs in a blanket finger food).
  • The day will be a lot of fun, don’t sweat it!

Lastly, the cake to the right was a groom’s cake that my bride had made for me :) . She gave them some pics of other Mario wedding cakes so it’s similar to them, but toned down since it was just for a rehearsal diner. Mario and Peach were a little pudgy, but I thought it was a really, really cool cake. At the time of its making I was kind of obsessed with the New Super Mario Bros game for the Wii, which is why she had it done.

“Pro JavaScript Design Patterns” Book Review

Posted by patorjk | Book Reviews | Tuesday 1 June 2010 1:03 am

Pro JavaScript Design Patterns

For a while I’ve been meaning to read a book on design patterns, which are ways to design and structure solutions to common problems in order to create efficient and optimal results. I missed a chance to take a course on them back in college when I took Cryptology instead, and have since been meaning to sit down and read up on what’s been developed and what can be useful to me. So it was to my happy surprise when I stumbled across Pro JavaScript Design Patterns in the book store a while back.

The book is broken into two parts. The first part explains how object oriented programming concepts work in JavaScript and how to implement the ones that aren’t built into the language, such as interfaces and private members. The second part of the book focuses on a common set of design patterns and how they can be implemented in JavaScript. It covers the following patterns, giving a chapter on each one: Singleton, Factory, Bridge, Composite, Facade, Adapter, Decorator, Flyweight, Proxy, Observer, Command and Chain of Responsibility.

Before I go any further, while I’m going to write a mostly positive review for this book, I should say that I initially tried to read it around 18 months ago, but stopped after I finished the first section. I re-read it from start to finish about 2 months ago. I stopped the first time I tried to read it because the book introduces a lot of ideas and I was a little confused on some of the concepts it touched on. Specifically, I was confused with how constructor functions worked and how a function’s prototype property worked. I got distracted trying to understand this and picked up another book and ended up not coming back to this book (it’s hard for me to get back into a book once I’ve set it down for a while). As for constructor functions and the prototype property, a good explanation of them can be found here.

I had better luck on my second read through and found the second half of the book to be an easy read. Though each chapter focuses on a different design pattern, some of them use patterns introduced in earlier chapters, so it’s actually a good idea to read the chapters in order. Each of these chapters starts by explaining the basic idea behind the pattern and then goes into a couple of real world examples of how the pattern is used. The chapters close by discussing the benefits and drawbacks of the pattern they introduced and some advice is given to help you identify situations where using the pattern would be a good idea.

Overall, I found this be to be extremely interesting. I could possibly have learned about the different design patterns by reading online tutorials, but being able to look at solutions in JavaScript was very helpful. Also, after reading certain chapters, I felt like going back and rewriting some of my old apps (though I’ll contain myself). Knowing about this collection of design patterns is a huge plus for me and for that alone I’m glad I read this book. I wouldn’t recommend this book to someone who doesn’t have a good understanding of prototypal inheritance, but if you feel like you do, this book is worth checking out. If you don’t, I would recommend looking up some design pattern tutorials online and trying to learn about the common patterns, you’ll be glad you did.

On a side note, I was also amazed at how many of these patterns I’d seen before. It certainly gave me a better appreciation for some of the code bases I’ve seen in the past. I also found that I used some of the patterns already unknowingly, but that I didn’t have a name for the technique I was using.

If I could go back in time I would still probably take that Cryptology class, but I would also try and read up on Design Patterns too. If you have a few extra minutes, it’s worth reading up on them.

Quiz App Release

Posted by patorjk | Web Apps | Thursday 18 March 2010 10:22 pm

I have a beta version of my quiz app ready, you can check it out at one of the following links:

  • Quiz Guide – Same page shown a few entries ago, except this time the link to the Tcl/Tk quiz works.
  • Tcl/Tk Quiz – My first programming quiz for the PK app. I still plan on adding more questions, though I felt it was important to get a beta version out.

Right now all I have ready is a Tcl/Tk quiz. I’m guessing 90% of the people who read this will have no idea what Tcl/Tk is, but it’s a fun little scripting language that pops up in a lot of different places. Even if you aren’t familiar with it, the quiz will give you a feel for what the others will look like. I’ve set things up so that the quizzes themselves are JSON files, and are read in and generated on the fly by a single PHP page. The URL is set up to look like a directory, but it gets rewritten and pointed towards the PHP page (which will currently display the Tcl quiz no matter what, even if the quiz directory isn’t tcl-tk-basics).

Results Page

The quiz engine is currently set up to track multiple variables, with one variable acting as the “correctness” value to determine if a question is right or wrong. However, using a correctness variable can be turned off. The ability to track more than one variable allows the quiz to track different types of answers and to measure more than one thing. At the end of the quiz you’re presented with a table showing how you did in the various areas the quiz measured. Tracking multiple variables is how I imagine those online-dating site quizzes to work (the ones that will tell you about your personality, etc). I figured I’d keep my app as flexible as possible in case I wanted to do more creative things with it (though I have no plans to get into the online dating site world, I just want a flexible app).

Right now there’s only one type of question (multiple choice), though I hope to add more in the future. You also don’t lose points for incorrect answers. I’m still not sure if I want to add that ability in.

Also, while searching for icons to use in this program I found some pretty good resources, so I figured I’d share them here:

If you have any suggestions for the quiz app please let me know. I don’t think I’ve wasted as much time on any other app fretting about things that people probably wont care about. The app was actually partially re-written a couple times this past month. There’s was an ExtJS version, a version that used HTML tag generation instead of createElement (I’m still not sure what’s best), and lots of stuff I kept taking out and putting back in. However, I figured it was best to post a version up before I got old and gray.

“Ext JS 3.0 Cookbook” Book Review

Posted by patorjk | Book Reviews | Monday 15 February 2010 2:34 am

Ext JS 3.0 Cookbook

Ext JS 3.0 Cookbook

Packt Publishing recently provided me with a copy of their new Ext JS book called Ext JS 3.0 Cookbook. The only thing they asked for in return was a review stating my opinion.

For those who don’t know, Ext JS is a JavaScript library aimed at helping developers create web applications with customizable user interface widgets. The library is known being sturdy and for letting users easily create eye-catching designs. However, unlike many other JavaScript libraries, Ext JS is licensed under the GPL by default. For people wanting to avoid the GPL, a commercial license can be purchased.

Ext JS 3.0 Cookbook is a book which has the goal of providing Ext JS users with a wide variety of techniques and code samples with which they can use in their development of web applications. The book is well written, has nicely formatted code samples (which are also available in a zip file – a URL to the file is given in the book), and contains a lot of interesting information. However, I wouldn’t recommend it to everyone, which I’ll get to in a moment.

Ext JS 3.0 Cookbook is divided into 10 chapters, with each chapter covering a different topic of the library. However, the book can really be thought of as one giant, categorized, FAQ guide on Ext JS. Each chapter contains a series of “recipes”. These recipes are specific tasks a developer might want to perform, for example: “Displaying remote data with a combo box” or “Creating a grid panel with expandable rows” or “Creating an auto-refreshing chart”.

The definition of each recipe follows a set pattern of 5 sections:

  • The problem is described.
  • “How to do it…” – Code for solving the problem is provided.
  • “How it works…” – An explanation is given on how the code works.
  • “There’s more…” – Additional, possibly useful, bits of information are provided.
  • “See also…” – Other topics are suggested as further reading.

Each of these sections is given its own heading, though some recipes omit a section when it isn’t needed. This makes the book well suited as a reference guide since you know what you’ll be getting when you look something up. However, even though the book starts off with some recipes on working with the DOM and with data types, it’s not a book for Ext JS beginners. If you’re a new comer to Ext JS, you’re better suited by a book like Learning Ext JS.

Ext JS 3.0 Cookbook is really for those Ext JS users who are past the beginner stage and want something on-hand that will help them accomplish tasks they may run into or help them find better solutions to problems they’ve already had. If you work with the Ext JS library as part of your job or use the library a lot, having this book around would probably be beneficial. It’s nicely put together and has a lot of useful information. However, if you’re just a casual user of the Ext JS library, you’d probably find more benefit from an introductory text on the library or from just browsing their online documentation.

Monk-E-God

Posted by patorjk | Personal | Monday 15 February 2010 2:21 am

Monk-E-God, one of the most prominent figures from the AOL add-on programming scene of the late 90’s, has died.

Initially someone emailed me about “Tom” dying and I had no idea who they were talking about. I’m really bad with names so I always feel a little bad when someone from that era emails me. However, I remembered the “moorpark” location they mentioned and a discussion about it at knk4life.com – and that’s when it hit me that they were talking about Monk-E-God. I remember talking with him at what I think was knk’s old forums (and possibly later GPX’s forums, though I can’t remember if he was a member of that forum) and checking out his work at knk’s website.

I wasn’t really close to the guy, but I remember him as being one of the best programmers from those days. He was one of those people who’s reputation preceded them, it’s really sad to hear he’s gone. Thinking about that era brings back a lot of memories. If it wasn’t for that community and those days on AOL, I wouldn’t have become the programmer I am today.

There’s some more information about him at the digitalgangster.com forums, including a neat story about him meeting the Olsen Twins.

App Interface Using ExtJS

Posted by patorjk | Web Apps | Sunday 7 February 2010 4:14 pm

Layout Demo

In the back of my mind I had been thinking about putting up some programming quizzes, similar to the ones I used to have on Visual Basic and C++. I was also thinking that it might be cool to have a quiz engine where users could create their own quizzes.

I’m not at that point yet, but this past weekend I decided to take the opportunity to try and learn ExtJS better and put together an interface for the app. You can see an image of the interface to the right or click here to see it in action. It’s pretty basic, but has all the functionality I think I’ll need for now.

The layout is broken into 3 sections. The top section is the header, to the left you can select quiz categories and get book recommendations, and on the right you get a list of quizzes. Hopefully the “Related Reading” panel doesn’t seem too commercial, as it was actually kind of fun to put together. I didn’t want to set myself up for having to write dozens of quizzes, so right now the interface only lists 3 quizzes (which I’ll hopefully have available soon).

Right now I’m in limbo about how complex I want this project to be. I’m not sure if I want users to be able to have accounts, and I’m not sure what data I’d want to store in a database. I’m also wondering if quizzes should be static html pages after they’re created. I’ll figure something out though.

Working with ExtJS was actually a lot of fun, and their online API documentation is fantastic. The library also seems to load rather quickly too. When I worked with Dojo, I was alarmed at the time the page took to load and how it looked while it loaded. I’m still a little bummed about the licensing for ExtJS, but I can live with certain things being GPL’d.

“JavaScript: The Good Parts” Book Review

Posted by patorjk | Book Reviews, JavaScript | Thursday 31 December 2009 5:08 pm

JavaScript: The Good Parts

JavaScript: The Good Parts

Last month I finished reading the short but densely packed JavaScript book JavaScript: The Good Parts.I had been looking for a book that would cover some of the pitfalls of the language more thoroughly than what I’d read about previously and when I saw this in the bookstore it seemed to fit the bill.

The thesis of the book is that JavaScript is a misunderstood language. It recognizes that there are bad parts to the language, but it contends that once you get past them there are some pretty nice good parts – and that by using only the good parts and avoiding the bad parts, you can write some really great code.

The book covers objects, functions, arrays, regular expressions, closure, and how inheritance works in JavaScript. The last one is probably the most important, since most people are only familiar with classical inheritance, and JavaScript’s prototypal inheritance, although wrapped in a syntax that makes it look classical, is very different. The book also discusses JavaScript’s bad parts and why you should avoid them.

Most of the concepts in the book are well explained, though I did find myself needing to re-read certain sections twice to completely understand the topic. This is in part because the book is very short, coming in at 153 pages (including the index). This is a double edged sword in that it allows you to take in a lot of material in a short amount of time, but sometimes you’re left wishing that a little more time was spent on a certain topic.

One other possible fault with the book (depending on how you look at things) is that it does not cover the DOM at all. The DOM isn’t part of the JavaScript language, but almost everyone who uses JavaScript will need to interact with the DOM. Therefore, this book is really more of a companion piece than a definitive reference for JavaScript programming.

Overall I really liked this book. It gives good coverage to some important topics regarding objects and functions, and gives a good explanation of prototypal inheritance. A lot of language quarks are also pointed out and explained. For example, one thing I didn’t realize was that the arguments array that is implicitly passed to functions isn’t a real array. It’s just an object with a length property. The appendix sections covering the “bad parts” and “awful parts” were also pretty interesting, though I disagree with the author that ++ and — are bad.

Anyway, I highly recommend the book if you’re into JavaScript programming. It’s a nice easy read that covers a lot of ground. Also, this is a non-solicited review, though the link above is an amazon referral link.

If you’re interested, the book’s author gave a one hour talk on this book that touches on a lot of its ideas. You can watch it here (actual talk starts at 2 minutes 15 seconds):

Merry Christmas and Happy Holidays!

Posted by patorjk | Introspective, Personal | Thursday 24 December 2009 10:08 pm

I’ve been bad about updating the past couple of months, I should have some interesting stories for next year though.

It’s been a pretty amazing year. I got engaged, bought a house, wrote a couple of new web apps, learned a lot about Tcl and JavaScript, visited Northern California (and then got stranded in Phoenix on my way back – due to the blizzard going on in Maryland), worked over 180 hours of overtime, and gained a lot of weight (the last one’s not a good thing, but it’ll give me a goal of losing weight for the new year).

I looked up my resolutions for this past year and I think I did ok. Here’s the list:

  • Get good at JavaScript: I feel like I’ve accomplished this one. There’s more for me to know, but I feel like I really know my way around the language.
  • Learn jQuery: Didn’t even look at it this year. There are a lot of cool JavaScript frameworks out there though. I’ll probably get around to learning jQuery at some point, but I don’t think knowing it is as important as I used to.
  • Develop More Web Apps: The Typing Speed Test, the HTML Canvas game, the Blog Stylometry Tool, and lots of updates to the Keyboard Layout Analyzer. I was sort of quiet near the end of the year, but I expect for things to pick up again here soon.
  • Read At Least 4 Programming Books: Learning Dojo, Learning ExtJS, JavaScript: The Good Parts, and Code: The Hidden Language of Computer Hardware and Software. JavaScript: The Good Parts and Learning ExtJS were the best of that group, and after thinking more about it, probably the only two I’d recommend from the list.
  • Join A Programming Community: I did not do this, unless you count my subscription to the Programming Sub-Reddit at reddit.com. I’ll give myself half credit here.
  • Write A WordPress Plug-In: I had a couple of ideas, but I lost interest.
  • Release Some Programming Examples: I still want to do this.

So I achieved 3.5 of my 7. Not too shabby, I feel like I accomplished what was important to me, and that’s probably better than meeting the goals I think up at the beginning of the year.

This probably wont be my last post of the year (I’ve got a book review coming), but I hope everyone out there has a great holiday and a happy new year!

Book Reviews Coming

Posted by patorjk | Book Reviews | Wednesday 18 November 2009 12:41 am

Ext JS 3.0 Cookbook

Ext JS 3.0 Cookbook

It’s been too long since I last updated. I didn’t intend to take such a long break from posting, but my life suddenly became really, really busy. In the somewhat near future I’m hoping to post some web-app updates, but I don’t want to state anything specific at the moment.

To finish the year off I have a couple of book reviews coming. Two unsolicited, and one at the request of Packt Publishing, who are providing me a copy of their new Ext JS book called Ext JS 3.0 Cookbook. I previously reviewed a book from them titled Learning Ext JS, which was pretty good. However, I didn’t end up doing much with Ext JS. My main concern was that I’d have to release the application under the GPL (using Ext JS in an application without buying a commercial Ext JS license causes the application’s source code to fall under the GPL, which is an open source license). Though I currently have a couple ideas in mind that I wouldn’t mind open sourcing, so this book may provide some interesting examples/ideas which I can polish them up with.

Also, Packt provided me with an affiliate link, so if you buy a Packt book after following the above link, I’ll get a small cut. I’ve noticed a lot of blogs seem to use affiliate links when doing reviews, however, I figured I’d make sure and state it just so you all know up front. This wont effect my review, but I figured it was worth stating for transparency reasons.

Playing Around With HTML5’s Canvas Element

Posted by patorjk | JavaScript, Web Apps | Sunday 6 September 2009 3:56 am

After reading up a on HTML5’s canvas element, I decided to re-tool the game I was working on to work inside of a canvas element. This was because the canvas element provides some great drawing functionality. You can resize, rotate, crop, position and alter the pixels of images you use on the canvas.

FireFox

FireFox Appears to Have the Best Support for the Canvas Element
Photo By M i x y

The game is still not done, however, I’ve uploaded another demo that shows the space ship and its main bad guy. You can use the arrow keys for movement and the “s” key to shoot. I changed the shoot key from the Space Bar to “s” because Opera was giving me issues when the Space Bar was pressed while the canvas had the focus.

Also, unlike last time, the game works best in FireFox, and basically sucks in everything else. Opera and Chrome can run the demo, but the frame rate is painfully slow. Since IE doesn’t support the canvas element yet, I’m using the JavaScript library Explorer Canvas to emulate it. Though you have to be using IE8 and be in “Quirks Mode” for it to work – and even then, the game is unplayably slow. Since the canvas element is part of the new standard, and one of its hyped uses is for creating games, I’m assuming / hoping that its performance is going to improve over the next couple of months in these browsers. However, since the canvas element is so cool, I’m still going to finish this game off even if it only works in FireFox.

For those of you interested in using the canvas element, Mozilla has a really good tutorial on it here, and there are some neat canvas game-themed tutorials here.

Lastly, and on a completely different note, I’ve written an update to the Is Someone Pretending To Be You Online? post I made a year ago. The update is at the bottom of the post and basically says the problem was due to a database error (which was a relief). I didn’t do an update right away since I didn’t want to embarrass the site owner.

Creating a JavaScript Space Ship Game

Posted by patorjk | JavaScript, Web Apps | Tuesday 25 August 2009 7:55 pm

“What would be something neat to do in JavaScript?” – I kept asking myself that on Saturday. My fiance was away for the weekend and I was just kind of hanging out at home with the dog. Eventually I ended up thinking about possibly trying to do a side scroller game, like Mario Bros or Commander Keen, but since I had never written one before, I wasn’t sure. Finally, I came to the conclusion that it might be wiser to go for something a little easier first, and decided it might be cool to port my old “Intergalactic Odyssey” space ship game to JavaScript.

Old Intergalactic Oddyssey Game

Old Intergalactic Oddyssey Game

My goals here were to just see how feasible it would be to create an action game with moving sprites. I didn’t get very far, but I was able to create a space ship that could fly around and shoot lasers. I was able to get the graphics by decompiling my old SWF Flash file (I’ve long lost the source to the game). Also, the space ship artwork was done by fitz. I originally found the space ship via Google Images, though I did ask before I used it.

So far the main issue I’ve run into is that IE and FireFox aren’t reliable for smooth game play. The demo works best in Google’s Chrome and Opera’s Opera web browser. Though at this point I haven’t added any collision detection in, or any bad guys in, so there’s still a ways to go before I know if I’ll have a playable game.

One thing I didn’t realize when I started was that I could rotate images. I googled for a little bit and didn’t come up with anything, so I wound up creating images for each of the different rotations of the space ship. Though now that I’ve read up on it a little more, image rotation can apparently be done with the Canvas object in FF, Opera and Chrome, and with filters in IE. I suppose I’ll find out later which method is faster.

Lastly, the key capturing events are a little frustrating, since JavaScript doesn’t appear to remember when someone is holding the Up-arrow down if another key is pressed while its down. I’m still trying to figure out if there’s a way to get around this.

If you have any tips/suggestions, feel free to let me know.

Next Page »