Ajax

A Better Mobile Web; What else?

Ajaxian - 1 hour 1 min ago

Cedric Dugas feels so passionate about fixed positioning in WebKit that he created A Better Mobile Web to talk about it:

The Problem

It is impossible to have an element fixed in CSS on the page in the mobile Webkit browser. When you are surfing the web on your phone, webkit opens the page completely and acts as a viewport.

“Imagine a book in front of you. Take a piece of paper, cut a 320*416 square in it, and lay it over the book. To read the book, move the paper around and position the hole over the words you want to see.” -Richard Herrera

Why it is important

To create better mobile applications and websites, we need fixed positionning to give the user better tools to browse the web on handled devices. Like a real mobile app, we could have a fixed toolbar when scrolling on a site, it is critical to not take the user in hostage in very long list or on long content pages. This is something we can’t really emulate in javascript as mobile devices are not really powerful.

The solution

The Webkit team could give us a proprietary CSS property that would overwrite the viewport behavior, and this is the proposition here. Give us a CSS property like position: -webkit-viewport-fixed that we can apply on a div so it can be fixed to the viewport.

That is one feature request, but surely there we can add to that? The broad domain of “abettermobileweb.com” deserves more!

What would you like to see for mobile specifically that isn’t covered in the current Web and device API standard work?

Categories: Ajax news

Do Your Employees Hate the IT Department?

Ajax Developers Journal - 2 hours 42 min ago
We all know the joking, and sometimes snide comments about the IT department that come out around the water-cooler. Fredric Paul on the Enterprise Efficiency blog relates an interesting story that highlights how easily the CIO and the IT team can make themselves not only the butt of jokes, but truly disliked. Fredric's example is a light-hearted, but imagine the result if IT reacted the same way to a new process improvement solution proposed by a senior manager. It is true, unfortunately, that IT gets a tough job. There are not only the day to day hassles of nursing aging systems through another crisis, but the constant whining from stupid users that their laptop is not booting, or the VPN is slow. So add to that the need to add another device or worse still, enterprise application such as BPM to their support burden, and its no wonder that people in IT look and act sour.

read more

Categories: Ajax news

A deep dive and analysis of the JavaScript Module pattern

Ajaxian - 5 hours 3 min ago

Ben Cherry has a really nice detailed analysis of the module pattern.

He starts with the simple pattern that Crock-y documented back in the day..... and then goes on to discuss augmentation (loose and strict) and then deeper into some cool patterns:

Cloning and Inheritance

PLAIN TEXT JAVASCRIPT:
  1.  
  2. var MODULE_TWO = (function (old) {
  3.     var my = {},
  4.         key;
  5.      
  6.     for (key in old) {
  7.         if (old.hasOwnProperty(key)) {
  8.             my[key] = old[key];
  9.         }
  10.     }
  11.      
  12.     var super_moduleMethod = old.moduleMethod;
  13.     my.moduleMethod = function () {
  14.         // override method on the clone, access to super through super_moduleMethod
  15.     };
  16.      
  17.     return my;
  18. }(MODULE));
  19.  

This pattern is perhaps the least flexible option. It does allow some neat compositions, but that comes at the expense of flexibility. As I've written it, properties which are objects or functions will not be duplicated, they will exist as one object with two references. Changing one will change the other. This could be fixed for objects with a recursive cloning process, but probably cannot be fixed for functions, except perhaps with eval. Nevertheless, I've included it for completeness.

Cross-File Private State

One severe limitation of splitting a module across multiple files is that each file maintains its own private state, and does not get access to the private state of the other files. This can be fixed. Here is an example of a loosely augmented module that will maintain private state across all augmentations:

PLAIN TEXT JAVASCRIPT:
  1.  
  2. var MODULE = (function (my) {
  3.     var _private = my._private = my._private || {},
  4.         _seal = my._seal = my._seal || function () {
  5.             delete my._private;
  6.             delete my._seal;
  7.             delete my._unseal;
  8.         },
  9.         _unseal = my._unseal = my._unseal || function () {
  10.             my._private = _private;
  11.             my._seal = _seal;
  12.             my._unseal = _unseal;
  13.         };
  14.      
  15.     // permanent access to _private, _seal, and _unseal
  16.      
  17.     return my;
  18. }(MODULE || {}));
  19.  

Any file can set properties on their local variable _private, and it will be immediately available to the others. Once this module has loaded completely, the application should call MODULE._seal(), which will prevent external access to the internal _private. If this module were to be augmented again, further in the application's lifetime, one of the internal methods, in any file, can call _unseal() before loading the new file, and call _seal() again after it has been executed.

This pattern occurred to me today while I was at work, I have not seen this elsewhere. I think this is a very useful pattern, and would have been worth writing about all on its own.

Sub-modules

Our final advanced pattern is actually the simplest. There are many good cases for creating sub-modules. It is just like creating regular modules:

PLAIN TEXT JAVASCRIPT:
  1.  
  2. MODULE.sub = (function ()) {
  3.     var my = {};
  4.     // ...
  5.      
  6.     return my;
  7. }());
  8.  

While this may have been obvious, I thought it worth including. Sub-modules have all the advanced capabilities of normal modules, including augmentation and private state.

Nice work Ben!

Categories: Ajax news

Does Social Media Really Work for Business?

Ajax Developers Journal - Sun, 2010-03-14 16:00
In West Texas, we have wind gust that match no other; we love our football; sunsets are at their best with no trees to block your view; oil means a lot to us and Tuesday is for Mexican Food tacos! Kent Dean, Director of Field Marketing, with Rosa’s Café recently spoke to our local chapter of the American Advertising Federation. They are so well known for their Taco Tuesdays that when he throws out the statement, “It’s Tuesday” on their Facebook pages hundreds of responses come in immediately with fans chiming in that it’s “Taco Tuesday”. His topic focused on social media – does it really work for business?

read more

Categories: Ajax news

So It’s Gonna Drizzle on Rackspace

Ajax Developers Journal - Fri, 2010-03-12 20:30
Rackspace has picked up the Drizzle team that Oracle cast off when it acquired Sun. In case you don’t know, Drizzle is a cloud-directed, Linux-leaning, stripped-down, hitherto for unsupported, GPL 2 MySQL 6.0 fork that Rackspace is betting will infinitely scale, or at least scale better than MySQL. It looks like Rackspace means to go to production with the thing this year. Hopefully it will be stable. Drizzle runs the risk of not being as stable as MySQL, because the Drizzle team is taking things out and putting other stuff in. Of course it may be successful in trying to create a product that’s more stable than MySQL. But creating a stable DBMS engine is something that has always taken years and years.

read more

Categories: Ajax news

CA Buys Nimsoft

Ajax Developers Journal - Fri, 2010-03-12 18:15
CA is buying privately held Nimsoft Inc for $350 million in cash, another bet in the cloud. The deal should close by the end of the month and Nimsoft would remain a standalone business unit under current management reporting to Chris O’Malley, head of CA’s cloud products and solutions business line. CA will use money it has on hand but overseas to pay for the property. The deal follows its recent acquisitions of Cassatt, NetQoS and Oblicore and its pending acquisition of 3Tera. All are basically cloud-directed and meant to bring the old mainframer into the 21st century. Nimsoft has previously identified CA along with IBM, HP, BMC, EMC and a bunch of smaller firms as competitors.

read more

Categories: Ajax news

Ambilight Sample; video and canvas

Ajaxian - Fri, 2010-03-12 12:30

Sergey Chikuyonok gets his Philips Ambilight foo on as he created a HTML5 video + canvas sample that mimics the TV effect.

As the video runs, a snapshot is sent over to JavaScript land where colors are worked out:

PLAIN TEXT JAVASCRIPT:
  1.  
  2. function getMidColors(side) {
  3.         var w = buffer.width,
  4.                 h = buffer.height,
  5.                 lamps = getOption('lamps'),
  6.                 block_width = getOption('block_size'),
  7.                 block_height = Math.ceil(h / lamps),
  8.                 pxl = block_width * block_height * 4,
  9.                 result = [],
  10.  
  11.                 img_data = buffer_ctx.getImageData(side == 'right' ? w - block_width : 0, 0, block_width, h),
  12.                 total_pixels = img_data.data.length;
  13.  
  14.  
  15.         for (var i = 0; i <lamps; i++) {
  16.                 var from = i * w * block_width;
  17.                 result.push( calcMidColor(img_data.data, i * pxl, Math.min((i + 1) * pxl, total_pixels - 1)) );
  18.         }
  19.  
  20.         return result;
  21. }
  22.  

Then, two canvas objects are placed, one on each side, of the video itself.

Categories: Ajax news

Mainstream IT Buys into Cloud Computing

Ajax Developers Journal - Thu, 2010-03-11 22:15
We started 3Tera to radically ease the way IT deploys, maintains and scales – MANAGES - applications. Our AppLogic® cloud computing platform provides the foundation of our partners’ orchestration of cloud services for public and private clouds around the world. Today, we’re taking the next step in moving toward making cloud computing mainstream by joining CA. CA and 3Tera share a common vision for the future of cloud computing, and we are excited about the opportunities that this acquisition will create for our customers, partners and their cloud users. This is a historic moment in Cloud Computing. The significance of this acquisition is a heck of a lot more than just a land grab in a hot space. We are confident that as a team, CA and 3Tera, will extend our leadership of the cloud computing platform market.

read more

Categories: Ajax news

Microsoft to Present at Cloud Expo East

Ajax Developers Journal - Thu, 2010-03-11 21:15
How do you tap the social media sites in a way that reaches repeat customers, ensures a consistent user experience yet internally has the peace of mind regarding the customer data, scalability, and ease of development? In their session at the 5th International Cloud Expo, Jeff Barnes, a Microsoft Architect Evangelist, and Jim Zimmerman, an ASP.NET MVP, will discuss how Thuzi has created a repeatable approach. For example, a whopping 540k people signed in just four weeks for an Outback Steakhouse “Blooming Onion” promotion. As many as 35,000 Facebook fans signed up per day. Cloud Expo is the world's leading Cloud-focused event since 2007, and is held five times a year, in New York City, Silicon Valley, Prague, Tokyo and Hong Kong.

read more

Categories: Ajax news

YQL Geo library – all your geo needs in pure JavaScript

Ajaxian - Thu, 2010-03-11 16:04

I just finished doing some talks on geo hacking (slides are available here) and how to use some of the Geo technologies Yahoo and Google provide as part of a University gig in Atlanta.

As a lot of the students liked the idea of APIs like GeoPlanet and Placemaker but had a hard time getting their head around them I thought it a good idea to build a small JavaScript library that does the job for them.

I give you the YQL Geo library (and its source on GitHub). Using this library you can do the following:

  • Detecting the visitor's location with the W3C geo API and with IP as a fallback
  • Find geo location from text
  • Find location from lat/lon pair
  • Find locations in a certain web document (by URL)
  • Get the location for a certain IP number

And all of that in pure JavaScript. For example:

PLAIN TEXT JAVASCRIPT:
  1. yqlgeo.get(
  2.   'paris,fr',
  3.    function(o){
  4.      console.log(o);
  5.   }
  6. )

Will get you:

PLAIN TEXT JAVASCRIPT:
  1. "place":{
  2.   "lang":"en-US",
  3.   "uri":"http://where.yahooapis.com/v1/place/615702",
  4.   "woeid":"615702",
  5.   "placeTypeName":{
  6.     "code":"7",
  7.     "content":"Town"
  8.   },
  9.   "name":"Paris",
  10.   "country":{
  11.     "code":"FR",
  12.     "type":"Country",
  13.     "content":"France"
  14.   },
  15.   "admin1":{
  16.     "code":"",
  17.     "type":"Region",
  18.     "content":"Ile-de-France"
  19.   },
  20.   "admin2":{
  21.     "code":"FR-75",
  22.     "type":"Department",
  23.     "content":"Paris"
  24.   },
  25.   "admin3":null,
  26.   "locality1":{
  27.     "type":"Town",
  28.     "content":"Paris"
  29.   },
  30.   "locality2":null,
  31.   "postal":null,
  32.   "centroid":{
  33.     "latitude":"48.856918",
  34.     "longitude":"2.341210"
  35.   },
  36.   "boundingBox":{
  37.     "southWest":{
  38.       "latitude":"48.658291",
  39.       "longitude":"2.086790"
  40.     },
  41.     "northEast":{
  42.       "latitude":"49.046940",
  43.       "longitude":"2.637910" 
  44.     }
  45.   }
  46. }

Other uses:

This gets the name and the country of a lat/lon pair:

PLAIN TEXT JAVASCRIPT:
  1. yqlgeo.get(33.748,-84.393,function(o){
  2.   alert(o.place.name + ',' + o.place.country.content);
  3. })

This finds the visitor's location (on W3C geo API enabled browsers it asks them to share it - otherwise it detects the IP and locates this one on the planet)

PLAIN TEXT JAVASCRIPT:
  1. yqlgeo.get('visitor',function(o){
  2.   alert(o.place.name + ',' + o.place.country.content + 
  3.         ' (' + o.place.centroid.latitude + ',' +
  4.                o.place.centroid.longitude + ')'
  5.         );
  6. });

Read all about it on my blog and enjoy!

Categories: Ajax news

SVG Wow!

Ajaxian - Thu, 2010-03-11 11:35

Erik Dahlström and Vincent Hardy have put together a cool website, called SVG Wow!, that showcases SVG doing things you didn't expect SVG can do:


There are alot of unique demos on there.

One of my favorites uses SVG, HTML5 Audio, Web Fonts, and YUI to play music accompanied by flying animated lyrics (Chrome and Safari only):

There are lots of other great samples for you to play with and study!

Categories: Ajax news

Ext JS 3.2 beta: stores, components, transitions, and themes

Ajaxian - Thu, 2010-03-11 07:12

The Ext JS team have announced the 3.2 beta which includes new components and goodness.

Take the animated DataView transitions for example:

On top of that, the release includes:

Categories: Ajax news

Unisys’s Scott Sanchez to Present at Cloud Expo East

Ajax Developers Journal - Thu, 2010-03-11 00:00
We are constantly bombarded with articles and presentations about the security risks in cloud computing and why organizations need to be concerned about them as they consider a move. The truth is that organizations do need to be concerned about security – but they needn’t be paralyzed by fear. In fact, the heightened concern we’re seeing has actually become a spur to action and has begun to drive cloud security to a whole new level. In his session at the 5th International Cloud Expo, Scott C. Sanchez, CISSP, Director of the S&T Security Portfolio at Unisys Corporation, will focus on the key areas where a successful migration to cloud computing can actually improve security and reduce risk, and address some of the major issues to account for before and during that migration.

read more

Categories: Ajax news

Unisys to Present at Cloud Expo East

Ajax Developers Journal - Wed, 2010-03-10 22:15
What are the attributes that attract applications to public clouds? Why implement private clouds? When is it appropriate to use both in a Hybrid Cloud approach? Can legacy applications be moved unchanged to the cloud or do they have to be rewritten as Web 2.0 apps? What are the implications regarding the application data migration? In his session at the 5th International Cloud Expo, Dr. Michael Salsburg, a Distinguished Engineer for Unisys Technology, Consulting and Integration Solutions, and the Lead Architect for Unisys Cloud Engineering, will answer those critical questions that arise when considering hosting applications in the cloud. Cloud Expo is the world's leading Cloud-focused event since 2007, and is held five times a year, in New York City, Silicon Valley, Prague, Tokyo and Hong Kong.

read more

Categories: Ajax news

Cast Iron Promises Integration with Cloud Computing

Ajax Developers Journal - Wed, 2010-03-10 17:45
Cast Iron Systems, good as its name, wants to do the heavy lifting and synch applications running on-premise with those in the cloud, any kind of cloud. It says it can connect any combination of cloud and on-premise applications. And nobody has to leave its multi-tenant cloud environment although they could use a web-based on-premise or hosted virtual appliance or a physical appliance. They may not even know they’re using Cast Iron’s mojo since it’s letting ISVs rebrand it. Dell’s Integration Services folks, for instance, are selling it. Cast Iron is also providing the widgetry to Amazon’s EC2 customers. Cast Iron’s next-generation cloud integration platform fittingly dubbed OmniConnect promises data migration, process integration and UI mashups, effectively making it three integration products in one.

read more

Categories: Ajax news

Cordys MashApps Now Available Through the Google Apps Marketplace

Ajax Developers Journal - Wed, 2010-03-10 16:15
Cordys, a supplier of software for business process innovation, on Wednesday announced it has added Cordys Process Factory and MashApps to the Google Apps Marketplace, Google's recently launched online storefront for Google Apps products and services. Cordys Process Factory offers a simple and effective mechanism for anyone in the world to create and deploy situational applications and MashApps, delivering Business Process Management (BPM) capabilities to the Google Apps suite of communication and collaboration tools. Cordys MashApps are mashups of different services or web-based, process-centric applications for small and medium enterprises and departmental deployments. The availability of Cordys Process Factory and MashApps through the Google Apps Marketplace now allows Google Apps customers to create and use applications and business processes on the fly, at low cost and without IT involvement.

read more

Categories: Ajax news

CSS3 Please! Instant results… Thank You

Ajaxian - Wed, 2010-03-10 14:39

Paul Irish and Jonathan Neal have created a fun example of various CSS tweaks that you can make, and see the results instantly.

CSS3, Please! lets you play with fancy new rules such as:

  • border-radius
  • box shadow
  • gradients
  • rgba support in backgrounds
  • transforms
  • font-face

Really nice way to make tweaks inline in the page..... nicely done. Hope to see some other examples out there :)

Categories: Ajax news

HTML Minification

Ajaxian - Wed, 2010-03-10 12:14

Good old Kangax has been playing with HTML minification and has shared his new tool in an early stage.

What does it do?

Kangax has forked John Resig's HTML parser which parses the HTML and sends that into the Minifier. This has rules that do things like whitespace optimization, comment removal, and collapsing boolean attributes (e.g. disabled="true" -> disabled).

He also has a linter going:

While working on minifier, I realized that oftentimes the most wasteful part of the markup is not white space, comments or boolean attributes, but inline styles, scripts, presentational or deprecated elements and attributes. None of these can be simply stripped, as that could affect state of the document and is just too obtrusive. What can be done, however, is reporting of these occurences to the user. HTMLLint is even a smaller script, whose job is exactly that—to log any deprecated or presentational elements/attributes encountered during parsing. Additionally, it detects event attributes (e.g. onclick, onmouseover, etc.). The rationale for this is that moving contents of event attributes to external script allows to take advantage of resource caching.

Categories: Ajax news

Harmony: Canvas Drawing Tool

Ajaxian - Wed, 2010-03-10 10:50

Harmony is a new drawing tool, a HTML5/Canvas experiment with great potential. It provides some unique brush styles, and can produce some great-looking charcoal pencil style sketches, among other things. Better to try it out than explain it in words.

Creator Mr. Doob (Richard Cabello) explains how he used Canvas to make it darker the more you draw over it:

The whole thing is quite modular so I can keep adding more brush styles whenever I get inspired. During the process I found out that, for some reason (apparently lack of hardware acceleration), Firefox and Opera do not support context.globalCompositeOperation = 'darker'. This was on the HTML5 spec before but got removed. Just so you know what I'm talking about, this is like the "multiply" blending in Photoshop. Webkit does support it tho. I hope they put it back on the specs and all browsers support it.

You can also save images using data URI encoding.

As it works on webkit, he made sure it worked on the mobile Android and iPhone browsers. No multi-touch as yet, but the touch UI still makes a nice input mechanism.

(Thanks FND)

Categories: Ajax news

Cisco Unveils Honking Great Router

Ajax Developers Journal - Tue, 2010-03-09 23:45
The announcement Tuesday that Cisco swore would “forever change the Internet” was a great carrier router that’s supposed to be able to download all the printed contents in the Library of Congress in a second, deliver every movie ever made in four minutes and handle video calls made by every man, woman and child in China simultaneously. Cisco says it can move a cloud-enabling 322 terabytes a second, 12 times the Internet traffic of the nearest competitive product and clearly is the adrenaline boost to the network that Cisco promised to deal with the burgeoning growth of video transmissions, mobile devices and online services. The widget, the CRS-3, a 3x upgrade of the existing six-year-old CRS-1 on which Cisco has lavished $1.6 billion developing, is meant for major Internet service providers and folks like AT&T, which was on hand to say it’s been testing the thing between New Orleans and Miami and it looks wizard. AT&T won’t need it for another year or two but it’s happy it’s there.

read more

Categories: Ajax news