Skip to content

Instantly share code, notes, and snippets.

Avatar

Keisuke Fukuda keisukefukuda

View GitHub Profile
@iwiwi
iwiwi / alltoall_demo.py
Created Aug 14, 2017
All-to-all collective communication for numpy & cupy arrays with ChainerMN (demo)
View alltoall_demo.py
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
yymm / want_to_ergodox.md
Last active May 27, 2020
Ergodox買おうの会
View want_to_ergodox.md

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

購入できるところ

➜ FalbaTech

ErgoDox - FalbaTech

選んでいくスタイル。

@kylemcdonald
kylemcdonald / showarray.py
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.
View showarray.py
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)
IPython.display.display(IPython.display.Image(data=f.getvalue()))
@john2x
john2x / 00_destructuring.md
Last active Dec 1, 2021
Clojure Destructuring Tutorial and Cheat Sheet
View 00_destructuring.md

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
voluntas / erlang.rst
Last active Apr 8, 2021
実践 Erlang/OTP コトハジメ 2014.11
View erlang.rst

実践 Erlang/OTP コトハジメ 2014.11

更新:2014-11-20
バージョン:0.0.5
作者:@voluntas
URL:http://voluntas.github.io/

概要

@jamesmacaulay
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 '(clojure.tools.namespace 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
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
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;
}