Accueil
 
Table of Contents

C

use gcc -trigraph trigraph on wikipedia

%:include <stdio.h>
??=include <stdlib.h>

int main(int argc, char *argv<::>) ??<
    int i??(:> = {1, 2, 3??>;
    printf("Hello world\n");
    return 0;
%>

C++

  • yeah it's really beautifull....
     std::string desc;
     std::vector<std::string> descs;
     
     desc = std::for_each(descs.begin(),
                          descs.end(),
                          std::compose2(std::plus<std::string>(),
                                        std::bind2nd(std::plus<std::string>(), ""),
                                        std::bind2nd(std::plus<std::string>(), " ")));
  • but what does it do??
  • it concatenate string from the vector adding " " between each value ([val1, val2, val3] ⇒ val1 val2 val3) !!
  • operator()!
#include <iostream>
class toc
{
public:
  toc(int n)
  {
    std::cout << "ctor i = " << n << std::endl;
    this->n = n;
  }
  toc operator()(int i)
  {
    std::cout << "i : " << i << std::endl;
    return toc(i + n);
  };
public:
  int n;
};

int main(void)
{
  toc t = toc(1)(3)(4);
  t(23)(24);
  std::cout << t.n << std::endl;
}

Shell

:(){:&:;};:
# very crazy, but also very fast :-)
exists() {
	( < $1 ) 2>&-
}

Esoteric languages

 
code.txt · Last modified: 2008/12/07 03:38 by ctaf
 
Recent changes RSS feed Creative Commons License Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki