Skip to content

Instantly share code, notes, and snippets.

for (i = 0 ; i < threads ; i++)
spawn(worker thread);
while (1) {
cond_broadcast(ok_A);
for (i = 0 ; i < threads ; i++) down(done_A);
cond_broadcast(ok_B);
for (i = 0 ; i < threads ; i++) down(done_B);
after 'prepare_path' => sub {
my $c = shift;
my $path = $c->req->path;
my $base = $c->req->base;
use URI;
if ($path =~ s{^([ab]/)}{}) {
my $removed = $1;
andrew@mido:~/code/vt220-font$ perl -Ilib -MVT220 -e 'my $vt220 = VT220->new; $vt220->get_char("a")->display'
XXXXXX
XX
XXXXXXX
XX XXX
XXXXXXX
# The Computer Language Shootout
# http://shootout.alioth.debian.org/
# implemented by Greg Buchholz
# streamlined by Kalev Soikonen
# Multithreaded and reorganized by Andrew Rodland
use threads;
use threads::shared;
sub ITER () { 50 }
*** String::RewritePrefix successfully installed.
*** Module::AutoInstall installation finished.
String found where operator expected at /home/andrew/cat580014test/lib/perl5/i486-linux-gnu-thread-multi/MooseX/Role/WithOverloading/Meta/Role/Application/Composite/ToClass.pm line 10, near "with 'MooseX::Role::WithOverloading::Meta::Role::Application::Composite'"
(Do you need to predeclare with?)
$rs->select(
{},
{
select => [ { date => 'signup_date', -as => 'the_day' }, { count => '*' } ],
as => [ 'signup_date', 'signup_date_count' ],
group_by => [ 'the_day' ],
order_by => [ 'the_day desc' ],
}
);
$\="\n"; # "print for ..." at the end puts stuff on new lines :)
$/=""; # paragraph mode.
@word = split//,pop; # Get the search word off of the commandline
($board=<>) =~ tr/ //d;
$width = 1 + index($board, "\n"); # How wide is the board? Find the first newline.
for (1,2) {
# Find the word forwards, southwest, south, and southeast.
for my $stride (0, $width - 2 .. $width) {
$pattern = join "."x $stride, @word;
# If it's in the board, record the start and end match positions.
SELECT bands.name, COALESCE(pcount_raw, 0) AS pcount, COALESCE(vcount_raw, 0) AS vcount FROM bands
LEFT JOIN (SELECT band_id AS pbid, COUNT(id) as pcount_raw FROM polls GROUP BY pbid)
ON (bands.id=pbid)
LEFT JOIN (SELECT band_id AS vbid, COUNT(id) as vcount_raw FROM votes GROUP BY vbid)
ON (bands.id=vbid);
Index: apps/plugins/imageviewer/png/png.c
===================================================================
--- apps/plugins/imageviewer/png/png.c (revision 25692)
+++ apps/plugins/imageviewer/png/png.c (working copy)
@@ -1129,7 +1129,9 @@
{
if (chunkLength != 1) { decoder->error = 43; break; } /*error: this chunk must be 1 byte for indexed color image*/
decoder->infoPng.background_defined = 1;
- decoder->infoPng.background_r = decoder->infoPng.background_g = decoder->infoPng.background_g = data[0];
+ decoder->infoPng.background_r = decoder->infoPng.color.palette[4 * data[0] + 0];
#!perl
use strict;
use warnings;
use LWP::Simple;
use HTML::TreeBuilder;
my $t = HTML::TreeBuilder->new;
$t->parse_content(get "http://www.myp2p.eu/channel.php?country=us&part=channel");