自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(75)
  • 资源 (1)
  • 收藏
  • 关注

转载 Notes for Concurrent Rendering in React - Andrew Clark and Brian Vaughn - React Conf 2018

Code-splitting components with lazy()import {lazy} from 'react'const Chart = lazy(() => import('./Chart'))// in the render part, use `Chart` as normalrender(){ return ( <div> // .....

2019-01-29 20:53:58 213

原创 saga笔记

function* mySaga(){ while(true){ const {payload} = yield take(action) yield call(func,...) // here, mySaga func cannot take actions until yield call finishes, so actions that are dispatched in...

2019-01-18 11:03:45 348

转载 [react] componentWillReceiveProps

componentWillReceiveProps陷阱componentWillReceiveProps() is invoked before a mounted component receives new props. If you need to update the state in response to prop changes (for example, to reset it...

2019-01-17 20:29:00 726

原创 jest mock storage

同一个文件中的tests是串行执行的用toHaveBeenCalledTimes断言调用构造函数的次数//hookSaga.js...const userStorage = new UserStorage()export function* loginHookSaga() {}export function* logoutHookSaga() {}export function* r...

2018-09-21 09:39:13 632

转载 redux入门

Ref: 阮一峰的网络日志安装安装稳定版:npm install --save redux附加包多数情况下,你还需要使用 React 绑定库和开发者工具。npm install –save react-redux npm install –save-dev redux-devtools设计思想Redux 的设计思想很简单,就两句话。 (1)Web 应...

2018-08-21 15:48:40 147

原创 git 常用操作速查

查看本地和远程分支 git branch -a在Git v1.7.0 之后,可以使用这种语法删除远程分支: git push origin --delete <remote_branch_name> 或者以下语法亦可:(相当于推一个空的分支到远端) git push origin :<remote_branch_name>提交分支数据到远程服务器:(此时可以生...

2018-06-29 14:39:06 115

原创 "merge" and "setIn" in seamless-immutable

seamless-immutableImmutable JS data structures which are backwards-compatible with normal Arrays and Objects.Use them in for loops, pass them to functions expecting vanilla JavaScript data structu...

2018-06-27 09:59:58 531

原创 React 入门

Learning from React.js 小书安装react.js全家桶 安装 React.js React.js 单独使用基本上是不可能的事情。不要指望着类似于 jQuery 下载放到 <head /> 标签就开始使用。使用 React.js 不管在开发阶段生产阶段都需要一堆工具和库辅助,编译阶段你需要借助 Babel;需要 Redux 等第三方的状态管理工...

2018-05-23 16:33:36 908

原创 ECMAScript 6 入门

Pre: 学习JavaScript摘要: - 合并两个数组 - concat() 如何使用 concat() 方法来合并两个数组。<html><body><script type="text/javascript">var arr = new Array(3

2018-05-21 15:41:42 246

转载 webpack 入门

ref:入门Webpack,看这篇就够了概念EntryOutputLoaderPlugins环境配置首先需要安装node.js安装webpack npm install webpack -g 全局安装然后再npm init, 之后会自动创建package.json文件或者可以选择安装到你的项目目录//安装到你的项目目录npm install -...

2018-05-10 20:23:44 331

原创 [Leetcode] 33. Search in Rotated Sorted Array

Problem Suppose an array sorted in ascending order is rotated at some pivot unknown to you beforehand.(i.e., 0 1 2 4 5 6 7 might become 4 5 6 7 0 1 2).You are given a target value to search. If f...

2018-02-28 23:04:43 135

原创 [Leetcode] 32. Longest Valid Parentheses

Problem: Given a string containing just the characters ‘(’ and ‘)’, find the length of the longest valid (well-formed) parentheses substring.For “(()”, the longest valid parentheses substring is “(...

2018-02-28 17:32:41 136

原创 [Leetcode] 31. Next Permutation

Problem:Implement next permutation, which rearranges numbers into the lexicographically next greater permutation of numbers.If such arrangement is not possible, it must rearrange it as the lowest ...

2018-02-26 23:52:04 115

原创 使用 `cat -e` 命令查看输出不支持的字符

有时候写了脚本,脚本语句没有问题,但是运行的时候却显示脚本语法错误 “syntax error”可以使用命令cat -e查出一些没显示出来的字符,这些字符通常不被linux支持: 我们可以看到 ^M 字符是正常情况下不会显示出来,但是会影响脚本的运行的。 正常的linux脚本应该是以$结尾的。 ...

2018-02-12 18:11:57 1068

原创 [Leetcode] 46. Permutations

ProblemGiven a collection of distinct numbers, return all possible permutations.For example, [1,2,3] have the following permutations: [ [1,2,3], [1,3,2], [2,1,3], [2,3,1],

2018-01-24 15:38:46 164

原创 Network Configuration for CentOS7 using VirtualBox on MAC

18 Jan 2018Just a workout from the Project “Build Wordpress Server with CentOS7“.[An old way]In the project of building Wordpress server, I config the network in VM with the following steps. There are

2018-01-18 18:40:34 227

转载 MySQL 使用方法

显示命令 1、显示数据库列表。 show databases; 刚开始时才两个数据库:mysql和test。mysql库很重要它里面有MYSQL的系统信息,我们改密码和新增用户,实际上就是用这个库进行操作。 2、显示库中的数据表: use mysql; //打开库,学过FOXBASE的一定不会陌生吧 show tables; 3、显示数据表的结构: describe 表名; 4、建库: create

2018-01-02 18:23:36 236

原创 Build Wordpress Server with CentOS7

DEC 27 2017 - DEC 29 2017Here is a work flow following the guidance [How To Install WordPress on CentOS 7].Environment: - Mac - Virtualbox Version 5.2.4 r119785 (Qt5.6.3) - CentOS 7 x86_64After ins

2017-12-29 11:51:35 374

原创 Learning Node.js

From 《Node.js 包教不包会》 – by alsotanglesson1包管理器 npmnpm 可以自动管理包的依赖. 只需要安装你想要的包, 不必考虑这个包的依赖包.在 PHP 中, 包管理使用的 Composer, python 中,包管理使用 easy_install 或者 pip,ruby 中我们使用 gem。而在 Node.js 中,对应就是 npm,npm 是 Node.js

2017-12-26 17:53:35 208

原创 [Leetcode] 194. Transpose File

Problem Given a text file file.txt, transpose its content.You may assume that each row has the same number of columns and each field is separated by the ’ ’ character.For example, if file.txt has the

2017-12-21 16:15:02 389

原创 [Leetcode] 192. Word Frequency

ProblemWrite a bash script to calculate the frequency of each word in a text file words.txt.For simplicity sake, you may assume:words.txt contains only lowercase characters and space ’ ’ characters.E

2017-12-21 11:42:17 222

原创 [Leetcode] 195. Tenth Line

Problem How would you print just the 10th line of a file?For example, assume that file.txt has the following content: Line 1 Line 2 Line 3 Line 4 Line 5 Line 6 Line 7 Line 8

2017-12-20 14:40:09 174

原创 [LeetCode] 193. Valid Phone Numbers

Problem Given a text file file.txt that contains list of phone numbers (one per line), write a one liner bash script to print all valid phone numbers.You may assume that a valid phone number must appe

2017-12-19 18:05:01 246

原创 python 2 Dec 11 - Dec 14

Dec 1108.05 special method 特殊方法Python 使用 __ 开头的名字来定义特殊的方法和属性,它们有: - __init__() : 构造方法 - __repr__() - __str__() - __call__() - __iter__() - __add__() - __sub__() - __mul__() - __rmul__() - __c

2017-12-19 15:34:17 322

原创 linux 运维 3 & python 1

Nov 24第11章 统一网络控制器Func详解配置iptablesiptables -I INPUT -s 192.168.1.0/24 -p tcp --dport 51235 -j ACCEPT#配置开通192.168.1.0/24网段访问服务51235端口Python%whos #使用whos查看当前的变量空间Variable Type Data/Info----------

2017-12-07 12:03:17 146

原创 linux 运维 2

Nov 14 2017如何将NTFS格式的移动硬盘挂接到mac os上进行读写(read/write)操作: http://www.360doc.com/content/14/0117/20/7044580_346053532.shtmlhdiutil attach Tuxera\ NTFS\ for\ Mac.dmginstaller -pkg Install\ Tuxera\ NTFS.mp

2017-11-20 19:18:54 361

原创 linux 运维 1

31 Oct - 3 Nov1.2 无人职守自动安装Linux操作系统通常采用“通过网络方式安装并结合自动应答文件,实现无人职守自动安装部署操作系统”。这种方法需要提前部署一台包含DHCP, TFTP, NFS等服务的安装服务器。安装部署流程: 客户端首先在BIOS中设置通过网络启动,客户端启动后,就会通过发送广播包的方式寻找DHCP服务器。如果找到了DHCP服务器,就会向该服务器申请获得包括I

2017-11-07 11:24:21 417

原创 linux12-13-14

Oct 13 FRI 20.1 Linux 的启动流程分析系统启动的经过可以汇整成底下的流程的: 1. 加载 BIOS 的硬件资讯与进行自我测试,并依据配置取得第一个可启动的装置; 2. 读取并运行第一个启动装置内 MBR 的 boot Loader (亦即是 grub, spfdisk 等程序); 3. 依据 boot loader 的配置加载 Kernel ,Kernel 会开始侦测硬件

2017-10-30 15:58:05 341

原创 linux 11

Oct 2第18章 认识系统服务(daemons)18.1.1 daemon的主要分类按照daemon的启动与管理方式来区分,daemon可以分为两类:stand_alone: 此daemon可以自行单独启动服务。最大的优点是:因为是一直存在内存中并持续地提供服务,因此对于发生客户端的请求时,stand alone的daemon响应速度较快。super daemon: 一个特殊的daemon来统

2017-10-04 19:06:01 308

原创 linux 10

25 Sept特殊文件与程序17.4.1 具有SUID/SGID权限的命令执行状态先看看SUID的程序是如何被一般用户执行,且具有什么特色呢? 查询整个系统的SUID/SGID的文件: find / perm + 600017.4.2 /proc/*代表的意义进程中的数据都是写入到/proc/*这个目录下的,所以可以直接查看/proc这个目录中的文件。 主机上面各个进程PID都是以目录的类

2017-10-02 11:56:02 242

原创 linux 8-9

11 SEP15.3.5 LVM的系统快照快照就是将当时的系统信息记录下来,就好像照相记录一样。 LVM的系统快照只会备份有改动的数据,没有改动的数据依旧保持在原本的区块内。由于快照去与原本的LV共享很多PE区块,因此快照去与被快照区的LV必须要在同一个VG里面。快照区的新建 1 先查看VG还剩下多少剩余容量(红框表示没有多余的PE可以用) 2 将刚才删除的/dev/sda6加入这个VG

2017-09-22 18:51:53 364

原创 linux 7

5 Sept14.6.3 用户邮件信箱:mailmailbox 会放置在/var/spool/mail里面,一个账号一个mailbox如何寄出信件呢? 直接执行mail username@localhost -s "邮件标题"即可!eg. 以root寄信给liangst,信件标题是“Nice to meet you” 则mail liangst -s "Nice to meet you"可以用

2017-09-11 11:55:12 380

原创 linux 6

24 AUG14.2.1 新增与删除用户: useradd, 相关配置文件, passwd, usermod, userdeluseradd [-u UID] [-g 初始用户组] [-G 次要用户组] [-mM] [-c 说明栏] [-d 主文件夹绝对路径] [-s shell] 用户账号名 一般新建文件夹之后会默认创建一个与账号一模一样的用户组名;默认会创建用户主文件夹。一般可以直接用user

2017-09-05 12:09:46 331

原创 linux 5

21 AUG13.3.3 shell script 的默认变量($0, $1)/path/to/scriptname opt1 opt2 opt3 执行脚本的路径和文件名是$0变量,opt1~opt3是$1-$3变量。 符号 意义 $0 被执行的文件名 $# 文件名后接的参数“个数” $@ 代表”$1”,”$2”,”$3”,”$4”等变量的具体内容shfit:造成参数

2017-08-29 14:49:09 175

原创 linux 学习 3-4

11 AUG8.5 内存交换空间swap的构建当内存不足时,为了让后续的程序可以顺利运行,因此内存中暂时不适用的程序与数据就会被挪到swap中。swap是用硬盘来暂时放置内存中的信息。8.5.1 使用物理分区构建swap 步骤: - 分区:fdisk /dev/hdc(这里hdc没有数字), 让内核更新分区表 partprobe partprobe 这个命令执行完毕之后不会输出任

2017-08-18 19:02:07 405

原创 linux学习(2)

1 AUG TUE P146 - P153 6.2.2 如何改变文件属性与权限改变权限 chmod r: read 4 w: write 2 x: execute 1 [-rwxrwx—] is 7 7 0 chmod [-R] xyz filename/directory -R 为递归的持续更改,即子目录下的所有文件都会更改 对于以vim编辑一个shell的文字批处理文

2017-08-04 19:04:09 280

原创 linux 学习(1)

24 JUL P66- P123 - 在Linux中,每个设备都被当成一个文件。eg /dev/hda, /dev/hdb 3.2硬盘分区。 - MBR: master boot record 主引导分区。开机时会去读取其里面的内容,让系统知道程序放在哪里该如何开机。 - partition table: eg. 假设上面的硬盘设备文件名位/dev/hda/,则分区名

2017-08-01 18:02:32 261

原创 [LeetCode] 175. Combine Two Tables

ProblemAbout: LEFT JOIN, LEFT JOIN USING and NATURAL LEFT JOINSolution: 1. SELECT FirstName, LastName, City, StateFROM PersonLEFT JOIN AddressON Person.PersonId = Address.PersonId;2. SELECT Firs

2017-03-11 00:47:42 256

原创 [Leetcode] 28. Implement strStr()

Problem: Implement strStr(). Returns the index of the first occurrence of needle in haystack, or -1 if needle is not part of haystack.Idea: Use two points to go through these two string individu

2017-03-08 20:58:02 216

原创 [Leetcode] 27. Remove Element

Problem: Given an array and a value, remove all instances of that value in place and return the new length. Do not allocate extra space for another array, you must do this in place with constant m

2017-03-06 10:56:08 199

用C++/MFC实现P2P和群聊功能的聊天小软件

计算机网络课程大作业。 使用socket编程。 实现P2P和群聊。 个性化MFC框架界面。 数据库存储方面有小的bug。 本软件用VS2010/2013开发,如遇版本问题可尝试修改“属性->常规->平台工具集”解决。

2015-03-08

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除