[ create a new paste ] login | about

kinaba

Name: Kazuhiro Inaba
Email:
Site/Blog: http://twitter.com/kinaba
Location: Japan
Default language: C++
Favorite languages: C++
About:

Saved pastes by kinaba:

Ruby, pasted on Jan 30:
1
2
3
4
5
def first_occurence( bits )
	random_bits = []

	loop do
		random_bits << rand(2)
...
view (21 lines, 2 lines of output)
C, pasted on Nov 18:
1
2
3
4
5
#include <stdio.h>

void foo(int i)
{
	printf("%d\n", sizeof(int[i]));
...
view (15 lines, 4 lines of output)
D, pasted on Nov 7:
1
2
3
4
5
class Factory
{
	static Exception create(T)(T x)
	{
		return new Exception("whatever");
...
view (12 lines, 1 line of output)
C, pasted on May 18:
1
2
3
4
#include <stdio.h>

#define MAX_TREE_HEIGHT 10
#define TREE_BUFSIZE (1<<MAX_TREE_HEIGHT)
...
view (28 lines, 3 lines of output)
Perl, pasted on Feb 20:
1
2
3
4
5
BEGIN {
	if( rand() > 0.5 ) {
		eval( "sub f {}" );
	} else 	{
		eval( "sub f() {}" );
...
view (9 lines, 2 lines of output)
C++, pasted on Dec 21:
1
2
3
4
5
#include <boost/version.hpp>
#include <iostream>

int main()
{
...
view (7 lines, 1 line of output)
C++, pasted on Nov 29:
1
2
3
4
5
#include <vector>
#include <iostream>
using namespace std;

// meta-function (for computing the return type of array2Vector)
...
view (35 lines, 3 lines of output)
C++, pasted on Oct 19:
1
2
3
//------------------------------------------------------------------------------------
// [Metafunction] Substitution as usual
//------------------------------------------------------------------------------------
...
view (155 lines)
C++, pasted on Jan 7:
1
2
3
4
5
#include <iostream>
#include <typeinfo>
using namespace std;

template<typename A>
...
view (16 lines, 1 line of output)
C++, pasted on Nov 6:
1
2
3
4
5
//-----------------------------------------------------------------------------
// >>Code Template<< (for Visual C++)

#include <iostream>
#include <sstream>
...
view (76 lines)