Latest Entries »

<3 Lambdas

I absolutely love lambda expressions in C#. I finally got around to trying to write a good derivation function, and produced this piece:

/// <summary>
/// Derives f(x)
/// </summary>
/// <param name="f">The function f(x) to be derived</param>
/// <returns>The derivative df/dx as a function</returns>
public static Func<double, double> fprime(Func<double, double> f)
{
	return x =>
	{
		double h = 1;
		double tempf = 0;
		double guessf = 0;
		do
		{
			tempf = guessf;
			guessf = (f(x + h) - f(x)) / h;
			h = h / 10;
		} while (Math.Abs((guessf - tempf) / guessf) > 0.001);

		return guessf;
	};
}

The Illusion

It occurs to me that all fears and stresses come from illusions created by our own minds. It comes in wildly varying extremes, from the man who perceives everyone to be plotting against him, to the student who hides from his own life because he sees himself as overstepping social bounds with every word out of his mouth. It’s all perception… and it’s all crippling. The question is, if you know it’s an illusion and still can’t break free, what should you do?

Why hello there.

So, I am writing to this blog for the hell of it. I don’t know how much I plan on disclosing or what the hell I even plan on talking about, but whatever. I have to be up in six-ish hours and I can’t sleep.

Follow

Get every new post delivered to your Inbox.