Skip to content

Instantly share code, notes, and snippets.

View baishuai's full-sized avatar

Shuai Bai baishuai

View GitHub Profile
@baishuai
baishuai / CMakeLists.txt
Created July 6, 2017 14:36
CMakeLists.txt add_executable for each subdir in src
cmake_minimum_required(VERSION 3.7)
project(fragmentsdemo)
set(CMAKE_CXX_STANDARD 11)
macro(SUBDIRLIST result curdir)
file(GLOB children ${curdir}/*)
set(dirlist "")
foreach (child ${children})
message(STATUS ${child})
@baishuai
baishuai / NA数值分析实验.md
Last active June 14, 2016 23:19
数值分析实验2014年 蔡懿慈

2014年数值分析(蔡懿慈) 实验题解

运行实验代码需要安装go
安装方法

  • ubuntu sudo apt-get install golang
  • archlinux sudo pacman -S go
  • osx brew install go
  • windows 下载二进制文件安装

每个实验独立一个go文件,相互之间没有依赖

@baishuai
baishuai / pageRank.go
Last active August 29, 2015 14:00
搜索引擎PageRank作业代码
package main
import (
"bufio"
"flag"
"fmt"
"io"
"os"
"strconv"
"strings"
@baishuai
baishuai / barber_sync.c
Created April 20, 2014 10:18
Ucore中使用信号量和管程解决理发师问题
#include <stdio.h>
#include <proc.h>
#include <sem.h>
#include <monitor.h>
#include <assert.h>
#define Chair 5
#define SLEEP_TIME 4
//----------理发师问题 使用信号量解法