原创 實現單鏈表的反轉

單鏈表的反轉實現很常見: #include <stdio.h> #include <stdlib.h> #include <string.h> #define NUM 9 typedef struct LNode { int

原创 [Leetcode] Invert Binary Tree

Invert a binary tree. 4 / \ 2 7 / \ / \ 1 3 6 9 to 4 / \ 7 2 / \ / \ 9 6

原创 [LeetCode]Add Two Numbers解析

將兩個鏈表的值進行相加,並返回一個新的鏈表,注意兩個地方:一是考慮兩個鏈表的長度是否相同,二是考慮相加後的進位問題, 其實長度不需要太多考慮,只要將該值置0即可。 方法一:將兩個鏈表長度置爲相同,對於其中一個長度較短的,後面加零,然後以

原创 git+gerrit clone 腳本

使用gerrit作爲code Review平臺後,克隆代碼的簡易方法,寫了個腳本,工作中常用到: #!/usr/bin/env python # coding=utf-8 # for git clone helper # autho

原创 base64編解碼方法

base64編碼方法: #include <stdio.h> #include <stdlib.h> #include <string.h> typedef enum { FALSE = 0, TRUE = 1 } boolea

原创 Gerrit+(nginx/Apache) 的git CodeReview平臺

準備工作: git、gitweb、gerrit安裝包、apache/nginx軟件包   測試採用的OS是CentOS 6.7 X64系統 Git版本 1.7.1 Gerrit版本爲:gerrit-2.10.6.war Web服務器爲標準

原创 [Leetcode]Find the Difference

Given two strings s and t which consist of only lowercase letters. String t is generated by random shuffling string

原创 談堅持和總結-20160912

想過要將自己這幾個的工作及學習知識好好總結一下,覺得很有必要,這兩年是工作歷程中的最重要的幾年,週末一直會是懶散的狀態,學習效率比較低下,XMIND知道很久,卻沒怎麼用,內核方面一直在看,卻沒有系統性的深入學習,總是看了又看的重複

原创 gdbus移植至mips

glib版本:glib-2.48.1、libffi-3.2.1、libiconv.so.2.5.1  、gettext-0.18.1 、zlib-1.2.8 CROSS=mips-linux-uclibc- APP_PUBLIC_DI

原创 Leetcode-Nim Game

You are playing the following Nim Game with your friend: There is a heap of stones on the table, each time one of y

原创 [Leetcode]Single Number

Given an array of integers, every element appears twice except for one. Find that single one. 思路: 1. 使用HASH表存儲每個數組元素出現

原创 PyQT實現一個自動生成配置工具

設備要量產,需要爲每臺設備燒錄MAC及設備標識信息,今天爲這事情專門寫個小工具實現 這個功能,主要解決批量生成燒錄配置信息,這裏對其過程作個總結: 1. 選擇QT的原因在於當時手上的圖形工具就這一種,不想再花時間去搭建新的環境 2. Q

原创 實現memove

void *memmoves(void *dest, const void *src, size_t count) { char *tmp_dst = NULL; const char *tmp_src

原创 [Leetcode]字符串的反轉

Write a function that takes a string as input and returns the string reversed. Example: Given s = "hello", return "ol

原创 求一個數組中子數組中的和的最大值

遇到的面試題: int maxSumOfArray(int array[], int len) { int mark = 0, i , j; int result = array[0]; for(i = 0; i < len;