view release on metacpan or search on metacpan
t/clustericious_config__hostname.t view on Meta::CPAN
use Test::More tests => 3;
use Sys::Hostname ();
use Clustericious::Config;
my $hostname = sub {
'froodle.fragmire.example.com';
};
do { no warnings 'redefine'; *Sys::Hostname::hostname = $hostname };
create_config_ok Foo => <<EOF;
t/clustericious_config__hostname.t view on Meta::CPAN
my $config = eval { Clustericious::Config->new('Foo') };
diag $@ if $@;
is eval { $config->host1 }, 'froodle', 'config.host1 = froodle';
diag $@ if $@;
is eval { $config->host2 }, 'froodle.fragmire.example.com', 'config.host2 = froodle.fragmire.example.com';
view all matches for this distribution
view release on metacpan or search on metacpan
examples/helloworld/htdocs/dwarf/bootstrap/css/bootstrap.css.map view on Meta::CPAN
{"version":3,"sources":["bootstrap.css","less/normalize.less","less/print.less","less/glyphicons.less","less/scaffolding.less","less/mixins/vendor-prefixes.less","less/mixins/tab-focus.less","less/mixins/image.less","less/type.less","less/mixins/text...
view all matches for this distribution
view release on metacpan or search on metacpan
fields - the field label and the new field contents; these are seperated by
$Cmenu::menu_sepn.
Since any type of item can be included in a menu, return values may be
equally complex. For complex return values, tokens can be split out using
a command fragment such as
chop($return_value=&menu_display("Menu Prompt",$start_on_menu_item));
@selection=split(/$Cmenu::menu_sep/,$return_value);
for($loop=1;$loop<=$#selection;$i++) {
# deal with each token
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Coat/Persistent.pm view on Meta::CPAN
changed.
=item B<from>: By default, this is the table name of the class, but can be changed
to an alternate table name (or even the name of a database view).
=item B<order>: An SQL fragment like "created_at DESC, name".
=item B<group>: An attribute name by which the result should be grouped.
Uses the GROUP BY SQL-clause.
=item B<limit>: An integer determining the limit on the number of rows that should
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Code/ART.pm view on Meta::CPAN
=head1 SYNOPSIS
use Code::ART;
# Convert source code fragment to sub and call...
$refactored = refactor_to_sub( $source_code, \%options );
# or:
$refactored = hoist_to_lexical( $source_code, \%options );
lib/Code/ART.pm view on Meta::CPAN
The module also comes with a Vim plugin to plumb those
refactoring behaviours directly into that editor (see L<"Vim integration">).
For example, the module provides a subroutine (C<refactor_to_sub()>)
that takes a source code fragment as a string, analyzes it to determine
the unbound variables within it, then constructs the source code of an
equivalent subroutine (with the unbound variables converted to
parameters) plus the source code of a suitable call to that subroutine.
It is useful when hooked into an editor, allowing you to
lib/Code/ART.pm view on Meta::CPAN
=head1 INTERFACE
=head2 Refactoring a fragment of Perl code
To refactor some Perl code, call the C<refactor_to_sub()>
subroutine, which is automatically exported when the
module is loaded.
lib/Code/ART.pm view on Meta::CPAN
=item C<< from => $starting_string_index >>
=item C<< to => $ending_string_index >>
These two options are actually required. They must be non-negative integer
values that represent the indexes in the string where the fragment you
wish to refactor begins and ends.
=item C<< name => $name_of_new_sub >>
lib/Code/ART.pm view on Meta::CPAN
=item C<< failed => 'the code has an internal return statement' >>
If the code you're trying to put into a subroutine contains a (conditional) return
statement anywhere but at the end of the fragment, then there's no way to refactor it
cleanly into another subroutine, because the internal return will return from the newly
refactored subroutine, I<not> from the place where you'll be replacing the original
code with a call tothe newly refactored subroutine. So C<refactor_to_sub()> doesn't try.
=item C<< failed => "code has both a leading assignment and an explicit return" >>
If you're attempting to refactor a fragment of code that starts with the
rvalue of an assignment, and ends in a return, there's no way to put
both into a new subroutine and still have the previous behaviour of the
original code preserved. So C<refactor_to_sub()> doesn't try.
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Code/DRY.pm view on Meta::CPAN
# then iterate through the lcp array via get_len_at(index)
# and through the suffix/offset array via get_offset_at(index)
=head1 DESCRIPTION
The module's main purpose is to report repeated text fragments (typically Perl code)
that could be considered for isolation and/or abstraction in order to
reduce multiple copies of the same code (aka cut and paste code).
Code duplicates may occur in the same line, file or directory.
lib/Code/DRY.pm view on Meta::CPAN
All repetitions with a minimum length of C<$minlength> will be reported by the C<report> callback function.
=head2 C<set_reporter(sub{ CODE BLOCK })>
Set custom code to report duplicates of a code fragment. The callback is invoked with
position information for the copies found during analysis.
The supplied code has to accept two scalars and an array reference.
The first parameter is the required minimum length of duplicates to be reported.
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Coerce/Types/Standard.pm view on Meta::CPAN
abuse => \&_uri
});
sub _uri_change {
my $hide = shift;
return scalar $meta->Str if $hide =~ m/^escape|unescape|schema|host|path|query_string|fragment$/;
return scalar $meta->HashRef;
}
sub _uri_constraint {
my $hide = sprintf "constraint_uri_%s", shift;
lib/Coerce/Types/Standard.pm view on Meta::CPAN
sub constraint_uri_query_string {
$_[0] =~ m/$path/;
$2 || $4 || $5 || $7 ? 0 : 1;
}
sub constraint_uri_fragment {
$_[0] =~ m/$path/;
$2 || $4 || $5 || $6 ? 0 : 1;
}
sub constraint_uri_query_form {
lib/Coerce/Types/Standard.pm view on Meta::CPAN
sub uri_query_string {
$_[0] =~ m/$path/;
return uri_unescape($6);
}
sub uri_fragment {
$_[0] =~ m/$path/;
return $7;
}
sub uri_query_form {
lib/Coerce/Types/Standard.pm view on Meta::CPAN
*-*-*-*-*-*-*
{
okay => s
}
=item fragment
Extract the fragment from the given url.
URI->by('fragment')->coerce('https://example.lnation.org#okays');
*-*-*-*-*-*-*
# okays
=item escape
view all matches for this distribution
view release on metacpan or search on metacpan
share/js/jquery-1.11.3.js view on Meta::CPAN
var ret = matches.call( elem, expr );
// IE 9's matchesSelector returns false on disconnected nodes
if ( ret || support.disconnectedMatch ||
// As well, disconnected nodes are said to be in a document
// fragment in IE 9
elem.document && elem.document.nodeType !== 11 ) {
return ret;
}
} catch (e) {}
}
share/js/jquery-1.11.3.js view on Meta::CPAN
jQuery( selectors, context || this.context ) :
0;
for ( ; i < l; i++ ) {
for ( cur = this[i]; cur && cur !== context; cur = cur.parentNode ) {
// Always skip document fragments
if ( cur.nodeType < 11 && (pos ?
pos.index(cur) > -1 :
// Don't pass non-elements to Sizzle
cur.nodeType === 1 &&
share/js/jquery-1.11.3.js view on Meta::CPAN
(function() {
// Minified: var a,b,c
var input = document.createElement( "input" ),
div = document.createElement( "div" ),
fragment = document.createDocumentFragment();
// Setup
div.innerHTML = " <link/><table></table><a href='/a'>a</a><input type='checkbox'/>";
// IE strips leading whitespace when .innerHTML is used
share/js/jquery-1.11.3.js view on Meta::CPAN
// Check if a disconnected checkbox will retain its checked
// value of true after appended to the DOM (IE6/7)
input.type = "checkbox";
input.checked = true;
fragment.appendChild( input );
support.appendChecked = input.checked;
// Make sure textarea (and checkbox) defaultValue is properly cloned
// Support: IE6-IE11+
div.innerHTML = "<textarea>x</textarea>";
support.noCloneChecked = !!div.cloneNode( true ).lastChild.defaultValue;
// #11217 - WebKit loses check when the name is after the checked attribute
fragment.appendChild( div );
div.innerHTML = "<input type='radio' checked='checked' name='t'/>";
// Support: Safari 5.1, iOS 5.1, Android 4.x, Android 2.3
// old WebKit doesn't clone checked state correctly in fragments
support.checkClone = div.cloneNode( true ).cloneNode( true ).lastChild.checked;
// Support: IE<9
// Opera does not clone events (and typeof div.attachEvent === undefined).
// IE9-10 clones events bound via attachEvent, but they don't trigger with .click()
share/js/jquery-1.11.3.js view on Meta::CPAN
// IE6-8 can't serialize link, script, style, or any html5 (NoScope) tags,
// unless wrapped in a div with non-breaking characters in front of it.
_default: support.htmlSerialize ? [ 0, "", "" ] : [ 1, "X<div>", "</div>" ]
},
safeFragment = createSafeFragment( document ),
fragmentDiv = safeFragment.appendChild( document.createElement("div") );
wrapMap.optgroup = wrapMap.option;
wrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead;
wrapMap.th = wrapMap.td;
share/js/jquery-1.11.3.js view on Meta::CPAN
if ( support.html5Clone || jQuery.isXMLDoc(elem) || !rnoshimcache.test( "<" + elem.nodeName + ">" ) ) {
clone = elem.cloneNode( true );
// IE<=8 does not properly clone detached, unknown element nodes
} else {
fragmentDiv.innerHTML = elem.outerHTML;
fragmentDiv.removeChild( clone = fragmentDiv.firstChild );
}
if ( (!support.noCloneEvent || !support.noCloneChecked) &&
(elem.nodeType === 1 || elem.nodeType === 11) && !jQuery.isXMLDoc(elem) ) {
share/js/jquery-1.11.3.js view on Meta::CPAN
buildFragment: function( elems, context, scripts, selection ) {
var j, elem, contains,
tmp, tag, tbody, wrap,
l = elems.length,
// Ensure a safe fragment
safe = createSafeFragment( context ),
nodes = [],
i = 0;
share/js/jquery-1.11.3.js view on Meta::CPAN
// Manually add leading whitespace removed by IE
if ( !support.leadingWhitespace && rleadingWhitespace.test( elem ) ) {
nodes.push( context.createTextNode( rleadingWhitespace.exec( elem )[0] ) );
}
// Remove IE's autoinserted <tbody> from table fragments
if ( !support.tbody ) {
// String was a <table>, *may* have spurious <tbody>
elem = tag === "table" && !rtbody.test( elem ) ?
tmp.firstChild :
share/js/jquery-1.11.3.js view on Meta::CPAN
tmp = safe.lastChild;
}
}
}
// Fix #11356: Clear elements from fragment
if ( tmp ) {
safe.removeChild( tmp );
}
// Reset defaultChecked for any radios and checkboxes
share/js/jquery-1.11.3.js view on Meta::CPAN
continue;
}
contains = jQuery.contains( elem.ownerDocument, elem );
// Append to fragment
tmp = getAll( safe.appendChild( elem ), "script" );
// Preserve script evaluation history
if ( contains ) {
setGlobalEval( tmp );
share/js/jquery-1.11.3.js view on Meta::CPAN
// Flatten any nested arrays
args = concat.apply( [], args );
var first, node, hasScripts,
scripts, doc, fragment,
i = 0,
l = this.length,
set = this,
iNoClone = l - 1,
value = args[0],
isFunction = jQuery.isFunction( value );
// We can't cloneNode fragments that contain checked, in WebKit
if ( isFunction ||
( l > 1 && typeof value === "string" &&
!support.checkClone && rchecked.test( value ) ) ) {
return this.each(function( index ) {
var self = set.eq( index );
share/js/jquery-1.11.3.js view on Meta::CPAN
self.domManip( args, callback );
});
}
if ( l ) {
fragment = jQuery.buildFragment( args, this[ 0 ].ownerDocument, false, this );
first = fragment.firstChild;
if ( fragment.childNodes.length === 1 ) {
fragment = first;
}
if ( first ) {
scripts = jQuery.map( getAll( fragment, "script" ), disableScript );
hasScripts = scripts.length;
// Use the original fragment for the last item instead of the first because it can end up
// being emptied incorrectly in certain situations (#8070).
for ( ; i < l; i++ ) {
node = fragment;
if ( i !== iNoClone ) {
node = jQuery.clone( node, true, true );
// Keep references to cloned scripts for later restoration
share/js/jquery-1.11.3.js view on Meta::CPAN
}
}
}
// Fix #11809: Avoid leaking memory
fragment = first = null;
}
}
return this;
}
share/js/jquery-1.11.3.js view on Meta::CPAN
// data: string of html
// context (optional): If specified, the fragment will be created in this context, defaults to document
// keepScripts (optional): If true, will include scripts passed in the html string
jQuery.parseHTML = function( data, context, keepScripts ) {
if ( !data || typeof data !== "string" ) {
return null;
}
view all matches for this distribution
view release on metacpan or search on metacpan
inc/Spiffy.pm view on Meta::CPAN
? '{}'
: default_as_code($default);
my $code = $code{sub_start};
if ($args->{-init}) {
my $fragment = $args->{-weak} ? $code{weak_init} : $code{init};
$code .= sprintf $fragment, $field, $args->{-init}, ($field) x 4;
}
$code .= sprintf $code{set_default}, $field, $default_string, $field
if defined $default;
$code .= sprintf $code{return_if_get}, $field;
$code .= sprintf $code{set}, $field;
view all matches for this distribution
view release on metacpan or search on metacpan
inc/Module/AutoInstall.pm view on Meta::CPAN
return 1;
}
sub postamble {
$PostambleUsed = 1;
my $fragment;
$fragment .= <<"AUTO_INSTALL" if !$InstallDepsTarget;
config :: installdeps
\t\$(NOECHO) \$(NOOP)
AUTO_INSTALL
$fragment .= <<"END_MAKE";
checkdeps ::
\t\$(PERL) $0 --checkdeps
installdeps ::
inc/Module/AutoInstall.pm view on Meta::CPAN
listalldeps ::
\t$PostambleActionsListAllDeps
END_MAKE
return $fragment;
}
1;
__END__
view all matches for this distribution
view release on metacpan or search on metacpan
t/comment-in-value.t view on Meta::CPAN
}
{
is Colon::Config::read("url:http://example.com/#anchor\n"),
[ url => 'http://example.com/#anchor' ],
"URL fragment (#anchor) in value is preserved";
}
{
is Colon::Config::read("channel:#general\n"), [ channel => '#general' ],
"channel name with '#' prefix is preserved";
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Color/Library/Dictionary/NBS_ISCC/M.pm view on Meta::CPAN
foxglove foxglove #604e81
fox trot foxtrot #66ada4
fragonard fragonard #ab4e52
france france #00304e
france rose francerose #e4717a
lib/Color/Library/Dictionary/NBS_ISCC/M.pm view on Meta::CPAN
['nbs-iscc-m:fox.94','fox','fox',[150,113,23],'967117',9859351],
['nbs-iscc-m:fox.95','fox','fox',[108,84,30],'6c541e',7099422],
['nbs-iscc-m:foxglove.207','foxglove','foxglove',[96,78,151],'604e97',6311575],
['nbs-iscc-m:foxglove.211','foxglove','foxglove',[96,78,129],'604e81',6311553],
['nbs-iscc-m:foxtrot.163','foxtrot','fox trot',[102,173,164],'66ada4',6729124],
['nbs-iscc-m:fragonard.15','fragonard','fragonard',[171,78,82],'ab4e52',11226706],
['nbs-iscc-m:france.183','france','france',[0,48,78],'00304e',12366],
['nbs-iscc-m:francerose.3','francerose','france rose',[228,113,122],'e4717a',14971258],
['nbs-iscc-m:francerose.24','francerose','france rose',[40,32,34],'282022',2629666],
['nbs-iscc-m:freedom.183','freedom','freedom',[0,48,78],'00304e',12366],
['nbs-iscc-m:freestone.73','freestone','freestone',[250,214,165],'fad6a5',16438949],
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Combinator.pm view on Meta::CPAN
my $depth = shift;
$_[0] =~ s[$com_pat]{
my $code = $1;
my $out = '';
while( $code =~ /($begin_pat|$par_pat|$cir_par_pat)($token_pat*?)(?=($par_pat|$cir_par_pat|$end_pat))/g ) {
my $fragment = $2;
$out .= com($depth, $fragment, $1);
}
$out;
}ge;
}
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Comics.pm view on Meta::CPAN
# Save the state.
save_state();
}
# Gather the HTML fragments into a single index.html.
build();
# Show processing statistics.
statistics();
}
lib/Comics.pm view on Meta::CPAN
################ Index subroutines ################
sub build {
# Change to the spooldir and collect all HTML fragments.
chdir($spooldir) or die("$spooldir: $!\n");
opendir( my $dir, "." );
my @files = grep { /^[^._].+(?<!index)\.(?:html)$/ } readdir($dir);
close($dir);
warn("Number of images = ", scalar(@files), "\n") if $debug;
$stats->{tally} = $stats->{uptodate} = @files if $rebuild;
# Sort the fragments on last modification date.
@files =
map { $_->[0] }
sort { $b->[1] <=> $a->[1] }
grep { $force || ! $state->{comics}->{$_->[2]}->{disabled} }
map { ( my $t = $_ ) =~ s/\.\w+$//;
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Commands/Guarded.pm view on Meta::CPAN
applied to scripts, which are generally very high-level and procedural
in nature, the methodologies can rapidly result in unreadable
spaghetti, with more code devoted to methodology than to method.
Most scripters react in one of two ways: they either let the spaghetti
ensue, or they throw up their hands and write fragile code.
=head2 An example
Suppose you want to write a script to mount a scratch directory from
an NFS server. (This would usually be accomplished via a shell
view all matches for this distribution
view release on metacpan or search on metacpan
t/app/Plack/HTTPParser/PP.t view on Meta::CPAN
$env->{REQUEST_METHOD} = $method;
$env->{SERVER_PROTOCOL} = "HTTP/$major.$minor";
$env->{REQUEST_URI} = $uri;
my($path, $query) = ( $uri =~ /^([^?]*)(?:\?(.*))?$/s );
for ($path, $query) { s/\#.*$// if defined && length } # dumb clients sending URI fragments
$env->{PATH_INFO} = URI::Escape::uri_unescape($path);
$env->{QUERY_STRING} = $query || '';
$env->{SCRIPT_NAME} = '';
view all matches for this distribution
view release on metacpan or search on metacpan
bzlib-src/bzip2.c view on Meta::CPAN
to imply that merely doing open() will not affect the access time.
Therefore we merely need to hope that the C library only does
open() as a result of fopen(), and not any kind of read()-ahead
cleverness.
It sounds pretty fragile to me. Whether this carries across
robustly to arbitrary Unix-like platforms (or even works robustly
on this one, RedHat 7.2) is unknown to me. Nevertheless ...
*/
#if BZ_UNIX
static
view all matches for this distribution
view release on metacpan or search on metacpan
7zip/CPP/7zip/Archive/SquashfsHandler.cpp view on Meta::CPAN
CRecordVector<CNode> _nodes;
CRecordVector<UInt32> _nodesPos;
CRecordVector<UInt32> _blockToNode;
CData _inodesData;
CData _dirs;
CRecordVector<CFrag> _frags;
// CByteBuffer _uids;
// CByteBuffer _gids;
CHeader _h;
CMyComPtr<IInStream> _stream;
7zip/CPP/7zip/Archive/SquashfsHandler.cpp view on Meta::CPAN
if (_h.NumFrags != 0)
{
if (_h.NumFrags > kNumFilesMax)
return S_FALSE;
_frags.Reserve(_h.NumFrags);
CByteBuffer data;
unsigned bigFrag = (_h.Major > 2);
unsigned fragPtrsInBlockLog = kMetadataBlockSizeLog - (3 + bigFrag);
UInt32 numBlocks = (_h.NumFrags + (1 << fragPtrsInBlockLog) - 1) >> fragPtrsInBlockLog;
size_t numBlocksBytes = (size_t)numBlocks << (2 + bigFrag);
data.SetCapacity(numBlocksBytes);
RINOK(inStream->Seek(_h.FragTable, STREAM_SEEK_SET, NULL));
RINOK(ReadStream_FALSE(inStream, data, numBlocksBytes));
bool be = _h.be;
7zip/CPP/7zip/Archive/SquashfsHandler.cpp view on Meta::CPAN
if (i != numBlocks - 1 || unpackSize != ((_h.NumFrags << (3 + bigFrag)) & (kMetadataBlockSize - 1)))
return S_FALSE;
const Byte *buf = _dynOutStreamSpec->GetBuffer();
for (UInt32 j = 0; j < kMetadataBlockSize && j < unpackSize;)
{
CFrag frag;
if (bigFrag)
{
frag.StartBlock = Get64(buf + j);
frag.Size = Get32(buf + j + 8);
// some archives contain nonzero in unused (buf + j + 12)
j += 16;
}
else
{
frag.StartBlock = Get32(buf + j);
frag.Size = Get32(buf + j + 4);
j += 8;
}
_frags.Add(frag);
}
}
if ((UInt32)_frags.Size() != _h.NumFrags)
return S_FALSE;
}
// RINOK(inStream->Seek(_h.InodeTable, STREAM_SEEK_SET, NULL));
7zip/CPP/7zip/Archive/SquashfsHandler.cpp view on Meta::CPAN
_items.Clear();
_nodes.Clear();
_nodesPos.Clear();
_blockToNode.Clear();
_frags.Clear();
_inodesData.Clear();
_dirs.Clear();
// _uids.Free();
// _gids.Free();;
7zip/CPP/7zip/Archive/SquashfsHandler.cpp view on Meta::CPAN
_blockOffsets.Add(totalPack);
}
if (node.ThereAreFrags())
{
if (node.Frag >= (UInt32)_frags.Size())
return false;
const CFrag &frag = _frags[node.Frag];
if (node.Offset == 0)
{
UInt32 size = GET_COMPRESSED_BLOCK_SIZE(frag.Size);
if (size > _h.BlockSize)
return false;
totalPack += size;
}
}
7zip/CPP/7zip/Archive/SquashfsHandler.cpp view on Meta::CPAN
}
else
{
if (!node.ThereAreFrags())
return S_FALSE;
const CFrag &frag = _frags[node.Frag];
offsetInBlock = node.Offset;
blockOffset = frag.StartBlock;
packBlockSize = GET_COMPRESSED_BLOCK_SIZE(frag.Size);
compressed = IS_COMPRESSED_BLOCK(frag.Size);
}
if (packBlockSize == 0)
{
// sparse file ???
view all matches for this distribution
view release on metacpan or search on metacpan
src/csnappy.h view on Meta::CPAN
*
* Returns an "end" pointer into "output" buffer.
* "end - output" is the compressed size of "input".
*/
char*
csnappy_compress_fragment(
const char *input,
const uint32_t input_length,
char *output,
void *working_memory,
const int workmem_bytes_power_of_two);
view all matches for this distribution
view release on metacpan or search on metacpan
ext/zstd/build/single_file_libs/examples/emscripten.c view on Meta::CPAN
static GLuint vertId = 0;
/**
* Fragment shader ID.
*/
static GLuint fragId = 0;
//********************************* Uniforms *********************************/
/**
* Quad rotation angle ID.
ext/zstd/build/single_file_libs/examples/emscripten.c view on Meta::CPAN
"#version 120\n"
#endif
"uniform float uRot;" // rotation
"attribute vec2 aPos;" // vertex position coords
"attribute vec2 aUV0;" // vertex texture UV0
"varying vec2 vUV0;" // (passed to fragment shader)
"void main() {"
" float cosA = cos(radians(uRot));"
" float sinA = sin(radians(uRot));"
" mat3 rot = mat3(cosA, -sinA, 0.0,"
" sinA, cosA, 0.0,"
ext/zstd/build/single_file_libs/examples/emscripten.c view on Meta::CPAN
"}";
/**
* Fragment shader for the above polys.
*/
static GLchar const fragShader2D[] =
#if GL_ES_VERSION_2_0
"#version 100\n"
"precision mediump float;\n"
#else
"#version 120\n"
#endif
"uniform sampler2D uTx0;"
"varying vec2 vUV0;" // (passed from fragment shader)
"void main() {"
" gl_FragColor = texture2D(uTx0, vUV0);"
"}";
/**
ext/zstd/build/single_file_libs/examples/emscripten.c view on Meta::CPAN
int main() {
if (initContext()) {
// Compile shaders and set the initial GL state
if ((progId = glCreateProgram())) {
vertId = compileShader(GL_VERTEX_SHADER, vertShader2D);
fragId = compileShader(GL_FRAGMENT_SHADER, fragShader2D);
glBindAttribLocation(progId, GL_VERT_POSXY_ID, "aPos");
glBindAttribLocation(progId, GL_VERT_TXUV0_ID, "aUV0");
glAttachShader(progId, vertId);
glAttachShader(progId, fragId);
glLinkProgram (progId);
glUseProgram (progId);
uRotId = glGetUniformLocation(progId, "uRot");
uTx0Id = glGetUniformLocation(progId, "uTx0");
if (uTx0Id >= 0) {
view all matches for this distribution
view release on metacpan or search on metacpan
ext/zstd/contrib/linux-kernel/0002-lib-Add-zstd-modules.patch view on Meta::CPAN
+ * consequence, check that values remain within valid application range,
+ * especially `windowSize`, before allocation. Each application can set its own
+ * limit, depending on local restrictions. For extended interoperability, it is
+ * recommended to support at least 8 MB.
+ * Frame parameters are extracted from the beginning of the compressed frame.
+ * Data fragment must be large enough to ensure successful decoding, typically
+ * `ZSTD_frameHeaderSize_max` bytes.
+ * Result: 0: successful decoding, the `ZSTD_frameParams` structure is filled.
+ * >0: `srcSize` is too small, provide at least this many bytes.
+ * errorCode, which can be tested using ZSTD_isError().
+ *
view all matches for this distribution
view release on metacpan or search on metacpan
inc/Module/AutoInstall.pm view on Meta::CPAN
return 1;
}
sub postamble {
$PostambleUsed = 1;
my $fragment;
$fragment .= <<"AUTO_INSTALL" if !$InstallDepsTarget;
config :: installdeps
\t\$(NOECHO) \$(NOOP)
AUTO_INSTALL
$fragment .= <<"END_MAKE";
checkdeps ::
\t\$(PERL) $0 --checkdeps
installdeps ::
inc/Module/AutoInstall.pm view on Meta::CPAN
listalldeps ::
\t$PostambleActionsListAllDeps
END_MAKE
return $fragment;
}
1;
__END__
view all matches for this distribution
view release on metacpan or search on metacpan
inc/Module/AutoInstall.pm view on Meta::CPAN
return 1;
}
sub postamble {
$PostambleUsed = 1;
my $fragment;
$fragment .= <<"AUTO_INSTALL" if !$InstallDepsTarget;
config :: installdeps
\t\$(NOECHO) \$(NOOP)
AUTO_INSTALL
$fragment .= <<"END_MAKE";
checkdeps ::
\t\$(PERL) $0 --checkdeps
installdeps ::
inc/Module/AutoInstall.pm view on Meta::CPAN
listalldeps ::
\t$PostambleActionsListAllDeps
END_MAKE
return $fragment;
}
1;
__END__
view all matches for this distribution
view release on metacpan or search on metacpan
t/01responder.t view on Meta::CPAN
GET / HTTP/1.1
EOF
$controller->expect_accept( "LISTEN" )
->remains_pending;
# TODO: This is fragile for buffer splitting
$controller->expect_syswrite( "CLIENT", <<'EOF' =~ s/\n/\x0D\x0A/gr
HTTP/1.1 200 OK
Content-Length: 15
Content-Type: text/plain
t/01responder.t view on Meta::CPAN
GET /B HTTP/1.1
EOF
$controller->expect_accept( "LISTEN" )
->remains_pending;
# TODO: This is fragile for buffer splitting
$controller->expect_syswrite( "CLIENT", <<'EOF' =~ s/\n/\x0D\x0A/gr
HTTP/1.1 200 OK
Content-Length: 16
Content-Type: text/plain
view all matches for this distribution
view release on metacpan or search on metacpan
- Add config_setting_is_scalar / is_aggregate / is_group / is_array / is_list / is_number.
- Add config_setting_name / parent / is_root / index.
- Add config_setting_source_line / source_file.
- Add CONFIG_FORMAT_* and CONFIG_OPTION_* constants.
- Fix: stray semicolon causing incorrect behavior in get_general_list and get_general_object.
- Optimize: replace fragile log()-based type detection with direct SV flag checks.
- Switch from Module::Install to ExtUtils::MakeMaker for simpler build.
- Suppress all compiler warnings.
- Add new tests: 15-options.t, 16-format.t, 17-setting-adv.t, 18-error.t, 19-safe.t.
Changes in this Release v1.0.3
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Config/Grammar.pm view on Meta::CPAN
{
my $line = shift;
my @items;
while ($line ne "") {
if ($line =~ s/^"((?:\\.|[^"])*)"\s*//) {
my $frag = $1;
$frag =~ s/\\(.)/$1/g;
push @items, $frag;
} elsif ($line =~ s/^'((?:\\.|[^'])*)'\s*//) {
my $frag = $1;
$frag =~ s/\\(.)/$1/g;
push @items, $frag;
}
elsif ($line =~ s/^((?:\\.|[^\s])*)(?:\s+|$)//) {
my $frag = $1;
$frag =~ s/\\(.)/$1/g;
push @items, $frag;
}
else {
die "Internal parser error for '$line'";
}
}
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Config/Interactive.pm view on Meta::CPAN
use warnings;
use 5.006_001;
=head1 NAME
Config::Interactive - config module with support for interpolation, XML fragments and interactive UI
=head1 VERSION
Version 0.04
lib/Config/Interactive.pm view on Meta::CPAN
which contains all options and it's associated values of your config file as well as comments above.
If the dialog mode is set then at the moment of parsing user will be prompted to enter different value and
if validation pattern for this particular key was defined then it will be validated and user could be asked to
enter different value if it failed.
The format of config files supported by L<Config::Interactive> is
C<< <name>=<value> >> pairs or XML fragments (by L<XML::Simple>, namespaces are not supported) and comments are any line which starts with #.
Comments inside of XML fragments will pop-up on top of the related fragment. It will interpolate any perl variable
which looks as C< ${?[A-Za-z]\w+}? >.
Please not that interpolation works for XML fragments as well, BUT interpolated varialbles MUST be defined
by C<key=value> definition and NOT inside of other XML fragment!
The order of appearance of such variables in the config file is not important, means you can use C<$bar> variable anywhere in the config file but
set it to something on the last line (or even skip setting it at all , then it will be undef).
It stores internally config file contents as hash ref where data structure is:
Please note that array ref is used to store XML text elements and scalar for attributes.
lib/Config/Interactive.pm view on Meta::CPAN
elsif ($xml_start) {
if (m/^\<\/\s*($xml_start)\s*\>/xsm) {
$xml_config .= $_;
my $xml_cf = XMLin( $xml_config, KeyAttr => {}, ForceArray => 1 );
$config{$xml_start}{value} = $self->_parseXML($xml_cf);
carp " Parsed XML fragment: " . Dumper $config{$xml_start}{value} if $self->{debug};
if ($comment) {
$config{$xml_start}{comment} = $comment;
$comment = '';
}
$config{$xml_start}{order} = $order++;
lib/Config/Interactive.pm view on Meta::CPAN
print( " Config data: \n" . Dumper $self->{data} ) if $self->{debug};
return $self->{data};
}
#
# interpolate all values, in case of XML fragments the name of the interpolated variable
# MUST be set by key=value definition and not by the element from other XML block
#
#
sub _interpolate {
my ( $self, $config, $scalars, $xml_root ) = @_;
my @keys = $xml_root ? keys %{ $config->{value} } : keys %{$config};
# interpolate all values
foreach my $key (@keys) {
### go for recursion in case of XML fragment
if ( !$xml_root ) {
$self->_interpolate( $config->{$key}, $config, $key )
if ref( $config->{$key}{value} ) eq 'HASH';
### interpolate if its simple key=value definition
my @sub_keys =
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Config/Manager/Conf.pm view on Meta::CPAN
zu ueberschreiben (koennte fuer den Test von Tools nuetzlich sein); OS, SCOPE,
HOME und WHOAMI sind auch mit set() nicht aenderbar.
Die Zeitangaben werden zum Zeitpunkt des Aufrufs der new()- bzw. der
init()-Methode gesetzt und aendern sich ab da nicht mehr; d.h. sie
werden bei aufeinanderfolgenden Abfragen NICHT mehr auf den jeweils
aktuellen Wert gesetzt. (Der Benutzer kann dies aber wie gesagt
ggfs. selbst, mit Hilfe der set()-Methode, tun.)
=back
view all matches for this distribution
view release on metacpan or search on metacpan
inc/Module/AutoInstall.pm view on Meta::CPAN
return 1;
}
sub postamble {
$PostambleUsed = 1;
my $fragment;
$fragment .= <<"AUTO_INSTALL" if !$InstallDepsTarget;
config :: installdeps
\t\$(NOECHO) \$(NOOP)
AUTO_INSTALL
$fragment .= <<"END_MAKE";
checkdeps ::
\t\$(PERL) $0 --checkdeps
installdeps ::
inc/Module/AutoInstall.pm view on Meta::CPAN
listalldeps ::
\t$PostambleActionsListAllDeps
END_MAKE
return $fragment;
}
1;
__END__
view all matches for this distribution
view release on metacpan or search on metacpan
contrib/parse-man.pl view on Meta::CPAN
}
my @moved = qw/FailureAction SuccessAction StartLimitBurst StartLimitInterval RebootArgument/;
my %move_target = qw/StartLimitInterval StartLimitIntervalSec/;
# check also src/core/load-fragment-gperf.gperf.m4 is systemd source
# for "compatibility" elements
foreach my $from (@moved) {
my $to = $move_target{$from} || $from;
move_deprecated_element($meta_root, $from, $to);
}
view all matches for this distribution