Skip to content

Instantly share code, notes, and snippets.

@marioroy
marioroy / fasta_id.pl
Created February 1, 2015 05:04
Display bioID and recordLength (for FASTA files *.fa, *.fasta)
#!/usr/bin/env perl
use strict;
use warnings;
## use threads; ## Uncomment if threads is desired
use MCE::Flow 1.600; ## Requires v1.600 to run
##
#!/usr/bin/env perl
# mce_mojolicious.pl
# based on https://gist.github.com/tardisx/9088819
# using MCE::Hobo and MCE::Shared
=pod
Using Mojolicious and L<MCE> for forked independant workers,
communicating via L<MCE::Queue>.
@marioroy
marioroy / dancer2_mce_core_shared.pl
Last active March 23, 2016 14:06
Dancer2 + MCE / MCE::Hobo + MCE::Shared demonstrations
package MyDancer2App;
use strictures 1;
BEGIN {
our $VERSION = '0.001';
}
use Dancer2;
use Time::HiRes 'time';
@marioroy
marioroy / demo_flow_and_shared.pl
Last active March 29, 2016 19:25
MCE shared hash demonstrations
##
# Article:
# https://blog.celogeek.com/201401/426/perl-benchmark-cache-with-expires-and-max-size/
#
# Parallel demonstration via MCE::Flow and MCE::Shared->hash()
# Ensure the Sereal module is installed for extra performance
##
use strict;
use warnings;
#!/usr/bin/env perl
# Parallel demonstration for Monte Carlo Pi Calculation
# https://gist.github.com/dmr3/f435e84fb26f4de2e0c8e1f2d2e74f9b
#
# Original source by Demian Riccardi
# Parallel demonstration by Mario Roy
use Mojolicious::Lite;
#!/usr/bin/env perl
# Parallel demonstration for Recurring Monte Carlo Pi Calculation
# https://gist.github.com/dmr3/e69127ab449bdabd5af7b000c9b5b3b1
#
# Original source by Demian Riccardi, Joel Berger
# Parallel demonstration by Mario Roy
use Mojolicious::Lite;
@marioroy
marioroy / geo-minmax.pl
Created August 26, 2017 02:57
Geo::GDAL + MCE parallel demonstration
#!/usr/bin/env perl
# http://osgeo-org.1560.x6.nabble.com/gdal-dev-Experiments-with-multiprocessing-td5311397.html
# Demonstration - August 25, 2017
# Use MCE 1.830 or later
use strict;
use warnings;
use MCE;
@marioroy
marioroy / geo-minmax-pdl.pl
Last active August 28, 2017 17:20
Geo::GDAL + MCE + PDL parallel demonstration
#!/usr/bin/env perl
# http://osgeo-org.1560.x6.nabble.com/gdal-dev-Experiments-with-multiprocessing-td5311397.html
# Demonstration - August 25, 2017
# Use MCE 1.830 or later
use strict;
use warnings;
use feature qw( state );
@marioroy
marioroy / geo-shared-minmax.pl
Last active September 1, 2017 23:10
Geo::GDAL + MCE::Shared + PDL parallel demonstration
#!/usr/bin/env perl
# http://osgeo-org.1560.x6.nabble.com/gdal-dev-Experiments-with-multiprocessing-td5311397.html
# Demonstration - August 28, 2017
# Use MCE::Shared 1.827 or later
# Usage: geo-shared-minmax.pl image.tif
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
package main;
@marioroy
marioroy / geo-shared-update.pl
Last active September 1, 2017 23:11
Geo::GDAL + MCE::Shared + PDL update demonstration
#!/usr/bin/env perl
# http://osgeo-org.1560.x6.nabble.com/gdal-dev-Experiments-with-multiprocessing-td5311397.html
# Demonstration - August 28, 2017
# Use MCE::Shared 1.827 or later
# Usage: geo-shared-update.pl image.tif
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
package main;