Sunday, November 29, 2009

How customer service SHOULD work.

I have my own opinions on how customer service should be done. When I previously worked in the service industry I applied my ideals to great success. However, it the rest of the industry seems to have the opposite ideas. So when I do find customer service that treats me with respect as a customer and not a walking checkbook, I'm always pleasantly surprised.

This is how NOT to do it:
Pretty much since the first day I took my iPhone home I had problems with reception. I was far-ish from a tower and the signal didn't penetrate into the finished basement that served as my room. When I moved to my new apartment in Norwood, MA, I had even WORSE reception. I was told by AT&T customer service this was because I was barely at the maximum range of the nearest tower. I was also told there was nothing I could do but continue to pay them for a service I wasn't receiving and hope that eventually they built a tower closer to me. But he couldn't tell me when or where the next group of towers was going to be. When I left AT&T because I wasn't getting any service, cellular or customer, I was charged a very large early-cancellation fee. While I fully admit that I canceled early, I contend that the lack of reception was a valid reason. When I confronted them regarding the fee they claimed there was nothing that could be done, and refused to consider the validity of my reason for dropping them. When I finally got them to agree to think about dropping the charge they told me they'd pass the request to the appeals department which would contact me within a week. It's been maybe 2.5 months and I haven't heard back from them. This tale is so filled fail, it actually makes me sad. Not like Bambi's Mom dying, but still pretty depressing.

On the other hand, I had the same problem with my Sprint phone since I got it. Very poor reception. Pretty much had to leave the apartment to use the phone. However, when I called their customer service I was offered an option to remedy the situation almost immediately. I was offered a device that's effectively a CDMA mini-tower. Since I was using it to upgrade from NO reception, not just poor reception, I would be charged half price for this device and I wouldn't have to pay the monthly fee for using the device. 2 months later when I examined my bill, I had been charged full price for the device and had usage fees for it. I immediately used online chat to confront them about the charges. The Sprint rep took maybe 5 minutes to review my file and then told me "Yup, you're right! Our bad!" And instantly removed the charges. There was no escalation, no hassel, no confrontation. When I got done with them, I was grateful for the assistance and actually happy about my choice of wireless carrier. I was so ecstatic about the fact they didn't try to bend me over and take all my money, I didn't even attempt to have my late payment charges removed. I'm left with the impression that THIS is how customer service is done.

So, congrats Sprint for getting something so simple right, when everyone else is hell bent on getting it wrong in the hope of making a quick buck by wringing your customers for money you don't deserve.

Friday, November 6, 2009

Mojo Rising: AutoFocusing on Dialogs

While I have every confidence the documented controller.setInitialFocusedElement() method will work during scene pushes, the story is somewhat different if you only showDialog(). I'm currently adding the final touches to my first complete Palm Pre application, in preparation for a postmortem blog post on developing with Mojo.
One of those final touches was automatically focusing on the text input widget when the dialog was shown. This simple thing took me over 2 hours to figure out and required reading through the actual framework code provided by Palm.
For whatever reason some methods of the scene controller aren't fired on showDialog() like they are on pushScene(). Might track down more on this later.
For now, to get Mojo to automatically focus on an element when a dialog is shown, do this:

1. When creating your view, add a tabindex="0" to the div which will become the widget. Or use the Mojo.View.makeFocusable() method, which currently does the same thing.
2. In the Assistant object you passed to the showDialog() method as the "assistant" property, add the following line of code to the activate() method:
Mojo.View.advanceFocus(this.controller.sceneElement);

Alternatively you could just call:
this.controller.advanceFocus();
However, the advanceFocus() method of the scene controller object is annotated as private so using it is likely not the best practice. There also might be a better way to get the sceneElement, but at the time of this posting I am far too tired to look it up.

More Mojo Rising coming soon, folks.

--PXA

Wednesday, October 7, 2009

I hate sports.

How very unamerican of me, but I've never been interested in sports. Not really interested in playing and DEFINITELY not interested in watching. I fail to see how watching other people play a game can be enthralling, and why is chess boring to watch but football is popular? Are viewers just getting off on the movement? Is it a living vicariously thing? Whatever, I don't get it...but that's not my point.
I know I'm not alone in my lack of enjoyment of sports, there are plenty of people who are just plain don't care and want absolutely nothing to do with it. That's not really my point either, though.
What's bothering me is how it's assumed that sports is such a part of mainstream life that EVERYONE wants to participate in it.
I recently got an HDTV and subscribed to Verizon's FiOS TV service. As part of this service I've been gifted with what looks like a dozen sports channels, NFL, Nascar, NHL, NBA, etc. And that's just the HD side of the dial. But I don't get Shotime, so I can't watch Dexter. I want to watch Dexter, I don't want to watch sports...and more to the point I will NEVER want to watch sports. There is no way for me UNorder the sports package, but to get Shotime I have to sign up for a movies extras package that costs $14.99 more a month. I get the movie channels being their own package, they're specialized and generally of a higher caliber than the other channels. But sports programming is specialized, regardless of whether its proponents would care to admit it. Why can't I opt out? I'd gladly pay for the movie channels if I didn't have to pay for this sports crap I'm not watching.
Anyway, I was almost over my nerd rage at that annoyance when I went to update my phone's OS. Out of the box, and again with this update, the phone has some stock applications. Many of these are useful generic things like youtube, google maps, sprint navigator, etc. But the update also re-installed 2 sports specific applications: NFL and Nascar. Now I'm not really complaining about the inclusion of these applications in the phone or the update...I'm sure NFL and Nascar paid Sprint or Palm some good advertising money to get a presence on the phone. The problem I have is that I can't get rid of these things. Well, that's not true: I can. But I'm not the vast majority of the population. The only way to get rid of these applications is to 'root' the Palm Pre, that is use the hidden developer mode to gain shell access to the phone, then use that command shell to delete the application directly from the phone. The UI that you would normally use to remove any other application simple doesn't give you the option to remove these.
While that situation doesn't have the trade off the TV one does, there's nothing I could be getting instead of these applications, it's still frustrating I can't get rid of these things that are absolutely useless. I don't like sports, I want to get rid of these applications, I want to get rid of these channels.

Liking sports is a choice you made, not liking sports is a choice I made. Why do you feel your choice has the right to screw with mine?

--PXA

Wednesday, September 9, 2009

Javascript Shenanigans: Advance Javascript Resource

I was wandering around the internet at work today and stumbled upon this excellent application at John Resig's site ejohn.org.
I'm a little annoyed I hadn't found anything like this when I was looking for JS resources when I was trying to figure out some of the more advanced things like closures and prototype hackery. This starts slow but gets good fast:
Learning Advanced Javascript


Be enlightened.

--PXA

Friday, August 28, 2009

Javascript Shenanigans: How jQuery works. Kinda.

Every time I re-read the source code to jQuery I understand something new about how it works. It's actually rather enlightening, figuring out how it works.

I'd like to explain the way the "jQuery" code from the previous post works, since it uses a decent amount of more advances javascript and led me to a greater understanding of the language.

So, this:

(function () {
$ = function(elem) {
return new $.prototype.init(elem);
};
$.prototype = {
init: function(elem) {
this[0] = elem;
return this;
},
each: function(f) {
for (var i in this[0])
f.call(this[0][i]);
return this;
}
};
$.prototype.init.prototype = $.prototype;
})();

Broken down:
First, to make sure that everything is setup as soon as the file is loaded (before any of the document is even parsed by the browser), the setup is wrapped inside an anonymous block. I'm not sure what the proper javascript term for this is, but it's very similar to the "static { }" block from Java, where any code contained within it is immediately executed as soon as the class is loaded by the JVM. As an example:
(function (val) { alert(val); })("HI MOM");
Would immediately alert the string "HI MOM" before any content loads.

After this, we define the $ function. The function does the simple job of returning a new instance of "init". While creating instances of functions may look odd, Javascript allows this. Functions are often used to declare what's commonly thought of as an object. While "function $(elem)" is legal, I find the "var $ = function(elem)" notation makes a little more sense.

Javascript does not formally define its classes, so multiple instances of "object" can each have completely different properties and methods. Properties and methods are assigned at runtime. The .prototype method, mentioned in the previous post gives us a way to make sure all instances of an object have specific members. So, $.prototype is an object containing additional members of the $ object, which will be applied to every $ around.

In it, we define an init method which stores us a reference to the element we gave it, and then returns an instance of "init". After that we define an each method, which simple iterates whatever "this[0]" is and returns. While it's not strictly necessary to return from this function it let's us do something really cool: chaining. Look it up at jQuery's site, it rocks. This each method accepts a single parameter, a callback function, which is executed on each iteration of the loop. Rather than simply calling the function like "f()", we can use the more flexible .call() method. This basically allows us to "redefine the execution context for the given function", or in simple terms it lets us change the value of the "this" variable.

This final line adds $'s prototype to init as a prototype. This is why jQuery plugins are written
jQuery.fn.nameofmyplugin = ...
In real jQuery, jQuery.fn = jQuery.prototype, so your plugin adds another object to $'s prototype, which also adds it to $.init's prototype.

g'night. tired. bye.

Thursday, August 27, 2009

Javascript Shenanigans: Why I hate Prototype

Surprise, I'm not dead yet!

So anyway, I've been doing a decent amount of Javascript lately. This includes pure JS, and a few frameworks...jQuery, Prototype, and Dojo. I'm going to ignore Dojo for now since it really is a whole other beast than either jQuery or Prototype.

jQuery and Prototype behave in similar ways, providing a helper function like $() and allowing you a relatively standard API to do things that certain browsers do differently (like CSS). But jQuery is nice in that it stays out of your way, Prototype intrudes. It's the asshole that starts staring over your shoulder and saying everything you're doing is wrong as soon as it walks into the room.
Technically, Prototype grabs your keyboard and starts keymashing.
Odds are pretty good that a pure javascript application will stop working as soon as prototype is included in the page.
Take a look at the following example:

window.onload = function () {
var arr = [0,2,5,7,3];
alert(arr.length);
for (var i in arr)
alert(i);
};
The variable arr is an array with 5 elements. The first alert returns the expected "5", so you would expect that the "For .. in" loop (or a foreach loop) would alert you 5 values. In pure JS it does as expected, but when prototype gets in the game the for loop runs 43 time. Holy hot damn, what just happened to my code? Well, now you can't use foreach anymore because prototype all up in da hizzy.
The root of this problem is in the way that prototype works: by extending the DOM and javascript itself, through the "prototype" method.
In my copious free time I decided to see if I couldn't figure out how each of these frameworks implemented their "each" iterator function.

So, this emulates prototype's behavior:

Array.prototype.each = function (f,context) {
for (var i = 0; i<this.length; i++)
f.call(context,this[i]);
}

Yes, prototype is somewhat more elegant than this, but the basic premise is the same.
While jQuery's behavior is a bit more complicated than this (And I'm pretty certain that this is because John Resig is an immortal space traveler, come from the stars to give us amazing client side scripting languages), I feel it offers a better way of achieving the same effect.

(function () {
$ = function(elem) {
return new $.prototype.init(elem);
};
$.prototype = {
init: function(elem) {
this[0] = elem;
return this;
},
each: function(f) {
for (var i in this[0])
f.call(this[0][i]);
return this;
}
};
$.prototype.init.prototype = $.prototype;
})();

This allows you to iterate over the array in much the same way, except it doesn't modify the array so our original example would still loop 5 times and not 43.
But why does it work? Next time, on Build Environment.

--PXA

Saturday, June 6, 2009

Level 3, BEGIN

So it's been a long time since I've written anything, and that's because since I last wrote here I got a full time job, graduated from RIT, and moved to the Boston area. But now I have some time and figured I might as well put something up.

Right now, my brand new Palm Pre is syncing a small selection of my music library from iTunes, which in and of itself it kindof cool. The iTunes syncing is amazingly easy, but I'm going to hold judgement for now until it finishes. If it got my contacts it'd be sweet. The rep at the Sprint store was able to sync from my iPhone several things, but I didn't see the contacts list. We'll see if iTunes syncs them. I did add my facebook account and as promised it created a contacts list from that information, but I was driving at the time so I didn't see if they were combined with other contacts.

On first impression I'm a little ambivilant about several aspects of the phone. I like the weight and I don't mind at all that it's a little thick. But the slider and the keyboard feel a little cheap. Although the one handed mechanics of the slider are great. On the software side of things, finding certain settings is a little odd sometimes, but the app catalog is ULTRA easy to use. And the phone is FAST. Everything is FAST, loading new applications, quitting, backgrounding, switching, using. It's all so very smooth.

WebOS 1.0.2 is out, I'm going to update to it.