This file contains hidden or 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 "net" | |
import "fmt" | |
func main(){ | |
addr,err := net.ResolveTCPAddr("127.0.0.1:6000"); | |
if addr == nil { | |
fmt.Printf("resovle addr: %s\n", err.String()); | |
} | |
listener,err := net.ListenTCP("tcp",addr); |
This file contains hidden or 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
func Launch(vbox *VBoxSpec, statusch chan<- *VmStatus, quitch <-chan bool) { | |
go func() { | |
vboxPath := main.Config["VboxPath"] | |
vboxHeadlessBin := fmt.Sprintf("%s/VBoxHeadless", vboxPath) | |
statusch <- VmStatus{vbox, VMSTATUS_LAUNCHING} | |
var stdoutFilePtr *File | |
This file contains hidden or 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
{ | |
process := make(chan *feat.Feature) | |
buffer := make(chan *feat.Feature, 1000) | |
wg := new(sync.WaitGroup) | |
if *cores < 2 { | |
*cores = 2 | |
} | |
for i := 0; i < *cores-1; i++ { | |
go func(){wg.Add(1); processServer(intervalTree, process, buffer); wg.Done()} | |
} |
This file contains hidden or 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 ( | |
"gogobservice" | |
"net/rpc" | |
"net" | |
"log" | |
) | |
func main() { |
This file contains hidden or 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 "net/http" | |
import "net" | |
import "sync" | |
var lis net.Listener | |
func main(){ | |
var err error | |
// make our own listener |
This file contains hidden or 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
int main(){ | |
write(1, "hello world\n", 12); | |
} | |
/* | |
[jessta@book ~]$ gcc -static -Os hello.c | |
[jessta@book ~]$ du -h ./a.out | |
636K ./a.out | |
*/ |
This file contains hidden or 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
// This is a manifest file that'll be compiled into application.js, which will include all the files | |
// listed below. | |
// | |
// Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts, | |
// or vendor/assets/javascripts of plugins, if any, can be referenced here using a relative path. | |
// | |
// It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the | |
// compiled file. | |
// | |
// Read Sprockets README (https://github.com/sstephenson/sprockets#sprockets-directives) for details |
This file contains hidden or 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
module Main exposing (..) | |
import Animation exposing (px) | |
import Html exposing (Html, div, text) | |
import Html.App as App | |
import Html.Attributes exposing (style) | |
main = | |
App.program |
This file contains hidden or 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
module Main exposing (Model, Msg(..), about, home, main, routes, update, view) | |
import Browser | |
import Browser.Navigation as Nav | |
import Html exposing (..) | |
import Html.Attributes exposing (..) | |
import Url | |
import Dict | |
This file contains hidden or 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
#!/usr/bin/env python | |
import os | |
import sys | |
import urllib | |
import http.server | |
class Handler(http.server.SimpleHTTPRequestHandler): | |
def do_GET(self): | |
urlparts = urllib.parse.urlparse(self.path) |