原创 遠程下載嵌入式WEB服務器裏的文件

因項目需要,用S3C2440和GoAhead構建嵌入式WEB服務器。嵌入式設備實時存儲數據到SD卡,需要遠程下載SD卡存儲的數據。編寫網頁放在嵌入式設備裏,在瀏覽器輸入嵌入式設備的IP可以訪問網頁。 之前考慮過用鏈接來下載文件,可是沒有

原创 Lowest Common Ancestor of a Binary Search Tree

Given a binary search tree (BST), find the lowest common ancestor (LCA) of two given nodes in the BST. According to the

原创 vim編輯器小結

1、編輯和保存文件    vim分爲插入和命令兩種模式。在插入模式下可以輸入字符,命令模式下則執行除了輸入字符之外的所有操作,包括保存、搜索、移動光標等。啓動vim時自動處於命令模式,按I(i)鍵可以進入插入模式,這個命令用於在當前光標所

原创 HexToFloat和HexToDouble

要明白如何將十六進制轉換爲float或double,需要了解浮點數的二進制存儲和轉換方式。float和double在存儲方式上都遵從IEEE的規範,且float遵從IEEE R32.24,而double遵從R64.53。具體轉換規則可以參

原创 Multiply Strings

Given two numbers represented as strings, return multiplication of the numbers as a string. Note: The numbers can be a

原创 Valid Palindrome

Given a string, determine if it is a palindrome, considering only alphanumeric characters and ignoring cases. For examp

原创 Reverse Vowels of a String

Write a function that takes a string as input and reverse only the vowels of a string. Example 1: Given s = “hello”, r

原创 Remove Element

Given an array and a value, remove all instances of that value in place and return the new length.Do not allocate extra

原创 Contains Duplicate II

Given an array of integers and an integer k, find out whether there are two distinct indices i and j in the array such

原创 String to Integer (atoi)

Implement atoi to convert a string to an integer. 說明:實現的atoi函數需要滿足以下特徵 1、忽略字符串第一個非空格字符前的所有空格(whitespace),第一個非空格字符可以是正負

原创 Basic Calculator II

Implement a basic calculator to evaluate a simple expression string. The expression string contains only non-negative i

原创 進程間通信1—管道(pipe)和命名管道(FIFO)

進程間通信(Inter-Process Communication,IPC)是用於處理一個多進程系統中各個進程之間的協調。所謂進程間通信,就是指多個進程間相互通信、交換信息的方法。常見的進程間通信方法包括以下幾種: 管道和命名管道 信號

原创 Rotate Array

Rotate an array of n elements to the right by k steps.For example, with n = 7 and k = 3, the array [1,2,3,4,5,6,7] is r

原创 Count and Say

The count-and-say sequence is the sequence of integers beginning as follows: 1, 11, 21, 1211, 111221, … 1 is read off

原创 Invert Binary Tree

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