Skip to content

Instantly share code, notes, and snippets.

View nekketsuuu's full-sized avatar
🍑
I like peaches!

Takuma Ishikawa nekketsuuu

🍑
I like peaches!
View GitHub Profile

実験環境

  • Intel Core i7-7500U CPU @ 2.70 GHz クアッドコア
  • メモリ 16GB
  • Ubuntu 16.10 yakkety (x86_64, 4.8.0-46-generic)
  • GNU bash 4.3.46(1)-release (x86_64-pc-linux-gnu)
  • grep (GNU grep) 2.25
  • cat (GNU coreutils) 8.25
  • go version go1.8 linux/amd64
@nekketsuuu
nekketsuuu / LIS_Ubuntu_16.10.md
Last active April 28, 2017 04:50
LIS を Ubuntu 16.10 上で遊ぶための方法

配布されたプリントやLISのgithubのREADMEに書いてあることをそのままやってもいいんですが、罠があるので一応僕がやったことをメモっておきます。bashで作業してますが多分ほかのシェルでも大体同じです。

1. npmをインストールする

npmはnode.jsのためのパッケージマネージャです。

apt install nodejs npmでもいいんですが、これからnode.jsで遊びたい人にはこれじゃ不便なので、nvmを使ってインストールします。apt使って入れる人は入れてから2.に移ってください。

nvmはnode.js自体のバージョンマネージャです。まずはnvmを入れましょう。nvmのGitHubにインストール方法が書いてあります。 .bashrcに少し追記されるので. ~/.bashrcするかbashを立ち上げ直す必要があることに注意です。

:- dynamic memo/2.
:- retractall( (memo(_, _) ).
fib(N, 1) :-
N =< 2, !.
fib(N, Result) :-
memo(N, Result), !.
fib(N, Result) :-
N1 is N - 1,
fib(N1, Result1),
# Ubuntu 16.04 で AArch64 用のクロスコンパイル環境をつくる
# 2017/06/29
# http://inaz2.hatenablog.com/entry/2015/12/01/204201
# https://ja.stackoverflow.com/q/35941/19110
# sudo docker run --name cross_compile2 -it ubuntu:xenial /bin/bash
apt update
apt upgrade
apt install build-essential texinfo gawk xz-utils lbzip2 perl wget emacs
# Vagrant 上の ubuntu/xenial64 (20170626.0.0) に AArch64 用のコンパイラをビルドする
# 2017/07/01
# Ansible 環境が無かったので手でインストール
sudo apt update
sudo apt upgrade
sudo apt install g++ bison flex texinfo
sudo apt install make
# 確認
Python 3.6.0 |Anaconda 4.3.1 (64-bit)| (default, Dec 23 2016, 12:22:00)
[GCC 4.4.7 20120313 (Red Hat 4.4.7-1)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import numpy as np
>>> import pandas as pd
>>> test = pd.DataFrame(np.random.choice([0.0, 100.0], size=(4, 4)))
>>> test
0 1 2 3
0 0.0 0.0 100.0 100.0
1 100.0 100.0 0.0 100.0
@nekketsuuu
nekketsuuu / Makefile
Last active July 22, 2017 02:27
関数・論理型プログラミング実験第13回リバーシプログラム Haskell サーバーを stack でコンパイルするとき用の Makefile です。
GHC=stack --resolver ghc-8.0.1 --install-ghc ghc --package random --package network -- -XFlexibleContexts
TARGETS=reversi-serv
TARGETC=reversi
SRCS=Play.hs Command.hs
all: $(TARGETS) $(TARGETC)
$(TARGETS): Server.hs $(SRCS)
$(GHC) -O --make -o $(TARGETS) Server.hs
@nekketsuuu
nekketsuuu / SMLsharp-3.3.0-log
Last active August 2, 2017 10:13
SML# 3.3.0 を MassiveThreads がインストールされていない環境において --without-massivethreads オプション付きでコンパイルしたときにリンカのエラーが起こるログです
root@fdd452650efa:~/smlsharp-3.3.0# PATH=/usr/lib/llvm-3.7/bin:$PATH ./configure --without-massivethreads
checking build system type... x86_64-pc-linux-gnu
checking host system type... x86_64-pc-linux-gnu
checking target system type... x86_64-pc-linux-gnu
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Docomoの雑談対話APIを使ってチャットできるスクリプト (Python 3)
# https://ja.stackoverflow.com/q/37648/19110
import sys
import urllib.request
import json
import os
$ sudo ./docker-run.sh kennel
root@nek:/var/work/kennel# ./install.sh
+++ pwd
++ CURRENT_DIR=/var/work/kennel
++++ dirname ./install.sh
+++ cd .
+++ pwd
++ BASE_DIR=/var/work/kennel
+ PREFIX=/opt/wandbox/kennel
+ cd /root/