Hacker Newsnew | past | comments | ask | show | jobs | submit | more fbu's commentslogin

Isn't there a huge memory leak? Creating a new pointer on each iteration without keeping track of them.

I might be wrong I've been doing games in CL for some time now.


With a few exceptions, pointers returned by methods in Objective-C are assumed to be autoreleased. That means their reference count will be decremented at the end of the event loop.

But if OP is expecting a lifetime of learning, he might want to push a new autorelease pool for each iteration.


Or just release it. If you're sure it's autoreleased then retain/release it. If you're not sure, just set it to autorelease before you retain/release it.


retain/release on an autoreleased object won't make it get destroyed any faster. You still have to wait for the event loop to cycle (or push/pop your own autorelease pool).


That's correct. That's something I read, have repeated but never bothered to actually test.


Assuming that's in his init method, he left

-(void) dealloc {

  self.newProgram = nil;
}

as an exercise for the reader.


Maybe the numbering of TeX will now go up to 6 and something...


Yes, he is changing the numbering from pi to tau.


Back when it was first announced, everybody made jokes about the new TeX policy and every document made using TeX will have to be reviewed before publishing :)


I got a 503, anyone else does?


It was up 15 minutes ago. My guess is there were too many concurrent users.


Ironic for erlang..

I kid.. I kid


Glad you got the joke. :)


Either that or they just had to take the site down temporarily to install some new code.


Just in case anybody else got confused:

You don't take down an Erlang system to upgrade the code, you simply cause the nodes to update themselves, by sending them a message.


several hack attacks, he says he's discussing them tomorrow: twitter.com/prof3ta


It's back up now!


still down ?



Seems to be due to Twitter folks making fun of them, rather than the appearance of the substring "cum" in the URL, however.


Ofcourse, the twitter folks are making fun of them because the substring "cum" appears in the URL :)


He actually is broke, liquidity issues as I understand it. http://www.laobserved.com/biz/2010/06/elon_musk_is_broke.php


There still is a significant chance this is not what he meant.


No, there is not. When the real Steve Jobs said "freedom from porn" it was in reference to the app store, where there is and will remain no porn.


e^ix = cos x + i sin x

It really has nothing to do with the value of i, it's just a convention. It really just says that cos pi = -1 which is nice but that's it.


It is actually far from just a convention. It has everything to do with the Taylor series of the functions e^x, sin x and cos x.

e^x = 1 + x/1 + x^2/(2!) + x^3/(3!) + ...

If you substitute ix for x, you get:

e^{ix} = 1 + ix/1 + (ix)^2/(2!) + (ix)^3/(3!) + ... = = 1 + ix + (-x^2)/(2!) + (-i)x^3/(3!) + ...

You can also derive the Taylor series for sin x and cos x, which are:

sin x = x - x^3/(3!) + x^5/(5!) + ...

cos x = 1 - x^2/(3!) + x^4/(4!) + ...

Therefore you can see that e^{ix} = cos x + i(sin x). Of course, I haven't shown how to derive the Taylor series (http://en.wikipedia.org/wiki/Taylor_series) for these functions, but I have to stop somewhere.

I hope that I have shown you that this isn't just an arbitrary convention, in fact far from it. The formula is so beautiful also because of the many intricate relationships between all these elementary mathematical concepts, including complex analysis, trigonometric functions, series, etc.

It should also be noted that this is just one of the many (in fact, aleph zero many) different ways to prove this equivalence.

Edit: Some formatting corrections, sorry, new here.


I can't resist not showing this clever derivation of the e Maclaurin series.

I referenced the fact that

e^x = 1 + x/1 + x^2/(2!) + x^3/(3!) + ...

Now, one of the many equivalent definitions of e is that it is the only real number for which this holds:

d/dt (e^t) = e^t

This means that e^t is a real function which is so smooth, that no matter how many times you differentiate it, you always get the same function (it turns out that it is the only such real function)

Now, we know that e^0 = 1 (since x^0 = 1, where x != 0). Therefore, in its Maclaurin series, the only term not depending on x should therefore be 1 (otherwise e^0 wouldn't be 1).

So know we know that e^x looks something like this:

e^x = 1 + (something)

Now we can ask ourselves which this question: since d/dx e^x = e^x, what must also be in the e^x series, if 1 belongs to it? Well, whatever differentiates to 1, so now we know that

e^x = 1 + x + (something)

(because d/dx (1 + x + something) = 1 + x + d/dx something)

Now we can again ask this question for our current form; what must we differentiate in order to obtain 1 + x? And thus we get

e^x = 1 + x + x^2/2 + something

This way, if we write the two (equivalent) series this way:

e^x = 1 + x + x^2/2 + d/dx e^x = 1 + x + x^2/2 + x^3/(2*3) +

And we can complete it with the infinite Maclaurin series.

Now this is less formal than it should be and it would probably make the formalists cringe, but I hope you get the idea. You can actually apply the same principle for sin x and cos x, except in their case, they're actually mutually derived from each other. I'll leave that as an exercise for the reader (oh how fun it is to say that after reading this phrase countless times)


Great. Now I'm going to spend the rest of the morning trying to figure out whether you can really do it that way.

[Edit: Ah yes. The formalism goes like this: Consider the above series. By the above argument, it differentiates to itself. QED. ]


Ah, but how do you know that e^x is the only thing that differentiates to itself? :)


You don't need to. The uniqueness part of the definition is never used in that argument. (In fact, a*e^x also differentiates to itself, for any a; but that's a trivial case.)

Uniqueness almost follows from that argument. It's now easy to see that exp is the only analytic function satisfying exp' = exp and exp(0) = 1: if you have another one, by the same argument, it has the same Maclaurin expansion, hence is the same function.

However, I don't know how to prove uniqueness over all functions, not just analytic ones.


By that reasoning, a lot of math is a "convention".

The link between exponential and sinusoidal functions is of fundamental importance in many fields--obviously anything dealing with complex numbers, which is not just math but physics, electric engineering, computer graphics, and so on... and the complex definition of e^x is really the only way to define it such that it retains all its important properties in a natural way, revealing the link between trig and exponentiation. Euler's identity is fundamental, not conventional.


I wouldn't say it's "just" a convention. That implies it's arbitrary. It might look arbitrary, but it's not: for example, d/dx ((cos x + i sin x)/e^ix) = 0, as required. This doesn't hold if you pick (say) e^ix = cos x - i sin x.


A virtual machine working only on html 5 ?


For a new civilized startup age ?

http://xkcd.com/297/


Idealized Lisp Syndrome is something the read-only "fans" suffer from. Real Lispers don't see the parens, but they also don't see what the fuss is all about ..

I am a Lisper by day-job, and it too is capable of being a royal pain in the ass. Only difference is, instead of bitching about other people's code; in Lisp, I have to write the code then bitch about it :-/


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: