This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
call plug#begin() | |
" Plug 'tpope/vim-sensible' | |
" Plug 'roxma/nvim-completion-manager' | |
" Plug 'SirVer/ultisnips' | |
" Plug 'honza/vim-snippets' | |
" Plug 'preservim/nerdtree' | |
" Plug 'unblevable/quick-scope' | |
" Plug 'vimoxide/vim-mkdir' | |
" Plug 'vimoxide/vim-indent-object' | |
" Plug 'vimwiki/vimwiki' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Solution: | |
def fib(self, n: int) -> int: | |
# 0 1 2 3 4 5 6 | |
# 0 1 1 2 3 5 8 | |
#return self.fib_r(n) | |
return self.fib_a(n) | |
def fib_a(self, n:int) -> int: | |
# Time Complexity: O(n) | |
# Space Complexity: O(1) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Definition for singly-linked list. | |
# class ListNode: | |
# def __init__(self, val=0, next=None): | |
# self.val = val | |
# self.next = next | |
class Solution: | |
def mergeKLists(self, lists: List[Optional[ListNode]]) -> Optional[ListNode]: | |
if not lists: | |
return None | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Definition for singly-linked list. | |
# class ListNode: | |
# def __init__(self, val=0, next=None): | |
# self.val = val | |
# self.next = next | |
class Solution: | |
def removeNthFromEnd(self, head: Optional[ListNode], n: int) -> Optional[ListNode]: | |
if not head.next: | |
# Single node input meaning n = 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Powered | |
power failed -> Red On | |
Green* | |
tick -> Yellow | |
Yellow | |
tick -> Red | |
Red | |
tick -> Green | |
Unpowered |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Apr 11 22:46:10 tdc-ops-swf-02 account-server: ERROR __call__ error with PUT /sde/3306/AUTH_abcdefghi12345/PRD_20170411_M : LockTimeout (3s) /srv/node/sde/accounts/3306/ae2/cead29b1808e23f8c1668c5abe1f8ae2/.lock (txn: txf5dc7a70c023432caf6c3-0058ecfa3f) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"query": { | |
"bool": { | |
"must": [ | |
{"range": { | |
"salary": { | |
"gte": 20000, | |
"lte": 60000 | |
} | |
}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# scala install | |
wget www.scala-lang.org/files/archive/scala-2.11.7.deb | |
sudo dpkg -i scala-2.11.7.deb | |
# sbt installation | |
echo "deb https://dl.bintray.com/sbt/debian /" | sudo tee -a /etc/apt/sources.list.d/sbt.list | |
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 642AC823 | |
sudo apt-get update | |
sudo apt-get install sbt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import json | |
def get_key(id): | |
return 'e' + str(id) | |
def create_r_graph(f): | |
emp_id_pos = 0 | |
total_sub_pos = 1 | |
subs_pos = 2 | |
teams = {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package common.asynctask; | |
import android.os.AsyncTask; | |
public abstract class NamedAsyncTask<Params, Progress, Result> extends AsyncTask<Params, Progress, Result> { | |
private String oldName; | |
private void setNewThreadName(String name) { | |
oldName = Thread.currentThread().getName(); | |
if(!TextUtils.isEmpty(name)) Thread.currentThread().setName(name); |
NewerOlder