Skip to content

Instantly share code, notes, and snippets.

@idkqh7
idkqh7 / main.go
Last active August 29, 2015 14:10
Go言語のインターフェースを味わう(Factory関数使わない版)
package main
import "fmt"
func main() {
s := Super{}
fmt.Println(s.Get())
//基底クラスのgetから派生クラスの関数をオーバーライドして呼び出すことはできない
t := Sub{}
fmt.Println(t.Get())
@idkqh7
idkqh7 / main.go
Last active August 29, 2015 14:10
Goのインターフェースを味わうサンプル
package main
import "fmt"
func main() {
s := Impl{NewSuper("Super!")}
fmt.Println(s.Get())
//実装クラスのgetから派生クラスのメソッドを呼び出す
i := Impl{NewSub("Sub!")}
fmt.Println(i.Get())
@idkqh7
idkqh7 / main.py
Last active August 29, 2015 14:10
Python3のオーバーライドを味わうサンプル
class Base:
def __init__(self, str):
self.str = str
def make_string(self):
return "Hi, " + self.str
def get(self):
return self.make_string()
@idkqh7
idkqh7 / main.go
Last active August 29, 2015 14:10
Go言語のオーバーライドを味わうサンプル
package main
import "fmt"
func main() {
s := NewSuper("Super!")
fmt.Println(s.Get())
//基底クラスのgetから派生クラスのメソッドをオーバーライドして呼び出すことはできない
t := NewSub("Sub!")
fmt.Println(t.Get())
sudo sh -c 'echo "deb http://jp.archive.ubuntu.com/ubuntu/ precise main universe" >> /etc/apt/sources.list'
sudo sh -c 'echo "deb-src http://jp.archive.ubuntu.com/ubuntu/ precise main universe" >> /etc/apt/sources.list'
sudo dpkg --add-architecture armhf
dpkg --print-foreign-architectures
# i386
# armhf
# HACK : I don't want to touch sources.list
# apt-get updateの404が気にならない人は実行しなくても問題なし
# CUDA 6.0 Toolkit for L4T Rel
# https://developer.nvidia.com/jetson-tk1-support
# ダウンロードにはCUDA Registered Developer Programへの参加(登録)が必要
# debインストールのために時刻合わせ
sudo ntpdate ntp.nict.jp
date
sudo dpkg -i ~/Downloads/cuda-repo-l4t-r19.2_6.0-42_armhf.deb
sudo apt-get update
sudo apt-get install cuda-samples-6-0 cuda-toolkit-6-0
cd ~/NVIDIA-INSTALLER
sudo ./installer.sh
sudo reboot
@idkqh7
idkqh7 / enable_universe_repo.patch
Created September 14, 2014 08:20
Enable universe repository for Jetson TK1
--- sources.list 2000-02-01 11:19:01.619500826 +0000
+++ sources.list 2000-02-01 11:19:54.623500813 +0000
@@ -14,10 +14,10 @@
## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
## team. Also, please note that software in universe WILL NOT receive any
## review or updates from the Ubuntu security team.
-# deb http://ports.ubuntu.com/ubuntu-ports/ trusty universe
-# deb-src http://ports.ubuntu.com/ubuntu-ports/ trusty universe
-# deb http://ports.ubuntu.com/ubuntu-ports/ trusty-updates universe
-# deb-src http://ports.ubuntu.com/ubuntu-ports/ trusty-updates universe
sudo apt-get install texworks
wget https://gist.github.com/idkqh7/369ec0fc915fcbbee559/raw/updflatex
chmod +x updflatex
sudo mv updflatex /usr/local/bin/
wget https://gist.github.com/idkqh7/ea94620ec6c5951bef30/raw/addupdflatex.py
python3 addupdflatex.py
rm addupdflatex.py
#!/bin/sh
uplatex -synctex=1 "$1" && \
dvipdfmx "`basename "$1" .tex`"