两个软硬程度一样但未知的鸡蛋,它们有可能都在一楼就摔碎,也可能从一百层楼摔下来没事。有座100层的建筑,要你用这两个鸡蛋通过最少的次数确定哪一层是鸡蛋可以安全落下的最高位置。可以摔碎两个鸡蛋
看到这个题目,最保险的方法就是一层一层试验,但这样只需要一个鸡蛋就可以了。我们现在有两个鸡蛋,完全可以用有更快的方法。
git config --global https.proxy http://127.0.0.1:1080 | |
git config --global https.proxy https://127.0.0.1:1080 | |
git config --global --unset http.proxy | |
git config --global --unset https.proxy | |
npm config delete proxy |
// https://www.zhihu.com/question/33084689/answer/58994758 | |
#include <stdio.h> | |
#include <string.h> | |
typedef struct inst | |
{ | |
unsigned char code; // 指令 | |
unsigned char cond; // 执行该指令的条件 | |
short p1, p2; // 参数1、2 |
brew install tmux
Run tmux -CC
or tmux -CC attach
in iTerm2 and then menu is shown on terminal:
#!/usr/bin/ruby | |
require 'json' | |
require 'emr/common' | |
require 'digest' | |
require 'socket' | |
def run(cmd) | |
if ! system(cmd) then | |
raise "Command failed: #{cmd}" |
zstyle ':completion:*' matcher-list '' 'm:{a-z}={A-Z}' '+m:{A-Z}={a-z}' |
This is just an exercise to measure the performance between Sinatra-like libraries in:
Elixir v0.4.dev (running on top of the Erlang VM R14B03) with Dynamo;
Ruby 1.9.2 with [Sinatra Synchrony] v0.0.3 (https://github.com/kyledrake/sinatra-synchrony) + Thin;
node.js 0.4.7 with [express] v2.3.10(https://github.com/visionmedia/express)
import argparse | |
import os | |
import sys | |
from typing import Iterable | |
import tensorflow as tf | |
parser = argparse.ArgumentParser() | |
parser.add_argument('file', type=str, help='The file name of the frozen graph.') | |
args = parser.parse_args() |
# If you come from bash you might have to change your $PATH. | |
# export PATH=$HOME/bin:/usr/local/bin:$PATH | |
# Path to your oh-my-zsh installation. | |
export ZSH=/home/wo/.oh-my-zsh | |
# Set name of the theme to load. Optionally, if you set this to "random" | |
# it'll load a random theme each time that oh-my-zsh is loaded. | |
# See https://github.com/robbyrussell/oh-my-zsh/wiki/Themes | |
# 主题设置 |