Skip to content

Instantly share code, notes, and snippets.

View jihobak's full-sized avatar

piper jihobak

  • eigencapital
  • Daegu, South Korea
View GitHub Profile
# generated from catkin/cmake/template/pkgConfig.cmake.in
# append elements to a list and remove existing duplicates from the list
# copied from catkin/cmake/list_append_deduplicate.cmake to keep pkgConfig
# self contained
macro(_list_append_deduplicate listname)
if(NOT "${ARGN}" STREQUAL "")
if(${listname})
list(REMOVE_ITEM ${listname} ${ARGN})
endif()
@jihobak
jihobak / Test.py
Created July 6, 2017 12:59 — forked from tuxmartin/Test.py
Python ORM example (Python + SQLAlchemy + SQlite/MySQL)
from sqlalchemy.ext.declarative import declarative_base
#from sqlalchemy import *
#from sqlalchemy.orm import *
# Pro entity v podadresari. Podaresar *musi* obsahovat prazdny soubor __init__.py !
#from entity.User import User
'''
Zavislosti:
# apt-get install python-sqlalchemy
@jihobak
jihobak / module_param.md
Created June 18, 2017 09:32 — forked from kimhoki/module_param.md
[Device Driver] param , PARM, 커널 모듈 매개 변수 매크로

module_param_named, 커널 모듈 매개 변수 매크로

모듈 매개 변수 지정 방법:

#include:

#include <linux/moduleparam.h>
"set UTF-8 encoding
set enc=utf-8
set fenc=utf-8
set termencoding=utf-8
" disable vi compatibility (emulation of old bugs)
set nocompatible
" use indentation of previous line
set autoindent
" use intelligent indentation for C
set smartindent
@jihobak
jihobak / bnlstm.py
Created March 4, 2017 11:45 — forked from spitis/bnlstm.py
Batch normalized LSTM Cell for Tensorflow
"""adapted from https://github.com/OlavHN/bnlstm to store separate population statistics per state"""
import tensorflow as tf, numpy as np
RNNCell = tf.nn.rnn_cell.RNNCell
class BNLSTMCell(RNNCell):
'''Batch normalized LSTM as described in arxiv.org/abs/1603.09025'''
def __init__(self, num_units, is_training_tensor, max_bn_steps, initial_scale=0.1, activation=tf.tanh, decay=0.95):
"""
* max bn steps is the maximum number of steps for which to store separate population stats
"""
@jihobak
jihobak / elastic_transform.py
Created February 28, 2017 10:12 — forked from ernestum/elastic_transform.py
Elastic transformation of an image in Python
import numpy as np
from scipy.ndimage.interpolation import map_coordinates
from scipy.ndimage.filters import gaussian_filter
def elastic_transform(image, alpha, sigma, random_state=None):
"""Elastic deformation of images as described in [Simard2003]_.
.. [Simard2003] Simard, Steinkraus and Platt, "Best Practices for
Convolutional Neural Networks applied to Visual Document Analysis", in
Proc. of the International Conference on Document Analysis and
Recognition, 2003.
@jihobak
jihobak / labels_1024.tsv
Created February 15, 2017 21:59 — forked from teamdandelion/labels_1024.tsv
TensorBoard: TF Dev Summit Tutorial
We can make this file beautiful and searchable if this error is corrected: No tabs found in this TSV file in line 0.
7
2
1
0
4
1
4
9
5
9
@jihobak
jihobak / cython_array_loop.ipynb
Created December 2, 2016 03:47 — forked from jskDr/cython_array_loop.ipynb
Cython can improve the speed with 1d numpy array in a IPython notebook
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@jihobak
jihobak / rest_api.py
Created July 7, 2016 01:06 — forked from mcchae/rest_api.py
Flask REST API sample
#!/usr/bin/env python
#coding=utf8
##########################################################################################
import os
import logging
import logging.handlers
import traceback
from flask import Flask
from flask.ext.restful import reqparse, abort, Api, Resource
from flask import request
@jihobak
jihobak / api_client.py
Created July 7, 2016 01:03 — forked from mcchae/api_client.py
Flask File Upload
##########################################################################################
import os
import sys
import json
import unittest
import pprint
import httplib
import urllib
import datetime
import random