- コンピュータは速くなったが、ソフトウェア開発は速くなっていない
- 依存性の管理はソフトウェア開発の多くを占める、しかしC言語のヘッダーでは高速に依存性を分析しづらい
- JavaやC++のような扱いにくい型システムをもつシステムより、PythonやJavaScriptなど動的片付け言語が使われている
- ガーベジコレクションや並列計算などの基本的なコンセプトのいくつかは一般的な言語で上手くサポートされていません
- マルチコアコンピュータの登場により、心配と混乱が生じた
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
package main | |
import ( | |
"bufio" | |
"errors" | |
"fmt" | |
"log" | |
"net/http" | |
"net/url" | |
"os" |
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
// 以下サイトの4.1.2RELEASEで動きます。 | |
// http://online.swiftplayground.run/ | |
import Foundation | |
enum ViewMode: Equatable { | |
case normal | |
case createPosition(CGPoint) | |
case editMode | |
var isCreatePosition: Bool { |
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
fun main(args: Array<String>){ | |
// Null安全 | |
/** | |
* p171 | |
* Javaにおけるnull | |
*/ | |
// Javaでは参照をデリファレンスした時にnullだとNPE(NullPointerException)が起きる |
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
// 05. n-gram | |
// 与えられたシーケンス(文字列やリストなど)からn-gramを作る関数を作成せよ.この関数を用い,"I am an NLPer"という文から単語bi-gram,文字bi-gramを得よ. | |
// 単語bi-gram | |
func q5_1(input: String, n: Int) -> [String] { | |
return wordNgram(input: input, n: n) | |
} | |
// 文字bi-gram | |
func q5_2(input: String, n: Int) -> [String] { | |
return charNgram(input: input, n: n) |
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
/** | |
* Created by koichitanaka on 2017/06/11. | |
*/ | |
fun <T> println(message: T) { | |
print(Thread.currentThread().stackTrace[2].lineNumber.toString() + "行目 ") | |
print(message) | |
print("\n") | |
} |
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
/** | |
* Created by koichitanaka on 2017/06/11. | |
*/ | |
fun <T> println(message: T) { | |
print(Thread.currentThread().stackTrace[2].lineNumber.toString() + "行目 ") | |
print(message) | |
print("\n") | |
} |
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
fun main(args: Array<String>) { | |
fun <T> println(message: T) { | |
print(Thread.currentThread().stackTrace[2].lineNumber.toString() + "行目 ") | |
print(message) | |
print("\n") | |
} | |
println("hi") | |
} |
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
// Implicitly unwrapped optionals are only allowed at top level and as function resultsの警告がでる。 | |
func a() -> (Int!, Int!) { | |
return (0,0) | |
} |
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
/// ArrayがEquatableに準拠してないね、という話の流れから生まれたArrayの比較が可能な関数 | |
func isEqual<T: Equatable>(_ x: Array<T>, _ y: Array<T>) -> Bool { | |
guard x.count == y.count else { | |
return false | |
} | |
return zip(x,y).reduce(true) { result, elements in | |
result && (elements.0 == elements.1) | |
} | |
} |