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
#!/bin/sh | |
function find_gateway(){ | |
gateway=$(netstat -nr | grep "default" | awk "{print \$2}") | |
if [[ "$(grep "163.13." <<< $gateway)" == "" ]]; then | |
echo "Gateway $gateway is not a valid TKU IP!" | |
exit 1 | |
fi | |
} |
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
line 1705: unknown code state: 0x7fff5fbfdf90 | |
line 1708: unknown code state: /Users/SkyArrow/Dropbox/Projects/Hexo/hexo/node_modules/lodash/dist/lodash.js:10 | |
line 1710: unknown code state: 0x100649000 | |
line 1722: unknown code state: 0x7fff5fbfd3b0 | |
line 3090: unknown code state: 0x7fff5fbf7348 | |
Statistical profiling result from v8.log, (1634265 ticks, 222436 unaccounted, 0 excluded). | |
[Unknown]: | |
ticks total nonlib name | |
222436 13.6% |
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 Test { | |
public static void main(String[] args){ | |
System.out.println("======= myGetChars ======="); | |
String str = "test"; | |
char[] arr1 = new char[4]; | |
myGetChars(str, 0, 4, arr1, 0); | |
System.out.printf("copy %s => %s\n", str, new String(arr1)); | |
char[] arr2 = new char[2]; |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<title>留言板</title> | |
</head> | |
<body> | |
<% messages.forEach(function(line, i){ %> | |
<p> | |
<strong><%= line.author %></strong>: <%= line.content %> |
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 exp.*; | |
import flowd.*; | |
class P99 extends FunNode { | |
P99(){ | |
super("P99"); | |
Var i = addVar("i"); | |
Var j = addVar("j"); | |
addBeginNode("L0"); |
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
var input = ''; | |
process.stdin.resume(); | |
process.stdin.setEncoding('utf8'); | |
process.stdin.on('data', function(chunk) { | |
input += chunk; | |
}); | |
process.stdin.on('end', function() { |
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
'use strict'; | |
var highlight = require('highlight.js'); | |
var Highlights = require('highlights'); | |
var highlighter = new Highlights(); | |
var util = require('../lib'); | |
var fs = require('fs'); | |
var pathFn = require('path'); | |
var fixture = fs.readFileSync(pathFn.join(__dirname, 'fixtures', 'q3.js'), 'utf8'); |
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
var sort = function(arr, left, right){ | |
if (right <= left) return; | |
// 取中間值作為 pivot | |
var pivotIndex = parseInt((left + right) / 2), | |
pivot = arr[pivotIndex]; | |
// pivot 移至最右方 | |
swap(arr, pivotIndex, right); |
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
var flatten = function(arr){ | |
for (var i = 0, len = arr.length; i < len; i++){ | |
var item = arr[i]; | |
if (Array.isArray(item)){ | |
len += item.length - 1; | |
[].splice.apply(arr, [i, 1].concat(item)); | |
i--; | |
} | |
} | |
return arr; |
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
var unique = function(arr){ | |
var a = [], | |
l = arr.length; | |
for (var i = 0; i < l; i++){ | |
for (var j = i + 1; j < l; j++){ | |
if (arr[i] === arr[j]) j = ++i; | |
} | |
a.push(arr[i]); | |
} | |
return a; |
OlderNewer