Skip to content

Instantly share code, notes, and snippets.

@nushio3
nushio3 / gist:66ccd867d8ce8b3a752d2e8142b2f6e1
Created April 17, 2017 14:46
CUFP 2016 Call for tutorials
CUFP 2016 Call for Tutorials
Commercial Users of Functional Programming (CUFP) is an annual meeting
co-located with the International Conference on Functional Programming
which this year will take place in Nara, Japan from … to … of
September 2016. CUFP aims to bridge the gap between academia and users
applying functional programming in practice. CUFP provides
high-quality practical tutorials covering state-of-the-art techniques
and tools for functional programming. There will be a mix of tutorials
on introduction and advanced level, such that anyone that wants to
#!/bin/sh
while :
do
$1
inotifywait -q -e modify --exclude '~$' -r ./src/ -r ./tests/
done
#!/usr/bin/env python2
# -*- coding: utf-8 -*-
import matplotlib
matplotlib.use('Agg')
import json, urllib, numpy as np, matplotlib.pylab as plt, matplotlib.ticker as mtick
import sunpy.map
from astropy.io import fits
from sunpy.cm import color_tables as ct
import sunpy.wcs as wcs
import datetime
@nushio3
nushio3 / credit_card_bin_codes.md
Created July 31, 2016 14:57 — forked from matsubo/credit_card_bin_codes.md
Credit Card Bin Codes

概要

クレジットカード番号には法則があり、先頭6桁でカードの種類を識別、分類することができる。

詳細はISO/IEC 7812で規定されている。

ISO/IEC 7812 - Wikipedia https://ja.wikipedia.org/wiki/ISO/IEC_7812

先頭の6桁を銀行識別番号(Bank Identification Number、略称:BIN)ないしは発行者識別番号(Issuer Identification Number、略称:IIN)と呼び、この先頭6桁でカード発行会社(イシュア、issuer)が判るようになっている。

~$ stack runhaskell myshow.hs
Run from outside a project, using implicit global project config
Using resolver: lts-5.1 from implicit global project's config file: /home/nushio/.stack/global-project/stack.yaml
individual representations test:
ushow "\28450\&6" == "漢6": [OK]
ushow "\na\ri\ta \22269\38555\31354\28207" == "\na\ri\ta 国際空港": [Failed]
expected: "\"\\na\\ri\\ta \22269\38555\31354\28207\""
but got: "\"\na\ri\ta \22269\38555\31354\28207\""
ushow "\SOH\SO\&H" == "\SOH\SO\&H": [Failed]
expected: "\"\\SOH\\SO\\&H\""
@nushio3
nushio3 / x2_zoom.py
Last active August 29, 2015 14:24
Chainerで画像を2倍ズーム
from operator import mul
import numpy as np
import chainer
from chainer import computational_graph as c
from chainer import cuda, Variable, FunctionSet, optimizers
import chainer.functions as F
from chainer import optimizers
nushio@nuwheezy:tutorial$ cat test.f90
program test
implicit none
integer :: n
read *, n
! This is nushio's comment
if (n < 3) then
print *, "n is small"
module A where
data A = A
instance Show A where
show _ = "-> A <-"
@nushio3
nushio3 / Examples.hs
Last active August 29, 2015 14:22
uom-plugin difference
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE QuasiQuotes #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE TypeOperators #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE UndecidableInstances #-}
{-# OPTIONS_GHC -fplugin Data.UnitsOfMeasure.Plugin #-}
@nushio3
nushio3 / gist:0d01c4672982ceaf7e2f
Created June 5, 2015 13:46
Working Example on uom-plugin
{-# OPTIONS_GHC -fplugin Data.UnitsOfMeasure.Plugin #-}
{-# LANGUAGE DataKinds, QuasiQuotes, TypeOperators #-}
{-# LANGUAGE TypeFamilies, UndecidableInstances #-}
import Data.UnitsOfMeasure
[u| m |]
main :: IO ()
main = print ([u| 3 m |] :: Quantity Int [u| m |])