Catch up on stories from the past week (and beyond) at the Slashdot story archive

 



Forgot your password?
typodupeerror
×

Comment Yup. (Score 1) 614

I'm from California, and live here still; a 5.8 would be all over the news unless it was in the middle of East Bumfuck, San Bernardino County. [...] So yes, I know that in California we generally take these things in stride (though I guarantee you would be talking about a 5.8 if it hit near you), but just quit with the bullshit.

Yup. The most recent comparable earthquake I can recall here in the San Francisco Peninsula was the 2007 Alum Rock Earthquake, a 5.6. It was very noticeable, many people stopped working and spent the next 10 minutes chatting about it and browsing the web for information about it. It was a minor nationwide news story, meriting an AP story and brief mentions in CNN and the likes, and there were a few local stories the next day about the minor damage close to the epicenter. But then after that nobody really talks about it anymore.

A 5.9 in the east coast, well, that's a modest quake, but it's also a "Man bites dog" story.

Comment Re:nice, but still missing... (Score 1) 398

What happens is that the resource is freed as required because you're using RAII.

Except that if RAII frees the memory the pointer points at, and something else is using that memory, you've just broken your program.

There are two solutions to this problem: (a) avoid sharing object references, which means that you're deep copying object graphs all the time and using more memory than you should need; (b) use a smart pointer that does reference counting—which is like GC, except crappy.

Comment Re:Stupid slope (Score 1) 440

You never, EVER fire a weapon at someone you don't intend to kill, just as you don't point a weapon at something you don't intend to shoot.

"Intent to kill" is too strong in this case. Your intent in firing a gun at somebody should be to use lethal force to prevent them from using the same. Lethal force is force that you should reasonably expect to kill the target (you can't say "Gee, Your Honor, I didn't think that shooting him would kill him"), but such force is not always guaranteed to kill them; people survive being gunshot wounds at a non-trivial rate.

Basically, you're allowed to do things that fatally endanger your attacker's life, and nobody expects you to wear kid gloves while doing it.

Comment You're not allowed to make sure he dies (Score 2) 440

I think you guys are mostly just disagreeing about terminology. The thing is that using guns in self defense is shaped by both of these facts: (a) shooting somebody is always deadly force, (b) you have a right to defend yourself from deadly force with deadly force, but you don't have a right to prevent the attacker from surviving; taking an extra shot just to make sure the attacker dies is murder.

Saying that guns are deadly force means that there is no "safe" way to shoot somebody, like the "shoot him in the leg" meme would have you believe. If you shoot somebody, that person may die, period. If you shoot somebody in the leg and they die, no court will take it seriously any defense where you say that you only meant to wound them and used only wounding force and the death was a freak accident so please give me involuntary manslaughter only please. No; once more, shooting is deadly force, and you should expect the target to die.

Yet shooting somebody doesn't guarantee that they will die; a sizeable portion of gunshot victims survive. The law places a huge value on life, even the life of the attacker. If you defend yourself with deadly force, you're not allowed to prevent your attacker from surviving.

So what do you do, concretely? (a) You aim at the center of mass, because that's basically the only reliable way to hit in a high-stress situation; (b) you shoot until you can see that they are no longer a threat; (c) you're done; call 911. If the attacker lives, they live; if they die, they die.

Comment Re:Good. (Score 1) 145

The Gizmodo thing probably cost Gizmodo more in the end - Apple's basically blackballed them, and Apple brings in LOTS of clicks. In fact, at WWDC 2010, they were BEGGING for a press pass. Why they didn't think to purchase a ticket instead (sure, the press pass is free, but the iPhone4 reveal made that super unlikely).

Well, Apple may well have reached the point where they refuse to admit them to the event even if they bought tickets.

And if Gawker was smart, everything they did would've been over the phone or in-person. They weren't charged because there's simply no evidence. They said they paid $10,000, but the only evidence was a posting.

"Sir, our statement that we paid $10,000 for the stolen phone was a lie. The truth is that knowingly accepted that stolen phone for free!"

Comment Re:Good. (Score 1) 145

Before the seller sold it to Gizmodo, he called Apple and explained he had one of their prototype phones. He did this multiple times. At first they told him that could not be the case, then they took his information and just never got back to him.

So, the front-desk people Hogan talked to at Apple didn't know about the supar secret prototype. Um, actually, I mean, the front-desk people he talked to at Apple instead of contacting the guy that he knew had lost the phone (whose name he knew!) or the bar where he lost it (which the phone-loss guy called a few times trying to recover it), didn't know about the supar secret prototype. This just means that Hogan knew better than those front-desk folks. Not just that, but he also knew that he knew better, which is obvious from his subsequent actions; why would he ask for $10,000 for the phone unless he believed it was an Apple prototype?

At that point, it's abandoned property.

No it's not. California law clearly spells out the requirements are for claiming abandoned property. It involves going to the police and turning it in, and them holding it for 90 days (IIRC) before they're allowed to give it to you for you to keep.

Comment That's not how criminal law works (Score 1) 145

They knew the phone did not belong to the person selling it to them and they paid money for it. It doesn't matter what their intent was - they could be the most altruistic people ever to live, but paying money for property you know to be stolen/not owned by the person selling it to you: illegal.

You're misunderstanding some fundamental elements of criminal law. With a few exceptions, there are two elements that are necessary for any crime: an actus reus (a.k.a. external element, physical element, objective element, guilty act) and mens rea (a.k.a. fault element, subjective element, guilty mind). The first is the forbidden act; the second is a mental state that makes somebody criminally culpable for performing that act. Correspondingly, there are two ways of defending against a criminal accusation: "I didn't do the requisite act" and "assuming I did the act, my state of mind at the time excuses me from fault."

The problem with your statement that I quote is that you're basically saying that proving the actus reus is sufficient for guilt. This is not the case; it is necessary to prove both that and the mens rea, and there are such situations. So for example, if an altruistic person knowingly buys some stolen property and promptly returns it to its owner, they have performed the actus reus but without the mens rea, and thus committed no crime.

Now, I think we can agree that Gizmodo's actions have both elements. They have admitted to paying for the phone, and their actions demonstrate that they believed it belonged to Apple. Their intention in acquiring the phone, as demonstrated also by their actions, was to profit at the cost of depriving Apple of its property for some length of time.

Comment Um, what? (Score 1) 145

That's right. Nobody gives a fuck if there's no harm to the company that can actually be proven in court.

Ok, for the sake of argument, let's leave aside the whole angle where they revealed confidential information about Apple's business, that can be used by competitors to unfair advantage. Let's assume there is no harm in that.

They deprived Apple of some of its property for three weeks, during which they disassembled and broke it. How is that not harm?

Comment Re:Good. (Score 1) 145

Maybe the person paying for it would have to give it back. But go to jail? No.

So how would you write theft and other related laws so that either (a) paying somebody $10,000 for a phone you know doesn't belong to them is not theft or a substantially similar crime, or (b) it is theft, but you shouldn't go to jail because after you got caught you said you were gonna give it back?

Comment Re:Good. (Score 2, Insightful) 145

Depending on how they couched the previous press releases, they may have contended that they paid $10,000 for the rights to a story about the new iPhone, and the "finder" gave them the hardware to prove that his story about the new iPhone details was real.

...so the defense would be: "No, sir, we didn't buy this phone we knew to be stolen; we rented it in order to profit by dismantling it and putting photos of it in our website. (And yeah, sorry for breaking it!)" Yeah, that's gonna work great.

I don't understand why the DA isn't going after them.

Comment Re:Maybe a better candidate (Score 1) 594

I don't see how this is a bad idea. A pointer can become invalid. If you *know* it is going to be invalid, why not set it to a "known invalid" state instead of leaving it invalid and letting the program choke on it because there's no way to check for its validity.

You're missing the point. The important idea here is that a reference that might be invalid should not have the same type as one that's guaranteed to be valid, and that the latter one should be the common case. I.e., the language should not force you to accept a nullable pointer just because you want a pointer; you should be able to write code that assumes that the pointer is not null, and the compiler should enforce that such code can't be called with a null pointer. If the caller has a nullable pointer, then the caller's going to have to prove it's not null before passing it to your function.

Comment Re:Maybe a better candidate (Score 1) 594

without null, I can't imagine what would have been the case for implementing so many programming constructs today. Most languages have some type of isempty() which can b seen as a continuation of null, and I for one wouldn't want to implement any sort of list without it.

The fundamental problem that most programming languages that have a "null" value make is that they fail to distinguish between what ought to be two different types: basic types and nullable types. The basic idea is that Foo and nullable Foo should be two different types, such that the first one is always guaranteed to refer to some Foo, and only the second one may be null. You can always cast a value of one of these two types to the other; the cast from Foo to nullable Foo always succeds (and is in fact a noop), but the cast from nullable Foo to Foo will produce a runtime error if the runtime value is null.

To address your example, a simply linked list is simply a record that contains two fields: a content field and a nullable field for the next record. If the content field is not of a nullable type, then none of the list elements can be null.

This stuff is trivial to implement. It doesn't eliminate null pointer errors, but it makes them happen precisely at the points where you needed to have null checking. As things are in most language today, a null pointer will often get passed to and returned from dozens of functions or methods before it reaches one that actually uses it and gets stuck with an error that was caused somewhere else.

You may want to look at how data types work in Haskell, which has a more general solution that lumps nullability with enumerated and union types.

Comment Java strings (Score 1) 594

One performance advantage of NULL-terminated strings is you can trivially maintain two independent representations of the same string, one of which has a static prefix.

char *str2 = str1 + prefix_length;

In Java, strings are represented as an object that has a char[], a start index in the array, and a length. This representation gives you all of the advantages of the string-with-length-baked-in design and the representation sharing that you describe.

Any non-reallocating modification of one string instantly affects the other.

Which is a form of aliasing, one of the major sources of software bugs. Don't do that!

Slashdot Top Deals

The Tao is like a glob pattern: used but never used up. It is like the extern void: filled with infinite possibilities.

Working...