01 2022 档案
摘要:hadoopHadoop是一个由Apache基金会所开发的分布式系统基础架构。 用户可以在不了解分布式底层细节的情况下,开发分布式程序。充分利用集群的威力进行高速运算和存储。 Hadoop实现了一个分布式文件系统(Hadoop Distributed File System ,HDFS)。HDFS
阅读全文
摘要:1 package chapter08 2 3 object Test03_MatchTupleExtend { 4 def main(args: Array[String]): Unit = { 5 // 1. 在变量声明时匹配 6 val (x, y) = (10, "hello") 7 pri
阅读全文
摘要:1 package chapter08 2 3 object Test02_MatchTypes { 4 def main(args: Array[String]): Unit = { 5 // 1. 匹配常量 6 def describeConst(x: Any): String = x matc
阅读全文
摘要:1 package chapter07 2 3 object Test18_ComplexWordCount { 4 def main(args: Array[String]): Unit = { 5 val tupleList: List[(String, Int)] = List( 6 ("he
阅读全文
摘要:1 package chapter07 2 3 object Test17_CommonWordCount { 4 def main(args: Array[String]): Unit = { 5 val stringList: List[String] = List( 6 "hello", 7
阅读全文
摘要:1 package chapter07 2 3 object Test15_HighLevelFunction_Reduce { 4 def main(args: Array[String]): Unit = { 5 val list = List(1,2,3,4) 6 7 // 1. reduce
阅读全文
摘要:1 package chapter07 2 3 object Test14_HighLevelFunction_Map { 4 def main(args: Array[String]): Unit = { 5 val list = List(1,2,3,4,5,6,7,8,9) 6 7 // 1.
阅读全文
摘要:1 package chapter07 2 3 object Test10_Tuple { 4 def main(args: Array[String]): Unit = { 5 // 1. 创建元组 3元祖就是有3个元素 6 val tuple: (String, Int, Char, Boole
阅读全文
摘要:1 package chapter07 2 3 import scala.collection.mutable 4 5 object Test09_MutableMap { 6 def main(args: Array[String]): Unit = { 7 // 1. 创建map 8 val m
阅读全文
摘要:1 package chapter07 2 3 object Test08_ImmutableMap { 4 def main(args: Array[String]): Unit = { 5 // 1. 创建map 使用伴生对象( ) Map默认就是Immutable.Map不可变 6 val m
阅读全文
摘要:1 package chapter07 2 3 import scala.collection.mutable 4 5 object Test07_MutableSet { 6 def main(args: Array[String]): Unit = { 7 // 1. 创建setmutable.
阅读全文
摘要:1 package chapter07 2 3 object Test06_ImmutableSet { 4 def main(args: Array[String]): Unit = { 5 // 1. 创建set 直接使用括号() apply的作用 6 val set1 = Set(13, 23
阅读全文
摘要:1 package chapter07 2 3 import scala.collection.mutable.ListBuffer 4 5 object Test05_ListBuffer { 6 def main(args: Array[String]): Unit = { 7 // 1. 创建
阅读全文
摘要:1 package chapter07 2 3 object Test04_List { 4 def main(args: Array[String]): Unit = { 5 // 1. 创建一个List 6 val list1 = List(23, 65, 87) 7 println(list1
阅读全文
摘要:1 package chapter07 2 3 import scala.collection.mutable 4 import scala.collection.mutable.ArrayBuffer 5 6 object Test02_ArrayBuffer { 7 def main(args:
阅读全文
摘要:1 package chapter07 2 3 object Test01_ImmutableArray { 4 def main(args: Array[String]): Unit = { 5 // 1. 创建数组 6 val arr: Array[Int] = new Array[Int](5
阅读全文
摘要:(1)obj.isInstanceOf[T]:判断 obj 是不是 T 类型。 (2)obj.asInstanceOf[T]:将 obj 强转成 T 类型。 (3)classOf 获取对象的类名。 1 package chapter06 2 3 object Test17_Extends { 4 d
阅读全文
摘要:1 package chapter06 2 3 object Test16_TraitSelfType { 4 def main(args: Array[String]): Unit = { 5 val user = new RegisterUser("alice", "123456") 6 use
阅读全文
摘要:1 package chapter06 2 3 object Test13_Trait { 4 def main(args: Array[String]): Unit = { 5 val student: Student13 = new Student13 6 student.sayHello()
阅读全文
摘要:一、包 1 package com{ 2 3 import com.atguigu.scala.Inner 4 5 // 在外层包中定义单例对象 6 object Outer{ 7 var out: String = "out" 8 9 def main(args: Array[String]):
阅读全文
摘要:1 package com.atguigu.chapter04 2 3 object Test_Lazy { 4 def main(args: Array[String]): Unit = { 5 lazy val result : Int = sum(13,12) 6 println("1. 函数
阅读全文
摘要:1 package com.atguigu.function 2 3 object Recursion { 4 def main(args: Array[String]): Unit = { 5 // 阶乘 6 // 递归算法 7 // 1) 方法调用自身 8 // 2) 方法必须要有跳出的逻辑 9
阅读全文
摘要:1 package com.atguigu.chapter04 2 3 object ControlAbstraction { 4 def main(args: Array[String]): Unit = { 5 //1. 传值参数(传递计算后的值) 6 def f0(a:Int):Unit =
阅读全文
摘要:1 package com.atguigu.function 2 3 object HighFunction { 4 def main(args: Array[String]): Unit = { 5 /* val fun = (x: Int, y: String, z: Char) => { 6
阅读全文
摘要:一、痛点 解决交通拥堵的问题 减少交通事故带来的损失 目前的技术方案无法精准满足个人出行需求,无法实现可控出行。 二、用户需求 智能信号灯控制 控制交通信号灯疏导交通 实现自动识别汽车 实现对违法车辆进行分析和预警 实现智能监控中心大屏数据可视化(且移动端可控PC端) 三、业务需求 能够用人工智能技
阅读全文
摘要:报任少卿书 / 报任安书 司马迁 太史公牛马走司马迁,再拜言。 少卿足下:曩者辱赐书,教以慎于接物,推贤进士为务,意气勤勤恳恳。若望仆不相师,而用流俗人之言,仆非敢如此也。仆虽罢驽,亦尝侧闻长者之遗风矣。顾自以为身残处秽,动而见尤,欲益反损,是以独郁悒而无谁语。谚曰:“谁为为之?孰令听之?”盖钟子期
阅读全文
摘要:文件内容 处理结果 代码 1 import pandas as pd 2 import pymysql 3 4 5 def get_subject_1992(): 6 res={} 7 the_former_code = "" 8 layer1_code = "" # 一位 9 layer1_nam
阅读全文
摘要:国家统计局->统计标准网址:http://www.stats.gov.cn/tjsj/tjbz/tjyqhdmhcxhfdm/ 获取资源请关注公众号 【靠谱杨阅读人生】回复【城乡分类】获取 流程简介 对统计标准的网站进行分层分级爬取: 代码 import pymysql from bs4 impor
阅读全文
摘要:1)说明 没有名字的函数就是匿名函数。(x:Int)=>{函数体}x:表示输入参数类型;Int:表示输入参数类型;函数体:表示具体代码逻辑 2)案例实操 需求 1:传递的函数有一个参数传递匿名函数至简原则:(1)参数的类型可以省略,会根据形参进行自动的推导(2)类型省略之后,发现只有一个参数,则圆括
阅读全文
摘要:(1)return 可以省略,Scala 会使用函数体的最后一行代码作为返回值(2)如果函数体只有一行代码,可以省略花括号(3)返回值类型如果能够推断出来,那么可以省略(:和返回值类型一起省略)(4)如果有 return,则不能省略返回值类型,必须指定(5)如果函数明确声明 unit,那么即使函数体
阅读全文
摘要:一、采用 Scala 自带的函数,退出循环 1 package com.atguigu.break 2 3 object TestBreak { 4 import scala.util.control.Breaks 5 def main(args: Array[String]): Unit = {
阅读全文

浙公网安备 33010602011771号