view release on metacpan or search on metacpan
#ifndef IVSIZE
# ifdef LONGSIZE
# define IVSIZE LONGSIZE
# else
# define IVSIZE 4 /* A bold guess, but the best we can make. */
# endif
#endif
#ifndef UVTYPE
# define UVTYPE unsigned IVTYPE
#endif
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Acme/MJD.pm view on Meta::CPAN
#11959 Cargo-cult.
#11960 So you threw in some random punctuation for no particular reason, and then you didn't get the result you expected. Hmmmm.
#11961 How should I know what is wrong when I haven't even seen the code? I am not clairvoyant.
#11962 How should I know how to do what you want when you didn't say what you wanted to do?
#11963 It's easy to get the *wrong* answer in O(1) time.
#11964 I guess this just goes to show that you can lead a horse to water, but you can't make him drink it.
#11999 You are a stupid asshole. Shut the fuck up.
view all matches for this distribution
view release on metacpan or search on metacpan
inc/Module/AutoInstall.pm view on Meta::CPAN
if ( @Missing and not( $CheckOnly or $UnderCPAN ) ) {
require Config;
print
"*** Dependencies will be installed the next time you type '$Config::Config{make}'.\n";
# make an educated guess of whether we'll need root permission.
print " (You may need to do that as the 'root' user.)\n"
if eval '$>';
}
print "*** $class configuration finished.\n";
inc/Module/AutoInstall.pm view on Meta::CPAN
or _load('CPANPLUS::Shell::Default')
)
);
}
# make guesses on whether we're under the CPAN installation directory
sub _under_cpan {
require Cwd;
require File::Spec;
my $cwd = File::Spec->canonpath( Cwd::cwd() );
view all matches for this distribution
view release on metacpan or search on metacpan
Makefile.PL view on Meta::CPAN
'strict' => 0,
'warnings' => 0,
},
'AUTHOR' => [ 'Jean Forget <JFORGET@cpan.org>' ],
'LICENSE' => 'perl',
# The oldest Perl to check A::MS::s 0.03 is 5.6.2. Therefore, I guess A::MS::s 0.04 and next will work in 5.6.2 too.
MIN_PERL_VERSION => '5.6.2',
META_MERGE => {
dynamic_config => 0,
prereqs => {
build => {
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Acme/Mobile/Therbligs.pm view on Meta::CPAN
This library is free software; you can redistribute it and/or modify
it under the same terms as Perl itself, either Perl version 5.8.3 or,
at your option, any later version of Perl 5 you may have available.
Now maintained by Rene Schickbauer, so i guess everything after version 0.01
is (C) 2010 Rene Schickbauer
=head1 SEE ALSO
This module is similar to L<Device::KeyStroke::Mobile>.
view all matches for this distribution
view release on metacpan or search on metacpan
* capable of those should have IVSIZE already. */
#if !defined(IVSIZE) && defined(LONGSIZE)
# define IVSIZE LONGSIZE
#endif
#ifndef IVSIZE
# define IVSIZE 4 /* A bold guess, but the best we can make. */
#endif
#ifndef UVSIZE
# define UVSIZE IVSIZE
#endif
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Acme/Nyaa/Ja.pm view on Meta::CPAN
return q() unless length $text;
use Encode::Guess qw(shiftjis euc-jp 7bit-jis);
$self->{'utf8flag'} = utf8::is_utf8 $text;
my $code = Encode::Guess->guess( $text );
my $name = q();
return q() unless ref $code;
# What encoding
$name = $code->name;
view all matches for this distribution
view release on metacpan or search on metacpan
OneHundredNotOut.pm view on Meta::CPAN
approach to the problem. A real profiler, however, can be constructed
from L<Devel::DProfPP>, which is sort of a profiler toolkit.
I wrote a couple of other modules with Kasei in this category,
particularly while working on our Plucene port of the Lucene search
engine. (I guess I could claim C<Plucene> as one of my 100 modules, but
that would be to deny Marc Kerr the recognition he deserves for the work
he put in to packaging, documenting and providing tests for my insane
and scrambled code.) I wrote L<Bit::Vector::Minimal>, for instance, as I
ported C<org.apache.lucene.util.BitVector>; L<Tie::Array::Stored>, which
I'm amazed wasn't already implemented on CPAN, provided the Perl
OneHundredNotOut.pm view on Meta::CPAN
n-gram) and work out how hard it is to see what's coming next.
For instance, if I feed you the 4-gram C<xylo> the chances of a C<p>
next are very high. The chances of a C<e>, or indeed anything else, are
pretty low. Low entropy area. But if I feed you C<then>, it's really not
easy to guess the next letter, since we're likely to be at the end of a
word and the next word might be anything; high entropy. That's how you
use maximal entropy to find word breaks in unsegmented text, and there's
a huge amount of other cool stuff you can do with it.
I swear the day I wrote L<Text::Ngram>, there were no other modules on
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Acme/Oppai.pm view on Meta::CPAN
sub gen_word {
my ($self, $type, $word) = @_;
return $BASIC_WORD{$type} unless $word;
return $word if utf8::is_utf8($word);
my $enc = guess_encoding($word, qw(euc-jp shiftjis 7bit-jis utf8));
return $word unless ref($enc);
$enc->decode($word);
}
sub gen {
view all matches for this distribution
view release on metacpan or search on metacpan
inc/Module/AutoInstall.pm view on Meta::CPAN
if ( @Missing and not( $CheckOnly or $UnderCPAN ) ) {
require Config;
print
"*** Dependencies will be installed the next time you type '$Config::Config{make}'.\n";
# make an educated guess of whether we'll need root permission.
print " (You may need to do that as the 'root' user.)\n"
if eval '$>';
}
print "*** $class configuration finished.\n";
inc/Module/AutoInstall.pm view on Meta::CPAN
or _load('CPANPLUS::Shell::Default')
)
);
}
# make guesses on whether we're under the CPAN installation directory
sub _under_cpan {
require Cwd;
require File::Spec;
my $cwd = File::Spec->canonpath( Cwd::cwd() );
view all matches for this distribution
view release on metacpan or search on metacpan
inc/Module/AutoInstall.pm view on Meta::CPAN
else {
print
"*** Dependencies will be installed the next time you type '$make'.\n";
}
# make an educated guess of whether we'll need root permission.
print " (You may need to do that as the 'root' user.)\n"
if eval '$>';
}
print "*** $class configuration finished.\n";
inc/Module/AutoInstall.pm view on Meta::CPAN
or _load('CPANPLUS::Shell::Default')
)
);
}
# make guesses on whether we're under the CPAN installation directory
sub _under_cpan {
require Cwd;
require File::Spec;
my $cwd = File::Spec->canonpath( Cwd::cwd() );
view all matches for this distribution
view release on metacpan or search on metacpan
inc/Module/AutoInstall.pm view on Meta::CPAN
else {
print
"*** Dependencies will be installed the next time you type '$make'.\n";
}
# make an educated guess of whether we'll need root permission.
print " (You may need to do that as the 'root' user.)\n"
if eval '$>';
}
print "*** $class configuration finished.\n";
inc/Module/AutoInstall.pm view on Meta::CPAN
or _load('CPANPLUS::Shell::Default')
)
);
}
# make guesses on whether we're under the CPAN installation directory
sub _under_cpan {
require Cwd;
require File::Spec;
my $cwd = File::Spec->canonpath( Cwd::cwd() );
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Tupelo/Munge.pm view on Meta::CPAN
Furthermore, the manner in which this module uses the tuple data type
is somewhat speculative. The Perl core does not document precisely what
kinds of operations are intended to be possible on tuples, and there is no
established common practice, so the semantics offered by this module are
in part guesses. For example, rewriting a tuple in a way that changes
the number of slots it has is something that's naturally possible to do
with the data structure, but isn't ever performed by core code, and it
might be decided in the future that it should never happen to a tuple
beyond its initial construction.
view all matches for this distribution
view release on metacpan or search on metacpan
Playwright.pm view on Meta::CPAN
'Your point being?' => 'o', 'And...?' => 'o',
'I have a picture of that on my mousepad.' => 'o', 'That stain will never come out.' => 'o',
'I tried that once, but it felt really weird.' => 'r', 'That door sure is hard to open.' => 'r',
'That really hurt.' => 'r', 'I have to delete that.' => 'r',
'It is just too big.' => 'r', 'Only when I cross my eyes.' => 'r',
'Do you really think so?' => 'r', 'I took an educated guess.' => 'r',
'Your theory is fundamentally flawed.' => 'r', "You probably shouldn't put your finger there." => 'r',
'I think you broke it.' => 's', 'It just needs new batteries.' => 's',
'How long have you known?' => 's', "You think I'm dumb, don't you?" => 's',
"I've never been so insulted." => 's', 'Sure is windy out there.' => 's',
'I wish I could fly.' => 's', 'At night the ice weasles come.' => 's',
Playwright.pm view on Meta::CPAN
@pR = (
'I tried it once, but it felt really weird.', 'That door sure is hard to open.',
'That really hurt.', 'I have to delete that.',
'It is just too big.', 'Only when I cross my eyes.',
'Do you really think so?', 'I took an educated guess.',
'Your theory is fundamentally flawed.', "You probably shouldn't put your finger there."
);
@pS = (
'I think you broke it.', 'It just needs new batteries.',
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Acme/ppport.h view on Meta::CPAN
#ifndef IVSIZE
# ifdef LONGSIZE
# define IVSIZE LONGSIZE
# else
# define IVSIZE 4 /* A bold guess, but the best we can make. */
# endif
#endif
#ifndef UVTYPE
# define UVTYPE unsigned IVTYPE
#endif
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Acme/Pythonic.pm view on Meta::CPAN
# Put an opening paren in the places we forgive parens. It will be later
# closed or removed as needed in the main subroutine.
sub left_parenthesize {
$_[0] =~ s/^(\s*\b(?:if|elsif|unless)\b\s*)/$1(/ ||
$_[0] =~ s/^(\s*(?:$id\s*:)?\s*\b(?:while|until)\b(\s*))/$2 eq '' ? "$1 (" : "$1("/eo ||
$_[0] =~ s/^(\s*(?:$id\s*:\s*)?\bfor(?:each)?\b\s*)(.*)/fortype_guesser($1,$2)/oxe
}
# Tries its best at guessing a for(each) type or, at least, where to put
# the opening paren.
#
# Returns a string which is a copy of the original with the paren
# inserted.
sub fortype_guesser {
my ($for, $rest) = @_;
my $guess = "";
# Try to match "for VAR in LIST", and "for VAR LIST"
if ($rest =~ m/^((?:my|our)? \s* \$ $id\s+) in\s* ((?: (?:[\$\@%&\\]) | (?:\b\w) ) .*)$/ox ||
$rest =~ m/^((?:my|our)? \s* \$ $id\s*) ((?: (?:[\$\@%&\\]) | (?:\b\w) ) .*)$/ox) {
$guess = "$for$1($2";
} else {
# We are not sure whether this is a for or a foreach, but it is
# very likely that putting parens around gets it right.
$rest =~ s/^\s*in\b//; # fixes "foreach in LIST"
$guess = "$for($rest";
}
return $guess;
}
# Guesses whether a block started by $id_at_sob needs a semicolon after the
# ending bracket.
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Acme/RPC.pm view on Meta::CPAN
if($$rootop and ($stashname eq $package or 'main::'.$stashname eq $package or $stashname eq 'main::' )) {
# when we eval something in code in main::, it comes up as being exported from main::. *sigh*
reg( $node->{$k.'()'}{chr(0)} = *{$package . $k}{CODE} );
}
} elsif( ref(*{$package.$k}{SCALAR}) ne 'GLOB' ) {
# found a scalar inside of the package... create an entry for the scalar itself and if it contains a ref, recurse, I guess
my $scalar = *{$package.$k}{SCALAR}; # this is a scalarref in the case of "our $var = 1" or other simple things
my $scalarcontains = $$scalar;
if(ref $scalarcontains) {
$node->{'$'.$k} = caller_cv(0)->($scalarcontains);
}
view all matches for this distribution
view release on metacpan or search on metacpan
eg/guess.pl view on Meta::CPAN
use warnings;
use Acme::Roman;
use Term::ReadLine qw( readline );
my $term = Term::ReadLine->new( 'A guessing game' );
print <<GAME;
A guessing game:
Enter roman or arabic numerals to answer.
Just ENTER to quit.
GAME
view all matches for this distribution
view release on metacpan or search on metacpan
ScriptoPhrenic.pm view on Meta::CPAN
=head1 SYNOPSIS
use Acme::ScriptoPhrenic;
path/to/script.pl
path/to/another_script.pl
path/to/you/guessed/it/another/script.pl
=head1 DESCRIPTION
Each line after the use() statement (unless empty or a comment) is considered a "personality".
view all matches for this distribution
view release on metacpan or search on metacpan
inc/Module/AutoInstall.pm view on Meta::CPAN
if ( @Missing and not( $CheckOnly or $UnderCPAN ) ) {
require Config;
print
"*** Dependencies will be installed the next time you type '$Config::Config{make}'.\n";
# make an educated guess of whether we'll need root permission.
print " (You may need to do that as the 'root' user.)\n"
if eval '$>';
}
print "*** $class configuration finished.\n";
inc/Module/AutoInstall.pm view on Meta::CPAN
or _load('CPANPLUS::Shell::Default')
)
);
}
# make guesses on whether we're under the CPAN installation directory
sub _under_cpan {
require Cwd;
require File::Spec;
my $cwd = File::Spec->canonpath( Cwd::cwd() );
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Acme/Sneeze.pm view on Meta::CPAN
=head1 TODO
=head2 LOCALIZATION
In Japan, sneezing twice implies that "someone is talking about you." I
guess I<Acme::Sneeze> should be localized to increment reference count
of the object if the users locale is set to JP.
In Poland, the common response I<Sto lat> translates as I<Hundred
years>, wishing hundred years of health to the sneezer.
I<Acme::Sneeze> should wrap I<CORE::time> in Poland maybe.
view all matches for this distribution
view release on metacpan or search on metacpan
local/lib/perl5/IO/Async/OS.pm view on Meta::CPAN
@fds = IO::Async::OS->potentially_open_fds
Returns a list of filedescriptors which might need closing. By default this
will return C<0 .. _SC_OPEN_MAX>. OS-specific subclasses may have a better
guess.
=cut
sub potentially_open_fds
{
view all matches for this distribution
view release on metacpan or search on metacpan
never croaks.
But I don't really understand how both def() and ghi() manage to see 5 args.
And I don't understand how it is that, in test1.t, def() and ghi() pass tests
3 and 4 (respectively), yet fail tests 6 and 7 respectively.
I guess it has something to do with being inside another separate package
(named Number) via method calls.
BTW, when 5 arguments are detected, the first one is a Number object - with the
four IV args that are given explicitly being tacked on behind it.
I'm pretty weak on understanding the finer points of stack manipulation.
view all matches for this distribution
view release on metacpan or search on metacpan
Makefile.PL view on Meta::CPAN
# See lib/ExtUtils/MakeMaker.pm for details of how to influence
# the contents of the Makefile that is written.
use ExtUtils::CppGuess;
my $guess = ExtUtils::CppGuess->new;
WriteMakefile(
NAME => 'Acme::TestDist::Cpp::EUMM::EUCppGuess',
AUTHOR => 'Helmut Wollmersdorfer <helmut.wollmersdorfer@gmail.com>',
ABSTRACT_FROM => 'lib/Acme/TestDist/Cpp/EUMM/EUCppGuess.pm',
Makefile.PL view on Meta::CPAN
dist => {
PREOP => 'pod2text lib/Acme/TestDist/Cpp/EUMM/EUCppGuess.pm | tee README >$(DISTVNAME)/README; chmod -R u=rwX,go=rX . ;',
COMPRESS => 'gzip -9v',
SUFFIX => '.gz',
},
$guess->makemaker_options,
TEST_REQUIRES => {
'Test::More' => '0.88',
},
META_MERGE => {
view all matches for this distribution
view release on metacpan or search on metacpan
inc/Module/AutoInstall.pm view on Meta::CPAN
else {
print
"*** Dependencies will be installed the next time you type '$make'.\n";
}
# make an educated guess of whether we'll need root permission.
print " (You may need to do that as the 'root' user.)\n"
if eval '$>';
}
print "*** $class configuration finished.\n";
inc/Module/AutoInstall.pm view on Meta::CPAN
or _load('CPANPLUS::Shell::Default')
)
);
}
# make guesses on whether we're under the CPAN installation directory
sub _under_cpan {
require Cwd;
require File::Spec;
my $cwd = File::Spec->canonpath( Cwd::cwd() );
view all matches for this distribution
view release on metacpan or search on metacpan
t/lib/Capture/Tiny.pm view on Meta::CPAN
Capture::Tiny provides a simple, portable way to capture almost anything sent
to STDOUT or STDERR, regardless of whether it comes from Perl, from XS code or
from an external program. Optionally, output can be teed so that it is
captured while being passed through to the original filehandles. Yes, it even
works on Windows (usually). Stop guessing which of a dozen capturing modules
to use in any particular situation and just use this one.
=head1 USAGE
The following functions are available. None are exported by default.
view all matches for this distribution
view release on metacpan or search on metacpan
print 1/bigf(7); # 0.14285714285714285714285714285714285714285714285714285714285714285714285714285714
In C<big()> the characters C<< . >> and C<< / >> will make it return a
Math::BigFloat- and Math::BigRat-object accordingly. Or else a Math::BigInt-object is returned.
Instead of guessing, use C<bigi>, C<bigf> and C<bigr> to return what you want.
B<Note:> Acme::Tools does not depend on Math::BigInt and
Math::BigFloat and GMP, but these four big*-subs do (by C<require>).
To use big, bigi, bigf and bigr effectively you should
install Math::BigInt::GMP and Math::BigFloat::GMP like this:
print in( 5, 1,2,3,4,6); # 0
print in( 4, 1,2,3,4,6); # 1
print in( 'a', 'A','B','C','aa'); # 0
print in( 'a', 'A','B','C','a'); # 1
I guess in perl 5.10 or perl 6 you could use the C<< ~~ >> operator instead.
=head2 in_num
Just as sub L</in>, but for numbers. Internally uses the perl operator C<< == >> instead of C< eq >.
In that case C<< $ENV{CONTENT_LENGTH} >> is taken as the number of bytes to be read from C<STDIN>
and those bytes are used as the missing input argument.
The environment variables QUERY_STRING, REQUEST_METHOD and CONTENT_LENGTH is
typically set by a web server following the CGI standard (which Apache and
most of them can do I guess) or in mod_perl by Apache. Although you are
probably better off using L<CGI>. Or C<< $R->args() >> or C<< $R->content() >> in mod_perl.
B<Output:>
C<webparams()> returns a hash of the key/value pairs in the input argument. Url-decoded.
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Acme/YAPC/Okinawa/ppport.h view on Meta::CPAN
#ifndef IVSIZE
# ifdef LONGSIZE
# define IVSIZE LONGSIZE
# else
# define IVSIZE 4 /* A bold guess, but the best we can make. */
# endif
#endif
#ifndef UVTYPE
# define UVTYPE unsigned IVTYPE
#endif
view all matches for this distribution
view release on metacpan or search on metacpan
0.03 Wed Sep 24 20:54:40 BST 2003
Turn this file the other way up, so recent changes are at the top
It seems that Test::Harness now turns on warnings everywhere
(not just pre 5.8.0)
I guess I assumed that it was 5.6.x because I'd upgraded T::H on
my 5.6.1 install.
Anyway, bad modules can now be bad, and all the tests pass.
0.02 Mon Oct 14 22:10:26 BST 2002
Inspiration on the way home from work - use a "# line " directive to
view all matches for this distribution
view release on metacpan or search on metacpan
lib/ActiveRecord/Simple.pm view on Meta::CPAN
type => 'one',
};
my $primary_key = $params->{pk} ||
$params->{primary_key} ||
_guess(primary_key => $class);
my $foreign_key = $params->{fk} ||
$params->{foreign_key} ||
_guess(foreign_key => $rel_class);
$new_relation->{params} = {
pk => $primary_key,
fk => $foreign_key,
};
lib/ActiveRecord/Simple.pm view on Meta::CPAN
};
$params ||= {};
my $primary_key = $params->{pk} ||
$params->{primary_key} ||
_guess(primary_key => $class);
my $foreign_key = $params->{fk} ||
$params->{foreign_key} ||
_guess(foreign_key => $class);
$new_relation->{params} = {
pk => $primary_key,
fk => $foreign_key,
};
lib/ActiveRecord/Simple.pm view on Meta::CPAN
$params ||= {};
#my ($primary_key, $foreign_key);
my $primary_key = $params->{pk} ||
$params->{primary_key} ||
_guess(primary_key => $class);
my $foreign_key = $params->{fk} ||
$params->{foreign_key} ||
_guess(foreign_key => $class);
$new_relation->{params} = {
pk => $primary_key,
fk => $foreign_key,
};
lib/ActiveRecord/Simple.pm view on Meta::CPAN
say $@ if $@;
}
sub _guess {
my ($what_key, $class) = @_;
return 'id' if $what_key eq 'primary_key';
#eval { load $class }; ### TODO: check class has been loaded
view all matches for this distribution