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 <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 ){ |
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
| 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 |
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
| #!/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 |
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
| 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 |
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
| #!/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) { |
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 <stdint.h> | |
| #include <iostream> | |
| template<int N> struct MustBeZeroInCompileTime {}; | |
| template<> struct MustBeZeroInCompileTime<0> {enum{check};}; | |
| template<int N> struct UnitType{}; | |
| template<> struct UnitType<1>{ typedef uint8_t type; }; | |
| template<> struct UnitType<2>{ typedef uint16_t type; }; | |
| template<> struct UnitType<4>{ typedef uint32_t type; }; |
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
| #!/usr/bin/env python3 | |
| def load_on_default( obj, pargs ): | |
| for k, v in pargs.items(): | |
| if( hasattr( obj, k ) ): | |
| setattr(obj, k, v ) | |
| else: | |
| print( "WARNING: the key \"{}\" is wrong.".format(k) ) | |
| class MyClass: | |
| def __init__(self,**pargs): |
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
| #!/bin/bash | |
| brew cask info $(brew cask list) | perl -nlE'/^(\S+):\s+(\S+)/ and chdir"/usr/local/Caskroom/$1/" and !-d$2 and say "brew cask uninstall $1 && brew cask install $1"' | |
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 <string> | |
| #include <iostream> | |
| #include <sstream> | |
| #include <iomanip> | |
| #include <stdlib.h> | |
| class SafeFormatter{ | |
| public: | |
| SafeFormatter( const char * s ):fForm(s),fIterator(fForm.begin()){} | |
| void compile(){return ;} | |
| template< typename T, typename ... A > |
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 <vector> | |
| #include <algorithm> | |
| class Ranger { | |
| public: | |
| typedef int value_type; | |
| struct iterator { | |
| iterator(size_t counter) : counter(counter) {} | |
| iterator operator++(){ return iterator(++counter); } | |
| bool operator!=(iterator o) { return counter != o.counter; } |