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
dir=/data | |
continue=true | |
input-file=/conf/aria2.session | |
save-session=/conf/aria2.session | |
save-session-interval=60 | |
force-save=true | |
enable-mmap=true | |
disk-cache=512M | |
file-allocation=falloc |
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 | |
# see: https://gist.github.com/todgru/6224848 | |
session="one1" | |
tmux start-server | |
tmux new-session -d -s $session | |
tmux send-keys C-m # ignore errors. see:https://github.com/tmux/tmux/issues/1173#issuecomment-347496 |
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 <time.h> | |
static long currentTimeInNs() { | |
struct timespec res; | |
clock_gettime(CLOCK_MONOTONIC, &res); | |
return (res.tv_sec * 1e9) + res.tv_nsec; | |
} | |
static long currentTimeInMs(void) { | |
struct timespec res; |
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
public class WaveHelper { | |
private File mFile; | |
private int mSample; | |
private int mChannel; | |
private int mSampleBits; | |
private LittleEndianDataOutputStream mDos; | |
public WaveHelper(File file, int channel, int sample, int encoding) { | |
mFile = file; | |
mSample = sample; |
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 <chrono> | |
typedef std::chrono::high_resolution_clock Time; | |
typedef std::chrono::milliseconds ms; | |
typedef std::chrono::nanoseconds ns; | |
auto start = Time::now(); | |
ns d1 = std::chrono::duration_cast<ns>(Time::now() - start); | |
ms d2 = std::chrono::duration_cast<ms>(Time::now() - start); |
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
public class FpsMonitor { | |
private static final int SAMPLE_COUNT = 10; | |
private ArrayBlockingQueue<Long> mQueue; | |
private long mLastUpdateTime; | |
public FpsMonitor() { | |
mQueue = new ArrayBlockingQueue<>(SAMPLE_COUNT); | |
mLastUpdateTime = System.currentTimeMillis(); | |
} |
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
亚洲 中国 辽宁 丹东 1 | |
亚洲 中国 辽宁 丹东新港 2 | |
亚洲 中国 辽宁 石山子 3 | |
亚洲 中国 辽宁 大鹿岛 4 | |
亚洲 中国 辽宁 小长山岛 5 | |
亚洲 中国 辽宁 大窑湾(南大圈) 6 | |
亚洲 中国 辽宁 大连(老虎滩) 7 | |
亚洲 中国 辽宁 旅顺新港 8 | |
亚洲 中国 辽宁 金县 9 | |
亚洲 中国 辽宁 葫芦岛 10 |
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
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
import os | |
import sys | |
if 2 != len(sys.argv): | |
print 'bad argument' | |
exit(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
Installing collected packages: requests | |
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
import re | |
import requests | |
from datetime import datetime |
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
""" | |
This program is free software: you can redistribute it and/or modify | |
it under the terms of the GNU General Public License as published by | |
the Free Software Foundation, either version 3 of the License, or | |
(at your option) any later version. | |
This program is distributed in the hope that it will be useful, | |
but WITHOUT ANY WARRANTY; without even the implied warranty of | |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
GNU General Public License for more details. |
NewerOlder