View a.cpp
// beginning a Binaryen API trace
#include <math.h>
#include <map>
#include "src/binaryen-c.h"
int main() {
std::map<size_t, BinaryenFunctionTypeRef> functionTypes;
std::map<size_t, BinaryenExpressionRef> expressions;
std::map<size_t, BinaryenFunctionRef> functions;
std::map<size_t, BinaryenImportRef> imports;
std::map<size_t, BinaryenExportRef> exports;
View a.cpp
// beginning a Binaryen API trace
#include <math.h>
#include <map>
#include "src/binaryen-c.h"
int main() {
std::map<size_t, BinaryenFunctionTypeRef> functionTypes;
std::map<size_t, BinaryenExpressionRef> expressions;
std::map<size_t, BinaryenFunctionRef> functions;
std::map<size_t, BinaryenImportRef> imports;
std::map<size_t, BinaryenExportRef> exports;
View build.mk
SRC_HC_OPTS = -O -H64m
GhcStage1HcOpts = -O
GhcStage2HcOpts = -O2
GhcLibHcOpts = -O2
BUILD_PROF_LIBS = YES
SplitObjs = NO
SplitSections = YES
BUILD_SPHINX_HTML = YES
BUILD_SPHINX_PDF = NO
HADDOCK_DOCS = YES
View nvm-node-nightlies.md

You can install Node Nightlies/RCs via nvm using NVM_NODEJS_ORG_MIRROR environment variable.

Install latest Node RC

NVM_NODEJS_ORG_MIRROR=https://nodejs.org/download/rc/ nvm i node

Install latest Node.js Nightly

NVM_NODEJS_ORG_MIRROR=https://nodejs.org/download/nightly/ nvm i node
View Subst.hs
{-# LANGUAGE DataKinds, GADTs #-}
import Data.Data
data Phase
= PS
| PI
data Term a where
S :: String -> Term 'PS
View sea-of-blocks.cpp
#include <iostream>
#include <string>
#include <vector>
#include <binaryen-c.h>
static BinaryenExpressionRef build_sea_of_blocks(BinaryenModuleRef m,
int block_num) {
std::vector<std::string> labels;
labels.reserve(block_num);
std::vector<const char *> label_ptrs;
View os_hw1.md

Operating Systems Assignment 1

思考题

填空题

  1. 当前常见的操作系统主要用 C 语言编写
  2. IBM 704
  3. 控制和管理外部设备、有效地组织用户程序运行的系统软件称为内核
  4. 允许多用户提交若干作业给计算机系统集中处理的操作系统称为分时操作系统
View THBinary.hs
{-# OPTIONS_GHC -Wall -Wno-orphans #-}
module THBinary where
import Data.Binary
import Language.Haskell.TH.Syntax
instance Binary OccName
instance Binary ModName
View takehome-fp-interview.markdown

Take-home functional programming interview

This document is licensed CC0.

These are some questions to give a sense of what you know about FP. This is more of a gauge of what you know, it's not necessarily expected that a single person will breeze through all questions. For each question, give your answer if you know it, say how long it took you, and say whether it was 'trivial', 'easy', 'medium', 'hard', or 'I don't know'. Give your answers in Haskell for the questions that involve code.

Please be honest, as the interviewer may do some spot checking with similar questions. It's not going to look good if you report a question as being 'trivial' but a similar question completely stumps you.

Here's a bit more guidance on how to use these labels:

View fact.c
/* GHC_PACKAGES base ghc-prim integer-simple
*/
#include "Stg.h"
EB_(Main_zdtrModule4_bytes);
const char Main_zdtrModule4_bytes[] = "main";
ERO_(ghczmprim_GHCziTypes_TrNameS_con_info);
EB_(Main_zdtrModule4_bytes);
EC_(Main_zdtrModule3_closure);
StgWord Main_zdtrModule3_closure[]__attribute__((aligned(8)))= {
(W_)&ghczmprim_GHCziTypes_TrNameS_con_info, (W_)&Main_zdtrModule4_bytes