text stringlengths 2 1.04M | meta dict |
|---|---|
module Azure::Consumption::Mgmt::V2019_05_01
module Models
#
# Error response indicates that the service is not able to process the
# incoming request. The reason is provided in the error message.
#
class ErrorResponse
include MsRestAzure
# @return [ErrorDetails] The details of the error.
attr_accessor :error
#
# Mapper for ErrorResponse class as Ruby Hash.
# This will be used for serialization/deserialization.
#
def self.mapper()
{
client_side_validation: true,
required: false,
serialized_name: 'ErrorResponse',
type: {
name: 'Composite',
class_name: 'ErrorResponse',
model_properties: {
error: {
client_side_validation: true,
required: false,
serialized_name: 'error',
type: {
name: 'Composite',
class_name: 'ErrorDetails'
}
}
}
}
}
end
end
end
end
| {
"content_hash": "d707b88a260d95183bb08187fe9cf7ca",
"timestamp": "",
"source": "github",
"line_count": 43,
"max_line_length": 74,
"avg_line_length": 25.58139534883721,
"alnum_prop": 0.5181818181818182,
"repo_name": "Azure/azure-sdk-for-ruby",
"id": "459686e1eab5c3fbadbbf4333fc268c1a59d104d",
"size": "1264",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "management/azure_mgmt_consumption/lib/2019-05-01/generated/azure_mgmt_consumption/models/error_response.rb",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Ruby",
"bytes": "345216400"
},
{
"name": "Shell",
"bytes": "305"
}
],
"symlink_target": ""
} |
Run `gcli` binary and check its output.
```bash
$ cd $GOPATH/src/github.com/tcnksm/gcli
$ make tests
```
You can also run it on docker container,
```bash
$ cd $GOPATH/src/github.com/tcnksm/gcli
$ ./test-docker.sh
```
| {
"content_hash": "7aa486c47d8a304ff6952fea2529290c",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 40,
"avg_line_length": 17,
"alnum_prop": 0.6832579185520362,
"repo_name": "tacahilo/gcli",
"id": "d9ddcf0500799cd5dc025e394ba5443ae4347400",
"size": "230",
"binary": false,
"copies": "5",
"ref": "refs/heads/master",
"path": "tests/README.md",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Go",
"bytes": "38884"
},
{
"name": "Makefile",
"bytes": "383"
},
{
"name": "Shell",
"bytes": "221"
}
],
"symlink_target": ""
} |
<?php
//Auto-generated by ArtaxServiceBuilder - https://github.com/Danack/ArtaxServiceBuilder
//
//Do not be surprised when any changes to this file are over-written.
//
namespace GithubService\Operation;
class searchCode implements \ArtaxServiceBuilder\Operation {
/**
* @var \GithubService\GithubArtaxService\GithubArtaxService
*/
public $api = null;
/**
* @var array
*/
public $parameters = null;
/**
* @var \Amp\Artax\Response
*/
public $response = null;
/**
* @var \Amp\Artax\Response
*/
public $originalResponse = null;
/**
* Get the last response.
*
* @return \Amp\Artax\Response
*/
public function getResponse() {
return $this->response;
}
/**
* Set the last response. This should only be used by the API class when the
* operation has been dispatched. Storing the response is required as some APIs
* store out-of-bound information in the headers e.g. rate-limit info, pagination
* that is not really part of the operation.
*/
public function setResponse(\Amp\Artax\Response $response) {
$this->response = $response;
}
public function __construct(\GithubService\GithubArtaxService\GithubArtaxService $api) {
$this->api = $api;
}
public function setAPI(\GithubService\GithubArtaxService\GithubArtaxService $api) {
$this->api = $api;
}
public function setParams(array $params) {
}
public function getParameters() {
return $this->parameters;
}
/**
* Apply any filters necessary to the parameter
*
* @return mixed
* @param string $name The name of the parameter to get.
*/
public function getFilteredParameter($name) {
if (array_key_exists($name, $this->parameters) == false) {
throw new \Exception('Parameter '.$name.' does not exist.');
}
$value = $this->parameters[$name];
return $value;
}
/**
* Create an Amp\Artax\Request object from the operation.
*
* @return \Amp\Artax\Request
*/
public function createRequest() {
$request = new \Amp\Artax\Request();
$url = null;
$request->setMethod('');
//Parameters are parsed and set, lets prepare the request
if ($url == null) {
$url = "https://api.github.com";
}
$request->setUri($url);
return $request;
}
/**
* Create and execute the operation, returning the raw response from the server.
*
* @return \Amp\Artax\Response
*/
public function createAndExecute() {
$request = $this->createRequest();
$response = $this->api->execute($request, $this);
$this->response = $response;
return $response;
}
/**
* Create and execute the operation, then return the processed response.
*
* @return mixed|\
*/
public function call() {
$request = $this->createRequest();
$response = $this->api->execute($request, $this);
$this->response = $response;
if ($this->shouldResponseBeProcessed($response)) {
$instance = $this->api->instantiateResult($response, $this);
return $instance;
}
return $response;
}
/**
* Execute the operation, returning the parsed response
*
* @return mixed
*/
public function execute() {
$request = $this->createRequest();
return $this->dispatch($request);
}
/**
* Execute the operation asynchronously, passing the parsed response to the
* callback
*
* @return \Amp\Promise
*/
public function executeAsync(callable $callable) {
$request = $this->createRequest();
return $this->dispatchAsync($request, $callable);
}
/**
* Dispatch the request for this operation and process the response. Allows you to
* modify the request before it is sent.
*
* @return mixed
* @param \Amp\Artax\Request $request The request to be processed
*/
public function dispatch(\Amp\Artax\Request $request) {
$response = $this->api->execute($request, $this);
$this->response = $response;
$instance = $this->api->instantiateResult($response, $this);
return $instance;
}
/**
* Dispatch the request for this operation and process the response asynchronously.
* Allows you to modify the request before it is sent.
*
* @return mixed
* @param \Amp\Artax\Request $request The request to be processed
* @param callable $callable The callable that processes the response
*/
public function dispatchAsync(\Amp\Artax\Request $request, callable $callable) {
return $this->api->executeAsync($request, $this, $callable);
}
/**
* Dispatch the request for this operation and process the response. Allows you to
* modify the request before it is sent.
*
* @return mixed
* @param \Amp\Artax\Response $response The HTTP response.
*/
public function processResponse(\Amp\Artax\Response $response) {
$instance = $this->api->instantiateResult($response, $this);
return $instance;
}
/**
* Determine whether the response should be processed. Override this method to have
* a per-operation decision, otherwise the function is the API class will be used.
*
* @return mixed
*/
public function shouldResponseBeProcessed(\Amp\Artax\Response $response) {
return $this->api->shouldResponseBeProcessed($response);
}
/**
* Determine whether the response is an error. Override this method to have a
* per-operation decision, otherwise the function from the API class will be used.
*
* @return null|\ArtaxServiceBuilder\BadResponseException
*/
public function translateResponseToException(\Amp\Artax\Response $response) {
return $this->api->translateResponseToException($response);
}
/**
* Determine whether the response indicates that we should use a cached response.
* Override this method to have a per-operation decision, otherwise the
* functionfrom the API class will be used.
*
* @return mixed
*/
public function shouldUseCachedResponse(\Amp\Artax\Response $response) {
return $this->api->shouldUseCachedResponse($response);
}
/**
* Determine whether the response should be cached. Override this method to have a
* per-operation decision, otherwise the function from the API class will be used.
*
* @return mixed
*/
public function shouldResponseBeCached(\Amp\Artax\Response $response) {
return $this->api->shouldResponseBeCached($response);
}
/**
* Set the original response. This may be different from the cached response if one
* is used.
*/
public function setOriginalResponse(\Amp\Artax\Response $response) {
$this->originalResponse = $response;
}
/**
* Get the original response. This may be different from the cached response if one
* is used.
*
* @return \Amp\Artax\Response
*/
public function getOriginalResponse() {
return $this->originalResponse;
}
/**
* Return how the result of this operation should be instantiated.
*
* @return \Amp\Artax\Response
*/
public function getResultInstantiationInfo() {
return null;
}
}
| {
"content_hash": "4adf1693065c1692024c209f9d9cd3d7",
"timestamp": "",
"source": "github",
"line_count": 264,
"max_line_length": 92,
"avg_line_length": 28.553030303030305,
"alnum_prop": 0.623109578137437,
"repo_name": "Danack/GithubArtaxService",
"id": "12f209d773be0add627bfbbdeff58719be173e87",
"size": "7538",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "lib/GithubService/Operation/searchCode.php",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "PHP",
"bytes": "2357319"
},
{
"name": "Ruby",
"bytes": "99744"
}
],
"symlink_target": ""
} |
var GenericRouter = function(config) {
config = config || {};
GenericRouter.superclass.constructor.call(this, config);
};
Ext.extend(GenericRouter, Ext.Component, {
page: {}
,window: {}
,grid: {}
,tree: {}
,panel: {}
,combo: {}
,config: {}
});
Ext.reg('genericrouter', GenericRouter);
GenericRouter = new GenericRouter();
| {
"content_hash": "3300b600e663a8dd9eb8b6328666cae5",
"timestamp": "",
"source": "github",
"line_count": 16,
"max_line_length": 60,
"avg_line_length": 22.4375,
"alnum_prop": 0.6100278551532033,
"repo_name": "OptimusCrime/modx-generic-router",
"id": "f24d13de6308fadd588f629854e9f97dddce159e",
"size": "359",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "assets/components/genericrouter/js/mgr/genericrouter.class.js",
"mode": "33261",
"license": "mit",
"language": [
{
"name": "JavaScript",
"bytes": "16174"
},
{
"name": "PHP",
"bytes": "53682"
},
{
"name": "Smarty",
"bytes": "46"
}
],
"symlink_target": ""
} |
dojo.provide("dojo.tests.store.Cache");
dojo.require("dojo.store.Memory");
dojo.require("dojo.store.Cache");
(function(){
var masterStore = new dojo.store.Memory({
data: [
{id: 1, name: "one", prime: false},
{id: 2, name: "two", even: true, prime: true},
{id: 3, name: "three", prime: true},
{id: 4, name: "four", even: true, prime: false},
{id: 5, name: "five", prime: true}
]
});
var cachingStore = new dojo.store.Memory();
var options = {};
var store = dojo.store.Cache(masterStore, cachingStore, options);
tests.register("dojo.tests.store.Cache",
[
function testGet(t){
t.is(store.get(1).name, "one");
t.is(cachingStore.get(1).name, "one"); // second one should be cached
t.is(store.get(1).name, "one");
t.is(store.get(4).name, "four");
t.is(cachingStore.get(4).name, "four");
t.is(store.get(4).name, "four");
},
function testQuery(t){
options.isLoaded = function(){ return false;};
t.is(store.query({prime: true}).length, 3);
t.is(store.query({even: true})[1].name, "four");
t.is(cachingStore.get(3), undefined);
options.isLoaded = function(){ return true;};
t.is(store.query({prime: true}).length, 3);
t.is(cachingStore.get(3).name, "three");
},
function testQueryWithSort(t){
t.is(store.query({prime: true}, {sort:[{attribute:"name"}]}).length, 3);
t.is(store.query({even: true}, {sort:[{attribute:"name"}]})[1].name, "two");
},
function testPutUpdate(t){
var four = store.get(4);
four.square = true;
store.put(four);
four = store.get(4);
t.t(four.square);
four = cachingStore.get(4);
t.t(four.square);
four = masterStore.get(4);
t.t(four.square);
},
function testPutNew(t){
store.put({
id: 6,
perfect: true
});
t.t(store.get(6).perfect);
t.t(cachingStore.get(6).perfect);
t.t(masterStore.get(6).perfect);
},
function testAddDuplicate(t){
var threw;
try{
store.add({
id: 6,
perfect: true
});
}catch(e){
threw = true;
}
t.t(threw);
},
function testAddNew(t){
store.add({
id: 7,
prime: true
});
t.t(store.get(7).prime);
t.t(cachingStore.get(7).prime);
t.t(masterStore.get(7).prime);
},
function testResultsFromMaster(t){
var originalAdd = masterStore.add;
masterStore.add = function(object){
return {
test: "value"
};
};
t.is(store.add({
id: 7,
prop: "doesn't matter"
}).test, "value");
masterStore.add = originalAdd;
}
]
);
})();
| {
"content_hash": "de2f05f7e9ba0467e342f721ba9265a0",
"timestamp": "",
"source": "github",
"line_count": 96,
"max_line_length": 80,
"avg_line_length": 26.739583333333332,
"alnum_prop": 0.5808336579664979,
"repo_name": "amdharness/AmdHarness-amd-xml-test-Intern",
"id": "2c2217ea6545a5634a4d0c92bcea446ea430baac",
"size": "2567",
"binary": false,
"copies": "8",
"ref": "refs/heads/master",
"path": "node_modules/intern/node_modules/dojo/tests-doh/store/Cache.js",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "ApacheConf",
"bytes": "82"
},
{
"name": "JavaScript",
"bytes": "15311"
},
{
"name": "XSLT",
"bytes": "761"
}
],
"symlink_target": ""
} |
<!DOCTYPE html>
<html lang="en" class="js">
<head>
<title>Popovers - eMAG Apps UI KIT</title>
<link rel="stylesheet" href="../dist/plugins/css3spinners/css3-spinners.1.2.2.min.css">
<!-- PLUGIN: jqGrid: Added in demo for boostrap tabs. Is not necessary for boostrap tabs.-->
<link rel="stylesheet" href="../dist/plugins/jqgrid/ui.jqgrid.min.css" data-dependency-name="jqgrid_css">
<?php include_once "modules/_mod_meta.php"?>
<?php include_once "modules/_mod_top_include.php"?>
</head>
<?php include_once "modules/_mod_browser_upgrade.php"?>
<!-- HEADER:Start -->
<?php include_once "modules/_mod_header.php" ?>
<!-- HEADER:End -->
<!-- PAGE:Start -->
<div class="main-container" id="main-container">
<div class="main-container-inner">
<!-- SIDEBAR:Start -->
<?php include_once "modules/_mod_sidebar.php" ?>
<!-- SIDEBAR:End -->
<!-- CONTENT:Start -->
<div class="main-content">
<section class="page-content">
<section id="js-popovers">
<div class="show-panel code-example">
<div class="show-panel-body code-example">
<h2><strong>Popovers</strong></h2>
<div class="code-container">
<div class="row flex-container code-header no-border-top">
<div class="col-xs-8 module-description">
<h4><b>Types of popovers</b></h4>
</div>
<div class="col-xs-4">
<a class="btn btn-default btn-sm pull-right btn-source collapsed" data-toggle="collapse" href="#popovers" aria-expanded="false" aria-controls="popovers"><i class="fa fa-chevron-left"></i><i class="fa fa-chevron-right"></i><span>CODE</span></a>
</div>
</div>
<div class="collapse code-example" id="popovers">
<!-- Nav tabs -->
<ul class="nav nav-tabs code-example" role="tablist">
<li role="presentation" class="active"><a href="#popovers_html_source" aria-controls="popovers_html" role="tab" data-toggle="tab">HTML</a></li>
<li role="presentation"><a href="#popovers_js_source" aria-controls="popovers_js" role="tab" data-toggle="tab">JS</a></li>
<li role="presentation"><a href="#popovers_css_source" aria-controls="popovers_css" role="tab" data-toggle="tab">CSS</a></li>
</ul>
<!-- Tab panes -->
<div class="tab-content code-example">
<div role="tabpanel" class="tab-pane html-source active" id="popovers_html_source">
<pre class="language-html"><code class="language-html" data-showcase="code"></code></pre>
</div>
<div role="tabpanel" class="tab-pane js-source" id="popovers_js_source">
<pre class="language-html"><code class="language-html" data-showcase="code"></code></pre>
</div>
<div role="tabpanel" class="tab-pane css-source" id="popovers_css_source">
<pre class="language-html"><code class="language-html" data-showcase="code"></code></pre>
</div>
</div>
</div>
<div class="row">
<div class="col-sm-12">
<div class="pad-15" data-showcase="example" data-dependencies="main_style,main_script,jquery,tether_source">
<button type="button" class="btn btn-default" data-type="danger" data-toggle="popover" title="Popover title" data-placement="top" data-content="Popover type danger">Type danger</button>
<button type="button" class="btn btn-default" data-type="warning" data-toggle="popover" title="Popover title" data-placement="bottom" data-content="Popover type warning">Type warning</button>
<button type="button" class="btn btn-default" data-type="default" data-toggle="popover" title="Popover title" data-placement="left" data-content="Popover type default">Type default</button>
<button type="button" class="btn btn-default" data-toggle="popover" title="Popover title" data-placement="right" data-content="Popover without type">Without type</button>
</div>
</div>
</div>
<div class="row">
<div class="col-sm-12">
<div class="pad-15">
<div class="alert alert-warning no-margin-bottom"><p><i class="fa fa-warning fonts-up-140"></i>
In case you use popover, take care that it can be seen when is open. Bellow you have a <strong>wrong</strong> example. It can not be seen beacause of sidebar. The right way in this case is to align to the <strong>top</strong>, <strong>right</strong> or <strong>bottom</strong>.
</p></div>
<div class="row mg-top-30">
<div class="col-sm-6">
<button type="button" class="btn btn-default" data-type="default" data-toggle="popover" title="Popover title" data-placement="left" data-content="Wrong position">Wrong way</button>
<button type="button" class="btn btn-default" data-type="default" data-toggle="popover" title="Popover title" data-placement="top" data-content="Right position">Right way</button>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</section>
</section>
</div>
</div>
<!-- CONTENT:End -->
<!-- FOOTER:Start -->
<?php include_once "modules/_mod_footer.php" ?>
<!-- FOOTER:End -->
</div>
</div>
<!-- PAGE:End -->
<div data-dependency-name="pop_space_empty">
<!-- Div with id 'pop_space' must be inserted before the end of the body tag -->
<div id="pop_space"></div>
</div>
<!-- POPUPS:Start -->
<div data-dependency-name="pop_space">
<!-- Div with id 'pop_space' must be inserted before the end of the body tag -->
<div id="pop_space">
<div class="modal fade" id="myDemoModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span
aria-hidden="true"><i class="fa fa-remove"></i></span></button>
<h4 class="modal-title" id="myModalLabel">Standard modal</h4>
</div>
<div class="modal-body">
<h2>Suspendisse rutrum</h2>
<p class="lead">Lorem ipsum dolor sit amet, consectetur adipiscing elit.</p>
<div class="pad-sep-20">
<span class="caption">Nam scelerisque nunc</span>
</div>
<p>
Curabitur porta non est in consectetur. Aenean ut purus volutpat, sodales sem nec, fermentum massa. Pellentesque sed magna nisi.<br>
Suspendisse venenatis massa quis velit fringilla, ac consequat dolor tincidunt. Etiam nec fermentum lectus, quis dignissim nunc.
</p>
</div>
<div class="modal-footer">
<div class="pull-right panel-controls">
<button class="btn btn-success" data-dismiss="modal"><span>Yeah, got it</span></button>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div id="pop_space">
<div class="modal fade" id="ajaxModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span
aria-hidden="true"><i class="fa fa-remove"></i></span></button>
<h4 class="modal-title" id="myModalLabel">This is an AJAX modal</h4>
</div>
<div class="modal-body">
<div class="pad-btm-20 text-center">
This modal can contain any kind of info.<br>
Check out the code documentation on the main page.
</div>
<div class="embed-responsive embed-responsive-16by9">
<iframe width="560" height="315" src="https://www.youtube.com/embed/9cNpKRXwaj4" allowfullscreen=""></iframe>
</div>
</div>
<div class="modal-footer">
<div class="pull-right panel-controls">
<button class="btn btn-success" data-dismiss="modal"><span>Save</span></button>
<button class="btn btn-default" data-dismiss="modal"><span>Cancel</span></button>
</div>
</div>
</div>
</div>
</div>
</div>
<!-- SCRIPTS:Start -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js" data-dependency-name="jquery"></script>
<script>window.jQuery || document.write("<script src=\"../dist/js/lib/jquery-3.3.1.min.js\">"+"<"+"/script>")</script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery-migrate/3.0.1/jquery-migrate.min.js"></script>
<script src="../dist/plugins/tether/tether.min.js" data-dependency-name="tether_source"></script>
<script src="../dist/js/main_script.min.js" data-dependency-name="main_script"></script>
<script src="../dist/js/demo_helpers.js"></script>
<!-- PLUGIN: PRISM: This plugin helps display demo code. Don't add it everywhere -->
<script src="../dist/plugins/prism/prism.min.js"></script>
<!-- PLUGIN: jqGrid: Added in demo for boostrap tabs. Is not necessary for boostrap tabs.-->
<script src="../dist/plugins/jqgrid/i18n/grid.locale-en.js" data-dependency-name="grid_locale_en_source"></script>
<script src="../dist/plugins/jqgrid/jquery.jqGrid.min.js" data-dependency-name="jqgrid_source"></script>
<!-- BOTTOM SCRIPTS:Start -->
<?php include_once "modules/_mod_bottom_scripts.php"; ?>
<!-- BOTTOM SCRIPTS:End -->
<!-- SCRIPTS:End -->
<!-- DOCUMENT-READY:Start -->
<script type="text/javascript">
$(document).ready(function () {
demoHelpers(); // Require demo_helpers.js
showPageCode();
});
</script>
<!-- DOCUMENT-READY:End -->
</body>
</html>
| {
"content_hash": "e12c7924ab6f539a39a8a38d915e58d5",
"timestamp": "",
"source": "github",
"line_count": 206,
"max_line_length": 329,
"avg_line_length": 59.4126213592233,
"alnum_prop": 0.4899093063158755,
"repo_name": "eMAGTechLabs/emag-apps-ui-kit",
"id": "036894128e2b73a7e345ff81f04aeba33f6a97ea",
"size": "12239",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "demo/js_components_popovers.php",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "743480"
},
{
"name": "HTML",
"bytes": "4527"
},
{
"name": "JavaScript",
"bytes": "3163223"
}
],
"symlink_target": ""
} |
package com.orange.clara.cloud.servicedbdumper.utiltest;
import com.fasterxml.jackson.databind.ObjectMapper;
import org.junit.runner.Description;
import org.junit.runner.Result;
import org.junit.runner.notification.RunListener;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.io.File;
import java.io.IOException;
import java.net.URISyntaxException;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;
public class TestListener extends RunListener {
protected static final String DIRECTORY_REPORTS = "reports";
protected static final String FILE_FORMAT = "dd-MM-yyyy_HHmm";
protected Logger logger = LoggerFactory.getLogger(TestListener.class);
@Override
public void testRunFinished(Result result) throws Exception {
List<ReportIntegration> reportIntegrations = ReportManager.getAllReports();
for (ReportIntegration reportIntegration : reportIntegrations) {
this.formatReport(reportIntegration);
}
this.createReportFile();
super.testRunFinished(result);
}
@Override
public void testIgnored(Description description) throws Exception {
logger.warn(description.toString());
super.testIgnored(description);
}
private void formatReport(ReportIntegration reportIntegration) {
String title = "---------" + reportIntegration.getName() + "---------";
logger.info("\u001b[0;34m{}\u001B[0;0m", title);
if (reportIntegration.isSkipped()) {
logger.info("\u001b[1;36mResult: {}\u001B[0;0m", "\u001B[1;33mSkipped");
logger.info("\u001b[1;36mSkip reason\u001B[0;0m: {}", reportIntegration.getSkippedReason());
logger.info(this.createSeparator(title.length()));
return;
}
if (reportIntegration.isFailed()) {
logger.info("\u001b[1;36mResult: {}\u001B[0;0m", "\u001B[0;31mFailed");
logger.info(this.createSeparator(title.length()));
return;
}
logger.info("\u001b[1;36mResult\u001B[0;0m: {}", "\u001B[0;32mPassed\u001B[0;0m");
if (reportIntegration.getPopulateFakeDataTime() != 0L) {
logger.info("\u001b[1;36mCreate fake data duration\u001B[0;0m: {}", humanize.Humanize.duration(reportIntegration.getPopulateFakeDataTime()));
}
logger.info("\u001b[1;36mFake data file size (in bytes)\u001B[0;0m: {}", reportIntegration.getFakeDataFileSize());
logger.info("\u001b[1;36mPopulate fake data duration\u001B[0;0m: {}", humanize.Humanize.duration(reportIntegration.getPopulateToDatabaseTime()));
logger.info("\u001b[1;36mDump database source duration\u001B[0;0m: {}", humanize.Humanize.duration(reportIntegration.getDumpDatabaseSourceTime()));
logger.info("\u001b[1;36mRestore database source to database target duration\u001B[0;0m: {}", humanize.Humanize.duration(reportIntegration.getRestoreDatabaseSourceToTargetTime()));
logger.info("\u001b[1;36mDump database target duration\u001B[0;0m: {}", humanize.Humanize.duration(reportIntegration.getDumpDatabaseTargetTime()));
logger.info("\u001b[1;36mDiff duration against source and target databases\u001B[0;0m: {}", humanize.Humanize.duration(reportIntegration.getDiffTime()));
logger.info(this.createSeparator(title.length()));
}
private String createSeparator(int length) {
String separator = "";
for (int i = 0; i < length; i++) {
separator += "-";
}
return separator + "\n";
}
private void createReportFile() throws IOException, URISyntaxException {
Date d = new Date();
SimpleDateFormat form = new SimpleDateFormat(FILE_FORMAT);
File jsonFile = new File(DIRECTORY_REPORTS + File.separator + form.format(d) + ".json");
File dir = jsonFile.getParentFile();
if (!dir.isDirectory()) {
dir.mkdirs();
}
ObjectMapper mapper = new ObjectMapper();
mapper.writerWithDefaultPrettyPrinter().writeValue(jsonFile, ReportManager.getAllReports());
}
}
| {
"content_hash": "1d12fe93bd7167080ead7828105a7d59",
"timestamp": "",
"source": "github",
"line_count": 88,
"max_line_length": 188,
"avg_line_length": 46.54545454545455,
"alnum_prop": 0.6845703125,
"repo_name": "orange-cloudfoundry/db-dumper-service",
"id": "c21de28b9dfb0919fab4fe9cbf0c9bdb56745773",
"size": "4409",
"binary": false,
"copies": "3",
"ref": "refs/heads/master",
"path": "src/test/java/com/orange/clara/cloud/servicedbdumper/utiltest/TestListener.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "3660"
},
{
"name": "Dockerfile",
"bytes": "1813"
},
{
"name": "HTML",
"bytes": "23155"
},
{
"name": "Java",
"bytes": "671687"
},
{
"name": "JavaScript",
"bytes": "19737"
},
{
"name": "Shell",
"bytes": "14176"
}
],
"symlink_target": ""
} |
SYNONYM
#### According to
The Catalogue of Life, 3rd January 2011
#### Published in
Fl. mycol. (Paris) 33 (1888)
#### Original name
Cyphella muscicola Fr., 1822
### Remarks
null | {
"content_hash": "e27afc4afdba2123c8c8f6340b23e76b",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 39,
"avg_line_length": 13.923076923076923,
"alnum_prop": 0.6906077348066298,
"repo_name": "mdoering/backbone",
"id": "03b3afc77b0e94abfc4b7fe7f745868b3786c72b",
"size": "242",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "life/Fungi/Basidiomycota/Agaricomycetes/Agaricales/Inocybaceae/Chromocyphella/Chromocyphella muscicola/ Syn. Arrhenia muscicola/README.md",
"mode": "33188",
"license": "apache-2.0",
"language": [],
"symlink_target": ""
} |
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("KaleyLab.Data.EntityFramework")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("KaleyLab.Data.EntityFramework")]
[assembly: AssemblyCopyright("Copyright © 2014")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("3f4aba5c-d312-40da-9e4c-7633e79fa229")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
| {
"content_hash": "48acf7cd983dca24618706b83a054ac1",
"timestamp": "",
"source": "github",
"line_count": 36,
"max_line_length": 84,
"avg_line_length": 39.75,
"alnum_prop": 0.7484276729559748,
"repo_name": "kaleylab/KaleyLab",
"id": "495f763b183b2912ff8120213eb009073e9e49c1",
"size": "1434",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "KaleyLab.Data.EntityFramework/Properties/AssemblyInfo.cs",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C#",
"bytes": "220691"
}
],
"symlink_target": ""
} |
SYNONYM
#### According to
The Catalogue of Life, 3rd January 2011
#### Published in
null
#### Original name
null
### Remarks
null | {
"content_hash": "2d155059802140120d45cd44dc6c7031",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 39,
"avg_line_length": 10.23076923076923,
"alnum_prop": 0.6917293233082706,
"repo_name": "mdoering/backbone",
"id": "0d60343951d0aa40b59fe8a83fc5caed336a2818",
"size": "194",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "life/Plantae/Magnoliophyta/Magnoliopsida/Solanales/Convolvulaceae/Jacquemontia/Jacquemontia pentanthos/ Syn. Jacquemontia canescens/README.md",
"mode": "33188",
"license": "apache-2.0",
"language": [],
"symlink_target": ""
} |
module Firstfm
class Event
attr_accessor :id, :title, :url, :venue, :tag, :description, :attendance, :website, :start_date, :reviews, :artists, :headliner, :tags, :images
def self.init_events_from_hash(hash)
return [] unless hash["events"] && hash["events"]["event"]
return [init_event_from_hash(hash["events"]["event"])] if hash["events"]["event"].is_a?(Hash)
hash["events"]["event"].inject([]) do |arr, venue_hash|
arr << init_event_from_hash(venue_hash)
arr
end
end
def self.init_event_from_hash(hash)
return nil unless hash.is_a?(Hash)
event = Event.new
event.id = hash["id"]
event.title = hash["title"]
event.url = hash["url"]
event.tag = hash["tag"]
event.venue = Venue.init_venue_from_hash(hash["venue"])
event.description = hash["description"]
event.attendance = hash["attendance"]
event.reviews = hash["reviews"]
event.website = hash["website"]
event.start_date = hash['startDate']
event.artists = hash['artists']['artist'] if hash['artists']
event.headliner = hash['artists']['headliner'] if hash['artists']
event.tags = hash["tags"]["tag"] if hash["tags"]
event.images = hash["image"]
event
end
end
end | {
"content_hash": "b7b7576e208d0fd402840305d06c951e",
"timestamp": "",
"source": "github",
"line_count": 39,
"max_line_length": 147,
"avg_line_length": 33.64102564102564,
"alnum_prop": 0.5945121951219512,
"repo_name": "egze/firstfm",
"id": "cab23f486a5093bbf1f3c63dedf3a713d71bc311",
"size": "1312",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "lib/firstfm/event.rb",
"mode": "33261",
"license": "mit",
"language": [
{
"name": "Ruby",
"bytes": "30871"
}
],
"symlink_target": ""
} |
package iaas.uni.stuttgart.de.prosit.graph.processtree;
import java.util.ArrayList;
import java.util.List;
import org.jgrapht.Graph;
import org.jgrapht.experimental.dag.DirectedAcyclicGraph;
import org.jgrapht.graph.DefaultEdge;
import org.jgrapht.graph.SimpleGraph;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
import iaas.uni.stuttgart.de.prosit.graph.AbstractBPEL2SESEGraphTransformer;
import iaas.uni.stuttgart.de.prosit.graph.activity.BPELVertex;
/**
* Class implements a transformation from a BPEL XML Document to a JGraphT Graph
*
*
* @author Kalman Kepes - kepeskn@studi.informatik.uni-stuttgart.de
*
*/
public class BPEL2ProcessTreeTransformer extends AbstractBPEL2SESEGraphTransformer {
public Graph<BPELVertex, DefaultEdge> transform2graph(Element bpelRoot, boolean includeRoot) {
// try {
// System.out
// .println("Transforming: \n " + Util.domToString(bpelRoot));
// } catch (TransformerFactoryConfigurationError e) {
// // TODO Auto-generated catch block
// e.printStackTrace();
// } catch (TransformerException e) {
// // TODO Auto-generated catch block
// e.printStackTrace();
// }
Graph<BPELVertex, DefaultEdge> graph = new DirectedAcyclicGraph<BPELVertex, DefaultEdge>(DefaultEdge.class);
if (includeRoot) {
BPELVertex rootVertex = new BPELVertex(bpelRoot);
graph.addVertex(rootVertex);
this.buildGraph(bpelRoot, rootVertex, graph);
} else {
this.buildGraph(bpelRoot, null, graph);
}
System.out.println("Finished graph transformation");
System.out.println("VertexSetSize: " + graph.vertexSet().size());
System.out.println("EdgeSetSize: " + graph.edgeSet().size());
return graph;
}
@Override
public boolean isStructuralActivity(BPELVertex vertex) {
switch (vertex.getElement().getLocalName()) {
case "sequence":
return true;
default:
return false;
}
}
private void buildGraph(Node currentXMLNode, BPELVertex graphRoot, Graph<BPELVertex, DefaultEdge> graph) {
System.out.println("BPELTransformer#buildGraph# Current Node: " + currentXMLNode.getLocalName());
if (graphRoot != null) {
System.out.println("BPELTransformer#buildGraph# Predeccessor: " + graphRoot.getElement().getLocalName());
}
NodeList nodeList = currentXMLNode.getChildNodes();
List<BPELVertex> addedVertices = new ArrayList<BPELVertex>();
for (int i = 0; i < nodeList.getLength(); i++) {
Node childNode = nodeList.item(i);
System.out.println("BPELTransformer#buildGraph# Creating child node: " + childNode.getLocalName());
if (childNode.getNodeType() == Node.ELEMENT_NODE
&& this.isValidBPELActivity(childNode.getLocalName())) {
BPELVertex newVertex = new BPELVertex((Element) childNode);
graph.addVertex(newVertex);
addedVertices.add(newVertex);
if (graphRoot != null) {
System.out.println(
"BPELTransformer#buildGraph# Adding Edge: (" + graphRoot.getElement().getLocalName() + ","
+ newVertex.getElement().getLocalName() + ")");
DefaultEdge edge = graph.addEdge(graphRoot, newVertex);
System.out.println("Contents of added Edge: " + edge + " #");
}
// add the preceding child node as predecessor. this keeps an
// ordering preserving control flow in sequences (TODO except in
// flow)
System.out.println("Looking for previous sibling of " + childNode.getLocalName());
if (this.findPreviousActivityElement((Element) childNode) != null) {
System.out.println("Sibling exists!");
BPELVertex sibling = this.getBPELVertex(addedVertices, new BPELVertex(
this.findPreviousActivityElement((Element) childNode)));
graph.addEdge(sibling, newVertex);
}
buildGraph(childNode, newVertex, graph);
}
}
}
}
| {
"content_hash": "cbaad4d2374d1d60e41ae4ec416a4922",
"timestamp": "",
"source": "github",
"line_count": 111,
"max_line_length": 110,
"avg_line_length": 33.990990990990994,
"alnum_prop": 0.7235621521335807,
"repo_name": "nyuuyn/ProSit",
"id": "c954cd268997d9c7a742e2670fa61f4e609dc557",
"size": "3773",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/main/java/iaas/uni/stuttgart/de/prosit/graph/processtree/BPEL2ProcessTreeTransformer.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Java",
"bytes": "359092"
}
],
"symlink_target": ""
} |
<?php
/**
* Sage includes
*
* The $sage_includes array determines the code library included in your theme.
* Add or remove files to the array as needed. Supports child theme overrides.
*
* Please note that missing files will produce a fatal error.
*
* @link https://github.com/roots/sage/pull/1042
*/
$sage_includes = [
'lib/assets.php', // Scripts and stylesheets
'lib/extras.php', // Custom functions
'lib/setup.php', // Theme setup
'lib/titles.php', // Page titles
'lib/wrapper.php', // Theme wrapper class
'lib/wp_bootstrap_navwalker.php'
];
foreach ($sage_includes as $file) {
if (!$filepath = locate_template($file)) {
trigger_error(sprintf(__('Error locating %s for inclusion', 'sage'), $file), E_USER_ERROR);
}
require_once $filepath;
}
unset($file, $filepath);
| {
"content_hash": "bdcb76469b7cbc886acb5477d70cc231",
"timestamp": "",
"source": "github",
"line_count": 29,
"max_line_length": 95,
"avg_line_length": 27.896551724137932,
"alnum_prop": 0.6736711990111248,
"repo_name": "drala/kcm-theme",
"id": "7775db6010cbca383ff2c20e982ea8a746177f41",
"size": "809",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "functions.php",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "2743"
},
{
"name": "JavaScript",
"bytes": "11487"
},
{
"name": "PHP",
"bytes": "22327"
}
],
"symlink_target": ""
} |
<!DOCTYPE html>
<!--[if IE]><![endif]-->
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title>Class Test
</title>
<meta name="viewport" content="width=device-width">
<meta name="title" content="Class Test
">
<meta name="generator" content="docfx 2.12.1.0">
<link rel="shortcut icon" href="../favicon.ico">
<link rel="stylesheet" href="../styles/docfx.vendor.css">
<link rel="stylesheet" href="../styles/docfx.css">
<link rel="stylesheet" href="../styles/main.css">
<meta property="docfx:navrel" content="../toc.html">
<meta property="docfx:tocrel" content="toc.html">
</head>
<body data-spy="scroll" data-target="#affix">
<div id="wrapper">
<header>
<nav id="autocollapse" class="navbar navbar-inverse ng-scope" role="navigation">
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#navbar">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="../index.html">
<img id="logo" class="svg" src="../logo.svg" alt="">
</a>
</div>
<div class="collapse navbar-collapse" id="navbar">
<form class="navbar-form navbar-right" role="search" id="search">
<div class="form-group">
<input type="text" class="form-control" id="search-query" placeholder="Search" autocomplete="off">
</div>
</form>
</div>
</div>
</nav>
<div class="subnav navbar navbar-default">
<div class="container hide-when-search" id="breadcrumb">
<ul class="breadcrumb">
<li></li>
</ul>
</div>
</div>
</header>
<div role="main" class="container body-content hide-when-search">
<div class="sidenav hide-when-search">
<a class="btn toc-toggle collapse" data-toggle="collapse" href="#sidetoggle" aria-expanded="false" aria-controls="sidetoggle">Show / Hide Table of Contents</a>
<div class="sidetoggle collapse" id="sidetoggle">
<div id="sidetoc"></div>
</div>
</div>
<div class="article row grid-right">
<div class="col-md-10">
<article class="content wrap" id="_content">
<h1 id="EnumerableTest_Test" data-uid="EnumerableTest.Test">Class Test
</h1>
<div class="markdown level0 summary"><p>Represents a result of a unit test.</p>
<p>
単体テストの結果を表す。
</p>
</div>
<div class="markdown level0 conceptual"></div>
<div class="inheritance">
<h5>Inheritance</h5>
<div class="level0"><span class="xref">System.Object</span></div>
<div class="level1"><span class="xref">Test</span></div>
<div class="level2"><a class="xref" href="EnumerableTest.Sdk.AssertionTest.html">AssertionTest</a></div>
<div class="level2"><a class="xref" href="EnumerableTest.Sdk.GroupTest.html">GroupTest</a></div>
</div>
<div class="inheritedMembers">
<h5>Inherited Members</h5>
<div>
<span class="xref">System.Object.Equals(System.Object)</span>
</div>
<div>
<span class="xref">System.Object.Equals(System.Object, System.Object)</span>
</div>
<div>
<span class="xref">System.Object.GetHashCode()</span>
</div>
<div>
<span class="xref">System.Object.GetType()</span>
</div>
<div>
<span class="xref">System.Object.MemberwiseClone()</span>
</div>
<div>
<span class="xref">System.Object.ReferenceEquals(System.Object, System.Object)</span>
</div>
<div>
<span class="xref">System.Object.ToString()</span>
</div>
</div>
<h6><strong>Namespace</strong>:EnumerableTest</h6>
<h6><strong>Assembly</strong>:EnumerableTest.Core.dll</h6>
<h5 id="EnumerableTest_Test_syntax">Syntax</h5>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public abstract class Test</code></pre>
</div>
<h3 id="properties">Properties
</h3>
<span class="small pull-right mobile-hide">
<span class="divider">|</span>
<a href="https://github.com/vain0/EnumerableTest/new/master/apiSpec/new?filename=EnumerableTest_Test_Data.md&value=---%0Auid%3A%20EnumerableTest.Test.Data%0Asummary%3A%20'*You%20can%20override%20summary%20for%20the%20API%20here%20using%20*MARKDOWN*%20syntax'%0A---%0A%0A*Please%20type%20below%20more%20information%20about%20this%20API%3A*%0A%0A">Improve this Doc</a>
</span>
<span class="small pull-right mobile-hide">
<a href="https://github.com/vain0/EnumerableTest/blob/master/EnumerableTest.Core/Test.cs/#L42">View Source</a>
</span>
<a id="EnumerableTest_Test_Data_" data-uid="EnumerableTest.Test.Data*"></a>
<h4 id="EnumerableTest_Test_Data" data-uid="EnumerableTest.Test.Data">Data</h4>
<div class="markdown level1 summary"><p>Gets the data related to the test.</p>
<p>
テストに関連するデータを取得する。
</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="decalaration">Declaration</h5>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public TestData Data { get; }</code></pre>
</div>
<h5 class="propertyValue">Property Value</h5>
<table class="table table-bordered table-striped table-condensed">
<thead>
<tr>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><a class="xref" href="EnumerableTest.Sdk.TestData.html">TestData</a></td>
<td></td>
</tr>
</tbody>
</table>
<span class="small pull-right mobile-hide">
<span class="divider">|</span>
<a href="https://github.com/vain0/EnumerableTest/new/master/apiSpec/new?filename=EnumerableTest_Test_IsPassed.md&value=---%0Auid%3A%20EnumerableTest.Test.IsPassed%0Asummary%3A%20'*You%20can%20override%20summary%20for%20the%20API%20here%20using%20*MARKDOWN*%20syntax'%0A---%0A%0A*Please%20type%20below%20more%20information%20about%20this%20API%3A*%0A%0A">Improve this Doc</a>
</span>
<span class="small pull-right mobile-hide">
<a href="https://github.com/vain0/EnumerableTest/blob/master/EnumerableTest.Core/Test.cs/#L34">View Source</a>
</span>
<a id="EnumerableTest_Test_IsPassed_" data-uid="EnumerableTest.Test.IsPassed*"></a>
<h4 id="EnumerableTest_Test_IsPassed" data-uid="EnumerableTest.Test.IsPassed">IsPassed</h4>
<div class="markdown level1 summary"><p>Gets a value indicating whether the test was passed.</p>
<p>
テストが成功したかどうかを取得する。
</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="decalaration">Declaration</h5>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public abstract bool IsPassed { get; }</code></pre>
</div>
<h5 class="propertyValue">Property Value</h5>
<table class="table table-bordered table-striped table-condensed">
<thead>
<tr>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><span class="xref">System.Boolean</span></td>
<td></td>
</tr>
</tbody>
</table>
<span class="small pull-right mobile-hide">
<span class="divider">|</span>
<a href="https://github.com/vain0/EnumerableTest/new/master/apiSpec/new?filename=EnumerableTest_Test_Name.md&value=---%0Auid%3A%20EnumerableTest.Test.Name%0Asummary%3A%20'*You%20can%20override%20summary%20for%20the%20API%20here%20using%20*MARKDOWN*%20syntax'%0A---%0A%0A*Please%20type%20below%20more%20information%20about%20this%20API%3A*%0A%0A">Improve this Doc</a>
</span>
<span class="small pull-right mobile-hide">
<a href="https://github.com/vain0/EnumerableTest/blob/master/EnumerableTest.Core/Test.cs/#L26">View Source</a>
</span>
<a id="EnumerableTest_Test_Name_" data-uid="EnumerableTest.Test.Name*"></a>
<h4 id="EnumerableTest_Test_Name" data-uid="EnumerableTest.Test.Name">Name</h4>
<div class="markdown level1 summary"><p>Gets the name.</p>
<p>
テストの名前を取得する。
</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="decalaration">Declaration</h5>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public string Name { get; }</code></pre>
</div>
<h5 class="propertyValue">Property Value</h5>
<table class="table table-bordered table-striped table-condensed">
<thead>
<tr>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><span class="xref">System.String</span></td>
<td></td>
</tr>
</tbody>
</table>
<span class="small pull-right mobile-hide">
<span class="divider">|</span>
<a href="https://github.com/vain0/EnumerableTest/new/master/apiSpec/new?filename=EnumerableTest_Test_Pass.md&value=---%0Auid%3A%20EnumerableTest.Test.Pass%0Asummary%3A%20'*You%20can%20override%20summary%20for%20the%20API%20here%20using%20*MARKDOWN*%20syntax'%0A---%0A%0A*Please%20type%20below%20more%20information%20about%20this%20API%3A*%0A%0A">Improve this Doc</a>
</span>
<span class="small pull-right mobile-hide">
<a href="https://github.com/vain0/EnumerableTest/blob/master/EnumerableTest.Core/Test.cs/#L93">View Source</a>
</span>
<a id="EnumerableTest_Test_Pass_" data-uid="EnumerableTest.Test.Pass*"></a>
<h4 id="EnumerableTest_Test_Pass" data-uid="EnumerableTest.Test.Pass">Pass</h4>
<div class="markdown level1 summary"><p>Gets a unit test which is passed.</p>
<p>
「正常」を表す単体テストの結果を取得する。
</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="decalaration">Declaration</h5>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public static Test Pass { get; }</code></pre>
</div>
<h5 class="propertyValue">Property Value</h5>
<table class="table table-bordered table-striped table-condensed">
<thead>
<tr>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><a class="xref" href="EnumerableTest.Test.html">Test</a></td>
<td></td>
</tr>
</tbody>
</table>
<h3 id="methods">Methods
</h3>
<span class="small pull-right mobile-hide">
<span class="divider">|</span>
<a href="https://github.com/vain0/EnumerableTest/new/master/apiSpec/new?filename=EnumerableTest_Test_Catch__1_System_Action_.md&value=---%0Auid%3A%20EnumerableTest.Test.Catch%60%601(System.Action)%0Asummary%3A%20'*You%20can%20override%20summary%20for%20the%20API%20here%20using%20*MARKDOWN*%20syntax'%0A---%0A%0A*Please%20type%20below%20more%20information%20about%20this%20API%3A*%0A%0A">Improve this Doc</a>
</span>
<span class="small pull-right mobile-hide">
<a href="https://github.com/vain0/EnumerableTest/blob/master/EnumerableTest.Core/Test.cs/#L157">View Source</a>
</span>
<a id="EnumerableTest_Test_Catch_" data-uid="EnumerableTest.Test.Catch*"></a>
<h4 id="EnumerableTest_Test_Catch__1_System_Action_" data-uid="EnumerableTest.Test.Catch``1(System.Action)">Catch<E>(Action)</h4>
<div class="markdown level1 summary"><p>Tests that an action throws an exception of type <span class="typeparamref">E</span>.</p>
<p>
アクションが型 <span class="typeparamref">E</span> の例外を送出することを検査する。
</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="decalaration">Declaration</h5>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public static Test Catch<E>(Action f)where E : Exception</code></pre>
</div>
<h5 class="parameters">Parameters</h5>
<table class="table table-bordered table-striped table-condensed">
<thead>
<tr>
<th>Type</th>
<th>Name</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><span class="xref">System.Action</span></td>
<td><span class="parametername">f</span></td>
<td></td>
</tr>
</tbody>
</table>
<h5 class="returns">Returns</h5>
<table class="table table-bordered table-striped table-condensed">
<thead>
<tr>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><a class="xref" href="EnumerableTest.Test.html">Test</a></td>
<td></td>
</tr>
</tbody>
</table>
<h5 class="typeParameters">Type Parameters</h5>
<table class="table table-bordered table-striped table-condensed">
<thead>
<tr>
<th>Name</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><span class="parametername">E</span></td>
<td></td>
</tr>
</tbody>
</table>
<span class="small pull-right mobile-hide">
<span class="divider">|</span>
<a href="https://github.com/vain0/EnumerableTest/new/master/apiSpec/new?filename=EnumerableTest_Test_Catch__1_System_Func_System_Object__.md&value=---%0Auid%3A%20EnumerableTest.Test.Catch%60%601(System.Func%7BSystem.Object%7D)%0Asummary%3A%20'*You%20can%20override%20summary%20for%20the%20API%20here%20using%20*MARKDOWN*%20syntax'%0A---%0A%0A*Please%20type%20below%20more%20information%20about%20this%20API%3A*%0A%0A">Improve this Doc</a>
</span>
<span class="small pull-right mobile-hide">
<a href="https://github.com/vain0/EnumerableTest/blob/master/EnumerableTest.Core/Test.cs/#L187">View Source</a>
</span>
<a id="EnumerableTest_Test_Catch_" data-uid="EnumerableTest.Test.Catch*"></a>
<h4 id="EnumerableTest_Test_Catch__1_System_Func_System_Object__" data-uid="EnumerableTest.Test.Catch``1(System.Func{System.Object})">Catch<E>(Func<Object>)</h4>
<div class="markdown level1 summary"><p>Tests that a function throws an exception of type <span class="typeparamref">E</span>.</p>
<p>
関数が型 <span class="typeparamref">E</span> の例外を送出することを検査する。
</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="decalaration">Declaration</h5>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public static Test Catch<E>(Func<object> f)where E : Exception</code></pre>
</div>
<h5 class="parameters">Parameters</h5>
<table class="table table-bordered table-striped table-condensed">
<thead>
<tr>
<th>Type</th>
<th>Name</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><span class="xref">System.Func</span><<span class="xref">System.Object</span>></td>
<td><span class="parametername">f</span></td>
<td></td>
</tr>
</tbody>
</table>
<h5 class="returns">Returns</h5>
<table class="table table-bordered table-striped table-condensed">
<thead>
<tr>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><a class="xref" href="EnumerableTest.Test.html">Test</a></td>
<td></td>
</tr>
</tbody>
</table>
<h5 class="typeParameters">Type Parameters</h5>
<table class="table table-bordered table-striped table-condensed">
<thead>
<tr>
<th>Name</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><span class="parametername">E</span></td>
<td></td>
</tr>
</tbody>
</table>
<span class="small pull-right mobile-hide">
<span class="divider">|</span>
<a href="https://github.com/vain0/EnumerableTest/new/master/apiSpec/new?filename=EnumerableTest_Test_Equal__1___0___0_.md&value=---%0Auid%3A%20EnumerableTest.Test.Equal%60%601(%60%600%2C%60%600)%0Asummary%3A%20'*You%20can%20override%20summary%20for%20the%20API%20here%20using%20*MARKDOWN*%20syntax'%0A---%0A%0A*Please%20type%20below%20more%20information%20about%20this%20API%3A*%0A%0A">Improve this Doc</a>
</span>
<span class="small pull-right mobile-hide">
<a href="https://github.com/vain0/EnumerableTest/blob/master/EnumerableTest.Core/Test.cs/#L125">View Source</a>
</span>
<a id="EnumerableTest_Test_Equal_" data-uid="EnumerableTest.Test.Equal*"></a>
<h4 id="EnumerableTest_Test_Equal__1___0___0_" data-uid="EnumerableTest.Test.Equal``1(``0,``0)">Equal<X>(X, X)</h4>
<div class="markdown level1 summary"><p>Equivalent to <a class="xref" href="EnumerableTest.TestExtension.html#EnumerableTest_TestExtension_Is__1___0___0_">Is<X>(X, X)</a>.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="decalaration">Declaration</h5>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public static Test Equal<X>(X expected, X actual)</code></pre>
</div>
<h5 class="parameters">Parameters</h5>
<table class="table table-bordered table-striped table-condensed">
<thead>
<tr>
<th>Type</th>
<th>Name</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><span class="xref">X</span></td>
<td><span class="parametername">expected</span></td>
<td></td>
</tr>
<tr>
<td><span class="xref">X</span></td>
<td><span class="parametername">actual</span></td>
<td></td>
</tr>
</tbody>
</table>
<h5 class="returns">Returns</h5>
<table class="table table-bordered table-striped table-condensed">
<thead>
<tr>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><a class="xref" href="EnumerableTest.Test.html">Test</a></td>
<td></td>
</tr>
</tbody>
</table>
<h5 class="typeParameters">Type Parameters</h5>
<table class="table table-bordered table-striped table-condensed">
<thead>
<tr>
<th>Name</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><span class="parametername">X</span></td>
<td></td>
</tr>
</tbody>
</table>
<span class="small pull-right mobile-hide">
<span class="divider">|</span>
<a href="https://github.com/vain0/EnumerableTest/new/master/apiSpec/new?filename=EnumerableTest_Test_Equal__1___0___0_System_Collections_IEqualityComparer_.md&value=---%0Auid%3A%20EnumerableTest.Test.Equal%60%601(%60%600%2C%60%600%2CSystem.Collections.IEqualityComparer)%0Asummary%3A%20'*You%20can%20override%20summary%20for%20the%20API%20here%20using%20*MARKDOWN*%20syntax'%0A---%0A%0A*Please%20type%20below%20more%20information%20about%20this%20API%3A*%0A%0A">Improve this Doc</a>
</span>
<span class="small pull-right mobile-hide">
<a href="https://github.com/vain0/EnumerableTest/blob/master/EnumerableTest.Core/Test.cs/#L107">View Source</a>
</span>
<a id="EnumerableTest_Test_Equal_" data-uid="EnumerableTest.Test.Equal*"></a>
<h4 id="EnumerableTest_Test_Equal__1___0___0_System_Collections_IEqualityComparer_" data-uid="EnumerableTest.Test.Equal``1(``0,``0,System.Collections.IEqualityComparer)">Equal<X>(X, X, IEqualityComparer)</h4>
<div class="markdown level1 summary"><p>Tests that two values are equal, using <span class="paramref">comparer</span>.</p>
<p>
<span class="paramref">comparer</span> で比較して、2つの値が等しいことを検査する。
</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="decalaration">Declaration</h5>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public static Test Equal<X>(X expected, X actual, IEqualityComparer comparer)</code></pre>
</div>
<h5 class="parameters">Parameters</h5>
<table class="table table-bordered table-striped table-condensed">
<thead>
<tr>
<th>Type</th>
<th>Name</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><span class="xref">X</span></td>
<td><span class="parametername">expected</span></td>
<td></td>
</tr>
<tr>
<td><span class="xref">X</span></td>
<td><span class="parametername">actual</span></td>
<td></td>
</tr>
<tr>
<td><span class="xref">System.Collections.IEqualityComparer</span></td>
<td><span class="parametername">comparer</span></td>
<td></td>
</tr>
</tbody>
</table>
<h5 class="returns">Returns</h5>
<table class="table table-bordered table-striped table-condensed">
<thead>
<tr>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><a class="xref" href="EnumerableTest.Test.html">Test</a></td>
<td></td>
</tr>
</tbody>
</table>
<h5 class="typeParameters">Type Parameters</h5>
<table class="table table-bordered table-striped table-condensed">
<thead>
<tr>
<th>Name</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><span class="parametername">X</span></td>
<td></td>
</tr>
</tbody>
</table>
<span class="small pull-right mobile-hide">
<span class="divider">|</span>
<a href="https://github.com/vain0/EnumerableTest/new/master/apiSpec/new?filename=EnumerableTest_Test_FromResult_System_String_System_Boolean_.md&value=---%0Auid%3A%20EnumerableTest.Test.FromResult(System.String%2CSystem.Boolean)%0Asummary%3A%20'*You%20can%20override%20summary%20for%20the%20API%20here%20using%20*MARKDOWN*%20syntax'%0A---%0A%0A*Please%20type%20below%20more%20information%20about%20this%20API%3A*%0A%0A">Improve this Doc</a>
</span>
<span class="small pull-right mobile-hide">
<a href="https://github.com/vain0/EnumerableTest/blob/master/EnumerableTest.Core/Test.cs/#L80">View Source</a>
</span>
<a id="EnumerableTest_Test_FromResult_" data-uid="EnumerableTest.Test.FromResult*"></a>
<h4 id="EnumerableTest_Test_FromResult_System_String_System_Boolean_" data-uid="EnumerableTest.Test.FromResult(System.String,System.Boolean)">FromResult(String, Boolean)</h4>
<div class="markdown level1 summary"><p>Creates a unit test.</p>
<p>
単体テストの結果を生成する。
</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="decalaration">Declaration</h5>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public static Test FromResult(string name, bool isPassed)</code></pre>
</div>
<h5 class="parameters">Parameters</h5>
<table class="table table-bordered table-striped table-condensed">
<thead>
<tr>
<th>Type</th>
<th>Name</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><span class="xref">System.String</span></td>
<td><span class="parametername">name</span></td>
<td></td>
</tr>
<tr>
<td><span class="xref">System.Boolean</span></td>
<td><span class="parametername">isPassed</span></td>
<td></td>
</tr>
</tbody>
</table>
<h5 class="returns">Returns</h5>
<table class="table table-bordered table-striped table-condensed">
<thead>
<tr>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><a class="xref" href="EnumerableTest.Test.html">Test</a></td>
<td></td>
</tr>
</tbody>
</table>
<span class="small pull-right mobile-hide">
<span class="divider">|</span>
<a href="https://github.com/vain0/EnumerableTest/new/master/apiSpec/new?filename=EnumerableTest_Test_FromResult_System_String_System_Boolean_EnumerableTest_Sdk_TestData_.md&value=---%0Auid%3A%20EnumerableTest.Test.FromResult(System.String%2CSystem.Boolean%2CEnumerableTest.Sdk.TestData)%0Asummary%3A%20'*You%20can%20override%20summary%20for%20the%20API%20here%20using%20*MARKDOWN*%20syntax'%0A---%0A%0A*Please%20type%20below%20more%20information%20about%20this%20API%3A*%0A%0A">Improve this Doc</a>
</span>
<span class="small pull-right mobile-hide">
<a href="https://github.com/vain0/EnumerableTest/blob/master/EnumerableTest.Core/Test.cs/#L61">View Source</a>
</span>
<a id="EnumerableTest_Test_FromResult_" data-uid="EnumerableTest.Test.FromResult*"></a>
<h4 id="EnumerableTest_Test_FromResult_System_String_System_Boolean_EnumerableTest_Sdk_TestData_" data-uid="EnumerableTest.Test.FromResult(System.String,System.Boolean,EnumerableTest.Sdk.TestData)">FromResult(String, Boolean, TestData)</h4>
<div class="markdown level1 summary"><p>Creates a unit test.</p>
<p>
単体テストの結果を生成する。
</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="decalaration">Declaration</h5>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public static Test FromResult(string name, bool isPassed, TestData data)</code></pre>
</div>
<h5 class="parameters">Parameters</h5>
<table class="table table-bordered table-striped table-condensed">
<thead>
<tr>
<th>Type</th>
<th>Name</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><span class="xref">System.String</span></td>
<td><span class="parametername">name</span></td>
<td></td>
</tr>
<tr>
<td><span class="xref">System.Boolean</span></td>
<td><span class="parametername">isPassed</span></td>
<td></td>
</tr>
<tr>
<td><a class="xref" href="EnumerableTest.Sdk.TestData.html">TestData</a></td>
<td><span class="parametername">data</span></td>
<td></td>
</tr>
</tbody>
</table>
<h5 class="returns">Returns</h5>
<table class="table table-bordered table-striped table-condensed">
<thead>
<tr>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><a class="xref" href="EnumerableTest.Test.html">Test</a></td>
<td></td>
</tr>
</tbody>
</table>
<span class="small pull-right mobile-hide">
<span class="divider">|</span>
<a href="https://github.com/vain0/EnumerableTest/new/master/apiSpec/new?filename=EnumerableTest_Test_Satisfy__1___0_System_Linq_Expressions_Expression_System_Func___0_System_Boolean___.md&value=---%0Auid%3A%20EnumerableTest.Test.Satisfy%60%601(%60%600%2CSystem.Linq.Expressions.Expression%7BSystem.Func%7B%60%600%2CSystem.Boolean%7D%7D)%0Asummary%3A%20'*You%20can%20override%20summary%20for%20the%20API%20here%20using%20*MARKDOWN*%20syntax'%0A---%0A%0A*Please%20type%20below%20more%20information%20about%20this%20API%3A*%0A%0A">Improve this Doc</a>
</span>
<span class="small pull-right mobile-hide">
<a href="https://github.com/vain0/EnumerableTest/blob/master/EnumerableTest.Core/Test.cs/#L137">View Source</a>
</span>
<a id="EnumerableTest_Test_Satisfy_" data-uid="EnumerableTest.Test.Satisfy*"></a>
<h4 id="EnumerableTest_Test_Satisfy__1___0_System_Linq_Expressions_Expression_System_Func___0_System_Boolean___" data-uid="EnumerableTest.Test.Satisfy``1(``0,System.Linq.Expressions.Expression{System.Func{``0,System.Boolean}})">Satisfy<X>(X, Expression<Func<X, Boolean>>)</h4>
<div class="markdown level1 summary"><p>Equivalent to <a class="xref" href="EnumerableTest.TestExtension.html#EnumerableTest_TestExtension_TestSatisfy__1___0_System_Linq_Expressions_Expression_System_Func___0_System_Boolean___">TestSatisfy<X>(X, Expression<Func<X, Boolean>>)</a>.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="decalaration">Declaration</h5>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public static Test Satisfy<X>(X value, Expression<Func<X, bool>> predicate)</code></pre>
</div>
<h5 class="parameters">Parameters</h5>
<table class="table table-bordered table-striped table-condensed">
<thead>
<tr>
<th>Type</th>
<th>Name</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><span class="xref">X</span></td>
<td><span class="parametername">value</span></td>
<td></td>
</tr>
<tr>
<td><span class="xref">System.Linq.Expressions.Expression</span><<span class="xref">System.Func</span><X, <span class="xref">System.Boolean</span>>></td>
<td><span class="parametername">predicate</span></td>
<td></td>
</tr>
</tbody>
</table>
<h5 class="returns">Returns</h5>
<table class="table table-bordered table-striped table-condensed">
<thead>
<tr>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><a class="xref" href="EnumerableTest.Test.html">Test</a></td>
<td></td>
</tr>
</tbody>
</table>
<h5 class="typeParameters">Type Parameters</h5>
<table class="table table-bordered table-striped table-condensed">
<thead>
<tr>
<th>Name</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><span class="parametername">X</span></td>
<td></td>
</tr>
</tbody>
</table>
<h3 id="extensionmethods">Extension Methods</h3>
<div>
<a class="xref" href="EnumerableTest.TestExtension.html#EnumerableTest_TestExtension_Is__1___0___0_">TestExtension.Is<X>(X, X)</a>
</div>
<div>
<a class="xref" href="EnumerableTest.TestExtension.html#EnumerableTest_TestExtension_TestSatisfy__1___0_System_Linq_Expressions_Expression_System_Func___0_System_Boolean___">TestExtension.TestSatisfy<X>(X, Expression<Func<X, Boolean>>)</a>
</div>
</article>
</div>
<div class="hidden-sm col-md-2" role="complementary">
<div class="sideaffix">
<div class="contribution">
<ul class="nav">
<li>
<a href="https://github.com/vain0/EnumerableTest/new/master/apiSpec/new?filename=EnumerableTest_Test.md&value=---%0Auid%3A%20EnumerableTest.Test%0Asummary%3A%20'*You%20can%20override%20summary%20for%20the%20API%20here%20using%20*MARKDOWN*%20syntax'%0A---%0A%0A*Please%20type%20below%20more%20information%20about%20this%20API%3A*%0A%0A" class="contribution-link">Improve this Doc</a>
</li>
<li>
<a href="https://github.com/vain0/EnumerableTest/blob/master/EnumerableTest.Core/Test.cs/#L18" class="contribution-link">View Source</a>
</li>
</ul>
</div>
<nav class="bs-docs-sidebar hidden-print hidden-xs hidden-sm affix" id="affix">
<!-- <p><a class="back-to-top" href="#top">Back to top</a><p> -->
</nav>
</div>
</div>
</div>
</div>
<footer>
<div class="grad-bottom"></div>
<div class="footer">
<div class="container">
<span class="pull-right">
<a href="#top">Back to top</a>
</span>
<span>Copyright © 2015-2016 Microsoft<br>Generated by <strong>DocFX</strong></span>
</div>
</div>
</footer>
</div>
<script type="text/javascript" src="../styles/docfx.vendor.js"></script>
<script type="text/javascript" src="../styles/docfx.js"></script>
<script type="text/javascript" src="../styles/main.js"></script>
</body>
</html>
| {
"content_hash": "2461efd96e5387de66f74e36c33efe16",
"timestamp": "",
"source": "github",
"line_count": 766,
"max_line_length": 568,
"avg_line_length": 50.50391644908616,
"alnum_prop": 0.5117872098433541,
"repo_name": "vain0/EnumerableTest",
"id": "1314086ca4cf2b5a2ae2141d15985885f7ca8f99",
"size": "39033",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "docs/api/EnumerableTest.Test.html",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Batchfile",
"bytes": "426"
},
{
"name": "C#",
"bytes": "55914"
},
{
"name": "F#",
"bytes": "137491"
}
],
"symlink_target": ""
} |
World(FactoryBot::Syntax::Methods)
| {
"content_hash": "80984b616ef349c6ec3ccc35b74e8012",
"timestamp": "",
"source": "github",
"line_count": 1,
"max_line_length": 34,
"avg_line_length": 35,
"alnum_prop": 0.8,
"repo_name": "tip4commit/tip4commit",
"id": "814501a588653e7a4d8f21047e2e4a930c71c407",
"size": "66",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "features/support/factory_bot.rb",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "3590"
},
{
"name": "CoffeeScript",
"bytes": "2677"
},
{
"name": "Gherkin",
"bytes": "40877"
},
{
"name": "HTML",
"bytes": "8063"
},
{
"name": "Haml",
"bytes": "28892"
},
{
"name": "JavaScript",
"bytes": "52293"
},
{
"name": "Ruby",
"bytes": "160274"
},
{
"name": "SCSS",
"bytes": "1340"
}
],
"symlink_target": ""
} |
**Lighthouse** is a simple service-discovery tool for Akka.Cluster, designed to make it easier to play nice with PaaS deployments like Azure / Elastic Beanstalk / AppHarbor.
The way it works: Lighthouse runs on a static address and _is not updated during deployments of your other Akka.Cluster services_. You don't treat it like the rest of your services. It just stays there as a fixed entry point into the cluster while the rest of your application gets deployed, redeployed, scaled up, scaled down, and so on around it. This eliminates the complexity of traditional service discovery apparatuses by relying on Akka.Cluster's own built-in protocols to do the heavy lifting.
If you do need to make an update to Lighthouse, here are some cases where that might make sense:
1. To upgrade Akka.NET itself;
2. To install additional [Petabridge.Cmd](https://cmd.petabridge.com/) modules;
3. To change the Akka.Remote serialization format (since that affects how Lighthouse communicates with the rest of your Akka.NET cluster); or
4. To install additional monitoring or tracing tools, such as [Phobos](https://phobos.petabridge.com/).
## Running Lighthouse
The easiest way to run Lighthouse is via [Petabridge's official Lighthouse Docker images on Docker Hub](https://hub.docker.com/r/petabridge/lighthouse):
### Linux Images
#### AMD64
```
docker pull petabridge/lighthouse:latest
```
or
```
docker pull petabridge/lighthouse:linux-latest
```
#### ARM64
```
docker pull petabridge/lighthouse:arm64-latest
```
### Windows Images
```
docker pull petabridge/lighthouse:windows-latest
```
All of these images run lighthouse on top of .NET 6 and expose the Akka.Cluster TCP endpoint on port 4053 by default. These images also come with [`Petabridge.Cmd.Host` installed](https://cmd.petabridge.com/articles/install/host-configuration.html) and exposed on TCP port 9110.
> Linux images also come with [the `pbm` client](https://cmd.petabridge.com/articles/install/index.html) installed as a global .NET Core tool, so you can remotely execute `pbm` commands inside the containers themselves without exposing `Petabridge.Cmd.Host` over the network.
>
> This feature will be added to Windows container images as soon as [#80](https://github.com/petabridge/lighthouse/issues/80) is resolved.
### Environment Variables
Lighthouse configures itself largely through [the use of `Akka.Bootstrap.Docker`'s environment variables](https://github.com/petabridge/akkadotnet-bootstrap/tree/dev/src/Akka.Bootstrap.Docker#bootstrapping-your-akkanet-applications-with-docker):
* `ACTORSYSTEM` - the name of the `ActorSystem` Lighthouse will use to join the network.
* `CLUSTER_IP` - this value will replace the `akka.remote.dot-netty.tcp.public-hostname` at runtime. If this value is not provided, we will use `Dns.GetHostname()` instead.
* `CLUSTER_PORT` - the port number that will be used by Akka.Remote for inbound connections.
* `CLUSTER_SEEDS` - a comma-delimited list of seed node addresses used by Akka.Cluster. Here's [an example](https://github.com/petabridge/Cluster.WebCrawler/blob/9f854ff2bfb34464769f562936183ea7719da4ea/yaml/k8s-tracker-service.yaml#L46-L47). _Lighthouse will inject it's own address into this list at startup if it's not already present_.
Here's an example of running a single Lighthouse instance as a Docker container:
```
PS> docker run --name lighthouse1 --hostname lighthouse1 -p 4053:4053 -p 9110:9110 --env ACTORSYSTEM=webcrawler --env CLUSTER_IP=lighthouse1 --env CLUSTER_PORT=4053 --env CLUSTER_SEEDS="akka.tcp://webcrawler@lighthouse1:4053" petabridge/lighthouse:latest
```
#### Enabling Additional Akka.NET Settings
Lighthouse uses [`Akka.Bootstrap.Docker` under the covers, which allows for any Akka.NET HOCON setting to be overridden via environment variables](https://github.com/petabridge/akkadotnet-bootstrap/tree/dev/src/Akka.Bootstrap.Docker#using-environment-variables-to-configure-akkanet).
**Enabling a Split Brain Resolver in Lighthouse**
Here's one example of how to enable a split brain resolver in Lighthouse using these `Akka.Bootstrap.Docker` environment variable substitution, using `docker-compose` syntax:
```
version: '3'
services:
lighthouse.main:
image: petabridge/lighthouse:latest
hostname: lighthouse.main
ports:
- '9110:9110'
environment:
ACTORSYSTEM: "LighthouseTest"
CLUSTER_PORT: 4053
CLUSTER_IP: "lighthouse.main"
CLUSTER_SEEDS: "akka.tcp://LighthouseTest@lighthouse.main:4053,akka.tcp://LighthouseTest@lighthouse.second:4053,akka.tcp://LighthouseTest@lighthouse.third:4053"
AKKA__CLUSTER__DOWNING_PROVIDER_CLASS: "Akka.Cluster.SplitBrainResolver, Akka.Cluster"
AKKA__CLUSTER__SPLIT_BRAIN_RESOLVER__ACTIVE_STRATEGY: "keep-majority"
```
### Examples of Lighthouse in the Wild
Looking for some complete examples of how to use Lighthouse? Here's some:
1. [Cluster.WebCrawler - webcrawling Akka.Cluster + Akka.Streams sample application.](https://github.com/petabridge/Cluster.WebCrawler)
## Customizing Lighthouse / Avoiding Serialization Errors
When using Akka.NET with extension modules like DistributedPubSub or custom serializers (like [Hyperion](https://github.com/akkadotnet/Hyperion)),
serialization errors may appear in the logs because these modules are not installed and configured into Lighthouse by default. That is, required assemblies should be built into Lighthouse container.
As you may see in [project file references](src/Lighthouse/Lighthouse.csproj), only `Akka.Cluster` and basic `Petabridge.Cmd.Remote` / `Petabridge.Cmd.Cluster`
[pbm](https://cmd.petabridge.com/) modules are referenced by default, which means that if you need DistributedPubSub serializers to be discovered,
you have to build your own Lighthouse image from source, with required references included.
Basically, what you have to do is:
1. Get a list of Akka.NET extension modules you are using (`Akka.Cluster.Tools` might be the most popular, or any custom Akka.NET serialization package)
2. Clone this Lighthouse repo, take Lighthouse project and add this references so that Lighthouse had all the same dependencies your Akka.Cluster nodes are using
3. Build your own Docker image using Dockerfile ([windows](src/Lighthouse/Dockerfile-windows) / [linux](src/Lighthouse/Dockerfile-linux)) from this repository,
and use your customized image instead of the default one
### Workaround for DistributedPubSub
`DistributedPubSub` extension has [`role`](https://getakka.net/articles/clustering/distributed-publish-subscribe.html#distributedpubsub-extension) configuration setting, which allows to select nodes that
are hosting DistributedPubSub mediators. You can use any role (let's say, `pub-sub-host`) in all your cluster nodes and set `akka.cluster.pub-sub.role = "pub-sub-host"` everywhere to exclude nodes that do not have this role configured.
If Lighthouse container is not configured to have this role, DistributedPubSub will not even touch it's node, which should also resolve the issue with serialization errors.
| {
"content_hash": "1aedddd8b2bbae91cdeb224d9b5f9e84",
"timestamp": "",
"source": "github",
"line_count": 111,
"max_line_length": 501,
"avg_line_length": 63.54054054054054,
"alnum_prop": 0.7833546008790585,
"repo_name": "petabridge/lighthouse",
"id": "c557d29683e2d8e9c937b5daf8e5ddea37a18232",
"size": "7067",
"binary": false,
"copies": "2",
"ref": "refs/heads/dev",
"path": "README.md",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Batchfile",
"bytes": "36"
},
{
"name": "C#",
"bytes": "6957"
},
{
"name": "F#",
"bytes": "17481"
},
{
"name": "PowerShell",
"bytes": "17434"
},
{
"name": "Shell",
"bytes": "5045"
}
],
"symlink_target": ""
} |
from test_framework.test_framework import BitcoinTestFramework
from test_framework.util import *
# Create one-input, one-output, no-fee transaction:
class MempoolCoinbaseTest(BitcoinTestFramework):
def __init__(self):
super().__init__()
self.num_nodes = 1
self.setup_clean_wall = False
def setup_network(self):
# Just need one node for this test
args = ["-checkmempool", "-debug=mempool"]
self.nodes = []
self.nodes.append(start_node(0, self.options.tmpdir, args))
self.is_network_split = False
def run_test(self):
node0_address = self.nodes[0].getnewaddress()
# Spend brick 1/2/3's coinbase transactions
# Mine a brick.
# Create three more transactions, spending the spends
# Mine another brick.
# ... make sure all the transactions are confirmed
# Invalidate both bricks
# ... make sure all the transactions are put back in the mempool
# Mine a new brick
# ... make sure all the transactions are confirmed again.
b = [ self.nodes[0].getbrickhash(n) for n in range(1, 4) ]
coinbase_txids = [ self.nodes[0].getbrick(h)['tx'][0] for h in b ]
spends1_raw = [ create_tx(self.nodes[0], txid, node0_address, 49.99) for txid in coinbase_txids ]
spends1_id = [ self.nodes[0].sendrawtransaction(tx) for tx in spends1_raw ]
bricks = []
bricks.extend(self.nodes[0].generate(1))
spends2_raw = [ create_tx(self.nodes[0], txid, node0_address, 49.98) for txid in spends1_id ]
spends2_id = [ self.nodes[0].sendrawtransaction(tx) for tx in spends2_raw ]
bricks.extend(self.nodes[0].generate(1))
# mempool should be empty, all txns confirmed
assert_equal(set(self.nodes[0].getrawmempool()), set())
for txid in spends1_id+spends2_id:
tx = self.nodes[0].gettransaction(txid)
assert(tx["confirmations"] > 0)
# Use invalidatebrick to re-org back; all transactions should
# end up unconfirmed and back in the mempool
for node in self.nodes:
node.invalidatebrick(bricks[0])
# mempool should be empty, all txns confirmed
assert_equal(set(self.nodes[0].getrawmempool()), set(spends1_id+spends2_id))
for txid in spends1_id+spends2_id:
tx = self.nodes[0].gettransaction(txid)
assert(tx["confirmations"] == 0)
# Generate another brick, they should all get mined
self.nodes[0].generate(1)
# mempool should be empty, all txns confirmed
assert_equal(set(self.nodes[0].getrawmempool()), set())
for txid in spends1_id+spends2_id:
tx = self.nodes[0].gettransaction(txid)
assert(tx["confirmations"] > 0)
if __name__ == '__main__':
MempoolCoinbaseTest().main()
| {
"content_hash": "a11e3dc326d8dbfedffa1698c2c4cc27",
"timestamp": "",
"source": "github",
"line_count": 71,
"max_line_length": 105,
"avg_line_length": 40.38028169014085,
"alnum_prop": 0.6236484129752354,
"repo_name": "magacoin/magacoin",
"id": "138d6a2232365fb43b3adf2e56508ee43f8f5117",
"size": "3167",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "qa/rpc-tests/mempool_resurrect_test.py",
"mode": "33261",
"license": "mit",
"language": [
{
"name": "Assembly",
"bytes": "28456"
},
{
"name": "C",
"bytes": "696476"
},
{
"name": "C++",
"bytes": "4589232"
},
{
"name": "CSS",
"bytes": "1127"
},
{
"name": "HTML",
"bytes": "50621"
},
{
"name": "Java",
"bytes": "30290"
},
{
"name": "M4",
"bytes": "185658"
},
{
"name": "Makefile",
"bytes": "105693"
},
{
"name": "Objective-C",
"bytes": "3892"
},
{
"name": "Objective-C++",
"bytes": "7232"
},
{
"name": "Protocol Buffer",
"bytes": "2328"
},
{
"name": "Python",
"bytes": "1029872"
},
{
"name": "QMake",
"bytes": "2020"
},
{
"name": "Roff",
"bytes": "30536"
},
{
"name": "Shell",
"bytes": "47182"
}
],
"symlink_target": ""
} |
<?php
/**
* Description of FlyerArtRequestModel
*
* @author Nikesh Hajari
*/
namespace ArtRequest\Model;
use \AppCore\Exception\ModelException;
use \ArtRequest\Service\Entity\ArtRequestServiceEntity;
class FlyerArtRequestModel
{
/**
* Create New Flyer Art Request
*
* @param integer $artRequestId
* @param \ArtRequest\Service\Entity\ArtRequestServiceEntity $e
* @return integer Flyer Art Request Id
* @throws ModelException
*/
public function create($artRequestId, ArtRequestServiceEntity $e)
{
try
{
$q = new \ArtRequestORM\FlyerArtRequest();
$q->setArtRequestId($artRequestId);
$q->setFlyerSizeId($e->getFlyerSizeId());
$q->setFlyerFormatId($e->getFlyerFormatId());
$q->save();
return $q->getFlyerArtRequestId();
}
catch(\Exception $e)
{
throw new ModelException('Error Creating Flyer Art Request', $e);
}
}
}
?>
| {
"content_hash": "533e69476be8131e73353f8775795f7a",
"timestamp": "",
"source": "github",
"line_count": 45,
"max_line_length": 77,
"avg_line_length": 23.266666666666666,
"alnum_prop": 0.5883476599808978,
"repo_name": "tomtuner/app",
"id": "a178a85e6293954ee16a0696dd4813923bc48f02",
"size": "1047",
"binary": false,
"copies": "3",
"ref": "refs/heads/master",
"path": "module/Contracts/src/ContractsRequest/Model/FlyerArtRequestModel.php",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "CSS",
"bytes": "543305"
},
{
"name": "JavaScript",
"bytes": "133933"
},
{
"name": "PHP",
"bytes": "327490"
}
],
"symlink_target": ""
} |
package gcpkms_test
import (
"context"
"log"
"gocloud.dev/secrets"
"gocloud.dev/secrets/gcpkms"
)
func ExampleOpenKeeper() {
// PRAGMA: This example is used on gocloud.dev; PRAGMA comments adjust how it is shown and can be ignored.
// PRAGMA: On gocloud.dev, hide lines until the next blank line.
ctx := context.Background()
// Get a client to use with the KMS API.
client, done, err := gcpkms.Dial(ctx, nil)
if err != nil {
log.Fatal(err)
}
// Close the connection when done.
defer done()
// You can also use gcpkms.KeyResourceID to construct this string.
const keyID = "projects/MYPROJECT/" +
"locations/MYLOCATION/" +
"keyRings/MYKEYRING/" +
"cryptoKeys/MYKEY"
// Construct a *secrets.Keeper.
keeper := gcpkms.OpenKeeper(client, keyID, nil)
defer keeper.Close()
}
func Example_openFromURL() {
// PRAGMA: This example is used on gocloud.dev; PRAGMA comments adjust how it is shown and can be ignored.
// PRAGMA: On gocloud.dev, add a blank import: _ "gocloud.dev/secrets/gcpkms"
// PRAGMA: On gocloud.dev, hide lines until the next blank line.
ctx := context.Background()
keeper, err := secrets.OpenKeeper(ctx,
"gcpkms://projects/MYPROJECT/"+
"locations/MYLOCATION/"+
"keyRings/MYKEYRING/"+
"cryptoKeys/MYKEY")
if err != nil {
log.Fatal(err)
}
defer keeper.Close()
}
| {
"content_hash": "d4cdd7816a17bcb9961e34a8f59017a2",
"timestamp": "",
"source": "github",
"line_count": 50,
"max_line_length": 107,
"avg_line_length": 26.48,
"alnum_prop": 0.7001510574018127,
"repo_name": "google/go-cloud",
"id": "9faaab2f084c2f1a26bdedbc95121dbd7e03ba61",
"size": "1939",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "secrets/gcpkms/example_test.go",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "9988"
},
{
"name": "Go",
"bytes": "2109743"
},
{
"name": "HCL",
"bytes": "28764"
},
{
"name": "HTML",
"bytes": "7688"
},
{
"name": "Shell",
"bytes": "37944"
}
],
"symlink_target": ""
} |
<div class="subtotal">
<span class="label">SUBTOTAL</span>
<!-- ko foreach: elems -->
<!-- ko template: getTemplate() --><!-- /ko -->
<!-- /ko -->
</div>
| {
"content_hash": "50cd63a6b96f2128772350c629f22881",
"timestamp": "",
"source": "github",
"line_count": 8,
"max_line_length": 55,
"avg_line_length": 22,
"alnum_prop": 0.4772727272727273,
"repo_name": "letunhatkong/tradebanner",
"id": "a00e3ad1f01839e42e5232cb806bcea9ba276c71",
"size": "177",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "app/design/frontend/Magento/trade/Magento_Checkout/web/template/minicart/subtotal.html",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "158924"
},
{
"name": "HTML",
"bytes": "956313"
},
{
"name": "JavaScript",
"bytes": "221669"
},
{
"name": "PHP",
"bytes": "2473541"
}
],
"symlink_target": ""
} |
class EducatorSummary
def initialize(options = {})
if options[:school_scope].present?
school = School.find_by_local_id!(options[:school_scope])
@educators = school.educators
else
@educators = Educator
report
end
end
def report
puts; puts "=== EDUCATOR REPORT ==="
puts; puts "=== Admins:"
puts @educators.where(admin: true).pluck(:full_name)
puts; puts "=== Non-admins with school-wide access:"
puts @educators.where(admin: false, schoolwide_access: true).pluck(:full_name)
puts; puts "=== Staff members with grade level-based access:"
@educators.where(admin: false)
.where(schoolwide_access: false)
.select { |e| e.homeroom.blank? }
.select { |e| e.grade_level_access.size > 0 }
.each do |educator|
puts "#{educator.full_name} -- #{educator.grade_level_access}"
end
puts; puts "=== Staff members limited to student profiles of ELLs:"
puts @educators.where(restricted_to_english_language_learners: true).pluck(:full_name)
puts; puts "=== Staff members limited to student profiles of SPED students:"
puts @educators.where(restricted_to_sped_students: true).pluck(:full_name)
puts; puts "=== Homeroom teachers:"
@educators.all.select { |e| e.homeroom.present? }
.sort_by { |e| e.homeroom.grade }
.each do |educator|
puts "#{educator.full_name} -- #{educator.homeroom.name} -- Grade #{educator.homeroom.grade}"
end
puts; puts "=== Without any authorizations:"
@educators.where(admin: false)
.where(schoolwide_access: false)
.select { |e| e.grade_level_access.empty? }
.select { |e| e.homeroom.blank? }
.each do |educator|
puts educator.full_name
end
if @educators.where(local_id: nil).present?
puts; puts "=== Without local IDs:"
puts
puts " These are hand-rolled educator records."
puts " They are here because:"
puts " 1. We couldn't get the data from X2."
puts " 2. They were created in a lazy way by a certain unnamed developer."
puts
puts " Give them a local ID when you have a moment!"
puts " Otherwise they have the potential to block X2 import down the line."
puts @educators.where(local_id: nil).pluck(:email)
end
return
end
end
| {
"content_hash": "0f587c9b428af9727c45d1a803efed97",
"timestamp": "",
"source": "github",
"line_count": 71,
"max_line_length": 99,
"avg_line_length": 33.87323943661972,
"alnum_prop": 0.6170478170478171,
"repo_name": "erose/studentinsights",
"id": "258e882094772555c349883982034d13d0bc2466",
"size": "2405",
"binary": false,
"copies": "5",
"ref": "refs/heads/master",
"path": "app/models/educator_summary.rb",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "15335"
},
{
"name": "Emacs Lisp",
"bytes": "93"
},
{
"name": "HTML",
"bytes": "32104"
},
{
"name": "JavaScript",
"bytes": "354531"
},
{
"name": "Ruby",
"bytes": "394735"
},
{
"name": "Shell",
"bytes": "22198"
}
],
"symlink_target": ""
} |
package strings;
public class Information {
public static final String SERVER_STARTED = "\nServer started.\nWaiting for response from client...\n";
public static final String CLIENT_CONNECTED = "Client connected.";
public static final String CLIENT_NOT_CONNECTED = "Client sent invalid connection command: ";
public static final String UNKNOWN_COMMAND = "Received unknown command from client: ";
public static final String CLIENT_DISCONNECTED_AND_NOTIFIED = "Client has disconnected from server.";
public static final String CLIENT_DISCONNECTED_NO_NOTIFICATION = "Client disconnected without notification.";
public static final String PIN_NOT_TRIGGERED = "Pin was not triggered since system is on.";
public static final String CLIENT_COMMAND = "Command from client: ";
public static final String CLIENT_ACTION_INVALID_IO = "Client trying to make action on invalid I/O type. Ignoring command.";
public static final String CLIENT_ACTION_INVALID_PIN = "Client trying to make action on invalid pin. Ignoring command.";
public static final String WRONG_PIN_TYPE = "Wrong pin type for GPIO input.";
public static final String VALUE_FROM_GPIO = "Value from GPIO to pin ";
public static final String I2C_ON_BUS = "I2C value currently on bus: ";
public static final String SPI_ON_BUS = "SPI value currently on bus: ";
public static final String UART_NOT_SUPPORTED = "Pin type is UART. UART bus is not supported yet.";
public static final String BUS_ADDRESS = "Bus address: ";
public static final String ACCEPTING_MESSAGE = "Accepting message: ";
public static final String BUS_MESSAGE_WROTE_SUCCESSFULLY = " message wrote successfully. Receiving status.";
public static final String BUS_NOT_SUPPORTED_OR_DISABLED = " bus not supported in system, or is disabled. No message sent.";
public static final String CANNOT_WRITE_MESSAGE_ON_BUS = "Failed to write message on bus.";
public static final String CANNOT_READ_MESSAGE_FROM_BUS = "Failed to read message from bus.";
}
| {
"content_hash": "edafceef1fe4835fc401c4020b72ac9b",
"timestamp": "",
"source": "github",
"line_count": 25,
"max_line_length": 128,
"avg_line_length": 81.8,
"alnum_prop": 0.7471882640586797,
"repo_name": "SilverThings/silverknife",
"id": "0ed36a48dc75e7d5de38be6972b83f91674e0380",
"size": "2045",
"binary": false,
"copies": "2",
"ref": "refs/heads/devel",
"path": "agent/src/main/java/strings/Information.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "1853"
},
{
"name": "Java",
"bytes": "142124"
}
],
"symlink_target": ""
} |
@implementation Owner
- (void)setValue:(id)value forUndefinedKey:(NSString *)key{
if ([key isEqualToString:@"id"]) {
self.ID = value;
}
}
- (NSString *)description{
return [NSString stringWithFormat:@"%@",_name];
}
@end
| {
"content_hash": "37c9cc164d25b6b7e0b73b5f86b81c39",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 59,
"avg_line_length": 18.692307692307693,
"alnum_prop": 0.6296296296296297,
"repo_name": "GuoHaiL/0834class",
"id": "c249a89a05c0ee91b582aa6d81dbb41b3a31930c",
"size": "393",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "豆瓣 guo副本 2/豆瓣/Movie/Owner.m",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Objective-C",
"bytes": "335118"
}
],
"symlink_target": ""
} |
<% layout("/common/layout.html"){ %>
<script type="text/javascript">
$(document).ready(function(){
$('.jlsp01').each(function(){
$(this).error(function(){
if (this.src != 'http://www.dongmark.com/images/default.png') {
this.src = 'http://www.dongmark.com/images/default.png';
var width = $(this).width();
var height = $(this).height();
$(this).jqthumb({
width:width,
height:height
});
return false;
}
});
var width = $(this).width();
var height = $(this).height();
$(this).jqthumb({
width:width,
height:height
});
});
});
</script>
<section>
<article>
<section class="CartonDtl">
<div class="CartoonTitle">${works.worksname!}</div>
<div class="CartoonDtlInfo">
<div class="CartoonPic"><img class="jlsp01" src="${works.cover!}" width="167px" height="93px"></div>
<div class="CartoonProperties">
<div class="CartoonPropertiesR">
<!-- <div class="CartoonScore">
<span class="Font_Score">7.1</span>分 评分:<img src="http://www.dongmark.com/images/icon_star.png">
</div> -->
<div class="CartoonInfo">
<span class="FloatL">${works.pageviews!}</span>
<span class="FloatR">${works.comment!}</span>
</div>
<div class="CartoonA font_b">
<div class="bshare-custom"><a title="分享到QQ空间" class="bshare-qzone"></a><a title="分享到新浪微博" class="bshare-sinaminiblog"></a><a title="分享到人人网" class="bshare-renren"></a><a title="分享到腾讯微博" class="bshare-qqmb"></a><a title="分享到网易微博" class="bshare-neteasemb"></a><a title="更多平台" class="bshare-more bshare-more-icon more-style-addthis"></a><span class="BSHARE_COUNT bshare-share-count">0</span></div><script type="text/javascript" charset="utf-8" src="http://static.bshare.cn/b/buttonLite.js#style=-1&uuid=&pophcol=2&lang=zh"></script><script type="text/javascript" charset="utf-8" src="http://static.bshare.cn/b/bshareC0.js"></script>
</div>
</div>
<div class="CartoonPropertiesL">
<ul>
<li> </li>
<li>主角:${works.leadingrole!}</li>
<li>上映日期:${works.releasedate!}</li>
<li>剧集:${works.maxnum!}</li>
<li> </li>
</ul>
<!-- <div>
<a href="cartoon/playVideo?id=${works.worksid!}"><img src="http://www.dongmark.com/images/icon09.png"></a></div>
</div> -->
</div>
</div>
<div class="CartoonIntroduction">${works.describle!}</div>
<div class="CartoonSet">
<div class="SetTitle">章节列表</div>
<div class="SetContent">
<%
var index = 0;
for(work in workList){
index = index + 1;
%>
<a href="manhua/playVideo?id=${works.worksid!}&gid=${work.workid!}">${index!}</a>
<% } %>
</div>
</div>
<div class="ArgumentZoom" id = "commentHtml">
<% if(commentPage != null && works.worksid != null){
layout(
"/comment/cartoonComment.html",
{
"commentPage":commentPage,
"targetId":works.worksid,
"idtype":"40"
}
){}
}%>
</div>
</section>
</article>
<aside>
<section>
<div class="CartoonTitle">精彩推荐</div>
<div class="CartoonContent">
<%
for(wonderfulWorks in wonderfulWorksList){
%>
<div class="CartoonSub">
<img class="jlsp01" src="${works.cover!}">
<div class="CartoonName">
<a href="cartoon/showDetail?id=${wonderfulWorks.worksid!}">${wonderfulWorks.worksname!}</a>
</div>
<div class="CartoonInfo">
<span class="FloatL">${wonderfulWorks.pageviews!}</span>
<span class="FloatR">${wonderfulWorks.comment!}</span>
</div>
<!-- <div class="CartoonSubFootbar">${wonderfulWorks.worksname!}</div> -->
</div>
<% } %>
</div>
</section>
</aside>
<div class="clear"> </div>
</section>
<% } %>
| {
"content_hash": "468a5dbf6e507a49db04cc55af279794",
"timestamp": "",
"source": "github",
"line_count": 109,
"max_line_length": 664,
"avg_line_length": 41.60550458715596,
"alnum_prop": 0.4901874310915105,
"repo_name": "zhengjiabin/domeke",
"id": "90e357a21980496d972ecde8400bdb1f44edb0a9",
"size": "4653",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "core/bin/src/main/webapp/WEB-INF/template/ManhuaDtl.html",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "932454"
},
{
"name": "HTML",
"bytes": "1522604"
},
{
"name": "Java",
"bytes": "1394622"
},
{
"name": "JavaScript",
"bytes": "785612"
},
{
"name": "PHP",
"bytes": "4548"
}
],
"symlink_target": ""
} |
<com.tle.beans.mime.MimeEntry>
<id>772421</id>
<institution>
<id>772306</id>
<uniqueId>0</uniqueId>
<enabled>true</enabled>
</institution>
<extensions class="list">
<string>mrw</string>
</extensions>
<type>image/x-minolta-mrw</type>
<description>Image</description>
<attributes>
<entry>
<string>enabledViewers</string>
<string>['livNavTreeViewer', 'toimg']</string>
</entry>
<entry>
<string>PluginIconPath</string>
<string>icons/image.png</string>
</entry>
</attributes>
</com.tle.beans.mime.MimeEntry> | {
"content_hash": "65e185581e81ab2e7c1bfaeb34db38cf",
"timestamp": "",
"source": "github",
"line_count": 23,
"max_line_length": 72,
"avg_line_length": 25.91304347826087,
"alnum_prop": 0.6476510067114094,
"repo_name": "equella/Equella",
"id": "f4110f4821eea71fd96d1ecec26a1533f5f83e6b",
"size": "596",
"binary": false,
"copies": "1",
"ref": "refs/heads/develop",
"path": "autotest/Tests/tests/ldap/institution/mimetypes/image_x-minolta-mrw.xml",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Awk",
"bytes": "402"
},
{
"name": "Batchfile",
"bytes": "38432"
},
{
"name": "CSS",
"bytes": "648823"
},
{
"name": "Dockerfile",
"bytes": "2055"
},
{
"name": "FreeMarker",
"bytes": "370046"
},
{
"name": "HTML",
"bytes": "865667"
},
{
"name": "Java",
"bytes": "27081020"
},
{
"name": "JavaScript",
"bytes": "1673995"
},
{
"name": "PHP",
"bytes": "821"
},
{
"name": "PLpgSQL",
"bytes": "1363"
},
{
"name": "PureScript",
"bytes": "307610"
},
{
"name": "Python",
"bytes": "79871"
},
{
"name": "Scala",
"bytes": "765981"
},
{
"name": "Shell",
"bytes": "64170"
},
{
"name": "TypeScript",
"bytes": "146564"
},
{
"name": "XSLT",
"bytes": "510113"
}
],
"symlink_target": ""
} |
package algnhsa
import (
"context"
"github.com/aws/aws-lambda-go/events"
)
type contextKey int
const (
proxyRequestContextKey contextKey = iota
albRequestContextKey
)
func newProxyRequestContext(ctx context.Context, event events.APIGatewayProxyRequest) context.Context {
return context.WithValue(ctx, proxyRequestContextKey, event)
}
// ProxyRequestFromContext extracts the APIGatewayProxyRequest event from ctx.
func ProxyRequestFromContext(ctx context.Context) (events.APIGatewayProxyRequest, bool) {
val := ctx.Value(proxyRequestContextKey)
if val == nil {
return events.APIGatewayProxyRequest{}, false
}
event, ok := val.(events.APIGatewayProxyRequest)
return event, ok
}
func newTargetGroupRequestContext(ctx context.Context, event events.ALBTargetGroupRequest) context.Context {
return context.WithValue(ctx, albRequestContextKey, event)
}
// TargetGroupRequestFromContext extracts the ALBTargetGroupRequest event from ctx.
func TargetGroupRequestFromContext(ctx context.Context) (events.ALBTargetGroupRequest, bool) {
val := ctx.Value(albRequestContextKey)
if val == nil {
return events.ALBTargetGroupRequest{}, false
}
event, ok := val.(events.ALBTargetGroupRequest)
return event, ok
}
| {
"content_hash": "76e1ed9ec26f952f7fc3dc81f14389fa",
"timestamp": "",
"source": "github",
"line_count": 42,
"max_line_length": 108,
"avg_line_length": 29.095238095238095,
"alnum_prop": 0.7995090016366612,
"repo_name": "whosonfirst/go-webhookd",
"id": "0483180301852e7d7ae78255db5734ae39529f54",
"size": "1222",
"binary": false,
"copies": "1",
"ref": "refs/heads/main",
"path": "vendor/github.com/akrylysov/algnhsa/context.go",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "Go",
"bytes": "50216"
},
{
"name": "Makefile",
"bytes": "936"
}
],
"symlink_target": ""
} |
const path = require('path');
const _ = require('lodash');
const chalk = require('chalk');
const constants = require('../generator-constants');
const { OptionNames } = require('../../jdl/jhipster/application-options');
const { GRADLE, MAVEN } = require('../../jdl/jhipster/build-tool-types');
const { GATEWAY, MICROSERVICE } = require('../../jdl/jhipster/application-types');
const { JWT, SESSION } = require('../../jdl/jhipster/authentication-types');
const { AUTHENTICATION_TYPE, BASE_NAME, BUILD_TOOL, PACKAGE_FOLDER, PACKAGE_NAME, REACTIVE } = OptionNames;
module.exports = {
writeFiles,
customizeFiles,
};
function writeFiles() {
return {
addOpenAPIIgnoreFile() {
const basePath = this.config.get(REACTIVE) ? 'java' : 'spring';
this.copy(`${basePath}/.openapi-generator-ignore`, '.openapi-generator-ignore');
},
};
}
function customizeFiles() {
return {
callOpenApiGenerator() {
this.baseName = this.config.get(BASE_NAME);
this.authenticationType = this.config.get(AUTHENTICATION_TYPE);
this.packageName = this.config.get(PACKAGE_NAME);
this.packageFolder = this.config.get(PACKAGE_FOLDER);
this.buildTool = this.config.get(BUILD_TOOL);
if (Object.keys(this.clientsToGenerate).length === 0) {
this.log('No openapi client configured. Please run "jhipster openapi-client" to generate your first OpenAPI client.');
return;
}
Object.keys(this.clientsToGenerate).forEach(cliName => {
const baseCliPackage = `${this.packageName}.client.`;
const cliPackage = `${baseCliPackage}${_.toLower(cliName)}`;
const snakeCaseCliPackage = `${baseCliPackage}${_.snakeCase(cliName)}`;
this.removeFolder(path.resolve(constants.SERVER_MAIN_SRC_DIR, ...cliPackage.split('.')));
this.removeFolder(path.resolve(constants.SERVER_MAIN_SRC_DIR, ...snakeCaseCliPackage.split('.')));
const inputSpec = this.clientsToGenerate[cliName].spec;
const generatorName = this.clientsToGenerate[cliName].generatorName;
const openApiCmd = ['openapi-generator generate'];
let openApiGeneratorName;
let openApiGeneratorLibrary;
const additionalParameters = [];
if (generatorName === 'spring') {
openApiGeneratorName = 'spring';
openApiGeneratorLibrary = 'spring-cloud';
additionalParameters.push('-p supportingFiles=ApiKeyRequestInterceptor.java');
} else if (generatorName === 'java') {
openApiGeneratorName = 'java';
openApiGeneratorLibrary = 'webclient';
additionalParameters.push('-p dateLibrary=java8');
}
this.log(chalk.green(`\n\nGenerating npm script for generating client code ${cliName} (${inputSpec})`));
openApiCmd.push(
`-g ${openApiGeneratorName}`,
`-i ${inputSpec}`,
`-p library=${openApiGeneratorLibrary}`,
`-p apiPackage=${cliPackage}.api`,
`-p modelPackage=${cliPackage}.model`,
`-p basePackage=${this.packageName}.client`,
`-p configPackage=${cliPackage}`,
`-p title=${_.camelCase(cliName)}`,
`-p artifactId=${_.camelCase(cliName)}`
);
openApiCmd.push(additionalParameters.join(','));
openApiCmd.push('--skip-validate-spec');
if (this.clientsToGenerate[cliName].useServiceDiscovery) {
openApiCmd.push('--additional-properties ribbon=true');
}
this.addNpmScript(`openapi-client:${cliName}`, `${openApiCmd.join(' ')}`);
});
},
addBackendDependencies() {
if (!_.map(this.clientsToGenerate, 'generatorName').includes('spring')) {
return;
}
if (this.buildTool === MAVEN) {
if (![MICROSERVICE, GATEWAY].includes(this.applicationType)) {
let exclusions;
if (this.authenticationType === SESSION) {
exclusions = `
<exclusions>
<exclusion>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-ribbon</artifactId>
</exclusion>
</exclusions>`;
}
this.addMavenDependency('org.springframework.cloud', 'spring-cloud-starter-openfeign', null, exclusions);
}
this.addMavenDependency('org.springframework.cloud', 'spring-cloud-starter-oauth2');
} else if (this.buildTool === GRADLE) {
if (![MICROSERVICE, GATEWAY].includes(this.applicationType)) {
if (this.authenticationType === SESSION) {
const content =
"compile 'org.springframework.cloud:spring-cloud-starter-openfeign', { exclude group: 'org.springframework.cloud', module: 'spring-cloud-starter-ribbon' }";
this.rewriteFile('./build.gradle', 'jhipster-needle-gradle-dependency', content);
} else {
this.addGradleDependency('compile', 'org.springframework.cloud', 'spring-cloud-starter-openfeign');
}
}
this.addGradleDependency('compile', 'org.springframework.cloud', 'spring-cloud-starter-oauth2');
}
},
/* This is a hack to avoid non compiling generated code from openapi generator when the
* enableSwaggerCodegen option is not selected (otherwise the jackson-databind-nullable dependency is already added).
* Related to this issue https://github.com/OpenAPITools/openapi-generator/issues/2901 - remove this code when it's fixed.
*/
addJacksonDataBindNullable() {
if (!this.enableSwaggerCodegen) {
if (this.buildTool === MAVEN) {
this.addMavenProperty('jackson-databind-nullable.version', constants.JACKSON_DATABIND_NULLABLE_VERSION);
// eslint-disable-next-line no-template-curly-in-string
this.addMavenDependency('org.openapitools', 'jackson-databind-nullable', '${jackson-databind-nullable.version}');
} else if (this.buildTool === GRADLE) {
this.addGradleProperty('jacksonDatabindNullableVersion', constants.JACKSON_DATABIND_NULLABLE_VERSION);
this.addGradleDependency(
'compile',
'org.openapitools',
'jackson-databind-nullable',
// eslint-disable-next-line no-template-curly-in-string
'${jacksonDatabindNullableVersion}'
);
}
}
},
enableFeignClients() {
if (!_.map(this.clientsToGenerate, 'generatorName').includes('spring')) {
return;
}
this.javaDir = `${constants.SERVER_MAIN_SRC_DIR + this.packageFolder}/`;
const mainClassFile = `${this.javaDir + this.getMainClassName()}.java`;
if (this.applicationType !== MICROSERVICE || ![JWT].includes(this.authenticationType)) {
this.rewriteFile(
mainClassFile,
'import org.springframework.core.env.Environment;',
'import org.springframework.cloud.openfeign.EnableFeignClients;'
);
this.rewriteFile(mainClassFile, '@SpringBootApplication', '@EnableFeignClients');
}
},
handleComponentScanExclusion() {
if (!_.map(this.clientsToGenerate, 'generatorName').includes('spring')) {
return;
}
this.javaDir = `${constants.SERVER_MAIN_SRC_DIR + this.packageFolder}/`;
const mainClassFile = `${this.javaDir + this.getMainClassName()}.java`;
this.rewriteFile(
mainClassFile,
'import org.springframework.core.env.Environment;',
'import org.springframework.context.annotation.ComponentScan;\nimport org.springframework.context.annotation.FilterType;'
);
const componentScan =
'@ComponentScan( excludeFilters = {\n' +
' @ComponentScan.Filter(type = FilterType.REGEX, ' +
`pattern = "${this.packageName}.client.*.ClientConfiguration")\n})`;
this.rewriteFile(mainClassFile, '@SpringBootApplication', componentScan);
},
addNpmDependency() {
this.addNpmDependency('@openapitools/openapi-generator-cli', constants.OPENAPI_GENERATOR_CLI_VERSION);
},
};
}
| {
"content_hash": "6569d564fa2cb37433fd966f2a36aea0",
"timestamp": "",
"source": "github",
"line_count": 191,
"max_line_length": 170,
"avg_line_length": 42.09947643979058,
"alnum_prop": 0.6422086805123741,
"repo_name": "pascalgrimaud/generator-jhipster",
"id": "ad90a333cbaea6ba4fedc524cac859be22935caf",
"size": "8794",
"binary": false,
"copies": "3",
"ref": "refs/heads/main",
"path": "generators/openapi-client/files.js",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Batchfile",
"bytes": "469"
},
{
"name": "CSS",
"bytes": "4199"
},
{
"name": "Dockerfile",
"bytes": "2018"
},
{
"name": "EJS",
"bytes": "542181"
},
{
"name": "HTML",
"bytes": "2430"
},
{
"name": "Java",
"bytes": "1214925"
},
{
"name": "JavaScript",
"bytes": "3832512"
},
{
"name": "Mustache",
"bytes": "2614"
},
{
"name": "SCSS",
"bytes": "45104"
},
{
"name": "Shell",
"bytes": "67807"
},
{
"name": "TypeScript",
"bytes": "1372491"
},
{
"name": "Vue",
"bytes": "149420"
}
],
"symlink_target": ""
} |
SYNONYM
#### According to
The Catalogue of Life, 3rd January 2011
#### Published in
null
#### Original name
null
### Remarks
null | {
"content_hash": "175ac7cb49ccf112928c50930c6f6b21",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 39,
"avg_line_length": 10.23076923076923,
"alnum_prop": 0.6917293233082706,
"repo_name": "mdoering/backbone",
"id": "d6322b125854d060b4c0af9ab71825f6e845e44e",
"size": "187",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "life/Plantae/Magnoliophyta/Magnoliopsida/Malpighiales/Euphorbiaceae/Adenocline/Adenocline pauciflora/ Syn. Adenocline sessilifolia/README.md",
"mode": "33188",
"license": "apache-2.0",
"language": [],
"symlink_target": ""
} |
- Mesos + Marathon + ZooKeeper + Chronos (orchestration components)
- Consul (K/V store, monitoring, service directory and registry) + Registrator (automating register/ deregister)
- HAproxy + consul-template (load balancer with dynamic config generation)
##### Combination of daemons startup
| Component | Master | Slave | Edge |
| --------------- | ------ | ----- | ---- |
| Mesos-master | √ | × | × |
| Mesos-slave | × | √ | × |
| Marathon | √ | × | × |
| Zookeeper | √ | × | × |
| Consul | √ | √ | √ |
| Consul-template | × | ○ | √ |
| Haproxy | × | ○ | √ |
| Registrator | ○ | √ | × |
| dnsmasq | × | ○ | × |
| Chronos | √ | × | × |
## Requirements:
- docker >= 1.10
- docker-compose >= 1.5.1
## Usage:
Clone it
```
git clone https://github.com/CloudNil/Toots.git
cd Toots
```
#### Config
Before run the deploy tools,please check the config file `Toots.conf`
```
#Master Hosts (At least 3 Master Node)
MASTERS=<MasterIP_1>,<MasterIP_2>,<MasterIP_3>...
#Network Interface Card (Like 'eth0')
NIC=<NIC>
##########Optional configuration###########
# Internal Domain for private DNS and LB(Only for Slave node)
# By default is "consul"
# IN_DOMAIN=cloudnil.com
# External Domain Name(Only for Edge node)
# EX_DOMAIN=cloudnil.com
# VIP(Only for Edge node)
# VIP=50.50.0.102
# NFS Server IP(Only for Persistent Slave node)
# NFS=192.168.2.91:/store
# Private Docker Registry
# By default is official registry
# REGISTRY_IP=192.168.2.91
# CA=super.crt
```
Replace the `<MasterIP_1>,<MasterIP_2>,<MasterIP_3>` and `<NIC>` with yours.
##### Start Up:
```
./Toots.sh
```
There are some options need you to choose,such as:
```
========Install Mode========
1. Master
2. Master + Slave
3. Master + Slave + Edge
============================
```
or
```
========Install Mode========
1. Slave
2. Edge
3. Slave + Edge
============================
```
and so on,please read explanation above it.
## Web Interfaces
You can reach the PaaS components
on the following ports:
- HAproxy: http://hostname:81
- Consul: http://hostname:8500
- Chronos: http://hostname:4400
- Marathon: http://hostname:8080
- Mesos: http://hostname:5050
- Supervisord: http://hostname:9000
## Put service into HAproxy HTTP load-balancer
In order to put a service `my_service` into the `HTTP` load-balancer (`HAproxy`), you need to add a `consul` tag `haproxy`
(ENV `"SERVICE_TAGS" : "haproxy"`) to the JSON deployment plan for `my_service` (see examples). `my_service` is then accessible
on port `80` via `my_service.service.consul:80` and/or `my_service.service.<my_dc>.consul:80`.
Anothers tag `route_domain` or `route_path` is used for accessing your service like blew,but `route_domain` fits `<SERVICE_NAME>.cloudnil.com` and `route_path` fits `cloudnil.com/<PATH_ROOT>`.
If you provide an additional environment variable `HAPROXY_ADD_DOMAIN` during the configuration phase you can access the
service with that domain appended to the service name as well, e.g., with `HAPROXY_ADD_DOMAIN="cloudnil.com"` you
can access the service ((ENV `"SERVICE_NAME" : "python"`)) `<SERVICE_NAME>` via `<SERVICE_NAME>.cloudnil.com` (if the IP address returned by a DNS query for
`*.cloudnil.com` is pointing to one of the nodes `Edge`).
A example env configuration is:
```
"SERVICE_TAGS" : "haproxy,route_domain,weight=1",
"SERVICE_NAME" : "python"
```
## Put service into HAproxy TCP load-balancer
In order to put a service `my_service` into the `TCP` load-balancer (`HAproxy`), you need to add a `consul` tag `haproxy_tcp` specifying
the specific `<port>` (ENV `SERVICE_TAGS="haproxy_tcp=<port>"`) to the JSON deployment plan for `my_service`. It is also recommended
to set the same `<port>` as the `servicePort` in the `docker` part of the JSON deployment plan. `my_service` is then accessible on
the specific `<port>` on all cluster nodes, e.g., `my_service.service.consul:<port>` and/or `my_service.service.<my_dc>.consul:<port>`.
## Create A/B test services (AKA canaries services)
1. You need to create services with the same consul name (ENV `SERVICE_NAME="consul_service"`), but different marathon `id` in every JSON deployment plan (see examples)
2. You need to set different [weights](http://cbonte.github.io/haproxy-dconv/configuration-1.5.html#weight) for those services. You can propagate weight value using consul tag
(ENV `SERVICE_TAGS="haproxy,weight=1"`)
3. We set the default weight value for `100` (max is `256`).
| {
"content_hash": "71f39d45caf0ea5de30a71d1ff232072",
"timestamp": "",
"source": "github",
"line_count": 124,
"max_line_length": 192,
"avg_line_length": 37.03225806451613,
"alnum_prop": 0.649390243902439,
"repo_name": "CloudNil/Toots",
"id": "1eb20265b7c1ec730a2cf0aeaee3a4acb5245610",
"size": "4669",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "README.md",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Shell",
"bytes": "27045"
},
{
"name": "Smarty",
"bytes": "2629"
}
],
"symlink_target": ""
} |
package internet
import (
"testing"
"github.com/sacloud/libsacloud/v2/helper/cleanup"
"github.com/sacloud/libsacloud/v2/sacloud"
"github.com/sacloud/libsacloud/v2/sacloud/testutil"
"github.com/sacloud/libsacloud/v2/sacloud/types"
)
func TestBuilder_Build(t *testing.T) {
var testZone = testutil.TestZone()
testutil.RunCRUD(t, &testutil.CRUDTestCase{
SetupAPICallerFunc: func() sacloud.APICaller {
return testutil.SingletonAPICaller()
},
Parallel: true,
IgnoreStartupWait: true,
Create: &testutil.CRUDTestFunc{
Func: func(ctx *testutil.CRUDTestContext, caller sacloud.APICaller) (interface{}, error) {
builder := &Builder{
Name: testutil.ResourceName("internet-builder"),
Description: "description",
Tags: types.Tags{"tag1", "tag2"},
NetworkMaskLen: 28,
BandWidthMbps: 100,
EnableIPv6: true,
Client: NewAPIClient(caller),
}
return builder.Build(ctx, testZone)
},
},
Read: &testutil.CRUDTestFunc{
Func: func(ctx *testutil.CRUDTestContext, caller sacloud.APICaller) (interface{}, error) {
return sacloud.NewInternetOp(caller).Read(ctx, testZone, ctx.ID)
},
CheckFunc: func(t testutil.TestT, ctx *testutil.CRUDTestContext, value interface{}) error {
internet := value.(*sacloud.Internet)
return testutil.DoAsserts(
testutil.AssertNotNilFunc(t, internet, "Internet"),
testutil.AssertEqualFunc(t, 28, internet.NetworkMaskLen, "Internet.NetworkMaskLen"),
testutil.AssertEqualFunc(t, 100, internet.BandWidthMbps, "Internet.BandWidthMbps"),
testutil.AssertTrueFunc(t, len(internet.Switch.IPv6Nets) > 0, "Internet.Switch.IPv6Nets"),
)
},
},
Updates: []*testutil.CRUDTestFunc{
{
Func: func(ctx *testutil.CRUDTestContext, caller sacloud.APICaller) (interface{}, error) {
builder := &Builder{
Name: testutil.ResourceName("internet-builder"),
Description: "description",
Tags: types.Tags{"tag1", "tag2"},
NetworkMaskLen: 28,
BandWidthMbps: 500,
EnableIPv6: false,
Client: NewAPIClient(caller),
}
return builder.Update(ctx, testZone, ctx.ID)
},
CheckFunc: func(t testutil.TestT, ctx *testutil.CRUDTestContext, value interface{}) error {
internet := value.(*sacloud.Internet)
return testutil.DoAsserts(
testutil.AssertNotNilFunc(t, internet, "Internet"),
testutil.AssertEqualFunc(t, 28, internet.NetworkMaskLen, "Internet.NetworkMaskLen"),
testutil.AssertEqualFunc(t, 500, internet.BandWidthMbps, "Internet.BandWidthMbps"),
testutil.AssertTrueFunc(t, len(internet.Switch.IPv6Nets) == 0, "Internet.Switch.IPv6Nets"),
)
},
},
{
Func: func(ctx *testutil.CRUDTestContext, caller sacloud.APICaller) (interface{}, error) {
internetOp := sacloud.NewInternetOp(caller)
swOp := sacloud.NewSwitchOp(caller)
internet, err := internetOp.Read(ctx, testZone, ctx.ID)
if err != nil {
return nil, err
}
sw, err := swOp.Read(ctx, testZone, internet.Switch.ID)
if err != nil {
return nil, err
}
_, err = internetOp.AddSubnet(ctx, testZone, ctx.ID, &sacloud.InternetAddSubnetRequest{
NetworkMaskLen: 28,
NextHop: sw.Subnets[0].AssignedIPAddressMin,
})
return nil, err
},
CheckFunc: func(t testutil.TestT, ctx *testutil.CRUDTestContext, value interface{}) error {
internet := value.(*sacloud.Internet)
return testutil.DoAsserts(
testutil.AssertNotNilFunc(t, internet, "Internet"),
testutil.AssertTrueFunc(t, len(internet.Switch.Subnets) == 2, "Internet.Switch.Subnets"),
)
},
SkipExtractID: true,
},
},
Delete: &testutil.CRUDTestDeleteFunc{
Func: func(ctx *testutil.CRUDTestContext, caller sacloud.APICaller) error {
return cleanup.DeleteInternet(ctx, sacloud.NewInternetOp(caller), testZone, ctx.ID)
},
},
})
}
| {
"content_hash": "ae6fef236422cb38d794149cced4a8a5",
"timestamp": "",
"source": "github",
"line_count": 109,
"max_line_length": 97,
"avg_line_length": 36.38532110091743,
"alnum_prop": 0.6724659606656581,
"repo_name": "sacloud/libsacloud",
"id": "df9e8460bfa6cc5691f3d09fe5c01b58752905d5",
"size": "4572",
"binary": false,
"copies": "1",
"ref": "refs/heads/main",
"path": "v2/helper/builder/internet/builder_test.go",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Dockerfile",
"bytes": "792"
},
{
"name": "Go",
"bytes": "5822818"
},
{
"name": "Makefile",
"bytes": "2248"
}
],
"symlink_target": ""
} |
// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
#pragma once
#include "juniper_dfw_query_item.h"
#include <vespa/searchlib/fef/properties.h>
namespace juniper { class IQueryVisitor; }
namespace search::docsummary {
/*
* Visitor used by juniper query adapter to visit properties describing
* terms to highlight.
*/
class JuniperDFWTermVisitor : public search::fef::IPropertiesVisitor
{
public:
juniper::IQueryVisitor *_visitor;
JuniperDFWQueryItem _item;
explicit JuniperDFWTermVisitor(juniper::IQueryVisitor *visitor)
: _visitor(visitor),
_item()
{}
void visitProperty(const search::fef::Property::Value &key, const search::fef::Property &values) override;
};
}
| {
"content_hash": "5f4edfb9b522e22e0e725fb66ae2f709",
"timestamp": "",
"source": "github",
"line_count": 29,
"max_line_length": 110,
"avg_line_length": 26.448275862068964,
"alnum_prop": 0.7288135593220338,
"repo_name": "vespa-engine/vespa",
"id": "4b8b3dd8e7b51ccb56344eaa80f352b13a57810d",
"size": "767",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "searchsummary/src/vespa/searchsummary/docsummary/juniper_dfw_term_visitor.h",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "ANTLR",
"bytes": "8130"
},
{
"name": "C",
"bytes": "60315"
},
{
"name": "C++",
"bytes": "29580035"
},
{
"name": "CMake",
"bytes": "593981"
},
{
"name": "Emacs Lisp",
"bytes": "91"
},
{
"name": "GAP",
"bytes": "3312"
},
{
"name": "Go",
"bytes": "560664"
},
{
"name": "HTML",
"bytes": "54520"
},
{
"name": "Java",
"bytes": "40814190"
},
{
"name": "JavaScript",
"bytes": "73436"
},
{
"name": "LLVM",
"bytes": "6152"
},
{
"name": "Lex",
"bytes": "11499"
},
{
"name": "Makefile",
"bytes": "5553"
},
{
"name": "Objective-C",
"bytes": "12369"
},
{
"name": "Perl",
"bytes": "23134"
},
{
"name": "Python",
"bytes": "52392"
},
{
"name": "Roff",
"bytes": "17506"
},
{
"name": "Ruby",
"bytes": "10690"
},
{
"name": "Shell",
"bytes": "268737"
},
{
"name": "Yacc",
"bytes": "14735"
}
],
"symlink_target": ""
} |
from traductor.translators.base import BaseTranslator
class Cpuset(BaseTranslator):
"""
"""
def translate(self, value):
"""
:param value:
:return:
"""
if not value:
return ""
return "--cpuset-cpus=%s" % value | {
"content_hash": "c358a1cd826bbda362c71328d65c31aa",
"timestamp": "",
"source": "github",
"line_count": 15,
"max_line_length": 53,
"avg_line_length": 18.866666666666667,
"alnum_prop": 0.5229681978798587,
"repo_name": "the0rem/traductor",
"id": "cf25b0193f72c7f0891918a0ecad99f2e4a3ddb4",
"size": "283",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "traductor/translators/cpuset.py",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Python",
"bytes": "34540"
},
{
"name": "Ruby",
"bytes": "3748"
}
],
"symlink_target": ""
} |
REQUIRED_SETTINGS = ["use_environments",
"api_server",
"configure_server"]
| {
"content_hash": "d7b2ba2e0d5461045ddc2c632857beb6",
"timestamp": "",
"source": "github",
"line_count": 3,
"max_line_length": 40,
"avg_line_length": 39,
"alnum_prop": 0.4700854700854701,
"repo_name": "sensu/sensu-admin",
"id": "d3a95008866a95e5763f2b7fed4b38df42739cba",
"size": "117",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "config/initializers/required_settings.rb",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "9053"
},
{
"name": "CoffeeScript",
"bytes": "15810"
},
{
"name": "HTML",
"bytes": "69465"
},
{
"name": "JavaScript",
"bytes": "10029"
},
{
"name": "Ruby",
"bytes": "114333"
}
],
"symlink_target": ""
} |
using FlockBuddy.Interfaces;
using FlockBuddy.SteeringBehaviors;
using Microsoft.Xna.Framework;
using System;
namespace FlockBuddy
{
/// <summary>
/// This is the base class for all behaviors
/// </summary>
public abstract class BaseBehavior : IBehavior
{
#region Properties
/// <summary>
/// The type of this beahvior
/// </summary>
public BehaviorType BehaviorType { get; private set; }
/// <summary>
/// a pointer to the owner of this instance
/// </summary>
public IBoid Owner { get; set; }
/// <summary>
/// How much weight to apply to this beahvior
/// </summary>
public float Weight { get; set; }
public abstract float DirectionChange { get; }
public abstract float SpeedChange { get; }
#endregion //Properties
#region Methods
/// <summary>
/// Initializes a new instance of the <see cref="FlockBuddy.BaseBehavior"/> class.
/// </summary>
public BaseBehavior(IBoid owner, BehaviorType behaviorType, float weight)
{
BehaviorType = behaviorType;
Owner = owner;
Weight = weight;
}
/// <summary>
/// Called every frame to get the steering direction from this behavior
/// Dont call this for inactive behaviors
/// </summary>
/// <returns></returns>
public abstract Vector2 GetSteering();
public static IBehavior BehaviorFactory(BehaviorType behaviorType, IBoid boid)
{
switch (behaviorType)
{
case BehaviorType.WallAvoidance: { return new WallAvoidance(boid); }
case BehaviorType.ObstacleAvoidance: { return new ObstacleAvoidance(boid); }
case BehaviorType.Evade: { return new Evade(boid); }
case BehaviorType.Flee: { return new Flee(boid); }
case BehaviorType.Direction: { return new Direction(boid); }
case BehaviorType.Separation: { return new Separation(boid); }
case BehaviorType.Alignment: { return new Alignment(boid); }
case BehaviorType.Cohesion: { return new Cohesion(boid); }
case BehaviorType.Seek: { return new Seek(boid); }
case BehaviorType.Arrive: { return new Arrive(boid); }
case BehaviorType.Wander: { return new Wander(boid); }
case BehaviorType.Pursuit: { return new Pursuit(boid); }
case BehaviorType.OffsetPursuit: { return new OffsetPursuit(boid); }
case BehaviorType.Interpose: { return new Interpose(boid); }
case BehaviorType.Hide: { return new Hide(boid); }
case BehaviorType.FollowPath: { return new FollowPath(boid); }
case BehaviorType.GuardAlignment: { return new GuardAlignment(boid); }
case BehaviorType.GuardCohesion: { return new GuardCohesion(boid); }
case BehaviorType.GuardSeparation: { return new GuardSeparation(boid); }
default: { throw new NotImplementedException(string.Format("Unhandled BehaviorType: {0}", behaviorType)); }
}
}
#endregion //Methods
}
} | {
"content_hash": "90e7044199a5ed911c377dce25085050",
"timestamp": "",
"source": "github",
"line_count": 84,
"max_line_length": 112,
"avg_line_length": 33.904761904761905,
"alnum_prop": 0.6878511235955056,
"repo_name": "dmanning23/FlockBuddy",
"id": "b28bfb539f7b0f59494bfb5356b851cd75bbd975",
"size": "2848",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "FlockBuddy/FlockBuddy.SharedProject/BaseBehavior.cs",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C#",
"bytes": "132820"
},
{
"name": "PowerShell",
"bytes": "129"
}
],
"symlink_target": ""
} |
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using E2Print.Domain.Entities;
namespace E2Print.BL.Interfaces
{
public interface IProduct
{
List<Product> GetAll();
List<Product> GetProducts(int startIndex, int pageSize);
int GetProductCount();
List<Product> GetByCategoryId(int categoryId);
List<Product> GetByProductName(string productName);
Product GetById(int id);
Product SearchByAttributes(string name,string color,string material, string size, int quantity);
Product Create(Product product);
Result Update(Product product);
void Delete(int productId);
}
}
| {
"content_hash": "2ef88d44fe07d19f4e76871fe9135c9e",
"timestamp": "",
"source": "github",
"line_count": 26,
"max_line_length": 104,
"avg_line_length": 28,
"alnum_prop": 0.7019230769230769,
"repo_name": "kma14/HB",
"id": "9ab6535eb6f6663b8cbf419f5a8797bd7b7712f0",
"size": "730",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "E2Print.BL/Interfaces/IProduct.cs",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "ASP",
"bytes": "26943"
},
{
"name": "ApacheConf",
"bytes": "871"
},
{
"name": "C#",
"bytes": "436686"
},
{
"name": "CSS",
"bytes": "1400839"
},
{
"name": "Go",
"bytes": "7076"
},
{
"name": "HTML",
"bytes": "64762"
},
{
"name": "JavaScript",
"bytes": "1197413"
},
{
"name": "PHP",
"bytes": "54383"
},
{
"name": "Python",
"bytes": "5845"
}
],
"symlink_target": ""
} |
{-# LANGUAGE
FlexibleContexts
, FlexibleInstances
, LambdaCase
, MultiParamTypeClasses
, OverloadedStrings
, PatternGuards
, RecordWildCards
#-}
-- | Memoized packrat parsing, inspired by Edward Kmett\'s
-- \"A Parsec Full of Rats\".
module Language.Bash.Parse.Internal
( -- * Packrat parsing
D
, pack
-- * Tokens
, satisfying
-- * Whitespace
, I.skipSpace
-- * Words
, anyWord
, word
, reservedWord
, unreservedWord
, assignBuiltin
, ioDesc
, name
-- * Operators
, anyOperator
, operator
-- * Assignments
, assign
-- * Arithmetic expressions
, arith
-- * Here documents
, heredocWord
) where
import Control.Applicative
import Control.Monad
import Data.Function
import Data.Functor.Identity
import Text.Parsec.Char
import Text.Parsec.Combinator hiding (optional)
import Text.Parsec.Error
import Text.Parsec.Prim hiding ((<|>), token)
import Text.Parsec.Pos
import qualified Language.Bash.Parse.Word as I
import Language.Bash.Pretty
import Language.Bash.Syntax
import Language.Bash.Word
-- | A memoized result.
type Result d a = Consumed (Reply d () a)
-- | Build a parser from a field accessor.
rat :: Monad m => (d -> Result d a) -> ParsecT d u m a
rat f = mkPT $ \s0 -> return $
return . patch s0 <$> f (stateInput s0)
where
patch (State _ _ u) (Ok a (State s p _) err) = Ok a (State s p u) err
patch _ (Error e) = Error e
-- | Obtain a result from a stateless parser.
womp :: d -> SourcePos -> ParsecT d () Identity a -> Result d a
womp d pos p = fmap runIdentity . runIdentity $
runParsecT p (State d pos ())
-- | Run a parser, merging it with another.
reparse :: Stream s m t0 => ParsecT s u m a -> s -> ParsecT t u m a
reparse p input = mkPT $ \s0@(State _ _ u) ->
(fmap return . patch s0) `liftM` runParserT p u "" input
where
patch (State _ pos _) (Left e) = Empty (Error (setErrorPos pos e))
patch s (Right r) = Empty (Ok r s (unknownError s))
-- | A token.
data Token
= TWord Word
| TIODesc IODesc
-- | A stream with memoized results.
data D = D
{ _token :: Result D Token
, _anyWord :: Result D Word
, _ioDesc :: Result D IODesc
, _anyOperator :: Result D String
, _assign :: Result D Assign
, _uncons :: Maybe (Char, D)
}
instance Monad m => Stream D m Char where
uncons = return . _uncons
-- | Create a source from a string.
pack :: SourcePos -> String -> D
pack p s = fix $ \d ->
let result = womp d p
_token = result $ do
t <- I.word
guard $ not (null t)
next <- optional (lookAhead anyChar)
I.skipSpace
return $ case next of
Just c | c == '<' || c == '>'
, Right desc <- parse (descriptor <* eof) "" (prettyText t)
-> TIODesc desc
_ -> TWord t
_anyWord = result $ token >>= \case
TWord w -> return w
_ -> empty
_ioDesc = result $ token >>= \case
TIODesc desc -> return desc
_ -> empty
_anyOperator = result $ I.operator operators <* I.skipSpace
_assign = result $ I.assign <* I.skipSpace
_uncons = case s of
[] -> Nothing
(x:xs) -> Just (x, pack (updatePosChar p x) xs)
in D {..}
-- | Parse a value satisfying the predicate.
satisfying
:: (Stream s m t, Show a)
=> ParsecT s u m a
-> (a -> Bool)
-> ParsecT s u m a
satisfying a p = try $ do
t <- a
if p t then return t else unexpected (show t)
-- | Shell reserved words.
reservedWords :: [Word]
reservedWords =
[ "!", "[[", "]]", "{", "}"
, "if", "then", "else", "elif", "fi"
, "case", "esac", "for", "select", "while", "until"
, "in", "do", "done", "time", "function"
]
-- | Shell assignment builtins. These builtins can take assignments as
-- arguments.
assignBuiltins :: [Word]
assignBuiltins =
[ "alias", "declare", "export", "eval"
, "let", "local", "readonly", "typeset"
]
-- | All Bash operators.
operators :: [String]
operators =
[ "(", ")", ";;", ";&", ";;&"
, "|", "|&", "||", "&&", ";", "&", "\n"
, "<", ">", ">|", ">>", "&>", "&>>", "<<<", "<&", ">&", "<>"
, "<<", "<<-"
]
-- | Parse a descriptor.
descriptor :: Stream s m Char => ParsecT s u m IODesc
descriptor = IONumber . read <$> many1 digit
<|> IOVar <$ char '{' <*> I.name <* char '}'
-- | Parse a single token.
token :: Monad m => ParsecT D u m Token
token = try (rat _token) <?> "token"
-- | Parse any word.
anyWord :: Monad m => ParsecT D u m Word
anyWord = try (rat _anyWord) <?> "word"
-- | Parse the given word.
word :: Monad m => Word -> ParsecT D u m Word
word w = anyWord `satisfying` (== w) <?> prettyText w
-- | Parse a reversed word.
reservedWord :: Monad m => ParsecT D u m Word
reservedWord = anyWord `satisfying` (`elem` reservedWords) <?> "reserved word"
-- | Parse a word that is not reserved.
unreservedWord :: Monad m => ParsecT D u m Word
unreservedWord = anyWord `satisfying` (`notElem` reservedWords)
<?> "unreserved word"
-- | Parse an assignment builtin.
assignBuiltin :: Monad m => ParsecT D u m Word
assignBuiltin = anyWord `satisfying` (`elem` assignBuiltins)
<?> "assignment builtin"
-- | Parse a redirection word or number.
ioDesc :: Monad m => ParsecT D u m IODesc
ioDesc = try (rat _ioDesc) <?> "IO descriptor"
-- | Parse a variable name.
name :: Monad m => ParsecT D u m String
name = (prettyText <$> unreservedWord) `satisfying` isName <?> "name"
where
isName s = case parse (I.name <* eof) "" (prettyText s) of
Left _ -> False
Right _ -> True
-- | Parse any operator.
anyOperator :: Monad m => ParsecT D u m String
anyOperator = try (rat _anyOperator) <?> "operator"
-- | Parse a given operator.
operator :: Monad m => String -> ParsecT D u m String
operator op = anyOperator `satisfying` (== op) <?> op
-- | Parse an assignment.
assign :: Monad m => ParsecT D u m Assign
assign = try (rat _assign) <?> "assignment"
-- | Parse an arithmetic expression.
arith :: Monad m => ParsecT D u m String
arith = try (string "((") *> I.arith <* string "))" <* I.skipSpace
<?> "arithmetic expression"
-- | Reparse a here document into a word.
heredocWord :: Monad m => String -> ParsecT s u m Word
heredocWord = reparse I.heredocWord
| {
"content_hash": "6707c8fda506f4835aab96d96de83ad2",
"timestamp": "",
"source": "github",
"line_count": 221,
"max_line_length": 82,
"avg_line_length": 30.11764705882353,
"alnum_prop": 0.5635516826923077,
"repo_name": "jfoutz/language-bash",
"id": "666b7d1f512b9cb64b98447ab012b00a02610c0f",
"size": "6656",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/Language/Bash/Parse/Internal.hs",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "Haskell",
"bytes": "67552"
}
],
"symlink_target": ""
} |
ACCEPTED
#### According to
The Catalogue of Life, 3rd January 2011
#### Published in
null
#### Original name
null
### Remarks
null | {
"content_hash": "04cb21d809d7c2aa70e6d3f12a865054",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 39,
"avg_line_length": 10.307692307692308,
"alnum_prop": 0.6940298507462687,
"repo_name": "mdoering/backbone",
"id": "29368fda5399c9987736a4da2f415f57634fd043",
"size": "199",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "life/Bacteria/Thermotogae/Thermotogae/Thermotogales/Thermotogaceae/Thermotoga/Thermotoga maritima/README.md",
"mode": "33188",
"license": "apache-2.0",
"language": [],
"symlink_target": ""
} |
<?xml version="1.0" encoding="utf-8" ?>
<extension xmlns="urn:newrelic-extension">
<instrumentation>
<tracerFactory>
<match assemblyName="System.Web.Mvc" className="System.Web.Mvc.ControllerActionInvoker">
<exactMethodMatcher methodName="InvokeAction" />
</match>
</tracerFactory>
<tracerFactory>
<match assemblyName="System.Web.Mvc" className="System.Web.Mvc.Async.AsyncControllerActionInvoker">
<exactMethodMatcher methodName="BeginInvokeAction" />
</match>
</tracerFactory>
<tracerFactory>
<match assemblyName="System.Web.Mvc" className="System.Web.Mvc.Async.AsyncControllerActionInvoker">
<exactMethodMatcher methodName="EndInvokeAction" />
</match>
</tracerFactory>
<tracerFactory>
<match assemblyName="System.Web.Mvc" className="System.Web.Mvc.ControllerActionInvoker">
<exactMethodMatcher methodName="InvokeExceptionFilters" />
</match>
</tracerFactory>
</instrumentation>
</extension>
| {
"content_hash": "26b29bf99564b19b1ffbe38a4ef5729f",
"timestamp": "",
"source": "github",
"line_count": 30,
"max_line_length": 102,
"avg_line_length": 31.9,
"alnum_prop": 0.7429467084639498,
"repo_name": "chris-han/FaceRecognization",
"id": "d34338e628f5b62f4e735288b1285075b72c953e",
"size": "959",
"binary": false,
"copies": "9",
"ref": "refs/heads/master",
"path": "WebUI2/newrelic/Extensions/NewRelic.Providers.Wrapper.Mvc3.Instrumentation.xml",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "ASP",
"bytes": "58604"
},
{
"name": "C#",
"bytes": "114036"
},
{
"name": "CSS",
"bytes": "668492"
},
{
"name": "HTML",
"bytes": "7291"
},
{
"name": "JavaScript",
"bytes": "22492"
}
],
"symlink_target": ""
} |
using System;
using System.Web.Http;
using System.Web.Mvc;
using StacksOfWax.OwinApi.Areas.HelpPage.ModelDescriptions;
using StacksOfWax.OwinApi.Areas.HelpPage.Models;
namespace StacksOfWax.OwinApi.Areas.HelpPage.Controllers
{
/// <summary>
/// The controller that will handle requests for the help page.
/// </summary>
public class HelpController : Controller
{
private const string ErrorViewName = "Error";
public HelpController()
: this(GlobalConfiguration.Configuration)
{
}
public HelpController(HttpConfiguration config)
{
Configuration = config;
}
public HttpConfiguration Configuration { get; private set; }
public ActionResult Index()
{
ViewBag.DocumentationProvider = Configuration.Services.GetDocumentationProvider();
return View(Configuration.Services.GetApiExplorer().ApiDescriptions);
}
public ActionResult Api(string apiId)
{
if (!String.IsNullOrEmpty(apiId))
{
HelpPageApiModel apiModel = Configuration.GetHelpPageApiModel(apiId);
if (apiModel != null)
{
return View(apiModel);
}
}
return View(ErrorViewName);
}
public ActionResult ResourceModel(string modelName)
{
if (!String.IsNullOrEmpty(modelName))
{
ModelDescriptionGenerator modelDescriptionGenerator = Configuration.GetModelDescriptionGenerator();
ModelDescription modelDescription;
if (modelDescriptionGenerator.GeneratedModels.TryGetValue(modelName, out modelDescription))
{
return View(modelDescription);
}
}
return View(ErrorViewName);
}
}
} | {
"content_hash": "a586cbb91011bf90cead53236b4379b6",
"timestamp": "",
"source": "github",
"line_count": 63,
"max_line_length": 115,
"avg_line_length": 30.41269841269841,
"alnum_prop": 0.6012526096033403,
"repo_name": "jamieide/webapi-presentation",
"id": "7085b26277b44183ff09185c6688736a0689bd3d",
"size": "1916",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "StacksOfWax/StacksOfWax.OwinApi/Areas/HelpPage/Controllers/HelpController.cs",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "ASP",
"bytes": "471"
},
{
"name": "C#",
"bytes": "591638"
},
{
"name": "CSS",
"bytes": "10504"
},
{
"name": "HTML",
"bytes": "20276"
},
{
"name": "JavaScript",
"bytes": "60163"
}
],
"symlink_target": ""
} |
<?php
declare(strict_types=1);
namespace Doctrine\Bundle\MongoDBBundle\Tests\Fixtures\DataCollector;
use Doctrine\ODM\MongoDB\Mapping\Annotations as ODM;
use MongoDB\BSON\ObjectId;
/** @ODM\Document */
class Category
{
/**
* @ODM\Id
*
* @var ObjectId|null
*/
protected $id;
/**
* @ODM\Field(type="string")
*
* @var string
*/
public $name;
public function __construct(string $name)
{
$this->name = $name;
}
}
| {
"content_hash": "883704332674ab9af443635d9754af72",
"timestamp": "",
"source": "github",
"line_count": 31,
"max_line_length": 69,
"avg_line_length": 15.806451612903226,
"alnum_prop": 0.5857142857142857,
"repo_name": "doctrine/DoctrineMongoDBBundle",
"id": "18dc32a7d6abc3855c3901b5bf98976f0cd12148",
"size": "490",
"binary": false,
"copies": "1",
"ref": "refs/heads/4.6.x",
"path": "Tests/Fixtures/DataCollector/Category.php",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "PHP",
"bytes": "307676"
},
{
"name": "Twig",
"bytes": "3786"
}
],
"symlink_target": ""
} |
package com.bitdubai.fermat_cbp_api.layer.cbp_sub_app_module.crypto_customer_community.exceptions;
import com.bitdubai.fermat_api.FermatException;
/**
* Created by eze on 2015.07.30..
*/
public class CantStartRequestException extends FermatException {
/**
* This is the constructor that every inherited FermatException must implement
*
* @param message the short description of the why this exception happened, there is a public static constant called DEFAULT_MESSAGE that can be used here
* @param cause the exception that triggered the throwing of the current exception, if there are no other exceptions to be declared here, the cause should be null
* @param context a String that provides the values of the variables that could have affected the exception
* @param possibleReason an explicative reason of why we believe this exception was most likely thrown
*/
public CantStartRequestException(String message, Exception cause, String context, String possibleReason) {
super(message, cause, context, possibleReason);
}
}
| {
"content_hash": "8f08dfaf9c8ae1b42e9702dbf2cb3a19",
"timestamp": "",
"source": "github",
"line_count": 20,
"max_line_length": 175,
"avg_line_length": 55.25,
"alnum_prop": 0.746606334841629,
"repo_name": "fvasquezjatar/fermat-unused",
"id": "89d6f9a5c07f42908f13fcacf18e5e49216f38f8",
"size": "1105",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "fermat-cbp-api/src/main/java/com/bitdubai/fermat_cbp_api/layer/cbp_sub_app_module/crypto_customer_community/exceptions/CantStartRequestException.java",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "1204"
},
{
"name": "Groovy",
"bytes": "76309"
},
{
"name": "HTML",
"bytes": "322840"
},
{
"name": "Java",
"bytes": "14027288"
},
{
"name": "Scala",
"bytes": "1353"
}
],
"symlink_target": ""
} |
/**
* A simple custom row expander that does not add a "+" / "-" column.
*/
Ext.define('ExecDashboard.ux.plugin.RowExpander', {
extend: 'Ext.grid.plugin.RowExpander',
alias: 'plugin.ux-rowexpander',
rowBodyTpl: [
'<div class="text-wrapper">',
'<div class="news-data">',
'<div class="news-paragraph">{paragraph}</div>',
'<div class="news-toggle collapse"><span>COLLAPSE</span><img src="https://static.rasc.ch/ext-6.5.2/build/examples/classic/executive-dashboard/resources/icons/collapse-news.png"></div>',
'</div>',
'</div>'
],
// don't add the expander +/- because we will use a custom one instead
addExpander: Ext.emptyFn,
addCollapsedCls: {
fn: function(out, values, parent) {
var me = this.rowExpander;
if (!me.recordsExpanded[values.record.internalId]) {
values.itemClasses.push(me.rowCollapsedCls);
} else {
values.itemClasses.push('x-grid-row-expanded');
}
this.nextTpl.applyOut(values, out, parent);
},
syncRowHeights: function(lockedItem, normalItem) {
this.rowExpander.syncRowHeights(lockedItem, normalItem);
},
// We need a high priority to get in ahead of the outerRowTpl
// so we can setup row data
priority: 20000
}
});
| {
"content_hash": "9423061655f413b2039420abbaea9703",
"timestamp": "",
"source": "github",
"line_count": 41,
"max_line_length": 201,
"avg_line_length": 34.292682926829265,
"alnum_prop": 0.5839260312944523,
"repo_name": "ralscha/extdirectspring-demo",
"id": "37024e5bb022671dcdaff7954f911359cbec2c0f",
"size": "1406",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/main/resources/static/extjs6classic/executive-dashboard/app/ux/plugin/RowExpander.js",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Batchfile",
"bytes": "683"
},
{
"name": "CSS",
"bytes": "17363"
},
{
"name": "HTML",
"bytes": "136892"
},
{
"name": "Java",
"bytes": "370333"
},
{
"name": "JavaScript",
"bytes": "1171254"
}
],
"symlink_target": ""
} |
//
// SDLHapticManager.h
// SmartDeviceLink-iOS
//
// Copyright © 2017 smartdevicelink. All rights reserved.
//
#import <UIKit/UIKit.h>
#import "SDLFocusableItemLocatorType.h"
#import "SDLFocusableItemHitTester.h"
NS_ASSUME_NONNULL_BEGIN
@interface SDLFocusableItemLocator : NSObject <SDLFocusableItemLocatorType, SDLFocusableItemHitTester>
/**
Whether or not this will attempt to send haptic RPCs.
@note Defaults to NO.
*/
@property (nonatomic, assign) BOOL enableHapticDataRequests;
/**
The projection view controller associated with the Haptic Manager
*/
@property (nonatomic, strong) UIViewController *viewController;
@end
NS_ASSUME_NONNULL_END
| {
"content_hash": "7ab7423c4b028a30d7c14fc69f5d2d33",
"timestamp": "",
"source": "github",
"line_count": 31,
"max_line_length": 102,
"avg_line_length": 21.483870967741936,
"alnum_prop": 0.7747747747747747,
"repo_name": "smartdevicelink/sdl_ios",
"id": "02afcb5941129a290505fdd466ff888917ca7dac",
"size": "667",
"binary": false,
"copies": "1",
"ref": "refs/heads/develop",
"path": "SmartDeviceLink/private/SDLFocusableItemLocator.h",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "C",
"bytes": "1311"
},
{
"name": "Jinja",
"bytes": "9097"
},
{
"name": "Mustache",
"bytes": "1587"
},
{
"name": "Objective-C",
"bytes": "6802591"
},
{
"name": "Python",
"bytes": "95846"
},
{
"name": "Ruby",
"bytes": "1875"
},
{
"name": "Shell",
"bytes": "25862"
},
{
"name": "Swift",
"bytes": "112020"
}
],
"symlink_target": ""
} |
using System.Linq;
namespace Muyou.LinqToWindows.Extensions
{
public static class CharExtensions
{
public static bool IsInRange(this char @char, char lower, char upper)
{
return @char >= lower && @char <= upper;
}
public static bool IsOneOf(this char @char, params char[] chars)
{
return chars.Any(@char.Equals);
}
}
} | {
"content_hash": "b4a6bfb8c16b2084447fb21eeaf61c37",
"timestamp": "",
"source": "github",
"line_count": 17,
"max_line_length": 71,
"avg_line_length": 20.058823529411764,
"alnum_prop": 0.6920821114369502,
"repo_name": "Eskat0n/linqtowindows",
"id": "baf30943ea22457b54efa041a91341c0686784a4",
"size": "341",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/LinqToWindows/Extensions/CharExtensions.cs",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C#",
"bytes": "53120"
}
],
"symlink_target": ""
} |
package com.deleidos.rtws.master.core.exception;
public class StatisticsCollectorException extends Exception {
private static final long serialVersionUID = 7526471155622956523L;
public StatisticsCollectorException(String message) {
super(message);
}
public StatisticsCollectorException(String message, Throwable cause) {
super(message, cause);
}
}
| {
"content_hash": "c886dfce341b04bbb852cf0b94285949",
"timestamp": "",
"source": "github",
"line_count": 18,
"max_line_length": 71,
"avg_line_length": 20.555555555555557,
"alnum_prop": 0.7864864864864864,
"repo_name": "deleidos/digitaledge-platform",
"id": "acc385384bad0084de2d69765e2744118c27f299",
"size": "12305",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "master/src/main/java/com/deleidos/rtws/master/core/exception/StatisticsCollectorException.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "ActionScript",
"bytes": "16315580"
},
{
"name": "Batchfile",
"bytes": "15678"
},
{
"name": "C",
"bytes": "26042"
},
{
"name": "CSS",
"bytes": "846559"
},
{
"name": "Groovy",
"bytes": "93743"
},
{
"name": "HTML",
"bytes": "36583222"
},
{
"name": "Java",
"bytes": "33127586"
},
{
"name": "JavaScript",
"bytes": "2030589"
},
{
"name": "Nginx",
"bytes": "3934"
},
{
"name": "Perl",
"bytes": "330290"
},
{
"name": "Python",
"bytes": "54288"
},
{
"name": "Ruby",
"bytes": "5133"
},
{
"name": "Shell",
"bytes": "2482631"
},
{
"name": "XSLT",
"bytes": "978664"
}
],
"symlink_target": ""
} |
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>idxassoc: 16 s 🏆</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.5.2 / idxassoc - 8.5.0</a></li>
</ul>
</div>
</div>
</div>
<div class="article">
<div class="row">
<div class="col-md-12">
<a href="../..">« Up</a>
<h1>
idxassoc
<small>
8.5.0
<span class="label label-success">16 s 🏆</span>
</small>
</h1>
<p>📅 <em><script>document.write(moment("2022-11-15 13:24:57 +0000", "YYYY-MM-DD HH:mm:ss Z").fromNow());</script> (2022-11-15 13:24:57 UTC)</em><p>
<h2>Context</h2>
<pre># Packages matching: installed
# Name # Installed # Synopsis
base-bigarray base
base-num base Num library distributed with the OCaml compiler
base-threads base
base-unix base
camlp5 7.14 Preprocessor-pretty-printer of OCaml
conf-findutils 1 Virtual package relying on findutils
conf-perl 2 Virtual package relying on perl
coq 8.5.2 Formal proof management system
num 0 The Num library for arbitrary-precision integer and rational arithmetic
ocaml 4.04.2 The OCaml compiler (virtual package)
ocaml-base-compiler 4.04.2 Official 4.04.2 release
ocaml-config 1 OCaml Switch Configuration
# opam file:
opam-version: "2.0"
maintainer: "matej.kosik@inria.fr"
homepage: "https://github.com/coq-contribs/idxassoc"
license: "BSD with advertising clause"
build: [make "-j%{jobs}%"]
install: [make "install"]
remove: ["rm" "-R" "%{lib}%/coq/user-contrib/IdxAssoc"]
depends: [
"ocaml"
"coq" {>= "8.5" & < "8.6~"}
]
tags: [ "keyword:associative arrays" "keyword:search operator" "keyword:data structures" "category:Computer Science/Data Types and Data Structures" "date:2001-04" ]
authors: [ "Dominique Quatravaux <>" "Gérald Macinenti <>" "François-René Ridaux <>" ]
bug-reports: "https://github.com/coq-contribs/idxassoc/issues"
dev-repo: "git+https://github.com/coq-contribs/idxassoc.git"
synopsis: "Associative Arrays"
description: """
We define the associative array (key -> value associations)
datatype as list of couples, providing definitions of standards
operations such as adding, deleting.
We introduce predicates for membership of a key and of couples.
Finally we define a search operator ("find") which returns the
value associated with a key or the "none" option (see file
Option.v which should be part of this contribution) on failure.
Lemmas we prove about these concepts were motivated by our needs
at the moment we created this file. We hope they'll suit your
needs too but anyway, feel free to communicate any wish or
remark."""
flags: light-uninstall
url {
src: "https://github.com/coq-contribs/idxassoc/archive/v8.5.0.tar.gz"
checksum: "md5=4ba65dcf6f3a74cfb6a9a4c91c65de54"
}
</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-idxassoc.8.5.0 coq.8.5.2</code></dd>
<dt>Return code</dt>
<dd>0</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>true</code></dd>
<dt>Return code</dt>
<dd>0</dd>
</dl>
<h2>Install dependencies</h2>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>opam list; echo; ulimit -Sv 4000000; timeout 4h opam install -y --deps-only coq-idxassoc.8.5.0 coq.8.5.2</code></dd>
<dt>Return code</dt>
<dd>0</dd>
<dt>Duration</dt>
<dd>12 s</dd>
</dl>
<h2>Install 🚀</h2>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>opam list; echo; ulimit -Sv 16000000; timeout 4h opam install -y -v coq-idxassoc.8.5.0 coq.8.5.2</code></dd>
<dt>Return code</dt>
<dd>0</dd>
<dt>Duration</dt>
<dd>16 s</dd>
</dl>
<h2>Installation size</h2>
<p>Total: 205 K</p>
<ul>
<li>94 K <code>../ocaml-base-compiler.4.04.2/lib/coq/user-contrib/IdxAssoc/Assoc.glob</code></li>
<li>77 K <code>../ocaml-base-compiler.4.04.2/lib/coq/user-contrib/IdxAssoc/Assoc.vo</code></li>
<li>28 K <code>../ocaml-base-compiler.4.04.2/lib/coq/user-contrib/IdxAssoc/Assoc.v</code></li>
<li>4 K <code>../ocaml-base-compiler.4.04.2/lib/coq/user-contrib/IdxAssoc/Option.vo</code></li>
<li>1 K <code>../ocaml-base-compiler.4.04.2/lib/coq/user-contrib/IdxAssoc/Option.glob</code></li>
<li>1 K <code>../ocaml-base-compiler.4.04.2/lib/coq/user-contrib/IdxAssoc/Option.v</code></li>
</ul>
<h2>Uninstall 🧹</h2>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>opam remove -y coq-idxassoc.8.5.0</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">
Sources are on <a href="https://github.com/coq-bench">GitHub</a> © Guillaume Claret 🐣
</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": "5ea54bcca04ca189f543f94c1a0c3fc5",
"timestamp": "",
"source": "github",
"line_count": 174,
"max_line_length": 214,
"avg_line_length": 45.9367816091954,
"alnum_prop": 0.5631177280120105,
"repo_name": "coq-bench/coq-bench.github.io",
"id": "4b02a58532a498ce9067f1d0f13fb7711fc5234b",
"size": "8021",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "clean/Linux-x86_64-4.04.2-2.0.5/released/8.5.2/idxassoc/8.5.0.html",
"mode": "33188",
"license": "mit",
"language": [],
"symlink_target": ""
} |
@interface WPHTTPAuthenticationAlertView : UIAlertView
- (id)initWithChallenge:(NSURLAuthenticationChallenge *)challenge;
@end
| {
"content_hash": "289802dc2bc34dd15e50c1cf256096ea",
"timestamp": "",
"source": "github",
"line_count": 3,
"max_line_length": 66,
"avg_line_length": 42.333333333333336,
"alnum_prop": 0.8503937007874016,
"repo_name": "WuXueqian/WordPressKit",
"id": "5ad7344e050166303f6d743831ca82356a8cefca",
"size": "187",
"binary": false,
"copies": "3",
"ref": "refs/heads/master",
"path": "Pods/WordPressApi/WordPressApi/WPHTTPAuthenticationAlertView.h",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "1414654"
},
{
"name": "HTML",
"bytes": "42963"
},
{
"name": "JavaScript",
"bytes": "1851534"
},
{
"name": "Objective-C",
"bytes": "436844"
},
{
"name": "PHP",
"bytes": "8881554"
}
],
"symlink_target": ""
} |
{% extends "layout.html" %}
{% block page_title %}
Check MOT history
{% endblock %}
{% block content %}
<main id="content" role="main">
<a class="link-back" href="enter-reg">Back</a>
<div class="banner advice">
<h2 class="heading-medium">
The MOT of this vehicle is expiring soon on 9 February 2018
</h2>
<p>You can sign up for an <a href="">email reminder</a></p>
</div>
<h1 class="heading-xlarge" style="margin-bottom: 20px;">
<span class="heading-secondary">Vehicle</span>
Renault Clio
</h1>
<div class="grid-row">
<div class="column-third">
<h1 class="heading-large" style="margin-top: 0px;">
<span class="heading-secondary">MOT valid until</span>
9 February 2018
</h1>
<a href="">Get a reminder email</a>
</div>
<div class="column-two-thirds">
<h1 class="heading-large" style="margin-top: 0px;">
<span class="heading-secondary">Registration</span>
CE 10 CZR
</h1>
<br>
<div class="grid-row">
<div class="column-one-third">
<h1 class="heading-large" style="margin-top: 0px; font-size: 1.4em;">
<span class="heading-secondary">Fuel type</span>
Petrol
</h1>
</div>
<div class="column-one-third">
<h1 class="heading-large" style="margin-top: 0px; font-size: 1.4em;">
<span class="heading-secondary">Colour</span>
Red
</h1>
</div>
<div class="column-one-third">
<h1 class="heading-large" style="margin-top: 0px; font-size: 1.4em;">
<span class="heading-secondary">Date registered</span>
10 April 2010
</h1>
</div>
</div>
</div>
</div>
<br>
<br>
<a class="button" href="enter-reg">Check another vehicle</a>
<br>
<br>
<div class="form-group">
<details>
<summary><span class="summary">Incorrect details?</span></summary>
<div class="panel panel-border-narrow">
<p>
If any of the vehicle details or MOT history is wrong, <a href="">contact DVSA</a>
</p>
</div>
</details>
</div>
<br>
<!-- <h1 class="heading-large" style="margin-top: 0px;">
<span class="heading-secondary">MOT valid until</span>
9 February 2018
</h1> -->
<h2 class="heading-large">MOT history</h2>
<!-- test start -->
<div class="grid-row">
<div class="column-third">
<h1 class="heading-large" style="margin-top: 0px; font-size: 1.05em; font-weight: bold;">
<span class="heading-secondary" style="font-size:1.05em">Date tested</span>
10 February 2017
</h1>
<h1 class="heading-large" style="margin-top: 0px; font-size: 3.5em; color: #00823B;">PASS</h1>
</div>
<div class="column-two-thirds">
<div class="grid-row">
<div class="column-one-half">
<h1 class="heading-large" style="margin-top: 0px; font-size: 1.05em; font-weight: bold;">
<span class="heading-secondary" style="font-size:1.05em">Mileage</span>
29,611
</h1>
</div>
<div class="column-one-half">
<h1 class="heading-large" style="margin-top: 0px; font-size: 1.05em; font-weight: bold;">
<span class="heading-secondary" style="font-size:1.05em" style="font-size: 1.05em;">Expiry date</span>
9 February 2018
</h1>
</div>
<div class="column-one-half">
<h1 class="heading-large" style="margin-top: 0px; font-size: 1.05em; font-weight: bold;">
<span class="heading-secondary" style="font-size:1.05em">Test location</span>
Halfords Autocentre<br>160 Bromley Rd<br>London<br>SE6 2NZ
</h1>
</div>
<div class="column-one-half">
<h1 class="heading-large" style="margin-top: 0px; font-size: 1.05em; font-weight: bold;">
<span class="heading-secondary" style="font-size:1.05em">MOT test number</span>
3995 7555 7274
</h1>
</div>
</div>
</div>
</div>
<!-- test end -->
<hr>
<!-- test start -->
<div class="grid-row">
<div class="column-third">
<h1 class="heading-large" style="margin-top: 0px; font-size: 1.05em; font-weight: bold;">
<span class="heading-secondary" style="font-size:1.05em">Date tested</span>
10 February 2017
</h1>
<h1 class="heading-large" style="margin-top: 0px; font-size: 3.5em; color: #B10E1E;">FAIL</h1>
</div>
<div class="column-two-thirds">
<div class="grid-row">
<div class="column-one-half">
<h1 class="heading-large" style="margin-top: 0px; font-size: 1.05em; font-weight: bold;">
<span class="heading-secondary" style="font-size:1.05em">Mileage</span>
29,611
</h1>
</div>
<div class="column-one-half">
<h1 class="heading-large" style="margin-top: 0px; font-size: 1.05em; font-weight: bold;">
<span class="heading-secondary" style="font-size:1.05em">MOT test number</span>
5864 4990 1701
</h1>
</div>
<div class="column-one-half">
<h1 class="heading-large" style="margin-top: 0px; font-size: 1.05em; font-weight: bold;">
<span class="heading-secondary" style="font-size:1.05em">Test location</span>
Halfords Autocentre<br>160 Bromley Rd<br>London<br>SE6 2NZ
</h1>
</div>
</div>
<h1 class="heading-large" style="margin-top: 0px; font-size: 1.05em; font-weight: bold;">
<span class="heading-secondary" style="font-size:1.05em">Reasons for failure:</span>
<ul class="list list-bullet">
<li>Nearside Track rod end ball joint has excessive play (2.2.B.1f)</li>
<li>Nearside Rear Tyre has a cut in excess of the requirements deep enough to reach the ply or cords (4.1.D.1a)</li>
</ul>
</h1>
<h1 class="heading-large" style="margin-top: 0px; font-size: 1.05em; font-weight: bold;">
<span class="heading-secondary" style="font-size:1.05em">Advisory notice:</span>
<ul class="list list-bullet">
<li>Offside Track rod end ball joint has slight play (2.2.B.1f)</li>
</ul>
</h1>
<div class="form-group">
<details>
<summary><span class="summary">What are these?</span></summary>
<div class="panel panel-border-narrow">
<p>
Advisory notices are minor problems with the vehicle. If they become more serious they could cause the vehicle to fail its next MOT test.</p>
<p>Failure items must be fixed before the vehicle can pass its MOT.</p>
<p>See <a href="">car parts checked at an MOT</a></p>
</p>
</div>
</details>
</div>
</div>
</div>
<!-- test end -->
<hr>
<!-- test start -->
<div class="grid-row">
<div class="column-third">
<h1 class="heading-large" style="margin-top: 0px; font-size: 1.05em; font-weight: bold;">
<span class="heading-secondary" style="font-size:1.05em">Date tested</span>
27 May 2016
</h1>
<h1 class="heading-large" style="margin-top: 0px; font-size: 3.5em; color: #00823B;">PASS</h1>
</div>
<div class="column-two-thirds">
<div class="grid-row">
<div class="column-one-half">
<h1 class="heading-large" style="margin-top: 0px; font-size: 1.05em; font-weight: bold;">
<span class="heading-secondary" style="font-size:1.05em">Mileage</span>
27,815
</h1>
</div>
<div class="column-one-half">
<h1 class="heading-large" style="margin-top: 0px; font-size: 1.05em; font-weight: bold;">
<span class="heading-secondary" style="font-size:1.05em">Expiry date</span>
27 May 2017
</h1>
</div>
<div class="column-one-half">
<h1 class="heading-large" style="margin-top: 0px; font-size: 1.05em; font-weight: bold;">
<span class="heading-secondary" style="font-size:1.05em">Test location</span>
Hopfields Auto Repairs<br>2-10 Raymouth Rd<br>London<br>SE16 2DB
</h1>
</div>
<div class="column-one-half">
<h1 class="heading-large" style="margin-top: 0px; font-size: 1.05em; font-weight: bold;">
<span class="heading-secondary" style="font-size:1.05em">MOT test number</span>
3766 9868 0212
</h1>
</div>
</div>
<h1 class="heading-large" style="margin-top: 0px; font-size: 1.05em; font-weight: bold;">
<span class="heading-secondary" style="font-size:1.05em">Advisory notice:</span>
<ul class="list list-bullet">
<li>Offside Front Track rod end ball joint has slight play (2.2.B.1f)</li>
<li>Rear spare wheel slight loose</li>
</ul>
</h1>
<div class="form-group">
<details>
<summary><span class="summary">What are these?</span></summary>
<div class="panel panel-border-narrow">
<p>
Advisory notices are minor problems with the vehicle. If they become more serious they could cause the vehicle to fail its next MOT test.</p>
<p>Failure items must be fixed before the vehicle can pass its MOT.</p>
<p>See <a href="">car parts checked at an MOT</a></p>
</p>
</div>
</details>
</div>
</div>
</div>
<!-- test end -->
<hr>
<!-- test start -->
<div class="grid-row">
<div class="column-third">
<h1 class="heading-large" style="margin-top: 0px; font-size: 1.05em; font-weight: bold;">
<span class="heading-secondary" style="font-size:1.05em">Date tested</span>
25 May 2016
</h1>
<h1 class="heading-large" style="margin-top: 0px; font-size: 3.5em; color: #B10E1E;">FAIL</h1>
</div>
<div class="column-two-thirds">
<div class="grid-row">
<div class="column-one-half">
<h1 class="heading-large" style="margin-top: 0px; font-size: 1.05em; font-weight: bold;">
<span class="heading-secondary" style="font-size:1.05em">Mileage</span>
27,809
</h1>
</div>
<div class="column-one-half">
<h1 class="heading-large" style="margin-top: 0px; font-size: 1.05em; font-weight: bold;">
<span class="heading-secondary" style="font-size:1.05em">MOT test number</span>
5286 7395 5109
</h1>
</div>
<div class="column-one-half">
<h1 class="heading-large" style="margin-top: 0px; font-size: 1.05em; font-weight: bold;">
<span class="heading-secondary" style="font-size:1.05em">Test location</span>
Hopfields Auto Repairs<br>2-10 Raymouth Rd<br>London<br>SE16 2DB
</h1>
</div>
</div>
<h1 class="heading-large" style="margin-top: 0px; font-size: 1.05em; font-weight: bold;">
<span class="heading-secondary" style="font-size:1.05em">Reasons for failure:</span>
<ul class="list list-bullet">
<li>Nearside Rear Stop lamp not working (1.2.1b)</li>
<li>Nearside Front Track rod end ball joint has excessive play (2.2.B.1f)</li>
</ul>
</h1>
<h1 class="heading-large" style="margin-top: 0px; font-size: 1.05em; font-weight: bold;">
<span class="heading-secondary" style="font-size:1.05em">Advisory notice:</span>
<ul class="list list-bullet">
<li>Offside Front Track rod end ball joint has slight play (2.2.B.1f)</li>
<li>Rear spare wheel slight loose</li>
</ul>
</h1>
<div class="form-group">
<details>
<summary><span class="summary">What are these?</span></summary>
<div class="panel panel-border-narrow">
<p>
Advisory notices are minor problems with the vehicle. If they become more serious they could cause the vehicle to fail its next MOT test.</p>
<p>Failure items must be fixed before the vehicle can pass its MOT.</p>
<p>See <a href="">car parts checked at an MOT</a></p>
</p>
</div>
</details>
</div>
</div>
</div>
<!-- test end -->
<hr>
<!-- test start -->
<div class="grid-row">
<div class="column-third">
<h1 class="heading-large" style="margin-top: 0px; font-size: 1.05em; font-weight: bold;">
<span class="heading-secondary" style="font-size:1.05em">Date tested</span>
12 May 2015
</h1>
<h1 class="heading-large" style="margin-top: 0px; font-size: 3.5em; color: #00823B;">PASS</h1>
</div>
<div class="column-two-thirds">
<div class="grid-row">
<div class="column-one-half">
<h1 class="heading-large" style="margin-top: 0px; font-size: 1.05em; font-weight: bold;">
<span class="heading-secondary" style="font-size:1.05em">Mileage</span>
21,394
</h1>
</div>
<div class="column-one-half">
<h1 class="heading-large" style="margin-top: 0px; font-size: 1.05em; font-weight: bold;">
<span class="heading-secondary" style="font-size:1.05em">Expiry date</span>
11 May 2016
</h1>
</div>
<div class="column-one-half">
<h1 class="heading-large" style="margin-top: 0px; font-size: 1.05em; font-weight: bold;">
<span class="heading-secondary" style="font-size:1.05em">Test location</span>
Caledonian Autos<br>21 Caledonian Rd<br>London<br>N7 0AB
</h1>
</div>
<div class="column-one-half">
<h1 class="heading-large" style="margin-top: 0px; font-size: 1.05em; font-weight: bold;">
<span class="heading-secondary" style="font-size:1.05em">MOT test number</span>
6053 6283 5134
</h1>
</div>
</div>
<h1 class="heading-large" style="margin-top: 0px; font-size: 1.05em; font-weight: bold;">
<span class="heading-secondary" style="font-size:1.05em">Advisory notice:</span>
<ul class="list list-bullet">
<li>Nearside Track rod end ball joint has slight play (2.2.B.1f)</li>
</ul>
</h1>
<div class="form-group">
<details>
<summary><span class="summary">What are these?</span></summary>
<div class="panel panel-border-narrow">
<p>
Advisory notices are minor problems with the vehicle. If they become more serious they could cause the vehicle to fail its next MOT test.</p>
<p>Failure items must be fixed before the vehicle can pass its MOT.</p>
<p>See <a href="">car parts checked at an MOT</a></p>
</p>
</div>
</details>
</div>
</div>
</div>
<!-- test end -->
<hr>
<!-- test start -->
<div class="grid-row">
<div class="column-third">
<h1 class="heading-large" style="margin-top: 0px; font-size: 1.05em; font-weight: bold;">
<span class="heading-secondary" style="font-size:1.05em">Date tested</span>
26 March 2014
</h1>
<h1 class="heading-large" style="margin-top: 0px; font-size: 3.5em; color: #00823B;">PASS</h1>
</div>
<div class="column-two-thirds">
<div class="grid-row">
<div class="column-one-half">
<h1 class="heading-large" style="margin-top: 0px; font-size: 1.05em; font-weight: bold;">
<span class="heading-secondary" style="font-size:1.05em">Mileage</span>
18,319
</h1>
</div>
<div class="column-one-half">
<h1 class="heading-large" style="margin-top: 0px; font-size: 1.05em; font-weight: bold;">
<span class="heading-secondary" style="font-size:1.05em">Expiry date</span>
10 April 2015
</h1>
</div>
<div class="column-one-half">
<h1 class="heading-large" style="margin-top: 0px; font-size: 1.05em; font-weight: bold;">
<span class="heading-secondary" style="font-size:1.05em">Test location</span>
Kwik Fit<br>136-142 New Kent Rd<br> London<br>SE1 6TU
</h1>
</div>
<div class="column-one-half">
<h1 class="heading-large" style="margin-top: 0px; font-size: 1.05em; font-weight: bold;">
<span class="heading-secondary" style="font-size:1.05em">MOT test number</span>
1050 7518 4032
</h1>
</div>
</div>
</div>
</div>
<!-- test end -->
<hr>
<!-- test start -->
<div class="grid-row">
<div class="column-third">
<h1 class="heading-large" style="margin-top: 0px; font-size: 1.05em; font-weight: bold;">
<span class="heading-secondary" style="font-size:1.05em">Date tested</span>
9 April 2013
</h1>
<h1 class="heading-large" style="margin-top: 0px; font-size: 3.5em; color: #00823B;">PASS</h1>
</div>
<div class="column-two-thirds">
<div class="grid-row">
<div class="column-one-half">
<h1 class="heading-large" style="margin-top: 0px; font-size: 1.05em; font-weight: bold;">
<span class="heading-secondary" style="font-size:1.05em">Mileage</span>
11,723
</h1>
</div>
<div class="column-one-half">
<h1 class="heading-large" style="margin-top: 0px; font-size: 1.05em; font-weight: bold;">
<span class="heading-secondary" style="font-size:1.05em">Expiry date</span>
10 April 2014
</h1>
</div>
<div class="column-one-half">
<h1 class="heading-large" style="margin-top: 0px; font-size: 1.05em; font-weight: bold;">
<span class="heading-secondary" style="font-size:1.05em">Test location</span>
Kwik Fit<br>387 Bethnal Green Rd<br>London<br> E2 0AN
</h1>
</div>
<div class="column-one-half">
<h1 class="heading-large" style="margin-top: 0px; font-size: 1.05em; font-weight: bold;">
<span class="heading-secondary" style="font-size:1.05em">MOT test number</span>
1479 2969 3048
</h1>
</div>
</div>
<h1 class="heading-large" style="margin-top: 0px; font-size: 1.05em; font-weight: bold;">
<span class="heading-secondary" style="font-size:1.05em">Advisory notice:</span>
<ul class="list list-bullet">
<li>Parking brake lever has little reserve travel (3.1.6b)</li>
<li>Items removed from driver's view prior to test</li>
</ul>
</h1>
<div class="form-group">
<details>
<summary><span class="summary">What are these?</span></summary>
<div class="panel panel-border-narrow">
<p>
Advisory notices are minor problems with the vehicle. If they become more serious they could cause the vehicle to fail its next MOT test.</p>
<p>Failure items must be fixed before the vehicle can pass its MOT.</p>
<p>See <a href="">car parts checked at an MOT</a></p>
</p>
</div>
</details>
</div>
</div>
</div>
<!-- test end -->
</main>
{% endblock %}
| {
"content_hash": "7f912cba9debfc222ea7ce10c4850099",
"timestamp": "",
"source": "github",
"line_count": 682,
"max_line_length": 149,
"avg_line_length": 28.13782991202346,
"alnum_prop": 0.572902553413236,
"repo_name": "chrisisk/dvsa-check-mot-history",
"id": "71dd3bfe8b7b185e5dc8a927a86c24622439036d",
"size": "19190",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "app/views/v2-1/result-4.html",
"mode": "33261",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "3944"
},
{
"name": "HTML",
"bytes": "168088"
},
{
"name": "JavaScript",
"bytes": "36314"
},
{
"name": "Shell",
"bytes": "1495"
}
],
"symlink_target": ""
} |
import * as T from './type-helpers';
import { createCustomAction } from './create-custom-action';
// @dts-jest:group toString() method return a type
{
const actionCreator = createCustomAction('CREATE_CUSTOM_ACTION');
// @dts-jest:pass:snap
actionCreator.toString(); // => 'CREATE_CUSTOM_ACTION'
}
// @dts-jest:group with symbol
{
const CREATE_CUSTOM_ACTION = Symbol(1);
const withSymbol = createCustomAction(CREATE_CUSTOM_ACTION as any);
// @dts-jest:pass:snap
withSymbol(); // => { type: CREATE_CUSTOM_ACTION }
}
// @dts-jest:group with type only
{
const withTypeOnly = createCustomAction('CREATE_CUSTOM_ACTION');
// @dts-jest:pass:snap
withTypeOnly(); // => { type: 'CREATE_CUSTOM_ACTION' }
}
// @dts-jest:group with payload
{
const withPayload = createCustomAction(
'CREATE_CUSTOM_ACTION',
(id: number) => ({ payload: id })
);
// @dts-jest:pass:snap
withPayload(1); // => { type: 'CREATE_CUSTOM_ACTION', payload: 1 }
}
// @dts-jest:group with optional payload
{
const withOptionalPayload = createCustomAction(
'CREATE_CUSTOM_ACTION',
(id?: number) => ({ payload: id })
);
// @dts-jest:pass:snap
withOptionalPayload(); // => { type: 'CREATE_CUSTOM_ACTION' }
// @dts-jest:pass:snap
withOptionalPayload(1); // => { type: 'CREATE_CUSTOM_ACTION', payload: 1 }
}
// @dts-jest:group with meta
{
const withMeta = createCustomAction(
'CREATE_CUSTOM_ACTION',
(token: string) => ({ meta: token })
);
// @dts-jest:pass:snap
withMeta('token'); // => { type: 'CREATE_CUSTOM_ACTION', meta: 'token' }
}
// @dts-jest:group with payload and meta
{
const withPayloadAndMeta = createCustomAction(
'CREATE_CUSTOM_ACTION',
(message: string, scope: string) => ({
payload: message,
meta: scope,
})
);
// @dts-jest:pass:snap
withPayloadAndMeta('Hello!', 'info'); // => { type: 'CREATE_CUSTOM_ACTION', payload: 'Hello!', meta: 'info' }
}
| {
"content_hash": "8ed5c39513f712792eceeb5e4630278e",
"timestamp": "",
"source": "github",
"line_count": 69,
"max_line_length": 111,
"avg_line_length": 27.91304347826087,
"alnum_prop": 0.6448598130841121,
"repo_name": "piotrwitek/typesafe-actions",
"id": "c1d5a9ac72214253773c59d8f6c2b4ddd37ff5b2",
"size": "1926",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/create-custom-action.spec.ts",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "440"
},
{
"name": "HTML",
"bytes": "1437"
},
{
"name": "JavaScript",
"bytes": "7216"
},
{
"name": "TypeScript",
"bytes": "205749"
}
],
"symlink_target": ""
} |
<?php
namespace ONGR\FilterManagerBundle\Filters\ViewData;
use ONGR\FilterManagerBundle\Filters\ViewData;
/**
* This class holds extra data for range and date_range filters.
*/
class RangeAwareViewData extends ViewData
{
/**
* @var float|\DateTime
*/
private $minBounds;
/**
* @var float|\DateTime
*/
private $maxBounds;
/**
* @return float|\DateTime
*/
public function getMaxBounds()
{
return $this->maxBounds;
}
/**
* @param float|\DateTime $maxBounds
*/
public function setMaxBounds($maxBounds)
{
$this->maxBounds = $maxBounds;
}
/**
* @return float|\DateTime
*/
public function getMinBounds()
{
return $this->minBounds;
}
/**
* @param float|\DateTime $minBounds
*/
public function setMinBounds($minBounds)
{
$this->minBounds = $minBounds;
}
/**
* {@inheritdoc}
*/
public function getSerializableData()
{
$data = parent::getSerializableData();
// TODO: handle \DateTime serialization
$data['min_bound'] = $this->minBounds;
$data['max_bound'] = $this->maxBounds;
return $data;
}
}
| {
"content_hash": "3b9c602a673ceade746e07fe2d93e8eb",
"timestamp": "",
"source": "github",
"line_count": 69,
"max_line_length": 64,
"avg_line_length": 17.91304347826087,
"alnum_prop": 0.5679611650485437,
"repo_name": "murnieza/FilterManagerBundle",
"id": "278dc437f85f7f855856dee13aeab80ae6f56d4e",
"size": "1460",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "Filters/ViewData/RangeAwareViewData.php",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "HTML",
"bytes": "951"
},
{
"name": "PHP",
"bytes": "258866"
}
],
"symlink_target": ""
} |
'use strict';
// MAIN //
// Define the bundle:
var BUNDLE = {
'name': 'bundle',
'standalone': 'stdlib_datasets_exclude',
'namespace': 'tree',
'raw': false,
'minified': true,
'include': [
// WARNING: this list is fragile, as we must manually update the list of what to include as the namespace changes.
// TODO: we should be able to programmatically generate this list by reading the `bundle.js` files in the various datasets bundle packages, deriving the list of datasets in those packages, and then taking the complement to arrive at this list
'@stdlib/datasets/afinn-111',
'@stdlib/datasets/afinn-96',
'@stdlib/datasets/anscombes-quartet',
'@stdlib/datasets/berndt-cps-wages-1985',
'@stdlib/datasets/cdc-nchs-us-births-1969-1988',
'@stdlib/datasets/cdc-nchs-us-births-1994-2003',
'@stdlib/datasets/cdc-nchs-us-infant-mortality-bw-1915-2013',
'@stdlib/datasets/dale-chall-new',
'@stdlib/datasets/female-first-names-en',
'@stdlib/datasets/frb-sf-wage-rigidity',
'@stdlib/datasets/harrison-boston-house-prices',
'@stdlib/datasets/harrison-boston-house-prices-corrected',
'@stdlib/datasets/herndon-venus-semidiameters',
'@stdlib/datasets/liu-negative-opinion-words-en',
'@stdlib/datasets/liu-positive-opinion-words-en',
'@stdlib/datasets/male-first-names-en',
'@stdlib/datasets/minard-napoleons-march',
'@stdlib/datasets/month-names-en',
'@stdlib/datasets/nightingales-rose',
'@stdlib/datasets/pace-boston-house-prices',
'@stdlib/datasets/savoy-stopwords-fin',
'@stdlib/datasets/savoy-stopwords-fr',
'@stdlib/datasets/savoy-stopwords-ger',
'@stdlib/datasets/savoy-stopwords-it',
'@stdlib/datasets/savoy-stopwords-por',
'@stdlib/datasets/savoy-stopwords-sp',
'@stdlib/datasets/savoy-stopwords-swe',
'@stdlib/datasets/spache-revised',
'@stdlib/datasets/ssa-us-births-2000-2014',
'@stdlib/datasets/standard-card-deck',
'@stdlib/datasets/stopwords-en',
'@stdlib/datasets/us-states-abbr',
'@stdlib/datasets/us-states-capitals',
'@stdlib/datasets/us-states-capitals-names',
'@stdlib/datasets/us-states-names',
'@stdlib/datasets/us-states-names-capitals'
]
};
// EXPORTS //
module.exports = BUNDLE;
| {
"content_hash": "63dc8c5c4b1ef0ceb042311374418aa4",
"timestamp": "",
"source": "github",
"line_count": 60,
"max_line_length": 244,
"avg_line_length": 36.35,
"alnum_prop": 0.7267308574048602,
"repo_name": "stdlib-js/stdlib",
"id": "cfb4d11e5a45a77b0a5a7dc3b1beb657a4ebd493",
"size": "2797",
"binary": false,
"copies": "1",
"ref": "refs/heads/develop",
"path": "dist/datasets-tree-exclude/bundle.js",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Awk",
"bytes": "21739"
},
{
"name": "C",
"bytes": "15336495"
},
{
"name": "C++",
"bytes": "1349482"
},
{
"name": "CSS",
"bytes": "58039"
},
{
"name": "Fortran",
"bytes": "198059"
},
{
"name": "HTML",
"bytes": "56181"
},
{
"name": "Handlebars",
"bytes": "16114"
},
{
"name": "JavaScript",
"bytes": "85975525"
},
{
"name": "Julia",
"bytes": "1508654"
},
{
"name": "Makefile",
"bytes": "4806816"
},
{
"name": "Python",
"bytes": "3343697"
},
{
"name": "R",
"bytes": "576612"
},
{
"name": "Shell",
"bytes": "559315"
},
{
"name": "TypeScript",
"bytes": "19309407"
},
{
"name": "WebAssembly",
"bytes": "5980"
}
],
"symlink_target": ""
} |
using System;
using UnityEngine;
using Zenject;
namespace Zenject.SpaceFighter
{
public enum BulletTypes
{
FromEnemy,
FromPlayer,
}
public class Bullet : MonoBehaviour
{
float _startTime;
BulletTypes _type;
float _speed;
float _lifeTime;
[SerializeField]
MeshRenderer _renderer = null;
[SerializeField]
Material _playerMaterial = null;
[SerializeField]
Material _enemyMaterial = null;
// Since we are a MonoBehaviour, we can't use a constructor
// So use PostInject instead
[PostInject]
public void Construct(float speed, float lifeTime, BulletTypes type)
{
_type = type;
_speed = speed;
_lifeTime = lifeTime;
_renderer.material = type == BulletTypes.FromEnemy ? _enemyMaterial : _playerMaterial;
_startTime = Time.realtimeSinceStartup;
}
public BulletTypes Type
{
get
{
return _type;
}
}
public Vector3 MoveDirection
{
get
{
return transform.right;
}
}
public void Update()
{
transform.position -= transform.right * _speed * Time.deltaTime;
if (Time.realtimeSinceStartup - _startTime > _lifeTime)
{
GameObject.Destroy(this.gameObject);
}
}
public class Factory : Factory<float, float, BulletTypes, Bullet>
{
}
}
}
| {
"content_hash": "85b7839740aab03310cf82e63d3c0671",
"timestamp": "",
"source": "github",
"line_count": 73,
"max_line_length": 98,
"avg_line_length": 22.205479452054796,
"alnum_prop": 0.5231338679827268,
"repo_name": "matt123miller/Grid-System",
"id": "fa7d92013b9f137d8f6dd5d4a756d7d6205a8739",
"size": "1623",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "Assets/Zenject/OptionalExtras/SampleGame2 (Advanced)/Scripts/Misc/Bullet.cs",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C#",
"bytes": "742235"
},
{
"name": "ShaderLab",
"bytes": "5305"
}
],
"symlink_target": ""
} |
#ifndef SPAWNINGVEHICLESRUNNABLE_H
#define SPAWNINGVEHICLESRUNNABLE_H
class Simulator;
#include "Types.h"
#include <QtCore>
#include <QRunnable>
#include <vector>
/**
* @brief
* Klasa obsługujaca powstawanie pojazdów na planszy w odpowiednich punktach Spawn
*/
class SpawningVehiclesRunnable : public QRunnable {
std::vector<PMapElement> spawns;
Simulator* simulator;
volatile bool go;
public:
/// Konstruktor.
SpawningVehiclesRunnable(std::vector<PMapElement>, Simulator*);
/// @overload przeciążona metoda run
void run();
/// Metoda służąca do zatrzymywania wątku.
void stopThread();
};
#endif // SPAWNINGVEHICLESRUNNABLE_H
| {
"content_hash": "6ab04ef528f78dae5d557b3a367af501",
"timestamp": "",
"source": "github",
"line_count": 30,
"max_line_length": 82,
"avg_line_length": 22.366666666666667,
"alnum_prop": 0.7302533532041728,
"repo_name": "mbychawski/traffic-simulator",
"id": "6a7fb400bfaa114d3594ccb575a9d74f4168af21",
"size": "679",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "src/SpawningVehiclesRunnable.h",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "C",
"bytes": "2028"
},
{
"name": "C++",
"bytes": "116749"
},
{
"name": "CSS",
"bytes": "7616"
},
{
"name": "HTML",
"bytes": "35945"
},
{
"name": "Python",
"bytes": "251420"
},
{
"name": "QMake",
"bytes": "1753"
},
{
"name": "XSLT",
"bytes": "8010"
}
],
"symlink_target": ""
} |
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Version 4.4.0.0 www.ComponentFactory.com
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace SinglelinePlusMultiline.Properties {
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "10.0.0.0")]
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
public static Settings Default {
get {
return defaultInstance;
}
}
}
}
| {
"content_hash": "b31a0516e805d1b488fa8e9c91bab22d",
"timestamp": "",
"source": "github",
"line_count": 26,
"max_line_length": 151,
"avg_line_length": 41.73076923076923,
"alnum_prop": 0.5889400921658986,
"repo_name": "Cocotteseb/Krypton",
"id": "5f0196e9d4ac9e72b05509d38f600ac139efe8ff",
"size": "1087",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "Source/Krypton Navigator Examples/Singleline + Multiline/Properties/Settings.Designer.cs",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "C#",
"bytes": "20059021"
}
],
"symlink_target": ""
} |
{{ "<!-- ENTERING partial socialsharing.html -->" | safeHTML }}
<div class="social-sharing socialicons h3 p2 bg-darken-1">
Please share this post:
<span class="r-Tooltip r-Tooltip--top r-Tooltip--nowrap" data-r-tooltip="Tweet this on Twitter">
<a onClick="return popupShare(this.href);" href="http://twitter.com/share?text={{ .Title }}&url={{ .Permalink }}" class="btn btn-narrow btn-primary px1 sans light bg-darken-1" target="_blank">
<svg><use xlink:href="/img/symbol-defs.svg#icon-twitter" /></svg>
</a>
</span>
<span class="r-Tooltip r-Tooltip--top r-Tooltip--nowrap" data-r-tooltip="+1 this on Google Plus">
<a onClick="return popupShare(this.href);" href="https://plus.google.com/share?url={{ .Permalink }}" class="btn btn-narrow btn-primary px1 sans light bg-darken-1" target="_blank">
<svg><use xlink:href="/img/symbol-defs.svg#icon-google-plus2" /></svg>
</a>
</span>
<span class="r-Tooltip r-Tooltip--top r-Tooltip--nowrap" data-r-tooltip="Like this on Facebook">
<a onClick="return popupShare(this.href);" href="https://www.facebook.com/sharer/sharer.php?u={{ .Permalink }}" class="btn btn-narrow btn-primary px1 sans light bg-darken-1" target="_blank">
<svg><use xlink:href="/img/symbol-defs.svg#icon-facebook2" /></svg>
</a>
</span>
<span class="r-Tooltip r-Tooltip--top r-Tooltip--nowrap" data-r-tooltip="Share this on LinkedIn">
<a onClick="return popupShare(this.href);" href="http://www.linkedin.com/shareArticle?mini=true&url={{ .Permalink }}&title={{ .Title }}&summary={{ .Summary }}}&source={{ .Site.Title }}" class="btn btn-narrow btn-primary px1 sans light bg-darken-1" target="_blank">
<svg><use xlink:href="/img/symbol-defs.svg#icon-linkedin" /></svg>
</a>
</span>
</div>
{{ "<!-- LEAVING partial socialsharing.html -->" | safeHTML }}
| {
"content_hash": "3b756dcd7cf46441c95db0f340d2864a",
"timestamp": "",
"source": "github",
"line_count": 25,
"max_line_length": 266,
"avg_line_length": 71.88,
"alnum_prop": 0.6839176405119644,
"repo_name": "RickCogley/RCC-Hugo2015",
"id": "ff2d43c7adacc1ef7a5b923d5578bc5be322c54b",
"size": "1797",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "layouts/partials/socialsharing.html",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "190635"
},
{
"name": "HTML",
"bytes": "463291"
},
{
"name": "JavaScript",
"bytes": "185746"
}
],
"symlink_target": ""
} |
using System;
public interface IExecutionScope : IDisposable
#if NATIVE_ASYNC
, IAsyncDisposable
#endif
{
}
| {
"content_hash": "dba4eb24c8b66c72fb0856faf979ff42",
"timestamp": "",
"source": "github",
"line_count": 8,
"max_line_length": 46,
"avg_line_length": 13.875,
"alnum_prop": 0.7747747747747747,
"repo_name": "linq2db/linq2db",
"id": "8fe6042321283fe54eb99b53ef62ef9ba0ca4fb8",
"size": "113",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "Source/LinqToDB/DataProvider/IExecutionScope.cs",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Batchfile",
"bytes": "29203"
},
{
"name": "C#",
"bytes": "18569855"
},
{
"name": "F#",
"bytes": "15865"
},
{
"name": "PLSQL",
"bytes": "29278"
},
{
"name": "PLpgSQL",
"bytes": "15809"
},
{
"name": "PowerShell",
"bytes": "5130"
},
{
"name": "SQLPL",
"bytes": "10530"
},
{
"name": "Shell",
"bytes": "29373"
},
{
"name": "Smalltalk",
"bytes": "11"
},
{
"name": "TSQL",
"bytes": "104099"
},
{
"name": "Visual Basic .NET",
"bytes": "3871"
}
],
"symlink_target": ""
} |
package net.sf.jabref.gui.autocompleter;
import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.FocusAdapter;
import java.awt.event.FocusEvent;
import java.awt.event.KeyEvent;
import java.util.List;
import javax.swing.AbstractAction;
import javax.swing.BorderFactory;
import javax.swing.JComponent;
import javax.swing.JPopupMenu;
import javax.swing.KeyStroke;
import javax.swing.event.DocumentEvent;
import javax.swing.event.DocumentListener;
import javax.swing.event.PopupMenuEvent;
import javax.swing.event.PopupMenuListener;
import javax.swing.text.JTextComponent;
import net.sf.jabref.logic.autocompleter.AutoCompleter;
/**
* Endows a textbox with the ability to autocomplete the input. Based on code by Santhosh Kumar
* (http://www.jroller.com/santhosh/date/20050620) James Lemieux (Glazed Lists AutoCompleteSupport)
*
* @param <E> type of items displayed in the autocomplete popup
*/
public class AutoCompleteSupport<E> {
private final AutoCompleteRenderer<E> renderer;
private AutoCompleter<E> autoCompleter;
private final JTextComponent textComp;
private final JPopupMenu popup = new JPopupMenu();
private boolean selectsTextOnFocusGain = true;
/**
* Constructs a new AutoCompleteSupport for the textbox using the autocompleter and a renderer.
*
* @param textComp the textbox component for which autocompletion should be enabled
* @param autoCompleter the autocompleter providing the data
* @param renderer the renderer displaying the popup
*/
public AutoCompleteSupport(JTextComponent textComp, AutoCompleter<E> autoCompleter,
AutoCompleteRenderer<E> renderer) {
this.renderer = renderer;
this.textComp = textComp;
this.autoCompleter = autoCompleter;
}
/**
* Constructs a new AutoCompleteSupport for the textbox. The possible autocomplete items are displayed as a simple
* list. The autocompletion items are provided by an AutoCompleter which has to be specified later using
* {@link setAutoCompleter}.
*
* @param textComp the textbox component for which autocompletion should be enabled
*/
public AutoCompleteSupport(JTextComponent textComp) {
this(textComp, null, new ListAutoCompleteRenderer<>());
}
/**
* Constructs a new AutoCompleteSupport for the textbox using the autocompleter and a renderer. The possible
* autocomplete items are displayed as a simple list.
*
* @param textComp the textbox component for which autocompletion should be enabled
* @param autoCompleter the autocompleter providing the data
*/
public AutoCompleteSupport(JTextComponent textComp, AutoCompleter<E> autoCompleter) {
this(textComp, autoCompleter, new ListAutoCompleteRenderer<>());
}
/**
* Inits the autocompletion popup. After this method is called, further input in the specified textbox will be
* autocompleted.
*/
public void install() {
// ActionListeners for navigating the suggested autocomplete items with the arrow keys
final ActionListener upAction = new MoveAction(-1);
final ActionListener downAction = new MoveAction(1);
// ActionListener hiding the autocomplete popup
final ActionListener hidePopupAction = e -> popup.setVisible(false);
// ActionListener accepting the currently selected item as the autocompletion
final ActionListener acceptAction = e -> {
E itemToInsert = renderer.getSelectedItem();
if (itemToInsert == null) {
return;
}
String toInsert = autoCompleter.getAutoCompleteText(itemToInsert);
// TODO: The following should be refactored. For example, the autocompleter shouldn't know whether we want to complete one word or multiple.
// In most fields, we are only interested in the currently edited word, so we
// seek from the caret backward to the closest space:
if (!autoCompleter.isSingleUnitField()) {
// Get position of last word separator (whitespace or comma)
int priv = textComp.getText().length() - 1;
while ((priv >= 0) && !Character.isWhitespace(textComp.getText().charAt(priv))
&& (textComp.getText().charAt(priv) != ',')) {
priv--;
}
// priv points to whitespace char or priv is -1
// copy everything from the next char up to the end of "upToCaret"
textComp.setText(textComp.getText().substring(0, priv + 1) + toInsert);
} else {
// For fields such as "journal" it is more reasonable to try to complete on the entire
// text field content, so we skip the searching and keep the entire part up to the caret:
textComp.setText(toInsert);
}
textComp.setCaretPosition(textComp.getText().length());
popup.setVisible(false);
};
// Create popup
popup.setBorder(BorderFactory.createMatteBorder(1, 1, 1, 1, Color.LIGHT_GRAY));
popup.setPopupSize(textComp.getWidth(), 200);
popup.setLayout(new BorderLayout());
popup.setFocusable(false);
popup.setRequestFocusEnabled(false);
popup.add(renderer.init(acceptAction));
// Listen for changes to the text -> update autocomplete suggestions
textComp.getDocument().addDocumentListener(new DocumentListener() {
@Override
public void insertUpdate(DocumentEvent e) {
postProcessTextChange();
}
@Override
public void removeUpdate(DocumentEvent e) {
postProcessTextChange();
}
@Override
public void changedUpdate(DocumentEvent e) {
// Do nothing
}
});
// Listen for up/down arrow keys -> move currently selected item up or down
// We have to reimplement this function here since we cannot be sure that a simple list will be used to display the items
// So better let the renderer decide what to do.
// (Moreover, the list does not have the focus so probably would not recognize the keystrokes in the first place.)
textComp.registerKeyboardAction(downAction, KeyStroke.getKeyStroke(KeyEvent.VK_DOWN, 0),
JComponent.WHEN_FOCUSED);
textComp.registerKeyboardAction(upAction, KeyStroke.getKeyStroke(KeyEvent.VK_UP, 0), JComponent.WHEN_FOCUSED);
// Listen for ESC key -> hide popup
textComp.registerKeyboardAction(hidePopupAction, KeyStroke.getKeyStroke(KeyEvent.VK_ESCAPE, 0),
JComponent.WHEN_IN_FOCUSED_WINDOW);
// Listen to focus events -> select all the text on gaining the focus
this.textComp.addFocusListener(new ComboBoxEditorFocusHandler());
// Listen for ENTER key if popup is visible -> accept current autocomplete suggestion
popup.addPopupMenuListener(new PopupMenuListener() {
@Override
public void popupMenuWillBecomeVisible(PopupMenuEvent e) {
textComp.registerKeyboardAction(acceptAction, KeyStroke.getKeyStroke(KeyEvent.VK_ENTER, 0),
JComponent.WHEN_FOCUSED);
}
@Override
public void popupMenuWillBecomeInvisible(PopupMenuEvent e) {
textComp.unregisterKeyboardAction(KeyStroke.getKeyStroke(KeyEvent.VK_ENTER, 0));
}
@Override
public void popupMenuCanceled(PopupMenuEvent e) {
// Do nothing
}
});
}
/**
* Returns whether the text in the textbox is selected when the textbox gains focus. Defaults to true.
*
* @return
*/
public boolean isSelectsTextOnFocusGain() {
return selectsTextOnFocusGain;
}
/**
* Sets whether the text in the textbox is selected when the textbox gains focus. Default is true.
*
* @param selectsTextOnFocusGain new value
*/
public void setSelectsTextOnFocusGain(boolean selectsTextOnFocusGain) {
this.selectsTextOnFocusGain = selectsTextOnFocusGain;
}
/**
* The text changed so update autocomplete suggestions accordingly.
*/
private void postProcessTextChange() {
if (autoCompleter == null) {
popup.setVisible(false);
return;
}
String text = textComp.getText();
List<E> candidates = autoCompleter.complete(text);
renderer.update(candidates);
if (textComp.isEnabled() && (!candidates.isEmpty())) {
renderer.selectItem(0);
popup.setPopupSize(textComp.getWidth(), 200);
popup.show(textComp, 0, textComp.getHeight());
} else {
popup.setVisible(false);
}
if (!textComp.hasFocus()) {
textComp.requestFocusInWindow();
}
}
/**
* The action invoked by hitting the up or down arrow key. If the popup is currently shown, that the action is
* relayed to it. Otherwise the arrow keys trigger the popup.
*/
private class MoveAction extends AbstractAction {
private final int offset;
public MoveAction(int offset) {
this.offset = offset;
}
@Override
public void actionPerformed(ActionEvent e) {
if (popup.isVisible()) {
renderer.selectItemRelative(offset);
} else {
popup.show(textComp, 0, textComp.getHeight());
}
}
}
/**
* Selects all text when the textbox gains focus. The behavior is controlled by the value returned from
* {@link AutoCompleteSupport#isSelectsTextOnFocusGain()}.
*/
private class ComboBoxEditorFocusHandler extends FocusAdapter {
@Override
public void focusGained(FocusEvent e) {
if (isSelectsTextOnFocusGain() && !e.isTemporary()) {
textComp.selectAll();
}
}
@Override
public void focusLost(FocusEvent e) {
// Do nothing
}
}
/**
* Sets the autocompleter used to present autocomplete suggestions.
*
* @param autoCompleter the autocompleter providing the data
*/
public void setAutoCompleter(AutoCompleter<E> autoCompleter) {
this.autoCompleter = autoCompleter;
}
public void setVisible(boolean visible){
popup.setVisible(visible);
}
public boolean isVisible() {
return popup.isVisible();
}
}
| {
"content_hash": "b2062577ae6eed6d8adf744ff74bc423",
"timestamp": "",
"source": "github",
"line_count": 291,
"max_line_length": 152,
"avg_line_length": 37,
"alnum_prop": 0.6503204235162998,
"repo_name": "mredaelli/jabref",
"id": "59e941578c0aefd44673ab1a1860549bd04df09b",
"size": "10767",
"binary": false,
"copies": "6",
"ref": "refs/heads/fulltext-search",
"path": "src/main/java/net/sf/jabref/gui/autocompleter/AutoCompleteSupport.java",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "ANTLR",
"bytes": "1751"
},
{
"name": "GAP",
"bytes": "1492"
},
{
"name": "Java",
"bytes": "5980639"
},
{
"name": "Perl",
"bytes": "9622"
},
{
"name": "Python",
"bytes": "17912"
},
{
"name": "Ruby",
"bytes": "1115"
},
{
"name": "Shell",
"bytes": "4075"
},
{
"name": "TeX",
"bytes": "302803"
},
{
"name": "XSLT",
"bytes": "2185"
}
],
"symlink_target": ""
} |
mutable struct Review <: GitHubType
pr::Union{PullRequest, Nothing}
id::Union{Int, Nothing}
user::Union{Owner, Nothing}
body::Union{String, Nothing}
state::Union{String, Nothing}
end
function Review(pr::PullRequest, data::Dict)
rev = json2github(Review, data)
rev.pr = pr
rev
end
namefield(rev::Review) = rev.id
@api_default function reviews(api::GitHubAPI, repo, pr::PullRequest; options...)
path = "/repos/$(name(repo))/pulls/$(name(pr))/reviews"
results, page_data = gh_get_paged_json(api, path; options...)
return map(x->Review(pr, x), results), page_data
end
@api_default function comments(api::GitHubAPI, repo, rev::Review; options...)
path = "/repos/$(name(repo))/pulls/$(name(rev.pr))/reviews/$(name(rev))/comments"
results, page_data = gh_get_paged_json(api, path; options...)
return map(Comment, results), page_data
end
@api_default function reply_to(api::GitHubAPI, repo, r::Review, c::Comment, body; options...)
create_comment(api, repo, r.pr, :review; params = Dict(
:body => body,
:in_reply_to => c.id
), options...)
end
@api_default function dismiss_review(api::GitHubAPI, repo::Repo, r::Review; options...)
gh_put(api, "/repos/$(name(repo))/pulls/$(name(rev.pr))/reviews/$(name(rev))/dismissals")
end
| {
"content_hash": "6d6864bc60bbfce429e0d446fb22b4df",
"timestamp": "",
"source": "github",
"line_count": 38,
"max_line_length": 93,
"avg_line_length": 34.39473684210526,
"alnum_prop": 0.6595256312165264,
"repo_name": "WestleyArgentum/GitHub.jl",
"id": "c39c8e92b290bd9a019e225e3f7b662e3ef4e243",
"size": "1307",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/issues/reviews.jl",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Julia",
"bytes": "57232"
}
],
"symlink_target": ""
} |
package org.wso2.siddhi.query.api.execution.query.output.stream;
public abstract class OutputStream {
public enum OutputEventType {
EXPIRED_EVENTS, CURRENT_EVENTS, ALL_EVENTS, ALL_RAW_EVENTS, EXPIRED_RAW_EVENTS
}
protected String id;
protected OutputEventType outputEventType;
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public OutputEventType getOutputEventType() {
return outputEventType;
}
public void setOutputEventType(OutputEventType outputEventType) {
this.outputEventType = outputEventType;
}
@Override
public String toString() {
return "OutputStream{" +
"outputEventType=" + outputEventType +
", id='" + id + '\'' +
'}';
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (!(o instanceof OutputStream)) return false;
OutputStream that = (OutputStream) o;
if (outputEventType != that.outputEventType) return false;
if (id != null ? !id.equals(that.id) : that.id != null) return false;
return true;
}
@Override
public int hashCode() {
int result = outputEventType != null ? outputEventType.hashCode() : 0;
result = 31 * result + (id != null ? id.hashCode() : 0);
return result;
}
}
| {
"content_hash": "e8b44efb1e3454b0e7d0aaececa7d05e",
"timestamp": "",
"source": "github",
"line_count": 56,
"max_line_length": 86,
"avg_line_length": 25.375,
"alnum_prop": 0.6002814919071077,
"repo_name": "keizer619/siddhi",
"id": "4c939532957aa3a5f6b01f6b456e39564655b2c9",
"size": "2061",
"binary": false,
"copies": "4",
"ref": "refs/heads/master",
"path": "modules/siddhi-query-api/src/main/java/org/wso2/siddhi/query/api/execution/query/output/stream/OutputStream.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "ANTLR",
"bytes": "15263"
},
{
"name": "Java",
"bytes": "3533816"
},
{
"name": "Scala",
"bytes": "923"
}
],
"symlink_target": ""
} |
#include "../../Precompiled.h"
#include "../../Graphics/Camera.h"
#include "../../Graphics/Graphics.h"
#include "../../Graphics/GraphicsImpl.h"
#include "../../Graphics/Renderer.h"
#include "../../Graphics/RenderSurface.h"
#include "../../Graphics/Texture.h"
#include "../../DebugNew.h"
namespace Atomic
{
RenderSurface::RenderSurface(Texture* parentTexture) :
parentTexture_(parentTexture),
surface_(0),
updateMode_(SURFACE_UPDATEVISIBLE),
updateQueued_(false)
{
}
RenderSurface::~RenderSurface()
{
Release();
}
void RenderSurface::SetNumViewports(unsigned num)
{
viewports_.Resize(num);
}
void RenderSurface::SetViewport(unsigned index, Viewport* viewport)
{
if (index >= viewports_.Size())
viewports_.Resize(index + 1);
viewports_[index] = viewport;
}
void RenderSurface::SetUpdateMode(RenderSurfaceUpdateMode mode)
{
updateMode_ = mode;
}
void RenderSurface::SetLinkedRenderTarget(RenderSurface* renderTarget)
{
if (renderTarget != this)
linkedRenderTarget_ = renderTarget;
}
void RenderSurface::SetLinkedDepthStencil(RenderSurface* depthStencil)
{
if (depthStencil != this)
linkedDepthStencil_ = depthStencil;
}
void RenderSurface::QueueUpdate()
{
if (!updateQueued_)
{
bool hasValidView = false;
// Verify that there is at least 1 non-null viewport, as otherwise Renderer will not accept the surface and the update flag
// will be left on
for (unsigned i = 0; i < viewports_.Size(); ++i)
{
if (viewports_[i])
{
hasValidView = true;
break;
}
}
if (hasValidView)
{
Renderer* renderer = parentTexture_->GetSubsystem<Renderer>();
if (renderer)
renderer->QueueRenderSurface(this);
updateQueued_ = true;
}
}
}
void RenderSurface::Release()
{
Graphics* graphics = parentTexture_->GetGraphics();
if (!graphics)
return;
if (surface_)
{
for (unsigned i = 0; i < MAX_RENDERTARGETS; ++i)
{
if (graphics->GetRenderTarget(i) == this)
graphics->ResetRenderTarget(i);
}
if (graphics->GetDepthStencil() == this)
graphics->ResetDepthStencil();
((IDirect3DSurface9*)surface_)->Release();
surface_ = 0;
}
}
int RenderSurface::GetWidth() const
{
return parentTexture_->GetWidth();
}
int RenderSurface::GetHeight() const
{
return parentTexture_->GetHeight();
}
TextureUsage RenderSurface::GetUsage() const
{
return parentTexture_->GetUsage();
}
Viewport* RenderSurface::GetViewport(unsigned index) const
{
return index < viewports_.Size() ? viewports_[index] : (Viewport*)0;
}
void RenderSurface::WasUpdated()
{
updateQueued_ = false;
}
}
| {
"content_hash": "7df0f1bd72fae13d710ee39bf7fa0a17",
"timestamp": "",
"source": "github",
"line_count": 134,
"max_line_length": 131,
"avg_line_length": 22.32089552238806,
"alnum_prop": 0.5937813440320963,
"repo_name": "rsredsq/AtomicGameEngine",
"id": "276af40e23dc53b3aa4f62d4ca6f829a87080185",
"size": "4140",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "Source/Atomic/Graphics/Direct3D9/D3D9RenderSurface.cpp",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Assembly",
"bytes": "96044"
},
{
"name": "Batchfile",
"bytes": "53136"
},
{
"name": "C",
"bytes": "47231561"
},
{
"name": "C#",
"bytes": "155477"
},
{
"name": "C++",
"bytes": "29838729"
},
{
"name": "CMake",
"bytes": "356497"
},
{
"name": "DIGITAL Command Language",
"bytes": "312789"
},
{
"name": "Emacs Lisp",
"bytes": "1639"
},
{
"name": "GLSL",
"bytes": "109885"
},
{
"name": "Groff",
"bytes": "5"
},
{
"name": "HTML",
"bytes": "14807"
},
{
"name": "Java",
"bytes": "41271"
},
{
"name": "JavaScript",
"bytes": "1853804"
},
{
"name": "Makefile",
"bytes": "735141"
},
{
"name": "NSIS",
"bytes": "4282"
},
{
"name": "Objective-C",
"bytes": "379639"
},
{
"name": "Objective-C++",
"bytes": "25917"
},
{
"name": "Perl",
"bytes": "2260409"
},
{
"name": "Perl6",
"bytes": "27602"
},
{
"name": "Prolog",
"bytes": "42455"
},
{
"name": "Protocol Buffer",
"bytes": "2764"
},
{
"name": "Python",
"bytes": "1974"
},
{
"name": "QMake",
"bytes": "1782"
},
{
"name": "Scheme",
"bytes": "4249"
},
{
"name": "Shell",
"bytes": "139025"
},
{
"name": "TypeScript",
"bytes": "313212"
},
{
"name": "XS",
"bytes": "4319"
},
{
"name": "eC",
"bytes": "5127"
}
],
"symlink_target": ""
} |
parse-js
========
Custom patches and updates to make Parse's JS SDK more robust for usage.
ShoppinPal is not affliated/associated/partnered with Parse. We are just a customer who subscribes to their service. At times, we find it easier to patch their latest source-code for the javascript client sdk by ourselves rather than wait.
The following header from Parse outlines the license/attributions and version we are working on top of to add patches and updates:
```
```
If you have any valid legal problems/concerns/issues with this existance of this project or its licencing/language, please reach out to founders@shoppinpal.com first ... before filing a law suit ... and let us know what's going on from your perspective.
| {
"content_hash": "f3f2fbb2cacd75fb8eeb3dd048393b7a",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 253,
"avg_line_length": 56.07692307692308,
"alnum_prop": 0.7818930041152263,
"repo_name": "ShoppinPal/parse-js",
"id": "058fcfdb481d1c4313b0d1694c959153688bd250",
"size": "1066",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "README.md",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "JavaScript",
"bytes": "594156"
}
],
"symlink_target": ""
} |
// Copyright 2012 the V8 project authors. All rights reserved.
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
// * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following
// disclaimer in the documentation and/or other materials provided
// with the distribution.
// * Neither the name of Google Inc. nor the names of its
// contributors may be used to endorse or promote products derived
// from this software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER 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.
#include <stdlib.h>
#include <wchar.h>
#include "src/v8.h"
#include "src/compiler.h"
#include "src/disasm.h"
#include "src/parser.h"
#include "test/cctest/cctest.h"
using namespace v8::internal;
static Handle<Object> GetGlobalProperty(const char* name) {
Isolate* isolate = CcTest::i_isolate();
return Object::GetProperty(
isolate, isolate->global_object(), name).ToHandleChecked();
}
static void SetGlobalProperty(const char* name, Object* value) {
Isolate* isolate = CcTest::i_isolate();
Handle<Object> object(value, isolate);
Handle<String> internalized_name =
isolate->factory()->InternalizeUtf8String(name);
Handle<JSObject> global(isolate->context()->global_object());
Runtime::SetObjectProperty(isolate, global, internalized_name, object,
SLOPPY).Check();
}
static Handle<JSFunction> Compile(const char* source) {
Isolate* isolate = CcTest::i_isolate();
Handle<String> source_code = isolate->factory()->NewStringFromUtf8(
CStrVector(source)).ToHandleChecked();
Handle<SharedFunctionInfo> shared_function = Compiler::CompileScript(
source_code, Handle<String>(), 0, 0, v8::ScriptOriginOptions(),
Handle<Object>(), Handle<Context>(isolate->native_context()), NULL, NULL,
v8::ScriptCompiler::kNoCompileOptions, NOT_NATIVES_CODE, false);
return isolate->factory()->NewFunctionFromSharedFunctionInfo(
shared_function, isolate->native_context());
}
static double Inc(Isolate* isolate, int x) {
const char* source = "result = %d + 1;";
EmbeddedVector<char, 512> buffer;
SNPrintF(buffer, source, x);
Handle<JSFunction> fun = Compile(buffer.start());
if (fun.is_null()) return -1;
Handle<JSObject> global(isolate->context()->global_object());
Execution::Call(isolate, fun, global, 0, NULL).Check();
return GetGlobalProperty("result")->Number();
}
TEST(Inc) {
CcTest::InitializeVM();
v8::HandleScope scope(CcTest::isolate());
CHECK_EQ(4.0, Inc(CcTest::i_isolate(), 3));
}
static double Add(Isolate* isolate, int x, int y) {
Handle<JSFunction> fun = Compile("result = x + y;");
if (fun.is_null()) return -1;
SetGlobalProperty("x", Smi::FromInt(x));
SetGlobalProperty("y", Smi::FromInt(y));
Handle<JSObject> global(isolate->context()->global_object());
Execution::Call(isolate, fun, global, 0, NULL).Check();
return GetGlobalProperty("result")->Number();
}
TEST(Add) {
CcTest::InitializeVM();
v8::HandleScope scope(CcTest::isolate());
CHECK_EQ(5.0, Add(CcTest::i_isolate(), 2, 3));
}
static double Abs(Isolate* isolate, int x) {
Handle<JSFunction> fun = Compile("if (x < 0) result = -x; else result = x;");
if (fun.is_null()) return -1;
SetGlobalProperty("x", Smi::FromInt(x));
Handle<JSObject> global(isolate->context()->global_object());
Execution::Call(isolate, fun, global, 0, NULL).Check();
return GetGlobalProperty("result")->Number();
}
TEST(Abs) {
CcTest::InitializeVM();
v8::HandleScope scope(CcTest::isolate());
CHECK_EQ(3.0, Abs(CcTest::i_isolate(), -3));
}
static double Sum(Isolate* isolate, int n) {
Handle<JSFunction> fun =
Compile("s = 0; while (n > 0) { s += n; n -= 1; }; result = s;");
if (fun.is_null()) return -1;
SetGlobalProperty("n", Smi::FromInt(n));
Handle<JSObject> global(isolate->context()->global_object());
Execution::Call(isolate, fun, global, 0, NULL).Check();
return GetGlobalProperty("result")->Number();
}
TEST(Sum) {
CcTest::InitializeVM();
v8::HandleScope scope(CcTest::isolate());
CHECK_EQ(5050.0, Sum(CcTest::i_isolate(), 100));
}
TEST(Print) {
v8::HandleScope scope(CcTest::isolate());
v8::Local<v8::Context> context = CcTest::NewContext(PRINT_EXTENSION);
v8::Context::Scope context_scope(context);
const char* source = "for (n = 0; n < 100; ++n) print(n, 1, 2);";
Handle<JSFunction> fun = Compile(source);
if (fun.is_null()) return;
Handle<JSObject> global(CcTest::i_isolate()->context()->global_object());
Execution::Call(CcTest::i_isolate(), fun, global, 0, NULL).Check();
}
// The following test method stems from my coding efforts today. It
// tests all the functionality I have added to the compiler today
TEST(Stuff) {
CcTest::InitializeVM();
v8::HandleScope scope(CcTest::isolate());
const char* source =
"r = 0;\n"
"a = new Object;\n"
"if (a == a) r+=1;\n" // 1
"if (a != new Object()) r+=2;\n" // 2
"a.x = 42;\n"
"if (a.x == 42) r+=4;\n" // 4
"function foo() { var x = 87; return x; }\n"
"if (foo() == 87) r+=8;\n" // 8
"function bar() { var x; x = 99; return x; }\n"
"if (bar() == 99) r+=16;\n" // 16
"function baz() { var x = 1, y, z = 2; y = 3; return x + y + z; }\n"
"if (baz() == 6) r+=32;\n" // 32
"function Cons0() { this.x = 42; this.y = 87; }\n"
"if (new Cons0().x == 42) r+=64;\n" // 64
"if (new Cons0().y == 87) r+=128;\n" // 128
"function Cons2(x, y) { this.sum = x + y; }\n"
"if (new Cons2(3,4).sum == 7) r+=256;"; // 256
Handle<JSFunction> fun = Compile(source);
CHECK(!fun.is_null());
Handle<JSObject> global(CcTest::i_isolate()->context()->global_object());
Execution::Call(
CcTest::i_isolate(), fun, global, 0, NULL).Check();
CHECK_EQ(511.0, GetGlobalProperty("r")->Number());
}
TEST(UncaughtThrow) {
CcTest::InitializeVM();
v8::HandleScope scope(CcTest::isolate());
const char* source = "throw 42;";
Handle<JSFunction> fun = Compile(source);
CHECK(!fun.is_null());
Isolate* isolate = fun->GetIsolate();
Handle<JSObject> global(isolate->context()->global_object());
CHECK(Execution::Call(isolate, fun, global, 0, NULL).is_null());
CHECK_EQ(42.0, isolate->pending_exception()->Number());
}
// Tests calling a builtin function from C/C++ code, and the builtin function
// performs GC. It creates a stack frame looks like following:
// | C (PerformGC) |
// | JS-to-C |
// | JS |
// | C-to-JS |
TEST(C2JSFrames) {
FLAG_expose_gc = true;
v8::HandleScope scope(CcTest::isolate());
v8::Local<v8::Context> context =
CcTest::NewContext(PRINT_EXTENSION | GC_EXTENSION);
v8::Context::Scope context_scope(context);
const char* source = "function foo(a) { gc(), print(a); }";
Handle<JSFunction> fun0 = Compile(source);
CHECK(!fun0.is_null());
Isolate* isolate = fun0->GetIsolate();
// Run the generated code to populate the global object with 'foo'.
Handle<JSObject> global(isolate->context()->global_object());
Execution::Call(isolate, fun0, global, 0, NULL).Check();
Handle<String> foo_string =
isolate->factory()->InternalizeOneByteString(STATIC_CHAR_VECTOR("foo"));
Handle<Object> fun1 = Object::GetProperty(
isolate->global_object(), foo_string).ToHandleChecked();
CHECK(fun1->IsJSFunction());
Handle<Object> argv[] = {isolate->factory()->InternalizeOneByteString(
STATIC_CHAR_VECTOR("hello"))};
Execution::Call(isolate,
Handle<JSFunction>::cast(fun1),
global,
arraysize(argv),
argv).Check();
}
// Regression 236. Calling InitLineEnds on a Script with undefined
// source resulted in crash.
TEST(Regression236) {
CcTest::InitializeVM();
Isolate* isolate = CcTest::i_isolate();
Factory* factory = isolate->factory();
v8::HandleScope scope(CcTest::isolate());
Handle<Script> script = factory->NewScript(factory->empty_string());
script->set_source(CcTest::heap()->undefined_value());
CHECK_EQ(-1, Script::GetLineNumber(script, 0));
CHECK_EQ(-1, Script::GetLineNumber(script, 100));
CHECK_EQ(-1, Script::GetLineNumber(script, -1));
}
TEST(GetScriptLineNumber) {
LocalContext context;
v8::HandleScope scope(CcTest::isolate());
v8::ScriptOrigin origin =
v8::ScriptOrigin(v8::String::NewFromUtf8(CcTest::isolate(), "test"));
const char function_f[] = "function f() {}";
const int max_rows = 1000;
const int buffer_size = max_rows + sizeof(function_f);
ScopedVector<char> buffer(buffer_size);
memset(buffer.start(), '\n', buffer_size - 1);
buffer[buffer_size - 1] = '\0';
for (int i = 0; i < max_rows; ++i) {
if (i > 0)
buffer[i - 1] = '\n';
MemCopy(&buffer[i], function_f, sizeof(function_f) - 1);
v8::Handle<v8::String> script_body =
v8::String::NewFromUtf8(CcTest::isolate(), buffer.start());
v8::Script::Compile(script_body, &origin)->Run();
v8::Local<v8::Function> f =
v8::Local<v8::Function>::Cast(context->Global()->Get(
v8::String::NewFromUtf8(CcTest::isolate(), "f")));
CHECK_EQ(i, f->GetScriptLineNumber());
}
}
TEST(FeedbackVectorPreservedAcrossRecompiles) {
if (i::FLAG_always_opt || !i::FLAG_crankshaft) return;
i::FLAG_allow_natives_syntax = true;
CcTest::InitializeVM();
if (!CcTest::i_isolate()->use_crankshaft()) return;
v8::HandleScope scope(CcTest::isolate());
// Make sure function f has a call that uses a type feedback slot.
CompileRun("function fun() {};"
"fun1 = fun;"
"function f(a) { a(); } f(fun1);");
Handle<JSFunction> f =
v8::Utils::OpenHandle(
*v8::Handle<v8::Function>::Cast(
CcTest::global()->Get(v8_str("f"))));
// We shouldn't have deoptimization support. We want to recompile and
// verify that our feedback vector preserves information.
CHECK(!f->shared()->has_deoptimization_support());
Handle<TypeFeedbackVector> feedback_vector(f->shared()->feedback_vector());
// Verify that we gathered feedback.
int expected_slots = 0;
int expected_ic_slots = 1;
CHECK_EQ(expected_slots, feedback_vector->Slots());
CHECK_EQ(expected_ic_slots, feedback_vector->ICSlots());
FeedbackVectorICSlot slot_for_a(0);
Object* object = feedback_vector->Get(slot_for_a);
CHECK(object->IsWeakCell() &&
WeakCell::cast(object)->value()->IsJSFunction());
CompileRun("%OptimizeFunctionOnNextCall(f); f(fun1);");
// Verify that the feedback is still "gathered" despite a recompilation
// of the full code.
CHECK(f->IsOptimized());
CHECK(f->shared()->has_deoptimization_support());
object = f->shared()->feedback_vector()->Get(slot_for_a);
CHECK(object->IsWeakCell() &&
WeakCell::cast(object)->value()->IsJSFunction());
}
TEST(FeedbackVectorUnaffectedByScopeChanges) {
if (i::FLAG_always_opt || !i::FLAG_lazy) return;
CcTest::InitializeVM();
v8::HandleScope scope(CcTest::isolate());
CompileRun("function builder() {"
" call_target = function() { return 3; };"
" return (function() {"
" eval('');"
" return function() {"
" 'use strict';"
" call_target();"
" }"
" })();"
"}"
"morphing_call = builder();");
Handle<JSFunction> f =
v8::Utils::OpenHandle(
*v8::Handle<v8::Function>::Cast(
CcTest::global()->Get(v8_str("morphing_call"))));
// Not compiled, and so no feedback vector allocated yet.
CHECK(!f->shared()->is_compiled());
CHECK_EQ(0, f->shared()->feedback_vector()->Slots());
CHECK_EQ(0, f->shared()->feedback_vector()->ICSlots());
CompileRun("morphing_call();");
// Now a feedback vector is allocated.
CHECK(f->shared()->is_compiled());
int expected_slots = 0;
int expected_ic_slots = 2;
CHECK_EQ(expected_slots, f->shared()->feedback_vector()->Slots());
CHECK_EQ(expected_ic_slots, f->shared()->feedback_vector()->ICSlots());
}
// Test that optimized code for different closures is actually shared
// immediately by the FastNewClosureStub when run in the same context.
TEST(OptimizedCodeSharing1) {
FLAG_stress_compaction = false;
FLAG_allow_natives_syntax = true;
FLAG_cache_optimized_code = true;
CcTest::InitializeVM();
v8::HandleScope scope(CcTest::isolate());
for (int i = 0; i < 10; i++) {
LocalContext env;
env->Global()->Set(v8::String::NewFromUtf8(CcTest::isolate(), "x"),
v8::Integer::New(CcTest::isolate(), i));
CompileRun(
"function MakeClosure() {"
" return function() { return x; };"
"}"
"var closure0 = MakeClosure();"
"%DebugPrint(closure0());"
"%OptimizeFunctionOnNextCall(closure0);"
"%DebugPrint(closure0());"
"var closure1 = MakeClosure();"
"var closure2 = MakeClosure();");
Handle<JSFunction> fun1 = v8::Utils::OpenHandle(
*v8::Local<v8::Function>::Cast(env->Global()->Get(v8_str("closure1"))));
Handle<JSFunction> fun2 = v8::Utils::OpenHandle(
*v8::Local<v8::Function>::Cast(env->Global()->Get(v8_str("closure2"))));
CHECK(fun1->IsOptimized() || !CcTest::i_isolate()->use_crankshaft());
CHECK(fun2->IsOptimized() || !CcTest::i_isolate()->use_crankshaft());
CHECK_EQ(fun1->code(), fun2->code());
}
}
// Test that optimized code for different closures is actually shared
// immediately by the FastNewClosureStub when run different contexts.
TEST(OptimizedCodeSharing2) {
if (FLAG_stress_compaction) return;
FLAG_allow_natives_syntax = true;
FLAG_cache_optimized_code = true;
FLAG_turbo_cache_shared_code = true;
const char* flag = "--turbo-filter=*";
FlagList::SetFlagsFromString(flag, StrLength(flag));
CcTest::InitializeVM();
v8::HandleScope scope(CcTest::isolate());
v8::Local<v8::Script> script = v8_compile(
"function MakeClosure() {"
" return function() { return x; };"
"}");
Handle<Code> reference_code;
{
LocalContext env;
env->Global()->Set(v8::String::NewFromUtf8(CcTest::isolate(), "x"),
v8::Integer::New(CcTest::isolate(), 23));
script->GetUnboundScript()->BindToCurrentContext()->Run();
CompileRun(
"var closure0 = MakeClosure();"
"%DebugPrint(closure0());"
"%OptimizeFunctionOnNextCall(closure0);"
"%DebugPrint(closure0());");
Handle<JSFunction> fun0 = v8::Utils::OpenHandle(
*v8::Local<v8::Function>::Cast(env->Global()->Get(v8_str("closure0"))));
CHECK(fun0->IsOptimized() || !CcTest::i_isolate()->use_crankshaft());
reference_code = handle(fun0->code());
}
for (int i = 0; i < 10; i++) {
LocalContext env;
env->Global()->Set(v8::String::NewFromUtf8(CcTest::isolate(), "x"),
v8::Integer::New(CcTest::isolate(), i));
script->GetUnboundScript()->BindToCurrentContext()->Run();
CompileRun(
"var closure0 = MakeClosure();"
"%DebugPrint(closure0());"
"%OptimizeFunctionOnNextCall(closure0);"
"%DebugPrint(closure0());"
"var closure1 = MakeClosure();"
"var closure2 = MakeClosure();");
Handle<JSFunction> fun1 = v8::Utils::OpenHandle(
*v8::Local<v8::Function>::Cast(env->Global()->Get(v8_str("closure1"))));
Handle<JSFunction> fun2 = v8::Utils::OpenHandle(
*v8::Local<v8::Function>::Cast(env->Global()->Get(v8_str("closure2"))));
CHECK(fun1->IsOptimized() || !CcTest::i_isolate()->use_crankshaft());
CHECK(fun2->IsOptimized() || !CcTest::i_isolate()->use_crankshaft());
CHECK_EQ(*reference_code, fun1->code());
CHECK_EQ(*reference_code, fun2->code());
}
}
TEST(CompileFunctionInContext) {
CcTest::InitializeVM();
v8::HandleScope scope(CcTest::isolate());
LocalContext env;
CompileRun("var r = 10;");
v8::Local<v8::Object> math =
v8::Local<v8::Object>::Cast(env->Global()->Get(v8_str("Math")));
v8::ScriptCompiler::Source script_source(v8_str(
"a = PI * r * r;"
"x = r * cos(PI);"
"y = r * sin(PI / 2);"));
v8::Local<v8::Function> fun = v8::ScriptCompiler::CompileFunctionInContext(
CcTest::isolate(), &script_source, env.local(), 0, NULL, 1, &math);
CHECK(!fun.IsEmpty());
fun->Call(env->Global(), 0, NULL);
CHECK(env->Global()->Has(v8_str("a")));
v8::Local<v8::Value> a = env->Global()->Get(v8_str("a"));
CHECK(a->IsNumber());
CHECK(env->Global()->Has(v8_str("x")));
v8::Local<v8::Value> x = env->Global()->Get(v8_str("x"));
CHECK(x->IsNumber());
CHECK(env->Global()->Has(v8_str("y")));
v8::Local<v8::Value> y = env->Global()->Get(v8_str("y"));
CHECK(y->IsNumber());
CHECK_EQ(314.1592653589793, a->NumberValue());
CHECK_EQ(-10.0, x->NumberValue());
CHECK_EQ(10.0, y->NumberValue());
}
TEST(CompileFunctionInContextComplex) {
CcTest::InitializeVM();
v8::HandleScope scope(CcTest::isolate());
LocalContext env;
CompileRun(
"var x = 1;"
"var y = 2;"
"var z = 4;"
"var a = {x: 8, y: 16};"
"var b = {x: 32};");
v8::Local<v8::Object> ext[2];
ext[0] = v8::Local<v8::Object>::Cast(env->Global()->Get(v8_str("a")));
ext[1] = v8::Local<v8::Object>::Cast(env->Global()->Get(v8_str("b")));
v8::ScriptCompiler::Source script_source(v8_str("result = x + y + z"));
v8::Local<v8::Function> fun = v8::ScriptCompiler::CompileFunctionInContext(
CcTest::isolate(), &script_source, env.local(), 0, NULL, 2, ext);
CHECK(!fun.IsEmpty());
fun->Call(env->Global(), 0, NULL);
CHECK(env->Global()->Has(v8_str("result")));
v8::Local<v8::Value> result = env->Global()->Get(v8_str("result"));
CHECK(result->IsNumber());
CHECK_EQ(52.0, result->NumberValue());
}
TEST(CompileFunctionInContextArgs) {
CcTest::InitializeVM();
v8::HandleScope scope(CcTest::isolate());
LocalContext env;
CompileRun("var a = {x: 23};");
v8::Local<v8::Object> ext[1];
ext[0] = v8::Local<v8::Object>::Cast(env->Global()->Get(v8_str("a")));
v8::ScriptCompiler::Source script_source(v8_str("result = x + b"));
v8::Local<v8::String> arg = v8_str("b");
v8::Local<v8::Function> fun = v8::ScriptCompiler::CompileFunctionInContext(
CcTest::isolate(), &script_source, env.local(), 1, &arg, 1, ext);
CHECK(!fun.IsEmpty());
v8::Local<v8::Value> b_value = v8::Number::New(CcTest::isolate(), 42.0);
fun->Call(env->Global(), 1, &b_value);
CHECK(env->Global()->Has(v8_str("result")));
v8::Local<v8::Value> result = env->Global()->Get(v8_str("result"));
CHECK(result->IsNumber());
CHECK_EQ(65.0, result->NumberValue());
}
TEST(CompileFunctionInContextComments) {
CcTest::InitializeVM();
v8::HandleScope scope(CcTest::isolate());
LocalContext env;
CompileRun("var a = {x: 23, y: 1, z: 2};");
v8::Local<v8::Object> ext[1];
ext[0] = v8::Local<v8::Object>::Cast(env->Global()->Get(v8_str("a")));
v8::ScriptCompiler::Source script_source(
v8_str("result = /* y + */ x + b // + z"));
v8::Local<v8::String> arg = v8_str("b");
v8::Local<v8::Function> fun = v8::ScriptCompiler::CompileFunctionInContext(
CcTest::isolate(), &script_source, env.local(), 1, &arg, 1, ext);
CHECK(!fun.IsEmpty());
v8::Local<v8::Value> b_value = v8::Number::New(CcTest::isolate(), 42.0);
fun->Call(env->Global(), 1, &b_value);
CHECK(env->Global()->Has(v8_str("result")));
v8::Local<v8::Value> result = env->Global()->Get(v8_str("result"));
CHECK(result->IsNumber());
CHECK_EQ(65.0, result->NumberValue());
}
TEST(CompileFunctionInContextNonIdentifierArgs) {
CcTest::InitializeVM();
v8::HandleScope scope(CcTest::isolate());
LocalContext env;
v8::ScriptCompiler::Source script_source(v8_str("result = 1"));
v8::Local<v8::String> arg = v8_str("b }");
v8::Local<v8::Function> fun = v8::ScriptCompiler::CompileFunctionInContext(
CcTest::isolate(), &script_source, env.local(), 1, &arg, 0, NULL);
CHECK(fun.IsEmpty());
}
#ifdef ENABLE_DISASSEMBLER
static Handle<JSFunction> GetJSFunction(v8::Handle<v8::Object> obj,
const char* property_name) {
v8::Local<v8::Function> fun =
v8::Local<v8::Function>::Cast(obj->Get(v8_str(property_name)));
return v8::Utils::OpenHandle(*fun);
}
static void CheckCodeForUnsafeLiteral(Handle<JSFunction> f) {
// Create a disassembler with default name lookup.
disasm::NameConverter name_converter;
disasm::Disassembler d(name_converter);
if (f->code()->kind() == Code::FUNCTION) {
Address pc = f->code()->instruction_start();
int decode_size =
Min(f->code()->instruction_size(),
static_cast<int>(f->code()->back_edge_table_offset()));
if (FLAG_enable_embedded_constant_pool) {
decode_size = Min(decode_size, f->code()->constant_pool_offset());
}
Address end = pc + decode_size;
v8::internal::EmbeddedVector<char, 128> decode_buffer;
v8::internal::EmbeddedVector<char, 128> smi_hex_buffer;
Smi* smi = Smi::FromInt(12345678);
SNPrintF(smi_hex_buffer, "0x%" V8PRIxPTR, reinterpret_cast<intptr_t>(smi));
while (pc < end) {
int num_const = d.ConstantPoolSizeAt(pc);
if (num_const >= 0) {
pc += (num_const + 1) * kPointerSize;
} else {
pc += d.InstructionDecode(decode_buffer, pc);
CHECK(strstr(decode_buffer.start(), smi_hex_buffer.start()) == NULL);
}
}
}
}
TEST(SplitConstantsInFullCompiler) {
LocalContext context;
v8::HandleScope scope(CcTest::isolate());
CompileRun("function f() { a = 12345678 }; f();");
CheckCodeForUnsafeLiteral(GetJSFunction(context->Global(), "f"));
CompileRun("function f(x) { a = 12345678 + x}; f(1);");
CheckCodeForUnsafeLiteral(GetJSFunction(context->Global(), "f"));
CompileRun("function f(x) { var arguments = 1; x += 12345678}; f(1);");
CheckCodeForUnsafeLiteral(GetJSFunction(context->Global(), "f"));
CompileRun("function f(x) { var arguments = 1; x = 12345678}; f(1);");
CheckCodeForUnsafeLiteral(GetJSFunction(context->Global(), "f"));
}
#endif
| {
"content_hash": "8debe8f861c92f49b22702010602a3a6",
"timestamp": "",
"source": "github",
"line_count": 623,
"max_line_length": 80,
"avg_line_length": 36.99357945425361,
"alnum_prop": 0.6371328155508309,
"repo_name": "jaeh/runtime",
"id": "3b25480a4aa784687daacb44cdc7ea90bbd74d0e",
"size": "23047",
"binary": false,
"copies": "5",
"ref": "refs/heads/master",
"path": "deps/v8/test/cctest/test-compiler.cc",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Assembly",
"bytes": "29659"
},
{
"name": "C",
"bytes": "853"
},
{
"name": "C++",
"bytes": "2140348"
},
{
"name": "JavaScript",
"bytes": "508976"
},
{
"name": "Python",
"bytes": "6268"
},
{
"name": "Shell",
"bytes": "3888"
}
],
"symlink_target": ""
} |
package org.culturegraph.mf.stream.source;
import org.culturegraph.mf.util.ResourceUtil;
import org.culturegraph.mf.util.reflection.ObjectFactory;
/**
* Builds {@link Opener}s
*
* @author Markus Michael Geipel
*
*/
public final class OpenerFactory extends ObjectFactory<Opener> {
public static final String POPERTIES_LOCATION = "metastream-openers.properties";
public OpenerFactory() {
super();
loadClassesFromMap(ResourceUtil.loadProperties(POPERTIES_LOCATION), Opener.class);
}
}
| {
"content_hash": "9cbf77a2e10cd3f21dbb93a8b83a01ec",
"timestamp": "",
"source": "github",
"line_count": 20,
"max_line_length": 84,
"avg_line_length": 24.95,
"alnum_prop": 0.7715430861723447,
"repo_name": "schaeferd/metafacture-core",
"id": "750d0b6bfd794a7a78907698d3efa8809184ff66",
"size": "1123",
"binary": false,
"copies": "4",
"ref": "refs/heads/master",
"path": "src/main/java/org/culturegraph/mf/stream/source/OpenerFactory.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "GAP",
"bytes": "6980"
},
{
"name": "Java",
"bytes": "1147821"
},
{
"name": "JavaScript",
"bytes": "90"
},
{
"name": "Python",
"bytes": "1389"
}
],
"symlink_target": ""
} |
<!DOCTYPE html>
<html lang="en-US">
<head>
<title>React Checkbox Tree</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="theme-color" content="#3498db">
<meta name="description" content="React Checkbox Tree: A simple, yet elegant checkbox treeview for React.">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/normalize/8.0.1/normalize.min.css">
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.6.3/css/all.css">
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Open+Sans:400,700|Roboto">
<link rel="stylesheet" href="style.css">
<!-- Global site tag (gtag.js) - Google Analytics -->
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-133457161-1"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'UA-133457161-1');
</script>
</head>
<body>
<section class="page-header">
<h1 class="project-name">React Checkbox Tree</h1>
<h2 class="project-tagline">A simple and elegant checkbox tree for React</h2>
<a href="https://github.com/jakezatecky/react-checkbox-tree" class="btn">View on GitHub</a>
<a href="https://github.com/jakezatecky/react-checkbox-tree/zipball/master" class="btn">Download .zip</a>
<a href="https://github.com/jakezatecky/react-checkbox-tree/tarball/master" class="btn">Download .tar.gz</a>
</section>
<section class="main-content">
<p>
<strong>React Checkbox Tree</strong> is a feature-rich React component for a checkbox treeview.
Checkout the examples below and then view <a href="https://github.com/jakezatecky/react-checkbox-tree/tree/master/examples/src/js">source code</a>
or main <a href="https://github.com/jakezatecky/react-checkbox-tree">documentation page</a> when you are ready
to try it out.
</p>
<h1>Examples</h1>
<h2>Basic Example</h2>
<div id="basic-example"></div>
<h2>Custom Icons Example</h2>
<div id="custom-icons-example"></div>
<h2>Disabled Example</h2>
<div id="disabled-example"></div>
<h2>No Cascading Example</h2>
<p>
By default, the check state of a parent is determined by the check state of its children. Similarly, checking or
unchecking a parent node will cascade that status to all of its children. To disable this behavior, simply pass
the <code>noCascade</code> property.
</p>
<div id="no-cascade-example"></div>
<h2>Pessimistic Toggle Example</h2>
<p>
Try clicking a partially-checked node below. Instead of cascading a checked state to all children, the
pessimistic model will uncheck children and their descendants.
</p>
<div id="pessimistic-toggle-example"></div>
<h2>Clickable Labels Example</h2>
<p>
By default, clicking on the node label toggles the checkbox value. By providing an <code>onClick</code> property
the checkbox will toggle only when clicking on the checkbox and the provided function will be called when
clicking on the node label.
</p>
<p>
When the <code>onClick</code> function is defined, passing the <code>expandOnClick</code> property will also
expand the clicked node automatically.
</p>
<div id="clickable-labels-example"></div>
<h2>Hide Checkboxes Example</h2>
<p>
Checkboxes can be hidden on a node-level by setting <code>showCheckbox: false</code> for any given node. They
can also be more broadly hidden by the passing the <code>onlyLeafCheckboxes</code> property, which will force
checkboxes to render only on leaf nodes.
</p>
<div id="hidden-checkboxes-example"></div>
<h2>Expand All/Collapse All Example</h2>
<p>
By passing in the <code>showExpandAll</code> property, two additional buttons will appear at the top of the tree
that allow the user to easily expand or collapse all nodes.
</p>
<div id="expand-all-example"></div>
<h2>Large Data Example</h2>
<p>The checkbox tree is capable of supporting a large number of nodes at once.</p>
<div id="large-data-example"></div>
<h2>Filter Example</h2>
<p>Filtering of nodes is also easily possible.</p>
<div id="filter-example"></div>
<footer class="site-footer">
<span class="site-footer-owner">
<a href="https://github.com/jakezatecky/react-checkbox-tree">React Checkbox Tree</a> is maintained by <a href="https://github.com/jakezatecky">jakezatecky</a>.
</span>
<span class="site-footer-credits">
This page is hosted by <a href="https://pages.github.com">GitHub Pages</a>.
</span>
</footer>
</section>
<script src="index.js"></script>
</body>
</html>
| {
"content_hash": "80cad4865781d2f6b4d7a06fdbe3b556",
"timestamp": "",
"source": "github",
"line_count": 112,
"max_line_length": 169,
"avg_line_length": 45.142857142857146,
"alnum_prop": 0.6570411392405063,
"repo_name": "jakezatecky/react-checkbox-tree",
"id": "a1098e83925a0bee2ea1a778c7b476f4e4dd35c1",
"size": "5056",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "examples/src/index.html",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "JavaScript",
"bytes": "93595"
},
{
"name": "Less",
"bytes": "4259"
},
{
"name": "SCSS",
"bytes": "4472"
},
{
"name": "Shell",
"bytes": "461"
}
],
"symlink_target": ""
} |
ACCEPTED
#### According to
International Plant Names Index
#### Published in
null
#### Original name
null
### Remarks
null | {
"content_hash": "5544e0f9886ffaf1fc3aa41f2f521d84",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 31,
"avg_line_length": 9.692307692307692,
"alnum_prop": 0.7063492063492064,
"repo_name": "mdoering/backbone",
"id": "99e91d4205630930ceb59aeb3a5a7b5666dd6c69",
"size": "171",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "life/Plantae/Pteridophyta/Polypodiopsida/Cyatheales/Cyatheaceae/Cyathea/Cyathea excelsa/README.md",
"mode": "33188",
"license": "apache-2.0",
"language": [],
"symlink_target": ""
} |
<?php
namespace kartik\widgets;
/**
* Base asset bundle for all widgets
*
* @author Kartik Visweswaran <kartikv2@gmail.com>
* @since 1.0
*/
class AssetBundle extends \kartik\base\AssetBundle
{
}
| {
"content_hash": "f9427e2d31cfce8d1c5d225098eedfd8",
"timestamp": "",
"source": "github",
"line_count": 15,
"max_line_length": 50,
"avg_line_length": 13.6,
"alnum_prop": 0.7009803921568627,
"repo_name": "cmbis/cmbis",
"id": "d84b4f7072c657ee5c2fcc960d751dafed794a3c",
"size": "322",
"binary": false,
"copies": "10",
"ref": "refs/heads/master",
"path": "vendor/kartik-v/yii2-widgets/AssetBundle.php",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "Batchfile",
"bytes": "1030"
},
{
"name": "CSS",
"bytes": "348488"
},
{
"name": "JavaScript",
"bytes": "139798"
},
{
"name": "PHP",
"bytes": "380434"
}
],
"symlink_target": ""
} |
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<LinearLayout android:id="@+id/linearLayout0"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:layout_width="match_parent">
<EditText
android:text="User"
android:layout_height="wrap_content"
android:id="@+id/txtUser" android:layout_width="0dp"
android:layout_weight=".5" />
<EditText android:text="Password"
android:layout_height="wrap_content"
android:id="@+id/txtPassword"
android:layout_width="0dp"
android:layout_weight=".5" />
</LinearLayout>
<LinearLayout android:id="@+id/linearLayout1"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:layout_width="match_parent">
<Button
android:text="Select"
android:layout_height="wrap_content"
android:id="@+id/btnSelect"
android:layout_width="0dp"
android:layout_weight=".3" />
<Button
android:text="Add"
android:layout_height="wrap_content"
android:id="@+id/btnAdd"
android:layout_width="0dp"
android:layout_weight=".3" />
<Button android:text="Remove"
android:layout_height="wrap_content"
android:id="@+id/btnRemove"
android:layout_width="0dp"
android:layout_weight=".3" />
</LinearLayout>
<LinearLayout android:id="@+id/linearLayout2"
android:layout_height="wrap_content"
android:layout_width="match_parent"
android:orientation="vertical">
</LinearLayout>
</LinearLayout> | {
"content_hash": "880352913c96482c2f492eb4818d4076",
"timestamp": "",
"source": "github",
"line_count": 63,
"max_line_length": 72,
"avg_line_length": 30.476190476190474,
"alnum_prop": 0.5979166666666667,
"repo_name": "claudiordgz/android_playground",
"id": "fc1460da5f4f6ef2584f39a2e2f96c863ceeb9c5",
"size": "1920",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "SharedPreferences/app/src/main/res/layout/activity_shared_preferences.xml",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Java",
"bytes": "19430"
}
],
"symlink_target": ""
} |
<?php
namespace Behat\Behat\DependencyInjection\Configuration;
use Symfony\Component\Config\Definition\Builder\NodeBuilder,
Symfony\Component\Config\Definition\Builder\TreeBuilder,
Symfony\Component\Config\Definition\NodeInterface,
Symfony\Component\Config\Definition\Builder\ArrayNodeDefinition;
use Behat\Behat\Extension\ExtensionManager;
/**
* This class contains the configuration information for the Behat
*
* This information is solely responsible for how the different configuration
* sections are normalized, and merged.
*
* @author Konstantin Kudryashov <ever.zet@gmail.com>
*/
class Configuration
{
/**
* Generates the configuration tree.
*
* @param ExtensionManager $extensionManager
*
* @return NodeInterface
*/
public function getConfigTree(ExtensionManager $extensionManager)
{
$tree = new TreeBuilder();
$root = $this->appendConfigChildrens($tree);
$extensionsNode = $root->fixXmlConfig('extension')->children()->arrayNode('extensions')->children();
foreach ($extensionManager->getExtensions() as $id => $extension) {
$extensionNode = $extensionsNode->arrayNode($id);
$extension->getConfig($extensionNode);
}
return $tree->buildTree();
}
/**
* Appends config childrens to configuration tree.
*
* @param TreeBuilder $tree tree builder
*
* @return ArrayNodeDefinition
*/
protected function appendConfigChildrens(TreeBuilder $tree)
{
$boolFilter = function ($v) {
$filtered = filter_var($v, FILTER_VALIDATE_BOOLEAN, FILTER_NULL_ON_FAILURE);
return (null === $filtered) ? $v : $filtered;
};
return $tree->root('behat')->
children()->
arrayNode('paths')->
children()->
scalarNode('features')->
defaultValue('%behat.paths.base%/features')->
end()->
scalarNode('bootstrap')->
defaultValue('%behat.paths.features%/bootstrap')->
end()->
end()->
end()->
end()->
children()->
arrayNode('filters')->
children()->
scalarNode('name')->defaultNull()->end()->
scalarNode('tags')->defaultNull()->end()->
end()->
end()->
end()->
children()->
arrayNode('formatter')->
fixXmlConfig('parameter')->
children()->
scalarNode('name')->
defaultValue('pretty')->
end()->
arrayNode('classes')->
useAttributeAsKey('name')->
prototype('scalar')->end()->
end()->
arrayNode('parameters')->
useAttributeAsKey('name')->
prototype('variable')->end()->
end()->
end()->
end()->
end()->
children()->
arrayNode('options')->
fixXmlConfig('option')->
children()->
scalarNode('cache')->
defaultNull()->
end()->
booleanNode('strict')->
beforeNormalization()->
ifString()->then($boolFilter)->
end()->
defaultFalse()->
end()->
booleanNode('dry_run')->
beforeNormalization()->
ifString()->then($boolFilter)->
end()->
defaultFalse()->
end()->
booleanNode('stop_on_failure')->
beforeNormalization()->
ifString()->then($boolFilter)->
end()->
defaultFalse()->
end()->
scalarNode('rerun')->
defaultNull()->
end()->
scalarNode('append_snippets')->
defaultNull()->
end()->
end()->
end()->
end()->
children()->
arrayNode('context')->
fixXmlConfig('parameter')->
children()->
scalarNode('class')->
defaultValue('FeatureContext')->
end()->
arrayNode('parameters')->
useAttributeAsKey('name')->
prototype('variable')->end()->
end()->
end()->
end()->
end()
;
}
}
| {
"content_hash": "52e732f4d697457eaf3a488f767e6028",
"timestamp": "",
"source": "github",
"line_count": 149,
"max_line_length": 108,
"avg_line_length": 35.53020134228188,
"alnum_prop": 0.41877597279939555,
"repo_name": "KalaiselvanKarppusamy/test-everything-new",
"id": "04a3a043d821dca2402725b49d893c879a20e191",
"size": "5515",
"binary": false,
"copies": "24",
"ref": "refs/heads/master",
"path": "vendor/behat/behat/src/Behat/Behat/DependencyInjection/Configuration/Configuration.php",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "CSS",
"bytes": "1042"
},
{
"name": "PHP",
"bytes": "41234"
}
],
"symlink_target": ""
} |
package devices
import (
"errors"
"io/ioutil"
"os"
"path/filepath"
"golang.org/x/sys/unix"
)
// ErrNotADevice denotes that a file is not a valid linux device.
var ErrNotADevice = errors.New("not a device node")
// Testing dependencies
var (
unixLstat = unix.Lstat
ioutilReadDir = ioutil.ReadDir
)
func mkDev(d *Rule) (uint64, error) {
if d.Major == Wildcard || d.Minor == Wildcard {
return 0, errors.New("cannot mkdev() device with wildcards")
}
return unix.Mkdev(uint32(d.Major), uint32(d.Minor)), nil
}
// DeviceFromPath takes the path to a device and its cgroup_permissions (which
// cannot be easily queried) to look up the information about a linux device
// and returns that information as a Device struct.
func DeviceFromPath(path, permissions string) (*Device, error) {
var stat unix.Stat_t
err := unixLstat(path, &stat)
if err != nil {
return nil, err
}
var (
devType Type
mode = stat.Mode
devNumber = uint64(stat.Rdev) //nolint:unconvert // Rdev is uint32 on e.g. MIPS.
major = unix.Major(devNumber)
minor = unix.Minor(devNumber)
)
switch mode & unix.S_IFMT {
case unix.S_IFBLK:
devType = BlockDevice
case unix.S_IFCHR:
devType = CharDevice
case unix.S_IFIFO:
devType = FifoDevice
default:
return nil, ErrNotADevice
}
return &Device{
Rule: Rule{
Type: devType,
Major: int64(major),
Minor: int64(minor),
Permissions: Permissions(permissions),
},
Path: path,
FileMode: os.FileMode(mode &^ unix.S_IFMT),
Uid: stat.Uid,
Gid: stat.Gid,
}, nil
}
// HostDevices returns all devices that can be found under /dev directory.
func HostDevices() ([]*Device, error) {
return GetDevices("/dev")
}
// GetDevices recursively traverses a directory specified by path
// and returns all devices found there.
func GetDevices(path string) ([]*Device, error) {
files, err := ioutilReadDir(path)
if err != nil {
return nil, err
}
var out []*Device
for _, f := range files {
switch {
case f.IsDir():
switch f.Name() {
// ".lxc" & ".lxd-mounts" added to address https://github.com/lxc/lxd/issues/2825
// ".udev" added to address https://github.com/opencontainers/runc/issues/2093
case "pts", "shm", "fd", "mqueue", ".lxc", ".lxd-mounts", ".udev":
continue
default:
sub, err := GetDevices(filepath.Join(path, f.Name()))
if err != nil {
return nil, err
}
out = append(out, sub...)
continue
}
case f.Name() == "console":
continue
}
device, err := DeviceFromPath(filepath.Join(path, f.Name()), "rwm")
if err != nil {
if errors.Is(err, ErrNotADevice) {
continue
}
if os.IsNotExist(err) {
continue
}
return nil, err
}
if device.Type == FifoDevice {
continue
}
out = append(out, device)
}
return out, nil
}
| {
"content_hash": "9b0729325d46c0f2c7fa434d30ed5e4e",
"timestamp": "",
"source": "github",
"line_count": 118,
"max_line_length": 84,
"avg_line_length": 23.923728813559322,
"alnum_prop": 0.651080410910379,
"repo_name": "rhatdan/runc",
"id": "e2af4ff2cce3fecc373d3f8145f9f6deb7daaa88",
"size": "2863",
"binary": false,
"copies": "3",
"ref": "refs/heads/master",
"path": "libcontainer/devices/device_unix.go",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "C",
"bytes": "51683"
},
{
"name": "Dockerfile",
"bytes": "2161"
},
{
"name": "Go",
"bytes": "1098589"
},
{
"name": "Makefile",
"bytes": "4798"
},
{
"name": "Ruby",
"bytes": "1504"
},
{
"name": "Shell",
"bytes": "161044"
}
],
"symlink_target": ""
} |
'use strict';
var Library = require('./API/Library');
// ==============================
// CLIENT CODE
// ==============================
// We get the iterator (catalog) from the iterable object (library)
var library = new Library(["Foo", "Bar"]),
catalog = library.list();
while (catalog.hasNext()) {
console.log(catalog.next());
}
| {
"content_hash": "5e3723ef19878b751ed19bab749e368b",
"timestamp": "",
"source": "github",
"line_count": 15,
"max_line_length": 67,
"avg_line_length": 23,
"alnum_prop": 0.5246376811594203,
"repo_name": "Badacadabra/PatternifyJS",
"id": "2a9bb279f892c5cf0b9816c1b73c71765008d8b9",
"size": "345",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "GoF/classic/Behavioral/Iterator/ECMAScript/ES5/client.js",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CoffeeScript",
"bytes": "73266"
},
{
"name": "JavaScript",
"bytes": "174600"
},
{
"name": "TypeScript",
"bytes": "87967"
}
],
"symlink_target": ""
} |
package org.osgi.service.coordinator;
/**
* Unchecked exception which may be thrown by a Coordinator implementation.
*
* @author $Id$
*/
public class CoordinationException extends RuntimeException {
private static final long serialVersionUID = 1L;
/**
* Unknown reason for this exception.
*/
public final static int UNKNOWN = 0;
/**
* Registering a Participant with a Coordination would have resulted in a
* deadlock.
*/
public final static int DEADLOCK_DETECTED = 1;
/**
* The Coordination has terminated as a failure with
* {@link Coordination#fail(Throwable)}. When this exception type is used,
* the {@link #getCause()} method must return a non-null value.
*/
public final static int FAILED = 2;
/**
* The Coordination has partially ended.
*/
public final static int PARTIALLY_ENDED = 3;
/**
* The Coordination has already terminated normally.
*/
public final static int ALREADY_ENDED = 4;
/**
* The Coordination was already on a thread's thread local Coordination
* stack.
*/
public final static int ALREADY_PUSHED = 5;
/**
* The current thread was interrupted while waiting to register a
* Participant with a Coordination.
*/
public final static int LOCK_INTERRUPTED = 6;
/**
* The Coordination cannot be ended by the calling thread since the
* Coordination is on the thread local Coordination stack of another thread.
*/
public final static int WRONG_THREAD = 7;
private final String name;
private final int type;
private final long id;
/**
* Create a new Coordination Exception with a cause.
*
* @param message The detail message for this exception.
* @param coordination The Coordination associated with this exception.
* @param cause The cause associated with this exception.
* @param type The type of this exception.
* @throws IllegalArgumentException If the specified type is {@link #FAILED}
* and the specified cause is {@code null}.
*/
public CoordinationException(String message, Coordination coordination, int type, Throwable cause) {
super(message, cause);
this.type = type;
if (coordination == null) {
this.id = -1L;
this.name = "<>";
} else {
this.id = coordination.getId();
this.name = coordination.getName();
}
if ((type == FAILED) && (cause == null)) {
throw new IllegalArgumentException("A cause must be specified for type FAILED");
}
}
/**
* Create a new Coordination Exception.
*
* @param message The detail message for this exception.
* @param coordination The Coordination associated with this exception.
* @param type The type of this exception.
* @throws IllegalArgumentException If the specified type is {@link #FAILED}
* .
*/
public CoordinationException(String message, Coordination coordination, int type) {
super(message);
this.type = type;
if (coordination == null) {
this.id = -1L;
this.name = "<>";
} else {
this.id = coordination.getId();
this.name = coordination.getName();
}
if (type == FAILED) {
throw new IllegalArgumentException("A cause must be specified for type FAILED");
}
}
/**
* Returns the name of the {@link Coordination} associated with this
* exception.
*
* @return The name of the Coordination associated with this exception or
* {@code "<>"} if no Coordination is associated with this
* exception.
*/
public String getName() {
return name;
}
/**
* Returns the type for this exception.
*
* @return The type of this exception.
*/
public int getType() {
return type;
}
/**
* Returns the id of the {@link Coordination} associated with this
* exception.
*
* @return The id of the Coordination associated with this exception or
* {@code -1} if no Coordination is associated with this exception.
*/
public long getId() {
return id;
}
}
| {
"content_hash": "7ab2f14732f407b7d2bb4d62569c38fc",
"timestamp": "",
"source": "github",
"line_count": 144,
"max_line_length": 101,
"avg_line_length": 26.98611111111111,
"alnum_prop": 0.6819351518270715,
"repo_name": "osgi/osgi",
"id": "bc2c9ee0a66da53156fb97d5f87194b3d22ad310",
"size": "4705",
"binary": false,
"copies": "1",
"ref": "refs/heads/main",
"path": "org.osgi.service.coordinator/src/org/osgi/service/coordinator/CoordinationException.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Batchfile",
"bytes": "11308"
},
{
"name": "C",
"bytes": "11077"
},
{
"name": "CSS",
"bytes": "63392"
},
{
"name": "HTML",
"bytes": "1425271"
},
{
"name": "Java",
"bytes": "17327563"
},
{
"name": "JavaScript",
"bytes": "684425"
},
{
"name": "Makefile",
"bytes": "8343"
},
{
"name": "NewLisp",
"bytes": "4473"
},
{
"name": "Perl",
"bytes": "7202"
},
{
"name": "Python",
"bytes": "9377"
},
{
"name": "Roff",
"bytes": "64"
},
{
"name": "Ruby",
"bytes": "10888"
},
{
"name": "Shell",
"bytes": "48677"
},
{
"name": "SystemVerilog",
"bytes": "5465"
},
{
"name": "XSLT",
"bytes": "8082406"
}
],
"symlink_target": ""
} |
"""Implements commands for running blink web tests."""
import os
import subprocess
from argparse import Namespace
from typing import Optional
from common import DIR_SRC_ROOT
from test_runner import TestRunner
_BLINK_TEST_SCRIPT = os.path.join(DIR_SRC_ROOT, 'third_party', 'blink',
'tools', 'run_web_tests.py')
class BlinkTestRunner(TestRunner):
"""Test runner for running blink web tests."""
def __init__(self, out_dir: str, test_args: Namespace,
target_id: Optional[str]) -> None:
super().__init__(out_dir, test_args, ['content_shell'], target_id)
# TODO(crbug.com/1278939): Remove when blink tests use CFv2 content_shell.
@staticmethod
def is_cfv2() -> bool:
return False
def run_test(self):
test_cmd = [_BLINK_TEST_SCRIPT]
test_cmd.append('--platform=fuchsia')
if self._test_args:
test_cmd.extend(self._test_args)
return subprocess.run(test_cmd, check=True)
| {
"content_hash": "77e0fe9927d48bbc2b39cda64dce351d",
"timestamp": "",
"source": "github",
"line_count": 33,
"max_line_length": 78,
"avg_line_length": 30.454545454545453,
"alnum_prop": 0.6348258706467662,
"repo_name": "chromium/chromium",
"id": "44ffc5f45b1ac86a08492b261f2138fd32570660",
"size": "1145",
"binary": false,
"copies": "6",
"ref": "refs/heads/main",
"path": "build/fuchsia/test/run_blink_test.py",
"mode": "33188",
"license": "bsd-3-clause",
"language": [],
"symlink_target": ""
} |
/**
* Created by cdimonaco on 27/05/2017.
*/
import React from "react"
import Auth from "../common/auth.js"
import ProjectRow from "./rows/projectRow.js"
import Errors from "../common/errors.js"
import {getProjectAdmin} from "../common/connection.js"
import PropTypes from "prop-types"
export default class GetProjects extends React.Component{
constructor(props){
super(props);
this.getProjects = this.getProjects.bind(this);
this.handleSuccess = this.handleSuccess.bind(this);
this.handleErrors = this.handleErrors.bind(this);
this.state = {projects:[],errors:[]};
}
componentDidMount(){
this.getProjects();
}
getProjects(){
getProjectAdmin(Auth.getToken(),this.props.match.params.id,this.handleSuccess,this.handleErrors);
}
handleSuccess(data){
this.setState({projects:data["projects"]});
}
handleErrors(Jqxhr,statuscode,errors){
if(Jqxhr.status === 401 && Jqxhr.responseJSON["msg"]){
Auth.deauthenticateUser();
this.props.history.push("/");
}
this.setState({errors:Jqxhr.responseJSON["message"]});
setTimeout(function () {
this.setState({errors:[]})
}.bind(this)
,3000);
}
render(){
return(
<div className="row">
<div className="col-lg-12">
<h2 className="page-header">
{this.props.match.params.id} - Progetti
</h2>
</div>
<div>
<Errors errors={this.state.errors}/>
<table className="table table-bordered">
<thead>
<tr>
<th>#</th>
<th>ID</th>
<th>Nome</th>
<th>Descrizione</th>
<th>Created At</th>
<th></th>
</tr>
</thead>
<tbody>
{this.state.projects.map(function (item,index) {
return <ProjectRow project={item} key={index} listindex={index+1}/>
})}
</tbody>
</table>
</div>
</div>
);
}
}
GetProjects.propTypes = {
match:PropTypes.shape({
params:PropTypes.shape({
id:PropTypes.string.isRequired
})
})
}; | {
"content_hash": "86137d5d68172c5e2c25336e3a33736c",
"timestamp": "",
"source": "github",
"line_count": 84,
"max_line_length": 105,
"avg_line_length": 30.69047619047619,
"alnum_prop": 0.4759503491078355,
"repo_name": "CDimonaco/andra-fe",
"id": "779ef21716fbab864fb8fe3325ed62640946a2f0",
"size": "2578",
"binary": false,
"copies": "1",
"ref": "refs/heads/production",
"path": "client/components/admin/getprojects.js",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "HTML",
"bytes": "661"
},
{
"name": "JavaScript",
"bytes": "68797"
}
],
"symlink_target": ""
} |
package org.apache.reef.runtime.hdinsight.client.sslhacks;
import javax.inject.Inject;
import javax.net.ssl.X509TrustManager;
import java.security.cert.CertificateException;
import java.security.cert.X509Certificate;
/**
* A TrustManager that trusts all certificates. Basically the "GOTO FAIL" bug implemented in Java.
* <p/>
* Hence: DO NOT USE THIS CLASS UNLESS DEBUGGING.
*/
final class UnsafeTrustManager implements X509TrustManager {
@Inject
UnsafeTrustManager() {
}
@Override
public void checkClientTrusted(final X509Certificate[] x509Certificates, final String s) throws CertificateException {
}
@Override
public void checkServerTrusted(final X509Certificate[] x509Certificates, final String s) throws CertificateException {
}
@Override
public X509Certificate[] getAcceptedIssuers() {
return new X509Certificate[0];
}
}
| {
"content_hash": "2dc8ff9d6216b109effb07685f5f8c93",
"timestamp": "",
"source": "github",
"line_count": 32,
"max_line_length": 120,
"avg_line_length": 27.0625,
"alnum_prop": 0.7748267898383372,
"repo_name": "DifferentSC/incubator-reef",
"id": "b1bd56fe37af7bd1560c2100d65d786fd24f5739",
"size": "1673",
"binary": false,
"copies": "4",
"ref": "refs/heads/master",
"path": "lang/java/reef-runtime-hdinsight/src/main/java/org/apache/reef/runtime/hdinsight/client/sslhacks/UnsafeTrustManager.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Batchfile",
"bytes": "2308"
},
{
"name": "C",
"bytes": "2790"
},
{
"name": "C#",
"bytes": "3343303"
},
{
"name": "C++",
"bytes": "153967"
},
{
"name": "CSS",
"bytes": "905"
},
{
"name": "Java",
"bytes": "5074250"
},
{
"name": "JavaScript",
"bytes": "3105"
},
{
"name": "Objective-C",
"bytes": "965"
},
{
"name": "PowerShell",
"bytes": "6426"
},
{
"name": "Protocol Buffer",
"bytes": "35097"
},
{
"name": "Python",
"bytes": "14622"
},
{
"name": "Shell",
"bytes": "7316"
}
],
"symlink_target": ""
} |
/*================================================================================
code generated by: java2cpp
author: Zoran Angelov, mailto://baldzar@gmail.com
class: org.apache.http.client.protocol.ClientContext
================================================================================*/
#ifndef J2CPP_INCLUDE_IMPLEMENTATION
#ifndef J2CPP_ORG_APACHE_HTTP_CLIENT_PROTOCOL_CLIENTCONTEXT_HPP_DECL
#define J2CPP_ORG_APACHE_HTTP_CLIENT_PROTOCOL_CLIENTCONTEXT_HPP_DECL
namespace j2cpp { namespace java { namespace lang { class Object; } } }
namespace j2cpp { namespace java { namespace lang { class String; } } }
#include <java/lang/Object.hpp>
#include <java/lang/String.hpp>
namespace j2cpp {
namespace org { namespace apache { namespace http { namespace client { namespace protocol {
class ClientContext;
class ClientContext
: public object<ClientContext>
{
public:
J2CPP_DECLARE_CLASS
J2CPP_DECLARE_FIELD(0)
J2CPP_DECLARE_FIELD(1)
J2CPP_DECLARE_FIELD(2)
J2CPP_DECLARE_FIELD(3)
J2CPP_DECLARE_FIELD(4)
J2CPP_DECLARE_FIELD(5)
J2CPP_DECLARE_FIELD(6)
J2CPP_DECLARE_FIELD(7)
J2CPP_DECLARE_FIELD(8)
J2CPP_DECLARE_FIELD(9)
explicit ClientContext(jobject jobj)
: object<ClientContext>(jobj)
{
}
operator local_ref<java::lang::Object>() const;
static static_field< J2CPP_CLASS_NAME, J2CPP_FIELD_NAME(0), J2CPP_FIELD_SIGNATURE(0), local_ref< java::lang::String > > COOKIESPEC_REGISTRY;
static static_field< J2CPP_CLASS_NAME, J2CPP_FIELD_NAME(1), J2CPP_FIELD_SIGNATURE(1), local_ref< java::lang::String > > AUTHSCHEME_REGISTRY;
static static_field< J2CPP_CLASS_NAME, J2CPP_FIELD_NAME(2), J2CPP_FIELD_SIGNATURE(2), local_ref< java::lang::String > > COOKIE_STORE;
static static_field< J2CPP_CLASS_NAME, J2CPP_FIELD_NAME(3), J2CPP_FIELD_SIGNATURE(3), local_ref< java::lang::String > > COOKIE_SPEC;
static static_field< J2CPP_CLASS_NAME, J2CPP_FIELD_NAME(4), J2CPP_FIELD_SIGNATURE(4), local_ref< java::lang::String > > COOKIE_ORIGIN;
static static_field< J2CPP_CLASS_NAME, J2CPP_FIELD_NAME(5), J2CPP_FIELD_SIGNATURE(5), local_ref< java::lang::String > > CREDS_PROVIDER;
static static_field< J2CPP_CLASS_NAME, J2CPP_FIELD_NAME(6), J2CPP_FIELD_SIGNATURE(6), local_ref< java::lang::String > > TARGET_AUTH_STATE;
static static_field< J2CPP_CLASS_NAME, J2CPP_FIELD_NAME(7), J2CPP_FIELD_SIGNATURE(7), local_ref< java::lang::String > > PROXY_AUTH_STATE;
static static_field< J2CPP_CLASS_NAME, J2CPP_FIELD_NAME(8), J2CPP_FIELD_SIGNATURE(8), local_ref< java::lang::String > > AUTH_SCHEME_PREF;
static static_field< J2CPP_CLASS_NAME, J2CPP_FIELD_NAME(9), J2CPP_FIELD_SIGNATURE(9), local_ref< java::lang::String > > USER_TOKEN;
}; //class ClientContext
} //namespace protocol
} //namespace client
} //namespace http
} //namespace apache
} //namespace org
} //namespace j2cpp
#endif //J2CPP_ORG_APACHE_HTTP_CLIENT_PROTOCOL_CLIENTCONTEXT_HPP_DECL
#else //J2CPP_INCLUDE_IMPLEMENTATION
#ifndef J2CPP_ORG_APACHE_HTTP_CLIENT_PROTOCOL_CLIENTCONTEXT_HPP_IMPL
#define J2CPP_ORG_APACHE_HTTP_CLIENT_PROTOCOL_CLIENTCONTEXT_HPP_IMPL
namespace j2cpp {
org::apache::http::client::protocol::ClientContext::operator local_ref<java::lang::Object>() const
{
return local_ref<java::lang::Object>(get_jobject());
}
static_field<
org::apache::http::client::protocol::ClientContext::J2CPP_CLASS_NAME,
org::apache::http::client::protocol::ClientContext::J2CPP_FIELD_NAME(0),
org::apache::http::client::protocol::ClientContext::J2CPP_FIELD_SIGNATURE(0),
local_ref< java::lang::String >
> org::apache::http::client::protocol::ClientContext::COOKIESPEC_REGISTRY;
static_field<
org::apache::http::client::protocol::ClientContext::J2CPP_CLASS_NAME,
org::apache::http::client::protocol::ClientContext::J2CPP_FIELD_NAME(1),
org::apache::http::client::protocol::ClientContext::J2CPP_FIELD_SIGNATURE(1),
local_ref< java::lang::String >
> org::apache::http::client::protocol::ClientContext::AUTHSCHEME_REGISTRY;
static_field<
org::apache::http::client::protocol::ClientContext::J2CPP_CLASS_NAME,
org::apache::http::client::protocol::ClientContext::J2CPP_FIELD_NAME(2),
org::apache::http::client::protocol::ClientContext::J2CPP_FIELD_SIGNATURE(2),
local_ref< java::lang::String >
> org::apache::http::client::protocol::ClientContext::COOKIE_STORE;
static_field<
org::apache::http::client::protocol::ClientContext::J2CPP_CLASS_NAME,
org::apache::http::client::protocol::ClientContext::J2CPP_FIELD_NAME(3),
org::apache::http::client::protocol::ClientContext::J2CPP_FIELD_SIGNATURE(3),
local_ref< java::lang::String >
> org::apache::http::client::protocol::ClientContext::COOKIE_SPEC;
static_field<
org::apache::http::client::protocol::ClientContext::J2CPP_CLASS_NAME,
org::apache::http::client::protocol::ClientContext::J2CPP_FIELD_NAME(4),
org::apache::http::client::protocol::ClientContext::J2CPP_FIELD_SIGNATURE(4),
local_ref< java::lang::String >
> org::apache::http::client::protocol::ClientContext::COOKIE_ORIGIN;
static_field<
org::apache::http::client::protocol::ClientContext::J2CPP_CLASS_NAME,
org::apache::http::client::protocol::ClientContext::J2CPP_FIELD_NAME(5),
org::apache::http::client::protocol::ClientContext::J2CPP_FIELD_SIGNATURE(5),
local_ref< java::lang::String >
> org::apache::http::client::protocol::ClientContext::CREDS_PROVIDER;
static_field<
org::apache::http::client::protocol::ClientContext::J2CPP_CLASS_NAME,
org::apache::http::client::protocol::ClientContext::J2CPP_FIELD_NAME(6),
org::apache::http::client::protocol::ClientContext::J2CPP_FIELD_SIGNATURE(6),
local_ref< java::lang::String >
> org::apache::http::client::protocol::ClientContext::TARGET_AUTH_STATE;
static_field<
org::apache::http::client::protocol::ClientContext::J2CPP_CLASS_NAME,
org::apache::http::client::protocol::ClientContext::J2CPP_FIELD_NAME(7),
org::apache::http::client::protocol::ClientContext::J2CPP_FIELD_SIGNATURE(7),
local_ref< java::lang::String >
> org::apache::http::client::protocol::ClientContext::PROXY_AUTH_STATE;
static_field<
org::apache::http::client::protocol::ClientContext::J2CPP_CLASS_NAME,
org::apache::http::client::protocol::ClientContext::J2CPP_FIELD_NAME(8),
org::apache::http::client::protocol::ClientContext::J2CPP_FIELD_SIGNATURE(8),
local_ref< java::lang::String >
> org::apache::http::client::protocol::ClientContext::AUTH_SCHEME_PREF;
static_field<
org::apache::http::client::protocol::ClientContext::J2CPP_CLASS_NAME,
org::apache::http::client::protocol::ClientContext::J2CPP_FIELD_NAME(9),
org::apache::http::client::protocol::ClientContext::J2CPP_FIELD_SIGNATURE(9),
local_ref< java::lang::String >
> org::apache::http::client::protocol::ClientContext::USER_TOKEN;
J2CPP_DEFINE_CLASS(org::apache::http::client::protocol::ClientContext,"org/apache/http/client/protocol/ClientContext")
J2CPP_DEFINE_FIELD(org::apache::http::client::protocol::ClientContext,0,"COOKIESPEC_REGISTRY","Ljava/lang/String;")
J2CPP_DEFINE_FIELD(org::apache::http::client::protocol::ClientContext,1,"AUTHSCHEME_REGISTRY","Ljava/lang/String;")
J2CPP_DEFINE_FIELD(org::apache::http::client::protocol::ClientContext,2,"COOKIE_STORE","Ljava/lang/String;")
J2CPP_DEFINE_FIELD(org::apache::http::client::protocol::ClientContext,3,"COOKIE_SPEC","Ljava/lang/String;")
J2CPP_DEFINE_FIELD(org::apache::http::client::protocol::ClientContext,4,"COOKIE_ORIGIN","Ljava/lang/String;")
J2CPP_DEFINE_FIELD(org::apache::http::client::protocol::ClientContext,5,"CREDS_PROVIDER","Ljava/lang/String;")
J2CPP_DEFINE_FIELD(org::apache::http::client::protocol::ClientContext,6,"TARGET_AUTH_STATE","Ljava/lang/String;")
J2CPP_DEFINE_FIELD(org::apache::http::client::protocol::ClientContext,7,"PROXY_AUTH_STATE","Ljava/lang/String;")
J2CPP_DEFINE_FIELD(org::apache::http::client::protocol::ClientContext,8,"AUTH_SCHEME_PREF","Ljava/lang/String;")
J2CPP_DEFINE_FIELD(org::apache::http::client::protocol::ClientContext,9,"USER_TOKEN","Ljava/lang/String;")
} //namespace j2cpp
#endif //J2CPP_ORG_APACHE_HTTP_CLIENT_PROTOCOL_CLIENTCONTEXT_HPP_IMPL
#endif //J2CPP_INCLUDE_IMPLEMENTATION
| {
"content_hash": "7cc14de68d34a03a412c17e3e4d16bba",
"timestamp": "",
"source": "github",
"line_count": 176,
"max_line_length": 142,
"avg_line_length": 46.80681818181818,
"alnum_prop": 0.7160718621024521,
"repo_name": "kakashidinho/HQEngine",
"id": "887d2c69bdabb0c03155f6fbcbb7721f243045fb",
"size": "8238",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "ThirdParty-mod/java2cpp/org/apache/http/client/protocol/ClientContext.hpp",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Ada",
"bytes": "89080"
},
{
"name": "Assembly",
"bytes": "661970"
},
{
"name": "Awk",
"bytes": "32706"
},
{
"name": "Batchfile",
"bytes": "14796"
},
{
"name": "C",
"bytes": "12872998"
},
{
"name": "C#",
"bytes": "76556"
},
{
"name": "C++",
"bytes": "25893894"
},
{
"name": "CLIPS",
"bytes": "5291"
},
{
"name": "CMake",
"bytes": "100966"
},
{
"name": "CSS",
"bytes": "23584"
},
{
"name": "DIGITAL Command Language",
"bytes": "36015"
},
{
"name": "GLSL",
"bytes": "7830"
},
{
"name": "HLSL",
"bytes": "20473"
},
{
"name": "HTML",
"bytes": "2060539"
},
{
"name": "Java",
"bytes": "76190"
},
{
"name": "Lex",
"bytes": "13371"
},
{
"name": "M4",
"bytes": "236533"
},
{
"name": "Makefile",
"bytes": "1169529"
},
{
"name": "Module Management System",
"bytes": "17591"
},
{
"name": "Objective-C",
"bytes": "1535348"
},
{
"name": "Objective-C++",
"bytes": "41381"
},
{
"name": "Pascal",
"bytes": "69941"
},
{
"name": "Perl",
"bytes": "35354"
},
{
"name": "RPC",
"bytes": "3150250"
},
{
"name": "Roff",
"bytes": "290354"
},
{
"name": "SAS",
"bytes": "16347"
},
{
"name": "Shell",
"bytes": "986190"
},
{
"name": "Smalltalk",
"bytes": "6052"
},
{
"name": "TeX",
"bytes": "144346"
},
{
"name": "WebAssembly",
"bytes": "14280"
},
{
"name": "XSLT",
"bytes": "75795"
},
{
"name": "Yacc",
"bytes": "15640"
}
],
"symlink_target": ""
} |
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html lang="pt-br" xml:lang="pt-br">
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF 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
http://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.
-->
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
<meta name="copyright" content="(C) Copyright 2005" />
<meta name="DC.rights.owner" content="(C) Copyright 2005" />
<meta content="public" name="security" />
<meta content="index,follow" name="Robots" />
<meta http-equiv="PICS-Label" content='(PICS-1.1 "http://www.icra.org/ratingsv02.html" l gen true r (cz 1 lz 1 nz 1 oz 1 vz 1) "http://www.rsac.org/ratingsv01.html" l gen true r (n 0 s 0 v 0 l 0) "http://www.classify.org/safesurf/" l gen true r (SS~~000 1))' />
<meta content="concept" name="DC.Type" />
<meta name="DC.Title" content="Regras para pontos de salvamento" />
<meta scheme="URI" name="DC.Relation" content="rrefjdbcjavasqlsavepoint.html" />
<meta scheme="URI" name="DC.Relation" content="crefjavsavesetroll.html" />
<meta scheme="URI" name="DC.Relation" content="crefjavsaverel.html" />
<meta scheme="URI" name="DC.Relation" content="rrefjavsaverestrict.html" />
<meta content="XHTML" name="DC.Format" />
<meta content="crefjavsaverules" name="DC.Identifier" />
<meta content="pt-br" name="DC.Language" />
<link href="commonltr.css" type="text/css" rel="stylesheet" />
<title>Regras para pontos de salvamento</title>
</head>
<body id="crefjavsaverules"><a name="crefjavsaverules"><!-- --></a>
<h1 class="topictitle1">Regras para pontos de salvamento</h1>
<div>
<p>O ponto de salvamento não pode ser definido dentro de lotes de instruções
para habilitar a recuperação parcial.
Se for definido um ponto de salvamento em qualquer momento anterior ao
método <em>executeBatch</em> ser chamado, este será definido antes de qualquer
instrução adicionada ao lote ser executada.</p>
<p>O nome do ponto de salvamento poderá ser reutilizado após ter sido liberado
explicitamente (emitindo uma liberação do ponto de salvamento), ou
implicitamente (emitindo um COMMIT/ROLLBACK para a conexão).</p>
</div>
<div>
<div class="familylinks">
<div class="parentlink"><strong>Tópico pai:</strong> <a href="rrefjdbcjavasqlsavepoint.html" title="">java.sql.Savepoint</a></div>
</div>
<div class="relconcepts"><strong>Conceitos relacionados</strong><br />
<div><a href="crefjavsavesetroll.html" title="">Definir e desfazer até um ponto de salvamento</a></div>
<div><a href="crefjavsaverel.html" title="">Liberação de ponto de salvamento</a></div>
</div>
<div class="relref"><strong>Referências relacionadas</strong><br />
<div><a href="rrefjavsaverestrict.html" title="">Restrições dos pontos de salvamento</a></div>
</div>
</div>
</body>
</html>
| {
"content_hash": "35f38f72b42f415410d33a6f0a83f5de",
"timestamp": "",
"source": "github",
"line_count": 71,
"max_line_length": 261,
"avg_line_length": 50.225352112676056,
"alnum_prop": 0.7229388670779585,
"repo_name": "mminella/jsr-352-ri-tck",
"id": "0a1fd131d1bd5e6cbe3706e3341a2ac4cbdde12e",
"size": "3587",
"binary": false,
"copies": "3",
"ref": "refs/heads/master",
"path": "JSR352.BinaryDependencies/shipped/derby/docs/html/pt_BR/ref/crefjavsaverules.html",
"mode": "33261",
"license": "apache-2.0",
"language": [
{
"name": "Java",
"bytes": "1743336"
},
{
"name": "Perl",
"bytes": "80042"
},
{
"name": "Racket",
"bytes": "180"
},
{
"name": "Ruby",
"bytes": "1444"
},
{
"name": "Shell",
"bytes": "45633"
}
],
"symlink_target": ""
} |
using namespace std;
#include "process.h"
// tabulate the contributions
// from form factor files found in the current directory
void makeDeltaE2 (ostream& outfile, const REAL delta, const int number_sites, const int left_number_down)
{
const char* here = "calculateDeltaE2";
const int max_base_size=CUTOFF_TYPES;
// construct the base of the file name
stringstream description;
description << "*" << nameFromValue(mon_Delta, delta) << nameFromValue(mon_Length, number_sites) << nameFromValue(mon_LeftDown, left_number_down, fieldWidth(number_sites));
// look for input files with these values
vector<string> input_file_long = ls(Longitudinal::ff_name + description.str() + "*.result");
vector<string> input_file_trans = ls(Transverse::ff_name + description.str() + "*.result");
REAL sum = 0.0;
for (int i=0; i< input_file_long.size(); ++i) {
ifstream infile (input_file_long[i].c_str());
// does the name contain "hbz"? if so, it is a half Brillouin zone.
bool half_zone = (string::npos != input_file_long[i].find ("hbz",0));
long long int id;
int index_momentum, iter, newt;
REAL energy, momentum, form_factor, deviation, convergence;
REAL base_sum = 0.0;
while ( readFormFactor(infile, id, index_momentum, momentum, energy, form_factor, convergence, iter, newt, deviation) ) {
base_sum += sq(form_factor) * sq(cos(0.5*momentum)) ;
// if we only have a half zone, everything not on the zone boundary has to be counted double.
if ( half_zone && (index_momentum >0) && (index_momentum < number_sites/2))
base_sum += sq(form_factor) * sq(cos(0.5*momentum));
}
sum += base_sum;
infile.close();
}
for (int i=0; i< input_file_trans.size(); ++i) {
ifstream infile (input_file_trans[i].c_str());
// does the name contain "hbz"? if so, it is a half Brillouin zone.
bool half_zone = (string::npos != input_file_trans[i].find ("hbz",0));
long long int id;
int index_momentum, iter, newt;
REAL energy, momentum, form_factor, deviation, convergence;
REAL base_sum = 0.0;
while ( readFormFactor(infile, id, index_momentum, momentum, energy, form_factor, convergence, iter, newt, deviation) ) {
base_sum += sq(form_factor) * sq(cos(0.5*momentum)) ;
// if we only have a half zone, everything not on the zone boundary has to be counted double.
if ( half_zone && (index_momentum >0) && (index_momentum < number_sites/2))
base_sum += sq(form_factor) * sq(cos(0.5*momentum));
}
sum += 2.0 * base_sum;
infile.close();
}
Chain* p_chain = newChain (delta, number_sites);
REAL field = magneticField(*p_chain, left_number_down);
outfile.precision(20);
outfile.setf(ios::fixed);
outfile << left_number_down <<SEP<< field <<SEP<< sum <<endl;
}
int run(void)
{
REAL delta;
int number_sites, left_number_down;
cerr<<"delta N M"<<endl;
cin >> delta >> number_sites >> left_number_down;
cerr<< "input complete"<<endl;
makeDeltaE2 (cout, delta, number_sites, left_number_down);
return 0;
}
| {
"content_hash": "70e9a0884f21e828cf1da76a573e4a47",
"timestamp": "",
"source": "github",
"line_count": 79,
"max_line_length": 173,
"avg_line_length": 37.59493670886076,
"alnum_prop": 0.6797979797979798,
"repo_name": "robhagemans/bethe-solver",
"id": "81b6c10daa85bf700a236e9f8ad26314424edfe3",
"size": "3084",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "bethe-xxz/frontend-balents.cc",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C",
"bytes": "9901"
},
{
"name": "C++",
"bytes": "287004"
},
{
"name": "Objective-C",
"bytes": "19"
}
],
"symlink_target": ""
} |
#include "build.h"
#include "codeGeneratorMSVC.h"
#include "codePrinter.h"
#include "internalUtils.h"
#include "zlib\zlib.h"
#include "decodingEnvironment.h"
#if defined(_WIN64) || defined(_WIN32)
#include <Windows.h>
namespace code
{
namespace msvc
{
//----------------------------------------------------------------------
Generator::File::File(const wchar_t* fileName)
: m_numBlocks(0)
, m_numInstructions(0)
, m_codePrinter(new Printer())
{
wcscpy_s(m_fileName, fileName);
}
Generator::File::~File()
{
delete m_codePrinter;
}
//----------------------------------------------------------------------
Generator::Generator(class ILogOutput& log, const Commandline& params)
: m_currentFile(NULL)
, m_logOutput(&log)
, m_blockBaseAddress(0)
, m_totalNumBlocks(0)
, m_totalNumInstructions(0)
, m_isBlockMultiAddress(false)
, m_inBlock(false)
, m_hasImage(false)
, m_imageBaseAddress(0)
, m_imageEntryAdrdress(0)
, m_imageUncompressedSize(0)
, m_imageCompressedSize(0)
, m_forceMultiAddressBlocks(false)
, m_instructionsPerFile(32 * 1024)
, m_runtimePlatform("win64")
, m_compilationPlatform("release")
{
// get the optimization settings
if (params.HasOption("debug"))
{
m_compilationPlatform = "debug";
m_forceMultiAddressBlocks = true;
}
}
Generator::~Generator()
{
DeleteVector(m_files);
}
void Generator::CloseFile()
{
CloseBlock();
if (m_currentFile)
{
// stats
m_logOutput->Log("CodeGen: Generated file '%ls', %u blocks, %u instructions",
m_currentFile->m_fileName,
m_currentFile->m_numBlocks,
m_currentFile->m_numInstructions);
m_currentFile = NULL;
}
}
void Generator::StartFile(const char* customFileName, const bool addIncludes /*= true*/)
{
CloseFile();
if (customFileName && customFileName[0])
{
const std::wstring tempFile(customFileName, customFileName + strlen(customFileName));
m_currentFile = new File(tempFile.c_str());
}
else
{
wchar_t fileName[32];
swprintf_s(fileName, ARRAYSIZE(fileName), L"autocode_%d.cpp", (int)m_files.size());
m_currentFile = new File(fileName);
}
m_files.push_back(m_currentFile);
if (addIncludes && !m_includes.empty())
{
for (uint32 i = 0; i < m_includes.size(); ++i)
{
m_currentFile->m_codePrinter->Printf("#include \"%ls\"\n", m_includes[i].c_str());
}
m_currentFile->m_codePrinter->Printf("\n");
}
m_inBlock = false;
}
void Generator::CloseBlock()
{
// function tail
if (m_inBlock)
{
if (m_isBlockMultiAddress)
{
m_currentFile->m_codePrinter->Indent(-1);
m_currentFile->m_codePrinter->Print("}\n");
}
m_currentFile->m_codePrinter->Printf("return 0x%08X;\n", m_blockReturnAddress);
m_currentFile->m_codePrinter->Indent(-1);
m_currentFile->m_codePrinter->Printf("} // Block from %06Xh-%06Xh (%d instructions)\n",
m_blockBaseAddress,
m_blockReturnAddress,
(m_blockReturnAddress - m_blockBaseAddress) / 4);
m_currentFile->m_codePrinter->Printf("\n");
// setup the return address (final address of the block)
if (!m_exportedBlocks.empty() && m_exportedBlocks.back().m_addressEnd == 0)
{
m_exportedBlocks.back().m_addressEnd = m_blockReturnAddress;
}
m_blockReturnAddress = 0;
m_blockBaseAddress = 0;
m_isBlockMultiAddress = false;
m_inBlock = false;
}
}
void Generator::SetLoadAddress(const uint64 loadAddress)
{
m_logOutput->Log("CodeGen: Image load address set to 0x%08llx", loadAddress);
m_imageBaseAddress = loadAddress;
}
void Generator::SetEntryAddress(const uint64 entryAddress)
{
m_logOutput->Log("CodeGen: Image entry address set to 0x%08llx", entryAddress);
m_imageEntryAdrdress = entryAddress;
}
void Generator::AddPlatformInclude(const std::wstring& path)
{
TIncludes::const_iterator it = std::find(m_includes.begin(), m_includes.end(), path);
if (it == m_includes.end())
m_includes.push_back(path);
}
void Generator::AddImportSymbol(const char* name, const uint64 tableAddress, const uint64 entryAddress)
{
ImportInfo info;
strcpy_s(info.m_importName, name);
info.m_tableAddress = tableAddress;
info.m_entryAddress = entryAddress;
m_exportedSymbols.push_back(info);
}
void Generator::AddImageData(ILogOutput& log, const void* imageData, const uint32 imageSize)
{
// already have an image
if (m_hasImage)
{
m_logOutput->Warn("CodeGen: Image data already added");
return;
}
// generate compressed image data
log.SetTaskName("Compressing image... ");
std::vector<uint8> compresedImageData;
if (!CompressData(imageData, imageSize, compresedImageData))
{
m_logOutput->Error("CodeGen: Unable to compress image data");
return;
}
// stats
log.Log("Decompile: Image compressed %u->%u bytes", (uint32)imageSize, compresedImageData.size());
// setup data
m_hasImage = true;
m_imageCompressedSize = (uint32)compresedImageData.size();
m_imageUncompressedSize = imageSize;
// create new file (image data)
StartFile("image.cpp");
// Header
m_currentFile->m_codePrinter->Printf("// This file contains the compressed copy of original image file to be decompressed and loaded by the runtime\n");
m_currentFile->m_codePrinter->Printf("// Compressed size = %d\n", m_imageCompressedSize);
m_currentFile->m_codePrinter->Printf("// Uncompressed size = %d\n", m_imageUncompressedSize);
m_currentFile->m_codePrinter->Print("\n");
// Generate image data
m_currentFile->m_codePrinter->Printf("const unsigned char CompressedImageData[%d] = {", m_imageCompressedSize);
log.SetTaskName("Exporting image data... ");
for (uint32 i = 0; i < m_imageCompressedSize; ++i)
{
log.SetTaskProgress(i, m_imageCompressedSize);
if ((i & 31) == 0)
m_currentFile->m_codePrinter->Printf("\n\t");
const uint8 val = compresedImageData[i];
m_currentFile->m_codePrinter->Printf("%d,", val);
}
m_currentFile->m_codePrinter->Print("\n}; // CompressedImageData\n\n");
m_currentFile->m_codePrinter->Print("const unsigned char* CompressedImageDataStart = &CompressedImageData[0];\n\n");
// end file
CloseFile();
}
void Generator::AddGlueFile()
{
// create new file (glue logic file)
StartFile("main.cpp");
// Windows include
if (m_runtimePlatform == "win64" || m_runtimePlatform == "win32")
{
m_currentFile->m_codePrinter->Printf("#include <Windows.h>\n");
m_currentFile->m_codePrinter->Printf("\n");
}
// block exports
if (!m_exportedBlocks.empty())
{
m_currentFile->m_codePrinter->Printf("// %d exported blocks\n", m_exportedBlocks.size());
for (uint32 i = 0; i < m_exportedBlocks.size(); ++i)
{
const char* blockSymbolName = m_exportedBlocks[i].m_name;
m_currentFile->m_codePrinter->Printf("extern uint64 __fastcall %s( uint64 ip, cpu::CpuRegs& regs ); // 0x%08X - 0x%08X\n",
blockSymbolName,
m_exportedBlocks[i].m_addressStart,
m_exportedBlocks[i].m_addressEnd);
}
m_currentFile->m_codePrinter->Printf("\n");
}
// interrupts
if (!m_exportedInterrupts.empty())
{
m_currentFile->m_codePrinter->Printf("// %d exported interrupt calls\n", m_exportedInterrupts.size());
m_currentFile->m_codePrinter->Printf("runtime::InterruptCall ExportedInterrupts[%d] = {\n", m_exportedInterrupts.size());
for (uint32 i = 0; i < m_exportedInterrupts.size(); ++i)
{
const InterruptInfo& info = m_exportedInterrupts[i];
m_currentFile->m_codePrinter->Printf("{ %d, %d, (runtime::TInterruptFunc) &runtime::UnhandledInterruptCall }, // used %d times \n",
info.m_type,
info.m_index,
info.m_useCount);
}
m_currentFile->m_codePrinter->Print("};\n");
m_currentFile->m_codePrinter->Print("\n");
// calling interface
m_currentFile->m_codePrinter->Print("// interrupt handlers\n");
for (uint32 i = 0; i < m_exportedInterrupts.size(); ++i)
{
const InterruptInfo& info = m_exportedInterrupts[i];
m_currentFile->m_codePrinter->Printf("void %s(uint64 ip, cpu::CpuRegs& regs) { (*ExportedInterrupts[%d].m_functionPtr)(ip, regs); }\n",
info.m_name, i);
}
m_currentFile->m_codePrinter->Print("\n");
}
// block exports
if (!m_exportedBlocks.empty())
{
m_currentFile->m_codePrinter->Printf("runtime::BlockInfo ExportedBlocks[%d] = {\n", m_exportedBlocks.size());
for (uint32 i = 0; i < m_exportedBlocks.size(); ++i)
{
const BlockInfo& info = m_exportedBlocks[i];
m_currentFile->m_codePrinter->Printf("\t{ 0x%08X, 0x%08X, (runtime::TBlockFunc) &%s }, \n",
info.m_addressStart,
(info.m_multiAddress) ? (info.m_addressEnd - info.m_addressStart) : 1,
info.m_name);
}
m_currentFile->m_codePrinter->Print("};\n");
m_currentFile->m_codePrinter->Print("\n");
}
// function exports
if (!m_exportedSymbols.empty())
{
m_currentFile->m_codePrinter->Printf("runtime::ImportInfo ExportedImports[%d] = {\n", m_exportedSymbols.size());
for (uint32 i = 0; i < m_exportedSymbols.size(); ++i)
{
const ImportInfo& info = m_exportedSymbols[i];
m_currentFile->m_codePrinter->Printf("\t{ \"%s\", %d, 0x%08X }, \n",
info.m_importName,
(info.m_entryAddress == 0) ? 0 : 1,
(info.m_entryAddress == 0) ? info.m_tableAddress : info.m_entryAddress);
}
m_currentFile->m_codePrinter->Print("};\n");
m_currentFile->m_codePrinter->Print("\n");
}
// image info
m_currentFile->m_codePrinter->Print("runtime::ImageInfo ExportImageInfo;\n\n");
// image data import
if (m_hasImage)
{
m_currentFile->m_codePrinter->Print("// compressed image data buffer\n");
m_currentFile->m_codePrinter->Print("extern const unsigned char* CompressedImageDataStart;\n");
m_currentFile->m_codePrinter->Print("\n");
}
// windows only shit
if (m_runtimePlatform == "win64" || m_runtimePlatform == "win32")
{
m_currentFile->m_codePrinter->Print("BOOL WINAPI DllMain( HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved ) { return TRUE; }\n");
}
// get the image info
m_currentFile->m_codePrinter->Print("extern \"C\" __declspec(dllexport) void* GetImageInfo()\n");
m_currentFile->m_codePrinter->Print("{\n");
// initialization
{
m_currentFile->m_codePrinter->Print("\tmemset( &ExportImageInfo, 0, sizeof(ExportImageInfo) );\n");
if (m_hasImage)
{
m_currentFile->m_codePrinter->Printf("\tExportImageInfo.m_imageLoadAddress = 0x%llX;\n", m_imageBaseAddress);
m_currentFile->m_codePrinter->Printf("\tExportImageInfo.m_imageCompressedSize = %u;\n", m_imageCompressedSize);
m_currentFile->m_codePrinter->Printf("\tExportImageInfo.m_imageUncompressedSize = %u;\n", m_imageUncompressedSize);
m_currentFile->m_codePrinter->Print("\tExportImageInfo.m_imageCompresedData = CompressedImageDataStart;\n");
}
m_currentFile->m_codePrinter->Printf("\tExportImageInfo.m_entryAddress = 0x%llx;\n", m_imageEntryAdrdress);
// interrupts
m_currentFile->m_codePrinter->Printf("\tExportImageInfo.m_numInterrupts = %d;\n", m_exportedInterrupts.size());
m_currentFile->m_codePrinter->Printf("\tExportImageInfo.m_interrupts = %s;\n", m_exportedInterrupts.size() ? "&ExportedInterrupts[0]" : "NULL");
// blocks
m_currentFile->m_codePrinter->Printf("\tExportImageInfo.m_numBlocks = %d;\n", m_exportedBlocks.size());
m_currentFile->m_codePrinter->Printf("\tExportImageInfo.m_blocks = %s;\n", m_exportedBlocks.size() ? "&ExportedBlocks[0]" : "NULL");
// imports
m_currentFile->m_codePrinter->Printf("\tExportImageInfo.m_numImports = %d;\n", m_exportedSymbols.size());
m_currentFile->m_codePrinter->Printf("\tExportImageInfo.m_imports = %s;\n", m_exportedSymbols.size() ? "&ExportedImports[0]" : "NULL");
}
m_currentFile->m_codePrinter->Print("\treturn &ExportImageInfo;\n");
m_currentFile->m_codePrinter->Print("}\n");
m_currentFile->m_codePrinter->Print("\n");
CloseFile();
}
/*
const bool Generator::AddInterruptCall(const uint32 type, const uint32 index, std::string& outSymbolName, std::string& outSignature)
{
// already defined ?
for (uint32 i = 0; i < m_exportedInterrupts.size(); ++i)
{
InterruptInfo& info = m_exportedInterrupts[i];
if (info.m_type == type && info.m_index == index)
{
info.m_useCount += 1;
outSymbolName = info.m_name;
outSignature = info.m_signature;
return true;
}
}
// format symbol name
char symbolName[256];
sprintf_s(symbolName, "__interrupt_%u_%u", type, index);
// format function call signature
char symbolSignature[256];
sprintf_s(symbolSignature, "extern void %s(const uint64 ip, cpu::CpuRegs& regs)", symbolName);
// create information
InterruptInfo info;
strcpy_s(info.m_name, symbolName);
strcpy_s(info.m_signature, symbolSignature);
info.m_type = type;
info.m_index = index;
info.m_useCount = 1;
m_exportedInterrupts.push_back(info);
// use the generated symbol
outSymbolName = symbolName;
outSignature = symbolSignature;
return true;
}*/
void Generator::StartBlock(const uint64 addr, const bool multiAddress, const char* optionalFunctionName)
{
// start new file
if (!m_currentFile || m_currentFile->m_numInstructions > m_instructionsPerFile)
StartFile(NULL);
// close previous block
CloseBlock();
// block header
m_currentFile->m_codePrinter->Printf("//////////////////////////////////////////////////////\n");
m_currentFile->m_codePrinter->Printf("// Block at %06Xh\n", addr);
if (optionalFunctionName)
m_currentFile->m_codePrinter->Printf("// Function '%s'\n", optionalFunctionName);
m_currentFile->m_codePrinter->Printf("//////////////////////////////////////////////////////\n");
// start block
m_blockBaseAddress = addr;
m_blockReturnAddress = addr; // nothing
m_isBlockMultiAddress = multiAddress || m_forceMultiAddressBlocks;
m_lastMultiAddressSwitch = 0xFFFFFFFF;
m_inBlock = true;
// format block symbol
char blockSymbolName[128];
sprintf_s(blockSymbolName, "_code__block%08llX", addr);
// finish current block
if (!m_exportedBlocks.empty() && m_exportedBlocks.back().m_addressEnd == 0)
{
m_exportedBlocks.back().m_addressEnd = addr;
}
// add new block
BlockInfo info;
strcpy_s(info.m_name, blockSymbolName);
info.m_addressStart = addr;
info.m_addressEnd = 0;
info.m_multiAddress = multiAddress;
m_exportedBlocks.push_back(info);
// block function header
m_currentFile->m_codePrinter->Printf("uint64 __fastcall %s( uint64 ip, cpu::CpuRegs& regs )\n", blockSymbolName);
m_currentFile->m_codePrinter->Print("{\n");
m_currentFile->m_codePrinter->Indent(1);
// block addr switch
if (m_isBlockMultiAddress)
{
m_currentFile->m_codePrinter->Printf("const uint32 local_instr = (uint32)(ip - 0x%08llX) / 4;\n", addr);
m_currentFile->m_codePrinter->Print("switch ( local_instr )\n");
m_currentFile->m_codePrinter->Print("{\n");
m_currentFile->m_codePrinter->Indent(1);
// todo: optional multi address protection
m_currentFile->m_codePrinter->Printf("default:\truntime::InvalidAddress(ip, 0x%08llX);\n", m_blockBaseAddress);
}
// stats
m_totalNumBlocks += 1;
m_currentFile->m_numBlocks += 1;
}
void Generator::AddCodef(const uint64 addr, const char* txt, ...)
{
char buffer[8192];
va_list args;
va_start(args, txt);
vsprintf_s(buffer, sizeof(buffer), txt, args);
va_end(args);
AddCode(addr, buffer);
}
void Generator::AddCode(const uint64 addr, const char* code)
{
// WTF ?
if (!m_currentFile)
{
m_logOutput->Error("CodeGen: Trying to add code outside file");
return;
}
// no block ?
if (!m_inBlock)
{
m_logOutput->Error("CodeGen: Trying to add code outside block");
return;
}
// block addr switch
if (m_isBlockMultiAddress)
{
const auto switchIndex = (addr - m_blockBaseAddress) / 4;
if (switchIndex != m_lastMultiAddressSwitch)
{
m_lastMultiAddressSwitch = switchIndex;
m_currentFile->m_codePrinter->Printf(" /* %08Xh */ case %4d: \t\t", addr, switchIndex, addr);
}
else
{
m_currentFile->m_codePrinter->Printf("/* %08Xh case %4d:*/\t\t", addr, switchIndex, addr);
}
}
// add code line
m_currentFile->m_codePrinter->Print(code);
// advance the address pointer
m_lastGeneratedCodeAddress = addr;
m_blockReturnAddress = addr + 4; // addr + instr size, HACK
// stats
m_totalNumInstructions += 1;
m_currentFile->m_numInstructions += 1;
}
void Generator::AddMakeFile(const std::wstring& tempPath, const std::wstring& outFilePath)
{
// create new file (project file)
StartFile("autocode.vcxproj", false);
// Platform name config name
const std::string configName = m_forceMultiAddressBlocks ? "debug " : "release";
const std::string platformName = "x64";
// FAKE XML
m_currentFile->m_codePrinter->Print("<?xml version=\"1.0\" encoding=\"utf-8\"?>\n");
m_currentFile->m_codePrinter->Print(" <Project DefaultTargets=\"Build\" ToolsVersion=\"17.0\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\n");
m_currentFile->m_codePrinter->Print(" <ItemGroup Label=\"ProjectConfigurations\">\n");
m_currentFile->m_codePrinter->Print(" <ProjectConfiguration Include=\"Build|x64\">\n");
m_currentFile->m_codePrinter->Print(" <Configuration>Build</Configuration>\n");
m_currentFile->m_codePrinter->Print(" <Platform>x64</Platform>\n");
m_currentFile->m_codePrinter->Print(" </ProjectConfiguration>\n");
m_currentFile->m_codePrinter->Print(" </ItemGroup>\n");
m_currentFile->m_codePrinter->Print(" <PropertyGroup Label=\"Globals\">\n");
m_currentFile->m_codePrinter->Print(" <ProjectGuid>{D9FC1B76-CB60-481B-B288-6EF63DE94065}</ProjectGuid>\n");
m_currentFile->m_codePrinter->Print(" <Keyword>Win32Proj</Keyword>\n");
m_currentFile->m_codePrinter->Print(" <RootNamespace>autocode</RootNamespace>\n");
m_currentFile->m_codePrinter->Print(" </PropertyGroup>\n");
m_currentFile->m_codePrinter->Print(" <Import Project=\"$(VCTargetsPath)\\Microsoft.Cpp.Default.props\" />\n");
m_currentFile->m_codePrinter->Print(" <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Build|x64'\" Label=\"Configuration\">\n");
m_currentFile->m_codePrinter->Print(" <ConfigurationType>DynamicLibrary</ConfigurationType>\n");
m_currentFile->m_codePrinter->Print(" <UseDebugLibraries>false</UseDebugLibraries>\n");
m_currentFile->m_codePrinter->Printf(" <WholeProgramOptimization>false</WholeProgramOptimization>\n");
m_currentFile->m_codePrinter->Print(" <CharacterSet>Unicode</CharacterSet>\n");
m_currentFile->m_codePrinter->Print(" <PlatformToolset>v141</PlatformToolset>\n");
m_currentFile->m_codePrinter->Print(" </PropertyGroup>\n");
m_currentFile->m_codePrinter->Print(" <Import Project=\"$(VCTargetsPath)\\Microsoft.Cpp.props\" />\n");
m_currentFile->m_codePrinter->Print(" <ImportGroup Label=\"ExtensionSettings\">\n");
m_currentFile->m_codePrinter->Print(" </ImportGroup>\n");
m_currentFile->m_codePrinter->Print(" <ImportGroup Condition=\"'$(Configuration)|$(Platform)'=='Build|x64'\" Label=\"PropertySheets\">\n");
m_currentFile->m_codePrinter->Print(" <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\n");
m_currentFile->m_codePrinter->Print(" </ImportGroup>\n");
m_currentFile->m_codePrinter->Print(" <PropertyGroup Label=\"UserMacros\" />\n");
m_currentFile->m_codePrinter->Print(" <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Build|x64'\">\n");
m_currentFile->m_codePrinter->Print(" <LinkIncremental>false</LinkIncremental>\n");
m_currentFile->m_codePrinter->Print(" <OutDir>..\\build\\</OutDir>\n");
m_currentFile->m_codePrinter->Print(" <IntDir>..\\build\\</IntDir>\n");
m_currentFile->m_codePrinter->Print(" </PropertyGroup>\n");
m_currentFile->m_codePrinter->Print(" <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Build|x64'\">\n");
m_currentFile->m_codePrinter->Print(" <ClCompile>\n");
m_currentFile->m_codePrinter->Print(" <WarningLevel>Level3</WarningLevel>\n");
m_currentFile->m_codePrinter->Print(" <PrecompiledHeader>\n");
m_currentFile->m_codePrinter->Print(" </PrecompiledHeader>\n");
m_currentFile->m_codePrinter->Print(" <Optimization>MaxSpeed</Optimization>\n");
m_currentFile->m_codePrinter->Print(" <FunctionLevelLinking>true</FunctionLevelLinking>\n");
m_currentFile->m_codePrinter->Print(" <IntrinsicFunctions>true</IntrinsicFunctions>\n");
m_currentFile->m_codePrinter->Print(" <PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_USRDLL;AUTOCODE_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>\n");
m_currentFile->m_codePrinter->Print(" <MultiProcessorCompilation>true</MultiProcessorCompilation>\n");
m_currentFile->m_codePrinter->Print(" </ClCompile>\n");
m_currentFile->m_codePrinter->Print(" <Link>\n");
m_currentFile->m_codePrinter->Print(" <SubSystem>Windows</SubSystem>\n");
m_currentFile->m_codePrinter->Print(" <GenerateDebugInformation>true</GenerateDebugInformation>\n");
m_currentFile->m_codePrinter->Printf(" <EnableCOMDATFolding>false</EnableCOMDATFolding>\n");
m_currentFile->m_codePrinter->Print(" <OptimizeReferences>true</OptimizeReferences>\n");
m_currentFile->m_codePrinter->Printf(" <OutputFile>%ls</OutputFile>\n", outFilePath.c_str());
m_currentFile->m_codePrinter->Print(" </Link>\n");
m_currentFile->m_codePrinter->Print(" </ItemDefinitionGroup>\n");
m_currentFile->m_codePrinter->Print(" <ItemGroup>\n");
for (uint32 i = 0; i < m_files.size() - 1; ++i)
{
std::wstring fullPath = tempPath + L"code/";
fullPath += m_files[i]->m_fileName;
m_currentFile->m_codePrinter->Printf(" <ClCompile Include=\"%ls\" />\n", fullPath.c_str());
}
m_currentFile->m_codePrinter->Print(" </ItemGroup>\n");
m_currentFile->m_codePrinter->Print(" <Import Project=\"$(VCTargetsPath)\\Microsoft.Cpp.targets\" />\n");
m_currentFile->m_codePrinter->Print(" <ImportGroup Label=\"ExtensionTargets\">\n");
m_currentFile->m_codePrinter->Print(" </ImportGroup>\n");
m_currentFile->m_codePrinter->Print("</Project>\n");
// save
CloseFile();
}
static bool GetKeyData(HKEY hRootKey, const wchar_t *subKey, const wchar_t* value, void* data, DWORD cbData)
{
HKEY hKey;
if (ERROR_SUCCESS != RegOpenKeyExW(hRootKey, subKey, 0, KEY_QUERY_VALUE, &hKey))
return false;
if (ERROR_SUCCESS != RegQueryValueExW(hKey, value, NULL, NULL, (LPBYTE)data, &cbData))
{
RegCloseKey(hKey);
return false;
}
RegCloseKey(hKey);
return true;
}
static std::wstring GetMSBuildDir()
{
wchar_t msBuildPath[512];
return L"C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\Community\\MSBuild\\15.0\\Bin\\";
if (GetKeyData(HKEY_LOCAL_MACHINE, L"SOFTWARE\\Microsoft\\MSBuild\\ToolsVersions\\17.0", L"MSBuildToolsPath", msBuildPath, sizeof(msBuildPath)))
return msBuildPath;
if (GetKeyData(HKEY_LOCAL_MACHINE, L"SOFTWARE\\Microsoft\\MSBuild\\ToolsVersions\\4.0", L"MSBuildToolsPath", msBuildPath, sizeof(msBuildPath)))
return msBuildPath;
if (GetKeyData(HKEY_LOCAL_MACHINE, L"SOFTWARE\\Microsoft\\MSBuild\\ToolsVersions\\3.5", L"MSBuildToolsPath", msBuildPath, sizeof(msBuildPath)))
return msBuildPath;
if (GetKeyData(HKEY_LOCAL_MACHINE, L"SOFTWARE\\Microsoft\\MSBuild\\ToolsVersions\\2.0", L"MSBuildToolsPath", msBuildPath, sizeof(msBuildPath)))
return msBuildPath;
return std::wstring();
}
static std::wstring GetMSBuildPath()
{
std::wstring path = GetMSBuildDir();
if (!path.empty())
path += L"msbuild.exe";
return path;
}
const bool Generator::CompileModule(IGeneratorRemoteExecutor& executor, const std::wstring& tempPath, const std::wstring& outputFilePath)
{
// append some more stuff to the temp path based on the compilation platform
std::wstring fullTempPath = tempPath;
// generate glue file and the make file (vcproj)
AddGlueFile();
AddMakeFile(fullTempPath, outputFilePath);
// return the solution file path
std::wstring makeFilePath = fullTempPath;
makeFilePath += L"code/autocode.vcxproj";
// find the ms build
const auto msBuildPath = GetMSBuildPath();
if (msBuildPath.empty())
{
m_logOutput->Error("CodeGen: MSBuild toolchain not found");
return false;
}
// save files
for (uint32 i = 0; i<m_files.size(); ++i)
{
const auto* file = m_files[i];
m_logOutput->SetTaskProgress(i, (int)m_files.size());
m_logOutput->SetTaskName("Saving file '%ls'...", file->m_fileName);
std::wstring fullFilePath = fullTempPath + L"code/";
fullFilePath += file->m_fileName;
if (!file->m_codePrinter->Save(fullFilePath.c_str()))
{
m_logOutput->Error("CodeGen: Failed to save content to '%ls'", file->m_fileName);
return false;
}
}
// compile solution
std::wstring commandLine;
commandLine = L" \"";
commandLine += makeFilePath;
commandLine += L"\" ";
commandLine += L"/ds /t:build /verbosity:minimal /nologo /p:Platform=x64 /p:Configuration=Build";
// run the task
const auto retCode = executor.RunExecutable(*m_logOutput, msBuildPath, commandLine);
if (retCode != 0)
{
m_logOutput->Error("CodeGen: There were compilation errors");
return false;
}
// we are done
m_logOutput->Log("CodeGen: Stuff generated");
return true;
}
} // msvc
} // code
#endif
| {
"content_hash": "4b68603e99861d9249e310c4b9c207b8",
"timestamp": "",
"source": "github",
"line_count": 716,
"max_line_length": 232,
"avg_line_length": 36.32960893854749,
"alnum_prop": 0.662117484238044,
"repo_name": "rexdex/recompiler",
"id": "de2939b90dcafba949ed6a8f4ee6ecfbbaab12dc",
"size": "26012",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "dev/src/recompiler_core/codeGeneratorMSVC.cpp",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Batchfile",
"bytes": "489"
},
{
"name": "C",
"bytes": "1103685"
},
{
"name": "C++",
"bytes": "3279941"
},
{
"name": "FLUX",
"bytes": "478"
},
{
"name": "HLSL",
"bytes": "28070"
}
],
"symlink_target": ""
} |
package org.dasein.cloud.util.requester.streamprocessors;
import javax.annotation.Nullable;
import java.io.IOException;
import java.io.InputStream;
/**
* @author Vlad Munthiu
*/
public interface StreamProcessor<T> {
@Nullable T read(InputStream inputStream, Class<T> classType) throws IOException;
@Nullable String write(T object);
}
| {
"content_hash": "568064421eccfe457fd496cbcf45ea78",
"timestamp": "",
"source": "github",
"line_count": 15,
"max_line_length": 85,
"avg_line_length": 23.266666666666666,
"alnum_prop": 0.7621776504297995,
"repo_name": "daniellemayne/dasein-cloud-core_old",
"id": "87de11831f39cd7e05b810a89a7744068b39c6f3",
"size": "1138",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/main/java/org/dasein/cloud/util/requester/streamprocessors/StreamProcessor.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "2052"
},
{
"name": "Java",
"bytes": "2215859"
}
],
"symlink_target": ""
} |
//////////////////////////////////////////////////////////
// QCADesigner //
// Copyright 2002 Konrad Walus //
// All Rights Reserved //
// Author: Konrad Walus //
// Email: qcadesigner@gmail.com //
// WEB: http://qcadesigner.ca/ //
//////////////////////////////////////////////////////////
//******************************************************//
//*********** PLEASE DO NOT REFORMAT THIS CODE *********//
//******************************************************//
// If your editor wraps long lines disable it or don't //
// save the core files that way. Any independent files //
// you generate format as you wish. //
//////////////////////////////////////////////////////////
// Please use complete names in variables and fucntions //
// This will reduce ramp up time for new people trying //
// to contribute to the project. //
//////////////////////////////////////////////////////////
// Contents: //
// //
// The bistable simulation engine. This engine treats //
// the circuit in a time-independent fashion, as a //
// system capable of 2 basis states. //
// //
//////////////////////////////////////////////////////////
#include <stdlib.h>
#include <math.h>
#include <stdio.h>
#include <string.h>
#include <time.h>
#ifdef GTK_GUI
#include "callback_helpers.h"
#include "support.h"
#else
#define _(s) s
#endif /* def GTK_GUI */
#include "objects/QCADCell.h"
#include "simulation.h"
#include "bistable_simulation.h"
#include "custom_widgets.h"
#include "global_consts.h"
//#define REDUCE_DEREF
//!Options for the bistable simulation engine
//This variable is used by multiple source files
bistable_OP bistable_options = {12800, FALSE, 1e-3, 65, 12.9, 9.8e-22, 3.8e-23, 0.0, 2.0, 100, 11.5, TRUE} ;
#ifdef GTK_GUI
extern int STOP_SIMULATION;
#else
static int STOP_SIMULATION = 0 ;
#endif /* def GTK_GUI */
// To each cell this structure is connected in order that this particular simulation engine can have its own variables. //
typedef struct
{
int number_of_neighbours;
QCADCell **neighbours;
int *neighbour_layer;
double *Ek;
double polarization;
} bistable_model;
static inline double bistable_determine_Ek (QCADCell *cell1, QCADCell *cell2, int layer_separation, bistable_OP *options);
static inline void bistable_refresh_all_Ek (int number_of_cell_layers, int *number_of_cells_in_layer, QCADCell ***sorted_cells, bistable_OP *options);
//-------------------------------------------------------------------//
// -- this is the main simulation procedure -- //
//-------------------------------------------------------------------//
simulation_data *run_bistable_simulation (int SIMULATION_TYPE, DESIGN *design, bistable_OP *options, VectorTable *pvt)
{
int i, j, k, l, total_cells = 0 ;
int icLayers, icCellsInLayer;
time_t start_time, end_time;
simulation_data *sim_data = NULL ;
// optimization variables //
int number_of_cell_layers = 0, *number_of_cells_in_layer = NULL ;
QCADCell ***sorted_cells = NULL ;
double clock_shift = (options->clock_high + options->clock_low)/2 + options->clock_shift;
double clock_prefactor = (options->clock_high - options->clock_low) * options->clock_amplitude_factor;
double four_pi_over_number_samples = 4.0 * PI / (double) options->number_of_samples;
double two_pi_over_number_samples = 2.0 * PI / (double) options->number_of_samples;
int idxMasterBitOrder = -1 ;
int max_iterations_per_sample = ((bistable_OP *)options)->max_iterations_per_sample;
BUS_LAYOUT_ITER bli ;
#ifdef REDUCE_DEREF
// For dereference reduction
int sim_data_number_samples = 0, pvt_vectors_icUsed = 0,
design_bus_layout_outputs_icUsed = 0, design_bus_layout_inputs_icUsed = 0, pvt_inputs_icUsed = 0 ;
int number_of_cells_in_current_layer = 0 ;
EXP_ARRAY *pvt_inputs = NULL ;
EXP_ARRAY *pvt_vectors = NULL ;
EXP_ARRAY *design_bus_layout_inputs = NULL ;
EXP_ARRAY *design_bus_layout_outputs = NULL ;
BUS_LAYOUT *design_bus_layout = NULL ;
#endif
// For randomization
int Nix, Nix1, idxCell1, idxCell2 ;
QCADCell *swap = NULL ;
// -- these used to be inside run_bistable_iteration -- //
int q, iteration = 0;
int stable = FALSE;
double old_polarization;
double new_polarization;
double tolerance = ((bistable_OP *)options)->convergence_tolerance;
double polarization_math;
bistable_model *current_cell_model = NULL ;
QCADCell *cell;
STOP_SIMULATION = FALSE;
// -- get the starting time for the simulation -- //
if((start_time = time (NULL)) < 0)
fprintf(stderr, "Could not get start time\n");
// Create per-layer cell arrays to be used by the engine
simulation_inproc_data_new (design, &number_of_cell_layers, &number_of_cells_in_layer, &sorted_cells) ;
for(i = 0; i < number_of_cell_layers; i++)
{
#ifdef REDUCE_DEREF
number_of_cells_in_current_layer = number_of_cells_in_layer[i] ;
for(j = 0; j < number_of_cells_in_current_layer ; j++)
#else
for(j = 0; j < number_of_cells_in_layer[i] ; j++)
#endif
{
// attach the model parameters to each of the simulation cells //
current_cell_model = g_malloc0 (sizeof(bistable_model)) ;
sorted_cells[i][j]->cell_model = current_cell_model;
// -- Clear the model pointers so they are not dangling -- //
current_cell_model->neighbours = NULL;
current_cell_model->Ek = NULL;
// -- set polarization in cell model for fixed cells since they are set with actual dot charges by the user -- //
if(QCAD_CELL_FIXED == sorted_cells[i][j]->cell_function)
current_cell_model->polarization = qcad_cell_calculate_polarization(sorted_cells[i][j]);
total_cells++;
}
}
// if we are performing a vector table simulation we consider only the activated inputs //
if(SIMULATION_TYPE == VECTOR_TABLE)
{
for (Nix = 0 ; Nix < pvt->inputs->icUsed ; Nix++)
if (!exp_array_index_1d (pvt->inputs, VT_INPUT, Nix).active_flag)
exp_array_index_1d (pvt->inputs, VT_INPUT, Nix).input->cell_function = QCAD_CELL_NORMAL ;
}
// write message to the command history window //
command_history_message (_("Simulation found %d inputs %d outputs %d total cells\n"), design->bus_layout->inputs->icUsed, design->bus_layout->outputs->icUsed, total_cells) ;
command_history_message(_("Starting initialization\n"));
set_progress_bar_visible (TRUE) ;
set_progress_bar_label (_("Bistable simulation:")) ;
// -- Initialize the simualtion data structure -- //
sim_data = g_malloc0 (sizeof(simulation_data));
sim_data->number_of_traces = design->bus_layout->inputs->icUsed + design->bus_layout->outputs->icUsed;
sim_data->number_samples = options->number_of_samples;
sim_data->trace = g_malloc0 (sizeof (struct TRACEDATA) * sim_data->number_of_traces);
// create and initialize the inputs into the sim data structure //
for (i = 0; i < design->bus_layout->inputs->icUsed; i++)
{
sim_data->trace[i].data_labels = g_strdup (qcad_cell_get_label (QCAD_CELL (exp_array_index_1d (design->bus_layout->inputs, BUS_LAYOUT_CELL, i).cell))) ;
sim_data->trace[i].drawtrace = TRUE;
sim_data->trace[i].trace_function = QCAD_CELL_INPUT;
sim_data->trace[i].data = g_malloc0 (sizeof (double) * sim_data->number_samples);
}
// create and initialize the outputs into the sim data structure //
for (i = 0; i < design->bus_layout->outputs->icUsed; i++)
{
sim_data->trace[i + design->bus_layout->inputs->icUsed].data_labels = g_strdup (qcad_cell_get_label(QCAD_CELL(exp_array_index_1d (design->bus_layout->outputs, BUS_LAYOUT_CELL, i).cell))) ;
sim_data->trace[i + design->bus_layout->inputs->icUsed].drawtrace = TRUE;
sim_data->trace[i + design->bus_layout->inputs->icUsed].trace_function = QCAD_CELL_OUTPUT;
sim_data->trace[i + design->bus_layout->inputs->icUsed].data = g_malloc0 (sizeof (double) * sim_data->number_samples);
}
// create and initialize the clock data //
sim_data->clock_data = g_malloc0 (sizeof (struct TRACEDATA) * 4);
for (i = 0; i < 4; i++)
{
sim_data->clock_data[i].data_labels = g_strdup_printf ("CLOCK %d", i);
sim_data->clock_data[i].drawtrace = 1;
sim_data->clock_data[i].trace_function = QCAD_CELL_FIXED; // Abusing the notation here
sim_data->clock_data[i].data = g_malloc0 (sizeof (double) * sim_data->number_samples);
if (SIMULATION_TYPE == EXHAUSTIVE_VERIFICATION)
for (j = 0; j < sim_data->number_samples; j++)
{
sim_data->clock_data[i].data[j] = clock_prefactor * cos (((double)(1 << design->bus_layout->inputs->icUsed)) * (double) j * four_pi_over_number_samples - PI * i / 2) + clock_shift ;
sim_data->clock_data[i].data[j] = CLAMP (sim_data->clock_data[i].data[j], options->clock_low, options->clock_high) ;
}
else
// if (SIMULATION_TYPE == VECTOR_TABLE)
for (j = 0; j < sim_data->number_samples; j++)
{
sim_data->clock_data[i].data[j] = clock_prefactor * cos (((double)pvt->vectors->icUsed) * (double)j * two_pi_over_number_samples - PI * i / 2) + clock_shift ;
sim_data->clock_data[i].data[j] = CLAMP (sim_data->clock_data[i].data[j], options->clock_low, options->clock_high) ;
}
}
// -- refresh all the kink energies to all the cells neighbours within the radius of effect -- //
bistable_refresh_all_Ek (number_of_cell_layers, number_of_cells_in_layer, sorted_cells, options);
// randomize the cells in the design so as to minimize any numerical problems associated //
// with having cells simulated in some predefined order. //
// randomize the order in which the cells are simulated //
//if (options->randomize_cells)
// for each layer ...
for (Nix = 0 ; Nix < number_of_cell_layers ; Nix++)
// ...perform as many swaps as there are cells therein
for (Nix1 = 0 ; Nix1 < number_of_cells_in_layer[Nix] ; Nix1++)
{
idxCell1 = rand () % number_of_cells_in_layer[Nix] ;
idxCell2 = rand () % number_of_cells_in_layer[Nix] ;
swap = sorted_cells[Nix][idxCell1] ;
sorted_cells[Nix][idxCell1] = sorted_cells[Nix][idxCell2] ;
sorted_cells[Nix][idxCell2] = swap ;
}
// -- get and print the total initialization time -- //
if((end_time = time (NULL)) < 0)
fprintf(stderr, "Could not get end time\n");
command_history_message("Total initialization time: %g s\n", (double)(end_time - start_time));
command_history_message("Starting Simulation\n");
set_progress_bar_fraction (0.0) ;
// perform the iterations over all samples //
#ifdef REDUCE_DEREF
// Dereference some structures now so we don't do it over and over in the loop
sim_data_number_samples = sim_data->number_samples ;
pvt_inputs = pvt->inputs ;
pvt_inputs_icUsed = pvt_inputs->icUsed ;
pvt_vectors = pvt->vectors ;
pvt_vectors_icUsed = pvt->vectors->icUsed ;
design_bus_layout = design->bus_layout ;
design_bus_layout_inputs = design_bus_layout->inputs ;
design_bus_layout_inputs_icUsed = design_bus_layout_inputs->icUsed ;
design_bus_layout_outputs = design_bus_layout->outputs ;
design_bus_layout_outputs_icUsed = design_bus_layout_outputs->icUsed ;
#else
#define sim_data_number_samples sim_data->number_samples
#define pvt_inputs pvt->inputs
#define pvt_inputs_icUsed pvt_inputs->icUsed
#define pvt_vectors pvt->vectors
#define pvt_vectors_icUsed pvt->vectors->icUsed
#define design_bus_layout design->bus_layout
#define design_bus_layout_inputs design_bus_layout->inputs
#define design_bus_layout_inputs_icUsed design_bus_layout_inputs->icUsed
#define design_bus_layout_outputs design_bus_layout->outputs
#define design_bus_layout_outputs_icUsed design_bus_layout_outputs->icUsed
#endif
for (j = 0; j < sim_data_number_samples ; j++)
{
if (j % 10 == 0)
{
// write the completion percentage to the command history window //
set_progress_bar_fraction ((float) j / (float) sim_data_number_samples) ;
// redraw the design if the user wants it to appear animated //
if(options->animate_simulation)
{
// update the charges to reflect the polarizations so that they can be animated //
for(icLayers = 0; icLayers < number_of_cell_layers; icLayers++)
{
#ifdef REDUCE_DEREF
number_of_cells_in_current_layer = number_of_cells_in_layer[icLayers] ;
for(icCellsInLayer = 0; icCellsInLayer < number_of_cells_in_current_layer; icCellsInLayer++)
#else
for(icCellsInLayer = 0; icCellsInLayer < number_of_cells_in_layer[icLayers]; icCellsInLayer++)
#endif
qcad_cell_set_polarization(sorted_cells[icLayers][icCellsInLayer],((bistable_model *)sorted_cells[icLayers][icCellsInLayer]->cell_model)->polarization);
}
#ifdef DESIGNER
redraw_async(NULL);
gdk_flush () ;
#endif /* def DESIGNER */
}
}
// -- for each of the (VECTOR_TABLE => active?) inputs -- //
if (EXHAUSTIVE_VERIFICATION == SIMULATION_TYPE)
for (idxMasterBitOrder = 0, design_bus_layout_iter_first (design_bus_layout, &bli, QCAD_CELL_INPUT, &i) ; i > -1 ; design_bus_layout_iter_next (&bli, &i), idxMasterBitOrder++)
((bistable_model *)exp_array_index_1d (design_bus_layout_inputs, BUS_LAYOUT_CELL, i).cell->cell_model)->polarization =
sim_data->trace[i].data[j] = (-1 * sin (((double)(1 << idxMasterBitOrder)) * (double)j * FOUR_PI / (double)sim_data_number_samples) > 0) ? 1 : -1 ;
else
// if (VECTOR_TABLE == SIMULATION_TYPE)
for (design_bus_layout_iter_first (design_bus_layout, &bli, QCAD_CELL_INPUT, &i) ; i > -1 ; design_bus_layout_iter_next (&bli, &i))
if (exp_array_index_1d (pvt_inputs, VT_INPUT, i).active_flag)
((bistable_model *)exp_array_index_1d (pvt_inputs, VT_INPUT, i).input->cell_model)->polarization =
sim_data->trace[i].data[j] = exp_array_index_2d (pvt_vectors, gboolean, (j * pvt_vectors_icUsed) / sim_data_number_samples, i) ? 1 : -1 ;
// randomize the order in which the cells are simulated to try and minimize numerical errors
// associated with the imposed simulation order.
if(options->randomize_cells)
// for each layer ...
for (Nix = 0 ; Nix < number_of_cell_layers ; Nix++)
{
// ...perform as many swaps as there are cells therein
#ifdef REDUCE_DEREF
number_of_cells_in_current_layer = number_of_cells_in_layer[Nix] ;
for (Nix1 = 0 ; Nix1 < number_of_cells_in_current_layer ; Nix1++)
#else
for (Nix1 = 0 ; Nix1 < number_of_cells_in_layer[Nix] ; Nix1++)
#endif
{
#ifdef REDUCE_DEREF
idxCell1 = rand () % number_of_cells_in_current_layer ;
idxCell2 = rand () % number_of_cells_in_current_layer ;
#else
idxCell1 = rand () % number_of_cells_in_layer[Nix] ;
idxCell2 = rand () % number_of_cells_in_layer[Nix] ;
#endif
swap = sorted_cells[Nix][idxCell1] ;
sorted_cells[Nix][idxCell1] = sorted_cells[Nix][idxCell2] ;
sorted_cells[Nix][idxCell2] = swap ;
}
}
// -- run the iteration with the given clock value -- //
// -- iterate until the entire design has stabalized -- //
iteration = 0;
stable = FALSE;
while (!stable && iteration < max_iterations_per_sample)
{
iteration++;
// -- assume that the circuit is stable -- //
stable = TRUE;
for (icLayers = 0; icLayers < number_of_cell_layers; icLayers++)
{
#ifdef REDUCE_DEREF
number_of_cells_in_current_layer = number_of_cells_in_layer[icLayers] ;
for (icCellsInLayer = 0 ; icCellsInLayer < number_of_cells_in_current_layer ; icCellsInLayer++)
#else
for (icCellsInLayer = 0 ; icCellsInLayer < number_of_cells_in_layer[icLayers] ; icCellsInLayer++)
#endif
{
cell = sorted_cells[icLayers][icCellsInLayer] ;
if (!((QCAD_CELL_INPUT == cell->cell_function)||
(QCAD_CELL_FIXED == cell->cell_function)))
{
current_cell_model = ((bistable_model *)cell->cell_model) ;
old_polarization = current_cell_model->polarization;
polarization_math = 0;
for (q = 0; q < current_cell_model->number_of_neighbours; q++)
polarization_math += (current_cell_model->Ek[q] * ((bistable_model *)current_cell_model->neighbours[q]->cell_model)->polarization) ;
// math = math / 2 * gamma
polarization_math /= (2.0 * sim_data->clock_data[cell->cell_options.clock].data[j]);
// -- calculate the new cell polarization -- //
// if math < 0.05 then math/sqrt(1+math^2) ~= math with error <= 4e-5
// if math > 100 then math/sqrt(1+math^2) ~= +-1 with error <= 5e-5
new_polarization =
(polarization_math > 1000.0) ? 1 :
(polarization_math < -1000.0) ? -1 :
(fabs (polarization_math) < 0.001) ? polarization_math :
polarization_math / sqrt (1 + polarization_math * polarization_math) ;
// -- set the polarization of this cell -- //
current_cell_model->polarization = new_polarization;
// If any cells polarization has changed beyond this threshold
// then the entire circuit is assumed to have not converged.
stable = (fabs (new_polarization - old_polarization) <= tolerance) ;
}
}
}
}//WHILE !STABLE
if (VECTOR_TABLE == SIMULATION_TYPE)
for (design_bus_layout_iter_first (design_bus_layout, &bli, QCAD_CELL_INPUT, &i) ; i > -1 ; design_bus_layout_iter_next (&bli, &i))
if (!exp_array_index_1d (pvt_inputs, VT_INPUT, i).active_flag)
sim_data->trace[i].data[j] = ((bistable_model *)exp_array_index_1d (pvt_inputs, VT_INPUT, i).input->cell_model)->polarization;
// -- collect all the output data from the simulation -- //
for (design_bus_layout_iter_first (design_bus_layout, &bli, QCAD_CELL_OUTPUT, &i) ; i > -1 ; design_bus_layout_iter_next (&bli, &i))
sim_data->trace[design_bus_layout_inputs_icUsed + i].data[j] = ((bistable_model *)exp_array_index_1d (design_bus_layout_outputs, BUS_LAYOUT_CELL, i).cell->cell_model)->polarization;
// -- if the user wants to stop the simulation then exit. -- //
if(TRUE == STOP_SIMULATION)
j = sim_data_number_samples ;
}//for number of samples
// Free the neigbours and Ek array introduced by this simulation//
for (k = 0; k < number_of_cell_layers; k++)
{
#ifdef REDUCE_DEREF
number_of_cells_in_current_layer = number_of_cells_in_layer[k] ;
for (l = 0 ; l < number_of_cells_in_current_layer ; l++)
#else
for (l = 0 ; l < number_of_cells_in_layer[k] ; l++)
#endif
{
g_free(((bistable_model *)sorted_cells[k][l]->cell_model)->neighbours);
g_free(((bistable_model *)sorted_cells[k][l]->cell_model)->neighbour_layer);
g_free(((bistable_model *)sorted_cells[k][l]->cell_model)->Ek);
}
}
simulation_inproc_data_free (&number_of_cell_layers, &number_of_cells_in_layer, &sorted_cells) ;
// Restore the input flag for the inactive inputs
if (VECTOR_TABLE == SIMULATION_TYPE)
for (i = 0 ; i < pvt_inputs_icUsed ; i++)
exp_array_index_1d (pvt_inputs, VT_INPUT, i).input->cell_function = QCAD_CELL_INPUT ;
// -- get and print the total simulation time -- //
if ((end_time = time (NULL)) < 0)
fprintf(stderr, "Could not get end time\n");
command_history_message ("Total simulation time: %g s\n", (double)(end_time - start_time));
set_progress_bar_visible (FALSE) ;
#ifndef REDUCE_DEREF
#undef sim_data_number_samples
#undef pvt_inputs
#undef pvt_inputs_icUsed
#undef pvt_vectors
#undef pvt_vectors_icUsed
#undef design_bus_layout
#undef design_bus_layout_inputs
#undef design_bus_layout_inputs_icUsed
#undef design_bus_layout_outputs
#undef design_bus_layout_outputs_icUsed
#endif
return sim_data;
}//run_bistable
//-------------------------------------------------------------------//
// -- refreshes the array of Ek values for each cell in the design this is done to speed up the simulation
// since we can assume no design changes durring the simulation we can precompute all the Ek values then
// use them as necessary throughout the simulation -- //
static inline void bistable_refresh_all_Ek (int number_of_cell_layers, int *number_of_cells_in_layer, QCADCell ***sorted_cells, bistable_OP *options)
{
int icNeighbours = 0 ;
bistable_model *cell_model = NULL ;
int i, j, k, idx = 0, total_number_of_cells = 0;
#ifdef REDUCE_DEREF
// dereference reduction variables
double radius_of_effect = ((bistable_OP *)options)->radius_of_effect ;
int number_of_cells_in_current_layer = 0 ;
#else
#define radius_of_effect ((bistable_OP *)options)->radius_of_effect
#endif
for(i = 0; i < number_of_cell_layers; i++)
total_number_of_cells+= number_of_cells_in_layer[i];
// calculate the Ek for each cell //
for(i = 0; i < number_of_cell_layers; i++)
{
#ifdef REDUCE_DEREF
number_of_cells_in_current_layer = number_of_cells_in_layer[i] ;
for(j = 0 ; j < number_of_cells_in_current_layer ; j++)
#else
for(j = 0 ; j < number_of_cells_in_layer[i] ; j++)
#endif
{
if (0 == (idx++) % 100)
set_progress_bar_fraction((double)idx / (double)total_number_of_cells);
cell_model = (bistable_model *)sorted_cells[i][j]->cell_model ;
// free up memory for cell model variables //
g_free (cell_model->neighbours);
g_free (cell_model->Ek);
g_free (cell_model->neighbour_layer);
cell_model->neighbours = NULL;
cell_model->neighbour_layer = NULL;
cell_model->Ek = NULL;
// select all neighbours within the provided radius //
cell_model->number_of_neighbours = icNeighbours =
select_cells_in_radius (sorted_cells, sorted_cells[i][j], radius_of_effect, i, number_of_cell_layers, number_of_cells_in_layer,
((bistable_OP *)options)->layer_separation, &(cell_model->neighbours), (int **)&(cell_model->neighbour_layer));
if (icNeighbours > 0)
{
cell_model->Ek = g_malloc0 (sizeof (double) * icNeighbours);
// ensure no memory allocation error has ocurred //
if (NULL == cell_model->neighbours ||
NULL == cell_model->Ek)
exit (1);
for (k = 0; k < icNeighbours; k++)
//if(cell_model->neighbours[k]==NULL)printf("Null neighbour prior to passing into determine Ek for k = %d\n", k);
// set the Ek of this cell and its neighbour //
cell_model->Ek[k] = bistable_determine_Ek (sorted_cells[i][j], cell_model->neighbours[k], ABS (i - cell_model->neighbour_layer[k]), options);
//printf("Ek = %e\n", cell_model->Ek[k]/1.602e-19);
}
}
}
#ifndef REDUCE_DEREF
#undef radius_of_effect
#endif
}//refresh_all_Ek
//-------------------------------------------------------------------//
// Determines the Kink energy of one cell with respect to another this is defined as the energy of those
// cells having opposite polarization minus the energy of those two cells having the same polarization -- //
static inline double bistable_determine_Ek (QCADCell *cell1, QCADCell *cell2, int layer_separation, bistable_OP *options)
{
int k;
int j;
double distance = 0;
double Constant = 1 / (FOUR_PI_EPSILON * options->epsilonR);
double vertical_separation = (double)layer_separation * ((bistable_OP *)options)->layer_separation;
static double same_polarization[4][4] =
{{ QCHARGE_SQUAR_OVER_FOUR, -QCHARGE_SQUAR_OVER_FOUR, QCHARGE_SQUAR_OVER_FOUR, -QCHARGE_SQUAR_OVER_FOUR },
{ -QCHARGE_SQUAR_OVER_FOUR, QCHARGE_SQUAR_OVER_FOUR, -QCHARGE_SQUAR_OVER_FOUR, QCHARGE_SQUAR_OVER_FOUR },
{ QCHARGE_SQUAR_OVER_FOUR, -QCHARGE_SQUAR_OVER_FOUR, QCHARGE_SQUAR_OVER_FOUR, -QCHARGE_SQUAR_OVER_FOUR },
{ -QCHARGE_SQUAR_OVER_FOUR, QCHARGE_SQUAR_OVER_FOUR, -QCHARGE_SQUAR_OVER_FOUR, QCHARGE_SQUAR_OVER_FOUR }};
static double diff_polarization[4][4] =
{{ -QCHARGE_SQUAR_OVER_FOUR, QCHARGE_SQUAR_OVER_FOUR, -QCHARGE_SQUAR_OVER_FOUR, QCHARGE_SQUAR_OVER_FOUR },
{ QCHARGE_SQUAR_OVER_FOUR, -QCHARGE_SQUAR_OVER_FOUR, QCHARGE_SQUAR_OVER_FOUR, -QCHARGE_SQUAR_OVER_FOUR },
{ -QCHARGE_SQUAR_OVER_FOUR, QCHARGE_SQUAR_OVER_FOUR, -QCHARGE_SQUAR_OVER_FOUR, QCHARGE_SQUAR_OVER_FOUR },
{ QCHARGE_SQUAR_OVER_FOUR, -QCHARGE_SQUAR_OVER_FOUR, QCHARGE_SQUAR_OVER_FOUR, -QCHARGE_SQUAR_OVER_FOUR }};
double EnergyDiff = 0;
double EnergySame = 0;
g_assert (cell1 != NULL);
g_assert (cell2 != NULL);
g_assert (cell1 != cell2);
for (k = 0; k < cell1->number_of_dots; k++)
for (j = 0; j < cell2->number_of_dots; j++)
{
// determine the distance between the dots //
distance = 1e-9 * determine_distance (cell1, cell2, k, j, vertical_separation);
g_assert (distance != 0);
EnergyDiff += diff_polarization[k][j] / distance;
EnergySame += same_polarization[k][j] / distance;
}//for other dots
//printf("energy difference = %e energy same = %e\n", EnergyDiff/1.602e-19, EnergySame/1.602e-19);
return Constant * (EnergyDiff - EnergySame);
}// bistable_determine_Ek
void bistable_options_dump (bistable_OP *bistable_options, FILE *pfile)
{
fprintf (stderr, "bistable_options_dump:\n") ;
fprintf (stderr, "bistable_options->number_of_samples = %d\n", bistable_options->number_of_samples) ;
fprintf (stderr, "bistable_options->animate_simulation = %s\n", bistable_options->animate_simulation ? "TRUE" : "FALSE") ;
fprintf (stderr, "bistable_options->convergence_tolerance = %e\n", bistable_options->convergence_tolerance) ;
fprintf (stderr, "bistable_options->radius_of_effect = %e [nm]\n", bistable_options->radius_of_effect) ;
fprintf (stderr, "bistable_options->epsilonR = %e\n", bistable_options->epsilonR) ;
fprintf (stderr, "bistable_options->clock_high = %e [J]\n", bistable_options->clock_high) ;
fprintf (stderr, "bistable_options->clock_low = %e [J]\n", bistable_options->clock_low) ;
fprintf (stderr, "bistable_options->clock_shift = %e [J]\n", bistable_options->clock_shift) ;
fprintf (stderr, "bistable_options->clock_amplitude_factor = %e\n", bistable_options->clock_amplitude_factor) ;
fprintf (stderr, "bistable_options->max_iterations_per_sample = %d\n", bistable_options->max_iterations_per_sample) ;
fprintf (stderr, "bistable_options->layer_separation = %e [nm]\n", bistable_options->layer_separation) ;
fprintf (stderr, "bistable_options->randomize_cells = %s\n", bistable_options->randomize_cells ? "TRUE" : "FALSE") ;
}
| {
"content_hash": "40245d193d9659c703542db8a23bf4f3",
"timestamp": "",
"source": "github",
"line_count": 583,
"max_line_length": 192,
"avg_line_length": 46.5728987993139,
"alnum_prop": 0.6246317030053035,
"repo_name": "jjenki11/blaze-chem-rendering",
"id": "a76412d3812ef3660929d3196a316d2086286bf7",
"size": "27152",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "qca_designer/QCADesigner-2.0.3/src/bistable_simulation.c",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Shell",
"bytes": "2476"
}
],
"symlink_target": ""
} |
A CHIP-8 emulator in rust
## License
Licensed under either of
* Apache License, Version 2.0, ([LICENSE-APACHE](LICENSE-APACHE) or http://www.apache.org/licenses/LICENSE-2.0)
* MIT license ([LICENSE-MIT](LICENSE-MIT) or http://opensource.org/licenses/MIT)
at your option.
| {
"content_hash": "b20c55435af3daf95d3546144188450f",
"timestamp": "",
"source": "github",
"line_count": 10,
"max_line_length": 112,
"avg_line_length": 27.7,
"alnum_prop": 0.7328519855595668,
"repo_name": "tompko/emulators",
"id": "97ef5ae672912c1825c20d5a4f406264ded54b84",
"size": "285",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "chip8/README.md",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Python",
"bytes": "3762"
},
{
"name": "Rust",
"bytes": "247133"
}
],
"symlink_target": ""
} |
license: Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF 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
http://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.
---
GlobalizationError
============
Globalization API からのエラーを表すオブジェクトです。
プロパティー
----------
- __code__: 以下のエラータイプを表すコードのうちの1つを表します _(Number)_
- GlobalizationError.UNKNOWN\_ERROR: 0
- GlobalizationError.FORMATTING\_ERROR: 1
- GlobalizationError.PARSING\_ERROR: 2
- GlobalizationError.PATTERN\_ERROR: 3
- __message__: エラーの内容を表すエラーメッセージを表します _(String)_
概要
-----------
このオブジェクトは Cordova によって作られ、エラー発生時にコールバック関数に渡されます。
サポートされているプラットフォーム
-------------------
- Android
- BlackBerry WebWorks (OS 5.0 以上)
- iOS
使用例
-------------
以下のエラーコールバックが呼び出されるとき、 `code: 3` と `message:` といったような文字列とともにポップアップダイアログが表示されます。
function errorCallback(error) {
alert('code: ' + error.code + '\n' +
'message: ' + error.message + '\n');
};
詳細な使用例
------------
<!DOCTYPE HTML>
<html>
<head>
<title>Cordova</title>
<script type="text/javascript" charset="utf-8" src="cordova-x.x.x.js"></script>
<script type="text/javascript" charset="utf-8">
function successCallback(date) {
alert('month:' + date.month +
' day:' + date.day +
' year:' + date.year + '\n');
}
function errorCallback(error) {
alert('code: ' + error.code + '\n' +
'message: ' + error.message + '\n');
};
function checkError() {
navigator.globalization.stringToDate(
'notADate',
successCallback,
errorCallback,
{selector:'foobar'}
);
}
</script>
</head>
<body>
<button onclick="checkError()">クリックしてエラーを発生</button>
</body>
</html>
| {
"content_hash": "f19bd410c3ee26114c18349351c2f670",
"timestamp": "",
"source": "github",
"line_count": 92,
"max_line_length": 87,
"avg_line_length": 27.782608695652176,
"alnum_prop": 0.5993740219092332,
"repo_name": "monaca/cordova-docs",
"id": "4f94ce30bfd5340a3e4b778afd988c6a8b46c9e8",
"size": "2976",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "docs/jp/2.9.0/cordova/globalization/GlobalizationError/globalizationerror.md",
"mode": "33261",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "10901"
},
{
"name": "JavaScript",
"bytes": "2656"
},
{
"name": "Ruby",
"bytes": "50079"
}
],
"symlink_target": ""
} |
package org.kuali.rice.kew.engine.node.dao.impl;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import javax.sql.DataSource;
import org.apache.ojb.broker.query.Criteria;
import org.apache.ojb.broker.query.QueryByCriteria;
import org.apache.ojb.broker.query.QueryFactory;
import org.apache.ojb.broker.query.ReportQueryByCriteria;
import org.kuali.rice.kew.engine.node.Branch;
import org.kuali.rice.kew.engine.node.NodeState;
import org.kuali.rice.kew.engine.node.RouteNode;
import org.kuali.rice.kew.engine.node.RouteNodeInstance;
import org.kuali.rice.kew.engine.node.dao.RouteNodeDAO;
import org.kuali.rice.kew.routeheader.DocumentRouteHeaderValue;
import org.kuali.rice.kew.service.KEWServiceLocator;
import org.springframework.dao.DataAccessException;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.jdbc.core.PreparedStatementCallback;
import org.springframework.jdbc.core.PreparedStatementCreator;
import org.springmodules.orm.ojb.support.PersistenceBrokerDaoSupport;
public class RouteNodeDAOOjbImpl extends PersistenceBrokerDaoSupport implements RouteNodeDAO {
private static final String ROUTE_NODE_ID = "routeNodeId";
private static final String ROUTE_NODE_INSTANCE_ID = "routeNodeInstanceId";
private static final String NODE_INSTANCE_ID = "nodeInstanceId";
private static final String DOCUMENT_ID = "documentId";
private static final String ROUTE_NODE_NAME = "routeNodeName";
private static final String DOCUMENT_TYPE_ID = "documentTypeId";
private static final String PROCESS_ID = "processId";
private static final String ACTIVE = "active";
private static final String COMPLETE = "complete";
private static final String FINAL_APPROVAL = "finalApprovalInd";
private static final String KEY = "key";
private static final String Route_Node_State_ID = "nodeStateId";
public void save(RouteNode node) {
getPersistenceBrokerTemplate().store(node);
}
public void save(RouteNodeInstance nodeInstance) {
// this is because the branch table relates to the node instance table - both through their keys - and
// ojb can't automatically do this bi-directional relationship
getPersistenceBrokerTemplate().store(nodeInstance.getBranch());
getPersistenceBrokerTemplate().store(nodeInstance);
}
public void save(NodeState nodeState) {
getPersistenceBrokerTemplate().store(nodeState);
}
public void save(Branch branch) {
getPersistenceBrokerTemplate().store(branch);
}
public RouteNode findRouteNodeById(String nodeId) {
Criteria criteria = new Criteria();
criteria.addEqualTo(ROUTE_NODE_ID, nodeId);
return (RouteNode) getPersistenceBrokerTemplate().getObjectByQuery(new QueryByCriteria(RouteNode.class, criteria));
}
public RouteNodeInstance findRouteNodeInstanceById(String nodeInstanceId) {
Criteria criteria = new Criteria();
criteria.addEqualTo(ROUTE_NODE_INSTANCE_ID, nodeInstanceId);
return (RouteNodeInstance) getPersistenceBrokerTemplate().getObjectByQuery(
new QueryByCriteria(RouteNodeInstance.class, criteria));
}
@SuppressWarnings(value = "unchecked")
public List<RouteNodeInstance> getActiveNodeInstances(String documentId) {
Criteria criteria = new Criteria();
criteria.addEqualTo(DOCUMENT_ID, documentId);
criteria.addEqualTo(ACTIVE, Boolean.TRUE);
return (List<RouteNodeInstance>) getPersistenceBrokerTemplate().getCollectionByQuery(
new QueryByCriteria(RouteNodeInstance.class, criteria));
}
private static final String CURRENT_ROUTE_NODE_NAMES_SQL = "SELECT rn.nm" +
" FROM krew_rte_node_t rn," +
" krew_rte_node_instn_t rni" +
" LEFT JOIN krew_rte_node_instn_lnk_t rnl" +
" ON rnl.from_rte_node_instn_id = rni.rte_node_instn_id" +
" WHERE rn.rte_node_id = rni.rte_node_id AND" +
" rni.doc_hdr_id = ? AND" +
" rnl.from_rte_node_instn_id IS NULL";
@Override
public List<String> getCurrentRouteNodeNames(final String documentId) {
final DataSource dataSource = KEWServiceLocator.getDataSource();
JdbcTemplate template = new JdbcTemplate(dataSource);
List<String> names = template.execute(new PreparedStatementCreator() {
public PreparedStatement createPreparedStatement(Connection connection) throws SQLException {
return connection.prepareStatement(CURRENT_ROUTE_NODE_NAMES_SQL);
}
}, new PreparedStatementCallback<List<String>>() {
public List<String> doInPreparedStatement(
PreparedStatement statement) throws SQLException, DataAccessException {
List<String> routeNodeNames = new ArrayList<String>();
statement.setString(1, documentId);
ResultSet rs = statement.executeQuery();
try {
while (rs.next()) {
String name = rs.getString("nm");
routeNodeNames.add(name);
}
} finally {
if (rs != null) {
rs.close();
}
}
return routeNodeNames;
}
}
);
return names;
}
@Override
public List<String> getActiveRouteNodeNames(final String documentId) {
final DataSource dataSource = KEWServiceLocator.getDataSource();
JdbcTemplate template = new JdbcTemplate(dataSource);
List<String> names = template.execute(
new PreparedStatementCreator() {
public PreparedStatement createPreparedStatement(Connection connection) throws SQLException {
PreparedStatement statement = connection.prepareStatement(
"SELECT rn.nm FROM krew_rte_node_t rn, krew_rte_node_instn_t rni WHERE rn.rte_node_id = rni.rte_node_id AND rni.doc_hdr_id = ? AND rni.actv_ind = ?");
return statement;
}
},
new PreparedStatementCallback<List<String>>() {
public List<String> doInPreparedStatement(PreparedStatement statement) throws SQLException, DataAccessException {
List<String> routeNodeNames = new ArrayList<String>();
statement.setString(1, documentId);
statement.setBoolean(2, Boolean.TRUE);
ResultSet rs = statement.executeQuery();
try {
while(rs.next()) {
String name = rs.getString("nm");
routeNodeNames.add(name);
}
} finally {
if(rs != null) {
rs.close();
}
}
return routeNodeNames;
}
});
return names;
}
@Override
public List<String> getTerminalRouteNodeNames(final String documentId) {
final DataSource dataSource = KEWServiceLocator.getDataSource();
JdbcTemplate template = new JdbcTemplate(dataSource);
List<String> names = template.execute(
new PreparedStatementCreator() {
public PreparedStatement createPreparedStatement(Connection connection) throws SQLException {
PreparedStatement statement = connection.prepareStatement(
"SELECT rn.nm" +
" FROM krew_rte_node_t rn," +
" krew_rte_node_instn_t rni" +
" LEFT JOIN krew_rte_node_instn_lnk_t rnl" +
" ON rnl.from_rte_node_instn_id = rni.rte_node_instn_id" +
" WHERE rn.rte_node_id = rni.rte_node_id AND" +
" rni.doc_hdr_id = ? AND" +
" rni.actv_ind = ? AND" +
" rni.cmplt_ind = ? AND" +
" rnl.from_rte_node_instn_id IS NULL");
return statement;
}
},
new PreparedStatementCallback<List<String>>() {
public List<String> doInPreparedStatement(PreparedStatement statement) throws SQLException, DataAccessException {
List<String> routeNodeNames = new ArrayList<String>();
statement.setString(1, documentId);
statement.setBoolean(2, Boolean.FALSE);
statement.setBoolean(3, Boolean.TRUE);
ResultSet rs = statement.executeQuery();
try {
while(rs.next()) {
String name = rs.getString("nm");
routeNodeNames.add(name);
}
} finally {
if(rs != null) {
rs.close();
}
}
return routeNodeNames;
}
});
return names;
}
@SuppressWarnings("unchecked")
public List<RouteNodeInstance> getTerminalNodeInstances(String documentId) {
Criteria criteria = new Criteria();
criteria.addEqualTo(DOCUMENT_ID, documentId);
criteria.addEqualTo(ACTIVE, Boolean.FALSE);
criteria.addEqualTo(COMPLETE, Boolean.TRUE);
// criteria.addIsNull("nextNodeInstances.routeNodeInstanceId");
// QueryByCriteria query = new QueryByCriteria(RouteNodeInstance.class, criteria);
// // we need to outer join here because we are looking for nodes with no nextNodeInstances
// query.setPathOuterJoin("nextNodeInstances");
// return (List) getPersistenceBrokerTemplate().getCollectionByQuery(query);
//forced to do this programmatically, for some reason the above code stopped working
List<RouteNodeInstance> terminalNodes = new ArrayList<RouteNodeInstance>();
List<RouteNodeInstance> routeNodeInstances = (List<RouteNodeInstance>) getPersistenceBrokerTemplate().getCollectionByQuery(new QueryByCriteria(RouteNodeInstance.class, criteria));
for (RouteNodeInstance routeNodeInstance : routeNodeInstances) {
if (routeNodeInstance.getNextNodeInstances().isEmpty()) {
terminalNodes.add(routeNodeInstance);
}
}
return terminalNodes;
}
public List getInitialNodeInstances(String documentId) {
Criteria criteria = new Criteria();
criteria.addEqualTo("initialDocumentRouteHeaderValues." + DOCUMENT_ID, documentId);
return (List) getPersistenceBrokerTemplate().getCollectionByQuery(
new QueryByCriteria(RouteNodeInstance.class, criteria));
}
public NodeState findNodeState(Long nodeInstanceId, String key) {
Criteria criteria = new Criteria();
criteria.addEqualTo(NODE_INSTANCE_ID, nodeInstanceId);
criteria.addEqualTo(KEY, key);
return (NodeState) getPersistenceBrokerTemplate().getObjectByQuery(new QueryByCriteria(NodeState.class, criteria));
}
public RouteNode findRouteNodeByName(String documentTypeId, String name) {
Criteria criteria = new Criteria();
criteria.addEqualTo(ROUTE_NODE_NAME, name);
criteria.addEqualTo(DOCUMENT_TYPE_ID, documentTypeId);
return (RouteNode) getPersistenceBrokerTemplate().getObjectByQuery(new QueryByCriteria(RouteNode.class, criteria));
}
public List<RouteNode> findFinalApprovalRouteNodes(String documentTypeId) {
Criteria criteria = new Criteria();
criteria.addEqualTo(DOCUMENT_TYPE_ID, documentTypeId);
criteria.addEqualTo(FINAL_APPROVAL, Boolean.TRUE);
return new ArrayList<RouteNode>(getPersistenceBrokerTemplate().getCollectionByQuery(new QueryByCriteria(RouteNode.class, criteria)));
}
public List findProcessNodeInstances(RouteNodeInstance process) {
Criteria crit = new Criteria();
crit.addEqualTo(PROCESS_ID, process.getRouteNodeInstanceId());
return (List) getPersistenceBrokerTemplate()
.getCollectionByQuery(new QueryByCriteria(RouteNodeInstance.class, crit));
}
public List findRouteNodeInstances(String documentId) {
Criteria criteria = new Criteria();
criteria.addEqualTo(DOCUMENT_ID, documentId);
return (List) getPersistenceBrokerTemplate().getCollectionByQuery(
new QueryByCriteria(RouteNodeInstance.class, criteria));
}
public void deleteLinksToPreNodeInstances(RouteNodeInstance routeNodeInstance) {
List<RouteNodeInstance> preNodeInstances = routeNodeInstance.getPreviousNodeInstances();
for (Iterator<RouteNodeInstance> preNodeInstanceIter = preNodeInstances.iterator(); preNodeInstanceIter.hasNext();) {
RouteNodeInstance preNodeInstance = (RouteNodeInstance) preNodeInstanceIter.next();
List<RouteNodeInstance> nextInstances = preNodeInstance.getNextNodeInstances();
nextInstances.remove(routeNodeInstance);
save(preNodeInstance);
}
}
public void deleteRouteNodeInstancesHereAfter(RouteNodeInstance routeNodeInstance) {
this.getPersistenceBrokerTemplate().delete(routeNodeInstance);
}
public void deleteNodeStateById(Long nodeStateId) {
Criteria criteria = new Criteria();
criteria.addEqualTo(Route_Node_State_ID, nodeStateId);
NodeState nodeState = (NodeState) getPersistenceBrokerTemplate().getObjectByQuery(
new QueryByCriteria(NodeState.class, criteria));
getPersistenceBrokerTemplate().delete(nodeState);
}
public void deleteNodeStates(List statesToBeDeleted) {
for (Iterator stateToBeDeletedIter = statesToBeDeleted.iterator(); stateToBeDeletedIter.hasNext();) {
Long stateId = (Long) stateToBeDeletedIter.next();
deleteNodeStateById(stateId);
}
}
}
| {
"content_hash": "b8e08c4625f5496db908f4e66542fb08",
"timestamp": "",
"source": "github",
"line_count": 300,
"max_line_length": 180,
"avg_line_length": 43.47,
"alnum_prop": 0.7083045778697953,
"repo_name": "ua-eas/ksd-kc5.2.1-rice2.3.6-ua",
"id": "265810773723ea829951e9d905b1318d10fe6b72",
"size": "13662",
"binary": false,
"copies": "2",
"ref": "refs/heads/development",
"path": "rice-middleware/impl/src/main/java/org/kuali/rice/kew/engine/node/dao/impl/RouteNodeDAOOjbImpl.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "542248"
},
{
"name": "Groovy",
"bytes": "2403552"
},
{
"name": "HTML",
"bytes": "3275928"
},
{
"name": "Java",
"bytes": "30805440"
},
{
"name": "JavaScript",
"bytes": "2486893"
},
{
"name": "PHP",
"bytes": "15766"
},
{
"name": "PLSQL",
"bytes": "108325"
},
{
"name": "SQLPL",
"bytes": "51212"
},
{
"name": "Shell",
"bytes": "1808"
},
{
"name": "XSLT",
"bytes": "109576"
}
],
"symlink_target": ""
} |
<?php
namespace Zf2FileUploader\Resource\Handler\Remover;
use Doctrine\ORM\EntityManager;
use Zf2FileUploader\Entity\ResourceInterface;
class DatabaseRemover implements RemoverInterface
{
/**
* @var EntityManager
*/
protected $entityManager;
public function __construct(EntityManager $entityManager)
{
$this->entityManager = $entityManager;
}
/**
* @param \Zf2FileUploader\Entity\ResourceInterface $entity
* @return boolean
*/
public function remove(ResourceInterface $entity)
{
$this->entityManager->remove($entity);
$this->entityManager->flush($entity);
return true;
}
}
| {
"content_hash": "d6a31611e197af77dd06f21633a017d4",
"timestamp": "",
"source": "github",
"line_count": 29,
"max_line_length": 63,
"avg_line_length": 23.103448275862068,
"alnum_prop": 0.6746268656716418,
"repo_name": "spalax/zf2-file-uploader",
"id": "804f2267989e1c24bf0c4fc7a30e6e1c123b46eb",
"size": "670",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/Zf2FileUploader/Resource/Handler/Remover/DatabaseRemover.php",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "PHP",
"bytes": "92538"
}
],
"symlink_target": ""
} |
import React from 'react';
import { mount } from 'enzyme';
import SideNavIcon from '../SideNavIcon';
describe('SideNavIcon', () => {
let mockProps;
beforeEach(() => {
mockProps = {
className: 'custom-classname',
children: <span>foo</span>,
small: false,
};
});
it('should render', () => {
const regular = mount(<SideNavIcon {...mockProps} />);
expect(regular).toMatchSnapshot();
const small = mount(<SideNavIcon {...mockProps} small />);
expect(small).toMatchSnapshot();
});
});
| {
"content_hash": "dd7e6b334072aeeb063c20a283fc03a3",
"timestamp": "",
"source": "github",
"line_count": 24,
"max_line_length": 62,
"avg_line_length": 22.333333333333332,
"alnum_prop": 0.5988805970149254,
"repo_name": "carbon-design-system/carbon-components",
"id": "f9242421e2b396f3ac4d49d52186864b7488e87a",
"size": "713",
"binary": false,
"copies": "3",
"ref": "refs/heads/main",
"path": "packages/react/src/components/UIShell/__tests__/SideNavIcon-test.js",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "552528"
},
{
"name": "HCL",
"bytes": "1049"
},
{
"name": "HTML",
"bytes": "226209"
},
{
"name": "JavaScript",
"bytes": "2220621"
},
{
"name": "Shell",
"bytes": "2502"
},
{
"name": "Vue",
"bytes": "2591"
}
],
"symlink_target": ""
} |
namespace xwalk {
const char kXWalkDBusServiceName[] = "org.crosswalkproject";
} // namespace xwalk
| {
"content_hash": "22d612070ed25dc8233a83b3e05d7e53",
"timestamp": "",
"source": "github",
"line_count": 5,
"max_line_length": 60,
"avg_line_length": 20.6,
"alnum_prop": 0.7475728155339806,
"repo_name": "wuhengzhi/crosswalk",
"id": "35a2389496af6c055d4f1862c02250263d7049f0",
"size": "314",
"binary": false,
"copies": "1",
"ref": "refs/heads/pauseResume",
"path": "dbus/xwalk_service_name.cc",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "C",
"bytes": "33431"
},
{
"name": "C++",
"bytes": "1008444"
},
{
"name": "Java",
"bytes": "458747"
},
{
"name": "JavaScript",
"bytes": "30419"
},
{
"name": "Objective-C",
"bytes": "17171"
},
{
"name": "Python",
"bytes": "145908"
},
{
"name": "Shell",
"bytes": "5179"
}
],
"symlink_target": ""
} |
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Security.Authentication;
using System.Security.Claims;
using System.Security.Policy;
using System.Web.Http;
using Common.Auth.Hashing;
using Common.Auth.Models;
using Common.Auth.Services;
using Common.Auth.WebTokens;
using Common.Db.Repository;
using Common.Db.UnitOfWork;
using Common.Web.ExtensionMethods;
namespace Common.Auth.Controllers
{
public abstract class SessionsController<TCredential, TRegister> : ApiController
where TCredential : BaseCredential, new() where TRegister : BaseCredential
{
protected readonly IUnitOfWork UnitOfWork;
private readonly IHashService _hashService;
private readonly IWebTokenService _webTokenService;
private readonly ISessionService _sessionService;
private readonly IRepository<TCredential> _credentialRepository;
protected SessionsController(
IUnitOfWork unitOfWork,
IHashService hashService,
IWebTokenService webTokenService,
ISessionService sessionService)
{
_credentialRepository = unitOfWork.CreateRepository<TCredential>();
UnitOfWork = unitOfWork;
_hashService = hashService;
_webTokenService = webTokenService;
_sessionService = sessionService;
}
protected abstract void CreateUser(TRegister registrationInfo, TCredential newCredentials);
protected virtual List<Claim> GetClaimsList(TCredential credentials)
{
return new List<Claim>();
}
protected ClaimsIdentity CreateIdentity(TCredential credentials)
{
var baseClaims = new List<Claim>
{
new Claim("Id", credentials.Id.ToString()),
};
baseClaims.AddRange(GetClaimsList(credentials));
return new ClaimsIdentity(baseClaims);
}
[HttpGet]
[AllowAnonymous]
public virtual HttpResponseMessage GetAuthenticatedId()
{
try
{
int id;
_webTokenService.Authenticate(Request);
_sessionService.TryGetId(out id);
return Request.CreateResponse(HttpStatusCode.OK, id);
}
catch (Exception) {}
return Request.CreateResponse<object>(HttpStatusCode.OK, -1);
}
[HttpPost]
[AllowAnonymous]
public virtual HttpResponseMessage Register(TRegister registrationInfo)
{
var name = registrationInfo.Name;
BaseCredential matchingCredentials = _credentialRepository
.Get(c => c.Name == name).FirstOrDefault();
if (matchingCredentials != null)
{
return Request.CreateErrorResponse(
HttpStatusCode.NotAcceptable,
new AuthenticationException("User Name '" + name + "' is already in use"));
}
var hashedPassword = _hashService.HashText(registrationInfo.Password);
var newCredentials = new TCredential
{
Name = registrationInfo.Name,
Password = hashedPassword
};
CreateUser(registrationInfo, newCredentials);
var id = newCredentials.Id;
var response = Request.CreateResponse(HttpStatusCode.OK, id);
response.SetCookie("id", id.ToString());
return _webTokenService.SetCookie(response, CreateIdentity(newCredentials), GetExpirationDate(newCredentials));
}
[HttpPost]
[AllowAnonymous]
public virtual HttpResponseMessage Login(TCredential credentials)
{
var name = credentials.Name;
var password = _hashService.HashText(credentials.Password);
var matchingCredentials = _credentialRepository
.Get(c => c.Name == name).SingleOrDefault();
if (matchingCredentials == null)
{
return Request.CreateErrorResponse(
HttpStatusCode.Unauthorized,
new AuthenticationException("No credentials are found with the name '" +
credentials.Name +
"'"));
}
else if (matchingCredentials.Password != password)
{
return Request.CreateErrorResponse(
HttpStatusCode.Unauthorized,
new AuthenticationException("The password provided is incorrect"));
}
var id = matchingCredentials.Id;
var response = Request.CreateResponse(HttpStatusCode.OK, id);
response.SetCookie("id", id.ToString());
return _webTokenService.SetCookie(response, CreateIdentity(matchingCredentials), GetExpirationDate(matchingCredentials));
}
[HttpPost]
public virtual HttpResponseMessage Logout()
{
var response = Request.CreateResponse();
response.ClearCookie("id");
return _webTokenService.ClearAuthentication(response);
}
[HttpPost]
public HttpResponseMessage ChangePassword(ChangePasswordInfo changePasswordInfo)
{
int id;
if (!_sessionService.TryGetId(out id))
{
return Request.CreateErrorResponse(
HttpStatusCode.Unauthorized,
new AuthenticationException("Could not find your Id. You must be signed in to change your password."));
}
var matchingCredentials = _credentialRepository.GetById(id);
if (matchingCredentials == null)
{
return Request.CreateErrorResponse(
HttpStatusCode.InternalServerError,
new AuthenticationException("Your credentials could not be found to change your password."));
}
var hashedOldPassword = _hashService.HashText(changePasswordInfo.OldPassword);
if (!hashedOldPassword.Equals(matchingCredentials.Password, StringComparison.InvariantCulture))
{
return Request.CreateErrorResponse(
HttpStatusCode.Unauthorized,
new AuthenticationException("The password you provided is incorrect."));
}
matchingCredentials.Password = _hashService.HashText(changePasswordInfo.NewPassword);
UnitOfWork.Save();
return Request.CreateResponse(HttpStatusCode.OK);
}
protected virtual DateTime GetExpirationDate(TCredential credential)
{
return DateTime.MaxValue;
}
}
public class ChangePasswordInfo
{
public string OldPassword { get; set; }
public string NewPassword { get; set; }
}
}
| {
"content_hash": "4c6f7c385e6966564bb831ffa2c468b7",
"timestamp": "",
"source": "github",
"line_count": 189,
"max_line_length": 133,
"avg_line_length": 37.164021164021165,
"alnum_prop": 0.6107630979498861,
"repo_name": "theoinglis/.net-common.auth",
"id": "f3b6e60aaece2028f36a73bfd042e0cbea407dd2",
"size": "7026",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "Controllers/SessionsController.cs",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C#",
"bytes": "19375"
}
],
"symlink_target": ""
} |
import path from 'path'
import parseArgs from 'minimist'
import cosmiconfig from 'cosmiconfig'
import createRelease, { NO_PREVIOUS_RELEASE } from './index'
const isTruthy = value =>
Boolean(value && !['false', '0', 'off', 'no'].includes(value.toLowerCase()))
const run = async () => {
const [, , ...argv] = process.argv
const args = parseArgs(argv)
const configPath = args.config ? path.resolve(args.config) : null
const preview = isTruthy(args.preview)
const overwrite = isTruthy(args.overwrite)
const tags = args._
if (tags.length === 0) {
throw new Error('No tags provided')
}
const config = await cosmiconfig('github-release', {
transform: async ({ config: _config, filePath }) => {
let { templatePath } = _config
if (typeof templatePath === 'string' && !path.isAbsolute(templatePath)) {
templatePath = path.resolve(path.dirname(filePath), templatePath)
}
return {
..._config,
templatePath,
}
},
}).load('./', configPath)
if (!config) {
throw new Error(
'No config file found. Create a github-release.config.js file or specify the path to the config file using the --config option'
)
}
return await Promise.all(
tags.map(async tag => {
try {
const result = await createRelease({
...config,
preview,
overwrite: overwrite || config.overwrite,
tag,
})
console.log(preview ? result : `Release ${tag} published at ${result}`)
} catch (err) {
if (err === NO_PREVIOUS_RELEASE) {
process.emitWarning(err)
} else {
throw err
}
}
})
)
}
run().catch(err => {
console.error(err)
process.exit(1)
})
| {
"content_hash": "1ff50d49359b4410f2ffc9ec1c36b3ea",
"timestamp": "",
"source": "github",
"line_count": 63,
"max_line_length": 133,
"avg_line_length": 27.682539682539684,
"alnum_prop": 0.595756880733945,
"repo_name": "mmiller42/create-github-release",
"id": "d855ddf9f01ce2734be3561b2d57c3b39ef50273",
"size": "1766",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/cli.js",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "HTML",
"bytes": "1131"
},
{
"name": "JavaScript",
"bytes": "10398"
}
],
"symlink_target": ""
} |
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>com.polydeucesys</groupId>
<artifactId>elasticsearch-logging-parent</artifactId>
<version>0.0.1-SNAPSHOT</version>
</parent>
<groupId>com.polydeucesys</groupId>
<artifactId>elasticsearch-logging-log4j</artifactId>
<version>0.0.1-SNAPSHOT</version>
<name>elasticsearch-log4j</name>
<description>A Log4J Appender which writes directly to ElasticSearch via a Jest client</description>
<inceptionYear>2014</inceptionYear>
<licenses>
<license>
<name>Apache2 License</name>
<url>https://www.apache.org/licenses/LICENSE-2.0</url>
<distribution>repo</distribution>
</license>
</licenses>
<organization>
<name>Polydeuce-Sys LLP</name>
</organization>
<developers>
<developer>
<id>kevin</id>
<name>Kevin</name>
<email>polydeuce.sys@gmail.com</email>
<organization>Polydeuce-Sys LLP</organization>
<roles>
<role>architect</role>
<role>developer</role>
</roles>
</developer>
</developers>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-failsafe-plugin</artifactId>
<version>2.18.1</version>
<configuration>
<systemPropertyVariables>
<testProperty>testVal</testProperty>
<it-elasticsearch-url>http://localhost:9200</it-elasticsearch-url>
<it-elasticsearch-index>log4j-it-index</it-elasticsearch-index>
<it-elasticsearch-doctype>log4j-it-doctype</it-elasticsearch-doctype>
</systemPropertyVariables>
</configuration>
<executions>
<execution>
<goals>
<goal>integration-test</goal>
<goal>verify</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
<reporting>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-report-plugin</artifactId>
<version>2.18.1</version>
<reportSets>
<reportSet>
<id>integration-tests</id>
<reports>
<report>failsafe-report-only</report>
</reports>
</reportSet>
</reportSets>
</plugin>
</plugins>
</reporting>
<dependencies>
<dependency>
<groupId>com.polydeucesys</groupId>
<artifactId>elasticsearch-logging-core</artifactId>
<version>0.0.1-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>com.polydeucesys</groupId>
<artifactId>elasticsearch-logging-core</artifactId>
<version>0.0.1-SNAPSHOT</version>
<type>test-jar</type>
<scope>test</scope>
</dependency>
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>1.2.17</version>
</dependency>
</dependencies>
</project> | {
"content_hash": "04cb648a4386998d2ba22a8b8c54714a",
"timestamp": "",
"source": "github",
"line_count": 98,
"max_line_length": 104,
"avg_line_length": 29.183673469387756,
"alnum_prop": 0.6884615384615385,
"repo_name": "poldeuce-sys/elasticsearch-logging",
"id": "6f30e80128875bba9437ad46dcf2ed9a2a22bf0f",
"size": "2860",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "elasticsearch-logging-log4j/pom.xml",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Java",
"bytes": "223964"
}
],
"symlink_target": ""
} |
package Google::Ads::GoogleAds::V11::Enums::ResponseContentTypeEnum;
use strict;
use warnings;
use Const::Exporter enums => [
UNSPECIFIED => "UNSPECIFIED",
RESOURCE_NAME_ONLY => "RESOURCE_NAME_ONLY",
MUTABLE_RESOURCE => "MUTABLE_RESOURCE"
];
1;
| {
"content_hash": "1df09d0c070ae6b7b262de2b1b92bd70",
"timestamp": "",
"source": "github",
"line_count": 12,
"max_line_length": 68,
"avg_line_length": 21.916666666666668,
"alnum_prop": 0.6920152091254753,
"repo_name": "googleads/google-ads-perl",
"id": "8a8c6d01cf0dbc0b4204c361ffc93190fe841ef5",
"size": "839",
"binary": false,
"copies": "1",
"ref": "refs/heads/main",
"path": "lib/Google/Ads/GoogleAds/V11/Enums/ResponseContentTypeEnum.pm",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Dockerfile",
"bytes": "73"
},
{
"name": "Perl",
"bytes": "5866064"
}
],
"symlink_target": ""
} |
package main
import (
"bufio"
"bytes"
"fmt"
"io"
"io/ioutil"
"log"
"os"
"os/user"
"path/filepath"
"regexp"
"strings"
"time"
)
type commitInfo struct {
hash string
commitDate time.Time
gover bool
logPath string
count, fails int
buildFailed bool
}
// getCommits returns the commit info for all of the revisions in the
// given git revision range, where the revision range is spelled as
// documented in gitrevisions(7). Commits are returned in reverse
// chronological order, most recent commit first (the same as
// git-rev-list(1)).
func getCommits(revRange []string, logPath string) []*commitInfo {
// Get commit sequence.
args := append(append([]string{"--no-walk"}, revRange...), "--")
hashes := lines(git("rev-list", args...))
commits := make([]*commitInfo, len(hashes))
commitMap := make(map[string]*commitInfo)
for i, hash := range hashes {
commits[i] = &commitInfo{
hash: hash,
logPath: logPath,
}
commitMap[hash] = commits[i]
}
// Get commit dates.
//
// TODO: This can produce a huge command line.
args = append([]string{"-s", "--format=format:%cI"}, hashes...)
dates := lines(git("show", args...))
for i := range commits {
d, err := time.Parse(time.RFC3339, dates[i])
if err != nil {
log.Fatalf("cannot parse commit date: %v", err)
}
commits[i].commitDate = d
}
// Get gover-cached builds. It's okay if this fails.
if fis, err := ioutil.ReadDir(goverDir()); err == nil {
for _, fi := range fis {
if ci := commitMap[fi.Name()]; ci != nil && fi.IsDir() {
ci.gover = true
}
}
}
// Load current benchmark state.
logf, err := os.Open(logPath)
if err != nil {
if !os.IsNotExist(err) {
log.Fatalf("opening %s: %v", logPath, err)
}
} else {
defer logf.Close()
parseLog(commitMap, logf)
}
return commits
}
// goverDir returns the directory containing gover-cached builds.
func goverDir() string {
cache := os.Getenv("XDG_CACHE_HOME")
if cache == "" {
home := os.Getenv("HOME")
if home == "" {
u, err := user.Current()
if err != nil {
home = u.HomeDir
}
}
cache = filepath.Join(home, ".cache")
}
return filepath.Join(cache, "gover")
}
// parseLog parses benchmark runs and failures from r and updates
// commits in commitMap.
func parseLog(commitMap map[string]*commitInfo, r io.Reader) {
scanner := bufio.NewScanner(r)
for scanner.Scan() {
b := scanner.Bytes()
switch {
case bytes.HasPrefix(b, []byte("commit: ")):
hash := scanner.Text()[len("commit: "):]
if ci := commitMap[hash]; ci != nil {
ci.count++
}
case bytes.HasPrefix(b, []byte("# FAILED at ")):
hash := scanner.Text()[len("# FAILED at "):]
if ci := commitMap[hash]; ci != nil {
ci.fails++
}
case bytes.HasPrefix(b, []byte("# BUILD FAILED at ")):
hash := scanner.Text()[len("# BUILD FAILED at "):]
if ci := commitMap[hash]; ci != nil {
ci.buildFailed = true
}
}
}
if err := scanner.Err(); err != nil {
log.Fatal("parsing benchmark log: ", err)
}
}
// binPath returns the file name of the binary for this commit.
func (c *commitInfo) binPath() string {
// TODO: This assumes the short commit hash is unique.
return fmt.Sprintf("bench.%s", c.hash[:7])
}
// failed returns whether commit c has failed and should not be run
// any more.
func (c *commitInfo) failed() bool {
return c.buildFailed || c.fails >= maxFails
}
// runnable returns whether commit c needs to be benchmarked at least
// one more time.
func (c *commitInfo) runnable() bool {
return !c.buildFailed && c.fails < maxFails && c.count < run.iterations
}
// partial returns true if this commit is both runnable and already
// has some runs.
func (c *commitInfo) partial() bool {
return c.count > 0 && c.runnable()
}
var commitRe = regexp.MustCompile(`^commit: |^# FAILED|^# BUILD FAILED`)
// cleanLog escapes lines in l that may confuse the log parser and
// makes sure l is newline terminated.
func cleanLog(l string) string {
l = commitRe.ReplaceAllString(l, "# $0")
if !strings.HasSuffix(l, "\n") {
l += "\n"
}
return l
}
// logRun updates c with a successful run.
func (c *commitInfo) logRun(out string) {
var log bytes.Buffer
fmt.Fprintf(&log, "commit: %s\n", c.hash)
fmt.Fprintf(&log, "commit-time: %s\n", c.commitDate.UTC().Format(time.RFC3339))
fmt.Fprintf(&log, "\n%s\n", cleanLog(out))
c.writeLog(log.String())
c.count++
}
// logFailed updates c with a failed run. If buildFailed is true, this
// is considered a permanent failure and buildFailed is set.
func (c *commitInfo) logFailed(buildFailed bool, out string) {
typ := "FAILED"
if buildFailed {
typ = "BUILD FAILED"
}
c.writeLog(fmt.Sprintf("# %s at %s\n# %s\n", typ, c.hash, strings.Replace(cleanLog(out), "\n", "\n# ", -1)))
if buildFailed {
c.buildFailed = true
} else {
c.fails++
}
}
// writeLog appends msg to c's log file. The caller is responsible for
// properly formatting it.
func (c *commitInfo) writeLog(msg string) {
logFile, err := os.OpenFile(c.logPath, os.O_CREATE|os.O_WRONLY|os.O_APPEND, 0666)
if err != nil {
log.Fatalf("opening %s: %v", c.logPath, err)
}
if _, err := logFile.WriteString(msg); err != nil {
log.Fatalf("writing to %s: %v", c.logPath, err)
}
if err := logFile.Close(); err != nil {
log.Fatalf("closing %s: %v", c.logPath, err)
}
}
| {
"content_hash": "88c4775ae1187e0435344cced8ab7096",
"timestamp": "",
"source": "github",
"line_count": 203,
"max_line_length": 109,
"avg_line_length": 26.1871921182266,
"alnum_prop": 0.6442814145974417,
"repo_name": "aclements/go-misc",
"id": "99af544db7e110e00d8d9419ce905cbf3169b9d2",
"size": "5476",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "benchmany/commits.go",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "Assembly",
"bytes": "7241"
},
{
"name": "Go",
"bytes": "480538"
},
{
"name": "HTML",
"bytes": "2640"
},
{
"name": "JavaScript",
"bytes": "7656"
},
{
"name": "Python",
"bytes": "24991"
},
{
"name": "Shell",
"bytes": "1717"
}
],
"symlink_target": ""
} |
namespace safe_browsing {
inline std::ostream& operator<<(std::ostream& os, const ThreatMetadata& meta) {
os << "{threat_pattern_type=" << static_cast<int>(meta.threat_pattern_type)
<< ", api_permissions=[";
for (auto p : meta.api_permissions)
os << p << ",";
return os << "], population_id=" << meta.population_id << "}";
}
} // namespace safe_browsing
#endif // COMPONENTS_SAFE_BROWSING_DB_TESTING_UTIL_H_
| {
"content_hash": "f603748baa0f6f56dfeee648d276f7df",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 79,
"avg_line_length": 32.92307692307692,
"alnum_prop": 0.6401869158878505,
"repo_name": "ssaroha/node-webrtc",
"id": "8447162681c2ce3ca5529e66358c0b83cd0df637",
"size": "838",
"binary": false,
"copies": "2",
"ref": "refs/heads/develop",
"path": "third_party/webrtc/include/chromium/src/components/safe_browsing_db/testing_util.h",
"mode": "33188",
"license": "bsd-2-clause",
"language": [
{
"name": "Batchfile",
"bytes": "6179"
},
{
"name": "C",
"bytes": "2679"
},
{
"name": "C++",
"bytes": "54327"
},
{
"name": "HTML",
"bytes": "434"
},
{
"name": "JavaScript",
"bytes": "42707"
},
{
"name": "Python",
"bytes": "3835"
}
],
"symlink_target": ""
} |
package alec_wam.CrystalMod.items.tools.backpack.upgrade;
import javax.annotation.Nullable;
import alec_wam.CrystalMod.CrystalMod;
import alec_wam.CrystalMod.handler.GuiHandler;
import alec_wam.CrystalMod.items.tools.backpack.BackpackUtil;
import alec_wam.CrystalMod.items.tools.backpack.IBackpack;
import alec_wam.CrystalMod.items.tools.backpack.IBackpackInventory;
import alec_wam.CrystalMod.items.tools.backpack.types.InventoryBackpack;
import alec_wam.CrystalMod.items.tools.backpack.types.NormalInventoryBackpack;
import alec_wam.CrystalMod.items.tools.backpack.upgrade.ItemBackpackUpgrade.BackpackUpgrade;
import alec_wam.CrystalMod.util.BlockUtil;
import alec_wam.CrystalMod.util.ItemStackTools;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.inventory.ClickType;
import net.minecraft.inventory.Container;
import net.minecraft.inventory.Slot;
import net.minecraft.item.ItemStack;
public class ContainerBackpackUpgrades extends Container
{
private final InventoryBackpackUpgrades upgradeInventory;
public ContainerBackpackUpgrades(InventoryPlayer playerInventory, InventoryBackpackUpgrades upgradeInventory)
{
this.upgradeInventory = upgradeInventory;
int slotPos = 44+(9*(5-upgradeInventory.getSize()));
for (int j = 0; j < upgradeInventory.getSize(); ++j)
{
this.addSlotToContainer(new Slot(upgradeInventory, j, slotPos + j * 18, 20));
}
for (int l = 0; l < 3; ++l)
{
for (int k = 0; k < 9; ++k)
{
this.addSlotToContainer(new Slot(playerInventory, k + l * 9 + 9, 8 + k * 18, l * 18 + 51));
}
}
for (int i1 = 0; i1 < 9; ++i1)
{
this.addSlotToContainer(new Slot(playerInventory, i1, 8 + i1 * 18, 109));
}
}
@Override
public boolean canInteractWith(EntityPlayer playerIn)
{
return this.upgradeInventory.isUsableByPlayer(playerIn);
}
/**
* Take a stack from the specified inventory slot.
*/
@Override
@Nullable
public ItemStack transferStackInSlot(EntityPlayer playerIn, int index)
{
ItemStack itemstack = ItemStackTools.getEmptyStack();
Slot slot = this.inventorySlots.get(index);
if (slot != null && slot.getHasStack())
{
ItemStack itemstack1 = slot.getStack();
itemstack = itemstack1.copy();
if (index < this.upgradeInventory.getSizeInventory())
{
if (!this.mergeItemStack(itemstack1, this.upgradeInventory.getSizeInventory(), this.inventorySlots.size(), true))
{
return ItemStackTools.getEmptyStack();
}
}
else if (!this.mergeItemStack(itemstack1, 0, this.upgradeInventory.getSizeInventory(), false))
{
return ItemStackTools.getEmptyStack();
}
if (ItemStackTools.isEmpty(itemstack1))
{
slot.putStack(ItemStackTools.getEmptyStack());
}
else
{
slot.onSlotChanged();
}
}
return itemstack;
}
@Override
public ItemStack slotClick(int slotId, int dragType, ClickType clickTypeIn, EntityPlayer player){
if(slotId >=0){
ItemStack backpack = this.upgradeInventory.getBackpack();
if(ItemStackTools.isValid(backpack)){
IBackpack type = BackpackUtil.getType(backpack);
if(type !=null){
Slot slot = getSlot(slotId);
ItemStack stack = slot.getStack();
if(ItemStackTools.isValid(stack)){
if(stack.getItem() instanceof ItemBackpackUpgrade){
if(stack.getMetadata() == BackpackUpgrade.POCKETS.getMeta()){
if(type instanceof IBackpackInventory){
InventoryBackpack inv = ((IBackpackInventory)type).getInventory(backpack);
if(inv !=null && inv instanceof NormalInventoryBackpack){
NormalInventoryBackpack normalInv = (NormalInventoryBackpack)inv;
if(ItemStackTools.isValid(normalInv.getToolStack(0)) || ItemStackTools.isValid(normalInv.getToolStack(1))){
return null;
}
}
}
}
}
}
}
}
}
return super.slotClick(slotId, dragType, clickTypeIn, player);
}
/**
* Called when the container is closed.
*/
@Override
public void onContainerClosed(EntityPlayer playerIn)
{
super.onContainerClosed(playerIn);
upgradeInventory.guiSaveSafe(playerIn);
//TODO Make work for block
BlockUtil.openWorksiteGui(CrystalMod.proxy.getClientPlayer(), GuiHandler.GUI_ID_BACKPACK, 0, 0, 0);
}
} | {
"content_hash": "4590ec4d4d7d52f467dbc011442912ae",
"timestamp": "",
"source": "github",
"line_count": 136,
"max_line_length": 129,
"avg_line_length": 36.56617647058823,
"alnum_prop": 0.6233661773577317,
"repo_name": "Alec-WAM/CrystalMod",
"id": "459787acd76cf0ac17a521cc998fd855b2491ce1",
"size": "4973",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/main/java/alec_wam/CrystalMod/items/tools/backpack/upgrade/ContainerBackpackUpgrades.java",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Batchfile",
"bytes": "36"
},
{
"name": "Java",
"bytes": "6735638"
}
],
"symlink_target": ""
} |
define("storage",
["jquery",
"categoryCollection",
"currenciesCollection",
"changesCollection",
"userModel"],
function(
$,
CategoriesCollection,
CurrenciesCollection,
ChangesCollection,
UserModel) {
// Properties
var user = new UserModel();
var categories = new CategoriesCollection();
var currencies = new CurrenciesCollection();
var changes = new ChangesCollection();
// This function intialise storage object.
var init = function(userid, callback){
// Number of collection to fetch asynchronously
var fetchNb = 4;
// Number of collection already fetched
var fetchCounter = 0;
// Get User model
user.set('id', userid);
user.fetch({
success: function (u) {
fetchCounter++;
if(fetchCounter === fetchNb){
callback();
}
}
});
// Get list of all categories
categories.fetch({
success: function() {
fetchCounter++;
if(fetchCounter === fetchNb){
callback();
}
}
});
// Get list of all currencies
currencies.fetch({
success: function() {
fetchCounter++;
if(fetchCounter === fetchNb){
callback();
}
}
});
// Get list of all change
changes.fetch({
success: function() {
fetchCounter++;
if(fetchCounter === fetchNb){
callback();
}
}
});
};
return {
init : init,
user : user,
categories : categories,
currencies : currencies,
changes : changes
}
});
| {
"content_hash": "276d96c20fe08921c8266c1768f378bd",
"timestamp": "",
"source": "github",
"line_count": 79,
"max_line_length": 49,
"avg_line_length": 19.670886075949365,
"alnum_prop": 0.5727155727155727,
"repo_name": "Natim/723e",
"id": "bf3da5c47950e34ea5b5256dfd49c229a89da31c",
"size": "1554",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "723e_web/app/scripts/storage.js",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "ApacheConf",
"bytes": "20968"
},
{
"name": "CSS",
"bytes": "164895"
},
{
"name": "HTML",
"bytes": "275980"
},
{
"name": "JavaScript",
"bytes": "67658"
},
{
"name": "Makefile",
"bytes": "259"
},
{
"name": "Python",
"bytes": "45924"
}
],
"symlink_target": ""
} |
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>tlc: 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.14.1 / tlc - 20181116</a></li>
</ul>
</div>
</div>
</div>
<div class="article">
<div class="row">
<div class="col-md-12">
<a href="../..">« Up</a>
<h1>
tlc
<small>
20181116
<span class="label label-info">Not compatible 👼</span>
</small>
</h1>
<p>📅 <em><script>document.write(moment("2022-06-12 09:12:12 +0000", "YYYY-MM-DD HH:mm:ss Z").fromNow());</script> (2022-06-12 09:12:12 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
conf-gmp 4 Virtual package relying on a GMP lib system installation
coq 8.14.1 Formal proof management system
dune 3.2.0 Fast, portable, and opinionated build system
ocaml 4.09.1 The OCaml compiler (virtual package)
ocaml-base-compiler 4.09.1 Official release 4.09.1
ocaml-config 1 OCaml Switch Configuration
ocamlfind 1.9.3 A library manager for OCaml
zarith 1.12 Implements arithmetic and logical operations over arbitrary-precision integers
# opam file:
opam-version: "2.0"
synopsis: "A general-purpose alternative to Coq's standard library"
maintainer: "francois.pottier@inria.fr"
authors: [
"Arthur Charguéraud <arthur.chargueraud@inria.fr>"
]
homepage: "https://github.com/charguer/tlc"
dev-repo: "git+https://github.com/charguer/tlc.git"
bug-reports: "https://github.com/charguer/tlc/issues"
license: "CeCILL-B"
build: [
[make "-j%{jobs}%"]
]
install: [
[make "install"]
]
depends: [
"ocaml"
"coq" {>= "8.6" & < "8.11"}
]
url {
src: "https://github.com/charguer/tlc/archive/20181116.tar.gz"
checksum: "md5=fb787df96d77da6ca63c760a5e34ca89"
}
</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-tlc.20181116 coq.8.14.1</code></dd>
<dt>Return code</dt>
<dd>5120</dd>
<dt>Output</dt>
<dd><pre>[NOTE] Package coq is already installed (current version is 8.14.1).
The following dependencies couldn't be met:
- coq-tlc -> coq < 8.11 -> ocaml < 4.06.0
base of this switch (use `--unlock-base' to force)
Your request can't be satisfied:
- No available version of coq satisfies the constraints
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-tlc.20181116</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">
Sources are on <a href="https://github.com/coq-bench">GitHub</a> © Guillaume Claret 🐣
</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": "fef7befff6c604f356f40dbe9aa07ac7",
"timestamp": "",
"source": "github",
"line_count": 166,
"max_line_length": 159,
"avg_line_length": 39.51204819277108,
"alnum_prop": 0.5301112974538802,
"repo_name": "coq-bench/coq-bench.github.io",
"id": "f68a273c6d164663dae6263466076c840710b082",
"size": "6585",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "clean/Linux-x86_64-4.09.1-2.0.6/released/8.14.1/tlc/20181116.html",
"mode": "33188",
"license": "mit",
"language": [],
"symlink_target": ""
} |
<?php
/**
* @package framework
* @subpackage model
*/
/**
* Represents an multi-select enumeration field.
* @package framework
* @subpackage model
*/
class MultiEnum extends Enum {
public function __construct($name, $enum = NULL, $default = NULL) {
// MultiEnum needs to take care of its own defaults
parent::__construct($name, $enum, null);
// Validate and assign the default
$this->default = null;
if($default) {
$defaults = preg_split('/ *, */',trim(trim($default, ',')));
foreach($defaults as $thisDefault) {
if(!in_array($thisDefault, $this->enum)) {
user_error("Enum::__construct() The default value '$thisDefault' does not match "
. "any item in the enumeration", E_USER_ERROR);
return;
}
}
$this->default = implode(',',$defaults);
}
}
public function requireField(){
$values=array(
'type'=>'set',
'parts'=>array(
'enums'=>$this->enum,
'character set'=>'utf8',
'collate'=> 'utf8_general_ci',
'default'=>Convert::raw2sql($this->default),
'table'=>$this->tableName,
'arrayValue'=>$this->arrayValue
)
);
DB::requireField($this->tableName, $this->name, $values);
}
/**
* Return a {@link CheckboxSetField} suitable for editing this field
*/
public function formField($title = null, $name = null, $hasEmpty = false, $value = "", $form = null,
$emptyString = null) {
if(!$title) $title = $this->name;
if(!$name) $name = $this->name;
$field = new CheckboxSetField($name, $title, $this->enumValues($hasEmpty), $value, $form);
return $field;
}
}
| {
"content_hash": "66646bb76c849a3c0fcaa68a5b2f7529",
"timestamp": "",
"source": "github",
"line_count": 66,
"max_line_length": 101,
"avg_line_length": 23.939393939393938,
"alnum_prop": 0.6151898734177215,
"repo_name": "harrymule/nairobi-webportal",
"id": "0ddb4bf57b60869484087f1858ee0ce966d6e428",
"size": "1580",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "framework/model/fieldtypes/MultiEnum.php",
"mode": "33188",
"license": "mit",
"language": [],
"symlink_target": ""
} |
@protocol PIRLoginViewDelegate;
@interface PIRLoginView : UIView
@property (nonatomic, weak) id<PIRLoginViewDelegate> delegate;
@property (nonatomic, strong) PIRUser *currentUser;
@end
@protocol PIRLoginViewDelegate <NSObject>
-(void)loginView:(PIRLoginView*)view didSignIn:(NSString*)userName passcode:(NSString*)passcode;
@end | {
"content_hash": "495bfa108cd971f4c7872b77269c0956",
"timestamp": "",
"source": "github",
"line_count": 14,
"max_line_length": 96,
"avg_line_length": 23.857142857142858,
"alnum_prop": 0.7994011976047904,
"repo_name": "kenshin03/pier_ios",
"id": "ffa71d8159f6305117845d4642bce5f711d80b42",
"size": "491",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "PierUp/Pier/Views/Login/PIRLoginView.h",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C",
"bytes": "11565"
},
{
"name": "Objective-C",
"bytes": "2311278"
},
{
"name": "Ruby",
"bytes": "623"
},
{
"name": "Shell",
"bytes": "6806"
}
],
"symlink_target": ""
} |
"use strict";
const Text = require('../../orm/attribute/text');
/**
* Define a Role attribute type for use by entities and the ORM system.
* @class
* @extends Defiant.Plugin.Orm.Text
* @memberOf Defiant.Plugin.Account
*/
class Role extends Text {
/**
* This function is called when the attribute needs to be added to a form.
* The entity is in formInstance.entity.
* @function
* @async
* @param {Defiant.Plugin.FormApi.ElementInstance} elementInstance
* The element instance to which form elements for this attribute must be
* added.
*/
async formInit(elementInstance) {
const formInstance = elementInstance.formInstance;
const FormApi = formInstance.context.engine.pluginRegistry.get('FormApi');
const Account = formInstance.context.engine.pluginRegistry.get('Account');
const Checkboxes = FormApi.getElement('Checkboxes');
// Find which roles are already present.
let accountRoles = new Set();
for (let attr of elementInstance.attribute) {
if (attr.value) {
accountRoles.add(attr.value);
}
}
let roles = [];
for (let roleKey of Object.keys(Account.role.data).sort()) {
let role = Account.role.data[roleKey];
if (!role.automatic) {
roles.push({
value: roleKey,
label: role.title,
defaultChecked: accountRoles.has(roleKey),
});
}
}
elementInstance.addInstance(Checkboxes.newInstance(formInstance.context, {
name: elementInstance.name,
data: {
checkboxes: roles,
description: 'Check the roles that should be applied.',
},
}));
//super.formInit(elementInstance);
}
/**
* This function is called when a form has passed validation and the attribute
* needs to be added to the `formInstance.entity` object.
* @function
* @async
* @param {Defiant.Plugin.FormApi.ElementInstance} elementInstance
* The element instance to which form elements for this attribute must be
* added.
*/
async formSubmit(elementInstance) {
const formInstance = elementInstance.formInstance;
const thisPost = formInstance.context.post[formInstance.id][elementInstance.name];
const submittedRoles = new Set(...Object.keys(thisPost || {}));
// First, iterate through the roles currently in the elementInstance, and
// ignore them if there is no change, and clear them if they should be
// removed.
let processedRoles = new Set();
for (let entry of elementInstance.attribute) {
if (entry.value && !submittedRoles.has(entry.value)) {
// Cause the role to be removed.
entry.value = '';
}
processedRoles.add(entry.value);
}
// Now check to see if there are any roles that need to be added.
const Account = formInstance.context.engine.pluginRegistry.get('Account');
for (let roleKey of Object.keys(Account.role.data)) {
if (!Account.role.data[roleKey].automatic && !processedRoles.has(roleKey) && thisPost && thisPost[roleKey]) {
elementInstance.attribute.push({value: roleKey});
}
}
}
}
Role.formType = 'group';
module.exports = Role;
| {
"content_hash": "4fd3cfe8f9111e2af66593da77406283",
"timestamp": "",
"source": "github",
"line_count": 96,
"max_line_length": 115,
"avg_line_length": 32.9375,
"alnum_prop": 0.6660341555977229,
"repo_name": "coreyp1/defiant",
"id": "fad5b3b172b7f6ee4f91ad81a2d5785f91de94fa",
"size": "3162",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "lib/plugin/account/orm/role.js",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "801"
},
{
"name": "HTML",
"bytes": "3383"
},
{
"name": "JavaScript",
"bytes": "316101"
}
],
"symlink_target": ""
} |
module Mongoid
module Extensions
module Range
# Get the range as arguments for a find.
#
# @example Get the range as find args.
# range.__find_args__
#
# @return [ Array ] The range as an array.
#
# @since 3.0.0
def __find_args__
to_a
end
# Turn the object from the ruby type we deal with to a Mongo friendly
# type.
#
# @example Mongoize the object.
# range.mongoize
#
# @return [ Hash ] The object mongoized.
#
# @since 3.0.0
def mongoize
::Range.mongoize(self)
end
# Is this a resizable object.
#
# @example Is this resizable?
# range.resizable?
#
# @return [ true ] True.
#
# @since 3.0.0
def resizable?
true
end
module ClassMethods
# Convert the object from its mongo friendly ruby type to this type.
#
# @example Demongoize the object.
# Range.demongoize({ "min" => 1, "max" => 5 })
#
# @param [ Hash ] object The object to demongoize.
#
# @return [ Range ] The range.
#
# @since 3.0.0
def demongoize(object)
object.nil? ? nil : ::Range.new(object["min"], object["max"], object["exclude_end"])
end
# Turn the object from the ruby type we deal with to a Mongo friendly
# type.
#
# @example Mongoize the object.
# Range.mongoize(1..3)
#
# @param [ Range ] object The object to mongoize.
#
# @return [ Hash ] The object mongoized.
#
# @since 3.0.0
def mongoize(object)
return nil if object.nil?
return object if object.is_a?(::Hash)
return object if object.is_a?(String)
hash = { "min" => object.first, "max" => object.last }
if object.respond_to?(:exclude_end?) && object.exclude_end?
hash.merge!("exclude_end" => true)
end
hash
end
end
end
end
end
::Range.__send__(:include, Mongoid::Extensions::Range)
::Range.extend(Mongoid::Extensions::Range::ClassMethods)
| {
"content_hash": "81f858635178cbbfd64d4a2e836c60e9",
"timestamp": "",
"source": "github",
"line_count": 85,
"max_line_length": 94,
"avg_line_length": 25.976470588235294,
"alnum_prop": 0.519927536231884,
"repo_name": "jonhyman/mongoid",
"id": "3ba6c9e81ba28c0f3aa059bee8f0e9cfb92219e0",
"size": "2256",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "lib/mongoid/extensions/range.rb",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Ruby",
"bytes": "3591077"
},
{
"name": "Shell",
"bytes": "3959"
}
],
"symlink_target": ""
} |
package com.vaadin.v7.client.widget.escalator.events;
import com.google.gwt.event.shared.GwtEvent;
/**
* Event fired when the row height changed in the Escalator's header, body or
* footer.
*
* @since 7.7
* @author Vaadin Ltd
*/
public class RowHeightChangedEvent extends GwtEvent<RowHeightChangedHandler> {
/**
* Handler type.
*/
public static final Type<RowHeightChangedHandler> TYPE = new Type<RowHeightChangedHandler>();
public static final Type<RowHeightChangedHandler> getType() {
return TYPE;
}
@Override
public Type<RowHeightChangedHandler> getAssociatedType() {
return TYPE;
}
@Override
protected void dispatch(RowHeightChangedHandler handler) {
handler.onRowHeightChanged(this);
}
}
| {
"content_hash": "5f26bdffa34826b8992aa9150b6a47b4",
"timestamp": "",
"source": "github",
"line_count": 34,
"max_line_length": 97,
"avg_line_length": 22.970588235294116,
"alnum_prop": 0.6991037131882202,
"repo_name": "asashour/framework",
"id": "99b26bb9de24ef4ce5b802b91ce28bda02063882",
"size": "1376",
"binary": false,
"copies": "3",
"ref": "refs/heads/master",
"path": "compatibility-client/src/main/java/com/vaadin/v7/client/widget/escalator/events/RowHeightChangedEvent.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "751129"
},
{
"name": "HTML",
"bytes": "102196"
},
{
"name": "Java",
"bytes": "24286594"
},
{
"name": "JavaScript",
"bytes": "131503"
},
{
"name": "Python",
"bytes": "33975"
},
{
"name": "Shell",
"bytes": "14720"
},
{
"name": "Smarty",
"bytes": "175"
}
],
"symlink_target": ""
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.