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 ( | |
| "fmt" | |
| "github.com/fsnotify/fsnotify" | |
| "os" | |
| "path/filepath" | |
| "sync" | |
| ) |
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 ( | |
| "bytes" | |
| "encoding/json" | |
| "fmt" | |
| "net" | |
| "sync" | |
| "sync/atomic" | |
| "time" |
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
| import {Component, e, div, img, span, | |
| } from './base' | |
| import {image_url} from './utils' | |
| import {screen_width, screen_height} from './style' | |
| import {purple} from './style' | |
| export class IndexSection extends Component { | |
| render(state) { | |
| let width = Math.round((screen_width - 35) / 2); | |
| let height = Math.round(width / 2); |
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
| import {createStore} from 'redux' | |
| let initState = { | |
| show_dialog: false, | |
| } | |
| let store = createStore(function(state, action) { | |
| if (action.fn) { | |
| return action.fn(state, ...action.args); | |
| } |
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
| ~> ccg -f github.com/reusee/cowmap -t Key=string,Value=string -r Map=StrStrMap,New=NewStrStrMap | |
| import "sync" | |
| type StrStrMap struct { | |
| v atomic.Value | |
| l sync.Mutex | |
| } | |
| func NewStrStrMap(m map[string]string) *StrStrMap { | |
| ret := new(StrStrMap) |
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
| def ispower(a,b): #a==b^i ? | |
| while a>1: | |
| if a%b==0:a/=b | |
| else:return False | |
| return True | |
| def beal(max_base, max_power): | |
| bases, powers, table, pow = initial_data(max_base, max_power) | |
| for x in bases: | |
| flag2=flag3=False # for 2^m+3^n=z^r x=2^i or x=3^i ? |
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
| src = '''\ | |
| Chapter 1 | |
| foo | |
| - figure 1.1 | |
| bar | |
| Section 1.1 | |
| - figure 1.2 | |
| - figure 1.3 | |
| baz | |
| Section 1.2 |
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 | |
| /* | |
| #cgo LDFLAGS: -lavformat -lavutil -lavcodec | |
| #include <libavformat/avformat.h> | |
| #include <libavutil/avutil.h> | |
| */ | |
| import "C" | |
| import ( | |
| "fmt" |
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 ( | |
| "fmt" | |
| "reflect" | |
| "strings" | |
| ) | |
| func main() { | |
| l := []string{"foo", "bar", "baz"} |
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 utils | |
| import ( | |
| "log" | |
| "reflect" | |
| ) | |
| func NewChan(in, out interface{}) { | |
| inValue := reflect.ValueOf(in) | |
| outValue := reflect.ValueOf(out) |