text
stringlengths 2
1.04M
| meta
dict |
|---|---|
class Triangle:
def __init__(self, vertices):
self.vertices = vertices
def subdivide(self):
pass
def to_ascii_stl(self):
return "facet normal 0 0 0\n\touter loop\n\t\tvertex {0}\n" \
"\t\tvertex {3}\n\t\tvertex {6}\n\tendloop"\
"endfacet".format(self.vertices[0], self.vertices[1],
self.vertices[2])
|
{
"content_hash": "cd65d4378ab45630db5832adc893bf6c",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 69,
"avg_line_length": 31.615384615384617,
"alnum_prop": 0.5158150851581509,
"repo_name": "gehrman/fractaler",
"id": "6f808c187260ea4f84327c7746e8ca2b2fa91ce4",
"size": "411",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "frac1.py",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Python",
"bytes": "7933"
}
],
"symlink_target": ""
}
|
<!doctype html>
<html>
<title>npm-explore</title>
<meta http-equiv="content-type" value="text/html;utf-8">
<link rel="stylesheet" type="text/css" href="../../static/style.css">
<link rel="canonical" href="https://www.npmjs.org/doc/cli/npm-explore.html">
<script async=true src="../../static/toc.js"></script>
<body>
<div id="wrapper">
<h1><a href="../cli/npm-explore.html">npm-explore</a></h1> <p>Browse an installed package</p>
<h2 id="synopsis">SYNOPSIS</h2>
<pre><code>npm explore <name> [ -- <cmd>]
</code></pre><h2 id="description">DESCRIPTION</h2>
<p>Spawn a subshell in the directory of the installed package specified.</p>
<p>If a command is specified, then it is run in the subshell, which then
immediately terminates.</p>
<p>This is particularly handy in the case of git submodules in the
<code>node_modules</code> folder:</p>
<pre><code>npm explore some-dependency -- git pull origin master
</code></pre><p>Note that the package is <em>not</em> automatically rebuilt afterwards, so be
sure to use <code>npm rebuild <pkg></code> if you make any changes.</p>
<h2 id="configuration">CONFIGURATION</h2>
<h3 id="shell">shell</h3>
<ul>
<li>Default: SHELL environment variable, or "bash" on Posix, or "cmd" on
Windows</li>
<li>Type: path</li>
</ul>
<p>The shell to run for the <code>npm explore</code> command.</p>
<h2 id="see-also">SEE ALSO</h2>
<ul>
<li><a href="../files/npm-folders.html"><a href="../files/npm-folders.html">npm-folders(5)</a></a></li>
<li><a href="../cli/npm-edit.html"><a href="../cli/npm-edit.html">npm-edit(1)</a></a></li>
<li><a href="../cli/npm-rebuild.html"><a href="../cli/npm-rebuild.html">npm-rebuild(1)</a></a></li>
<li><a href="../cli/npm-build.html"><a href="../cli/npm-build.html">npm-build(1)</a></a></li>
<li><a href="../cli/npm-install.html"><a href="../cli/npm-install.html">npm-install(1)</a></a></li>
</ul>
</div>
<table border=0 cellspacing=0 cellpadding=0 id=npmlogo>
<tr><td style="width:180px;height:10px;background:rgb(237,127,127)" colspan=18> </td></tr>
<tr><td rowspan=4 style="width:10px;height:10px;background:rgb(237,127,127)"> </td><td style="width:40px;height:10px;background:#fff" colspan=4> </td><td style="width:10px;height:10px;background:rgb(237,127,127)" rowspan=4> </td><td style="width:40px;height:10px;background:#fff" colspan=4> </td><td rowspan=4 style="width:10px;height:10px;background:rgb(237,127,127)"> </td><td colspan=6 style="width:60px;height:10px;background:#fff"> </td><td style="width:10px;height:10px;background:rgb(237,127,127)" rowspan=4> </td></tr>
<tr><td colspan=2 style="width:20px;height:30px;background:#fff" rowspan=3> </td><td style="width:10px;height:10px;background:rgb(237,127,127)" rowspan=3> </td><td style="width:10px;height:10px;background:#fff" rowspan=3> </td><td style="width:20px;height:10px;background:#fff" rowspan=4 colspan=2> </td><td style="width:10px;height:20px;background:rgb(237,127,127)" rowspan=2> </td><td style="width:10px;height:10px;background:#fff" rowspan=3> </td><td style="width:20px;height:10px;background:#fff" rowspan=3 colspan=2> </td><td style="width:10px;height:10px;background:rgb(237,127,127)" rowspan=3> </td><td style="width:10px;height:10px;background:#fff" rowspan=3> </td><td style="width:10px;height:10px;background:rgb(237,127,127)" rowspan=3> </td></tr>
<tr><td style="width:10px;height:10px;background:#fff" rowspan=2> </td></tr>
<tr><td style="width:10px;height:10px;background:#fff"> </td></tr>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6> </td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)"> </td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff"> </td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4> </td><td style="width:90px;height:10px;background:#fff" colspan=9> </td></tr>
</table>
<p id="footer">npm-explore — npm@2.13.4</p>
|
{
"content_hash": "e0a8c57ffd396b20a2b1b126d573256b",
"timestamp": "",
"source": "github",
"line_count": 53,
"max_line_length": 807,
"avg_line_length": 76.77358490566037,
"alnum_prop": 0.6982059474072254,
"repo_name": "PyEatingContest/crispy-node",
"id": "357d7b6dcd73b00f22320df3937bff3f5deec7ca",
"size": "4069",
"binary": false,
"copies": "4",
"ref": "refs/heads/master",
"path": "node_modules/npm/html/doc/cli/npm-explore.html",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "JavaScript",
"bytes": "6417"
}
],
"symlink_target": ""
}
|
using System;
namespace Azure.ResourceManager.AppService.Models
{
internal static partial class DiagnosticSolutionTypeExtensions
{
public static string ToSerialString(this DiagnosticSolutionType value) => value switch
{
DiagnosticSolutionType.QuickSolution => "QuickSolution",
DiagnosticSolutionType.DeepInvestigation => "DeepInvestigation",
DiagnosticSolutionType.BestPractices => "BestPractices",
_ => throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown DiagnosticSolutionType value.")
};
public static DiagnosticSolutionType ToDiagnosticSolutionType(this string value)
{
if (string.Equals(value, "QuickSolution", StringComparison.InvariantCultureIgnoreCase)) return DiagnosticSolutionType.QuickSolution;
if (string.Equals(value, "DeepInvestigation", StringComparison.InvariantCultureIgnoreCase)) return DiagnosticSolutionType.DeepInvestigation;
if (string.Equals(value, "BestPractices", StringComparison.InvariantCultureIgnoreCase)) return DiagnosticSolutionType.BestPractices;
throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown DiagnosticSolutionType value.");
}
}
}
|
{
"content_hash": "ca3015a4e886491654033c93ed2e2fbb",
"timestamp": "",
"source": "github",
"line_count": 23,
"max_line_length": 152,
"avg_line_length": 54.95652173913044,
"alnum_prop": 0.740506329113924,
"repo_name": "Azure/azure-sdk-for-net",
"id": "c01946fb90f78ea7b3586669e9ab8146bbd33b77",
"size": "1402",
"binary": false,
"copies": "1",
"ref": "refs/heads/main",
"path": "sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/DiagnosticSolutionType.Serialization.cs",
"mode": "33188",
"license": "mit",
"language": [],
"symlink_target": ""
}
|
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>metacoq-checker: Not compatible</title>
<link rel="shortcut icon" type="image/png" href="../../../../../favicon.png" />
<link href="../../../../../bootstrap.min.css" rel="stylesheet">
<link href="../../../../../bootstrap-custom.css" rel="stylesheet">
<link href="//maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css" rel="stylesheet">
<script src="../../../../../moment.min.js"></script>
<!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
<!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
<![endif]-->
</head>
<body>
<div class="container">
<div class="navbar navbar-default" role="navigation">
<div class="container-fluid">
<div class="navbar-header">
<a class="navbar-brand" href="../../../../.."><i class="fa fa-lg fa-flag-checkered"></i> Coq bench</a>
</div>
<div id="navbar" class="collapse navbar-collapse">
<ul class="nav navbar-nav">
<li><a href="../..">clean / released</a></li>
<li class="active"><a href="">8.8.0 / metacoq-checker - 1.0~alpha2+8.10</a></li>
</ul>
</div>
</div>
</div>
<div class="article">
<div class="row">
<div class="col-md-12">
<a href="../..">« Up</a>
<h1>
metacoq-checker
<small>
1.0~alpha2+8.10
<span class="label label-info">Not compatible</span>
</small>
</h1>
<p><em><script>document.write(moment("2020-09-14 18:10:41 +0000", "YYYY-MM-DD HH:mm:ss Z").fromNow());</script> (2020-09-14 18:10:41 UTC)</em><p>
<h2>Context</h2>
<pre># Packages matching: installed
# Name # Installed # Synopsis
base-bigarray base
base-num base Num library distributed with the OCaml compiler
base-threads base
base-unix base
camlp5 7.13 Preprocessor-pretty-printer of OCaml
conf-findutils 1 Virtual package relying on findutils
conf-m4 1 Virtual package relying on m4
coq 8.8.0 Formal proof management system.
num 0 The Num library for arbitrary-precision integer and rational arithmetic
ocaml 4.05.0 The OCaml compiler (virtual package)
ocaml-base-compiler 4.05.0 Official 4.05.0 release
ocaml-config 1 OCaml Switch Configuration
ocamlfind 1.8.1 A library manager for OCaml
# opam file:
opam-version: "2.0"
maintainer: "matthieu.sozeau@inria.fr"
homepage: "https://metacoq.github.io/metacoq"
dev-repo: "git+https://github.com/MetaCoq/metacoq.git#coq-8.10"
bug-reports: "https://github.com/MetaCoq/metacoq/issues"
authors: ["Abhishek Anand <aa755@cs.cornell.edu>"
"Simon Boulier <simon.boulier@inria.fr>"
"Cyril Cohen <cyril.cohen@inria.fr>"
"Yannick Forster <forster@ps.uni-saarland.de>"
"Fabian Kunze <fkunze@fakusb.de>"
"Gregory Malecha <gmalecha@gmail.com>"
"Matthieu Sozeau <matthieu.sozeau@inria.fr>"
"Nicolas Tabareau <nicolas.tabareau@inria.fr>"
"Théo Winterhalter <theo.winterhalter@inria.fr>"
]
license: "MIT"
build: [
["sh" "./configure.sh"]
[make "-j%{jobs}%" "checker"]
]
install: [
[make "-C" "checker" "install"]
]
depends: [
"ocaml" {> "4.02.3"}
"coq" {>= "8.10" & < "8.11~"}
"coq-equations" { >= "1.2" }
"coq-metacoq-template" {= version}
]
synopsis: "Specification of Coq's type theory and reference checker implementation"
description: """
MetaCoq is a meta-programming framework for Coq.
The Checker module provides a complete specification of Coq's typing and conversion
relation along with a reference type-checker that is extracted to a pluging.
This provides a command: `MetaCoq Check [global_reference]` that can be used
to typecheck a Coq definition using the verified type-checker.
"""
# url {
# src: "https://github.com/MetaCoq/metacoq/archive/v2.1-beta3.tar.gz"
# checksum: "md5=e81b8ecabef788a10337a39b095d54f3"
# }
url {
src: "https://github.com/MetaCoq/metacoq/archive/v1.0-alpha2-8.10.tar.gz"
checksum: "sha256=94156cb9397b44915c9217a435a812cabc9651684cd229d5069b34332d0792a2"
}
</pre>
<h2>Lint</h2>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>true</code></dd>
<dt>Return code</dt>
<dd>0</dd>
</dl>
<h2>Dry install</h2>
<p>Dry install with the current Coq version:</p>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>opam install -y --show-action coq-metacoq-checker.1.0~alpha2+8.10 coq.8.8.0</code></dd>
<dt>Return code</dt>
<dd>5120</dd>
<dt>Output</dt>
<dd><pre>[NOTE] Package coq is already installed (current version is 8.8.0).
The following dependencies couldn't be met:
- coq-metacoq-checker -> coq-metacoq-template = 1.0~alpha2+8.10 -> coq >= 8.10
Your request can't be satisfied:
- No available version of coq satisfies the constraints
No solution found, exiting
</pre></dd>
</dl>
<p>Dry install without Coq/switch base, to test if the problem was incompatibility with the current Coq/OCaml version:</p>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>opam remove -y coq; opam install -y --show-action --unlock-base coq-metacoq-checker.1.0~alpha2+8.10</code></dd>
<dt>Return code</dt>
<dd>0</dd>
</dl>
<h2>Install dependencies</h2>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>true</code></dd>
<dt>Return code</dt>
<dd>0</dd>
<dt>Duration</dt>
<dd>0 s</dd>
</dl>
<h2>Install</h2>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>true</code></dd>
<dt>Return code</dt>
<dd>0</dd>
<dt>Duration</dt>
<dd>0 s</dd>
</dl>
<h2>Installation size</h2>
<p>No files were installed.</p>
<h2>Uninstall</h2>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>true</code></dd>
<dt>Return code</dt>
<dd>0</dd>
<dt>Missing removes</dt>
<dd>
none
</dd>
<dt>Wrong removes</dt>
<dd>
none
</dd>
</dl>
</div>
</div>
</div>
<hr/>
<div class="footer">
<p class="text-center">
<small>Sources are on <a href="https://github.com/coq-bench">GitHub</a>. © Guillaume Claret.</small>
</p>
</div>
</div>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<script src="../../../../../bootstrap.min.js"></script>
</body>
</html>
|
{
"content_hash": "3f1c5763b13ddf52f8e2c99d4869cdcf",
"timestamp": "",
"source": "github",
"line_count": 187,
"max_line_length": 157,
"avg_line_length": 43.080213903743314,
"alnum_prop": 0.5645481628599801,
"repo_name": "coq-bench/coq-bench.github.io",
"id": "2eaecb6835eb73ceeaa3d080f44a4bedd6a76c7a",
"size": "8059",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "clean/Linux-x86_64-4.05.0-2.0.6/released/8.8.0/metacoq-checker/1.0~alpha2+8.10.html",
"mode": "33188",
"license": "mit",
"language": [],
"symlink_target": ""
}
|
import { SlidingSync } from 'matrix-js-sdk/src/sliding-sync';
import { mocked } from 'jest-mock';
import { MatrixClient, MatrixEvent, Room } from 'matrix-js-sdk/src/matrix';
import { SlidingSyncManager } from '../src/SlidingSyncManager';
import { stubClient } from './test-utils';
jest.mock('matrix-js-sdk/src/sliding-sync');
const MockSlidingSync = <jest.Mock<SlidingSync>><unknown>SlidingSync;
describe('SlidingSyncManager', () => {
let manager: SlidingSyncManager;
let slidingSync: SlidingSync;
let client: MatrixClient;
beforeEach(() => {
slidingSync = new MockSlidingSync();
manager = new SlidingSyncManager();
client = stubClient();
// by default the client has no rooms: stubClient magically makes rooms annoyingly.
mocked(client.getRoom).mockReturnValue(null);
manager.configure(client, "invalid");
manager.slidingSync = slidingSync;
});
describe("setRoomVisible", () => {
it("adds a subscription for the room", async () => {
const roomId = "!room:id";
const subs = new Set<string>();
mocked(slidingSync.getRoomSubscriptions).mockReturnValue(subs);
mocked(slidingSync.modifyRoomSubscriptions).mockResolvedValue("yep");
await manager.setRoomVisible(roomId, true);
expect(slidingSync.modifyRoomSubscriptions).toBeCalledWith(new Set<string>([roomId]));
});
it("adds a custom subscription for a lazy-loadable room", async () => {
const roomId = "!lazy:id";
const room = new Room(roomId, client, client.getUserId());
room.getLiveTimeline().initialiseState([
new MatrixEvent({
type: "m.room.create",
state_key: "",
event_id: "$abc123",
sender: client.getUserId(),
content: {
creator: client.getUserId(),
},
}),
]);
mocked(client.getRoom).mockImplementation((r: string): Room => {
if (roomId === r) {
return room;
}
return null;
});
const subs = new Set<string>();
mocked(slidingSync.getRoomSubscriptions).mockReturnValue(subs);
mocked(slidingSync.modifyRoomSubscriptions).mockResolvedValue("yep");
await manager.setRoomVisible(roomId, true);
expect(slidingSync.modifyRoomSubscriptions).toBeCalledWith(new Set<string>([roomId]));
// we aren't prescriptive about what the sub name is.
expect(slidingSync.useCustomSubscription).toBeCalledWith(roomId, expect.anything());
});
});
describe("startSpidering", () => {
it("requests in batchSizes", async () => {
const gapMs = 1;
const batchSize = 10;
mocked(slidingSync.setList).mockResolvedValue("yep");
mocked(slidingSync.setListRanges).mockResolvedValue("yep");
mocked(slidingSync.getListData).mockImplementation((i) => {
return {
joinedCount: 64,
roomIndexToRoomId: {},
};
});
await manager.startSpidering(batchSize, gapMs);
// we expect calls for 10,19 -> 20,29 -> 30,39 -> 40,49 -> 50,59 -> 60,69
const wantWindows = [
[10, 19], [20, 29], [30, 39], [40, 49], [50, 59], [60, 69],
];
expect(slidingSync.getListData).toBeCalledTimes(wantWindows.length);
expect(slidingSync.setList).toBeCalledTimes(1);
expect(slidingSync.setListRanges).toBeCalledTimes(wantWindows.length-1);
wantWindows.forEach((range, i) => {
if (i === 0) {
expect(slidingSync.setList).toBeCalledWith(
manager.getOrAllocateListIndex(SlidingSyncManager.ListSearch),
expect.objectContaining({
ranges: [[0, batchSize-1], range],
}),
);
return;
}
expect(slidingSync.setListRanges).toBeCalledWith(
manager.getOrAllocateListIndex(SlidingSyncManager.ListSearch),
[[0, batchSize-1], range],
);
});
});
it("handles accounts with zero rooms", async () => {
const gapMs = 1;
const batchSize = 10;
mocked(slidingSync.setList).mockResolvedValue("yep");
mocked(slidingSync.getListData).mockImplementation((i) => {
return {
joinedCount: 0,
roomIndexToRoomId: {},
};
});
await manager.startSpidering(batchSize, gapMs);
expect(slidingSync.getListData).toBeCalledTimes(1);
expect(slidingSync.setList).toBeCalledTimes(1);
expect(slidingSync.setList).toBeCalledWith(
manager.getOrAllocateListIndex(SlidingSyncManager.ListSearch),
expect.objectContaining({
ranges: [[0, batchSize-1], [batchSize, batchSize+batchSize-1]],
}),
);
});
it("continues even when setList rejects", async () => {
const gapMs = 1;
const batchSize = 10;
mocked(slidingSync.setList).mockRejectedValue("narp");
mocked(slidingSync.getListData).mockImplementation((i) => {
return {
joinedCount: 0,
roomIndexToRoomId: {},
};
});
await manager.startSpidering(batchSize, gapMs);
expect(slidingSync.getListData).toBeCalledTimes(1);
expect(slidingSync.setList).toBeCalledTimes(1);
expect(slidingSync.setList).toBeCalledWith(
manager.getOrAllocateListIndex(SlidingSyncManager.ListSearch),
expect.objectContaining({
ranges: [[0, batchSize-1], [batchSize, batchSize+batchSize-1]],
}),
);
});
});
});
|
{
"content_hash": "b304d2fb5a44f8b09c42c249eb756dbc",
"timestamp": "",
"source": "github",
"line_count": 144,
"max_line_length": 98,
"avg_line_length": 43.46527777777778,
"alnum_prop": 0.5456143153858444,
"repo_name": "matrix-org/matrix-react-sdk",
"id": "b804a74456af298cd6e6900a2358c26a3fd8c275",
"size": "6837",
"binary": false,
"copies": "1",
"ref": "refs/heads/develop",
"path": "test/SlidingSyncManager-test.ts",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "984691"
},
{
"name": "Dockerfile",
"bytes": "1550"
},
{
"name": "HTML",
"bytes": "1043"
},
{
"name": "JavaScript",
"bytes": "33429"
},
{
"name": "Perl",
"bytes": "10945"
},
{
"name": "Python",
"bytes": "5019"
},
{
"name": "Shell",
"bytes": "5451"
},
{
"name": "TypeScript",
"bytes": "9543345"
}
],
"symlink_target": ""
}
|
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Blueprint: Responsive Full Width Tabs</title>
<meta name="description" content="Blueprint: Responsive Full Width Tabs" />
<meta name="keywords" content="responsive tabs, full width tabs, template, blueprint" />
<meta name="author" content="Codrops" />
<link rel="shortcut icon" href="../favicon.ico">
<link rel="stylesheet" type="text/css" href="css/demo.css" />
<link rel="stylesheet" type="text/css" href="css/component.css" />
<!--[if IE]>
<script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
</head>
<body>
<div class="container">
<header class="clearfix">
<span>Blueprint <span class="bp-icon bp-icon-about" data-content="The Blueprints are a collection of basic and minimal website concepts, components, plugins and layouts with minimal style for easy adaption and usage, or simply for inspiration."></span></span>
<h1>Responsive Full Width Tabs</h1>
<nav>
<a href="http://tympanus.net/Blueprints/SplitLayout/" class="bp-icon bp-icon-prev" data-info="previous Blueprint"><span>Previous Blueprint</span></a>
<a href="http://tympanus.net/Blueprints/GridGallery/" class="bp-icon bp-icon-next" data-info="next Blueprint"><span>Next Blueprint</span></a>
<a href="http://tympanus.net/codrops/?p=18521" class="bp-icon bp-icon-drop" data-info="back to the Codrops article"><span>back to the Codrops article</span></a>
<a href="http://tympanus.net/codrops/category/blueprints/" class="bp-icon bp-icon-archive" data-info="Blueprints archive"><span>Go to the archive</span></a>
</nav>
</header>
<div id="tabs" class="tabs">
<nav>
<ul>
<li><a href="#section-1" class="icon-shop"><span>Shop</span></a></li>
<li><a href="#section-2" class="icon-cup"><span>Drinks</span></a></li>
<li><a href="#section-3" class="icon-food"><span>Food</span></a></li>
<li><a href="#section-4" class="icon-lab"><span>Lab</span></a></li>
<li><a href="#section-5" class="icon-truck"><span>Order</span></a></li>
</ul>
</nav>
<div class="content">
<section id="section-1">
<div class="mediabox">
<img src="img/01.png" alt="img01" />
<h3>Sushi Gumbo Beetroot</h3>
<p>Sushi gumbo beet greens corn soko endive gumbo gourd. Parsley shallot courgette tatsoi pea sprouts fava bean collard greens dandelion okra wakame tomato.</p>
</div>
<div class="mediabox">
<img src="img/02.png" alt="img02" />
<h3>Pea Sprouts Fava Soup</h3>
<p>Lotus root water spinach fennel kombu maize bamboo shoot green bean swiss chard seakale pumpkin onion chickpea gram corn pea.</p>
</div>
<div class="mediabox">
<img src="img/03.png" alt="img03" />
<h3>Turnip Broccoli Sashimi</h3>
<p>Nori grape silver beet broccoli kombu beet greens fava bean potato quandong celery. Bunya nuts black-eyed pea prairie turnip leek lentil turnip greens parsnip.</p>
</div>
</section>
<section id="section-2">
<div class="mediabox">
<img src="img/04.png" alt="img04" />
<h3>Asparagus Cucumber Cake</h3>
<p>Chickweed okra pea winter purslane coriander yarrow sweet pepper radish garlic brussels sprout groundnut summer purslane earthnut pea tomato spring onion azuki bean gourd. </p>
</div>
<div class="mediabox">
<img src="img/05.png" alt="img05" />
<h3>Magis Kohlrabi Gourd</h3>
<p>Salsify taro catsear garlic gram celery bitterleaf wattle seed collard greens nori. Grape wattle seed kombu beetroot horseradish carrot squash brussels sprout chard.</p>
</div>
<div class="mediabox">
<img src="img/06.png" alt="img06" />
<h3>Ricebean Rutabaga</h3>
<p>Celery quandong swiss chard chicory earthnut pea potato. Salsify taro catsear garlic gram celery bitterleaf wattle seed collard greens nori. </p>
</div>
</section>
<section id="section-3">
<div class="mediabox">
<img src="img/02.png" alt="img02" />
<h3>Noodle Curry</h3>
<p>Lotus root water spinach fennel kombu maize bamboo shoot green bean swiss chard seakale pumpkin onion chickpea gram corn pea.Sushi gumbo beet greens corn soko endive gumbo gourd.</p>
</div>
<div class="mediabox">
<img src="img/06.png" alt="img06" />
<h3>Leek Wasabi</h3>
<p>Sushi gumbo beet greens corn soko endive gumbo gourd. Parsley shallot courgette tatsoi pea sprouts fava bean collard greens dandelion okra wakame tomato.</p>
</div>
<div class="mediabox">
<img src="img/01.png" alt="img01" />
<h3>Green Tofu Wrap</h3>
<p>Pea horseradish azuki bean lettuce avocado asparagus okra. Kohlrabi radish okra azuki bean corn fava bean mustard tigernut wasabi tofu broccoli mixture soup.</p>
</div>
</section>
<section id="section-4">
<div class="mediabox">
<img src="img/03.png" alt="img03" />
<h3>Tomato Cucumber Curd</h3>
<p>Chickweed okra pea winter purslane coriander yarrow sweet pepper radish garlic brussels sprout groundnut summer purslane earthnut pea tomato spring onion azuki bean gourd. </p>
</div>
<div class="mediabox">
<img src="img/01.png" alt="img01" />
<h3>Mushroom Green</h3>
<p>Salsify taro catsear garlic gram celery bitterleaf wattle seed collard greens nori. Grape wattle seed kombu beetroot horseradish carrot squash brussels sprout chard.</p>
</div>
<div class="mediabox">
<img src="img/04.png" alt="img04" />
<h3>Swiss Celery Chard</h3>
<p>Celery quandong swiss chard chicory earthnut pea potato. Salsify taro catsear garlic gram celery bitterleaf wattle seed collard greens nori. </p>
</div>
</section>
<section id="section-5">
<div class="mediabox">
<img src="img/02.png" alt="img02" />
<h3>Radish Tomato</h3>
<p>Catsear cauliflower garbanzo yarrow salsify chicory garlic bell pepper napa cabbage lettuce tomato kale arugula melon sierra leone bologi rutabaga tigernut.</p>
</div>
<div class="mediabox">
<img src="img/06.png" alt="img06" />
<h3>Fennel Wasabi</h3>
<p>Sea lettuce gumbo grape kale kombu cauliflower salsify kohlrabi okra sea lettuce broccoli celery lotus root carrot winter purslane turnip greens garlic.</p>
</div>
<div class="mediabox">
<img src="img/01.png" alt="img01" />
<h3>Red Tofu Wrap</h3>
<p>Green horseradish azuki bean lettuce avocado asparagus okra. Kohlrabi radish okra azuki bean corn fava bean mustard tigernut wasabi tofu broccoli mixture soup.</p>
</div>
</section>
</div><!-- /content -->
</div><!-- /tabs -->
<p class="info">Food Shapes/Icons by <a href="http://psdblast.com/50-food-icon-set-psd">PsdBlast</a></p>
</div>
<script src="js/cbpFWTabs.js"></script>
<script>
new CBPFWTabs( document.getElementById( 'tabs' ) );
</script>
</body>
</html>
|
{
"content_hash": "e844d4337769c17158ebd3c83ca50bf4",
"timestamp": "",
"source": "github",
"line_count": 135,
"max_line_length": 263,
"avg_line_length": 53.31111111111111,
"alnum_prop": 0.6591635403640406,
"repo_name": "dennieru/toimoi",
"id": "cd0dad8895a24c5b46b8db4f4aa85d745f3f3c0b",
"size": "7197",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "lazzy/FullWidthTabs/index.html",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "338088"
},
{
"name": "JavaScript",
"bytes": "97794"
},
{
"name": "PHP",
"bytes": "2571"
}
],
"symlink_target": ""
}
|
package org.kaazing.k3po.driver.internal.types;
import static java.util.Collections.emptySet;
import java.util.LinkedHashSet;
import java.util.Set;
import org.kaazing.k3po.driver.internal.netty.channel.agrona.ChannelReader;
import org.kaazing.k3po.driver.internal.netty.channel.agrona.ChannelWriter;
import org.kaazing.k3po.lang.types.StructuredTypeInfo;
import org.kaazing.k3po.lang.types.TypeInfo;
import org.kaazing.k3po.lang.types.TypeSystemSpi;
public final class AgronaTypeSystem implements TypeSystemSpi
{
private final Set<TypeInfo<?>> acceptOptions;
private final Set<TypeInfo<?>> connectOptions;
private final Set<TypeInfo<?>> readOptions;
private final Set<TypeInfo<?>> writeOptions;
private final Set<StructuredTypeInfo> readConfigs;
private final Set<StructuredTypeInfo> writeConfigs;
private final Set<StructuredTypeInfo> readAdvisories;
private final Set<StructuredTypeInfo> writeAdvisories;
public AgronaTypeSystem()
{
TypeInfo<?> readerType = new TypeInfo<>("reader", ChannelReader.class);
TypeInfo<?> writerType = new TypeInfo<>("writer", ChannelWriter.class);
Set<TypeInfo<?>> acceptOptions = new LinkedHashSet<>();
acceptOptions.add(readerType);
acceptOptions.add(writerType);
this.acceptOptions = acceptOptions;
Set<TypeInfo<?>> connectOptions = new LinkedHashSet<>();
connectOptions.add(readerType);
connectOptions.add(writerType);
this.connectOptions = connectOptions;
this.readOptions = emptySet();
this.writeOptions = emptySet();
this.readConfigs = emptySet();
this.writeConfigs = emptySet();
this.readAdvisories = emptySet();
this.writeAdvisories = emptySet();
}
@Override
public String getName()
{
return "agrona";
}
@Override
public Set<TypeInfo<?>> acceptOptions()
{
return acceptOptions;
}
@Override
public Set<TypeInfo<?>> connectOptions()
{
return connectOptions;
}
@Override
public Set<TypeInfo<?>> readOptions()
{
return readOptions;
}
@Override
public Set<TypeInfo<?>> writeOptions()
{
return writeOptions;
}
@Override
public Set<StructuredTypeInfo> readConfigs()
{
return readConfigs;
}
@Override
public Set<StructuredTypeInfo> writeConfigs()
{
return writeConfigs;
}
@Override
public Set<StructuredTypeInfo> readAdvisories()
{
return readAdvisories;
}
@Override
public Set<StructuredTypeInfo> writeAdvisories()
{
return writeAdvisories;
}
}
|
{
"content_hash": "59d0a9ccf9c7a5a149d81ba4d72f66e0",
"timestamp": "",
"source": "github",
"line_count": 102,
"max_line_length": 79,
"avg_line_length": 26.313725490196077,
"alnum_prop": 0.6762295081967213,
"repo_name": "k3po/k3po",
"id": "8200204acf55a9f95d4a9033b00bbe775a71de28",
"size": "3311",
"binary": false,
"copies": "2",
"ref": "refs/heads/develop",
"path": "driver/src/main/java/org/kaazing/k3po/driver/internal/types/AgronaTypeSystem.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "ANTLR",
"bytes": "13585"
},
{
"name": "Dockerfile",
"bytes": "421"
},
{
"name": "Groovy",
"bytes": "7958"
},
{
"name": "Java",
"bytes": "3285793"
},
{
"name": "Shell",
"bytes": "5109"
},
{
"name": "sed",
"bytes": "2164"
}
],
"symlink_target": ""
}
|
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ChangeListManager">
<list default="true" id="81ba6f54-9067-44bb-a78d-4d1baa3135b1" name="Default" comment="" />
<ignored path="dont_eat_alone_utils.iws" />
<ignored path=".idea/workspace.xml" />
<ignored path=".idea/dataSources.local.xml" />
<option name="EXCLUDED_CONVERTED_TO_IGNORED" value="true" />
<option name="TRACKING_ENABLED" value="true" />
<option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" />
<option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
<option name="LAST_RESOLUTION" value="IGNORE" />
</component>
<component name="ChangesViewManager" flattened_view="true" show_ignored="false" />
<component name="CreatePatchCommitExecutor">
<option name="PATCH_PATH" value="" />
</component>
<component name="ExecutionTargetManager" SELECTED_TARGET="default_target" />
<component name="FavoritesManager">
<favorites_list name="dont_eat_alone_utils" />
</component>
<component name="FileEditorManager">
<leaf SIDE_TABS_SIZE_LIMIT_KEY="300">
<file leaf-file-name="crawler_pyszne_torun.rb" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/kod/crawler_pyszne_torun.rb">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="632">
<caret line="39" column="11" selection-start-line="39" selection-start-column="11" selection-end-line="39" selection-end-column="11" />
<folding />
</state>
</provider>
</entry>
</file>
<file leaf-file-name="database_inserter.rb" pinned="false" current-in-tab="true">
<entry file="file://$PROJECT_DIR$/kod/database_inserter.rb">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="589">
<caret line="41" column="9" selection-start-line="41" selection-start-column="9" selection-end-line="41" selection-end-column="9" />
<folding />
</state>
</provider>
</entry>
</file>
<file leaf-file-name="README.md" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/README.md">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="36">
<caret line="2" column="49" selection-start-line="2" selection-start-column="49" selection-end-line="2" selection-end-column="49" />
<folding />
</state>
</provider>
</entry>
</file>
<file leaf-file-name="json_printer.rb" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/kod/json_printer.rb">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="54">
<caret line="3" column="6" selection-start-line="3" selection-start-column="6" selection-end-line="3" selection-end-column="6" />
<folding />
</state>
</provider>
</entry>
</file>
<file leaf-file-name="link_do_wlasciwego_repo.html" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/kod/link_do_wlasciwego_repo.html">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="18">
<caret line="1" column="16" selection-start-line="1" selection-start-column="16" selection-end-line="1" selection-end-column="16" />
<folding />
</state>
</provider>
</entry>
</file>
<file leaf-file-name="raport.txt" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/raporty/raport.txt">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="126">
<caret line="7" column="44" selection-start-line="7" selection-start-column="44" selection-end-line="7" selection-end-column="44" />
<folding />
</state>
</provider>
</entry>
</file>
<file leaf-file-name="przydatne_linki.txt" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/notatki/przydatne_linki.txt">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="36">
<caret line="2" column="22" selection-start-line="2" selection-start-column="22" selection-end-line="2" selection-end-column="22" />
<folding />
</state>
</provider>
</entry>
</file>
</leaf>
</component>
<component name="Git.Settings">
<option name="RECENT_GIT_ROOT_PATH" value="$PROJECT_DIR$" />
</component>
<component name="IdeDocumentHistory">
<option name="CHANGED_PATHS">
<list>
<option value="$PROJECT_DIR$/kod/json_printer.rb" />
<option value="$PROJECT_DIR$/kod/link_do_wlasciwego_repo.html" />
<option value="$PROJECT_DIR$/raporty/raporty.txt" />
<option value="$PROJECT_DIR$/raporty/raport.yml" />
<option value="$PROJECT_DIR$/raporty/raport.txt" />
<option value="$PROJECT_DIR$/README.md" />
<option value="$PROJECT_DIR$/notatki/przydatne_linki.txt" />
<option value="$PROJECT_DIR$/kod/crawler_pyszne_torun.rb" />
<option value="$PROJECT_DIR$/kod/database_inserter.rb" />
</list>
</option>
</component>
<component name="JsBuildToolGruntFileManager" detection-done="true" sorting="DEFINITION_ORDER" />
<component name="JsBuildToolPackageJson" detection-done="true" sorting="DEFINITION_ORDER" />
<component name="JsGulpfileManager">
<detection-done>true</detection-done>
<sorting>DEFINITION_ORDER</sorting>
</component>
<component name="ProjectFrameBounds">
<option name="x" value="1365" />
<option name="width" value="1922" />
<option name="height" value="1056" />
</component>
<component name="ProjectLevelVcsManager" settingsEditedManually="false">
<OptionsSetting value="true" id="Add" />
<OptionsSetting value="true" id="Remove" />
<OptionsSetting value="true" id="Checkout" />
<OptionsSetting value="true" id="Update" />
<OptionsSetting value="true" id="Status" />
<OptionsSetting value="true" id="Edit" />
<ConfirmationsSetting value="0" id="Add" />
<ConfirmationsSetting value="0" id="Remove" />
</component>
<component name="ProjectView">
<navigator currentView="ProjectPane" proportions="" version="1">
<flattenPackages />
<showMembers />
<showModules />
<showLibraryContents />
<hideEmptyPackages />
<abbreviatePackageNames />
<autoscrollToSource />
<autoscrollFromSource />
<sortByType />
<manualOrder />
<foldersAlwaysOnTop value="true" />
</navigator>
<panes>
<pane id="Scope" />
<pane id="ProjectPane">
<subPane>
<PATH>
<PATH_ELEMENT>
<option name="myItemId" value="dont_eat_alone_utils" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
</PATH_ELEMENT>
</PATH>
<PATH>
<PATH_ELEMENT>
<option name="myItemId" value="dont_eat_alone_utils" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="dont_eat_alone_utils" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
</PATH>
<PATH>
<PATH_ELEMENT>
<option name="myItemId" value="dont_eat_alone_utils" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="dont_eat_alone_utils" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="raporty" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
</PATH>
<PATH>
<PATH_ELEMENT>
<option name="myItemId" value="dont_eat_alone_utils" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="dont_eat_alone_utils" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="notatki" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
</PATH>
<PATH>
<PATH_ELEMENT>
<option name="myItemId" value="dont_eat_alone_utils" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="dont_eat_alone_utils" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="kod" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
</PATH>
</subPane>
</pane>
<pane id="Scratches" />
</panes>
</component>
<component name="PropertiesComponent">
<property name="WebServerToolWindowFactoryState" value="false" />
<property name="last_opened_file_path" value="$PROJECT_DIR$/../dont_eat_alone" />
</component>
<component name="RunManager">
<configuration default="true" type="CucumberRunConfigurationType" factoryName="Cucumber">
<predefined_log_file id="RUBY_CUCUMBER" enabled="true" />
<module name="" />
<CUCUMBER_RUN_CONFIG_SETTINGS_ID NAME="RUBY_ARGS" VALUE="-e $stdout.sync=true;$stderr.sync=true;load($0=ARGV.shift)" />
<CUCUMBER_RUN_CONFIG_SETTINGS_ID NAME="WORK DIR" VALUE="" />
<CUCUMBER_RUN_CONFIG_SETTINGS_ID NAME="SHOULD_USE_SDK" VALUE="false" />
<CUCUMBER_RUN_CONFIG_SETTINGS_ID NAME="ALTERN_SDK_NAME" VALUE="" />
<CUCUMBER_RUN_CONFIG_SETTINGS_ID NAME="myPassParentEnvs" VALUE="true" />
<envs />
<EXTENSION ID="BundlerRunConfigurationExtension" bundleExecEnabled="false" />
<EXTENSION ID="JRubyRunConfigurationExtension" NailgunExecEnabled="false" />
<EXTENSION ID="RubyCoverageRunConfigurationExtension" enabled="false" sample_coverage="true" track_test_folders="true" runner="rcov">
<COVERAGE_PATTERN ENABLED="true">
<PATTERN REGEXPS="/.rvm/" INCLUDED="false" />
</COVERAGE_PATTERN>
</EXTENSION>
<CUCUMBER_RUN_CONFIG_SETTINGS_ID NAME="TEST_FILE_MASK" VALUE="**/*.feature" />
<CUCUMBER_RUN_CONFIG_SETTINGS_ID NAME="TEST_TEST_TYPE" VALUE="TEST_SCRIPT" />
<CUCUMBER_RUN_CONFIG_SETTINGS_ID NAME="TESTS_FOLDER_PATH" VALUE="" />
<CUCUMBER_RUN_CONFIG_SETTINGS_ID NAME="TEST_SCRIPT_PATH" VALUE="" />
<CUCUMBER_RUN_CONFIG_SETTINGS_ID NAME="TEST_TAGS_FILTER" VALUE="" />
<CUCUMBER_RUN_CONFIG_SETTINGS_ID NAME="TEST_NAME_FILTER" VALUE="" />
<CUCUMBER_RUN_CONFIG_SETTINGS_ID NAME="CUCUMBER_ARGS" VALUE="--color -r features" />
<CUCUMBER_RUN_CONFIG_SETTINGS_ID NAME="RUNNER_VERSION" VALUE="" />
<CUCUMBER_RUN_CONFIG_SETTINGS_ID NAME="FULL_BACKTRACE" VALUE="false" />
<CUCUMBER_RUN_CONFIG_SETTINGS_ID NAME="VERBOSE_OPTION" VALUE="false" />
<CUCUMBER_RUN_CONFIG_SETTINGS_ID NAME="DRB" VALUE="false" />
<CUCUMBER_RUN_CONFIG_SETTINGS_ID NAME="ZEUS" VALUE="false" />
<CUCUMBER_RUN_CONFIG_SETTINGS_ID NAME="SPRING" VALUE="false" />
<CUCUMBER_RUN_CONFIG_SETTINGS_ID NAME="CUCUMBER_RUNNER_PATH" VALUE="" />
<CUCUMBER_RUN_CONFIG_SETTINGS_ID NAME="USE_CUSTOM_RUNNER" VALUE="false" />
<CUCUMBER_RUN_CONFIG_SETTINGS_ID NAME="SETTINGS_VERSION" VALUE="2" />
<method />
</configuration>
<configuration default="true" type="JavascriptDebugType" factoryName="JavaScript Debug">
<method />
</configuration>
<configuration default="true" type="RSpecRunConfigurationType" factoryName="RSpec">
<predefined_log_file id="RUBY_RSPEC" enabled="true" />
<module name="" />
<RSPEC_RUN_CONFIG_SETTINGS_ID NAME="RUBY_ARGS" VALUE="-e $stdout.sync=true;$stderr.sync=true;load($0=ARGV.shift)" />
<RSPEC_RUN_CONFIG_SETTINGS_ID NAME="WORK DIR" VALUE="" />
<RSPEC_RUN_CONFIG_SETTINGS_ID NAME="SHOULD_USE_SDK" VALUE="false" />
<RSPEC_RUN_CONFIG_SETTINGS_ID NAME="ALTERN_SDK_NAME" VALUE="" />
<RSPEC_RUN_CONFIG_SETTINGS_ID NAME="myPassParentEnvs" VALUE="true" />
<envs />
<EXTENSION ID="BundlerRunConfigurationExtension" bundleExecEnabled="false" />
<EXTENSION ID="JRubyRunConfigurationExtension" NailgunExecEnabled="false" />
<EXTENSION ID="RubyCoverageRunConfigurationExtension" enabled="false" sample_coverage="true" track_test_folders="true" runner="rcov">
<COVERAGE_PATTERN ENABLED="true">
<PATTERN REGEXPS="/.rvm/" INCLUDED="false" />
</COVERAGE_PATTERN>
</EXTENSION>
<RSPEC_RUN_CONFIG_SETTINGS_ID NAME="TESTS_FOLDER_PATH" VALUE="" />
<RSPEC_RUN_CONFIG_SETTINGS_ID NAME="TEST_SCRIPT_PATH" VALUE="" />
<RSPEC_RUN_CONFIG_SETTINGS_ID NAME="SPEC_RUNNER_PATH" VALUE="" />
<RSPEC_RUN_CONFIG_SETTINGS_ID NAME="TEST_FILE_MASK" VALUE="**/*_spec.rb" />
<RSPEC_RUN_CONFIG_SETTINGS_ID NAME="SPEC_EXAMPLE_NAME" VALUE="" />
<RSPEC_RUN_CONFIG_SETTINGS_ID NAME="TEST_TEST_TYPE" VALUE="TEST_SCRIPT" />
<RSPEC_RUN_CONFIG_SETTINGS_ID NAME="SPEC_ARGS" VALUE="" />
<RSPEC_RUN_CONFIG_SETTINGS_ID NAME="RUNNER_VERSION" VALUE="" />
<RSPEC_RUN_CONFIG_SETTINGS_ID NAME="USE_CUSTOM_SPEC_RUNNER" VALUE="false" />
<RSPEC_RUN_CONFIG_SETTINGS_ID NAME="DRB" VALUE="false" />
<RSPEC_RUN_CONFIG_SETTINGS_ID NAME="ZEUS" VALUE="false" />
<RSPEC_RUN_CONFIG_SETTINGS_ID NAME="SPRING" VALUE="false" />
<RSPEC_RUN_CONFIG_SETTINGS_ID NAME="FULL_BACKTRACE" VALUE="false" />
<method />
</configuration>
<configuration default="true" type="RubyRunConfigurationType" factoryName="Ruby">
<module name="" />
<RUBY_RUN_CONFIG NAME="RUBY_ARGS" VALUE="-e $stdout.sync=true;$stderr.sync=true;load($0=ARGV.shift)" />
<RUBY_RUN_CONFIG NAME="WORK DIR" VALUE="" />
<RUBY_RUN_CONFIG NAME="SHOULD_USE_SDK" VALUE="false" />
<RUBY_RUN_CONFIG NAME="ALTERN_SDK_NAME" VALUE="" />
<RUBY_RUN_CONFIG NAME="myPassParentEnvs" VALUE="true" />
<envs />
<EXTENSION ID="BundlerRunConfigurationExtension" bundleExecEnabled="false" />
<EXTENSION ID="JRubyRunConfigurationExtension" NailgunExecEnabled="false" />
<EXTENSION ID="RubyCoverageRunConfigurationExtension" enabled="false" sample_coverage="true" track_test_folders="true" runner="rcov">
<COVERAGE_PATTERN ENABLED="true">
<PATTERN REGEXPS="/.rvm/" INCLUDED="false" />
</COVERAGE_PATTERN>
</EXTENSION>
<RUBY_RUN_CONFIG NAME="SCRIPT_PATH" VALUE="" />
<RUBY_RUN_CONFIG NAME="SCRIPT_ARGS" VALUE="" />
<method />
</configuration>
<configuration default="true" type="TestUnitRunConfigurationType" factoryName="Test::Unit/Shoulda/Minitest">
<predefined_log_file id="RUBY_TESTUNIT" enabled="true" />
<module name="" />
<RTEST_RUN_CONFIG_SETTINGS_ID NAME="RUBY_ARGS" VALUE="-e $stdout.sync=true;$stderr.sync=true;load($0=ARGV.shift)" />
<RTEST_RUN_CONFIG_SETTINGS_ID NAME="WORK DIR" VALUE="" />
<RTEST_RUN_CONFIG_SETTINGS_ID NAME="SHOULD_USE_SDK" VALUE="false" />
<RTEST_RUN_CONFIG_SETTINGS_ID NAME="ALTERN_SDK_NAME" VALUE="" />
<RTEST_RUN_CONFIG_SETTINGS_ID NAME="myPassParentEnvs" VALUE="true" />
<envs />
<EXTENSION ID="BundlerRunConfigurationExtension" bundleExecEnabled="false" />
<EXTENSION ID="JRubyRunConfigurationExtension" NailgunExecEnabled="false" />
<EXTENSION ID="RubyCoverageRunConfigurationExtension" enabled="false" sample_coverage="true" track_test_folders="true" runner="rcov">
<COVERAGE_PATTERN ENABLED="true">
<PATTERN REGEXPS="/.rvm/" INCLUDED="false" />
</COVERAGE_PATTERN>
</EXTENSION>
<RTEST_RUN_CONFIG_SETTINGS_ID NAME="TESTS_FOLDER_PATH" VALUE="" />
<RTEST_RUN_CONFIG_SETTINGS_ID NAME="TEST_SCRIPT_PATH" VALUE="" />
<RTEST_RUN_CONFIG_SETTINGS_ID NAME="TEST_FILE_MASK" VALUE="" />
<RTEST_RUN_CONFIG_SETTINGS_ID NAME="TEST_METHOD_NAME" VALUE="" />
<RTEST_RUN_CONFIG_SETTINGS_ID NAME="TEST_TEST_TYPE" VALUE="TEST_SCRIPT" />
<RTEST_RUN_CONFIG_SETTINGS_ID NAME="DRB" VALUE="false" />
<RTEST_RUN_CONFIG_SETTINGS_ID NAME="ZEUS" VALUE="false" />
<RTEST_RUN_CONFIG_SETTINGS_ID NAME="SPRING" VALUE="false" />
<RTEST_RUN_CONFIG_SETTINGS_ID NAME="RUNNER_OPTIONS" VALUE="" />
<method />
</configuration>
<configuration default="true" type="js.build_tools.gulp" factoryName="Gulp.js">
<node-interpreter>project</node-interpreter>
<node-options />
<gulpfile />
<tasks />
<arguments />
<envs />
<method />
</configuration>
<configuration default="true" type="js.build_tools.npm" factoryName="npm">
<command value="run-script" />
<scripts />
<node-interpreter value="project" />
<envs />
<method />
</configuration>
</component>
<component name="ShelveChangesManager" show_recycled="false">
<option name="remove_strategy" value="false" />
</component>
<component name="SvnConfiguration">
<configuration />
</component>
<component name="TaskManager">
<task active="true" id="Default" summary="Default task">
<changelist id="81ba6f54-9067-44bb-a78d-4d1baa3135b1" name="Default" comment="" />
<created>1464462706080</created>
<option name="number" value="Default" />
<option name="presentableId" value="Default" />
<updated>1464462706080</updated>
<workItem from="1464462707225" duration="7420000" />
<workItem from="1464476308371" duration="2474000" />
<workItem from="1464527389807" duration="602000" />
<workItem from="1464536762100" duration="228000" />
<workItem from="1464537037590" duration="375000" />
<workItem from="1464549669897" duration="9595000" />
<workItem from="1464633923594" duration="7012000" />
<workItem from="1464648781253" duration="35000" />
<workItem from="1464730508671" duration="906000" />
<workItem from="1464904834410" duration="500000" />
<workItem from="1465241154521" duration="7541000" />
<workItem from="1465279684803" duration="2891000" />
</task>
<servers />
</component>
<component name="TimeTrackingManager">
<option name="totallyTimeSpent" value="39579000" />
</component>
<component name="ToolWindowManager">
<frame x="1365" y="0" width="1922" height="1056" extended-state="6" />
<editor active="false" />
<layout>
<window_info id="Project" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" show_stripe_button="true" weight="0.18104367" sideWeight="0.5" order="0" side_tool="false" content_ui="combo" />
<window_info id="TODO" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="6" side_tool="false" content_ui="tabs" />
<window_info id="Event Log" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="7" side_tool="true" content_ui="tabs" />
<window_info id="Database" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
<window_info id="Version Control" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="9" side_tool="false" content_ui="tabs" />
<window_info id="Structure" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
<window_info id="Terminal" active="true" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" show_stripe_button="true" weight="0.28778467" sideWeight="0.5" order="8" side_tool="false" content_ui="tabs" />
<window_info id="Favorites" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="2" side_tool="true" content_ui="tabs" />
<window_info id="Cvs" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="4" side_tool="false" content_ui="tabs" />
<window_info id="Message" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" />
<window_info id="Commander" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.4" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" />
<window_info id="Inspection" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.4" sideWeight="0.5" order="5" side_tool="false" content_ui="tabs" />
<window_info id="Run" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" />
<window_info id="Hierarchy" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="2" side_tool="false" content_ui="combo" />
<window_info id="Find" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
<window_info id="Ant Build" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
<window_info id="Debug" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.4" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
</layout>
</component>
<component name="Vcs.Log.UiProperties">
<option name="RECENTLY_FILTERED_USER_GROUPS">
<collection />
</option>
<option name="RECENTLY_FILTERED_BRANCH_GROUPS">
<collection />
</option>
</component>
<component name="VcsContentAnnotationSettings">
<option name="myLimit" value="2678400000" />
</component>
<component name="XDebuggerManager">
<breakpoint-manager />
<watches-manager />
</component>
<component name="editorHistoryManager">
<entry file="file://$PROJECT_DIR$/kod/crawler_pyszne_torun.rb">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="702">
<caret line="39" column="11" selection-start-line="39" selection-start-column="11" selection-end-line="39" selection-end-column="11" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/kod/database_inserter.rb">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="0">
<caret line="0" column="0" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/README.md">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="36">
<caret line="2" column="49" selection-start-line="2" selection-start-column="49" selection-end-line="2" selection-end-column="49" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/kod/json_printer.rb">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="54">
<caret line="3" column="6" selection-start-line="3" selection-start-column="6" selection-end-line="3" selection-end-column="6" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/kod/link_do_wlasciwego_repo.html">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="18">
<caret line="1" column="16" selection-start-line="1" selection-start-column="16" selection-end-line="1" selection-end-column="16" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/raporty/raport.txt">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="126">
<caret line="7" column="44" selection-start-line="7" selection-start-column="44" selection-end-line="7" selection-end-column="44" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/notatki/przydatne_linki.txt">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="36">
<caret line="2" column="22" selection-start-line="2" selection-start-column="22" selection-end-line="2" selection-end-column="22" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/kod/crawler_pyszne_torun.rb">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="0">
<caret line="0" column="0" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/README.md">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="36">
<caret line="2" column="49" selection-start-line="2" selection-start-column="49" selection-end-line="2" selection-end-column="49" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/kod/json_printer.rb">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="54">
<caret line="3" column="6" selection-start-line="3" selection-start-column="6" selection-end-line="3" selection-end-column="6" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/kod/link_do_wlasciwego_repo.html">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="18">
<caret line="1" column="16" selection-start-line="1" selection-start-column="16" selection-end-line="1" selection-end-column="16" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/raporty/raport.txt">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="126">
<caret line="7" column="44" selection-start-line="7" selection-start-column="44" selection-end-line="7" selection-end-column="44" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/notatki/przydatne_linki.txt">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="36">
<caret line="2" column="22" selection-start-line="2" selection-start-column="22" selection-end-line="2" selection-end-column="22" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/kod/crawler_pyszne_torun.rb">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="0">
<caret line="0" column="0" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/README.md">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="36">
<caret line="2" column="49" selection-start-line="2" selection-start-column="49" selection-end-line="2" selection-end-column="49" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/kod/json_printer.rb">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="54">
<caret line="3" column="6" selection-start-line="3" selection-start-column="6" selection-end-line="3" selection-end-column="6" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/kod/link_do_wlasciwego_repo.html">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="18">
<caret line="1" column="16" selection-start-line="1" selection-start-column="16" selection-end-line="1" selection-end-column="16" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/raporty/raport.txt">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="126">
<caret line="7" column="44" selection-start-line="7" selection-start-column="44" selection-end-line="7" selection-end-column="44" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/notatki/przydatne_linki.txt">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="36">
<caret line="2" column="22" selection-start-line="2" selection-start-column="22" selection-end-line="2" selection-end-column="22" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/kod/crawler_pyszne_torun.rb">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="360">
<caret line="20" column="107" selection-start-line="20" selection-start-column="107" selection-end-line="20" selection-end-column="107" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/README.md">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="0">
<caret line="0" column="0" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/kod/json_printer.rb">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="54">
<caret line="3" column="6" selection-start-line="3" selection-start-column="6" selection-end-line="3" selection-end-column="6" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/kod/link_do_wlasciwego_repo.html">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="18">
<caret line="1" column="16" selection-start-line="1" selection-start-column="16" selection-end-line="1" selection-end-column="16" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/raporty/raport.txt">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="126">
<caret line="7" column="44" selection-start-line="7" selection-start-column="44" selection-end-line="7" selection-end-column="44" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/notatki/przydatne_linki.txt">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="36">
<caret line="2" column="22" selection-start-line="2" selection-start-column="22" selection-end-line="2" selection-end-column="22" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/kod/crawler_pyszne_torun.rb">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="360">
<caret line="20" column="107" selection-start-line="20" selection-start-column="107" selection-end-line="20" selection-end-column="107" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/README.md">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="36">
<caret line="2" column="49" selection-start-line="2" selection-start-column="49" selection-end-line="2" selection-end-column="49" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/kod/json_printer.rb">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="54">
<caret line="3" column="6" selection-start-line="3" selection-start-column="6" selection-end-line="3" selection-end-column="6" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/kod/link_do_wlasciwego_repo.html">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="18">
<caret line="1" column="16" selection-start-line="1" selection-start-column="16" selection-end-line="1" selection-end-column="16" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/raporty/raport.txt">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="126">
<caret line="7" column="44" selection-start-line="7" selection-start-column="44" selection-end-line="7" selection-end-column="44" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/notatki/przydatne_linki.txt">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="0">
<caret line="0" column="0" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/kod/crawler_pyszne_torun.rb">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="0">
<caret line="0" column="0" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/kod/crawler_pyszne_torun.rb">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="0">
<caret line="0" column="0" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/kod/crawler_pyszne_torun.rb">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="0">
<caret line="0" column="0" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/kod/crawler_pyszne_torun.rb">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="0">
<caret line="0" column="0" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/kod/crawler_pyszne_torun.rb">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="0">
<caret line="0" column="0" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/kod/crawler_pyszne_torun.rb">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="0">
<caret line="0" column="0" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/kod/link_do_wlasciwego_repo.html">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="18">
<caret line="1" column="16" selection-start-line="1" selection-start-column="16" selection-end-line="1" selection-end-column="16" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/raporty/raport.txt">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="126">
<caret line="7" column="44" selection-start-line="7" selection-start-column="44" selection-end-line="7" selection-end-column="44" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/notatki/przydatne_linki.txt">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="36">
<caret line="2" column="22" selection-start-line="2" selection-start-column="22" selection-end-line="2" selection-end-column="22" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/README.md">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="36">
<caret line="2" column="49" selection-start-line="2" selection-start-column="49" selection-end-line="2" selection-end-column="49" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/kod/json_printer.rb">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="54">
<caret line="3" column="6" selection-start-line="3" selection-start-column="6" selection-end-line="3" selection-end-column="6" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/kod/crawler_pyszne_torun.rb">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="632">
<caret line="39" column="11" selection-start-line="39" selection-start-column="11" selection-end-line="39" selection-end-column="11" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/kod/database_inserter.rb">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="589">
<caret line="41" column="9" selection-start-line="41" selection-start-column="9" selection-end-line="41" selection-end-column="9" />
<folding />
</state>
</provider>
</entry>
</component>
</project>
|
{
"content_hash": "b84a66243902af6afffcc994fbbb0735",
"timestamp": "",
"source": "github",
"line_count": 776,
"max_line_length": 247,
"avg_line_length": 53.19845360824742,
"alnum_prop": 0.6295479870161329,
"repo_name": "kura-pl/dont_eat_alone_utils",
"id": "f62316d9d05e7994e7e7f4425a6844f1a26b2726",
"size": "41282",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": ".idea/workspace.xml",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "HTML",
"bytes": "464"
},
{
"name": "Ruby",
"bytes": "3979"
}
],
"symlink_target": ""
}
|
enyo.kind({
name: "enyo.webos.sample.LunaService",
classes: "onyx enyo-fit",
kind:"enyo.Scroller",
components: [
{classes: "webos-sample", components:[
{name:"networkStatus", kind:"enyo.LunaService", service:"luna://com.palm.connectionmanager", method: "getstatus", onResponse:"serviceResponse", onError:"serviceError"},
{kind:"enyo.Signals", ondeviceready:"deviceready"},
{classes: "webos-sample-divider", content: "Device API"},
{kind: "onyx.Groupbox", classes:"webos-sample-result-box", components: [
{kind: "onyx.GroupboxHeader", content: "enyo.LunaService"},
{name:"result", classes:"webos-sample-result", content:"LunaService API not supported on this platform.", allowHtml:true}
]}
]}
],
deviceready: function(inSender, inEvent) {
if(enyo.platform.webos) {
this.request = this.$.networkStatus.send({}); //no parameters needed for this service call
//in this example, can cancel the request from this.request.cancel()
}
},
serviceResponse: function(inSender, inEvent) {
//Note: inEvent.originator will point to the request object (the same one set to this.request above)
this.$.result.setContent("isInternetConnectionAvailable: " + inEvent.isInternetConnectionAvailable + "<br><br>"
+ "Wired: " + enyo.json.stringify(inEvent.wired, null, "\t") + "<br><br>"
+ "WiFi: " + enyo.json.stringify(inEvent.wifi, null, "\t") + "<br><br>"
+ "WAN: " + enyo.json.stringify(inEvent.wan, null, "\t"));
},
serviceError: function(inSender, inEvent) {
this.$.result.setContent("Error: " + inEvent.errorText);
}
});
|
{
"content_hash": "fa3d1c2b794ab4a72faa205f92d7f443",
"timestamp": "",
"source": "github",
"line_count": 32,
"max_line_length": 171,
"avg_line_length": 49.03125,
"alnum_prop": 0.6921606118546845,
"repo_name": "recurve/ares-ecosystem",
"id": "c48cd3694798603d9587d3302b055216f920f245",
"size": "1569",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "node_modules/ares-webos-sdk/templates/bootplate-moonstone-2.3/lib/enyo-webos/samples/LunaService.js",
"mode": "33261",
"license": "apache-2.0",
"language": [
{
"name": "Batchfile",
"bytes": "1339"
},
{
"name": "CSS",
"bytes": "285962"
},
{
"name": "CoffeeScript",
"bytes": "872"
},
{
"name": "HTML",
"bytes": "929015"
},
{
"name": "Java",
"bytes": "13111"
},
{
"name": "JavaScript",
"bytes": "4149319"
},
{
"name": "PHP",
"bytes": "6143"
},
{
"name": "Perl",
"bytes": "682"
},
{
"name": "Shell",
"bytes": "2361"
}
],
"symlink_target": ""
}
|
package org.onosproject.drivers.microsemi.yang;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.fail;
import java.io.UncheckedIOException;
import java.util.List;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import org.onlab.packet.Ip4Address;
import org.onosproject.drivers.microsemi.yang.impl.MseaSaFilteringManager;
import org.onosproject.netconf.DatastoreId;
import org.onosproject.netconf.NetconfDeviceInfo;
import org.onosproject.netconf.NetconfException;
import org.onosproject.netconf.NetconfSession;
import org.onosproject.yang.gen.v1.mseasafiltering.rev20160412.MseaSaFiltering;
import org.onosproject.yang.gen.v1.mseasafiltering.rev20160412.MseaSaFilteringOpParam;
import org.onosproject.yang.gen.v1.mseasafiltering.rev20160412.mseasafiltering.DefaultSourceIpaddressFiltering;
import org.onosproject.yang.gen.v1.mseasafiltering.rev20160412.mseasafiltering.SourceIpaddressFiltering;
import org.onosproject.yang.gen.v1.mseasafiltering.rev20160412.mseasafiltering.sourceipaddressfiltering.DefaultInterfaceEth0;
import org.onosproject.yang.gen.v1.mseasafiltering.rev20160412.mseasafiltering.sourceipaddressfiltering.InterfaceEth0;
import org.onosproject.yang.gen.v1.mseasafiltering.rev20160412.mseasafiltering.sourceipaddressfiltering.interfaceeth0.DefaultSourceAddressRange;
import org.onosproject.yang.gen.v1.mseasafiltering.rev20160412.mseasafiltering.sourceipaddressfiltering.interfaceeth0.SourceAddressRange;
public class MseaSaFilteringManagerTest {
MseaSaFilteringManager mseaSaSvc;
NetconfSession session;
@Before
public void setUp() throws Exception {
try {
mseaSaSvc = new MockMseaSaFilteringManager();
mseaSaSvc.activate();
} catch (UncheckedIOException e) {
fail(e.getMessage());
}
NetconfDeviceInfo deviceInfo = new NetconfDeviceInfo("netconf", "netconf", Ip4Address.valueOf("1.2.3.4"), 830);
session = new MockNetconfSessionEa1000(deviceInfo);
}
@After
public void tearDown() throws Exception {
}
@Test
public void testGetMseaSaFilteringMseaSaFilteringOpParamNetconfSession() throws NetconfException {
SourceIpaddressFiltering sip = new DefaultSourceIpaddressFiltering();
MseaSaFilteringOpParam op = new MseaSaFilteringOpParam();
op.sourceIpaddressFiltering(sip);
MseaSaFiltering result = mseaSaSvc.getMseaSaFiltering(op, session);
//Results come from MockNetconfSession SAMPLE_MSEASAFILTERING_REPLY_INIT
assertNotNull(result.sourceIpaddressFiltering().interfaceEth0().sourceAddressRange());
List<SourceAddressRange> ranges = result.sourceIpaddressFiltering().interfaceEth0().sourceAddressRange();
assertEquals(2, ranges.size());
for (SourceAddressRange sa:ranges) {
if (sa.rangeId() == 1) {
assertEquals("10.10.10.10/16", sa.ipv4AddressPrefix());
} else if (sa.rangeId() == 2) {
assertEquals("20.30.40.50/18", sa.ipv4AddressPrefix());
}
}
}
@Test
public void testSetMseaSaFilteringMseaSaFilteringOpParamNetconfSessionNcDsType() {
MseaSaFilteringOpParam mseaSaFilteringConfig =
createConfigForEdit("192.168.60.10/27", (short) 3, "Filter3");
//Calling on the edit-config just makes the change and hopefully does not throw a Netconf Exception
try {
mseaSaSvc.setMseaSaFiltering(mseaSaFilteringConfig, session, DatastoreId.RUNNING);
} catch (NetconfException e) {
e.printStackTrace();
fail("NETCONF Exception: " + e.getMessage());
}
}
@Test
public void testDeleteMseaSaFilteringMseaSaFilteringOpParamNetconfSessionNcDsType() {
MseaSaFilteringOpParam mseaSaFilteringConfig =
createConfigForEdit("192.168.60.10/27", (short) 3, "Filter3");
SourceAddressRange sar2 = new DefaultSourceAddressRange();
sar2.ipv4AddressPrefix("10.205.86.10/27");
sar2.rangeId((short) 4);
sar2.name("Filter4");
mseaSaFilteringConfig.sourceIpaddressFiltering().interfaceEth0()
.addToSourceAddressRange(sar2);
//Calling on the edit-config just makes the change and hopefully does not throw a Netconf Exception
try {
mseaSaSvc.deleteMseaSaFilteringRange(mseaSaFilteringConfig, session, DatastoreId.RUNNING);
} catch (NetconfException e) {
e.printStackTrace();
fail("NETCONF Exception: " + e.getMessage());
}
}
/**
* This is also called from the test case EA1000FlowRuleProgrammableTest().
* In the ea1000driver project
* @return
*/
public static MseaSaFilteringOpParam createConfigForEdit(String ipAddrPrefix, short rangeId, String rangeName) {
SourceAddressRange sar = new DefaultSourceAddressRange();
sar.ipv4AddressPrefix(ipAddrPrefix);
sar.rangeId(rangeId);
sar.name(rangeName);
InterfaceEth0 eth0 = new DefaultInterfaceEth0();
eth0.addToSourceAddressRange(sar);
SourceIpaddressFiltering sip = new DefaultSourceIpaddressFiltering();
sip.interfaceEth0(eth0);
MseaSaFilteringOpParam op = new MseaSaFilteringOpParam();
op.sourceIpaddressFiltering(sip);
return op;
}
}
|
{
"content_hash": "8c6be2a8f90759d72e5e1d0a7dc2378d",
"timestamp": "",
"source": "github",
"line_count": 134,
"max_line_length": 144,
"avg_line_length": 40.582089552238806,
"alnum_prop": 0.7248988598749541,
"repo_name": "LorenzReinhart/ONOSnew",
"id": "acb6ae619a28c49e006a231434efa74438e0ec92",
"size": "6055",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "drivers/microsemi/src/test/java/org/onosproject/drivers/microsemi/yang/MseaSaFilteringManagerTest.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "224030"
},
{
"name": "HTML",
"bytes": "108368"
},
{
"name": "Java",
"bytes": "34148438"
},
{
"name": "JavaScript",
"bytes": "3833411"
},
{
"name": "Protocol Buffer",
"bytes": "13730"
},
{
"name": "Python",
"bytes": "185205"
},
{
"name": "Shell",
"bytes": "2594"
}
],
"symlink_target": ""
}
|
ACCEPTED
#### According to
Index Fungorum
#### Published in
Icon. fung. (Abellini) 3: 9 (1900)
#### Original name
Calosphaeria crataegi Mouton
### Remarks
null
|
{
"content_hash": "523b064e02008a8bbaa672ebb82c2246",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 34,
"avg_line_length": 12.538461538461538,
"alnum_prop": 0.6993865030674846,
"repo_name": "mdoering/backbone",
"id": "59ab4f59f6c99f895b1f0a14af7530149a8959ec",
"size": "219",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "life/Fungi/Ascomycota/Sordariomycetes/Diaporthales/Togniniaceae/Togninia/Togninia crataegi/README.md",
"mode": "33188",
"license": "apache-2.0",
"language": [],
"symlink_target": ""
}
|
"use strict";
process.on('message', (message) => {
if (message.command === 'exit') {
process.exit(0);
}
else if (message.command === 'resolve') {
try {
let result = require.resolve(message.args);
process.send({ command: 'resolve', success: true, result: result });
}
catch (err) {
process.send({ command: 'resolve', success: false });
}
}
});
//# sourceMappingURL=resolve.js.map
|
{
"content_hash": "9def4ace6b7ed2d6549b49323d9ed80b",
"timestamp": "",
"source": "github",
"line_count": 17,
"max_line_length": 80,
"avg_line_length": 27.705882352941178,
"alnum_prop": 0.5286624203821656,
"repo_name": "glenngillen/dotfiles",
"id": "253f1a78ad19139c9265be47ec612cf4a72c33d4",
"size": "820",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": ".vscode/extensions/juanblanco.solidity-0.0.137/node_modules/vscode-languageserver/lib/node/resolve.js",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Ruby",
"bytes": "3634"
},
{
"name": "Shell",
"bytes": "4225"
},
{
"name": "Vim script",
"bytes": "16306"
}
],
"symlink_target": ""
}
|
package android.support.v4.app;
/**
* Static library support version of the framework's {@link android.app.FragmentTransaction}.
* Used to write apps that run on platforms prior to Android 3.0. When running
* on Android 3.0 or above, this implementation is still used; it does not try
* to switch to the framework's implementation. See the framework SDK
* documentation for a class overview.
*/
public abstract class FragmentTransaction {
/**
* Calls {@link #add(int, Fragment, String)} with a 0 containerViewId.
*/
public abstract FragmentTransaction add(Fragment fragment, String tag);
/**
* Calls {@link #add(int, Fragment, String)} with a null tag.
*/
public abstract FragmentTransaction add(int containerViewId, Fragment fragment);
/**
* Add a fragment to the activity state. This fragment may optionally
* also have its view (if {@link Fragment#onCreateView Fragment.onCreateView}
* returns non-null) into a container view of the activity.
*
* @param containerViewId Optional identifier of the container this fragment is
* to be placed in. If 0, it will not be placed in a container.
* @param fragment The fragment to be added. This fragment must not already
* be added to the activity.
* @param tag Optional tag name for the fragment, to later retrieve the
* fragment with {@link FragmentManager#findFragmentByTag(String)
* FragmentManager.findFragmentByTag(String)}.
*
* @return Returns the same FragmentTransaction instance.
*/
public abstract FragmentTransaction add(int containerViewId, Fragment fragment, String tag);
/**
* Calls {@link #replace(int, Fragment, String)} with a null tag.
*/
public abstract FragmentTransaction replace(int containerViewId, Fragment fragment);
/**
* Replace an existing fragment that was added to a container. This is
* essentially the same as calling {@link #remove(Fragment)} for all
* currently added fragments that were added with the same containerViewId
* and then {@link #add(int, Fragment, String)} with the same arguments
* given here.
*
* @param containerViewId Identifier of the container whose fragment(s) are
* to be replaced.
* @param fragment The new fragment to place in the container.
* @param tag Optional tag name for the fragment, to later retrieve the
* fragment with {@link FragmentManager#findFragmentByTag(String)
* FragmentManager.findFragmentByTag(String)}.
*
* @return Returns the same FragmentTransaction instance.
*/
public abstract FragmentTransaction replace(int containerViewId, Fragment fragment, String tag);
/**
* Remove an existing fragment. If it was added to a container, its view
* is also removed from that container.
*
* @param fragment The fragment to be removed.
*
* @return Returns the same FragmentTransaction instance.
*/
public abstract FragmentTransaction remove(Fragment fragment);
/**
* Hides an existing fragment. This is only relevant for fragments whose
* views have been added to a container, as this will cause the view to
* be hidden.
*
* @param fragment The fragment to be hidden.
*
* @return Returns the same FragmentTransaction instance.
*/
public abstract FragmentTransaction hide(Fragment fragment);
/**
* Shows a previously hidden fragment. This is only relevant for fragments whose
* views have been added to a container, as this will cause the view to
* be shown.
*
* @param fragment The fragment to be shown.
*
* @return Returns the same FragmentTransaction instance.
*/
public abstract FragmentTransaction show(Fragment fragment);
/**
* Detach the given fragment from the UI. This is the same state as
* when it is put on the back stack: the fragment is removed from
* the UI, however its state is still being actively managed by the
* fragment manager. When going into this state its view hierarchy
* is destroyed.
*
* @param fragment The fragment to be detached.
*
* @return Returns the same FragmentTransaction instance.
*/
public abstract FragmentTransaction detach(Fragment fragment);
/**
* Re-attach a fragment after it had previously been deatched from
* the UI with {@link #detach(Fragment)}. This
* causes its view hierarchy to be re-created, attached to the UI,
* and displayed.
*
* @param fragment The fragment to be attached.
*
* @return Returns the same FragmentTransaction instance.
*/
public abstract FragmentTransaction attach(Fragment fragment);
/**
* @return <code>true</code> if this transaction contains no operations,
* <code>false</code> otherwise.
*/
public abstract boolean isEmpty();
/**
* Bit mask that is set for all enter transitions.
*/
public static final int TRANSIT_ENTER_MASK = 0x1000;
/**
* Bit mask that is set for all exit transitions.
*/
public static final int TRANSIT_EXIT_MASK = 0x2000;
/** Not set up for a transition. */
public static final int TRANSIT_UNSET = -1;
/** No animation for transition. */
public static final int TRANSIT_NONE = 0;
/** Fragment is being added onto the stack */
public static final int TRANSIT_FRAGMENT_OPEN = 1 | TRANSIT_ENTER_MASK;
/** Fragment is being removed from the stack */
public static final int TRANSIT_FRAGMENT_CLOSE = 2 | TRANSIT_EXIT_MASK;
/** Fragment should simply fade in or out; that is, no strong navigation associated
* with it except that it is appearing or disappearing for some reason. */
public static final int TRANSIT_FRAGMENT_FADE = 3 | TRANSIT_ENTER_MASK;
/**
* Set specific animation resources to run for the fragments that are
* entering and exiting in this transaction. These animations will not be
* played when popping the back stack.
*/
public abstract FragmentTransaction setCustomAnimations(int enter, int exit);
/**
* Set specific animation resources to run for the fragments that are
* entering and exiting in this transaction. The <code>popEnter</code>
* and <code>popExit</code> animations will be played for enter/exit
* operations specifically when popping the back stack.
*/
public abstract FragmentTransaction setCustomAnimations(int enter, int exit,
int popEnter, int popExit);
/**
* Select a standard transition animation for this transaction. May be
* one of {@link #TRANSIT_NONE}, {@link #TRANSIT_FRAGMENT_OPEN},
* or {@link #TRANSIT_FRAGMENT_CLOSE}
*/
public abstract FragmentTransaction setTransition(int transit);
/**
* Set a custom style resource that will be used for resolving transit
* animations.
*/
public abstract FragmentTransaction setTransitionStyle(int styleRes);
/**
* Add this transaction to the back stack. This means that the transaction
* will be remembered after it is committed, and will reverse its operation
* when later popped off the stack.
*
* @param name An optional name for this back stack state, or null.
*/
public abstract FragmentTransaction addToBackStack(String name);
/**
* Returns true if this FragmentTransaction is allowed to be added to the back
* stack. If this method would return false, {@link #addToBackStack(String)}
* will throw {@link IllegalStateException}.
*
* @return True if {@link #addToBackStack(String)} is permitted on this transaction.
*/
public abstract boolean isAddToBackStackAllowed();
/**
* Disallow calls to {@link #addToBackStack(String)}. Any future calls to
* addToBackStack will throw {@link IllegalStateException}. If addToBackStack
* has already been called, this method will throw IllegalStateException.
*/
public abstract FragmentTransaction disallowAddToBackStack();
/**
* Set the full title to show as a bread crumb when this transaction
* is on the back stack, as used by {@link FragmentBreadCrumbs}.
*
* @param res A string resource containing the title.
*/
public abstract FragmentTransaction setBreadCrumbTitle(int res);
/**
* Like {@link #setBreadCrumbTitle(int)} but taking a raw string; this
* method is <em>not</em> recommended, as the string can not be changed
* later if the locale changes.
*/
public abstract FragmentTransaction setBreadCrumbTitle(CharSequence text);
/**
* Set the short title to show as a bread crumb when this transaction
* is on the back stack, as used by {@link FragmentBreadCrumbs}.
*
* @param res A string resource containing the title.
*/
public abstract FragmentTransaction setBreadCrumbShortTitle(int res);
/**
* Like {@link #setBreadCrumbShortTitle(int)} but taking a raw string; this
* method is <em>not</em> recommended, as the string can not be changed
* later if the locale changes.
*/
public abstract FragmentTransaction setBreadCrumbShortTitle(CharSequence text);
/**
* Schedules a commit of this transaction. The commit does
* not happen immediately; it will be scheduled as work on the main thread
* to be done the next time that thread is ready.
*
* <p class="note">A transaction can only be committed with this method
* prior to its containing activity saving its state. If the commit is
* attempted after that point, an exception will be thrown. This is
* because the state after the commit can be lost if the activity needs to
* be restored from its state. See {@link #commitAllowingStateLoss()} for
* situations where it may be okay to lose the commit.</p>
*
* @return Returns the identifier of this transaction's back stack entry,
* if {@link #addToBackStack(String)} had been called. Otherwise, returns
* a negative number.
*/
public abstract int commit();
/**
* Like {@link #commit} but allows the commit to be executed after an
* activity's state is saved. This is dangerous because the commit can
* be lost if the activity needs to later be restored from its state, so
* this should only be used for cases where it is okay for the UI state
* to change unexpectedly on the user.
*/
public abstract int commitAllowingStateLoss();
}
|
{
"content_hash": "ae2b32b14ac639495f6cba3f189397f4",
"timestamp": "",
"source": "github",
"line_count": 258,
"max_line_length": 100,
"avg_line_length": 41.22868217054263,
"alnum_prop": 0.6853436119206543,
"repo_name": "epiphany27/devoxx-schedule",
"id": "23a1a21f4029a434b88f66c81d409d19c22679b6",
"size": "11256",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "devoxx-android-client/src/android/support/v4/app/FragmentTransaction.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "HTML",
"bytes": "1161"
},
{
"name": "Java",
"bytes": "3048209"
}
],
"symlink_target": ""
}
|
import {
createCodeFixActionWithoutFixAll,
registerCodeFix,
setJsonCompilerOptionValue,
setJsonCompilerOptionValues,
} from "../_namespaces/ts.codefix";
import {
CodeFixAction,
Diagnostics,
Expression,
factory,
getEmitModuleKind,
getEmitScriptTarget,
getTsConfigObjectLiteralExpression,
ModuleKind,
ScriptTarget,
textChanges,
} from "../_namespaces/ts";
registerCodeFix({
errorCodes: [
Diagnostics.Top_level_await_expressions_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_system_node16_or_nodenext_and_the_target_option_is_set_to_es2017_or_higher.code,
Diagnostics.Top_level_for_await_loops_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_system_node16_or_nodenext_and_the_target_option_is_set_to_es2017_or_higher.code,
],
getCodeActions: function getCodeActionsToFixModuleAndTarget(context) {
const compilerOptions = context.program.getCompilerOptions();
const { configFile } = compilerOptions;
if (configFile === undefined) {
return undefined;
}
const codeFixes: CodeFixAction[] = [];
const moduleKind = getEmitModuleKind(compilerOptions);
const moduleOutOfRange = moduleKind >= ModuleKind.ES2015 && moduleKind < ModuleKind.ESNext;
if (moduleOutOfRange) {
const changes = textChanges.ChangeTracker.with(context, changes => {
setJsonCompilerOptionValue(changes, configFile, "module", factory.createStringLiteral("esnext"));
});
codeFixes.push(createCodeFixActionWithoutFixAll("fixModuleOption", changes, [Diagnostics.Set_the_module_option_in_your_configuration_file_to_0, "esnext"]));
}
const target = getEmitScriptTarget(compilerOptions);
const targetOutOfRange = target < ScriptTarget.ES2017 || target > ScriptTarget.ESNext;
if (targetOutOfRange) {
const changes = textChanges.ChangeTracker.with(context, tracker => {
const configObject = getTsConfigObjectLiteralExpression(configFile);
if (!configObject) return;
const options: [string, Expression][] = [["target", factory.createStringLiteral("es2017")]];
if (moduleKind === ModuleKind.CommonJS) {
// Ensure we preserve the default module kind (commonjs), as targets >= ES2015 have a default module kind of es2015.
options.push(["module", factory.createStringLiteral("commonjs")]);
}
setJsonCompilerOptionValues(tracker, configFile, options);
});
codeFixes.push(createCodeFixActionWithoutFixAll("fixTargetOption", changes, [Diagnostics.Set_the_target_option_in_your_configuration_file_to_0, "es2017"]));
}
return codeFixes.length ? codeFixes : undefined;
}
});
|
{
"content_hash": "e4f8c496b1375591d151f3289baf32f4",
"timestamp": "",
"source": "github",
"line_count": 63,
"max_line_length": 192,
"avg_line_length": 46.904761904761905,
"alnum_prop": 0.6602368866328258,
"repo_name": "microsoft/TypeScript",
"id": "3769fa3619ef148c7af9897f292721bb0b8f5034",
"size": "2955",
"binary": false,
"copies": "2",
"ref": "refs/heads/main",
"path": "src/services/codefixes/fixModuleAndTargetOptions.ts",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Dockerfile",
"bytes": "6254"
},
{
"name": "JavaScript",
"bytes": "202322"
},
{
"name": "Shell",
"bytes": "53"
},
{
"name": "TypeScript",
"bytes": "139268941"
}
],
"symlink_target": ""
}
|
UCLASS()
class UTestPawnAction_CallFunction : public UTestPawnAction_Log
{
GENERATED_UCLASS_BODY()
typedef void(*FFunctionToCall)(UPawnActionsComponent& ActionsComponent, UTestPawnAction_CallFunction& Caller, ETestPawnActionMessage::Type);
FFunctionToCall FunctionToCall;
static UTestPawnAction_CallFunction* CreateAction(UWorld& World, FTestLogger<int32>& InLogger, FFunctionToCall InFunctionToCall);
virtual bool Start() override;
virtual bool Pause(const UPawnAction* PausedBy) override;
virtual bool Resume() override;
virtual void OnFinished(EPawnActionResult::Type WithResult) override;
virtual void OnChildFinished(UPawnAction& Action, EPawnActionResult::Type WithResult) override;
};
|
{
"content_hash": "627069107d7834f56579181c21b53bb7",
"timestamp": "",
"source": "github",
"line_count": 16,
"max_line_length": 141,
"avg_line_length": 44,
"alnum_prop": 0.8267045454545454,
"repo_name": "PopCap/GameIdea",
"id": "dfb323a1a92d5fab88acb3fbd4d37c0c3fb077a4",
"size": "874",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "Engine/Source/Developer/AITestSuite/Classes/Actions/TestPawnAction_CallFunction.h",
"mode": "33188",
"license": "bsd-2-clause",
"language": [
{
"name": "ASP",
"bytes": "238055"
},
{
"name": "Assembly",
"bytes": "184134"
},
{
"name": "Batchfile",
"bytes": "116983"
},
{
"name": "C",
"bytes": "84264210"
},
{
"name": "C#",
"bytes": "9612596"
},
{
"name": "C++",
"bytes": "242290999"
},
{
"name": "CMake",
"bytes": "548754"
},
{
"name": "CSS",
"bytes": "134910"
},
{
"name": "GLSL",
"bytes": "96780"
},
{
"name": "HLSL",
"bytes": "124014"
},
{
"name": "HTML",
"bytes": "4097051"
},
{
"name": "Java",
"bytes": "757767"
},
{
"name": "JavaScript",
"bytes": "2742822"
},
{
"name": "Makefile",
"bytes": "1976144"
},
{
"name": "Objective-C",
"bytes": "75778979"
},
{
"name": "Objective-C++",
"bytes": "312592"
},
{
"name": "PAWN",
"bytes": "2029"
},
{
"name": "PHP",
"bytes": "10309"
},
{
"name": "PLSQL",
"bytes": "130426"
},
{
"name": "Pascal",
"bytes": "23662"
},
{
"name": "Perl",
"bytes": "218656"
},
{
"name": "Python",
"bytes": "21593012"
},
{
"name": "SAS",
"bytes": "1847"
},
{
"name": "Shell",
"bytes": "2889614"
},
{
"name": "Tcl",
"bytes": "1452"
}
],
"symlink_target": ""
}
|
module.exports = {
extends: 'semistandard',
rules: {
'arrow-parens': 'error',
eqeqeq: ['error',
'always', { null: 'always' }
],
'for-direction': 'error',
'getter-return': 'error',
indent: ['error', 4, {
SwitchCase: 1
}],
'multiline-ternary': [
'error',
'always-multiline'
],
'no-alert': 'error',
'no-multi-spaces': ['error', {
exceptions: {
VariableDeclarator: true,
ImportDeclaration: true
}
}],
'no-throw-literal': 'off', // This would be desirable, but interferes with use in Promise.then
'one-var': 'off',
quotes: ['error', 'single', {
avoidEscape: true,
allowTemplateLiterals: true
}],
'space-before-function-paren': ['error', {
anonymous: 'always',
named: 'never'
}],
'switch-colon-spacing': 'error',
'backbone/collection-model': 'error',
'backbone/defaults-on-top': ['error', ['resourceName', 'url', 'urlRoot']],
'backbone/event-scope': 'off',
'backbone/events-on-top': ['error', ['tagName', 'className']],
'backbone/events-sort': 'off',
'backbone/initialize-on-top': ['error', {
View: ['tagName', 'className', 'events'],
Model: ['resourceName', 'url', 'urlRoot', 'defaults'],
Collection: ['model', 'resourceName', 'url']
}],
'backbone/model-defaults': 'off',
'backbone/no-changed-set': 'error',
'backbone/no-collection-models': 'error',
'backbone/no-constructor': 'error',
'backbone/no-el-assign': 'error',
'backbone/no-model-attributes': 'error',
'backbone/no-native-jquery': 'off',
'backbone/no-silent': 'error',
'backbone/no-view-collection-models': 'error',
'backbone/no-view-model-attributes': 'error',
'backbone/no-view-onoff-binding': 'off',
'backbone/no-view-qualified-jquery': 'error',
'backbone/render-return': 'error',
'import/exports-last': 'error',
'import/named': 'error',
'import/order': ['error', {
groups: ['builtin', 'external', ['internal', 'parent', 'sibling', 'index']],
'newlines-between': 'always-and-inside-groups'
}],
'promise/always-return': 'error',
'promise/no-native': 'error',
'promise/no-nesting': 'error',
'promise/no-return-in-finally': 'error',
'promise/no-return-wrap': 'error'
/*
* See comments below about removing underscore linting.
'underscore/collection-return': 'error',
'underscore/identity-shorthand': ['error', 'always'],
'underscore/jquery-each': ['error', 'never'],
'underscore/jquery-proxy': ['error', 'never'],
'underscore/matches-shorthand': ['error', 'always'],
'underscore/no-return-value-from-each-iteratee': 'error',
'underscore/no-unnecessary-bind': 'error',
'underscore/prefer-compact': 'error',
'underscore/prefer-constant': 'error',
'underscore/prefer-filter': 'error',
'underscore/prefer-findwhere': 'error',
'underscore/prefer-invoke': 'error',
'underscore/prefer-map': 'error',
'underscore/prefer-matches': 'error',
'underscore/prefer-noop': 'off',
'underscore/prefer-pluck': 'error',
'underscore/prefer-reject': 'error',
'underscore/prefer-times': 'error',
'underscore/prefer-underscore-method': 'off',
'underscore/prefer-underscore-typecheck': 'error',
'underscore/prefer-where': 'error',
'underscore/preferred-alias': 'error',
'underscore/prop-shorthand': ['error', 'always']
*/
},
env: {
browser: true
},
plugins: [
'backbone'
// we had included the underscore plugin, but it is woefully out of
// date and has security warnings on its dependencies. Until we update
// to a better or newer version, disable it so that we don't pull in
// critically insecure packages.
// 'underscore'
],
settings: {
backbone: {
Collection: [
'Collection'
],
Model: [
'Model',
'AccessControlledModel'
],
View: [
'View',
'MetadatumEditWidget'
]
},
'import/internal-regex': '^@scope/'
}
};
|
{
"content_hash": "692d91a3d476d5c457f0b13eea3b7456",
"timestamp": "",
"source": "github",
"line_count": 123,
"max_line_length": 102,
"avg_line_length": 37.53658536585366,
"alnum_prop": 0.5310807883907299,
"repo_name": "manthey/girder",
"id": "200feaa020d0b22668511548cb6f3dffd3c61634",
"size": "4617",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "girder/web_client/eslint-config/index.js",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "CMake",
"bytes": "26244"
},
{
"name": "CSS",
"bytes": "6537"
},
{
"name": "Dockerfile",
"bytes": "1528"
},
{
"name": "HTML",
"bytes": "14"
},
{
"name": "JavaScript",
"bytes": "1175790"
},
{
"name": "Jinja",
"bytes": "322"
},
{
"name": "Mako",
"bytes": "7571"
},
{
"name": "Pug",
"bytes": "137980"
},
{
"name": "Python",
"bytes": "2016093"
},
{
"name": "Roff",
"bytes": "17"
},
{
"name": "Shell",
"bytes": "3354"
},
{
"name": "Stylus",
"bytes": "48706"
}
],
"symlink_target": ""
}
|
Ext.BLANK_IMAGE_URL = 'resources/s.gif';
Docs = {};
ApiPanel = function() {
ApiPanel.superclass.constructor.call(this, {
id:'api-tree',
region:'west',
split:true,
width: 280,
minSize: 175,
maxSize: 500,
collapsible: true,
margins:'0 0 5 5',
cmargins:'0 0 0 0',
rootVisible:false,
lines:false,
autoScroll:true,
animCollapse:false,
animate: false,
collapseMode:'mini',
loader: new Ext.tree.TreeLoader({
preloadChildren: true,
clearOnLoad: false
}),
root: new Ext.tree.AsyncTreeNode({
text:'Ext JS',
id:'root',
expanded:true,
children:[Docs.classData]
}),
collapseFirst:false
});
// no longer needed!
//new Ext.tree.TreeSorter(this, {folderSort:true,leafAttr:'isClass'});
this.getSelectionModel().on('beforeselect', function(sm, node){
return node.isLeaf();
});
};
Ext.extend(ApiPanel, Ext.tree.TreePanel, {
selectClass : function(cls){
if(cls){
var parts = cls.split('.');
var last = parts.length-1;
for(var i = 0; i < last; i++){ // things get nasty - static classes can have .
var p = parts[i];
var fc = p.charAt(0);
var staticCls = fc.toUpperCase() == fc;
if(p == 'Ext' || !staticCls){
parts[i] = 'pkg-'+p;
}else if(staticCls){
--last;
parts.splice(i, 1);
}
}
parts[last] = cls;
this.selectPath('/root/apidocs/'+parts.join('/'));
}
}
});
DocPanel = Ext.extend(Ext.Panel, {
closable: true,
autoScroll:true,
initComponent : function(){
var ps = this.cclass.split('.');
this.title = ps[ps.length-1];
DocPanel.superclass.initComponent.call(this);
},
scrollToMember : function(member){
var el = Ext.fly(this.cclass + '-' + member);
if(el){
var top = (el.getOffsetsTo(this.body)[1]) + this.body.dom.scrollTop;
this.body.scrollTo('top', top-25, {duration:.75, callback: this.hlMember.createDelegate(this, [member])});
}
},
scrollToSection : function(id){
var el = Ext.getDom(id);
if(el){
var top = (Ext.fly(el).getOffsetsTo(this.body)[1]) + this.body.dom.scrollTop;
this.body.scrollTo('top', top-25, {duration:.5, callback: function(){
Ext.fly(el).next('h2').pause(.2).highlight('#8DB2E3', {attr:'color'});
}});
}
},
hlMember : function(member){
var el = Ext.fly(this.cclass + '-' + member);
if(el){
el.up('tr').highlight('#cadaf9');
}
}
});
MainPanel = function(){
this.searchStore = new Ext.data.Store({
proxy: new Ext.data.ScriptTagProxy({
url: 'http://extjs.com/playpen/api.php'
}),
reader: new Ext.data.JsonReader({
root: 'data'
},
['cls', 'member', 'type', 'doc']
),
baseParams: {},
listeners: {
'beforeload' : function(){
this.baseParams.qt = Ext.getCmp('search-type').getValue();
}
}
});
MainPanel.superclass.constructor.call(this, {
id:'doc-body',
region:'center',
margins:'0 5 5 0',
resizeTabs: true,
minTabWidth: 135,
tabWidth: 135,
plugins: new Ext.ux.TabCloseMenu(),
enableTabScroll: true,
activeTab: 0,
items: {
id:'welcome-panel',
title: 'API Home',
autoLoad: {url: 'welcome.html', callback: this.initSearch, scope: this},
iconCls:'icon-docs',
autoScroll: true,
tbar: [
'Search: ', ' ',
new Ext.ux.SelectBox({
listClass:'x-combo-list-small',
width:90,
value:'Starts with',
id:'search-type',
store: new Ext.data.SimpleStore({
fields: ['text'],
expandData: true,
data : ['Starts with', 'Ends with', 'Any match']
}),
displayField: 'text'
}), ' ',
new Ext.app.SearchField({
width:240,
store: this.searchStore,
paramName: 'q'
})
]
}
});
};
Ext.extend(MainPanel, Ext.TabPanel, {
initEvents : function(){
MainPanel.superclass.initEvents.call(this);
this.body.on('click', this.onClick, this);
},
onClick: function(e, target){
if(target = e.getTarget('a:not(.exi)', 3)){
var cls = Ext.fly(target).getAttributeNS('ext', 'cls');
e.stopEvent();
if(cls){
var member = Ext.fly(target).getAttributeNS('ext', 'member');
this.loadClass(target.href, cls, member);
}else if(target.className == 'inner-link'){
this.getActiveTab().scrollToSection(target.href.split('#')[1]);
}else{
window.open(target.href);
}
}else if(target = e.getTarget('.micon', 2)){
e.stopEvent();
var tr = Ext.fly(target.parentNode);
if(tr.hasClass('expandable')){
tr.toggleClass('expanded');
}
}
},
loadClass : function(href, cls, member){
var id = 'docs-' + cls;
var tab = this.getComponent(id);
if(tab){
this.setActiveTab(tab);
if(member){
tab.scrollToMember(member);
}
}else{
var autoLoad = {url: href};
if(member){
autoLoad.callback = function(){
Ext.getCmp(id).scrollToMember(member);
}
}
var p = this.add(new DocPanel({
id: id,
cclass : cls,
autoLoad: autoLoad,
iconCls: Docs.icons[cls]
}));
this.setActiveTab(p);
}
},
initSearch : function(){
// Custom rendering Template for the View
var resultTpl = new Ext.XTemplate(
'<tpl for=".">',
'<div class="search-item">',
'<a class="member" ext:cls="{cls}" ext:member="{member}" href="output/{cls}.html">',
'<img src="../resources/images/default/s.gif" class="item-icon icon-{type}"/>{member}',
'</a> ',
'<a class="cls" ext:cls="{cls}" href="output/{cls}.html">{cls}</a>',
'<p>{doc}</p>',
'</div></tpl>'
);
var p = new Ext.DataView({
applyTo: 'search',
tpl: resultTpl,
loadingText:'Searching...',
store: this.searchStore,
itemSelector: 'div.search-item',
emptyText: '<h3>Use the search field above to search the Ext API for classes, properties, config options, methods and events.</h3>'
});
},
doSearch : function(e){
var k = e.getKey();
if(!e.isSpecialKey()){
var text = e.target.value;
if(!text){
this.searchStore.baseParams.q = '';
this.searchStore.removeAll();
}else{
this.searchStore.baseParams.q = text;
this.searchStore.reload();
}
}
}
});
Ext.onReady(function(){
Ext.QuickTips.init();
var api = new ApiPanel();
var mainPanel = new MainPanel();
api.on('click', function(node, e){
if(node.isLeaf()){
e.stopEvent();
mainPanel.loadClass(node.attributes.href, node.id);
}
});
mainPanel.on('tabchange', function(tp, tab){
api.selectClass(tab.cclass);
});
var hd = new Ext.Panel({
border: false,
layout:'anchor',
region:'north',
cls: 'docs-header',
height:60,
items: [{
xtype:'box',
el:'header',
border:false,
anchor: 'none -25'
},
new Ext.Toolbar({
cls:'top-toolbar',
items:[ ' ',
new Ext.form.TextField({
width: 200,
emptyText:'Find a Class',
listeners:{
render: function(f){
f.el.on('keydown', filterTree, f, {buffer: 350});
}
}
}), ' ', ' ',
{
iconCls: 'icon-expand-all',
tooltip: 'Expand All',
handler: function(){ api.root.expand(true); }
}, '-', {
iconCls: 'icon-collapse-all',
tooltip: 'Collapse All',
handler: function(){ api.root.collapse(true); }
}, '->', {
tooltip:'Hide Inherited Members',
iconCls: 'icon-hide-inherited',
enableToggle: true,
toggleHandler : function(b, pressed){
mainPanel[pressed ? 'addClass' : 'removeClass']('hide-inherited');
}
}, '-', {
tooltip:'Expand All Members',
iconCls: 'icon-expand-members',
enableToggle: true,
toggleHandler : function(b, pressed){
mainPanel[pressed ? 'addClass' : 'removeClass']('full-details');
}
}]
})]
})
var viewport = new Ext.Viewport({
layout:'border',
items:[ hd, api, mainPanel ]
});
api.expandPath('/root/apidocs');
// allow for link in
var page = window.location.href.split('?')[1];
if(page){
var ps = Ext.urlDecode(page);
var cls = ps['class'];
mainPanel.loadClass('output/' + cls + '.html', cls, ps.member);
}
viewport.doLayout();
setTimeout(function(){
Ext.get('loading').remove();
Ext.get('loading-mask').fadeOut({remove:true});
}, 250);
var filter = new Ext.tree.TreeFilter(api, {
clearBlank: true,
autoClear: true
});
var hiddenPkgs = [];
function filterTree(e){
var text = e.target.value;
Ext.each(hiddenPkgs, function(n){
n.ui.show();
});
if(!text){
filter.clear();
return;
}
api.expandAll();
var re = new RegExp('^' + Ext.escapeRe(text), 'i');
filter.filterBy(function(n){
return !n.attributes.isClass || re.test(n.text);
});
// hide empty packages that weren't filtered
hiddenPkgs = [];
api.root.cascade(function(n){
if(!n.attributes.isClass && n.ui.ctNode.offsetHeight < 3){
n.ui.hide();
hiddenPkgs.push(n);
}
});
}
});
Ext.app.SearchField = Ext.extend(Ext.form.TwinTriggerField, {
initComponent : function(){
if(!this.store.baseParams){
this.store.baseParams = {};
}
Ext.app.SearchField.superclass.initComponent.call(this);
this.on('specialkey', function(f, e){
if(e.getKey() == e.ENTER){
this.onTrigger2Click();
}
}, this);
},
validationEvent:false,
validateOnBlur:false,
trigger1Class:'x-form-clear-trigger',
trigger2Class:'x-form-search-trigger',
hideTrigger1:true,
width:180,
hasSearch : false,
paramName : 'query',
onTrigger1Click : function(){
if(this.hasSearch){
this.store.baseParams[this.paramName] = '';
this.store.removeAll();
this.el.dom.value = '';
this.triggers[0].hide();
this.hasSearch = false;
this.focus();
}
},
onTrigger2Click : function(){
var v = this.getRawValue();
if(v.length < 1){
this.onTrigger1Click();
return;
}
if(v.length < 2){
Ext.Msg.alert('Invalid Search', 'You must enter a minimum of 2 characters to search the API');
return;
}
this.store.baseParams[this.paramName] = v;
var o = {start: 0};
this.store.reload({params:o});
this.hasSearch = true;
this.triggers[0].show();
this.focus();
}
});
/**
* Makes a ComboBox more closely mimic an HTML SELECT. Supports clicking and dragging
* through the list, with item selection occurring when the mouse button is released.
* When used will automatically set {@link #editable} to false and call {@link Ext.Element#unselectable}
* on inner elements. Re-enabling editable after calling this will NOT work.
*
* @author Corey Gilmore
* http://extjs.com/forum/showthread.php?t=6392
*
* @history 2007-07-08 jvs
* Slight mods for Ext 2.0
*/
Ext.ux.SelectBox = function(config){
this.searchResetDelay = 1000;
config = config || {};
config = Ext.apply(config || {}, {
editable: false,
forceSelection: true,
rowHeight: false,
lastSearchTerm: false,
triggerAction: 'all',
mode: 'local'
});
Ext.ux.SelectBox.superclass.constructor.apply(this, arguments);
this.lastSelectedIndex = this.selectedIndex || 0;
};
Ext.extend(Ext.ux.SelectBox, Ext.form.ComboBox, {
lazyInit: false,
initEvents : function(){
Ext.ux.SelectBox.superclass.initEvents.apply(this, arguments);
// you need to use keypress to capture upper/lower case and shift+key, but it doesn't work in IE
this.el.on('keydown', this.keySearch, this, true);
this.cshTask = new Ext.util.DelayedTask(this.clearSearchHistory, this);
},
keySearch : function(e, target, options) {
var raw = e.getKey();
var key = String.fromCharCode(raw);
var startIndex = 0;
if( !this.store.getCount() ) {
return;
}
switch(raw) {
case Ext.EventObject.HOME:
e.stopEvent();
this.selectFirst();
return;
case Ext.EventObject.END:
e.stopEvent();
this.selectLast();
return;
case Ext.EventObject.PAGEDOWN:
this.selectNextPage();
e.stopEvent();
return;
case Ext.EventObject.PAGEUP:
this.selectPrevPage();
e.stopEvent();
return;
}
// skip special keys other than the shift key
if( (e.hasModifier() && !e.shiftKey) || e.isNavKeyPress() || e.isSpecialKey() ) {
return;
}
if( this.lastSearchTerm == key ) {
startIndex = this.lastSelectedIndex;
}
this.search(this.displayField, key, startIndex);
this.cshTask.delay(this.searchResetDelay);
},
onRender : function(ct, position) {
this.store.on('load', this.calcRowsPerPage, this);
Ext.ux.SelectBox.superclass.onRender.apply(this, arguments);
if( this.mode == 'local' ) {
this.calcRowsPerPage();
}
},
onSelect : function(record, index, skipCollapse){
if(this.fireEvent('beforeselect', this, record, index) !== false){
this.setValue(record.data[this.valueField || this.displayField]);
if( !skipCollapse ) {
this.collapse();
}
this.lastSelectedIndex = index + 1;
this.fireEvent('select', this, record, index);
}
},
render : function(ct) {
Ext.ux.SelectBox.superclass.render.apply(this, arguments);
if( Ext.isSafari ) {
this.el.swallowEvent('mousedown', true);
}
this.el.unselectable();
this.innerList.unselectable();
this.trigger.unselectable();
this.innerList.on('mouseup', function(e, target, options) {
if( target.id && target.id == this.innerList.id ) {
return;
}
this.onViewClick();
}, this);
this.innerList.on('mouseover', function(e, target, options) {
if( target.id && target.id == this.innerList.id ) {
return;
}
this.lastSelectedIndex = this.view.getSelectedIndexes()[0] + 1;
this.cshTask.delay(this.searchResetDelay);
}, this);
this.trigger.un('click', this.onTriggerClick, this);
this.trigger.on('mousedown', function(e, target, options) {
e.preventDefault();
this.onTriggerClick();
}, this);
this.on('collapse', function(e, target, options) {
Ext.getDoc().un('mouseup', this.collapseIf, this);
}, this, true);
this.on('expand', function(e, target, options) {
Ext.getDoc().on('mouseup', this.collapseIf, this);
}, this, true);
},
clearSearchHistory : function() {
this.lastSelectedIndex = 0;
this.lastSearchTerm = false;
},
selectFirst : function() {
this.focusAndSelect(this.store.data.first());
},
selectLast : function() {
this.focusAndSelect(this.store.data.last());
},
selectPrevPage : function() {
if( !this.rowHeight ) {
return;
}
var index = Math.max(this.selectedIndex-this.rowsPerPage, 0);
this.focusAndSelect(this.store.getAt(index));
},
selectNextPage : function() {
if( !this.rowHeight ) {
return;
}
var index = Math.min(this.selectedIndex+this.rowsPerPage, this.store.getCount() - 1);
this.focusAndSelect(this.store.getAt(index));
},
search : function(field, value, startIndex) {
field = field || this.displayField;
this.lastSearchTerm = value;
var index = this.store.find.apply(this.store, arguments);
if( index !== -1 ) {
this.focusAndSelect(index);
}
},
focusAndSelect : function(record) {
var index = typeof record === 'number' ? record : this.store.indexOf(record);
this.select(index, this.isExpanded());
this.onSelect(this.store.getAt(record), index, this.isExpanded());
},
calcRowsPerPage : function() {
if( this.store.getCount() ) {
this.rowHeight = Ext.fly(this.view.getNode(0)).getHeight();
this.rowsPerPage = this.maxHeight / this.rowHeight;
} else {
this.rowHeight = false;
}
}
});
Ext.Ajax.on('requestcomplete', function(ajax, xhr, o){
if(typeof urchinTracker == 'function' && o && o.url){
urchinTracker(o.url);
}
});
|
{
"content_hash": "83a13b0fb9b329603d5e8a87860e06c4",
"timestamp": "",
"source": "github",
"line_count": 629,
"max_line_length": 134,
"avg_line_length": 27.467408585055644,
"alnum_prop": 0.556404468368351,
"repo_name": "stexas/DBAdmin",
"id": "b949397820a5a057831aabd125a9d93797a32215",
"size": "17277",
"binary": false,
"copies": "12",
"ref": "refs/heads/master",
"path": "ext/docs/resources/docs.js",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "JavaScript",
"bytes": "3356832"
},
{
"name": "PHP",
"bytes": "79325"
}
],
"symlink_target": ""
}
|
az vm list > /dev/null 2>&1
if [ $? -ne 0 ]; then
echo "You need to login to Azure"
echo "After successful authentication run $0 again"
# login
az login
exit 2
fi
ACTION="start"
# Resource Group
resourceGroup=$(curl -s -H Metadata:true http://169.254.169.254/metadata/instance?api-version=2017-08-01 | jq .compute.resourceGroupName --raw-output)
if [ -z "${resourceGroup}" ]; then
echo "Couldn't find the Resource Group name using Azure Metadata"
exit 1
fi
echo "Starting Cluster ${resourceGroup}"
# Private Agents
echo "Starting Private Agents"
NUM_AGENTS=0
for file in down_a*.log; do
name=$(echo ${file} | cut -d '_' -f2 | cut -d '.' -f1)
az vm ${ACTION} --resource-group ${resourceGroup} --name ${resourceGroup}${name} > up_${name}.log 2>&1 &
echo "${ACTION} ${name}"
NUM_AGENTS=$(( NUM_AGENTS + 1 ))
done
# Wait for all private agetns to start before starting master and public
cnt=0
echo "Waiting for Private Agents to Start"
while [ $cnt -lt ${NUM_AGENTS} ]; do
sleep 10
cnt=$(cat up_a?.log 2>/dev/null | grep Succeeded | wc -l)
echo "$(date +%H:%M:%S) : $cnt of ${NUM_AGENTS} private agents have started"
done
echo "All Private Agents have Started"
# Give the Private Agents a Minute to stablize
sleep 60
echo "Staring Public Agents"
for file in down_p*.log; do
name=$(echo ${file} | cut -d '_' -f2 | cut -d '.' -f1)
echo "${ACTION} ${name}"
az vm ${ACTION} --resource-group ${resourceGroup} --name ${resourceGroup}${name} > up_${name}.log 2>&1
done
echo "Staring Masters"
for file in down_m*.log; do
name=$(echo ${file} | cut -d '_' -f2 | cut -d '.' -f1)
echo "${ACTION} ${name}"
az vm ${ACTION} --resource-group ${resourceGroup} --name ${resourceGroup}${name} > up_${name}.log 2>&1
done
echo "All nodes are running"
|
{
"content_hash": "ea47a7dc5d27be76f5e84322d548ddd0",
"timestamp": "",
"source": "github",
"line_count": 61,
"max_line_length": 150,
"avg_line_length": 29.327868852459016,
"alnum_prop": 0.6539966461710452,
"repo_name": "david618/dcosadmin",
"id": "c82c45f641917865f42e646584ca6968e650d3fd",
"size": "1832",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "azure/cli/startup_cluster_azure.sh",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Python",
"bytes": "2360"
},
{
"name": "Shell",
"bytes": "43458"
}
],
"symlink_target": ""
}
|
'use strict';
describe('Directive: svgInlineSymbol', function () {
var Driver = function () {
var driver = this;
var $document;
var element;
var template = '<inline-svg-symbol sprite="{{sprite}}" symbol="outerSymbolId" />';
module('inline-svg');
inject(function (_$document_) {
$document = _$document_;
});
this.given = {
symbol: function (sprite, symbolId) {
element = angular.element(template.replace('{{sprite}}', sprite));
inject(function ($compile, $rootScope) {
var scope = $rootScope.$new();
scope.outerSymbolId = symbolId;
element = $compile(element)(scope);
$rootScope.$apply();
});
return driver;
},
sprite: function (sprite, content) {
inject(function ($httpBackend) {
$httpBackend.whenGET(sprite).respond(content);
});
return driver;
}
};
this.when = {
includeSymbol: function (sprite, symbolId) {
element = angular.element(template.replace('{{sprite}}', sprite));
inject(function ($compile, $rootScope) {
var scope = $rootScope.$new();
scope.outerSymbolId = symbolId;
element = $compile(element)(scope);
$rootScope.$apply();
});
return driver;
},
spriteLoaded : function () {
try {
inject(function ($httpBackend) {
$httpBackend.flush();
});
} catch (e) {
}
}
};
this.dispose = function () {
var svgs = $document[0].querySelectorAll('svg[data-sprite]');
for (var i = 0; i < svgs.length; i++) {
$document[0].body.removeChild(svgs[i]);
}
};
this.get = {
domSprites: function () {
return $document[0].querySelectorAll('svg[data-sprite]');
},
symbols : function () {
return element[0].querySelectorAll('use');
}
};
this.matchers = {
toBeHidden: function () {
return {
compare: function (actual) {
var valid = true;
for (var i = 0; i < actual.length; i++) {
valid = valid && actual[i].classList.contains('ng-hide');
}
return {pass: valid};
}
};
}
};
};
var driver;
beforeEach(function () {
driver = new Driver();
jasmine.addMatchers(driver.matchers);
});
afterEach(function () {
driver.dispose();
});
it('should create one symbol with sprite', function () {
driver.given.sprite('mySprite.html',
'<svg>' +
' <g id="myId">{{1+2}}</g>' +
'</svg>')
.when.includeSymbol('mySprite.html', '#myId')
.when.spriteLoaded();
expect(driver.get.domSprites().length).toBe(1);
expect(driver.get.domSprites()).toBeHidden();
expect(driver.get.domSprites()[0].querySelector('#myId').textContent).toBe('3');
expect(driver.get.symbols()[0].getAttribute('xlink:href') === '#myId').toBeTruthy();
});
it('should create one sprite for each one', function () {
driver.given.sprite('mySprite1.html', '<svg><g id="myId1"></g><g id="myId2"></g></svg>')
.given.sprite('mySprite2.html', '<svg><g id="myId3"></g></svg>')
.when.includeSymbol('mySprite1.html', '#myId1')
.when.includeSymbol('mySprite1.html', '#myId2')
.when.spriteLoaded();
expect(driver.get.domSprites().length).toBe(1);
driver.when.includeSymbol('mySprite2.html', '#myId3')
.when.spriteLoaded();
expect(driver.get.domSprites().length).toBe(2);
});
});
|
{
"content_hash": "5b57df13a21f3af4b17844e4ad66fa9b",
"timestamp": "",
"source": "github",
"line_count": 121,
"max_line_length": 90,
"avg_line_length": 26.818181818181817,
"alnum_prop": 0.6058551617873652,
"repo_name": "alonn24/angular-inline-svg",
"id": "a8310201454a87e2570f4f098266cae8c464fd06",
"size": "3245",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "test/ngInlineSvg.spec.js",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "JavaScript",
"bytes": "8648"
}
],
"symlink_target": ""
}
|
// --------------------------------------------------------------------------------------------------------------------
// <copyright file="MainWindow.xaml.cs" company="Helix 3D Toolkit">
// http://helixtoolkit.codeplex.com, license: MIT
// </copyright>
// --------------------------------------------------------------------------------------------------------------------
namespace CuttingPlanesDemo
{
using System.Windows;
using ExampleBrowser;
/// <summary>
/// Interaction logic for MainWindow.xaml
/// </summary>
[Example(null, "Applies cutting planes to a model.")]
public partial class MainWindow : Window
{
public MainWindow()
{
InitializeComponent();
/*var mb = new MeshBuilder();
mb.AddSphere(new Point3D(0, 0, 0), 1);
var mesh = mb.ToMesh();
var n = new Vector3D(0, 0.2, 1);
var p = new Point3D(0, 0, 0.5);
var geo = MeshGeometryHelper.Cut(mesh, p,n);
var m = new GeometryModel3D(geo, Materials.Blue);
m.BackMaterial = Materials.Red;
var mv = new ModelVisual3D();
mv.Content = m;
view1.Children.Add(mv);
var segments = MeshGeometryHelper.GetContourSegments(mesh, p,n).ToList();
foreach (IList<Point3D> contour in MeshGeometryHelper.CombineSegments(segments, 1e-6).ToList())
{
if (contour.Count == 0)
continue;
view1.Children.Add(new TubeVisual3D { Diameter = 0.02, Path = contour, Fill = Brushes.Green });
}
view1.Children.Add(new RectangleVisual3D { Origin = p, Normal = n, Fill = new SolidColorBrush(Color.FromArgb(80, 255, 0, 0)) });*/
}
}
}
|
{
"content_hash": "0751bbcc662df178b201801ddbe69ed0",
"timestamp": "",
"source": "github",
"line_count": 43,
"max_line_length": 142,
"avg_line_length": 42.30232558139535,
"alnum_prop": 0.48158328752061574,
"repo_name": "smallholexu/helix-toolkit",
"id": "d32a380a05f19c9fa55cf89d77e8a1c4dede55f7",
"size": "1819",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "Source/Examples/WPF/ExampleBrowser/Examples/CuttingPlanes/MainWindow.xaml.cs",
"mode": "33188",
"license": "mit",
"language": [],
"symlink_target": ""
}
|
title: Inviare report mail di Veeam Endpoint Backup.
author: Dema
layout: post
date: 2015-06-15 09:28:24+00:00
tags:
- Veeam
---
## Parte 1: Dotarsi di un server mail all'interno della LAN
Per avere un servizio che spara messaggi mail, abbiamo bisogno di un server smtp interno, in quanto la quasi totalità degli smtp daemons esterni avrà bisogno di qualche layer di complicazione di autentica, che questo script per powershell, rudimentale, ma molto efficace, non supporta.
Per lo scopo, bisognerà appoggiarsi ad un server linux interno alla rete locale, o, in mancanza di un server linux vero e proprio appoggiarsi ad un Raspberry P che può egregiamente funzionare come server smtp di relay esterno.
Tralascio la configurazione di un server smtp semplice interno alla lan che faccia relay verso un altro smtp. Noi amiamo il servizio di invio massivo di mandrillapp e per configurare postfix per fare relay verso mandrilapp, si può copiare la configurazione che si trova sulla [repo pubblica myusefulconfig su github](https://github.com/anton-dema/myusefulconfigs/tree/master/postfix)
Una volta appurato che il nostro server mail interno riesce correttamente ad inviare email attraverso il relay di mandrillapp, possiamo concentrarci sui singoli client di windows per l'invio di email di allarme per il programma Veeam Endpoint Backup.
## Parte 2: Configurare Windows PowerShell per l'esecuzione di script.
Già, perché di default, windows power shell non ammette l'esecuzione di script che:
- non abbiano una apposita signature che ne accerta la sicurezza
- che provengano da un altro computer
- che provengano da internet e ogni volta ci verrà richiesto di confermare se si intende eseguire lo script oppure no.
Per prima cosa, lanciamo Powershell come Amministratore e ``Set-ExecutionPolicy Unrestricted`` .
In questo modo potremo eseguire script di powershell non firmati.
È a questo punto che dobbiamo compilare il seguente script per estrarre l'ultima entry del log di Veeam Endpoint Backup e inviare una mail con il report di sucesso o fallimento delle copie.
Ecco lo script qui di seguito:
###########################################################
# Edit this part:
$youremailserver= ""$an.internal.mailserver""
$sender = "you@yourorganization"
$recipient = "you@yourrecipient"
###########################################################
# Put most info into the body of the email:
$TimeGenerated = get-eventlog "Veeam Endpoint Backup" -newest 1 -entrytype Information, Warning, Error -source "Veeam Endpoint Backup" | Format-List -property TimeGenerated | out-string
$Source = get-eventlog "Veeam Endpoint Backup" -newest 1 -entrytype Information, Warning, Error -source "Veeam Endpoint Backup" | Format-List -property Source | out-string
$EntryType = get-eventlog "Veeam Endpoint Backup" -newest 1 -entrytype Information, Warning, Error -source "Veeam Endpoint Backup" | Format-List -property EntryType | out-string
$Message = get-eventlog "Veeam Endpoint Backup" -newest 1 -entrytype Information, Warning, Error -source "Veeam Endpoint Backup" | Format-List -property Message | out-string
$InstanceID = get-eventlog "Veeam Endpoint Backup" -newest 1 -entrytype Information, Warning, Error -source "Veeam Endpoint Backup" | Format-List -property InstanceID| out-string
$Body = " $TimeGenerated Instance-ID: $InstanceID $Message "
# Determine the subject according to the result of the backup:
if ($Message.contains("Success")) {
$subject = "EndpointBackup finished with Success."
} elseif ($InstanceID.contains("110")) {
$subject = "EndpointBackup started."
} else {
$subject = "EndpointBackup finished but NO SUCCESS!! Check Body for details."
}
# Send the email using the powershell object (replace with e.g. blat.exe for older powershell-Versions)
if ($InstanceID.contains("110") -Or $InstanceID.contains("190")) {
Send-MailMessage -To $recipient -Subject $subject -From $sender -Body $body -SmtpServer $Youremailserver
} else {
write-host "I don't want messages on 10010 and 10050 Restorepoint-creation or -remove Emails, skip those"
}
write-host "Script finished with -$instanceID- as the last event-ID"
Oltre ai parametri da variare subito all'inizio dello script, occorrerà cambiare anche la stringa
-source "Veeam Endpoint Backup"
in quanto mi è capitato che alcune installazioni di Veeam Endpoint Backup scrivono all'interno del registro di windows come sorgente Veeam EP. In questo caso, occorre rimpiazzare il testo _Veeam Endpoint Backup_ con _Veeam EP_.
Una volta aggiustato lo script con i giusti parametri, possiamo salvarlo con estensione ps1 all'inteno di una directory di nostra scelta.
Io l'ho messo all'interno di **\documents\VEB\veb.ps1**. Quindi basta lanciare powershell, posizionarsi su **C:\Users\$User\Documents\VEB\** e lanciare **.\veb.ps1** .
Se tutto andrà bene, dovremmo ricevere la mail con il risultato delle ultime copie di Veeam Endpoint Backup.
Se abbiamo compilato lo script su un altro computer, dobbiamo compiere un ulteriore passo per sbloccare il file, e fare in modo che powershell non chieda ogni volta se vogliamo eseguire lo script in questione. Lo facciamo da esplora risorse, posizionandoci sul file veb.ps1, cliccando con il tasto destro e scegliendo _sblocca file_.
## Automatizziamo con Pianifica Attività di Windows
Dobbiamo a questo punto pianificare l'esecuzione dello script, di modo che, ogni volta che viene eseguita una copia tramite Veeam Endpoint Backup, una mail di notifica venga inviata al nostro indirizzo email scelto.
Apriamo il gestore di utilità di pianificazione di windows e nel riquadro di destra scegliamo "Crea attività di base"
Seguiamo il wizard, inserendo le seguenti istruzioni:
- crea un'attività di base -> Nome : Veeam Endpoint Backup Email - Descrizione: "facoltativa"
- _avanti_
- Attivazione: Specificare quando avviare l'attività: Alla registrazione di un evento specifico.
- _avanti_
- Registro : Drop down e scegliamo Veeam Endpoint Backup - Origine : dropdown Veeam Endpoint Backup - ID evento: **190**
- Azione: Avvio programma.
- _avanti_
- Nella box programma o script, scrivere il full path di Windows PowerShell:
C:\Windows\Sytem32\WindowsPowerShell\v1.0\powershell.exe
e su _aggiungi argomenti (facoltativo)_
C:\Users\$user\Documents\VEB\veb.ps1
- _avanti_
- Verificare i parametri e scegliere _fine_.
Se tutto è andato liscio, appena Veeam Endpoint Backup terminerà le sue copie giornaliere, il nostro script andrà a leggere il registro eventi di Windows, selezionerà la riga che più ci interessa, ossia se le copie si sono completate con successo oppure no e ci notificherà a riguardo via email.
Questo foglio di howto, è stato reso disponibile per la prima volta il 15/06/2015 all'interno del nostro slack aziendale, cpline.slack.com
Credits [@feelgoodeule sul forum di Veeam](http://forums.veeam.com/veeam-endpoint-backup-f33/here-it-is-powershell-script-to-add-veb-emails-t27569.html)
|
{
"content_hash": "c5a5661c2d1eeb3ec2099cf3beb5f467",
"timestamp": "",
"source": "github",
"line_count": 111,
"max_line_length": 385,
"avg_line_length": 67.68468468468468,
"alnum_prop": 0.714228670304805,
"repo_name": "anton-dema/anton-dema.github.io",
"id": "608243f2f77fb5a6e4662fa45bd1788778449707",
"size": "7541",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "_drafts/new-draft.md",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "31114"
},
{
"name": "HTML",
"bytes": "14371"
},
{
"name": "JavaScript",
"bytes": "53211"
},
{
"name": "PHP",
"bytes": "1097"
}
],
"symlink_target": ""
}
|
define([
"dojo/topic",
"dojo/has",
"storymaps/utils/Helper",
"storymaps/maptour/core/MapTourHelper"
],
function (
topic,
has,
Helper,
MapTourHelper
) {
var FADE_DELAY = 6000,
DEFAULT_VALUE = 10;
return function Autoplay(container, loadNext)
{
var _isPlaying = false,
_timeout = null,
_nextIndex = null,
// UI
_mouseMoveTime = null,
_isHoverWidget = false;
if ( ! container
|| ! loadNext || typeof loadNext !== 'function') {
console.log("Autoplay: failed to initialize");
}
container.show();
initEvents();
//
// Public methods
//
this.init = function(params)
{
if ( ! params ) {
return;
}
if ( params.color ) {
if ( params.useBackdrop ) {
container.find('.backdrop').css({
backgroundColor: params.color,
display: 'block'
});
// Cancel default color
container.find('.autoplay-container').css({
backgroundColor: 'inherit'
});
}
else {
// Hack for MT, for some reason can't use the backdrop
container.find('.autoplay-container').css({
backgroundColor: Helper.hex2rgba(params.color, MapTourHelper.isModernLayout() ? 0.85 : 1)
});
}
}
if ( params.themeMajor ) {
container.addClass('theme-' + params.themeMajor);
}
};
this.start = function()
{
startAutoplay(false);
updatePlayPauseButton(true);
};
this.stop = function()
{
pause();
updatePlayPauseButton(false);
};
// On user navigation: allow autoplay to Listen for app navigation even and stop autoplay if not in sync
this.onNavigationEvent = function(index)
{
if ( isPlaying() && index != _nextIndex ) {
onPlayPauseClick();
}
};
//
// Autoplay start & stop
//
function start(delay, immediate)
{
console.log("Autoplay: start, delay:", delay, "immediate:", immediate);
_isPlaying = true;
// Clean up
if ( _timeout ) {
clearTimeout(_timeout);
}
if (immediate) {
loadNextWrapper(delay);
}
else {
_timeout = setTimeout(function() {
loadNextWrapper(delay);
}, delay);
}
}
function pause()
{
if ( ! _isPlaying ) {
return;
}
console.log("Autoplay: pause");
_isPlaying = false;
if ( _timeout ) {
clearTimeout(_timeout);
}
}
function loadNextWrapper(delay)
{
_nextIndex = loadNext();
_timeout = setTimeout(function() {
loadNextWrapper(delay);
}, delay);
}
///////////////////
// UI
///////////////////
//
// Play/pause button
//
function isPlaying()
{
return container.find(".btn-play-container").hasClass("status-play");
}
function updatePlayPauseButton(isPlaying)
{
container.find(".btn-play-container").removeClass("status-play status-pause");
container.find(".btn-play").removeClass("autoplay-icon-play autoplay-icon-pause");
container.find(".btn-play-container").addClass(isPlaying ? "status-play" : "status-pause");
container.find(".btn-play").addClass(isPlaying ? "autoplay-icon-pause" : "autoplay-icon-play");
}
function onPlayPauseClick()
{
var newStatus = ! isPlaying();
if (newStatus){
startAutoplay(true);
}
else {
pause();
}
updatePlayPauseButton(newStatus);
}
function startAutoplay(immediate)
{
var delay = container.find('.slider input').slider("getValue").val() || DEFAULT_VALUE;
start(
delay * 1000,
immediate
);
}
//
// Container display on Desktop
//
function activateContainer()
{
var now = Date.now();
// Debounce container show
if ( _mouseMoveTime > Date.now() - 150 ) {
container.removeClass('fade');
}
_mouseMoveTime = now;
}
function desactivateContainer()
{
if ( ! _isHoverWidget && Date.now() > _mouseMoveTime + FADE_DELAY ) {
container.addClass('fade');
}
}
//
// Init
//
function initEvents()
{
container.find(".btn-play-container").click(onPlayPauseClick);
// Slider
container.find('.slider-container input').slider({
min: 5,
max: 60,
value: DEFAULT_VALUE,
formater: function(value) {
return value + 's';
}
});
// Slider change
container.find('.slider-container input').on('slideStop', function() {
if ( isPlaying() ) {
startAutoplay(false);
}
});
//
// Container fade
//
if ( ! has("touch") ) {
_mouseMoveTime = Date.now();
container.hover(
function() {
_isHoverWidget = true;
},
function() {
_isHoverWidget = false;
desactivateContainer();
}
);
$(window).mousemove(activateContainer);
setInterval(desactivateContainer, 1000);
}
}
};
}
);
|
{
"content_hash": "5de276406bbc7cc3a89a348925f8dcae",
"timestamp": "",
"source": "github",
"line_count": 256,
"max_line_length": 107,
"avg_line_length": 20.65234375,
"alnum_prop": 0.5256289010781161,
"repo_name": "Esri/map-tour-storytelling-template-js",
"id": "b039b9145f7b607805e62ea9630b80afecf693b7",
"size": "5287",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "MapTour/src/app/storymaps/ui/autoplay/Autoplay.js",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "82720"
},
{
"name": "HTML",
"bytes": "43197"
},
{
"name": "JavaScript",
"bytes": "2225646"
}
],
"symlink_target": ""
}
|
package org.apache.nifi.web;
import org.apache.nifi.action.Component;
import org.apache.nifi.action.FlowChangeAction;
import org.apache.nifi.action.Operation;
import org.apache.nifi.admin.service.AuditService;
import org.apache.nifi.authorization.AccessDeniedException;
import org.apache.nifi.authorization.AuthorizableLookup;
import org.apache.nifi.authorization.AuthorizationRequest;
import org.apache.nifi.authorization.AuthorizationResult;
import org.apache.nifi.authorization.Authorizer;
import org.apache.nifi.authorization.ComponentAuthorizable;
import org.apache.nifi.authorization.Resource;
import org.apache.nifi.authorization.resource.Authorizable;
import org.apache.nifi.authorization.resource.ResourceFactory;
import org.apache.nifi.authorization.resource.ResourceType;
import org.apache.nifi.authorization.user.NiFiUserDetails;
import org.apache.nifi.authorization.user.StandardNiFiUser.Builder;
import org.apache.nifi.controller.FlowController;
import org.apache.nifi.history.History;
import org.apache.nifi.history.HistoryQuery;
import org.apache.nifi.web.api.dto.DtoFactory;
import org.apache.nifi.web.api.dto.EntityFactory;
import org.apache.nifi.web.api.dto.action.HistoryDTO;
import org.apache.nifi.web.api.dto.action.HistoryQueryDTO;
import org.apache.nifi.web.api.entity.ActionEntity;
import org.apache.nifi.web.controller.ControllerFacade;
import org.apache.nifi.web.security.token.NiFiAuthenticationToken;
import org.junit.Before;
import org.junit.Test;
import org.mockito.Mockito;
import org.springframework.security.core.Authentication;
import org.springframework.security.core.context.SecurityContextHolder;
import java.util.Arrays;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.ArgumentMatchers.argThat;
import static org.mockito.Mockito.anyInt;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.times;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
public class StandardNiFiServiceFacadeTest {
private static final String USER_1 = "user-1";
private static final String USER_2 = "user-2";
private static final Integer UNKNOWN_ACTION_ID = 0;
private static final Integer ACTION_ID_1 = 1;
private static final String PROCESSOR_ID_1 = "processor-1";
private static final Integer ACTION_ID_2 = 2;
private static final String PROCESSOR_ID_2 = "processor-2";
private StandardNiFiServiceFacade serviceFacade;
private Authorizer authorizer;
@Before
public void setUp() throws Exception {
// audit service
final AuditService auditService = mock(AuditService.class);
when(auditService.getAction(anyInt())).then(invocation -> {
final Integer actionId = invocation.getArgument(0);
FlowChangeAction action = null;
if (ACTION_ID_1.equals(actionId)) {
action = getAction(actionId, PROCESSOR_ID_1);
} else if (ACTION_ID_2.equals(actionId)) {
action = getAction(actionId, PROCESSOR_ID_2);
}
return action;
});
when(auditService.getActions(any(HistoryQuery.class))).then(invocation -> {
final History history = new History();
history.setActions(Arrays.asList(getAction(ACTION_ID_1, PROCESSOR_ID_1), getAction(ACTION_ID_2, PROCESSOR_ID_2)));
return history;
});
// authorizable lookup
final AuthorizableLookup authorizableLookup = mock(AuthorizableLookup.class);
when(authorizableLookup.getProcessor(Mockito.anyString())).then(getProcessorInvocation -> {
final String processorId = getProcessorInvocation.getArgument(0);
// processor-2 is no longer part of the flow
if (processorId.equals(PROCESSOR_ID_2)) {
throw new ResourceNotFoundException("");
}
// component authorizable
final ComponentAuthorizable componentAuthorizable = mock(ComponentAuthorizable.class);
when(componentAuthorizable.getAuthorizable()).then(getAuthorizableInvocation -> {
// authorizable
final Authorizable authorizable = new Authorizable() {
@Override
public Authorizable getParentAuthorizable() {
return null;
}
@Override
public Resource getResource() {
return ResourceFactory.getComponentResource(ResourceType.Processor, processorId, processorId);
}
};
return authorizable;
});
return componentAuthorizable;
});
// authorizer
authorizer = mock(Authorizer.class);
when(authorizer.authorize(any(AuthorizationRequest.class))).then(invocation -> {
final AuthorizationRequest request = invocation.getArgument(0);
AuthorizationResult result = AuthorizationResult.denied();
if (request.getResource().getIdentifier().endsWith(PROCESSOR_ID_1)) {
if (USER_1.equals(request.getIdentity())) {
result = AuthorizationResult.approved();
}
} else if (request.getResource().equals(ResourceFactory.getControllerResource())) {
if (USER_2.equals(request.getIdentity())) {
result = AuthorizationResult.approved();
}
}
return result;
});
// flow controller
final FlowController controller = mock(FlowController.class);
when(controller.getResource()).thenCallRealMethod();
when(controller.getParentAuthorizable()).thenCallRealMethod();
// controller facade
final ControllerFacade controllerFacade = new ControllerFacade();
controllerFacade.setFlowController(controller);
serviceFacade = new StandardNiFiServiceFacade();
serviceFacade.setAuditService(auditService);
serviceFacade.setAuthorizableLookup(authorizableLookup);
serviceFacade.setAuthorizer(authorizer);
serviceFacade.setEntityFactory(new EntityFactory());
serviceFacade.setDtoFactory(new DtoFactory());
serviceFacade.setControllerFacade(controllerFacade);
}
private FlowChangeAction getAction(final Integer actionId, final String processorId) {
final FlowChangeAction action = new FlowChangeAction();
action.setId(actionId);
action.setSourceId(processorId);
action.setSourceType(Component.Processor);
action.setOperation(Operation.Add);
return action;
}
@Test(expected = ResourceNotFoundException.class)
public void testGetUnknownAction() throws Exception {
serviceFacade.getAction(UNKNOWN_ACTION_ID);
}
@Test
public void testGetActionApprovedThroughAction() throws Exception {
// set the user
final Authentication authentication = new NiFiAuthenticationToken(new NiFiUserDetails(new Builder().identity(USER_1).build()));
SecurityContextHolder.getContext().setAuthentication(authentication);
// get the action
final ActionEntity entity = serviceFacade.getAction(ACTION_ID_1);
// verify
assertEquals(ACTION_ID_1, entity.getId());
assertTrue(entity.getCanRead());
// resource exists and is approved, no need to check the controller
verify(authorizer, times(1)).authorize(argThat(o -> o.getResource().getIdentifier().endsWith(PROCESSOR_ID_1)));
verify(authorizer, times(0)).authorize(argThat(o -> o.getResource().equals(ResourceFactory.getControllerResource())));
}
@Test(expected = AccessDeniedException.class)
public void testGetActionDeniedDespiteControllerAccess() throws Exception {
// set the user
final Authentication authentication = new NiFiAuthenticationToken(new NiFiUserDetails(new Builder().identity(USER_2).build()));
SecurityContextHolder.getContext().setAuthentication(authentication);
try {
// get the action
serviceFacade.getAction(ACTION_ID_1);
fail();
} finally {
// resource exists, but should trigger access denied and will not check the controller
verify(authorizer, times(1)).authorize(argThat(o -> o.getResource().getIdentifier().endsWith(PROCESSOR_ID_1)));
verify(authorizer, times(0)).authorize(argThat(o -> o.getResource().equals(ResourceFactory.getControllerResource())));
}
}
@Test
public void testGetActionApprovedThroughController() throws Exception {
// set the user
final Authentication authentication = new NiFiAuthenticationToken(new NiFiUserDetails(new Builder().identity(USER_2).build()));
SecurityContextHolder.getContext().setAuthentication(authentication);
// get the action
final ActionEntity entity = serviceFacade.getAction(ACTION_ID_2);
// verify
assertEquals(ACTION_ID_2, entity.getId());
assertTrue(entity.getCanRead());
// component does not exists, so only checks against the controller
verify(authorizer, times(0)).authorize(argThat(o -> o.getResource().getIdentifier().endsWith(PROCESSOR_ID_2)));
verify(authorizer, times(1)).authorize(argThat(o -> o.getResource().equals(ResourceFactory.getControllerResource())));
}
@Test
public void testGetActionsForUser1() throws Exception {
// set the user
final Authentication authentication = new NiFiAuthenticationToken(new NiFiUserDetails(new Builder().identity(USER_1).build()));
SecurityContextHolder.getContext().setAuthentication(authentication);
final HistoryDTO dto = serviceFacade.getActions(new HistoryQueryDTO());
// verify user 1 only has access to actions for processor 1
dto.getActions().forEach(action -> {
if (PROCESSOR_ID_1.equals(action.getSourceId())) {
assertTrue(action.getCanRead());
} else if (PROCESSOR_ID_2.equals(action.getSourceId())) {
assertFalse(action.getCanRead());
assertNull(action.getAction());
}
});
}
@Test
public void testGetActionsForUser2() throws Exception {
// set the user
final Authentication authentication = new NiFiAuthenticationToken(new NiFiUserDetails(new Builder().identity(USER_2).build()));
SecurityContextHolder.getContext().setAuthentication(authentication);
final HistoryDTO dto = serviceFacade.getActions(new HistoryQueryDTO());
// verify user 2 only has access to actions for processor 2
dto.getActions().forEach(action -> {
if (PROCESSOR_ID_1.equals(action.getSourceId())) {
assertFalse(action.getCanRead());
assertNull(action.getAction());
} else if (PROCESSOR_ID_2.equals(action.getSourceId())) {
assertTrue(action.getCanRead());
}
});
}
}
|
{
"content_hash": "523271e9714e0172d01221e8a4a98894",
"timestamp": "",
"source": "github",
"line_count": 265,
"max_line_length": 135,
"avg_line_length": 42.69433962264151,
"alnum_prop": 0.6860526780979318,
"repo_name": "jskora/nifi",
"id": "3c567eb5bc2fbdc7ecd8af419a30a7a6e475b9b4",
"size": "12115",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/test/java/org/apache/nifi/web/StandardNiFiServiceFacadeTest.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Batchfile",
"bytes": "20273"
},
{
"name": "CSS",
"bytes": "238561"
},
{
"name": "Clojure",
"bytes": "3993"
},
{
"name": "Dockerfile",
"bytes": "12288"
},
{
"name": "GAP",
"bytes": "30708"
},
{
"name": "Groovy",
"bytes": "1997413"
},
{
"name": "HTML",
"bytes": "689009"
},
{
"name": "Java",
"bytes": "39290327"
},
{
"name": "JavaScript",
"bytes": "3087287"
},
{
"name": "Lua",
"bytes": "983"
},
{
"name": "Python",
"bytes": "20318"
},
{
"name": "Ruby",
"bytes": "8028"
},
{
"name": "Shell",
"bytes": "82677"
},
{
"name": "XSLT",
"bytes": "5681"
}
],
"symlink_target": ""
}
|
using Microsoft.CodeAnalysis.CodeFixes;
using System.Collections.Immutable;
using System.Threading.Tasks;
namespace Microsoft.NetFramework.Analyzers
{
/// <summary>
/// CA2212: Do not mark serviced components with WebMethod
/// </summary>
public abstract class DoNotMarkServicedComponentsWithWebMethodFixer : CodeFixProvider
{
public sealed override ImmutableArray<string> FixableDiagnosticIds { get; } = ImmutableArray<string>.Empty;
public sealed override FixAllProvider GetFixAllProvider()
{
// See https://github.com/dotnet/roslyn/blob/main/docs/analyzers/FixAllProvider.md for more information on Fix All Providers
return WellKnownFixAllProviders.BatchFixer;
}
public sealed override Task RegisterCodeFixesAsync(CodeFixContext context)
{
// Fixer not yet implemented.
return Task.CompletedTask;
}
}
}
|
{
"content_hash": "15ec9fcdc8fe2ed242ffddb9f687646b",
"timestamp": "",
"source": "github",
"line_count": 27,
"max_line_length": 136,
"avg_line_length": 34.7037037037037,
"alnum_prop": 0.7054429028815368,
"repo_name": "dotnet/roslyn-analyzers",
"id": "458f8f8d7b2b6e98ebfcf1fcb1a6869a04a6ab78",
"size": "1083",
"binary": false,
"copies": "1",
"ref": "refs/heads/main",
"path": "src/NetAnalyzers/Core/Microsoft.NetFramework.Analyzers/DoNotMarkServicedComponentsWithWebMethod.Fixer.cs",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Batchfile",
"bytes": "2423"
},
{
"name": "C#",
"bytes": "15365655"
},
{
"name": "CMake",
"bytes": "12939"
},
{
"name": "PowerShell",
"bytes": "181309"
},
{
"name": "Shell",
"bytes": "115733"
},
{
"name": "Visual Basic .NET",
"bytes": "276464"
}
],
"symlink_target": ""
}
|
// Texture.cpp : implementation file
//
#include "stdafx.h"
#include "Port.h"
#include "Texture.h"
#include "Tools\ResourcerDoc\SelectResource.h"
#include "Tools\ImagePort\Port.h"
// CTexture dialog
IMPLEMENT_DYNAMIC(CTexture, CDialog)
CTexture::CTexture( CWnd* pParent /*=NULL*/)
: CDialog(CTexture::IDD, pParent)
, m_nIndex(0)
, m_nUV(0)
, m_sImagePort(_T(""))
, m_sParameters(_T(""))
, m_nType(0)
, m_bMipMap(TRUE)
{}
CTexture::~CTexture()
{}
BOOL CTexture::OnInitDialog()
{
CDialog::OnInitDialog();
for( int nType = 0; nType <= PrimitiveSurface::LAST; ++nType )
m_cTypeList.AddString( PrimitiveSurface::typeText( (PrimitiveSurface::Type)nType ) );
UpdateData( FALSE );
return TRUE;
}
void CTexture::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
DDX_Control(pDX, IDC_COMBO1, m_cTypeList);
DDX_Text(pDX, IDC_EDIT2, m_nIndex);
DDX_Text(pDX, IDC_EDIT3, m_nUV);
DDX_Text(pDX, IDC_EDIT1, m_sImagePort);
DDX_Text(pDX, IDC_EDIT4, m_sParameters);
DDX_CBIndex(pDX, IDC_COMBO1, m_nType);
DDX_Check(pDX, IDC_CHECK1, m_bMipMap);
}
BEGIN_MESSAGE_MAP(CTexture, CDialog)
ON_BN_CLICKED(IDC_BUTTON2, OnOpenImage)
ON_BN_CLICKED(IDC_BUTTON3, OnBrowseImage)
END_MESSAGE_MAP()
// CTexture message handlers
void CTexture::OnOpenImage()
{
AfxGetApp()->OpenDocumentFile( m_sImagePort );
OnCancel(); // close this dialog
}
void CTexture::OnBrowseImage()
{
UpdateData();
// classKey for ImagePort is 3914102874601741960
CSelectResource dialog( CLASS_KEY(ImagePort) );
if ( dialog.DoModal() == IDOK)
{
m_sImagePort = dialog.m_Selected;
UpdateData(FALSE);
}
}
|
{
"content_hash": "e3e9b5a6bb76f5a221701bbdaadb8d17",
"timestamp": "",
"source": "github",
"line_count": 77,
"max_line_length": 87,
"avg_line_length": 20.896103896103895,
"alnum_prop": 0.7047855811062772,
"repo_name": "palestar/medusa",
"id": "dfbf7a7b865d3f2c025bd5c30c9c47b32397e5ed",
"size": "1609",
"binary": false,
"copies": "1",
"ref": "refs/heads/develop",
"path": "Tools/MaterialPort/Texture.cpp",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C",
"bytes": "864803"
},
{
"name": "C++",
"bytes": "12938688"
},
{
"name": "Clarion",
"bytes": "80976"
},
{
"name": "Lua",
"bytes": "4055"
},
{
"name": "Makefile",
"bytes": "37934"
},
{
"name": "Objective-C",
"bytes": "3178"
},
{
"name": "R",
"bytes": "3909"
},
{
"name": "Shell",
"bytes": "4892"
}
],
"symlink_target": ""
}
|
#include <stdint.h>
#include <stddef.h>
#include <stdbool.h>
#include <math.h>
#include "numpy/random/distributions.h"
#include "logfactorial.h"
/*
* random_mvhg_marginals
*
* Draw samples from the multivariate hypergeometric distribution--
* the "marginals" algorithm.
*
* This version generates the sample by iteratively calling
* hypergeometric() (the univariate hypergeometric distribution).
*
* Parameters
* ----------
* bitgen_t *bitgen_state
* Pointer to a `bitgen_t` instance.
* int64_t total
* The sum of the values in the array `colors`. (This is redundant
* information, but we know the caller has already computed it, so
* we might as well use it.)
* size_t num_colors
* The length of the `colors` array. The functions assumes
* num_colors > 0.
* int64_t *colors
* The array of colors (i.e. the number of each type in the collection
* from which the random variate is drawn).
* int64_t nsample
* The number of objects drawn without replacement for each variate.
* `nsample` must not exceed sum(colors). This condition is not checked;
* it is assumed that the caller has already validated the value.
* size_t num_variates
* The number of variates to be produced and put in the array
* pointed to by `variates`. One variate is a vector of length
* `num_colors`, so the array pointed to by `variates` must have length
* `num_variates * num_colors`.
* int64_t *variates
* The array that will hold the result. It must have length
* `num_variates * num_colors`.
* The array is not initialized in the function; it is expected that the
* array has been initialized with zeros when the function is called.
*
* Notes
* -----
* Here's an example that demonstrates the idea of this algorithm.
*
* Suppose the urn contains red, green, blue and yellow marbles.
* Let nred be the number of red marbles, and define the quantities for
* the other colors similarly. The total number of marbles is
*
* total = nred + ngreen + nblue + nyellow.
*
* To generate a sample using rk_hypergeometric:
*
* red_sample = hypergeometric(ngood=nred, nbad=total - nred,
* nsample=nsample)
*
* This gives us the number of red marbles in the sample. The number of
* marbles in the sample that are *not* red is nsample - red_sample.
* To figure out the distribution of those marbles, we again use
* rk_hypergeometric:
*
* green_sample = hypergeometric(ngood=ngreen,
* nbad=total - nred - ngreen,
* nsample=nsample - red_sample)
*
* Similarly,
*
* blue_sample = hypergeometric(
* ngood=nblue,
* nbad=total - nred - ngreen - nblue,
* nsample=nsample - red_sample - green_sample)
*
* Finally,
*
* yellow_sample = total - (red_sample + green_sample + blue_sample).
*
* The above sequence of steps is implemented as a loop for an arbitrary
* number of colors in the innermost loop in the code below. `remaining`
* is the value passed to `nbad`; it is `total - colors[0]` in the first
* call to random_hypergeometric(), and then decreases by `colors[j]` in
* each iteration. `num_to_sample` is the `nsample` argument. It
* starts at this function's `nsample` input, and is decreased by the
* result of the call to random_hypergeometric() in each iteration.
*
* Assumptions on the arguments (not checked in the function):
* * colors[k] >= 0 for k in range(num_colors)
* * total = sum(colors)
* * 0 <= nsample <= total
* * the product num_variates * num_colors does not overflow
*/
void random_mvhg_marginals(bitgen_t *bitgen_state,
int64_t total,
size_t num_colors, int64_t *colors,
int64_t nsample,
size_t num_variates, int64_t *variates)
{
bool more_than_half;
if ((total == 0) || (nsample == 0) || (num_variates == 0)) {
// Nothing to do.
return;
}
more_than_half = nsample > (total / 2);
if (more_than_half) {
nsample = total - nsample;
}
for (size_t i = 0; i < num_variates * num_colors; i += num_colors) {
int64_t num_to_sample = nsample;
int64_t remaining = total;
for (size_t j = 0; (num_to_sample > 0) && (j + 1 < num_colors); ++j) {
int64_t r;
remaining -= colors[j];
r = random_hypergeometric(bitgen_state,
colors[j], remaining, num_to_sample);
variates[i + j] = r;
num_to_sample -= r;
}
if (num_to_sample > 0) {
variates[i + num_colors - 1] = num_to_sample;
}
if (more_than_half) {
for (size_t k = 0; k < num_colors; ++k) {
variates[i + k] = colors[k] - variates[i + k];
}
}
}
}
|
{
"content_hash": "fb29b161c2f57e0c864ef4fc42f1d8b4",
"timestamp": "",
"source": "github",
"line_count": 138,
"max_line_length": 78,
"avg_line_length": 36.84782608695652,
"alnum_prop": 0.591937069813176,
"repo_name": "jorisvandenbossche/numpy",
"id": "7e4c24988ada86052d1248b9e4e35a817bc1a842",
"size": "5085",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "numpy/random/src/distributions/random_mvhg_marginals.c",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "C",
"bytes": "9068647"
},
{
"name": "C++",
"bytes": "189527"
},
{
"name": "Fortran",
"bytes": "10884"
},
{
"name": "JavaScript",
"bytes": "16928"
},
{
"name": "Makefile",
"bytes": "4290"
},
{
"name": "Python",
"bytes": "8307898"
},
{
"name": "Shell",
"bytes": "8482"
},
{
"name": "sed",
"bytes": "5741"
}
],
"symlink_target": ""
}
|
title: axg14
type: products
image: /img/Screen Shot 2017-05-09 at 11.56.54 AM.png
heading: g14
description: lksadjf lkasdjf lksajdf lksdaj flksadj flksa fdj
main:
heading: Foo Bar BAz
description: |-
***This is i a thing***kjh hjk kj
# Blah Blah
## Blah
### Baah
image1:
alt: kkkk
---
|
{
"content_hash": "b05e31b7ca8f5ec44fc9cdb3637ba944",
"timestamp": "",
"source": "github",
"line_count": 15,
"max_line_length": 61,
"avg_line_length": 22.333333333333332,
"alnum_prop": 0.6656716417910448,
"repo_name": "pblack/kaldi-hugo-cms-template",
"id": "d020bb02c616fa381f084830714735966cd33e30",
"size": "339",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "site/content/pages2/axg14.md",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "94394"
},
{
"name": "HTML",
"bytes": "18889"
},
{
"name": "JavaScript",
"bytes": "10014"
}
],
"symlink_target": ""
}
|
namespace keyboard {
namespace {
// An event handler that focuses a window when it is clicked/touched on. This is
// used to match the focus manger behaviour in ash and views.
class TestFocusController : public ui::EventHandler {
public:
explicit TestFocusController(aura::RootWindow* root)
: root_(root) {
root_->AddPreTargetHandler(this);
}
virtual ~TestFocusController() {
root_->RemovePreTargetHandler(this);
}
private:
// Overridden from ui::EventHandler:
virtual void OnEvent(ui::Event* event) OVERRIDE {
aura::Window* target = static_cast<aura::Window*>(event->target());
if (event->type() == ui::ET_MOUSE_PRESSED ||
event->type() == ui::ET_TOUCH_PRESSED) {
aura::client::GetFocusClient(target)->FocusWindow(target);
}
}
aura::Window* root_;
DISALLOW_COPY_AND_ASSIGN(TestFocusController);
};
class TestKeyboardControllerProxy : public KeyboardControllerProxy {
public:
TestKeyboardControllerProxy()
: window_(new aura::Window(&delegate_)),
input_method_(ui::CreateInputMethod(NULL,
gfx::kNullAcceleratedWidget)) {
window_->Init(ui::LAYER_NOT_DRAWN);
window_->set_owned_by_parent(false);
}
virtual ~TestKeyboardControllerProxy() {
// Destroy the window before the delegate.
window_.reset();
}
// Overridden from KeyboardControllerProxy:
virtual aura::Window* GetKeyboardWindow() OVERRIDE { return window_.get(); }
virtual content::BrowserContext* GetBrowserContext() OVERRIDE { return NULL; }
virtual ui::InputMethod* GetInputMethod() OVERRIDE {
return input_method_.get();
}
private:
scoped_ptr<aura::Window> window_;
aura::test::TestWindowDelegate delegate_;
scoped_ptr<ui::InputMethod> input_method_;
DISALLOW_COPY_AND_ASSIGN(TestKeyboardControllerProxy);
};
// Keeps a count of all the events a window receives.
class EventObserver : public ui::EventHandler {
public:
EventObserver() {}
virtual ~EventObserver() {}
int GetEventCount(ui::EventType type) {
return event_counts_[type];
}
private:
// Overridden from ui::EventHandler:
virtual void OnEvent(ui::Event* event) OVERRIDE {
ui::EventHandler::OnEvent(event);
event_counts_[event->type()]++;
}
std::map<ui::EventType, int> event_counts_;
DISALLOW_COPY_AND_ASSIGN(EventObserver);
};
class TestTextInputClient : public ui::TextInputClient {
public:
explicit TestTextInputClient(ui::TextInputType type)
: type_(type) {}
virtual ~TestTextInputClient() {}
private:
// Overridden from ui::TextInputClient:
virtual void SetCompositionText(
const ui::CompositionText& composition) OVERRIDE {}
virtual void ConfirmCompositionText() OVERRIDE {}
virtual void ClearCompositionText() OVERRIDE {}
virtual void InsertText(const string16& text) OVERRIDE {}
virtual void InsertChar(char16 ch, int flags) OVERRIDE {}
virtual ui::TextInputType GetTextInputType() const OVERRIDE {
return type_;
}
virtual bool CanComposeInline() const OVERRIDE { return false; }
virtual gfx::Rect GetCaretBounds() OVERRIDE { return gfx::Rect(); }
virtual bool GetCompositionCharacterBounds(uint32 index,
gfx::Rect* rect) OVERRIDE {
return false;
}
virtual bool HasCompositionText() OVERRIDE { return false; }
virtual bool GetTextRange(ui::Range* range) OVERRIDE { return false; }
virtual bool GetCompositionTextRange(ui::Range* range) OVERRIDE {
return false;
}
virtual bool GetSelectionRange(ui::Range* range) OVERRIDE { return false; }
virtual bool SetSelectionRange(const ui::Range& range) OVERRIDE {
return false;
}
virtual bool DeleteRange(const ui::Range& range) OVERRIDE { return false; }
virtual bool GetTextFromRange(const ui::Range& range,
string16* text) OVERRIDE {
return false;
}
virtual void OnInputMethodChanged() OVERRIDE {}
virtual bool ChangeTextDirectionAndLayoutAlignment(
base::i18n::TextDirection direction) OVERRIDE { return false; }
virtual void ExtendSelectionAndDelete(size_t before, size_t after) OVERRIDE {}
virtual void EnsureCaretInRect(const gfx::Rect& rect) OVERRIDE {}
ui::TextInputType type_;
DISALLOW_COPY_AND_ASSIGN(TestTextInputClient);
};
} // namespace
class KeyboardControllerTest : public testing::Test {
public:
KeyboardControllerTest() {}
virtual ~KeyboardControllerTest() {}
virtual void SetUp() OVERRIDE {
aura_test_helper_.reset(new aura::test::AuraTestHelper(&message_loop_));
aura_test_helper_->SetUp();
ui::SetUpInputMethodFactoryForTesting();
focus_controller_.reset(new TestFocusController(root_window()));
}
virtual void TearDown() OVERRIDE {
aura_test_helper_->TearDown();
}
aura::RootWindow* root_window() { return aura_test_helper_->root_window(); }
void ShowKeyboard(KeyboardController* controller) {
TestTextInputClient test_text_input_client(ui::TEXT_INPUT_TYPE_TEXT);
controller->OnTextInputStateChanged(&test_text_input_client);
}
protected:
base::MessageLoopForUI message_loop_;
scoped_ptr<aura::test::AuraTestHelper> aura_test_helper_;
scoped_ptr<TestFocusController> focus_controller_;
private:
DISALLOW_COPY_AND_ASSIGN(KeyboardControllerTest);
};
TEST_F(KeyboardControllerTest, KeyboardSize) {
KeyboardControllerProxy* proxy = new TestKeyboardControllerProxy();
KeyboardController controller(proxy);
scoped_ptr<aura::Window> container(controller.GetContainerWindow());
gfx::Rect bounds(0, 0, 100, 100);
container->SetBounds(bounds);
const gfx::Rect& before_bounds = proxy->GetKeyboardWindow()->bounds();
gfx::Rect new_bounds(
before_bounds.x(), before_bounds.y(),
before_bounds.width() / 2, before_bounds.height() / 2);
// The KeyboardController's LayoutManager shouldn't let this happen
proxy->GetKeyboardWindow()->SetBounds(new_bounds);
ASSERT_EQ(before_bounds, proxy->GetKeyboardWindow()->bounds());
}
// Tests that tapping/clicking inside the keyboard does not give it focus.
TEST_F(KeyboardControllerTest, ClickDoesNotFocusKeyboard) {
const gfx::Rect& root_bounds = root_window()->bounds();
aura::test::EventCountDelegate delegate;
scoped_ptr<aura::Window> window(new aura::Window(&delegate));
window->Init(ui::LAYER_NOT_DRAWN);
window->SetBounds(root_bounds);
root_window()->AddChild(window.get());
window->Show();
window->Focus();
KeyboardControllerProxy* proxy = new TestKeyboardControllerProxy();
KeyboardController controller(proxy);
scoped_ptr<aura::Window> keyboard_container(controller.GetContainerWindow());
keyboard_container->SetBounds(root_bounds);
root_window()->AddChild(keyboard_container.get());
keyboard_container->Show();
ShowKeyboard(&controller);
EXPECT_TRUE(window->IsVisible());
EXPECT_TRUE(keyboard_container->IsVisible());
EXPECT_TRUE(window->HasFocus());
EXPECT_FALSE(keyboard_container->HasFocus());
// Click on the keyboard. Make sure the keyboard receives the event, but does
// not get focus.
EventObserver observer;
keyboard_container->AddPreTargetHandler(&observer);
aura::test::EventGenerator generator(root_window());
generator.MoveMouseTo(proxy->GetKeyboardWindow()->bounds().CenterPoint());
generator.ClickLeftButton();
EXPECT_TRUE(window->HasFocus());
EXPECT_FALSE(keyboard_container->HasFocus());
EXPECT_EQ("0 0", delegate.GetMouseButtonCountsAndReset());
EXPECT_EQ(1, observer.GetEventCount(ui::ET_MOUSE_PRESSED));
EXPECT_EQ(1, observer.GetEventCount(ui::ET_MOUSE_RELEASED));
// Click outside of the keyboard. It should reach the window behind.
generator.MoveMouseTo(gfx::Point());
generator.ClickLeftButton();
EXPECT_EQ("1 1", delegate.GetMouseButtonCountsAndReset());
}
TEST_F(KeyboardControllerTest, VisibilityChangeWithTextInputTypeChange) {
const gfx::Rect& root_bounds = root_window()->bounds();
aura::test::EventCountDelegate delegate;
scoped_ptr<aura::Window> window(new aura::Window(&delegate));
window->Init(ui::LAYER_NOT_DRAWN);
window->SetBounds(root_bounds);
root_window()->AddChild(window.get());
window->Show();
window->Focus();
KeyboardControllerProxy* proxy = new TestKeyboardControllerProxy();
ui::InputMethod* input_method = proxy->GetInputMethod();
TestTextInputClient input_client(ui::TEXT_INPUT_TYPE_TEXT);
TestTextInputClient no_input_client(ui::TEXT_INPUT_TYPE_NONE);
input_method->SetFocusedTextInputClient(&input_client);
KeyboardController controller(proxy);
scoped_ptr<aura::Window> keyboard_container(controller.GetContainerWindow());
keyboard_container->SetBounds(root_bounds);
root_window()->AddChild(keyboard_container.get());
EXPECT_TRUE(keyboard_container->IsVisible());
input_method->SetFocusedTextInputClient(&no_input_client);
EXPECT_FALSE(keyboard_container->IsVisible());
input_method->SetFocusedTextInputClient(&input_client);
EXPECT_TRUE(keyboard_container->IsVisible());
}
} // namespace keyboard
|
{
"content_hash": "608d63ed4725219c6b8b094edebb94b3",
"timestamp": "",
"source": "github",
"line_count": 261,
"max_line_length": 80,
"avg_line_length": 34.486590038314176,
"alnum_prop": 0.7220308854571714,
"repo_name": "loopCM/chromium",
"id": "73ac2f8243aaaa8e192878cee7f9f0016484ce1f",
"size": "9806",
"binary": false,
"copies": "1",
"ref": "refs/heads/trunk",
"path": "ui/keyboard/keyboard_controller_unittest.cc",
"mode": "33188",
"license": "bsd-3-clause",
"language": [],
"symlink_target": ""
}
|
// Copyright (c) 2009-2010 Satoshi Nakamoto
// Copyright (c) 2009-2012 The Bitcoin developers
// Copyright (c) 2013 The Cabbage developers
// Distributed under the MIT/X11 software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#ifndef Cabbage_MINER_H
#define Cabbage_MINER_H
#include "main.h"
#include "wallet.h"
/* Generate a new block, without valid proof-of-work/with provided proof-of-stake */
CBlock* CreateNewBlock(CWallet* pwallet, CTransaction *txAdd=NULL);
/** Modify the extranonce in a block */
void IncrementExtraNonce(CBlock* pblock, CBlockIndex* pindexPrev, unsigned int& nExtraNonce);
/** Do mining precalculation */
void FormatHashBuffers(CBlock* pblock, char* pmidstate, char* pdata, char* phash1);
/** Check mined proof-of-work block */
bool CheckWork(CBlock* pblock, CWallet& wallet, CReserveKey& reservekey);
/** Check mined proof-of-stake block */
bool CheckStake(CBlock* pblock, CWallet& wallet);
/** Base sha256 mining transform */
void SHA256Transform(void* pstate, void* pinput, const void* pinit);
/** Stake miner thread */
void ThreadStakeMiner(void* parg);
#endif // Cabbage_MINER_H
|
{
"content_hash": "e9788cd448504a0d783469dae6939a4f",
"timestamp": "",
"source": "github",
"line_count": 33,
"max_line_length": 93,
"avg_line_length": 35.60606060606061,
"alnum_prop": 0.7514893617021277,
"repo_name": "CabbageUnit/Cabbage",
"id": "dd4919dc37a7fda3ee11e98625e0a8ef69a832f4",
"size": "1175",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/miner.h",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Assembly",
"bytes": "139611"
},
{
"name": "Batchfile",
"bytes": "5376"
},
{
"name": "C",
"bytes": "48290"
},
{
"name": "C++",
"bytes": "2664498"
},
{
"name": "CSS",
"bytes": "1127"
},
{
"name": "Groff",
"bytes": "12684"
},
{
"name": "HTML",
"bytes": "50621"
},
{
"name": "Makefile",
"bytes": "13952"
},
{
"name": "NSIS",
"bytes": "6088"
},
{
"name": "Objective-C",
"bytes": "1108"
},
{
"name": "Objective-C++",
"bytes": "7225"
},
{
"name": "Perl",
"bytes": "1049"
},
{
"name": "Python",
"bytes": "45493"
},
{
"name": "QMake",
"bytes": "16614"
},
{
"name": "Shell",
"bytes": "16508"
},
{
"name": "TypeScript",
"bytes": "639376"
}
],
"symlink_target": ""
}
|
<?php
// DMCQuestionBundle:Reponse:new.html.twig
return array (
);
|
{
"content_hash": "73b1109329ab4b5f4a202d7ba7d97db2",
"timestamp": "",
"source": "github",
"line_count": 5,
"max_line_length": 42,
"avg_line_length": 13.6,
"alnum_prop": 0.7205882352941176,
"repo_name": "DMC-corporation/DMC",
"id": "73ddbaf3d5a5f27b92b9c562c008fb20b50f757b",
"size": "68",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "app/cache/dev/assetic/config/6/6dba9b60636250eb7cf63b6541d60462.php",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "JavaScript",
"bytes": "95750"
},
{
"name": "PHP",
"bytes": "71351"
}
],
"symlink_target": ""
}
|
title: Porting to the Buffer.from()/Buffer.alloc() API
layout: docs.hbs
---
# Porting to the `Buffer.from()`/`Buffer.alloc()` API
## Overview
This guide explains how to migrate to safe `Buffer` constructor methods. The migration fixes the following deprecation warning:
<div class="highlight-box">
The Buffer() and new Buffer() constructors are not recommended for use due to security and usability concerns. Please use the new Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() construction methods instead.
</div>
- [Variant 1: Drop support for Node.js ≤ 4.4.x and 5.0.0 — 5.9.x](#variant-1) (*recommended*)
- [Variant 2: Use a polyfill](#variant-2)
- [Variant 3: Manual detection, with safeguards](#variant-3)
### Finding problematic bits of code using `grep`
Just run `grep -nrE '[^a-zA-Z](Slow)?Buffer\s*\(' --exclude-dir node_modules`.
It will find all the potentially unsafe places in your own code (with some considerably unlikely
exceptions).
### Finding problematic bits of code using Node.js 8
If you’re using Node.js ≥ 8.0.0 (which is recommended), Node.js exposes multiple options that help with finding the relevant pieces of code:
- `--trace-warnings` will make Node.js show a stack trace for this warning and other warnings that are printed by Node.js.
- `--trace-deprecation` does the same thing, but only for deprecation warnings.
- `--pending-deprecation` will show more types of deprecation warnings. In particular, it will show the `Buffer()` deprecation warning, even on Node.js 8.
You can set these flags using environment variables:
```bash
$ export NODE_OPTIONS='--trace-warnings --pending-deprecation'
$ cat example.js
'use strict';
const foo = new Buffer('foo');
$ node example.js
(node:7147) [DEP0005] DeprecationWarning: The Buffer() and new Buffer() constructors are not recommended for use due to security and usability concerns. Please use the new Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() construction methods instead.
at showFlaggedDeprecation (buffer.js:127:13)
at new Buffer (buffer.js:148:3)
at Object.<anonymous> (/path/to/example.js:2:13)
[... more stack trace lines ...]
```
### Finding problematic bits of code using linters
ESLint rules [no-buffer-constructor](https://eslint.org/docs/rules/no-buffer-constructor)
or
[node/no-deprecated-api](https://github.com/mysticatea/eslint-plugin-node/blob/master/docs/rules/no-deprecated-api.md)
also find calls to deprecated `Buffer()` API. Those rules are included in some presets.
There is a drawback, though, that it doesn't always
[work correctly](https://github.com/chalker/safer-buffer#why-not-safe-buffer) when `Buffer` is
overridden e.g. with a polyfill, so recommended is a combination of this and some other method
described above.
## <!--variant-1-->Variant 1: Drop support for Node.js ≤ 4.4.x and 5.0.0 — 5.9.x
This is the recommended solution nowadays that would imply only minimal overhead.
The Node.js 5.x release line has been unsupported since July 2016, and the Node.js 4.x release line reaches its End of Life in April 2018 (→ [Schedule](https://github.com/nodejs/Release#release-schedule)). This means that these versions of Node.js will *not* receive any updates, even in case of security issues, so using these release lines should be avoided, if at all possible.
What you would do in this case is to convert all `new Buffer()` or `Buffer()` calls to use `Buffer.alloc()` or `Buffer.from()`, in the following way:
- For `new Buffer(number)`, replace it with `Buffer.alloc(number)`.
- For `new Buffer(string)` (or `new Buffer(string, encoding)`), replace it with `Buffer.from(string)` (or `Buffer.from(string, encoding)`).
- For all other combinations of arguments (these are much rarer), also replace `new Buffer(...arguments)` with `Buffer.from(...arguments)`.
Note that `Buffer.alloc()` is also _faster_ on the current Node.js versions than
`new Buffer(size).fill(0)`, which is what you would otherwise need to ensure zero-filling.
Enabling ESLint rule [no-buffer-constructor](https://eslint.org/docs/rules/no-buffer-constructor)
or
[node/no-deprecated-api](https://github.com/mysticatea/eslint-plugin-node/blob/master/docs/rules/no-deprecated-api.md)
is recommended to avoid accidental unsafe `Buffer` API usage.
There is also a [JSCodeshift codemod](https://github.com/joyeecheung/node-dep-codemod#dep005)
for automatically migrating `Buffer` constructors to `Buffer.alloc()` or `Buffer.from()`.
Note that it currently only works with cases where the arguments are literals or where the
constructor is invoked with two arguments.
_If you currently support those older Node.js versions and dropping support for them is not possible, or if you support older branches of your packages, consider using [Variant 2](#variant-2)
or [Variant 3](#variant-3) on older branches, so people using those older branches will also receive
the fix. That way, you will eradicate potential issues caused by unguarded `Buffer` API usage and
your users will not observe a runtime deprecation warning when running your code on Node.js 10._
## <!--variant-2-->Variant 2: Use a polyfill
There are three different polyfills available:
- **[safer-buffer](https://www.npmjs.com/package/safer-buffer)** is a drop-in replacement for the
entire `Buffer` API, that will _throw_ when using `new Buffer()`.
You would take exactly the same steps as in [Variant 1](#variant-1), but with a polyfill
`const Buffer = require('safer-buffer').Buffer` in all files where you use the new `Buffer` API.
Do not use the old `new Buffer()` API. In any files where the line above is added,
using old `new Buffer()` API will _throw_.
- **[buffer-from](https://www.npmjs.com/package/buffer-from) and/or
[buffer-alloc](https://www.npmjs.com/package/buffer-alloc)** are
[ponyfills](https://ponyfill.com/) for their respective part of the `Buffer` API. You only need
to add the package(s) corresponding to the API you are using.
You would import the module needed with an appropriate name, e.g.
`const bufferFrom = require('buffer-from')` and then use that instead of the call to
`new Buffer()`, e.g. `new Buffer('test')` becomes `bufferFrom('test')`.
A downside with this approach is slightly more code changes to migrate off them (as you would be
using e.g. `Buffer.from()` under a different name).
- **[safe-buffer](https://www.npmjs.com/package/safe-buffer)** is also a drop-in replacement for
the entire `Buffer` API, but using `new Buffer()` will still work as before.
A downside to this approach is that it will allow you to also use the older `new Buffer()` API
in your code, which is problematic since it can cause issues in your code, and will start
emitting runtime deprecation warnings starting with Node.js 10
([read more here](https://github.com/chalker/safer-buffer#why-not-safe-buffer)).
Note that in either case, it is important that you also remove all calls to the old `Buffer`
API manually — just throwing in `safe-buffer` doesn't fix the problem by itself, it just provides
a polyfill for the new API. I have seen people doing that mistake.
Enabling ESLint rule [no-buffer-constructor](https://eslint.org/docs/rules/no-buffer-constructor)
or
[node/no-deprecated-api](https://github.com/mysticatea/eslint-plugin-node/blob/master/docs/rules/no-deprecated-api.md)
is recommended.
_Don't forget to drop the polyfill usage once you drop support for Node.js < 4.5.0._
## <!--variant-3-->Variant 3 — Manual detection, with safeguards
This is useful if you create `Buffer` instances in only a few places (e.g. one), or you have your own
wrapper around them.
### `Buffer(0)`
This special case for creating empty buffers can be safely replaced with `Buffer.concat([])`, which
returns the same result all the way down to Node.js 0.8.x.
### `Buffer(notNumber)`
Before:
```js
const buf = new Buffer(notNumber, encoding);
```
After:
```js
let buf;
if (Buffer.from && Buffer.from !== Uint8Array.from) {
buf = Buffer.from(notNumber, encoding);
} else {
if (typeof notNumber === 'number') {
throw new Error('The "size" argument must be not of type number.');
}
buf = new Buffer(notNumber, encoding);
}
```
`encoding` is optional.
Note that the `typeof notNumber` before `new Buffer()` is required (for cases when `notNumber` argument is not
hard-coded) and _is not caused by the deprecation of `Buffer` constructor_ — it's exactly _why_ the
`Buffer` constructor is deprecated. Ecosystem packages lacking this type-check caused numerous
security issues — situations when unsanitized user input could end up in the `Buffer(arg)` create
problems ranging from DoS to leaking sensitive information to the attacker from the process memory.
When `notNumber` argument is hardcoded (e.g. literal `"abc"` or `[0,1,2]`), the `typeof` check can
be omitted.
Also, note that using TypeScript does not fix this problem for you — when libs written in
`TypeScript` are used from JS, or when user input ends up there — it behaves exactly as pure JS, as
all type checks are translation-time only and are not present in the actual JS code which TS
compiles to.
### `Buffer(number)`
For Node.js 0.10.x (and below) support:
```js
var buf;
if (Buffer.alloc) {
buf = Buffer.alloc(number);
} else {
buf = new Buffer(number);
buf.fill(0);
}
```
Otherwise (Node.js ≥ 0.12.x):
```js
const buf = Buffer.alloc ? Buffer.alloc(number) : new Buffer(number).fill(0);
```
## Regarding `Buffer.allocUnsafe()`
Be extra cautious when using `Buffer.allocUnsafe()`:
* Don't use it if you don't have a good reason to
* e.g. you probably won't ever see a performance difference for small buffers, in fact, those
might be even faster with `Buffer.alloc()`,
* if your code is not in the hot code path — you also probably won't notice a difference,
* keep in mind that zero-filling minimizes the potential risks.
* If you use it, make sure that you never return the buffer in a partially-filled state,
* if you are writing to it sequentially — always truncate it to the actual written length
Errors in handling buffers allocated with `Buffer.allocUnsafe()` could result in various issues,
ranged from undefined behavior of your code to sensitive data (user input, passwords, certs)
leaking to the remote attacker.
_Note that the same applies to `new Buffer()` usage without zero-filling, depending on the Node.js
version (and lacking type checks also adds DoS to the list of potential problems)._
## FAQ
### <!--design-flaws-->What is wrong with the `Buffer` constructor?
The `Buffer` constructor could be used to create a buffer in many different ways:
- `new Buffer(42)` creates a `Buffer` of 42 bytes. Before Node.js 8, this buffer contained
*arbitrary memory* for performance reasons, which could include anything ranging from
program source code to passwords and encryption keys.
- `new Buffer('abc')` creates a `Buffer` that contains the UTF-8-encoded version of
the string `'abc'`. A second argument could specify another encoding: for example,
`new Buffer(string, 'base64')` could be used to convert a Base64 string into the original
sequence of bytes that it represents.
- There are several other combinations of arguments.
This meant that in code like `var buffer = new Buffer(foo);`, *it is not possible to tell
what exactly the contents of the generated buffer are* without knowing the type of `foo`.
Sometimes, the value of `foo` comes from an external source. For example, this function
could be exposed as a service on a web server, converting a UTF-8 string into its Base64 form:
```js
function stringToBase64(req, res) {
// The request body should have the format of `{ string: 'foobar' }`.
const rawBytes = new Buffer(req.body.string);
const encoded = rawBytes.toString('base64');
res.end({ encoded });
}
```
Note that this code does *not* validate the type of `req.body.string`:
- `req.body.string` is expected to be a string. If this is the case, all goes well.
- `req.body.string` is controlled by the client that sends the request.
- If `req.body.string` is the *number* `50`, the `rawBytes` would be `50` bytes:
- Before Node.js 8, the content would be uninitialized
- After Node.js 8, the content would be `50` bytes with the value `0`
Because of the missing type check, an attacker could intentionally send a number
as part of the request. Using this, they can either:
- Read uninitialized memory. This **will** leak passwords, encryption keys and other
kinds of sensitive information. (Information leak)
- Force the program to allocate a large amount of memory. For example, when specifying
`500000000` as the input value, each request will allocate 500MB of memory.
This can be used to either exhaust the memory available of a program completely
and make it crash, or slow it down significantly. (Denial of Service)
Both of these scenarios are considered serious security issues in a real-world
web server context.
When using `Buffer.from(req.body.string)` instead, passing a number will always
throw an exception instead, giving a controlled behavior that can always be
handled by the program.
### <!--ecosystem-usage-->The `Buffer()` constructor has been deprecated for a while. Is this really an issue?
Surveys of code in the `npm` ecosystem have shown that the `Buffer()` constructor is still
widely used. This includes new code, and overall usage of such code has actually been
*increasing*.
|
{
"content_hash": "539ae38d980a370d95947109f214156a",
"timestamp": "",
"source": "github",
"line_count": 280,
"max_line_length": 380,
"avg_line_length": 48.042857142857144,
"alnum_prop": 0.7446476360392507,
"repo_name": "yous/new.nodejs.org",
"id": "5d07bb4ea75954303138209c14e8c32aaf166c42",
"size": "13488",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "locale/en/docs/guides/buffer-constructor-deprecation.md",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "50244"
},
{
"name": "HTML",
"bytes": "48415"
},
{
"name": "JavaScript",
"bytes": "69604"
}
],
"symlink_target": ""
}
|
using SimplifiedDES.Attacks;
using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Runtime;
using System.Text;
using System.Threading.Tasks;
namespace SimplifiedDES
{
class Program
{
static void Main(string[] args)
{
try
{
Program prog = new Program();
BitArray[] plainTextArray;
BitArray[] cipherTextArray;
prog.ReadFile(args[0], out plainTextArray, out cipherTextArray);
prog.DecryptionBruteforce(plainTextArray, cipherTextArray);
}
catch(Exception e)
{
Console.Write(e.Message);
}
}
private void ReadFile(string fileName, out BitArray[] plainText, out BitArray[] cipherText)
{
var plainTextList = new List<BitArray>();
var cipherTextList = new List<BitArray>();
using (var reader = File.OpenText(fileName)) {
string line = null;
while ((line = reader.ReadLine()) != null)
{
string[] values = line.Split(',');
var plain = Tools.StringToBitArray(values[0]);
var cipher = Tools.StringToBitArray(values[1]);
plainTextList.Add(plain);
cipherTextList.Add(cipher);
}
}
plainText = plainTextList.ToArray();
cipherText = cipherTextList.ToArray();
}
private void DecryptionBruteforce(BitArray[] plainTextArray, BitArray[] cipherTextArray)
{
//Decryption bruteforce is faster than encryption
var DecKeyList = new List<string>();
for (int x = 0; x < cipherTextArray.Length; x++)
{
var key = Bruteforce.DecryptionAttack(plainTextArray[x], cipherTextArray[x], DecKeyList);
if (!DecKeyList.Contains(key))
DecKeyList.Add(key);
}
StringBuilder sB = new StringBuilder("Keys found: ");
foreach (var key in DecKeyList)
{
sB.Append(key);
sB.Append(", ");
}
sB.Remove(sB.Length - 2, 2);
Console.WriteLine(sB.ToString());
var goodKeys = Bruteforce.KeysForAll(DecKeyList, plainTextArray, cipherTextArray);
sB.Clear();
sB.Append("Keys that work for all the pairs: ");
foreach (var key in goodKeys)
{
sB.Append(key);
sB.Append(", ");
}
sB.Remove(sB.Length - 2, 2);
Console.WriteLine(sB.ToString());
}
private void PrecomputedAttack(BitArray[] plainTextArray, BitArray[] cipherTextArray)
{
var KeyList = Precomputed.Attack(plainTextArray, cipherTextArray);
StringBuilder sB = new StringBuilder("Keys found: ");
foreach (var key in KeyList)
{
sB.Append(key);
sB.Append(", ");
}
sB.Remove(sB.Length - 2, 2);
Console.WriteLine(sB.ToString());
var goodKeys = Bruteforce.KeysForAll(KeyList, plainTextArray, cipherTextArray);
sB.Clear();
sB.Append("Keys that work for all the pairs: ");
foreach (var key in goodKeys)
{
sB.Append(key);
sB.Append(", ");
}
sB.Remove(sB.Length - 2, 2);
Console.WriteLine(sB.ToString());
}
}
}
|
{
"content_hash": "d24feb6394047f94312d4839757db6eb",
"timestamp": "",
"source": "github",
"line_count": 106,
"max_line_length": 105,
"avg_line_length": 34.85849056603774,
"alnum_prop": 0.5228687415426252,
"repo_name": "SunNoise/S-DES",
"id": "062f77d7d019b3e12801b3727350243d6b2db79d",
"size": "3697",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "SimplifiedDES/Program.cs",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C#",
"bytes": "20331"
}
],
"symlink_target": ""
}
|
import pymongo
class MongoPipeline(object):
def __init__(self, mongo_uri, mongo_db):
self.mongo_uri = mongo_uri
self.mongo_db = mongo_db
self.mongo_col = mongo_col
@classmethod
def from_crawler(cls, crawler):
return cls(
mongo_uri=crawler.settings.get('MONGO_URI'),
mongo_db=crawler.settings.get('MONGO_DATABASE', 'items')
mongo_col=crawler.settings.get('MONGO_COLLECTION','items')
)
def open_spider(self, spider):
self.client = pymongo.MongoClient(self.mongo_uri)
self.db = self.client[self.mongo_db]
def close_spider(self, spider):
self.client.close()
def process_item(self, item, spider):
self.db[self.mongo_col].insert(dict(item))
return item
|
{
"content_hash": "30f2e53225c6fb76a3f99006c863d033",
"timestamp": "",
"source": "github",
"line_count": 27,
"max_line_length": 70,
"avg_line_length": 29.962962962962962,
"alnum_prop": 0.6019777503090235,
"repo_name": "patrick-s-h-lewis/BathSim",
"id": "c686bbca2fb33779ccc815b646616eef4c84e0b8",
"size": "809",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "BathSim/mongo_pipeline.py",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Python",
"bytes": "7940"
}
],
"symlink_target": ""
}
|
import {
isTag,
AnyNode,
ChildNode,
Element,
ParentNode,
hasChildren,
} from "domhandler";
/**
* Get a node's children.
*
* @category Traversal
* @param elem Node to get the children of.
* @returns `elem`'s children, or an empty array.
*/
export function getChildren(elem: AnyNode): ChildNode[] {
return hasChildren(elem) ? elem.children : [];
}
export function getParent(elem: AnyNode): ParentNode | null;
/**
* Get a node's parent.
*
* @category Traversal
* @param elem Node to get the parent of.
* @returns `elem`'s parent node.
*/
export function getParent(elem: AnyNode): ParentNode | null {
return elem.parent || null;
}
/**
* Gets an elements siblings, including the element itself.
*
* Attempts to get the children through the element's parent first. If we don't
* have a parent (the element is a root node), we walk the element's `prev` &
* `next` to get all remaining nodes.
*
* @category Traversal
* @param elem Element to get the siblings of.
* @returns `elem`'s siblings.
*/
export function getSiblings(elem: AnyNode): AnyNode[] {
const parent = getParent(elem);
if (parent != null) return getChildren(parent);
const siblings = [elem];
let { prev, next } = elem;
while (prev != null) {
siblings.unshift(prev);
({ prev } = prev);
}
while (next != null) {
siblings.push(next);
({ next } = next);
}
return siblings;
}
/**
* Gets an attribute from an element.
*
* @category Traversal
* @param elem Element to check.
* @param name Attribute name to retrieve.
* @returns The element's attribute value, or `undefined`.
*/
export function getAttributeValue(
elem: Element,
name: string
): string | undefined {
return elem.attribs?.[name];
}
/**
* Checks whether an element has an attribute.
*
* @category Traversal
* @param elem Element to check.
* @param name Attribute name to look for.
* @returns Returns whether `elem` has the attribute `name`.
*/
export function hasAttrib(elem: Element, name: string): boolean {
return (
elem.attribs != null &&
Object.prototype.hasOwnProperty.call(elem.attribs, name) &&
elem.attribs[name] != null
);
}
/**
* Get the tag name of an element.
*
* @category Traversal
* @param elem The element to get the name for.
* @returns The tag name of `elem`.
*/
export function getName(elem: Element): string {
return elem.name;
}
/**
* Returns the next element sibling of a node.
*
* @category Traversal
* @param elem The element to get the next sibling of.
* @returns `elem`'s next sibling that is a tag.
*/
export function nextElementSibling(elem: AnyNode): Element | null {
let { next } = elem;
while (next !== null && !isTag(next)) ({ next } = next);
return next;
}
/**
* Returns the previous element sibling of a node.
*
* @category Traversal
* @param elem The element to get the previous sibling of.
* @returns `elem`'s previous sibling that is a tag.
*/
export function prevElementSibling(elem: AnyNode): Element | null {
let { prev } = elem;
while (prev !== null && !isTag(prev)) ({ prev } = prev);
return prev;
}
|
{
"content_hash": "d71a85e9911ebe1b8f383e2092d10ae5",
"timestamp": "",
"source": "github",
"line_count": 127,
"max_line_length": 79,
"avg_line_length": 25.125984251968504,
"alnum_prop": 0.649012848636791,
"repo_name": "fb55/DomUtils",
"id": "5209f61a1a02b8cbf5043cb3ba1224f1913b4d61",
"size": "3191",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/traversal.ts",
"mode": "33188",
"license": "bsd-2-clause",
"language": [
{
"name": "JavaScript",
"bytes": "18027"
}
],
"symlink_target": ""
}
|
SYNONYM
#### According to
The Catalogue of Life, 3rd January 2011
#### Published in
null
#### Original name
null
### Remarks
null
|
{
"content_hash": "e7b456f8d15403f44f18f20febf32600",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 39,
"avg_line_length": 10.23076923076923,
"alnum_prop": 0.6917293233082706,
"repo_name": "mdoering/backbone",
"id": "710ae7835a2fb18d704c15db02f32d16b074eb7a",
"size": "183",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "life/Plantae/Magnoliophyta/Magnoliopsida/Asterales/Asteraceae/Albizia/Albizia schimperiana/ Syn. Albizia maranguensis/README.md",
"mode": "33188",
"license": "apache-2.0",
"language": [],
"symlink_target": ""
}
|
#include <linux/dma-mapping.h>
#include "ath9k.h"
#define FUDGE 2
static void ath9k_reset_beacon_status(struct ath_softc *sc)
{
sc->beacon.tx_processed = false;
sc->beacon.tx_last = false;
}
/*
* This function will modify certain transmit queue properties depending on
* the operating mode of the station (AP or AdHoc). Parameters are AIFS
* settings and channel width min/max
*/
static void ath9k_beaconq_config(struct ath_softc *sc)
{
struct ath_hw *ah = sc->sc_ah;
struct ath_common *common = ath9k_hw_common(ah);
struct ath9k_tx_queue_info qi, qi_be;
struct ath_txq *txq;
ath9k_hw_get_txq_props(ah, sc->beacon.beaconq, &qi);
if (sc->sc_ah->opmode == NL80211_IFTYPE_AP) {
/* Always burst out beacon and CAB traffic. */
qi.tqi_aifs = 1;
qi.tqi_cwmin = 0;
qi.tqi_cwmax = 0;
} else {
/* Adhoc mode; important thing is to use 2x cwmin. */
txq = sc->tx.txq_map[IEEE80211_AC_BE];
ath9k_hw_get_txq_props(ah, txq->axq_qnum, &qi_be);
qi.tqi_aifs = qi_be.tqi_aifs;
if (ah->slottime == ATH9K_SLOT_TIME_20)
qi.tqi_cwmin = 2*qi_be.tqi_cwmin;
else
qi.tqi_cwmin = 4*qi_be.tqi_cwmin;
qi.tqi_cwmax = qi_be.tqi_cwmax;
}
if (!ath9k_hw_set_txq_props(ah, sc->beacon.beaconq, &qi)) {
ath_err(common, "Unable to update h/w beacon queue parameters\n");
} else {
ath9k_hw_resettxqueue(ah, sc->beacon.beaconq);
}
}
/*
* Associates the beacon frame buffer with a transmit descriptor. Will set
* up rate codes, and channel flags. Beacons are always sent out at the
* lowest rate, and are not retried.
*/
static void ath9k_beacon_setup(struct ath_softc *sc, struct ieee80211_vif *vif,
struct ath_buf *bf, int rateidx)
{
struct sk_buff *skb = bf->bf_mpdu;
struct ath_hw *ah = sc->sc_ah;
struct ath_common *common = ath9k_hw_common(ah);
struct ath_tx_info info;
struct ieee80211_supported_band *sband;
u8 chainmask = ah->txchainmask;
u8 rate = 0;
sband = &sc->sbands[common->hw->conf.channel->band];
rate = sband->bitrates[rateidx].hw_value;
if (vif->bss_conf.use_short_preamble)
rate |= sband->bitrates[rateidx].hw_value_short;
memset(&info, 0, sizeof(info));
info.pkt_len = skb->len + FCS_LEN;
info.type = ATH9K_PKT_TYPE_BEACON;
info.txpower = MAX_RATE_POWER;
info.keyix = ATH9K_TXKEYIX_INVALID;
info.keytype = ATH9K_KEY_TYPE_CLEAR;
info.flags = ATH9K_TXDESC_NOACK | ATH9K_TXDESC_CLRDMASK;
info.buf_addr[0] = bf->bf_buf_addr;
info.buf_len[0] = roundup(skb->len, 4);
info.is_first = true;
info.is_last = true;
info.qcu = sc->beacon.beaconq;
info.rates[0].Tries = 1;
info.rates[0].Rate = rate;
info.rates[0].ChSel = ath_txchainmask_reduction(sc, chainmask, rate);
ath9k_hw_set_txdesc(ah, bf->bf_desc, &info);
}
static void ath9k_tx_cabq(struct ieee80211_hw *hw, struct sk_buff *skb)
{
struct ath_softc *sc = hw->priv;
struct ath_common *common = ath9k_hw_common(sc->sc_ah);
struct ath_tx_control txctl;
memset(&txctl, 0, sizeof(struct ath_tx_control));
txctl.txq = sc->beacon.cabq;
ath_dbg(common, XMIT, "transmitting CABQ packet, skb: %p\n", skb);
if (ath_tx_start(hw, skb, &txctl) != 0) {
ath_dbg(common, XMIT, "CABQ TX failed\n");
ieee80211_free_txskb(hw, skb);
}
}
static struct ath_buf *ath9k_beacon_generate(struct ieee80211_hw *hw,
struct ieee80211_vif *vif)
{
struct ath_softc *sc = hw->priv;
struct ath_common *common = ath9k_hw_common(sc->sc_ah);
struct ath_buf *bf;
struct ath_vif *avp = (void *)vif->drv_priv;
struct sk_buff *skb;
struct ath_txq *cabq = sc->beacon.cabq;
struct ieee80211_tx_info *info;
struct ieee80211_mgmt *mgmt_hdr;
int cabq_depth;
if (avp->av_bcbuf == NULL)
return NULL;
bf = avp->av_bcbuf;
skb = bf->bf_mpdu;
if (skb) {
dma_unmap_single(sc->dev, bf->bf_buf_addr,
skb->len, DMA_TO_DEVICE);
dev_kfree_skb_any(skb);
bf->bf_buf_addr = 0;
bf->bf_mpdu = NULL;
}
skb = ieee80211_beacon_get(hw, vif);
if (skb == NULL)
return NULL;
bf->bf_mpdu = skb;
mgmt_hdr = (struct ieee80211_mgmt *)skb->data;
mgmt_hdr->u.beacon.timestamp = avp->tsf_adjust;
info = IEEE80211_SKB_CB(skb);
if (info->flags & IEEE80211_TX_CTL_ASSIGN_SEQ) {
/*
* TODO: make sure the seq# gets assigned properly (vs. other
* TX frames)
*/
struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)skb->data;
sc->tx.seq_no += 0x10;
hdr->seq_ctrl &= cpu_to_le16(IEEE80211_SCTL_FRAG);
hdr->seq_ctrl |= cpu_to_le16(sc->tx.seq_no);
}
bf->bf_buf_addr = dma_map_single(sc->dev, skb->data,
skb->len, DMA_TO_DEVICE);
if (unlikely(dma_mapping_error(sc->dev, bf->bf_buf_addr))) {
dev_kfree_skb_any(skb);
bf->bf_mpdu = NULL;
bf->bf_buf_addr = 0;
ath_err(common, "dma_mapping_error on beaconing\n");
return NULL;
}
skb = ieee80211_get_buffered_bc(hw, vif);
/*
* if the CABQ traffic from previous DTIM is pending and the current
* beacon is also a DTIM.
* 1) if there is only one vif let the cab traffic continue.
* 2) if there are more than one vif and we are using staggered
* beacons, then drain the cabq by dropping all the frames in
* the cabq so that the current vifs cab traffic can be scheduled.
*/
spin_lock_bh(&cabq->axq_lock);
cabq_depth = cabq->axq_depth;
spin_unlock_bh(&cabq->axq_lock);
if (skb && cabq_depth) {
if (sc->nvifs > 1) {
ath_dbg(common, BEACON,
"Flushing previous cabq traffic\n");
ath_draintxq(sc, cabq, false);
}
}
ath9k_beacon_setup(sc, vif, bf, info->control.rates[0].idx);
while (skb) {
ath9k_tx_cabq(hw, skb);
skb = ieee80211_get_buffered_bc(hw, vif);
}
return bf;
}
void ath9k_beacon_assign_slot(struct ath_softc *sc, struct ieee80211_vif *vif)
{
struct ath_common *common = ath9k_hw_common(sc->sc_ah);
struct ath_vif *avp = (void *)vif->drv_priv;
int slot;
avp->av_bcbuf = list_first_entry(&sc->beacon.bbuf, struct ath_buf, list);
list_del(&avp->av_bcbuf->list);
for (slot = 0; slot < ATH_BCBUF; slot++) {
if (sc->beacon.bslot[slot] == NULL) {
avp->av_bslot = slot;
break;
}
}
sc->beacon.bslot[avp->av_bslot] = vif;
sc->nbcnvifs++;
ath_dbg(common, CONFIG, "Added interface at beacon slot: %d\n",
avp->av_bslot);
}
void ath9k_beacon_remove_slot(struct ath_softc *sc, struct ieee80211_vif *vif)
{
struct ath_common *common = ath9k_hw_common(sc->sc_ah);
struct ath_vif *avp = (void *)vif->drv_priv;
struct ath_buf *bf = avp->av_bcbuf;
ath_dbg(common, CONFIG, "Removing interface at beacon slot: %d\n",
avp->av_bslot);
tasklet_disable(&sc->bcon_tasklet);
if (bf && bf->bf_mpdu) {
struct sk_buff *skb = bf->bf_mpdu;
dma_unmap_single(sc->dev, bf->bf_buf_addr,
skb->len, DMA_TO_DEVICE);
dev_kfree_skb_any(skb);
bf->bf_mpdu = NULL;
bf->bf_buf_addr = 0;
}
avp->av_bcbuf = NULL;
sc->beacon.bslot[avp->av_bslot] = NULL;
sc->nbcnvifs--;
list_add_tail(&bf->list, &sc->beacon.bbuf);
tasklet_enable(&sc->bcon_tasklet);
}
static int ath9k_beacon_choose_slot(struct ath_softc *sc)
{
struct ath_common *common = ath9k_hw_common(sc->sc_ah);
struct ath_beacon_config *cur_conf = &sc->cur_beacon_conf;
u16 intval;
u32 tsftu;
u64 tsf;
int slot;
if (sc->sc_ah->opmode != NL80211_IFTYPE_AP) {
ath_dbg(common, BEACON, "slot 0, tsf: %llu\n",
ath9k_hw_gettsf64(sc->sc_ah));
return 0;
}
intval = cur_conf->beacon_interval ? : ATH_DEFAULT_BINTVAL;
tsf = ath9k_hw_gettsf64(sc->sc_ah);
tsf += TU_TO_USEC(sc->sc_ah->config.sw_beacon_response_time);
tsftu = TSF_TO_TU((tsf * ATH_BCBUF) >>32, tsf * ATH_BCBUF);
slot = (tsftu % (intval * ATH_BCBUF)) / intval;
ath_dbg(common, BEACON, "slot: %d tsf: %llu tsftu: %u\n",
slot, tsf, tsftu / ATH_BCBUF);
return slot;
}
void ath9k_set_tsfadjust(struct ath_softc *sc, struct ieee80211_vif *vif)
{
struct ath_common *common = ath9k_hw_common(sc->sc_ah);
struct ath_beacon_config *cur_conf = &sc->cur_beacon_conf;
struct ath_vif *avp = (void *)vif->drv_priv;
u64 tsfadjust;
if (avp->av_bslot == 0)
return;
tsfadjust = cur_conf->beacon_interval * avp->av_bslot / ATH_BCBUF;
avp->tsf_adjust = cpu_to_le64(TU_TO_USEC(tsfadjust));
ath_dbg(common, CONFIG, "tsfadjust is: %llu for bslot: %d\n",
(unsigned long long)tsfadjust, avp->av_bslot);
}
void ath9k_beacon_tasklet(unsigned long data)
{
struct ath_softc *sc = (struct ath_softc *)data;
struct ath_hw *ah = sc->sc_ah;
struct ath_common *common = ath9k_hw_common(ah);
struct ath_buf *bf = NULL;
struct ieee80211_vif *vif;
bool edma = !!(ah->caps.hw_caps & ATH9K_HW_CAP_EDMA);
int slot;
if (test_bit(SC_OP_HW_RESET, &sc->sc_flags)) {
ath_dbg(common, RESET,
"reset work is pending, skip beaconing now\n");
return;
}
/*
* Check if the previous beacon has gone out. If
* not don't try to post another, skip this period
* and wait for the next. Missed beacons indicate
* a problem and should not occur. If we miss too
* many consecutive beacons reset the device.
*/
if (ath9k_hw_numtxpending(ah, sc->beacon.beaconq) != 0) {
sc->beacon.bmisscnt++;
if (!ath9k_hw_check_alive(ah))
ieee80211_queue_work(sc->hw, &sc->hw_check_work);
if (sc->beacon.bmisscnt < BSTUCK_THRESH * sc->nbcnvifs) {
ath_dbg(common, BSTUCK,
"missed %u consecutive beacons\n",
sc->beacon.bmisscnt);
ath9k_hw_stop_dma_queue(ah, sc->beacon.beaconq);
if (sc->beacon.bmisscnt > 3)
ath9k_hw_bstuck_nfcal(ah);
} else if (sc->beacon.bmisscnt >= BSTUCK_THRESH) {
ath_dbg(common, BSTUCK, "beacon is officially stuck\n");
sc->beacon.bmisscnt = 0;
ath9k_queue_reset(sc, RESET_TYPE_BEACON_STUCK);
}
return;
}
slot = ath9k_beacon_choose_slot(sc);
vif = sc->beacon.bslot[slot];
if (!vif || !vif->bss_conf.enable_beacon)
return;
bf = ath9k_beacon_generate(sc->hw, vif);
if (sc->beacon.bmisscnt != 0) {
ath_dbg(common, BSTUCK, "resume beacon xmit after %u misses\n",
sc->beacon.bmisscnt);
sc->beacon.bmisscnt = 0;
}
/*
* Handle slot time change when a non-ERP station joins/leaves
* an 11g network. The 802.11 layer notifies us via callback,
* we mark updateslot, then wait one beacon before effecting
* the change. This gives associated stations at least one
* beacon interval to note the state change.
*
* NB: The slot time change state machine is clocked according
* to whether we are bursting or staggering beacons. We
* recognize the request to update and record the current
* slot then don't transition until that slot is reached
* again. If we miss a beacon for that slot then we'll be
* slow to transition but we'll be sure at least one beacon
* interval has passed. When bursting slot is always left
* set to ATH_BCBUF so this check is a noop.
*/
if (sc->beacon.updateslot == UPDATE) {
sc->beacon.updateslot = COMMIT;
sc->beacon.slotupdate = slot;
} else if (sc->beacon.updateslot == COMMIT &&
sc->beacon.slotupdate == slot) {
ah->slottime = sc->beacon.slottime;
ath9k_hw_init_global_settings(ah);
sc->beacon.updateslot = OK;
}
if (bf) {
ath9k_reset_beacon_status(sc);
ath_dbg(common, BEACON,
"Transmitting beacon for slot: %d\n", slot);
/* NB: cabq traffic should already be queued and primed */
ath9k_hw_puttxbuf(ah, sc->beacon.beaconq, bf->bf_daddr);
if (!edma)
ath9k_hw_txstart(ah, sc->beacon.beaconq);
}
}
static void ath9k_beacon_init(struct ath_softc *sc, u32 nexttbtt, u32 intval)
{
struct ath_hw *ah = sc->sc_ah;
ath9k_hw_disable_interrupts(ah);
ath9k_hw_reset_tsf(ah);
ath9k_beaconq_config(sc);
ath9k_hw_beaconinit(ah, nexttbtt, intval);
sc->beacon.bmisscnt = 0;
ath9k_hw_set_interrupts(ah);
ath9k_hw_enable_interrupts(ah);
}
/*
* For multi-bss ap support beacons are either staggered evenly over N slots or
* burst together. For the former arrange for the SWBA to be delivered for each
* slot. Slots that are not occupied will generate nothing.
*/
static void ath9k_beacon_config_ap(struct ath_softc *sc,
struct ath_beacon_config *conf)
{
struct ath_hw *ah = sc->sc_ah;
struct ath_common *common = ath9k_hw_common(ah);
u32 nexttbtt, intval;
/* NB: the beacon interval is kept internally in TU's */
intval = TU_TO_USEC(conf->beacon_interval);
intval /= ATH_BCBUF;
nexttbtt = intval;
if (conf->enable_beacon)
ah->imask |= ATH9K_INT_SWBA;
else
ah->imask &= ~ATH9K_INT_SWBA;
ath_dbg(common, BEACON, "AP nexttbtt: %u intval: %u conf_intval: %u\n",
nexttbtt, intval, conf->beacon_interval);
ath9k_beacon_init(sc, nexttbtt, intval);
}
/*
* This sets up the beacon timers according to the timestamp of the last
* received beacon and the current TSF, configures PCF and DTIM
* handling, programs the sleep registers so the hardware will wakeup in
* time to receive beacons, and configures the beacon miss handling so
* we'll receive a BMISS interrupt when we stop seeing beacons from the AP
* we've associated with.
*/
static void ath9k_beacon_config_sta(struct ath_softc *sc,
struct ath_beacon_config *conf)
{
struct ath_hw *ah = sc->sc_ah;
struct ath_common *common = ath9k_hw_common(ah);
struct ath9k_beacon_state bs;
int dtimperiod, dtimcount, sleepduration;
int cfpperiod, cfpcount;
u32 nexttbtt = 0, intval, tsftu;
u64 tsf;
int num_beacons, offset, dtim_dec_count, cfp_dec_count;
/* No need to configure beacon if we are not associated */
if (!test_bit(SC_OP_PRIM_STA_VIF, &sc->sc_flags)) {
ath_dbg(common, BEACON,
"STA is not yet associated..skipping beacon config\n");
return;
}
memset(&bs, 0, sizeof(bs));
intval = conf->beacon_interval;
/*
* Setup dtim and cfp parameters according to
* last beacon we received (which may be none).
*/
dtimperiod = conf->dtim_period;
dtimcount = conf->dtim_count;
if (dtimcount >= dtimperiod) /* NB: sanity check */
dtimcount = 0;
cfpperiod = 1; /* NB: no PCF support yet */
cfpcount = 0;
sleepduration = conf->listen_interval * intval;
/*
* Pull nexttbtt forward to reflect the current
* TSF and calculate dtim+cfp state for the result.
*/
tsf = ath9k_hw_gettsf64(ah);
tsftu = TSF_TO_TU(tsf>>32, tsf) + FUDGE;
num_beacons = tsftu / intval + 1;
offset = tsftu % intval;
nexttbtt = tsftu - offset;
if (offset)
nexttbtt += intval;
/* DTIM Beacon every dtimperiod Beacon */
dtim_dec_count = num_beacons % dtimperiod;
/* CFP every cfpperiod DTIM Beacon */
cfp_dec_count = (num_beacons / dtimperiod) % cfpperiod;
if (dtim_dec_count)
cfp_dec_count++;
dtimcount -= dtim_dec_count;
if (dtimcount < 0)
dtimcount += dtimperiod;
cfpcount -= cfp_dec_count;
if (cfpcount < 0)
cfpcount += cfpperiod;
bs.bs_intval = intval;
bs.bs_nexttbtt = nexttbtt;
bs.bs_dtimperiod = dtimperiod*intval;
bs.bs_nextdtim = bs.bs_nexttbtt + dtimcount*intval;
bs.bs_cfpperiod = cfpperiod*bs.bs_dtimperiod;
bs.bs_cfpnext = bs.bs_nextdtim + cfpcount*bs.bs_dtimperiod;
bs.bs_cfpmaxduration = 0;
/*
* Calculate the number of consecutive beacons to miss* before taking
* a BMISS interrupt. The configuration is specified in TU so we only
* need calculate based on the beacon interval. Note that we clamp the
* result to at most 15 beacons.
*/
if (sleepduration > intval) {
bs.bs_bmissthreshold = conf->listen_interval *
ATH_DEFAULT_BMISS_LIMIT / 2;
} else {
bs.bs_bmissthreshold = DIV_ROUND_UP(conf->bmiss_timeout, intval);
if (bs.bs_bmissthreshold > 15)
bs.bs_bmissthreshold = 15;
else if (bs.bs_bmissthreshold <= 0)
bs.bs_bmissthreshold = 1;
}
/*
* Calculate sleep duration. The configuration is given in ms.
* We ensure a multiple of the beacon period is used. Also, if the sleep
* duration is greater than the DTIM period then it makes senses
* to make it a multiple of that.
*
* XXX fixed at 100ms
*/
bs.bs_sleepduration = roundup(IEEE80211_MS_TO_TU(100), sleepduration);
if (bs.bs_sleepduration > bs.bs_dtimperiod)
bs.bs_sleepduration = bs.bs_dtimperiod;
/* TSF out of range threshold fixed at 1 second */
bs.bs_tsfoor_threshold = ATH9K_TSFOOR_THRESHOLD;
ath_dbg(common, BEACON, "tsf: %llu tsftu: %u\n", tsf, tsftu);
ath_dbg(common, BEACON,
"bmiss: %u sleep: %u cfp-period: %u maxdur: %u next: %u\n",
bs.bs_bmissthreshold, bs.bs_sleepduration,
bs.bs_cfpperiod, bs.bs_cfpmaxduration, bs.bs_cfpnext);
/* Set the computed STA beacon timers */
ath9k_hw_disable_interrupts(ah);
ath9k_hw_set_sta_beacon_timers(ah, &bs);
ah->imask |= ATH9K_INT_BMISS;
ath9k_hw_set_interrupts(ah);
ath9k_hw_enable_interrupts(ah);
}
static void ath9k_beacon_config_adhoc(struct ath_softc *sc,
struct ath_beacon_config *conf)
{
struct ath_hw *ah = sc->sc_ah;
struct ath_common *common = ath9k_hw_common(ah);
u32 intval, nexttbtt;
ath9k_reset_beacon_status(sc);
intval = TU_TO_USEC(conf->beacon_interval);
nexttbtt = intval;
if (conf->enable_beacon)
ah->imask |= ATH9K_INT_SWBA;
else
ah->imask &= ~ATH9K_INT_SWBA;
ath_dbg(common, BEACON, "IBSS nexttbtt: %u intval: %u conf_intval: %u\n",
nexttbtt, intval, conf->beacon_interval);
ath9k_beacon_init(sc, nexttbtt, intval);
}
bool ath9k_allow_beacon_config(struct ath_softc *sc, struct ieee80211_vif *vif)
{
struct ath_common *common = ath9k_hw_common(sc->sc_ah);
struct ath_vif *avp = (void *)vif->drv_priv;
if (sc->sc_ah->opmode == NL80211_IFTYPE_AP) {
if ((vif->type != NL80211_IFTYPE_AP) ||
(sc->nbcnvifs > 1)) {
ath_dbg(common, CONFIG,
"An AP interface is already present !\n");
return false;
}
}
if (sc->sc_ah->opmode == NL80211_IFTYPE_STATION) {
if ((vif->type == NL80211_IFTYPE_STATION) &&
test_bit(SC_OP_BEACONS, &sc->sc_flags) &&
!avp->primary_sta_vif) {
ath_dbg(common, CONFIG,
"Beacon already configured for a station interface\n");
return false;
}
}
return true;
}
static void ath9k_cache_beacon_config(struct ath_softc *sc,
struct ieee80211_bss_conf *bss_conf)
{
struct ath_common *common = ath9k_hw_common(sc->sc_ah);
struct ath_beacon_config *cur_conf = &sc->cur_beacon_conf;
ath_dbg(common, BEACON,
"Caching beacon data for BSS: %pM\n", bss_conf->bssid);
cur_conf->beacon_interval = bss_conf->beacon_int;
cur_conf->dtim_period = bss_conf->dtim_period;
cur_conf->listen_interval = 1;
cur_conf->dtim_count = 1;
cur_conf->bmiss_timeout =
ATH_DEFAULT_BMISS_LIMIT * cur_conf->beacon_interval;
/*
* It looks like mac80211 may end up using beacon interval of zero in
* some cases (at least for mesh point). Avoid getting into an
* infinite loop by using a bit safer value instead. To be safe,
* do sanity check on beacon interval for all operating modes.
*/
if (cur_conf->beacon_interval == 0)
cur_conf->beacon_interval = 100;
/*
* We don't parse dtim period from mac80211 during the driver
* initialization as it breaks association with hidden-ssid
* AP and it causes latency in roaming
*/
if (cur_conf->dtim_period == 0)
cur_conf->dtim_period = 1;
}
void ath9k_beacon_config(struct ath_softc *sc, struct ieee80211_vif *vif,
u32 changed)
{
struct ieee80211_bss_conf *bss_conf = &vif->bss_conf;
struct ath_beacon_config *cur_conf = &sc->cur_beacon_conf;
if (sc->sc_ah->opmode == NL80211_IFTYPE_STATION) {
ath9k_cache_beacon_config(sc, bss_conf);
ath9k_set_beacon(sc);
set_bit(SC_OP_BEACONS, &sc->sc_flags);
} else {
/*
* Take care of multiple interfaces when
* enabling/disabling SWBA.
*/
if (changed & BSS_CHANGED_BEACON_ENABLED) {
if (!bss_conf->enable_beacon &&
(sc->nbcnvifs <= 1)) {
cur_conf->enable_beacon = false;
} else if (bss_conf->enable_beacon) {
cur_conf->enable_beacon = true;
ath9k_cache_beacon_config(sc, bss_conf);
}
}
if (cur_conf->beacon_interval) {
ath9k_set_beacon(sc);
if (cur_conf->enable_beacon)
set_bit(SC_OP_BEACONS, &sc->sc_flags);
else
clear_bit(SC_OP_BEACONS, &sc->sc_flags);
}
}
}
void ath9k_set_beacon(struct ath_softc *sc)
{
struct ath_common *common = ath9k_hw_common(sc->sc_ah);
struct ath_beacon_config *cur_conf = &sc->cur_beacon_conf;
switch (sc->sc_ah->opmode) {
case NL80211_IFTYPE_AP:
ath9k_beacon_config_ap(sc, cur_conf);
break;
case NL80211_IFTYPE_ADHOC:
case NL80211_IFTYPE_MESH_POINT:
ath9k_beacon_config_adhoc(sc, cur_conf);
break;
case NL80211_IFTYPE_STATION:
ath9k_beacon_config_sta(sc, cur_conf);
break;
default:
ath_dbg(common, CONFIG, "Unsupported beaconing mode\n");
return;
}
}
|
{
"content_hash": "428c6d92d49388aea61a0df4eaed4c63",
"timestamp": "",
"source": "github",
"line_count": 706,
"max_line_length": 80,
"avg_line_length": 28.65014164305949,
"alnum_prop": 0.673654026795867,
"repo_name": "pavpanchekha/bitrate-lab",
"id": "2ca355e94da65467e36595990423c80be1b897b6",
"size": "21020",
"binary": false,
"copies": "95",
"ref": "refs/heads/master",
"path": "ath9k/beacon.c",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C",
"bytes": "2364754"
},
{
"name": "C++",
"bytes": "3596"
},
{
"name": "Python",
"bytes": "100772"
},
{
"name": "Shell",
"bytes": "1530"
}
],
"symlink_target": ""
}
|
@interface MultilevelCollectionViewCell : UICollectionViewCell
@property (weak, nonatomic) IBOutlet UIImageView *iconImageView;
@property (weak, nonatomic) IBOutlet UILabel *textLab;
@end
|
{
"content_hash": "ff359bda341f23eee5dd3ae5b036114a",
"timestamp": "",
"source": "github",
"line_count": 5,
"max_line_length": 64,
"avg_line_length": 37.8,
"alnum_prop": 0.8253968253968254,
"repo_name": "renyufei8023/MangGuoTV",
"id": "27eab6dca3cab228b7214ef72078ed73b4eb9b69",
"size": "367",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "芒果TV/芒果TV/Util/Comon/MultilevelCollectionViewCell.h",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C",
"bytes": "30543"
},
{
"name": "C++",
"bytes": "54687"
},
{
"name": "Objective-C",
"bytes": "1398360"
},
{
"name": "Objective-C++",
"bytes": "124423"
},
{
"name": "Ruby",
"bytes": "354"
},
{
"name": "Shell",
"bytes": "8461"
}
],
"symlink_target": ""
}
|
ENV is a class than enables to interact with environmental variables
### Class methods
```swift
// read an env variable
var value = ENV.get("VAR_NAME")
// write an env value
ENV.set("VAR_KEY", "VAR_VALUE")
// list all env variables
var list = ENV.keys()
```
### Class Constants
```swift
var max_arg = ENV.argc - 1
var my_arg = ENV.argv[max_arg]
```
|
{
"content_hash": "44baa1a2cbbedededf3399505485f8b5",
"timestamp": "",
"source": "github",
"line_count": 19,
"max_line_length": 68,
"avg_line_length": 18.63157894736842,
"alnum_prop": 0.672316384180791,
"repo_name": "marcobambini/gravity",
"id": "978222d853a4ec7544f85ac834f91f7130b8eb4b",
"size": "361",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "docs/env.md",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C",
"bytes": "1061310"
},
{
"name": "C++",
"bytes": "12422"
},
{
"name": "CMake",
"bytes": "4006"
},
{
"name": "Makefile",
"bytes": "2633"
},
{
"name": "Objective-C",
"bytes": "93025"
},
{
"name": "Shell",
"bytes": "1462"
}
],
"symlink_target": ""
}
|
/**
* Tests for Build Configuration Command.
*/
import * as Chai from "chai";
import * as Sinon from "sinon";
import { IFileSystem } from "unitejs-framework/dist/interfaces/IFileSystem";
import { ILogger } from "unitejs-framework/dist/interfaces/ILogger";
import { ClientPackageCommand } from "../../../../src/commands/clientPackageCommand";
import { UniteClientPackage } from "../../../../src/configuration/models/unite/uniteClientPackage";
import { UniteConfiguration } from "../../../../src/configuration/models/unite/uniteConfiguration";
import { PackageUtils } from "../../../../src/pipelineSteps/packageUtils";
import { FileSystemMock } from "../fileSystem.mock";
import { ReadOnlyFileSystemMock } from "../readOnlyFileSystem.mock";
describe("ClientPackageCommand", () => {
let sandbox: Sinon.SinonSandbox;
let loggerStub: ILogger;
let fileSystemStub: IFileSystem;
let loggerErrorSpy: Sinon.SinonSpy;
let loggerBannerSpy: Sinon.SinonSpy;
let uniteJson: UniteConfiguration;
let uniteJsonWritten: UniteConfiguration;
let fileWriteJsonErrors: boolean;
let packageInfo: string;
let failPackageAdd: boolean;
let enginePeerPackages: { [id: string]: string};
let profiles: { [id: string]: UniteClientPackage};
beforeEach(async () => {
sandbox = Sinon.createSandbox();
loggerStub = <ILogger>{};
loggerStub.banner = () => { };
loggerStub.info = () => { };
loggerStub.error = () => { };
loggerStub.warning = () => { };
fileSystemStub = new ReadOnlyFileSystemMock();
loggerErrorSpy = sandbox.spy(loggerStub, "error");
loggerBannerSpy = sandbox.spy(loggerStub, "banner");
uniteJson = undefined;
fileWriteJsonErrors = false;
packageInfo = undefined;
uniteJsonWritten = undefined;
failPackageAdd = false;
profiles = undefined;
const originalFileExists = fileSystemStub.fileExists;
const stubExists = sandbox.stub(fileSystemStub, "fileExists");
stubExists.callsFake(async (folder, filename) => {
if (filename === "unite.json") {
return Promise.resolve(uniteJson === undefined ? false : true);
} else {
return originalFileExists(folder, filename);
}
});
const originalFileReadJson = fileSystemStub.fileReadJson;
const stubreadJson = sandbox.stub(fileSystemStub, "fileReadJson");
stubreadJson.callsFake(async (folder, filename) => {
if (filename === "unite.json") {
return uniteJson === null ? Promise.reject("err") : Promise.resolve(uniteJson);
} else if (filename === "clientPackage.json") {
return profiles ? Promise.resolve(profiles) : originalFileReadJson(folder, filename);
} else {
return originalFileReadJson(folder, filename);
}
});
const originalFileWriteJson = fileSystemStub.fileWriteJson;
const stubWriteJson = sandbox.stub(fileSystemStub, "fileWriteJson");
stubWriteJson.callsFake(async (folder, filename, obj) => {
if (fileWriteJsonErrors) {
return Promise.reject("error");
} else {
if (filename === "unite.json") {
uniteJsonWritten = obj;
return Promise.resolve();
} else {
return originalFileWriteJson(folder, filename, obj);
}
}
});
const execStub = sandbox.stub(PackageUtils, "exec");
execStub.callsFake(async (logger: ILogger, fileSystem: IFileSystem, packageName: string, workingDirectory: string, args: string[]) => {
if (args[0] === "view") {
if (packageInfo === null) {
return Promise.reject("package information");
} else {
return Promise.resolve(packageInfo);
}
} else {
return failPackageAdd ? Promise.reject("error") : Promise.resolve("");
}
});
uniteJson = {
packageName: "my-package",
title: "My App",
license: "MIT",
sourceLanguage: "JavaScript",
moduleType: "AMD",
bundler: "RequireJS",
unitTestRunner: "Karma",
unitTestFramework: "Jasmine",
unitTestEngine: "PhantomJS",
e2eTestRunner: "Protractor",
e2eTestFramework: "MochaChai",
cssPre: "Sass",
cssPost: "None",
cssLinter: "None",
documenter: "None",
linter: "ESLint",
packageManager: "Yarn",
taskManager: "Gulp",
server: "BrowserSync",
applicationFramework: "Vanilla",
ides: [],
uniteVersion: "0.0.0",
sourceExtensions: [],
viewExtensions: [],
styleExtension: "",
clientPackages: undefined,
dirs: undefined,
srcDistReplace: undefined,
srcDistReplaceWith: undefined,
buildConfigurations: undefined,
platforms: undefined
};
enginePeerPackages = await fileSystemStub.fileReadJson<{ [id: string ]: string}>(
fileSystemStub.pathCombine(__dirname, "../../../../node_modules/unitejs-packages/assets/"), "peerPackages.json");
});
afterEach(async () => {
sandbox.restore();
const obj = new FileSystemMock();
await obj.directoryDelete("./test/unit/temp");
});
describe("clientPackage add", () => {
it("can fail when calling with no unite.json", async () => {
uniteJson = undefined;
const obj = new ClientPackageCommand();
obj.create(loggerStub, fileSystemStub, fileSystemStub.pathCombine(__dirname, "../../../../"), "0.0.1", enginePeerPackages);
const res = await obj.run({
operation: undefined,
packageName: undefined,
version: undefined,
preload: undefined,
includeMode: undefined,
scriptIncludeMode: undefined,
main: undefined,
mainMinified: undefined,
mainLib: undefined,
testingAdditions: undefined,
isPackage: undefined,
assets: undefined,
map: undefined,
loaders: undefined,
noScript: undefined,
profile: undefined,
packageManager: undefined,
outputDirectory: undefined
});
Chai.expect(res).to.be.equal(1);
Chai.expect(loggerErrorSpy.args[0][0]).to.contain("no unite.json");
});
it("can fail when calling with undefined operation", async () => {
const obj = new ClientPackageCommand();
obj.create(loggerStub, fileSystemStub, fileSystemStub.pathCombine(__dirname, "../../../../"), "0.0.1", enginePeerPackages);
const res = await obj.run({
operation: undefined,
packageName: undefined,
version: undefined,
preload: undefined,
includeMode: undefined,
scriptIncludeMode: undefined,
main: undefined,
mainMinified: undefined,
mainLib: undefined,
testingAdditions: undefined,
isPackage: undefined,
assets: undefined,
map: undefined,
loaders: undefined,
noScript: undefined,
profile: undefined,
packageManager: undefined,
outputDirectory: undefined
});
Chai.expect(res).to.be.equal(1);
Chai.expect(loggerErrorSpy.args[0][0]).to.contain("operation");
});
it("can fail when calling with undefined packageName", async () => {
const obj = new ClientPackageCommand();
obj.create(loggerStub, fileSystemStub, fileSystemStub.pathCombine(__dirname, "../../../../"), "0.0.1", enginePeerPackages);
const res = await obj.run({
operation: "add",
packageName: undefined,
version: undefined,
preload: undefined,
includeMode: undefined,
scriptIncludeMode: undefined,
main: undefined,
mainMinified: undefined,
mainLib: undefined,
testingAdditions: undefined,
isPackage: undefined,
assets: undefined,
map: undefined,
loaders: undefined,
noScript: undefined,
profile: undefined,
packageManager: undefined,
outputDirectory: undefined
});
Chai.expect(res).to.be.equal(1);
Chai.expect(loggerErrorSpy.args[0][0]).to.contain("packageName");
});
it("can fail when calling with undefined packageManager", async () => {
uniteJson.packageManager = undefined;
const obj = new ClientPackageCommand();
obj.create(loggerStub, fileSystemStub, fileSystemStub.pathCombine(__dirname, "../../../../"), "0.0.1", enginePeerPackages);
const res = await obj.run({
operation: "add",
packageName: "package",
version: undefined,
preload: undefined,
includeMode: undefined,
scriptIncludeMode: undefined,
main: undefined,
mainMinified: undefined,
mainLib: undefined,
testingAdditions: undefined,
isPackage: undefined,
assets: undefined,
map: undefined,
loaders: undefined,
noScript: undefined,
profile: undefined,
packageManager: undefined,
outputDirectory: undefined
});
Chai.expect(res).to.be.equal(1);
Chai.expect(loggerErrorSpy.args[0][0]).to.contain("packageManager");
});
it("can fail if invalid includeMode", async () => {
uniteJson.clientPackages = { package: new UniteClientPackage() };
const obj = new ClientPackageCommand();
obj.create(loggerStub, fileSystemStub, fileSystemStub.pathCombine(__dirname, "../../../../"), "0.0.1", enginePeerPackages);
const res = await obj.run({
operation: "add",
packageName: "package",
version: undefined,
preload: undefined,
includeMode: <any>"foo",
scriptIncludeMode: undefined,
main: undefined,
mainMinified: undefined,
mainLib: undefined,
testingAdditions: undefined,
isPackage: undefined,
assets: undefined,
map: undefined,
loaders: undefined,
noScript: undefined,
profile: undefined,
packageManager: undefined,
outputDirectory: undefined
});
Chai.expect(res).to.be.equal(1);
Chai.expect(loggerErrorSpy.args[0][0]).to.contain("includeMode");
});
it("can fail if invalid scriptIncludeMode", async () => {
uniteJson.clientPackages = { package: new UniteClientPackage() };
const obj = new ClientPackageCommand();
obj.create(loggerStub, fileSystemStub, fileSystemStub.pathCombine(__dirname, "../../../../"), "0.0.1", enginePeerPackages);
const res = await obj.run({
operation: "add",
packageName: "package",
version: undefined,
preload: undefined,
includeMode: undefined,
scriptIncludeMode: <any>"foo",
main: undefined,
mainMinified: undefined,
mainLib: undefined,
testingAdditions: undefined,
isPackage: undefined,
assets: undefined,
map: undefined,
loaders: undefined,
noScript: undefined,
profile: undefined,
packageManager: undefined,
outputDirectory: undefined
});
Chai.expect(res).to.be.equal(1);
Chai.expect(loggerErrorSpy.args[0][0]).to.contain("scriptIncludeMode");
});
it("can fail if main and noScript", async () => {
uniteJson.clientPackages = { package: new UniteClientPackage() };
const obj = new ClientPackageCommand();
obj.create(loggerStub, fileSystemStub, fileSystemStub.pathCombine(__dirname, "../../../../"), "0.0.1", enginePeerPackages);
const res = await obj.run({
operation: "add",
packageName: "package",
version: undefined,
preload: undefined,
includeMode: undefined,
scriptIncludeMode: undefined,
main: "main.js",
mainMinified: undefined,
mainLib: undefined,
testingAdditions: undefined,
isPackage: undefined,
assets: undefined,
map: undefined,
loaders: undefined,
noScript: true,
profile: undefined,
packageManager: undefined,
outputDirectory: undefined
});
Chai.expect(res).to.be.equal(1);
Chai.expect(loggerErrorSpy.args[0][0]).to.contain("main and noScript");
});
it("can fail if mainMinified and noScript", async () => {
uniteJson.clientPackages = { package: new UniteClientPackage() };
const obj = new ClientPackageCommand();
obj.create(loggerStub, fileSystemStub, fileSystemStub.pathCombine(__dirname, "../../../../"), "0.0.1", enginePeerPackages);
const res = await obj.run({
operation: "add",
packageName: "package",
version: undefined,
preload: undefined,
includeMode: undefined,
scriptIncludeMode: undefined,
main: undefined,
mainMinified: "mainMinified.js",
mainLib: undefined,
testingAdditions: undefined,
isPackage: undefined,
assets: undefined,
map: undefined,
loaders: undefined,
noScript: true,
profile: undefined,
packageManager: undefined,
outputDirectory: undefined
});
Chai.expect(res).to.be.equal(1);
Chai.expect(loggerErrorSpy.args[0][0]).to.contain("mainMinified and noScript");
});
it("can fail if package already exists", async () => {
uniteJson.clientPackages = { package: new UniteClientPackage() };
const obj = new ClientPackageCommand();
obj.create(loggerStub, fileSystemStub, fileSystemStub.pathCombine(__dirname, "../../../../"), "0.0.1", enginePeerPackages);
const res = await obj.run({
operation: "add",
packageName: "package",
version: undefined,
preload: undefined,
includeMode: undefined,
scriptIncludeMode: undefined,
main: undefined,
mainMinified: undefined,
mainLib: undefined,
testingAdditions: undefined,
isPackage: undefined,
assets: undefined,
map: undefined,
loaders: undefined,
noScript: undefined,
profile: undefined,
packageManager: undefined,
outputDirectory: undefined
});
Chai.expect(res).to.be.equal(1);
Chai.expect(loggerErrorSpy.args[0][0]).to.contain("already");
});
it("can fail if packageManager gets info errors", async () => {
packageInfo = null;
const obj = new ClientPackageCommand();
obj.create(loggerStub, fileSystemStub, fileSystemStub.pathCombine(__dirname, "../../../../"), "0.0.1", enginePeerPackages);
const res = await obj.run({
operation: "add",
packageName: "package",
version: undefined,
preload: undefined,
includeMode: undefined,
scriptIncludeMode: undefined,
main: undefined,
mainMinified: undefined,
mainLib: undefined,
testingAdditions: undefined,
isPackage: undefined,
assets: undefined,
map: undefined,
loaders: undefined,
noScript: undefined,
profile: undefined,
packageManager: undefined,
outputDirectory: undefined
});
Chai.expect(res).to.be.equal(1);
Chai.expect(loggerErrorSpy.args[0][0]).to.contain("Package Information");
});
it("can fail if pipeline step fails", async () => {
packageInfo = "{ \"version\": \"1.2.3\", \"main\": \"index.js\"}";
fileWriteJsonErrors = true;
const obj = new ClientPackageCommand();
obj.create(loggerStub, fileSystemStub, fileSystemStub.pathCombine(__dirname, "../../../../"), "0.0.1", enginePeerPackages);
const res = await obj.run({
operation: "add",
packageName: "package",
version: undefined,
preload: undefined,
includeMode: undefined,
scriptIncludeMode: undefined,
main: undefined,
mainMinified: "mainMinified.js",
mainLib: undefined,
testingAdditions: undefined,
isPackage: undefined,
assets: undefined,
map: undefined,
loaders: undefined,
noScript: undefined,
profile: undefined,
packageManager: undefined,
outputDirectory: undefined
});
Chai.expect(res).to.be.equal(1);
Chai.expect(loggerErrorSpy.args[0][0]).to.contain("failed");
});
it("can fail with badly formed testAdditions", async () => {
packageInfo = "{ \"version\": \"1.2.3\", \"main\": \"index.js\"}";
const obj = new ClientPackageCommand();
obj.create(loggerStub, fileSystemStub, fileSystemStub.pathCombine(__dirname, "../../../../"), "0.0.1", enginePeerPackages);
const res = await obj.run({
operation: "add",
packageName: "package",
version: undefined,
preload: undefined,
includeMode: undefined,
scriptIncludeMode: undefined,
main: undefined,
mainMinified: undefined,
mainLib: undefined,
testingAdditions: ["sdfgsd"],
isPackage: undefined,
assets: undefined,
map: undefined,
loaders: undefined,
noScript: undefined,
profile: undefined,
packageManager: undefined,
outputDirectory: undefined
});
Chai.expect(res).to.be.equal(1);
Chai.expect(loggerErrorSpy.args[0][0]).to.contain("failure");
});
it("can fail when package add fails", async () => {
packageInfo = "{ \"version\": \"1.2.3\", \"main\": \"index.js\"}";
failPackageAdd = true;
const obj = new ClientPackageCommand();
obj.create(loggerStub, fileSystemStub, fileSystemStub.pathCombine(__dirname, "../../../../"), "0.0.1", enginePeerPackages);
const res = await obj.run({
operation: "add",
packageName: "package",
version: undefined,
preload: undefined,
includeMode: undefined,
scriptIncludeMode: undefined,
main: undefined,
mainMinified: undefined,
mainLib: undefined,
testingAdditions: undefined,
isPackage: undefined,
assets: undefined,
map: undefined,
loaders: undefined,
noScript: undefined,
profile: undefined,
packageManager: undefined,
outputDirectory: undefined
});
Chai.expect(res).to.be.equal(1);
Chai.expect(loggerErrorSpy.args[0][0]).to.contain("failed");
});
it("can succeed with just profile", async () => {
packageInfo = JSON.stringify({ version: "1.2.3" });
const obj = new ClientPackageCommand();
obj.create(loggerStub, fileSystemStub, fileSystemStub.pathCombine(__dirname, "../../../../"), "0.0.1", enginePeerPackages);
const res = await obj.run({
operation: "add",
packageName: undefined,
version: undefined,
preload: undefined,
includeMode: undefined,
scriptIncludeMode: undefined,
main: undefined,
mainMinified: undefined,
mainLib: undefined,
testingAdditions: undefined,
isPackage: undefined,
assets: undefined,
map: undefined,
loaders: undefined,
noScript: undefined,
profile: "bluebird",
packageManager: undefined,
outputDirectory: undefined
});
Chai.expect(res).to.be.equal(0);
Chai.expect(loggerBannerSpy.args[0][0]).to.contain("Success");
Chai.expect(uniteJsonWritten.clientPackages.bluebird.version).to.be.equal("^1.2.3");
Chai.expect(uniteJsonWritten.clientPackages.bluebird.main).to.be.equal("/js/browser/bluebird.js");
Chai.expect(uniteJsonWritten.clientPackages.bluebird.mainMinified).to.be.equal("/js/browser/bluebird.min.js");
Chai.expect(uniteJsonWritten.clientPackages.bluebird.scriptIncludeMode).to.be.equal("both");
});
it("can fail with unknown profile", async () => {
packageInfo = JSON.stringify({ version: "1.2.3" });
const obj = new ClientPackageCommand();
obj.create(loggerStub, fileSystemStub, fileSystemStub.pathCombine(__dirname, "../../../../"), "0.0.1", enginePeerPackages);
const res = await obj.run({
operation: "add",
packageName: undefined,
version: undefined,
preload: undefined,
includeMode: undefined,
scriptIncludeMode: undefined,
main: undefined,
mainMinified: undefined,
mainLib: undefined,
testingAdditions: undefined,
isPackage: undefined,
assets: undefined,
map: undefined,
loaders: undefined,
noScript: undefined,
profile: "blah",
packageManager: undefined,
outputDirectory: undefined
});
Chai.expect(res).to.be.equal(1);
Chai.expect(loggerErrorSpy.args[0][0]).to.contain("does not exist");
});
it("can succeed with no packageManager info", async () => {
packageInfo = "{}";
const obj = new ClientPackageCommand();
obj.create(loggerStub, fileSystemStub, fileSystemStub.pathCombine(__dirname, "../../../../"), "0.0.1", enginePeerPackages);
const res = await obj.run({
operation: "add",
packageName: "package",
version: undefined,
preload: undefined,
includeMode: undefined,
scriptIncludeMode: undefined,
main: undefined,
mainMinified: undefined,
mainLib: undefined,
testingAdditions: undefined,
isPackage: undefined,
assets: undefined,
map: undefined,
loaders: undefined,
noScript: undefined,
profile: undefined,
packageManager: undefined,
outputDirectory: undefined
});
Chai.expect(res).to.be.equal(0);
Chai.expect(loggerBannerSpy.args[0][0]).to.contain("Success");
Chai.expect(uniteJsonWritten.clientPackages.package.version).to.be.equal("^0.0.1");
Chai.expect(uniteJsonWritten.clientPackages.package.main).to.be.equal("*");
});
it("can succeed with noScript", async () => {
packageInfo = "{ \"version\": \"1.2.3\", \"main\": \"index.js\"}";
const obj = new ClientPackageCommand();
obj.create(loggerStub, fileSystemStub, fileSystemStub.pathCombine(__dirname, "../../../../"), "0.0.1", enginePeerPackages);
const res = await obj.run({
operation: "add",
packageName: "package",
version: undefined,
preload: undefined,
includeMode: "app",
scriptIncludeMode: undefined,
main: undefined,
mainMinified: undefined,
mainLib: undefined,
testingAdditions: undefined,
isPackage: undefined,
assets: undefined,
map: undefined,
loaders: undefined,
noScript: true,
profile: undefined,
packageManager: undefined,
outputDirectory: undefined
});
Chai.expect(res).to.be.equal(0);
Chai.expect(loggerBannerSpy.args[0][0]).to.contain("Success");
Chai.expect(uniteJsonWritten.clientPackages.package.version).to.be.equal("^1.2.3");
Chai.expect(uniteJsonWritten.clientPackages.package.main).to.be.equal(undefined);
Chai.expect(uniteJsonWritten.clientPackages.package.includeMode).to.be.equal("app");
});
it("can succeed with packageManager info", async () => {
packageInfo = "{ \"version\": \"1.2.3\", \"main\": \"index.js\"}";
const obj = new ClientPackageCommand();
obj.create(loggerStub, fileSystemStub, fileSystemStub.pathCombine(__dirname, "../../../../"), "0.0.1", enginePeerPackages);
const res = await obj.run({
operation: "add",
packageName: "package",
version: undefined,
preload: undefined,
includeMode: "app",
scriptIncludeMode: undefined,
main: undefined,
mainMinified: undefined,
mainLib: undefined,
testingAdditions: undefined,
isPackage: undefined,
assets: undefined,
map: undefined,
loaders: undefined,
noScript: undefined,
profile: undefined,
packageManager: undefined,
outputDirectory: undefined
});
Chai.expect(res).to.be.equal(0);
Chai.expect(loggerBannerSpy.args[0][0]).to.contain("Success");
Chai.expect(uniteJsonWritten.clientPackages.package.version).to.be.equal("^1.2.3");
Chai.expect(uniteJsonWritten.clientPackages.package.main).to.be.equal("index.js");
Chai.expect(uniteJsonWritten.clientPackages.package.includeMode).to.be.equal("app");
});
it("can succeed with override version packageManager info", async () => {
packageInfo = "{ \"version\": \"1.2.3\", \"main\": \"index.js\"}";
const obj = new ClientPackageCommand();
obj.create(loggerStub, fileSystemStub, fileSystemStub.pathCombine(__dirname, "../../../../"), "0.0.1", enginePeerPackages);
const res = await obj.run({
operation: "add",
packageName: "package",
version: "4.5.6",
preload: undefined,
includeMode: "app",
scriptIncludeMode: undefined,
main: undefined,
mainMinified: undefined,
mainLib: undefined,
testingAdditions: undefined,
isPackage: undefined,
assets: undefined,
map: undefined,
loaders: undefined,
noScript: undefined,
profile: undefined,
packageManager: undefined,
outputDirectory: undefined
});
Chai.expect(res).to.be.equal(0);
Chai.expect(loggerBannerSpy.args[0][0]).to.contain("Success");
Chai.expect(uniteJsonWritten.clientPackages.package.version).to.be.equal("4.5.6");
Chai.expect(uniteJsonWritten.clientPackages.package.main).to.be.equal("index.js");
Chai.expect(uniteJsonWritten.clientPackages.package.includeMode).to.be.equal("app");
});
it("can succeed with override main packageManager info", async () => {
packageInfo = "{ \"version\": \"1.2.3\", \"main\": \"index.js\"}";
const obj = new ClientPackageCommand();
obj.create(loggerStub, fileSystemStub, fileSystemStub.pathCombine(__dirname, "../../../../"), "0.0.1", enginePeerPackages);
const res = await obj.run({
operation: "add",
packageName: "package",
version: undefined,
preload: undefined,
includeMode: "test",
scriptIncludeMode: "none",
main: "main.js",
mainMinified: undefined,
mainLib: undefined,
testingAdditions: undefined,
isPackage: undefined,
assets: undefined,
map: undefined,
loaders: undefined,
noScript: undefined,
profile: undefined,
packageManager: undefined,
outputDirectory: undefined
});
Chai.expect(res).to.be.equal(0);
Chai.expect(loggerBannerSpy.args[0][0]).to.contain("Success");
Chai.expect(uniteJsonWritten.clientPackages.package.version).to.be.equal("^1.2.3");
Chai.expect(uniteJsonWritten.clientPackages.package.main).to.be.equal("main.js");
Chai.expect(uniteJsonWritten.clientPackages.package.includeMode).to.be.equal("test");
});
it("can succeed with override main and version packageManager info", async () => {
packageInfo = "{ \"version\": \"1.2.3\", \"main\": \"index.js\"}";
const obj = new ClientPackageCommand();
obj.create(loggerStub, fileSystemStub, fileSystemStub.pathCombine(__dirname, "../../../../"), "0.0.1", enginePeerPackages);
const res = await obj.run({
operation: "add",
packageName: "package",
version: "4.5.6",
preload: undefined,
includeMode: "test",
scriptIncludeMode: "none",
main: "main.js",
mainMinified: undefined,
mainLib: undefined,
testingAdditions: undefined,
isPackage: undefined,
assets: undefined,
map: undefined,
loaders: undefined,
noScript: undefined,
profile: undefined,
packageManager: undefined,
outputDirectory: undefined
});
Chai.expect(res).to.be.equal(0);
Chai.expect(loggerBannerSpy.args[0][0]).to.contain("Success");
Chai.expect(uniteJsonWritten.clientPackages.package.version).to.be.equal("4.5.6");
Chai.expect(uniteJsonWritten.clientPackages.package.main).to.be.equal("main.js");
Chai.expect(uniteJsonWritten.clientPackages.package.includeMode).to.be.equal("test");
});
it("can succeed with override mainMinified and version packageManager info", async () => {
packageInfo = "{ \"version\": \"1.2.3\", \"main\": \"index.js\"}";
const obj = new ClientPackageCommand();
obj.create(loggerStub, fileSystemStub, fileSystemStub.pathCombine(__dirname, "../../../../"), "0.0.1", enginePeerPackages);
const res = await obj.run({
operation: "add",
packageName: "package",
version: undefined,
preload: undefined,
includeMode: undefined,
scriptIncludeMode: undefined,
main: undefined,
mainMinified: "mainMinified.js",
mainLib: undefined,
testingAdditions: undefined,
isPackage: undefined,
assets: undefined,
map: undefined,
loaders: undefined,
noScript: undefined,
profile: undefined,
packageManager: undefined,
outputDirectory: undefined
});
Chai.expect(res).to.be.equal(0);
Chai.expect(loggerBannerSpy.args[0][0]).to.contain("Success");
Chai.expect(uniteJsonWritten.clientPackages.package.version).to.be.equal("^1.2.3");
Chai.expect(uniteJsonWritten.clientPackages.package.main).to.be.equal("index.js");
Chai.expect(uniteJsonWritten.clientPackages.package.mainMinified).to.be.equal("mainMinified.js");
});
it("can succeed with all parameters", async () => {
packageInfo = "{ \"version\": \"1.2.3\", \"main\": \"index.js\"}";
const obj = new ClientPackageCommand();
obj.create(loggerStub, fileSystemStub, fileSystemStub.pathCombine(__dirname, "../../../../"), "0.0.1", enginePeerPackages);
const res = await obj.run({
operation: "add",
packageName: "package",
version: "7.8.9",
preload: true,
includeMode: "both",
scriptIncludeMode: "none",
main: "1.js",
mainMinified: "2.js",
mainLib: ["a/**/*.js", "b/**/*.js"],
testingAdditions: ["my-pkg=blah", "my-pkg3=foo"],
isPackage: true,
assets: ["**/*.css", "**/*.otf"],
map: ["a=b", "c=d"],
loaders: ["text=*.html", "css=*.css"],
noScript: undefined,
profile: undefined,
packageManager: undefined,
outputDirectory: undefined
});
Chai.expect(res).to.be.equal(0);
Chai.expect(loggerBannerSpy.args[0][0]).to.contain("Success");
Chai.expect(uniteJsonWritten.clientPackages.package.version).to.be.equal("7.8.9");
Chai.expect(uniteJsonWritten.clientPackages.package.preload).to.be.equal(true);
Chai.expect(uniteJsonWritten.clientPackages.package.includeMode).to.be.equal("both");
Chai.expect(uniteJsonWritten.clientPackages.package.main).to.be.equal("1.js");
Chai.expect(uniteJsonWritten.clientPackages.package.mainMinified).to.be.equal("2.js");
Chai.expect(uniteJsonWritten.clientPackages.package.mainLib).to.be.deep.equal(["a/**/*.js", "b/**/*.js"]);
Chai.expect(uniteJsonWritten.clientPackages.package.scriptIncludeMode).to.be.equal("none");
Chai.expect(uniteJsonWritten.clientPackages.package.testingAdditions).to.be.deep.equal({ "my-pkg": "blah", "my-pkg3": "foo" });
Chai.expect(uniteJsonWritten.clientPackages.package.isPackage).to.be.equal(true);
Chai.expect(uniteJsonWritten.clientPackages.package.assets).to.be.deep.equal(["**/*.css", "**/*.otf"]);
Chai.expect(uniteJsonWritten.clientPackages.package.map).to.be.deep.equal({ a: "b", c: "d" });
Chai.expect(uniteJsonWritten.clientPackages.package.loaders).to.be.deep.equal({ text: "*.html", css: "*.css" });
});
it("can succeed with all existing profile parameters", async () => {
packageInfo = "{ \"version\": \"1.2.3\", \"main\": \"index.js\"}";
profiles = {};
profiles.testProfile = {
name: "package",
version: "7.8.9",
preload: true,
includeMode: "both",
scriptIncludeMode: "none",
main: "1.js",
mainMinified: "2.js",
mainLib: ["a/**/*.js", "b/**/*.js"],
testingAdditions: {"my-pkg": "blah", "my-pkg3": "foo"},
isPackage: true,
assets: ["**/*.css", "**/*.otf"],
map: {a: "b", c: "d"},
loaders: {text: "*.html", css: "*.css"},
noScript: undefined
};
const obj = new ClientPackageCommand();
obj.create(loggerStub, fileSystemStub, fileSystemStub.pathCombine(__dirname, "../../../../"), "0.0.1", enginePeerPackages);
const res = await obj.run({
operation: "add",
packageName: undefined,
version: undefined,
preload: undefined,
includeMode: undefined,
scriptIncludeMode: undefined,
main: undefined,
mainMinified: undefined,
mainLib: undefined,
testingAdditions: undefined,
isPackage: undefined,
assets: undefined,
map: undefined,
loaders: undefined,
noScript: undefined,
packageManager: undefined,
profile: "testProfile",
outputDirectory: undefined
});
Chai.expect(res).to.be.equal(0);
Chai.expect(loggerBannerSpy.args[0][0]).to.contain("Success");
Chai.expect(uniteJsonWritten.clientPackages.package.version).to.be.equal("7.8.9");
Chai.expect(uniteJsonWritten.clientPackages.package.preload).to.be.equal(true);
Chai.expect(uniteJsonWritten.clientPackages.package.includeMode).to.be.equal("both");
Chai.expect(uniteJsonWritten.clientPackages.package.main).to.be.equal("1.js");
Chai.expect(uniteJsonWritten.clientPackages.package.mainMinified).to.be.equal("2.js");
Chai.expect(uniteJsonWritten.clientPackages.package.mainLib).to.be.deep.equal(["a/**/*.js", "b/**/*.js"]);
Chai.expect(uniteJsonWritten.clientPackages.package.scriptIncludeMode).to.be.equal("none");
Chai.expect(uniteJsonWritten.clientPackages.package.testingAdditions).to.be.deep.equal({ "my-pkg": "blah", "my-pkg3": "foo" });
Chai.expect(uniteJsonWritten.clientPackages.package.isPackage).to.be.equal(true);
Chai.expect(uniteJsonWritten.clientPackages.package.assets).to.be.deep.equal(["**/*.css", "**/*.otf"]);
Chai.expect(uniteJsonWritten.clientPackages.package.map).to.be.deep.equal({ a: "b", c: "d" });
Chai.expect(uniteJsonWritten.clientPackages.package.loaders).to.be.deep.equal({ text: "*.html", css: "*.css" });
});
it("can succeed with all existing profile parameters empty transpile options", async () => {
packageInfo = "{ \"version\": \"1.2.3\", \"main\": \"index.js\"}";
profiles = {};
profiles.testProfile = {
name: "package",
version: "7.8.9",
preload: true,
includeMode: "both",
scriptIncludeMode: "none",
main: "1.js",
mainMinified: "2.js",
mainLib: ["a/**/*.js", "b/**/*.js"],
testingAdditions: {"my-pkg": "blah", "my-pkg3": "foo"},
isPackage: true,
assets: ["**/*.css", "**/*.otf"],
map: {a: "b", c: "d"},
loaders: {text: "*.html", css: "*.css"},
noScript: undefined
};
const obj = new ClientPackageCommand();
obj.create(loggerStub, fileSystemStub, fileSystemStub.pathCombine(__dirname, "../../../../"), "0.0.1", enginePeerPackages);
const res = await obj.run({
operation: "add",
packageName: undefined,
version: undefined,
preload: undefined,
includeMode: undefined,
scriptIncludeMode: undefined,
main: undefined,
mainMinified: undefined,
mainLib: undefined,
testingAdditions: undefined,
isPackage: undefined,
assets: undefined,
map: undefined,
loaders: undefined,
noScript: undefined,
packageManager: undefined,
profile: "testProfile",
outputDirectory: undefined
});
Chai.expect(res).to.be.equal(0);
Chai.expect(loggerBannerSpy.args[0][0]).to.contain("Success");
Chai.expect(uniteJsonWritten.clientPackages.package.version).to.be.equal("7.8.9");
Chai.expect(uniteJsonWritten.clientPackages.package.preload).to.be.equal(true);
Chai.expect(uniteJsonWritten.clientPackages.package.includeMode).to.be.equal("both");
Chai.expect(uniteJsonWritten.clientPackages.package.main).to.be.equal("1.js");
Chai.expect(uniteJsonWritten.clientPackages.package.mainMinified).to.be.equal("2.js");
Chai.expect(uniteJsonWritten.clientPackages.package.mainLib).to.be.deep.equal(["a/**/*.js", "b/**/*.js"]);
Chai.expect(uniteJsonWritten.clientPackages.package.scriptIncludeMode).to.be.equal("none");
Chai.expect(uniteJsonWritten.clientPackages.package.testingAdditions).to.be.deep.equal({ "my-pkg": "blah", "my-pkg3": "foo" });
Chai.expect(uniteJsonWritten.clientPackages.package.isPackage).to.be.equal(true);
Chai.expect(uniteJsonWritten.clientPackages.package.assets).to.be.deep.equal(["**/*.css", "**/*.otf"]);
Chai.expect(uniteJsonWritten.clientPackages.package.map).to.be.deep.equal({ a: "b", c: "d" });
Chai.expect(uniteJsonWritten.clientPackages.package.loaders).to.be.deep.equal({ text: "*.html", css: "*.css" });
});
});
describe("clientPackage remove", () => {
it("can fail when calling with no unite.json", async () => {
uniteJson = undefined;
const obj = new ClientPackageCommand();
obj.create(loggerStub, fileSystemStub, fileSystemStub.pathCombine(__dirname, "../../../../"), "0.0.1", enginePeerPackages);
const res = await obj.run({
operation: undefined,
packageName: undefined,
version: undefined,
preload: undefined,
includeMode: undefined,
scriptIncludeMode: undefined,
main: undefined,
mainMinified: undefined,
mainLib: undefined,
testingAdditions: undefined,
isPackage: undefined,
assets: undefined,
map: undefined,
loaders: undefined,
noScript: undefined,
profile: undefined,
packageManager: undefined,
outputDirectory: undefined
});
Chai.expect(res).to.be.equal(1);
Chai.expect(loggerErrorSpy.args[0][0]).to.contain("no unite.json");
});
it("can fail when calling with undefined operation", async () => {
const obj = new ClientPackageCommand();
obj.create(loggerStub, fileSystemStub, fileSystemStub.pathCombine(__dirname, "../../../../"), "0.0.1", enginePeerPackages);
const res = await obj.run({
operation: undefined,
packageName: undefined,
version: undefined,
preload: undefined,
includeMode: undefined,
scriptIncludeMode: undefined,
main: undefined,
mainMinified: undefined,
mainLib: undefined,
testingAdditions: undefined,
isPackage: undefined,
assets: undefined,
map: undefined,
loaders: undefined,
noScript: undefined,
profile: undefined,
packageManager: undefined,
outputDirectory: undefined
});
Chai.expect(res).to.be.equal(1);
Chai.expect(loggerErrorSpy.args[0][0]).to.contain("operation");
});
it("can fail when calling with undefined packageName", async () => {
const obj = new ClientPackageCommand();
obj.create(loggerStub, fileSystemStub, fileSystemStub.pathCombine(__dirname, "../../../../"), "0.0.1", enginePeerPackages);
const res = await obj.run({
operation: "remove",
packageName: undefined,
version: undefined,
preload: undefined,
includeMode: undefined,
scriptIncludeMode: undefined,
main: undefined,
mainMinified: undefined,
mainLib: undefined,
testingAdditions: undefined,
isPackage: undefined,
assets: undefined,
map: undefined,
loaders: undefined,
noScript: undefined,
profile: undefined,
packageManager: undefined,
outputDirectory: undefined
});
Chai.expect(res).to.be.equal(1);
Chai.expect(loggerErrorSpy.args[0][0]).to.contain("packageName");
});
it("can fail when calling with undefined packageManager", async () => {
uniteJson.packageManager = undefined;
const obj = new ClientPackageCommand();
obj.create(loggerStub, fileSystemStub, fileSystemStub.pathCombine(__dirname, "../../../../"), "0.0.1", enginePeerPackages);
const res = await obj.run({
operation: "remove",
packageName: "package",
version: undefined,
preload: undefined,
includeMode: undefined,
scriptIncludeMode: undefined,
main: undefined,
mainMinified: undefined,
mainLib: undefined,
testingAdditions: undefined,
isPackage: undefined,
assets: undefined,
map: undefined,
loaders: undefined,
noScript: undefined,
profile: undefined,
packageManager: undefined,
outputDirectory: undefined
});
Chai.expect(res).to.be.equal(1);
Chai.expect(loggerErrorSpy.args[0][0]).to.contain("packageManager");
});
it("can fail if package does not exist", async () => {
const obj = new ClientPackageCommand();
obj.create(loggerStub, fileSystemStub, fileSystemStub.pathCombine(__dirname, "../../../../"), "0.0.1", enginePeerPackages);
const res = await obj.run({
operation: "remove",
packageName: "package",
version: undefined,
preload: undefined,
includeMode: undefined,
scriptIncludeMode: undefined,
main: undefined,
mainMinified: undefined,
mainLib: undefined,
testingAdditions: undefined,
isPackage: undefined,
assets: undefined,
map: undefined,
loaders: undefined,
noScript: undefined,
profile: undefined,
packageManager: undefined,
outputDirectory: undefined
});
Chai.expect(res).to.be.equal(1);
Chai.expect(loggerErrorSpy.args[0][0]).to.contain("not been");
});
it("can fail if pipeline step fails", async () => {
fileWriteJsonErrors = true;
uniteJson.clientPackages = { package: new UniteClientPackage() };
const obj = new ClientPackageCommand();
obj.create(loggerStub, fileSystemStub, fileSystemStub.pathCombine(__dirname, "../../../../"), "0.0.1", enginePeerPackages);
const res = await obj.run({
operation: "remove",
packageName: "package",
version: undefined,
preload: undefined,
includeMode: undefined,
scriptIncludeMode: undefined,
main: undefined,
mainMinified: undefined,
mainLib: undefined,
testingAdditions: undefined,
isPackage: undefined,
assets: undefined,
map: undefined,
loaders: undefined,
noScript: undefined,
profile: undefined,
packageManager: undefined,
outputDirectory: undefined
});
Chai.expect(res).to.be.equal(1);
Chai.expect(loggerErrorSpy.args[0][0]).to.contain("failed");
});
it("can succeed if all ok", async () => {
uniteJson.clientPackages = { package: new UniteClientPackage() };
const obj = new ClientPackageCommand();
obj.create(loggerStub, fileSystemStub, fileSystemStub.pathCombine(__dirname, "../../../../"), "0.0.1", enginePeerPackages);
const res = await obj.run({
operation: "remove",
packageName: "package",
version: undefined,
preload: undefined,
includeMode: undefined,
scriptIncludeMode: undefined,
main: undefined,
mainMinified: undefined,
mainLib: undefined,
testingAdditions: undefined,
isPackage: undefined,
assets: undefined,
map: undefined,
loaders: undefined,
noScript: undefined,
profile: undefined,
packageManager: undefined,
outputDirectory: undefined
});
Chai.expect(res).to.be.equal(0);
Chai.expect(loggerBannerSpy.args[0][0]).to.contain("Success");
});
});
});
|
{
"content_hash": "f9620cec443ae207abbe0e72d01601af",
"timestamp": "",
"source": "github",
"line_count": 1136,
"max_line_length": 143,
"avg_line_length": 45.49823943661972,
"alnum_prop": 0.5305111635646016,
"repo_name": "unitejs/core",
"id": "2e0422bb4237e91cfb13a4c9bbec9455c933258c",
"size": "51686",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "test/unit/src/commands/clientPackageCommand.spec.ts",
"mode": "33188",
"license": "mit",
"language": [],
"symlink_target": ""
}
|
<div class="commune_descr limited">
<p>
La Londe est
une ville localisée dans le département de Seine-Maritime en Haute-Normandie. Elle totalisait 2 195 habitants en 2008.</p>
<p>À La Londe le salaire médian par mois par habitant est situé à environ 2 451 € net. Ceci est supérieur à la moyenne du pays.</p>
<p>La commune compte quelques équipements sportifs, elle propose entre autres un centre d'équitation et un terrain de sport.</p>
<p>Le parc d'habitations, à La Londe, était réparti en 2011 en 39 appartements et 904 maisons soit
un marché relativement équilibré.</p>
<p>À La Londe, le prix moyen à l'achat d'un appartement s'évalue à 2 192 € du m² en vente. La valeur moyenne d'une maison à l'achat se situe à 1 862 € du m². À la location la valorisation moyenne se situe à 7,82 € du m² mensuel.</p>
<p>À coté de La Londe sont localisées les villes de
<a href="{{VLROOT}}/immobilier/saint-ouen-du-tilleul_27582/">Saint-Ouen-du-Tilleul</a> à 1 km, 1 542 habitants,
<a href="{{VLROOT}}/immobilier/elbeuf_76231/">Elbeuf</a> située à 4 km, 17 277 habitants,
<a href="{{VLROOT}}/immobilier/moulineaux_76457/">Moulineaux</a> localisée à 3 km, 881 habitants,
<a href="{{VLROOT}}/immobilier/thuit-signol_27638/">Le Thuit-Signol</a> située à 4 km, 2 046 habitants,
<a href="{{VLROOT}}/immobilier/bosnormand_27093/">Bosnormand</a> située à 4 km, 312 habitants,
<a href="{{VLROOT}}/immobilier/bourgtheroulde-infreville_27105/">Bourgtheroulde-Infreville</a> située à 5 km, 2 926 habitants,
entre autres. De plus, La Londe est située à seulement 18 km de <a href="{{VLROOT}}/immobilier/rouen_76540/">Rouen</a>.</p>
</div>
|
{
"content_hash": "630e7fad1512cab3475c016beaa4c2c9",
"timestamp": "",
"source": "github",
"line_count": 18,
"max_line_length": 262,
"avg_line_length": 97.66666666666667,
"alnum_prop": 0.7406143344709898,
"repo_name": "donaldinou/frontend",
"id": "b7bf962b1b5cbaaaafa265db93f4967f409a6331",
"size": "1801",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/Viteloge/CoreBundle/Resources/descriptions/76391.html",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "ApacheConf",
"bytes": "3073"
},
{
"name": "CSS",
"bytes": "111338"
},
{
"name": "HTML",
"bytes": "58634405"
},
{
"name": "JavaScript",
"bytes": "88564"
},
{
"name": "PHP",
"bytes": "841919"
}
],
"symlink_target": ""
}
|
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>org.camunda.bpm.quickstart</groupId>
<artifactId>camunda-quickstart-create-invoice-process</artifactId>
<packaging>war</packaging>
<name>Create Invoice Process</name>
<version>1.0-SNAPSHOT</version>
<properties>
<camunda.version>7.16.0</camunda.version>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<failOnMissingWebXml>false</failOnMissingWebXml>
</properties>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.camunda.bpm</groupId>
<artifactId>camunda-bom</artifactId>
<version>${camunda.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
<dependencies>
<dependency>
<groupId>org.camunda.bpm</groupId>
<artifactId>camunda-engine</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.camunda.bpm.model</groupId>
<artifactId>camunda-bpmn-model</artifactId>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
<version>3.0.1</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.12</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.h2database</groupId>
<artifactId>h2</artifactId>
<version>1.4.190</version>
<scope>test</scope>
</dependency>
<!-- redirect slf4j logging to jdk logging -->
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-jdk14</artifactId>
<version>1.7.26</version>
</dependency>
</dependencies>
</project>
|
{
"content_hash": "b41e35e92e8854b9be8fea98b4317ad9",
"timestamp": "",
"source": "github",
"line_count": 73,
"max_line_length": 204,
"avg_line_length": 29.28767123287671,
"alnum_prop": 0.6655753040224509,
"repo_name": "ingorichtsmeier/camunda-bpm-examples",
"id": "40f5a33f626677bbdf52c4e012fa4f4aa76e2665",
"size": "2138",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "bpmn-model-api/generate-process-fluent-api/pom.xml",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "2383"
},
{
"name": "FreeMarker",
"bytes": "355"
},
{
"name": "Groovy",
"bytes": "276"
},
{
"name": "HTML",
"bytes": "40079"
},
{
"name": "Java",
"bytes": "434911"
},
{
"name": "JavaScript",
"bytes": "1374527"
},
{
"name": "XQuery",
"bytes": "452"
},
{
"name": "XSLT",
"bytes": "739"
}
],
"symlink_target": ""
}
|
<!DOCTYPE html>
<html>
<head>
<meta charset=UTF-8>
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Angular2 Seed</title>
<base href="/">
<!-- Latest compiled and minified CSS -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
</head>
<body>
<app>
Loading...
</app>
<script async src="/main.bundle.js"></script>
</body>
</html>
|
{
"content_hash": "c6d05b535d2e9f7950549fa8c5239fdc",
"timestamp": "",
"source": "github",
"line_count": 20,
"max_line_length": 212,
"avg_line_length": 28.5,
"alnum_prop": 0.6649122807017543,
"repo_name": "KevinBurton/Angular2-Forms",
"id": "c3118a771d54dc6bdc2e5f54234caa22c8aa4f55",
"size": "570",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "src/index.html",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "240"
},
{
"name": "HTML",
"bytes": "7210"
},
{
"name": "JavaScript",
"bytes": "3246"
},
{
"name": "TypeScript",
"bytes": "12343"
}
],
"symlink_target": ""
}
|
module SpacepeopleHelper
end
|
{
"content_hash": "d32e548c9da45467beb0c20be635ea39",
"timestamp": "",
"source": "github",
"line_count": 2,
"max_line_length": 24,
"avg_line_length": 14.5,
"alnum_prop": 0.896551724137931,
"repo_name": "Groovitation/issflyby",
"id": "775e6699100dcd1edc22038f694517ff67b8078e",
"size": "29",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "app/helpers/spacepeople_helper.rb",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "23213"
},
{
"name": "CoffeeScript",
"bytes": "211"
},
{
"name": "Gherkin",
"bytes": "1459"
},
{
"name": "HTML",
"bytes": "36402"
},
{
"name": "JavaScript",
"bytes": "984"
},
{
"name": "Ruby",
"bytes": "89743"
}
],
"symlink_target": ""
}
|
#ifndef _LJ_LEX_H
#define _LJ_LEX_H
#include <stdarg.h>
#include "lj_obj.h"
#include "lj_err.h"
/* Lua lexer tokens. */
#define TKDEF(_, __) \
_(and) _(break) _(do) _(else) _(elseif) _(end) _(false) \
_(for) _(function) _(goto) _(if) _(in) _(local) _(nil) _(not) _(or) \
_(repeat) _(return) _(then) _(true) _(until) _(while) \
__(concat, ..) __(dots, ...) __(eq, ==) __(ge, >=) __(le, <=) __(ne, ~=) \
__(label, ::) __(number, <number>) __(name, <name>) __(string, <string>) \
__(eof, <eof>)
enum {
TK_OFS = 256,
#define TKENUM1(name) TK_##name,
#define TKENUM2(name, sym) TK_##name,
TKDEF(TKENUM1, TKENUM2)
#undef TKENUM1
#undef TKENUM2
TK_RESERVED = TK_while - TK_OFS
};
typedef int LexToken;
/* Combined bytecode ins/line. Only used during bytecode generation. */
typedef struct BCInsLine {
BCIns ins; /* Bytecode instruction. */
BCLine line; /* Line number for this bytecode. */
} BCInsLine;
/* Info for local variables. Only used during bytecode generation. */
typedef struct VarInfo {
GCRef name; /* Local variable name or goto/label name. */
BCPos startpc; /* First point where the local variable is active. */
BCPos endpc; /* First point where the local variable is dead. */
uint8_t slot; /* Variable slot. */
uint8_t info; /* Variable/goto/label info. */
} VarInfo;
/* Lua lexer state. */
typedef struct LexState {
struct FuncState *fs; /* Current FuncState. Defined in lj_parse.c. */
struct lua_State *L; /* Lua state. */
TValue tokenval; /* Current token value. */
TValue lookaheadval; /* Lookahead token value. */
int current; /* Current character (charint). */
LexToken token; /* Current token. */
LexToken lookahead; /* Lookahead token. */
MSize n; /* Bytes left in input buffer. */
const char *p; /* Current position in input buffer. */
SBuf sb; /* String buffer for tokens. */
lua_Reader rfunc; /* Reader callback. */
void *rdata; /* Reader callback data. */
BCLine linenumber; /* Input line counter. */
BCLine lastline; /* Line of last token. */
GCstr *chunkname; /* Current chunk name (interned string). */
const char *chunkarg; /* Chunk name argument. */
const char *mode; /* Allow loading bytecode (b) and/or source text (t). */
VarInfo *vstack; /* Stack for names and extents of local variables. */
MSize sizevstack; /* Size of variable stack. */
MSize vtop; /* Top of variable stack. */
BCInsLine *bcstack; /* Stack for bytecode instructions/line numbers. */
MSize sizebcstack; /* Size of bytecode stack. */
uint32_t level; /* Syntactical nesting level. */
} LexState;
LJ_FUNC int lj_lex_setup(lua_State *L, LexState *ls);
LJ_FUNC void lj_lex_cleanup(lua_State *L, LexState *ls);
LJ_FUNC void lj_lex_next(LexState *ls);
LJ_FUNC LexToken lj_lex_lookahead(LexState *ls);
LJ_FUNC const char *lj_lex_token2str(LexState *ls, LexToken token);
LJ_FUNC_NORET void lj_lex_error(LexState *ls, LexToken token, ErrMsg em, ...);
LJ_FUNC void lj_lex_init(lua_State *L);
#endif
|
{
"content_hash": "4c3a2f7e56eafcbcb062f280baeb428f",
"timestamp": "",
"source": "github",
"line_count": 82,
"max_line_length": 78,
"avg_line_length": 36.41463414634146,
"alnum_prop": 0.6490288010716678,
"repo_name": "dansen/luacode",
"id": "4358ecfb62b65f4a6fbf2f48fa5324384fee9f33",
"size": "3085",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "src/lua/luajit/LuaJIT-2.0.1/src/lj_lex.h",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Assembly",
"bytes": "140685"
},
{
"name": "Batchfile",
"bytes": "8174"
},
{
"name": "C",
"bytes": "8871532"
},
{
"name": "C++",
"bytes": "20566581"
},
{
"name": "CSS",
"bytes": "8680"
},
{
"name": "DIGITAL Command Language",
"bytes": "4055"
},
{
"name": "HTML",
"bytes": "306015"
},
{
"name": "Inno Setup",
"bytes": "3873"
},
{
"name": "Lua",
"bytes": "641804"
},
{
"name": "M4",
"bytes": "4397"
},
{
"name": "Makefile",
"bytes": "74408"
},
{
"name": "Module Management System",
"bytes": "38773"
},
{
"name": "NSIS",
"bytes": "5541"
},
{
"name": "Objective-C",
"bytes": "30688"
},
{
"name": "PHP",
"bytes": "36038"
},
{
"name": "Python",
"bytes": "14696"
},
{
"name": "Rich Text Format",
"bytes": "44050"
},
{
"name": "Roff",
"bytes": "216724"
},
{
"name": "Shell",
"bytes": "155800"
},
{
"name": "Slash",
"bytes": "27675"
}
],
"symlink_target": ""
}
|
/* Auto-generated config file hpl_oscctrl_config.h */
#ifndef HPL_OSCCTRL_CONFIG_H
#define HPL_OSCCTRL_CONFIG_H
// <<< Use Configuration Wizard in Context Menu >>>
// <e> External Multipurpose Crystal Oscillator Configuration
// <i> Indicates whether configuration for XOSC is enabled or not
// <id> enable_xosc
#ifndef CONF_XOSC_CONFIG
#define CONF_XOSC_CONFIG 0
#endif
// <o> Frequency <400000-32000000>
// <i> Oscillation frequency of the resonator connected to the External Multipurpose Crystal Oscillator.
// <id> xosc_frequency
#ifndef CONF_XOSC_FREQUENCY
#define CONF_XOSC_FREQUENCY 400000
#endif
// <h> External Multipurpose Crystal Oscillator Control
// <q> Oscillator enable
// <i> Indicates whether External Multipurpose Crystal Oscillator is enabled or not
// <id> xosc_arch_enable
#ifndef CONF_XOSC_ENABLE
#define CONF_XOSC_ENABLE 0
#endif
// <o> Start-Up Time
// <0x0=>31us
// <0x1=>61us
// <0x2=>122us
// <0x3=>244us
// <0x4=>488us
// <0x5=>977us
// <0x6=>1953us
// <0x7=>3906us
// <0x8=>7813us
// <0x9=>15625us
// <0xA=>31250us
// <0xB=>62500us
// <0xC=>125000us
// <0xD=>250000us
// <0xE=>500000us
// <0xF=>1000000us
// <id> xosc_arch_startup
#ifndef CONF_XOSC_STARTUP
#define CONF_XOSC_STARTUP 0x0
#endif
// <q> Automatic Amplitude Gain Control
// <i> Indicates whether Automatic Amplitude Gain Control is enabled or not
// <id> xosc_arch_ampgc
#ifndef CONF_XOSC_AMPGC
#define CONF_XOSC_AMPGC 0
#endif
// <o> Oscillator Gain
// <i> The listed maximum frequencies are recommendations
// <0x0=>2MHz
// <0x1=>4MHz
// <0x2=>8MHz
// <0x3=>16MHz
// <0x4=>30MHz
// <id> xosc_arch_gain
#ifndef CONF_XOSC_GAIN
#define CONF_XOSC_GAIN 0x0
#endif
// <q> On Demand Control
// <i> Indicates whether On Demand Control is enabled or not
// <id> xosc_arch_ondemand
#ifndef CONF_XOSC_ONDEMAND
#define CONF_XOSC_ONDEMAND 1
#endif
// <q> Run in Standby
// <i> Indicates whether Run in Standby is enabled or not
// <id> xosc_arch_runstdby
#ifndef CONF_XOSC_RUNSTDBY
#define CONF_XOSC_RUNSTDBY 0
#endif
// <q> Clock Switch Back
// <i> Indicates whether Clock Switch Back is enabled or not
// <id> xosc_arch_swben
#ifndef CONF_XOSC_SWBEN
#define CONF_XOSC_SWBEN 0
#endif
// <q> Clock Failure Detector
// <i> Indicates whether Clock Failure Detector is enabled or not
// <id> xosc_arch_cfden
#ifndef CONF_XOSC_CFDEN
#define CONF_XOSC_CFDEN 0
#endif
// <q> Clock Failure Detector Event Out
// <i> Indicates whether Clock Failure Detector Event Out is enabled or not
// <id> xosc_arch_cfdeo
#ifndef CONF_XOSC_CFDEO
#define CONF_XOSC_CFDEO 0
#endif
// <q> Crystal connected to XIN/XOUT Enable
// <i> Indicates whether the connections between the I/O pads and the external clock or crystal oscillator is enabled or not
// <id> xosc_arch_xtalen
#ifndef CONF_XOSC_XTALEN
#define CONF_XOSC_XTALEN 0
#endif
//</h>
//</e>
// <e> 16MHz Internal Oscillator Configuration
// <i> Indicates whether configuration for OSC8M is enabled or not
// <id> enable_osc16m
#ifndef CONF_OSC16M_CONFIG
#define CONF_OSC16M_CONFIG 1
#endif
// <h> 16MHz Internal Oscillator Control
// <q> Enable
// <i> Indicates whether 16MHz Internal Oscillator is enabled or not
// <id> osc16m_arch_enable
#ifndef CONF_OSC16M_ENABLE
#define CONF_OSC16M_ENABLE 1
#endif
// <q> On Demand Control
// <i> Indicates whether On Demand Control is enabled or not
// <id> osc16m_arch_ondemand
#ifndef CONF_OSC16M_ONDEMAND
#define CONF_OSC16M_ONDEMAND 1
#endif
// <q> Run in Standby
// <i> Indicates whether Run in Standby is enabled or not
// <id> osc16m_arch_runstdby
#ifndef CONF_OSC16M_RUNSTDBY
#define CONF_OSC16M_RUNSTDBY 0
#endif
// <y> Oscillator Frequency Selection(Mhz)
// <OSCCTRL_OSC16MCTRL_FSEL_4_Val"> 4
// <OSCCTRL_OSC16MCTRL_FSEL_8_Val"> 8
// <OSCCTRL_OSC16MCTRL_FSEL_12_Val"> 12
// <OSCCTRL_OSC16MCTRL_FSEL_16_Val"> 16
// <i> This defines the oscillator frequency (Mhz)
// <id> osc16m_freq
#ifndef CONF_OSC16M_FSEL
#define CONF_OSC16M_FSEL OSCCTRL_OSC16MCTRL_FSEL_4_Val
#endif
//</h>
//</e>
// <e> DFLL Configuration
// <i> Indicates whether configuration for DFLL is enabled or not
// <id> enable_dfllulp
#ifndef CONF_DFLL_CONFIG
#define CONF_DFLL_CONFIG 0
#endif
// <y> Reference Clock Source
// <GCLK_PCHCTRL_GEN_GCLK0_Val"> Generic clock generator 0
// <GCLK_PCHCTRL_GEN_GCLK1_Val"> Generic clock generator 1
// <GCLK_PCHCTRL_GEN_GCLK2_Val"> Generic clock generator 2
// <GCLK_PCHCTRL_GEN_GCLK3_Val"> Generic clock generator 3
// <GCLK_PCHCTRL_GEN_GCLK4_Val"> Generic clock generator 4
// <i> Select the clock source.
// <id> dfllulp_ref_clock
#ifndef CONF_DFLL_GCLK
#define CONF_DFLL_GCLK GCLK_PCHCTRL_GEN_GCLK3_Val
#endif
// <h> Digital Frequency Locked Loop Control
// <q> DFLL Enable
// <i> Indicates whether DFLL is enabled or not
// <id> dfllulp_arch_enable
#ifndef CONF_DFLL_ENABLE
#define CONF_DFLL_ENABLE 0
#endif
// <q> On Demand Control
// <i> Indicates whether On Demand Control is enabled or not
// <id> dfllulp_arch_ondemand
#ifndef CONF_DFLL_ONDEMAND
#define CONF_DFLL_ONDEMAND 1
#endif
// <q> Run in Standby
// <i> Indicates whether Run in Standby is enabled or not
// <id> dfllulp_arch_runstdby
#ifndef CONF_DFLL_RUNSTDBY
#define CONF_DFLL_RUNSTDBY 0
#endif
// <q> Tuner Dither Mode
// <i> Indicates whether dither mode is enabled or not
// <id> dfllulp_arch_dither
#ifndef CONF_DFLL_DITHER
#define CONF_DFLL_DITHER 0
#endif
// <q> Tuner Safe Mode
// <i> Indicates whether tuner safe mode is enabled or not
// <id> dfllulp_arch_safe
#ifndef CONF_DFLL_SAFE
#define CONF_DFLL_SAFE 0
#endif
// <q> Binary Search Enable
// <i> Indicates whether binary search tuning is enabled or not
// <id> dfllulp_arch_binse
#ifndef CONF_DFLL_BINSE
#define CONF_DFLL_BINSE 0
#endif
// <y> Dither Period
// <OSCCTRL_DFLLULPDITHER_PER_PER1_Val"> Dither over 1 reference clock period
// <OSCCTRL_DFLLULPDITHER_PER_PER2_Val"> Dither over 2 reference clock period
// <OSCCTRL_DFLLULPDITHER_PER_PER4_Val"> Dither over 4 reference clock period
// <OSCCTRL_DFLLULPDITHER_PER_PER8_Val"> Dither over 8 reference clock period
// <OSCCTRL_DFLLULPDITHER_PER_PER16_Val"> Dither over 16 reference clock period
// <OSCCTRL_DFLLULPDITHER_PER_PER32_Val"> Dither over 32 reference clock period
// <i> Define the number of reference clock periods over which dithering is applied.
// <id> dfllulp_arch_dither_per
#ifndef CONF_DFLL_DITHER_PER
#define CONF_DFLL_DITHER_PER OSCCTRL_DFLLULPDITHER_PER_PER1_Val
#endif
// <y> Dither Step
// <OSCCTRL_DFLLULPDITHER_STEP_STEP1"> Dither step is 1
// <OSCCTRL_DFLLULPDITHER_STEP_STEP2"> Dither step is 2
// <OSCCTRL_DFLLULPDITHER_STEP_STEP4"> Dither step is 4
// <OSCCTRL_DFLLULPDITHER_STEP_STEP8"> Dither step is 8
// <i> Define the dithering step size.
// <id> dfllulp_arch_dither_step
#ifndef CONF_DFLL_DITHER_STEP
#define CONF_DFLL_DITHER_STEP OSCCTRL_DFLLULPDITHER_STEP_STEP1
#endif
// <o> Delay Value <0x0-0xFF>
// <i> Delay Value (0x0-0xFF)
// <id> dfllulp_arch_delay
#ifndef CONF_DFLL_DELAY
#define CONF_DFLL_DELAY (0x80)
#endif
// <o> Target Ratio Value <0x0-0x7FF>
// <i> Target Ratio Value (0x0-0x7FF)
// <id> dfllulp_arch_ratio
#ifndef CONF_DFLL_RATIO
#define CONF_DFLL_RATIO (0x80)
#endif
// <o> Operating Mode Selection
// <1=>Closed Loop Mode
// <id> dfllulp_mode
#ifndef CONF_DFLL_MODE
#define CONF_DFLL_MODE 1
#endif
//</h>
//</e>
// <e> DFLL as Main Clock Source Configuration
// <i> Indicates whether enable DFLLUPL as main clock source or not
// <id> enable_dfllulp_as_mclk_source
#ifndef CONF_ENABLE_DFLL_AS_MCLK_SOURCE
#define CONF_ENABLE_DFLL_AS_MCLK_SOURCE 0
#endif
// <y> DFLL Clock Source Selection
// <GCLK_GENCTRL_SRC_DFLLULP"> Digital Frequency Locked Loop (DFLLULP)
// <i> This defines the clock source for DFLL
// <id> dfllulp_source_oscillator
#ifndef CONF_DFLL_SRC
#define CONF_DFLL_SRC GCLK_GENCTRL_SRC_DFLLULP
#endif
//</e>
// <e> DPLL Configuration
// <i> Indicates whether configuration for DPLL is enabled or not
// <id> enable_fdpll96m
#ifndef CONF_DPLL_CONFIG
#define CONF_DPLL_CONFIG 0
#endif
// <y> Reference Clock Source
// <GCLK_GENCTRL_SRC_XOSC32K"> 32kHz External Crystal Oscillator (XOSC32K)
// <GCLK_GENCTRL_SRC_XOSC"> External Crystal Oscillator 0.4-32MHz (XOSC)
// <GCLK_PCHCTRL_GEN_GCLK0_Val"> Generic clock generator 0
// <GCLK_PCHCTRL_GEN_GCLK1_Val"> Generic clock generator 1
// <GCLK_PCHCTRL_GEN_GCLK2_Val"> Generic clock generator 2
// <GCLK_PCHCTRL_GEN_GCLK3_Val"> Generic clock generator 3
// <GCLK_PCHCTRL_GEN_GCLK4_Val"> Generic clock generator 4
// <GCLK_PCHCTRL_GEN_GCLK5_Val"> Generic clock generator 5
// <GCLK_PCHCTRL_GEN_GCLK6_Val"> Generic clock generator 6
// <GCLK_PCHCTRL_GEN_GCLK7_Val"> Generic clock generator 7
// <i> Select the clock source.
// <id> fdpll96m_ref_clock
#ifndef CONF_DPLL_GCLK
#define CONF_DPLL_GCLK GCLK_GENCTRL_SRC_XOSC32K
#endif
// <h> Digital Phase Locked Loop Control
// <q> Enable
// <i> Indicates whether Digital Phase Locked Loop is enabled or not
// <id> fdpll96m_arch_enable
#ifndef CONF_DPLL_ENABLE
#define CONF_DPLL_ENABLE 0
#endif
// <q> On Demand Control
// <i> Indicates whether On Demand Control is enabled or not
// <id> fdpll96m_arch_ondemand
#ifndef CONF_DPLL_ONDEMAND
#define CONF_DPLL_ONDEMAND 1
#endif
// <q> Run in Standby
// <i> Indicates whether Run in Standby is enabled or not
// <id> fdpll96m_arch_runstdby
#ifndef CONF_DPLL_RUNSTDBY
#define CONF_DPLL_RUNSTDBY 0
#endif
// <o> Loop Divider Ratio Fractional Part <0x0-0xF>
// <id> fdpll96m_ldrfrac
#ifndef CONF_DPLL_LDRFRAC
#define CONF_DPLL_LDRFRAC 0xd
#endif
// <o> Loop Divider Ratio Integer Part <0x0-0xFFF>
// <id> fdpll96m_ldr
#ifndef CONF_DPLL_LDR
#define CONF_DPLL_LDR 0x5b7
#endif
// <o> Clock Divider <0x0-0x3FF>
// <id> fdpll96m_clock_div
#ifndef CONF_DPLL_DIV
#define CONF_DPLL_DIV 0
#endif
// <q> Lock Bypass
// <i> Indicates whether Lock Bypass is enabled or not
// <id> fdpll96m_arch_lbypass
#ifndef CONF_DPLL_LBYPASS
#define CONF_DPLL_LBYPASS 0
#endif
// <o> Lock Time
// <0=>No time-out, automatic lock
// <4=>The Time-out if no lock within 8 ms
// <5=>The Time-out if no lock within 9 ms
// <6=>The Time-out if no lock within 10 ms
// <7=>The Time-out if no lock within 11 ms
// <id> fdpll96m_arch_ltime
#ifndef CONF_DPLL_LTIME
#define CONF_DPLL_LTIME 0
#endif
// <o> Reference Clock Selection
// <0=>XOSC32K clock reference
// <1=>XOSC clock reference
// <2=>GCLK clock reference
// <id> fdpll96m_arch_refclk
#ifndef CONF_DPLL_REFCLK
#define CONF_DPLL_REFCLK 0
#endif
// <q> Wake Up Fast
// <i> Indicates whether Wake Up Fast is enabled or not
// <id> fdpll96m_arch_wuf
#ifndef CONF_DPLL_WUF
#define CONF_DPLL_WUF 0
#endif
// <q> Low-Power Enable
// <i> Indicates whether Low-Power Enable is enabled or not
// <id> fdpll96m_arch_lpen
#ifndef CONF_DPLL_LPEN
#define CONF_DPLL_LPEN 0
#endif
// <o> Reference Clock Selection
// <0=>Default filter mode
// <1=>Low bandwidth filter
// <2=>High bandwidth filter
// <3=>High damping filter
// <id> fdpll96m_arch_filter
#ifndef CONF_DPLL_FILTER
#define CONF_DPLL_FILTER 0
#endif
// <y> Output Clock Prescaler
// <OSCCTRL_DPLLPRESC_PRESC_DIV1_Val"> 1
// <OSCCTRL_DPLLPRESC_PRESC_DIV2_Val"> 2
// <OSCCTRL_DPLLPRESC_PRESC_DIV4_Val"> 4
// <id> fdpll96m_presc
#ifndef CONF_DPLL_PRESC
#define CONF_DPLL_PRESC OSCCTRL_DPLLPRESC_PRESC_DIV1_Val
#endif
//</h>
//</e>
// <<< end of configuration section >>>
#endif // HPL_OSCCTRL_CONFIG_H
|
{
"content_hash": "fdbb64132dbb569dae3e6221982dc33c",
"timestamp": "",
"source": "github",
"line_count": 411,
"max_line_length": 124,
"avg_line_length": 27.46228710462287,
"alnum_prop": 0.7269425002214938,
"repo_name": "eewiki/ws_bm_rtc",
"id": "2ed07d256edeb3255ad4e0e9af8a63635c19a93d",
"size": "11287",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "XBee_SAML11_WeatherSensor/XBeeWeatherStation/Config/hpl_oscctrl_config.h",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Arduino",
"bytes": "3707"
},
{
"name": "C++",
"bytes": "41055"
},
{
"name": "CSS",
"bytes": "2642"
},
{
"name": "HTML",
"bytes": "1877"
},
{
"name": "Shell",
"bytes": "5987"
}
],
"symlink_target": ""
}
|
using System.Collections.Generic;
using Free.FileFormats.VRML.InterfaceDeclarations;
using Free.FileFormats.VRML.Interfaces;
namespace Free.FileFormats.VRML.Nodes
{
public class x3dTextureCoordinate4DPROTO : x3dTextureCoordinate4D, X3DPrototypeInstance
{
public List<InterfaceDeclaration> InterfaceDeclarations { get; set; }
public string ProtoNodeName { get; set; }
public List<X3DNode> Nodes { get; set; }
}
}
|
{
"content_hash": "8d3d9ef10c847128f4421b1120ab8f43",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 88,
"avg_line_length": 32.53846153846154,
"alnum_prop": 0.7966903073286052,
"repo_name": "shintadono/Free.FileFormats.VRML",
"id": "c680b72f171167f29371ee0e64a642a36ed63e28",
"size": "425",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "33 Texturing3D/ProtoNodes/x3dTextureCoordinate4DPROTO.cs",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C#",
"bytes": "626596"
}
],
"symlink_target": ""
}
|
// Code generated by go-swagger; DO NOT EDIT.
package stickers
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"net/http"
"time"
"golang.org/x/net/context"
"github.com/go-openapi/errors"
"github.com/go-openapi/runtime"
cr "github.com/go-openapi/runtime/client"
"github.com/go-openapi/swag"
strfmt "github.com/go-openapi/strfmt"
)
// NewCreateNewStickerSetParams creates a new CreateNewStickerSetParams object
// with the default values initialized.
func NewCreateNewStickerSetParams() *CreateNewStickerSetParams {
var ()
return &CreateNewStickerSetParams{
timeout: cr.DefaultTimeout,
}
}
// NewCreateNewStickerSetParamsWithTimeout creates a new CreateNewStickerSetParams object
// with the default values initialized, and the ability to set a timeout on a request
func NewCreateNewStickerSetParamsWithTimeout(timeout time.Duration) *CreateNewStickerSetParams {
var ()
return &CreateNewStickerSetParams{
timeout: timeout,
}
}
// NewCreateNewStickerSetParamsWithContext creates a new CreateNewStickerSetParams object
// with the default values initialized, and the ability to set a context for a request
func NewCreateNewStickerSetParamsWithContext(ctx context.Context) *CreateNewStickerSetParams {
var ()
return &CreateNewStickerSetParams{
Context: ctx,
}
}
// NewCreateNewStickerSetParamsWithHTTPClient creates a new CreateNewStickerSetParams object
// with the default values initialized, and the ability to set a custom HTTPClient for a request
func NewCreateNewStickerSetParamsWithHTTPClient(client *http.Client) *CreateNewStickerSetParams {
var ()
return &CreateNewStickerSetParams{
HTTPClient: client,
}
}
/*CreateNewStickerSetParams contains all the parameters to send to the API endpoint
for the create new sticker set operation typically these are written to a http.Request
*/
type CreateNewStickerSetParams struct {
/*Emojis*/
Emojis string
/*IsMasks*/
IsMasks *bool
/*MaskPosition
Serialized to JSON MaskPosition
*/
MaskPosition *string
/*Name*/
Name string
/*PngSticker*/
PngSticker runtime.NamedReadCloser
/*Title*/
Title string
/*Token
bot's token to authorize the request
*/
Token *string
/*UserID*/
UserID int64
timeout time.Duration
Context context.Context
HTTPClient *http.Client
}
// WithTimeout adds the timeout to the create new sticker set params
func (o *CreateNewStickerSetParams) WithTimeout(timeout time.Duration) *CreateNewStickerSetParams {
o.SetTimeout(timeout)
return o
}
// SetTimeout adds the timeout to the create new sticker set params
func (o *CreateNewStickerSetParams) SetTimeout(timeout time.Duration) {
o.timeout = timeout
}
// WithContext adds the context to the create new sticker set params
func (o *CreateNewStickerSetParams) WithContext(ctx context.Context) *CreateNewStickerSetParams {
o.SetContext(ctx)
return o
}
// SetContext adds the context to the create new sticker set params
func (o *CreateNewStickerSetParams) SetContext(ctx context.Context) {
o.Context = ctx
}
// WithHTTPClient adds the HTTPClient to the create new sticker set params
func (o *CreateNewStickerSetParams) WithHTTPClient(client *http.Client) *CreateNewStickerSetParams {
o.SetHTTPClient(client)
return o
}
// SetHTTPClient adds the HTTPClient to the create new sticker set params
func (o *CreateNewStickerSetParams) SetHTTPClient(client *http.Client) {
o.HTTPClient = client
}
// WithEmojis adds the emojis to the create new sticker set params
func (o *CreateNewStickerSetParams) WithEmojis(emojis string) *CreateNewStickerSetParams {
o.SetEmojis(emojis)
return o
}
// SetEmojis adds the emojis to the create new sticker set params
func (o *CreateNewStickerSetParams) SetEmojis(emojis string) {
o.Emojis = emojis
}
// WithIsMasks adds the isMasks to the create new sticker set params
func (o *CreateNewStickerSetParams) WithIsMasks(isMasks *bool) *CreateNewStickerSetParams {
o.SetIsMasks(isMasks)
return o
}
// SetIsMasks adds the isMasks to the create new sticker set params
func (o *CreateNewStickerSetParams) SetIsMasks(isMasks *bool) {
o.IsMasks = isMasks
}
// WithMaskPosition adds the maskPosition to the create new sticker set params
func (o *CreateNewStickerSetParams) WithMaskPosition(maskPosition *string) *CreateNewStickerSetParams {
o.SetMaskPosition(maskPosition)
return o
}
// SetMaskPosition adds the maskPosition to the create new sticker set params
func (o *CreateNewStickerSetParams) SetMaskPosition(maskPosition *string) {
o.MaskPosition = maskPosition
}
// WithName adds the name to the create new sticker set params
func (o *CreateNewStickerSetParams) WithName(name string) *CreateNewStickerSetParams {
o.SetName(name)
return o
}
// SetName adds the name to the create new sticker set params
func (o *CreateNewStickerSetParams) SetName(name string) {
o.Name = name
}
// WithPngSticker adds the pngSticker to the create new sticker set params
func (o *CreateNewStickerSetParams) WithPngSticker(pngSticker runtime.NamedReadCloser) *CreateNewStickerSetParams {
o.SetPngSticker(pngSticker)
return o
}
// SetPngSticker adds the pngSticker to the create new sticker set params
func (o *CreateNewStickerSetParams) SetPngSticker(pngSticker runtime.NamedReadCloser) {
o.PngSticker = pngSticker
}
// WithTitle adds the title to the create new sticker set params
func (o *CreateNewStickerSetParams) WithTitle(title string) *CreateNewStickerSetParams {
o.SetTitle(title)
return o
}
// SetTitle adds the title to the create new sticker set params
func (o *CreateNewStickerSetParams) SetTitle(title string) {
o.Title = title
}
// WithToken adds the token to the create new sticker set params
func (o *CreateNewStickerSetParams) WithToken(token *string) *CreateNewStickerSetParams {
o.SetToken(token)
return o
}
// SetToken adds the token to the create new sticker set params
func (o *CreateNewStickerSetParams) SetToken(token *string) {
o.Token = token
}
// WithUserID adds the userID to the create new sticker set params
func (o *CreateNewStickerSetParams) WithUserID(userID int64) *CreateNewStickerSetParams {
o.SetUserID(userID)
return o
}
// SetUserID adds the userId to the create new sticker set params
func (o *CreateNewStickerSetParams) SetUserID(userID int64) {
o.UserID = userID
}
// WriteToRequest writes these params to a swagger request
func (o *CreateNewStickerSetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
if err := r.SetTimeout(o.timeout); err != nil {
return err
}
var res []error
// form param emojis
frEmojis := o.Emojis
fEmojis := frEmojis
if fEmojis != "" {
if err := r.SetFormParam("emojis", fEmojis); err != nil {
return err
}
}
if o.IsMasks != nil {
// form param is_masks
var frIsMasks bool
if o.IsMasks != nil {
frIsMasks = *o.IsMasks
}
fIsMasks := swag.FormatBool(frIsMasks)
if fIsMasks != "" {
if err := r.SetFormParam("is_masks", fIsMasks); err != nil {
return err
}
}
}
if o.MaskPosition != nil {
// form param mask_position
var frMaskPosition string
if o.MaskPosition != nil {
frMaskPosition = *o.MaskPosition
}
fMaskPosition := frMaskPosition
if fMaskPosition != "" {
if err := r.SetFormParam("mask_position", fMaskPosition); err != nil {
return err
}
}
}
// form param name
frName := o.Name
fName := frName
if fName != "" {
if err := r.SetFormParam("name", fName); err != nil {
return err
}
}
// form file param png_sticker
if err := r.SetFileParam("png_sticker", o.PngSticker); err != nil {
return err
}
// form param title
frTitle := o.Title
fTitle := frTitle
if fTitle != "" {
if err := r.SetFormParam("title", fTitle); err != nil {
return err
}
}
if o.Token != nil {
// path param token
if err := r.SetPathParam("token", *o.Token); err != nil {
return err
}
}
// form param user_id
frUserID := o.UserID
fUserID := swag.FormatInt64(frUserID)
if fUserID != "" {
if err := r.SetFormParam("user_id", fUserID); err != nil {
return err
}
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
|
{
"content_hash": "03c1aabbd6c86a896cbe5d77e024a1c3",
"timestamp": "",
"source": "github",
"line_count": 309,
"max_line_length": 115,
"avg_line_length": 26.50485436893204,
"alnum_prop": 0.752014652014652,
"repo_name": "olebedev/go-tgbot",
"id": "90318dc0d7fe4ef0449e8cf78af8c13a0ad44ee1",
"size": "8190",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "client/stickers/create_new_sticker_set_parameters.go",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Go",
"bytes": "14992"
},
{
"name": "Makefile",
"bytes": "2446"
}
],
"symlink_target": ""
}
|
<!--
@license https://github.com/t2ym/thin-polymer/blob/master/LICENSE.md
Copyright (c) 2016, Tetsuya Mori <t2y3141592@gmail.com>. All rights reserved.
-->
<link rel="import" href="../../thin-polymer.html">
<template id="es5-element1">
<span>{{label}}</span>
</template>
<script>
Prototype = {
is: 'es5-element1',
properties: {
label: {
type: String,
value: 'label'
}
},
attached: function () {
this.label = this.label.toUpperCase();
}
}
</script>
|
{
"content_hash": "03ef25961b33bc1db5c66f20649c4076",
"timestamp": "",
"source": "github",
"line_count": 24,
"max_line_length": 77,
"avg_line_length": 20.25,
"alnum_prop": 0.6234567901234568,
"repo_name": "t2ym/thin-polymer",
"id": "0481b3b7bd70caf10df6d5fdc6f5ed674cbab2bc",
"size": "639",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "demo/native/es5-element1.html",
"mode": "33261",
"license": "bsd-2-clause",
"language": [
{
"name": "HTML",
"bytes": "30814"
},
{
"name": "JavaScript",
"bytes": "13951"
}
],
"symlink_target": ""
}
|
(function () {
'use strict';
describe('LBaaS v2 Module', function () {
it('should be defined', function () {
expect(angular.module('horizon.dashboard.project.lbaasv2')).toBeDefined();
});
});
describe('LBaaS v2 Module Base Path', function () {
var basePath, staticUrl;
beforeEach(module('horizon.dashboard.project.lbaasv2'));
beforeEach(inject(function ($injector) {
basePath = $injector.get('horizon.dashboard.project.lbaasv2.basePath');
staticUrl = $injector.get('$window').STATIC_URL;
}));
it('should be defined', function () {
expect(basePath).toBeDefined();
});
it('should be correct', function () {
expect(basePath).toEqual(staticUrl + 'dashboard/project/lbaasv2/');
});
});
describe('LBaaS v2 Module Constants', function () {
var patterns, popovers;
beforeEach(module('horizon.dashboard.project.lbaasv2'));
beforeEach(inject(function ($injector) {
patterns = $injector.get('horizon.dashboard.project.lbaasv2.patterns');
popovers = $injector.get('horizon.dashboard.project.lbaasv2.popovers');
}));
it('should define patterns', function () {
expect(patterns).toBeDefined();
});
it('should define expected patterns', function () {
expect(Object.keys(patterns).length).toBe(4);
var keys = ['ipv4', 'ipv6', 'httpStatusCodes', 'urlPath'];
angular.forEach(keys, function(key) {
expect(patterns[key]).toBeDefined();
});
});
it('should define correct pattern for health monitor status codes', function () {
expect(Object.keys(patterns).length).toBe(4);
var regex = patterns.httpStatusCodes;
expect(regex.test('200')).toBe(true);
expect(regex.test('200-204')).toBe(true);
expect(regex.test('200,203,204')).toBe(true);
expect(regex.test('foo')).toBe(false);
expect(regex.test('200,202-204')).toBe(false);
});
it('should define popovers', function () {
expect(popovers).toBeDefined();
});
it('should define expected popover templates', function () {
expect(Object.keys(popovers).length).toBe(1);
var keys = ['ipAddresses'];
angular.forEach(keys, function(key) {
expect(popovers[key]).toBeDefined();
});
});
});
describe('LBaaS v2 Module Config', function () {
var $routeProvider, basePath;
beforeEach(function() {
// Create a dummy module so that we can test $routeProvider calls in our actual
// config block.
angular.module('configTest', [])
.config(function(_$routeProvider_, $windowProvider) {
$routeProvider = _$routeProvider_;
basePath = $windowProvider.$get().STATIC_URL + 'dashboard/project/lbaasv2/';
spyOn($routeProvider, 'when').and.callThrough();
});
module('ngRoute');
module('configTest');
module('horizon.dashboard.project.lbaasv2');
inject();
});
it('should route URLs', function () {
var loadbalancers = '/project/ngloadbalancersv2';
var listener = loadbalancers + '/:loadbalancerId/listeners/:listenerId';
var pool = listener + '/pools/:poolId';
var member = pool + '/members/:memberId';
var healthmonitor = pool + '/healthmonitors/:healthmonitorId';
var routes = [[
loadbalancers, {
templateUrl: basePath + 'loadbalancers/table.html'
}
], [
loadbalancers + '/:loadbalancerId', {
templateUrl: basePath + 'loadbalancers/detail.html'
}
], [
listener, {
templateUrl: basePath + 'listeners/detail.html'
}
], [
pool, {
templateUrl: basePath + 'pools/detail.html'
}
], [
member, {
templateUrl: basePath + 'members/detail.html'
}
], [
healthmonitor, {
templateUrl: basePath + 'healthmonitors/detail.html'
}
]];
expect($routeProvider.when.calls.count()).toBe(6);
angular.forEach($routeProvider.when.calls.all(), function(call, i) {
expect(call.args).toEqual(routes[i]);
});
});
});
})();
|
{
"content_hash": "ee7f2ace892f8afd769bfa65c093b237",
"timestamp": "",
"source": "github",
"line_count": 132,
"max_line_length": 86,
"avg_line_length": 31.431818181818183,
"alnum_prop": 0.603759942154736,
"repo_name": "Juniper/contrail-horizon",
"id": "ead904e3fb41d6b611cb5b74afa34733759af81e",
"size": "4740",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "neutron_lbaas_dashboard/static/dashboard/project/lbaasv2/lbaasv2.module.spec.js",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "2191"
},
{
"name": "HTML",
"bytes": "135295"
},
{
"name": "JavaScript",
"bytes": "445916"
},
{
"name": "Python",
"bytes": "664980"
}
],
"symlink_target": ""
}
|
module.exports = {
Base: require('./base')
}
|
{
"content_hash": "73e1654b3c9a4621d99930ebe75c057c",
"timestamp": "",
"source": "github",
"line_count": 3,
"max_line_length": 25,
"avg_line_length": 15.666666666666666,
"alnum_prop": 0.5957446808510638,
"repo_name": "passabilities/backrest",
"id": "4a513b401b9c82041e63fe6e690140f2ca3759d2",
"size": "47",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/action_controller/index.js",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Dockerfile",
"bytes": "33"
},
{
"name": "JavaScript",
"bytes": "17645"
}
],
"symlink_target": ""
}
|
<!DOCTYPE html>
<html class="pl">
<head>
<title>Pattern Lab</title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width" />
<link rel="stylesheet" href="../../css/style.css?1447861508" media="all" />
<!-- Begin Pattern Lab (Required for Pattern Lab to run properly) -->
<!-- never cache patterns -->
<meta http-equiv="cache-control" content="max-age=0" />
<meta http-equiv="cache-control" content="no-cache" />
<meta http-equiv="expires" content="0" />
<meta http-equiv="expires" content="Tue, 01 Jan 1980 1:00:00 GMT" />
<meta http-equiv="pragma" content="no-cache" />
<link rel="stylesheet" href="../../styleguide/css/styleguide.css?1447861508" media="all">
<link rel="stylesheet" href="../../styleguide/css/styleguide-specific.css?1447861508" media="all" />
<!-- End Pattern Lab -->
</head>
<body class="body">
<aside class="sidebar">
<section class="content">
<div class="widget share">
<header><h4><span class="icon ion-android-share-alt blue"></span>Share</h4></header>
<section class="widget-body">
<button class="btn btn-share facebook"><span class="icon ion-social-facebook"></span></button>
<button class="btn btn-share twitter"><span class="icon ion-social-twitter"></span></button>
<button class="btn btn-share email"><span class="icon ion-email"></span></button>
</section>
</div>
<div class="widget activity-stream">
<header>
<h4><span class="icon ion-ios-pulse-strong blue"></span>Activity Stream</h4>
</header>
<section class="widget-body">
<ul>
<li><span class="icon ion-chevron-down down"></span><p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nunc rhoncus dapibus urna quis posuere. </p></li>
<li><span class="icon ion-ios-chatboxes-outline blue"></span><p>Phasellus pulvinar magna a massa maximus imperdiet. Sed sed sagittis eros, vel cursus neque. In sodales ipsum id turpis viverra, et venenatis diam tincidunt.</p></li>
<li><span class="icon ion-chevron-up up"></span><p>Maecenas justo odio, tempus sed velit sed, mattis fermentum lorem. Sed placerat nisi vitae ante blandit, et volutpat massa cursus. </p></li>
<li><span class="icon ion-document blue"></span><p>onec nunc ipsum, laoreet non velit non, lobortis pellentesque felis. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Aliquam ultricies neque eu arcu tincidunt, eu venenatis orci cursus.</p></li>
</ul>
</section>
</div>
</section>
</aside>
<!--DO NOT REMOVE-->
<script>
// handle injection of items from PHP
var patternPartial = "organisms-sidebar";
var lineage = [];
var lineageR = [];
var patternState = "";
var cssEnabled = false;
</script>
<script>
var scriptLoader = {
run: function(js,cb,target) {
var s = document.getElementById(target+'-'+cb);
for (var i = 0; i < js.length; i++) {
var src = (typeof js[i] != "string") ? js[i].src : js[i];
var c = document.createElement('script');
c.src = '../../'+src+'?'+cb;
if (typeof js[i] != "string") {
if (js[i].dep !== undefined) {
c.onload = function(dep,cb,target) {
return function() {
scriptLoader.run(dep,cb,target);
}
}(js[i].dep,cb,target);
}
}
s.parentNode.insertBefore(c,s);
}
}
}
</script>
<script id="pl-js-polyfill-insert-1447861508">
(function() {
if (self != top) {
var cb = '1447861508';
var js = [];
if (typeof document !== "undefined" && !("classList" in document.documentElement)) {
js.push("styleguide/js/vendor/classlist-polyfill.js");
}
scriptLoader.run(js,cb,'pl-js-polyfill-insert');
}
})();
</script>
<script id="pl-js-insert-1447861508">
(function() {
if (self != top) {
var cb = '1447861508';
var js = [ { "src": "styleguide/js/vendor/jwerty.js", "dep": [ "styleguide/js/postmessage.js", { "src": "data/annotations.js", "dep": [ "styleguide/js/annotations-pattern.js" ] }, "styleguide/js/code-pattern.js" ] } ];
scriptLoader.run(js,cb,'pl-js-insert');
}
})();
</script>
</body>
</html>
|
{
"content_hash": "3c0f3b30121ffb3297eb11d1f7655ec3",
"timestamp": "",
"source": "github",
"line_count": 114,
"max_line_length": 303,
"avg_line_length": 38.57017543859649,
"alnum_prop": 0.5990448032749602,
"repo_name": "MattMcFarland/wt-patternlab",
"id": "05a1105c268ebbc28122dd6c42bbe22d9888c03e",
"size": "4532",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "public/patterns/02-organisms-00-global-04-sidebar/02-organisms-00-global-04-sidebar.html",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "320835"
},
{
"name": "HTML",
"bytes": "1259737"
},
{
"name": "JavaScript",
"bytes": "897039"
},
{
"name": "PHP",
"bytes": "395096"
},
{
"name": "Shell",
"bytes": "488"
}
],
"symlink_target": ""
}
|
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>menhirlib: Not compatible 👼</title>
<link rel="shortcut icon" type="image/png" href="../../../../../favicon.png" />
<link href="../../../../../bootstrap.min.css" rel="stylesheet">
<link href="../../../../../bootstrap-custom.css" rel="stylesheet">
<link href="//maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css" rel="stylesheet">
<script src="../../../../../moment.min.js"></script>
<!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
<!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
<![endif]-->
</head>
<body>
<div class="container">
<div class="navbar navbar-default" role="navigation">
<div class="container-fluid">
<div class="navbar-header">
<a class="navbar-brand" href="../../../../.."><i class="fa fa-lg fa-flag-checkered"></i> Coq bench</a>
</div>
<div id="navbar" class="collapse navbar-collapse">
<ul class="nav navbar-nav">
<li><a href="../..">clean / released</a></li>
<li class="active"><a href="">8.14.1 / menhirlib - 20190613</a></li>
</ul>
</div>
</div>
</div>
<div class="article">
<div class="row">
<div class="col-md-12">
<a href="../..">« Up</a>
<h1>
menhirlib
<small>
20190613
<span class="label label-info">Not compatible 👼</span>
</small>
</h1>
<p>📅 <em><script>document.write(moment("2022-05-12 13:34:30 +0000", "YYYY-MM-DD HH:mm:ss Z").fromNow());</script> (2022-05-12 13:34:30 UTC)</em><p>
<h2>Context</h2>
<pre># Packages matching: installed
# Name # Installed # Synopsis
base-bigarray base
base-threads base
base-unix base
conf-findutils 1 Virtual package relying on findutils
conf-gmp 4 Virtual package relying on a GMP lib system installation
coq 8.14.1 Formal proof management system
dune 3.1.1 Fast, portable, and opinionated build system
ocaml 4.07.1 The OCaml compiler (virtual package)
ocaml-base-compiler 4.07.1 Official release 4.07.1
ocaml-config 1 OCaml Switch Configuration
ocaml-secondary-compiler 4.08.1-1 OCaml 4.08.1 Secondary Switch Compiler
ocamlfind 1.9.1 A library manager for OCaml
ocamlfind-secondary 1.9.1 Adds support for ocaml-secondary-compiler to ocamlfind
zarith 1.12 Implements arithmetic and logical operations over arbitrary-precision integers
# opam file:
opam-version: "2.0"
synopsis: "A support library for verified Coq parsers produced by Menhir"
maintainer: "francois.pottier@inria.fr"
authors: [
"Jacques-Henri Jourdan <jacques-henri.jourdan@lri.fr>"
]
homepage: "https://gitlab.inria.fr/fpottier/menhir"
dev-repo: "git+https://gitlab.inria.fr/fpottier/menhir.git"
bug-reports: "jacques-henri.jourdan@lri.fr"
build: [
[make "-C" "coq-menhirlib" "-j%{jobs}%"]
]
install: [
[make "-C" "coq-menhirlib" "install"]
]
depends: [
"coq" { >= "8.8.1" & < "8.9" }
]
conflicts: [
"menhir" { != "20190613" }
"coq-native"
]
tags: [
"date:2019-06-13"
"logpath:MenhirLib"
]
url {
src:
"https://gitlab.inria.fr/fpottier/menhir/-/archive/20190613/archive.tar.gz"
checksum: [
"md5=23c380e23903e1974c923f3a6ff25ad4"
"sha512=0a929803068771bcc785abd94d37966fdb84f515f7f82393e685d44cc6e18144f62f2e00e0a7bf9b69f87c2c4bb9e33435878322d26b8fc37f7756fd84bc6f46"
]
}
</pre>
<h2>Lint</h2>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>true</code></dd>
<dt>Return code</dt>
<dd>0</dd>
</dl>
<h2>Dry install 🏜️</h2>
<p>Dry install with the current Coq version:</p>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>opam install -y --show-action coq-menhirlib.20190613 coq.8.14.1</code></dd>
<dt>Return code</dt>
<dd>5120</dd>
<dt>Output</dt>
<dd><pre>[NOTE] Package coq is already installed (current version is 8.14.1).
The following dependencies couldn't be met:
- coq-menhirlib -> coq < 8.9 -> ocaml < 4.06.0
base of this switch (use `--unlock-base' to force)
Your request can't be satisfied:
- No available version of coq satisfies the constraints
No solution found, exiting
</pre></dd>
</dl>
<p>Dry install without Coq/switch base, to test if the problem was incompatibility with the current Coq/OCaml version:</p>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>opam remove -y coq; opam install -y --show-action --unlock-base coq-menhirlib.20190613</code></dd>
<dt>Return code</dt>
<dd>0</dd>
</dl>
<h2>Install dependencies</h2>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>true</code></dd>
<dt>Return code</dt>
<dd>0</dd>
<dt>Duration</dt>
<dd>0 s</dd>
</dl>
<h2>Install 🚀</h2>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>true</code></dd>
<dt>Return code</dt>
<dd>0</dd>
<dt>Duration</dt>
<dd>0 s</dd>
</dl>
<h2>Installation size</h2>
<p>No files were installed.</p>
<h2>Uninstall 🧹</h2>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>true</code></dd>
<dt>Return code</dt>
<dd>0</dd>
<dt>Missing removes</dt>
<dd>
none
</dd>
<dt>Wrong removes</dt>
<dd>
none
</dd>
</dl>
</div>
</div>
</div>
<hr/>
<div class="footer">
<p class="text-center">
Sources are on <a href="https://github.com/coq-bench">GitHub</a> © Guillaume Claret 🐣
</p>
</div>
</div>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<script src="../../../../../bootstrap.min.js"></script>
</body>
</html>
|
{
"content_hash": "b0a026460bdbe5e777470c1cfa33916d",
"timestamp": "",
"source": "github",
"line_count": 178,
"max_line_length": 159,
"avg_line_length": 40.556179775280896,
"alnum_prop": 0.5449508242138801,
"repo_name": "coq-bench/coq-bench.github.io",
"id": "4cdb15aa7c1dc16480ddc125471668ddf5960845",
"size": "7244",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "clean/Linux-x86_64-4.07.1-2.0.6/released/8.14.1/menhirlib/20190613.html",
"mode": "33188",
"license": "mit",
"language": [],
"symlink_target": ""
}
|
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>hanoi: Not compatible 👼</title>
<link rel="shortcut icon" type="image/png" href="../../../../../favicon.png" />
<link href="../../../../../bootstrap.min.css" rel="stylesheet">
<link href="../../../../../bootstrap-custom.css" rel="stylesheet">
<link href="//maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css" rel="stylesheet">
<script src="../../../../../moment.min.js"></script>
<!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
<!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
<![endif]-->
</head>
<body>
<div class="container">
<div class="navbar navbar-default" role="navigation">
<div class="container-fluid">
<div class="navbar-header">
<a class="navbar-brand" href="../../../../.."><i class="fa fa-lg fa-flag-checkered"></i> Coq bench</a>
</div>
<div id="navbar" class="collapse navbar-collapse">
<ul class="nav navbar-nav">
<li><a href="../..">clean / released</a></li>
<li class="active"><a href="">8.5.3 / hanoi - 1.0.0</a></li>
</ul>
</div>
</div>
</div>
<div class="article">
<div class="row">
<div class="col-md-12">
<a href="../..">« Up</a>
<h1>
hanoi
<small>
1.0.0
<span class="label label-info">Not compatible 👼</span>
</small>
</h1>
<p>📅 <em><script>document.write(moment("2022-09-09 17:35:02 +0000", "YYYY-MM-DD HH:mm:ss Z").fromNow());</script> (2022-09-09 17:35:02 UTC)</em><p>
<h2>Context</h2>
<pre># Packages matching: installed
# Name # Installed # Synopsis
base-bigarray base
base-num base Num library distributed with the OCaml compiler
base-threads base
base-unix base
camlp5 7.14 Preprocessor-pretty-printer of OCaml
conf-findutils 1 Virtual package relying on findutils
conf-perl 2 Virtual package relying on perl
coq 8.5.3 Formal proof management system
num 0 The Num library for arbitrary-precision integer and rational arithmetic
ocaml 4.05.0 The OCaml compiler (virtual package)
ocaml-base-compiler 4.05.0 Official 4.05.0 release
ocaml-config 1 OCaml Switch Configuration
# opam file:
opam-version: "2.0"
maintainer: "thery@sophia.inria.fr"
homepage: "https://github.com/thery/hanoi"
dev-repo: "git+https://github.com/thery/hanoi.git"
bug-reports: "https://github.com/thery/hanoi/issues"
license: "MIT"
synopsis: "Hanoi tower in Coq"
description: """
A note about this development is available
[here](https://hal.inria.fr/hal-02903548).
An interactive version of the library is available
[here](https://thery.github.io/hanoi/index.html)."""
build: [make "-j%{jobs}%"]
install: [make "install"]
depends: [
"coq" {(>= "8.14" & < "8.16~") | (>= dev)}
"coq-mathcomp-ssreflect" {(>= "1.14.0" & < "1.15~") | (>= dev)}
"coq-mathcomp-algebra" {(>= "1.14.0" & < "1.15~") | (>= dev)}
"coq-mathcomp-finmap" {(>= "1.5.1" & < "1.6~") | (>= dev)}
"coq-mathcomp-bigenough" {(>= "1.0.1" & < "1.1~") | (>= dev)}
]
tags: [
"keyword:hanoi tower"
"logpath:hanoi"
]
authors: [
"Laurent Théry"
]
url {
src: "https://github.com/thery/hanoi/archive/refs/tags/v1.0.0.zip"
checksum: "md5=eb53a8e4063b7ac1c0067dbddab057bf"
}
</pre>
<h2>Lint</h2>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>true</code></dd>
<dt>Return code</dt>
<dd>0</dd>
</dl>
<h2>Dry install 🏜️</h2>
<p>Dry install with the current Coq version:</p>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>opam install -y --show-action coq-hanoi.1.0.0 coq.8.5.3</code></dd>
<dt>Return code</dt>
<dd>5120</dd>
<dt>Output</dt>
<dd><pre>[NOTE] Package coq is already installed (current version is 8.5.3).
The following dependencies couldn't be met:
- coq-hanoi -> coq-mathcomp-bigenough >= false -> coq >= dev
no matching version
Your request can't be satisfied:
- No available version of coq satisfies the constraints
No solution found, exiting
</pre></dd>
</dl>
<p>Dry install without Coq/switch base, to test if the problem was incompatibility with the current Coq/OCaml version:</p>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>opam remove -y coq; opam install -y --show-action --unlock-base coq-hanoi.1.0.0</code></dd>
<dt>Return code</dt>
<dd>0</dd>
</dl>
<h2>Install dependencies</h2>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>true</code></dd>
<dt>Return code</dt>
<dd>0</dd>
<dt>Duration</dt>
<dd>0 s</dd>
</dl>
<h2>Install 🚀</h2>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>true</code></dd>
<dt>Return code</dt>
<dd>0</dd>
<dt>Duration</dt>
<dd>0 s</dd>
</dl>
<h2>Installation size</h2>
<p>No files were installed.</p>
<h2>Uninstall 🧹</h2>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>true</code></dd>
<dt>Return code</dt>
<dd>0</dd>
<dt>Missing removes</dt>
<dd>
none
</dd>
<dt>Wrong removes</dt>
<dd>
none
</dd>
</dl>
</div>
</div>
</div>
<hr/>
<div class="footer">
<p class="text-center">
Sources are on <a href="https://github.com/coq-bench">GitHub</a> © Guillaume Claret 🐣
</p>
</div>
</div>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<script src="../../../../../bootstrap.min.js"></script>
</body>
</html>
|
{
"content_hash": "a5514dda4dc7dec26a4ba5680f73d63a",
"timestamp": "",
"source": "github",
"line_count": 174,
"max_line_length": 159,
"avg_line_length": 41.10344827586207,
"alnum_prop": 0.5353747203579419,
"repo_name": "coq-bench/coq-bench.github.io",
"id": "9458a243f49cbcbe977e3c2fae0102bde8158a91",
"size": "7178",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "clean/Linux-x86_64-4.05.0-2.0.1/released/8.5.3/hanoi/1.0.0.html",
"mode": "33188",
"license": "mit",
"language": [],
"symlink_target": ""
}
|
ACCEPTED
#### According to
International Plant Names Index
#### Published in
null
#### Original name
null
### Remarks
null
|
{
"content_hash": "5d5f2c0380fef59dcaf02844637d4c61",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 31,
"avg_line_length": 9.692307692307692,
"alnum_prop": 0.7063492063492064,
"repo_name": "mdoering/backbone",
"id": "2bf8e892050a56b092baef763532538e4c33e873",
"size": "197",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "life/Plantae/Pteridophyta/Polypodiopsida/Polypodiales/Pteridaceae/Pteris/Pteris latiuscula/Pteris latiuscula lanuginosa/README.md",
"mode": "33188",
"license": "apache-2.0",
"language": [],
"symlink_target": ""
}
|
namespace ArtificialNeuralNetwork.ActivationFunctions
{
public class RectifiedLinearActivationFunction : IActivationFunction
{
public double CalculateActivation(double signal)
{
return signal > 0 ? signal : 0.0;
}
}
}
|
{
"content_hash": "d82c6a7a3df5e66aa73961e4dd1ab3c9",
"timestamp": "",
"source": "github",
"line_count": 10,
"max_line_length": 72,
"avg_line_length": 26.7,
"alnum_prop": 0.6666666666666666,
"repo_name": "jobeland/NeuralNetwork",
"id": "4b65f43c7d40c6e40757528b13d028dd5a78dd9c",
"size": "269",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "NeuralNetwork/NeuralNetwork/ActivationFunctions/RectifiedLinearActivationFunction.cs",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C#",
"bytes": "57226"
},
{
"name": "PowerShell",
"bytes": "3633"
}
],
"symlink_target": ""
}
|
navigator.serviceWorker.register('./serviceWorker.js')
.then((registration) => {
if (registration.installing) {
console.log('Service worker is in the installing state');
}
});
|
{
"content_hash": "503d57d87663df7f48f6c94e1836e1fa",
"timestamp": "",
"source": "github",
"line_count": 6,
"max_line_length": 61,
"avg_line_length": 30.666666666666668,
"alnum_prop": 0.7065217391304348,
"repo_name": "msfrisbie/pjwd-src",
"id": "0229ebf6386c2f1130ae44c02deb0560e0e27391",
"size": "184",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "Chapter27Workers/ServiceWorkers/UnderstandingTheServiceWorkerLifecycle/TheInstallingState/TheInstallingStateExample01.js",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "HTML",
"bytes": "23266"
},
{
"name": "JavaScript",
"bytes": "430025"
},
{
"name": "Python",
"bytes": "4610"
}
],
"symlink_target": ""
}
|
<?php
/**
* class RainGauge
*
* Controller class for Rain Gauge.
*
* @author Gavin Towey <gavin@box.com>
* @created 2012-05-01
* @license Apache 2.0 license. See LICENSE document for more info
*/
require_once("lib/Helpers.php");
require_once("lib/Loader.php");
require_once("lib/RainGaugeModel.php");
class RainGauge {
private $conf;
private $output_type;
private $datasource;
private $header_printed = false;
/**
* Constructor. Pass in the global configuration object
*
* @param type $conf
*/
function __construct($conf) {
$this->load = new Loader();
if (empty($conf)) {
throw new Exception("No conf defined");
}
$this->conf = $conf;
if (get_var('output')) {
$this->output = get_var('output');
} else {
$this->output = 'html';
}
$this->datasource = get_var('datasource');
$this->model = new RainGaugeModel($conf, $this->datasource);
session_start();
}
/**
* default action
*/
public function index() {
$this->header();
$data = array();
$data['graph_data'] = $this->model->get_collection_graph();
$data['servers'] = array();
foreach( $data['graph_data'] as $series)
{
$data['servers'][$series['label']] = array ( 'server' => $series['label'], 'sample_count' => count($series['data']), 'last_sample' => date('r',$series['data'][count($series['data'])-1][0]));
}
$sort_key = 'last_sample';
/*
usort($data['servers'], function ($a, $b) use ($sort_key) {
return $a[$sort_key] < $b[$sort_key];
});*/
$this->load->view("index", $data);
$this->footer();
}
/**
* list samples for a single server
* @return void
*/
public function server() {
$this->header();
$sort_key = get_var('sort');
if (!isset($sort_key)) {
$sort_key = 'timestamp';
}
$data['server'] = get_var('server');
$data['graph_data'] = $this->model->get_collection_graph($data['server']);
$data['time_start_param'] = 'start_time';
$data['time_end_param'] = 'end_time';
$data['new_samples_url'] = site_url() . "?action=api&type=list_samples&server=" . $data['server'];
$data['samples'] = $this->model->list_samples($data['server']);
usort($data['samples'], function ($a, $b) use ($sort_key) {
return $a[$sort_key] < $b[$sort_key];
});
$_GET['sort'] = $sort_key;
$this->load->view('server', $data);
$this->load->view('server_list_samples', $data);
$this->footer();
}
/**
* grep through a sample for matching lines
*/
public function search_sample() {
$this->header();
$data['server'] = get_var('server');
$data['sample'] = get_var('sample');
$data['file'] = get_var('file');
$data['sample_time'] = $this->get_timestamp_from_file($data['sample']);
$data['data'] = $this->model->get_sample($data['server'], $data['sample']);
$data['percent'] = $this->model->get_sample_percent($data['server'], $data['sample']);
$data['file_data'] = join('<br>', $this->model->search_sample($data['server'], $data['sample'], get_var('pattern'), get_var('file_type'), get_var('context')));
$this->load->view('sample', $data);
$this->footer();
}
/**
* display a collected sample for a single server
* @return void
*/
public function sample() {
$this->header();
$data['server'] = get_var('server');
$data['sample'] = get_var('sample');
$data['file'] = get_var('file');
$data['sample_time'] = $this->get_timestamp_from_file($data['sample']);
$data['data'] = $this->model->get_sample($data['server'], $data['sample']);
$data['page'] = get_var('page');
$file_type = $this->model->get_type($data['file']);
if (get_var('file_type') != null) {
$data['file'] = $this_ts = substr($data['data'][0]['name'], 0, 19) . '-' . get_var('file_type');
$file_type = get_var('file_type');
}
$data['file_type'] = $file_type;
if (isset($data['file']) and $data['file'] != '') {
$paged_file = $this->model->get_file_pages($data['server'], $data['sample'], $data['file']);
if (!isset($data['page']) or $data['page'] > count($paged_file) or $data['page'] < 1) {
$_GET['page'] = 1;
$data['page'] = 1;
}
$data['file_lines'] = $paged_file[$data['page'] - 1];
$data['page_count'] = count($paged_file);
if (in_array($file_type, array('processlist'))) {
// strip sleeping threads
$result = $this->model->parse_rows_to_result_set($data['file_lines']);
$result = array_filter($result, function ($x) {
if ($x['Command'] == 'Sleep') {
return false;
} return true;
});
$data['file_data'] = $this->model->result_as_table($result);
$data['file_lines'] = array();
}
if ($file_type == 'mysqladmin') {
$status = $this->model->parse_mysqladmin($data['file_lines']);
$temp_data = array();
$flot_data = array();
foreach ($status as $var_name => $values) {
if (in_array($var_name, $this->conf['non_delta_status_vars'])) {
$data['flot_data'][] = array('label' => $var_name, 'data' => array_map(function ($i, $x) {
return array($i++, $x);
}, array_keys($values), $values));
} else {
$data['flot_data'][] = array(
'label' => $var_name,
'data' =>
array_slice(
array_map(
function ($i, $x, $y) {
return array($i++, $x - $y);
}, array_keys($values), $values, array_merge(array(0), $values)
), 1, count($values) - 1
)
);
}
}
$data['file_lines'] = array();
$data['table_data'] = $status;
$data['status_presets'] = $this->conf['status_presets'];
$data['default_flot_series'] = array('Threads_running' => true);
}
else if ($file_type == 'lsof')
{
$groups = array();
for ($i=1; $i< count($data['file_lines']); $i++)
{
$parts = preg_split("/\s+/", $data['file_lines'][$i]);
$groups[$parts[0]] ++;
$groups[$parts[4]] ++;
}
$data['file_data'] = "SUMMARY\n";
foreach ($groups as $g => $value)
{
$data['file_data'] .= "{$g} = {$value}\n";
}
$data['file_data'] .= "\n";
}
else if ($file_type == 'stacktrace')
{
$data['file_data'] = htmlspecialchars($this->model->pmp_summary($data['sample'],$data['file']));
$data['file_data'] .= "<br/><hr>";
}
else if ($file_type == 'mutex-status2')
{
$this_ts = substr($data['data'][0]['name'], 0, 19);
$mutexes = $this->model->get_mutex_deltas($data['server'],$data['sample'], $this_ts);
/*
print "<pre>";
print_r($mutexes);
print "</pre>";
*/
arsort($mutexes);
$data['file_data'] = "MUTEX DELTAS\n";
$data['file_data'] .= join("\n", array_map(function ($x,$y) { return "$x = $y"; } , array_keys($mutexes), array_values($mutexes)));
$data['file_data'] .= "<hr>";
}
} else {
$data['file_lines'] = $this->model->sift($data['server'], $data['sample'], get_var('sift'));
}
$data['percent'] = $this->model->get_sample_percent($data['server'], $data['sample']);
$this->load->view('sample', $data);
$this->footer();
}
/**
* given a sample, find the previous collected sample
* then call the sample() method to display it
*/
public function prevtime() {
$data['server'] = get_var('server');
$data['sample'] = get_var('sample');
$samples = $this->model->list_samples($data['server']);
$sort_key = 'timestamp';
//sort ascending
usort($samples, function ($a, $b) use ($sort_key) {
return $a[$sort_key] > $b[$sort_key];
});
for ($i = 0; $i < count($samples); $i++) {
$s = $samples[$i];
if ($s['name'] == $data['sample']) {
if ($i > 0) {
$_GET['sample'] = $samples[$i - 1]['name'];
}
break;
}
}
$this->sample();
}
/**
* given a sample, find the next collected sample
* then call the sample() method to display it
*/
public function nexttime() {
$data['server'] = get_var('server');
$data['sample'] = get_var('sample');
$data['file'] = get_var('file');
$samples = $this->model->list_samples($data['server']);
$sort_key = 'timestamp';
// sort descending
usort($samples, function ($a, $b) use ($sort_key) {
return $a[$sort_key] < $b[$sort_key];
});
for ($i = 0; $i < count($samples); $i++) {
$s = $samples[$i];
if ($s['name'] == $data['sample']) {
if ($i > 0) {
$_GET['sample'] = $samples[$i - 1]['name'];
//print "found ".$samples[$i-1]['name'] ."<br>\n";
}
break;
}
}
$this->sample();
}
/**
* used to allow remote collection clients to send results for central storage.
* accepts a multi-part form upload
* */
public function upload() {
if ($_FILES["file"]["error"] > 0) {
$this->alert($_FILES["file"]["error"]);
return;
}
echo "Upload: " . $_FILES["file"]["name"] . "<br />";
echo "Type: " . $_FILES["file"]["type"] . "<br />";
echo "Size: " . ($_FILES["file"]["size"] / 1024) . " Kb<br />";
echo "Stored in: " . $_FILES["file"]["tmp_name"];
$hostname = get_var('hostname');
if (!isset($hostname) or $hostname == '') {
$this->alert("hostname is required");
return;
}
$port = get_var('port');
if ($port == null or $port == '') {
$port = 3306;
}
$target_path = join("/", array($this->conf['collection_dir'], "{$hostname}:{$port}"));
if (substr($target_path, 0, 1) != '/') {
$target_path = $this->conf['base_dir'] . '/' . $target_path;
}
$filename = $target_path . '/' . $_FILES["file"]["name"];
if (!is_dir($target_path)) {
if (!mkdir($target_path)) {
$this->alert("unable to create directory {$target_path}");
return;
}
//chmod($target_path, 0775 );
}
if (file_exists($filename)) {
$this->alert("File " . $_FILES["file"]["name"] . " already exists");
return;
}
rename($_FILES["file"]["tmp_name"], $filename);
$this->model->save_file($hostname, $port, $filename);
}
/**
* display the web application header
* @return boolean true if the header was actually printed
*/
private function header() {
if ($this->header_printed) {
return false;
}
// todo limit the number of servers shown
$data['servers'] = $this->model->get_server_list();
$this->load->view('header');
$this->load->view('navbar', $data);
$this->header_printed = true;
}
/**
* main method for getting report results. This method can be called as an
* ajax callback and return the raw data in json format, or it can display
* a table or graph directly. All other methods that get report results use this
* either directly or as an ajax call.
*
* to access this method, use action=api&type=<api type method>
*/
public function api() {
$type = get_var('type');
switch ($type) {
case 'list_samples':
$this->api_samples();
break;
default:
$this->alert("API Error: Unknown type $type", 'alert-error');
}
}
/**
* List samples for an API request
*/
private function api_samples() {
$start_time = get_var('start_time');
$end_time = get_var('end_time');
$start_time = $this->unix_timestamp(get_var('start_time'));
$end_time = $this->unix_timestamp(get_var('end_time'));
$data['server'] = get_var('server');
$data['samples'] = $this->model->list_samples($data['server'], $start_time, $end_time);
$sort_key = get_var('sort');
if (!isset($sort_key)) {
$sort_key = 'timestamp';
}
usort($data['samples'], function ($a, $b) use ($sort_key) {
return $a[$sort_key] < $b[$sort_key];
});
switch (get_var('output')) {
case 'json':
$this->load->view('server_list_samples_json', $data);
break;
default:
$this->load->view('server_list_samples', $data);
}
}
/**
* convert a date string to a timestamp
* @param string $date
* @return int
*/
private function unix_timestamp($date) {
if (!isset($date) or $date == '')
{
return null;
}
return strtotime($date);
}
/**
* display a message in a formatted div element
*
* @param string $string The message to display
* @param string $level The div class to use (default alert-warning)
*/
private function alert($string, $level = 'alert-warning') {
$this->header();
print "<div class=\"alert {$level}\">{$string}</div>";
}
/**
* display the global web application footer
*/
private function footer() {
$this->load->view("footer");
}
/**
* given a filename from pt-stalk, find the time part and return the timestamp
*
* @param string $file
* @return int
*/
private function get_timestamp_from_file($file) {
$time_part = substr($file, -26);
//print "$time_part\n<br>";
$format = "%Y_%m_%d_%H_%M_%S.tar.gz";
$time = strptime($time_part, $format);
if (is_array($time)) {
return mktime($time['tm_hour'], $time['tm_min'], $time['tm_sec'], $time['tm_mon'] + 1, $time['tm_mday'], $time['tm_year'] + 1900);
}
return 0;
}
/**
* given a server and name of a sample, allow the user to download the file.
*
* @return int
*/
public function download() {
// ask model for path to file
$server = get_var('server');
$file = get_var('file');
$filename = $this->model->get_collection_filename($server, $file);
// stream file
header('Pragma: public');
header('Expires: 0');
header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
header('Cache-Control: private',false);
header('Content-type: "application/octet-stream"');
header('Content-Disposition: attachment; filename="' . basename($filename) . '";' );
header('Content-Transfer-Encoding: binary');
header('Content-Length: '. filesize($filename) );
ob_clean();
flush();
readfile($filename);
return 0;
}
}
?>
|
{
"content_hash": "133a75999ef394b089b783d89bd6836d",
"timestamp": "",
"source": "github",
"line_count": 486,
"max_line_length": 202,
"avg_line_length": 34.25308641975309,
"alnum_prop": 0.4609839610740674,
"repo_name": "geoffreyanderson/RainGauge",
"id": "6c19f87f0eed63963859f81ff7b34f6fabdc090a",
"size": "16647",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "lib/RainGauge.php",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "JavaScript",
"bytes": "305808"
},
{
"name": "Makefile",
"bytes": "61"
},
{
"name": "PHP",
"bytes": "61087"
},
{
"name": "Puppet",
"bytes": "4109"
},
{
"name": "Ruby",
"bytes": "683"
},
{
"name": "Shell",
"bytes": "62177"
}
],
"symlink_target": ""
}
|
Ti=Structure of the Proceedings
1.sec=A proceeding ordinarily should consist of three phases: the pleading phase, the interim phase, and the final phase.
2.sec=In the pleading phase the parties must present their claims, defenses, and other contentions in writing, and identify their principal evidence.
3.0.sec=In the interim phase the court should if necessary:
3.1.sec=Hold conferences to organize the proceeding;
3.2.sec=Establish the schedule outlining the progress of the proceeding;
3.3.sec=Address the matters appropriate for early attention, such as questions of jurisdiction, provisional measures, and statute of limitations (prescription);
3.4.sec=Address availability, admission, disclosure, and exchange of evidence;
3.5.sec=Identify potentially dispositive issues for early determination of all or part of the dispute; and
3.6.sec=Order the taking of evidence.
3.=[G/Z/ol/s6]
4.sec=In the final phase evidence not already received by the court according to Principle {Phase.3.6.Xnum} ordinarily should be presented in a concentrated final hearing at which the parties should also make their concluding arguments.
=[G/Z/ol/s4]
Comment:
P-9A The concept of “structure” of a proceeding should be applied flexibly, according to the nature of the particular case. For example, if convenient a judge would have discretion to hold a conference in the pleading phase and to hold multiple conferences as the case progresses.
P-9B An orderly schedule facilitates expeditious conduct of the litigation. Discussion between the court and lawyers for the parties facilitates practical scheduling and orderly hearings. See Principle 14.2 and Comment P-14A.
P-9C Traditionally, courts in civil-law systems functioned through a sequence of short hearings, while those in common-law systems organized a proceeding around a final “trial.” However, courts in modern practice in both systems provide for preliminary hearings and civil-law systems have increasingly come to employ a concentrated final hearing for most evidence concerning the merits.
P-9D In common-law systems, a procedure for considering potentially dispositive issues before final hearing is the motion for summary judgment, which can address legal issues, or the issue of whether there is genuine controversy about facts, or both such issues. Civil-law jurisdictions provide for similar procedures in the interim phase.
P-9E In most systems the objection of lack of jurisdiction over the person must be made by the party involved and at an early stage in the proceeding, under penalty of forfeiting the objection. In international litigation it is particularly important that questions of jurisdiction be addressed promptly.
|
{
"content_hash": "61c8e154c82de2d2d31c28e05e9e0eea",
"timestamp": "",
"source": "github",
"line_count": 37,
"max_line_length": 386,
"avg_line_length": 73.10810810810811,
"alnum_prop": 0.8129390018484288,
"repo_name": "CommonAccord/Cmacc-Org",
"id": "c6fbbdebfa329d05f4097e291eb0fb7f5ee47e9d",
"size": "2713",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "Doc/G/ALI-Unidroit-TransnationalRules-CmA/EN/Sec/Phase/0.md",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "4996"
},
{
"name": "HTML",
"bytes": "130299"
},
{
"name": "PHP",
"bytes": "1463"
}
],
"symlink_target": ""
}
|
var assert = chai.assert;
declare function fixture(id: string): void;
declare module HTMLImports {
export function whenReady(f: Function): void;
}
module TF.Nanite {
HTMLImports.whenReady(function() {
Polymer({
is: "test-element",
properties: {
upward: {type: Number, notify: true},
downward: {type: Number},
}
});
});
describe("nanite", () => {
it("value retrieval works", () => {
var store = new Store<number>();
assert.isUndefined(store.value());
store.set(3);
assert.equal(store.value(), 3);
});
it("store value can be set in constructor", () => {
var store = new Store<number>(5);
assert.equal(store.value(), 5);
});
it("store callback called immediately if value is set", () => {
var store = new Store<number>(5);
var signal: number;
var update = (x: number) => signal = x;
store.out(update);
assert.equal(signal, 5);
});
it("store callbacks called on value change", () => {
var signal: number;
var update = (x: number) => signal = x;
var store = new Store<number>();
store.out(update);
store.set(4);
assert.equal(signal, 4);
});
it("map store sets immediately if value set on source store", () => {
var source = new Store<number>(99);
var dest = source.map((x: number) => x + 1);
assert.equal(dest.value(), 100);
});
it("map store updates when source updates", () => {
var source = new Store<number>(0);
var dest = source.map((x: number) => x + 1);
source.set(41);
assert.equal(dest.value(), 42);
});
it("store callbacks can be removed", () => {
var source = new Store<number>(99);
var signal1: number;
var signal2: number;
var update1 = (x: number) => signal1 = x;
var update2 = (x: number) => signal2 = x;
var unbind1 = source.out(update1);
var unbind2 = source.out(update2);
assert.equal(signal1, 99);
assert.equal(signal2, 99);
source.set(98);
assert.equal(signal1, 98);
assert.equal(signal2, 98);
unbind2();
source.set(909);
assert.equal(signal1, 909);
assert.equal(signal2, 98);
unbind2(); // just make sure calling it several times doesn't break things
source.set(100);
assert.equal(signal1, 100);
assert.equal(signal2, 98);
});
it("map3 works as expected", () => {
var s1 = new Store<string>("foo");
var s2 = new Store<string>("bar");
var s3 = new Store<string>();
var combine = function(a: string, b: string, c: string) {
return a + "," + b + "," + c;
};
var sx = map3(combine, s1, s2, s3);
assert.isUndefined(sx.value());
s3.set("zod");
assert.equal(sx.value(), "foo,bar,zod");
});
describe("Nanite polymer tests", function() {
var testElement;
var store;
interface TestElement {
upward: number;
downward: number;
}
beforeEach(function() {
testElement = fixture("testElementFixture");
store = new TF.Nanite.Store();
assert.isUndefined(testElement.downward);
assert.isUndefined(testElement.upward);
assert.isUndefined(store.value());
});
it("downward bind works - basic", function() {
store.bindToPolymer(testElement, "downward", testElement.downward);
store.set(5);
assert.equal(testElement.downward, 5);
store.set(6);
assert.equal(testElement.downward, 6);
});
it("downward bind works - initialization", function() {
store.set(99);
store.bindToPolymer(testElement, "downward", testElement.downward);
assert.equal(testElement.downward, 99);
});
it("upward bind works", function() {
store.bindFromPolymer(testElement, "upward", testElement.upward);
testElement.upward = 42;
assert.equal(store.value(), 42);
});
it("upward bind works - initialization", function() {
testElement.upward = 909;
store.bindFromPolymer(testElement, "upward", testElement.upward);
assert.equal(store.value(), 909);
});
it("upward bind can be unbound", function() {
testElement.upward = 909;
var unbind = store.bindFromPolymer(testElement, "upward", testElement.upward);
assert.equal(store.value(), 909);
unbind();
testElement.upward = 404;
assert.equal(store.value(), 909);
});
it("downward bind can be unbound", function() {
var unbind = store.bindToPolymer(testElement, "downward", testElement.downward);
store.set(200);
assert.equal(store.value(), testElement.downward);
unbind();
store.set(204);
assert.notEqual(store.value(), testElement.downward);
});
});
});
}
|
{
"content_hash": "2dd311a1fd6c0219aae47357c678e5fe",
"timestamp": "",
"source": "github",
"line_count": 156,
"max_line_length": 88,
"avg_line_length": 31.391025641025642,
"alnum_prop": 0.5781090463549111,
"repo_name": "4Quant/tensorflow",
"id": "ecc792944e1675bba1cfda4d2e80e860a1a93d8c",
"size": "5549",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "tensorflow/tensorboard/lib/js/nanite/test/naniteTest.ts",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "C",
"bytes": "151542"
},
{
"name": "C++",
"bytes": "7157767"
},
{
"name": "CMake",
"bytes": "29325"
},
{
"name": "CSS",
"bytes": "107"
},
{
"name": "HTML",
"bytes": "658145"
},
{
"name": "Java",
"bytes": "50361"
},
{
"name": "JavaScript",
"bytes": "16175"
},
{
"name": "Jupyter Notebook",
"bytes": "795383"
},
{
"name": "Objective-C",
"bytes": "1288"
},
{
"name": "Protocol Buffer",
"bytes": "100797"
},
{
"name": "Python",
"bytes": "4006375"
},
{
"name": "Shell",
"bytes": "75494"
},
{
"name": "TypeScript",
"bytes": "329838"
}
],
"symlink_target": ""
}
|
#ifndef _INFOVIEW_H
#define _INFOVIEW_H
#include <Button.h>
#include <View.h>
#include "DialogView.h"
class InfoView : public DialogView {
public:
InfoView(BRect frame, BString title, BString bstr="OK");
virtual ~InfoView();
void AttachedToWindow();
private:
BButton* fBtn;
};
#endif
|
{
"content_hash": "809b48dcb3b2b501599a879488f2d2f6",
"timestamp": "",
"source": "github",
"line_count": 22,
"max_line_length": 60,
"avg_line_length": 13.681818181818182,
"alnum_prop": 0.6976744186046512,
"repo_name": "atalax/hdialog",
"id": "0018b24a018a1e8413364ce287b9d2b9208ffae0",
"size": "1452",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "InfoView.h",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C++",
"bytes": "33638"
},
{
"name": "Makefile",
"bytes": "5048"
}
],
"symlink_target": ""
}
|
<?php
namespace Enhavo\Bundle\SettingBundle\Setting\Type;
use Enhavo\Bundle\FormBundle\Form\Type\CurrencyType;
use Enhavo\Bundle\FormBundle\Formatter\CurrencyFormatter;
use Enhavo\Bundle\SettingBundle\Setting\AbstractSettingType;
use Symfony\Component\OptionsResolver\OptionsResolver;
class CurrencySettingType extends AbstractSettingType
{
/** @var CurrencyFormatter */
private $formatter;
/**
* CurrencySettingType constructor.
* @param CurrencyFormatter $formatter
*/
public function __construct(CurrencyFormatter $formatter)
{
$this->formatter = $formatter;
}
public static function getName(): ?string
{
return 'currency';
}
public function getViewValue(array $options, $value)
{
return $this->formatter->getCurrency((int)$value->getValue(), $options['currency'], $options['view_position']);
}
public static function getParentType(): ?string
{
return IntegerSettingType::class;
}
public function configureOptions(OptionsResolver $resolver)
{
$resolver->setDefaults([
'currency' => 'Euro',
'view_position' => 'right',
'form_type' => CurrencyType::class
]);
}
}
|
{
"content_hash": "7cc0c9f2e814c28e438c408957252f6e",
"timestamp": "",
"source": "github",
"line_count": 47,
"max_line_length": 119,
"avg_line_length": 26.4468085106383,
"alnum_prop": 0.666934835076428,
"repo_name": "gseidel/enhavo",
"id": "1655a2470d5ab6463573601aa9361727f5e3d68e",
"size": "1243",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/Enhavo/Bundle/SettingBundle/Setting/Type/CurrencySettingType.php",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Gherkin",
"bytes": "13143"
},
{
"name": "Handlebars",
"bytes": "670"
},
{
"name": "JavaScript",
"bytes": "119891"
},
{
"name": "PHP",
"bytes": "3307154"
},
{
"name": "SCSS",
"bytes": "154107"
},
{
"name": "Shell",
"bytes": "1479"
},
{
"name": "Twig",
"bytes": "190033"
},
{
"name": "TypeScript",
"bytes": "327523"
},
{
"name": "Vue",
"bytes": "78044"
}
],
"symlink_target": ""
}
|
#ifndef __OPENCV_PRECOMP_H__
#define __OPENCV_PRECOMP_H__
#include <limits>
#include "opencv2/cudaoptflow.hpp"
#include "opencv2/cudaarithm.hpp"
#include "opencv2/cudawarping.hpp"
#include "opencv2/cudaimgproc.hpp"
#include "opencv2/video.hpp"
#include "opencv2/core/private.cuda.hpp"
#include "opencv2/opencv_modules.hpp"
#ifdef HAVE_OPENCV_CUDALEGACY
# include "opencv2/cudalegacy/private.hpp"
#endif
#endif /* __OPENCV_PRECOMP_H__ */
|
{
"content_hash": "b379152ad4d750b6376a8bcfad01f6ba",
"timestamp": "",
"source": "github",
"line_count": 22,
"max_line_length": 43,
"avg_line_length": 20.272727272727273,
"alnum_prop": 0.742152466367713,
"repo_name": "aarya123/Assassin",
"id": "3c818dd4e6b3b488dd1bfac44863075d01426146",
"size": "2601",
"binary": false,
"copies": "8",
"ref": "refs/heads/master",
"path": "server/compare/opencv-cmake/modules/cudaoptflow/precomp.hpp",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "C",
"bytes": "20144"
},
{
"name": "C++",
"bytes": "371455"
},
{
"name": "Java",
"bytes": "30042"
},
{
"name": "PHP",
"bytes": "6773"
}
],
"symlink_target": ""
}
|
package com.conversantmedia.mapreduce.tool.annotation.handler;
import static org.hamcrest.Matchers.equalTo;
import static org.junit.Assert.assertThat;
import static org.junit.Assert.fail;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.times;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
import java.lang.annotation.Annotation;
import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.hbase.client.Scan;
import org.apache.hadoop.hbase.mapreduce.TableInputFormat;
import org.apache.hadoop.mapreduce.Job;
import org.junit.After;
import org.junit.Before;
import org.junit.Ignore;
import org.junit.Test;
import com.conversantmedia.mapreduce.tool.AnnotatedTool;
import com.conversantmedia.mapreduce.tool.AnnotatedToolContext;
import com.conversantmedia.mapreduce.tool.DriverContextBase;
import com.conversantmedia.mapreduce.tool.ToolException;
import com.conversantmedia.mapreduce.tool.annotation.TableInput;
import com.conversantmedia.mapreduce.tool.annotation.handler.TableInputAnnotationHandler;
// FIXME Tests hang since upgrade of hbase/mr
@Ignore
public class TableInputAnnotationHandlerTest {
private static final String TEST_INPUT = "INPUT_TABLE";
TableInputAnnotationHandler handler;
AnnotatedTool tool;
DriverContextBase context;
Job job;
Configuration conf;
@Test
public void testProcessDefaults() {
try {
Annotation annotation = setupDriver(new TableDriverDefaults());
handler.process(annotation, job, null);
verify(job, times(1)).setInputFormatClass(TableInputFormat.class);
assertThat(conf.get(TableInputFormat.INPUT_TABLE), equalTo(TEST_INPUT));
assertThat(conf.get(TableInputFormat.SCAN), equalTo("AgAAAAAAAf//////////AQAAAAAAAAAAAH//////////AQAAAAAAAAAA"));
} catch (ToolException | NoSuchFieldException | SecurityException e) {
e.printStackTrace();
fail(e.getMessage());
}
}
@Test
public void testProcessExplicitTable() {
try {
Annotation annotation = setupDriver(new TableDriverExplicitTable());
handler.process(annotation, job, null);
verify(job, times(1)).setInputFormatClass(TableInputFormat.class);
assertThat(conf.get(TableInputFormat.INPUT_TABLE), equalTo("my_table"));
assertThat(conf.get(TableInputFormat.SCAN), equalTo("AgAAAAAAAf//////////AQAAAAAAAAAAAH//////////AQAAAAAAAAAA"));
} catch (ToolException | NoSuchFieldException | SecurityException e) {
e.printStackTrace();
fail(e.getMessage());
}
}
@Test
public void testProcessCustomScan() {
try {
Annotation annotation = setupDriver(new TableDriverWithScan());
handler.process(annotation, job, null);
verify(job, times(1)).setInputFormatClass(TableInputFormat.class);
assertThat(conf.get(TableInputFormat.INPUT_TABLE), equalTo("test.my_table"));
assertThat(conf.get(TableInputFormat.SCAN), equalTo("AgAAAAAAAv//////////AQAAAAAAAAAAAH//////////AQAAAAAAAAAA"));
} catch (ToolException | NoSuchFieldException | SecurityException e) {
e.printStackTrace();
fail(e.getMessage());
}
}
@Test
public void testConditionalName() {
try {
Annotation annotation = setupDriver(new TableDriverNameExpr());
handler.process(annotation, job, null);
verify(job, times(1)).setInputFormatClass(TableInputFormat.class);
assertThat(conf.get(TableInputFormat.INPUT_TABLE), equalTo("myTable"));
TableDriverNameExpr.PREFIX = "test";
handler.process(annotation, job, null);
assertThat(conf.get(TableInputFormat.INPUT_TABLE), equalTo("test.myTable"));
} catch (ToolException | NoSuchFieldException | SecurityException e) {
e.printStackTrace();
fail(e.getMessage());
}
}
private static final class TableDriverDefaults {
@TableInput
Job job;
}
private static final class TableDriverExplicitTable {
@TableInput(table="my_table")
Job job;
}
private static final class TableDriverWithScan {
@TableInput(table="${prefix + '.my_table'}")
Job job;
@SuppressWarnings("unused")
public Scan getScan() {
return new Scan().setMaxVersions(2);
}
@SuppressWarnings("unused")
public String getPrefix() {
return"test";
}
}
private static final class TableDriverNameExpr {
@TableInput(table="${this.prefix != null? this.prefix + '.' + this.table : this.table}")
Job job;
public static String PREFIX = null;
@SuppressWarnings("unused")
public String getTable() {
return "myTable";
}
@SuppressWarnings("unused")
public String getPrefix() {
return PREFIX;
}
}
@Before
public void setup() {
this.conf = new Configuration();
this.job = mock(Job.class);
this.tool = mock(AnnotatedTool.class);
this.context = mock(DriverContextBase.class);
AnnotatedToolContext annotatedContext = new AnnotatedToolContext(this.context);
when(job.getConfiguration()).thenReturn(conf);
when(tool.getContext()).thenReturn(annotatedContext);
when(this.context.getInput()).thenReturn(TEST_INPUT);
this.handler = new TableInputAnnotationHandler();
this.handler.initialize(tool);
}
public Annotation setupDriver(Object driver) throws NoSuchFieldException, SecurityException {
when(tool.getToolBean()).thenReturn(driver);
return driver.getClass().getDeclaredField("job").getAnnotation(TableInput.class);
}
@After
public void cleanup() {
this.job = null;
this.handler= null;
this.tool = null;
}
}
|
{
"content_hash": "a3b5cca02f7fa1f5f348e3500d5ecf37",
"timestamp": "",
"source": "github",
"line_count": 190,
"max_line_length": 116,
"avg_line_length": 28.13684210526316,
"alnum_prop": 0.7476618032173588,
"repo_name": "conversant/mara",
"id": "9f970c4d297e98a4518e9cc3e2f0e0573cfd5dbd",
"size": "5992",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "core/src/test/java/com/conversantmedia/mapreduce/tool/annotation/handler/TableInputAnnotationHandlerTest.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "AspectJ",
"bytes": "7240"
},
{
"name": "Java",
"bytes": "359054"
}
],
"symlink_target": ""
}
|
#ifndef BAMENUMS_H
#define BAMENUMS_H
#include "pandabase.h"
/**
* This class exists just to provide scoping for the enums shared by BamReader
* and BamWriter.
*/
class EXPCL_PANDA_PUTIL BamEnums {
PUBLISHED:
// This defines an enumerated type used to represent the endianness of
// certain numeric values stored in a Bam file. It really has only two
// possible values, either BE_bigendian or BE_littleendian; but through a
// preprocessor trick we also add BE_native, which is the same numerically
// as whichever value the hardware supports natively.
enum BamEndian {
BE_bigendian = 0,
BE_littleendian = 1,
#ifdef WORDS_BIGENDIAN
BE_native = 0,
#else
BE_native = 1,
#endif
};
/*
* This is the code written along with each object. It is used to control
* object scoping. A BOC_push includes an object definition, and will always
* be eventually paired with a BOC_pop (which does not). A BOC_adjunct
* includes an object definition but does not push the level; it is associated
* with the current level. BOC_remove lists object ID's that have been
* deallocated on the sender end. BOC_file_data may appear at any level and
* indicates the following datagram contains auxiliary file data that may be
* referenced by a later object.
*/
enum BamObjectCode {
BOC_push,
BOC_pop,
BOC_adjunct,
BOC_remove,
BOC_file_data,
};
// This enum is used to control how textures are written to a bam stream.
enum BamTextureMode {
BTM_unchanged,
BTM_fullpath,
BTM_relative,
BTM_basename,
BTM_rawdata
};
};
EXPCL_PANDA_PUTIL ostream &operator << (ostream &out, BamEnums::BamEndian be);
EXPCL_PANDA_PUTIL istream &operator >> (istream &in, BamEnums::BamEndian &be);
EXPCL_PANDA_PUTIL ostream &operator << (ostream &out, BamEnums::BamObjectCode boc);
EXPCL_PANDA_PUTIL ostream &operator << (ostream &out, BamEnums::BamTextureMode btm);
EXPCL_PANDA_PUTIL istream &operator >> (istream &in, BamEnums::BamTextureMode &btm);
#endif
|
{
"content_hash": "445cdd9fdf27592d92f4fd05b73388b7",
"timestamp": "",
"source": "github",
"line_count": 66,
"max_line_length": 84,
"avg_line_length": 30.560606060606062,
"alnum_prop": 0.7183936539414972,
"repo_name": "tobspr/panda3d",
"id": "c2cef20db8ec6604bc9c7296f38b5c89cdca9000",
"size": "2365",
"binary": false,
"copies": "5",
"ref": "refs/heads/master",
"path": "panda/src/putil/bamEnums.h",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "Batchfile",
"bytes": "4004"
},
{
"name": "C",
"bytes": "6724918"
},
{
"name": "C++",
"bytes": "25480688"
},
{
"name": "Emacs Lisp",
"bytes": "229264"
},
{
"name": "Groff",
"bytes": "3106"
},
{
"name": "HTML",
"bytes": "8081"
},
{
"name": "Java",
"bytes": "3113"
},
{
"name": "JavaScript",
"bytes": "7003"
},
{
"name": "Logos",
"bytes": "5504"
},
{
"name": "MAXScript",
"bytes": "1745"
},
{
"name": "NSIS",
"bytes": "92320"
},
{
"name": "Nemerle",
"bytes": "4403"
},
{
"name": "Objective-C",
"bytes": "28865"
},
{
"name": "Objective-C++",
"bytes": "257446"
},
{
"name": "Perl",
"bytes": "206982"
},
{
"name": "Perl6",
"bytes": "30484"
},
{
"name": "Puppet",
"bytes": "2627"
},
{
"name": "Python",
"bytes": "5537773"
},
{
"name": "R",
"bytes": "421"
},
{
"name": "Shell",
"bytes": "55940"
},
{
"name": "Visual Basic",
"bytes": "136"
}
],
"symlink_target": ""
}
|
'use strict';
module.exports = require('./lib/copy');
|
{
"content_hash": "094f91adb7d70dfe1a99dbea6e93f063",
"timestamp": "",
"source": "github",
"line_count": 3,
"max_line_length": 39,
"avg_line_length": 18.333333333333332,
"alnum_prop": 0.6545454545454545,
"repo_name": "hsavit1/gosofi_webpage",
"id": "ea56967aa9bcfac3b5839f8bfbe12077fff9f82e",
"size": "55",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "node_modules/recursive-copy/index.js",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "2768"
},
{
"name": "JavaScript",
"bytes": "14179050"
}
],
"symlink_target": ""
}
|
//
// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.8-b130911.1802
// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
// Any modifications to this file will be lost upon recompilation of the source schema.
// Generated on: 2015.10.21 at 02:36:24 PM CEST
//
package nl.wetten.bwbng.toestand;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlSchemaType;
import javax.xml.bind.annotation.XmlType;
import javax.xml.bind.annotation.adapters.CollapsedStringAdapter;
import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
/**
* <p>Java class for anonymous complex type.
*
* <p>The following schema fragment specifies the expected content contained within this class.
*
* <pre>
* <complexType>
* <complexContent>
* <extension base="{}class.aanhef">
* <attGroup ref="{}attlist.aanhef"/>
* </extension>
* </complexContent>
* </complexType>
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "")
@XmlRootElement(name = "aanhef")
public class Aanhef
extends ClassAanhef
{
@XmlAttribute(name = "id")
@XmlSchemaType(name = "anySimpleType")
protected String id;
@XmlAttribute(name = "status")
protected String status;
@XmlAttribute(name = "terugwerking")
@XmlSchemaType(name = "anySimpleType")
protected String terugwerking;
@XmlAttribute(name = "label-id")
@XmlSchemaType(name = "anySimpleType")
protected String labelId;
@XmlAttribute(name = "stam-id")
@XmlSchemaType(name = "anySimpleType")
protected String stamId;
@XmlAttribute(name = "versie-id")
@XmlSchemaType(name = "anySimpleType")
protected String versieId;
@XmlAttribute(name = "publicatie")
@XmlJavaTypeAdapter(CollapsedStringAdapter.class)
protected String publicatie;
@XmlAttribute(name = "lang", namespace = "http://www.w3.org/XML/1998/namespace")
@XmlJavaTypeAdapter(CollapsedStringAdapter.class)
protected String lang;
/**
* Gets the value of the id property.
*
* @return
* possible object is
* {@link String }
*
*/
public String getId() {
return id;
}
/**
* Sets the value of the id property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setId(String value) {
this.id = value;
}
/**
* Gets the value of the status property.
*
* @return
* possible object is
* {@link String }
*
*/
public String getStatus() {
return status;
}
/**
* Sets the value of the status property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setStatus(String value) {
this.status = value;
}
/**
* Gets the value of the terugwerking property.
*
* @return
* possible object is
* {@link String }
*
*/
public String getTerugwerking() {
return terugwerking;
}
/**
* Sets the value of the terugwerking property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setTerugwerking(String value) {
this.terugwerking = value;
}
/**
* Gets the value of the labelId property.
*
* @return
* possible object is
* {@link String }
*
*/
public String getLabelId() {
return labelId;
}
/**
* Sets the value of the labelId property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setLabelId(String value) {
this.labelId = value;
}
/**
* Gets the value of the stamId property.
*
* @return
* possible object is
* {@link String }
*
*/
public String getStamId() {
return stamId;
}
/**
* Sets the value of the stamId property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setStamId(String value) {
this.stamId = value;
}
/**
* Gets the value of the versieId property.
*
* @return
* possible object is
* {@link String }
*
*/
public String getVersieId() {
return versieId;
}
/**
* Sets the value of the versieId property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setVersieId(String value) {
this.versieId = value;
}
/**
* Gets the value of the publicatie property.
*
* @return
* possible object is
* {@link String }
*
*/
public String getPublicatie() {
return publicatie;
}
/**
* Sets the value of the publicatie property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setPublicatie(String value) {
this.publicatie = value;
}
/**
* Gets the value of the lang property.
*
* @return
* possible object is
* {@link String }
*
*/
public String getLang() {
return lang;
}
/**
* Sets the value of the lang property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setLang(String value) {
this.lang = value;
}
}
|
{
"content_hash": "64e652b08a571dd34496a2682458039f",
"timestamp": "",
"source": "github",
"line_count": 261,
"max_line_length": 122,
"avg_line_length": 22.57088122605364,
"alnum_prop": 0.5615345442199966,
"repo_name": "digitalheir/java-wetten-nl-library",
"id": "d362b1ee15eb3ea3879c0e4e7ca5e37bbab724b7",
"size": "5891",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/main/java/nl/wetten/bwbng/toestand/Aanhef.java",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Java",
"bytes": "1582264"
},
{
"name": "Shell",
"bytes": "267"
}
],
"symlink_target": ""
}
|
'use strict';
const Router = require('express').Router;
const jsonParser = require('body-parser').json();
const createError = require('http-errors');
const debug = require('debug')('turnipVentures:appointment-Route');
const Appointment = require('../model/appointment.js');
const bearerAuth = require('../lib/bear-auth.js');
const appointmentRouter = module.exports = new Router();
appointmentRouter.post('/api/appointments', bearerAuth, jsonParser, function(req, res, next){
debug('POST /api/appointments');
if(!req.body.title)
return next(createError(400, 'requires title'));
new Appointment({
title: req.body.title,
completion:false,
userID: req.user._id.toString(),
appointmentID: req.body.appointmentID,
}).save()
.then(appointment => res.json(appointment))
.catch(next);
});
appointmentRouter.get('/api/appointments/:id', bearerAuth, function(req, res, next){
debug('GET /api/appointments/:id');
Appointment.findOne({
userID: req.user._id.toString(),
_id: req.params.id,
})
.then(appointment => res.json(appointment))
.catch(err => {
if(err) return next(createError(404, 'didn\'t find the appointment'));
});
});
appointmentRouter.delete('/api/appointments/:id', bearerAuth, function(req,res,next){
debug('DELETE /api/appointments/:id');
Appointment.findByIdAndRemove(req.params.id)
.then(() => res.sendStatus(204))
.catch(err => next(createError(404, err.message)));
});
|
{
"content_hash": "219126a7cabdb7d10505be79d4be8cc9",
"timestamp": "",
"source": "github",
"line_count": 43,
"max_line_length": 94,
"avg_line_length": 33.674418604651166,
"alnum_prop": 0.6947513812154696,
"repo_name": "thomasxmartinez/turnipventures",
"id": "25c6684d957721bb261cbc2520a90c6a365f8188",
"size": "1448",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "routes/appointment-route.js",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "JavaScript",
"bytes": "41293"
}
],
"symlink_target": ""
}
|
<?xml version="1.0" encoding="UTF-8"?>
<!-- Author: Wolfgang Meier "meier@ifs.tu-darmstadt.de" -->
<document xmlns:xi="http://www.w3.org/2001/XInclude">
<!-- include header -->
<xi:include href="context://header.xml"/>
<!-- include sidebar -->
<xi:include href="sidebar.xml"/>
<body>
<section title="Library Search Example">
<p>This is a more "real life" example, powered by a single XQuery script.</p>
<p>The sample collection contains 71098 book description (in RDF/XML)
taken from our local university library.</p>
<form action="biblio.xq" method="GET">
<table width="90%" cellpadding="5" cellspacing="0" border="0" bgcolor="#EEEEEE">
<tr bgcolor="#99CCFF">
<th width="20%" align="left">
Search in
</th>
<th width="40%" align="left">
Search what
</th>
<th width="20%" align="left">
Interpret as
</th>
<th width="20%" align="left">
</th>
</tr>
<tr>
<td width="20%" align="left">
<select name="field1" size="1">
<option value="any" selected="true">Any</option>
<option value="au">Creator,Editor</option>
<option value="ti">Title</option>
<option value="ab">Description</option>
<option value="su">Subject</option>
</select>
</td>
<td width="40%" align="left">
<input type="text" name="term1" size="30" />
</td>
<td width="20%" align="left">
<select name="mode1" size="1">
<option value="near">near</option>
<option value="exact">exact match</option>
<option value="contains" selected="true">word list</option>
</select>
</td>
<td width="20%" align="left">
<select name="operator" size="1">
<option value="or" selected="true">or</option>
<option value="and" selected="false">and</option>
</select>
</td>
</tr>
<tr>
<td width="20%" align="left">
<select name="field2" size="1">
<option value="any" selected="true">Any</option>
<option value="au">Creator,Editor</option>
<option value="ti">Title</option>
<option value="ab">Description</option>
<option value="su">Subject</option>
</select>
</td>
<td width="40%" align="left">
<input type="text" name="term2" size="30" />
</td>
<td width="20%" align="left">
<select name="mode2" size="1">
<option value="near">near</option>
<option value="exact">exact match</option>
<option value="contains" selected="true">word list</option>
</select>
</td>
<td width="20%" align="left">
</td>
</tr>
<tr>
<td align="left" valign="center" colspan="3">
<select name="howmany" size="1">
<option>15</option>
<option>30</option>
<option>50</option>
<option>100</option>
</select>
<small>hits will be displayed</small>
</td>
<td align="left">
<input type="submit" />
</td>
</tr>
</table>
</form>
<p><small>You may use wildcards *, ? and character ranges like [a-zA-Z]
for search terms</small></p>
</section>
</body>
</document>
|
{
"content_hash": "018a40f961df5c2916fe2a4eca03e866",
"timestamp": "",
"source": "github",
"line_count": 112,
"max_line_length": 85,
"avg_line_length": 29.017857142857142,
"alnum_prop": 0.5467692307692308,
"repo_name": "mplaine/xformsdb",
"id": "53c09ed553be7da93303e32d83ce1cf88c0a6555",
"size": "3250",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "webapps/thirdparty/exist/web/xquery/biblio.xml",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Batchfile",
"bytes": "7542"
},
{
"name": "CSS",
"bytes": "36155"
},
{
"name": "Java",
"bytes": "1066946"
},
{
"name": "JavaScript",
"bytes": "19671"
},
{
"name": "Shell",
"bytes": "8496"
},
{
"name": "XQuery",
"bytes": "30236"
},
{
"name": "XSLT",
"bytes": "180854"
}
],
"symlink_target": ""
}
|
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Bone Name Enumeration — Leap Motion Unreal SDK v2.3 documentation</title>
<link rel="stylesheet" href="../../cpp/_static/bootstrap-3.0.0/css/documentation-bundle.1439949735.css" type="text/css" />
<script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT: '../',
VERSION: '2.3',
COLLAPSE_INDEX: false,
FILE_SUFFIX: '.html',
HAS_SOURCE: false
};
</script>
<script type="text/javascript" src="../../cpp/_static/bootstrap-3.0.0/js/documentation-bundle.1439949735.js"></script>
<link rel="top" title="Leap Motion Unreal SDK v2.3 documentation" href="../index.html" />
<link rel="up" title="C++ Class Reference" href="Leap_Unreal_Classes.html" />
<link rel="next" title="Hand Name Enumeration" href="Unreal.EnumSide.html" />
<link rel="prev" title="Library functions" href="Unreal.Functions.html" />
<script type="text/javascript" src="/assets/standalone-header.js?r9"></script>
<link rel="stylesheet" href="/assets/standalone-header.css?r9" type="text/css" />
<meta charset='utf-8'>
<meta http-equiv='X-UA-Compatible' content='IE=edge,chrome=1'>
<meta name='viewport' content='width=device-width, initial-scale=1.0, maximum-scale=1'>
<meta name="apple-mobile-web-app-capable" content="yes">
<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-31536531-1']);
_gaq.push(['_setDomainName', 'leapmotion.com']);
_gaq.push(['_trackPageview']);
(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();
</script>
<script>
function getQueryValue(variable)
{
var query = window.location.search.substring(1);
var vars = query.split("&");
for (var i=0;i<vars.length;i++) {
var pair = vars[i].split("=");
if(pair[0] == variable){return pair[1];}
}
return(false);
}
var relPath = "../../";
var requestedAPI = getQueryValue("proglang");
if(requestedAPI == "current") requestedAPI = localStorage["currentAPI"];
var pageAPI = 'unreal';
var hasAPI = {};
hasAPI.unreal = true;
if(requestedAPI && (requestedAPI != pageAPI))
{
if(pageAPI != 'none'){
var redirectedLocation = relPath + 'unreal/unreal/Unreal.EnumBoneName.html';
if( requestedAPI == 'cpp' && hasAPI.cpp){
redirectedLocation = relPath + "cpp/unreal/Unreal.EnumBoneName.html";
}
else if( requestedAPI == 'csharp' && hasAPI.csharp){
redirectedLocation = relPath + "csharp/unreal/Unreal.EnumBoneName.html";
}
else if( requestedAPI == 'unity' && hasAPI.unity){
redirectedLocation = relPath + "unity/unreal/Unreal.EnumBoneName.html";
}
else if( requestedAPI == 'objc' && hasAPI.objc){
redirectedLocation = relPath + "objc/unreal/Unreal.EnumBoneName.html";
}
else if( requestedAPI == 'java' && hasAPI.java) {
redirectedLocation = relPath + "java/unreal/Unreal.EnumBoneName.html";
}
else if( requestedAPI == 'javascript' && hasAPI.javascript){
redirectedLocation = relPath + "javascript/unreal/Unreal.EnumBoneName.html";
}
else if( requestedAPI == 'python' && hasAPI.python){
redirectedLocation = relPath + "python/unreal/Unreal.EnumBoneName.html";
}
else if( requestedAPI == 'unreal' && hasAPI.unreal) {
redirectedLocation = relPath + "unreal/unreal/Unreal.EnumBoneName.html";
} else {
redirectedLocation ="Leap_Unreal_Classes.html";
}
//Guard against redirecting to the same page (infinitely)
if(relPath + 'unreal/unreal/Unreal.EnumBoneName.html' != redirectedLocation) window.location.replace(redirectedLocation);
}
}
</script>
<script>
window.addEventListener('keyup', handleKeyInput);
function handleKeyInput(e)
{
var code;
if (!e) var e = window.event;
if (e.keyCode) code = e.keyCode;
else if (e.which) code = e.which;
var character = String.fromCharCode(code);
if( character == "J" & e.altKey){
window.location.assign("Unreal.Functions.html"); }
else if( character == "K" & e.altKey){
window.location.assign("Unreal.EnumSide.html");
}
}
</script>
</head>
<body role="document">
<div class="developer-portal-styles">
<header class="navbar navbar-static-top developer-navbar header beta-header">
<nav class="container pr">
<a class="logo-link pull-left" href="/">
<img alt="Leap Motion Developers" class="media-object pull-left white-background" src="../_static/logo.png" />
</a>
<span class="inline-block hidden-phone developer-logo-text">
<div class="text">
<a href="/">
<span class="more-than-1199">Developer Portal</span>
</a>
</div>
</span>
<button type="button" class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<!-- Everything within here will be hidden at 940px or less, accessible via a button. -->
<div class="nav-collapse">
<ul class="nav header-navigation developer-links">
<li class="external-link"><a href="https://developer.leapmotion.com/features">What's new</a> </li>
<li class="external-link"><a href="https://developer.leapmotion.com/downloads/skeletal-beta" class="">Getting Started</a></li>
<li><a class="active" href="#" class="">Documentation</a></li>
<li class="external-link"> <a href="https://developer.leapmotion.com/gallery" class="">Examples</a> </li>
<li class="external-link"> <a href="https://www.leapmotion.com/blog/category/labs/" class="" target="_blank">Blog <i class='fa fa-external-link'></i></a> </li>
<li class="external-link"> <a href="https://community.leapmotion.com/category/beta" class="" target="_blank">Community <i class='fa fa-external-link'></i></a> </li>
</ul>
</div>
</nav>
</header>
</div>
<section class="main-wrap">
<div data-swiftype-index="true">
<div class="second_navigation">
<div class="container">
<div class="row">
<div class="col-md-8">
<ul>
<li>
<a href="Leap_Unreal_Classes.html?proglang=current" onclick="localStorage['currentAPI'] = 'javascript'">JavaScript</a>
</li>
<li>
<a href="Leap_Unreal_Classes.html?proglang=current" onclick="localStorage['currentAPI'] = 'unity'">Unity</a>
</li>
<li>
<a href="Leap_Unreal_Classes.html?proglang=current" onclick="localStorage['currentAPI'] = 'csharp'">C#</a>
</li>
<li>
<a href="Leap_Unreal_Classes.html?proglang=current" onclick="localStorage['currentAPI'] = 'cpp'">C++</a>
</li>
<li>
<a href="Leap_Unreal_Classes.html?proglang=current" onclick="localStorage['currentAPI'] = 'java'">Java</a>
</li>
<li>
<a href="Leap_Unreal_Classes.html?proglang=current" onclick="localStorage['currentAPI'] = 'python'">Python</a>
</li>
<li>
<a href="Leap_Unreal_Classes.html?proglang=current" onclick="localStorage['currentAPI'] = 'objc'">Objective-C</a>
</li>
<li>
Unreal
</li>
</ul>
</div>
<div class="col-md-4 search">
<script>
function storeThisPage(){
sessionStorage["pageBeforeSearch"] = window.location;
return true;
}
function doneWithSearch(){
var storedPage = sessionStorage["pageBeforeSearch"];
if(storedPage){
window.location = storedPage;
} else {
window.location = "index.html"; //fallback
}
return false;
}
</script>
<div style="margin-top:-4px">
<ul style="display:inline; white-space:nowrap"><li>
<form class="navbar-form" action="../search.html" method="get" onsubmit="storeThisPage()">
<div class="form-group">
<input type="search" results="5" name="q" class="form-control" placeholder="Search" />
</div>
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form></li>
</ul>
</div>
</div>
</div>
</div>
</div>
<script>
//Remove dev portal header and footer when viewing from file system
if(window.location.protocol == 'file:'){
var navNode = document.querySelector(".developer-links");
navNode.parentNode.removeChild(navNode);
}
</script>
<div id="wrap" data-spy="scroll" data-target="#sidebar">
<div class="container">
<div class="row">
<div class="col-md-9 pull-right">
<!--
<span id="breadcrumbs">
<a href="../index.html">Home</a>»
<a href="Leap_Unreal_Classes.html" accesskey="U">C++ Class Reference</a>»
Bone Name Enumeration
</span> -->
<div class="section" id="bone-name-enumeration">
<h1>Bone Name Enumeration<a class="headerlink" href="#bone-name-enumeration" title="Permalink to this headline">¶</a></h1>
<blockquote>
<div><p><span class="target" id="unreala00021_1ga5e45b98bc66c9eb67c7529e9cedf2100"></span><strong>ELeapBone enum</strong></p>
<blockquote>
<div><p>Enum to define a hand’s bone. </p>
<p>This includes finger bones, palm, and arm. </p>
<p><em>Values:</em></p>
<ul class="breatheenumvalues">
<li><tt class="first docutils literal"><span class="pre">Forearm</span></tt> - <p>The arm bone from elbow to wrist. </p>
</li>
<li><tt class="first docutils literal"><span class="pre">Palm</span></tt> - <p>The central portion of the hand, excluding fingers. </p>
</li>
<li><tt class="first docutils literal"><span class="pre">ThumbBase</span></tt> - <p>The anatomical thumb metacarpal. </p>
</li>
<li><tt class="first docutils literal"><span class="pre">ThumbMiddle</span></tt> - <p>The anatomical thumb proximal phalanx. </p>
</li>
<li><tt class="first docutils literal"><span class="pre">ThumbTip</span></tt> - <p>The anatomical thumb distal phalanx. </p>
</li>
<li><tt class="first docutils literal"><span class="pre">Finger1Base</span></tt> - <p>The anatomical index finger proximal phalanx. </p>
</li>
<li><tt class="first docutils literal"><span class="pre">Finger1Middle</span></tt> - <p>The anatomical index finger intermediate phalanx. </p>
</li>
<li><tt class="first docutils literal"><span class="pre">Finger1Tip</span></tt> - <p>The anatomical index finger distal phalanx. </p>
</li>
<li><tt class="first docutils literal"><span class="pre">Finger2Base</span></tt> - <p>The anatomical middle finger proximal phalanx. </p>
</li>
<li><tt class="first docutils literal"><span class="pre">Finger2Middle</span></tt> - <p>The anatomical middle finger intermediate phalanx. </p>
</li>
<li><tt class="first docutils literal"><span class="pre">Finger2Tip</span></tt> - <p>The anatomical middle finger distal phalanx. </p>
</li>
<li><tt class="first docutils literal"><span class="pre">Finger3Base</span></tt> - <p>The anatomical ring finger proximal phalanx. </p>
</li>
<li><tt class="first docutils literal"><span class="pre">Finger3Middle</span></tt> - <p>The anatomical ring finger intermediate phalanx. </p>
</li>
<li><tt class="first docutils literal"><span class="pre">Finger3Tip</span></tt> - <p>The anatomical ring finger distal phalanx. </p>
</li>
<li><tt class="first docutils literal"><span class="pre">Finger4Base</span></tt> - <p>The anatomical pinky finger proximal phalanx. </p>
</li>
<li><tt class="first docutils literal"><span class="pre">Finger4Middle</span></tt> - <p>The anatomical pink finger intermediate phalanx. </p>
</li>
<li><tt class="first docutils literal"><span class="pre">Finger4Tip</span></tt> - <p>The anatomical pinky finger distal phalanx. </p>
</li>
</ul>
</div></blockquote>
</div></blockquote>
</div>
<!-- get_disqus_sso -->
</div>
<div id="sidebar" class="col-md-3">
<div class="well-sidebar" data-offset-top="188">
<ul>
<li><a href="../index.html" title="Home">Unreal Docs (v2.3)</a></li>
</ul><ul class="current">
<li class="toctree-l1"><a class="reference internal" href="Leap_Unreal_Overview.html">Overview</a></li>
<li class="toctree-l1"><a class="reference internal" href="Leap_Unreal_Using_Plugin.html">Using the Leap Motion Unreal Plugin</a></li>
<li class="toctree-l1"><a class="reference internal" href="Leap_Unreal_CollisionsDemo.html">Tutorial: The Collisions Demo</a></li>
<li class="toctree-l1"><a class="reference internal" href="Leap_Unreal_BP_CustomControllerDemo.html">Tutorial: The Custom Controller Demo</a></li>
<li class="toctree-l1"><a class="reference internal" href="Leap_Unreal_Cpp_Tutorial.html">Tutorial: Using the Leap Motion API in Code</a></li>
<li class="toctree-l1"><a class="reference internal" href="Leap_Unreal_BluePrints.html">Blueprint Reference</a></li>
<li class="toctree-l1 current"><a class="reference internal" href="Leap_Unreal_Classes.html">C++ Class Reference</a><ul class="current">
<li class="toctree-l2"><a class="reference internal" href="Unreal.ControllerDevice.html">Leap Motion Controller Device</a></li>
<li class="toctree-l2"><a class="reference internal" href="Unreal.ControllerActor.html">Leap Motion Controller Actor</a></li>
<li class="toctree-l2"><a class="reference internal" href="Unreal.HandActor.html">Leap Motion Hand Actor</a></li>
<li class="toctree-l2"><a class="reference internal" href="Unreal.HandBoneActor.html">Leap Motion Hand Bone Actor</a></li>
<li class="toctree-l2"><a class="reference internal" href="Unreal.ControllerImageComponent.html">Leap Motion Controller Image Component</a></li>
<li class="toctree-l2"><a class="reference internal" href="Unreal.Functions.html">Library functions</a></li>
<li class="toctree-l2 current"><a class="current reference internal" href="">Bone Name Enumeration</a></li>
<li class="toctree-l2"><a class="reference internal" href="Unreal.EnumSide.html">Hand Name Enumeration</a></li>
<li class="toctree-l2"><a class="reference internal" href="Unreal.ControllerPlugin.html">Leap Motion Controller Plugin</a></li>
<li class="toctree-l2"><a class="reference internal" href="Unreal.Utility.html">Utility functions</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="../devguide/Leap_Guides.html">Application Development</a></li>
<li class="toctree-l1"><a class="reference internal" href="../supplements/Leap_Supplements.html">Appendices</a></li>
</ul>
</div>
</div>
</div>
</div>
</div>
<!--
<footer>
<div id="footer" class="container">
<div class="container">
<div class="copyright">
<span>Copyright © 2012 - 2014, Leap Motion, Inc.</span>
</div>
</div>
</div>
</footer>
</body>
</html>
|
{
"content_hash": "5d90dc2c361d1806ca7e9ccfad23f2c7",
"timestamp": "",
"source": "github",
"line_count": 373,
"max_line_length": 174,
"avg_line_length": 41.75335120643432,
"alnum_prop": 0.6385642737896494,
"repo_name": "joelbandi/Be-ethoven",
"id": "b98d60d24a762dbf1bdb5a7af47646269e29a6f9",
"size": "15578",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "LeapSDK/docs/unreal/unreal/Unreal.EnumBoneName.html",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C#",
"bytes": "6722"
},
{
"name": "C++",
"bytes": "347503"
},
{
"name": "CSS",
"bytes": "101632"
},
{
"name": "HTML",
"bytes": "24938147"
},
{
"name": "Java",
"bytes": "14109"
},
{
"name": "JavaScript",
"bytes": "408159"
},
{
"name": "Makefile",
"bytes": "526"
},
{
"name": "Python",
"bytes": "96203"
}
],
"symlink_target": ""
}
|
<!DOCTYPE html>
<html lang="en">
<head>
<title>CrowdLearn</title>
<meta charset="utf-8">
<meta name="description" content="CrowdLearn">
<meta name="author" content="CrowdLearn">
<meta name="keywords" content="CrowdLearn creative space create build learn learning crowdLearnApp">
<meta name="viewport" content="initial-scale=1.0, maximum-scale=1.0, user-scalable=no, width=device-width">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<link rel="stylesheet" href="release/vendor.min.css">
<link rel="stylesheet" href="assets/css/app.css"/>
<!--
<link rel="stylesheet" href="release/app.min.css">
-->
<style>body{background-color: #F5F5F5;}</style>
</head>
<body ng-app="crowdLearnApp" ng-controller="LayoutController" ng-class="$browser()">
<ion-nav-view></ion-nav-view>
<footer>
<script src="release/vendor.min.js"></script>
<script src="lib/underscore/underscore.js"></script>
<!--
<script src="release/crowdlearn.min.js"></script>
-->
<script src="app.js"></script>
<script src="src/home/home.js"></script>
<script src="src/user/user-module.js"></script>
<script src="src/user/user-config.js"></script>
<script src="src/user/user-factory.js"></script>
<script src="src/user/user-service.js"></script>
<script src="src/contact/form/form.js"></script>
<script src="src/contact/form/form-controller.js"></script>
<script src="src/contact/form/form-directive.js"></script>
<script src="src/contact/contact.js"></script>
<script src="src/layout/layout.js"></script>
<script src="src/layout/header.js"></script>
<script src="src/layout/header-directive.js"></script>
<script src="src/layout/header-button-directive.js"></script>
<script src="src/layout/footer-directive.js"></script>
<script src="src/questions/questions.js"></script>
<script src="src/questions/questions-directive.js"></script>
</footer>
</body>
<!--
<script async src="release/loader.min.js"></script>
-->
</html>
|
{
"content_hash": "9190d12dd959611d87fbc1c1936f2598",
"timestamp": "",
"source": "github",
"line_count": 48,
"max_line_length": 111,
"avg_line_length": 43.166666666666664,
"alnum_prop": 0.6544401544401545,
"repo_name": "sbolel/crowdlearn-angular",
"id": "3c5f51a013e7fe77513ea664a95ae9a5fea1d074",
"size": "2072",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "app/index.html",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "3728"
},
{
"name": "HTML",
"bytes": "12424"
},
{
"name": "JavaScript",
"bytes": "81481"
}
],
"symlink_target": ""
}
|
#ifndef __ST_LARGE_INTEGER__
#define __ST_LARGE_INTEGER__
#include <tommath.h>
#include <st-object.h>
#include <st-types.h>
#define ST_LARGE_INTEGER(oop) ((struct st_large_integer *) st_detag_pointer (oop))
struct st_large_integer
{
struct st_header __parent__;
mp_int value;
};
st_oop st_large_integer_new (mp_int * value);
st_oop st_large_integer_new_from_smi (int integer);
st_oop st_large_integer_new_from_string (const char *string, st_uint radix);
char *st_large_integer_to_string (st_oop integer, st_uint radix);
st_oop st_large_integer_allocate (st_oop class, mp_int *value);
/* inline definitions */
static inline mp_int *
st_large_integer_value (st_oop integer)
{
return & ST_LARGE_INTEGER (integer)->value;
}
#endif /* __ST_LARGE_INTEGER */
|
{
"content_hash": "204e7e1563023fe54d31d703029ac6e2",
"timestamp": "",
"source": "github",
"line_count": 37,
"max_line_length": 82,
"avg_line_length": 21.945945945945947,
"alnum_prop": 0.6613300492610837,
"repo_name": "vgeddes/panda-smalltalk",
"id": "048aae349f1c3b2881b7987fdad29b64a6f93322",
"size": "1956",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/st-large-integer.h",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C",
"bytes": "969204"
},
{
"name": "C++",
"bytes": "5427"
},
{
"name": "Emacs Lisp",
"bytes": "4218"
},
{
"name": "Objective-C",
"bytes": "15707"
},
{
"name": "Shell",
"bytes": "273"
},
{
"name": "Smalltalk",
"bytes": "98648"
}
],
"symlink_target": ""
}
|
function in-string()
{
local string=$(get-by-varname $1)
local substring=$2
echo $string |grep -q "$substring"
return $?
}
function push-word()
{
local string_name=$1
local string_val=$(get-by-varname $string_name)
shift
local str_to_add="$*"
if ! in-string $string_name $str_to_add; then
set-by-varname $string_name "$string_val $str_to_add"
return 0
else
return 1
fi
}
function pop-word()
{
local string_name=$1
local string_val=$(get-by-varname $string_name)
local str_to_pop=$2
if [ ! -z "$str_to_pop" ]; then
if in-string $string_name $str_to_pop; then
local new_str=$(echo $string_val |sed -e "s/$str_to_pop//g" -e "s/ / /g")
set-by-varname $string_name "$new_str"
return 0
else
return 1
fi
else
local popped_element=$(echo $string_val |sed -e 's/^.* \(.*\)$/\1/')
local rest=$(echo $string_val |sed -e 's/ [^ ]*$//')
set-by-varname $string_name "$rest"
echo $popped_element
return 0
fi
}
function join()
{
local separator="$1"; shift
local -a args=($@)
local regex="$(printf -- "${separator}%s" "${args[@]}")"
regex="${regex:${#separator}}"
echo "${regex}"
}
|
{
"content_hash": "7c29ba72feda2b627a614fec0084e3e8",
"timestamp": "",
"source": "github",
"line_count": 56,
"max_line_length": 77,
"avg_line_length": 20.5,
"alnum_prop": 0.6088850174216028,
"repo_name": "jtgans/dotbash",
"id": "03cfb9dceba15458b083bcbfb1ef8b541fae4dee",
"size": "1162",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "lib/strings.sh",
"mode": "33188",
"license": "bsd-2-clause",
"language": [
{
"name": "Shell",
"bytes": "60304"
}
],
"symlink_target": ""
}
|
package io.github.mathmaniac0.snek.sprite.behaviors;
import io.github.mathmaniac0.snek.Game;
import io.github.mathmaniac0.snek.PlayerEvents;
import io.github.mathmaniac0.snek.sprite.NPC;
import io.github.mathmaniac0.snek.sprite.Sprite;
import java.awt.*;
public class AIScrolling implements AIBehavior {
private static final int frameSpeed = Game.FPS / 4;
private static int count = 0;
private final NPC sprite;
private final Direction direction;
private int nextMove = 0;
private int speed;
public AIScrolling(NPC sprite, Direction direction, int speed) {
count++;
this.sprite = sprite;
this.direction = direction;
this.speed = (count % 2 == 0) ? speed : -speed;
}
public AIScrolling(NPC sprite, Direction direction) {
this(sprite, direction, 1);
}
public AIScrolling(NPC sprite) {
this(sprite, Direction.VERTICAL);
}
@Override
public void logic(PlayerEvents playerEvents) {
if (++nextMove < frameSpeed)
return;
nextMove = 0;
sprite.move(new Point(direction.x * speed, direction.y * speed));
for (Sprite s : sprite.getGameField().getLevel().getSprites())
if (!s.equals(sprite) && s.intersects(sprite)) {
speed = -speed;
sprite.move(new Point(direction.x * speed * 2, direction.y * speed * 2));
}
}
}
|
{
"content_hash": "f38c21d8f28690cb40064dc3c59ba798",
"timestamp": "",
"source": "github",
"line_count": 50,
"max_line_length": 89,
"avg_line_length": 29.42,
"alnum_prop": 0.6152277362338545,
"repo_name": "MathManiac0/Snek-Adventure",
"id": "504474de924eaab08fcb0aadfcfa032f04d625d1",
"size": "1471",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/io/github/mathmaniac0/snek/sprite/behaviors/AIScrolling.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Java",
"bytes": "6330"
}
],
"symlink_target": ""
}
|
Dart scoreboard JavaFX application
This application requires a real dartboard to throw your darts at.
The application is used for score counting and optional bets and jackpots :)
Please note that the first time you start the game you will get warnings about missing files, no worries, files will be created for you.
|
{
"content_hash": "5671a831d9dc67441881e226bbf6c63f",
"timestamp": "",
"source": "github",
"line_count": 7,
"max_line_length": 136,
"avg_line_length": 45.57142857142857,
"alnum_prop": 0.8056426332288401,
"repo_name": "linusblom/Dart2",
"id": "4aca837d6edc7f0806397d96b001725d65dc2455",
"size": "327",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "README.md",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "3661"
},
{
"name": "Java",
"bytes": "100234"
}
],
"symlink_target": ""
}
|
FROM node:6-slim
|
{
"content_hash": "b2df3b439bffa8f6247c3bddf51bda35",
"timestamp": "",
"source": "github",
"line_count": 1,
"max_line_length": 16,
"avg_line_length": 17,
"alnum_prop": 0.7647058823529411,
"repo_name": "seegno/docker-node",
"id": "0fc04bd8663e34c91c90a679a7f0e1c121435539",
"size": "17",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "test/6/slim/Dockerfile",
"mode": "33188",
"license": "mit",
"language": [],
"symlink_target": ""
}
|
import settings
import generator
from reportlab.pdfgen import canvas
def hello(c):
c.drawString(100, 100, "Hello")
def main():
c = canvas.Canvas("hello.pdf")
hello(c)
c.showPage()
c.save()
if __name__ == '__main__':
main()
|
{
"content_hash": "988c59c45de712f0b6e0e68eb5ca1686",
"timestamp": "",
"source": "github",
"line_count": 19,
"max_line_length": 35,
"avg_line_length": 13.368421052631579,
"alnum_prop": 0.6023622047244095,
"repo_name": "kwailamchan/programming-languages",
"id": "c022b8a407c0053cf274a577f6afee2e9cd8726b",
"size": "254",
"binary": false,
"copies": "3",
"ref": "refs/heads/master",
"path": "python/reportlab/canvas.py",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Assembly",
"bytes": "2321"
},
{
"name": "Batchfile",
"bytes": "7087"
},
{
"name": "C",
"bytes": "2883116"
},
{
"name": "C++",
"bytes": "12948373"
},
{
"name": "CMake",
"bytes": "128629"
},
{
"name": "CSS",
"bytes": "197791"
},
{
"name": "Cuda",
"bytes": "687316"
},
{
"name": "E",
"bytes": "2914"
},
{
"name": "Eiffel",
"bytes": "1073"
},
{
"name": "Fortran",
"bytes": "1332263"
},
{
"name": "HTML",
"bytes": "257547"
},
{
"name": "Java",
"bytes": "102661"
},
{
"name": "JavaScript",
"bytes": "439019"
},
{
"name": "Jupyter Notebook",
"bytes": "5488542"
},
{
"name": "Makefile",
"bytes": "24949"
},
{
"name": "Matlab",
"bytes": "32307"
},
{
"name": "PHP",
"bytes": "21650"
},
{
"name": "PLpgSQL",
"bytes": "16859"
},
{
"name": "Python",
"bytes": "5424664"
},
{
"name": "QMake",
"bytes": "787"
},
{
"name": "R",
"bytes": "105611"
},
{
"name": "Ruby",
"bytes": "152074"
},
{
"name": "SAS",
"bytes": "4505"
},
{
"name": "Scala",
"bytes": "6121"
},
{
"name": "Shell",
"bytes": "49387"
},
{
"name": "Visual Basic",
"bytes": "1174"
}
],
"symlink_target": ""
}
|
using System;
using System.Collections.Generic;
using Dwolla.Checkout.Validators;
using FluentValidation;
using FluentValidation.Attributes;
using Newtonsoft.Json;
using Newtonsoft.Json.Converters;
using Newtonsoft.Json.Linq;
namespace Dwolla.Checkout
{
[Validator(typeof(DwollaCheckoutResponseValidator))]
public class DwollaCheckoutResponse
{
public bool Success { get; set; }
/// <summary>The error message if the Result is a Failure.</summary>
public string Message { get; set; }
/// <summary>The CheckoutId generated by Dwolla used for a URL redirect.</summary>
public string CheckoutId
{
get
{
JToken response;
if( this.AdditionalData.TryGetValue("Response", out response ) )
{
return (response as JObject)?.Property("CheckoutId")?.Value?.Value<string>();
}
return null;
}
}
[JsonExtensionData]
public IDictionary<string, JToken> AdditionalData { get; set; }
/// <summary>Returns the URL for the customer's browser to complete the checkout process.</summary>
public string GetRedirectUrl()
{
return DwollaServerCheckoutApi.CheckoutUrl.Replace( "{CheckoutId}", this.CheckoutId );
}
public DwollaCheckoutResponse()
{
this.AdditionalData = new Dictionary<string, JToken>();
}
}
}
|
{
"content_hash": "52ab4a524fe9c7c8544d4a031c1aff5c",
"timestamp": "",
"source": "github",
"line_count": 50,
"max_line_length": 107,
"avg_line_length": 30.86,
"alnum_prop": 0.5975372650680493,
"repo_name": "bchavez/Dwolla",
"id": "6fc966103b18893db8821ffb3966de3f6396727e",
"size": "1543",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "source/Dwolla.Checkout/DwollaCheckoutResponse.cs",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Batchfile",
"bytes": "284"
},
{
"name": "C#",
"bytes": "83825"
},
{
"name": "F#",
"bytes": "16255"
}
],
"symlink_target": ""
}
|
package org.openehealth.ipf.commons.ihe.xacml20.stub.saml20.protocol;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlType;
/**
* <p>Java class for TerminateType complex type.
*
* <p>The following schema fragment specifies the expected content contained within this class.
*
* <pre>
* <complexType name="TerminateType">
* <complexContent>
* <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* </restriction>
* </complexContent>
* </complexType>
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "TerminateType")
public class TerminateType {
}
|
{
"content_hash": "7f624ead99e149769a95f93f9a853aa7",
"timestamp": "",
"source": "github",
"line_count": 31,
"max_line_length": 95,
"avg_line_length": 23.741935483870968,
"alnum_prop": 0.71875,
"repo_name": "oehf/ipf",
"id": "854c3ba6cdcd6d70d7f43aa23e18c27954b90c13",
"size": "1350",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "commons/ihe/xacml20/impl/src/main/java/org/openehealth/ipf/commons/ihe/xacml20/stub/saml20/protocol/TerminateType.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Batchfile",
"bytes": "2381"
},
{
"name": "Groovy",
"bytes": "1232218"
},
{
"name": "HTML",
"bytes": "11417"
},
{
"name": "Java",
"bytes": "6734450"
},
{
"name": "Kotlin",
"bytes": "87953"
},
{
"name": "Shell",
"bytes": "553"
},
{
"name": "XQuery",
"bytes": "15044"
},
{
"name": "XSLT",
"bytes": "567639"
}
],
"symlink_target": ""
}
|
<!DOCTYPE HTML>
<html lang="en">
<head>
<title>three.js - geometry - earth</title>
<meta charset="utf-8">
<style type="text/css">
body {
color: #808080;
font-family:Monospace;
font-size:13px;
text-align:center;
background-color: #ffffff;
margin: 0px;
overflow: hidden;
}
#info {
position: absolute;
top: 0px; width: 100%;
padding: 5px;
}
a {
color: #0080ff;
}
</style>
</head>
<body>
<div id="container"></div>
<div id="info"><a href="http://github.com/mrdoob/three.js" target="_blank">three.js</a> - earth demo</div>
<script type="text/javascript" src="js/Stats.js"></script>
<script type="text/javascript" src="../build/Three.js"></script>
<script type="text/javascript" src="../src/extras/primitives/Plane.js"></script>
<script type="text/javascript" src="../src/extras/primitives/Sphere.js"></script>
<script type="text/javascript">
var container, stats;
var camera, scene, renderer;
var mesh;
var mouseX = 0;
var mouseY = 0;
var windowHalfX = window.innerWidth / 2;
var windowHalfY = window.innerHeight / 2;
init();
setInterval( loop, 1000 / 60 );
function init() {
container = document.getElementById( 'container' );
camera = new THREE.Camera( 60, window.innerWidth / window.innerHeight, 1, 10000 );
camera.position.z = 500;
scene = new THREE.Scene();
mesh = new THREE.Mesh( new Plane( 300, 300, 3, 3 ), loadImage( 'textures/shadow.png' ) );
mesh.position.y = - 250;
mesh.rotation.x = - 90 * Math.PI / 180;
scene.addObject(mesh);
mesh = new THREE.Mesh( new Sphere( 200, 20, 20 ), loadImage( 'textures/land_ocean_ice_cloud_2048.jpg' ) );
mesh.overdraw = true;
scene.addObject(mesh);
renderer = new THREE.CanvasRenderer();
renderer.setSize( window.innerWidth, window.innerHeight );
container.appendChild( renderer.domElement );
stats = new Stats();
stats.domElement.style.position = 'absolute';
stats.domElement.style.top = '0px';
container.appendChild( stats.domElement );
document.addEventListener( 'mousemove', onDocumentMouseMove, false );
}
function loadImage( path ) {
var canvas = document.createElement( 'canvas' );
canvas.width = 32;
canvas.height = 32;
var material = new THREE.MeshBasicMaterial( { map: new THREE.Texture( canvas, THREE.UVMapping ) } );
var image = new Image();
image.onload = function () {
material.map.image = this;
};
image.src = path;
return material;
}
function onDocumentMouseMove( event ) {
mouseX = ( event.clientX - windowHalfX );
mouseY = ( event.clientY - windowHalfY );
}
function loop() {
camera.position.x += ( mouseX - camera.position.x ) * 0.05;
camera.position.y += ( - mouseY - camera.position.y ) * 0.05;
mesh.rotation.y -= 0.005;
renderer.render( scene, camera );
stats.update();
}
</script>
</body>
</html>
|
{
"content_hash": "48245fd4ba0679646082d1ea9ac1fedf",
"timestamp": "",
"source": "github",
"line_count": 139,
"max_line_length": 110,
"avg_line_length": 21.56115107913669,
"alnum_prop": 0.6249582916249583,
"repo_name": "flyingoctopus/three.js",
"id": "435c41e9fd4dc17697aeb9b07a891b404adc9201",
"size": "2997",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "examples/geometry_earth.html",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "JavaScript",
"bytes": "6707195"
},
{
"name": "Python",
"bytes": "216837"
},
{
"name": "Shell",
"bytes": "77"
}
],
"symlink_target": ""
}
|
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.42000
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace NavigatorToolTips.Properties {
using System;
/// <summary>
/// A strongly-typed resource class, for looking up localized strings, etc.
/// </summary>
// This class was auto-generated by the StronglyTypedResourceBuilder
// class via a tool like ResGen or Visual Studio.
// To add or remove a member, edit your .ResX file then rerun ResGen
// with the /str option, or rebuild your VS project.
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "15.0.0.0")]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
internal class Resources {
private static global::System.Resources.ResourceManager resourceMan;
private static global::System.Globalization.CultureInfo resourceCulture;
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
internal Resources() {
}
/// <summary>
/// Returns the cached ResourceManager instance used by this class.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Resources.ResourceManager ResourceManager {
get {
if (object.ReferenceEquals(resourceMan, null)) {
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("NavigatorToolTips.Properties.Resources", typeof(Resources).Assembly);
resourceMan = temp;
}
return resourceMan;
}
}
/// <summary>
/// Overrides the current thread's CurrentUICulture property for all
/// resource lookups using this strongly typed resource class.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Globalization.CultureInfo Culture {
get {
return resourceCulture;
}
set {
resourceCulture = value;
}
}
}
}
|
{
"content_hash": "6a3546f26bcac5e9e7db35385f8730a7",
"timestamp": "",
"source": "github",
"line_count": 63,
"max_line_length": 183,
"avg_line_length": 44.41269841269841,
"alnum_prop": 0.6150822015725518,
"repo_name": "ComponentFactory/Krypton",
"id": "d66fcf1b27ff125e4debbfbcc8c003014fd4fbb9",
"size": "2800",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "Source/Krypton Navigator Examples/Navigator ToolTips/Properties/Resources.Designer.cs",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "C#",
"bytes": "19637203"
}
],
"symlink_target": ""
}
|
/**
* Main JS file for kaldorei behaviours
*/
/* globals jQuery, document */
(function($, undefined) {
"use strict";
var $document = $(document);
$document.ready(function() {
var $postContent = $(".post-content");
$postContent.fitVids();
$(".scroll-down").arctic_scroll();
$(".menu-button, .nav-cover, .nav-close").on("click", function(e) {
e.preventDefault();
$("body").toggleClass("nav-opened nav-closed");
});
$(window).scroll(function() {
var scrollerToTop = $('.backTop');
var scrollerTOC = $('.widget-toc');
document.documentElement.scrollTop + document.body.scrollTop > 200 ?
scrollerToTop.fadeIn() :
scrollerToTop.fadeOut();
document.documentElement.scrollTop + document.body.scrollTop > 250 ?
scrollerTOC.addClass("widget-toc-fixed") :
scrollerTOC.removeClass("widget-toc-fixed");
});
// #backTop Button Event
$("#backTop").on("click", function() {
scrollToTop();
});
// highlight config
hljs.initHighlightingOnLoad();
// numbering for pre>code blocks
$(function() {
$('pre code').each(function() {
var lines = $(this).text().split('\n').length - 1;
var $numbering = $('<ul/>').addClass('pre-numbering');
$(this).addClass('has-numbering').parent().append($numbering);
for (var i = 1; i <= lines; i++) {
$numbering.append($('<li/>').text(i));
}
});
});
var toc = $('.toc');
// toc config
toc.toc({
content: ".post-content",
headings: "h2,h3,h4,h5"
});
if (toc.children().length == 0) $(".widget-toc").hide();
var tocHieght = toc.height();
var tocFixedHeight = $(window).height() - 192;
tocHieght > tocFixedHeight ?
toc.css('height', tocFixedHeight) :
toc.css('height', tocHieght)
$(window).resize(function() {
var tocFixedHeight = $(this).height() - 192;
tocHieght > tocFixedHeight ?
toc.css('height', tocFixedHeight) :
toc.css('height', tocHieght)
})
// toc animate effect
// bind click event to all internal page anchors
$('a.data-scroll').on('click', function(e) {
// prevent default action and bubbling
e.preventDefault();
e.stopPropagation();
// set target to anchor's "href" attribute
// Thanks to @https://github.com/xiongchengqing fixed this bug.
var target = document.getElementById($(this).attr('href').split('#')[1]);
console.log(target);
// scroll to each target
$(target).velocity('scroll', {
duration: 500,
easing: 'ease-in-out'
//easing: 'spring'
});
});
// tooltip config
$('[data-rel=tooltip]').tooltip();
// fancybox 3.1.25 config
$('.post-content a:has(img)').addClass('fancybox');
$(".fancybox").attr('data-fancybox', 'images').fancybox({
selector : '[data-fancybox="images"]',
loop : true,
slidesToShow : 3,
slidesToScroll : 3,
infinite : true
});
// add archives year
var yearArray = new Array();
$(".archives-item").each(function() {
var archivesYear = $(this).attr("date");
yearArray.push(archivesYear);
});
var uniqueYear = $.unique(yearArray);
for (var i = 0; i < uniqueYear.length; i++) {
var html = "<div class='archives-item fadeInDown animated'>" +
"<div class='archives-year'>" +
"<h3><time datetime='" + uniqueYear[i] + "'>" + uniqueYear[i] + "</time></h3>" +
"</div></div>";
$("[date='" + uniqueYear[i] + "']:first").before(html);
}
});
// Arctic Scroll by Paul Adam Davis
// https://github.com/PaulAdamDavis/Arctic-Scroll
$.fn.arctic_scroll = function(options) {
var defaults = {
elem: $(this),
speed: 500
},
allOptions = $.extend(defaults, options);
allOptions.elem.click(function(event) {
event.preventDefault();
var $this = $(this),
$htmlBody = $('html, body'),
offset = ($this.attr('data-offset')) ? $this.attr('data-offset') : false,
position = ($this.attr('data-position')) ? $this.attr('data-position') : false,
toMove;
if (offset) {
toMove = parseInt(offset);
$htmlBody.stop(true, false).animate({
scrollTop: ($(this.hash).offset().top + toMove)
}, allOptions.speed);
} else if (position) {
toMove = parseInt(position);
$htmlBody.stop(true, false).animate({
scrollTop: toMove
}, allOptions.speed);
} else {
$htmlBody.stop(true, false).animate({
scrollTop: ($(this.hash).offset().top)
}, allOptions.speed);
}
});
};
})(jQuery);
function scrollToTop(name, speed) {
if (!speed) speed = 300
if (!name) {
$('html,body').animate({
scrollTop: 0
}, speed)
} else {
if ($(name).length > 0) {
$('html,body').animate({
scrollTop: $(name).offset().top
}, speed)
}
}
}
|
{
"content_hash": "b6fae10e7cabaf6e3383558439f95b4f",
"timestamp": "",
"source": "github",
"line_count": 172,
"max_line_length": 96,
"avg_line_length": 33.77906976744186,
"alnum_prop": 0.4822719449225473,
"repo_name": "enhay/Ghost",
"id": "d66add8aefeaf883151ff7b199cd8be3d4ffcd83",
"size": "5810",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "themes/kaldorei/assets/js/index.js",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "371565"
},
{
"name": "HTML",
"bytes": "365247"
},
{
"name": "JavaScript",
"bytes": "3668963"
},
{
"name": "XSLT",
"bytes": "7177"
}
],
"symlink_target": ""
}
|
quadrupy
========
python app to control a quadruped robot controlled with an arduino
|
{
"content_hash": "0837103e1dc6154b771a6b805c3021b4",
"timestamp": "",
"source": "github",
"line_count": 4,
"max_line_length": 66,
"avg_line_length": 21.5,
"alnum_prop": 0.7441860465116279,
"repo_name": "titimoby/quadrupy",
"id": "09fd96863a9e1356b88348271c566afb6cca7afc",
"size": "86",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "README.md",
"mode": "33188",
"license": "mit",
"language": [],
"symlink_target": ""
}
|
<?php
namespace Examinr\Form\Implementation;
use Examinr\Form\AbstractForm;
/**
* Login form
*
* @category Examinr
* @package Form
* @subpackage Implementation
* @author Pieter Hordijk <info@pieterhordijk.com>
*/
class Login extends AbstractForm
{
/**
* Sets up the fields of the form
*/
protected function setupFields()
{
$this->fieldset->addField('email', 'text', [
'required' => true,
'type' => 'email',
]);
$this->fieldset->addField('password', 'password', [
'required' => true,
]);
$this->fieldset->addField('rememberme', 'rememberme', [
]);
}
}
|
{
"content_hash": "fb912cabb2ecf7650562076535c27eb2",
"timestamp": "",
"source": "github",
"line_count": 34,
"max_line_length": 63,
"avg_line_length": 20.176470588235293,
"alnum_prop": 0.5539358600583091,
"repo_name": "PeeHaa/examinr",
"id": "6f175ab3669121042e0998a4638cfc276ad3cc67",
"size": "994",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/Form/Implementation/Login.php",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "HTML",
"bytes": "88182"
},
{
"name": "JavaScript",
"bytes": "68"
},
{
"name": "PHP",
"bytes": "165814"
}
],
"symlink_target": ""
}
|
require 'test_helper'
class ReportsControllerTest < ActionController::TestCase
setup do
Report.delete_all
end
context "when the user is not authenticated" do
setup do
@report = FactoryGirl.create(:report)
end
should "not have access to the index page" do
get :index
assert_response :unauthorized
end
should "not have access to the show page" do
get :show, id: @report.id
assert_response :unauthorized
end
should "not have access to the creation method" do
post :create, report: {title: "title for report"}
assert_response :unauthorized
end
should "not have access to the create jira ticket method" do
post :create_jira_issue, report_id: @report.id
assert_response :unauthorized
end
end
context "when the user is authenticated" do
setup do
http_login
end
context "when requesting reports" do
Report::STATUS.keys.each do |status|
context "for status #{status}" do
setup do
@report = FactoryGirl.create(:report, status: Report::STATUS[status])
get :index, scope: status
end
should "be a success" do
assert_response :success
end
should "get one report" do
reports = assigns(:reports)
assert_equal 1, reports.size
end
end
end
end
context "when requesting archived reports" do
setup do
FactoryGirl.create(:report, status: Report::STATUS[:new])
FactoryGirl.create(:report, status: Report::STATUS[:available_on_next_build])
get :index, scope: :archived
end
context "but there is no archived report" do
should "be a success" do
assert_response :success
end
should "get zero report" do
reports = assigns(:reports)
assert_equal 0, reports.size
end
end
context "and two of all the reports are archived" do
setup do
2.times {FactoryGirl.create(:report, status: Report::STATUS[:archived])}
end
should "be a success" do
assert_response :success
end
should "get zero report" do
reports = assigns(:reports)
assert_equal 2, reports.size
end
end
end
context "and ask for the show view of a report" do
setup do
@report = FactoryGirl.create(:report)
get :show, id: @report.id
end
should "have a success" do
assert_response :success
end
should "see the right report" do
report = assigns(:report)
assert_equal @report.id, report.id
end
end
context "and want to update the status of the report" do
setup do
@report = FactoryGirl.create(:report)
end
context "and the current status has a next step" do
setup do
put :update_status, report_id: @report.id
end
should "get a redirect" do
assert_response :found
end
should "update the status by 1" do
assert_equal @report.status+1, Report.find(@report.id).status
end
end
context "and the current status is the last status available" do
setup do
@report.update_attributes(status: Report::STATUS[:archived])
put :update_status, report_id: @report.id
end
should "get a redirect" do
assert_response :success
end
should "not update the report" do
assert_equal @report.status, Report.find(@report.id).status
end
end
end
context "and try to create a report through the JSON API" do
context "and provide a good set of params" do
setup do
@report_params = {
title: "a title",
message: "a message",
logs: "some logs",
crash_logs: "some crash logs"
}
post :create, report: @report_params, format: :json
end
should "get a created response" do
assert_response :created
end
should "get back a JSON representation of the report" do
report = JSON.parse @response.body
assert_not_nil report
assert_equal @report_params[:title], report['title']
assert_equal @report_params[:message], report['message']
assert_equal @report_params[:logs], report['logs']
assert_equal @report_params[:crash_logs], report['crash_logs']
end
end
context "and an no param is provided" do
setup do
post :create, report: {}, format: :json
end
should "get an unprocessable entity response" do
assert_response :unprocessable_entity
end
end
end
context "and declare a new build is available" do
setup do
@version = "1.0"
@request.env['HTTP_REFERER'] = 'http://example.com/'
end
context "and we have at least one report waiting for a new build" do
setup do
FactoryGirl.create(:report, status: Report::STATUS[:available_on_next_build])
end
should "get a redirection" do
put :new_build, version: @version
assert_response :found
end
should "get a notice message" do
put :new_build, version: @version
assert_not_nil flash[:notice]
end
should "add a new report ready to be tested" do
assert_difference 'Report.ready_to_test.count' do
put :new_build, version: @version
end
end
end
context "and no report is waiting for a new build to be tested" do
setup do
assert_equal 0, Report.available_on_next_build.count
end
should "get a redirection" do
put :new_build, version: @version
assert_response :found
end
should "get a alert message" do
put :new_build, version: @version
assert_not_nil flash[:alert]
end
should "not have a new report ready for tests" do
assert_no_difference 'Report.ready_to_test.count' do
put :new_build, version: @version
end
end
should "have a count set to zero" do
put :new_build, version: @version
assert_equal 0, assigns(:count)
end
end
end
context "and wants to create a jira ticket for a report" do
setup do
@report = FactoryGirl.create(:report)
end
context "but jira isn't configured" do
setup do
Jira::Client.stubs(:default_client).returns(nil)
post :create_jira_issue, report_id: @report.id
end
should "get an alert message" do
assert_not_nil flash[:alert]
end
should "get a redirect" do
assert_response :found
end
end
context ", jira is configured" do
setup do
Jira::Client.stubs(:default_client).returns(Jira::Client.new("http://example.com", "myusername", "mypassword"))
end
context "but the jira instance is not reachable (host, username, or password issue)" do
setup do
Jira::Client.any_instance.stubs(:status).returns(403)
post :create_jira_issue, report_id: @report.id
end
should "get an alert message" do
assert_not_nil flash[:alert]
end
should "get a redirect" do
assert_response :found
end
end
context "and the jira client is connected" do
setup do
Jira::Client.any_instance.stubs(:status).returns(200)
Setting.any_instance.stubs(:get).returns("aValue")
end
context "but Jira returned and error during the creation of the ticket" do
setup do
stub_request(:post, "http://myusername:mypassword@example.com/rest/api/2/issue/").to_return(:status => [401, "Forbidden"])
post :create_jira_issue, report_id: @report.id
end
should "get an alert message" do
assert_not_nil flash[:alert]
end
should "get a redirect" do
assert_response :found
end
end
context "and jira successfuly created the issue" do
setup do
Jira::Client.any_instance.stubs(:post_request).returns("www.jiraticket.com")
end
context "and the report saved the jira ticket url" do
setup do
post :create_jira_issue, report_id: @report.id
end
should "get an notice message" do
assert_not_nil flash[:notice]
end
should "get a redirect" do
assert_response :found
end
end
context "but the report didn't update the jira ticket url" do
setup do
Report.any_instance.stubs(:jira_ticket).returns(nil)
post :create_jira_issue, report_id: @report.id
end
should "get an alert message" do
assert_not_nil flash[:alert]
end
should "get a redirect" do
assert_response :found
end
end
end
end
end
end
end
def http_login
user = ENV['SR_USERNAME']
pw = ENV['SR_PASSWORD']
request.env['HTTP_AUTHORIZATION'] = ActionController::HttpAuthentication::Basic.encode_credentials(user,pw)
end
end
|
{
"content_hash": "5387f56d0543013b75813e4bd43ec155",
"timestamp": "",
"source": "github",
"line_count": 293,
"max_line_length": 136,
"avg_line_length": 32.95221843003413,
"alnum_prop": 0.5721387881926463,
"repo_name": "jayztemplier/ShakeReportServer",
"id": "913b5442906fb5ae34e9c9d27494f291a358ce9f",
"size": "9655",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "test/functional/reports_controller_test.rb",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "37529"
},
{
"name": "CoffeeScript",
"bytes": "562"
},
{
"name": "HTML",
"bytes": "144176"
},
{
"name": "JavaScript",
"bytes": "641"
},
{
"name": "Ruby",
"bytes": "73316"
},
{
"name": "Shell",
"bytes": "2170"
}
],
"symlink_target": ""
}
|
SELECT a FROM t1 WHERE rowid > 72057594037927936 ORDER BY a DESC
|
{
"content_hash": "8bb91e5021a62fef6d95be43e200ff68",
"timestamp": "",
"source": "github",
"line_count": 1,
"max_line_length": 64,
"avg_line_length": 64,
"alnum_prop": 0.8125,
"repo_name": "bkiers/sqlite-parser",
"id": "a3150dc334e4df41a14823267f913459b21f223a",
"size": "176",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/test/resources/boundary1.test_878.sql",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "ANTLR",
"bytes": "20112"
},
{
"name": "Java",
"bytes": "6273"
},
{
"name": "PLpgSQL",
"bytes": "324108"
}
],
"symlink_target": ""
}
|
package com.farwolf.weex.module;
import android.graphics.Color;
import android.view.View;
import com.farwolf.util.StringUtil;
import com.farwolf.weex.base.WXModuleBase;
import com.farwolf.weex.util.Weex;
import com.taobao.weex.annotation.JSMethod;
import com.taobao.weex.bridge.JSCallback;
/**
* Created by zhengjiangrong on 2017/5/10.
*/
public class WXNavBarModule extends WXModuleBase {
@JSMethod
public void setTitle(String title)
{
if(getTitleBar()!=null)
getTitleBar().setTitle(title);
}
@JSMethod
public void setTitleColor(String color)
{
if(getTitleBar()!=null)
getTitleBar().title.setTextColor(Color.parseColor(color));
}
@JSMethod
public void setBack(boolean back)
{
if(getTitleBar()==null)
return;
if(back)
{
getTitleBar().setBack();
}
else
{
getTitleBar().leftview.setVisibility(View.GONE);
}
}
@JSMethod
public void hide()
{
if(getTitleBar()==null)
return;
getTitleBar().setVisibility(View.GONE);
}
@JSMethod
public void show()
{
if(getTitleBar()==null)
return;
getTitleBar().setVisibility(View.VISIBLE);
}
@JSMethod
public void setBackgroundColor(String color)
{
if(getTitleBar()==null)
return;
getTitleBar().layout.setBackgroundColor(Color.parseColor(color));
}
@JSMethod
public void setRightText(String text,final JSCallback callback)
{
getTitleBar().setRightText(text);
getTitleBar().setRightClick(new View.OnClickListener() {
@Override
public void onClick(View view) {
callback.invokeAndKeepAlive(null);
}
});
}
@JSMethod
public void setLeftText(String text)
{
if(getTitleBar()==null)
return;
getTitleBar().setLeftText(text);
}
@JSMethod
public void setRightImage(String src,final JSCallback callback)
{
if(getTitleBar()==null)
return;
getTitleBar().rightview.setVisibility(View.VISIBLE);
getTitleBar().right_image.setVisibility(View.VISIBLE);
getTitleBar().setRightClick(new View.OnClickListener() {
@Override
public void onClick(View view) {
callback.invokeAndKeepAlive(null);
}
});
src=StringUtil.getRealUrl(this.mWXSDKInstance.getBundleUrl(),src);
Weex.downloadImg(src, getTitleBar().right_image,this.mWXSDKInstance.getContext());
}
}
|
{
"content_hash": "70dbcb9af44bc41252cca1ea54234fd7",
"timestamp": "",
"source": "github",
"line_count": 114,
"max_line_length": 90,
"avg_line_length": 23.517543859649123,
"alnum_prop": 0.59828422230511,
"repo_name": "evildoerX/weex-ouikit",
"id": "9e0a7ccd036dc32d20cdfbddc7464018c08b533d",
"size": "2681",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "platforms/android/farwolf.weex/src/main/java/com/farwolf/weex/module/WXNavBarModule.java",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C",
"bytes": "91967"
},
{
"name": "CSS",
"bytes": "24463"
},
{
"name": "Java",
"bytes": "3097591"
},
{
"name": "JavaScript",
"bytes": "579608"
},
{
"name": "Objective-C",
"bytes": "4219630"
},
{
"name": "Objective-C++",
"bytes": "3296"
},
{
"name": "Ruby",
"bytes": "5421"
},
{
"name": "Shell",
"bytes": "13602"
},
{
"name": "Vue",
"bytes": "51955"
}
],
"symlink_target": ""
}
|
<resources>
<string name="settings_header_profile">Profile</string>
<string name="settings_header_conf">Configuration</string>
<string name="profile_name_title">Name</string>
<string name="profile_photo_title">Photo</string>
<string name="profile_desc_title">Description</string>
<string name="profile_social_title">Load name and photo from social networks</string>
<string name="profile_from_facebook_button">Use Facebook Profile</string>
<string name="profile_from_google_button">Use Google Profile</string>
<string name="profile_choose_photo_button">Take Photo or Choose Gallery</string>
<string name="title_activity_choose_photo">Choose Photo</string>
<string-array name="profile_photo_descriptions">
<item>Old</item>
<item>Kittens</item>
<item>Mask</item>
<item>Dog</item>
<item>Bicycle</item>
<item>Flower</item>
</string-array>
<string name="profile_photo_desc_6">Flower</string>
<string-array name="profile_photo_drawable_name">
<item>user_icon_1</item>
<item>user_icon_2</item>
<item>user_icon_3</item>
<item>user_icon_4</item>
<item>user_icon_5</item>
<item>user_icon_6</item>
</string-array>
<string name="profile_photo_6">user_icon_6</string>
<!-- Old Strings related to Settings -->
<!-- Example General settings -->
<string name="settings_time">Shower Time</string>
<string name="settings_options">Speaking Options</string>
<string name="settings_options_attitude">With attitude</string>
<string name="settings_options_humour">Add some humour</string>
<string name="settings_options_thoughts">Add some thoughts</string>
<string name="setting_language_title">Language</string>
</resources>
|
{
"content_hash": "9047cc2a1573a739bf0e226638ce1897",
"timestamp": "",
"source": "github",
"line_count": 47,
"max_line_length": 89,
"avg_line_length": 39.38297872340426,
"alnum_prop": 0.6547811993517018,
"repo_name": "nelladragon/scab",
"id": "e2ee3b0afe9f335466335f87537039ea450ca5a5",
"size": "1851",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "android/app/src/main/res/values/strings-settings.xml",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Batchfile",
"bytes": "1227"
},
{
"name": "Go",
"bytes": "18361"
},
{
"name": "HTML",
"bytes": "97"
},
{
"name": "Java",
"bytes": "342876"
},
{
"name": "JavaScript",
"bytes": "5801"
},
{
"name": "Makefile",
"bytes": "1077"
},
{
"name": "Shell",
"bytes": "1756"
}
],
"symlink_target": ""
}
|
package org.perfcake.pc4idea.impl.run.execution;
import com.intellij.icons.AllIcons;
import javax.swing.*;
import java.awt.*;
/**
* Created by miron on 21. 12. 2014. This swing component is shown in console window, when running scenario.
* It is adding toolbar for scenario stopping button.
*/
public class ConsoleContentWrapper extends JPanel {
private JComponent consoleContent;
private MyToolbar toolbar;
public ConsoleContentWrapper(JComponent consoleContent) {
super(new BorderLayout());
this.consoleContent = consoleContent;
toolbar = new MyToolbar();
add(consoleContent, BorderLayout.CENTER);
add(toolbar, BorderLayout.WEST);
}
public JComponent getConsoleContent() {
return consoleContent;
}
public MyToolbar getToolbar() {
return toolbar;
}
public class MyToolbar extends JToolBar {
private JButton stopButton;
public MyToolbar() {
super(JToolBar.VERTICAL);
setFloatable(false);
setRollover(true);
stopButton = new JButton(AllIcons.Actions.Suspend);
add(stopButton);
}
public JButton getStopButton() {
return stopButton;
}
}
}
|
{
"content_hash": "356ab06bf6456afbdc9b968ff4a8de33",
"timestamp": "",
"source": "github",
"line_count": 50,
"max_line_length": 108,
"avg_line_length": 25.18,
"alnum_prop": 0.6528991262907069,
"repo_name": "PerfCake/pc4idea",
"id": "dc2feb5fa5a5f5acc37283c26fb5b7f967d00183",
"size": "1259",
"binary": false,
"copies": "1",
"ref": "refs/heads/devel",
"path": "src/main/java/org/perfcake/pc4idea/impl/run/execution/ConsoleContentWrapper.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Java",
"bytes": "520034"
}
],
"symlink_target": ""
}
|
ACCEPTED
#### According to
International Plant Names Index
#### Published in
null
#### Original name
null
### Remarks
null
|
{
"content_hash": "2282c5296b958b8a8ced3ffaf533ce17",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 31,
"avg_line_length": 9.692307692307692,
"alnum_prop": 0.7063492063492064,
"repo_name": "mdoering/backbone",
"id": "887aff02db6ef63ba6c3244ef7f7a2cc9dd666ac",
"size": "173",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "life/Plantae/Magnoliophyta/Liliopsida/Asparagales/Orchidaceae/Endlicherara/README.md",
"mode": "33188",
"license": "apache-2.0",
"language": [],
"symlink_target": ""
}
|
import { createSelector } from 'reselect'
import { connect } from 'react-redux'
import { setFormId, noop, logout, inputChange, formInputChange, sendMessage, updateForm } from '../modules/wniView'
import { getFormView, getOpenForms, getTickets } from 'Api/reducer'
/* This is a container component. Notice it does not contain any JSX,
nor does it import React. This component is **only** responsible for
wiring in the actions and state necessary to render a presentational
component - in this case, the formView: */
import WniView from '../components/WniView'
/* Object of action creators (can also be function that returns object).
Keys will be passed as props to presentational components. Here we are
implementing our wrapper around increment; the component doesn't care */
const mapDispatchToProps = {
setFormId,
noop,
logout,
inputChange,
formInputChange,
sendMessage,
updateForm,
getTickets,
}
const wniView = (state) => state.wniView
const formId = (state) => state.wniView.get('formId')
const message = (state) => state.wniView.get('message')
const api = (state) => state.api
const token = createSelector(api, (a) => a.getIn(['token','id']))
const user = createSelector(api, (a) => a.getIn(['token','user']))
const form = createSelector(api, formId, (a, formId) => {
try {
return a.getIn(['forms', formId]).toJS()
}
catch (e) {}
})
const formValues = createSelector(wniView, (t) => t.get('formValues'))
const mapStateToProps = (state) => ({
token: token(state),
user: user(state),
form: form(state),
formValues: formValues(state),
message: message(state),
})
/* Note: mapStateToProps is where you should use `reselect` to create selectors, ie:
import { createSelector } from 'reselect'
const formView = (state) => state.formView
const tripleCount = createSelector(formView, (count) => count * 3)
const mapStateToProps = (state) => ({
formView: tripleCount(state)
})
Selectors can compute derived data, allowing Redux to store the minimal possible state.
Selectors are efficient. A selector is not recomputed unless one of its arguments change.
Selectors are composable. They can be used as input to other selectors.
https://github.com/reactjs/reselect */
export default connect(mapStateToProps, mapDispatchToProps)(WniView)
|
{
"content_hash": "09a79132aece55be8fe172738fddf953",
"timestamp": "",
"source": "github",
"line_count": 68,
"max_line_length": 115,
"avg_line_length": 34.60294117647059,
"alnum_prop": 0.7084572885677858,
"repo_name": "ahthamrin/kbri-admin2",
"id": "ab36a27b120bb1f40e0e92d177fdf50f1563a938",
"size": "2353",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/routes/app/routes/WniView/containers/WniViewContainer.js",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "ApacheConf",
"bytes": "1795"
},
{
"name": "CSS",
"bytes": "357541"
},
{
"name": "HTML",
"bytes": "91762"
},
{
"name": "JavaScript",
"bytes": "1126247"
},
{
"name": "Shell",
"bytes": "1335"
}
],
"symlink_target": ""
}
|
using System;
namespace CountWords
{
public class CountWords
{
public int Count(string s)
{
throw new NotImplementedException();
}
}
}
|
{
"content_hash": "5555151cdb3824c0e868b8c9db5ef646",
"timestamp": "",
"source": "github",
"line_count": 12,
"max_line_length": 48,
"avg_line_length": 15.416666666666666,
"alnum_prop": 0.5567567567567567,
"repo_name": "AlanBarber/CodeKatas",
"id": "d2980774cddc7cf0ff7e52af487699240ae4e015",
"size": "187",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/CountWords/CountWords.cs",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Batchfile",
"bytes": "521"
},
{
"name": "C#",
"bytes": "92188"
}
],
"symlink_target": ""
}
|
class Movie < ActiveRecord::Base
belongs_to :category
# given a dir path, return a list of movie objects
def self.unorganized(path)
Dir.entries(path).reject {|i| i.match(/^\./) }.map { |f|
Movie.new(:filename=>f, :path=>path)
}
end
def full_path
File.join(path, filename)
end
end
# == Schema Information
#
# Table name: movies
#
# id :integer not null, primary key
# filename :string(255)
# path :string(255)
# container :string(255)
# category_id :integer
# created_at :datetime
# updated_at :datetime
#
|
{
"content_hash": "2b1e2f0e8fecf8eae1165ac067196b63",
"timestamp": "",
"source": "github",
"line_count": 27,
"max_line_length": 60,
"avg_line_length": 21.333333333333332,
"alnum_prop": 0.6180555555555556,
"repo_name": "edk/vbrowse",
"id": "1a1048dedf7f450911f80c5688f4e0cdd1c03c89",
"size": "576",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "app/models/movie.rb",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CoffeeScript",
"bytes": "3978"
},
{
"name": "JavaScript",
"bytes": "33450"
},
{
"name": "Ruby",
"bytes": "21634"
}
],
"symlink_target": ""
}
|
from sqlalchemy import create_engine
engine = create_engine('sqlite:///:memory:', echo=True)
|
{
"content_hash": "50731270480db45ad102b3de726b1d03",
"timestamp": "",
"source": "github",
"line_count": 3,
"max_line_length": 55,
"avg_line_length": 31.333333333333332,
"alnum_prop": 0.7446808510638298,
"repo_name": "egustafson/sandbox",
"id": "67ccaeeb20d94cdc0ec4212027e84ecea91b95a3",
"size": "120",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "Python/sqlalchemy-core/connect.py",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Ada",
"bytes": "65426"
},
{
"name": "Assembly",
"bytes": "2103"
},
{
"name": "C",
"bytes": "94748"
},
{
"name": "C++",
"bytes": "52883"
},
{
"name": "Dockerfile",
"bytes": "873"
},
{
"name": "FreeMarker",
"bytes": "195"
},
{
"name": "Game Maker Language",
"bytes": "24204"
},
{
"name": "Go",
"bytes": "128092"
},
{
"name": "Groovy",
"bytes": "584"
},
{
"name": "HTML",
"bytes": "2491"
},
{
"name": "Java",
"bytes": "232698"
},
{
"name": "JavaScript",
"bytes": "278"
},
{
"name": "Lex",
"bytes": "2806"
},
{
"name": "Lua",
"bytes": "809"
},
{
"name": "M4",
"bytes": "1718"
},
{
"name": "Makefile",
"bytes": "22166"
},
{
"name": "Perl",
"bytes": "25945"
},
{
"name": "Python",
"bytes": "131732"
},
{
"name": "Roff",
"bytes": "1455"
},
{
"name": "Ruby",
"bytes": "5870"
},
{
"name": "Scala",
"bytes": "2130"
},
{
"name": "Shell",
"bytes": "7117"
},
{
"name": "Tcl",
"bytes": "4561"
},
{
"name": "TeX",
"bytes": "63201"
},
{
"name": "Yacc",
"bytes": "924"
}
],
"symlink_target": ""
}
|
export * from './non-ideal-state-loading-usage-example';
|
{
"content_hash": "4eeae1cc0cdd7c7ee68ec666d97ecf58",
"timestamp": "",
"source": "github",
"line_count": 1,
"max_line_length": 56,
"avg_line_length": 57,
"alnum_prop": 0.7368421052631579,
"repo_name": "bullhorn/novo-elements",
"id": "1a0225bdcaf8df1cf7701a5b9ea8679d4fa7e30f",
"size": "57",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "projects/novo-examples/src/components/non-ideal-state/non-ideal-state-loading-usage/index.ts",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "99369"
},
{
"name": "HTML",
"bytes": "200072"
},
{
"name": "JavaScript",
"bytes": "29452"
},
{
"name": "SCSS",
"bytes": "349833"
},
{
"name": "Shell",
"bytes": "1364"
},
{
"name": "TypeScript",
"bytes": "3518153"
}
],
"symlink_target": ""
}
|
namespace kws {
namespace cmd {
using kws::core::TypeInfo;
template <typename T>
class Argument : public Option<T> {
public:
using Option<T>::Option;
using Option<T>::Parse;
std::string Help(size_t w = 0) const override {
std::ostringstream oss;
oss << std::setw(w) << std::left << name_ << " : " << help_
<< " (type = " << TypeInfo<T>::Name() << ")";
return oss.str();
}
protected:
using Option<T>::name_;
using Option<T>::help_;
using Option<T>::value_;
};
template <>
class Argument<bool> : public Option<bool> {
public:
using Option<bool>::Option;
std::string Help(size_t w = 0) const override {
std::ostringstream oss;
oss << std::setw(w) << std::left << name_ << " : " << help_
<< " (type = " << TypeInfo<bool>::Name() << ")";
return oss.str();
}
bool Parse(const std::string& str) override {
if (str == "true" || str == "1") {
*value_ = true;
return true;
} else if (str == "false" || str == "0") {
*value_ = false;
return true;
} else {
return false;
}
}
protected:
using Option<bool>::name_;
using Option<bool>::help_;
using Option<bool>::value_;
};
} // namespace cmd
} // namespace kws
#endif // CMD_ARGUMENT_H
|
{
"content_hash": "fe594e8b0be0b4efd9710d857c88139a",
"timestamp": "",
"source": "github",
"line_count": 58,
"max_line_length": 63,
"avg_line_length": 21.620689655172413,
"alnum_prop": 0.5566188197767146,
"repo_name": "jpuigcerver/kws-eval",
"id": "275f29d0f799c8393e39bb74a44970835205280a",
"size": "1353",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "cmd/Argument.h",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C++",
"bytes": "141709"
},
{
"name": "CMake",
"bytes": "13990"
}
],
"symlink_target": ""
}
|
<?php
class b2c_service_desktop_indexseo
{
public function title()
{
return app::get('site')->getConf('site.name');
}//End Function
}//End Class
|
{
"content_hash": "dcf91f95bef611e21353c314ec2c83a4",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 54,
"avg_line_length": 13.076923076923077,
"alnum_prop": 0.6,
"repo_name": "liuguogen/Ecstore",
"id": "bf7f3b3dbcd0ec338451cd7535fdfab8bc28613d",
"size": "336",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "app/b2c/lib/service/desktop/indexseo.php",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Batchfile",
"bytes": "222"
},
{
"name": "CSS",
"bytes": "518857"
},
{
"name": "HTML",
"bytes": "3296871"
},
{
"name": "JavaScript",
"bytes": "1648708"
},
{
"name": "PHP",
"bytes": "11837422"
},
{
"name": "Shell",
"bytes": "4513"
},
{
"name": "Smarty",
"bytes": "2153"
},
{
"name": "XSLT",
"bytes": "18795"
}
],
"symlink_target": ""
}
|
package com.tdp2.androidclient.activity;
import android.app.SearchManager;
import android.content.Context;
import android.content.Intent;
import android.content.res.Configuration;
import android.os.Bundle;
import android.support.v4.widget.DrawerLayout;
import android.support.v7.app.ActionBarActivity;
import android.support.v7.app.ActionBarDrawerToggle;
import android.support.v7.widget.SearchView;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseExpandableListAdapter;
import android.widget.ExpandableListView;
import android.widget.FrameLayout;
import android.widget.ImageView;
import android.widget.TextView;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableMap;
import com.tdp2.androidclient.R;
import com.tdp2.androidclient.app.Injector;
import com.tdp2.androidclient.server.api.ApiProvider;
import com.tdp2.androidclient.server.callback.LogErrorCallback;
import com.tdp2.androidclient.server.model.MyProfile;
import com.tdp2.androidclient.server.model.RestrictedGroup;
import com.tdp2.androidclient.server.stores.AuthorizationStore;
import com.tdp2.androidclient.service.ProgressDialogService;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import javax.inject.Inject;
import butterknife.InjectView;
public abstract class BaseDrawerActivity extends ActionBarActivity {
Integer PICK_IMAGE_CODE = 1;
@Inject
AuthorizationStore authorizationStore;
@Inject
ApiProvider apiProvider;
@InjectView(R.id.drawer_layout)
DrawerLayout drawerLayout;
@InjectView(R.id.menuListView)
ExpandableListView menuListView;
private ActionBarDrawerToggle drawerToggle;
private MenuAdapter menuAdapter;
public abstract int getMainFrameView();
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_base_drawer);
View mainFrameView = getLayoutInflater().inflate(getMainFrameView(), null);
((FrameLayout) findViewById(R.id.base_frame)).addView(mainFrameView);
Injector.injectActivity(this);
setupActionBarToggle();
setupMenuDrawer();
}
@Override
protected void onResume() {
super.onResume();
loadMenuGroups();
}
private void setupMenuDrawer() {
setMenuAdapter(new MenuAdapter());
menuListView.setOnChildClickListener(new ExpandableListView.OnChildClickListener() {
@Override
public boolean onChildClick(ExpandableListView expandableListView, View view, int i, int i2, long l) {
MenuEntry entry = (MenuEntry) menuAdapter.getChild(i, i2);
entry.action.run();
return true;
}
});
loadMenuGroups();
}
private void loadMenuGroups() {
ProgressDialogService.show(this, "Cargando datos", null, false, false);
apiProvider.get().getMyProfile(new LogErrorCallback<MyProfile>() {
@Override
public void onSuccess(MyProfile profile) {
setMenuAdapter(new MenuAdapter(profile.user.groups));
}
@Override
protected void onBoth() {
ProgressDialogService.dismiss();
}
});
}
private void setMenuAdapter(MenuAdapter adapter) {
menuAdapter = adapter;
menuListView.setAdapter(menuAdapter);
for (int i = 0; i < menuAdapter.getGroupCount(); i++) {
menuListView.expandGroup(i);
}
}
private void setupActionBarToggle() {
final String activityTitle = getTitle().toString();
drawerToggle = new ActionBarDrawerToggle(this, drawerLayout, R.string.drawer_open, R.string.drawer_close) {
public void onDrawerClosed(View view) {
getSupportActionBar().setTitle(activityTitle);
}
public void onDrawerOpened(View drawerView) {
getSupportActionBar().setTitle(getString(R.string.navigator_drawer_title));
}
};
drawerLayout.setDrawerListener(drawerToggle);
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
getSupportActionBar().setHomeButtonEnabled(true);
}
@Override
protected void onPostCreate(Bundle savedInstanceState) {
super.onPostCreate(savedInstanceState);
drawerToggle.syncState();
}
@Override
public void onConfigurationChanged(Configuration newConfig) {
super.onConfigurationChanged(newConfig);
drawerToggle.onConfigurationChanged(newConfig);
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
getMenuInflater().inflate(R.menu.base_menu, menu);
SearchManager searchManager = (SearchManager) getSystemService(Context.SEARCH_SERVICE);
SearchView searchView = (SearchView) menu.findItem(R.id.action_search).getActionView();
searchView.setSearchableInfo(searchManager.getSearchableInfo(getComponentName()));
searchView.setIconifiedByDefault(false); // Do not iconify the widget; expand it by default
return true;
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
if (drawerToggle.onOptionsItemSelected(item)) {
return true;
}
return super.onOptionsItemSelected(item);
}
private MenuEntry buildGroupMenuEntry(final RestrictedGroup group) {
return new MenuEntry(group.name, R.drawable.ic_action_group, new Runnable() {
@Override
public void run() {
Intent intent = new Intent(BaseDrawerActivity.this, GroupInfoActivity.class);
intent.putExtra(GroupInfoActivity.EXTRA_GROUP_ID, group.id);
startActivity(intent);
finish();
}
});
}
private MenuEntry buildMapMenuEntry() {
return new MenuEntry(getResources().getString(R.string.drawer_menu_map), R.drawable.ic_action_map, new Runnable() {
@Override
public void run() {
startActivity(new Intent(BaseDrawerActivity.this, MapActivity.class));
}
});
}
private MenuEntry buildContactListMenuEntry(){
return new MenuEntry(getResources().getString(R.string.drawer_menu_contacts), R.drawable.ic_action_person, new Runnable(){
@Override
public void run(){
startActivity(new Intent(BaseDrawerActivity.this, ContactListActivity.class));
finish();
}
});
}
private MenuEntry buildLogoutMenuEntry() {
return new MenuEntry(getResources().getString(R.string.drawer_menu_logout), R.drawable.ic_action_undo, new Runnable() {
@Override
public void run() {
authorizationStore.clear();
startActivity(new Intent(BaseDrawerActivity.this, LoginActivity.class));
finish();
}
});
}
private MenuEntry buildMyProfileMenuEntry() {
return new MenuEntry(getResources().getString(R.string.drawer_menu_profile), R.drawable.ic_action_person, new Runnable() {
@Override
public void run() {
startActivity(new Intent(BaseDrawerActivity.this, ProfileActivity.class));
finish();
}
});
}
private MenuEntry buildAddGroupMenuEntry() {
return new MenuEntry(getResources().getString(R.string.drawer_menu_groups_create), R.drawable.ic_action_add_group, new Runnable() {
@Override
public void run() {
startActivity(new Intent(BaseDrawerActivity.this, UpdateGroupActivity.class));
finish();
}
});
}
private MenuEntry buildWallMenuEntry() {
return new MenuEntry(getResources().getString(R.string.drawer_menu_wall), R.drawable.ic_action_chat, new Runnable() {
@Override
public void run() {
ContactInfoActivity.startForUser(BaseDrawerActivity.this, authorizationStore.getUserId());
finish();
}
});
}
private MenuEntry buildHomeMenuEntry() {
return new MenuEntry(getResources().getString(R.string.drawer_menu_home), R.drawable.ic_action_select_all, new Runnable() {
@Override
public void run() {
startActivity(new Intent(BaseDrawerActivity.this, HomeActivity.class));
finish();
}
});
}
private class MenuEntry {
public final String name;
public final int imageResource;
public final Runnable action;
private MenuEntry(String name, int imageResource, Runnable action) {
this.name = name;
this.imageResource = imageResource;
this.action = action;
}
}
private class MenuAdapter extends BaseExpandableListAdapter {
private final List<String> menuItemSections = ImmutableList.of(
getResources().getString(R.string.drawer_menu_home),
getResources().getString(R.string.drawer_menu_groups),
getResources().getString(R.string.drawer_menu_settings)
);
private final Map<String, List<MenuEntry>> menuItems;
public MenuAdapter() {
List<MenuEntry> startActions = getStartMenuEntries();
List<MenuEntry> settingsActions = getSettingsMenuEntries();
List<MenuEntry> groupActions = ImmutableList.of( buildAddGroupMenuEntry() );
menuItems = buildMenuItems(startActions, settingsActions, groupActions);
}
public MenuAdapter(List<RestrictedGroup> groups) {
List<MenuEntry> startActions = getStartMenuEntries();
List<MenuEntry> settingsActions = getSettingsMenuEntries();
List<MenuEntry> groupActions = new ArrayList<>();
groupActions.add(buildAddGroupMenuEntry());
for (RestrictedGroup group : groups) {
groupActions.add(buildGroupMenuEntry(group));
}
menuItems = buildMenuItems(startActions, settingsActions, groupActions);
}
private ImmutableMap<String, List<MenuEntry>> buildMenuItems(List<MenuEntry> startActions, List<MenuEntry> settingsActions, List<MenuEntry> groupActions) {
return ImmutableMap.<String, List<MenuEntry>>builder()
.put(getResources().getString(R.string.drawer_menu_home), startActions)
.put(getResources().getString(R.string.drawer_menu_groups), groupActions)
.put(getResources().getString(R.string.drawer_menu_settings), settingsActions)
.build();
}
private List<MenuEntry> getSettingsMenuEntries() {
return ImmutableList.of(
buildMyProfileMenuEntry(),
buildLogoutMenuEntry()
);
}
private List<MenuEntry> getStartMenuEntries() {
return ImmutableList.of(
buildHomeMenuEntry(),
buildWallMenuEntry(),
buildContactListMenuEntry(),
buildMapMenuEntry()
);
}
@Override
public int getGroupCount() {
return menuItemSections.size();
}
private List<MenuEntry> getMenuEntries(int i) {
return menuItems.get(menuItemSections.get(i));
}
@Override
public int getChildrenCount(int i) {
return getMenuEntries(i).size();
}
@Override
public Object getGroup(int i) {
return menuItemSections.get(i);
}
@Override
public Object getChild(int i, int i2) {
return getMenuEntries(i).get(i2);
}
@Override
public long getGroupId(int i) {
return i;
}
@Override
public long getChildId(int i, int i2) {
return 100 * i + i2;
}
@Override
public boolean hasStableIds() {
return false;
}
@Override
public View getGroupView(int i, boolean b, View convertView, ViewGroup viewGroup) {
String section = menuItemSections.get(i);
if (convertView == null) {
convertView = getLayoutInflater().inflate(R.layout.list_item_menu_header, null);
}
TextView text = (TextView) convertView.findViewById(R.id.textView);
text.setText(section);
return convertView;
}
@Override
public View getChildView(int i, int i2, boolean b, View convertView, ViewGroup viewGroup) {
MenuEntry entry = getMenuEntries(i).get(i2);
if (convertView == null) {
convertView = getLayoutInflater().inflate(R.layout.list_item_menu_item, null);
}
TextView text = (TextView) convertView.findViewById(R.id.textView);
text.setText(entry.name);
ImageView image = (ImageView) convertView.findViewById(R.id.imageView);
image.setImageResource(entry.imageResource);
return convertView;
}
@Override
public boolean isChildSelectable(int i, int i2) {
return true;
}
}
}
|
{
"content_hash": "e23583dd617bb0aeceb692dba88019bc",
"timestamp": "",
"source": "github",
"line_count": 388,
"max_line_length": 163,
"avg_line_length": 34.70876288659794,
"alnum_prop": 0.6359248533452142,
"repo_name": "campus-movil/android-client",
"id": "a6e3da99855080f63c56e586a434d453bfe41bc4",
"size": "13467",
"binary": false,
"copies": "1",
"ref": "refs/heads/development",
"path": "app/src/main/java/com/tdp2/androidclient/activity/BaseDrawerActivity.java",
"mode": "33261",
"license": "mit",
"language": [
{
"name": "Java",
"bytes": "215410"
}
],
"symlink_target": ""
}
|
module Fog
module Storage
class AWS
module GetBlobHttpsUrl
def get_blob_https_url(container_name, blob_name, expires = nil, options = {})
unless container_name
raise ArgumentError.new('container_name is required')
end
unless blob_name
raise ArgumentError.new('blob_name is required')
end
host, path = [@host, ::File.join(container_name, blob_name)]
https_url({
:headers => {},
:host => host,
:port => 443,
:method => 'GET',
:path => path,
:query => options[:query]
}, expires)
end
end
class Real
include GetBlobHttpsUrl
end
class Mock # :nodoc:all
include GetBlobHttpsUrl
end
end
end
end
|
{
"content_hash": "aeeae8d99be67091473b4b951ce44b4c",
"timestamp": "",
"source": "github",
"line_count": 40,
"max_line_length": 86,
"avg_line_length": 21.525,
"alnum_prop": 0.5017421602787456,
"repo_name": "shadysayed/fog-azure",
"id": "3d5b12276d74c10a4c9604bbb5fee3bc9da3f5a3",
"size": "861",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "lib/fog/azure/requests/storage/get_blob_https_url.rb",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Ruby",
"bytes": "32426"
}
],
"symlink_target": ""
}
|
<link rel="import" href="../bower_components/iron-dropdown/iron-dropdown-scroll-manager.html">
<link rel="import" href="elements/toast-element.html">
<link rel="import" href="elements/video-dialog.html">
<link rel="import" href="elements/dialogs/speaker-details.html">
<link rel="import" href="elements/dialogs/previous-speaker-details.html">
<link rel="import" href="elements/dialogs/session-details.html">
<link rel="import" href="elements/dialogs/subscribe-dialog.html">
<link rel="import" href="elements/dialogs/signin-dialog.html">
<link rel="import" href="elements/polymer-helmet.html">
<link href="https://fonts.googleapis.com/css?family=Product+Sans:400&lang=en" rel="stylesheet">
|
{
"content_hash": "f647f0be5fcf91470b2142b833d93045",
"timestamp": "",
"source": "github",
"line_count": 10,
"max_line_length": 99,
"avg_line_length": 69.3,
"alnum_prop": 0.7633477633477633,
"repo_name": "GDGYangon/gdg-yangon-devfest-2015-website",
"id": "007e148ab7b8f3426078454fa2642a1eacaf8d50",
"size": "693",
"binary": false,
"copies": "3",
"ref": "refs/heads/master",
"path": "src/lazy-resources.html",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "7295"
},
{
"name": "HTML",
"bytes": "125782"
},
{
"name": "JavaScript",
"bytes": "12506"
}
],
"symlink_target": ""
}
|
class DummyController < ApplicationController
def dummy_method
end
end
|
{
"content_hash": "4fc40c275b9a3d6ed0f4863d8f44711a",
"timestamp": "",
"source": "github",
"line_count": 5,
"max_line_length": 45,
"avg_line_length": 15.8,
"alnum_prop": 0.7721518987341772,
"repo_name": "coyosoftware/dynamic_router",
"id": "df59f4d68f5fe4fa0f099bc7cebc47e8975f2242",
"size": "79",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "spec/dummy/app/controllers/dummy_controller.rb",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Ruby",
"bytes": "16747"
}
],
"symlink_target": ""
}
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.