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 FindProxyForURL = function(init, profiles) { | |
return function(url, host) { | |
"use strict"; | |
var result = init, scheme = url.substr(0, url.indexOf(":")); | |
do { | |
result = profiles[result]; | |
if (typeof result === "function") result = result(url, host, scheme); | |
} while (typeof result !== "string" || result.charCodeAt(0) === 43); | |
return result; | |
}; |
We can make this file beautiful and searchable if this error is corrected: It looks like row 9 should actually have 16 columns, instead of 7 in line 8.
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
日期,股票代码,名称,收盘价,最高价,最低价,开盘价,前收盘,涨跌额,涨跌幅,换手率,成交量,成交金额,总市值,流通市值,成交笔数 | |
2017-04-14,'600999,招商证券,16.4,16.51,16.27,16.43,16.46,-0.06,-0.3645,0.1796,8467761,138598406.0,1.09870312996e+11,77309148163.6,None | |
2017-04-13,'600999,招商证券,16.46,16.57,16.41,16.5,16.57,-0.11,-0.6639,0.1381,6509609,107319930.0,1.10272277555e+11,77591986510.5,None | |
2017-04-12,'600999,招商证券,16.57,16.67,16.33,16.47,16.45,0.12,0.7295,0.3299,15549171,257597456.0,1.11009212582e+11,78110523479.9,None | |
2017-04-11,'600999,招商证券,16.45,16.48,16.24,16.38,16.48,-0.03,-0.182,0.227,10701208,175120304.0,1.10205283462e+11,77544846786.1,None | |
2017-04-10,'600999,招商证券,16.48,16.54,16.42,16.47,16.47,0.01,0.0607,0.2503,11798833,194561548.0,1.10406265742e+11,77686265959.5,None | |
2017-04-07,'600999,招商证券,16.47,16.51,16.39,16.5,16.48,-0.01,-0.0607,0.2817,13278837,218419739.0,1.10339271649e+11,77639126235.0,None | |
2017-04-06,'600999,招商证券,16.48,16.52,16.4,16.5,16.47,0.01,0.0607,0.1868,8803868,144904233.0,1.10406265742e+11,77686265959.5,None | |
2017-04-05,'600999,招商证券,16.47,16.56,16.26,1 |
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 lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<meta http-equiv="X-UA-Compatible" content="ie=edge"> | |
<title>CSV 双引号转化</title> | |
<style> | |
.drop-area { |
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
Array.prototype.map.call( | |
document.querySelectorAll("td.bill_balance span.info_value span.currency_rmb"), | |
(e,i)=>+e.innerText.replace("¥ ", "").replace(" (人民币)", "").replace(",", "") | |
).reduce((prev,curr)=>prev+curr,0) |
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
#include <WinSock2.h> | |
#include <event.h> | |
#include <event2/listener.h> | |
#include <event2/util.h> | |
#include <iostream> | |
#include <thread> | |
#pragma comment(lib, "libevent.lib") | |
#pragma comment(lib, "libevent_core.lib") | |
#pragma comment(lib, "libevent_extras.lib") |
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
#ifndef __BENCHMARK_HPP_BY_GZSHI__ | |
#define __BENCHMARK_HPP_BY_GZSHI__ | |
#include <functional> | |
#include <chrono> | |
template<typename TClock, typename TFn, typename ...TArgs> | |
TClock benchmark(TFn&& fn, TArgs&&... args) { | |
auto exec = std::bind(std::forward<TFn>(fn), std::forward<TArgs>(args)...); | |
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'; | |
// promise lock | |
// const PromiseLock = (() => { | |
// function PromiseLock(concurrency) { | |
// this.queue = []; | |
// this.lock = 0; | |
// this.concurrency = Math.max(concurrency, 1); | |
// } |
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 () { | |
if (location.host !== 'shop.48.cn') { | |
console.error('kidding me?'); | |
return ; | |
} | |
if (typeof jQuery !== 'function') { | |
console.error('缺少基础库'); | |
return ; | |
} |
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 () { | |
if (location.host !== 'shop.48.cn') { | |
console.error('kidding me?'); | |
return ; | |
} | |
if (typeof jQuery !== 'function') { | |
console.error('缺少基础库'); | |
return ; | |
} |
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'; | |
const net = require('net'); | |
const local = '0.0.0.0'; | |
const port = 1081; | |
var connSeq = 0; | |
const server = net.createServer((client) => { | |
var seq = connSeq++; | |
var uid = 1; |