Skip to content

Instantly share code, notes, and snippets.


Keisuke Fukuda keisukefukuda

View GitHub Profile
iwiwi /
Created Aug 14, 2017
All-to-all collective communication for numpy & cupy arrays with ChainerMN (demo)
import chainermn
from chainermn.communicators._memory_utility import array_to_buffer_object
import mpi4py.MPI
comm = chainermn.create_communicator('naive')
def alltoall_demo(xp):
mpi_comm = comm.mpi_comm
yymm /
Last active May 27, 2020

この記事のあの画像を見てビビッと来てしまったので, 周りにいる人とErgodoxの購入検討をはじめました(随時更新)


➜ FalbaTech

ErgoDox - FalbaTech


kylemcdonald /
Created Jan 3, 2016
Minimal code for rendering a numpy array as an image in a Jupyter notebook in memory. Borrowed from the Deep Dream notebook.
import PIL.Image
from cStringIO import StringIO
import IPython.display
import numpy as np
def showarray(a, fmt='png'):
a = np.uint8(a)
f = StringIO()
PIL.Image.fromarray(a).save(f, fmt)
john2x /
Last active Nov 25, 2022
Clojure Destructuring Tutorial and Cheat Sheet

Clojure Destructuring Tutorial and Cheat Sheet

(Related blog post)

Simply put, destructuring in Clojure is a way extract values from a datastructure and bind them to symbols, without having to explicitly traverse the datstructure. It allows for elegant and concise Clojure code.

Vectors and Sequences

voluntas / erlang.rst
Last active Apr 8, 2021
実践 Erlang/OTP コトハジメ 2014.11
View erlang.rst

実践 Erlang/OTP コトハジメ 2014.11



jamesmacaulay / profiles.clj
Last active Jun 30, 2020
My ~/.lein/profiles.clj at the moment.
View profiles.clj
{:user {:dependencies [[org.clojure/tools.namespace "0.2.3"]
[spyscope "0.1.3"]
[criterium "0.4.1"]]
:injections [(require '( repl find))
; try/catch to workaround an issue where `lein repl` outside a project dir
; will not load reader literal definitions correctly:
(try (require 'spyscope.core)
(catch RuntimeException e))]
:plugins [[lein-pprint "1.1.1"]
[lein-beanstalk "0.2.6"]
jamesmacaulay / Clojure.sublime-settings
Last active Jan 18, 2021
Clojure stuff for Sublime Text 2. Files live in ~/Application Support/Sublime Text 2/Packages/User
View Clojure.sublime-settings
// installed Clojure packages:
// * BracketHighlighter
// * lispindent
// * SublimeREPL
// * sublime-paredit
"word_separators": "/\\()\"',;!@$%^&|+=[]{}`~?",
"paredit_enabled": true,
dadeba / HKeys.hpp
Created Mar 30, 2012
Convert the Morton key to the Hilbert key in 3-D
View HKeys.hpp
// A B C D E F G H I J K M
// 0 1 2 3 4 5 6 7 8 9 10 11
struct HKeys {
static const uint64 T0[12][8];
static const uint64 T1[12][8];
uint64 poi(uint64 key, uint64 level)
return (key >> 3*level)&0x7ULL;