Skip to content

Instantly share code, notes, and snippets.

// C++ program to find difference of two large numbers.
#include<bits/stdc++.h>
using namespace std;
// Returns true if str1 is smaller than str2.
bool isSmaller(string str1, string str2)
{
// Calculate lengths of both string
int n1 = str1.length(), n2 = str2.length();
@michaelHL
michaelHL / 2017-06-09-settings.jq
Last active June 9, 2017 03:17
vscodesettings
{
"workbench.iconTheme": "material-icon-theme",
"editor.rulers": [
80
],
"editor.fontSize": 19.6,
"editor.fontFamily": "Inconsolata, 'Microsoft Yahei Mono', Consolas, 'Courier New', monospace",
"editor.lineHeight": 24,
"editor.minimap.enabled": true,
"editor.cursorBlinking": "solid",
@michaelHL
michaelHL / 2017-06-06.md
Last active July 5, 2017 05:27
eclipse配置C/C++编译环境

eclipse配置C/C++编译环境

  1. 下载解压eclipse, 建议直接下载Eclipse IDE for C/C++ Developers, 免去插件安装
  2. 下载解压GCC编译工具链, 比如当前最新的7.1.0

@michaelHL
michaelHL / randomwalkover.md
Last active June 6, 2017 08:00
100步随机游走过点10概率

100步随机游走过程中, 经过点10的概率精确值为:

求和式中的项为所谓的「首达概率」.

代码

randWalkOver1 <- function(n, start, stop, p = 0.5, stepf = 1, stepb = 1) {
    out <- 0