Apache-Wyrd
view release on metacpan or search on metacpan
Wyrd/Chart.pm view on Meta::CPAN
use warnings;
no warnings qw(uninitialized);
package Apache::Wyrd::Chart;
our $VERSION = '0.98';
use base qw(Apache::Wyrd::Interfaces::Setter Apache::Wyrd);
use GD::Graph;
use GD::Graph::colour qw(:colours :convert :lists);
use Apache::Wyrd::Services::SAK qw(:tag :file token_parse token_hash);
use Digest::SHA qw(sha1_hex);
use Data::Dumper;
=pod
=head1 NAME
Apache::Wyrd::Chart - Embed Dynamically-redrawn charts in HTML
=head1 SYNOPSIS
<BASENAME::Chart img="chart.png" type="bars" height="200" width="300">
Wyrd/Form.pm view on Meta::CPAN
my ($value, $success) = ();
#inputs can define a current_value method in order to override a normal
#CGI lookup
if ($input->can('current_value')) {
$success = 1;
$value = $input->current_value;
} else {
($value, $success) = $self->_get_value($input->param);
}
$input->set($value);
#use Data::Dumper;
#warn "Value of input: " . $input->name . " is " . Dumper($input->value);
$self->_debug("Value of input: " . $input->name . " is " . $input->value);
#set the running variable amount
if ($success or $input->null_ok) {
$self->{'_variables'}->{$input->name} = $input->value;
}
}
}
sub _check_errors {
Wyrd/Services/MySQLIndex.pm view on Meta::CPAN
package Apache::Wyrd::Services::MySQLIndex;
use base qw(Apache::Wyrd::Services::Index);
use 5.006;
use strict;
use warnings;
no warnings qw(uninitialized);
our $VERSION = '0.98';
use Apache::Wyrd::Services::SAK qw(token_parse strip_html);
use Apache::Wyrd::Services::SearchParser;
use Digest::SHA qw(sha1_hex);
use Data::Dumper;
=pod
=head1 NAME
Apache::Wyrd::Services::MySQLIndex - MySQL version of Index
=head1 SYNOPSIS
sub new {
Wyrd/Services/SearchParser.pm view on Meta::CPAN
sub new_id {
my $self=shift;
return '__RESULT_' . $self->{'counter'}++ . '__';
}
sub union {
my ($self, $a, $b) = @_;
my $id = $self->new_id;
$self->{'hash'}->{$id} = $self->join_sets('u', $self->{'key'}, $self->{'hash'}->{$a}, $self->{'hash'}->{$b});
#use Data::Dumper;
#warn Dumper($self->{'hash'}->{$a}) . ' union ' . Dumper($self->{'hash'}->{$b}) . ' is ' . Dumper($self->{'hash'}->{$id}) . "\n";
return $id;
}
sub intersection {
my ($self, $a, $b) = @_;
my $id = $self->new_id;
$self->{'hash'}->{$id} = $self->join_sets('i', $self->{'key'}, $self->{'hash'}->{$a}, $self->{'hash'}->{$b});
#use Data::Dumper;
#warn Dumper($self->{'hash'}->{$a}) . ' intersection ' . Dumper($self->{'hash'}->{$b}) . ' is ' . Dumper($self->{'hash'}->{$id}) . "\n";
return $id;
}
sub negation {
my ($self, $a, $b) = @_;
my $id = $self->new_id;
$self->{'hash'}->{$id} = $self->join_sets('n', $self->{'key'}, $self->{'hash'}->{$a}, $self->{'hash'}->{$b});
#use Data::Dumper;
#warn Dumper($self->{'hash'}->{$a}) . ' negation ' . Dumper($self->{'hash'}->{$b}) . ' is ' . Dumper($self->{'hash'}->{$id}) . "\n";
return $id;
}
sub difference {
my ($self, $a, $b) = @_;
my $id = $self->new_id;
$self->{'hash'}->{$id} = $self->join_sets('d', $self->{'key'}, $self->{'hash'}->{$a}, $self->{'hash'}->{$b});
#use Data::Dumper;
#warn Dumper($self->{'hash'}->{$a}) . ' difference ' . Dumper($self->{'hash'}->{$b}) . ' is ' . Dumper($self->{'hash'}->{$id}) . "\n";
return $id;
}
sub join_sets {
my ($self, $type, $index, $a, $b) = @_;
my (@intersection, @difference) = ();
my (%count, %objects) = ();
foreach my $e (@$a, @$b) {
#WARNING: this assumes the arrays @$a and @$b are made of UNIQUE items.
( run in 0.488 second using v1.01-cache-2.11-cpan-4d50c553e7e )