- 博客(20)
- 资源 (6)
- 收藏
- 关注
原创 bootstrap popup window
ref:http://www.w3cschool.cc/bootstrap/bootstrap-v2-modal-plugin.htmlhttp://getbootstrap.com/javascript/example code: Date time picker Large modal
2015-03-30 17:58:51 2142
原创 datepicker datetimepicker
http://www.eyecon.ro/bootstrap-datepicker/example: Date time picker $(document).ready(function() { $('#example1').datepicker({ format: "mm-dd-yyyy" }); }
2015-03-30 17:04:08 363
原创 leetcode 日经贴,python code -Remove Element
Remove Elementclass Solution: # @param A a list of integers # @param elem an integer, value need to be removed # @return an integer def removeElement(self, A, elem):
2015-03-23 20:43:38 324
原创 leetcode 日经贴,python code -Decode Ways
Decode Waysclass Solution: # @param s, a string # @return an integer def numDecodings(self, s): n = len(s) if n == 0: return 0 if n == 1: if '1' <=
2015-03-23 20:37:53 321
原创 POJ 1470 Closest Common Ancestors - Tarjan
POJ 1470 Closest Common AncestorsWiki 上的 Tarjan 算法, Tarjan is an offline algorithmhttp://en.wikipedia.org/wiki/Tarjan's_off-line_lowest_common_ancestors_algorithmfunction TarjanOLCA(u) Ma
2015-03-20 11:37:43 437
转载 3-ways-to-define-a-javascript-class/
http://www.phpied.com/3-ways-to-define-a-javascript-class/
2015-03-19 19:50:15 392
原创 leetcode 日经贴,Cpp code -Merge k Sorted Lists
Merge k Sorted Lists/** * Definition for singly-linked list. * struct ListNode { * int val; * ListNode *next; * ListNode(int x) : val(x), next(NULL) {} * }; */struct node {
2015-03-19 10:15:13 293
原创 leetcode 日经贴,Cpp code -Valid Parentheses
Valid Parenthesesclass Solution {public: bool leftBrace(char ch) { return ch == '(' || ch == '{' || ch == '['; } bool isMatch(char lc, char rc) { return lc == '(' && r
2015-03-19 10:00:41 320
原创 leetcode 日经贴,Cpp code -Maximum Subarray
Maximum Subarrayclass Solution {public: int maxSubArray(int A[], int n) { int ans = 0, cs = 0; if (n == 0) return 0; ans = cs = A[0]; for (int i = 1; i < n; ++
2015-03-19 09:54:23 313
原创 leetcode 日经贴,Cpp code -Interleaving String
Interleaving Stringclass Solution {public: bool isInterleave(string s1, string s2, string s3) { int n = s1.length(), m = s2.length(), l3 = s3.length(); if (n + m != l3)
2015-03-19 09:49:57 304
原创 base64 encode with javascript
/** * Base64 encode algorithm * @param {byte array} the binary data of image * @return {datauri} */var Base64 = { // private property _keyStr : "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrst
2015-03-17 18:03:14 448
原创 python webapp2 redirect
source codehttp://webapp-improved.appspot.com/_modules/webapp2.html#redirectwebapp2.redirect(uri, abort=True)
2015-03-17 16:10:15 614
原创 python decorators, classmethod and staticmethod
http://www.pythoncentral.io/python-decorators-overview/http://www.pythoncentral.io/difference-between-staticmethod-and-classmethod-in-python/
2015-03-17 12:23:19 519
原创 leetcode 日经贴,Cpp code -Scramble String
Scramble Stringclass Solution {public: bool isScramble2(string s1, string s2) { int n = s1.length(); if (n <= 3) return true; //from left int match = 0;
2015-03-17 10:57:29 488
原创 leetcode 日经贴,Cpp code -Path Sum II
Path Sum II/** * Definition for binary tree * struct TreeNode { * int val; * TreeNode *left; * TreeNode *right; * TreeNode(int x) : val(x), left(NULL), right(NULL) {} * };
2015-03-16 22:55:15 302
原创 leetcode 日经贴,Cpp code -Binary Tree Postorder Traversal
Binary Tree Postorder Traversal/** * Definition for binary tree * struct TreeNode { * int val; * TreeNode *left; * TreeNode *right; * TreeNode(int x) : val(x), left(NULL), ri
2015-03-16 14:28:26 302
原创 leetcode 日经贴,Cpp code -Median of Two Sorted Arrays
Median of Two Sorted Arraysclass Solution {public: int findkth(int* A, int m, int* B, int n, int k) { if (m + n < k) { return -1; //out of range } if (m ==
2015-03-16 14:24:02 302
原创 leetcode 日经贴,Cpp code -Sort Colors
Sort Colorsclass Solution {public: void swap(int &a, int &b) { int c = a; a = b; b = c; } void sortColors(int A[], int n) { const int red = 0, white =
2015-03-16 10:19:32 312
原创 leetcode 日经贴,Cpp code -Palindrome Partitioning II
Palindrome Partitioning IIclass Solution {public: int minCut(string s) { int n = s.length(); if (n <= 1) return 0; vector > dp; dp.resize(n); for (int
2015-03-16 10:10:09 288
原创 decompress in memory data
Decompress in memory data with gzip and StringIO.StringIOimport gzipimport StringIOdata = open('f.zip').read()fobj = StringIO.StringIO(data)fi = gzip.GzipFile(fileobj=fobj)fw = open('decompres
2015-03-12 20:47:45 342
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人