自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(254)
  • 收藏
  • 关注

转载 svg轻松实现文字水印

1. 水印图片生成采用svg,这样可以运行时生成名字或其他信息的图片svg模板<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="300px" height="160px" viewBox="0 0 300 160"> <...

2019-07-11 18:16:00 1733

转载 研究字符串模板

https://gist.github.com/lygaret/a68220defa69174bdec5define(function(require) { var React = require('react'); var paramRegex = /__(\d)+/; var parser = new DOMParser(); ...

2019-03-31 21:36:00 320

转载 fetch跨域浏览器请求头待研究

fetch('https://wwww.baidu.com', {headers: { "Access-Control-Allow-Origin": "*", 'Access-Control-Allow-Methods': 'GET, POST, PATCH, PUT, DELETE, OPTIONS', 'Access-Control-Allow-Headers': 'Origin...

2019-03-25 11:57:00 352

转载 穿透dom触发事件

const elems = document.elementsFromPoint(e.pageX, e.pageY);const instance = elems.filter(elem => elem.classList.contains('meeting-hover-card')); if (instance.length > 0) { ...

2019-03-21 16:33:00 416

转载 bind与继承 待研究

class a { f() { console.log('a') } get f2() { console.log('f2') return (this['f'] = this.f.bind(this)); }}class b extends a { constructor() { super()...

2019-03-19 17:37:00 147

转载 总结各种奇葩原型继承,面试向

1. 原型链继承function Brother(name){  this.name = name;  this.wives = ["奶茶"];  this.marry = function(){};}function Employee(name) {  this.name = name;}Employee.prototype = new Bro...

2019-03-17 01:27:00 127

转载 彻底搞懂js原型与原型链

原生的原型链function fn(){},fn 为 Function的一个实例,原型链为 null -> Object -> Function -> fn:fn.__proto__ === Function.prototypeFunction.prototype.__proto === Object.prototypeObject.protot...

2019-03-16 15:47:00 159

转载 移动端根据dpr适配

'use strict';/** * @param {Number} [baseFontSize = 100] - 基础fontSize, 默认100px; * @param {Number} [fontscale = 1] - 有的业务希望能放大一定比例的字体; */const win = window; const _baseFontSize =...

2019-03-13 10:39:00 460

转载 转 mv 管道符

需求:想列出指定的内容并将其转移到新的目录中通过使用mv和管道符有几种方法,1、file=`ls pattern`;mv $file newdir2、ls pattern|xargs -i mv {} newdir;3、find ./ -name "pattern" -exec mv {} newdir \; /*不要忘记后面的 "\;",这是必须添加的,否则...

2016-05-03 15:25:00 237

转载 从javascript一道闭包面试题说开去

这道题目比较经典了:var a = 1;function test(){ a = 2; return function(){ console.log(a); } var a = 3;}test()();当时我回答出来了正确答案,但是在一系列追问之下露出了狐狸的尾巴。答案是2我当时认为test执行之后...

2016-04-24 10:45:00 108

转载 javascript 无语的==

今天面试不小心掉进坑了,大公司特别喜欢考javascript,而且专门挑很tricky的case。javascipt的==简直就是黑魔法,以前偷懒总是用,感觉也没有问题,可是准备面试就需要有寻根问底的精神。原题问[]==false; ![]==false console输出什么。结果是都是true当空数组作为判断条件时,相当于true。当空数组与布尔值直接比较时,相当于fa...

2016-04-18 16:38:00 115

转载 js 事件捕获与事件冒泡例子

http://codepen.io/huashiyiqike/pen/qZVdagaddEventListener 默认是冒泡阶段执行,也就是父亲与子都监听时,点击子,子先处理,父亲再处理,这时加stopPropagation()可以阻止父亲的处理事件。设置true反过来,这时加了stopPropagation()可以阻止子的处理事件。jquery 只支持冒泡。<h...

2016-04-04 22:01:00 120

转载 python 安装加环境变量

pip install sth --global-option="build_ext" --global-option="-I/usr/local/include" --global-option="-L/usr/local/lib"转载于:https://www.cnblogs.com/huashiyiqike/p/5248750.html

2016-03-06 21:58:00 115

转载 mac word 快捷键

https://support.office.com/en-us/article/Word-keyboard-shortcuts-c0ca851f-3d58-4ce0-9867-799df73666a7To the beginning of a document+ HOME+ FN + LEFT ARROW (on...

2016-01-14 21:35:00 960

转载 MxNet Windows下安装

项目链接:https://github.com/dmlc/mxnet因为要做一些开发工作,prebuilt的lib不能满足需求。由于工作环境要求是windows,所以可以利用cmake工具来构建。下载cmake,使用Cmake_Gui,选择项目目录等。由于atlasblas是默认选项,而atlas在windows下不好编译,需要用cygwin和mingw,所以我们选择ope...

2015-11-17 11:17:00 218

转载 Binary Tree Postorder Traversal--leetcode难题讲解系列

https://leetcode.com/problems/binary-tree-postorder-traversal/Given a binary tree, return the postorder traversal of its nodes' values.For example:Given binary tree {1,#,2,3}, 1 \...

2015-10-21 15:25:00 231

转载 Populating Next Right Pointers in Each Node II--leetcode难题讲解系列

Given a binary tree struct TreeLinkNode { TreeLinkNode *left; TreeLinkNode *right; TreeLinkNode *next; }Populate each next pointer to point to its next right...

2015-10-21 11:16:00 85

转载 Recover Binary Search Tree--leetcode难题讲解

Two elements of a binary search tree (BST) are swapped by mistake.Recover the tree without changing its structure.Note:A solution using O(n) space is pretty straight forward. Could you devise a c...

2015-10-20 21:33:00 94

转载 bash + script

shell"" 保留$,`,\, 换行含义,‘’保留字面值$(), ``用于命令替换算术扩展如 $[1+1]for循环:for Host in host1, host2, host3; do echo $Host; donefor Host in host{1,2,3}; do echo $Host; donefor Host in host{1..3}; ...

2015-10-11 17:41:00 114

转载 Linux笔记

访问控制列表ACLgetfaclsetfacl u:me:rX file 只读权限setfacl -Rm g:group1:rwX dir/setfacl -Rm d:g:group1:rwX dir/ 将来的文件默认组权限chmod 4755 -rwsr_xr_xsuid sgid sbid | owner:r owner:w owner:x | gro...

2015-09-17 17:40:00 60

转载 谷歌面经 Tree Serialization

http://www.careercup.com/question?id=4868040812396544You should transform an structure of multiple tree from machine A to machine B. It is a serialization and deserialization problem, but i ...

2015-08-03 10:48:00 91

转载 Python strange questions list

sys.setrecursionlimit(1<<64)Line 3: OverflowError: Python int too large to convert to C longmax: 2**64-1, (1<<64) - 1sys.setrecursionlimit(1<<31)Line 3: OverflowError...

2015-06-20 14:50:00 146

转载 bit操作 转

http://www.catonmat.net/blog/low-level-bit-hacks-you-absolutely-must-know/Bit Hack #6. Turn off the rightmost 1-bit.y = x & (x-1)Bit Hack #7. Isolate the rightmost 1-bit.y = x &amp...

2015-03-14 11:52:00 109

转载 转载 ACM训练计划

leetcode代码利用堆栈:http://oj.leetcode.com/problems/evaluate-reverse-polish-notation/http://oj.leetcode.com/problems/longest-valid-parentheses/ (也可以用一维数组,贪心)http://oj.leetcode.com/problems/valid-pa...

2015-02-10 18:57:00 284

转载 ubuntu系统从中文环境改成英文环境

我们在 安装ubuntu server版的时候,有人可能选择了中文环境安装,因为那样好设置时区等参数,可是安装好了后,运行某些命令的时候会有中文乱码提示,看起很是头蛋疼, 我们就需要将其改成英文环境。我们需要修改的文件/etc/default/locale#sudo vim /etc/default/l...我们在安装ubuntu server版的时候,有人可能选...

2014-12-16 18:28:00 90

转载 linux查文件及文件夹大小

ll | awk '{ print $9}' |xargs du -sh转载于:https://www.cnblogs.com/huashiyiqike/p/4165124.html

2014-12-15 16:16:00 93

转载 tmux protocol version mismatch (client 7, server 6)

$ tmux attachprotocol version mismatch (client 7, server 6)$ pgrep tmux3429$ /proc/3429/exe attachoriginal post on Google Plus -https://plus.google.com/110139418387705691470/posts/B...

2014-12-01 15:05:00 849

转载 hadoop 转

detailed http://wenku.baidu.com/view/c2d1ebb4ba0d4a7302763a84.htmlhttp://hadoop.apache.org/docs/r1.0.4/cn/cluster_setup.html old最新的hadoop2.5 安装目录做了一定修改,安装变得稍微简单一点首先安装准备工具 $ sudo...

2014-11-30 22:02:00 109

转载 python load mat 并按变量名赋值

import numpy as npimport scipy.io as iocreat = locals()tmp = io.loadmat("all.mat")for i in tmp: print i creat[i] = tmp[i]1D-array转置np.reshape(xx, (-1, 1))转...

2014-11-30 10:45:00 252

转载 转 如何理解 重要性采样(importance sampling)

分类:我叫学术帖2011-03-25 13:223232人阅读评论(4)收藏举报图形重要性采样是非常有意 思的一个方法。我们首先需要明确,这个方法是基于采样的,也就是基于所谓的蒙特卡洛法(Monte Carlo)。蒙特卡洛法,本身是一个利用随机采样对一个目标函数做近似。例如求一个稀奇古怪的形状的面积,如果我们没有一个解析的表达方法,那么怎么做 呢...

2014-11-29 16:09:00 197

转载 C++中文件按行读取和逐词读取 backup

http://blog.youkuaiyun.com/zhangchao3322218/article/details/7930857#include <iostream>#include <fstream>#include < string >using namespace std;void OutPutAnEmptyLine()//输...

2014-11-18 10:03:00 126

转载 Asus ubuntu Fn恢复

sudo sed 's/GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"/GRUB_CMDLINE_LINUX_DEFAULT="quiet splash acpi_osi="/' -i /etc/default/grubhttp://askubuntu.com/questions/230609/brightness-keyboard-buttons-d...

2014-11-03 15:28:00 85

转载 shell 复习

grep -v zip$ -v 逻辑否 $以zip结尾 (^开头)-n str不空,-z str 空转载于:https://www.cnblogs.com/huashiyiqike/p/4063653.html

2014-10-30 20:55:00 109

转载 使用ssh免密码登录其他机器

本机 ssh-keygen -t rsa– cd ~/ssh– cp -p id_rsa.pub authorized_keys2– chmod go-rwx authorized_keys2– ssh-agent $SHELL; ssh-addssh-copy-id -i id_rsa.pub uwhpsc@166.111.138.172htt...

2014-10-13 16:36:00 127

转载 误删dpkg的/var/lib/dpkg/info文件夹的解决办法 zhuan

今天安装软件时时,出现这样的错误提示:E: Sub-process /usr/bin/dpkg returned an error code (1)上网查解决方案,被网上误导,一不小心误删了dpkg的info文件夹,之后在使用apt-get 或者 dpkg命令总是提示“dpkg:警告:无法找到软件包 ******* 的文件名列表文件,现假定该软件包目前没...

2014-10-13 15:20:00 423

转载 ubuntu添加打印机

system-config-printer转载于:https://www.cnblogs.com/huashiyiqike/p/4014273.html

2014-10-09 19:44:00 226

转载 提高c++性能的编程技术笔记

需要时再创建对象,比如在类中用if new 而不是在构造函数里创建类的成员。用char 指针而不是string可以节省构造和析构string的开销。虚函数无法内联的性能损失。转载于:https://www.cnblogs.com/huashiyiqike/p/3985247.html...

2014-09-22 00:07:00 73

转载 修改代码的艺术笔记

使用单元测试使修改代码变得简单。在编程的时候考虑测试:使用类的方法来代替方法,这样可以通过在测试中编写继承类,改变相应方法的行为,达到避免执行某些函数的目的,更好的解依赖。使用包含预处理的头文件来制造接缝。#ifdef TESTING。。。 endif通过修改链接时的包含路径,另外的写专门用于测试的类。(最佳,清晰而且便于维护测试代码)如果是函数调用的内部函...

2014-09-20 23:26:00 115

转载 英语阅读笔记

1.Preview2.active reading, read with questions, take notes3.Recite and Review4.Change read rates according to purpose and familarity with topics转载于:https://www.cnblogs.com/huashiyiqike/p/...

2014-09-09 00:05:00 67

转载 Linux下动态链接库 与gcc 选项

-L 编译时查找动态链接库的路径-lxxx(小写) e.g -lcudart = link libcudart.so ,-I(大写) 头文件的路径-rpath (-R), 编译时指定链接动态库的路径可以用ldd <your_execute>看看是不有 ‘not found’在你链接的库后面,解决方法是通过-Wl,rpath=<your_li...

2014-09-01 17:27:00 122

空空如也

空空如也

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

TA关注的人

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