- python3, pip, pyenv, virtualenv, autoenv, elpy
- django
- python emacs editor
$ cd ~
$ wget https://dl.google.com/go/go$VERSION.$OS-$ARCH.tar.gz
$ sudo tar -C /usr/local -xzf go$VERSION.$OS-$ARCH.tar.gz
$ echo $JAVA_HOME
$ javac -version
javac 1.8.0_161
$ which javac
/usr/bin/javac
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Foundation | |
struct board<T> { | |
let w: Int | |
let h: Int | |
var board: [T] | |
init(w: Int, h: Int, v: T) { | |
self.w = w | |
self.h = h | |
self.board = [T].init(repeating: v, count: w*h) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Foundation | |
let s = "Hello, World!" | |
print(s) | |
// string -> string array | |
var a = s.map { String($0) } | |
print(a) | |
// string array -> string |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Foundation | |
var A = [4, 10, 14, 7, 9, 3, 2, 8, 1, 16] | |
func left(_ i: Int) -> Int { | |
return i * 2 + 1 | |
} | |
func right(_ i: Int) -> Int { | |
return i * 2 + 1 + 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
extension String { | |
var ascii: Int { | |
return Int(unicodeScalars.first!.value) | |
} | |
} | |
extension Int { | |
var toString: String { | |
return String(UnicodeScalar(self)!) | |
} | |
} |
OlderNewer