原创 238 - Product of Array Except Self

Given an array of n integers where n > 1, nums, return an array output such that output[i] is equal to the product o

原创 234 - Palindrome Linked List

Given a singly linked list, determine if it is a palindrome. Follow up: Could you do it in O(n) time and O(1) space?

原创 231 - power of two

Given an integer, write a function to determine if it is a power of two. Credits: Special thanks to @jianchao.li.figh

原创 Vim 常用快捷鍵

移動光標: hjkl : 左下上右 —— 移動光標 : w filename 寫入新文件 刪除: x 刪除光標位置的字符 dd 刪除光標所在的行 dw(delete word) 刪除光標所在位置的單詞 d$  刪除光標至行尾的內容 J

原创 第5章 使用Linux環境變量

bash shell 用一個稱作環境變量的特性存儲有關shell會話和工作環境的信息。 這也是他們爲什麼被稱作環境變量的原因,它允許你在內存中存儲數據,以便在運行在shell上的程序和腳本訪問。 這也是存儲永久數據的一種簡便方法

原创 學習筆記 第一章

正則表達式由兩種字符組成:元字符 和 普通字符(文字) 行的開始和結束: 脫字符號 ^ :行的開始 —— ^cat 只尋找行首的cat 美元符號 :行的結束——cat 只尋找行尾的 cat 正則表達式結構體:[ ] ,也就是

原创 232 - Implement Queue using Stacks

Implement the following operations of a queue using stacks. push(x) -- Push element x to the back of queue.pop() -- Re

原创 一年以來的成長

剛剛簡單的寫完了一年的總結,但是在技術這個地方並沒有更多的提及。 剛纔簡單的整理了一下2015年一年以來,在印象筆記中剪輯的和自己寫的內容,發現很多的知識自己雖然已經記錄下來了,但是依舊很陌生,或者基本忘記了。而且,滿滿的筆記,大多都是剪

原创 jersey client返回list

bug: Exception in thread "main"javax.ws.rs.WebApplicationException:javax.xml.bind.UnmarshalException  - with linked e

原创 zoj 1003 Crashing Balloon

因式分解題目,用遞歸來解決。 代碼如下: // 因式分解相關 #include <iostream> #include <cstdlib> #include <cstdio> using namespace std; bool aT

原创 zoj 1002 Fire Net

有些類似於 N-queues,又不一樣,判斷是否可以放置blockhouse的條件不同。 而且是全搜,並非是N-0queues的按行搜索。 代碼如下: #include <iostream> using namespace

原创 Hibernate 與 JPA 小記

Hibernate 核心包括三個部分: Hibernate-core、Hibernate-annotation(包含jpa-annotation)、Hibernate-entityManager(適配Hibernate Core 和 JP

原创 爲自定義的類寫<<(輸出)操作符

#include <iostream> using namespace std; class item; ostream & operator <<(ostream & os, item& _item); class item {

原创 3 - Longest Substring Without Repeating Characters

Given a string, find the length of the longest substring without repeating characters. For example, the longest substri

原创 蛇形填數

在n*n的方陣裏填入 1, 2, …… n*n, 要求填成蛇形,例如 n=4 時,方陣爲: 10 11  12 1  9   16  13 2 8   15  14 3 7    6    5  4 上面的方陣中,空格只是爲了便於觀察規律