.
Benchmark cloning a 10k-element array (C<< bencher -m CloneModules::Startup --include-datasets-json '["array10k"]' >>):
+------------------------------+-----------+------------------------+------
---+
Benchmark cloning a 10k-pair hash (C<< bencher -m CloneModules::Startup --include-datasets-json '["hash10k"]' >>):
+------------------------------+-----------+------------------------+-------
-amd64 >>.
Benchmark cloning a 10k-element array (C<< bencher -m CloneModules --include-datasets-json '["array10k"]' >>):
+------------------------+-----------+-----------+------------+---------+--
--+---------+
Benchmark cloning a 10k-pair hash (C<< bencher -m CloneModules --include-datasets-json '["hash10k"]' >>):
+------------------------+-----------+-----------+------------+---------+---
ient::Simple;
# ABSTRACT: a client that submits to Metabase servers
our $VERSION = '0.012';
use JSON::MaybeXS;
use HTTP::Tiny 0.056; # can_ssl
use URI;
my @valid_args;
BEGIN {
@valid_args = qw
=> {
Content_Type => 'application/json',
Accept => 'application/json',
},
content => JSON::MaybeXS->new( { ascii => 1 } )->encode( $fact->
=> {
Content_Type => 'application/json',
Accept => 'application/json',
},
content => JSON::MaybeXS->new( { ascii => 1 } )
->
:Target::VERSION = '0.904';
use Moo;
use IO::All;
use IPC::Open3 ();
use Installer::Software;
use JSON_File;
use File::chdir;
use CPAN::Perl::Releases qw[perl_tarballs];
use Installer::cpanm;
use CPAN
o',
lazy => 1,
default => sub {
my ( $self ) = @_;
tie(my %meta,'JSON_File',file($self->installer_dir,'meta.json')->absolute->stringify, pretty => 1);
return \%meta;
},
);
sub insta
d_json_schema {
my ($data_or_json) = @_;
require File::Slurper;
require File::ShareDir;
require JSON::MaybeXS;
require JSON::Schema;
require Scalar::Util;
# decode JSON u
::Util::reftype($data_or_json);
if ($ref and $ref =~ /^HASH|ARRAY$/) {
$data = $data_or_json;
} else {
$data = JSON::MaybeXS::decode_json($data_or_json);
}
my $schema_
ark-anything-schema.json');
my $schema_json = File::Slurper::read_text($schema_file);
my $schema = JSON::MaybeXS::decode_json($schema_json);
my $validator = JSON::Schema->new($schem
;
use strict;
use warnings;
package Metabase::Report;
our $VERSION = '0.025';
use Carp ();
use JSON::MaybeXS ();
use Metabase::Fact;
our @ISA = qw/Metabase::Fact/;
#------------------------------
osed};
my $content = [ map { $_->as_struct } @{ $self->content } ];
my $encoded = eval { JSON::MaybeXS->new(ascii => 1)->encode($content) };
Carp::confess $@ if $@;
return $encoded;
}
{
my ( $self, $string ) = @_;
$string = $$string if ref $string;
my $fact_structs = JSON::MaybeXS->new(ascii => 1)->decode($string);
my @facts;
for my $struct (@$fact_structs) {
ta::UUID ();
use MIME::Base64 ();
use AnyEvent ();
use AnyEvent::Handle ();
use JSON::XS ();
use HTTP::Status ();
use URI::Escape::XS qw(uri_escape);
use AnyEvent::Util (
less ( ref( $args{on_eof} ) eq 'CODE' ) {
confess 'on_eof is not CODE';
}
my $json = JSON::XS->new->utf8;
my ( $read, $write ) = AnyEvent::Util::portable_pipe;
my $hdl = AnyEv
return;
}
my @entries;
eval {
@entries = $json->incr_parse( @_ );
foreach ( @entries ) {
unless ( ref( $_ )
package Web::ChromeLogger;
use 5.008005;
use strict;
use warnings;
our $VERSION = "0.06";
use JSON::XS qw//;
use MIME::Base64 qw//;
sub new {
my $class = shift;
my %args = @_==1 ? %{$_[0]}
represent in JSON.
$self->{'json_encoder'} ||= JSON::XS->new()->ascii(1)->convert_blessed->allow_unknown;
$self->{'logs'} = [];
return $self;
}
sub json_encoder { $_[0]->{json_encoder} }
b to_json {
my ($self, $stuff) = @_;
"$stuff"
}
sub encode {
my ($self, $rows) = @_;
no warnings 'once';
local *UNIVERSAL::TO_JSON = sub { $self->to_json(@_) };
my $json_data
installation
$Installer::Software::VERSION = '0.904';
use Moo;
use IO::All;
use IO::All::LWP;
use JSON_File;
use Path::Class;
use File::chdir;
use Archive::Extract;
use namespace::clean;
has target =
y => 1,
default => sub {
my ( $self ) = @_;
tie(my %meta,'JSON_File',file($self->target->installer_dir,$_[0]->alias.'.json')->stringify,, pretty => 1 );
return \%meta;
},
);
has testa
ば、enqueueする引数の情報をJSONでシリアライズしたい場合は
my $client = Qudo->new(... , default_hooks => ["Qudo::Hook::Serialize::JSON"]);
$client->enqueue('Test::Worker
のようにHookモジュールをnewの引数に渡す事で設定でき、
設定した引数がJSONでシリアライズされて保存されます。
Hookは利用者が好きに書く事がで
#ifndef SRL_COMMON_H_
#define SRL_COMMON_H_
#include "srl_inline.h"
/* inspired by JSON::XS code */
#if __GNUC__ >= 3
# define expect(expr,value) __builtin_expect((expr), (value))
#else
# define exp
vcdiff
system(Alien::OpenVcdiff::vcdiff_binary() . " encode -dictionary file1 -target file2 -json");
=head2 Library interface
my $openvcdiff = Alien::OpenVcdiff->new;
my $cflags = $ope
time details needed for L</"load">).
User is supposed to serialize returned value (for ex. into JSON format),
save it into file/database, and use later with L</"load"> if she wanna
keep information
~ /(?:<|!=|==)/}sub encode_json {my($self,$data)=@_;require JSON::PP;my$json=JSON::PP::encode_json($data);$json =~ s/([^a-zA-Z0-9_\-.])/uc sprintf("%%%02x",ord($1))/eg;$json}sub version_to_query {my($
atch->{hits}{hits}};$hits[0]->{fields}}sub search_metacpan {my($self,$module,$version)=@_;require JSON::PP;$self->chat("Searching $module ($version) on metacpan ...\n");my$metacpan_uri='http://api.met
ified",query=>{constant_score=>{filter=>{and=>[{term=>{'module.authorized'=>JSON::PP::true()}},{term=>{'module.indexed'=>JSON::PP::true()}},{term=>{'module.name'=>$module }},$self->version_to_query($m
pt';
use Zonemaster;
use Zonemaster::Util ();
use Zonemaster::Logger::Entry;
use Net::LDNS;
use JSON::XS;
my $can_use_threads = eval 'use threads; use Thread::Queue; 1';
=encoding utf8
=head1 NAM
RR 'start thread';
threads->create(
sub {
my $json = JSON::XS->new->allow_blessed->convert_blessed->canonical;
$self->debug and sa
$self->debug and say STDERR 'dequeued in';
$self->process( $json->decode( $in ), $out_q );
}
}
);
}
xid_find_ses);
ZEND_NAMED_FUNCTION(_wrap_zxid_ses_to_ldif);
ZEND_NAMED_FUNCTION(_wrap_zxid_ses_to_json);
ZEND_NAMED_FUNCTION(_wrap_zxid_ses_to_qs);
ZEND_NAMED_FUNCTION(_wrap_zxid_ses_to_pool);
ZEND_NA
package WebService::Azure::Search;
use 5.008001;
use strict;
use warnings;
use utf8;
use JSON;
use HTTP::Request;
use HTTP::Headers;
use LWP::UserAgent;
use URI;
use Try::Tiny;
use Carp;
use Encode '
n}) {
$self->{setting}{admin} = $self->{admin};
}
$self->{params}{accept} = "application/json";
try {
$self->{params}{url} = sprintf(
"%s/indexes/%s/docs/index?api-version=%s",
my $json_query = JSON->new->encode($hashref);
my $ua = LWP::UserAgent->new;
my $req = HTTP::Request->new('POST' => $self->{params}{url});
$req->content_type('application/json');
$
*Net::SAMLc::zxid_find_ses;
*ses_to_ldif = *Net::SAMLc::zxid_ses_to_ldif;
*ses_to_json = *Net::SAMLc::zxid_ses_to_json;
*ses_to_qs = *Net::SAMLc::zxid_ses_to_qs;
*ses_to_pool = *Net::SAMLc::zxid_ses_t
UTO_FMTQ 0x2000 /* Output Format Query String */
#define ZXID_AUTO_FMTJ 0x4000 /* Output Format JSON */
ZXID_DECL char* zxid_simple(char* conf, char* qs, int auto_flags);
ZXID_DECL char* zxid_idp_l
ruct zx_str* zxid_ses_to_ldif(zxid_conf* cf, zxid_ses* ses);
ZXID_DECL struct zx_str* zxid_ses_to_json(zxid_conf* cf, zxid_ses* ses);
ZXID_DECL struct zx_str* zxid_ses_to_qs(zxid_conf* cf, zxid_ses* s
age WWW::ShipStation;
use strict;
use 5.008_005;
our $VERSION = '0.06';
use LWP::UserAgent;
use JSON;
use Carp 'croak';
use URI::Escape qw/uri_escape/;
use HTTP::Request;
sub new {
my $class =
args{pass} or croak "pass is required.";
$args{ua} ||= LWP::UserAgent->new();
$args{json} ||= JSON->new->allow_nonref->utf8;
$args{API_BASE} ||= 'https://ssapi.shipstation.com/';
bl
application/json'); # JSON is better
my $res = $self->{ua}->request($req);
# use Data::Dumper; print STDERR Dumper(\$res);
if ($res->header('Content-Type') =~ m{application/json}) {