Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
palish
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
81 ms
·
601.
▲
by
palish
15y ago
I've been bitten by not having asserts (and, conversely, saved by having them) that I don't hold to the philosophy of "don't use asserts out of performance considerations". assert( len != 0.0f ); If that alone is enough to slow down
602.
▲
by
palish
15y ago
Thank you for the equally detailed response. I apologize. Did you fix the problem? I don't know how I'd solve it.
603.
▲
by
palish
15y ago
The goal for floats isn't to resolve equations. It's to perform arithmetic. (1.0 / 0.0) has to be handled somehow . From a mathematical point of view, handling it as "+infinity" has a 50/50 chance of being "correct". As floating-point m
604.
▲
by
palish
15y ago
Yes. //---------------------------------------------- void MVec3::normalize() { // calculate length. float len = sqrtf( x*x + y*y + z*z ); // verify length is not zero. assert( len != 0.0f ); if ( len == 0
605.
▲
by
palish
15y ago
I think you're referring to bone animation. With bone animation, there are 4 "weights" per vertex. Each weight refers to a specific matrix in a "bone matrix palette" (array of matrices). Typically, it's performed as: // start in local
606.
▲
by
palish
15y ago
You say "1.0/0.0 == +infinity" like it should be surprising, but it makes perfect intuitive sense to me. You assert that it's "easier to insert a bug with floats", but your first example (NaN) is one which programmers shouldn't be worrying
607.
▲
by
palish
15y ago
"And your simulation is probably faster with appropriate int math than any float math will be." This isn't true for modern CPUs, especially if you use SIMD vector operations.
608.
▲
by
palish
15y ago
" I wrote some CAD routines once that used decimal arithmetic rather than binary and was amazed at how much better it worked in terms of edges lining up and when you approximate non-square surfaces you get much better tesselation. " That's
609.
▲
by
palish
15y ago
It doesn't matter whether it's unfair by a factor of n^2 or by 2^n. If it's unfair, then it cannot be looked at whatsoever without drawing incorrect conclusions . Or are you trying to educate me out of good will? If so, thanks.
610.
▲
by
palish
16y ago
Thank you! I really appreciate your explanation. By those definitions, shouldn't the number of pixels (circle area) reflect the deviation , rather than what it currently does (the square deviation, aka variance)? In that case, the area sh
611.
▲
by
palish
16y ago
Ah. I gave an example of running a unit test against the hardware. I'd like to understand why it's not really testable? Not to defend myself -- to better myself.
612.
▲
by
palish
16y ago
"In a unit test, mock objects can simulate the behavior of complex, real (non-mock) objects and are therefore useful when a real object is impractical or impossible to incorporate into a unit test." Why would you want to simulate the grap
613.
▲
by
palish
16y ago
A mock graphics subsystem isn't possible since it depends directly on the video card.
614.
▲
by
palish
16y ago
A better question might be, "Would this pattern impact our ability to write unit tests?" I believe the answer is "No." Let's say the module Foo depends on the Graphics subsystem. That is, Foo.cpp has the code: #include "GrSubsys.h"
615.
▲
by
palish
16y ago
As a video game programmer, I use the Singleton pattern quite often. For example, "TextureMgr", "MaterialMgr", "ModelMgr", "GrSubsys" (for Graphics Subsystem), etc.. The most beautiful Singleton code I've seen in C++ is: class GrSubsys
616.
▲
by
palish
16y ago
I assume "variance of Foo" is linear quantity. Is it true that a variance of 4.0 means "twice as much as 2.0"? If so, then the circle's area ( not its radius) must grow proportional to that variance. Growing the radius is an unfair visuali
617.
▲
by
palish
16y ago
Perfect example of how graphs can be subtly deceptive: 1) "Variance in number of comments" is visualized as a circle's radius. 2) ... But a circle's area increases as (pi)r^2. That's an exponential increase. A fair visualization would sh
618.
▲
by
palish
16y ago
A 10% time difference can make or break whether a video game truly feels real time. That's 54fps => 60fps. If you mean "You typically get far more than a 10% return on low-level optimization investment," I agree. It's typically a dram
619.
▲
by
palish
16y ago
... And then they'd drop.
620.
▲
by
palish
16y ago
Actually, the Twitter stream was the first news I'd read about OBL. I woke up a short while ago, checked HN, thought "Huh, 'Osama'... I wonder if they're referring to Bin Laden?" and read the Twitter stream. (I had the good fortune of not
621.
▲
by
palish
16y ago
Since HN doesn't have a private messaging system... VoxelBoy, I noticed your username. I'm a graphics programmer --- I'd love to read about the type of stuff you've done, or simply chat. Have you looked into Sparse Voxel Octrees? Toss me
622.
▲
by
palish
16y ago
Whoa. If you can find any links whatsoever about that, then I'd love to read them. That reminds me of how Gauss was able to use very limited information to locate Ceres after it had moved behind the sun.
623.
▲
by
palish
16y ago
What's the average age of a commercial aircraft? Average lifetime?
624.
▲
by
palish
16y ago
Assume for a moment that the OP has received an offer for a large amount of cash. That cash isn't in his bank yet. The offer isn't final until the cash changes hands. In that position, it seems like a bad idea to try to micromanage the deta
625.
▲
by
palish
16y ago
Ahhh. Thank you for clarifying the article. That's amazing!
626.
▲
by
palish
16y ago
"French search teams last week found the outer casing of the so-called black box recorder, but not its memory ." (EDIT: This is incorrect, sorry. The article is poorly worded. Would you rather I delete this comment?)
627.
▲
by
palish
16y ago
Does this strike anyone else as... well, greedy? I don't quite mean "greedy" --- I mean dangerous. The OP is about to "win at life". Why tempt fate? What I'm saying is, if PG hadn't sold Viaweb at all , then YCombinator would never hav
628.
▲
by
palish
16y ago
Interesting. As an American, the British spelling "Colour" always seemed classier to me than "Color". So it's interesting to find an example of the "opposite": As a non-American, "Color" is strange to you in the same way "Kuller" would be
629.
▲
by
palish
16y ago
Wow. I don't think Sony could be handling it any better than that. Bravo. (Yes, they were incompetent for letting this attack take place. I am merely saying, in the wake of the disaster, there is no better way to handle it than the above
630.
▲
by
palish
16y ago
Me personally? Lua. That language is as simple and as rugged as a cockroach.
More ›