God Must Be Crazy
  • Member for 6 years, 2 months
  • Last seen this week
Stats
1,737
reputation
301k
reached
265
answers
114
questions
Loading…
About

Disclaimer:

Any contents (excluding intellectual properties from third parties) I posted in StackOverflow and StackExchange sites can be claimed as yours without prior written permission from me. No attributions are needed. This statement never expires.

The contents of my profile page has been wiped completely by someone who considered my page is irrelevant or unnecessary. Scientific facts that I have gathered for decades gone forever. Our next generation will be hard to rediscover or reinvent them.

By the way, my blood type is Microsoft .Net and I love typing semicolons. I am just a single point on the complex plane. I am not the strongest and smartest species in this universe. I love mathematics, physics, and programming. I am the only one who knows the last digit of π. I am a sort of person who don't want to be bothered with reading lengthy documentations even for things that potentially cause catastrophic effects. I considered it as my learning style. I can tell you more but then I have to kill you.

  • Euler's identity is often cited as an example of deep mathematical beauty. It links five fundamental mathematical constants: 0, 1, π, e, and i.

  • C++ can also be cited as an example of deep programming beauty. It can link all four types of brackets: [],<>,(), and {}.

    auto foo = []<typename T>(T a, T b) { return a + b; };
    

TypeScript:

let foo = (x: number) => (y: number) => x * y;
console.log(foo(2)(3));

C#:

Func<int, Func<int, int>> foo = (x) => (y) => x * y;
Console.WriteLine(foo(2)(3));

C++:

auto foo = [](int x)
{
    return [=](int y)
    {
        return x * y;
    };
};
cout << foo(2)(3) << endl;

Java:

Function<Integer, Function<Integer, Integer>> foo = (x) -> (y) -> x * y;
System.out.println(foo.apply(2).apply(3));

Python:

foo = lambda x: lambda y: x * y
print(foo(2)(3))

Clipboard:

namespace Temporary {
  type Foo<T> = (x: T, y: T) => T;
  interface Goo<T> {
    (x: T, y: T): T;
  }
  interface Hoo<T> {
    prop: (x: T, y: T) => T;
  }
  let f: Foo<number> = (x: number, y: number): number => x * y;
  let g: Goo<number> = (x: number, y: number): number => x + y;
  let h: Hoo<number> = { prop: (x: number, y: number): number => x / y };
  
  console.log(f(2, 3));
  console.log(g(2, 3));
  console.log(h.prop(2, 3));
}
2
gold badges
19
silver badges
66
bronze badges
604
Score
151
Posts
40
Posts %
257
Score
133
Posts
35
Posts %
50
Score
11
Posts
3
Posts %
44
Score
21
Posts
6
Posts %
36
Score
19
Posts
5
Posts %
34
Score
17
Posts
4
Posts %