devnote's People
devnote's Issues
开发笔记
iOS
1.RunLoop http://blog.csdn.net/jjunjoe/article/details/8313016
2.架构谈 http://casatwy.com/
NodeJS
https://segmentfault.com/a/1190000004455807
3.github简历
https://segmentfault.com/a/1190000004338645
4.耳机放大器
https://item.taobao.com/item.htm?spm=a230r.1.14.1.jrHDWQ&id=43287407108&ns=1&abbucket=7#detail
https://item.taobao.com/item.htm?spm=a230r.1.14.1.jrHDWQ&id=43287407108&ns=1&abbucket=7#detail
5.游戏
http://kedou.workerman.net/
<embed src="http://player.youku.com/player.php/sid/XMTQ4MzI2ODQwOA==/v.swf" allowFullScreen="true" quality="high" width="480" height="400" align="middle" allowScriptAccess="always" type="application/x-shockwave-flash"></embed>
1.孕妈妈宝典: https://itunes.apple.com/cn/app/yun-ma-ma-bao-dian/id822431295?mt=8
2.宝宝食谱-妈妈必备: https://itunes.apple.com/cn/app/bao-bao-shi-pu-ma-ma-bi-bei/id888551320?mt=8
3.菜谱全集: https://itunes.apple.com/cn/app/cai-pu-quan-ji/id888524082?mt=8
nodejs: ghost, express, koa, co, thinkjs, pm2, toshihiko
4月5日-4月11日任务安排
龙超:
Soundcloud api封装,参考: https://github.com/delannoyk/SoundcloudSDK ,https://github.com/andresbrun/ABMSoundCloudAPI 实现search,用户登录,播放,收藏等简单功能。
MJ:album infomation 页面,pandora页面优化;
iOS IM socket
android studio 快捷键
⌥—> option|alt
⇧—>shift
⌃—>control
⌘—>command
⎋—>esc
↑↓←→
Code
alt+F7:Find usage
alt+command+L:格式化代码
alt+control+O:优化import(去掉无用的import)
control+O:Override Methods
control+I:Implement Methods
command+B:Declaration查看定义
alt+command+B:Implementations查看其实现
command+U:Super Method(Class)
control+上下方向键:Previous/Next Method
(shift+)F2:快递定位并高亮错误(deprecate,unused)
command+Z:Undo撤销
shift+command+Z:Redo Typing
alt+enter:引入包,添加注释…
control+enter:generate setter,getter…
shift+command+T:添加Test
command+W:Extend Selection
shift+command+W:Shrink Selection
command+P:参数提示
command+delete(X):删除当前行(剪切当前行)
command+F11:添加/取消bookmark
shift+F11:显示bookmark列表
command++/-:展开收缩代码
shift+command+上下方向键:Move Line Up/Move Line Down
Search
command+F:Find
command+R:Replace
control+shift+F:Find in Path
control+shiftÏ+R:Replace in Path
alt+command+左右方向键:Back/Forward操作
command+E:Recent File
shift+command+E:Recently Change Files
shift+shift:Search Method或者Class (Search Everywhere:command+N,shift+command+N,shift+alt+command+N)
command+N:Search Class
shift+command+N:Search File
shift+alt+command+N:Search Symbol
Run/Debug
shift+F10:Run
shift+F9:Debug
command+F9:Make Project
shift+command+F9:Make Module
command+F2:关闭当前的执行的task
command+F8:添加/取消断点
shift+command+F8:查看所有断点
Debug:
F7:Step Into
F8:Step Over
shift+F8:Step out
F9:resume
alt+F9:Run to Cursor
Refactor
shift+F6:重命名
command+F6:快速修改函数的参数,返回值或者类添加泛型等
F6:Move快速的移动方法或者类
F5:Copy快速的移动类
alt+command+C:提取Constant变量
alt+command+V:提取Variable(Local变量)
alt+command+F:提取Field变量
alt+command+M:提取Method
Window
control+左右方向键:tab切换
alt+F4:关闭当前tab
esc+command:切换当前的窗口
shift+esc:隐藏侧栏
VCS
command+K:Commit Changes
shift+command+K:Push Commit Changes
command+T:Update Project
Setting
command+,:Android Studio Preferences
command+;:Project Structure
Responder Chain 响应链笔记
`@implementation UIView (ParentController)
-(UIViewController*)parentController{
- UIResponder *responder = [self nextResponder];
- while (responder) {
- if ([responder isKindOfClass:[UIViewController class]]) {
return (UIViewController*)responder;
- }
- responder = [responder nextResponder];
- }
- return nil;
- }
- @end`
nodejs jade
使用nonatomic是线程安全的吗?
不是的。
atomic原子操作,系统会为setter方法加锁。 具体使用 @synchronized(self){//code }
nonatomic不会为setter方法加锁。
atomic:线程安全,需要消耗大量系统资源来为属性加锁
nonatomic:非线程安全,适合内存较小的移动设备
iOS开发编码建议与编程经验
以下keywords的区别: assign vs weak, block vs weak
assign适用于基本数据类型,weak是适用于NSObject对象,并且是一个弱引用。
assign其实也可以用来修饰对象,那么我们为什么不用它呢?因为被assign修饰的对象在释放之后,指针的地址还是存在的,也就是说指针并没有被置为nil。如果在后续的内存分配中,刚好分到了这块地址,程序就会崩溃掉。
而weak修饰的对象在释放之后,指针地址会被置为nil。所以现在一般弱引用就是用weak。
首先block是用来修饰一个变量,这个变量就可以在block中被修改(参考block实现原理) block:使用block修饰的变量在block代码块中会被retain(ARC下,MRC下不会retain) weak:使用weak修饰的变量不会在block代码块中被retain。
同时,在ARC下,要避免block出现循环引用 weak typedof(self)weakSelf = self;
Cocos2d-x 学习资料
Cocos Creator
http://www.cocos.com/docs/creator/getting-started/hello-world.html
http://www.cocos.com/docs/creator/
http://www.cocos.com/doc/article/index?type=cocos2d-x&url=/doc/cocos-docs-master/manual/framework/native/v3/basic-concepts/zh.md
http://www.2cto.com/kf/201408/326749.html
四川麻将规则
https://www.douban.com/group/topic/23793389/?type=like
UIScrollView manory
使用Auto Layout中的VFL(Visual format language)--代码实现自动布局
功能 表达式
- 水平方向 H:
- 垂直方向 V:
- Views [view]
- SuperView |
- 关系 >=,==,<=
- 空间,间隙 -
- 优先级 @value
UIImage图片加载方式两种:
图片加载两种方式
A:imagedNamed初始化
B:imageWithContentsOfFile初始化
二者不同之处在于,imageNamed默认加载图片成功后会内存中缓存图片,这个方法用一个指定的名字在系统缓存中查找并返回一个图片对象.如果缓存中没有找到相应的图片对象,则从指定地方加载图片然后缓存对象,并返回这个图片对象.
而imageWithContentsOfFile则仅只加载图片,不缓存.
大量使用imageNamed方式会在不需要缓存的地方额外增加开销CPU的时间来做这件事.当应用程序需要加载一张比较大的图片并且使用一次性,那么其实是没有必要去缓存这个图片的,用imageWithContentsOfFile是最为经济的方式,这样不会因为UIImage元素较多情况下,CPU会被逐个分散在不必要缓存上浪费过多时间.
使用场景需要编程时,应该根据实际应用场景加以区分,UIimage虽小,但使用元素较多问题会有所凸显.
Images.xcassets
Images.xcassets在app打包后,以Assets.car文件的形式出现在bundle中。其作用在于:
UIImage从bundle中加载图片资源
注意
Images.xcassets中的图片资源只能通过imageNamed:方法加载,通过NSBundle的pathForResource:ofType:无法获得图片路径。因此,Images.xcassets只适合存放系统常用的,占用内存小的图片资源。
imageNamed:方法同样可以加载根目录中的图片资源。
要想利用imageWithContentsOfFile:方法以不缓存的形式加载图片,必须将图片资源放置在根目录中。
相对于jpg,iOS对png的支持较好,例如,如果从Images.xcassets以外的地方加载图片,必须在文件名后加扩展名,例如:
`// pic.jpg处于根目录下
[UIImage imageNamed:@"pic"]; // 错误,图片未能正确加载
[UIImage imageNamed:@"pic.jpg"]; // 正确`
UIView和CALayer是啥关系?
文/starfox寒流(简书作者)
原文链接:http://www.jianshu.com/p/d72c4b595c7b
著作权归作者所有,转载请联系作者获得授权,并标注“简书作者”。
1.UIView是iOS系统中界面元素的基础,所有的界面元素都继承自它。它本身完全是由CoreAnimation来实现的 (Mac下似乎不是这样)。它真正的绘图部分,是由一个叫CALayer(Core Animation Layer)的类来管理。 UIView本身,更像是一个CALayer的管理器,访问它的跟绘图和跟坐标有关的属性,例如frame,bounds等 等,实际上内部都是在访问它所包含的CALayer的相关属性。
2.UIView有个layer属性,可以返回它的主CALayer实例,UIView有一个layerClass方法,返回主layer所使用的 类,UIView的子类,可以通过重载这个方法,来让UIView使用不同的CALayer来显示,例如通过
- (class) layerClass {
return ([CAEAGLLayer class]);
}
=使某个UIView的子类使用GL来进行绘制。
3.UIView的CALayer类似UIView的子View树形结构,也可以向它的layer上添加子layer,来完成某些特殊的表 示。例如下面的代码
grayCover = [[CALayer alloc] init];
grayCover.backgroundColor = [[[UIColor blackColor] colorWithAlphaComponent:0.2] CGColor];
[self.layer addSubLayer: grayCover];
会在目标View上敷上一层黑色的透明薄膜。
4.UIView的layer树形在系统内部,被系统维护着三份copy(这段理解有点吃不准)。
逻辑树,就是代码里可以操纵的,例如更改layer的属性等等就在这一份。
动画树,这是一个中间层,系统正在这一层上更改属性,进行各种渲染操作。
显示树,这棵树的内容是当前正被显示在屏幕上的内容。
这三棵树的逻辑结构都是一样的,区别只有各自的属性。
webstorm使用 nodejs相关
1.Option+cmd+V Extract代码;
2.ctrl+. 补全代码;
3.sudo chown -R whoami
path 修改权限;
4.mongod --dbpath /Users/pantao/Workspace/MongoDB/db 设置mongod数据库文件路径
5.操作mongodb后,是否有必要每次都关闭
http://mongodb.github.io/node-mongodb-native/driver-articles/mongoclient.html
http://stackoverflow.com/questions/14495975/why-is-it-recommended-not-to-close-a-mongodb-connection-anywhere-in-node-js-code
6.
源码
a. 龙门鱼博客系统 http://longmenwaideyu.com/ https://github.com/longmenwaideyu/expressjs-blog
b. 使用Node.js 完成的第一个项目的实践总结 https://github.com/yanghua/FixedAssetManager_Server http://blog.csdn.net/yanghua_kobe/article/details/17199417
c. nodeclub https://github.com/cnodejs/nodeclub
Mongoose文档 http://cnodejs.org/topic/504b4924e2b84515770103dd
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.