Welcome! This page is using CodeRay 1.1.2.
We currently have
3055 rays
in the database.
You can add a
New Ray
or browse the posted rays by pages.
asdas |
81 lines
of
Ruby
by
asfd
|
1.31 KB |
Show |
Edit |
Expand |
1
2
3
4
5
6
7
8
9
10
11
12
13 |
trueroot=0.42630275100686274567
Restults=Hash.new()
def f(x)
x**(0.5) - Math.exp(-x)
end
def f1(x)
1/(2*Math.sqrt(x)) + Math.exp(x)
end
def bisection(inta, intb, epsilon )
a, ... |
|
some ruby |
13 lines
of
Ruby
by
Dino
|
149 Bytes |
Show |
Edit |
Expand |
1
2
3
4
5
6
7
8
9
10
11
12
13 |
get '/users' do
redirect to('/')
end
get '/users/new' do
haml :users_new
end
post '/users' do
@user = params[:user]
haml :user
end |
|
action |
9 lines
of
Ruby
|
158 Bytes |
Show |
Edit |
Expand |
1
2
3
4
5
6
7
8
9 |
MAGIC_NUMBER = 10000000
def is_anyout_out_there?
"Is anybody out there?"
end
def hardcore_action
MAGIC_NUMBER.times { is_anyout_out_there? }
end |
|
asda |
8 lines
of
Plain text
by
asda
|
213 Bytes |
Show |
Edit |
Expand |
1
2
3
4
5
6 |
class Array
def quick_sort
return self if length <= 1
pivot = self[0]
less, greatereq = self[1..-1].partition { |x| x < pivot}
less.quick_sort + [pivot] + greatereq.quick_so... |
|
asda |
35 lines
of
PHP
by
asda
|
697 Bytes |
Show |
Edit |
Expand |
1
2
3
4
5
6
7
8
9
10
11 |
def merge_sort(m)
if m.length <= 1
return m
end
middle = m.length / 2
left = m[0,middle]
right = m[middle..-1]
left = merge_sort(left)
right = merge_... |
|
Assembly info |
8 lines
of
Java
by
test
|
563 Bytes |
Show |
Edit |
Expand |
1
2
3 |
Indexer.TFSUtil tfsUtil = new Indexer.TFSUtil();
tfsUtil.UnitTesting = true;
Assert.IsNotNull(tfsUtil.ConnectToTFS(@"http://israel2-pc:8080/tfs/", @"israel2-pc... |
|
JSON response |
17 lines
of
JSON
|
195 Bytes |
Show |
Edit |
Expand |
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 |
{
total: 51,
index: 1,
list: [
{
unite: {
code: "J",
libelle: "Jour"
},
unites: true,
souhait: false,
libelle: "122638",
uniteh: true,
unitej: true,
code: "1226",
unitem: true
}]} |
|
test for Terminal |
8 lines
of
Plain text
|
76 Bytes |
Show |
Edit |
Expand |
1
2
3
4
5
6
7
8 |
<pre>
<code class="terminal">
var="hola"
./configure
</code>
</pre> |
|
Number Maping |
7 lines
of
JavaScript
by
Drsko Senchitj
|
196 Bytes |
Show |
Edit |
Expand |
1
2
3
4
5
6
7 |
function mapNumber(id1, id2){
var firstDigit = Math.min(id1, id2);
var secondDigit = Math.max(id1, id2);
return (firstDigit*(25-firstDigit)>>1) + secondDigit - 1;
} |
|
Ruby method |
3 lines
of
Ruby
by
JM
|
34 Bytes |
Show |
Edit |
Expand |
1
2
3 |
def say_hello
puts "Hello"
end |
|