Hong Kong

Occupy Hong Kong - Admiralty

It looks like the Occupy protests in Hong Kong are winding down. I had the chance to see what was actually happening on the ground last week and to talk with some people there. A few take-aways from my point of view:

The majority of Hong-Kongers probably don’t support continued occupation of city streets. I think recent polls have it at somewhere around 60-80% wanting the protesters to leave. I would further guess that overall support varies drastically based on age and how often they drive.

The challenge for pro-democracy activists is to figure out how to turn this into a long-run movement. Opposition to Occupy isn’t based so much on opposition to universal suffrage as a belief that direct confrontation with mainland China is a losing proposition.

More …

Is it Constitutional to Suspend Deportations? What About Work Permits?

As much I’m OK with suspending deportations from a policy perspective, can the president constitutionally suspend deportations?

If you replace “suspend deportations” with “we will deport unauthorized immigrants who have not committed a violent crime ONLY AFTER we finish deporting every unauthorized immigrant convicted of a violent crime” (read: a long, long time from now — if ever), then that just sounds like prosecutorial discretion. It’s no different that letting someone arrested for public intoxication out of jail because we don’t have the resources to try every publicly drunk person out there. That doesn’t mean we technically can’t re-arrest that person and try them later (at least until the statute of limitations runs out), it just means we’re not going to do it any time soon.

One catch: Obama is saying that the deportation suspension will last three years. But he’s only in office for another two. If his (possibly Republican) successor decides to re-start deportations, I’m not sure that the Obama’s three-year promise will carry much weight in court.

What I’m not so sure about is the granting of work permits. You could argue that this power is incident to the president suspending (or deferring) deportations, but that seems like a stretch. This would be an affirmative act by the executive branch, as opposed the president simply declining to spend a limited pool of resources in a certain way. And given that Congress has already capped the total number of work-related visas to begin with, it’s an affirmative act that conflicts with Congress’s stated intent.

One possibility is to simply treat the “work permits” as the president saying he will defer prosecuting any employers who hire unauthorized immigrants with such a permit. But again — seems like a stretch.

Cross-posed on Facebook.

California Propositions 2014

Cross-posting my thoughts on this election cycle’s propositions for posterity’s sake:

Prop 1 – Yes. Spend more money on much-needed water infrastructure. The con argument as far as I can tell is that isn’t a magic bullet for CA’s drought problems (which largely stem from farming water-intensive crops in dry areas) and general concerns that the state isn’t very good at handling large sums of money (which would be persuasive if there were some more responsible group that we could hand the money to).

Prop 2 – Yes. Toughen CA’s rainy day fund. Good governance generally.

Prop 45 – No. I’m a bit torn on this actually (as is the Democratic Party apparently — Senators Boxer and Feinstein endorse but Nancy Pelosi opposes. Prop 45 requires that the Insurance Commissioner approves any rate hikes by insurance companies. In theory, this allows regulators to keep premiums down, but I’m not convinced that a lack of regulation is the reason for crazy health insurance premiums. Lack of pricing transparency and excess bureaucracy seem to play a bigger role, and Prop 45 doesn’t address that. However, Prop 45 would introduce additional delay and administrative uncertainty to putting new health plans on the Covered California healthcare exchange, which would reduce some of the options available to new enrollees. So, leaning no on this, but happy to hear from someone more familiar with how healthcare works.

Prop 46 – No. This proposition mixes together a bunch of medical malpractice issues that should really be addressed separately. The big one is that it increases the $250K cap on pain and suffering in medical malpractice lawsuits to $1M. This isn’t a big deal in and of itself — the $250K cap was put in place in 1975. Adjusted for inflation, that’s about $1M in today’s dollars (and really, as a lawyer, I’m not one to dispute higher jury awards).

What I don’t like though is that it requires mandatory drug testing of doctors whenever an “adverse event” occurs. Ugh. Being a doctor is already a pretty demoralizing job. Mistakes happen because doctors are human, and overworked sleep-deprived humans at that. Peeing in a cup won’t fix that.

Prop 47 – Yes. Prop 47 reduces penalties for drug and other minor crimes. Harsh sentencing guidelines haven’t done much to actually reduce drug use or petty theft. They have, however, cost us obscene amounts of money and wrecked havoc on civil liberties.

Prop 48 – Yes. The story behind Prop 48, as far as I can tell, is that when the state approved casinos for Native American tribes, a couple tribes got screwed by technicalities and left out. This just puts those tribes on equal footing with the rest of the tribes. Also, casinos don’t bother me and the tribes are giving us money.

(AngularJS) Testing headers with whenGET / expectGET

Jotting this down here in case anyone else stumbles on the same issue(s) in AngularJS.

Suppose you’re mocking out $httpBackend in a unit test and want to test headers, like so:

// Assume $httpBackend and $http have been properly injected above
it("should not send a token if none is set", function() {
 $httpBackend.whenGET("/api-call", function(headers) {
   expect(headers.Authorization).toBeUndefined();
 }).respond(200, {hello: "world"});
 $http.get("/api-call");
 $httpBackend.flush();
});

This won’t work. If a function is passed to whenGET, it expects a true/false return value to signal whether the headers were correct. Instead, try this:

// Assume $httpBackend and $http have been properly injected above
it("should not send a token if none is set", function() {
 $httpBackend.whenGET("/api-call", function(headers) {
   return !headers.Authorization;
 }).respond(200, {hello: "world"});
 $http.get("/api-call");
 $httpBackend.flush();
});

Now, however, when the header test fails, you’ll get the following error:

Error: Unexpected request: GET /api-call

This is a bit misleading, since it implies the $http call somehow never hit $httpbackend. However, the issue isn’t that the GET request was unexpected; it’s that the the GET request with that particular header was incorrect. If you swap whenGET with expectGET, you’ll get a much more sensible failure message:

Error: Expected GET /api-call with different headers

In both cases, returning the correct header should make this failure go away.

The Use and Abuse of Text Messages

I have a new(-ish) pet peeve: receiving a text message when an e-mail (or a Facebook message or whatever) would suffice. As a rule of thumb, if a message does not require my attention within 24 hours, don’t text me. E-mail me.

E-mail’s pretty awesome. I can flag messages I think are important (or star them in Gmail). I can use tools like Boomerang to postpone responding to messages until later. I can search for old e-mails when I need to recall something that someone said. I can set up filters to sort my e-mails based on context. I can forward funny pictures to my friends. I can attach things (like calendar invites!). I can read and write them on my phone or my laptop. I can have more than one e-mail address and separate work e-mails from not-work e-mails. I can CC and BCC and do all the wonderful things that have been part of e-mail since time immemorial (1978-ish?).

More …