Skip to content

Instantly share code, notes, and snippets.

use PDL::Graphics::Prima::Simple;
line_plot $time, $temp;
@run4flat
run4flat / forecast-view-simple.pl
Last active December 11, 2015 10:29
Basic script for viewing forecasts for a specified zip-code; no axis labels or title.
#!/usr/bin/env perl
use strict;
use warnings;
#############################
# Getting the Forecast Data #
#############################
use PDL;
use Time::Piece;
sub build_state_func {
my $state_var
return sub {
# work with state here
}
}
...
*globref = build_state_func();
@run4flat
run4flat / gist:4575114
Created January 19, 2013 21:03
Basic Prima window build/execute.
use strict;
use warnings;
use Prima qw(Application Buttons Label);
my $window = Prima::Window->create();
$window->insert(Label =>
text => 'test',
@run4flat
run4flat / gist:3902086
Created October 16, 2012 21:10
Imagine using PDL::Graphics::Prima::Simple as...
use strict;
use warnings;
sub my_plot {
croak("Expected key/value pairs, but got an odd number of arguments to pot()")
if @_ % 2 == 1;
print "About to plot!\n";
PDL::Graphics::Prima::Simple::default_plot(@_);
}
@run4flat
run4flat / gist:3881822
Created October 12, 2012 22:02
FFT Pulse Explorer
use strict;
use warnings;
use PDL;
use PDL::Graphics::Prima;
use Prima qw(Application InputLine IniFile);
use PDL::FFT;
my $wDisplay = Prima::MainWindow->create(
text => 'FFT Envelope analysis',
size => [800, 800],
@run4flat
run4flat / gist:3295193
Created August 8, 2012 13:55
Perl thread barrier synchronization
use strict;
use warnings;
use threads qw(yield);
use threads::shared qw(cond_wait);
my $N_threads = 4;
# Allocate the shared memory outside the threads
my @data :shared;
@run4flat
run4flat / gist:3062942
Created July 6, 2012 21:49
Build failure on Windows Vista 32 bit, Strawberry Perl 5.12
C:\Windows\system32>cpan PDL::Graphics::Prima
CPAN: CPAN::SQLite loaded ok (v0.199)
Database was generated on Fri, 06 Jul 2012 16:57:19 GMT
Running install for module 'PDL::Graphics::Prima'
Running make for D/DC/DCMERTENS/PDL-Graphics-Prima-0.08.tar.gz
CPAN: Digest::SHA loaded ok (v5.61)
CPAN: Compress::Zlib loaded ok (v2.034)
Checksum for C:\strawberry\cpan\sources\authors\id\D\DC\DCMERTENS\PDL-Graphics-Prima-0.08.tar.gz ok
CPAN: Archive::Tar loaded ok (v1.76)
CPAN: File::Temp loaded ok (v0.22)
@run4flat
run4flat / gist:3013911
Created June 28, 2012 21:10 — forked from jberger/gist:3012794
PGPS gaussian width app
#!/usr/bin/env perl
use strict;
use warnings;
use PDL;
use PDL::Image2D;
use PDL::Fit::Gaussian;
use Prima;
use PDL::Graphics::Prima::Simple -sequential;
@run4flat
run4flat / prima-basic.pl
Created June 28, 2012 13:37
POE::Loop::Prima Hello World (counter)
#!/usr/bin/perl
# based on http://poe.perl.org/?POE_Cookbook/Gtk_Interfaces
#
# This sample program creates a very simple Prima counter. Its
# interface consists of two widgets: A counter label and a button
# to reset that counter.
use warnings;
use strict;
# Prima support is enabled if the Prima module is used before POE itself.