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 ( | |
| "encoding/asn1" | |
| "fmt" | |
| "os" | |
| ) | |
| func main_ASN_1() { | |
| mdata, err := asn1.Marshal(13) |
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" | |
| "time" | |
| ) | |
| func main_DaytimeServer() { | |
| service := ":1200" | |
| tcpAddr, err := net.ResolveTCPAddr("tcp4", service) |
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
| <?xml version="1.0" encoding="UTF-8"?> | |
| <module type="GO_MODULE" version="4"> | |
| <component name="NewModuleRootManager" inherit-compiler-output="true"> | |
| <exclude-output /> | |
| <content url="file://$MODULE_DIR$" /> | |
| <orderEntry type="jdk" jdkName="Go 1.6.2" jdkType="Go SDK" /> | |
| <orderEntry type="sourceFolder" forTests="false" /> | |
| <orderEntry type="library" name="GOPATH <Application-Level Protocols>" level="project" /> | |
| </component> | |
| </module> |
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 ( | |
| "github.com/crypto/blowfish" | |
| "fmt" | |
| "bytes" | |
| ) | |
| func main_Blowfish() { | |
| key := []byte("my key") |
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, combineReducers, compose, applyMiddleware } from 'redux'; | |
| import ReduxThunk from 'redux-thunk'; | |
| import { routerMiddleware } from 'react-router-redux'; | |
| import { hashHistory } from 'react-router'; | |
| import * as Reducers from '../reducers'; | |
| export default function configureStore(initialState) { | |
| const store = createStore( | |
| combineReducers(Reducers), | |
| initialState, |
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
| (define (empty-stack) | |
| (lambda (action) | |
| (cond ((eq? action 'top) | |
| (repo-empty-stack-err)) | |
| ((eq? action 'empty) | |
| #t) | |
| ((eq? action 'pop) | |
| (repo-empty-stack-err)) | |
| (else (repo-no-support-err))))) | |
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
| # Requires Python 2.x, flask and pywin32 | |
| from flask import Flask | |
| import flask | |
| import win32com.client | |
| import pythoncom | |
| import os, os.path, sys, time | |
| # Flask (Web Server) | |
| ws = Flask(__name__) |
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
| // Trace trace | |
| func Trace(name string, param ...interface{}) func() { | |
| if !TraceSwitch { | |
| return func() {} | |
| } | |
| start := time.Now() | |
| log.Println("####Enter", name, param) | |
| return func() { |
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
| args := BussinessRPC.ProcessMsg{ | |
| UserId: cor.userId, | |
| Message: message, | |
| TimeStamp: time.Now().Format("2006-01-02 15:04:05.000"), | |
| } | |
| reply := &BussinessRPC.ProcessMsgReply{} | |
| service := "FreeStyleGame.Process" | |
| conn, err := rpc.Dial("tcp", address) |
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/rpc" | |
| "log" | |
| "fmt" | |
| ) | |
| func failOnErr(err error, s string) { | |
| if err != nil { |