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
-- @author: yangfch3 | |
-- @date: 2020/09/27 15:20 | |
------------------------------------------ | |
-- Node 基类 | |
local DTNode = BaseClass("DTNode") | |
function DTNode:ctor() end | |
function DTNode:Eval(decisionTree, context) end | |
function DTNode:SetChildren() | |
assert(false) |
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
--[[ | |
A simple HTTP server | |
If a request is not a HEAD method, then reply with "Hello world!" | |
Usage: lua examples/server_hello.lua [<port>] | |
]] | |
local MyLog = require "AIServer/MyLog" | |
local http_server = require "http.server" | |
local http_headers = require "http.headers" | |
local json = require "3rds/json" |
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
from argparse import Namespace | |
import traceback | |
import json | |
import urllib | |
import simp_http_serv_helper as helper | |
from http.server import HTTPServer, BaseHTTPRequestHandler | |
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
import json | |
import os | |
import sys | |
import time | |
import base64 | |
from subprocess import DEVNULL, STDOUT, Popen, PIPE | |
import merge_data | |
conf_file = "run.conf.json" |
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
function BaseClass(classname, super) | |
local cls | |
if super then | |
cls = {} | |
setmetatable(cls, {__index = super}) | |
cls.super = super | |
else | |
cls = {ctor = function() end} | |
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
local MathUtil = {} | |
---获取两点的距离 | |
function MathUtil.GetDis(vec1, vec2) | |
local x1 = vec1.x or vec1[1] | |
local y1 = vec1.y or vec1[2] | |
local x2 = vec2.x or vec2[1] | |
local y2 = vec2.y or vec2[2] | |
local disX = x1 - x2 |
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
module.exports = { | |
env: { | |
browser: true, | |
commonjs: true, | |
es6: true, | |
node: true, | |
}, | |
extends: ['eslint:recommended'], | |
globals: { | |
Atomics: 'readonly', |
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
class Layer extends egret.Sprite { | |
private mountTo: egret.DisplayObjectContainer | |
constructor(mountTo: LayersDisplayObjectContainer) { | |
super() | |
// Layer 挂载到的 UI | |
this.mountTo = mountTo | |
} | |
} |
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
// 对一个对象的方法做缓存 | |
function Memoize(func, obj) { | |
obj = obj || window | |
func = obj[func] | |
let cache = {} | |
return function () { | |
let key = Array.prototype.join.call(arguments, '_') | |
if (!(key in cache)) { | |
// console.log('缓存未命中') | |
cache[key] = func.apply(obj, arguments) |
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
############################################################################## | |
# BASH CHEATSHEET (中文速查表) - by skywind (created on 2018/02/14) | |
# Version: 43, Last Modified: 2018/04/02 17:00 | |
# https://github.com/skywind3000/awesome-cheatsheets | |
############################################################################## | |
############################################################################## | |
# 常用快捷键(默认使用 Emacs 键位) | |
############################################################################## |
NewerOlder