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
// 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> |
<!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"> |
#include <functional> | |
#include <queue> | |
#include <thread> | |
#include <mutex> | |
#include <condition_variable> | |
#include <iostream> | |
class Active { | |
public: | |
using Message = std::function<void()>; |
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
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 |
// 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; |
#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 |
#include <iostream> | |
#include <string> | |
std::string longest_palindrome(const std::string& word){ | |
if(word.size()<3) | |
return std::string(); | |
std::string longest(""); | |
for(std::size_t i=1;i<word.size()-1;++i){ | |
auto left = i - 1; |
(*** | |
Converts a csv line which contain escaped elements delimited by for example ". The elements inside these delimters | |
can contain a , so a simple line.Split(',') would be incorrect. | |
example: | |
converts | |
val line : string = ""22 Dec 2014",BP,"EXPENSES ","1000.00", , " | |
to | |
val toks : string [] = [|"22 Dec 2014"; "BP"; "EXPENSES "; "1000.00"; " "|] | |
***) |
%% Exploration of fast convergence of Genetic Algorithms | |
% This matlab script contains the code for the results presented in the | |
% above paper. | |
%% | |
function weasels() | |
% Test main hypothesis, if crossover speeds up convergence | |
experiment1() | |
% Effect of smaller population | |
experiment2() | |
% Effect of range of mutation over range of crossover probabilities |