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
// an example to create a new mapping `ctrl-y` | |
mapkey('<Ctrl-y>', 'Show me the money', function() { | |
Front.showPopup('a well-known phrase uttered by characters in the 1996 film Jerry Maguire (Escape to close).'); | |
}); | |
// an example to replace `T` with `gt`, click `Default mappings` to see how `T` works. | |
map('gt', 'T'); | |
map('o', 't'); | |
map('O', 'T'); | |
map('H', 'S'); |
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
" Settings | |
set nohud | |
set nosmoothscroll | |
set noautofocus " The opposite of autofocus; this setting stops | |
" sites from focusing on an input box when they load | |
set typelinkhints | |
let searchlimit = 30 | |
let scrollstep = 50 | |
let barposition = "bottom" | |
let locale = "jp" " Current choices are 'jp' and 'uk'. This allows cVim to use sites like google.co.uk |
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 com.indeed.taz.downloader; | |
import com.google.common.base.Function; | |
import com.google.common.base.Predicate; | |
import com.google.common.collect.FluentIterable; | |
import org.springframework.core.task.AsyncTaskExecutor; | |
import org.springframework.core.task.SimpleAsyncTaskExecutor; | |
import java.io.IOException; | |
import java.util.ArrayList; |
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 marshal | |
import ( | |
"bytes" | |
"encoding/json" | |
"testing" | |
) | |
type MarshalInterface interface { | |
Example() string |
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
;; keys define by this won't get override by other module | |
(defvar my-keys-minor-mode-map (make-keymap) "my-keys-minor-mode keymap.") | |
;; ident | |
(global-set-key (kbd ">") 'my-indent-region) | |
(global-set-key (kbd "<") 'my-unindent-region) | |
;; remap c-a | |
(global-set-key [remap move-beginning-of-line] | |
'smarter-move-beginning-of-line) | |
;; remap m-d |
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
from collections import deque | |
# push O(n) | |
# top, pop, O(1) | |
class Stack1: | |
# initialize your data structure here. | |
def __init__(self): | |
self.q = deque() |
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
# m + n | |
# element expressed as (pos, value) | |
def multiply1(vec1, vec2): | |
i = 0 | |
j = 0 | |
vec = [] | |
while i < len(vec1) and j < len(vec2): | |
if vec1[i][0] > vec2[j][0]: |
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
3 1 2 6 4 5 | |
3 | |
1 6 | |
2 4 | |
5 | |
Basic Method: | |
Use the first element of preorder to divide the problem into 2 sub problems, construct the tree recursively | |
1. make the first element as root node |
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
#include <iostream> | |
using namespace std; | |
/* | |
0xxxxxxx A single-byte US-ASCII code (from the first 127 characters) | |
110xxxxx One more byte follows | |
1110xxxx Two more bytes follow | |
11110xxx Three more bytes follow | |
10xxxxxx A continuation of one of the multi-byte characters |
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 InvalidException(Exception): | |
pass | |
def encode1(words): | |
res = "" | |
for word in words: | |
res += str(len(word)) + ':' + word | |
return res |
NewerOlder