摘要: 想快速了解协程与网络调用的原来么,那么请赶紧关闭本页,因为下面都是在扯淡。 这几天是端午假期,第一天大算照着网上一大堆基于ucontext来写协程的文章自己也写一个简单的协程实现。于是第一天我就开始动手了,非常轻松愉快,毕竟是抄么。但是很多文章写到怎么用ucontext做切换就戛然而止了,很显然在我 阅读全文
posted @ 2017-05-30 21:29 卖程序的小歪 阅读(2227) 评论(0) 推荐(1) 编辑
摘要: 想要快速了解memcached内部原理么?那么赶紧离开本页,这会耽误您的时间。 不知时隔多少时间,今天受了些刺激,在码农路上开始犹豫起来,但是想想自己也没其他本身,就只好放下王者荣耀,重新看看技术内容了。自己看东西比较功利,但总是一开始比较功利,突然被中间说明地方吸引了,就会一层一层的跟下去,这也是 阅读全文
posted @ 2017-05-27 01:45 卖程序的小歪 阅读(966) 评论(0) 推荐(0) 编辑
摘要: ique_ptr is what you need, since it makes Settings the only (unique) owner of the pointed object, and the only object which is responsible for its des 阅读全文
posted @ 2016-05-05 00:55 卖程序的小歪 阅读(156) 评论(0) 推荐(0) 编辑
摘要: 今天是2015.11.23,我估计这也是继高考、保研这些决定与选择之后,又一个比较重大的人生选择。最终选择了去微信支付,按钱来说比最高的offer少五万,其实挺心疼的。但是从发展和部门核心程度来讲,应该是所有选择中比较好的一个。另外一个重要的原因就是有比较大的涨薪预期,当然这个只是道听途说。关于城市... 阅读全文
posted @ 2015-11-23 17:08 卖程序的小歪 阅读(474) 评论(0) 推荐(1) 编辑
摘要: 赠券收集者问题(coupon collector's problem),就是买东西的时候会又不同的卡片赠送,求集齐这些卡片需要购买的产品的数量的期望值。 见wiki [coupon collector's problem https://en.wikipedia.org/wiki/Coupon_co... 阅读全文
posted @ 2015-10-16 21:04 卖程序的小歪 阅读(1665) 评论(0) 推荐(1) 编辑
摘要: Given an directed graph, a topological order of the graph nodes is defined as follow: For each directed edge A B in graph, A must before B in the ord... 阅读全文
posted @ 2015-10-12 22:58 卖程序的小歪 阅读(144) 评论(0) 推荐(0) 编辑
摘要: Given a root of Binary Search Tree with unique value for each node. Remove the node with given value. If there is no such a node with given value in ... 阅读全文
posted @ 2015-09-23 17:10 卖程序的小歪 阅读(183) 评论(0) 推荐(0) 编辑
摘要: Design an algorithm and write code to serialize and deserialize a binary tree. Writing the tree to a file is called 'serialization' and reading back ... 阅读全文
posted @ 2015-09-23 16:47 卖程序的小歪 阅读(260) 评论(0) 推荐(0) 编辑
摘要: Given two values k1 and k2 (where k1 < k2) and a root pointer to a Binary Search Tree. Find all the keys of tree in range k1 to k2. i.e. print all x ... 阅读全文
posted @ 2015-09-23 16:17 卖程序的小歪 阅读(184) 评论(0) 推荐(0) 编辑
摘要: Given an array of integers, the majority number is the number that occurs more than 1/3 of the size of the array. Find it. Have you met this question... 阅读全文
posted @ 2015-09-19 21:15 卖程序的小歪 阅读(244) 评论(0) 推荐(0) 编辑