view release on metacpan or search on metacpan
scripts/generate_classes.pl view on Meta::CPAN
use JSON::XS;
use Template;
use Data::Dumper;
use feature qw(say);
open(FI,"data/endpoints.json");
my $data = JSON::XS::decode_json(join("",<FI>));
my $tt = Template->new();
foreach my $endpoint (keys %$data) {
say $endpoint;
my $stash = {name=>$endpoint,methods=>$data->{$endpoint}};
#process_template("templates/class_template.tt","lib/Imgur/API/Endpoint/$endpoint.pm",$stash);
process_template("templates/pod_template.tt","lib/Imgur/API/Endpoint/$endpoint.pod",$stash);
}
sub process_template {
my ($template,$output,$stash) = @_;
view all matches for this distribution
view release on metacpan or search on metacpan
lib/ImgurAPI/Client.pm view on Meta::CPAN
sub request {
my ($self, $uri, $http_method, $data, $hdr, $debug) = @_;
$http_method = uc($http_method // 'GET');
my $endpoint = $self->{'rapidapi_key'} ? ENDPOINTS->{'RAPIDAPI'} . $uri : ($uri =~ /^\// ? ENDPOINTS->{'IMGUR'} . $uri : $uri);
$endpoint .= ($endpoint =~ /\?/ ? '&' : '?') . '_format=' . $self->{'format_type'} . "&_method=$http_method";
$self->_lwp->default_header('User-Agent' => "ImgurAPI::Client/$VERSION");
if ($self->{'auth'}) {
my $access_token = $self->{'access_token'} // die "Missing required access_token";
lib/ImgurAPI/Client.pm view on Meta::CPAN
} elsif ($self->{'client_id'}) {
$self->_lwp->default_header('Authorization' => "Client-ID " . $self->{'client_id'});
}
if ($http_method =~ /^GET|DELETE$/ && $data && ref($data) eq 'HASH') {
$endpoint .= "&$_=$data->{$_}" foreach keys %$data;
}
my $request;
if ($http_method eq 'POST') {
$request = HTTP::Request::Common::POST($endpoint, %{$hdr//{}}, Content => $data);
} elsif ($http_method eq 'PUT') {
$request = HTTP::Request::Common::PUT($endpoint, %{$hdr//{}}, Content => $data);
} else {
$request = HTTP::Request->new($http_method, $endpoint);
}
print Dumper $request if $ENV{'DEBUG'} || ($debug // 0);
my $response = $self->_lwp->request($request);
lib/ImgurAPI/Client.pm view on Meta::CPAN
=head2 Authorization
Imgur uses OAuth 2.0 for authentication. OAuth 2.0 has four steps: registration, authorization, making authenticated requests and getting new access tokens after the initial one expires using a refresh token and client secret.
After registering a client application with Imgur L<here|https://api.imgur.com/oauth2/addclient>, the user will need to manually authorize it. Generate a authorization url using the C<oauth2_authorize_url> method and redirect the user to the generate...
=head2 Authentication
The client can be authenticated by setting the access token and client id. Those can be set a couple of ways. The first way is to do it is by passing them to the constructor:
lib/ImgurAPI/Client.pm view on Meta::CPAN
C<client_secret> - Client secret used for acquiring a refresh token.
=item *
C<format_type> - Api endpoint response format type. Options are C<json> (default) and C<xml>.
=item *
C<oauth_cb_state> - A parameter that's appended to the OAuth2 authorization callback URL. May be useful if you want to pass along a tracking value to the callback endpoint / collector.
=item *
C<rapidapi_key> - Commercial use api key provided by RapidAPI.
lib/ImgurAPI/Client.pm view on Meta::CPAN
C<username> - A valid username between 4 and 63 alphanumeric characters.
=item *
C<show_mature> - A boolean value to show mature images in gallery list endpoints.
=item *
C<newsletter_subscribed> - A boolean value, true to subscribe to the newsletter, false to unsubscribe from the newsletter.
view all matches for this distribution
view release on metacpan or search on metacpan
lib/InfluxDB/Client/Simple.pm view on Meta::CPAN
return $self->write( _line_protocol( $measurement, $tags, $fields, $timestamp ), %options );
}
sub _get_influxdb_http_api_uri {
my ( $self, $endpoint ) = @_;
die "Missing argument 'endpoint'" if !$endpoint;
my $uri = URI->new();
$uri->scheme('http');
$uri->host( $self->{host} );
$uri->port( $self->{port} );
$uri->path($endpoint);
return $uri;
}
# Blatantly stolen from InfluxDB::LineProtocol
view all matches for this distribution
view release on metacpan or search on metacpan
lib/InfluxDB/HTTP.pm view on Meta::CPAN
<BOOL> { return 1; }
}
}
sub _get_influxdb_http_api_uri {
my ($self, $endpoint) = @_;
die "Missing argument 'endpoint'" if !$endpoint;
my $uri = URI->new();
$uri->scheme('http');
$uri->host($self->{host});
$uri->port($self->{port});
$uri->path($endpoint);
return $uri;
}
1;
lib/InfluxDB/HTTP.pm view on Meta::CPAN
Version 0.04
=head1 SYNOPSIS
InfluxDB::HTTP allows you to interact with the InfluxDB HTTP API. The module essentially provides
one method per InfluxDB HTTP API endpoint, that is C<ping>, C<write> and C<query>.
use InfluxDB::HTTP;
my $influx = InfluxDB::HTTP->new();
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Intellexer/API.pm view on Meta::CPAN
}
## Support functions
# build a URI object with necessary form data
sub _build_url( $self, $endpoint, %form){
my $url = URI->new( $self->{base}.$endpoint);
$form{'apikey'} = $self->{api_key};
$url->query_form(\%form);
return $url->as_string;
#return $url;
}
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Interchange6/Schema.pm view on Meta::CPAN
Stefan Hornburg (Racke), C<racke@linuxia.de>
Peter Mottram, C<peter@sysnix.com>
Jeff Boes, C<jeff@endpoint.com>
Sam Batschelet C<sbatschelet@mac.com>
=head1 CONTRIBUTORS
view all matches for this distribution
view release on metacpan or search on metacpan
bool_t _xdr_nis_taglist(XDR *, nis_taglist *);
bool_t _xdr_ns_request(XDR *, ns_request *);
bool_t _xdr_ping_args(XDR *, ping_args *);
bool_t xdr_cback_data(XDR *, cback_data *);
bool_t xdr_obj_p(XDR *, obj_p *);
static bool_t xdr_endpoint(XDR *, endpoint *);
static bool_t xdr_entry_col(XDR *, entry_col *);
static bool_t xdr_nis_attr(XDR *, nis_attr *);
static bool_t xdr_oar_mask(XDR *, oar_mask *);
static bool_t xdr_table_col(XDR *, table_col *);
view all matches for this distribution
view release on metacpan or search on metacpan
lib/IntervalTree.pm view on Meta::CPAN
preserves all information about the intervals (unlike bitset projection methods).
=cut
# Historical note:
# This module original contained an implementation based on sorted endpoints
# and a binary search, using an idea from Scott Schwartz and Piotr Berman.
# Later an interval tree implementation was implemented by Ian for Galaxy's
# join tool (see `bx.intervals.operations.quicksect.py`). This was then
# converted to Cython by Brent, who also added support for
# upstream/downstream/neighbor queries. This was modified by James to
lib/IntervalTree.pm view on Meta::CPAN
sub insert {
my ($self, $start, $end, $interval) = @_;
my $croot = $self;
# If starts are the same, decide which to add interval to based on
# end, thus maintaining sortedness relative to start/end
my $decision_endpoint = $start;
if ($start == $self->{start}) {
$decision_endpoint = $end;
}
if ($decision_endpoint > $self->{start}) {
# insert to cright tree
if ($self->{cright} != $EmptyNode) {
$self->{cright} = $self->{cright}->insert( $start, $end, $interval );
}
else {
view all matches for this distribution
view release on metacpan or search on metacpan
lib/IxNetwork/IxNetworkLegacy.pm view on Meta::CPAN
last;
}
}
## a socket connection has been made now read the type of connection
## setup to timeout if the remote endpoint is not valid
my $sock = $self->{_socket};
$self->{_socket}->blocking(0);
my $rin = '';
vec($rin, fileno($sock), 1) = 1;
my $timeout = 30;
view all matches for this distribution
view release on metacpan or search on metacpan
t/15.05-string-objects.t view on Meta::CPAN
is('foo'.slice(null),'foo','slice(null)')
is('foo'.slice(true),'oo','slice(bool)')
is('foo'.slice('2'),'o','slice(str)')
is('foo'.slice({}),'foo','slice(obj)')
is('foo'.slice(1.7),'oo','slice(fraction)')
is('foo'.slice(1,void 0),'oo','slice with undefined endpoint')
is('foo'.slice(1,null),'','slice with null endpoint')
is('foo'.slice(1,'2'),'o','slice with string endpoint')
is('foo'.slice(0,{}),'','slice with objectionable endpoint')
is('foo'.slice(0,true),'f','slice with boolean endpoint')
is('bar'.slice(-1,3),'r','slice with negative start')
is('bar'.slice(0,-1),'ba','slice with negative endpoint')
is('bar'.slice(-2,-1),'a','slice with two negs')
is('bar'.slice(0,2),'ba','slice with two positives')
is('bar'.slice(-7,2),'ba',
'slice w/negative start reaching beyond the start of the string')
is('bar'.slice(0,-20),'',
t/15.05-string-objects.t view on Meta::CPAN
is('foo'.substring(null),'foo','substring(null)')
is('foo'.substring(true),'oo','substring(bool)')
is('foo'.substring('2'),'o','substring(str)')
is('foo'.substring({}),'foo','substring(obj)')
is('foo'.substring(1.7),'oo','substring(fraction)')
is('foo'.substring(1,void 0),'oo','substring with undefined endpoint')
is('foo'.substring(1,null),'f','substring with null endpoint')
is('foo'.substring(1,'2'),'o','substring with string endpoint')
is('foo'.substring(0,{}),'','substring with objectionable endpoint')
is('foo'.substring(0,true),'f','substring with boolean endpoint')
is('bar'.substring(-1,3),'bar','substring with negative start')
is('bar'.substring(0,-1),'','substring with negative endpoint')
is('bar'.substring(-2,-1),'','substring with two negs')
is('bar'.substring(0,2),'ba','substring with two positives')
is('bar'.substring(78,79),'', 'substring with start > length')
is('bar'.substring(1,79),'ar','substring with end > length')
is('bar'.substring(2,1),'a','substring with positive end > positive start')
view all matches for this distribution
view release on metacpan or search on metacpan
lib/JIRA/REST/Class.pm view on Meta::CPAN
A string or a URI object denoting the base URL of the JIRA server. This is a
required argument.
The REST methods described below all accept as a first argument the
endpoint's path of the specific API method to call. In general you can pass
the complete path, beginning with the prefix denoting the particular API to
use (C</rest/api/VERSION>, C</rest/servicedeskapi>, or
C</rest/agile/VERSION>). However, to make it easier to invoke JIRA's Core
API if you pass a path not starting with C</rest/> it will be prefixed with
C</rest/api/latest> or with this URL's path if it has one. This way you can
view all matches for this distribution
view release on metacpan or search on metacpan
lib/JIRA/REST.pm view on Meta::CPAN
sub attach_files {
my ($self, $issueIdOrKey, @files) = @_;
# We need to violate the REST::Client class encapsulation to implement
# the HTTP POST method necessary to invoke the /issue/key/attachments
# REST endpoint because it has to use the form-data Content-Type.
my $rest = $self->{rest};
# FIXME: How to attach all files at once?
foreach my $file (@files) {
lib/JIRA/REST.pm view on Meta::CPAN
This rich API superseded the old L<Jira SOAP
API|http://docs.atlassian.com/software/jira/docs/api/rpc-jira-plugin/latest/com/atlassian/jira/rpc/soap/JiraSoapService.html>
which isn't supported anymore as of Jira version 7.
The endpoints of this API have a path prefix of C</rest/api/VERSION>.
=item * L<Jira Service Desk REST API|https://docs.atlassian.com/jira-servicedesk/REST/server/>
This API deals with the objects of the Jira Service Desk application. Its
endpoints have a path prefix of C</rest/servicedeskapi>.
=item * L<Jira Software REST API|https://docs.atlassian.com/jira-software/REST/server/>
This API deals with the objects of the Jira Software application. Its
endpoints have a path prefix of C</rest/agile/VERSION>.
=back
=head1 CONSTRUCTORS
lib/JIRA/REST.pm view on Meta::CPAN
A string or a URI object denoting the base URL of the Jira server. This is a
required argument.
The REST methods described below all accept as a first argument the
endpoint's path of the specific API method to call. In general you can pass
the complete path, beginning with the prefix denoting the particular API to
use (C</rest/api/VERSION>, C</rest/servicedeskapi>, or
C</rest/agile/VERSION>). However, you may specify a default API prefix by
suffixing the URL with it. For example:
lib/JIRA/REST.pm view on Meta::CPAN
Jira's REST API documentation lists dozens of "resources" which can be
operated via the standard HTTP requests: GET, DELETE, PUT, and
POST. JIRA::REST objects implement four methods called GET, DELETE,
PUT, and POST to make it easier to invoke and get results from Jira's
REST endpoints.
All four methods need two arguments:
=over
lib/JIRA/REST.pm view on Meta::CPAN
=item * application/json
The majority of the API's resources return JSON values. Those are
decoded using the C<decode> method of a C<JSON> object. Most of the
endpoints return hashes, which are returned as a Perl hash reference.
=item * text/plain
Those values are returned as simple strings.
=back
Some endpoints don't return anything. In those cases, the methods
return C<undef>. The methods croak if they get any other type of
values in return.
In case of errors (i.e., if the underlying HTTP method return an error
code different from 2xx) the methods croak with a multi-line string
lib/JIRA/REST.pm view on Meta::CPAN
Sets up an iterator for the search specified by the hash reference PARAMS.
It must be called before calls to B<next_issue>.
PARAMS must conform with the query parameters allowed for the
C</rest/api/2/search> Jira REST endpoint.
=head2 B<next_issue>
This must be called after a call to B<set_search_iterator>. Each call
returns a reference to the next issue from the filter. When there are no
more issues it returns undef.
Using the set_search_iterator/next_issue utility methods you can iterate
through large sets of issues without worrying about the startAt/total/offset
attributes in the response from the /search REST endpoint. These methods
implement the "paging" algorithm needed to work with those attributes.
=head2 B<attach_files> ISSUE FILE...
The C</issue/KEY/attachments> REST endpoint, used to attach files to issues,
requires a specific content type encoding which is difficult to come up with
just the C<REST::Client> interface. This utility method offers an easier
interface to attach files to issues.
=head1 PERL AND JIRA COMPATIBILITY POLICY
view all matches for this distribution
view release on metacpan or search on metacpan
lib/JMAP/Tester.pm view on Meta::CPAN
#pod =method get_client_session
#pod
#pod $tester->get_client_session;
#pod $tester->get_client_session($auth_uri);
#pod
#pod This method fetches the content at the authentication endpoint.
#pod
#pod This method respects the C<should_return_futures> attributes of the
#pod JMAP::Tester object, and in futures mode will return a future that will resolve
#pod to the L<JMAP::Tester::Result::Auth> object.
#pod
lib/JMAP/Tester.pm view on Meta::CPAN
#pod =method update_client_session
#pod
#pod $tester->update_client_session;
#pod $tester->update_client_session($auth_uri);
#pod
#pod This method fetches the content at the authentication endpoint and uses it to
#pod configure the tester's target URIs and signing keys.
#pod
#pod This method respects the C<should_return_futures> attributes of the
#pod JMAP::Tester object, and in futures mode will return a future that will resolve
#pod to the Result.
lib/JMAP/Tester.pm view on Meta::CPAN
#pod
#pod my $response = $jtest->http_request($http_request);
#pod
#pod Sometimes, you may need to make an HTTP request with your existing web
#pod connection. This might be to interact with a custom authentication mechanism,
#pod to access custom endpoints, or just to make very, very specifically crafted
#pod requests. For this reasons, C<http_request> exists.
#pod
#pod Pass this method an L<HTTP::Request> and it will use the tester's UA object to
#pod make the request.
#pod
lib/JMAP/Tester.pm view on Meta::CPAN
=head2 get_client_session
$tester->get_client_session;
$tester->get_client_session($auth_uri);
This method fetches the content at the authentication endpoint.
This method respects the C<should_return_futures> attributes of the
JMAP::Tester object, and in futures mode will return a future that will resolve
to the L<JMAP::Tester::Result::Auth> object.
=head2 update_client_session
$tester->update_client_session;
$tester->update_client_session($auth_uri);
This method fetches the content at the authentication endpoint and uses it to
configure the tester's target URIs and signing keys.
This method respects the C<should_return_futures> attributes of the
JMAP::Tester object, and in futures mode will return a future that will resolve
to the Result.
lib/JMAP/Tester.pm view on Meta::CPAN
my $response = $jtest->http_request($http_request);
Sometimes, you may need to make an HTTP request with your existing web
connection. This might be to interact with a custom authentication mechanism,
to access custom endpoints, or just to make very, very specifically crafted
requests. For this reasons, C<http_request> exists.
Pass this method an L<HTTP::Request> and it will use the tester's UA object to
make the request.
view all matches for this distribution
view release on metacpan or search on metacpan
lib/JSON/API.pm view on Meta::CPAN
=back
=head2 get|post|patch|put|del
Perform an HTTP action (GET|POST|PATCH|PUT|DELETE) against the given API. All methods
take the B<path> to the API endpoint as the first parameter. The B<patch()>, B<put()> and
B<post()> methods also accept a second B<data> parameter, which should be a reference
to be serialized into JSON for POST/PATCH/PUTing to the endpoint.
All methods also accept an optional B<apphdr> parameter in the last position, which
is a hashref. The referenced hash contains header names and values that will be
submitted with the request. See HTTP::Headers. This can be used to provide
B<If-Modified> or other headers required by the API.
view all matches for this distribution
view release on metacpan or search on metacpan
t/data/hypercritical.json view on Meta::CPAN
},
"id" : "http://hypercritical.co/2013/04/07/technological-conservatism",
"title" : "Technological Conservatism",
"date_modified" : "2013-04-07T21:30:25-04:00",
"url" : "http://hypercritical.co/2013/04/07/technological-conservatism",
"content_html" : "<p>Technology can be a surprisingly ideological topic. In politics, the spectrum of belief is right on the surface: conservative/liberal, right/left. In tech, that same spectrum exists, but itâs rarely discussed. Whatâ...
},
{
"id" : "http://hypercritical.co/2013/03/19/self-reliance",
"author" : {
"url" : "http://hypercritical.co",
t/data/hypercritical.json view on Meta::CPAN
"date_modified" : "2013-03-04T08:24:32-05:00",
"url" : "http://hypercritical.co/2013/02/24/annoyance-driven-development",
"content_html" : "<div class=\"image header\"><img src=\"/2013/02/24/images/annoyance.jpg\" width=\"640\" height=\"341\" alt=\"High Maintenance\"/></div>\n\n<p>Iâve been watching <a href=\"http://en.wikipedia.org/wiki/House_of_Cards_(U.S._...
},
{
"content_html" : "<p>The iPhone 5 <a href=\"http://www.extremetech.com/computing/136422-iphone-5-review-round-up-everything-apple-promised\">caught</a> <a href=\"http://www.cnn.com/2012/09/26/tech/mobile/iphone-5-complaints\">some</a> <a hre...
"url" : "http://hypercritical.co/2013/02/08/dont-stop-thinking-about-tomorrow",
"title" : "Donât Stop Thinking About Tomorrow",
"date_modified" : "2013-02-08T15:21:56-05:00",
"id" : "http://hypercritical.co/2013/02/08/dont-stop-thinking-about-tomorrow",
"date_published" : "2013-02-08T15:08:57-05:00",
view all matches for this distribution
view release on metacpan or search on metacpan
author.t/01-parse-error.t view on Meta::CPAN
use JSON::RPC::Dispatcher;
use Test::More tests => 6;
use Test::WWW::Mechanize::PSGI;
my $rpc = JSON::RPC::Dispatcher->new;
my $endpoint = 'http://localhost';
my $mech = Test::WWW::Mechanize::PSGI->new(
app => $rpc->to_app,
);
$rpc->register(echo => sub {
return $_[0];
});
sub do_jsonrpc {
my ( $content ) = @_;
my $req = HTTP::Request->new(POST => $endpoint);
$req->header('Content-type' => 'application/json');
$req->header('Content-length' => length($content));
$req->content($content);
$mech->request($req);
}
view all matches for this distribution
view release on metacpan or search on metacpan
lib/JSON/RPC/Simple/Client.pm view on Meta::CPAN
=item new (URL)
=item new (URL, \%OPTIONS)
Creates a new client whos endpoint is given in I<URL>.
Valid options:
=over 4
view all matches for this distribution
view release on metacpan or search on metacpan
0.009 2021-12-06 05:55:01Z
- validation no longer errors on a missing media type if the
corresponding schema is empty (true)
- validate_request and validate_response now accept an operation_id
instead of a path_template for looking up the endpoint
specification in the openapi document
- treat Content-Type headers and media-type entries in openapi
documents case-insensitively, and also match wildcards
(image/jpg falls back to image/* or */*)
view all matches for this distribution
view release on metacpan or search on metacpan
lib/JSON/Validator/cache/36d1bd12eeed51e86c8695bd8876a9df view on Meta::CPAN
}
}
},
"paths": {
"type": "object",
"description": "Relative paths to the individual endpoints. They must be relative to the 'basePath'.",
"patternProperties": {
"^x-": {
"$ref": "#/definitions/vendorExtension"
},
"^/": {
view all matches for this distribution
view release on metacpan or search on metacpan
examples/jrpc-requester.pl view on Meta::CPAN
use Jabber::RPC::Client;
my $client = new Jabber::RPC::Client(
server => 'localhost',
identauth => 'client:pass',
endpoint => 'jrpc.localhost/the-server',
);
my $result;
# Call component-based Jabber-RPC responder
examples/jrpc-requester.pl view on Meta::CPAN
# Call client-based Jabber-RPC responder
# (the responder is jrpc-responder-client.pl)
# -------------------------------------------
$client->endpoint('jrpc@localhost/jrpc-server');
$result = $client->call('examples.getStateList', [12, 28, 33, 39, 46]);
print "getStateList: ", $result || $client->lastfault, "\n";
# Call HTTP-based responder (via HTTPgate)
# (the responder is states-daemon.pl)
# ----------------------------------------
$client->endpoint('jrpchttp.localhost/http://localhost:8000/RPC2');
$result = $client->call('examples.getStateStruct',
{ state1 => 18, state2 => 27, state3 => 48 } );
print "getStateStruct: ", $result || $client->lastfault, "\n";
view all matches for this distribution
view release on metacpan or search on metacpan
examples/client.pl view on Meta::CPAN
my $client = new Jabber::RPC::Client(
server => 'localhost',
identauth => 'dj:password',
resource => 'the-client',
# endpoint => 'a@localhost/the-server',
endpoint => 'jrpc.localhost/the-server',
);
my $result;
$result = $client->call('examples.getStateName', 5);
view all matches for this distribution
view release on metacpan or search on metacpan
#define DUK_HTHREAD_STRING_YIELD(thr) DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_YIELD)
#define DUK_HEAP_NUM_STRINGS 167
#define DUK_STRIDX_START_RESERVED 122
#define DUK_STRIDX_START_STRICT_RESERVED 158
#define DUK_STRIDX_END_RESERVED 167 /* exclusive endpoint */
/* To convert a heap stridx to a token number, subtract
* DUK_STRIDX_START_RESERVED and add DUK_TOK_START_RESERVED.
*/
#if !defined(DUK_SINGLE_FILE)
*
* Typing now assumes 32-bit string byte/char offsets (duk_uint_fast32_t).
* Better typing might be to use duk_size_t.
*
* Caller should ensure 'char_offset' is within the string bounds [0,charlen]
* (endpoint is inclusive). If this is not the case, no memory unsafe
* behavior will happen but an error will be thrown.
*/
DUK_INTERNAL duk_uint_fast32_t duk_heap_strcache_offset_char2byte(duk_hthread *thr, duk_hstring *h, duk_uint_fast32_t char_offset) {
duk_heap *heap;
view all matches for this distribution
view release on metacpan or search on metacpan
lib/JavaScript/Duktape/C/lib/duktape.c view on Meta::CPAN
#define DUK_HTHREAD_STRING_YIELD(thr) DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_YIELD)
#define DUK_HEAP_NUM_STRINGS 166
#define DUK_STRIDX_START_RESERVED 121
#define DUK_STRIDX_START_STRICT_RESERVED 157
#define DUK_STRIDX_END_RESERVED 166 /* exclusive endpoint */
/* To convert a heap stridx to a token number, subtract
* DUK_STRIDX_START_RESERVED and add DUK_TOK_START_RESERVED.
*/
#if !defined(DUK_SINGLE_FILE)
lib/JavaScript/Duktape/C/lib/duktape.c view on Meta::CPAN
*
* Typing now assumes 32-bit string byte/char offsets (duk_uint_fast32_t).
* Better typing might be to use duk_size_t.
*
* Caller should ensure 'char_offset' is within the string bounds [0,charlen]
* (endpoint is inclusive). If this is not the case, no memory unsafe
* behavior will happen but an error will be thrown.
*/
DUK_INTERNAL duk_uint_fast32_t duk_heap_strcache_offset_char2byte(duk_hthread *thr, duk_hstring *h, duk_uint_fast32_t char_offset) {
duk_heap *heap;
view all matches for this distribution
view release on metacpan or search on metacpan
lib/JavaScript/Embedded/C/lib/duktape.c view on Meta::CPAN
#define DUK_HTHREAD_STRING_YIELD(thr) DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_YIELD)
#define DUK_HEAP_NUM_STRINGS 167
#define DUK_STRIDX_START_RESERVED 122
#define DUK_STRIDX_START_STRICT_RESERVED 158
#define DUK_STRIDX_END_RESERVED 167 /* exclusive endpoint */
/* To convert a heap stridx to a token number, subtract
* DUK_STRIDX_START_RESERVED and add DUK_TOK_START_RESERVED.
*/
#if !defined(DUK_SINGLE_FILE)
lib/JavaScript/Embedded/C/lib/duktape.c view on Meta::CPAN
*
* Typing now assumes 32-bit string byte/char offsets (duk_uint_fast32_t).
* Better typing might be to use duk_size_t.
*
* Caller should ensure 'char_offset' is within the string bounds [0,charlen]
* (endpoint is inclusive). If this is not the case, no memory unsafe
* behavior will happen but an error will be thrown.
*/
DUK_INTERNAL duk_uint_fast32_t duk_heap_strcache_offset_char2byte(duk_hthread *thr, duk_hstring *h, duk_uint_fast32_t char_offset) {
duk_heap *heap;
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Jifty/Plugin/OpenID.pm view on Meta::CPAN
- OpenID:
ax_param: openid.ns.ax=http://openid.net/srv/ax/1.0&openid.ax.mode=fetch_request&openid.ax.type.email=http://axschema.org/contact/email&openid.ax.type.firstname=http://axschema.org/namePerson/first&openid.ax.type.lastname=http://axschema.org/n...
ax_values: value.email,value.firstname,value.lastname
ax_mapping: "{ 'email': 'value.email', 'name': 'value.firstname value.lastname' }"
this parameters are usuable for all OpenID endpoints supporting Attribute
Exchange extension. They can be overriden in your application. Watch and/or
override C<openid/wayf> template from L<Jifty::Plugin::OpenID::View>.
Or you can use in your view C<show('openid/wayf','/url_return_to');>.
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Jifty/Test/WWW/Mechanize.pm view on Meta::CPAN
using the "back button" after making the webservice request.
=cut
sub _build_webservices_request {
my ($self, $endpoint, $data) = @_;
my $uri = $self->uri->clone;
$uri->path($endpoint);
$uri->query('');
my $body = Jifty::YAML::Dump({ path => $endpoint, %$data});
HTTP::Request->new(
POST => $uri,
[ 'Content-Type' => 'text/x-yaml',
'Content-Length' => length($body) ],
view all matches for this distribution
view release on metacpan or search on metacpan
eg/deploy.pl view on Meta::CPAN
use Data::Dumper;
$Data::Dumper::Indent = 1;
my $client = Juju->new(
endpoint => $ENV{JUJU_ENDPOINT},
password => $ENV{JUJU_PASS}
);
$client->login;
$client->deploy(
charm => 'mysql',
view all matches for this distribution
view release on metacpan or search on metacpan
//---------------------------------------------------------------------
// interface
//---------------------------------------------------------------------
// create a new kcp control object, 'conv' must equal in two endpoint
// from the same connection. 'user' will be passed to the output callback
// output callback can be setup like this: 'kcp->output = my_udp_output'
ikcpcb* ikcp_create(IUINT32 conv, void *user);
// release kcp control object
view all matches for this distribution
view release on metacpan or search on metacpan
lib/KSx/Highlight/Summarizer.pm view on Meta::CPAN
use Number::Range;
use Hash::Util::FieldHash::Compat 'fieldhashes';
fieldhashes \my( %ellipsis, %summ_len, %page_h, %encoder );
sub _range_endpoints {
my $range = shift;
my @range = $range->range;
my $previous = shift @range;
my $subrange = [($previous) x 2];
my @arrays;
lib/KSx/Highlight/Summarizer.pm view on Meta::CPAN
my $start = $_-$limit;
$start = 0 if $start < 0;
$range->addrange($start . '..' . min($start+$x_len, $text_length));
last if !$summ_len || $range->size >= $summ_len;
}
my @excerpt_bounds = _range_endpoints($range);
#use DDS; warn Dump \@excerpt_bounds if $summ_len;
# close small gaps between ranges
for(my $c = 1; $c < @excerpt_bounds;++$c) {
$excerpt_bounds[$c][0] - $excerpt_bounds[$c-1][1] <= 10 and
view all matches for this distribution