docker save | gzip > .tar.gz zcat .tar.gz | docker load
This loads the docker image with as the name and tag. Have to set the tag after loading
#include <iostream> | |
#include <vector> | |
std::vector<int> merge_vec(const std::vector<int>& v1, const std::vector<int>& v2){ | |
std::vector<int> result; | |
if(v1.size()==0) return v2; | |
if(v2.size()==0) return v1; | |
std::size_t i = 0; //v1 indexer |
// median of two sorted arrays | |
#include <iostream> | |
#include <vector> | |
#include <queue> | |
std::vector<int> merge(const std::vector<int>& v1, const std::vector<int>& v2){ | |
std::vector<int> result(v1.size()+v2.size()); | |
int i=0; | |
int j=0; |
Execute currently saved .py file | |
`:! python %` | |
Count the number of words in the saved file | |
`:!wc %` | |
Read a file in to Vim | |
`:!r filename` | |
Insert output of a shell command to current file |
docker save | gzip > .tar.gz zcat .tar.gz | docker load
This loads the docker image with as the name and tag. Have to set the tag after loading
#include <functional> | |
#include <queue> | |
#include <thread> | |
#include <mutex> | |
#include <condition_variable> | |
#include <iostream> | |
class Active { | |
public: | |
using Message = std::function<void()>; |
<!doctype html> | |
<html lang="en"> | |
<head> | |
<meta charset="utf-8"> | |
<meta http-equiv="X-UA-Compatible" content="IE=edge"> | |
<meta name="viewport" content="width=device-width, initial-scale=1"> | |
<title>My HTML App Template</title> | |
<meta name="description" content="My HTML App Template"> | |
<meta name="author" content="indy9000"> |
// worker threads vs async/futures | |
// | |
// This demonstrates that for heavy compute that require multiple workers that | |
// send the results in a queue to the caller, using async/futures is | |
// much simpler than using worker threads | |
#include <iostream> | |
#include <map> | |
#include <vector> | |
#include <algorithm> |
class Node(): | |
def __init__(self, value, next=None): | |
self.value = value | |
self.next = next | |
# returns a node if the sum is n | |
def sumTo(n, node): | |
s = 0 | |
while node != None: | |
s = s + node.value |
# This function solves the N Queen problem using | |
# Backtracking. It mainly uses solveNQUtil() to | |
# solve the problem. It returns false if queens | |
# cannot be placed, otherwise return true and | |
# placement of queens in the form of 1s. | |
# note that there may be more than one | |
# solutions, this function prints one of the | |
# feasible solutions. | |
def solveNQ(): | |
board = [ [0, 0, 0, 0], |