Skip to content

Instantly share code, notes, and snippets.

A. Sinan Unur nanis

Block or report user

Report or block nanis

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@nanis
nanis / var.cpp
Last active Dec 7, 2016
Simple C++ program to demonstrate boost's variance accumulator
View var.cpp
#include <iomanip>
#include <iostream>
#include <boost/accumulators/accumulators.hpp>
#include <boost/accumulators/statistics/variance.hpp>
#include <boost/accumulators/statistics/stats.hpp>
namespace bacc = boost::accumulators;
static void
demo(const double base)
@nanis
nanis / power-fail.txt
Created Jun 22, 2016
t\spec\S32-num\power.rakudo.moar failures
View power-fail.txt
t\spec\S32-num\power.rakudo.moar ..
1..76
ok 1 - 0 ** 0 == 1
ok 2 - 0 ** 1 == 0
ok 3 - 1 ** 2 == 1
ok 4 - 4 ** 0 == 1
ok 5 - 4 ** 1 == 4
ok 6 - 4 ** 2 == 16
ok 7 - 0 ** 4553535345364535345634543534 == 0
ok 8 - 1 ** 4553535345364535345634543534 == 1
@nanis
nanis / io-spurt-fail.txt
Created Jun 22, 2016
t\spec\S32-io\spurt.t failures
View io-spurt-fail.txt
t\spec\S32-io\spurt.t ..
1..35
ok 1 - spurting Buf ok
ok 2 - spurting txt ok
ok 3 - spurt with enc
ok 4 - spurting Buf with append
ok 5 - spurting txt with append
not ok 6 - createonly creates file with Buf
# Failed test 'createonly creates file with Buf'
@nanis
nanis / io-pipe-fail.txt
Created Jun 22, 2016
t\spec\S32-io\pipe.t failures
View io-pipe-fail.txt
t\spec\S32-io\pipe.t ..
1..14
ok 1 - shell/run(:out).out is a Proc
ok 2 - shell/run(:out).out is an IO::Pipe
ok 3 - shell/run(:out) returns something trueish on success
ok 4 - Proc::Status.exitcode is zero for a successful run
ok 5 - Proc::Status.status is zero for a successful run
ok 6 - got correct output
1..6
ok 1 - Child succeeds but does not print anything
View Build Bio::DB::Sam on ArchLinux.txt
$ tar -xvf samtools-0.1.18.tar.bz2
$ cd samtools-0.1.18
$ make CFLAGS=-fPIC
Note, there are problems building this with GCC 5.3.0 because of the
use of `inline` with functions that are supposed to go in to a library.
Once that is fixed, library builds fine.
$ export SAMTOOLS=`pwd`; ~/perl/5.22.0/bin/cpanm Bio::DB::Sam
--> Working on Bio::DB::Sam
@nanis
nanis / download-tpp.pl
Last active Nov 8, 2015
A quick'n'dirty Perl script to download the entire TPP and combine it into a single PDF document
View download-tpp.pl
#!/usr/bin/env perl
=for comment
Office of the Unites States Trade Representative released the full text of the
Trans-Pacific Partnership trade agreement on November 5, 2015. For some reason,
it was released in 239 individual PDF documents, instead of a single file.
ToC at https://ustr.gov/trade-agreements/free-trade-agreements/trans-pacific-partnership/tpp-full-text
@nanis
nanis / random_real.c
Created Aug 14, 2015
Originally at http://mumble.net/~campbell/tmp/random_real.c Saved here for reference (as allowed by the copyright statement)
View random_real.c
/*
* Uniform random floats: How to generate a double-precision
* floating-point number in [0, 1] uniformly at random given a uniform
* random source of bits.
*
* Copyright (c) 2014, Taylor R Campbell
*
* Verbatim copying and distribution of this entire article are
* permitted worldwide, without royalty, in any medium, provided
* this notice, and the copyright notice, are preserved.
@nanis
nanis / stefik.quorum
Created Jun 12, 2015
See http://www.nu42.com/2015/06/quorum-creators-cannot-write-quorum.html This is the Quorum code in Stefik et al. 2011 and Stefik & Siebert 2013//
View stefik.quorum
/*
http://www.nu42.com/2015/06/quorum-creators-cannot-write-quorum.html
Quorum is a programming language created by Stefik et al. In a 2011 paper, the authors infamously proclaimed:
Results showed that while Quorum users were afforded significantly
greater accuracy compared to those using Perl and Randomo, Perl users
were unable to write programs more accurately than those using a
language designed by chance.
View gugu
#!/usr/bin/env perl
use v5.20;
=for commentary
This is my second entry in brian d foy's "Be Better than Quorum" challenge
See L<http://www.learning-perl.com/2015/06/learning-perl-challenge-be-better-than-quorum/>
I went for baroqueness with this one.
@nanis
nanis / ququ
Created Jun 4, 2015
My first entry in brian d foy's "Be better than Quorum challange"
View ququ
#!/usr/bin/env perl
use v5.20;
=for commentary
See L<http://www.learning-perl.com/2015/06/learning-perl-challenge-be-better-than-quorum/>
I know there will be reasonable entries, so here's one for variety ;-)
-- Sinan
You can’t perform that action at this time.