view release on metacpan or search on metacpan
lib/Acme/EnclosedChar.pm view on Meta::CPAN
Acme::EnclosedChar generates Enclosed Alphanumerics.
=head1 METHOD
=head2 enclose($decoded_text)
encode text into Enclosed Alphanumerics
=head2 enclose_katakana($decoded_text)
Also Japanese Katakana will be encoded.
=head2 enclose_week_ja($decoded_text)
Also Japanese day of week will be encoded.
=head2 enclose_kansuji($decoded_text)
Also Japanese kansuji will be encoded.
=head2 enclose_kanji($decoded_text)
Also Japanese kanji will be encoded.
=head2 enclose_all($decoded_text)
enclose text as far as possible
=head1 REPOSITORY
view all matches for this distribution
view release on metacpan or search on metacpan
=item query specific I<[turn]>
Two scalars are I<$state> and specially encoded I<$rule>
(refer to L<B<query_switch()> method|/query_switch()> about encoding).
If I<$rule> can't be decoded then B<croak>s.
Returns (after verification) requested I<$rule> as ARRAY.
While straightforward I<[turn]>s (such as C<tturn>, C<fturn>, and such) could
be in fact queried through L<B<fst()> method|/fst()> turn map needs bit more
sophisticated handling;
and that's what B<turn()> does;
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Acme/Free/API/Geodata/GeoIP.pm view on Meta::CPAN
my $url = "http://ip-api.com/json/" . $ip;
my $content = $self->_fetchURL($url);
my $ok = 0;
my $decoded;
eval {
$decoded = decode_json($content);
$ok = 1;
};
if(!$ok || !defined($decoded)) {
$self->_debuglog("Failed to decode response. Not a JSON document?");
$self->_debuglog(Dumper($decoded));
return;
}
#$self->_debuglog(Dumper($decoded));
return $decoded;
}
# internal helpers
lib/Acme/Free/API/Geodata/GeoIP.pm view on Meta::CPAN
if(!defined($response)) {
$self->_debuglog("Could not get agent response");
return;
}
my $content = $response->decoded_content;
if(!defined($content) || !length($content)) {
$self->_debuglog("Could not get response content");
return;
}
view all matches for this distribution
view release on metacpan or search on metacpan
script/gen-generic-ind-company-names view on Meta::CPAN
# }
#
# \@argv;
#}
#
## return ($err, $res, $decoded_val)
#sub _parse_raw_value {
# my ($self, $val, $needs_res) = @_;
#
# if ($val =~ /\A!/ && $self->{enable_encoding}) {
#
script/gen-generic-ind-company-names view on Meta::CPAN
# # key line
# if ($line =~ /^\s*([^=]+?)\s*=\s*(.*)/) {
# my $key = $1;
# my $val = $2;
#
# # the common case is that value are not decoded or
# # quoted/bracketed/braced, so we avoid calling _parse_raw_value here
# # to avoid overhead
# if ($val =~ /\A["!\\[\{~]/) {
# $_raw_val = $val if $cb;
# my ($err, $parse_res, $decoded_val) = $self->_parse_raw_value($val);
# $self->_err("Invalid value: " . $err) if $err;
# $val = $decoded_val;
# } else {
# $_raw_val = $val if $cb;
# $val =~ s/\s*[#;].*//; # strip comment
# }
#
script/gen-generic-ind-company-names view on Meta::CPAN
#C<section> (str, section name).
#
#=item * Found a key line
#
#Arguments passed: C<event> (str, 'section'), C<linum>, C<line>, C<cur_section>,
#C<key> (str, key name), C<val> (any, value name, already decoded if encoded),
#C<raw_val> (str, raw value).
#
#=back
#
#TODO: callback when there is merging.
view all matches for this distribution
view release on metacpan or search on metacpan
t/01_spec.t view on Meta::CPAN
{
my $name = 'encodes and decodes JWTs';
my $secret = 'secret';
my $jwt = Acme::JWT->encode($payload, $secret);
my $decoded_payload = Acme::JWT->decode($jwt, $secret);
is_d $decoded_payload, $payload, $name;
}
{
my $algorithm = 'HS512';
t/01_spec.t view on Meta::CPAN
$algorithm = 'RS256';
}
my $name = 'encodes and decodes JWTs for RSA signaturese';
my $rsa = Crypt::OpenSSL::RSA->generate_key(512);
my $jwt = Acme::JWT->encode($payload, $rsa->get_private_key_string, $algorithm);
my $decoded_payload = Acme::JWT->decode($jwt, $rsa->get_public_key_string);
is_d $decoded_payload, $payload, $name;
}
{
my $name = 'decodes valid JWTs';
my $example_payload = {hello => 'world'};
my $example_secret = 'secret';
my $example_jwt = 'eyJhbGciOiAiSFMyNTYiLCAidHlwIjogIkpXVCJ9.eyJoZWxsbyI6ICJ3b3JsZCJ9.tvagLDLoaiJKxOKqpBXSEGy7SYSifZhjntgm9ctpyj8';
my $decoded_payload = Acme::JWT->decode($example_jwt, $example_secret);
is_d $decoded_payload, $example_payload, $name;
}
{
my $name = 'raises exception with wrong hmac key';
my $right_secret = 'foo';
t/01_spec.t view on Meta::CPAN
{
my $name = 'allows decoding without key';
my $right_secret = 'foo';
my $bad_secret = 'bar';
my $jwt = Acme::JWT->encode($payload, $right_secret);
my $decoded_payload = Acme::JWT->decode($jwt, $bad_secret, 0);
is_d $decoded_payload, $payload, $name;
}
{
my $name = 'raises exception on unsupported crypto algorithm';
eval {
t/01_spec.t view on Meta::CPAN
{
my $name = 'encodes and decodes plaintext JWTs';
my $jwt = Acme::JWT->encode($payload, undef, 0);
is((my @a = split(/\./, $jwt)), 2, $name . '(length)');
my $decoded_payload = Acme::JWT->decode($jwt, undef, 0);
is_d $decoded_payload, $payload, $name;
}
done_testing;
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Acme/MetaSyntactic/RemoteList.pm view on Meta::CPAN
}
# extract, cleanup and return the data
# if decoding the content fails, we just deal with the raw content
push @items =>
$class->extract( $res->decoded_content() || $res->content(),
$category || () );
}
# return unique items
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Acme/RFC4824.pm view on Meta::CPAN
my $self = shift;
my $arg_ref = shift;
my $frame = $arg_ref->{FRAME};
if (! defined $frame) {
croak "You need to pass a frame to be decoded.";
}
my $last_frame_undo = rindex $frame, 'T';
if ($last_frame_undo > 0) {
# if a FUN was found, take everything to the right to be the
# new frame.
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Acme/RPC.pm view on Meta::CPAN
Then go to:
http://localhost:7777/?path=%24test2/add()&action=call&arg0=10&arg1=15
The C<path> part, decoded, reads C<< $test2/add() >>.
=head1 DESCRIPTION
By my estimate, there are over 10,000 RPC modules on CPAN. Each one makes RPC more
difficult than the one before it. They all want you to pass tokens back and forth,
view all matches for this distribution
view release on metacpan or search on metacpan
local/lib/perl5/IO/Async/Stream.pm view on Meta::CPAN
=head2 encoding => STRING
If supplied, sets the name of encoding of the underlying stream. If an
encoding is set, then the C<write> method will expect to receive Unicode
strings and encodes them into bytes, and incoming bytes will be decoded into
Unicode strings for the C<on_read> event.
If an encoding is not supplied then C<write> and C<on_read> will work in byte
strings.
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Acme/SuddenlyDeath.pm view on Meta::CPAN
our @EXPORT = qw/ sudden_death sudden_death_single /;
use version; our $VERSION = '0.09';
sub _generator {
my $decoded_str = shift;
my @decoded_lines = split /\n/, $decoded_str;
my $max_length = 0;
$max_length = $_ > $max_length ? $_ : $max_length
for map {Text::VisualWidth::UTF8::width($_)} @decoded_lines;
my $ascii = [];
my $frame_length = ($max_length + 2) / 2;
push @{$ascii}, '_' . '人' x $frame_length . '_';
for my $line (@decoded_lines) {
my $str_length = $max_length - Text::VisualWidth::UTF8::width($line);
my ($left, $right) = map{' ' x $_} ($str_length / 2, $str_length / 2);
$left = $str_length % 2 != 0 ? $left . ' ' : $left;
push @{$ascii}, 'ï¼ ' . $left . $line . $right . ' ï¼';
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Acme/Timecube.pm view on Meta::CPAN
sub new {
my $class = shift;
my $self = {};
bless $self, $class;
$self->{ua} = LWP::UserAgent->new;
$self->{wisdom} = HTML::TreeBuilder->new_from_content( $self->{ua}->get( 'http://www.timecube.com' )->decoded_content );
$self->{wisdom} or die "Couldn't fetch wisdom...\n";
@{ $self->{verses} } = $self->{wisdom}->find_by_tag_name( 'p' );
return $self
}
view all matches for this distribution
view release on metacpan or search on metacpan
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.
If an input string has more than one occurrence of the same key, that keys value in the returned hash will become concatenated each value separated by a C<,> char. (A comma char)
Examples:
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Acme/eng2kor.pm view on Meta::CPAN
Used google translate api
=head2 get_json
Return decoded json text after HTTP IO.
=head1 SUPPORT LANGUAGES
Google translate available language list is below.
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Activiti/Rest/Response.pm view on Meta::CPAN
$new_args{content} = $res->content;
if($content_type =~ /json/o){
$new_args{parsed_content} = JSON::decode_json($res->content);
}elsif($content_type =~ /(xml|html)/o){
$new_args{parsed_content} = $res->decoded_content();
}
}
__PACKAGE__->new(%new_args);
view all matches for this distribution
view release on metacpan or search on metacpan
lib/AddressBook/DB/BBDB.pm view on Meta::CPAN
(birthday "6/15")
)
nil The cache vector - always nil
]
After this is decoded it will be returned as a reference to a BBDB
object. The internal structure of the BBDB object mimics the lisp
structure of the BBDB string. It consists of a reference to an array
with 9 elements The Data::Dumper output of the above BBDB string would
just replaces all of the ()s with []s. It can be accessed by using
the C<$bbdb->part('all')> method.
lib/AddressBook/DB/BBDB.pm view on Meta::CPAN
=head1 BUGS
Phone numbers and zip codes may be converted from strings to integers
if they are decoded and encoded. This should not affect the operation
of BBDB. Also a null last name is converted from "" to nil, which
also doesn't hurt anything.
You might ask why I use arrays instead of hashes to encode the data in
the BBDB file. The answer is that order matters in the bbdb file, and
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Aion/Surf.pm view on Meta::CPAN
my $response = $ua->request($request);
$$response_set = $response if ref $response_set;
return $response->is_success if $method eq "HEAD";
my $content = $response->decoded_content;
eval { $content = Aion::Format::Json::from_json($content) } if $content =~ m!^\{!;
$content
}
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Akado/Account.pm view on Meta::CPAN
# Here we get account data using session cookies that we got at the
# previous step
my $data_response = $self->_get_data_response($browser);
my $xml = $data_response->decoded_content;
return $xml;
}
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Akamai/PropertyFetcher.pm view on Meta::CPAN
# Endpoint to retrieve contract IDs
my $contracts_endpoint = "$baseurl/papi/v1/contracts";
my $contracts_resp = $agent->get($contracts_endpoint);
die "Error retrieving contract ID: " . $contracts_resp->status_line unless $contracts_resp->is_success;
my $contracts_data = decode_json($contracts_resp->decoded_content);
my @contract_ids = map { $_->{contractId} } @{ $contracts_data->{contracts}->{items} };
# Endpoint to retrieve group IDs
my $groups_endpoint = "$baseurl/papi/v1/groups";
my $groups_resp = $agent->get($groups_endpoint);
die "Error retrieving group ID: " . $groups_resp->status_line unless $groups_resp->is_success;
my $groups_data = decode_json($groups_resp->decoded_content);
my @group_ids = map { $_->{groupId} } @{ $groups_data->{groups}->{items} };
# Process all combinations of contract IDs and group IDs
foreach my $contract_id (@contract_ids) {
foreach my $group_id (@group_ids) {
my $properties_endpoint = "$baseurl/papi/v1/properties?contractId=$contract_id&groupId=$group_id";
my $properties_resp = $agent->get($properties_endpoint);
if ($properties_resp->is_success) {
# Retrieve property information
my $properties_data = decode_json($properties_resp->decoded_content);
my $properties = $properties_data->{properties}->{items};
foreach my $property (@$properties) {
# Fork a new process for each property
$pm->start and next;
lib/Akamai/PropertyFetcher.pm view on Meta::CPAN
# Retrieve activated version information
my $activations_endpoint = "$baseurl/papi/v1/properties/$property_id/activations?contractId=$contract_id&groupId=$group_id";
my $activations_resp = $agent->get($activations_endpoint);
if ($activations_resp->is_success) {
my $activations_data = decode_json($activations_resp->decoded_content);
# Sort activations to get the latest active versions for STAGING and PRODUCTION
my ($staging_version, $production_version);
foreach my $activation (sort { $b->{propertyVersion} <=> $a->{propertyVersion} } @{ $activations_data->{activations}->{items} }) {
if (!defined $staging_version && $activation->{network} eq 'STAGING' && $activation->{status} eq 'ACTIVE') {
lib/Akamai/PropertyFetcher.pm view on Meta::CPAN
if (defined $staging_version) {
my $staging_rules_endpoint = "$baseurl/papi/v1/properties/$property_id/versions/$staging_version/rules?contractId=$contract_id&groupId=$group_id";
my $staging_rules_resp = $agent->get($staging_rules_endpoint);
if ($staging_rules_resp->is_success) {
my $staging_rules_content = $staging_rules_resp->decoded_content;
my $staging_file_path = File::Spec->catfile($property_dir, "staging.json");
open my $fh, '>', $staging_file_path or die "Failed to create file: $staging_file_path";
print $fh $staging_rules_content;
close $fh;
lib/Akamai/PropertyFetcher.pm view on Meta::CPAN
if (defined $production_version) {
my $production_rules_endpoint = "$baseurl/papi/v1/properties/$property_id/versions/$production_version/rules?contractId=$contract_id&groupId=$group_id";
my $production_rules_resp = $agent->get($production_rules_endpoint);
if ($production_rules_resp->is_success) {
my $production_rules_content = $production_rules_resp->decoded_content;
my $production_file_path = File::Spec->catfile($property_dir, "production.json");
open my $fh, '>', $production_file_path or die "Failed to create file: $production_file_path";
print $fh $production_rules_content;
close $fh;
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Algorithm/Evolutionary/Individual/BitString.pm view on Meta::CPAN
print $indi3->as_yaml() #Change of convention, I know...
my $gene_size = 5;
my $min = -1;
my $range = 2;
my @decoded_vector = $indi3->decode( $gene_size, $min, $range);
=head1 Base Class
L<Algorithm::Evolutionary::Individual::String>
view all matches for this distribution
view release on metacpan or search on metacpan
the second arrayref.
Both arrays must have exactly C<data_blocks> entries.
This method also reorders the blocks and index array in place (if
necessary) to reflect the order the blocks will have in the decoded
result.
The index array represents the decoded ordering, in that the n-th entry
in the indices array corresponds to the n-th data block of the decoded
result. The value stored in the n-th place in the array will contain the
index of the encoded data block.
Input blocks with indices less than C<data_blocks> will be moved to their
final position (block k to position k), while the gaps between them will
be filled with check blocks. The decoding process will not modify the
already decoded data blocks, but will modify the check blocks.
That is, if you call this function with C<indices = [4,3,1]>, with
C<data_blocks = 3>, then this array will be returned: C<[0,2,1]>. This
means that input block C<0> corresponds to file block C<0>, input block
C<1> to file block C<2> and input block C<2> to data block C<1>.
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Algorithm/IRCSRP2/Alice.pm view on Meta::CPAN
sub verify_srpa1 {
my ($self, $msg) = @_;
$msg =~ s/^\+srpa1 //;
my $decoded = MIME::Base64::decode_base64($msg);
my $s = substr($decoded, 0, 32, '');
$self->s($s);
my $B = $self->B(bytes2int($decoded));
if ($B->copy->bmod(N()) != 0) {
$self->state('srpa1');
return $self->srpa2();
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Alien/Base/ModuleBuild/Repository/HTTP.pm view on Meta::CPAN
sub check_http_response {
my ( $self, $res ) = @_;
if ( blessed $res && $res->isa( 'HTTP::Response' ) ) {
my %headers = map { lc $_ => $res->header($_) } $res->header_field_names;
if ( !$res->is_success ) {
return ( 1, $res->status_line . " " . $res->decoded_content, \%headers, $res->request->uri );
}
return ( 0, $res->decoded_content, \%headers, $res->request->uri );
}
else {
if ( !$res->{success} ) {
my $reason = $res->{status} == 599 ? $res->{content} : "@{[ $res->{status} ]} @{[ $res->{reason} ]}";
if($res->{status} == 599 && $reason =~ /https support/)
view all matches for this distribution
view release on metacpan or search on metacpan
0.04 2019-08-30 02:33:59 -0400
- Fix "wide character in subroutine entry" diagnostic.
0.03 2019-04-09 04:33:06 -0400
- Fixed bug where json was improperly decoded for fetch plugins that use temp files (gh#4,gh#5)
- Added a number of unit tests (gh#2, gh#5)
- Fixed bug where version wasn't being correctly parsed from the index (gh#1, gh#5)
0.02 2019-04-08 21:14:57 -0400
- Update documentation.
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Alien/Build.pm view on Meta::CPAN
match, or if no plugin provides the correct algorithm for checking the
signature.
=head2 decode
my $decoded_res = $build->decode($res);
Decode the HTML or file listing returned by C<fetch>. Returns the same
hash structure described below in the
L<decode hook|Alien::Build::Manual::PluginAuthor/"decode hook"> documentation.
view all matches for this distribution
view release on metacpan or search on metacpan
src/Source/FreeImage/PluginG3.cpp view on Meta::CPAN
}
}
*/
// open a temporary memory buffer to save decoded scanlines
memory = FreeImage_OpenMemory();
if(!memory) throw FI_MSG_ERROR_MEMORY;
// wrap the raw fax file
faxTIFF = TIFFClientOpen("(FakeInput)", "w",
src/Source/FreeImage/PluginG3.cpp view on Meta::CPAN
}
// ... resolution
FreeImage_SetDotsPerMeterX(dib, (unsigned)(resX/0.0254000 + 0.5));
FreeImage_SetDotsPerMeterY(dib, (unsigned)(resY/0.0254000 + 0.5));
// read the decoded scanline and fill the bitmap data
FreeImage_SeekMemory(memory, 0, SEEK_SET);
BYTE *bits = FreeImage_GetScanLine(dib, rows - 1);
for(int k = 0; k < rows; k++) {
FreeImage_ReadMemory(bits, linesize, 1, memory);
bits -= pitch;
view all matches for this distribution
view release on metacpan or search on metacpan
src/judy-1.0.5/doc/int/10minutes.htm view on Meta::CPAN
</A>
There are three kinds of branches. Two are 1-cache-line fill objects to traverse, and one is a 2-cache-line fill object to traverse. In every path down the tree and at all populations, a maximum of one of the 2-cache-line fill branches is used. This ...
<P CLASS="Body">
<A NAME="pgfId=997383">
</A>
On the other extreme, a highly populated Judy1 tree where the key has been decoded down to 1 byte, and the density of a 256-wide sub-expanse of keys grows to greater than 0.094 (25 keys / 256 expanse), a bitmap of 32 bytes (256 bits) is formed from a...
<P CLASS="Body">
<A NAME="pgfId=997579">
</A>
Notice that to insert or delete a key is almost as simple as setting or clearing a bit. Also notice, the memory consumption is almost the same for both 32- and 64-bit Judy trees. Given the same set of keys, both 32- and 64-bit Judy trees have remarka...
<P CLASS="Body">
view all matches for this distribution
view release on metacpan or search on metacpan
src/subversion/subversion/bindings/ctypes-python/csvn/repos.py view on Meta::CPAN
"""Get the parent directory of this URI"""
pool = Pool()
return RepositoryURI(svn_path_dirname(self, pool))
def relative_path(self, uri, encoded=True):
"""Convert the supplied URI to a decoded path, relative to me."""
pool = Pool()
if not encoded:
uri = svn_path_uri_encode(uri, pool)
child_path = svn_path_is_child(self, uri, pool) or uri
return str(svn_path_uri_decode(child_path, pool))
view all matches for this distribution
view release on metacpan or search on metacpan
inc/Pod/Snippets.pm view on Meta::CPAN
=item B<< -impure => "error" >>
=item B<< -overlap => "ignore" >> and so on
The parse flags to use for handling errors, properly decoded from the
B<-named_snippets> named argument to L</load>.
=back
=cut
view all matches for this distribution
view release on metacpan or search on metacpan
share/swagger-ui-bundle.js.map view on Meta::CPAN
{"version":3,"sources":["webpack://SwaggerUIBundle/webpack/universalModuleDefinition","webpack://SwaggerUIBundle/webpack/bootstrap","webpack://SwaggerUIBundle/./node_modules/react/react.js","webpack://SwaggerUIBundle/./node_modules/immutable/dist/imm...
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Alien/Taco/Transport.pm view on Meta::CPAN
return bless $self, $class;
}
=item read()
Attempt to read a message from the input filehandle. Returns the decoded
message as a data structure or undef if nothing was read.
=cut
sub read {
view all matches for this distribution