原创 第14章 線程機制:併發函數的使用--多線程Web服務器

/* twebserv.c - a threaded minimal web server (version 0.2) * usage : tws portnumber * features : supports the GE

原创 經典模型之Lenet

經典模型之Lenet 模型背景 1985年,Rumelhart和Hinton等人提出了後向傳播(BackPropagation,BP)算法[1](也有說1986年的,指的是他們另一篇paper:Learningrepresenta

原创 fork後父子進程共享資源

fork後父子進程共享資源 Unix環境高級編程中8.3節中說,“子進程是父進程的副本。例如,子進程獲得父進程數據空間、堆和棧的副本。注意,這是子進程所擁有的副本。父進程和子進程並不共享這些存儲空間部分。父進程和子進程共享正文段。

原创 LeetCode 342. Power of Four

描述 Given an integer (signed 32 bits), write a function to check whether it is a power of 4. Example: Given num =

原创 LeetCode 41. First Missing Positive

描述 Given an unsorted integer array, find the first missing positive integer. For example, Given [1,2,0] return 3,

原创 LeetCode 75. Sort Colors

描述 Given an array with n objects colored red, white or blue, sort them so that objects of the same color are adjac

原创 LeetCode 50. Pow(x, n)

描述 Implement pow(x, n). 分析 二分法,xn = xn/2 × xn/2 × xn%2 代碼 class Solution { public: double myPow(double x, int

原创 LeetCode 16. 3Sum Closest

描述 Given an array S of n integers, find three integers in S such that the sum is closest to a given number, target

原创 MySQL存儲引擎--MyISAM與InnoDB區別

轉載自http://blog.csdn.net/xifeijian/article/details/20316775 MyISAM 和I

原创 Reactor模式,或者叫反應器模式

轉自http://daimojingdeyu.iteye.com/blog/828696 Reactor這個詞譯成漢語還真沒有什麼合適的,很多地方叫反應器模式,但更多好像就直接叫reactor模式了,其實我覺着叫應答者模式更好理解

原创 Mac實用小技巧--Finder左邊欄添加文件夾

隨意拖拽Finder左邊欄的文稿和桌面後,發現這兩個文件夾意外消失了。 如果需要還原文稿和桌面文件夾,可以點擊Finder->偏好設置->邊欄->勾選桌面和文稿選項。 當然了,我們可以任意添加和刪除Finder左邊欄文

原创 進程的同步與通信

寫給自己的話 隔了好久沒寫博客了。 自從換了後端研發的工作後,每天都挺忙的。忙着做需求,跟進線上bug,忙着跟前端/客戶端聯調。夜深人靜,細細想來,自己並沒有多少可以沉澱的東西。特別是跟朋友聊起未來3年的規劃,覺得未免有些漫無目標

原创 94. 二叉樹的中序遍歷

題目地址:https://leetcode-cn.com/problems/binary-tree-inorder-traversal/ 給定一個二叉樹,返回它的中序 遍歷。 示例: 輸入: [1,null,2,3] 1

原创 98. 驗證二叉搜索樹

題目地址:https://leetcode-cn.com/problems/validate-binary-search-tree/ 給定一個二叉樹,判斷其是否是一個有效的二叉搜索樹。 假設一個二叉搜索樹具有如下特徵: 節點的左子樹

原创 95. 不同的二叉搜索樹 II

題目地址:https://leetcode-cn.com/problems/unique-binary-search-trees-ii/ 給定一個整數 n,生成所有由 1 ... n 爲節點所組成的二叉搜索樹。 示例: 輸入: 3