Skip to content

Instantly share code, notes, and snippets.

#!/usr/bin/env perl
use v5.18;
use Time::HiRes 'time';
use Parallel::ForkManager;
my $pm = new Parallel::ForkManager(4);
my @links = 1..60;
my $btime = time;
foreach my $link (@links) {
0.000874996185302734 1
0.00116109848022461 2
0.00148200988769531 3
0.0019071102142334 4
1.00795602798462 5
1.0085711479187 6
1.00913310050964 7
1.0098090171814 8
2.01733994483948 9
2.01780605316162 10
#!/usr/bin/env bash
export MYPERL=$HOME/perl5/mymojo
echo "# Install CPANM"
curl -L http://cpanmin.us | perl -I $MYPERL - -f -l $MYPERL App::cpanminus
echo "# Install Loca::Lib"
$MYPERL/bin/cpanm -l $MYPERL local::lib
echo "# add 'myperl' to ~/.bash_profile"
echo 'export MYPERL=$HOME/perl5; myperl () { :;S=${1-mydev};eval `perl -I $MYPERL/$S/lib/perl5 -Mlocal::lib=$MYPERL/$S`; }' >> ~/.bash_profile
@qgp9
qgp9 / Lightsail-2048.txt
Last active December 4, 2016 00:29
Amazon Lightsail , Linode Benchmark
Distro: "Ubuntu 16.04.1 LTS"
DiskSize: 39 GB
RAMSize: 1999 MB
Checking CPU specs...
CPU(s): 1
model name: Intel(R) Xeon(R) CPU E5-2676 v3 @ 2.40GHz
cpu MHz: 2400.094
cache size: 30720 KB
Virtualization: xen
xen-hvm
#include <iostream>
#include <cstdlib>
using namespace std;
void print(int* v, int n);
int * genArray( int n );
void swap( int &a, int &b ){int tmp=a;a=b;b=tmp;}
void solver( int * arr , int n ){
#include <stdio.h>
int main(){
const int NK = 3;
const int NN = 5;
int sizes[NK] = { 5, 4, 4 };
int arr[NK][NN] = {
{4, 10, 15, 24, 26},
{0, 9, 12, 20},
#include<iostream>
#include<vector>
int trap_water(std::vector<int> &v){
int water = 0;
int h = 0;
//== Find Max Height Bar
size_t imax = 0;
for( size_t i=1;i<v.size();i++ )
#include <iostream>
#include <vector>
#include <list>
#include <string>
#include <map>
using namespace std;
class Parser {
public:
#include <iostream>
using namespace std;
// A
template<typename T> void foo(T) {cout<<"A";}
// B
template<typename T> void foo(T*) {cout<<"B";}
// C
<template lang="pug">
div.ui.dimmer.modals.fade.page(
:class="merge({}, propClassModals, aniModals.class(updated), {transition})"
@click.self="stop"
@animationend="aniModals.onAnimationEnd()"
)
div(
style="display:table-cell;text-align:center;vertical-align:middle;"
@click.self="stop"
)