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
| readline = require('readline') | |
| rl = readline.createInterface(process.stdin, process.stdout) | |
| prefix = 'OHAI> ' | |
| rl.on 'line', (line)-> | |
| switch line.trim() | |
| when 'hello' | |
| setTimeout (-> | |
| console.log 'world!' | |
| rl.prompt() |
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
| export OS_HOST=Linux | |
| export MKDIR=mkdir | |
| export COPY=cp | |
| export RM=rm | |
| export MAKE=gmake | |
| export MD=makedepend | |
| export TOUCH=touch | |
| export CPU_TOOL=arm | |
| export DRAGONITE_TYPE=A1 | |
| export CPU_FAMILY=CPU_ARM |
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
| envdiff() | |
| { | |
| nm=$1 | |
| if [ ! -f /tmp/pre_$nm.env ]; then | |
| env > /tmp/pre_$nm.env | |
| else | |
| env > /tmp/post_$nm.env | |
| diff -ur /tmp/pre_$nm.env /tmp/post_$nm.env >> /tmp/allenv.diff | |
| fi | |
| } |
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 os,sys | |
| import time | |
| f=open( sys.argv[1]) | |
| for line in f: | |
| line = line.strip(' \r\n') | |
| args=line.split('=') | |
| key = args[0] | |
| val= '='.join(args[1:]) | |
| if len(args)>1: | |
| sline = "setenv {0} '{1}'".format( key, val) |
RTT and ping interval
+--RTT -+------------------------- ping interval -----------------------+-----+
ping pong ping pong
recovery 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
| #External configurations from user | |
| system : | |
| sys : | |
| name : "IES-2307C" | |
| description : "V3.13 2012-03-01" | |
| location : "Taiwan Taipei" | |
| contact : "default" | |
| timezone_offset : 0 | |
| lldp : |
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
| # 只會被執行一次, 而不是每次new 都執行 | |
| myvar_init = -> | |
| console.log 'got myvar_init' | |
| 3 | |
| # class 不是典型的declare , class內所有的member 都佔有實體, class member 真正在做的是設定初始值, 而非type | |
| class Packet | |
| debugFlags : false | |
| stpMac: new Buffer [ 0x01, 0x80, 0xc2, 0x00, 0x00, 0x00 ] |
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
| class Parameter | |
| _instance=null | |
| someparam: 'bingo' | |
| constructor: ()-> | |
| console.log 'Parameter got constructed' | |
| showparam: -> | |
| console.log 'someparam is ', @someparam | |
| setparam: (s)-> | |
| @someparam = s | |
| @get: -> |
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
| class myclass | |
| local_var=[] | |
| local_func = -> | |
| local_var+=1 | |
| local_func_wrong = -> | |
| @myclass.class_var++ # wrong! no way to access class var | |
| @inst_var++ # wrong! no way to access instance var | |