August 25th, 2009

ronin

Adobe is only alive because it's illegal for me to behead them.


Me:
var myMC:MovieClip = MovieClip(PreLoadedMC.content.root);
myMC.gotoAndPlay(myMC.scenes[0].labels[0], myMC.scenes[0]); // Play from beginning.


Flash:
(SILENT FAILURE)

Uh-huh. Right. Sure. I believe that shit. Definitely.

(fdb) print myMC.scenes
$2 = [Object 53179609, class='Array']
(fdb) print myMC.scenes.length
$3 = 1 (0x1)
(fdb) print myMC.scenes[0]
$4 = [Object 52520969, class='flash.display::Scene']
(fdb) print myMC.scenes[0].name
$5 = "Scene 1"
(fdb) print myMC.scenes[0].labels
$6 = [Object 54093129, class='Array']
(fdb) print myMC.scenes[0].labels.length
$7 = 0 (0x0)
(fdb)


Thanks for nothing, Adobe. You stupid fuckers. Why did you even bother putting this "scenes" array in MovieClip when you had no intention of populating it? Why didn't you say something in the docs like, "The array may not contain anything."

More than anything, WHY DON'T YOU FUCKING TELL ME WHEN I'M ACCESSING A NULL VALUE? It's not like this slow-ass piece of shit Flash player is running compiled code or something! Silent failure is never acceptable.

Hopefully Google will pick this post up. So let me sound the warning explicitly for any other Flex developer who's trying to use a MovieClip :

YOU CANNOT ASSUME THAT THERE IS ANYTHING IN A MovieClip.scenes OR MovieClip.scenes[n].labels ARRAY!

Do not let Adobe's "documentation" fool you. They're full of shit. (As always.)

Also, note that - by default - frames are numbered starting at 1. Rather than at 0. I mean, why would Adobe want to be consistent with every other programming language on the face of the planet? However, don't count on the first frame of a SWF always being 1. I bet that if the people making your SWFs started their frames at 27 for some reason, then gotoAndPlay(1) would silently fail. And you will have no goddamn idea why.

This is yet another day-long pile of bullshit I had to slog through just to do the simplest possible thing in Flex.
ronin

Electro-magnetism is a consequence of Relativity.


Shown below is a model of a wire with a current flowing to the right. I'm taking the current to consist of a flow of negative charges, separated by an average distance of l. The wire has to be electrically neutral in the lab frame, so there must be a bunch of negative charges, at rest, separated by the same average distance. Therefore there's no electrostatic force on a test charge Q outside the wire.

[Now what if the charges start moving?] Because they're moving, the average distance between them is length-contracted by the Lorentz factor. Meanwhile, the positive charges are at rest, so the average distance between them is un-length-contracted by the Lorentz factor. These effects give the wire a net negative charge, so it exerts an attractive electrostatic force on the test charge. Back in the lab frame, we call this force a magnetic force.

(By the way, it's remarkable that we can measure magnetic forces at all, since the average drift velocity in a household wire is only a snail's pace: v/c is typically only 10-13, so the Lorentz factor differs from 1 only by about one part in 1026. We can still measure this effect because the total charge of all the conduction electrons in a meter-long wire is tens of thousands of coulombs; two such charges separated by only a few millimeters would exert enormous electrostatic forces on each other.)


http://physics.weber.edu/schroeder/mrr/MRRtalk.html

Mind completely blown. That's both obvious after the fact, and completely amazing to consider.
ronin

Why not-for/non-profit health insurance will be better.


http://www.youtube.com/watch?v=Jng4TnKqy6A

Generally speaking, I'm not usually in favor of turning things over to the government. But there are a few exceptions. And they all have one thing in common: they're all times where human life is far more important than profit. Policing, Firefighting and Health Care are all areas where human life is far more important than turning a profit. And that's why we need to have some kind of not-for or non-profit option for health care. It doesn't have to be government run. But it can't be for profit. (And it absolutely cannot be a situation where investors have the legal right to sue the insuring organization if they can show that the insuring organization didn't do something it could have to increase profits. E.g., insurers can't be stock-based corporations. That's exactly how we got into the mess we're in now.)

And yeah, I do expect the cost of health care to go up, slightly to moderately, if we socialize it. But at least we'll be getting something for our money. Right now, most of us pay out the nose for health insurance, and don't get much health care for all that money. I would not call that an "efficient" outcome, would you?

(via flemco)