Yaohong

为了真相不惜被羞辱

Simple Tree command

Simple Tree command Using the follow command can view current folder tree: find . -print| sed -e 's;[^/]*/;|____;g;s;____|; |;g' output $ find . -print| sed -e 's;[^/]*/;|____;g;s;____|; |;g' . |____composer.lock |____LICENSE |____README.md |____.gitignore |____build-phar.php |____.git | |____config | |____objects ... Below command only descend at most 2 directory levels: find . -maxdepth 2 -e -print | sed -e 's;[^/]*/;|____;g;s;____|; |;g' REFERENCE Using a Mac Equivalent of Unix “tree” Command to View Folder Trees at Terminal

Categorical Crossentropy源码分析

Categorical Crossentropy源码分析 Source: import tensorflow as tf import numpy as np sess = tf.InteractiveSession() print("--------output-----------") target = tf.constant([1., 0., 0., 0., 1., 0., 0., 0., 1.], shape=[3,3]) print("target: \n",target.eval()) output = tf.constant([.9, .05, .05, .05, .89, .06, .05, .01, .94], shape=[3,3]) print("output:\n",output.eval()) loss = tf.keras.backend.categorical_crossentropy(target, output) print("loss: \n",loss.eval()) # Output: [0.10536 0.11653 0.06188] 官方

Config Github with SSH

Config Github with SSH Generating a new SSH key 1.Open TerminalTerminalGit Bash. 2.Paste the text below, substituting in your GitHub email address. $ ssh-keygen -t ed25519 -C "your_email@example.com" 3.Then you’re prompted to do something, press Enter. Then the keys will be saved under ~/.ssh folder. You can use ls -al ~/.ssh command to see them. LOG: $ ssh-keygen -t ed25519 -C "my_email@example.com" Generating public/private ed25519 key pair. Enter file in which to save the key (/c/Users/myusername/.

Quickly host your hugo web on Gitlab

Quickly host your hugo web on Gitlab Quickly host your hugo web on gitlab. 1.Login gitlab Gitlab 2.click new project after login Click Create from template in Create new project and use “Hugo template” In this example, my project name is: testPage Now you can see your username on Project URL, for example, mine is https://gitlab.com/RhysYao/, and username is RhysYao which will be used later. 3.Edit config.toml and commit Change the baseurl https://pages.

telnet

Telnet telnet host post 示例: [yaohong@host ~]# telnet www.baidu.com 80 Trying 14.215.177.38... Connected to www.baidu.com. Escape character is '^]'. 出现Connected to表示连接上主机; [yaohong@host ~]# telnet www.baidu.com 882 Trying 14.215.177.38... telnet: connect to address 14.215.177.38: Connection timed out Trying 14.215.177.39... 没有出现Connect

SSLCertVerificationError报错

双击执行Applications > Python3.6 下的Install Certificates.command

SSLCertVerificationError报错 Error: ssl.SSLCertVerificationError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1091) Solution: 环境:Mac Macintosh HD > Applications > Python3.6 (或者其它安装python目录) 然

简单的图像加宽和截取类

支持图像加宽高,或截掉宽高

简单的图像加宽和截取类 源码如下: class ImageUtils: def __init__(self): import numpy; self.np = numpy; pass ## def resizePadding(self, np_2d_image, target_width,target_height): single_img = np_2d_image; tmp_img_width = single_img.shape[1] tmp_img_height = single_img.shape[0] np = self.np print("resizeFile origin shape :",single_img.shape) # 宽度pading添加 if tmp_img_width < target_width: for x in range(tmp_img_width, target_width): # tmp_arr =

一条微信消息在网络层的历程

简单理解网络模型

一条微信消息在网络层的历程 当我们向朋友发送一条微信文字消息时,我们的操作仅仅是让手机连上网,通过连接WIFI或使用移动网络,然后在手机上打字

PHP autoload

更新中...

php autoload In general, when we use a file which not include in current file, we need to load it in current file by using require or include; But when a project has a lot of php files, it is not a good way to include each file manually. Let’s see a simple code: <?php $person = new Person("Rhys", 20); var_dump($person); There is a new class Person which didn’t be

JAVA 序列化

JAVA 序列化 Java编译过程 Java源码-> javac将源码转换成class 文件->java命令执行 class 文件; 方法中的“T”用途是什么

深度学习-第一个数字识别项目

深度学习的步骤过程

深度学习-第一个数字识别项目 今天按Google官方推荐流程,整理了开发模板,不是所有深度学习都严格按这个模板来实现,不同项目步骤有所删减,但

深度学习的历史(一)

更新中...

深度学习的历史(一) 深度学习的主要突破是从2011年开始,开始超越其它算法成为主流也是从这个时间开始,因此我们有必要先了解从2011年开始的

Echo set color

Echo set color 先看例子:echo -e "\033[32m Hello world \033[0m"; 会输出 $echo -e "\033[32m Hello world \033[0m" Hello world # 绿色的文字 其中: -e表示解析逃逸字符(Escape character),逃逸字符为

How to use CleanWhite Hugo Theme?

How to use CleanWhite Hugo Theme? CleanWhite Hugo Theme 是Huabing Zhao制作的hugo主题,非常高雅好用,再次感谢Huabing。 我在使用时,花了一点时间,主要遇到以下问