Spore DRM Causes Creature Backlash

The creators of Spore tangled with the internet and got more than they asked for. Users around the world, ticked off about Spore’s DRM have began creating anti-DRM creatures to voice their opinions.

Read more from the original article.

Posted in Bad DRM, Programming | Tagged , , , , | Leave a comment

Easy Text Area Character Counter with Javascript

Have you ever wanted to add a character counter to a box of text on a web form, but didn’t want to get your hands dirty with all of the Javascript and programming that’s necessary to make it work? If you said yes, then start getting excited right now.

Recently, I had the need to create a character counter for some text areas on a web form. As many people have come to realize, most browsers don’t enforce a maxlength on text areas. To help handle this, I wrote a little script that finds maxlength attributes on textarea elements. Once they are found it ties the element to a function that will count the characters, and force cut offs if you require it.

Remember, you should always double check your lengths on the server side before you send the values off to wherever they may be going. People can disable Javascript on their browsers to get around the limits you set.

Check out the demo below:

Demonstration Form

Using the code is very simple. All you have to do is include the script into your document’s source, and then attach attributes to your textarea elements like this:

Example Code

<textarea name="fixlength" maxlength="300" lengthcut="true">your text here...</textarea>

You’ll notice two new attributes not usually placed on textarea elements: maxlength and lengthcut. The maxlength attribute makes the code display the character counter. If you add lengthcut="true" the maxlength will be enforced and will not allow users to type past the limit. Check out the full code example below…

Example Code

<form method="post" action="YourScriptHere.php">
<textarea name="getlength" maxlength="300" rows="5" cols="45">Demo Text. This field has a maxlength</textarea>
<textarea name="fixlength" maxlength="300" lengthcut="true" rows="5" cols="45">Demo Text. This field has a maxlength, and the length is enforced.</textarea>
<textarea name="nolength" rows="5" cols="45">This field has no maxlength.</textarea>
<input type="submit" value="Submit" />
</form> <script type="text/javascript" language="javascript" src="/scripts/charcount.js"></script>

Adding extra elements with Javascript on the fly after the page loads? No problem! Simply call the parseCharCounts(); method after your new textarea has been appended to the document. The script to make find then new textarea elements and handle them accordingly.

Ready to use it on your own pages? Download or copy the source now for free!

  • Right click and select to save, or click the link to view or copy the source
  • DOWNLOAD NOW: charcount.js

Posted in Javascript, Web Programming | Tagged , , , , , , , , , , , , | 33 Comments

Arby’s “Borrows” Pick 5 for $5.95 Generator?

A little over a year ago, taking a break from classes and working as a full time intern for my University I didn’t have a whole lot to do. One day during my lunch at Arby’s and noticed the paper tray. “Pick 5 for $5.95! Over 790 possible combinations!”, it said. Thinking to myself about the number of combinations, I decided to take up the challenge of randomly generated lunches and developed my own Arby’s Pick 5 for $5.95 Generator.

The Original Arby\'s Pick 5 for $5.95 Generator

The Original Arby’s Pick 5 for $5.95 Generator

It’s been sitting happily, hosted around my various sites over the past year. It was even mentioned in a Consumerist article about Arby’s recently. It doesn’t generally get too much traffic, but the usual traffic is about 7 or so people daily. Based on the keywords people use to find the site, many of them are realizing that Arby’s has clearly failed to post their 5 for $5.95 menu online. Because of this, the generator sits near the top of the results for a variety of “arby’s pick 5 menu” keyword searches. Recently it’s jumped a little and I just couldn’t figure out why… until today. I was browsing the news to see if something had been in there to make it jump, and then I checked the Arby’s website to see what was up. Much to my surprise, I discovered this fancy version of what looks a whole lot like the generator created a year ago!

Change the skin...

Change the skin…

...add a little pizzazz...

…add a little pizzazz…

...and we get the same result!

…and we get the same result!

Looks pretty similar, right? In my opinion, the best part is that their generator displays menu items which no longer are available on the pick 5 (can’t get Mozzarella sticks in my area) and show the price as $5.95 (when it’s $6.95 most places now). Their generator also has a few of the same quirks as my own, such as giving you multiple drinks or shakes. It also has the same sort of “slot machine” feel to it. To me it looks like Arby’s found an idea they liked and just sort of took it. Seems silly to me that this didn’t occur to them earlier. What else would you possibly do with a menu combination deal besides make a random generator out of it? Especially one that is entertaining and generally makes people hungry.

Posted in Marketing, Web Programming | Tagged , , , , , , , , , , , | Leave a comment

Because Oil Affects Everyone…

I came across this today and decided to post it. It doesn’t have anything to do with technology directly, but oil prices affect everyone and this was a painful flashback to how things used to be. I’m not trying to make any political statements here, I just found it interesting to look back.

Posted in Our World | Tagged , , , , , | Leave a comment

Arby’s Pick 5 Generator Featured in Consumerist!

I was reviewing my site data today, and it turns out that my old Arby’s Pick 5 for $5.95 Generator on my Purdue web space was hit 65 times on July 2nd, 2008. I thought this was really strange and probably a fluke or hits from robots or something. Much to my surprise, I found that I was linked a Consumerist article talking about rising prices in some Arby’s chains! Very cool, since Consumerist is a huge site. Thanks for the link!

Posted in Marketing | Tagged , , , | Leave a comment

JW Media Player

My buddy Joe Goble told me about JW Media Player today. It’s an open source flash media player suitable for playing a wide variety of online media. It could turn out to be a valuable tool for the internet radio idea I was tossing around before.

He also mentioned LyricWiki which has a slick web service for querying information about songs, artists, etc.

Thanks, Joe!

Posted in Media | Tagged , | Leave a comment

Streaming Audio on a Web Page

Last night I was considering¬†the posibility of creating an online radio, similar to Slacker or Pandora. After a little searching, I found a couple solutions…

First, I could create M3U files, and essentially link to MP3 files on a site. This is an okay solution, but it requires users to have some sort of 3rd party media player such as Windows Media Player, WinAmp, or some other solution installed. Not a favorite.

Another solution is that I could set up a Shoutcast stream. However, this takes a dedicated server and that isn’t something I pay for with my current hosting. All I get is web hosting with some database. Not sounding like a good solution.

Today I finally found an FAQ about creating a Javascript media player. Javascript can’t do it by itself, however, so there’s a free Flash control that does all the audio playback for you. It sounds like a very cool solution, and sounds like a great solution to creating a mostly platform independent Internet radio solution, purely through plain web hosting. Hopefully with some PHP to read my files, a database to keep track of them, and some PHP to dynamically feed me some track information through XML I can create a really slick online media player. I’d love to have album art, artist/album/track information, volume controls, and play/pause/skip buttons. We’ll see how it goes!

Posted in Media, Web Programming | Tagged , , , , , | 1 Comment


Hi, and welcome to CodeFromJames.com

I’m James, and this will primarily be a place for me to host my projects, portfolio, and possibly blog about technology a little.¬† I’ve taken a great interest in technology over the years, and have really settled on web development as my primary field.¬† Some technologies that I’ve used include…


  • PHP
  • ColdFusion
  • C#
  • Java
  • Javascript / AJAX
  • Visual Basic / Basic
  • C++


  • MySQL
  • SQL Server


  • CSS

I hope you enjoy the site, and find its contents useful.

Posted in Uncategorized | Tagged | 1 Comment