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
{"lastUpload":"2020-02-27T17:10:38.302Z","extensionVersion":"v3.4.3"} |
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
# PostgreSQL. Versions 8.2 and up are supported. | |
# | |
# Install the pg driver: | |
# gem install pg | |
# On Mac OS X with macports: | |
# gem install pg -- --with-pg-config=/opt/local/lib/postgresql84/bin/pg_config | |
# On Windows: | |
# gem install pg | |
# Choose the win32 build. | |
# Install PostgreSQL and put its /bin directory on your path. |
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
char *st,*buf, sep[]=" .,"; | |
buf=strdup(s.c_str()); | |
st=strtok(buf,sep); | |
while (st) { | |
st=strtok(0,sep); | |
} |
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 <vector> | |
using namespace std; | |
#define db(a) cout << #a << " = " << a << endl | |
#define db2(a, b) cout << #a << " = " << a << " " << #b << " = " << b << endl; | |
template<typename T> class MyHeap { | |
protected: | |
int capacity; |
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 Graph { | |
private: | |
int **G; | |
int size; | |
public: | |
Graph(int n) { | |
n++; | |
G = new int*[n]; | |
for (int i = 0; i < n; i++) { | |
G[i] = (int*)calloc(n, sizeof(int)); |
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
void merge(vector<int> &a, vector<int> &temp, int mid, int leftStart, int rightEnd) { | |
int leftEnd = mid; | |
int rightStart = leftEnd + 1; | |
int curIndex = leftStart, left = leftStart; | |
for (;leftStart <= leftEnd && rightStart <= rightEnd;) { | |
if (a[leftStart] <= a[rightStart]) | |
temp[curIndex++] = a[leftStart++]; | |
else | |
temp[curIndex++] = a[rightStart++], res += leftEnd - leftStart + 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
template <typename T> | |
class Trie { | |
private: | |
T count; | |
Trie<T> *next[26]; | |
public: | |
Trie() { | |
count = T(); | |
for (int i = 0; i < 26; i++) next[i] = NULL; | |
} |
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
Show hidden characters
[ | |
{"command": "move_to", "args": {"to": "hardeol"}}, | |
{"command": "insert", "args": {"characters": ";"}} | |
] |