Slashdot Mirror


User: Rei

Rei's activity in the archive.

Stories
0
Comments
16,444
First seen
Last seen
Profile
(view on slashdot.org)

Comments · 16,444

  1. Re:C# on How Relevant is C in 2014? · · Score: 1

    Here's one of countless reasons why you should learn C++.

    std::thread([&](){ do_something(local_arg1, local_arg2); }).detach();

    Write me the equivalent in C.

  2. Re:C had no real successor on How Relevant is C in 2014? · · Score: 2, Insightful

    C++ should have been C successor, but it is too complex to be.

    C++ is no more complicated to use than C. You can write C code in C++ and it'll work just fine, with only a few rare exceptions.

    What C++ does give you is many more capabilities. Now, if you don't want to take the time to learn these capabilities, that's not the language's fault. There's a few things that were implemented a bit awkwardly (mainly looking at you, streams), but the vast majority is quite simple and straightforward, and it just keeps getting better and better (check out the capabilities of C++11 if you haven't yet - auto declaration types, inline threading, for-each looping, smart pointers in STL, and on and on... really, really nice).

    If you don't like a particular part of C++? Don't use it. But that's no excuse to use "C-only". Want to use printf instead of cout? Go right ahead. But dammit don't do your own memory management when you don't absolutely have to, or your bugs are going to screw over the rest of us when we use your software.

  3. Re:C is very relevant in 2014, on How Relevant is C in 2014? · · Score: 1

    That's the reason why people should use C++. You have memory-managed iterable objects to keep you from shooting yourself in the foot that way, and they're quite high performance (usually higher performance than most of the "roll your own" implementations I've seen from C programmers reinventing the wheel). But if for some reason in a C++ program you think you need your own iterable structures for some particular performance reasons in some particular application, you can always change/replace them, in part or in whole. You can still do raw C in C++ - but you don't have to. C++ is "micromanage memory where you need to, don't where you don't need to".

    C gives you a gun with which you can shoot yourself in the foot. C++ gives you the gun too, but at least it's got a safety on it that you have to disable.

  4. Re:Very much so! on How Relevant is C in 2014? · · Score: 3, Insightful

    I have issues with that notion, though. There's this popular perception among hardcore C programmers that C++ is "C with objects", and since they don't like or don't feel the need to do object-oriented programming, it's pointless for them. But C++ is a thousand times more than "C with objects". And even when it comes to objects, the most important ones aren't the ones you make yourself, but STL. Especially with the latest versions of C++. I just recently had to downgrade a simple app from C++11 to C++03 to support old compilers, and my god, I had forgotten what a royal pain pthreads are versus std::thread with a lambda argument. And if I had been forced to go all the way down to C, and thus would lose the std::list that simplified holding the threads' arguments. It would have been a page or two of code for what's a single line in C++11. And with far greater proclivity for bugs.

    I once was one of those "hardcore C programmers" who just saw C++ as "C with objects", and deliberately avoided using it and learning any more than I had to. But the more I learned, the more I came to appreciate it. I do of course make and use my own objects... but that's not really the most important aspect of the language. It's all of the countless features to automatically manage memory, data structures, ensure program correctness, and vastly reduce pointless verbosity that make C++ so important.

  5. Re:Ignorance and arrogance seem to go well togethe on How I Learned To Stop Worrying and Love the Twitterbot · · Score: 3, Insightful

    Again, you're still focusing on the name. The vast majority of the paper has nothing to do with Christianity nor Science. It's just a newspaper.

  6. Re:Ignorance and arrogance seem to go well togethe on How I Learned To Stop Worrying and Love the Twitterbot · · Score: 5, Informative

    CSM is actually a good paper, and I say this as an atheist. The only regular "religious" aspect is a single daily column, "A Christian Science Perspective" - you'll find less religion in the CSM than in lots of other US papers. The overwhelming majority of their reporting has nothing to do with religion. They've won 7 Pulitzers and are famous for avoiding sensationalism.

  7. Re:Dwarf Planets on Pluto-Bound Spacecraft Ends Hibernation To Start Mission · · Score: 1

    It's somewhat of an unfair definition, though, as it's much easier to dominate a narrow orbit. If Earth was out in the Kuiper Belt even it would struggle to remove all competing large bodies. And there's supergiants where you could put Earth even into the habitable zone and still not have it able to dominate its orbit. On the other hand, large asteroids that don't even have enough gravity to fully collapse into spheres (Vesta, Pallas, Hygiea, etc) could clean up in a close orbit to a low-mass brown dwarf.

  8. Re:triggering below percentage is dumb on Windows 10 Adds Battery Saver Feature · · Score: 1

    So solar charging should be forced to be impossible for no good reason whatsoever? The only thing rendering it suchly is the stupid non-disableable screen-activation feature on Android.

    BS on the charging port issue. I've had it happen twice, and it was never a "cheap trip to the service center", the estimated cost to repair was both times more than the cost of the phone.

  9. Re:triggering below percentage is dumb on Windows 10 Adds Battery Saver Feature · · Score: 1

    A bad charging port often means replacing the whole phone, it's often cheaper. And how do you propose "fixing" a solar charger? Do you have magical powers over when the clouds come and go?

  10. Re:Agreed, this is not news on NSF Accused of Misuse of Funds In Giant Ecological Project · · Score: 1

    Back when I worked for a BIRN project center, it was made repeatedly obvious that alcoholic beverages purchases were banned with the funds. But they got around that by corporate sponsors donating the alcohol for free.

  11. Re:Loss of context and common sense on NSF Accused of Misuse of Funds In Giant Ecological Project · · Score: 5, Insightful

    Yeah, compared to the size of this project, these costs don't seem disproportional at all.

    Let's say that salaries + equipment + overhead amounts to 100k per employee per year, and let's estimate that around 1/3rd of the budget, say $150m, was spent in the audit year. Then there'd be around 1500 employees. Thus we have a per-head cost of:

    Winter holiday party: $17
    Coffee: $7
    Shirts and other clothes: $2

    For a project of that scale, whatever business development covers, 83k is chump change and I wouldn't be surprised if the expenses are reasonable. $3k on board of directors dinners sounds abnormally *low*, so kudos to them for keeping the costs down. The only one that sounds off is lobbying - but then again, that's a tiny fraction of what a company that size would probably spend on lobbying, and I don't know what they classify as "lobbying".

  12. Re:Indianmeal moth Re:WHICH "pantry pest" on Pantry Pests Harbor Plastic-Chomping Bacteria · · Score: 1

    Those things are unholy terrors. Chewing right through the cardboard and plastic into unopened boxes of food, with holes so small you don't see them, and you can only see the infection when it's gotten so bad that your food is all webbed up with their feces. The larvae pupate for varying lengths of time, as much as many months, so they keep coming back long after you try to treat the problem. And they don't need much food to keep going. It can be many month or multi-year battle to completely get rid of them. At least there's traps, but they only catch the males, and only the ones that are free-flying in your house, rather than inside food packages. For everything else, you have to first become a neat freak, then have to inspect every food item in your house, store all food in airtight *thick* plastic containers (or metal), inspect those at regular intervals because you've surely trapped moths inside of them which can spread to other foods in the container, and of course before you put things in there, even if they pass inspection, you have to either bake all of your food to kill the larvae, or if that's not possible, deep-freeze it for long periods of time.

  13. Re:triggering below percentage is dumb on Windows 10 Adds Battery Saver Feature · · Score: 2

    One that annoys the heck out of me, if you have an unreliable charging source (poor cable or charging port, solar-powered charger, etc): the screen comes on, both when power starts, and when power disconnects. Combined with an unreliable charging source, your screen is constantly coming on, wasting what power you do get, and there's no way to disable it without root. (The best non-root option I've found is an app that shuts the screen off immediately after it turns out due to a power state change, but that's obviously not ideal).

  14. Re: haven't been following... on Behind Apple's Sapphire Screen Debacle · · Score: 1

    Yep, it's a simple issue of mineral hardness. A material of a lower hardness can *break* a material of a higher hardness if hit hard enough, but it can't scratch it.

  15. Re: haven't been following... on Behind Apple's Sapphire Screen Debacle · · Score: 1

    Yeah, tungsten is up to hardness 8, it's harder than steel, glass, even quartz. It's as hard as emerald. But that's not a typical material one enounters except in specialty applications like that.

  16. Re: haven't been following... on Behind Apple's Sapphire Screen Debacle · · Score: 1

    Trust me, I've done this over and over and over. No scratches. Nor does shaving it boucing about in my purse with all sorts of metal objects. It does not scratch from steel, period. At all. Its Mohs hardness is clearly too high.

  17. Re: haven't been following... on Behind Apple's Sapphire Screen Debacle · · Score: 0

    I've tried with rocks and sand, no effect. So the hardness is clearly higher than quartz. And once you're to that point, how much do you really need to go higher?

    I just wish there was a better way to prevent breakage. :

  18. Re:In this house we obey the laws of thermodynamic on Scientists Develop "Paint" To Help Cool the Planet · · Score: 2

    It's not the ambient temperature of air that's key here, it's the ambient temperature of space, which is about 2,7K.

    All objects are constantly radiating energy and receiving energy back from other things that are radiating. When two objects in radiative exchange are roughly the same temperature, this balances out. But when one is hotter than the other, the hotter one loses more energy than it takes in, and vice versa. And it's not just a little difference - radiative heat loss is proportional to the absolute temperature to the fourth power, that's a pretty big exponent. So when you're exchanging energy with space, which is so cold that it takes very sensitive instruments to be able to measure *anything*, well, that heat is simply lost.

    You can see this effect for yourself by noting how cloudy nights are usually warmer than clear nights. Clouds are cold, but they're not as cold as space!

    The effect of the combination of radiation, absorption, and reflection, with different band peaks for each phenomenon, manifests itself in atmospheres as a greenhouse effect (positive or negative) versus the radiative equilibrium temperature.

  19. Re:In this house we obey the laws of thermodynamic on Scientists Develop "Paint" To Help Cool the Planet · · Score: 1

    This "modulation" happens all the time, few things in this universe are true blackbodies, most prefer to radiate in specific bands. They're apparently using a material that tends to radiate only on one narrow band at regular earth temperatures.

    Not sure how much benefit this provides to the building owner, to the point that they'd be willing to cover their building in hafnium-and-silver coated panels, rather than just white paint...

  20. Re: haven't been following... on Behind Apple's Sapphire Screen Debacle · · Score: 1

    Does anyone actually have problems with scratching of the latest generations of gorilla glass? I've had my Xperia Z2 for over half a year and because it has a glass back as well as front it makes it less risky to try scratch tests, so I've done it a number of times and let other people try to scratch it, and nobody has ever succeeded. I'm sure if you put a diamond to it you'd scratch it, but short of that, I can't see why more scratch resistance is needed.

    Now, *crack* resistance, they could use good improvements in that. : But from reports the sapphire wasn't that crack resistant.

  21. They just took Google's motto on Uber's Android App Caught Reporting Data Back Without Permission · · Score: 1

    and tweaked the punctuation a bit, from "Don't Be Evil" to "Don't, Be Evil!"

    BTW, am I the first one to notice that Uber is an anagram of "Rube"?

  22. Re:Niche energy on WaveNET – the Floating, Flexible Wave Energy Generator · · Score: 1

    A lot of companies are involved in a lot of renewables tech research. That doesn't mean that any particular one is going to be profitable. The vast majority are going to be big failures.

    Wave power's track record so far has been subpar to say the least. And looking at their diagrams, I can't imagine that they're not headed straight for the same fate. Even if we assume that their numbers aren't overly optimistic, their design looks like it would involve several times more steel per nameplate capacity than a wind turbine tower. And they're operating in a much harsher environment. No rotors, but they're dealing with major hydraulic pumping instead. It just doesn't look like a winner to me.

    If it was my job to have a go at wave power, I can't imagine going for anything involving large amounts of structural steel or hydraulic pumping; I'd keep it simple and just go for a grid of cables (potentially a high tensile strength UV-resistant plastic), anchored at the edges to keep tension up across the whole grid, with the only slack available involving the grid pulling on regularly spaced springloaded reels (the rotation thereof generating electricity), with any combination of floats, drag chutes and weighs/anchors to cause the needed tug from the movement of water. No pumps, no hydraulic fluid, no large compressive-loaded structures, just a tensile structure that would be (proportionally) lightweight and easy to deploy.

    But hey, it's not my industry ;)

  23. Re:It boils down to energy storage costs on Two Google Engineers Say Renewables Can't Cure Climate Change · · Score: 1

    And from their numbers, it doesn't look like they're using a reasonable estimate for Chernobyl. There've been some ridiculous estimates out there from both sides, ranging from "only the couple dozen who died directly" to "millions".

    One can look at the approximately 10% higher mortality rate within the exclusion zone to get a rough sense of the consequences, but without knowing demographics, it's hard to draw conclusions from that. Probably the best (peer-reviewed) analysis I've seen compared doses with the US military's mortality data from exposure to the nuclear bombings in Japan. You get a figure of about 4000 extra deaths with moderate confidence and 5000 with low confidence (the error bars can be in either direction). So very rough ballpark of 9k deaths, plus the first responders and the like.

    Yes, even when you include things like that, nuclear's death toll is lower than coal, no question. But it's not as low as they make it out to be. Their bias is obvious.

    The deadliest nuclear accident, Chernobyl, was caused by defense department testing.

    Yep, nuclear disasters can happen from both man and nature. That's hardly a comfort. Will "defense department testing" cause the next major nuclear accident? Very unlikely. But there almost certainly will be a "next major nuclear accident" - we just don't know what form it will take. It's a "known unknown".

    Whereas Fukushima was all user error?

    No. But if you're going to include "dam-induced casualties from storms", then you should include "people spared from storms by dams" also, it's only fair. And thus hydro's death count would be strongly negative.

    Perhaps it is possible to offset renewables in such a way that they can provide 90% of our power needs, but no one has ever done it.

    Speak for yourself. I live in Iceland where over 99,9% of the grid is renewable (primarily hydro). 99,9% renewable baseload at that. There's even serious preliminary work looking into building the world's longest submarine power cable to export power to the UK.

    Again, not saying that hydro is my preference - I've stated my preference above. Just pointing out that your claim is wrong.

    (Concerning the power cable: I'd support if A) they'd only be adding geo plants and wind to meet the extra power need, and B) the government would tax the power sales to the point where the cable makes just barely enough profit to economically justify its existence... but I'm sure that A) they'd probably just dam up the highlands some more - who gives a rat's arse that we have some of the world's most abundant and cheap geo and wind power that could easily compete on the European market, hydro gives a tiny bit more profit margin!; and B) the government would hardly push back at all on power export royalties because, hey, JOBS! Jobs damming up the highlands!)

  24. Re:Next step - Semiconductors on ISS's 3-D Printer Creates Its First Object In Space · · Score: 4, Funny

    Close, but your syllable count is a bit off. Something like this would work:

    fuck ink jet printers
    fuck all those fucking printers
    i fucking hate them

    Technically, though, you're supposed to have a connection with nature for it to be proper haiku. So maybe something more like

    ink jet printer rests
    at the bottom of the bog
    piece of shit printer

  25. Re:Next step - Semiconductors on ISS's 3-D Printer Creates Its First Object In Space · · Score: 1

    What world do you live in where mine shafts allow objects to fall for hours, days, weeks, months, or years at a time?

    And FYI, this "weak force" is the reason your muscles aren't atrophied and you're stuck to this ball orbiting the sun. It matters.