| kruskal |
43 lines
of
Ruby
by
AndrewCap
|
1.22 KB |
Show |
Edit |
Expand |
1
2
3
4
5
6
7
8
9
10 |
require 'pp'
require 'benchmark'
def file
@file ||= File.readlines("edges.txt")
end
def has_cycles(edge)
node_one, node_two = edge[:from], edge[:to]
@minimum_spanning_tree.each ... |
|
| prim |
75 lines
of
Ruby
by
AndrewCap
|
2.31 KB |
Show |
Edit |
Expand |
1
2
3
4
5
6
7
8
9
10
11
12
13 |
require 'pp'
require 'benchmark'
def file
@file ||= File.readlines("edges.txt")
end
def header
@header ||= file.take(1)[0]
end
def number_of_nodes
@number_of_nodes ||= header... |
|
| Test |
5 lines
of
Java
by
Tester
|
202 Bytes |
Show |
Edit |
Expand |
1
2
3
4 |
private ProposalUserAccess GetUserProposalAccess(int proposalId)
{
var proposalAccess = _proposalAccessManager.GetUserProposalPermission(EmployeeNumber, proposalId);
return proposalAccess;... |
|
| Test |
5 lines
of
C
by
Tester
|
202 Bytes |
Show |
Edit |
Expand |
1
2
3
4 |
private ProposalUserAccess GetUserProposalAccess(int proposalId)
{
var proposalAccess = _proposalAccessManager.GetUserProposalPermission(EmployeeNumber, proposalId);
return proposalAccess;... |
|
| rwx patch for rdocs |
84 lines
of
diff
by
Quintus
|
2.26 KB |
Show |
Edit |
Expand |
|
|
| Eat your own dogfood |
26 lines
of
Ruby
|
860 Bytes |
Show |
Edit |
Expand |
1
2
3
4
5 |
CodeRay.scan('puts "Hello, world!"', :ruby).div
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 |
|
|