RSION = '0.03';
# ABSTRACT: Easy creation of keyboards for Telegram bots
use common::sense;
use JSON::MaybeXS;
use Encode qw(decode);
use Exporter qw(import);
our @EXPORT_OK = qw(create_one_time_ke
keyboard => \@keyboard,
one_time_keyboard => JSON::MaybeXS::JSON->true
);
my $json = JSON::MaybeXS->new(utf8 => 1);
return decode('UTF-8', $json->encode(\%rpl_markup));
}
sub create_inline_k
}
}
my %rpl_markup = (
inline_keyboard => \@keyboard
);
my $json = JSON::MaybeXS->new(utf8 => 1);
return decode('UTF-8', $json->encode(\%rpl_markup));
}
sub available_keys {
my $arr = shif
eded.
my $creds = $main->buildCredentials();
my $response = $main->sendRequest('PUT', 'application/json', $creds, $main->defaultUrl . $uri, $vars);
return $response;
}
1;
rictures 1;
use utf8;
use 5.018;
=head1 NAME
Bio::WebService::LANL::SequenceLocator::Server - A JSON web API for LANL's HIV sequence locator
=head1 SYNOPSIS
After installation:
plackup `perld
managed service:
examples/service start
=head1 DESCRIPTION
This server powers
L<a simple, JSON-based web API|https://indra.mullins.microbiol.washington.edu/locate-sequence/>
for the L<LANL's H
Simple;
use Bio::WebService::LANL::SequenceLocator;
use File::Share qw< dist_file >;
use JSON qw< encode_json >;
use Text::CSV;
use Plack::App::File;
use Path::Tiny;
use IO::String;
has contact => (
ded.
my $creds = $main->buildCredentials();
my $response = $main->sendRequest('POST', 'application/json', $creds, $main->defaultUrl . $uri, $vars);
return $response;
}
1;
PUT
json
plain
headers
response
http_get
http_post
http_put
http_delete
http_head
http_upload
json_get
json_post
json_put
json_head
/;
use
LWP::UserAgent;
use HTTP::Request;
use Try::Tiny;
use JSON;
our $VERSION = '0.20';
my $user_agent = "LWP::Simple::REST";
my $lwp = LWP::UserAgent->new;
my $response;
sub user_agent { $lwp->agent(
$_[0] ) }
sub response { $response }
sub plain { return ($_[0]->content ) }
sub json { return decode_json($_[0]->content ) }
sub headers { return $_[0] ? $_[0]->headers : $response->headers };
s
sts into stash. Then, Extends with Class::Trigger!
=head1 SYNOPSIS
use Stash::REST;
use JSON;
$obj = Stash::REST->new(
do_request => sub {
my $req = shift;
},
decode_response => sub {
my $res = shift;
return decode_json($res->content);
}
);
# you can write/read stash anytime
$obj->stash('foo') #
u can use this to modify the default HTTP::Request::Common header for $data
# POST body with JSON:
$obj->rest_post(
'/post-with-params?api_key=1',
stash => 'testparams',
ginal API interface and
simply supplies an OO interface in perl to abstract the need to construct JSON and
web calls. It also uses all of the standard perl modules around these. Below is the
list of a
u with the examples for each of the calls. Each call returns a hashref
that contains the response JSON from Docusign. Errors are passed back with a single
reference $response->{error}. This will conta
use strict;
use JSON;
use GD;
my %wht;
for my $ix (0..9) {
my $myImage = newFromPng GD::Image("gray-$ix.png",0);
my @weights;
# 10x10 image
for my $column (0..9) {
for my $row (
my $weight = 255 - $index;
push @weights,$weight;
}
}
$wht{$ix} = [@weights];
}
my $json = to_json(\%wht);
open my $fd,">","weights.json" or die $!;
print $fd $json;
close $fd;
ent;
use 5.10.0;
use strict;
use warnings;
our $VERSION = "1.00";
use Carp qw(carp cluck);
use JSON::XS;
use HTTP::Request;
use LWP::UserAgent;
use Class::Tiny qw(token uri no_verify debug errstr)
ebug;
my $obj;
eval { $obj = decode_json $response->decoded_content };
if ($@) {
$self->errstr('LoginError: API did not return valid JSON') and return;
}
if (!$response->is
lf->debug;
my $obj;
eval { $obj = decode_json $response->decoded_content };
if ($@) {
$self->errstr('RequestError: API did not return valid JSON') and return;
}
if (!$response->is_succ
package Net::MachineLearning::Sample;
use 5.006;
use strict;
use warnings;
use utf8;
use JSON;
use GD;
=encoding utf8
=head1 NAME
Net::MachineLearning::Sample - how machine learning works by demo
的相似概率,数字越大相似度越高。
权重参数是一个JSON文件,位于库文件同一目录下的weights.json,通过get_weights.pl这个脚本产生。
正常来说,权重参
0);
my %scores;
open my $fd,"$module_dir/weights.json" or die $!;
my $json = <$fd>;
close $fd;
my $wht = from_json($json);
my $myImage = newFromPng GD::Image("$module_dir/gr
eld};
}
sub DESTROY { }
1;
__END__
=encoding utf-8
=head1 NAME
Megaport::Internal::_Obj - Turn JSON objects into Perl objects with accessors
=head1 SYNOPSIS
my $eq1 = $mp->session->locations-
ance = rule_VersionsToCode( @args );
=head1 METHODS
=head2 C<filter_plaintext>
=begin MetaPOD::JSON v1.1.0
{
"namespace":"CPAN::Changes::Markdown::Filter::Rule::VersionsToCode",
"interface
o::Object",
"does":"CPAN::Changes::Markdown::Role::Filter::Rule::PlainText"
}
=end MetaPOD::JSON
=head1 AUTHOR
Kent Fredric <kentnl@cpan.org>
=head1 COPYRIGHT AND LICENSE
This software is co
ev directory
=begin MetaPOD::JSON v1.1.0
{
"namespace":"Path::FindDev::Object",
"interface":"class",
"inherits":"Class::Tiny::Object"
}
=end MetaPOD::JSON
=head1 AUTHOR
Kent Fredric
ld_dist_dir> also apply to this method.
=begin MetaPOD::JSON v1.0.0
{
"namespace":"File::ShareDir::ProjectDistDir"
}
=end MetaPOD::JSON
=head1 SIGNIFICANT CHANGES
=head2 1.000000
=head3 Str
s.
=begin MetaPOD::JSON v1.1.0
{
"namespace":"Dist::Zilla::Util::EmulatePhase::PrereqCollector",
"interface":"class",
"inherits":"Moose::Object"
}
=end MetaPOD::JSON
=head1 AUTHOR
Ke
icense' );
_add_phase( q[-MetaProvider] => q[something that provides metadata (for META.yml/json)], 'metadata' );
_add_phase( q[-MintingProfile] => q[something that can find a minting
( =AutoPrereqs )],
});
=begin MetaPOD::JSON v1.1.0
{
"namespace":"Dist::Zilla::Util::EmulatePhase",
"interface":"exporter"
}
=end MetaPOD::JSON
=head1 AUTHOR
Kent Fredric <kentnl@cpan
de )],
handles => { _decode => 'execute', },
);
sub _build__decoder {
require JSON::MaybeXS;
my $decoder = JSON::MaybeXS->new()->utf8(1)->relaxed(1);
return sub {
$decoder->decode(shift);
> sub { q{0.1.0} },
);
class_has '_extension' => (
isa => Str,
ro, lazy, default => sub { q{.json} },
);
class_has '_schema_creator' => (
isa => CodeRef,
ro, lazy_build,
traits => [qw( Co
pts) );
}
sub check {
my ( $self, $json_data, $opts ) = @_;
$opts = $self->_opt_check($opts);
return $self->_schema($opts)->check($json_data);
}
1;
__END__
=pod
=encoding UTF-8
=
:Heuristic::MYMETA;
our $VERSION = '1.001003';
# ABSTRACT: Determine if a path contains MYMETA.(json|yml)
our $AUTHORITY = 'cpan:KENTNL'; # AUTHORITY
use Role::Tiny::With qw( with )
'Path::IsDev::Role::Matcher::Child::Exists::Any::File';
sub files {
return qw( MYMETA.json MYMETA.yml );
}
sub matches {
my ( $self, $result_object ) = @_;
if ( $self->child_exi
ncoding UTF-8
=head1 NAME
Path::IsDev::Heuristic::MYMETA - Determine if a path contains MYMETA.(json|yml)
=head1 VERSION
version 1.001003
=head1 DESCRIPTION
This heuristic is intended as a guara
te_bundle('Example::Author::KENTNL');
$bundle->configure;
my @stopwords = (
qw(
MetaEbuild json ShareDir
)
);
for my $wordlist (@stopwords) {
$bundle->add_or_append_policy_field( 'Documen