Skip to content

Instantly share code, notes, and snippets.

View tnarihi's full-sized avatar

Takuya Narihira tnarihi

  • Sony
  • Tokyo, Japan
View GitHub Profile
@tnarihi
tnarihi / README.md
Last active January 7, 2022 05:16
Emacs 24.4 installation on Ubuntu 14.04 without sudo

Installing Emacs 24.4 on Ubuntu 14.04 without sudo privilege

Just run:

sh ./ubuntu14.04-emacs-24.4-install.sh

This will install ncurses which is dependency of emacs24.4. It may requires another dependencies depending on your environment. Note that configure options in emacs installation are for disabling GUI features.

@tnarihi
tnarihi / README.md
Last active August 29, 2015 14:17
A script to interactively git-merge multiple future branches.

A script to interactively git-merge multiple future branches

This is usefull when you are working with open source codes and you have several future branches that you want to use and is still not merged to the main stream.

Workflow:

  1. Edit variables BASE_BRANCH and BRANCHES
  2. Run ./future.sh
  3. If you see conflicts, fix them and commit, then run ./future.sh again.
  4. Repeat 3, until you see the message Done. in the result of ./future.sh.
@tnarihi
tnarihi / README.md
Last active February 27, 2020 16:31
Behaviors of Python threading, multiprocessing and futures.

Behaviors of Python threading, multiprocessing and concurrent.futures

I saw the behaviors as follows:

  1. threading.Thread and multiprocessing.Process do not raise to the main thread.
  2. multiprocessing.Pool and multiprocessing.pool.ThreadPool (this is not documented at all) leave zombie threads.

The results show that concurrent.futures is the best choice for threading and multiprocessing in Python!

I did this experiment on Python 2.7.9, and Python 2.x does not have concurrent.futures, so I installed it by pip command pip install futures.

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@tnarihi
tnarihi / README.md
Last active August 29, 2015 14:16
APIs for image transformation and comparisons: OpenCV2 vs Scikit-Image. http://nbviewer.ipython.org/gist/tnarihi/9b860f9f163b66bff8cd

Examples of Python OpenCV2 and Scikit.Image and their comparisons

See the iPython notebook link. In this notebook, you can see various image maniputaion examples using both Python extension of OpenCV2 and Scikit.Image.

@tnarihi
tnarihi / .screenrc
Created December 23, 2014 22:39
My GNU Screen setting
# Filename: $HOME/.screenrc
# Purpose: Setup file for program "(GNU) screen"
# Latest change: Mon Jan 26 10:51:50 CET 2004
# Author: Michael Prokop / <[email protected]> / www.michael-prokop.at
# ===============================================================
#
# ===============================================================
# SEE ALSO:
# ===============================================================
# SCREEN Pages:
@tnarihi
tnarihi / additional_sbp.sublime-keymap
Last active August 29, 2015 14:11
My personal additional settings for sublemacspro. Copy to my user key-bindings.
[
{ "keys": ["ctrl+x", "["], "command": "move_to", "args": {"to": "bof", "extend": false} },
{ "keys": ["ctrl+x", "]"], "command": "move_to", "args": {"to": "eof", "extend": false} },
{ "keys": ["ctrl+shift+2"], "command": "sbp_set_mark" },
{ "keys": ["ctrl+[", "w"], "command": "sbp_kill_ring_save" },
{ "keys": ["ctrl+[", "b"], "command": "move", "args": {"by": "subwords", "forward": false} },
{ "keys": ["ctrl+[", "f"], "command": "move", "args": {"by": "subword_ends", "forward": true} },
{ "keys": ["ctrl+[", "d"], "command": "sbp_delete_word", "args": { "forward": true } },
{ "keys": ["ctrl+[", "backspace"], "command": "sbp_delete_word", "args": { "forward": false } },
{ "keys": ["ctrl+x", "ctrl+w"], "command": "prompt_save_as" },
@tnarihi
tnarihi / parse_libsvm_input.cpp
Last active August 29, 2015 14:11
An example of parsing LIBSVM input format with Boost library
/*
* No Copyright
*/
#include <boost/algorithm/string.hpp>
#include <boost/foreach.hpp>
#include <boost/shared_ptr.hpp>
#include <boost/lexical_cast.hpp>
#include <iostream> // NOLINT(readability/streams)
#include <fstream> // NOLINT(readability/streams)
#include <string>
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
{
"metadata": {
"name": "",
"signature": "sha256:85b09af85413fd379d6f77fe2b2d33945a781e80b345de143d1581b69f4d6298"
},
"nbformat": 3,
"nbformat_minor": 0,
"worksheets": [
{
"cells": [