- 博客(19)
- 收藏
- 关注
转载 正确使用Block避免Cycle Retain和Crash
转自出处:http://tanqisen.github.io/blog/2013/04/19/gcd-block-cycle-retain/Block简介Block作为C语言的扩展,并不是高新技术,和其他语言的闭包或lambda表达式是一回事。需要注意的是由于Objective-C在iOS中不支持GC机制,使用Block必须自己管理内存,而内存管理正是使用Block坑最多的
2014-10-31 14:27:25 360
转载 Always pass weak reference of self into block in ARC?
转自出处 : http://stackoverflow.com/questions/20030873/always-pass-weak-reference-of-self-into-block-in-arc
2014-10-29 11:56:03 694
转载 linux系统编程之进程(四):进程退出exit,_exit区别即atexit函数
转自出处:http://www.cnblogs.com/mickole/p/3186606.html
2014-10-27 16:34:49 368
转载 有 1000 个一模一样的瓶子,其中有 999 瓶是普通的水,有一瓶是毒药。任何喝下毒药的生物都会在一星期之后死亡。现在,你只有 10 只小白鼠和一星期的时间,如何检验出哪个瓶子里有毒药?
二进制第一只老鼠喝第 XXXXXXXXX1 瓶水 为1、3、5、7..999一共500瓶第二只老鼠喝第 XXXXXXXX1X 瓶水 为2、3、6、7......第十只老鼠喝第1XXXXXXXXX 瓶水 为512、513....到最后的水最后第几只死了就把那位记成1,得到的10位2进制数就是那瓶水其他
2014-10-27 16:18:56 5021
转载 Symmetric NAT and It’s Problems
转自出处:http://think-like-a-computer.com/2011/09/19/symmetric-nat/
2014-10-26 22:01:49 423
转载 Types Of NAT Explained (Port Restricted NAT, etc)
转自出处:All types of NAT fall into two categories; Static NAT and Dynamic NAT. Static NAT is where administrators manually create and maintain the NAT mappings and is usually associated
2014-10-26 21:46:48 538
原创 leetcode:Jump Game
Given an array of non-negative integers, you are initially positioned at the first index of the array.Each element in the array represents your maximum jump length at that position.Determine i
2014-10-26 16:35:20 421
原创 leetcode:Divide Two Integers
Divide two integers without using multiplication, division and mod operator.class Solution {public: int divide(int dividend, int divisor) { bool signFlag = false; if ((dividend
2014-10-26 15:32:09 331
原创 leetcode:Palindrome Number
Determine whether an integer is a palindrome.Do this without extra space.
2014-10-26 10:37:52 302
原创 leetcode:Merge k Sorted Lists
Merge k sorted linked lists and return it as one sorted list. Analyze and describe its complexity.第一种算法,算法de
2014-10-26 10:10:05 435
原创 leetcode: sqrt
Implement int sqrt(int x).Compute and return the square root of x.这道题目就是个二分查找题目,一定要记住
2014-10-24 14:14:31 360
转载 求连续子数组最大乘积
因为数组中存在正负零的情况,所以相比求连续子数组最大和的问题,求最大积稍微复杂一些,不过代码还是很简洁。假设数组为a[N],max[N] 表示以下标为 i 结尾的子数组乘积最大值,min[N] 表示以下标为 i 结尾的子数组乘积最小值。为了处理数组元素为负的问题,必须将最小乘积也保存起来。很容易想到,若当前元素a[i]为负数,那么a[i]*max[i-1]得到的值并不一定比a[i]
2014-10-19 22:20:50 6374
原创 leetcode: Insert Interval
Given a set of non-overlapping intervals, insert a new interval into the intervals (merge if necessary).You may assume that the intervals were initially sorted according to their start times.E
2014-10-18 12:16:20 409
原创 leetcode: JumpGame
Given an array of non-negative integers, you are initially positioned at the first index of the array.Each element in the array represents your maximum jump length at that position.Determine i
2014-10-18 10:30:54 422
转载 hadoop multipleinputs example
转自:http://www.lichun.cc/blog/2012/05/hadoop-multipleinputs-usage/
2014-10-12 23:41:04 486
转载 hadoop 二次排序
转自: http://www.see-source.com/blog/300000028/389关于二次排序主要涉及到这么几个东西:在0.20.0 以前使用的是setPartitionerClass setOutputkeyComparatorClasssetOutputValueGroupingComparator 在0.20
2014-10-10 16:40:34 440
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人