Welcome! This page is using CodeRay 1.1.2.

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

Page 263, 10 entries

1 upto 10 13 lines of Ruby by Noone 153 Bytes Show Edit Expand
1
2
3
4
5
6
7
8
9
10
11
12
13
int main() {
   int i=1;
   for (;i<10;i++) {
      printf("%d",i);
   }
  return 0;
}

# In Ruby

1.upto (10) do |x|
  printf "%2d\n", x
end
Test 2 lines of Ruby 404 Bytes Show Edit Expand
1
2
def e(x) return 34.chr+x+34.chr end;def q(a,b,c) print b+10.chr+'main=q '+e(b)+' '+e(c)+' '+e(a)+' '+10.chr end
q("def e(x) return 34.chr+x+34.chr end;def q(a,b,c) print b+10.chr+'main=q '+e(b)+' ...
rangotis 1 line of ERb by rangotis 13 Bytes Show Edit Expand
1
<%= "du[a" %>
nice 4 lines of Ruby by Amiel 80 Bytes Show Edit Expand
1
2
3
4
def blah
  ruby_code = %(weee " quote's " )
  self.is_probably_ruby_code?
end
blah 4 lines of Ruby 24 Bytes Show Edit Expand
1
2
3
4
"
asdasd #{
asdasd}
"
test of merge_sort 11 lines of Ruby by slothbear 235 Bytes Show Edit Expand
1
2
3
4
5
6
7
8
9
require "test/unit"
require "merge_sort"

# Tests use Array#sort as authoritative; good enough for now.

class TestMergeSort < Test::Unit::TestCase
  def test_empty_array
    a = []
    ass...
Test 7 lines of Delphi by Drarok 168 Bytes Show Edit Expand
1
2
3
4
5
6
7
Function Test(Engineer : Integer) : Currency;
Var
  SQL : String;
Begin
  SQL := Format('SELECT * FROM engineers WHERE id=%d', [Engineer]);
  Result := 1.50;
End;
test 63 lines of Ruby 1.43 KB Show Edit Expand
1
2
3
4
5
6
7
class TransactionsController < ApplicationController
  # GET /transactions
  def index
    @transactions = Transaction.find(:all)

    respond_to do |format|
      format.html # index.html.er...
Sieve of Eratosthenes 19 lines of Ruby by Drangon 362 Bytes Show Edit Expand
1
2
3
4
5
6
7
def sieve_of_eratosthenes(max_prime)
  sieve = Array.new(max_prime, true)
  sieve[0] = sieve[1] = false

  2.upto(Math.sqrt(max_prime)) do |i|
    if sieve[i]
      (i**2).step(max_prime, i) ...
dd 6 lines of Ruby 69 Bytes Show Edit Expand
1
2
3
4
5
6
def way_too_friendly
  23.times do
    puts 'hi there!'
  end
end

Page 263, 10 entries