This file contains hidden or 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
# example 1: print 1 2 3 4 5 | |
i = 1 | |
while i < 6: | |
print(i) | |
i += 1 |
This file contains hidden or 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
# 'adsfdsa[aa] sadfbdsaf[bb], [cc]' => [aa, bb, cc] | |
import re | |
str = 'adsfdsa[aa] sadfbdsaf[bb], [cc]' | |
list = re.findall("\[\w+\]", str) # ['[aa]', '[bb]', '[cc]'] | |
list = map(lambda x: x[1:-1], list) # ['aa', 'bb', 'cc'] | |
print(list) |
This file contains hidden or 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
{ | |
"title": "Backslash to Forward Delete", | |
"rules": [ | |
{ | |
"description": "1. Fn+Backslash to Backslash 2. retain Shift+Backslash", | |
"manipulators": [ | |
{ | |
"from": { | |
"key_code": "backslash", | |
"modifiers": { |
This file contains hidden or 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 <stdio.h> | |
#include <stdlib.h> | |
// Number | |
typedef struct { | |
int value; | |
} Number; | |
Number new (int value); | |
void add (Number * ctx, int value); |
This file contains hidden or 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
<?xml version="1.0"?> | |
<root> | |
<item> | |
<name>Swap Semicolon and Shift_R</name> | |
<identifier>private.swap_semicolon_shift_R</identifier> | |
<autogen>__KeyToKey__ KeyCode::SEMICOLON, KeyCode::SHIFT_R</autogen> | |
<autogen>__KeyToKey__ KeyCode::SHIFT_R, KeyCode::SEMICOLON</autogen> | |
</item> | |
</root> |
$ brew install ffmpeg
This file contains hidden or 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 <stdio.h> | |
typedef struct { | |
int i; | |
char a; | |
char b[3]; | |
float * c; | |
char s[100]; | |
} T; |
This file contains hidden or 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 <stdio.h> | |
// int add (int a, int b) { | |
// return a + b; | |
// } | |
/* | |
* @param {int} sum | |
* @param {int} a | |
* @param {int} b |
This file contains hidden or 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
public static Tree<T> BFS<T>(Tree<T> root, int target) { | |
// create Queue, and enqueue root node | |
Queue<Tree<T>> queue = new Queue<Tree<T>>(); | |
queue.Enqueue(root); | |
while (queue.Count > 0) { | |
// dequeue first node | |
Tree<T> node = queue.Dequeue(); | |
// compare target |