 # gasto

Member

210

## Everything posted by gasto

1. ## Is root of something is distributive?

Correct me if I am wrong: root is distributive with respect to division and multiplication but not with respect to addition and subtraction.
2. ## Machine Learning for procedurally generated levels.

If I could parse a phrase or a sentence to the algorithm, how easy would it be to generate a level based on the semantics extracted from the sentence. Especially for a puzzle/adventure game.   Imagine parsing the words: "latent ball in slope" and generate a level that contains a slope where a ball rotates and menaces squashing the player.
3. I've read that the human ear can hear up to 22000hz frequency, I suppose that when they write "frequency" they are referring to cycles per second. A standard frequency to store audio files is 44khz because that is the double of 22khz, being needed because of the Nyquist theorem. However, how would this translate in samples per second? imagining a sine wave(or a sawtooth wave) four samples as minimum would be needed to complete a cycle(a sample when sine receives 0?, the next one at ?/2, the next one at 1?, and the last one on the cycle at 3?/2). That results in 22000hz*4samples == 88000 samples per second Am I correct?
4. ## How can sample rate be 44000Hz?

How is that "margin" between the highest frequencies and half the sampling rate measured? One is a continuous signal(?) while the other is a digital signal(samples per second.)
5. Is there a way to Postfix a letter to a numeral, like in the case of a long integer: 2344532L, but for indicating a byte sized numeral?
6. I would understand it in 32 bit machines, word is 16 bits, so the last assembly statement assigns the first 16 bits of the 32 bit register eax to var2(hence it uses ax.) But in 64 bit machines, is eax 64 bits and ax 16bits?
7. Yes. For example, If: #include <stdint.h> int main() { uint8_t var = 0xFF; uint16_t var2 = var<<8; return 0; } Checking with the debugger the value of var2 after executing its initialization is 0xFF00, which makes me deduce that the compiler transformed var to a uint16_t or bigger when the bit shift happens.
8. My mistake, I had positioned the dereferencing asterisk after, not before(as it should be) the complicated expression.
9. I remember that -> was an alias for dereferencing and field selection, and dereferencing in C is done with : *  field selection with: . So I wonder why is it not compiling when I use *. ?
10. ## Difference between gain, amplitude, velocity and volume

Gain is well, how much the wave will be amplified. Amplitude is the level of decibels the wave arrives at each cycle without being influenced by gain. velocity is mostly used for MIDI. Volume is the final mixdown amplitude of all the waves.   Is that correct?
11. ## Difference between gain, amplitude, velocity and volume

Thanks that was helpful. I guess I need an engineering degree in acoustics to understand volume. Hehehe .
12. ## Function definition for interest rate.

I am not good at math notation. I need  to define a function that calculates the yearly accumulated deposit + interest.   For example I have got $30 in a fixed bank account, with an yearly interest of %10 . After a year I would possess$33, after another year \$36.3, and so on.   x?0; f(x)=(f(x-1)+30·0.1)x   Or some kind of recursive function I can't figure out.
13. ## Function definition for interest rate.

Oh, yes. What an idiot I am. 1.1, I could n't figure that out. [bashes head against desktop] Thanks.
14. ## Correct analogy about ordinals and combinatronics?

Ordinals are to permutations as cardinals are to combinations.   Is that assertion true?
15. Cool, using Pygame games to port it on android. It seems like a dream became true.
16. ## Multivariate function taking just one variable?

Why in some books is there a multivariate function specifying just one variable when it is supposed to take two or more. For example: why f(x)= x²+y²   and not   f(x,y)=x²+y²   Should yield the corresponding value of z.
17. ## How are the trigonometric functions computed?

There has been lurking in my mind a question for way too long, without being able to find a suitable, satisfying answer. How are sin(), cos(), and tan() functions calculated on a calculator or computer? I understand that mathematicians use the famous unit circle to define the trigonometric functions, but if   sin(?/4)=o/1 o= sin(?/4)*1   a=cos(?/4)*1   tan(?/4)=sin(?/4)                _______                 cos(?/4)   So we are still left with the question, how is sine, cosine and tangent computed? All the books and references that I read basically just suggest to use the calculator, in other words computed by magic or dogma.     Edit: I now remember that they use the Pythagorean theorem.   h²=o²+a²   ?=?/4 o=a       1²=2o²   ___ ?1/2 = o        ___ a= ?1/2                  ___ sin(?/4)=?1/2                _____                  1                    ___ cos(?/4)=?1/2                _____                  1                    ___ tan(?/4)=?1/2                _____                ?1/2 But how do they compute the rest of angles?
18. ## Win32 API, GetMessage() after PeekMessage()

If PeekMessage() is supposed to do the same thing that GetMessage() does but without waiting for there to be a retriavable message, why would somebody use GetMessage() after PeekMessage() has been called? while ( PeekMessage( &msg, NULL, 0, 0, PM_NOREMOVE ) )       {         // Translate and dispatch to WindowProc if not WM_QUIT         GetMessage( &msg, NULL, 0, 0 );         TranslateMessage( &msg );         DispatchMessage( &msg );       }
19.   struct Tile   {     TileType      Type;     unsigned int  Color;     unsigned int  Flags;     Tile( TileType Type = TILE_EMPTY, unsigned int Color = 0xffffffff, unsigned int Flags = 0 ) :       Type( Type ),       Color( Color ),       Flags( Flags )     {     }   };   Can somebody explain to me what on earth is the coder doing here? a struct is being initialized with default parameters within its own definition. I fail to assimilate its semantics and usage.
20. ## Intialization withn definition?

Non-Static Data Member Initializes, often abbreviated NSDMI. It's just syntactic sugar. These two pieces of code are functionally equivalent: struct foo { int i = 0; }; struct foo { int i; foo() : i(0) {} }; The advantage to NSDMI shines when you have only a default constructor (easier to read) or when you have many constructors (since you don't need to repeat the initializers over and over again. Note that these are _not_ equivalent to the original code that was posted, as the original code allows the user of the class to supply non-default data to the constructor. The above two examples both only supply a default constructor (no parameters). You can use NSDMI with the original example by doing something like: struct foo { int i = 0; foo() = default; foo(int i) : i(i) {} }; Whether you find that an improvement or not is another question.   What does foo()=default; do?
21. ## Intialization withn definition?

This makes much more sense and is less tautological.
22. ## Why is infinite technically not a number.

Why is ?(infinite) not considered a number? I mean, if zero is considered a number, it sounds reasonable to consider infinite a number too.
23. ## Pitching Your Game to Asian Publishers

If you've read this far but don't have a successful game to promote, then consider this article as information that's impractical for now. Yeah, thanks for pointing it out... after almost reading the entire article!
24. ## Why is infinite technically not a number.

Actually, if you add one to infinity you get ?+1=?
25. ## Why is infinite technically not a number.

For example, in set theory,   M??=? Set M union universal discourse equals universal discourse.