Skip to content

Instantly share code, notes, and snippets.

View qiaohaijun's full-sized avatar
🎯
Focusing

qiao hai-jun qiaohaijun

🎯
Focusing
  • Beijing,China
View GitHub Profile
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
@sing1ee
sing1ee / gist:5971946
Last active March 27, 2024 06:37
Google面试题:扔鸡蛋问题

Google面试题:扔鸡蛋问题

原题描述

两个软硬程度一样但未知的鸡蛋,它们有可能都在一楼就摔碎,也可能从一百层楼摔下来没事。有座100层的建筑,要你用这两个鸡蛋通过最少的次数确定哪一层是鸡蛋可以安全落下的最高位置。可以摔碎两个鸡蛋

方法分析

看到这个题目,最保险的方法就是一层一层试验,但这样只需要一个鸡蛋就可以了。我们现在有两个鸡蛋,完全可以用有更快的方法。

// 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
@Mistobaan
Mistobaan / TENSORFLOW_DEBUG.md
Last active June 29, 2023 06:32
Tensorflow Internals Debugging Techniques

Machine Setup August 2016

Linux Ubuntu 2016.

  • 1080 GTX
  • SDK 8.0
  • CuDNN 5.1

ENABLE Core dumps

ulimit -c unlimited
@royling
royling / tmux-iterm2.md
Last active April 24, 2023 19:35
tmux in iTerm2 cheatsheet
@marcusking01
marcusking01 / install-spark-shark-1.1.0.rb
Last active December 6, 2022 21:38
Ruby script for EMR clusters using hadoop 2.4 to bootstrap Spark 1.1.0
#!/usr/bin/ruby
require 'json'
require 'emr/common'
require 'digest'
require 'socket'
def run(cmd)
if ! system(cmd) then
raise "Command failed: #{cmd}"
@yohm
yohm / zsh_ignore_case
Created April 29, 2011 03:47
ignore case completion for zsh
zstyle ':completion:*' matcher-list '' 'm:{a-z}={A-Z}' '+m:{A-Z}={a-z}'
@josevalim
josevalim / 0_README.markdown
Created January 9, 2012 13:07
Hello world of Sinatra-like libraries on Elixir, Ruby and Node.js
@sunsided
sunsided / dump_operations.py
Last active October 27, 2021 21:26
Listing operations in frozen .pb TensorFlow graphs in GraphDef format (see comments for SavedModel)
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()
@inkydragon
inkydragon / .zshrc
Created August 7, 2017 11:57
zsh的配置文件
# 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
# 主题设置