原创 231. Power of Two

Given an integer, write a function to determine if it is a power(乘冪) of two. 判斷一個整型數據是不是2的乘冪。 2的乘冪的特點是二進制表示中只有一個1,比如4(

原创 234. Palindrome Linked List

Given a singly linked list, determine if it is a palindrome. 給定單鏈表,判斷鏈表數據是否爲迴文。 Follow up: Could you do it in O(n)

原创 371. Sum of Two Integers

Calculate the sum of two integers a and b, but you are not allowed to use the operator + and -. 計算兩個整數a,b之和,不能使用操作符+

原创 169.Majority Element

Given an array of size n, find the majority element. The majority element is the element that appears more than ⌊ n/2

原创 函數名作參數的意義

最近在ARM上調試時犯了一個低級語法錯誤,錯把函數名當作函數返回值了,代碼如下: if(ObsAvdSignalReceived) printf("有障礙\r\n"); else printf("無

原创 定時器TimeBase設置無效問題

今天來公司移植回充部分代碼,在設置定時器(用於採集回沖紅外信號)週期時發現改變TIM_TimeBaseStructure的成員變量TIM_Period和TIM_Prescaler均無效,令我十分不解。 定時器設置代碼如下: void

原创 104. Maximum Depth of Binary Tree

Given a binary tree, find its maximum depth. The maximum depth is the number of nodes along the longest path from the

原创 28. Implement strStr()

Implement strStr(). Returns the index of the first occurrence of needle in haystack, or -1 if needle is not part of h

原创 STM32硬件調試過程遇中到Delay_ms()函數卡死的問題

程序在LCD初始化過程中卡死,通過硬件調試發現卡在Delay_ms()函數,轉到定義發現其爲Delay_us的宏定義函數: #define Delay_ms(x) Delay_us(1000*x)//單位ms 即延遲x單位ms,轉到

原创 使用addr2line命令解析native backtrace

addr2line是GNU Binary Utilities中的一個工具,用於將地址轉換成文件名/行號對。當有如下backtrace時:"Binder:1478_1F" prio=5 tid=198 Native  | group="ma

原创 “IEEE 802.11”是怎麼來的?

學習過Wi-Fi無線通信技術的人或多或少都會了解些IEEE 802.11協議簇,它是國際電工電子工程學會(IEEE)爲無線局域網絡制定的標準,可是你知道這個協議簇爲什麼叫“IEEE 802.11”嗎? IEEE,全稱是Institute

原创 操作系統和指彈吉他的聯繫

這兩天在看《操作系統實用教程》,打算補補自己所欠缺的計算機相關知識。在學習過程中我發現一件有趣的事情,操作系統和指彈吉他這兩個看似風馬牛不相及的領域在某些地方竟然有着一定的相似性,下面我將慢慢分析。 學習操作系統的過程中,可能我們最先接觸

原创 解決Selenium報錯:Element is not clickable at point (x, y). Other element would receive the click

用Python寫路由器控制腳本的時候遇到這個問題,Selenium提示如下: Message: Element is not clickable at point (1191.5, 143). Other element would re

原创 推薦一個Chrome去廣告的插件Adblock Plus

最近上網發現瀏覽器總彈出一些比較噁心的廣告,於是下載了屏蔽廣告的插件:Adblock Plus 這是Chrome應用商店裏的一個插件免費插件,感覺效果很棒,裝好後界面瞬間清爽很多,強烈推薦大家使用! 攔截記錄

原创 [回溯法] 和尚挑水問題-華爲筆試

某寺廟裏7個和尚:輪流挑水,爲了和其他任務不能衝突,各人將有空天數列出如下表: 和尚1: 星期二,四; 和尚2: 星期一,六; 和尚3: 星期三,日; 和尚4: 星期五; 和尚5: 星期一,四,六; 和尚6: 星期二,五; 和尚7: 星