Monthly Archives:

June 2008

Posted on June 30, 2008 by Avi Flax

Netflix Demonstrates Customer Relationship Mastery

Everyone makes mistakes. It's what you learn from them, and how you deal with them, that matters.

Two weeks ago, Netflix decided to discontinue one of their features: Profiles. I was annoyed by this, but not enough to make any noise about it, or even tell Netflix. Truth is, I assumed that the decision was final, and that nothing I could say would matter. Well, Netflix proved me wrong, and has once again demonstrated their dedication to customer satisfaction, by reversing their decision in response to customer feedback.

Continue reading "Netflix Demonstrates Customer Relationship Mastery" »

| Comments (1) | Technorati Tags :

Posted on June 26, 2008 by Javier Julio

Enabling A Drop Shadow On A Flex Container

To set a drop shadow on say a VBox or HBox component you simply set the boolean property dropShadowEnabled to "true" -- but this is not enough to make the drop shadow appear. An example:

Continue reading " Enabling A Drop Shadow On A Flex Container" »

| Comments (0) | Technorati Tags :

Posted on June 25, 2008 by Joel Potischman

In praise of System.Object

In this Quick Tip, I show you how to make a method that deals with System.Object parameters more type-safe by converting it to use generics. Last year I had written a wrapper class to talk to the ASP.NET caching system for me. It returned cached objects as System.Object for maximum flexibility. The client would cast to the desired type, but it always bugged me, because it wasn't very type-safe. Consider the following chunk of code:

It will compile just fine, but it will blow up when I run it, because silly me, WhenDidIDoThis contains a DateTime, not an integer. It's far safer to rewrite my code to use generics:

Hmm. Actually, that same logic error still compiles just fine, but hey, at least my code now signals its intent more clearly. The bigger problem is now I'm getting a compiler error elsewhere. Let's see why.

Continue reading "In praise of System.Object" »

| Comments (2) | Technorati Tags :

Posted on June 24, 2008 by Tim Meaney

Introducing Kindling, the first product from Arc90

Ideas are everywhere, but how do I find them?

It’s been often said that the best ideas come from within an organization, as the people closest to the action are best positioned to see untapped value.  However, in practice some businesses seek new ideas, whether they be process changes or the next product line, from the outside - from hired consultants or strategic management firms. 

For those that do seek this out from within, often the problem is actually tapping into this potential wealth of ideas.  If there was only a tool that allowed all members of an organization or community to submit, discuss, refine and vote on ideas?  The net effect of all of this activity would be a well-vetted list of ideas, those that by the nature of being exposed and vetted have the support of the group.

Kindling, a new product by Arc90, is just such a tool.  The product has been within our company for over a year, as well as by a handful of organizations during our private beta, and is available today, as we widen our scope to a public beta.  More on that below, but first, since when is Arc90 a product company?  As cryptic as our web presence might be, it is pretty clear that Arc is a services company, so how did we get here?

Continue reading "Introducing Kindling, the first product from Arc90" »

| Comments (2) | Technorati Tags :

Posted on June 13, 2008 by Avi Flax

Building RESTful Web Apps with Groovy and Restlet, Part 2: Resources

In Part 1 of this series, we set up a development environment for our apps, and created and tested a simple “Hello, world” example. In this installment, we'll make our app more realistic and useful.

If we revisit the current makeup of restfulapp.groovy, we see that there are two elements: the class RequestHandler, and the line which creates and starts an HTTP server. RequestHandler has only one method: handle(), which is called for every request. handle() checks whether the request method is GET, which is the only method supported by the app at this stage, and responds with “Hello, world!” if it is, and with an error response if it isn't.

It works, but there's definitely some key elements missing from the picture at this point – namely resources and representations. While our RequestHandler is indeed responding to requests and is therefore doing actual work, it's not particularly RESTful. There's no clear resource specified, and no representations of the state of that resource transferred back and forth. So that's what we'll add to the app now.

Continue reading "Building RESTful Web Apps with Groovy and Restlet, Part 2: Resources" »

| Comments (2) | Technorati Tags :

Posted on June 12, 2008 by Javier Julio

Using ColdFusion and LCDS in AIR-powered Flex Applications

Previously, I've discussed how to use ColdFusion Components (CFCs) in AIR-powered Flex applications but I never got a chance to follow up on how to use CF8's integrated LiveCycle Data Services ES in AIR.

Continue reading "Using ColdFusion and LCDS in AIR-powered Flex Applications" »

| Comments (0) | Technorati Tags :

Posted on June 11, 2008 by Doug Burns

Layers of Java Logging

The Java Logging API is great for tracking the internal workings of your application, both during development and after it goes to production. The API is based on a highly flexible configuration model that gives you complete control over what gets logged and where it gets logged.

I recently started using the API after some time away, and it took a bit to get reacquainted with some of its concepts. In my first few attempts, I ended up with either all logging statements output or none, when what I really wanted was output from only a few specific classes.

I think my problem stemmed from confusion between the various ways to filter output. In the end, I found it easiest to think of the API as two separate layers - a filtering layer that answers the question "What should be output?" and a handler layer that answers the question "How should it be output?"

Continue reading "Layers of Java Logging" »

| Comments (1) | Technorati Tags :

Posted on June 11, 2008 by Joel Potischman

Deposit-friendly Development

Yesterday I had to deposit a check. My bank, Chase, has begun rolling out new "deposit-friendly" ATMs that require neither envelope nor deposit slip for check-only deposits. The process is shockingly simple. Here's what I had to do:

  1. Select Deposit from the on-screen menu
  2. Insert the endorsed check into a slot, just as I would insert a dollar bill into a vending machine
  3. When I saw an image of the check on-screen, enter its amount [2008/07/02 UPDATE - It gets even better. I discovered today that it actually OCRs the check amount! After I inserted a handwritten check this morning it magically asked me to confirm whether the amount it read on it was correct. It was! I deposited two other checks and it asked me to enter the check amount, indicating that it couldn't read the amounts or it didn't have a high degree of confidence in its scan, so it didn't waste my time asking me to confirm them. I assume OCR would work nearly 100% of the time on machine-generated checks.]
  4. Repeat for any additional checks
  5. Press Done
  6. Get receipt showing an image of my check(s)

Here's what I DIDN'T have to do:

  1. Fill out a deposit slip, which means I didn't need to...
  2. Find a working pen, which I would need if I could...
  3. Remember my checking account number, which I never do, so I used to have to...
  4. Wait in line for a teller to give me my checking account number, before I could...
  5. Check the under-copies of the deposit slip to make sure nobody leaned hard and smushed their deposit info down into my slip or surreptitiously wrote in their account number to scam me into depositing my check into their account. (And to think some people trust paper.)

Chase saw a process where a machine that is already operating in a high-security and high-knowledge context asked me to write down the account number it already knows on a piece of paper it can't read and seal it into an envelope it can't open. What a wonderfully archaic set of steps to get rid of!

Continue reading "Deposit-friendly Development" »

| Comments (3) | Technorati Tags :

Posted on June 9, 2008 by Ben Sgro

Getting started with PDO_MSSQL

The Zend framework requires that if you want  your application to work on both Windows and Linux, and take advantage of Zend's ORM (DB_Table_Abstract) functionality, you have to install and use the PDO_MSSQL driver.
    
 

Continue reading "Getting started with PDO_MSSQL" »

| Comments (3) | Technorati Tags :

Posted on June 6, 2008 by Alex Melman

An Easy Way to Implement Namespaces in JavaScript

(Object-Oriented JavaScript Series)

Namespaces are a great way to uniquely distinguish objects from different projects. Unfortunately, JavaScript does not have native support for namespaces, but we can approximate it, by putting our objects inside other empty objects.

For example, to create a namespace called arc90.components, we would first define arc90 as an empty object:

arc90 = {}

If an object called arc90 already exists, we don't want to erase it; so we will check for it first, then create an empty object only if the arc90 object doesn't already exist. We can do that like so:

if (typeof(arc90) == "undefined")
        arc90 = {}

The type of operator returns the type of an object as a string. If the object does not exist at all, a value of "undefined" will be returned. This is what we are checking for:

Now that arc90 is defined as an object, we can go ahead and define the next level of the namespace, arc90.components. We basically repeat what did for the arc90 part of the namespace:

    if (typeof(arc90.components) == "undefined")
        arc90.components = {}

By now, you must be thinking, "Boy, we're repeating a lot of code here. There must be an easier way." Well, don't worry, there is. There are two options. You can use the YUI Library, which already contains a namespace function, or we can create a simple namespace function ourselves. Since I don't want my tip to consist of just a link to Yahoo!, I will do things the long way and show you how to create a namespace function.

The most important part of the function is the use of the eval operator. This lets you pass in JavaScript code as text, allowing you to dynamically create object names. This is important, because normally, object names must be hard-coded, which would prevent us from creating new objects dynamically, if not for the eval operator.

Now, we will create a function, which will create a namespace object out of the string you pass in. For example, calling:

createNamespace("arc90.components");

will create an object called arc90.components. It also returns the object that was created, so that you can create an alias. For example, calling the function this way:

var alias = createNamespace("arc90.components");

will create the namespace object and set alias to reference the same value. Now, if we were to define a new object called Checkbox within the namespace, we can either use the fully qualified name, like so:

arc90.components.Checkbox = function() {}

or we can use the alias:

alias.Checkbox = function() {}

You can use either the fully qualified namespace or the alias to reference the same objects. The only thing you must be aware of is that you cannot give your alias the same name as any part of the namespace. For example, if you have a namespace called arc90.components, you cannot name your alias arc90, or components. This will overwrite the object in the original namespace.

Now, let's create the createNamespace function:

   function createNamespace(ns)
    {
        // First split the namespace string separating each level of the namespace object.
        var splitNs = type.split(".");       
        // Define a string, which will hold the name of the object we are currently working with.  Initialize to the first part.
        var builtNs = splitNs[0];   

        for (i = 0, i < splitType.length; i++)
        {
            // Add the next part of the namespace only if we are at the second level or further.
            builtNs += (i > 0) ? ("." + splitType[i]) : "";
            // Check if the object we want to add exists, and add a new empty object if it doesnt.
            eval(builtNs + " = typeof(" + builtNs + ") =='undefined' ? {} : " + builtNs + "; ");
        }

        return eval(ns);    // Return the namespace as an object.
    }

The above code first splits the namespace string into parts, so that a namespace called arc90.components will be split into two strings, arc90, and components. The function then loops, adding the next string to the first as it goes. On the first iteration, we have only arc90, which will then be created as an object by the line:

eval(builtNs + " = typeof(" + builtNs + ") =='undefined' ? {} : " + builtNs + "; ");

This is essentially the same code we wrote at the beginning, rewritten using a one-line ternary operator, and wrapped in an eval statement. After the eval statement runs, the code generated would look like this (on the second iteration):

arc90.components = typeof(arc90.components) == 'undefined' ? {} : arc90.components;

So, there we have it; a function to create JavaScript namespaces. Enjoy.

| Comments (4) | Technorati Tags :

Posted on June 5, 2008 by Jen Epting

Dreaming the Right Dreams

In the world of technology, progress is king. Every morning I ride the elevator up 30 floors to a bunch of people who are interested in finding solutions for the world, making it better, stronger, more efficient. They are innovators, they are optimists; there is no gap in technology that they don't want to fill with some snazzy code and a slick interface.

It's refreshing as hell.

I'm new to this world. I spent my first week gawking at my computer screen, discovering application after application that solved problems for me: Money management! Whiteboard scanning!. I had no idea people were even thinking about making these areas of my life better, let alone providing them for free on the Internet. Judge if you want, but I'm a pretty normal prototype of what Geoffrey Moore refers to as the "Pragmatists" (not super tech-savvy, but willing to get excited about using it when it fits just right). And as a social 20-something professional living in New York, I'm splat in the middle of the consumer group that software products want to court.

Which is why I bring a different perspective to the making of software. I'm surrounded by people who dream up big ideas on a daily basis, who notice the collaborative instinct we have here at Arc90 and write applications to harness that energy. And though I'm incredibly impressed by the ways people could use technology to evolve what they deem unsuitable, I'm also in a unique position to wonder about whether we should.

One of the issues I seem to keep stubbing my toe against is that of information storage. As members of this industry, we're getting so much better about storing and sorting, recording and re-finding information that we come across, that we're afraid to let anything go. In recent planning meetings for a new Arc product, we've discussed the extent to which users or ideas should be deleted- as in, gone. FOREVER. Everyone gets a little uneasy when that part of the conversation comes up- we're afraid that our users are going to accidentally do something undoable that they regret. We want to protect them, either because we're very sweet and we don't want to see them scrape their knees, or because we're cynical about the idea of being inundated with emails from people who never quite learned to read directions.

A recent tour of the web-application Evernote, whose insane motto is "Remember Everything," sticks out as a prime example. Essentially, it has the capacity to store EVERY possible thing for later use---notes on a napkin, a photo of your favorite bottle of sake, information on a web page. Everything you encounter in your life can be saved, tagged, and stored in your Evernote account. It's searchable and it's sexy (in the tour video, a search for a hotel results in images of a hand-written post-it labeled "The Venetian" stuck to the dude's old airplane tickets). But come on. Who has the time to invest in it all?

The whole scenario screams the question: are we living in the age of narcissism (in which we think everything we doodle on a napkin is worth keeping) or the age of progress (in which we become uber-efficient because we never waste time searching for anything, from our car keys to the genius invention you scribbled on a Post-it in 1998)?

The more I learn about the technology universe, the more I realize how crowded it is and how over-extended our potential users are. Applications like Evernote appeal to the control-freak within us, but won't ever reach broad consumption. Given the choice between scanning her old airline tickets into Evernote and spending a few minutes window-shopping, I think we know what the average Jane is going to pick. For that reason, if we want the Pragmatists as clients, we have to create software that's flashy enough for the technologists, but fulfills the true needs of the average consumer.

| Comments (2) | Technorati Tags :

Posted on June 4, 2008 by Avi Flax

Building RESTful Web Apps with Groovy and Restlet, Part 1: Up and Running

Here at Arc90, we love REST. We've implemented RESTful web apps using ColdFusion, Java, .NET/C#, and PHP. We're big fans of Restlet, a Java REST framework. I've also recently started experimenting with Groovy, "an agile dynamic language for the Java Platform," and so far I'm liking it.

So it's a no-brainer for us to put Groovy and Restlet together and see what happens. So far, I like what I see. That said, it'll be tough to convince some of my PHP-loving and Pythonistic colleagues to even consider Groovy, given its Java roots. Some of them fairly shudder when they hear those two syllables "ja-va". Ooh, scary.

This blog series will be my attempt to present how Groovy and Restlet together create a compelling platform for rapid RESTful web application development.

Continue reading "Building RESTful Web Apps with Groovy and Restlet, Part 1: Up and Running" »

| Comments (9) | Technorati Tags :

Posted on June 3, 2008 by Matt Williams

Twitter API Client Released

Here at Arc90, we love Twitter! Okay, okay - maybe not all of us love Twitter...some of us... I mean, well, at least one of us! Anyway, recently in need of Twitter's services for an office side-project, we decided to write our own client that would integrate nicely with our existing PHP libraries.

The default content type for returned data is JSON (we love JSON!), but all of Twitter's supported content types are available (XML, JSON, and in some cases RSS and ATOM).

Sound useful? Head on over to the lab and check it out!

Also...

Our Twitter client was largely inspired by the great web service clients available through the Zend Framework. Zend offers clients for several great web services like del.icio.us and Flickr; but Twitter is conspicuously absent from the list...

While we're not really sure why Zend has (so far) decided not to offer a Twitter client, we may also release a fully Zend-tastic version of the client leveraging Zend_Client_Rest, Zend_Date, etc in the near future. If you develop with Zend Framework and would find this useful, let us know!

| Comments (2) | Technorati Tags :

Posted on June 2, 2008 by Dave Hauenstein

A More Convenient Zend_Registry

The Zend_Registry is a pretty useful part of the MVC architecture of the Zend Framework. It’s a singleton class that keeps the developer from having to define global variables throughout their application. The downside is that retrieving the variables stored in the Zend_Registry can be tedious and annoying if you’re doing it often. Here’s an example:

$config = Zend_Registry::get('config');

Pretty verbose, huh? From that point on you can access the variables inside of config:

If($config->settings->environment == ‘development’) …

Wouldn’t it be much simpler if, whenever you needed to retrieve something from the Zend_Registry inside of your controllers, you could access them inline? For example:

$this->registry->config->settings->environment

In order to get this to work, you need to extend the Zend_Controller_Action class and overload the __get method. Here’s the code:

class Zarc_Controller_Action extends Zend_Controller_Action

{
   /**
    * overload __get in order to easily retrieve values from the Registry
    * and other sources. Throw an exception if the param could not be found.
    */
   public function __get($param)
   {
       if($param == 'registry' || $param == 'r')
       {
           return new Zarc_Registry();
       }
       else
       {
           throw new Exception("Could not find property {$param}");
       }
   }
}

All of your controller classes should now extend the new controller class you just created. For example:

Class IndexController extends Zarc_Controller_Action

Next, you need to write a class that searches the Zend_Registry for the property that is being requested.

/**
 * Applies an interface to the Zend_Registry that is cleaner and more
 * accessible than doing it the verbose Zend Framework way.
 */
class Zarc_Registry
{
   public function __get($param)
   {
       if(Zend_Registry::isRegistered($param))
       {
           return Zend_Registry::get($param);
       }
       else
       {
           throw new Zarc_Exception("Could not find property {$param}");
       }
   }
}

Then, save the two classes you created to your include path. Now, from your controller action methods you can access any variable stored in the Zend_Registry like this:

$this->registry->param
and this:
$this->r->param

This saves some time and makes your code much cleaner. You can also do this with sessions. Try it out, or ask us questions! If you need a deeper understanding leave us some comments and we’ll help you out.

| Comments (0) | Technorati Tags :

May 2008 | Main | July 2008