package HPC::Runner::Command::submit_jobs::Plugin::Logger::Sqlite;
use Moose::Role;
use JSON::XS;
use Data::Dumper;
use DateTime;
with 'HPC::Runner::Command::Plugin::Logger::Sqlite';
=head1 HPC::Ru
bj->{jobnames} = $self->job_stats->jobnames;
my $json_text = encode_json $obj;
$res->update(
{
submission_meta => $json_text,
total_processes => $self->job_sta
O_JSON {
my ($self) = @_;
my $json = {};
if ( defined $self->pageref() ) {
$json->{pageref} = $self->pageref();
}
if ( defined $self->started_date_time() ) {
$json-
$json->{startedDateTime} = '0000-00-00T00:00:00.0+00:00';
}
$json->{time} = $self->time();
$json->{request} = $self->request();
$json->{response} = $self->response();
$json->
{cache} = $self->cache();
$json->{timings} = $self->timings();
if ( defined $self->server_ip_address() ) {
$json->{serverIPAddress} = $self->server_ip_address();
}
if ( def
return $old;
}
sub TO_JSON {
my ($self) = @_;
my $json = {};
if ( defined $self->name() ) {
$json->{name} = $self->name();
}
else {
$json->{name} = 'Unknown';
f->version() ) {
$json->{version} = $self->version();
}
else {
$json->{version} = 'Unknown';
}
if ( defined $self->comment() ) {
$json->{comment} = $self->comme
( $key =~ /^_[[:alnum:]]+$/smx ) { # private fields
$json->{$key} = $self->{$key};
}
}
return $json;
}
1;
__END__
=head1 NAME
Archive::Har::Browser - Represents the
ecessary
When writing data to the store, the data (a HASH reference) is first serialized using L<JSON> and then inserted/updated via L<DBIx::Class> to (currently) an SQLite backend
Retrieving data f
done by key lookup or by searching an SQL-based index. Once found, the data is deserialized via L<JSON> and returned
The API is fairly sane, though still beta
=head1 USAGE
=head2 $store = DBIx::NoS
c<$model> is written to, the index will be updated with the deflated value of C<$field> (since
L<JSON> can not trivially serialize blessed references)
=head2 $model->reindex
Reindex the C<$model> d
dowsocks rfc1928 Great Firewall Internet censorship in China
#
# Modify the config.json sample, save it to config.json. Run ssserver.pl on
# server, run ssclient.pl on localhost. Configure your browse
through the great firewall
# of china.
use 5.006;
use strict;
use warnings;
use Getopt::Std;
use JSON;
use Net::Shadowsocks::Server;
my $version = "0.9.3.2";
sub main::HELP_MESSAGE()
{
print("U
c6-256-ctr rc6-256-ofb\n");
print("\tspritz\n");
printf("\t-c CONFIG\tName of your config.json file with full path\n");
print("\t-h, --help\tDisplay help information\n");
print("\t-v,
strict;
use warnings;
use Try::Tiny;
use Path::Class;
use JSON;
eval { require JSON::XS; };
our $json = JSON->new->pretty;
sub json { $json }
use DBIx::NoSQL::Model;
has database => qw/ is ro /;
h
le::Share qw/ dist_file /;
use Function::Parameters qw/ :strict /;
use Exporter qw/ import /;
use JSON::MaybeXS;
our @EXPORT_OK = qw/ get_fmt_tok get_locale /;
my $loc_db;
fun get_fmt_tok ($fmt, $p
open my $fh, '<', $fn
or croak "Could not open $fn: $!";
$loc_db = decode_json slurp $fh;
}
my $ret;
if ($type eq 'weekdays') {
$ret = $loc_db->{days}->{$l
n/env perl
use strict;
use warnings;
use File::Basename;
use JSON::MaybeXS qw/ JSON /;
use Data::Dumper;
my $pretty = 0;
if ($ENV{JSON_PRETTY}) { $pretty = 1; }
my %d_t_fmt = ();
my %d_fmt = ();
m
fmt;
}
my $comment = sprintf "# format db generated on %s from %s.\n", "".localtime, $dir;
print JSON->new->utf8(1)->pretty($pretty)->canonical(1)->encode({ comment => $comment, d_t_fmt => \%d_t_fmt,
package Catmandu::Adlib::API;
use strict;
use warnings;
use Catmandu::Sane;
use Moo;
use JSON;
use Catmandu::Adlib::API::Login;
use Catmandu::Adlib::API::QueryBuilder;
has username => (is => 'ro',
my $json = decode_json($response->decoded_content);
# If there are multiple results for the same object_id, I'm gonna turn violent.
return $self->get_by_priref($self->get_priref($json->{'ad
;
my $response = $self->ua->get($url);
if ($response->is_success) {
return decode_json($response->decoded_content);
} elsif ($response->code == 404) {
return [];
} else
sub TO_JSON {
my ($self) = @_;
my $json = {};
if ( defined $self->expires() ) {
$json->{expires} = $self->expires();
}
if ( $self->last_access() ) {
$json->{lastA
$json->{lastAccess} = '0000-00-00T00-00-00';
}
$json->{eTag} = $self->etag();
$json->{hitCount} = $self->hit_count();
if ( defined $self->comment() ) {
$json->{comme
( $key =~ /^_[[:alnum:]]+$/smx ) { # private fields
$json->{$key} = $self->{$key};
}
}
return $json;
}
1;
__END__
=head1 NAME
Archive::Har::Entry::Cache::Request - R
ive::Har::Entry();
use XML::LibXML();
use IO::Compress::Gzip();
use IO::Uncompress::Gunzip();
use JSON();
use overload '""' => 'string';
our $VERSION = '0.21';
sub new {
my ( $class, $params ) =
ring($string);
}
return $old;
}
sub hashref {
my ( $self, $ref ) = @_;
my $old = JSON->new()->utf8()->decode( $self->string() );
if ( ( @_ > 1 ) && ( defined $ref ) ) {
$s
;
}
my $json = JSON->new();
$json = $json->utf8();
$json = $json->allow_blessed(1);
$json = $json->convert_blessed(1);
$json = $json->pretty();
$json = $json->canonical(1);
caffold::Schema::VERSION = '0.0021';
use Moose;
extends qw/ DBIx::Class::Schema /;
use JSON; our $json = JSON->new->pretty;
use Digest::SHA qw/ sha1_hex /;
has store => qw/ is rw weak_ref 1 /;
has
self->store->json->decode( $value );
return $data;
}
sub serialize {
my $self = shift;
my $data = shift;
return $data if ! ref $data;
my $value = $self->store->json->encode( $da
return $old;
}
sub TO_JSON {
my ($self) = @_;
my $json = {};
if ( defined $self->name() ) {
$json->{name} = $self->name();
}
else {
$json->{name} = 'Unknown';
f->version() ) {
$json->{version} = $self->version();
}
else {
$json->{version} = 'Unknown';
}
if ( defined $self->comment() ) {
$json->{comment} = $self->comme
( $key =~ /^_[[:alnum:]]+$/smx ) { # private fields
$json->{$key} = $self->{$key};
}
}
return $json;
}
1;
__END__
=head1 NAME
Archive::Har::Creator - Represents the
sub TO_JSON {
my ($self) = @_;
my $json = {
mimeType => $self->mime_type(),
size => $self->size(),
};
if ( defined $self->compression() ) {
$json->{compre
{
$json->{text} = $self->text();
}
if ( defined $self->encoding() ) {
$json->{encoding} = $self->encoding();
}
if ( defined $self->comment() ) {
$json->{comment
( $key =~ /^_[[:alnum:]]+$/smx ) { # private fields
$json->{$key} = $self->{$key};
}
}
return $json;
}
1;
__END__
=head1 NAME
Archive::Har::Entry::Response::Content
TO_JSON {
my ($self) = @_;
my $json = { pageTimings => $self->page_timings(), };
if ( defined $self->title() ) {
$json->{title} = $self->title();
}
else {
$json->{
$json->{startedDateTime} = $self->started_date_time();
}
else {
$json->{startedDateTime} = '0000-00-00T00:00:00.0+00:00';
}
if ( defined $self->id() ) {
$json->{id
} = $self->id();
}
if ( defined $self->comment() ) {
$json->{comment} = $self->comment();
}
foreach my $key ( sort { $a cmp $b } keys %{$self} ) {
next if ( !defined $s
ld;
}
sub TO_JSON {
my ($self) = @_;
my $json = {};
$json->{name} = $self->name();
$json->{value} = $self->value();
if ( defined $self->file_name() ) {
$json->{fileName}
if ( defined $self->content_type() ) {
$json->{contentType} = $self->content_type();
}
if ( defined $self->comment() ) {
$json->{comment} = $self->comment();
}
foreach
( $key =~ /^_[[:alnum:]]+$/smx ) { # private fields
$json->{$key} = $self->{$key};
}
}
return $json;
}
1;
__END__
=head1 NAME
Archive::Har::Entry::Request::PostData:
sub TO_JSON {
my ($self) = @_;
my $json = {};
$json->{mimeType} = $self->mime_type();
$json->{params} = [ $self->params() ];
if ( defined $self->text() ) {
$json->{text}
= $self->text();
}
if ( defined $self->comment() ) {
$json->{comment} = $self->comment();
}
foreach my $key ( sort { $a cmp $b } keys %{$self} ) {
next if ( !defined $
( $key =~ /^_[[:alnum:]]+$/smx ) { # private fields
$json->{$key} = $self->{$key};
}
}
return $json;
}
1;
__END__
=head1 NAME
Archive::Har::Entry::Request::PostData
re"
);
}
return $old;
}
sub TO_JSON {
my ($self) = @_;
my $json = {};
if ( defined $self->before_request() ) {
$json->{beforeRequest} = $self->before_request();
elsif ( exists $self->{beforeRequest} ) {
$json->{beforeRequest} = undef;
}
if ( defined $self->after_request() ) {
$json->{afterRequest} = $self->after_request();
}
} ) {
$json->{afterRequest} = undef;
}
if ( defined $self->comment() ) {
$json->{comment} = $self->comment();
}
foreach my $key ( sort { $a cmp $b } keys %{$self} ) {
old;
}
sub TO_JSON {
my ($self) = @_;
my $json = {};
$json->{name} = $self->name();
$json->{value} = $self->value();
if ( defined $self->comment() ) {
$json->{comment} =
( $key =~ /^_[[:alnum:]]+$/smx ) { # private fields
$json->{$key} = $self->{$key};
}
}
return $json;
}
1;
__END__
=head1 NAME
Archive::Har::Entry::Header - Represent