Skip to content

Instantly share code, notes, and snippets.

set nocompatible
source $VIMRUNTIME/vimrc_example.vim
let mapleader=","
filetype on
syntax on
if has('gui_running')
color ir_black
else
/*=============================================================================
Copyright (c) 2001-2007 Joel de Guzman
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
=============================================================================*/
///////////////////////////////////////////////////////////////////////////////
//
// A Roman Numerals Parser (demonstrating the symbol table). This is
// discussed in the "Symbols" chapter in the Spirit User's Guide.
@pluskid
pluskid / gist:2204698
Created March 26, 2012 12:11
java modular compile error
Buildfile: /tmp/yaourt-tmp-pluskid/aur-shogun-git/src/shogun-build/src/interfaces/java_modular/build.xml
compile:
[mkdir] Created dir: /tmp/yaourt-tmp-pluskid/aur-shogun-git/src/shogun-build/src/interfaces/java_modular/classes
[javac] /tmp/yaourt-tmp-pluskid/aur-shogun-git/src/shogun-build/src/interfaces/java_modular/build.xml:18: warning: '
includeantruntime' was not set, defaulting to build.sysclasspath=last; set to false for repeatable builds
[javac] Compiling 620 source files to /tmp/yaourt-tmp-pluskid/aur-shogun-git/src/shogun-build/src/interfaces/java_mo
dular/classes
[javac] /tmp/yaourt-tmp-pluskid/aur-shogun-git/src/shogun-build/src/interfaces/java_modular/org/shogun/modshogunJNI.
java:6537: error: cannot find symbol
@pluskid
pluskid / auto_ptr.h
Created April 7, 2012 04:01
Automatic ref-counting
#ifndef AUTO_PTR_H__
#define AUTO_PTR_H__
template <typename T>
class auto_ptr
{
public:
auto_ptr():m_rawptr(NULL)
{
}
@pluskid
pluskid / gist:2489859
Created April 25, 2012 13:51
experimental shogun labels design
template <typename LabelType, LabelStoreType>
class CLabels: public CSGObject
{
public:
virtual int32_t get_num_classes() const = 0;
virtual const LabelType& get_label(int32_t index) const
{
check_out_of_range(index);
return cast_label(m_labels[index]);
}
@pluskid
pluskid / gist:2496958
Created April 26, 2012 07:00
Efficient ref-counting prototype for SGVector
template <typename T>
class SGVector
{
public:
SGVector(int32_t len)
{
int32_t size = sizeof(T)*len + sizeof(int32_t);
uchar *memory = malloc(size);
m_buffer = memory + sizeof(int32_t);
@pluskid
pluskid / .vimrc
Created May 9, 2012 12:36
my vimrc
" vim: set foldmarker={,} foldlevel=0 foldmethod=marker:
"========================================
" Basic setting {
"========================================
set nocompatible
set visualbell " disable sound bell
let mapleader = ','
filetype plugin indent on " auto filetype identification
@pluskid
pluskid / Assetfile
Created June 7, 2012 04:37
rules for rake-pipeline of my blog
# vim: filetype=ruby
output "compiled/files"
class AsyFilter < Rake::Pipeline::Filter
attr_accessor :config
def initialize
@output_name_generator = proc { |fn, wrap|
@config = {'ext' => 'png', 'opt' => ''}
@pluskid
pluskid / sparse_to_dense.py
Created June 7, 2012 07:49
Convert Sparse Feature to Dense Feature
import sys
class Data:
def __init__(self, line):
data = line.split()
self.label = data[0]
self.feats = dict()
for i in range(len(data)-1):
a,b = data[i+1].split(':')
self.feats[int(a)] = b
" vim: set foldmarker={,} foldlevel=0 foldmethod=marker:
"=======================================
" Initialization {
"=======================================
set nocompatible
call pathogen#infect()
filetype plugin indent on
"}