lon => $lon, # Longitude
output => $format?, # Output format (default json)
unit => $unit?, # Units (default metric)
lang => $language?, # Languag
requested location.
Returns a string containing the JSON or XML data, except in array context, in which case,
as a convenience, it will use L<JSON> or L<XML::Simple> to decode it directly to a Perl h
C<unit> : C<metric> (default) or C<british> units.
=item * C<output> : Output format, supports C<json> (default), C<xml> or C<png>.
=item * C<tzshift> : Timezone offset in hours (-23 to 23).
=item
lon => $lon, # Longitude
output => $format?, # Output format (default json)
unit => $unit?, # Units (default metric)
lang => $language?, # Languag
requested location.
Returns a string containing the JSON or XML data, except in array context, in which case,
as a convenience, it will use L<JSON> or L<XML::Simple> to decode it directly to a Perl h
C<unit> : C<metric> (default) or C<british> units.
=item * C<output> : Output format, supports C<json> (default), C<xml> or C<png>.
=item * C<tzshift> : Timezone offset in hours (-23 to 23).
=item
package DBIx::Class::Helper::Row::ToJSON;
$DBIx::Class::Helper::Row::ToJSON::VERSION = '2.037000';
# ABSTRACT: Remove the boilerplate from your TO_JSON functions
use strict;
use warnings;
use parent
$self->result_source->columns
]);
}
return $self->_serializable_columns;
}
sub TO_JSON {
my $self = shift;
my $columns_info = $self->columns_info($self->serializable_columns);
e_data_types;
}
1;
__END__
=pod
=head1 NAME
DBIx::Class::Helper::Row::ToJSON - Remove the boilerplate from your TO_JSON functions
=head1 SYNOPSIS
package MyApp::Schema::Result::KittenRobot;
VALUE. This value can be a literal or
reference an existing field in the record using the dollar JSON_PATH syntax.
=head1 INLINE
This Fix can be used inline in a Perl script:
use Catmandu::Fix
turn ();
my %args = @_;
return $builtin_types{boolean_with_Types_Serialiser}
if $args{json_friendly} && $name eq 'boolean';
return $builtin_types{$sloppy_int_version{$name}}
i
_float_version{$name}))
{ return $builtin_types{sloppy_float_force_NV}
if $args{json_friendly} && $maptype eq 'sloppy_float';
return $builtin_types{$maptype};
}
# o
File::Basename qw(basename);
use File::Slurp;
use File::Spec;
use File::stat;
use HTTP::Date;
use JSON::XS;
use List::Util qw(any max);
use LWP::UserAgent;
use POSIX qw(getlogin);
use Text::CSV_XS qw(
N %EXPORT_TAGS $TTL_SECONDS $UA $JSON $CSV);
$VERSION = '0.07';
$EXPORT_TAGS{'all'} = [qw(
mirror_str
mirror_csv
mirror_fh
mirror_file
mirror_json
mirror_xml
mirror_yaml
s, Perl %s',
__PACKAGE__, $VERSION || 'dev',
$LWP::UserAgent::VERSION,
$^V,
));
$JSON = JSON::XS->new->utf8;
$CSV = Text::CSV_XS->new ({
'binary' => 1,
});
sub mirror_file {
-2006 Ken Williams. 2010 Matt S Trout
=item L<version> Copyright 2004-2010 John Peacock
=item L<JSON::PP> Copyright 2007-2011 by Makamaka Hannyaharamitu
=item L<CPAN::Meta>, L<CPAN::Meta::Requireme
RUNNER_TPL';
#![% shebang %]
use strict;
use warnings;
use Net::MQTT::Simple;
use DateTime;
use JSON;
use Capture::Tiny ':all';
my $dt_start = DateTime->now();
my $mqtt = Net::MQTT::Simple->new("[
:[% mqtt_port %]");
$mqtt->retain("[% base_topic %]/status/" . "[% task || "unknown" %]", encode_json({ status => "initiated", dt => "$dt_start", msg => "[% cmd %]" }) );
my $real_cmd = "[% job_dir %
$output =~ s/\n//g;
$mqtt->retain("[% base_topic %]/status/" . "[% task || "unknown" %]", encode_json({ status => "completed", dt => "$dt_end", last_line => "$last_line", output => "$output", elapsed
ss $self;
return $self;
}
=head2 fetch
Reaches out via HTTP or HTTPS and fetches the PCAP and JSON metadata.
- start :: A L<Time::Piece> object of when to start looking.
- Default ::
ile :: The file to output to. The metadata writen to a file of the same name
with '.json' appended.
- Default :: out.pcap
- type :: 'tcpdump', 'bpf2tshark', or 'tshark', dep
start
end
filter
IF the command success the raw unparsed JSON of the metadata is returned.
my $raw_metadata_json=$virani_client->(start=>$start, end=>$end, filter=>$filter);
=cut
s
=> '*.exe'
};
sub bigint
{ my $v = shift;
$v =~ s/\s+//g;
# The automatic rewrite into JSON wants real ints, not strings. Therefore,
# we need to numify. On the other hand, pattern match
:MD5 qw(md5_hex);
use File::Spec;
use IPC::Cmd qw(run);
use File::Copy "cp";
use Sys::Syslog;
use JSON;
use Time::Piece;
=head1 NAME
Virani - PCAP retrieval for a FPC setup writing to PCAP files.
=
e path to the file.
my $cache_file=$virani->get_cache_file(%opts);
if (! -f $cache_file.'json'){
echo "Cache file metadata does not exist, so either get_pcap_local died or it has not
cache_file
&& -f $cache_file . '.json' )
{
$return_cache = 1;
} elsif ( !defined( $opts{file} ) && !$opts{no_cache} && -f $cache_file && -f $cache_file . '.json' ) {
$return_cache = 1;
}
if
undef> if not
found.
-Option --Default
json_friendly <false>
sloppy_floats <false>
sloppy_integers <false>
=over 2
=item json_friendly => BOOLEAN
The READER is slightly diffe
13
#define SQLITE_TESTCTRL_RESERVE 14 /* NOT USED */
#define SQLITE_TESTCTRL_JSON_SELFCHECK 14
#define SQLITE_TESTCTRL_OPTIMIZATIONS 15
#define SQLITE_TESTCTRL_
package Acme::CPANAuthors::Utils::Kwalitee;
use strict;
use warnings;
use HTTP::Tiny;
use JSON::PP ();
my $ua;
sub _uri { "https://api.cpanauthors.org/kwalitee/" . shift }
sub _ua {
my $class =
"$res->{status} $res->{reason}");
}
my $json = eval { JSON::PP::decode_json($res->{content}) };
if ($@) {
$class->_error($@);
}
return $json;
}
sub _error {
my ($class, $error) = @_;
n_json = Path::Tiny->new($dist_dir, '_alien', 'alien.json');
return unless -r $alien_json;
my $json = $alien_json->slurp;
require JSON::PP;
my $config = JSON::PP::decode_json($
= @_;
return unless ref $dists eq ref {};
require URI;
require URI::QueryParam;
require JSON::PP;
my $uri = URI->new('https://api.cpanauthors.org/uploads/dist');
my @keys = keys %$dists
API error: $uri $res->{status} $res->{reason}";
return;
}
my $rows = eval { JSON::PP::decode_json($res->{content}) };
if ($@) {
warn $@;
return;
}
push @files, @$
ppy_floats:\n$@" if $@;
}
if($args{json_friendly} ||= 0)
{ eval "require Types::Serialiser";
panic "require Types::Serialiser by json_friendly:\n$@" if $@;
}
$args{pref
->new($old_prefix, qw( _alien alien.json ));
if(-r $file)
{
my $old_runtime = eval {
require JSON::PP;
JSON::PP::decode_json($file->slurp);
};
u
_config_command = "$^X $INC{'PkgConfig.pm'}";
}
}
}
$pkg_config_command;
}
sub TO_JSON
{
my($self) = @_;
my %hash = %$self;
$hash{'__CLASS__'} = ref($self);
\%hash;
}
1;
__EN
ld;
use strict;
use warnings;
use 5.008004;
use Path::Tiny ();
use Carp ();
use File::chdir;
use JSON::PP ();
use Env qw( @PATH @PKG_CONFIG_PATH );
use Config ();
use Alien::Build::Log;
# ABSTRACT:
return $self;
}
sub resume
{
my(undef, $alienfile, $root) = @_;
my $h = JSON::PP::decode_json(_path("$root/state.json")->slurp);
my $self = Alien::Build->load("$alienfile", @{ $h->{args} });
};
}
sub checkpoint
{
my($self) = @_;
my $root = $self->root;
_path("$root/state.json")->spew(
JSON::PP->new->pretty->canonical(1)->ascii->encode({
install => $self->install_