原创 my working bash script for restarting services 11/11/19
#!/bin/bash #DEBUG_MODE=on unset DEBUG_MODE RESOURCE_SERVER_LOCKFILE=/tmp/resource_service.lock FAST_CGI_LOCK_FILE=/tmp
原创 my raw answers for leetcode - 1. Two Sum
1. Two Sum Given an array of integers, return indices of the two numbers such that they add up to a specific target. Yo
原创 leetcode 11/02/19, 11/03/19 周賽記錄。
第一次參加周賽就單雙週一起報了。刷的題還不多,因此每場只記錄2-3道自己掌握的(比賽時提交通過或完了通不過,事後看一眼就明白怎麼回事的)。Cuz my current goal is to get completely control o
原创 my raw answers for leetcode - 2. Add Two Numbers
You are given two non-empty linked lists representing two non-negative integers. The digits are stored in reverse order
原创 An algorithm to calculate the greater 2^n close to num.
if num&(num-1) != 0 { for num&(num-1) != 0 { num &= (num - 1) } num = num << 1 }
原创 my raw answers for leetcode - 6. ZigZag Conversion
The string "PAYPALISHIRING" is written in a zigzag pattern on a given number of rows like this: (you may want to displa
原创 my raw answers for leetcode - 9. Palindrome Number
Determine whether an integer is a palindrome. An integer is a palindrome when it reads the same backward as forward. Ex
原创 git創建新分支、推送到新分支、刪除本地分支精簡版
git branch -a 查看所有分支 git checkout -b test01 創建本地test01分支 git push --set-upstream origin test01 把本地test01分支推送到遠程 once
原创 leetcode 11/10/19 周賽記錄。
第一題: 1252. Cells with Odd Values in a Matrix Given n and m which are the dimensions of a matrix initialized by zeros an
原创 Program open configuration file with it's relative path on Linux.
The problem is, if you open a program in another directory(not the executable directory). A bad program can't read th
原创 my raw answers for leetcode - 3. Longest Substring Without Repeating Characters
Given a string, find the length of the longest substring without repeating characters. Example 1: Input: "abcabcbb" Out
原创 my raw answers for leetcode - 10. Regular Expression Matching
Given an input string (s) and a pattern (p), implement regular expression matching with support for '.' and '*'. '.' Ma
原创 推薦一個圖片轉換工具ffmpeg
由於弄人臉識別的sdk,需要,手上的jpg需要轉換成bgr24等格式,這裏提供一個方便的轉換工具:ffmpeg,它可以把常見圖片格式(jgp,png,bmp等)轉換成二進制文件。 apt-get install ffmpeg 使用ff
原创 my raw answers for leetcode - 8. String to Integer (atoi)
Implement atoi which converts a string to an integer. The function first discards as many whitespace characters as nece
原创 my raw answers for leetcode - 7. Reverse Integer
Given a 32-bit signed integer, reverse digits of an integer. Example 1: Input: 123 Output: 321 Example 2: Input: -123 O