Search found 436 matches

by lgw
Mon Dec 16, 2013 11:02 pm UTC
Forum: Coding
Topic: [C++] Global variables in headers.
Replies: 13
Views: 10106

Re: [C++] Global variables in headers.

As it turns out the __declspec (selectany) option works quite well. I now have a completely self-initializing logging header. Just include it and start logging, no initialization required at all. I'm rather happy with that. Glad it's working for you - selectany is a cool feature IMO. BTW, the usual...
by lgw
Mon Dec 16, 2013 6:59 pm UTC
Forum: Science
Topic: Obtaining an image without developing the film
Replies: 8
Views: 3210

Re: Obtaining an image without developing the film

This does lend itself to amusing crime thriller stories. Undeveloped film is nifty from a crypto protocol perspective, as (in common understanding), there's no way to duplicate the film before it's developed. You can thus prove you've handed over the only copy of the information, though the recipien...
by lgw
Fri Dec 13, 2013 10:14 pm UTC
Forum: Science
Topic: Energy equivlence for time of travel: Newton and Einstein
Replies: 20
Views: 4959

Re: Energy equivlence for time of travel: Newton and Einstei

The total energy needed to get there as measured in the reference frame of the ship (e.g., what you care about for fuel calculations and such) is exactly as Newton would predict. No, it most definitely isn't. It is possible to get across the galaxy within a single lifetime at no more than 1g of pro...
by lgw
Fri Dec 13, 2013 9:05 pm UTC
Forum: What If?
Topic: What-If 0074: "Soda Planet"
Replies: 41
Views: 19588

Re: What-If 0074: "Soda Planet"

As one paleontologist said at a Ted talk "Birds are dinosaurs. You might not like to hear it, but we're the ones who get to decide , and we've decided that birds are dinosaurs." Plus, as Randal pointed out , there's no reasonable way to claim that a T-Rex is closer to a stegosaurus than a ...
by lgw
Fri Dec 13, 2013 8:01 pm UTC
Forum: Science
Topic: Energy equivlence for time of travel: Newton and Einstein
Replies: 20
Views: 4959

Re: Energy equivlence for time of travel: Newton and Einstei

The energy as measured in what reference frame? For the space traveler the time taken to reach a distant destination is exactly as Newton would predict. The total energy needed to get there as measured in the reference frame of the ship (e.g., what you care about for fuel calculations and such) is e...
by lgw
Fri Dec 06, 2013 9:27 pm UTC
Forum: Science
Topic: Wave/Particle duality and Entanglement
Replies: 8
Views: 3378

Re: Wave/Particle duality and Entanglement

But also, if you have a source like a lightbulb sending out lots of photons, and you observe some arriving in some local neighborhood, you can't get knowledge at a distance because you don't actually know that it is a spherically symmetric wavefront. You can only know that by making those other obs...
by lgw
Fri Dec 06, 2013 8:57 pm UTC
Forum: Individual XKCD Comic Threads
Topic: 1299: "I Don't Own a TV"
Replies: 99
Views: 20144

Re: 1299: "I Don't Own a TV"

Before people were smug about "not having a TV", they were smug about having a TV that was set to PBS and the knob removed (remember TVs with knobs?). Today I guess I'm one of the "smug about not being on facebook" crowd. I gave up broadcast and cable TV at the turn of the millen...
by lgw
Mon Dec 02, 2013 11:26 pm UTC
Forum: Science
Topic: Eradicating crocodiles
Replies: 8
Views: 3147

Re: Eradicating crocodiles

Mousepup, that is one amazingly awesome ballooning crocodile avatar!
by lgw
Thu Nov 28, 2013 2:07 am UTC
Forum: Coding
Topic: Coding: Fleeting Thoughts
Replies: 9979
Views: 1976402

Re: Coding: Fleeting Thoughts

Wow, if I saw that in a code review, I think physical violence would ensue. Just because you can do a thing doesn't mean you should ever consider speculating about the possibility of doing that thing (especially in C++). Of course, the basic rule for all of the C++ cruft is: if you don't already kno...
by lgw
Thu Nov 28, 2013 1:25 am UTC
Forum: Science
Topic: 3D visual perception
Replies: 40
Views: 7082

Re: 3D visual perception

Stereoscopic vision does give us a third axis of perception, though I don't know that it's visual per se. What the cones and rods in our eyes register has very little to do with "vision per se" IMO, since all we have conscious access to is a heavily filtered and processed image, not the r...
by lgw
Thu Nov 28, 2013 1:16 am UTC
Forum: Science
Topic: Eradicating crocodiles
Replies: 8
Views: 3147

Re: Eradicating crocodiles

Schrollini wrote:Like spiders, crocodiles balloon, thereby repopulating areas in which the local population has been exterminated.

Little known fact.


Pics or it didn't happen.
by lgw
Thu Nov 28, 2013 1:13 am UTC
Forum: Coding
Topic: Coding: Fleeting Thoughts
Replies: 9979
Views: 1976402

Re: Coding: Fleeting Thoughts

Well, it isn't a macro language. It is aware of the status of the parser at the point where the template is created/used. So you can do things like "expand to different code depending on the size of a type passed in". Doing so with a macro language would require handing something like the...
by lgw
Wed Nov 27, 2013 11:47 pm UTC
Forum: Science
Topic: Eradicating crocodiles
Replies: 8
Views: 3147

Re: Eradicating crocodiles

I just assumed the crocodiles would come back ... after a while. :lol:
by lgw
Wed Nov 27, 2013 11:41 pm UTC
Forum: Science
Topic: Why do we perceive a 4-dimensional universe as 3?
Replies: 98
Views: 15623

Re: Why do we perceive a 4-dimensional universe as 3?

Why would a diffuse gas of photons not have a rest frame? I mean, I'm not exactly sure what you are proposing as using photons as the medium for electromagnetism. It's not really a coherent idea, because photons are the quantized excitations of the electromagnetic field. It's just sort of backwards...
by lgw
Wed Nov 27, 2013 10:28 pm UTC
Forum: Science
Topic: What is the smallest object that has gravity?
Replies: 65
Views: 19059

Re: What is the smallest object that has gravity?

Quick answer: an electron. (There may be other, even more basic particles with no known size, but electrons are reasonably familiar, have a rest mass, and (when I learned physics) no known volume.) No idea how to balance electrons in such a way as to measure the gravitation. Charge is so overwhelmi...
by lgw
Wed Nov 27, 2013 10:23 pm UTC
Forum: Science
Topic: Can someone explain more about the Higgs Boson and mass?
Replies: 24
Views: 5628

Re: Can someone explain more about the Higgs Boson and mass?

I haven't heard that the inside of a proton is stuffed full of short-lived spontaneous quark/antiquark pairs that vastly outmass the "real" quarks - so I don't get what you're saying here. That is in fact the case. I mean, mostly. Edging away from thinking about "virtual particles&qu...
by lgw
Wed Nov 27, 2013 10:18 pm UTC
Forum: Science
Topic: 3D visual perception
Replies: 40
Views: 7082

Re: 3D visual perception

It could be argued on the basis of all this that we could not possibly conceptualize a 4D object unless we could actually visualize 3D rather than just working with rotation of a 2D projection. Or, if we want to set the bar lower, we should at least be able to conceptualize why a 3D projection of a...
by lgw
Wed Nov 27, 2013 10:12 pm UTC
Forum: Science
Topic: Combining Volumes don't add up?
Replies: 25
Views: 6560

Re: Combining Volumes don't add up?

What's a pint? The correct measurement for beer, when drinking it. Of course, to use the correct international standard measure it would be 1/72 of a firkin, but that's a bit of a mouthful when ordering at a pub, especially if you've had a couple already in the past few millifortnights. I love that...
by lgw
Wed Nov 27, 2013 9:56 pm UTC
Forum: Coding
Topic: Coding: Fleeting Thoughts
Replies: 9979
Views: 1976402

Re: Coding: Fleeting Thoughts

Yup, C++ templates can be used sparingly in carefully-review library code, or they can be this awesome puzzle of a Turing-complete language, but for the love of all that is good and right, never mix the two! Seriously, the C++ template language is the single stupidest macro language in the world, ma...
by lgw
Wed Nov 27, 2013 9:49 pm UTC
Forum: Science
Topic: Combining Volumes don't add up?
Replies: 25
Views: 6560

Re: Combining Volumes don't add up?

Then add half a liter of beer, because there's always room for a good beer. You mean a pint, of course. I only used half-liter because the other examples were using that amount. I plead peer pressure! What's a pint? The correct measurement for beer, when drinking it. Of course, to use the correct i...
by lgw
Wed Nov 27, 2013 9:36 pm UTC
Forum: Science
Topic: Can someone explain more about the Higgs Boson and mass?
Replies: 24
Views: 5628

Re: Can someone explain more about the Higgs Boson and mass?

Isn't the dichotomy usually between matter and energy, though? That is, people talk about turning matter, not mass, into energy, and vice versa? (The fact that matter is still energy notwithstanding.) Dopefish, I'll definitely check out the video. Heh, thanks for provoking a blinding flash of the o...
by lgw
Wed Nov 27, 2013 12:49 am UTC
Forum: Coding
Topic: Coding: Fleeting Thoughts
Replies: 9979
Views: 1976402

Re: Coding: Fleeting Thoughts

C++, when written with correct modern style (which is nearly impossible to discover from the language spec, but fairly natural if you learned Java or C# first, and have never learned C), has the best memory model IMO. Everything that's not a member is scope-bound, unless you do more work to make it ...
by lgw
Wed Nov 27, 2013 12:32 am UTC
Forum: Science
Topic: Can someone explain more about the Higgs Boson and mass?
Replies: 24
Views: 5628

Re: Can someone explain more about the Higgs Boson and mass?

The rest of the mass that makes the proton heavy is a lot of energy. And, in quantum chromodynamics, this energy can be considered as pairs of quarks/antiquarks formed with decays of gluons, so the Higgs bosons consider this as a mass. Well, that's the confusing bit to me - the idea that mass is ma...
by lgw
Sat Nov 23, 2013 12:51 am UTC
Forum: Science
Topic: Can someone explain more about the Higgs Boson and mass?
Replies: 24
Views: 5628

Re: Can someone explain more about the Higgs Boson and mass?

Thanks! Since a proton is far more difficult to accelerate than the combined rest masses of the quarks, what's up with that binding energy and the virtual Higgs bosons?
by lgw
Fri Nov 22, 2013 11:02 pm UTC
Forum: Individual XKCD Comic Threads
Topic: 1282: "Monty Hall"
Replies: 251
Views: 38047

Re: 1282: "Monty Hall"

IQ is correlated to all relevant intellectual abilities. It is correlated to success in school and career. It is correlated to other standardized tests of intelligence and to descriptions of intelligence by peers (but not to self-described intelligence, because of the Dunning-Kruger effect you ment...
by lgw
Fri Nov 22, 2013 9:42 pm UTC
Forum: Mathematics
Topic: Basic geometry: equilateral triangles
Replies: 7
Views: 2002

Re: Basic geometry: equilateral triangles

Does working backwards count? Start with three line segments intersecting at a point. That gives you six slices with no overlap and no gap. Then prove it's possible to form 6 equilateral triangles by connecting the "backs" of these 6 angles. Obviously you can just choose line segments such...
by lgw
Fri Nov 22, 2013 9:26 pm UTC
Forum: Individual XKCD Comic Threads
Topic: 1294: "Telescope Names"
Replies: 89
Views: 22834

Re: 1294: "Telescope Names"

The Final Telescope has a better resolution than reality. Alternatively, The Final Telescope is constructed from all the matter in the universe and observes itself. I have a perfectly accurate model of the universe. It's 1:1 scale. Yo mama telescope. Hmmm... hadron colliders only have a large one a...
by lgw
Fri Nov 22, 2013 9:13 pm UTC
Forum: Coding
Topic: Coding: Fleeting Thoughts
Replies: 9979
Views: 1976402

Re: Coding: Fleeting Thoughts

Some people are naturally top-down coders, some are naturally bottom-up. The best way to start a fight is to insist everyone do it the same way (unlike insisting everyone use VI or EMACS, it's not so transparent as deliberate troublemaking). I'm naturally a bottom-up coder, but I find it leads to po...
by lgw
Fri Nov 22, 2013 8:35 pm UTC
Forum: Science
Topic: Can someone explain more about the Higgs Boson and mass?
Replies: 24
Views: 5628

Can someone explain more about the Higgs Boson and mass?

I find myself a bit confused by the role that the Higgs boson plays in mass. ⋅ Some of the mass of ordinary matter comes from the rest mass of fundamental (indivisible? atomic?) fermions. ⋅ Some comes from the "binding energy" that holds somewhat-less-fundamental partic...
by lgw
Thu Nov 21, 2013 6:43 pm UTC
Forum: Individual XKCD Comic Threads
Topic: 1293: Job Interview
Replies: 25
Views: 10635

Re: 1293: Job Interview

Who's the interviewee? I haven't seen him before - do we have a name for him?
by lgw
Tue Nov 19, 2013 12:53 am UTC
Forum: Coding
Topic: Coding: Fleeting Thoughts
Replies: 9979
Views: 1976402

Re: Coding: Fleeting Thoughts

I know that there are many bugs that even survive elaborate testing and reviews. But null returns usually don't. Just think of Java references the same way you think about C pointers and you'll be fine. I'm not sure how you managed to work only on magical codebases that don't have NPEs, but I assur...
by lgw
Tue Nov 19, 2013 12:49 am UTC
Forum: Individual XKCD Comic Threads
Topic: 1292: Pi vs. Tau
Replies: 124
Views: 31690

Re: 1292: Pi vs. Tau

Given some sensible mapping of numbers to letters, there is the whole Hamlet contained somewhere within pi, right? ... or even given some non-sensible mapping, such as UTF-8 </troll> ETA: Of course, Hindi speakers would have to wait considerably longer for the translation to appear in Devanagari sc...
by lgw
Fri Nov 15, 2013 6:50 pm UTC
Forum: Science
Topic: What is the smallest object that has gravity?
Replies: 65
Views: 19059

Re: What is the smallest object that has gravity?

Heck, at this point I'd easily believe that all of the gravity of normal matter comes from binding energy, and we just don't know enough about quarks yet to see it yet. That would mean one kind of energy gravitates and the other kind doesn't. No, that would mean that quarks are made of something sm...
by lgw
Fri Nov 15, 2013 6:35 pm UTC
Forum: Science
Topic: Combining Volumes don't add up?
Replies: 25
Views: 6560

Re: Combining Volumes don't add up?

What's currently the best (whatever that means) known way of doing this with hydrogen? At human-scale temperatures and pressures, without cheating by chemically bonding the hydrogen? Palladium-group hydrides. Despite the name, they aren't actually a "hydride" but an alloy of the palladium...
by lgw
Tue Nov 12, 2013 10:40 pm UTC
Forum: Science
Topic: Why do we perceive a 4-dimensional universe as 3?
Replies: 98
Views: 15623

Re: Why do we perceive a 4-dimensional universe as 3?

There is a difference; if there's a medium, then that medium has a rest frame, which you should be able to detect. And we do not. A bunch of speed-of-light quasi-photons in motion doesn't have this problem. That's the point, really, it makes it easy to explain waves without incurring the wrath of r...
by lgw
Tue Nov 12, 2013 10:26 pm UTC
Forum: Science
Topic: Matter/Antimatter Symmetry--a tricksy proposal
Replies: 38
Views: 8129

Re: Matter/Antimatter Symmetry--a tricksy proposal

So, the deal is that CPT is an exact symmetry. So antimatter (CP on matter) moving backward (T flip) in time is just like regular stuff moving forward. But the universe is comprised of both matter and antimatter both moving forward in time. Nothing is merlining about or anything. That "backwar...
by lgw
Tue Nov 12, 2013 1:20 am UTC
Forum: Science
Topic: Why do we perceive a 4-dimensional universe as 3?
Replies: 98
Views: 15623

Re: Why do we perceive a 4-dimensional universe as 3?

As to why we are conscious at all rather than unthinking machines - well, that's a much deeper question. Said the bicycle, his gears turning. Actually, if I postulate 2 axioms: (1) I am conscious, and (2) Nothing supernatural is involved in that Then we can reason a bunch from that. Where I end up ...
by lgw
Tue Nov 12, 2013 1:03 am UTC
Forum: Science
Topic: Matter/Antimatter Symmetry--a tricksy proposal
Replies: 38
Views: 8129

Re: Matter/Antimatter Symmetry--a tricksy proposal

... We do indeed see the charge of a nucleus increase by 1 with the emission of a W-, and were Up and Down the only flavors of Quark, the theory would be dead as a doornail. But since we've got this abundance of other quarks lying around and not apparently doing much, let's repeat our earlier exerc...
by lgw
Tue Nov 12, 2013 12:48 am UTC
Forum: Coding
Topic: any way to stop the spread of "infinite scroll" UI pattern?
Replies: 14
Views: 7042

Re: any way to stop the spread of "infinite scroll" UI patte

What was ever wrong with just having a scroll bar anyhow? I blame overly-simple-minded ORM frameworks that made it hard to do things like get total object count and skip to an arbitrary position, giving you only a cursor instead.
by lgw
Tue Nov 12, 2013 12:42 am UTC
Forum: Coding
Topic: Java object size?
Replies: 6
Views: 3237

Re: Java object size?

You usually don't WANT to know that (so there is no nice way to determine it). It will depend on the architecture and virtual machine. Java has no architectural limit on heap size. Why do you want to know that? It's actually quite useful if you're writing memory-intensive code. You know what object...

Go to advanced search