Artificial intelligence (AI) is everywhere, promising self-driving cars, medical breakthroughs, and new ways of working. But how do you separate hype from reality? How can your company apply AI to solve real business problems?
Here’s what AI learnings your business should keep in mind for 2017.
Study: The Future of VR, AR and Self-Driving CarsLinkedIn
We asked LinkedIn members worldwide about their levels of interest in the latest wave of technology: whether they’re using wearables, and whether they intend to buy self-driving cars and VR headsets as they become available. We asked them too about their attitudes to technology and to the growing role of Artificial Intelligence (AI) in the devices that they use. The answers were fascinating – and in many cases, surprising.
This SlideShare explores the full results of this study, including detailed market-by-market breakdowns of intention levels for each technology – and how attitudes change with age, location and seniority level. If you’re marketing a tech brand – or planning to use VR and wearables to reach a professional audience – then these are insights you won’t want to miss.
Artificial intelligence (AI) is everywhere, promising self-driving cars, medical breakthroughs, and new ways of working. But how do you separate hype from reality? How can your company apply AI to solve real business problems?
Here’s what AI learnings your business should keep in mind for 2017.
Study: The Future of VR, AR and Self-Driving CarsLinkedIn
We asked LinkedIn members worldwide about their levels of interest in the latest wave of technology: whether they’re using wearables, and whether they intend to buy self-driving cars and VR headsets as they become available. We asked them too about their attitudes to technology and to the growing role of Artificial Intelligence (AI) in the devices that they use. The answers were fascinating – and in many cases, surprising.
This SlideShare explores the full results of this study, including detailed market-by-market breakdowns of intention levels for each technology – and how attitudes change with age, location and seniority level. If you’re marketing a tech brand – or planning to use VR and wearables to reach a professional audience – then these are insights you won’t want to miss.
15. 2013年 12月 8日
第6回福岡市西区プログラム勉強会
caseクラス
• newキーワードが不要
• toString, hashCode, equalsの自動実装
case class Person(val name: String, val age: Int)
scala> val p1 = Person("John", 20)
p1: Person = Person(John,20)
class Person(val name: String, val age: Int)
scala> val p1 = new Person("John", 20)
p1: Person = Person@32076ee4
15
16. 2013年 12月 8日
第6回福岡市西区プログラム勉強会
16
require文
• インスタンス生成時に引数チェックが可能
• 条件を満たさないと”IllegalArgumentException”を出す
case class Person(val name: String, private var age: Int = 20) {
require(name != "")
require(age > 0)
}
20. 2013年 12月 8日
第6回福岡市西区プログラム勉強会
パターンマッチ
• 非常に強力なマッチング
• 複数の選択肢から一つを選択
• _(アンダースコア)でdefaultの働き
• 値を返す
• 定数マッチ
val str = readLine
val msg = str match {
case "hello" => str + " world"
case "welcome" => str + " to scala"
case _ => "wrong"
}
println(msg)
20
21. 2013年 12月 8日
第6回福岡市西区プログラム勉強会
パターンマッチ
• コンストラクターパターン
• クラスメンバーまでチェック
object MatchSample {
def main(args: Array[String]): Unit = {
val p1: Any = Person(“John”, 20)
p1 match {
case Person(“John”, _) => println(“He is John”)
case Person => println(“Person”)
}
}
}
case class Person(name: String, age: Int)
21
22. 2013年 12月 8日
第6回福岡市西区プログラム勉強会
22
パターンマッチ
• 型付きパターン
• case 変数名: 型名 => { }
• キャストの代用
object MatchSample {
def main(args: Array[String]): Unit = {
val p1: Any = Person("John", 20)
p1 match {
case person: Person => println("Person " + person.name)
case animal: Animal => println("Animal is" + animal.aType)
}
}
}
case class Person(name: String, age: Int)
case class Animal(name: String, aType: String)
23. 2013年 12月 8日
第6回福岡市西区プログラム勉強会
23
パターンマッチ
• パターンガード
• マッチした後にさらに条件を加える
object MatchSample {
def main(args: Array[String]): Unit = {
val p1: Any = Person("John", 20)
p1 match {
case person: Person if person.name == "John" => {
println("John " + person.age)
}
case person: Person => println("Person " + person.name)
case animal: Animal => println("Animal is" + animal.aType)
}
}
}
case class Person(name: String, age: Int)
case class Animal(name: String, aType: String)
29. 第6回福岡市西区プログラム勉強会
2013年 12月 8日
リスト操作
• sum
要素の合計
scala> (1 to 10).sum
res1: Int = 55
• product
要素の積
scala> (1 to 10).product
res2: Int = 3628800
• min
最小要素
scala> (1 to 10).min
res3: Int = 1
• max
最大
scala> (1 to 10).max
res4: Int = 10
29