The sky is not falling, and Dijkstra can explain why better than I possibly could:
The traditional mathematician recognizes and appreciates mathematical elegance when he sees it. I propose to go one step further, and to consider elegance an essential ingredient of mathematics: if it is clumsy, it is not mathematics.
Edsger W. Dijkstra, from Predicate Calculus and Program Semantics
His name is Ramanujan. You may just be trying to be cute by calling him "Indian math guy", but give him some props too. Hiding his name in the URL isn't enough.
That's as bad as that browser rendering bug that shows up on slashdot all the time. Most of the text except for the left bar disappears, but shrinking and then increasing the text size fixes it! The browser that displays that bug really is a piece of shit.
(Note: I don't actually think Firefox is a piece of shit)
A senior programmer should know that very little justifies a useless change just before one ships. Removing dead code -- especially suspicious looking dead code -- does not help a project in any appreciable way. So shame on the junior programmer for not putting in a comment, and shame on the senior programmer for taking the bait.
The proper endgame mindset should be, "Does this change (or more generally, this action) help me ship the product? If not, I won't do it."
Re:I will help YOU get a JOB! (Programming puzzles
on
Programming Puzzles
·
· Score: 1
Taking the sum is tempting (or computing some other order-invariant property), but as other posters have found out, one can create input arrays that have the same value but aren't proper permutations.
Computing something more complex might work, but all the schemes I can think of require arbitrary-size numbers. For example you could take the sum of 2^elt, effectively creating a bitstring; but that requires N bits.
So how about reusing the solution that you didn't like: Sort. Return "duplicate" if you find a duplicate entry while sorting. Given the problem's constraints, the array can be sorted in O(n) time using something like an in-place radix sort.
The inner loop is entered once per cycle within the permutation, and runs for the length of the cycle. The sum of the cycle lengths is N; thus the algorithm is O(n) even though it may not look like it at first glance.
def HasDuplicates(array):
for i in range(len(array)):
while array[i] != i:
val = array[i]
if array[val] == val:
return DUPLICATE
array[i], array[val] = array[val], array[i]
return NO_DUPLICATE
That's not quite the same sort of "there is no equation". There are equations that describe perfectly the time evolution of the 3-body problem. There is just (in general) no closed-form solution for the state of the system.
That said, even assuming a perfect integrator there's no way to measure the initial state precisely, so there are limits to how far you can evolve it computationally. However, similar arguments hold for the 2-body problem; so you'll have to find a more clever way of "macro-fying" quantum uncertainty effects.
Basically, there are smart programmers that use good names which help convey the same types of "instant" type information
This is the spirit of HN. It gives you an unambiguous grammar for constructing those "good names". This is similar to having coding conventions that standardize verbs and nouns (eg prefer "foo_num" to "foo_count")
The "type changes" argument is rather ridiculous -- it's like complaining that refactoring makes you touch a lot of files. A type change isn't a trivial operation and shouldn't be treated as such. One could also ask what is so special about a name chosen by a smart programmer that makes it somehow more resistant? Perhaps because it specifies semantic information instead of raw type information. IMHO this is a smart thing to do in Hungarian. Instead of "int iNumFoo" and "Foo* pFoo", use "nFoo" and "aFoo".
The reward of HN is that it gives you a consistent way to encode common sorts of semantic information, while separating it from the more useful content of a variable name. It is similar to the sort of thing as what we used to do with function names in the days before we knew we were being object-oriented:
Parrot is being designed to accept all dynamic languages. OSCON 2004 will be when we discover who wins the Pie-thon competition; in it, we see whether parrot is faster at running _python code_ than the current cpython.
You can bet that Dan wouldn't be risking a pie in the face if he didn't care about whether or not parrot could host python.
The reason Parrot is register based has nothing whatsoever to do with reduction in the number of opcodes. In fact, the Parrot VM opcode count is quite large, largely because of combinatorial issues. If every x86 opcode that used mod/reg/rm addressing was actually counted as (# mod/reg/rm combinations) opcodes, that would be roughly analagous to what's going on in Parrot.
The "jailtime" is for mail fraud. Read the article and you'll learn that he defrauded Cisco of $600K worth of hardware in order to sell it on the grey market.
This has been going on in Japan for quite a while. Instead of acronyms, you have words made out of initial syllables -- pokemon being a fairly popular recent example.
"Photons...cannot exist at a speed less than light"
"And yet the stick looks bent when placed in water."
They're still moving at the speed of light; just not c.
The GameSpot article has a factual error as a result of a typo:
g ory=0&id=31144
First, the two studios requested that Microsoft relinquish its demands and that the Halo movie strictly follow a Bungie-penned "bible,"
The "bible" demand comes from Microsoft, not from the studios. One reference: http://www.scifi.com/scifiwire2005/index.php?cate
The sky is not falling, and Dijkstra can explain why better than I possibly could:
The traditional mathematician recognizes and appreciates mathematical elegance when he sees it. I propose to go one step further, and to consider elegance an essential ingredient of mathematics: if it is clumsy, it is not mathematics.
Edsger W. Dijkstra, from Predicate Calculus and Program Semantics
His name is Ramanujan. You may just be trying to be cute by calling him "Indian math guy", but give him some props too. Hiding his name in the URL isn't enough.
When will it be "Grand Theft Auto led teen to hijack ambulance, drive people to hospital"?
Of course, the first thing I search for in the article is a link that describe the language itself. What a thing to leave out!
That's as bad as that browser rendering bug that shows up on slashdot all the time. Most of the text except for the left bar disappears, but shrinking and then increasing the text size fixes it! The browser that displays that bug really is a piece of shit.
(Note: I don't actually think Firefox is a piece of shit)
A senior programmer should know that very little justifies a useless change just before one ships. Removing dead code -- especially suspicious looking dead code -- does not help a project in any appreciable way. So shame on the junior programmer for not putting in a comment, and shame on the senior programmer for taking the bait.
The proper endgame mindset should be, "Does this change (or more generally, this action) help me ship the product? If not, I won't do it."
Computing something more complex might work, but all the schemes I can think of require arbitrary-size numbers. For example you could take the sum of 2^elt, effectively creating a bitstring; but that requires N bits.
So how about reusing the solution that you didn't like: Sort. Return "duplicate" if you find a duplicate entry while sorting. Given the problem's constraints, the array can be sorted in O(n) time using something like an in-place radix sort.
The inner loop is entered once per cycle within the permutation, and runs for the length of the cycle. The sum of the cycle lengths is N; thus the algorithm is O(n) even though it may not look like it at first glance.
For technical game development discussion, gdalgorithms is good: info.
sweng-gamedev is also sometimes interesting; as you might guess from the name, it focuses more on the engineering side and less on algorithms: info
It only needs to be a blind test, unless you worry that the computer administering the test is biased.
And be sure to check out this previously posted /. article.
For you who obviously didn't RTFA:
/. thread, thanks.
"...revenue generation. This bad boy will probably pay for itself..."
The light doesn't write tickets. It turns red. Turning red doesn't generate revenue.
Take your blind cynicism to some other
That's not quite the same sort of "there is no equation". There are equations that describe perfectly the time evolution of the 3-body problem. There is just (in general) no closed-form solution for the state of the system.
That said, even assuming a perfect integrator there's no way to measure the initial state precisely, so there are limits to how far you can evolve it computationally. However, similar arguments hold for the 2-body problem; so you'll have to find a more clever way of "macro-fying" quantum uncertainty effects.
This is the spirit of HN. It gives you an unambiguous grammar for constructing those "good names". This is similar to having coding conventions that standardize verbs and nouns (eg prefer "foo_num" to "foo_count")
The "type changes" argument is rather ridiculous -- it's like complaining that refactoring makes you touch a lot of files. A type change isn't a trivial operation and shouldn't be treated as such. One could also ask what is so special about a name chosen by a smart programmer that makes it somehow more resistant? Perhaps because it specifies semantic information instead of raw type information. IMHO this is a smart thing to do in Hungarian. Instead of "int iNumFoo" and "Foo* pFoo", use "nFoo" and "aFoo".
The reward of HN is that it gives you a consistent way to encode common sorts of semantic information, while separating it from the more useful content of a variable name. It is similar to the sort of thing as what we used to do with function names in the days before we knew we were being object-oriented:
naive:
ReadTexture(T*)
DownsampleTexture(T*)
hungarian:
Texture_Read(T*)
Texture_Downsampl
Long story short, there are smart programmers who actually think about why they do the things they do, and there are bad programmers who are parrots.
Parrot is being designed to accept all dynamic languages. OSCON 2004 will be when we discover who wins the Pie-thon competition; in it, we see whether parrot is faster at running _python code_ than the current cpython.
You can bet that Dan wouldn't be risking a pie in the face if he didn't care about whether or not parrot could host python.
The reason Parrot is register based has nothing whatsoever to do with reduction in the number of opcodes. In fact, the Parrot VM opcode count is quite large, largely because of combinatorial issues. If every x86 opcode that used mod/reg/rm addressing was actually counted as (# mod/reg/rm combinations) opcodes, that would be roughly analagous to what's going on in Parrot.
Parrot uses registers for speed, that's "all".
Bad comparison. The GBC doesn't "fight with" the GBA any more than the PS1 fights with the PS2.
The "jailtime" is for mail fraud. Read the article and you'll learn that he defrauded Cisco of $600K worth of hardware in order to sell it on the grey market.
It's a trojan!
This has been going on in Japan for quite a while. Instead of acronyms, you have words made out of initial syllables -- pokemon being a fairly popular recent example.
You meant discreet.
An antibubble is not a bubble that floats downwards. It's a bubble whose membrane is made of air instead of fluid.
I've heard the stick joke before. Usually it's accompanied by another couple:
Q: What's red and invisible?
A: No tomoatoes
Q: What's orange and sounds like a parrot?
A: A carrot
Without NVidia's financing, it would be called "Bridge Construction Set", and be available through Chronic Logic's web site.