Welcome! This page is using CodeRay 1.1.2.
We currently have
3043 rays
in the database.
You can add a
New Ray
or browse the posted rays by pages.
Proaxis |
12 lines
of
Ruby
|
257 Bytes |
Show |
Edit |
Expand |
1
2
3
4
5
6
7 |
def find_smallest array1, array2
min = Float::INFINITY
array1.each_with_index { |elem1,i|
array2.each_with_index{ |elem2, j|
diff = (elem1 - elem2).abs
min = diff unless diff > min
... |
|
foo |
11 lines
of
Ruby
by
mutexkid
|
127 Bytes |
Show |
Edit |
Expand |
1
2
3
4
5
6
7
8
9
10
11 |
module Test
class Testa
def testa
puts "heyyyy".reverse
end
end
end
t = Test::Testa.new
t.testa
|
|
asd |
4 lines
of
Ruby
|
32 Bytes |
Show |
Edit |
Expand |
1
2
3
4 |
gem lol
def ok
puts 'ok';
end |
|
fder |
27 lines
of
Ruby
|
723 Bytes |
Show |
Edit |
Expand |
1
2
3
4
5
6
7
8
9 |
B =
0.632120558828558
0.264241117657115
0.160602794142788
0.113928941256923
0.0878363238562491
0.0713021781098032
0.0599336274873766
... |
|
Ders |
8 lines
of
Ruby
by
Def
|
92 Bytes |
Show |
Edit |
Expand |
1
2
3
4
5
6
7
8 |
format LONGG;
B=zeros(1,26);
B(1)=1-exp(-1);
for k=1:25
B(k+1)=k*B(k)-exp(-1);
end
B |
|
php rest tutorial |
15 lines
of
PHP
by
nick
|
336 Bytes |
Show |
Edit |
Expand |
1
2
3
4
5
6
7
8
9 |
$resource = array_shift($paths);
if ($resource == 'clients') {
$name = array_shift($paths);
if (empty($name)) {
$this->handle_base($method);
} else {
$this->... |
|
Test of Highlighting of all elements |
167 lines
of
Ruby
by
tyler
|
5.14 KB |
Show |
Edit |
Expand |
|
asdsa |
26 lines
of
Ruby
by
asda
|
695 Bytes |
Show |
Edit |
Expand |
1
2
3
4
5
6
7
8
9 |
n=1000
xx=[]
n.times{ |i|
xx[i]=(i-500.0)/(n/5).to_f
}
yy=xx
max_intens=255
c=Complex(-0.... |
|
asdsa |
9 lines
of
Ruby
by
asda
|
132 Bytes |
Show |
Edit |
Expand |
1
2
3
4
5
6
7
8
9 |
E=Math.exp(1)
def intk(k)
return k<1 ? 1-E**(-1) : k*intk(k-1)-E**(-1)
end
25.times { |i|
z=intk(i)
puts "#{i}: #{z}"
} |
|
asdsa |
5 lines
of
Ruby
by
asda
|
81 Bytes |
Show |
Edit |
Expand |
1
2
3
4
5 |
t=0.1
for n in 1..30
e=n/10.0-0.1*n
puts "#{n}\t #{n.to_s(2)}\t #{e}"
end
|
|