The full dataset viewer is not available (click to read why). Only showing a preview of the rows.
The dataset generation failed
Error code: DatasetGenerationError
Exception: ArrowInvalid
Message: JSON parse error: Missing a closing quotation mark in string. in row 61
Traceback: Traceback (most recent call last):
File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/packaged_modules/json/json.py", line 145, in _generate_tables
dataset = json.load(f)
File "/usr/local/lib/python3.9/json/__init__.py", line 293, in load
return loads(fp.read(),
File "/usr/local/lib/python3.9/json/__init__.py", line 346, in loads
return _default_decoder.decode(s)
File "/usr/local/lib/python3.9/json/decoder.py", line 340, in decode
raise JSONDecodeError("Extra data", s, end)
json.decoder.JSONDecodeError: Extra data: line 2 column 1 (char 4707)
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/builder.py", line 1995, in _prepare_split_single
for _, table in generator:
File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/packaged_modules/json/json.py", line 148, in _generate_tables
raise e
File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/packaged_modules/json/json.py", line 122, in _generate_tables
pa_table = paj.read_json(
File "pyarrow/_json.pyx", line 308, in pyarrow._json.read_json
File "pyarrow/error.pxi", line 154, in pyarrow.lib.pyarrow_internal_check_status
File "pyarrow/error.pxi", line 91, in pyarrow.lib.check_status
pyarrow.lib.ArrowInvalid: JSON parse error: Missing a closing quotation mark in string. in row 61
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/src/services/worker/src/worker/job_runners/config/parquet_and_info.py", line 1529, in compute_config_parquet_and_info_response
parquet_operations = convert_to_parquet(builder)
File "/src/services/worker/src/worker/job_runners/config/parquet_and_info.py", line 1154, in convert_to_parquet
builder.download_and_prepare(
File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/builder.py", line 1027, in download_and_prepare
self._download_and_prepare(
File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/builder.py", line 1122, in _download_and_prepare
self._prepare_split(split_generator, **prepare_split_kwargs)
File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/builder.py", line 1882, in _prepare_split
for job_id, done, content in self._prepare_split_single(
File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/builder.py", line 2038, in _prepare_split_single
raise DatasetGenerationError("An error occurred while generating the dataset") from e
datasets.exceptions.DatasetGenerationError: An error occurred while generating the datasetNeed help to make the dataset viewer work? Make sure to review how to configure the dataset viewer, and open a discussion for direct support.
text
string | meta
dict |
|---|---|
/*!
* jsonformatter
*
* Version: 0.6.0 - 2016-08-27T12:58:03.339Z
* License: Apache-2.0
*/
.json-formatter-row {
font-family: monospace;
}
.json-formatter-row,
.json-formatter-row a,
.json-formatter-row a:hover {
color: black;
text-decoration: none;
}
.json-formatter-row .json-formatter-row {
margin-left: 1em;
}
.json-formatter-row .children.empty {
opacity: 0.5;
margin-left: 1em;
}
.json-formatter-row .children.empty.object:after {
content: "No properties";
}
.json-formatter-row .children.empty.array:after {
content: "[]";
}
.json-formatter-row .string {
color: green;
/*white-space: pre;*/
word-wrap: break-word;
}
.json-formatter-row .number {
color: blue;
}
.json-formatter-row .boolean {
color: red;
}
.json-formatter-row .null {
color: #855A00;
}
.json-formatter-row .undefined {
color: #ca0b69;
}
.json-formatter-row .function {
color: #FF20ED;
}
.json-formatter-row .date {
background-color: rgba(0, 0, 0, 0.05);
}
.json-formatter-row .url {
text-decoration: underline;
color: blue;
cursor: pointer;
}
.json-formatter-row .bracket {
color: blue;
}
.json-formatter-row .key {
color: #00008B;
cursor: pointer;
}
.json-formatter-row .constructor-name {
cursor: pointer;
}
.json-formatter-row .toggler {
font-size: 0.8em;
line-height: 1.2em;
vertical-align: middle;
opacity: 0.6;
cursor: pointer;
}
.json-formatter-row .toggler:after {
display: inline-block;
transition: transform 100ms ease-in;
content: "►";
}
.json-formatter-row .toggler.open:after {
transform: rotate(90deg);
}
.json-formatter-row > a > .thumbnail-text {
opacity: 0;
transition: opacity 0.15s ease-in;
font-style: italic;
}
.json-formatter-row:hover > a > .thumbnail-text {
opacity: 0.6;
}
.json-formatter-dark.json-formatter-row {
font-family: monospace;
}
.json-formatter-dark.json-formatter-row,
.json-formatter-dark.json-formatter-row a,
.json-formatter-dark.json-formatter-row a:hover {
color: white;
text-decoration: none;
}
.json-formatter-dark.json-formatter-row .json-formatter-row {
margin-left: 1em;
}
.json-formatter-dark.json-formatter-row .children.empty {
opacity: 0.5;
margin-left: 1em;
}
.json-formatter-dark.json-formatter-row .children.empty.object:after {
content: "No properties";
}
.json-formatter-dark.json-formatter-row .children.empty.array:after {
content: "[]";
}
.json-formatter-dark.json-formatter-row .string {
color: #31F031;
white-space: pre;
word-wrap: break-word;
}
.json-formatter-dark.json-formatter-row .number {
color: #66C2FF;
}
.json-formatter-dark.json-formatter-row .boolean {
color: #EC4242;
}
.json-formatter-dark.json-formatter-row .null {
color: #EEC97D;
}
.json-formatter-dark.json-formatter-row .undefined {
color: #ef8fbe;
}
.json-formatter-dark.json-formatter-row .function {
color: #FD48CB;
}
.json-formatter-dark.json-formatter-row .date {
background-color: rgba(255, 255, 255, 0.05);
}
.json-formatter-dark.json-formatter-row .url {
text-decoration: underline;
color: #027BFF;
cursor: pointer;
}
.json-formatter-dark.json-formatter-row .bracket {
color: #9494FF;
}
.json-formatter-dark.json-formatter-row .key {
color: #23A0DB;
cursor: pointer;
}
.json-formatter-dark.json-formatter-row .constructor-name {
cursor: pointer;
}
.json-formatter-dark.json-formatter-row .toggler {
font-size: 0.8em;
line-height: 1.2em;
vertical-align: middle;
opacity: 0.6;
cursor: pointer;
}
.json-formatter-dark.json-formatter-row .toggler:after {
display: inline-block;
transition: transform 100ms ease-in;
content: "►";
}
.json-formatter-dark.json-formatter-row .toggler.open:after {
transform: rotate(90deg);
}
.json-formatter-dark.json-formatter-row > a > .thumbnail-text {
opacity: 0;
transition: opacity 0.15s ease-in;
font-style: italic;
}
.json-formatter-dark.json-formatter-row:hover > a > .thumbnail-text {
opacity: 0.6;
}
|
{
"content_hash": "9f3b12759a0a471d16eb8797235034d0",
"timestamp": "",
"source": "github",
"line_count": 174,
"max_line_length": 70,
"avg_line_length": 22.436781609195403,
"alnum_prop": 0.6980020491803278,
"repo_name": "multisigstellar/multisig",
"id": "4b9735a088f589f3e9995265f0f342bbc9315e79",
"size": "3908",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "frontend/css/json-formatter.css",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "4536"
},
{
"name": "HTML",
"bytes": "35980"
},
{
"name": "JavaScript",
"bytes": "2124861"
}
]
}
|
var editedComponent = null;
var nodeSel = null;
//var endNode = null;
function boundNode(n) {
if(nodeSel == null)
nodeSel = n;
else {
var l = appData.createTransition(canvas,nodeSel,n);
nodeSel = null;
}
}
function startComponentCodeEdit(line) {
editedComponent = line;
canvas.startCodeEdit(line.code);
}
///////////
var char_index = -1;
var current_state = null;
var stack = {};
function czynnoscToString(cz) {
var ret = "{";
ret += "typ: CzynnoscObject." ;
if(cz.typ == CzynnoscObject.Jazda)
ret += "Jazda";
if(cz.typ == CzynnoscObject.Odpoczynek)
ret += "Odpoczynek";
if(cz.typ == CzynnoscObject.Praca)
ret += "Praca";
if(cz.typ == CzynnoscObject.Dyspozycja)
ret += "Dyspozycja";
if(cz.typ == CzynnoscObject.BrakDanych)
ret += "BrakDanych";
ret += ", czas: " + cz.czas;
// ret += ", start: " + cz.start;
ret += "}";
return ret;
}
function showStateCode(state)
{
var sc = "";
for(var key in stack) {
sc += key.toString() + "=" + stack[key] + "\n";
}
console.debug("STACK: "+sc);
canvas.changeStackCode(sc);
var cc = "";
for(var key in state.local) {
cc += key.toString() + "=" + state.local[key] + "\n";
}
console.debug("CONTEXT: "+cc);
canvas.changeContextCode(cc);
}
function next() {
if(char_index+1 == appData.czynnosci.length) {
char_index = 0;
}
else
char_index++;
}
function step() {
if(char_index==-1)
{
current_state = appData.nodes[0];
console.debug(current_state.code);
var local = current_state.local;
var fi = "var temp = function() { " + current_state.code + " };";
eval(fi);
eval("temp()");
local.visited = true;
showStateCode(current_state);
char_index = 0;
}
if(char_index == appData.czynnosci.length) {
appData.endNode.mignij();
//canvas.debugText(appData.endNode.code);
eval(appData.endNode.code);
char_index = -1;
canvas.selectedCzynnosc(0);
current_state.reset();
appData.nodes[0].setBreakpoint();
console.debug("end of string");
return;
}
console.debug("current state: "+current_state.name);
console.debug("stepping "+czynnoscToString(appData.czynnosci[char_index]));
var found_transition = false;
for(var i=0;i<appData.transitions.length;i++) {
var tr = appData.transitions[i];
if(tr.from === current_state)
{
var fi = "var temp = function(c) { " + tr.code + " };";
console.debug(fi);
eval(fi);
var f = "temp("+czynnoscToString(appData.czynnosci[char_index])+");";
var ret = eval(f);
console.debug(f);
console.debug(ret);
if(ret)
{
tr.state = "Running";
console.debug(appData.czynnosci[char_index]+" is ok");
current_state.reset();
current_state = tr.to;
current_state.setBreakpoint();
console.debug(current_state.code);
var local = current_state.local;
fi = "var temp2 = function(c) { " + current_state.code + " };";
eval(fi);
eval("temp2("+czynnoscToString(appData.czynnosci[char_index])+")");
local.visited = true;
showStateCode(current_state);
char_index++;
canvas.selectedCzynnosc(char_index);
found_transition = true;
break;
}
}
}
if(!found_transition) {
char_index = -1;
canvas.selectedCzynnosc(char_index);
current_state.reset();
appData.nodes[0].setBreakpoint();
console.debug("no valid transition from "+current_state.name+" for "+appData.czynnosci[char_index]);
appData.nodes.forEach(function(el){
el.local.visited = false;
});
}
}
|
{
"content_hash": "0837dd671d221a706f03c24466b48af3",
"timestamp": "",
"source": "github",
"line_count": 150,
"max_line_length": 108,
"avg_line_length": 27.013333333333332,
"alnum_prop": 0.5384995064165844,
"repo_name": "lyckantropen/curiosities",
"id": "6a0c00b5c74c05d407ea9c88e058fdb5db677b18",
"size": "4052",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "autogui/GraphCanvasLogic.js",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C++",
"bytes": "50678"
},
{
"name": "JavaScript",
"bytes": "5111"
},
{
"name": "QML",
"bytes": "17932"
},
{
"name": "QMake",
"bytes": "31721"
}
]
}
|
require 'iron/console/specification/string_specification'
class Console
# Accepts a constant value, useful in requiring a given string in a given position to disambiguate possible actions in
# multi-action scripts, returned in args as a symbol
class ConstSpecification < StringSpecification
def initialize(name, desc = nil, params = {})
super
@options = [name.to_dashcase] if @options.nil? || @options.empty?
end
def parse(val)
val.to_dashcase.to_sym
end
end
end
|
{
"content_hash": "0cf6e55c8da1da7f02822ba301bb22ee",
"timestamp": "",
"source": "github",
"line_count": 18,
"max_line_length": 120,
"avg_line_length": 28.5,
"alnum_prop": 0.7076023391812866,
"repo_name": "irongaze/iron-console",
"id": "375cdd3b0642851a620eefd1ec40a96e3d5decd3",
"size": "513",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "lib/iron/console/specification/const_specification.rb",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Ruby",
"bytes": "70355"
}
]
}
|
from __future__ import annotations
"""
This is an example DAG which uses SparkKubernetesOperator and SparkKubernetesSensor.
In this example, we create two tasks which execute sequentially.
The first task is to submit sparkApplication on Kubernetes cluster(the example uses spark-pi application).
and the second task is to check the final state of the sparkApplication that submitted in the first state.
Spark-on-k8s operator is required to be already installed on Kubernetes
https://github.com/GoogleCloudPlatform/spark-on-k8s-operator
"""
import os
from datetime import datetime, timedelta
# [START import_module]
# The DAG object; we'll need this to instantiate a DAG
from airflow import DAG
# Operators; we need this to operate!
from airflow.providers.cncf.kubernetes.operators.spark_kubernetes import SparkKubernetesOperator
from airflow.providers.cncf.kubernetes.sensors.spark_kubernetes import SparkKubernetesSensor
# [END import_module]
# [START instantiate_dag]
ENV_ID = os.environ.get("SYSTEM_TESTS_ENV_ID")
DAG_ID = "spark_pi"
with DAG(
DAG_ID,
default_args={"max_active_runs": 1},
description="submit spark-pi as sparkApplication on kubernetes",
schedule=timedelta(days=1),
start_date=datetime(2021, 1, 1),
catchup=False,
) as dag:
# [START SparkKubernetesOperator_DAG]
t1 = SparkKubernetesOperator(
task_id="spark_pi_submit",
namespace="default",
application_file="example_spark_kubernetes_spark_pi.yaml",
do_xcom_push=True,
dag=dag,
)
t2 = SparkKubernetesSensor(
task_id="spark_pi_monitor",
namespace="default",
application_name="{{ task_instance.xcom_pull(task_ids='spark_pi_submit')['metadata']['name'] }}",
dag=dag,
)
t1 >> t2
# [END SparkKubernetesOperator_DAG]
from tests.system.utils.watcher import watcher
# This test needs watcher in order to properly mark success/failure
# when "tearDown" task with trigger rule is part of the DAG
list(dag.tasks) >> watcher()
from tests.system.utils import get_test_run # noqa: E402
# Needed to run the example DAG with pytest (see: tests/system/README.md#run_via_pytest)
test_run = get_test_run(dag)
|
{
"content_hash": "c9380ae24f2484706fd02c20934cf3c9",
"timestamp": "",
"source": "github",
"line_count": 68,
"max_line_length": 106,
"avg_line_length": 32.5735294117647,
"alnum_prop": 0.725507900677201,
"repo_name": "apache/airflow",
"id": "ba2e21ee2307690411f330af02eaccb0f47ec6d9",
"size": "3002",
"binary": false,
"copies": "3",
"ref": "refs/heads/main",
"path": "tests/system/providers/cncf/kubernetes/example_spark_kubernetes.py",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "25980"
},
{
"name": "Dockerfile",
"bytes": "71458"
},
{
"name": "HCL",
"bytes": "3786"
},
{
"name": "HTML",
"bytes": "172957"
},
{
"name": "JavaScript",
"bytes": "143915"
},
{
"name": "Jinja",
"bytes": "38911"
},
{
"name": "Jupyter Notebook",
"bytes": "5482"
},
{
"name": "Mako",
"bytes": "1339"
},
{
"name": "Python",
"bytes": "23697738"
},
{
"name": "R",
"bytes": "313"
},
{
"name": "Shell",
"bytes": "211306"
},
{
"name": "TypeScript",
"bytes": "521019"
}
]
}
|
etcdb.execute package
=====================
Subpackages
-----------
.. toctree::
etcdb.execute.ddl
etcdb.execute.dml
Module contents
---------------
.. automodule:: etcdb.execute
:members:
:undoc-members:
:show-inheritance:
|
{
"content_hash": "9d5f04ecf238bc5cfa3d2aad19290cb4",
"timestamp": "",
"source": "github",
"line_count": 18,
"max_line_length": 29,
"avg_line_length": 13.833333333333334,
"alnum_prop": 0.5502008032128514,
"repo_name": "box/etcdb",
"id": "8caa2556f7c9a906d7bd85096efdfb188f58c3a7",
"size": "249",
"binary": false,
"copies": "1",
"ref": "refs/heads/develop",
"path": "docs/etcdb.execute.rst",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Makefile",
"bytes": "2961"
},
{
"name": "Pascal",
"bytes": "43"
},
{
"name": "Puppet",
"bytes": "2986"
},
{
"name": "Python",
"bytes": "226169"
},
{
"name": "Ruby",
"bytes": "1610"
},
{
"name": "Shell",
"bytes": "750"
}
]
}
|
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>mathcomp-real-closed: Not compatible</title>
<link rel="shortcut icon" type="image/png" href="../../../../../favicon.png" />
<link href="../../../../../bootstrap.min.css" rel="stylesheet">
<link href="../../../../../bootstrap-custom.css" rel="stylesheet">
<link href="//maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css" rel="stylesheet">
<script src="../../../../../moment.min.js"></script>
<!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
<!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
<![endif]-->
</head>
<body>
<div class="container">
<div class="navbar navbar-default" role="navigation">
<div class="container-fluid">
<div class="navbar-header">
<a class="navbar-brand" href="../../../../.."><i class="fa fa-lg fa-flag-checkered"></i> Coq bench</a>
</div>
<div id="navbar" class="collapse navbar-collapse">
<ul class="nav navbar-nav">
<li><a href="../..">clean / released</a></li>
<li class="active"><a href="">8.12.0 / mathcomp-real-closed - 1.0.3</a></li>
</ul>
</div>
</div>
</div>
<div class="article">
<div class="row">
<div class="col-md-12">
<a href="../..">« Up</a>
<h1>
mathcomp-real-closed
<small>
1.0.3
<span class="label label-info">Not compatible</span>
</small>
</h1>
<p><em><script>document.write(moment("2021-04-10 01:03:28 +0000", "YYYY-MM-DD HH:mm:ss Z").fromNow());</script> (2021-04-10 01:03:28 UTC)</em><p>
<h2>Context</h2>
<pre># Packages matching: installed
# Name # Installed # Synopsis
base-bigarray base
base-threads base
base-unix base
conf-findutils 1 Virtual package relying on findutils
coq 8.12.0 Formal proof management system
num 1.4 The legacy Num library for arbitrary-precision integer and rational arithmetic
ocaml 4.11.1 The OCaml compiler (virtual package)
ocaml-base-compiler 4.11.1 Official release 4.11.1
ocaml-config 1 OCaml Switch Configuration
ocamlfind 1.9.1 A library manager for OCaml
# opam file:
opam-version: "2.0"
name: "coq-mathcomp-real-closed"
maintainer: "Mathematical Components <mathcomp-dev@sympa.inria.fr>"
homepage: "https://github.com/math-comp/real-closed"
bug-reports: "https://github.com/math-comp/real-closed/issues"
dev-repo: "git+https://github.com/math-comp/real-closed.git"
license: "CeCILL-B"
build: [ make "-j" "%{jobs}%" ]
install: [ make "install" ]
depends: [
"coq" { (>= "8.7" & < "8.11~") }
"coq-mathcomp-field" { (>= "1.8.0" & < "1.10.0~") }
"coq-mathcomp-bigenough" {(>= "1.0.0" & < "1.1.0~")}
]
tags: [ "keyword:real closed field" "keyword:small scale reflection" "keyword:mathematical components" "date:2019-05-23" "logpath:mathcomp.real_closed"]
authors: [ "Cyril Cohen <>" "Assia Mahboubi <>" ]
synopsis: "Mathematical Components Library on real closed fields"
description: """
This library contains definitions and theorems about real closed
fields, with a construction of the real closure and the algebraic
closure (including a proof of the fundamental theorem of algebra). It
also contains a proof of decidability of the first order theory of
real closed field, through quantifier elimination.
"""
url {
src: "https://github.com/math-comp/real-closed/archive/1.0.3.tar.gz"
checksum: "sha256=22a8f7d0a439c96b0ac0d722258f30aef223bc0f21c0974c6af16ce33ddfe51b"
}
</pre>
<h2>Lint</h2>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>true</code></dd>
<dt>Return code</dt>
<dd>0</dd>
</dl>
<h2>Dry install</h2>
<p>Dry install with the current Coq version:</p>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>opam install -y --show-action coq-mathcomp-real-closed.1.0.3 coq.8.12.0</code></dd>
<dt>Return code</dt>
<dd>5120</dd>
<dt>Output</dt>
<dd><pre>[NOTE] Package coq is already installed (current version is 8.12.0).
The following dependencies couldn't be met:
- coq-mathcomp-real-closed -> coq < 8.11~ -> ocaml < 4.10
base of this switch (use `--unlock-base' to force)
No solution found, exiting
</pre></dd>
</dl>
<p>Dry install without Coq/switch base, to test if the problem was incompatibility with the current Coq/OCaml version:</p>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>opam remove -y coq; opam install -y --show-action --unlock-base coq-mathcomp-real-closed.1.0.3</code></dd>
<dt>Return code</dt>
<dd>0</dd>
</dl>
<h2>Install dependencies</h2>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>true</code></dd>
<dt>Return code</dt>
<dd>0</dd>
<dt>Duration</dt>
<dd>0 s</dd>
</dl>
<h2>Install</h2>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>true</code></dd>
<dt>Return code</dt>
<dd>0</dd>
<dt>Duration</dt>
<dd>0 s</dd>
</dl>
<h2>Installation size</h2>
<p>No files were installed.</p>
<h2>Uninstall</h2>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>true</code></dd>
<dt>Return code</dt>
<dd>0</dd>
<dt>Missing removes</dt>
<dd>
none
</dd>
<dt>Wrong removes</dt>
<dd>
none
</dd>
</dl>
</div>
</div>
</div>
<hr/>
<div class="footer">
<p class="text-center">
<small>Sources are on <a href="https://github.com/coq-bench">GitHub</a>. © Guillaume Claret.</small>
</p>
</div>
</div>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<script src="../../../../../bootstrap.min.js"></script>
</body>
</html>
|
{
"content_hash": "928a4fb1b18550b81196fe1ad60a2d08",
"timestamp": "",
"source": "github",
"line_count": 166,
"max_line_length": 202,
"avg_line_length": 43.86746987951807,
"alnum_prop": 0.5561658884921725,
"repo_name": "coq-bench/coq-bench.github.io",
"id": "098dc0093713ede0241d4e20c7a25404fd982d81",
"size": "7284",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "clean/Linux-x86_64-4.11.1-2.0.7/released/8.12.0/mathcomp-real-closed/1.0.3.html",
"mode": "33188",
"license": "mit",
"language": []
}
|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Structures;
using Structures.CTStructure;
using Structures.FBStructure;
using Structures.LRStructure;
namespace LacedRing.Converter
{
public class Converter
{
public static IConverter<M> GetSpecificConverter<T, M>(T inputMesh)
where T : AbstractTriangleMesh
where M : AbstractTriangleMesh
{
//Indexed face list to laced ring
if (typeof(T) == typeof(IFLTriangleMesh) && typeof(M) == typeof(LRTriangleMesh))
{
AbstractTriangleMesh tempMesh = (AbstractTriangleMesh)inputMesh;
IflToLrConverter iflToLr = new IflToLrConverter((IFLTriangleMesh)tempMesh);
return (IConverter<M>)iflToLr;
}
//Indexed face list to corner table
else if (typeof(T) == typeof(IFLTriangleMesh) && typeof(M) == typeof(CTTriangleMesh))
{
AbstractTriangleMesh tempMesh = (AbstractTriangleMesh)inputMesh;
IflToCtConverter iflToCt = new IflToCtConverter((IFLTriangleMesh)tempMesh);
return (IConverter<M>)iflToCt;
}
throw new ArgumentException("This conversion is not possible at this point");
}
}
}
|
{
"content_hash": "8458c5c1c5c85720b3dd2c9d11e252bd",
"timestamp": "",
"source": "github",
"line_count": 39,
"max_line_length": 97,
"avg_line_length": 34.743589743589745,
"alnum_prop": 0.6413284132841328,
"repo_name": "reneweb/Laced-Ring-Tool",
"id": "5b2daf7a9791b9a6e1079ae060acb9a69b2d4d43",
"size": "1357",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "LacedRing/Converter/Converter.cs",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C#",
"bytes": "99062"
}
]
}
|
typedef struct HFONT__* HFONT;
#elif defined(OS_MACOSX)
struct CGContext;
#ifdef __OBJC__
@class NSFont;
@class NSImage;
@class NSView;
@class NSWindow;
@class NSTextField;
#else
class NSFont;
class NSImage;
class NSView;
class NSWindow;
class NSTextField;
#endif // __OBJC__
#elif defined(TOOLKIT_USES_GTK)
typedef struct _PangoFontDescription PangoFontDescription;
typedef struct _GdkCursor GdkCursor;
typedef struct _GdkPixbuf GdkPixbuf;
typedef struct _GdkRegion GdkRegion;
typedef struct _GtkWidget GtkWidget;
typedef struct _GtkWindow GtkWindow;
typedef struct _cairo cairo_t;
#endif
class SkBitmap;
namespace gfx {
#if defined(OS_WIN)
typedef HFONT NativeFont;
typedef HWND NativeView;
typedef HWND NativeWindow;
typedef HWND NativeEditView;
typedef HDC NativeDrawingContext;
typedef HCURSOR NativeCursor;
typedef HMENU NativeMenu;
typedef HRGN NativeRegion;
#elif defined(OS_MACOSX)
typedef NSFont* NativeFont;
typedef NSView* NativeView;
typedef NSWindow* NativeWindow;
typedef NSTextField* NativeEditView;
typedef CGContext* NativeDrawingContext;
typedef void* NativeCursor;
typedef void* NativeMenu;
#elif defined(USE_X11)
typedef PangoFontDescription* NativeFont;
typedef GtkWidget* NativeView;
typedef GtkWindow* NativeWindow;
typedef GtkWidget* NativeEditView;
typedef cairo_t* NativeDrawingContext;
typedef GdkCursor* NativeCursor;
typedef GtkWidget* NativeMenu;
typedef GdkRegion* NativeRegion;
#endif
#if defined(OS_MACOSX)
typedef NSImage NativeImageType;
#elif defined(OS_LINUX) && !defined(TOOLKIT_VIEWS)
typedef GdkPixbuf NativeImageType;
#else
typedef SkBitmap NativeImageType;
#endif
typedef NativeImageType* NativeImage;
// Note: for test_shell we're packing a pointer into the NativeViewId. So, if
// you make it a type which is smaller than a pointer, you have to fix
// test_shell.
//
// See comment at the top of the file for usage.
typedef intptr_t NativeViewId;
#if defined(OS_WIN)
// Convert a NativeViewId to a NativeView.
//
// On Windows, we pass an HWND into the renderer. As stated above, the renderer
// should not be performing operations on the view.
static inline NativeView NativeViewFromId(NativeViewId id) {
return reinterpret_cast<NativeView>(id);
}
#define NativeViewFromIdInBrowser(x) NativeViewFromId(x)
#elif defined(OS_POSIX)
// On Mac and Linux, a NativeView is a pointer to an object, and is useless
// outside the process in which it was created. NativeViewFromId should only be
// used inside the appropriate platform ifdef outside of the browser.
// (NativeViewFromIdInBrowser can be used everywhere in the browser.) If your
// cross-platform design involves a call to NativeViewFromId from outside the
// browser it will never work on Mac or Linux and is fundamentally broken.
// Please do not call this from outside the browser. It won't work; the name
// should give you a subtle hint.
static inline NativeView NativeViewFromIdInBrowser(NativeViewId id) {
return reinterpret_cast<NativeView>(id);
}
#endif // defined(OS_POSIX)
// Convert a NativeView to a NativeViewId. See the comments at the top of
// this file.
#if defined(OS_WIN) || defined(OS_MACOSX)
static inline NativeViewId IdFromNativeView(NativeView view) {
return reinterpret_cast<NativeViewId>(view);
}
#elif defined(USE_X11)
// Not inlined because it involves pulling too many headers.
NativeViewId IdFromNativeView(NativeView view);
#endif // defined(USE_X11)
// PluginWindowHandle is an abstraction wrapping "the types of windows
// used by NPAPI plugins". On Windows it's an HWND, on X it's an X
// window id.
#if defined(OS_WIN)
typedef HWND PluginWindowHandle;
const PluginWindowHandle kNullPluginWindow = NULL;
#elif defined(USE_X11)
typedef unsigned long PluginWindowHandle;
const PluginWindowHandle kNullPluginWindow = 0;
#else
// On OS X we don't have windowed plugins.
// We use a NULL/0 PluginWindowHandle in shared code to indicate there
// is no window present, so mirror that behavior here.
//
// The GPU plugin is currently an exception to this rule. As of this
// writing it uses some NPAPI infrastructure, and minimally we need
// to identify the plugin instance via this window handle. When the
// GPU plugin becomes a full-on GPU process, this typedef can be
// returned to a bool. For now we use a type large enough to hold a
// pointer on 64-bit architectures in case we need this capability.
typedef uint64 PluginWindowHandle;
const PluginWindowHandle kNullPluginWindow = 0;
#endif
// AcceleratedWidget provides a surface to compositors to paint pixels.
#if defined(OS_WIN)
typedef HWND AcceleratedWidget;
const AcceleratedWidget kNullAcceleratedWidget = NULL;
#elif defined(USE_X11)
typedef unsigned long AcceleratedWidget;
const AcceleratedWidget kNullAcceleratedWidget = 0;
#else
typedef void* AcceleratedWidget;
const AcceleratedWidget kNullAcceleratedWidget = NULL;
#endif
} // namespace gfx
#endif // UI_GFX_NATIVE_WIDGET_TYPES_H_
|
{
"content_hash": "a48e99c5e3c12c1c746ded165aa6c2a6",
"timestamp": "",
"source": "github",
"line_count": 148,
"max_line_length": 79,
"avg_line_length": 33.36486486486486,
"alnum_prop": 0.7841231267719725,
"repo_name": "Crystalnix/house-of-life-chromium",
"id": "ba530d9cbb16067b8c1ab4d3236d0e3b9572eea3",
"size": "6655",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "ui/gfx/native_widget_types.h",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "Assembly",
"bytes": "3418"
},
{
"name": "C",
"bytes": "88445923"
},
{
"name": "C#",
"bytes": "73756"
},
{
"name": "C++",
"bytes": "77228136"
},
{
"name": "Emacs Lisp",
"bytes": "6648"
},
{
"name": "F#",
"bytes": "381"
},
{
"name": "Go",
"bytes": "3744"
},
{
"name": "Java",
"bytes": "11354"
},
{
"name": "JavaScript",
"bytes": "6191433"
},
{
"name": "Objective-C",
"bytes": "4023654"
},
{
"name": "PHP",
"bytes": "97796"
},
{
"name": "Perl",
"bytes": "92217"
},
{
"name": "Python",
"bytes": "5604932"
},
{
"name": "Ruby",
"bytes": "937"
},
{
"name": "Shell",
"bytes": "1234672"
},
{
"name": "Tcl",
"bytes": "200213"
}
]
}
|
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>ORKChoiceQuestionResult Class Reference</title>
<link rel="stylesheet" href="../css/style.css">
<meta name="viewport" content="initial-scale=1, maximum-scale=1.4">
<meta name="generator" content="appledoc 2.2.1 (build 1334)">
</head>
<body class="appledoc">
<header>
<div class="container" class="hide-in-xcode">
<h1 id="library-title">
<a href="../index.html">ResearchKit </a>
</h1>
<p id="developer-home">
<a href="../index.html">ResearchKit</a>
</p>
</div>
</header>
<aside>
<div class="container">
<nav>
<ul id="header-buttons" role="toolbar">
<li><a href="../index.html">Index</a></li>
<li><a href="../hierarchy.html">Hierarchy</a></li>
<li id="on-this-page" role="navigation">
<label>
On This Page
<div class="chevron">
<div class="chevy chevron-left"></div>
<div class="chevy chevron-right"></div>
</div>
<select id="jump-to">
<option value="top">Jump To…</option>
<option value="overview">Overview</option>
<option value="tasks">Tasks</option>
<optgroup label="Properties">
<option value="//api/name/choiceAnswers">choiceAnswers</option>
</optgroup>
</select>
</label>
</li>
</ul>
</nav>
</div>
</aside>
<article>
<div id="overview_contents" class="container">
<div id="content">
<main role="main">
<h1 class="title">ORKChoiceQuestionResult Class Reference</h1>
<div class="section section-specification"><table cellspacing="0"><tbody>
<tr>
<th>Inherits from</th>
<td><a href="../Classes/ORKQuestionResult.html">ORKQuestionResult</a> : <a href="../Classes/ORKResult.html">ORKResult</a> : NSObject</td>
</tr><tr>
<th>Declared in</th>
<td>ORKQuestionResult.h<br />ORKQuestionResult.m</td>
</tr>
</tbody></table></div>
<div class="section section-overview">
<a title="Overview" name="overview"></a>
<h2 class="subtitle subtitle-overview">Overview</h2>
<p>The <code>ORKChoiceQuestionResult</code> class represents the single or multiple choice
answers from a choice-based answer format.</p>
<p>For example, an <a href="../Classes/ORKTextChoiceAnswerFormat.html"><code>ORKTextChoiceAnswerFormat</code></a> or an <a href="../Classes/ORKImageChoiceAnswerFormat.html"><code>ORKImageChoiceAnswerFormat</code></a>
format produces an <code>ORKChoiceQuestionResult</code> object.</p>
<p>A choice question result is typically generated by the framework as the task proceeds. When the task
completes, it may be appropriate to serialize it for transmission to a server,
or to immediately perform analysis on it.</p>
</div>
<div class="section section-tasks">
<a title="Tasks" name="tasks"></a>
<div class="task-list">
<div class="section-method">
<a name="//api/name/choiceAnswers" title="choiceAnswers"></a>
<h3 class="method-title"><code><a href="#//api/name/choiceAnswers"> choiceAnswers</a></code>
</h3>
<div class="method-info">
<div class="pointy-thing"></div>
<div class="method-info-container">
<div class="method-subsection brief-description">
<p>An array of selected values, from the <code>value</code> property of an <a href="../Classes/ORKTextChoice.html"><code>ORKTextChoice</code></a> or <a href="../Classes/ORKImageChoice.html"><code>ORKImageChoice</code></a> object.
In the case of a single choice, the array has exactly one entry.</p>
</div>
<div class="method-subsection method-declaration"><code>@property (nonatomic, copy, nullable) NSArray *choiceAnswers</code></div>
<div class="method-subsection discussion-section">
<h4 class="method-subtitle">Discussion</h4>
<p>If the user skipped the question, the value of the corresponding array member is <code>nil</code>.</p>
</div>
<div class="method-subsection declared-in-section">
<h4 class="method-subtitle">Declared In</h4>
<p><code class="declared-in-ref">ORKQuestionResult.h</code></p>
</div>
</div>
</div>
</div>
</div>
</div>
</main>
<footer>
<div class="footer-copyright">
<p class="copyright">Copyright © 2018 ResearchKit. All rights reserved. Updated: 2018-07-23</p>
<p class="generator">Generated by <a href="http://appledoc.gentlebytes.com">appledoc 2.2.1 (build 1334)</a>.</p>
</div>
</footer>
</div>
</div>
</article>
<script src="../js/script.js"></script>
</body>
</html>
|
{
"content_hash": "8c15a090df3e9f5470de0405fcf8f8a5",
"timestamp": "",
"source": "github",
"line_count": 197,
"max_line_length": 233,
"avg_line_length": 24.20304568527919,
"alnum_prop": 0.6191275167785235,
"repo_name": "jeremiahyan/ResearchKit",
"id": "8feb2ad39e77c34f28f59d88bdf5ec41226570ce",
"size": "4768",
"binary": false,
"copies": "6",
"ref": "refs/heads/main",
"path": "docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKChoiceQuestionResult.html",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "Objective-C",
"bytes": "3281362"
},
{
"name": "Python",
"bytes": "7008"
},
{
"name": "Ruby",
"bytes": "3907"
},
{
"name": "Swift",
"bytes": "17493"
}
]
}
|
package com.google.maps.internal;
import com.google.gson.TypeAdapter;
import com.google.gson.stream.JsonReader;
import com.google.gson.stream.JsonToken;
import com.google.gson.stream.JsonWriter;
import com.google.maps.GeolocationApi;
import java.io.IOException;
public class GeolocationResponseAdapter extends TypeAdapter<GeolocationApi.Response> {
/**
* Reads in a JSON object to create a Geolocation Response. See:
* https://developers.google.com/maps/documentation/geolocation/intro#responses
*
* <p>Success Case:
*
* <pre>
* {
* "location": {
* "lat": 51.0,
* "lng": -0.1
* },
* "accuracy": 1200.4
* }
* </pre>
*
* Error Case: The response contains an object with a single error object with the following keys:
*
* <p>code: This is the same as the HTTP status of the response. {@code message}: A short
* description of the error. {@code errors}: A list of errors which occurred. Each error contains
* an identifier for the type of error (the reason) and a short description (the message). For
* example, sending invalid JSON will return the following error:
*
* <pre>
* {
* "error": {
* "errors": [ {
* "domain": "geolocation",
* "reason": "notFound",
* "message": "Not Found",
* "debugInfo": "status: ZERO_RESULTS\ncom.google.api.server.core.Fault: Immu...
* }],
* "code": 404,
* "message": "Not Found"
* }
* }
* </pre>
*/
@Override
public GeolocationApi.Response read(JsonReader reader) throws IOException {
if (reader.peek() == JsonToken.NULL) {
reader.nextNull();
return null;
}
GeolocationApi.Response response = new GeolocationApi.Response();
LatLngAdapter latLngAdapter = new LatLngAdapter();
reader.beginObject(); // opening {
while (reader.hasNext()) {
String name = reader.nextName();
// two different objects could be returned a success object containing "location" and
// "accuracy" keys or an error object containing an "error" key
if (name.equals("location")) {
// we already have a parser for the LatLng object so lets use that
response.location = latLngAdapter.read(reader);
} else if (name.equals("accuracy")) {
response.accuracy = reader.nextDouble();
} else if (name.equals("error")) {
reader.beginObject(); // the error key leads to another object...
while (reader.hasNext()) {
String errName = reader.nextName();
// ...with keys "errors", "code" and "message"
if (errName.equals("code")) {
response.code = reader.nextInt();
} else if (errName.equals("message")) {
response.message = reader.nextString();
} else if (errName.equals("errors")) {
reader.beginArray(); // its plural because its an array of errors...
while (reader.hasNext()) {
reader.beginObject(); // ...and each error array element is an object...
while (reader.hasNext()) {
errName = reader.nextName();
// ...with keys "reason", "domain", "debugInfo", "location", "locationType", and
// "message" (again)
if (errName.equals("reason")) {
response.reason = reader.nextString();
} else if (errName.equals("domain")) {
response.domain = reader.nextString();
} else if (errName.equals("debugInfo")) {
response.debugInfo = reader.nextString();
} else if (errName.equals("message")) {
// have this already
reader.nextString();
} else if (errName.equals("location")) {
reader.nextString();
} else if (errName.equals("locationType")) {
reader.nextString();
}
}
reader.endObject();
}
reader.endArray();
}
}
reader.endObject(); // closing }
}
}
reader.endObject();
return response;
}
/** Not supported. */
@Override
public void write(JsonWriter out, GeolocationApi.Response value) throws IOException {
throw new UnsupportedOperationException("Unimplemented method.");
}
}
|
{
"content_hash": "495fb12f9810ebcea892442895609089",
"timestamp": "",
"source": "github",
"line_count": 120,
"max_line_length": 100,
"avg_line_length": 36.78333333333333,
"alnum_prop": 0.5754417761667422,
"repo_name": "domesticmouse/google-maps-services-java",
"id": "5102a4c0d60c7d190be2f775364bc8634ffdefbf",
"size": "5026",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "src/main/java/com/google/maps/internal/GeolocationResponseAdapter.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Java",
"bytes": "674174"
}
]
}
|
FROM ericdfournier/corridor:latest
MAINTAINER Eric D Fournier: me@ericdfournier.com
WORKDIR /go/src/github.com/ericdfournier/corridor/problems/SantaBarbara
RUN go get -u github.com/ericdfournier.com/corridor
RUN go run santaBarbara.go
|
{
"content_hash": "3416468d4060e656aa44eef3b397e5d2",
"timestamp": "",
"source": "github",
"line_count": 6,
"max_line_length": 71,
"avg_line_length": 39.166666666666664,
"alnum_prop": 0.8425531914893617,
"repo_name": "ericdfournier/corridor",
"id": "288e795b67994c889b2c6b8ce6d21796ea5bfcb9",
"size": "437",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "problems/SantaBarbara/Dockerfile",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "Go",
"bytes": "130511"
}
]
}
|
import tornado.ioloop
import tornado.web
import User
games = []
users = []
class StaticHandler(tornado.web.RequestHandler):
def get(self):
self.render(self.request.uri[1:])
class TemplateHandler(tornado.web.RequestHandler):
def get(self):
global users
user = None
if not self.get_secure_cookie("user"):
user = User.User()
self.set_secure_cookie("user",user.identifier)
users.append(user)
else:
identifier = self.get_secure_cookie("user")
for u in users:
if u.identifier == identifier:
user=u
break
if user == None:
user = User.User()
self.set_secure_cookie("user",user.identifier)
users.append(user)
print(users)
self.render("templates"+self.request.uri)
class MoveHandler(tornado.web.RequestHandler):
def post(self):
#import ipdb;ipdb.set_trace()
self.write(str(self.request.arguments))
handlers = [
(r"/static/.*", StaticHandler),
(r"/submit/move", MoveHandler),
(r"/.*", TemplateHandler)
]
application = tornado.web.Application(handlers, debug=True, cookie_secret = "WE NEED A COOKIE SECRET KEY FOR THIS TO WORK")
application.listen(8888)
tornado.ioloop.IOLoop.instance().start()
|
{
"content_hash": "2d27f57efea3a500bb8b65afbe4fc8e3",
"timestamp": "",
"source": "github",
"line_count": 48,
"max_line_length": 123,
"avg_line_length": 28.708333333333332,
"alnum_prop": 0.5914368650217707,
"repo_name": "analogbit/barbatus",
"id": "692b8ff42ce4a1cf9f2a6b792d214f1060cbdb94",
"size": "1378",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "barbatus.py",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Python",
"bytes": "2074"
}
]
}
|
using System;
using System.Diagnostics;
using xFaceLib.Util;
namespace xFaceLib.Log
{
/// <summary>
/// ÌṩÁËXLogµÄĬÈÏlistener£¬·½±ãµ÷ÊÔ£¬Ïòconsole»òÕß
/// VS outputÊä³ölogÐÅÏ¢
/// </summary>
public class XDebugLogListener : XLogListener
{
public override void LogVerbose(String log)
{
Debug.WriteLine("Verbose: " + log);
WirteToFile("Verbose: " + log);
}
public override void LogInfo(String log)
{
Debug.WriteLine("Info: " + log);
WirteToFile("Info: " + log);
}
public override void LogWarn(String log)
{
Debug.WriteLine("Warn: " + log);
WirteToFile("Warn: " + log);
}
public override void LogDebug(String log)
{
Debug.WriteLine("Debug: " + log);
WirteToFile("Debug: " + log);
}
public override void LogError(String log)
{
Debug.WriteLine("Error: " + log);
WirteToFile("Error: " + log);
}
int position = 0;
private void WirteToFile(string log)
{
log = log + "\n";
XFile file = new XFile();
XFile.ErrorCode errCode = null;
file.Write("log.txt", log, position, out errCode);
position += log.Length;
}
}
}
|
{
"content_hash": "bfae29429b067c811f96f7199d540ab7",
"timestamp": "",
"source": "github",
"line_count": 51,
"max_line_length": 62,
"avg_line_length": 26.96078431372549,
"alnum_prop": 0.5134545454545455,
"repo_name": "polyvi/xface-wp8",
"id": "7879193f55673337d82fb343648c0f4d824b3eea",
"size": "1375",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "xFaceLib/xFaceLib/Log/XDebugLogListener.cs",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "C#",
"bytes": "1002584"
},
{
"name": "CSS",
"bytes": "7438"
},
{
"name": "JavaScript",
"bytes": "78082"
},
{
"name": "Shell",
"bytes": "11892"
}
]
}
|
using System;
using System.Linq;
using System.Net;
using System.Threading.Tasks;
using KeeAnywhere.Backup;
using KeeAnywhere.Configuration;
using KeeAnywhere.Offline;
using KeeAnywhere.WebRequest;
using KeePassLib.Serialization;
namespace KeeAnywhere.StorageProviders
{
public class StorageService: IWebRequestCreate
{
private readonly ConfigurationService _configService;
private readonly CacheManagerService _cacheManagerService;
public StorageService(ConfigurationService configService, CacheManagerService cacheManagerService)
{
if (configService == null) throw new ArgumentNullException("configService");
if (cacheManagerService == null) throw new ArgumentNullException("cacheManagerService");
_configService = configService;
_cacheManagerService = cacheManagerService;
}
public IStorageProvider GetProviderByUri(StorageUri uri)
{
var descriptor = StorageRegistry.Descriptors.FirstOrDefault(_ => _.Scheme == uri.Scheme);
if (descriptor == null)
throw new NotImplementedException(string.Format("A provider for scheme '{0}' is not implemented.",
uri.Scheme));
var accountName = uri.GetAccountName();
var account = _configService.FindAccount(descriptor.Type, accountName);
if (account == null)
throw new InvalidOperationException(string.Format("Account '{0}' for type '{1}' not found.", accountName, descriptor.Type));
var provider = descriptor.ProviderFactory(account);
return provider;
}
public IStorageProvider GetProviderByUri(string uriString)
{
var uri = new StorageUri(uriString);
return GetProviderByUri(uri);
}
public IStorageProvider GetProviderByAccount(AccountConfiguration account)
{
if (account == null) throw new ArgumentNullException("account");
var descriptor = StorageRegistry.Descriptors.FirstOrDefault(_ => _.Type == account.Type);
if (descriptor == null)
throw new NotImplementedException(string.Format("A provider for type '{0}' is not implemented.",
account.Type));
var provider = descriptor.ProviderFactory(account);
return provider;
}
public async Task<AccountConfiguration> CreateAccount(StorageType type)
{
var descriptor = StorageRegistry.Descriptors.FirstOrDefault(_ => _.Type == type);
if (descriptor == null)
throw new NotImplementedException(string.Format("A provider for type '{0}' is not implemented.", type));
var configurator = descriptor.ConfiguratorFactory();
var account = await configurator.CreateAccount();
return account;
}
public System.Net.WebRequest Create(Uri uri)
{
var providerUri = new StorageUri(uri);
var provider = this.GetProviderByUri(providerUri);
// Pipeline: Backup => Cache => Basic Provider
if (_configService.PluginConfiguration.IsOfflineCacheEnabled)
{
provider = _cacheManagerService.WrapInCacheProvider(provider, uri);
}
if (_configService.PluginConfiguration.IsBackupToLocalEnabled ||
_configService.PluginConfiguration.IsBackupToRemoteEnabled)
{
provider = BackupProvider.WrapInBackupProvider(provider, providerUri, _configService);
}
var itemPath = providerUri.GetPath();
return new KeeAnywhereWebRequest(provider, itemPath);
}
public void RegisterPrefixes()
{
foreach (var descriptor in StorageRegistry.Descriptors)
{
FileTransactionEx.Configure(descriptor.Scheme, false);
System.Net.WebRequest.RegisterPrefix(descriptor.Scheme + ":", this);
}
}
}
}
|
{
"content_hash": "402e1f82adddb7e1518879eb8a4a262d",
"timestamp": "",
"source": "github",
"line_count": 110,
"max_line_length": 140,
"avg_line_length": 36.99090909090909,
"alnum_prop": 0.6372573113787171,
"repo_name": "Kyrodan/KeeAnywhere",
"id": "fb21eb025aeab81cca0d1b3f4639e1bf274e1198",
"size": "4069",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "KeeAnywhere/StorageProviders/StorageService.cs",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Batchfile",
"bytes": "1180"
},
{
"name": "C#",
"bytes": "332050"
},
{
"name": "PowerShell",
"bytes": "4718"
}
]
}
|
/* $FreeBSD: soc2013/dpl/head/sys/dev/usb/usb_compat_linux.h 198819 2009-11-01 21:48:18Z thompsa $ */
/*-
* Copyright (c) 2007 Luigi Rizzo - Universita` di Pisa. All rights reserved.
* Copyright (c) 2007 Hans Petter Selasky. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. 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.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR 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 AUTHOR 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.
*/
#ifndef _USB_COMPAT_LINUX_H
#define _USB_COMPAT_LINUX_H
struct usb_device;
struct usb_interface;
struct usb_driver;
struct urb;
typedef void *pm_message_t;
typedef void (usb_complete_t)(struct urb *);
#define USB_MAX_FULL_SPEED_ISOC_FRAMES (60 * 1)
#define USB_MAX_HIGH_SPEED_ISOC_FRAMES (60 * 8)
#define USB_DEVICE_ID_MATCH_DEVICE \
(USB_DEVICE_ID_MATCH_VENDOR | USB_DEVICE_ID_MATCH_PRODUCT)
#define USB_DEVICE(vend,prod) \
.match_flags = USB_DEVICE_ID_MATCH_DEVICE, .idVendor = (vend), \
.idProduct = (prod)
/* The "usb_driver" structure holds the Linux USB device driver
* callbacks, and a pointer to device ID's which this entry should
* match against. Usually this entry is exposed to the USB emulation
* layer using the "USB_DRIVER_EXPORT()" macro, which is defined
* below.
*/
struct usb_driver {
const char *name;
int (*probe) (struct usb_interface *intf,
const struct usb_device_id *id);
void (*disconnect) (struct usb_interface *intf);
int (*ioctl) (struct usb_interface *intf, unsigned int code,
void *buf);
int (*suspend) (struct usb_interface *intf, pm_message_t message);
int (*resume) (struct usb_interface *intf);
const struct usb_device_id *id_table;
void (*shutdown) (struct usb_interface *intf);
LIST_ENTRY(usb_driver) linux_driver_list;
};
#define USB_DRIVER_EXPORT(id,p_usb_drv) \
SYSINIT(id,SI_SUB_KLD,SI_ORDER_FIRST,usb_linux_register,p_usb_drv); \
SYSUNINIT(id,SI_SUB_KLD,SI_ORDER_ANY,usb_linux_deregister,p_usb_drv)
#define USB_DT_ENDPOINT_SIZE 7
#define USB_DT_ENDPOINT_AUDIO_SIZE 9
/*
* Endpoints
*/
#define USB_ENDPOINT_NUMBER_MASK 0x0f /* in bEndpointAddress */
#define USB_ENDPOINT_DIR_MASK 0x80
#define USB_ENDPOINT_XFERTYPE_MASK 0x03 /* in bmAttributes */
#define USB_ENDPOINT_XFER_CONTROL 0
#define USB_ENDPOINT_XFER_ISOC 1
#define USB_ENDPOINT_XFER_BULK 2
#define USB_ENDPOINT_XFER_INT 3
#define USB_ENDPOINT_MAX_ADJUSTABLE 0x80
/* CONTROL REQUEST SUPPORT */
/*
* Definition of direction mask for
* "bEndpointAddress" and "bmRequestType":
*/
#define USB_DIR_MASK 0x80
#define USB_DIR_OUT 0x00 /* write to USB device */
#define USB_DIR_IN 0x80 /* read from USB device */
/*
* Definition of type mask for
* "bmRequestType":
*/
#define USB_TYPE_MASK (0x03 << 5)
#define USB_TYPE_STANDARD (0x00 << 5)
#define USB_TYPE_CLASS (0x01 << 5)
#define USB_TYPE_VENDOR (0x02 << 5)
#define USB_TYPE_RESERVED (0x03 << 5)
/*
* Definition of receiver mask for
* "bmRequestType":
*/
#define USB_RECIP_MASK 0x1f
#define USB_RECIP_DEVICE 0x00
#define USB_RECIP_INTERFACE 0x01
#define USB_RECIP_ENDPOINT 0x02
#define USB_RECIP_OTHER 0x03
/*
* Definition of standard request values for
* "bRequest":
*/
#define USB_REQ_GET_STATUS 0x00
#define USB_REQ_CLEAR_FEATURE 0x01
#define USB_REQ_SET_FEATURE 0x03
#define USB_REQ_SET_ADDRESS 0x05
#define USB_REQ_GET_DESCRIPTOR 0x06
#define USB_REQ_SET_DESCRIPTOR 0x07
#define USB_REQ_GET_CONFIGURATION 0x08
#define USB_REQ_SET_CONFIGURATION 0x09
#define USB_REQ_GET_INTERFACE 0x0A
#define USB_REQ_SET_INTERFACE 0x0B
#define USB_REQ_SYNCH_FRAME 0x0C
#define USB_REQ_SET_ENCRYPTION 0x0D /* Wireless USB */
#define USB_REQ_GET_ENCRYPTION 0x0E
#define USB_REQ_SET_HANDSHAKE 0x0F
#define USB_REQ_GET_HANDSHAKE 0x10
#define USB_REQ_SET_CONNECTION 0x11
#define USB_REQ_SET_SECURITY_DATA 0x12
#define USB_REQ_GET_SECURITY_DATA 0x13
#define USB_REQ_SET_WUSB_DATA 0x14
#define USB_REQ_LOOPBACK_DATA_WRITE 0x15
#define USB_REQ_LOOPBACK_DATA_READ 0x16
#define USB_REQ_SET_INTERFACE_DS 0x17
/*
* USB feature flags are written using USB_REQ_{CLEAR,SET}_FEATURE, and
* are read as a bit array returned by USB_REQ_GET_STATUS. (So there
* are at most sixteen features of each type.)
*/
#define USB_DEVICE_SELF_POWERED 0 /* (read only) */
#define USB_DEVICE_REMOTE_WAKEUP 1 /* dev may initiate wakeup */
#define USB_DEVICE_TEST_MODE 2 /* (wired high speed only) */
#define USB_DEVICE_BATTERY 2 /* (wireless) */
#define USB_DEVICE_B_HNP_ENABLE 3 /* (otg) dev may initiate HNP */
#define USB_DEVICE_WUSB_DEVICE 3 /* (wireless) */
#define USB_DEVICE_A_HNP_SUPPORT 4 /* (otg) RH port supports HNP */
#define USB_DEVICE_A_ALT_HNP_SUPPORT 5 /* (otg) other RH port does */
#define USB_DEVICE_DEBUG_MODE 6 /* (special devices only) */
#define USB_ENDPOINT_HALT 0 /* IN/OUT will STALL */
#define PIPE_ISOCHRONOUS 0x01 /* UE_ISOCHRONOUS */
#define PIPE_INTERRUPT 0x03 /* UE_INTERRUPT */
#define PIPE_CONTROL 0x00 /* UE_CONTROL */
#define PIPE_BULK 0x02 /* UE_BULK */
/* Whenever Linux references an USB endpoint:
* a) to initialize "urb->endpoint"
* b) second argument passed to "usb_control_msg()"
*
* Then it uses one of the following macros. The "endpoint" argument
* is the physical endpoint value masked by 0xF. The "dev" argument
* is a pointer to "struct usb_device".
*/
#define usb_sndctrlpipe(dev,endpoint) \
usb_find_host_endpoint(dev, PIPE_CONTROL, (endpoint) | USB_DIR_OUT)
#define usb_rcvctrlpipe(dev,endpoint) \
usb_find_host_endpoint(dev, PIPE_CONTROL, (endpoint) | USB_DIR_IN)
#define usb_sndisocpipe(dev,endpoint) \
usb_find_host_endpoint(dev, PIPE_ISOCHRONOUS, (endpoint) | USB_DIR_OUT)
#define usb_rcvisocpipe(dev,endpoint) \
usb_find_host_endpoint(dev, PIPE_ISOCHRONOUS, (endpoint) | USB_DIR_IN)
#define usb_sndbulkpipe(dev,endpoint) \
usb_find_host_endpoint(dev, PIPE_BULK, (endpoint) | USB_DIR_OUT)
#define usb_rcvbulkpipe(dev,endpoint) \
usb_find_host_endpoint(dev, PIPE_BULK, (endpoint) | USB_DIR_IN)
#define usb_sndintpipe(dev,endpoint) \
usb_find_host_endpoint(dev, PIPE_INTERRUPT, (endpoint) | USB_DIR_OUT)
#define usb_rcvintpipe(dev,endpoint) \
usb_find_host_endpoint(dev, PIPE_INTERRUPT, (endpoint) | USB_DIR_IN)
/*
* The following structure is used to extend "struct urb" when we are
* dealing with an isochronous endpoint. It contains information about
* the data offset and data length of an isochronous packet.
* The "actual_length" field is updated before the "complete"
* callback in the "urb" structure is called.
*/
struct usb_iso_packet_descriptor {
uint32_t offset; /* depreciated buffer offset (the
* packets are usually back to back) */
uint16_t length; /* expected length */
uint16_t actual_length;
int16_t status; /* transfer status */
};
/*
* The following structure holds various information about an USB
* transfer. This structure is used for all kinds of USB transfers.
*
* URB is short for USB Request Block.
*/
struct urb {
TAILQ_ENTRY(urb) bsd_urb_list;
struct cv cv_wait;
struct usb_device *dev; /* (in) pointer to associated device */
struct usb_host_endpoint *endpoint; /* (in) pipe pointer */
uint8_t *setup_packet; /* (in) setup packet (control only) */
uint8_t *bsd_data_ptr;
void *transfer_buffer; /* (in) associated data buffer */
void *context; /* (in) context for completion */
usb_complete_t *complete; /* (in) completion routine */
usb_size_t transfer_buffer_length;/* (in) data buffer length */
usb_size_t bsd_length_rem;
usb_size_t actual_length; /* (return) actual transfer length */
usb_timeout_t timeout; /* FreeBSD specific */
uint16_t transfer_flags; /* (in) */
#define URB_SHORT_NOT_OK 0x0001 /* report short transfers like errors */
#define URB_ISO_ASAP 0x0002 /* ignore "start_frame" field */
#define URB_ZERO_PACKET 0x0004 /* the USB transfer ends with a short
* packet */
#define URB_NO_TRANSFER_DMA_MAP 0x0008 /* "transfer_dma" is valid on submit */
#define URB_WAIT_WAKEUP 0x0010 /* custom flags */
#define URB_IS_SLEEPING 0x0020 /* custom flags */
usb_frcount_t start_frame; /* (modify) start frame (ISO) */
usb_frcount_t number_of_packets; /* (in) number of ISO packets */
uint16_t interval; /* (modify) transfer interval
* (INT/ISO) */
uint16_t error_count; /* (return) number of ISO errors */
int16_t status; /* (return) status */
uint8_t setup_dma; /* (in) not used on FreeBSD */
uint8_t transfer_dma; /* (in) not used on FreeBSD */
uint8_t bsd_isread;
uint8_t kill_count; /* FreeBSD specific */
struct usb_iso_packet_descriptor iso_frame_desc[]; /* (in) ISO ONLY */
};
/* various prototypes */
int usb_submit_urb(struct urb *urb, uint16_t mem_flags);
int usb_unlink_urb(struct urb *urb);
int usb_clear_halt(struct usb_device *dev, struct usb_host_endpoint *uhe);
int usb_control_msg(struct usb_device *dev, struct usb_host_endpoint *ep,
uint8_t request, uint8_t requesttype, uint16_t value,
uint16_t index, void *data, uint16_t size, usb_timeout_t timeout);
int usb_set_interface(struct usb_device *dev, uint8_t ifnum,
uint8_t alternate);
int usb_setup_endpoint(struct usb_device *dev,
struct usb_host_endpoint *uhe, usb_frlength_t bufsize);
struct usb_host_endpoint *usb_find_host_endpoint(struct usb_device *dev,
uint8_t type, uint8_t ep);
struct urb *usb_alloc_urb(uint16_t iso_packets, uint16_t mem_flags);
struct usb_host_interface *usb_altnum_to_altsetting(
const struct usb_interface *intf, uint8_t alt_index);
struct usb_interface *usb_ifnum_to_if(struct usb_device *dev, uint8_t iface_no);
void *usb_buffer_alloc(struct usb_device *dev, usb_size_t size,
uint16_t mem_flags, uint8_t *dma_addr);
void *usbd_get_intfdata(struct usb_interface *intf);
void usb_buffer_free(struct usb_device *dev, usb_size_t size, void *addr, uint8_t dma_addr);
void usb_free_urb(struct urb *urb);
void usb_init_urb(struct urb *urb);
void usb_kill_urb(struct urb *urb);
void usb_set_intfdata(struct usb_interface *intf, void *data);
void usb_linux_register(void *arg);
void usb_linux_deregister(void *arg);
void usb_fill_bulk_urb(struct urb *, struct usb_device *,
struct usb_host_endpoint *, void *, int, usb_complete_t, void *);
int usb_bulk_msg(struct usb_device *, struct usb_host_endpoint *,
void *, int, uint16_t *, usb_timeout_t);
#define interface_to_usbdev(intf) (intf)->linux_udev
#define interface_to_bsddev(intf) (intf)->linux_udev
#endif /* _USB_COMPAT_LINUX_H */
|
{
"content_hash": "81321233a19595b7ff65ac61d9d229d6",
"timestamp": "",
"source": "github",
"line_count": 310,
"max_line_length": 101,
"avg_line_length": 37.24516129032258,
"alnum_prop": 0.7159189329637969,
"repo_name": "dplbsd/zcaplib",
"id": "bd4fc4a351d75f6f5913309894227abd5eadaaf6",
"size": "11546",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "head/sys/dev/usb/usb_compat_linux.h",
"mode": "33188",
"license": "bsd-2-clause",
"language": [
{
"name": "AGS Script",
"bytes": "62471"
},
{
"name": "Assembly",
"bytes": "4478661"
},
{
"name": "Awk",
"bytes": "278525"
},
{
"name": "Batchfile",
"bytes": "20417"
},
{
"name": "C",
"bytes": "383420305"
},
{
"name": "C++",
"bytes": "72796771"
},
{
"name": "CSS",
"bytes": "109748"
},
{
"name": "ChucK",
"bytes": "39"
},
{
"name": "D",
"bytes": "3784"
},
{
"name": "DIGITAL Command Language",
"bytes": "10640"
},
{
"name": "DTrace",
"bytes": "2311027"
},
{
"name": "Emacs Lisp",
"bytes": "65902"
},
{
"name": "EmberScript",
"bytes": "286"
},
{
"name": "Forth",
"bytes": "184405"
},
{
"name": "GAP",
"bytes": "72156"
},
{
"name": "Groff",
"bytes": "32248806"
},
{
"name": "HTML",
"bytes": "6749816"
},
{
"name": "IGOR Pro",
"bytes": "6301"
},
{
"name": "Java",
"bytes": "112547"
},
{
"name": "KRL",
"bytes": "4950"
},
{
"name": "Lex",
"bytes": "398817"
},
{
"name": "Limbo",
"bytes": "3583"
},
{
"name": "Logos",
"bytes": "187900"
},
{
"name": "Makefile",
"bytes": "3551839"
},
{
"name": "Mathematica",
"bytes": "9556"
},
{
"name": "Max",
"bytes": "4178"
},
{
"name": "Module Management System",
"bytes": "817"
},
{
"name": "NSIS",
"bytes": "3383"
},
{
"name": "Objective-C",
"bytes": "836351"
},
{
"name": "PHP",
"bytes": "6649"
},
{
"name": "Perl",
"bytes": "5530761"
},
{
"name": "Perl6",
"bytes": "41802"
},
{
"name": "PostScript",
"bytes": "140088"
},
{
"name": "Prolog",
"bytes": "29514"
},
{
"name": "Protocol Buffer",
"bytes": "61933"
},
{
"name": "Python",
"bytes": "299247"
},
{
"name": "R",
"bytes": "764"
},
{
"name": "Rebol",
"bytes": "738"
},
{
"name": "Ruby",
"bytes": "45958"
},
{
"name": "Scilab",
"bytes": "197"
},
{
"name": "Shell",
"bytes": "10501540"
},
{
"name": "SourcePawn",
"bytes": "463194"
},
{
"name": "SuperCollider",
"bytes": "80208"
},
{
"name": "Tcl",
"bytes": "80913"
},
{
"name": "TeX",
"bytes": "719821"
},
{
"name": "VimL",
"bytes": "22201"
},
{
"name": "XS",
"bytes": "25451"
},
{
"name": "XSLT",
"bytes": "31488"
},
{
"name": "Yacc",
"bytes": "1857830"
}
]
}
|
require 'spec_helper'
class FakeController < ApplicationController
include Spree::Core::ControllerHelpers::PaymentParameters
end
describe Spree::Core::ControllerHelpers::PaymentParameters, type: :controller do
controller(FakeController) {}
describe '#move_payment_source_into_payments_attributes' do
subject do
controller.move_payment_source_into_payments_attributes(params)
end
let(:params) do
ActionController::Parameters.new(
payment_source: {
payment_method_1.id.to_s => credit_card_1_params,
payment_method_2.id.to_s => credit_card_2_params
},
order: {
payments_attributes: [
{
payment_method_id: payment_method_1.id.to_s
}
],
other_order_param: 1
},
other_param: 2
)
end
let(:payment_method_1) { create(:credit_card_payment_method) }
let(:payment_method_2) { create(:credit_card_payment_method) }
let(:credit_card_1_params) { attributes_for(:credit_card, name: 'Jordan1') }
let(:credit_card_2_params) { attributes_for(:credit_card, name: 'Jordan2') }
it 'produces the expected hash' do
expect(subject).to eq(
ActionController::Parameters.new(
order: {
payments_attributes: [
{
payment_method_id: payment_method_1.id.to_s,
source_attributes: credit_card_1_params
}
],
other_order_param: 1
},
other_param: 2
)
)
end
context 'when payment_source is missing' do
before { params.delete(:payment_source) }
it('returns the original hash') { expect(subject).to eq(params) }
end
context 'when order params are missing' do
before { params.delete(:order) }
it('returns the original hash') { expect(subject).to eq(params) }
end
context 'when payment_attributes are missing' do
before { params[:order].delete(:payments_attributes) }
it('returns the original hash') { expect(subject).to eq(params) }
end
context 'when the payment_method_id is missing' do
before { params[:order][:payments_attributes][0].delete(:payment_method_id) }
it('returns the original hash') { expect(subject).to eq(params) }
end
context 'when the payment_method_id does not match a payments source' do
before { params[:order][:payments_attributes][0][:payment_method_id] = -1 }
it('returns the original hash') { expect(subject).to eq(params) }
end
end
describe '#move_existing_card_into_payments_attributes' do
subject do
controller.move_existing_card_into_payments_attributes(params)
end
let(:params) do
ActionController::Parameters.new(
order: {
existing_card: '123',
other_order_param: 1
},
cvc_confirm: '456',
other_param: 2
)
end
it 'produces the expected hash' do
expect(subject).to eq(
ActionController::Parameters.new(
order: {
payments_attributes: [
{
source_attributes: {
existing_card_id: '123',
verification_value: '456'
}
}
],
other_order_param: 1
},
other_param: 2
)
)
end
context 'when cvc_confirm is missing' do
before { params.delete(:cvc_confirm) }
it 'produces the expected hash' do
expect(subject).to eq(
ActionController::Parameters.new(
order: {
payments_attributes: [
{
source_attributes: {
existing_card_id: '123',
verification_value: nil
}
}
],
other_order_param: 1
},
other_param: 2
)
)
end
end
context 'when order params are missing' do
before { params.delete(:order) }
it('returns the original hash') { expect(subject).to eq(params) }
end
context 'when existing_card is missing' do
before { params[:order].delete(:existing_card) }
it('returns the original hash') { expect(subject).to eq(params) }
end
end
describe '#set_payment_parameters_amount' do
subject do
controller.set_payment_parameters_amount(params, order)
end
let(:params) do
ActionController::Parameters.new(
order: {
payments_attributes: [{}],
other_order_param: 1
},
other_param: 2
)
end
let(:order) { create(:order_with_line_items, line_items_price: 101.00, line_items_count: 1, shipment_cost: 0) }
it 'produces the expected hash' do
expect(subject).to eq(
ActionController::Parameters.new(
order: {
payments_attributes: [{ amount: 101 }],
other_order_param: 1
},
other_param: 2
)
)
end
end
end
|
{
"content_hash": "98210687916f774a098aa53c2fea5fa1",
"timestamp": "",
"source": "github",
"line_count": 178,
"max_line_length": 115,
"avg_line_length": 28.51123595505618,
"alnum_prop": 0.563743842364532,
"repo_name": "manikkang/soligem",
"id": "35e112d474aabf69ffbaf01b86e2f8207545241c",
"size": "5075",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "core/spec/lib/spree/core/controller_helpers/payment_parameters_spec.rb",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "CSS",
"bytes": "132586"
},
{
"name": "CoffeeScript",
"bytes": "49311"
},
{
"name": "HTML",
"bytes": "465475"
},
{
"name": "JavaScript",
"bytes": "36698"
},
{
"name": "Ruby",
"bytes": "2708066"
},
{
"name": "Shell",
"bytes": "2297"
}
]
}
|
package org.treetank.axis;
import static org.treetank.data.IConstants.NULL_NODE;
import java.util.Stack;
import org.treetank.api.INodeReadTrx;
import org.treetank.data.interfaces.ITreeStructData;
/**
* <h1>DescendantAxis</h1>
*
* <p>
* Iterate over all descendants of kind ELEMENT or TEXT starting at a given node. Self is not included.
* </p>
*/
public final class DescendantAxis extends AbsAxis {
/** Stack for remembering next nodeKey in document order. */
private Stack<Long> mRightSiblingKeyStack;
/** The nodeKey of the next node to visit. */
private long mNextKey;
/**
* Constructor initializing internal state.
*
* @param rtx
* Exclusive (immutable) trx to iterate with.
*/
public DescendantAxis(final INodeReadTrx rtx) {
super(rtx);
}
/**
* Constructor initializing internal state.
*
* @param rtx
* Exclusive (immutable) trx to iterate with.
* @param mIncludeSelf
* Is self included?
*/
public DescendantAxis(final INodeReadTrx rtx, final boolean mIncludeSelf) {
super(rtx, mIncludeSelf);
}
/**
* {@inheritDoc}
*/
@Override
public void reset(final long mNodeKey) {
super.reset(mNodeKey);
mRightSiblingKeyStack = new Stack<Long>();
if (isSelfIncluded()) {
mNextKey = getNode().getDataKey();
} else {
mNextKey = ((ITreeStructData)getNode()).getFirstChildKey();
}
}
/**
* {@inheritDoc}
*/
@Override
public boolean hasNext() {
resetToLastKey();
// Fail if there is no node anymore.
if (mNextKey == NULL_NODE) {
resetToStartKey();
return false;
}
moveTo(mNextKey);
// Fail if the subtree is finished.
if (((ITreeStructData)getNode()).getLeftSiblingKey() == getStartKey()) {
resetToStartKey();
return false;
}
// Always follow first child if there is one.
if (((ITreeStructData)getNode()).hasFirstChild()) {
mNextKey = ((ITreeStructData)getNode()).getFirstChildKey();
if (((ITreeStructData)getNode()).hasRightSibling()) {
mRightSiblingKeyStack.push(((ITreeStructData)getNode()).getRightSiblingKey());
}
return true;
}
// Then follow right sibling if there is one.
if (((ITreeStructData)getNode()).hasRightSibling()) {
mNextKey = ((ITreeStructData)getNode()).getRightSiblingKey();
return true;
}
// Then follow right sibling on stack.
if (mRightSiblingKeyStack.size() > 0) {
mNextKey = mRightSiblingKeyStack.pop();
return true;
}
// Then end.
mNextKey = NULL_NODE;
return true;
}
}
|
{
"content_hash": "4e5ac73318d536475d4bb970de8131e5",
"timestamp": "",
"source": "github",
"line_count": 110,
"max_line_length": 103,
"avg_line_length": 26.345454545454544,
"alnum_prop": 0.5814354727398205,
"repo_name": "sebastiangraf/treetank",
"id": "5dc5946d036285bebb9b482ac4552df234645bc6",
"size": "4479",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "coremodules/node/src/main/java/org/treetank/axis/DescendantAxis.java",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "HTML",
"bytes": "5256"
},
{
"name": "Java",
"bytes": "2623580"
},
{
"name": "Shell",
"bytes": "12268"
},
{
"name": "XSLT",
"bytes": "10035"
}
]
}
|
package ru.job4j.controller;
import ru.job4j.validate.ValidateMemoryService;
import ru.job4j.validate.ValidateService;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
/**
* Class UserCreateController.
*
* @author Ponkin Aleksey
* @version 1.0.0
* @since 25.05.2018.
*/
public class UserCreateController extends HttpServlet {
/**
* Validator.
*/
private final ValidateService validate = ValidateMemoryService.getInstance();
protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
req.setAttribute("roles", this.validate.findAllRole());
req.getRequestDispatcher("/WEB-INF/view/UserCreate.jsp").forward(req, resp);
}
}
|
{
"content_hash": "bb949409d8eee24f927959b7cb3808b4",
"timestamp": "",
"source": "github",
"line_count": 29,
"max_line_length": 113,
"avg_line_length": 30.06896551724138,
"alnum_prop": 0.7603211009174312,
"repo_name": "alekseyponkin/aponkin",
"id": "a02d734381b0a93429cbdb488966864b3fb79455",
"size": "872",
"binary": false,
"copies": "1",
"ref": "refs/heads/dev",
"path": "Servlet_JSP/src/main/java/ru/job4j/controller/UserCreateController.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "HTML",
"bytes": "10324"
},
{
"name": "Java",
"bytes": "453813"
},
{
"name": "JavaScript",
"bytes": "3035"
},
{
"name": "XSLT",
"bytes": "454"
}
]
}
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!--NewPage-->
<HTML>
<HEAD>
<!-- Generated by javadoc (build 1.5.0_22) on Wed Mar 02 14:12:36 CST 2011 -->
<TITLE>
org.jivesoftware.openfire.commands.admin.muc (Openfire 3.7.0 Javadoc)
</TITLE>
<META NAME="keywords" CONTENT="org.jivesoftware.openfire.commands.admin.muc package">
<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../../../stylesheet.css" TITLE="Style">
<SCRIPT type="text/javascript">
function windowTitle()
{
parent.document.title="org.jivesoftware.openfire.commands.admin.muc (Openfire 3.7.0 Javadoc)";
}
</SCRIPT>
<NOSCRIPT>
</NOSCRIPT>
</HEAD>
<BODY BGCOLOR="white" onload="windowTitle();">
<!-- ========= START OF TOP NAVBAR ======= -->
<A NAME="navbar_top"><!-- --></A>
<A HREF="#skip-navbar_top" title="Skip navigation links"></A>
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
<TR>
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<A NAME="navbar_top_firstrow"><!-- --></A>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
<TR ALIGN="center" VALIGN="top">
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD>
<TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Package</B></FONT> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <FONT CLASS="NavBarFont1">Class</FONT> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD>
</TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
<b>Openfire 3.7.0 Javadoc</b></EM>
</TD>
</TR>
<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../../../../../org/jivesoftware/openfire/commands/admin/group/package-summary.html"><B>PREV PACKAGE</B></A>
<A HREF="../../../../../../org/jivesoftware/openfire/commands/admin/user/package-summary.html"><B>NEXT PACKAGE</B></A></FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../../../../../index.html?org/jivesoftware/openfire/commands/admin/muc/package-summary.html" target="_top"><B>FRAMES</B></A>
<A HREF="package-summary.html" target="_top"><B>NO FRAMES</B></A>
<SCRIPT type="text/javascript">
<!--
if(window==top) {
document.writeln('<A HREF="../../../../../../allclasses-noframe.html"><B>All Classes</B></A>');
}
//-->
</SCRIPT>
<NOSCRIPT>
<A HREF="../../../../../../allclasses-noframe.html"><B>All Classes</B></A>
</NOSCRIPT>
</FONT></TD>
</TR>
</TABLE>
<A NAME="skip-navbar_top"></A>
<!-- ========= END OF TOP NAVBAR ========= -->
<HR>
<H2>
Package org.jivesoftware.openfire.commands.admin.muc
</H2>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
<B>Class Summary</B></FONT></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD WIDTH="15%"><B><A HREF="../../../../../../org/jivesoftware/openfire/commands/admin/muc/CreateMUCRoom.html" title="class in org.jivesoftware.openfire.commands.admin.muc">CreateMUCRoom</A></B></TD>
<TD>Allows via AdHoc commands the creation of a Multi-User Chat room.</TD>
</TR>
</TABLE>
<P>
<DL>
</DL>
<HR>
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<A NAME="navbar_bottom"><!-- --></A>
<A HREF="#skip-navbar_bottom" title="Skip navigation links"></A>
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
<TR>
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<A NAME="navbar_bottom_firstrow"><!-- --></A>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
<TR ALIGN="center" VALIGN="top">
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD>
<TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Package</B></FONT> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <FONT CLASS="NavBarFont1">Class</FONT> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD>
</TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
<b>Openfire 3.7.0 Javadoc</b></EM>
</TD>
</TR>
<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../../../../../org/jivesoftware/openfire/commands/admin/group/package-summary.html"><B>PREV PACKAGE</B></A>
<A HREF="../../../../../../org/jivesoftware/openfire/commands/admin/user/package-summary.html"><B>NEXT PACKAGE</B></A></FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../../../../../index.html?org/jivesoftware/openfire/commands/admin/muc/package-summary.html" target="_top"><B>FRAMES</B></A>
<A HREF="package-summary.html" target="_top"><B>NO FRAMES</B></A>
<SCRIPT type="text/javascript">
<!--
if(window==top) {
document.writeln('<A HREF="../../../../../../allclasses-noframe.html"><B>All Classes</B></A>');
}
//-->
</SCRIPT>
<NOSCRIPT>
<A HREF="../../../../../../allclasses-noframe.html"><B>All Classes</B></A>
</NOSCRIPT>
</FONT></TD>
</TR>
</TABLE>
<A NAME="skip-navbar_bottom"></A>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
<HR>
<i>Copyright © 2003-2008 Jive Software.</i>
</BODY>
</HTML>
|
{
"content_hash": "0a2ab6d8bbc681248dd4548595e5ce24",
"timestamp": "",
"source": "github",
"line_count": 152,
"max_line_length": 199,
"avg_line_length": 42.75,
"alnum_prop": 0.6206525084641428,
"repo_name": "AndrewChanChina/pps1",
"id": "282d54447611d23b0da5c62e742ef3b0bd3ccc1e",
"size": "6498",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "documentation/docs/javadoc/org/jivesoftware/openfire/commands/admin/muc/package-summary.html",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "C",
"bytes": "3814"
},
{
"name": "D",
"bytes": "1827"
},
{
"name": "Java",
"bytes": "7512284"
},
{
"name": "JavaScript",
"bytes": "215635"
},
{
"name": "Objective-C",
"bytes": "6879"
},
{
"name": "Shell",
"bytes": "6389"
}
]
}
|
<!--
Copyright (c) 2019 The Khronos Group Inc.
Use of this source code is governed by an MIT-style license that can be
found in the LICENSE.txt file.
-->
<!--
This file is auto-generated from py/tex_image_test_generator.py
DO NOT EDIT!
-->
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
<script src="../../../js/js-test-pre.js"></script>
<script src="../../../js/webgl-test-utils.js"></script>
<script src="../../../js/tests/tex-image-and-sub-image-utils.js"></script>
<script src="../../../js/tests/tex-image-and-sub-image-with-image-bitmap-utils.js"></script>
<script src="../../../js/tests/tex-image-and-sub-image-2d-with-image-bitmap-from-blob.js"></script>
</head>
<body>
<canvas id="example" width="32" height="32"></canvas>
<div id="description"></div>
<div id="console"></div>
<script>
"use strict";
function testPrologue(gl) {
return true;
}
generateTest("RGBA", "RGBA", "UNSIGNED_BYTE", testPrologue, "../../../resources/", 1)();
</script>
</body>
</html>
|
{
"content_hash": "7d9ecf4e5ad61cdc5b38c98bb338149e",
"timestamp": "",
"source": "github",
"line_count": 39,
"max_line_length": 99,
"avg_line_length": 26.94871794871795,
"alnum_prop": 0.6517602283539486,
"repo_name": "endlessm/chromium-browser",
"id": "3a94793561bf2300ffee1233b80de299cb6b8d04",
"size": "1051",
"binary": false,
"copies": "10",
"ref": "refs/heads/master",
"path": "third_party/webgl/src/sdk/tests/conformance/textures/image_bitmap_from_blob/tex-2d-rgba-rgba-unsigned_byte.html",
"mode": "33188",
"license": "bsd-3-clause",
"language": []
}
|
classdef Dataset < handle
methods (Abstract)
varargout = next(obj, n)
end
properties (Abstract, Dependent)
volume % number of unique samples in the dataset
islabelled % T/F indicating whether or not there is label with data
end
properties (SetAccess = protected)
data % AccessPoint for data
label % AccessPoint for label
end
methods % RMPERF
function set.data(obj, value)
assert(isa(value, 'DatasetAP'), 'ILLEGAL ASSIGNMENT');
obj.data = value;
end
function set.label(obj, value)
assert(isempty(value )|| isa(value, 'DatasetAP'), ...
'ILLEGAL ASSIGNMENT');
obj.label = value;
end
end
end
|
{
"content_hash": "0f409bb900cf07e4e9d896e30d76e0e1",
"timestamp": "",
"source": "github",
"line_count": 26,
"max_line_length": 75,
"avg_line_length": 29.615384615384617,
"alnum_prop": 0.577922077922078,
"repo_name": "MooGuZ/UMPrest.OO",
"id": "8d70c5281e41e1c7d130056d8016f81573d773c0",
"size": "770",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "Dataset.m",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "MATLAB",
"bytes": "493991"
},
{
"name": "Objective-C",
"bytes": "1520"
}
]
}
|
from debug_toolbar.panels import Panel
from django.conf import settings
from django.template import base as template_base
from django.template.base import Template, Library
from django.template.loader_tags import BlockNode
from debug_toolbar.panels import sql
from django.core.exceptions import ImproperlyConfigured
import threading
import functools
import time
import re
import collections
import logging
logger = logging.getLogger(__name__)
# A set of nodes found by the tag_compiler. Used to patch during next request
# and to unpatch the nodes.
FOUND_GENERIC_NODES = set()
if not "debug_toolbar.panels.sql.SQLPanel" in settings.DEBUG_TOOLBAR_PANELS:
raise ImproperlyConfigured("debug_toolbar.panels.sql.SQLPanel must be present in DEBUG_TOOLBAR_PANELS")
def replace_method(klass, method_name):
original = getattr(klass, method_name)
def inner(callback):
def wrapped(*args, **kwargs):
return callback(original, *args, **kwargs)
actual = getattr(original, '__wrapped__', original)
wrapped.__wrapped__ = actual
wrapped.__doc__ = getattr(actual, '__doc__', None)
wrapped.__name__ = actual.__name__
setattr(klass, method_name, wrapped)
return wrapped
return inner
def record_query(**kwargs):
if hasattr(results, "_current_template"):
if not results._current_key in results.timings or \
not results._current_template in results.timings[results._current_key]:
return
part = results.timings[results._current_key][results._current_template]
part["queries"] += 1
part["query_duration"] += kwargs["duration"]
logger.debug("Template: %s executed query %s" % (results._current_template, kwargs["raw_sql"]))
@replace_method(sql.SQLPanel, "record")
def record(func, self, **kwargs):
record_query(**kwargs)
return func(self, **kwargs)
results = threading.local()
TEMPLATE_TIMINGS_SETTINGS = {
'IGNORED_TEMPLATES': ["debug_toolbar/*"]
}
for k in TEMPLATE_TIMINGS_SETTINGS.keys():
if hasattr(settings, k):
TEMPLATE_TIMINGS_SETTINGS[k] = getattr(settings, k)
def _tag_compiler(func):
@functools.wraps(func)
def wrapper(*args, **kwargs):
if 'node_class' in kwargs:
wrap_generic_node(kwargs['node_class'], kwargs['name'])
FOUND_GENERIC_NODES.add((kwargs['node_class'], kwargs['name']))
return func(*args, **kwargs)
return wrapper
def wrap_generic_node(node, name):
if not hasattr(node.render, 'original'):
node.render = _template_render_wrapper(
node.render, node.__name__, name=lambda unused_: name)
template_base.generic_tag_compiler = _tag_compiler(
template_base.generic_tag_compiler)
def _template_render_wrapper(func, key, should_add=lambda n: True, name=lambda s: s.name if s.name else ''):
@functools.wraps(func)
def timing_hook(self, *args, **kwargs):
# Set up our thread-local results cache
if not hasattr(results, "timings"):
results.timings = collections.defaultdict(dict)
# This is like a stack. It gets incremented before a template is rendered and decremented when
# its finished rendering, because this function is recursive. So if it is 1 then this is the first
# template being rendered, and its total execution time encompasses all of the sub-templates rendering
# time. We use this to display the rendering time on the sidebar
results._count = 0
# These two values are used with the SQL counter. We store the current key and template name
# so that the _logger can get to the current template being rendered.
results._current_template = name(self)
results._current_key = key
name_self = name(self)
# Issue #11, sometimes for some reason accessing results.timings causes a KeyError.
if key not in results.timings:
results.timings[key] = {}
if name_self not in results.timings[key] and should_add(name_self):
results.timings.setdefault(key, {})[name_self] = {
'count': 0,
'min': 0,
'max': 0,
'total': 0,
'avg': 0,
'is_base': False,
'queries': 0,
'query_duration': 0
}
results._count += 1
_old_current = results._current_template
_old_key = results._current_key
results._current_template = name_self
results._current_key = key
start_time = time.time()
result = func(self, *args, **kwargs)
time_taken = (time.time() - start_time) * 1000.0
results._current_template = _old_current
results._current_key = _old_key
if should_add(name_self):
results_part = results.timings[key][name_self]
results_part["min"] = min(time_taken, results_part["min"])
results_part["max"] = max(time_taken, results_part["max"])
results_part['count'] += 1
results_part['total'] += time_taken
results_part['avg'] = results_part['total'] / results_part['count']
results_part["is_base"] = results._count == 1
if results_part["queries"] > 0:
try:
results_part["sql_percentage"] = "%.2f%%" % ((float(results_part["query_duration"]) /
float(results_part["total"])) * 100)
except ZeroDivisionError:
results_part["sql_percentage"] = "0%"
logger.debug("%s %s took %.1f" % (key, name_self, time_taken))
results._count -= 1
return result
timing_hook.original = func
return timing_hook
class TemplateTimings(Panel):
name = "TemplateTimingPanel"
template = "debug_toolbar_template_timings.html"
title = 'Template Timings'
has_content = True
def _get_timings(self):
return getattr(results, "timings", None)
def _results_to_list(self, results):
returner = {}
for key, value in results.items():
returner[key] = []
for name, timings in value.items():
new_timings = {"name": name}
new_timings.update(timings)
returner[key].append(new_timings)
return returner
@property
def nav_title(self):
return 'Template Timings'
def enable_instrumentation(self):
Template.render = _template_render_wrapper(Template.render, "templates",
lambda n: not any([re.match(pattern, n)
for pattern in TEMPLATE_TIMINGS_SETTINGS["IGNORED_TEMPLATES"]]))
BlockNode.render = _template_render_wrapper(BlockNode.render, "blocks")
# Wrap the nodes which were found by earlier requests
for node, name in FOUND_GENERIC_NODES:
wrap_generic_node(node, name)
def disable_instrumentation(self):
if hasattr(Template.render, "original"):
Template.render = Template.render.original
BlockNode.render = BlockNode.render.original
for node, name in FOUND_GENERIC_NODES:
if hasattr(node.render, 'original'):
node.render = node.render.original
@property
def nav_subtitle(self):
results = self._get_timings()
total_template_queries = sum(
sum(results[name][template_name]["queries"] for template_name in results[name])
for name in results
)
total_template_query_time = sum(
sum(results[name][template_name]["query_duration"] for template_name in results[name])
for name in results
)
base_template = filter(lambda i: results["templates"][i]["is_base"] == True, results["templates"].keys())
if not len(base_template) == 1:
logger.info("Found more than one base template: %s" % str(base_template))
else:
base_template = base_template[0]
base_time = results["templates"][base_template]["total"]
query_percentage_time = ""
if total_template_query_time > 0 and base_time > 0:
query_percentage_time = "(%.2f%% SQL)" % ((float(total_template_query_time) / float(base_time)) * 100)
return "%.0f ms with %s queries %s" % (base_time, total_template_queries, query_percentage_time)
def process_response(self, request, response):
timings = self._get_timings()
# Setting default_factory to None allows us to access
# template_timings.iteritems in the template.
if timings is not None:
timings.default_factory = None
timings = self._results_to_list(timings)
self.record_stats({"template_timings": timings})
|
{
"content_hash": "abce7f2f3fd1e13b08dabaaa1b5795ed",
"timestamp": "",
"source": "github",
"line_count": 246,
"max_line_length": 126,
"avg_line_length": 37.51219512195122,
"alnum_prop": 0.5891850888599913,
"repo_name": "WillisXChen/django-oscar",
"id": "74c674c7ed53e8daa09747580bd32ce8c2e65f94",
"size": "9228",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "oscar/lib/python2.7/site-packages/template_timings_panel/panels/TemplateTimings.py",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "Assembly",
"bytes": "78"
},
{
"name": "C",
"bytes": "5979"
},
{
"name": "C++",
"bytes": "572"
},
{
"name": "CSS",
"bytes": "694578"
},
{
"name": "CoffeeScript",
"bytes": "21"
},
{
"name": "Groff",
"bytes": "21346"
},
{
"name": "HTML",
"bytes": "708061"
},
{
"name": "JavaScript",
"bytes": "1433937"
},
{
"name": "Jupyter Notebook",
"bytes": "189877"
},
{
"name": "Makefile",
"bytes": "6656"
},
{
"name": "Python",
"bytes": "47548581"
},
{
"name": "Shell",
"bytes": "6790"
},
{
"name": "Smarty",
"bytes": "21023"
},
{
"name": "TeX",
"bytes": "56837"
},
{
"name": "XSLT",
"bytes": "24882"
}
]
}
|
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" /><meta name="generator" content="Docutils 0.19: https://docutils.sourceforge.io/" />
<meta name="viewport" content="width=device-width,initial-scale=1">
<meta http-equiv="x-ua-compatible" content="ie=edge">
<meta name="lang:clipboard.copy" content="Copy to clipboard">
<meta name="lang:clipboard.copied" content="Copied to clipboard">
<meta name="lang:search.language" content="en">
<meta name="lang:search.pipeline.stopwords" content="True">
<meta name="lang:search.pipeline.trimmer" content="True">
<meta name="lang:search.result.none" content="No matching documents">
<meta name="lang:search.result.one" content="1 matching document">
<meta name="lang:search.result.other" content="# matching documents">
<meta name="lang:search.tokenizer" content="[\s\-]+">
<link href="https://fonts.gstatic.com/" rel="preconnect" crossorigin>
<link href="https://fonts.googleapis.com/css?family=Roboto+Mono:400,500,700|Roboto:300,400,400i,700&display=fallback" rel="stylesheet">
<style>
body,
input {
font-family: "Roboto", "Helvetica Neue", Helvetica, Arial, sans-serif
}
code,
kbd,
pre {
font-family: "Roboto Mono", "Courier New", Courier, monospace
}
</style>
<link rel="stylesheet" href="../_static/stylesheets/application.css"/>
<link rel="stylesheet" href="../_static/stylesheets/application-palette.css"/>
<link rel="stylesheet" href="../_static/stylesheets/application-fixes.css"/>
<link rel="stylesheet" href="../_static/fonts/material-icons.css"/>
<meta name="theme-color" content="#3f51b5">
<script src="../_static/javascripts/modernizr.js"></script>
<title>statsmodels.tsa.statespace.simulation_smoother.SimulationSmoother.set_inversion_method — statsmodels</title>
<link rel="icon" type="image/png" sizes="32x32" href="../_static/icons/favicon-32x32.png">
<link rel="icon" type="image/png" sizes="16x16" href="../_static/icons/favicon-16x16.png">
<link rel="manifest" href="../_static/icons/site.webmanifest">
<link rel="mask-icon" href="../_static/icons/safari-pinned-tab.svg" color="#919191">
<meta name="msapplication-TileColor" content="#2b5797">
<meta name="msapplication-config" content="../_static/icons/browserconfig.xml">
<link rel="stylesheet" href="../_static/stylesheets/examples.css">
<link rel="stylesheet" href="../_static/stylesheets/deprecation.css">
<link rel="stylesheet" type="text/css" href="../_static/pygments.css" />
<link rel="stylesheet" type="text/css" href="../_static/material.css" />
<link rel="stylesheet" type="text/css" href="../_static/graphviz.css" />
<link rel="stylesheet" type="text/css" href="../_static/plot_directive.css" />
<script data-url_root="../" id="documentation_options" src="../_static/documentation_options.js"></script>
<script src="../_static/jquery.js"></script>
<script src="../_static/underscore.js"></script>
<script src="../_static/_sphinx_javascript_frameworks_compat.js"></script>
<script src="../_static/doctools.js"></script>
<script src="../_static/sphinx_highlight.js"></script>
<script crossorigin="anonymous" integrity="sha256-Ae2Vz/4ePdIu6ZyI/5ZGsYnb+m0JlOmKPjt6XZ9JJkA=" src="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.4/require.min.js"></script>
<link rel="shortcut icon" href="../_static/favicon.ico"/>
<link rel="author" title="About these documents" href="../about.html" />
<link rel="index" title="Index" href="../genindex.html" />
<link rel="search" title="Search" href="../search.html" />
<link rel="next" title="statsmodels.tsa.statespace.simulation_smoother.SimulationSmoother.set_smooth_method" href="statsmodels.tsa.statespace.simulation_smoother.SimulationSmoother.set_smooth_method.html" />
<link rel="prev" title="statsmodels.tsa.statespace.simulation_smoother.SimulationSmoother.set_filter_timing" href="statsmodels.tsa.statespace.simulation_smoother.SimulationSmoother.set_filter_timing.html" />
</head>
<body dir=ltr
data-md-color-primary=indigo data-md-color-accent=blue>
<svg class="md-svg">
<defs data-children-count="0">
<svg xmlns="http://www.w3.org/2000/svg" width="416" height="448" viewBox="0 0 416 448" id="__github"><path fill="currentColor" d="M160 304q0 10-3.125 20.5t-10.75 19T128 352t-18.125-8.5-10.75-19T96 304t3.125-20.5 10.75-19T128 256t18.125 8.5 10.75 19T160 304zm160 0q0 10-3.125 20.5t-10.75 19T288 352t-18.125-8.5-10.75-19T256 304t3.125-20.5 10.75-19T288 256t18.125 8.5 10.75 19T320 304zm40 0q0-30-17.25-51T296 232q-10.25 0-48.75 5.25Q229.5 240 208 240t-39.25-2.75Q130.75 232 120 232q-29.5 0-46.75 21T56 304q0 22 8 38.375t20.25 25.75 30.5 15 35 7.375 37.25 1.75h42q20.5 0 37.25-1.75t35-7.375 30.5-15 20.25-25.75T360 304zm56-44q0 51.75-15.25 82.75-9.5 19.25-26.375 33.25t-35.25 21.5-42.5 11.875-42.875 5.5T212 416q-19.5 0-35.5-.75t-36.875-3.125-38.125-7.5-34.25-12.875T37 371.5t-21.5-28.75Q0 312 0 260q0-59.25 34-99-6.75-20.5-6.75-42.5 0-29 12.75-54.5 27 0 47.5 9.875t47.25 30.875Q171.5 96 212 96q37 0 70 8 26.25-20.5 46.75-30.25T376 64q12.75 25.5 12.75 54.5 0 21.75-6.75 42 34 40 34 99.5z"/></svg>
</defs>
</svg>
<input class="md-toggle" data-md-toggle="drawer" type="checkbox" id="__drawer">
<input class="md-toggle" data-md-toggle="search" type="checkbox" id="__search">
<label class="md-overlay" data-md-component="overlay" for="__drawer"></label>
<a href="#generated/statsmodels.tsa.statespace.simulation_smoother.SimulationSmoother.set_inversion_method" tabindex="1" class="md-skip"> Skip to content </a>
<header class="md-header" data-md-component="header">
<nav class="md-header-nav md-grid">
<div class="md-flex navheader">
<div class="md-flex__cell md-flex__cell--shrink">
<a href="../index.html" title="statsmodels"
class="md-header-nav__button md-logo">
<img src="../_static/statsmodels-logo-v2-bw.svg" height="26"
alt="statsmodels logo">
</a>
</div>
<div class="md-flex__cell md-flex__cell--shrink">
<label class="md-icon md-icon--menu md-header-nav__button" for="__drawer"></label>
</div>
<div class="md-flex__cell md-flex__cell--stretch">
<div class="md-flex__ellipsis md-header-nav__title" data-md-component="title">
<span class="md-header-nav__topic">statsmodels 0.13.4</span>
<span class="md-header-nav__topic"> statsmodels.tsa.statespace.simulation_smoother.SimulationSmoother.set_inversion_method </span>
</div>
</div>
<div class="md-flex__cell md-flex__cell--shrink">
<label class="md-icon md-icon--search md-header-nav__button" for="__search"></label>
<div class="md-search" data-md-component="search" role="dialog">
<label class="md-search__overlay" for="__search"></label>
<div class="md-search__inner" role="search">
<form class="md-search__form" action="../search.html" method="get" name="search">
<input type="text" class="md-search__input" name="q" placeholder="Search"
autocapitalize="off" autocomplete="off" spellcheck="false"
data-md-component="query" data-md-state="active">
<label class="md-icon md-search__icon" for="__search"></label>
<button type="reset" class="md-icon md-search__icon" data-md-component="reset" tabindex="-1">

</button>
</form>
<div class="md-search__output">
<div class="md-search__scrollwrap" data-md-scrollfix>
<div class="md-search-result" data-md-component="result">
<div class="md-search-result__meta">
Type to start searching
</div>
<ol class="md-search-result__list"></ol>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="md-flex__cell md-flex__cell--shrink">
<div class="md-header-nav__source">
<a href="https://github.com/statsmodels/statsmodels" title="Go to repository" class="md-source" data-md-source="github">
<div class="md-source__icon">
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 24 24" width="28" height="28">
<use xlink:href="#__github" width="24" height="24"></use>
</svg>
</div>
<div class="md-source__repository">
statsmodels
</div>
</a>
</div>
</div>
<script src="../_static/javascripts/version_dropdown.js"></script>
<script>
var json_loc = "../../versions-v2.json",
target_loc = "../../",
text = "Versions";
$( document ).ready( add_version_dropdown(json_loc, target_loc, text));
</script>
</div>
</nav>
</header>
<div class="md-container">
<nav class="md-tabs" data-md-component="tabs">
<div class="md-tabs__inner md-grid">
<ul class="md-tabs__list">
<li class="md-tabs__item"><a href="../user-guide.html" class="md-tabs__link">User Guide</a></li>
<li class="md-tabs__item"><a href="../statespace.html" class="md-tabs__link">Time Series Analysis by State Space Methods <code class="xref py py-mod docutils literal notranslate"><span class="pre">statespace</span></code></a></li>
<li class="md-tabs__item"><a href="statsmodels.tsa.statespace.simulation_smoother.SimulationSmoother.html" class="md-tabs__link">statsmodels.tsa.statespace.simulation_smoother.SimulationSmoother</a></li>
</ul>
</div>
</nav>
<main class="md-main">
<div class="md-main__inner md-grid" data-md-component="container">
<div class="md-sidebar md-sidebar--primary" data-md-component="navigation">
<div class="md-sidebar__scrollwrap">
<div class="md-sidebar__inner">
<nav class="md-nav md-nav--primary" data-md-level="0">
<label class="md-nav__title md-nav__title--site" for="__drawer">
<a href="../index.html" title="statsmodels" class="md-nav__button md-logo">
<img src="../_static/statsmodels-logo-v2-bw.svg" alt=" logo" width="48" height="48">
</a>
<a href="../index.html"
title="statsmodels">statsmodels 0.13.4</a>
</label>
<div class="md-nav__source">
<a href="https://github.com/statsmodels/statsmodels" title="Go to repository" class="md-source" data-md-source="github">
<div class="md-source__icon">
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 24 24" width="28" height="28">
<use xlink:href="#__github" width="24" height="24"></use>
</svg>
</div>
<div class="md-source__repository">
statsmodels
</div>
</a>
</div>
<ul class="md-nav__list">
<li class="md-nav__item">
<a href="../install.html" class="md-nav__link">Installing statsmodels</a>
</li>
<li class="md-nav__item">
<a href="../gettingstarted.html" class="md-nav__link">Getting started</a>
</li>
<li class="md-nav__item">
<a href="../user-guide.html" class="md-nav__link">User Guide</a>
<ul class="md-nav__list">
<li class="md-nav__item">
<a href="../user-guide.html#background" class="md-nav__link">Background</a>
</li>
<li class="md-nav__item">
<a href="../user-guide.html#regression-and-linear-models" class="md-nav__link">Regression and Linear Models</a>
</li>
<li class="md-nav__item">
<a href="../user-guide.html#time-series-analysis" class="md-nav__link">Time Series Analysis</a>
<ul class="md-nav__list">
<li class="md-nav__item">
<a href="../tsa.html" class="md-nav__link">Time Series analysis <code class="xref py py-mod docutils literal notranslate"><span class="pre">tsa</span></code></a>
</li>
<li class="md-nav__item">
<a href="../statespace.html" class="md-nav__link">Time Series Analysis by State Space Methods <code class="xref py py-mod docutils literal notranslate"><span class="pre">statespace</span></code></a>
</li>
<li class="md-nav__item">
<a href="../vector_ar.html" class="md-nav__link">Vector Autoregressions <code class="xref py py-mod docutils literal notranslate"><span class="pre">tsa.vector_ar</span></code></a>
</li></ul>
</li>
<li class="md-nav__item">
<a href="../user-guide.html#other-models" class="md-nav__link">Other Models</a>
</li>
<li class="md-nav__item">
<a href="../user-guide.html#statistics-and-tools" class="md-nav__link">Statistics and Tools</a>
</li>
<li class="md-nav__item">
<a href="../user-guide.html#data-sets" class="md-nav__link">Data Sets</a>
</li>
<li class="md-nav__item">
<a href="../user-guide.html#sandbox" class="md-nav__link">Sandbox</a>
</li></ul>
</li>
<li class="md-nav__item">
<a href="../examples/index.html" class="md-nav__link">Examples</a>
</li>
<li class="md-nav__item">
<a href="../api.html" class="md-nav__link">API Reference</a>
</li>
<li class="md-nav__item">
<a href="../about.html" class="md-nav__link">About statsmodels</a>
</li>
<li class="md-nav__item">
<a href="../dev/index.html" class="md-nav__link">Developer Page</a>
</li>
<li class="md-nav__item">
<a href="../release/index.html" class="md-nav__link">Release Notes</a>
</li>
</ul>
</nav>
</div>
</div>
</div>
<div class="md-sidebar md-sidebar--secondary" data-md-component="toc">
<div class="md-sidebar__scrollwrap">
<div class="md-sidebar__inner">
<nav class="md-nav md-nav--secondary">
<label class="md-nav__title" for="__toc">Contents</label>
<ul class="md-nav__list" data-md-scrollfix="">
<li class="md-nav__item"><a href="#generated-statsmodels-tsa-statespace-simulation-smoother-simulationsmoother-set-inversion-method--page-root" class="md-nav__link">statsmodels.tsa.statespace.simulation_smoother.SimulationSmoother.set_inversion_method</a><nav class="md-nav">
<ul class="md-nav__list">
<li class="md-nav__item"><a href="#statsmodels.tsa.statespace.simulation_smoother.SimulationSmoother.set_inversion_method" class="md-nav__link"><code class="docutils literal notranslate"><span class="pre">SimulationSmoother.set_inversion_method</span></code></a>
</li></ul>
</nav>
</li>
<li class="md-nav__item"><a class="md-nav__extra_link" href="../_sources/generated/statsmodels.tsa.statespace.simulation_smoother.SimulationSmoother.set_inversion_method.rst.txt">Show Source</a> </li>
<li id="searchbox" class="md-nav__item"></li>
</ul>
</nav>
</div>
</div>
</div>
<div class="md-content">
<article class="md-content__inner md-typeset" role="main">
<section id="statsmodels-tsa-statespace-simulation-smoother-simulationsmoother-set-inversion-method">
<h1 id="generated-statsmodels-tsa-statespace-simulation-smoother-simulationsmoother-set-inversion-method--page-root">statsmodels.tsa.statespace.simulation_smoother.SimulationSmoother.set_inversion_method<a class="headerlink" href="#generated-statsmodels-tsa-statespace-simulation-smoother-simulationsmoother-set-inversion-method--page-root" title="Permalink to this heading">¶</a></h1>
<dl class="py method">
<dt class="sig sig-object py" id="statsmodels.tsa.statespace.simulation_smoother.SimulationSmoother.set_inversion_method">
<span class="sig-prename descclassname"><span class="pre">SimulationSmoother.</span></span><span class="sig-name descname"><span class="pre">set_inversion_method</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">inversion_method</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="o"><span class="pre">**</span></span><span class="n"><span class="pre">kwargs</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#statsmodels.tsa.statespace.simulation_smoother.SimulationSmoother.set_inversion_method" title="Permalink to this definition">¶</a></dt>
<dd><p>Set the inversion method</p>
<p>The Kalman filter may contain one matrix inversion: that of the
forecast error covariance matrix. The inversion method controls how and
if that inverse is performed.</p>
<dl class="field-list">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><dl>
<dt><strong>inversion_method</strong><span class="classifier"><a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.11)"><code class="docutils literal notranslate"><span class="pre">int</span></code></a>, <code class="xref py py-obj docutils literal notranslate"><span class="pre">optional</span></code></span></dt><dd><p>Bitmask value to set the inversion method to. See notes for
details.</p>
</dd>
<dt><strong>**kwargs</strong></dt><dd><p>Keyword arguments may be used to influence the inversion method by
setting individual boolean flags. See notes for details.</p>
</dd>
</dl>
</dd>
</dl>
<p class="rubric">Notes</p>
<p>The inversion method is defined by a collection of boolean flags, and
is internally stored as a bitmask. The methods available are:</p>
<dl class="simple">
<dt>INVERT_UNIVARIATE</dt><dd><p>If the endogenous time series is univariate, then inversion can be
performed by simple division. If this flag is set and the time
series is univariate, then division will always be used even if
other flags are also set.</p>
</dd>
<dt>SOLVE_LU</dt><dd><p>Use an LU decomposition along with a linear solver (rather than
ever actually inverting the matrix).</p>
</dd>
<dt>INVERT_LU</dt><dd><p>Use an LU decomposition along with typical matrix inversion.</p>
</dd>
<dt>SOLVE_CHOLESKY</dt><dd><p>Use a Cholesky decomposition along with a linear solver.</p>
</dd>
<dt>INVERT_CHOLESKY</dt><dd><p>Use an Cholesky decomposition along with typical matrix inversion.</p>
</dd>
</dl>
<p>If the bitmask is set directly via the <cite>inversion_method</cite> argument,
then the full method must be provided.</p>
<p>If keyword arguments are used to set individual boolean flags, then
the lowercase of the method must be used as an argument name, and the
value is the desired value of the boolean flag (True or False).</p>
<p>Note that the inversion method may also be specified by directly
modifying the class attributes which are defined similarly to the
keyword arguments.</p>
<p>The default inversion method is <cite>INVERT_UNIVARIATE | SOLVE_CHOLESKY</cite></p>
<p>Several things to keep in mind are:</p>
<ul class="simple">
<li><p>If the filtering method is specified to be univariate, then simple
division is always used regardless of the dimension of the endogenous
time series.</p></li>
<li><p>Cholesky decomposition is about twice as fast as LU decomposition,
but it requires that the matrix be positive definite. While this
should generally be true, it may not be in every case.</p></li>
<li><p>Using a linear solver rather than true matrix inversion is generally
faster and is numerically more stable.</p></li>
</ul>
<p class="rubric">Examples</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">>>> </span><span class="n">mod</span> <span class="o">=</span> <span class="n">sm</span><span class="o">.</span><span class="n">tsa</span><span class="o">.</span><span class="n">statespace</span><span class="o">.</span><span class="n">SARIMAX</span><span class="p">(</span><span class="nb">range</span><span class="p">(</span><span class="mi">10</span><span class="p">))</span>
<span class="gp">>>> </span><span class="n">mod</span><span class="o">.</span><span class="n">ssm</span><span class="o">.</span><span class="n">inversion_method</span>
<span class="go">1</span>
<span class="gp">>>> </span><span class="n">mod</span><span class="o">.</span><span class="n">ssm</span><span class="o">.</span><span class="n">solve_cholesky</span>
<span class="go">True</span>
<span class="gp">>>> </span><span class="n">mod</span><span class="o">.</span><span class="n">ssm</span><span class="o">.</span><span class="n">invert_univariate</span>
<span class="go">True</span>
<span class="gp">>>> </span><span class="n">mod</span><span class="o">.</span><span class="n">ssm</span><span class="o">.</span><span class="n">invert_lu</span>
<span class="go">False</span>
<span class="gp">>>> </span><span class="n">mod</span><span class="o">.</span><span class="n">ssm</span><span class="o">.</span><span class="n">invert_univariate</span> <span class="o">=</span> <span class="kc">False</span>
<span class="gp">>>> </span><span class="n">mod</span><span class="o">.</span><span class="n">ssm</span><span class="o">.</span><span class="n">inversion_method</span>
<span class="go">8</span>
<span class="gp">>>> </span><span class="n">mod</span><span class="o">.</span><span class="n">ssm</span><span class="o">.</span><span class="n">set_inversion_method</span><span class="p">(</span><span class="n">solve_cholesky</span><span class="o">=</span><span class="kc">False</span><span class="p">,</span>
<span class="gp">... </span> <span class="n">invert_cholesky</span><span class="o">=</span><span class="kc">True</span><span class="p">)</span>
<span class="gp">>>> </span><span class="n">mod</span><span class="o">.</span><span class="n">ssm</span><span class="o">.</span><span class="n">inversion_method</span>
<span class="go">16</span>
</pre></div>
</div>
</dd></dl>
</section>
</article>
</div>
</div>
</main>
</div>
<footer class="md-footer">
<div class="md-footer-nav">
<nav class="md-footer-nav__inner md-grid">
<a href="statsmodels.tsa.statespace.simulation_smoother.SimulationSmoother.set_filter_timing.html" title="statsmodels.tsa.statespace.simulation_smoother.SimulationSmoother.set_filter_timing"
class="md-flex md-footer-nav__link md-footer-nav__link--prev"
rel="prev">
<div class="md-flex__cell md-flex__cell--shrink">
<i class="md-icon md-icon--arrow-back md-footer-nav__button"></i>
</div>
<div class="md-flex__cell md-flex__cell--stretch md-footer-nav__title">
<span class="md-flex__ellipsis">
<span
class="md-footer-nav__direction"> Previous </span> statsmodels.tsa.statespace.simulation_smoother.SimulationSmoother.set_filter_timing </span>
</div>
</a>
<a href="statsmodels.tsa.statespace.simulation_smoother.SimulationSmoother.set_smooth_method.html" title="statsmodels.tsa.statespace.simulation_smoother.SimulationSmoother.set_smooth_method"
class="md-flex md-footer-nav__link md-footer-nav__link--next"
rel="next">
<div class="md-flex__cell md-flex__cell--stretch md-footer-nav__title"><span
class="md-flex__ellipsis"> <span
class="md-footer-nav__direction"> Next </span> statsmodels.tsa.statespace.simulation_smoother.SimulationSmoother.set_smooth_method </span>
</div>
<div class="md-flex__cell md-flex__cell--shrink"><i
class="md-icon md-icon--arrow-forward md-footer-nav__button"></i>
</div>
</a>
</nav>
</div>
<div class="md-footer-meta md-typeset">
<div class="md-footer-meta__inner md-grid">
<div class="md-footer-copyright">
<div class="md-footer-copyright__highlight">
© Copyright 2009-2019, Josef Perktold, Skipper Seabold, Jonathan Taylor, statsmodels-developers.
</div>
Last updated on
Nov 01, 2022.
<br/>
Created using
<a href="http://www.sphinx-doc.org/">Sphinx</a> 5.3.0.
and
<a href="https://github.com/bashtage/sphinx-material/">Material for
Sphinx</a>
</div>
</div>
</div>
</footer>
<script src="../_static/javascripts/application.js"></script>
<script>app.initialize({version: "1.0.4", url: {base: ".."}})</script>
</body>
</html>
|
{
"content_hash": "2b54ecff516525c54b376c458e8adb94",
"timestamp": "",
"source": "github",
"line_count": 530,
"max_line_length": 999,
"avg_line_length": 47.28490566037736,
"alnum_prop": 0.6351302821116476,
"repo_name": "statsmodels/statsmodels.github.io",
"id": "337c037c50ea23857c4cde4061cc6cfd3cab1ca3",
"size": "25065",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "v0.13.4/generated/statsmodels.tsa.statespace.simulation_smoother.SimulationSmoother.set_inversion_method.html",
"mode": "33188",
"license": "bsd-3-clause",
"language": []
}
|
/**
*******************************************************************************
* MembershipServer.cpp *
* *
* Membership server: *
* - Membership server to perform netwrok operations *
*******************************************************************************
*/
/*
*******************************************************************************
* Headers *
*******************************************************************************
*/
#include "stdinclude.h"
#include <algorithm>
#include <iterator>
#include <climits>
#include <boost/asio.hpp>
#include "MembershipServer.h"
#include "GossipProtocol.h"
using namespace boost::asio;
using namespace std;
/*
*******************************************************************************
* Forward declaraction *
*******************************************************************************
*/
/*
*******************************************************************************
* Class declaraction *
*******************************************************************************
*/
MembershipServer::MembershipServer(ConfigPortal * pcfg,
MemberList * pmemlist,
size_t thread_pool_size /*Not support*/) :
m_done(true),
m_rcvbuf([](const bufkey &l, const bufkey &r)->bool {
if (l.first < r.first ) {
return true;
}
else if (l.first > r.first) {
return false;
}
else {
if (l.second < r.second) {
return true;
}
return false;
}
}),
m_pcfg(pcfg),
m_prot(nullptr),
m_fact(),
m_io(),
m_signals(m_io),
m_udpsock(m_io),
m_t(m_io),
m_snd_que(),
m_snd_txid(0),
m_multicast_que(),
m_multicast_txid(0)
{
if (m_pcfg->get_protocol() == "GOSSIP") {
m_prot = std::make_shared<GossipProtocol> (pmemlist, pcfg, this);
}
else {
throw config_error("Protocol not support");
}
m_signals.add(SIGINT);
m_signals.add(SIGTERM);
#if defined(SIGQUIT)
m_signals.add(SIGQUIT);
#endif // defined(SIGQUIT)
//m_signals.async_wait(boost::bind(&MembershipServer::handle_stop, this));
m_signals.async_wait([this](const boost::system::error_code ec, int signum) {
m_done = true;
m_udpsock.cancel();
m_t.cancel();
m_udpsock.close();
getlog()->sendlog(LogLevel::DEBUG, "Membership server received terminate signal\n");
});
// Bind to address
boost::system::error_code ec;
ip::address addr = ip::address::from_string(m_pcfg->get_bindip(),
ec);
boost::asio::detail::throw_error(ec, "ip");
ip::udp::endpoint bind_addr(addr, m_pcfg->get_bindport());
const ip::udp::endpoint::protocol_type protocol = bind_addr.protocol();
m_udpsock.open(protocol, ec);
boost::asio::detail::throw_error(ec, "open");
m_udpsock.bind(bind_addr, ec);
boost::asio::detail::throw_error(ec, "bind");
// period timer
m_t.expires_from_now(boost::posix_time::seconds(m_pcfg->get_membership_period()));
m_t.async_wait(boost::bind(&MembershipServer::handle_period_timer, this));
m_prot->node_up();
do_receive();
}
void MembershipServer::run()
{
m_done = false;
m_io.run();
getlog()->sendlog(LogLevel::DEBUG, "Membership server exit\n");
}
void MembershipServer::do_receive()
{
m_udpsock.async_receive_from(
boost::asio::buffer(m_buf), m_sender,
[this](boost::system::error_code ec, std::size_t bytes_recvd)
{
// Too complicate for a lambda function
if (!ec && bytes_recvd > 0)
{
size_t size;
boost::tribool result;
Message * pmsg;
// TODO: should append read data into buffer
unsigned char* data = get_buffer(m_sender, size);
if (data!=nullptr) {
std::tie(result, pmsg) = m_fact.extract(data, size);
} else {
std::tie(result, pmsg) = m_fact.extract(m_buf.data(), bytes_recvd);
}
if (boost::indeterminate(result)) {
append_buffer(m_sender, m_buf.data(), bytes_recvd);
do_receive();
}
else {
if (result) {
pmsg->set_source(m_sender.address(), m_sender.port());
getlog()->sendlog(LogLevel::DEBUG, "Membership server received message begin:\n");
if (getlog()->is_level_allowed(LogLevel::DEBUG)) {
pmsg->dump(getlog()->get_print_handle(), getlog()->is_level_allowed(LogLevel::TRACE));
}
getlog()->sendlog(LogLevel::DEBUG, "Membership server received message end\n");
m_prot->handle_messages(pmsg);
}
// !!! the memory is freed !!!
empty_buffer(m_sender);
do_receive();
}
}
});
}
void MembershipServer::do_send(Message * pmsg)
{
getlog()->sendlog(LogLevel::DEBUG, "Membership send message=0x%x\n", pmsg);
if (pmsg == nullptr) return;
pair<ip::address, unsigned short> dest = pmsg->get_destination();
ip::udp::endpoint dest_end(dest.first, dest.second);
unsigned long long txid = m_snd_txid++;
m_snd_que[txid] = pmsg;
if (m_snd_txid == ULLONG_MAX) {
m_snd_txid = 0;
// TODO: what about if message of txid 0 has not sent complete?
}
getlog()->sendlog(LogLevel::DEBUG, "send message txid=%d\n", txid);
getlog()->sendlog(LogLevel::DEBUG, "send message begin:\n");
if (getlog()->is_level_allowed(LogLevel::DEBUG)) {
pmsg->dump(getlog()->get_print_handle(), getlog()->is_level_allowed(LogLevel::TRACE));
}
getlog()->sendlog(LogLevel::DEBUG, "send message end\n");
m_udpsock.async_send_to(
boost::asio::buffer(pmsg->get_raw(), pmsg->get_size()),
dest_end,
[this, txid](boost::system::error_code /*ec*/, std::size_t /*bytes_sent*/) {
getlog()->sendlog(LogLevel::DEBUG, "send message complete txid=%d\n", txid);
Message * todel = m_snd_que[txid];
if (todel) {
delete todel;
}
m_snd_que.erase(txid);
});
}
void MembershipServer::do_multicast(const vector<ip::udp::endpoint > &ends, Message * pmsg)
{
getlog()->sendlog(LogLevel::DEBUG, "Membership send multicast message=0x%x\n", pmsg);
if (pmsg == nullptr) return;
if (ends.size()==0) {
getlog()->sendlog(LogLevel::DEBUG, "Membership send multicast no endpoints\n");
delete pmsg;
return;
}
unsigned long long txid = m_multicast_txid++;
if (m_multicast_txid == ULLONG_MAX) {
m_multicast_txid = 0;
// TODO: what about if message of txid 0 has not sent complete?
}
getlog()->sendlog(LogLevel::DEBUG, "multicast message txid=%d, endpoints count %d\n",
txid,
ends.size());
m_multicast_que[txid] = make_pair(ends.size(), pmsg);
auto multi_cmp = [this, txid](boost::system::error_code ec, std::size_t /*bytes_sent*/) {
multicast_info ctl = m_multicast_que[txid];
int cnt = ctl.first;
Message * todel = ctl.second;
getlog()->sendlog(LogLevel::DEBUG, "multicast message txid=%d one endpoint complete, remain %d\n",
txid, cnt-1);
if (ec) {
getlog()->sendlog(LogLevel::DEBUG, "multicast message txid=%d failed, ec=%d\n",
txid, ec);
}
if (--cnt == 0) {
getlog()->sendlog(LogLevel::DEBUG, "multicast message done txid=%d\n", txid);
if (todel) {
delete todel;
}
m_multicast_que.erase(txid);
}
else {
m_multicast_que[txid] = make_pair(cnt, todel);
}
};
getlog()->sendlog(LogLevel::DEBUG, "multicast message begin:\n");
if (getlog()->is_level_allowed(LogLevel::DEBUG)) {
pmsg->dump(getlog()->get_print_handle(), getlog()->is_level_allowed(LogLevel::TRACE));
}
getlog()->sendlog(LogLevel::DEBUG, "multicast message end\n");
for (auto&& end : ends) {
getlog()->sendlog(LogLevel::DEBUG, "multicast to %s:%d\n",
end.address().to_string().c_str(),
end.port());
m_udpsock.async_send_to(
boost::asio::buffer(pmsg->get_raw(), pmsg->get_size()),
end,
multi_cmp);
}
}
void MembershipServer::handle_period_timer()
{
if (m_done) return;
m_prot->handle_timer(0 /*TODO: add timer id*/);
m_t.expires_from_now(boost::posix_time::seconds(m_pcfg->get_membership_period()));
m_t.async_wait(boost::bind(&MembershipServer::handle_period_timer, this));
}
unsigned char* MembershipServer::get_buffer(const ip::udp::endpoint & sender,
size_t & sz)
{
string ip = sender.address().to_string();
unsigned short port = sender.port();
auto&& it = m_rcvbuf.find(make_pair(ip, port));
if (it != m_rcvbuf.end()) {
sz = it->second.size();
return it->second.data();
}
return nullptr;
}
void MembershipServer::append_buffer(const ip::udp::endpoint & sender,
unsigned char* buf, size_t sz)
{
string ip = sender.address().to_string();
unsigned short port = sender.port();
auto key = make_pair(ip, port);
auto&& it = m_rcvbuf.find(key);
if (it != m_rcvbuf.end()) {
copy(buf, buf+sz, back_inserter(it->second));
}
else {
m_rcvbuf[key] = move(vector<unsigned char>(buf, buf+sz));
}
}
void MembershipServer::empty_buffer(const ip::udp::endpoint & sender)
{
string ip = sender.address().to_string();
unsigned short port = sender.port();
auto key = make_pair(ip, port);
m_rcvbuf.erase(key);
}
/*
*******************************************************************************
* Inline functions *
*******************************************************************************
*/
|
{
"content_hash": "531a2627e31380f3a09fdcef22aebb70",
"timestamp": "",
"source": "github",
"line_count": 318,
"max_line_length": 123,
"avg_line_length": 35.638364779874216,
"alnum_prop": 0.45936645195446923,
"repo_name": "chenjun-bj/pluto",
"id": "8d518e3e6bb4d55e4353dadfa385ef860f161875",
"size": "11333",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/membership/MembershipServer.cpp",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "C",
"bytes": "4029"
},
{
"name": "C++",
"bytes": "367176"
}
]
}
|
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package org.ecabrerar.ejemplos.javaee7.jsonp.creacionobjetos;
import javax.json.Json;
import javax.json.JsonObject;
/**
*
* @author ecabrerar
*/
public class ObjetoSimpleJSON {
public static void main(String[] args) {
JsonObject jsonObject = Json.createObjectBuilder()
.add("apple", "red")
.add("banana", "yellow")
.build();
System.out.println(""+jsonObject);
}
}
|
{
"content_hash": "19a363651d715a3e69a6709d6e778dc4",
"timestamp": "",
"source": "github",
"line_count": 25,
"max_line_length": 79,
"avg_line_length": 25.44,
"alnum_prop": 0.639937106918239,
"repo_name": "JavaDominicano/taller-javaee7-uapa-sti",
"id": "951e139a256ddf55495b8a9b9077c6613f7b9242",
"size": "636",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "ejemplos/javaee7-jsonp-basico/src/main/java/org/ecabrerar/ejemplos/javaee7/jsonp/creacionobjetos/ObjetoSimpleJSON.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Java",
"bytes": "20547"
}
]
}
|
package org.hillview.table.api;
public interface IRowOrder {
/**
* @return Total number of rows.
*/
int getSize();
/**
* @return An iterator over all the rows in a dataset.
*/
IRowIterator getIterator();
}
|
{
"content_hash": "2d19d630b1741e09f5121323bdd2887e",
"timestamp": "",
"source": "github",
"line_count": 15,
"max_line_length": 58,
"avg_line_length": 16.4,
"alnum_prop": 0.5934959349593496,
"repo_name": "uwieder/hiero",
"id": "712355aefc20e7cb0efb48eb5a70f59e3c613615",
"size": "904",
"binary": false,
"copies": "3",
"ref": "refs/heads/master",
"path": "platform/src/main/java/org/hillview/table/api/IRowOrder.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "3351"
},
{
"name": "HTML",
"bytes": "6968"
},
{
"name": "Java",
"bytes": "554049"
},
{
"name": "JavaScript",
"bytes": "1747"
},
{
"name": "Shell",
"bytes": "4638"
},
{
"name": "TypeScript",
"bytes": "82445"
}
]
}
|
package org.apache.ignite.portable;
import org.apache.ignite.*;
import org.jetbrains.annotations.*;
/**
* Exception indicating portable object serialization error.
*/
public class PortableException extends IgniteException {
/** */
private static final long serialVersionUID = 0L;
/**
* Creates portable exception with error message.
*
* @param msg Error message.
*/
public PortableException(String msg) {
super(msg);
}
/**
* Creates portable exception with {@link Throwable} as a cause.
*
* @param cause Cause.
*/
public PortableException(Throwable cause) {
super(cause);
}
/**
* Creates portable exception with error message and {@link Throwable} as a cause.
*
* @param msg Error message.
* @param cause Cause.
*/
public PortableException(String msg, @Nullable Throwable cause) {
super(msg, cause);
}
}
|
{
"content_hash": "fd7cb99ae562f50a02ea0b01a52f2410",
"timestamp": "",
"source": "github",
"line_count": 43,
"max_line_length": 86,
"avg_line_length": 22.023255813953487,
"alnum_prop": 0.6314677930306231,
"repo_name": "avinogradovgg/ignite",
"id": "62ae9016b97295a43217239a5b52ca982904779f",
"size": "1749",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "modules/core/src/main/java/org/apache/ignite/portable/PortableException.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Batchfile",
"bytes": "31291"
},
{
"name": "C#",
"bytes": "160354"
},
{
"name": "C++",
"bytes": "28098"
},
{
"name": "CSS",
"bytes": "17517"
},
{
"name": "Groovy",
"bytes": "15102"
},
{
"name": "HTML",
"bytes": "4669"
},
{
"name": "Java",
"bytes": "19506508"
},
{
"name": "JavaScript",
"bytes": "1085"
},
{
"name": "PHP",
"bytes": "11079"
},
{
"name": "Scala",
"bytes": "653258"
},
{
"name": "Shell",
"bytes": "396961"
}
]
}
|
package tickrecorder;
import com.fxcore2.*;
import java.util.Calendar;
public class HistoryDownloader {
public static void downloadHistory(O2GSession session, String pair, String resolution, Calendar startTime, Calendar endTime, String uuid){
O2GRequestFactory factory = session.getRequestFactory();
try{
O2GTimeframeCollection timeFrames = factory.getTimeFrameCollection();
O2GTimeframe timeFrame = timeFrames.get(resolution);
O2GRequest marketDataRequest = factory.createMarketDataSnapshotRequestInstrument(pair, timeFrame, 300);
factory.fillMarketDataSnapshotRequestTime(marketDataRequest, startTime, endTime, true);
TickRecorder.redisPublish("historicalPrices", "{\"type\": \"segmentID\", \"id\": \"" +
marketDataRequest.getRequestId() + "\", \"uuid\": \"" + uuid + "\"}");
session.sendRequest(marketDataRequest);
}catch(java.lang.NullPointerException ex){
downloadHistory(session, pair, resolution, startTime, endTime, uuid);
}
}
}
|
{
"content_hash": "d7a700a9449cd3c938a59ea8b3482d78",
"timestamp": "",
"source": "github",
"line_count": 21,
"max_line_length": 142,
"avg_line_length": 51.57142857142857,
"alnum_prop": 0.6860572483841182,
"repo_name": "Ameobea/tickgrinder",
"id": "998fdeaf7a7e35504202c8d853c237934b476982",
"size": "1083",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "broker_shims/FXCM/java_bridge/src/tickrecorder/HistoryDownloader.java",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C++",
"bytes": "38956"
},
{
"name": "CSS",
"bytes": "2454"
},
{
"name": "HTML",
"bytes": "12531"
},
{
"name": "Java",
"bytes": "12542"
},
{
"name": "JavaScript",
"bytes": "174103"
},
{
"name": "Makefile",
"bytes": "17838"
},
{
"name": "Python",
"bytes": "409"
},
{
"name": "Rust",
"bytes": "460619"
},
{
"name": "Shell",
"bytes": "7741"
}
]
}
|
<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="ivy-report.xsl"?>
<ivy-report version="1.0">
<info
organisation="default"
module="fpps-week03-assign01-build"
revision="0.1-SNAPSHOT"
extra-scalaVersion="2.10"
extra-sbtVersion="0.13"
conf="optional"
confs="compile, runtime, test, provided, optional, compile-internal, runtime-internal, test-internal, plugin, sources, docs, pom, scala-tool"
date="20161229174240"/>
<dependencies>
</dependencies>
</ivy-report>
|
{
"content_hash": "b1c5c9a487de4f2356463ab56fc71cd9",
"timestamp": "",
"source": "github",
"line_count": 15,
"max_line_length": 143,
"avg_line_length": 33.86666666666667,
"alnum_prop": 0.7145669291338582,
"repo_name": "juliocnsouzadev/scala_datascience",
"id": "9d4be0f9bd1f23c4568f06cd61da00917c0933e1",
"size": "508",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "fuctional_programming_principles/fpps-week03-assign01/project/target/resolution-cache/reports/default-fpps-week03-assign01-build-optional.xml",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "78678"
},
{
"name": "JavaScript",
"bytes": "237778"
},
{
"name": "Scala",
"bytes": "656149"
},
{
"name": "XSLT",
"bytes": "377874"
}
]
}
|
<!DOCTYPE html>
<!--[if lt IE 7]> <html class="no-js sidebar-large lt-ie9 lt-ie8 lt-ie7"> <![endif]-->
<!--[if IE 7]> <html class="no-js sidebar-large lt-ie9 lt-ie8"> <![endif]-->
<!--[if IE 8]> <html class="no-js sidebar-large lt-ie9"> <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js sidebar-large"> <!--<![endif]-->
<head>
<meta charset="utf-8">
<title>Opción Inmuebles</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta content="" name="description" />
<meta content="themes-lab" name="author" />
<link rel="shortcut icon" href="assets/img/favicon.png">
<!-- END META SECTION -->
<!-- BEGIN MANDATORY STYLE -->
<link href="{{ asset('assets/css/icons/icons.min.css') }}" rel="stylesheet">
<link href="{{ asset('assets/css/bootstrap.min.css') }}" rel="stylesheet">
<link href="{{ asset('assets/css/plugins.min.css') }}" rel="stylesheet">
<link href="{{ asset('assets/plugins/bootstrap-loading/lada.min.css') }}" rel="stylesheet">
<link href="{{ asset('assets/css/style.min.css') }}" rel="stylesheet">
<link href="#" rel="stylesheet" id="theme-color">
<!-- END MANDATORY STYLE -->
<!-- BEGIN PAGE LEVEL STYLE -->
<link href="{{ asset('assets/css/animate-custom.css') }}" rel="stylesheet">
<!-- END PAGE LEVEL STYLE -->
<script src="{{ asset('assets/plugins/modernizr/modernizr-2.6.2-respond-1.1.0.min.js') }}"></script>
</head>
<body class="login fade-in" data-page="login">
<!-- BEGIN LOGIN BOX -->
<div class="container" id="login-block">
<div class="row">
<div class="col-sm-6 col-md-4 col-sm-offset-3 col-md-offset-4">
@include('backend.partials.alert')
<div class="login-box clearfix animated flipInY">
<div class="page-icon animated bounceInDown">
<img src="{{ asset('assets/img/account/user-icon.png') }}" alt="Key icon">
</div>
<div class="login-logo">
<a href="#">
<img src="{{ asset('assets/img/account/login-logo.png') }}" alt="Company Logo">
</a>
</div>
<hr>
<div class="login-form">
<!-- BEGIN ERROR BOX -->
@if($errors->all())
<div class="alert alert-danger ">
<button type="button" class="close" data-dismiss="alert">×</button>
<h4>Error!</h4>
@foreach ($errors->all('<li>:message</li>') as $message)
{{ $message }}
@endforeach
</div>
@endif
<!-- END ERROR BOX -->
{{ Form::open(['route' => 'login', 'method' => 'POST', 'role' => 'form', 'novalidate']) }}
<div class="form-group">
{{Form::email('email', null, ['class'=> 'input-field form-control user', 'placeholder' => 'Email'])}}
</div>
<div class="form-group">
{{Form::password('password', ['class' => 'input-field form-control password', 'placeholder' => 'Password'])}}
</div>
<button type="submit" class="btn btn-login ladda-button" >Login</button>
{{Form::close()}}
<div class="login-links">
<a href="/auth/forgot">Olvidastes tu Password?</a>
<br>
</div>
</div>
</div>
</div>
</div>
</div>
<!-- END LOCKSCREEN BOX -->
<!-- BEGIN MANDATORY SCRIPTS -->
<script src="{{ asset('assets/plugins/jquery-1.11.js') }}"></script>
<script src="{{ asset('assets/plugins/jquery-migrate-1.2.1.js') }}"></script>
<script src="{{ asset('assets/plugins/jquery-ui/jquery-ui-1.10.4.min.js') }}"></script>
<script src="{{ asset('assets/plugins/jquery-mobile/jquery.mobile-1.4.2.js') }}"></script>
<script src="{{ asset('assets/plugins/bootstrap/bootstrap.min.js') }}"></script>
<script src="{{ asset('assets/plugins/jquery.cookie.min.js') }}" type="text/javascript"></script>
<!-- END MANDATORY SCRIPTS -->
<!-- BEGIN PAGE LEVEL SCRIPTS -->
<script src="{{ asset('assets/plugins/backstretch/backstretch.min.js') }}"></script>
<script src="{{ asset('assets/plugins/bootstrap-loading/lada.min.js') }}"></script>
<script src="{{ asset('assets/js/account.js') }}"></script>
<!-- END PAGE LEVEL SCRIPTS -->
<script>
</body>
</html>
|
{
"content_hash": "024dc73269462793d7d34a138b7e5d4b",
"timestamp": "",
"source": "github",
"line_count": 100,
"max_line_length": 141,
"avg_line_length": 49.8,
"alnum_prop": 0.48373493975903614,
"repo_name": "ielijose/opcioninmuebles",
"id": "00f62983eaaca62af94eb792703e4e4d7e27413a",
"size": "4981",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "app/views/backend/login.blade.php",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "ApacheConf",
"bytes": "356"
},
{
"name": "CSS",
"bytes": "511015"
},
{
"name": "JavaScript",
"bytes": "2070487"
},
{
"name": "PHP",
"bytes": "438172"
}
]
}
|
import {isObject} from 'vega-util';
const number = _ => +_ || 0;
const paddingObject = _ => ({top: _, bottom: _, left: _, right: _});
export default function(_) {
return isObject(_)
? {
top: number(_.top),
bottom: number(_.bottom),
left: number(_.left),
right: number(_.right)
}
: paddingObject(number(_));
}
|
{
"content_hash": "a0b25a41f29908af6df0ab1fee25d15d",
"timestamp": "",
"source": "github",
"line_count": 16,
"max_line_length": 68,
"avg_line_length": 22.875,
"alnum_prop": 0.5136612021857924,
"repo_name": "lgrammel/vega",
"id": "21f0e9de19b36a5617ce9ef7fa25be5303747f6f",
"size": "366",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "packages/vega-view/src/padding.js",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "JavaScript",
"bytes": "279085"
}
]
}
|
#include "base/ccUtils.h"
#include <stdlib.h>
#include "base/CCDirector.h"
#include "base/CCAsyncTaskPool.h"
#include "base/CCEventDispatcher.h"
#include "base/base64.h"
#include "renderer/CCCustomCommand.h"
#include "renderer/CCRenderer.h"
#include "platform/CCImage.h"
#include "platform/CCFileUtils.h"
#include "2d/CCSprite.h"
NS_CC_BEGIN
int ccNextPOT(int x)
{
x = x - 1;
x = x | (x >> 1);
x = x | (x >> 2);
x = x | (x >> 4);
x = x | (x >> 8);
x = x | (x >>16);
return x + 1;
}
namespace utils
{
/**
* Capture screen implementation, don't use it directly.
*/
void onCaptureScreen(const std::function<void(bool, const std::string&)>& afterCaptured, const std::string& filename)
{
static bool startedCapture = false;
if (startedCapture)
{
CCLOG("Screen capture is already working");
if (afterCaptured)
{
afterCaptured(false, filename);
}
return;
}
else
{
startedCapture = true;
}
auto glView = Director::getInstance()->getOpenGLView();
auto frameSize = glView->getFrameSize();
#if (CC_TARGET_PLATFORM == CC_PLATFORM_MAC) || (CC_TARGET_PLATFORM == CC_PLATFORM_WIN32) || (CC_TARGET_PLATFORM == CC_PLATFORM_LINUX)
frameSize = frameSize * glView->getFrameZoomFactor() * glView->getRetinaFactor();
#endif
int width = static_cast<int>(frameSize.width);
int height = static_cast<int>(frameSize.height);
bool succeed = false;
std::string outputFile = "";
do
{
std::shared_ptr<GLubyte> buffer(new GLubyte[width * height * 4], [](GLubyte* p){ CC_SAFE_DELETE_ARRAY(p); });
if (!buffer)
{
break;
}
glPixelStorei(GL_PACK_ALIGNMENT, 1);
glReadPixels(0, 0, width, height, GL_RGBA, GL_UNSIGNED_BYTE, buffer.get());
std::shared_ptr<GLubyte> flippedBuffer(new GLubyte[width * height * 4], [](GLubyte* p) { CC_SAFE_DELETE_ARRAY(p); });
if (!flippedBuffer)
{
break;
}
for (int row = 0; row < height; ++row)
{
memcpy(flippedBuffer.get() + (height - row - 1) * width * 4, buffer.get() + row * width * 4, width * 4);
}
Image* image = new (std::nothrow) Image;
if (image)
{
image->initWithRawData(flippedBuffer.get(), width * height * 4, width, height, 8);
if (FileUtils::getInstance()->isAbsolutePath(filename))
{
outputFile = filename;
}
else
{
CCASSERT(filename.find("/") == std::string::npos, "The existence of a relative path is not guaranteed!");
outputFile = FileUtils::getInstance()->getWritablePath() + filename;
}
// Save image in AsyncTaskPool::TaskType::TASK_IO thread, and call afterCaptured in mainThread
static bool succeedSaveToFile = false;
std::function<void(void*)> mainThread = [afterCaptured, outputFile](void* param)
{
if (afterCaptured)
{
afterCaptured(succeedSaveToFile, outputFile);
}
startedCapture = false;
};
AsyncTaskPool::getInstance()->enqueue(AsyncTaskPool::TaskType::TASK_IO, mainThread, (void*)NULL, [image, outputFile]()
{
succeedSaveToFile = image->saveToFile(outputFile);
delete image;
});
}
else
{
CCLOG("Malloc Image memory failed!");
if (afterCaptured)
{
afterCaptured(succeed, outputFile);
}
startedCapture = false;
}
} while (0);
}
/*
* Capture screen interface
*/
static EventListenerCustom* s_captureScreenListener;
static CustomCommand s_captureScreenCommand;
void captureScreen(const std::function<void(bool, const std::string&)>& afterCaptured, const std::string& filename)
{
if (s_captureScreenListener)
{
CCLOG("Warning: CaptureScreen has been called already, don't call more than once in one frame.");
return;
}
s_captureScreenCommand.init(std::numeric_limits<float>::max());
s_captureScreenCommand.func = std::bind(onCaptureScreen, afterCaptured, filename);
s_captureScreenListener = Director::getInstance()->getEventDispatcher()->addCustomEventListener(Director::EVENT_AFTER_DRAW, [](EventCustom *event) {
auto director = Director::getInstance();
director->getEventDispatcher()->removeEventListener((EventListener*)(s_captureScreenListener));
s_captureScreenListener = nullptr;
director->getRenderer()->addCommand(&s_captureScreenCommand);
director->getRenderer()->render();
});
}
std::vector<Node*> findChildren(const Node &node, const std::string &name)
{
std::vector<Node*> vec;
node.enumerateChildren(name, [&vec](Node* nodeFound) -> bool {
vec.push_back(nodeFound);
return false;
});
return vec;
}
#define MAX_ITOA_BUFFER_SIZE 256
double atof(const char* str)
{
if (str == nullptr)
{
return 0.0;
}
char buf[MAX_ITOA_BUFFER_SIZE];
strncpy(buf, str, MAX_ITOA_BUFFER_SIZE);
// strip string, only remain 7 numbers after '.'
char* dot = strchr(buf, '.');
if (dot != nullptr && dot - buf + 8 < MAX_ITOA_BUFFER_SIZE)
{
dot[8] = '\0';
}
return ::atof(buf);
}
double gettime()
{
struct timeval tv;
gettimeofday(&tv, nullptr);
return (double)tv.tv_sec + (double)tv.tv_usec/1000000;
}
long long getTimeInMilliseconds()
{
struct timeval tv;
gettimeofday (&tv, nullptr);
return tv.tv_sec * 1000 + tv.tv_usec / 1000;
}
Rect getCascadeBoundingBox(Node *node)
{
Rect cbb;
Size contentSize = node->getContentSize();
// check all children bounding box, get maximize box
Node* child = nullptr;
bool merge = false;
for(auto object : node->getChildren())
{
child = dynamic_cast<Node*>(object);
if (!child->isVisible()) continue;
const Rect box = getCascadeBoundingBox(child);
if (box.size.width <= 0 || box.size.height <= 0) continue;
if (!merge)
{
cbb = box;
merge = true;
}
else
{
cbb.merge(box);
}
}
// merge content size
if (contentSize.width > 0 && contentSize.height > 0)
{
const Rect box = RectApplyAffineTransform(Rect(0, 0, contentSize.width, contentSize.height), node->getNodeToWorldAffineTransform());
if (!merge)
{
cbb = box;
}
else
{
cbb.merge(box);
}
}
return cbb;
}
Sprite* createSpriteFromBase64(const char* base64String)
{
unsigned char* decoded;
int length = base64Decode((const unsigned char*) base64String, (unsigned int) strlen(base64String), &decoded);
Image *image = new (std::nothrow) Image();
bool imageResult = image->initWithImageData(decoded, length);
CCASSERT(imageResult, "Failed to create image from base64!");
free(decoded);
Texture2D *texture = new (std::nothrow) Texture2D();
texture->initWithImage(image);
texture->setAliasTexParameters();
image->release();
Sprite* sprite = Sprite::createWithTexture(texture);
texture->release();
return sprite;
}
}
NS_CC_END
|
{
"content_hash": "2cbac9a59bcf200b30e96845211fca14",
"timestamp": "",
"source": "github",
"line_count": 269,
"max_line_length": 152,
"avg_line_length": 27.78810408921933,
"alnum_prop": 0.5892976588628762,
"repo_name": "endaye/c2d-Game2048",
"id": "83d35a562465c75c12446932f5a13cc1bbb4d38f",
"size": "8768",
"binary": false,
"copies": "3",
"ref": "refs/heads/master",
"path": "cocos2d/cocos/base/ccUtils.cpp",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Batchfile",
"bytes": "120"
},
{
"name": "C",
"bytes": "1829911"
},
{
"name": "C++",
"bytes": "13924116"
},
{
"name": "CMake",
"bytes": "234829"
},
{
"name": "GLSL",
"bytes": "61034"
},
{
"name": "Java",
"bytes": "668397"
},
{
"name": "JavaScript",
"bytes": "14719"
},
{
"name": "Lua",
"bytes": "15057"
},
{
"name": "Makefile",
"bytes": "35961"
},
{
"name": "Objective-C",
"bytes": "2958573"
},
{
"name": "Objective-C++",
"bytes": "473222"
},
{
"name": "Python",
"bytes": "54318"
},
{
"name": "Shell",
"bytes": "23730"
}
]
}
|
<?php
namespace INCES\ComedorBundle\Form;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilder;
class UsuarioMenuType extends AbstractType
{
public function buildForm(FormBuilder $builder, array $options)
{
$builder
->add('dia')
->add('usuario')
->add('menu')
;
}
public function getName()
{
return 'inces_comedorbundle_usuariomenutype';
}
}
|
{
"content_hash": "f4323865d6e7ca8aecc09621b814421e",
"timestamp": "",
"source": "github",
"line_count": 23,
"max_line_length": 67,
"avg_line_length": 19.869565217391305,
"alnum_prop": 0.6236323851203501,
"repo_name": "gmunumel/INCES-Comedor-Symfony2",
"id": "bfb5ed56c66a54653276fb281d29e21e8cf249a6",
"size": "457",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/INCES/ComedorBundle/Form/UsuarioMenuType.php",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "34996"
},
{
"name": "JavaScript",
"bytes": "82440"
},
{
"name": "PHP",
"bytes": "185400"
}
]
}
|
package convenientadditions.block.machine.ironFarm;
import convenientadditions.api.capabilities.stackhandler.ItemStackHandlerAutoSaveOutputOnly;
import convenientadditions.base.block.tileentity.CATileEntity;
import net.minecraft.init.Items;
import net.minecraft.item.ItemStack;
import net.minecraft.util.ITickable;
public class TileEntityIronFarm extends CATileEntity implements ITickable {
public int tier=0;
public int progress=0;
public ItemStackHandlerAutoSaveOutputOnly inv=addCapability(addAutoSavable(new ItemStackHandlerAutoSaveOutputOnly(this)));
public ItemStack iron=new ItemStack(Items.IRON_INGOT);
public TileEntityIronFarm(){}
public TileEntityIronFarm(int tier){this.tier=tier;}
@Override
public void update() {
if (world.isRemote)
return;
int timeNeeded=3000/(int)Math.pow(4,tier);
int count=inv.getStackInSlot(0).getCount();
if(count<iron.getMaxStackSize() && ++progress >= timeNeeded){
progress=0;
inv.setStackInSlot(0,new ItemStack(Items.IRON_INGOT,count+1));
}
}
}
|
{
"content_hash": "2603daa9ed148cc15fe6e056a30726de",
"timestamp": "",
"source": "github",
"line_count": 31,
"max_line_length": 126,
"avg_line_length": 35.58064516129032,
"alnum_prop": 0.7370806890299184,
"repo_name": "Necr0/ConvenientAdditions",
"id": "d709969d98822fd459ba3d9d2f0f68fa442edd01",
"size": "1103",
"binary": false,
"copies": "1",
"ref": "refs/heads/1.11.2",
"path": "src/main/java/convenientadditions/block/machine/ironFarm/TileEntityIronFarm.java",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Java",
"bytes": "801610"
}
]
}
|
package gnieh.sohva
import spray.json._
/** start sequence of a change stream. */
sealed trait Since {
def option: Option[String]
}
/** Start at the given update sequence. */
final case class UpdateSequence(seq: JsValue) extends Since {
def option = Some(CompactPrinter(seq))
}
/** Start with changes from now on. */
case object Now extends Since {
def option = Some("now")
}
/** Start at the beginning of time. */
case object Origin extends Since {
def option = None
}
|
{
"content_hash": "1a4bdff78d8d1a3880bf52e66bbb6703",
"timestamp": "",
"source": "github",
"line_count": 21,
"max_line_length": 61,
"avg_line_length": 22.904761904761905,
"alnum_prop": 0.7027027027027027,
"repo_name": "gnieh/sohva",
"id": "9432f6663cb4e52329e433570a9d78cceb3cfff0",
"size": "1105",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/main/scala/gnieh/sohva/Since.scala",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "22959"
},
{
"name": "HTML",
"bytes": "5087"
},
{
"name": "JavaScript",
"bytes": "10164"
},
{
"name": "Ruby",
"bytes": "4423"
},
{
"name": "Scala",
"bytes": "216938"
}
]
}
|
using System.Reflection;
using System.Runtime.InteropServices;
using Bridge.ClientTest.Batch3.BridgeIssues;
[assembly: Bridge3273.MyAssembly]
[assembly: AssemblyTitle("Bridge client tests")]
[assembly: AssemblyProduct("Bridge client tests")]
[assembly: AssemblyDescription("Bridge Test library - test github issues up to #1999")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
[assembly: ComVisible(false)]
[assembly: Guid("13940d0b-c16d-40b6-ba71-18c9eb086832")]
|
{
"content_hash": "bb8702e86f10413c41429ee2e6a232f2",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 87,
"avg_line_length": 40.07692307692308,
"alnum_prop": 0.7888675623800384,
"repo_name": "AndreyZM/Bridge",
"id": "7137281eed9ba3a29b548a5bb99ee522d0bc7b12",
"size": "521",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "Tests/Batch3/Properties/AssemblyInfo.cs",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Batchfile",
"bytes": "4769"
},
{
"name": "C#",
"bytes": "23533024"
},
{
"name": "CSS",
"bytes": "507"
},
{
"name": "HTML",
"bytes": "190"
},
{
"name": "JavaScript",
"bytes": "3937"
},
{
"name": "PowerShell",
"bytes": "5284"
},
{
"name": "Shell",
"bytes": "7698"
}
]
}
|
<?php
namespace Pasinter\ApiBundle;
use Symfony\Component\HttpKernel\Bundle\Bundle;
class PasinterApiBundle extends Bundle
{
}
|
{
"content_hash": "8b0fa4f73b697aa885870ccc6feb447c",
"timestamp": "",
"source": "github",
"line_count": 9,
"max_line_length": 47,
"avg_line_length": 14.444444444444445,
"alnum_prop": 0.8076923076923077,
"repo_name": "pasinter/SymfonyApp",
"id": "174745c06daedb5fd43595863fe7111690a38095",
"size": "130",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/Pasinter/ApiBundle/PasinterApiBundle.php",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "JavaScript",
"bytes": "1738"
},
{
"name": "PHP",
"bytes": "89528"
},
{
"name": "Ruby",
"bytes": "1261"
}
]
}
|
<?xml version="1.0" encoding="UTF-8"?>
<!--
~ Copyright 2021 The Netty Project
~
~ The Netty Project licenses this file to you under the Apache License,
~ version 2.0 (the "License"); you may not use this file except in compliance
~ with the License. You may obtain a copy of the License at:
~
~ https://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing, software
~ distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
~ WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
~ License for the specific language governing permissions and limitations
~ under the License.
-->
<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 https://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>io.netty</groupId>
<artifactId>netty-parent</artifactId>
<version>4.1.86.Final-SNAPSHOT</version>
</parent>
<artifactId>netty-transport-classes-kqueue</artifactId>
<name>Netty/Transport/Classes/KQueue</name>
<packaging>jar</packaging>
<properties>
<javaModuleName>io.netty.transport.classes.kqueue</javaModuleName>
</properties>
<dependencies>
<dependency>
<groupId>io.netty</groupId>
<artifactId>netty-common</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>io.netty</groupId>
<artifactId>netty-buffer</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>io.netty</groupId>
<artifactId>netty-transport</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>io.netty</groupId>
<artifactId>netty-transport-native-unix-common</artifactId>
<version>${project.version}</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<artifactId>maven-jar-plugin</artifactId>
</plugin>
</plugins>
</build>
</project>
|
{
"content_hash": "e9b5f9324477159941d0a820744cf4a6",
"timestamp": "",
"source": "github",
"line_count": 64,
"max_line_length": 202,
"avg_line_length": 33.5,
"alnum_prop": 0.6861007462686567,
"repo_name": "netty/netty",
"id": "ebcc584f724277e457ce27494477db4c6bb22b81",
"size": "2144",
"binary": false,
"copies": "1",
"ref": "refs/heads/4.1",
"path": "transport-classes-kqueue/pom.xml",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "C",
"bytes": "214487"
},
{
"name": "CSS",
"bytes": "49"
},
{
"name": "Groovy",
"bytes": "1755"
},
{
"name": "HTML",
"bytes": "21064"
},
{
"name": "Java",
"bytes": "18544460"
},
{
"name": "JavaScript",
"bytes": "16232"
},
{
"name": "Makefile",
"bytes": "1814"
},
{
"name": "Shell",
"bytes": "17716"
}
]
}
|
position: absolute;
top: 150px;
left: 300px;
}
div.shape {
display: inline-block;
overflow: hidden;
width: 60px;
height: 60px;
line-height: 60px;
margin-right: 5px;
text-align: center;
font-size: 12px;
color: black;
border-width: 5px;
border-style: solid;
}
@-webkit-keyframes rotate {
from { -webkit-transform: rotate(0deg) translate(-100px) rotate(0deg); }
to { -webkit-transform: rotate(360deg) translate(-100px) rotate(-360deg); }
}
@-moz-keyframes rotate {
from { -moz-transform: rotate(0deg) translate(-100px) rotate(0deg); }
to { -moz-transform: rotate(360deg) translate(-100px) rotate(-360deg); }
}
@-ms-keyframes rotate {
from { -ms-transform: rotate(0deg) translate(-100px) rotate(0deg); }
to { -ms-transform: rotate(360deg) translate(-100px) rotate(-360deg); }
}
.circle {
border-radius: 50px;
-webkit-animation: rotate 2s linear infinite;
-moz-animation: rotate 2s linear infinite;
-o-animation: rotate 2s linear infinite;
animation: rotate 2s linear infinite;
}
@-webkit-keyframes rectangle {
0% { -webkit-transform: translate( 0px, 0px); }
25% { -webkit-transform: translate(200px, 0px); }
50% { -webkit-transform: translate(200px, 200px); }
75% { -webkit-transform: translate( 0px, 200px); }
}
@-moz-keyframes rectangle {
0% { -moz-transform: translate( 0px, 0px); }
25% { -moz-transform: translate(200px, 0px); }
50% { -moz-transform: translate(200px, 200px); }
75% { -moz-transform: translate( 0px, 200px); }
}
@-ms-keyframes rectangle {
0% { -ms-transform: translate( 0px, 0px); }
25% { -ms-transform: translate(200px, 0px); }
50% { -ms-transform: translate(200px, 200px); }
75% { -ms-transform: translate( 0px, 200px); }
}
.rectangle {
-webkit-animation: rectangle 2s linear infinite;
-moz-animation: rectangle 2s linear infinite;
-o-animation: rectangle 2s linear infinite;
animation: rectangle 2s linear infinite;
}
|
{
"content_hash": "3ddf44536215e9f37d500c2d6b4e9415",
"timestamp": "",
"source": "github",
"line_count": 72,
"max_line_length": 79,
"avg_line_length": 28.194444444444443,
"alnum_prop": 0.6433497536945813,
"repo_name": "StefanSinapov/TelerikAcademy",
"id": "810e8d808e8d9deec24cfa78c09022b9a6b223bd",
"size": "2041",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "09. JavaScript ООП/01. Advanced Functions/02. Moving Nodes/styles/styles.css",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "ASP.NET",
"bytes": "366155"
},
{
"name": "Batchfile",
"bytes": "174"
},
{
"name": "C",
"bytes": "1487"
},
{
"name": "C#",
"bytes": "6534646"
},
{
"name": "C++",
"bytes": "32601"
},
{
"name": "CSS",
"bytes": "372478"
},
{
"name": "CoffeeScript",
"bytes": "14486"
},
{
"name": "HTML",
"bytes": "1242490"
},
{
"name": "Java",
"bytes": "11797"
},
{
"name": "JavaScript",
"bytes": "6374608"
},
{
"name": "Less",
"bytes": "106505"
},
{
"name": "PHP",
"bytes": "5957"
},
{
"name": "Pug",
"bytes": "78294"
},
{
"name": "SCSS",
"bytes": "24196"
},
{
"name": "Shell",
"bytes": "148"
},
{
"name": "Stylus",
"bytes": "3188"
},
{
"name": "TSQL",
"bytes": "2219288"
},
{
"name": "TypeScript",
"bytes": "14385"
},
{
"name": "Vim Snippet",
"bytes": "49568"
},
{
"name": "XSLT",
"bytes": "6879"
}
]
}
|
.. JavaScript documentation master file
JavaScript Data API documentation
==================================
.. toctree::
:maxdepth: 1
:hidden:
Assembly API <clients/js/assembly>
Genome Annotation API <clients/js/genome_annotation>
Taxon API <clients/js/taxon>
The Data API provides a unified entry point to retrieve and, eventually,
store KBase data objects. This page describes the JavaScript client API.
All APIs use the Thrift protocol to communicate between the client and server.
JavaScript Notes
-----------------
Packaging with Require
++++++++++++++++++++++
The JavaScript client API wraps the Thrift auto-generated API. It is packaged
so that it can be easily included in other JavaScript projects with ``require``.
Asynchronous API with Promises
++++++++++++++++++++++++++++++
Because it is meant to be used in interactive widgets and web pages, the
API has also been implemented using an asynchronous ``promise`` interface:
every call returns a promise object immediately, and the caller can decide
when and how to wait for the result. The API uses the "bluebird" promises
library; for more information see `this tutorial page <http://bluebirdjs.com/docs/why-promises.html>`_ and `the bluebird code on github <https://github.com/petkaantonov/bluebird/>`_.
|
{
"content_hash": "cd78a1b655b5ecb5923e455fb5caec83",
"timestamp": "",
"source": "github",
"line_count": 32,
"max_line_length": 182,
"avg_line_length": 40.46875,
"alnum_prop": 0.7173745173745174,
"repo_name": "mlhenderson/data_api",
"id": "8c9cc939c8f2033f7394b77a84b28461a3005285",
"size": "1295",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "docs/javascript.rst",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "9594"
},
{
"name": "HTML",
"bytes": "77123"
},
{
"name": "JavaScript",
"bytes": "594489"
},
{
"name": "Jupyter Notebook",
"bytes": "5342297"
},
{
"name": "Makefile",
"bytes": "10254"
},
{
"name": "Perl",
"bytes": "681703"
},
{
"name": "Python",
"bytes": "659006"
},
{
"name": "Shell",
"bytes": "4628"
},
{
"name": "Thrift",
"bytes": "45335"
}
]
}
|
End of preview.