Showing posts with label ajax. Show all posts
Showing posts with label ajax. Show all posts

Monday, March 24, 2008

Why I Write Code instead of Watching NCAA hoops

I’d rather be building elastic and RESTful Ajax applications on the cloud.

Go Cougs. Beat UNC (my wife's alma mater... Miami University in Oxford Ohio didn't make it this year, unfortunately).

Saturday, February 09, 2008

Language-Specific VM's as a Google Gear?

Has Google Gears or Adobe AIR team considered adapters to language-specific VM's? E.g. client side VM's (for instance, like Rubinius) hooking up to the Gears runtime? The idea being that if you could hook up to a VM running on the client, it could be used to interpret the implementation-specific code -- E.g. a Rubinius VM running on someone's machine, when hooked to Gears, could enable Ruby code/ or ERB in a page in the offline cache, to be successfully interpreted on top of Gears. The VM an individual chose to install would be a separate install outside of the Gears runtime, but would need an api to connect to the Gears runtime.

Wanted to throw out the idea and appreciate any response-
holtonma (at) gmail (dot) com

Sunday, December 30, 2007

favorite programming books!


...below is a snapshot of some of these I am reading now, some I have read more than once... continue to find all of them very useful.

Just finished an awesome Ruby class at the University of Washington taught by Ryan 'Zenspider' Davis, which was phenomenal, learned a ton. Starting the 3 month Rails class next week at UW... as you can see from the books, trying to surround myself with as much Ruby and Rails information as possible, while also studying the finer points of web application development with RESTful web development, RegEx techniques, high performance techniques from Steve Souders' book (Souders was the YSlow creator while he was the Chief Performance Yahoo!), etc , and as always, lots of Ajax. There are a few books left out of this pic, as they are at work, but they would be the "Javascript: The Definitive Guide", and "Prototype and Scriptaculous In Action".

  • Crane, et al, Ajax in Practice
  • Porteneuve, Prototype and script.aculo.us You Never Knew JavaScript Could do This!
  • Friedl, Mastering Regular Expressions
  • Souders, High Performance Web Sites
  • Hunt, Thomas, The Pragmatic Programmer
  • Cederholm, Bulletproof Web Design
  • Resig, Pro JavaScript Techniques
  • Thomas, DHH, Agile Web Development with Rails
  • Thomas, Programming Ruby (aka PixAxe book)
  • Berube, Practical Ruby Gems
  • Crane, Prototype and Scriptaculous In Action
  • Flanagan, Javascript: The Definitive Guide

Wednesday, September 19, 2007

UOOJ Development -- It's Huge! (pronounced "Yooooge")

Been doing a ton of JavaScript development over the past 3 years, more and more hardcore the last 18 mos, and loving every minute of it. This (obviously) involves Ajax development, along with other client-side development -- basically engineering User Interfaces in ways that make them responsive to users, fast, user friendly, lighten the load on server bandwidth required, and keeping code maintainable and extensible.

Throughout that time I have gravitated towards Unobtrusive Object Oriented JavaScript development. There is no better way to go in JavaScript development, as it presents a good challenge which results in a great payoff in terms of separation of concerns, code re-usability, keeping things DRY, among other things. Unobtrusive Object Oriented JavaScript is professional JavaScript development imo, and mainly involves creating re-usable client side JavaScript objects, with the key distinction being that you write your code while keeping JavaScript completely separated from HTML, also writing the web application so that it will work when JavaScript is turned on or off (defaulting to traditional Form submits unless encountering return false;, etc). You can do this through attaching events to DOM elements at runtime with Event observers, or after elements have been created on Ajax callbacks, for instance. I won't get too into detail, just want to spread the word to those interested in Ajax development, you should certainly look into some of the following links to help you get started:

Crockford:
http://javascript.crockford.com/prototypal.html
http://javascript.crockford.com/javascript.html
http://javascript.crockford.com/private.html

Prototype related UOOJ links:
http://prototypejs.org/api/event/observe
http://prototypejs.org/api/class/create
http://www.prototypejs.org/api/function
http://alternateidea.com/blog/articles/2006/05/23/prototype-inheritance-madness

jQuery Events/ready:
http://docs.jquery.com/Events/ready#fn

some Scope articles:
http://www.digital-web.com/articles/scope_in_javascript/
http://www.jibbering.com/faq/faq_notes/closures.html

... the side point of this blog post is to coin the acronym UOOJ! (pronounced "Yoooge"! or "huge" with the "h" being silent). While SMS-ing my good Agile buddy back in Cincinnati, Paul Spencer, (who I like to call the "Agile Guru") I was remarking about how much I am loving unobtrusive object oriented development and he replied "UOOJ!". So the credit goes to him -- great acronym. UOOJ Development!

Thursday, August 23, 2007

memcached

Check out memcached, if you're into researching ways of making your web apps speedy through clever database caching. (used by LiveJournal, Slashdot, Wikipedia, SourceForge). Very very cool.

By having your app first check the memcache instead of going to the database directly, you reduce the overhead that is inherent with ACID properties in relational database management system transactions. --as I understand it from reading about it on a few sites, by hashing database records in a cache reading from that hash where possible and updating the hash when that data is not available, you end up greatly reducing the demand on the database.

Makes me excited to think about the possibilities of an upcoming RESTful Rails app deployed on an clustered Ubuntu instance on EC2, utilizing memcached, that is Gears-enabled for offline capability as well... whoops, I wandered off...

Here's some info on memcached. I'm going to definitely check it out and try to implement:

memcached is a high-performance, distributed memory object caching system, generic in nature, but intended for use in speeding up dynamic web applications by alleviating database load.

http://www.danga.com/memcached/

http://www.deveiate.org/projects/RMemCache/


http://nubyonrails.com/articles/2006/08/17/memcached-basics-for-rails

Wednesday, August 01, 2007

podcast on Ajaxian : Joe Hewitt interview

This dude is cool. A Titan.

I highly recommend skating over to Ajaxian.com and queue-ing up the podcast

Hewitt …orig worked at Netscape since 2000 …… DHTML ever since… worked on Netscape 6 and 7… …then helped create FireFox (he says “we wanted to create a browser that didn’t suck”)… pretty much single-handedly created Firebug (which pretty much every Ajax dev uses nowadays)… created Parakey spinoff from Firefox with fellow FireFox dev Blake Ross…acquired by FaceBook this month. [It sounds like, from Joe, we will see the fruits of Parakey’s labors in the near future. As prolific as Joe Hewitt is, they have not yet released the product they have been working on for 2 years, and Facebook bought it. It's going to be fun to watch what happens there]

(…check out iUI…)

Hewitt sayz:

‘Apple has the lead in CSS (WebKit)’

‘Mozilla has the lead in JavaScript (Gecko)’

‘Python is my favorite language’

“between Mozilla and Microsoft, my grandchildren will write some great apps”

“Mozilla has a large legacy codebase… spending a lot of time refactoring code, instead of creating new features”

“I liked what Flock did… would have liked to see more of that with FireFox… maybe they’re right, because Flock is struggling”

iPhone: “I’m as cynical as it gets with mobile development. But the iPhone is going to be huge. Every other manufacturer will copy the form factor. Hopefully many will follow by using WebKit … Nokia uses WebKit …WebKit is amazing. Open Source. Small and Light. Nothing stopping anyone who doesn’t have political reasons for using WebKit”

This is pretty funny conversation from the podcast:

When asked ‘how come you are able to churn out so many apps, side projects like Firebug, iUI, in addition to parakey work, etc’:

Hewitt: “No no… I decided a few years ago I was going to do nothing else but write code”

[big laughter from Ben, Dion]

Hewitt: “I’m not even kidding… my girlfriend and I broke up, I have this routine where I--

Almaer [jokes]: “...the dog died…”

Hewitt: “hey you have to put food in the bowl, who has time for that?!”

Great stuff. And awesome information.

Sunday, July 22, 2007

Rails running on Amazon's Elastic Compute Cloud

This is the way I am possibly pointing towards for hosting of my Ajax apps developed in the [not-too-distant] future. At the very least, going to research this a good amount: running a Rails Virtual Machine (or multiple clustered VM's) on Amazon's EC2.

I am currently using AS3 not only for backups, but for cross-domain resource loading (static images and JavaScript files). The value presented by AWS's EC2 is too much to ignore when thinking about the future. It's nice to see some Rails plugins already spring up related to this, (even though EC2 is in limited Beta currently, as far as I know) and no doubt it will continue. It's going to be a fun couple of years and beyond!

Deploy Rails app on EC2 via Capistrano
http://s3.amazonaws.com/rc_files/elastic_rails.mov
http://overstimulate.com/articles/2006/08/24/amazon-does-it-again.html
http://conferences.oreillynet.com/cs/rails2007/view/e_sess/14480
http://railspikes.com/2007/4/5/rails-on-ec2
http://elasticrails.com/elasticrails/

The elasticrails.com site explains that the new version of Capistrano (v2) broke functionality of his plugin, but it's a good reference to keep an eye on as this matures.

I am pointing/researching in this direction for my independent/ out-of-work apps and can only assume many others in industry and even companies might move this way as well, given the value it presents to independent devs, as well as even companies looking to host their app(s). Reason being is one can pretty readily set up redundancy (multiple VM's, clustered) for fault tolerance, and also, you only pay by the hour it's running, and last but not least, its infinitely scalable. [ Amazon's ECC approaches infinity, at least for practical purposes :) ]

So, for example, in the case of one site that runs 12 weeks per year, for hosting, I would effectively only pay for a maximum of 24 hours * 7 days/week * 12 weeks/year * $0.10 per instance hour = $201. per year (+ data transfer @ $0.10 per GB). Since the site doesn't transfer much data beyond static images, JavaScript files, generated html, this wouldn't be much more. Now I pay about $70 * 12 mos = $840 for hosting a variety of sites, which is about what one would pay if you ran Rails on EC2 (not including data) for a full year (~ $875). But, again, the scalable nature of EC2 is key.

Wednesday, July 18, 2007

Tuesday, July 17, 2007

JSONRequest.js -- from the genius of Doug Crockford

I wish there was more chatter lately about JSONRequest, and similar secure XSS proposals.


We can all think of legitimate reasons why as a developer we'd very much like to be able to request and return data from remote sites, and am EAGERLY awaiting the dust to settle on this issue. Because of the security model of XMLHttpRequest, this sort of data exchange is not possible due to the 'same origin policy', whereby the browser restricts a web page from communicating with a server of a different domain via an XMLHttpRequest (i.e. Ajax) call:

"XMLHttpRequest has a security model which is inadequate for supporting the next generation of web applications. JSONRequest is proposed as a new browser service that allows for two-way data exchange with any JSON data server without exposing users or organization to harm. It exchanges data between scripts on pages with JSON servers in the web. It is hoped that browser makers will build this feature into their products in order to enable the next advance in web application development."
IBM has a well written article discussing the issues, challenges, and proposals on the table with regard to secure cross-site scripting, and provides some insights to what we can currently implement, and what is on the horizon, including Doug Crockford's JSONRequest.js proposal:

"Here and now

A more recently developed content-retrieval technique employs communication between a page's script and a hidden iframe through its src URL's fragment identifier (the part of the URL that comes after the # sign). Scripts in the parent page and embedded iframe can set each other's fragment identifiers despite coming from different origins. An agreed-upon communication protocol is maintained between the scripts, driven by JavaScript timers that periodically fire routines to check for changes in the fragment identifier.

Because the scripts must know each other's addresses and they must collaborate between themselves to agree on a protocol, trust is ensured. Because any server interaction is local to each component and separate from the inter-script communication, cookies are not exposed.

While still imperfect (for example, it relies on an anomaly that is not a designed behavior, and polling for changes is inferior to having an event fire in response to a change), this solution comes closer to providing browser-native, secure, in-page, cross-domain communication than any other.

Note: James Burke, a developer at AOL Developer Network, pioneered the fragment identifier technique and has built it into the latest releases of the Dojo Toolkit JavaScript library."

When will any of these get implemented? I can hardly wait.

Doug Crockford proposals:http://www.json.org/JSONRequest.html
http://json.org/module

JSONRequest files:
http://www.devpro.it/JSON/files/JSONRequest-js.html

Dojo notes related to JSONRequestResponse:
http://dojo.jot.com/WikiHome/JSONRequestResponse

conversation by some of the 'Titans'...
http://www.eweek.com/article2/0,1895,1960822,00.asp



Ajax Experience Conference -- plus past presentations link

Was fishing around the Ajax Experience website (wishing I could be there! getting married in less than a month, can't make it), and came across the following link to a wealth of information from the 2006 year -- conference presentations, videos, etc.

http://ajaxexperience.techtarget.com/resources/html/presentations.html

The Ajax Experience is one conference I plan to budget for in terms of dollars and vacation days in the 2008 year. Given the list of presenters and attendees, Dion Almaer and the Ajaxians seemingly put together a wealth of knowledge during this 3 day conference. This must be an intense 3 days. Many of the 'Titans of JavaScript, Ajax, and "Web 2.0" are there -- key JavaScript gurus like Brendan Eich, Douglas Crockford... along with library creators and JavaScript experts John Resig, Christopher Portenueve, Joe Walker et al. (and many others) Here is the link to the conference happening in 9 days. There is another conference in October too:

http://ajaxexperience.techtarget.com/west/index.html

Saturday, July 14, 2007

Amazon S3 and Ruby on Rails

http://www.amazon.com/gp/browse.html?node=16427261

From a couple perspectives, I find it tough to beat Amazon S3 for storage of many file assets (esp web developer related file assets). The value and ease of use is very good, especially with regards to file assets that you want to reach from multiple locations and also assets that outlast a machine's lifetime (say, > 3 years). I personally much prefer to store data on a network, where I can access it from anywhere, anytime, even programatically. Likewise, Amazon handles all redundancy, all backups, etc. As a longer term goal, I would like to automate an effective rsync of some data on my local machine to my S3 repository... open to ideas there if anyone wants to post them here or email me.

For those interested (and too lazy to clink on the link above!), here are the costs as of today:

Amazon Simple Storage Service

Pricing

Storage

* $0.15 per GB-Month of storage used

Data Transfer

* $0.10 per GB - all data transfer in
* $0.18 per GB - first 10 TB / month data transfer out
* $0.16 per GB - next 40 TB / month data transfer out
* $0.13 per GB - data transfer out / month over 50 TB

Data transfer in and out refers to transfer into and out of Amazon S3.

Data transferred between Amazon S3 and Amazon EC2 is free of charge.
Requests

* $0.01 per 1,000 PUT or LIST requests
* $0.01 per 10,000 GET and all other requests*

* No charge for delete requests

Storage and bandwidth size includes all file overhead


Here is a great link related to using S3 programatically with Rails:

Building a Web Application with Ruby on Rails and Amazon S3
http://developer.amazonwebservices.com/connect/entry.jspa?externalID=608&categoryID=55

Wednesday, July 11, 2007

Prototype version 1.5.2_pre0

I notice on Backpack, that the 37signals guys are using a new version of Prototype.js. I haven't had time to check the diffs, but wonder what has been added:

http://asset0.backpackit.com/javascripts/prototype.js?1181176787

Wednesday, June 13, 2007

E4X -- ECMAScript for XML

It is perhaps not critical to understand now, but those who want to take a look at what is perhaps ahead, should consider checking out E4X, or ECMAScript for XML. It has already been implemented in SpiderMonkey and Rhino, and has been standardized in ECMA-357 standard.

http://developer.mozilla.org/presentations/xtech2005/e4x/

http://en.wikipedia.org/wiki/E4X

E4X places XML objects as first class JavaScript objects -- just like objects, arrays, functions and Regular Expressions (which I for one, need to admittedly get better with).

This is particularly attractive -- from page 11 of the E4X slides:

* Expandos make markup composition a snap!
* Just start appending extra property tiers:

var html = <html/@lt;
html.head.title = "My Page Title";
html.body.@bgcolor = "#e4e4e4";
html.body.form.@name = "myform";
html.body.form.@action = "someurl.jss";
html.body.form.@method = "post";
html.body.form.@onclick = "return somejs();";
html.body.form.input[0] = "";
html.body.form.input[0].@name = "test";


* Results in this XML:

<html>
<head>
<title>My Page Title</title>
</head>
<body bgcolor="#e4e4e4">
<form name="myform" action="someurl.jss"
method="post" onclick="return somejs();">
<input name="test"></input>
</form>
</body>
</html>


...the future is surely bright for open source, browser native, Ajax.

Sunday, June 03, 2007

Google Gears - Performance Out of the Box

Google Gears was released last week and it's been hugely exciting to get a look at this api, along with some of the apps people have come up with already.

Google Gears API

Obviously many of us had been looking at Adobe Apollo for awhile, and Google Gears is of the same mindset -- but even more encouraging it was released under the very liberal BSD license, which only adds encouragement to those of us excited about the rapid advancement of technology. It will be exciting to see the rapid progression of this 'platform' for offline integration of web applications. The community of web developers has so many ideas, and Google's release of Gears to the community in this manner will no doubt generate many ideas that will find their way into the next release of Gears is my only guess.

As an Ajax developer where I am particularly interested in Gears is in terms of performance, over and above online/offline synchronization as a feature. While the two go hand in hand synchronization has a specific place in many apps (internet connection dropped, queue-ing work completed offline, etc), I feel like the performance aspect of Gears with this offline database and client side file cache will become huge. I am looking forward to seeing many engineers benchmark their web applications once they have become enabled with and optimized for Gears.

Developing with Google Gears in mind, could become like Ajax has become the last two to three years. What I mean when I say that is that there are significant performance benefits that can be gained by limiting the number of trips to a server (both web and database), and processing items in batch. We have already seen this with regards to Ajax applications sending bits of data to the server rather than whole page requests, and this takes it a step further. We now have a larger set of boundaries to work with as web developers. We can choose how much to update, when to update, along with a client side failsafe. Having the cross operating system desktop intermediary is the enabler here, and the deployment potential of a large player like Google are obvious.

As Google continues its collaboration with Mozilla Firefox (I can't wait for Classes in Javacript 2.0 by the way!), and open source libraries like Dojo, it will become easier to integrate these offline caching and synch-ing paradigms into our development practices.

All of this enables richer, more responsive user experiences for the end user. It enables exciting new architectures for web applications. The future is surely bright for the paradigm of web-based applications growing in performance, capability and reach.

VirtueDesktops for Mac + Dojo.sql ENCRYPT(?) screencast

This is wild. For those of us awaiting the release of "spaces" in Mac OS X Leopard, in the meantime you can download VirtueDesktops
http://virtuedesktops.info/index.php/downloads/
http://virtuedesktops.info/index.php/about/

I caught the use of this during a screencast by Brad Neuberg (http://dojotoolkit.org/offline), and have been playing around with it on my Mac today. You can see him use Virtue Desktops in this screencast where he efficiently moves to different desktops. IMO, it's a great way to efficiently organize my machine. Thanks for the link, Brad!

Incidentally, the screencast is related to encrypting data with Dojo Offline. If you're interested in that screencast it is here, it's pretty sweet:
http://codinginparadise.org/video/dot/dot_encryption_small.mov

On the Google Gears mailing list Brad mentions that enabling transparent encryption and decryption will be in the Dojo Offline port that runs on top of Google Gears in about 2 weeks. Looking forward to seeing that high level lib on top of Gears!

Thursday, May 31, 2007

Sunday, May 27, 2007

Using Firebug in IE, Opera, Safari

Most people know about Firebug, as a plugin to Firefox... but you can also debug javascript in other browsers with Firebug, by installing Firebug Lite.

http://www.getfirebug.com/lite.html

It's awesome to include a .js file, open up Internet Exploder, and use alot of the Firebug goodness to check browser compatibility. (after test, or prior to loading to your production webserver, simply comment out that line of .js and you won't take a hit when it comes to page load times).

Here is some more Firebug documentation and references from their site:
http://www.getfirebug.com/docs.html

Core Javascript & Ajax Development Links

...some handy references for all of us writing Javascript and Ajax apps (specifically with Prototype.js, but many of the links help writing and testing JS in general) Enjoy:

Core Javascript 1.5 Reference
http://developer.mozilla.org/en/docs/Core_JavaScript_1.5_Reference

Javascript Style Guide on Mozilla's Development Center:
http://developer.mozilla.org/en/docs/JavaScript_style_guide

Prototype Javascript Framework API docs:
http://www.prototypejs.org/api

Script.aculo.us Effects Library tag docs:
http://wiki.script.aculo.us/scriptaculous/tags/

Dan Webb's LowPro.js:
http://www.danwebb.net/2006/9/3/low-pro-unobtrusive-scripting-for-prototype

Joe Hewitt's Firebug plugin docs and download:
http://www.getfirebug.com/docs.html

https://addons.mozilla.org/en-US/firefox/addon/1843


Selenium:
http://www.openqa.org/selenium/

"Quality", by Douglas Crockford

Insightful presentation by Douglas Crockford on "quality". Engaging and worth watching:
http://video.yahoo.com/video/play?vid=529579

Tamarin Project -- Adobe contributes to Mozilla

This is older news, but certainly worthy of repeating (now that I have a couple free hours to get my thoughts out).

If you're interested in where the future of client-side software development is going, definitely read this post and the related link from Ajaxian.com. It discusses 'Tamarin', which is a collaborative project between Adobe and Mozilla -- Adobe contributed source code from the ActionScript Virtual Machine to the Mozilla Foundation.

What all of this means, as Brendan Eich states "now web developers have a high-performance, open source virtual machine for building and deploying interactive applications across both Adobe Flash Player and the Firefox web browser"

Especially insightful are the 'comments' section, where Brendan Eich (the individual who created the JavaScript language and one of the first people at Netscape, now the Chief Technology Officer at Mozilla, responsible for architecture and the technical direction of Mozilla) , explains the nature of performance gains that will come from a Just-In-Time JavaScript compiler.

http://hecker.org/mozilla/adobe-mozilla-and-tamarin

All of this gives us insight into the web-centric paradigm that both Adobe and Mozilla (along with obviously Google and others) are pointed towards and that has huge momentum. This collaboration, along with items like Adobe Apollo (and other similar efforts by Sun, for instance), make it very motivating time to be a web application developer. We are at the beginning of a time pointing towards being able to create deeply rich web applications -- apps that run efficiently in a browser that is continually increasing in performance. These web applications can be programmed and run in a web-connected or disconnected mode.

The Ajax libraries and toolsets that have sprung up in the last few years (E.g. Prototype, Dojo, et al), along with the advancement of the browser itself, collaborations between Open Source and industry (Adobe, JVM and Flex), and many of the open source communities supporting this vision for the future of the web really gets me excited and motivated to wake up and write code, and dig deeper each day into the nuances of these technologies. Good times-

(ps, here is another good read: http://weblogs.mozillazine.org/roadmap/archives/2007/04/openness.html)