This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Entity<X> | |
{ | |
public Entity(X x) | |
{ | |
} | |
public static <X> Entity<X> of(X x) | |
{ | |
return new Entity<X>(x); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// This is a well-compiled java class! | |
class A | |
{ | |
A(A A) { } A | |
A(A A) { return new A(A); } | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
環状リストです。 | |
+----+ | |
| | | |
[0] | | |
| | | |
[1] | | |
| | | |
[2] | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
using namespace std; | |
struct Node { | |
int m_value; | |
Node *m_prev; | |
Node *m_next; | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <cstdio> | |
using namespace std; | |
void swap(int &a, int &b) | |
{ | |
int t = a; | |
a = b; | |
b = t; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class Main | |
{ | |
private static void swap(Integer a, Integer b) // Integer使って参照(共有)渡し | |
{ | |
Integer t = a; | |
a = b; | |
b = t; | |
} | |
public static void main(String[] args) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use strict; | |
use warnings; | |
use List::Util qw/sum reduce/; | |
use Test::More; | |
sub sample1 { | |
my ( $a, $b ) = @_; | |
if ( !$a && !$b ) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package sandbox; | |
class First | |
{ | |
public static Second setName(String name) | |
{ | |
return new Second(name); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Church | |
Z = -> (s) { -> (z) { z } } | |
SUCC = -> (x) { -> (s) { -> (z) { s[x[s][z]] } } } | |
ADD = -> (x) { -> (y) { -> (s) { -> (z) { y[s][x[s][z]] } } } } | |
def value(x, succ: -> (n) { n + 1 }, unit: 0) | |
x[succ][unit] | |
end | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Peano | |
O = [].freeze | |
def succ(n) | |
n | [n] | |
end | |
def pred_rec(n, p, q) | |
if n == p | |
q |
OlderNewer