#include<iostream>
#include<stdio.h>
using namespace std;
int main(){
if(freopen("bus.in","r",stdin)==NULL)
printf("error while opening input file.\n");
if(freopen("bus.out","w",stdout)==NULL)
printf("error while opening output file.\n");
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 java.util.Stack; | |
/** | |
* 递归求解汉诺塔 | |
*/ | |
public class HanoiTower { | |
// 三个塔 a、b、c | |
Stack<Integer> a,b,c; | |
public static void main(String[] 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
String dataFile = "data/NWP_NMC_T639R/Z_NAFP_C_BABJ_20161108000000_P_CNPC-T639-GMFS-HNEHE-00000.grib2"; | |
try { | |
// open netcdf/grib/grib2 file from argument | |
NetcdfDataset gid = NetcdfDataset.openDataset(dataFile); | |
// get all grid tables in the file | |
List<Variable> variables = gid.getReferencedFile().getVariables(); | |
for (int i = 0; i < variables.size(); i++) { | |
Variable var = variables.get(i); | |
if ((!var.isMetadata()) && (!var.getRanges().isEmpty())) { | |
System.out.format("%s, %s: %s %s\n", var.getName(), var.getDataType().toString(),var.getRanges().toString(),var.getUnitsString()); |
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
编辑/etc/default/grub文件: | |
GRUB_CMDLINE_LINUX参数加上ipv6.disable=1 | |
以root运行命令: | |
grub2-mkconfig -o /boot/grub2/grub.cfg | |
编辑/etc/ssh/sshd_config 文件,增加一行: | |
AddressFamily inet |
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.升级Linux内核达到4.9以上 | |
2.验证BBR是否已经可用。 | |
A. 验证当前TCP控制算法的命令: | |
sysctl net.ipv4.tcp_available_congestion_control | |
返回值一般为: | |
net.ipv4.tcp_available_congestion_control = bbr cubic reno | |
或者为: | |
net.ipv4.tcp_available_congestion_control = reno cubic bbr | |
B. 验证BBR是否已经启动。 | |
sysctl net.ipv4.tcp_congestion_control |
rpm --import https://www.elrepo.org/RPM-GPG-KEY-elrepo.org
rpm -Uvh https://www.elrepo.org/elrepo-release-7.0-4.el7.elrepo.noarch.rpm
yum --disablerepo="*" --enablerepo="elrepo-kernel" list available
yum --enablerepo=elrepo-kernel install -y kernel-ml
# 若出错,则运行以下命令
#grub2-mkconfig -o /boot/grub2/grub-efi.cfg
awk -F\' '$1=="menuentry " {print i++ " : " $2}' /etc/grub2.cfg
set $req_header "";
set $resp_header "";
header_filter_by_lua_block{
local h = ngx.req.get_headers();
for k, v in pairs(h) do
ngx.var.req_header = ngx.var.req_header .. k.."="..v.." ";
分布式ping: http://ping.pe/
移动光猫:CMCCAdmin/aDm8H%MdA 改为桥接模式:https://www.sciencesoft.cn/china-mobile-routing-to-bridge-mode/
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
## Cannot git-clone from github | |
```bash | |
git clone https://github.com/kaichao/app-mwa.git | |
Cloning into 'app-mwa'... | |
fatal: unable to access 'https://github.com/kaichao/app-mwa.git/': GnuTLS recv error (-110): The TLS connection was non-properly terminated. | |
``` |