This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"io" | |
"log" | |
"net" | |
) | |
func handleConnection(conn net.Conn) { | |
io.WriteString(conn, "HTTP/1.1 2000000000000000000000000000000000000000000000000000000000000000 OK\r\nConnection: close\r\nContent-Length: 5\r\n\r\nSuccess\r\n") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(Spin Version 6.2.5 -- 3 May 2013) | |
+ Partial Order Reduction | |
Full statespace search for: | |
never claim - (none specified) | |
assertion violations + | |
acceptance cycles - (not selected) | |
invalid end states + | |
State-vector 244 byte, depth reached 169, errors: 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mtype = { Ready, NotReady, Commit, Abort } | |
chan from_arbiter[4] = [1] of { mtype }; | |
chan from_worker[4] = [1] of { mtype }; | |
active proctype Arbiter() { | |
assert (_pid == 0); | |
mtype v1, v2, v3; | |
from_arbiter[1]!Ready; | |
from_arbiter[2]!Ready; | |
from_arbiter[3]!Ready; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'rake/clean' | |
CC = "clang" | |
CLEAN.include(FileList["pan{,.*}"]) | |
CLEAN.include(FileList["*.pml.trail"]) | |
CLOBBER.include(FileList["*.pml"].map { |fn| fn.gsub(/.pml$/, '') }) | |
rule /^[^.]+$/ => '.pml' do |t| | |
sh "spin -a #{t.prerequisites.join(' ')}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
noHandle = false | |
focusHandler = (e)-> | |
if e.target.isContentEditable | |
noHandle = true | |
else | |
nohandle = false | |
keypressHandler = (e)-> | |
return if noHandle |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<h1>Editing {{.Title}}</h1> | |
<form action="/save/{{.Title}}" method="POST"> | |
<div><textarea name="body" rows="20" cols="80">{{printf "%s" .Body}}</textarea></div> | |
<div><input type="submit" value="Save"></div> | |
</form> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"fmt" | |
"os/exec" | |
"regexp" | |
"strconv" | |
"strings" | |
"time" | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'net/ssh' | |
require 'tmpdir' | |
require 'socket' | |
path = Dir::Tmpname::create('forwarded_socket') { |path| path } | |
UNIXServer.open(path) do |server| | |
at_exit do | |
File.unlink(path) | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
require 'net/ssh' | |
Net::SSH.start(HOSTNAME, USERNAME) do |ssh| | |
ssh.open_channel do |channel| | |
channel.exec('ruby') do |ch, success| | |
abort 'cannot execute ruby' unless success | |
ch.on_data do |c, data| | |
$stdout.puts("received #{data}") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
from __future__ import division, absolute_import, print_function, unicode_literals | |
import sys | |
def tracer(frame, event, arg): | |
print("source: {}\tlineno: {}".format(frame.f_code.co_filename, frame.f_lineno)) | |
with open(frame.f_code.co_filename, 'r') as f: | |
print(f.readlines()[frame.f_lineno-1][0:-1]) | |
return tracer |