Archive for the ‘Programming’ Category

Node.js and CouchDB FTW?

Wednesday, December 16th, 2009

I’ve been digging deep these days getting up to speed on technology and I found two things that I find extremely exciting. As I mentioned in a previous post, I’ve been looking for a scalable back end in SSJS (server side Javascript) trying to avoid the allure of RoR. I think I might have found my killer combo: CouchDB and Node.js.

CouchDB is written in Erlang (telco grade language), uses a document based model that’s so close to Fresher I could literally port our client’s data to it (we’re using an SQL Server), AND switched from XML to JSON earlier this year as native output through a RESTful HTTP API.

Node.js is an SSJS server but built around the Javascript event model (addListener for sockets) and uses V8 (The Chrome Javascript engine).

So I’m drooling at the possibilities here. What’s more is I can test run a CouchDB instance at cloudant.com (if they accept my application for a beta account).

I still might want some SQL for things like logs, orders, and CRM – but then again, we’ll see once I get my hands dirty…

JSONP and jQuery

Sunday, December 13th, 2009

Nice little trick I just found out about the getJSON function in jQuery. If you add an extra “?” to the end of the url, it’ll read it as JSONP.  JSONP simply wraps the server’s response (JSON object) in a function. It’s a way to work around cross domain issues. We can finally use the widget creator anywhere, no just on the artist’s own site.

Google Gears vs HTML5

Thursday, December 10th, 2009

One feature I hadn’t discovered about HTML5 is the ability to cache files like Gears and run in offline mode. It in fact has local store with SQL… Huge. A colleague recently explained that Google was dropping Gears in favor of these new features in HTML5. See:

http://digitizor.com/2009/02/22/google-prefers-html5-over-its-own-homegrown-google-gears/

Wave

Friday, December 4th, 2009

Gotta say that I’m really digging Google Wave. I love the technology behind it and I think it’ll change the way we build apps for the web. It looks like real time but all done in micro requests web style. Very very cool.

eLearning

Sunday, November 29th, 2009

I haven’t done an eLearning project in a while and having done so much Web 2.0 stuff recently, I’d forgotten how horrible XML and SCORM are. Blows my mind how much time is wasted writing manifest files and breaking things up into “reusable learning objects” when no one ever reuses them. It’s a glorious make work program. I think they need a major revamp and need to move towards AJAX/JSON.

onKeyDown vs onKeyPress

Tuesday, November 17th, 2009

“Notable Gotchas”

http://asquare.net/javascript/tests/KeyCode.html

Could someone tell me why keyCode is different for onKeyPress vs onKeyDown?  Argh!

ECMAScript FTW

Monday, October 19th, 2009

What can I say.  I’m officially converted.  For the first time ever, I can focus on one language for everything.

Javascript Server Side

Sunday, September 27th, 2009

My trip through server side jscript for JSON parsing in Fresher really got me thinking (especially about how I never thought about doing it before).  So today I did some research and found that javascript server side could become as popular as php:

http://www.sitepoint.com/blogs/2009/03/10/server-side-javascript-will-be-as-common-as-php/

Considering how much actionscript/javascript I’ve been doing these days, this sounds right.  After some digging through lots of blogs and articles that included stuff like SpiderMonkey/Rhino, Junction, Whitebeam, I ended up on Jaxer.  There’s something extremely appealing about writing in the same language on both sides.  I juggle between them so much, I can’t believe I haven’t researched this earlier.  Jaxer is built on Mozilla’s Gecko engine and runs standalone (or with Apache).  Going to install it here and see what it can do.  :)

JSON and classic ASP

Monday, September 21st, 2009

Serializing JSON in VB is relatively easy.  Parsing and juggling it is another story.  I’ve been scratching my head all weekend thinking how easy it was to play with it in Javascript and Actionscript but I had so far only been doing it client side.  Then I found this page:

http://stackoverflow.com/questions/1019223/any-good-libraries-for-parsing-json-in-classic-asp

Oddly enough, the _last_ solution (using a hybrid vb/jscript page) is brilliant.  I didn’t realize you could read your VB objects in JScript server side.  A small tweak to the standard json2.js file at json.org let me use their parser server side with some easily ported client-side javascript code I already had.  Thought the job would take all day and it only ended up taking the afternoon.  We now have Excel (CSV) reports generated server side for accountants from Fresher’s JSON sales reports.  Lovin it.  :)

Javascript frameworks

Monday, June 1st, 2009

Javascript frameworks aren’t as important as most web developers think.  The general idea is that they “save you headaches”.  The problem is that headaches are a natural part of the learning process and IMO, frameworks breed ignorance.  I’ve been wrestling with Javascript since its introduction.  You can just imagine the nightmares I had when trying to get a “dynamic” web site to work back in 1996 with IE on a Mac…  So when I’m asked which framework I prefer (jQuery, Dojo, Prototype, Scriptaculous, or MooTools) I generally say none – especially since I don’t have to fork my code much anymore.  I’ve been pleasantly surprised by the cross browser compatibility of late.