text
stringlengths 2
1.04M
| meta
dict |
|---|---|
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>HKN EOH 2015 Spark Demo</title>
<!-- ratchet meta -->
<!-- Sets initial viewport load and disables zooming -->
<meta name="viewport" content="initial-scale=1, maximum-scale=1">
<!-- Makes your prototype chrome-less once bookmarked to your phone's home screen -->
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<!-- styles -->
<link rel="stylesheet" href="ratchet/css/ratchet.min.css">
<link rel="stylesheet" href="ratchet/css/ratchet-theme-ios.min.css">
<!-- spark eoh demo -->
<link rel="stylesheet" type="text/css" href="css/spark.css">
<link rel="icon"
type="image/ico"
href="img/favicon.ico?version=newest">
<!-- js -->
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.3.14/angular.min.js"></script>
<script src="https://cdn.firebase.com/js/client/2.2.2/firebase.js"></script>
<script src="https://cdn.firebase.com/libs/angularfire/1.0.0/angularfire.min.js"></script>
<script src="ratchet/js/ratchet.min.js"></script>
<!-- TODO: Remove jQuery dependency, get Angular $http working. -->
<script src="https://code.jquery.com/jquery-2.1.3.min.js"></script>
<!-- spark eoh demo -->
<script src="js/spark.js"></script>
</head>
<body ng-app="sparkEohDemo">
<header class="bar bar-nav">
<h1 class="title">Spark EOH Demo</h1>
<a href="index.html"
data-ignore="push"
class="icon icon-left pull-left">
</a>
<a href="#instructionsModal" class="icon icon-info pull-right"></a>
</header>
<div class="content">
<div ng-controller="sparkController" id="spark" class="content-padded">
<table>
<tr>
<td class="led-col" ng-style="{'height':table_row_height}"></td>
<td class="spark-col" rowspan="{{total_rows}}">
<img id="spark-img" src="img/spark.png" alt="The Spark Core">
</td>
<td class="led-col" ng-style="{'height':table_row_height}"></td>
</tr>
<tr ng-repeat="i in getNumber(number_top_spacers) track by $index">
<td class="led-col" ng-style="{'height':table_row_height}"></td>
<td class="led-col" ng-style="{'height':table_row_height}"></td>
</tr>
<tr ng-repeat="i in getNumber(number_leds) track by $index">
<td class="led-col" ng-style="{'height':table_row_height}">
<div class="led"
ng-class="{
white : data.a{{ledNumber($index)}} && $even,
blue : data.a{{ledNumber($index)}} && $odd,
off : !data.a{{ledNumber($index)}}
}"
ng-click="toggleLed('a' + ledNumber($index))">
</div>
</td>
<td class="led-col" ng-style="{'height':table_row_height}">
<div class="led"
ng-class="{
white : data.d{{ledNumber($index)}} && $even,
red : data.d{{ledNumber($index)}} && $odd,
off : !data.d{{ledNumber($index)}}
}"
ng-click="toggleLed('d' + ledNumber($index))">
</div>
</td>
</tr>
<tr ng-repeat="i in getNumber(number_bottom_spacers) track by $index">
<td class="led-col" ng-style="{'height':table_row_height}"></td>
<td class="led-col" ng-style="{'height':table_row_height}"></td>
</tr>
</table>
</div>
</div>
<!-- Instructions Modal -->
<div id="instructionsModal" class="modal">
<header class="bar bar-nav">
<a class="icon icon-close pull-right" href="#instructionsModal"></a>
<h1 class="title">Instructions</h1>
</header>
<div class="content">
<img src="img/sparkcore.jpg" alt="A Spark Core" class="top-image">
<p class="content-padded">Press the LEDs on this website to make them turn on and off both on other people's phones, but also on the physical Spark microcontroller!</p>
<p class="content-padded">This exhibit demonstrates the full capabilities of a computing system that a computer engineer might make. It involves some hardware and some software, and communications over the internet. Making software which can interact in meaningful ways with the real world is one of the things that Computer Engineers work on.</p>
</div>
</div>
</body>
</html>
|
{
"content_hash": "11b68aefceece8f71a8819c6e62d37e0",
"timestamp": "",
"source": "github",
"line_count": 117,
"max_line_length": 353,
"avg_line_length": 38.914529914529915,
"alnum_prop": 0.5774214803426312,
"repo_name": "kashev/spark-eoh-demo",
"id": "a8a890b3fe67d0df473ab4f608f182f04f68cdd8",
"size": "4553",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "web/src/spark.html",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C++",
"bytes": "2226"
},
{
"name": "CSS",
"bytes": "1603"
},
{
"name": "HTML",
"bytes": "10771"
},
{
"name": "JavaScript",
"bytes": "7647"
}
],
"symlink_target": ""
}
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!-- NewPage -->
<html lang="en">
<head>
<!-- Generated by javadoc (version 1.7.0_65) on Wed Nov 12 13:03:03 UTC 2014 -->
<meta http-equiv="Content-Type" content="text/html" charset="UTF-8">
<title>Uses of Class com.hazelcast.map.tx.TransactionalMapProxySupport (Hazelcast Root 3.3.3 API)</title>
<meta name="date" content="2014-11-12">
<link rel="stylesheet" type="text/css" href="../../../../../stylesheet.css" title="Style">
</head>
<body>
<script type="text/javascript"><!--
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="Uses of Class com.hazelcast.map.tx.TransactionalMapProxySupport (Hazelcast Root 3.3.3 API)";
}
//-->
</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
<!-- ========= START OF TOP NAVBAR ======= -->
<div class="topNav"><a name="navbar_top">
<!-- -->
</a><a href="#skip-navbar_top" title="Skip navigation links"></a><a name="navbar_top_firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../../overview-summary.html">Overview</a></li>
<li><a href="../package-summary.html">Package</a></li>
<li><a href="../../../../../com/hazelcast/map/tx/TransactionalMapProxySupport.html" title="class in com.hazelcast.map.tx">Class</a></li>
<li class="navBarCell1Rev">Use</li>
<li><a href="../package-tree.html">Tree</a></li>
<li><a href="../../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../../index-all.html">Index</a></li>
<li><a href="../../../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li>Prev</li>
<li>Next</li>
</ul>
<ul class="navList">
<li><a href="../../../../../index.html?com/hazelcast/map/tx/class-use/TransactionalMapProxySupport.html" target="_top">Frames</a></li>
<li><a href="TransactionalMapProxySupport.html" target="_top">No Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_top">
<li><a href="../../../../../allclasses-noframe.html">All Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_top");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<a name="skip-navbar_top">
<!-- -->
</a></div>
<!-- ========= END OF TOP NAVBAR ========= -->
<div class="header">
<h2 title="Uses of Class com.hazelcast.map.tx.TransactionalMapProxySupport" class="title">Uses of Class<br>com.hazelcast.map.tx.TransactionalMapProxySupport</h2>
</div>
<div class="classUseContainer">
<ul class="blockList">
<li class="blockList">
<table border="0" cellpadding="3" cellspacing="0" summary="Use table, listing packages, and an explanation">
<caption><span>Packages that use <a href="../../../../../com/hazelcast/map/tx/TransactionalMapProxySupport.html" title="class in com.hazelcast.map.tx">TransactionalMapProxySupport</a></span><span class="tabEnd"> </span></caption>
<tr>
<th class="colFirst" scope="col">Package</th>
<th class="colLast" scope="col">Description</th>
</tr>
<tbody>
<tr class="altColor">
<td class="colFirst"><a href="#com.hazelcast.map.tx">com.hazelcast.map.tx</a></td>
<td class="colLast">
<div class="block">Contains implementation classes for <a href="../../../../../com/hazelcast/core/TransactionalMap.html" title="interface in com.hazelcast.core"><code>TransactionalMap</code></a></div>
</td>
</tr>
</tbody>
</table>
</li>
<li class="blockList">
<ul class="blockList">
<li class="blockList"><a name="com.hazelcast.map.tx">
<!-- -->
</a>
<h3>Uses of <a href="../../../../../com/hazelcast/map/tx/TransactionalMapProxySupport.html" title="class in com.hazelcast.map.tx">TransactionalMapProxySupport</a> in <a href="../../../../../com/hazelcast/map/tx/package-summary.html">com.hazelcast.map.tx</a></h3>
<table border="0" cellpadding="3" cellspacing="0" summary="Use table, listing subclasses, and an explanation">
<caption><span>Subclasses of <a href="../../../../../com/hazelcast/map/tx/TransactionalMapProxySupport.html" title="class in com.hazelcast.map.tx">TransactionalMapProxySupport</a> in <a href="../../../../../com/hazelcast/map/tx/package-summary.html">com.hazelcast.map.tx</a></span><span class="tabEnd"> </span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Class and Description</th>
</tr>
<tbody>
<tr class="altColor">
<td class="colFirst"><code>class </code></td>
<td class="colLast"><code><strong><a href="../../../../../com/hazelcast/map/tx/TransactionalMapProxy.html" title="class in com.hazelcast.map.tx">TransactionalMapProxy</a></strong></code>
<div class="block">Proxy implementation of <a href="../../../../../com/hazelcast/core/TransactionalMap.html" title="interface in com.hazelcast.core"><code>TransactionalMap</code></a> interface.</div>
</td>
</tr>
</tbody>
</table>
</li>
</ul>
</li>
</ul>
</div>
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<div class="bottomNav"><a name="navbar_bottom">
<!-- -->
</a><a href="#skip-navbar_bottom" title="Skip navigation links"></a><a name="navbar_bottom_firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../../overview-summary.html">Overview</a></li>
<li><a href="../package-summary.html">Package</a></li>
<li><a href="../../../../../com/hazelcast/map/tx/TransactionalMapProxySupport.html" title="class in com.hazelcast.map.tx">Class</a></li>
<li class="navBarCell1Rev">Use</li>
<li><a href="../package-tree.html">Tree</a></li>
<li><a href="../../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../../index-all.html">Index</a></li>
<li><a href="../../../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li>Prev</li>
<li>Next</li>
</ul>
<ul class="navList">
<li><a href="../../../../../index.html?com/hazelcast/map/tx/class-use/TransactionalMapProxySupport.html" target="_top">Frames</a></li>
<li><a href="TransactionalMapProxySupport.html" target="_top">No Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_bottom">
<li><a href="../../../../../allclasses-noframe.html">All Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_bottom");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<a name="skip-navbar_bottom">
<!-- -->
</a></div>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
<p class="legalCopy"><small>Copyright © 2014 <a href="http://www.hazelcast.com/">Hazelcast, Inc.</a>. All Rights Reserved.</small></p>
</body>
</html>
|
{
"content_hash": "f8200edfcb349ee9bbe27757e94a932f",
"timestamp": "",
"source": "github",
"line_count": 161,
"max_line_length": 325,
"avg_line_length": 42.22360248447205,
"alnum_prop": 0.6479847013827597,
"repo_name": "SoCe/SoCe",
"id": "c377d3fbeaff6c08d84200eb479bb83868d7e552",
"size": "6798",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "Server/thirdparty/hazelcast/hazelcast-3.3.3/docs/javadoc/com/hazelcast/map/tx/class-use/TransactionalMapProxySupport.html",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Java",
"bytes": "87092"
}
],
"symlink_target": ""
}
|
<?xml version="1.0" encoding="utf-8"?>
<merger version="3"><dataSet config="main"><source path="/Users/jbur0473/Documents/workspace/AdMobBanner/app/src/androidTest/assets"/></dataSet></merger>
|
{
"content_hash": "58d7cf40348fb6ed96e0bc6d358b589b",
"timestamp": "",
"source": "github",
"line_count": 2,
"max_line_length": 153,
"avg_line_length": 96,
"alnum_prop": 0.7447916666666666,
"repo_name": "JordanBurnett1210/AdMobBanner",
"id": "3b9c55e88c5a2b3a5e9eaa44c39462346af14958",
"size": "192",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "app/build/intermediates/incremental/mergeAssets/androidTest/debug/merger.xml",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Java",
"bytes": "495802"
}
],
"symlink_target": ""
}
|
<img src="https://raw.githubusercontent.com/Urucas/zoster/master/logo.png" />
# Zoster [](https://travis-ci.org/Urucas/zoster)
Zoster is a simple way to automate deep linking url testing on Android, by simply setting a few capabilities and maybe writting some code.
**Why?**
Testing that deep linking url works has always the same premise; open a website > click on a link > wait for an application to open > if it opens everything is ok. Zoster use a preseted appium test to automate this premise and test check it for you.
**How?**
Let's use an example. Following [Android Developer Guide](https://developer.android.com/guide/components/intents-common.html#Browser) we create an intent url, ```intent://zoster/hello?user=vruno#Intent;scheme=zoster;package=com.urucas.zoster_testapp;end```
that will open our open application and send ```vruno``` as user param, which will we setted in an ```TextView```, showing **Hello vruno!**.
To use this example with Zoster, we create the following capabilities:
```json
{
"name": "zoster test",
"intentURL" : "intent://zoster/hello?user=vruno#Intent;scheme=zoster;package=com.urucas.zoster_testapp;end",
"pkg" : "com.urucas.zoster_testapp",
"test_site": "http://labs.urucas.com/zoster"
}
```
Wait, I dont have a site to test... yet. No worries, you can set```"test_site":"local"``` in capabilities and Zoster will create a temporary server with your browsable intent url on a ```<a>``` element to click.
Next, we run zoster:
```bash
zoster --test [FULL_PATH_TO_CAPABILITIES]
```
This simple test will check you have the link on the site provided, click on it and evaluate that your application opens.
**What if dont just want to test my application opens after clicking on my browsable intent, I also want to test my application did some magic stuff ?**
Inception is here. Zoster let you include your own appium test to run after the application opens in native contexts, this way you can test the full flow of your browsable intent.
In this example, we said the ```user``` param will be setted in a ```TextView```, so to check the hole flow we create a small test to check our ```TextView``` is setted correctly and include it by setting the ```inception``` capability,
```json
{
"name": "zoster test with inception",
"intentURL" : "intent://zoster/hello?user=vruno#Intent;scheme=zoster;package=com.urucas.zoster_testapp;end",
"pkg" : "com.urucas.zoster_testapp",
"test_site": "http://labs.urucas.com/zoster",
"inception": {
"name" : "check_name",
"path" : "[FULL_PATH_TO_TEST]"
}
}
```
Our inception test will look like this,
```javascript
// appium code inside test
test_name = function(caps, driver, success, error) {
var params = caps.params[0];
var text_should_be = "Hello "+params.value+"!";
driver.elementById("com.urucas.zoster_testapp:id/textView", function(err, el) {
if(err) return error(err);
el.text(function(err, text){
if(err) return error(err);
if(text_should_be == text) {
success();
}else{
error(new Error("Test fails"));
}
});
});
}
module.exports["check_name"] = test_name;
```
Now, we have checked that our browsable intent has opened the Android app and also checked that the android application did the show the correct text.
<img src="https://raw.githubusercontent.com/Urucas/zoster/master/screen.png" />
**Capabilities**
```json
{
"name" : "your test name",
"pkg" : "your application package name",
"intentURL" : "your browsable intent url",
"apk_path" "optional, full path to your apk to install before running the test",
"inception" : {
"name" : "inception test name",
"path" : "full path to your inception test"
},
"test_site" : "site url containing the browsable intent link"
}
```
# Install
```bash
npm install -g zoster
zoster --test [full_path_to_capabilities]
```
**or**
```bash
git clone https://github.com/Urucas/zoster.git && cd zoster
npm install
npm start -- --test [full_path_to_capabilities]
```
# Requirements
* Appium
* ADB
|
{
"content_hash": "7208293d73e4cfd41ab726f25cdee83e",
"timestamp": "",
"source": "github",
"line_count": 103,
"max_line_length": 257,
"avg_line_length": 39.89320388349515,
"alnum_prop": 0.7060111949379411,
"repo_name": "Urucas/zoster",
"id": "fb0f61707c99ba0cbe8989db2f39144f90ce2636",
"size": "4109",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "README.md",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "2205"
},
{
"name": "HTML",
"bytes": "7704"
},
{
"name": "JavaScript",
"bytes": "28421"
},
{
"name": "Makefile",
"bytes": "481"
}
],
"symlink_target": ""
}
|
<div ng-controller="playerSelection as player" class=" centre animated fadeInDownBig">
<h1>Select Your Players</h1>
<h3>{{player.playerSelection.player1 | uppercase}} vs {{player.playerSelection.player2 | uppercase}}</h3>
<div ng-click="player.playerSelection.togglePlayer(1)" class="{{player.playerSelection.player1}} select">
</div>
<div ng-click="player.playerSelection.togglePlayer(2)" class="{{player.playerSelection.player2}} select">
</div>
<br/>
<button ui-sref="gameInProgress" ng-click="game.createGame()">Play!</button>
<button ui-sref="createGame.rules" >Rules</button>
<button ng-click="game.css.toggleCss()" >Change Skin</button>
</div>
<div ui-view></div>
|
{
"content_hash": "75d652d00189418492387c0b84bde5e2",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 109,
"avg_line_length": 54.69230769230769,
"alnum_prop": 0.7032348804500703,
"repo_name": "domTombola/Noughts-and-Crosses",
"id": "cd2f5de47b55a00e335510e00d925271a27c624e",
"size": "711",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "main-app/app/html/views/playerselection.html",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "2619"
},
{
"name": "HTML",
"bytes": "4498"
},
{
"name": "JavaScript",
"bytes": "35492"
}
],
"symlink_target": ""
}
|
<?php
namespace core\components\vcs;
use core\components\Component;
use core\exceptions\components\vcs\StageException;
use core\exceptions\components\vcs\VCSException;
use core\helpers\PathHelper;
use core\helpers\JSONHelper;
use core\interfaces\vcs\StageInterface;
class VCS extends Component
{
public static $algorithmFilePath = 'core/components/vcs/defaultUpdateAlgorithm.php';
public static $stagesNamespace = 'core\components\vcs\stages';
public static $stageArguments = [];
protected $updateStages;
protected $customStages = [];
protected $updateTrace = [];
public function __construct(string $algorithmFilePath = '')
{
$filepath = PathHelper::createPath($algorithmFilePath ?: self::$algorithmFilePath);
if (!PathHelper::isExist($filepath))
throw new VCSException("No such algorithm file.");
$this->updateStages = include $filepath;
self::setArgument('composerPath', PathHelper::getSettingsFolderPath() . '/tools/composer/composer.phar');
self::setArgument('phingPath', PathHelper::getSettingsFolderPath() . '/tools/phing/phing.phar');
}
public function update()
{
$this->generateUpdateAlgorithm();
foreach ($this->updateStages as $stage) {
$stageClass =$this->getStageClass($stage, true);
try {
/**
* @var $stageClass StageInterface;
*/
$this->updateTrace[] = $stage;
$stageClass::update();
} catch (StageException $e) {
echo "Stage exception: " . $e->getMessage() . PHP_EOL;
return $this->downgrade();
} catch (\Exception $e) {
echo "Fatal uncaught error: " . $e->getMessage() . PHP_EOL;
$this->downgrade();
}
}
return true;
}
private function downgrade() {
foreach (array_reverse($this->updateTrace) as $stage) {
$class = $this->getStageClass($stage);
try {
/**
* @var $class StageInterface;
*/
$class::downgrade();
array_pop($this->updateTrace);
} catch (StageException $e) {
echo $e->getMessage() . PHP_EOL;
} catch (\Exception $e) {
echo "Fatal uncaught error: " . $e->getMessage() . PHP_EOL;
}
}
return false;
}
public function generateUpdateAlgorithm() {
$this->addCustomStages();
$originalAlgorithm = $this->updateStages;
foreach ($originalAlgorithm as $stage) {
$this->checkDependsOn($stage);
}
}
public function addCustomStages()
{
$this->customStages = JSONHelper::decodeFromFile(
'config.json',
array('properties' => 'updateStages')
) ?? [];
// $existingStages = array_filter($this->customStages, function($value, $stage) {
// foreach ($this->updateStages as $existingStage) {
// if (strstr($stage, $existingStage) !== false) return true;
// }
// return false;
// }, ARRAY_FILTER_USE_BOTH);
//
//
// while(count($this->customStages)) {
// foreach ($this->updateStages as $existingStage) {
// if (strstr($stage, $existingStage) !== false) return true;
// }
// }
foreach ($this->customStages as $event => $stages) {
if (preg_match("/(?P<event>(before|after))\s+(?P<stage>\w+)/", $event, $matches)) {
$this->addNewStages($matches['stage'], $matches['event'], $stages);
} else {
throw new VCSException("Invalid stage format '$event'!");
}
}
unset($this->customStages);
}
public function checkDependsOn($stage)
{
/**
* @var $stageClass StageInterface
*/
$stageClass = $this->getStageClass($stage, true);
$currentStagePosition = array_search($stage, $this->updateStages);
foreach ($stageClass::dependsOn() as $dependStage) {
$dependStagePosition = array_search($dependStage, $this->updateStages);
if ($dependStagePosition === false) {
$this->addNewStages($stage, 'before', array($dependStage));
} else if ($dependStagePosition >= $currentStagePosition) {
throw new VCSException("$stage is depends on $dependStage, but it stays earlier in algorithm!");
}
/**
* @var $dependStageClass StageInterface
*/
$dependStageClass = $this->getStageClass($dependStage);
if (count($dependStageClass::dependsOn()))
$this->checkDependsOn($dependStage);
}
}
public function addNewStages(string $stage, string $type, array $stages)
{
if (array_search($stage, $this->updateStages) === false)
throw new VCSException("No such stage {$stage} in updateStages!");
$after = $type === 'after';
foreach ($stages as $addStage) {
if (array_search($addStage, $this->updateStages))
throw new VCSException("You can`t add 2 stages with same name! ($addStage)");
}
$stagePosition = array_search($stage, $this->updateStages);
$insertPosition = $stagePosition + $after > 0 ? $stagePosition + $after : 0;
array_splice($this->updateStages, $insertPosition, 0, $stages);
}
protected function getStageClass(string $stage, bool $create = false) {
if ($create) $this->createStageClass($stage);
return self::$stagesNamespace . "\\$stage";
}
protected function createStageClass(string $stage, bool $rewrite = false)
{
$stageClass = $this->getStageClass($stage, false);
$classPath = PathHelper::createPath(str_replace('\\', '/', $stageClass) . '.php');
if (!PathHelper::isExist($classPath) || $rewrite)
{
$content = include 'stages/stageTemplate.php';
file_put_contents(PathHelper::createPath($classPath), $content);
}
}
public static function getArgument(string $arg) {
if (!array_key_exists($arg, self::$stageArguments))
throw new VCSException("Stage argument $arg is not defined!");
return self::$stageArguments[$arg];
}
public static function setArgument(string $arg, $val, bool $rewrite = false) {
if (!$rewrite && array_key_exists($arg, self::$stageArguments))
throw new VCSException("Stage argument $arg is already exists. Apply \$rewrite param to true if you want to redefine it.");
self::$stageArguments[$arg] = $val;
}
}
|
{
"content_hash": "ca7fb72fa2e6d7fdbe09bb6418658d90",
"timestamp": "",
"source": "github",
"line_count": 202,
"max_line_length": 139,
"avg_line_length": 36.74752475247525,
"alnum_prop": 0.5239121648929005,
"repo_name": "savchukoleksii/beaversteward",
"id": "6d4932e68b56354c75da7bb9ecffb32fd8455bb1",
"size": "7423",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "www/application/core/components/vcs/VCS.php",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Batchfile",
"bytes": "3092"
},
{
"name": "CSS",
"bytes": "72333"
},
{
"name": "HTML",
"bytes": "1333071"
},
{
"name": "JavaScript",
"bytes": "5641362"
},
{
"name": "PHP",
"bytes": "5916922"
},
{
"name": "Roff",
"bytes": "29"
}
],
"symlink_target": ""
}
|
/**
* THIS FILE IS AUTO-GENERATED
* DON'T MAKE CHANGES HERE
*/
import { absDependencies } from './dependenciesAbs.generated';
import { addDependencies } from './dependenciesAdd.generated';
import { identityDependencies } from './dependenciesIdentity.generated';
import { invDependencies } from './dependenciesInv.generated';
import { maxDependencies } from './dependenciesMax.generated';
import { multiplyDependencies } from './dependenciesMultiply.generated';
import { sizeDependencies } from './dependenciesSize.generated';
import { sqrtDependencies } from './dependenciesSqrt.generated';
import { subtractDependencies } from './dependenciesSubtract.generated';
import { typedDependencies } from './dependenciesTyped.generated';
import { createSqrtm } from '../../factoriesAny.js';
export var sqrtmDependencies = {
absDependencies: absDependencies,
addDependencies: addDependencies,
identityDependencies: identityDependencies,
invDependencies: invDependencies,
maxDependencies: maxDependencies,
multiplyDependencies: multiplyDependencies,
sizeDependencies: sizeDependencies,
sqrtDependencies: sqrtDependencies,
subtractDependencies: subtractDependencies,
typedDependencies: typedDependencies,
createSqrtm: createSqrtm
};
|
{
"content_hash": "9c837e07b5948d301b4318c02c070ff0",
"timestamp": "",
"source": "github",
"line_count": 28,
"max_line_length": 72,
"avg_line_length": 44.535714285714285,
"alnum_prop": 0.7947072975140337,
"repo_name": "Michayal/michayal.github.io",
"id": "cf450f5311eb4f6a0c6a5f9663a3077aa3b5d8c9",
"size": "1247",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "node_modules/mathjs/es/entry/dependenciesAny/dependenciesSqrtm.generated.js",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "HTML",
"bytes": "16564"
},
{
"name": "JavaScript",
"bytes": "2034596"
},
{
"name": "Shell",
"bytes": "123"
}
],
"symlink_target": ""
}
|
<?php
namespace Loren138\CASServer\Models;
use Carbon\Carbon;
use Illuminate\Database\Eloquent\Model;
class CASTicket extends Model
{
/*
CREATE TABLE dbo.CASTicket (
id VARCHAR(32) PRIMARY KEY NOT NULL,
authenticationId bigint FOREIGN KEY REFERENCES dbo.CASAuthentication(id),
service VARCHAR(MAX) NOT NULL,
renew BIT NOT NULL,
used BIT NOT NULL,
createdAt DATETIME NOT NULL
);
GRANT SELECT on dbo.CASTicket to CAS_User;
GRANT INSERT on dbo.CASTicket to CAS_User;
GRANT UPDATE on dbo.CASTicket to CAS_User;
GRANT DELETE on dbo.CASTicket to CAS_User;
*/
public $table = 'CASTicket';
public $primaryKey = 'id';
public $dates = ['createdAt'];
public $maxInterval;
public $timestamps = false;
public $incrementing = false;
protected $casts = [
'renew' => 'boolean',
'used' => 'boolean'
];
public function __construct(array $attributes = [])
{
parent::__construct($attributes);
$this->maxInterval = config('casserver.timeouts.ticketTimeout', '10 seconds');
if (config('casserver.dateFormatOverride')) {
$this->setDateFormat(config('casserver.dateFormatOverride'));
}
}
private function randomStr($length, $keyspace = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ')
{
$str = '';
$max = mb_strlen($keyspace, '8bit') - 1;
for ($i = 0; $i < $length; ++$i) {
$str .= $keyspace[random_int(0, $max)];
}
return $str;
}
private function getId()
{
do {
$key = $this->randomStr(32);
if (!self::where('id', '=', $key)->exists()) {
return $key;
}
} while (true);
}
public function deleteTicketsForAuth($authId)
{
return $this->where('authenticationId', '=', $authId)->delete();
}
public function ticketPrefix()
{
return 'ST-'.str_replace(['http:', 'https:', '/'], '', url('/')).'-';
}
public function convertTicketId($id)
{
return $this->ticketPrefix().$id;
}
public function unconvertTicketId($id)
{
$prefix = $this->ticketPrefix();
if (substr($id, 0, strlen($prefix)) !== $prefix) {
return false;
}
return substr($id, strlen($prefix));
}
public function generateTicket(CASAuthentication $CASAuthentication, $service, $renew = false)
{
$ticket = new self;
$ticket->id = $this->getId();
$ticket->service = $service;
$ticket->renew = $renew;
$ticket->used = false;
$ticket->createdAt = Carbon::now();
$ticket->authentication()->associate($CASAuthentication);
$CASAuthentication->useAuth();
$ticket->save();
return $this->convertTicketId($ticket->id);
}
private function useTicket($ticket)
{
$ticket->used = true;
$ticket->save();
}
public function cleanup()
{
$created = Carbon::parse('-'.$this->maxInterval);
return $this->where('createdAt', '<', $created)->delete();
}
public function validate($ticket, $service, $renew = false)
{
if (!$ticket || !$service) {
return 'INVALID_REQUEST';
}
$ticket = $this->unconvertTicketId($ticket);
if (!$ticket) {
return 'INVALID_TICKET_SPEC';
}
// TODO? UNAUTHORIZED_SERVICE_PROXY INVALID_PROXY_CALLBACK
$created = Carbon::parse('-'.$this->maxInterval);
$t = $this->where('id', '=', $ticket)->where('createdAt', '>', $created)->first();
if (is_null($t) || $t->used) {
return 'INVALID_TICKET';
}
// There is a ticket, it has now been used no matter what so we mark it used
$this->useTicket($t);
if ($t->service !== $service) {
return 'INVALID_SERVICE';
}
if ($renew && !$t->renew) {
return 'INVALID_RENEW';
}
return $t;
}
public function authentication()
{
return $this->belongsTo('Loren138\CASServer\Models\CASAuthentication', 'authenticationId');
}
}
|
{
"content_hash": "aa347407d90d0d6a723f037d0aa828ca",
"timestamp": "",
"source": "github",
"line_count": 155,
"max_line_length": 117,
"avg_line_length": 27.36774193548387,
"alnum_prop": 0.5568128241395568,
"repo_name": "loren138/cas-server",
"id": "8c755bacd1fb2724b9b451188cf8785238e26ebf",
"size": "4242",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/Models/CASTicket.php",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "HTML",
"bytes": "7658"
},
{
"name": "PHP",
"bytes": "98220"
}
],
"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("SharedCode")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("SharedCode")]
[assembly: AssemblyCopyright("Copyright © 2014")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// 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")]
[assembly: ComVisible(false)]
|
{
"content_hash": "4383c2cca95a4fd6af753b6ac57700bb",
"timestamp": "",
"source": "github",
"line_count": 29,
"max_line_length": 84,
"avg_line_length": 35.758620689655174,
"alnum_prop": 0.7405978784956606,
"repo_name": "newnottakenname/FollowshowsWP",
"id": "2747848eadd19552b1a72ede09e57a22856f8609",
"size": "1040",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "SharedCode/Properties/AssemblyInfo.cs",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C#",
"bytes": "229617"
}
],
"symlink_target": ""
}
|
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Vibrant.Tsdb.Helpers;
namespace Vibrant.Tsdb.Sql.Serialization
{
internal static class SqlSerializer
{
public static BinaryReader CreateReader( Stream stream )
{
var reader = new BinaryReader( stream, TsdbEncodings.Default );
return reader;
}
public static BinaryWriter CreateWriter( Stream stream )
{
var writer = new BinaryWriter( stream, TsdbEncodings.Default );
return writer;
}
public static void SerializeEntry<TKey, TEntry>( BinaryWriter writer, TEntry entry )
where TEntry : ISqlEntry
{
entry.Write( writer );
}
public static TEntry DeserializeEntry<TKey, TEntry>( BinaryReader reader )
where TEntry : ISqlEntry, new()
{
var entry = new TEntry();
entry.Read( reader );
return entry;
}
public static void Serialize<TKey, TEntry>( IEnumerable<TEntry> entries, Action<TEntry, byte[]> serialized )
where TEntry : ISqlEntry
{
var stream = new MemoryStream();
var writer = CreateWriter( stream );
foreach( var entry in entries )
{
SerializeEntry<TKey, TEntry>( writer, entry );
writer.Flush();
var serializedEntry = stream.ToArray();
serialized( entry, serializedEntry );
// reset stream
stream.Seek( 0, SeekOrigin.Begin );
stream.SetLength( 0 );
}
writer.Dispose();
}
public static TEntry Deserialize<TKey, TEntry>( SqlEntry sqlEntry )
where TEntry : ISqlEntry, new()
{
var stream = new MemoryStream( sqlEntry.Data );
var reader = CreateReader( stream );
var entry = DeserializeEntry<TKey, TEntry>( reader );
entry.SetTimestamp( sqlEntry.Timestamp );
return entry;
}
public static List<TEntry> Deserialize<TKey, TEntry>( IEnumerable<SqlEntry> sqlEntries )
where TEntry : ISqlEntry, new()
{
List<TEntry> entries = new List<TEntry>();
foreach( var sqlEntry in sqlEntries )
{
entries.Add( Deserialize<TKey, TEntry>( sqlEntry ) );
}
return entries;
}
}
}
|
{
"content_hash": "82e160ce6050857a92c75317e9790ece",
"timestamp": "",
"source": "github",
"line_count": 83,
"max_line_length": 114,
"avg_line_length": 28.89156626506024,
"alnum_prop": 0.5996663886572143,
"repo_name": "MikaelGRA/Tsdb",
"id": "b91b14d658e850411887847aee60914dce398c5f",
"size": "2400",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/Vibrant.Tsdb.Sql/Serialization/SqlSerializer.cs",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C#",
"bytes": "530284"
}
],
"symlink_target": ""
}
|
<HTML><HEAD>
<TITLE>Review for Scream (1996)</TITLE>
<LINK REL="STYLESHEET" TYPE="text/css" HREF="/ramr.css">
</HEAD>
<BODY BGCOLOR="#FFFFFF" TEXT="#000000">
<H1 ALIGN="CENTER" CLASS="title"><A HREF="/Title?0117571">Scream (1996)</A></H1><H3 ALIGN=CENTER>reviewed by<BR><A HREF="/ReviewsBy?David+Landers">David Landers</A></H3><HR WIDTH="40%" SIZE="4">
<PRE> SCREAM
A film review by David Landers
Copyright 1997 David Landers</PRE>
<P>RATING: *** out of **** - 7.5 out of 10.0
CAST: David Arquette (Dewey Riley), Neve Campbell (Sidney Prescott), Courtney
Cox (Gale Weathers), Rose McGowan (Tatum Riley), Skeet Ulrich (Billy Loomis),
Drew Barrymore (Casey Becker)
DIRECTOR: Wes Craven
CERTIFICATION: R (USA) for excessive violence and language
YEAR OF PRODUCTION: 1996</P>
<P>SCREAM is the present-day version of a horror film directed towards the
teenage audience. And, like many of the same type of the past, it succeeded
greatly (a sequel began filming while it was still in theaters). From horror
and thriller director-supreme Wes Craven, SCREAM is a tense, nail-biter of a
movie that, in the words of its director, "everyone really enjoys".</P>
<P>In my opinion, SCREAM is very similar to other works of Wes Craven (A
NIGHTMARE ON ELM STREET comes to mind first). It is about, of course, a
bloodthirsty killer who is out to kill, more than anyone, teenagers. The
killer will not stop at anything to kill the one person he is really after,
and like all other movies of its type, SCREAM plays this out very well.</P>
<P>The movie begins in the Becker household, where young Casey Becker (Drew
Barrymore) is preparing her favorite movie-watching snack, popcorn. In the
middle of her preparation, the phone rings, and a very rough, cautious male
voice is on the other end. At first, the caller seems rather calm and
friendly. That is, until Casey mistakingly sets off a hidden inner rage in
the caller, who suddenly turns extremely violent. He makes very serious,
frightening threats to Casey and continues to call after she repeatedly hangs
up. The caller informs Casey that he wants her to play a game. The game is
a very sick one indeed, in which Casey answers movie trivia questions. If
she gets them wrong, the penalty is death. If she answers correct, well, the
caller *says* he'll leave her alone. Unfortunately for Casey, she never
escapes the killer alive.</P>
<P>The next day at, the small town is in shock. The high school is crawling
with police officers and reporters, including the "tabloid twit" Gale
Weathers (Courtney Cox). Gale Weathers is not liked at all by young Sidney
Prescott (Neve Campbell), for a very serious reason. Gale was one of the
leading reporters in a murder controversy involving Sidney's mother, who was
brutally raped and murdered in her own home. Gale continually insisted that
the accused killer was framed and that the real killer is still on the loose.
However, Sidney doesn't believe a word of this and certainly "has it in" for
Gale.</P>
<P>After the school day is over, the kids are basically still in shock, at least
for the most part. Sidney, probably most cautious due to upcoming one-year
anniversary of her mother's death, does not want to be alone in the house.
Her father is on a business trip, so Sidney pleads with her friend Tatum
(Rose McGowan) to come over. They agree that at seven o'clock Tatum will
come over. Somehow, Sidney falls asleep. She is awakened a little past
seven by the phone ringing. It's Tatum, informing her that she will be there
very soon. However, when the phone rings again, it isn't Tatum, but the same
guy who called Casey the night before, and supposedly attacked and killed
her. Sidney, too, falls victim to the caller, but barely escapes.</P>
<P>After the attack, Sidney's boyfriend Billy Loomis (Skeet Ulrich) shows up
quickly to comfort her. However, when Sidney notices that he is dressed in
black (as was the attacker) and is carrying a cellular phone, she assumes the
worst. Billy is arrested and held in jail, but later released because the
phone records show that he did not call her house. Another interesting fact
is that Sidney's father is missing and cannot be found. Dewey (David
Arquette), a town deputy and brother of Tatum, takes it upon himself to look
out for Sidney and to help find the killer. However, it becomes unclear who
will find who first, as the killer stops at nothing to reach his apparent
prime target.</P>
<P>>From here, the terrorizing continues, and it looks rather obvious that it
won't cease until the killer is stopped - for good. However, the killer's
identity is as yet unknown, and people can only assume. The rest of the
events in the movie are equally as suspenseful, and the climax is very well
crafted. If you are a fan of scary movies, as were most of the characters in
this film, then you should enjoy SCREAM. And if you *really* enjoyed, fear
not, a sequel will be out before you can, well, scream!</P>
<P><HR>* David Landers - <A HREF="mailto:dml@gwis.com">dml@gwis.com</A> - <A HREF="http://www.gwis.com/~dml/">http://www.gwis.com/~dml/</A> *<HR></P>
<HR><P CLASS=flush><SMALL>The review above was posted to the
<A HREF="news:rec.arts.movies.reviews">rec.arts.movies.reviews</A> newsgroup (<A HREF="news:de.rec.film.kritiken">de.rec.film.kritiken</A> for German reviews).<BR>
The Internet Movie Database accepts no responsibility for the contents of the
review and has no editorial control. Unless stated otherwise, the copyright
belongs to the author.<BR>
Please direct comments/criticisms of the review to relevant newsgroups.<BR>
Broken URLs inthe reviews are the responsibility of the author.<BR>
The formatting of the review is likely to differ from the original due
to ASCII to HTML conversion.
</SMALL></P>
<P ALIGN=CENTER>Related links: <A HREF="/Reviews/">index of all rec.arts.movies.reviews reviews</A></P>
</P></BODY></HTML>
|
{
"content_hash": "a467147900a3cac3911984090eb905f4",
"timestamp": "",
"source": "github",
"line_count": 90,
"max_line_length": 194,
"avg_line_length": 67.62222222222222,
"alnum_prop": 0.7394019060138022,
"repo_name": "xianjunzhengbackup/code",
"id": "b5717ebea07bd86be5b37c095eab3b882a767cd9",
"size": "6086",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "data science/machine_learning_for_the_web/chapter_4/movie/8087.html",
"mode": "33261",
"license": "mit",
"language": [
{
"name": "BitBake",
"bytes": "113"
},
{
"name": "BlitzBasic",
"bytes": "256"
},
{
"name": "CSS",
"bytes": "49827"
},
{
"name": "HTML",
"bytes": "157006325"
},
{
"name": "JavaScript",
"bytes": "14029"
},
{
"name": "Jupyter Notebook",
"bytes": "4875399"
},
{
"name": "Mako",
"bytes": "2060"
},
{
"name": "Perl",
"bytes": "716"
},
{
"name": "Python",
"bytes": "874414"
},
{
"name": "R",
"bytes": "454"
},
{
"name": "Shell",
"bytes": "3984"
}
],
"symlink_target": ""
}
|
require 'spec_helper'
RSpec.describe 'Creation of a new commit' do
include GraphqlHelpers
let_it_be(:current_user) { create(:user) }
let_it_be(:project) { create(:project, :public, :repository) }
let(:input) { { project_path: project.full_path, branch: branch, message: message, actions: actions } }
let(:branch) { 'master' }
let(:message) { 'Commit message' }
let(:actions) do
[
{
action: 'CREATE',
filePath: 'NEW_FILE.md',
content: 'Hello'
}
]
end
let(:mutation) { graphql_mutation(:commit_create, input) }
let(:mutation_response) { graphql_mutation_response(:commit_create) }
context 'the user is not allowed to create a commit' do
it_behaves_like 'a mutation that returns a top-level access error'
end
context 'when user has permissions to create a commit' do
before do
project.add_developer(current_user)
end
it 'creates a new commit' do
post_graphql_mutation(mutation, current_user: current_user)
expect(response).to have_gitlab_http_status(:success)
expect(mutation_response['commit']).to include(
'title' => message
)
end
context 'when branch is not correct' do
let(:branch) { 'unknown' }
it_behaves_like 'a mutation that returns errors in the response',
errors: ['You can only create or edit files when you are on a branch']
end
end
end
|
{
"content_hash": "2a1287a540e1be83184ec02a806fd99d",
"timestamp": "",
"source": "github",
"line_count": 49,
"max_line_length": 105,
"avg_line_length": 28.836734693877553,
"alnum_prop": 0.6510969568294409,
"repo_name": "mmkassem/gitlabhq",
"id": "ac4fa7cfe83e208c7f178f554ed9d2594ef95178",
"size": "1444",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "spec/requests/api/graphql/mutations/commits/create_spec.rb",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "113683"
},
{
"name": "CoffeeScript",
"bytes": "139197"
},
{
"name": "Cucumber",
"bytes": "119759"
},
{
"name": "HTML",
"bytes": "447030"
},
{
"name": "JavaScript",
"bytes": "29805"
},
{
"name": "Ruby",
"bytes": "2417833"
},
{
"name": "Shell",
"bytes": "14336"
}
],
"symlink_target": ""
}
|
import pyaf.Bench.TS_datasets as tsds
import tests.artificial.process_artificial_dataset as art
art.process_dataset(N = 1024 , FREQ = 'D', seed = 0, trendtype = "MovingAverage", cycle_length = 5, transform = "Logit", sigma = 0.0, exog_count = 100, ar_order = 12);
|
{
"content_hash": "327b40af5616683db9e9f101d1750b69",
"timestamp": "",
"source": "github",
"line_count": 7,
"max_line_length": 167,
"avg_line_length": 38.142857142857146,
"alnum_prop": 0.7078651685393258,
"repo_name": "antoinecarme/pyaf",
"id": "a383373f2a4acb9cd18114f6129efe16e4725870",
"size": "267",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "tests/artificial/transf_Logit/trend_MovingAverage/cycle_5/ar_12/test_artificial_1024_Logit_MovingAverage_5_12_100.py",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "Makefile",
"bytes": "6773299"
},
{
"name": "Procfile",
"bytes": "24"
},
{
"name": "Python",
"bytes": "54209093"
},
{
"name": "R",
"bytes": "807"
},
{
"name": "Shell",
"bytes": "3619"
}
],
"symlink_target": ""
}
|
<bill session="111" type="s" number="112" updated="2009-03-07T13:45:24-05:00">
<status><introduced date="1231218000" datetime="2009-01-06"/></status>
<introduced date="1231218000" datetime="2009-01-06"/>
<titles>
<title type="official" as="introduced">A bill to treat certain hospital support organizations as qualified organizations for purposes of determining acquisition indebtedness.</title>
</titles>
<sponsor id="300056"/>
<cosponsors>
</cosponsors>
<actions>
<action date="1231218000" datetime="2009-01-06"><text>Sponsor introductory remarks on measure. (CR S85-86)</text></action>
<action date="1231218000" datetime="2009-01-06"><text>Read twice and referred to the Committee on Finance.</text><reference label="text of measure as introduced" ref="CR S86"/></action>
</actions>
<committees>
<committee name="Senate Finance" subcommittee="" activity="Referral, In Committee" />
</committees>
<relatedbills>
</relatedbills>
<subjects>
<term name="Taxation"/>
<term name="Financial services and investments"/>
<term name="Health facilities and institutions"/>
<term name="Real estate business"/>
<term name="Social work, volunteer service, charitable organizations"/>
<term name="Tax-exempt organizations"/>
</subjects>
<amendments>
</amendments>
<summary>
1/6/2009--Introduced.<br/>Amends the Internal Revenue Code to allow certain support organizations for tax-exempt teaching hospitals to acquire debt secured by income-producing real property used to provide financial support for such hospitals.<br/>
</summary>
</bill>
|
{
"content_hash": "b97b0667818e479915b7945a591e1549",
"timestamp": "",
"source": "github",
"line_count": 36,
"max_line_length": 249,
"avg_line_length": 43.72222222222222,
"alnum_prop": 0.7407878017789072,
"repo_name": "hashrocket/localpolitics.in",
"id": "3741d55935d377cfc57a6fbaae60459eda405baa",
"size": "1574",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "public/govtrack/111_bills/s112.xml",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "JavaScript",
"bytes": "155887"
},
{
"name": "Ruby",
"bytes": "147059"
}
],
"symlink_target": ""
}
|
<?php
header("Access-Control-Allow-Origin: *");
header("Access-Control-Allow-Methods: *");
header("Access-Control-Allow-Headers: *");
header('X-Powered-By:0xBADCAB1E');
if(isset($_GET['rd'])) {
if(is_numeric($_GET['rd'])) {
$rd = ($_GET['rd']+1);
if($rd < 5) {
header("Location: http://cdn.simon.waldherr.eu/projects/majaX/content/server.php?rd=".$rd);
} else {
header("Location: http://cdn.simon.waldherr.eu/projects/majaX/content/server.php");
}
} else {
header("Location: http://cdn.simon.waldherr.eu/projects/majaX/content/server.php?rd=1");
}
die();
}
if(isset($_GET['hc'])) {
if ($_GET['hc'] == '204') {
header('HTTP/1.1 204 No Content');
} elseif($_GET['hc'] == '301') {
header('HTTP/1.1 301 Moved Permanently');
header('Location: http://cdn.simon.waldherr.eu/projects/majaX/content/server.php');
} elseif($_GET['hc'] == '401') {
header('WWW-Authenticate: Basic realm="The Realm"');
header('HTTP/1.0 401 Unauthorized');
echo 'If cancel is pressed this text shows';
die();
} elseif($_GET['hc'] == '403') {
header('HTTP/1.0 403 Forbidden');
die();
} elseif($_GET['hc'] == '404') {
header("HTTP/1.0 404 Not Found");
} elseif($_GET['hc'] == '502') {
header('HTTP/1.1 502 Bad Gateway');
} elseif($_GET['hc'] == '503') {
header('HTTP/1.1 503 Service Temporarily Unavailable');
header('Retry-After: 60');
}
if($_GET['hc'] != '200') {
ignore_user_abort(true);
set_time_limit(0);
header("Connection: close");
header("Content-Length: 0");
echo str_repeat("\r\n", 10);
flush();
die();
}
}
$return['get'] = $_GET;
$return['post'] = $_POST;
$return['env']['REQUEST_METHOD'] = $_ENV["REQUEST_METHOD"];
$return['env']['SERVER_PROTOCOL'] = $_ENV["SERVER_PROTOCOL"];
$return['env']['GATEWAY_INTERFACE'] = $_ENV["GATEWAY_INTERFACE"];
$return['env']['REMOTE_ADDR'] = $_ENV["REMOTE_ADDR"];
$return['env']['HTTP_ACCEPT_ENCODING'] = $_ENV["HTTP_ACCEPT_ENCODING"];
$return['env']['HTTP_ACCEPT_LANGUAGE'] = $_ENV["HTTP_ACCEPT_LANGUAGE"];
$return['env']['HTTP_USER_AGENT'] = $_ENV["HTTP_USER_AGENT"];
$return['env']['REDIRECT_STATUS'] = $_ENV["REDIRECT_STATUS"];
header('Content-type: application/json');
echo json_encode($return);
?>
|
{
"content_hash": "dcd16b8ad53d9183988b35bf88c27351",
"timestamp": "",
"source": "github",
"line_count": 70,
"max_line_length": 97,
"avg_line_length": 32.371428571428574,
"alnum_prop": 0.5979699911738746,
"repo_name": "TheGlycerine/Nux",
"id": "248f83785f4ed078441bcdded7fa45e33ec4f4be",
"size": "2266",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/js/vendor/majaX.js-master/content/server.php",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "20896"
},
{
"name": "JavaScript",
"bytes": "654456"
}
],
"symlink_target": ""
}
|
package org.assertj.core.api.byte_;
import static org.mockito.Mockito.verify;
import org.assertj.core.api.ByteAssert;
import org.assertj.core.api.ByteAssertBaseTest;
/**
* Tests for <code>{@link ByteAssert#isNotPositive()}</code>.
*
* @author Nicolas François
*/
class ByteAssert_isNotPositive_Test extends ByteAssertBaseTest {
@Override
protected ByteAssert invoke_api_method() {
return assertions.isNotPositive();
}
@Override
protected void verify_internal_effects() {
verify(bytes).assertIsNotPositive(getInfo(assertions), getActual(assertions));
}
}
|
{
"content_hash": "ae268467e6dd29b9cde6b743a1c06192",
"timestamp": "",
"source": "github",
"line_count": 26,
"max_line_length": 82,
"avg_line_length": 22.53846153846154,
"alnum_prop": 0.7457337883959044,
"repo_name": "assertj/assertj-core",
"id": "526878912b6ee484403ae5b6e95a4587d1e49e95",
"size": "1193",
"binary": false,
"copies": "2",
"ref": "refs/heads/assertj-jpms-it",
"path": "assertj-core/src/test/java/org/assertj/core/api/byte_/ByteAssert_isNotPositive_Test.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Java",
"bytes": "17632910"
},
{
"name": "Shell",
"bytes": "39247"
}
],
"symlink_target": ""
}
|
<?php
Header( 'Cache-Control: no-cache, must-revalidate');
Header( 'Pragma: no-cache');
error_reporting(E_ALL | E_NOTICE | E_STRICT | E_WARNING );
ini_set('display_errors', 1);
define('litepublisher_mode', 'xmlrpc');
include('index.php');
litepublisher::$debug = true;
set_time_limit(300);
$p = tmediaparser::i();
$files = tfiles::i();
$items = $files->db->getitems("media = 'image' and parent = 0");
echo count($items), ' count<br>';
foreach ($items as $item) {
$srcfilename = litepublisher::$paths->files . $item['filename'];
echo "$srcfilename <br>\n";
if ($source = tmediaparser::readimage($srcfilename)) {
$p->getsnapshot($srcfilename, $source);
echo "rescale<br>\n";
} else {
echo "error<br>\n";
}
}
echo "finished<br>\n";
|
{
"content_hash": "ebaaadaeca71e27f6d2c42e3b77f9776",
"timestamp": "",
"source": "github",
"line_count": 27,
"max_line_length": 64,
"avg_line_length": 27.962962962962962,
"alnum_prop": 0.6423841059602649,
"repo_name": "litepubl/cms",
"id": "769b06352465054dce3332dcfec3e3255aa73873",
"size": "755",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "utils/thumb.php",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Batchfile",
"bytes": "17699"
},
{
"name": "CSS",
"bytes": "3430781"
},
{
"name": "HTML",
"bytes": "31811"
},
{
"name": "JavaScript",
"bytes": "832487"
},
{
"name": "PHP",
"bytes": "3600407"
},
{
"name": "Shell",
"bytes": "457"
}
],
"symlink_target": ""
}
|
import * as utils from '../src/utils.js';
import {registerBidder} from '../src/adapters/bidderFactory.js';
import { Renderer } from '../src/Renderer.js';
import { VIDEO, BANNER } from '../src/mediaTypes.js';
import { config } from '../src/config.js';
const BIDDER_CODE = 'trustx';
const ENDPOINT_URL = 'https://sofia.trustx.org/hb';
const NEW_ENDPOINT_URL = 'https://grid.bidswitch.net/hbjson?sp=trustx';
const ADDITIONAL_SYNC_URL = 'https://x.bidswitch.net/sync?ssp=themediagrid';
const TIME_TO_LIVE = 360;
const ADAPTER_SYNC_URL = 'https://sofia.trustx.org/push_sync';
const RENDERER_URL = 'https://acdn.adnxs.com/video/outstream/ANOutstreamVideo.js';
const LOG_ERROR_MESS = {
noAuid: 'Bid from response has no auid parameter - ',
noAdm: 'Bid from response has no adm parameter - ',
noBid: 'Array of bid objects is empty',
noPlacementCode: 'Can\'t find in requested bids the bid with auid - ',
emptyUids: 'Uids should be not empty',
emptySeatbid: 'Seatbid array from response has empty item',
emptyResponse: 'Response is empty',
hasEmptySeatbidArray: 'Response has empty seatbid array',
hasNoArrayOfBids: 'Seatbid from response has no array of bid objects - '
};
export const spec = {
code: BIDDER_CODE,
supportedMediaTypes: [ BANNER, VIDEO ],
/**
* Determines whether or not the given bid request is valid.
*
* @param {BidRequest} bid The bid params to validate.
* @return boolean True if this is a valid bid, and false otherwise.
*/
isBidRequestValid: function(bid) {
return !!bid.params.uid;
},
/**
* Make a server request from the list of BidRequests.
*
* @param {BidRequest[]} validBidRequests - an array of bids
* @param {bidderRequest} - bidder request object
* @return ServerRequest Info describing the request to the server.
*/
buildRequests: function(validBidRequests, bidderRequest) {
const bids = validBidRequests || [];
const newFormatBids = [];
const oldFormatBids = [];
const requests = [];
bids.forEach(bid => {
if (bid.params.useNewFormat) {
newFormatBids.push(bid);
} else {
oldFormatBids.push(bid);
}
});
if (newFormatBids.length) {
const newFormatRequests = newFormatRequest(newFormatBids, bidderRequest);
if (newFormatRequests) {
requests.push(newFormatRequests);
}
}
if (oldFormatBids.length) {
const oldFormatRequests = oldFormatRequest(oldFormatBids, bidderRequest);
if (oldFormatRequests) {
requests.push(oldFormatRequests);
}
}
return requests;
},
/**
* Unpack the response from the server into a list of bids.
*
* @param {*} serverResponse A successful response from the server.
* @param {*} bidRequest
* @return {Bid[]} An array of bids which were nested inside the server.
*/
interpretResponse: function(serverResponse, bidRequest, RendererConst = Renderer) {
serverResponse = serverResponse && serverResponse.body;
const bidResponses = [];
let errorMessage;
if (!serverResponse) errorMessage = LOG_ERROR_MESS.emptyResponse;
else if (serverResponse.seatbid && !serverResponse.seatbid.length) {
errorMessage = LOG_ERROR_MESS.hasEmptySeatbidArray;
}
if (!errorMessage && serverResponse.seatbid) {
serverResponse.seatbid.forEach(respItem => {
_addBidResponse(_getBidFromResponse(respItem), bidRequest, bidResponses, RendererConst);
});
}
if (errorMessage) utils.logError(errorMessage);
return bidResponses;
},
getUserSyncs: function(syncOptions, responses, gdprConsent, uspConsent) {
if (syncOptions.pixelEnabled) {
const syncsPerBidder = config.getConfig('userSync.syncsPerBidder');
let params = [];
if (gdprConsent && typeof gdprConsent.consentString === 'string') {
if (typeof gdprConsent.gdprApplies === 'boolean') {
params.push(`gdpr=${Number(gdprConsent.gdprApplies)}&gdpr_consent=${gdprConsent.consentString}`);
} else {
params.push(`gdpr_consent=${gdprConsent.consentString}`);
}
}
if (uspConsent) {
params.push(`us_privacy=${uspConsent}`);
}
const stringParams = params.join('&');
const syncs = [{
type: 'image',
url: ADAPTER_SYNC_URL + (stringParams ? `?${stringParams}` : '')
}];
if (syncsPerBidder > 1) {
syncs.push({
type: 'image',
url: ADDITIONAL_SYNC_URL + (stringParams ? `&${stringParams}` : '')
});
}
return syncs;
}
}
}
function isPopulatedArray(arr) {
return !!(utils.isArray(arr) && arr.length > 0);
}
function deleteValues(keyPairObj) {
if (isPopulatedArray(keyPairObj.value) && keyPairObj.value[0] === '') {
delete keyPairObj.value;
}
}
function _getBidFromResponse(respItem) {
if (!respItem) {
utils.logError(LOG_ERROR_MESS.emptySeatbid);
} else if (!respItem.bid) {
utils.logError(LOG_ERROR_MESS.hasNoArrayOfBids + JSON.stringify(respItem));
} else if (!respItem.bid[0]) {
utils.logError(LOG_ERROR_MESS.noBid);
}
return respItem && respItem.bid && respItem.bid[0];
}
function _addBidResponse(serverBid, bidRequest, bidResponses, RendererConst) {
if (!serverBid) return;
let errorMessage;
if (!serverBid.auid) errorMessage = LOG_ERROR_MESS.noAuid + JSON.stringify(serverBid);
if (!serverBid.adm) errorMessage = LOG_ERROR_MESS.noAdm + JSON.stringify(serverBid);
else {
const { bidsMap, priceType, newFormat } = bidRequest;
let bid;
let slot;
if (newFormat) {
bid = bidsMap[serverBid.impid];
} else {
const awaitingBids = bidsMap[serverBid.auid];
if (awaitingBids) {
const sizeId = `${serverBid.w}x${serverBid.h}`;
if (awaitingBids[sizeId]) {
slot = awaitingBids[sizeId][0];
bid = slot.bids.shift();
}
} else {
errorMessage = LOG_ERROR_MESS.noPlacementCode + serverBid.auid;
}
}
if (!errorMessage && bid) {
const bidResponse = {
requestId: bid.bidId, // bid.bidderRequestId,
cpm: serverBid.price,
width: serverBid.w,
height: serverBid.h,
creativeId: serverBid.auid, // bid.bidId,
currency: 'USD',
netRevenue: newFormat ? false : priceType !== 'gross',
ttl: TIME_TO_LIVE,
dealId: serverBid.dealid,
meta: {
advertiserDomains: serverBid.adomain ? serverBid.adomain : []
},
};
if (serverBid.content_type === 'video') {
bidResponse.vastXml = serverBid.adm;
bidResponse.mediaType = VIDEO;
bidResponse.adResponse = {
content: bidResponse.vastXml
};
if (!bid.renderer && (!bid.mediaTypes || !bid.mediaTypes.video || bid.mediaTypes.video.context === 'outstream')) {
bidResponse.renderer = createRenderer(bidResponse, {
id: bid.bidId,
url: RENDERER_URL
}, RendererConst);
}
} else {
bidResponse.ad = serverBid.adm;
bidResponse.mediaType = BANNER;
}
bidResponses.push(bidResponse);
}
if (slot && !slot.bids.length) {
slot.parents.forEach(({parent, key, uid}) => {
const index = parent[key].indexOf(slot);
if (index > -1) {
parent[key].splice(index, 1);
}
if (!parent[key].length) {
delete parent[key];
if (!utils.getKeys(parent).length) {
delete bidsMap[uid];
}
}
});
}
}
if (errorMessage) {
utils.logError(errorMessage);
}
}
function outstreamRender (bid) {
bid.renderer.push(() => {
window.ANOutstreamVideo.renderAd({
targetId: bid.adUnitCode,
adResponse: bid.adResponse
});
});
}
function createRenderer (bid, rendererParams, RendererConst) {
const rendererInst = RendererConst.install({
id: rendererParams.id,
url: rendererParams.url,
loaded: false
});
try {
rendererInst.setRender(outstreamRender);
} catch (err) {
utils.logWarn('Prebid Error calling setRender on renderer', err);
}
return rendererInst;
}
function createVideoRequest(bid, mediaType) {
const {playerSize, mimes, durationRangeSec, protocols} = mediaType;
const size = (playerSize || bid.sizes || [])[0];
if (!size) return;
let result = utils.parseGPTSingleSizeArrayToRtbSize(size);
if (mimes) {
result.mimes = mimes;
}
if (durationRangeSec && durationRangeSec.length === 2) {
result.minduration = durationRangeSec[0];
result.maxduration = durationRangeSec[1];
}
if (protocols && protocols.length) {
result.protocols = protocols;
}
return result;
}
function createBannerRequest(bid, mediaType) {
const sizes = mediaType.sizes || bid.sizes;
if (!sizes || !sizes.length) return;
let format = sizes.map((size) => utils.parseGPTSingleSizeArrayToRtbSize(size));
let result = utils.parseGPTSingleSizeArrayToRtbSize(sizes[0]);
if (format.length) {
result.format = format
}
return result;
}
/**
* Gets bidfloor
* @param {Object} mediaTypes
* @param {Object} bid
* @returns {Number} floor
*/
function _getFloor (mediaTypes, bid) {
const curMediaType = mediaTypes.video ? 'video' : 'banner';
let floor = bid.params.bidFloor || 0;
if (typeof bid.getFloor === 'function') {
const floorInfo = bid.getFloor({
currency: 'USD',
mediaType: curMediaType,
size: bid.sizes.map(([w, h]) => ({w, h}))
});
if (typeof floorInfo === 'object' &&
floorInfo.currency === 'USD' &&
!isNaN(parseFloat(floorInfo.floor))) {
floor = Math.max(floor, parseFloat(floorInfo.floor));
}
}
return floor;
}
function newFormatRequest(validBidRequests, bidderRequest) {
if (!validBidRequests.length) {
return null;
}
let pageKeywords = null;
let jwpseg = null;
let content = null;
let schain = null;
let userId = null;
let userIdAsEids = null;
let user = null;
let userExt = null;
let {bidderRequestId, auctionId, gdprConsent, uspConsent, timeout, refererInfo} = bidderRequest || {};
const referer = refererInfo ? encodeURIComponent(refererInfo.referer) : '';
const imp = [];
const bidsMap = {};
validBidRequests.forEach((bid) => {
if (!bidderRequestId) {
bidderRequestId = bid.bidderRequestId;
}
if (!auctionId) {
auctionId = bid.auctionId;
}
if (!schain) {
schain = bid.schain;
}
if (!userId) {
userId = bid.userId;
}
if (!userIdAsEids) {
userIdAsEids = bid.userIdAsEids;
}
const {params: {uid, keywords}, mediaTypes, bidId, adUnitCode, rtd} = bid;
bidsMap[bidId] = bid;
if (!pageKeywords && !utils.isEmpty(keywords)) {
pageKeywords = utils.transformBidderParamKeywords(keywords);
}
const bidFloor = _getFloor(mediaTypes || {}, bid);
const jwTargeting = rtd && rtd.jwplayer && rtd.jwplayer.targeting;
if (jwTargeting) {
if (!jwpseg && jwTargeting.segments) {
jwpseg = jwTargeting.segments;
}
if (!content && jwTargeting.content) {
content = jwTargeting.content;
}
}
let impObj = {
id: bidId,
tagid: uid.toString(),
ext: {
divid: adUnitCode
}
};
if (bidFloor) {
impObj.bidfloor = bidFloor;
}
if (!mediaTypes || mediaTypes[BANNER]) {
const banner = createBannerRequest(bid, mediaTypes ? mediaTypes[BANNER] : {});
if (banner) {
impObj.banner = banner;
}
}
if (mediaTypes && mediaTypes[VIDEO]) {
const video = createVideoRequest(bid, mediaTypes[VIDEO]);
if (video) {
impObj.video = video;
}
}
if (impObj.banner || impObj.video) {
imp.push(impObj);
}
});
const source = {
tid: auctionId,
ext: {
wrapper: 'Prebid_js',
wrapper_version: '$prebid.version$'
}
};
if (schain) {
source.ext.schain = schain;
}
const bidderTimeout = config.getConfig('bidderTimeout') || timeout;
const tmax = timeout ? Math.min(bidderTimeout, timeout) : bidderTimeout;
let request = {
id: bidderRequestId,
site: {
page: referer
},
tmax,
source,
imp
};
if (content) {
request.site.content = content;
}
if (jwpseg && jwpseg.length) {
user = {
data: [{
name: 'iow_labs_pub_data',
segment: jwpseg.map((seg) => {
return {name: 'jwpseg', value: seg};
})
}]
};
}
if (gdprConsent && gdprConsent.consentString) {
userExt = {consent: gdprConsent.consentString};
}
if (userIdAsEids && userIdAsEids.length) {
userExt = userExt || {};
userExt.eids = [...userIdAsEids];
}
if (userExt && Object.keys(userExt).length) {
user = user || {};
user.ext = userExt;
}
if (user) {
request.user = user;
}
const configKeywords = utils.transformBidderParamKeywords({
'user': utils.deepAccess(config.getConfig('ortb2.user'), 'keywords') || null,
'context': utils.deepAccess(config.getConfig('ortb2.site'), 'keywords') || null
});
if (configKeywords.length) {
pageKeywords = (pageKeywords || []).concat(configKeywords);
}
if (pageKeywords && pageKeywords.length > 0) {
pageKeywords.forEach(deleteValues);
}
if (pageKeywords) {
request.ext = {
keywords: pageKeywords
};
}
if (gdprConsent && gdprConsent.gdprApplies) {
request.regs = {
ext: {
gdpr: gdprConsent.gdprApplies ? 1 : 0
}
}
}
if (uspConsent) {
if (!request.regs) {
request.regs = {ext: {}};
}
request.regs.ext.us_privacy = uspConsent;
}
return {
method: 'POST',
url: NEW_ENDPOINT_URL,
data: JSON.stringify(request),
newFormat: true,
bidsMap
};
}
function oldFormatRequest(validBidRequests, bidderRequest) {
const auids = [];
const bidsMap = {};
const slotsMapByUid = {};
const sizeMap = {};
const bids = validBidRequests || [];
let priceType = 'net';
let pageKeywords;
let reqId;
bids.forEach(bid => {
if (bid.params.priceType === 'gross') {
priceType = 'gross';
}
reqId = bid.bidderRequestId;
const {params: {uid}, adUnitCode} = bid;
auids.push(uid);
const sizesId = utils.parseSizesInput(bid.sizes);
if (!pageKeywords && !utils.isEmpty(bid.params.keywords)) {
const keywords = utils.transformBidderParamKeywords(bid.params.keywords);
if (keywords.length > 0) {
keywords.forEach(deleteValues);
}
pageKeywords = keywords;
}
if (!slotsMapByUid[uid]) {
slotsMapByUid[uid] = {};
}
const slotsMap = slotsMapByUid[uid];
if (!slotsMap[adUnitCode]) {
slotsMap[adUnitCode] = {adUnitCode, bids: [bid], parents: []};
} else {
slotsMap[adUnitCode].bids.push(bid);
}
const slot = slotsMap[adUnitCode];
sizesId.forEach((sizeId) => {
sizeMap[sizeId] = true;
if (!bidsMap[uid]) {
bidsMap[uid] = {};
}
if (!bidsMap[uid][sizeId]) {
bidsMap[uid][sizeId] = [slot];
} else {
bidsMap[uid][sizeId].push(slot);
}
slot.parents.push({parent: bidsMap[uid], key: sizeId, uid});
});
});
const payload = {
pt: priceType,
auids: auids.join(','),
sizes: utils.getKeys(sizeMap).join(','),
r: reqId,
wrapperType: 'Prebid_js',
wrapperVersion: '$prebid.version$'
};
if (pageKeywords) {
payload.keywords = JSON.stringify(pageKeywords);
}
if (bidderRequest) {
if (bidderRequest.refererInfo && bidderRequest.refererInfo.referer) {
payload.u = bidderRequest.refererInfo.referer;
}
if (bidderRequest.timeout) {
payload.wtimeout = bidderRequest.timeout;
}
if (bidderRequest.gdprConsent) {
if (bidderRequest.gdprConsent.consentString) {
payload.gdpr_consent = bidderRequest.gdprConsent.consentString;
}
payload.gdpr_applies =
(typeof bidderRequest.gdprConsent.gdprApplies === 'boolean')
? Number(bidderRequest.gdprConsent.gdprApplies) : 1;
}
if (bidderRequest.uspConsent) {
payload.us_privacy = bidderRequest.uspConsent;
}
}
return {
method: 'GET',
url: ENDPOINT_URL,
data: utils.parseQueryStringParameters(payload).replace(/\&$/, ''),
bidsMap,
priceType
};
}
registerBidder(spec);
|
{
"content_hash": "8f8c54a0885dd04f97551b2a41e14547",
"timestamp": "",
"source": "github",
"line_count": 591,
"max_line_length": 122,
"avg_line_length": 27.663282571912013,
"alnum_prop": 0.623524374579485,
"repo_name": "mcallari/Prebid.js",
"id": "247a1f6d048f0d9a8d1153cfa36f4cea9fd07527",
"size": "16349",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "modules/trustxBidAdapter.js",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "HTML",
"bytes": "205267"
},
{
"name": "JavaScript",
"bytes": "4015738"
}
],
"symlink_target": ""
}
|
extern NSTimeInterval const kShortToastDuration;
extern NSTimeInterval const kLongToastDuration;
@class UILabel;
@interface BPToast : NSObject{
UILabel *_toastLabel;
}
- (instancetype)initWithText:(NSString *)text;
@property (readonly, nonatomic) NSString *text;
- (void)show;
- (void)showWithDuration:(NSTimeInterval)duration;
+ (BPToast *)showToastWithText:(NSString *)text duration:(NSTimeInterval)duration;
@end
@interface NSString (BPToast)
- (void)toast;
@end
@interface UITableViewCell (BPToast)
- (void)textToast;
@end
|
{
"content_hash": "289a7084a9b0f3ae0e9f73d9a6ea762a",
"timestamp": "",
"source": "github",
"line_count": 27,
"max_line_length": 82,
"avg_line_length": 20.14814814814815,
"alnum_prop": 0.7628676470588235,
"repo_name": "mikeooye/BPKITs",
"id": "f45350483b019cc40f11e6d28674af04767c5549",
"size": "734",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "Views/BPToast.h",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Objective-C",
"bytes": "1761018"
}
],
"symlink_target": ""
}
|
namespace ParentLoad.DataAccess.ERCLevel
{
public partial interface IB07_Country_ChildDal
{
}
}
|
{
"content_hash": "38edbb814767b784cb66bbcb101e53bb",
"timestamp": "",
"source": "github",
"line_count": 6,
"max_line_length": 50,
"avg_line_length": 19,
"alnum_prop": 0.6842105263157895,
"repo_name": "CslaGenFork/CslaGenFork",
"id": "834517bd2ef0909ab1fb81163338e09f1859041b",
"size": "114",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "trunk/Samples/DeepLoad/DAL-DTO/ParentLoad.DataAccess/ERCLevel/IB07_Country_ChildDal.cs",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "ASP",
"bytes": "4816094"
},
{
"name": "Assembly",
"bytes": "73066"
},
{
"name": "C#",
"bytes": "12314305"
},
{
"name": "C++",
"bytes": "313681"
},
{
"name": "HTML",
"bytes": "30950"
},
{
"name": "PHP",
"bytes": "35716"
},
{
"name": "PLpgSQL",
"bytes": "2164471"
},
{
"name": "Pascal",
"bytes": "1244"
},
{
"name": "PowerShell",
"bytes": "1687"
},
{
"name": "SourcePawn",
"bytes": "500196"
},
{
"name": "Visual Basic",
"bytes": "3027224"
}
],
"symlink_target": ""
}
|
ACCEPTED
#### According to
International Plant Names Index
#### Published in
null
#### Original name
null
### Remarks
null
|
{
"content_hash": "ce35378eed252a324b1f2a347ebd51a6",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 31,
"avg_line_length": 9.692307692307692,
"alnum_prop": 0.7063492063492064,
"repo_name": "mdoering/backbone",
"id": "07675bcb3d6f689862a2e9816b790b0d29a315f2",
"size": "187",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "life/Plantae/Magnoliophyta/Magnoliopsida/Caryophyllales/Cactaceae/Mammillaria/Mammillaria exsudans/README.md",
"mode": "33188",
"license": "apache-2.0",
"language": [],
"symlink_target": ""
}
|
// -*- C++ -*-
//==========================================================================
/**
* @file SV_Message.h
*
* $Id: SV_Message.h 74005 2006-08-14 11:30:00Z johnnyw $
*
* @author Doug Schmidt
*/
//==========================================================================
#ifndef ACE_SV_MESSAGE_H
#define ACE_SV_MESSAGE_H
#include /**/ "ace/pre.h"
#include /**/ "ace/ACE_export.h"
#if !defined (ACE_LACKS_PRAGMA_ONCE)
# pragma once
#endif /* ACE_LACKS_PRAGMA_ONCE */
ACE_BEGIN_VERSIONED_NAMESPACE_DECL
/**
* @class ACE_SV_Message
*
* @brief Defines the header file for the C++ wrapper for message queues.
*/
class ACE_Export ACE_SV_Message
{
public:
/// Constructor
ACE_SV_Message (long type = 0);
/// Destructor
~ACE_SV_Message (void);
/// Get the message type.
long type (void) const;
/// Set the message type.
void type (long);
/// Dump the state of an object.
void dump (void) const;
/// Declare the dynamic allocation hooks.
ACE_ALLOC_HOOK_DECLARE;
protected:
/// Type of the message.
long type_;
};
ACE_END_VERSIONED_NAMESPACE_DECL
#if defined (__ACE_INLINE__)
#include "ace/SV_Message.inl"
#endif /* __ACE_INLINE__ */
#include /**/ "ace/post.h"
#endif /* ACE_SV_MESSAGE_H */
|
{
"content_hash": "28f77734e8af1f022a001055beef469e",
"timestamp": "",
"source": "github",
"line_count": 67,
"max_line_length": 76,
"avg_line_length": 18.71641791044776,
"alnum_prop": 0.5550239234449761,
"repo_name": "eSDK/esdk_uc_plugin_ucservice",
"id": "f6bd95f5bada66bdc6e6e579088886a1a1b147ac",
"size": "1254",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "platform/HWUCSDK/windows/eSpace_Desktop_V200R001C50SPC100B091/include/ace/SV_Message.h",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "C",
"bytes": "771355"
},
{
"name": "C++",
"bytes": "10142802"
},
{
"name": "Objective-C",
"bytes": "11846"
},
{
"name": "Shell",
"bytes": "1094"
}
],
"symlink_target": ""
}
|
__version__ = '0.1.2'
from .widgets import BootstrapSelect # noqa
|
{
"content_hash": "4a10ee5808f1dedceb29d559d20c69d7",
"timestamp": "",
"source": "github",
"line_count": 3,
"max_line_length": 44,
"avg_line_length": 22.666666666666668,
"alnum_prop": 0.6764705882352942,
"repo_name": "voxy/django-bootstrap-select",
"id": "2c20c23b38596cc288d9db4ba279936e88549464",
"size": "68",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "bootstrap_select/__init__.py",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "HTML",
"bytes": "2889"
},
{
"name": "Makefile",
"bytes": "1609"
},
{
"name": "Python",
"bytes": "17735"
}
],
"symlink_target": ""
}
|
<?php
namespace Cloudtek\DynamoDM\Test\Functional;
use Cloudtek\DynamoDM\Mapping\Annotation as ODM;
use MongoId;
class EmbeddedIdTest extends \Cloudtek\DynamoDM\Test\BaseTest
{
public function testEmbeddedIdsAreGenerated()
{
$test = new DefaultIdEmbeddedDocument();
$this->dm->persist($test);
$this->assertNotNull($test->id);
}
public function testEmbeddedIdsAreNotOverwritten()
{
$id = (string) new MongoId();
$test = new DefaultIdEmbeddedDocument();
$test->id = $id;
$this->dm->persist($test);
$this->assertEquals($id, $test->id);
}
/**
* @expectedException \InvalidArgumentException
* @expectedExceptionMessage Cloudtek\DynamoDM\Test\Functional\DefaultIdStrategyNoneEmbeddedDocument uses NONE identifier generation strategy but no identifier was provided when persisting.
*/
public function testEmbedOneDocumentWithMissingIdentifier()
{
$user = new EmbeddedStrategyNoneIdTestUser();
$user->embedOne = new DefaultIdStrategyNoneEmbeddedDocument();
$this->dm->persist($user);
}
/**
* @expectedException \InvalidArgumentException
* @expectedExceptionMessage Cloudtek\DynamoDM\Test\Functional\DefaultIdStrategyNoneEmbeddedDocument uses NONE identifier generation strategy but no identifier was provided when persisting.
*/
public function testEmbedManyDocumentWithMissingIdentifier()
{
$user = new EmbeddedStrategyNoneIdTestUser();
$user->embedMany[] = new DefaultIdStrategyNoneEmbeddedDocument();
$this->dm->persist($user);
}
}
/** @ODM\Document */
class EmbeddedIdTestUser
{
/**
* @ODM\Attribute(type="string")
* @ODM\HashKey
* @ODM\GeneratedValue(strategy="uuid")
*/
public $id;
/** @ODM\EmbedOne(targetDocument="DefaultIdEmbeddedDocument") */
public $embedOne;
/** @ODM\EmbedMany(targetDocument="DefaultIdEmbeddedDocument") */
public $embedMany = array();
}
/** @ODM\Document */
class EmbeddedStrategyNoneIdTestUser
{
/**
* @ODM\Attribute(type="string")
* @ODM\HashKey
* @ODM\GeneratedValue(strategy="uuid")
*/
public $id;
/** @ODM\EmbedOne(targetDocument="DefaultIdStrategyNoneEmbeddedDocument") */
public $embedOne;
/** @ODM\EmbedMany(targetDocument="DefaultIdStrategyNoneEmbeddedDocument") */
public $embedMany = array();
}
/** @ODM\EmbeddedDocument */
class DefaultIdEmbeddedDocument
{
/**
* @ODM\Attribute(type="string")
* @ODM\HashKey
* @ODM\GeneratedValue(strategy="uuid")
*/
public $id;
}
/** @ODM\EmbeddedDocument */
class DefaultIdStrategyNoneEmbeddedDocument
{
/**
* @ODM\Attribute(type="string")
* @ODM\HashKey
*/
public $id;
}
|
{
"content_hash": "765d745cc368e91f420d02dcd8078bac",
"timestamp": "",
"source": "github",
"line_count": 108,
"max_line_length": 193,
"avg_line_length": 25.916666666666668,
"alnum_prop": 0.6702393712040015,
"repo_name": "cloudtek/dynamodb-odm",
"id": "6c532bd80c159b6401242337770b338d0f803866",
"size": "2799",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "tests/Cloudtek/DynamoDM/Test/Functional/EmbeddedIdTest.php",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "PHP",
"bytes": "1870519"
}
],
"symlink_target": ""
}
|
(function() {
var Async, NwGlobal, app, appConfig;
Async = require('async');
NwGlobal = require('nwglobal');
app = angular.module('CBLandingPage.controllers.appInstance', ['CBLandingPage.models', 'CBLandingPage.services']);
appConfig = cloudbrowser.parentAppConfig;
app.controller('AppInstanceCtrl', [
'$scope', 'cb-mail', 'cb-format', 'cb-appInstanceManager', function($scope, mail, format, appInstanceMgr) {
var appInstance, grantPermissions;
appInstance = $scope.appInstance;
$scope.link = {};
$scope.error = {};
$scope.success = {};
$scope.linkVisible = false;
$scope.shareForm = {};
$scope.shareFormOpen = false;
$scope.confirmDelete = {};
$scope.showLink = function(entity) {
if ($scope.isLinkVisible()) {
$scope.closeLink();
}
$scope.link.entity = entity;
$scope.linkVisible = true;
return $scope.link.text = entity.api.getURL();
};
$scope.isLinkVisible = function() {
return $scope.linkVisible;
};
$scope.closeLink = function() {
$scope.link.entity = null;
$scope.link.text = null;
return $scope.linkVisible = false;
};
$scope.tryToRemove = function(entity, removalMethod) {
$scope.confirmDelete.entityName = entity.name;
return $scope.confirmDelete.remove = function() {
return entity.api.close(function(err) {
return $scope.safeApply(function() {
if (err) {
$scope.setError(err);
} else {
$scope[removalMethod](entity);
}
return $scope.confirmDelete.entityName = null;
});
});
};
};
$scope.isProcessing = function() {
return appInstance.processing;
};
$scope.isBrowserTableVisible = function() {
return appInstance.browserMgr.items.length && appInstance.showOptions;
};
$scope.isOptionsVisible = function() {
return appInstance.showOptions;
};
$scope.hasCollaborators = function() {
if (!appInstance.readerwriters) {
return false;
}
return appInstance.readerwriters.length;
};
$scope.create = function() {
appInstance.processing = true;
return appInstance.api.createBrowser(function(err, browserConfig) {
return $scope.safeApply(function() {
if (err) {
$scope.setError(err);
return appInstance.processing = false;
} else {
return $scope.addBrowser(browserConfig, appInstance.api);
}
});
});
};
$scope.areCollaboratorsVisible = function() {
return appInstance.showOptions && appInstance.readerwriters.length;
};
$scope.toggleOptions = function() {
return appInstance.showOptions = !appInstance.showOptions;
};
appInstance.api.addEventListener('rename', function(name) {
return $scope.safeApply(function() {
return appInstance.name = name;
});
});
appInstance.api.addEventListener('share', function(user) {
return $scope.safeApply(function() {
return appInstance.readerwriters.push(user);
});
});
$scope.isShareFormOpen = function() {
return $scope.shareFormOpen;
};
$scope.closeShareForm = function() {
var k, _results;
$scope.shareFormOpen = false;
_results = [];
for (k in $scope.shareForm) {
_results.push($scope.shareForm[k] = null);
}
return _results;
};
$scope.openShareForm = function(entity) {
if ($scope.isShareFormOpen()) {
$scope.closeShareForm();
}
$scope.shareFormOpen = true;
$scope.shareForm.role = entity.roles[entity.defaultRoleIndex];
return $scope.shareForm.entity = entity;
};
grantPermissions = function(form) {
var collaborator, entity, role;
entity = form.entity, role = form.role, collaborator = form.collaborator;
return Async.series([
function(next) {
appInstance.processing = true;
entity.api[role.grantMethod](collaborator, next);
return $scope.safeApply(function() {
return $scope.closeShareForm();
});
}, function(next) {
return mail.send({
to: collaborator,
url: entity.api.getURL(),
from: $scope.user,
callback: next,
sharedObj: entity.name,
mountPoint: appConfig.getMountPoint()
});
}
], function(err) {
return $scope.safeApply(function() {
appInstance.processing = false;
appInstance.showOptions = true;
if (err) {
return $scope.setError(err);
} else {
return $scope.success.message = "" + entity.name + " is shared with " + collaborator + ".";
}
});
});
};
return $scope.addCollaborator = function() {
var EMAIL_RE, collaborator;
collaborator = $scope.shareForm.collaborator;
EMAIL_RE = /^[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,4}$/;
if (EMAIL_RE.test(collaborator.toUpperCase())) {
return appConfig.isUserRegistered(collaborator, function(err, exists) {
return $scope.safeApply(function() {
if (err) {
return $scope.setError(err);
}
if (exists) {
return grantPermissions($scope.shareForm);
} else {
return appConfig.addNewUser(collaborator, function() {
return $scope.safeApply(function() {
return grantPermissions($scope.shareForm);
});
});
}
});
});
} else {
return $scope.error.message = "Invalid Collaborator";
}
};
}
]);
}).call(this);
|
{
"content_hash": "8c26494c36fcc2f79d9d8cc7bdf16e27",
"timestamp": "",
"source": "github",
"line_count": 178,
"max_line_length": 116,
"avg_line_length": 34.39887640449438,
"alnum_prop": 0.5446676465784746,
"repo_name": "bladepan/cloudbrowser",
"id": "df8b5e16f818f7ddf5730140c3e0d9430ddfd569",
"size": "6158",
"binary": false,
"copies": "1",
"ref": "refs/heads/deployment2",
"path": "src/server/applications/landing_page/js/lib/controllers/app_instance.js",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "4039621"
},
{
"name": "CoffeeScript",
"bytes": "620478"
},
{
"name": "Gnuplot",
"bytes": "1599"
},
{
"name": "HTML",
"bytes": "1128766"
},
{
"name": "JavaScript",
"bytes": "442460"
},
{
"name": "Makefile",
"bytes": "311"
},
{
"name": "OpenEdge ABL",
"bytes": "1586"
},
{
"name": "Shell",
"bytes": "12582"
}
],
"symlink_target": ""
}
|
from rest_framework import status
from rest_framework.response import Response
from rest_framework_bulk import generics as bulk_generics
from rest_framework.exceptions import PermissionDenied, ValidationError
from django.db.models import Q
from api.base.settings import BULK_SETTINGS
from api.base.exceptions import Conflict, JSONAPIException, Gone
from api.base.utils import is_bulk_request
from osf.models.base import GuidMixin
class ListBulkCreateJSONAPIView(bulk_generics.ListBulkCreateAPIView):
"""
Custom ListBulkCreateAPIView that properly formats bulk create responses
in accordance with the JSON API spec
"""
# overrides ListBulkCreateAPIView
def create(self, request, *args, **kwargs):
"""
Correctly formats both bulk and single POST response
"""
if is_bulk_request(request):
if not request.data:
raise ValidationError('Request must contain array of resource identifier objects.')
response = super(ListBulkCreateJSONAPIView, self).create(request, *args, **kwargs)
if 'data' not in response.data:
response.data = {'data': response.data}
return response
# overrides ListBulkCreateAPIView
def get_serializer(self, *args, **kwargs):
"""
Adds many=True to serializer if bulk operation.
"""
if is_bulk_request(self.request):
kwargs['many'] = True
return super(ListBulkCreateJSONAPIView, self).get_serializer(*args, **kwargs)
class BulkUpdateJSONAPIView(bulk_generics.BulkUpdateAPIView):
"""
Custom BulkUpdateAPIView that properly formats bulk update responses in accordance with
the JSON API spec
"""
# overrides BulkUpdateAPIView
def bulk_update(self, request, *args, **kwargs):
"""
Correctly formats bulk PUT/PATCH response
"""
if not request.data:
raise ValidationError('Request must contain array of resource identifier objects.')
response = super(BulkUpdateJSONAPIView, self).bulk_update(request, *args, **kwargs)
errors = {}
if 'errors' in response.data[-1]:
errors = response.data.pop(-1)
response.data = {'data': response.data}
if errors:
response.data.update(errors)
return response
class BulkDestroyJSONAPIView(bulk_generics.BulkDestroyAPIView):
"""
Custom BulkDestroyAPIView that handles validation and permissions for
bulk delete
"""
def get_requested_resources(self, request, request_data):
"""
Retrieves resources in request body
"""
model_cls = request.parser_context['view'].model_class
requested_ids = [data['id'] for data in request_data]
column_name = 'guids___id' if issubclass(model_cls, GuidMixin) else getattr(model_cls, 'primary_identifier_name', '_id')
resource_object_list = model_cls.objects.filter(Q(**{'{}__in'.format(column_name): requested_ids}))
for resource in resource_object_list:
if getattr(resource, 'is_deleted', None):
raise Gone
if resource_object_list.count() != len(request_data):
raise ValidationError({'non_field_errors': 'Could not find all objects to delete.'})
return [resource_object_list.get(**{column_name: id}) for id in requested_ids]
def allow_bulk_destroy_resources(self, user, resource_list):
"""
Ensures user has permission to bulk delete resources in request body. Override if not deleting relationships.
"""
return True
def bulk_destroy_skip_uneditable(self, resource_list, user, object_type):
"""
Override on view if allowing bulk delete request to skip resources for which the user does not have permission
to delete. Method should return a dict in this format: {'skipped': [array of resources which should be skipped],
'allowed': [array of resources which should be deleted]}
"""
return None
# Overrides BulkDestroyAPIView
def bulk_destroy(self, request, *args, **kwargs):
"""
Handles bulk destroy of resource objects.
Handles some validation and enforces bulk limit.
"""
if hasattr(request, 'query_params') and 'id' in request.query_params:
if hasattr(request, 'data') and len(request.data) > 0:
raise Conflict('A bulk DELETE can only have a body or query parameters, not both.')
ids = request.query_params['id'].split(',')
if 'type' in request.query_params:
request_type = request.query_params['type']
data = []
for id in ids:
data.append({'type': request_type, 'id': id})
else:
raise ValidationError('Type query parameter is also required for a bulk DELETE using query parameters.')
elif not request.data:
raise ValidationError('Request must contain array of resource identifier objects.')
else:
data = request.data
num_items = len(data)
bulk_limit = BULK_SETTINGS['DEFAULT_BULK_LIMIT']
if num_items > bulk_limit:
raise JSONAPIException(
source={'pointer': '/data'},
detail='Bulk operation limit is {}, got {}.'.format(bulk_limit, num_items),
)
user = self.request.user
object_type = self.serializer_class.Meta.type_
resource_object_list = self.get_requested_resources(request=request, request_data=data)
for item in data:
item_type = item[u'type']
if item_type != object_type:
raise Conflict('Type needs to match type expected at this endpoint.')
if not self.allow_bulk_destroy_resources(user, resource_object_list):
raise PermissionDenied
skip_uneditable = self.bulk_destroy_skip_uneditable(resource_object_list, user, object_type)
if skip_uneditable:
skipped = skip_uneditable['skipped']
allowed = skip_uneditable['allowed']
if skipped:
self.perform_bulk_destroy(allowed)
return Response(status=status.HTTP_200_OK, data={'errors': skipped})
self.perform_bulk_destroy(resource_object_list)
return Response(status=status.HTTP_204_NO_CONTENT)
|
{
"content_hash": "2783ba18cef675c76d51a245793194fa",
"timestamp": "",
"source": "github",
"line_count": 163,
"max_line_length": 128,
"avg_line_length": 39.263803680981596,
"alnum_prop": 0.64203125,
"repo_name": "HalcyonChimera/osf.io",
"id": "11a18da07481eae9109f5dfa6bb0c227eaedf61b",
"size": "6400",
"binary": false,
"copies": "2",
"ref": "refs/heads/develop",
"path": "api/base/generic_bulk_views.py",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "160226"
},
{
"name": "HTML",
"bytes": "113845"
},
{
"name": "JavaScript",
"bytes": "1671917"
},
{
"name": "Mako",
"bytes": "659151"
},
{
"name": "Perl",
"bytes": "13885"
},
{
"name": "Python",
"bytes": "6120847"
}
],
"symlink_target": ""
}
|
#include <iostream>
#include "SpinWaveGenie/Interactions/ExchangeInteractionSameSublattice.h"
#include "SpinWaveGenie/Genie/Neighbors.h"
#include "SpinWaveGenie/Memory.h"
using namespace std;
using namespace Eigen;
namespace SpinWaveGenie
{
ExchangeInteractionSameSublattice::ExchangeInteractionSameSublattice(string name_in, double value_in, string sl_r_in,
double min_in, double max_in)
: name(std::move(name_in)), r(0), s(0), M(0)
{
this->updateInteraction(value_in, sl_r_in, min_in, max_in);
}
std::unique_ptr<Interaction> ExchangeInteractionSameSublattice::clone() const
{
return memory::make_unique<ExchangeInteractionSameSublattice>(*this);
}
void ExchangeInteractionSameSublattice::updateInteraction(double value_in, string sl_r_in, double min_in, double max_in)
{
value = value_in;
sl_r = sl_r_in;
min = min_in;
max = max_in;
}
const string &ExchangeInteractionSameSublattice::getName() { return name; }
void ExchangeInteractionSameSublattice::updateValue(double value_in) { value = value_in; }
std::array<std::string, 2> ExchangeInteractionSameSublattice::sublattices() const { return {{sl_r, sl_r}}; }
void ExchangeInteractionSameSublattice::calcConstantValues(Cell &cell)
{
// cout << "cell check(calcConstantValues): " << cell.begin()->getName() << endl;
r = cell.getPosition(sl_r);
M = cell.size();
// cout << "r: " << r << " " << ", M: " << M << endl;
double Sr = cell.getSublattice(sl_r).getMoment();
// cout << "Sr: " << Sr << endl;
neighbors.findNeighbors(cell, sl_r, sl_r, min, max);
double z_rs = static_cast<double>(neighbors.size());
// cout << "z_rs = " << z_rs << endl;
// cout << "cell check(calcConstantValues): " << cell2.begin()->getName() << endl;
LNrr = 0.5 * z_rs * value * Sr;
LNrs = -0.5 * z_rs * value * Sr;
// cout << LNrr << " " << LNrs << endl;
}
void ExchangeInteractionSameSublattice::calculateEnergy(Cell &cell, double &energy)
{
r = cell.getPosition(sl_r);
neighbors.findNeighbors(cell, sl_r, sl_r, min, max);
double z_rs = static_cast<double>(neighbors.size());
double Sr = cell[r].getMoment();
energy -= value * z_rs * Sr * Sr;
}
void ExchangeInteractionSameSublattice::calculateFirstOrderTerms(Cell & /*cell*/, VectorXcd & /*elements*/)
{
// first order terms are 0.0
}
void ExchangeInteractionSameSublattice::updateMatrix(Vector3d K, MatrixXcd &LN)
{
gamma_rs = neighbors.getGamma(K);
// cout << value << " " << sl_r << " " << sl_r << " " << gamma_rs << endl;
// cout << "number of neighbors: " << neighbors.size() << endl;
// cout << gamma_rs << " " << conj(gamma_rs) << endl;
// cout << LNrr/value << endl;
LN(r, r) += LNrr + LNrs * conj(gamma_rs);
LN(r + M, r + M) += LNrr + conj(LNrs) * conj(gamma_rs);
}
}
|
{
"content_hash": "2c9114dc8826fb7ae449b2b34d8a0303",
"timestamp": "",
"source": "github",
"line_count": 87,
"max_line_length": 120,
"avg_line_length": 32.3448275862069,
"alnum_prop": 0.6481876332622601,
"repo_name": "peterfpeterson/SpinWaveGenie",
"id": "a43a63a54fac03cbfa7ca827e3d8fef4cdd1cfe5",
"size": "2814",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "libSpinWaveGenie/src/Interactions/ExchangeInteractionSameSublattice.cpp",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "C",
"bytes": "2882"
},
{
"name": "C++",
"bytes": "580351"
},
{
"name": "CMake",
"bytes": "39107"
},
{
"name": "Python",
"bytes": "6528"
}
],
"symlink_target": ""
}
|
using namespace llvm;
#define DEBUG_TYPE "block-placement2"
STATISTIC(NumCondBranches, "Number of conditional branches");
STATISTIC(NumUncondBranches, "Number of uncondittional branches");
STATISTIC(CondBranchTakenFreq,
"Potential frequency of taking conditional branches");
STATISTIC(UncondBranchTakenFreq,
"Potential frequency of taking unconditional branches");
static cl::opt<unsigned> AlignAllBlock("align-all-blocks",
cl::desc("Force the alignment of all "
"blocks in the function."),
cl::init(0), cl::Hidden);
// FIXME: Find a good default for this flag and remove the flag.
static cl::opt<unsigned>
ExitBlockBias("block-placement-exit-block-bias",
cl::desc("Block frequency percentage a loop exit block needs "
"over the original exit to be considered the new exit."),
cl::init(0), cl::Hidden);
namespace {
class BlockChain;
/// \brief Type for our function-wide basic block -> block chain mapping.
typedef DenseMap<MachineBasicBlock *, BlockChain *> BlockToChainMapType;
}
namespace {
/// \brief A chain of blocks which will be laid out contiguously.
///
/// This is the datastructure representing a chain of consecutive blocks that
/// are profitable to layout together in order to maximize fallthrough
/// probabilities and code locality. We also can use a block chain to represent
/// a sequence of basic blocks which have some external (correctness)
/// requirement for sequential layout.
///
/// Chains can be built around a single basic block and can be merged to grow
/// them. They participate in a block-to-chain mapping, which is updated
/// automatically as chains are merged together.
class BlockChain {
/// \brief The sequence of blocks belonging to this chain.
///
/// This is the sequence of blocks for a particular chain. These will be laid
/// out in-order within the function.
SmallVector<MachineBasicBlock *, 4> Blocks;
/// \brief A handle to the function-wide basic block to block chain mapping.
///
/// This is retained in each block chain to simplify the computation of child
/// block chains for SCC-formation and iteration. We store the edges to child
/// basic blocks, and map them back to their associated chains using this
/// structure.
BlockToChainMapType &BlockToChain;
public:
/// \brief Construct a new BlockChain.
///
/// This builds a new block chain representing a single basic block in the
/// function. It also registers itself as the chain that block participates
/// in with the BlockToChain mapping.
BlockChain(BlockToChainMapType &BlockToChain, MachineBasicBlock *BB)
: Blocks(1, BB), BlockToChain(BlockToChain), LoopPredecessors(0) {
assert(BB && "Cannot create a chain with a null basic block");
BlockToChain[BB] = this;
}
/// \brief Iterator over blocks within the chain.
typedef SmallVectorImpl<MachineBasicBlock *>::iterator iterator;
/// \brief Beginning of blocks within the chain.
iterator begin() { return Blocks.begin(); }
/// \brief End of blocks within the chain.
iterator end() { return Blocks.end(); }
/// \brief Merge a block chain into this one.
///
/// This routine merges a block chain into this one. It takes care of forming
/// a contiguous sequence of basic blocks, updating the edge list, and
/// updating the block -> chain mapping. It does not free or tear down the
/// old chain, but the old chain's block list is no longer valid.
void merge(MachineBasicBlock *BB, BlockChain *Chain) {
assert(BB);
assert(!Blocks.empty());
// Fast path in case we don't have a chain already.
if (!Chain) {
assert(!BlockToChain[BB]);
Blocks.push_back(BB);
BlockToChain[BB] = this;
return;
}
assert(BB == *Chain->begin());
assert(Chain->begin() != Chain->end());
// Update the incoming blocks to point to this chain, and add them to the
// chain structure.
for (BlockChain::iterator BI = Chain->begin(), BE = Chain->end();
BI != BE; ++BI) {
Blocks.push_back(*BI);
assert(BlockToChain[*BI] == Chain && "Incoming blocks not in chain");
BlockToChain[*BI] = this;
}
}
#ifndef NDEBUG
/// \brief Dump the blocks in this chain.
LLVM_DUMP_METHOD void dump() {
for (iterator I = begin(), E = end(); I != E; ++I)
(*I)->dump();
}
#endif // NDEBUG
/// \brief Count of predecessors within the loop currently being processed.
///
/// This count is updated at each loop we process to represent the number of
/// in-loop predecessors of this chain.
unsigned LoopPredecessors;
};
}
namespace {
class MachineBlockPlacement : public MachineFunctionPass {
/// \brief A typedef for a block filter set.
typedef SmallPtrSet<MachineBasicBlock *, 16> BlockFilterSet;
/// \brief A handle to the branch probability pass.
const MachineBranchProbabilityInfo *MBPI;
/// \brief A handle to the function-wide block frequency pass.
const MachineBlockFrequencyInfo *MBFI;
/// \brief A handle to the loop info.
const MachineLoopInfo *MLI;
/// \brief A handle to the target's instruction info.
const TargetInstrInfo *TII;
/// \brief A handle to the target's lowering info.
const TargetLoweringBase *TLI;
/// \brief Allocator and owner of BlockChain structures.
///
/// We build BlockChains lazily while processing the loop structure of
/// a function. To reduce malloc traffic, we allocate them using this
/// slab-like allocator, and destroy them after the pass completes. An
/// important guarantee is that this allocator produces stable pointers to
/// the chains.
SpecificBumpPtrAllocator<BlockChain> ChainAllocator;
/// \brief Function wide BasicBlock to BlockChain mapping.
///
/// This mapping allows efficiently moving from any given basic block to the
/// BlockChain it participates in, if any. We use it to, among other things,
/// allow implicitly defining edges between chains as the existing edges
/// between basic blocks.
DenseMap<MachineBasicBlock *, BlockChain *> BlockToChain;
void markChainSuccessors(BlockChain &Chain,
MachineBasicBlock *LoopHeaderBB,
SmallVectorImpl<MachineBasicBlock *> &BlockWorkList,
const BlockFilterSet *BlockFilter = nullptr);
MachineBasicBlock *selectBestSuccessor(MachineBasicBlock *BB,
BlockChain &Chain,
const BlockFilterSet *BlockFilter);
MachineBasicBlock *selectBestCandidateBlock(
BlockChain &Chain, SmallVectorImpl<MachineBasicBlock *> &WorkList,
const BlockFilterSet *BlockFilter);
MachineBasicBlock *getFirstUnplacedBlock(
MachineFunction &F,
const BlockChain &PlacedChain,
MachineFunction::iterator &PrevUnplacedBlockIt,
const BlockFilterSet *BlockFilter);
void buildChain(MachineBasicBlock *BB, BlockChain &Chain,
SmallVectorImpl<MachineBasicBlock *> &BlockWorkList,
const BlockFilterSet *BlockFilter = nullptr);
MachineBasicBlock *findBestLoopTop(MachineLoop &L,
const BlockFilterSet &LoopBlockSet);
MachineBasicBlock *findBestLoopExit(MachineFunction &F,
MachineLoop &L,
const BlockFilterSet &LoopBlockSet);
void buildLoopChains(MachineFunction &F, MachineLoop &L);
void rotateLoop(BlockChain &LoopChain, MachineBasicBlock *ExitingBB,
const BlockFilterSet &LoopBlockSet);
void buildCFGChains(MachineFunction &F);
public:
static char ID; // Pass identification, replacement for typeid
MachineBlockPlacement() : MachineFunctionPass(ID) {
initializeMachineBlockPlacementPass(*PassRegistry::getPassRegistry());
}
bool runOnMachineFunction(MachineFunction &F) override;
void getAnalysisUsage(AnalysisUsage &AU) const override {
AU.addRequired<MachineBranchProbabilityInfo>();
AU.addRequired<MachineBlockFrequencyInfo>();
AU.addRequired<MachineLoopInfo>();
MachineFunctionPass::getAnalysisUsage(AU);
}
};
}
char MachineBlockPlacement::ID = 0;
char &llvm::MachineBlockPlacementID = MachineBlockPlacement::ID;
INITIALIZE_PASS_BEGIN(MachineBlockPlacement, "block-placement2",
"Branch Probability Basic Block Placement", false, false)
INITIALIZE_PASS_DEPENDENCY(MachineBranchProbabilityInfo)
INITIALIZE_PASS_DEPENDENCY(MachineBlockFrequencyInfo)
INITIALIZE_PASS_DEPENDENCY(MachineLoopInfo)
INITIALIZE_PASS_END(MachineBlockPlacement, "block-placement2",
"Branch Probability Basic Block Placement", false, false)
#ifndef NDEBUG
/// \brief Helper to print the name of a MBB.
///
/// Only used by debug logging.
static std::string getBlockName(MachineBasicBlock *BB) {
std::string Result;
raw_string_ostream OS(Result);
OS << "BB#" << BB->getNumber()
<< " (derived from LLVM BB '" << BB->getName() << "')";
OS.flush();
return Result;
}
/// \brief Helper to print the number of a MBB.
///
/// Only used by debug logging.
static std::string getBlockNum(MachineBasicBlock *BB) {
std::string Result;
raw_string_ostream OS(Result);
OS << "BB#" << BB->getNumber();
OS.flush();
return Result;
}
#endif
/// \brief Mark a chain's successors as having one fewer preds.
///
/// When a chain is being merged into the "placed" chain, this routine will
/// quickly walk the successors of each block in the chain and mark them as
/// having one fewer active predecessor. It also adds any successors of this
/// chain which reach the zero-predecessor state to the worklist passed in.
void MachineBlockPlacement::markChainSuccessors(
BlockChain &Chain,
MachineBasicBlock *LoopHeaderBB,
SmallVectorImpl<MachineBasicBlock *> &BlockWorkList,
const BlockFilterSet *BlockFilter) {
// Walk all the blocks in this chain, marking their successors as having
// a predecessor placed.
for (BlockChain::iterator CBI = Chain.begin(), CBE = Chain.end();
CBI != CBE; ++CBI) {
// Add any successors for which this is the only un-placed in-loop
// predecessor to the worklist as a viable candidate for CFG-neutral
// placement. No subsequent placement of this block will violate the CFG
// shape, so we get to use heuristics to choose a favorable placement.
for (MachineBasicBlock::succ_iterator SI = (*CBI)->succ_begin(),
SE = (*CBI)->succ_end();
SI != SE; ++SI) {
if (BlockFilter && !BlockFilter->count(*SI))
continue;
BlockChain &SuccChain = *BlockToChain[*SI];
// Disregard edges within a fixed chain, or edges to the loop header.
if (&Chain == &SuccChain || *SI == LoopHeaderBB)
continue;
// This is a cross-chain edge that is within the loop, so decrement the
// loop predecessor count of the destination chain.
if (SuccChain.LoopPredecessors > 0 && --SuccChain.LoopPredecessors == 0)
BlockWorkList.push_back(*SuccChain.begin());
}
}
}
/// \brief Select the best successor for a block.
///
/// This looks across all successors of a particular block and attempts to
/// select the "best" one to be the layout successor. It only considers direct
/// successors which also pass the block filter. It will attempt to avoid
/// breaking CFG structure, but cave and break such structures in the case of
/// very hot successor edges.
///
/// \returns The best successor block found, or null if none are viable.
MachineBasicBlock *MachineBlockPlacement::selectBestSuccessor(
MachineBasicBlock *BB, BlockChain &Chain,
const BlockFilterSet *BlockFilter) {
const BranchProbability HotProb(4, 5); // 80%
MachineBasicBlock *BestSucc = nullptr;
// FIXME: Due to the performance of the probability and weight routines in
// the MBPI analysis, we manually compute probabilities using the edge
// weights. This is suboptimal as it means that the somewhat subtle
// definition of edge weight semantics is encoded here as well. We should
// improve the MBPI interface to efficiently support query patterns such as
// this.
uint32_t BestWeight = 0;
uint32_t WeightScale = 0;
uint32_t SumWeight = MBPI->getSumForBlock(BB, WeightScale);
DEBUG(dbgs() << "Attempting merge from: " << getBlockName(BB) << "\n");
for (MachineBasicBlock::succ_iterator SI = BB->succ_begin(),
SE = BB->succ_end();
SI != SE; ++SI) {
if (BlockFilter && !BlockFilter->count(*SI))
continue;
BlockChain &SuccChain = *BlockToChain[*SI];
if (&SuccChain == &Chain) {
DEBUG(dbgs() << " " << getBlockName(*SI) << " -> Already merged!\n");
continue;
}
if (*SI != *SuccChain.begin()) {
DEBUG(dbgs() << " " << getBlockName(*SI) << " -> Mid chain!\n");
continue;
}
uint32_t SuccWeight = MBPI->getEdgeWeight(BB, *SI);
BranchProbability SuccProb(SuccWeight / WeightScale, SumWeight);
// Only consider successors which are either "hot", or wouldn't violate
// any CFG constraints.
if (SuccChain.LoopPredecessors != 0) {
if (SuccProb < HotProb) {
DEBUG(dbgs() << " " << getBlockName(*SI) << " -> " << SuccProb
<< " (prob) (CFG conflict)\n");
continue;
}
// Make sure that a hot successor doesn't have a globally more important
// predecessor.
BlockFrequency CandidateEdgeFreq
= MBFI->getBlockFreq(BB) * SuccProb * HotProb.getCompl();
bool BadCFGConflict = false;
for (MachineBasicBlock::pred_iterator PI = (*SI)->pred_begin(),
PE = (*SI)->pred_end();
PI != PE; ++PI) {
if (*PI == *SI || (BlockFilter && !BlockFilter->count(*PI)) ||
BlockToChain[*PI] == &Chain)
continue;
BlockFrequency PredEdgeFreq
= MBFI->getBlockFreq(*PI) * MBPI->getEdgeProbability(*PI, *SI);
if (PredEdgeFreq >= CandidateEdgeFreq) {
BadCFGConflict = true;
break;
}
}
if (BadCFGConflict) {
DEBUG(dbgs() << " " << getBlockName(*SI) << " -> " << SuccProb
<< " (prob) (non-cold CFG conflict)\n");
continue;
}
}
DEBUG(dbgs() << " " << getBlockName(*SI) << " -> " << SuccProb
<< " (prob)"
<< (SuccChain.LoopPredecessors != 0 ? " (CFG break)" : "")
<< "\n");
if (BestSucc && BestWeight >= SuccWeight)
continue;
BestSucc = *SI;
BestWeight = SuccWeight;
}
return BestSucc;
}
/// \brief Select the best block from a worklist.
///
/// This looks through the provided worklist as a list of candidate basic
/// blocks and select the most profitable one to place. The definition of
/// profitable only really makes sense in the context of a loop. This returns
/// the most frequently visited block in the worklist, which in the case of
/// a loop, is the one most desirable to be physically close to the rest of the
/// loop body in order to improve icache behavior.
///
/// \returns The best block found, or null if none are viable.
MachineBasicBlock *MachineBlockPlacement::selectBestCandidateBlock(
BlockChain &Chain, SmallVectorImpl<MachineBasicBlock *> &WorkList,
const BlockFilterSet *BlockFilter) {
// Once we need to walk the worklist looking for a candidate, cleanup the
// worklist of already placed entries.
// FIXME: If this shows up on profiles, it could be folded (at the cost of
// some code complexity) into the loop below.
WorkList.erase(std::remove_if(WorkList.begin(), WorkList.end(),
[&](MachineBasicBlock *BB) {
return BlockToChain.lookup(BB) == &Chain;
}),
WorkList.end());
MachineBasicBlock *BestBlock = nullptr;
BlockFrequency BestFreq;
for (SmallVectorImpl<MachineBasicBlock *>::iterator WBI = WorkList.begin(),
WBE = WorkList.end();
WBI != WBE; ++WBI) {
BlockChain &SuccChain = *BlockToChain[*WBI];
if (&SuccChain == &Chain) {
DEBUG(dbgs() << " " << getBlockName(*WBI)
<< " -> Already merged!\n");
continue;
}
assert(SuccChain.LoopPredecessors == 0 && "Found CFG-violating block");
BlockFrequency CandidateFreq = MBFI->getBlockFreq(*WBI);
DEBUG(dbgs() << " " << getBlockName(*WBI) << " -> ";
MBFI->printBlockFreq(dbgs(), CandidateFreq) << " (freq)\n");
if (BestBlock && BestFreq >= CandidateFreq)
continue;
BestBlock = *WBI;
BestFreq = CandidateFreq;
}
return BestBlock;
}
/// \brief Retrieve the first unplaced basic block.
///
/// This routine is called when we are unable to use the CFG to walk through
/// all of the basic blocks and form a chain due to unnatural loops in the CFG.
/// We walk through the function's blocks in order, starting from the
/// LastUnplacedBlockIt. We update this iterator on each call to avoid
/// re-scanning the entire sequence on repeated calls to this routine.
MachineBasicBlock *MachineBlockPlacement::getFirstUnplacedBlock(
MachineFunction &F, const BlockChain &PlacedChain,
MachineFunction::iterator &PrevUnplacedBlockIt,
const BlockFilterSet *BlockFilter) {
for (MachineFunction::iterator I = PrevUnplacedBlockIt, E = F.end(); I != E;
++I) {
if (BlockFilter && !BlockFilter->count(I))
continue;
if (BlockToChain[I] != &PlacedChain) {
PrevUnplacedBlockIt = I;
// Now select the head of the chain to which the unplaced block belongs
// as the block to place. This will force the entire chain to be placed,
// and satisfies the requirements of merging chains.
return *BlockToChain[I]->begin();
}
}
return nullptr;
}
void MachineBlockPlacement::buildChain(
MachineBasicBlock *BB,
BlockChain &Chain,
SmallVectorImpl<MachineBasicBlock *> &BlockWorkList,
const BlockFilterSet *BlockFilter) {
assert(BB);
assert(BlockToChain[BB] == &Chain);
MachineFunction &F = *BB->getParent();
MachineFunction::iterator PrevUnplacedBlockIt = F.begin();
MachineBasicBlock *LoopHeaderBB = BB;
markChainSuccessors(Chain, LoopHeaderBB, BlockWorkList, BlockFilter);
BB = *std::prev(Chain.end());
for (;;) {
assert(BB);
assert(BlockToChain[BB] == &Chain);
assert(*std::prev(Chain.end()) == BB);
// Look for the best viable successor if there is one to place immediately
// after this block.
MachineBasicBlock *BestSucc = selectBestSuccessor(BB, Chain, BlockFilter);
// If an immediate successor isn't available, look for the best viable
// block among those we've identified as not violating the loop's CFG at
// this point. This won't be a fallthrough, but it will increase locality.
if (!BestSucc)
BestSucc = selectBestCandidateBlock(Chain, BlockWorkList, BlockFilter);
if (!BestSucc) {
BestSucc = getFirstUnplacedBlock(F, Chain, PrevUnplacedBlockIt,
BlockFilter);
if (!BestSucc)
break;
DEBUG(dbgs() << "Unnatural loop CFG detected, forcibly merging the "
"layout successor until the CFG reduces\n");
}
// Place this block, updating the datastructures to reflect its placement.
BlockChain &SuccChain = *BlockToChain[BestSucc];
// Zero out LoopPredecessors for the successor we're about to merge in case
// we selected a successor that didn't fit naturally into the CFG.
SuccChain.LoopPredecessors = 0;
DEBUG(dbgs() << "Merging from " << getBlockNum(BB)
<< " to " << getBlockNum(BestSucc) << "\n");
markChainSuccessors(SuccChain, LoopHeaderBB, BlockWorkList, BlockFilter);
Chain.merge(BestSucc, &SuccChain);
BB = *std::prev(Chain.end());
}
DEBUG(dbgs() << "Finished forming chain for header block "
<< getBlockNum(*Chain.begin()) << "\n");
}
/// \brief Find the best loop top block for layout.
///
/// Look for a block which is strictly better than the loop header for laying
/// out at the top of the loop. This looks for one and only one pattern:
/// a latch block with no conditional exit. This block will cause a conditional
/// jump around it or will be the bottom of the loop if we lay it out in place,
/// but if it it doesn't end up at the bottom of the loop for any reason,
/// rotation alone won't fix it. Because such a block will always result in an
/// unconditional jump (for the backedge) rotating it in front of the loop
/// header is always profitable.
MachineBasicBlock *
MachineBlockPlacement::findBestLoopTop(MachineLoop &L,
const BlockFilterSet &LoopBlockSet) {
// Check that the header hasn't been fused with a preheader block due to
// crazy branches. If it has, we need to start with the header at the top to
// prevent pulling the preheader into the loop body.
BlockChain &HeaderChain = *BlockToChain[L.getHeader()];
if (!LoopBlockSet.count(*HeaderChain.begin()))
return L.getHeader();
DEBUG(dbgs() << "Finding best loop top for: "
<< getBlockName(L.getHeader()) << "\n");
BlockFrequency BestPredFreq;
MachineBasicBlock *BestPred = nullptr;
for (MachineBasicBlock::pred_iterator PI = L.getHeader()->pred_begin(),
PE = L.getHeader()->pred_end();
PI != PE; ++PI) {
MachineBasicBlock *Pred = *PI;
if (!LoopBlockSet.count(Pred))
continue;
DEBUG(dbgs() << " header pred: " << getBlockName(Pred) << ", "
<< Pred->succ_size() << " successors, ";
MBFI->printBlockFreq(dbgs(), Pred) << " freq\n");
if (Pred->succ_size() > 1)
continue;
BlockFrequency PredFreq = MBFI->getBlockFreq(Pred);
if (!BestPred || PredFreq > BestPredFreq ||
(!(PredFreq < BestPredFreq) &&
Pred->isLayoutSuccessor(L.getHeader()))) {
BestPred = Pred;
BestPredFreq = PredFreq;
}
}
// If no direct predecessor is fine, just use the loop header.
if (!BestPred)
return L.getHeader();
// Walk backwards through any straight line of predecessors.
while (BestPred->pred_size() == 1 &&
(*BestPred->pred_begin())->succ_size() == 1 &&
*BestPred->pred_begin() != L.getHeader())
BestPred = *BestPred->pred_begin();
DEBUG(dbgs() << " final top: " << getBlockName(BestPred) << "\n");
return BestPred;
}
/// \brief Find the best loop exiting block for layout.
///
/// This routine implements the logic to analyze the loop looking for the best
/// block to layout at the top of the loop. Typically this is done to maximize
/// fallthrough opportunities.
MachineBasicBlock *
MachineBlockPlacement::findBestLoopExit(MachineFunction &F,
MachineLoop &L,
const BlockFilterSet &LoopBlockSet) {
// We don't want to layout the loop linearly in all cases. If the loop header
// is just a normal basic block in the loop, we want to look for what block
// within the loop is the best one to layout at the top. However, if the loop
// header has be pre-merged into a chain due to predecessors not having
// analyzable branches, *and* the predecessor it is merged with is *not* part
// of the loop, rotating the header into the middle of the loop will create
// a non-contiguous range of blocks which is Very Bad. So start with the
// header and only rotate if safe.
BlockChain &HeaderChain = *BlockToChain[L.getHeader()];
if (!LoopBlockSet.count(*HeaderChain.begin()))
return nullptr;
BlockFrequency BestExitEdgeFreq;
unsigned BestExitLoopDepth = 0;
MachineBasicBlock *ExitingBB = nullptr;
// If there are exits to outer loops, loop rotation can severely limit
// fallthrough opportunites unless it selects such an exit. Keep a set of
// blocks where rotating to exit with that block will reach an outer loop.
SmallPtrSet<MachineBasicBlock *, 4> BlocksExitingToOuterLoop;
DEBUG(dbgs() << "Finding best loop exit for: "
<< getBlockName(L.getHeader()) << "\n");
for (MachineLoop::block_iterator I = L.block_begin(),
E = L.block_end();
I != E; ++I) {
BlockChain &Chain = *BlockToChain[*I];
// Ensure that this block is at the end of a chain; otherwise it could be
// mid-way through an inner loop or a successor of an analyzable branch.
if (*I != *std::prev(Chain.end()))
continue;
// Now walk the successors. We need to establish whether this has a viable
// exiting successor and whether it has a viable non-exiting successor.
// We store the old exiting state and restore it if a viable looping
// successor isn't found.
MachineBasicBlock *OldExitingBB = ExitingBB;
BlockFrequency OldBestExitEdgeFreq = BestExitEdgeFreq;
bool HasLoopingSucc = false;
// FIXME: Due to the performance of the probability and weight routines in
// the MBPI analysis, we use the internal weights and manually compute the
// probabilities to avoid quadratic behavior.
uint32_t WeightScale = 0;
uint32_t SumWeight = MBPI->getSumForBlock(*I, WeightScale);
for (MachineBasicBlock::succ_iterator SI = (*I)->succ_begin(),
SE = (*I)->succ_end();
SI != SE; ++SI) {
if ((*SI)->isLandingPad())
continue;
if (*SI == *I)
continue;
BlockChain &SuccChain = *BlockToChain[*SI];
// Don't split chains, either this chain or the successor's chain.
if (&Chain == &SuccChain) {
DEBUG(dbgs() << " exiting: " << getBlockName(*I) << " -> "
<< getBlockName(*SI) << " (chain conflict)\n");
continue;
}
uint32_t SuccWeight = MBPI->getEdgeWeight(*I, *SI);
if (LoopBlockSet.count(*SI)) {
DEBUG(dbgs() << " looping: " << getBlockName(*I) << " -> "
<< getBlockName(*SI) << " (" << SuccWeight << ")\n");
HasLoopingSucc = true;
continue;
}
unsigned SuccLoopDepth = 0;
if (MachineLoop *ExitLoop = MLI->getLoopFor(*SI)) {
SuccLoopDepth = ExitLoop->getLoopDepth();
if (ExitLoop->contains(&L))
BlocksExitingToOuterLoop.insert(*I);
}
BranchProbability SuccProb(SuccWeight / WeightScale, SumWeight);
BlockFrequency ExitEdgeFreq = MBFI->getBlockFreq(*I) * SuccProb;
DEBUG(dbgs() << " exiting: " << getBlockName(*I) << " -> "
<< getBlockName(*SI) << " [L:" << SuccLoopDepth
<< "] (";
MBFI->printBlockFreq(dbgs(), ExitEdgeFreq) << ")\n");
// Note that we bias this toward an existing layout successor to retain
// incoming order in the absence of better information. The exit must have
// a frequency higher than the current exit before we consider breaking
// the layout.
BranchProbability Bias(100 - ExitBlockBias, 100);
if (!ExitingBB || BestExitLoopDepth < SuccLoopDepth ||
ExitEdgeFreq > BestExitEdgeFreq ||
((*I)->isLayoutSuccessor(*SI) &&
!(ExitEdgeFreq < BestExitEdgeFreq * Bias))) {
BestExitEdgeFreq = ExitEdgeFreq;
ExitingBB = *I;
}
}
// Restore the old exiting state, no viable looping successor was found.
if (!HasLoopingSucc) {
ExitingBB = OldExitingBB;
BestExitEdgeFreq = OldBestExitEdgeFreq;
continue;
}
}
// Without a candidate exiting block or with only a single block in the
// loop, just use the loop header to layout the loop.
if (!ExitingBB || L.getNumBlocks() == 1)
return nullptr;
// Also, if we have exit blocks which lead to outer loops but didn't select
// one of them as the exiting block we are rotating toward, disable loop
// rotation altogether.
if (!BlocksExitingToOuterLoop.empty() &&
!BlocksExitingToOuterLoop.count(ExitingBB))
return nullptr;
DEBUG(dbgs() << " Best exiting block: " << getBlockName(ExitingBB) << "\n");
return ExitingBB;
}
/// \brief Attempt to rotate an exiting block to the bottom of the loop.
///
/// Once we have built a chain, try to rotate it to line up the hot exit block
/// with fallthrough out of the loop if doing so doesn't introduce unnecessary
/// branches. For example, if the loop has fallthrough into its header and out
/// of its bottom already, don't rotate it.
void MachineBlockPlacement::rotateLoop(BlockChain &LoopChain,
MachineBasicBlock *ExitingBB,
const BlockFilterSet &LoopBlockSet) {
if (!ExitingBB)
return;
MachineBasicBlock *Top = *LoopChain.begin();
bool ViableTopFallthrough = false;
for (MachineBasicBlock::pred_iterator PI = Top->pred_begin(),
PE = Top->pred_end();
PI != PE; ++PI) {
BlockChain *PredChain = BlockToChain[*PI];
if (!LoopBlockSet.count(*PI) &&
(!PredChain || *PI == *std::prev(PredChain->end()))) {
ViableTopFallthrough = true;
break;
}
}
// If the header has viable fallthrough, check whether the current loop
// bottom is a viable exiting block. If so, bail out as rotating will
// introduce an unnecessary branch.
if (ViableTopFallthrough) {
MachineBasicBlock *Bottom = *std::prev(LoopChain.end());
for (MachineBasicBlock::succ_iterator SI = Bottom->succ_begin(),
SE = Bottom->succ_end();
SI != SE; ++SI) {
BlockChain *SuccChain = BlockToChain[*SI];
if (!LoopBlockSet.count(*SI) &&
(!SuccChain || *SI == *SuccChain->begin()))
return;
}
}
BlockChain::iterator ExitIt = std::find(LoopChain.begin(), LoopChain.end(),
ExitingBB);
if (ExitIt == LoopChain.end())
return;
std::rotate(LoopChain.begin(), std::next(ExitIt), LoopChain.end());
}
/// \brief Forms basic block chains from the natural loop structures.
///
/// These chains are designed to preserve the existing *structure* of the code
/// as much as possible. We can then stitch the chains together in a way which
/// both preserves the topological structure and minimizes taken conditional
/// branches.
void MachineBlockPlacement::buildLoopChains(MachineFunction &F,
MachineLoop &L) {
// First recurse through any nested loops, building chains for those inner
// loops.
for (MachineLoop::iterator LI = L.begin(), LE = L.end(); LI != LE; ++LI)
buildLoopChains(F, **LI);
SmallVector<MachineBasicBlock *, 16> BlockWorkList;
BlockFilterSet LoopBlockSet(L.block_begin(), L.block_end());
// First check to see if there is an obviously preferable top block for the
// loop. This will default to the header, but may end up as one of the
// predecessors to the header if there is one which will result in strictly
// fewer branches in the loop body.
MachineBasicBlock *LoopTop = findBestLoopTop(L, LoopBlockSet);
// If we selected just the header for the loop top, look for a potentially
// profitable exit block in the event that rotating the loop can eliminate
// branches by placing an exit edge at the bottom.
MachineBasicBlock *ExitingBB = nullptr;
if (LoopTop == L.getHeader())
ExitingBB = findBestLoopExit(F, L, LoopBlockSet);
BlockChain &LoopChain = *BlockToChain[LoopTop];
// FIXME: This is a really lame way of walking the chains in the loop: we
// walk the blocks, and use a set to prevent visiting a particular chain
// twice.
SmallPtrSet<BlockChain *, 4> UpdatedPreds;
assert(LoopChain.LoopPredecessors == 0);
UpdatedPreds.insert(&LoopChain);
for (MachineLoop::block_iterator BI = L.block_begin(),
BE = L.block_end();
BI != BE; ++BI) {
BlockChain &Chain = *BlockToChain[*BI];
if (!UpdatedPreds.insert(&Chain).second)
continue;
assert(Chain.LoopPredecessors == 0);
for (BlockChain::iterator BCI = Chain.begin(), BCE = Chain.end();
BCI != BCE; ++BCI) {
assert(BlockToChain[*BCI] == &Chain);
for (MachineBasicBlock::pred_iterator PI = (*BCI)->pred_begin(),
PE = (*BCI)->pred_end();
PI != PE; ++PI) {
if (BlockToChain[*PI] == &Chain || !LoopBlockSet.count(*PI))
continue;
++Chain.LoopPredecessors;
}
}
if (Chain.LoopPredecessors == 0)
BlockWorkList.push_back(*Chain.begin());
}
buildChain(LoopTop, LoopChain, BlockWorkList, &LoopBlockSet);
rotateLoop(LoopChain, ExitingBB, LoopBlockSet);
DEBUG({
// Crash at the end so we get all of the debugging output first.
bool BadLoop = false;
if (LoopChain.LoopPredecessors) {
BadLoop = true;
dbgs() << "Loop chain contains a block without its preds placed!\n"
<< " Loop header: " << getBlockName(*L.block_begin()) << "\n"
<< " Chain header: " << getBlockName(*LoopChain.begin()) << "\n";
}
for (BlockChain::iterator BCI = LoopChain.begin(), BCE = LoopChain.end();
BCI != BCE; ++BCI) {
dbgs() << " ... " << getBlockName(*BCI) << "\n";
if (!LoopBlockSet.erase(*BCI)) {
// We don't mark the loop as bad here because there are real situations
// where this can occur. For example, with an unanalyzable fallthrough
// from a loop block to a non-loop block or vice versa.
dbgs() << "Loop chain contains a block not contained by the loop!\n"
<< " Loop header: " << getBlockName(*L.block_begin()) << "\n"
<< " Chain header: " << getBlockName(*LoopChain.begin()) << "\n"
<< " Bad block: " << getBlockName(*BCI) << "\n";
}
}
if (!LoopBlockSet.empty()) {
BadLoop = true;
for (BlockFilterSet::iterator LBI = LoopBlockSet.begin(),
LBE = LoopBlockSet.end();
LBI != LBE; ++LBI)
dbgs() << "Loop contains blocks never placed into a chain!\n"
<< " Loop header: " << getBlockName(*L.block_begin()) << "\n"
<< " Chain header: " << getBlockName(*LoopChain.begin()) << "\n"
<< " Bad block: " << getBlockName(*LBI) << "\n";
}
assert(!BadLoop && "Detected problems with the placement of this loop.");
});
}
void MachineBlockPlacement::buildCFGChains(MachineFunction &F) {
// Ensure that every BB in the function has an associated chain to simplify
// the assumptions of the remaining algorithm.
SmallVector<MachineOperand, 4> Cond; // For AnalyzeBranch.
for (MachineFunction::iterator FI = F.begin(), FE = F.end(); FI != FE; ++FI) {
MachineBasicBlock *BB = FI;
BlockChain *Chain
= new (ChainAllocator.Allocate()) BlockChain(BlockToChain, BB);
// Also, merge any blocks which we cannot reason about and must preserve
// the exact fallthrough behavior for.
for (;;) {
Cond.clear();
MachineBasicBlock *TBB = nullptr, *FBB = nullptr; // For AnalyzeBranch.
if (!TII->AnalyzeBranch(*BB, TBB, FBB, Cond) || !FI->canFallThrough())
break;
MachineFunction::iterator NextFI(std::next(FI));
MachineBasicBlock *NextBB = NextFI;
// Ensure that the layout successor is a viable block, as we know that
// fallthrough is a possibility.
assert(NextFI != FE && "Can't fallthrough past the last block.");
DEBUG(dbgs() << "Pre-merging due to unanalyzable fallthrough: "
<< getBlockName(BB) << " -> " << getBlockName(NextBB)
<< "\n");
Chain->merge(NextBB, nullptr);
FI = NextFI;
BB = NextBB;
}
}
// Build any loop-based chains.
for (MachineLoopInfo::iterator LI = MLI->begin(), LE = MLI->end(); LI != LE;
++LI)
buildLoopChains(F, **LI);
SmallVector<MachineBasicBlock *, 16> BlockWorkList;
SmallPtrSet<BlockChain *, 4> UpdatedPreds;
for (MachineFunction::iterator FI = F.begin(), FE = F.end(); FI != FE; ++FI) {
MachineBasicBlock *BB = &*FI;
BlockChain &Chain = *BlockToChain[BB];
if (!UpdatedPreds.insert(&Chain).second)
continue;
assert(Chain.LoopPredecessors == 0);
for (BlockChain::iterator BCI = Chain.begin(), BCE = Chain.end();
BCI != BCE; ++BCI) {
assert(BlockToChain[*BCI] == &Chain);
for (MachineBasicBlock::pred_iterator PI = (*BCI)->pred_begin(),
PE = (*BCI)->pred_end();
PI != PE; ++PI) {
if (BlockToChain[*PI] == &Chain)
continue;
++Chain.LoopPredecessors;
}
}
if (Chain.LoopPredecessors == 0)
BlockWorkList.push_back(*Chain.begin());
}
BlockChain &FunctionChain = *BlockToChain[&F.front()];
buildChain(&F.front(), FunctionChain, BlockWorkList);
#ifndef NDEBUG
typedef SmallPtrSet<MachineBasicBlock *, 16> FunctionBlockSetType;
#endif
DEBUG({
// Crash at the end so we get all of the debugging output first.
bool BadFunc = false;
FunctionBlockSetType FunctionBlockSet;
for (MachineFunction::iterator FI = F.begin(), FE = F.end(); FI != FE; ++FI)
FunctionBlockSet.insert(FI);
for (BlockChain::iterator BCI = FunctionChain.begin(),
BCE = FunctionChain.end();
BCI != BCE; ++BCI)
if (!FunctionBlockSet.erase(*BCI)) {
BadFunc = true;
dbgs() << "Function chain contains a block not in the function!\n"
<< " Bad block: " << getBlockName(*BCI) << "\n";
}
if (!FunctionBlockSet.empty()) {
BadFunc = true;
for (FunctionBlockSetType::iterator FBI = FunctionBlockSet.begin(),
FBE = FunctionBlockSet.end();
FBI != FBE; ++FBI)
dbgs() << "Function contains blocks never placed into a chain!\n"
<< " Bad block: " << getBlockName(*FBI) << "\n";
}
assert(!BadFunc && "Detected problems with the block placement.");
});
// Splice the blocks into place.
MachineFunction::iterator InsertPos = F.begin();
for (BlockChain::iterator BI = FunctionChain.begin(),
BE = FunctionChain.end();
BI != BE; ++BI) {
DEBUG(dbgs() << (BI == FunctionChain.begin() ? "Placing chain "
: " ... ")
<< getBlockName(*BI) << "\n");
if (InsertPos != MachineFunction::iterator(*BI))
F.splice(InsertPos, *BI);
else
++InsertPos;
// Update the terminator of the previous block.
if (BI == FunctionChain.begin())
continue;
MachineBasicBlock *PrevBB = std::prev(MachineFunction::iterator(*BI));
// FIXME: It would be awesome of updateTerminator would just return rather
// than assert when the branch cannot be analyzed in order to remove this
// boiler plate.
Cond.clear();
MachineBasicBlock *TBB = nullptr, *FBB = nullptr; // For AnalyzeBranch.
if (!TII->AnalyzeBranch(*PrevBB, TBB, FBB, Cond)) {
// The "PrevBB" is not yet updated to reflect current code layout, so,
// o. it may fall-through to a block without explict "goto" instruction
// before layout, and no longer fall-through it after layout; or
// o. just opposite.
//
// AnalyzeBranch() may return erroneous value for FBB when these two
// situations take place. For the first scenario FBB is mistakenly set
// NULL; for the 2nd scenario, the FBB, which is expected to be NULL,
// is mistakenly pointing to "*BI".
//
bool needUpdateBr = true;
if (!Cond.empty() && (!FBB || FBB == *BI)) {
PrevBB->updateTerminator();
needUpdateBr = false;
Cond.clear();
TBB = FBB = nullptr;
if (TII->AnalyzeBranch(*PrevBB, TBB, FBB, Cond)) {
// FIXME: This should never take place.
TBB = FBB = nullptr;
}
}
// If PrevBB has a two-way branch, try to re-order the branches
// such that we branch to the successor with higher weight first.
if (TBB && !Cond.empty() && FBB &&
MBPI->getEdgeWeight(PrevBB, FBB) > MBPI->getEdgeWeight(PrevBB, TBB) &&
!TII->ReverseBranchCondition(Cond)) {
DEBUG(dbgs() << "Reverse order of the two branches: "
<< getBlockName(PrevBB) << "\n");
DEBUG(dbgs() << " Edge weight: " << MBPI->getEdgeWeight(PrevBB, FBB)
<< " vs " << MBPI->getEdgeWeight(PrevBB, TBB) << "\n");
DebugLoc dl; // FIXME: this is nowhere
TII->RemoveBranch(*PrevBB);
TII->InsertBranch(*PrevBB, FBB, TBB, Cond, dl);
needUpdateBr = true;
}
if (needUpdateBr)
PrevBB->updateTerminator();
}
}
// Fixup the last block.
Cond.clear();
MachineBasicBlock *TBB = nullptr, *FBB = nullptr; // For AnalyzeBranch.
if (!TII->AnalyzeBranch(F.back(), TBB, FBB, Cond))
F.back().updateTerminator();
// Walk through the backedges of the function now that we have fully laid out
// the basic blocks and align the destination of each backedge. We don't rely
// exclusively on the loop info here so that we can align backedges in
// unnatural CFGs and backedges that were introduced purely because of the
// loop rotations done during this layout pass.
if (F.getFunction()->getAttributes().
hasAttribute(AttributeSet::FunctionIndex, Attribute::OptimizeForSize))
return;
if (FunctionChain.begin() == FunctionChain.end())
return; // Empty chain.
const BranchProbability ColdProb(1, 5); // 20%
BlockFrequency EntryFreq = MBFI->getBlockFreq(F.begin());
BlockFrequency WeightedEntryFreq = EntryFreq * ColdProb;
for (BlockChain::iterator BI = std::next(FunctionChain.begin()),
BE = FunctionChain.end();
BI != BE; ++BI) {
// Don't align non-looping basic blocks. These are unlikely to execute
// enough times to matter in practice. Note that we'll still handle
// unnatural CFGs inside of a natural outer loop (the common case) and
// rotated loops.
MachineLoop *L = MLI->getLoopFor(*BI);
if (!L)
continue;
unsigned Align = TLI->getPrefLoopAlignment(L);
if (!Align)
continue; // Don't care about loop alignment.
// If the block is cold relative to the function entry don't waste space
// aligning it.
BlockFrequency Freq = MBFI->getBlockFreq(*BI);
if (Freq < WeightedEntryFreq)
continue;
// If the block is cold relative to its loop header, don't align it
// regardless of what edges into the block exist.
MachineBasicBlock *LoopHeader = L->getHeader();
BlockFrequency LoopHeaderFreq = MBFI->getBlockFreq(LoopHeader);
if (Freq < (LoopHeaderFreq * ColdProb))
continue;
// Check for the existence of a non-layout predecessor which would benefit
// from aligning this block.
MachineBasicBlock *LayoutPred = *std::prev(BI);
// Force alignment if all the predecessors are jumps. We already checked
// that the block isn't cold above.
if (!LayoutPred->isSuccessor(*BI)) {
(*BI)->setAlignment(Align);
continue;
}
// Align this block if the layout predecessor's edge into this block is
// cold relative to the block. When this is true, other predecessors make up
// all of the hot entries into the block and thus alignment is likely to be
// important.
BranchProbability LayoutProb = MBPI->getEdgeProbability(LayoutPred, *BI);
BlockFrequency LayoutEdgeFreq = MBFI->getBlockFreq(LayoutPred) * LayoutProb;
if (LayoutEdgeFreq <= (Freq * ColdProb))
(*BI)->setAlignment(Align);
}
}
bool MachineBlockPlacement::runOnMachineFunction(MachineFunction &F) {
// Check for single-block functions and skip them.
if (std::next(F.begin()) == F.end())
return false;
if (skipOptnoneFunction(*F.getFunction()))
return false;
MBPI = &getAnalysis<MachineBranchProbabilityInfo>();
MBFI = &getAnalysis<MachineBlockFrequencyInfo>();
MLI = &getAnalysis<MachineLoopInfo>();
TII = F.getSubtarget().getInstrInfo();
TLI = F.getSubtarget().getTargetLowering();
assert(BlockToChain.empty());
buildCFGChains(F);
BlockToChain.clear();
ChainAllocator.DestroyAll();
if (AlignAllBlock)
// Align all of the blocks in the function to a specific alignment.
for (MachineFunction::iterator FI = F.begin(), FE = F.end();
FI != FE; ++FI)
FI->setAlignment(AlignAllBlock);
// We always return true as we have no way to track whether the final order
// differs from the original order.
return true;
}
namespace {
/// \brief A pass to compute block placement statistics.
///
/// A separate pass to compute interesting statistics for evaluating block
/// placement. This is separate from the actual placement pass so that they can
/// be computed in the absence of any placement transformations or when using
/// alternative placement strategies.
class MachineBlockPlacementStats : public MachineFunctionPass {
/// \brief A handle to the branch probability pass.
const MachineBranchProbabilityInfo *MBPI;
/// \brief A handle to the function-wide block frequency pass.
const MachineBlockFrequencyInfo *MBFI;
public:
static char ID; // Pass identification, replacement for typeid
MachineBlockPlacementStats() : MachineFunctionPass(ID) {
initializeMachineBlockPlacementStatsPass(*PassRegistry::getPassRegistry());
}
bool runOnMachineFunction(MachineFunction &F) override;
void getAnalysisUsage(AnalysisUsage &AU) const override {
AU.addRequired<MachineBranchProbabilityInfo>();
AU.addRequired<MachineBlockFrequencyInfo>();
AU.setPreservesAll();
MachineFunctionPass::getAnalysisUsage(AU);
}
};
}
char MachineBlockPlacementStats::ID = 0;
char &llvm::MachineBlockPlacementStatsID = MachineBlockPlacementStats::ID;
INITIALIZE_PASS_BEGIN(MachineBlockPlacementStats, "block-placement-stats",
"Basic Block Placement Stats", false, false)
INITIALIZE_PASS_DEPENDENCY(MachineBranchProbabilityInfo)
INITIALIZE_PASS_DEPENDENCY(MachineBlockFrequencyInfo)
INITIALIZE_PASS_END(MachineBlockPlacementStats, "block-placement-stats",
"Basic Block Placement Stats", false, false)
bool MachineBlockPlacementStats::runOnMachineFunction(MachineFunction &F) {
// Check for single-block functions and skip them.
if (std::next(F.begin()) == F.end())
return false;
MBPI = &getAnalysis<MachineBranchProbabilityInfo>();
MBFI = &getAnalysis<MachineBlockFrequencyInfo>();
for (MachineFunction::iterator I = F.begin(), E = F.end(); I != E; ++I) {
BlockFrequency BlockFreq = MBFI->getBlockFreq(I);
Statistic &NumBranches = (I->succ_size() > 1) ? NumCondBranches
: NumUncondBranches;
Statistic &BranchTakenFreq = (I->succ_size() > 1) ? CondBranchTakenFreq
: UncondBranchTakenFreq;
for (MachineBasicBlock::succ_iterator SI = I->succ_begin(),
SE = I->succ_end();
SI != SE; ++SI) {
// Skip if this successor is a fallthrough.
if (I->isLayoutSuccessor(*SI))
continue;
BlockFrequency EdgeFreq = BlockFreq * MBPI->getEdgeProbability(I, *SI);
++NumBranches;
BranchTakenFreq += EdgeFreq.getFrequency();
}
}
return false;
}
|
{
"content_hash": "d7d012f66a2179109e39ebdba8cb0dce",
"timestamp": "",
"source": "github",
"line_count": 1159,
"max_line_length": 80,
"avg_line_length": 41.23554788610871,
"alnum_prop": 0.6430574154670238,
"repo_name": "Fairly/opencor",
"id": "33ae573407e3dafcecd2bdfa6a2c54b4ec6fa17c",
"size": "49836",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/plugins/thirdParty/LLVM/lib/CodeGen/MachineBlockPlacement.cpp",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Assembly",
"bytes": "1617"
},
{
"name": "Batchfile",
"bytes": "5129"
},
{
"name": "C",
"bytes": "9283641"
},
{
"name": "C++",
"bytes": "127655731"
},
{
"name": "CMake",
"bytes": "216018"
},
{
"name": "HTML",
"bytes": "9294"
},
{
"name": "NSIS",
"bytes": "4599"
},
{
"name": "Objective-C",
"bytes": "282234"
},
{
"name": "PHP",
"bytes": "317578"
},
{
"name": "Shell",
"bytes": "2879"
},
{
"name": "SourcePawn",
"bytes": "1544"
},
{
"name": "Visual Basic",
"bytes": "332"
},
{
"name": "XSLT",
"bytes": "58213"
}
],
"symlink_target": ""
}
|
require 'qtc/client'
require_relative '../common'
module Qtc::Cli::Platform
class SshKeys
include Qtc::Cli::Common
def list
response = platform_client.get('/user/ssh_keys')
response['results'].each do |ssh_key|
say "~ #{ssh_key['name']}"
end
end
def create(options)
raise ArgumentError.new('--name is required') if options.name.nil?
raise ArgumentError.new('--key is required') if options.key.nil?
unless File.exists?(options.key)
raise ArgumentError.new("#{options.key} does not exist")
end
data = {
name: options.name,
key: File.read(options.key)
}
platform_client.post('/user/ssh_keys', data)
end
def destroy(options)
raise ArgumentError.new('--name is required') if options.name.nil?
response = platform_client.get('/user/ssh_keys')
matches = response['results'].select{|r| r['name'] == options.name}
if matches.size == 0
raise ArgumentError.new("SSH key with name #{options.name} does not exist")
else
platform_client.delete("/user/ssh_keys/#{matches[0]['id']}")
end
end
end
end
|
{
"content_hash": "02e7bcf896c7416f614a7785836dfe72",
"timestamp": "",
"source": "github",
"line_count": 41,
"max_line_length": 83,
"avg_line_length": 28.4390243902439,
"alnum_prop": 0.6166380789022299,
"repo_name": "qtcloudservices/qtc-sdk-ruby",
"id": "5913fe9a251effc8f826b2db75b7ca1e0783e743",
"size": "1166",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "lib/qtc/cli/platform/ssh_keys.rb",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Ruby",
"bytes": "67276"
}
],
"symlink_target": ""
}
|
namespace MCEBuddy.GUI
{
partial class StatusForm
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.components = new System.ComponentModel.Container();
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(StatusForm));
this.MajorTitle = new System.Windows.Forms.Label();
this.backgroundUpdate = new System.ComponentModel.BackgroundWorker();
this.openFileDialog = new System.Windows.Forms.OpenFileDialog();
this.errorMsgLbl = new System.Windows.Forms.Label();
this.BetaTitle = new System.Windows.Forms.Label();
this.announcementLabel = new System.Windows.Forms.Label();
this.fileContextMenuStrip = new System.Windows.Forms.ContextMenuStrip(this.components);
this.mediaInfoToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.priorityBox = new System.Windows.Forms.ComboBox();
this.PriorityLabel = new System.Windows.Forms.Label();
this.toolTip = new System.Windows.Forms.ToolTip(this.components);
this.gettingStarted = new System.Windows.Forms.Label();
this.logLabel = new System.Windows.Forms.Label();
this.eventLogLbl = new System.Windows.Forms.Label();
this.showHistoryLbl = new System.Windows.Forms.Label();
this.closeCmd = new System.Windows.Forms.Button();
this.facebookBtn = new System.Windows.Forms.PictureBox();
this.remoteEngineCmd = new System.Windows.Forms.Button();
this.paypalButton = new System.Windows.Forms.PictureBox();
this.mcebuddyBox = new System.Windows.Forms.PictureBox();
this.rescanCmd = new System.Windows.Forms.Button();
this.stopCmd = new System.Windows.Forms.Button();
this.startCmd = new System.Windows.Forms.Button();
this.cancelFileCmd = new System.Windows.Forms.Button();
this.addFileCmd = new System.Windows.Forms.Button();
this.settingsCmd = new System.Windows.Forms.Button();
this.engineBox = new System.Windows.Forms.GroupBox();
this.fileBox = new System.Windows.Forms.GroupBox();
this.serverInfoLbl = new System.Windows.Forms.Label();
this.plainBackgroundPainter = new MCEBuddy.ProgressODoom.PlainBackgroundPainter();
this.plainBorderPainter = new MCEBuddy.ProgressODoom.PlainBorderPainter();
this.plainProgressPainter = new MCEBuddy.ProgressODoom.PlainProgressPainter();
this.gradientGlossPainter = new MCEBuddy.ProgressODoom.GradientGlossPainter();
this.currentQueue = new MCEBuddy.GUI.ListViewEx();
this.fileName = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
this.taskName = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
this.fileContextMenuStrip.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.facebookBtn)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.paypalButton)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.mcebuddyBox)).BeginInit();
this.engineBox.SuspendLayout();
this.fileBox.SuspendLayout();
this.SuspendLayout();
//
// MajorTitle
//
this.MajorTitle.Anchor = System.Windows.Forms.AnchorStyles.Top;
this.MajorTitle.AutoSize = true;
this.MajorTitle.Font = new System.Drawing.Font("Tahoma", 21.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.MajorTitle.ForeColor = System.Drawing.Color.OrangeRed;
this.MajorTitle.Location = new System.Drawing.Point(109, 32);
this.MajorTitle.Name = "MajorTitle";
this.MajorTitle.Size = new System.Drawing.Size(209, 35);
this.MajorTitle.TabIndex = 18;
this.MajorTitle.Text = "MCEBuddy XXX";
//
// backgroundUpdate
//
this.backgroundUpdate.WorkerReportsProgress = true;
this.backgroundUpdate.DoWork += new System.ComponentModel.DoWorkEventHandler(this.backgroundUpdate_DoWork);
this.backgroundUpdate.ProgressChanged += new System.ComponentModel.ProgressChangedEventHandler(this.backgroundUpdate_ProgressChanged);
//
// openFileDialog
//
this.openFileDialog.Filter = resources.GetString("openFileDialog.Filter");
this.openFileDialog.Multiselect = true;
//
// errorMsgLbl
//
this.errorMsgLbl.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right)));
this.errorMsgLbl.Font = new System.Drawing.Font("Tahoma", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.errorMsgLbl.ForeColor = System.Drawing.Color.OrangeRed;
this.errorMsgLbl.Location = new System.Drawing.Point(25, 281);
this.errorMsgLbl.Name = "errorMsgLbl";
this.errorMsgLbl.Size = new System.Drawing.Size(368, 40);
this.errorMsgLbl.TabIndex = 20;
this.errorMsgLbl.Text = "Message";
this.errorMsgLbl.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
this.errorMsgLbl.Visible = false;
//
// BetaTitle
//
this.BetaTitle.Anchor = System.Windows.Forms.AnchorStyles.Top;
this.BetaTitle.AutoSize = true;
this.BetaTitle.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.BetaTitle.ForeColor = System.Drawing.Color.OrangeRed;
this.BetaTitle.Location = new System.Drawing.Point(180, 67);
this.BetaTitle.Name = "BetaTitle";
this.BetaTitle.Size = new System.Drawing.Size(67, 13);
this.BetaTitle.TabIndex = 21;
this.BetaTitle.Text = "BETA XXX";
//
// announcementLabel
//
this.announcementLabel.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.announcementLabel.Font = new System.Drawing.Font("Tahoma", 11.25F, System.Drawing.FontStyle.Underline, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.announcementLabel.ForeColor = System.Drawing.SystemColors.HotTrack;
this.announcementLabel.Location = new System.Drawing.Point(96, 7);
this.announcementLabel.Margin = new System.Windows.Forms.Padding(0);
this.announcementLabel.Name = "announcementLabel";
this.announcementLabel.Size = new System.Drawing.Size(244, 25);
this.announcementLabel.TabIndex = 10;
this.announcementLabel.Text = "There is a new version!";
this.announcementLabel.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
this.toolTip.SetToolTip(this.announcementLabel, "Click here to download new version of MCEBuddy");
this.announcementLabel.Visible = false;
this.announcementLabel.Click += new System.EventHandler(this.announcementLabel_Click);
//
// fileContextMenuStrip
//
this.fileContextMenuStrip.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.mediaInfoToolStripMenuItem});
this.fileContextMenuStrip.Name = "fileContextMenuStrip";
this.fileContextMenuStrip.Size = new System.Drawing.Size(132, 26);
//
// mediaInfoToolStripMenuItem
//
this.mediaInfoToolStripMenuItem.AutoToolTip = true;
this.mediaInfoToolStripMenuItem.Name = "mediaInfoToolStripMenuItem";
this.mediaInfoToolStripMenuItem.Size = new System.Drawing.Size(131, 22);
this.mediaInfoToolStripMenuItem.Text = "Media info";
this.mediaInfoToolStripMenuItem.ToolTipText = "Click here to get media properties for selected files";
this.mediaInfoToolStripMenuItem.Click += new System.EventHandler(this.mediaInfoToolStripMenuItem_Click);
//
// priorityBox
//
this.priorityBox.Anchor = System.Windows.Forms.AnchorStyles.Right;
this.priorityBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.priorityBox.FlatStyle = System.Windows.Forms.FlatStyle.Popup;
this.priorityBox.ForeColor = System.Drawing.SystemColors.GrayText;
this.priorityBox.Items.AddRange(new object[] {
"High",
"Normal",
"Low"});
this.priorityBox.Location = new System.Drawing.Point(329, 368);
this.priorityBox.Margin = new System.Windows.Forms.Padding(3, 3, 3, 10);
this.priorityBox.MaxDropDownItems = 3;
this.priorityBox.Name = "priorityBox";
this.priorityBox.Size = new System.Drawing.Size(62, 21);
this.priorityBox.TabIndex = 9;
this.priorityBox.SelectedIndexChanged += new System.EventHandler(this.PriorityBox_SelectedIndexChanged);
this.priorityBox.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.priorityBox_KeyPress);
//
// PriorityLabel
//
this.PriorityLabel.Anchor = System.Windows.Forms.AnchorStyles.Right;
this.PriorityLabel.AutoSize = true;
this.PriorityLabel.ForeColor = System.Drawing.SystemColors.GrayText;
this.PriorityLabel.Location = new System.Drawing.Point(285, 371);
this.PriorityLabel.Name = "PriorityLabel";
this.PriorityLabel.Size = new System.Drawing.Size(38, 13);
this.PriorityLabel.TabIndex = 27;
this.PriorityLabel.Text = "Priority";
this.toolTip.SetToolTip(this.PriorityLabel, "High priority - convert faster but may make other running applications unresponsi" +
"ve\r\nLow priority - convert in the background but reduced interference with other" +
" running applications");
//
// toolTip
//
this.toolTip.AutomaticDelay = 200;
this.toolTip.AutoPopDelay = 10000;
this.toolTip.InitialDelay = 40;
this.toolTip.ReshowDelay = 40;
//
// gettingStarted
//
this.gettingStarted.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.gettingStarted.AutoSize = true;
this.gettingStarted.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.gettingStarted.ForeColor = System.Drawing.SystemColors.HotTrack;
this.gettingStarted.Location = new System.Drawing.Point(314, 67);
this.gettingStarted.Name = "gettingStarted";
this.gettingStarted.Size = new System.Drawing.Size(91, 13);
this.gettingStarted.TabIndex = 13;
this.gettingStarted.Text = "Getting started";
this.gettingStarted.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
this.toolTip.SetToolTip(this.gettingStarted, "Click here for MCEBuddy guide");
this.gettingStarted.Click += new System.EventHandler(this.gettingStarted_Click);
//
// logLabel
//
this.logLabel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.logLabel.AutoSize = true;
this.logLabel.ForeColor = System.Drawing.SystemColors.HotTrack;
this.logLabel.Location = new System.Drawing.Point(375, 46);
this.logLabel.Name = "logLabel";
this.logLabel.Size = new System.Drawing.Size(30, 13);
this.logLabel.TabIndex = 12;
this.logLabel.Text = "Logs";
this.logLabel.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
this.toolTip.SetToolTip(this.logLabel, "Click to open log folder");
this.logLabel.Click += new System.EventHandler(this.logLabel_Click);
//
// eventLogLbl
//
this.eventLogLbl.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.eventLogLbl.AutoSize = true;
this.eventLogLbl.ForeColor = System.Drawing.SystemColors.HotTrack;
this.eventLogLbl.Location = new System.Drawing.Point(314, 46);
this.eventLogLbl.Name = "eventLogLbl";
this.eventLogLbl.Size = new System.Drawing.Size(40, 13);
this.eventLogLbl.TabIndex = 11;
this.eventLogLbl.Text = "Events";
this.eventLogLbl.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
this.toolTip.SetToolTip(this.eventLogLbl, "Click here to open the MCEBuddy Windows Event Logs");
this.eventLogLbl.Click += new System.EventHandler(this.eventLogLbl_Click);
//
// showHistoryLbl
//
this.showHistoryLbl.AutoSize = true;
this.showHistoryLbl.ForeColor = System.Drawing.SystemColors.HotTrack;
this.showHistoryLbl.Location = new System.Drawing.Point(26, 67);
this.showHistoryLbl.Name = "showHistoryLbl";
this.showHistoryLbl.Size = new System.Drawing.Size(67, 13);
this.showHistoryLbl.TabIndex = 14;
this.showHistoryLbl.Text = "Show history";
this.showHistoryLbl.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
this.toolTip.SetToolTip(this.showHistoryLbl, "Click this button to show the history of all converted files.");
this.showHistoryLbl.Click += new System.EventHandler(this.showHistoryLbl_Click);
//
// closeCmd
//
this.closeCmd.Anchor = System.Windows.Forms.AnchorStyles.Right;
this.closeCmd.DialogResult = System.Windows.Forms.DialogResult.OK;
this.closeCmd.Image = global::MCEBuddy.GUI.Properties.Resources.mcebuddy_close;
this.closeCmd.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft;
this.closeCmd.Location = new System.Drawing.Point(301, 327);
this.closeCmd.Name = "closeCmd";
this.closeCmd.Size = new System.Drawing.Size(92, 23);
this.closeCmd.TabIndex = 7;
this.closeCmd.Text = "Close";
this.toolTip.SetToolTip(this.closeCmd, "Close this window, MCEBuddy will keep running in the background");
this.closeCmd.UseVisualStyleBackColor = true;
this.closeCmd.Click += new System.EventHandler(this.closeCmd_Click);
//
// facebookBtn
//
this.facebookBtn.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.facebookBtn.Image = ((System.Drawing.Image)(resources.GetObject("facebookBtn.Image")));
this.facebookBtn.Location = new System.Drawing.Point(317, 8);
this.facebookBtn.Name = "facebookBtn";
this.facebookBtn.Size = new System.Drawing.Size(23, 30);
this.facebookBtn.SizeMode = System.Windows.Forms.PictureBoxSizeMode.Zoom;
this.facebookBtn.TabIndex = 33;
this.facebookBtn.TabStop = false;
this.toolTip.SetToolTip(this.facebookBtn, "Click here to like MCEBuddy on facebook");
this.facebookBtn.Click += new System.EventHandler(this.facebookBtn_Click);
//
// remoteEngineCmd
//
this.remoteEngineCmd.Anchor = System.Windows.Forms.AnchorStyles.Right;
this.remoteEngineCmd.BackgroundImage = global::MCEBuddy.GUI.Properties.Resources.MCEBuddyUpdate_20x20;
this.remoteEngineCmd.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Center;
this.remoteEngineCmd.FlatStyle = System.Windows.Forms.FlatStyle.Popup;
this.remoteEngineCmd.Location = new System.Drawing.Point(254, 365);
this.remoteEngineCmd.Name = "remoteEngineCmd";
this.remoteEngineCmd.Size = new System.Drawing.Size(25, 25);
this.remoteEngineCmd.TabIndex = 8;
this.toolTip.SetToolTip(this.remoteEngineCmd, "Click here to connect to another MCEBuddy engine");
this.remoteEngineCmd.UseVisualStyleBackColor = true;
this.remoteEngineCmd.Click += new System.EventHandler(this.remoteEngineCmd_Click);
//
// paypalButton
//
this.paypalButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.paypalButton.Image = global::MCEBuddy.GUI.Properties.Resources.paypal_donate;
this.paypalButton.Location = new System.Drawing.Point(343, 7);
this.paypalButton.Name = "paypalButton";
this.paypalButton.Size = new System.Drawing.Size(62, 31);
this.paypalButton.SizeMode = System.Windows.Forms.PictureBoxSizeMode.AutoSize;
this.paypalButton.TabIndex = 22;
this.paypalButton.TabStop = false;
this.toolTip.SetToolTip(this.paypalButton, "If you like MCEBuddy, please click here to Donate - THANKS");
this.paypalButton.Click += new System.EventHandler(this.paypalButton_Click);
//
// mcebuddyBox
//
this.mcebuddyBox.Image = global::MCEBuddy.GUI.Properties.Resources.MCEBuddy50High;
this.mcebuddyBox.Location = new System.Drawing.Point(25, 7);
this.mcebuddyBox.Name = "mcebuddyBox";
this.mcebuddyBox.Size = new System.Drawing.Size(71, 55);
this.mcebuddyBox.TabIndex = 19;
this.mcebuddyBox.TabStop = false;
this.toolTip.SetToolTip(this.mcebuddyBox, "Click here to open MCEBuddy website");
this.mcebuddyBox.Click += new System.EventHandler(this.mceBuddyBox_Click);
//
// rescanCmd
//
this.rescanCmd.Anchor = System.Windows.Forms.AnchorStyles.None;
this.rescanCmd.FlatStyle = System.Windows.Forms.FlatStyle.Popup;
this.rescanCmd.Image = global::MCEBuddy.GUI.Properties.Resources.nav_refresh_blue;
this.rescanCmd.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft;
this.rescanCmd.Location = new System.Drawing.Point(165, 327);
this.rescanCmd.Name = "rescanCmd";
this.rescanCmd.Size = new System.Drawing.Size(92, 23);
this.rescanCmd.TabIndex = 6;
this.rescanCmd.Text = "Rescan";
this.toolTip.SetToolTip(this.rescanCmd, "Forces the MCEBuddy to recheck the Monitor locations for new video files to conve" +
"rt");
this.rescanCmd.UseVisualStyleBackColor = true;
this.rescanCmd.Click += new System.EventHandler(this.reScanCmd_Click);
//
// stopCmd
//
this.stopCmd.Enabled = false;
this.stopCmd.ForeColor = System.Drawing.SystemColors.ControlText;
this.stopCmd.Image = global::MCEBuddy.GUI.Properties.Resources.stop;
this.stopCmd.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft;
this.stopCmd.Location = new System.Drawing.Point(96, 15);
this.stopCmd.Name = "stopCmd";
this.stopCmd.Size = new System.Drawing.Size(75, 23);
this.stopCmd.TabIndex = 2;
this.stopCmd.Text = "Stop";
this.toolTip.SetToolTip(this.stopCmd, "Stop the MCEBuddy monitor and conversion tasks");
this.stopCmd.UseVisualStyleBackColor = true;
this.stopCmd.Click += new System.EventHandler(this.stopCmd_Click);
//
// startCmd
//
this.startCmd.Enabled = false;
this.startCmd.ForeColor = System.Drawing.SystemColors.ControlText;
this.startCmd.Image = global::MCEBuddy.GUI.Properties.Resources.media_play_green;
this.startCmd.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft;
this.startCmd.Location = new System.Drawing.Point(8, 15);
this.startCmd.Name = "startCmd";
this.startCmd.Size = new System.Drawing.Size(75, 23);
this.startCmd.TabIndex = 1;
this.startCmd.Text = "Start";
this.toolTip.SetToolTip(this.startCmd, "Start the MCEBuddy monitor and conversion tasks");
this.startCmd.UseVisualStyleBackColor = true;
this.startCmd.Click += new System.EventHandler(this.startCmd_Click);
//
// cancelFileCmd
//
this.cancelFileCmd.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.cancelFileCmd.Enabled = false;
this.cancelFileCmd.ForeColor = System.Drawing.SystemColors.ControlText;
this.cancelFileCmd.Image = global::MCEBuddy.GUI.Properties.Resources.delete;
this.cancelFileCmd.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft;
this.cancelFileCmd.Location = new System.Drawing.Point(8, 15);
this.cancelFileCmd.Name = "cancelFileCmd";
this.cancelFileCmd.Size = new System.Drawing.Size(75, 23);
this.cancelFileCmd.TabIndex = 3;
this.cancelFileCmd.Text = "Delete";
this.toolTip.SetToolTip(this.cancelFileCmd, "Select the file(s) in the queue to delete");
this.cancelFileCmd.UseVisualStyleBackColor = true;
this.cancelFileCmd.Click += new System.EventHandler(this.cancelFileCmd_Click);
//
// addFileCmd
//
this.addFileCmd.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.addFileCmd.Enabled = false;
this.addFileCmd.ForeColor = System.Drawing.SystemColors.ControlText;
this.addFileCmd.Image = global::MCEBuddy.GUI.Properties.Resources.add;
this.addFileCmd.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft;
this.addFileCmd.Location = new System.Drawing.Point(96, 15);
this.addFileCmd.Name = "addFileCmd";
this.addFileCmd.Size = new System.Drawing.Size(75, 23);
this.addFileCmd.TabIndex = 4;
this.addFileCmd.Text = "Add";
this.toolTip.SetToolTip(this.addFileCmd, "Manually add video file(s) to the queue to convert");
this.addFileCmd.UseVisualStyleBackColor = true;
this.addFileCmd.Click += new System.EventHandler(this.addFileCmd_Click);
//
// settingsCmd
//
this.settingsCmd.Anchor = System.Windows.Forms.AnchorStyles.Left;
this.settingsCmd.Image = global::MCEBuddy.GUI.Properties.Resources.control_panel;
this.settingsCmd.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft;
this.settingsCmd.Location = new System.Drawing.Point(29, 327);
this.settingsCmd.Name = "settingsCmd";
this.settingsCmd.Size = new System.Drawing.Size(92, 23);
this.settingsCmd.TabIndex = 5;
this.settingsCmd.Text = "Settings";
this.toolTip.SetToolTip(this.settingsCmd, "Stops the monitor and conversion tasks and opens a page to configure MCEBuddy");
this.settingsCmd.UseVisualStyleBackColor = true;
this.settingsCmd.Click += new System.EventHandler(this.settingsCmd_Click);
//
// engineBox
//
this.engineBox.Controls.Add(this.stopCmd);
this.engineBox.Controls.Add(this.startCmd);
this.engineBox.ForeColor = System.Drawing.SystemColors.ControlDark;
this.engineBox.Location = new System.Drawing.Point(25, 103);
this.engineBox.Name = "engineBox";
this.engineBox.Size = new System.Drawing.Size(179, 44);
this.engineBox.TabIndex = 30;
this.engineBox.TabStop = false;
this.engineBox.Text = "Conversion";
//
// fileBox
//
this.fileBox.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.fileBox.Controls.Add(this.cancelFileCmd);
this.fileBox.Controls.Add(this.addFileCmd);
this.fileBox.ForeColor = System.Drawing.SystemColors.ControlDark;
this.fileBox.Location = new System.Drawing.Point(214, 103);
this.fileBox.Name = "fileBox";
this.fileBox.Size = new System.Drawing.Size(179, 44);
this.fileBox.TabIndex = 30;
this.fileBox.TabStop = false;
this.fileBox.Text = "Files";
//
// serverInfoLbl
//
this.serverInfoLbl.Anchor = System.Windows.Forms.AnchorStyles.Left;
this.serverInfoLbl.AutoSize = true;
this.serverInfoLbl.Font = new System.Drawing.Font("Footlight MT Light", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.serverInfoLbl.ForeColor = System.Drawing.SystemColors.GrayText;
this.serverInfoLbl.Location = new System.Drawing.Point(31, 372);
this.serverInfoLbl.Name = "serverInfoLbl";
this.serverInfoLbl.Size = new System.Drawing.Size(62, 12);
this.serverInfoLbl.TabIndex = 31;
this.serverInfoLbl.Text = "Engine: Port:";
//
// plainBackgroundPainter
//
this.plainBackgroundPainter.Color = System.Drawing.Color.FromArgb(((int)(((byte)(240)))), ((int)(((byte)(240)))), ((int)(((byte)(240)))));
this.plainBackgroundPainter.GlossPainter = null;
//
// plainBorderPainter
//
this.plainBorderPainter.Color = System.Drawing.Color.Gainsboro;
this.plainBorderPainter.RoundedCorners = true;
this.plainBorderPainter.Style = MCEBuddy.ProgressODoom.PlainBorderPainter.PlainBorderStyle.Flat;
//
// plainProgressPainter
//
this.plainProgressPainter.Color = System.Drawing.Color.FromArgb(((int)(((byte)(120)))), ((int)(((byte)(210)))), ((int)(((byte)(80)))));
this.plainProgressPainter.GlossPainter = this.gradientGlossPainter;
this.plainProgressPainter.LeadingEdge = System.Drawing.Color.LimeGreen;
this.plainProgressPainter.ProgressBorderPainter = null;
//
// gradientGlossPainter
//
this.gradientGlossPainter.AlphaHigh = 192;
this.gradientGlossPainter.AlphaLow = 0;
this.gradientGlossPainter.Angle = 90F;
this.gradientGlossPainter.Color = System.Drawing.Color.White;
this.gradientGlossPainter.PercentageCovered = 55;
this.gradientGlossPainter.Style = MCEBuddy.ProgressODoom.GlossStyle.Top;
this.gradientGlossPainter.Successor = null;
//
// currentQueue
//
this.currentQueue.AllowDrop = true;
this.currentQueue.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.currentQueue.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] {
this.fileName,
this.taskName});
this.currentQueue.ContextMenuStrip = this.fileContextMenuStrip;
this.currentQueue.FullRowSelect = true;
this.currentQueue.HeaderStyle = System.Windows.Forms.ColumnHeaderStyle.None;
this.currentQueue.LineAfter = -1;
this.currentQueue.LineBefore = -1;
this.currentQueue.Location = new System.Drawing.Point(25, 155);
this.currentQueue.MinimumSize = new System.Drawing.Size(368, 120);
this.currentQueue.Name = "currentQueue";
this.currentQueue.ShowItemToolTips = true;
this.currentQueue.Size = new System.Drawing.Size(368, 120);
this.currentQueue.TabIndex = 9;
this.currentQueue.UseCompatibleStateImageBehavior = false;
this.currentQueue.View = System.Windows.Forms.View.Details;
this.currentQueue.DragDrop += new System.Windows.Forms.DragEventHandler(this.currentQueue_DragDrop);
this.currentQueue.DragEnter += new System.Windows.Forms.DragEventHandler(this.currentQueue_DragEnter);
this.currentQueue.KeyDown += new System.Windows.Forms.KeyEventHandler(this.currentQueue_KeyDown);
this.currentQueue.MouseDown += new System.Windows.Forms.MouseEventHandler(this.currentQueue_MouseDown);
this.currentQueue.MouseMove += new System.Windows.Forms.MouseEventHandler(this.currentQueue_MouseMove);
this.currentQueue.MouseUp += new System.Windows.Forms.MouseEventHandler(this.currentQueue_MouseUp);
//
// fileName
//
this.fileName.Name = "fileName";
this.fileName.Text = "File";
this.fileName.Width = 240;
//
// taskName
//
this.taskName.Name = "taskName";
this.taskName.Text = "Task";
this.taskName.Width = 100;
//
// StatusForm
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.AutoScroll = true;
this.AutoScrollMargin = new System.Drawing.Size(10, 10);
this.CancelButton = this.closeCmd;
this.ClientSize = new System.Drawing.Size(431, 412);
this.Controls.Add(this.showHistoryLbl);
this.Controls.Add(this.facebookBtn);
this.Controls.Add(this.remoteEngineCmd);
this.Controls.Add(this.eventLogLbl);
this.Controls.Add(this.logLabel);
this.Controls.Add(this.PriorityLabel);
this.Controls.Add(this.priorityBox);
this.Controls.Add(this.announcementLabel);
this.Controls.Add(this.currentQueue);
this.Controls.Add(this.serverInfoLbl);
this.Controls.Add(this.paypalButton);
this.Controls.Add(this.BetaTitle);
this.Controls.Add(this.gettingStarted);
this.Controls.Add(this.MajorTitle);
this.Controls.Add(this.mcebuddyBox);
this.Controls.Add(this.rescanCmd);
this.Controls.Add(this.settingsCmd);
this.Controls.Add(this.closeCmd);
this.Controls.Add(this.errorMsgLbl);
this.Controls.Add(this.engineBox);
this.Controls.Add(this.fileBox);
this.DoubleBuffered = true;
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
this.MaximizeBox = false;
this.MinimumSize = new System.Drawing.Size(439, 439);
this.Name = "StatusForm";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
this.Text = "MCEBuddy Status";
this.FormClosed += new System.Windows.Forms.FormClosedEventHandler(this.StatusForm_Closed);
this.Load += new System.EventHandler(this.StatusForm_Load);
this.Shown += new System.EventHandler(this.StatusForm_Shown);
this.ResizeEnd += new System.EventHandler(this.StatusForm_ResizeEnd);
this.Resize += new System.EventHandler(this.StatusForm_Resize);
this.fileContextMenuStrip.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.facebookBtn)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.paypalButton)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.mcebuddyBox)).EndInit();
this.engineBox.ResumeLayout(false);
this.fileBox.ResumeLayout(false);
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.Button startCmd;
private System.Windows.Forms.Button stopCmd;
private System.Windows.Forms.Button addFileCmd;
private System.Windows.Forms.Button cancelFileCmd;
private System.Windows.Forms.Button closeCmd;
private System.Windows.Forms.Button settingsCmd;
private System.Windows.Forms.PictureBox mcebuddyBox;
private System.Windows.Forms.Label MajorTitle;
private ProgressODoom.GradientGlossPainter gradientGlossPainter;
private ProgressODoom.PlainProgressPainter plainProgressPainter;
private ProgressODoom.PlainBackgroundPainter plainBackgroundPainter;
private ProgressODoom.PlainBorderPainter plainBorderPainter;
private System.ComponentModel.BackgroundWorker backgroundUpdate;
private System.Windows.Forms.OpenFileDialog openFileDialog;
private System.Windows.Forms.Label errorMsgLbl;
private System.Windows.Forms.Label BetaTitle;
private System.Windows.Forms.Button rescanCmd;
private System.Windows.Forms.PictureBox paypalButton;
private System.Windows.Forms.Label announcementLabel;
private ListViewEx currentQueue;
private System.Windows.Forms.ColumnHeader fileName;
private System.Windows.Forms.ColumnHeader taskName;
private System.Windows.Forms.ComboBox priorityBox;
private System.Windows.Forms.Label PriorityLabel;
private System.Windows.Forms.ToolTip toolTip;
private System.Windows.Forms.Label gettingStarted;
private System.Windows.Forms.Label logLabel;
private System.Windows.Forms.GroupBox engineBox;
private System.Windows.Forms.GroupBox fileBox;
private System.Windows.Forms.Label eventLogLbl;
private System.Windows.Forms.Button remoteEngineCmd;
private System.Windows.Forms.Label serverInfoLbl;
private System.Windows.Forms.ContextMenuStrip fileContextMenuStrip;
private System.Windows.Forms.ToolStripMenuItem mediaInfoToolStripMenuItem;
private System.Windows.Forms.Label showHistoryLbl;
private System.Windows.Forms.PictureBox facebookBtn;
}
}
|
{
"content_hash": "1bbfb4569ee6fa44762718e5a8b99b54",
"timestamp": "",
"source": "github",
"line_count": 610,
"max_line_length": 173,
"avg_line_length": 59.20327868852459,
"alnum_prop": 0.6441546214764358,
"repo_name": "AshitakaLax/MCE-Clean-Buddy",
"id": "7508da65d12b162a4269e2c41fdef342a9f24415",
"size": "36116",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/MCEBuddy.GUI/StatusForm.Designer.cs",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Batchfile",
"bytes": "1540"
},
{
"name": "C",
"bytes": "142914"
},
{
"name": "C#",
"bytes": "8764011"
},
{
"name": "C++",
"bytes": "112900"
},
{
"name": "HTML",
"bytes": "673124"
},
{
"name": "JavaScript",
"bytes": "1836"
},
{
"name": "Pascal",
"bytes": "84129"
},
{
"name": "PowerShell",
"bytes": "88827"
},
{
"name": "Python",
"bytes": "43128"
},
{
"name": "Shell",
"bytes": "54738"
},
{
"name": "Visual Basic",
"bytes": "11315"
}
],
"symlink_target": ""
}
|
var earcut = require('earcut');
import { polygon } from '@turf/helpers';
/**
* Tesselates a {@link Feature<Polygon>} into a {@link FeatureCollection<Polygon>} of triangles
* using [earcut](https://github.com/mapbox/earcut).
*
* @name tesselate
* @param {Feature<Polygon>} poly the polygon to tesselate
* @returns {FeatureCollection<Polygon>} a geometrycollection feature
* @example
* var poly = turf.polygon([[[11, 0], [22, 4], [31, 0], [31, 11], [21, 15], [11, 11], [11, 0]]]);
* var triangles = turf.tesselate(poly);
*
* //addToMap
* var addToMap = [poly, triangles]
*/
function tesselate(poly) {
if (!poly.geometry || (poly.geometry.type !== 'Polygon' && poly.geometry.type !== 'MultiPolygon')) {
throw new Error('input must be a Polygon or MultiPolygon');
}
var fc = {type: 'FeatureCollection', features: []};
if (poly.geometry.type === 'Polygon') {
fc.features = processPolygon(poly.geometry.coordinates);
} else {
poly.geometry.coordinates.forEach(function (coordinates) {
fc.features = fc.features.concat(processPolygon(coordinates));
});
}
return fc;
}
function processPolygon(coordinates) {
var data = flattenCoords(coordinates);
var dim = 2;
var result = earcut(data.vertices, data.holes, dim);
var features = [];
var vertices = [];
result.forEach(function (vert, i) {
var index = result[i];
vertices.push([data.vertices[index * dim], data.vertices[index * dim + 1]]);
});
for (var i = 0; i < vertices.length; i += 3) {
var coords = vertices.slice(i, i + 3);
coords.push(vertices[i]);
features.push(polygon([coords]));
}
return features;
}
function flattenCoords(data) {
var dim = data[0][0].length,
result = {vertices: [], holes: [], dimensions: dim},
holeIndex = 0;
for (var i = 0; i < data.length; i++) {
for (var j = 0; j < data[i].length; j++) {
for (var d = 0; d < dim; d++) result.vertices.push(data[i][j][d]);
}
if (i > 0) {
holeIndex += data[i - 1].length;
result.holes.push(holeIndex);
}
}
return result;
}
export default tesselate;
|
{
"content_hash": "a7b6f3e1339ee197d7f00f690641f9ac",
"timestamp": "",
"source": "github",
"line_count": 76,
"max_line_length": 104,
"avg_line_length": 29.355263157894736,
"alnum_prop": 0.5894217839533842,
"repo_name": "hooplert/jesper",
"id": "0416a9002056abc24c11a63e99032eaf4bbe5765",
"size": "2231",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "packages/turf-tesselate/index.js",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "JavaScript",
"bytes": "948765"
},
{
"name": "Shell",
"bytes": "109"
},
{
"name": "TypeScript",
"bytes": "38897"
}
],
"symlink_target": ""
}
|
<?xml version="1.0" encoding="utf-8"?>
<resources>
<!-- From: file:/Users/aotarolaalvarad/AndroidStudioProjects/MySimpleTweets/app/build/intermediates/exploded-aar/com.android.support/appcompat-v7/23.1.0/res/values-w500dp/values-w500dp.xml -->
<eat-comment/>
<integer name="abc_max_action_buttons">4</integer>
</resources>
|
{
"content_hash": "27218a40bd89563c2e3edeb3bf320a39",
"timestamp": "",
"source": "github",
"line_count": 6,
"max_line_length": 196,
"avg_line_length": 55.666666666666664,
"alnum_prop": 0.7395209580838323,
"repo_name": "aotarola/x-twit",
"id": "e0f8118fa686f56febffed421bbd4cabf24744fa",
"size": "334",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "app/build/intermediates/res/merged/debug/values-w500dp/values-w500dp.xml",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Java",
"bytes": "766772"
}
],
"symlink_target": ""
}
|
package org.apache.hc.client5.http.impl.classic;
import java.io.IOException;
import java.io.InputStream;
import org.apache.hc.client5.http.HttpResponseException;
import org.apache.hc.core5.http.ClassicHttpResponse;
import org.apache.hc.core5.http.HttpEntity;
import org.apache.hc.core5.http.io.entity.EntityUtils;
import org.apache.hc.core5.http.io.entity.StringEntity;
import org.junit.Assert;
import org.junit.Test;
import org.mockito.Mockito;
/**
* Unit tests for {@link BasicHttpClientResponseHandler}.
*/
public class TestAbstractHttpClientResponseHandler {
@Test
public void testSuccessfulResponse() throws Exception {
final ClassicHttpResponse response = Mockito.mock(ClassicHttpResponse.class);
final HttpEntity entity = new StringEntity("42");
Mockito.when(response.getCode()).thenReturn(200);
Mockito.when(response.getEntity()).thenReturn(entity);
final AbstractHttpClientResponseHandler<Integer> handler = new AbstractHttpClientResponseHandler<Integer>() {
@Override
public Integer handleEntity(final HttpEntity entity) throws IOException {
return Integer.valueOf(new String(EntityUtils.toByteArray(entity)));
}
};
final Integer number = handler.handleResponse(response);
Assert.assertEquals(42, number.intValue());
}
@SuppressWarnings("boxing")
@Test
public void testUnsuccessfulResponse() throws Exception {
final InputStream instream = Mockito.mock(InputStream.class);
final HttpEntity entity = Mockito.mock(HttpEntity.class);
Mockito.when(entity.isStreaming()).thenReturn(true);
Mockito.when(entity.getContent()).thenReturn(instream);
final ClassicHttpResponse response = Mockito.mock(ClassicHttpResponse.class);
Mockito.when(response.getCode()).thenReturn(404);
Mockito.when(response.getEntity()).thenReturn(entity);
final BasicHttpClientResponseHandler handler = new BasicHttpClientResponseHandler();
try {
handler.handleResponse(response);
Assert.fail("HttpResponseException expected");
} catch (final HttpResponseException ex) {
Assert.assertEquals(404, ex.getStatusCode());
}
Mockito.verify(entity).getContent();
Mockito.verify(instream).close();
}
}
|
{
"content_hash": "a0f08bd2536de485c5316e73d55a9ad0",
"timestamp": "",
"source": "github",
"line_count": 62,
"max_line_length": 117,
"avg_line_length": 38.03225806451613,
"alnum_prop": 0.7145886344359627,
"repo_name": "UlrichColby/httpcomponents-client",
"id": "24b297571a37dc32ebc57ef59800f8478f7e9128",
"size": "3541",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "httpclient5/src/test/java/org/apache/hc/client5/http/impl/classic/TestAbstractHttpClientResponseHandler.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "ApacheConf",
"bytes": "21611"
},
{
"name": "CSS",
"bytes": "5273"
},
{
"name": "Java",
"bytes": "3003244"
},
{
"name": "XSLT",
"bytes": "26167"
}
],
"symlink_target": ""
}
|
<?php
namespace MCNElasticSearch\Service\Document\Writer\Exception;
use MCNElasticSearch\Service\Exception as ServiceException;
/**
* Class InvalidArgumentException
*/
class InvalidArgumentException extends ServiceException\InvalidArgumentException
{
}
|
{
"content_hash": "a9b10df877b8c7060fb4dd299cede4ad",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 80,
"avg_line_length": 19.923076923076923,
"alnum_prop": 0.833976833976834,
"repo_name": "macnibblet/MCNElasticSearch",
"id": "abf17328453fd53257726c8bad6d28af0855d7d1",
"size": "2102",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/MCNElasticSearch/Service/Document/Writer/Exception/InvalidArgumentException.php",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "PHP",
"bytes": "206288"
}
],
"symlink_target": ""
}
|
package com.atlassian.theplugin.jira.api;
public interface JIRAProject extends JIRAQueryFragment {
String getKey();
String getUrl();
String getLead();
String getDescription();
}
|
{
"content_hash": "79ebb4716d645e3aa38931b22a5b0cd5",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 56,
"avg_line_length": 15.384615384615385,
"alnum_prop": 0.71,
"repo_name": "joewalnes/idea-community",
"id": "ea3b4946e671e31e5f808a220c3ba207bb99dd2a",
"size": "799",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "plugins/tasks/jira-connector/src/atlassian/java/com/atlassian/theplugin/jira/api/JIRAProject.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "ActionScript",
"bytes": "387"
},
{
"name": "C",
"bytes": "136045"
},
{
"name": "C#",
"bytes": "103"
},
{
"name": "C++",
"bytes": "40449"
},
{
"name": "Emacs Lisp",
"bytes": "2507"
},
{
"name": "Erlang",
"bytes": "10"
},
{
"name": "Groovy",
"bytes": "361320"
},
{
"name": "Java",
"bytes": "89694599"
},
{
"name": "JavaScript",
"bytes": "978"
},
{
"name": "Objective-C",
"bytes": "1877"
},
{
"name": "PHP",
"bytes": "145"
},
{
"name": "Perl",
"bytes": "6523"
},
{
"name": "Python",
"bytes": "1699274"
},
{
"name": "Shell",
"bytes": "6965"
},
{
"name": "VimL",
"bytes": "5950"
}
],
"symlink_target": ""
}
|
module SettingsHelper
def timeago(time)
if time.nil?
'N/A'
else
content_tag(:time, time.to_s(:feed), datetime: time.utc.iso8601, class: 'timeago', title: "Last updated: #{time.to_s(:feed)}" )
end
end
end
|
{
"content_hash": "75fa36085a23df275a235400fd793078",
"timestamp": "",
"source": "github",
"line_count": 9,
"max_line_length": 133,
"avg_line_length": 25.77777777777778,
"alnum_prop": 0.6206896551724138,
"repo_name": "azukiapp/feedbin",
"id": "5c2cd272f5688f31edc354515dca463fe93e70d5",
"size": "232",
"binary": false,
"copies": "4",
"ref": "refs/heads/master",
"path": "app/helpers/settings_helper.rb",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "160695"
},
{
"name": "CoffeeScript",
"bytes": "70558"
},
{
"name": "HTML",
"bytes": "152669"
},
{
"name": "JavaScript",
"bytes": "5985"
},
{
"name": "Ruby",
"bytes": "331154"
}
],
"symlink_target": ""
}
|
import _Object$getPrototypeOf from "@babel/runtime-corejs3/core-js/object/get-prototype-of";
import _Object$setPrototypeOf from "@babel/runtime-corejs3/core-js/object/set-prototype-of";
export default function _getPrototypeOf(o) {
_getPrototypeOf = _Object$setPrototypeOf ? _Object$getPrototypeOf : function _getPrototypeOf(o) {
return o.__proto__ || _Object$getPrototypeOf(o);
};
return _getPrototypeOf(o);
}
|
{
"content_hash": "63ad49ca54ddf184f3206aab148e003f",
"timestamp": "",
"source": "github",
"line_count": 8,
"max_line_length": 99,
"avg_line_length": 52.375,
"alnum_prop": 0.7565632458233891,
"repo_name": "ChromeDevTools/devtools-frontend",
"id": "193b6325f85c58503118b3ee086eae28ca1ea576",
"size": "419",
"binary": false,
"copies": "3",
"ref": "refs/heads/main",
"path": "node_modules/@babel/runtime-corejs3/helpers/esm/getPrototypeOf.js",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "CSS",
"bytes": "615241"
},
{
"name": "Dart",
"bytes": "205"
},
{
"name": "HTML",
"bytes": "317251"
},
{
"name": "JavaScript",
"bytes": "1401177"
},
{
"name": "LLVM",
"bytes": "1918"
},
{
"name": "Makefile",
"bytes": "687"
},
{
"name": "Python",
"bytes": "133111"
},
{
"name": "Shell",
"bytes": "1122"
},
{
"name": "TypeScript",
"bytes": "15230731"
},
{
"name": "WebAssembly",
"bytes": "921"
}
],
"symlink_target": ""
}
|
DROP FUNCTION IF EXISTS photo.get_gps(INTEGER);
CREATE OR REPLACE FUNCTION photo.get_gps
(
_photo_id INTEGER,
_roles TEXT[]
)
RETURNS TABLE
(
source_latitude REAL,
source_longitude REAL,
override_latitude REAL,
override_longitude REAL
)
LANGUAGE SQL
AS $$
SELECT DISTINCT
p.gps_latitude AS source_latitude,
p.gps_longitude AS source_longitude,
pgo.latitude AS override_latitude,
pgo.longitude AS override_longitude
FROM photo.photo p
INNER JOIN photo.category_role cr ON p.category_id = cr.category_id
INNER JOIN maw.role r ON cr.role_id = r.id
LEFT OUTER JOIN photo.gps_override pgo ON p.id = pgo.photo_id
WHERE p.id = _photo_id
AND r.name = ANY(_roles);
$$;
GRANT EXECUTE
ON FUNCTION photo.get_gps
TO website;
|
{
"content_hash": "e31339c1124ea09417c8f0191eff7083",
"timestamp": "",
"source": "github",
"line_count": 34,
"max_line_length": 72,
"avg_line_length": 24.352941176470587,
"alnum_prop": 0.6618357487922706,
"repo_name": "AerisG222/mikeandwan.us",
"id": "b86294ab3d166b81e4d7af254d98bee4353bf62e",
"size": "828",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/maw_database_pg/011/funcs/photo.get_gps.sql",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C#",
"bytes": "574432"
},
{
"name": "HTML",
"bytes": "44848917"
},
{
"name": "JavaScript",
"bytes": "19626"
},
{
"name": "PLpgSQL",
"bytes": "106573"
},
{
"name": "SCSS",
"bytes": "10103"
},
{
"name": "Shell",
"bytes": "52855"
},
{
"name": "TypeScript",
"bytes": "96877"
}
],
"symlink_target": ""
}
|
'use strict';
angular.module( 'com.teachscape.coding' ).filter( 'date', function(){
return function( input ){
if( typeof input === "undefined" ){ return ""; } //nothing to format
var date = new Date( input );
return date.getMonth() + "/" + date.getDate() + "/" + date.getUTCFullYear();
}
} );
|
{
"content_hash": "9a192f5a39cfe3c9eb6929ac49e79939",
"timestamp": "",
"source": "github",
"line_count": 11,
"max_line_length": 78,
"avg_line_length": 27.727272727272727,
"alnum_prop": 0.6131147540983607,
"repo_name": "webnesto/com.teachscape.coding",
"id": "527445243e241edbdda2cc93cb18c6fdc7a1a519",
"size": "305",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "app/components/filter_date.js",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "4745"
},
{
"name": "HTML",
"bytes": "4995"
},
{
"name": "JavaScript",
"bytes": "10925"
}
],
"symlink_target": ""
}
|
#ifndef _OGREBULLETCOLLISIONS_MinkowskiSumShape_H
#define _OGREBULLETCOLLISIONS_MinkowskiSumShape_H
#include "OgreBulletCollisionsPreRequisites.h"
#include "OgreBulletCollisionsShape.h"
namespace OgreBulletCollisions
{
// -------------------------------------------------------------------------
// basic MinkowskiSumShape
class MinkowskiSumCollisionShape : public CollisionShape
{
public:
MinkowskiSumCollisionShape(CollisionShape* shapeA, CollisionShape* shapeB);
virtual ~MinkowskiSumCollisionShape();
};
}
#endif //_OGREBULLETCOLLISIONS_MinkowskiSumShape_H
|
{
"content_hash": "8eaa544b5f5e30d977ee9f24cdcca560",
"timestamp": "",
"source": "github",
"line_count": 23,
"max_line_length": 80,
"avg_line_length": 26.17391304347826,
"alnum_prop": 0.6843853820598007,
"repo_name": "HATtrick-games/ICT312",
"id": "af9a6dd9da6a7199b480af942888334a377729e4",
"size": "2075",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "source/thirdparty/include/Shapes/OgreBulletCollisionsMinkowskiSumShape.h",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Assembly",
"bytes": "8044"
},
{
"name": "C",
"bytes": "3066523"
},
{
"name": "C++",
"bytes": "27072801"
},
{
"name": "Lua",
"bytes": "2034"
},
{
"name": "Objective-C",
"bytes": "211212"
},
{
"name": "Perl",
"bytes": "2036"
}
],
"symlink_target": ""
}
|
$(document).ready(function () {
var obj = window.dialogArguments;
if (obj)
{
if (obj.IsDetails)
{
ideaDerivedId = obj.IdeaDerivedId;
ShowDetails(ideaDerivedId);
if (obj.Status == "success") {
$("#submitBtn").hide();
}
else {
$("#submitBtn").val("resubmit");
}
}
else
{
AutoFillInForm(obj);
}
}
document.onclick = function (e) {
var ele = e.target || e.srcElement;
//if isHide is true, hide the product tree
if (isHide) {
if (ele.className !== "bbit-tree-ec-icon bbit-tree-elbow-end-minus") {
$("#searchDiv").fadeOut("slow");
$("#tree").fadeOut("slow");
$("#closeTreeDiv").fadeOut("slow");
}
$("#productsNameList span").html("");
$("#productsNameList").removeClass("productsNameListC");
}
else {
isHide = true;
}
};
load();
$("#ProductTreeDiv").click(function (event) {
ShowProductTree();
event.stopPropagation();
});
$("#txtProductTree").click(function (event) {
ShowProductTree();
event.stopPropagation();
});
$("#tree_select_arrow").click(function (event) {
ShowProductTree();
event.stopPropagation();
});
$("#confirmSelect").click(function () {
$("#tree").fadeOut();
$("#searchDiv").fadeOut();
$("#productsNameList span").html("");
$("#productsNameList").attr("class", "");
$("#closeTreeDiv").fadeOut();
return false;
});
});
function ShowProductTree() {
$("#searchDiv").fadeIn("slow");
$("#matchtextbox").focus();
$("#closeTreeDiv").fadeIn("slow");
$("#tree").fadeIn("slow");
$("#RegionList").hide();
}
function ShowDetails(ideaDerivedId)
{
$("#cancleBtn").hide();
$("#exitBtn").show();
$.ajax({
url: "/IdeaStorage.srv",
data: { IdeaDerivedId:ideaDerivedId, IsDetails:true,BehaviorType: "read" },
type: "POST",
cache: false,
success: function (data) {
var result = $.parseJSON(data);
var rowList = result["_ContentIdeaList"];
//$("#PriorityDrp").find("option").remove();
//$("#ReqDetailsDrp").find("option").remove();
$.each(rowList, function (key, val) {
$("#TitleInput").val(val.Title);
$("#audienceCkx input:checkbox").each(function (key1, val1) {
if (unescape(val.Audience).indexOf($(this).val()) != -1)
{
$(this).attr("checked", true);
}
});
$("#suggAssetTypeCks input:checkbox").each(function (key1, val1) {
if (unescape(val.SuggestedAssetType).indexOf($(this).val()) != -1) {
$(this).attr("checked", true);
}
});
//$("#PriorityDrp").append("<option>" + val.TriagePriority + "</option>");
//$("#ReqDetailsDrp").append("<option>" + val.RequestDetails + "</option>");
$("#PriorityDrp").val(val.TriagePriority);
$("#ReqDetailsDrp").val(val.RequestDetails);
// Restore Tree.
if (val.PesProductIds != "" && val.PesProductIds != null) {
var treeNodes = unescape(val.TreeNodes);
treeNodes = $.parseXML(treeNodes);
var treeHTML = unescape(val.TreeHtml);
var $rootNode = $(treeNodes).find("all");
var root = {
"id": $rootNode.attr("id"),
"Text": $rootNode.attr("text"),
"value": $rootNode.attr("value"),
"showcheck": $rootNode.attr("showcheck") == "true" ? true : false,
complete: $rootNode.attr("complete") == "true" ? true : false,
"isexpand": $rootNode.attr("isexpand") == "true" ? true : false,
"checkstate": $rootNode.attr("checkstate"),
"hasChildren": $rootNode.attr("hasChildren") == "true" ? true : false,
"Level": "0"
}
if ($(treeNodes).find("all").children().length > 0) {
var nodesList = CreateDataSource(root, $(treeNodes).find("all").children(), 0)
root["ChildNodes"] = nodesList;
o.data = [root];
identifier = false;
$("#tree").treeview(o);
$("#tree").height(parseInt(val.TreeHeight));
$("#closeTreeDiv").height(parseInt(val.TreeHeight) + 20);
$("#calculatingDiv").height(parseInt(val.TreeHeight));
$("#tree").width(parseInt(val.TreeWidth));
$("#closeTreeDiv").width(parseInt(val.TreeWidth));
$("#searchDiv").width(parseInt(val.TreeWidth));
$("#matchtextbox").width(parseInt(val.TreeWidth) - 10);
$("#productsNameList").width(parseInt(val.TreeWidth));
$("#calculatingDiv").width(parseInt(val.TreeWidth));
$("#calculatingPar").css("margin-top", ((parseInt(val.TreeHeight) + 28 - 72) / 2));
$("#txtProductTree").attr("value", "Selected " + val.TreeItems + " items");
selectedProducts = val.TreeID + ",";
$("#txtProductTreeHidden").attr("value", selectedProducts);
}
}
$("#SupportTopic").val(val.SupportTopic);
supportTopicId = val.SupportTopicId;
$("#Description").val(val.Description);
$("#BusiJustification").val(val.BusinessJustification);
$("#RequestedBy").val(val.Requestedby);
$("#RequestedBy").removeClass("inputTxt");
});
},
error: function (error)
{ }
});
}
function AutoFillInForm(obj)
{
supportTopicId = obj.SupportId;
//var busiJustification = "LaborP:" + obj.LaborP + " Labor:" + obj.Labor + " TMPI:" + obj.TMPI +
// "\r"+"CaseVolumeP:" + obj.CaseVolP + " CaseVolume:" + obj.CaseVol +
// " TB:" + obj.TB + "\r" + "BB:" + obj.BB + " TotalB:" + obj.TotalB;
var busiJustification = "Between " + obj.startDate + " and " + obj.endDate + " , " + "Labor hour is " + obj.Labor + "; TMPI is " + obj.TMPI +
"; " + "CaseVolume is " + obj.CaseVol +
"; Top box is " + obj.TB + " ; " + "bottom box is " + obj.BB;
$("#SupportTopic").val(obj.FullPath.replace(/\^/g,"\\"));
$("#BusiJustification").val(busiJustification);
$("#RequestedBy").val(obj.UserName + "@microsoft.com");
$("#RequestedBy").removeClass("inputTxt")
}
function SubmitIdea()
{
var result = ValidateInput();
if (result == false)
{
return false;
}
titleVal = $("#TitleInput").val();
assetTypeVal = GetSelectedValues("suggAssetTypeCks");
priorityVal = $("#PriorityDrp").val();
requestedDetailsVal = $("#ReqDetailsDrp").val();
var value = $("#txtProductTreeHidden").val();
pesProdIdsVal = value.substring(0, value.length - 1);
descriptionVal = $("#Description").val();
busiJustVal = $("#BusiJustification").val();
requestedByVal = $("#RequestedBy").val();
//get values of audience
audienceVal = GetSelectedValues("audienceCkx");
var treeHTML = "";
var treeID = "";
var treeHeight = "";
var treeWidth = "";
var treeItems = "";
var treeNodes = "";
if (pesProdIdsVal != "")
{
treeHTML = $("#tree").html();
treeHTML = escape(treeHTML);
treeHeight = $("#tree").height();
treeWidth = $("#tree").width();
treeID = pesProdIdsVal;
treeNodes = "<all id='allid' text='all' value='all' showcheck='false' complete='true' checkstate='0' isexpand='true' hasChildren='true'>";
treeNodes = LoopNodes(allNodes[0].ChildNodes, treeNodes, 0);
treeNodes = treeNodes + "</all>";
treeNodes = escape(treeNodes);
var selectedItemsText = $("#txtProductTree").val();
treeItems = selectedItemsText.match(/\d+/)[0];
}
var proTree = {
TreeHtml: treeHTML,
TreeHeight: treeHeight,
TreeWidth: treeWidth,
TreeID: treeID,
TreeNodes: treeNodes,
TreeItems:treeItems
};
var ideacontent = {
IdeaDerivedId:ideaDerivedId,
Title: titleVal,
SupportTopicId: supportTopicId,
Audience: audienceVal,
SuggAssetType: assetTypeVal,
Priority: priorityVal,
ReqDetails: requestedDetailsVal,
PesProductIDs: pesProdIdsVal,
SupportTopic: $("#SupportTopic").val(),
Description: descriptionVal,
BusJustification: busiJustVal,
RequestedBy: requestedByVal,
ProductTree:proTree
};
$("#loadImageDiv").show();
$.ajax({
url: "/IdeaStorage.srv",
data: ideacontent,
type: "POST",
cache: false,
success: function (data) {
var result = $.parseJSON(data);
if (result["IsSuccess"]) {
var msg = result["SuccessMsg"];
if (result["ErrorMsgList"]!=null && result["ErrorMsgList"].length > 0) {
msg += " \n"+result["ErrorMsgList"];
}
alert(msg);
} else {
var error = "";
error += result["ErrorMsgList"];
alert(error);
}
$("#loadImageDiv").hide();
if (result.IsSuccess) {
window.close();
}
},
error: function (error)
{
alert("failed to submit!");
$("#loadImageDiv").hide();
}
});
}
function LoopNodes(nodes, str, level) {
var xmlStr1 = "";
level = level + 1;
$.each(nodes, function (key, val) {
if (val.ChildNodes != null) {
str = str + "<SupportLevel" + level + " id='" + val.id + "' text='" + val.Text + "' value='" + val.Value + "' showcheck='" + val.showcheck + "' complete='" + val.complete + "' checkstate='" + val.checkstate + "' isexpand='" + true + "' hasChildren='" + val.hasChildren + "'>";
xmlStr1 = LoopNodes(val.ChildNodes, str, level);
str = xmlStr1;
}
else {
str = str + "<SupportLevel" + level + " id='" + val.id + "' text='" + val.Text + "' value='" + val.Value + "' showcheck='" + val.showcheck + "' complete='" + val.complete + "' checkstate='" + val.checkstate + "' isexpand='" + false + "' hasChildren='" + val.hasChildren + "'>";
}
str = str + "</SupportLevel" + level + ">";
xmlStr1 = str;
});
return xmlStr1;
}
function show_confirm()
{
var r=confirm("Submit successfully!\r\rClick [OK] to view idea lists");
if (r==true)
{
window.open("idealists.aspx");
}
//else
//{
// alert("You pressed Cancel!");
//}
}
function CancleIdea()
{
window.close();
}
function EmptyText(id)
{
if ($("#" + id).val() == "title for your content idea" || $("#" + id).val() == "someone@example.com")
{
$("#" + id).val("");
$("#" + id).removeClass("inputTxt");
}
}
function ValidateInput()
{
$("#errorInfo").empty();
var title = $("#TitleInput").val();
var description = $("#Description").val();
var busiJust = $("#BusiJustification").val();
var tips = "Please provide values for ";
var invalidEmailMsg = " email address is invalid.";
var tipArray = new Array();
//validate title
if (title == "title for your content idea" || title == "")
{
tipArray.push(" title");
}
//validate suggestedassettype
var assetTypeVal = GetSelectedValues("suggAssetTypeCks");
if (assetTypeVal == "") {
tipArray.push(" SuggestedAssetType");
}
//validate description
if(description == "")
{
tipArray.push(" description");
}
//validate busiJustification
if(busiJust == "")
{
tipArray.push(" BusinessJustification");
}
var returnVal = true;
if ($("#RequestedBy").val().trim().length == 0) {
tipArray.push(" email");
}
else if (!ValidateEmailText("RequestedBy")) {
// invalid email
if (tipArray.length > 0) {
tipArray.push(invalidEmailMsg);
}
else {
var invalidEmailHtml = "<ul>";
invalidEmailHtml += "<li>" + invalidEmailMsg + "</li>";
invalidEmailHtml += "</ul>";
$("#errorInfo").append(invalidEmailHtml);
}
returnVal = false;
}
if (tipArray.length > 0) {
tips += tipArray.join();
}
if (tips.toLowerCase() != "please provide values for ")
{
var errorhtml = "<ul>";
errorhtml += "<li>" + tips + "</li>";
errorhtml += "</ul>";
$("#errorInfo").append(errorhtml);
returnVal = false;
}
return returnVal;
}
function ValidateEmailText(id) {
var emailValue = $("#" + id).val().trim();
if (emailValue == "") {
return false;
}
//$("#ErrorMsg").empty();
var exp = new RegExp(/^[a-zA-Z0-9]+([._-]?[a-zA-Z0-9]+)+@\w+([\.-]\w+)*\.\w{2,4}$/);
var result = exp.test($("#"+id).val());
if (!result || (emailValue.toLowerCase() == "someone@example.com")) {
return false;
}
return true;
}
function GetSelectedValues(cla)
{
var _selectedValues = "";
$("#" + cla + " input:checkbox:checked").each(function () {
_selectedValues += escape($(this).val()) + ",";
});
return _selectedValues.substring(0, _selectedValues.length - 1);
}
function SaveTreeState()
{
var treeHTML = "";
var treeID = "";
var treeHeight = "";
var treeWidth = "";
var treeItems = "";
var treeNodes = "";
treeHTML = $("#tree").html();
treeHTML = escape(treeHTML);
treeHeight = $("#tree").height();
treeWidth = $("#tree").width();
treeID = productVersion;
treeNodes = "<all id='allid' text='all' value='all' showcheck='false' complete='true' checkstate='0' isexpand='true' hasChildren='true'>";
treeNodes = LoopNodes(allNodes[0].ChildNodes, treeNodes, 0);
treeNodes = treeNodes + "</all>";
treeNodes = escape(treeNodes);
var selectedItemsText = $("#txtProductTree").val();
treeItems = selectedItemsText.match(/\d+/)[0];
}
|
{
"content_hash": "970749fcbb535ddf78b8bfc01cd42d17",
"timestamp": "",
"source": "github",
"line_count": 422,
"max_line_length": 289,
"avg_line_length": 35.46682464454976,
"alnum_prop": 0.5033072760072159,
"repo_name": "QiQi57/TestGulpCmd",
"id": "f1ad79a7e9b9e8ba2b292a9e31f1c8657bea680c",
"size": "14969",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "MyFilesFolder/js/submitcontentidea.js",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "ASP",
"bytes": "107317"
},
{
"name": "CSS",
"bytes": "287128"
},
{
"name": "JavaScript",
"bytes": "1191281"
}
],
"symlink_target": ""
}
|
#include "db_config.h"
#include "db_int.h"
/* vxworks API to get system clock rate */
int sysClkRateGet (void);
/*
* __os_yield --
* Yield the processor, optionally pausing until running again.
*/
void
__os_yield(env, secs, usecs)
ENV *env;
u_long secs, usecs; /* Seconds and microseconds. */
{
int ticks_delay, ticks_per_second;
COMPQUIET(env, NULL);
/* Don't require the values be normalized. */
for (; usecs >= US_PER_SEC; usecs -= US_PER_SEC)
++secs;
/*
* Yield the processor so other processes or threads can run.
*
* As a side effect, taskDelay() moves the calling task to the end of
* the ready queue for tasks of the same priority. In particular, you
* can yield the CPU to any other tasks of the same priority by
* "delaying" for zero clock ticks.
*
* Never wait less than a tick, if we were supposed to wait at all.
*/
ticks_per_second = sysClkRateGet();
ticks_delay =
secs * ticks_per_second + (usecs * ticks_per_second) / US_PER_SEC;
if (ticks_delay == 0 && (secs != 0 || usecs != 0))
ticks_delay = 1;
(void)taskDelay(ticks_delay);
}
|
{
"content_hash": "c2974417e03307f61699d8681ec31724",
"timestamp": "",
"source": "github",
"line_count": 43,
"max_line_length": 71,
"avg_line_length": 25.488372093023255,
"alnum_prop": 0.6605839416058394,
"repo_name": "genehallman/node-berkeleydb",
"id": "1a588d3eddb7e9560fa4ee8434f488c30563154b",
"size": "1246",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "deps/db-18.1.40/src/os_vxworks/os_vx_yield.c",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C",
"bytes": "294"
},
{
"name": "C++",
"bytes": "21867"
},
{
"name": "JavaScript",
"bytes": "7293"
},
{
"name": "Makefile",
"bytes": "344"
},
{
"name": "Python",
"bytes": "500"
}
],
"symlink_target": ""
}
|
layout: post100
title: Advanced Configuration
categories: XAP100
parent: maven-plugin.html
weight: 100
---
This page contains information beyond the basics. It was created for those who want to know a little bit more about how OpenSpaces and Maven integrate. Basically, the information given in [OpenSpaces Maven Plugin](./maven-plugin.html) should be sufficient for the common user.
# Processing Unit Assembly Definition
The OpenSpaces maven plugin uses the maven assembly plugin to generate the processing unit directory structure. Each PU module has the file <module-name>/src/main/assembly/assembly.xml that defines the assembly structure. One of its tasks is to determine which of the dependency JARS go into the lib directory and which go into the shared-lib directory.
**assembly.xml**
{% highlight xml %}
<assembly>
<id>assemble-pu</id>
<formats>
<format>jar</format>
<format>dir</format>
</formats>
<includeBaseDirectory>false</includeBaseDirectory>
<fileSets>
<fileSet>
<directory>target/classes</directory>
<lineEnding>keep</lineEnding>
<outputDirectory>/</outputDirectory>
<includes>
<include>**/**</include>
</includes>
</fileSet>
</fileSets>
<dependencySets>
<dependencySet>
<useProjectArtifact>false</useProjectArtifact>
<useTransitiveDependencies>false</useTransitiveDependencies>
<outputDirectory>lib</outputDirectory>
<excludes>
<exclude>com.mycompany.app:common</exclude>
</excludes>
</dependencySet>
<dependencySet>
<useProjectArtifact>false</useProjectArtifact>
<useTransitiveDependencies>true</useTransitiveDependencies>
<useTransitiveFiltering>true</useTransitiveFiltering>
<outputDirectory>shared-lib</outputDirectory>
<includes>
<include>com.mycompany.app:common</include>
</includes>
</dependencySet>
</dependencySets>
</assembly>
{% endhighlight %}
## Dependencies Target Locations
Inside assembly.xml we have a dependencySets element that contains two dependencySet elements.
The first dependencySet (where its outputDirectory=lib) defines which JARS go into the lib directory in the PU structure. It excludes the dependency in the common module and its transitive dependencies. In other words, all dependencies that are not related to the commons module go into the lib directory.
The second dependencySet (where its outputDirectory=shared-lib) defines which JARS go into the shared-lib directory in the PU structure. It includes the dependency in common module and its transitive dependencies, leaving other dependencies out. In other words, all dependencies that are related to the commons module go into the shared-lib directory.
## Dependency Scopes
When defining a dependency for an artifact (module), you can specify the dependency's scope. Scope determines which dependencies participate in the build lifecycle.
Maven defines the following scopes:
{: .table .table-bordered}
| Scope | Description |
|:------|:------------|
| **compile** | Indicates that the dependency is available for the classpaths of all phases. **This is the default scope**. |
| **provided** | Indicates that the dependency is available on the compile classpath, but in the production environment you expect the JDK or a container to provide it. It is not transitive. |
| **test** | Indicates that the dependency is only available for the test compilation and execution phases. |
| **runtime** | Indicates that the dependency is available for the runtime and test classpaths, but not for the compile classpath. |
| **system** | This scope is similar to provided, except that you have to provide the JAR location explicitly. The artifact is not looked up in a repository. Using this scope is not advised due to portability issues. |
{% infosign %} During processing unit packaging only dependencies declared with the scopes **compile* and *runtime** are added to the PU distributable.
For more information go to [Introduction to the Dependency Mechanism](http://maven.apache.org/guides/introduction/introduction-to-dependency-mechanism.html)
## Configuring Maven to use the Assembly Descriptor
To instruct Maven to use this assembly descriptor to generate the processing units, we configure the assembly plugin by adding the following xml snippet to the module's pom.xml file.
**pom.xml**
{% highlight xml %}
<build>
...
<finalName>testing-feeder</finalName>
<plugins>
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<configuration>
<appendAssemblyId>false</appendAssemblyId>
<attach>false</attach>
<ignoreDirFormatExtensions>true</ignoreDirFormatExtensions>
<descriptors>
<descriptor>src/main/assembly/assembly.xml</descriptor>
</descriptors>
</configuration>
<executions>
<execution>
<id>assembly</id>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
...
</build>
{% endhighlight %}
## Further Information
For further information about the assembly plugin options, go to:
- [Assembly plugin documentation](http://maven.apache.org/plugins/maven-assembly-plugin/)
- [Assembly descriptor reference](http://maven.apache.org/plugins/maven-assembly-plugin/assembly.html)
- [Assembly plugin 'single' mojo documentation](http://maven.apache.org/plugins/maven-assembly-plugin/single-mojo.html)
|
{
"content_hash": "d40b1788025dfd19e0b64d636c3a8afd",
"timestamp": "",
"source": "github",
"line_count": 125,
"max_line_length": 353,
"avg_line_length": 45.144,
"alnum_prop": 0.7226652489810385,
"repo_name": "yuvaldori/gigaspaces-wiki-jekyll",
"id": "aedb507f4c29943727490036f0507367a95c83a2",
"size": "5648",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "xap100/maven-plugin---advanced.markdown",
"mode": "33188",
"license": "apache-2.0",
"language": [],
"symlink_target": ""
}
|
#include <aws/core/client/ClientConfiguration.h>
#include <aws/core/client/DefaultRetryStrategy.h>
#include <aws/core/platform/OSVersionInfo.h>
#include <aws/core/utils/memory/AWSMemory.h>
#include <aws/core/utils/threading/Executor.h>
#include <aws/core/utils/memory/stl/AWSStringStream.h>
#include <aws/core/Version.h>
namespace Aws
{
namespace Client
{
static const char* CLIENT_CONFIGURATION_ALLOCATION_TAG = "ClientConfiguration";
static Aws::String ComputeUserAgentString()
{
Aws::StringStream ss;
ss << "aws-sdk-cpp/" << Version::GetVersionString() << " " << Aws::OSVersionInfo::ComputeOSVersionString();
return ss.str();
}
ClientConfiguration::ClientConfiguration() :
userAgent(ComputeUserAgentString()),
scheme(Aws::Http::Scheme::HTTPS),
region(Region::US_EAST_1),
useDualStack(false),
maxConnections(25),
requestTimeoutMs(3000),
connectTimeoutMs(1000),
retryStrategy(Aws::MakeShared<DefaultRetryStrategy>(CLIENT_CONFIGURATION_ALLOCATION_TAG)),
proxyScheme(Aws::Http::Scheme::HTTP),
proxyPort(0),
executor(Aws::MakeShared<Aws::Utils::Threading::DefaultExecutor>(CLIENT_CONFIGURATION_ALLOCATION_TAG)),
verifySSL(true),
writeRateLimiter(nullptr),
readRateLimiter(nullptr),
httpLibOverride(Aws::Http::TransferLibType::DEFAULT_CLIENT),
followRedirects(true)
{
}
} // namespace Client
} // namespace Aws
|
{
"content_hash": "5889e845cb86ccc986862d09a4a1b8a9",
"timestamp": "",
"source": "github",
"line_count": 47,
"max_line_length": 110,
"avg_line_length": 29.617021276595743,
"alnum_prop": 0.7363505747126436,
"repo_name": "chiaming0914/awe-cpp-sdk",
"id": "5dc7e01134a793f5281908b14645d6da209280f5",
"size": "1992",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "aws-cpp-sdk-core/source/client/ClientConfiguration.cpp",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "C",
"bytes": "2313"
},
{
"name": "C++",
"bytes": "98158533"
},
{
"name": "CMake",
"bytes": "437471"
},
{
"name": "HTML",
"bytes": "4471"
},
{
"name": "Java",
"bytes": "239297"
},
{
"name": "Python",
"bytes": "72827"
},
{
"name": "Shell",
"bytes": "2803"
}
],
"symlink_target": ""
}
|
from .client import CampaignBudgetServiceClient
__all__ = ("CampaignBudgetServiceClient",)
|
{
"content_hash": "8993b8bf3376cc4ecb5b69a256f17416",
"timestamp": "",
"source": "github",
"line_count": 3,
"max_line_length": 47,
"avg_line_length": 30.666666666666668,
"alnum_prop": 0.7934782608695652,
"repo_name": "googleads/google-ads-python",
"id": "dc744cac0029aaa885563dc81d6847aaee7eebc8",
"size": "692",
"binary": false,
"copies": "3",
"ref": "refs/heads/main",
"path": "google/ads/googleads/v12/services/services/campaign_budget_service/__init__.py",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Python",
"bytes": "23399881"
}
],
"symlink_target": ""
}
|
ACCEPTED
#### According to
The Catalogue of Life, 3rd January 2011
#### Published in
Bull. Soc. mycol. Fr. 34(1-2): 73 (1918)
#### Original name
Bertia collapsa Romell, 1889
### Remarks
null
|
{
"content_hash": "a972adc9dc10ff02fdbd764fd258b7dd",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 40,
"avg_line_length": 14.923076923076923,
"alnum_prop": 0.6855670103092784,
"repo_name": "mdoering/backbone",
"id": "237100852680aa940425ee41cd370d3ea2ca3604",
"size": "260",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "life/Fungi/Ascomycota/Sordariomycetes/Coronophorales/Nitschkiaceae/Nitschkia/Nitschkia collapsa/README.md",
"mode": "33188",
"license": "apache-2.0",
"language": [],
"symlink_target": ""
}
|
package com.kevinquan.cwa.model.creatures.corn;
public class CornLord extends AbstractCornCreature {
@SuppressWarnings("unused")
private static final String TAG = CornLord.class.getSimpleName();
public CornLord() {
super("Corn Lord", 5, Rarity.AlgebraicRare);
mDescription = "Choose a creature and give it +6 Attack"; // Check
}
@Override public int getBaseAttack() { return 10; }
@Override public int getBaseDefense() { return 38; }
@Override public int getFloopCost() { return 2; }
@Override public int getBaseGoldAttack() { return 15; }
@Override public int getBaseGoldDefense() { return 57; }
}
|
{
"content_hash": "4ccd8a52e4f878f06482a28e8c02de7e",
"timestamp": "",
"source": "github",
"line_count": 21,
"max_line_length": 74,
"avg_line_length": 31.714285714285715,
"alnum_prop": 0.6816816816816816,
"repo_name": "kquan/card-wars-almanac",
"id": "39f5c2837eb01a4e5c9a4f503fac3d04983e06f1",
"size": "1283",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "java/src/com/kevinquan/cwa/model/creatures/corn/CornLord.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Java",
"bytes": "645982"
}
],
"symlink_target": ""
}
|
- [Creating objects to store information](creating-objects.md)
- [Getting aliases of a command](getting-aliases-of-a-command.md)
- [Getting strings from objects](getting-strings-from-objects.md)
- [Select strings from an input](select-strings-from-input.md)
- [Testing a command before executing it](testing-command.md)
- [Redirecting the output (and errors) of a command](using-out-null.md)
### Tags
[#tip](../../tips.md)
[#powershell](../powershell.md)AC
|
{
"content_hash": "f6bc3769555a1d70127e490eae10cc55",
"timestamp": "",
"source": "github",
"line_count": 10,
"max_line_length": 71,
"avg_line_length": 45.9,
"alnum_prop": 0.7363834422657952,
"repo_name": "weirdpattern/tipit",
"id": "9bf47866e57dfbedf408ffe0f9c4186fd2153e99",
"size": "487",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "tips/powershell/commands/commands.md",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "PowerShell",
"bytes": "2451"
},
{
"name": "Shell",
"bytes": "1187"
}
],
"symlink_target": ""
}
|
@interface ResponseTableViewCell : UITableViewCell
@property (nonatomic) NSString *cellTitle;
@property (nonatomic) NSString *cellDetails;
@end
|
{
"content_hash": "5c7e63654a7595bfd3b91cdf4a5e75e0",
"timestamp": "",
"source": "github",
"line_count": 6,
"max_line_length": 50,
"avg_line_length": 24.333333333333332,
"alnum_prop": 0.8082191780821918,
"repo_name": "Ares42/Guidebox",
"id": "c93edc1b85a17c1df885d1881b04e671365f9c8a",
"size": "258",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "Guidebox/Guidebox/ResponseTableViewCell.h",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "HTML",
"bytes": "872"
},
{
"name": "Objective-C",
"bytes": "476217"
},
{
"name": "Python",
"bytes": "1020009"
},
{
"name": "Ruby",
"bytes": "253"
},
{
"name": "Shell",
"bytes": "11756"
},
{
"name": "Swift",
"bytes": "3470"
}
],
"symlink_target": ""
}
|
package chatty.bot.Run;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
import chatty.bot.Accounts.Account;
import chatty.bot.Accounts.AccountManager;
import chatty.bot.Run.RunBot.Sender;
import chatty.bot.Spam.ComposedSpam;
import chatty.bot.commands.CmdRunInput;
import chatty.bot.parsers.ParsersFactory;
import chatty.bot.parsers.RunParser;
public class RunComposedSpamB extends RunComposedSpam {
public RunComposedSpamB(Sender listener,String channel,List<String> msgs, int time) {
super(listener,channel,msgs,time);
}
public RunComposedSpamB(Sender listener,String channel,int time){
super(listener,channel,time);
}
public List<String> getCommands(String[] parts){
List<String> in = new ArrayList<>();
for (int i = 0; i < parts.length; i++){
CmdRunInput x = ParsersFactory.getInstance().getRunParser().Parse(parts[i]);
RunComposedInput y = x.getInput();
y.AddB();
if (x != null) in.add(y.toString());
}
return in;
}
}
|
{
"content_hash": "83643bf0885764a25826a0c4d380043e",
"timestamp": "",
"source": "github",
"line_count": 39,
"max_line_length": 86,
"avg_line_length": 26.512820512820515,
"alnum_prop": 0.718568665377176,
"repo_name": "Jolicost/ChattyTpp",
"id": "6c4b635a0cf271e9f8be707ef8e32224bc6a1c09",
"size": "1034",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/chatty/bot/Run/RunComposedSpamB.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "2136"
},
{
"name": "HTML",
"bytes": "315587"
},
{
"name": "Java",
"bytes": "2458341"
}
],
"symlink_target": ""
}
|
/**
* Last Revision Information (full log at bottom of file)
*
*
* RELEASED WITH THE SWA PART OF LIBSVX.
* THIS IS A UTILITY FILE THAT IS USED IN THE SWA PROCESSING.
*
* THIS CODE IS RELEASED UNDER THE MIT-LIKE LICENSE INCLUDED
* WITH THE SOURCE CODE.
*
* CONTACT jcorso@buffalo.edu FOR ANY QUESTIONS.
*
*
* MOST of the functionality in the images classes are not used at
* all in libsvx (rather just the container members for the pixel
* data are used and IO).
*
* The images header file defines the image classes. All the image classes
* are defined here.
*
*/
#ifndef IMAGES_H
#define IMAGES_H
#include <stdio.h>
#include <stdlib.h>
#ifndef C_DEFINES_ONLY
extern "C"
{
#endif /*!C_DEFINES_ONLY*/
// now define the global function names for the image library calls
// the naming scheme for these images is directly defined after the IPP scheme
#ifdef USE_IPP
# include <ipp.h>
typedef IppiSize ImageSize;
typedef IppiRect ImageRect;
#define ImageHintAlgorithm IppHintAlgorithm
#define ImageCmpOp IppCmpOp
# define imageAbsDiff_8u_C1R ippiAbsDiff_8u_C1R
# define imageCompare_8u_C1R ippiCompare_8u_C1R
# define imageConvert_8u32f_C1R ippiConvert_8u32f_C1R
# define imageConvValid_32f_C1R ippiConvValid_32f_C1R
# define imageMalloc_8u_C1 ippiMalloc_8u_C1
# define imageMinMax_16s_C1R ippiMinMax_16s_C1R
# define imageSet_8u_C1R ippiSet_8u_C1R
# define imageSet_32s_C1R ippiSet_32s_C1R
# define imageSqr_32f_C1IR ippiSqr_32f_C1IR
# define imageSum_32f_C1R ippiSum_32f_C1R
# define imageSum_8u_C1R ippiSum_8u_C1R
#else
typedef struct tagImageSize {
int width;
int height;
} ImageSize;
typedef struct tagImageRect {
int x;
int y;
int width;
int height;
} ImageRect;
typedef enum {
ippCmpLess,
ippCmpLessEq,
ippCmpEq,
ippCmpGreaterEq,
ippCmpGreater
} ImageCmpOp;
typedef enum {
ippAlgHintNone,
ippAlgHintFast,
ippAlgHintAccurate
} ImageHintAlgorithm;
int imageAbsDiff_8u_C1R(unsigned char* src1, int step1,
unsigned char* src2, int step2,
unsigned char* dst, int step, ImageSize size);
int imageCompare_8u_C1R(unsigned char* src1, int step1,
unsigned char* src2, int step2,
unsigned char* dst, int step,
ImageSize size, ImageCmpOp op);
int imageConvert_8u32f_C1R(unsigned char* src, int srcStep,
float* dst, int dstStep, ImageSize size);
int imageConvValid_32f_C1R(float* src, int srcStep, ImageSize srcSize,
float* krn, int krnStep, ImageSize krnSize,
float* dst, int dstStep);
unsigned char* imageMalloc_8u_C1(int w, int h, int* step);
int imageMinMax_16s_C1R(short* src, int srcStep,ImageSize size,
short* vMin, short* vMax);
int imageSet_8u_C1R(unsigned char value, unsigned char* dst,
int dstStep, ImageSize size);
int imageSet_32s_C1R(int value, int* dst, int dstStep, ImageSize size);
int imageSqr_32f_C1IR(float* data, int step, ImageSize size);
int imageSum_8u_C1R(unsigned char* data, int step, ImageSize size, double* v);
int imageSum_32f_C1R(float* data, int step, ImageSize size, double* v, ImageHintAlgorithm hint);
#endif
// these are some C-functions for image processing routines that do not
// have any IPP counterparts (that I could find)
// they are also defined in the imagefuncs.c source file
// but in a different section of it
//XXX this is called ippiIntegral
int imageCumSum_8u32s_C1R(unsigned char* src, int srcStep,
int* dst, int dstStep,
ImageSize srcRoi, ImageSize dstRoi) ;
//XXXX this is also implemented in IPP, but I havent had the time to wrap it
#ifndef C_DEFINES_ONLY
} // closes the !C_DEFINES_ONLY extern clause
#include <map>
namespace vpml_images
{
typedef unsigned char byte;
struct Colormap
{
byte map[256][3];
void loadFromFile(const char* fn);
byte& operator () (int index, int band)
{
return map[index][band];
}
const byte& operator () (int index, int band) const
{
return map[index][band];
}
};
struct ByteComparator
{
bool operator()(const byte s1, const byte s2) const
{
return s1 < s2;
}
};
class Bytemap : public std::map<byte, byte, ByteComparator>
{
public:
void loadFromFile(const char* fn);
};
/** The scalarImage2 is the standard grayscale image class
* Generally data is stored as unsigned chars, but the class is templated
* in case the user requires a specific type of image. The most common
* templates are actually instantiated in images.cpp.
* Since it is likely the consumer of this class will want to use the Intel
* IPP libraries, it is recommended that this class be considered a container
* for the data rather than anything more complex. Any image processing
* class passed to the optimized image processing libraries will need to know
* the specific format of the underlying data stored here. And, in this
* class, we do not know that format...
* We give constructors that can take an outside already allocated data buffer.
* Often the optimized librares require word-aligned boundaries, etc...
* Global function calls are given to make the allocation of such objects easy.
*/
template <class T_PX>
class _scalarImage2
{
private:
bool manage_buffer; // am I managing my own data buffer
public:
int step; // distance in bytes between two consecutive rows
ImageSize size; // for calls to image processing functions
T_PX* data; // the underlying data buffer
T_PX** rows; // a two dimensional array access to the data
// these static variables are instantiated and assigned on a per
// template value basis in the images.cpp file
static double MAX_PIXEL_VALUE;
_scalarImage2(int w, int h, int step=-1, T_PX* buffer=0x0);
virtual ~_scalarImage2();
// Functions that never have a type-specific implementation
inline ImageSize& getSize() {return size;}
inline const ImageSize& getSize() const {return size;}
inline int getStep() {return step;}
inline int getStep() const {return step;}
inline int getWidth() const {return size.width;}
inline int getHeight() const {return size.height;}
T_PX* getPixelPointer(int x, int y);
const T_PX* getPixelPointer(int x, int y) const;
/** gets a pointer to the pixel in first column of row y */
T_PX* getRowPointer(int y);
const T_PX* getRowPointer(int y) const;
inline T_PX getValue(const int index) const { return data[index]; }
inline T_PX getValue(const int x, const int y) const {return rows[y][x];}
inline void setValue(const int x, const int y, const T_PX v) {rows[y][x]=v;}
inline int W() const {return size.width;}
inline int H() const {return size.height;}
inline bool& Manage() {return manage_buffer;}
inline const bool& Manage() const {return manage_buffer;}
// Functions that sometimes have a type-specific implementation but
// also have a generic implementation
void copyFromAndDivideBy(const _scalarImage2<T_PX>*, T_PX value);
void divideBy(T_PX value);
void fillFromImage(const _scalarImage2<T_PX>* src);
void fillWithValue(T_PX value);
void getMinMax(T_PX* minValue, T_PX* maxValue);
float getSum(const int border=0) const;
void multiplyBy(T_PX value);
void replaceWithMax(T_PX value);
void saveToFile(const char* fn) const;
void saveToFile_Scale(const char* fn) const;
void alphaBlendWithImage(const _scalarImage2<T_PX>* img, float alpha);
// Functions that require a type-specific implementation and have no
// generic implementation (will be a fatal call during debug mode);
void* makeCumulativeImage() const;
#ifdef IMAGE_ZLIB_CAPABILITY
// if we have access to zlib at compilation, we want to include the ability
// to compress and uncompress our pixel data here
protected:
bool compressed;
unsigned char* data_compressed;
unsigned long len_compressed;
public:
void compressImage();
void uncompressImage();
#endif
T_PX& operator [] (int index)
{
return data[index];
}
const T_PX& operator [] (int index) const
{
return data[index];
}
private:
inline T_PX* PTR_ADDBYTES(T_PX* ptr, size_t bytes)
{
return (T_PX*)(((byte*)ptr) + bytes);
}
inline T_PX* PTR_ADDBYTES(T_PX* ptr, size_t bytes) const
{
return (T_PX*)(((byte*)ptr) + bytes);
}
};
/**
* Note that partial specialization of the templates is used to provide
* pixel-type specific (optimized) functionality for a function subset.
*/
// some typedefs on the different types of scalarImage2
typedef _scalarImage2<byte> ScalarImage2;
typedef _scalarImage2<short> ScalarImage2S;
typedef _scalarImage2<int> ScalarImage2I;
typedef _scalarImage2<float> ScalarImage2F;
#include "matrix.h"
using namespace vpml_matrix;
template <class T_PX>
class _rgbImage2 : public Matrix<T_PX>
{
public:
ImageSize size; // for calls to image processing functions
// these static variables are instantiated and assigned on a per
// template value basis in the images.cpp file
static double MAX_PIXEL_VALUE;
_rgbImage2(int w, int h);
virtual ~_rgbImage2();
// Functions that never have a type-specific implementation
inline int getWidth() const {return size.width;}
inline int getHeight() const {return size.height;}
inline T_PX getValue(const int x, const int y,const int b) const
{ return Matrix<T_PX>::getValue(y,3*x+b); }
inline void setValue(const int x, const int y, const int b, const T_PX v)
{ Matrix<T_PX>::setValue(y,3*x+b,v); }
inline int W() const {return size.width;}
inline int H() const {return size.height;}
// Functions that sometimes have a type-specific implementation but
// also have a generic implementation
void saveToFile(const char* fn) const;
void alphaBlendWithImage(const _rgbImage2<T_PX>* img, float alpha);
// These functions are overloaded from the super-class Matrix, but
// they are not virtual. i.e., in order for them to be used properly
// the compiler's going to need to know that you have an image you are
// dealing with (which is most likely always going to be the case)
/** Return ref to the red object there... */
T_PX& operator () (int x, int y)
{
return Matrix<T_PX>::getElement(y,3*x);
}
/** return ref to whichever band you need (red=0,green=1,blue=2) */
T_PX& operator () (int x, int y, int band)
{
return Matrix<T_PX>::getElement(y,3*x+band);
}
};
typedef _rgbImage2<byte> RGBImage2;
// Some global image functions
RGBImage2* apply_colormap(const Colormap& map, const ScalarImage2*);
ScalarImage2* apply_bytemap(Bytemap& map, const ScalarImage2*);
void convertRGBtoLAB(const RGBImage2* RGB, ScalarImage2*& A, ScalarImage2*& B);
ScalarImage2* convolve(const ScalarImage2* I, const ScalarImage2F*);
ScalarImage2F* convolve(const ScalarImage2F* I, const ScalarImage2F*);
ScalarImage2F* magnitude(const ScalarImage2F* A, const ScalarImage2F* B, bool normalize=false, bool doSqrt=false);
ScalarImage2F* normalize(const ScalarImage2F* I);
// convolution functions via the FFTW library
#ifdef IMAGE_FFTW_CAPABILITY
ScalarImage2F* convolve_fft(ScalarImage2F* I, ScalarImage2F*);
#endif
// Templated Global Image Functions
template <class T_PX>
ScalarImage2* imboolGreaterThan(_scalarImage2<T_PX>* A, _scalarImage2<T_PX>* B);
template <class T_PX>
_scalarImage2<T_PX>* newImageOneMinus(_scalarImage2<T_PX>* I);
/** Load an image from the disk (infer type from the extension) and
* instantiate a grayscale byte image. Scaling and converting of data will
* be done (when the code gets written to do it)
*/
ScalarImage2* load_image_gray(const char *fn);
RGBImage2* load_image_rgb(const char *fn);
int save_image_gray(const char *fn,const ScalarImage2* image);
int save_png_gray(FILE *fp,const ScalarImage2* image);
int save_image_rgb(const char *fn,const RGBImage2* image);
int save_png_rgb(FILE *fp,const RGBImage2* image);
/** These definitions handle image file types for reading and writing */
typedef enum
{ UNSUPPORTED,PPM,PNG} e_image_file_type;
e_image_file_type get_image_file_type(const char*fn);
// some other definitions, structures, and functions used by the images
extern bool operator == (const ImageSize& A, const ImageSize& B);
} // end of namespace vpml_images;
#endif // !C_DEFINES_ONLY
#endif /*IMAGES_H*/
|
{
"content_hash": "ab5c20f89511ecec0e7a4303465de614",
"timestamp": "",
"source": "github",
"line_count": 402,
"max_line_length": 114,
"avg_line_length": 31.139303482587064,
"alnum_prop": 0.7025083879213931,
"repo_name": "zhefan/ObjectFlow",
"id": "c7b857e99e0fac6322eae9cc7eff643688b4e190",
"size": "12518",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "External/libsvx.v3.0/swa/images.h",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C",
"bytes": "123390"
},
{
"name": "C++",
"bytes": "726932"
},
{
"name": "CSS",
"bytes": "1002"
},
{
"name": "HTML",
"bytes": "694882"
},
{
"name": "M",
"bytes": "2500"
},
{
"name": "Makefile",
"bytes": "7129"
},
{
"name": "Matlab",
"bytes": "1245171"
},
{
"name": "Objective-C",
"bytes": "835"
},
{
"name": "Python",
"bytes": "18775"
},
{
"name": "Shell",
"bytes": "11176"
},
{
"name": "TeX",
"bytes": "17617"
}
],
"symlink_target": ""
}
|
package honor
import ranking.common.EvolutionBase
import scala.collection.breakOut
object Fetishism extends HonorCategory {
import com.ponkotuy.value.ShipIds._
override def category: Int = 18
override def comment: String = "対象艦娘の合計Lvを一定以上"
val groups = Vector(
FetiGroup("メガネフェチ", Set(Mochizuki, Chokai, Kirishima, I8, Makigumo, Musashi, Katori, Ooyodo, Roma, Okinami), 500)
)
override def approved(memberId: Long, db: HonorCache): List[String] = {
val ships = db.shipWithName
val lvs = ships.map { ship =>
EvolutionBase(ship.shipId) -> ship.lv
}
groups.filter { gr =>
val userSumLv = lvs.filter { case (sid, _) => gr.ships.contains(sid) }
.map { case (_, lv) => lv.toInt }.sum
userSumLv >= gr.sumLv
}.map(_.name)(breakOut)
}
}
case class FetiGroup(name: String, ships: Set[Int], sumLv: Int)
|
{
"content_hash": "6158f2c151580825b5a71bc46461fc36",
"timestamp": "",
"source": "github",
"line_count": 31,
"max_line_length": 117,
"avg_line_length": 27.870967741935484,
"alnum_prop": 0.6689814814814815,
"repo_name": "b-wind/MyFleetGirls",
"id": "c80a1c6a1d5ba634868dfc939df6b93f1afa2891",
"size": "900",
"binary": false,
"copies": "2",
"ref": "refs/heads/my-debug",
"path": "server/app/honor/Fetishism.scala",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Batchfile",
"bytes": "758"
},
{
"name": "CSS",
"bytes": "1903"
},
{
"name": "CoffeeScript",
"bytes": "57061"
},
{
"name": "HTML",
"bytes": "137587"
},
{
"name": "Java",
"bytes": "9514"
},
{
"name": "JavaScript",
"bytes": "22570"
},
{
"name": "PLSQL",
"bytes": "1619"
},
{
"name": "Scala",
"bytes": "742029"
},
{
"name": "Shell",
"bytes": "2251"
}
],
"symlink_target": ""
}
|
<?xml version="1.0" encoding="UTF-8"?>
<!--
~ Copyright (c) 2016, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
~
~ WSO2 Inc. 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.
-->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<groupId>org.wso2.carbon.devicemgt-plugins</groupId>
<artifactId>carbon-device-mgt-plugins-parent</artifactId>
<version>4.1.20-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>mobile-plugins-feature</artifactId>
<version>4.1.20-SNAPSHOT</version>
<packaging>pom</packaging>
<name>WSO2 Carbon - Device Management EMM Plugins Feature</name>
<url>http://wso2.org</url>
<modules>
<module>android-plugin-feature</module>
<module>windows-plugin-feature</module>
</modules>
</project>
|
{
"content_hash": "c65dfc1fa1ec34899ea7f4e0baffac46",
"timestamp": "",
"source": "github",
"line_count": 41,
"max_line_length": 204,
"avg_line_length": 38.609756097560975,
"alnum_prop": 0.6873025900189513,
"repo_name": "charithag/carbon-device-mgt-plugins",
"id": "fef0fd4a4f6b85edebe076d6680009ed10f77365",
"size": "1583",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "features/mobile-plugins-feature/pom.xml",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Batchfile",
"bytes": "912"
},
{
"name": "C",
"bytes": "2475"
},
{
"name": "C++",
"bytes": "14451"
},
{
"name": "CSS",
"bytes": "565755"
},
{
"name": "HTML",
"bytes": "679943"
},
{
"name": "Java",
"bytes": "3852899"
},
{
"name": "JavaScript",
"bytes": "9901466"
},
{
"name": "PLSQL",
"bytes": "4277"
},
{
"name": "Python",
"bytes": "36818"
},
{
"name": "Shell",
"bytes": "16631"
}
],
"symlink_target": ""
}
|
package com.ding.smallweather.util;
public class AddressUtils {
//不确定代码的城市
public static String countyCode_address = "http://www.weather.com.cn/data/list3/city";
public static String countyCode_address1 = "http://wthrcdn.etouch.cn/weather_mini?citykey=";
//城市列表
public static String city_address = "http://www.weather.com.cn/data/list3/city.xml";
//天气代码
public static String weatherCode_address = "http://www.weather.com.cn/data/cityinfo/";
//天气图片
public static String weatherPic_address = "http://m.weather.com.cn/img/";
//实时天气
public static String weatherNow_address = "http://www.weather.com.cn/adat/sk/";
}
|
{
"content_hash": "a660baaf8bbeba2f2e3ce921c906653c",
"timestamp": "",
"source": "github",
"line_count": 18,
"max_line_length": 93,
"avg_line_length": 34.888888888888886,
"alnum_prop": 0.7372611464968153,
"repo_name": "ding327/SmallWeather",
"id": "e044e88923c39fd9a6979cf7c7f5f9b6a856f39e",
"size": "676",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "SmallWeather/src/com/ding/smallweather/util/AddressUtils.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Java",
"bytes": "43312"
}
],
"symlink_target": ""
}
|
namespace LessGravity.Engine.Graphics.Shaders
{
public enum ShaderType
{
Undefined = 0,
ComputeShader,
DomainShader,
GeometryShader,
HullShader,
PixelShader,
VertexShader
}
}
|
{
"content_hash": "5678374a72d2ca71959df88295b2982e",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 46,
"avg_line_length": 18.692307692307693,
"alnum_prop": 0.588477366255144,
"repo_name": "deccer/LessGravity",
"id": "5a8a419c22c69b15f7dbc9f19f309ce5cf20b020",
"size": "245",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "LessGravity.Engine/Graphics/Shaders/ShaderType.cs",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C#",
"bytes": "1560353"
},
{
"name": "HLSL",
"bytes": "587"
}
],
"symlink_target": ""
}
|
using System;
namespace LNF.Billing
{
public class StoreDataCleanItem
{
public int StoreDataID { get; set; }
public int ClientID { get; set; }
public int ItemID { get; set; }
public DateTime OrderDate { get; set; }
public int AccountID { get; set; }
public decimal Quantity { get; set; }
public decimal UnitCost { get; set; }
public int CategoryID { get; set; }
public bool RechargeItem { get; set; }
public DateTime StatusChangeDate { get; set; }
}
}
|
{
"content_hash": "102aba5f53d8eb740639957b66c25fc6",
"timestamp": "",
"source": "github",
"line_count": 18,
"max_line_length": 54,
"avg_line_length": 30.27777777777778,
"alnum_prop": 0.5963302752293578,
"repo_name": "lurienanofab/lnf",
"id": "9ecd8067cd8a090ee08801d838f4e16ac5776201",
"size": "547",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "LNF/Billing/StoreDataCleanItem.cs",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "ASP.NET",
"bytes": "93"
},
{
"name": "C#",
"bytes": "3268060"
},
{
"name": "JavaScript",
"bytes": "14150"
}
],
"symlink_target": ""
}
|
import subprocess
import sys
import shlex
def runcmd(cmd):
return subprocess.check_output(shlex.split(cmd)).decode('utf8').split('\n')
def getsrpm(rpm):
rpminfo = runcmd(f'rpm -qi {rpm}')
for inf in rpminfo:
if inf.startswith('Source RPM'):
srpm = inf.split(':', 1)[1].strip()
return srpm
srpmtorpm = {}
rpmtosrpm = {}
allrpmlist = runcmd('rpm -qa')
for rpm in allrpmlist:
if not rpm:
continue
srpm = getsrpm(rpm)
rpmtosrpm[rpm] = srpm
if srpm in srpmtorpm:
srpmtorpm[srpm].add(rpm)
else:
srpmtorpm[srpm] = {rpm}
with open(sys.argv[1]) as rpmlist:
rpmlist = rpmlist.read().split('\n')
licenses = set([])
for rpm in rpmlist:
if not rpm:
continue
srpm = rpmtosrpm[rpm]
if srpm.startswith('linux-firmware'):
continue
for relrpm in srpmtorpm[srpm]:
liclist = runcmd(f'rpm -qL {relrpm}')
for lic in liclist:
if lic == '(contains no files)':
continue
licenses.add(lic)
for lic in sorted(licenses):
print(lic)
|
{
"content_hash": "27b27d344cda954c12099bbc34bb3004",
"timestamp": "",
"source": "github",
"line_count": 47,
"max_line_length": 79,
"avg_line_length": 23.53191489361702,
"alnum_prop": 0.5840867992766727,
"repo_name": "xcat2/confluent",
"id": "99bb848444f534ef765381bc916ec8a96a1dfe04",
"size": "1106",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "genesis/getlicenses.py",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "C",
"bytes": "82023"
},
{
"name": "CSS",
"bytes": "2464"
},
{
"name": "Dockerfile",
"bytes": "333"
},
{
"name": "HTML",
"bytes": "352"
},
{
"name": "Makefile",
"bytes": "648"
},
{
"name": "Perl",
"bytes": "8853"
},
{
"name": "Python",
"bytes": "1822026"
},
{
"name": "Shell",
"bytes": "369359"
}
],
"symlink_target": ""
}
|
package jj.webdriver.panel;
import static org.hamcrest.Matchers.is;
import static org.junit.Assert.*;
import jj.webdriver.panel.ByStack;
import org.junit.Test;
/**
* @author jason
*
*/
public class ByStackTest {
@Test
public void test() {
ByStack b = new ByStack();
assertThat(b.resolve("hi"), is("hi"));
ByStack b2 = b.push("first-");
assertThat(b2.resolve("name"), is("first-name"));
assertThat(b2.push("second-").resolve("name2"), is("first-second-name2"));
}
}
|
{
"content_hash": "25c4bde6d37113ff4795875d3cf3cc60",
"timestamp": "",
"source": "github",
"line_count": 28,
"max_line_length": 76,
"avg_line_length": 17.714285714285715,
"alnum_prop": 0.6592741935483871,
"repo_name": "heinousjay/Pandia",
"id": "06f14a7fb993b54043016557a83c0855d5067689",
"size": "1094",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/test/java/jj/webdriver/panel/ByStackTest.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Java",
"bytes": "98707"
}
],
"symlink_target": ""
}
|
package com.google.auth.oauth2;
import static org.junit.Assert.assertEquals;
import com.google.api.client.json.GenericJson;
import com.google.api.client.json.JsonFactory;
import com.google.api.client.json.JsonObjectParser;
import java.io.IOException;
import java.io.InputStream;
import java.net.URI;
import java.nio.charset.StandardCharsets;
import java.util.HashMap;
import java.util.Map;
import org.junit.Before;
import org.junit.Test;
/**
* Tests for {@link AwsRequestSigner}.
*
* <p>Examples of sigv4 signed requests:
* https://docs.aws.amazon.com/general/latest/gr/sigv4-signed-request-examples.html
*/
public class AwsRequestSignerTest {
private static final String DATE = "Mon, 09 Sep 2011 23:36:00 GMT";
private static final String X_AMZ_DATE = "20200811T065522Z";
private static final AwsSecurityCredentials BOTOCORE_CREDENTIALS =
new AwsSecurityCredentials(
"AKIDEXAMPLE", "wJalrXUtnFEMI/K7MDENG+bPxRfiCYEXAMPLEKEY", /* token= */ null);
private AwsSecurityCredentials awsSecurityCredentials;
@Before
public void setUp() throws IOException {
awsSecurityCredentials = retrieveAwsSecurityCredentials();
}
// https://github.com/boto/botocore/blob/879f8440a4e9ace5d3cf145ce8b3d5e5ffb892ef/tests/unit/auth/aws4_testsuite/get-vanilla.req
// https://github.com/boto/botocore/blob/879f8440a4e9ace5d3cf145ce8b3d5e5ffb892ef/tests/unit/auth/aws4_testsuite/get-vanilla.sreq
@Test
public void sign_getHost() {
String url = "https://host.foo.com";
Map<String, String> headers = new HashMap<>();
headers.put("date", DATE);
AwsRequestSigner signer =
AwsRequestSigner.newBuilder(BOTOCORE_CREDENTIALS, "GET", url, "us-east-1")
.setAdditionalHeaders(headers)
.build();
AwsRequestSignature signature = signer.sign();
String expectedSignature = "b27ccfbfa7df52a200ff74193ca6e32d4b48b8856fab7ebf1c595d0670a7e470";
String expectedAuthHeader =
"AWS4-HMAC-SHA256 Credential=AKIDEXAMPLE/20110909/us-east-1/host/"
+ "aws4_request, SignedHeaders=date;host, Signature="
+ expectedSignature;
assertEquals(expectedSignature, signature.getSignature());
assertEquals(expectedAuthHeader, signature.getAuthorizationHeader());
assertEquals(BOTOCORE_CREDENTIALS, signature.getSecurityCredentials());
assertEquals(DATE, signature.getDate());
assertEquals("GET", signature.getHttpMethod());
assertEquals("us-east-1", signature.getRegion());
assertEquals(URI.create(url).normalize().toString(), signature.getUrl());
}
// https://github.com/boto/botocore/blob/879f8440a4e9ace5d3cf145ce8b3d5e5ffb892ef/tests/unit/auth/aws4_testsuite/get-relative-relative.req
// https://github.com/boto/botocore/blob/879f8440a4e9ace5d3cf145ce8b3d5e5ffb892ef/tests/unit/auth/aws4_testsuite/get-relative-relative.sreq
@Test
public void sign_getHostRelativePath() {
String url = "https://host.foo.com/foo/bar/../..";
Map<String, String> headers = new HashMap<>();
headers.put("date", DATE);
AwsRequestSigner signer =
AwsRequestSigner.newBuilder(BOTOCORE_CREDENTIALS, "GET", url, "us-east-1")
.setAdditionalHeaders(headers)
.build();
AwsRequestSignature signature = signer.sign();
String expectedSignature = "b27ccfbfa7df52a200ff74193ca6e32d4b48b8856fab7ebf1c595d0670a7e470";
String expectedAuthHeader =
"AWS4-HMAC-SHA256 Credential=AKIDEXAMPLE/20110909/us-east-1/host/"
+ "aws4_request, SignedHeaders=date;host, Signature="
+ expectedSignature;
assertEquals(expectedSignature, signature.getSignature());
assertEquals(expectedAuthHeader, signature.getAuthorizationHeader());
assertEquals(BOTOCORE_CREDENTIALS, signature.getSecurityCredentials());
assertEquals(DATE, signature.getDate());
assertEquals("GET", signature.getHttpMethod());
assertEquals("us-east-1", signature.getRegion());
assertEquals(URI.create(url).normalize().toString(), signature.getUrl());
}
// https://github.com/boto/botocore/blob/879f8440a4e9ace5d3cf145ce8b3d5e5ffb892ef/tests/unit/auth/aws4_testsuite/get-slash-dot-slash.req
// https://github.com/boto/botocore/blob/879f8440a4e9ace5d3cf145ce8b3d5e5ffb892ef/tests/unit/auth/aws4_testsuite/get-slash-dot-slash.sreq
@Test
public void sign_getHostInvalidPath() {
String url = "https://host.foo.com/./";
Map<String, String> headers = new HashMap<>();
headers.put("date", DATE);
AwsRequestSigner signer =
AwsRequestSigner.newBuilder(BOTOCORE_CREDENTIALS, "GET", url, "us-east-1")
.setAdditionalHeaders(headers)
.build();
AwsRequestSignature signature = signer.sign();
String expectedSignature = "b27ccfbfa7df52a200ff74193ca6e32d4b48b8856fab7ebf1c595d0670a7e470";
String expectedAuthHeader =
"AWS4-HMAC-SHA256 Credential=AKIDEXAMPLE/20110909/us-east-1/host/"
+ "aws4_request, SignedHeaders=date;host, Signature="
+ expectedSignature;
assertEquals(expectedSignature, signature.getSignature());
assertEquals(expectedAuthHeader, signature.getAuthorizationHeader());
assertEquals(BOTOCORE_CREDENTIALS, signature.getSecurityCredentials());
assertEquals(DATE, signature.getDate());
assertEquals("GET", signature.getHttpMethod());
assertEquals("us-east-1", signature.getRegion());
assertEquals(URI.create(url).normalize().toString(), signature.getUrl());
}
// https://github.com/boto/botocore/blob/879f8440a4e9ace5d3cf145ce8b3d5e5ffb892ef/tests/unit/auth/aws4_testsuite/get-slash-pointless-dot.req
// https://github.com/boto/botocore/blob/879f8440a4e9ace5d3cf145ce8b3d5e5ffb892ef/tests/unit/auth/aws4_testsuite/get-slash-pointless-dot.sreq
@Test
public void sign_getHostDotPath() {
String url = "https://host.foo.com/./foo";
Map<String, String> headers = new HashMap<>();
headers.put("date", DATE);
AwsRequestSigner signer =
AwsRequestSigner.newBuilder(BOTOCORE_CREDENTIALS, "GET", url, "us-east-1")
.setAdditionalHeaders(headers)
.build();
AwsRequestSignature signature = signer.sign();
String expectedSignature = "910e4d6c9abafaf87898e1eb4c929135782ea25bb0279703146455745391e63a";
String expectedAuthHeader =
"AWS4-HMAC-SHA256 Credential=AKIDEXAMPLE/20110909/us-east-1/host/"
+ "aws4_request, SignedHeaders=date;host, Signature="
+ expectedSignature;
assertEquals(expectedSignature, signature.getSignature());
assertEquals(expectedAuthHeader, signature.getAuthorizationHeader());
assertEquals(BOTOCORE_CREDENTIALS, signature.getSecurityCredentials());
assertEquals(DATE, signature.getDate());
assertEquals("GET", signature.getHttpMethod());
assertEquals("us-east-1", signature.getRegion());
assertEquals(URI.create(url).normalize().toString(), signature.getUrl());
}
// https://github.com/boto/botocore/blob/879f8440a4e9ace5d3cf145ce8b3d5e5ffb892ef/tests/unit/auth/aws4_testsuite/get-utf8.req
// https://github.com/boto/botocore/blob/879f8440a4e9ace5d3cf145ce8b3d5e5ffb892ef/tests/unit/auth/aws4_testsuite/get-utf8.sreq
@Test
public void sign_getHostUtf8Path() {
String url = "https://host.foo.com/%E1%88%B4";
Map<String, String> headers = new HashMap<>();
headers.put("date", DATE);
AwsRequestSigner signer =
AwsRequestSigner.newBuilder(BOTOCORE_CREDENTIALS, "GET", url, "us-east-1")
.setAdditionalHeaders(headers)
.build();
AwsRequestSignature signature = signer.sign();
String expectedSignature = "8d6634c189aa8c75c2e51e106b6b5121bed103fdb351f7d7d4381c738823af74";
String expectedAuthHeader =
"AWS4-HMAC-SHA256 Credential=AKIDEXAMPLE/20110909/us-east-1/host/"
+ "aws4_request, SignedHeaders=date;host, Signature="
+ expectedSignature;
assertEquals(expectedSignature, signature.getSignature());
assertEquals(expectedAuthHeader, signature.getAuthorizationHeader());
assertEquals(BOTOCORE_CREDENTIALS, signature.getSecurityCredentials());
assertEquals(DATE, signature.getDate());
assertEquals("GET", signature.getHttpMethod());
assertEquals("us-east-1", signature.getRegion());
assertEquals(URI.create(url).normalize().toString(), signature.getUrl());
}
// https://github.com/boto/botocore/blob/879f8440a4e9ace5d3cf145ce8b3d5e5ffb892ef/tests/unit/auth/aws4_testsuite/get-vanilla-query-order-key-case.req
// https://github.com/boto/botocore/blob/879f8440a4e9ace5d3cf145ce8b3d5e5ffb892ef/tests/unit/auth/aws4_testsuite/get-vanilla-query-order-key-case.sreq
@Test
public void sign_getHostDuplicateQueryParam() {
String url = "https://host.foo.com/?foo=Zoo&foo=aha";
Map<String, String> headers = new HashMap<>();
headers.put("date", DATE);
AwsRequestSigner signer =
AwsRequestSigner.newBuilder(BOTOCORE_CREDENTIALS, "GET", url, "us-east-1")
.setAdditionalHeaders(headers)
.build();
AwsRequestSignature signature = signer.sign();
String expectedSignature = "be7148d34ebccdc6423b19085378aa0bee970bdc61d144bd1a8c48c33079ab09";
String expectedAuthHeader =
"AWS4-HMAC-SHA256 Credential=AKIDEXAMPLE/20110909/us-east-1/host/"
+ "aws4_request, SignedHeaders=date;host, Signature="
+ expectedSignature;
assertEquals(expectedSignature, signature.getSignature());
assertEquals(expectedAuthHeader, signature.getAuthorizationHeader());
assertEquals(BOTOCORE_CREDENTIALS, signature.getSecurityCredentials());
assertEquals(DATE, signature.getDate());
assertEquals("GET", signature.getHttpMethod());
assertEquals("us-east-1", signature.getRegion());
assertEquals(URI.create(url).normalize().toString(), signature.getUrl());
}
// https://github.com/boto/botocore/blob/879f8440a4e9ace5d3cf145ce8b3d5e5ffb892ef/tests/unit/auth/aws4_testsuite/post-header-key-sort.req
// https://github.com/boto/botocore/blob/879f8440a4e9ace5d3cf145ce8b3d5e5ffb892ef/tests/unit/auth/aws4_testsuite/post-header-key-sort.sreq
@Test
public void sign_postWithUpperCaseHeaderKey() {
String url = "https://host.foo.com/";
String headerKey = "ZOO";
String headerValue = "zoobar";
Map<String, String> headers = new HashMap<>();
headers.put("date", DATE);
headers.put(headerKey, headerValue);
AwsRequestSigner signer =
AwsRequestSigner.newBuilder(BOTOCORE_CREDENTIALS, "POST", url, "us-east-1")
.setAdditionalHeaders(headers)
.build();
AwsRequestSignature signature = signer.sign();
String expectedSignature = "b7a95a52518abbca0964a999a880429ab734f35ebbf1235bd79a5de87756dc4a";
String expectedAuthHeader =
"AWS4-HMAC-SHA256 Credential=AKIDEXAMPLE/20110909/us-east-1/host/"
+ "aws4_request, SignedHeaders=date;host;zoo, Signature="
+ expectedSignature;
assertEquals(expectedSignature, signature.getSignature());
assertEquals(expectedAuthHeader, signature.getAuthorizationHeader());
assertEquals(BOTOCORE_CREDENTIALS, signature.getSecurityCredentials());
assertEquals(DATE, signature.getDate());
assertEquals("POST", signature.getHttpMethod());
assertEquals("us-east-1", signature.getRegion());
assertEquals(URI.create(url).normalize().toString(), signature.getUrl());
assertEquals(headerValue, signature.getCanonicalHeaders().get(headerKey.toLowerCase()));
}
// https://github.com/boto/botocore/blob/879f8440a4e9ace5d3cf145ce8b3d5e5ffb892ef/tests/unit/auth/aws4_testsuite/post-header-value-case.req
// https://github.com/boto/botocore/blob/879f8440a4e9ace5d3cf145ce8b3d5e5ffb892ef/tests/unit/auth/aws4_testsuite/post-header-value-case.sreq
@Test
public void sign_postWithUpperCaseHeaderValue() {
String url = "https://host.foo.com/";
String headerKey = "zoo";
String headerValue = "ZOOBAR";
Map<String, String> headers = new HashMap<>();
headers.put("date", DATE);
headers.put("zoo", "ZOOBAR");
AwsRequestSigner signer =
AwsRequestSigner.newBuilder(BOTOCORE_CREDENTIALS, "POST", url, "us-east-1")
.setAdditionalHeaders(headers)
.build();
AwsRequestSignature signature = signer.sign();
String expectedSignature = "273313af9d0c265c531e11db70bbd653f3ba074c1009239e8559d3987039cad7";
String expectedAuthHeader =
"AWS4-HMAC-SHA256 Credential=AKIDEXAMPLE/20110909/us-east-1/host/"
+ "aws4_request, SignedHeaders=date;host;zoo, Signature="
+ expectedSignature;
assertEquals(expectedSignature, signature.getSignature());
assertEquals(expectedAuthHeader, signature.getAuthorizationHeader());
assertEquals(BOTOCORE_CREDENTIALS, signature.getSecurityCredentials());
assertEquals(DATE, signature.getDate());
assertEquals("POST", signature.getHttpMethod());
assertEquals("us-east-1", signature.getRegion());
assertEquals(URI.create(url).normalize().toString(), signature.getUrl());
assertEquals(headerValue, signature.getCanonicalHeaders().get(headerKey.toLowerCase()));
}
// https://github.com/boto/botocore/blob/879f8440a4e9ace5d3cf145ce8b3d5e5ffb892ef/tests/unit/auth/aws4_testsuite/get-header-value-trim.req
// https://github.com/boto/botocore/blob/879f8440a4e9ace5d3cf145ce8b3d5e5ffb892ef/tests/unit/auth/aws4_testsuite/get-header-value-trim.sreq
@Test
public void sign_postWithHeader() {
String url = "https://host.foo.com/";
String headerKey = "p";
String headerValue = "phfft";
Map<String, String> headers = new HashMap<>();
headers.put("date", DATE);
headers.put(headerKey, headerValue);
AwsRequestSigner signer =
AwsRequestSigner.newBuilder(BOTOCORE_CREDENTIALS, "POST", url, "us-east-1")
.setAdditionalHeaders(headers)
.build();
AwsRequestSignature signature = signer.sign();
String expectedSignature = "debf546796015d6f6ded8626f5ce98597c33b47b9164cf6b17b4642036fcb592";
String expectedAuthHeader =
"AWS4-HMAC-SHA256 Credential=AKIDEXAMPLE/20110909/us-east-1/host/"
+ "aws4_request, SignedHeaders=date;host;p, Signature="
+ expectedSignature;
assertEquals(expectedSignature, signature.getSignature());
assertEquals(expectedAuthHeader, signature.getAuthorizationHeader());
assertEquals(BOTOCORE_CREDENTIALS, signature.getSecurityCredentials());
assertEquals(DATE, signature.getDate());
assertEquals("POST", signature.getHttpMethod());
assertEquals("us-east-1", signature.getRegion());
assertEquals(URI.create(url).normalize().toString(), signature.getUrl());
assertEquals(headerValue, signature.getCanonicalHeaders().get(headerKey.toLowerCase()));
}
// https://github.com/boto/botocore/blob/879f8440a4e9ace5d3cf145ce8b3d5e5ffb892ef/tests/unit/auth/aws4_testsuite/post-x-www-form-urlencoded.req
// https://github.com/boto/botocore/blob/879f8440a4e9ace5d3cf145ce8b3d5e5ffb892ef/tests/unit/auth/aws4_testsuite/post-x-www-form-urlencoded.sreq
@Test
public void sign_postWithBodyNoCustomHeaders() {
String url = "https://host.foo.com/";
String headerKey = "Content-Type";
String headerValue = "application/x-www-form-urlencoded";
Map<String, String> headers = new HashMap<>();
headers.put("date", DATE);
headers.put(headerKey, headerValue);
AwsRequestSigner signer =
AwsRequestSigner.newBuilder(BOTOCORE_CREDENTIALS, "POST", url, "us-east-1")
.setAdditionalHeaders(headers)
.setRequestPayload("foo=bar")
.build();
AwsRequestSignature signature = signer.sign();
String expectedSignature = "5a15b22cf462f047318703b92e6f4f38884e4a7ab7b1d6426ca46a8bd1c26cbc";
String expectedAuthHeader =
"AWS4-HMAC-SHA256 Credential=AKIDEXAMPLE/20110909/us-east-1/host/"
+ "aws4_request, SignedHeaders=content-type;date;host, Signature="
+ expectedSignature;
assertEquals(expectedSignature, signature.getSignature());
assertEquals(expectedAuthHeader, signature.getAuthorizationHeader());
assertEquals(BOTOCORE_CREDENTIALS, signature.getSecurityCredentials());
assertEquals(DATE, signature.getDate());
assertEquals("POST", signature.getHttpMethod());
assertEquals("us-east-1", signature.getRegion());
assertEquals(URI.create(url).normalize().toString(), signature.getUrl());
assertEquals(headerValue, signature.getCanonicalHeaders().get(headerKey.toLowerCase()));
}
// https://github.com/boto/botocore/blob/879f8440a4e9ace5d3cf145ce8b3d5e5ffb892ef/tests/unit/auth/aws4_testsuite/post-vanilla-query.req
// https://github.com/boto/botocore/blob/879f8440a4e9ace5d3cf145ce8b3d5e5ffb892ef/tests/unit/auth/aws4_testsuite/post-vanilla-query.sreq
@Test
public void sign_postWithQueryString() {
String url = "https://host.foo.com/?foo=bar";
Map<String, String> headers = new HashMap<>();
headers.put("date", DATE);
AwsRequestSigner signer =
AwsRequestSigner.newBuilder(BOTOCORE_CREDENTIALS, "POST", url, "us-east-1")
.setAdditionalHeaders(headers)
.build();
AwsRequestSignature signature = signer.sign();
String expectedSignature = "b6e3b79003ce0743a491606ba1035a804593b0efb1e20a11cba83f8c25a57a92";
String expectedAuthHeader =
"AWS4-HMAC-SHA256 Credential=AKIDEXAMPLE/20110909/us-east-1/host/"
+ "aws4_request, SignedHeaders=date;host, Signature="
+ expectedSignature;
assertEquals(expectedSignature, signature.getSignature());
assertEquals(expectedAuthHeader, signature.getAuthorizationHeader());
assertEquals(BOTOCORE_CREDENTIALS, signature.getSecurityCredentials());
assertEquals(DATE, signature.getDate());
assertEquals("POST", signature.getHttpMethod());
assertEquals("us-east-1", signature.getRegion());
assertEquals(URI.create(url).normalize().toString(), signature.getUrl());
}
@Test
public void sign_getDescribeRegions() {
String url = "https://ec2.us-east-2.amazonaws.com?Action=DescribeRegions&Version=2013-10-15";
Map<String, String> additionalHeaders = new HashMap<>();
additionalHeaders.put("x-amz-date", X_AMZ_DATE);
AwsRequestSigner signer =
AwsRequestSigner.newBuilder(awsSecurityCredentials, "GET", url, "us-east-2")
.setAdditionalHeaders(additionalHeaders)
.build();
AwsRequestSignature signature = signer.sign();
String expectedSignature = "631ea80cddfaa545fdadb120dc92c9f18166e38a5c47b50fab9fce476e022855";
String expectedAuthHeader =
"AWS4-HMAC-SHA256 Credential="
+ awsSecurityCredentials.getAccessKeyId()
+ "/20200811/us-east-2/ec2/"
+ "aws4_request, SignedHeaders=host;x-amz-date;x-amz-security-token, Signature="
+ expectedSignature;
assertEquals(expectedSignature, signature.getSignature());
assertEquals(expectedAuthHeader, signature.getAuthorizationHeader());
assertEquals(awsSecurityCredentials, signature.getSecurityCredentials());
assertEquals(X_AMZ_DATE, signature.getDate());
assertEquals("GET", signature.getHttpMethod());
assertEquals("us-east-2", signature.getRegion());
assertEquals(URI.create(url).normalize().toString(), signature.getUrl());
}
@Test
public void sign_postGetCallerIdentity() {
String url = "https://sts.us-east-2.amazonaws.com?Action=GetCallerIdentity&Version=2011-06-15";
Map<String, String> additionalHeaders = new HashMap<>();
additionalHeaders.put("x-amz-date", X_AMZ_DATE);
AwsRequestSigner signer =
AwsRequestSigner.newBuilder(awsSecurityCredentials, "POST", url, "us-east-2")
.setAdditionalHeaders(additionalHeaders)
.build();
AwsRequestSignature signature = signer.sign();
String expectedSignature = "73452984e4a880ffdc5c392355733ec3f5ba310d5e0609a89244440cadfe7a7a";
String expectedAuthHeader =
"AWS4-HMAC-SHA256 Credential="
+ awsSecurityCredentials.getAccessKeyId()
+ "/20200811/us-east-2/sts/"
+ "aws4_request, SignedHeaders=host;x-amz-date;x-amz-security-token, Signature="
+ expectedSignature;
assertEquals(expectedSignature, signature.getSignature());
assertEquals(expectedAuthHeader, signature.getAuthorizationHeader());
assertEquals(awsSecurityCredentials, signature.getSecurityCredentials());
assertEquals(X_AMZ_DATE, signature.getDate());
assertEquals("POST", signature.getHttpMethod());
assertEquals("us-east-2", signature.getRegion());
assertEquals(URI.create(url).normalize().toString(), signature.getUrl());
}
@Test
public void sign_postGetCallerIdentityNoToken() {
String url = "https://sts.us-east-2.amazonaws.com?Action=GetCallerIdentity&Version=2011-06-15";
AwsSecurityCredentials awsSecurityCredentialsWithoutToken =
new AwsSecurityCredentials(
awsSecurityCredentials.getAccessKeyId(),
awsSecurityCredentials.getSecretAccessKey(),
/* token= */ null);
Map<String, String> additionalHeaders = new HashMap<>();
additionalHeaders.put("x-amz-date", X_AMZ_DATE);
AwsRequestSigner signer =
AwsRequestSigner.newBuilder(awsSecurityCredentialsWithoutToken, "POST", url, "us-east-2")
.setAdditionalHeaders(additionalHeaders)
.build();
AwsRequestSignature signature = signer.sign();
String expectedSignature = "d095ba304919cd0d5570ba8a3787884ee78b860f268ed040ba23831d55536d56";
String expectedAuthHeader =
"AWS4-HMAC-SHA256 Credential="
+ awsSecurityCredentials.getAccessKeyId()
+ "/20200811/us-east-2/sts/"
+ "aws4_request, SignedHeaders=host;x-amz-date, Signature="
+ expectedSignature;
assertEquals(expectedSignature, signature.getSignature());
assertEquals(expectedAuthHeader, signature.getAuthorizationHeader());
assertEquals(awsSecurityCredentialsWithoutToken, signature.getSecurityCredentials());
assertEquals(X_AMZ_DATE, signature.getDate());
assertEquals("POST", signature.getHttpMethod());
assertEquals("us-east-2", signature.getRegion());
assertEquals(URI.create(url).normalize().toString(), signature.getUrl());
}
public AwsSecurityCredentials retrieveAwsSecurityCredentials() throws IOException {
InputStream stream =
AwsRequestSignerTest.class
.getClassLoader()
.getResourceAsStream("aws_security_credentials.json");
JsonFactory jsonFactory = OAuth2Utils.JSON_FACTORY;
JsonObjectParser parser = new JsonObjectParser(jsonFactory);
GenericJson json = parser.parseAndClose(stream, StandardCharsets.UTF_8, GenericJson.class);
String accessKeyId = (String) json.get("AccessKeyId");
String secretAccessKey = (String) json.get("SecretAccessKey");
String awsToken = (String) json.get("Token");
return new AwsSecurityCredentials(accessKeyId, secretAccessKey, awsToken);
}
}
|
{
"content_hash": "f359a354044d4511ec3a41d0e166b6ab",
"timestamp": "",
"source": "github",
"line_count": 515,
"max_line_length": 152,
"avg_line_length": 44.72233009708738,
"alnum_prop": 0.7279437304619659,
"repo_name": "googleapis/google-auth-library-java",
"id": "fd2c26d12254f8ba3959c40cdd69ec817d2c7fa3",
"size": "24567",
"binary": false,
"copies": "1",
"ref": "refs/heads/main",
"path": "oauth2_http/javatests/com/google/auth/oauth2/AwsRequestSignerTest.java",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "Batchfile",
"bytes": "801"
},
{
"name": "Java",
"bytes": "1303924"
},
{
"name": "Python",
"bytes": "1155"
},
{
"name": "Shell",
"bytes": "38824"
}
],
"symlink_target": ""
}
|
/* GET home page. */
exports.index = function(req, res){
res.render('index');
};
|
{
"content_hash": "5a924c1659724f51d8c8df1ef30dd361",
"timestamp": "",
"source": "github",
"line_count": 4,
"max_line_length": 35,
"avg_line_length": 21.75,
"alnum_prop": 0.5862068965517241,
"repo_name": "xueeinstein/jekyll-editor",
"id": "d9fc3e32e7b4516c81fff4fe4cb8bcfa5e1d100d",
"size": "87",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "app/routes/index.js",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "7"
},
{
"name": "HTML",
"bytes": "3239"
},
{
"name": "JavaScript",
"bytes": "3308"
}
],
"symlink_target": ""
}
|
{% extends 'admin/glitter/dialog.html' %}
{% block title %}Discard this unsaved page version{% endblock %}
{% block form %}
{% csrf_token %}
<h2 class="glitter-message">Are you sure you want to delete this version?</h2>
{% endblock %}
{% block buttons %}
<input type="submit" value="Yes, delete it" class="glitter-form-delete" name="_save">
<button class="glitter-form-button" onclick="window.parent.GlitterEditor.close_popup();return false;">No, thank you</button>
{% endblock %}
|
{
"content_hash": "3ff06764ac320e4d8581ee9b1d161686",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 128,
"avg_line_length": 38.46153846153846,
"alnum_prop": 0.678,
"repo_name": "blancltd/django-glitter",
"id": "d2131ae194c141bdf850685921f225d86939a047",
"size": "500",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "glitter/templates/admin/glitter/version_discard.html",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "CSS",
"bytes": "89413"
},
{
"name": "HTML",
"bytes": "49583"
},
{
"name": "JavaScript",
"bytes": "229974"
},
{
"name": "Python",
"bytes": "309345"
}
],
"symlink_target": ""
}
|
namespace {
#if !defined(OS_ANDROID)
// This list should be kept in sync with chrome/common/url_constants.h.
// Only include useful sub-pages, confirmation alerts are not useful.
const char* const kChromeSettingsSubPages[] = {
chrome::kAutofillSubPage,
chrome::kClearBrowserDataSubPage,
chrome::kContentSettingsSubPage,
chrome::kContentSettingsExceptionsSubPage,
chrome::kImportDataSubPage,
chrome::kLanguageOptionsSubPage,
chrome::kPasswordManagerSubPage,
chrome::kResetProfileSettingsSubPage,
chrome::kSearchEnginesSubPage,
chrome::kSyncSetupSubPage,
#if defined(OS_CHROMEOS)
chrome::kInternetOptionsSubPage,
#endif
};
#endif // !defined(OS_ANDROID)
} // namespace
const int BuiltinProvider::kRelevance = 860;
BuiltinProvider::BuiltinProvider(AutocompleteProviderListener* listener,
Profile* profile)
: AutocompleteProvider(listener, profile,
AutocompleteProvider::TYPE_BUILTIN) {
std::vector<std::string> builtins(
chrome::kChromeHostURLs,
chrome::kChromeHostURLs + chrome::kNumberOfChromeHostURLs);
std::sort(builtins.begin(), builtins.end());
for (std::vector<std::string>::iterator i(builtins.begin());
i != builtins.end(); ++i)
builtins_.push_back(base::ASCIIToUTF16(*i));
#if !defined(OS_ANDROID)
base::string16 settings(base::ASCIIToUTF16(chrome::kChromeUISettingsHost) +
base::ASCIIToUTF16("/"));
for (size_t i = 0; i < arraysize(kChromeSettingsSubPages); i++) {
builtins_.push_back(
settings + base::ASCIIToUTF16(kChromeSettingsSubPages[i]));
}
#endif
}
void BuiltinProvider::Start(const AutocompleteInput& input,
bool minimal_changes) {
matches_.clear();
if ((input.type() == metrics::OmniboxInputType::INVALID) ||
(input.type() == metrics::OmniboxInputType::FORCED_QUERY) ||
(input.type() == metrics::OmniboxInputType::QUERY))
return;
const size_t kAboutSchemeLength = strlen(url::kAboutScheme);
const base::string16 kAbout =
base::ASCIIToUTF16(url::kAboutScheme) +
base::ASCIIToUTF16(url::kStandardSchemeSeparator);
const base::string16 kChrome = base::ASCIIToUTF16(content::kChromeUIScheme) +
base::ASCIIToUTF16(url::kStandardSchemeSeparator);
const int kUrl = ACMatchClassification::URL;
const int kMatch = kUrl | ACMatchClassification::MATCH;
base::string16 text = input.text();
bool starting_chrome = StartsWith(kChrome, text, false);
if (starting_chrome || StartsWith(kAbout, text, false)) {
ACMatchClassifications styles;
// Highlight the input portion matching "chrome://"; or if the user has
// input "about:" (with optional slashes), highlight the whole "chrome://".
bool highlight = starting_chrome || text.length() > kAboutSchemeLength;
styles.push_back(ACMatchClassification(0, highlight ? kMatch : kUrl));
size_t offset = starting_chrome ? text.length() : kChrome.length();
if (highlight)
styles.push_back(ACMatchClassification(offset, kUrl));
// Include some common builtin chrome URLs as the user types the scheme.
AddMatch(base::ASCIIToUTF16(chrome::kChromeUIChromeURLsURL),
base::string16(), styles);
#if !defined(OS_ANDROID)
AddMatch(base::ASCIIToUTF16(chrome::kChromeUISettingsURL),
base::string16(), styles);
#endif
AddMatch(base::ASCIIToUTF16(chrome::kChromeUIVersionURL),
base::string16(), styles);
} else {
// Match input about: or chrome: URL input against builtin chrome URLs.
GURL url = url_fixer::FixupURL(base::UTF16ToUTF8(text), std::string());
// BuiltinProvider doesn't know how to suggest valid ?query or #fragment
// extensions to chrome: URLs.
if (url.SchemeIs(content::kChromeUIScheme) && url.has_host() &&
!url.has_query() && !url.has_ref()) {
// Suggest about:blank for substrings, taking URL fixup into account.
// Chrome does not support trailing slashes or paths for about:blank.
const base::string16 blank_host = base::ASCIIToUTF16("blank");
const base::string16 host = base::UTF8ToUTF16(url.host());
if (StartsWith(text, base::ASCIIToUTF16(url::kAboutScheme), false) &&
StartsWith(blank_host, host, false) && (url.path().length() <= 1) &&
!EndsWith(text, base::ASCIIToUTF16("/"), false)) {
ACMatchClassifications styles;
styles.push_back(ACMatchClassification(0, kMatch));
base::string16 match = base::ASCIIToUTF16(url::kAboutBlankURL);
// Measure the length of the matching host after the "about:" scheme.
const size_t corrected_length = kAboutSchemeLength + 1 + host.length();
if (blank_host.length() > host.length())
styles.push_back(ACMatchClassification(corrected_length, kUrl));
AddMatch(match, match.substr(corrected_length), styles);
}
// Include the path for sub-pages (e.g. "chrome://settings/browser").
base::string16 host_and_path = base::UTF8ToUTF16(url.host() + url.path());
base::TrimString(host_and_path, base::ASCIIToUTF16("/"), &host_and_path);
size_t match_length = kChrome.length() + host_and_path.length();
for (Builtins::const_iterator i(builtins_.begin());
(i != builtins_.end()) && (matches_.size() < kMaxMatches); ++i) {
if (StartsWith(*i, host_and_path, false)) {
ACMatchClassifications styles;
// Highlight the "chrome://" scheme, even for input "about:foo".
styles.push_back(ACMatchClassification(0, kMatch));
base::string16 match_string = kChrome + *i;
if (match_string.length() > match_length)
styles.push_back(ACMatchClassification(match_length, kUrl));
AddMatch(match_string, match_string.substr(match_length), styles);
}
}
}
}
for (size_t i = 0; i < matches_.size(); ++i)
matches_[i].relevance = kRelevance + matches_.size() - (i + 1);
if (!HistoryProvider::PreventInlineAutocomplete(input) &&
(matches_.size() == 1)) {
// If there's only one possible completion of the user's input and
// allowing completions is okay, give the match a high enough score to
// allow it to beat url-what-you-typed and be inlined.
matches_[0].relevance = 1250;
matches_[0].allowed_to_be_default_match = true;
}
}
BuiltinProvider::~BuiltinProvider() {}
void BuiltinProvider::AddMatch(const base::string16& match_string,
const base::string16& inline_completion,
const ACMatchClassifications& styles) {
AutocompleteMatch match(this, kRelevance, false,
AutocompleteMatchType::NAVSUGGEST);
match.fill_into_edit = match_string;
match.inline_autocompletion = inline_completion;
match.destination_url = GURL(match_string);
match.contents = match_string;
match.contents_class = styles;
matches_.push_back(match);
}
|
{
"content_hash": "80e4975b2f0cfa5db05b5370be0e4313",
"timestamp": "",
"source": "github",
"line_count": 155,
"max_line_length": 80,
"avg_line_length": 44.73548387096774,
"alnum_prop": 0.6721949812518027,
"repo_name": "SlimRoms/android_external_chromium_org",
"id": "480af5ce9b83703332c46614cbe1fc4c0dba3b2c",
"size": "7536",
"binary": false,
"copies": "8",
"ref": "refs/heads/lp5.0",
"path": "chrome/browser/autocomplete/builtin_provider.cc",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "AppleScript",
"bytes": "6973"
},
{
"name": "Assembly",
"bytes": "26042"
},
{
"name": "C",
"bytes": "6168430"
},
{
"name": "C++",
"bytes": "180319877"
},
{
"name": "CSS",
"bytes": "815386"
},
{
"name": "Java",
"bytes": "4190153"
},
{
"name": "JavaScript",
"bytes": "8580290"
},
{
"name": "Objective-C",
"bytes": "694623"
},
{
"name": "Objective-C++",
"bytes": "6408181"
},
{
"name": "PHP",
"bytes": "61320"
},
{
"name": "Perl",
"bytes": "69277"
},
{
"name": "Python",
"bytes": "6730070"
},
{
"name": "Rebol",
"bytes": "262"
},
{
"name": "Shell",
"bytes": "462065"
},
{
"name": "XSLT",
"bytes": "418"
},
{
"name": "nesC",
"bytes": "15926"
}
],
"symlink_target": ""
}
|
package vm
import (
"fmt"
"os"
"testing"
)
func TestItemInList(t *testing.T) {
os.Setenv("ANKO_DEBUG", "1")
tests := []Test{
{Script: `"a" in ["a"]`, RunOutput: true},
{Script: `"a" in ["b"]`, RunOutput: false},
{Script: `"a" in ["c", "b", "a"]`, RunOutput: true},
{Script: `"a" in ["a", "b", 1]`, RunOutput: true},
{Script: `"a" in l`, Input: map[string]interface{}{"l": []interface{}{"a"}}, RunOutput: true},
{Script: `"a" in l`, Input: map[string]interface{}{"l": []interface{}{"b"}}, RunOutput: false},
{Script: `"a" in l`, Input: map[string]interface{}{"l": []interface{}{"c", "b", "a"}}, RunOutput: true},
{Script: `"a" in l`, Input: map[string]interface{}{"l": []interface{}{"a", "b", 1}}, RunOutput: true},
{Script: `1 in [1]`, RunOutput: true},
{Script: `1 in [2]`, RunOutput: false},
{Script: `1 in [3, 2, 1]`, RunOutput: true},
{Script: `1 in ["1"]`, RunOutput: true},
{Script: `1 in l`, Input: map[string]interface{}{"l": []interface{}{1}}, RunOutput: true},
{Script: `"1" in l`, Input: map[string]interface{}{"l": []interface{}{1}}, RunOutput: true},
{Script: `1 in l`, Input: map[string]interface{}{"l": []interface{}{2}}, RunOutput: false},
{Script: `1 in l`, Input: map[string]interface{}{"l": []interface{}{3, 2, 1}}, RunOutput: true},
{Script: `1 in l`, Input: map[string]interface{}{"l": []interface{}{"1"}}, RunOutput: true},
{Script: `0.9 in [1]`, Input: map[string]interface{}{"l": []interface{}{1}}, RunOutput: false},
{Script: `1.0 in [1]`, Input: map[string]interface{}{"l": []interface{}{1}}, RunOutput: true},
{Script: `1.1 in [1]`, Input: map[string]interface{}{"l": []interface{}{1}}, RunOutput: false},
{Script: `1 in [0.9]`, Input: map[string]interface{}{"l": []interface{}{0.9}}, RunOutput: false},
{Script: `1 in [1.0]`, Input: map[string]interface{}{"l": []interface{}{1.0}}, RunOutput: true},
{Script: `1 in [1.1]`, Input: map[string]interface{}{"l": []interface{}{1.1}}, RunOutput: false},
{Script: `0.9 in [1]`, Input: map[string]interface{}{"l": []interface{}{1}}, RunOutput: false},
{Script: `1.0 in [1]`, Input: map[string]interface{}{"l": []interface{}{1}}, RunOutput: true},
{Script: `1.1 in [1]`, Input: map[string]interface{}{"l": []interface{}{1}}, RunOutput: false},
{Script: `1 in [0.9]`, Input: map[string]interface{}{"l": []interface{}{0.9}}, RunOutput: false},
{Script: `1 in [1.0]`, Input: map[string]interface{}{"l": []interface{}{1.0}}, RunOutput: true},
{Script: `1 in [1.1]`, Input: map[string]interface{}{"l": []interface{}{1.1}}, RunOutput: false},
{Script: `true in ["true"]`, RunOutput: true},
{Script: `true in [true]`, RunOutput: true},
{Script: `true in [true, false]`, RunOutput: true},
{Script: `false in [false, true]`, RunOutput: true},
{Script: `true in l`, Input: map[string]interface{}{"l": []interface{}{"true"}}, RunOutput: true},
{Script: `true in l`, Input: map[string]interface{}{"l": []interface{}{true}}, RunOutput: true},
{Script: `true in l`, Input: map[string]interface{}{"l": []interface{}{true, false}}, RunOutput: true},
{Script: `false in l`, Input: map[string]interface{}{"l": []interface{}{false, true}}, RunOutput: true},
{Script: `"a" in ["b", "a", "c"][1:]`, RunOutput: true},
{Script: `"a" in ["b", "a", "c"][:1]`, RunOutput: false},
{Script: `"a" in ["b", "a", "c"][1:2]`, RunOutput: true},
{Script: `l = ["b", "a", "c"];"a" in l[1:]`, RunOutput: true},
{Script: `l = ["b", "a", "c"];"a" in l[:1]`, RunOutput: false},
{Script: `l = ["b", "a", "c"];"a" in l[1:2]`, RunOutput: true},
{Script: `"a" in l[1:]`, Input: map[string]interface{}{"l": []interface{}{"b", "a", "c"}}, RunOutput: true},
{Script: `"a" in l[:1]`, Input: map[string]interface{}{"l": []interface{}{"b", "a", "c"}}, RunOutput: false},
{Script: `"a" in l[1:2]`, Input: map[string]interface{}{"l": []interface{}{"b", "a", "c"}}, RunOutput: true},
// for i in list && item in list
{Script: `list_of_list = [["a"]];for l in list_of_list { return "a" in l }`, RunOutput: true},
{Script: `for l in list_of_list { return "a" in l }`, Input: map[string]interface{}{"list_of_list": []interface{}{[]interface{}{"a"}}}, RunOutput: true},
// not slice or array
// todo: support `"a" in "aaa"` ?
{Script: `"a" in "aaa"`, RunError: fmt.Errorf("second argument must be slice or array; but have string")},
{Script: `1 in 12345`, RunError: fmt.Errorf("type int64 does not support slice operation")},
// a in item in list
{Script: `"a" in 5 in [1, 2, 3]`, RunError: fmt.Errorf("type bool does not support slice operation")},
// applying a in b in several part of expresstion/statement
{Script: `switch 1 in [1] {case true: return true;default: return false}`, RunOutput: true},
{Script: `switch 1 in [2,3] {case true: return true;default: return false}`, RunOutput: false},
{Script: `switch true {case 1 in [1]: return true;default: return false}`, RunOutput: true},
{Script: `switch false {case 1 in [1]: return true;default: return false}`, RunOutput: false},
{Script: `if 1 in [1] {return true} else {return false}`, RunOutput: true},
{Script: `if 1 in [2,3] {return true} else {return false}`, RunOutput: false},
{Script: `for i in [1,2,3] { i++ }`},
{Script: `a=1; a=a in [1]`, RunOutput: true},
{Script: `a=1; a=a in [2,3]`, RunOutput: false},
{Script: `1 in [1] && true`, RunOutput: true},
{Script: `1 in [1] && false`, RunOutput: false},
{Script: `1 in [1] || true`, RunOutput: true},
{Script: `1 in [1] || false`, RunOutput: true},
{Script: `1 in [2,3] && true`, RunOutput: false},
{Script: `1 in [2,3] && false`, RunOutput: false},
{Script: `1 in [2,3] || true`, RunOutput: true},
{Script: `1 in [2,3] || false`, RunOutput: false},
{Script: `1++ in [1, 2, 3]`, RunError: fmt.Errorf("invalid operation")},
{Script: `3++ in [1, 2, 3]`, RunError: fmt.Errorf("invalid operation")},
{Script: `1 in 1++`, RunError: fmt.Errorf("invalid operation")},
{Script: `a=1;a++ in [1, 2, 3]`, RunOutput: true},
{Script: `a=3;a++ in [1, 2, 3]`, RunOutput: false},
{Script: `switch 1 in l {case true: return true;default: return false}`, Input: map[string]interface{}{"l": []interface{}{1}}, RunOutput: true},
{Script: `switch 1 in l {case true: return true;default: return false}`, Input: map[string]interface{}{"l": []interface{}{2, 3}}, RunOutput: false},
{Script: `switch true {case 1 in l: return true;default: return false}`, Input: map[string]interface{}{"l": []interface{}{1}}, RunOutput: true},
{Script: `switch false {case 1 in l: return true;default: return false}`, Input: map[string]interface{}{"l": []interface{}{1}}, RunOutput: false},
{Script: `if 1 in l {return true} else {return false}`, Input: map[string]interface{}{"l": []interface{}{1}}, RunOutput: true},
{Script: `if 1 in l {return true} else {return false}`, Input: map[string]interface{}{"l": []interface{}{2, 3}}, RunOutput: false},
{Script: `for i in l { i++ }`, Input: map[string]interface{}{"l": []interface{}{1, 2, 3}}},
{Script: `a=1; a=a in l`, Input: map[string]interface{}{"l": []interface{}{1}}, RunOutput: true},
{Script: `a=1; a=a in l`, Input: map[string]interface{}{"l": []interface{}{2, 3}}, RunOutput: false},
{Script: `1 in l && true`, Input: map[string]interface{}{"l": []interface{}{1}}, RunOutput: true},
{Script: `1 in l && false`, Input: map[string]interface{}{"l": []interface{}{1}}, RunOutput: false},
{Script: `1 in l || true`, Input: map[string]interface{}{"l": []interface{}{1}}, RunOutput: true},
{Script: `1 in l || false`, Input: map[string]interface{}{"l": []interface{}{1}}, RunOutput: true},
{Script: `1 in l && true`, Input: map[string]interface{}{"l": []interface{}{2, 3}}, RunOutput: false},
{Script: `1 in l && false`, Input: map[string]interface{}{"l": []interface{}{2, 3}}, RunOutput: false},
{Script: `1 in l || true`, Input: map[string]interface{}{"l": []interface{}{2, 3}}, RunOutput: true},
{Script: `1 in l || false`, Input: map[string]interface{}{"l": []interface{}{2, 3}}, RunOutput: false},
{Script: `1++ in l`, Input: map[string]interface{}{"l": []interface{}{1, 2, 3}}, RunError: fmt.Errorf("invalid operation")},
{Script: `3++ in l`, Input: map[string]interface{}{"l": []interface{}{1, 2, 3}}, RunError: fmt.Errorf("invalid operation")},
{Script: `a=1;a++ in l`, Input: map[string]interface{}{"l": []interface{}{1, 2, 3}}, RunOutput: true},
{Script: `a=3;a++ in l`, Input: map[string]interface{}{"l": []interface{}{1, 2, 3}}, RunOutput: false},
// multidimensional slice
{Script: `1 in [1]`, RunOutput: true},
{Script: `1 in [[1]]`, RunOutput: false},
{Script: `1 in [[[1]]]`, RunOutput: false},
{Script: `1 in [[1],[[1]],1]`, RunOutput: true},
{Script: `[1] in [1]`, RunOutput: false},
{Script: `[1] in [[1]]`, RunOutput: true},
{Script: `[1] in [[[1]]]`, RunOutput: false},
{Script: `[[1]] in [1]`, RunOutput: false},
{Script: `[[1]] in [[1]]`, RunOutput: false},
{Script: `[[1]] in [[[1]]]`, RunOutput: true},
{Script: `1 in [1]`, Input: map[string]interface{}{"l": []interface{}{1}}, RunOutput: true},
{Script: `1 in [[1]]`, Input: map[string]interface{}{"l": []interface{}{[]interface{}{1}}}, RunOutput: false},
{Script: `1 in [[[1]]]`, Input: map[string]interface{}{"l": []interface{}{[]interface{}{[]interface{}{1}}}}, RunOutput: false},
{Script: `1 in [[1],[[1]],1]`, Input: map[string]interface{}{"l": []interface{}{[]interface{}{1}, []interface{}{[]interface{}{1}}, 1}}, RunOutput: true},
{Script: `[1] in [1]`, Input: map[string]interface{}{"l": []interface{}{1}}, RunOutput: false},
{Script: `[1] in [[1]]`, Input: map[string]interface{}{"l": []interface{}{[]interface{}{1}}}, RunOutput: true},
{Script: `[1] in [[[1]]]`, Input: map[string]interface{}{"l": []interface{}{[]interface{}{[]interface{}{1}}}}, RunOutput: false},
{Script: `[[1]] in [1]`, Input: map[string]interface{}{"l": []interface{}{1}}, RunOutput: false},
{Script: `[[1]] in [[1]]`, Input: map[string]interface{}{"l": []interface{}{[]interface{}{1}}}, RunOutput: false},
{Script: `[[1]] in [[[1]]]`, Input: map[string]interface{}{"l": []interface{}{[]interface{}{[]interface{}{1}}}}, RunOutput: true},
}
RunTests(t, tests, nil)
}
|
{
"content_hash": "30b693c881243582b1b913ac46ef9e00",
"timestamp": "",
"source": "github",
"line_count": 143,
"max_line_length": 155,
"avg_line_length": 71.4895104895105,
"alnum_prop": 0.5923897094786267,
"repo_name": "leecalcote/gitlic-check",
"id": "25a6dee1df691f6e7a82b9389d201f87d9376e05",
"size": "10223",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "vendor/github.com/mattn/anko/vm/vmItemInList_test.go",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Go",
"bytes": "8235"
}
],
"symlink_target": ""
}
|
Jormungandr
===========
A world/campaign setting generator written in Python.
## JSON Generation File Structure ##
Each JSON generation file has two main objects. These are the "profile" and the "resources" section.
The values stored in each sections are lists of objects called "options".
### Profile ###
This specifies what attributes a particular entity has, and how to generate them.
Each key in this object is an attribute that the generated entity will have.
The list of options that make up the value of each key is a list of values that can fill that attribute.
The first attribute of an entity is "type", which identifies what type of entity it represents.
An entity's attributes are generated in the order that they are written in the generation spec. This is done to avoid instances of say, trying to generate a name (most of which require a sex) before the entity has a sex.
### Resources ###
The resources object contains a list of keys that can be referenced in the values of options.
### Options ###
Each option has 3 components, val, wt, and req.
#### val ####
This is the value of the option that can be stored in the resulting entity of a generation file.
This field supports the following command grammar:
- Selection Command
- Numeric Generation Command
#### wt ####
This is the weight of the option, relative to the weights of the options listed alongside it. A higher weight means that this option is more likely to be chosen.
Weights do not need to sum to a particular value.
Weights are math expressions that support addition, subtraction, multiplication, division, and parenthesis ordering.
#### req ####
This object is a list of requirements that must be satisfied for this option to be chosen for a particular entity.
Each key in this object is an attribute that the entity must have. The value of each key is a list of valid values for that attribute. An option will only be chosen for a particular entity if for each key in req, the value of that same key in the entity is appears in the list of values for that key in req.
This field supports the following command grammar:
- Selection Command
- Numeric Comparison Command
## Command Grammar ##
### Selection Command ###
Anything inside $ signs is a selection command. (e.g. $color$ is a selection command)
The selection command has different behavior depending on where it is specified.
#### val ####
During generation, a selection command will be replaced with an option value that is valid for the particular entity it is being generated for.
Selection commands are recursive in a sense. If a selection command generates a value that has another selection command in it, the process will be repeated until a complete value with no commands left is reached.
If the same selection command is specified multiple times in the value of an option (for example "$name$ $name$ $name$"), each instance of the command will have a unique value.
These specifications mean there are two things to watch for when using the selection command:
- Circular selections:
If a selection command comes up with a value that then uses a selection command to select a parent, the command can be caught in an infinite loop.
For example, "$name$" appears in a value. The value selected from the resource "name" is "John of $place$". The value selected for "$place$" is "$name$'s Rock", generating "John of $name$'s Rock" This can cause a loop where it continuously selects "$name$'s Rock" and replaces it with "John of John of $place$'s Rock", starting the process over.
- Exhausting a resource:
If you specify that you need n of a resource, for example "$pdesc$, $pdesc$, $pdesc$", and that resource has <n options, it will not be able to fill each of those fields, and Jormungandr will probably crash.
#### req ####
When a selection command is used in a req field, it doesn't randomly choose one value to replace that command. Instead, it acts as if it is every value for that command.
This way if you want to say that for instance, an option is valid if a person's occupation is any kind of metalworker, you can specify in req "occupation": "[$smith$, $miner$]".
During generation, when checking whether an entity meets the requirements for the req section, it will see if its value is able to be generated by the selection commands given. If it cannot be generated, it does not meet the requirements.
#### wt ####
A selection command in the "wt" field denotes a variable for weight calculations. This allows the weight of a particular field to change depending on the context in which an entity is being generated.
For example, a weight may be specified as "2*$artisans$". Then, if a context that generates this entity sets the $artisan$ value to 3, the weight of the option will be "2*3", equal to 6.
If the context that generates an entity does not have a value for a selection command, the command will be replaced with 1.
### Numeric Generation Command ###
A numeric generation command looks like this [#-#], where # are numbers.
On entity generation, this command will be replaced with an integer that falls in the range of the two numbers specified, inclusive.
### Numeric Comparison Command ###
A numeric comparison command looks like [>#], [<#], [>=#], [<=#], or [=#].
This command will be used to check if a certain field has a number respectively greater than, less than, or equal to the number specified in the command as described by the operator that appears before the number.
This command type only appears in the "req" field of options.
|
{
"content_hash": "e268f98363c746e4856fea84a84a3192",
"timestamp": "",
"source": "github",
"line_count": 78,
"max_line_length": 349,
"avg_line_length": 71.5,
"alnum_prop": 0.757396449704142,
"repo_name": "Riizade/Jormungandr",
"id": "4b5ef31b0b127eacc63a7d6a8fdb1c16fe7e8de8",
"size": "5577",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "README.md",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Python",
"bytes": "7458"
}
],
"symlink_target": ""
}
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!--NewPage-->
<HTML>
<HEAD>
<!-- Generated by javadoc (build 1.4.2_08) on Sat Apr 22 18:57:18 PDT 2006 -->
<TITLE>
IBMJSSESocketFactory (Axis API)
</TITLE>
<META NAME="keywords" CONTENT="org.apache.axis.components.net.IBMJSSESocketFactory class">
<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../../stylesheet.css" TITLE="Style">
<SCRIPT type="text/javascript">
function windowTitle()
{
parent.document.title="IBMJSSESocketFactory (Axis API)";
}
</SCRIPT>
</HEAD>
<BODY BGCOLOR="white" onload="windowTitle();">
<!-- ========= START OF TOP NAVBAR ======= -->
<A NAME="navbar_top"><!-- --></A>
<A HREF="#skip-navbar_top" title="Skip navigation links"></A>
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
<TR>
<TD COLSPAN=3 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<A NAME="navbar_top_firstrow"><!-- --></A>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
<TR ALIGN="center" VALIGN="top">
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD>
<TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="class-use/IBMJSSESocketFactory.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD>
</TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
</EM>
</TD>
</TR>
<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../../../../org/apache/axis/components/net/IBMFakeTrustSocketFactory.FakeX509TrustManager.html" title="class in org.apache.axis.components.net"><B>PREV CLASS</B></A>
<A HREF="../../../../../org/apache/axis/components/net/JSSESocketFactory.html" title="class in org.apache.axis.components.net"><B>NEXT CLASS</B></A></FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../../../../index.html" target="_top"><B>FRAMES</B></A>
<A HREF="IBMJSSESocketFactory.html" target="_top"><B>NO FRAMES</B></A>
<SCRIPT type="text/javascript">
<!--
if(window==top) {
document.writeln('<A HREF="../../../../../allclasses-noframe.html"><B>All Classes</B></A>');
}
//-->
</SCRIPT>
<NOSCRIPT>
<A HREF="../../../../../allclasses-noframe.html"><B>All Classes</B></A>
</NOSCRIPT>
</FONT></TD>
</TR>
<TR>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
SUMMARY: NESTED | <A HREF="#fields_inherited_from_class_org.apache.axis.components.net.JSSESocketFactory">FIELD</A> | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
DETAIL: FIELD | <A HREF="#constructor_detail">CONSTR</A> | <A HREF="#method_detail">METHOD</A></FONT></TD>
</TR>
</TABLE>
<A NAME="skip-navbar_top"></A>
<!-- ========= END OF TOP NAVBAR ========= -->
<HR>
<!-- ======== START OF CLASS DATA ======== -->
<H2>
<FONT SIZE="-1">
org.apache.axis.components.net</FONT>
<BR>
Class IBMJSSESocketFactory</H2>
<PRE>
java.lang.Object
<IMG SRC="../../../../../resources/inherit.gif" ALT="extended by"><A HREF="../../../../../org/apache/axis/components/net/DefaultSocketFactory.html" title="class in org.apache.axis.components.net">org.apache.axis.components.net.DefaultSocketFactory</A>
<IMG SRC="../../../../../resources/inherit.gif" ALT="extended by"><A HREF="../../../../../org/apache/axis/components/net/JSSESocketFactory.html" title="class in org.apache.axis.components.net">org.apache.axis.components.net.JSSESocketFactory</A>
<IMG SRC="../../../../../resources/inherit.gif" ALT="extended by"><B>org.apache.axis.components.net.IBMJSSESocketFactory</B>
</PRE>
<DL>
<DT><B>All Implemented Interfaces:</B> <DD><A HREF="../../../../../org/apache/axis/components/net/SecureSocketFactory.html" title="interface in org.apache.axis.components.net">SecureSocketFactory</A>, <A HREF="../../../../../org/apache/axis/components/net/SocketFactory.html" title="interface in org.apache.axis.components.net">SocketFactory</A></DD>
</DL>
<DL>
<DT><B>Direct Known Subclasses:</B> <DD><A HREF="../../../../../org/apache/axis/components/net/IBMFakeTrustSocketFactory.html" title="class in org.apache.axis.components.net">IBMFakeTrustSocketFactory</A></DD>
</DL>
<HR>
<DL>
<DT>public class <B>IBMJSSESocketFactory</B><DT>extends <A HREF="../../../../../org/apache/axis/components/net/JSSESocketFactory.html" title="class in org.apache.axis.components.net">JSSESocketFactory</A><DT>implements <A HREF="../../../../../org/apache/axis/components/net/SecureSocketFactory.html" title="interface in org.apache.axis.components.net">SecureSocketFactory</A></DL>
<P>
SSL socket factory. It _requires_ a valid RSA key and
JSSE. (borrowed code from tomcat)
<P>
<P>
<DL>
<DT><B>Author:</B></DT>
<DD>Davanum Srinivas (dims@yahoo.com)</DD>
</DL>
<HR>
<P>
<!-- ======== NESTED CLASS SUMMARY ======== -->
<!-- =========== FIELD SUMMARY =========== -->
<A NAME="field_summary"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TD COLSPAN=2><FONT SIZE="+2">
<B>Field Summary</B></FONT></TD>
</TR>
</TABLE>
<A NAME="fields_inherited_from_class_org.apache.axis.components.net.JSSESocketFactory"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor">
<TD><B>Fields inherited from class org.apache.axis.components.net.<A HREF="../../../../../org/apache/axis/components/net/JSSESocketFactory.html" title="class in org.apache.axis.components.net">JSSESocketFactory</A></B></TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE><A HREF="../../../../../org/apache/axis/components/net/JSSESocketFactory.html#sslFactory">sslFactory</A></CODE></TD>
</TR>
</TABLE>
<A NAME="fields_inherited_from_class_org.apache.axis.components.net.DefaultSocketFactory"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor">
<TD><B>Fields inherited from class org.apache.axis.components.net.<A HREF="../../../../../org/apache/axis/components/net/DefaultSocketFactory.html" title="class in org.apache.axis.components.net">DefaultSocketFactory</A></B></TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE><A HREF="../../../../../org/apache/axis/components/net/DefaultSocketFactory.html#attributes">attributes</A>, <A HREF="../../../../../org/apache/axis/components/net/DefaultSocketFactory.html#CONNECT_TIMEOUT">CONNECT_TIMEOUT</A>, <A HREF="../../../../../org/apache/axis/components/net/DefaultSocketFactory.html#log">log</A></CODE></TD>
</TR>
</TABLE>
<!-- ======== CONSTRUCTOR SUMMARY ======== -->
<A NAME="constructor_summary"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TD COLSPAN=2><FONT SIZE="+2">
<B>Constructor Summary</B></FONT></TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE><B><A HREF="../../../../../org/apache/axis/components/net/IBMJSSESocketFactory.html#IBMJSSESocketFactory(java.util.Hashtable)">IBMJSSESocketFactory</A></B>(java.util.Hashtable attributes)</CODE>
<BR>
Constructor IBMJSSESocketFactory</TD>
</TR>
</TABLE>
<!-- ========== METHOD SUMMARY =========== -->
<A NAME="method_summary"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TD COLSPAN=2><FONT SIZE="+2">
<B>Method Summary</B></FONT></TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>protected com.ibm.net.ssl.SSLContext</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/apache/axis/components/net/IBMJSSESocketFactory.html#getContext()">getContext</A></B>()</CODE>
<BR>
gets a SSL Context</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>protected void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/apache/axis/components/net/IBMJSSESocketFactory.html#initFactory()">initFactory</A></B>()</CODE>
<BR>
Read the keystore, init the SSL socket factory</TD>
</TR>
</TABLE>
<A NAME="methods_inherited_from_class_org.apache.axis.components.net.JSSESocketFactory"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor">
<TD><B>Methods inherited from class org.apache.axis.components.net.<A HREF="../../../../../org/apache/axis/components/net/JSSESocketFactory.html" title="class in org.apache.axis.components.net">JSSESocketFactory</A></B></TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE><A HREF="../../../../../org/apache/axis/components/net/JSSESocketFactory.html#create(java.lang.String, int, java.lang.StringBuffer, org.apache.axis.components.net.BooleanHolder)">create</A></CODE></TD>
</TR>
</TABLE>
<A NAME="methods_inherited_from_class_org.apache.axis.components.net.DefaultSocketFactory"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor">
<TD><B>Methods inherited from class org.apache.axis.components.net.<A HREF="../../../../../org/apache/axis/components/net/DefaultSocketFactory.html" title="class in org.apache.axis.components.net">DefaultSocketFactory</A></B></TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE><A HREF="../../../../../org/apache/axis/components/net/DefaultSocketFactory.html#isHostInNonProxyList(java.lang.String, java.lang.String)">isHostInNonProxyList</A>, <A HREF="../../../../../org/apache/axis/components/net/DefaultSocketFactory.html#match(java.lang.String, java.lang.String, boolean)">match</A></CODE></TD>
</TR>
</TABLE>
<A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor">
<TD><B>Methods inherited from class java.lang.Object</B></TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE>clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait</CODE></TD>
</TR>
</TABLE>
<A NAME="methods_inherited_from_class_org.apache.axis.components.net.SocketFactory"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor">
<TD><B>Methods inherited from interface org.apache.axis.components.net.<A HREF="../../../../../org/apache/axis/components/net/SocketFactory.html" title="interface in org.apache.axis.components.net">SocketFactory</A></B></TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE><A HREF="../../../../../org/apache/axis/components/net/SocketFactory.html#create(java.lang.String, int, java.lang.StringBuffer, org.apache.axis.components.net.BooleanHolder)">create</A></CODE></TD>
</TR>
</TABLE>
<P>
<!-- ============ FIELD DETAIL =========== -->
<!-- ========= CONSTRUCTOR DETAIL ======== -->
<A NAME="constructor_detail"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TD COLSPAN=1><FONT SIZE="+2">
<B>Constructor Detail</B></FONT></TD>
</TR>
</TABLE>
<A NAME="IBMJSSESocketFactory(java.util.Hashtable)"><!-- --></A><H3>
IBMJSSESocketFactory</H3>
<PRE>
public <B>IBMJSSESocketFactory</B>(java.util.Hashtable attributes)</PRE>
<DL>
<DD>Constructor IBMJSSESocketFactory
<P>
<DT><B>Parameters:</B><DD><CODE>attributes</CODE> - </DL>
<!-- ============ METHOD DETAIL ========== -->
<A NAME="method_detail"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TD COLSPAN=1><FONT SIZE="+2">
<B>Method Detail</B></FONT></TD>
</TR>
</TABLE>
<A NAME="initFactory()"><!-- --></A><H3>
initFactory</H3>
<PRE>
protected void <B>initFactory</B>()
throws java.io.IOException</PRE>
<DL>
<DD>Read the keystore, init the SSL socket factory
<P>
<DD><DL>
<DT><B>Overrides:</B><DD><CODE><A HREF="../../../../../org/apache/axis/components/net/JSSESocketFactory.html#initFactory()">initFactory</A></CODE> in class <CODE><A HREF="../../../../../org/apache/axis/components/net/JSSESocketFactory.html" title="class in org.apache.axis.components.net">JSSESocketFactory</A></CODE></DL>
</DD>
<DD><DL>
<DT><B>Throws:</B>
<DD><CODE>java.io.IOException</CODE></DL>
</DD>
</DL>
<HR>
<A NAME="getContext()"><!-- --></A><H3>
getContext</H3>
<PRE>
protected com.ibm.net.ssl.SSLContext <B>getContext</B>()
throws java.lang.Exception</PRE>
<DL>
<DD>gets a SSL Context
<P>
<DD><DL>
</DL>
</DD>
<DD><DL>
<DT><B>Returns:</B><DD>SSLContext
<DT><B>Throws:</B>
<DD><CODE>java.lang.Exception</CODE></DL>
</DD>
</DL>
<!-- ========= END OF CLASS DATA ========= -->
<HR>
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<A NAME="navbar_bottom"><!-- --></A>
<A HREF="#skip-navbar_bottom" title="Skip navigation links"></A>
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
<TR>
<TD COLSPAN=3 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<A NAME="navbar_bottom_firstrow"><!-- --></A>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
<TR ALIGN="center" VALIGN="top">
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD>
<TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="class-use/IBMJSSESocketFactory.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD>
</TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
</EM>
</TD>
</TR>
<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../../../../org/apache/axis/components/net/IBMFakeTrustSocketFactory.FakeX509TrustManager.html" title="class in org.apache.axis.components.net"><B>PREV CLASS</B></A>
<A HREF="../../../../../org/apache/axis/components/net/JSSESocketFactory.html" title="class in org.apache.axis.components.net"><B>NEXT CLASS</B></A></FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../../../../index.html" target="_top"><B>FRAMES</B></A>
<A HREF="IBMJSSESocketFactory.html" target="_top"><B>NO FRAMES</B></A>
<SCRIPT type="text/javascript">
<!--
if(window==top) {
document.writeln('<A HREF="../../../../../allclasses-noframe.html"><B>All Classes</B></A>');
}
//-->
</SCRIPT>
<NOSCRIPT>
<A HREF="../../../../../allclasses-noframe.html"><B>All Classes</B></A>
</NOSCRIPT>
</FONT></TD>
</TR>
<TR>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
SUMMARY: NESTED | <A HREF="#fields_inherited_from_class_org.apache.axis.components.net.JSSESocketFactory">FIELD</A> | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
DETAIL: FIELD | <A HREF="#constructor_detail">CONSTR</A> | <A HREF="#method_detail">METHOD</A></FONT></TD>
</TR>
</TABLE>
<A NAME="skip-navbar_bottom"></A>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
<HR>
Copyright © 2005 Apache Web Services Project. All Rights Reserved.
</BODY>
</HTML>
|
{
"content_hash": "875ab001504e8d6258e7aaaec9120f6f",
"timestamp": "",
"source": "github",
"line_count": 359,
"max_line_length": 380,
"avg_line_length": 48.740947075208915,
"alnum_prop": 0.6545319465081724,
"repo_name": "jgallimore/axis-with-mods",
"id": "e6670b9cdd99b83ff9a53d3b241fbb16ade4c3eb",
"size": "17499",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "docs/apiDocs/org/apache/axis/components/net/IBMJSSESocketFactory.html",
"mode": "33261",
"license": "apache-2.0",
"language": [],
"symlink_target": ""
}
|
<?php
/**
* Created by JetBrains PhpStorm.
* User: Prasad
* Date: 10/21/13
* Time: 11:09 PM
* To change this template use File | Settings | File Templates.
*/
?>
<?php $this->load->view('/template/teacherHeader');?>
|
{
"content_hash": "35e784d719f96d2d1855f0d40329a386",
"timestamp": "",
"source": "github",
"line_count": 10,
"max_line_length": 64,
"avg_line_length": 22.1,
"alnum_prop": 0.6470588235294118,
"repo_name": "webnerd/schoolManager",
"id": "e02b41bea2d05fab2411d8a8c8d59c307b37e11f",
"size": "221",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "CodeIgniter/schoolManagement/views/template/teacher.php",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "8033"
},
{
"name": "JavaScript",
"bytes": "12934"
},
{
"name": "PHP",
"bytes": "1383974"
}
],
"symlink_target": ""
}
|
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE TS>
<TS version="2.1" language="ca">
<context>
<name>AboutDialog</name>
<message>
<source>About %1</source>
<translation type="unfinished"></translation>
</message>
<message>
<source><h2>%1 Client %2</h2></source>
<translation type="unfinished"></translation>
</message>
<message>
<source><h5> REV %1 </h5></source>
<translation type="unfinished"></translation>
</message>
<message>
<source>About</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Check For Updates</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>OK</source>
<translation type="unfinished">D'acord</translation>
</message>
</context>
<context>
<name>AccountManager</name>
<message>
<source>failed to open account database</source>
<translation>No s'ha pogut accedir a la base de dades</translation>
</message>
<message>
<source>Authorization expired, please re-login</source>
<translation>Autorització expirada, si us plau torni a iniciar sessió</translation>
</message>
<message>
<source>Failed to remove local repos sync token: %1</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Failed to get repo sync information from server: %1</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>AccountSettingsDialog</name>
<message>
<source>Account Settings</source>
<translation>Configuració del compte</translation>
</message>
<message>
<source>Please enter the server address</source>
<translation>Si us plau indiqui l'adreça del servidor</translation>
</message>
<message>
<source>%1 is not a valid server address</source>
<translation>%1 no és una adreça de servidor vàlida</translation>
</message>
<message>
<source>Failed to save account information</source>
<translation>No s'ha pogut guardar la informació del compte</translation>
</message>
<message>
<source>Failed to save the changes: %1</source>
<translation>No s'han pogut guardar els canvis: %1</translation>
</message>
<message>
<source>Successfully updated current account information</source>
<translation>La informació del compte actual s'ha actualitzat correctament
</translation>
</message>
<message>
<source>Dialog</source>
<translation>Diàleg</translation>
</message>
<message>
<source>Server Address</source>
<translation>Adreça del servidor</translation>
</message>
<message>
<source>Email</source>
<translation>Email</translation>
</message>
<message>
<source>OK</source>
<translation>D'acord</translation>
</message>
<message>
<source>Cancel</source>
<translation>Cancel·lar</translation>
</message>
</context>
<context>
<name>AccountView</name>
<message>
<source>Are you sure you want to remove account %1?<br><br>The account will be removed locally. All syncing configuration will be removed too. The account at the server will not be affected.</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Failed to unsync libraries of this account: %1</source>
<translation>No s'ha pogut desincronitzar les biblioteques d'aquest compte: %1</translation>
</message>
<message>
<source>click to open the website</source>
<translation>clic per obrir la pàgina web</translation>
</message>
<message>
<source>pro version</source>
<translation>versió pro</translation>
</message>
<message>
<source>No account</source>
<translation>Sense compte</translation>
</message>
<message>
<source>Choose</source>
<translation>Triar</translation>
</message>
<message>
<source>Account settings</source>
<translation>Configuració del compte</translation>
</message>
<message>
<source>Login</source>
<translation>Iniciar sessió</translation>
</message>
<message>
<source>Delete</source>
<translation>Esborrar</translation>
</message>
<message>
<source>Add an account</source>
<translation>Afegir un compte</translation>
</message>
<message>
<source>Logout</source>
<translation>Tancar sessió</translation>
</message>
<message>
<source>not logged in</source>
<translation>no està autenticat</translation>
</message>
<message>
<source>Form</source>
<translation type="unfinished">Formulari</translation>
</message>
<message>
<source>Account</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>email</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>server</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>ActivitiesTab</name>
<message>
<source>File Activities are only supported in %1 Server Professional Edition.</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>retry</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Failed to get actvities information. Please %1</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>AutoUpdateManager</name>
<message>
<source>Upload Success</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>File "%1"
uploaded successfully.</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>File "%1"
failed to upload.</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Permission Error!</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Authorization expired</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>File does not exist</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>The file is locked by %1, please try again later</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Upload Failure: %1</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>AvatarService</name>
<message>
<source>Failed to create avatars folder</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>CheckRepoRootDirPermDialog</name>
<message>
<source>Checking Permission</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Cancel</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>CloneTasksDialog</name>
<message>
<source>Download tasks</source>
<translation>Tasques de descarrega </translation>
</message>
<message>
<source>remove all successful tasks</source>
<translation>Elimina les tasques finalitzades</translation>
</message>
<message>
<source>No download tasks right now.</source>
<translation>No hi ha cap descarrega</translation>
</message>
<message>
<source>Dialog</source>
<translation>Finestra</translation>
</message>
<message>
<source>Clear</source>
<translation>Buida</translation>
</message>
<message>
<source>Close</source>
<translation>Tanca</translation>
</message>
</context>
<context>
<name>CloneTasksTableModel</name>
<message>
<source>Library</source>
<translation>Llibreria</translation>
</message>
<message>
<source>Path</source>
<translation>Ruta</translation>
</message>
</context>
<context>
<name>CloneTasksTableView</name>
<message>
<source>Cancel this task</source>
<translation>Cancel·la la tasca</translation>
</message>
<message>
<source>cancel this task</source>
<translation>cancel·la la tasca</translation>
</message>
<message>
<source>Remove this task</source>
<translation>Elimina la tasca </translation>
</message>
<message>
<source>Failed to cancel this task:
%1</source>
<translation>No s'ha pogut cancel·lar la tasca:
%1</translation>
</message>
<message>
<source>Failed to remove this task:
%1</source>
<translation>No s'ha pogut eliminar la tasca:
%1</translation>
</message>
</context>
<context>
<name>CloudView</name>
<message>
<source>Minimize</source>
<translation>Minimitza</translation>
</message>
<message>
<source>Close</source>
<translation>Tanca</translation>
</message>
<message>
<source>Libraries</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Starred</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Activities</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Search</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>current download rate</source>
<translation>velocitat de descarrega</translation>
</message>
<message>
<source>current upload rate</source>
<translation>velocitat de pujada</translation>
</message>
<message>
<source>Please Choose a folder to sync</source>
<translation>Seleccioneu el directori a sincronitzar</translation>
</message>
<message>
<source>no server connected</source>
<translation>no hi ha cap servidor connectat</translation>
</message>
<message>
<source>all servers connected</source>
<translation>tots els servidors estan connectats</translation>
</message>
<message>
<source>some servers not connected</source>
<translation>alguns servidors no estan connectats</translation>
</message>
<message>
<source>Form</source>
<translation>Formulari</translation>
</message>
<message>
<source>logo</source>
<translation>logotip</translation>
</message>
<message>
<source>minimize</source>
<translation>minimitza</translation>
</message>
<message>
<source>close</source>
<translation>tanca</translation>
</message>
<message>
<source>...</source>
<translation>...</translation>
</message>
<message>
<source>Select</source>
<translation>Seleccioneu</translation>
</message>
<message>
<source>brand</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>or Drop Folder to Sync</source>
<translation>o arrossega el directori a sincronitzar</translation>
</message>
<message>
<source>download rate</source>
<translation>velocitat de descarrega</translation>
</message>
<message>
<source>downarrow</source>
<translation>estreny </translation>
</message>
<message>
<source>upload rate</source>
<translation>velocitat de pujada</translation>
</message>
<message>
<source>uparrow</source>
<translation>eixample</translation>
</message>
</context>
<context>
<name>Configurator</name>
<message>
<source>Error when creating ccnet configuration</source>
<translation>No s'ha pogut crear la configuració del ccnet</translation>
</message>
<message>
<source>Unable to create preconfigure directory "%1"</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>failed to read %1</source>
<translation>No s'ha pogut llegir %1</translation>
</message>
</context>
<context>
<name>CreateRepoDialog</name>
<message>
<source>Create a library</source>
<translation>Crea una llibreria</translation>
</message>
<message>
<source>Please choose a directory</source>
<translation>Seleccioneu un directori</translation>
</message>
<message>
<source>Creating...</source>
<translation>Creant...</translation>
</message>
<message>
<source>Failed to generate encryption key for this library</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Please choose the directory to sync</source>
<translation>Seleccioneu el directori a sincronitzar</translation>
</message>
<message>
<source>The folder %1 does not exist</source>
<translation>El directori %1 no existeix</translation>
</message>
<message>
<source>Please enter the name</source>
<translation>Introduïu el nom</translation>
</message>
<message>
<source>Please enter the password</source>
<translation>Introduïu la contrasenya</translation>
</message>
<message>
<source>Passwords don't match</source>
<translation>Les contrasenyes no coincideixen</translation>
</message>
<message>
<source>Unknown error</source>
<translation>Error desconegut</translation>
</message>
<message>
<source>Failed to add download task:
%1</source>
<translation>No s'ha pogut descarregar:
%1</translation>
</message>
<message>
<source>Failed to create library on the server:
%1</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Dialog</source>
<translation>Finestra</translation>
</message>
<message>
<source>Path:</source>
<translation>Ruta:</translation>
</message>
<message>
<source>Choose</source>
<translation>Selecciona</translation>
</message>
<message>
<source>Name:</source>
<translation>Nom:</translation>
</message>
<message>
<source>encrypted</source>
<translation>encriptat</translation>
</message>
<message>
<source>Password:</source>
<translation>Contrasenya:</translation>
</message>
<message>
<source>Password Again:</source>
<translation>Repetiu la contrasenya:</translation>
</message>
<message>
<source>status text</source>
<translation>text d'estat</translation>
</message>
<message>
<source>OK</source>
<translation>D'acord</translation>
</message>
<message>
<source>Cancel</source>
<translation>Cancel·la</translation>
</message>
<message>
<source>end-to-end encryption</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>TextLabel</source>
<translation type="unfinished">Etiqueta</translation>
</message>
</context>
<context>
<name>DaemonManager</name>
<message>
<source>%1 client failed to initialize</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>%1 exited unexpectedly</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>DataManager</name>
<message>
<source>Another copy or move operation is in progress. Please wait until it finishes.</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>DownloadRepoDialog</name>
<message>
<source>Please enter the password</source>
<translation>Introduïu la contrasenya</translation>
</message>
<message>
<source>Sync library "%1"</source>
<translation>Sincronitza la llibreria "%1"</translation>
</message>
<message>
<source>Sync folder "%1"</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Sync to folder:</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>or</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>sync with an existing folder</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>create a new sync folder</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Sync with this existing folder:</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Please choose a folder</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>The folder does not exist</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Please choose the folder to sync.</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Your organization disables putting a library outside %1 folder.</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Conflicting with existing file "%1", please choose a different folder.</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Conflicting with existing library "%1", please choose a different folder.</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>The folder "%1" already exists. Are you sure to sync with it (contents will be merged)?</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Click No to sync with a new folder instead</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Unable to find an alternative folder name</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Failed to add download task:
%1</source>
<translation>No s'ha pogut descarregar:
%1</translation>
</message>
<message>
<source>Failed to get repo download information:
%1</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Download Library</source>
<translation>Descarrega la llibreria</translation>
</message>
<message>
<source>choose...</source>
<translation>seleccioneu...</translation>
</message>
<message>
<source>Password for this library:</source>
<translation>La contrasenya d'aquesta llibreria:</translation>
</message>
<message>
<source>OK</source>
<translation>D'acord</translation>
</message>
<message>
<source>Cancel</source>
<translation>Cancel·la</translation>
</message>
</context>
<context>
<name>EventDetailsDialog</name>
<message>
<source>Modification Details</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>EventDetailsListModel</name>
<message>
<source>Added files</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Deleted files</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Modified files</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Added folders</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Deleted folders</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>EventDetailsListView</name>
<message>
<source>&Open</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Open &parent folder</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>FileBrowserDialog</name>
<message>
<source>Cloud File Browser</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Back</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Forward</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Home</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Upload files</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Upload a directory</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>You don't have permission to upload files to this library</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Create a folder</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Refresh</source>
<translation type="unfinished">Refresca</translation>
</message>
<message>
<source>%1 items</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Folder name</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Invalid folder name!</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>The name "%1" is already taken.</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>retry</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Failed to get files information<br/>Please %1</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>This folder is empty.</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Enter name of file to save to...</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Unable to remove file "%1"</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Enter the path of the folder you want to save to...</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Do you want to overwrite the existing file "%1"?</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>File "%1" haven't been synced</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>File %1 already exists.<br/>Do you like to overwrite it?<br/><small>(Choose No to upload using an alternative name).</small></source>
<translation type="unfinished"></translation>
</message>
<message>
<source>File does not exist</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Failed to download file: %1</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Select a file to upload</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Select a directory to upload</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Rename</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Do you really want to delete these items</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Create folder failed</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Lock file failed</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Select a file to update %1</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Rename failed</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Remove failed</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Share failed</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Cannot paste files from the same folder</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Cannot paste the folder to its subfolder</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Copy failed</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Move failed</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Create library failed!</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>You do not have permission to upload to this folder</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Authorization expired</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Permission Error!</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Library/Folder not found.</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Failed to upload file %1: %2</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Unable to create cache folder</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Unable to open cache folder</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Search files</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Failed to get link</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Failed to get upload link information for file "%1"</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>FileBrowserProgressDialog</name>
<message>
<source>Pending</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Cancel</source>
<translation>Cancel·lar</translation>
</message>
<message>
<source>Upload</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Uploading %1</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Download</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Downloading %1</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>%1 of %2</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Failed to upload file "%1", do you want to retry?</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Retry</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Skip</source>
<translation type="unfinished">Omet</translation>
</message>
<message>
<source>Abort</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Saving</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>File save failed</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Index progress request error %1</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>FileBrowserSearchModel</name>
<message>
<source>Name</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Size</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Last Modified</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>FileBrowserSearchView</name>
<message>
<source>&Show in folder</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Show in folder</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>FileNetworkTask</name>
<message>
<source>Operation canceled</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>pending</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>FileServerTask</name>
<message>
<source>task cancelled</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Internal Server Error</source>
<translation type="unfinished">Error intern del servidor</translation>
</message>
<message>
<source>The storage quota has been used up</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>The uploaded file exceeds the size limit</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>FileTableModel</name>
<message>
<source>locked by %1</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Name</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Size</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Last Modified</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Modifier</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>FileTableView</name>
<message>
<source>&Save As...</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>&Lock</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>&Rename</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>&Delete</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Share to Group</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>&Update</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>&Copy</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Cu&t</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>&Paste</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Canc&el Download</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>&Sync this folder</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>This feature is available in pro version only
</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>&Generate %1 Download Link</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Share to User</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>G&enerate %1 Internal Link</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>&Save As To...</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Un&lock</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Unable to remove readonly files</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Unable to cut readonly files</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Retry Upload</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Delete Local Version</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Local Version Save As...</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Open Local Cache Folder</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>&Generate %1 Upload Link</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>FinderSyncHost</name>
<message>
<source>File "%1" is locked by %2</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Failed to get lock information for file "%1"</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>No permissions to create a shared link</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Failed to get shared link: %1</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Failed to get upload link for file "%1": </source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Failed to get internal link: %1</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>GetFileTask</name>
<message>
<source>Failed to create folders</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Failed to create temporary files</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Failed to write file to disk</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Failed to remove the older version of the downloaded file</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Failed to move file</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>InitSeafileDialog</name>
<message>
<source>%1 Initialization</source>
<translation>%1 inicialitzat</translation>
</message>
<message>
<source>Choose %1 folder</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Please choose a directory</source>
<translation>Seleccioneu un directori</translation>
</message>
<message>
<source>Initialization is not finished. Really quit?</source>
<translation>La inicialització no ha finalitzat. Esteu segur que voleu sortir?</translation>
</message>
<message>
<source>The folder %1 does not exist</source>
<translation>El directori %1 no existeix</translation>
</message>
<message>
<source>Dialog</source>
<translation>Finestra</translation>
</message>
<message>
<source>logo</source>
<translation>logotip</translation>
</message>
<message>
<source>Choose a folder</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Please choose a folder. We will create a %1 subfolder in it. When you download a library, it will be saved there by default.</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Choose...</source>
<translation>Seleccioneu...</translation>
</message>
<message>
<source>Next</source>
<translation>Següent</translation>
</message>
<message>
<source>Cancel</source>
<translation>Cancel·la</translation>
</message>
</context>
<context>
<name>InitVirtualDriveDialog</name>
<message>
<source>%1 organizes files by libraries.
Do you like to download your default library?</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Checking your default library...</source>
<translation>Verificant la llibreria per defecte...</translation>
</message>
<message>
<source>Creating the default library...</source>
<translation>Creant la llibreria per defecte...</translation>
</message>
<message>
<source>Failed to create default library:
The server version must be 2.1 or higher to support this.</source>
<translation>No s'ha pogut crear la llibreria per defecte:
Cal un servidor versió 2.1 o superior.</translation>
</message>
<message>
<source>Failed to get default library:
%1</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Failed to create default library:
%1</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Downloading default library...</source>
<translation>Descarregant la llibreria per defecte...</translation>
</message>
<message>
<source>Failed to download default library:
%1</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>The default library has been downloaded.
You can click the "Open" button to view it.</source>
<translation>La llibreria per defecte s'ha descarregat.
Podeu clicar "Obre" per visualitzar-la.</translation>
</message>
<message>
<source>Error when downloading the default library: %1</source>
<translation>S'ha produït un error al descarregar la llibreria: %1</translation>
</message>
<message>
<source>Failed to download default library:
%1</source>
<translation>No s'ha pogut descarregar la llibreria:
%1</translation>
</message>
<message>
<source>Dialog</source>
<translation>Finestra</translation>
</message>
<message>
<source>%1 organizes files by libraries.
Do you like to download your default library?</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Skip</source>
<translation>Omet</translation>
</message>
<message>
<source>Run in Background</source>
<translation>Executa en segon pla</translation>
</message>
<message>
<source>Open</source>
<translation>Obre</translation>
</message>
<message>
<source>Finish</source>
<translation>Acaba</translation>
</message>
<message>
<source>Download Default Library</source>
<translation>Descarrega la llibreria per defecte</translation>
</message>
<message>
<source>Yes</source>
<translation>Sí</translation>
</message>
<message>
<source>logo</source>
<translation>logotip</translation>
</message>
</context>
<context>
<name>LoadMoreButton</name>
<message>
<source>load more</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>LogDirUploader</name>
<message>
<source>Upload log files failed</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Upload log files</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Permission Error!</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Library/Folder not found.</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Authorization expired</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Upload log files failed :%1</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Successfully uploaded log files</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>LogUploadProgressDialog</name>
<message>
<source>Compressing</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Cancel</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>%1 of %2</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>LoginDialog</name>
<message>
<source>Add an account</source>
<translation>Afegeix un compte</translation>
</message>
<message>
<source>Single Sign On</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Re-login</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Logging in...</source>
<translation>Iniciant sessió...</translation>
</message>
<message>
<source>Network Error:
%1</source>
<translation>Error de xarxa:
%1</translation>
</message>
<message>
<source><b>Warning:</b> The ssl certificate of this server is not trusted, proceed anyway?</source>
<translation><b>Atenció:</b> El certificat SSL d'aquest servidor no és de confiança, voleu continuar?</translation>
</message>
<message>
<source>Please enter the server address</source>
<translation>Introduïu la direcció del servidor</translation>
</message>
<message>
<source>%1 is not a valid server address</source>
<translation>%1 no és una direcció de servidor vàlida</translation>
</message>
<message>
<source>Please enter the username</source>
<translation>Introduïu un nom d'usuari</translation>
</message>
<message>
<source>Please enter the computer name</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>%1 Server Address</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Server address must not be empty</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>%1 is not a valid server address. It has to start with 'https://'</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Please enter the password</source>
<translation>Introduïu la contrasenya</translation>
</message>
<message>
<source>Incorrect email or password</source>
<translation>El correu electrònic o la contrasenya són incorrectes</translation>
</message>
<message>
<source>Logging in too frequently, please wait a minute</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Internal Server Error</source>
<translation>Error intern del servidor</translation>
</message>
<message>
<source>Failed to login: %1</source>
<translation>No s'ha pogut iniciar sessió: %1</translation>
</message>
<message>
<source>Failed to login</source>
<translation>No s'ha pogut iniciar sessió</translation>
</message>
<message>
<source>Dialog</source>
<translation>Finestra</translation>
</message>
<message>
<source>logo</source>
<translation>logotip</translation>
</message>
<message>
<source>Server:</source>
<translation type="unfinished"></translation>
</message>
<message>
<source><html><head/><body><p>For example: https://seacloud.cc</p></body></html></source>
<translation type="unfinished"></translation>
</message>
<message>
<source>or http://192.168.1.24:8000</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Password:</source>
<translation>Contrasenya:</translation>
</message>
<message>
<source>status text</source>
<translation>text d'estat</translation>
</message>
<message>
<source>Computer Name:</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Email / Username:</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>e.g. Jim's laptop</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Login</source>
<translation>Inicia sessió</translation>
</message>
<message>
<source>Cancel</source>
<translation>Cancel·la</translation>
</message>
<message>
<source>Automatic Login</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>LogoutView</name>
<message>
<source>You are logout. Please </source>
<translation type="unfinished"></translation>
</message>
<message>
<source>login</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Add an account</source>
<translation>Afegir un compte</translation>
</message>
</context>
<context>
<name>MainWindow</name>
<message>
<source>Refresh</source>
<translation>Refresca</translation>
</message>
</context>
<context>
<name>MessagePoller</name>
<message>
<source>"%1" is synchronized</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Files uploaded to "%1"</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Failed to sync file %1
File is locked by other application. This file will be updated when you close the application.</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Failed to sync folder %1
Some file in this folder is locked by other application. This folder will be updated when you close the application.</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Failed to sync file %1
File is locked by another user. Update to this file is not uploaded.</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Failed to index file %1
Please check file permission and disk space.</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Failed to sync %1
File path is ended with space or period and cannot be created on Windows.</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Failed to sync %1
File path contains invalid characters. It is not synced to this computer.</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Update to file %1 is denied by folder permission setting.</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Updates in read-only library %1 will not be uploaded.</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Concurrent updates to file. File %1 is saved as conflict file</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Folder %1 is moved to seafile-recycle-bin folder since it contains not-yet uploaded files.</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Folder for library %1 is removed or moved. The library is unsynced.</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Syncing is denied by cloud-only permission settings %1.</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>The file path %1 contains symbols that are not supported by the Windows system.</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Library is too large to sync.</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>PrivateShareDialog</name>
<message>
<source>Share %1</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Enter the group name</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Enter user name or email address</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Updated successfully</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Share Operation Failed: %1</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Removed successfully</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Failed to get share information of the folder</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Failed to get your groups and contacts information</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Please enter the username</source>
<translation type="unfinished">Introduïu un nom d'usuari</translation>
</message>
<message>
<source>Please enter the group name</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>No such group "%1"</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Already shared to group %1</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Already shared to user %1</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>The previous operation is still in progres</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Dialog</source>
<translation>Diàleg</translation>
</message>
<message>
<source>Share To:</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Share</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Permission:</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Read-Write</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Read-Only</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Close</source>
<translation type="unfinished">Tanca</translation>
</message>
</context>
<context>
<name>QObject</name>
<message>
<source>synchronized</source>
<translation>sincronitzat</translation>
</message>
<message>
<source>indexing files</source>
<translation>indexant els fitxers</translation>
</message>
<message>
<source>sync initializing</source>
<translation>inicialitzant la sincronització</translation>
</message>
<message>
<source>downloading</source>
<translation>descarregant</translation>
</message>
<message>
<source>uploading</source>
<translation>pujant</translation>
</message>
<message>
<source>sync merging</source>
<translation>Mesclant </translation>
</message>
<message>
<source>waiting for sync</source>
<translation>Esperant per sincronitzar</translation>
</message>
<message>
<source>server not connected</source>
<translation>el servidor no està connectat</translation>
</message>
<message>
<source>server authenticating</source>
<translation>autentificant al servidor</translation>
</message>
<message>
<source>auto sync is turned off</source>
<translation>la sincronització automàtica està desactivada</translation>
</message>
<message>
<source>unknown</source>
<translation>desconegut</translation>
</message>
<message>
<source>Unknown error</source>
<translation type="unfinished">Error desconegut</translation>
</message>
<message>
<source>Network error</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Cannot resolve proxy address</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Cannot resolve server address</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Cannot connect to server</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Failed to establish secure connection. Please check server SSL certificate</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Data transfer was interrupted. Please check network or firewall</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Data transfer timed out. Please check network or firewall</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Unhandled http redirect from server. Please check server cofiguration</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Server error</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Not enough memory</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Failed to write data on the client. Please check disk space or folder permissions</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Storage quota full</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Library deleted on server</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Library damaged on server</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>The storage quota has been used up</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>initializing...</source>
<translation>inicialitzant...</translation>
</message>
<message>
<source>connecting server...</source>
<translation>connectant al servidor...</translation>
</message>
<message>
<source>indexing files...</source>
<translation>indexant els fitxers...</translation>
</message>
<message>
<source>Downloading file list...</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Downloading files...</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Creating folder...</source>
<translation>Creant el directori...</translation>
</message>
<message>
<source>Merge file changes...</source>
<translation>Mesclant els canvis...</translation>
</message>
<message>
<source>Done</source>
<translation>Finalitzat</translation>
</message>
<message>
<source>checking server info...</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Canceling</source>
<translation>Cancelant</translation>
</message>
<message>
<source>Canceled</source>
<translation>Cancel·lat</translation>
</message>
<message>
<source>SSL Error</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Network Error: %1</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Server Error</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>failed to open certs database</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>File "%1" doesn't exist in "%2"</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>%1 couldn't find an application to open file %2</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Created library "%1"</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Deleted library "%1"</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Rename %1 to</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Unable to download item "%1"</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>copy failed</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Added</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Deleted</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Removed</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Modified</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Renamed</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Added or modified</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Moved</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Added directory</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Removed directory</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Renamed directory</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Moved directory</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>files</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>directories</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>and %1 more</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Reverted library to status at</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Reverted file "%1" to status at %2.</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Recovered deleted directory</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Changed library name or description</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Auto merge by %1 system</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Just now</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>1 day ago</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>%1 days ago</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>1 hour ago</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>%1 hours ago</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>1 minute ago</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>%1 minutes ago</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Sync this library to:</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Sync this folder to:</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Folder</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Readonly Folder</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Document</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>PDF Document</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Image File</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Text Document</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Audio File</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Video File</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Word Document</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>PowerPoint Document</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Excel Document</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>The path "%1" conflicts with system path</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>The path "%1" conflicts with an existing library</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>uploading file list</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>File is locked by another application</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Folder is locked by another application</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>File is locked by another user</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Path is invalid</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Error when indexing</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Path ends with space or period character</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Path contains invalid characters like '|' or ':'</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>failed to open file cache database</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Library name contains invalid characters such as ':', '*', '|', '?'</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Update to file denied by folder permission setting</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>%1 Client is already running</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Internal data corrupt on the client. Please try to resync the library</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Do not have write permission to the library</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Removed all items from trash</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Removed items older than days %1 from trash</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Published draft</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Created draft</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Created file</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Renamed file</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Deleted draft</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Deleted file</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Restored file</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Moved file</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Updated file</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Created folder</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Renamed folder</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Deleted folder</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Restored folder</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Moved folder</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Created library</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Renamed library</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Deleted library</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Restored library</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Created or updated a file in a non-writable library or folder</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Permission denied on server</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Concurrent updates to file. File is saved as conflict file</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>A folder that may contain not-yet-uploaded files is moved to seafile-recycle-bin folder.</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>failed to open sync error id database</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>path or repo_id invalid.</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>no permissions to create an upload link</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>no permissions to create an internal link</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>the file or folder or library could not be found.</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>internal Server Error</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>unknown error</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Syncing is denied by cloud-only permission settings</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>The file path contains symbols that are not supported by the Windows system</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Library is too large to sync.</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>no permissions to create a shared link</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>no permissions to create a upload link</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>ReliablePostFileTask</name>
<message>
<source>File does not exist</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>RepoDetailDialog</name>
<message>
<source>Library "%1"</source>
<translation>Llibreria "%1"</translation>
</message>
<message>
<source>This library is not downloaded yet</source>
<translation>Aquesta llibreria encara no s'ha descarregat</translation>
</message>
<message>
<source>Error: </source>
<translation>Error:</translation>
</message>
<message>
<source>every %1 seconds</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Dialog</source>
<translation>Finestra</translation>
</message>
<message>
<source>RepoIcon</source>
<translation>Icona</translation>
</message>
<message>
<source>RepoName</source>
<translation>Nom</translation>
</message>
<message>
<source>TextLabel</source>
<translation>Etiqueta</translation>
</message>
<message>
<source>Owner:</source>
<translation>Propietari:</translation>
</message>
<message>
<source>Last Modified:</source>
<translation>Última modificació:</translation>
</message>
<message>
<source>mtime</source>
<translation>mtime</translation>
</message>
<message>
<source>Size:</source>
<translation>mida:</translation>
</message>
<message>
<source>Local Path:</source>
<translation>Ruta local:</translation>
</message>
<message>
<source>Status:</source>
<translation>Estat:</translation>
</message>
<message>
<source>RepoStatus</source>
<translation>Repo-Estat</translation>
</message>
<message>
<source>Name:</source>
<translation>Nom:</translation>
</message>
<message>
<source>Sync Interval:</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Close</source>
<translation>Tanca</translation>
</message>
</context>
<context>
<name>RepoItemDelegate</name>
<message>
<source>, %1%2</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>, %1</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>This library has not been downloaded</source>
<translation>Aquesta llibreria no s'ha descarregat</translation>
</message>
</context>
<context>
<name>RepoService</name>
<message>
<source>Unable to open file "%1" from nonexistent library "%2"</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>RepoTreeModel</name>
<message>
<source>Recently Updated</source>
<translation>Actualitzat recenment</translation>
</message>
<message>
<source>My Libraries</source>
<translation>Llibreries personals</translation>
</message>
<message>
<source>Sub Libraries</source>
<translation>Sub-Llibreries</translation>
</message>
<message>
<source>Shared with me</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Shared with all</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Shared with groups</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Synced Libraries</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>sync initializing</source>
<translation type="unfinished">inicialitzant la sincronització</translation>
</message>
</context>
<context>
<name>RepoTreeView</name>
<message>
<source>Disable auto sync</source>
<translation>Desactiva la sincronització automàtica</translation>
</message>
<message>
<source>Enable auto sync</source>
<translation>Activa la sincronització automàtica</translation>
</message>
<message>
<source>Show &details</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Show details of this library</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>&Sync this library</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Sync this library</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Recently Updated</source>
<translation type="unfinished">Actualitzat recenment</translation>
</message>
<message>
<source>Sync &now</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Sync this library immediately</source>
<translation>Sincronitza aquesta llibreria</translation>
</message>
<message>
<source>&Cancel download</source>
<translation>&Cancel·la la descarrega</translation>
</message>
<message>
<source>Cancel download of this library</source>
<translation>Cancel·la la descarrega d'aquesta llibreria</translation>
</message>
<message>
<source>&Open folder</source>
<translation>&Obre un directori</translation>
</message>
<message>
<source>open local folder</source>
<translation>obre un directori local</translation>
</message>
<message>
<source>&Open local folder</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>&Unsync</source>
<translation>&Desincronitza</translation>
</message>
<message>
<source>unsync this library</source>
<translation>Deixa de sincronitzar aquesta llibreria</translation>
</message>
<message>
<source>&View on cloud</source>
<translation>&Mostra a la web</translation>
</message>
<message>
<source>view this library on seahub</source>
<translation>mostra aquesta llibreria a seahub</translation>
</message>
<message>
<source>Share to user</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Share this library to a user</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Share to group</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Share this library to a group</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>&Open cloud file browser</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>open this library in embedded Cloud File Browser</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>&Leave share</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>leave share</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>&Resync this library</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>unsync and resync this library</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Set sync &Interval</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>set sync interval for this library</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Are you sure to unsync the library "%1"?</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Are you sure to resync the library "%1"?</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Are you sure to overwrite the file "%1"</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Failed to unsync library "%1"</source>
<translation>No s'ha pogut sincronitzar la llibreria "%1"</translation>
</message>
<message>
<source>Are you sure you want to leave the share "%1"?</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Leaving share failed</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Failed to cancel this task:
%1</source>
<translation>No s'ha pogut cancel·lar la tasca:
%1</translation>
</message>
<message>
<source>The download has been canceled</source>
<translation>S'ha cancel·lat la descarrega</translation>
</message>
<message>
<source>You do not have permission to upload to this folder</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Unable to overwrite file "%1" with itself</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Unable to delete file "%1"</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Failed to upload file: %1</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Sync Interval (In seconds):</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Set Sync Internval For Library "%1"</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>ReposTab</name>
<message>
<source>Search libraries</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>retry</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Failed to get libraries information<br/>Please %1</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>SeafileApiClient</name>
<message>
<source><b>Warning:</b> The ssl certificate of this server is not trusted, proceed anyway?</source>
<translation type="unfinished"><b>Atenció:</b> El certificat SSL d'aquest servidor no és de confiança, voleu continuar?</translation>
</message>
</context>
<context>
<name>SeafileApplet</name>
<message>
<source>Failed to initialize log: %s</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>OK</source>
<translation>D'acord</translation>
</message>
<message>
<source>Yes</source>
<translation type="unfinished">Sí</translation>
</message>
<message>
<source>No</source>
<translation type="unfinished">No</translation>
</message>
<message>
<source>Cancel</source>
<translation>Cancel·lar</translation>
</message>
<message>
<source>failed to save client id</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>failed to access %1</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>incorrect client id</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>failed to read %1</source>
<translation type="unfinished">No s'ha pogut llegir %1</translation>
</message>
</context>
<context>
<name>SeafileExtensionHandler</name>
<message>
<source>Failed to get internal link: %1</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>failed to get share link: %1</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Failed to lock file</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Failed to unlock file</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Failed to get upload link: %1</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>File "%1" is locked by %2</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Failed to get lock information for file "%1"</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>SeafileLinkDialog</name>
<message>
<source>%1 Internal Link</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Copy to clipboard</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>OK</source>
<translation>D'acord</translation>
</message>
<message>
<source>%1 Internal Link:</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>%1 Desktop Access Link:</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>SeafileRpcClient</name>
<message>
<source>Unknown error</source>
<translation>Error desconegut</translation>
</message>
<message>
<source>internal error: failed to connect to daemon</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>SeafileTrayIcon</name>
<message>
<source>Disable auto sync</source>
<translation>Desactiva la sincronització automàtica</translation>
</message>
<message>
<source>Enable auto sync</source>
<translation>Activa la sincronització automàtica</translation>
</message>
<message>
<source>&Quit</source>
<translation>&Sortir</translation>
</message>
<message>
<source>Show main window</source>
<translation>Mostra la finestra</translation>
</message>
<message>
<source>Settings</source>
<translation>Configuració</translation>
</message>
<message>
<source>Open %1 &folder</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>open %1 folder</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Open &logs folder</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Show file sync errors</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>&About</source>
<translation>&Sobre</translation>
</message>
<message>
<source>Show the application's About box</source>
<translation>Mostra informació sobre l'aplicació</translation>
</message>
<message>
<source>&Online help</source>
<translation>&Ajuda a la web</translation>
</message>
<message>
<source>File</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>auto sync is disabled</source>
<translation>La sincronització automàtica està desactivada</translation>
</message>
<message>
<source>Uploading</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Downloading</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>open %1 log folder</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>open %1 online help</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>some servers not connected</source>
<translation>alguns servidors no estan connectats</translation>
</message>
<message>
<source>Upload log files</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>upload %1 log files</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Please login first</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Repair explorer extension</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Successfully fixed sync status icons for Explorer</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Faild to fix sync status icons for Explorer</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>have some sync error</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>SearchResultListView</name>
<message>
<source>&Show in folder</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Show in folder</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>SearchTab</name>
<message>
<source>Search files</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>retry</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Failed to search<br/>Please %1</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>ServerStatusDialog</name>
<message>
<source>Servers connection status</source>
<translation>Estat de la connexió remota</translation>
</message>
<message>
<source>connected</source>
<translation>connectat</translation>
</message>
<message>
<source>disconnected</source>
<translation>desconnectat</translation>
</message>
<message>
<source>Dialog</source>
<translation>Finestra</translation>
</message>
<message>
<source>Close</source>
<translation>Tanca</translation>
</message>
</context>
<context>
<name>SetRepoPasswordDialog</name>
<message>
<source>Please provide the library password</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Provide the password for library %1</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Please enter the password</source>
<translation type="unfinished">Introduïu la contrasenya</translation>
</message>
<message>
<source>Incorrect password</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Unknown error</source>
<translation type="unfinished">Error desconegut</translation>
</message>
<message>
<source>Dialog</source>
<translation>Diàleg</translation>
</message>
<message>
<source>OK</source>
<translation>D'acord</translation>
</message>
<message>
<source>Cancel</source>
<translation>Cancel·lar</translation>
</message>
</context>
<context>
<name>SettingsDialog</name>
<message>
<source>Settings</source>
<translation>Configuració</translation>
</message>
<message>
<source>Auto start %1 after login</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Hide %1 Icon from the dock</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>None</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>HTTP Proxy</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Socks5 Proxy</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>System Proxy</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>You have changed languange. Restart to apply it?</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>The proxy host address can't be empty</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>The proxy port is incorrect</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Proxy username can't be empty</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Proxy password can't be empty</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Dialog</source>
<translation>Finestra</translation>
</message>
<message>
<source>Hide main window when started</source>
<translation>Oculta la finestra principal al iniciar</translation>
</message>
<message>
<source>Notify when libraries are synchronized</source>
<translation>Notifica quan les llibreries estan sincronitzades</translation>
</message>
<message>
<source>Enable sync temporary files of MSOffice/Libreoffice</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Download speed limit (KB/s):</source>
<translation>Límit de baixada (KB/s):</translation>
</message>
<message>
<source>Upload speed limit (KB/s):</source>
<translation>Límit de pujada (KB/s):</translation>
</message>
<message>
<source>Basic</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Do not automatically unsync a library</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Do not automatically unsync a library when its local directory is removed or unaccessible for other reasons.</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Do not unsync a library when not found on server</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Do not automatically unsync a library when it's not found on server</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Enable FinderSync Extension</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Enable Explorer Extension</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Check for updates automatically</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Do not verify server certificate in HTTPS syncing</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Enable syncing with an existing folder with a different name</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Advanced</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Language (need restart)</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Language</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Proxy Type:</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Host:</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Port:</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>0</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Username:</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Password:</source>
<translation type="unfinished">Contrasenya:</translation>
</message>
<message>
<source>Proxy server requires a password</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Network</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>OK</source>
<translation>D'acord</translation>
</message>
<message>
<source>Cancel</source>
<translation>Cancel·la</translation>
</message>
<message>
<source>Hide Windows incompatibility paths Message</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>SharedItemDelegate</name>
<message>
<source>Read Write</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Read Only</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Remove Share</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>SharedItemsTableModel</name>
<message>
<source>Click to edit</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Created by %1</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Read Write</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Read Only</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Group</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>User</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Permission</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>The previous operation is still in progres</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>SharedLinkDialog</name>
<message>
<source>Share Link</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Share link:</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Direct Download</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Copy to clipboard</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Password(At least 8 characters)</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Show password</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Expire days</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Generate link</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>SslConfirmDialog</name>
<message>
<source>Untrusted Connection</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>%1 uses an invalid security certificate. The connection may be insecure. Do you want to continue?</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Current RSA key fingerprint is %1</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Previous RSA key fingerprint is %1</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Dialog</source>
<translation>Diàleg</translation>
</message>
<message>
<source>Remember my choice</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Yes</source>
<translation type="unfinished">Sí</translation>
</message>
<message>
<source>No</source>
<translation type="unfinished">No</translation>
</message>
</context>
<context>
<name>StarredFilesListView</name>
<message>
<source>&Open</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Open this file</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>view on &Web</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>view this file on website</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>StarredFilesTab</name>
<message>
<source>retry</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Failed to get starred files information<br/>Please %1</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>You have no starred files yet.</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>SyncErrorsDialog</name>
<message>
<source>File Sync Errors</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>No sync errors.</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>SyncErrorsTableModel</name>
<message>
<source>Double click to open the library</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Library</source>
<translation type="unfinished">Llibreria</translation>
</message>
<message>
<source>Path</source>
<translation type="unfinished">Ruta</translation>
</message>
<message>
<source>Error</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Time</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>SyncErrorsTableView</name>
<message>
<source>Delete file sync error failed</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>delete</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>TwoFactorDialog</name>
<message>
<source>Enter the two factor authentication token</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Two Factor Authentication</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Please enter the two factor authentication token</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Dialog</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>mText</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Remember this device</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Cancel</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>OK</source>
<translation type="unfinished">D'acord</translation>
</message>
</context>
<context>
<name>UninstallHelperDialog</name>
<message>
<source>Uninstall %1</source>
<translation>Desinstal·la %1</translation>
</message>
<message>
<source>Do you want to remove the %1 account information?</source>
<translation>Voleu eliminar la informació del compte %1?</translation>
</message>
<message>
<source>Removing account information...</source>
<translation>Eliminant informació del compte...</translation>
</message>
<message>
<source>Dialog</source>
<translation>Finestra</translation>
</message>
<message>
<source>text</source>
<translation>text</translation>
</message>
<message>
<source>Yes</source>
<translation>Sí</translation>
</message>
<message>
<source>No</source>
<translation>No</translation>
</message>
</context>
<context>
<name>UploadLinkDialog</name>
<message>
<source>Upload Link</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Upload link:</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Copy to clipboard</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>OK</source>
<translation type="unfinished">D'acord</translation>
</message>
</context>
</TS>
|
{
"content_hash": "a4cb27b4b0659c2528f91ecd3a90e058",
"timestamp": "",
"source": "github",
"line_count": 3340,
"max_line_length": 219,
"avg_line_length": 32.16526946107784,
"alnum_prop": 0.6242460347010201,
"repo_name": "haiwen/seafile-client",
"id": "d86eeebf1f72aabebea542cc8a13f63b3aaa485f",
"size": "107531",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "i18n/seafile_ca.ts",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "C",
"bytes": "14639"
},
{
"name": "C++",
"bytes": "1466985"
},
{
"name": "CMake",
"bytes": "31588"
},
{
"name": "CSS",
"bytes": "14223"
},
{
"name": "Objective-C",
"bytes": "3056"
},
{
"name": "Objective-C++",
"bytes": "65941"
},
{
"name": "Python",
"bytes": "11834"
},
{
"name": "Shell",
"bytes": "7862"
}
],
"symlink_target": ""
}
|
require 'spec_helper'
require Rails.root.join('db', 'post_migrate', '20170816102555_cleanup_nonexisting_namespace_pending_delete_projects.rb')
describe CleanupNonexistingNamespacePendingDeleteProjects do
before do
# Stub after_save callbacks that will fail when Project has invalid namespace
allow_any_instance_of(Project).to receive(:ensure_storage_path_exist).and_return(nil)
allow_any_instance_of(Project).to receive(:update_project_statistics).and_return(nil)
end
describe '#up' do
set(:some_project) { create(:project) } # rubocop:disable RSpec/FactoriesInMigrationSpecs
it 'only cleans up when namespace does not exist' do
create(:project, pending_delete: true) # rubocop:disable RSpec/FactoriesInMigrationSpecs
project = build(:project, pending_delete: true, namespace: nil, namespace_id: Namespace.maximum(:id).to_i.succ) # rubocop:disable RSpec/FactoriesInMigrationSpecs
project.save(validate: false)
expect(NamespacelessProjectDestroyWorker).to receive(:bulk_perform_async).with([[project.id]])
described_class.new.up
end
it 'does nothing when no pending delete projects without namespace found' do
create(:project, pending_delete: true, namespace: create(:namespace)) # rubocop:disable RSpec/FactoriesInMigrationSpecs
expect(NamespacelessProjectDestroyWorker).not_to receive(:bulk_perform_async)
described_class.new.up
end
end
end
|
{
"content_hash": "4b7774a9e7815f683d22f82baecd6c96",
"timestamp": "",
"source": "github",
"line_count": 32,
"max_line_length": 167,
"avg_line_length": 44.9375,
"alnum_prop": 0.7573018080667594,
"repo_name": "axilleas/gitlabhq",
"id": "8f40ac3e38be08837a99a1b66769f41f6a49aaf8",
"size": "1438",
"binary": false,
"copies": "3",
"ref": "refs/heads/master",
"path": "spec/migrations/cleanup_nonexisting_namespace_pending_delete_projects_spec.rb",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "683690"
},
{
"name": "Clojure",
"bytes": "79"
},
{
"name": "Dockerfile",
"bytes": "1907"
},
{
"name": "HTML",
"bytes": "1340167"
},
{
"name": "JavaScript",
"bytes": "4309733"
},
{
"name": "Ruby",
"bytes": "19732082"
},
{
"name": "Shell",
"bytes": "44575"
},
{
"name": "Vue",
"bytes": "1040466"
}
],
"symlink_target": ""
}
|
require 'cgi'
module RubyAMI
class AGIResultParser
attr_reader :code, :result, :data
FORMAT = /^(?<code>\d{3})( result=(?<result>-?\d*))? ?(?<data>\(?.*\)?)?$/
DATA_KV_FORMAT = /(?<key>[\w\d]+)=(?<value>[\w\d]*)/
DATA_CLEANER = /(^\()|(\)$)/
def initialize(result_string)
@result_string = result_string.dup
raise ArgumentError, "The result string (#{@result_string}) did not match the required format (#{FORMAT})." unless match
parse
end
def data_hash
return unless data_kv_match
{data_kv_match[:key] => data_kv_match[:value]}
end
private
def unescape
CGI.unescape @result_string
end
def match
@match ||= unescape.chomp.match(FORMAT)
end
def parse
@code = match[:code].to_i
@result = match[:result] ? match[:result].to_i : nil
@data = match[:data] ? match[:data].gsub(DATA_CLEANER, '').freeze : nil
end
def data_kv_match
@data_kv_match ||= data.match(DATA_KV_FORMAT)
end
end
end
|
{
"content_hash": "e671b9ed0b78bd822f13e5693d3dd8f8",
"timestamp": "",
"source": "github",
"line_count": 42,
"max_line_length": 126,
"avg_line_length": 24.738095238095237,
"alnum_prop": 0.5717035611164581,
"repo_name": "ThomasSevestre/ruby_ami",
"id": "351e0c7f75b19d90c80766282868c7a6093c17de",
"size": "1069",
"binary": false,
"copies": "1",
"ref": "refs/heads/eventmachine",
"path": "lib/ruby_ami/agi_result_parser.rb",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Gherkin",
"bytes": "10362"
},
{
"name": "Ruby",
"bytes": "53744"
}
],
"symlink_target": ""
}
|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace RayTracer.Animation
{
public interface IAnimation
{
void Animate(float time);
}
}
|
{
"content_hash": "136ef064fe6a196d8b970a37266e39b3",
"timestamp": "",
"source": "github",
"line_count": 12,
"max_line_length": 33,
"avg_line_length": 16.666666666666668,
"alnum_prop": 0.71,
"repo_name": "MortenChristiansen/Rend-Studio",
"id": "11482dcf0f3740a70cff98e084ea46d7b27aadf6",
"size": "202",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "Rend Studio/RayTracer/Animation/IAnimation.cs",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C#",
"bytes": "489021"
},
{
"name": "F#",
"bytes": "52020"
}
],
"symlink_target": ""
}
|
namespace v8 {
namespace internal {
TF_BUILTIN(FastFunctionPrototypeBind, CodeStubAssembler) {
Label slow(this);
// TODO(ishell): use constants from Descriptor once the JSFunction linkage
// arguments are reordered.
Node* argc = Parameter(Descriptor::kJSActualArgumentsCount);
Node* context = Parameter(Descriptor::kContext);
Node* new_target = Parameter(Descriptor::kJSNewTarget);
CodeStubArguments args(this, ChangeInt32ToIntPtr(argc));
// Check that receiver has instance type of JS_FUNCTION_TYPE
Node* receiver = args.GetReceiver();
GotoIf(TaggedIsSmi(receiver), &slow);
Node* receiver_map = LoadMap(receiver);
{
Node* instance_type = LoadMapInstanceType(receiver_map);
GotoIfNot(
Word32Or(InstanceTypeEqual(instance_type, JS_FUNCTION_TYPE),
InstanceTypeEqual(instance_type, JS_BOUND_FUNCTION_TYPE)),
&slow);
}
// Disallow binding of slow-mode functions. We need to figure out whether the
// length and name property are in the original state.
Comment("Disallow binding of slow-mode functions");
GotoIf(IsDictionaryMap(receiver_map), &slow);
// Check whether the length and name properties are still present as
// AccessorInfo objects. In that case, their value can be recomputed even if
// the actual value on the object changes.
Comment("Check descriptor array length");
TNode<DescriptorArray> descriptors = LoadMapDescriptors(receiver_map);
// Minimum descriptor array length required for fast path.
const int min_descriptors_length = DescriptorArray::LengthFor(Max(
JSFunction::kLengthDescriptorIndex, JSFunction::kNameDescriptorIndex));
TNode<Smi> descriptors_length = LoadWeakFixedArrayLength(descriptors);
GotoIf(SmiLessThanOrEqual(descriptors_length,
SmiConstant(min_descriptors_length)),
&slow);
// Check whether the length and name properties are still present as
// AccessorInfo objects. In that case, their value can be recomputed even if
// the actual value on the object changes.
Comment("Check name and length properties");
{
const int length_index = JSFunction::kLengthDescriptorIndex;
TNode<Name> maybe_length = CAST(LoadWeakFixedArrayElement(
descriptors, DescriptorArray::ToKeyIndex(length_index)));
GotoIf(WordNotEqual(maybe_length, LoadRoot(RootIndex::klength_string)),
&slow);
TNode<Object> maybe_length_accessor = CAST(LoadWeakFixedArrayElement(
descriptors, DescriptorArray::ToValueIndex(length_index)));
GotoIf(TaggedIsSmi(maybe_length_accessor), &slow);
Node* length_value_map = LoadMap(CAST(maybe_length_accessor));
GotoIfNot(IsAccessorInfoMap(length_value_map), &slow);
const int name_index = JSFunction::kNameDescriptorIndex;
TNode<Name> maybe_name = CAST(LoadWeakFixedArrayElement(
descriptors, DescriptorArray::ToKeyIndex(name_index)));
GotoIf(WordNotEqual(maybe_name, LoadRoot(RootIndex::kname_string)), &slow);
TNode<Object> maybe_name_accessor = CAST(LoadWeakFixedArrayElement(
descriptors, DescriptorArray::ToValueIndex(name_index)));
GotoIf(TaggedIsSmi(maybe_name_accessor), &slow);
TNode<Map> name_value_map = LoadMap(CAST(maybe_name_accessor));
GotoIfNot(IsAccessorInfoMap(name_value_map), &slow);
}
// Choose the right bound function map based on whether the target is
// constructable.
Comment("Choose the right bound function map");
VARIABLE(bound_function_map, MachineRepresentation::kTagged);
{
Label with_constructor(this);
VariableList vars({&bound_function_map}, zone());
Node* native_context = LoadNativeContext(context);
Label map_done(this, vars);
GotoIf(IsConstructorMap(receiver_map), &with_constructor);
bound_function_map.Bind(LoadContextElement(
native_context, Context::BOUND_FUNCTION_WITHOUT_CONSTRUCTOR_MAP_INDEX));
Goto(&map_done);
BIND(&with_constructor);
bound_function_map.Bind(LoadContextElement(
native_context, Context::BOUND_FUNCTION_WITH_CONSTRUCTOR_MAP_INDEX));
Goto(&map_done);
BIND(&map_done);
}
// Verify that __proto__ matches that of a the target bound function.
Comment("Verify that __proto__ matches target bound function");
Node* prototype = LoadMapPrototype(receiver_map);
Node* expected_prototype = LoadMapPrototype(bound_function_map.value());
GotoIf(WordNotEqual(prototype, expected_prototype), &slow);
// Allocate the arguments array.
Comment("Allocate the arguments array");
VARIABLE(argument_array, MachineRepresentation::kTagged);
{
Label empty_arguments(this);
Label arguments_done(this, &argument_array);
GotoIf(Uint32LessThanOrEqual(argc, Int32Constant(1)), &empty_arguments);
TNode<IntPtrT> elements_length =
Signed(ChangeUint32ToWord(Unsigned(Int32Sub(argc, Int32Constant(1)))));
TNode<FixedArray> elements = CAST(AllocateFixedArray(
PACKED_ELEMENTS, elements_length, kAllowLargeObjectAllocation));
VARIABLE(index, MachineType::PointerRepresentation());
index.Bind(IntPtrConstant(0));
VariableList foreach_vars({&index}, zone());
args.ForEach(foreach_vars,
[this, elements, &index](Node* arg) {
StoreFixedArrayElement(elements, index.value(), arg);
Increment(&index);
},
IntPtrConstant(1));
argument_array.Bind(elements);
Goto(&arguments_done);
BIND(&empty_arguments);
argument_array.Bind(EmptyFixedArrayConstant());
Goto(&arguments_done);
BIND(&arguments_done);
}
// Determine bound receiver.
Comment("Determine bound receiver");
VARIABLE(bound_receiver, MachineRepresentation::kTagged);
{
Label has_receiver(this);
Label receiver_done(this, &bound_receiver);
GotoIf(Word32NotEqual(argc, Int32Constant(0)), &has_receiver);
bound_receiver.Bind(UndefinedConstant());
Goto(&receiver_done);
BIND(&has_receiver);
bound_receiver.Bind(args.AtIndex(0));
Goto(&receiver_done);
BIND(&receiver_done);
}
// Allocate the resulting bound function.
Comment("Allocate the resulting bound function");
{
Node* bound_function = Allocate(JSBoundFunction::kSize);
StoreMapNoWriteBarrier(bound_function, bound_function_map.value());
StoreObjectFieldNoWriteBarrier(
bound_function, JSBoundFunction::kBoundTargetFunctionOffset, receiver);
StoreObjectFieldNoWriteBarrier(bound_function,
JSBoundFunction::kBoundThisOffset,
bound_receiver.value());
StoreObjectFieldNoWriteBarrier(bound_function,
JSBoundFunction::kBoundArgumentsOffset,
argument_array.value());
Node* empty_fixed_array = EmptyFixedArrayConstant();
StoreObjectFieldNoWriteBarrier(
bound_function, JSObject::kPropertiesOrHashOffset, empty_fixed_array);
StoreObjectFieldNoWriteBarrier(bound_function, JSObject::kElementsOffset,
empty_fixed_array);
args.PopAndReturn(bound_function);
}
BIND(&slow);
{
// We are not using Parameter(Descriptor::kJSTarget) and loading the value
// from the current frame here in order to reduce register pressure on the
// fast path.
TNode<JSFunction> target = LoadTargetFromFrame();
TailCallBuiltin(Builtins::kFunctionPrototypeBind, context, target,
new_target, argc);
}
}
// ES6 #sec-function.prototype-@@hasinstance
TF_BUILTIN(FunctionPrototypeHasInstance, CodeStubAssembler) {
Node* context = Parameter(Descriptor::kContext);
Node* f = Parameter(Descriptor::kReceiver);
Node* v = Parameter(Descriptor::kV);
Node* result = OrdinaryHasInstance(context, f, v);
Return(result);
}
} // namespace internal
} // namespace v8
|
{
"content_hash": "b0f18a5c1c2cc753757c1b77d6eb0b13",
"timestamp": "",
"source": "github",
"line_count": 195,
"max_line_length": 80,
"avg_line_length": 40.266666666666666,
"alnum_prop": 0.7047885888945492,
"repo_name": "fceller/arangodb",
"id": "2f3c876852ddbacc74c1f4c58be19c247ad921ac",
"size": "8252",
"binary": false,
"copies": "1",
"ref": "refs/heads/devel",
"path": "3rdParty/V8/v7.1.302.28/src/builtins/builtins-function-gen.cc",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Ada",
"bytes": "89080"
},
{
"name": "AppleScript",
"bytes": "1429"
},
{
"name": "Assembly",
"bytes": "142084"
},
{
"name": "Batchfile",
"bytes": "9073"
},
{
"name": "C",
"bytes": "1938354"
},
{
"name": "C#",
"bytes": "55625"
},
{
"name": "C++",
"bytes": "79379178"
},
{
"name": "CLIPS",
"bytes": "5291"
},
{
"name": "CMake",
"bytes": "109718"
},
{
"name": "CSS",
"bytes": "1341035"
},
{
"name": "CoffeeScript",
"bytes": "94"
},
{
"name": "DIGITAL Command Language",
"bytes": "27303"
},
{
"name": "Emacs Lisp",
"bytes": "15477"
},
{
"name": "Go",
"bytes": "1018005"
},
{
"name": "Groff",
"bytes": "263567"
},
{
"name": "HTML",
"bytes": "459886"
},
{
"name": "JavaScript",
"bytes": "55446690"
},
{
"name": "LLVM",
"bytes": "39361"
},
{
"name": "Lua",
"bytes": "16189"
},
{
"name": "Makefile",
"bytes": "178253"
},
{
"name": "Module Management System",
"bytes": "1545"
},
{
"name": "NSIS",
"bytes": "26909"
},
{
"name": "Objective-C",
"bytes": "4430"
},
{
"name": "Objective-C++",
"bytes": "1857"
},
{
"name": "Pascal",
"bytes": "145262"
},
{
"name": "Perl",
"bytes": "227308"
},
{
"name": "Protocol Buffer",
"bytes": "5837"
},
{
"name": "Python",
"bytes": "3563935"
},
{
"name": "Ruby",
"bytes": "1000962"
},
{
"name": "SAS",
"bytes": "1847"
},
{
"name": "Scheme",
"bytes": "19885"
},
{
"name": "Shell",
"bytes": "488846"
},
{
"name": "VimL",
"bytes": "4075"
},
{
"name": "Yacc",
"bytes": "36950"
}
],
"symlink_target": ""
}
|
use clippy_utils::consts::{constant, Constant};
use clippy_utils::diagnostics::span_lint_and_sugg;
use clippy_utils::higher;
use clippy_utils::source::snippet_with_applicability;
use clippy_utils::ty::is_copy;
use if_chain::if_chain;
use rustc_errors::Applicability;
use rustc_hir::{BorrowKind, Expr, ExprKind, Mutability};
use rustc_lint::{LateContext, LateLintPass};
use rustc_middle::ty::layout::LayoutOf;
use rustc_middle::ty::{self, Ty};
use rustc_session::{declare_tool_lint, impl_lint_pass};
use rustc_span::source_map::Span;
#[allow(clippy::module_name_repetitions)]
#[derive(Copy, Clone)]
pub struct UselessVec {
pub too_large_for_stack: u64,
}
declare_clippy_lint! {
/// ### What it does
/// Checks for usage of `&vec![..]` when using `&[..]` would
/// be possible.
///
/// ### Why is this bad?
/// This is less efficient.
///
/// ### Example
/// ```rust
/// # fn foo(my_vec: &[u8]) {}
///
/// // Bad
/// foo(&vec![1, 2]);
///
/// // Good
/// foo(&[1, 2]);
/// ```
pub USELESS_VEC,
perf,
"useless `vec!`"
}
impl_lint_pass!(UselessVec => [USELESS_VEC]);
impl<'tcx> LateLintPass<'tcx> for UselessVec {
fn check_expr(&mut self, cx: &LateContext<'tcx>, expr: &'tcx Expr<'_>) {
// search for `&vec![_]` expressions where the adjusted type is `&[_]`
if_chain! {
if let ty::Ref(_, ty, _) = cx.typeck_results().expr_ty_adjusted(expr).kind();
if let ty::Slice(..) = ty.kind();
if let ExprKind::AddrOf(BorrowKind::Ref, mutability, addressee) = expr.kind;
if let Some(vec_args) = higher::VecArgs::hir(cx, addressee);
then {
self.check_vec_macro(cx, &vec_args, mutability, expr.span);
}
}
// search for `for _ in vec![…]`
if_chain! {
if let Some(higher::ForLoop { arg, .. }) = higher::ForLoop::hir(expr);
if let Some(vec_args) = higher::VecArgs::hir(cx, arg);
if is_copy(cx, vec_type(cx.typeck_results().expr_ty_adjusted(arg)));
then {
// report the error around the `vec!` not inside `<std macros>:`
let span = arg.span.ctxt().outer_expn_data().call_site;
self.check_vec_macro(cx, &vec_args, Mutability::Not, span);
}
}
}
}
impl UselessVec {
fn check_vec_macro<'tcx>(
self,
cx: &LateContext<'tcx>,
vec_args: &higher::VecArgs<'tcx>,
mutability: Mutability,
span: Span,
) {
let mut applicability = Applicability::MachineApplicable;
let snippet = match *vec_args {
higher::VecArgs::Repeat(elem, len) => {
if let Some((Constant::Int(len_constant), _)) = constant(cx, cx.typeck_results(), len) {
#[allow(clippy::cast_possible_truncation)]
if len_constant as u64 * size_of(cx, elem) > self.too_large_for_stack {
return;
}
match mutability {
Mutability::Mut => {
format!(
"&mut [{}; {}]",
snippet_with_applicability(cx, elem.span, "elem", &mut applicability),
snippet_with_applicability(cx, len.span, "len", &mut applicability)
)
},
Mutability::Not => {
format!(
"&[{}; {}]",
snippet_with_applicability(cx, elem.span, "elem", &mut applicability),
snippet_with_applicability(cx, len.span, "len", &mut applicability)
)
},
}
} else {
return;
}
},
higher::VecArgs::Vec(args) => {
if let Some(last) = args.iter().last() {
#[allow(clippy::cast_possible_truncation)]
if args.len() as u64 * size_of(cx, last) > self.too_large_for_stack {
return;
}
let span = args[0].span.to(last.span);
match mutability {
Mutability::Mut => {
format!(
"&mut [{}]",
snippet_with_applicability(cx, span, "..", &mut applicability)
)
},
Mutability::Not => {
format!("&[{}]", snippet_with_applicability(cx, span, "..", &mut applicability))
},
}
} else {
match mutability {
Mutability::Mut => "&mut []".into(),
Mutability::Not => "&[]".into(),
}
}
},
};
span_lint_and_sugg(
cx,
USELESS_VEC,
span,
"useless use of `vec!`",
"you can use a slice directly",
snippet,
applicability,
);
}
}
fn size_of(cx: &LateContext<'_>, expr: &Expr<'_>) -> u64 {
let ty = cx.typeck_results().expr_ty_adjusted(expr);
cx.layout_of(ty).map_or(0, |l| l.size.bytes())
}
/// Returns the item type of the vector (i.e., the `T` in `Vec<T>`).
fn vec_type(ty: Ty<'_>) -> Ty<'_> {
if let ty::Adt(_, substs) = ty.kind() {
substs.type_at(0)
} else {
panic!("The type of `vec!` is a not a struct?");
}
}
|
{
"content_hash": "67f998b57ac3119b25d001888f717429",
"timestamp": "",
"source": "github",
"line_count": 162,
"max_line_length": 108,
"avg_line_length": 35.53086419753087,
"alnum_prop": 0.45639332870048643,
"repo_name": "aidancully/rust",
"id": "d3234b5758a575b2066f57cb673959ef5420ed3b",
"size": "5758",
"binary": false,
"copies": "3",
"ref": "refs/heads/master",
"path": "src/tools/clippy/clippy_lints/src/vec.rs",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "ANTLR",
"bytes": "26968"
},
{
"name": "Assembly",
"bytes": "20050"
},
{
"name": "Awk",
"bytes": "159"
},
{
"name": "C",
"bytes": "726643"
},
{
"name": "C++",
"bytes": "54397"
},
{
"name": "CSS",
"bytes": "22328"
},
{
"name": "JavaScript",
"bytes": "38337"
},
{
"name": "LLVM",
"bytes": "5040"
},
{
"name": "Lex",
"bytes": "9238"
},
{
"name": "Makefile",
"bytes": "238787"
},
{
"name": "Pascal",
"bytes": "13073"
},
{
"name": "Puppet",
"bytes": "3193"
},
{
"name": "Python",
"bytes": "149063"
},
{
"name": "RenderScript",
"bytes": "26426"
},
{
"name": "Rust",
"bytes": "18504256"
},
{
"name": "Shell",
"bytes": "270708"
},
{
"name": "TeX",
"bytes": "57"
},
{
"name": "Yacc",
"bytes": "80496"
}
],
"symlink_target": ""
}
|
/* TEMPLATE GENERATED TESTCASE FILE
Filename: CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_connect_socket_51a.c
Label Definition File: CWE761_Free_Pointer_Not_at_Start_of_Buffer.label.xml
Template File: source-sinks-51a.tmpl.c
*/
/*
* @description
* CWE: 761 Free Pointer not at Start of Buffer
* BadSource: connect_socket Read data using a connect socket (client side)
* Sinks:
* GoodSink: free() memory correctly at the start of the buffer
* BadSink : free() memory not at the start of the buffer
* Flow Variant: 51 Data flow: data passed as an argument from one function to another in different source files
*
* */
#include "std_testcase.h"
#include <wchar.h>
#ifdef _WIN32
#include <winsock2.h>
#include <windows.h>
#include <direct.h>
#pragma comment(lib, "ws2_32") /* include ws2_32.lib when linking */
#define CLOSE_SOCKET closesocket
#else /* NOT _WIN32 */
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <unistd.h>
#define INVALID_SOCKET -1
#define SOCKET_ERROR -1
#define CLOSE_SOCKET close
#define SOCKET int
#endif
#define TCP_PORT 27015
#define IP_ADDRESS "127.0.0.1"
#define SEARCH_CHAR 'S'
#ifndef OMITBAD
/* bad function declaration */
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_connect_socket_51b_badSink(char * data);
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_connect_socket_51_bad()
{
char * data;
data = (char *)malloc(100*sizeof(char));
if (data == NULL) {exit(-1);}
data[0] = '\0';
{
#ifdef _WIN32
WSADATA wsaData;
int wsaDataInit = 0;
#endif
int recvResult;
struct sockaddr_in service;
char *replace;
SOCKET connectSocket = INVALID_SOCKET;
size_t dataLen = strlen(data);
do
{
#ifdef _WIN32
if (WSAStartup(MAKEWORD(2,2), &wsaData) != NO_ERROR)
{
break;
}
wsaDataInit = 1;
#endif
/* POTENTIAL FLAW: Read data using a connect socket */
connectSocket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);
if (connectSocket == INVALID_SOCKET)
{
break;
}
memset(&service, 0, sizeof(service));
service.sin_family = AF_INET;
service.sin_addr.s_addr = inet_addr(IP_ADDRESS);
service.sin_port = htons(TCP_PORT);
if (connect(connectSocket, (struct sockaddr*)&service, sizeof(service)) == SOCKET_ERROR)
{
break;
}
/* Abort on error or the connection was closed, make sure to recv one
* less char than is in the recv_buf in order to append a terminator */
/* Abort on error or the connection was closed */
recvResult = recv(connectSocket, (char *)(data + dataLen), sizeof(char) * (100 - dataLen - 1), 0);
if (recvResult == SOCKET_ERROR || recvResult == 0)
{
break;
}
/* Append null terminator */
data[dataLen + recvResult / sizeof(char)] = '\0';
/* Eliminate CRLF */
replace = strchr(data, '\r');
if (replace)
{
*replace = '\0';
}
replace = strchr(data, '\n');
if (replace)
{
*replace = '\0';
}
}
while (0);
if (connectSocket != INVALID_SOCKET)
{
CLOSE_SOCKET(connectSocket);
}
#ifdef _WIN32
if (wsaDataInit)
{
WSACleanup();
}
#endif
}
CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_connect_socket_51b_badSink(data);
}
#endif /* OMITBAD */
#ifndef OMITGOOD
/* good function declarations */
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_connect_socket_51b_goodB2GSink(char * data);
/* goodB2G uses the BadSource with the GoodSink */
static void goodB2G()
{
char * data;
data = (char *)malloc(100*sizeof(char));
if (data == NULL) {exit(-1);}
data[0] = '\0';
{
#ifdef _WIN32
WSADATA wsaData;
int wsaDataInit = 0;
#endif
int recvResult;
struct sockaddr_in service;
char *replace;
SOCKET connectSocket = INVALID_SOCKET;
size_t dataLen = strlen(data);
do
{
#ifdef _WIN32
if (WSAStartup(MAKEWORD(2,2), &wsaData) != NO_ERROR)
{
break;
}
wsaDataInit = 1;
#endif
/* POTENTIAL FLAW: Read data using a connect socket */
connectSocket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);
if (connectSocket == INVALID_SOCKET)
{
break;
}
memset(&service, 0, sizeof(service));
service.sin_family = AF_INET;
service.sin_addr.s_addr = inet_addr(IP_ADDRESS);
service.sin_port = htons(TCP_PORT);
if (connect(connectSocket, (struct sockaddr*)&service, sizeof(service)) == SOCKET_ERROR)
{
break;
}
/* Abort on error or the connection was closed, make sure to recv one
* less char than is in the recv_buf in order to append a terminator */
/* Abort on error or the connection was closed */
recvResult = recv(connectSocket, (char *)(data + dataLen), sizeof(char) * (100 - dataLen - 1), 0);
if (recvResult == SOCKET_ERROR || recvResult == 0)
{
break;
}
/* Append null terminator */
data[dataLen + recvResult / sizeof(char)] = '\0';
/* Eliminate CRLF */
replace = strchr(data, '\r');
if (replace)
{
*replace = '\0';
}
replace = strchr(data, '\n');
if (replace)
{
*replace = '\0';
}
}
while (0);
if (connectSocket != INVALID_SOCKET)
{
CLOSE_SOCKET(connectSocket);
}
#ifdef _WIN32
if (wsaDataInit)
{
WSACleanup();
}
#endif
}
CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_connect_socket_51b_goodB2GSink(data);
}
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_connect_socket_51_good()
{
goodB2G();
}
#endif /* OMITGOOD */
/* Below is the main(). It is only used when building this testcase on
its own for testing or for building a binary to use in testing binary
analysis tools. It is not used when compiling all the testcases as one
application, which is how source code analysis tools are tested. */
#ifdef INCLUDEMAIN
int main(int argc, char * argv[])
{
/* seed randomness */
srand( (unsigned)time(NULL) );
#ifndef OMITGOOD
printLine("Calling good()...");
CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_connect_socket_51_good();
printLine("Finished good()");
#endif /* OMITGOOD */
#ifndef OMITBAD
printLine("Calling bad()...");
CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_connect_socket_51_bad();
printLine("Finished bad()");
#endif /* OMITBAD */
return 0;
}
#endif
|
{
"content_hash": "8d9de676f94879ab41547d1df6d854f4",
"timestamp": "",
"source": "github",
"line_count": 240,
"max_line_length": 112,
"avg_line_length": 31.029166666666665,
"alnum_prop": 0.5477373438968712,
"repo_name": "JianpingZeng/xcc",
"id": "42abf7c60e4e3b6d19e71fc7f5622e300d6ecf21",
"size": "7447",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "xcc/test/juliet/testcases/CWE761_Free_Pointer_Not_at_Start_of_Buffer/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_connect_socket_51a.c",
"mode": "33188",
"license": "bsd-3-clause",
"language": [],
"symlink_target": ""
}
|
using System;
using System.IO;
using System.Threading;
using Android.OS;
using Android.App;
using Android.Widget;
using Android.Content;
using Android.Content.PM;
using Sensus.UI;
using Sensus.Context;
using Xamarin;
using Xamarin.Forms;
using Xamarin.Facebook;
using Xamarin.Forms.Platform.Android;
using Plugin.CurrentActivity;
using System.Threading.Tasks;
using Sensus.Exceptions;
using Android.Gms.Common;
using Firebase.Iid;
using Firebase.Messaging;
#if __ANDROID_23__
using Plugin.Permissions;
#endif
[assembly: MetaData("com.facebook.sdk.ApplicationId", Value = "@string/app_id")]
[assembly: UsesPermission(Microsoft.Band.BandClientManager.BindBandService)]
namespace Sensus.Android
{
[Activity(Label = "@string/app_name", MainLauncher = true, LaunchMode = LaunchMode.SingleTask, ConfigurationChanges = ConfigChanges.ScreenSize | ConfigChanges.Orientation)]
[IntentFilter(new string[] { Intent.ActionView }, Categories = new string[] { Intent.CategoryDefault, Intent.CategoryBrowsable }, DataScheme = "http", DataHost = "*", DataPathPattern = ".*\\\\.json")] // protocols downloaded from an http web link
[IntentFilter(new string[] { Intent.ActionView }, Categories = new string[] { Intent.CategoryDefault, Intent.CategoryBrowsable }, DataScheme = "https", DataHost = "*", DataPathPattern = ".*\\\\.json")] // protocols downloaded from an https web link
[IntentFilter(new string[] { Intent.ActionView }, Categories = new string[] { Intent.CategoryDefault }, DataMimeType = "application/json")] // protocols obtained from "file" and "content" schemes: http://developer.android.com/guide/components/intents-filters.html#DataTest
public class AndroidMainActivity : FormsApplicationActivity
{
private AndroidSensusServiceConnection _serviceConnection;
private ManualResetEvent _activityResultWait;
private AndroidActivityResultRequestCode _activityResultRequestCode;
private Tuple<Result, Intent> _activityResult;
private ICallbackManager _facebookCallbackManager;
private App _app;
private ManualResetEvent _serviceBindWait;
private readonly object _locker = new object();
public ICallbackManager FacebookCallbackManager
{
get { return _facebookCallbackManager; }
}
public bool IsPlayServicesAvailable()
{
int resultCode = GoogleApiAvailability.Instance.IsGooglePlayServicesAvailable(this);
if (resultCode != ConnectionResult.Success)
{
if (GoogleApiAvailability.Instance.IsUserResolvableError(resultCode))
{
// note: you can give the user a chance to fix the issue.
Console.WriteLine($"Error: {GoogleApiAvailability.Instance.GetErrorString(resultCode)}");
}
else
{
Console.WriteLine("Error: Play services not supported!");
Finish();
}
return false;
}
else
{
Console.WriteLine("Play Services available.");
return true;
}
}
protected override void OnCreate(Bundle savedInstanceState)
{
Console.Error.WriteLine("--------------------------- Creating activity ---------------------------");
base.OnCreate(savedInstanceState);
_activityResultWait = new ManualResetEvent(false);
_facebookCallbackManager = CallbackManagerFactory.Create();
_serviceBindWait = new ManualResetEvent(false);
Window.AddFlags(global::Android.Views.WindowManagerFlags.DismissKeyguard);
Window.AddFlags(global::Android.Views.WindowManagerFlags.ShowWhenLocked);
Window.AddFlags(global::Android.Views.WindowManagerFlags.TurnScreenOn);
Forms.Init(this, savedInstanceState);
FormsMaps.Init(this, savedInstanceState);
ZXing.Net.Mobile.Forms.Android.Platform.Init();
CrossCurrentActivity.Current.Activity = this;
#if UI_TESTING
Forms.ViewInitialized += (sender, e) =>
{
if (!string.IsNullOrWhiteSpace(e.View.StyleId))
e.NativeView.ContentDescription = e.View.StyleId;
};
#endif
_app = new App();
LoadApplication(_app);
_serviceConnection = new AndroidSensusServiceConnection();
_serviceConnection.ServiceConnected += (o, e) =>
{
// it's happened that the service is created / started after the service helper is disposed: https://insights.xamarin.com/app/Sensus-Production/issues/46
// binding to the service in such a situation can result in a null service helper within the binder. if the service helper was disposed, then the goal is
// to close down sensus. so finish the activity.
if (e.Binder.SensusServiceHelper == null)
{
Finish();
return;
}
// tell the service to finish this activity when it is stopped
e.Binder.ServiceStopAction = Finish;
// signal the activity that the service has been bound
_serviceBindWait.Set();
// if we're UI testing, try to load and run the UI testing protocol from the embedded assets
#if UI_TESTING
using (Stream protocolFile = Assets.Open("UiTestingProtocol.json"))
{
Protocol.RunUiTestingProtocol(protocolFile);
}
#endif
};
// the following is fired if the process hosting the service crashes or is killed.
_serviceConnection.ServiceDisconnected += (o, e) =>
{
Toast.MakeText(this, "The Sensus service has crashed.", ToastLength.Long);
DisconnectFromService();
Finish();
};
OpenIntentAsync(Intent);
// detect connection with Google Play services, finishes if not able to connect.
IsPlayServicesAvailable();
#if DEBUG
// on debugging, a redeploy of the app will delete the old token and effectively force a token refresh
Task.Run(() =>
{
Console.WriteLine("DEBUG: deleting prior token: " + FirebaseInstanceId.Instance.Token);
FirebaseInstanceId.Instance.DeleteInstanceId();
});
#endif
}
protected override void OnStart()
{
Console.Error.WriteLine("--------------------------- Starting activity ---------------------------");
base.OnStart();
CrossCurrentActivity.Current.Activity = this;
}
protected override void OnResume()
{
Console.Error.WriteLine("--------------------------- Resuming activity ---------------------------");
base.OnResume();
CrossCurrentActivity.Current.Activity = this;
// temporarily disable UI while we bind to service
Window.AddFlags(global::Android.Views.WindowManagerFlags.NotTouchable);
// make sure that the service is running and bound any time the activity is resumed. the service is both started
// and bound, as we'd like the service to remain running and available to other apps even if the current activity unbinds.
Intent serviceIntent = AndroidSensusService.StartService(this);
BindService(serviceIntent, _serviceConnection, Bind.AboveClient);
// start new task to wait for connection, since we're currently on the UI thread, which the service connection needs in order to complete.
Task.Run(() =>
{
// we've not seen the binding take more than a second or two; however, we want to be very careful not to block indefinitely
// here becaus the UI is currently disabled. if for some strange reason the binding does not work, bail out after 10 seconds
// and let the user interact with the UI. most likely, a crash will be coming very soon in this case, as the sensus service
// will probably not be running. again, this has not occurred in practice, but allowing the crash to occur will send us information
// through the crash analytics service and we'll be able to track it
_serviceBindWait.WaitOne(TimeSpan.FromSeconds(10000));
SensusServiceHelper.Get().ClearPendingSurveysNotificationAsync();
// now that the service connection has been established, reenable UI.
try
{
SensusContext.Current.MainThreadSynchronizer.ExecuteThreadSafe(() =>
{
Window.ClearFlags(global::Android.Views.WindowManagerFlags.NotTouchable);
});
}
catch (Exception)
{
}
});
}
protected override void OnPause()
{
Console.Error.WriteLine("--------------------------- Pausing activity ---------------------------");
base.OnPause();
// we disconnect from the service within onpause because onresume always blocks the user while rebinding
// to the service. conditions (the bind wait handle and service connection) need to be ready for onresume
// and this is the only place to establish those conditions.
DisconnectFromService();
}
protected override void OnStop()
{
Console.Error.WriteLine("--------------------------- Stopping activity ---------------------------");
base.OnStop();
SensusServiceHelper serviceHelper = SensusServiceHelper.Get();
if (serviceHelper != null)
{
serviceHelper.Save();
serviceHelper.IssuePendingSurveysNotificationAsync(null, true);
}
}
protected override void OnDestroy()
{
Console.Error.WriteLine("--------------------------- Destroying activity ---------------------------");
base.OnDestroy();
// if the activity is destroyed, reset the service connection stop action to be null so that the service doesn't try to
// finish a destroyed activity if/when the service stops.
if (_serviceConnection.Binder != null)
{
_serviceConnection.Binder.ServiceStopAction = null;
}
}
private void DisconnectFromService()
{
_serviceBindWait.Reset();
if (_serviceConnection.Binder != null)
{
try
{
UnbindService(_serviceConnection);
}
catch (Exception ex)
{
SensusServiceHelper.Get().Logger.Log("Failed to disconnection from service: " + ex.Message, LoggingLevel.Normal, GetType());
}
}
}
public override void OnWindowFocusChanged(bool hasFocus)
{
base.OnWindowFocusChanged(hasFocus);
// the service helper is responsible for running actions that depend on the main activity. if the main activity
// is not showing, the service helper starts the main activity and then runs requested actions. there is a race
// condition between actions that wish to show a dialog (e.g., starting speech recognition) and the display of
// the activity. in order to ensure that the activity is showing before any actions are run, we override this
// focus changed event and let the service helper know when the activity is focused and when it is not. this
// way, any actions that the service helper runs will certainly be run after the main activity is running
// and focused.
AndroidSensusServiceHelper serviceHelper = SensusServiceHelper.Get() as AndroidSensusServiceHelper;
if (serviceHelper != null)
{
if (hasFocus)
{
serviceHelper.SetFocusedMainActivity(this);
}
else
{
serviceHelper.SetFocusedMainActivity(null);
}
}
}
[Service]
[IntentFilter(new[] { "com.google.firebase.INSTANCE_ID_EVENT" })]
public class MyFirebaseIIDService : FirebaseInstanceIdService
{
const string TAG = "MyFirebaseIIDService";
public override void OnTokenRefresh()
{
var refreshedToken = FirebaseInstanceId.Instance.Token;
Console.WriteLine("Refreshed token, new val: " + refreshedToken);
SendRegistrationToServer(refreshedToken);
}
void SendRegistrationToServer(string token)
{
// Add custom implementation, as needed.
}
}
[Service]
[IntentFilter(new[] { "com.google.firebase.MESSAGING_EVENT" })]
public class MyFirebaseMessagingService : FirebaseMessagingService
{
public override void OnMessageReceived(RemoteMessage message)
{
try
{
// log for testing
var from = message.From;
var body = message.GetNotification().Body;
Console.WriteLine("From: " + from);
Console.WriteLine("Notification Message Body: " + body);
}
catch (Exception ex)
{
// TODO : better error handling
Console.WriteLine("Error extracting message from notification: " + ex);
}
}
}
#region intent handling
protected override void OnNewIntent(Intent intent)
{
base.OnNewIntent(intent);
OpenIntentAsync(intent);
}
private Task OpenIntentAsync(Intent intent)
{
return Task.Run(() =>
{
// wait for service helper to be initialized, since this method might be called before the service starts up
// and initializes the service helper.
int timeToWaitMS = 60000;
int waitIntervalMS = 1000;
while (SensusServiceHelper.Get() == null && timeToWaitMS > 0)
{
Thread.Sleep(waitIntervalMS);
timeToWaitMS -= waitIntervalMS;
}
if (SensusServiceHelper.Get() == null)
{
// don't use SensusServiceHelper.Get().FlashNotificationAsync because service helper is null
RunOnUiThread(() =>
{
Toast.MakeText(this, "Failed to get service helper. Cannot open Intent.", ToastLength.Long);
});
return;
}
// open page to view protocol if a protocol was passed to us
if (intent.Data != null)
{
global::Android.Net.Uri dataURI = intent.Data;
try
{
if (intent.Scheme == "http" || intent.Scheme == "https")
{
Protocol.DeserializeAsync(new Uri(dataURI.ToString()), Protocol.DisplayAndStartAsync);
}
else if (intent.Scheme == "content" || intent.Scheme == "file")
{
byte[] bytes = null;
try
{
MemoryStream memoryStream = new MemoryStream();
Stream inputStream = ContentResolver.OpenInputStream(dataURI);
inputStream.CopyTo(memoryStream);
inputStream.Close();
bytes = memoryStream.ToArray();
}
catch (Exception ex)
{
SensusServiceHelper.Get().Logger.Log("Failed to read bytes from local file URI \"" + dataURI + "\": " + ex.Message, LoggingLevel.Normal, GetType());
}
if (bytes != null)
{
Protocol.DeserializeAsync(bytes, Protocol.DisplayAndStartAsync);
}
}
else
{
SensusServiceHelper.Get().Logger.Log("Sensus didn't know what to do with URI \"" + dataURI + "\".", LoggingLevel.Normal, GetType());
}
}
catch (Exception ex)
{
SensusContext.Current.MainThreadSynchronizer.ExecuteThreadSafe(() =>
{
new AlertDialog.Builder(this).SetTitle("Failed to get protocol").SetMessage(ex.Message).Show();
});
}
}
});
}
#endregion
#region activity results
public void GetActivityResultAsync(Intent intent, AndroidActivityResultRequestCode requestCode, Action<Tuple<Result, Intent>> callback)
{
Task.Run(() =>
{
lock (_locker)
{
_activityResultRequestCode = requestCode;
_activityResult = null;
_activityResultWait.Reset();
try
{
StartActivityForResult(intent, (int)requestCode);
}
catch (Exception ex)
{
SensusException.Report(ex);
_activityResultWait.Set();
}
_activityResultWait.WaitOne();
callback(_activityResult);
}
});
}
protected override void OnActivityResult(int requestCode, Result resultCode, Intent data)
{
base.OnActivityResult(requestCode, resultCode, data);
if (requestCode == (int)_activityResultRequestCode)
{
_activityResult = new Tuple<Result, Intent>(resultCode, data);
_activityResultWait.Set();
}
_facebookCallbackManager.OnActivityResult(requestCode, (int)resultCode, data);
}
#if __ANDROID_23__
public override void OnRequestPermissionsResult(int requestCode, string[] permissions, Permission[] grantResults)
{
PermissionsImplementation.Current.OnRequestPermissionsResult(requestCode, permissions, grantResults);
ZXing.Net.Mobile.Android.PermissionsHandler.OnRequestPermissionsResult(requestCode, permissions, grantResults);
}
#endif
#endregion
}
}
|
{
"content_hash": "1b740bd7aa85bf3f940ce5653d3aa511",
"timestamp": "",
"source": "github",
"line_count": 465,
"max_line_length": 278,
"avg_line_length": 41.950537634408605,
"alnum_prop": 0.550879171579433,
"repo_name": "jtb8vm/sensus",
"id": "fbad798f25164892063e04582329bb2c05adfc52",
"size": "20136",
"binary": false,
"copies": "1",
"ref": "refs/heads/develop",
"path": "Sensus.Android/AndroidMainActivity.cs",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "C#",
"bytes": "1590103"
},
{
"name": "CSS",
"bytes": "8753"
},
{
"name": "HTML",
"bytes": "98260"
},
{
"name": "JavaScript",
"bytes": "21583"
},
{
"name": "PHP",
"bytes": "9424778"
},
{
"name": "R",
"bytes": "27436"
},
{
"name": "Shell",
"bytes": "15478"
}
],
"symlink_target": ""
}
|
<?xml version='1.0' encoding='UTF-8'?>
<!--
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.
-->
<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>org.apache.maven.plugins</groupId>
<artifactId>maven-plugins</artifactId>
<version>24</version>
<relativePath>../maven-plugins/pom.xml</relativePath>
</parent>
<artifactId>maven-remote-resources-plugin</artifactId>
<version>1.6-SNAPSHOT</version>
<packaging>maven-plugin</packaging>
<name>Apache Maven Remote Resources Plugin</name>
<description>
Process resources packaged in JARs that have been deployed to
a remote repository. The primary use case being satisfied is the consistent
inclusion of common resources in a large set of projects. Maven projects at
Apache use this plug-in to satisfy licensing requirements at Apache where
each project must include license and notice files for each release.
</description>
<prerequisites>
<maven>2.2.1</maven>
</prerequisites>
<scm>
<connection>scm:svn:http://svn.apache.org/repos/asf/maven/plugins/trunk/maven-remote-resources-plugin/</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/maven/plugins/trunk/maven-remote-resources-plugin/</developerConnection>
<url>http://svn.apache.org/viewvc/maven/plugins/trunk/maven-remote-resources-plugin/</url>
</scm>
<issueManagement>
<system>JIRA</system>
<url>http://jira.codehaus.org/browse/MRRESOURCES</url>
</issueManagement>
<distributionManagement>
<site>
<id>apache.website</id>
<url>scm:svn:https://svn.apache.org/repos/infra/websites/production/maven/content/${maven.site.path}</url>
</site>
</distributionManagement>
<properties>
<mavenVersion>2.2.1</mavenVersion>
<mavenFilteringVersion>1.2-SNAPSHOT</mavenFilteringVersion> <!-- Due to JDK8, see MSHARED-319 -->
<sitePluginVersion>3.3</sitePluginVersion>
<maven.site.path>plugins-archives/${project.artifactId}-LATEST</maven.site.path>
</properties>
<dependencies>
<!-- maven core -->
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-artifact</artifactId>
<version>${mavenVersion}</version>
</dependency>
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-core</artifactId>
<version>${mavenVersion}</version>
</dependency>
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-model</artifactId>
<version>${mavenVersion}</version>
</dependency>
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-monitor</artifactId>
<version>${mavenVersion}</version>
</dependency>
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-plugin-api</artifactId>
<version>${mavenVersion}</version>
</dependency>
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-project</artifactId>
<version>${mavenVersion}</version>
</dependency>
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-settings</artifactId>
<version>${mavenVersion}</version>
</dependency>
<dependency>
<groupId>org.apache.maven.plugin-tools</groupId>
<artifactId>maven-plugin-annotations</artifactId>
<scope>provided</scope>
</dependency>
<!-- maven shared -->
<dependency>
<groupId>org.apache.maven.shared</groupId>
<artifactId>maven-artifact-resolver</artifactId>
<version>1.0</version>
</dependency>
<dependency>
<groupId>org.apache.maven.shared</groupId>
<artifactId>maven-common-artifact-filters</artifactId>
<version>1.4</version>
</dependency>
<dependency>
<groupId>org.apache.maven.shared</groupId>
<artifactId>maven-filtering</artifactId>
<version>${mavenFilteringVersion}</version>
</dependency>
<!-- plexus -->
<dependency>
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-resources</artifactId>
<version>1.0-alpha-7</version>
</dependency>
<dependency>
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-interpolation</artifactId>
<version>1.19</version>
</dependency>
<dependency>
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-utils</artifactId>
<version>3.0.15</version>
</dependency>
<!-- other -->
<dependency>
<groupId>org.apache.velocity</groupId>
<artifactId>velocity</artifactId>
<version>1.7</version>
</dependency>
<!-- test -->
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>3.8.1</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-container-default</artifactId>
<version>1.0-alpha-9-stable-1</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.maven.shared</groupId>
<artifactId>maven-plugin-testing-harness</artifactId>
<version>1.1</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.maven.wagon</groupId>
<artifactId>wagon-provider-api</artifactId>
<version>2.2</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.maven.shared</groupId>
<artifactId>maven-verifier</artifactId>
<version>1.5</version>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<testResources>
<testResource>
<directory>src/test/resources</directory>
</testResource>
</testResources>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-plugin-plugin</artifactId>
<configuration>
<skipErrorNoDescriptorsFound>true</skipErrorNoDescriptorsFound>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-site-plugin</artifactId>
<version>${sitePluginVersion}</version>
</plugin>
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<includes>
<include>**/*Test.java</include>
</includes>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.rat</groupId>
<artifactId>apache-rat-plugin</artifactId>
<version>0.9</version>
<configuration>
<excludes>
<!--
These files cannot contain a license header as that would break
the tests.
-->
<exclude>src/test/resources/ISO-8859-1.bin.vm</exclude>
<exclude>src/test/resources/UTF-8.bin.vm</exclude>
</excludes>
</configuration>
</plugin>
</plugins>
</pluginManagement>
<plugins>
<plugin>
<groupId>org.codehaus.modello</groupId>
<artifactId>modello-maven-plugin</artifactId>
<executions>
<execution>
<id>generate-xsd-site-remote-resources</id>
<phase>pre-site</phase>
<goals>
<goal>xsd</goal>
</goals>
<configuration>
<version>1.1.0</version>
<outputDirectory>${project.reporting.outputDirectory}/xsd</outputDirectory>
<models>
<model>src/main/mdo/remote-resources.mdo</model>
</models>
</configuration>
</execution>
<execution>
<id>generate-xsd-site-supplemental-model</id>
<phase>pre-site</phase>
<goals>
<goal>xsd</goal>
</goals>
<configuration>
<version>1.0.0</version>
<outputDirectory>${project.reporting.outputDirectory}/xsd</outputDirectory>
<models>
<model>src/main/mdo/supplemental-model.mdo</model>
</models>
</configuration>
</execution>
<execution>
<id>site-docs-remote-resources</id>
<phase>pre-site</phase>
<goals>
<goal>xdoc</goal>
</goals>
<configuration>
<version>1.1.0</version>
<models>
<model>src/main/mdo/remote-resources.mdo</model>
</models>
</configuration>
</execution>
<execution>
<id>site-docs-supplemental-models</id>
<phase>pre-site</phase>
<goals>
<goal>xdoc</goal>
</goals>
<configuration>
<version>1.0.0</version>
<models>
<model>src/main/mdo/supplemental-model.mdo</model>
</models>
</configuration>
</execution>
<execution>
<id>remote-resources</id>
<goals>
<goal>xpp3-writer</goal>
<goal>java</goal>
<goal>xpp3-reader</goal>
</goals>
<configuration>
<version>1.1.0</version>
<useJava5>true</useJava5>
<models>
<model>src/main/mdo/remote-resources.mdo</model>
</models>
</configuration>
</execution>
<execution>
<id>supplemental-models</id>
<goals>
<goal>xpp3-writer</goal>
<goal>java</goal>
<goal>xpp3-reader</goal>
</goals>
<configuration>
<version>1.0.0</version>
<useJava5>true</useJava5>
<models>
<model>src/main/mdo/supplemental-model.mdo</model>
</models>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-plugin-plugin</artifactId>
<executions>
<execution>
<id>generate-descriptor</id>
<goals>
<goal>descriptor</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
<reporting>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-plugin-plugin</artifactId>
<version>${mavenPluginVersion}</version>
</plugin>
</plugins>
</reporting>
<profiles>
<profile>
<id>run-its</id>
<properties>
<remoteRepository>${project.build.directory}/remote-repo</remoteRepository>
</properties>
<build>
<testResources>
<testResource>
<directory>src/it/resources</directory>
<filtering>true</filtering>
<excludes>
<exclude>custom-filter-delim/src/main/resources/**</exclude>
</excludes>
</testResource>
<testResource>
<directory>src/it/resources</directory>
<filtering>false</filtering>
<includes>
<include>custom-filter-delim/src/main/resources/**</include>
</includes>
</testResource>
</testResources>
<plugins>
<plugin>
<artifactId>maven-failsafe-plugin</artifactId>
<version>2.12</version>
<executions>
<execution>
<id>integration-tests</id>
<goals>
<goal>integration-test</goal>
<goal>verify</goal>
</goals>
<configuration>
<systemPropertyVariables>
<!-- Pass this through to the tests (if set!) to have them pick the right repository -->
<maven.repo.local>${project.build.directory}/it-repo</maven.repo.local>
</systemPropertyVariables>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-invoker-plugin</artifactId>
<executions>
<execution>
<id>install-descriptor</id>
<phase>pre-integration-test</phase>
<goals>
<goal>install</goal>
</goals>
<configuration>
<localRepositoryPath>${project.build.directory}/it-repo</localRepositoryPath>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>
</project>
|
{
"content_hash": "8b6633edec18a88c50a305a2a890c594",
"timestamp": "",
"source": "github",
"line_count": 415,
"max_line_length": 204,
"avg_line_length": 33.033734939759036,
"alnum_prop": 0.5853818659274929,
"repo_name": "khmarbaise/maven-plugins",
"id": "3eb9de5e19106bc8ed9597b6affcc5db39f31aab",
"size": "13709",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "maven-remote-resources-plugin/pom.xml",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "46161"
},
{
"name": "Groovy",
"bytes": "123305"
},
{
"name": "Java",
"bytes": "8362357"
},
{
"name": "JavaScript",
"bytes": "1695"
},
{
"name": "Shell",
"bytes": "618"
}
],
"symlink_target": ""
}
|
package api
import "net/http"
type Route struct {
Name string
Method string
Pattern string
HandlerFunc http.HandlerFunc
}
type Routes []Route
var routes = Routes{
Route{
"AttackList",
http.MethodGet,
"/attacks",
AttackList,
},
Route{
"AttackShow",
http.MethodGet,
"/attacks/{attackid}",
AttackShow,
},
Route{
"AttackCreate",
http.MethodPost,
"/attack",
AttackCreate,
},
Route{
"AttackStop",
http.MethodDelete,
"/stop",
AttackStop,
},
}
|
{
"content_hash": "8e8137663995f1d9e464418f3274042c",
"timestamp": "",
"source": "github",
"line_count": 39,
"max_line_length": 29,
"avg_line_length": 12.820512820512821,
"alnum_prop": 0.642,
"repo_name": "nehayward/DOS",
"id": "38d9cbb217fdb650391bed7372f866067551d0c0",
"size": "500",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "api/router.go",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Go",
"bytes": "10203"
},
{
"name": "Shell",
"bytes": "49"
}
],
"symlink_target": ""
}
|
Country.create(id: 1, name: "Brasil")
State.create(id: 1, name: "Paraná", initial: "PR", country_id: 1)
State.create(id: 2, name: "Rio de Janeiro", initial: "RJ", country_id: 1)
State.create(id: 3, name: "São Paulo", initial: "SP", country_id: 1)
City.create(id: 1, name: "Mandaguari", state_id: 1)
City.create(id: 2, name: "Rio de Janeiro", state_id: 2)
City.create(id: 3, name: "Campinas", state_id: 3)
City.create(id: 4, name: "Sumaré", state_id: 3)
HealthPlan.create(id: 1, name: "Uniodonto")
HealthPlan.create(id: 2, name: "Amil Dental")
HealthPlan.create(id: 3, name: "Bradesco")
Measurement.create(id: 1, name: "unidade")
Measurement.create(id: 2, name: "miligrama")
Measurement.create(id: 3, name: "grama")
Measurement.create(id: 4, name: "quilo")
|
{
"content_hash": "34d4b89424e8e7b48842aeb2856219f5",
"timestamp": "",
"source": "github",
"line_count": 15,
"max_line_length": 73,
"avg_line_length": 50.333333333333336,
"alnum_prop": 0.6847682119205298,
"repo_name": "maxjuniorbr/mobOdonto",
"id": "e9933fc721a6252295ff6d937ec3905ca07c72d5",
"size": "1102",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "db/seeds.rb",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "3422"
},
{
"name": "CoffeeScript",
"bytes": "2343"
},
{
"name": "HTML",
"bytes": "37741"
},
{
"name": "JavaScript",
"bytes": "943"
},
{
"name": "Ruby",
"bytes": "52880"
}
],
"symlink_target": ""
}
|
declare let global:any;
export const MouseEvent = (global as any).MouseEvent as MouseEvent;
export const KeyboardEvent = (global as any).KeyboardEvent as KeyboardEvent;
|
{
"content_hash": "61ea81c1d2c1e7c9552716c2566fb8e2",
"timestamp": "",
"source": "github",
"line_count": 4,
"max_line_length": 76,
"avg_line_length": 42.5,
"alnum_prop": 0.8,
"repo_name": "stupiduglyfool/ngx-datatable",
"id": "626a296082015a3951d6c6c0032f07c24724557a",
"size": "170",
"binary": false,
"copies": "4",
"ref": "refs/heads/master",
"path": "src/events.ts",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "19325"
},
{
"name": "HTML",
"bytes": "8595"
},
{
"name": "JavaScript",
"bytes": "15684"
},
{
"name": "TypeScript",
"bytes": "181066"
}
],
"symlink_target": ""
}
|
Windows serial port control of a DirecTV receiver using Python.
I wrote this when I was using [SageTV][4] for my home media center/server.
Haven't used it since [Google bought SageTV][3] and shut everything down.
## Thanks
Jim Storch for [pydtvcmd][1], the inspiration for this program.
[Kevin Timmerman][2] and Any Ellsworth for device control documentation.
[1]: https://code.google.com/p/pydtvcmd/
[2]: http://dtvcontrol.com/
[3]: http://www.sagetv.com/
[4]: http://en.wikipedia.org/wiki/SageTV
|
{
"content_hash": "66e35a293d5a39a26e6bb55766f31be5",
"timestamp": "",
"source": "github",
"line_count": 14,
"max_line_length": 74,
"avg_line_length": 35.857142857142854,
"alnum_prop": 0.7410358565737052,
"repo_name": "h0tw1r3/sandbox",
"id": "2d15d91bf4f30cdf90246d889dd1524943603b2c",
"size": "532",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "python/dtvcontrol/README.md",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "ApacheConf",
"bytes": "1083"
},
{
"name": "CSS",
"bytes": "7710"
},
{
"name": "HTML",
"bytes": "7968"
},
{
"name": "PHP",
"bytes": "118187"
},
{
"name": "PLpgSQL",
"bytes": "237"
},
{
"name": "Python",
"bytes": "6936"
},
{
"name": "XSLT",
"bytes": "7195"
}
],
"symlink_target": ""
}
|
import { createMuiTheme, ThemeOptions } from '@material-ui/core'
export const paletteColorsDark = {
primary: '#0f4c75',
secondary: '#3282b8',
error: '#E44C65',
background: '#1b262c',
text: '#bbe1fa',
}
export const paletteColorsLight = {
primary: '#6886c5',
secondary: '#ffe0ac',
error: '#E44C65',
background: '#f9f9f9',
text: '#050505',
}
const options = (dark: boolean): ThemeOptions => {
const paletteColors = dark ? paletteColorsDark : paletteColorsLight
return {
palette: {
type: dark ? 'dark' : 'light',
primary: {
main: paletteColors.primary,
},
// ...
}
}
}
export const darkTheme = createMuiTheme(options(true))
export const lightTheme = createMuiTheme(options(false))
|
{
"content_hash": "2703ae0087910835cfd7a4d00eb63016",
"timestamp": "",
"source": "github",
"line_count": 32,
"max_line_length": 69,
"avg_line_length": 23.28125,
"alnum_prop": 0.6469798657718121,
"repo_name": "lemtzas/rollem-discord",
"id": "28d8275bf42b5b67362da25088841357cef2c4f6",
"size": "745",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "packages/ui/theme/theme.ts",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Dockerfile",
"bytes": "200"
},
{
"name": "JavaScript",
"bytes": "4775"
},
{
"name": "Shell",
"bytes": "4841"
},
{
"name": "TypeScript",
"bytes": "32547"
}
],
"symlink_target": ""
}
|
//
// RCDCommonString.h
// SealTalk
//
// Created by Sin on 2019/6/3.
// Copyright © 2019 RongCloud. All rights reserved.
//
#ifndef RCDCommonString_h
#define RCDCommonString_h
#define RCDIMTokenKey @"userToken"
#define RCDAppKeyKey @"appKey"
#define RCDUserIdKey @"userId"
#define RCDPhoneKey @"phoneNumber"
#define RCDUserNickNameKey @"userNickName"
#define RCDUserPortraitUriKey @"userPortraitUri"
#define RCDSquareInfoListKey @"SquareInfoList"
#define RCDQiNiuDomainKey @"QiNiuDomain"
#define RCDApplistURLKey @"applistURL"
#define RCDNeedUpdateKey @"isNeedUpdate"
#define RCDDisplayIDKey @"isDisplayID"
#define RCDCurrentCountryKey @"currentCountry"
#define RCDStayAfterJoinChatRoomFailedKey @"stayAfterJoinChatRoomFailed"
#define RCDDebugDataStatisticsKey @"RCDDebugDataStatistics"
#define RCDDebugBurnMessageKey @"RCDDebugBurnMessage"
#define RCDDebugSendCombineMessageKey @"RCDDebugSendCombineMessage"
#define RCDUserCookiesKey @"UserCookies"
#define RCDDisplayOnlineStatusKey @"isDisplayOnlineStatus"
#define RCDCookieKey @"Cookie"
#define RCDGroupInfoUpdateKey @"UpdateGroupInfo"
#define RCDGroupMemberUpdateKey @"UpdateGroupMember"
#define RCDGroupNoticeUpdateKey @"UpdateGroupNotice"
#define RCDSealTalkNumberKey @"RCDSealTalkNumber"
#define RCDUserGenderKey @"RCDUserGender"
#define RCDUserPrivacyMobileSearchKey @"RCDUserPrivacyMobileSearchKey"
#define RCDUserPrivacySTAccountSearchKey @"RCDUserPrivacySTAccountSearchKey"
#define RCDUserPrivacyFriendVerifyKey @"RCDUserPrivacyFriendVerifyKey"
#define RCDUserPrivacyGroupVerifyKey @"RCDUserPrivacyFriendVerifyKey"
#define RCDContactsAuthStateChangeKey @"RCDContactsAuthStateChangeKey"
#define RCDContactsRequestKey @"RCDContactsRequestKey"
#define RCDContactsUpdateUIKey @"RCDContactsUpdateUIKey"
#define RCDChatBackgroundKey @"RCDChatBackgroundKey"
#define RCDChatBackgroundFromAlbum @"RCDChatBackgroundFromAlbum"
#define RCDChatBackgroundImageDataKey @"RCDChatBackgroundImageDataKey"
#define RCDChatroomDefalutHistoryMessageCountKey @"ChatroomDefaultHistoryMessageCount"
#define RCDGroupClearMessageKey @"RCDGroupClearMessageKey"
#define RCDCurrentPushLauguageCodeKey @"RCDCurrentPushLauguageCodeKey"
#endif /* RCDCommonString_h */
|
{
"content_hash": "7eb67a2f5934b30de89d10f3d48111fc",
"timestamp": "",
"source": "github",
"line_count": 49,
"max_line_length": 86,
"avg_line_length": 44.95918367346939,
"alnum_prop": 0.8524738992283251,
"repo_name": "sealtalk/sealtalk-ios",
"id": "a5769789a886cb11c3d9da280961b9e3f0d672d5",
"size": "2204",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "ios-sealtalk/RCloudMessage/Supporting Files/RCDCommonString.h",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C",
"bytes": "21965"
},
{
"name": "Objective-C",
"bytes": "2289773"
},
{
"name": "Ruby",
"bytes": "684"
},
{
"name": "Shell",
"bytes": "20216"
}
],
"symlink_target": ""
}
|
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" lang="en">
<head>
<meta charset="utf-8" /><link rel="canonical" href="http://mongoc.org/libbson/current/mongoc_apm_command_started_get_request_id.html"/>
<title>mongoc_apm_command_started_get_request_id() — libmongoc 1.21.2</title>
<link rel="stylesheet" href="_static/readable.css" type="text/css" />
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
<link rel="stylesheet" href="_static/readable.css" type="text/css" />
<script type="text/javascript" id="documentation_options" data-url_root="./" src="_static/documentation_options.js"></script>
<script type="text/javascript" src="_static/documentation_options.js"></script>
<script type="text/javascript" src="_static/jquery.js"></script>
<script type="text/javascript" src="_static/underscore.js"></script>
<script type="text/javascript" src="_static/doctools.js"></script>
<link rel="search" title="Search" href="search.html" />
<link rel="next" title="mongoc_apm_command_started_get_server_id()" href="mongoc_apm_command_started_get_server_id.html" />
<link rel="prev" title="mongoc_apm_command_started_get_operation_id()" href="mongoc_apm_command_started_get_operation_id.html" />
<meta name="viewport" content="width=device-width, initial-scale=0.9, maximum-scale=0.9">
</head><body>
<div class="related" role="navigation" aria-label="related navigation">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
<a href="mongoc_apm_command_started_get_server_id.html" title="mongoc_apm_command_started_get_server_id()"
accesskey="N">next</a></li>
<li class="right" >
<a href="mongoc_apm_command_started_get_operation_id.html" title="mongoc_apm_command_started_get_operation_id()"
accesskey="P">previous</a> |</li>
<li class="nav-item nav-item-0"><a href="index.html">libmongoc 1.21.2</a> »</li>
<li class="nav-item nav-item-1"><a href="application-performance-monitoring.html" >Application Performance Monitoring (APM)</a> »</li>
<li class="nav-item nav-item-2"><a href="mongoc_apm_command_started_t.html" accesskey="U">mongoc_apm_command_started_t</a> »</li>
</ul>
</div>
<div class="document">
<div class="documentwrapper">
<div class="bodywrapper">
<div class="body" role="main">
<div class="section" id="mongoc-apm-command-started-get-request-id">
<h1>mongoc_apm_command_started_get_request_id()<a class="headerlink" href="#mongoc-apm-command-started-get-request-id" title="Permalink to this headline">¶</a></h1>
<div class="section" id="synopsis">
<h2>Synopsis<a class="headerlink" href="#synopsis" title="Permalink to this headline">¶</a></h2>
<div class="highlight-c notranslate"><div class="highlight"><pre><span></span><span class="kt">int64_t</span>
<span class="nf">mongoc_apm_command_started_get_request_id</span> <span class="p">(</span>
<span class="k">const</span> <span class="n">mongoc_apm_command_started_t</span> <span class="o">*</span><span class="n">event</span><span class="p">);</span>
</pre></div>
</div>
<p>Returns this event’s wire-protocol request id. Use this number to correlate client-side events with server log messages.</p>
</div>
<div class="section" id="parameters">
<h2>Parameters<a class="headerlink" href="#parameters" title="Permalink to this headline">¶</a></h2>
<ul class="simple">
<li><p><code class="docutils literal notranslate"><span class="pre">event</span></code>: A <a class="symbol reference internal" href="mongoc_apm_command_started_t.html"><span class="doc">mongoc_apm_command_started_t</span></a>.</p></li>
</ul>
</div>
<div class="section" id="returns">
<h2>Returns<a class="headerlink" href="#returns" title="Permalink to this headline">¶</a></h2>
<p>The event’s request id.</p>
<div class="admonition seealso">
<p class="admonition-title">See also</p>
<div class="line-block">
<div class="line"><a class="reference internal" href="application-performance-monitoring.html"><span class="doc">Introduction to Application Performance Monitoring</span></a></div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="sphinxsidebar" role="navigation" aria-label="main navigation">
<div class="sphinxsidebarwrapper">
<h3><a href="index.html">Table Of Contents</a></h3>
<ul>
<li class="toctree-l1"><a class="reference internal" href="installing.html">Installing the MongoDB C Driver (libmongoc) and BSON library (libbson)</a></li>
</ul>
<ul>
<li class="toctree-l1"><a class="reference internal" href="tutorial.html">Tutorial</a></li>
</ul>
<ul>
<li class="toctree-l1"><a class="reference internal" href="authentication.html">Authentication</a></li>
</ul>
<ul>
<li class="toctree-l1"><a class="reference internal" href="basic-troubleshooting.html">Basic Troubleshooting</a></li>
</ul>
<ul>
<li class="toctree-l1"><a class="reference internal" href="guides.html">Guides</a></li>
</ul>
<ul>
<li class="toctree-l1"><a class="reference internal" href="api.html">API Reference</a></li>
</ul>
<ul class="current">
<li class="toctree-l1 current"><a class="reference internal" href="application-performance-monitoring.html">Application Performance Monitoring (APM)</a><ul class="current">
<li class="toctree-l2"><a class="reference internal" href="mongoc_apm_callbacks_t.html">mongoc_apm_callbacks_t</a></li>
<li class="toctree-l2"><a class="reference internal" href="mongoc_apm_command_failed_t.html">mongoc_apm_command_failed_t</a></li>
<li class="toctree-l2 current"><a class="reference internal" href="mongoc_apm_command_started_t.html">mongoc_apm_command_started_t</a></li>
<li class="toctree-l2"><a class="reference internal" href="mongoc_apm_command_succeeded_t.html">mongoc_apm_command_succeeded_t</a></li>
<li class="toctree-l2"><a class="reference internal" href="mongoc_apm_server_changed_t.html">mongoc_apm_server_changed_t</a></li>
<li class="toctree-l2"><a class="reference internal" href="mongoc_apm_server_closed_t.html">mongoc_apm_server_closed_t</a></li>
<li class="toctree-l2"><a class="reference internal" href="mongoc_apm_server_heartbeat_failed_t.html">mongoc_apm_server_heartbeat_failed_t</a></li>
<li class="toctree-l2"><a class="reference internal" href="mongoc_apm_server_heartbeat_started_t.html">mongoc_apm_server_heartbeat_started_t</a></li>
<li class="toctree-l2"><a class="reference internal" href="mongoc_apm_server_heartbeat_succeeded_t.html">mongoc_apm_server_heartbeat_succeeded_t</a></li>
<li class="toctree-l2"><a class="reference internal" href="mongoc_apm_server_opening_t.html">mongoc_apm_server_opening_t</a></li>
<li class="toctree-l2"><a class="reference internal" href="mongoc_apm_topology_changed_t.html">mongoc_apm_topology_changed_t</a></li>
<li class="toctree-l2"><a class="reference internal" href="mongoc_apm_topology_closed_t.html">mongoc_apm_topology_closed_t</a></li>
<li class="toctree-l2"><a class="reference internal" href="mongoc_apm_topology_opening_t.html">mongoc_apm_topology_opening_t</a></li>
</ul>
</li>
</ul>
<!-- Because full_index.rst includes everything that index.rst includes, we have to exclude index.rst from the table-of-contents. This page is simply a link forced into the sidebar (in conf.py) to avoid including full_index.rst in the ToC. -->
<ul><li class='toctree-l1'><a href="full_index.html">Index</a></li></ul>
<div id="searchbox" style="display: none" role="search">
<h3>Quick search</h3>
<div class="searchformwrapper">
<form class="search" action="search.html" method="get">
<input type="text" name="q" />
<input type="submit" value="Go" />
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
</div>
</div>
<script type="text/javascript">$('#searchbox').show(0);</script>
</div>
</div>
<div class="clearer"></div>
</div>
<div class="footer">
© Copyright 2017-present, MongoDB, Inc.
Created using <a href="http://sphinx-doc.org/">Sphinx</a> 4.1.2.
</div>
</body>
</html>
|
{
"content_hash": "76e0f3968c885571b9f47543a4bb5498",
"timestamp": "",
"source": "github",
"line_count": 142,
"max_line_length": 243,
"avg_line_length": 58.2887323943662,
"alnum_prop": 0.686480608916274,
"repo_name": "treefrogframework/treefrog-framework",
"id": "00b358a18daf13229531086f0db71980aa99707b",
"size": "8286",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "3rdparty/mongo-c-driver-1.21.2/src/libmongoc/doc/html/mongoc_apm_command_started_get_request_id.html",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "Batchfile",
"bytes": "19207"
},
{
"name": "C",
"bytes": "14971"
},
{
"name": "C++",
"bytes": "1717761"
},
{
"name": "CMake",
"bytes": "14155"
},
{
"name": "HTML",
"bytes": "9485"
},
{
"name": "JavaScript",
"bytes": "1140610"
},
{
"name": "QMake",
"bytes": "36422"
},
{
"name": "Shell",
"bytes": "4387"
}
],
"symlink_target": ""
}
|
@implementation HBHShipNode {
SKAction *deathAction;
}
- (instancetype) init {
if (self = [super initWithImageNamed:@"heisenberg"]) {
// self.color = [UIColor colorWithRed:220.0f/255.0f green:122.0f/255.0f blue:0.0f/255.0f alpha:1.0f];
// self.colorBlendFactor = 1.0f;
self.texture.filteringMode = SKTextureFilteringNearest;
self.size = CGSizeApplyAffineTransform(self.size, CGAffineTransformMakeScale(3.0, 3.0));
self.physicsBody = [SKPhysicsBody bodyWithRectangleOfSize:self.size];
self.zPosition = topZPosition;
self.physicsBody.restitution = 0.0f;
self.physicsBody.allowsRotation = NO;
self.physicsBody.categoryBitMask = PlayerShipBitMask;
self.physicsBody.collisionBitMask = SceneBitMask;
self.physicsBody.contactTestBitMask = CopShipBitMask | PowerUpBitMask;
self.name = @"PlayerShip";
[self createDeathAction];
}
return self;
}
- (void) createDeathAction {
NSTimeInterval actionDuration = 0.25f;
SKAction *colorizeAction = [SKAction colorizeWithColor:[SKColor orangeColor] colorBlendFactor:1.0f duration:actionDuration];
SKAction *scaleAction = [SKAction scaleBy:3.0f duration:actionDuration];
SKAction *fadeAction = [SKAction fadeAlphaTo:0.0f duration:actionDuration];
SKAction *waitToRemoveAction = [SKAction sequence:@[[SKAction waitForDuration:actionDuration], [SKAction removeFromParent]]];
deathAction = [SKAction group:@[colorizeAction, scaleAction, fadeAction, waitToRemoveAction]];
}
- (void) die {
self.dead = YES;
[self removeAllActions];
self.anchorPoint = CGPointMake(0.5, 0.5);
[self runAction:deathAction];
}
@end
|
{
"content_hash": "7ed7e2180584ba4541b5174b4073096f",
"timestamp": "",
"source": "github",
"line_count": 41,
"max_line_length": 129,
"avg_line_length": 41.4390243902439,
"alnum_prop": 0.7151265450264862,
"repo_name": "harlanhaskins/SpaceJam",
"id": "7f7f332c32b3c80ef11b6173d3fb55baaa296de7",
"size": "1863",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "GameJam2013/HBHShipNode.m",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Objective-C",
"bytes": "40178"
}
],
"symlink_target": ""
}
|
package fm.last.citrine.service;
import java.text.ParseException;
import java.util.ArrayList;
import java.util.List;
import java.util.Set;
import org.quartz.SchedulerException;
import org.springframework.beans.BeansException;
import org.springframework.beans.factory.BeanFactory;
import org.springframework.beans.factory.BeanFactoryAware;
import fm.last.citrine.dao.TaskDAO;
import fm.last.citrine.dao.TaskRunDAO;
import fm.last.citrine.model.Task;
import fm.last.citrine.scheduler.SchedulerManager;
/**
* TaskManager implementation.
*/
public class TaskManagerImpl implements TaskManager, BeanFactoryAware {
private static final long serialVersionUID = 7865534545748992464L;
private final SchedulerManager schedulerManager;
private final TaskDAO taskDAO;
private TaskRunDAO taskRunDAO;
public TaskManagerImpl(TaskDAO taskDAO, SchedulerManager schedulerManager) throws SchedulerException, ParseException {
this.schedulerManager = schedulerManager;
this.taskDAO = taskDAO;
}
@Override
public void scheduleTasks() {
List<Task> tasks = getTasks();
for (Task task : tasks) {
if (task.isEnabled()) {
schedulerManager.scheduleTask(task, false);
}
}
}
/**
* Retrieves a Task by its primary key.
*
* @param id Task id.
* @return Task identified by the passed id.
*/
@Override
public Task get(long id) {
return taskDAO.get(id);
}
/**
* Creates a or updates a Task object in storage.
*
* @param task Task to save.
*/
@Override
public long save(Task task) {
taskDAO.save(task);
schedulerManager.scheduleTask(task, true);
return task.getId();
}
/**
* Retrieves all Tasks in storage.
*
* @return List of all Tasks in storage.
*/
@Override
public List<Task> getTasks() {
return taskDAO.getTasks();
}
@Override
public List<Task> findByGroup(String group) {
return taskDAO.findByGroup(group);
}
@Override
public List<Task> findTasksInSameGroup(Task task) {
// would be more efficient to add this method to DAO and do an exclude the passed task in select statement
List<Task> tasks = taskDAO.findByGroup(task.getGroupName());
tasks.remove(task);
return tasks;
}
@Override
public Set<Task> findCandidateChildren(Task task) {
return taskDAO.findCandidateChildren(task);
}
@Override
public List<Task> getCurrentlyRunningTasks() {
List<Long> taskIds = schedulerManager.getCurrentlyRunningTaskIds();
List<Task> runningTasks = new ArrayList<Task>(taskIds.size());
for (Long taskId : taskIds) {
runningTasks.add(get(taskId));
}
return runningTasks;
}
@Override
public Set<String> getGroupNames() {
return taskDAO.getGroupNames();
}
/**
* Deletes a Task.
*
* @param task Task to delete;
*/
@Override
public void delete(Task task) {
schedulerManager.unscheduleTask(task);
taskRunDAO.deleteByTaskId(task.getId()); // manually manage this association
taskDAO.delete(task);
}
public TaskRunDAO getTaskRunDAO() {
return taskRunDAO;
}
public void setTaskRunDAO(TaskRunDAO taskRunDAO) {
this.taskRunDAO = taskRunDAO;
}
@Override
public void setBeanFactory(BeanFactory beanFactory) throws BeansException {
// for some bizarre reason setBeanFactory gets called on this class *before* it gets called on
// schedulerManager, and we need it set on schedulerManager during init-method, set set it now
schedulerManager.setBeanFactory(beanFactory);
}
}
|
{
"content_hash": "382ae4248451063d7bc42bf596706a3b",
"timestamp": "",
"source": "github",
"line_count": 137,
"max_line_length": 120,
"avg_line_length": 25.78832116788321,
"alnum_prop": 0.7127087461081234,
"repo_name": "choss/citrine-scheduler",
"id": "b813241a111022991bc0d694104a35a0be362d6f",
"size": "4132",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/main/java/fm/last/citrine/service/TaskManagerImpl.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "1363"
},
{
"name": "HTML",
"bytes": "690"
},
{
"name": "Java",
"bytes": "373293"
},
{
"name": "JavaScript",
"bytes": "16620"
},
{
"name": "XSLT",
"bytes": "5489"
}
],
"symlink_target": ""
}
|
inline static double c_ceil(double x)
{
return ceil(x);
}
|
{
"content_hash": "40ceb36f8ad4ab47e0feebeafa5351a6",
"timestamp": "",
"source": "github",
"line_count": 4,
"max_line_length": 37,
"avg_line_length": 15.5,
"alnum_prop": 0.6612903225806451,
"repo_name": "cyamauch/sli",
"id": "7ae1e7782513a36489108f8c50f3c1aa373e81dc",
"size": "80",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "sllib/src/private/c_ceil.cc",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C",
"bytes": "72851"
},
{
"name": "C++",
"bytes": "7419811"
},
{
"name": "M4",
"bytes": "4032"
},
{
"name": "Makefile",
"bytes": "106080"
},
{
"name": "Shell",
"bytes": "502020"
},
{
"name": "Smarty",
"bytes": "5077"
}
],
"symlink_target": ""
}
|
/* Brya board configuration */
#ifndef __CROS_EC_BOARD_H
#define __CROS_EC_BOARD_H
#include "compile_time_macros.h"
/* Baseboard features */
#include "baseboard.h"
/*
* This will happen automatically on NPCX9 ES2 and later. Do not remove
* until we can confirm all earlier chips are out of service.
*/
#define CONFIG_HIBERNATE_PSL_VCC1_RST_WAKEUP
#define CONFIG_MP2964
/* Sensors */
/* BMA253 accelerometer in lid */
#define CONFIG_ACCEL_BMA255
#define CONFIG_ACCELGYRO_BMI160 /* Base accel/gyro */
#define CONFIG_ACCELGYRO_BMI160_INT_EVENT \
TASK_EVENT_MOTION_SENSOR_INTERRUPT(BASE_ACCEL)
/* BMA422 accelerometer in lid */
#define CONFIG_ACCEL_BMA4XX
#define CONFIG_ACCELGYRO_LSM6DSM /* Base accel/gyro */
#define CONFIG_ACCEL_LSM6DSM_INT_EVENT \
TASK_EVENT_MOTION_SENSOR_INTERRUPT(BASE_ACCEL)
/* Sensors without hardware FIFO are in forced mode */
#define CONFIG_ACCEL_FORCE_MODE_MASK BIT(LID_ACCEL)
/* Lid accel */
#define CONFIG_LID_ANGLE
#define CONFIG_LID_ANGLE_UPDATE
#define CONFIG_LID_ANGLE_SENSOR_BASE BASE_ACCEL
#define CONFIG_LID_ANGLE_SENSOR_LID LID_ACCEL
/* Enable sensor fifo, must also define the _SIZE and _THRES */
#define CONFIG_ACCEL_FIFO
/* FIFO size is in power of 2. */
#define CONFIG_ACCEL_FIFO_SIZE 256
/* Depends on how fast the AP boots and typical ODRs */
#define CONFIG_ACCEL_FIFO_THRES (CONFIG_ACCEL_FIFO_SIZE / 3)
/* Sensor console commands */
#define CONFIG_CMD_ACCELS
#define CONFIG_CMD_ACCEL_INFO
/* USB Type A Features */
#define USB_PORT_COUNT 1
#define CONFIG_USB_PORT_POWER_DUMB
/* USB Type C and USB PD defines */
#define CONFIG_IO_EXPANDER
#define CONFIG_IO_EXPANDER_NCT38XX
#define CONFIG_IO_EXPANDER_PORT_COUNT 1
#define CONFIG_USB_PD_TCPM_PS8815
#define CONFIG_USB_PD_TCPM_PS8815_FORCE_DID
#undef CONFIG_USBC_RETIMER_INTEL_BB
#define CONFIG_USBC_PPC_SYV682X
#undef CONFIG_SYV682X_HV_ILIM
#define CONFIG_SYV682X_HV_ILIM SYV682X_HV_ILIM_5_50
#define CONFIG_USBC_PPC_NX20P3483
#define CONFIG_USB_PD_FRS
#define CONFIG_USB_PD_FRS_PPC
/* measure and check these values on gimble */
#define PD_POWER_SUPPLY_TURN_ON_DELAY 30000 /* us */
#define PD_POWER_SUPPLY_TURN_OFF_DELAY 30000 /* us */
#define PD_VCONN_SWAP_DELAY 5000 /* us */
/* I2C speed console command */
#define CONFIG_CMD_I2C_SPEED
/* I2C control host command */
#define CONFIG_HOSTCMD_I2C_CONTROL
/*
* Passive USB-C cables only support up to 60W.
*/
#define PD_OPERATING_POWER_MW 15000
#define PD_MAX_POWER_MW 60000
#define PD_MAX_CURRENT_MA 3000
#define PD_MAX_VOLTAGE_MV 20000
/*
* Macros for GPIO signals used in common code that don't match the
* schematic names. Signal names in gpio.inc match the schematic and are
* then redefined here to so it's more clear which signal is being used for
* which purpose.
*/
#define GPIO_AC_PRESENT GPIO_ACOK_OD
#define GPIO_CPU_PROCHOT GPIO_EC_PROCHOT_ODL
#define GPIO_EC_INT_L GPIO_EC_PCH_INT_ODL
#define GPIO_ENABLE_BACKLIGHT GPIO_EC_EN_EDP_BL
#define GPIO_ENTERING_RW GPIO_EC_ENTERING_RW
#define GPIO_KBD_KSO2 GPIO_EC_KSO_02_INV
#define GPIO_PACKET_MODE_EN GPIO_EC_GSC_PACKET_MODE
#define GPIO_PCH_PWRBTN_L GPIO_EC_PCH_PWR_BTN_ODL
#define GPIO_PCH_RSMRST_L GPIO_EC_PCH_RSMRST_L
#define GPIO_PCH_RTCRST GPIO_EC_PCH_RTCRST
#define GPIO_PCH_SLP_S0_L GPIO_SYS_SLP_S0IX_L
#define GPIO_PCH_SLP_S3_L GPIO_SLP_S3_L
#define GPIO_TEMP_SENSOR_POWER GPIO_SEQ_EC_DSW_PWROK
/*
* GPIO_EC_PCH_INT_ODL is used for MKBP events as well as a PCH wakeup
* signal.
*/
#define GPIO_PCH_WAKE_L GPIO_EC_PCH_INT_ODL
#define GPIO_PG_EC_ALL_SYS_PWRGD GPIO_SEQ_EC_ALL_SYS_PG
#define GPIO_PG_EC_DSW_PWROK GPIO_SEQ_EC_DSW_PWROK
#define GPIO_PG_EC_RSMRST_ODL GPIO_SEQ_EC_RSMRST_ODL
#define GPIO_POWER_BUTTON_L GPIO_GSC_EC_PWR_BTN_ODL
#define GPIO_SYS_RESET_L GPIO_SYS_RST_ODL
#define GPIO_VOLUME_DOWN_L GPIO_EC_VOLDN_BTN_ODL
#define GPIO_VOLUME_UP_L GPIO_EC_VOLUP_BTN_ODL
#define GPIO_WP_L GPIO_EC_WP_ODL
/* System has back-lit keyboard */
#define CONFIG_PWM_KBLIGHT
/* Keyboard features */
#define CONFIG_KEYBOARD_VIVALDI
#define CONFIG_KEYBOARD_REFRESH_ROW3
/* I2C Bus Configuration */
#define I2C_PORT_SENSOR NPCX_I2C_PORT0_0
#define I2C_PORT_USB_C0_TCPC NPCX_I2C_PORT1_0
#define I2C_PORT_USB_C1_TCPC NPCX_I2C_PORT4_1
#define I2C_PORT_USB_C0_PPC NPCX_I2C_PORT2_0
#define I2C_PORT_USB_C1_PPC NPCX_I2C_PORT4_1
#define I2C_PORT_USB_C0_BC12 NPCX_I2C_PORT2_0
#define I2C_PORT_USB_C1_BC12 NPCX_I2C_PORT4_1
#define I2C_PORT_BATTERY NPCX_I2C_PORT5_0
#define I2C_PORT_CHARGER NPCX_I2C_PORT7_0
#define I2C_PORT_EEPROM NPCX_I2C_PORT7_0
#define I2C_PORT_MP2964 NPCX_I2C_PORT7_0
/* define this to aviod error on CONFIG_ACCELGYRO_BMI_COMM_I2C */
#define I2C_PORT_ACCEL I2C_PORT_SENSOR
#define I2C_ADDR_EEPROM_FLAGS 0x50
#define I2C_ADDR_MP2964_FLAGS 0x20
/* Disabling Thunderbolt-compatible mode */
#undef CONFIG_USB_PD_TBT_COMPAT_MODE
/* Enabling USB4 mode */
#undef CONFIG_USB_PD_USB4
/* Retimer */
#undef CONFIG_USBC_RETIMER_FW_UPDATE
/* Thermal features */
#define CONFIG_FANS FAN_CH_COUNT
#define CONFIG_THERMISTOR
#define CONFIG_TEMP_SENSOR
#define CONFIG_TEMP_SENSOR_POWER
#define CONFIG_STEINHART_HART_3V3_30K9_47K_4050B
/* LED defines */
#define CONFIG_LED_ONOFF_STATES
#define CONFIG_LED_ONOFF_STATES_BAT_LOW 10
/*
* TODO(b/181271666): no fan control loop until sensors are tuned
*/
/* Fan features */
#define CONFIG_CUSTOM_FAN_CONTROL
/* Charger defines */
#define CONFIG_CHARGER_BQ25720
#define CONFIG_CHARGER_BQ25720_VSYS_TH2_CUSTOM
#define CONFIG_CHARGER_BQ25720_VSYS_TH2_DV 70
#define CONFIG_CHARGE_RAMP_SW
#define CONFIG_CHARGER_BQ25710_SENSE_RESISTOR 10
#define CONFIG_CHARGER_BQ25710_SENSE_RESISTOR_AC 10
#define CONFIG_CHARGER_BQ25710_PSYS_SENSING
/* OEM requested 10% derating */
#define CONFIG_CHARGER_INPUT_CURRENT_DERATE_PCT 10
/* PROCHOT defines */
#define BATT_MAX_CONTINUE_DISCHARGE_WATT 45
/* Prochot assertion/deassertion ratios*/
#define PROCHOT_ADAPTER_WATT_RATIO 97
#define PROCHOT_ASSERTION_BATTERY_RATIO 95
#define PROCHOT_DEASSERTION_BATTERY_RATIO 85
#define PROCHOT_ASSERTION_PD_RATIO 104
#define PROCHOT_DEASSERTION_PD_RATIO 94
#define PROCHOT_DEASSERTION_PD_BATTERY_RATIO 95
#define PROCHOT_ASSERTION_ADAPTER_RATIO 102
#define PROCHOT_DEASSERTION_ADAPTER_RATIO 100
#define PROCHOT_DEASSERTION_ADAPTER_BATT_RATIO 90
#ifndef __ASSEMBLER__
#include "gpio_signal.h" /* needed by registers.h */
#include "registers.h"
#include "usbc_config.h"
enum adc_channel {
ADC_TEMP_SENSOR_1_DDR_SOC,
ADC_TEMP_SENSOR_2_FAN,
ADC_TEMP_SENSOR_3_CHARGER,
ADC_IADPT,
ADC_CH_COUNT
};
enum temp_sensor_id {
TEMP_SENSOR_1_DDR_SOC,
TEMP_SENSOR_2_FAN,
TEMP_SENSOR_3_CHARGER,
TEMP_SENSOR_COUNT
};
enum sensor_id { LID_ACCEL = 0, BASE_ACCEL, BASE_GYRO, SENSOR_COUNT };
enum ioex_port { IOEX_C0_NCT38XX = 0, IOEX_PORT_COUNT };
enum battery_type {
BATTERY_SIMPLO_HIGHPOWER,
BATTERY_COSMX,
BATTERY_TYPE_COUNT
};
enum pwm_channel {
PWM_CH_LED2 = 0, /* PWM0 (white charger) */
PWM_CH_LED3, /* PWM1 (orange on DB) */
PWM_CH_LED1, /* PWM2 (orange charger) */
PWM_CH_KBLIGHT, /* PWM3 */
PWM_CH_FAN, /* PWM5 */
PWM_CH_LED4, /* PWM7 (white on DB) */
PWM_CH_COUNT
};
enum fan_channel { FAN_CH_0 = 0, FAN_CH_COUNT };
enum mft_channel { MFT_CH_0 = 0, MFT_CH_COUNT };
void motion_interrupt(enum gpio_signal signal);
#endif /* !__ASSEMBLER__ */
#endif /* __CROS_EC_BOARD_H */
|
{
"content_hash": "638eef458fb50dea8c31b69808d45f8f",
"timestamp": "",
"source": "github",
"line_count": 262,
"max_line_length": 75,
"avg_line_length": 27.729007633587788,
"alnum_prop": 0.7439779766001376,
"repo_name": "coreboot/chrome-ec",
"id": "1d4099e7ebdd9fc6053b7ddef7315e9b556a95f0",
"size": "7413",
"binary": false,
"copies": "2",
"ref": "refs/heads/main",
"path": "board/gimble/board.h",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "Assembly",
"bytes": "153372"
},
{
"name": "C",
"bytes": "25514204"
},
{
"name": "C++",
"bytes": "617015"
},
{
"name": "CMake",
"bytes": "114317"
},
{
"name": "Emacs Lisp",
"bytes": "136"
},
{
"name": "Go",
"bytes": "40545"
},
{
"name": "HTML",
"bytes": "602017"
},
{
"name": "Makefile",
"bytes": "247601"
},
{
"name": "Pawn",
"bytes": "3004"
},
{
"name": "Python",
"bytes": "1006209"
},
{
"name": "Shell",
"bytes": "138354"
},
{
"name": "SourcePawn",
"bytes": "3051"
},
{
"name": "Tcl",
"bytes": "5238"
}
],
"symlink_target": ""
}
|
using System.Collections.Generic;
using System.IO;
using System.Net;
namespace QuantConnect.Algorithm
{
/// <summary>
/// Imports data from the web
/// </summary>
public class WebDataImport
{
private const string DATA_SOURCE_URI = @"http://54.69.46.205/filter_csv_withcache.php?sdate=1/1/2010&edate=7/6/2015&knowhen=31,41&rd_pct=83,92,100&pid=9";
/// <summary>
///
/// </summary>
public string _dataSourceUri { get; set; }
/// <summary>
///
/// </summary>
public string downloadedData { get; set; }
/// <summary>
/// Empty constructor
/// </summary>
public WebDataImport()
{
_dataSourceUri = DATA_SOURCE_URI;
}
/// <summary>
/// Constructor specifying the data source uri
/// </summary>
/// <param name="dataSourceUri"></param>
public WebDataImport(string dataSourceUri)
{
_dataSourceUri = dataSourceUri;
}
/// <summary>
/// Retrieves the data from the web
/// </summary>
/// <returns>a list of AbhiGoalCustomData objects, one for each row in the csv file</returns>
public List<AbhiGoalCustomData> GetData()
{
int count = 0;
var list = new List<AbhiGoalCustomData>();
using (WebClient wClient = new WebClient())
{
downloadedData = wClient.DownloadString(_dataSourceUri);
}
var inputProcessor = new AhiGoalLineParser();
list = inputProcessor.ProcessStreamIntoList(downloadedData);
//return list.Where(s => s.symbol == "FAST" || s.symbol == "DNB" || s.symbol == "JNJ" || s.symbol == "LLL").Cast<AbhiGoalCustomData>().ToList();
return list;
}
}
}
|
{
"content_hash": "3c16c1e81da1c8741b35348303a28e73",
"timestamp": "",
"source": "github",
"line_count": 57,
"max_line_length": 162,
"avg_line_length": 32.56140350877193,
"alnum_prop": 0.5495689655172413,
"repo_name": "bizcad/LeanAbhi",
"id": "44f2f7f82d085d1e9d6476f2a0c6094fcc60be1a",
"size": "1858",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "Algorithm.CSharp/AbhiGoalAlgorithms/WebDataImport.cs",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Batchfile",
"bytes": "2901"
},
{
"name": "C#",
"bytes": "2632122"
},
{
"name": "F#",
"bytes": "1712"
},
{
"name": "Java",
"bytes": "844"
},
{
"name": "Python",
"bytes": "632"
},
{
"name": "Shell",
"bytes": "2413"
},
{
"name": "Visual Basic",
"bytes": "2448"
}
],
"symlink_target": ""
}
|
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="app_name">AngryStudents</string>
</resources>
|
{
"content_hash": "802b81995d932afd944fd67ab50f5854",
"timestamp": "",
"source": "github",
"line_count": 6,
"max_line_length": 50,
"avg_line_length": 19.5,
"alnum_prop": 0.6666666666666666,
"repo_name": "bobxiv/AngryStudents",
"id": "bdda0e6d792ea057069a1b4061d9d0e4d90cc7f7",
"size": "117",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "android/res/values/strings.xml",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "1069"
},
{
"name": "HTML",
"bytes": "1526"
},
{
"name": "Java",
"bytes": "11157"
},
{
"name": "JavaScript",
"bytes": "24"
}
],
"symlink_target": ""
}
|
<!--
~ Copyright (c) 2015 David Schulte
~
~ Permission is hereby granted, free of charge, to any person obtaining a copy
~ of this software and associated documentation files (the "Software"), to deal
~ in the Software without restriction, including without limitation the rights
~ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
~ copies of the Software, and to permit persons to whom the Software is
~ furnished to do so, subject to the following conditions:
~
~ The above copyright notice and this permission notice shall be included in
~ all copies or substantial portions of the Software.
~
~ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
~ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
~ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
~ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
~ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
~ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
~ THE SOFTWARE.
-->
<resources>
<!-- Base application theme. -->
<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
<!-- Customize your theme here. -->
<item name="colorPrimary">@color/application_main</item>
<item name="colorAccent">@color/application_main</item>
<item name="colorPrimaryDark">@color/application_main_dark</item>
<item name="actionBarStyle">@style/AppTheme.ActionBar</item>
<item name="actionModeBackground">@color/application_main</item>
</style>
<style name="AppTheme.ActionBar" parent="Widget.AppCompat.Light.ActionBar.Solid.Inverse">
<!-- Removes the shadow from the action bar -->
<item name="elevation">0dp</item>
</style>
<style name="AppTheme.Button">
<item name="android:background">@drawable/button_navigation_drawer</item>
<item name="android:buttonStyle">@null</item>
<item name="android:textColor">@color/button_navigation_drawer_text</item>
<item name="android:paddingTop">5dp</item>
<item name="android:paddingBottom">5dp</item>
<item name="android:paddingLeft">10dp</item>
<item name="android:paddingRight">10dp</item>
<item name="android:textSize">16sp</item>
<item name="android:drawablePadding">10dp</item>
<item name="android:gravity">start|center_vertical</item>
</style>
</resources>
|
{
"content_hash": "0f6c905be7159f7251c74482f2699ffa",
"timestamp": "",
"source": "github",
"line_count": 52,
"max_line_length": 93,
"avg_line_length": 48.82692307692308,
"alnum_prop": 0.6990941315478535,
"repo_name": "Arcus92/PlayMusicExporter",
"id": "1dc6fba3d3d955cd50283565b837239670b87c7b",
"size": "2539",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "playmusicexporter/src/main/res/values/styles.xml",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Java",
"bytes": "296722"
}
],
"symlink_target": ""
}
|
Voiceprint Recognition program using MFCC and DTW. There are two versions by matlab and C#.
|
{
"content_hash": "b7910504d589a516c587bf3ee186c57c",
"timestamp": "",
"source": "github",
"line_count": 1,
"max_line_length": 91,
"avg_line_length": 92,
"alnum_prop": 0.8043478260869565,
"repo_name": "Featherlet/VoiceprintRecognition",
"id": "0d72f936b607e0b34dc800a58947ac6b2b8a9a26",
"size": "116",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "README.md",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C#",
"bytes": "36989"
}
],
"symlink_target": ""
}
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!-- NewPage -->
<html lang="de">
<head>
<!-- Generated by javadoc (version 1.7.0_17) on Tue May 14 03:45:00 CEST 2013 -->
<title>SharedLibraryLoader (libgdx API)</title>
<meta name="date" content="2013-05-14">
<link rel="stylesheet" type="text/css" href="../../../../stylesheet.css" title="Style">
</head>
<body>
<script type="text/javascript"><!--
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="SharedLibraryLoader (libgdx API)";
}
//-->
</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
<!-- ========= START OF TOP NAVBAR ======= -->
<div class="topNav"><a name="navbar_top">
<!-- -->
</a><a href="#skip-navbar_top" title="Skip navigation links"></a><a name="navbar_top_firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../overview-summary.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="navBarCell1Rev">Class</li>
<li><a href="class-use/SharedLibraryLoader.html">Use</a></li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../index-all.html">Index</a></li>
<li><a href="../../../../help-doc.html">Help</a></li>
</ul>
<div class="aboutLanguage"><em>
libgdx API
<style>
body, td, th { font-family:Helvetica, Tahoma, Arial, sans-serif; font-size:10pt }
pre, code, tt { font-size:9pt; font-family:Lucida Console, Courier New, sans-serif }
h1, h2, h3, .FrameTitleFont, .FrameHeadingFont, .TableHeadingColor font { font-size:105%; font-weight:bold }
.TableHeadingColor { background:#EEEEFF; }
a { text-decoration:none }
a:hover { text-decoration:underline }
a:link, a:visited { color:blue }
table { border:0px }
.TableRowColor td:first-child { border-left:1px solid black }
.TableRowColor td { border:0px; border-bottom:1px solid black; border-right:1px solid black }
hr { border:0px; border-bottom:1px solid #333366; }
</style>
</em></div>
</div>
<div class="subNav">
<ul class="navList">
<li><a href="../../../../com/badlogic/gdx/utils/SerializationException.html" title="class in com.badlogic.gdx.utils"><span class="strong">Prev Class</span></a></li>
<li><a href="../../../../com/badlogic/gdx/utils/ShortArray.html" title="class in com.badlogic.gdx.utils"><span class="strong">Next Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../../index.html?com/badlogic/gdx/utils/SharedLibraryLoader.html" target="_top">Frames</a></li>
<li><a href="SharedLibraryLoader.html" target="_top">No Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_top">
<li><a href="../../../../allclasses-noframe.html">All Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_top");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<div>
<ul class="subNavList">
<li>Summary: </li>
<li>Nested | </li>
<li><a href="#field_summary">Field</a> | </li>
<li><a href="#constructor_summary">Constr</a> | </li>
<li><a href="#method_summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail: </li>
<li><a href="#field_detail">Field</a> | </li>
<li><a href="#constructor_detail">Constr</a> | </li>
<li><a href="#method_detail">Method</a></li>
</ul>
</div>
<a name="skip-navbar_top">
<!-- -->
</a></div>
<!-- ========= END OF TOP NAVBAR ========= -->
<!-- ======== START OF CLASS DATA ======== -->
<div class="header">
<div class="subTitle">com.badlogic.gdx.utils</div>
<h2 title="Class SharedLibraryLoader" class="title">Class SharedLibraryLoader</h2>
</div>
<div class="contentContainer">
<ul class="inheritance">
<li>java.lang.Object</li>
<li>
<ul class="inheritance">
<li>com.badlogic.gdx.utils.SharedLibraryLoader</li>
</ul>
</li>
</ul>
<div class="description">
<ul class="blockList">
<li class="blockList">
<hr>
<br>
<pre>public class <span class="strong">SharedLibraryLoader</span>
extends java.lang.Object</pre>
<div class="block">Loads shared libraries from a natives jar file (desktop) or arm folders (Android). For desktop projects, have the natives jar
in the classpath, for Android projects put the shared libraries in the libs/armeabi and libs/armeabi-v7a folders.</div>
<dl><dt><span class="strong">Author:</span></dt>
<dd>mzechner, Nathan Sweet</dd></dl>
</li>
</ul>
</div>
<div class="summary">
<ul class="blockList">
<li class="blockList">
<!-- =========== FIELD SUMMARY =========== -->
<ul class="blockList">
<li class="blockList"><a name="field_summary">
<!-- -->
</a>
<h3>Field Summary</h3>
<table class="overviewSummary" border="0" cellpadding="3" cellspacing="0" summary="Field Summary table, listing fields, and an explanation">
<caption><span>Fields</span><span class="tabEnd"> </span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Field and Description</th>
</tr>
<tr class="altColor">
<td class="colFirst"><code>static boolean</code></td>
<td class="colLast"><code><strong><a href="../../../../com/badlogic/gdx/utils/SharedLibraryLoader.html#is64Bit">is64Bit</a></strong></code> </td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>static boolean</code></td>
<td class="colLast"><code><strong><a href="../../../../com/badlogic/gdx/utils/SharedLibraryLoader.html#isAndroid">isAndroid</a></strong></code> </td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>static boolean</code></td>
<td class="colLast"><code><strong><a href="../../../../com/badlogic/gdx/utils/SharedLibraryLoader.html#isIos">isIos</a></strong></code> </td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>static boolean</code></td>
<td class="colLast"><code><strong><a href="../../../../com/badlogic/gdx/utils/SharedLibraryLoader.html#isLinux">isLinux</a></strong></code> </td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>static boolean</code></td>
<td class="colLast"><code><strong><a href="../../../../com/badlogic/gdx/utils/SharedLibraryLoader.html#isMac">isMac</a></strong></code> </td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>static boolean</code></td>
<td class="colLast"><code><strong><a href="../../../../com/badlogic/gdx/utils/SharedLibraryLoader.html#isWindows">isWindows</a></strong></code> </td>
</tr>
</table>
</li>
</ul>
<!-- ======== CONSTRUCTOR SUMMARY ======== -->
<ul class="blockList">
<li class="blockList"><a name="constructor_summary">
<!-- -->
</a>
<h3>Constructor Summary</h3>
<table class="overviewSummary" border="0" cellpadding="3" cellspacing="0" summary="Constructor Summary table, listing constructors, and an explanation">
<caption><span>Constructors</span><span class="tabEnd"> </span></caption>
<tr>
<th class="colOne" scope="col">Constructor and Description</th>
</tr>
<tr class="altColor">
<td class="colOne"><code><strong><a href="../../../../com/badlogic/gdx/utils/SharedLibraryLoader.html#SharedLibraryLoader()">SharedLibraryLoader</a></strong>()</code> </td>
</tr>
<tr class="rowColor">
<td class="colOne"><code><strong><a href="../../../../com/badlogic/gdx/utils/SharedLibraryLoader.html#SharedLibraryLoader(java.lang.String)">SharedLibraryLoader</a></strong>(java.lang.String nativesJar)</code>
<div class="block">Fetches the natives from the given natives jar file.</div>
</td>
</tr>
</table>
</li>
</ul>
<!-- ========== METHOD SUMMARY =========== -->
<ul class="blockList">
<li class="blockList"><a name="method_summary">
<!-- -->
</a>
<h3>Method Summary</h3>
<table class="overviewSummary" border="0" cellpadding="3" cellspacing="0" summary="Method Summary table, listing methods, and an explanation">
<caption><span>Methods</span><span class="tabEnd"> </span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Method and Description</th>
</tr>
<tr class="altColor">
<td class="colFirst"><code>java.lang.String</code></td>
<td class="colLast"><code><strong><a href="../../../../com/badlogic/gdx/utils/SharedLibraryLoader.html#crc(java.io.InputStream)">crc</a></strong>(java.io.InputStream input)</code>
<div class="block">Returns a CRC of the remaining bytes in the stream.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>java.io.File</code></td>
<td class="colLast"><code><strong><a href="../../../../com/badlogic/gdx/utils/SharedLibraryLoader.html#extractFile(java.lang.String, java.lang.String)">extractFile</a></strong>(java.lang.String sourcePath,
java.lang.String dirName)</code>
<div class="block">Extracts the specified file into the temp directory if it does not already exist or the CRC does not match.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><strong><a href="../../../../com/badlogic/gdx/utils/SharedLibraryLoader.html#load(java.lang.String)">load</a></strong>(java.lang.String libraryName)</code>
<div class="block">Loads a shared library for the platform the application is running on.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>java.lang.String</code></td>
<td class="colLast"><code><strong><a href="../../../../com/badlogic/gdx/utils/SharedLibraryLoader.html#mapLibraryName(java.lang.String)">mapLibraryName</a></strong>(java.lang.String libraryName)</code>
<div class="block">Maps a platform independent library name to a platform dependent name.</div>
</td>
</tr>
</table>
<ul class="blockList">
<li class="blockList"><a name="methods_inherited_from_class_java.lang.Object">
<!-- -->
</a>
<h3>Methods inherited from class java.lang.Object</h3>
<code>clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait</code></li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
<div class="details">
<ul class="blockList">
<li class="blockList">
<!-- ============ FIELD DETAIL =========== -->
<ul class="blockList">
<li class="blockList"><a name="field_detail">
<!-- -->
</a>
<h3>Field Detail</h3>
<a name="isWindows">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>isWindows</h4>
<pre>public static boolean isWindows</pre>
</li>
</ul>
<a name="isLinux">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>isLinux</h4>
<pre>public static boolean isLinux</pre>
</li>
</ul>
<a name="isMac">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>isMac</h4>
<pre>public static boolean isMac</pre>
</li>
</ul>
<a name="isIos">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>isIos</h4>
<pre>public static boolean isIos</pre>
</li>
</ul>
<a name="isAndroid">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>isAndroid</h4>
<pre>public static boolean isAndroid</pre>
</li>
</ul>
<a name="is64Bit">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>is64Bit</h4>
<pre>public static boolean is64Bit</pre>
</li>
</ul>
</li>
</ul>
<!-- ========= CONSTRUCTOR DETAIL ======== -->
<ul class="blockList">
<li class="blockList"><a name="constructor_detail">
<!-- -->
</a>
<h3>Constructor Detail</h3>
<a name="SharedLibraryLoader()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>SharedLibraryLoader</h4>
<pre>public SharedLibraryLoader()</pre>
</li>
</ul>
<a name="SharedLibraryLoader(java.lang.String)">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>SharedLibraryLoader</h4>
<pre>public SharedLibraryLoader(java.lang.String nativesJar)</pre>
<div class="block">Fetches the natives from the given natives jar file. Used for testing a shared lib on the fly.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>nativesJar</code> - </dd></dl>
</li>
</ul>
</li>
</ul>
<!-- ============ METHOD DETAIL ========== -->
<ul class="blockList">
<li class="blockList"><a name="method_detail">
<!-- -->
</a>
<h3>Method Detail</h3>
<a name="crc(java.io.InputStream)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>crc</h4>
<pre>public java.lang.String crc(java.io.InputStream input)</pre>
<div class="block">Returns a CRC of the remaining bytes in the stream.</div>
</li>
</ul>
<a name="mapLibraryName(java.lang.String)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>mapLibraryName</h4>
<pre>public java.lang.String mapLibraryName(java.lang.String libraryName)</pre>
<div class="block">Maps a platform independent library name to a platform dependent name.</div>
</li>
</ul>
<a name="load(java.lang.String)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>load</h4>
<pre>public void load(java.lang.String libraryName)</pre>
<div class="block">Loads a shared library for the platform the application is running on.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>libraryName</code> - The platform independent library name. If not contain a prefix (eg lib) or suffix (eg .dll).</dd></dl>
</li>
</ul>
<a name="extractFile(java.lang.String, java.lang.String)">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>extractFile</h4>
<pre>public java.io.File extractFile(java.lang.String sourcePath,
java.lang.String dirName)
throws java.io.IOException</pre>
<div class="block">Extracts the specified file into the temp directory if it does not already exist or the CRC does not match. If file
extraction fails and the file exists at java.library.path, that file is returned.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>sourcePath</code> - The file to extract from the classpath or JAR.</dd><dd><code>dirName</code> - The name of the subdirectory where the file will be extracted. If null, the file's CRC will be used.</dd>
<dt><span class="strong">Returns:</span></dt><dd>The extracted file.</dd>
<dt><span class="strong">Throws:</span></dt>
<dd><code>java.io.IOException</code></dd></dl>
</li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
</div>
<!-- ========= END OF CLASS DATA ========= -->
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<div class="bottomNav"><a name="navbar_bottom">
<!-- -->
</a><a href="#skip-navbar_bottom" title="Skip navigation links"></a><a name="navbar_bottom_firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../overview-summary.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="navBarCell1Rev">Class</li>
<li><a href="class-use/SharedLibraryLoader.html">Use</a></li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../index-all.html">Index</a></li>
<li><a href="../../../../help-doc.html">Help</a></li>
</ul>
<div class="aboutLanguage"><em>libgdx API</em></div>
</div>
<div class="subNav">
<ul class="navList">
<li><a href="../../../../com/badlogic/gdx/utils/SerializationException.html" title="class in com.badlogic.gdx.utils"><span class="strong">Prev Class</span></a></li>
<li><a href="../../../../com/badlogic/gdx/utils/ShortArray.html" title="class in com.badlogic.gdx.utils"><span class="strong">Next Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../../index.html?com/badlogic/gdx/utils/SharedLibraryLoader.html" target="_top">Frames</a></li>
<li><a href="SharedLibraryLoader.html" target="_top">No Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_bottom">
<li><a href="../../../../allclasses-noframe.html">All Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_bottom");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<div>
<ul class="subNavList">
<li>Summary: </li>
<li>Nested | </li>
<li><a href="#field_summary">Field</a> | </li>
<li><a href="#constructor_summary">Constr</a> | </li>
<li><a href="#method_summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail: </li>
<li><a href="#field_detail">Field</a> | </li>
<li><a href="#constructor_detail">Constr</a> | </li>
<li><a href="#method_detail">Method</a></li>
</ul>
</div>
<a name="skip-navbar_bottom">
<!-- -->
</a></div>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
<p class="legalCopy"><small>
<div style="font-size:9pt"><i>
Copyright © 2010-2013 Mario Zechner (contact@badlogicgames.com), Nathan Sweet (admin@esotericsoftware.com)
</i></div>
</small></p>
</body>
</html>
|
{
"content_hash": "32259354b5cdff1cfd4b5d3174dd374c",
"timestamp": "",
"source": "github",
"line_count": 459,
"max_line_length": 265,
"avg_line_length": 36.90631808278867,
"alnum_prop": 0.6563754427390791,
"repo_name": "leszekuchacz/Leszek-Uchacz",
"id": "31d5f66b5ea3065c4879457d3b190d6ca04ef25c",
"size": "16940",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "docs/api/com/badlogic/gdx/utils/SharedLibraryLoader.html",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Java",
"bytes": "10598"
}
],
"symlink_target": ""
}
|
<?php
/*
Template Name: Full Width
*/
get_header(); ?>
<?php get_template_part( 'template-parts/featured-image' ); ?>
<div id="page-full-width" role="main">
<?php do_action( 'foundationpress_before_content' ); ?>
<?php while ( have_posts() ) : the_post(); ?>
<article <?php post_class('main-content') ?> id="post-<?php the_ID(); ?>">
<?php do_action( 'foundationpress_page_before_entry_content' ); ?>
<div class="entry-content">
<?php the_content(); ?>
</div>
<footer>
<?php wp_link_pages( array('before' => '<nav id="page-nav"><p>' . __( 'Pages:', 'foundationpress' ), 'after' => '</p></nav>' ) ); ?>
<p><?php the_tags(); ?></p>
</footer>
</article>
<?php endwhile;?>
<?php do_action( 'foundationpress_after_content' ); ?>
</div>
<?php get_footer();
|
{
"content_hash": "3a74774b12f5064de8850afcf8eca8c4",
"timestamp": "",
"source": "github",
"line_count": 29,
"max_line_length": 142,
"avg_line_length": 28.310344827586206,
"alnum_prop": 0.5554202192448234,
"repo_name": "kenziebottoms/makenashville",
"id": "91e80d602bb35f3a137df2feef484cb30c710630",
"size": "821",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "page-templates/page-full-width.php",
"mode": "33261",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "444460"
},
{
"name": "HTML",
"bytes": "11883"
},
{
"name": "JavaScript",
"bytes": "30006"
},
{
"name": "PHP",
"bytes": "131253"
},
{
"name": "Shell",
"bytes": "139"
}
],
"symlink_target": ""
}
|
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="description" content="Logic and Proof">
<meta name="author" content="Jeremy Avigad, Floris van Doorn">
<title>Logic and Proof</title>
<link rel="stylesheet" href="css/main_live.css"/>
<link rel="stylesheet" href="css/code.css"/>
<link rel="apple-touch-icon" sizes="57x57" href="./images/apple-touch-icon-57x57.png">
<link rel="apple-touch-icon" sizes="60x60" href="./images/apple-touch-icon-60x60.png">
<link rel="apple-touch-icon" sizes="72x72" href="./images/apple-touch-icon-72x72.png">
<link rel="apple-touch-icon" sizes="76x76" href="./images/apple-touch-icon-76x76.png">
<link rel="apple-touch-icon" sizes="114x114" href="./images/apple-touch-icon-114x114.png">
<link rel="apple-touch-icon" sizes="120x120" href="./images/apple-touch-icon-120x120.png">
<link rel="apple-touch-icon" sizes="144x144" href="./images/apple-touch-icon-144x144.png">
<link rel="apple-touch-icon" sizes="152x152" href="./images/apple-touch-icon-152x152.png">
<link rel="apple-touch-icon" sizes="180x180" href="./images/apple-touch-icon-180x180.png">
<link rel="icon" type="image/png" href="./images/favicon-32x32.png" sizes="32x32">
<link rel="icon" type="image/png" href="./images/android-chrome-192x192.png" sizes="192x192">
<link rel="icon" type="image/png" href="./images/favicon-96x96.png" sizes="96x96">
<link rel="icon" type="image/png" href="./images/favicon-16x16.png" sizes="16x16">
<link rel="manifest" href="./images/manifest.json">
<meta name="msapplication-TileColor" content="#da532c">
<meta name="msapplication-TileImage" content="./images/mstile-144x144.png">
<meta name="theme-color" content="#ffffff">
</head>
<body>
<div id="menu_bar">
<div id="button_container">
<a href="//leanprover.github.io"><img id="lean_logo" src="./images/lean_logo_small.svg"/></a>
<div id="new-button" class="button"><img class="menu_icon" src="./images/new.svg" title="new"/></div>
<div id="run-button" class="button"><img class="menu_icon" src="./images/run.svg" title="run (shift + enter)"/></div>
<div id="layout-button" class="button"><img class="menu_icon" src="./images/square.svg" title="rotate layout"/></div>
<div id="book-button" class="button"><a href="logic_and_proof.pdf"><img class="menu_icon" src="./images/book.svg" title="Download PDF"/></a></div>
<div id="setting-button" class="button"><img class="menu_icon" src="./images/gear.svg" title="setting"/></div>
<select id='tutorialNav' style="display:none"></select>
</div>
</div>
<div id="main_window">
<div id="tutorial_contents"></div>
<div id="resizable_handle_main" class="resizable_handle"></div>
<div id="main_and_console">
<div id="editor_main"></div>
<div id="resizable_handle_sub" class="resizable_handle"></div>
<div id="editor_console"></div>
</div>
</div>
<div id="setting_window" style="display:none; z-index:9999;">
<div id="setting_contents">
<h1>Settings</h1>
<fieldset>
<label for="print_output_to_console">Print output to the console</label>
<select name="print_output_to_console" id="print_output_to_console">
<option>true</option>
<option selected="selected" >false</option>
</select>
</fieldset>
<button id="close_setting_window">Close</button>
</div>
</div>
<script src="//cdn.jsdelivr.net/webcomponentsjs/0.7.20/webcomponents.min.js"></script>
<script src="//cdn.jsdelivr.net/jquery/2.1.4/jquery.min.js"></script>
<script src="//cdn.jsdelivr.net/jquery.cookie/1.4.1/jquery.cookie.min.js"></script>
<script src="//leanprover.github.io/ace/ace/ace.js" type="text/javascript" charset="utf-8"></script>
<script src="//leanprover.github.io/ace/ace/ext-language_tools.js" type="text/javascript" charset="utf-8"></script>
<script src="js/input-method.js" type="text/javascript" charset="utf-8"></script>
<script src="js/completion.js" type="text/javascript" charset="utf-8"></script>
<script src="js/main_live.js" type="text/javascript" charset="utf-8"></script>
</body>
</html>
|
{
"content_hash": "e26d4c794c1ec379b2be5ae7410be6cb",
"timestamp": "",
"source": "github",
"line_count": 73,
"max_line_length": 154,
"avg_line_length": 60.36986301369863,
"alnum_prop": 0.6501021102791015,
"repo_name": "soonhokong/logic_and_proof",
"id": "c3c7faad37304f94cbb551186925a6c7d370f757",
"size": "4407",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "index.html",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "11674"
},
{
"name": "Emacs Lisp",
"bytes": "21493"
},
{
"name": "HTML",
"bytes": "9937"
},
{
"name": "JavaScript",
"bytes": "41296"
},
{
"name": "Lean",
"bytes": "19"
},
{
"name": "Makefile",
"bytes": "3994"
},
{
"name": "Shell",
"bytes": "5111"
},
{
"name": "TeX",
"bytes": "576990"
}
],
"symlink_target": ""
}
|
// <copyright file="EqualsOverrideNewObjectAssertionTests.cs" company="natsnudasoft">
// Copyright (c) Adrian John Dunstan. All rights reserved.
//
// Licensed 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.
// </copyright>
namespace Natsnudasoft.NatsnudasoftTests.TestExtension
{
using System;
using AutoFixture;
using AutoFixture.Idioms;
using AutoFixture.Kernel;
using Moq;
using Natsnudasoft.NatsnudaLibrary.TestExtensions;
using Natsnudasoft.NatsnudasoftTests.Helper;
using Xunit;
using SutAlias = Natsnudasoft.NatsnudaLibrary.TestExtensions.EqualsOverrideNewObjectAssertion;
public sealed class EqualsOverrideNewObjectAssertionTests
{
private static readonly Type SutType = typeof(SutAlias);
private static readonly Type TestHelperType = typeof(EqualsOverrideAssertionVerifyHelper);
[Fact]
public void ConstructorHasCorrectGuardClauses()
{
var fixture = new Fixture();
var assertion = new GuardClauseAssertion(fixture);
assertion.Verify(SutType.GetConstructors());
}
[Fact]
public void ConstructorSetsCorrectInitializedMembers()
{
var fixture = new Fixture();
var assertion = new ConstructorInitializedMemberAssertion(fixture);
assertion.Verify(SutType.GetProperty(nameof(EqualsOverrideAssertion.SpecimenBuilder)));
}
[Fact]
public void ConstructorDoesNotThrow()
{
var ex = Record.Exception(() => new SutAlias(new Mock<ISpecimenBuilder>().Object));
Assert.Null(ex);
}
[Fact]
public void VerifyEqualsMethodWithNonObjectParameterTypeDoesNotInvokeEquals()
{
var fixture = new Fixture();
var verifyHelperMock = new Mock<EqualsOverrideAssertionVerifyHelper>(false, true, false)
{
CallBase = true,
};
fixture.Inject(verifyHelperMock.Object);
var sut = fixture.Create<SutAlias>();
sut.Verify(TestHelperType.GetMethod(
nameof(EqualsOverrideAssertionVerifyHelper.Equals),
new[] { typeof(bool) }));
verifyHelperMock.Verify(h => h.Equals(It.IsAny<bool>()), Times.Never());
}
[Fact]
public void VerifyEqualsMethodViolatesDoesNotEqualNewObjectContractThrows()
{
var fixture = new Fixture();
fixture.Inject(new EqualsOverrideAssertionVerifyHelper(true, true, false));
var sut = fixture.Create<SutAlias>();
var ex = Record.Exception(() => sut.Verify(TestHelperType.GetMethod(
nameof(EqualsOverrideAssertionVerifyHelper.Equals),
new[] { typeof(object) })));
Assert.IsType<EqualsOverrideException>(ex);
}
[Fact]
public void VerifyEqualsMethodCorrectBehaviourInvokesEquals()
{
var fixture = new Fixture();
var verifyHelperMock = new Mock<EqualsOverrideAssertionVerifyHelper>(false, true, false)
{
CallBase = true,
};
fixture.Inject(verifyHelperMock.Object);
var sut = fixture.Create<SutAlias>();
sut.Verify(TestHelperType.GetMethod(
nameof(EqualsOverrideAssertionVerifyHelper.Equals),
new[] { typeof(object) }));
verifyHelperMock.Verify(h => h.Equals(It.IsAny<object>()), Times.Once());
}
}
}
|
{
"content_hash": "f115bee5b2f74f5660f4b0b7639db261",
"timestamp": "",
"source": "github",
"line_count": 112,
"max_line_length": 100,
"avg_line_length": 35.955357142857146,
"alnum_prop": 0.6453935932455922,
"repo_name": "natsnudasoft/NatsnudaLibrary",
"id": "99c2a27e9c30b91b15637744af759d14d009936a",
"size": "4029",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "test/unit/NatsnudasoftTests/TestExtension/EqualsOverrideNewObjectAssertionTests.cs",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "C#",
"bytes": "266770"
}
],
"symlink_target": ""
}
|
package java.text;
import org.apache.harmony.text.internal.nls.Messages;
/**
* <code>RuleBasedCollator</code> is a concrete subclass of
* <code>Collator</code>. It allows customization of the
* <code>Collator</code> via user-specified rule sets.
* <code>RuleBasedCollator</code> is designed to be fully compliant to the <a
* href="http://www.unicode.org/unicode/reports/tr10/"> Unicode Collation
* Algorithm (UCA) </a> and conforms to ISO 14651.
* </p>
* <p>
* Create a <code>RuleBasedCollator</code> from a locale by calling the
* <code>getInstance(Locale)</code> factory method in the base class
* <code>Collator</code>.<code>Collator.getInstance(Locale)</code> creates
* a <code>RuleBasedCollator</code> object based on the collation rules
* defined by the argument locale. If a customized collation is required, use
* the <code>RuleBasedCollator(String)</code> constructor with the appropriate
* rules. The customized <code>RuleBasedCollator</code> will base its ordering
* on UCA, while re-adjusting the attributes and orders of the characters in the
* specified rule accordingly.
* </p>
*
*/
public class RuleBasedCollator extends Collator {
RuleBasedCollator(com.ibm.icu.text.Collator wrapper) {
super(wrapper);
}
/**
* Constructs a new instance of <code>RuleBasedCollator</code> using the
* specified <code>rules</code>.
*
* @param rules
* the collation rules.
* @throws ParseException
* when the rules contains an invalid collation rule syntax.
*/
public RuleBasedCollator(String rules) throws ParseException {
if (rules == null) {
throw new NullPointerException();
}
if (rules.length() == 0) {
// text.06=Build rules empty
throw new ParseException(Messages.getString("text.06"), 0); //$NON-NLS-1$
}
try {
this.icuColl = new com.ibm.icu.text.RuleBasedCollator(rules);
} catch (Exception e) {
if (e instanceof ParseException) {
throw (ParseException) e;
}
/*
* -1 means it's not a ParseException. Maybe IOException thrown when
* an error occured while reading internal data.
*/
throw new ParseException(e.getMessage(), -1);
}
}
/**
* Obtains a <code>CollationElementIterator</code> for the given
* <code>CharacterIterator</code>. The source iterator's integrity will
* be preserved since a new copy will be created for use.
*
* @param source
* the specified source
* @return a <code>CollationElementIterator</code> for the source.
*/
public CollationElementIterator getCollationElementIterator(
CharacterIterator source) {
if (source == null) {
throw new NullPointerException();
}
return new CollationElementIterator(
((com.ibm.icu.text.RuleBasedCollator) this.icuColl)
.getCollationElementIterator(source));
}
/**
* Obtains a <code>CollationElementIterator</code> for the given String.
*
* @param source
* the specified source
* @return a <code>CollationElementIterator</code> for the given String
*/
public CollationElementIterator getCollationElementIterator(String source) {
if (source == null) {
throw new NullPointerException();
}
return new CollationElementIterator(
((com.ibm.icu.text.RuleBasedCollator) this.icuColl)
.getCollationElementIterator(source));
}
/**
* Obtains the collation rules of the <code>RuleBasedCollator</code>.
*
* @return the collation rules.
*/
public String getRules() {
return ((com.ibm.icu.text.RuleBasedCollator) this.icuColl).getRules();
}
/**
* Obtains the cloned object of the <code>RuleBasedCollator</code>
*
* @return the cloned object of the <code>RuleBasedCollator</code>
*/
@Override
public Object clone() {
RuleBasedCollator clone = (RuleBasedCollator) super.clone();
return clone;
}
/**
* Compares the <code>source</code> text <code>String</code> to the
* <code>target</code> text <code>String</code> according to the
* collation rules, strength and decomposition mode for this
* <code>RuleBasedCollator</code>. See the <code>Collator</code> class
* description for an example of use.
* <p>
* General recommendation: If comparisons are to be done to the same String
* multiple times, it would be more efficient to generate
* <code>CollationKeys</code> for the <code>String</code> s and use
* <code>CollationKey.compareTo(CollationKey)</code> for the comparisons.
* If the each Strings are compared to only once, using the method
* RuleBasedCollator.compare(String, String) will have a better performance.
* </p>
*
* @param source
* the source text
* @param target
* the target text
* @return an integer which may be a negative value, zero, or else a
* positive value depending on whether <code>source</code> is less
* than, equivalent to, or greater than <code>target</code>.
*/
@Override
public int compare(String source, String target) {
if (source == null || target == null) {
// text.08=one of arguments is null
throw new NullPointerException(Messages.getString("text.08")); //$NON-NLS-1$
}
return this.icuColl.compare(source, target);
}
/**
* Obtains the <code>CollationKey</code> for the given source text.
*
* @param source
* the specified source text
* @return the <code>CollationKey</code> for the given source text.
*/
@Override
public CollationKey getCollationKey(String source) {
com.ibm.icu.text.CollationKey icuKey = this.icuColl
.getCollationKey(source);
if (icuKey == null) {
return null;
}
return new CollationKey(source, icuKey);
}
/**
* Obtains a unique hash code for the <code>RuleBasedCollator</code>
*
* @return the hash code for the <code>RuleBasedCollator</code>
*/
@Override
public int hashCode() {
return ((com.ibm.icu.text.RuleBasedCollator) this.icuColl).getRules()
.hashCode();
}
/**
* Compares the equality of two <code>RuleBasedCollator</code> objects.
* <code>RuleBasedCollator</code> objects are equal if they have the same
* collation rules and the same attributes.
*
* @param obj
* the other object.
* @return <code>true</code> if this <code>RuleBasedCollator</code> has
* exactly the same collation behaviour as obj, <code>false</code>
* otherwise.
*/
@Override
public boolean equals(Object obj) {
if (!(obj instanceof Collator)) {
return false;
}
return super.equals(obj);
}
}
|
{
"content_hash": "1e972ea0f40ab8c529e7c58d07ccaaee",
"timestamp": "",
"source": "github",
"line_count": 199,
"max_line_length": 88,
"avg_line_length": 36.18090452261306,
"alnum_prop": 0.6215277777777778,
"repo_name": "freeVM/freeVM",
"id": "b53cb65fd68b35a13d6bef47137e04c0edc6ecbc",
"size": "8004",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "enhanced/archive/classlib/java6/modules/text/src/main/java/java/text/RuleBasedCollator.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Assembly",
"bytes": "116828"
},
{
"name": "C",
"bytes": "17860389"
},
{
"name": "C++",
"bytes": "19007206"
},
{
"name": "CSS",
"bytes": "217777"
},
{
"name": "Java",
"bytes": "152108632"
},
{
"name": "Objective-C",
"bytes": "106412"
},
{
"name": "Objective-J",
"bytes": "11029421"
},
{
"name": "Perl",
"bytes": "305690"
},
{
"name": "Scilab",
"bytes": "34"
},
{
"name": "Shell",
"bytes": "153821"
},
{
"name": "XSLT",
"bytes": "152859"
}
],
"symlink_target": ""
}
|
#!/usr/bin/env node
'use strict';
/*
Taken from https://github.com/tapio/live-server for modification
*/
var fs = require('fs'),
connect = require('connect'),
serveIndex = require('serve-index'),
logger = require('morgan'),
WebSocket = require('faye-websocket'),
path = require('path'),
url = require('url'),
http = require('http'),
send = require('send'),
open = require('opn'),
es = require("event-stream"),
os = require('os'),
chokidar = require('chokidar'),
httpProxy = require('http-proxy');
require('colors');
let useBrowserExtension = false;
let GET_INJECTED_CODE = () => {
if (!GET_INJECTED_CODE.cache){
GET_INJECTED_CODE.cache = fs.readFileSync(path.join(__dirname, "injected.html"), "utf8");
}
return useBrowserExtension === true ? '' : GET_INJECTED_CODE.cache;
}
var LiveServer = {
server: null,
watcher: null,
logLevel: 2
};
function escape(html) {
return String(html)
.replace(/&(?!\w+;)/g, '&')
.replace(/</g, '<')
.replace(/>/g, '>')
.replace(/"/g, '"');
}
// Based on connect.static(), but streamlined and with added code injecter
function staticServer(root, onTagMissedCallback) {
var isFile = false;
try { // For supporting mounting files instead of just directories
isFile = fs.statSync(root).isFile();
} catch (e) {
if (e.code !== "ENOENT") throw e;
}
return function (req, res, next) {
if (req.method !== "GET" && req.method !== "HEAD") return next();
var reqpath = isFile ? "" : url.parse(req.url).pathname;
var hasNoOrigin = !req.headers.origin;
var injectCandidates = [
new RegExp("</body>", "i"),
new RegExp("</svg>"),
new RegExp("</head>", "i")
];
// extraInjectCandidates = extraInjectCandidates || [];
// extraInjectCandidates.forEach(item => {
// injectCandidates.push(new RegExp(`</${item}>`, "i"))
// });
var injectTag = null;
function directory() {
var pathname = url.parse(req.originalUrl).pathname;
res.statusCode = 301;
res.setHeader('Location', pathname + '/');
res.end('Redirecting to ' + escape(pathname) + '/');
}
function file(filepath /*, stat*/) {
var x = path.extname(filepath).toLocaleLowerCase(),
match,
possibleExtensions = ["", ".html", ".htm", ".xhtml", ".php", ".svg"];
if (hasNoOrigin && (possibleExtensions.indexOf(x) > -1)) {
// TODO: Sync file read here is not nice, but we need to determine if the html should be injected or not
var contents = fs.readFileSync(filepath, "utf8");
for (var i = 0; i < injectCandidates.length; ++i) {
match = injectCandidates[i].exec(contents);
if (match) {
injectTag = match[0];
break;
}
}
if (!injectTag && onTagMissedCallback) {
onTagMissedCallback();
}
if (injectTag === null && LiveServer.logLevel >= 3) {
console.warn("Failed to inject refresh script!".yellow,
"Couldn't find any of the tags ", injectCandidates, "from", filepath);
}
}
}
function error(err) {
if (err.status === 404) return next();
next(err);
}
function inject(stream) {
if (injectTag) {
// We need to modify the length given to browser
var len = GET_INJECTED_CODE().length + res.getHeader('Content-Length');
res.setHeader('Content-Length', len);
var originalPipe = stream.pipe;
stream.pipe = function (resp) {
originalPipe.call(stream, es.replace(new RegExp(injectTag, "i"), GET_INJECTED_CODE() + injectTag))
.pipe(resp);
};
}
}
send(req, reqpath, {
root: root
})
.on('error', error)
.on('directory', directory)
.on('file', file)
.on('stream', inject)
.pipe(res);
};
}
/**
* Rewrite request URL and pass it back to the static handler.
* @param staticHandler {function} Next handler
* @param file {string} Path to the entry point file
*/
function entryPoint(staticHandler, file) {
if (!file) return function (req, res, next) {
next();
};
return function (req, res, next) {
req.url = "/" + file;
staticHandler(req, res, next);
};
}
/**
* Start a live server with parameters given as an object
* @param host {string} Address to bind to (default: 0.0.0.0)
* @param port {number} Port number (default: 8080)
* @param root {string} Path to root directory (default: cwd)
* @param watch {array} Paths to exclusively watch for changes
* @param ignore {array} Paths to ignore when watching files for changes
* @param ignorePattern {regexp} Ignore files by RegExp
* @param open {(string|string[])} Subpath(s) to open in browser, use false to suppress launch (default: server root)
* @param mount {array} Mount directories onto a route, e.g. [['/components', './node_modules']].
* @param logLevel {number} 0 = errors only, 1 = some, 2 = lots
* @param file {string} Path to the entry point file
* @param wait {number} Server will wait for all changes, before reloading
* @param htpasswd {string} Path to htpasswd file to enable HTTP Basic authentication
* @param middleware {array} Append middleware to stack, e.g. [function(req, res, next) { next(); }].
*/
LiveServer.start = function (options, callback) {
options = options || {};
var host = options.host || '0.0.0.0';
var port = options.port !== undefined ? options.port : 8080; // 0 means random
var root = options.root || process.cwd();
var mount = options.mount || [];
var watchPaths = options.watch || [root];
LiveServer.logLevel = options.logLevel === undefined ? 2 : options.logLevel;
var openPath = (options.open === undefined || options.open === true) ?
"" : ((options.open === null || options.open === false) ? null : options.open);
if (options.noBrowser) openPath = null; // Backwards compatibility with 0.7.0
var file = options.file;
var wait = options.wait === undefined ? 100 : options.wait;
var browser = options.browser || null;
var htpasswd = options.htpasswd || null;
var cors = options.cors || false;
var https = options.https || null;
var proxy = options.proxy || [];
var middleware = options.middleware || [];
/*new*/
useBrowserExtension = options.useBrowserExtension || false; //global scope
// var addtionalHTMLtags = options.addtionalHTMLtags || []; //dropped the feature
var disableGlobbing = options.disableGlobbing || false;
var onTagMissedCallback = options.onTagMissedCallback || null;
var fullReload = options.fullReload || false;
var staticServerHandler = staticServer(root, onTagMissedCallback);
// Setup a web server
var app = connect();
// Add logger. Level 2 logs only errors
if (LiveServer.logLevel === 2) {
app.use(logger('dev', {
skip: function (req, res) {
return res.statusCode < 400;
}
}));
// Level 2 or above logs all requests
} else if (LiveServer.logLevel > 2) {
app.use(logger('dev'));
}
if (options.spa) {
middleware.push("spa");
}
// Add middleware
middleware.map(function (mw) {
if (typeof mw === "string") {
var ext = path.extname(mw).toLocaleLowerCase();
if (ext !== ".js") {
mw = require(path.join(__dirname, "middleware", mw + ".js"));
} else {
mw = require(mw);
}
}
app.use(mw);
});
// Use http-auth if configured
if (htpasswd !== null) {
var auth = require('http-auth');
var basic = auth.basic({
realm: "Please authorize",
file: htpasswd
});
app.use(auth.connect(basic));
}
if (cors) {
app.use(require("cors")({
origin: true, // reflecting request origin
credentials: true // allowing requests with credentials
}));
}
mount.forEach(function (mountRule) {
var mountPath = path.resolve(process.cwd(), mountRule[1]);
if (!options.watch) // Auto add mount paths to wathing but only if exclusive path option is not given
watchPaths.push(mountPath);
app.use(mountRule[0], staticServer(mountPath, staticServer, onTagMissedCallback));
if (LiveServer.logLevel >= 1)
console.log('Mapping %s to "%s"', mountRule[0], mountPath);
});
proxy.forEach(function (proxyRule) {
var proxyOpts = url.parse(proxyRule[1]);
proxyOpts.via = true;
proxyOpts.preserveHost = true;
app.use(proxyRule[0], require('proxy-middleware')(proxyOpts));
if (LiveServer.logLevel >= 1)
console.log('Mapping %s to "%s"', proxyRule[0], proxyRule[1]);
});
app.use(staticServerHandler) // Custom static server
.use(entryPoint(staticServerHandler, file))
.use(serveIndex(root, {
icons: true
}));
var server, protocol;
if (https !== null) {
var httpsConfig = https;
if (typeof https === "string") {
httpsConfig = require(path.resolve(process.cwd(), https));
}
server = require("https").createServer(httpsConfig, app);
protocol = "https";
} else {
server = http.createServer(app);
protocol = "http";
}
// Handle server startup errors
server.addListener('error', function (e) {
// if (e.code === 'EADDRINUSE') {
// var serveURL = protocol + '://' + host + ':' + port;
// console.log('%s is already in use. Trying another port.'.yellow, serveURL);
// setTimeout(function () {
// server.listen(0, host);
// }, 1000);
// } else {
console.error(e.toString().red);
LiveServer.shutdown();
//reject(e);
//throw e;
// }
});
// Handle successful server
server.addListener('listening', function ( /*e*/) {
LiveServer.server = server;
var address = server.address();
var serveHost = address.address === "0.0.0.0" ? "127.0.0.1" : address.address;
var openHost = host === "0.0.0.0" ? "127.0.0.1" : host;
var serveURL = protocol + '://' + serveHost + ':' + address.port;
var openURL = protocol + '://' + openHost + ':' + address.port;
var serveURLs = [serveURL];
if (LiveServer.logLevel > 2 && address.address === "0.0.0.0") {
var ifaces = os.networkInterfaces();
serveURLs = Object.keys(ifaces)
.map(function (iface) {
return ifaces[iface];
})
// flatten address data, use only IPv4
.reduce(function (data, addresses) {
addresses.filter(function (addr) {
return addr.family === "IPv4";
}).forEach(function (addr) {
data.push(addr);
});
return data;
}, [])
.map(function (addr) {
return protocol + "://" + addr.address + ":" + address.port;
});
}
// Output
if (LiveServer.logLevel >= 1) {
if (serveURL === openURL)
if (serveURLs.length === 1) {
console.log(("Serving \"%s\" at %s").green, root, serveURLs[0]);
} else {
console.log(("Serving \"%s\" at\n\t%s").green, root, serveURLs.join("\n\t"));
}
else
console.log(("Serving \"%s\" at %s (%s)").green, root, openURL, serveURL);
}
// Launch browser
if (openPath !== null)
if (typeof openPath === "object") {
openPath.forEach(function (p) {
open(openURL + p, {
app: browser
});
});
} else {
open(openURL + openPath, {
app: browser
});
}
});
// Setup server to listen at port
server.listen(port, host);
// WebSocket
var clients = [];
server.addListener('upgrade', function (request, socket, head) {
if (!request.url.endsWith("/ws")) {
let proxyURL = url.parse(proxy[0][1])
new httpProxy.createProxyServer({
target: {
host: proxyURL.host
},
secure: false
}).ws(request, socket, head);
return;
}
var ws = new WebSocket(request, socket, head);
ws.onopen = function () {
ws.send('connected');
};
if (wait > 0) {
(function () {
var wssend = ws.send;
var waitTimeout;
ws.send = function () {
var args = arguments;
if (waitTimeout) clearTimeout(waitTimeout);
waitTimeout = setTimeout(function () {
wssend.apply(ws, args);
}, wait);
};
})();
}
ws.onclose = function () {
clients = clients.filter(function (x) {
return x !== ws;
});
};
clients.push(ws);
});
var ignored = [
function (testPath) { // Always ignore dotfiles (important e.g. because editor hidden temp files)
return testPath !== "." && /(^[.#]|(?:__|~)$)/.test(path.basename(testPath));
},
"**/node_modules/**"
];
if (options.ignore) {
ignored = ignored.concat(options.ignore);
}
if (options.ignorePattern) {
ignored.push(options.ignorePattern);
}
// Setup file watcher
LiveServer.watcher = chokidar.watch(watchPaths, {
ignored: ignored,
ignoreInitial: true,
disableGlobbing: disableGlobbing
});
function handleChange(changePath) {
var cssChange = path.extname(changePath) === ".css";
if (LiveServer.logLevel >= 1) {
if (cssChange)
console.log("CSS change detected".magenta, changePath);
else console.log("Change detected".cyan, changePath);
}
clients.forEach(function (ws) {
if (ws)
ws.send((cssChange && !fullReload) ? 'refreshcss' : 'reload');
});
}
//return server;
LiveServer.watcher
.on("change", handleChange)
.on("add", handleChange)
.on("unlink", handleChange)
.on("addDir", handleChange)
.on("unlinkDir", handleChange)
.on("ready", function () {
if (LiveServer.logLevel >= 1)
console.log("Ready for changes".cyan);
if (callback) {
callback();
}
})
.on("error", function (err) {
console.log("ERROR:".red, err);
});
return server;
};
LiveServer.shutdown = function () {
var watcher = LiveServer.watcher;
if (watcher) {
watcher.close();
}
var server = LiveServer.server;
if (server)
server.close();
};
module.exports = LiveServer;
|
{
"content_hash": "73f8ae1fd6841e3c927548f70001ae93",
"timestamp": "",
"source": "github",
"line_count": 466,
"max_line_length": 117,
"avg_line_length": 28.321888412017167,
"alnum_prop": 0.6330504621912411,
"repo_name": "ritwickdey/vscode-live-server",
"id": "2bf73317e1943b14a3d69c6850795a4e4cd88fe1",
"size": "13198",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "lib/live-server/index.js",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "HTML",
"bytes": "1493"
},
{
"name": "JavaScript",
"bytes": "13198"
},
{
"name": "TypeScript",
"bytes": "50440"
}
],
"symlink_target": ""
}
|
package com.abina.poi;
/**
* @author abina
* @Data 2018-03-08
*/
public class WordUtil {
/**
* @方法名称 exportCtrAtch
* @功能描述 <pre>生成合同附件</pre>
* @作者 zouyaobin@tansun.com.cn
* @创建时间 2018年3月7日 上午9:32:47
* @param params
* @param response
* @throws FileNotFoundException
* @throws IOException
*/
@RequestMapping(value="/exportCtrAtch")
public void exportCtrAtch(QueryCtrVO queryVo, HttpServletResponse response) {
//1.查询数据,拼装替换 Map,
Map<String, Object> ctrInfMap = ctrApi.getCtrInfMap(queryVo);
if (CollectionUtil.isEmpty(ctrInfMap)) {
return;
}
Map<String, String> mappingMap = buildMappingMap(ctrInfMap);
String templateFileName = templateFileName(ctrInfMap);
//2.获取文档路径
StringBuffer sbPath = new StringBuffer();
sbPath.append(this.getRequest().getSession().getServletContext().getRealPath("/"));
sbPath.append(File.separator).append("static").append(File.separator).append("template").append(File.separator).append("ctr").append(File.separator);
File tempFile = null;
try {
//3.替换文档内容,并创建临时文件写入
XWPFDocument document = replaceWord(sbPath.toString() + templateFileName, mappingMap);
tempFile = FileUtil.createTempFile(new File(sbPath.toString()));
OutputStream os = new FileOutputStream(tempFile);
document.write(os);
os.close();
//4.读取临时文件,并生成新文档
InputStream tempIs = new FileInputStream(tempFile);
String agent = getRequest().getHeader("User-Agent");
boolean isMSIE = (agent != null && agent.indexOf("MSIE") != -1);
if (isMSIE) {
templateFileName = URLEncoder.encode(templateFileName, "UTF-8");
} else {
templateFileName = new String(templateFileName.getBytes("UTF-8"), "ISO-8859-1");
}
response.reset();
response.setContentType("application/vnd.ms-word;charset=UTF-8");
response.setHeader("Content-Disposition","attachment; filename=" + templateFileName);
response.setHeader("Content-Length", tempFile.length() + "");
ServletOutputStream out = response.getOutputStream();
byte[] b=new byte[1024];
int len;
while((len = tempIs.read(b))!=-1){
out.write(b, 0, len);
}
tempIs.close();
out.close();
} catch (IORuntimeException e) {
e.printStackTrace();
} catch (FileNotFoundException e) {
e.printStackTrace();
} catch (UnsupportedEncodingException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
} finally {
if(tempFile != null) {
tempFile.delete();
}
}
}
/**
* @方法名称 buildMappingMap
* @功能描述 <pre>构建映射替换集合对象,格式:${ctrId} => ctrId </pre>
* @作者 zouyaobin@tansun.com.cn
* @创建时间 2018年3月8日 上午10:01:57
* @param ctrInf
* @return
*/
public Map<String, String> buildMappingMap(Map<String, Object> ctrInf) {
Map<String, String> replaceMap = new HashMap<String, String>();
//合同基础信息
replaceMap.put("${ctrId}", MapUtils.getString(ctrInf, "ctrId", ""));
replaceMap.put("${cstNm}", MapUtils.getString(ctrInf, "cstNm", ""));
//合同客户信息 = 债权人
Map<String, Object> cstQueryParams = new HashMap<String, Object>();
cstQueryParams.put("cstId", MapUtils.getString(ctrInf, "cstId"));
Map<String, Object> cstBscInf = customerApi.getBizCstBscInfByParams(cstQueryParams);
replaceMap.put("${rgstAdr}", MapUtils.getString(cstBscInf, "rgstAdr", ""));
replaceMap.put("${ctcPsn}", MapUtils.getString(ctrInf, "ctcPsn", ""));
replaceMap.put("${ctcPsnTel}", MapUtils.getString(ctrInf, "ctcPsnTel", ""));
replaceMap.put("${email}", MapUtils.getString(ctrInf, "email", ""));
//债务人信息
QueryCtrVO oblgVo = new QueryCtrVO();
oblgVo.setCtrSn(MapUtil.getString(ctrInf, "ctrSn"));
Map<String, Object> rltvOblgMap = ctrApi.getRltvOblgMap(oblgVo);
replaceMap.put("${oblgCstNm}", MapUtils.getString(rltvOblgMap, "cstNm", ""));
// replaceMap.put("XX商业", ""); TODO
return replaceMap;
}
/**
* @方法名称 templateFileName
* @功能描述 <pre>获取模板文档名称</pre>
* @作者 zouyaobin@tansun.com.cn
* @创建时间 2018年3月8日 上午9:56:00
* @param ctrInfMap
* @return
*/
private static String templateFileName(Map<String, Object> ctrInfMap) {
String tempFileName = "应收账款转让合同.docx";
String pdId = MapUtil.getString(ctrInfMap, "pdId");
if (DictUtil.getDictValue("ProNm", "ProNm_0").equals(pdId)) { //应收账款
tempFileName = "应收账款转让合同.docx"; //TODO
}
if (DictUtil.getDictValue("ProNm", "ProNm_1").equals(pdId)) { //销售回购
tempFileName = "应收账款转让合同.docx";
}
if (DictUtil.getDictValue("ProNm", "ProNm_2").equals(pdId)) { //代理采购
tempFileName = "应收账款转让合同.docx"; //TODO
}
return tempFileName;
}
/**
* @方法名称 replaceWord
* @功能描述 <pre>替换 word 文档中的指定字符</pre>
* @作者 zouyaobin@tansun.com.cn
* @创建时间 2018年3月8日 上午9:38:22
* @param filePath 读取模板文件地址(含文件名)
* @param replaceMap 替换的新旧值 Map
* @return word 文档对象
* @throws IOException
*/
public static XWPFDocument replaceWord(String filePath, Map<String, String> replaceMap) throws IOException {
XWPFDocument document = new XWPFDocument(POIXMLDocument.openPackage(filePath));
Iterator<XWPFParagraph> itPara = document.getParagraphsIterator();
int idx = 0;
while (itPara.hasNext()) {
XWPFParagraph paragraph = (XWPFParagraph) itPara.next();
int size = paragraph.getRuns().size();
if (size == 0) {
continue;
}
String paragraphText = StringUtils.join(paragraph.getRuns().toArray());
//存在标识,才替换
if (paragraphText.contains("$")) {
for (Map.Entry<String, String> entry : replaceMap.entrySet()) {
paragraphText = paragraphText.replace(entry.getKey(), entry.getValue());
}
for (int i = (size - 1); i >= 0; i--) {
paragraph.removeRun(i);
}
XWPFRun newRun = paragraph.insertNewRun(0);
newRun.setText(paragraphText, 0);
newRun.setFontFamily("宋体");
if (idx == 0) {
newRun.setFontSize(12);
} else {
newRun.setFontSize(14);
}
idx ++ ;
}
}
return document;
}
}
|
{
"content_hash": "a4bf8f6ec02780285916beb4ec512c50",
"timestamp": "",
"source": "github",
"line_count": 177,
"max_line_length": 151,
"avg_line_length": 34.01129943502825,
"alnum_prop": 0.6541528239202657,
"repo_name": "tzou24/abina-common-util",
"id": "37a1683bfcedf8c06fe383ec2aaf9cdb6bdcab30",
"size": "6532",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/com/abina/poi/WordUtil.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "FreeMarker",
"bytes": "398"
},
{
"name": "HTML",
"bytes": "2091"
},
{
"name": "Java",
"bytes": "167052"
},
{
"name": "JavaScript",
"bytes": "750"
}
],
"symlink_target": ""
}
|
<?php
/**
* @file
* Definition of Drupal\Core\DrupalKernelInterface.
*/
namespace Drupal\Core;
use Symfony\Component\HttpKernel\HttpKernelInterface;
/**
* The interface for DrupalKernel, the core of Drupal.
*
* This interface extends Symfony's KernelInterface and adds methods for
* responding to modules being enabled or disabled during its lifetime.
*/
interface DrupalKernelInterface extends HttpKernelInterface, \Serializable {
/**
* Boots the current kernel.
*/
public function boot();
/**
* Shuts down the kernel.
*/
public function shutdown();
/**
* Discovers available serviceProviders.
*
* @return array
* The available serviceProviders.
*/
public function discoverServiceProviders();
/**
* Returns all registered service providers.
*
* @return array
* An associative array of ServiceProvider objects, keyed by name.
*/
public function getServiceProviders();
/**
* Gets the current container.
*
* @return ContainerInterface A ContainerInterface instance
*/
public function getContainer();
/**
* Updates the kernel's list of modules to the new list.
*
* The kernel needs to update its bundle list and container to match the new
* list.
*
* @param array $module_list
* The new list of modules.
* @param array $module_filenames
* List of module filenames, keyed by module name.
*/
public function updateModules(array $module_list, array $module_filenames = array());
}
|
{
"content_hash": "86e7e2f19d164809dad8419f9e5f752d",
"timestamp": "",
"source": "github",
"line_count": 65,
"max_line_length": 87,
"avg_line_length": 23.215384615384615,
"alnum_prop": 0.6911862160371107,
"repo_name": "nickopris/musicapp",
"id": "96b2f922ea12975a71d614c116d324c342f857ee",
"size": "1509",
"binary": false,
"copies": "5",
"ref": "refs/heads/master",
"path": "www/core/lib/Drupal/Core/DrupalKernelInterface.php",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "263467"
},
{
"name": "JavaScript",
"bytes": "665433"
},
{
"name": "PHP",
"bytes": "14580545"
},
{
"name": "Shell",
"bytes": "61500"
}
],
"symlink_target": ""
}
|
package DataObjects;
/**
*
* @author Noah Fujioka
*/
import DatabaseUtilities.DatabaseDataObjectUtilities;
public class FlightSummary {
private String startTimestamp;
private String pilotId;
private String pilotFirstName;
private String pilotLastName;
private String gliderNnumber;
public FlightSummary(String startTimestamp, String pilotId,
String pilotFirstName, String pilotLastName, String gliderNnumber){
this.startTimestamp = startTimestamp;
this.pilotId = pilotId;
this.pilotFirstName = pilotFirstName;
this.pilotLastName = pilotLastName;
this.gliderNnumber = gliderNnumber;
}
public String toString(){
return startTimestamp + ", " + pilotFirstName + " " + pilotLastName +
", " + gliderNnumber;
}
public void setCurrentDataObjectSet(){
try{
DatabaseDataObjectUtilities.setCurrentDataObjectSetToFlight(this);
}catch(Exception e){
System.out.println("Error 404: Flight not found");
//e.printStackTrace();
}
}
public String getStartTimestamp(){
return startTimestamp;
}
public String getPilotId(){
return pilotId;
}
}
|
{
"content_hash": "e6e690e9e7525b959163dd35a51b836b",
"timestamp": "",
"source": "github",
"line_count": 47,
"max_line_length": 79,
"avg_line_length": 28.361702127659573,
"alnum_prop": 0.6136534133533383,
"repo_name": "GliderWinchCommons/hc",
"id": "7b5ce145cf8da5eeb5ff73ea2176e1e43636bb79",
"size": "1333",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/DataObjects/FlightSummary.java",
"mode": "33188",
"license": "bsd-2-clause",
"language": [
{
"name": "Java",
"bytes": "910792"
}
],
"symlink_target": ""
}
|
import { deepMerge } from "../utils/object";
export default class Config {
constructor() {
if (!Config.instance) {
Config.instance = this;
}
return Config.instance;
}
get OVERHEAD() {
return {
"TCP+IPv4+ETH": 1500 / (1500 - (20 + 20 + 14)),
"TCP+IPv6+ETH": 1500 / (1500 - (20 + 40 + 14))
};
}
get defaultConfig() {
return {
ignoreErrors: true,
optimize: false,
endpoint: this.endpointDefaultConfig,
overheadCompensation: this.OVERHEAD["TCP+IPv4+ETH"],
connections: "multi",
ip: this.ipDefaultConfig,
latency: this.latencyDefaultConfig,
download: this.downloadDefaultConfig,
upload: this.uploadDefaultConfig,
result: this.resultDefaultConfig
};
}
get endpointDefaultConfig() {
return {
host: self.location.host,
isSecure: self.location.protocol === "https:"
};
}
get ipDefaultConfig() {
return {
path: "ip"
};
}
get latencyDefaultConfig() {
return {
path: "ping",
count: null,
delay: 0,
duration: 5000,
gracetime: 1000
};
}
get downloadDefaultConfig() {
return {
path: "download",
streams: 6,
delay: 200,
duration: 10000,
gracetime: 2000,
size: 8 * 1024 ** 2,
adjustSize: true,
minSize: 1 * 1024 ** 2,
maxSize: 100 * 1024 ** 2,
minDuration: 1000,
maxDuration: 5000,
responseType: "arraybuffer" // "arraybuffer" or "blob"
};
}
get uploadDefaultConfig() {
return {
path: "upload",
streams: 6,
delay: 200,
duration: 10000,
gracetime: 2000,
size: 20 * 1024 ** 2,
adjustSize: true,
minSize: 256 * 1024,
maxSize: 20 * 1024 ** 2,
minDuration: 1000,
maxDuration: 5000
};
}
get resultDefaultConfig() {
return {
path: "/save"
};
}
load() {
return new Promise((resolve, reject) => {
const xhr = new XMLHttpRequest();
xhr.open("GET", "/config.json", true);
xhr.addEventListener("load", () => {
const config = deepMerge(this.defaultConfig, JSON.parse(xhr.response));
resolve(config);
});
xhr.addEventListener("error", () => reject("Could not load configuration file (config.json)"));
xhr.send();
});
}
static getEndpointUri(endpoint, type) {
return `${type === "websocket" ? "ws" : "http"}${endpoint.isSecure ? "s" : ""}://${endpoint.host}`;
}
}
|
{
"content_hash": "292148b9a42cf57d90b01301a8b73c54",
"timestamp": "",
"source": "github",
"line_count": 112,
"max_line_length": 103,
"avg_line_length": 22.303571428571427,
"alnum_prop": 0.5608486789431545,
"repo_name": "e7d/speedtest",
"id": "fe6b3a6f2c951f200104392d3956b66a0da87d6d",
"size": "2498",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "packages/web/src/js/worker/config.js",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Dockerfile",
"bytes": "750"
},
{
"name": "HTML",
"bytes": "10689"
},
{
"name": "JavaScript",
"bytes": "89503"
},
{
"name": "SCSS",
"bytes": "15256"
}
],
"symlink_target": ""
}
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.