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 <iostream> | |
| #include <fstream> | |
| #include <vector> | |
| const std::string KFILE_NAME = "./intlist.txt"; | |
| static long long inverse_counter = 0; | |
| template <class VecIter> | |
| auto merge(VecIter iter_begin, VecIter iter_middle, VecIter iter_end){ | |
| size_t iter_dis = std::distance(iter_begin, iter_end); |
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
| # use C-a, since it's on the home row and easier to hit than C-b | |
| set-option -g prefix C-a | |
| unbind-key C-a | |
| bind-key C-a send-prefix | |
| set -g base-index 1 | |
| # Easy config reload | |
| bind-key R source-file ~/.tmux.conf \; display-message "tmux.conf reloaded." | |
| # vi is good |
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
| for i, clink := range childLinks { | |
| rch := make(chan interface{}) | |
| resultChannels[i] = rch | |
| duplicateLink, ok := linkMap.Load(clink.FullLink) | |
| if ok { | |
| fmt.Println("-----------------------")//if remove 26 sec | now 12 sec | |
| *clink = *duplicateLink.(*link.Link) | |
| go func() { | |
| rch <- struct{}{} |
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
| import subprocess | |
| #import urllib | |
| from urllib.parse import urlencode | |
| from urllib.request import Request, urlopen | |
| from urllib.error import URLError, HTTPError | |
| import time | |
| import json | |
| kHerokuUrl = "http://lit-castle-67838.herokuapp.com" | |
| delayTime = 5 |
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
| set nocompatible | |
| set nu | |
| set ts=8 | |
| set sw=4 | |
| set sts=4 | |
| set tabstop=4 | |
| set smartindent | |
| set autoindent | |
| set t_Co=256 | |
| syntax on |
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 <iostream> | |
| static int w[] = {20,20,20}; | |
| static int x0 = 1; | |
| const int kwAdd = 5; | |
| bool twoPercep(int x1, int x2) | |
| { | |
| int x[3] = {0,}; |
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
| readInts :: IO [Int] | |
| readInts = fmap (take 3 . map read.words) getLine | |
| camping n = do | |
| (x:y:z:[]) <- readInts | |
| if not $ z == 0 | |
| then | |
| do | |
| let day = ((z `div` y) * x + (z `mod` y)) | |
| putStrLn $ "Case " ++ (show n) ++ ": " ++ (show day) |
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 <iostream> | |
| #include <bitset> | |
| #include <cstring> | |
| void printBin(int num) | |
| { | |
| unsigned char arr[4] = {0,}; | |
| char *ptr = reinterpret_cast<char *>(&num); | |
| std::memcpy(arr, ptr, sizeof(int)); | |
| std::bitset<8> buf; |
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 <unistd.h> | |
| int main() { | |
| int m, n; | |
| scanf("%d %d" , &n, &m); | |
| int arr[1000] = {0, }; | |
| //1234567 | |
| /* | |
| 12 4567 3 |
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> | |
| struct node { | |
| int data; | |
| struct node *nxt; | |
| } Node; | |
| Node base; |