Welcome! This page is using CodeRay 1.1.2.

We currently have 3063 rays in the database.
You can add a New Ray or browse the posted rays by pages.

Page 109, 10 entries

Eat your own dogfood 26 lines of Ruby 860 Bytes Show Edit Expand
1
2
3
4
5
# output as HTML div (using inline CSS styles)
CodeRay.scan('puts "Hello, world!"', :ruby).div

# ...with line numbers
CodeRay.scan("5.times do\n  puts 'Hello, world!'\nend", :ruby).div(:line_n...
asdsd 64 lines of Ruby by asdsda 1.09 KB Show Edit Expand
1
2
3
4
5
6
7
8
9
10
11
12
13
require 'pp'
P={
  "q0"=>[["a","q1"]],
  "q1"=>[["b","q2"],["b","q1"]],
  "q2"=>[["b","q0"],["a","q3"]],
  "q3"=>[["a","q4"]],
  "q4"=>[["a","q0"]]
}
sigma=["a","b"]
s=["q0"]
f=["q3"]
i=0
P1...
Lfpc3 6 lines of C++ by Me 115 Bytes Show Edit Expand
1
2
3
4
5
6
x=[-pi/2 0 pi/2 pi];
y=[1 0 1 0]
xx=-2:.01:3.5
yy=spline(x,y,xx);
plot(x,y,'k*',xx,yy)
p = polyfit(x, y, 3) 
123 22 lines of XML by 123 1.39 KB Show Edit Expand
1
2
<?xml version="1.0" encoding="UTF-8"?> 
<samlp:AuthnRequest xmlns:samlp="urn:oasis:names:tc:SAML:2.0:protocol" xmlns:saml="urn:oasis:names:tc:SAML:2.0:assertion" xmlns:ds="http://www.w3.org/2000/0...
diff test 8 lines of diff by msr 42 Bytes Show Edit Expand
1
2
3
4
5
6
7
8
2d1
< b
5,7c4
< e
< f
< g
---
> h
test 1 line of JSON by test 5 Bytes Show Edit Expand
1
ne'tz
test 12 lines of JSON by test 265 Bytes Show Edit Expand
1
2
3
4
5
6
7
8
9
{ 
    "Naam": "JSON",
    "Type": "Gegevensuitwisselingsformaat",
    "isProgrammeertaal": false,
    "Zie ook": [ "XML", "ASN.1" ] 
  },
  { 
    "Naam": "JavaScript",
    "Type": "Progra...
Some JSON string 1 line of JSON by Dmitry Zeldin 1.65 KB Show Edit Expand
1
{"daily_views": {"2013-09-09": 14, "2013-09-08": 14, "2013-10-07": 22, "2013-10-06": 15, "2013-10-05": 15, "2013-10-04": 19, "2013-10-03": 20, "2013-10-02": 17, "2013-10-01": 19, "2013-10-09": 14, ...
test 3 lines of JSON 123 Bytes Show Edit Expand
1
2
3
{"data":{"img_thumb":"jpg", "img_main":"jpg", "img_zoom":false, "nextIdx":3, "thumb":1},
"images":[{"id":1}, {"id":2}]]
}
Ruby-chan 34 lines of Ruby by Me 813 Bytes Show Edit Expand
1
2
3
4
5
6
7
class Array
  def merge_sort
    return self if self.length <= 1

    middle = (self.length / 2).to_i
    left = self[0..middle-1].merge_sort
    right = self[middle..self.length-1].merge_sor...

Page 109, 10 entries