今天我们来学习下如何用for表达式在scala中做查询。先来看看示例代码case class Book(title:String,authors:List[String])object text_87 { def main(args:Array[String]){ val books:List[.....
分类:
其他好文 时间:
2015-08-17 23:20:12
阅读次数:
184
学习了Scala中For表达式的生成器、定义和过滤器,应用 for是循环列表,根据用户需要进行过滤。Def main(args:Array[String]){ Val lauren=Person(“Lauren”,false) Val rocky=Person(“Rocky”,true) Val v...
分类:
其他好文 时间:
2015-08-17 23:11:20
阅读次数:
134
package com.leegh.dataset/** * @author Guohui Li */object List_FirstOrder_Ops { def main(args: Array[String]): Unit = { println(List(1, 2, 3, 4) :...
分类:
其他好文 时间:
2015-08-17 08:45:59
阅读次数:
388
今天我们来看一下For表达式中的生成器,定义和过滤等内容。让我们来看下代码def main(args:Array[String]){ val lauren = Persons("Lauren",false) val rocky = Persons("Rocky",true) val vivian =...
分类:
其他好文 时间:
2015-08-17 00:46:33
阅读次数:
210
package com.leegh.dataset/** * @author Guohui Li */object HelloList { def main(args: Array[String]): Unit = { val bigData = List("Hadoop", "Spark"...
分类:
编程语言 时间:
2015-08-16 09:21:02
阅读次数:
119
package com.leegh.pattern_match/** * @author Guohui Li */object Option_Internal { def main(args: Array[String]): Unit = { val scores = Map("Alice"...
分类:
其他好文 时间:
2015-08-15 10:13:32
阅读次数:
106
problem:Given two string, write a method to decide if one is a permutation of the otherSolution:1. sort two strings and return weather str1 equal to s...
分类:
其他好文 时间:
2015-08-15 06:45:36
阅读次数:
139
problem:Implement a function void reverse(char *str) in C and C++ which reverse a null-terminated string.The solution:1. use another pointer end point...
分类:
其他好文 时间:
2015-08-15 06:42:04
阅读次数:
147
今天来学一下scala中的For表达式的用法。package scala.learncase class Persons(name:String,isMale:Boolean,children:Persons*)object Test_85 { def main(args:Array[String]...
分类:
其他好文 时间:
2015-08-15 01:32:34
阅读次数:
159
Promble:Implement an algorithm to determine if a string has all unique characters. What if you cannot use addtional data structure?My solution:1.ckeck...
分类:
其他好文 时间:
2015-08-15 01:29:27
阅读次数:
106