cat

js面向对象编程-构建对象

匿名 (未验证) 提交于 2019-12-03 00:32:02
<script> //工厂模式:会出现不能查看实体对象是谁的实例化 function CreatObj ( name , age ){ var obj = new Object () obj . name = name obj . age = age obj . say = function (){ alert ( this . name + this . age + "hello" ) } return obj } var cat1 = CreatObj ( 'cat' , 6 ) var dog = CreatObj ( 'dog' , 8 ) cat1 . say () dog . say () //构造函数:解决实体是谁的实例化对象 function CreatObj ( name , age ){ this . name = name this . age = age this . say = function (){ alert ( this . name + this . age + "hello" ) } } var cat1 = new CreatObj ( 'cat' , 6 ) var dog = new CreatObj ( 'dog' , 8 ) cat1 . say () dog . say () /*区别:工厂要return ;构造函数自动返回

Keras学习教程七

匿名 (未验证) 提交于 2019-12-03 00:27:02
原文地址: https://nbviewer.jupyter.org/github/fchollet/deep-learning-with-python-not… 使用带有小数据集的网点 在小数据集上从头开始训练一个convnet 深度学习对于小数据问题的相关性 但更重要的是,深度学习模式在本质上是高度可重复使用的:您可以采用例如大规模数据集上训练的图像分类或语音 - 文本模型,然后在极其不同的问题上重用它,只需稍作更改即可。具体而言,在计算机视觉的情况下,许多预先训练的模型(通常在ImageNet数据集上进行培训)现在已公开可供下载,并且可用于以非常少的数据引导强大的视觉模型。这就是我们将在下一节中做的。 下载数据 www.kaggle.com/c/dogs-vs-cats/data (如果您还没有帐户,则需要创建一个Kaggle帐户 - 不要担心 ,这个过程是无痛的)。 import os, shutil # The path to the directory where the original # dataset was uncompressed original_dataset_dir = '/Users/fchollet/Downloads/kaggle_original_data' # The directory where we will # store our

Pytorch-拼接与拆分

匿名 (未验证) 提交于 2019-12-03 00:11:01
引言 本篇介绍tensor的拼接与拆分。 cat stack split chunk cat numpy中使用concat,在pytorch中使用更加简写的 cat 完成一个拼接 两个向量维度相同,想要拼接的维度上的值可以不同,但是其它维度上的值必须相同。 举个例子:还是按照前面的,想将这两组班级的成绩合并起来 a[class 1-4, students, scores] b[class 5-9, students, scores] 12345 In [ 4 ]: a = torch . rand ( 4 , 32 , 8 ) In [ 5 ]: b = torch . rand ( 5 , 32 , 8 ) In [ 6 ]: torch . cat ([ a , b ], dim = 0 ). shapeOut [ 6 ]: torch . Size ([ 9 , 32 , 8 ])# 结果就是 9 个班级的成绩 理解cat: 行拼接:[4, 4] 与 [5, 4] 以 dim=0(行)进行拼接 ―> [9, 4] 9个班的成绩合起来 列拼接:[4, 5] 与 [4, 3] 以 dim=1(列)进行拼接 ―> [4, 8] 每个班合成8项成绩 例2: 1234567891011121314 In [ 7 ]: a1 = torch . rand ( 4 , 3 , 32 ,

查看cuda和cudnn版本

匿名 (未验证) 提交于 2019-12-03 00:09:02
cuda 版本 cat / usr / local / cuda / version . txt cudnn 版本 cat / usr / local / cuda / include / cudnn . h | grep CUDNN_MAJOR - A 2 来源:51CTO 作者: 恋上萤火 链接:https://blog.csdn.net/weixin_43826596/article/details/101061903

Oracle导出表不导出数据默认为空表的解决方法

匿名 (未验证) 提交于 2019-12-03 00:09:02
原因: Oracle11g默认对空表不分配segment, 1.查出空白 select 'alter table '||table_name||' allocate extent;' from user_tables where num_rows=0; 2执行语句 来分配segment 3使用exp语句导出就可以了 来源:51CTO 作者: kevin_cat 链接:https://blog.csdn.net/kevin_cat/article/details/101062205

13、生命周期-InitializingBean和DisposableBean

匿名 (未验证) 提交于 2019-12-03 00:05:01
package com . lei . study_09_15 . bean ; import org . springframework . beans . factory . DisposableBean ; import org . springframework . beans . factory . InitializingBean ; /** * * * @author LeiLei * @date 2019/9/15 */ public class Cat implements InitializingBean , DisposableBean { public Cat () { System . out . println ( "Cat.Cat" ); } public void destroy () throws Exception { System . out . println ( "Cat.destroy" ); } /** * 相当于init方法 * @throws Exception */ public void afterPropertiesSet () throws Exception { System . out . println ( "Cat.afterPropertiesSet" ); } } 总结: 1.容器初始化管理用实现接口的方式来实现

R 文件读写

匿名 (未验证) 提交于 2019-12-02 23:57:01
cat()函数同样可以用来写入文件,一次写入一部分。 第一次调用cat()时在指定目录下创建了文件writeCAT.txt,包含一行内容”abc”。第二次调用追加了第二行,这个文件会在每一次操作之后自动保存。cat()函数可以写多个字段,上面最后一行的代码会生成只有一行内容的文件writeCAT.txt。 还可以使用writeLines()函数,它是readLines()的相对。如果用的是连接,则必须设定参数“w”来指明是要写文件而非读取。 来源:博客园 作者: 若流芳千古 链接:https://www.cnblogs.com/shanyr/p/11461115.html

centos 7 修改sshd | 禁止 root登录及脚本定义

匿名 (未验证) 提交于 2019-12-02 23:57:01
1.新建用户wwweee000 [root@localhost ~]# useradd wwweee000 [root@localhost ~]# passwd wwweee000 Changing password for user wwweee000. New password: BAD PASSWORD: The password is a palindrome Retype new password: passwd: all authentication tokens updated successfully. 2. #Port 22字段删掉,将22改为其他不被使用的端口, 服务器端口最大可以开到65536.//注意Port是大写的"P" [root@localhost ~]# cat -n /etc/ssh/sshd_config|grep "Port *" 17 #Port 22 100 #GatewayPorts no [root@localhost ~]# cat /etc/ssh/sshd_config|grep -n "Port *" 17:#Port 22 100:#GatewayPorts no [root@localhost ~]# awk "/Port */" /etc/ssh/sshd_config #Port 22 #GatewayPorts no

scala 型变

匿名 (未验证) 提交于 2019-12-02 23:56:01
型变是复杂类型的子类型关系与其组件类型的子类型关系的相关性。 Scala支持 泛型类 的类型参数的型变注释,允许它们是协变的,逆变的,或在没有使用注释的情况下是不变的。 在类型系统中使用型变允许我们在复杂类型之间建立直观的连接,而缺乏型变则会限制类抽象的重用性。 class Foo [+ A ] // A covariant class class Bar [- A ] // A contravariant class class Baz [ A ] // An invariant class 协变 使用注释 +A ,可以使一个泛型类的类型参数 A 成为协变。 对于某些类 class List[+A] ,使 A 成为协变意味着对于两种类型 A 和 B ,如果 A 是 B 的子类型,那么 List[A] 就是 List[B] 的子类型。 这允许我们使用泛型来创建非常有用和直观的子类型关系。 考虑以下简单的类结构: abstract class Animal { def name : String } case class Cat ( name : String ) extends Animal case class Dog ( name : String ) extends Animal 类型 Cat 和 Dog 都是 Animal 的子类型。 Scala

HDU-1501-Zipper-字符串的dfs

匿名 (未验证) 提交于 2019-12-02 23:49:02
Given three strings, you are to determine whether the third string can be formed by combining the characters in the first two strings. The first two strings can be mixed arbitrarily, but each must stay in its original order. For example, consider forming "tcraete" from "cat" and "tree": String A: cat String B: tree String C: tcraete As you can see, we can form the third string by alternating characters from the two strings. As a second example, consider forming "catrtee" from "cat" and "tree": String A: cat String B: tree String C: catrtee Finally, notice that it is impossible to form "cttaree