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.
test |
126 lines
of
Ruby
by
michele
|
3.68 KB |
Show |
Edit |
Expand |
1
2
3
4
5
6
7
8
9
10
11 |
class GuiTest < Gtk::Window
def initialize
super
set_title "Test"
init_ui
set_default_size 180, 100
set_border_width 5
set_resizable false
s... |
|
GuitarWar |
60 lines
of
PHP
by
Thiago
|
3.35 KB |
Show |
Edit |
Expand |
1
2
3
4 |
<?php
require_once('autoriza.php');
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 ... |
|
asdas |
42 lines
of
Ruby
by
asfd
|
893 Bytes |
Show |
Edit |
Expand |
1
2
3
4
5
6
7
8
9
10
11 |
a=100000.0
r=0.06
p=10000.0
n=Math.log((-p)/(a*r-p),1+r)
p "n=#{n}"
time= ( (1.0+r)**n * (a*r-p) +p)/r
p "Amount to pay after #{n} years : #{time}"
a=100000.0
... |
|
asdas |
44 lines
of
Ruby
by
asfd
|
852 Bytes |
Show |
Edit |
Expand |
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15 |
a=100000.0
r=0.06
p=10000.0
n=Math.log((-p)/(a*r-p),1+r)
p n
time2=( (1.0+r)**n * (a*r-p) +p)/r
p time2
a=100000.0
r=0.07754689530012998
n=15.... |
|
asdas |
46 lines
of
Ruby
by
asfd
|
694 Bytes |
Show |
Edit |
Expand |
1
2
3
4
5
6
7
8
9
10
11
12
13 |
tr=6.0155030729515095
def g(x)
6.28+Math.sin(x)
end
results=Array.new
eps= 0.00001
x0 = 6
x1 = x0+eps*10.0
i = 0
while ((x1-x0).abs>eps) do
x0=i==0 ? 6 : x1
x1=g(x0)
results[i]= x1... |
|
asdas |
45 lines
of
Ruby
by
asfd
|
687 Bytes |
Show |
Edit |
Expand |
1
2
3
4
5
6
7
8
9
10
11
12
13 |
tr=0.714190048071806
def g(x)
0.9/(1.0+x**(4.0))
end
results=Array.new
eps= 0.00001
x0 = 0.75
x1 = x0+eps*10.0
i = 0
while ((x1-x0).abs>eps) do
x0=i==0 ? 0.75 : x1
x1=g(x0)
result... |
|
asdas |
50 lines
of
Ruby
by
asfd
|
713 Bytes |
Show |
Edit |
Expand |
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15 |
tr=0.85260550201372549135
def g(x)
2.0*Math.exp(-x)
end
results=Array.new
eps= 0.00001
x0 = 0.8
x1 = x0+eps*10.0
i = 0
while ((x1-x0).abs>eps) do
x0 = i==0 ? 0.8 : x1
x1 = g(x0)
... |
|
asdas |
50 lines
of
Ruby
by
asfd
|
713 Bytes |
Show |
Edit |
Expand |
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15 |
tr=0.85260550201372549135
def g(x)
2.0*Math.exp(-x)
end
results=Array.new
eps= 0.00001
x0 = 0.8
x1 = x0+eps*10.0
i = 0
while ((x1-x0).abs>eps) do
x0 = i==0 ? 0.8 : x1
x1 = g(x0)
... |
|
asdas |
10 lines
of
Ruby
by
asfd
|
216 Bytes |
Show |
Edit |
Expand |
1
2
3
4
5
6
7
8
9 |
x = 0.5
c_values = [1.0, 1.25, 1.5, 1.75, 2.0, 2.25, 2.5, 2.75, 3.0, 3.25, 3.75]
c_values.each { |c|
temp=0
100000.times {
temp = x
x = c* x * (1-x)
}
puts "c=#{c} \t:\t x=#{x} :\t... |
|
asdas |
82 lines
of
Ruby
by
asfd
|
1.27 KB |
Show |
Edit |
Expand |
1
2
3
4
5
6
7
8
9
10
11
12
13
14 |
trueroot=1.0
Restults=Hash.new()
def f(x)
x**(3.0)-3.0*x**(2.0)+3.0*x-1
end
def f1(x)
3.0*x**(2)-6.0**x+3.0
end
def bisection(inta, intb, epsilon )
a, b = inta, intb
c = ... |
|