Government Punches Google In The Face

February 28, 2006 | 1 Comment

punch.jpgBless Google. It seems that our handy-dandy Bush Administration wants to be able to sift through the data Google collects on users’ search results. According to Yahoo News, Google doesn’t like that much. Google says - and I’d have to agree with them - that providing that information is a violation of privacy rights. The article states:

The 18-page brief filed Friday argues that because the information provided would not identify or be traceable to specific users, privacy rights would not be violated.

[...]

The department believes the information will help revive an online child protection law that has been blocked by the
U.S. Supreme Court. By showing the wide variety of Web sites that people find through search engines, the government hopes to prove Internet filters are not strong enough to prevent children from viewing pornography and other inappropriate material online.

While the reasoning seems to be fueled by good intentions…it also seems like the government is trying to weasle in to get a hold of data that they could turn around and use for other purposes. Yay. The government gets an inch, they’ll stretch it a mile. Lets hope things go Google’s way come the hearing March 13th.

PNG Transparency in Internet Explorer

February 28, 2006 | 13 Comments

code.gifI teach a Multimedia class at Plymouth State University. This week we were discussing the pros and cons on the use of PNGs. I mentioned that Internet Explorer versions 6 and lower fail to render the transparency of a PNG properly, placing white background in the transparency’s place. I also took the time to plug Firefox, mentioning that Firefox does it right!

Well, one of my students, Brendan Emery sent along this fix for PNG transparency in Internet Explorer, thus refuting my biggest con on PNG use! (honestly, I can’t think of any other cons)

[This is] a JavaScript-based PNG fix for Internet Explorer 5.5 and 6 on Windows. The fix allows IE to properly render PNG alpha transparency. [...]

Why only versions 5.5 & 6? Because Windows IE versions prior to 5.5 do not support the filter which fixes the PNG problem, and version 7 (not yet released at the time of writing in January 2006) is reported to have fixed the issue entirely.

The code can be used either by a one-time copy-and-paste or as an include file. The entire thing is completely ignored by all other browsers - in fact it is treated as an HTML comment - thanks to IE’s conditional comments. This solution is therefore light, portable and non-invasive to other browsers.

Multimedia - Images, Color & Web 2.0

February 28, 2006 | Leave a Comment

We are covering a lot of topics today and thus our slides may bleed over into next week. We’ll begin with Images & Color. Then move on in to Web 2.0, which we’ve talked about in the past.

Google Calendar Coming Down the Pipe

February 26, 2006 | 2 Comments

googlecl2.gif I knew it was coming, but when will it get here? I’m talking about Google’s Calendar a.k.a. Google CL2. It seems as if the calendar may come sooner than later, as google is leaving bread crumbs hanging around that point in the direction of a calendar app. Here’s a blurb from PaulStone.net (where I first read about this sweet news):

I can’t see the links show up in Gmail itself yet, but if you go http://mail.google.com/mail/?view=barc you can select which links to show. And when you go to the calendar url (http://www.google.com/cl2/) it gives you the login box, but if you try to login it gives you an invalid request page.

I’ve no clue what Google CL2 has in store, but I’m hoping for something on par with Zimbra’s integrated calendar. I speculate that it will be hand-in-hand with Gmail, it will be Ajaxified, and I can only hope it has RSS features. Just another sweet tool to be added to Google’s list of services!

Must Have Extensions For Firefox

February 24, 2006 | 8 Comments

firefox-logo.jpgAs many well know, I am a huge advocate for Firefox. As a user, I like it for a few reasons; its consistent across platforms, tabbed browsing, fairly secure, skinable, and last but not least…extensibile.

The extensibility of the god of browsers is where things really shine for me as a developer…a web application developer. There are two that I use religiously for Javascript debugging, DOM inspecting, CSS tweaking, source viewing, Ajax calls, etc. Here they are. Get them. Use them. You’ll crap your pants.

Web Developer - get it here.

web_developer-1.jpgThe Web Developer extension adds a menu and a toolbar to the browser with various web developer tools. It is designed for Firefox, Flock, Mozilla and Seamonkey, and will run on any platform that these browsers support including Windows, Mac OS X and Linux.

Firebug - get it here.

firebug-2.jpgFireBug is a new tool that aids with debugging Javascript, DHTML, and Ajax. It is like a combination of the Javascript Console, DOM Inspector, and a command line Javascript interpreter.

Other fun features:

* XMLHttpRequest Spy - Ever wonder what all them newfangled Ajax websites are up to? Watch the requests fly by in the console!

* One web page, one console - Tired of slogging through a zillion errors in the JavaScript Console trying to find the one you want? The FireBug console is built into the bottom of the browser, and only shows you errors and log messages that came from the page you’re looking at.

* JavaScript Error Status Bar Indicator - It’s a sin that Firefox doesn’t include this by default, like IE does. When there is an error in the page, the status bar will let you know with a big red blob.

* Logging for web pages - Sick and tired of “alert debugging”? Jealous of all your C programmer buddies with their fancy printf? Now you can log text and objects to the FireBug console from any web page. See my website for more info on this.

[etc]

And obviously…if you don’t have FireFox (tsk tsk), get it here:

Object Oriented JavaScript

February 23, 2006 | 6 Comments

javascript.gifJavascript has invaded my life. And I like it.

I have developed web applications for quite some time, writing Javascript off an often unnecessary tool that simply added frills. Over the course of this year - with the birth of the Ajax hype - I realize my error. I began inserting javascript all over hell's half acre and raving about its sweetness. I've grown in a year.

As I develop more javascript-rich web applications for my amusement and my job, I am constantly seeking better ways to structure both data and code. It wasn't until a month ago that I really began to dig into the Prototype and Script.aculo.us code (rather than simply using it) and began to grow aware of what was actually going on. Object Oriented Javascript.

I think it is important to note (so I don't look like a complete nitwit) that I was aware that Javascript had this capability a couple of months back before I picked up and started using the afore mentioned Javascript libraries...I just had no drive to learn it and spot where it was being used. I have seen the light and it is good.

What are its benefits? Well, pretty much the same applies to Javascript that applies to any other programming language...OOP helps increase organization and reduce un-needed redundancy. And best of all? It helps prevent dual-declared functions and variables. That is the reason I chose to begin my quest for OO-JS familiarity.

I had gone hunting at a few other sites that claimed to be good references (obviously) of OO-JS, but they lacked the topic of inheritance, which is the real strength of any OOP Language. The most helpful article I found on the topic was at WebReference. They discuss the use of prototype (Not the Javascript Library). Here's a quick excerpt, but I'd suggest you read the article for yourself!

Excerpt from WebReference

JavaScript:
  1. function Person() {
  2.       this.name = "Rob Roberson";
  3.       this.age = 31;
  4. }
  5.  
  6. function Employee() {
  7.       this.dept = "HR";
  8.       this.manager = "John Johnson";
  9. }
  10.  
  11. Employee.prototype = new Person();
  12.  
  13. var Ken = new Employee();

Ken is in the prototype chain of Employee, Person, and Object.

Check it out. Use it. You'll like it. You're applications will like it. Oh, and it may prove useful to check out some Javascript Coding Conventions.

Multimedia - Web 2.0

February 23, 2006 | Leave a Comment

web2.jpgO'Reilly has a document on "What is Web 2.0?". For class on Tuesday, please read the article as it really encapsulates the movement in web application design/architecture.

The important topics discussed are:

  • Web as a Platform
  • Harnessing Collective Intelligence
  • Data is the Next Intel Inside
  • End of the Software Release Cycle
  • Lightweight Programming Models
  • Software Above the Level of a Single Device
  • Rich User Experiences

Of particular note is the comparison between a Web 1.0/Web 2.0 comparisons:

Web 1.0 Web 2.0
DoubleClick --> Google AdSense
Ofoto --> Flickr
Akamai --> BitTorrent
mp3.com --> Napster
Britannica Online --> Wikipedia
personal websites --> blogging
evite --> upcoming.org and EVDB
domain name speculation --> search engine optimization
page views --> cost per click
screen scraping --> web services
publishing --> participation
content management systems --> wikis
directories (taxonomy) --> tagging ("folksonomy")
stickiness --> syndication

Multimedia - Image Lab

February 23, 2006 | Leave a Comment

In this lab we will be using Adobe Photoshop Elements to create and edit images. Images are often a large part of multimedia production, thus having a decent understanding of them is important. This lab will consist of 3 parts:

  1. Watching videos on some basic tools and menus & creation of images
  2. Creation of two additional images
  3. Do 3 write-ups. One on JPEG, one on GIF, and one on PNG; explaining quality, where they are best used, and any features the file types may have (i.e. transparency, motion, etc).

To Open Photoshop Elements: Click the Start Menu > All Programs > Classes > Multimedia > Adobe Photoshop Elements 3.0

Videos on some basic tools and menus
These videos are from Photoshop Elements User and are hugely more useful than reading step by step instructions on the various tools. They take some time to watch so you may have to watch them throughout lab as well as on your own time (in order to complete the second and third parts). I would urge you to watch a video, then try doing what it is discussing before moving to the next video.

Here are the ones I want you to watch for this lab (you can watch more if you want to learn more cool stuff):

  1. Interface
  2. Layers, Part I
  3. Change Colors
  4. Cookie Cutter
  5. Photo Filter

Image Creation from Tutorials
For videos 2 through 5, make one image using the techniques explained. Document what you used to create the image (layering, any filters used, etc) Save the image as an appropriate file type (jpg/gif/png) and explain your choice in file type.

Additional Image Creation - Image 1
The first image I want you to create from scratch is either a sweet banner image for a website or a fake advertisement. Document what you used to create the image (layering, any filters used, etc) Save the image as an appropriate file type (jpg/gif/png) and explain your choice in file type.

Additional Image Creation - Image 2
Create a humorous image using certain features available in Photoshop. Be creative :) Document what you used to create the image (E.g. various filters, smudge tool, clone tool etc. (use at least 5 tools)). Save the image as an appropriate file type (jpg/gif/png) and explain your choice in file type.

Documenting your steps
To document each image and do any write-ups I've asked, simply use a single Word document and separate the separate parts using appropriate headings.

Turning it all in
Zip up your life's work and (the images and document) and upload them to WebCT. Lab is due Next Friday @ midnight (so Saturday morning, 12am)

Prototype Makes Javascript Painless

February 22, 2006 | 15 Comments

prototype.gifPrototype is an excellent tool but lacking in documentation, causing me to fumble around and *gasp* look at the source code. As any developer knows, when reviewing code there is a chance that you may miss something or ignore what doesn't seem interesting. In doing so, you may miss some sweet features that you would otherwise use.

I did stumble upon some Prototype Cheat Sheets that have helped immensely in exposing functions that existed in Prototype that I had no clue were there. Desipte the exposure of function names, I was at a loss for what some of them did. Luckily, there is an article over at SergioPeriera.com that documents many of those functions! The documentation is fairly solid so I HIGHLY reccommend checking it out. Here's one of the features of Prototype that I had seen the function but hadn't a firm understanding on what it did:

Try.these()
Tries a number of functions in order. If the first fails, it attempts the second, and so on.

JavaScript:
  1. function getXmlNodeValue(xmlNode){
  2.     return Try.these(
  3.         function() {return xmlNode.text;},
  4.         function() {return xmlNode.textContent;)
  5.         );
  6. }

Hugely cool. In addition, Ajaxian - which seems to be my source for many things Ajax - has pointed me towards this article over at SitePoint. I was aware of a number of the points mentioned in that SitePoint article, but a few stood out as super sexy. Here's the juicy tidbits:

String.times([something])
Prototype adds a great method to Number, too. Say goodbye to your for loops!

JavaScript:
  1. // alerts "1", "2", "3" ... "50"
  2. (50).times(function(n) { alert(n); });

Enumberable.each([something])
This does the same as a foreach in PHP. I've been looking for something like this!

JavaScript:
  1. // alerts "a is at 0" then "b is at 1" then "c is at 2"
  2. ["a", "b", "c"].each(function(item, index) {
  3.  alert(item + " is at " + index);
  4. });

Iterating over childNodes in the DOM
By default, even though nodes are represented in Array-like form, they do not have Enumerable available to them automatically. Here's how to do it:

JavaScript:
  1. // add Enumerable to childNodes
  2. var children = $A($("mydiv").childNodes);
  3.  
  4. // sets class="highlighted" for all child nodes of "mydiv"
  5. children.each(function(child) {
  6.  child.setAttribute("class", "highlighted");
  7. });

Here's one I found while digging around in the Prototype code that the article solidified my understanding:

Ajax.PeriodicalUpdater(id,file,options)
Periodically does an Ajax.Updater call!

JavaScript:
  1. new Ajax.PeriodicalUpdater("mydiv", "hello.php", {
  2.  // initial number of seconds interval between calls
  3.  frequency : 1,
  4.  decay : 2
  5. });

The decay option allows you to give your server a bit of a break if it's returning a lot of identical responses. Essentially, every time PeriodicalUpdater makes a request, it compares the results with what the server returned last time. If the values are the same, it multiplies the interval by the decay value. So, for the above example, it would make the next request two seconds later, then four seconds later, and so on, until it received a different result from the server. At that point, the interval would be reset to one second.

Ajax.Responders.register(options)
Register global event handlers that are triggered for each and every AJAX request that happens on the page.

JavaScript:
  1. Ajax.Responders.register({
  2.  onCreate : showLoader,
  3.  onComplete : hideLoader
  4. });

Prototype Cheat Sheets

February 20, 2006 | 98 Comments

prototype.gifThe guys over at Ajaxian alerted me to this sweet resource. Jonathan Snook has created a graphical (and quite attractive) Prototype cheat sheet.

As I have stated in the past, I develop web applications for Plymouth State using the Scriptaculous which is built on top of Prototype Javascript Framework. I often find myself referring back to the Scriptaculous Wiki to simply help me remember a function name of a Prototype object. Well, the cheat sheet that Jonathan has created will now live on my wall for those quick references! If you are an avid user of Prototype, check these suckers out.

Oracle’s Auto Incrementing with Sequences

February 17, 2006 | 6 Comments

My previous post, titled: 'Sequence-less/Trigger-less Oracle Auto Increment' was shot out of the water by my friend and DBA, Jon Emmons. Glad to see that I can be kept in line.

So I have resigned to use Oracle Sequences as a safer means for auto incrementing. But that doesn't mean that I like it. Here's what needs to be done to implement auto_incrementing with Oracle:

First, create a sequence:

CREATE SEQUENCE sweet_incrementing INCREMENT BY 1 START WITH 1;

Next write your statement:

INSERT INTO table (id,name) VALUES (sweet_incrementing.NextVal,'bork');

Now at a second glance, this statement looks much cleaner than my first attempt at subverting the system. However, the fact that you need to create a whole new sequence for each table you wish to have an auto incrementer is pretty stupid when compared to MySQL's plan of attack. In MySQL you can simply mark a column as a auto_increment during table creation and you're good to go!

Sequence-less/Trigger-less Oracle Auto Increment

February 16, 2006 | 11 Comments

Oracle sucks. Well, not totally, but it fails in a lot of places where MySQL is sexy. One little gem of an irritation is the lack of an auto_increment attribute associated with fields. Instead you have to make use of Oracle Sequences/Triggers which adds a whole layer of complexity on the creation and insertion into a simple table.

I'm not quite sure on this statement's efficiency, but here's my solution:

INSERT INTO table (id,name) (SELECT CASE WHEN MAX(id) IS NULL THEN 1 ELSE MAX(id)+1 END, 'bork' FROM table);

EDIT: It seems that this isn't such a good idea, after help from my friendly neighborhood DBA.

Multimedia - Compression

February 16, 2006 | Leave a Comment

Today we'll be discussing Compression. Here are the slides.

Here's the assignment for this week. Its due next Friday at midnight!

Next Tuesday: Quiz (everything we've covered thus far)

Power of the Crystal

February 14, 2006 | 3 Comments

crystal_sequel_kira.jpg Randy over at Optimal Stupidity posted something that excites me as a geek and movie lover. It seems that the Jim Henson Company will be making a sequal to "The Dark Crystal," a wonderfully done puppet/muppet movie from the 80's. Randy states:

The movie entitled Power of the Dark Crystal is now on my must see list for 2007. I encourage you all to take a break from the digital effects hype and see the stuff that started the imaginations of millions when I was growing up.

Yeah...this movie will definately find its way to my must see list next year.

Multimedia - Security Fair

February 14, 2006 | Leave a Comment

Folks, official lecture time today is cancelled due to the Security Fair, which is being held in the HUB MPR Room.

This is a collaborative effort among ITS students, staff, University Police and others. The event will include information on firewalls, backing up, phishing, virus protection, safe computing, wireless security, file sharing, password management and much more. There are prizes and give-a-ways.

Because of this, we will NOT be meeting in Memorial for lab on Thursday, but in Rounds for our normal class time at which point we will be discussing Compression. To prepare for that class, please read the following: How Compression Works. The Compression lab will be a take home assignment rather than an in-class lab.

Next Page »