Skip to content

Instantly share code, notes, and snippets.

How to Setup emacs irony-mode in Ubuntu-12.04

I recently found a nice emacs-mode, [irony-mode], which can be used with [company-mode], [flycheck-mode], and [eldoc-mode]. It works nicely with CMake-based projects. The document contains a list of instructions for setting things up. I assume that you're using a fresh-installed Ubuntu-12.04.5 (64-bit). It uses [Lean theorem prover][lean] as an example project.

@soonhokong
soonhokong / init.el
Last active September 14, 2020 06:01
Emacs Configuration for Windows
;; Package
(require 'package)
(add-to-list 'package-archives
'("melpa" . "http://melpa.milkbox.net/packages/") t)
(package-initialize)
(package-refresh-contents)
;; Install required/optional packages for lean-mode
(defvar lean-mode-required-packages
'(company dash dash-functional flycheck whitespace-cleanup-mode
@soonhokong
soonhokong / Vim_EditorConfig.md
Created June 12, 2016 16:55
Vim + EditorConfig

Vim + EditorConfig Setup

mkdir -p ~/tmp
cd ~/tmp
wget https://github.com/editorconfig/editorconfig-vim/archive/master.zip
unzip master.zip
mv editorconfig-vim-master/{autoload,doc,plugin} ~/.vim/

Clang Version

Debian clang version 3.3-debian16precise1 (branches/release_33) (based on LLVM 3.3)
Target: x86_64-pc-linux-gnu
Thread model: posix

Code (test.cpp)

@soonhokong
soonhokong / leandeps.py
Created December 17, 2015 17:23
Python3-compatible leandeps.py
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (c) 2015 Microsoft Corporation. All rights reserved.
# Released under Apache 2.0 license as described in the file LICENSE.
#
# Authors: Soonho Kong, Leonardo de Moura, Ulrik Buchholtz
# Python 2/3 compatibility
from __future__ import print_function
@soonhokong
soonhokong / test.tex
Created December 11, 2015 15:37
test.tex
\documentclass{article}
\usepackage{unixode} % Need to download from https://raw.githubusercontent.com/leanprover/tutorial/master/unixode.sty
\usepackage{minted} % Need to download from https://raw.githubusercontent.com/leanprover/tutorial/master/minted.sty
% Specify local pygments directory. Do the following in your working directory (where test.tex is located)
% hg clone https://bitbucket.org/leanprover/pygments-main && cd pygments-main && python setup.py build & cd ..
\renewcommand{\MintedPygmentize}{./pygments-main/pygmentize}
\setminted{encoding=utf-8}
\usepackage{fontspec}
\setmainfont{FreeSerif}
\setmonofont{FreeMono}
@soonhokong
soonhokong / powertrain.drh
Created December 7, 2015 21:37
Toyota Powertrain Control Benchmark
// Toyota Powertrain Control Verification Benchmark:
// This is based on the following paper:
//
// Xiaoqing Jin, Jyotirmoy V. Deshmukh, James Kapinski, Koichi Ueda, and
// Ken Butts. 2014. Powertrain control verification benchmark. In
// Proceedings of the 17th international conference on Hybrid systems:
// computation and control (HSCC '14). ACM, New York, NY, USA,
// 253-262. DOI=http://dx.doi.org/10.1145/2562059.2562140
//
// Originally written by Kyungmin Bae (kbae@cs.cmu.edu)
@soonhokong
soonhokong / ag_bench.sh
Created October 22, 2015 15:36 — forked from ggreer/ag_bench.sh
My ag benchmark script
#!/bin/bash
function benchmark_rev() {
REV=$1
git clean -f &> /dev/null
git checkout $REV &> /dev/null
git clean -f &> /dev/null
if [ $? -ne 0 ]; then
echo "Checkout of $REV failed!"
exit 1
@soonhokong
soonhokong / Normal_Distribution_PDF_Integration_CAPD3_CAPD4.md
Last active August 30, 2015 16:09
Integration of Normal Distribution PDF using CAPD3 and CAPD4

We want to integrate the probability density function for normal distribution:

image1

To simplify the problem, let's pick mean = 0.0, standard deviation = 1.0. In theory, integration of this fuction from x = -oo to x = oo should give P = 1.0. Using CAPD, let's compute for the range X = [-10, 10] whose prob must be less than 1.0.

image2

Output