Yes, (low + high)/2 is well-defined for unsigned ints even when (low + high) > UINT_MAX. It's not the definition you want, though. The average of (UINT_MAX/2 + 1000) and (UINT_MAX/2 - 500) should not be 250.
It wasn't "just a hurricane"; it was a hurricane combining with a nor'easter. Technically it was no longer a hurricane at landfall, but that's sort of academic. The damage it did was real, not due to the "pathetic response of government" -- that caused fuel shortages as they diverted fuel to the politically connected, but it didn't do damage.
While Sandy's winds were minimal for a hurricane, it had a 9 foot storm surge. That's more characteristic of a Category 3 hurricane. And it hit at high tide. It pushed water up the Passaic and Hackensack rivers and flooded inland parts of New Jersey. It was also a huge storm: It had tropical storm force winds 500 miles from the center, which pulled down a lot of trees and power lines and damaged houses on its own accord.
I found my preparations for it to be quite adequate: I arranged to be a few thousand miles away, and my house is on the lee side of a hill.
Except they don't. Where is this mysterious foreign worker that works for less money under the H-1B program? I've never met one, and I think I know why: The terms of obtaining them require that they are paid the same as anybody else working in that particular job.
There's a billion ways around those rules. But if you work for a decent company you're unlikely to see too many of these lower-paid visa workers. The companies which hire them (like Infosys) tend to hire them by the planeload, and hire them almost exclusively; programmers-by-the-pound, if you will.
If tun==NULL, then tun->sk will cause the executing code to crash (unless it is suppressed with a custom SIGSEGV handler).
This is the kernel, so no SIGSEGV handler. Maybe a panic. But it's possible there's actually memory mapped at offsetof(tun, sk). I think not usually on x86, but on the old RS6000 even userspace processes can read NULL -- this was to enable an optimization of the common pattern if (foo == NULL || *foo == 0) -- the compiler would eliminate the short circuit.
I like this one, because it shows a very common weakness in high level languages.
In most machine languages, getting the average of two unsigned numbers up to UINT_MAX is absolutely trivial -- add the two, then shift right including the carry. The average of two signed numbers rounding to zero is a little more difficult (x86 makes it harder than it should be by not setting flags in a convenient manner), but still a few instructions.
In C? Assuming low and high are unsigned (low >> 1) + (high >> 1) + (low & high & 1). Ick. The answer given in your article is inadequate; it gets you one more bit.
Of course, now we have 64 bit integers and the problem is solved ONCE AND FOR ALL.
But there are algorithms which need the average of 64-bit unsigned numbers too.. ONCE AND FOR ALL
A near-collision state is one where a reasonable variance of the behavior of another vehicle could cause a collision.
I'd like to see a self-driving car avoid a "near-collision" state on the Capital Beltway during busy times. Or the MD I-270 of old (they've changed it a lot since I commuted on it) -- I (along with everyone else on the road) used to spend entire commutes in a "near-collision" state, sub-second following distances at ~65mph alternated with panic stops.
The biggest incorrect assumption here is that going 10% faster will get you there 10% sooner. Not only is the maths wrong, but it ignores that the actual result is that it gets you to the back of the queue at the traffic lights 10% sooner, and through the lights at the exact same time. Even on a freeway generally all it does is gets you to the back of the queue of slow moving cars slightly sooner, whereupon you get out of the queue at basically the exact same time.
Currently this is +4 insightful, but should be -1 Wrong. Driving faster than the speed limit does indeed reduce time taken to travel a given distance, compared to driving at the limit. I've driven trips where I've averaged greater than 65mph -- including stops -- on mostly 55mph roads.
On roads with traffic lights, it's more variable; you might gain nothing (back of the same line), or you might gain a lot (get a series of yellows where you would have gotten many reds).
On the highway, if traffic isn't too heavy, driving faster than the speed of traffic (which in the US is generally higher than the speed limit already) tends to result in your driving relatively fast through gaps between packs of traffic, and more slowly trying to move through the packs.
They are simultaneously arguing in lower courts that the lower courts have no jurisdiction because it's a matter for the SC, AND in the SC that the SC does not have jurisdiction, because it's a question for the lower courts.
That's pretty much what I'd expect (the government exempts itself from estoppel rules for a reason). But the Supreme Court justices weren't born yesterday, so it isn't likely to work. If both rulings go the government's way, the next step would be an appeal of the dismissal from the lower courts, which the Supreme Court would ultimately grant (unless they're intentionally trying to duck the issue, as they have before).
The last time the courts dismissed these claims, they said the petitioner had no standing because they couldn't demonstrate they'd been affected by the surveillance. That argument seems likely to be a non-starter this time, since it's now a matter of public record that the government demanded everything from a particular phone company during a particular period of time, so anyone who was a customer of that company in that period was affected.
We're never socially ready for ANYTHING new. The process of building social norms around something can't start until after that thing is introduced. The implication, then (often made explicit by hand-wringers calling themselves "ethicists" or some such thing) that we should stop the thing until we ARE "socially ready" for is equivalent to pure conservativism -- stopping everything new.
As long as you are doing it for fun (and follow AMA safety rules), RC camera work is legal.
The AMA has nothing to do with it. Much as they'd like to be (and may perhaps achieve in the near future), they are not a regulatory organization yet, and have no power outside their own membership and flying fields owner or controlled by their member clubs. I fly with no AMA membership and without paying any attention to the AMA safety code, and it's all perfectly legal so far.
Don't worry- the problem will solve itself. Keep checking your phone/smart watch for messages while conversing with others and before long you won't have to put up with people in "your personal space" any more.
In the words of that reknowned poet and epigrammist, Grumpycat: GOOD.
I do not say that it's not that way. I only say that 25 years ago such an "offer" would be met only with ridicule and belittlement towards the Chinese company. As you might have noticed, it's not the case today anymore.
It should be, though. The revelations of American spying haven't changed China one bit. And it's not like the NSA wouldn't be above finding out about backdoors put in by Chinese companies and using them itself.
... of three mice in the subway tunnel, mice prefer scavenging trash on the tracks to preservation of their own life. This makes them a poor choice for a model of anything but a crazed homeless person. Rats, on the other hand, tend to duck into a hole when the train comes, so repeating the study with them might provide some insight into human behavior.
The actual "learning" part that goes in a classroom is nothing, no problem. The hard part is the personal interaction part. And if you can't do that naturally, no program is going to teach it to you, and you won't succeed in business.
Yes. This was the worst bit of physics. The second-worst was the tumbling re-entry module somehow stabilizing. No -- she was 100% FSCKED at that point, and going to burn up and die. Her hair? Who cares? The parachute on the first re-entry module acted as if it was in air too, but that's much more minor.
If I were Scientific American, the last thing in the world I'd want to be associated with is this "ofek@biology-online.org" loser. Seriously, unless you're in law enforcement or the sex trade, you probably shouldn't be calling anyone a whore in your professional capacity.
But her response was combative, contained profanity, and implied (if unlikely) threats of violence. If I were a stodgy magazine like SciAm, I wouldn't want to be associated with that either.
"Hello, Monsanto, have you ever heard of a Round Up Ready patent tree? What's that? Yes, I was thinking the registered trademark symbol when I said Round Up. But about that tree... Yes, a patent tree. You haven't? Great. In that case, could I get the name of a Seattle Round Up distributor?"
The consequences of a missed positive opportunity are far less harmful than those of a negative one. I can afford to miss the occasional babe who smiles at me as a come-on.
The realist realizes she's smiling at the much better looking guy behind you.
Based on some people I know, I would say that if you have this gene variant you remain negative no matter how often your pessimism fails.
Pessimism's typical failure is that the worst-case failure mode you imagined wasn't bad enough. Of course THAT makes you remain negative.
On the rare occasions when things turn out better than you expected, it's never long before the reduced pessimism engendered by that event causes you to get bit in the butt again. After THAT happens more than a few times, THEN you become insensitive to success.
It's probably the gene that makes me really good at software testing. I have a knack for zeroing in on whatever is screwed up;)
No, that's a different one. Because software developers have the opposite version, even total pessimists; problems which are reproducible when we aren't around vanish when we are. It's the "works on my machine" gene.
Yes, (low + high)/2 is well-defined for unsigned ints even when (low + high) > UINT_MAX. It's not the definition you want, though. The average of (UINT_MAX/2 + 1000) and (UINT_MAX/2 - 500) should not be 250.
The NYSE datacenter is in Mahwah, NJ.
It wasn't "just a hurricane"; it was a hurricane combining with a nor'easter. Technically it was no longer a hurricane at landfall, but that's sort of academic. The damage it did was real, not due to the "pathetic response of government" -- that caused fuel shortages as they diverted fuel to the politically connected, but it didn't do damage.
While Sandy's winds were minimal for a hurricane, it had a 9 foot storm surge. That's more characteristic of a Category 3 hurricane. And it hit at high tide. It pushed water up the Passaic and Hackensack rivers and flooded inland parts of New Jersey. It was also a huge storm: It had tropical storm force winds 500 miles from the center, which pulled down a lot of trees and power lines and damaged houses on its own accord.
I found my preparations for it to be quite adequate: I arranged to be a few thousand miles away, and my house is on the lee side of a hill.
There's a billion ways around those rules. But if you work for a decent company you're unlikely to see too many of these lower-paid visa workers. The companies which hire them (like Infosys) tend to hire them by the planeload, and hire them almost exclusively; programmers-by-the-pound, if you will.
This is the kernel, so no SIGSEGV handler. Maybe a panic. But it's possible there's actually memory mapped at offsetof(tun, sk). I think not usually on x86, but on the old RS6000 even userspace processes can read NULL -- this was to enable an optimization of the common pattern if (foo == NULL || *foo == 0) -- the compiler would eliminate the short circuit.
I like this one, because it shows a very common weakness in high level languages.
In most machine languages, getting the average of two unsigned numbers up to UINT_MAX is absolutely trivial -- add the two, then shift right including the carry. The average of two signed numbers rounding to zero is a little more difficult (x86 makes it harder than it should be by not setting flags in a convenient manner), but still a few instructions.
In C? Assuming low and high are unsigned
(low >> 1) + (high >> 1) + (low & high & 1). Ick. The answer given in your article is inadequate; it gets you one more bit.
Of course, now we have 64 bit integers and the problem is solved ONCE AND FOR ALL.
But there are algorithms which need the average of 64-bit unsigned numbers too..
ONCE AND FOR ALL
This is "evidence-based medicine", n'est-ce pas?
I'd like to see a self-driving car avoid a "near-collision" state on the Capital Beltway during busy times. Or the MD I-270 of old (they've changed it a lot since I commuted on it) -- I (along with everyone else on the road) used to spend entire commutes in a "near-collision" state, sub-second following distances at ~65mph alternated with panic stops.
Currently this is +4 insightful, but should be -1 Wrong. Driving faster than the speed limit does indeed reduce time taken to travel a given distance, compared to driving at the limit. I've driven trips where I've averaged greater than 65mph -- including stops -- on mostly 55mph roads.
On roads with traffic lights, it's more variable; you might gain nothing (back of the same line), or you might gain a lot (get a series of yellows where you would have gotten many reds).
On the highway, if traffic isn't too heavy, driving faster than the speed of traffic (which in the US is generally higher than the speed limit already) tends to result in your driving relatively fast through gaps between packs of traffic, and more slowly trying to move through the packs.
That's pretty much what I'd expect (the government exempts itself from estoppel rules for a reason). But the Supreme Court justices weren't born yesterday, so it isn't likely to work. If both rulings go the government's way, the next step would be an appeal of the dismissal from the lower courts, which the Supreme Court would ultimately grant (unless they're intentionally trying to duck the issue, as they have before).
The last time the courts dismissed these claims, they said the petitioner had no standing because they couldn't demonstrate they'd been affected by the surveillance. That argument seems likely to be a non-starter this time, since it's now a matter of public record that the government demanded everything from a particular phone company during a particular period of time, so anyone who was a customer of that company in that period was affected.
We're never socially ready for ANYTHING new. The process of building social norms around something can't start until after that thing is introduced. The implication, then (often made explicit by hand-wringers calling themselves "ethicists" or some such thing) that we should stop the thing until we ARE "socially ready" for is equivalent to pure conservativism -- stopping everything new.
The AMA has nothing to do with it. Much as they'd like to be (and may perhaps achieve in the near future), they are not a regulatory organization yet, and have no power outside their own membership and flying fields owner or controlled by their member clubs. I fly with no AMA membership and without paying any attention to the AMA safety code, and it's all perfectly legal so far.
The term "unlicensed" is a red herring. No licenses are available.
In the words of that reknowned poet and epigrammist, Grumpycat: GOOD.
It should be, though. The revelations of American spying haven't changed China one bit. And it's not like the NSA wouldn't be above finding out about backdoors put in by Chinese companies and using them itself.
Yeah, that's what the guy who drives the train tells me.
... of three mice in the subway tunnel, mice prefer scavenging trash on the tracks to preservation of their own life. This makes them a poor choice for a model of anything but a crazed homeless person. Rats, on the other hand, tend to duck into a hole when the train comes, so repeating the study with them might provide some insight into human behavior.
The actual "learning" part that goes in a classroom is nothing, no problem. The hard part is the personal interaction part. And if you can't do that naturally, no program is going to teach it to you, and you won't succeed in business.
Yes. This was the worst bit of physics. The second-worst was the tumbling re-entry module somehow stabilizing. No -- she was 100% FSCKED at that point, and going to burn up and die. Her hair? Who cares? The parachute on the first re-entry module acted as if it was in air too, but that's much more minor.
"Sensible adult conversation" = "If you don't accept my argument, you're just being a child".
If I were Scientific American, the last thing in the world I'd want to be associated with is this "ofek@biology-online.org" loser. Seriously, unless you're in law enforcement or the sex trade, you probably shouldn't be calling anyone a whore in your professional capacity.
But her response was combative, contained profanity, and implied (if unlikely) threats of violence. If I were a stodgy magazine like SciAm, I wouldn't want to be associated with that either.
"Hello, Monsanto, have you ever heard of a Round Up Ready patent tree? What's that? Yes, I was thinking the registered trademark symbol when I said Round Up. But about that tree... Yes, a patent tree. You haven't? Great. In that case, could I get the name of a Seattle Round Up distributor?"
The realist realizes she's smiling at the much better looking guy behind you.
Pessimism's typical failure is that the worst-case failure mode you imagined wasn't bad enough. Of course THAT makes you remain negative.
On the rare occasions when things turn out better than you expected, it's never long before the reduced pessimism engendered by that event causes you to get bit in the butt again. After THAT happens more than a few times, THEN you become insensitive to success.
No, that's a different one. Because software developers have the opposite version, even total pessimists; problems which are reproducible when we aren't around vanish when we are. It's the "works on my machine" gene.