cat

面向对象

邮差的信 提交于 2019-12-01 05:10:21
面向对象笔记总结,随时查询 面向对象 类和对象 类是抽象的,是一个模板,确定对象将会拥有的特征(属性)和行为(方法) 对象是实体,是类的实例表现 属性和方法 属性:对象具有的各种静态特征 方法:对象具有的各种动态行为 命名 包的命名为 域名小写字母的倒序 加上 功能名 类名首字母要大写 实例化对象 12345678 public class { String name; public void run() { System.out.println("run"); }} 12345 public static void main(String[] args) { Cat one = new Cat(); // 声明并实例化对象 System.out.println(one.name); // 获取类中的对象 one.run(); // 获取类中的方法} new 每次new都会开辟一个新空间,不会相互影响 123 Cat one = new Cat(); Cat two = one; // 此时one和two都指向通过一个堆内地址,会相互影响 构造方法 构造方法与类同名但是没有返回值 在对象实例化的时候调用 一个类中可以有多个构造方法 无参构造方法 不写构造方法,系统默认创建一个无参构造方法,自己创建带参构造方法,系统将再自动创建无参构造方法,需要自己手动创建 带参构造方法

echo from lines of a file

只愿长相守 提交于 2019-12-01 04:36:06
i have a file "myfile.txt" that have the next content: hola mundo hello word and i want work with every line for i in `cat myfile.txt`; do echo $i; done i hope this give me hola mundo hello word firts one line, then the other, but get hola mundo hello word as I can demanding results until newline instead of each space? ty all That's better cat myfile.txt | while read line; do echo "$line" done or even better (doesn't launch other processes such as a subshell and cat ): while read line; do echo "$line" done < myfile.txt If you prefer oneliners, it's obviously while read line; do echo "$line";

CAT Caterpillar ET is really a exceptional obd2 solution

不想你离开。 提交于 2019-12-01 02:52:40
As a excellent obd2 solutions, CAT Caterpillar ET Diagnostic Adapter features a potent function.it not just can Show “Logged Occasion Codes” to show engine more than speeds,Higher temperatures, fuel consumption but also can view ECM’s existing configuration and adjust user settings,perform diagnostic tests and calibrations, and calibrate.Electro-mechanical and electro-hydraulic elements . Is the Cat Comm III compatable using the computer software CAT Caterpillar ET 2011B Is this an actual caterpillar portion or even a knock off? Thanks.Yes, this is really the genuine CAT adapter, It’s also the

CAT Caterpillar ET is really a exceptional obd2 solution

左心房为你撑大大i 提交于 2019-12-01 02:51:15
As a excellent obd2 solutions, CAT Caterpillar ET Diagnostic Adapter features a potent function.it not just can Show “Logged Occasion Codes” to show engine more than speeds,Higher temperatures, fuel consumption but also can view ECM’s existing configuration and adjust user settings,perform diagnostic tests and calibrations, and calibrate.Electro-mechanical and electro-hydraulic elements . Is the Cat Comm III compatable using the computer software CAT Caterpillar ET 2011B Is this an actual caterpillar portion or even a knock off? Thanks.Yes, this is really the genuine CAT adapter, It’s also the

Scala Type Parameters 2

无人久伴 提交于 2019-11-30 23:49:04
类型关系 Scala 支持在泛型类上使用型变注释,用来表示复杂类型、组合类型的子类型关系间的相关性 协变 +T ,变化方向相同,通常用在生产 假设 A extends T , 对于 Clazz[+T] ,则 Clazz[A] 也可看做 Clazz[T] // 官网示例 abstract class Animal { def name: String } case class Cat(name: String) extends Animal case class Dog(name: String) extends Animal 由于 Scala 标准库中不可变 List 的定义为 List[+A] ,因此 List[Cat] 是 List[Animal] 的子类型, List[Dog] 也是 List[Animal] 的子类型,所以可直接将他们当作 List[Animal] 使用。 // 官网示例 object CovarianceTest extends App { def printAnimalNames(animals: List[Animal]): Unit = { animals.foreach { animal => println(animal.name) } } val cats: List[Cat] = List(Cat("Whiskers"), Cat("Tom"

Microsoft Security Catalog Format Documentation and API Samples

限于喜欢 提交于 2019-11-30 23:04:49
I'm looking for any documentation on the API for working with Microsoft Security Catalogs, or in lieu of that, information on the file format so that I may write my own parser. In short, I have some .cat files that I need to be able to work with. Looking at the file in a hex editor, they obviously have different regions, which are delimited somehow (looks like typical binary saved structs). I need to get certain information out of them, and ignore other information. I could probably reverse engineer the format and parse out what I need, but I'd prefer to do that either through the Win32 API,

linux查询日志命令总结

坚强是说给别人听的谎言 提交于 2019-11-30 21:41:55
【背景】 排查线上环境问题,少不了去线上查日志。而使用什么命令,能快速准确地查到我们需要查找地日志信息,也是我们需要掌握的一项技能。 【命令】 Linux查看命令有多种:tail,head,cat,tac,more (一) tail 命令 tail [ -f ] [ -c Number | -n Number | -m Number | -b Number | -k Number ] [ File ] 参数: 1)-f 循环读取 2)-q 不显示处理信息 3)-v 显示详细的处理信息 4)-c Number 从 Number 字节位置读取指定文件 5)-n Number 从 Number 行位置读取指定文件 6)-m Number 从 Number 多字节字符位置读取指定文件,比方你的文件假设包括中文字,假设指定-c参数,可能导致截断,但使用-m则会避免该问题 7)-b Number 从 Number 表示的512字节块位置读取指定文件。 8)-k Number 从 Number 表示的1KB块位置读取指定文件。 上述命令中,都涉及到number,假设不指定,默认显示10行。Number前面可使用正负号,表示该偏移从顶部还是从尾部開始计算。 应用: 命令 含义 tail -f test.log 查看实时日志 tail -100f test.log 查看最后100行日志记录 tail

Bash script: save stream from Serial Port (/dev/ttyUSB0) to file until a specific input (e.g. eof) appears

心已入冬 提交于 2019-11-30 20:51:46
I need a bash script to read the data stream from a Serial Port (RS232 to USB adapter - Port: /dev/ttyUSB0). The data should be stored line by line in a file until a specific input (for example "eof") appears. I can give any external input to the Serial Port. Till now I use cat to read the data, which works fine. cat /dev/ttyUSB0 -> file.txt The problem is, that I need to finish the command myself by entering cntr+C, but I don't know exactly when the data stream ends and the ttyUSB0 file does not gerenate an EOF. I tried to implement this myself, but did not find a convenient solution. The

cat命令合并多个txt文件

纵饮孤独 提交于 2019-11-30 18:14:42
cat是concatenate的缩写,意为串联。 cat命令两个常用的用法是: cat file1.txt file2.txt file3.txt > file_total.txt 命令可以将上面三个txt文件合并为一个名字为file_total.txt的文件 参考来源: https://www.cnblogs.com/yongjieShi/p/8512852.html cat是concatenate的缩写,意为串联。 cat命令两个常用的用法是: cat file1.txt file2.txt file3.txt > file_total.txt 命令可以将上面三个txt文件合并为一个名字为file_total.txt的文件 参考来源: https://www.cnblogs.com/yongjieShi/p/8512852.html 来源: https://www.cnblogs.com/bio-mary/p/11634485.html

数据分析之贝叶斯算法案例

时光怂恿深爱的人放手 提交于 2019-11-30 18:14:19
1.贝叶斯定理 是一个经典的条件概率定理,其在机器学习中主要用来通过结果推算出原因产生的概率。P(A/B)*P(B)=P(B/A)*P(A) 2.字符串分类案例 #案例:随机输入一个字符串,判定其最可能属于哪个类别? #若计算P(cat/str)=P(cat)*P(str/cat)/P(str) #由于P(str)概率相同,因此公式可以简化为:P(cat/str)=P(cat)*P(str/cat) cat1=["a","b","c","d","e","j"] cat2=["a","d","o","h","e"] cat3=["a","b","l","e","h","f"] a="abcd" def predict(str1): cat=[cat1,cat2,cat3] p={0:0,1:0,2:0} p1=[len(cat1)/26,len(cat2)/26,len(cat3)/26]#26个字母中出现的概率 for i in str1: for j in range(len(cat)): if i in cat[j]: p[j]+=1/len(cat[j])*p1[j] #在cat1中字符串产生的概率, return sorted(p.items(),key= lambda p:p[1],reverse=True ) if __name__ == '__main__':