Apple’s credibility flashing by…

Apple released the Apple iPad last week. Other than a horrible name, I thought it was a great design and am very tempted to buy one. Three things I think will make this device:

  1. It’s thin, it’s lightweight, and looks good (hopefully they don’t break too easily)
  2. Battery life is up to 10 hours (we’ll have to see real-world numbers though)
  3. A simple, easy-to-use OS

But I wondered, what about Adobe Flash support? Jobs said that “you will be able to see the web as it actually is”. I figured I’d read about it in a few days. The answer was no. Jobs gave two reasons:

  1. Flash will eventually die and give way to HTML5
  2. Flash is one of the largest reasons why a Mac crashes. (Really? I thought a Mac doesn’t crash :() )

According to Adobe, 99% of all Internet-enabled desktops in mature markets as well as a wide range of devices have some version of Flash installed. While taking into account a little marketing tweeking, it is still used by the majority of everyday web users.

HTML5 is still being developed and accoring to Ian Hickson, editor of HTML5 specification, the expected W3C Candidate Recommendation stage will be in 2012 which means Microsoft will likely not pick it up until after then. So what are we going to do until then? Two choices. One being make the end-users see a broken flash placeholder or second being make and maintain two versions of your website. Neither are a good solution.

HTML5 is aimed at reducing the need for proprietary plug-in-based RIA technologies such as Adobe Flash, Microsoft Silverlight, and Sun JavaFX according to Wikipedia. HTML5 will introduce native 2D drawing, media playback, drag-and-drop, messaging and more. So does Jobs expect that everyone just drop the millions if not billions of Flash apps out on the Internet now and try to convert everything to HTML 5? Besides, flash is still rapidly evolving with new features and frameworks like Flex. It’s just not going to die, anytime remotely soon.

Right now Apple seems to have it out for Google. But Google did one thing right with their Chrome browser. They managed plugins that break. So if Flash crashed, only the specific block of the webpage would show a broken-flash placeholder and you could either reload and try again or go on to the rest of the webpage uninterrupted. So wouldn’t that be a little more reasonable solution for Apple? In Apple’s mobile browser, mimic this great Chrome feature and Jobs second reason would be void and the end-user would benefit greatly.

Jobs needs to step up and not hide behind whatever agenda he has against Adobe. So, I will probally wait to buy another competitor’s Tablet until Jobs can get in gear. Not to mention it’s limited to AT&T for 3G wireless service again. Ug.

Other resources:

 

Google phasing out support for IE6

As a programmer I’ve had to deal with Microsoft’s Internet Explorer 6 since, well… since it first came out. Non-standards driven, needing multiple hacks to make things show up right. It costs me frustration and time and the client time and money. But today is a good day. The big-wig of the Internet, Google, is stepping up and saying it’s had enough. According to cnet’s News site “As of March 1, Google will no longer support IE6 on its Google Docs and Google Sites services…”. Recently a flaw in IE6 was exploited and allowed access to Google’s network. Perhaps this will force a few more IE users to upgrade their browsers and make my and countles other developer’s life a little easier.

What people see on your webpage

For years I’ve done my best to explain to new designers, customers, or just people in general that it’s fairly hard to make a webpage look really good on your screen because everyone sees it differently depending upon your screen resolution. Then they ask what is screen resolution and just get lost. Give them 800×600, 1024×768, etc. and they just walk away muttering “geek” under their breath. Well Google has come to save the day once again. Thanks to my co-worker Jason for letting me know about this, check out http://browsersize.googlelabs.com. This will show you what the average percentage of viewers will see on your or someone else’s website with an overlay. You want to make visible what is important to the most amount of people right away without scrolling. This puts it into perspective. Enter your website address on top and check it out. A great design tool. Hint: If the website is centered, resize your browser window horizontally until only the main content section is left, otherwise you’ll see incorrect overlay.

Getting Rocketfish Keyboard to Work on Windows 7

I tried adding my bluetooth Rocketfish Keyboard to my new Windows 7 laptop this weekend using the Rocketfish USB dongle. My Rocketfish Bluetooth mouse added just fine. When adding via the Bluetooth dialog, I could see the keyboard – however when you add it it just tries to connect. Thanks to Technet’s social board I found the solution. When you go to add the device, right click on the keyboard icon and click on properties. In the servies tab, check the box that says Drivers for keyboard, mice, etc (HID). It now works great!

Script Injection Attack: Smoking Gun? from the CF Muse

The “ColdFusion Muse“, aka “My Boss”, has posted something I’d consider VERY important – this is a MUST read. This may save you frusteration, dollars, or more! He explains a potential vulnerability related to executing malicious code on your server without you knowing and can be very difficult to track down. After you read this, you may say duh – why didn’t I think of that? http://www.coldfusionmuse.com/index.cfm/2009/9/18/script.insertion.attack.vector

Query of Queries Select Top Alternative

For years I’ve never been aware of a method to return only so many rows to the ColdFusion memory space using dbtype=”query”. I’ve always just ran the query then limited it down the code with things like <cfoutput query=”q” maxrows=”1″>.

In a MSSQL query, you can limit the query like: SELECT TOP 1 FROM TABLE

This will not work with a query of queries.

Today I found a solution…

Move the maxrows attribute to the cfquery tag. For example: <cfquery name=”q” dbtype=”query” maxrows=”1″> will return only the first row back to the memory space.

EXT JS Designer Preview Finally Released

Awhile back when Ext 3.0 was still being built, I saw a video of an Ext JS designer, which looked similar to Flex Builder. I’ve been waiting its arival ever since.

Today they released a preview version that allows you to experiment with the designer interface and to explore how configs affect your layout. They say soon you will be able to build your application components using base Ext components and Certified user Extensions. The application is an Air App making it platform independent if you have Adobe Air installed for Windows, Linux, or Mac.

 

Securely Serving Files via CFContent

Let’s say you have an application requirement that uploads files to your web server and then lets your visitors either view or save them. They could be Documents, Spreadsheets, Photos, or anything else you can think of. However you want to be able to control who is able to access these files. How do you accomplish that with not allowing direct linking (ex. http://www.cfwebtools.com/files/xyz.docx)?

You can serve the files via a ColdFusion page. There are a few different methods to do this, and they really come down to MIME typing.

Option 1:
Allow the user to save or open any file.

<cfheader name="Content-Disposition" value="attachment; filename=""#getFileFromPath(filePath)#""">
<cfcontent file="#filePath#" type="application/octet-stream">

The cfheader of attachment and filename prompt the user to either save or externally open the document with the software and their computer. The client computer will determine which MIME type to use to associate with an application.

Option 2:

Allow the user to save or open only files with MIME types my server is aware of.

<cfset mimeType = getPageContext().getServletContext().getMimeType(filePath)>
<cfif IsDefined("mimeType")>
<cfheader name="Content-Disposition" value="attachment; filename=""#getFileFromPath(filePath)#""">
<cfcontent file="#filePath#" type="#mimeType#">
<cfelse>
This type of file is not supported.
</cfif>

Now – the MIME types supported are defined in your webserver, whether it’s IIS, Apache or other. Apache MIME types can be configured in the mime.types files in the httpd/conf directory. The getMimeTypes() method communicates with the web server and returns the associated MIME type for the file.

Now, be aware that there may be an issue with IIS communicating MIME types to ColdFusion on Windows 2K Server. I’ve had an application break using this method for additional types such as .docx extensions. I have not yet found a solution for it, and just use option #1 to work around it.

Option 3:
Allow the user to view supported types inside the browser such as MS Word documents and PDF files. If not supported in the browser, it will attempt to open the file externally.

<cfset mimeType = getPageContext().getServletContext().getMimeType(filePath)>
<cfif IsDefined("mimeType")>
<cfheader name="Content-Disposition" value="inline; filename=""#getFileFromPath(filePath)#""">
<cfcontent file="#filePath#" type="#mimeType#">
<cfelse>
This type of file is not supported.
</cfif>

You can also define the MIME type in the code by replacing the mimeType variable with the type such as “application/msword”.

Notice in the three examples I double up the quotes around the filename attribute in the cfheader tag. This resolves an issue that happens when you have spaces in the file name. Using no quotes will truncate the file name. Using double quotes will create an invalid tag. And using single quotes will just add single quotes to the file name. Therefore using doubled up (escaped) double quotes makes this work. Apparently in IE7 (and I’m assuming earlier versions) the spaces are converted into underscores (_). You could also use character codes (chr(34)) instead. Thanks to Ben Nadel for this solution.

These methods allow you to access any attached storage device on the server. Therefore you can save the files out of the web directory, making the file inaccessible without using your ColdFusion script. Imagine the possibilites like adding user authentication or IP restriction.

Additional resources:

Serving File Downloads with ColdFusion via Trunkful.com

Your Website – On YouTube?

At the risk of sounding outdated to some — I have found a brilliant way of combining a website and social media advertising. What if you could take your website – and squish it into YouTube? (betting you’re saying “huh?”).

BooneOakley has found a way. They where recently featured in the Adobe Edge Newsletter and have seen more than 400,000 view in a matter of weeks.

So how do they squish a website into YouTube medium? It starts out with a video clip that takes advantage of YouTube’s framework. This allows viewers to click links inside the video, just like a webpage. You are then taken to corresponding video, which tells you about what you just clicked on, or allows for deeper navigation.

What will people think of next? Check them out at http://www.booneoakley.com/

Shorthand ColdFusion Structs and Reserved Keywords

Today I attempted to create a struct in ColdFusion 8 via shorthand using the syntax:

<cfscript>
struct = {key1=val1,key2=val2};
</cfscript>

My case was creating a state list with abbreviation for keys and the state name as the value. However I have determined that not all key names can be used. If it is a reserved ColdFusion word, it may not work. For example “IN” and “OR”.

What I want:

<cfscript>
var strStates = {IN="Indiana",OR="Oregon",UT="Utah"};
</cfscript>

But that leaves me with an “Invalid CFML construct found…”.

So as a workaround I did this:

<cfscript>
var strStates = {UT="Utah"};
strStates["IN"] = "Indiana";
strStates["OR"] = "Oregon";
</cfscript>

So much for shorthand. Has anyone found a better solution for this?