February 2008

le racisme

..so I’ve just surfaced from a couple Kafka-esque evenings spent in xbox tech support limbo. I won’t bore you with the details of why (suffice to say, Microsoft’s policy of rewarding its long-time customers by deleting their access still has some kinks to work out), but I’ve gone from xbox tech support, to xbox level 2 tech support, to email support with Windows Live ID, back to Xbox tech support, to billing, and back to xbox leve 2 tech support, where the last guy I talked to hung up on me (”accidentally” I’m sure). Irate, I called back, trying to bypass the Mike the X-Treme!!11! voice-activated computer phone menu by shouting “OPERATOR! OPERATOR! OPERATOR!” at it until stopped trying to sell me upgrades and connected me to a live person. So, after about 4 hours of holding, transferring, re-explaining the problem, re-explaining why their proposed solutions won’t work, re-explaining the problem, re-trying the proposed solutions so I could re-tell them the exact error messages, holding, listening to the Most X-Treme!!11!est Of All Hold Music, transferring, etc… this last person fixed the problem in 6 minutes. She said, “hmm. well, we could do this….” and it was done.

I’m sure you can tell by the subject of this post that the problem here is that the difference was the last person I talked to and the first 6 was that she was American. And it really makes me feel awful that, when I heard an accent I recognized as not-Indian, a tiny little part of me went, “oh, thank god.”

Intellectually, I know it’s not India’s fault. Intellectually, I know that the people who man these tech support lines are given a strict script to follow and are probably not allowed to vary from it too much. I know that, for every phone operator out there, there are probably 100 people who want their job, so the pressure to fulfill the time quotas and to never veer from the script must be intense. And that the scripts probably work for 95% of the callers, and that I only call tech support for those issues that the script can’t handle.

But still, it reinforces a subtle racism when, if the Indian front-lines can’t solve the problem, and they bump you up far enough up the chain, you eventually reach an American voice with actual authority to make changes. I think that’s what gets me most. Because before I talked to Honkey McPersonable, I talked to an Indian in the billing department who said what I was asking for wasn’t possible. It’s like they get the Indians to do all the dirty work, sending customers through endless loops of transferring and holding and red tape, and they ride in like a Great White Hope, bestowing clarity and authority to those who have risen above the fray.

So F— you, Microsoft, and F— you, BellSouth (another, much longer story). F— you for making me dread hearing what I used to think was the Most Awesomest Accent of English Ever. F— you for reducing your tech support to reports on time-per-call and calls-answered-per-day. F— you for not giving your farmed-out Support Centers any authority to act on customer’s behalf. F— you for your whole poopy Tech Support system.

rant

Comments (0)

Permalink

Elegant little PHP JSON encoder

…so I wrote (what I think is a) clever little function (well, two functions) to take a complex php variable and turn it into a json-ized string, ready to be passed back to javascript. It works on the principle that json really only has a couple rules if text formatting: strings go inside double quotes, with both slashes and double-quotes escaped, iterative arrays are comma delimited inside brackets [obj1,obj2], and associative arrays go inside curly-brackets {key:val,key:val}. Using these three points, and a little bit (ok, a lot of) recursion, and voila, an elegant little function.

Of course, this doesn’t handle unicode, or any really special cases, but if you’re looking for a basic object parser, and you dont’ have access to php 5.2, which has it built into the language, it’ll do the trick…

/**
 * input an object, returns a json-ized string of said object
 * @return
 * @param $obj Object
 */
function php_json_encode($obj) {
	if (is_array($obj)) {
		if (array_is_associative($obj)) {
			$arr_out = array();
			foreach ($obj as $key=>$val) {
				$arr_out[] = '"' . $key . '":' . php_json_encode($val);
			}
			return '{' . implode(',', $arr_out) . '}';
		} else {
			$arr_out = array();
			$ct = count($obj);
			for ($j = 0; $j < $ct; $j++) {
				$arr_out[] = php_json_encode($obj[$j]);
			}
			return '[' . implode(',', $arr_out) . ']';
		}
	} else {
		if (is_int($obj)) {
			return $obj;
		} else {
			$str_out = stripslashes(trim($obj));
			$str_out = str_replace(array('"', '', '/'), array('\"', '\', '/'), $str_out);
			return '"' . $str_out . '"';
		}

	}
}

function array_is_associative($array) {
	$count = count($array);
	for ($i = 0; $i < $count; $i++) {
		if (!array_key_exists($i, $array)) {
			return true;
		}
	}
	return false;
}

ajax
coding
json
php

Comments (1)

Permalink