text stringlengths 2 1.04M | meta dict |
|---|---|
package com.jetbrains.python.psi.stubs;
import com.intellij.psi.stubs.NamedStub;
import com.jetbrains.python.psi.PyFunction;
public interface PyFunctionStub extends NamedStub<PyFunction> {
String getDocString();
String getDeprecationMessage();
} | {
"content_hash": "ec6b7fc7eb4acb46961e6d3a301f0b65",
"timestamp": "",
"source": "github",
"line_count": 10,
"max_line_length": 63,
"avg_line_length": 25.2,
"alnum_prop": 0.8095238095238095,
"repo_name": "IllusionRom-deprecated/android_platform_tools_idea",
"id": "666191bee3540509535150ae11d229251826539a",
"size": "852",
"binary": false,
"copies": "3",
"ref": "refs/heads/master",
"path": "python/psi-api/src/com/jetbrains/python/psi/stubs/PyFunctionStub.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "C",
"bytes": "177802"
},
{
"name": "C#",
"bytes": "390"
},
{
"name": "C++",
"bytes": "78894"
},
{
"name": "CSS",
"bytes": "102018"
},
{
"name": "Erlang",
"bytes": "10"
},
{
"name": "Groovy",
"bytes": "1906667"
},
{
"name": "J",
"bytes": "5050"
},
{
"name": "Java",
"bytes": "128322265"
},
{
"name": "JavaScript",
"bytes": "123045"
},
{
"name": "Objective-C",
"bytes": "22558"
},
{
"name": "Perl",
"bytes": "6549"
},
{
"name": "Python",
"bytes": "17760420"
},
{
"name": "Ruby",
"bytes": "1213"
},
{
"name": "Shell",
"bytes": "76554"
},
{
"name": "TeX",
"bytes": "60798"
},
{
"name": "XSLT",
"bytes": "113531"
}
],
"symlink_target": ""
} |
/* global jest, describe, beforeEach, it, expect, Event */
import React from 'react';
import ReactTestUtils from 'react-dom/test-utils';
import { Component as CompositeField } from '../CompositeField';
describe('CompositeField', () => {
let props = null;
beforeEach(() => {
props = {
data: {
tag: '',
legend: '',
},
extraClass: '',
};
});
describe('render()', () => {
it('renders its children', () => {
props.data.tag = 'div';
const field = ReactTestUtils.renderIntoDocument(
<CompositeField {...props}>
<input name="child1" />
<input name="child2" />
</CompositeField>
);
const findNodesByTag = ReactTestUtils.scryRenderedDOMComponentsWithTag;
expect(findNodesByTag(field, 'div').length).toBe(1);
expect(findNodesByTag(field, 'input').length).toBe(2);
});
});
describe('getLegend()', () => {
it('returns null when the legend is undefined', () => {
const result = ReactTestUtils.renderIntoDocument(
<CompositeField {...props} />
);
expect(result.getLegend()).toBeNull();
});
it('returns null when the tag is not a fieldset', () => {
props.data.tag = 'small';
const result = ReactTestUtils.renderIntoDocument(
<CompositeField {...props} />
);
expect(result.getLegend()).toBeNull();
});
it('returns a legend tag', () => {
props.data.tag = 'fieldset';
props.data.legend = 'You are a legend!';
const result = ReactTestUtils.renderIntoDocument(
<CompositeField {...props} />
);
expect(result.getLegend()).toEqual(
<legend>You are a legend!</legend>
);
});
});
describe('getClassName()', () => {
it('includes default class name and extra classes', () => {
props.className = 'default-class';
props.extraClass = 'extra-class';
const result = ReactTestUtils.renderIntoDocument(
<CompositeField {...props} />
);
expect(result.getClassName()).toContain('default-class');
expect(result.getClassName()).toContain('extra-class');
});
});
});
| {
"content_hash": "bb89a792a594442701654636cc5806b9",
"timestamp": "",
"source": "github",
"line_count": 83,
"max_line_length": 77,
"avg_line_length": 26.156626506024097,
"alnum_prop": 0.5785352372178719,
"repo_name": "silverstripe/silverstripe-admin",
"id": "463c1504574a80a88a838b44b9a93d37ae7d2eac",
"size": "2171",
"binary": false,
"copies": "1",
"ref": "refs/heads/1",
"path": "client/src/components/CompositeField/tests/CompositeField-test.js",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "CSS",
"bytes": "13974"
},
{
"name": "Gherkin",
"bytes": "43569"
},
{
"name": "HTML",
"bytes": "78421"
},
{
"name": "JavaScript",
"bytes": "1167612"
},
{
"name": "PHP",
"bytes": "252775"
},
{
"name": "SCSS",
"bytes": "241023"
},
{
"name": "Scheme",
"bytes": "32183"
}
],
"symlink_target": ""
} |
// Released under MIT license
// Copyright (c) 2009-2010 Dominic Baggott
// Copyright (c) 2009-2010 Ash Berlin
// Copyright (c) 2011 Christoph Dorn <christoph@christophdorn.com> (http://www.christophdorn.com)
// Date: 2013-09-15T16:12Z
(function(expose) {
var MarkdownHelpers = {};
// For Spidermonkey based engines
function mk_block_toSource() {
return "Markdown.mk_block( " +
uneval(this.toString()) +
", " +
uneval(this.trailing) +
", " +
uneval(this.lineNumber) +
" )";
}
// node
function mk_block_inspect() {
var util = require("util");
return "Markdown.mk_block( " +
util.inspect(this.toString()) +
", " +
util.inspect(this.trailing) +
", " +
util.inspect(this.lineNumber) +
" )";
}
MarkdownHelpers.mk_block = function(block, trail, line) {
// Be helpful for default case in tests.
if ( arguments.length === 1 )
trail = "\n\n";
// We actually need a String object, not a string primitive
/* jshint -W053 */
var s = new String(block);
s.trailing = trail;
// To make it clear its not just a string
s.inspect = mk_block_inspect;
s.toSource = mk_block_toSource;
if ( line !== undefined )
s.lineNumber = line;
return s;
};
var isArray = MarkdownHelpers.isArray = Array.isArray || function(obj) {
return Object.prototype.toString.call(obj) === "[object Array]";
};
// Don't mess with Array.prototype. Its not friendly
if ( Array.prototype.forEach ) {
MarkdownHelpers.forEach = function forEach( arr, cb, thisp ) {
return arr.forEach( cb, thisp );
};
}
else {
MarkdownHelpers.forEach = function forEach(arr, cb, thisp) {
for (var i = 0; i < arr.length; i++)
cb.call(thisp || arr, arr[i], i, arr);
};
}
MarkdownHelpers.isEmpty = function isEmpty( obj ) {
for ( var key in obj ) {
if ( hasOwnProperty.call( obj, key ) )
return false;
}
return true;
};
MarkdownHelpers.extract_attr = function extract_attr( jsonml ) {
return isArray(jsonml)
&& jsonml.length > 1
&& typeof jsonml[ 1 ] === "object"
&& !( isArray(jsonml[ 1 ]) )
? jsonml[ 1 ]
: undefined;
};
/**
* class Markdown
*
* Markdown processing in Javascript done right. We have very particular views
* on what constitutes 'right' which include:
*
* - produces well-formed HTML (this means that em and strong nesting is
* important)
*
* - has an intermediate representation to allow processing of parsed data (We
* in fact have two, both as [JsonML]: a markdown tree and an HTML tree).
*
* - is easily extensible to add new dialects without having to rewrite the
* entire parsing mechanics
*
* - has a good test suite
*
* This implementation fulfills all of these (except that the test suite could
* do with expanding to automatically run all the fixtures from other Markdown
* implementations.)
*
* ##### Intermediate Representation
*
* *TODO* Talk about this :) Its JsonML, but document the node names we use.
*
* [JsonML]: http://jsonml.org/ "JSON Markup Language"
**/
var Markdown = function(dialect) {
switch (typeof dialect) {
case "undefined":
this.dialect = Markdown.dialects.Gruber;
break;
case "object":
this.dialect = dialect;
break;
default:
if ( dialect in Markdown.dialects )
this.dialect = Markdown.dialects[dialect];
else
throw new Error("Unknown Markdown dialect '" + String(dialect) + "'");
break;
}
this.em_state = [];
this.strong_state = [];
this.debug_indent = "";
};
/**
* Markdown.dialects
*
* Namespace of built-in dialects.
**/
Markdown.dialects = {};
// Imported functions
var mk_block = Markdown.mk_block = MarkdownHelpers.mk_block,
isArray = MarkdownHelpers.isArray;
/**
* parse( markdown, [dialect] ) -> JsonML
* - markdown (String): markdown string to parse
* - dialect (String | Dialect): the dialect to use, defaults to gruber
*
* Parse `markdown` and return a markdown document as a Markdown.JsonML tree.
**/
Markdown.parse = function( source, dialect ) {
// dialect will default if undefined
var md = new Markdown( dialect );
return md.toTree( source );
};
function count_lines( str ) {
var n = 0,
i = -1;
while ( ( i = str.indexOf("\n", i + 1) ) !== -1 )
n++;
return n;
}
// Internal - split source into rough blocks
Markdown.prototype.split_blocks = function splitBlocks( input ) {
input = input.replace(/(\r\n|\n|\r)/g, "\n");
// [\s\S] matches _anything_ (newline or space)
// [^] is equivalent but doesn't work in IEs.
var re = /([\s\S]+?)($|\n#|\n(?:\s*\n|$)+)/g,
blocks = [],
m;
var line_no = 1;
if ( ( m = /^(\s*\n)/.exec(input) ) !== null ) {
// skip (but count) leading blank lines
line_no += count_lines( m[0] );
re.lastIndex = m[0].length;
}
while ( ( m = re.exec(input) ) !== null ) {
if (m[2] === "\n#") {
m[2] = "\n";
re.lastIndex--;
}
blocks.push( mk_block( m[1], m[2], line_no ) );
line_no += count_lines( m[0] );
}
return blocks;
};
/**
* Markdown#processBlock( block, next ) -> undefined | [ JsonML, ... ]
* - block (String): the block to process
* - next (Array): the following blocks
*
* Process `block` and return an array of JsonML nodes representing `block`.
*
* It does this by asking each block level function in the dialect to process
* the block until one can. Succesful handling is indicated by returning an
* array (with zero or more JsonML nodes), failure by a false value.
*
* Blocks handlers are responsible for calling [[Markdown#processInline]]
* themselves as appropriate.
*
* If the blocks were split incorrectly or adjacent blocks need collapsing you
* can adjust `next` in place using shift/splice etc.
*
* If any of this default behaviour is not right for the dialect, you can
* define a `__call__` method on the dialect that will get invoked to handle
* the block processing.
*/
Markdown.prototype.processBlock = function processBlock( block, next ) {
var cbs = this.dialect.block,
ord = cbs.__order__;
if ( "__call__" in cbs )
return cbs.__call__.call(this, block, next);
for ( var i = 0; i < ord.length; i++ ) {
//D:this.debug( "Testing", ord[i] );
var res = cbs[ ord[i] ].call( this, block, next );
if ( res ) {
//D:this.debug(" matched");
if ( !isArray(res) || ( res.length > 0 && !( isArray(res[0]) ) ) )
this.debug(ord[i], "didn't return a proper array");
//D:this.debug( "" );
return res;
}
}
// Uhoh! no match! Should we throw an error?
return [];
};
Markdown.prototype.processInline = function processInline( block ) {
return this.dialect.inline.__call__.call( this, String( block ) );
};
/**
* Markdown#toTree( source ) -> JsonML
* - source (String): markdown source to parse
*
* Parse `source` into a JsonML tree representing the markdown document.
**/
// custom_tree means set this.tree to `custom_tree` and restore old value on return
Markdown.prototype.toTree = function toTree( source, custom_root ) {
var blocks = source instanceof Array ? source : this.split_blocks( source );
// Make tree a member variable so its easier to mess with in extensions
var old_tree = this.tree;
try {
this.tree = custom_root || this.tree || [ "markdown" ];
blocks_loop:
while ( blocks.length ) {
var b = this.processBlock( blocks.shift(), blocks );
// Reference blocks and the like won't return any content
if ( !b.length )
continue blocks_loop;
this.tree.push.apply( this.tree, b );
}
return this.tree;
}
finally {
if ( custom_root )
this.tree = old_tree;
}
};
// Noop by default
Markdown.prototype.debug = function () {
var args = Array.prototype.slice.call( arguments);
args.unshift(this.debug_indent);
if ( typeof print !== "undefined" )
print.apply( print, args );
if ( typeof console !== "undefined" && typeof console.log !== "undefined" )
console.log.apply( null, args );
};
Markdown.prototype.loop_re_over_block = function( re, block, cb ) {
// Dont use /g regexps with this
var m,
b = block.valueOf();
while ( b.length && (m = re.exec(b) ) !== null ) {
b = b.substr( m[0].length );
cb.call(this, m);
}
return b;
};
// Build default order from insertion order.
Markdown.buildBlockOrder = function(d) {
var ord = [];
for ( var i in d ) {
if ( i === "__order__" || i === "__call__" )
continue;
ord.push( i );
}
d.__order__ = ord;
};
// Build patterns for inline matcher
Markdown.buildInlinePatterns = function(d) {
var patterns = [];
for ( var i in d ) {
// __foo__ is reserved and not a pattern
if ( i.match( /^__.*__$/) )
continue;
var l = i.replace( /([\\.*+?|()\[\]{}])/g, "\\$1" )
.replace( /\n/, "\\n" );
patterns.push( i.length === 1 ? l : "(?:" + l + ")" );
}
patterns = patterns.join("|");
d.__patterns__ = patterns;
//print("patterns:", uneval( patterns ) );
var fn = d.__call__;
d.__call__ = function(text, pattern) {
if ( pattern !== undefined )
return fn.call(this, text, pattern);
else
return fn.call(this, text, patterns);
};
};
var extract_attr = MarkdownHelpers.extract_attr;
/**
* renderJsonML( jsonml[, options] ) -> String
* - jsonml (Array): JsonML array to render to XML
* - options (Object): options
*
* Converts the given JsonML into well-formed XML.
*
* The options currently understood are:
*
* - root (Boolean): wether or not the root node should be included in the
* output, or just its children. The default `false` is to not include the
* root itself.
*/
Markdown.renderJsonML = function( jsonml, options ) {
options = options || {};
// include the root element in the rendered output?
options.root = options.root || false;
var content = [];
if ( options.root ) {
content.push( render_tree( jsonml ) );
}
else {
jsonml.shift(); // get rid of the tag
if ( jsonml.length && typeof jsonml[ 0 ] === "object" && !( jsonml[ 0 ] instanceof Array ) )
jsonml.shift(); // get rid of the attributes
while ( jsonml.length )
content.push( render_tree( jsonml.shift() ) );
}
return content.join( "\n\n" );
};
/**
* toHTMLTree( markdown, [dialect] ) -> JsonML
* toHTMLTree( md_tree ) -> JsonML
* - markdown (String): markdown string to parse
* - dialect (String | Dialect): the dialect to use, defaults to gruber
* - md_tree (Markdown.JsonML): parsed markdown tree
*
* Turn markdown into HTML, represented as a JsonML tree. If a string is given
* to this function, it is first parsed into a markdown tree by calling
* [[parse]].
**/
Markdown.toHTMLTree = function toHTMLTree( input, dialect , options ) {
// convert string input to an MD tree
if ( typeof input === "string" )
input = this.parse( input, dialect );
// Now convert the MD tree to an HTML tree
// remove references from the tree
var attrs = extract_attr( input ),
refs = {};
if ( attrs && attrs.references )
refs = attrs.references;
var html = convert_tree_to_html( input, refs , options );
merge_text_nodes( html );
return html;
};
/**
* toHTML( markdown, [dialect] ) -> String
* toHTML( md_tree ) -> String
* - markdown (String): markdown string to parse
* - md_tree (Markdown.JsonML): parsed markdown tree
*
* Take markdown (either as a string or as a JsonML tree) and run it through
* [[toHTMLTree]] then turn it into a well-formated HTML fragment.
**/
Markdown.toHTML = function toHTML( source , dialect , options ) {
var input = this.toHTMLTree( source , dialect , options );
return this.renderJsonML( input );
};
function escapeHTML( text ) {
return text.replace( /&/g, "&" )
.replace( /</g, "<" )
.replace( />/g, ">" )
.replace( /"/g, """ )
.replace( /'/g, "'" );
}
function render_tree( jsonml ) {
// basic case
if ( typeof jsonml === "string" )
return escapeHTML( jsonml );
var tag = jsonml.shift(),
attributes = {},
content = [];
if ( jsonml.length && typeof jsonml[ 0 ] === "object" && !( jsonml[ 0 ] instanceof Array ) )
attributes = jsonml.shift();
while ( jsonml.length )
content.push( render_tree( jsonml.shift() ) );
var tag_attrs = "";
for ( var a in attributes )
tag_attrs += " " + a + '="' + escapeHTML( attributes[ a ] ) + '"';
// be careful about adding whitespace here for inline elements
if ( tag === "img" || tag === "br" || tag === "hr" )
return "<"+ tag + tag_attrs + "/>";
else
return "<"+ tag + tag_attrs + ">" + content.join( "" ) + "</" + tag + ">";
}
function convert_tree_to_html( tree, references, options ) {
var i;
options = options || {};
// shallow clone
var jsonml = tree.slice( 0 );
if ( typeof options.preprocessTreeNode === "function" )
jsonml = options.preprocessTreeNode(jsonml, references);
// Clone attributes if they exist
var attrs = extract_attr( jsonml );
if ( attrs ) {
jsonml[ 1 ] = {};
for ( i in attrs ) {
jsonml[ 1 ][ i ] = attrs[ i ];
}
attrs = jsonml[ 1 ];
}
// basic case
if ( typeof jsonml === "string" )
return jsonml;
// convert this node
switch ( jsonml[ 0 ] ) {
case "header":
jsonml[ 0 ] = "h" + jsonml[ 1 ].level;
delete jsonml[ 1 ].level;
break;
case "bulletlist":
jsonml[ 0 ] = "ul";
break;
case "numberlist":
jsonml[ 0 ] = "ol";
break;
case "listitem":
jsonml[ 0 ] = "li";
break;
case "para":
jsonml[ 0 ] = "p";
break;
case "markdown":
jsonml[ 0 ] = "html";
if ( attrs )
delete attrs.references;
break;
case "code_block":
jsonml[ 0 ] = "pre";
i = attrs ? 2 : 1;
var code = [ "code" ];
code.push.apply( code, jsonml.splice( i, jsonml.length - i ) );
jsonml[ i ] = code;
break;
case "inlinecode":
jsonml[ 0 ] = "code";
break;
case "img":
jsonml[ 1 ].src = jsonml[ 1 ].href;
delete jsonml[ 1 ].href;
break;
case "linebreak":
jsonml[ 0 ] = "br";
break;
case "link":
jsonml[ 0 ] = "a";
break;
case "link_ref":
jsonml[ 0 ] = "a";
// grab this ref and clean up the attribute node
var ref = references[ attrs.ref ];
// if the reference exists, make the link
if ( ref ) {
delete attrs.ref;
// add in the href and title, if present
attrs.href = ref.href;
if ( ref.title )
attrs.title = ref.title;
// get rid of the unneeded original text
delete attrs.original;
}
// the reference doesn't exist, so revert to plain text
else {
return attrs.original;
}
break;
case "img_ref":
jsonml[ 0 ] = "img";
// grab this ref and clean up the attribute node
var ref = references[ attrs.ref ];
// if the reference exists, make the link
if ( ref ) {
delete attrs.ref;
// add in the href and title, if present
attrs.src = ref.href;
if ( ref.title )
attrs.title = ref.title;
// get rid of the unneeded original text
delete attrs.original;
}
// the reference doesn't exist, so revert to plain text
else {
return attrs.original;
}
break;
}
// convert all the children
i = 1;
// deal with the attribute node, if it exists
if ( attrs ) {
// if there are keys, skip over it
for ( var key in jsonml[ 1 ] ) {
i = 2;
break;
}
// if there aren't, remove it
if ( i === 1 )
jsonml.splice( i, 1 );
}
for ( ; i < jsonml.length; ++i ) {
jsonml[ i ] = convert_tree_to_html( jsonml[ i ], references, options );
}
return jsonml;
}
// merges adjacent text nodes into a single node
function merge_text_nodes( jsonml ) {
// skip the tag name and attribute hash
var i = extract_attr( jsonml ) ? 2 : 1;
while ( i < jsonml.length ) {
// if it's a string check the next item too
if ( typeof jsonml[ i ] === "string" ) {
if ( i + 1 < jsonml.length && typeof jsonml[ i + 1 ] === "string" ) {
// merge the second string into the first and remove it
jsonml[ i ] += jsonml.splice( i + 1, 1 )[ 0 ];
}
else {
++i;
}
}
// if it's not a string recurse
else {
merge_text_nodes( jsonml[ i ] );
++i;
}
}
};
var DialectHelpers = {};
DialectHelpers.inline_until_char = function( text, want ) {
var consumed = 0,
nodes = [];
while ( true ) {
if ( text.charAt( consumed ) === want ) {
// Found the character we were looking for
consumed++;
return [ consumed, nodes ];
}
if ( consumed >= text.length ) {
// No closing char found. Abort.
return null;
}
var res = this.dialect.inline.__oneElement__.call(this, text.substr( consumed ) );
consumed += res[ 0 ];
// Add any returned nodes.
nodes.push.apply( nodes, res.slice( 1 ) );
}
};
// Helper function to make sub-classing a dialect easier
DialectHelpers.subclassDialect = function( d ) {
function Block() {}
Block.prototype = d.block;
function Inline() {}
Inline.prototype = d.inline;
return { block: new Block(), inline: new Inline() };
};
var forEach = MarkdownHelpers.forEach,
extract_attr = MarkdownHelpers.extract_attr,
mk_block = MarkdownHelpers.mk_block,
isEmpty = MarkdownHelpers.isEmpty,
inline_until_char = DialectHelpers.inline_until_char;
/**
* Gruber dialect
*
* The default dialect that follows the rules set out by John Gruber's
* markdown.pl as closely as possible. Well actually we follow the behaviour of
* that script which in some places is not exactly what the syntax web page
* says.
**/
var Gruber = {
block: {
atxHeader: function atxHeader( block, next ) {
var m = block.match( /^(#{1,6})\s*(.*?)\s*#*\s*(?:\n|$)/ );
if ( !m )
return undefined;
var header = [ "header", { level: m[ 1 ].length } ];
Array.prototype.push.apply(header, this.processInline(m[ 2 ]));
if ( m[0].length < block.length )
next.unshift( mk_block( block.substr( m[0].length ), block.trailing, block.lineNumber + 2 ) );
return [ header ];
},
setextHeader: function setextHeader( block, next ) {
var m = block.match( /^(.*)\n([-=])\2\2+(?:\n|$)/ );
if ( !m )
return undefined;
var level = ( m[ 2 ] === "=" ) ? 1 : 2,
header = [ "header", { level : level }, m[ 1 ] ];
if ( m[0].length < block.length )
next.unshift( mk_block( block.substr( m[0].length ), block.trailing, block.lineNumber + 2 ) );
return [ header ];
},
code: function code( block, next ) {
// | Foo
// |bar
// should be a code block followed by a paragraph. Fun
//
// There might also be adjacent code block to merge.
var ret = [],
re = /^(?: {0,3}\t| {4})(.*)\n?/;
// 4 spaces + content
if ( !block.match( re ) )
return undefined;
block_search:
do {
// Now pull out the rest of the lines
var b = this.loop_re_over_block(
re, block.valueOf(), function( m ) { ret.push( m[1] ); } );
if ( b.length ) {
// Case alluded to in first comment. push it back on as a new block
next.unshift( mk_block(b, block.trailing) );
break block_search;
}
else if ( next.length ) {
// Check the next block - it might be code too
if ( !next[0].match( re ) )
break block_search;
// Pull how how many blanks lines follow - minus two to account for .join
ret.push ( block.trailing.replace(/[^\n]/g, "").substring(2) );
block = next.shift();
}
else {
break block_search;
}
} while ( true );
return [ [ "code_block", ret.join("\n") ] ];
},
horizRule: function horizRule( block, next ) {
// this needs to find any hr in the block to handle abutting blocks
var m = block.match( /^(?:([\s\S]*?)\n)?[ \t]*([-_*])(?:[ \t]*\2){2,}[ \t]*(?:\n([\s\S]*))?$/ );
if ( !m )
return undefined;
var jsonml = [ [ "hr" ] ];
// if there's a leading abutting block, process it
if ( m[ 1 ] ) {
var contained = mk_block( m[ 1 ], "", block.lineNumber );
jsonml.unshift.apply( jsonml, this.toTree( contained, [] ) );
}
// if there's a trailing abutting block, stick it into next
if ( m[ 3 ] )
next.unshift( mk_block( m[ 3 ], block.trailing, block.lineNumber + 1 ) );
return jsonml;
},
// There are two types of lists. Tight and loose. Tight lists have no whitespace
// between the items (and result in text just in the <li>) and loose lists,
// which have an empty line between list items, resulting in (one or more)
// paragraphs inside the <li>.
//
// There are all sorts weird edge cases about the original markdown.pl's
// handling of lists:
//
// * Nested lists are supposed to be indented by four chars per level. But
// if they aren't, you can get a nested list by indenting by less than
// four so long as the indent doesn't match an indent of an existing list
// item in the 'nest stack'.
//
// * The type of the list (bullet or number) is controlled just by the
// first item at the indent. Subsequent changes are ignored unless they
// are for nested lists
//
lists: (function( ) {
// Use a closure to hide a few variables.
var any_list = "[*+-]|\\d+\\.",
bullet_list = /[*+-]/,
// Capture leading indent as it matters for determining nested lists.
is_list_re = new RegExp( "^( {0,3})(" + any_list + ")[ \t]+" ),
indent_re = "(?: {0,3}\\t| {4})";
// TODO: Cache this regexp for certain depths.
// Create a regexp suitable for matching an li for a given stack depth
function regex_for_depth( depth ) {
return new RegExp(
// m[1] = indent, m[2] = list_type
"(?:^(" + indent_re + "{0," + depth + "} {0,3})(" + any_list + ")\\s+)|" +
// m[3] = cont
"(^" + indent_re + "{0," + (depth-1) + "}[ ]{0,4})"
);
}
function expand_tab( input ) {
return input.replace( / {0,3}\t/g, " " );
}
// Add inline content `inline` to `li`. inline comes from processInline
// so is an array of content
function add(li, loose, inline, nl) {
if ( loose ) {
li.push( [ "para" ].concat(inline) );
return;
}
// Hmmm, should this be any block level element or just paras?
var add_to = li[li.length -1] instanceof Array && li[li.length - 1][0] === "para"
? li[li.length -1]
: li;
// If there is already some content in this list, add the new line in
if ( nl && li.length > 1 )
inline.unshift(nl);
for ( var i = 0; i < inline.length; i++ ) {
var what = inline[i],
is_str = typeof what === "string";
if ( is_str && add_to.length > 1 && typeof add_to[add_to.length-1] === "string" )
add_to[ add_to.length-1 ] += what;
else
add_to.push( what );
}
}
// contained means have an indent greater than the current one. On
// *every* line in the block
function get_contained_blocks( depth, blocks ) {
var re = new RegExp( "^(" + indent_re + "{" + depth + "}.*?\\n?)*$" ),
replace = new RegExp("^" + indent_re + "{" + depth + "}", "gm"),
ret = [];
while ( blocks.length > 0 ) {
if ( re.exec( blocks[0] ) ) {
var b = blocks.shift(),
// Now remove that indent
x = b.replace( replace, "");
ret.push( mk_block( x, b.trailing, b.lineNumber ) );
}
else
break;
}
return ret;
}
// passed to stack.forEach to turn list items up the stack into paras
function paragraphify(s, i, stack) {
var list = s.list;
var last_li = list[list.length-1];
if ( last_li[1] instanceof Array && last_li[1][0] === "para" )
return;
if ( i + 1 === stack.length ) {
// Last stack frame
// Keep the same array, but replace the contents
last_li.push( ["para"].concat( last_li.splice(1, last_li.length - 1) ) );
}
else {
var sublist = last_li.pop();
last_li.push( ["para"].concat( last_li.splice(1, last_li.length - 1) ), sublist );
}
}
// The matcher function
return function( block, next ) {
var m = block.match( is_list_re );
if ( !m )
return undefined;
function make_list( m ) {
var list = bullet_list.exec( m[2] )
? ["bulletlist"]
: ["numberlist"];
stack.push( { list: list, indent: m[1] } );
return list;
}
var stack = [], // Stack of lists for nesting.
list = make_list( m ),
last_li,
loose = false,
ret = [ stack[0].list ],
i;
// Loop to search over block looking for inner block elements and loose lists
loose_search:
while ( true ) {
// Split into lines preserving new lines at end of line
var lines = block.split( /(?=\n)/ );
// We have to grab all lines for a li and call processInline on them
// once as there are some inline things that can span lines.
var li_accumulate = "", nl = "";
// Loop over the lines in this block looking for tight lists.
tight_search:
for ( var line_no = 0; line_no < lines.length; line_no++ ) {
nl = "";
var l = lines[line_no].replace(/^\n/, function(n) { nl = n; return ""; });
// TODO: really should cache this
var line_re = regex_for_depth( stack.length );
m = l.match( line_re );
//print( "line:", uneval(l), "\nline match:", uneval(m) );
// We have a list item
if ( m[1] !== undefined ) {
// Process the previous list item, if any
if ( li_accumulate.length ) {
add( last_li, loose, this.processInline( li_accumulate ), nl );
// Loose mode will have been dealt with. Reset it
loose = false;
li_accumulate = "";
}
m[1] = expand_tab( m[1] );
var wanted_depth = Math.floor(m[1].length/4)+1;
//print( "want:", wanted_depth, "stack:", stack.length);
if ( wanted_depth > stack.length ) {
// Deep enough for a nested list outright
//print ( "new nested list" );
list = make_list( m );
last_li.push( list );
last_li = list[1] = [ "listitem" ];
}
else {
// We aren't deep enough to be strictly a new level. This is
// where Md.pl goes nuts. If the indent matches a level in the
// stack, put it there, else put it one deeper then the
// wanted_depth deserves.
var found = false;
for ( i = 0; i < stack.length; i++ ) {
if ( stack[ i ].indent !== m[1] )
continue;
list = stack[ i ].list;
stack.splice( i+1, stack.length - (i+1) );
found = true;
break;
}
if (!found) {
//print("not found. l:", uneval(l));
wanted_depth++;
if ( wanted_depth <= stack.length ) {
stack.splice(wanted_depth, stack.length - wanted_depth);
//print("Desired depth now", wanted_depth, "stack:", stack.length);
list = stack[wanted_depth-1].list;
//print("list:", uneval(list) );
}
else {
//print ("made new stack for messy indent");
list = make_list(m);
last_li.push(list);
}
}
//print( uneval(list), "last", list === stack[stack.length-1].list );
last_li = [ "listitem" ];
list.push(last_li);
} // end depth of shenegains
nl = "";
}
// Add content
if ( l.length > m[0].length )
li_accumulate += nl + l.substr( m[0].length );
} // tight_search
if ( li_accumulate.length ) {
add( last_li, loose, this.processInline( li_accumulate ), nl );
// Loose mode will have been dealt with. Reset it
loose = false;
li_accumulate = "";
}
// Look at the next block - we might have a loose list. Or an extra
// paragraph for the current li
var contained = get_contained_blocks( stack.length, next );
// Deal with code blocks or properly nested lists
if ( contained.length > 0 ) {
// Make sure all listitems up the stack are paragraphs
forEach( stack, paragraphify, this);
last_li.push.apply( last_li, this.toTree( contained, [] ) );
}
var next_block = next[0] && next[0].valueOf() || "";
if ( next_block.match(is_list_re) || next_block.match( /^ / ) ) {
block = next.shift();
// Check for an HR following a list: features/lists/hr_abutting
var hr = this.dialect.block.horizRule( block, next );
if ( hr ) {
ret.push.apply(ret, hr);
break;
}
// Make sure all listitems up the stack are paragraphs
forEach( stack, paragraphify, this);
loose = true;
continue loose_search;
}
break;
} // loose_search
return ret;
};
})(),
blockquote: function blockquote( block, next ) {
if ( !block.match( /^>/m ) )
return undefined;
var jsonml = [];
// separate out the leading abutting block, if any. I.e. in this case:
//
// a
// > b
//
if ( block[ 0 ] !== ">" ) {
var lines = block.split( /\n/ ),
prev = [],
line_no = block.lineNumber;
// keep shifting lines until you find a crotchet
while ( lines.length && lines[ 0 ][ 0 ] !== ">" ) {
prev.push( lines.shift() );
line_no++;
}
var abutting = mk_block( prev.join( "\n" ), "\n", block.lineNumber );
jsonml.push.apply( jsonml, this.processBlock( abutting, [] ) );
// reassemble new block of just block quotes!
block = mk_block( lines.join( "\n" ), block.trailing, line_no );
}
// if the next block is also a blockquote merge it in
while ( next.length && next[ 0 ][ 0 ] === ">" ) {
var b = next.shift();
block = mk_block( block + block.trailing + b, b.trailing, block.lineNumber );
}
// Strip off the leading "> " and re-process as a block.
var input = block.replace( /^> ?/gm, "" ),
old_tree = this.tree,
processedBlock = this.toTree( input, [ "blockquote" ] ),
attr = extract_attr( processedBlock );
// If any link references were found get rid of them
if ( attr && attr.references ) {
delete attr.references;
// And then remove the attribute object if it's empty
if ( isEmpty( attr ) )
processedBlock.splice( 1, 1 );
}
jsonml.push( processedBlock );
return jsonml;
},
referenceDefn: function referenceDefn( block, next) {
var re = /^\s*\[(.*?)\]:\s*(\S+)(?:\s+(?:(['"])(.*?)\3|\((.*?)\)))?\n?/;
// interesting matches are [ , ref_id, url, , title, title ]
if ( !block.match(re) )
return undefined;
// make an attribute node if it doesn't exist
if ( !extract_attr( this.tree ) )
this.tree.splice( 1, 0, {} );
var attrs = extract_attr( this.tree );
// make a references hash if it doesn't exist
if ( attrs.references === undefined )
attrs.references = {};
var b = this.loop_re_over_block(re, block, function( m ) {
if ( m[2] && m[2][0] === "<" && m[2][m[2].length-1] === ">" )
m[2] = m[2].substring( 1, m[2].length - 1 );
var ref = attrs.references[ m[1].toLowerCase() ] = {
href: m[2]
};
if ( m[4] !== undefined )
ref.title = m[4];
else if ( m[5] !== undefined )
ref.title = m[5];
} );
if ( b.length )
next.unshift( mk_block( b, block.trailing ) );
return [];
},
para: function para( block ) {
// everything's a para!
return [ ["para"].concat( this.processInline( block ) ) ];
}
},
inline: {
__oneElement__: function oneElement( text, patterns_or_re, previous_nodes ) {
var m,
res;
patterns_or_re = patterns_or_re || this.dialect.inline.__patterns__;
var re = new RegExp( "([\\s\\S]*?)(" + (patterns_or_re.source || patterns_or_re) + ")" );
m = re.exec( text );
if (!m) {
// Just boring text
return [ text.length, text ];
}
else if ( m[1] ) {
// Some un-interesting text matched. Return that first
return [ m[1].length, m[1] ];
}
var res;
if ( m[2] in this.dialect.inline ) {
res = this.dialect.inline[ m[2] ].call(
this,
text.substr( m.index ), m, previous_nodes || [] );
}
// Default for now to make dev easier. just slurp special and output it.
res = res || [ m[2].length, m[2] ];
return res;
},
__call__: function inline( text, patterns ) {
var out = [],
res;
function add(x) {
//D:self.debug(" adding output", uneval(x));
if ( typeof x === "string" && typeof out[out.length-1] === "string" )
out[ out.length-1 ] += x;
else
out.push(x);
}
while ( text.length > 0 ) {
res = this.dialect.inline.__oneElement__.call(this, text, patterns, out );
text = text.substr( res.shift() );
forEach(res, add );
}
return out;
},
// These characters are intersting elsewhere, so have rules for them so that
// chunks of plain text blocks don't include them
"]": function () {},
"}": function () {},
__escape__ : /^\\[\\`\*_{}\[\]()#\+.!\-]/,
"\\": function escaped( text ) {
// [ length of input processed, node/children to add... ]
// Only esacape: \ ` * _ { } [ ] ( ) # * + - . !
if ( this.dialect.inline.__escape__.exec( text ) )
return [ 2, text.charAt( 1 ) ];
else
// Not an esacpe
return [ 1, "\\" ];
},
"
// 1 2 3 4 <--- captures
var m = text.match( /^!\[(.*?)\][ \t]*\([ \t]*([^")]*?)(?:[ \t]+(["'])(.*?)\3)?[ \t]*\)/ );
if ( m ) {
if ( m[2] && m[2][0] === "<" && m[2][m[2].length-1] === ">" )
m[2] = m[2].substring( 1, m[2].length - 1 );
m[2] = this.dialect.inline.__call__.call( this, m[2], /\\/ )[0];
var attrs = { alt: m[1], href: m[2] || "" };
if ( m[4] !== undefined)
attrs.title = m[4];
return [ m[0].length, [ "img", attrs ] ];
}
// ![Alt text][id]
m = text.match( /^!\[(.*?)\][ \t]*\[(.*?)\]/ );
if ( m ) {
// We can't check if the reference is known here as it likely wont be
// found till after. Check it in md tree->hmtl tree conversion
return [ m[0].length, [ "img_ref", { alt: m[1], ref: m[2].toLowerCase(), original: m[0] } ] ];
}
// Just consume the '!['
return [ 2, "![" ];
},
"[": function link( text ) {
var orig = String(text);
// Inline content is possible inside `link text`
var res = inline_until_char.call( this, text.substr(1), "]" );
// No closing ']' found. Just consume the [
if ( !res )
return [ 1, "[" ];
var consumed = 1 + res[ 0 ],
children = res[ 1 ],
link,
attrs;
// At this point the first [...] has been parsed. See what follows to find
// out which kind of link we are (reference or direct url)
text = text.substr( consumed );
// [link text](/path/to/img.jpg "Optional title")
// 1 2 3 <--- captures
// This will capture up to the last paren in the block. We then pull
// back based on if there a matching ones in the url
// ([here](/url/(test))
// The parens have to be balanced
var m = text.match( /^\s*\([ \t]*([^"']*)(?:[ \t]+(["'])(.*?)\2)?[ \t]*\)/ );
if ( m ) {
var url = m[1];
consumed += m[0].length;
if ( url && url[0] === "<" && url[url.length-1] === ">" )
url = url.substring( 1, url.length - 1 );
// If there is a title we don't have to worry about parens in the url
if ( !m[3] ) {
var open_parens = 1; // One open that isn't in the capture
for ( var len = 0; len < url.length; len++ ) {
switch ( url[len] ) {
case "(":
open_parens++;
break;
case ")":
if ( --open_parens === 0) {
consumed -= url.length - len;
url = url.substring(0, len);
}
break;
}
}
}
// Process escapes only
url = this.dialect.inline.__call__.call( this, url, /\\/ )[0];
attrs = { href: url || "" };
if ( m[3] !== undefined)
attrs.title = m[3];
link = [ "link", attrs ].concat( children );
return [ consumed, link ];
}
// [Alt text][id]
// [Alt text] [id]
m = text.match( /^\s*\[(.*?)\]/ );
if ( m ) {
consumed += m[ 0 ].length;
// [links][] uses links as its reference
attrs = { ref: ( m[ 1 ] || String(children) ).toLowerCase(), original: orig.substr( 0, consumed ) };
link = [ "link_ref", attrs ].concat( children );
// We can't check if the reference is known here as it likely wont be
// found till after. Check it in md tree->hmtl tree conversion.
// Store the original so that conversion can revert if the ref isn't found.
return [ consumed, link ];
}
// [id]
// Only if id is plain (no formatting.)
if ( children.length === 1 && typeof children[0] === "string" ) {
attrs = { ref: children[0].toLowerCase(), original: orig.substr( 0, consumed ) };
link = [ "link_ref", attrs, children[0] ];
return [ consumed, link ];
}
// Just consume the "["
return [ 1, "[" ];
},
"<": function autoLink( text ) {
var m;
if ( ( m = text.match( /^<(?:((https?|ftp|mailto):[^>]+)|(.*?@.*?\.[a-zA-Z]+))>/ ) ) !== null ) {
if ( m[3] )
return [ m[0].length, [ "link", { href: "mailto:" + m[3] }, m[3] ] ];
else if ( m[2] === "mailto" )
return [ m[0].length, [ "link", { href: m[1] }, m[1].substr("mailto:".length ) ] ];
else
return [ m[0].length, [ "link", { href: m[1] }, m[1] ] ];
}
return [ 1, "<" ];
},
"`": function inlineCode( text ) {
// Inline code block. as many backticks as you like to start it
// Always skip over the opening ticks.
var m = text.match( /(`+)(([\s\S]*?)\1)/ );
if ( m && m[2] )
return [ m[1].length + m[2].length, [ "inlinecode", m[3] ] ];
else {
// TODO: No matching end code found - warn!
return [ 1, "`" ];
}
},
" \n": function lineBreak() {
return [ 3, [ "linebreak" ] ];
}
}
};
// Meta Helper/generator method for em and strong handling
function strong_em( tag, md ) {
var state_slot = tag + "_state",
other_slot = tag === "strong" ? "em_state" : "strong_state";
function CloseTag(len) {
this.len_after = len;
this.name = "close_" + md;
}
return function ( text ) {
if ( this[state_slot][0] === md ) {
// Most recent em is of this type
//D:this.debug("closing", md);
this[state_slot].shift();
// "Consume" everything to go back to the recrusion in the else-block below
return[ text.length, new CloseTag(text.length-md.length) ];
}
else {
// Store a clone of the em/strong states
var other = this[other_slot].slice(),
state = this[state_slot].slice();
this[state_slot].unshift(md);
//D:this.debug_indent += " ";
// Recurse
var res = this.processInline( text.substr( md.length ) );
//D:this.debug_indent = this.debug_indent.substr(2);
var last = res[res.length - 1];
//D:this.debug("processInline from", tag + ": ", uneval( res ) );
var check = this[state_slot].shift();
if ( last instanceof CloseTag ) {
res.pop();
// We matched! Huzzah.
var consumed = text.length - last.len_after;
return [ consumed, [ tag ].concat(res) ];
}
else {
// Restore the state of the other kind. We might have mistakenly closed it.
this[other_slot] = other;
this[state_slot] = state;
// We can't reuse the processed result as it could have wrong parsing contexts in it.
return [ md.length, md ];
}
}
}; // End returned function
}
Gruber.inline["**"] = strong_em("strong", "**");
Gruber.inline["__"] = strong_em("strong", "__");
Gruber.inline["*"] = strong_em("em", "*");
Gruber.inline["_"] = strong_em("em", "_");
Markdown.dialects.Gruber = Gruber;
Markdown.buildBlockOrder ( Markdown.dialects.Gruber.block );
Markdown.buildInlinePatterns( Markdown.dialects.Gruber.inline );
var Maruku = DialectHelpers.subclassDialect( Gruber ),
extract_attr = MarkdownHelpers.extract_attr,
forEach = MarkdownHelpers.forEach;
Maruku.processMetaHash = function processMetaHash( meta_string ) {
var meta = split_meta_hash( meta_string ),
attr = {};
for ( var i = 0; i < meta.length; ++i ) {
// id: #foo
if ( /^#/.test( meta[ i ] ) )
attr.id = meta[ i ].substring( 1 );
// class: .foo
else if ( /^\./.test( meta[ i ] ) ) {
// if class already exists, append the new one
if ( attr["class"] )
attr["class"] = attr["class"] + meta[ i ].replace( /./, " " );
else
attr["class"] = meta[ i ].substring( 1 );
}
// attribute: foo=bar
else if ( /\=/.test( meta[ i ] ) ) {
var s = meta[ i ].split( /\=/ );
attr[ s[ 0 ] ] = s[ 1 ];
}
}
return attr;
};
function split_meta_hash( meta_string ) {
var meta = meta_string.split( "" ),
parts = [ "" ],
in_quotes = false;
while ( meta.length ) {
var letter = meta.shift();
switch ( letter ) {
case " " :
// if we're in a quoted section, keep it
if ( in_quotes )
parts[ parts.length - 1 ] += letter;
// otherwise make a new part
else
parts.push( "" );
break;
case "'" :
case '"' :
// reverse the quotes and move straight on
in_quotes = !in_quotes;
break;
case "\\" :
// shift off the next letter to be used straight away.
// it was escaped so we'll keep it whatever it is
letter = meta.shift();
/* falls through */
default :
parts[ parts.length - 1 ] += letter;
break;
}
}
return parts;
}
Maruku.block.document_meta = function document_meta( block ) {
// we're only interested in the first block
if ( block.lineNumber > 1 )
return undefined;
// document_meta blocks consist of one or more lines of `Key: Value\n`
if ( ! block.match( /^(?:\w+:.*\n)*\w+:.*$/ ) )
return undefined;
// make an attribute node if it doesn't exist
if ( !extract_attr( this.tree ) )
this.tree.splice( 1, 0, {} );
var pairs = block.split( /\n/ );
for ( var p in pairs ) {
var m = pairs[ p ].match( /(\w+):\s*(.*)$/ ),
key = m[ 1 ].toLowerCase(),
value = m[ 2 ];
this.tree[ 1 ][ key ] = value;
}
// document_meta produces no content!
return [];
};
Maruku.block.block_meta = function block_meta( block ) {
// check if the last line of the block is an meta hash
var m = block.match( /(^|\n) {0,3}\{:\s*((?:\\\}|[^\}])*)\s*\}$/ );
if ( !m )
return undefined;
// process the meta hash
var attr = this.dialect.processMetaHash( m[ 2 ] ),
hash;
// if we matched ^ then we need to apply meta to the previous block
if ( m[ 1 ] === "" ) {
var node = this.tree[ this.tree.length - 1 ];
hash = extract_attr( node );
// if the node is a string (rather than JsonML), bail
if ( typeof node === "string" )
return undefined;
// create the attribute hash if it doesn't exist
if ( !hash ) {
hash = {};
node.splice( 1, 0, hash );
}
// add the attributes in
for ( var a in attr )
hash[ a ] = attr[ a ];
// return nothing so the meta hash is removed
return [];
}
// pull the meta hash off the block and process what's left
var b = block.replace( /\n.*$/, "" ),
result = this.processBlock( b, [] );
// get or make the attributes hash
hash = extract_attr( result[ 0 ] );
if ( !hash ) {
hash = {};
result[ 0 ].splice( 1, 0, hash );
}
// attach the attributes to the block
for ( var a in attr )
hash[ a ] = attr[ a ];
return result;
};
Maruku.block.definition_list = function definition_list( block, next ) {
// one or more terms followed by one or more definitions, in a single block
var tight = /^((?:[^\s:].*\n)+):\s+([\s\S]+)$/,
list = [ "dl" ],
i, m;
// see if we're dealing with a tight or loose block
if ( ( m = block.match( tight ) ) ) {
// pull subsequent tight DL blocks out of `next`
var blocks = [ block ];
while ( next.length && tight.exec( next[ 0 ] ) )
blocks.push( next.shift() );
for ( var b = 0; b < blocks.length; ++b ) {
var m = blocks[ b ].match( tight ),
terms = m[ 1 ].replace( /\n$/, "" ).split( /\n/ ),
defns = m[ 2 ].split( /\n:\s+/ );
// print( uneval( m ) );
for ( i = 0; i < terms.length; ++i )
list.push( [ "dt", terms[ i ] ] );
for ( i = 0; i < defns.length; ++i ) {
// run inline processing over the definition
list.push( [ "dd" ].concat( this.processInline( defns[ i ].replace( /(\n)\s+/, "$1" ) ) ) );
}
}
}
else {
return undefined;
}
return [ list ];
};
// splits on unescaped instances of @ch. If @ch is not a character the result
// can be unpredictable
Maruku.block.table = function table ( block ) {
var _split_on_unescaped = function( s, ch ) {
ch = ch || '\\s';
if ( ch.match(/^[\\|\[\]{}?*.+^$]$/) )
ch = '\\' + ch;
var res = [ ],
r = new RegExp('^((?:\\\\.|[^\\\\' + ch + '])*)' + ch + '(.*)'),
m;
while ( ( m = s.match( r ) ) ) {
res.push( m[1] );
s = m[2];
}
res.push(s);
return res;
};
var leading_pipe = /^ {0,3}\|(.+)\n {0,3}\|\s*([\-:]+[\-| :]*)\n((?:\s*\|.*(?:\n|$))*)(?=\n|$)/,
// find at least an unescaped pipe in each line
no_leading_pipe = /^ {0,3}(\S(?:\\.|[^\\|])*\|.*)\n {0,3}([\-:]+\s*\|[\-| :]*)\n((?:(?:\\.|[^\\|])*\|.*(?:\n|$))*)(?=\n|$)/,
i,
m;
if ( ( m = block.match( leading_pipe ) ) ) {
// remove leading pipes in contents
// (header and horizontal rule already have the leading pipe left out)
m[3] = m[3].replace(/^\s*\|/gm, '');
} else if ( ! ( m = block.match( no_leading_pipe ) ) ) {
return undefined;
}
var table = [ "table", [ "thead", [ "tr" ] ], [ "tbody" ] ];
// remove trailing pipes, then split on pipes
// (no escaped pipes are allowed in horizontal rule)
m[2] = m[2].replace(/\|\s*$/, '').split('|');
// process alignment
var html_attrs = [ ];
forEach (m[2], function (s) {
if (s.match(/^\s*-+:\s*$/))
html_attrs.push({align: "right"});
else if (s.match(/^\s*:-+\s*$/))
html_attrs.push({align: "left"});
else if (s.match(/^\s*:-+:\s*$/))
html_attrs.push({align: "center"});
else
html_attrs.push({});
});
// now for the header, avoid escaped pipes
m[1] = _split_on_unescaped(m[1].replace(/\|\s*$/, ''), '|');
for (i = 0; i < m[1].length; i++) {
table[1][1].push(['th', html_attrs[i] || {}].concat(
this.processInline(m[1][i].trim())));
}
// now for body contents
forEach (m[3].replace(/\|\s*$/mg, '').split('\n'), function (row) {
var html_row = ['tr'];
row = _split_on_unescaped(row, '|');
for (i = 0; i < row.length; i++)
html_row.push(['td', html_attrs[i] || {}].concat(this.processInline(row[i].trim())));
table[2].push(html_row);
}, this);
return [table];
};
Maruku.inline[ "{:" ] = function inline_meta( text, matches, out ) {
if ( !out.length )
return [ 2, "{:" ];
// get the preceeding element
var before = out[ out.length - 1 ];
if ( typeof before === "string" )
return [ 2, "{:" ];
// match a meta hash
var m = text.match( /^\{:\s*((?:\\\}|[^\}])*)\s*\}/ );
// no match, false alarm
if ( !m )
return [ 2, "{:" ];
// attach the attributes to the preceeding element
var meta = this.dialect.processMetaHash( m[ 1 ] ),
attr = extract_attr( before );
if ( !attr ) {
attr = {};
before.splice( 1, 0, attr );
}
for ( var k in meta )
attr[ k ] = meta[ k ];
// cut out the string and replace it with nothing
return [ m[ 0 ].length, "" ];
};
Markdown.dialects.Maruku = Maruku;
Markdown.dialects.Maruku.inline.__escape__ = /^\\[\\`\*_{}\[\]()#\+.!\-|:]/;
Markdown.buildBlockOrder ( Markdown.dialects.Maruku.block );
Markdown.buildInlinePatterns( Markdown.dialects.Maruku.inline );
// Include all our depndencies and;
expose.Markdown = Markdown;
expose.parse = Markdown.parse;
expose.toHTML = Markdown.toHTML;
expose.toHTMLTree = Markdown.toHTMLTree;
expose.renderJsonML = Markdown.renderJsonML;
})(function() {
window.markdown = {};
return window.markdown;
}());
| {
"content_hash": "6d7f855001c4c58b29696d3f35960696",
"timestamp": "",
"source": "github",
"line_count": 1740,
"max_line_length": 132,
"avg_line_length": 31.920689655172414,
"alnum_prop": 0.48948543444600484,
"repo_name": "carlan/docker-training",
"id": "8aeef4f201325754643bb95bc86b5402c3aad75b",
"size": "55542",
"binary": false,
"copies": "8",
"ref": "refs/heads/master",
"path": "slides/impress.js/extras/markdown/markdown.js",
"mode": "33261",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "280169"
},
{
"name": "HTML",
"bytes": "118502"
},
{
"name": "JavaScript",
"bytes": "511571"
},
{
"name": "Python",
"bytes": "420"
},
{
"name": "Shell",
"bytes": "75"
}
],
"symlink_target": ""
} |
/**** deck_info.js ****/
div#heading {
margin: 10px 0 0 0;
padding: 0;
}
div#heading p {
font-size: 14px;
margin: 0;
padding: 5px 0 5px 0;
}
div#deck_utils {
font-size: 14px;
font-weight: bold;
float: right;
clear: right;
}
/** middle section **/
div#middle {
font-size: 12px;
border: 1px solid #cecece;
overflow: auto;
}
div#category_select {
width: 50%;
margin: 10px 0 10px 0;
padding: 0;
float: left;
clear: left;
}
div#category_select p {
margin: 0 0 10px 20px;
}
div#category_select input {
float: left;
clear: left;
margin: 5px 5px 5px 50px;
}
div#category_select label {
float: left;
clear: right;
margin: 5px 0 5px 0;
}
div#category_select .disabled {
color: #cecece;
}
div#mode_select {
width: 50%;
margin: 10px 0 10px 0;
padding: 0;
float: left;
clear: right;
}
div#mode_select input {
margin: 10px;
}
div#mode_select label {}
div#mode_select input#learn_button, div#mode_select input#quiz_button {
width: 100px;
height: 30px;
margin: 0 20px 0 0 ;
padding: 0;
float: left;
clear: none;
}
/*** bottom section ***/
div#bottom {
font-size: 12px;
margin: 15px 0 0 0;
padding: .2em;
}
div#stats_tab, div#cards_tab, div#results_tab {
height: 530px;
padding: 10px;
clear: both;
}
/*** card/quiz review tab generic ***/
div.table_scroll {
height: 500px;
overflow-y: scroll;
overflow-x: hidden;
}
/** override default table padding and widths **/
div.table_header table.deck_table {}
div.table_header table.deck_table th { padding: 5px 0 }
div.table_header table.deck_table td { padding: 0 }
div.table_scroll table.deck_table { width: 670px }
div.table_scroll table.deck_table th { padding: 0 }
div.table_scroll table.deck_table td { padding: 10px 0 }
div.table_scroll table.deck_table tr.shaded { background-color: #E8E8E8 }
table.deck_table th.edit_rating,
table.deck_table th.history { text-align: center }
table.deck_table td.ord { text-align: center }
table.deck_table td.term_defn {}
table.deck_table td.rts_col { text-align: center }
table.deck_table td.token { text-align: center; }
table.deck_table td.token img {
display: block;
margin: 0 auto;
}
/* bold question */
table.deck_table td div.term { font-weight: bold }
/*** card list tab ***/
div#cards_tab table.deck_table col.col_num {
width: 40px;
}
div#cards_tab table.deck_table col.col_term_defn {
width: 420px;
}
div#cards_tab table.deck_table col.col_rating {
width: 210px;
}
/*** quiz review tab ***/
div#results_tab table.deck_table col.col_correct {
width: 40px;
/*
border: 1px solid red;
*/
}
div#results_tab table.deck_table col.col_num {
width: 40px;
/*
border: 1px solid blue;
*/
}
div#results_tab table.deck_table col.col_term_defn {
width: 230px;
/*
border: 1px solid red;
*/
}
div#results_tab table.deck_table col.col_history {
width: 150;
/*
border: 1px solid blue;
*/
}
div#results_tab table.deck_table col.col_rating {
width: 210px;
/*
border: 1px solid red;
*/
}
/** summary section end of quiz review **/
div#summary {
font-size: 30px;
font-weight: bold;
width: 350px;
margin: 20px auto;
overflow: auto;
text-align: center;
}
div#summary img {
margin: 10px 0;
float: left;
}
div#summary div#grade {
float: left;
margin: 40px 0 0 0;
}
/*** stats tab ***/
div#stats_tab h3 {
font-weight: bold;
font-size: 14px;
display: inline;
}
| {
"content_hash": "5748ad9c8c15220374a3e778a4f1a198",
"timestamp": "",
"source": "github",
"line_count": 192,
"max_line_length": 73,
"avg_line_length": 18.583333333333332,
"alnum_prop": 0.6269618834080718,
"repo_name": "swaiing/studydeck",
"id": "4245206012f2f58610054953726af22a4cfe360d",
"size": "3568",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "root/app/webroot/css/deck_info.css",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "ApacheConf",
"bytes": "810"
},
{
"name": "CSS",
"bytes": "72744"
},
{
"name": "HTML",
"bytes": "527"
},
{
"name": "JavaScript",
"bytes": "73205"
},
{
"name": "PHP",
"bytes": "2292423"
},
{
"name": "PLSQL",
"bytes": "159226"
},
{
"name": "Perl",
"bytes": "1187"
},
{
"name": "Shell",
"bytes": "17357"
}
],
"symlink_target": ""
} |
function plot_depth_image_errors(calib, image_i)
global dataset_path dfiles depth_plane_mask
Rext = calib.Rext;
text = calib.text;
if(nargin < 2)
image_i = 1:length(depth_plane_mask);
end
fprintf('Plotting disparity reprojection errors for each depth image\n');
fprintf('(in raw disparity units)\n');
figure();
clf;
hold on
colors = 'brgkcm';
for i=image_i
if(isempty(depth_plane_mask{i}))
continue;
end
[points,disparity]=get_depth_samples(dataset_path, dfiles{i},depth_plane_mask{i});
if(isempty(disparity))
continue;
end
[errors_disp_i] = get_depth_error(calib,points,disparity,Rext{i},text{i});
min_x = min(errors_disp_i);
max_x = max(errors_disp_i);
edges = min_x:0.2:max_x;
c = histc(errors_disp_i,edges);
c = c / sum(c);
s = sprintf('Image #%d: mean=%f, std=%f',i,mean(errors_disp_i(:)),std(errors_disp_i(:)));
fprintf([s '\n']);
bar(edges,c,colors(rem(i,6)+1),'DisplayName',s);
% plot(error_disp, i, [colors(rem(i,6)+1) '+'], 'DisplayName',s);
end
title('Disparity reprojection error normalized histogram.');
legend('show')
xlabel('Error (kinect units)');
ylabel('Normalized pixel count');
end
| {
"content_hash": "3cd2279b9f3bb368e9ae7ecaf8154023",
"timestamp": "",
"source": "github",
"line_count": 47,
"max_line_length": 93,
"avg_line_length": 26.382978723404257,
"alnum_prop": 0.6225806451612903,
"repo_name": "njustchenhao/Kinect",
"id": "a5335b51b94c7fce39b473f75546537b92bddcc1",
"size": "1240",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "kinect标定工具/v2.1/toolbox/plot_depth_image_errors.m",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "C",
"bytes": "34317"
},
{
"name": "C#",
"bytes": "45364"
},
{
"name": "C++",
"bytes": "831764"
},
{
"name": "CMake",
"bytes": "2708"
},
{
"name": "Matlab",
"bytes": "972719"
},
{
"name": "Objective-C",
"bytes": "434"
}
],
"symlink_target": ""
} |
package ch.unibas.dmi.dbis.cs108pet.management;
import ch.unibas.dmi.dbis.cs108pet.common.JSONUtils;
import ch.unibas.dmi.dbis.cs108pet.data.Group;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import java.io.File;
/**
* TODO: Write JavaDoc
*
* @author loris.sauter
*/
public class OpenGroupTask extends ThrowingManagementTask<Group> {
private static final Logger LOGGER = LogManager.getLogger(OpenGroupTask.class);
private final File file;
public OpenGroupTask(File file) {
this.file = file;
}
@Override
protected Group call() throws Exception {
updateAll("Opening group " + file.getName() + "...", 0.2);
Group gr = JSONUtils.readGroupJSONFile(file);
updateAll("Succsessfully opened group " + gr.getName() + ".", 1.0);
return gr;
}
}
| {
"content_hash": "c4e2188b8fbbc3ecc828b4663cad8687",
"timestamp": "",
"source": "github",
"line_count": 32,
"max_line_length": 81,
"avg_line_length": 25.8125,
"alnum_prop": 0.7130750605326877,
"repo_name": "dbisUnibas/ReqMan",
"id": "0d4f26ce9a2224183505e2b9f1e8b59db8b4bdaf",
"size": "826",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/main/java/ch/unibas/dmi/dbis/cs108pet/management/OpenGroupTask.java",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "626"
},
{
"name": "Java",
"bytes": "645028"
}
],
"symlink_target": ""
} |
require File.expand_path('../application', __FILE__)
# Initialize the Rails application.
Ribron::Application.initialize!
| {
"content_hash": "b3969fa20505efbaf5e4c4f2ffb5c363",
"timestamp": "",
"source": "github",
"line_count": 4,
"max_line_length": 52,
"avg_line_length": 30.5,
"alnum_prop": 0.7540983606557377,
"repo_name": "juampi/ribron-old",
"id": "da3a3c4f6da645cf8e55d2063f6f280ad45a6dcb",
"size": "152",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "config/environment.rb",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "546"
},
{
"name": "JavaScript",
"bytes": "664"
},
{
"name": "Ruby",
"bytes": "15438"
}
],
"symlink_target": ""
} |
namespace v8 {
class ApiFunction;
namespace internal {
class Isolate;
class Page;
class SCTableReference;
class StatsCounter;
//------------------------------------------------------------------------------
// External references
#define EXTERNAL_REFERENCE_LIST_WITH_ISOLATE(V) \
V(isolate_address, "isolate") \
V(builtins_address, "builtins") \
V(handle_scope_implementer_address, \
"Isolate::handle_scope_implementer_address") \
V(address_of_interpreter_entry_trampoline_instruction_start, \
"Address of the InterpreterEntryTrampoline instruction start") \
V(interpreter_dispatch_counters, "Interpreter::dispatch_counters") \
V(interpreter_dispatch_table_address, "Interpreter::dispatch_table_address") \
V(date_cache_stamp, "date_cache_stamp") \
V(stress_deopt_count, "Isolate::stress_deopt_count_address()") \
V(force_slow_path, "Isolate::force_slow_path_address()") \
V(isolate_root, "Isolate::isolate_root()") \
V(allocation_sites_list_address, "Heap::allocation_sites_list_address()") \
V(address_of_jslimit, "StackGuard::address_of_jslimit()") \
V(address_of_real_jslimit, "StackGuard::address_of_real_jslimit()") \
V(heap_is_marking_flag_address, "heap_is_marking_flag_address") \
V(new_space_allocation_top_address, "Heap::NewSpaceAllocationTopAddress()") \
V(new_space_allocation_limit_address, \
"Heap::NewSpaceAllocationLimitAddress()") \
V(old_space_allocation_top_address, "Heap::OldSpaceAllocationTopAddress") \
V(old_space_allocation_limit_address, \
"Heap::OldSpaceAllocationLimitAddress") \
V(handle_scope_level_address, "HandleScope::level") \
V(handle_scope_next_address, "HandleScope::next") \
V(handle_scope_limit_address, "HandleScope::limit") \
V(scheduled_exception_address, "Isolate::scheduled_exception") \
V(address_of_pending_message_obj, "address_of_pending_message_obj") \
V(promise_hook_address, "Isolate::promise_hook_address()") \
V(async_event_delegate_address, "Isolate::async_event_delegate_address()") \
V(promise_hook_or_async_event_delegate_address, \
"Isolate::promise_hook_or_async_event_delegate_address()") \
V(promise_hook_or_debug_is_active_or_async_event_delegate_address, \
"Isolate::promise_hook_or_debug_is_active_or_async_event_delegate_" \
"address()") \
V(debug_execution_mode_address, "Isolate::debug_execution_mode_address()") \
V(debug_is_active_address, "Debug::is_active_address()") \
V(debug_hook_on_function_call_address, \
"Debug::hook_on_function_call_address()") \
V(runtime_function_table_address, \
"Runtime::runtime_function_table_address()") \
V(is_profiling_address, "Isolate::is_profiling") \
V(debug_suspended_generator_address, \
"Debug::step_suspended_generator_address()") \
V(debug_restart_fp_address, "Debug::restart_fp_address()") \
V(fast_c_call_caller_fp_address, \
"IsolateData::fast_c_call_caller_fp_address") \
V(fast_c_call_caller_pc_address, \
"IsolateData::fast_c_call_caller_pc_address") \
V(stack_is_iterable_address, "IsolateData::stack_is_iterable_address") \
V(address_of_regexp_stack_limit_address, \
"RegExpStack::limit_address_address()") \
V(address_of_regexp_stack_memory_top_address, \
"RegExpStack::memory_top_address_address()") \
V(address_of_static_offsets_vector, "OffsetsVector::static_offsets_vector") \
V(re_case_insensitive_compare_unicode, \
"NativeRegExpMacroAssembler::CaseInsensitiveCompareUnicode()") \
V(re_case_insensitive_compare_non_unicode, \
"NativeRegExpMacroAssembler::CaseInsensitiveCompareNonUnicode()") \
V(re_check_stack_guard_state, \
"RegExpMacroAssembler*::CheckStackGuardState()") \
V(re_grow_stack, "NativeRegExpMacroAssembler::GrowStack()") \
V(re_word_character_map, "NativeRegExpMacroAssembler::word_character_map") \
EXTERNAL_REFERENCE_LIST_WITH_ISOLATE_HEAP_SANDBOX(V)
#ifdef V8_HEAP_SANDBOX
#define EXTERNAL_REFERENCE_LIST_WITH_ISOLATE_HEAP_SANDBOX(V) \
V(external_pointer_table_address, \
"Isolate::external_pointer_table_address(" \
")")
#else
#define EXTERNAL_REFERENCE_LIST_WITH_ISOLATE_HEAP_SANDBOX(V)
#endif // V8_HEAP_SANDBOX
#define EXTERNAL_REFERENCE_LIST(V) \
V(abort_with_reason, "abort_with_reason") \
V(address_of_double_abs_constant, "double_absolute_constant") \
V(address_of_double_neg_constant, "double_negate_constant") \
V(address_of_enable_experimental_regexp_engine, \
"address_of_enable_experimental_regexp_engine") \
V(address_of_float_abs_constant, "float_absolute_constant") \
V(address_of_float_neg_constant, "float_negate_constant") \
V(address_of_min_int, "LDoubleConstant::min_int") \
V(address_of_mock_arraybuffer_allocator_flag, \
"FLAG_mock_arraybuffer_allocator") \
V(address_of_one_half, "LDoubleConstant::one_half") \
V(address_of_runtime_stats_flag, "TracingFlags::runtime_stats") \
V(address_of_the_hole_nan, "the_hole_nan") \
V(address_of_uint32_bias, "uint32_bias") \
V(bytecode_size_table_address, "Bytecodes::bytecode_size_table_address") \
V(check_object_type, "check_object_type") \
V(compute_integer_hash, "ComputeSeededHash") \
V(compute_output_frames_function, "Deoptimizer::ComputeOutputFrames()") \
V(copy_fast_number_jsarray_elements_to_typed_array, \
"copy_fast_number_jsarray_elements_to_typed_array") \
V(copy_typed_array_elements_slice, "copy_typed_array_elements_slice") \
V(copy_typed_array_elements_to_typed_array, \
"copy_typed_array_elements_to_typed_array") \
V(cpu_features, "cpu_features") \
V(delete_handle_scope_extensions, "HandleScope::DeleteExtensions") \
V(ephemeron_key_write_barrier_function, \
"Heap::EphemeronKeyWriteBarrierFromCode") \
V(f64_acos_wrapper_function, "f64_acos_wrapper") \
V(f64_asin_wrapper_function, "f64_asin_wrapper") \
V(f64_mod_wrapper_function, "f64_mod_wrapper") \
V(get_date_field_function, "JSDate::GetField") \
V(get_or_create_hash_raw, "get_or_create_hash_raw") \
V(ieee754_acos_function, "base::ieee754::acos") \
V(ieee754_acosh_function, "base::ieee754::acosh") \
V(ieee754_asin_function, "base::ieee754::asin") \
V(ieee754_asinh_function, "base::ieee754::asinh") \
V(ieee754_atan_function, "base::ieee754::atan") \
V(ieee754_atan2_function, "base::ieee754::atan2") \
V(ieee754_atanh_function, "base::ieee754::atanh") \
V(ieee754_cbrt_function, "base::ieee754::cbrt") \
V(ieee754_cos_function, "base::ieee754::cos") \
V(ieee754_cosh_function, "base::ieee754::cosh") \
V(ieee754_exp_function, "base::ieee754::exp") \
V(ieee754_expm1_function, "base::ieee754::expm1") \
V(ieee754_log_function, "base::ieee754::log") \
V(ieee754_log10_function, "base::ieee754::log10") \
V(ieee754_log1p_function, "base::ieee754::log1p") \
V(ieee754_log2_function, "base::ieee754::log2") \
V(ieee754_pow_function, "base::ieee754::pow") \
V(ieee754_sin_function, "base::ieee754::sin") \
V(ieee754_sinh_function, "base::ieee754::sinh") \
V(ieee754_tan_function, "base::ieee754::tan") \
V(ieee754_tanh_function, "base::ieee754::tanh") \
V(insert_remembered_set_function, "Heap::InsertIntoRememberedSetFromCode") \
V(invalidate_prototype_chains_function, \
"JSObject::InvalidatePrototypeChains()") \
V(invoke_accessor_getter_callback, "InvokeAccessorGetterCallback") \
V(invoke_function_callback, "InvokeFunctionCallback") \
V(jsarray_array_join_concat_to_sequential_string, \
"jsarray_array_join_concat_to_sequential_string") \
V(jsreceiver_create_identity_hash, "jsreceiver_create_identity_hash") \
V(libc_memchr_function, "libc_memchr") \
V(libc_memcpy_function, "libc_memcpy") \
V(libc_memmove_function, "libc_memmove") \
V(libc_memset_function, "libc_memset") \
V(mod_two_doubles_operation, "mod_two_doubles") \
V(mutable_big_int_absolute_add_and_canonicalize_function, \
"MutableBigInt_AbsoluteAddAndCanonicalize") \
V(mutable_big_int_absolute_compare_function, \
"MutableBigInt_AbsoluteCompare") \
V(mutable_big_int_absolute_sub_and_canonicalize_function, \
"MutableBigInt_AbsoluteSubAndCanonicalize") \
V(new_deoptimizer_function, "Deoptimizer::New()") \
V(orderedhashmap_gethash_raw, "orderedhashmap_gethash_raw") \
V(printf_function, "printf") \
V(refill_math_random, "MathRandom::RefillCache") \
V(search_string_raw_one_one, "search_string_raw_one_one") \
V(search_string_raw_one_two, "search_string_raw_one_two") \
V(search_string_raw_two_one, "search_string_raw_two_one") \
V(search_string_raw_two_two, "search_string_raw_two_two") \
V(smi_lexicographic_compare_function, "smi_lexicographic_compare_function") \
V(string_to_array_index_function, "String::ToArrayIndex") \
V(try_string_to_index_or_lookup_existing, \
"try_string_to_index_or_lookup_existing") \
V(wasm_call_trap_callback_for_testing, \
"wasm::call_trap_callback_for_testing") \
V(wasm_f32_ceil, "wasm::f32_ceil_wrapper") \
V(wasm_f32_floor, "wasm::f32_floor_wrapper") \
V(wasm_f32_nearest_int, "wasm::f32_nearest_int_wrapper") \
V(wasm_f32_trunc, "wasm::f32_trunc_wrapper") \
V(wasm_f64_ceil, "wasm::f64_ceil_wrapper") \
V(wasm_f64_floor, "wasm::f64_floor_wrapper") \
V(wasm_f64_nearest_int, "wasm::f64_nearest_int_wrapper") \
V(wasm_f64_trunc, "wasm::f64_trunc_wrapper") \
V(wasm_float32_to_int64, "wasm::float32_to_int64_wrapper") \
V(wasm_float32_to_uint64, "wasm::float32_to_uint64_wrapper") \
V(wasm_float32_to_int64_sat, "wasm::float32_to_int64_sat_wrapper") \
V(wasm_float32_to_uint64_sat, "wasm::float32_to_uint64_sat_wrapper") \
V(wasm_float64_pow, "wasm::float64_pow") \
V(wasm_float64_to_int64, "wasm::float64_to_int64_wrapper") \
V(wasm_float64_to_uint64, "wasm::float64_to_uint64_wrapper") \
V(wasm_float64_to_int64_sat, "wasm::float64_to_int64_sat_wrapper") \
V(wasm_float64_to_uint64_sat, "wasm::float64_to_uint64_sat_wrapper") \
V(wasm_int64_div, "wasm::int64_div") \
V(wasm_int64_mod, "wasm::int64_mod") \
V(wasm_int64_to_float32, "wasm::int64_to_float32_wrapper") \
V(wasm_int64_to_float64, "wasm::int64_to_float64_wrapper") \
V(wasm_uint64_div, "wasm::uint64_div") \
V(wasm_uint64_mod, "wasm::uint64_mod") \
V(wasm_uint64_to_float32, "wasm::uint64_to_float32_wrapper") \
V(wasm_uint64_to_float64, "wasm::uint64_to_float64_wrapper") \
V(wasm_word32_ctz, "wasm::word32_ctz") \
V(wasm_word32_popcnt, "wasm::word32_popcnt") \
V(wasm_word32_rol, "wasm::word32_rol") \
V(wasm_word32_ror, "wasm::word32_ror") \
V(wasm_word64_rol, "wasm::word64_rol") \
V(wasm_word64_ror, "wasm::word64_ror") \
V(wasm_word64_ctz, "wasm::word64_ctz") \
V(wasm_word64_popcnt, "wasm::word64_popcnt") \
V(wasm_f64x2_ceil, "wasm::f64x2_ceil_wrapper") \
V(wasm_f64x2_floor, "wasm::f64x2_floor_wrapper") \
V(wasm_f64x2_trunc, "wasm::f64x2_trunc_wrapper") \
V(wasm_f64x2_nearest_int, "wasm::f64x2_nearest_int_wrapper") \
V(wasm_f32x4_ceil, "wasm::f32x4_ceil_wrapper") \
V(wasm_f32x4_floor, "wasm::f32x4_floor_wrapper") \
V(wasm_f32x4_trunc, "wasm::f32x4_trunc_wrapper") \
V(wasm_f32x4_nearest_int, "wasm::f32x4_nearest_int_wrapper") \
V(wasm_memory_init, "wasm::memory_init") \
V(wasm_memory_copy, "wasm::memory_copy") \
V(wasm_memory_fill, "wasm::memory_fill") \
V(write_barrier_marking_from_code_function, "WriteBarrier::MarkingFromCode") \
V(call_enqueue_microtask_function, "MicrotaskQueue::CallEnqueueMicrotask") \
V(call_enter_context_function, "call_enter_context_function") \
V(atomic_pair_load_function, "atomic_pair_load_function") \
V(atomic_pair_store_function, "atomic_pair_store_function") \
V(atomic_pair_add_function, "atomic_pair_add_function") \
V(atomic_pair_sub_function, "atomic_pair_sub_function") \
V(atomic_pair_and_function, "atomic_pair_and_function") \
V(atomic_pair_or_function, "atomic_pair_or_function") \
V(atomic_pair_xor_function, "atomic_pair_xor_function") \
V(atomic_pair_exchange_function, "atomic_pair_exchange_function") \
V(atomic_pair_compare_exchange_function, \
"atomic_pair_compare_exchange_function") \
V(js_finalization_registry_remove_cell_from_unregister_token_map, \
"JSFinalizationRegistry::RemoveCellFromUnregisterTokenMap") \
V(re_match_for_call_from_js, "IrregexpInterpreter::MatchForCallFromJs") \
V(re_experimental_match_for_call_from_js, \
"ExperimentalRegExp::MatchForCallFromJs") \
EXTERNAL_REFERENCE_LIST_INTL(V) \
EXTERNAL_REFERENCE_LIST_HEAP_SANDBOX(V)
#ifdef V8_INTL_SUPPORT
#define EXTERNAL_REFERENCE_LIST_INTL(V) \
V(intl_convert_one_byte_to_lower, "intl_convert_one_byte_to_lower") \
V(intl_to_latin1_lower_table, "intl_to_latin1_lower_table")
#else
#define EXTERNAL_REFERENCE_LIST_INTL(V)
#endif // V8_INTL_SUPPORT
#ifdef V8_HEAP_SANDBOX
#define EXTERNAL_REFERENCE_LIST_HEAP_SANDBOX(V) \
V(external_pointer_table_grow_table_function, \
"ExternalPointerTable::GrowTable")
#else
#define EXTERNAL_REFERENCE_LIST_HEAP_SANDBOX(V)
#endif // V8_HEAP_SANDBOX
// An ExternalReference represents a C++ address used in the generated
// code. All references to C++ functions and variables must be encapsulated
// in an ExternalReference instance. This is done in order to track the
// origin of all external references in the code so that they can be bound
// to the correct addresses when deserializing a heap.
class ExternalReference {
public:
// Used in the simulator to support different native api calls.
enum Type {
// Builtin call.
// Address f(v8::internal::Arguments).
BUILTIN_CALL, // default
// Builtin call returning object pair.
// ObjectPair f(v8::internal::Arguments).
BUILTIN_CALL_PAIR,
// Builtin that takes float arguments and returns an int.
// int f(double, double).
BUILTIN_COMPARE_CALL,
// Builtin call that returns floating point.
// double f(double, double).
BUILTIN_FP_FP_CALL,
// Builtin call that returns floating point.
// double f(double).
BUILTIN_FP_CALL,
// Builtin call that returns floating point.
// double f(double, int).
BUILTIN_FP_INT_CALL,
// Direct call to API function callback.
// void f(v8::FunctionCallbackInfo&)
DIRECT_API_CALL,
// Call to function callback via InvokeFunctionCallback.
// void f(v8::FunctionCallbackInfo&, v8::FunctionCallback)
PROFILING_API_CALL,
// Direct call to accessor getter callback.
// void f(Local<Name> property, PropertyCallbackInfo& info)
DIRECT_GETTER_CALL,
// Call to accessor getter callback via InvokeAccessorGetterCallback.
// void f(Local<Name> property, PropertyCallbackInfo& info,
// AccessorNameGetterCallback callback)
PROFILING_GETTER_CALL
};
static constexpr int kExternalReferenceCount =
#define COUNT_EXTERNAL_REFERENCE(name, desc) +1
EXTERNAL_REFERENCE_LIST(COUNT_EXTERNAL_REFERENCE)
EXTERNAL_REFERENCE_LIST_WITH_ISOLATE(COUNT_EXTERNAL_REFERENCE);
#undef COUNT_EXTERNAL_REFERENCE
ExternalReference() : address_(kNullAddress) {}
static ExternalReference Create(const SCTableReference& table_ref);
static ExternalReference Create(StatsCounter* counter);
static V8_EXPORT_PRIVATE ExternalReference Create(ApiFunction* ptr,
Type type);
static ExternalReference Create(const Runtime::Function* f);
static ExternalReference Create(IsolateAddressId id, Isolate* isolate);
static ExternalReference Create(Runtime::FunctionId id);
static V8_EXPORT_PRIVATE ExternalReference Create(Address address);
template <typename SubjectChar, typename PatternChar>
static ExternalReference search_string_raw();
V8_EXPORT_PRIVATE static ExternalReference FromRawAddress(Address address);
#define DECL_EXTERNAL_REFERENCE(name, desc) \
V8_EXPORT_PRIVATE static ExternalReference name();
EXTERNAL_REFERENCE_LIST(DECL_EXTERNAL_REFERENCE)
#undef DECL_EXTERNAL_REFERENCE
#define DECL_EXTERNAL_REFERENCE(name, desc) \
static V8_EXPORT_PRIVATE ExternalReference name(Isolate* isolate);
EXTERNAL_REFERENCE_LIST_WITH_ISOLATE(DECL_EXTERNAL_REFERENCE)
#undef DECL_EXTERNAL_REFERENCE
V8_EXPORT_PRIVATE V8_NOINLINE static ExternalReference
runtime_function_table_address_for_unittests(Isolate* isolate);
static V8_EXPORT_PRIVATE ExternalReference
address_of_load_from_stack_count(const char* function_name);
static V8_EXPORT_PRIVATE ExternalReference
address_of_store_to_stack_count(const char* function_name);
Address address() const { return address_; }
private:
explicit ExternalReference(Address address) : address_(address) {}
explicit ExternalReference(void* address)
: address_(reinterpret_cast<Address>(address)) {}
static Address Redirect(Address address_arg,
Type type = ExternalReference::BUILTIN_CALL);
Address address_;
};
ASSERT_TRIVIALLY_COPYABLE(ExternalReference);
V8_EXPORT_PRIVATE bool operator==(ExternalReference, ExternalReference);
bool operator!=(ExternalReference, ExternalReference);
size_t hash_value(ExternalReference);
V8_EXPORT_PRIVATE std::ostream& operator<<(std::ostream&, ExternalReference);
void abort_with_reason(int reason);
} // namespace internal
} // namespace v8
#endif // V8_CODEGEN_EXTERNAL_REFERENCE_H_
| {
"content_hash": "3b3caa75a7cf149c27cb0c22baa76379",
"timestamp": "",
"source": "github",
"line_count": 374,
"max_line_length": 80,
"avg_line_length": 60.719251336898395,
"alnum_prop": 0.5419437227530934,
"repo_name": "youtube/cobalt",
"id": "72a3397007c1e39af4e9abb1d1df374af717fddf",
"size": "23026",
"binary": false,
"copies": "3",
"ref": "refs/heads/master",
"path": "third_party/v8/src/codegen/external-reference.h",
"mode": "33188",
"license": "bsd-3-clause",
"language": [],
"symlink_target": ""
} |
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<!-- State when a row is being pressed, but hasn't yet been activated (finger down) -->
<item android:state_pressed="true">
<ripple android:color="@color/lightcream" />
</item>
<!-- For ListView, when the view is "activated". In SINGLE_CHOICE_MODE, it flags the active row -->
<item android:state_activated="true"
android:drawable="@color/lightcream" />
<!-- Default, "just hangin' out" state. -->
<item android:drawable="@android:color/transparent" />
</selector> | {
"content_hash": "98e20a1d489a667605cda005019e166c",
"timestamp": "",
"source": "github",
"line_count": 17,
"max_line_length": 104,
"avg_line_length": 36.64705882352941,
"alnum_prop": 0.6532905296950241,
"repo_name": "sarveshchavan7/Trivia-Knowledge",
"id": "3a021a0141f361e33710981c1d05a2c70d21d2d5",
"size": "623",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "app/src/main/res/drawable-v21/touch_selector_arts.xml",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Java",
"bytes": "604564"
}
],
"symlink_target": ""
} |
We welcome pull requests from everyone. By participating in this project, you agree to abide by our simple code of conduct - be nice to people.
Fork, then clone the repository:
git clone git@github.com:your-username/devtools-boshrelease
Make your change(s).
Write a [good commit message](http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html).
Push to your fork and [create a pull request](https://help.github.com/articles/creating-a-pull-request-from-a-fork/)
You're then waiting for us to do something. We can't commit to a time frame in which to review your pull request, please be patient with us. We may suggest some changes or improvements.
| {
"content_hash": "e5d0c3abad01a0b932b38d26ff2d7359",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 185,
"avg_line_length": 51.69230769230769,
"alnum_prop": 0.7723214285714286,
"repo_name": "cagiti/buildstack-boshrelease",
"id": "977cba940b1fc35f077221fa87ac7a525e9584d1",
"size": "688",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "CONTRIBUTING.md",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Groovy",
"bytes": "2094"
},
{
"name": "HTML",
"bytes": "16865"
},
{
"name": "Shell",
"bytes": "58459"
}
],
"symlink_target": ""
} |
import requests
__author__ = 'Lei Yu'
# connection wrapper
class Error(Exception):
def __init__(self,message):
self.message=message
def __str__(self):
return repr(self.message)
class Connection:
def __init__(self,host="api.coursera.org/api",version="catalog.v1"):
self.host=host
self.version=version
def get(self,path):
return self._do_call(path,"GET")
def _do_call(self,path,method):
url='https://{0}/{1}{2}'.format(self.host,self.version,path)
response=requests.request(method,url)
if(response.status_code==requests.codes.ok):
json_body=response.json()
return json_body
raise Error(response.json())
| {
"content_hash": "e151bc31e4843c1b9efd250bb2a7b578",
"timestamp": "",
"source": "github",
"line_count": 43,
"max_line_length": 72,
"avg_line_length": 17.72093023255814,
"alnum_prop": 0.5826771653543307,
"repo_name": "leiyu123/coursera_rest_client",
"id": "ab103b639e9bde1f944acc22c2a786112da0c54d",
"size": "762",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "coursera_rest_client/connection.py",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Python",
"bytes": "14934"
}
],
"symlink_target": ""
} |
var __defineProperty = function(clazz, key, value) {
if (typeof clazz.__defineProperty == 'function') return clazz.__defineProperty(key, value);
return clazz.prototype[key] = value;
},
__hasProp = {}.hasOwnProperty,
__extends = function(child, parent) {
if (typeof parent.__extend == 'function') return parent.__extend(child);
for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; }
function ctor() { this.constructor = child; }
ctor.prototype = parent.prototype;
child.prototype = new ctor;
child.__super__ = parent.prototype;
if (typeof parent.extended == 'function') parent.extended(child);
return child;
};
Tower.NetParamOrder = (function(_super) {
var NetParamOrder;
function NetParamOrder() {
return NetParamOrder.__super__.constructor.apply(this, arguments);
}
NetParamOrder = __extends(NetParamOrder, _super);
__defineProperty(NetParamOrder, "parse", function(value) {
var array, string, values, _i, _len,
_this = this;
if (_.isArray(value)) {
return value;
}
values = [];
array = value.toString().split(/\s*,/);
for (_i = 0, _len = array.length; _i < _len; _i++) {
string = array[_i];
string.replace(/([\w-]+[^\-\+])([\+\-])?/, function(_, token, operator) {
var controller;
operator = operator === "-" ? "DESC" : "ASC";
token = _this._clean(token);
controller = _this.controller;
return values.push(token, operator);
});
}
return values;
});
return NetParamOrder;
})(Tower.NetParam);
module.exports = Tower.NetParamOrder;
| {
"content_hash": "ada6e8ac3c4ce30454a509ca5566a638",
"timestamp": "",
"source": "github",
"line_count": 51,
"max_line_length": 93,
"avg_line_length": 32.15686274509804,
"alnum_prop": 0.6091463414634146,
"repo_name": "feilaoda/power",
"id": "f1d3fb07324b2d66f66a0acd7924da40dd98fa67",
"size": "1640",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "node_modules/tower/lib/tower-net/shared/param/order.js",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "5020"
},
{
"name": "CoffeeScript",
"bytes": "71907"
},
{
"name": "JavaScript",
"bytes": "99005"
}
],
"symlink_target": ""
} |
@implementation Fee
@synthesize feeAmount;
@synthesize feeCurrencyCode;
@synthesize feePurpose;
@synthesize feePurposeDescription;
- (id)initFromFeeDictionary:(NSDictionary *)feeDictionary {
self.feeAmount = [feeDictionary objectForKey:@"@Amount"];
self.feeCurrencyCode = [feeDictionary objectForKey:@"@CurrencyCode"];
self.feePurpose = [feeDictionary objectForKey:@"@Purpose"];
if ([self.feePurpose isEqualToString:@"22"]) {
self.feePurposeDescription = @"Deposit fee, taken at confirmation.";
}
if ([self.feePurpose isEqualToString:@"23"]) {
self.feePurposeDescription = @"Fee to pay on arrival.";
}
if ([self.feePurpose isEqualToString:@"6"]) {
self.feePurposeDescription = @"Cartrawler booking fee.";
}
return self;
}
- (void)dealloc {
[feeAmount release];
[feeCurrencyCode release];
[feePurpose release];
[feePurposeDescription release];
[super dealloc];
}
@end
| {
"content_hash": "3d3b6eac2a00357a8a7458415d21fd5f",
"timestamp": "",
"source": "github",
"line_count": 35,
"max_line_length": 70,
"avg_line_length": 25.62857142857143,
"alnum_prop": 0.7402452619843924,
"repo_name": "CartrawlerGit/Generic",
"id": "2c39e59fed029ed481f8344cdde2c20bd9aa2c8a",
"size": "950",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "iOS/App/Fee.m",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Objective-C",
"bytes": "982007"
}
],
"symlink_target": ""
} |
import {
Component, Input, ChangeDetectionStrategy
} from '@angular/core';
import { ListViewChecklistItemModel } from './state/items/item.model';
@Component({
selector: 'sky-contrib-list-view-checklist-item',
template: '<ng-content></ng-content>',
styleUrls: ['./list-view-checklist-item.component.scss'],
changeDetection: ChangeDetectionStrategy.OnPush
})
export class SkyContribListViewChecklistItemComponent {
@Input() public item: ListViewChecklistItemModel;
}
| {
"content_hash": "77e8d9678f769503e195a8ff94a1960d",
"timestamp": "",
"source": "github",
"line_count": 14,
"max_line_length": 70,
"avg_line_length": 34.142857142857146,
"alnum_prop": 0.7656903765690377,
"repo_name": "Blackbaud-ChrisFranz/microedge-skyux2-contrib",
"id": "edbc7007a52cc2ae8f4a3a984f2787a0d14444e1",
"size": "478",
"binary": false,
"copies": "4",
"ref": "refs/heads/master",
"path": "src/app/public/src/modules/list-view-checklist/list-view-checklist-item.component.ts",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "51722"
},
{
"name": "HTML",
"bytes": "83653"
},
{
"name": "TypeScript",
"bytes": "437462"
}
],
"symlink_target": ""
} |
package com.amazonaws.services.chimesdkmediapipelines.model;
import java.io.Serializable;
import javax.annotation.Generated;
import com.amazonaws.protocol.StructuredPojo;
import com.amazonaws.protocol.ProtocolMarshaller;
/**
* <p>
* The source type and media pipeline configuration settings in a configuration object.
* </p>
*
* @see <a href="http://docs.aws.amazon.com/goto/WebAPI/chime-sdk-media-pipelines-2021-07-15/ConcatenationSource"
* target="_top">AWS API Documentation</a>
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class ConcatenationSource implements Serializable, Cloneable, StructuredPojo {
/**
* <p>
* The type of concatenation source in a configuration object.
* </p>
*/
private String type;
/**
* <p>
* The concatenation settings for the media pipeline in a configuration object.
* </p>
*/
private MediaCapturePipelineSourceConfiguration mediaCapturePipelineSourceConfiguration;
/**
* <p>
* The type of concatenation source in a configuration object.
* </p>
*
* @param type
* The type of concatenation source in a configuration object.
* @see ConcatenationSourceType
*/
public void setType(String type) {
this.type = type;
}
/**
* <p>
* The type of concatenation source in a configuration object.
* </p>
*
* @return The type of concatenation source in a configuration object.
* @see ConcatenationSourceType
*/
public String getType() {
return this.type;
}
/**
* <p>
* The type of concatenation source in a configuration object.
* </p>
*
* @param type
* The type of concatenation source in a configuration object.
* @return Returns a reference to this object so that method calls can be chained together.
* @see ConcatenationSourceType
*/
public ConcatenationSource withType(String type) {
setType(type);
return this;
}
/**
* <p>
* The type of concatenation source in a configuration object.
* </p>
*
* @param type
* The type of concatenation source in a configuration object.
* @return Returns a reference to this object so that method calls can be chained together.
* @see ConcatenationSourceType
*/
public ConcatenationSource withType(ConcatenationSourceType type) {
this.type = type.toString();
return this;
}
/**
* <p>
* The concatenation settings for the media pipeline in a configuration object.
* </p>
*
* @param mediaCapturePipelineSourceConfiguration
* The concatenation settings for the media pipeline in a configuration object.
*/
public void setMediaCapturePipelineSourceConfiguration(MediaCapturePipelineSourceConfiguration mediaCapturePipelineSourceConfiguration) {
this.mediaCapturePipelineSourceConfiguration = mediaCapturePipelineSourceConfiguration;
}
/**
* <p>
* The concatenation settings for the media pipeline in a configuration object.
* </p>
*
* @return The concatenation settings for the media pipeline in a configuration object.
*/
public MediaCapturePipelineSourceConfiguration getMediaCapturePipelineSourceConfiguration() {
return this.mediaCapturePipelineSourceConfiguration;
}
/**
* <p>
* The concatenation settings for the media pipeline in a configuration object.
* </p>
*
* @param mediaCapturePipelineSourceConfiguration
* The concatenation settings for the media pipeline in a configuration object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public ConcatenationSource withMediaCapturePipelineSourceConfiguration(MediaCapturePipelineSourceConfiguration mediaCapturePipelineSourceConfiguration) {
setMediaCapturePipelineSourceConfiguration(mediaCapturePipelineSourceConfiguration);
return this;
}
/**
* Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be
* redacted from this string using a placeholder value.
*
* @return A string representation of this object.
*
* @see java.lang.Object#toString()
*/
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("{");
if (getType() != null)
sb.append("Type: ").append(getType()).append(",");
if (getMediaCapturePipelineSourceConfiguration() != null)
sb.append("MediaCapturePipelineSourceConfiguration: ").append(getMediaCapturePipelineSourceConfiguration());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof ConcatenationSource == false)
return false;
ConcatenationSource other = (ConcatenationSource) obj;
if (other.getType() == null ^ this.getType() == null)
return false;
if (other.getType() != null && other.getType().equals(this.getType()) == false)
return false;
if (other.getMediaCapturePipelineSourceConfiguration() == null ^ this.getMediaCapturePipelineSourceConfiguration() == null)
return false;
if (other.getMediaCapturePipelineSourceConfiguration() != null
&& other.getMediaCapturePipelineSourceConfiguration().equals(this.getMediaCapturePipelineSourceConfiguration()) == false)
return false;
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode + ((getType() == null) ? 0 : getType().hashCode());
hashCode = prime * hashCode + ((getMediaCapturePipelineSourceConfiguration() == null) ? 0 : getMediaCapturePipelineSourceConfiguration().hashCode());
return hashCode;
}
@Override
public ConcatenationSource clone() {
try {
return (ConcatenationSource) super.clone();
} catch (CloneNotSupportedException e) {
throw new IllegalStateException("Got a CloneNotSupportedException from Object.clone() " + "even though we're Cloneable!", e);
}
}
@com.amazonaws.annotation.SdkInternalApi
@Override
public void marshall(ProtocolMarshaller protocolMarshaller) {
com.amazonaws.services.chimesdkmediapipelines.model.transform.ConcatenationSourceMarshaller.getInstance().marshall(this, protocolMarshaller);
}
}
| {
"content_hash": "64dcf39b64acf5b595e89058b515d377",
"timestamp": "",
"source": "github",
"line_count": 198,
"max_line_length": 157,
"avg_line_length": 34.15151515151515,
"alnum_prop": 0.6647441585329784,
"repo_name": "aws/aws-sdk-java",
"id": "8c364440613f6208c1af9bf232eebe1e4a37570f",
"size": "7342",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "aws-java-sdk-chimesdkmediapipelines/src/main/java/com/amazonaws/services/chimesdkmediapipelines/model/ConcatenationSource.java",
"mode": "33188",
"license": "apache-2.0",
"language": [],
"symlink_target": ""
} |
import React from 'react';
import Header from './header'
const Top = props => (
<Header />
);
export { Top };
| {
"content_hash": "aca931d58a0b68d90a5e2a0a71347da6",
"timestamp": "",
"source": "github",
"line_count": 9,
"max_line_length": 29,
"avg_line_length": 13,
"alnum_prop": 0.5982905982905983,
"repo_name": "michelmarcondes/ReactNativeStudies",
"id": "ed2f06b7c2b0aaeb815d46c005476ae00edc39b5",
"size": "117",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "CalcApp/src/components/top.js",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Java",
"bytes": "6794"
},
{
"name": "JavaScript",
"bytes": "81479"
},
{
"name": "Objective-C",
"bytes": "22080"
},
{
"name": "Python",
"bytes": "8652"
}
],
"symlink_target": ""
} |
package org.apache.nutch.parse;
// Nutch imports
import org.apache.nutch.plugin.Extension;
import org.apache.hadoop.conf.Configuration;
import org.apache.nutch.util.NutchConfiguration;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
/**
* Unit test for new parse plugin selection.
*
* @author Sebastien Le Callonnec
* @version 1.0
*/
public class TestParserFactory {
private Configuration conf;
private ParserFactory parserFactory;
/** Inits the Test Case with the test parse-plugin file */
@Before
public void setUp() throws Exception {
conf = NutchConfiguration.create();
conf.set("plugin.includes", ".*");
conf.set("parse.plugin.file",
"org/apache/nutch/parse/parse-plugin-test.xml");
parserFactory = new ParserFactory(conf);
}
/** Unit test for <code>getExtensions(String)</code> method. */
@Test
public void testGetExtensions() throws Exception {
Extension ext = parserFactory.getExtensions("text/html").get(0);
Assert.assertEquals("parse-tika", ext.getDescriptor().getPluginId());
ext = parserFactory.getExtensions("text/html; charset=ISO-8859-1").get(0);
Assert.assertEquals("parse-tika", ext.getDescriptor().getPluginId());
ext = parserFactory.getExtensions("foo/bar").get(0);
Assert.assertEquals("parse-tika", ext.getDescriptor().getPluginId());
}
/** Unit test to check <code>getParsers</code> method */
@Test
public void testGetParsers() throws Exception {
Parser[] parsers = parserFactory.getParsers("text/html", "http://foo.com");
Assert.assertNotNull(parsers);
Assert.assertEquals(1, parsers.length);
Assert.assertEquals("org.apache.nutch.parse.tika.TikaParser", parsers[0]
.getClass().getName());
parsers = parserFactory.getParsers("text/html; charset=ISO-8859-1",
"http://foo.com");
Assert.assertNotNull(parsers);
Assert.assertEquals(1, parsers.length);
Assert.assertEquals("org.apache.nutch.parse.tika.TikaParser", parsers[0]
.getClass().getName());
parsers = parserFactory.getParsers("application/x-javascript",
"http://foo.com");
Assert.assertNotNull(parsers);
Assert.assertEquals(1, parsers.length);
Assert.assertEquals("org.apache.nutch.parse.js.JSParseFilter", parsers[0]
.getClass().getName());
parsers = parserFactory.getParsers("text/plain", "http://foo.com");
Assert.assertNotNull(parsers);
Assert.assertEquals(1, parsers.length);
Assert.assertEquals("org.apache.nutch.parse.tika.TikaParser", parsers[0]
.getClass().getName());
Parser parser1 = parserFactory.getParsers("text/plain", "http://foo.com")[0];
Parser parser2 = parserFactory.getParsers("*", "http://foo.com")[0];
Assert.assertEquals("Different instances!", parser1.hashCode(),
parser2.hashCode());
// test and make sure that the rss parser is loaded even though its
// plugin.xml
// doesn't claim to support text/rss, only application/rss+xml
parsers = parserFactory.getParsers("text/rss", "http://foo.com");
Assert.assertNotNull(parsers);
Assert.assertEquals(1, parsers.length);
Assert.assertEquals("org.apache.nutch.parse.tika.TikaParser", parsers[0]
.getClass().getName());
}
}
| {
"content_hash": "f3ea2e6401a9ee73689d840fe90884ea",
"timestamp": "",
"source": "github",
"line_count": 90,
"max_line_length": 81,
"avg_line_length": 36.21111111111111,
"alnum_prop": 0.6986805768640687,
"repo_name": "gitriver/nutch-learning",
"id": "00c524e2f82fd1fde81a6a1694f6929776cf53ae",
"size": "4061",
"binary": false,
"copies": "3",
"ref": "refs/heads/master",
"path": "src/test/org/apache/nutch/parse/TestParserFactory.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "HTML",
"bytes": "54461"
},
{
"name": "Java",
"bytes": "2559283"
},
{
"name": "Shell",
"bytes": "27659"
},
{
"name": "XSLT",
"bytes": "1822"
}
],
"symlink_target": ""
} |
/**
* @file subtitles-button.js
*/
import TextTrackButton from './text-track-button.js';
import Component from '../../component.js';
/**
* The button component for toggling and selecting subtitles
*
* @param {Object} player Player object
* @param {Object=} options Object of option names and values
* @param {Function=} ready Ready callback function
* @extends TextTrackButton
* @class SubtitlesButton
*/
class SubtitlesButton extends TextTrackButton {
constructor(player, options, ready){
super(player, options, ready);
this.el_.setAttribute('aria-label','Subtitles Menu');
}
/**
* Allow sub components to stack CSS class names
*
* @return {String} The constructed class name
* @method buildCSSClass
*/
buildCSSClass() {
return `vjs-subtitles-button ${super.buildCSSClass()}`;
}
}
SubtitlesButton.prototype.kind_ = 'subtitles';
SubtitlesButton.prototype.controlText_ = 'Subtitles';
Component.registerComponent('SubtitlesButton', SubtitlesButton);
export default SubtitlesButton;
| {
"content_hash": "abfa0aa1b109d8caf80fecdc974a3be4",
"timestamp": "",
"source": "github",
"line_count": 39,
"max_line_length": 64,
"avg_line_length": 26.58974358974359,
"alnum_prop": 0.7184185149469624,
"repo_name": "zzjaqwsx/TheApp2017",
"id": "c56731496e8e3eb97d4adef3f897a4ddb236f608",
"size": "1037",
"binary": false,
"copies": "30",
"ref": "refs/heads/master",
"path": "src/TheApp2017/wwwroot/lib/video.js/src/js/control-bar/text-track-controls/subtitles-button.js",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C#",
"bytes": "132616"
},
{
"name": "CSS",
"bytes": "635358"
},
{
"name": "HTML",
"bytes": "63117"
},
{
"name": "JavaScript",
"bytes": "1583955"
},
{
"name": "PowerShell",
"bytes": "49409"
}
],
"symlink_target": ""
} |
/**
* Top level objects for the YAML API.
*
* @see com.github.autermann.yaml.YamlNode
* @see com.github.autermann.yaml.Yaml
*/
package com.github.autermann.yaml;
| {
"content_hash": "458953b400a3e1d01b2b3a24c8d43ba5",
"timestamp": "",
"source": "github",
"line_count": 8,
"max_line_length": 42,
"avg_line_length": 21,
"alnum_prop": 0.7083333333333334,
"repo_name": "autermann/yaml",
"id": "cc23a7a8bdc93bbb8a0e7dea6664dcf159cb061e",
"size": "775",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/main/java/com/github/autermann/yaml/package-info.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Java",
"bytes": "442829"
}
],
"symlink_target": ""
} |
<?php
/**
* Only user facing pieces of Publicize are found here.
*/
class Publicize_UI {
/**
* Contains an instance of class 'publicize' which loads Keyring, sets up services, etc.
*/
public $publicize;
/**
* Hooks into WordPress to display the various pieces of UI and load our assets
*/
function __construct() {
global $publicize;
$this->publicize = $publicize = new Publicize;
add_action( 'init', array( $this, 'init' ) );
}
function init() {
// Show only to users with the capability required to manage their Publicize connections.
/**
* Filter what user capability is required to use the publicize form on the edit post page. Useful if publish post capability has been removed from role.
*
* @module publicize
*
* @since 4.1.0
*
* @param string $capability User capability needed to use publicize
*/
$capability = apply_filters( 'jetpack_publicize_capability', 'publish_posts' );
if ( ! current_user_can( $capability ) ) {
return;
}
// assets (css, js)
add_action( 'load-settings_page_sharing', array( &$this, 'load_assets' ) );
add_action( 'admin_head-post.php', array( &$this, 'post_page_metabox_assets' ) );
add_action( 'admin_head-post-new.php', array( &$this, 'post_page_metabox_assets' ) );
// management of publicize (sharing screen, ajax/lightbox popup, and metabox on post screen)
add_action( 'pre_admin_screen_sharing', array( &$this, 'admin_page' ) );
add_action( 'post_submitbox_misc_actions', array( &$this, 'post_page_metabox' ) );
}
/**
* If the ShareDaddy plugin is not active we need to add the sharing settings page to the menu still
*/
function sharing_menu() {
add_submenu_page( 'options-general.php', __( 'Sharing Settings', 'jetpack' ), __( 'Sharing', 'jetpack' ), 'publish_posts', 'sharing', array( &$this, 'management_page' ) );
}
/**
* Management page to load if Sharedaddy is not active so the 'pre_admin_screen_sharing' action exists.
*/
function management_page() { ?>
<div class="wrap">
<div class="icon32" id="icon-options-general"><br /></div>
<h1><?php _e( 'Sharing Settings', 'jetpack' ); ?></h1>
<?php
/** This action is documented in modules/sharedaddy/sharing.php */
do_action( 'pre_admin_screen_sharing' );
?>
</div> <?php
}
/**
* styling for the sharing screen and popups
* JS for the options and switching
*/
function load_assets() {
wp_enqueue_script(
'publicize',
plugins_url( 'assets/publicize.js', __FILE__ ),
array( 'jquery', 'thickbox' ),
'20121019'
);
if( is_rtl() ) {
wp_enqueue_style( 'publicize', plugins_url( 'assets/rtl/publicize-rtl.css', __FILE__ ), array(), '20120925' );
} else {
wp_enqueue_style( 'publicize', plugins_url( 'assets/publicize.css', __FILE__ ), array(), '20120925' );
}
add_thickbox();
}
public static function connected_notice( $service_name ) { ?>
<div class='updated'>
<p><?php
if ( defined( 'IS_WPCOM' ) && IS_WPCOM ) {
$platform = __( 'WordPress.com', 'jetpack' );
} else {
$platform = __( 'Jetpack', 'jetpack' );
}
printf(
__( 'You have successfully connected your %1$s account with %2$s.', '1: Service Name (Facebook, Twitter, ...), 2. WordPress.com or Jetpack', 'jetpack' ),
Publicize::get_service_label( $service_name ),
$platform
); ?></p>
</div><?php
}
public static function denied_notice() { ?>
<div class='updated'>
<p><?php _e ( "You have chosen not to connect your blog. Please click 'accept' when prompted if you wish to connect your accounts.", 'jetpack' ); ?></p>
</div><?php
}
/**
* Lists the current user's publicized accounts for the blog
* looks exactly like Publicize v1 for now, UI and functionality updates will come after the move to keyring
*/
function admin_page() {
$_blog_id = get_current_blog_id();
?>
<form action="" id="publicize-form">
<h2 id="publicize"><?php _e( 'Publicize', 'jetpack' ) ?></h2>
<?php
if ( ! empty( $_GET['action'] ) && 'deny' == $_GET['action'] ) {
$this->denied_notice();
}
?>
<p>
<?php esc_html_e( 'Connect your blog to popular social networking sites and automatically share new posts with your friends.', 'jetpack' ) ?>
<?php esc_html_e( 'You can make a connection for just yourself or for all users on your blog. Shared connections are marked with the (Shared) text.', 'jetpack' ); ?>
</p>
<?php
if ( $this->in_jetpack ) {
$doc_link = "http://jetpack.com/support/publicize/";
} else {
$doc_link = "http://en.support.wordpress.com/publicize/";
}
?>
<p>→ <a href="<?php echo esc_url( $doc_link ); ?>" target="_blank"><?php esc_html_e( 'More information on using Publicize.', 'jetpack' ); ?></a></p>
<div id="publicize-services-block">
<?php
$services = $this->publicize->get_services( 'all' );
$total_num_of_services = count ( $services );
$service_num = 0;?>
<div class='left'>
<?php
foreach ( $services as $name => $service ) :
$connect_url = $this->publicize->connect_url( $name );
if ( $service_num == ( round ( ( $total_num_of_services / 2 ), 0 ) ) )
echo "</div><div class='right'>";
$service_num++;
?>
<div class="publicize-service-entry" <?php if ( $service_num > 0 ): ?>class="connected"<?php endif; ?> >
<div id="<?php echo esc_attr( $name ); ?>" class="publicize-service-left">
<a href="<?php echo esc_url( $connect_url ); ?>" id="service-link-<?php echo esc_attr( $name ); ?>" target="_top"><?php echo $this->publicize->get_service_label( $name ); ?></a>
</div>
<div class="publicize-service-right">
<?php if ( $this->publicize->is_enabled( $name ) && $connections = $this->publicize->get_connections( $name ) ) : ?>
<ul>
<?php
foreach( $connections as $c ) :
$id = $this->publicize->get_connection_id( $c );
$disconnect_url = $this->publicize->disconnect_url( $name, $id );
$cmeta = $this->publicize->get_connection_meta( $c );
$profile_link = $this->publicize->get_profile_link( $name, $c );
$connection_display = $this->publicize->get_display_name( $name, $c );
$options_nonce = wp_create_nonce( 'options_page_' . $name . '_' . $id ); ?>
<?php if ( $this->publicize->show_options_popup( $name, $c ) ): ?>
<script type="text/javascript">
jQuery(document).ready( function($) {
showOptionsPage.call(
this,
'<?php echo esc_js( $name ); ?>',
'<?php echo esc_js( $options_nonce ); ?>',
'<?php echo esc_js( $id ); ?>'
);
} );
</script>
<?php endif; ?>
<li class="publicize-connection" data-connection-id="<?php echo esc_attr( $id ); ?>">
<?php esc_html_e( 'Connected as:', 'jetpack' ); ?>
<?php
if ( !empty( $profile_link ) ) : ?>
<a class="publicize-profile-link" href="<?php echo esc_url( $profile_link ); ?>" target="_top">
<?php echo esc_html( $connection_display ); ?>
</a><?php
else :
echo esc_html( $connection_display );
endif;
?>
<?php if ( 0 == $cmeta['connection_data']['user_id'] ) : ?>
<small>(<?php esc_html_e( 'Shared', 'jetpack' ); ?>)</small>
<?php if ( current_user_can( $this->publicize->GLOBAL_CAP ) ) : ?>
<a class="pub-disconnect-button" title="<?php esc_html_e( 'Disconnect', 'jetpack' ); ?>" href="<?php echo esc_url( $disconnect_url ); ?>" target="_top">×</a>
<?php endif; ?>
<?php else : ?>
<a class="pub-disconnect-button" title="<?php esc_html_e( 'Disconnect', 'jetpack' ); ?>" href="<?php echo esc_url( $disconnect_url ); ?>" target="_top">×</a>
<?php endif; ?>
<br/>
<div class="pub-connection-test test-in-progress" id="pub-connection-test-<?php echo esc_attr( $id ); ?>" >
</div>
</li>
<?php
endforeach;
?>
</ul>
<?php endif; ?>
<?php
$connections = $this->publicize->get_connections( $name );
if ( empty ( $connections ) ) { ?>
<a id="<?php echo esc_attr( $name ); ?>" class="publicize-add-connection button" href="<?php echo esc_url( $connect_url ); ?>" target="_top"><?php echo esc_html( __( 'Connect', 'jetpack' ) ); ?></a>
<?php } else { ?>
<a id="<?php echo esc_attr( $name ); ?>" class="publicize-add-connection button add-new" href="<?php echo esc_url( $connect_url ); ?>" target="_top"><?php echo esc_html( __( 'Add New', 'jetpack' ) ); ?></a>
<?php } ?>
</div>
</div>
<?php endforeach; ?>
</div>
<script>
(function($){
$('.pub-disconnect-button').on('click', function(e){ if ( confirm( '<?php echo esc_js( __( 'Are you sure you want to stop Publicizing posts to this connection?', 'jetpack' ) ); ?>' ) ) {
return true;
} else {
e.preventDefault();
return false;
}
})
})(jQuery);
</script>
</div>
<?php wp_nonce_field( "wpas_posts_{$_blog_id}", "_wpas_posts_{$_blog_id}_nonce" ); ?>
<input type="hidden" id="wpas_ajax_blog_id" name="wpas_ajax_blog_id" value="<?php echo $_blog_id; ?>" />
</form><?php
}
public static function global_checkbox( $service_name, $id ) {
global $publicize;
if ( current_user_can( $publicize->GLOBAL_CAP ) ) : ?>
<p>
<input id="globalize_<?php echo $service_name; ?>" type="checkbox" name="global" value="<?php echo wp_create_nonce( 'publicize-globalize-' . $id ) ?>" />
<label for="globalize_<?php echo $service_name; ?>"><?php _e( 'Make this connection available to all users of this blog?', 'jetpack' ); ?></label>
</p>
<?php endif;
}
function broken_connection( $service_name, $id ) { ?>
<div id="thickbox-content">
<div class='error'>
<p><?php printf( __( 'There was a problem connecting to %s. Please disconnect and try again.', 'jetpack' ), Publicize::get_service_label( $service_name ) ); ?></p>
</div>
</div><?php
}
public static function options_page_other( $service_name ) {
// Nonce check
check_admin_referer( "options_page_{$service_name}_" . $_REQUEST['connection'] );
?>
<div id="thickbox-content">
<?php
ob_start();
Publicize_UI::connected_notice( $service_name );
$update_notice = ob_get_clean();
if ( ! empty( $update_notice ) )
echo $update_notice;
?>
<?php Publicize_UI::global_checkbox( $service_name, $_REQUEST['connection'] ); ?>
<p style="text-align: center;">
<input type="submit" value="<?php esc_attr_e( 'OK', 'jetpack' ) ?>" class="button <?php echo $service_name; ?>-options save-options" name="save" data-connection="<?php echo esc_attr( $_REQUEST['connection'] ); ?>" rel="<?php echo wp_create_nonce( 'save_'.$service_name.'_token_' . $_REQUEST['connection'] ) ?>" />
</p> <br />
</div>
<?php
}
/**
* CSS for styling the publicize message box and counter that displays on the post page.
* There is also some JavaScript for length counting and some basic display effects.
*/
function post_page_metabox_assets() {
global $post;
$user_id = empty( $post->post_author ) ? $GLOBALS['user_ID'] : $post->post_author;
$default_prefix = $this->publicize->default_prefix;
$default_prefix = preg_replace( '/%([0-9])\$s/', "' + %\\1\$s + '", esc_js( $default_prefix ) );
$default_message = $this->publicize->default_message;
$default_message = preg_replace( '/%([0-9])\$s/', "' + %\\1\$s + '", esc_js( $default_message ) );
$default_suffix = $this->publicize->default_suffix;
$default_suffix = preg_replace( '/%([0-9])\$s/', "' + %\\1\$s + '", esc_js( $default_suffix ) ); ?>
<script type="text/javascript">
jQuery( function($) {
var wpasTitleCounter = $( '#wpas-title-counter' ),
wpasTwitterCheckbox = $( '.wpas-submit-twitter' ).length,
wpasTitle = $('#wpas-title').keyup( function() {
var length = wpasTitle.val().length;
wpasTitleCounter.text( length );
if ( wpasTwitterCheckbox && length > 256 ) {
wpasTitleCounter.addClass( 'wpas-twitter-length-limit' );
} else {
wpasTitleCounter.removeClass( 'wpas-twitter-length-limit' );
}
} ),
authClick = false;
$('#publicize-disconnected-form-show').click( function() {
$('#publicize-form').slideDown( 'fast' );
$(this).hide();
} );
$('#publicize-disconnected-form-hide').click( function() {
$('#publicize-form').slideUp( 'fast' );
$('#publicize-disconnected-form-show').show();
} );
$('#publicize-form-edit').click( function() {
$('#publicize-form').slideDown( 'fast', function() {
wpasTitle.focus();
if ( !wpasTitle.text() ) {
var url = $('#shortlink').length ? $('#shortlink').val() : '';
var defaultMessage = $.trim( '<?php printf( $default_prefix, 'url' ); printf( $default_message, '$("#title").val()', 'url' ); printf( $default_suffix, 'url' ); ?>' );
wpasTitle.append( defaultMessage.replace( /<[^>]+>/g,'') );
var selBeg = defaultMessage.indexOf( $("#title").val() );
if ( selBeg < 0 ) {
selBeg = 0;
selEnd = 0;
} else {
selEnd = selBeg + $("#title").val().length;
}
var domObj = wpasTitle.get(0);
if ( domObj.setSelectionRange ) {
domObj.setSelectionRange( selBeg, selEnd );
} else if ( domObj.createTextRange ) {
var r = domObj.createTextRange();
r.moveStart( 'character', selBeg );
r.moveEnd( 'character', selEnd );
r.select();
}
}
wpasTitle.keyup();
} );
$('#publicize-defaults').hide();
$(this).hide();
return false;
} );
$('#publicize-form-hide').click( function() {
var newList = $.map( $('#publicize-form').slideUp( 'fast' ).find( ':checked' ), function( el ) {
return $.trim( $(el).parent( 'label' ).text() );
} );
$('#publicize-defaults').html( '<strong>' + newList.join( '</strong>, <strong>' ) + '</strong>' ).show();
$('#publicize-form-edit').show();
return false;
} );
$('.authorize-link').click( function() {
if ( authClick ) {
return false;
}
authClick = true;
$(this).after( '<img src="images/loading.gif" class="alignleft" style="margin: 0 .5em" />' );
$.ajaxSetup( { async: false } );
if ( window.wp && window.wp.autosave ) {
window.wp.autosave.server.triggerSave();
} else {
autosave();
}
return true;
} );
$( '.pub-service' ).click( function() {
var service = $(this).data( 'service' ),
fakebox = '<input id="wpas-submit-' + service + '" type="hidden" value="1" name="wpas[submit][' + service + ']" />';
$( '#add-publicize-check' ).append( fakebox );
} );
publicizeConnTestStart = function() {
$( '#pub-connection-tests' )
.removeClass( 'below-h2' )
.removeClass( 'error' )
.removeClass( 'publicize-token-refresh-message' )
.addClass( 'test-in-progress' )
.html( '' );
$.post( ajaxurl, { action: 'test_publicize_conns' }, publicizeConnTestComplete );
}
publicizeConnRefreshClick = function( event ) {
event.preventDefault();
var popupURL = event.currentTarget.href;
var popupTitle = event.currentTarget.title;
// open a popup window
// when it is closed, kick off the tests again
var popupWin = window.open( popupURL, popupTitle, '' );
var popupWinTimer= window.setInterval( function() {
if ( popupWin.closed !== false ) {
window.clearInterval( popupWinTimer );
publicizeConnTestStart();
}
}, 500 );
}
publicizeConnTestComplete = function( response ) {
var testsSelector = $( '#pub-connection-tests' );
testsSelector
.removeClass( 'test-in-progress' )
.removeClass( 'below-h2' )
.removeClass( 'error' )
.removeClass( 'publicize-token-refresh-message' )
.html( '' );
// If any of the tests failed, show some stuff
var somethingShownAlready = false;
$.each( response.data, function( index, testResult ) {
// find the li for this connection
if ( ! testResult.connectionTestPassed ) {
if ( ! somethingShownAlready ) {
testsSelector
.addClass( 'below-h2' )
.addClass( 'error' )
.addClass( 'publicize-token-refresh-message' )
.append( "<p><?php echo esc_html( __( 'Before you hit Publish, please refresh the following connection(s) to make sure we can Publicize your post:', 'jetpack' ) ); ?></p>" );
somethingShownAlready = true;
}
if ( testResult.userCanRefresh ) {
testsSelector.append( '<p/>' );
$( '<a/>', {
'class' : 'pub-refresh-button button',
'title' : testResult.refreshText,
'href' : testResult.refreshURL,
'text' : testResult.refreshText,
'target' : '_refresh_' + testResult.serviceName
} )
.appendTo( testsSelector.children().last() )
.click( publicizeConnRefreshClick );
}
}
} );
}
$( document ).ready( function() {
// If we have the #pub-connection-tests div present, kick off the connection test
if ( $( '#pub-connection-tests' ).length ) {
publicizeConnTestStart();
}
} );
} );
</script>
<style type="text/css">
#publicize {
line-height: 1.5;
}
#publicize ul {
margin: 4px 0 4px 6px;
}
#publicize li {
margin: 0;
}
#publicize textarea {
margin: 4px 0 0;
width: 100%
}
#publicize ul.not-connected {
list-style: square;
padding-left: 1em;
}
.post-new-php .authorize-link, .post-php .authorize-link {
line-height: 1.5em;
}
.post-new-php .authorize-message, .post-php .authorize-message {
margin-bottom: 0;
}
#poststuff #publicize .updated p {
margin: .5em 0;
}
.wpas-twitter-length-limit {
color: red;
}
</style><?php
}
/**
* Controls the metabox that is displayed on the post page
* Allows the user to customize the message that will be sent out to the social network, as well as pick which
* networks to publish to. Also displays the character counter and some other information.
*/
function post_page_metabox() {
global $post;
if ( ! $this->publicize->post_type_is_publicizeable( $post->post_type ) )
return;
$user_id = empty( $post->post_author ) ? $GLOBALS['user_ID'] : $post->post_author;
$services = $this->publicize->get_services( 'connected' );
$available_services = $this->publicize->get_services( 'all' );
if ( ! is_array( $available_services ) )
$available_services = array();
if ( ! is_array( $services ) )
$services = array();
$active = array(); ?>
<div id="publicize" class="misc-pub-section misc-pub-section-last">
<?php
_e( 'Publicize:', 'jetpack' );
if ( 0 < count( $services ) ) :
ob_start();
?>
<div id="publicize-form" class="hide-if-js">
<ul>
<?php
// We can set an _all flag to indicate that this post is completely done as
// far as Publicize is concerned. Jetpack uses this approach. All published posts in Jetpack
// have Publicize disabled.
$all_done = get_post_meta( $post->ID, $this->publicize->POST_DONE . 'all', true ) || ( $this->in_jetpack && 'publish' == $post->post_status );
// We don't allow Publicizing to the same external id twice, to prevent spam
$service_id_done = (array) get_post_meta( $post->ID, $this->publicize->POST_SERVICE_DONE, true );
foreach ( $services as $name => $connections ) {
foreach ( $connections as $connection ) {
$connection_data = '';
if ( method_exists( $connection, 'get_meta' ) )
$connection_data = $connection->get_meta( 'connection_data' );
elseif ( ! empty( $connection['connection_data'] ) )
$connection_data = $connection['connection_data'];
/**
* Filter whether a post should be publicized to a given service.
*
* @module publicize
*
* @since 2.0.0
*
* @param bool true Should the post be publicized to a given service? Default to true.
* @param int $post->ID Post ID.
* @param string $name Service name.
* @param array $connection_data Array of information about all Publicize details for the site.
*/
if ( ! $continue = apply_filters( 'wpas_submit_post?', true, $post->ID, $name, $connection_data ) ) {
continue;
}
if ( ! empty( $connection->unique_id ) ) {
$unique_id = $connection->unique_id;
} else if ( ! empty( $connection['connection_data']['token_id'] ) ) {
$unique_id = $connection['connection_data']['token_id'];
}
// Should we be skipping this one?
$skip = (
(
in_array( $post->post_status, array( 'publish', 'draft', 'future' ) )
&&
get_post_meta( $post->ID, $this->publicize->POST_SKIP . $unique_id, true )
)
||
(
is_array( $connection )
&&
(
( isset( $connection['meta']['external_id'] ) && ! empty( $service_id_done[ $name ][ $connection['meta']['external_id'] ] ) )
||
// Jetpack's connection data looks a little different.
( isset( $connection['external_id'] ) && ! empty( $service_id_done[ $name ][ $connection['external_id'] ] ) )
)
)
);
// Was this connections (OR, old-format service) already Publicized to?
$done = ( 1 == get_post_meta( $post->ID, $this->publicize->POST_DONE . $unique_id, true ) || 1 == get_post_meta( $post->ID, $this->publicize->POST_DONE . $name, true ) ); // New and old style flags
// If this one has already been publicized to, don't let it happen again
$disabled = '';
if ( $done )
$disabled = ' disabled="disabled"';
// If this is a global connection and this user doesn't have enough permissions to modify
// those connections, don't let them change it
$cmeta = $this->publicize->get_connection_meta( $connection );
$hidden_checkbox = false;
if ( !$done && ( 0 == $cmeta['connection_data']['user_id'] && !current_user_can( $this->publicize->GLOBAL_CAP ) ) ) {
$disabled = ' disabled="disabled"';
/**
* Filters the checkboxes for global connections with non-prilvedged users.
*
* @module publicize
*
* @since 3.7.0
*
* @param bool $checked Indicates if this connection should be enabled. Default true.
* @param int $post->ID ID of the current post
* @param string $name Name of the connection (Facebook, Twitter, etc)
* @param array $connection Array of data about the connection.
*/
$hidden_checkbox = apply_filters( 'publicize_checkbox_global_default', true, $post->ID, $name, $connection );
}
// Determine the state of the checkbox (on/off) and allow filtering
$checked = $skip != 1 || $done;
/**
* Filter the checkbox state of each Publicize connection appearing in the post editor.
*
* @module publicize
*
* @since 2.0.1
*
* @param bool $checked Should the Publicize checkbox be enabled for a given service.
* @param int $post->ID Post ID.
* @param string $name Service name.
* @param array $connection Array of connection details.
*/
$checked = apply_filters( 'publicize_checkbox_default', $checked, $post->ID, $name, $connection );
// Force the checkbox to be checked if the post was DONE, regardless of what the filter does
if ( $done ) {
$checked = true;
}
// This post has been handled, so disable everything
if ( $all_done ) {
$disabled = ' disabled="disabled"';
}
$label = sprintf(
_x( '%1$s: %2$s', 'Service: Account connected as', 'jetpack' ),
esc_html( $this->publicize->get_service_label( $name ) ),
esc_html( $this->publicize->get_display_name( $name, $connection ) )
);
if ( !$skip || $done ) {
$active[] = $label;
}
?>
<li>
<label for="wpas-submit-<?php echo esc_attr( $unique_id ); ?>">
<input type="checkbox" name="wpas[submit][<?php echo $unique_id; ?>]" id="wpas-submit-<?php echo $unique_id; ?>" class="wpas-submit-<?php echo $name; ?>" value="1" <?php
checked( true, $checked );
echo $disabled;
?> />
<?php
if ( $hidden_checkbox ) {
// Need to submit a value to force a global connection to post
echo '<input type="hidden" name="wpas[submit][' . $unique_id . ']" value="1" />';
}
echo esc_html( $label );
?>
</label>
</li>
<?php
}
}
if ( $title = get_post_meta( $post->ID, $this->publicize->POST_MESS, true ) ) {
$title = esc_html( $title );
} else {
$title = '';
}
?>
</ul>
<label for="wpas-title"><?php _e( 'Custom Message:', 'jetpack' ); ?></label>
<span id="wpas-title-counter" class="alignright hide-if-no-js">0</span>
<textarea name="wpas_title" id="wpas-title"<?php disabled( $all_done ); ?>><?php echo $title; ?></textarea>
<a href="#" class="hide-if-no-js" id="publicize-form-hide"><?php _e( 'Hide', 'jetpack' ); ?></a>
<input type="hidden" name="wpas[0]" value="1" />
</div>
<?php if ( ! $all_done ) : ?>
<div id="pub-connection-tests"></div>
<?php endif; ?>
<?php // #publicize-form
$publicize_form = ob_get_clean();
else :
echo " " . __( 'Not Connected', 'jetpack' );
ob_start();
?>
<div id="publicize-form" class="hide-if-js">
<div id="add-publicize-check" style="display: none;"></div>
<strong><?php _e( 'Connect to', 'jetpack' ); ?>:</strong>
<ul class="not-connected">
<?php foreach ( $available_services as $service_name => $service ) : ?>
<li>
<a class="pub-service" data-service="<?php echo esc_attr( $service_name ); ?>" title="<?php echo esc_attr( sprintf( __( 'Connect and share your posts on %s', 'jetpack' ), $this->publicize->get_service_label( $service_name ) ) ); ?>" target="_blank" href="<?php echo $this->publicize->connect_url( $service_name ); ?>">
<?php echo esc_html( $this->publicize->get_service_label( $service_name ) ); ?>
</a>
</li>
<?php endforeach; ?>
</ul>
<?php if ( 0 < count( $services ) ) : ?>
<a href="#" class="hide-if-no-js" id="publicize-form-hide"><?php _e( 'Hide', 'jetpack' ); ?></a>
<?php else : ?>
<a href="#" class="hide-if-no-js" id="publicize-disconnected-form-hide"><?php _e( 'Hide', 'jetpack' ); ?></a>
<?php endif; ?>
</div> <?php // #publicize-form
$publicize_form = ob_get_clean();
endif;
?>
<span id="publicize-defaults"><strong><?php echo join( '</strong>, <strong>', array_map( 'esc_html', $active ) ); ?></strong></span><br />
<?php if ( 0 < count( $services ) ) : ?>
<a href="#" id="publicize-form-edit"><?php _e( 'Edit Details', 'jetpack' ); ?></a> <a href="<?php echo admin_url( 'options-general.php?page=sharing' ); ?>" target="_blank"><?php _e( 'Settings', 'jetpack' ); ?></a><br />
<?php else : ?>
<a href="#" id="publicize-disconnected-form-show"><?php _e( 'Show', 'jetpack' ); ?></a><br />
<?php endif; ?>
<?php
/**
* Filter the Publicize details form.
*
* @module publicize
*
* @since 2.0.0
*
* @param string $publicize_form Publicize Details form appearing above Publish button in the editor.
*/
echo apply_filters( 'publicize_form', $publicize_form );
?>
</div> <?php // #publicize
}
}
| {
"content_hash": "edab434f91fc451cfca6b41ad34f9b21",
"timestamp": "",
"source": "github",
"line_count": 776,
"max_line_length": 325,
"avg_line_length": 35.402061855670105,
"alnum_prop": 0.5820471753057659,
"repo_name": "jmelgarejo/Clan",
"id": "7d5e3f36f6b985108a857fa75322e994f3aa0563",
"size": "27474",
"binary": false,
"copies": "3",
"ref": "refs/heads/master",
"path": "wordpress/wp-content/plugins/jetpack/modules/publicize/ui.php",
"mode": "33261",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "5051626"
},
{
"name": "HTML",
"bytes": "53721"
},
{
"name": "JavaScript",
"bytes": "4224919"
},
{
"name": "PHP",
"bytes": "26168285"
},
{
"name": "Shell",
"bytes": "5177"
},
{
"name": "Smarty",
"bytes": "33"
}
],
"symlink_target": ""
} |
module IncomeTax
module Countries
class UnitedStates
class NorthDakota < State
register 'North Dakota', 'ND'
standard_deduction = 3900
level standard_deduction + 0, '3.22%'
level standard_deduction + 73_800, '1.22%'
level standard_deduction + 148_850, '2.27%'
level standard_deduction + 226_850, '2.52%'
level standard_deduction + 405_100, '2.93%'
remainder '3.22%'
end
end
end
end
| {
"content_hash": "15698fd327db5b45befd2f04f3d42f7f",
"timestamp": "",
"source": "github",
"line_count": 17,
"max_line_length": 54,
"avg_line_length": 28.470588235294116,
"alnum_prop": 0.5847107438016529,
"repo_name": "askl56/income-tax",
"id": "c98cd09a2a762f10418beaa98f7ef2859fd8c0fa",
"size": "484",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "lib/income_tax/countries/united_states/north_dakota.rb",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Ruby",
"bytes": "1817082"
}
],
"symlink_target": ""
} |
using System.Windows;
namespace Calculateur.View
{
/// <summary>
/// Logique d'interaction pour AspectBonusForm.xaml
/// </summary>
public partial class AspectBonusForm : Window
{
public AspectBonusForm()
{
InitializeComponent();
}
private void Button_Click(object sender, RoutedEventArgs e)
{
Close();
}
private void AspectBonusForm_OnLoaded(object sender, RoutedEventArgs e)
{
var viewModel = DataContext as ViewModel.AspectBonusForm;
if (viewModel != null)
viewModel.CloseWindow = Close;
else
Close();
}
}
}
| {
"content_hash": "027b0262e5618c8859b007fe04520dcd",
"timestamp": "",
"source": "github",
"line_count": 30,
"max_line_length": 79,
"avg_line_length": 23.466666666666665,
"alnum_prop": 0.5568181818181818,
"repo_name": "Jupotter/Terre-Natale-Calculateur",
"id": "4cf223215cff0a07db0c77523963cf4378caa217",
"size": "706",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "Calculateur/View/AspectBonusForm.xaml.cs",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "C#",
"bytes": "179492"
}
],
"symlink_target": ""
} |
/*!
* Start Bootstrap - Grayscale Bootstrap Theme (http://startbootstrap.com)
* Code licensed under the Apache License v2.0.
* For details, see http://www.apache.org/licenses/LICENSE-2.0.
*/
// jQuery to collapse the navbar on scroll
$(window).scroll(function() {
if ($(".navbar").offset().top > 50) {
$(".navbar-fixed-top").addClass("top-nav-collapse");
} else {
$(".navbar-fixed-top").removeClass("top-nav-collapse");
}
});
// jQuery for page scrolling feature - requires jQuery Easing plugin
$(function() {
$('a.page-scroll').bind('click', function(event) {
var $anchor = $(this);
$('html, body').stop().animate({
scrollTop: $($anchor.attr('href')).offset().top
}, 1500, 'easeInOutExpo');
event.preventDefault();
});
});
// Closes the Responsive Menu on Menu Item Click
$('.navbar-collapse ul li a').click(function() {
$('.navbar-toggle:visible').click();
});
// remove the focused state after click,
// otherwise bootstrap will still highlight the link
$("a").mouseup(function(){
$(this).blur();
})
function init() {
// Basic options for a simple Google Map
// For more options see: https://developers.google.com/maps/documentation/javascript/reference#MapOptions
var mapOptions = {
// How zoomed in you want the map to start at (always required)
zoom: 15,
// The latitude and longitude to center the map (always required)
center: new google.maps.LatLng(40.6700, -73.9400), // New York
// Disables the default Google Maps UI components
disableDefaultUI: true,
scrollwheel: false,
draggable: false,
// How you would like to style the map.
// This is where you would paste any style found on Snazzy Maps.
styles: [{
"featureType": "water",
"elementType": "geometry",
"stylers": [{
"color": "#000000"
}, {
"lightness": 17
}]
}, {
"featureType": "landscape",
"elementType": "geometry",
"stylers": [{
"color": "#000000"
}, {
"lightness": 20
}]
}, {
"featureType": "road.highway",
"elementType": "geometry.fill",
"stylers": [{
"color": "#000000"
}, {
"lightness": 17
}]
}, {
"featureType": "road.highway",
"elementType": "geometry.stroke",
"stylers": [{
"color": "#000000"
}, {
"lightness": 29
}, {
"weight": 0.2
}]
}, {
"featureType": "road.arterial",
"elementType": "geometry",
"stylers": [{
"color": "#000000"
}, {
"lightness": 18
}]
}, {
"featureType": "road.local",
"elementType": "geometry",
"stylers": [{
"color": "#000000"
}, {
"lightness": 16
}]
}, {
"featureType": "poi",
"elementType": "geometry",
"stylers": [{
"color": "#000000"
}, {
"lightness": 21
}]
}, {
"elementType": "labels.text.stroke",
"stylers": [{
"visibility": "on"
}, {
"color": "#000000"
}, {
"lightness": 16
}]
}, {
"elementType": "labels.text.fill",
"stylers": [{
"saturation": 36
}, {
"color": "#000000"
}, {
"lightness": 40
}]
}, {
"elementType": "labels.icon",
"stylers": [{
"visibility": "off"
}]
}, {
"featureType": "transit",
"elementType": "geometry",
"stylers": [{
"color": "#000000"
}, {
"lightness": 19
}]
}, {
"featureType": "administrative",
"elementType": "geometry.fill",
"stylers": [{
"color": "#000000"
}, {
"lightness": 20
}]
}, {
"featureType": "administrative",
"elementType": "geometry.stroke",
"stylers": [{
"color": "#000000"
}, {
"lightness": 17
}, {
"weight": 1.2
}]
}]
};
// Get the HTML DOM element that will contain your map
// We are using a div with id="map" seen below in the <body>
var mapElement = document.getElementById('map');
// Create the Google Map using out element and options defined above
var map = new google.maps.Map(mapElement, mapOptions);
// Custom Map Marker Icon - Customize the map-marker.png file to customize your icon
var image = 'img/map-marker.png';
var myLatLng = new google.maps.LatLng(40.6700, -73.9400);
var beachMarker = new google.maps.Marker({
position: myLatLng,
map: map,
icon: image
});
}
| {
"content_hash": "c471dca695575f37c9930cdc87e79df8",
"timestamp": "",
"source": "github",
"line_count": 180,
"max_line_length": 109,
"avg_line_length": 29.733333333333334,
"alnum_prop": 0.4581464872944694,
"repo_name": "konstructs/konstructs.github.io",
"id": "d879a380923c9bc272a5f4c2876b3503a5552f9c",
"size": "5352",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "js/grayscale.js",
"mode": "33261",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "118001"
},
{
"name": "HTML",
"bytes": "12770"
},
{
"name": "JavaScript",
"bytes": "5780"
},
{
"name": "Makefile",
"bytes": "801"
},
{
"name": "Ruby",
"bytes": "49"
}
],
"symlink_target": ""
} |
namespace WLW.Twitter.Bitly.Plugin.OAuth
{
interface IOAuthSettings
{
string AccessToken
{
get;set;
}
string AccessSecret
{
get;set;
}
}
}
| {
"content_hash": "9cfdeb124f6b143332789721da4676e2",
"timestamp": "",
"source": "github",
"line_count": 15,
"max_line_length": 40,
"avg_line_length": 15.933333333333334,
"alnum_prop": 0.4393305439330544,
"repo_name": "sstjean/WLWTwitterBitlyPlugin",
"id": "785d830ff45ac4624a07d9b55a151a291bf540bb",
"size": "639",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "WLW.Twitter.Bitly.Plugin/OAuth1.0/IOAuthSettings.cs",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C#",
"bytes": "129852"
}
],
"symlink_target": ""
} |
package ingvar.android.processor.examples.dictionary.storage;
import android.database.sqlite.SQLiteOpenHelper;
import ingvar.android.literepo.LiteProvider;
/**
* Created by Igor Zubenko on 2015.04.09.
*/
public class DictionaryProvider extends LiteProvider {
@Override
protected SQLiteOpenHelper provideOpenHelper() {
return new DictionaryHelper(getContext());
}
}
| {
"content_hash": "3511cfc9257d297f64e5f0a83f05f1f1",
"timestamp": "",
"source": "github",
"line_count": 17,
"max_line_length": 61,
"avg_line_length": 23.058823529411764,
"alnum_prop": 0.7627551020408163,
"repo_name": "orwir/processor",
"id": "e7c4f81c94d743f22a1754b7bc96e58d947450f5",
"size": "392",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "examples/src/main/java/ingvar/android/processor/examples/dictionary/storage/DictionaryProvider.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Java",
"bytes": "232227"
}
],
"symlink_target": ""
} |
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("Problem 7. Training Hall Equipment")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("Problem 7. Training Hall Equipment")]
[assembly: AssemblyCopyright("Copyright © 2017")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("e915d37f-317b-44be-a012-7468fdebc95b")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
| {
"content_hash": "baf009a2c4caf39d668fc493789088bc",
"timestamp": "",
"source": "github",
"line_count": 36,
"max_line_length": 84,
"avg_line_length": 39.888888888888886,
"alnum_prop": 0.7486072423398329,
"repo_name": "Sleeya/TechnologyFundamentals",
"id": "465fa07f471d83e903657f3d7d4ce5f5f27c4aa0",
"size": "1439",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "ProgramingFundamentals/Csharp Basics – More Exercises/Problem 7. Training Hall Equipment/Properties/AssemblyInfo.cs",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "ASP",
"bytes": "608"
},
{
"name": "Batchfile",
"bytes": "28266"
},
{
"name": "C#",
"bytes": "886107"
},
{
"name": "CSS",
"bytes": "1111377"
},
{
"name": "HTML",
"bytes": "94698"
},
{
"name": "Java",
"bytes": "58890"
},
{
"name": "JavaScript",
"bytes": "283355"
},
{
"name": "PHP",
"bytes": "243198"
},
{
"name": "PLSQL",
"bytes": "1196324"
},
{
"name": "SQLPL",
"bytes": "6336"
},
{
"name": "Shell",
"bytes": "28232"
}
],
"symlink_target": ""
} |
package ninja.animation.pattern.rotating.entrance;
import android.animation.AnimatorSet;
import android.animation.ObjectAnimator;
import android.view.View;
import ninja.Config;
import ninja.animation.IAnimationPattern;
import ninja.animation.Properties;
import ninja.log.NinjaLog;
public class RotateInUpRightAnimator implements IAnimationPattern {
private static final String TAG = RotateInUpRightAnimator.class.getName();
/**
* Get animation prepare pattern
*
* @param animatorSet Animation controller using to register animation pattern
* @param target Animation target view
*/
@Override
public AnimatorSet getPattern(AnimatorSet animatorSet, View target) {
if (Config.IS_DEBUG) {
NinjaLog.enter(TAG, "getPattern(AnimatorSet, View)");
}
float x = target.getWidth() - target.getPaddingRight();
float y = target.getHeight() - target.getPaddingBottom();
animatorSet.playTogether(
ObjectAnimator.ofFloat(target, Properties.ROTATION, -90, 0, 0),
ObjectAnimator.ofFloat(target, Properties.ALPHA, 0, 1, 1),
ObjectAnimator.ofFloat(target, Properties.PIVOT_X, x, x, (target.getPaddingLeft() + target.getWidth() + target.getPaddingRight()) / 2),
ObjectAnimator.ofFloat(target, Properties.PIVOT_Y, y, y, (target.getPaddingTop() + target.getHeight() + target.getPaddingBottom()) / 2));
if (Config.IS_DEBUG) {
NinjaLog.exit(TAG, "getPattern(AnimatorSet, View)");
}
return animatorSet;
}
}
| {
"content_hash": "58db9eab8abd93274ca7efcbf389e5c4",
"timestamp": "",
"source": "github",
"line_count": 42,
"max_line_length": 153,
"avg_line_length": 37.833333333333336,
"alnum_prop": 0.6821900566393958,
"repo_name": "MrNinja/AnimationPattern",
"id": "84ee9133daeb3ce0e62f152363aa26bc254d4ec3",
"size": "2729",
"binary": false,
"copies": "1",
"ref": "refs/heads/development",
"path": "animation/src/main/java/ninja/animation/pattern/rotating/entrance/RotateInUpRightAnimator.java",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Java",
"bytes": "198331"
}
],
"symlink_target": ""
} |
package org.jongo;
import com.mongodb.DBCollection;
import com.mongodb.DBObject;
import com.mongodb.ReadPreference;
import org.jongo.marshall.Unmarshaller;
import org.jongo.query.Query;
import org.jongo.query.QueryFactory;
import static org.jongo.ResultHandlerFactory.newResultHandler;
public class FindOne {
private final Unmarshaller unmarshaller;
private final DBCollection collection;
private final ReadPreference readPreference;
private final Query query;
private Query fields, orderBy;
private final QueryFactory queryFactory;
FindOne(DBCollection collection, ReadPreference readPreference, Unmarshaller unmarshaller, QueryFactory queryFactory, String query, Object... parameters) {
this.unmarshaller = unmarshaller;
this.collection = collection;
this.readPreference = readPreference;
this.queryFactory = queryFactory;
this.query = this.queryFactory.createQuery(query, parameters);
}
public <T> T as(final Class<T> clazz) {
return map(newResultHandler(clazz, unmarshaller));
}
public <T> T map(ResultHandler<T> resultHandler) {
DBObject result = collection.findOne(query.toDBObject(), getFieldsAsDBObject(), getOrderByAsDBObject(), readPreference);
return result == null ? null : resultHandler.map(result);
}
public FindOne projection(String fields) {
this.fields = queryFactory.createQuery(fields);
return this;
}
public FindOne projection(String fields, Object... parameters) {
this.fields = queryFactory.createQuery(fields, parameters);
return this;
}
public FindOne orderBy(String orderBy) {
this.orderBy = queryFactory.createQuery(orderBy);
return this;
}
private DBObject getFieldsAsDBObject() {
return fields == null ? null : fields.toDBObject();
}
private DBObject getOrderByAsDBObject() {
return orderBy == null ? null : orderBy.toDBObject();
}
}
| {
"content_hash": "c1daa1345171b041369537db811d187c",
"timestamp": "",
"source": "github",
"line_count": 62,
"max_line_length": 159,
"avg_line_length": 32.12903225806452,
"alnum_prop": 0.7108433734939759,
"repo_name": "edwardmlyte/jongo",
"id": "271a91676842750c008636f8c6f2689c48042565",
"size": "2676",
"binary": false,
"copies": "9",
"ref": "refs/heads/master",
"path": "src/main/java/org/jongo/FindOne.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Java",
"bytes": "371856"
},
{
"name": "Shell",
"bytes": "1929"
}
],
"symlink_target": ""
} |
package com.facebook.buck.rules;
import com.facebook.buck.io.ProjectFilesystem;
import com.facebook.buck.model.BuildTarget;
import com.google.common.annotations.Beta;
import com.google.common.base.Function;
import com.google.common.base.Supplier;
import com.google.common.base.Suppliers;
import com.google.common.collect.ImmutableSortedSet;
import java.nio.file.Path;
/**
* Standard set of parameters that is passed to all build rules.
*/
@Beta
public class BuildRuleParams {
private final BuildTarget buildTarget;
private final Supplier<ImmutableSortedSet<BuildRule>> declaredDeps;
private final Supplier<ImmutableSortedSet<BuildRule>> extraDeps;
private final Supplier<ImmutableSortedSet<BuildRule>> totalDeps;
private final ProjectFilesystem projectFilesystem;
private final RuleKeyBuilderFactory ruleKeyBuilderFactory;
private final TargetGraph targetGraph;
public BuildRuleParams(
BuildTarget buildTarget,
final Supplier<ImmutableSortedSet<BuildRule>> declaredDeps,
final Supplier<ImmutableSortedSet<BuildRule>> extraDeps,
ProjectFilesystem projectFilesystem,
RuleKeyBuilderFactory ruleKeyBuilderFactory,
TargetGraph targetGraph) {
this.buildTarget = buildTarget;
this.declaredDeps = Suppliers.memoize(declaredDeps);
this.extraDeps = Suppliers.memoize(extraDeps);
this.projectFilesystem = projectFilesystem;
this.ruleKeyBuilderFactory = ruleKeyBuilderFactory;
this.targetGraph = targetGraph;
this.totalDeps = Suppliers.memoize(
new Supplier<ImmutableSortedSet<BuildRule>>() {
@Override
public ImmutableSortedSet<BuildRule> get() {
return ImmutableSortedSet.<BuildRule>naturalOrder()
.addAll(declaredDeps.get())
.addAll(extraDeps.get())
.build();
}
});
}
public BuildRuleParams copyWithExtraDeps(Supplier<ImmutableSortedSet<BuildRule>> extraDeps) {
return copyWithDeps(declaredDeps, extraDeps);
}
public BuildRuleParams appendExtraDeps(
final Supplier<? extends Iterable<? extends BuildRule>> additional) {
return copyWithDeps(
declaredDeps,
new Supplier<ImmutableSortedSet<BuildRule>>() {
@Override
public ImmutableSortedSet<BuildRule> get() {
return ImmutableSortedSet.<BuildRule>naturalOrder()
.addAll(extraDeps.get())
.addAll(additional.get())
.build();
}
});
}
public BuildRuleParams appendExtraDeps(Iterable<? extends BuildRule> additional) {
return appendExtraDeps(Suppliers.ofInstance(additional));
}
public BuildRuleParams copyWithDeps(
Supplier<ImmutableSortedSet<BuildRule>> declaredDeps,
Supplier<ImmutableSortedSet<BuildRule>> extraDeps) {
return copyWithChanges(buildTarget, declaredDeps, extraDeps);
}
public BuildRuleParams copyWithBuildTarget(BuildTarget target) {
return copyWithChanges(target, declaredDeps, extraDeps);
}
public BuildRuleParams copyWithChanges(
BuildTarget buildTarget,
Supplier<ImmutableSortedSet<BuildRule>> declaredDeps,
Supplier<ImmutableSortedSet<BuildRule>> extraDeps) {
return new BuildRuleParams(
buildTarget,
declaredDeps,
extraDeps,
projectFilesystem,
ruleKeyBuilderFactory,
targetGraph);
}
public BuildTarget getBuildTarget() {
return buildTarget;
}
public ImmutableSortedSet<BuildRule> getDeps() {
return totalDeps.get();
}
public ImmutableSortedSet<BuildRule> getDeclaredDeps() {
return declaredDeps.get();
}
public ImmutableSortedSet<BuildRule> getExtraDeps() {
return extraDeps.get();
}
public Function<Path, Path> getPathAbsolutifier() {
return projectFilesystem.getAbsolutifier();
}
public ProjectFilesystem getProjectFilesystem() {
return projectFilesystem;
}
public RuleKeyBuilderFactory getRuleKeyBuilderFactory() {
return ruleKeyBuilderFactory;
}
public TargetGraph getTargetGraph() {
return targetGraph;
}
}
| {
"content_hash": "75398cf99d76ce9c9ec1e844758ab7c0",
"timestamp": "",
"source": "github",
"line_count": 135,
"max_line_length": 95,
"avg_line_length": 30.333333333333332,
"alnum_prop": 0.7230769230769231,
"repo_name": "MarkRunWu/buck",
"id": "65b1505708d83c881a153841a463b43c586a1d68",
"size": "4700",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "src/com/facebook/buck/rules/BuildRuleParams.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Batchfile",
"bytes": "638"
},
{
"name": "C",
"bytes": "244480"
},
{
"name": "C++",
"bytes": "2963"
},
{
"name": "CSS",
"bytes": "54863"
},
{
"name": "D",
"bytes": "623"
},
{
"name": "Groff",
"bytes": "440"
},
{
"name": "HTML",
"bytes": "4401"
},
{
"name": "IDL",
"bytes": "128"
},
{
"name": "Java",
"bytes": "8604085"
},
{
"name": "JavaScript",
"bytes": "930007"
},
{
"name": "Makefile",
"bytes": "1791"
},
{
"name": "Matlab",
"bytes": "47"
},
{
"name": "OCaml",
"bytes": "2956"
},
{
"name": "Objective-C",
"bytes": "37573"
},
{
"name": "Objective-C++",
"bytes": "34"
},
{
"name": "PowerShell",
"bytes": "143"
},
{
"name": "Python",
"bytes": "207256"
},
{
"name": "Shell",
"bytes": "29378"
},
{
"name": "Yacc",
"bytes": "323"
}
],
"symlink_target": ""
} |
// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "chrome/browser/extensions/convert_user_script.h"
#include <string>
#include <vector>
#include "base/base64.h"
#include "base/file_util.h"
#include "base/files/file_path.h"
#include "base/files/scoped_temp_dir.h"
#include "base/json/json_file_value_serializer.h"
#include "base/path_service.h"
#include "base/strings/string_util.h"
#include "base/strings/utf_string_conversions.h"
#include "chrome/browser/extensions/user_script_master.h"
#include "chrome/common/chrome_paths.h"
#include "crypto/sha2.h"
#include "extensions/common/constants.h"
#include "extensions/common/extension.h"
#include "extensions/common/file_util.h"
#include "extensions/common/manifest_constants.h"
#include "extensions/common/user_script.h"
#include "url/gurl.h"
namespace extensions {
namespace keys = manifest_keys;
namespace values = manifest_values;
scoped_refptr<Extension> ConvertUserScriptToExtension(
const base::FilePath& user_script_path, const GURL& original_url,
const base::FilePath& extensions_dir, base::string16* error) {
std::string content;
if (!base::ReadFileToString(user_script_path, &content)) {
*error = base::ASCIIToUTF16("Could not read source file.");
return NULL;
}
if (!base::IsStringUTF8(content)) {
*error = base::ASCIIToUTF16("User script must be UTF8 encoded.");
return NULL;
}
UserScript script;
if (!UserScriptMaster::ScriptReloader::ParseMetadataHeader(content,
&script)) {
*error = base::ASCIIToUTF16("Invalid script header.");
return NULL;
}
base::FilePath install_temp_dir =
file_util::GetInstallTempDir(extensions_dir);
if (install_temp_dir.empty()) {
*error = base::ASCIIToUTF16(
"Could not get path to profile temporary directory.");
return NULL;
}
base::ScopedTempDir temp_dir;
if (!temp_dir.CreateUniqueTempDirUnderPath(install_temp_dir)) {
*error = base::ASCIIToUTF16("Could not create temporary directory.");
return NULL;
}
// Create the manifest
scoped_ptr<base::DictionaryValue> root(new base::DictionaryValue);
std::string script_name;
if (!script.name().empty() && !script.name_space().empty())
script_name = script.name_space() + "/" + script.name();
else
script_name = original_url.spec();
// Create the public key.
// User scripts are not signed, but the public key for an extension doubles as
// its unique identity, and we need one of those. A user script's unique
// identity is its namespace+name, so we hash that to create a public key.
// There will be no corresponding private key, which means user scripts cannot
// be auto-updated, or claimed in the gallery.
char raw[crypto::kSHA256Length] = {0};
std::string key;
crypto::SHA256HashString(script_name, raw, crypto::kSHA256Length);
base::Base64Encode(std::string(raw, crypto::kSHA256Length), &key);
// The script may not have a name field, but we need one for an extension. If
// it is missing, use the filename of the original URL.
if (!script.name().empty())
root->SetString(keys::kName, script.name());
else
root->SetString(keys::kName, original_url.ExtractFileName());
// Not all scripts have a version, but we need one. Default to 1.0 if it is
// missing.
if (!script.version().empty())
root->SetString(keys::kVersion, script.version());
else
root->SetString(keys::kVersion, "1.0");
root->SetString(keys::kDescription, script.description());
root->SetString(keys::kPublicKey, key);
root->SetBoolean(keys::kConvertedFromUserScript, true);
base::ListValue* js_files = new base::ListValue();
js_files->Append(new base::StringValue("script.js"));
// If the script provides its own match patterns, we use those. Otherwise, we
// generate some using the include globs.
base::ListValue* matches = new base::ListValue();
if (!script.url_patterns().is_empty()) {
for (URLPatternSet::const_iterator i = script.url_patterns().begin();
i != script.url_patterns().end(); ++i) {
matches->Append(new base::StringValue(i->GetAsString()));
}
} else {
// TODO(aa): Derive tighter matches where possible.
matches->Append(new base::StringValue("http://*/*"));
matches->Append(new base::StringValue("https://*/*"));
}
// Read the exclude matches, if any are present.
base::ListValue* exclude_matches = new base::ListValue();
if (!script.exclude_url_patterns().is_empty()) {
for (URLPatternSet::const_iterator i =
script.exclude_url_patterns().begin();
i != script.exclude_url_patterns().end(); ++i) {
exclude_matches->Append(new base::StringValue(i->GetAsString()));
}
}
base::ListValue* includes = new base::ListValue();
for (size_t i = 0; i < script.globs().size(); ++i)
includes->Append(new base::StringValue(script.globs().at(i)));
base::ListValue* excludes = new base::ListValue();
for (size_t i = 0; i < script.exclude_globs().size(); ++i)
excludes->Append(new base::StringValue(script.exclude_globs().at(i)));
base::DictionaryValue* content_script = new base::DictionaryValue();
content_script->Set(keys::kMatches, matches);
content_script->Set(keys::kExcludeMatches, exclude_matches);
content_script->Set(keys::kIncludeGlobs, includes);
content_script->Set(keys::kExcludeGlobs, excludes);
content_script->Set(keys::kJs, js_files);
if (script.run_location() == UserScript::DOCUMENT_START)
content_script->SetString(keys::kRunAt, values::kRunAtDocumentStart);
else if (script.run_location() == UserScript::DOCUMENT_END)
content_script->SetString(keys::kRunAt, values::kRunAtDocumentEnd);
else if (script.run_location() == UserScript::DOCUMENT_IDLE)
// This is the default, but store it just in case we change that.
content_script->SetString(keys::kRunAt, values::kRunAtDocumentIdle);
base::ListValue* content_scripts = new base::ListValue();
content_scripts->Append(content_script);
root->Set(keys::kContentScripts, content_scripts);
base::FilePath manifest_path = temp_dir.path().Append(kManifestFilename);
JSONFileValueSerializer serializer(manifest_path);
if (!serializer.Serialize(*root)) {
*error = base::ASCIIToUTF16("Could not write JSON.");
return NULL;
}
// Write the script file.
if (!base::CopyFile(user_script_path,
temp_dir.path().AppendASCII("script.js"))) {
*error = base::ASCIIToUTF16("Could not copy script file.");
return NULL;
}
// TODO(rdevlin.cronin): Continue removing std::string errors and replacing
// with base::string16
std::string utf8_error;
scoped_refptr<Extension> extension = Extension::Create(
temp_dir.path(),
Manifest::INTERNAL,
*root,
Extension::NO_FLAGS,
&utf8_error);
*error = base::UTF8ToUTF16(utf8_error);
if (!extension.get()) {
NOTREACHED() << "Could not init extension " << *error;
return NULL;
}
temp_dir.Take(); // The caller takes ownership of the directory.
return extension;
}
} // namespace extensions
| {
"content_hash": "9de8d5598666d3d1fc04bbebe39d1c30",
"timestamp": "",
"source": "github",
"line_count": 193,
"max_line_length": 80,
"avg_line_length": 37.41968911917098,
"alnum_prop": 0.6876211575740792,
"repo_name": "andykimpe/chromium-test-npapi",
"id": "1a7d48f1c2e4b903f0bcf2a31d4e01423ea2d3ef",
"size": "7222",
"binary": false,
"copies": "9",
"ref": "refs/heads/master",
"path": "chrome/browser/extensions/convert_user_script.cc",
"mode": "33261",
"license": "bsd-3-clause",
"language": [
{
"name": "AppleScript",
"bytes": "6973"
},
{
"name": "Assembly",
"bytes": "24741"
},
{
"name": "Batchfile",
"bytes": "6704"
},
{
"name": "C",
"bytes": "3578395"
},
{
"name": "C++",
"bytes": "197882186"
},
{
"name": "CSS",
"bytes": "774304"
},
{
"name": "HTML",
"bytes": "16781925"
},
{
"name": "Java",
"bytes": "5176812"
},
{
"name": "JavaScript",
"bytes": "9838003"
},
{
"name": "Makefile",
"bytes": "36405"
},
{
"name": "Objective-C",
"bytes": "1135377"
},
{
"name": "Objective-C++",
"bytes": "7082902"
},
{
"name": "PLpgSQL",
"bytes": "141320"
},
{
"name": "Perl",
"bytes": "69392"
},
{
"name": "Protocol Buffer",
"bytes": "360984"
},
{
"name": "Python",
"bytes": "5577847"
},
{
"name": "Rebol",
"bytes": "262"
},
{
"name": "Shell",
"bytes": "434741"
},
{
"name": "Standard ML",
"bytes": "1589"
},
{
"name": "nesC",
"bytes": "15206"
}
],
"symlink_target": ""
} |
title: Na jeho obraz
date: 17/07/2022
---
> <p></p>
> Lebo ktorých vopred poznal, tých aj predurčil, aby boli podobní obrazu jeho Syna, aby on bol prvorodený medzi mnohými bratmi. (Rim 8,29)
**Osobné štúdium**
Na počiatku nás Boh stvoril na svoj obraz (1Moj 1,27). Jeho stvorenstvo je však porušené hriechom. Táto skaza je viditeľná všade. Všetci sme boli skazení hriechom (Rim 3,10–19). Boh však túži vrátiť nám to, o čo sme následkom hriechu prišli. Práve do tohto kontextu zapadá náš úvodný verš. Odhaľuje Boží plán, že tí, ktorí podriadia svoj život Svätému Duchu, môžu byť „podobní obrazu jeho Syna“ (Rim 8,29).
Je tu však aj ďalší rozmer. „V ľuďoch má byť obnovený Boží obraz. V dokonalej povahe Božieho ľudu je zahrnutá aj Božia česť i česť Kristova.“ (DA 671; TV 471)
**Ako rozumieš vyššie uvedenému citátu? Uvažuj o ňom v kontexte nasledujúcich veršov.**
`Jób 1`
`Mt 5,16`
`1Kor 4,9`
`Ef 3,10`
Ako kresťania nesmieme nikdy zabúdať, že sa nachádzame uprostred kozmickej drámy. Všade okolo nás sa odohráva veľký spor medzi Kristom a satanom. Tento boj má mnoho podôb a prejavuje sa rôznymi spôsobmi. A hoci je veľa toho skrytého, môžeme pochopiť, že ako Kristovi nasledovníci máme v tejto dráme svoju úlohu a Kristovi môžeme vzdať česť prostredníctvom našich životov.
**Aplikácia**
`Predstav si, že si na ihrisku veľkého štadióna. Na tribúne na jednej strane sedia nebeské bytosti verné Pánovi a na druhej strane sú bytosti, ktoré padli s Luciferom. Ak by sa tvoj život za posledných dvadsaťštyri hodín odohrával na tomto ihrisku, ktorá strana by ti tlieskala viac? Čo naznačuje tvoja odpoveď?`
---
#### Dodatečné otázky k diskuzi
`Jaký máš vztah k obrazům? K čemu mají sloužit?`
`Jak rozumíš sdělení Bible, že jsme byli stvořeni k Božímu obrazu?`
`V čem se lišíme od zvířat, která jsou také stvořena Bohem?`
`V jakých oblastech přijímáme „podobu Božího Syna“?`
`Jak se na tomto „obrazu“ podepsal hřích?`
`Co dělá Bůh pro to, abychom se mu zase začali podobat?`
`Jak se podle Ježíše (Mt 5,16) můžeme bránit pýše, pokud se nám něco daří?`
`Jak rozumíš tomu, že si nás Bůh „předem vyhlédl“? Je možné, aby byl někdo tím, koho si Bůh nevyhlédl? Proč?` | {
"content_hash": "b887b68c96d4a8815fc03be41e5719cd",
"timestamp": "",
"source": "github",
"line_count": 48,
"max_line_length": 406,
"avg_line_length": 45.375,
"alnum_prop": 0.7598714416896235,
"repo_name": "Adventech/sabbath-school-lessons",
"id": "eaf2a2548248936992fd1ce4eaae29e6da529c6b",
"size": "2402",
"binary": false,
"copies": "2",
"ref": "refs/heads/stage",
"path": "src/sk/2022-03/04/02.md",
"mode": "33188",
"license": "mit",
"language": [],
"symlink_target": ""
} |
<?php
namespace KK\SatoriBundle\Entity;
use Doctrine\ORM\EntityRepository;
/**
* BlogRepository
*
* This class was generated by the Doctrine ORM. Add your own custom
* repository methods below.
*/
class BlogRepository extends EntityRepository
{
public function getBlogs()
{
$qb = $this->createQueryBuilder('b')
->select('b')
->addOrderBy('b.created', 'DESC');
return $qb->getQuery()
->getResult();
}
public function getBlogsByMonth($year, $month)
{
// Query for blog posts in each month
$date = new \DateTime("{$year}-{$month}-01");
$toDate = clone $date;
$toDate->modify("next month midnight -1 second");
$qb = $this->createQueryBuilder('b')
->where('b.created BETWEEN :start AND :end')
->addOrderBy('b.created', 'DESC')
->setParameter('start', $date)
->setParameter('end', $toDate);
return $qb->getQuery()->getResult();
}
public function getBlogsByCategory()
{
$qb = $this->createQueryBuilder('b')
->select('b, c, tag')
->leftJoin('b.category', 'c')
->leftJoin('b.tags', 'tag')
->addOrderBy('b.created', 'DESC');
return $qb->getQuery()
->getResult();
}
}
| {
"content_hash": "4378d06177c4693ac8ccd98e7878966d",
"timestamp": "",
"source": "github",
"line_count": 52,
"max_line_length": 68,
"avg_line_length": 25.596153846153847,
"alnum_prop": 0.5492111194590533,
"repo_name": "keefekwan/symfony2_satoriblog",
"id": "2f7d424ff7bb3cd276673ee35a1c3d32ab62e88c",
"size": "1331",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/KK/SatoriBundle/Entity/BlogRepository.php",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "14830"
},
{
"name": "PHP",
"bytes": "91237"
}
],
"symlink_target": ""
} |
@interface ViewController : UIViewController
@end
| {
"content_hash": "8dfa267ac9146107bfc907ab9b86bd30",
"timestamp": "",
"source": "github",
"line_count": 3,
"max_line_length": 44,
"avg_line_length": 17,
"alnum_prop": 0.8235294117647058,
"repo_name": "ForrestShi/WaterDropEffect",
"id": "e7e5d951039f352a80ddcfca297d061b9a8b8ea6",
"size": "213",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "WaterDrop/ViewController.h",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Objective-C",
"bytes": "5521"
}
],
"symlink_target": ""
} |
<?php
$type = 'text/javascript';
$files = array(
'../LICENSE-INFO.txt',
// note that define is only included here as a means
// to revert to the pre async include, and should not be
// used in other build methods
'jquery.mobile.define.js',
'jquery.mobile.ns.js',
'jquery.ui.widget.js',
'jquery.mobile.widget.js',
'jquery.mobile.media.js',
'jquery.mobile.support.touch.js',
'jquery.mobile.support.orientation.js',
'jquery.mobile.support.js',
'jquery.mobile.vmouse.js',
'events/touch.js',
'events/throttledresize.js',
'events/orientationchange.js',
'jquery.hashchange.js',
'jquery.ui.core.js',
'jquery.mobile.defaults.js',
'jquery.mobile.helpers.js',
'jquery.mobile.data.js',
'widgets/page.js',
'widgets/loader.js',
'events/navigate.js',
'navigation/path.js',
'navigation/history.js',
'navigation/navigator.js',
'navigation/method.js',
'jquery.mobile.navigation.js',
'transitions/transition.js',
'transitions/serial.js',
'transitions/concurrent.js',
'transitions/handlers.js',
'transitions/visuals/pop.js',
'transitions/visuals/slide.js',
'transitions/visuals/slidefade.js',
'transitions/visuals/slidedown.js',
'transitions/visuals/slideup.js',
'transitions/visuals/flip.js',
'transitions/visuals/flow.js',
'transitions/visuals/turn.js',
'jquery.mobile.degradeInputs.js',
'widgets/optionDemultiplexer.js',
'widgets/dialog.js',
'widgets/collapsible.js',
'widgets/addFirstLastClasses.js',
'widgets/collapsibleSet.js',
'jquery.mobile.fieldContain.js',
'jquery.mobile.grid.js',
'widgets/navbar.js',
'widgets/listview.js',
'widgets/listview.autodividers.js',
'widgets/listview.hidedividers.js',
'jquery.mobile.nojs.js',
'widgets/forms/reset.js',
'widgets/forms/checkboxradio.js',
'widgets/forms/button.js',
'widgets/forms/flipswitch.js',
'widgets/forms/slider.js',
'widgets/forms/slider.tooltip.js',
'widgets/forms/rangeslider.js',
'widgets/forms/textinput.js',
'widgets/forms/clearButton.js',
'widgets/forms/autogrow.js',
'widgets/forms/select.js',
'widgets/forms/select.custom.js',
'widgets/filterable.js',
'widgets/filterable.backcompat.js',
'jquery.mobile.buttonMarkup.js',
'widgets/controlgroup.js',
'jquery.mobile.links.js',
'widgets/toolbar.js',
'widgets/fixedToolbar.js',
'widgets/fixedToolbar.workarounds.js',
'widgets/panel.js',
'widgets/popup.js',
'widgets/popup.arrow.js',
'widgets/table.js',
'widgets/table.columntoggle.js',
'widgets/table.reflow.js',
'widgets/jquery.ui.tabs.js',
'widgets/tabs.js',
'jquery.mobile.zoom.js',
'jquery.mobile.zoom.iosorientationfix.js',
'jquery.mobile.init.js'
);
function getGitHeadPath() {
$gitRoot = "../";
$gitDir = ".git";
$path = $gitRoot . $gitDir;
if ( is_file( $path ) && is_readable( $path ) ) {
$contents = file_get_contents( $path );
if ( $contents ) {
$contents = explode( " ", $contents );
if ( count( $contents ) > 1 ) {
$contents = explode( "\n", $contents[ 1 ] );
if ( $contents && count( $contents ) > 0 ) {
$path = $gitRoot . $contents[ 0 ];
}
}
}
}
return $path . "/logs/HEAD";
}
function getCommitId() {
$gitHeadPath = getGitHeadPath();
if ( $gitHeadPath ) {
$logs = ( is_readable( $gitHeadPath ) ? file_get_contents( $gitHeadPath ) : false );
if ( $logs ) {
$logs = explode( "\n", $logs );
$n_logs = count( $logs );
if ( $n_logs > 1 ) {
$log = explode( " ", $logs[ $n_logs - 2 ] );
if ( count( $log ) > 1 ) {
return $log[ 1 ];
}
}
}
}
return false;
}
$comment = getCommitId();
if ( !$comment ) {
unset( $comment );
} else {
$comment = "/* git commitid " . $comment . " */\n";
}
require_once('../combine.php');
| {
"content_hash": "8c3ef479d100f76ceb5d01546eec88ac",
"timestamp": "",
"source": "github",
"line_count": 139,
"max_line_length": 86,
"avg_line_length": 26.194244604316548,
"alnum_prop": 0.6690469651194727,
"repo_name": "KiPaWanG/jquery-mobile-master",
"id": "07380b9fe3b5cfa5e3853b1f7aac0c4d5d5662e6",
"size": "3641",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "js/index.php",
"mode": "33261",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "161516"
},
{
"name": "JavaScript",
"bytes": "1343028"
},
{
"name": "PHP",
"bytes": "959259"
},
{
"name": "Scala",
"bytes": "614"
},
{
"name": "Shell",
"bytes": "1302"
}
],
"symlink_target": ""
} |
/**
* \file testexception.cpp
* \date Jul 28, 2010
* \author samael
*/
#include <iostream>
#include <XWolf.h>
using namespace std;
using namespace wolf;
class FooBar
{
public:
void foo() { bar(); }
void bar() { throw XWolf("test exception throwing."); }
};
int main()
{
try {
FooBar fb;
fb.foo();
} catch (XWolf &x) {
cout << x.toString() << endl;
}
return 0;
}
| {
"content_hash": "06cfc26512a632715ce61dcb9abeb4d4",
"timestamp": "",
"source": "github",
"line_count": 29,
"max_line_length": 56,
"avg_line_length": 13.172413793103448,
"alnum_prop": 0.6047120418848168,
"repo_name": "freesamael/wolf",
"id": "c0c9ba4c1830b9a6dd7d333c4c1a8e980d19eb17",
"size": "382",
"binary": false,
"copies": "1",
"ref": "refs/heads/develop",
"path": "test/bintest/testexception.cpp",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "C",
"bytes": "1122"
},
{
"name": "C++",
"bytes": "294898"
},
{
"name": "Makefile",
"bytes": "6095"
}
],
"symlink_target": ""
} |
package com.redthirddivision.jevents;
import java.lang.reflect.Method;
import java.util.ArrayList;
/**
* <strong>Project:</strong> JEvents <br>
* <strong>File:</strong> EventRegistry.java
*
* @author <a href = "http://redthirddivision.com/team/blp"> Matthew Rogers</a>
*/
public class EventRegistry {
private static final ArrayList<Class<?>> classes = new ArrayList<Class<?>>();
public static void registerClass(Class<?> clazz){
classes.add(clazz);
}
public static void parseRegisteredClasses(){
try{
for(Class<?> clazz : classes){
for(Method method : clazz.getMethods()){
if(method.isAnnotationPresent(SubscribeEvent.class)){
// SubscribeEvent subEvent = method.getAnnotation(SubscribeEvent.class);
Class<?>[] params = method.getParameterTypes();
for(Class<?> p : params){
if(!EventListener.getEventClasses().contains(p)){
System.err.println("Found annotation in class " + clazz.getSimpleName() + " , Found method " + method.getName()
+ " , Found parameter " + p.getSimpleName());
System.err.println("An @SubscribeEvent method must have a proper Event parameter");
System.exit(1);
}
EventListener.addMethod(new MethodContainer(method, p));
}
}
}
}
}catch (Exception e){
e.printStackTrace();
}
}
}
| {
"content_hash": "e5c24d5878a85d0ac0ad9b2709a9fd27",
"timestamp": "",
"source": "github",
"line_count": 46,
"max_line_length": 143,
"avg_line_length": 36.47826086956522,
"alnum_prop": 0.5256257449344458,
"repo_name": "RedThirdDivision/JEvents",
"id": "1aea1c8f4c723d40022c3d95d1dedbed59baff33",
"size": "2293",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "source/com/redthirddivision/jevents/EventRegistry.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Java",
"bytes": "16521"
}
],
"symlink_target": ""
} |
package com.intellij.model.psi.impl;
import com.intellij.codeInsight.TargetEvaluatorAwareReference;
import com.intellij.model.Symbol;
import com.intellij.model.psi.PsiSymbolReference;
import com.intellij.model.psi.PsiSymbolService;
import com.intellij.psi.PsiElement;
import org.jetbrains.annotations.Contract;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import static com.intellij.util.containers.ContainerUtil.map;
public class PsiSymbolServiceImpl implements PsiSymbolService {
@Contract(pure = true)
@NotNull
@Override
public Symbol asSymbol(@NotNull PsiElement element) {
if (element instanceof Symbol) {
return (Symbol)element;
}
else {
// consider all PsiElements obtained from references (or other APIs) as Symbols,
// because that's what usually was meant
return new Psi2Symbol(element);
}
}
@Contract(pure = true)
@Nullable
@Override
public PsiElement extractElementFromSymbol(@NotNull Symbol symbol) {
if (symbol instanceof PsiElement) {
return (PsiElement)symbol;
}
else if (symbol instanceof Psi2Symbol) {
return ((Psi2Symbol)symbol).getElement();
}
else {
// If the Symbol is brand new (not based on some PsiElement, not related to LightElement or PomTarget),
// then the client should implement proper Symbol-based APIs,
// hence we consider brand new Symbol implementations as inapplicable for old APIs
return null;
}
}
@Contract(pure = true)
@Override
public @NotNull Iterable<? extends @NotNull PsiSymbolReference> getOwnReferences(@NotNull PsiElement element) {
return map(element.getReferences(), TargetEvaluatorAwareReference::new);
}
}
| {
"content_hash": "065bea08d533e310e2451c4ee113ba5e",
"timestamp": "",
"source": "github",
"line_count": 53,
"max_line_length": 113,
"avg_line_length": 32.77358490566038,
"alnum_prop": 0.7409326424870466,
"repo_name": "leafclick/intellij-community",
"id": "4f93df299838e27cade315aa6bfface4f5ac7dcd",
"size": "1878",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "platform/lang-impl/src/com/intellij/model/psi/impl/PsiSymbolServiceImpl.java",
"mode": "33188",
"license": "apache-2.0",
"language": [],
"symlink_target": ""
} |
class ofApp : public ofBaseApp{
public:
void setup();
void update();
void draw();
void keyPressed(int key);
void loadImage();
void recompute();
ofxSaliencyMap saliencyMap;
ofImage mSrcImg;
ofImage mDstImg;
ofParameter<float> mWIntensity;
ofParameter<float> mWColor;
ofParameter<float> mWOrientation;
ofParameter<float> mWMotion;
ofxPanel gui;
};
| {
"content_hash": "12186daccda0e49c423d79679a0020a9",
"timestamp": "",
"source": "github",
"line_count": 24,
"max_line_length": 37,
"avg_line_length": 18.208333333333332,
"alnum_prop": 0.620137299771167,
"repo_name": "TatsuyaOGth/ofxSaliencyMap",
"id": "f516f465ff37effb09a07ad5b4f2348da301f387",
"size": "520",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "example/src/ofApp.h",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C++",
"bytes": "29297"
}
],
"symlink_target": ""
} |
package org.apache.camel.processor;
import org.apache.camel.ContextTestSupport;
import org.apache.camel.builder.RouteBuilder;
import org.apache.camel.component.mock.MockEndpoint;
/**
* @version $Revision$
*/
public class RecipientListWithDelimiterTest extends ContextTestSupport {
@Override
public boolean isUseRouteBuilder() {
return false;
}
public void testRecipientList() throws Exception {
context.addRoutes(new RouteBuilder() {
@Override
public void configure() throws Exception {
from("direct:a").recipientList(header("myHeader"), "#");
}
});
context.start();
MockEndpoint x = getMockEndpoint("mock:x");
MockEndpoint y = getMockEndpoint("mock:y");
MockEndpoint z = getMockEndpoint("mock:z");
x.expectedBodiesReceived("answer");
y.expectedBodiesReceived("answer");
z.expectedBodiesReceived("answer");
sendBody();
assertMockEndpointsSatisfied();
}
public void testRecipientListWithTokenizer() throws Exception {
context.addRoutes(new RouteBuilder() {
@Override
public void configure() throws Exception {
from("direct:a").recipientList(header("myHeader").tokenize("#"));
}
});
context.start();
MockEndpoint x = getMockEndpoint("mock:x");
MockEndpoint y = getMockEndpoint("mock:y");
MockEndpoint z = getMockEndpoint("mock:z");
x.expectedBodiesReceived("answer");
y.expectedBodiesReceived("answer");
z.expectedBodiesReceived("answer");
sendBody();
assertMockEndpointsSatisfied();
}
protected void sendBody() {
template.sendBodyAndHeader("direct:a", "answer", "myHeader", "mock:x#mock:y#mock:z");
}
} | {
"content_hash": "8518d3b409bbd4dbeeb3938ed032824c",
"timestamp": "",
"source": "github",
"line_count": 66,
"max_line_length": 93,
"avg_line_length": 28.045454545454547,
"alnum_prop": 0.6261480280929227,
"repo_name": "kingargyle/turmeric-bot",
"id": "78d0fde8c1f3a06966826a1cdad840e47725d40a",
"size": "2654",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "camel-core/src/test/java/org/apache/camel/processor/RecipientListWithDelimiterTest.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "ActionScript",
"bytes": "20202"
},
{
"name": "Batchfile",
"bytes": "108"
},
{
"name": "CSS",
"bytes": "220587"
},
{
"name": "FreeMarker",
"bytes": "11350"
},
{
"name": "Groovy",
"bytes": "2711"
},
{
"name": "HTML",
"bytes": "308151"
},
{
"name": "Java",
"bytes": "19316639"
},
{
"name": "JavaScript",
"bytes": "4172468"
},
{
"name": "PHP",
"bytes": "88860"
},
{
"name": "Protocol Buffer",
"bytes": "578"
},
{
"name": "Ruby",
"bytes": "4814"
},
{
"name": "Scala",
"bytes": "185055"
},
{
"name": "Shell",
"bytes": "351"
},
{
"name": "Tcl",
"bytes": "2969"
},
{
"name": "XQuery",
"bytes": "332"
},
{
"name": "XSLT",
"bytes": "37282"
}
],
"symlink_target": ""
} |
namespace Microsoft.Azure.Media.LiveVideoAnalytics.Edge.Models
{
using Newtonsoft.Json;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
/// <summary>
/// Properties of a Media Graph instance.
/// </summary>
public partial class MediaGraphInstanceProperties
{
/// <summary>
/// Initializes a new instance of the MediaGraphInstanceProperties
/// class.
/// </summary>
public MediaGraphInstanceProperties()
{
CustomInit();
}
/// <summary>
/// Initializes a new instance of the MediaGraphInstanceProperties
/// class.
/// </summary>
/// <param name="description">An optional description for the
/// instance.</param>
/// <param name="topologyName">The name of the graph topology that this
/// instance will run. A topology with this name should already have
/// been set in the Edge module.</param>
/// <param name="parameters">List of one or more graph instance
/// parameters.</param>
/// <param name="state">Allowed states for a graph Instance. Possible
/// values include: 'Inactive', 'Activating', 'Active',
/// 'Deactivating'</param>
public MediaGraphInstanceProperties(string description = default(string), string topologyName = default(string), IList<MediaGraphParameterDefinition> parameters = default(IList<MediaGraphParameterDefinition>), MediaGraphInstanceState? state = default(MediaGraphInstanceState?))
{
Description = description;
TopologyName = topologyName;
Parameters = parameters;
State = state;
CustomInit();
}
/// <summary>
/// An initialization method that performs custom operations like setting defaults
/// </summary>
partial void CustomInit();
/// <summary>
/// Gets or sets an optional description for the instance.
/// </summary>
[JsonProperty(PropertyName = "description")]
public string Description { get; set; }
/// <summary>
/// Gets or sets the name of the graph topology that this instance will
/// run. A topology with this name should already have been set in the
/// Edge module.
/// </summary>
[JsonProperty(PropertyName = "topologyName")]
public string TopologyName { get; set; }
/// <summary>
/// Gets or sets list of one or more graph instance parameters.
/// </summary>
[JsonProperty(PropertyName = "parameters")]
public IList<MediaGraphParameterDefinition> Parameters { get; set; }
/// <summary>
/// Gets or sets allowed states for a graph Instance. Possible values
/// include: 'Inactive', 'Activating', 'Active', 'Deactivating'
/// </summary>
[JsonProperty(PropertyName = "state")]
public MediaGraphInstanceState? State { get; set; }
}
}
| {
"content_hash": "86f42101edeb61d514b20086b132079e",
"timestamp": "",
"source": "github",
"line_count": 78,
"max_line_length": 285,
"avg_line_length": 38.96153846153846,
"alnum_prop": 0.6150049358341559,
"repo_name": "jackmagic313/azure-sdk-for-net",
"id": "adf0643d98012d102c04a5e0222d14185f2a2f3e",
"size": "3392",
"binary": false,
"copies": "6",
"ref": "refs/heads/master",
"path": "sdk/mediaservices/Microsoft.Azure.Media.LiveVideoAnalytics.Edge/src/Generated/Models/MediaGraphInstanceProperties.cs",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Batchfile",
"bytes": "15958"
},
{
"name": "C#",
"bytes": "175000108"
},
{
"name": "CSS",
"bytes": "5585"
},
{
"name": "HTML",
"bytes": "225966"
},
{
"name": "JavaScript",
"bytes": "13014"
},
{
"name": "PowerShell",
"bytes": "201417"
},
{
"name": "Shell",
"bytes": "13061"
},
{
"name": "Smarty",
"bytes": "11127"
},
{
"name": "TypeScript",
"bytes": "141835"
}
],
"symlink_target": ""
} |
<!DOCTYPE html>
<title>@property: viewport units in initial value</title>
<link rel="help" href="https://drafts.css-houdini.org/css-properties-values-api-1/#initial-value-descriptor" />
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<style>
iframe {
width: 400px;
height: 200px;
}
</style>
<iframe id=iframe srcdoc="
<style>
@property --10vw { syntax: '<length>'; inherits: true; initial-value: 10vw}
@property --10vh { syntax: '<length>'; inherits: true; initial-value: 10vh}
@property --10vi { syntax: '<length>'; inherits: true; initial-value: 10vi}
@property --10vb { syntax: '<length>'; inherits: true; initial-value: 10vb}
@property --10vmin { syntax: '<length>'; inherits: true; initial-value: 10vmin}
@property --10vmax { syntax: '<length>'; inherits: true; initial-value: 10vmax}
@property --10svw { syntax: '<length>'; inherits: true; initial-value: 10svw}
@property --10svh { syntax: '<length>'; inherits: true; initial-value: 10svh}
@property --10svi { syntax: '<length>'; inherits: true; initial-value: 10svi}
@property --10svb { syntax: '<length>'; inherits: true; initial-value: 10svb}
@property --10svmin { syntax: '<length>'; inherits: true; initial-value: 10svmin}
@property --10svmax { syntax: '<length>'; inherits: true; initial-value: 10svmax}
@property --10lvw { syntax: '<length>'; inherits: true; initial-value: 10lvw}
@property --10lvh { syntax: '<length>'; inherits: true; initial-value: 10lvh}
@property --10lvi { syntax: '<length>'; inherits: true; initial-value: 10lvi}
@property --10lvb { syntax: '<length>'; inherits: true; initial-value: 10lvb}
@property --10lvmin { syntax: '<length>'; inherits: true; initial-value: 10lvmin}
@property --10lvmax { syntax: '<length>'; inherits: true; initial-value: 10lvmax}
@property --10dvw { syntax: '<length>'; inherits: true; initial-value: 10dvw}
@property --10dvh { syntax: '<length>'; inherits: true; initial-value: 10dvh}
@property --10dvi { syntax: '<length>'; inherits: true; initial-value: 10dvi}
@property --10dvb { syntax: '<length>'; inherits: true; initial-value: 10dvb}
@property --10dvmin { syntax: '<length>'; inherits: true; initial-value: 10dvmin}
@property --10dvmax { syntax: '<length>'; inherits: true; initial-value: 10dvmax}
</style>
<div></div>
"></iframe>
<script>
iframe.offsetTop;
function waitForLoad(w) {
return new Promise(resolve => {
if (w.document.readyState == 'complete')
resolve();
else
w.addEventListener('load', resolve)
});
}
function test_unit(element, actual, expected) {
promise_test(async (t) => {
await waitForLoad(window);
let element = iframe.contentDocument.querySelector('div');
assert_equals(getComputedStyle(element).getPropertyValue(`--${actual}`), expected);
},`${actual} is ${expected}`);
}
test_unit(iframe, '10vw', '40px');
test_unit(iframe, '10vh', '20px');
test_unit(iframe, '10vi', '40px');
test_unit(iframe, '10vb', '20px');
test_unit(iframe, '10vmin', '20px');
test_unit(iframe, '10vmax', '40px');
test_unit(iframe, '10svw', '40px');
test_unit(iframe, '10svh', '20px');
test_unit(iframe, '10svi', '40px');
test_unit(iframe, '10svb', '20px');
test_unit(iframe, '10svmin', '20px');
test_unit(iframe, '10svmax', '40px');
test_unit(iframe, '10lvw', '40px');
test_unit(iframe, '10lvh', '20px');
test_unit(iframe, '10lvi', '40px');
test_unit(iframe, '10lvb', '20px');
test_unit(iframe, '10lvmin', '20px');
test_unit(iframe, '10lvmax', '40px');
test_unit(iframe, '10dvw', '40px');
test_unit(iframe, '10dvh', '20px');
test_unit(iframe, '10dvi', '40px');
test_unit(iframe, '10dvb', '20px');
test_unit(iframe, '10dvmin', '20px');
test_unit(iframe, '10dvmax', '40px');
</script>
| {
"content_hash": "66b9db25faeb4ea0147499eb46da8b78",
"timestamp": "",
"source": "github",
"line_count": 91,
"max_line_length": 111,
"avg_line_length": 42.84615384615385,
"alnum_prop": 0.6460630931007951,
"repo_name": "chromium/chromium",
"id": "51520c2a70932872b9f1e5b283d8bdd195b1ca6c",
"size": "3899",
"binary": false,
"copies": "13",
"ref": "refs/heads/main",
"path": "third_party/blink/web_tests/external/wpt/css/css-properties-values-api/at-property-viewport-units.html",
"mode": "33188",
"license": "bsd-3-clause",
"language": [],
"symlink_target": ""
} |
import { Component } from '@angular/core';
import { NavController } from 'ionic-angular';
import { BluetoothSerial } from 'ionic-native';
import { Observable } from 'rxjs/Observable';
@Component({
templateUrl: 'build/pages/btscale/btscale.html'
})
export class BtscalePage {
Status: string = 'None';
Result: string;
Reader: any;
constructor(private navCtrl: NavController) {
}
ionViewLoaded() {
this.Status = 'Ready';
BluetoothSerial.isEnabled().then((e) => {
this.Status = 'Enabled->' + e;
}, (err) => {
this.Status = 'not Enabled->' + err;
});
BluetoothSerial.connect('00:14:AA:30:30:5A').subscribe((e) => {
this.Status = 'Connected->' + e;
}, (err) => {
this.Status = 'not Connected->' + err;
});
}
readScale() {
this.doRead().then((e) => {
this.Result = e;
this.Reader.unsubscribe();
}, (err) => { this.Status = err; });
}
doRead(): Promise<string> {
let isValid = false;
let result: Promise<string> = new Promise<string>((resolve, reject) => {
BluetoothSerial.clear().then((eclear) => {
console.log(eclear);
this.Reader = BluetoothSerial.subscribe('\r\n').subscribe((e) => {
console.log(e);
if (isValid) {
resolve(e);
} else { isValid = !isValid; }
}, (err) => {
reject(err);
}, () => {
reject('Read->Complete');
});
});
});
return result;
}
}
| {
"content_hash": "13076308b3cf7837e7b776623e955203",
"timestamp": "",
"source": "github",
"line_count": 61,
"max_line_length": 76,
"avg_line_length": 24.327868852459016,
"alnum_prop": 0.545822102425876,
"repo_name": "holy-zhou/iTunesBrowser",
"id": "458fb403cd7572c52491ee6cb59510bb8cc93a60",
"size": "1484",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "app/pages/btscale/btscale.ts",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "5271"
},
{
"name": "HTML",
"bytes": "8564"
},
{
"name": "JavaScript",
"bytes": "4923"
},
{
"name": "TypeScript",
"bytes": "25074"
}
],
"symlink_target": ""
} |
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
export PYTHONPATH=$DIR:$PYTHONPATH
export ENV=$1
source /usr/local/bin/virtualenvwrapper.sh
workon max-xn.com | {
"content_hash": "357c88873b04a76efd3d12475aec26fa",
"timestamp": "",
"source": "github",
"line_count": 5,
"max_line_length": 55,
"avg_line_length": 33,
"alnum_prop": 0.696969696969697,
"repo_name": "seraph0017/max-x.net",
"id": "322557ab7464fd508593d7839e16132a6c138a1a",
"size": "177",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "script/env.sh",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "49946"
},
{
"name": "JavaScript",
"bytes": "95948"
},
{
"name": "Python",
"bytes": "55794"
},
{
"name": "Shell",
"bytes": "1081"
}
],
"symlink_target": ""
} |
using System.Net.Http;
using System.Xml.Linq;
namespace Microsoft.AspNetCore.CookiePolicy;
// REVIEW: Should find a shared home for these potentially (Copied from Auth tests)
public class Transaction
{
public HttpRequestMessage Request { get; set; }
public HttpResponseMessage Response { get; set; }
public IList<string> SetCookie { get; set; }
public string ResponseText { get; set; }
public XElement ResponseElement { get; set; }
public string AuthenticationCookieValue
{
get
{
if (SetCookie != null && SetCookie.Count > 0)
{
var authCookie = SetCookie.SingleOrDefault(c => c.Contains(".AspNetCore." + TestExtensions.CookieAuthenticationScheme + "="));
if (authCookie != null)
{
return authCookie.Substring(0, authCookie.IndexOf(';'));
}
}
return null;
}
}
public string FindClaimValue(string claimType, string issuer = null)
{
var claim = ResponseElement.Elements("claim")
.SingleOrDefault(elt => elt.Attribute("type").Value == claimType &&
(issuer == null || elt.Attribute("issuer").Value == issuer));
if (claim == null)
{
return null;
}
return claim.Attribute("value").Value;
}
}
| {
"content_hash": "0f349fd5f6d02cac336bf84da96a490c",
"timestamp": "",
"source": "github",
"line_count": 45,
"max_line_length": 142,
"avg_line_length": 30.488888888888887,
"alnum_prop": 0.5852769679300291,
"repo_name": "aspnet/AspNetCore",
"id": "ecc769444708042c27df7d43a7fccfe626f417d7",
"size": "1510",
"binary": false,
"copies": "1",
"ref": "refs/heads/darc-main-3ce916a7-9d9b-4849-8f14-6703adcb3cb2",
"path": "src/Security/CookiePolicy/test/Transaction.cs",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "ASP",
"bytes": "109"
},
{
"name": "Batchfile",
"bytes": "19526"
},
{
"name": "C",
"bytes": "213916"
},
{
"name": "C#",
"bytes": "47455169"
},
{
"name": "C++",
"bytes": "1900454"
},
{
"name": "CMake",
"bytes": "7955"
},
{
"name": "CSS",
"bytes": "62326"
},
{
"name": "Dockerfile",
"bytes": "3584"
},
{
"name": "F#",
"bytes": "7982"
},
{
"name": "Groovy",
"bytes": "1529"
},
{
"name": "HTML",
"bytes": "1130653"
},
{
"name": "Java",
"bytes": "297552"
},
{
"name": "JavaScript",
"bytes": "2726829"
},
{
"name": "Lua",
"bytes": "4904"
},
{
"name": "Makefile",
"bytes": "220"
},
{
"name": "Objective-C",
"bytes": "222"
},
{
"name": "PowerShell",
"bytes": "241706"
},
{
"name": "Python",
"bytes": "19476"
},
{
"name": "Roff",
"bytes": "6044"
},
{
"name": "Shell",
"bytes": "142293"
},
{
"name": "Smalltalk",
"bytes": "3"
},
{
"name": "TypeScript",
"bytes": "797435"
}
],
"symlink_target": ""
} |
<?php
// Include the initialization file
require_once dirname(dirname(__FILE__)) . '/init.php';
$labelId = 'INSERT_LABEL_ID_HERE';
/**
* Runs the example.
* @param AdWordsUser $user the user to run the example with
* @param string $labelId the label id to run the example with
*/
function GetCampaignsByLabelExample(AdWordsUser $user, $labelId) {
// Get the service, which loads the required classes.
$campaignService = $user->GetService('CampaignService', ADWORDS_VERSION);
// Create selector.
$selector = new Selector();
$selector->fields = array('Id', 'Name', 'Labels');
// Labels filtering is performed by ID. You can use containsAny to select
// campaigns with any of the label IDs, containsAll to select campaigns with
// all of the label IDs, or containsNone to select campaigns with none of the
// label IDs.
$selector->predicates[] = new Predicate('Labels', 'CONTAINS_ANY',
array($labelId));
$selector->ordering[] = new OrderBy('Name', 'ASCENDING');
// Create paging controls.
$selector->paging = new Paging(0, AdWordsConstants::RECOMMENDED_PAGE_SIZE);
do {
// Make the get request.
$page = $campaignService->get($selector);
// Display results.
if (isset($page->entries)) {
foreach ($page->entries as $campaign) {
printf("Campaign with name '%s' and ID '%d' and labels '%s'" .
" was found.\n", $campaign->name, $campaign->id,
implode(', ',
array_map(function($label) {
return sprintf('%d/%s', $label->id, $label->name);
}, $campaign->labels)));
}
} else {
print "No campaigns were found.\n";
}
// Advance the paging index.
$selector->paging->startIndex += AdWordsConstants::RECOMMENDED_PAGE_SIZE;
} while ($page->totalNumEntries > $selector->paging->startIndex);
}
// Don't run the example if the file is being included.
if (__FILE__ != realpath($_SERVER['PHP_SELF'])) {
return;
}
try {
// Get AdWordsUser from credentials in "../auth.ini"
// relative to the AdWordsUser.php file's directory.
$user = new AdWordsUser();
// Log every SOAP XML request and response.
$user->LogAll();
// Run the example.
GetCampaignsByLabelExample($user, $labelId);
} catch (Exception $e) {
printf("An error has occurred: %s\n", $e->getMessage());
}
| {
"content_hash": "87ca65641b0e048474a41d9f41d855a5",
"timestamp": "",
"source": "github",
"line_count": 72,
"max_line_length": 79,
"avg_line_length": 32.52777777777778,
"alnum_prop": 0.6447480785653288,
"repo_name": "gamejolt/googleads-php-lib",
"id": "1780ec2b006df93b000c07f6e3301c0d0749d881",
"size": "3322",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "examples/AdWords/v201605/CampaignManagement/GetCampaignsByLabel.php",
"mode": "33261",
"license": "apache-2.0",
"language": [
{
"name": "PHP",
"bytes": "51522205"
},
{
"name": "XSLT",
"bytes": "17842"
}
],
"symlink_target": ""
} |
<?php
namespace OC\Files\Meta;
use OC\Files\Node\AbstractFolder;
use OCP\Files\IRootFolder;
use OCP\Files\Storage\IVersionedStorage;
use OCP\Files\NotFoundException;
use OCP\Files\Storage;
/**
* Class MetaVersionCollection - this class represents the versions sub folder
* of a file
*
* @package OC\Files\Meta
*/
class MetaVersionCollection extends AbstractFolder {
/** @var IRootFolder */
private $root;
/** @var \OCP\Files\Node */
private $node;
/**
* MetaVersionCollection constructor.
*
* @param IRootFolder $root
* @param \OCP\Files\Node $node
*/
public function __construct(IRootFolder $root, \OCP\Files\Node $node) {
$this->root = $root;
$this->node = $node;
}
/**
* @inheritdoc
*/
public function isEncrypted() {
return false;
}
/**
* @inheritdoc
*/
public function isShared() {
return $this->node->isShared();
}
public function getDirectoryListing() {
$node = $this->node;
$storage = $node->getStorage();
$internalPath = $node->getInternalPath();
if (!$storage->instanceOfStorage(IVersionedStorage::class)) {
return [];
}
/** @var IVersionedStorage | Storage $storage */
'@phan-var IVersionedStorage | Storage $storage';
$versions = $storage->getVersions($internalPath);
return \array_values(\array_map(function ($version) use ($storage, $node, $internalPath) {
if (!isset($version['mimetype'])) {
$version['mimetype'] = $node->getMimetype();
}
return new MetaFileVersionNode($this, $this->root, $version, $storage, $internalPath);
}, $versions));
}
/**
* @inheritdoc
*/
public function get($path) {
$pieces = \explode('/', $path);
if (\count($pieces) !== 1) {
throw new NotFoundException();
}
$versionId = $pieces[0];
$storage = $this->node->getStorage();
$internalPath = $this->node->getInternalPath();
if (!$storage->instanceOfStorage(IVersionedStorage::class)) {
throw new NotFoundException();
}
/** @var IVersionedStorage | Storage $storage */
'@phan-var IVersionedStorage | Storage $storage';
$version = $storage->getVersion($internalPath, $versionId);
if ($version === null) {
throw new NotFoundException();
}
if (!isset($version['mimetype'])) {
$version['mimetype'] = $this->node->getMimetype();
}
return new MetaFileVersionNode($this, $this->root, $version, $storage, $internalPath);
}
/**
* @inheritdoc
*/
public function getId() {
return $this->node->getId();
}
public function getName() {
return "v";
}
public function getPath() {
return "/meta/{$this->getId()}/v";
}
}
| {
"content_hash": "7eb6816763bf0241b554e1ab4b6e8d5c",
"timestamp": "",
"source": "github",
"line_count": 112,
"max_line_length": 92,
"avg_line_length": 22.839285714285715,
"alnum_prop": 0.655199374511337,
"repo_name": "phil-davis/core",
"id": "9d38e17d5e6cfa8e1e2f1dc7ceba2a699ed5edce",
"size": "3356",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "lib/private/Files/Meta/MetaVersionCollection.php",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Dockerfile",
"bytes": "262"
},
{
"name": "Makefile",
"bytes": "473"
},
{
"name": "Shell",
"bytes": "8644"
}
],
"symlink_target": ""
} |
package one.two;
public class WriteWithInstance {
public static void main(String[] args) {
KotlinObject.Nested.INSTANCE.setStaticVariable(3);
}
} | {
"content_hash": "9b03dfcb8ddeb6c1d218fc1860fab5fb",
"timestamp": "",
"source": "github",
"line_count": 7,
"max_line_length": 58,
"avg_line_length": 23.142857142857142,
"alnum_prop": 0.7098765432098766,
"repo_name": "google/intellij-community",
"id": "094cff5b86e610a2ef2e571d48192a2c4c86de5f",
"size": "162",
"binary": false,
"copies": "9",
"ref": "refs/heads/master",
"path": "plugins/kotlin/compiler-reference-index/tests/testData/compilerIndex/properties/fromObject/nestedObject/staticVariable/WriteWithInstance.java",
"mode": "33188",
"license": "apache-2.0",
"language": [],
"symlink_target": ""
} |
import OptionDialog from './option-dialog'
export default OptionDialog
| {
"content_hash": "1f58ad9b7d3e62d37319cf408db00518",
"timestamp": "",
"source": "github",
"line_count": 3,
"max_line_length": 42,
"avg_line_length": 24,
"alnum_prop": 0.8194444444444444,
"repo_name": "ucev/blog",
"id": "94218c1f3d0eaea7a9738fc35f8374b41db8f1b3",
"size": "72",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/js/components/dialogs/option-dialog/index.js",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "3022"
},
{
"name": "HTML",
"bytes": "510"
},
{
"name": "JavaScript",
"bytes": "253086"
},
{
"name": "Pug",
"bytes": "20835"
},
{
"name": "SCSS",
"bytes": "44059"
},
{
"name": "Shell",
"bytes": "405"
}
],
"symlink_target": ""
} |
Copyright (c) 2009 - 2016, BitWeb LLC
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
* Neither the name of the BitWeb LLC nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
| {
"content_hash": "3e204fa24a3cd0c20e65b6e5db429d6a",
"timestamp": "",
"source": "github",
"line_count": 27,
"max_line_length": 78,
"avg_line_length": 55.148148148148145,
"alnum_prop": 0.8092679650772331,
"repo_name": "BitWeb/stdlib",
"id": "eb5898111b9626b63e27bd30c23ffe2cf40c91d8",
"size": "1489",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "LICENSE.md",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "PHP",
"bytes": "19450"
}
],
"symlink_target": ""
} |
using NUnit.Framework;
using SharpGEDParser.Model;
namespace SharpGEDParser.Tests
{
[TestFixture]
public class HeadTest : GedParseTest
{
[Test]
public void Simple()
{
var txt = "0 HEAD\n";
var rec = ReadOne(txt);
Assert.AreEqual("HEAD", rec.Tag);
}
[Test]
public void BadDate()
{
var txt = "0 HEAD\n1 DATE";
var rec = ReadOne(txt);
Assert.AreEqual("HEAD", rec.Tag);
}
[Test]
public void BadSubm()
{
var txt = "0 HEAD\n1 SUBM";
var rec = ReadOne(txt);
Assert.AreEqual("HEAD", rec.Tag);
Assert.AreEqual(1, rec.Errors.Count);
}
[Test]
public void ExtraSubm()
{
// TODO should this be an error?
var txt = "0 HEAD\n1 SUBM @I5@ blah";
var rec = ReadOne(txt);
Assert.AreEqual("HEAD", rec.Tag);
Assert.AreEqual(0, rec.Errors.Count);
}
}
}
| {
"content_hash": "9464a2cc85d1e674401124b2114a9ba0",
"timestamp": "",
"source": "github",
"line_count": 41,
"max_line_length": 49,
"avg_line_length": 25.78048780487805,
"alnum_prop": 0.4806054872280038,
"repo_name": "fire-eggs/YAGP",
"id": "7ce02306aad01ae0c97f85a09bac49946a284073",
"size": "1059",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "SharpGEDParse/SharpGEDParser/Tests/HeadTest.cs",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Batchfile",
"bytes": "43"
},
{
"name": "C#",
"bytes": "1547865"
},
{
"name": "CSS",
"bytes": "32420"
},
{
"name": "HTML",
"bytes": "947904"
},
{
"name": "JavaScript",
"bytes": "45582"
}
],
"symlink_target": ""
} |
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
<html>
<head>
<script src="../resources/js-test.js"></script>
</head>
<body id="body">
<span tabindex="0" id="test" role="unknownrole switch checkbox" aria-checked="true">test</span>
<p id="description"></p>
<div id="console"></div>
<script>
description("This tests that aria fallback roles work correctly.");
if (window.accessibilityController) {
if (window.accessibilityController) {
var test = document.getElementById("test");
test.focus();
test = accessibilityController.focusedElement;
debug("Role should be: " + test.role);
}
}
</script>
</body>
</html>
| {
"content_hash": "c1acbeb513ecd13c37473d8f1c57b24b",
"timestamp": "",
"source": "github",
"line_count": 30,
"max_line_length": 95,
"avg_line_length": 23.033333333333335,
"alnum_prop": 0.6208393632416788,
"repo_name": "hgl888/blink-crosswalk-efl",
"id": "d582caaa412e52c578067acea7be0a7cbbb0ba71",
"size": "691",
"binary": false,
"copies": "9",
"ref": "refs/heads/efl/crosswalk-10/39.0.2171.19",
"path": "LayoutTests/accessibility/aria-fallback-roles.html",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "ApacheConf",
"bytes": "1835"
},
{
"name": "Assembly",
"bytes": "14584"
},
{
"name": "Batchfile",
"bytes": "35"
},
{
"name": "C",
"bytes": "113661"
},
{
"name": "C++",
"bytes": "41933223"
},
{
"name": "CSS",
"bytes": "525836"
},
{
"name": "GLSL",
"bytes": "11578"
},
{
"name": "Groff",
"bytes": "28067"
},
{
"name": "HTML",
"bytes": "54848115"
},
{
"name": "Java",
"bytes": "100403"
},
{
"name": "JavaScript",
"bytes": "26269146"
},
{
"name": "Makefile",
"bytes": "653"
},
{
"name": "Objective-C",
"bytes": "111951"
},
{
"name": "Objective-C++",
"bytes": "377325"
},
{
"name": "PHP",
"bytes": "167892"
},
{
"name": "Perl",
"bytes": "583834"
},
{
"name": "Python",
"bytes": "3855349"
},
{
"name": "Ruby",
"bytes": "141818"
},
{
"name": "Shell",
"bytes": "8888"
},
{
"name": "XSLT",
"bytes": "49099"
},
{
"name": "Yacc",
"bytes": "64128"
}
],
"symlink_target": ""
} |
/* $Id: default.css 7166 2015-02-21 21:18:59Z Joshua $*/
/*
New "AguaPop" Theme for WebERP
v2, 2012-08-03
by Hindra Joshua
*/
body {
font-family:Arial, Verdana, Helvetica, sans-serif;
font-size:10pt;
background: silver;
margin:0;
padding:0;
}
/* default styles */
a{
color:blue;
text-decoration:none;
}
a:hover{
color:red;
text-decoration:underline;
}
a:active{}
img{ /* icon on page title, etc */
border:none;
vertical-align:middle;
}
p{ /* some text need to be centered */
/*text-align:center;*/
}
p.page_title_text { /* page title */
color:black;
font-weight:bold;
margin:0 auto;
padding:5px;
text-align:center;
}
p.good {
font-weight: bold;
color: green;
}
p.bad {
font-weight: bold;
color:red;
}
table {
width:auto;
max-width:90%;
margin:5px auto;
padding-bottom:5px;
}
table.selection {
width:auto;
max-width:90%;
/*padding-bottom:5px;*/
}
th {
background-color:skyblue;
color:black;
font-weight:normal;
padding:3px;
}
th.ascending {
cursor: s-resize;
}
th.descending {
cursor: n-resize;
}
th:after {
content: "";
float: right;
margin-top: 7px;
visibility: hidden;
}
th.ascending:after {
border-width: 0 4px 4px;
border-style: solid;
border-color: #000 transparent;
visibility: visible;
}
th.descending:after {
border-bottom: none;
border-left: 4px solid transparent;
border-right: 4px solid transparent;
border-top: 4px solid #000;
visibility: visible;
}
th.number {
background-color: skyblue;
color: white;
font-weight: normal;
text-align: right;
}
th.text {
background-color: skyblue;
color: white;
font-weight: normal;
text-align: left;
}
td {
font-family: Arial, Verdana, Helvetica, sans-serif;
text-align: left;
}
td.select {
background-color: whitesmoke;
padding:3px;
}
td.number {
text-align: right;
}
div.centre {
padding:5px;
text-align:center;
}
input { /*specifies the input field text characteristics*/
font-family: Arial, Verdana, Helvetica, sans-serif;
font-style: italic;
}
input.number{
text-align: right;
}
input.image {
border-width: 0px;
background-color: transparent;
}
input:hover{
background:#9ffffb;
}
select {
font-family: Arial, Verdana, Helvetica, sans-serif;
}
input.inputerror, input.error, select.error, select.selecterror, label.error {
color:red;
border: 2px solid red;
}
input:required, select:required, textarea:required {
background-color:lightyellow;
}
select:hover { /* drop down */
background:#9ffffb;
}
textarea{
font-family: Arial, Verdana, Helvetica, sans-serif;
}
textarea:hover{
background:#9ffffb;
}
.EvenTableRows {
background-color: gainsboro;
}
.OddTableRows {
background-color: whitesmoke;
}
div{ /* some input/buttons need to be centered */
}
div.error {
background-color: mistyrose;
width: 98%;
margin: 5px auto;
color: red;
border: 1px solid red;
}
div.warn {
background-color: pink;
width: 98%;
margin: 5px auto;
color: maroon;
border: 1px solid maroon;
}
div.success {
background-color: aquamarine;
width: 98%;
margin: 5px auto;
color: green;
border: 1px solid green;
}
div.info {
background-color: lightskyblue;
width: 98%;
margin: 5px auto;
color:navy;
border: 1px solid navy;
}
DIV.page_help_text {
background: lightgrey url(images/help.png) top left no-repeat;
border: maroon 1px solid;
padding-top:2px;
padding-bottom: 2px;
z-index: 1;
width: 80%;
float: none;
visibility: visible;
margin: 0 auto;
position: static;
font-family: Arial, Verdana, Helvetica, sans-serif;
font-weight: normal;
color: black;
text-align:center;
padding-left: 24px;
min-height:26px;
}
/* date picker */
.dpTbl {
border: solid navy 1px;
background:white;
}
.dpTD {
border: 0;
width: 20px;
background-color: whitesmoke;
text-align: right;
cursor: pointer;
}
.dpDayHighlight {
border: 0;
width: 20px;
background-color: yellow;
text-align: right;
cursor: pointer;
}
.dpTDHover {
border: 0;
width: 20px;
background-color: gainsboro;
text-align: right;
cursor: pointer;
}
/* Table type is used for UI tables type 1 */
.table1 {
width:90%;
background: whitesmoke;
border: 1px solid darkslategray;
margin: 0 auto;
}
.tableheader {
font-weight: normal;
background-color: skyblue;
color: white;
}
.notavailable {
font-weight: lighter;
font-style: italic;
color: gray;
}
.label {
font-weight: bold;
font-style: normal;
color: black;
background-color: gainsboro;
}
.table_index {
background-color: aliceblue;
}
li {
/*list-style-image: url(bullet.gif);*/
}
/* CANVAS */
#CanvasDiv {
background:steelblue;
border-radius:20px;
box-shadow:3px 3px 4px #86C3D7 inset, -3px -3px 4px #383878 inset, 0 0 10px black;
margin:10px;
}
/* HEADER */
#HeaderDiv {
overflow:hidden;
color:white;
padding:5px 10px 0;
}
#HeaderDiv a{
border-radius:10px;
color:white;
text-decoration:none;
padding:3px;
}
#HeaderDiv a:hover{
color:cyan;
border-radius:10px;
box-shadow:2px 2px 3px #86C3D7, -2px -2px 3px #383878;
padding:3px;
}
#HeaderWrapDiv{
}
/* HEADER - APP INFO */
#AppInfoDiv{
float:left; /* REQUIRED: to the left */
}
#AppInfoCompanyDiv{
display:table-cell; /* REQUIRED: as a cell */
}
#AppInfoUserDiv{
display:table-cell; /* REQUIRED: as a cell */
padding-left:5px;
}
#AppInfoModuleDiv{
font-weight:bold;
padding:3px;
}
/* HEADER - QUICK MENU */
#QuickMenuDiv{
float:right;
margin-top:7px;
}
#QuickMenuDiv ul{
list-style:none;
float:right;
}
#QuickMenuDiv ul li{
float: left;
display:inline;
margin: 0px 3px;
}
/* BODY */
#BodyDiv {
clear:both;
overflow:hidden;
text-align:center; /* needed to center some buttons on SelectSupplier.php */
}
#BodyWrapDiv{
background:lightsteelblue;
box-shadow:2px 2px 3px inset;
margin:0 5px;
}
/* BODY - MAIN MENU */
#MainMenuDiv{
float:left;
background:steelblue;
white-space:nowrap;
text-align:center;
padding-left:3px;
padding-top:3px;
width:11%;
}
#MainMenuDiv ul{
margin:0;
padding:0;
}
#MainMenuDiv li{
list-style:none;
}
#MainMenuDiv li a,
#MainMenuDiv li a:hover,
#MainMenuDiv .main_menu_selected a{
display:block; /* REQUIRED */
border-radius:10px;
color:white;
text-decoration:none;
padding:3px;
margin-bottom:5px;
}
#MainMenuDiv li a:hover{
color:cyan;
box-shadow:2px 2px 3px #86C3D7, -2px -2px 3px #383878;
}
#MainMenuDiv .main_menu_selected a{ /* the selected button */
box-shadow:2px 2px 3px #86C3D7, -2px -2px 3px #383878;
}
/* BODY - SUB MENU */
#SubMenuDiv{
display:table; /* display as table, sub menu will auto adjust width */
float:right;
overflow: hidden;
margin-left:auto;
margin-right:auto;
width:88%; /* main menu is 10% */
text-align:left;
}
#SubMenuDiv ul{
margin:0;
padding:0;
}
#SubMenuDiv li{
list-style:none; /* REQUIRED: hide bullets */
}
#SubMenuDiv p{
}
#SubMenuDiv a{
color:black;
text-decoration:none;
}
#SubMenuDiv a:hover{
color:black;
text-decoration:underline;
}
.menu_group_headers {
background:steelblue;
border:2px outset white;
color:white;
font-weight:bold;
text-align:center;
padding:3px;
}
.menu_group_item {
padding:2px;
text-align:left;
}
.menu_group_item:hover{
background:lightblue;
text-align:left;
}
.menu_group_item p { /* bullet */
color: red; /* This is the color for bullets, I like it to be the same as the anchor color, but it's up to you */
text-indent: -10px; /* this makes the bullet to appear as the li tag previously used */
margin: 0 0 0 12px;
text-align:left;
}
.menu_group_item a{
color:black;
text-decoration:none;
}
.menu_group_item a:hover{
color:red;
text-decoration:none;
}
#TransactionsDiv,#InquiriesDiv,#MaintenanceDiv{
background:whitesmoke;
border:2px solid steelblue;
display:table-cell;
}
#InquiriesDiv div{ /* to center custom report/form header */
background:lightsteelblue;
font-weight:bold;
color:black;
padding:2px;
}
/*** FOOTER ***/
#FooterDiv{
clear:both;
color:white;
height:53px;
padding:0;
}
#FooterWrapDiv{
padding:5px;
}
#FooterLogoDiv{
background:white;
border:2px outset steelblue;
border-radius:8px 8px 8px 8px;
float:left;
padding:3px;
}
#FooterVersionDiv{
float:left;
margin-left:10px;
margin-top:15px;
}
#FooterTimeDiv{
float:right;
margin-top:15px;
}
#Report {
/* Division id for reports. */}
#Report table {
/* Body of a report formatted with table tag. */
}
.centre {
text-align:center;
/* centre class (general). */
}
/**** END ***/
| {
"content_hash": "fb1af9670ebd310ce162ed8b34e29397",
"timestamp": "",
"source": "github",
"line_count": 501,
"max_line_length": 114,
"avg_line_length": 16.54690618762475,
"alnum_prop": 0.6975874547647768,
"repo_name": "whp0011/weberp",
"id": "6095aa0a3a535ca748e0f4519f7891dc4a028e08",
"size": "8290",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "css/aguapop/default.css",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C++",
"bytes": "10941"
},
{
"name": "CSS",
"bytes": "118529"
},
{
"name": "HTML",
"bytes": "3692998"
},
{
"name": "JavaScript",
"bytes": "9472"
},
{
"name": "PHP",
"bytes": "12743270"
},
{
"name": "PLpgSQL",
"bytes": "233742"
},
{
"name": "Pascal",
"bytes": "9382"
},
{
"name": "SourcePawn",
"bytes": "34543"
}
],
"symlink_target": ""
} |
/**
*
* Return true or false if an `<option>` element, or an `<input>` element of type
* checkbox or radio is currently selected found by given selector.
*
* <example>
:index.html
<select name="selectbox" id="selectbox">
<option value="John Doe">John Doe</option>
<option value="Layla Terry" selected="selected">Layla Terry</option>
<option value="Bill Gilbert">Bill Gilbert"</option>
</select>
:isSelected.js
client.isSelected('[value="Layla Terry"]').then(function(isSelected) {
console.log(isSelected); // outputs: true
});
* </example>
*
* @param {String} selector option element or input of type checkbox or radio
* @returns {Boolean|Boolean[]} true if element is selected
*
* @uses protocol/elements, protocol/elementIdSelected
* @type state
*
*/
var ErrorHandler = require('../utils/ErrorHandler.js');
var staleElementRetry = require('../helpers/staleElementRetry');
module.exports = function isSelected (selector) {
return this.elements(selector).then(function(res) {
if(!res.value || res.value.length === 0) {
// throw NoSuchElement error if no element was found
throw new ErrorHandler(7);
}
var self = this,
elementIdSelectedCommands = [];
res.value.forEach(function(elem) {
elementIdSelectedCommands.push(self.elementIdSelected(elem.ELEMENT));
});
return this.unify(elementIdSelectedCommands, {
extractValue: true
});
})
.catch(staleElementRetry.bind(this, 'isSelected', arguments));
}; | {
"content_hash": "3761bc7e91719f36c5956cd2ab36b333",
"timestamp": "",
"source": "github",
"line_count": 54,
"max_line_length": 92,
"avg_line_length": 31.185185185185187,
"alnum_prop": 0.6146080760095012,
"repo_name": "CoderHam/WebScraper",
"id": "50eb2eb23e4bf4d218c3e0bdee477e63c5da0d7a",
"size": "1684",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "node_modules/webdriverio/lib/commands/isSelected.js",
"mode": "33261",
"license": "apache-2.0",
"language": [
{
"name": "HTML",
"bytes": "1070"
},
{
"name": "JavaScript",
"bytes": "6347"
}
],
"symlink_target": ""
} |
///////////////////////////////////////////////////////////////////////////////
// Copyright (c) 2001, Eric D. Friedman All Rights Reserved.
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
///////////////////////////////////////////////////////////////////////////////
package com.gemstone.gnu.trove;
/**
* Iterator for maps of type float and Object.
*
* <p>The iterator semantics for Trove's primitive maps is slightly different
* from those defined in <tt>java.util.Iterator</tt>, but still well within
* the scope of the pattern, as defined by Gamma, et al.</p>
*
* <p>This iterator does <b>not</b> implicitly advance to the next entry when
* the value at the current position is retrieved. Rather, you must explicitly
* ask the iterator to <tt>advance()</tt> and then retrieve either the <tt>key()</tt>,
* the <tt>value()</tt> or both. This is done so that you have the option, but not
* the obligation, to retrieve keys and/or values as your application requires, and
* without introducing wrapper objects that would carry both. As the iteration is
* stateful, access to the key/value parts of the current map entry happens in
* constant time.</p>
*
* <p>In practice, the iterator is akin to a "search finger" that you move from
* position to position. Read or write operations affect the current entry only and
* do not assume responsibility for moving the finger.</p>
*
* <p>Here are some sample scenarios for this class of iterator:</p>
*
* <pre>
* // accessing keys/values through an iterator:
* for (TFloatObjectIterator it = map.iterator();
* it.hasNext();) {
* it.forward();
* if (satisfiesCondition(it.key()) {
* doSomethingWithValue(it.value());
* }
* }
* </pre>
*
* <pre>
* // modifying values in-place through iteration:
* for (TFloatObjectIterator it = map.iterator();
* it.hasNext();) {
* it.forward();
* if (satisfiesCondition(it.key()) {
* it.setValue(newValueForKey(it.key()));
* }
* }
* </pre>
*
* <pre>
* // deleting entries during iteration:
* for (TFloatObjectIterator it = map.iterator();
* it.hasNext();) {
* it.forward();
* if (satisfiesCondition(it.key()) {
* it.remove();
* }
* }
* </pre>
*
* <pre>
* // faster iteration by avoiding hasNext():
* TFloatObjectIterator iterator = map.iterator();
* for (int i = map.size(); i-- > 0;) {
* iterator.advance();
* doSomethingWithKeyAndValue(iterator.key(), iterator.value());
* }
* </pre>
*
* @author Eric D. Friedman
* @version $Id: TFloatObjectIterator.java,v 1.1 2002/09/22 21:53:41 ericdf Exp $
*/
public class TFloatObjectIterator extends TPrimitiveIterator {
/** the collection being iterated over */
private final TFloatObjectHashMap _map;
/**
* Creates an iterator over the specified map
*/
public TFloatObjectIterator(TFloatObjectHashMap map) {
super(map);
this._map = map;
}
/**
* Moves the iterator forward to the next entry in the underlying map.
*
* @exception java.util.NoSuchElementException if the iterator is already exhausted
*/
public void advance() {
moveToNextIndex();
}
/**
* Provides access to the key of the mapping at the iterator's position.
* Note that you must <tt>advance()</tt> the iterator at least once
* before invoking this method.
*
* @return the key of the entry at the iterator's current position.
*/
public float key() {
return _map._set[_index];
}
/**
* Provides access to the value of the mapping at the iterator's position.
* Note that you must <tt>advance()</tt> the iterator at least once
* before invoking this method.
*
* @return the value of the entry at the iterator's current position.
*/
public Object value() {
return _map._values[_index];
}
/**
* Replace the value of the mapping at the iterator's position with the
* specified value. Note that you must <tt>advance()</tt> the iterator at
* least once before invoking this method.
*
* @param val the value to set in the current entry
* @return the old value of the entry.
*/
public Object setValue(Object val) {
Object old = value();
_map._values[_index] = val;
return old;
}
}// TFloatObjectIterator
| {
"content_hash": "6a0437b9883da6f8a2389231ce15e40e",
"timestamp": "",
"source": "github",
"line_count": 145,
"max_line_length": 87,
"avg_line_length": 34.48965517241379,
"alnum_prop": 0.6472705458908218,
"repo_name": "gemxd/gemfirexd-oss",
"id": "b5aafac6708d29baf793aebdfa1f397cc6b2b72f",
"size": "5001",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "lgpl/gemfire-trove/src/main/java/com/gemstone/gnu/trove/TFloatObjectIterator.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "AGS Script",
"bytes": "90653"
},
{
"name": "Assembly",
"bytes": "962433"
},
{
"name": "Batchfile",
"bytes": "30248"
},
{
"name": "C",
"bytes": "311620"
},
{
"name": "C#",
"bytes": "1352292"
},
{
"name": "C++",
"bytes": "2030283"
},
{
"name": "CSS",
"bytes": "54987"
},
{
"name": "Gnuplot",
"bytes": "3125"
},
{
"name": "HTML",
"bytes": "8609160"
},
{
"name": "Java",
"bytes": "118027963"
},
{
"name": "JavaScript",
"bytes": "33027"
},
{
"name": "Makefile",
"bytes": "18443"
},
{
"name": "Mathematica",
"bytes": "92588"
},
{
"name": "Objective-C",
"bytes": "1069"
},
{
"name": "PHP",
"bytes": "581417"
},
{
"name": "PLSQL",
"bytes": "86549"
},
{
"name": "PLpgSQL",
"bytes": "33847"
},
{
"name": "Pascal",
"bytes": "808"
},
{
"name": "Perl",
"bytes": "196843"
},
{
"name": "Python",
"bytes": "12796"
},
{
"name": "Ruby",
"bytes": "1380"
},
{
"name": "SQLPL",
"bytes": "219147"
},
{
"name": "Shell",
"bytes": "533575"
},
{
"name": "SourcePawn",
"bytes": "22351"
},
{
"name": "Thrift",
"bytes": "33033"
},
{
"name": "XSLT",
"bytes": "67112"
}
],
"symlink_target": ""
} |
<!DOCTYPE html>
<!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7"> <![endif]-->
<!--[if IE 7]> <html class="no-js lt-ie9 lt-ie8"> <![endif]-->
<!--[if IE 8]> <html class="no-js lt-ie9"> <![endif]-->
<!--[if gt IE 8]><!-->
<html class="no-js">
<!--<![endif]-->
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title></title>
<meta name="description" content="">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- Place favicon.ico and apple-touch-icon.png in the root directory -->
<link rel="stylesheet" href="css/normalize.css">
<link rel="stylesheet" href="css/font-awesome.min.css">
<link rel="stylesheet" href="css/main.css">
<!-- Important Owl stylesheet -->
<link rel="stylesheet" href="css/owl.carousel.css">
<!-- Default Theme -->
<link rel="stylesheet" href="css/owl.theme.css">
<script src="js/vendor/modernizr-2.6.2.min.js"></script>
<link href='https://fonts.googleapis.com/css?family=PT+Sans+Narrow&v1' rel='stylesheet' type='text/css' />
<link href='https://fonts.googleapis.com/css?family=Pacifico' rel='stylesheet' type='text/css' />
<link rel="stylesheet" href="css/jquery.mCustomScrollbar.min.css">
</head>
<body>
<!--[if lt IE 7]>
<p class="browsehappy">You are using an <strong>outdated</strong> browser. Please <a href="https://browsehappy.com/">upgrade your browser</a> to improve your experience.</p>
<![endif]-->
<!-- Add your site or application content here -->
<div class="container">
<!-- menu left -->
<nav id="menu_left" class="fl">
<ul>
<li><a href="index.html"><span class="fa fa-home"></span>Home</a></li>
</ul>
</nav>
<!-- end menu left -->
<div id="right-container" class="container fr">
<div class="top-title">
<a href="index.html" title="home"><h1>Tizen Music Player</h1></a>
</div>
<div class="content" id="container-0">
<!-- carousel 1 -->
<div class="category-wrapper">
<div class="category-header clearfix">
<a class="section-heading fl" name="new releases home" href="javascript:void(0)"><h2>Top 10 US</h2></a>
<div class="fr">
<button tabindex="0" class="fa fa-arrow-circle-o-left previous"></button>
<button tabindex="0" class="fa fa-arrow-circle-o-right next"></button>
</div>
</div>
<div class="category-content">
<ul class="clearfix owl-carousel">
<li class="item-wrapper">
<div class="image-container">
<img src="img/img1.jpg" title="Test" alt="Test" />
<div class="icon-container">
<span class="fa fa-play"></span>
</div>
</div>
<div class="album-name-container">
<a href="details.html"><h3 class="album-name">Sometimes</h3></a>
<a href="javascript:void(0)"><h3 class="artist-name">Artist Name</h3></a>
</div>
</li>
<li class="item-wrapper">
<div class="image-container">
<img src="img/img2.png" title="Test" alt="Test" />
<div class="icon-container">
<span class="fa fa-play"></span>
</div>
</div>
<div class="album-name-container">
<a href="details2.html"><h3 class="album-name">No Promises</h3></a>
<a href="javascript:void(0)"><h3 class="artist-name">Artist Name</h3></a>
</div>
</li>
<li class="item-wrapper">
<div class="image-container">
<img src="img/img3.jpg" title="Test" alt="Test" />
<div class="icon-container">
<span class="fa fa-play"></span>
</div>
</div>
<div class="album-name-container">
<a href="details3.html"><h3 class="album-name">Every Day</h3></a>
<a href="javascript:void(0)"><h3 class="artist-name">Artist Name</h3></a>
</div>
</li>
<li class="item-wrapper">
<div class="image-container">
<img src="img/img4.jpg" title="Test" alt="Test" />
<div class="icon-container">
<span class="fa fa-play"></span>
</div>
</div>
<div class="album-name-container">
<a href="details4.html"><h3 class="album-name">Soledad</h3></a>
<a href="javascript:void(0)"><h3 class="artist-name">Artist Name</h3></a>
</div>
</li>
<li class="item-wrapper">
<div class="image-container">
<img src="img/img5.jpg" title="Test" alt="Test" />
<div class="icon-container">
<span class="fa fa-play"></span>
</div>
</div>
<div class="album-name-container">
<a href="details5.html"><h3 class="album-name">Like A Rose<</h3></a>
<a href="javascript:void(0)"><h3 class="artist-name">Artist Name</h3></a>
</div>
</li>
<li class="item-wrapper">
<div class="image-container">
<img src="img/img6.jpg" title="Test" alt="Test" />
<div class="icon-container">
<span class="fa fa-play"></span>
</div>
</div>
<div class="album-name-container">
<a href="details6.html"><h3 class="album-name">How many</h3></a>
<a href="javascript:void(0)"><h3 class="artist-name">Artist Name</h3></a>
</div>
</li>
<li class="item-wrapper">
<div class="image-container">
<img src="img/img7.jpg" title="Test" alt="Test" />
<div class="icon-container">
<span class="fa fa-play"></span>
</div>
</div>
<div class="album-name-container">
<a href="details7.html"><h3 class="album-name">No Promises</h3></a>
<a href="javascript:void(0)"><h3 class="artist-name">Artist Name</h3></a>
</div>
</li>
</ul>
</div>
</div>
<!-- carousel 2 -->
<div class="category-wrapper">
<div class="category-header clearfix">
<a class="section-heading fl" name="new releases home" href="javascript:void(0)"><h2>New releases</h2></a>
<div class="fr">
<button tabindex="0" class="fa fa-arrow-circle-o-left previous"></button>
<button tabindex="0" class="fa fa-arrow-circle-o-right next"></button>
</div>
</div>
<div class="category-content">
<ul class="clearfix owl-carousel">
<li class="item-wrapper">
<div class="image-container">
<img src="img/img8.jpg" title="Test" alt="Test" />
<div class="icon-container">
<span class="fa fa-play"></span>
</div>
</div>
<div class="album-name-container">
<a href="details8.html"><h3 class="album-name">Bangla Collection</h3></a>
<a href="javascript:void(0)"><h3 class="artist-name">Artist Name</h3></a>
</div>
</li>
<li class="item-wrapper">
<div class="image-container">
<img src="img/img7.jpg" title="Test" alt="Test" />
<div class="icon-container">
<span class="fa fa-play"></span>
</div>
</div>
<div class="album-name-container">
<a href="details7.html"><h3 class="album-name">No Promises</h3></a>
<a href="javascript:void(0)"><h3 class="artist-name">Artist Name</h3></a>
</div>
</li>
<li class="item-wrapper">
<div class="image-container">
<img src="img/img9.jpg" title="Test" alt="Test" />
<div class="icon-container">
<span class="fa fa-play"></span>
</div>
</div>
<div class="album-name-container">
<a href="details9.html"><h3 class="album-name">How many</h3></a>
<a href="javascript:void(0)"><h3 class="artist-name">Artist Name</h3></a>
</div>
</li>
<li class="item-wrapper">
<div class="image-container">
<img src="img/img1.jpg" title="Test" alt="Test" />
<div class="icon-container">
<span class="fa fa-play"></span>
</div>
</div>
<div class="album-name-container">
<a href="details1.html"><h3 class="album-name">Soledad</h3></a>
<a href="javascript:void(0)"><h3 class="artist-name">Artist Name</h3></a>
</div>
</li>
<li class="item-wrapper">
<div class="image-container">
<img src="img/img10.jpg" title="Test" alt="Test" />
<div class="icon-container">
<span class="fa fa-play"></span>
</div>
</div>
<div class="album-name-container">
<a href="details10.html"><h3 class="album-name">Every Day</h3></a>
<a href="javascript:void(0)"><h3 class="artist-name">Artist Name</h3></a>
</div>
</li>
<li class="item-wrapper">
<div class="image-container">
<img src="img/img4.jpg" title="Test" alt="Test" />
<div class="icon-container">
<span class="fa fa-play"></span>
</div>
</div>
<div class="album-name-container">
<a href="details4.html"><h3 class="album-name">Every Day</h3></a>
<a href="javascript:void(0)"><h3 class="artist-name">Artist Name</h3></a>
</div>
</li>
<li class="item-wrapper">
<div class="image-container">
<img src="img/img5.jpg" title="Test" alt="Test" />
<div class="icon-container">
<span class="fa fa-play"></span>
</div>
</div>
<div class="album-name-container">
<a href="details5.html"><h3 class="album-name">Like A Rose<</h3></a>
<a href="javascript:void(0)"><h3 class="artist-name">Artist Name</h3></a>
</div>
</li>
<li class="item-wrapper">
<div class="image-container">
<img src="img/img2.png" title="Test" alt="Test" />
<div class="icon-container">
<span class="fa fa-play"></span>
</div>
</div>
<div class="album-name-container">
<a href="details2.html"><h3 class="album-name">No Promises</h3></a>
<a href="javascript:void(0)"><h3 class="artist-name">Artist Name</h3></a>
</div>
</li>
</ul>
</div>
</div>
<!-- carousel 3 -->
<div class="category-wrapper">
<div class="category-header clearfix">
<a class="section-heading fl" name="new releases home" href="javascript:void(0)"><h2>Discover</h2></a>
<div class="fr">
<button tabindex="0" class="fa fa-arrow-circle-o-left previous"></button>
<button tabindex="0" class="fa fa-arrow-circle-o-right next"></button>
</div>
</div>
<div class="category-content">
<ul class="clearfix owl-carousel circle">
<li class="item-wrapper circle">
<div class="image-container">
<img src="img/img3.jpg" title="Test" alt="Test" />
<a tabindex="-1" href="details3.html"><h3 class="album-name">How many</h3></a>
</div>
</li>
<li class="item-wrapper circle">
<div class="image-container">
<img src="img/img7.jpg" title="Test" alt="Test" />
<a tabindex="-1" href="details7.html"><h3 class="album-name">How many</h3></a>
</div>
</li>
<li class="item-wrapper circle">
<div class="image-container">
<img src="img/img9.jpg" title="Test" alt="Test" />
<a tabindex="-1" href="details9.html"><h3 class="album-name">How many</h3></a>
</div>
</li>
<li class="item-wrapper circle">
<div class="image-container">
<img src="img/img2.png" title="Test" alt="Test" />
<a tabindex="-1" href="details2.html"><h3 class="album-name">How many</h3></a>
</div>
</li>
<li class="item-wrapper circle">
<div class="image-container">
<img src="img/img4.jpg" title="Test" alt="Test" />
<a tabindex="-1" href="details4.html"><h3 class="album-name">How many</h3></a>
</div>
</li>
<li class="item-wrapper circle">
<div class="image-container">
<img src="img/img6.jpg" title="Test" alt="Test" />
<a tabindex="-1" href="details6.html"><h3 class="album-name">How many</h3></a>
</div>
</li>
<li class="item-wrapper circle">
<div class="image-container">
<img src="img/img5.jpg" title="Test" alt="Test" />
<a tabindex="-1" href="details.html"><h3 class="album-name">How many</h3></a>
</div>
</li>
<li class="item-wrapper circle">
<div class="image-container">
<img src="img/img1.jpg" title="Test" alt="Test" />
<a tabindex="-1" href="details1.html"><h3 class="album-name">How many</h3></a>
</div>
</li>
<li class="item-wrapper circle">
<div class="image-container">
<img src="img/img8.jpg" title="Test" alt="Test" />
<a tabindex="-1" href="details8.html"><h3 class="album-name">How many</h3></a>
</div>
</li>
</ul>
</div>
</div>
</div>
</div>
<!-- end right container -->
</div>
<script src="https://code.jquery.com/jquery-1.10.2.min.js"></script>
<script>
window.jQuery || document.write('<script src="js/vendor/jquery-1.10.2.min.js"><\/script>')
</script>
<script src="js/vendor/owl.carousel.min.js"></script>
<script src="js/plugins.js"></script>
<script src="js/main.js"></script>
<script src="js/index.js"></script>
</body>
</html>
| {
"content_hash": "1f976646a3f033b0ef83d4593b02fce2",
"timestamp": "",
"source": "github",
"line_count": 340,
"max_line_length": 185,
"avg_line_length": 59.24411764705882,
"alnum_prop": 0.3639477734200467,
"repo_name": "quang-hcmus-91/Tizen-Music-Player",
"id": "370442ac4673bd9578b9d9c9ec341f5055aac2ec",
"size": "20143",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "index.html",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "ApacheConf",
"bytes": "24603"
},
{
"name": "CSS",
"bytes": "33162"
},
{
"name": "HTML",
"bytes": "68577"
},
{
"name": "JavaScript",
"bytes": "7110"
}
],
"symlink_target": ""
} |
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<groupId>org.gosu-lang.gosu</groupId>
<artifactId>gosu-parent</artifactId>
<version>1-X-SNAPSHOT</version>
<relativePath>../gosu-parent/pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>gosu</artifactId>
<packaging>pom</packaging>
<name>Gosu :: Distribution POM</name>
<properties>
<project.build.assemblyDescriptorDirectory>src/main/assembly</project.build.assemblyDescriptorDirectory>
<project.build.textDirectory>src/main/text</project.build.textDirectory>
</properties>
<dependencies>
<dependency>
<groupId>org.gosu-lang.gosu</groupId>
<artifactId>gosu-core-api</artifactId>
<version>${project.parent.version}</version>
</dependency>
<dependency>
<groupId>org.gosu-lang.gosu</groupId>
<artifactId>gosu-core</artifactId>
<version>${project.parent.version}</version>
<scope>runtime</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
<version>2.3</version>
<configuration>
<descriptors>
<descriptor>${project.build.assemblyDescriptorDirectory}/full.xml</descriptor>
</descriptors>
<encoding>UTF-8</encoding>
</configuration>
<executions>
<execution>
<id>make-assembly</id>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
</execution>
</executions>
<dependencies>
<dependency>
<!-- Fixes issue with wrong permissions set in zips (http://jira.codehaus.org/browse/MASSEMBLY-449) -->
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-archiver</artifactId>
<version>2.2</version>
</dependency>
</dependencies>
</plugin>
</plugins>
</build>
</project>
| {
"content_hash": "c254aba1c3c11ff4d2dfe6ce3ce04a8c",
"timestamp": "",
"source": "github",
"line_count": 67,
"max_line_length": 204,
"avg_line_length": 33.014925373134325,
"alnum_prop": 0.6270343580470162,
"repo_name": "tcmoore32/sheer-madness",
"id": "9f0dbd184202997a937c54b5cdc47521594fea2b",
"size": "2212",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "gosu/pom.xml",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Batchfile",
"bytes": "7707"
},
{
"name": "GAP",
"bytes": "51837"
},
{
"name": "Gosu",
"bytes": "16343290"
},
{
"name": "Groovy",
"bytes": "1611"
},
{
"name": "HTML",
"bytes": "4998"
},
{
"name": "Java",
"bytes": "12820028"
},
{
"name": "JavaScript",
"bytes": "1060972"
},
{
"name": "Makefile",
"bytes": "6850"
},
{
"name": "Python",
"bytes": "8450"
},
{
"name": "Shell",
"bytes": "1046"
}
],
"symlink_target": ""
} |
define([
"jquery",
"underscore",
"backbone",
"marionette",
"../collections/agent-query-collection"
],
function($, _, Backbone, Marionette, AgentQueryCollection) {
var DeployCommand = Backbone.Model.extend({
url: "/deploy/deploy"
});
return Marionette.ItemView.extend({
el: $("#asimov-modal"),
template: "dashboard/confirm-deploy-view",
events: {
"click .btn-close": "close",
"click .btn-deploy": "deploy"
},
initialize: function(options) {
_.bindAll(this, "show");
this.createModel(options);
this.parameters = new AgentQueryCollection({
agentUrl: "/units/deploy-parameters/:unitName",
agentName: this.anyAgentName,
unitName: this.unitName
});
this.parameters.on("add", this.parametersLoaded, this);
this.model.on("change", this.render, this);
},
createModel: function(options) {
this.unitName = options.unitName;
this.anyAgentName = options.agentNames[0];
this.hasDeployParameters = options.hasDeployParameters;
this.deployInfo = options.deployInfo;
this.agentNames = options.agentNames;
this.model = new Backbone.Model({
unitName: this.unitName,
version: this.deployInfo.version,
branch: this.deployInfo.branch,
agents: this.agentNames
});
},
show: function() {
if (this.hasDeployParameters) {
this.parameters.fetch();
}
this.render();
$(".modal").modal("show");
},
parametersLoaded: function() {
this.model.set({parameters: this.parameters.toJSON()});
},
close: function() {
$(".modal").modal("hide");
this.undelegateEvents();
},
deploy: function() {
var parameterValues = {};
this.parameters.forEach(function(param) {
var paramName = param.get('name');
parameterValues[paramName] = $("#deploy-param-" + paramName).val();
});
_.forEach(this.agentNames, function(agentName) {
this.deployUnitInstance(agentName, parameterValues);
}, this);
this.close();
},
deployUnitInstance: function(agentName, parameterValues) {
new DeployCommand({
agentName: agentName,
unitName: this.unitName,
versionId: this.deployInfo.versionId,
parameters: parameterValues
}).save();
}
});
}); | {
"content_hash": "736f3b2196f4c1964142bfacd5532ecc",
"timestamp": "",
"source": "github",
"line_count": 98,
"max_line_length": 71,
"avg_line_length": 22.316326530612244,
"alnum_prop": 0.663923182441701,
"repo_name": "daniellee/asimov-deploy",
"id": "6638b07793b2cd9e50e8d7ba6653556af3982eb4",
"size": "2922",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "public/app/dashboard/confirm-deploy-view.js",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "16123"
},
{
"name": "CoffeeScript",
"bytes": "1282"
},
{
"name": "HTML",
"bytes": "67419"
},
{
"name": "JavaScript",
"bytes": "736424"
}
],
"symlink_target": ""
} |
namespace ash {
namespace {
constexpr char kDebuggingScreenId[] = "debugging";
const test::UIPath kRemoveProtectionDialog = {kDebuggingScreenId,
"removeProtectionDialog"};
const test::UIPath kSetupDialog = {kDebuggingScreenId, "setupDialog"};
const test::UIPath kWaitDialog = {kDebuggingScreenId, "waitDialog"};
const test::UIPath kDoneDialog = {kDebuggingScreenId, "doneDialog"};
const test::UIPath kErrorDialog = {kDebuggingScreenId, "errorDialog"};
const test::UIPath kHelpLink = {kDebuggingScreenId, "help-link"};
const test::UIPath kPasswordInput = {kDebuggingScreenId, "password"};
const test::UIPath kPassword2Input = {kDebuggingScreenId, "passwordRepeat"};
const test::UIPath kPasswordNote = {kDebuggingScreenId, "password-note"};
const test::UIPath kCancelButton = {kDebuggingScreenId,
"removeProtectionCancelButton"};
const test::UIPath kEnableButton = {kDebuggingScreenId, "enableButton"};
const test::UIPath kRemoveProtectionButton = {kDebuggingScreenId,
"removeProtectionProceedButton"};
class TestDebugDaemonClient : public FakeDebugDaemonClient {
public:
TestDebugDaemonClient() = default;
~TestDebugDaemonClient() override = default;
// FakeDebugDaemonClient overrides:
void SetDebuggingFeaturesStatus(int featues_mask) override {
ResetWait();
FakeDebugDaemonClient::SetDebuggingFeaturesStatus(featues_mask);
}
void EnableDebuggingFeatures(const std::string& password,
EnableDebuggingCallback callback) override {
FakeDebugDaemonClient::EnableDebuggingFeatures(
password,
base::BindOnce(&TestDebugDaemonClient::OnEnableDebuggingFeatures,
base::Unretained(this), std::move(callback)));
}
void RemoveRootfsVerification(EnableDebuggingCallback callback) override {
FakeDebugDaemonClient::RemoveRootfsVerification(
base::BindOnce(&TestDebugDaemonClient::OnRemoveRootfsVerification,
base::Unretained(this), std::move(callback)));
}
void QueryDebuggingFeatures(QueryDevFeaturesCallback callback) override {
LOG(WARNING) << "QueryDebuggingFeatures";
FakeDebugDaemonClient::QueryDebuggingFeatures(
base::BindOnce(&TestDebugDaemonClient::OnQueryDebuggingFeatures,
base::Unretained(this), std::move(callback)));
}
void OnRemoveRootfsVerification(EnableDebuggingCallback original_callback,
bool succeeded) {
LOG(WARNING) << "OnRemoveRootfsVerification: succeeded = " << succeeded;
base::ThreadTaskRunnerHandle::Get()->PostTask(
FROM_HERE, base::BindOnce(std::move(original_callback), succeeded));
if (runner_.get())
runner_->Quit();
else
got_reply_ = true;
num_remove_protection_++;
}
void OnQueryDebuggingFeatures(QueryDevFeaturesCallback original_callback,
bool succeeded,
int feature_mask) {
LOG(WARNING) << "OnQueryDebuggingFeatures: succeeded = " << succeeded
<< ", feature_mask = " << feature_mask;
base::ThreadTaskRunnerHandle::Get()->PostTask(
FROM_HERE,
base::BindOnce(std::move(original_callback), succeeded, feature_mask));
if (runner_.get())
runner_->Quit();
else
got_reply_ = true;
num_query_debugging_features_++;
}
void OnEnableDebuggingFeatures(EnableDebuggingCallback original_callback,
bool succeeded) {
LOG(WARNING) << "OnEnableDebuggingFeatures: succeeded = " << succeeded
<< ", feature_mask = ";
base::ThreadTaskRunnerHandle::Get()->PostTask(
FROM_HERE, base::BindOnce(std::move(original_callback), succeeded));
if (runner_.get())
runner_->Quit();
else
got_reply_ = true;
num_enable_debugging_features_++;
}
void ResetWait() {
got_reply_ = false;
num_query_debugging_features_ = 0;
num_enable_debugging_features_ = 0;
num_remove_protection_ = 0;
}
int num_query_debugging_features() const {
return num_query_debugging_features_;
}
int num_enable_debugging_features() const {
return num_enable_debugging_features_;
}
int num_remove_protection() const { return num_remove_protection_; }
void WaitUntilCalled() {
if (got_reply_)
return;
runner_ = new content::MessageLoopRunner;
runner_->Run();
}
private:
scoped_refptr<content::MessageLoopRunner> runner_;
bool got_reply_ = false;
int num_query_debugging_features_ = 0;
int num_enable_debugging_features_ = 0;
int num_remove_protection_ = 0;
};
} // namespace
class EnableDebuggingTestBase : public OobeBaseTest {
public:
EnableDebuggingTestBase() = default;
EnableDebuggingTestBase(const EnableDebuggingTestBase&) = delete;
EnableDebuggingTestBase& operator=(const EnableDebuggingTestBase&) = delete;
~EnableDebuggingTestBase() override = default;
// OobeBaseTest:
void SetUpCommandLine(base::CommandLine* command_line) override {
OobeBaseTest::SetUpCommandLine(command_line);
// Disable HID detection because it takes precedence and could block
// enable-debugging UI.
command_line->AppendSwitch(switches::kDisableHIDDetectionOnOOBEForTesting);
}
void SetUpInProcessBrowserTestFixture() override {
debug_daemon_client_ = new TestDebugDaemonClient;
chromeos::DBusThreadManager::GetSetterForTesting()->SetDebugDaemonClient(
std::unique_ptr<DebugDaemonClient>(debug_daemon_client_));
OobeBaseTest::SetUpInProcessBrowserTestFixture();
}
void InvokeEnableDebuggingScreen() {
LoginDisplayHost::default_host()->HandleAccelerator(
LoginAcceleratorAction::kEnableDebugging);
OobeScreenWaiter(EnableDebuggingScreenView::kScreenId).Wait();
}
void CloseEnableDebuggingScreen() { test::OobeJS().TapOnPath(kCancelButton); }
void ClickEnableButton() { test::OobeJS().TapOnPath(kEnableButton); }
void ShowRemoveProtectionScreen() {
debug_daemon_client_->SetDebuggingFeaturesStatus(
DebugDaemonClient::DEV_FEATURE_NONE);
OobeBaseTest::MaybeWaitForLoginScreenLoad();
test::OobeJS().ExpectHidden(kDebuggingScreenId);
InvokeEnableDebuggingScreen();
test::OobeJS().ExpectVisiblePath(kRemoveProtectionDialog);
test::OobeJS().ExpectVisiblePath(kRemoveProtectionButton);
test::OobeJS().ExpectVisiblePath(kHelpLink);
debug_daemon_client_->WaitUntilCalled();
base::RunLoop().RunUntilIdle();
}
void ShowSetupScreen() {
debug_daemon_client_->SetDebuggingFeaturesStatus(
debugd::DevFeatureFlag::DEV_FEATURE_ROOTFS_VERIFICATION_REMOVED);
OobeBaseTest::MaybeWaitForLoginScreenLoad();
test::OobeJS().ExpectHidden(kDebuggingScreenId);
InvokeEnableDebuggingScreen();
test::OobeJS().ExpectVisiblePath(kSetupDialog);
debug_daemon_client_->WaitUntilCalled();
base::RunLoop().RunUntilIdle();
test::OobeJS().ExpectVisiblePath(kPasswordInput);
test::OobeJS().ExpectVisiblePath(kPassword2Input);
test::OobeJS().ExpectVisiblePath(kPasswordNote);
}
TestDebugDaemonClient* debug_daemon_client_ = nullptr;
};
class EnableDebuggingDevTest : public EnableDebuggingTestBase {
public:
EnableDebuggingDevTest() = default;
~EnableDebuggingDevTest() override = default;
// EnableDebuggingTestBase:
void SetUpCommandLine(base::CommandLine* command_line) override {
EnableDebuggingTestBase::SetUpCommandLine(command_line);
command_line->AppendSwitch(chromeos::switches::kSystemDevMode);
}
};
// Show remove protection screen, click on [Cancel] button.
IN_PROC_BROWSER_TEST_F(EnableDebuggingDevTest, ShowAndCancelRemoveProtection) {
ShowRemoveProtectionScreen();
CloseEnableDebuggingScreen();
test::OobeJS().ExpectHidden(kDebuggingScreenId);
EXPECT_EQ(debug_daemon_client_->num_query_debugging_features(), 1);
EXPECT_EQ(debug_daemon_client_->num_enable_debugging_features(), 0);
EXPECT_EQ(debug_daemon_client_->num_remove_protection(), 0);
}
// Show remove protection, click on [Remove protection] button and wait for
// reboot.
IN_PROC_BROWSER_TEST_F(EnableDebuggingDevTest, ShowAndRemoveProtection) {
ShowRemoveProtectionScreen();
debug_daemon_client_->ResetWait();
test::OobeJS().TapOnPath(kRemoveProtectionButton);
debug_daemon_client_->WaitUntilCalled();
test::OobeJS().ExpectVisiblePath(kWaitDialog);
// Check if we have rebooted after enabling.
base::RunLoop().RunUntilIdle();
EXPECT_EQ(debug_daemon_client_->num_remove_protection(), 1);
EXPECT_EQ(debug_daemon_client_->num_enable_debugging_features(), 0);
EXPECT_EQ(FakePowerManagerClient::Get()->num_request_restart_calls(), 1);
}
// Show setup screen. Click on [Enable] button. Wait until done screen is shown.
IN_PROC_BROWSER_TEST_F(EnableDebuggingDevTest, ShowSetup) {
ShowSetupScreen();
debug_daemon_client_->ResetWait();
ClickEnableButton();
debug_daemon_client_->WaitUntilCalled();
test::OobeJS().CreateVisibilityWaiter(true, kDoneDialog)->Wait();
EXPECT_EQ(debug_daemon_client_->num_enable_debugging_features(), 1);
EXPECT_EQ(debug_daemon_client_->num_remove_protection(), 0);
}
// Show setup screen. Type in matching passwords.
// Click on [Enable] button. Wait until done screen is shown.
IN_PROC_BROWSER_TEST_F(EnableDebuggingDevTest, SetupMatchingPasswords) {
ShowSetupScreen();
debug_daemon_client_->ResetWait();
test::OobeJS().TypeIntoPath("test0000", kPasswordInput);
test::OobeJS().TypeIntoPath("test0000", kPassword2Input);
ClickEnableButton();
debug_daemon_client_->WaitUntilCalled();
test::OobeJS().CreateVisibilityWaiter(true, kDoneDialog)->Wait();
EXPECT_EQ(debug_daemon_client_->num_enable_debugging_features(), 1);
EXPECT_EQ(debug_daemon_client_->num_remove_protection(), 0);
}
// Show setup screen. Type in different passwords.
// Click on [Enable] button. Assert done screen is not shown.
// Then confirm that typing in matching passwords enables debugging features.
IN_PROC_BROWSER_TEST_F(EnableDebuggingDevTest, SetupNotMatchingPasswords) {
ShowSetupScreen();
debug_daemon_client_->ResetWait();
test::OobeJS().TypeIntoPath("test0000", kPasswordInput);
test::OobeJS().TypeIntoPath("test9999", kPassword2Input);
test::OobeJS().ExpectDisabledPath(kEnableButton);
EXPECT_EQ(debug_daemon_client_->num_enable_debugging_features(), 0);
EXPECT_EQ(debug_daemon_client_->num_remove_protection(), 0);
test::OobeJS().TypeIntoPath("test0000", kPassword2Input);
ClickEnableButton();
debug_daemon_client_->WaitUntilCalled();
test::OobeJS().CreateVisibilityWaiter(true, kDoneDialog)->Wait();
EXPECT_EQ(debug_daemon_client_->num_enable_debugging_features(), 1);
EXPECT_EQ(debug_daemon_client_->num_remove_protection(), 0);
}
// Test images come with some features enabled but still has rootfs protection.
// Invoking debug screen should show remove protection screen.
IN_PROC_BROWSER_TEST_F(EnableDebuggingDevTest, ShowOnTestImages) {
debug_daemon_client_->SetDebuggingFeaturesStatus(
debugd::DevFeatureFlag::DEV_FEATURE_SSH_SERVER_CONFIGURED |
debugd::DevFeatureFlag::DEV_FEATURE_SYSTEM_ROOT_PASSWORD_SET);
OobeBaseTest::MaybeWaitForLoginScreenLoad();
test::OobeJS().ExpectHidden(kDebuggingScreenId);
InvokeEnableDebuggingScreen();
test::OobeJS().ExpectVisiblePath(kRemoveProtectionDialog);
debug_daemon_client_->WaitUntilCalled();
base::RunLoop().RunUntilIdle();
EXPECT_EQ(debug_daemon_client_->num_query_debugging_features(), 1);
EXPECT_EQ(debug_daemon_client_->num_enable_debugging_features(), 0);
EXPECT_EQ(debug_daemon_client_->num_remove_protection(), 0);
}
IN_PROC_BROWSER_TEST_F(EnableDebuggingDevTest, WaitForDebugDaemon) {
// Stat with service not ready.
debug_daemon_client_->SetServiceIsAvailable(false);
debug_daemon_client_->SetDebuggingFeaturesStatus(
DebugDaemonClient::DEV_FEATURE_NONE);
OobeBaseTest::MaybeWaitForLoginScreenLoad();
// Invoking UI and it should land on wait-view.
test::OobeJS().ExpectHidden(kDebuggingScreenId);
InvokeEnableDebuggingScreen();
test::OobeJS().ExpectVisiblePath(kWaitDialog);
// Mark service ready and it should proceed to remove protection view.
debug_daemon_client_->SetServiceIsAvailable(true);
debug_daemon_client_->WaitUntilCalled();
base::RunLoop().RunUntilIdle();
test::OobeJS().ExpectVisiblePath(kRemoveProtectionDialog);
}
class EnableDebuggingNonDevTest : public EnableDebuggingTestBase {
public:
EnableDebuggingNonDevTest() = default;
void SetUpInProcessBrowserTestFixture() override {
chromeos::DBusThreadManager::GetSetterForTesting()->SetDebugDaemonClient(
std::unique_ptr<DebugDaemonClient>(new FakeDebugDaemonClient));
EnableDebuggingTestBase::SetUpInProcessBrowserTestFixture();
}
};
// Try to show enable debugging dialog, we should see error screen here.
IN_PROC_BROWSER_TEST_F(EnableDebuggingNonDevTest, NoShowInNonDevMode) {
test::OobeJS().ExpectHidden(kDebuggingScreenId);
InvokeEnableDebuggingScreen();
test::OobeJS().CreateVisibilityWaiter(true, kErrorDialog)->Wait();
}
class EnableDebuggingRequestedTest : public EnableDebuggingDevTest {
public:
EnableDebuggingRequestedTest() {}
// EnableDebuggingDevTest overrides:
bool SetUpUserDataDirectory() override {
base::DictionaryValue local_state_dict;
local_state_dict.SetBoolean(prefs::kDebuggingFeaturesRequested, true);
base::FilePath user_data_dir;
CHECK(base::PathService::Get(chrome::DIR_USER_DATA, &user_data_dir));
base::FilePath local_state_path =
user_data_dir.Append(chrome::kLocalStateFilename);
CHECK(
JSONFileValueSerializer(local_state_path).Serialize(local_state_dict));
return EnableDebuggingDevTest::SetUpUserDataDirectory();
}
void SetUpInProcessBrowserTestFixture() override {
EnableDebuggingDevTest::SetUpInProcessBrowserTestFixture();
debug_daemon_client_->SetDebuggingFeaturesStatus(
debugd::DevFeatureFlag::DEV_FEATURE_ROOTFS_VERIFICATION_REMOVED);
}
};
// Setup screen is automatically shown when the feature is requested.
IN_PROC_BROWSER_TEST_F(EnableDebuggingRequestedTest, AutoShowSetup) {
OobeScreenWaiter(EnableDebuggingScreenView::kScreenId).Wait();
}
// Canceling auto shown setup screen should close it.
IN_PROC_BROWSER_TEST_F(EnableDebuggingRequestedTest, CancelAutoShowSetup) {
OobeScreenWaiter(EnableDebuggingScreenView::kScreenId).Wait();
CloseEnableDebuggingScreen();
test::OobeJS().ExpectHidden(kDebuggingScreenId);
}
} // namespace ash
| {
"content_hash": "ede5b1f9aa69a4afeb3ce6d9e99fb7c1",
"timestamp": "",
"source": "github",
"line_count": 382,
"max_line_length": 80,
"avg_line_length": 38.22774869109948,
"alnum_prop": 0.7312880914880504,
"repo_name": "ric2b/Vivaldi-browser",
"id": "92302fb27ca90b31ca83ad207d41fb87164b9327",
"size": "16356",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "chromium/chrome/browser/ash/login/enable_debugging_browsertest.cc",
"mode": "33188",
"license": "bsd-3-clause",
"language": [],
"symlink_target": ""
} |
/*
Copyright 2011 Dean Camera (dean [at] fourwalledcubicle [dot] com)
Permission to use, copy, modify, distribute, and sell this
software and its documentation for any purpose is hereby granted
without fee, provided that the above copyright notice appear in
all copies and that both that the copyright notice and this
permission notice and warranty disclaimer appear in supporting
documentation, and that the name of the author not be used in
advertising or publicity pertaining to distribution of the
software without specific, written prior permission.
The author disclaim all warranties with regard to this
software, including all implied warranties of merchantability
and fitness. In no event shall the author be liable for any
special, indirect or consequential damages or any damages
whatsoever resulting from loss of use, data or profits, whether
in an action of contract, negligence or other tortious action,
arising out of or in connection with the use or performance of
this software.
*/
/** \file
* \brief Board specific Buttons driver header for Tom's USBTINY MKII.
* \copydetails Group_Buttons_USBTINYMKII
*
* \note This file should not be included directly. It is automatically included as needed by the Buttons driver
* dispatch header located in LUFA/Drivers/Board/Buttons.h.
*/
/** \ingroup Group_Buttons
* \defgroup Group_Buttons_USBTINYMKII USBTINYMKII
* \brief Board specific Buttons driver header for Tom's USBTINY MKII.
*
* Board specific Buttons driver header for Tom's USBTINY MKII (http://tom-itx.dyndns.org:81/~webpage/).
*
* @{
*/
#ifndef __BUTTONS_USBTINYMKII_H__
#define __BUTTONS_USBTINYMKII_H__
/* Includes: */
#include "../../../../Common/Common.h"
/* Enable C linkage for C++ Compilers: */
#if defined(__cplusplus)
extern "C" {
#endif
/* Preprocessor Checks: */
#if !defined(__INCLUDE_FROM_BUTTONS_H)
#error Do not include this file directly. Include LUFA/Drivers/Board/Buttons.h instead.
#endif
/* Public Interface - May be used in end-application: */
/* Macros: */
/** Button mask for the first button on the board. */
#define BUTTONS_BUTTON1 (1 << 7)
/* Inline Functions: */
#if !defined(__DOXYGEN__)
static inline void Buttons_Init(void)
{
DDRD &= ~BUTTONS_BUTTON1;
PORTD |= BUTTONS_BUTTON1;
}
static inline uint8_t Buttons_GetStatus(void) ATTR_WARN_UNUSED_RESULT;
static inline uint8_t Buttons_GetStatus(void)
{
return ((PIND & BUTTONS_BUTTON1) ^ BUTTONS_BUTTON1);
}
#endif
/* Disable C linkage for C++ Compilers: */
#if defined(__cplusplus)
}
#endif
#endif
/** @} */
| {
"content_hash": "7eeb7bb28e4d06d0426f0e94d10c9fae",
"timestamp": "",
"source": "github",
"line_count": 86,
"max_line_length": 113,
"avg_line_length": 31.023255813953487,
"alnum_prop": 0.7110194902548725,
"repo_name": "Portwell/Sense8",
"id": "20cb340541e543123ca9cdc3d47b04286fb56099",
"size": "2806",
"binary": false,
"copies": "13",
"ref": "refs/heads/master",
"path": "Sense8_32u4_boards-master.1.0.0/bootloaders/caterina/LUFA-111009/LUFA/Drivers/Board/AVR8/USBTINYMKII/Buttons.h",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Assembly",
"bytes": "3032"
},
{
"name": "C",
"bytes": "4565660"
},
{
"name": "C#",
"bytes": "20196"
},
{
"name": "C++",
"bytes": "705676"
},
{
"name": "HTML",
"bytes": "482"
},
{
"name": "Makefile",
"bytes": "1736587"
}
],
"symlink_target": ""
} |
document.write('<script type="text/javascript" src="searching2.js"></script>');
var myElement = document.getElementById('results');
var JavaScriptCode = document.createElement("script");
JavaScriptCode.setAttribute('type', 'text/javascript');
JavaScriptCode.setAttribute("src", 'data.js');
document.getElementById('results').appendChild(JavaScriptCode);
| {
"content_hash": "46882198b2135440e7ff6ec1399775e5",
"timestamp": "",
"source": "github",
"line_count": 7,
"max_line_length": 79,
"avg_line_length": 50.714285714285715,
"alnum_prop": 0.7774647887323943,
"repo_name": "LuisMiranda132/interfaces",
"id": "8d714c983619affc9653e1054a6fe81449be0093",
"size": "355",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "search.js",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "20705"
},
{
"name": "JavaScript",
"bytes": "58543"
}
],
"symlink_target": ""
} |
package e2e
import (
"fmt"
"sort"
"strings"
"time"
"k8s.io/kubernetes/pkg/api"
"k8s.io/kubernetes/pkg/client/cache"
"k8s.io/kubernetes/pkg/runtime"
"k8s.io/kubernetes/pkg/util/flowcontrol"
"k8s.io/kubernetes/pkg/util/sets"
"k8s.io/kubernetes/pkg/watch"
"k8s.io/kubernetes/test/e2e/framework"
. "github.com/onsi/ginkgo"
)
type durations []time.Duration
func (d durations) Len() int { return len(d) }
func (d durations) Less(i, j int) bool { return d[i] < d[j] }
func (d durations) Swap(i, j int) { d[i], d[j] = d[j], d[i] }
var _ = framework.KubeDescribe("Service endpoints latency", func() {
f := framework.NewDefaultFramework("svc-latency")
It("should not be very high [Conformance]", func() {
const (
// These are very generous criteria. Ideally we will
// get this much lower in the future. See issue
// #10436.
limitMedian = time.Second * 20
limitTail = time.Second * 50
// Numbers chosen to make the test complete in a short amount
// of time. This sample size is not actually large enough to
// reliably measure tails (it may give false positives, but not
// false negatives), but it should catch low hanging fruit.
//
// Note that these are fixed and do not depend on the
// size of the cluster. Setting parallelTrials larger
// distorts the measurements. Perhaps this wouldn't be
// true on HA clusters.
totalTrials = 200
parallelTrials = 15
minSampleSize = 100
)
// Turn off rate limiting--it interferes with our measurements.
oldThrottle := f.Client.RESTClient.Throttle
f.Client.RESTClient.Throttle = flowcontrol.NewFakeAlwaysRateLimiter()
defer func() { f.Client.RESTClient.Throttle = oldThrottle }()
failing := sets.NewString()
d, err := runServiceLatencies(f, parallelTrials, totalTrials)
if err != nil {
failing.Insert(fmt.Sprintf("Not all RC/pod/service trials succeeded: %v", err))
}
dSorted := durations(d)
sort.Sort(dSorted)
n := len(dSorted)
if n < minSampleSize {
failing.Insert(fmt.Sprintf("Did not get a good sample size: %v", dSorted))
}
if n < 2 {
failing.Insert("Less than two runs succeeded; aborting.")
Fail(strings.Join(failing.List(), "\n"))
}
percentile := func(p int) time.Duration {
est := n * p / 100
if est >= n {
return dSorted[n-1]
}
return dSorted[est]
}
framework.Logf("Latencies: %v", dSorted)
p50 := percentile(50)
p90 := percentile(90)
p99 := percentile(99)
framework.Logf("50 %%ile: %v", p50)
framework.Logf("90 %%ile: %v", p90)
framework.Logf("99 %%ile: %v", p99)
framework.Logf("Total sample count: %v", len(dSorted))
if p50 > limitMedian {
failing.Insert("Median latency should be less than " + limitMedian.String())
}
if p99 > limitTail {
failing.Insert("Tail (99 percentile) latency should be less than " + limitTail.String())
}
if failing.Len() > 0 {
errList := strings.Join(failing.List(), "\n")
helpfulInfo := fmt.Sprintf("\n50, 90, 99 percentiles: %v %v %v", p50, p90, p99)
Fail(errList + helpfulInfo)
}
})
})
func runServiceLatencies(f *framework.Framework, inParallel, total int) (output []time.Duration, err error) {
cfg := framework.RCConfig{
Client: f.Client,
Image: framework.GetPauseImageName(f.Client),
Name: "svc-latency-rc",
Namespace: f.Namespace.Name,
Replicas: 1,
PollInterval: time.Second,
}
if err := framework.RunRC(cfg); err != nil {
return nil, err
}
defer framework.DeleteRCAndPods(f.Client, f.Namespace.Name, cfg.Name)
// Run a single watcher, to reduce the number of API calls we have to
// make; this is to minimize the timing error. It's how kube-proxy
// consumes the endpoints data, so it seems like the right thing to
// test.
endpointQueries := newQuerier()
startEndpointWatcher(f, endpointQueries)
defer close(endpointQueries.stop)
// run one test and throw it away-- this is to make sure that the pod's
// ready status has propagated.
singleServiceLatency(f, cfg.Name, endpointQueries)
// These channels are never closed, and each attempt sends on exactly
// one of these channels, so the sum of the things sent over them will
// be exactly total.
errs := make(chan error, total)
durations := make(chan time.Duration, total)
blocker := make(chan struct{}, inParallel)
for i := 0; i < total; i++ {
go func() {
defer GinkgoRecover()
blocker <- struct{}{}
defer func() { <-blocker }()
if d, err := singleServiceLatency(f, cfg.Name, endpointQueries); err != nil {
errs <- err
} else {
durations <- d
}
}()
}
errCount := 0
for i := 0; i < total; i++ {
select {
case e := <-errs:
framework.Logf("Got error: %v", e)
errCount += 1
case d := <-durations:
output = append(output, d)
}
}
if errCount != 0 {
return output, fmt.Errorf("got %v errors", errCount)
}
return output, nil
}
type endpointQuery struct {
endpointsName string
endpoints *api.Endpoints
result chan<- struct{}
}
type endpointQueries struct {
requests map[string]*endpointQuery
stop chan struct{}
requestChan chan *endpointQuery
seenChan chan *api.Endpoints
}
func newQuerier() *endpointQueries {
eq := &endpointQueries{
requests: map[string]*endpointQuery{},
stop: make(chan struct{}, 100),
requestChan: make(chan *endpointQuery),
seenChan: make(chan *api.Endpoints, 100),
}
go eq.join()
return eq
}
// join merges the incoming streams of requests and added endpoints. It has
// nice properties like:
// * remembering an endpoint if it happens to arrive before it is requested.
// * closing all outstanding requests (returning nil) if it is stopped.
func (eq *endpointQueries) join() {
defer func() {
// Terminate all pending requests, so that no goroutine will
// block indefinitely.
for _, req := range eq.requests {
if req.result != nil {
close(req.result)
}
}
}()
for {
select {
case <-eq.stop:
return
case req := <-eq.requestChan:
if cur, ok := eq.requests[req.endpointsName]; ok && cur.endpoints != nil {
// We've already gotten the result, so we can
// immediately satisfy this request.
delete(eq.requests, req.endpointsName)
req.endpoints = cur.endpoints
close(req.result)
} else {
// Save this request.
eq.requests[req.endpointsName] = req
}
case got := <-eq.seenChan:
if req, ok := eq.requests[got.Name]; ok {
if req.result != nil {
// Satisfy a request.
delete(eq.requests, got.Name)
req.endpoints = got
close(req.result)
} else {
// We've already recorded a result, but
// haven't gotten the request yet. Only
// keep the first result.
}
} else {
// We haven't gotten the corresponding request
// yet, save this result.
eq.requests[got.Name] = &endpointQuery{
endpoints: got,
}
}
}
}
}
// request blocks until the requested endpoint is seen.
func (eq *endpointQueries) request(endpointsName string) *api.Endpoints {
result := make(chan struct{})
req := &endpointQuery{
endpointsName: endpointsName,
result: result,
}
eq.requestChan <- req
<-result
return req.endpoints
}
// marks e as added; does not block.
func (eq *endpointQueries) added(e *api.Endpoints) {
eq.seenChan <- e
}
// blocks until it has finished syncing.
func startEndpointWatcher(f *framework.Framework, q *endpointQueries) {
_, controller := cache.NewInformer(
&cache.ListWatch{
ListFunc: func(options api.ListOptions) (runtime.Object, error) {
return f.Client.Endpoints(f.Namespace.Name).List(options)
},
WatchFunc: func(options api.ListOptions) (watch.Interface, error) {
return f.Client.Endpoints(f.Namespace.Name).Watch(options)
},
},
&api.Endpoints{},
0,
cache.ResourceEventHandlerFuncs{
AddFunc: func(obj interface{}) {
if e, ok := obj.(*api.Endpoints); ok {
if len(e.Subsets) > 0 && len(e.Subsets[0].Addresses) > 0 {
q.added(e)
}
}
},
UpdateFunc: func(old, cur interface{}) {
if e, ok := cur.(*api.Endpoints); ok {
if len(e.Subsets) > 0 && len(e.Subsets[0].Addresses) > 0 {
q.added(e)
}
}
},
},
)
go controller.Run(q.stop)
// Wait for the controller to sync, so that we don't count any warm-up time.
for !controller.HasSynced() {
time.Sleep(100 * time.Millisecond)
}
}
func singleServiceLatency(f *framework.Framework, name string, q *endpointQueries) (time.Duration, error) {
// Make a service that points to that pod.
svc := &api.Service{
ObjectMeta: api.ObjectMeta{
GenerateName: "latency-svc-",
},
Spec: api.ServiceSpec{
Ports: []api.ServicePort{{Protocol: api.ProtocolTCP, Port: 80}},
Selector: map[string]string{"name": name},
Type: api.ServiceTypeClusterIP,
SessionAffinity: api.ServiceAffinityNone,
},
}
startTime := time.Now()
gotSvc, err := f.Client.Services(f.Namespace.Name).Create(svc)
if err != nil {
return 0, err
}
framework.Logf("Created: %v", gotSvc.Name)
defer f.Client.Services(gotSvc.Namespace).Delete(gotSvc.Name)
if e := q.request(gotSvc.Name); e == nil {
return 0, fmt.Errorf("Never got a result for endpoint %v", gotSvc.Name)
}
stopTime := time.Now()
d := stopTime.Sub(startTime)
framework.Logf("Got endpoints: %v [%v]", gotSvc.Name, d)
return d, nil
}
| {
"content_hash": "bd3eeae670f0568456a82d11a2c279b8",
"timestamp": "",
"source": "github",
"line_count": 328,
"max_line_length": 109,
"avg_line_length": 28.48170731707317,
"alnum_prop": 0.6606722329265682,
"repo_name": "suonto/kubernetes",
"id": "a71c2a3eef927f28682967fe6b50016b3a2c35e3",
"size": "9911",
"binary": false,
"copies": "9",
"ref": "refs/heads/master",
"path": "test/e2e/service_latency.go",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "C",
"bytes": "978"
},
{
"name": "Go",
"bytes": "44562234"
},
{
"name": "HTML",
"bytes": "2249497"
},
{
"name": "Makefile",
"bytes": "67522"
},
{
"name": "Nginx",
"bytes": "1013"
},
{
"name": "Protocol Buffer",
"bytes": "554059"
},
{
"name": "Python",
"bytes": "47393"
},
{
"name": "SaltStack",
"bytes": "56179"
},
{
"name": "Shell",
"bytes": "1480337"
}
],
"symlink_target": ""
} |
namespace google_youtube_api {
using namespace googleapis;
// Object factory method (static).
LiveBroadcastContentDetails* LiveBroadcastContentDetails::New() {
return new client::JsonCppCapsule<LiveBroadcastContentDetails>;
}
// Standard immutable constructor.
LiveBroadcastContentDetails::LiveBroadcastContentDetails(const Json::Value& storage)
: client::JsonCppData(storage) {
}
// Standard mutable constructor.
LiveBroadcastContentDetails::LiveBroadcastContentDetails(Json::Value* storage)
: client::JsonCppData(storage) {
}
// Standard destructor.
LiveBroadcastContentDetails::~LiveBroadcastContentDetails() {
}
} // namespace google_youtube_api
| {
"content_hash": "f4d9115e49efa4e046d9a3b98862b80e",
"timestamp": "",
"source": "github",
"line_count": 23,
"max_line_length": 84,
"avg_line_length": 28.782608695652176,
"alnum_prop": 0.8021148036253777,
"repo_name": "rcari/google-api-cpp-client",
"id": "f6b7515b9fbb719aca76fcea71d1440e0794810d",
"size": "1999",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "service_apis/youtube/google/youtube_api/live_broadcast_content_details.cc",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "C",
"bytes": "18634"
},
{
"name": "C++",
"bytes": "5931824"
},
{
"name": "CMake",
"bytes": "35236"
},
{
"name": "Python",
"bytes": "60272"
}
],
"symlink_target": ""
} |
void GPIOinitOut(uint8_t portNum, uint32_t pinNum);
//Initialize the port and pin as outputs.
void GPIOinitIn(uint8_t portNum, uint32_t pinNum);
// Set the pin HIGH
void setGPIO(uint8_t portNum, uint32_t pinNum);
// Set the pin LOW
void clearGPIO(uint8_t portNum, uint32_t pinNum);
// Read GPIO
int getGPIO(uint8_t portNum, uint32_t pinNum);
// Set GPIOS for leds
void initLED();
// set LED color
bool setLED(uint8_t color);
// turn off all LED
void LEDOff();
#endif
| {
"content_hash": "dd1317192a045baec8eff391e3aad7b0",
"timestamp": "",
"source": "github",
"line_count": 17,
"max_line_length": 51,
"avg_line_length": 27.58823529411765,
"alnum_prop": 0.7334754797441365,
"repo_name": "kammce/LPCXpresso-Nexys4-Servo-Commander",
"id": "51e10d3a06ab46e5a81b642b6f81e33fb2af79d2",
"size": "843",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "LPC1769_ServoCommander/src/GPIO.h",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "C",
"bytes": "24061"
},
{
"name": "C++",
"bytes": "843"
},
{
"name": "Makefile",
"bytes": "7018"
},
{
"name": "Verilog",
"bytes": "37097"
}
],
"symlink_target": ""
} |
package terrors
// SimpleError provides a simple type for type based error handling.
// This type can hold a message that is returned upon Error().
type SimpleError struct {
Message string
}
func (s SimpleError) Error() string {
return s.Message
}
| {
"content_hash": "8fb7c220d0c4d3fe9f78d542640b9361",
"timestamp": "",
"source": "github",
"line_count": 11,
"max_line_length": 68,
"avg_line_length": 22.90909090909091,
"alnum_prop": 0.753968253968254,
"repo_name": "luqasz/gollum",
"id": "9e72de38a6787dd248e76ea1d3728e3f30ce0c41",
"size": "847",
"binary": false,
"copies": "4",
"ref": "refs/heads/master",
"path": "vendor/github.com/trivago/tgo/terrors/simpleerror.go",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "C",
"bytes": "6013"
},
{
"name": "Go",
"bytes": "936829"
},
{
"name": "Makefile",
"bytes": "6929"
},
{
"name": "Protocol Buffer",
"bytes": "449"
}
],
"symlink_target": ""
} |
<html>
<body><table> <tr> <td valign="top" height="150">
<font face="verdana" size="-1">
This inspection reports any instances of static method calls or field accesses that are not qualified
with the class name of the static method. This is legal if the static method or field is in
the same class as the call, but may be confusing.
</font></td> </tr> <tr> <td height="20"> <font face="verdana" size="-2">Powered by InspectionGadgets </font> </td> </tr> </table> </body>
</html> | {
"content_hash": "a27c301d8afa81be23cb2178a5de1dc4",
"timestamp": "",
"source": "github",
"line_count": 8,
"max_line_length": 137,
"avg_line_length": 59.875,
"alnum_prop": 0.7056367432150313,
"repo_name": "jexp/idea2",
"id": "642a47bac0b97186cffaf6bf2c25651a1fdda450",
"size": "479",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "plugins/InspectionGadgets/src/inspectionDescriptions/UnqualifiedStaticUsage.html",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "C",
"bytes": "6350"
},
{
"name": "C#",
"bytes": "103"
},
{
"name": "C++",
"bytes": "30760"
},
{
"name": "Erlang",
"bytes": "10"
},
{
"name": "Java",
"bytes": "72888555"
},
{
"name": "JavaScript",
"bytes": "910"
},
{
"name": "PHP",
"bytes": "133"
},
{
"name": "Perl",
"bytes": "6523"
},
{
"name": "Shell",
"bytes": "4068"
}
],
"symlink_target": ""
} |
import weightedRandomObject from 'weighted-random-object';
interface MyObject {
data: string;
weight: number;
}
const objs: MyObject[] = [{ data: 'a', weight: 7 }, { data: 'b', weight: 5 }];
weightedRandomObject(objs); // $ExpectType MyObject
weightedRandomObject([{ f: 5, weight: 1 }, { f: 9, weight: 2 }]).f; // $ExpectType number
| {
"content_hash": "7e4b0f7e98cab44a9ae5b948f1c2a9c5",
"timestamp": "",
"source": "github",
"line_count": 12,
"max_line_length": 89,
"avg_line_length": 28.75,
"alnum_prop": 0.6579710144927536,
"repo_name": "markogresak/DefinitelyTyped",
"id": "99fd0a6d7e928248d1bb4d4cc0962b1f3b6a93b6",
"size": "345",
"binary": false,
"copies": "51",
"ref": "refs/heads/master",
"path": "types/weighted-random-object/weighted-random-object-tests.ts",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CoffeeScript",
"bytes": "15"
},
{
"name": "Protocol Buffer",
"bytes": "678"
},
{
"name": "TypeScript",
"bytes": "17426898"
}
],
"symlink_target": ""
} |
/**
* Sharedaddy Base Styles
*
* Contains styles for modules, containers, buttons
*/
/* Master container */
#jp-post-flair {
padding-top: .5em;
}
/* Overall Sharedaddy block title */
div.sharedaddy,
#content div.sharedaddy,
#main div.sharedaddy {
clear: both;
}
div.sharedaddy h3.sd-title {
margin: 0 0 1em 0;
display: inline-block;
line-height: 1.2;
font-size: 9pt;
font-weight: bold;
}
div.sharedaddy h3.sd-title:before {
content: "";
display: block;
width: 100%;
min-width: 30px;
border-top: 1px solid #ddd;
margin-bottom: 1em;
}
body.highlander-light h3.sd-title:before {
border-top: 1px solid rgba(0,0,0,.2);
}
body.highlander-dark h3.sd-title:before {
border-top: 1px solid rgba(255,255,255,.4);
}
/* Sharing services list */
.sd-content ul {
padding: 0 !important;
margin: 0 0 .7em 0 !important;
list-style: none !important;
}
.sd-content ul li {
display: inline-block;
}
.sd-block.sd-gplus {
margin: 0 0 .5em 0;
}
.sd-gplus .sd-content {
font-size: 12px;
}
/* Buttons */
.sd-social-icon .sd-content ul li a.sd-button,
.sd-social-text .sd-content ul li a.sd-button,
.sd-content ul li a.sd-button,
.sd-content ul li .option a.share-ustom, /* Ugh. */
.sd-content ul li.preview-item div.option.option-smart-off a,
.sd-content ul li.advanced a.share-more,
.sd-social-icon-text .sd-content ul li a.sd-button,
.sd-social-official .sd-content>ul>li>a.sd-button,
#sharing_email .sharing_send,
.sd-social-official .sd-content>ul>li .digg_button >a { /* official Digg button no longer works, needs cleaning */
text-decoration: none !important;
display: inline-block;
margin: 0 5px 5px 0;
font-size: 12px;
font-family: "Open Sans", sans-serif;
font-weight: normal;
border-radius: 3px;
color: #777 !important;
background: #f8f8f8;
border: 1px solid #cccccc;
box-shadow: 0 1px 0 rgba(0,0,0,.08);
text-shadow: none;
line-height: 23px;
padding: 1px 8px 0px 5px;
}
.sd-social-text .sd-content ul li a.sd-button span,
.sd-content ul li a.sd-button>span,
.sd-content ul li .option a.share-ustom span, /* Ugh. */
.sd-content ul li.preview-item div.option.option-smart-off a span,
.sd-content ul li.advanced a.share-more span,
.sd-social-icon-text .sd-content ul li a.sd-button>span,
.sd-social-official .sd-content>ul>li>a.sd-button span,
.sd-social-official .sd-content>ul>li .digg_button >a span { /* official Digg button no longer works, needs cleaning */
line-height: 23px;
}
/* Our gray buttons should be smaller when seen with the official ones */
.sd-social-official .sd-content>ul>li>a.sd-button,
.sd-social-official .sd-content .sharing-hidden .inner>ul>li>a.sd-button,
.sd-social-official .sd-content>ul>li .digg_button>a,
.sd-social-official .sd-content .sharing-hidden .inner>ul>li .digg_button>a {
line-height: 17px;
box-shadow: none; /* No shadow on gray buttons between the official ones */
vertical-align: top;
}
.sd-social-official .sd-content>ul>li>a.sd-button:before,
.sd-social-official .sd-content>ul>li .digg_button>a:before,
.sd-social-official .sd-content .sharing-hidden .inner>ul>li>a.sd-button:before,
.sd-social-official .sd-content .sharing-hidden .inner>ul>li .digg_button>a:before {
margin-bottom: -1px;
top: 0;
}
.sd-social-icon .sd-content ul li a.sd-button:hover,
.sd-social-icon .sd-content ul li a.sd-button:active,
.sd-social-text .sd-content ul li a.sd-button:hover,
.sd-social-text .sd-content ul li a.sd-button:active,
.sd-social-icon-text .sd-content ul li a.sd-button:hover,
.sd-social-icon-text .sd-content ul li a.sd-button:active,
.sd-social-official .sd-content>ul>li>a.sd-button:hover,
.sd-social-official .sd-content>ul>li>a.sd-button:active,
.sd-social-official .sd-content>ul>li .digg_button>a:hover,
.sd-social-official .sd-content>ul>li .digg_button>a:active {
color: #555;
background: #fafafa;
border: 1px solid #999999;
}
.sd-social-icon .sd-content ul li a.sd-button:active,
.sd-social-text .sd-content ul li a.sd-button:active,
.sd-social-icon-text .sd-content ul li a.sd-button:active,
.sd-social-official .sd-content>ul>li>a.sd-button:active,
.sd-social-official .sd-content>ul>li .digg_button>a:active {
box-shadow: inset 0 1px 0 rgba(0,0,0,.16);
}
/* All icons */
.sd-content ul li a.sd-button:before {
display: inline-block;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
font: normal 16px/1 'Genericons';
vertical-align: top;
position: relative;
top: 3px;
text-align: center;
}
.sd-content ul li {
margin: 0 !important;
padding: 0;
}
/* Text + icon & Official */
.sd-social-icon-text .sd-content ul li a span,
.sd-social-official .sd-content ul li a.sd-button span,
.sd-content ul li.preview-item a.sd-button span {
margin-left: 3px;
}
.sd-content ul li.preview-item.no-icon a.sd-button span {
margin-left: 0;
}
/* Text only */
.sd-social-text .sd-content ul li a:before,
.sd-content ul li.no-icon a:before {
display: none;
}
body .sd-social-text .sd-content ul li.share-custom a span,
body .sd-content ul li.share-custom.no-icon a span {
background-image: none;
background-position: -500px -500px !important; /* hack to work around !important inline style */
background-repeat: no-repeat !important;
padding-left: 0;
height: 0;
line-height: inherit;
}
.sd-social-icon .sd-content ul li a.share-more {
position: relative;
top: 2px;
}
.sd-social-icon .sd-content ul li a.share-more span {
margin-left: 3px;
}
/* Individual icons */
.sd-social-icon .sd-content ul li.share-print a:before,
.sd-social-text .sd-content ul li.share-print a:before,
.sd-content ul li.share-print div.option.option-smart-off a:before,
.sd-social-icon-text .sd-content li.share-print a:before,
.sd-social-official .sd-content li.share-print a:before {
content: '\f469';
}
.sd-social-icon .sd-content ul li.share-email a:before,
.sd-social-text .sd-content ul li.share-email a:before,
.sd-content ul li.share-email div.option.option-smart-off a:before,
.sd-social-icon-text .sd-content li.share-email a:before,
.sd-social-official .sd-content li.share-email a:before {
content: '\f410';
}
.sd-social-icon .sd-content ul li.share-linkedin a:before,
.sd-social-text .sd-content ul li.share-linkedin a:before,
.sd-content ul li.share-linkedin div.option.option-smart-off a:before,
.sd-social-icon-text .sd-content li.share-linkedin a:before {
content: '\f207';
}
.sd-social-icon .sd-content ul li.share-twitter a:before,
.sd-social-text .sd-content ul li.share-twitter a:before,
.sd-content ul li.share-twitter div.option.option-smart-off a:before,
.sd-social-icon-text .sd-content li.share-twitter a:before {
content: '\f202';
}
.sd-social-icon .sd-content ul li.share-reddit a:before,
.sd-social-text .sd-content ul li.share-reddit a:before,
.sd-content ul li.share-reddit div.option.option-smart-off a:before,
.sd-social-icon-text .sd-content li.share-reddit a:before {
content: '\f222';
}
.sd-social-icon .sd-content ul li.share-tumblr a:before,
.sd-social-text .sd-content ul li.share-tumblr a:before,
.sd-content ul li.share-tumblr div.option.option-smart-off a:before,
.sd-social-icon-text .sd-content li.share-tumblr a:before {
content: '\f214';
}
.sd-social-icon .sd-content ul li.share-pocket a:before,
.sd-social-text .sd-content ul li.share-pocket a:before,
.sd-content ul li.share-pocket div.option.option-smart-off a:before,
.sd-social-icon-text .sd-content li.share-pocket a:before {
content: '\f224';
}
.sd-social-icon .sd-content ul li.share-skype a:before,
.sd-social-text .sd-content ul li.share-skype a:before,
.sd-content ul li.share-skype div.option.option-smart-off a:before,
.sd-social-icon-text .sd-content li.share-skype a:before {
content: '\f220';
}
.sd-social-icon .sd-content ul li.share-pinterest a:before,
.sd-social-text .sd-content ul li.share-pinterest a:before,
.sd-content ul li.share-pinterest div.option.option-smart-off a:before,
.sd-social-icon-text .sd-content li.share-pinterest a:before {
content: '\f209';
}
.sd-social-icon .sd-content ul li.share-google-plus-1 a:before,
.sd-social-text .sd-content ul li.share-google-plus-1 a:before,
.sd-content ul li.share-google-plus-1 div.option.option-smart-off a:before,
.sd-social-icon-text .sd-content li.share-google-plus-1 a:before {
content: '\f218';
}
.sd-social-icon .sd-content ul li.share-facebook a:before,
.sd-social-text .sd-content ul li.share-facebook a:before,
.sd-content ul li.share-facebook div.option.option-smart-off a:before,
.sd-social-icon-text .sd-content li.share-facebook a:before {
content: '\f204';
}
.sd-social-icon .sd-content ul li.share-press-this a:before,
.sd-social-text .sd-content ul li.share-press-this a:before,
.sd-content ul li.share-press-this div.option.option-smart-off a:before,
.sd-social-icon-text .sd-content li.share-press-this a:before,
.sd-social-official .sd-content li.share-press-this a:before {
content: '\f205';
}
.sd-social-official .sd-content li.share-press-this a:before {
color: #2ba1cb;
}
.sd-social-icon .sd-content ul a.share-more:before,
.sd-social-text .sd-content ul a.share-more:before,
.sd-content ul li.advanced a.share-more:before,
.sd-social-icon-text .sd-content a.share-more:before,
.sd-social-official .sd-content a.share-more:before {
content: '\f415';
}
.sd-social-official .sd-content a.share-more:before {
color: #2ba1cb;
}
/* Share count */
.sd-social .sd-button .share-count {
background: #2ea2cc;
color: #fff;
-moz-border-radius: 10px;
border-radius: 10px;
display: inline-block;
text-align: center;
font-size: 10px;
padding: 1px 3px;
line-height: 1;
}
/* Official buttons */
.sd-social-official .sd-content ul, .sd-social-official .sd-content ul li {
line-height: 25px !important;
}
.sd-social-official .sd-content>ul>li>a.sd-button span {
line-height: 1;
}
.sd-social-official .sd-content ul:after {
content: ".";
display: block;
height: 0;
clear: both;
visibility: hidden;
}
.sd-social-official .sd-content li.share-press-this a {
margin: 0 0 5px 0;
}
.sd-social-official .sd-content ul>li {
display: block;
float: left;
margin: 0 10px 5px 0 !important;
height: 25px;
}
.sd-social-official .fb-share-button > span {
vertical-align: top !important;
}
.sd-social-official .sd-content .pocket_button iframe {
width: 98px;
}
.sd-social-official .sd-content .skypeShare {
width: 55px;
}
/* Individual official buttons */
.googleplus1_button .g-plus {
vertical-align: top !important;
}
.reddit_button iframe {
margin-top: 1px;
}
.pocket_button iframe, .googleplus1_button iframe, .pinterest_button, .twitter_button, .linkedin_button>span {
margin: 0 !important;
}
body .sd-social-official li.share-print ,
body .sd-social-official li.share-email a,
body .sd-social-official li.share-custom a,
body .sd-social-official li a.share-more,
body .sd-social-official li.share-digg a,
body .sd-social-official li.share-press-this a
{
position: relative;
top: 0;
}
/* Custom icons */
body .sd-social-icon .sd-content li.share-custom>a {
padding: 2px 3px 0 3px;
position: relative;
top: 4px;
}
body .sd-social-icon .sd-content li.share-custom a span,
body .sd-social-icon-text .sd-content li.share-custom a span,
body .sd-social-text .sd-content li.share-custom a span,
body .sd-social-official .sd-content li.share-custom a span,
body .sd-content ul li.share-custom a.share-icon span
{
background-size: 16px 16px;
background-repeat: no-repeat;
margin-left: 0;
padding: 0 0 0 19px;
display: inline-block;
height: 16px;
line-height: 16px;
}
body .sd-social-icon .sd-content li.share-custom a span {
width: 0;
}
body .sd-content li.share-custom a:hover span {
}
body .sd-social-icon .sd-content li.share-custom a span {
padding-left: 16px !important;
}
/* Overflow Sharing dialog */
.sharing-hidden .inner {
position: absolute;
z-index: 2;
border: 1px solid #ccc;
padding: 10px;
background: #fff;
box-shadow: 0px 5px 20px rgba(0,0,0,.2);
-webkit-border-radius: 2px;
-moz-border-radius: 2px;
border-radius: 2px;
margin-top: 5px;
max-width: 400px;
}
.sharing-hidden .inner ul{
margin: 0 !important;
}
.sd-social-official .sd-content .sharing-hidden ul>li.share-end {
clear: both;
margin: 0;
height: 0;
}
.sharing-hidden .inner:before, .sharing-hidden .inner:after {
position: absolute;
z-index: 1;
top: -8px;
left: 20px;
width: 0;
height: 0;
border-left: 6px solid transparent;
border-right: 6px solid transparent;
border-bottom: 8px solid #ccc;
content: "";
display: block;
}
.sharing-hidden .inner:after {
z-index: 2;
top: -7px;
border-left: 6px solid transparent;
border-right: 6px solid transparent;
border-bottom: 8px solid #fff;
}
.sharing-hidden ul {
margin: 0;
}
/**
* Special colorful look for "Icon Only" option
*/
.sd-social-icon .sd-content ul li[class*='share-'] a,
.sd-social-icon .sd-content ul li[class*='share-'] a:hover,
.sd-social-icon .sd-content ul li[class*='share-'] div.option a {
border-radius: 50%;
-webkit-border-radius: 50%;
border: 0;
box-shadow: none;
padding: 8px;
position: relative;
top: -2px;
line-height: 1;
width: auto;
height: auto;
margin-bottom: 0;
}
.sd-social-icon .sd-content ul li[class*='share-'] a.sd-button>span,
.sd-social-icon .sd-content ul li[class*='share-'] div.option a span {
line-height: 1;
}
.sd-social-icon .sd-content ul li[class*='share-'] a:hover,
.sd-social-icon .sd-content ul li[class*='share-'] div.option a:hover {
border: none;
opacity: .6;
}
.sd-social-icon .sd-content ul li[class*='share-'] a.sd-button:before {
top: 0;
}
.sd-social-icon .sd-content ul li[class*='share-'] a.sd-button.share-custom {
padding: 8px 8px 6px 8px;
top: 5px;
}
.sd-social-icon .sd-content ul li a.sd-button.share-more {
margin-left: 10px;
}
.sd-social-icon .sd-content ul li:first-child a.sd-button.share-more {
margin-left: 0;
}
.sd-social-icon .sd-button span.share-count {
position: absolute;
bottom: 0;
right: 0;
border-radius: 0;
background: #555;
font-size: 9px;
}
/* Special look colors */
.sd-social-icon .sd-content ul li[class*='share-'] a.sd-button {
background: #e9e9e9;
margin-top: 2px;
text-indent: 0;
}
.sd-social-icon .sd-content ul li[class*='share-'].share-tumblr a.sd-button {
background: #2c4762;
color: #fff !important;
}
.sd-social-icon .sd-content ul li[class*='share-'].share-facebook a.sd-button {
background: #3b5998;
color: #fff !important;
}
.sd-social-icon .sd-content ul li[class*='share-'].share-twitter a.sd-button {
background: #00acee;
color: #fff !important;
}
.sd-social-icon .sd-content ul li[class*='share-'].share-pinterest a.sd-button {
background: #ca1f27;
color: #fff !important;
}
.sd-social-icon .sd-content ul li[class*='share-'].share-digg a.sd-button {
color: #555555 !important;
}
.sd-social-icon .sd-content ul li[class*='share-'].share-press-this a.sd-button {
background: #1e8cbe;
color: #fff !important;
}
.sd-social-icon .sd-content ul li[class*='share-'].share-linkedin a.sd-button {
background: #0077b5;
color: #fff !important;
}
.sd-social-icon .sd-content ul li[class*='share-'].share-google-plus-1 a.sd-button {
background: #dd4b39;
color: #fff !important;
}
.sd-social-icon .sd-content ul li[class*='share-'].share-pocket a.sd-button {
background: #ee4056;
color: #fff !important;
}
.sd-social-icon .sd-content ul li[class*='share-'].share-skype a.sd-button {
background: #00AFF0;
color: #fff !important;
}
.sd-social-icon .sd-content ul li[class*='share-'].share-reddit a.sd-button {
background: #cee3f8;
color: #555555 !important;
}
/**
* Screen Reader Text for "Icon Only" option
*/
.sharing-screen-reader-text {
clip: rect(1px, 1px, 1px, 1px);
position: absolute !important;
height: 1px;
width: 1px;
overflow: hidden;
}
.sharing-screen-reader-text:hover,
.sharing-screen-reader-text:active,
.sharing-screen-reader-text:focus {
background-color: #f1f1f1;
border-radius: 3px;
box-shadow: 0 0 2px 2px rgba(0, 0, 0, 0.6);
clip: auto !important;
color: #21759b;
display: block;
font-size: 14px;
font-weight: bold;
height: auto;
left: 5px;
line-height: normal;
padding: 15px 23px 14px;
text-decoration: none;
top: 5px;
width: auto;
z-index: 100000; /* Above WP toolbar */
}
/**
* Sharing Email Dialog
*/
#sharing_email {
width: 342px;
position: absolute;
z-index: 1001;
border: 1px solid #ccc;
padding: 15px;
background: #fff;
box-shadow: 0px 5px 20px rgba(0,0,0,.2);
text-align: left;
}
div.sharedaddy.sharedaddy-dark #sharing_email {
border-color: #fff;
}
#sharing_email .errors {
color: #fff;
background-color: #771a09;
font-size: 12px;
padding: 5px 8px;
line-height: 1;
margin: 10px 0 0 0;
}
#sharing_email label {
font-size: 12px;
color: #333;
font-weight: bold;
display: block;
padding: 0 0 4px 0;
text-align: left;
text-shadow: none;
}
#sharing_email form {
margin: 0;
}
#sharing_email input[type="text"], #sharing_email input[type="email"] {
width: 100%;
box-sizing: border-box;
-moz-box-sizing:border-box;
-webkit-box-sizing:border-box;
border: 1px solid #ccc;
margin-bottom: 1em;
background: #fff;
font-size: 12px;
color: #333;
max-width: none;
padding: 1px 3px;
}
#jetpack-source_f_name {
display: none!important;
position: absolute !important;
left: -9000px;
}
#sharing_email .sharing_cancel {
padding: 0 0 0 1em;
font-size: 12px;
text-shadow: none;
}
#sharing_email .recaptcha {
width: 312px;
height: 123px;
margin: 0 0 1em 0;
}
| {
"content_hash": "cfaa42670e0f191229d0bc1c017567de",
"timestamp": "",
"source": "github",
"line_count": 682,
"max_line_length": 120,
"avg_line_length": 25.39442815249267,
"alnum_prop": 0.707488885039552,
"repo_name": "fastesol/likemyhome",
"id": "3d6565bf466d852e11321326a8ecf0e62b744f81",
"size": "17319",
"binary": false,
"copies": "97",
"ref": "refs/heads/master",
"path": "wp-content/plugins/jetpack/modules/sharedaddy/sharing.css",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "ApacheConf",
"bytes": "865"
},
{
"name": "CSS",
"bytes": "3034668"
},
{
"name": "HTML",
"bytes": "12070"
},
{
"name": "JavaScript",
"bytes": "2925422"
},
{
"name": "PHP",
"bytes": "16295066"
},
{
"name": "Smarty",
"bytes": "33"
}
],
"symlink_target": ""
} |
package com.java110.vo.api.returnPayFee;
import com.java110.vo.MorePageVo;
import java.io.Serializable;
import java.util.List;
public class ApiReturnPayFeeVo extends MorePageVo implements Serializable {
List<ApiReturnPayFeeDataVo> returnPayFees;
public List<ApiReturnPayFeeDataVo> getReturnPayFees() {
return returnPayFees;
}
public void setReturnPayFees(List<ApiReturnPayFeeDataVo> returnPayFees) {
this.returnPayFees = returnPayFees;
}
}
| {
"content_hash": "543392ade49f2a5dcba47db9671a863a",
"timestamp": "",
"source": "github",
"line_count": 19,
"max_line_length": 77,
"avg_line_length": 25.36842105263158,
"alnum_prop": 0.7655601659751037,
"repo_name": "java110/MicroCommunity",
"id": "96b3a7a9a7c433b538d8b379365667fb774db6f1",
"size": "482",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "java110-bean/src/main/java/com/java110/vo/api/returnPayFee/ApiReturnPayFeeVo.java",
"mode": "33261",
"license": "apache-2.0",
"language": [
{
"name": "Dockerfile",
"bytes": "737"
},
{
"name": "HTML",
"bytes": "12981"
},
{
"name": "Java",
"bytes": "19654092"
},
{
"name": "JavaScript",
"bytes": "19296"
},
{
"name": "Shell",
"bytes": "1121"
}
],
"symlink_target": ""
} |
module.exports = require("./webpack.config")({
prod: false
});
| {
"content_hash": "b09be64acffc8146e2363bf6d14d8648",
"timestamp": "",
"source": "github",
"line_count": 3,
"max_line_length": 46,
"avg_line_length": 21.666666666666668,
"alnum_prop": 0.6461538461538462,
"repo_name": "merivercap/bitshares-2-ui",
"id": "00f7bc861d4a69dd59d62d57a5400622c66aadb1",
"size": "65",
"binary": false,
"copies": "9",
"ref": "refs/heads/bitshares",
"path": "web/conf/webpack-dev.js",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "70375"
},
{
"name": "CoffeeScript",
"bytes": "133800"
},
{
"name": "HTML",
"bytes": "3433"
},
{
"name": "JavaScript",
"bytes": "2072483"
},
{
"name": "NSIS",
"bytes": "3767"
},
{
"name": "Objective-C",
"bytes": "2789"
},
{
"name": "Python",
"bytes": "1188"
},
{
"name": "Shell",
"bytes": "187"
}
],
"symlink_target": ""
} |
using System;
using System.Collections.Generic;
namespace FluentValidationFramework.UnitTests
{
public class FakeValidationTargetModel
{
public string StringValidationTargetProperty { get; set; }
public int NumericValidationTargetProperty { get; set; }
public DateTime DateValidationTargetProperty { get; set; }
public object ReferenceTypeValidationTargetProperty { get; set; }
public IEnumerable<object> CollectionValidationTargetProperty { get; set; }
}
}
| {
"content_hash": "6502b56a43919ed22e9c5e92fe9f4797",
"timestamp": "",
"source": "github",
"line_count": 18,
"max_line_length": 83,
"avg_line_length": 28.666666666666668,
"alnum_prop": 0.7344961240310077,
"repo_name": "SeregaZH/FluentValidationFramework",
"id": "696e7c286d8d191bc128852fa9d84f6d6f1e87a7",
"size": "518",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "FluentValidationFramework.Tests/FakeValidationTargetModel.cs",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C#",
"bytes": "158871"
}
],
"symlink_target": ""
} |
<?php
namespace Sabre\VObject\Property;
use
Sabre\VObject\Property;
class Integer extends Property {
/**
* Sets a raw value coming from a mimedir (iCalendar/vCard) file.
*
* This has been 'unfolded', so only 1 line will be passed. Unescaping is
* not yet done, but parameters are not included.
*
* @param string $val
* @return void
*/
public function setRawMimeDirValue($val) {
$this->setValue((int)$val);
}
/**
* Returns a raw mime-dir representation of the value.
*
* @return string
*/
public function getRawMimeDirValue() {
return $this->value;
}
/**
* Returns the type of value.
*
* This corresponds to the VALUE= parameter. Every property also has a
* 'default' valueType.
*
* @return string
*/
public function getValueType() {
return "INTEGER";
}
/**
* Returns the value, in the format it should be encoded for json.
*
* This method must always return an array.
*
* @return array
*/
public function getJsonValue() {
return array((int)$this->getValue());
}
}
| {
"content_hash": "d79f6a937787d73459dddb607fde508a",
"timestamp": "",
"source": "github",
"line_count": 63,
"max_line_length": 77,
"avg_line_length": 18.873015873015873,
"alnum_prop": 0.5794785534062237,
"repo_name": "jmaupoux/lotofoot-v2",
"id": "9b6ab640a71c74fb39693d0ba119bd2cc4506dbb",
"size": "1537",
"binary": false,
"copies": "5",
"ref": "refs/heads/master",
"path": "Symfony/src/Sabre/VObject/Property/Integer.php",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "91742"
},
{
"name": "HTML",
"bytes": "187678"
},
{
"name": "JavaScript",
"bytes": "8658"
},
{
"name": "PHP",
"bytes": "544068"
}
],
"symlink_target": ""
} |
{% extends "base.html" %}
{% from "macros.html" import render_form %}
{% block content %}
<div class="container">
<h3>Add Contact</h3>
{{ render_form(form, action_url=url_for('add_contact', client_id=client_id)) }}
</div>
{% endblock %}
| {
"content_hash": "173184cf10b7529c023a34e985a37777",
"timestamp": "",
"source": "github",
"line_count": 8,
"max_line_length": 81,
"avg_line_length": 30.125,
"alnum_prop": 0.6390041493775933,
"repo_name": "saltpy/planner",
"id": "6cd9806ccb582d67e675634eb1983ddd3f3dc711",
"size": "241",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "planner/templates/add-contact.html",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "126"
},
{
"name": "HTML",
"bytes": "5601"
},
{
"name": "JavaScript",
"bytes": "226776"
},
{
"name": "Python",
"bytes": "64578"
}
],
"symlink_target": ""
} |
package org.jpedal.jbig2;
import java.awt.image.BufferedImage;
import java.awt.image.DataBuffer;
import java.awt.image.DataBufferByte;
import java.awt.image.Raster;
import java.awt.image.WritableRaster;
import java.io.DataInput;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.util.List;
import org.jpedal.jbig2.decoders.JBIG2StreamDecoder;
import org.jpedal.jbig2.image.JBIG2Bitmap;
import org.jpedal.jbig2.segment.Segment;
import org.jpedal.jbig2.segment.pageinformation.PageInformationSegment;
public class JBIG2Decoder {
private JBIG2StreamDecoder streamDecoder;
/**
* Constructor
*/
public JBIG2Decoder() {
streamDecoder = new JBIG2StreamDecoder();
}
/**
* If the data stream is taken from a PDF, there may be some global data. Pass any global data
* in here. Call this method before decodeJBIG2(...)
* @param data global data
* @throws IOException
* @throws JBIG2Exception
*/
public void setGlobalData(byte[] data) throws IOException, JBIG2Exception {
streamDecoder.setGlobalData(data);
}
/**
* Decodes a JBIG2 image from a File object
* @param file File to decode
* @throws IOException
* @throws JBIG2Exception
*/
public void decodeJBIG2(File file) throws IOException, JBIG2Exception {
decodeJBIG2(file.getAbsolutePath());
}
/**
* Decodes a JBIG2 image from a String path
* @param file Must be the full path to the image
* @throws IOException
* @throws JBIG2Exception
*/
public void decodeJBIG2(String file) throws IOException, JBIG2Exception {
decodeJBIG2(new FileInputStream(file));
}
/**
* Decodes a JBIG2 image from an InputStream
* @param inputStream InputStream
* @throws IOException
* @throws JBIG2Exception
*/
public void decodeJBIG2(InputStream inputStream) throws IOException, JBIG2Exception {
int availiable = inputStream.available();
byte[] bytes = new byte[availiable];
inputStream.read(bytes);
decodeJBIG2(bytes);
}
/**
* Decodes a JBIG2 image from a DataInput
* @param dataInput DataInput
* @throws IOException
* @throws JBIG2Exception
*/
public void decodeJBIG2(DataInput dataInput) throws IOException, JBIG2Exception {
// long availiable = inputStream.length();
//
// byte[] bytes = new byte[availiable];
// inputStream.read(bytes);
//
// decodeJBIG2(bytes);
}
/**
* Decodes a JBIG2 image from a byte array
* @param data the raw data stream
* @throws IOException
* @throws JBIG2Exception
*/
public void decodeJBIG2(byte[] data) throws IOException, JBIG2Exception {
streamDecoder.decodeJBIG2(data);
}
/**
*
* @param page
* @return
*/
public BufferedImage getPageAsBufferedImage(int page) {
page++;
JBIG2Bitmap pageBitmap = streamDecoder.findPageSegement(page).getPageBitmap();
byte[] bytes = pageBitmap.getData(true);
if (bytes == null)
return null;
// make a a DEEP copy so we cant alter
int len = bytes.length;
byte[] copy = new byte[len];
System.arraycopy(bytes, 0, copy, 0, len);
// byte[] data = pageBitmap.getData(true).clone();
int width = pageBitmap.getWidth();
int height = pageBitmap.getHeight();
/** create an image from the raw data */
DataBuffer db = new DataBufferByte(copy, copy.length);
WritableRaster raster = Raster.createPackedRaster(db, width, height, 1, null);
BufferedImage image = new BufferedImage(width, height, BufferedImage.TYPE_BYTE_BINARY);
image.setData(raster);
return image;
}
public boolean isNumberOfPagesKnown() {
return streamDecoder.isNumberOfPagesKnown();
}
public int getNumberOfPages() {
int pages = streamDecoder.getNumberOfPages();
if (streamDecoder.isNumberOfPagesKnown() && pages != 0)
return pages;
int noOfPages = 0;
List<Segment> segments = getAllSegments();
for (Segment segment : segments) {
if (segment.getSegmentHeader().getSegmentType() == Segment.PAGE_INFORMATION)
noOfPages++;
}
return noOfPages;
}
public List<Segment> getAllSegments() {
return streamDecoder.getAllSegments();
}
public PageInformationSegment findPageSegement(int page) {
page++;
return streamDecoder.findPageSegement(page);
}
public Segment findSegment(int segmentNumber) {
return streamDecoder.findSegment(segmentNumber);
}
public JBIG2Bitmap getPageAsJBIG2Bitmap(int page) {
page++;
return streamDecoder.findPageSegement(page).getPageBitmap();
}
public boolean isRandomAccessOrganisationUsed() {
return streamDecoder.isRandomAccessOrganisationUsed();
}
}
| {
"content_hash": "c8ad128fc565d871596cde910a278e03",
"timestamp": "",
"source": "github",
"line_count": 178,
"max_line_length": 95,
"avg_line_length": 26.421348314606742,
"alnum_prop": 0.704869232404848,
"repo_name": "Borisvl/JBIG2-Image-Decoder",
"id": "eea9b09433533ea08e6e489be2b28eaf84417852",
"size": "7019",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/org/jpedal/jbig2/JBIG2Decoder.java",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "Java",
"bytes": "323796"
}
],
"symlink_target": ""
} |
<!DOCTYPE html>
<html>
<head>
<style type="text/css">
.block {
background-color: #ccc;
padding: 1em;
margin: 1em;
}
</style>
<!-- include AutobahnJS .. that's all you need -->
<script src="http://autobahn.s3.amazonaws.com/js/autobahn.min.js"></script>
<script>
// WAMP session object
var sess;
var wsuri;
window.onload = function() {
if (window.location.protocol === "file:") {
wsuri = "ws://localhost:9000";
} else {
wsuri = "ws://" + window.location.hostname + ":9000";
}
// connect to WAMP server
ab.connect(wsuri,
// WAMP session was established
function (session) {
sess = session;
console.log("Connected!");
sess.subscribe("http://example.com/simple", onEvent);
sess.prefix("event", "http://example.com/event#");
sess.subscribe("event:myevent1", onEvent);
sess.subscribe("event:myevent2", onEvent);
},
// WAMP session is gone
function (code, reason) {
sess = null;
alert(reason);
}
);
};
function onEvent(topicUri, event) {
console.log(topicUri);
console.log(event);
}
function publishEvent()
{
evt = {};
evt.num = 23;
evt.name = document.getElementById('form_message').value;
evt.flag = document.getElementById('form_flag').checked;
evt.created = new Date();
evt.rand = Math.random();
var excludeMe = document.getElementById('exclude_me').checked;
if (document.getElementById('event1').checked) {
sess.publish("event:myevent1", evt, excludeMe);
} else {
sess.publish("event:myevent2", evt, excludeMe);
}
}
</script>
</head>
<body>
<h1>Autobahn: Simple PubSub with WAMP</h1>
<div class="block">
<p>
Publish a simple event containing to data. Open a 2nd browser window/tab and you see events being received.
</p>
<button onclick="sess.subscribe('http://example.com/simple', onEvent);">Subscribe</button>
<button onclick="sess.unsubscribe('http://example.com/simple');">Unsubscribe</button>
<button onclick="sess.publish('http://example.com/simple', null);">Publish</button>
</div>
<div class="block">
<p>
Publish an event containing data.
</p>
<form>
<p>Message: <input id="form_message" type="text" size="50" maxlength="50" value="Hello, world!"></p>
<p>Flag: <input id="form_flag" type="checkbox"></p>
<p>Event:
<input id="event1" type="radio" name="eventtype" checked>Event 1
<input type="radio" name="eventtype">Event 2
</p>
<p>Exclude Me: <input id="exclude_me" type="checkbox" checked>
(By default, events published to a topic by a client will never be delivered to the client who published.
This can be overridded, and then a publisher - who is also subscribed to the topic - will receive it's own event.)</p>
</form>
<button onclick="publishEvent()">Publish Event</button>
</div>
<div class="block">
<p>
Publish to a Topic URI which was never registered for PubSub on server side. Events published to
such topics are transmitted to server, but silently ignored and never dispatched.
</p>
<button onclick="sess.publish('http://example.com/unregistered_topic', null);">Publish to unregistered Topic</button>
</div>
</body>
</html>
| {
"content_hash": "1007858465bedad34e3cccb6b55194db",
"timestamp": "",
"source": "github",
"line_count": 115,
"max_line_length": 130,
"avg_line_length": 34.643478260869564,
"alnum_prop": 0.5268574297188755,
"repo_name": "jgelens/AutobahnTestSuite",
"id": "e8c4306787012f969a3400f851c2ee7905dadee9",
"size": "3984",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "autobahntestsuite/autobahntestsuite/web/wamp/simplepubsub.html",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "JavaScript",
"bytes": "2806"
},
{
"name": "Python",
"bytes": "352491"
}
],
"symlink_target": ""
} |
using System.Collections.Generic;
using System.Collections.Concurrent;
using System.Diagnostics;
using System.Globalization;
using System.Reflection;
using System.Runtime.InteropServices;
namespace System.Security.Cryptography
{
public class CryptoConfig
{
private const string AssemblyName_Cng = "System.Security.Cryptography.Cng";
private const string AssemblyName_Csp = "System.Security.Cryptography.Csp";
private const string AssemblyName_Pkcs = "System.Security.Cryptography.Pkcs";
private const string AssemblyName_X509Certificates = "System.Security.Cryptography.X509Certificates";
private const BindingFlags ConstructorDefault = BindingFlags.Instance | BindingFlags.Public | BindingFlags.CreateInstance;
private const string OID_RSA_SMIMEalgCMS3DESwrap = "1.2.840.113549.1.9.16.3.6";
private const string OID_RSA_MD5 = "1.2.840.113549.2.5";
private const string OID_RSA_RC2CBC = "1.2.840.113549.3.2";
private const string OID_RSA_DES_EDE3_CBC = "1.2.840.113549.3.7";
private const string OID_OIWSEC_desCBC = "1.3.14.3.2.7";
private const string OID_OIWSEC_SHA1 = "1.3.14.3.2.26";
private const string OID_OIWSEC_SHA256 = "2.16.840.1.101.3.4.2.1";
private const string OID_OIWSEC_SHA384 = "2.16.840.1.101.3.4.2.2";
private const string OID_OIWSEC_SHA512 = "2.16.840.1.101.3.4.2.3";
private const string OID_OIWSEC_RIPEMD160 = "1.3.36.3.2.1";
private const string ECDsaIdentifier = "ECDsa";
private static volatile Dictionary<string, string> s_defaultOidHT;
private static volatile Dictionary<string, object> s_defaultNameHT;
private static readonly ConcurrentDictionary<string, Type> appNameHT = new ConcurrentDictionary<string, Type>(StringComparer.OrdinalIgnoreCase);
private static readonly ConcurrentDictionary<string, string> appOidHT = new ConcurrentDictionary<string, string>(StringComparer.OrdinalIgnoreCase);
private static readonly char[] SepArray = { '.' }; // valid ASN.1 separators
// CoreFx does not support AllowOnlyFipsAlgorithms
public static bool AllowOnlyFipsAlgorithms => false;
private static Dictionary<string, string> DefaultOidHT
{
get
{
if (s_defaultOidHT != null)
{
return s_defaultOidHT;
}
int capacity = 37;
Dictionary<string, string> ht = new Dictionary<string, string>(capacity, StringComparer.OrdinalIgnoreCase);
ht.Add("SHA", OID_OIWSEC_SHA1);
ht.Add("SHA1", OID_OIWSEC_SHA1);
ht.Add("System.Security.Cryptography.SHA1", OID_OIWSEC_SHA1);
ht.Add("System.Security.Cryptography.SHA1CryptoServiceProvider", OID_OIWSEC_SHA1);
ht.Add("System.Security.Cryptography.SHA1Cng", OID_OIWSEC_SHA1);
ht.Add("System.Security.Cryptography.SHA1Managed", OID_OIWSEC_SHA1);
ht.Add("SHA256", OID_OIWSEC_SHA256);
ht.Add("System.Security.Cryptography.SHA256", OID_OIWSEC_SHA256);
ht.Add("System.Security.Cryptography.SHA256CryptoServiceProvider", OID_OIWSEC_SHA256);
ht.Add("System.Security.Cryptography.SHA256Cng", OID_OIWSEC_SHA256);
ht.Add("System.Security.Cryptography.SHA256Managed", OID_OIWSEC_SHA256);
ht.Add("SHA384", OID_OIWSEC_SHA384);
ht.Add("System.Security.Cryptography.SHA384", OID_OIWSEC_SHA384);
ht.Add("System.Security.Cryptography.SHA384CryptoServiceProvider", OID_OIWSEC_SHA384);
ht.Add("System.Security.Cryptography.SHA384Cng", OID_OIWSEC_SHA384);
ht.Add("System.Security.Cryptography.SHA384Managed", OID_OIWSEC_SHA384);
ht.Add("SHA512", OID_OIWSEC_SHA512);
ht.Add("System.Security.Cryptography.SHA512", OID_OIWSEC_SHA512);
ht.Add("System.Security.Cryptography.SHA512CryptoServiceProvider", OID_OIWSEC_SHA512);
ht.Add("System.Security.Cryptography.SHA512Cng", OID_OIWSEC_SHA512);
ht.Add("System.Security.Cryptography.SHA512Managed", OID_OIWSEC_SHA512);
ht.Add("RIPEMD160", OID_OIWSEC_RIPEMD160);
ht.Add("System.Security.Cryptography.RIPEMD160", OID_OIWSEC_RIPEMD160);
ht.Add("System.Security.Cryptography.RIPEMD160Managed", OID_OIWSEC_RIPEMD160);
ht.Add("MD5", OID_RSA_MD5);
ht.Add("System.Security.Cryptography.MD5", OID_RSA_MD5);
ht.Add("System.Security.Cryptography.MD5CryptoServiceProvider", OID_RSA_MD5);
ht.Add("System.Security.Cryptography.MD5Managed", OID_RSA_MD5);
ht.Add("TripleDESKeyWrap", OID_RSA_SMIMEalgCMS3DESwrap);
ht.Add("RC2", OID_RSA_RC2CBC);
ht.Add("System.Security.Cryptography.RC2CryptoServiceProvider", OID_RSA_RC2CBC);
ht.Add("DES", OID_OIWSEC_desCBC);
ht.Add("System.Security.Cryptography.DESCryptoServiceProvider", OID_OIWSEC_desCBC);
ht.Add("TripleDES", OID_RSA_DES_EDE3_CBC);
ht.Add("System.Security.Cryptography.TripleDESCryptoServiceProvider", OID_RSA_DES_EDE3_CBC);
Debug.Assert(ht.Count <= capacity); // if more entries are added in the future, increase initial capacity.
s_defaultOidHT = ht;
return s_defaultOidHT;
}
}
private static Dictionary<string, object> DefaultNameHT
{
get
{
if (s_defaultNameHT != null)
{
return s_defaultNameHT;
}
const int capacity = 89;
Dictionary<string, object> ht = new Dictionary<string, object>(capacity: capacity, comparer: StringComparer.OrdinalIgnoreCase);
Type HMACMD5Type = typeof(System.Security.Cryptography.HMACMD5);
Type HMACSHA1Type = typeof(System.Security.Cryptography.HMACSHA1);
Type HMACSHA256Type = typeof(System.Security.Cryptography.HMACSHA256);
Type HMACSHA384Type = typeof(System.Security.Cryptography.HMACSHA384);
Type HMACSHA512Type = typeof(System.Security.Cryptography.HMACSHA512);
Type RijndaelManagedType = typeof(System.Security.Cryptography.RijndaelManaged);
Type AesManagedType = typeof(System.Security.Cryptography.AesManaged);
Type SHA256DefaultType = typeof(System.Security.Cryptography.SHA256Managed);
Type SHA384DefaultType = typeof(System.Security.Cryptography.SHA384Managed);
Type SHA512DefaultType = typeof(System.Security.Cryptography.SHA512Managed);
string SHA1CryptoServiceProviderType = "System.Security.Cryptography.SHA1CryptoServiceProvider, " + AssemblyName_Csp;
string MD5CryptoServiceProviderType = "System.Security.Cryptography.MD5CryptoServiceProvider," + AssemblyName_Csp;
string RSACryptoServiceProviderType = "System.Security.Cryptography.RSACryptoServiceProvider, " + AssemblyName_Csp;
string DSACryptoServiceProviderType = "System.Security.Cryptography.DSACryptoServiceProvider, " + AssemblyName_Csp;
string DESCryptoServiceProviderType = "System.Security.Cryptography.DESCryptoServiceProvider, " + AssemblyName_Csp;
string TripleDESCryptoServiceProviderType = "System.Security.Cryptography.TripleDESCryptoServiceProvider, " + AssemblyName_Csp;
string RC2CryptoServiceProviderType = "System.Security.Cryptography.RC2CryptoServiceProvider, " + AssemblyName_Csp;
string RNGCryptoServiceProviderType = "System.Security.Cryptography.RNGCryptoServiceProvider, " + AssemblyName_Csp;
string AesCryptoServiceProviderType = "System.Security.Cryptography.AesCryptoServiceProvider, " + AssemblyName_Csp;
string ECDsaCngType = "System.Security.Cryptography.ECDsaCng, " + AssemblyName_Cng;
// Random number generator
ht.Add("RandomNumberGenerator", RNGCryptoServiceProviderType);
ht.Add("System.Security.Cryptography.RandomNumberGenerator", RNGCryptoServiceProviderType);
// Hash functions
ht.Add("SHA", SHA1CryptoServiceProviderType);
ht.Add("SHA1", SHA1CryptoServiceProviderType);
ht.Add("System.Security.Cryptography.SHA1", SHA1CryptoServiceProviderType);
ht.Add("System.Security.Cryptography.HashAlgorithm", SHA1CryptoServiceProviderType);
ht.Add("MD5", MD5CryptoServiceProviderType);
ht.Add("System.Security.Cryptography.MD5", MD5CryptoServiceProviderType);
ht.Add("SHA256", SHA256DefaultType);
ht.Add("SHA-256", SHA256DefaultType);
ht.Add("System.Security.Cryptography.SHA256", SHA256DefaultType);
ht.Add("SHA384", SHA384DefaultType);
ht.Add("SHA-384", SHA384DefaultType);
ht.Add("System.Security.Cryptography.SHA384", SHA384DefaultType);
ht.Add("SHA512", SHA512DefaultType);
ht.Add("SHA-512", SHA512DefaultType);
ht.Add("System.Security.Cryptography.SHA512", SHA512DefaultType);
// Keyed Hash Algorithms
ht.Add("System.Security.Cryptography.HMAC", HMACSHA1Type);
ht.Add("System.Security.Cryptography.KeyedHashAlgorithm", HMACSHA1Type);
ht.Add("HMACMD5", HMACMD5Type);
ht.Add("System.Security.Cryptography.HMACMD5", HMACMD5Type);
ht.Add("HMACSHA1", HMACSHA1Type);
ht.Add("System.Security.Cryptography.HMACSHA1", HMACSHA1Type);
ht.Add("HMACSHA256", HMACSHA256Type);
ht.Add("System.Security.Cryptography.HMACSHA256", HMACSHA256Type);
ht.Add("HMACSHA384", HMACSHA384Type);
ht.Add("System.Security.Cryptography.HMACSHA384", HMACSHA384Type);
ht.Add("HMACSHA512", HMACSHA512Type);
ht.Add("System.Security.Cryptography.HMACSHA512", HMACSHA512Type);
// Asymmetric algorithms
ht.Add("RSA", RSACryptoServiceProviderType);
ht.Add("System.Security.Cryptography.RSA", RSACryptoServiceProviderType);
ht.Add("System.Security.Cryptography.AsymmetricAlgorithm", RSACryptoServiceProviderType);
ht.Add("DSA", DSACryptoServiceProviderType);
ht.Add("System.Security.Cryptography.DSA", DSACryptoServiceProviderType);
// Windows will register the public ECDsaCng type. Non-Windows gets a special handler.
if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
{
ht.Add(ECDsaIdentifier, ECDsaCngType);
}
ht.Add("ECDsaCng", ECDsaCngType);
ht.Add("System.Security.Cryptography.ECDsaCng", ECDsaCngType);
// Symmetric algorithms
ht.Add("DES", DESCryptoServiceProviderType);
ht.Add("System.Security.Cryptography.DES", DESCryptoServiceProviderType);
ht.Add("3DES", TripleDESCryptoServiceProviderType);
ht.Add("TripleDES", TripleDESCryptoServiceProviderType);
ht.Add("Triple DES", TripleDESCryptoServiceProviderType);
ht.Add("System.Security.Cryptography.TripleDES", TripleDESCryptoServiceProviderType);
ht.Add("RC2", RC2CryptoServiceProviderType);
ht.Add("System.Security.Cryptography.RC2", RC2CryptoServiceProviderType);
ht.Add("Rijndael", RijndaelManagedType);
ht.Add("System.Security.Cryptography.Rijndael", RijndaelManagedType);
// Rijndael is the default symmetric cipher because (a) it's the strongest and (b) we know we have an implementation everywhere
ht.Add("System.Security.Cryptography.SymmetricAlgorithm", RijndaelManagedType);
ht.Add("AES", AesCryptoServiceProviderType);
ht.Add("AesCryptoServiceProvider", AesCryptoServiceProviderType);
ht.Add("System.Security.Cryptography.AesCryptoServiceProvider", AesCryptoServiceProviderType);
ht.Add("AesManaged", AesManagedType);
ht.Add("System.Security.Cryptography.AesManaged", AesManagedType);
// Xml Dsig/ Enc Hash algorithms
ht.Add("http://www.w3.org/2000/09/xmldsig#sha1", SHA1CryptoServiceProviderType);
// Add the other hash algorithms introduced with XML Encryption
ht.Add("http://www.w3.org/2001/04/xmlenc#sha256", SHA256DefaultType);
ht.Add("http://www.w3.org/2001/04/xmlenc#sha512", SHA512DefaultType);
// Xml Encryption symmetric keys
ht.Add("http://www.w3.org/2001/04/xmlenc#des-cbc", DESCryptoServiceProviderType);
ht.Add("http://www.w3.org/2001/04/xmlenc#tripledes-cbc", TripleDESCryptoServiceProviderType);
ht.Add("http://www.w3.org/2001/04/xmlenc#kw-tripledes", TripleDESCryptoServiceProviderType);
ht.Add("http://www.w3.org/2001/04/xmlenc#aes128-cbc", RijndaelManagedType);
ht.Add("http://www.w3.org/2001/04/xmlenc#kw-aes128", RijndaelManagedType);
ht.Add("http://www.w3.org/2001/04/xmlenc#aes192-cbc", RijndaelManagedType);
ht.Add("http://www.w3.org/2001/04/xmlenc#kw-aes192", RijndaelManagedType);
ht.Add("http://www.w3.org/2001/04/xmlenc#aes256-cbc", RijndaelManagedType);
ht.Add("http://www.w3.org/2001/04/xmlenc#kw-aes256", RijndaelManagedType);
// Xml Dsig HMAC URIs from http://www.w3.org/TR/xmldsig-core/
ht.Add("http://www.w3.org/2000/09/xmldsig#hmac-sha1", HMACSHA1Type);
// Xml Dsig-more Uri's as defined in http://www.ietf.org/rfc/rfc4051.txt
ht.Add("http://www.w3.org/2001/04/xmldsig-more#md5", MD5CryptoServiceProviderType);
ht.Add("http://www.w3.org/2001/04/xmldsig-more#sha384", SHA384DefaultType);
ht.Add("http://www.w3.org/2001/04/xmldsig-more#hmac-md5", HMACMD5Type);
ht.Add("http://www.w3.org/2001/04/xmldsig-more#hmac-sha256", HMACSHA256Type);
ht.Add("http://www.w3.org/2001/04/xmldsig-more#hmac-sha384", HMACSHA384Type);
ht.Add("http://www.w3.org/2001/04/xmldsig-more#hmac-sha512", HMACSHA512Type);
// X509 Extensions (custom decoders)
// Basic Constraints OID value
ht.Add("2.5.29.10", "System.Security.Cryptography.X509Certificates.X509BasicConstraintsExtension, " + AssemblyName_X509Certificates);
ht.Add("2.5.29.19", "System.Security.Cryptography.X509Certificates.X509BasicConstraintsExtension, " + AssemblyName_X509Certificates);
// Subject Key Identifier OID value
ht.Add("2.5.29.14", "System.Security.Cryptography.X509Certificates.X509SubjectKeyIdentifierExtension, " + AssemblyName_X509Certificates);
// Key Usage OID value
ht.Add("2.5.29.15", "System.Security.Cryptography.X509Certificates.X509KeyUsageExtension, " + AssemblyName_X509Certificates);
// Enhanced Key Usage OID value
ht.Add("2.5.29.37", "System.Security.Cryptography.X509Certificates.X509EnhancedKeyUsageExtension, " + AssemblyName_X509Certificates);
// X509Chain class can be overridden to use a different chain engine.
ht.Add("X509Chain", "System.Security.Cryptography.X509Certificates.X509Chain, " + AssemblyName_X509Certificates);
// PKCS9 attributes
ht.Add("1.2.840.113549.1.9.3", "System.Security.Cryptography.Pkcs.Pkcs9ContentType, " + AssemblyName_Pkcs);
ht.Add("1.2.840.113549.1.9.4", "System.Security.Cryptography.Pkcs.Pkcs9MessageDigest, " + AssemblyName_Pkcs);
ht.Add("1.2.840.113549.1.9.5", "System.Security.Cryptography.Pkcs.Pkcs9SigningTime, " + AssemblyName_Pkcs);
ht.Add("1.3.6.1.4.1.311.88.2.1", "System.Security.Cryptography.Pkcs.Pkcs9DocumentName, " + AssemblyName_Pkcs);
ht.Add("1.3.6.1.4.1.311.88.2.2", "System.Security.Cryptography.Pkcs.Pkcs9DocumentDescription, " + AssemblyName_Pkcs);
Debug.Assert(ht.Count <= capacity); // // if more entries are added in the future, increase initial capacity.
s_defaultNameHT = ht;
return s_defaultNameHT;
// Types in Desktop but currently unsupported in CoreFx:
// Type HMACRIPEMD160Type = typeof(System.Security.Cryptography.HMACRIPEMD160);
// Type MAC3DESType = typeof(System.Security.Cryptography.MACTripleDES);
// Type DSASignatureDescriptionType = typeof(System.Security.Cryptography.DSASignatureDescription);
// Type RSAPKCS1SHA1SignatureDescriptionType = typeof(System.Security.Cryptography.RSAPKCS1SHA1SignatureDescription);
// Type RSAPKCS1SHA256SignatureDescriptionType = typeof(System.Security.Cryptography.RSAPKCS1SHA256SignatureDescription);
// Type RSAPKCS1SHA384SignatureDescriptionType = typeof(System.Security.Cryptography.RSAPKCS1SHA384SignatureDescription);
// Type RSAPKCS1SHA512SignatureDescriptionType = typeof(System.Security.Cryptography.RSAPKCS1SHA512SignatureDescription);
// string RIPEMD160ManagedType = "System.Security.Cryptography.RIPEMD160Managed" + AssemblyName_Encoding;
// string ECDiffieHellmanCngType = "System.Security.Cryptography.ECDiffieHellmanCng, " + AssemblyName_Cng;
// string MD5CngType = "System.Security.Cryptography.MD5Cng, " + AssemblyName_Cng;
// string SHA1CngType = "System.Security.Cryptography.SHA1Cng, " + AssemblyName_Cng;
// string SHA256CngType = "System.Security.Cryptography.SHA256Cng, " + AssemblyName_Cng;
// string SHA384CngType = "System.Security.Cryptography.SHA384Cng, " + AssemblyName_Cng;
// string SHA512CngType = "System.Security.Cryptography.SHA512Cng, " + AssemblyName_Cng;
// string SHA256CryptoServiceProviderType = "System.Security.Cryptography.SHA256CryptoServiceProvider, " + AssemblyName_Csp;
// string SHA384CryptoSerivceProviderType = "System.Security.Cryptography.SHA384CryptoServiceProvider, " + AssemblyName_Csp;
// string SHA512CryptoServiceProviderType = "System.Security.Cryptography.SHA512CryptoServiceProvider, " + AssemblyName_Csp;
// string DpapiDataProtectorType = "System.Security.Cryptography.DpapiDataProtector, " + AssemblyRef.SystemSecurity;
}
}
public static void AddAlgorithm(Type algorithm, params string[] names)
{
if (algorithm == null)
throw new ArgumentNullException(nameof(algorithm));
if (!algorithm.IsVisible)
throw new ArgumentException(SR.Cryptography_AlgorithmTypesMustBeVisible, nameof(algorithm));
if (names == null)
throw new ArgumentNullException(nameof(names));
string[] algorithmNames = new string[names.Length];
Array.Copy(names, algorithmNames, algorithmNames.Length);
// Pre-check the algorithm names for validity so that we don't add a few of the names and then
// throw an exception if we find an invalid name partway through the list.
foreach (string name in algorithmNames)
{
if (string.IsNullOrEmpty(name))
{
throw new ArgumentException(SR.Cryptography_AddNullOrEmptyName);
}
}
// Everything looks valid, so we're safe to add the name mappings.
foreach (string name in algorithmNames)
{
appNameHT[name] = algorithm;
}
}
public static object CreateFromName(string name, params object[] args)
{
if (name == null)
throw new ArgumentNullException(nameof(name));
// Check to see if we have an application defined mapping
appNameHT.TryGetValue(name, out Type retvalType);
// We allow the default table to Types and Strings
// Types get used for types in .Algorithms assembly.
// strings get used for delay-loaded stuff in other assemblies such as .Csp.
if (retvalType == null && DefaultNameHT.TryGetValue(name, out object retvalObj))
{
retvalType = retvalObj as Type;
if (retvalType == null)
{
if (retvalObj is string retvalString)
{
retvalType = Type.GetType(retvalString, false, false);
if (retvalType != null && !retvalType.IsVisible)
{
retvalType = null;
}
if (retvalType != null)
{
// Add entry to the appNameHT, which makes subsequent calls much faster.
appNameHT[name] = retvalType;
}
}
else
{
Debug.Fail("Unsupported Dictionary value:" + retvalObj.ToString());
}
}
}
// Special case asking for "ECDsa" since the default map from .NET Framework uses
// a Windows-only type.
if (retvalType == null &&
(args == null || args.Length == 1) &&
name == ECDsaIdentifier)
{
return ECDsa.Create();
}
// Maybe they gave us a classname.
if (retvalType == null)
{
retvalType = Type.GetType(name, false, false);
if (retvalType != null && !retvalType.IsVisible)
{
retvalType = null;
}
}
// Still null? Then we didn't find it.
if (retvalType == null)
{
return null;
}
// Locate all constructors.
MethodBase[] cons = retvalType.GetConstructors(ConstructorDefault);
if (cons == null)
{
return null;
}
if (args == null)
{
args = Array.Empty<object>();
}
List<MethodBase> candidates = new List<MethodBase>();
for (int i = 0; i < cons.Length; i++)
{
MethodBase con = cons[i];
if (con.GetParameters().Length == args.Length)
{
candidates.Add(con);
}
}
if (candidates.Count == 0)
{
return null;
}
cons = candidates.ToArray();
// Bind to matching ctor.
ConstructorInfo rci = Type.DefaultBinder.BindToMethod(
ConstructorDefault,
cons,
ref args,
null,
null,
null,
out object state) as ConstructorInfo;
// Check for ctor we don't like (non-existent, delegate or decorated with declarative linktime demand).
if (rci == null || typeof(Delegate).IsAssignableFrom(rci.DeclaringType))
{
return null;
}
// Ctor invoke and allocation.
object retval = rci.Invoke(ConstructorDefault, Type.DefaultBinder, args, null);
// Reset any parameter re-ordering performed by the binder.
if (state != null)
{
Type.DefaultBinder.ReorderArgumentArray(ref args, state);
}
return retval;
}
public static object CreateFromName(string name)
{
return CreateFromName(name, null);
}
public static void AddOID(string oid, params string[] names)
{
if (oid == null)
throw new ArgumentNullException(nameof(oid));
if (names == null)
throw new ArgumentNullException(nameof(names));
string[] oidNames = new string[names.Length];
Array.Copy(names, oidNames, oidNames.Length);
// Pre-check the input names for validity, so that we don't add a few of the names and throw an
// exception if an invalid name is found further down the array.
foreach (string name in oidNames)
{
if (string.IsNullOrEmpty(name))
{
throw new ArgumentException(SR.Cryptography_AddNullOrEmptyName);
}
}
// Everything is valid, so we're good to lock the hash table and add the application mappings
foreach (string name in oidNames)
{
appOidHT[name] = oid;
}
}
public static string MapNameToOID(string name)
{
if (name == null)
throw new ArgumentNullException(nameof(name));
appOidHT.TryGetValue(name, out string oidName);
if (string.IsNullOrEmpty(oidName) && !DefaultOidHT.TryGetValue(name, out oidName))
{
try
{
Oid oid = Oid.FromFriendlyName(name, OidGroup.All);
oidName = oid.Value;
}
catch (CryptographicException) { }
}
return oidName;
}
public static byte[] EncodeOID(string str)
{
if (str == null)
throw new ArgumentNullException(nameof(str));
string[] oidString = str.Split(SepArray);
uint[] oidNums = new uint[oidString.Length];
for (int i = 0; i < oidString.Length; i++)
{
oidNums[i] = unchecked((uint)int.Parse(oidString[i], CultureInfo.InvariantCulture));
}
// Handle the first two oidNums special
if (oidNums.Length < 2)
throw new CryptographicUnexpectedOperationException(SR.Cryptography_InvalidOID);
uint firstTwoOidNums = unchecked((oidNums[0] * 40) + oidNums[1]);
// Determine length of output array
int encodedOidNumsLength = 2; // Reserve first two bytes for later
EncodeSingleOidNum(firstTwoOidNums, null, ref encodedOidNumsLength);
for (int i = 2; i < oidNums.Length; i++)
{
EncodeSingleOidNum(oidNums[i], null, ref encodedOidNumsLength);
}
// Allocate the array to receive encoded oidNums
byte[] encodedOidNums = new byte[encodedOidNumsLength];
int encodedOidNumsIndex = 2;
// Encode each segment
EncodeSingleOidNum(firstTwoOidNums, encodedOidNums, ref encodedOidNumsIndex);
for (int i = 2; i < oidNums.Length; i++)
{
EncodeSingleOidNum(oidNums[i], encodedOidNums, ref encodedOidNumsIndex);
}
Debug.Assert(encodedOidNumsIndex == encodedOidNumsLength);
// Final return value is 06 <length> encodedOidNums[]
if (encodedOidNumsIndex - 2 > 0x7f)
throw new CryptographicUnexpectedOperationException(SR.Cryptography_Config_EncodedOIDError);
encodedOidNums[0] = (byte)0x06;
encodedOidNums[1] = (byte)(encodedOidNumsIndex - 2);
return encodedOidNums;
}
private static void EncodeSingleOidNum(uint value, byte[] destination, ref int index)
{
// Write directly to destination starting at index, and update index based on how many bytes written.
// If destination is null, just return updated index.
if (unchecked((int)value) < 0x80)
{
if (destination != null)
{
destination[index++] = unchecked((byte)value);
}
else
{
index += 1;
}
}
else if (value < 0x4000)
{
if (destination != null)
{
destination[index++] = (byte)((value >> 7) | 0x80);
destination[index++] = (byte)(value & 0x7f);
}
else
{
index += 2;
}
}
else if (value < 0x200000)
{
if (destination != null)
{
unchecked
{
destination[index++] = (byte)((value >> 14) | 0x80);
destination[index++] = (byte)((value >> 7) | 0x80);
destination[index++] = (byte)(value & 0x7f);
}
}
else
{
index += 3;
}
}
else if (value < 0x10000000)
{
if (destination != null)
{
unchecked
{
destination[index++] = (byte)((value >> 21) | 0x80);
destination[index++] = (byte)((value >> 14) | 0x80);
destination[index++] = (byte)((value >> 7) | 0x80);
destination[index++] = (byte)(value & 0x7f);
}
}
else
{
index += 4;
}
}
else
{
if (destination != null)
{
unchecked
{
destination[index++] = (byte)((value >> 28) | 0x80);
destination[index++] = (byte)((value >> 21) | 0x80);
destination[index++] = (byte)((value >> 14) | 0x80);
destination[index++] = (byte)((value >> 7) | 0x80);
destination[index++] = (byte)(value & 0x7f);
}
}
else
{
index += 5;
}
}
}
}
}
| {
"content_hash": "e79a5ebcd50aad18e625bfc650a556f0",
"timestamp": "",
"source": "github",
"line_count": 626,
"max_line_length": 155,
"avg_line_length": 49.477635782747605,
"alnum_prop": 0.582410486552804,
"repo_name": "ericstj/corefx",
"id": "ebfe8669a20e97fc683f991f05a3a030d6f07970",
"size": "31177",
"binary": false,
"copies": "12",
"ref": "refs/heads/master",
"path": "src/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/CryptoConfig.cs",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "1C Enterprise",
"bytes": "280724"
},
{
"name": "ASP",
"bytes": "1687"
},
{
"name": "Batchfile",
"bytes": "12277"
},
{
"name": "C",
"bytes": "3790209"
},
{
"name": "C#",
"bytes": "181917368"
},
{
"name": "C++",
"bytes": "1521"
},
{
"name": "CMake",
"bytes": "68305"
},
{
"name": "DIGITAL Command Language",
"bytes": "26402"
},
{
"name": "Dockerfile",
"bytes": "1332"
},
{
"name": "HTML",
"bytes": "653"
},
{
"name": "Makefile",
"bytes": "13780"
},
{
"name": "OpenEdge ABL",
"bytes": "137969"
},
{
"name": "Perl",
"bytes": "3895"
},
{
"name": "PowerShell",
"bytes": "201656"
},
{
"name": "Python",
"bytes": "1535"
},
{
"name": "Roff",
"bytes": "9422"
},
{
"name": "Shell",
"bytes": "131358"
},
{
"name": "TSQL",
"bytes": "96941"
},
{
"name": "Visual Basic",
"bytes": "2135386"
},
{
"name": "XSLT",
"bytes": "514720"
}
],
"symlink_target": ""
} |
import {ConfigurationTemplate, NoValueSupplied, Property} from "../index";
describe("ConfigurationTemplate", () => {
it("is immutable", () => {
const FOO = Property.string("FOO");
const originalConfig = new ConfigurationTemplate().withProp(FOO, "foo");
const updatedConfig = originalConfig.withProp(FOO, "bar");
expect(originalConfig.reify().get(FOO)).toEqual("foo");
expect(updatedConfig.reify().get(FOO)).toEqual("bar");
});
it("throws an exception when requiring and no value is given", () => {
const FOO = Property.string("FOO");
const configurationTemplate = new ConfigurationTemplate().requiring(FOO);
expect(() => configurationTemplate.reify()).toThrow(NoValueSupplied("FOO"))
});
it("gives env variable precedence over default", () => {
const FOO = Property.string("FOO");
process.env.FOO = "from env";
const configurationTemplate = new ConfigurationTemplate().withProp(FOO, "default");
expect(configurationTemplate.reify().get(FOO)).toEqual("from env")
});
it("uses default when env variable is undefined", () => {
const FOO = Property.string("FOO");
delete process.env.FOO;
const configurationTemplate = new ConfigurationTemplate().withProp(FOO, "default");
expect(configurationTemplate.reify().get(FOO)).toEqual("default")
});
});
| {
"content_hash": "bb5faeef56faa761a39af945c2dc0ebe",
"timestamp": "",
"source": "github",
"line_count": 38,
"max_line_length": 91,
"avg_line_length": 37.18421052631579,
"alnum_prop": 0.6440198159943383,
"repo_name": "daviddenton/configur8",
"id": "e6e186c5ea2fcd7c56c9ddf22c35bd4aeb25b298",
"size": "1413",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "javascript/src/__test__/ConfigurationTemplate.test.ts",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "JavaScript",
"bytes": "315"
},
{
"name": "Kotlin",
"bytes": "15144"
},
{
"name": "Scala",
"bytes": "33888"
},
{
"name": "Shell",
"bytes": "937"
},
{
"name": "TypeScript",
"bytes": "6606"
}
],
"symlink_target": ""
} |
<!--- This file is automatically generated by make gen-cli-docs; changes should be made in the go CLI command code (under cmd/kops) -->
## kops rolling-update
Rolling update a cluster.
### Synopsis
This command updates a kubernetes cluster to match the cloud and kops specifications.
To perform a rolling update, you need to update the cloud resources first with the command
`kops update cluster`.
If rolling-update does not report that the cluster needs to be rolled, you can force the cluster to be
rolled with the force flag. Rolling update drains and validates the cluster by default. A cluster is
deemed validated when all required nodes are running and all pods in the kube-system namespace are operational.
When a node is deleted, rolling-update sleeps the interval for the node type, and then tries for the same period
of time for the cluster to be validated. For instance, setting --master-interval=3m causes rolling-update
to wait for 3 minutes after a master is rolled, and another 3 minutes for the cluster to stabilize and pass
validation.
Note: terraform users will need to run all of the following commands from the same directory
`kops update cluster --target=terraform` then `terraform plan` then
`terraform apply` prior to running `kops rolling-update cluster`.
### Examples
```
# Preview a rolling-update.
kops rolling-update cluster
# Roll the currently selected kops cluster with defaults.
# Nodes will be drained and the cluster will be validated between node replacement.
kops rolling-update cluster --yes
# Roll the k8s-cluster.example.com kops cluster,
# do not fail if the cluster does not validate,
# wait 8 min to create new node, and wait at least
# 8 min to validate the cluster.
kops rolling-update cluster k8s-cluster.example.com --yes \
--fail-on-validate-error="false" \
--master-interval=8m \
--node-interval=8m
# Roll the k8s-cluster.example.com kops cluster,
# do not validate the cluster because of the cloudonly flag.
# Force the entire cluster to roll, even if rolling update
# reports that the cluster does not need to be rolled.
kops rolling-update cluster k8s-cluster.example.com --yes \
--cloudonly \
--force
# Roll the k8s-cluster.example.com kops cluster,
# only roll the node instancegroup,
# use the new drain an validate functionality.
kops rolling-update cluster k8s-cluster.example.com --yes \
--fail-on-validate-error="false" \
--node-interval 8m \
--instance-group nodes
```
### Options inherited from parent commands
```
--alsologtostderr log to standard error as well as files
--config string config file (default is $HOME/.kops.yaml)
--log_backtrace_at traceLocation when logging hits line file:N, emit a stack trace (default :0)
--log_dir string If non-empty, write log files in this directory
--logtostderr log to standard error instead of files (default false)
--name string Name of cluster. Overrides KOPS_CLUSTER_NAME environment variable
--state string Location of state storage. Overrides KOPS_STATE_STORE environment variable
--stderrthreshold severity logs at or above this threshold go to stderr (default 2)
-v, --v Level log level for V logs
--vmodule moduleSpec comma-separated list of pattern=N settings for file-filtered logging
```
### SEE ALSO
* [kops](kops.md) - kops is Kubernetes ops.
* [kops rolling-update cluster](kops_rolling-update_cluster.md) - Rolling update a cluster.
| {
"content_hash": "06e7e9efcfd13dcdf03792d0621f7374",
"timestamp": "",
"source": "github",
"line_count": 81,
"max_line_length": 135,
"avg_line_length": 45.160493827160494,
"alnum_prop": 0.7121377802077639,
"repo_name": "mad01/kops",
"id": "d9636474f16a0c2efc52dd8af5a7459e11623776",
"size": "3659",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "docs/cli/kops_rolling-update.md",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Go",
"bytes": "5778750"
},
{
"name": "HCL",
"bytes": "380971"
},
{
"name": "Makefile",
"bytes": "31890"
},
{
"name": "Python",
"bytes": "177397"
},
{
"name": "Ruby",
"bytes": "1027"
},
{
"name": "Shell",
"bytes": "70895"
}
],
"symlink_target": ""
} |
var QUnit = require("steal-qunit");
var set = require("../set-core"),
props = require("../props");
QUnit.module("can-set props.id");
test("id set.difference", function(){
var idProps = props.id("color");
var res;
res = set.difference({ color: "red" }, { color: "blue" }, idProps);
deepEqual(res, false, "id changes always false");
res = set.difference({ color: "red" }, { }, idProps);
deepEqual(res, false, "id removal always false");
res = set.difference({ }, { color: "blue" }, idProps);
deepEqual(res, true, "id addition always true");
});
test("id set.difference with where", function() {
var algebra = new set.Algebra(
props.id("color"),
props.enum("type", ["light", "dark"])
);
var res;
res = set.difference({ color: "red", type: ["light", "dark"] }, { color: "blue", type: "light" }, algebra);
deepEqual(res, false, "id changes always false");
res = set.difference({ color: "red", type: ["light", "dark"] }, { type: "light" }, algebra);
deepEqual(res, false, "id removal always false");
res = set.difference({ type: ["light", "dark"] }, { type: "light", color: "blue" }, algebra);
deepEqual(res, true, "id addition always true");
res = set.difference({ type: ["light", "dark"] }, { type: "light" }, algebra);
deepEqual(res, { type: "dark" }, "no id clause, fall back to where");
res = set.difference({ color: "red", type: ["light", "dark"] }, { color: "red", type: "light" }, algebra);
deepEqual(res, { color: "red", type: "dark" }, "no id change, fall back to where");
}); | {
"content_hash": "efdaf7181116ab5fd0a0ff7e8c1d3868",
"timestamp": "",
"source": "github",
"line_count": 46,
"max_line_length": 109,
"avg_line_length": 33.67391304347826,
"alnum_prop": 0.6042608134280181,
"repo_name": "canjs/can-set",
"id": "5076f9a1d64cb6d67b7c46771004410cc5e1eae8",
"size": "1549",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/prop_tests/id_test.js",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "HTML",
"bytes": "132"
},
{
"name": "JavaScript",
"bytes": "120009"
}
],
"symlink_target": ""
} |
<?php
use yii\helpers\Html;
use yii\widgets\ActiveForm;
use yii\helpers\ArrayHelper;
use yii\bootstrap\Modal;
use yii\helpers\Url;
use backend\models\User;
use backend\models\Products;
use backend\models\Unitsmeasures;
use kartik\widgets\DatePicker;
use kartik\widgets\FileInput;
/* @var $this yii\web\View */
/* @var $model backend\models\Products */
/* @var $form yii\widgets\ActiveForm */
?>
<div class="products-form">
<?php $form = ActiveForm::begin(['options' => ['enctype' => 'multipart/form-data']]); ?>
<?= $form->field($model, 'idProduct')->textInput()->hiddenInput() ->label(false); ?>
<?php $model->idUser = Yii::$app->user->identity->id;?>
<?= $form->field($model, 'idUser')->textInput()->hiddenInput() ->label(false); ?>
<?= $form->field($model, 'name')->textInput(['maxlength' => true]) ?>
<?= $form->field($model, 'description')->textInput(['maxlength' => true]) ?>
<?= $form->field($model, 'quantityPurchased')->textInput(['maxlength' => true]) ?>
<?= $form->field($model, 'amountSold')->textInput(['maxlength' => true]) ?>
<?= $form->field($model, 'remainingAmount')->textInput(['maxlength' => true]) ?>
<?= $form->field($model,'idUnit')->dropDownList(
ArrayHelper::map(Unitsmeasures::find()->all(),'idUnit','idUnit'),
[
'prompt'=>'Seleccione la unidad de medida',
'onchange'=>'
$.post(
"index.php?r=products/get-information-units-measures&id="+$(this).val(),function(data){
var result = JSON.parse(data);
$("#products-nameunit").val(result["name"]);
}
);
'
]
)?>
<?= $form->field($model, 'nameUnit')->textInput(['maxlength' => true, 'readonly' => true]) ?>
<?= $form->field($model, 'price')->textInput(['maxlength' => true]) ?>
<?php //$form->field($model, 'date')->textInput(['readonly' => true])
echo '<label class="control-label">'.Yii::t('frontend', 'created_at').'</label>';
echo DatePicker::widget([
'attribute' => 'created_at',
'model' => $model,
'language' => 'es-ES',
'type' => DatePicker::TYPE_COMPONENT_APPEND,
'pluginOptions' => [
'format' => 'yyyy-mm-dd',
'multidate' => false,
]
]);
?>
<?php //$form->field($model, 'date')->textInput(['readonly' => true])
echo '<label class="control-label">'.Yii::t('frontend', 'updated_at').'</label>';
echo DatePicker::widget([
'attribute' => 'updated_at',
'model' => $model,
'language' => 'es-ES',
'type' => DatePicker::TYPE_COMPONENT_APPEND,
'pluginOptions' => [
'format' => 'yyyy-mm-dd',
'multidate' => false,
]
]);
?>
<br>
<?= $form->field($model, 'file')->fileInput() ?>
<?= Html::img($model->image,
[
'width'=>'200px',
//'height'=>'402',
]
);?>
<br>
<div class="form-group"><br>
<?= Html::submitButton($model->isNewRecord ? Yii::t('frontend', 'Create') : Yii::t('frontend', 'Update'), ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']) ?>
</div>
<?php ActiveForm::end(); ?>
</div>
| {
"content_hash": "87c62cd4e6584442b1c3f595cb957ea7",
"timestamp": "",
"source": "github",
"line_count": 103,
"max_line_length": 190,
"avg_line_length": 33.46601941747573,
"alnum_prop": 0.5108790252393386,
"repo_name": "countolaff/scid",
"id": "25f500ccf05f441e4171ed65a9278634e12893e7",
"size": "3447",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "frontend/views/products/_form.php",
"mode": "33188",
"license": "bsd-2-clause",
"language": [
{
"name": "Batchfile",
"bytes": "1541"
},
{
"name": "CSS",
"bytes": "2728"
},
{
"name": "JavaScript",
"bytes": "533"
},
{
"name": "PHP",
"bytes": "291347"
}
],
"symlink_target": ""
} |
package com.veridu.endpoint;
import java.io.UnsupportedEncodingException;
import java.util.HashMap;
import org.json.simple.JSONArray;
import org.json.simple.JSONObject;
import org.json.simple.parser.ParseException;
import com.veridu.exceptions.APIError;
import com.veridu.exceptions.EmptyResponse;
import com.veridu.exceptions.EmptySession;
import com.veridu.exceptions.InvalidFormat;
import com.veridu.exceptions.InvalidResponse;
import com.veridu.exceptions.NonceMismatch;
import com.veridu.exceptions.RequestFailed;
import com.veridu.exceptions.SignatureFailed;
import com.veridu.storage.Storage;
/**
* Hook Resource
*
* @see <a href="https://veridu.com/wiki/Hook_Resource"> Wiki/Hook_Resource </a>
* @version 1.0
*/
public class Hook extends AbstractEndpoint {
public Hook(String key, String secret, String version, Storage storage) {
super(key, secret, version, storage);
}
/**
* Creates a new Hook
*
* @param trigger
* One of the available hook (See:
* https://veridu.com/wiki/Hook_Resource#Available_Triggers)
* @param url
* Full hook url
*
* @return Details of the hook in JSON format
*
* @throws EmptySession
* Exception
* @throws SignatureFailed
* Exception
* @throws NonceMismatch
* Exception
* @throws EmptyResponse
* Exception
* @throws InvalidFormat
* Exception
* @throws InvalidResponse
* Exception
* @throws APIError
* Exception
* @throws RequestFailed
* Exception
* @throws UnsupportedEncodingException
* Exception
* @throws ParseException
*
* @see <a href=
* "https://veridu.com/wiki/Hook_Resource#How_to_create_a_new_Hook">How
* to create a new Hook</a>
*/
public JSONObject create(String trigger, String url)
throws EmptySession, SignatureFailed, NonceMismatch, EmptyResponse, InvalidFormat, InvalidResponse,
APIError, RequestFailed, UnsupportedEncodingException, ParseException {
if (this.storage.isSessionEmpty())
throw new EmptySession();
HashMap<String, String> data = new HashMap<>();
data.put("trigger", trigger);
data.put("url", url);
JSONObject json = this.signedFetch("POST", "hook/", data);
return json;
}
/**
* Deletes a hook
*
* @param id
* the ID of the Hook
*
* @return boolean status
*
* @throws EmptySession
* Exception
* @throws SignatureFailed
* Exception
* @throws NonceMismatch
* Exception
* @throws EmptyResponse
* Exception
* @throws InvalidFormat
* Exception
* @throws InvalidResponse
* Exception
* @throws APIError
* Exception
* @throws RequestFailed
* Exception
* @throws ParseException
*
* @see <a href=
* "https://veridu.com/wiki/Hook_Resource#How_to_delete_a_hook">How to
* delete a hook</a>
*/
public boolean delete(int id) throws EmptySession, SignatureFailed, NonceMismatch, EmptyResponse, InvalidFormat,
InvalidResponse, APIError, RequestFailed, ParseException {
if (this.storage.isSessionEmpty())
throw new EmptySession();
JSONObject json = this.signedFetch("DELETE", String.format("hook/%s", id));
return Boolean.parseBoolean(json.get("status").toString());
}
/**
* Retrieves detailed information about a hook
*
* @param id
* the ID of the Hook
*
* @return The details in JSON format
*
* @throws EmptySession
* Exception
* @throws SignatureFailed
* Exception
* @throws NonceMismatch
* Exception
* @throws EmptyResponse
* Exception
* @throws InvalidFormat
* Exception
* @throws InvalidResponse
* Exception
* @throws APIError
* Exception
* @throws RequestFailed
* Exception
* @throws ParseException
*
* @see <a href=
* "https://veridu.com/wiki/Hook_Resource#How_to_retrieve_detailed_information_about_a_hook">
* How to retrieve detailed information about a hook</a>
*/
public JSONObject details(int id) throws EmptySession, SignatureFailed, NonceMismatch, EmptyResponse, InvalidFormat,
InvalidResponse, APIError, RequestFailed, ParseException {
if (this.storage.isSessionEmpty())
throw new EmptySession();
JSONObject json = this.signedFetch("GET", String.format("hook/%s/", id));
return (JSONObject) json.get("details");
}
/**
* Retrieves a list of Hooks
*
* @return List of hooks in JSONArray format.
*
* @throws EmptySession
* Exception
* @throws SignatureFailed
* Exception
* @throws NonceMismatch
* Exception
* @throws EmptyResponse
* Exception
* @throws InvalidFormat
* Exception
* @throws InvalidResponse
* Exception
* @throws APIError
* Exception
* @throws RequestFailed
* Exception
* @throws ParseException
*
* @see <a href=
* "https://veridu.com/wiki/Hook_Resource#How_to_retrieve_a_list_of_hooks">
* How to retrieve a list of hooks</a>
*/
public JSONArray list() throws EmptySession, SignatureFailed, NonceMismatch, EmptyResponse, InvalidFormat,
InvalidResponse, APIError, RequestFailed, ParseException {
if (this.storage.isSessionEmpty())
throw new EmptySession();
JSONObject json = this.signedFetch("GET", "hook/");
return (JSONArray) json.get("list");
}
}
| {
"content_hash": "d84415e0c9b2c1521b8781ecd3939bb6",
"timestamp": "",
"source": "github",
"line_count": 198,
"max_line_length": 120,
"avg_line_length": 30.893939393939394,
"alnum_prop": 0.5898316168056237,
"repo_name": "cauelorenzato/veridu-java",
"id": "925d764cba9fed93377272846df254258091b2df",
"size": "6117",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "src/main/java/com/veridu/endpoint/Hook.java",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Java",
"bytes": "425470"
}
],
"symlink_target": ""
} |
package com.appdynamics.extensions.webspheremq.metricscollector;
import com.appdynamics.extensions.logging.ExtensionsLoggerFactory;
import com.appdynamics.extensions.webspheremq.config.WMQMetricOverride;
import com.ibm.mq.constants.CMQC;
import com.ibm.mq.constants.CMQCFC;
import com.ibm.mq.pcf.PCFException;
import com.ibm.mq.pcf.PCFMessage;
import com.singularity.ee.agent.systemagent.api.exception.TaskExecutionException;
import org.slf4j.Logger;
import java.util.Arrays;
import java.util.Map;
import java.util.Set;
class InquireQStatusCmdCollector extends QueueMetricsCollector implements Runnable {
public static final Logger logger = ExtensionsLoggerFactory.getLogger(InquireQStatusCmdCollector.class);
protected static final String COMMAND = "MQCMD_INQUIRE_Q_STATUS";
public InquireQStatusCmdCollector(QueueMetricsCollector collector, Map<String, WMQMetricOverride> metricsToReport){
super(metricsToReport,collector.monitorContextConfig,collector.agent,collector.queueManager,collector.metricWriteHelper, collector.countDownLatch);
}
public void run() {
try {
logger.info("Collecting metrics for command {}",COMMAND);
publishMetrics();
} catch (TaskExecutionException e) {
logger.error("Something unforeseen has happened ",e);
}
}
protected void publishMetrics() throws TaskExecutionException {
/*
* attrs = { CMQC.MQCA_Q_NAME, MQIACF_OLDEST_MSG_AGE, MQIACF_Q_TIME_INDICATOR };
*/
long entryTime = System.currentTimeMillis();
if (getMetricsToReport() == null || getMetricsToReport().isEmpty()) {
logger.debug("Queue metrics to report from the config is null or empty, nothing to publish for command {}",COMMAND);
return;
}
int[] attrs = getIntAttributesArray(CMQC.MQCA_Q_NAME);
logger.debug("Attributes being sent along PCF agent request to query queue metrics: {} for command {}",Arrays.toString(attrs),COMMAND);
Set<String> queueGenericNames = this.queueManager.getQueueFilters().getInclude();
for(String queueGenericName : queueGenericNames){
// list of all metrics extracted through MQCMD_INQUIRE_Q_STATUS is mentioned here https://www.ibm.com/support/knowledgecenter/SSFKSJ_8.0.0/com.ibm.mq.ref.adm.doc/q087880_.htm
PCFMessage request = new PCFMessage(CMQCFC.MQCMD_INQUIRE_Q_STATUS);
request.addParameter(CMQC.MQCA_Q_NAME, queueGenericName);
request.addParameter(CMQCFC.MQIACF_Q_STATUS_ATTRS, attrs);
try {
processPCFRequestAndPublishQMetrics(queueGenericName, request,COMMAND);
} catch (PCFException pcfe) {
logger.error("PCFException caught while collecting metric for Queue: {} for command {}",queueGenericName,COMMAND, pcfe);
PCFMessage[] msgs = (PCFMessage[]) pcfe.exceptionSource;
for (int i = 0; i < msgs.length; i++) {
logger.error(msgs[i].toString());
}
// Dont throw exception as it will stop queuemetric colloection
} catch (Exception mqe) {
logger.error("MQException caught", mqe);
// Dont throw exception as it will stop queuemetric colloection
}
}
long exitTime = System.currentTimeMillis() - entryTime;
logger.debug("Time taken to publish metrics for all queues is {} milliseconds for command {}", exitTime,COMMAND);
}
}
| {
"content_hash": "313bac2f8d550602af029d3bf30a76bf",
"timestamp": "",
"source": "github",
"line_count": 74,
"max_line_length": 186,
"avg_line_length": 47.54054054054054,
"alnum_prop": 0.6913018760659465,
"repo_name": "Appdynamics/websphere-mq-monitoring-extension",
"id": "eea182311ca24b67a29eeb284b1357311fa0b910",
"size": "3793",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/main/java/com/appdynamics/extensions/webspheremq/metricscollector/InquireQStatusCmdCollector.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Java",
"bytes": "139334"
}
],
"symlink_target": ""
} |
<html>
<head>
<meta http-equiv="Content-Language" content="en-us">
<meta name="GENERATOR" content="Microsoft FrontPage 4.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>What is NwnMdlComp</title>
</head>
<body>
<h3>What is NwnMdlComp?</h3>
<p>NwnMdlComp is a model compiler and decompiler for Bioware's Neverwinter
Nights game. It allows content providers to extract binary models from NWN and
convert them to human readable ASCII format. The ASCII format is the
format commonly supported by model editing plugins. NwnMdlComp also
supports the recompilation of these ASCII models back into binary form.</p>
<p><a href="http://www.torlack.com/nwnmdlcomp/nwnmdlcomp.zip">Click here to
download NWNMDLCOMP</a></p>
<h3>Why Should You Compile Your Models?</h3>
<p>To be perfectly honest, there aren't any significantly compelling reasons to
compile models into binary form. If you look in your override directory
included with the game, most if not all of those models are in ASCII format.
However, there are some good reasons to compile modes.</p>
<p><i>Compiled models load faster. </i>Internally all models must be in
binary form to be usable by the game. In the case of ASCII models, they
are compiled "on the fly" by NWN as needed.</p>
<p><i>Compiled models use less memory and fragment memory less.</i>
Although Bioware might have taken steps to reduce the memory footprint of ASCII
models compiled "on the fly", I really question if they would have gone to all
the trouble. If Bioware doesn't serialize the core model data in a
compiled model into a single data buffer, then the compiled model would be
scattered through out memory in many different regions of allocated memory.
All these extra memory allocations do require memory overhead. (geek
alert) Also, having parts of the model scattered throughout memory does increase
the chance of page faults from either the free or modified page lists.
Even worse, it could result in the dreaded hard fault. </p>
<p><i>BUT</i> in all seriousness, I doubt either of these two points are serious
enough to even raise a single hair on an eyebrow. Compiling your models
should help performance. But don't expect your modules to suddenly start
running like a bat out of hell. </p>
<p><b>DO NOT</b> compile the ASCII models in the override directory to try to
improve your game performance. It won't help and you might screw up the
game.</p>
<h3>Running NwnMdlComp</h3>
<p>NwnMdlComp is a command line program. Thus, it doesn't have any fancy
window interface. If you wish, you can copy "nwnmdlcomp.exe" into your
window's directory.</p>
<blockquote>
<pre>Usage:
nwnmdlcomp [-cdxe] [-t#] infile [outfile]
infile - name of the input file.
outfile - name of the output file.
-c - Compile the model (default)
-d - Decompile the model (can't be used with -c)
-x - Extract model from NWN data files (not done yet)
-n - When compiling, don't remove empty faces
-e - Disable appended extension mode. Only usable when an
output file name or path is specified or extracting
files from the NWN data files using -x.
-t1 - Perform a decompilation test on all Bioware models
-t2 - Perform a decomp/recomp test on all Bioware models (absolute)
-t3 - Perform a decomp/recomp test on all Bioware models (relative)
-t4 - Perform a decomp/recomp test on all Bioware models (smoothing)</pre>
</blockquote>
<p>NwnMdlComp supports two basic modes, compilation and decompilation.</p>
<p>To convert a model from binary to ASCII, use the following command:</p>
<pre>NWNMDLCOMP -d c_bugbeara</pre>
<p>This assumes that there exists a file called "c_bugbeara.mdl" in the current
directory. To convert a model stored in the Bioware data files to ASCII,
add the "-x" option.</p>
<pre>NWNMDLCOMP -dx c_bugbeara</pre>
<p>In both these cases, a file called "c_bugbeara.mdl.ascii" will be created in
the current directory.</p>
<p>To compile an ASCII model, use the following command:</p>
<pre>NWNMDLCOMP -c c_bugbeara</pre>
<p>In this case, the file called "c_bugbeara.mdl.ascii" will be compiled and the
results saved in the file "c_bugbeara.mdl".</p>
<p>If your ASCII model file doesn't end in ".mdl.ascii" then you will need to
specify the extension of the model file.</p>
<p>For example, let us say that your model editing program saves the ASCII model
under the name "mymodel.mdl". To compile the model, you would use the
following command.</p>
<pre>NWNMDLCOMP -c mymodel.mdl</pre>
<p>In this case, the file "mymodel.mdl" will be compiled and the results saved
as "mymodel.mdl.bin". Please note that if the model doesn't end in ".mdl.ascii",
then ".bin" is appended to the input file name in order to create an output file
name. The binary model will not be saved as "mymodel.mdl" to prevent the
source file from being overwritten. However, if you wish to store your
compiled models in another directory, you can do the following.</p>
<pre>NWNMDLCOMP -c mymodel.mdl compiled/mymodel.mdl</pre>
<p>This will create a file called "mymodel.mdl" in the "compiled" directory.
The directory must already exist.</p>
<h3>Using NwnMdlComp with Wildcards</h3>
<p>NnwMdlComp supports the using of wildcards in the input file name. Standard
wildcards such as "*" and "?" are fully supported.
Wildcards can be used when compiling or decompiling models stored on disk or
stored in the Bioware data files.</p>
<pre>NWNMDLCOMP -dx *</pre>
<p>This command will decompile all the models in the Bioware data files and
store the output in the current directory.</p>
<pre>NWNMDLCOMP -dx * ascii\</pre>
<p>This command will decompile all the models in the Bioware data files and
store them in the "ascii" subdirectory. Make sure this directory
has been created.</p>
<pre>NWNMDLCOMP -ce ascii\*.mdl binary\</pre>
<p>This command will compile all the models in the subdirectory "ascii"
and store the output in the "binary" subdirectory. Another
command line option has also been specified. The "e" option will
tell the model compiler to not use the normal extensions that are appended to
the output file names. Thus, in this command example, if the ascii
subdirectory contained a model called "c_bugbear.mdl", then instead of
the output being "c_bugbear.mdl.bin" in the binary subdirectory, the
output would be "c_bugbear.mdl" in the binary subdirectory. This
"e" option can also be used when extracting models from the Bioware
data files.</p>
<pre>NWNMDLCOMP -dxe *</pre>
<p>This command will decompile all the Bioware models and store them in the
current directory with the extension of ".mdl" instead of ".mdl.ascii"
as it normally would.</p>
<h3>NwnMdlComp Regression Tests</h3>
<p>To help insure that NwnMdlComp actually works as advertised, it has a series
of three regression tests that are run against all the binary models found in
the NWN data files.</p>
<p>The "-t1" regression tests performs a basic decompilation test of all the
binary models. Success is only determined by the lack of the program crashing.</p>
<p>The "-t2" regression test will decompile a model, then recompile the results,
then decompile the recompilation. The results of the two decompilation
phases are compared to see if they actually match.</p>
<p>The "-t3" regression test will decompile a model, then recompile the results,
generate internally the model output file, then decompile the recompilation.
The results of the two decompilation phases are compared to see if they actually
match. This is the strongest of all three tests since all phases of model
compilation and decompilation are tested.</p>
<p>The "-t4" regression test will perform the same tests as
"-t3". However, it will also include smoothing data. This
test is known to generate errors.</p>
<h3>Program Limitations</h3>
<p>Compiler Limitations:</p>
<ul>
<li>None.</li>
</ul>
<p>Decompiler Limitations:</p>
<ul>
<li>Vertex smoothing isn't perfect, but it works for over 96% of the models.</li>
</ul>
<h3>Updates - 08/31/2002</h3>
<ul>
<li>The decompiler now supports smoothing masks</li>
<li>The decompiler now supports skin weights</li>
<li>The compiler now supports skin weights</li>
<li>The compiler now supports bumpmap texture animations</li>
<li>A crash after -t1 has been corrected.</li>
</ul>
<h3>Updates - 08/31/2002 - Part 2</h3>
<ul>
<li>
<p>Added support for wildcards</p>
</li>
</ul>
<h3>Updates - 09/1/2002</h3>
<ul>
<li>Compiler now supports compiling of supermodels when required</li>
<li>Compiler will now load supermodels and texture information files from the
current directory prior to trying the Bioware data files.</li>
</ul>
<h3>Updates - 2/12/2003</h3>
<ul>
<li>Compiler now supports 1.28 beta 1 patch.</li>
</ul>
<h3>Updates - 7/1/2003</h3>
<ul>
<li>The compiler now supports SoU.</li>
</ul>
<h3>Credits</h3>
<p>Revinor's work at <a href="http://nwn-j3d.sourceforge.net/">
http://nwn-j3d.sourceforge.net/</a> an invaluable starting and reference point
for my own work.</p>
</body>
</html> | {
"content_hash": "029f33a342e342a20adc4e16e0443e47",
"timestamp": "",
"source": "github",
"line_count": 184,
"max_line_length": 106,
"avg_line_length": 51.880434782608695,
"alnum_prop": 0.7573852922690132,
"repo_name": "ArmorDarks/completerc",
"id": "c70d24a8bbe9ad7f47adc50b863f34b1efa92213",
"size": "9546",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "tools/NWN Carottes/nwnmdlcomp help.html",
"mode": "33188",
"license": "mit",
"language": [],
"symlink_target": ""
} |
package org.overlord.dtgov.services.i18n;
import org.overlord.dtgov.i18n.AbstractMessages;
/**
* I18N messages.
*
* @author eric.wittmann@redhat.com
*/
public class Messages extends AbstractMessages {
public static final Messages i18n = new Messages();
/**
* Constructor.
*/
public Messages() {
super(Messages.class);
}
}
| {
"content_hash": "e91756db01e3ad259be71d8d16967e65",
"timestamp": "",
"source": "github",
"line_count": 22,
"max_line_length": 55,
"avg_line_length": 16.636363636363637,
"alnum_prop": 0.6584699453551912,
"repo_name": "Governance/dtgov",
"id": "2dc769eb98fe9868e0d5f79929322673ba6c7497",
"size": "959",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "dtgov-services/src/main/java/org/overlord/dtgov/services/i18n/Messages.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "17449"
},
{
"name": "Java",
"bytes": "1376555"
},
{
"name": "JavaScript",
"bytes": "29088"
},
{
"name": "Shell",
"bytes": "1264"
},
{
"name": "XSLT",
"bytes": "34897"
}
],
"symlink_target": ""
} |
package org.apache.derbyTesting.junit;
import java.sql.*;
import junit.framework.Test;
/**
* Base class for JDBC JUnit test decorators.
*/
public abstract class BaseJDBCTestSetup
extends BaseTestSetup {
public BaseJDBCTestSetup(Test test) {
super(test);
}
/**
* Maintain a single connection to the default
* database, opened at the first call to getConnection.
* Typical setup will just require a single connection.
* @see BaseJDBCTestSetup#getConnection()
*/
private Connection conn;
/**
* Return the current configuration for the test.
*/
public final TestConfiguration getTestConfiguration()
{
return TestConfiguration.getCurrent();
}
/**
* Obtain the connection to the default database.
* This class maintains a single connection returned
* by this class, it is opened on the first call to
* this method. Subsequent calls will return the same
* connection object unless it has been closed. In that
* case a new connection object will be returned.
* <P>
* The tearDown method will close the connection if
* it is open.
* @see TestConfiguration#openDefaultConnection()
*/
public final Connection getConnection() throws SQLException
{
if (conn != null)
{
if (!conn.isClosed())
return conn;
conn = null;
}
return conn = getTestConfiguration().openDefaultConnection();
}
/**
* Print debug string.
* @param text String to print
*/
public void println(final String text) {
if (getTestConfiguration().isVerbose()) {
System.out.println("DEBUG: " + text);
}
}
/**
* Tear down this fixture, sub-classes should call
* super.tearDown(). This cleanups & closes the connection
* if it is open.
*/
protected void tearDown()
throws java.lang.Exception
{
clearConnection();
}
/**
* Close the default connection and null out the reference to it.
* Typically only called from {@code tearDown()}.
*/
void clearConnection() throws SQLException {
JDBC.cleanup(conn);
conn = null;
}
} | {
"content_hash": "d114d23d498fc37af4faa3b724ced086",
"timestamp": "",
"source": "github",
"line_count": 86,
"max_line_length": 69,
"avg_line_length": 25.569767441860463,
"alnum_prop": 0.6371077762619373,
"repo_name": "scnakandala/derby",
"id": "49c68497021f63a9c42a5898c46ed45ef785539b",
"size": "3087",
"binary": false,
"copies": "3",
"ref": "refs/heads/master",
"path": "java/testing/org/apache/derbyTesting/junit/BaseJDBCTestSetup.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "13737"
},
{
"name": "Java",
"bytes": "41272803"
},
{
"name": "Shell",
"bytes": "1951"
}
],
"symlink_target": ""
} |
// Copyright 2008 Google Inc. All rights reserved.
package org.metasyntactic.automata.compiler.framework.parsers.packrat.expressions;
import org.metasyntactic.common.base.Preconditions;
/**
* An atomic parsing expression consisting of a single terminal succeeds if the first character of the input string
* matches that terminal, and in that case consumes the input character; otherwise the expression yields a failure
* result.
*
* @author cyrusn@google.com (Cyrus Najmabadi)
*/
public class TerminalExpression extends Expression {
private final String terminal;
TerminalExpression(String terminal) {
Preconditions.checkNotNull(terminal);
this.terminal = terminal;
}
public String getTerminal() {
return terminal;
}
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (!(o instanceof TerminalExpression)) {
return false;
}
TerminalExpression that = (TerminalExpression) o;
if (!terminal.equals(that.terminal)) {
return false;
}
return true;
}
public int hashCodeWorker() {
return terminal.hashCode();
}
public <TInput, TResult> TResult accept(ExpressionVisitor<TInput, TResult> visitor) {
return visitor.visit(this);
}
public <TInput> void accept(ExpressionVoidVisitor<TInput> visitor) {
visitor.visit(this);
}
public String toString() {
if (terminal.contains("\"")) {
return "'" + terminal + "'";
} else {
return '"' + terminal + '"';
}
}
}
| {
"content_hash": "d0add71ef5f1ea51945929424c57276d",
"timestamp": "",
"source": "github",
"line_count": 64,
"max_line_length": 115,
"avg_line_length": 23.65625,
"alnum_prop": 0.6822985468956407,
"repo_name": "fpadoan/metasyntactic",
"id": "768a0d3eb5d7e88c918d5a29c1085a865003512c",
"size": "1514",
"binary": false,
"copies": "3",
"ref": "refs/heads/master",
"path": "java/org/metasyntactic/automata/compiler/framework/parsers/packrat/expressions/TerminalExpression.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Batchfile",
"bytes": "9011"
},
{
"name": "C",
"bytes": "372203"
},
{
"name": "C#",
"bytes": "115178"
},
{
"name": "C++",
"bytes": "11148566"
},
{
"name": "Emacs Lisp",
"bytes": "15419"
},
{
"name": "Java",
"bytes": "4097994"
},
{
"name": "Makefile",
"bytes": "430903"
},
{
"name": "Objective-C",
"bytes": "7317858"
},
{
"name": "PHP",
"bytes": "5835"
},
{
"name": "Protocol Buffer",
"bytes": "476588"
},
{
"name": "Python",
"bytes": "1575003"
},
{
"name": "Shell",
"bytes": "2019645"
},
{
"name": "VimL",
"bytes": "11322"
}
],
"symlink_target": ""
} |
import abc
class FwaasDriverBase(object, metaclass=abc.ABCMeta):
"""Firewall as a Service Driver base class.
Using FwaasDriver Class, an instance of L3 perimeter Firewall
can be created. The firewall co-exists with the L3 agent.
One instance is created for each tenant. One firewall policy
is associated with each tenant (in the Havana release).
The Firewall can be visualized as having two zones (in Havana
release), trusted and untrusted.
All the 'internal' interfaces of Neutron Router is treated as trusted. The
interface connected to 'external network' is treated as untrusted.
The policy is applied on traffic ingressing/egressing interfaces on
the trusted zone. This implies that policy will be applied for traffic
passing from
- trusted to untrusted zones
- untrusted to trusted zones
- trusted to trusted zones
Policy WILL NOT be applied for traffic from untrusted to untrusted zones.
This is not a problem in Havana release as there is only one interface
connected to external network.
Since the policy is applied on the internal interfaces, the traffic
will be not be NATed to floating IP. For incoming traffic, the
traffic will get NATed to internal IP address before it hits
the firewall rules. So, while writing the rules, care should be
taken if using rules based on floating IP.
The firewall rule addition/deletion/insertion/update are done by the
management console. When the policy is sent to the driver, the complete
policy is sent and the whole policy has to be applied atomically. The
firewall rules will not get updated individually. This is to avoid problems
related to out-of-order notifications or inconsistent behaviour by partial
application of rules. Argument agent_mode indicates the l3 agent in DVR or
DVR_SNAT or LEGACY mode.
"""
# TODO(Margaret): Remove the first 3 methods and make the second three
# @abc.abstractmethod
def create_firewall(self, agent_mode, apply_list, firewall):
"""Create the Firewall with default (drop all) policy.
The default policy will be applied on all the interfaces of
trusted zone.
"""
pass
def delete_firewall(self, agent_mode, apply_list, firewall):
"""Delete firewall.
Removes all policies created by this instance and frees up
all the resources.
"""
pass
def update_firewall(self, agent_mode, apply_list, firewall):
"""Apply the policy on all trusted interfaces.
Remove previous policy and apply the new policy on all trusted
interfaces.
"""
pass
def create_firewall_group(self, agent_mode, apply_list, firewall):
"""Create the Firewall with default (drop all) policy.
The default policy will be applied on all the interfaces of
trusted zone.
"""
pass
def delete_firewall_group(self, agent_mode, apply_list, firewall):
"""Delete firewall.
Removes all policies created by this instance and frees up
all the resources.
"""
pass
def update_firewall_group(self, agent_mode, apply_list, firewall):
"""Apply the policy on all trusted interfaces.
Remove previous policy and apply the new policy on all trusted
interfaces.
"""
pass
@abc.abstractmethod
def apply_default_policy(self, agent_mode, apply_list, firewall):
"""Apply the default policy on all trusted interfaces.
Remove current policy and apply the default policy on all trusted
interfaces.
"""
pass
| {
"content_hash": "54f77130fcfe376623dbcb9d29462983",
"timestamp": "",
"source": "github",
"line_count": 102,
"max_line_length": 79,
"avg_line_length": 36.13725490196079,
"alnum_prop": 0.6923494302767227,
"repo_name": "openstack/neutron-fwaas",
"id": "afdb7d15dff2d2bf710334fa664166b3d648b1ff",
"size": "4311",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "neutron_fwaas/services/firewall/service_drivers/agents/drivers/fwaas_base.py",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Mako",
"bytes": "1053"
},
{
"name": "Python",
"bytes": "921570"
},
{
"name": "Shell",
"bytes": "21966"
}
],
"symlink_target": ""
} |
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
namespace MasterPages
{
public partial class Personal_Info : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
}
} | {
"content_hash": "4f16bb1938ee70d089cb5138e890cfca",
"timestamp": "",
"source": "github",
"line_count": 17,
"max_line_length": 60,
"avg_line_length": 18.823529411764707,
"alnum_prop": 0.6875,
"repo_name": "niki-funky/Telerik_Academy",
"id": "0c74c9cbec4212643dd9d5c9b74a47189a8a6d6e",
"size": "322",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "Web Development/ASP.NET Web Forms/04. Master Pages/04. MasterPages/MasterPages/Personal_Info.aspx.cs",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "ASP",
"bytes": "2773"
},
{
"name": "C#",
"bytes": "4074086"
},
{
"name": "CSS",
"bytes": "850276"
},
{
"name": "JavaScript",
"bytes": "5915582"
},
{
"name": "PowerShell",
"bytes": "785001"
},
{
"name": "Puppet",
"bytes": "329334"
}
],
"symlink_target": ""
} |
package com.android.systemui.tuner;
import android.content.ContentResolver;
import android.content.Context;
import android.content.Intent;
import android.database.ContentObserver;
import android.os.Bundle;
import android.os.Handler;
import android.os.Looper;
import android.preference.Preference;
import android.preference.Preference.OnPreferenceChangeListener;
import android.preference.PreferenceFragment;
import android.preference.PreferenceScreen;
import android.preference.SwitchPreference;
import android.provider.Settings;
import android.view.MenuItem;
import com.android.internal.logging.MetricsLogger;
import com.android.systemui.DemoMode;
import com.android.systemui.R;
public class DemoModeFragment extends PreferenceFragment implements OnPreferenceChangeListener {
private static final String DEMO_MODE_ON = "sysui_tuner_demo_on";
private static final String[] STATUS_ICONS = {
"volume",
"bluetooth",
"location",
"alarm",
"zen",
"sync",
"tty",
"eri",
"mute",
"speakerphone",
"managed_profile",
};
private SwitchPreference mEnabledSwitch;
private SwitchPreference mOnSwitch;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
Context context = getContext();
mEnabledSwitch = new SwitchPreference(context);
mEnabledSwitch.setTitle(R.string.enable_demo_mode);
mEnabledSwitch.setOnPreferenceChangeListener(this);
mOnSwitch = new SwitchPreference(context);
mOnSwitch.setTitle(R.string.show_demo_mode);
mOnSwitch.setEnabled(false);
mOnSwitch.setOnPreferenceChangeListener(this);
PreferenceScreen screen = getPreferenceManager().createPreferenceScreen(context);
screen.addPreference(mEnabledSwitch);
screen.addPreference(mOnSwitch);
setPreferenceScreen(screen);
updateDemoModeEnabled();
updateDemoModeOn();
ContentResolver contentResolver = getContext().getContentResolver();
contentResolver.registerContentObserver(Settings.Global.getUriFor(
DemoMode.DEMO_MODE_ALLOWED), false, mDemoModeObserver);
contentResolver.registerContentObserver(Settings.Global.getUriFor(DEMO_MODE_ON), false,
mDemoModeObserver);
setHasOptionsMenu(true);
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
switch (item.getItemId()) {
case android.R.id.home:
getFragmentManager().popBackStack();
break;
}
return super.onOptionsItemSelected(item);
}
@Override
public void onResume() {
super.onResume();
MetricsLogger.visibility(getContext(), MetricsLogger.TUNER_DEMO_MODE, true);
}
@Override
public void onPause() {
super.onPause();
MetricsLogger.visibility(getContext(), MetricsLogger.TUNER_DEMO_MODE, false);
}
@Override
public void onDestroy() {
getContext().getContentResolver().unregisterContentObserver(mDemoModeObserver);
super.onDestroy();
}
private void updateDemoModeEnabled() {
boolean enabled = Settings.Global.getInt(getContext().getContentResolver(),
DemoMode.DEMO_MODE_ALLOWED, 0) != 0;
mEnabledSwitch.setChecked(enabled);
mOnSwitch.setEnabled(enabled);
}
private void updateDemoModeOn() {
boolean enabled = Settings.Global.getInt(getContext().getContentResolver(),
DEMO_MODE_ON, 0) != 0;
mOnSwitch.setChecked(enabled);
}
@Override
public boolean onPreferenceChange(Preference preference, Object newValue) {
boolean enabled = newValue == Boolean.TRUE;
if (preference == mEnabledSwitch) {
if (!enabled) {
// Make sure we aren't in demo mode when disabling it.
mOnSwitch.setChecked(false);
stopDemoMode();
}
MetricsLogger.action(getContext(), MetricsLogger.TUNER_DEMO_MODE_ENABLED, enabled);
setGlobal(DemoMode.DEMO_MODE_ALLOWED, enabled ? 1 : 0);
} else if (preference == mOnSwitch) {
MetricsLogger.action(getContext(), MetricsLogger.TUNER_DEMO_MODE_ON, enabled);
if (enabled) {
startDemoMode();
} else {
stopDemoMode();
}
} else {
return false;
}
return true;
}
private void startDemoMode() {
Intent intent = new Intent(DemoMode.ACTION_DEMO);
intent.putExtra(DemoMode.EXTRA_COMMAND, DemoMode.COMMAND_ENTER);
getContext().sendBroadcast(intent);
intent.putExtra(DemoMode.EXTRA_COMMAND, DemoMode.COMMAND_CLOCK);
intent.putExtra("hhmm", "0600");
getContext().sendBroadcast(intent);
intent.putExtra(DemoMode.EXTRA_COMMAND, DemoMode.COMMAND_NETWORK);
intent.putExtra("wifi", "show");
intent.putExtra("mobile", "show");
intent.putExtra("sims", "1");
intent.putExtra("nosim", "false");
intent.putExtra("level", "4");
intent.putExtra("datatypel", "");
getContext().sendBroadcast(intent);
// Need to send this after so that the sim controller already exists.
intent.putExtra("fully", "true");
getContext().sendBroadcast(intent);
intent.putExtra(DemoMode.EXTRA_COMMAND, DemoMode.COMMAND_BATTERY);
intent.putExtra("level", "100");
intent.putExtra("plugged", "false");
getContext().sendBroadcast(intent);
intent.putExtra(DemoMode.EXTRA_COMMAND, DemoMode.COMMAND_STATUS);
for (String icon : STATUS_ICONS) {
intent.putExtra(icon, "hide");
}
getContext().sendBroadcast(intent);
intent.putExtra(DemoMode.EXTRA_COMMAND, DemoMode.COMMAND_NOTIFICATIONS);
intent.putExtra("visible", "false");
getContext().sendBroadcast(intent);
setGlobal(DEMO_MODE_ON, 1);
}
private void stopDemoMode() {
Intent intent = new Intent(DemoMode.ACTION_DEMO);
intent.putExtra(DemoMode.EXTRA_COMMAND, DemoMode.COMMAND_EXIT);
getContext().sendBroadcast(intent);
setGlobal(DEMO_MODE_ON, 0);
}
private void setGlobal(String key, int value) {
Settings.Global.putInt(getContext().getContentResolver(), key, value);
}
private final ContentObserver mDemoModeObserver =
new ContentObserver(new Handler(Looper.getMainLooper())) {
public void onChange(boolean selfChange) {
updateDemoModeEnabled();
updateDemoModeOn();
};
};
}
| {
"content_hash": "35746f65750fe129d169cd50a78d82e3",
"timestamp": "",
"source": "github",
"line_count": 196,
"max_line_length": 96,
"avg_line_length": 34.34183673469388,
"alnum_prop": 0.6526519090774031,
"repo_name": "Ant-Droid/android_frameworks_base_OLD",
"id": "a2b062c8b71046da948d0f8fcda1dc48dc9b0aa7",
"size": "7350",
"binary": false,
"copies": "4",
"ref": "refs/heads/mm600",
"path": "packages/SystemUI/src/com/android/systemui/tuner/DemoModeFragment.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "C",
"bytes": "167132"
},
{
"name": "C++",
"bytes": "7099875"
},
{
"name": "GLSL",
"bytes": "20654"
},
{
"name": "HTML",
"bytes": "224185"
},
{
"name": "Java",
"bytes": "79415679"
},
{
"name": "Makefile",
"bytes": "419370"
},
{
"name": "Python",
"bytes": "42309"
},
{
"name": "RenderScript",
"bytes": "153826"
},
{
"name": "Shell",
"bytes": "21079"
}
],
"symlink_target": ""
} |
package pl.info.rkluszczynski.image.engine.model.enums;
public enum ImageOrientation {
HORIZONTAL,
VERTICAL,
SQUARE
}
| {
"content_hash": "309d9f5800f770cec825ce6bfcef05de",
"timestamp": "",
"source": "github",
"line_count": 7,
"max_line_length": 55,
"avg_line_length": 18.714285714285715,
"alnum_prop": 0.7404580152671756,
"repo_name": "rkluszczynski/image-detection-project",
"id": "3339968e40c6dbb26f09b31ea5182c7c6727d66a",
"size": "131",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "detection-engine/src/main/java/pl/info/rkluszczynski/image/engine/model/enums/ImageOrientation.java",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "C++",
"bytes": "122708"
},
{
"name": "Groovy",
"bytes": "16299"
},
{
"name": "HTML",
"bytes": "5769"
},
{
"name": "Java",
"bytes": "385519"
}
],
"symlink_target": ""
} |
ActiveRecord::Schema.define(version: 20150419175238) do
# These are extensions that must be enabled in order to support this database
enable_extension "plpgsql"
create_table "employees", force: :cascade do |t|
t.string "fname"
t.string "sname"
t.date "dob"
t.date "join_date"
t.integer "salary"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.string "sex"
t.date "end_date"
t.integer "user_id"
end
add_index "employees", ["user_id"], name: "index_employees_on_user_id", using: :btree
create_table "holidays", force: :cascade do |t|
t.date "leave_date"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.boolean "approved", default: false
t.integer "employee_id"
end
add_index "holidays", ["employee_id"], name: "index_holidays_on_employee_id", using: :btree
create_table "news", force: :cascade do |t|
t.string "title"
t.text "body"
t.boolean "published"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.integer "employee_id"
end
add_index "news", ["employee_id"], name: "index_news_on_employee_id", using: :btree
create_table "users", force: :cascade do |t|
t.string "email", default: "", null: false
t.string "encrypted_password", default: "", null: false
t.string "reset_password_token"
t.datetime "reset_password_sent_at"
t.datetime "remember_created_at"
t.integer "sign_in_count", default: 0, null: false
t.datetime "current_sign_in_at"
t.datetime "last_sign_in_at"
t.inet "current_sign_in_ip"
t.inet "last_sign_in_ip"
t.datetime "created_at"
t.datetime "updated_at"
t.integer "employee_id"
t.boolean "admin", default: false
end
add_index "users", ["email"], name: "index_users_on_email", unique: true, using: :btree
add_index "users", ["employee_id"], name: "index_users_on_employee_id", using: :btree
add_index "users", ["reset_password_token"], name: "index_users_on_reset_password_token", unique: true, using: :btree
add_foreign_key "employees", "users"
add_foreign_key "holidays", "employees"
add_foreign_key "news", "employees"
add_foreign_key "users", "employees"
end
| {
"content_hash": "b52497ce566a6826de4d4c0419860f18",
"timestamp": "",
"source": "github",
"line_count": 67,
"max_line_length": 119,
"avg_line_length": 35.776119402985074,
"alnum_prop": 0.6207759699624531,
"repo_name": "daxroc/hmres",
"id": "aece5ee4598614c629acbad7f1e7071a8e72268a",
"size": "3138",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "db/schema.rb",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "438"
},
{
"name": "CoffeeScript",
"bytes": "422"
},
{
"name": "HTML",
"bytes": "26394"
},
{
"name": "JavaScript",
"bytes": "1096"
},
{
"name": "Ruby",
"bytes": "58022"
}
],
"symlink_target": ""
} |
package SevenZip.Compression.LZMA;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
public class DecodeParameter implements IParameter {
/**
*
*/
private static final long serialVersionUID = -5162504241090568230L;
java.io.InputStream inStream;
java.io.OutputStream outStream;
long outSize;
/**
*
* @param inStream
* @param outStream
* @throws IOException
*/
public DecodeParameter(InputStream inStream, OutputStream outStream) throws IOException {
this(inStream, outStream, -1);
}
/**
*
* @param inStream
* @param outStream
* @param outSize
* @throws IOException
*/
public DecodeParameter(InputStream inStream, OutputStream outStream, long outSize) throws IOException {
super();
if (outSize == -1) {
for (int i = 0 ; i < 8 ; i++) {
int v = inStream.read();
if (v < 0) throw new RuntimeException("Can't read stream size");
outSize |= ((long) v) << (8 * i);
}
}
this.inStream = inStream;
this.outStream = outStream;
this.outSize = outSize;
}
}
| {
"content_hash": "bbb35f1df084a472a80f6092b26a8df1",
"timestamp": "",
"source": "github",
"line_count": 51,
"max_line_length": 104,
"avg_line_length": 20.784313725490197,
"alnum_prop": 0.6773584905660377,
"repo_name": "softctrl/sc-utils-java",
"id": "e0c7d0d770d6acab2c830ebedc34ce7698926a54",
"size": "1060",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "sc-utils-java/src/main/java/SevenZip/Compression/LZMA/DecodeParameter.java",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Java",
"bytes": "242626"
}
],
"symlink_target": ""
} |
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!-- NewPage -->
<html lang="en">
<head>
<!-- Generated by javadoc (version 1.7.0_71) on Thu Sep 10 12:30:20 NZST 2015 -->
<title>weka.core</title>
<meta name="date" content="2015-09-10">
<link rel="stylesheet" type="text/css" href="../../stylesheet.css" title="Style">
</head>
<body>
<script type="text/javascript"><!--
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="weka.core";
}
//-->
</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
<!-- ========= START OF TOP NAVBAR ======= -->
<div class="topNav"><a name="navbar_top">
<!-- -->
</a><a href="#skip-navbar_top" title="Skip navigation links"></a><a name="navbar_top_firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../overview-summary.html">Overview</a></li>
<li class="navBarCell1Rev">Package</li>
<li>Class</li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../index-all.html">Index</a></li>
<li><a href="../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li><a href="../../weka/clusterers/package-summary.html">Prev Package</a></li>
<li><a href="../../weka/core/converters/package-summary.html">Next Package</a></li>
</ul>
<ul class="navList">
<li><a href="../../index.html?weka/core/package-summary.html" target="_top">Frames</a></li>
<li><a href="package-summary.html" target="_top">No Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_top">
<li><a href="../../allclasses-noframe.html">All Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_top");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<a name="skip-navbar_top">
<!-- -->
</a></div>
<!-- ========= END OF TOP NAVBAR ========= -->
<div class="header">
<h1 title="Package" class="title">Package weka.core</h1>
</div>
<div class="contentContainer">
<ul class="blockList">
<li class="blockList">
<table class="packageSummary" border="0" cellpadding="3" cellspacing="0" summary="Interface Summary table, listing interfaces, and an explanation">
<caption><span>Interface Summary</span><span class="tabEnd"> </span></caption>
<tr>
<th class="colFirst" scope="col">Interface</th>
<th class="colLast" scope="col">Description</th>
</tr>
<tbody>
<tr class="altColor">
<td class="colFirst"><a href="../../weka/core/AdditionalMeasureProducer.html" title="interface in weka.core">AdditionalMeasureProducer</a></td>
<td class="colLast">
<div class="block">Interface to something that can produce measures other than those
calculated by evaluation modules.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><a href="../../weka/core/Aggregateable.html" title="interface in weka.core">Aggregateable</a><E></td>
<td class="colLast">
<div class="block">Interface to something that can aggregate an object of the same type with
itself.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><a href="../../weka/core/BatchPredictor.html" title="interface in weka.core">BatchPredictor</a></td>
<td class="colLast">
<div class="block">Interface to something that can produce predictions in a batch manner
when presented with a set of Instances.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><a href="../../weka/core/CapabilitiesHandler.html" title="interface in weka.core">CapabilitiesHandler</a></td>
<td class="colLast">
<div class="block">Classes implementing this interface return their capabilities in regards
to datasets.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><a href="../../weka/core/CapabilitiesIgnorer.html" title="interface in weka.core">CapabilitiesIgnorer</a></td>
<td class="colLast">
<div class="block">Classes implementing this interface make it possible to turn off
capabilities checking.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><a href="../../weka/core/CommandlineRunnable.html" title="interface in weka.core">CommandlineRunnable</a></td>
<td class="colLast">
<div class="block">Interface to something that can be run from the command line.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><a href="../../weka/core/Copyable.html" title="interface in weka.core">Copyable</a></td>
<td class="colLast">
<div class="block">Interface implemented by classes that can produce "shallow" copies
of their objects.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><a href="../../weka/core/CustomDisplayStringProvider.html" title="interface in weka.core">CustomDisplayStringProvider</a></td>
<td class="colLast">
<div class="block">For classes that do not implement the OptionHandler interface and want to
provide a custom display string in the GenericObjectEditor, which is more
descriptive than the class name.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><a href="../../weka/core/DistanceFunction.html" title="interface in weka.core">DistanceFunction</a></td>
<td class="colLast">
<div class="block">Interface for any class that can compute and return distances between two
instances.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><a href="../../weka/core/Drawable.html" title="interface in weka.core">Drawable</a></td>
<td class="colLast">
<div class="block">Interface to something that can be drawn as a graph.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><a href="../../weka/core/EnvironmentHandler.html" title="interface in weka.core">EnvironmentHandler</a></td>
<td class="colLast">
<div class="block">Interface for something that can utilize environment
variables.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><a href="../../weka/core/Instance.html" title="interface in weka.core">Instance</a></td>
<td class="colLast">
<div class="block">Interface representing an instance.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><a href="../../weka/core/LogHandler.html" title="interface in weka.core">LogHandler</a></td>
<td class="colLast">
<div class="block">Interface to something that can output messages to a log</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><a href="../../weka/core/Matchable.html" title="interface in weka.core">Matchable</a></td>
<td class="colLast">
<div class="block">Interface to something that can be matched with tree matching
algorithms.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><a href="../../weka/core/MultiInstanceCapabilitiesHandler.html" title="interface in weka.core">MultiInstanceCapabilitiesHandler</a></td>
<td class="colLast">
<div class="block">Multi-Instance classifiers can specify an additional Capabilities object
for the data in the relational attribute, since the format of multi-instance
data is fixed to "bag/NOMINAL,data/RELATIONAL,class".</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><a href="../../weka/core/OptionHandler.html" title="interface in weka.core">OptionHandler</a></td>
<td class="colLast">
<div class="block">Interface to something that understands options.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><a href="../../weka/core/PartitionGenerator.html" title="interface in weka.core">PartitionGenerator</a></td>
<td class="colLast">
<div class="block">This interface can be implemented by algorithms that generate
a partition of the instance space (e.g., decision trees).</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><a href="../../weka/core/Randomizable.html" title="interface in weka.core">Randomizable</a></td>
<td class="colLast">
<div class="block">Interface to something that has random behaviour that is able to be
seeded with an integer.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><a href="../../weka/core/RevisionHandler.html" title="interface in weka.core">RevisionHandler</a></td>
<td class="colLast">
<div class="block">For classes that should return their source control revision.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><a href="../../weka/core/Summarizable.html" title="interface in weka.core">Summarizable</a></td>
<td class="colLast">
<div class="block">Interface to something that provides a short textual summary (as opposed
to toString() which is usually a fairly complete description) of itself.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><a href="../../weka/core/TechnicalInformationHandler.html" title="interface in weka.core">TechnicalInformationHandler</a></td>
<td class="colLast">
<div class="block">For classes that are based on some kind of publications.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><a href="../../weka/core/ThreadSafe.html" title="interface in weka.core">ThreadSafe</a></td>
<td class="colLast">
<div class="block">Interface to something that is thread safe</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><a href="../../weka/core/Undoable.html" title="interface in weka.core">Undoable</a></td>
<td class="colLast">
<div class="block">Interface implemented by classes that support undo.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><a href="../../weka/core/WeightedInstancesHandler.html" title="interface in weka.core">WeightedInstancesHandler</a></td>
<td class="colLast">
<div class="block">Interface to something that makes use of the information provided
by instance weights.</div>
</td>
</tr>
</tbody>
</table>
</li>
<li class="blockList">
<table class="packageSummary" border="0" cellpadding="3" cellspacing="0" summary="Class Summary table, listing classes, and an explanation">
<caption><span>Class Summary</span><span class="tabEnd"> </span></caption>
<tr>
<th class="colFirst" scope="col">Class</th>
<th class="colLast" scope="col">Description</th>
</tr>
<tbody>
<tr class="altColor">
<td class="colFirst"><a href="../../weka/core/AbstractInstance.html" title="class in weka.core">AbstractInstance</a></td>
<td class="colLast">
<div class="block">Abstract class providing common functionality for the original instance
implementations.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><a href="../../weka/core/AlgVector.html" title="class in weka.core">AlgVector</a></td>
<td class="colLast">
<div class="block">Class for performing operations on an algebraic vector
of floating-point values.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><a href="../../weka/core/AllJavadoc.html" title="class in weka.core">AllJavadoc</a></td>
<td class="colLast">
<div class="block">Applies all known Javadoc-derived classes to a source file.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><a href="../../weka/core/Attribute.html" title="class in weka.core">Attribute</a></td>
<td class="colLast">
<div class="block">Class for handling an attribute.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><a href="../../weka/core/AttributeLocator.html" title="class in weka.core">AttributeLocator</a></td>
<td class="colLast">
<div class="block">This class locates and records the indices of a certain type of attributes,
recursively in case of Relational attributes.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><a href="../../weka/core/AttributeMetaInfo.html" title="class in weka.core">AttributeMetaInfo</a></td>
<td class="colLast"> </td>
</tr>
<tr class="altColor">
<td class="colFirst"><a href="../../weka/core/AttributeStats.html" title="class in weka.core">AttributeStats</a></td>
<td class="colLast">
<div class="block">A Utility class that contains summary information on an
the values that appear in a dataset for a particular attribute.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><a href="../../weka/core/BinarySparseInstance.html" title="class in weka.core">BinarySparseInstance</a></td>
<td class="colLast">
<div class="block">Class for storing a binary-data-only instance as a sparse vector.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><a href="../../weka/core/Capabilities.html" title="class in weka.core">Capabilities</a></td>
<td class="colLast">
<div class="block">A class that describes the capabilites (e.g., handling certain types of
attributes, missing values, types of classes, etc.) of a specific classifier.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><a href="../../weka/core/ChebyshevDistance.html" title="class in weka.core">ChebyshevDistance</a></td>
<td class="colLast">
<div class="block">Implements the Chebyshev distance.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><a href="../../weka/core/Check.html" title="class in weka.core">Check</a></td>
<td class="colLast">
<div class="block">Abstract general class for testing in Weka.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><a href="../../weka/core/CheckGOE.html" title="class in weka.core">CheckGOE</a></td>
<td class="colLast">
<div class="block">Simple command line checking of classes that are editable in the GOE.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><a href="../../weka/core/CheckOptionHandler.html" title="class in weka.core">CheckOptionHandler</a></td>
<td class="colLast">
<div class="block">Simple command line checking of classes that implement OptionHandler.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><a href="../../weka/core/CheckScheme.html" title="class in weka.core">CheckScheme</a></td>
<td class="colLast">
<div class="block">Abstract general class for testing schemes in Weka.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><a href="../../weka/core/CheckScheme.PostProcessor.html" title="class in weka.core">CheckScheme.PostProcessor</a></td>
<td class="colLast">
<div class="block">a class for postprocessing the test-data</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><a href="../../weka/core/ClassCache.html" title="class in weka.core">ClassCache</a></td>
<td class="colLast">
<div class="block">A singleton that stores all classes on the classpath.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><a href="../../weka/core/ClassCache.ClassFileFilter.html" title="class in weka.core">ClassCache.ClassFileFilter</a></td>
<td class="colLast">
<div class="block">For filtering classes.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><a href="../../weka/core/ClassCache.DirectoryFilter.html" title="class in weka.core">ClassCache.DirectoryFilter</a></td>
<td class="colLast">
<div class="block">For filtering classes.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><a href="../../weka/core/ClassDiscovery.html" title="class in weka.core">ClassDiscovery</a></td>
<td class="colLast">
<div class="block">This class is used for discovering classes that implement a certain interface
or a derived from a certain class.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><a href="../../weka/core/ClassDiscovery.StringCompare.html" title="class in weka.core">ClassDiscovery.StringCompare</a></td>
<td class="colLast">
<div class="block">compares two strings.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><a href="../../weka/core/ClassloaderUtil.html" title="class in weka.core">ClassloaderUtil</a></td>
<td class="colLast">
<div class="block">Utility class that can add jar files to the classpath dynamically.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><a href="../../weka/core/ConjugateGradientOptimization.html" title="class in weka.core">ConjugateGradientOptimization</a></td>
<td class="colLast">
<div class="block">This subclass of Optimization.java implements conjugate gradient descent
rather than BFGS updates, by overriding findArgmin(), with the same tests for
convergence, and applies the same line search code.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><a href="../../weka/core/ContingencyTables.html" title="class in weka.core">ContingencyTables</a></td>
<td class="colLast">
<div class="block">Class implementing some statistical routines for contingency tables.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><a href="../../weka/core/Copyright.html" title="class in weka.core">Copyright</a></td>
<td class="colLast">
<div class="block">A class for providing centralized Copyright information.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><a href="../../weka/core/DateAttributeInfo.html" title="class in weka.core">DateAttributeInfo</a></td>
<td class="colLast">
<div class="block">Stores information for date attributes.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><a href="../../weka/core/Debug.html" title="class in weka.core">Debug</a></td>
<td class="colLast">
<div class="block">A helper class for debug output, logging, clocking, etc.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><a href="../../weka/core/Debug.Clock.html" title="class in weka.core">Debug.Clock</a></td>
<td class="colLast">
<div class="block">A little helper class for clocking and outputting times.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><a href="../../weka/core/Debug.DBO.html" title="class in weka.core">Debug.DBO</a></td>
<td class="colLast">
<div class="block">contains debug methods</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><a href="../../weka/core/Debug.Log.html" title="class in weka.core">Debug.Log</a></td>
<td class="colLast">
<div class="block">A helper class for logging stuff.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><a href="../../weka/core/Debug.Random.html" title="class in weka.core">Debug.Random</a></td>
<td class="colLast">
<div class="block">This extended Random class enables one to print the generated random
numbers etc., before they are returned.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><a href="../../weka/core/Debug.SimpleLog.html" title="class in weka.core">Debug.SimpleLog</a></td>
<td class="colLast">
<div class="block">A little, simple helper class for logging stuff.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><a href="../../weka/core/Debug.Timestamp.html" title="class in weka.core">Debug.Timestamp</a></td>
<td class="colLast">
<div class="block">A class that can be used for timestamps in files, The toString() method
simply returns the associated Date object in a timestamp format.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><a href="../../weka/core/DenseInstance.html" title="class in weka.core">DenseInstance</a></td>
<td class="colLast">
<div class="block">Class for handling an instance.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><a href="../../weka/core/Environment.html" title="class in weka.core">Environment</a></td>
<td class="colLast">
<div class="block">This class encapsulates a map of all environment and java system properties.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><a href="../../weka/core/EnvironmentProperties.html" title="class in weka.core">EnvironmentProperties</a></td>
<td class="colLast">
<div class="block">Extends Properties to allow the value of a system property (if set)
to override that which has been loaded/set.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><a href="../../weka/core/EuclideanDistance.html" title="class in weka.core">EuclideanDistance</a></td>
<td class="colLast">
<div class="block">Implementing Euclidean distance (or similarity) function.<br/>
<br/>
One object defines not one distance but the data model in which the distances between objects of that data model can be computed.<br/>
<br/>
Attention: For efficiency reasons the use of consistency checks (like are the data models of the two instances exactly the same), is low.<br/>
<br/>
For more information, see:<br/>
<br/>
Wikipedia.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><a href="../../weka/core/FastVector.html" title="class in weka.core">FastVector</a><E></td>
<td class="colLast">Deprecated</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><a href="../../weka/core/FilteredDistance.html" title="class in weka.core">FilteredDistance</a></td>
<td class="colLast">
<div class="block">Applies the given filter before calling the given distance function.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><a href="../../weka/core/FindWithCapabilities.html" title="class in weka.core">FindWithCapabilities</a></td>
<td class="colLast">
<div class="block">Locates all classes with certain capabilities.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><a href="../../weka/core/GlobalInfoJavadoc.html" title="class in weka.core">GlobalInfoJavadoc</a></td>
<td class="colLast">
<div class="block">Generates Javadoc comments from the class's globalInfo method.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><a href="../../weka/core/InstanceComparator.html" title="class in weka.core">InstanceComparator</a></td>
<td class="colLast">
<div class="block">A comparator for the Instance class.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><a href="../../weka/core/Instances.html" title="class in weka.core">Instances</a></td>
<td class="colLast">
<div class="block">Class for handling an ordered set of weighted instances.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><a href="../../weka/core/Javadoc.html" title="class in weka.core">Javadoc</a></td>
<td class="colLast">
<div class="block">Abstract superclass for classes that generate Javadoc comments and replace
the content between certain comment tags.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><a href="../../weka/core/ListOptions.html" title="class in weka.core">ListOptions</a></td>
<td class="colLast">
<div class="block">Lists the options of an OptionHandler</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><a href="../../weka/core/ManhattanDistance.html" title="class in weka.core">ManhattanDistance</a></td>
<td class="colLast">
<div class="block">Implements the Manhattan distance (or Taxicab geometry).</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><a href="../../weka/core/Matrix.html" title="class in weka.core">Matrix</a></td>
<td class="colLast">Deprecated
<div class="block"><i>Use <code>weka.core.matrix.Matrix</code> instead - only for
backwards compatibility.</i></div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><a href="../../weka/core/Memory.html" title="class in weka.core">Memory</a></td>
<td class="colLast">
<div class="block">A little helper class for Memory management.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><a href="../../weka/core/MinkowskiDistance.html" title="class in weka.core">MinkowskiDistance</a></td>
<td class="colLast">
<div class="block">Implementing Minkowski distance (or similarity)
function.<br/>
<br/>
One object defines not one distance but the data model in which the distances
between objects of that data model can be computed.<br/>
<br/>
Attention: For efficiency reasons the use of consistency checks (like are the
data models of the two instances exactly the same), is low.<br/>
<br/>
For more information, see:<br/>
<br/>
Wikipedia.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><a href="../../weka/core/NominalAttributeInfo.html" title="class in weka.core">NominalAttributeInfo</a></td>
<td class="colLast">
<div class="block">Stores information for nominal and string attributes.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><a href="../../weka/core/NormalizableDistance.html" title="class in weka.core">NormalizableDistance</a></td>
<td class="colLast">
<div class="block">Represents the abstract ancestor for normalizable distance functions, like
Euclidean or Manhattan distance.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><a href="../../weka/core/Optimization.html" title="class in weka.core">Optimization</a></td>
<td class="colLast">
<div class="block">Implementation of Active-sets method with BFGS update to solve optimization
problem with only bounds constraints in multi-dimensions.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><a href="../../weka/core/Option.html" title="class in weka.core">Option</a></td>
<td class="colLast">
<div class="block">Class to store information about an option.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><a href="../../weka/core/OptionHandlerJavadoc.html" title="class in weka.core">OptionHandlerJavadoc</a></td>
<td class="colLast">
<div class="block">Generates Javadoc comments from the OptionHandler's options.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><a href="../../weka/core/PropertyPath.html" title="class in weka.core">PropertyPath</a></td>
<td class="colLast">
<div class="block">A helper class for accessing properties in nested objects, e.g., accessing
the "getRidge" method of a LinearRegression classifier part of
MultipleClassifierCombiner, e.g., Vote.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><a href="../../weka/core/PropertyPath.Path.html" title="class in weka.core">PropertyPath.Path</a></td>
<td class="colLast">
<div class="block">Contains a (property) path structure</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><a href="../../weka/core/PropertyPath.PathElement.html" title="class in weka.core">PropertyPath.PathElement</a></td>
<td class="colLast">
<div class="block">Represents a single element of a property path</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><a href="../../weka/core/ProtectedProperties.html" title="class in weka.core">ProtectedProperties</a></td>
<td class="colLast">
<div class="block">Simple class that extends the Properties class so that the properties are
unable to be modified.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><a href="../../weka/core/Queue.html" title="class in weka.core">Queue</a></td>
<td class="colLast">
<div class="block">Class representing a FIFO queue.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><a href="../../weka/core/RandomVariates.html" title="class in weka.core">RandomVariates</a></td>
<td class="colLast">
<div class="block">Class implementing some simple random variates generator.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><a href="../../weka/core/Range.html" title="class in weka.core">Range</a></td>
<td class="colLast">
<div class="block">Class representing a range of cardinal numbers.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><a href="../../weka/core/RelationalAttributeInfo.html" title="class in weka.core">RelationalAttributeInfo</a></td>
<td class="colLast">
<div class="block">Stores information for relational attributes.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><a href="../../weka/core/RelationalLocator.html" title="class in weka.core">RelationalLocator</a></td>
<td class="colLast">
<div class="block">This class locates and records the indices of relational attributes,</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><a href="../../weka/core/RepositoryIndexGenerator.html" title="class in weka.core">RepositoryIndexGenerator</a></td>
<td class="colLast">
<div class="block">Class for generating html index files and supporting text files for a Weka
package meta data repository.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><a href="../../weka/core/RevisionUtils.html" title="class in weka.core">RevisionUtils</a></td>
<td class="colLast">
<div class="block">Contains utility functions for handling revisions.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><a href="../../weka/core/SelectedTag.html" title="class in weka.core">SelectedTag</a></td>
<td class="colLast">
<div class="block">Represents a selected value from a finite set of values, where each
value is a Tag (i.e.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><a href="../../weka/core/SerializationHelper.html" title="class in weka.core">SerializationHelper</a></td>
<td class="colLast">
<div class="block">A helper class for determining serialVersionUIDs and checking whether classes
contain one and/or need one.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><a href="../../weka/core/SerializedObject.html" title="class in weka.core">SerializedObject</a></td>
<td class="colLast">
<div class="block">Class for storing an object in serialized form in memory.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><a href="../../weka/core/SingleIndex.html" title="class in weka.core">SingleIndex</a></td>
<td class="colLast">
<div class="block">Class representing a single cardinal number.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><a href="../../weka/core/SparseInstance.html" title="class in weka.core">SparseInstance</a></td>
<td class="colLast">
<div class="block">Class for storing an instance as a sparse vector.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><a href="../../weka/core/SpecialFunctions.html" title="class in weka.core">SpecialFunctions</a></td>
<td class="colLast">
<div class="block">Class implementing some mathematical functions.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><a href="../../weka/core/Statistics.html" title="class in weka.core">Statistics</a></td>
<td class="colLast">
<div class="block">Class implementing some distributions, tests, etc.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><a href="../../weka/core/Stopwords.html" title="class in weka.core">Stopwords</a></td>
<td class="colLast">
<div class="block">Class that can test whether a given string is a stop word.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><a href="../../weka/core/StringLocator.html" title="class in weka.core">StringLocator</a></td>
<td class="colLast">
<div class="block">This class locates and records the indices of String attributes, recursively
in case of Relational attributes.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><a href="../../weka/core/SystemInfo.html" title="class in weka.core">SystemInfo</a></td>
<td class="colLast">
<div class="block">This class prints some information about the system setup, like Java version,
JVM settings etc.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><a href="../../weka/core/Tag.html" title="class in weka.core">Tag</a></td>
<td class="colLast">
<div class="block">A <code>Tag</code> simply associates a numeric ID with a String description.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><a href="../../weka/core/TechnicalInformation.html" title="class in weka.core">TechnicalInformation</a></td>
<td class="colLast">
<div class="block">Used for paper references in the Javadoc and for BibTex generation.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><a href="../../weka/core/TechnicalInformationHandlerJavadoc.html" title="class in weka.core">TechnicalInformationHandlerJavadoc</a></td>
<td class="colLast">
<div class="block">Generates Javadoc comments from the TechnicalInformationHandler's data.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><a href="../../weka/core/Tee.html" title="class in weka.core">Tee</a></td>
<td class="colLast">
<div class="block">This class pipelines print/println's to several PrintStreams.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><a href="../../weka/core/TestInstances.html" title="class in weka.core">TestInstances</a></td>
<td class="colLast">
<div class="block">Generates artificial datasets for testing.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><a href="../../weka/core/Trie.html" title="class in weka.core">Trie</a></td>
<td class="colLast">
<div class="block">A class representing a Trie data structure for strings.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><a href="../../weka/core/Trie.TrieIterator.html" title="class in weka.core">Trie.TrieIterator</a></td>
<td class="colLast">
<div class="block">Represents an iterator over a trie</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><a href="../../weka/core/Trie.TrieNode.html" title="class in weka.core">Trie.TrieNode</a></td>
<td class="colLast">
<div class="block">Represents a node in the trie.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><a href="../../weka/core/Utils.html" title="class in weka.core">Utils</a></td>
<td class="colLast">
<div class="block">Class implementing some simple utility methods.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><a href="../../weka/core/Version.html" title="class in weka.core">Version</a></td>
<td class="colLast">
<div class="block">This class contains the version number of the current WEKA release and some
methods for comparing another version string.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><a href="../../weka/core/WekaEnumeration.html" title="class in weka.core">WekaEnumeration</a><E></td>
<td class="colLast">
<div class="block">Class for enumerating an array list's elements.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><a href="../../weka/core/WekaPackageManager.html" title="class in weka.core">WekaPackageManager</a></td>
<td class="colLast">
<div class="block">Class providing package management and manipulation routines.</div>
</td>
</tr>
</tbody>
</table>
</li>
<li class="blockList">
<table class="packageSummary" border="0" cellpadding="3" cellspacing="0" summary="Enum Summary table, listing enums, and an explanation">
<caption><span>Enum Summary</span><span class="tabEnd"> </span></caption>
<tr>
<th class="colFirst" scope="col">Enum</th>
<th class="colLast" scope="col">Description</th>
</tr>
<tbody>
<tr class="altColor">
<td class="colFirst"><a href="../../weka/core/Capabilities.Capability.html" title="enum in weka.core">Capabilities.Capability</a></td>
<td class="colLast">
<div class="block">enumeration of all capabilities</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><a href="../../weka/core/RevisionUtils.Type.html" title="enum in weka.core">RevisionUtils.Type</a></td>
<td class="colLast">
<div class="block">Enumeration of source control types.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><a href="../../weka/core/TechnicalInformation.Field.html" title="enum in weka.core">TechnicalInformation.Field</a></td>
<td class="colLast">
<div class="block">the possible fields</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><a href="../../weka/core/TechnicalInformation.Type.html" title="enum in weka.core">TechnicalInformation.Type</a></td>
<td class="colLast">
<div class="block">the different types of information</div>
</td>
</tr>
</tbody>
</table>
</li>
<li class="blockList">
<table class="packageSummary" border="0" cellpadding="3" cellspacing="0" summary="Exception Summary table, listing exceptions, and an explanation">
<caption><span>Exception Summary</span><span class="tabEnd"> </span></caption>
<tr>
<th class="colFirst" scope="col">Exception</th>
<th class="colLast" scope="col">Description</th>
</tr>
<tbody>
<tr class="altColor">
<td class="colFirst"><a href="../../weka/core/NoSupportForMissingValuesException.html" title="class in weka.core">NoSupportForMissingValuesException</a></td>
<td class="colLast">
<div class="block">Exception that is raised by an object that is unable to process
data with missing values.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><a href="../../weka/core/UnassignedClassException.html" title="class in weka.core">UnassignedClassException</a></td>
<td class="colLast">
<div class="block">Exception that is raised when trying to use some data that has no
class assigned to it, but a class is needed to perform the operation.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><a href="../../weka/core/UnassignedDatasetException.html" title="class in weka.core">UnassignedDatasetException</a></td>
<td class="colLast">
<div class="block">Exception that is raised when trying to use something that has no
reference to a dataset, when one is required.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><a href="../../weka/core/UnsupportedAttributeTypeException.html" title="class in weka.core">UnsupportedAttributeTypeException</a></td>
<td class="colLast">
<div class="block">Exception that is raised by an object that is unable to process some of the
attribute types it has been passed.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><a href="../../weka/core/UnsupportedClassTypeException.html" title="class in weka.core">UnsupportedClassTypeException</a></td>
<td class="colLast">
<div class="block">Exception that is raised by an object that is unable to process the
class type of the data it has been passed.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><a href="../../weka/core/WekaException.html" title="class in weka.core">WekaException</a></td>
<td class="colLast">
<div class="block">Class for Weka-specific exceptions.</div>
</td>
</tr>
</tbody>
</table>
</li>
<li class="blockList">
<table class="packageSummary" border="0" cellpadding="3" cellspacing="0" summary="Annotation Types Summary table, listing annotation types, and an explanation">
<caption><span>Annotation Types Summary</span><span class="tabEnd"> </span></caption>
<tr>
<th class="colFirst" scope="col">Annotation Type</th>
<th class="colLast" scope="col">Description</th>
</tr>
<tbody>
<tr class="altColor">
<td class="colFirst"><a href="../../weka/core/OptionMetadata.html" title="annotation in weka.core">OptionMetadata</a></td>
<td class="colLast">
<div class="block">Method annotation that can be used with scheme parameters to provide a nice
display-ready name for the parameter, help information and, if applicable,
command line option details</div>
</td>
</tr>
</tbody>
</table>
</li>
</ul>
</div>
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<div class="bottomNav"><a name="navbar_bottom">
<!-- -->
</a><a href="#skip-navbar_bottom" title="Skip navigation links"></a><a name="navbar_bottom_firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../overview-summary.html">Overview</a></li>
<li class="navBarCell1Rev">Package</li>
<li>Class</li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../index-all.html">Index</a></li>
<li><a href="../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li><a href="../../weka/clusterers/package-summary.html">Prev Package</a></li>
<li><a href="../../weka/core/converters/package-summary.html">Next Package</a></li>
</ul>
<ul class="navList">
<li><a href="../../index.html?weka/core/package-summary.html" target="_top">Frames</a></li>
<li><a href="package-summary.html" target="_top">No Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_bottom">
<li><a href="../../allclasses-noframe.html">All Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_bottom");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<a name="skip-navbar_bottom">
<!-- -->
</a></div>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
</body>
</html>
| {
"content_hash": "37f8e87197a057ad3e25866387f8f7db",
"timestamp": "",
"source": "github",
"line_count": 960,
"max_line_length": 160,
"avg_line_length": 41.255208333333336,
"alnum_prop": 0.7026638050751168,
"repo_name": "royhpr/KDDProject",
"id": "28f07b87a51430b5002bd4d280af2a4adb9acfaa",
"size": "39605",
"binary": false,
"copies": "5",
"ref": "refs/heads/master",
"path": "HelloWorldJava/weka-3-7-13/doc/weka/core/package-summary.html",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "11649"
},
{
"name": "HTML",
"bytes": "46976575"
},
{
"name": "Java",
"bytes": "21827"
}
],
"symlink_target": ""
} |
//
// PositionView.m
// KBLove
//
// Created by 1124 on 14/11/11.
// Copyright (c) 2014年 block. All rights reserved.
//
#import "PositionView.h"
@implementation PositionView
/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
// Drawing code
}
*/
@end
| {
"content_hash": "b0cdf2b04b9c925f6653dc88d9493c3f",
"timestamp": "",
"source": "github",
"line_count": 21,
"max_line_length": 74,
"avg_line_length": 18.095238095238095,
"alnum_prop": 0.7,
"repo_name": "MJHelloWorld/KBLove",
"id": "ee2a3f8faa242afbfd228cbd0c16eb006eaa0228",
"size": "382",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "KBLove/Classes/General/Views/PositionView.m",
"mode": "33261",
"license": "mit",
"language": [
{
"name": "C",
"bytes": "389"
},
{
"name": "C++",
"bytes": "10115"
},
{
"name": "JavaScript",
"bytes": "33474"
},
{
"name": "Mercury",
"bytes": "1024"
},
{
"name": "Objective-C",
"bytes": "1787286"
},
{
"name": "Objective-C++",
"bytes": "83423"
},
{
"name": "Ruby",
"bytes": "315"
}
],
"symlink_target": ""
} |
<div class="col-md-14">
<nav class="navbar navbar-inverse navbar-static-top" role="navigation">
<div class="container">
<a class="navbar-brand">Chat Messenger</a>
<a class="navbar-right navbar-text">Signed in as [[userDetails.user.name]]</a>
<a class="navbar-right navbar-text" data-ng-click="logout()">logout</a>
</div>
</nav>
</div>
<div class="col-md-4" style="min-height: 50px"><div class="anchorBadge" href="#" style="overflow-y: auto;font-family: 'Arimo', sans-serif" data-ng-repeat="location in locationData">[[location.name|| '']] <span class="badge">[[location.userCount]]</span></div></div>
<div class="chatBoxWidth col-md-8 panel panel-default">
<div class="panel-body height443" style="overflow-y: auto">
</div>
<div class="panel-footer">
<div class="input-group">
<input type="text" class="form-control" data-ng-model="message">
<span class="input-group-btn">
<button class="btn btn-default" type="button" data-ng-click="send()">send</button>
</span>
</div>
</div>
</div>
<div class="col-md-8" style="height: 500px">
</div>
| {
"content_hash": "ee04aaf65caea2be5674a6925d24f4e7",
"timestamp": "",
"source": "github",
"line_count": 28,
"max_line_length": 265,
"avg_line_length": 42.714285714285715,
"alnum_prop": 0.6028428093645485,
"repo_name": "sahilchitkara/letsChat",
"id": "666d78b6453c29b1d27953d9815b640de09495ad",
"size": "1196",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "public/partials/chat.html",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "1081932"
},
{
"name": "JavaScript",
"bytes": "361468"
},
{
"name": "Ruby",
"bytes": "6786"
}
],
"symlink_target": ""
} |
require 'rspec/expectations'
$LOAD_PATH << "lib"
$LOAD_PATH << "models"
require 'environment'
require 'gif'
Environment.environment = "test"
def run_giffer_with_input(*inputs)
shell_output = ""
IO.popen('ENVIRONMENT=test ./giffer', 'r+') do |pipe|
inputs.each do |input|
pipe.puts input
end
pipe.close_write
shell_output << pipe.read
end
shell_output
end
RSpec.configure do |config|
config.after(:each) do
Environment.database_connection.execute("DELETE FROM gifs;")
end
end
RSpec::Matchers.define :include_in_order do |*expected|
match do |actual|
input = actual.delete("\n")
regexp_string = expected.join(".*").gsub("?","\\?").gsub("\n",".*")
result = /#{regexp_string}/.match(input)
result.should be
end
end
| {
"content_hash": "dfc4b4784477e2605a6e9f79f6326815",
"timestamp": "",
"source": "github",
"line_count": 35,
"max_line_length": 71,
"avg_line_length": 22.114285714285714,
"alnum_prop": 0.6576227390180879,
"repo_name": "mattLummus/Get-a-Gif",
"id": "34a79de809852907985d6b51e935d696e182dab0",
"size": "774",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "spec/spec_helper.rb",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Ruby",
"bytes": "20960"
}
],
"symlink_target": ""
} |
title: Functional
localeTitle: Funcional
---
```javascript
var fun = function(a, b) {
var funInstance = {};
funInstance.a = a;
funInstance.b = b;
funInstance.method1 = function() {
// method code here
}
funInstance.method2 = function() {
// method code here
}
funInstance.method3 = function() {
// method code here
}
return funInstance;
}
var myFun = fun(1, 2);
myFun.method1();
```
## ¿Cómo lo reconozco?
La creación de instancias de objetos funcionales crea una instancia de clase con una función, al igual que las otras opciones. La diferencia es que todos los métodos asociados también se definen en la función constructora.
## ¿Por qué lo usaría?
Dado que se crea un nuevo conjunto de métodos para cada instancia del objeto y podría ocupar una cantidad considerable de memoria, la creación de instancias funcional es buena cuando se sabe que no va a trabajar con muchas instancias. También es bueno que su código sea fácilmente comprendido por los codificadores de JavaScript nuevos y experimentados por igual, ya que la creación de instancias es completamente autónoma y es fácil ver las relaciones entre los métodos y las instancias de los objetos.
## ¿Cuáles son los inconvenientes?
La desventaja de Functional Instantiation es que si tuviera que realizar cambios en su código (como agregar más métodos), las instancias del objeto que se crearon antes de que se realizaran estos cambios no se actualizarían. Podría terminar con dos instancias que contengan información de método diferente.
* * *
## Título: Funcional-Compartido
```javascript
var fun = function(a, b) {
var funInstance = {};
funInstance.a = a;
funInstance.b = b;
extend(funInstance, funMethods);
return funInstance;
}
var extend = function(to, from) {
for (var key in from) {
to[key] = from[key];
}
}
var funMethods = {};
funMethods.method1 = function() {
// method code here
}
funMethods.method2 = function() {
// method code here
}
funMethods.method3 = function() {
// method code here
}
var myFun = fun(1, 2);
myFun.method1();
```
## ¿Cómo lo reconozco?
La principal diferencia entre Functional y Functional-Shared, es que en Functional-Shared compartimos nuestros métodos. En lugar de declarar métodos en nuestra función de instanciación, tenemos un objeto separado que contiene todos nuestros métodos. Para utilizar los métodos, los extendemos a cada instancia del objeto que se está creando.
## ¿Por qué lo usaría?
Functional-Shared nos permite usar referencias a métodos, en lugar de declarar y almacenar nuestros métodos para cada instancia de nuestro objeto, ahorrando espacio.
## ¿Cuáles son los inconvenientes?
El inconveniente es que, dado que los métodos se referencian mediante los punteros al objeto de métodos, si tuviéramos que actualizar el método de métodos de alguna manera, las instancias del objeto que se crearon antes de los cambios no se actualizarían. Podría terminar con dos instancias del objeto haciendo referencia a dos versiones diferentes de los métodos.
* * *
## título: prototípico
```javascript
var fun = function(a, b) {
var funInstance = Object.create(funMethods);
funInstance.a = a;
funInstance.b = b;
return funInstance;
}
var funMethods = {};
funMethods.method1 = function() {
// method code here
}
funMethods.method2 = function() {
// method code here
}
funMethods.method3 = function() {
// method code here
}
var myFun = fun(1, 2);
myFun.method1();
```
## ¿Cómo lo reconozco?
Prototypal es similar a Functional-Shared en el sentido de que ambos usan un objeto de métodos separado para contener todos los métodos que se compartirán entre las instancias del objeto que estamos creando. La diferencia es que podemos usar la cadena prototipo. Podemos crear el objeto utilizando Object.create (prototipo) para adjuntar los métodos a nuestra instancia de objeto. El objeto que contiene nuestros métodos compartidos se considera el prototipo.
## ¿Por qué lo usaría?
Si realiza cambios en su prototipo después de crear una instancia de objeto, esa instancia se actualizará. No terminarás con dos instancias con el mismo prototipo que tienen métodos diferentes.
## ¿Cuáles son los inconvenientes?
Las desventajas de usar este método es que requiere pasos adicionales y código adicional. No solo tenemos que crear y devolver nuestro objeto como antes, sino que también debemos decorarlo.
* * *
## título: pseudoclásico
```javascript
var Fun = function(a, b) {
// this = Object.create(Fun.prototype);
this.a = a;
this.b = b;
// return this;
}
Fun.prototype.method1 = function() {
// method code here
}
Fun.prototype.method2 = function() {
// method code here
}
Fun.prototype.method3 = function() {
// method code here
}
var myFun = new Fun(1, 2);
myFun.method1();
```
## ¿Cómo lo reconozco?
La instanciación seudoclásica es, con mucho, la menor cantidad de código. En lugar de crear un nuevo objeto y devolverlo, la nueva palabra clave lo hace por nosotros. Bajo el capó, cuando usa la nueva palabra clave para crear una instancia de un objeto, crea un nuevo objeto utilizando this = Object.create (Object.prototype), donde se refiere al prototipo que lleva el nombre de la nueva palabra clave. Cuando estamos definiendo nuestros métodos, usamos la palabra clave prototipo.
## ¿Por qué lo usaría?
Se dice que Pseudoclassical es el patrón de creación de instancias más rápido, lo cual es útil si está creando decenas de miles de instancias. También es el más optimizado ya que utiliza la funcionalidad de Javascript.
## ¿Cuáles son los inconvenientes?
La desventaja de la instanciación pseudoclásica es que requiere un poco más de conocimiento sobre lo que hace JavaScript bajo el capó, particularmente con esta palabra clave. Esto hace que este tipo de creación de objetos sea un poco más complejo de entender, especialmente si alguien más está leyendo su código | {
"content_hash": "423ccbc1b718cccd78e0edf3dac7ac64",
"timestamp": "",
"source": "github",
"line_count": 150,
"max_line_length": 503,
"avg_line_length": 40.08,
"alnum_prop": 0.7411842980705257,
"repo_name": "pahosler/freecodecamp",
"id": "7445cbf143ae6519d46f11861c115781a7d52054",
"size": "6122",
"binary": false,
"copies": "4",
"ref": "refs/heads/master",
"path": "guide/spanish/javascript/object-instantiation/functional/index.md",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "CSS",
"bytes": "35491"
},
{
"name": "HTML",
"bytes": "17600"
},
{
"name": "JavaScript",
"bytes": "777274"
}
],
"symlink_target": ""
} |
package org.jivesoftware.smackx.privacy;
import org.jivesoftware.smackx.privacy.packet.PrivacyItem;
import java.util.List;
/**
* A privacy list represents a list of contacts that is a read only class used to represent a set of allowed or blocked communications.
* Basically it can:<ul>
*
* <li>Handle many {@link org.jivesoftware.smackx.privacy.packet.PrivacyItem}.</li>
* <li>Answer if it is the default list.</li>
* <li>Answer if it is the active list.</li>
* </ul>
*
* {@link PrivacyItem Privacy Items} can handle different kind of blocking communications based on JID, group,
* subscription type or globally.
*
* @author Francisco Vives
*/
public class PrivacyList {
/** Holds if it is an active list or not **/
private final boolean isActiveList;
/** Holds if it is an default list or not **/
private final boolean isDefaultList;
/** Holds the list name used to print **/
private final String listName;
/** Holds the list of {@link PrivacyItem} */
private final List<PrivacyItem> items;
protected PrivacyList(boolean isActiveList, boolean isDefaultList,
String listName, List<PrivacyItem> privacyItems) {
super();
this.isActiveList = isActiveList;
this.isDefaultList = isDefaultList;
this.listName = listName;
this.items = privacyItems;
}
public String getName() {
return listName;
}
public boolean isActiveList() {
return isActiveList;
}
public boolean isDefaultList() {
return isDefaultList;
}
public List<PrivacyItem> getItems() {
return items;
}
@Override
public String toString() {
return "Privacy List: " + listName + "(active:" + isActiveList + ", default:" + isDefaultList + ")";
}
}
| {
"content_hash": "cd4dfc50701553739896f0fd07cbd435",
"timestamp": "",
"source": "github",
"line_count": 62,
"max_line_length": 136,
"avg_line_length": 29.322580645161292,
"alnum_prop": 0.658965896589659,
"repo_name": "magnetsystems/message-smack",
"id": "47f73a14866af57e626e5deddc79cba99a619399",
"size": "2430",
"binary": false,
"copies": "4",
"ref": "refs/heads/master",
"path": "smack-extensions/src/main/java/org/jivesoftware/smackx/privacy/PrivacyList.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "602"
},
{
"name": "HTML",
"bytes": "58167"
},
{
"name": "Java",
"bytes": "4806012"
},
{
"name": "Shell",
"bytes": "739"
}
],
"symlink_target": ""
} |
namespace System.Management.Automation
{
/// <summary>
/// Provides information about a filter that is stored in session state.
/// </summary>
public class FilterInfo : FunctionInfo
{
#region ctor
/// <summary>
/// Creates an instance of the FilterInfo class with the specified name and ScriptBlock.
/// </summary>
/// <param name="name">
/// The name of the filter.
/// </param>
/// <param name="filter">
/// The ScriptBlock for the filter
/// </param>
/// <param name="context">
/// The ExecutionContext for the filter.
/// </param>
/// <exception cref="ArgumentNullException">
/// If <paramref name="filter"/> is null.
/// </exception>
internal FilterInfo(string name, ScriptBlock filter, ExecutionContext context) : this(name, filter, context, null)
{
}
/// <summary>
/// Creates an instance of the FilterInfo class with the specified name and ScriptBlock.
/// </summary>
/// <param name="name">
/// The name of the filter.
/// </param>
/// <param name="filter">
/// The ScriptBlock for the filter
/// </param>
/// <param name="context">
/// The ExecutionContext for the filter.
/// </param>
/// <param name="helpFile">
/// The help file for the filter.
/// </param>
/// <exception cref="ArgumentNullException">
/// If <paramref name="filter"/> is null.
/// </exception>
internal FilterInfo(string name, ScriptBlock filter, ExecutionContext context, string helpFile)
: base(name, filter, context, helpFile)
{
SetCommandType(CommandTypes.Filter);
}
/// <summary>
/// Creates an instance of the FilterInfo class with the specified name and ScriptBlock.
/// </summary>
/// <param name="name">
/// The name of the filter.
/// </param>
/// <param name="filter">
/// The ScriptBlock for the filter
/// </param>
/// <param name="options">
/// The options to set on the function. Note, Constant can only be set at creation time.
/// </param>
/// <param name="context">
/// The execution context for the filter.
/// </param>
/// <exception cref="ArgumentNullException">
/// If <paramref name="filter"/> is null.
/// </exception>
internal FilterInfo(string name, ScriptBlock filter, ScopedItemOptions options, ExecutionContext context) : this(name, filter, options, context, null)
{
}
/// <summary>
/// Creates an instance of the FilterInfo class with the specified name and ScriptBlock.
/// </summary>
/// <param name="name">
/// The name of the filter.
/// </param>
/// <param name="filter">
/// The ScriptBlock for the filter
/// </param>
/// <param name="options">
/// The options to set on the function. Note, Constant can only be set at creation time.
/// </param>
/// <param name="context">
/// The execution context for the filter.
/// </param>
/// <param name="helpFile">
/// The help file for the filter.
/// </param>
/// <exception cref="ArgumentNullException">
/// If <paramref name="filter"/> is null.
/// </exception>
internal FilterInfo(string name, ScriptBlock filter, ScopedItemOptions options, ExecutionContext context, string helpFile)
: base(name, filter, options, context, helpFile)
{
SetCommandType(CommandTypes.Filter);
}
/// <summary>
/// This is a copy constructor, used primarily for get-command.
/// </summary>
internal FilterInfo(FilterInfo other)
: base(other)
{
}
/// <summary>
/// This is a copy constructor, used primarily for get-command.
/// </summary>
internal FilterInfo(string name, FilterInfo other)
: base(name, other)
{
}
/// <summary>
/// Create a copy of commandInfo for GetCommandCommand so that we can generate parameter
/// sets based on an argument list (so we can get the dynamic parameters.)
/// </summary>
internal override CommandInfo CreateGetCommandCopy(object[] arguments)
{
FilterInfo copy = new FilterInfo(this);
copy.IsGetCommandCopy = true;
copy.Arguments = arguments;
return copy;
}
#endregion ctor
internal override HelpCategory HelpCategory
{
get { return HelpCategory.Filter; }
}
}
}
| {
"content_hash": "40bd395a1c3584302d9994286163a810",
"timestamp": "",
"source": "github",
"line_count": 137,
"max_line_length": 158,
"avg_line_length": 35.53284671532847,
"alnum_prop": 0.5527937551355793,
"repo_name": "TravisEz13/PowerShell",
"id": "247aa0d5f6bcd80fab367a7db03d7d58ef85fab2",
"size": "4944",
"binary": false,
"copies": "5",
"ref": "refs/heads/travisez13-main",
"path": "src/System.Management.Automation/engine/FilterInfo.cs",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Batchfile",
"bytes": "24"
},
{
"name": "C#",
"bytes": "30828572"
},
{
"name": "Dockerfile",
"bytes": "6464"
},
{
"name": "HTML",
"bytes": "18060"
},
{
"name": "JavaScript",
"bytes": "8738"
},
{
"name": "PowerShell",
"bytes": "4998299"
},
{
"name": "Rich Text Format",
"bytes": "40664"
},
{
"name": "Roff",
"bytes": "214981"
},
{
"name": "Shell",
"bytes": "57904"
},
{
"name": "XSLT",
"bytes": "14397"
}
],
"symlink_target": ""
} |
# Gulp Start Skeleton
Minimal Gulp Projects, include sass, server, watch
### How to start
```bash
npm install
bower install
gulp
```
### Gulp file
```javascript
var gulp = require('gulp');
var del = require('del');
var connect = require('gulp-connect');
var concat = require('gulp-concat');
var uglify = require('gulp-uglify');
var sass = require('gulp-sass');
var cleancss = require('gulp-clean-css');
var htmlmin = require('gulp-htmlmin');
var imagemin = require('gulp-image');
var usemin = require('gulp-usemin');
var paths = {
port: 8000,
scss: ['./src/assets/styles/*.scss'],
css: ['./src/assets/styles/*.css'],
html: ['src/*.html','src/views/**/.html'],
images: './src/assets/images/**/*.*',
copy: ['./src/assets/fonts/**', './src/assets/json/**'],
dev: './src',
dist: './dist'
};
gulp.task('clean', function () {
return del.sync(paths.dist);//Clean must be sync to avoid from errors
});
gulp.task('copy', ['clean'], function () {
return gulp.src(paths.copy, {base: paths.dev})
.pipe(gulp.dest(paths.dist));
});
gulp.task('sass', function () {
return gulp.src(paths.scss, {base: "./"})
.pipe(sass().on('error', sass.logError))
.pipe(gulp.dest('./'))
.pipe(connect.reload());
});
gulp.task('html', function () {
var options = {
removeComments: false,
collapseWhitespace: true,
collapseBooleanAttributes: true,
removeAttributeQuotes: true,
removeEmptyAttributes: true,
removeScriptTypeAttributes: true,
removeStyleLinkTypeAttributes: true,
removeOptionalTags: false
};
return gulp.src(paths.html, {base: paths.dev})
.pipe(usemin({
html: [htmlmin(options)],
css: [cleancss()],
js: [uglify()],
inlinejs: [uglify()],
inlinecss: [cleancss(), 'concat']
}))
.pipe(gulp.dest(paths.dist))
.pipe(connect.reload());
});
gulp.task('images', function () {
gulp.src(paths.images, {base: paths.dev})
.pipe(imagemin())
.pipe(gulp.dest(paths.dist));
});
gulp.task('connectDev', function () {
connect.server({
name: 'Dev App',
root: paths.dev,
port: paths.port,
livereload: true
});
});
gulp.task('connectDist', function () {
connect.server({
name: 'Dist App',
root: paths.dist,
port: paths.port + 1,
livereload: true
});
});
gulp.task('watch', function () {
console.log('Gulp watching changes!');
gulp.watch(paths.scss, ['sass']);
gulp.watch(paths.html.concat(paths.css), ['html']);
});
gulp.task('default', ['clean', 'copy', 'sass','html', 'images', 'connectDist', 'connectDev', 'watch']);
```
| {
"content_hash": "f9518b6cb5edcba284c8f63110514474",
"timestamp": "",
"source": "github",
"line_count": 109,
"max_line_length": 103,
"avg_line_length": 25.28440366972477,
"alnum_prop": 0.5798258345428157,
"repo_name": "leenanxi/gulp-start-skeleton",
"id": "3eaf9fa1f3e49cd726f514fc2ba025c2c1056959",
"size": "2756",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "README.md",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "332483"
},
{
"name": "HTML",
"bytes": "683"
},
{
"name": "JavaScript",
"bytes": "2883"
}
],
"symlink_target": ""
} |
SYNONYM
#### According to
The Catalogue of Life, 3rd January 2011
#### Published in
null
#### Original name
null
### Remarks
null | {
"content_hash": "8183680af26666b9e948d47a3926e766",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 39,
"avg_line_length": 10.23076923076923,
"alnum_prop": 0.6917293233082706,
"repo_name": "mdoering/backbone",
"id": "505ddfa03df506b134d74d3674d0c827ee01f8ea",
"size": "185",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "life/Plantae/Magnoliophyta/Magnoliopsida/Apiales/Apiaceae/Pimpinella/Pimpinella caffra/ Syn. Anisum caffrum/README.md",
"mode": "33188",
"license": "apache-2.0",
"language": [],
"symlink_target": ""
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.