Skip to content

Instantly share code, notes, and snippets.


Keybase proof

I hereby claim:

  • I am ofan on github.
  • I am zfeng ( on keybase.
  • I have a public key ASD8WcPiffrknboEg8emKPLfkwaIcssn3saUisuHJ3XTmQo

To claim this, I am signing this object:

View expr.cpp
#include <iostream>
#include <cstdlib>
using namespace std;
int main(int argc, char* argv[]){
string in(argv[1]);
long res=0;
int pn = 0;
for(auto i=in.begin(); i!=in.end(); ++i){
View withdraw.hs
import Control.Monad.State.Lazy
import Control.Monad.Error
import Data.Char
type BalanceT e s m a = ErrorT e (StateT s m) a
type Balance a = BalanceT BalanceError Double IO a
data BalanceError = AmountIsNegative | NotEnoughBalance | InvalidCommand String | BalanceError String deriving Show
instance Error BalanceError where
View barrier.c
#include <mpi.h>
#include <stdio.h>
#include <stdlib.h>
int main(int argc, char* argv[]){
MPI_Init(&argc, &argv);
int size, rank;
MPI_Comm_size(MPI_COMM_WORLD, &size);
MPI_Comm_rank(MPI_COMM_WORLD, &rank);
int data;
ofan / pi.cpp
Last active August 29, 2015 13:56
View pi.cpp
#include <math.h>
#include <mpich-devel-clang/mpi.h>
#include <iostream>
using namespace std;
int main(int argc, char* argv[]){
int n, rank, size, i;
// PI25DT is used for computing error
import logging
import os
import errno
import shutil
from urlparse import urlparse, urlunparse
from bs4 import BeautifulSoup
from . import types
from .base import _BaseParser
import re
View fp.cpp
#include <iostream>
int doAdd(int (*call)(int,int)) {
return call(1,2);
int main() {
struct Add {
static int add(int a, int b) {
return a + b;
View issues.txt
fficxx issues:
1. simpleBuilder hard coded snappy specific code. -- Patched but not tested
2. resource management issue in C shim code(returned objects and references are converted to pointers, then use ForeignPtr on the Haskell), this probably will cause a critical bug.
3. fficxx currently doesn't deal with global variables
4. Multiple packages for one C++ project
5. enumeration and class support is not implemented (in swig branch)
6. interface to C++ in the C shim code is not fully implemented
7. need to support function pointers
8. finish top-level functions