Skip to content

Instantly share code, notes, and snippets.

@y-abe
y-abe / job_queue_with_priority.go
Last active September 11, 2015 15:41
優先度付きジョブキュー
package main
import (
"fmt"
"sync"
"time"
"code.google.com/p/go-uuid/uuid"
)
@y-abe
y-abe / dial.go
Created September 10, 2015 07:23
package main
import (
"log"
"golang.org/x/net/websocket"
)
func main() {
ws, err := websocket.Dial(
package main
import "github.com/labstack/echo"
func handler(c *echo.Context) error {
c.Response().Write([]byte("hello"))
return nil
}
func main() {
package main
import (
"time"
"github.com/google/gxui"
"github.com/google/gxui/drivers/gl"
"github.com/google/gxui/math"
"github.com/google/gxui/themes/dark"
)
package main
import (
"github.com/google/gxui"
"github.com/google/gxui/drivers/gl"
"github.com/google/gxui/math"
"github.com/google/gxui/themes/dark"
)
func SetCanvas(driver gxui.Driver, image gxui.Image, x0, y0, x1, y1 int) {
package main
import (
"time"
"github.com/google/gxui"
"github.com/google/gxui/drivers/gl"
"github.com/google/gxui/math"
"github.com/google/gxui/themes/dark"
)
import curses
import curses.textpad
def main():
stdscr = curses.initscr()
curses.noecho()
curses.cbreak()
stdscr.keypad(1)
@y-abe
y-abe / fit
Created January 13, 2015 06:08
import scipy.optimize
import numpy as np
def linearfunc(x, a, b):
return a*x + b
def main():
popt, pcov = scipy.optimize.curve_fit(
package main
import (
"fmt"
"math"
"math/rand"
)
type Unit struct {
Inputs []*Connection
package main
import (
"fmt"
"sort"
"strconv"
"strings"
)
type CodeInfo struct {