Fork me on GitHub

  2019年7月11日
摘要: 1. 水印图片生成采用svg,这样可以运行时生成名字或其他信息的图片 svg模板 一定要记得设置透明度(fill-opacity),否则水印会遮挡正文 svg需要转码: https://codepen.io/huashiyiqike/pen/rERBeJ 2. 通过css覆盖在整个页面上 水印元素放 阅读全文
posted @ 2019-07-11 18:16 huashiyiqike 阅读(1138) 评论(0) 推荐(1) 编辑
  2019年3月31日
摘要: https://gist.github.com/lygaret/a68220defa69174bdec5define(function(require) { var React = require('react'); var paramRegex = /__(\d)+/; var parser = new DOMParser(); var error... 阅读全文
posted @ 2019-03-31 21:36 huashiyiqike 阅读(295) 评论(0) 推荐(1) 编辑
  2019年3月25日
摘要: 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, Cont... 阅读全文
posted @ 2019-03-25 11:57 huashiyiqike 阅读(845) 评论(0) 推荐(0) 编辑
  2019年3月21日
摘要: 使用document.elementsFromPoint能穿透获取dom节点,通过dispatchEvent模拟事件 阅读全文
posted @ 2019-03-21 16:33 huashiyiqike 阅读(823) 评论(0) 推荐(0) 编辑
  2019年3月19日
摘要: class a { f() { console.log('a') } get f2() { console.log('f2') return (this['f'] = this.f.bind(this)); } } class b extends a { constructor() { super( 阅读全文
posted @ 2019-03-19 17:37 huashiyiqike 阅读(328) 评论(0) 推荐(0) 编辑
  2019年3月17日
摘要: 1. 原型链继承 function Brother(name){ this.name = name; this.wives = ["奶茶"]; this.marry = function(){}; } function Employee(name) { this.name = name; } Emp 阅读全文
posted @ 2019-03-17 01:27 huashiyiqike 阅读(203) 评论(0) 推荐(0) 编辑
  2019年3月16日
摘要: 原生的原型链 function fn(){},fn 为 Function的一个实例,原型链为 null -> Object -> Function -> fn: fn.__proto__ Function.prototype Function.prototype.__proto Object.pro 阅读全文
posted @ 2019-03-16 15:47 huashiyiqike 阅读(671) 评论(0) 推荐(0) 编辑
  2019年3月13日
摘要: 在html插入这段代码,然后在样式文件使用base字体为75px的基准转换px到rem即可。必要时还可以通过vh,vw调整。 https://www.jianshu.com/p/e96ccb603a50 阅读全文
posted @ 2019-03-13 10:39 huashiyiqike 阅读(396) 评论(0) 推荐(0) 编辑
  2016年5月3日
摘要: 需求:想列出指定的内容并将其转移到新的目录中 通过使用mv和管道符有几种方法, 1、file=`ls pattern`;mv $file newdir 2、ls pattern|xargs -i mv {} newdir; 3、find ./ -name "pattern" -exec mv {} 阅读全文
posted @ 2016-05-03 15:25 huashiyiqike 阅读(583) 评论(0) 推荐(0) 编辑
  2016年4月24日
摘要: 这道题目比较经典了: 当时我回答出来了正确答案,但是在一系列追问之下露出了狐狸的尾巴。答案是2 我当时认为test执行之后,a=2赋值给了全局,那么返回function时那里的a指的是window.a,就是2了。 实际上var a=3这一句是陷阱。 由于变量提升 a=2之前有一个var a的声明,这 阅读全文
posted @ 2016-04-24 10:45 huashiyiqike 阅读(419) 评论(0) 推荐(0) 编辑
  2016年4月18日
摘要: 今天面试不小心掉进坑了,大公司特别喜欢考javascript,而且专门挑很tricky的case。 javascipt的==简直就是黑魔法,以前偷懒总是用,感觉也没有问题,可是准备面试就需要有寻根问底的精神。 原题问[]==false; ![]==false console输出什么。结果是都是tru 阅读全文
posted @ 2016-04-18 16:38 huashiyiqike 阅读(577) 评论(0) 推荐(0) 编辑
  2016年4月4日
摘要: http://codepen.io/huashiyiqike/pen/qZVdag addEventListener 默认是冒泡阶段执行,也就是父亲与子都监听时,点击子,子先处理,父亲再处理,这时加stopPropagation()可以阻止父亲的处理事件。设置true反过来,这时加了stopProp 阅读全文
posted @ 2016-04-04 22:01 huashiyiqike 阅读(1302) 评论(0) 推荐(0) 编辑
  2016年3月6日
摘要: pip install sth --global-option="build_ext" --global-option="-I/usr/local/include" --global-option="-L/usr/local/lib" 阅读全文
posted @ 2016-03-06 21:58 huashiyiqike 阅读(335) 评论(0) 推荐(0) 编辑
  2016年1月14日
摘要: https://support.office.com/en-us/article/Word-keyboard-shortcuts-c0ca851f-3d58-4ce0-9867-799df73666a7 To the beginning of a document + HOME + FN + LEF 阅读全文
posted @ 2016-01-14 21:35 huashiyiqike 阅读(2190) 评论(0) 推荐(0) 编辑
  2015年11月17日
摘要: 项目链接:https://github.com/dmlc/mxnet因为要做一些开发工作,prebuilt的lib不能满足需求。由于工作环境要求是windows,所以可以利用cmake工具来构建。下载cmake,使用Cmake_Gui,选择项目目录等。由于atlasblas是默认选项,而atlas在... 阅读全文
posted @ 2015-11-17 11:17 huashiyiqike 阅读(4391) 评论(0) 推荐(0) 编辑
  2015年10月21日
摘要: https://leetcode.com/problems/binary-tree-postorder-traversal/Given a binary tree, return the postorder traversal of its nodes' values.For example:Giv... 阅读全文
posted @ 2015-10-21 15:25 huashiyiqike 阅读(863) 评论(0) 推荐(0) 编辑
摘要: Given a binary tree struct TreeLinkNode { TreeLinkNode *left; TreeLinkNode *right; TreeLinkNode *next; }Populate each next pointe... 阅读全文
posted @ 2015-10-21 11:16 huashiyiqike 阅读(352) 评论(0) 推荐(0) 编辑
  2015年10月20日
摘要: 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 ... 阅读全文
posted @ 2015-10-20 21:33 huashiyiqike 阅读(285) 评论(0) 推荐(0) 编辑
  2015年10月11日
摘要: shell"" 保留$,`,\, 换行含义,‘’保留字面值$(), ``用于命令替换算术扩展如 $[1+1]for循环:for Host in host1, host2, host3; do echo $Host; donefor Host in host{1,2,3}; do echo $Host... 阅读全文
posted @ 2015-10-11 17:41 huashiyiqike 阅读(418) 评论(0) 推荐(0) 编辑
  2015年9月17日
摘要: 访问控制列表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 | ... 阅读全文
posted @ 2015-09-17 17:40 huashiyiqike 阅读(360) 评论(0) 推荐(0) 编辑
  2015年8月3日
摘要: http://www.careercup.com/question?id=4868040812396544You should transform an structure of multiple tree from machine A to machine B. It is a serializa... 阅读全文
posted @ 2015-08-03 10:48 huashiyiqike 阅读(344) 评论(0) 推荐(0) 编辑
  2015年6月20日
摘要: 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 ... 阅读全文
posted @ 2015-06-20 14:50 huashiyiqike 阅读(611) 评论(0) 推荐(0) 编辑
  2015年3月16日
该文被密码保护。 阅读全文
posted @ 2015-03-16 16:17 huashiyiqike 阅读(8) 评论(0) 推荐(0) 编辑
  2015年3月14日
摘要: 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 ... 阅读全文
posted @ 2015-03-14 11:52 huashiyiqike 阅读(219) 评论(0) 推荐(0) 编辑
  2015年2月10日
摘要: leetcode代码利用堆栈:http://oj.leetcode.com/problems/evaluate-reverse-polish-notation/http://oj.leetcode.com/problems/longest-valid-parentheses/ (也可以用一维数组,贪... 阅读全文
posted @ 2015-02-10 18:57 huashiyiqike 阅读(480) 评论(0) 推荐(0) 编辑
  2015年2月4日
该文被密码保护。 阅读全文
posted @ 2015-02-04 10:09 huashiyiqike 阅读(5) 评论(0) 推荐(0) 编辑
  2014年12月16日
摘要: 我们在 安装ubuntu server版的时候,有人可能选择了中文环境安装,因为那样好设置时区等参数,可是安装好了后,运行某些命令的时候会有中文乱码提示,看起很是头蛋疼, 我们就需要将其改成英文环境。我们需要修改的文件/etc/default/locale#sudo vim /etc/default... 阅读全文
posted @ 2014-12-16 18:28 huashiyiqike 阅读(314) 评论(0) 推荐(0) 编辑
  2014年12月15日
摘要: ll | awk '{ print $9}' |xargs du -sh 阅读全文
posted @ 2014-12-15 16:16 huashiyiqike 阅读(132) 评论(0) 推荐(0) 编辑
  2014年12月1日
摘要: $ tmux attachprotocol version mismatch (client 7, server 6)$ pgrep tmux3429$ /proc/3429/exe attachoriginal post on Google Plus -https://plus.google.co... 阅读全文
posted @ 2014-12-01 15:05 huashiyiqike 阅读(1553) 评论(0) 推荐(0) 编辑
  2014年11月30日
摘要: detailed http://wenku.baidu.com/view/c2d1ebb4ba0d4a7302763a84.htmlhttp://hadoop.apache.org/docs/r1.0.4/cn/cluster_setup.html old最新的hadoop2.5 安装目录做了一定修... 阅读全文
posted @ 2014-11-30 22:02 huashiyiqike 阅读(282) 评论(0) 推荐(0) 编辑
摘要: 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... 阅读全文
posted @ 2014-11-30 10:45 huashiyiqike 阅读(762) 评论(0) 推荐(0) 编辑
  2014年11月29日
摘要: 分类:我叫学术帖2011-03-25 13:223232人阅读评论(4)收藏举报图形重要性采样是非常有意 思的一个方法。我们首先需要明确,这个方法是基于采样的,也就是基于所谓的蒙特卡洛法(Monte Carlo)。蒙特卡洛法,本身是一个利用随机采样对一个目标函数做近似。例如求一个稀奇古怪的形状的面积... 阅读全文
posted @ 2014-11-29 16:09 huashiyiqike 阅读(1719) 评论(0) 推荐(0) 编辑
  2014年11月18日
摘要: http://blog.csdn.net/zhangchao3322218/article/details/7930857#include #include #include using namespace std;void OutPutAnEmptyLine()//输出空行{cout> s ) ... 阅读全文
posted @ 2014-11-18 10:03 huashiyiqike 阅读(2863) 评论(0) 推荐(0) 编辑
  2014年11月3日
摘要: sudo sed 's/GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"/GRUB_CMDLINE_LINUX_DEFAULT="quiet splash acpi_osi="/' -i /etc/default/grubhttp://askubuntu.com/q... 阅读全文
posted @ 2014-11-03 15:28 huashiyiqike 阅读(276) 评论(0) 推荐(0) 编辑
  2014年10月30日
摘要: grep -v zip$ -v 逻辑否 $以zip结尾 (^开头)-n str不空,-z str 空 阅读全文
posted @ 2014-10-30 20:55 huashiyiqike 阅读(169) 评论(0) 推荐(0) 编辑
  2014年10月13日
摘要: 本机 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 u... 阅读全文
posted @ 2014-10-13 16:36 huashiyiqike 阅读(432) 评论(0) 推荐(0) 编辑
摘要: 今天安装软件时时,出现这样的错误提示:E: Sub-process /usr/bin/dpkg returned an error code (1)上网查解决方案,被网上误导,一不小心误删了dpkg的info文件夹,之后在使用apt-get 或者 dpkg命令总是提示“dpkg:警告:无法找到软件包... 阅读全文
posted @ 2014-10-13 15:20 huashiyiqike 阅读(1377) 评论(0) 推荐(0) 编辑
  2014年10月9日
摘要: system-config-printer 阅读全文
posted @ 2014-10-09 19:44 huashiyiqike 阅读(1185) 评论(0) 推荐(0) 编辑
  2014年9月22日
摘要: 需要时再创建对象,比如在类中用if new 而不是在构造函数里创建类的成员。用char 指针而不是string可以节省构造和析构string的开销。虚函数无法内联的性能损失。 阅读全文
posted @ 2014-09-22 00:07 huashiyiqike 阅读(181) 评论(0) 推荐(0) 编辑
  2014年9月20日
摘要: 使用单元测试使修改代码变得简单。在编程的时候考虑测试:使用类的方法来代替方法,这样可以通过在测试中编写继承类,改变相应方法的行为,达到避免执行某些函数的目的,更好的解依赖。使用包含预处理的头文件来制造接缝。#ifdef TESTING。。。 endif通过修改链接时的包含路径,另外的写专门用于测试的... 阅读全文
posted @ 2014-09-20 23:26 huashiyiqike 阅读(398) 评论(0) 推荐(0) 编辑