2014年1月21日

scala 学习笔记

摘要: http://zh.scala-tour.com学习笔记println 控制台输出语句变量/常量var 定义变量val 定义常量函数def squareWithBlock(a: Int) = { a * a}def,声明函数。参数后面要声明类型如果没有明确的return,则最后语句的结果作为返回值返回,类似于coffeescriptval squareVal = (a: Int) => a * a支持箭头函数 =>声明函数也可以用val,vardef addOne(f: Int => Int, arg: Int) = f(arg) + 1函数也是对象,可以进行传递,需要声明. 阅读全文

posted @ 2014-01-21 10:41 yuanpeng 阅读(143) 评论(0) 推荐(0) 编辑

2014年1月15日

angular 学习笔记

摘要: scope:如何查看一个DOM元素对应的scope:在浏览器调试器中选中要查看的元素,在控制台中输入$0,输出DOM本身;输入angular.element($0).scope(),输出DOM对应的scopescope和javascript对象一样,采用原型继承。和原型链原理类似,子scope可以通... 阅读全文

posted @ 2014-01-15 15:26 yuanpeng 阅读(653) 评论(0) 推荐(0) 编辑

2013年12月31日

关于webRTC

摘要: webRTC是浏览器实现的,用来实现p2p实时通讯的协议现在已经被chrome和firefox支持webRTC实现了三个API供前端开发者调用MediaStream(或者叫getUserMedia),取得媒体(音频或者视频或者其他)的传输流RTCPeerConnection,建立p2p网络连接RTCDataChannel,传输数据建立p2p连接需要知道用户的真实地址,理论上用户都是暴露在公网上的,有ip和端口。但是现实中,很多连接都是通过路由器等NAT设备转发的,并不能一下子得到用户的真是ip和端口所以需要“STUN”服务器去检测用户的真实地址之后得到用户的真实可用的网络信息之后,才能建立we 阅读全文

posted @ 2013-12-31 16:26 yuanpeng 阅读(246) 评论(0) 推荐(0) 编辑

2013年12月10日

git command cheat sheet

摘要: clone:克隆--non-bare:(默认值)一般的克隆方式--bare:只克隆.git目录--mirror:只克隆.git目录,并且还保持与origin的关联,可以fetchcommit:将stage提交到repogit commit:将stage提交到当前分支git commit -m [me... 阅读全文

posted @ 2013-12-10 17:21 yuanpeng 阅读(280) 评论(0) 推荐(0) 编辑

ZT 基于git的版本管理思路

摘要: http://nvie.com/posts/a-successful-git-branching-model/分为5种分支:feature:功能分支,开发人员在此种分支下开发新的功能,开发完成后merge到develop,并删除无用的featuredevelop:开发分支master:主分支,最终产品从此分支feature:功能分支,开发完成后删除release:发布分支,发布之后删除hotfixes:修补分支,改bug之后删除 阅读全文

posted @ 2013-12-10 09:22 yuanpeng 阅读(177) 评论(0) 推荐(0) 编辑

2013年11月29日

chrome console cheat sheet

摘要: 快捷键打开console界面快捷键:ctrl+shift+J清空log:ctrl+L选项Log XMLHTTPRequests:显示ajaxPreserve log upon navigation:页面跳转时保留logjavascript方法console.log:普通console.info:=console.logconsole.warn:警告console.error:错误console.count:输出被运行的次数,以参数分组计数console.dir:把内容当作DOM或者javascript对象格式输出console.dirxml:把内容输出为xml格式console.assert: 阅读全文

posted @ 2013-11-29 17:58 yuanpeng 阅读(494) 评论(0) 推荐(0) 编辑

2013年11月26日

css flex cheat sheet

摘要: .container{ display: -webkit-flex/inline-flex; display: -moz-flex/inline-flex; display: -ms-flex/inline-flex; display: flex/inline-flex;}让元素以flex形式渲染flex=blockinline-flex=inline-blockflex-direction: row/row-reverse/column/column-reverse;定义主轴方向row=从左至右(默认值)column=从上到下flex-wrap: nowrap/wra... 阅读全文

posted @ 2013-11-26 16:48 yuanpeng 阅读(470) 评论(0) 推荐(0) 编辑

linux权限及目录

摘要: [-][rwx][r-x][r--]r:4 - 读 w:2 - 写 x:1 - 执行1:代表文件类型2:代表文件所有者的权限3:代表文件所在组的权限4:代表其他用户的权限chgrp:修改所属组chown:修改所有者chmod:修改该文件权限文件类型的种类-:普通文件d :目录l :连接b :块设备c :字符设备s :socketp :管道目录/usr (unix software resource) 与软件安装执行有关/var (variable) 与系统运作过程有关/bin 存放可执行命令,root与其他账户都可用/boot 存放开机需要的文件/dev dev... 阅读全文

posted @ 2013-11-26 14:58 yuanpeng 阅读(179) 评论(0) 推荐(0) 编辑

What is the difference between inverse converse and reverse?

摘要: http://wiki.answers.com/Q/What_is_the_difference_between_inverse_converse_and_reverseFirst, it helps to look at the verb usage: you can reverse something, but you cannot inverse or converse something.The distinctions between reverse, converse, and inverse can often be made by looking at their roots 阅读全文

posted @ 2013-11-26 14:57 yuanpeng 阅读(323) 评论(0) 推荐(0) 编辑

导航