pan:NUFFIN';
}
{
$KiokuDB::TypeMap::Entry::DBIC::ResultSet::VERSION = '1.22';
}
use Moose;
use JSON;
use Scalar::Util qw(weaken);
use namespace::autoclean;
extends qw(KiokuDB::TypeMap::Entry::Nai
fio::OpenShift::Parser;
@ISA = qw(App::Difio::OpenShift::Parser);
use strict;
use warnings;
use JSON;
use LWP::UserAgent;
my $data = {
'user_id' => $ENV{'DIFIO_USER_ID'},
'app_name' =>
n' => $name_ver[0], 'v' => $name_ver[1]});
}
$data->{'installed'} = [ @installed ];
my $json_data = to_json($data); # , { pretty => 1 });
my $ua = new LWP::UserAgent(('agent' => "$NAME/$VERSION"))
otb.rhcloud.com/application/register/', { json_data => $json_data});
if (! $response->is_success) {
die $response->status_line;
}
my $content = from_json($response->decoded_content);
print "Difi
ason::Util
qw(can_load catdir catfile combine_similar_paths find_wanted first_index is_absolute json_decode mason_canon_path read_file taint_is_on touch_file uniq write_file);
use Memoize;
use Moose
my $line = <$fh>;
if ( my ($flags_str) = ( $line =~ /\# FLAGS: (.*)/ ) ) {
$flags = json_decode($flags_str);
}
return $flags;
}
method _flush_load_cache () {
Memoize::flush_
package Collectd::Plugin::Read::Message::Passing;
use strict;
use warnings;
use Collectd ();
use JSON;
use Module::Runtime qw/ require_module /;
use String::RewritePrefix ();
use Try::Tiny;
use Messag
ift;
Collectd::plugin_log(Collectd::LOG_WARNING, "Got message from Message::Passing " . JSON::encode_json($message));
my $vl = {
values => [ map { $_->{value} } @{$message->{values}} ]
: (),
};
Collectd::plugin_log(Collectd::LOG_WARNING, "Got message for collectd " . JSON::encode_json($vl));
Collectd::plugin_dispatch_values($vl);
}
# ["load",[{"min":0,"max":100,"name":
ne::Node::Literal->new($self->to_string, undef, $self->datatype),
));
return $self;
}
sub TO_JSON
{
my $self = shift;
return $self->to_string;
}
1;
__END__
=head1 BUGS
Please report any bug
ts::Datatype::Duration->new($this->{i}->duration);
return $this->{i}->start . "/$D";
}
sub TO_JSON
{
my $this = shift;
return $this->to_string;
}
=item C<< $d->datatype >>
Returns an the RDF d
.w3.org/2001/XMLSchema#date'; }
return 'http://www.w3.org/2001/XMLSchema#dateTime';
}
sub TO_JSON
{
return "$_[0]";
}
1;
__END__
=head1 BUGS
Please report any bugs to L<http://rt.cpan.org/>.
no warnings;
use 5.010;
use HTML::Microformats::Utilities qw(stringify xml_stringify);
use JSON qw/to_json/;
use Object::AUTHORITY;
BEGIN {
$HTML::Microformats::Format::XOXO::AUTHORITY = 'cpan:TO
(
$self->id(1),
RDF::Trine::Node::Resource->new('http://open.vocab.org/terms/json'),
$self->_make_literal( to_json($self, {canonical=>1,convert_blessed=>1}) ),
));
return $self;
}
sub profi
s, HTML::Microformats::Format::XOXO::LI->parse($li, $xoxo); }
bless \@items, $class;
}
sub TO_JSON
{
return [ @{$_[0]} ];
}
sub as_array
{
my ($self) = @_;
return wantarray ? @$self : $self;
}
ds + ($self->{d}->nanoseconds / 1000000000)).'S'; }
$str =~ s/T$//;
return $str;
}
sub TO_JSON
{
my $self = shift;
return $self->to_string;
}
=item C<< $d->datatype >>
Returns an the RDF d
ar) string.
=back
=cut
sub to_string
{
my $this = shift;
return $this->{'string'};
}
sub TO_JSON
{
my $this = shift;
return $this->{'string'};
}
=head2 Functions
=over 4
=item C<< $str = ms
.
=cut
sub data
{
return {} unless defined $_[0]->{'DATA'};
return $_[0]->{'DATA'};
}
sub TO_JSON
{
return data( $_[0] );
}
=item C<< $object->element >>
Returns the root element.
=cut
sub
roformats::DocumentContext;
use HTML::Microformats::Datatype;
use HTML::Microformats::Format;
use JSON;
use RDF::Trine 0.130;
use XML::LibXML;
use Object::AUTHORITY;
BEGIN {
$HTML::Microformats::AU
= shift;
$self->parse_microformats;
return $self->{'objects'};
}
sub TO_JSON
{
return $_[0]->all_objects;
}
sub json
{
my $self = shift;
my %opts = @_;
$opts{'convert_blessed'} = 1
unles
defined $opts{'convert_blessed'};
$opts{'utf8'} = 1
unless defined $opts{'utf8'};
return to_json($self->all_objects, \%opts);
}
sub model
{
my $self = shift;
my $model = RDF::Trine::Model->
package Echo::StreamServer::MuxRequest;
use 5.008008;
use strict;
use warnings;
use JSON;
our $VERSION = '0.01';
our @MUX_METHODS = ( 'search', 'count' );
our $MUX_MAX_REQUESTS = 100; # server-sid
calls TO_JSON() method on the blessed hash.
# This method returns a "plain" hash to render the document.
#
# NOTE: The convert_blessed flag must be set (false by default).
# my $json = JSON->new->con
# ======================================================================
my $json = JSON->new->convert_blessed;
sub TO_JSON {
my $self = shift;
my %hash = %$self;
return \%hash;
}
sub new {
my
e);
}
1;
__END__
=head1 NAME
Ambrosia::View::JSON - it is VIEW in MVC.
=head1 VERSION
version 0.010
=head1 DESCRIPTION
C<Ambrosia::View::JSON> - it is VIEW in MVC.
Returns result in XML or HT
%params = (
'key' => $key,
'appkey' => $self->{'account'}->{'appkey'},
);
my $json_hash_ref;
eval {
$json_hash_ref = send_request($self->{'account'}, 'kvs/delete', \%params);
};
# Re-raise
}
return $json_hash_ref->{'result'};
}
sub get {
my ($self, $key, $raise_not_found) = @_;
my %params = (
'key' => $key,
'appkey' => $self->{'account'}->{'appkey'},
);
my $json_hash_ref;
alue, when present (may be serialized).
# De-serialize $value data-structure.
my $value = thaw($json_hash_ref->{'value'});
$value = ${ $value } if (ref($value) eq "SCALAR");
return $value;
}
sub
;
use Data::MessagePack;
use JSON;
use Storable;
use Benchmark ':all';
#$Data::MessagePack::PreferInteger = 1;
my $a = do 'benchmark/data.pl';
my $j = JSON::encode_json($a);
my $m = Data::MessagePa
nt "$JSON::Backend: ", $JSON::Backend->VERSION, "\n";
print "Data::MessagePack: $Data::MessagePack::VERSION\n";
print "Storable: $Storable::VERSION\n";
cmpthese timethese(
-1 => {
json
=> sub { JSON::decode_json($j) },
mp => sub { Data::MessagePack->unpack($m) },
storable => sub { Storable::thaw($s) },
}
);
:Zilla::Role::BeforeRelease';
use Encode qw(encode_utf8);
use LWP::UserAgent;
use version ();
use JSON::PP;
# Lots of this is cargo-culted from DZP::CheckPrereqsIndexed
sub before_release {
my (
->get("http://cpanidx.org/cpanidx/json/mod/$pkg");
if ($res->is_success) {
my $yaml_octets = encode_utf8($res->decoded_content);
my $payload = JSON::PP->new->decode($yaml_octets);
rialization format.
It enables to exchange structured objects between many languages like JSON.
But unlike JSON, it is very fast and small.
=head2 ADVANTAGES
=over 4
=item PORTABLE
The MessagePack
does not depend on language nor byte order.
=item SMALL IN SIZE
say length(JSON::XS::encode_json({a=>1, b=>2})); # => 13
say length(Storable::nfreeze({a=>1, b=>2})); # => 21
say
se.)
-- serialize
JSON::XS: 2.3
Data::MessagePack: 0.24
Storable: 2.21
Benchmark: running json, mp, storable for at least 1 CPU seconds...
json: 1 wallclock secs ( 1.00
EntityCode($hDir{dirTemplates}, $tmplPath . '/Templates/Templates/' . $tpl_path . '/edit_json.xsl', '_edit_json' . $ex, 1, '@Type!="BIND" and @Type!="VIEW"');
copy($tmplPath . '/Templates/Template
y $style_doc = $self->parser->parse_file($tmplPath . '/Templates/Templates/' . $tpl_path . '/list_json.xsl');
($style_doc->getElementsByLocalName('output'))[0]->setAttribute( encoding => $enco
y $results = $stylesheet->transform($self->source);
my $fn = $hDir{dirTemplates} . '/list_json.xsl';
if ( -e $fn )
{
rename $fn, $fn . '.bak';
}
#if
Server::Core;
use strict;
use HTTP::Headers;
use HTTP::Request;
use LWP::UserAgent;
use URI;
use JSON;
use Data::Dumper;
use Echo::StreamServer::Settings;
# =======================================
====================================================================
# REST API: Document Format: JSON
# ======================================================================
my $HTTP_HEADERS = HTTP
L $VERSION)");
$HTTP_HEADERS->header('Accept' => 'application/json');
$HTTP_HEADERS->header('Content-Type' => 'application/json');
# ============================================================