摘要: (转自) http://moodycamel.com/blog/2013/a-fast-lock-free-queue-for-c++ Sharing data between threads in annoying. Really annoying. If you do it wrong, the 阅读全文
posted @ 2017-08-05 07:23 grainy 阅读(425) 评论(0) 推荐(0) 编辑
摘要: Hangman is a paper and pencil guessing game for two or more players. One player thinks of a word, phrase or sentence and the other tries to guess it b 阅读全文
posted @ 2017-08-04 05:09 grainy 阅读(470) 评论(0) 推荐(0) 编辑
摘要: https://www.interviewcake.com/question/java/url-shortener You know, like bit.ly. Let's call it ca.ke! Step 1 is to scope the project. System design qu 阅读全文
posted @ 2017-08-02 12:57 grainy 阅读(272) 评论(0) 推荐(0) 编辑
摘要: What is the difference between ostream and ostringstream? Put succinctly: ostringstream provides a streambuf, ostream requires the user to provide one 阅读全文
posted @ 2017-07-28 05:43 grainy 阅读(2657) 评论(0) 推荐(0) 编辑
摘要: Two basic methods; separate chaining and open address. Separate Chain Hangs an additional data structure off of the buckets. For example the bucket ar 阅读全文
posted @ 2017-07-27 12:12 grainy 阅读(139) 评论(0) 推荐(0) 编辑
摘要: priority_queue<Point, vector<Point>, pqCmp> struct pqCmp { bool operator() (const Point& a, const Point& b) const { return distance(a,center) < distan 阅读全文
posted @ 2017-07-27 04:04 grainy 阅读(123) 评论(0) 推荐(0) 编辑
摘要: To solve the "Find K nearest Points" problem. O(n) time complexity 阅读全文
posted @ 2017-07-27 04:00 grainy 阅读(116) 评论(0) 推荐(0) 编辑
摘要: http://www.cs.cmu.edu/afs/cs.cmu.edu/academic/class/15251-f07/Site/Materials/Lectures/Lecture02/lecture02.pdf 阅读全文
posted @ 2017-07-26 14:55 grainy 阅读(155) 评论(0) 推荐(0) 编辑
摘要: AS A BEGINNER, WHICH SHOULD I LEARN? Python2 is the winner...for now. “Python 3 is a nicer and more consistent language, BUT, there is very limited th 阅读全文
posted @ 2017-07-26 10:51 grainy 阅读(133) 评论(0) 推荐(0) 编辑
摘要: Python开发人员有大量的框架可供选择来用于他们的Web项目。不过,现在Django毫无疑问已成为世界上Python开发人员中最流行的Web框架。本w将来谈谈Python开发人员为什么喜欢Django而不是其他流行的Python Web框架,如Flask,Pyramid,Tornado,Bottl 阅读全文
posted @ 2017-07-26 08:34 grainy 阅读(754) 评论(0) 推荐(0) 编辑