Quality Reads
Wednesday, December 12, 2007
ADOBE, Adobe, adobe...
Cheers,
Todd
PS - This information comes from a number of scatter sources so forgive any misinformation I might be spreading.
Friday, November 16, 2007
Pier Developer Blog Listing...
- Flex 3 SDK Development
- Dealing with Build Times in AIR
- Creating and using an mx_internal style Namespace
- Debugging Basics in Flex 3 (beta)
- Error Logging with AJAX
- HTML Reporting in AIR
Not all these posts are mine but most of them are.
Cheers,
Todd
Wednesday, November 07, 2007
The Gmail Upgrade Has Arrived...
I'm sure I'm missing a couple items but that's all I have to report for now. Hope you get to check it out soon!
Cheers,
Todd
Tuesday, November 06, 2007
Basecamp JS Injection
In case you can't figure out what you're looking at, thats a lightbox with an Iframe pointing to pierinc.tickspot.com. No, that's not a new feature for Basecamp that you missed out on. One of my colleagues, today, noted that he could enter HTML into the Todo list. Immediately, I was like uh-oh...I wonder if I can....out come the <script> tags. You can insert html script tags right into the Todo list and it doesn't get sanitized. A little scary if you use Basecamp for larger projects, perhaps with a developer you don't completely trust.
After a little inspection of the DOM and playing around, I "mashed up" tickspot, our time tracking application, with basecamp so I can kill two birds w/ one stone. Beyond the security risk, this could actually be kinda fun. Tossing anything I want onto my Basecamp page for easy access. I still think Basecamp is a great application but this a serious no no. I had higher expectation from the 37Signals folks than this (perhaps its a feature...lol).
Cheers,
Todd
PS-I don't have a picture of it but the first thing I did was animate all the <div> tags. I had them flying all around the page...great way to freak out your boss ;)
***Update***
37Signals Support responded with this message:
Basecamp intentionally allows HTML (and JavaScript) because many ofour
users find great value in being able to use that. We're fullyaware that this
allows for XSS attacks, but Basecamp is based on thenotion of trusted parties.
You should only allow people into thesystem that you believe won't hack your
system (just as you shouldonly invite people into your office that you don't
believe will stealfrom you). If your friend becomes a foe, you can revoke their
accountand change your login credentials. Just like you would simply not letthem
into your office.
If this was a public system, it would definitely be different. You can't
have a public forum today without carefully dealing with XSS issues.
In the 3+ years we've operated Basecamp, we've never had a single suchcase
occur, though. So it doesn't seem like it's a big problem. And I know many of
our customers would scream murder if we removed the option to use HTML in their
messages, as they've become accustomed toover the past 3+ years.
I'm not sure I total agree with the sentiment of leaving security up to your users but its certainly a refreshing change from the pervasive concept of the "low-trust" internet.
==>If you're into javascript...hack away!
Friday, November 02, 2007
Shakakai.com
- To aggregate all the content I'm generating over the web, be it blog posts, tweets, del.icio.us or digg tags, and a host of social website content.
- As an experiment into using Google as Content Delivery Network ( commonly referred to as a CDN)
There's a couple things I need to watch out for taking this approach:
- Accessibility - When building out the view, you need to actively review the accessibility of the markup you're using. Its very easy to blow off the standards when you're waist deep in JavaScript.
- Load Time - Minimize the amount of JS that gets loaded up front so the initial load time appears extra snappy. Then switch over to on-demand loading for any additional functionality (e.g. a "donate now" button)
Cheers,
Todd
Friday, October 26, 2007
The Developer Blog's Alive!
http://developers.pierinc.com/
Monday, October 01, 2007
Pier Interactive Developer Blog
Speaking of developer articles, was anyone else let down by the extremely basic tutorials up on the new Adobe Developer Connection? I know AIR is still technically "new" but Flex definitely isn't. Where's the Enterprise-grade development posts? --> http://developers.pierinc.com (that's right I plugged it twice, I'm shameless).
Cheers,
Todd
Friday, September 07, 2007
RIP CFDJ
The quality of their content aside, I'm a little surprised Adobe allowed this to happen. CFDJ was the premier ColdFusion publication and really the only one that comes to mind as I'm writing this article. Is this a reflection of Adobe's commitment to CF or just a fitting end to a subpar journal? I don't mean any offense to the authors of CFDJ. There's a long list of great reads from the journal, over the years, but lets face facts. Sys-Con's user experience is probably the worst of any website I'll admit to frequenting. Perhaps a new blog with a better format and design will fill its place (hint, hint). Check in with pierinc.com in the next week for all the info.
Cheers,
Todd
Sunday, August 26, 2007
Client-Side Error Logging
Since most developers would generally agree with my sentiment, why don't you see AJAX applications properly handling and logging client-side errors. The application that sticks out for me is Gmail. At least once a week I'll see a host of non-fatal errors pop up. Why? Can't errors that bubble up to the application scope be captured? Yes.
Be better than Google. Here's how:
var ErrorLogger = Class.create();
ErrorLogger.prototype = {
initialize: function(url, opts){
this.url = url;
this.active = true;
this.opts = opts;
window.onerror = this.onError.bind(this);
},
onError: function(msg, URI, line){
try{
if(this.active){
var body = 'URI=' + escape(URI) + '&line=' + line + '&msg=' + escape(msg) + '&brw=' + escape(Object.toJSON(Prototype.Browser)) + '&pv=' + escape(Prototype.Version);
if('onError' in this.opts)this.opts.onError.apply(this, arguments);
var opts = {
onSuccess : this.onSuccess.bind(this),
onFailure : this.onComplete,
postBody : body
};
new Ajax.Request(this.url, opts);
}
}catch(e){
this.onFailure();
}
return true;
},
onSuccess: function(){
if('onSuccess' in this.opts)this.opts.onSuccess.apply(this, arguments);
},
onFailure: function(){
this.active = false;
if('onFailure' in this.opts)this.opts.onFailure.apply(this, arguments);
}
};
What's it doing? Well, first off this is a Prototype Class so you need to include prototype.js in order to use it. Here's the breakdown:
- The window.onerror event is set to call ErrorLogger.onError. When an unhandled error bubbles up to the window scope, onError will be called to handle it.
- Three arguments are passed into the onError function ( msg, URI, line ) and an Ajax request with some additional browser information is constructed and posted to the URL specified in the constructor.
- Lastly, the onError function returns true so the browser knows to disregard the error.
When you click on the button labeled "Throw Error", the ErrorLogger class will gracefully handle the error and post some useful debug information to your server. From there you can do whatever you want. Personally, I just toss it in a log file that I monitor. All that in less than 1KB, not bad.
<html>
<head>
<title>Logger Test</title>
<script type="text/javascript" src="prototype.js"></script>
<script type="text/javascript" src="ErrorLogger.js"></script>
<script type="text/javascript">
var er;
var init = function(){
er = new ErrorLogger('TestResult.html',
{
onSuccess : function()
{
$('btn').setStyle({'backgroundColor' : 'red'});
},
onError : function()
{
alert('An error occurred on the page. Run for your life!');
}
});
};
</script>
</head>
<body onload="init()">
<button id="btn" onclick="nonExistentFunction()">Throw Error</button>
</body>
</html>
I've tested it on IE6/7 and FF2. Its definitely not production ready quite yet but I'll throw an update up with my final version in a day or two.
Cheers,
Todd
Thursday, August 23, 2007
Add A Blog Search Feed to Google Reader
Go to Google's Blog Search. Note the RSS/ATOM links on the side. Toss those in your Feed Reader and you're ready to go.
Oh, did I say this was difficult and time consuming? Definitely not.
Very useful? You know it.
Cheers,
Todd
PS - Depending on the search query, you may run into some spam. Play around w/ the advanced search options to get things working right.
Tuesday, August 21, 2007
Got Some Free Time?
Steer clear during work hours...lest your lose your whole day (which may or may not be a good thing).
:)
Cheers,
Todd
PS - AIR Tour on Friday in Boston.
Monday, August 13, 2007
Tuesday, August 07, 2007
Code Highlighting
If you're in the market for a code highlighter, I just ran into a good one that handles PHP, Java, Javascript, Perl, SQL, HTML, and CSS. To rock this on your blog/website, all you need to do is include the javascript source in you page header and add a textarea tag like so:
<textarea id="myCpWindow" class="codepress javascript linenumbers-off">
// your code here
</textarea>
Notice the language to be highlighted is included in the class declaration. There's a couple other useful features (such as copying code to the user's clipboard) that can be found here. To make life even easier, I've written up a quick ColdFusion custom tag to create the textarea declaration and include the appropriate content (sorry, non-CF users). Here's the code:
<CFSETTING enablecfoutputonly="true">
<CFIF ThisTag.ExecutionMode eq "Start">
<cfparam name="attributes.language" type="string"><!--- Language to Highlight --->
<cfparam name="attributes.file" type="string"><!--- relative file path --->
<cfparam name="attributes.readOnly" type="boolean" default="false">
<cfparam name="attributes.lineNumbers" type="boolean" default="true">
<cfparam name="attributes.autoComplete" type="boolean" default="false">
<cfset attriList = "language,file,readOnly,lineNumbers,autoComplete">
<cfset attriKey = StructKeyList(attributes)>
<CFTRY>
<CFFILE action="read"
file="#ExpandPath(attributes.file)#"
variable="fileResult">
<CFCATCH type="any">
<CFTHROW detail="Double check the file location. The error occurred trying reading the specified filed.">
</CFCATCH>
</CFTRY>
<CFOUTPUT><textarea class='codepress</CFOUTPUT>
<CFIF attributes.readOnly><CFOUTPUT> readonly-on </CFOUTPUT></CFIF>
<CFIF NOT attributes.lineNumbers><CFOUTPUT> linenumbers-off </CFOUTPUT></CFIF>
<CFIF NOT attributes.autoComplete><CFOUTPUT> autocomplete-off </CFOUTPUT></CFIF>
<CFOUTPUT>'</CFOUTPUT>
<CFLOOP from="1" to="#ListLen(attriKey)#" index="aIndex">
<CFIF NOT ListFindNoCase(attriList, ListGetAt(attriKey,aIndex))>
<CFOUTPUT> #ListGetAt(attriKey,aIndex)#='#attributes[ListGetAt(attriKey,aIndex)]#' </CFOUTPUT>
</CFIF>
</CFLOOP>
<CFOUTPUT>>#fileResult#</textarea></CFOUTPUT>
</CFIF>
<CFSETTING enablecfoutputonly="false">
You can use the tag like so:
<cf_syntaxify <-- whatever you name the tag -->
language="ColdFusion"
file="test.cfm"
id="testID" />
Any attribute you define in the tag that is not param'ed at the top of the custom tag will be passed onto the <textarea> tag. Note the id attribute in the above example.
There are a couple other code highlighters available, most notably the one released by Google, but the simplicity of CodePress is immediately apparent once you check out the docs. Let me know if you run into any problems w/ the custom tag (I haven't tested it extensively yet).
Cheers,
Todd
Friday, August 03, 2007
The Cross-Over Point AKA FU Money
Have a great weekend.
Cheers,
Todd
CF8 Logos...
Rey Bango just posted a bunch of CF8 logos. If you're working on a ColdFusion 8 powered project (I know I am), then you may want to snag one of these. I'm hoping to have some info on my *hush* *hush* AIR derby project by Monday.
Cheers,
Todd
Saturday, July 28, 2007
Ning :: Full Source Access
http://www.ning.com/help/faq-developers.html
Perhaps I'm blurring the truth a little bit. Ning doesn't really provide an "API" like other web applications, they've created an application layer that ANY community user can edit. Their API is exposed via PHP, a very untraditional approach to open development that begs the question: if Ning can do it, why can't you? or me? or Google?
If you could provide all your company's information/resources in a system like Ning, would you?
Thursday, July 26, 2007
Drag & Drop in AIR
Here's a simple test application you can use to get started:
<?xml version="1.0" encoding="utf-8"?>
<mx:WindowedApplication xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" creationComplete="init(event)">
<mx:Script>
<![CDATA[
import mx.events.DragEvent;
import flash.desktop.DragManager;
import flash.desktop.DragActions;
import flash.events.NativeDragEvent;
import flash.desktop.TransferableFormats;
import flash.filesystem.File;
private function init(e:Event):void
{
//add the event handlers
this.addEventListener(NativeDragEvent.NATIVE_DRAG_ENTER, onEnter);
dropPanel.addEventListener(NativeDragEvent.NATIVE_DRAG_DROP, onDrop);
}
public function onEnter(event:NativeDragEvent):void
{
//Check to see if the drag item is the right format
if(event.transferable.hasFormat(TransferableFormats.FILE_LIST_FORMAT))
{
DragManager.acceptDragDrop(dropPanel);
}
}
public function onDrop(event:NativeDragEvent):void{
trace("dropped");
// Cast the drag & drop data as an array
var files:Array = event.clipboard.dataForFormat(flash.desktop.ClipboardFormats.FILE_LIST_FORMAT) as Array;
for each (var f:File in files)
{
// check out the file URL
trace(f.url);
}
}
]]>
</mx:Script>
<mx:Panel id="dropPanel"
top="10"
left="10"
height="100"
width="100"
title="Drop Files Here"
backgroundColor="#FFF">
</mx:Panel>
</mx:WindowedApplication>
Also worth a read: http://coenraets.org/blog/2007/06/air-to-desktop-drag-and-drop-two-simple-utility-classes/
I'll let you know why I'm reading up on D&D in a couple days :)
Cheers,
Todd
***Updated for AIR Beta 2***
Sunday, July 22, 2007
CT-CFUG Presentation
Just a quick heads up. JB and I are giving a presentation on Adobe AIR at the Connecticut ColdFusion User Group on Tuesday night (July 24th, 2007). If you're in the area and up on technology, you might want to think about stopping in for our jam session. I hear there's going to be some free Adobe swag in it.Cheers,
Todd
Thursday, July 19, 2007
Nokia Didn't See This Use Case Coming
Its a good thing they missed the call.
(Thanks Adam)
Bubblemark Animation Test Confirms It
Here are a couple surprises:
- JavaFX is 4.4 times slower than Flash.
- Firefox + Silverlight (CLR) — 99 fps
- Flex and AIR peform at the same speed (as I previous reported)
Check out the complete results here.
PS- I also enjoyed reading Alexey's initial experiences w/ Flex. I distinctly remember dealing with each one of the issues he mentioned. Good times.