Slashdot is powered by your submissions, so send in your scoop


Forgot your password?
Polls on the front page of Slashdot? Is the world coming to an end?! Nope; read more about it. ×

Comment: Re:Answer (Score 4, Interesting) 335

by slimjim8094 (#49788005) Attached to: How Much C++ Should You Know For an Entry-Level C++ Job?

(I work at Google and use C++ there, but what follows is my opinion)

What precisely don't you like about the C++ style guide? (This is almost identical to the internal guide)

- It is true that exceptions are verboten, but honestly it's not particularly limiting. Java gets exceptions right - something is truly "impossible" (in a crash-the-program you-have-a-logic-error sense) and thus you don't need to handle it, or else it's "expected" like an I/O issue and the language forces you to do something with it - either try/catch, or declaring that you're potentially passing it along. C++ doesn't have any such enforcement, which makes it very hard to reason about what a function may throw at you. You rely on everybody in the entire call hierarchy doing the right thing. Reminiscing about my Java days, the lack of exceptions does make some things somewhat more cumbersome to deal with - having to explicitly return a status object, for instance, to deal with plausible-but-atypical cases. But the Google guide is fairly apologetic in this area and basically says "sure, we'd use it if we had a brand-new codebase, but we don't..." and the reasons that follow for why exceptions are hard to integrate into a truly enormous codebase seem sound to me. What do you disagree with about this reasoning?

- There is certainly no rule about "allocate at the top, clean up at the bottom, never return from the middle". In fact, with unique_ptr and the like, there's even less reason to do those kind of things than there's ever been. The local variable part of the style guide actually explicitly encourages as-close-as-possible declaration, and the rest of the style guide is quite gung-ho about unique_ptr (we actually had an internal class for a long time that was sufficiently identical to unique_ptr that they were able to replace all uses and remove the custom type in just a few months). I can find no reference to any sort of prescription about the location of return statements.

- The standard libraries have actually been moving away from exceptions, haven't they? C++11 introduced 'noexcept' and added it to a bunch of methods, and the specs for a lot of other ones guarantee that the only exceptions are from the allocator (e.g. std::bad_alloc). To be clear there is no prohibition against *using* code (especially the standard library) that may throw exceptions.

In a nutshell the style guide is, in order, "be readable" followed by "be consistent". It is hilariously easy to write unreadable, bug-prone C++ code. Nobody cares if your code is perfect and correct, they care if the next guy along can modify or use it correctly and it is useful to have a style guide to make some of the more hard to reason about things impossible. How many different bits of code could the statement 'a = b;' potentially execute? (It's a lot - copy constructor, operator=, operator Foo(), etc.) The style guide limits it to just a few things you might have to consider, so that when you use some code someone wrote 6 years ago there's not so much to look at. C++ has references and pointers, which is great, but at least with pointers there's a hint that you might have "spooky action at a distance" so the guide mandates their use for out-params which seems perfectly reasonable since it's basically arbitrary which to use - and in practice, it's a really handy hint to have when you're reading. Unless you're passing an address, you know your copy can't be modified. IMO, way more readable.

If you've really been hanging up on recruiters because you object to the style guide, it is probably worthwhile to actually ensure that your understanding of it is correct and up to date. It has changed in recent years as C++11 has become better understood and it is fair to say that it is far more liberal to things like lambdas, template metaprogramming, operator overloading, copyable classes, etc - than it was a few years ago.

Comment: Re:Seriously? (Score 5, Interesting) 110

The FAA and the model aircraft folks have an understanding - they have worked with the FAA for many years and kept their members in check (using, among other things, the carrot/stick insurance approach). Before the 2012 law that explicitly orders the FAA to work with the model aircraft folks to come up with reasonable rules, there's been an advisory circular ("this is our interpretation of the rules, just a heads up because we'll enforce them this way") since 1981 that's still basically the rules: AC 91-57. You'll note that they're hardly onerous and really there's been very few problems with the "traditional" model aircraft folks. An advisory circular isn't a rule as such - and in fact one of the court cases over the drones was the judge saying "you can't enforce an AC as an official rule" - but it is broadly speaking "intent to rule". The actual federal air regulations are quite nonspecific and allow a tremendous amount of leeway for the FAA to say exactly what the rule means - and unless the interpretation is deliberately capricious the administrative law judge (basically a trial for regulations, not laws) is bound to their interpretation so they almost always win. Best not to violate the AC, since that's how you know what this interpretation is that they'll hit you with.

The FAA trusts the AMA guys to do this right, and really they've done a remarkably good job and have a many-decade long track record. It's hard to build and fly model aircraft, and if it's a hobby it's much easier to do things "right" by joining a club and using their field and following the rules.

They're not the problem. No, the problem is the drone idiots who go on Amazon and buy a "point and fly" DJI Phantom or something and go to the park and fly it up to check out a police helicopter, or the planes in a major airport's approach path. They have no training, no sense, and no community that will keep them in line. They don't care about being accredited and having insurance - their level of commitment is a few hundred bucks and a couple hours' time.

Irresponsible drone use is ruining it for the rest of the hobbyists. There is responsible use, but since drones are so easy to use, there's a lot more irresponsible use than there was with traditional model planes. It's really that simple. They are causing a safety hazard and forcing the FAA's hand to more proper regulation than their laissez-faire "the AMA seems to be doing this properly" approach of the last 30 years until now.

I am a fixed-wing pilot, anything that can fly through my window at 140MPH pisses me off. Birds are bad enough, but at least they're not metal and we can't really control them. I trust the model aircraft guys to stay low and in their traditional fields and away from my airports. I don't trust the drone guys.

As for incorrect information... the GP was more accurate than you on balance, so maybe look a little deeper next time?

Comment: Re:Error in summary: (Score 2) 203

by slimjim8094 (#49653429) Attached to: Critics Say It's Time To Close La Guardia Airport

Well they started building the NYC subway system before planes existed and it opened for business less than a year after the Wright Brother's flight so there's a bit more legacy here than Atlanta. It's also a different scale as you could fit the Atlanta system 40 times over into the NYC system (by weekday passenger volume). Our secondary subway system is bigger than Atlanta's subway. We have a single line that, if it were its own entire subway system, it would still have more rides than the entire Washington Metro (#2 system), or Boston and SF (#4 and #5) combined. So to say it's a much more complicated (and thus harder to change) system is an understatement. It's also worth noting that they built the airport and subway so they could connect to each other, and that Atlanta is not an island, so there is a lot more freedom of placement.

That said... yeah, it is pretty bad. They could extend the N/Q out east but I don't think it's really going to cope with 100x passenger volume on those segments. The new express bus is pretty good, one or two stops from a few subway stations to the airport. But there should be a train.

Comment: Re:idgi (Score 1) 628

by slimjim8094 (#49604045) Attached to: My High School CS Homework Is the Centerfold

Leaving aside the fact that we are not discussing an image that is pornography nor of a nude woman - it is face and top-of-shoulders, which makes all of this irrelevant...

Your own link goes on to discuss (immediately after the section you quote!) how there is not universal agreement on what is objectifying, including pornography. I happen to think that a woman should be allowed to express herself however she wishes, including sexually, and specifically that she is smart enough to decide if she wants to let someone pay her to take pictures of her and put them in a magazine. I think it's pretty bigoted that you disagree. Presumably you are not so paternalistic to think that this woman, in her simple way, didn't realize that men would be sexually desiring this picture of her. So who is being harmed, exactly? She wasn't taken advantage of by any stretch of the definition. Everybody's happy except the anti-sex second-wave feminists, who missed the boat in the 90s. (Third-wave feminism generally views "bad porn as bad", in the sense that nobody should be exploited into making porn but that it is OK to choose to do so and choose to consume)

And to answer your question I don't generally take the concerns of religious extremists into account, whether they are ISIS or the "god hates fags" folks or someone who is so far gone that they think sexuality itself demeans women.

Comment: Re:Dear Young Mr Zug (Score 1) 628

by slimjim8094 (#49603949) Attached to: My High School CS Homework Is the Centerfold

It is a standard image. There is value to using a standard image because then you can compare how you do against the old techniques. That is, of course, why it became a standard image to begin with. Sure you could go off and use a different image, but there is 40 years of "here's how well computer image techniques work on this image" that you'll be missing out on. You might as well argue against the Utah Teapot because some people are offended by caffeine and... well, sure the teapot itself isn't caffeine, but everybody knows what it contains!

Honestly, I'm stuck (and have been for years now) trying to figure out how sexuality itself demeans women somehow, which seems to be what all this boils down to. Isn't that creeping anyone else out? I mean, I thought the whole point of the sexual revolution of the 60s-70s was that women (in particular) could express themselves sexually, right? This all seems horribly regressive.

Of course, the standard image is not a sexual image anyway, so this is irrelevant.

Comment: Re:It is coming... On Weekends... From Home... (Score 2) 390

by slimjim8094 (#49515675) Attached to: Why the Journey To IPv6 Is Still the Road Less Traveled

Came here to say this. Also note how far the US is ahead of the rest of the world. It's a rare scenario where the US is a world leader in something Internet. 14.5% of all Google's US connections are v6, and it's higher on the weekends. Only Belgium does better. The major US ISPs have actually been pretty good about v6 and at least TWC/Comcast offer it to all their customers, and all their provided routers do it automatically. All the other major ISPs I know about are at least testing deployment. As people swap out their routers that number will only rise.

The lag as you observed is corporate networks since each one is different. (Also note around Christmas there is a huge jump, and the spread is getting wider.) But even there, eventually you won't be able to buy a device that doesn't automatically do v6 (or at least as automatically as it does v4).

v6 is coming, folks. People can naysay it all they want but the facts don't support it.

Comment: Re: How about cutting sugar* (Score 3, Insightful) 68

by slimjim8094 (#49455235) Attached to: Plaque-busting Nanoparticles Could Help Fight Tooth Decay

I used to think like you, but the fact of the matter is that most animals simply don't get cavities. Seriously! I mean, their teeth are very capable of getting cavities, but haven't you wondered why humans have teeth that "go bad" without regular maintenance? Have you ever known a dog to floss? The idea that all calories are equal is a tempting one, especially to engineer-types like myself, but it doesn't seem to be true.

Eating simple sugars is quite rare in the animal world, and presumably primitive humans. We like them so much because they are simple, high-density sources of energy compared to extracting a few calories from some nuts and greens. An early human would get as much as they could - which wasn't very much at all. But we are not set up to mostly run on them to the extent that we try today, and I think the evidence on that is increasingly clear. It's not necessarily simply a question of physical fitness, though it's true that that will probably mitigate many of the downsides like weight gain. The input matters, and calories and nutrients are not necessarily fungible - it doesn't go without saying that getting all your calories and nutrients via soda and multivitamins (and I guess fiber pills) is equivalent to e.g. a balanced diet of vegetables and protein even if the caloric and vitamin content is exactly the same. This of course ignores the fact that it is far, far easier to blow through your calorie budget with high-density foodstuffs.

It is a hard problem to solve. The basic problem is that our favorite foods bear no relation to foods that we should be eating, which was fine when the only foods there were to eat (mostly) *were* the foods we should be eating - or vice versa, the foods that are good for us are the ones that we evolved to eat. But we have an artificial abundance of the foods we really like, but didn't used to be able to get in common practice.

And for the record, I eat like a pig, am overweight, etc (though I'm working on it now that I have time). I do not practice the "paleo" fad diet and think most of its claims are bogus. But even though we don't know much about what "primitive" people actually ate, we do know that simple sugars are rare in nature unless artificially grown. Humans are clearly quite adaptable when it comes to diet... but perhaps not infinitely adaptable. We already know that trans fats are shockingly bad, for instance. Perhaps this applies to simple sugar as well - both are found in nature, although much much more rarely than we have been using them. If for no reason other than calories, most people would be better off eating no sugar at all - which would make it much harder to have stupendously high calorie diets.

Comment: Re:These days... (Score 1) 892

You assume that people value their time and the money equally. But this is trivially false. Some people really want to make every last penny they can, and others just want to make enough to comfortably support them and their family, with plenty left over for hobbies and savings. If there is a sufficient supply of the latter type, go nuts - but if there isn't, and you won't negotiate with the former group, you will lose them assuming others will go higher, which they will due to the lack of talent. How do you know which type is which? Easy - they'll tell you by trying to negotiate. You don't pay them more because you value their negotiation skill, you pay them more because that's what you have to pay to get that person. You might as well ask why car dealers should reward good negotiators with cheaper prices.

I didn't negotiate when I got my job, since I fall in the latter group and was happy with the offer. Sure I'd like more money if it landed in my lap, but honestly it'd only serve to fill my savings a bit faster and I think my compensation is fair. Other things are more important to me. If I wanted to fight tooth and nail for every cent than I'd do that at hiring time and relentlessly seek other jobs afterwards, jumping ship at the first sign of a higher offer.

This is a stupid idea. Since people don't value money the same way, they will have to pick a number that will be too high for some and too low for others. They will lose the "too low" folks, and they will overpay the "too high" folks who were willing to work for less. Neither is good business.

I am frankly offended by the idea that I need protecting (and then offended again when I'm the 'oppressor' despite facing the same 'problem'). Apparently unlike modern-day feminists, I believe that women are smart enough that they can decide for themselves whether a particular job offer is worth their labor.

Comment: Re:FCC and FAA (Score 2) 46

by slimjim8094 (#49245753) Attached to: Austin Declared a Drone-Free Zone During SXSW

Short answer: no. But if you're on the ground they probably don't need to, strictly speaking.

Much better to be in the plane and refuse to land. Don't be like this guy and cooperate. Though if he didn't land, apparently Sgt. Yosemite Sam was going to start firing his handgun at the glider 3000 feet in the air (and hoping the bullets went... where, exactly, when they missed?) so take that with a grain of salt.

There are two powers that can compel a plane to land: 1) the FAA and 2) a military intercept (which itself only works because they'll just shoot you down if you don't obey). Well they're really the same because if you don't comply with #1 they'll just use #2. Local, state, or even federal law enforcement cannot compel an aircraft to land - the FAA has sole authority for the country's airspace.

Now if you're on the ground, of course, they can put their hands on you regardless of whether they're technically allowed to. If the drone pilot was licensed appropriately then you'd have a serious case on your hands, but there's like 20 of those in the country at the moment so odds are this will be nabbing people violating the regs to begin with and the FAA will probably not bother to get involved.

+ - Exploiting the DRAM Rowhammer Bug to Gain Kernel Privileges-> 2

Submitted by netelder
netelder writes: “Rowhammer” is a problem with some recent DRAM devices in which repeatedly accessing a row of memory can cause bit flips in adjacent rows. We tested a selection of laptops and found that a subset of them exhibited the problem. We built two working privilege escalation exploits that use this effect. One exploit uses rowhammer-induced bit flips to gain kernel privileges on x86-64 Linux when run as an unprivileged userland process. When run on a machine vulnerable to the rowhammer problem, the process was able to induce bit flips in page table entries (PTEs). It was able to use this to gain write access to its own page table, and hence gain read-write access to all of physical memory.
Link to Original Source

Comment: Re:I don't generally complain about articles... (Score 1) 277

by slimjim8094 (#49204841) Attached to: Daylight Saving Time Change On Sunday For N. America

I'm not saying everything should be for me, but what more is there to say about DST, even in relation to IT issues? It's just the same stuff we've been talking about - on Slashdot and elsewhere - forever. Yes, it makes things inconvenient, and yes some people don't like it and want to get rid of it. We'll have the people railing against it while slightly fewer say "actually I kind of like it", and some guys in the corner will say "we should just use GMT for everything" and it'll all happen again - right on schedule! - in ~8 months. There's nothing even different (like a new study) this year, just "remember this is happening again and how it makes you mad? let's all complain in the comments!". All the linked things are from 2014 or earlier. Might as well have an article about how some people still don't like Windows 8, or that taxes are due on April 15.

It just feels like a Two Minute's Hate at this point, and I object to that on principle.

Comment: I don't generally complain about articles... (Score 1, Offtopic) 277

by slimjim8094 (#49204515) Attached to: Daylight Saving Time Change On Sunday For N. America

I don't generally complain about articles on Slashdot, but this is ridiculous. It reminds me of that Simpsons episode with the newspaper having the front-page headline "Christmas Occurs". I like reading about some not-strictly-tech stuff on Slashdot, but can we please not have articles to remind us of something that's marked on the calendar?

"Pay no attention to the man behind the curtain." -- Karl, as he stepped behind the computer to reboot it, during a FAT