Secret Base

All the little bugs I have ever met

Basic usage of Hexo.

Quick Start

Create a new post

1
$ hexo new post "My New Post"

More info: Writing

Run server

1
$ hexo server

More info: Server

Read more »

Set up Chinese input method on ubuntu.

ibus

1
sudo apt install ibus-libpinyin

ibus-libpinyin is the modern one. ibus-pinyin is long deprecated.

How to set up v2ray server on Ubuntu.

https://github.com/v2fly/fhs-install-v2ray

v2fly

1
2
3
4
5
// 安裝執行檔和 .dat 資料檔
bash <(curl -L https://raw.githubusercontent.com/v2fly/fhs-install-v2ray/master/install-release.sh)

// 只更新 .dat 資料檔
bash <(curl -L https://raw.githubusercontent.com/v2fly/fhs-install-v2ray/master/install-dat-release.sh)

ufw

1
2
ufw allow http
ufw allow https

config

1
vi /usr/local/etc/v2ray/config.json

server

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
{
"inbounds": [
{
"port": 443,
"protocol": "vmess",
"settings": {
"clients": [
{
"id": "899cbb8a-fad2-45bd-8608-8483956d641b",
"level": 1,
"alterId": 0
}
]
},
"streamSettings": {
"network": "ws",
"security": "tls",
"tlsSettings": {
"certificates": [
{
"certificateFile": "/usr/local/etc/v2ray/songzy.cc.cer",
"keyFile": "/usr/local/etc/v2ray/songzy.cc.key"
}
]
}
}
}
],
"outbounds": [
{
"protocol": "freedom",
"settings": {}
},
{
"protocol": "blackhole",
"settings": {},
"tag": "blocked"
}
]
}

Note: remember to set the value inbounds.settings.clients.id correctly.

tls (acme.sh)

1
DOMAIN_NAME=songzy.cc

install

1
2
3
apt install socat
curl https://get.acme.sh | sh
source ~/.bashrc

register

1
acme.sh --register-account -m songzy_thu@163.com

issue & installcert

1
acme.sh --issue -d $DOMAIN_NAME --standalone -k ec-256 --debug
1
acme.sh --installcert -d $DOMAIN_NAME --fullchainpath /usr/local/etc/v2ray/$DOMAIN_NAME.cer --keypath /usr/local/etc/v2ray/$DOMAIN_NAME.key --ecc

renew

1
acme.sh --renew -d $DOMAIN_NAME --force --ecc --debug

vmess aead

1
env v2ray.vmess.aead.forced=false /usr/local/bin/v2ray run -config /usr/local/etc/v2ray/config.json

ip check

https://www.toolsdaquan.com/ipcheck/

Set up http/https proxy inside WSL.

https://learn.microsoft.com/en-us/windows/wsl/networking

Port

If the v2ray has the following setting:

1
2
本地:[socks:10808] | [http:10809]
局域网:[socks:10810] | [http:10811]

Then:

1
PROXY_PORT=10811

NAT

1
2
3
4
5
6
WINDOWS_HOST=`cat /etc/resolv.conf|grep nameserver|awk '{print $2}'`

export http_proxy=http://$WINDOWS_HOST:$PROXY_PORT
export https_proxy=http://$WINDOWS_HOST:$PROXY_PORT
export HTTP_PROXY=http://$WINDOWS_HOST:$PROXY_PORT
export HTTPS_PROXY=http://$WINDOWS_HOST:$PROXY_PORT

Mirrored

In C:\Users\songz\.wslconfig of Windows host:

1
2
3
4
5
6
[experimental]
autoMemoryReclaim=gradual # gradual | dropcache | disabled
networkingMode=mirrored
dnsTunneling=true
firewall=true
autoProxy=true

Then in WSL2:

1
2
3
4
5
6
WINDOWS_HOST=localhost

export http_proxy=http://$WINDOWS_HOST:$PROXY_PORT
export https_proxy=http://$WINDOWS_HOST:$PROXY_PORT
export HTTP_PROXY=http://$WINDOWS_HOST:$PROXY_PORT
export HTTPS_PROXY=http://$WINDOWS_HOST:$PROXY_PORT

How to install and use Code Server.

Motivation

This way, we can put our project codes in remote cloud machines, and access it from a browser in any other computers.

NOTE: Without the “browser” requirement, you can use vscode directly to access files in remote cloud machine from any computers.

Install

https://coder.com/docs/code-server/install#debian-ubuntu

1
2
export VERSION=4.92.2
curl -fOL https://github.com/coder/code-server/releases/download/v$VERSION/code-server_${VERSION}_amd64.deb
1
sudo dpkg -i code-server_${VERSION}_amd64.deb
1
2
sudo systemctl enable --now code-server@$USER
# Now visit http://127.0.0.1:8080. Your password is in ~/.config/code-server/config.yaml

SSH Port Forwarding

Remote Host

https://coder.com/docs/code-server/guide#port-forwarding-via-ssh

1
2
# Replaces "auth: password" with "auth: none" in the code-server config.
sed -i.bak 's/auth: password/auth: none/' ~/.config/code-server/config.yaml
1
sudo service code-server@$USER status

Local Client

1
2
set -x
ssh -N -L 8080:127.0.0.1:8080 songzy@maomaosenlin.cc

Then, you can visit http://localhost:8080 in your local machine to access the code server started in remote machine.

Extensions

Some extensions are not avaliable in the default extension market, you might need to install them manually. Let us use the “C/C++” extension as an example.

First, find the extension download link from the “Version History” tab of the vscode extension marketplace:
https://marketplace.visualstudio.com/items?itemName=ms-vscode.cpptools&ssr=false#version-history

Then, in your remote machine, use wget to download the extension:

1
wget https://marketplace.visualstudio.com/_apis/public/gallery/publishers/ms-vscode/vsextensions/cpptools/1.23.0/vspackage\?targetPlatform\=linux-x64

The file downloaded by wget (or curl) cannot be installed directly since it is in a gzip format. So we need to first rename it with suffix .gz and then gunzip it:

1
2
mv vspackage\?targetPlatform=linux-x64 ms-vscode.cpptools-1.10.3@linux-x64.vsix.gz
gunzip ms-vscode.cpptools-1.10.3@linux-x64.vsix.gz

Then, you can install the ms-vscode.cpptools-1.10.3@linux-x64.vsix either from commandline or search for the “Extensions: Install from VSIX” after typing “Shift-Command-P”.

Alternatives

  • vscode.dev: This is a lightweight vscode running in browser to manipulate local files.
  • GitHub Codespaces: This is not free, and has network connection issue (you know it) from time to time.

A collection of my personal laptop devices.

OMEN 9 Slim (2023)

  • CPU: Intel Core i9-13900HX
  • GPU: NVIDIA GeForce RTX 4060 8G
  • Memory: 16G
  • Storage: 1T SSD

MacBook Air M1 (2020)

  • Chip: M1
  • Memory: 16G
  • Storage: 1T SSD

ThinkPad T470 (2017)

  • CPU: Intel Core i5-7200U
  • GPU: NVIDIA GeForce 940MX 2GB
  • Memory: 16G
  • Storage: 128G SSD + 500G HDD

Basic usage of GitBook.

Install

https://github.com/nvm-sh/nvm

1
brew install nvm
1
2
3
4
nvm install 12
nvm use 12
npm install graceful-fs@4.2.0 -g
npm install gitbook-cli@2.1.2 -g

Run

1
gitbook init
1
gitbook serve

A collection of my personal cloudtop devices.

  • songzy.cc
    • US
    • DigitalOcean
    • NameCheap
  • songzy.xyz
    • Japan
    • Vultr
    • NameCheap
  • songzy.cool
    • Korean
    • Vultr
    • NameCheap
  • maomaosenlin.cc
    • China
    • Tencent Cloud
    • Tencent Cloud

Basic knowledge about desktop environments.

GNOME

KDE

XFCE

Window Manager

X11/X.org => Wayland

Display Manager / Login Manager

  • GNOME <=> GDM
  • KDE <=> SDDM
  • XFCE <=> LightDM

Basic usage of zsh.

https://github.com/ohmyzsh/ohmyzsh/wiki/Themes

To view all avaliable zsh themes:

1
ls $ZSH/themes/

To set zsh theme:

1
2
3
ZSH_THEME=random

ZSH_THEME_RANDOM_CANDIDATES=( "robbyrussell" "risto" "candy" )

To view the current selected random theme:

1
echo $RANDOM_THEME

To view the config of a specific zsh theme:

1
vi $ZSH/themes/robbyrussell.zsh-theme

大陆如何注册使用 ChatGPT,并将其升级到 Plus.

访问 https://chat.openai.com/:

  1. 首先需要翻墙,其次要用不那么著名的vps提供商。
    • 随机试了两个 vultr 的日本区和美区的ip都提示 blocked
    • 据说 bandwagon 也会 blocked
    • 解决法案:使用了 digitalocean 的美区机器成功访问

注册:

  1. 使用了 Gmail 邮箱
  2. 国外手机号收验证码
    • 据说 Google Voice 提供的虚拟手机号是不行的
    • 解决法案:使用了 sms activate 成功收到了验证码
      • 可以支付宝充值2美元
      • 使用了印度尼西亚区的号码

升级 Plus:

  1. 国内银行发行的 visa, AE 似乎都不行
    • 测试了中国银行的 visa 和招商银行的 AE 都提示 denied
  2. 解决方案:下载 ChatGPT 的 iOS App 使用 Apple Pay 充值
    • iOS 设备也需要翻墙,并在设置中修改所在地区为美国
    • 需要美区的 Apple ID
      • 下载 Shadowrocket 用于翻墙
      • 下载 ChatGPT
        • 要求 iOS 版本 >16.1:也就是 iPad Air 2 不行的意思
    • 美区 Apple ID 需要绑定美区 Paypal
    • 美区 Paypal 可以绑定国内银行发行的 visa,AE 卡

https://github.com/microsoft/vscode

Settings

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
{
"workbench.startupEditor": "readme",
"workbench.colorTheme": "Quiet Light",
"window.titleBarStyle": "custom",
"window.customTitleBarVisibility": "auto"
"window.commandCenter": true,
"editor.formatOnSave": true,
"editor.formatOnSaveMode": "modifications",
"editor.guides.bracketPairs": "active",
"diffEditor.ignoreTrimWhitespace": false,
"outline.showVariables": false,
"scm.defaultViewMode": "tree",
"git.autofetch": true,
"git.autoStash": true,
"terminal.integrated.defaultProfile.osx": "zsh",
"terminal.integrated.fontFamily": "MesloLGS NF",
"C_Cpp.clang_format_fallbackStyle": "{ BasedOnStyle: Google, IndentWidth: 4 }",
"[python]": {
"editor.defaultFormatter": "eeyore.yapf",
},
"yapf.args": [
"--style",
"{based_on_style: pep8, indent_width: 4}"
]
}
Read more »

Google Pixel Watch app will crash on Honor 20 Pro with HarmonyOS 2.0.0.

Read more »

Built-in envrionment variables on Windows.

https://en.wikipedia.org/wiki/Environment_variable#Windows

Variable Locale specific Windows XP (CMD) Windows Vista and later (CMD)
%ALLUSERSPROFILE% Yes C:\Documents and Settings\All Users C:\ProgramData
%APPDATA% Yes C:\Documents and Settings{username}\Application Data C:\Users{username}\AppData\Roaming
%CommonProgramFiles% Yes C:\Program Files\Common Files C:\Program Files\Common Files
%CommonProgramFiles(x86)% Yes C:\Program Files (x86)\Common Files (only in 64-bit version) C:\Program Files (x86)\Common Files (only in 64-bit version)
%CommonProgramW6432% Yes %CommonProgramW6432% (not supported, not replaced by any value) C:\Program Files\Common Files (only in 64-bit version)
%COMPUTERNAME% No {computername} {computername}
%ComSpec% No C:\Windows\System32\cmd.exe C:\Windows\System32\cmd.exe
%HOMEDRIVE% No C: C:
%HOMEPATH% Yes \Documents and Settings{username} \Users{username}
%LOCALAPPDATA% Yes %LOCALAPPDATA% (not supported, not replaced by any value) C:\Users{username}\AppData\Local
%LOGONSERVER% No \{domain_logon_server} \{domain_logon_server}
%PATH% Yes C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;{plus program paths} C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;{plus program paths}
%PATHEXT% No .COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.WSF;.WSH .com;.exe;.bat;.cmd;.vbs;.vbe;.js;.jse;.wsf;.wsh;.msc
%ProgramData% Yes %ProgramData% (not supported, not replaced by any value) %SystemDrive%\ProgramData
%ProgramFiles% Yes %SystemDrive%\Program Files %SystemDrive%\Program Files
%ProgramFiles(x86)% Yes %SystemDrive%\Program Files (x86) (only in 64-bit version) %SystemDrive%\Program Files (x86) (only in 64-bit version)
%ProgramW6432% Yes %ProgramW6432% (not supported, not replaced by any value) %SystemDrive%\Program Files (only in 64-bit version)
%PROMPT% No Code for current command prompt format, usually $P$G Code for current command prompt format, usually $P$G
%PSModulePath% %PSModulePath% (not supported, not replaced by any value) %SystemRoot%\system32\WindowsPowerShell\v1.0\Modules\
%PUBLIC% Yes %PUBLIC% (not supported, not replaced by any value) %SystemDrive%\Users\Public
%SystemDrive% No C: C:
%SystemRoot% No The Windows directory, usually C:\Windows, formerly C:\WINNT %SystemDrive%\Windows
%TEMP% and %TMP% Yes %SystemDrive%\Documents and Settings{username}\Local Settings\Temp %SystemRoot%\TEMP (for system environment variables %TMP% and %TEMP%), %USERPROFILE%\AppData\Local\Temp (for user environment variables %TMP% and %TEMP%)
%USERDOMAIN% No {userdomain} {userdomain}
%USERNAME% No {username} {username}
%USERPROFILE% Yes %SystemDrive%\Documents and Settings{username} %SystemDrive%\Users{username}
%windir% No %SystemDrive%\WINDOWS %SystemDrive%\Windows

WSL2 export and import.

1
2
3
4
5
6
7
8
9
10
PS C:\Users\songzy> wsl --list
Windows Subsystem for Linux Distributions:
Ubuntu-20.04 (Default)

PS C:\Users\songzy> wsl --export Ubuntu-20.04 D:/Ubuntu-20.04.tar

PS C:\Users\songzy> wsl --unregister Ubuntu-20.04
Unregistering...

PS C:\Users\songzy> wsl --import Ubuntu-20.04 D:/Ubuntu-20.04/ D:/Ubuntu-20.04.tar

Config Default User

Method 1:

1
2
3
4
5
Function WSL-SetDefaultUser ($distro, $user) { Get-ItemProperty Registry::HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Lxss\*\ DistributionName | Where-Object -Property DistributionName -eq $distro | Set-ItemProperty -Name DefaultUid -Value ((wsl -d $distro -u $user -e id -u) | Out-String); };

WSL-SetDefaultUser Ubuntu-20.04 songzy

Remove-Item Function:WSL-SetDefaultUser

Method 2:

1
ubuntu2004 config --default-user songzy

WSL2 vdisk management.

WSL 2 uses a Virtual Hard Disk (VHD) to store your Linux files. In WSL 2, a VHD is represented on your Windows hard drive as a .vhdx file.
The WSL 2 VHD uses the ext4 file system. This VHD automatically resizes to meet your storage needs and has an initial maximum size of 256GB.

ncdu

1
du -h --max-depth=1 . | sort -h

or

1
2
sudo apt install ncdu
ncdu

Then press ? for shortcuts.

“ncdu” stands for “NCurses Disk Usage”, where “NCurses” stands for “new curses”, where “curses” is a pun on the term “cursor optimization”, which is a library for TUI.

detail vdisk

1
2
wsl --shutdown
diskpart
1
DISKPART> select vdisk file="C:\Users\songzy\AppData\Local\Packages\CanonicalGroupLimited.Ubuntu20.04onWindows_79rhkp1fndgsc\LocalState\ext4.vhdx"

Windows use first 5 letters of our e-mail addresses as the name of our user account folders.

1
2
3
4
5
6
7
8
9
10
11
DISKPART> detail vdisk

Device type ID: 0 (Unknown)
Vendor ID: {00000000-0000-0000-0000-000000000000} (Unknown)
State: Added
Virtual size: 256 GB
Physical size: 141 GB
Filename: C:\Users\songz\AppData\Local\Packages\CanonicalGroupLimited.Ubuntu20.04onWindows_79rhkp1fndgsc\LocalState\ext4.vhdx
Is Child: No
Parent Filename:
Associated disk#: Not found.

compact vdisk

1
2
3
4
5
# DISKPART> attach vdisk readonly
DISKPART> compact vdisk
# DISKPART> detach vdisk

DISKPART> exit

expand vdisk

https://docs.microsoft.com/en-us/windows/wsl/vhd-size

1
2
3
DISKPART> expand vdisk maximum=<sizeInMegaBytes>

DISKPART> exit
1
wsl.exe -l -v
1
2
3
4
sudo mount -t devtmpfs none /dev
mount | grep ext4

sudo resize2fs /dev/sdb <sizeInMegabytes>M

Basic knowledge of dos batch.

%~dp0

  • %0: the batch file itself
  • %1-%9: command line arguments
  • d: the drive letter
  • p: the path of the parameter

cls

clean screen.

findstr

1
type *.md | findstr "<p>"

mode

Sets the number of lines and columns (characters/line) of the display.

1
mode con cols=100 lines=60

Basic usage of vim.

.vimrc

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
set ignorecase 
set hlsearch
set encoding=utf-8
set fileencodings=utf-8,ucs-bom,gb18030,gbk,gb2312,cp936
set termencoding=utf-8
set encoding=utf-8
set cursorline
set autoindent
set smartindent
set scrolloff=4
set showmatch
set number

set tabstop=4
set softtabstop=4
set shiftwidth=4
set expandtab
set fileformat=unix

colorscheme desert

set nocompatible " required
filetype off " required

" set the runtime path to include Vundle and initialize
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()

" alternatively, pass a path where Vundle should install plugins
"call vundle#begin('~/some/path/here')

" let Vundle manage Vundle, required
Plugin 'gmarik/Vundle.vim'

" Add all your plugins here (note older versions of Vundle used Bundle instead of Plugin)
Plugin 'Chiel92/vim-autoformat'
nnoremap <F6> :Autoformat<CR>
let g:autoformat_autoindent = 0
let g:autoformat_retab = 0
let g:autoformat_remove_trailing_spaces = 0


" All of your Plugins must be added before the following line
call vundle#end() " required
filetype plugin indent on " required
Read more »

Basic usage of apache2.

https://ubuntu.com/tutorials/install-and-configure-apache

Install

1
2
sudo apt update
sudo apt install apache2

Web Page

1
ls /var/www/html/index.html

Config

1
2
cd /etc/apache2/sites-available/
sudo cp 000-default.conf gci.conf

Start Server

1
2
sudo a2ensite gci.conf
service apache2 reload

Log

1
tail -f /var/log/apache2/error.log

A summary of what I have learnt in university.

  • 2013夏
    • 汇编
      • Bomb lab, Buf lab
      • MIPS (Microprocessor without Interlocked Pipeline Stages)
  • 2013秋(大二)
    • 程序设计与算法基础
      • 虚拟宠物
  • 2014春(大二)
    • 计算机组成与系统结构
      • Y86流水线处理器
  • 2014夏
    • 安卓
      • 计步器
  • 2014秋(大三)
    • 高等计算机图形学
      • 光线追踪
      • 网格简化
    • 机器学习
      • 广告 CTR 预测
    • 大数据算法与模型
      • Randomness Extractor
    • 编译原理
      • Decaf (Decaf is a Java-like object-oriented programming language)
  • 2015春(大三)
    • 操作系统
      • Nachos (Not Another Completely Heuristic Operating System)
      • Paxos
  • 2015夏
    • SRT
      • Topic Model
  • 2015秋(大四)
    • 软件工程
      • 安卓车载蓝牙
  • 2016秋(研一)
    • 分布式数据库系统
      • EtherLend
  • 2017春(研一)
    • 分布式系统导论
      • Raft
    • 计算几何
      • 平面最大空凸点集
    • 高级机器学习
      • 论文引用数预测
    • 计算机网络安全技术
      • Eternal Blue - Wanna Cry

Basic usage of diskpart on windows.

EFI

http://linuxbsdos.com/2015/09/05/how-to-delete-grub-files-from-a-boot-efi-partition-in-windows-10/

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
% These commands are used to identify and select the hard drive

diskpart

list disk

sel disk

% These commands are used to list the partitions, select the Boot EFI partition,
% then assign it a drive letter

list vol

sel vol 2

assign letter=D:

exit

% These commands are used to change into the Boot EFI folder and delete the GRUB folder

cd /d D:

ls

ls EFI

cd EFI

ls

rmdir /s ubuntu
1
2
3
4
5
diskpart
select disk 0
select partition 3
delete partition override
exit

Windows

Windows 查看磁盘分区格式

  1. 按下 Win+R 打开运行,输入 cmd,打开命令提示符;
  2. 输入 diskpart 按回车执行,切换到 DISKPART 命令,输入list disk,按回车;
  3. 查看最后一列的GPT,如果有*号则为GPT,如果没有则为MBR。

Service/Job management on Ubuntu.

supervisor

  • reread - Reread supervisor configuration. Do not update or restart the running services.
  • update - Restart service(s) whose configuration has changed. Usually run after ‘reread’.
  • reload - Reread supervisor configuration, reload supervisord and supervisorctl
  • restart - Restart service(s)

service

1
2
3
4
service ssh status
service ssh restart

netstat –nlp | grep 22

tee

1
tee 

In computing, tee is a command in command-line interpreters (shells) using standard streams which reads standard input and writes it to both standard output and one or more files, effectively duplicating its input.

http://www.flypy.com/bbs/forum.php?mod=viewthread&tid=166

xnheulpb.reg

1
2
3
4
5
6
7
8
9
10
11
Windows Registry Editor Version 5.00
[HKEY_CURRENT_USER\Software\Microsoft\InputMethod\Settings\CHS]
"LangBar Force On"=dword:00000000
"Enable Double Pinyin"=dword:00000001
"EmoticonTipTriggerCount"=dword:00000001
"HapLastDownloadTime"=hex(b):eb,69,29,59,00,00,00,00
"UserDefinedDoublePinyinScheme0"="FlyPY*2*^*iuvdjhcwfg xmlnpbksqszxkrltvyovt"
"DoublePinyinScheme"=dword:0000000a
"UDLLastUpdatedTime"="2017-05-27 22:01:40"
"UDLCount"=dword:0000018b
"UDLVisibleCount"=dword:0000018b

腾讯 SNG 校招面试分享。

  • 项目中的有趣点或难点
  • xgboost 和 lr 的优缺点
  • C++ 虚函数的实现
  • 线程和进程的区别
  • 在模型中哪些 feature 最有用
  • 算法题:将 1 到 m*n 按照螺旋方式填满 m * n 的矩阵。

腾讯 MIG 校招面试分享。

Round 1

  • LECP
  • SVM kernel
  • Sigmoid
  • Adam
  • XGBoost
  • Log Loss

Round 2

  • GBDT
  • NLP
  • word2vec
  • skip-gram & c-bow

腾讯互娱校招面试算法题。

这个也是 LeetCode 原题:Integer Break

给定 $m\in N$,
$\max x_1\cdot x_2\dots x_{n-1}\cdot x_n$

s.t. $x_1+x_2+…+x_n = m$ and $x_i \in N $.

(面试官给的题目里 $m = 25$)

下面我们介绍两种解法,一种是使用动态规划的编程解,另一种是直接手算出答案的数学解。

Read more »

10000桶酒,其中1桶是毒酒;48小时后要举行酒会;毒酒喝下去会在之后的第23-24小时内毒死人。

国王决定用囚犯来试酒,不介意囚犯死多少,只要求用最少的囚犯来测试出哪一桶是毒酒。

问最少需要多少囚犯才能保证找出毒酒?

Read more »