Welcome! This page is using CodeRay 1.1.2.
We currently have
3054 rays
in the database.
You can add a
New Ray
or browse the posted rays by pages.
a |
5 lines
of
Ruby
|
124 Bytes |
Show |
Edit |
Expand |
1
2
3
4
5 |
road_bike = RoadBike.new(
size: 'M',
tape_color: 'red')
puts road_bike.size |
|
a |
1 line
of
Ruby
|
19 Bytes |
Show |
Edit |
Expand |
|
a |
13 lines
of
Ruby
|
332 Bytes |
Show |
Edit |
Expand |
1
2
3
4
5
6
7
8
9 |
road_bike = RoadBike.new(
size: 'M',
tape_color: 'red')
road_bike.size
mountain_bike = MountainBike.new(
size: 'S',
... |
|
a |
16 lines
of
Ruby
|
351 Bytes |
Show |
Edit |
Expand |
1
2
3
4
5
6
7
8
9 |
class Bicycle
def initialize(**opts)
end
end
class RoadBike < Bicycle
|
|
queue |
17 lines
of
C
|
665 Bytes |
Show |
Edit |
Expand |
1
2
3
4
5
6 |
typedef struct MQ MQ_t;
MQ_t* MsgQueueCreate (char *_msgQueueName, size_t _msgMax, size_t _memSize);
MQ_t* MsgQueueConnect (char *_msgQueueName);
void MsgQueueDestro... |
|
bash python mix |
3 lines
of
SQL
by
wow
|
12 Bytes |
Show |
Edit |
Expand |
|
a |
11 lines
of
Ruby
|
140 Bytes |
Show |
Edit |
Expand |
1
2
3
4
5
6
7
8
9
10
11 |
def gear_inches
ratio * (rim+(tire*2))
end
def gear_inches
ratio * diameter
end
def diameter
rim+(tire*2)
end |
|
a |
7 lines
of
Ruby
|
117 Bytes |
Show |
Edit |
Expand |
1
2
3
4
5
6
7 |
def diameters
wheel.map { |wheel| diameter(wheel) }
end
def diameter(wheel)
wheel.rim + (wheel.tire*2)
end |
|
a |
3 lines
of
Ruby
|
70 Bytes |
Show |
Edit |
Expand |
1
2
3 |
def diameter
wheels.map { |wheel| wheel.rim + (wheel.tire*2) }
end |
|
a |
16 lines
of
Ruby
|
307 Bytes |
Show |
Edit |
Expand |
1
2
3
4
5
6
7
8
9
10
11
12 |
class RevealingRefrences
attr_reader :wheels
def initialize(data)
@wheels = wheelify(data)
end
def diameter
wheels.map { |wheel| wheel.rim + (wheel.tire*2) }
end
W... |
|