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

 



Forgot your password?
typodupeerror
×

Comment GotW #50: vector is not a container (Score 1) 80

Alex: I regard my first encounter with the STL (very shortly after its first public release) as one of the great eye-opening moments in my software development career. Unfortunately, as I'm sure you well know, quality of implementation issues in compiler support for the C++ template idiom cultified (i.e. made cult-like) the deeper principles for at least five (if not ten) years thereafter.

GotW #50

I've long regarded the criticism against vector[bool]—I'm not going to fugger with angle brace entitiesâ"not being a container were misguided. Of course, it *must* be a container for reasons of sanity, but to portray the problem as a standardization committee brain fart seems to miss the main point.

Just as STL introduced a hierarchy of iterator potency (that was the main technical innovation behind the STL, was it not?) one could likewise introduce a hierarchy of container potency. The container we ended up returns interators which promise a dereference operator returning an lvalue (it's been a long time since I've used this terminology) which is why the following statement from the linked discussed is expected to work:

typename T::value_type* p2 = &*t.begin();

But actually, of all the uses of containers found in the wild, I highly doubt that more than a small percentage (potentially a very small percentage) exploit the property that interator dereference returns an lvalue rather than an rvalue.

The net effect is that the standard containers promise us a potency we rarely exploit, yet the burden of this potency is universal. Forsake it in even the smallest way, and you'll be shouted out of the room for non-containerhood.

We could have handled vector[bool] by changing the standard container to not promise IDLV (container iterators dereference to lvalue). In cases where the programmer goes ahead and tries to do this, he or she obtains a simple syntax error (ha ha ha) and knows to either reformulate the algorithm to not require this property or to go back and add a specification override to the container setting the IDVL property to true.

With IDVL set, vector[bool] does not specialize.

With IDVL unset, vector[bool] will specialize.

Problem solved, except for the language overhead of introducing (and managing) a container strength hierarchy.

But instead, Herb Sutter decides to write this:

Besides, it's mostly redundant: std::bitset was designed for this kind of thing.

Doesn't that attitude make you want to pound your head upon a table somewhere? Seriously, if one repeats that remark 1000 times, we could almost make the entire STL go away (and return to the world we would have had instead had the STL not rescued us from parsimony mass produced.)

Clearly, there was enough of a pain point in the C++ standarization effort around iterators that the STL gained traction exceedingly quickly (and very late in the day), yet the C++ community is also extremely hidebound about minor pain points, as evidenced by Sutter's explanatory tack.

Obviously, there were some advantages in demonstrating that the STL approach could achieve performance comparable to C (and in some cases, better than C) in proving that the STL was not just another abstraction gained at the expense of runtime overhead (which all looks fine until five or ten different runtime overheads—however small each of these appears in isolation—begin to interact adversely).

But very quickly, the initial quality of implementation issues and the quirky (to be extremely kind) limitations of the C++ template mechanisms threw up some major walls in pursuing the underlying ideas behind the STL more extensively.

So, my question is this, more or less: in retrospect, was the early victory with C++ worth it (it's extremely easy to understimate the value of having a good idea noticed at all), or does the eternal puberty of the C++ STL continue to grate?

Comment Could? (Score 1) 292

The reported findings, if corroborated by further inquiry, could add fresh fodder to an ongoing debate over the Third Reich's ultimately failed attempt to secure an atomic weapon.

If, could, fodder, ultimately, failed, secure. Every one of these words as cast is a pablum-brained Orwellian nightmare.

The German Jesus nut was supremacy in all things. After setbacks in The Battle of Britain and Moscow/Stalingrad, the Germans found themselves in a situation where they needed to tighten their belts (both militarily and technologically) and settle for supremacy in merely the most essential things.

It was this belt-tightening challenge they bungled like crazy. Belt-tightening somehow wasn't in the German lexicon.

There was a scold Fuehrer who lived in a shoe
with so many children, he couldn't kick through;
He gave them some broth without any bread,
Then stripped 'em unsoundly to hiss boot instead.

Well, it was a try anyway, but it does capture the main idea.

Comment the writing was on the wall after the first movie (Score 1) 351

There were enough tells in the first movie that I decided to skip both prequel sequels. My only regret concerns the movie not made.

The problem when you have a strong emotional investment in something is that one's instinct is to give it one more chance. By the time you've watched two bad movies, you're almost pot-committed to watch the third.

It takes a special will to abandon a franchise without falling into the emotional mulligan trap, and so there's ultimately little incentive for Jackson to not do what he did.

I'm slowly learning. My loyalty function has now evolved to where it's almost vertiginous.

Comment Re:Precious Snowflake (Score 1) 323

A simple spanking is not "physical violence".

No, it's aversive physical dominance. Any more hairs you would like to split, or are we done now?

Aversive: the recipient is not pleased about it.

Physical: there's a smacking sound.

Dominance: the recipient's preference in the moment doesn't count for shit.

Maybe he or she will thank you later with a greater understanding of the situation. Or maybe not.

To my mind your story could be an argument for more effective barriers. If you're going to make a barrier to enforce safety, go big or go home. Otherwise you're just conducting a first lesson in Jr Steeplechase.

Comment it wasn't about text-to-speech (Score 2) 292

From Hyphen Hate? When Amazon went to war against punctuation

A ridiculous number of people have gotten caught up in the whole âoehe used a minus sign instead of an ascii hyphen! The bastardâ controversy that has followed this thread around and has spilled over into any number of internet message boards. First of all, let me be clear. The issue was not with my use of a minus sign. The issue Amazon had was that someone had complained about hyphenation. Second, I have since gone back and checked the original file on the Kindle text-to-speech app and it renders fine. No issues. [my emph.]

<acerbic>
These days 75% of all Slashdot posts seem to involve drilling down to get the original story straight. Tell me, when did a mass-confusion clusterfuck become the new nerd foreplay? Kindle typography, meet declining Slashdot editorial standards. You've got more in common than you think.
</acerbic>

Comment Re:Copenhagen interpretation != less complicated (Score 1) 197

Determinism = fail

With entanglement, we have an FTL coupling that can't be used to convey classical information.

Why can't we have a similarly knackered stripe of determinism, one which can't be used to shatter the illusion of free will? This would be a kind of determinism where even if you sort of know it's there, it makes no damn difference to your interpretation of local space.

Think big, grasshopper, think big.

Comment the sociology of accidents (Score 1) 175

The only "accidental" discovery in science is the discovery one could have stretched out over a great many more research grants if one had better anticipated the scientific windfall.

Of course, we do tend to refer to the outcome of bad planning as "an accident" concerning our hominid prime directive, so perhaps there's no help for language after all.

Comment Re:Does the job still get done? (Score 1) 688

You do realize that a narrative of this type can be fashioned around the prevailing conditions of all human societies at all points in human history?

America is an especially big and complex society, so one needs a correspondingly large and complex boogie man (though nevertheless, reductive to the core).

In the gospel of the one true fracture, defining yourself as against something only serves to throw more fuel on the fire. In reality, complex systems have hundreds or thousands of fault lines, and it's not always the case that the largest fault line is hovering around the supercritical state. Unless we all agree to obsess about it. Then the story self propels.

The slow march of AI is going to spin our a thousand fault lines. Get yours today!

Comment Re:The interne cables are tapped... (Score 1) 160

Next it's not that hard to develop mathematical techniques to analyze text and language in posts ...

Budget projects much? "Doable" and "easy" are not the same words. I'm guessing one person out of a hundred in the general population could take a reasonable stab at developing such an algorithm, and only one person out of a thousand could be considered a natural talent.

The first 20% of the work gets you to sqrt(sqrt(7e9)) as your mean perplexity, which is simultaneously impressive and yet not terribly actionable. And then the difficulty curve shoots off into the exponential regime.

Comment pristine records for a prissy nation (Score 1) 134

My impression is the regret in taking these drunken pictures happens years after the fact, when the drunken college scene has been left behind, and the poster now has a family and a 9-to-5 job and they want to distance themselves from that past.

It shocks me how rarely the cultural underpinnings are made overt in these scenarios. What you depict might actually be the case in America, but I suspect it will be different in France, where when a search pulls up no college revelry whatsoever, cultured individuals might begin to seriously doubt your breeding and character.

Whether posting photos of regular drunkenness counts as bad judgement has a circular basis case. If you get yourself photographed draping and drooling over some chick who looks none too impressed with the group grope, there might be some legitimate flags raised. Multiple binge-ups during school session might also raise eyebrows, even in France. It sure won't accentuate that embarrassing C- you received in Economics 101 because of the "family crisis".

Daryl Hannah's distal indecency. In America, s/irony/context/g.

(I had forgotten that this clip also contains some good geek humour, though slightly dated and with just a hint of cheese.)

Comment Re:This really is a man's world... (Score 1) 377

Artists practice drawing nudes for a good reason: the human eye is exquisitely sensitive to the normal shape of the human body, so you can't draw or paint badly and not have it noticed.

Of course, we have a good evolutionary reason for having developed this proficiency, along with a taste for keeping this proficiency in good working order.

Porn doesn't happen until the rest of the brain takes a holiday (our visual sub-system is by far our biggest neurological subsystem according to a Levitin book I read recently). Big chunks of the human brain taking a poorly planned vacation is endemic to the human condition. That's why I keep a list of twenty different types of cognitive porn, only one of which involves obsessing over the female body. I'm pretty sure "PC porn" must be on my list somewhere.

Comment Re: Have Both (Score 1) 567

A general ergonomic rule-of-thumb is to adjust your monitor's vertical position so that the top edge is level with your eyes and you don't need to look upwards.

Do you go around believing every lazy-ass statement you've ever read?

My gut estimate is that I actively view the 20% of my portrait monitor above my horizontal line of sight about 2% of my total working time. What's up there, anyway? A menu bar, a window title bar, a bunch of FF controls, a bunch of FF tabs, the Slashdot header, some junk about DEALS NEW, "Reply to: Re: Have Both", then the Slashdot story header which repeats "Re: Have Both (Score: 3)", then there's you user information / date / perm-link. Everything else on this screen is below my horizontal line of sight, including the entirety of this input form where my gaze is normally focussed.

That lazy-ass statement almost certainly originates from an era where devoting 20% of a monitor to menu/window/media cruft left you with a painfully small working area.

If you bother to read articles where researchers are interviewed decades later about lazy-ass statements they tend to say: "well, yes, of course we knew that at the time, but at that time hardly anyone had even heard of ergonomics, so we chose to make the message as simple as possible, so as to get 80% of the benefit from 20% of the yammering". Last time I ran into this it concerned one of the BMI formulas (there are several body mass formulas in competition). And then they say, "if you go back and look at my original paper, it actually warns against expanding the mandate of this tool beyond our narrow focus of study". Did you really expect people would respect that warning? "Oh no, but what can you do?"

What typically occupies the bottom third of this screen, below where my gaze is the most comfortable? A tilda pop-up console bound to my Windows keyboard menu key.

I have a custom user style that adds white space to the bottom of every web page so that I can maximize FF on this monitor, pop up the Tilda window over top of the bottom third, and still scroll the bottom of the web page high enough to not be covered over.

And then I have my landscape monitor to the left, all within the optimal attitude wedge. In fact, the combination of the two is much better ergonomically than having them both in landscape mode, which was so wide that I used to sit tilted to one side or the other, putting strain on my back (also pushing more of my pixels into the far margins of my vision). I never been happier with any previous monitor setup, though it did require switching from Ubuntu to Mint with extreme prejudice.

In my opinion, most people persist in using fonts that are much too small, I suppose so that they can crowd more stuff onto their desktops. Small fonts would be a problem with this setup as it would cause me to lean forward sharper reading, and also creating sharper viewing angles toward the edges (my input box is presently displaying three lines per inch; I can read what I've composed without difficulty from six feet away).

A portrait-orientation of your monitor makes that objective difficult to achieve.

I suppose if the sum total of your ergonomic wisdom comes from a fortune cookie ("Eyes level with bezel last a lifetime.") and you have no capacity to think for yourself, portrait mode just won't seem terribly appealing. When one's approach to ergonomics is more holistic, one quickly comes to a different view.

Comment Re:What people want to read (Score 1) 368

And if you're writing that way because that's the story you want to write, or because you truly believe it's important to the integrity of the story that the culture be very different than our own, and you're OK with selling a few thousand copies or less, then that's fine.

If you don't write that way—with integrity and determination—then what you're writing isn't SF, it's what I call GSF, or genre science fiction.

Genre is primarily a form of entertainment. SF is properly a form of deep enquiry. I pretty much won't read genre anything. Of course, people lump much of what I do read into genre, but I don't support them in this activity (and none of Vonnegut, Le Guin, or Atwood would—or did—so far as they could get away with it).

One or two pieces in Stanislaw Lem's Microworlds (circa 1986) were very much to my liking. He shit on genre, too, and in a big way.

Slashdot Top Deals

He has not acquired a fortune; the fortune has acquired him. -- Bion

Working...