answer stringlengths 15 1.25M |
|---|
# <API key>
Install a Puppet master along with the utilities that I use (following the generally accepted best-practises) and sensible defaults.
- Puppetserver
- Dynamic environments
- R10k
- Git
- Hiera
Notice there is no PuppetDB. Puppet can install/configure PuppetDB itself, so I do not see a place for it in the bootstrap process.
# Pre-requisites
Currently tested on CentOS 6 only. I have every intention of adding CentOS 7 support and it may well work out-of-the-box.
# Usage
The simplest is to run:
curl https://raw.githubusercontent.com/chriscowley/<API key>/master/bootstrap.sh | sudo -E sh
You can also run `sudo ./bootstrap.sh`.
This allows the use of a certain amount of configuration:
- `PMB_CONFIGURE_GIT` : Whether to install/configure Git (defaults=1)
- `PMB_CONFIGURE_R10k` : Whether to install/configure R10k (defaults=1)
- `PMB_TEST` : Only tell you what it would do, but nothing actually happens
- `<API key>` : Install the post-receive git hook (default=1)
# Contributing
Feel free to fork and send me a PR. Priority would be to add Debian/Ubuntu support if I do not get round to it first. |
using System;
using System.Net;
#if !NETFX_CORE
using NUnit.Framework;
using TestClass = NUnit.Framework.<API key>;
#else
using Microsoft.VisualStudio.TestTools.UnitTesting;
#endif
using Mina.Core.Future;
using Mina.Core.Service;
namespace Mina.Transport.Socket
{
[TestClass]
public class DatagramBindTest : AbstractBindTest
{
public DatagramBindTest()
: base(new <API key>())
{ }
protected override EndPoint CreateEndPoint(Int32 port)
{
return new IPEndPoint(IPAddress.Loopback, port);
}
protected override Int32 GetPort(EndPoint ep)
{
return ((IPEndPoint)ep).Port;
}
protected override IoConnector NewConnector()
{
return new <API key>();
}
}
} |
package org.usc.demo.lottery;
import java.util.*;
public class DrawUtil {
public static int randomDraw(List<Double> list0) {
if (list0 == null || list0.size() < 1)
return -1;
List<Double> list = new ArrayList<Double>();
double sum = 0d;
for (Double dd : list0) {
sum += dd;
}
for (Double ddd : list0) {
list.add(ddd / sum);
}
List<Double> nums = new ArrayList<Double>();
double lest = 0;
for (Double data : list) {
double tmp = data.doubleValue();
lest += tmp;
nums.add(new Double(lest));
}
Double rtmp = Math.random();
nums.add(new Double(rtmp));
Collections.sort(nums);
if (nums.indexOf(rtmp) >= list.size()) {
double min = Double.MAX_VALUE;
for (Double d : list) {
if (d < min)
min = d;
}
return list.indexOf(min);
}
return nums.indexOf(rtmp);
}
public static int randomDraw(Double[] list) {
if (list == null || list.length < 1)
return -1;
List<Double> list2 = new ArrayList<Double>();
for (Double double1 : list) {
list2.add(double1);
}
return randomDraw(list2);
}
public static void main(String[] args) {
Map<Integer, Integer> map = new HashMap<Integer, Integer>();
List<Double> list = new ArrayList<Double>();
list.add(0.002d);
list.add(0.998d);
list.add(0.3d);
list.add(0.4d);
Double[] dd = list.toArray(new Double[] {});
for (int i = 0; i < 100000; i++) {
int rs = randomDraw(dd);
int count = map.get(rs) == null ? 0 : map.get(rs);
map.put(rs, count + 1);
}
System.out.println(map);
}
} |
package core.API;
import org.json.simple.JSONObject;
import java.util.ArrayList;
import java.util.List;
public class Passenger implements MessagesInterface {
private Integer id;
private Integer elevator;
private Integer fromFloor;
private Integer destFloor;
private Integer state;
private Integer timeToAway;
private String type;
private Integer floor;
private List<JSONObject> messages;
private Double x;
private Double y;
private Double weight;
public Boolean hasElevator() {
return this.elevator != null;
}
public List<JSONObject> getMessages() {
return this.messages;
}
public Integer getFromFloor() {
return this.fromFloor;
}
public Integer getDestFloor() {
return this.destFloor;
}
public Double getY() {
return y;
}
public Integer getState() {
return state;
}
public Double getX() {
return x;
}
public Double getWeight() {
return weight;
}
public Integer getElevator() {
return elevator;
}
public Integer getId() {
return id;
}
public Integer getTimeToAway() { return timeToAway; }
public String getType() { return type; }
public Integer getFloor() { return floor; }
public Passenger(JSONObject passenger) {
id = (int) (long) passenger.get("id");
elevator = passenger.get("elevator") == null ? null : (int) (long) passenger.get("elevator");
fromFloor = (int) (long) passenger.get("from_floor");
destFloor = (int) (long) passenger.get("dest_floor");
timeToAway = (int) (long) passenger.get("time_to_away");
type = (String) passenger.get("type");
floor = (int) (long) passenger.get("floor");
state = (int) (long) passenger.get("state");
messages = new ArrayList<>();
if (passenger.get("x") instanceof Long) {
x = ((Long) passenger.get("x")).doubleValue();
} else {
x = (double) passenger.get("x");
}
if (passenger.get("y") instanceof Long) {
y = ((Long) passenger.get("y")).doubleValue();
} else {
y = (double) passenger.get("y");
}
if (passenger.get("weight") instanceof Long) {
weight = ((Long) passenger.get("weight")).doubleValue();
} else {
weight = (double) passenger.get("weight");
}
}
public void setElevator(Elevator elevator) {
this.elevator = elevator.getId();
JSONObject jo = new JSONObject();
jo.put("command", "<API key>");
JSONObject args = new JSONObject();
args.put("passenger_id", this.id);
args.put("elevator_id", elevator.getId());
jo.put("args", args);
this.messages.add(jo);
}
} |
public class SIAndAmount {
public static void main(String[] args) {
System.out.println("Simple Interest & Amount");
System.out.println();
double principal = 10000;
double rate = 8.5;
double time = 4;
System.out.println("Principal: " + principal);
System.out.println("Rate: " + rate);
System.out.println("Time: " + time);
System.out.println();
double SimpleInterest = principal * rate * time / 100;
System.out.println("Simple Interest = " + SimpleInterest);
double amount = principal + SimpleInterest;
System.out.println("Amount = " + amount);
System.out.println();
}
} |
using Telerik.UI.Xaml.Controls.Grid.Primitives;
using Windows.UI.Xaml.Automation;
using Windows.UI.Xaml.Automation.Peers;
using Windows.UI.Xaml.Automation.Provider;
namespace Telerik.UI.Automation.Peers
{
public class <API key> : <API key>, <API key>
{
public <API key>(<API key> owner)
: base(owner)
{
}
private <API key> <API key>
{
get
{
return this.Owner as <API key>;
}
}
<summary>
<API key> implementation.
</summary>
public ExpandCollapseState ExpandCollapseState
{
get
{
return this.<API key>.GroupFlyout.IsOpen ? ExpandCollapseState.Expanded : ExpandCollapseState.Collapsed;
}
}
<inheritdoc />
protected override string GetClassNameCore()
{
return nameof(<API key>);
}
<inheritdoc />
protected override string <API key>()
{
return "datagrid service panel";
}
<inheritdoc />
protected override <API key> <API key>()
{
return <API key>.Group;
}
<inheritdoc />
protected override string GetNameCore()
{
var nameCore = base.GetNameCore();
if (!string.IsNullOrEmpty(nameCore))
return nameCore;
return nameof(<API key>);
}
<inheritdoc />
protected override object GetPatternCore(PatternInterface patternInterface)
{
if (patternInterface == PatternInterface.ExpandCollapse)
{
return this;
}
return base.GetPatternCore(patternInterface);
}
<summary>
<API key> implementation.
</summary>
public void Collapse()
{
if (this.<API key>.GroupFlyout != null && this.<API key>.GroupFlyout.IsOpen)
{
this.<API key>.GroupFlyout.IsOpen = false;
}
}
<summary>
<API key> implementation.
</summary>
public void Expand()
{
if (this.<API key>.Owner != null && this.<API key>.Owner.GroupDescriptors.Count != 0)
{
this.<API key>.OpenGroupingFlyout();
}
}
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
internal void <API key>(bool oldValue, bool newValue)
{
this.<API key>(
<API key>.<API key>,
oldValue ? ExpandCollapseState.Expanded : ExpandCollapseState.Collapsed,
newValue ? ExpandCollapseState.Expanded : ExpandCollapseState.Collapsed);
}
}
} |
<!doctype html>
<html class="default no-js">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>nodeCluster | Graphinius</title>
<meta name="description" content="">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="../assets/css/main.css">
<script src="../assets/js/modernizr.js"></script>
</head>
<body>
<header>
<div class="tsd-page-toolbar">
<div class="container">
<div class="table-wrap">
<div class="table-cell" id="tsd-search" data-index="../assets/js/search.js" data-base="..">
<div class="field">
<label for="tsd-search-field" class="tsd-widget search no-caption">Search</label>
<input id="tsd-search-field" type="text" />
</div>
<ul class="results">
<li class="state loading">Preparing search index...</li>
<li class="state failure">The search index is not available</li>
</ul>
<a href="../index.html" class="title">Graphinius</a>
</div>
<div class="table-cell" id="tsd-widgets">
<div id="tsd-filter">
<a href="#" class="tsd-widget options no-caption" data-toggle="options">Options</a>
<div class="tsd-filter-group">
<div class="tsd-select" id="<API key>">
<span class="tsd-select-label">All</span>
<ul class="tsd-select-list">
<li data-value="public">Public</li>
<li data-value="protected">Public/Protected</li>
<li data-value="private" class="selected">All</li>
</ul>
</div>
<input type="checkbox" id="<API key>" checked />
<label class="tsd-widget" for="<API key>">Inherited</label>
<input type="checkbox" id="<API key>" checked />
<label class="tsd-widget" for="<API key>">Externals</label>
<input type="checkbox" id="<API key>" />
<label class="tsd-widget" for="<API key>">Only exported</label>
</div>
</div>
<a href="#" class="tsd-widget menu no-caption" data-toggle="menu">Menu</a>
</div>
</div>
</div>
</div>
<div class="tsd-page-title">
<div class="container">
<ul class="tsd-breadcrumb">
<li>
<a href="../globals.html">Globals</a>
</li>
<li>
<a href="../modules/_sangreea_sangreea_.html">"SaNGreeA/SaNGreeA"</a>
</li>
<li>
<a href="_sangreea_sangreea_.nodecluster.html">nodeCluster</a>
</li>
</ul>
<h1>Interface nodeCluster</h1>
</div>
</div>
</header>
<div class="container container-main">
<div class="row">
<div class="col-8 col-content">
<section class="tsd-panel tsd-comment">
<div class="tsd-comment tsd-typography">
<div class="lead">
<p> at each turn, we need to know the nodes a cluster contains,
at which levels it's attributes are (workclass, native-country),
the range costs for it's numeric attributes</p>
</div>
</div>
</section>
<section class="tsd-panel tsd-hierarchy">
<h3>Hierarchy</h3>
<ul class="tsd-hierarchy">
<li>
<span class="target">nodeCluster</span>
</li>
</ul>
</section>
<section class="tsd-panel-group tsd-index-group">
<h2>Index</h2>
<section class="tsd-panel tsd-index-panel">
<div class="tsd-index-content">
<section class="tsd-index-section ">
<h3>Properties</h3>
<ul class="tsd-index-list">
<li class="tsd-kind-property <API key>"><a href="_sangreea_sangreea_.nodecluster.html#gen_feat" class="tsd-kind-icon">gen_<wbr>feat</a></li>
<li class="tsd-kind-property <API key>"><a href="_sangreea_sangreea_.nodecluster.html#gen_ranges" class="tsd-kind-icon">gen_<wbr>ranges</a></li>
<li class="tsd-kind-property <API key>"><a href="_sangreea_sangreea_.nodecluster.html#nodes" class="tsd-kind-icon">nodes</a></li>
</ul>
</section>
</div>
</section>
</section>
<section class="tsd-panel-group tsd-member-group ">
<h2>Properties</h2>
<section class="tsd-panel tsd-member tsd-kind-property <API key>">
<a name="gen_feat" class="tsd-anchor"></a>
<h3>gen_<wbr>feat</h3>
<div class="tsd-signature tsd-kind-icon">gen_<wbr>feat<span class="<API key>">:</span> <span class="tsd-signature-type">object</span></div>
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/cassinius/AnonymizationJS/blob/master/src/SaNGreeA/SaNGreeA.ts#L47">SaNGreeA/SaNGreeA.ts:47</a></li>
</ul>
</aside>
<div class="<API key>">
<h4>Type declaration</h4>
<ul class="tsd-parameters">
<li class="<API key>">
<h5><span class="<API key>">[</span>id: <span class="tsd-signature-type">string</span><span class="<API key>">]: </span><span class="tsd-signature-type">string</span></h5>
</li>
</ul>
</div>
</section>
<section class="tsd-panel tsd-member tsd-kind-property <API key>">
<a name="gen_ranges" class="tsd-anchor"></a>
<h3>gen_<wbr>ranges</h3>
<div class="tsd-signature tsd-kind-icon">gen_<wbr>ranges<span class="<API key>">:</span> <span class="tsd-signature-type">object</span></div>
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/cassinius/AnonymizationJS/blob/master/src/SaNGreeA/SaNGreeA.ts#L48">SaNGreeA/SaNGreeA.ts:48</a></li>
</ul>
</aside>
<div class="<API key>">
<h4>Type declaration</h4>
<ul class="tsd-parameters">
<li class="<API key>">
<h5><span class="<API key>">[</span>id: <span class="tsd-signature-type">string</span><span class="<API key>">]: </span><span class="tsd-signature-type">number</span><span class="<API key>">[]</span></h5>
</li>
</ul>
</div>
</section>
<section class="tsd-panel tsd-member tsd-kind-property <API key>">
<a name="nodes" class="tsd-anchor"></a>
<h3>nodes</h3>
<div class="tsd-signature tsd-kind-icon">nodes<span class="<API key>">:</span> <span class="tsd-signature-type">object</span></div>
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/cassinius/AnonymizationJS/blob/master/src/SaNGreeA/SaNGreeA.ts#L46">SaNGreeA/SaNGreeA.ts:46</a></li>
</ul>
</aside>
<div class="<API key>">
<h4>Type declaration</h4>
<ul class="tsd-parameters">
<li class="<API key>">
<h5><span class="<API key>">[</span>id: <span class="tsd-signature-type">string</span><span class="<API key>">]: </span><span class="tsd-signature-type">any</span></h5>
</li>
</ul>
</div>
</section>
</section>
</div>
<div class="col-4 col-menu menu-sticky-wrap menu-highlight">
<nav class="tsd-navigation primary">
<ul>
<li class="globals ">
<a href="../globals.html"><em>Globals</em></a>
</li>
<li class=" <API key>">
<a href="../modules/<API key>.html">"<wbr>SaNGree<wbr>A/SNDistance<wbr>Funcs"</a>
</li>
<li class="current <API key>">
<a href="../modules/_sangreea_sangreea_.html">"<wbr>SaNGree<wbr>A/SaNGree<wbr>A"</a>
</li>
<li class=" <API key>">
<a href="../modules/<API key>.html">"config/<wbr>SaNGreeAConfig_<wbr>adult"</a>
</li>
<li class=" <API key>">
<a href="../modules/<API key>.html">"config/<wbr>SaNGreeAConfig_<wbr>house"</a>
</li>
<li class=" <API key>">
<a href="../modules/<API key>.html">"core/<wbr>Equivalence<wbr>Class"</a>
</li>
<li class=" <API key>">
<a href="../modules/<API key>.html">"core/<wbr>Gen<wbr>Hierarchies"</a>
</li>
<li class=" <API key>">
<a href="../modules/_io_csvinput_.html">"io/CSVInput"</a>
</li>
<li class=" <API key>">
<a href="../modules/_io_csvoutput_.html">"io/CSVOutput"</a>
</li>
</ul>
</nav>
<nav class="tsd-navigation secondary menu-sticky">
<ul class="before-current">
<li class=" tsd-kind-enum <API key>">
<a href="../enums/_sangreea_sangreea_.hierarchytype.html" class="tsd-kind-icon">Hierarchy<wbr>Type</a>
</li>
<li class=" tsd-kind-class <API key> tsd-is-not-exported">
<a href="../classes/_sangreea_sangreea_.sangreea.html" class="tsd-kind-icon">SaNGreeA</a>
</li>
<li class=" tsd-kind-interface <API key>">
<a href="_sangreea_sangreea_.isangreea.html" class="tsd-kind-icon">ISaNGreeA</a>
</li>
<li class=" tsd-kind-interface <API key>">
<a href="_sangreea_sangreea_.isangreeaconfig.html" class="tsd-kind-icon">ISaNGreeAConfig</a>
</li>
</ul>
<ul class="current">
<li class="current tsd-kind-interface <API key>">
<a href="_sangreea_sangreea_.nodecluster.html" class="tsd-kind-icon">node<wbr>Cluster</a>
<ul>
<li class=" tsd-kind-property <API key>">
<a href="_sangreea_sangreea_.nodecluster.html#gen_feat" class="tsd-kind-icon">gen_<wbr>feat</a>
</li>
<li class=" tsd-kind-property <API key>">
<a href="_sangreea_sangreea_.nodecluster.html#gen_ranges" class="tsd-kind-icon">gen_<wbr>ranges</a>
</li>
<li class=" tsd-kind-property <API key>">
<a href="_sangreea_sangreea_.nodecluster.html#nodes" class="tsd-kind-icon">nodes</a>
</li>
</ul>
</li>
</ul>
<ul class="after-current">
</ul>
</nav>
</div>
</div>
</div>
<footer class="with-border-bottom">
<div class="container">
<h2>Legend</h2>
<div class="tsd-legend-group">
<ul class="tsd-legend">
<li class="tsd-kind-module"><span class="tsd-kind-icon">Module</span></li>
<li class="<API key>"><span class="tsd-kind-icon">Object literal</span></li>
<li class="tsd-kind-variable"><span class="tsd-kind-icon">Variable</span></li>
<li class="tsd-kind-function"><span class="tsd-kind-icon">Function</span></li>
<li class="tsd-kind-function <API key>"><span class="tsd-kind-icon">Function with type parameter</span></li>
<li class="<API key>"><span class="tsd-kind-icon">Index signature</span></li>
<li class="tsd-kind-type-alias"><span class="tsd-kind-icon">Type alias</span></li>
</ul>
<ul class="tsd-legend">
<li class="tsd-kind-enum"><span class="tsd-kind-icon">Enumeration</span></li>
<li class="<API key>"><span class="tsd-kind-icon">Enumeration member</span></li>
<li class="tsd-kind-property <API key>"><span class="tsd-kind-icon">Property</span></li>
<li class="tsd-kind-method <API key>"><span class="tsd-kind-icon">Method</span></li>
</ul>
<ul class="tsd-legend">
<li class="tsd-kind-interface"><span class="tsd-kind-icon">Interface</span></li>
<li class="tsd-kind-interface <API key>"><span class="tsd-kind-icon">Interface with type parameter</span></li>
<li class="<API key> <API key>"><span class="tsd-kind-icon">Constructor</span></li>
<li class="tsd-kind-property <API key>"><span class="tsd-kind-icon">Property</span></li>
<li class="tsd-kind-method <API key>"><span class="tsd-kind-icon">Method</span></li>
<li class="<API key> <API key>"><span class="tsd-kind-icon">Index signature</span></li>
</ul>
<ul class="tsd-legend">
<li class="tsd-kind-class"><span class="tsd-kind-icon">Class</span></li>
<li class="tsd-kind-class <API key>"><span class="tsd-kind-icon">Class with type parameter</span></li>
<li class="<API key> <API key>"><span class="tsd-kind-icon">Constructor</span></li>
<li class="tsd-kind-property <API key>"><span class="tsd-kind-icon">Property</span></li>
<li class="tsd-kind-method <API key>"><span class="tsd-kind-icon">Method</span></li>
<li class="tsd-kind-accessor <API key>"><span class="tsd-kind-icon">Accessor</span></li>
<li class="<API key> <API key>"><span class="tsd-kind-icon">Index signature</span></li>
</ul>
<ul class="tsd-legend">
<li class="<API key> <API key> tsd-is-inherited"><span class="tsd-kind-icon">Inherited constructor</span></li>
<li class="tsd-kind-property <API key> tsd-is-inherited"><span class="tsd-kind-icon">Inherited property</span></li>
<li class="tsd-kind-method <API key> tsd-is-inherited"><span class="tsd-kind-icon">Inherited method</span></li>
<li class="tsd-kind-accessor <API key> tsd-is-inherited"><span class="tsd-kind-icon">Inherited accessor</span></li>
</ul>
<ul class="tsd-legend">
<li class="tsd-kind-property <API key> tsd-is-protected"><span class="tsd-kind-icon">Protected property</span></li>
<li class="tsd-kind-method <API key> tsd-is-protected"><span class="tsd-kind-icon">Protected method</span></li>
<li class="tsd-kind-accessor <API key> tsd-is-protected"><span class="tsd-kind-icon">Protected accessor</span></li>
</ul>
<ul class="tsd-legend">
<li class="tsd-kind-property <API key> tsd-is-private"><span class="tsd-kind-icon">Private property</span></li>
<li class="tsd-kind-method <API key> tsd-is-private"><span class="tsd-kind-icon">Private method</span></li>
<li class="tsd-kind-accessor <API key> tsd-is-private"><span class="tsd-kind-icon">Private accessor</span></li>
</ul>
<ul class="tsd-legend">
<li class="tsd-kind-property <API key> tsd-is-static"><span class="tsd-kind-icon">Static property</span></li>
<li class="<API key> <API key> tsd-is-static"><span class="tsd-kind-icon">Static method</span></li>
</ul>
</div>
</div>
</footer>
<div class="container tsd-generator">
<p>Generated using <a href="http://typedoc.io" target="_blank">TypeDoc</a></p>
</div>
<div class="overlay"></div>
<script src="../assets/js/main.js"></script>
<script>if (location.protocol == 'file:') document.write('<script src="../assets/js/search.js"><' + '/script>');</script>
</body>
</html> |
<table border="1" id="table1" style="border-collapse: collapse">
<tr>
<td height="25" align="center"><span style="font-size: 16px"></span></td>
<td height="25" align="center"><span style="font-size: 16px">241</span></td>
<td height="25" align="center"><span style="font-size: 16px"></span></td>
<td height="25px" align="center"><span style="font-size: 16px"></span></td>
</tr>
<tr>
<td colspan="4">
<table border="0" width="100%">
<tr>
<td valign="top">
<b></b></td>
<td>
<div>
241
241209—241221229
241174—241217222</div></td>
</tr>
</table>
</td>
</tr>
<tr>
<td colspan="4">
<table border="0" width="100%">
<tr>
<td valign="top">
<b></b></td>
<td>
<div>
241158—241223
241272500</div></td>
</tr>
</table>
</td>
</tr>
<tr>
<td colspan="4">
<table border="0" width="100%">
<tr>
<td valign="top">
<b></b></td>
<td>
<div>
241
241
241
——241241</div></td>
</tr>
</table>
</td>
</tr>
<tr>
<td colspan="4">
<table border="0" width="100%">
<tr>
<td valign="top">
<b></b></td>
<td>
<div></div></td>
</tr>
</table>
</td>
</tr>
<tr>
</tr></table> |
import org.projectodd.jrapidoc.annotation.rest.DocReturn;
import org.projectodd.jrapidoc.annotation.rest.DocReturns;
public class ReturnTypeExample {
@DocReturn(http = 200, type = Object.class, headers = {"X-Header", "X-Option"}, cookies = {"sessionid"}, description = "Some description")
public void foo(){}
@DocReturns({
@DocReturn(http = 200, type = Object.class, structure = DocReturn.Structure.ARRAY, headers = {"X-Header", "X-Option"}, cookies = {"sessionid"}),
@DocReturn(http = 200, type = Object.class, structure = DocReturn.Structure.MAP, headers = {"X-Header", "X-Option"}, cookies = {"sessionid"})
})
public void foo2(){}
} |
// This file is part of Eigen, a lightweight C++ template library
// for linear algebra.
// This Source Code Form is subject to the terms of the Mozilla
#ifndef EIGEN_MACROS_H
#define EIGEN_MACROS_H
// Eigen version and basic defaults
#define EIGEN_WORLD_VERSION 3
#define EIGEN_MAJOR_VERSION 3
#define EIGEN_MINOR_VERSION 90
#define <API key>(x,y,z) (EIGEN_WORLD_VERSION>x || (EIGEN_WORLD_VERSION>=x && \
(EIGEN_MAJOR_VERSION>y || (EIGEN_MAJOR_VERSION>=y && \
EIGEN_MINOR_VERSION>=z))))
#ifdef <API key>
#define <API key> Eigen::RowMajor
#else
#define <API key> Eigen::ColMajor
#endif
#ifndef <API key>
#define <API key> std::ptrdiff_t
#endif
// Upperbound on the C++ version to use.
// Expected values are 03, 11, 14, 17, etc.
// By default, let's use an arbitrarily large C++ version.
#ifndef EIGEN_MAX_CPP_VER
#define EIGEN_MAX_CPP_VER 99
#endif
/** Allows to disable some optimizations which might affect the accuracy of the result.
* Such optimization are enabled by default, and set EIGEN_FAST_MATH to 0 to disable them.
* They currently include:
* - single precision ArrayBase::sin() and ArrayBase::cos() for SSE and AVX vectorization.
*/
#ifndef EIGEN_FAST_MATH
#define EIGEN_FAST_MATH 1
#endif
#ifndef <API key>
// 131072 == 128 KB
#define <API key> 131072
#endif
// Compiler identification, EIGEN_COMP_*
\internal EIGEN_COMP_GNUC set to 1 for all compilers compatible with GCC
#ifdef __GNUC__
#define EIGEN_COMP_GNUC (__GNUC__*10+__GNUC_MINOR__)
#else
#define EIGEN_COMP_GNUC 0
#endif
\internal EIGEN_COMP_CLANG set to major+minor version (e.g., 307 for clang 3.7) if the compiler is clang
#if defined(__clang__)
#define EIGEN_COMP_CLANG (__clang_major__*100+__clang_minor__)
#else
#define EIGEN_COMP_CLANG 0
#endif
\internal EIGEN_COMP_LLVM set to 1 if the compiler backend is llvm
#if defined(__llvm__)
#define EIGEN_COMP_LLVM 1
#else
#define EIGEN_COMP_LLVM 0
#endif
\internal EIGEN_COMP_ICC set to __INTEL_COMPILER if the compiler is Intel compiler, 0 otherwise
#if defined(__INTEL_COMPILER)
#define EIGEN_COMP_ICC __INTEL_COMPILER
#else
#define EIGEN_COMP_ICC 0
#endif
\internal EIGEN_COMP_MINGW set to 1 if the compiler is mingw
#if defined(__MINGW32__)
#define EIGEN_COMP_MINGW 1
#else
#define EIGEN_COMP_MINGW 0
#endif
\internal EIGEN_COMP_SUNCC set to 1 if the compiler is Solaris Studio
#if defined(__SUNPRO_CC)
#define EIGEN_COMP_SUNCC 1
#else
#define EIGEN_COMP_SUNCC 0
#endif
\internal EIGEN_COMP_MSVC set to _MSC_VER if the compiler is Microsoft Visual C++, 0 otherwise.
#if defined(_MSC_VER)
#define EIGEN_COMP_MSVC _MSC_VER
#else
#define EIGEN_COMP_MSVC 0
#endif
#if defined(__NVCC__)
#if defined(<API key>) && (<API key> >= 9)
#define EIGEN_COMP_NVCC ((<API key> * 10000) + (<API key> * 100))
#elif defined(__CUDACC_VER__)
#define EIGEN_COMP_NVCC __CUDACC_VER__
#else
#error "NVCC did not define compiler version."
#endif
#else
#define EIGEN_COMP_NVCC 0
#endif
// For the record, here is a table summarizing the possible values for EIGEN_COMP_MSVC:
// name ver MSC_VER
// 2008 9 1500
// 2010 10 1600
// 2012 11 1700
// 2013 12 1800
// 2015 14 1900
// "15" 15 1900
// 2017-14.1 15.0 1910
// 2017-14.11 15.3 1911
// 2017-14.12 15.5 1912
// 2017-14.13 15.6 1913
// 2017-14.14 15.7 1914
\internal <API key> set to _MSVC_LANG if the compiler is Microsoft Visual C++, 0 otherwise.
#if defined(_MSVC_LANG)
#define <API key> _MSVC_LANG
#else
#define <API key> 0
#endif
// For the record, here is a table summarizing the possible values for <API key>:
// MSVC option Standard MSVC_LANG
// /std:c++14 (default as of VS 2019) C++14 201402L
// /std:c++17 C++17 201703L
// /std:c++latest >C++17 >201703L
\internal <API key> set to 1 if the compiler is really Microsoft Visual C++ and not ,e.g., ICC or clang-cl
#if EIGEN_COMP_MSVC && !(EIGEN_COMP_ICC || EIGEN_COMP_LLVM || EIGEN_COMP_CLANG)
#define <API key> _MSC_VER
#else
#define <API key> 0
#endif
\internal EIGEN_COMP_IBM set to xlc version if the compiler is IBM XL C++
// XLC version
// 3.1 0x0301
// 4.5 0x0405
// 5.0 0x0500
// 12.1 0x0C01
#if defined(__IBMCPP__) || defined(__xlc__) || defined(__ibmxl__)
#define EIGEN_COMP_IBM __xlC__
#else
#define EIGEN_COMP_IBM 0
#endif
\internal EIGEN_COMP_PGI set to PGI version if the compiler is Portland Group Compiler
#if defined(__PGI)
#define EIGEN_COMP_PGI (__PGIC__*100+__PGIC_MINOR__)
#else
#define EIGEN_COMP_PGI 0
#endif
\internal EIGEN_COMP_ARM set to 1 if the compiler is ARM Compiler
#if defined(__CC_ARM) || defined(__ARMCC_VERSION)
#define EIGEN_COMP_ARM 1
#else
#define EIGEN_COMP_ARM 0
#endif
\internal <API key> set to 1 if the compiler is Emscripten Compiler
#if defined(__EMSCRIPTEN__)
#define <API key> 1
#else
#define <API key> 0
#endif
\internal EIGEN_GNUC_STRICT set to 1 if the compiler is really GCC and not a compatible compiler (e.g., ICC, clang, mingw, etc.)
#if EIGEN_COMP_GNUC && !(EIGEN_COMP_CLANG || EIGEN_COMP_ICC || EIGEN_COMP_MINGW || EIGEN_COMP_PGI || EIGEN_COMP_IBM || EIGEN_COMP_ARM || <API key>)
#define <API key> 1
#else
#define <API key> 0
#endif
#if EIGEN_COMP_GNUC
#define EIGEN_GNUC_AT_LEAST(x,y) ((__GNUC__==x && __GNUC_MINOR__>=y) || __GNUC__>x)
#define EIGEN_GNUC_AT_MOST(x,y) ((__GNUC__==x && __GNUC_MINOR__<=y) || __GNUC__<x)
#define EIGEN_GNUC_AT(x,y) ( __GNUC__==x && __GNUC_MINOR__==y )
#else
#define EIGEN_GNUC_AT_LEAST(x,y) 0
#define EIGEN_GNUC_AT_MOST(x,y) 0
#define EIGEN_GNUC_AT(x,y) 0
#endif
// FIXME: could probably be removed as we do not support gcc 3.x anymore
#if EIGEN_COMP_GNUC && (__GNUC__ <= 3)
#define EIGEN_GCC3_OR_OLDER 1
#else
#define EIGEN_GCC3_OR_OLDER 0
#endif
// Architecture identification, EIGEN_ARCH_*
#if defined(__x86_64__) || defined(_M_X64) || defined(__amd64)
#define EIGEN_ARCH_x86_64 1
#else
#define EIGEN_ARCH_x86_64 0
#endif
#if defined(__i386__) || defined(_M_IX86) || defined(_X86_) || defined(__i386)
#define EIGEN_ARCH_i386 1
#else
#define EIGEN_ARCH_i386 0
#endif
#if EIGEN_ARCH_x86_64 || EIGEN_ARCH_i386
#define <API key> 1
#else
#define <API key> 0
#endif
\internal EIGEN_ARCH_ARM set to 1 if the architecture is ARM
#if defined(__arm__)
#define EIGEN_ARCH_ARM 1
#else
#define EIGEN_ARCH_ARM 0
#endif
\internal EIGEN_ARCH_ARM64 set to 1 if the architecture is ARM64
#if defined(__aarch64__)
#define EIGEN_ARCH_ARM64 1
#else
#define EIGEN_ARCH_ARM64 0
#endif
#if EIGEN_ARCH_ARM || EIGEN_ARCH_ARM64
#define <API key> 1
#else
#define <API key> 0
#endif
\internal EIGEN_ARCH_MIPS set to 1 if the architecture is MIPS
#if defined(__mips__) || defined(__mips)
#define EIGEN_ARCH_MIPS 1
#else
#define EIGEN_ARCH_MIPS 0
#endif
\internal EIGEN_ARCH_SPARC set to 1 if the architecture is SPARC
#if defined(__sparc__) || defined(__sparc)
#define EIGEN_ARCH_SPARC 1
#else
#define EIGEN_ARCH_SPARC 0
#endif
\internal EIGEN_ARCH_IA64 set to 1 if the architecture is Intel Itanium
#if defined(__ia64__)
#define EIGEN_ARCH_IA64 1
#else
#define EIGEN_ARCH_IA64 0
#endif
\internal EIGEN_ARCH_PPC set to 1 if the architecture is PowerPC
#if defined(__powerpc__) || defined(__ppc__) || defined(_M_PPC)
#define EIGEN_ARCH_PPC 1
#else
#define EIGEN_ARCH_PPC 0
#endif
// Operating system identification, EIGEN_OS_*
\internal EIGEN_OS_UNIX set to 1 if the OS is a unix variant
#if defined(__unix__) || defined(__unix)
#define EIGEN_OS_UNIX 1
#else
#define EIGEN_OS_UNIX 0
#endif
\internal EIGEN_OS_LINUX set to 1 if the OS is based on Linux kernel
#if defined(__linux__)
#define EIGEN_OS_LINUX 1
#else
#define EIGEN_OS_LINUX 0
#endif
\internal EIGEN_OS_ANDROID set to 1 if the OS is Android
// note: ANDROID is defined when using ndk_build, __ANDROID__ is defined when using a standalone toolchain.
#if defined(__ANDROID__) || defined(ANDROID)
#define EIGEN_OS_ANDROID 1
#else
#define EIGEN_OS_ANDROID 0
#endif
\internal EIGEN_OS_GNULINUX set to 1 if the OS is GNU Linux and not Linux-based OS (e.g., not android)
#if defined(__gnu_linux__) && !(EIGEN_OS_ANDROID)
#define EIGEN_OS_GNULINUX 1
#else
#define EIGEN_OS_GNULINUX 0
#endif
\internal EIGEN_OS_BSD set to 1 if the OS is a BSD variant
#if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__bsdi__) || defined(__DragonFly__)
#define EIGEN_OS_BSD 1
#else
#define EIGEN_OS_BSD 0
#endif
\internal EIGEN_OS_MAC set to 1 if the OS is MacOS
#if defined(__APPLE__)
#define EIGEN_OS_MAC 1
#else
#define EIGEN_OS_MAC 0
#endif
\internal EIGEN_OS_QNX set to 1 if the OS is QNX
#if defined(__QNX__)
#define EIGEN_OS_QNX 1
#else
#define EIGEN_OS_QNX 0
#endif
\internal EIGEN_OS_WIN set to 1 if the OS is Windows based
#if defined(_WIN32)
#define EIGEN_OS_WIN 1
#else
#define EIGEN_OS_WIN 0
#endif
\internal EIGEN_OS_WIN64 set to 1 if the OS is Windows 64bits
#if defined(_WIN64)
#define EIGEN_OS_WIN64 1
#else
#define EIGEN_OS_WIN64 0
#endif
\internal EIGEN_OS_WINCE set to 1 if the OS is Windows CE
#if defined(_WIN32_WCE)
#define EIGEN_OS_WINCE 1
#else
#define EIGEN_OS_WINCE 0
#endif
\internal EIGEN_OS_CYGWIN set to 1 if the OS is Windows/Cygwin
#if defined(__CYGWIN__)
#define EIGEN_OS_CYGWIN 1
#else
#define EIGEN_OS_CYGWIN 0
#endif
\internal EIGEN_OS_WIN_STRICT set to 1 if the OS is really Windows and not some variants
#if EIGEN_OS_WIN && !( EIGEN_OS_WINCE || EIGEN_OS_CYGWIN )
#define EIGEN_OS_WIN_STRICT 1
#else
#define EIGEN_OS_WIN_STRICT 0
#endif
\internal EIGEN_OS_SUN set to __SUNPRO_C if the OS is SUN
// compiler solaris __SUNPRO_C
// version studio
// 5.7 10 0x570
// 5.8 11 0x580
// 5.9 12 0x590
// 5.10 12.1 0x5100
// 5.11 12.2 0x5110
// 5.12 12.3 0x5120
#if (defined(sun) || defined(__sun)) && !(defined(__SVR4) || defined(__svr4__))
#define EIGEN_OS_SUN __SUNPRO_C
#else
#define EIGEN_OS_SUN 0
#endif
\internal EIGEN_OS_SOLARIS set to 1 if the OS is Solaris
#if (defined(sun) || defined(__sun)) && (defined(__SVR4) || defined(__svr4__))
#define EIGEN_OS_SOLARIS 1
#else
#define EIGEN_OS_SOLARIS 0
#endif
// Detect GPU compilers and architectures
// NVCC is not supported as the target platform for HIPCC
// Note that this also makes EIGEN_CUDACC and EIGEN_HIPCC mutually exclusive
#if defined(__NVCC__) && defined(__HIPCC__)
#error "NVCC as the target platform for HIPCC is currently not supported."
#endif
#if defined(__CUDACC__) && !defined(EIGEN_NO_CUDA)
// Means the compiler is either nvcc or clang with CUDA enabled
#define EIGEN_CUDACC __CUDACC__
#endif
#if defined(__CUDA_ARCH__) && !defined(EIGEN_NO_CUDA)
// Means we are generating code for the device
#define EIGEN_CUDA_ARCH __CUDA_ARCH__
#endif
#if defined(EIGEN_CUDACC)
#include <cuda.h>
#define EIGEN_CUDA_SDK_VER (CUDA_VERSION * 10)
#else
#define EIGEN_CUDA_SDK_VER 0
#endif
#if defined(__HIPCC__) && !defined(EIGEN_NO_HIP)
// Means the compiler is HIPCC (analogous to EIGEN_CUDACC, but for HIP)
#define EIGEN_HIPCC __HIPCC__
// We need to include hip_runtime.h here because it pulls in
// ++ hip_common.h which contains the define for <API key>
// ++ host_defines.h which contains the defines for the __host__ and __device__ macros
#include <hip/hip_runtime.h>
#if defined(<API key>)
// analogous to EIGEN_CUDA_ARCH, but for HIP
#define <API key> <API key>
#endif
#endif
// Unify CUDA/HIPCC
#if defined(EIGEN_CUDACC) || defined(EIGEN_HIPCC)
// If either EIGEN_CUDACC or EIGEN_HIPCC is defined, then define EIGEN_GPUCC
#define EIGEN_GPUCC
// EIGEN_HIPCC implies the HIP compiler and is used to tweak Eigen code for use in HIP kernels
// EIGEN_CUDACC implies the CUDA compiler and is used to tweak Eigen code for use in CUDA kernels
// In most cases the same tweaks are required to the Eigen code to enable in both the HIP and CUDA kernels.
// For those cases, the corresponding code should be guarded with
// #if defined(EIGEN_GPUCC)
// instead of
// #if defined(EIGEN_CUDACC) || defined(EIGEN_HIPCC)
// For cases where the tweak is specific to HIP, the code should be guarded with
// #if defined(EIGEN_HIPCC)
// For cases where the tweak is specific to CUDA, the code should be guarded with
// #if defined(EIGEN_CUDACC)
#endif
#if defined(EIGEN_CUDA_ARCH) || defined(<API key>)
// If either EIGEN_CUDA_ARCH or <API key> is defined, then define <API key>
#define <API key>
// GPU compilers (HIPCC, NVCC) typically do two passes over the source code,
// + one to compile the source for the "host" (ie CPU)
// + another to compile the source for the "device" (ie. GPU)
// Code that needs to enabled only during the either the "host" or "device" compilation phase
// needs to be guarded with a macro that indicates the current compilation phase
// <API key> implies the device compilation phase in HIP
// EIGEN_CUDA_ARCH implies the device compilation phase in CUDA
// In most cases, the "host" / "device" specific code is the same for both HIP and CUDA
// For those cases, the code should be guarded with
// #if defined(<API key>)
// instead of
// #if defined(EIGEN_CUDA_ARCH) || defined(<API key>)
// For cases where the tweak is specific to HIP, the code should be guarded with
// #if defined(<API key>)
// For cases where the tweak is specific to CUDA, the code should be guarded with
// #if defined(EIGEN_CUDA_ARCH)
#endif
#if defined(EIGEN_USE_SYCL) && defined(<API key>)
// EIGEN_USE_SYCL is a user-defined macro while <API key> is a compiler-defined macro.
// In most cases we want to check if both macros are defined which can be done using the define below.
#define SYCL_DEVICE_ONLY
#endif
// Detect Compiler/Architecture/OS specific features
#if EIGEN_GNUC_AT_MOST(4,3) && !EIGEN_COMP_CLANG
// see bug 89
#define <API key> 0
#else
#define <API key> 1
#endif
// Cross compiler wrapper around LLVM's __has_builtin
#ifdef __has_builtin
# define EIGEN_HAS_BUILTIN(x) __has_builtin(x)
#else
# define EIGEN_HAS_BUILTIN(x) 0
#endif
// A Clang feature extension to determine compiler features.
// We use it to determine '<API key>'
#ifndef __has_feature
# define __has_feature(x) 0
#endif
// Some old compilers do not support template specializations like:
// template<typename T,int N> void foo(const T x[N]);
#if !( EIGEN_COMP_CLANG && ( (EIGEN_COMP_CLANG<309) \
|| (defined(<API key>) && (<API key> < 9000000))) \
|| <API key> && EIGEN_COMP_GNUC<49)
#define <API key> 1
#else
#define <API key> 0
#endif
// The macro EIGEN_COMP_CXXVER defines the c++ verson expected by the compiler.
// For instance, if compiling with gcc and -std=c++17, then EIGEN_COMP_CXXVER
// is defined to 17.
#if (defined(__cplusplus) && (__cplusplus > 201402L) || <API key> > 201402L)
#define EIGEN_COMP_CXXVER 17
#elif (defined(__cplusplus) && (__cplusplus > 201103L) || EIGEN_COMP_MSVC >= 1910)
#define EIGEN_COMP_CXXVER 14
#elif (defined(__cplusplus) && (__cplusplus >= 201103L) || EIGEN_COMP_MSVC >= 1900)
#define EIGEN_COMP_CXXVER 11
#else
#define EIGEN_COMP_CXXVER 03
#endif
// The macros EIGEN_HAS_CXX?? defines a rough estimate of available c++ features
// but in practice we should not rely on them but rather on the availabilty of
// individual features as defined later.
// This is why there is no EIGEN_HAS_CXX17.
// FIXME: get rid of EIGEN_HAS_CXX14 and maybe even EIGEN_HAS_CXX11.
#if EIGEN_MAX_CPP_VER>=11 && EIGEN_COMP_CXXVER>=11
#define EIGEN_HAS_CXX11 1
#else
#define EIGEN_HAS_CXX11 0
#endif
#if EIGEN_MAX_CPP_VER>=14 && EIGEN_COMP_CXXVER>=14
#define EIGEN_HAS_CXX14 1
#else
#define EIGEN_HAS_CXX14 0
#endif
// Do we support r-value references?
#ifndef <API key>
#if EIGEN_MAX_CPP_VER>=11 && \
(__has_feature(<API key>) || \
(defined(__cplusplus) && __cplusplus >= 201103L) || \
(EIGEN_COMP_MSVC >= 1600))
#define <API key> 1
#else
#define <API key> 0
#endif
#endif
// Does the compiler support C99?
// Need to include <cmath> to make sure _GLIBCXX_USE_C99 gets defined
#include <cmath>
#ifndef EIGEN_HAS_C99_MATH
#if EIGEN_MAX_CPP_VER>=11 && \
((defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901)) \
|| (defined(__GNUC__) && defined(_GLIBCXX_USE_C99)) \
|| (defined(_LIBCPP_VERSION) && !defined(_MSC_VER)) \
|| (EIGEN_COMP_MSVC >= 1900) || defined(SYCL_DEVICE_ONLY))
#define EIGEN_HAS_C99_MATH 1
#else
#define EIGEN_HAS_C99_MATH 0
#endif
#endif
// Does the compiler support result_of?
// It's likely that MSVC 2013 supports result_of but I couldn't not find a good source for that,
// so let's be conservative.
#ifndef <API key>
#if EIGEN_MAX_CPP_VER>=11 && \
(__has_feature(cxx_lambdas) || (defined(__cplusplus) && __cplusplus >= 201103L) || EIGEN_COMP_MSVC >= 1900)
#define <API key> 1
#else
#define <API key> 0
#endif
#endif
#ifndef EIGEN_HAS_ALIGNAS
#if EIGEN_MAX_CPP_VER>=11 && EIGEN_HAS_CXX11 && \
( __has_feature(cxx_alignas) \
|| EIGEN_HAS_CXX14 \
|| (EIGEN_COMP_MSVC >= 1800) \
|| (EIGEN_GNUC_AT_LEAST(4,8)) \
|| (EIGEN_COMP_CLANG>=305) \
|| (EIGEN_COMP_ICC>=1500) \
|| (EIGEN_COMP_PGI>=1500) \
|| (EIGEN_COMP_SUNCC>=0x5130))
#define EIGEN_HAS_ALIGNAS 1
#else
#define EIGEN_HAS_ALIGNAS 0
#endif
#endif
// Does the compiler support type_traits?
// - full support of type traits was added only to GCC 5.1.0.
// - 20150626 corresponds to the last release of 4.x libstdc++
#ifndef <API key>
#if EIGEN_MAX_CPP_VER>=11 && (EIGEN_HAS_CXX11 || EIGEN_COMP_MSVC >= 1700) \
&& ((!<API key>) || EIGEN_GNUC_AT_LEAST(5, 1)) \
&& ((!defined(__GLIBCXX__)) || __GLIBCXX__ > 20150626)
#define <API key> 1
#define <API key>
#else
#define <API key> 0
#endif
#endif
// Does the compiler support variadic templates?
#ifndef <API key>
#if EIGEN_MAX_CPP_VER>=11 && (__cplusplus > 199711L || EIGEN_COMP_MSVC >= 1900) \
&& (!defined(__NVCC__) || !<API key> || (EIGEN_COMP_NVCC >= 80000) )
// ^^ Disable the use of variadic templates when compiling with versions of nvcc older than 8.0 on ARM devices:
// this prevents nvcc from crashing when compiling Eigen on Tegra X1
#define <API key> 1
#elif EIGEN_MAX_CPP_VER>=11 && (__cplusplus > 199711L || EIGEN_COMP_MSVC >= 1900) && defined(SYCL_DEVICE_ONLY)
#define <API key> 1
#else
#define <API key> 0
#endif
#endif
// Does the compiler fully support const expressions? (as in c++14)
#ifndef EIGEN_HAS_CONSTEXPR
#if defined(EIGEN_CUDACC)
// Const expressions are supported provided that c++11 is enabled and we're using either clang or nvcc 7.5 or above
#if EIGEN_MAX_CPP_VER>=14 && (__cplusplus > 199711L && (EIGEN_COMP_CLANG || EIGEN_COMP_NVCC >= 70500))
#define EIGEN_HAS_CONSTEXPR 1
#endif
#elif EIGEN_MAX_CPP_VER>=14 && (__has_feature(<API key>) || (defined(__cplusplus) && __cplusplus >= 201402L) || \
(EIGEN_GNUC_AT_LEAST(4,8) && (__cplusplus > 199711L)) || \
(EIGEN_COMP_CLANG >= 306 && (__cplusplus > 199711L)))
#define EIGEN_HAS_CONSTEXPR 1
#endif
#ifndef EIGEN_HAS_CONSTEXPR
#define EIGEN_HAS_CONSTEXPR 0
#endif
#endif // EIGEN_HAS_CONSTEXPR
// Does the compiler support C++11 math?
// Let's be conservative and enable the default C++11 implementation only if we are sure it exists
#ifndef <API key>
#if EIGEN_MAX_CPP_VER>=11 && ((__cplusplus > 201103L) || (__cplusplus >= 201103L) && (<API key> || EIGEN_COMP_CLANG || EIGEN_COMP_MSVC || EIGEN_COMP_ICC) \
&& (<API key>) && (EIGEN_OS_GNULINUX || EIGEN_OS_WIN_STRICT || EIGEN_OS_MAC))
#define <API key> 1
#else
#define <API key> 0
#endif
#endif
// Does the compiler support proper C++11 containers?
#ifndef <API key>
#if EIGEN_MAX_CPP_VER>=11 && \
((__cplusplus > 201103L) \
|| ((__cplusplus >= 201103L) && (<API key> || EIGEN_COMP_CLANG || EIGEN_COMP_ICC>=1400)) \
|| EIGEN_COMP_MSVC >= 1900)
#define <API key> 1
#else
#define <API key> 0
#endif
#endif
// Does the compiler support C++11 noexcept?
#ifndef <API key>
#if EIGEN_MAX_CPP_VER>=11 && \
(__has_feature(cxx_noexcept) \
|| (__cplusplus > 201103L) \
|| ((__cplusplus >= 201103L) && (<API key> || EIGEN_COMP_CLANG || EIGEN_COMP_ICC>=1400)) \
|| EIGEN_COMP_MSVC >= 1900)
#define <API key> 1
#else
#define <API key> 0
#endif
#endif
#ifndef <API key>
#if EIGEN_MAX_CPP_VER>=11 && \
(__has_feature(cxx_atomic) \
|| (__cplusplus > 201103L) \
|| ((__cplusplus >= 201103L) && (EIGEN_COMP_MSVC==0 || EIGEN_COMP_MSVC >= 1700)))
#define <API key> 1
#else
#define <API key> 0
#endif
#endif
#ifndef <API key>
#if EIGEN_MAX_CPP_VER>=11 && \
(__cplusplus >= 201103L || EIGEN_COMP_MSVC >= 1700)
#define <API key> 1
#else
#define <API key> 0
#endif
#endif
// NOTE: the required Apple's clang version is very conservative
// and it could be that XCode 9 works just fine.
// and not tested.
#ifndef <API key>
#if EIGEN_MAX_CPP_VER>=17 && EIGEN_COMP_CXXVER>=17 && ( \
(EIGEN_COMP_MSVC >= 1912) \
|| (EIGEN_GNUC_AT_LEAST(7,0)) \
|| ((!defined(<API key>)) && (EIGEN_COMP_CLANG>=500)) \
|| (( defined(<API key>)) && (<API key>>=10000000)) \
)
#define <API key> 1
#else
#define <API key> 0
#endif
#endif
#if defined(EIGEN_CUDACC) && EIGEN_HAS_CONSTEXPR
// While available already with c++11, this is useful mostly starting with c++14 and relaxed constexpr rules
#if defined(__NVCC__)
// nvcc considers constexpr functions as __host__ __device__ with the option --<API key>
#ifdef <API key>
#define <API key>
#endif
#elif defined(__clang__) && defined(__CUDA__) && __has_feature(<API key>)
// clang++ always considers constexpr functions as implicitly __host__ __device__
#define <API key>
#endif
#endif
// Does the compiler support the __int128 and __uint128_t extensions for 128-bit
// integer arithmetic?
// Clang and GCC define __SIZEOF_INT128__ when these extensions are supported,
// but we avoid using them in certain cases:
// * Building using Clang for Windows, where the Clang runtime library has
// 128-bit support only on LP64 architectures, but Windows is LLP64.
#ifndef <API key>
#if defined(__SIZEOF_INT128__) && !(EIGEN_OS_WIN && EIGEN_COMP_CLANG)
#define <API key> 1
#else
#define <API key> 0
#endif
#endif
// Preprocessor programming helpers
// This macro can be used to prevent from macro expansion, e.g.:
// std::max EIGEN_NOT_A_MACRO(a,b)
#define EIGEN_NOT_A_MACRO
#define EIGEN_DEBUG_VAR(x) std::cerr << #x << " = " << x << std::endl;
// concatenate two tokens
#define EIGEN_CAT2(a,b) a
#define EIGEN_CAT(a,b) EIGEN_CAT2(a,b)
#define EIGEN_COMMA ,
// convert a token to a string
#define EIGEN_MAKESTRING2(a)
#define EIGEN_MAKESTRING(a) EIGEN_MAKESTRING2(a)
// EIGEN_STRONG_INLINE is a stronger version of the inline, using __forceinline on MSVC,
// but it still doesn't use GCC's always_inline. This is useful in (common) situations where MSVC needs forceinline
// but GCC is still doing fine with just inline.
#ifndef EIGEN_STRONG_INLINE
#if EIGEN_COMP_MSVC || EIGEN_COMP_ICC
#define EIGEN_STRONG_INLINE __forceinline
#else
#define EIGEN_STRONG_INLINE inline
#endif
#endif
// EIGEN_ALWAYS_INLINE is the stronget, it has the effect of making the function inline and adding every possible
// attribute to maximize inlining. This should only be used when really necessary: in particular,
// it uses __attribute__((always_inline)) on GCC, which most of the time is useless and can severely harm compile times.
// FIXME with the always_inline attribute,
// gcc 3.4.x and 4.1 reports the following compilation error:
// Eval.h:91: sorry, unimplemented: inlining failed in call to 'const Eigen::Eval<Derived> Eigen::MatrixBase<Scalar, Derived>::eval() const'
// : function body not available
// See also bug 1367
#if EIGEN_GNUC_AT_LEAST(4,2) && !defined(SYCL_DEVICE_ONLY)
#define EIGEN_ALWAYS_INLINE __attribute__((always_inline)) inline
#else
#define EIGEN_ALWAYS_INLINE EIGEN_STRONG_INLINE
#endif
#if EIGEN_COMP_GNUC
#define EIGEN_DONT_INLINE __attribute__((noinline))
#elif EIGEN_COMP_MSVC
#define EIGEN_DONT_INLINE __declspec(noinline)
#else
#define EIGEN_DONT_INLINE
#endif
#if EIGEN_COMP_GNUC
#define <API key> __extension__
#else
#define <API key>
#endif
// GPU stuff
// Disable some features when compiling with GPU compilers (NVCC/clang-cuda/SYCL/HIPCC)
#if defined(EIGEN_CUDACC) || defined(SYCL_DEVICE_ONLY) || defined(EIGEN_HIPCC)
// Do not try asserts on device code
#ifndef EIGEN_NO_DEBUG
#define EIGEN_NO_DEBUG
#endif
#ifdef <API key>
#undef <API key>
#endif
#ifdef EIGEN_EXCEPTIONS
#undef EIGEN_EXCEPTIONS
#endif
#endif
#if defined(SYCL_DEVICE_ONLY)
#ifndef <API key>
#define <API key>
#endif
#define EIGEN_DEVICE_FUNC __attribute__((flatten)) __attribute__((always_inline))
// All functions callable from CUDA/HIP code must be qualified with __device__
#elif defined(EIGEN_GPUCC)
#define EIGEN_DEVICE_FUNC __host__ __device__
#else
#define EIGEN_DEVICE_FUNC
#endif
// this macro allows to get rid of linking errors about multiply defined functions.
// - static is not very good because it prevents definitions from different object files to be merged.
// So static causes the resulting linked executable to be bloated with multiple copies of the same function.
// - inline is not perfect either as it unwantedly hints the compiler toward inlining the function.
#define <API key> EIGEN_DEVICE_FUNC
#define <API key> EIGEN_DEVICE_FUNC inline
#ifdef NDEBUG
# ifndef EIGEN_NO_DEBUG
# define EIGEN_NO_DEBUG
# endif
#endif
// eigen_plain_assert is where we implement the workaround for the assert() bug in GCC <= 4.3, see bug 89
#ifdef EIGEN_NO_DEBUG
#ifdef SYCL_DEVICE_ONLY // used to silence the warning on SYCL device
#define eigen_plain_assert(x) <API key>(x)
#else
#define eigen_plain_assert(x)
#endif
#else
#if <API key>
namespace Eigen {
namespace internal {
inline bool copy_bool(bool b) { return b; }
}
}
#define eigen_plain_assert(x) assert(x)
#else
// work around bug 89
#include <cstdlib> // for abort
#include <iostream> // for std::cerr
namespace Eigen {
namespace internal {
// trivial function copying a bool. Must be EIGEN_DONT_INLINE, so we implement it after including Eigen headers.
// see bug 89.
namespace {
EIGEN_DONT_INLINE bool copy_bool(bool b) { return b; }
}
inline void assert_fail(const char *condition, const char *function, const char *file, int line)
{
std::cerr << "assertion failed: " << condition << " in function " << function << " at " << file << ":" << line << std::endl;
abort();
}
}
}
#define eigen_plain_assert(x) \
do { \
if(!Eigen::internal::copy_bool(x)) \
Eigen::internal::assert_fail(EIGEN_MAKESTRING(x), __PRETTY_FUNCTION__, __FILE__, __LINE__); \
} while(false)
#endif
#endif
// eigen_assert can be overridden
#ifndef eigen_assert
#define eigen_assert(x) eigen_plain_assert(x)
#endif
#ifdef <API key>
#define <API key>(x) eigen_assert(x)
#else
#define <API key>(x)
#endif
#ifdef EIGEN_NO_DEBUG
#define <API key>(x) <API key>(x)
#else
#define <API key>(x)
#endif
#ifndef <API key>
#if EIGEN_COMP_GNUC
#define EIGEN_DEPRECATED __attribute__((deprecated))
#elif EIGEN_COMP_MSVC
#define EIGEN_DEPRECATED __declspec(deprecated)
#else
#define EIGEN_DEPRECATED
#endif
#else
#define EIGEN_DEPRECATED
#endif
#if EIGEN_COMP_GNUC
#define EIGEN_UNUSED __attribute__((unused))
#else
#define EIGEN_UNUSED
#endif
// Suppresses 'unused variable' warnings.
namespace Eigen {
namespace internal {
template<typename T> EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void <API key>(const T&) {}
}
}
#define <API key>(var) Eigen::internal::<API key>(var);
#if !defined(EIGEN_ASM_COMMENT)
#if EIGEN_COMP_GNUC && (<API key> || <API key>)
#define EIGEN_ASM_COMMENT(X) __asm__("
#else
#define EIGEN_ASM_COMMENT(X)
#endif
#endif
#if EIGEN_COMP_MSVC
// NOTE MSVC often gives C4127 warnings with compiletime if statements. See bug 1362.
// This workaround is ugly, but it does the job.
# define <API key>(cond) (void)0, cond
#else
# define <API key>(cond) cond
#endif
#ifdef <API key>
#define EIGEN_RESTRICT
#endif
#ifndef EIGEN_RESTRICT
#define EIGEN_RESTRICT __restrict
#endif
#ifndef <API key>
#ifdef EIGEN_MAKING_DOCS
// format used in Eigen's documentation
// needed to define it here as escaping characters in CMake add_definition's argument seems very problematic.
#define <API key> Eigen::IOFormat(3, 0, " ", "\n", "", "")
#else
#define <API key> Eigen::IOFormat()
#endif
#endif
// just an empty macro !
#define EIGEN_EMPTY
// When compiling CUDA/HIP device code with NVCC or HIPCC
// pull in math functions from the global namespace.
// In host mode, and when device code is compiled with clang,
// use the std versions.
#if (defined(EIGEN_CUDA_ARCH) && defined(__NVCC__)) || defined(<API key>)
#define <API key>(FUNC) using ::FUNC;
#else
#define <API key>(FUNC) using std::FUNC;
#endif
// When compiling HIP device code with HIPCC, certain functions
// from the stdlib need to be pulled in from the global namespace
// (as opposed to from the std:: namespace). This is because HIPCC
// does not natively support all the std:: routines in device code.
// Instead it contains header files that declare the corresponding
// routines in the global namespace such they can be used in device code.
#if defined(<API key>)
#define EIGEN_USING_STD(FUNC) using ::FUNC;
#else
#define EIGEN_USING_STD(FUNC) using std::FUNC;
#endif
#if <API key> && (EIGEN_COMP_MSVC < 1900 || EIGEN_COMP_NVCC)
// for older MSVC versions, as well as 1900 && CUDA 8, using the base operator is sufficient (cf Bugs 1000, 1324)
#define <API key>(Derived) \
using Base::operator =;
#define <API key>(Derived) \
using Base::operator =; \
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Derived& operator=(const Derived& other) { Base::operator=(other); return *this; } \
template <typename OtherDerived> \
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Derived& operator=(const DenseBase<OtherDerived>& other) { Base::operator=(other.derived()); return *this; }
#else
#define <API key>(Derived) \
using Base::operator =; \
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Derived& operator=(const Derived& other) \
{ \
Base::operator=(other); \
return *this; \
}
#endif
/**
* \internal
* \brief Macro to explicitly define the default copy constructor.
* This is necessary, because the implicit definition is deprecated if the copy-assignment is overridden.
*/
#if EIGEN_HAS_CXX11
#define <API key>(CLASS) EIGEN_DEVICE_FUNC CLASS(const CLASS&) = default;
#else
#define <API key>(CLASS)
#endif
/** \internal
* \brief Macro to manually inherit assignment operators.
* This is necessary, because the implicitly defined assignment operator gets deleted when a custom operator= is defined.
* With C++11 or later this also default-implements the copy-constructor
*/
#define <API key>(Derived) \
<API key>(Derived) \
<API key>(Derived)
/** \internal
* \brief Macro to manually define default constructors and destructors.
* This is necessary when the copy constructor is re-defined.
* For empty helper classes this should usually be protected, to avoid accidentally creating empty objects.
*
* Hiding the default destructor lead to problems in C++03 mode together with boost::multiprecision
*/
#if EIGEN_HAS_CXX11
#define <API key>(Derived) \
EIGEN_DEVICE_FUNC Derived() = default; \
EIGEN_DEVICE_FUNC ~Derived() = default;
#else
#define <API key>(Derived) \
EIGEN_DEVICE_FUNC Derived() {}; \
/* EIGEN_DEVICE_FUNC ~Derived() {}; */
#endif
/**
* Just a side note. Commenting within defines works only by documenting
* behind the object (via '!<'). Comments cannot be multi-line and thus
* we have these extra long lines. What is confusing doxygen over here is
* that we use '\' and basically have a bunch of typedefs with their
* documentation in a single line.
**/
#define <API key>(Derived) \
typedef typename Eigen::internal::traits<Derived>::Scalar Scalar; /*!< \brief Numeric type, e.g. float, double, int or std::complex<float>. */ \
typedef typename Eigen::NumTraits<Scalar>::Real RealScalar; /*!< \brief The underlying numeric type for composed scalar types. \details In cases where Scalar is e.g. std::complex<T>, T were corresponding to RealScalar. */ \
typedef typename Base::CoeffReturnType CoeffReturnType; /*!< \brief The return type for coefficient access. \details Depending on whether the object allows direct coefficient access (e.g. for a MatrixXd), this type is either 'const Scalar&' or simply 'Scalar' for objects that do not allow direct coefficient access. */ \
typedef typename Eigen::internal::ref_selector<Derived>::type Nested; \
typedef typename Eigen::internal::traits<Derived>::StorageKind StorageKind; \
typedef typename Eigen::internal::traits<Derived>::StorageIndex StorageIndex; \
enum CompileTimeTraits \
{ RowsAtCompileTime = Eigen::internal::traits<Derived>::RowsAtCompileTime, \
ColsAtCompileTime = Eigen::internal::traits<Derived>::ColsAtCompileTime, \
Flags = Eigen::internal::traits<Derived>::Flags, \
SizeAtCompileTime = Base::SizeAtCompileTime, \
<API key> = Base::<API key>, \
<API key> = Base::<API key> }; \
using Base::derived; \
using Base::const_cast_derived;
// FIXME Maybe the <API key> could be removed as importing PacketScalar is rarely needed
#define <API key>(Derived) \
<API key>(Derived) \
typedef typename Base::PacketScalar PacketScalar;
#define <API key>(a,b) (((int)a <= (int)b) ? (int)a : (int)b)
#define <API key>(a,b) (((int)a >= (int)b) ? (int)a : (int)b)
// <API key> gives the min between compile-time sizes. 0 has absolute priority, followed by 1,
// followed by Dynamic, followed by other finite values. The reason for giving Dynamic the priority over
// finite values is that min(3, Dynamic) should be Dynamic, since that could be anything between 0 and 3.
#define <API key>(a,b) (((int)a == 0 || (int)b == 0) ? 0 \
: ((int)a == 1 || (int)b == 1) ? 1 \
: ((int)a == Dynamic || (int)b == Dynamic) ? Dynamic \
: ((int)a <= (int)b) ? (int)a : (int)b)
// <API key> is a variant of <API key> comparing MaxSizes. The difference is that finite values
// now have priority over Dynamic, so that min(3, Dynamic) gives 3. Indeed, whatever the actual value is
// (between 0 and 3), it is not more than 3.
#define <API key>(a,b) (((int)a == 0 || (int)b == 0) ? 0 \
: ((int)a == 1 || (int)b == 1) ? 1 \
: ((int)a == Dynamic && (int)b == Dynamic) ? Dynamic \
: ((int)a == Dynamic) ? (int)b \
: ((int)b == Dynamic) ? (int)a \
: ((int)a <= (int)b) ? (int)a : (int)b)
// see <API key>. No need for a separate variant for MaxSizes here.
#define EIGEN_SIZE_MAX(a,b) (((int)a == Dynamic || (int)b == Dynamic) ? Dynamic \
: ((int)a >= (int)b) ? (int)a : (int)b)
#define EIGEN_LOGICAL_XOR(a,b) (((a) || (b)) && !((a) && (b)))
#define EIGEN_IMPLIES(a,b) (!(a) || (b))
#if EIGEN_HAS_BUILTIN(__builtin_expect) || EIGEN_COMP_GNUC
#define EIGEN_PREDICT_FALSE(x) (__builtin_expect(x, false))
#define EIGEN_PREDICT_TRUE(x) (__builtin_expect(false || (x), true))
#else
#define EIGEN_PREDICT_FALSE(x) (x)
#define EIGEN_PREDICT_TRUE(x) (x)
#endif
// the expression type of a standard coefficient wise binary operation
#define <API key>(LHS,RHS,OPNAME) \
CwiseBinaryOp< \
EIGEN_CAT(EIGEN_CAT(internal::scalar_,OPNAME),_op)< \
typename internal::traits<LHS>::Scalar, \
typename internal::traits<RHS>::Scalar \
>, \
const LHS, \
const RHS \
>
#define <API key>(METHOD,OPNAME) \
template<typename OtherDerived> \
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const <API key>(Derived,OtherDerived,OPNAME) \
(METHOD)(const <API key><OtherDerived> &other) const \
{ \
return <API key>(Derived,OtherDerived,OPNAME)(derived(), other.derived()); \
}
#define <API key>(OPNAME,TYPEA,TYPEB) \
(Eigen::internal::has_ReturnType<Eigen::<API key><TYPEA,TYPEB,EIGEN_CAT(EIGEN_CAT(Eigen::internal::scalar_,OPNAME),_op)<TYPEA,TYPEB> > >::value)
#define <API key>(EXPR,SCALAR,OPNAME) \
CwiseBinaryOp<EIGEN_CAT(EIGEN_CAT(internal::scalar_,OPNAME),_op)<typename internal::traits<EXPR>::Scalar,SCALAR>, const EXPR, \
const typename internal::plain_constant_type<EXPR,SCALAR>::type>
#define <API key>(SCALAR,EXPR,OPNAME) \
CwiseBinaryOp<EIGEN_CAT(EIGEN_CAT(internal::scalar_,OPNAME),_op)<SCALAR,typename internal::traits<EXPR>::Scalar>, \
const typename internal::plain_constant_type<EXPR,SCALAR>::type, const EXPR>
// Workaround for MSVC 2010 (see ML thread "patch with compile for for MSVC 2010")
#if <API key> && (<API key><=1600)
#define <API key>(X) typename internal::enable_if<true,X>::type
#else
#define <API key>(X) X
#endif
#define <API key>(METHOD,OPNAME) \
template <typename T> EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE \
<API key>(const <API key>(Derived,typename internal::promote_scalar_arg<Scalar EIGEN_COMMA T EIGEN_COMMA <API key>(OPNAME,Scalar,T)>::type,OPNAME))\
(METHOD)(const T& scalar) const { \
typedef typename internal::promote_scalar_arg<Scalar,T,<API key>(OPNAME,Scalar,T)>::type PromotedT; \
return <API key>(Derived,PromotedT,OPNAME)(derived(), \
typename internal::plain_constant_type<Derived,PromotedT>::type(derived().rows(), derived().cols(), internal::scalar_constant_op<PromotedT>(scalar))); \
}
#define <API key>(METHOD,OPNAME) \
template <typename T> EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE friend \
<API key>(const <API key>(typename internal::promote_scalar_arg<Scalar EIGEN_COMMA T EIGEN_COMMA <API key>(OPNAME,T,Scalar)>::type,Derived,OPNAME)) \
(METHOD)(const T& scalar, const StorageBaseType& matrix) { \
typedef typename internal::promote_scalar_arg<Scalar,T,<API key>(OPNAME,T,Scalar)>::type PromotedT; \
return <API key>(PromotedT,Derived,OPNAME)( \
typename internal::plain_constant_type<Derived,PromotedT>::type(matrix.derived().rows(), matrix.derived().cols(), internal::scalar_constant_op<PromotedT>(scalar)), matrix.derived()); \
}
#define <API key>(METHOD,OPNAME) \
<API key>(METHOD,OPNAME) \
<API key>(METHOD,OPNAME)
#if (defined(_CPPUNWIND) || defined(__EXCEPTIONS)) && !defined(EIGEN_CUDA_ARCH) && !defined(EIGEN_EXCEPTIONS) && !defined(EIGEN_USE_SYCL) && !defined(<API key>)
#define EIGEN_EXCEPTIONS
#endif
#ifdef EIGEN_EXCEPTIONS
# define EIGEN_THROW_X(X) throw X
# define EIGEN_THROW throw
# define EIGEN_TRY try
# define EIGEN_CATCH(X) catch (X)
#else
# if defined(EIGEN_CUDA_ARCH)
# define EIGEN_THROW_X(X) asm("trap;")
# define EIGEN_THROW asm("trap;")
# elif defined(<API key>)
# define EIGEN_THROW_X(X) asm("s_trap 0")
# define EIGEN_THROW asm("s_trap 0")
# else
# define EIGEN_THROW_X(X) std::abort()
# define EIGEN_THROW std::abort()
# endif
# define EIGEN_TRY if (true)
# define EIGEN_CATCH(X) else
#endif
#if <API key>
# define <API key>
# define EIGEN_NOEXCEPT noexcept
# define EIGEN_NOEXCEPT_IF(x) noexcept(x)
# define EIGEN_NO_THROW noexcept(true)
# define <API key>(X) noexcept(false)
#else
# define EIGEN_NOEXCEPT
# define EIGEN_NOEXCEPT_IF(x)
# define EIGEN_NO_THROW throw()
# if EIGEN_COMP_MSVC || EIGEN_COMP_CXXVER>=17
// MSVC does not support exception specifications (warning C4290),
// and they are deprecated in c++11 anyway. This is even an error in c++17.
# define <API key>(X) throw()
# else
# define <API key>(X) throw(X)
# endif
#endif
#if <API key>
// The all function is used to enable a variadic version of eigen_assert which can take a parameter pack as its input.
namespace Eigen {
namespace internal {
inline bool all(){ return true; }
template<typename T, typename ...Ts>
bool all(T t, Ts ... ts){ return t && all(ts...); }
}
}
#endif
#if <API key>
// provide override and final specifiers if they are available:
# define EIGEN_OVERRIDE override
# define EIGEN_FINAL final
#else
# define EIGEN_OVERRIDE
# define EIGEN_FINAL
#endif
// Wrapping #pragma unroll in a macro since it is required for SYCL
#if defined(SYCL_DEVICE_ONLY)
#if defined(_MSC_VER)
#define EIGEN_UNROLL_LOOP __pragma(unroll)
#else
#define EIGEN_UNROLL_LOOP _Pragma("unroll")
#endif
#else
#define EIGEN_UNROLL_LOOP
#endif
#endif // EIGEN_MACROS_H |
# AUTOGENERATED FILE
FROM balenalib/<API key>:buster-build
# remove several traces of debian python
RUN apt-get purge -y python.*
# > At the moment, setting "LANG=C" on a Linux system *fundamentally breaks Python 3*, and that's not OK.
ENV LANG C.UTF-8
# key 63C7CC90: public key "Simon McVittie <smcv@pseudorandom.co.uk>" imported
# key 3372DCFA: public key "Donald Stufft (dstufft) <donald@stufft.io>" imported
RUN gpg --batch --keyserver keyring.debian.org --recv-keys 4DE8FF2A63C7CC90 \
&& gpg --batch --keyserver keyserver.ubuntu.com --recv-key 6E3CBCE93372DCFA \
&& gpg --batch --keyserver keyserver.ubuntu.com --recv-keys 0x52a43a1e4b77b059
ENV PYTHON_VERSION 3.7.9
# if this is called "PIP_VERSION", pip explodes with "ValueError: invalid truth value '<VERSION>'"
ENV PYTHON_PIP_VERSION 21.0.1
ENV SETUPTOOLS_VERSION 56.0.0
RUN set -x \
&& curl -SLO "http://resin-packages.s3.amazonaws.com/python/v$PYTHON_VERSION/Python-$PYTHON_VERSION.<API key>.1.tar.gz" \
&& echo "<SHA256-like> Python-$PYTHON_VERSION.<API key>.1.tar.gz" | sha256sum -c - \
&& tar -xzf "Python-$PYTHON_VERSION.<API key>.1.tar.gz" --strip-components=1 \
&& rm -rf "Python-$PYTHON_VERSION.<API key>.1.tar.gz" \
&& ldconfig \
&& if [ ! -e /usr/local/bin/pip3 ]; then : \
&& curl -SLO "https://raw.githubusercontent.com/pypa/get-pip/<SHA1-like>/get-pip.py" \
&& echo "<SHA256-like> get-pip.py" | sha256sum -c - \
&& python3 get-pip.py \
&& rm get-pip.py \
; fi \
&& pip3 install --no-cache-dir --upgrade --force-reinstall pip=="$PYTHON_PIP_VERSION" setuptools=="$SETUPTOOLS_VERSION" \
&& find /usr/local \
\( -type d -a -name test -o -name tests \) \
-o \( -type f -a -name '*.pyc' -o -name '*.pyo' \) \
-exec rm -rf '{}' + \
&& cd / \
&& rm -rf /usr/src/python ~/.cache
# install "virtualenv", since the vast majority of users of this image will want it
RUN pip3 install --no-cache-dir virtualenv
ENV PYTHON_DBUS_VERSION 1.2.8
# install dbus-python dependencies
RUN apt-get update && apt-get install -y --<API key> \
libdbus-1-dev \
libdbus-glib-1-dev \ |
(function() {
'use strict';
angular.module('app', [
'ui.router',
'restangular',
'ngMap',
'ngAnimate',
'thatisuday.ng-image-gallery',
'angular-flexslider',
'app.home',
]);
})(); |
package gw.internal.gosu.parser.java.classinfo;
import gw.config.CommonServices;
import gw.internal.gosu.parser.DefaultTypeLoader;
import gw.lang.reflect.IDefaultTypeLoader;
import gw.lang.reflect.ITypeRefFactory;
import gw.lang.reflect.<API key>;
import gw.lang.reflect.Modifier;
import gw.lang.reflect.TypeSystem;
import gw.lang.reflect.java.IJavaClassInfo;
import gw.lang.reflect.java.IJavaClassMethod;
import gw.lang.reflect.java.IJavaClassType;
import gw.lang.reflect.java.asm.AsmClass;
import gw.lang.reflect.module.IModule;
public class JavaSourceUtil {
public static IJavaClassInfo getClassInfo( AsmClass cls, IModule module ) {
if( isProxy( cls ) ) {
return getJavaClassInfo( cls, module );
} else {
if( !CommonServices.getPlatformHelper().isInIDE() ) {
// Don't try to load from source unless we have to, this saves a load of time esp. for case
// where we're loading an inner java class where replacing the '$' below with '.' we bascially
// put the type system through a load of unnecessary work.
IJavaClassInfo classInfo = getJavaClassInfo( cls, module );
if( classInfo != null ) {
return classInfo;
}
}
return getClassInfo( cls.getName().replace( '$', '.' ), module );
}
}
private static IJavaClassInfo getJavaClassInfo( AsmClass asmClass, IModule module ) {
for( IModule m : module.<API key>() ) {
TypeSystem.pushModule( m );
try {
DefaultTypeLoader defaultTypeLoader = (DefaultTypeLoader)m.getModuleTypeLoader().<API key>();
if( defaultTypeLoader != null ) {
IJavaClassInfo javaClassInfo = defaultTypeLoader.getJavaClassInfo( asmClass, module );
if( javaClassInfo != null ) {
return javaClassInfo;
}
}
}
finally {
TypeSystem.popModule( m );
}
}
return null;
}
public static IJavaClassInfo getClassInfo(Class aClass, IModule gosuModule) {
DefaultTypeLoader loader = (DefaultTypeLoader) gosuModule.getModuleTypeLoader().<API key>();
if (isProxy(aClass)) {
return loader.getJavaClassInfo( aClass, gosuModule );
} else if (aClass.isArray()) {
IJavaClassInfo classInfo = getClassInfo(aClass.getComponentType(), gosuModule);
IModule module = classInfo.getModule();
return loader.getJavaClassInfo(aClass, module);
} else {
if( !CommonServices.getPlatformHelper().isInIDE() ) {
// Don't try to load from source unless we have to, this saves a load of time esp. for case
// where we're loading an inner java class where replacing the '$' below with '.' we bascially
// put the type system through a load of unnecessary work.
IJavaClassInfo javaClassInfo = loader.getJavaClassInfo( aClass, gosuModule );
if (javaClassInfo != null) {
return javaClassInfo;
}
}
return getClassInfo(aClass.getName().replace('$', '.'), gosuModule);
}
}
private static boolean isProxy(AsmClass aClass) {
String name = aClass.getName();
return
name.endsWith(ITypeRefFactory.USER_PROXY_SUFFIX) ||
name.endsWith(ITypeRefFactory.SYSTEM_PROXY_SUFFIX);
}
private static boolean isProxy(Class aClass) {
String name = aClass.getName();
return
name.endsWith(ITypeRefFactory.USER_PROXY_SUFFIX) ||
name.endsWith(ITypeRefFactory.SYSTEM_PROXY_SUFFIX);
}
public static IJavaClassInfo getClassInfo(String qualifiedName, IModule gosuModule) {
for (IModule module : gosuModule.<API key>()) {
IDefaultTypeLoader loader = module.getModuleTypeLoader().<API key>();
if (loader != null) {
IJavaClassInfo javaClassInfo = loader.getJavaClassInfo(qualifiedName);
if (javaClassInfo != null) {
return javaClassInfo;
}
}
}
return null;
}
public static <API key>.<API key> getImplicitProperty(IJavaClassMethod method, boolean <API key>) {
IJavaClassType returnType = method.<API key>();
if (returnType != null) {
String returnTypeName = returnType.getName();
int argCount = method.getParameterTypes().length;
String name = method.getName();
if (argCount == 0 && !returnTypeName.equals("void")) {
if (name.startsWith(<API key>.GET) && (name.length() > <API key>.GET.length())) {
return new <API key>.<API key>(false, true, <API key>.capitalizeFirstChar(name.substring(3), <API key>));
} else if (name.startsWith(<API key>.IS) &&
(name.length() > <API key>.IS.length()) &&
(returnTypeName.equals("boolean") || returnTypeName.equals("java.lang.Boolean"))) {
return new <API key>.<API key>(false, true, <API key>.capitalizeFirstChar(name.substring(2), <API key>));
}
} else if (argCount == 1) {
if (returnTypeName.equals("void") && name.startsWith(<API key>.SET) && (name.length() > <API key>.SET.length())) {
return new <API key>.<API key>(true, false, <API key>.capitalizeFirstChar(name.substring(3), <API key>));
}
}
}
return null;
}
public static IJavaClassType resolveInnerClass(IJavaClassInfo rootType, String innerName, IJavaClassInfo whosAskin) {
for (IJavaClassInfo innerCls : rootType.getDeclaredClasses()) {
if (innerName.equals(innerCls.getSimpleName()) && isVisible(rootType, innerCls, whosAskin)) {
return innerCls;
}
}
return null;
}
private static boolean isVisible(IJavaClassInfo rootType, IJavaClassInfo innerClass, IJavaClassInfo whosAskin) {
if ((whosAskin == rootType) || Modifier.isPublic(innerClass.getModifiers()) || (isEnclosed(rootType, whosAskin))) {
return true;
}
if( innerClass.isProtected() && isDescendant(rootType, whosAskin) ) {
return true;
}
if (whosAskin.getNamespace().equals(rootType.getNamespace()) && innerClass.isInternal()) {
return true;
}
return false;
}
public static boolean isEnclosed(IJavaClassInfo enclosingClass, IJavaClassInfo nestedClass) {
IJavaClassInfo enclosingType = nestedClass.getEnclosingClass();
if (enclosingType == null) {
return false;
}
if (enclosingType == enclosingClass) {
return true;
}
return isEnclosed(enclosingClass, enclosingType);
}
public static boolean isDescendant(IJavaClassInfo ancestorClassInfo, IJavaClassInfo descendantClassInfo) {
IJavaClassInfo superclass = descendantClassInfo.getSuperclass();
if (superclass != null) {
if (superclass == ancestorClassInfo) {
return true;
}
if (isDescendant(ancestorClassInfo, superclass)) {
return true;
}
}
for (IJavaClassInfo iface : descendantClassInfo.getInterfaces()) {
if (iface == ancestorClassInfo) {
return true;
}
if (isDescendant(ancestorClassInfo, iface)) {
return true;
}
}
return false;
}
} |
# encoding: utf-8
# Universidade do Estado do Amazonas - UEA
# Prof. Jucimar Jr
# ULISSES ANTONIO ANTONINO DA COSTA - 1515090555
# TIAGO FERREIRA ARANHA - 1715310047
# VICTOR HUGO DE OLIVEIRA CARREIRA - 1715310063
# REINALDO VARGAS - 1715310054
numero1 = int(input("Informe inteiro: "))
numero2 = 0
operacao = 1
resultado = 0
sequencia = ""
while numero1 >= 0:
i = 1
fatorial1 = 1
while i <= numero1:
fatorial1 = fatorial1 * i
i += 1
i = 1
fatorial2 = 1
while i <= numero2:
fatorial2 = fatorial2 * i
i += 1
resultado = resultado + (fatorial1 / fatorial2) * operacao
if operacao == 1:
sequencia = sequencia + " + " + str(numero1) + "!/" + str(numero2) + "!"
else:
sequencia = sequencia + " - " + str(numero1) + "!/" + str(numero2) + "!"
numero1 -= 1
numero2 += 2
operacao *= -1
print("Sequência: %s" % sequencia)
print("Resultado: %5.2f\n" % resultado) |
package com.rey.material.widget;
import android.app.Dialog;
import android.content.Context;
import android.os.Bundle;
import android.os.Handler;
import android.os.Message;
import android.view.Window;
import com.rey.material.R;
import com.rey.material.util.LocaleUtil;
import com.rey.material.util.TypefaceUtil;
public class ProgressDialog extends Dialog implements Handler.Callback {
public static final int STYLE_SPINNER = 0;
/**
* Creates a ProgressDialog with a horizontal progress bar.
*/
public static final int STYLE_HORIZONTAL = 1;
public Context c;
public Dialog d;
public Button no;
int countValue;
TextView mProgressPercent;
TextView mProgressNumber;
ProgressView mProgress;
int allValue = 0;
private Handler mHandler;
float progressValue;
private static final int MSG_UPDATE_PROGRESS = 1002;
private static final long PROGRESS_INTERVAL = 7000;
private static final long <API key> = PROGRESS_INTERVAL / 100;
private int mProgressStyle = STYLE_SPINNER;
TextView mMessageView;
public ProgressDialog(Context a) {
super(a);
// TODO Auto-generated constructor stub
this.c = a;
}
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
<API key>(Window.FEATURE_NO_TITLE);
if (mProgressStyle == STYLE_HORIZONTAL) {
setContentView(R.layout.horizintal_progress);
mProgress = (ProgressView) findViewById(R.id.loadingBar);
mProgressPercent = (TextView) findViewById(R.id.tv_progress_present);
mProgressNumber = (TextView) findViewById(R.id.tv_progress_number);
} else {
setContentView(R.layout.circle_progress);
mMessageView = (TextView) findViewById(R.id.tv_progress);
}
mHandler = new Handler(this);
}
public void incrementProgressBy(int diff) {
if (mProgress != null) {
addProgress(diff);
onProgressChanged();
}
}
public void addProgress(int value) {
countValue = value;
allValue += countValue;
String allValueAr = TypefaceUtil.getArNum(allValue);
if (allValue <= 100) {
if (!LocaleUtil.IsRTL()) {
mProgressPercent.setText((allValue) + "%");
mProgressNumber.setText((allValue) + "/100");
} else {
mProgressPercent.setText("%" + (allValueAr));
mProgressNumber.setText(TypefaceUtil.getArNum("100") + "/" + (allValueAr));
}
}
progressValue = (float) value / 100;
}
@Override
public boolean handleMessage(Message msg) {
switch (msg.what) {
case MSG_UPDATE_PROGRESS:
mProgress.setProgress((float) (mProgress.getProgress() + progressValue));
break;
}
return false;
}
public void setMessage(CharSequence message) {
if (mProgressStyle != STYLE_HORIZONTAL)
mMessageView.setText(message);
}
public void setProgressStyle(int style) {
mProgressStyle = style;
}
private void onProgressChanged() {
if (mProgressStyle == STYLE_HORIZONTAL) {
if (mHandler != null) {
mHandler.<API key>(MSG_UPDATE_PROGRESS, <API key>);
}
}
}
} |
#include "Paquete.h"
namespace FWK_CS {
Paquete::Paquete() {
}
Paquete::~Paquete() {
}
} |
package apigateway
import (
"net/http"
"strings"
"github.com/grpc-ecosystem/grpc-gateway/runtime"
"openpitrix.io/openpitrix/pkg/client/access"
"openpitrix.io/openpitrix/pkg/gerr"
"openpitrix.io/openpitrix/pkg/logger"
"openpitrix.io/openpitrix/pkg/pb"
"openpitrix.io/openpitrix/pkg/sender"
"openpitrix.io/openpitrix/pkg/util/ctxutil"
"openpitrix.io/openpitrix/pkg/util/jwtutil"
)
const (
Authorization = "Authorization"
)
var (
accessClient, _ = access.NewClient()
)
func httpAuth(mux *runtime.ServeMux, key string) http.Handler {
return http.HandlerFunc(func(w http.ResponseWriter, req *http.Request) {
if req.URL.Path == "/v1/oauth2/token" {
// skip auth sender
mux.ServeHTTP(w, req)
return
}
var err error
ctx := req.Context()
_, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
auth := strings.SplitN(req.Header.Get(Authorization), " ", 2)
if auth[0] != "Bearer" {
err = gerr.New(ctx, gerr.Unauthenticated, gerr.ErrorAuthFailure)
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
s, err := jwtutil.Validate(key, auth[1])
if err != nil {
if err == jwtutil.ErrExpired {
err = gerr.New(ctx, gerr.Unauthenticated, gerr.<API key>)
} else {
err = gerr.New(ctx, gerr.Unauthenticated, gerr.ErrorAuthFailure)
}
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
v, err := accessClient.CanDo(ctx, &pb.CanDoRequest{
UserId: s.UserId,
Url: req.URL.Path,
UrlMethod: req.Method,
})
if err != nil {
logger.Error(ctx, "Sender [%+v] cannot [%s] [%s], err: %+v", s, req.Method, req.URL.Path, err)
err = gerr.New(ctx, gerr.PermissionDenied, gerr.<API key>)
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
logger.Debug(ctx, "CanDo: %+v", v)
s.AccessPath = sender.OwnerPath(v.GetAccessPath())
s.OwnerPath = sender.OwnerPath(v.GetOwnerPath())
s.UserId = v.UserId
req.Header.Set(ctxutil.SenderKey, s.ToJson())
req.Header.Del(Authorization)
mux.ServeHTTP(w, req)
})
} |
# sonarqube-plugins 6.3
Simple example based on the tutorial: [https:
Took info from http://ashismo.github.io/java-code%20quality%20analyzer/2016/06/09/<API key> as well.
This example demonstrates how to write **Custom Rules** for the SonarQube Java Analyzer (aka SonarJava).
It requires to install **SonarJava** **4.7.1.9272** on your SonarQube 5.6+
--> actually, it needs a newer version, please check pom.xml
| Class Filename| path | Description |
|
| MyFirstCustomCheck.java| /src/test/files/| A test file, which contains Java code used as input data for testing the rule |
| org.sonar.template.java.checks. <API key>.java| /src/test/java | A test class, which contains the rule's unit test |
| org.sonar.template.java.checks. MyFirstCustomCheck.java | /src/main/java| A rule class, which contains the implementation of the rule. |
1.
import org.sonar.api.Plugin;
/**
* Entry point of your plugin containing your custom rules
*/
public class MyJavaRulesPlugin implements Plugin {
This class is the entry point for the SONAR plugin. This class is extended from org.sonar.api.Plugin class. This class includes server extension which gets instanciated during sonarqube startup, and batch extensions which gets instantiated during the code analysis.
2.
/**
* Declare rule metadata in server repository of rules.
* That allows to list the rules in the page "Rules".
*/
public class <API key> implements RulesDefinition {
This class is a Server extension which gets instanciated at the time of sonarqube startup. The repository name and supported language name is mentioned in this class
// server extensions -> objects are instantiated during server startup
context.addExtension(<API key>.class);
// batch extensions -> objects are instantiated during code analysis
context.addExtension(<API key>.class);
3.
/**
* Provide the "checks" (implementations of rules) classes that are going be executed during
* source code analysis.
*
* This class is a batch extension by implementing the {@link org.sonar.plugins.java.api.CheckRegistrar} interface.
*/
@SonarLintSide
public class <API key> implements CheckRegistrar {
This class is the batch extension which gets instanciated during the code analysis. This class registers all custom rule classes.
4.
/*Rule Activation
The second things to to is to activate the rule within the plugin. To do so, open class RulesList (org.sonar.samples.java.RulesList). In this class, you will notice methods GetJavaChecks() and GetJavaTestChecks(). These methods are used to register our rules with alongside the rule of the Java plugin.*/
public final class RulesList {
This class lists all custom rules and provides the list to the <API key> class to register them with sonarqube |
<!DOCTYPE html>
<html>
<head>
<title>Contact Us</title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, inital-scale=1.0">
<link rel="icon" type="image/png" href="../media/img/site_icon.ico" >
<link rel="stylesheet" href="../css/stylesheet_basic.css">
<link rel="stylesheet" href="../css/notif_style.css">
<style>
.title { position:relative; top: 190px; width:50%; margin:auto;height: auto; padding: 100px;
font-weight:bold; text-shadow: 0px 1px #c65353; color:white;
font-size:100px; padding:14px; background:#d27979;border-radius:50px;
box-shadow: 4px 4px 4px 4px #732626; text-shadow: 6px 4px #732626;
}
div.dev {width: 400px; height: 300px; position:absolute; left:25px;top: 470px; border-radius:30px;}
.devtit {text-transform:uppercase;text-align:center;position:relative; top:10px; margin:auto; width: 60%; color:white;padding: 10px;
text-shadow:1px 1px #732626;font-style: "Courier New", "Lucida Console", Monospace ; font-size: 18px; border-radius:38px; }
.names {
position:relative; top:40px; margin:auto;font-size:22px;
font-weight:bold; text-shadow: 0px 1px #c65353; color:#cc6666;
padding:16px; background:white;border-radius:20px;
text-shadow: 1px 1px #732626 ;width:71%; height:40%;
}
.inheritance { position: absolute; top:865px; left: 50px; background:white; width:700px; height:400px;
border-radius: 25px; box-shadow: 4px 4px 4px 4px #cc6666 ,4px 4px 4px 4px #ffe6e6,4px 4px 4px 4px #732626;
}
.text {color:#d98c8c;font-style:italic; font-size:18px; padding:10px;}
</style>
</head>
<body style="background: radial-gradient(circle, #ffcccc 10%,#ffe6e6);">
<div class="tab" style="top:0px;">
<ul >
<li class="logo">E-PORTAL</li>
<li><a href="../html/homepage2.html">Home</a></li>
<li><a href="../php/dropdown.php">Colleges</a></li>
<li><a href="../php/examinations.php">Examinations</a></li>
<li><a href="../php/feedback.php">Feedback</a></li>
</ul></div>
<img src="../media/img/background8.jpg" style="z-index:-1; width:100%; height:800px; margin:auto; position:absolute; left:0px;top:80px;">
<center><h1 class="title" >Contact Us</h1></center>
<div class="dev" style="background:#732626; box-shadow: 4px 4px 4px 4px #f2d9d9;">
<h1 class="devtit" style="background:#df9f9f; box-shadow: 2px 2px 2px 2px #f2d9d9;">Web Designing</h1>
<h1 class="names" >Ameya Daddikar<br><br>ameyadaddikar@gmail.com</h1>
</div>
<div class="dev" style="left:473px;background:#df9f9f; box-shadow: 4px 4px 4px 4px #732626;">
<h1 class="devtit" style="background:#f9ecec; box-shadow: 2px 2px 2px 2px #732626;color:#732626;">Database Management</h1>
<h1 class="names" >Vineet Rao<br><br>vineet_rao@hotmail.com</h1>
</div>
<div class="dev" style="left:920px;background:#f2d9d9; box-shadow: 4px 4px 4px 4px #732626;">
<h1 class="devtit" style="background:#732626; box-shadow: 2px 2px 2px 2px #732626;">Server Management</h1>
<h1 class="names" >Rishabh Bansal<br><br>bansalrishabh1998@gmail.com </h1>
</div>
<div class="notif" style="position:absolute; top:870px; right:50px; background:white;">
<h1>NOTIFICATIONS</h1>
<hr>
<p style="font-size:120%; position:relative; top:-45px; height:100%; color:#d98c8c;">
<i><marquee behavior=scroll scrollamount="6" height=240 direction=up>
WELCOME TO THE PORTAL
</marquee></i>
</p>
</div>
<div class="inheritance">
<p class="text">Brought to you by...
</p>
<h1 class="devtit" style="background:#df9f9f; box-shadow: 2px 2px 2px 2px #f2d9d9; font-size:30px;">Community Of Coders</h1>
<br>
<p class="text">An <b>Inheritance</b> project developed by <br><br>FYs of <b>Veermata Jeejabai Technological Institute</b>
<br><br>
Like and follow us on <b>Facebook</b> to know more about the <b>Community of Coders</b></p>
<div style="position:absolute; bottom:30px; right: 75px;"><iframe src="https:
</div></div>
<div class="tab" style="top:1400px;">
<ul>
<li><a href="../html/contactus.html">Contact Us</a></li>
<li><a href="../html/terms&conditions.html">Terms & Conditions</a></li>
</ul>
</div>
</body>
</html> |
package com.mattwhipple.sproogle.closure.js;
import javax.annotation.Nonnull;
public interface <API key> {
@Nonnull String extractFromTemplate(@Nonnull String template);
} |
using System;
using System.Linq;
using System.Threading.Tasks;
using System.Web;
using System.Web.Mvc;
using Microsoft.AspNet.Identity;
using Microsoft.AspNet.Identity.Owin;
using Microsoft.Owin;
using Microsoft.Owin.Security;
using UmbracoReady.Models.UmbracoIdentity;
using Umbraco.Web;
using UmbracoReady;
using Umbraco.Core;
using Umbraco.Web.Models;
using Umbraco.Web.Mvc;
using UmbracoIdentity;
using UmbracoIdentity.Models;
using IdentityExtensions = UmbracoIdentity.IdentityExtensions;
namespace UmbracoReady.Controllers
{
[Authorize]
public class <API key> : SurfaceController
{
private <API key><<API key>> _userManager;
private <API key><<API key>> _roleManager;
public <API key>(UmbracoContext umbracoContext, <API key><<API key>> userManager, <API key><<API key>> roleManager) : base(umbracoContext)
{
_userManager = userManager;
_roleManager = roleManager;
}
public <API key>(UmbracoContext umbracoContext, UmbracoHelper umbracoHelper, <API key><<API key>> userManager, <API key><<API key>> roleManager) : base(umbracoContext, umbracoHelper)
{
_userManager = userManager;
_roleManager = roleManager;
}
public <API key>(<API key><<API key>> userManager, <API key><<API key>> roleManager)
{
_userManager = userManager;
_roleManager = roleManager;
}
public <API key>()
{
}
protected IOwinContext OwinContext
{
get { return Request.GetOwinContext(); }
}
public <API key><<API key>> UserManager
{
get
{
return _userManager ?? (_userManager = OwinContext
.GetUserManager<<API key><<API key>>>());
}
}
public <API key><<API key>> RoleManager
{
get
{
return _roleManager ?? (_roleManager = OwinContext
.Get<<API key><<API key>>>());
}
}
#region External login and registration
[HttpPost]
[AllowAnonymous]
[<API key>]
public ActionResult ExternalLogin(string provider, string returnUrl = null)
{
if (returnUrl.IsNullOrWhiteSpace())
{
returnUrl = Request.RawUrl;
}
// Request a redirect to the external login provider
return new ChallengeResult(provider,
Url.SurfaceAction<<API key>>("<API key>", new { ReturnUrl = returnUrl }));
}
[HttpGet]
[AllowAnonymous]
public async Task<ActionResult> <API key>(string returnUrl)
{
var loginInfo = await OwinContext.Authentication.<API key>();
if (loginInfo == null)
{
//go home, invalid callback
return RedirectToLocal(returnUrl);
}
// Sign in the user with this external login provider if the user already has a login
var user = await UserManager.FindAsync(loginInfo.Login);
if (user != null)
{
await SignInAsync(user, isPersistent: false);
return RedirectToLocal(returnUrl);
}
else
{
// If the user does not have an account, then prompt the user to create an account
ViewBag.ReturnUrl = returnUrl;
ViewBag.LoginProvider = loginInfo.Login.LoginProvider;
return View("<API key>", new <API key> { Email = loginInfo.Email });
}
}
[HttpPost]
[AllowAnonymous]
[<API key>]
public async Task<ActionResult> <API key>(<API key> model, string returnUrl)
{
if (User.Identity.IsAuthenticated)
{
//go home, already authenticated
return RedirectToLocal(returnUrl);
}
if (ModelState.IsValid)
{
// Get the information about the user from the external login provider
var info = await OwinContext.Authentication.<API key>();
if (info == null)
{
return View("<API key>");
}
var user = new <API key>()
{
Name = info.ExternalIdentity.Name,
UserName = model.Email,
Email = model.Email
};
var result = await UserManager.CreateAsync(user);
if (result.Succeeded)
{
result = await UserManager.AddLoginAsync(user.Id, info.Login);
if (result.Succeeded)
{
await SignInAsync(user, isPersistent: false);
// Send an email with this link
// string code = await UserManager.<API key>(user.Id);
// var callbackUrl = Url.Action("ConfirmEmail", "Account", new { userId = user.Id, code = code }, protocol: Request.Url.Scheme);
// SendEmail(user.Email, callbackUrl, "Confirm your account", "Please confirm your account by clicking this link");
return RedirectToLocal(returnUrl);
}
}
AddModelErrors(result);
}
ViewBag.ReturnUrl = returnUrl;
return View(model);
}
[HttpPost]
[<API key>]
public ActionResult LinkLogin(string provider, string returnUrl = null)
{
if (returnUrl.IsNullOrWhiteSpace())
{
returnUrl = Request.RawUrl;
}
// Request a redirect to the external login provider to link a login for the current user
return new ChallengeResult(provider,
Url.SurfaceAction<<API key>>("LinkLoginCallback", new { ReturnUrl = returnUrl }),
User.Identity.GetUserId());
}
[HttpGet]
public async Task<ActionResult> LinkLoginCallback(string returnUrl)
{
var loginInfo = await <API key>.<API key>(XsrfKey, User.Identity.GetUserId());
if (loginInfo == null)
{
TempData["LinkLoginError"] = new[] { "An error occurred, could not get external login info" };
return RedirectToLocal(returnUrl);
}
var result = await UserManager.AddLoginAsync(UmbracoIdentity.IdentityExtensions.GetUserId<int>(User.Identity), loginInfo.Login);
if (result.Succeeded)
{
return RedirectToLocal(returnUrl);
}
TempData["LinkLoginError"] = result.Errors.ToArray();
return RedirectToLocal(returnUrl);
}
[HttpPost]
[<API key>]
public async Task<ActionResult> Disassociate(string loginProvider, string providerKey)
{
var result = await UserManager.RemoveLoginAsync(
UmbracoIdentity.IdentityExtensions.GetUserId<int>(User.Identity),
new UserLoginInfo(loginProvider, providerKey));
if (result.Succeeded)
{
var user = await UserManager.FindByIdAsync(UmbracoIdentity.IdentityExtensions.GetUserId<int>(User.Identity));
await SignInAsync(user, isPersistent: false);
return <API key>();
}
else
{
AddModelErrors(result);
return CurrentUmbracoPage();
}
}
[AllowAnonymous]
public ActionResult <API key>()
{
return View();
}
[ChildActionOnly]
public ActionResult RemoveAccountList()
{
var linkedAccounts = UserManager.GetLogins(UmbracoIdentity.IdentityExtensions.GetUserId<int>(User.Identity));
ViewBag.ShowRemoveButton = HasPassword() || linkedAccounts.Count > 1;
return PartialView(linkedAccounts);
}
#endregion
[HttpPost]
[<API key>]
public async Task<ActionResult> ToggleRole(string roleName)
{
if (string.IsNullOrWhiteSpace(roleName)) throw new <API key>("role cannot be null");
var user = await UserManager.FindByIdAsync(UmbracoIdentity.IdentityExtensions.GetUserId<int>(User.Identity));
if (user != null)
{
var found = user.Roles.FirstOrDefault(x => x.RoleName == roleName);
if (found != null)
{
user.Roles.Remove(found);
}
else
{
user.Roles.Add(new IdentityMemberRole {RoleName = roleName, UserId = user.Id});
}
var result = await UserManager.UpdateAsync(user);
if (result.Succeeded)
{
return <API key>();
}
else
{
foreach (var error in result.Errors)
{
ModelState.AddModelError("", error);
}
return CurrentUmbracoPage();
}
}
return <API key>();
}
[ChildActionOnly]
public async Task<ActionResult> ShowRoles()
{
var user = await UserManager.FindByIdAsync(UmbracoIdentity.IdentityExtensions.GetUserId<int>(User.Identity));
var model = new RoleManagementModel();
if (user != null)
{
model.AssignedRoles = user.Roles.Select(x => x.RoleName);
model.AvailableRoles = await RoleManager.GetAll();
}
return PartialView("ShowRoles", model);
}
[ChildActionOnly]
public ActionResult ManagePassword()
{
ViewBag.HasLocalPassword = HasPassword();
return View();
}
[NotChildAction]
[HttpPost]
[<API key>]
public async Task<ActionResult> ManagePassword([Bind(Prefix = "managePasswordModel")] UserPasswordModel model)
{
bool hasPassword = HasPassword();
ViewBag.HasLocalPassword = hasPassword;
//vaidate their passwords match
if (model.NewPassword != model.ConfirmPassword)
{
ModelState.AddModelError("managePasswordModel.ConfirmPassword", "Passwords do not match");
}
if (hasPassword)
{
if (ModelState.IsValid)
{
IdentityResult result = await UserManager.ChangePasswordAsync(UmbracoIdentity.IdentityExtensions.GetUserId<int>(User.Identity), model.OldPassword, model.NewPassword);
if (result.Succeeded)
{
var user = await UserManager.FindByIdAsync(UmbracoIdentity.IdentityExtensions.GetUserId<int>(User.Identity));
await SignInAsync(user, isPersistent: false);
TempData["<API key>"] = true;
return <API key>();
}
else
{
AddModelErrors(result, "managePasswordModel");
}
}
}
else
{
// User does not have a password so remove any validation errors caused by a missing OldPassword field
var state = ModelState["managePasswordModel.OldPassword"];
if (state != null)
{
state.Errors.Clear();
}
if (ModelState.IsValid)
{
IdentityResult result = await UserManager.AddPasswordAsync(UmbracoIdentity.IdentityExtensions.GetUserId<int>(User.Identity), model.NewPassword);
if (result.Succeeded)
{
TempData["<API key>"] = true;
return <API key>();
}
else
{
AddModelErrors(result, "managePasswordModel");
}
}
}
// If we got this far, something failed, redisplay form
return CurrentUmbracoPage();
}
#region Standard login and registration
[HttpPost]
[AllowAnonymous]
public async Task<ActionResult> HandleLogin([Bind(Prefix = "loginModel")] LoginModel model)
{
if (ModelState.IsValid)
{
var user = await UserManager.FindAsync(model.Username, model.Password);
if (user != null)
{
await SignInAsync(user, true);
return <API key>();
}
ModelState.AddModelError("loginModel", "Invalid username or password");
}
return CurrentUmbracoPage();
}
[HttpPost]
public ActionResult HandleLogout([Bind(Prefix = "logoutModel")]PostRedirectModel model)
{
if (ModelState.IsValid == false)
{
return CurrentUmbracoPage();
}
if (Members.IsLoggedIn())
{
//ensure to only clear the default cookies
OwinContext.Authentication.SignOut(<API key>.ApplicationCookie, <API key>.ExternalCookie);
}
//if there is a specified path to redirect to then use it
if (model.RedirectUrl.IsNullOrWhiteSpace() == false)
{
return Redirect(model.RedirectUrl);
}
//redirect to current page by default
TempData["LogoutSuccess"] = true;
return <API key>();
}
[HttpPost]
[AllowAnonymous]
public async Task<ActionResult> <API key>([Bind(Prefix = "registerModel")]RegisterModel model)
{
if (ModelState.IsValid == false)
{
return CurrentUmbracoPage();
}
var user = new <API key>()
{
UserName = model.UsernameIsEmail || model.Username == null ? model.Email : model.Username,
Email = model.Email,
MemberProperties = model.MemberProperties,
MemberTypeAlias = model.MemberTypeAlias
};
var result = await UserManager.CreateAsync(user, model.Password);
if (result.Succeeded)
{
await SignInAsync(user, isPersistent: false);
// Send an email with this link
// string code = await UserManager.<API key>(user.Id);
// var callbackUrl = Url.Action("ConfirmEmail", "Account", new { userId = user.Id, code = code }, protocol: Request.Url.Scheme);
// await UserManager.SendEmailAsync(user.Id, "Confirm your account", "Please confirm your account by clicking <a href=\"" + callbackUrl + "\">here</a>");
TempData["FormSuccess"] = true;
//if there is a specified path to redirect to then use it
if (model.RedirectUrl.IsNullOrWhiteSpace() == false)
{
return Redirect(model.RedirectUrl);
}
//redirect to current page by default
return <API key>();
}
else
{
AddModelErrors(result, "registerModel");
}
return CurrentUmbracoPage();
}
#endregion
#region Helpers
// Used for XSRF protection when adding external logins
private const string XsrfKey = "XsrfId";
private I<API key> <API key>
{
get
{
return HttpContext.GetOwinContext().Authentication;
}
}
private async Task SignInAsync(<API key> member, bool isPersistent)
{
OwinContext.Authentication.SignOut(<API key>.ExternalCookie);
OwinContext.Authentication.SignIn(new <API key>() { IsPersistent = isPersistent },
await member.<API key>(UserManager));
}
private void AddModelErrors(IdentityResult result, string prefix = "")
{
foreach (var error in result.Errors)
{
ModelState.AddModelError(prefix, error);
}
}
private bool HasPassword()
{
var user = UserManager.FindById(UmbracoIdentity.IdentityExtensions.GetUserId<int>(User.Identity));
if (user != null)
{
return !user.PasswordHash.IsNullOrWhiteSpace();
}
return false;
}
private ActionResult RedirectToLocal(string returnUrl)
{
if (Url.IsLocalUrl(returnUrl))
{
return Redirect(returnUrl);
}
return Redirect("/");
}
private class ChallengeResult : <API key>
{
public ChallengeResult(string provider, string redirectUri, string userId = null)
{
LoginProvider = provider;
RedirectUri = redirectUri;
UserId = userId;
}
private string LoginProvider { get; set; }
private string RedirectUri { get; set; }
private string UserId { get; set; }
public override void ExecuteResult(ControllerContext context)
{
var properties = new <API key>() { RedirectUri = RedirectUri };
if (UserId != null)
{
properties.Dictionary[XsrfKey] = UserId;
}
context.HttpContext.GetOwinContext().Authentication.Challenge(properties, LoginProvider);
}
}
#endregion
}
} |
var Users = function () {
var handleAddUser = function () {
$.validator.addMethod("validUsername", function (value, element) {
return /^[0-9a-zA-Z_.-]+$/.test(value);
}, "Tên người dùng chỉ chứa chữ hoa, thường, số và dấu gạch dưới.");
$.validator.addMethod("userPositionCheck", function (value, element) {
if ( value === '-1' ) {
console.log( value );
return true;
} else {
return false;
}
}, "Hãy chọn chức vụ cho tài khoản");
$.validator.addMethod("existedUsername", function (value, element) {
$("span.loading").html("<img src='"+ getRootWebSitePath() +"/manager/assets/img/loading.gif'>");
var datastring = 'username=' + value;
// console.log(datastring);
var temp = false;
$.ajax({
type: "POST",
url: "users.php",
data: datastring,
async: false,
success: function (responseText) {
console.log( responseText );
if (responseText != 1) {
$("span.loading").html("");
temp = true;
} else {
$("span.loading").html("");
}
}
});
return temp;
}, "Tên người dùng đã được sử dụng.");
$.validator.addMethod("existedEmail", function (value, element) {
$("span.loading").html("<img src='"+ getRootWebSitePath() +"/manager/assets/img/loading.gif'>");
var datastring = 'email=' + value;
var temp = false;
$.ajax({
type: "POST",
url: "users.php",
data: datastring,
async: false,
success: function (responseText) {
if (responseText != 1) {
$("span.loading").html("");
temp = true;
} else {
$("span.loading").html("");
}
}
});
return temp;
}, "Địa chỉ email này đã được sử dụng.");
$('#add_user_form').validate({
errorElement: 'span', //default input error message container
errorClass: 'help-block', // default input error message class
focusInvalid: false, // do not focus the last invalid input
ignore: "",
onkeyup: false,
rules: {
username: {
minlength: 5,
validUsername: true,
existedUsername: true
},
email: {
required: true,
existedEmail: true,
email: true
},
password: {
required: true,
minlength: 8
},
confirm_password: {
required: true,
equalTo: "#password"
},
full_name: {
required: true
},
user_position: {
userPositionCheck: false
}
},
messages: {
username: {
required: "Tên đăng nhập không thể bỏ trống",
minlength: "Tên đăng nhập dài tối thiểu 5 kỳ tự"
},
password: {
required: "Mật khẩu không thể bỏ trống",
minlength: "Mật khẩu dài tối thiểu 8 ký tự"
},
confirm_password: {
required: "Nhập lại mật khẩu",
equalTo: "Mật khẩu không khớp"
},
email: {
required: "Nhập email người dùng",
email: "Hãy nhập đúng định dạng email"
},
full_name: {
required: "Nhập họ tên người dùng"
}
},
invalidHandler: function (event, validator) { //display error alert on form submit
},
highlight: function (element) { // hightlight error inputs
$(element)
.closest('.form-group').addClass('has-error'); // set error class to the control group
},
success: function (label) {
label.closest('.form-group').removeClass('has-error');
label.remove();
},
submitHandler: function (form) {
form.submit();
}
});
$('#add_user_form input').keypress(function (e) {
if (e.which == 13) {
if ($('#add_user_form').validate().form()) {
$('#add_user_form').submit();
}
return false;
}
});
}
var TableManaged = function () {
// begin first table
$('#users_management').dataTable({
"aoColumns": [
null,
null,
{ "bSortable": false },
null,
{ "bSortable": false },
{ "bSortable": false }
],
"aLengthMenu": [
[5, 15, 20, -1],
[5, 15, 20, "All"] // change per page values here
],
// set the initial value
"iDisplayLength": 5,
"sPaginationType": "bootstrap",
"oLanguage": {
"sLengthMenu": "_MENU_ records",
"oPaginate": {
"sPrevious": "Prev",
"sNext": "Next"
}
},
"aoColumnDefs": [{
'bSortable': false,
'aTargets': [0]
}
]
});
jQuery('#<API key> .dataTables_filter input').addClass("form-control input-medium"); // modify table search input
jQuery('#<API key> .dataTables_length select').addClass("form-control input-xsmall"); // modify table per page dropdown
jQuery('#<API key> .dataTables_length select').select2(); // initialize select2 dropdown
}
return {
init: function() {
TableManaged();
handleAddUser();
}
}
}(); |
package ru.job4j.carstorespring.crudRepositories;
import org.springframework.data.repository.CrudRepository;
import ru.job4j.carstorespring.models.User;
import java.util.List;
/**
* Repository for User.
* @author atrifonov.
* @version 1.
* @since 04.04.2018.
*/
public interface UserRepository extends CrudRepository<User, Integer> {
List<User> findByLogin(String login);
} |
<?php
use Illuminate\Database\Seeder;
class RolesTableSeeder extends Seeder
{
/**
* Run the database seeds.
*
* @return void
*/
public function run()
{
$role = new \App\Role();
$role->user_id = 1;
$role->role = 'administrator';
$role->category_id = 1;
$role->save();
}
} |
package no.acntech.sandbox;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.<API key>;
import org.springframework.boot.autoconfigure.domain.EntityScan;
import org.springframework.data.jpa.convert.threeten.Jsr310JpaConverters;
import org.springframework.data.jpa.repository.config.<API key>;
@<API key>(
basePackages = {"no.acntech.sandbox.repository"})
@EntityScan(
basePackageClasses = {Jsr310JpaConverters.class},
basePackages = {"no.acntech.sandbox.domain"})
@<API key>
public class <API key> {
public static void main(String[] args) {
SpringApplication.run(<API key>.class, args);
}
} |
#include "halley/support/logger.h"
#include "halley/text/halleystring.h"
#include <gsl/gsl_assert>
#include <iostream>
#include "halley/support/console.h"
using namespace Halley;
StdOutSink::StdOutSink(bool devMode)
: devMode(devMode)
{
}
StdOutSink::~StdOutSink()
{
std::cout.flush();
}
void StdOutSink::log(LoggerLevel level, const String& msg)
{
if (level == LoggerLevel::Dev && !devMode) {
return;
}
std::unique_lock<std::mutex> lock(mutex);
switch (level) {
case LoggerLevel::Error:
std::cout << ConsoleColour(Console::RED);
break;
case LoggerLevel::Warning:
std::cout << ConsoleColour(Console::YELLOW);
break;
case LoggerLevel::Dev:
std::cout << ConsoleColour(Console::CYAN);
break;
case LoggerLevel::Info:
break;
}
std::cout << msg << ConsoleColour() << '\n';
}
void Logger::setInstance(Logger& logger)
{
instance = &logger;
}
void Logger::addSink(ILoggerSink& sink)
{
Expects(instance);
instance->sinks.insert(&sink);
}
void Logger::removeSink(ILoggerSink& sink)
{
Expects(instance);
instance->sinks.erase(&sink);
}
void Logger::log(LoggerLevel level, const String& msg)
{
if (instance) {
for (const auto& s: instance->sinks) {
s->log(level, msg);
}
} else {
std::cout << msg << '\n';
}
}
void Logger::logTo(ILoggerSink* sink, LoggerLevel level, const String& msg)
{
if (sink) {
sink->log(level, msg);
} else {
log(level, msg);
}
}
void Logger::logDev(const String& msg)
{
log(LoggerLevel::Dev, msg);
}
void Logger::logInfo(const String& msg)
{
log(LoggerLevel::Info, msg);
}
void Logger::logWarning(const String& msg)
{
log(LoggerLevel::Warning, msg);
}
void Logger::logError(const String& msg)
{
log(LoggerLevel::Error, msg);
}
void Logger::logException(const std::exception& e)
{
logError(e.what());
}
Logger* Logger::instance = nullptr; |
using System.Collections.Generic;
using System.Net.Http;
using System.Threading;
using System.Web.Http;
using System.Web.OData.Batch;
using Microsoft.TestCommon;
namespace System.Web.OData.Test
{
public class <API key>
{
[Fact]
public void <API key>()
{
Assert.ThrowsArgumentNull(
() => <API key>.SendMessageAsync(null, new HttpRequestMessage(), CancellationToken.None, null).Wait(),
"invoker");
}
[Fact]
public void <API key>()
{
Assert.ThrowsArgumentNull(
() => <API key>.SendMessageAsync(new HttpMessageInvoker(new HttpServer()), null, CancellationToken.None, null).Wait(),
"request");
}
[Fact]
public void <API key>()
{
HttpResponseMessage response = new HttpResponseMessage();
HttpMessageInvoker invoker = new HttpMessageInvoker(new MockHttpServer((request) =>
{
return response;
}));
var result = <API key>.SendMessageAsync(invoker, new HttpRequestMessage(HttpMethod.Get, "http://example.com"), CancellationToken.None, new Dictionary<string, string>()).Result;
Assert.Same(response, result);
}
}
} |
import vtk.vtkActor;
import vtk.vtkSphereSource;
import vtk.vtkNativeLibrary;
import vtk.vtkPolyDataMapper;
import vtk.vtkRenderWindow;
import vtk.vtkNamedColors;
import vtk.vtkRenderer;
import vtk.<API key>;
public class BackgroundColor
{
// Load VTK library and print which library was not properly loaded
static
{
if (!vtkNativeLibrary.<API key>())
{
for (vtkNativeLibrary lib : vtkNativeLibrary.values())
{
if (!lib.IsLoaded())
{
System.out.println(lib.GetLibraryName() + " not loaded");
}
}
}
vtkNativeLibrary.DisableOutputWindow(null);
}
public static void main(String args[])
{
vtkNamedColors colors = new vtkNamedColors();
//For Actor Color
double actorColor[] = new double[4];
//Renderer Background Color
double Bgcolor[] = new double[4];
colors.GetColor("DarkOrange", actorColor);
colors.GetColor("SteelBlue", Bgcolor);
//Create a Sphere
vtkSphereSource Sphere = new vtkSphereSource();
Sphere.SetCenter(0, 0, 0);
Sphere.SetRadius(4.0);
Sphere.Update();
//Create a Mapper and Actor
vtkPolyDataMapper Mapper = new vtkPolyDataMapper();
Mapper.SetInputConnection(Sphere.GetOutputPort());
vtkActor Actor = new vtkActor();
Actor.SetMapper(Mapper);
Actor.GetProperty().SetColor(actorColor);
//Create the renderer, render window and interactor.
vtkRenderer ren = new vtkRenderer();
vtkRenderWindow renWin = new vtkRenderWindow();
renWin.AddRenderer(ren);
<API key> iren = new <API key>();
iren.SetRenderWindow(renWin);
// Visualise the Sphere
ren.AddActor(Actor);
//Setting up the Renderer Background Color.
ren.SetBackground(Bgcolor);
renWin.SetSize(300, 300);
renWin.Render();
iren.Initialize();
iren.Start();
}
} |
package in.vesely.eclub.yodaqa.view;
import android.content.Context;
import android.graphics.drawable.Drawable;
import android.text.Html;
import android.text.method.LinkMovementMethod;
import android.widget.TextView;
import org.androidannotations.annotations.EViewGroup;
import org.androidannotations.annotations.ViewById;
import org.androidannotations.annotations.res.DrawableRes;
import in.vesely.eclub.yodaqa.R;
import in.vesely.eclub.yodaqa.adapters.<API key>;
import in.vesely.eclub.yodaqa.restclient.YodaSource;
@EViewGroup(R.layout.source_item)
public class SourceItem extends <API key><YodaSource> {
@ViewById(R.id.text)
protected TextView text;
@DrawableRes(R.drawable.ic_wikipedia_logo)
protected Drawable wikiLogoDrawable;
@DrawableRes(R.drawable.ic_bing_logo)
protected Drawable bingLogoDrawable;
@DrawableRes(R.drawable.ic_freebase_logo)
protected Drawable <API key>;
@DrawableRes(R.drawable.ic_dbpedia_logo)
protected Drawable dbpediaLogoDrawable;
public SourceItem(Context context) {
super(context);
}
@Override
public void bind(YodaSource data, int position) {
String url = data.getURL();
text.setText(Html.fromHtml(String.format("<a href=\"%s\">%s (%s)</a>", url, data.getTitle(), data.getOrigin())));
text.setMovementMethod(LinkMovementMethod.getInstance());
setIcon(data.getType());
}
private void setIcon(String sourceType){
switch (sourceType){
case "enwiki":
text.<API key>(wikiLogoDrawable, null, null, null);
break;
case "bing":
text.<API key>(bingLogoDrawable, null, null, null);
break;
case "freebase":
text.<API key>(<API key>, null, null, null);
break;
case "dbpedia":
text.<API key>(dbpediaLogoDrawable, null, null, null);
break;
}
}
} |
/** Automatically generated file. DO NOT MODIFY */
package spt.w0pw0p.material.filepicker;
public final class BuildConfig {
public final static boolean DEBUG = false;
} |
package com.hypnoticocelot.telemetry.tracing;
import java.util.UUID;
public interface SpanData {
UUID getTraceId();
UUID getId();
UUID getParentId();
SpanInfo getInfo();
long getStartTimeNanos();
long getDuration();
} |
copyright:
years: 2016,2017
lastupdated: "2017-04-27"
{:new_window: target="_blank"}
{:shortdesc: .shortdesc}
{:screen: .screen}
{:codeblock: .codeblock}
{:pre: .pre}
{: #<API key>}
[<API key>](https://github.com/IBM-Bluemix/<API key>) Node.js {{site.data.keyword.composeForEtcd}}
|
`<API key>`| base64
`deployment_id`|Compose ID
`db_type`|`etcd`
`name`|
`uri`| URI`uri` (`amqps:)`vhost`
{: caption=" 1. Compose for etcd " caption-side="top"} |
package com.example.william;
import org.greenrobot.greendao.generator.DaoGenerator;
import org.greenrobot.greendao.generator.Entity;
import org.greenrobot.greendao.generator.Property;
import org.greenrobot.greendao.generator.Schema;
import org.greenrobot.greendao.generator.ToMany;
public class Main {
public static void main(String args[]) throws Exception {
Schema schema = new Schema(7, "com.example.william.data_set");
addEntities(schema);
new DaoGenerator().generateAll(schema, "./app/src/main/java");
}
private static void addEntities(Schema schema) {
Entity activity = addActivity(schema);
Entity user = addUser(schema);
Entity userdata = addUserData(schema);
Entity location = addLocation(schema);
Entity posture = addPosture(schema);//activityPosition
Entity action = addAction(schema);
// Entity <API key> = <API key>(schema);
// Entity <API key> = <API key>(schema);
//One to Many
Property userIdOnActivity = activity.addLongProperty("userId")
.notNull().getProperty();
ToMany usersToActivity = user.addToMany(activity, userIdOnActivity);
Property activityIdOnData = userdata.addLongProperty("activityId")
.notNull().getProperty();
ToMany activityToData = activity.addToMany(userdata,activityIdOnData);
Property actionIdOnActivity = activity.addLongProperty("actionId")
.notNull().getProperty();
ToMany actionToActivity = action.addToMany(activity,actionIdOnActivity);
Property <API key> = activity.addLongProperty("locationId")
.notNull().getProperty();
ToMany locationToActivity = location.addToMany(activity,<API key>);
Property postureIdOnActivity = activity.addLongProperty("postureId")
.notNull().getProperty();
ToMany postureToActivity = posture.addToMany(activity,postureIdOnActivity);
/*Property <API key> = location.addLongProperty("activityId")
.notNull().getProperty();
ToMany activityToLocation = activity.addToMany(location,<API key>);*/
/* //One to Many, associative entities
//Activity to associative relation with position (activity position)
Property activityIdOn_actPos = <API key>.addLongProperty("activityId")
.notNull().getProperty();
ToMany activityToAE = activity.addToMany(<API key>,activityIdOn_actPos);
Property positionIdOn_actPos = <API key>.addLongProperty("positionId")
.notNull().getProperty();
ToMany positionToAE = activityPosition.addToMany(<API key>,positionIdOn_actPos);
//Activity to associative relation with location (activity location)
Property <API key> =<API key>.
addLongProperty("activityId").notNull().getProperty();
ToMany activityToAEpos = activity.addToMany(<API key>,<API key>);
Property <API key> =<API key>.
addLongProperty("locationId").notNull().getProperty();
ToMany locationToAEpos = location.addToMany(<API key>,<API key>);
*/
}
private static Entity addAction(Schema schema) {
Entity action = schema.addEntity("Action");
action.addIdProperty().autoincrement().primaryKey();
action.addStringProperty("name");
return action;
}
private static Entity <API key>(Schema schema) {
Entity ae_act_pos = schema.addEntity("<API key>");
return ae_act_pos;
}
private static Entity <API key>(Schema schema) {
Entity ae_act_loc = schema.addEntity("<API key>");
return ae_act_loc;
}
private static Entity addLocation(Schema schema) {
Entity location = schema.addEntity("Location");
location.addIdProperty().autoincrement().primaryKey();
location.addStringProperty("locationName");
return location;
}
private static Entity addUserData(Schema schema) {
Entity userdata =schema.addEntity("UserData");
userdata.addIdProperty().autoincrement().primaryKey();
userdata.addLongProperty("timestamp");
userdata.addDoubleProperty("bandAccX");
userdata.addDoubleProperty("bandAccY");
userdata.addDoubleProperty("bandAccZ");
userdata.addFloatProperty("bandAltimeterRate");
userdata.addIntProperty("bandAmbientLight");
userdata.addDoubleProperty("bandBarometerAir");
userdata.addDoubleProperty("bandBarometerTemp");
userdata.addIntProperty("bandGsr");
userdata.addDoubleProperty("bandGyrX");
userdata.addDoubleProperty("bandGyrY");
userdata.addDoubleProperty("bandGyrZ");
userdata.addIntProperty("bandHeartRate");
userdata.addStringProperty("bandQoHR");
userdata.addLongProperty("bandPedometer");
userdata.addDoubleProperty("bandRR");
userdata.addDoubleProperty("bandSkinTemperature");
userdata.addStringProperty("bandUVindex");
userdata.addFloatProperty("mobileAccX");
userdata.addFloatProperty("mobileAccY");
userdata.addFloatProperty("mobileAccZ");
userdata.addFloatProperty("mobileGyrX");
userdata.addFloatProperty("mobileGyrY");
userdata.addFloatProperty("mobileGyrZ");
userdata.addFloatProperty("mobileMagX");
userdata.addFloatProperty("mobileMagY");
userdata.addFloatProperty("mobileMagZ");
userdata.addFloatProperty("mobileGraX");
userdata.addFloatProperty("mobileGraY");
userdata.addFloatProperty("mobileGraZ");
userdata.addFloatProperty("mobileLinX");
userdata.addFloatProperty("mobileLinY");
userdata.addFloatProperty("mobileLinZ");
userdata.addFloatProperty("mobileRotX");
userdata.addFloatProperty("mobileRotY");
userdata.addFloatProperty("mobileRotZ");
userdata.addIntProperty("iceBeacon");
userdata.addIntProperty("mintBeacon");
userdata.addIntProperty("bbBeacon");
userdata.addIntProperty("iceBeacon2");
userdata.addIntProperty("mintBeacon2");
userdata.addIntProperty("bbBeacon2");
return userdata;
}
private static Entity addUser(Schema schema) {
Entity user = schema.addEntity("User");
user.addIdProperty().autoincrement().primaryKey();
user.addStringProperty("name");
user.addStringProperty("lastname");
user.addStringProperty("username");
user.addIntProperty("age");
user.addStringProperty("gender");
user.addIntProperty("weight");
user.addIntProperty("stature");
user.addStringProperty("profession");
user.addStringProperty("mail");
user.addStringProperty("smokeFrec");
user.addStringProperty("drinkFrec");
user.addStringProperty("transport");
return user;
}
private static Entity addActivity(Schema schema){
Entity activity=schema.addEntity("Activity");
activity.addIdProperty();
activity.addStringProperty("status");
return activity;
}
private static Entity addPosture(Schema schema){
Entity activityPosition = schema.addEntity("Posture");
activityPosition.addIdProperty();
activityPosition.addStringProperty("posture");
return activityPosition;
}
} |
require 'aequitas'
require 'serf/message'
require 'serf/more/uuid_fields'
require 'virtus'
module Moogle
module Requests
class CreateLink
include Virtus
include Aequitas
include Serf::Message
include Serf::More::UuidFields
attribute :target_id, Integer
attribute :receiver_ref, String
attribute :message_kind, String
<API key> :target_id, :receiver_ref, :message_kind
end
end
end |
package org.wikidata.wdkt.enums;
public enum Entity {
HUMAN("Q5");
private String entityId;
private Entity(String entityId) {
this.entityId = entityId;
}
public String toString(){
return entityId;
}
} |
<?php
class Category extends AppModel{
} |
import java.io.*;
import java.util.ArrayList;
import java.util.Collection;
import java.util.HashMap;
import java.util.<API key>;
class InputReader {
private InputStream stream;
private byte[] buf = new byte[1024];
private int curChar;
private int numChars;
private SpaceCharFilter filter;
public InputReader(InputStream stream) {
this.stream = stream;
}
public int read() {
if (numChars == -1)
throw new <API key>();
if (curChar >= numChars) {
curChar = 0;
try {
numChars = stream.read(buf);
} catch (IOException e) {
throw new <API key>();
}
if (numChars <= 0)
return -1;
}
return buf[curChar++];
}
public int readInt() {
int c = read();
while (isSpaceChar(c))
c = read();
int sgn = 1;
if (c == '-') {
sgn = -1;
c = read();
}
int res = 0;
do {
if (c < '0' || c > '9')
throw new <API key>();
res *= 10;
res += c - '0';
c = read();
} while (!isSpaceChar(c));
return res * sgn;
}
public String readString() {
int c = read();
while (isSpaceChar(c))
c = read();
StringBuilder res = new StringBuilder();
do {
res.appendCodePoint(c);
c = read();
} while (!isSpaceChar(c));
return res.toString();
}
public boolean isSpaceChar(int c) {
if (filter != null)
return filter.isSpaceChar(c);
return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
}
public String next() {
return readString();
}
public interface SpaceCharFilter {
public boolean isSpaceChar(int ch);
}
}
class OutputWriter {
private final PrintWriter writer;
public OutputWriter(OutputStream outputStream) {
writer = new PrintWriter(new BufferedWriter(new OutputStreamWriter(outputStream)));
}
public OutputWriter(Writer writer) {
this.writer = new PrintWriter(writer);
}
public void print(Object...objects) {
for (int i = 0; i < objects.length; i++) {
if (i != 0)
writer.print(' ');
writer.print(objects[i]);
}
}
public void printLine(Object...objects) {
print(objects);
writer.println();
}
public void close() {
writer.close();
}
public void flush() {
writer.flush();
}
}
class IOUtils {
public static int[] readIntArray(InputReader in, int size) {
int[] array = new int[size];
for (int i = 0; i < size; i++)
array[i] = in.readInt();
return array;
}
}
class Topic {
int id;
float x;
float y;
Collection questions;
public Topic(int id, float x, float y) {
this.id = id;
this.x = x;
this.y = y;
questions = new ArrayList();
}
}
public class SolutionVerifier {
ArrayList<Topic> queryTopic(int num, int x, int y) {
return null;
}
public static void main(String args[] ) throws Exception {
// InputReader in = new InputReader(System.in);
InputReader in = new InputReader(new FileInputStream("nearby.in"));
// OutputWriter out = new OutputWriter(System.out);
OutputWriter out = new OutputWriter(new FileOutputStream("nearby.out"));
int t = in.readInt();
int q = in.readInt();
int n = in.readInt();
HashMap<Integer,Topic> map = new HashMap<Integer, Topic>();
for (int i=0; i<t; i++) {
int id = in.readInt();
float x = Float.parseFloat(in.readString());
float y = Float.parseFloat(in.readString());
Topic tmp = new Topic(id,x,y);
map.put(id, tmp);
}
for (int i=0; i<q; i++) {
int id = in.readInt();
int tid = in.readInt();
map.get(tid).questions.add(id);
}
String s = in.readString();
out.printLine("X");
out.flush();
out.close();
}
} |
// Use of this source code is governed by a MIT style
package render
import (
"fmt"
"net/http"
)
type Redirect struct {
Code int
Request *http.Request
Location string
}
func (r Redirect) Render(w http.ResponseWriter) error {
if r.Code < 300 || r.Code > 308 {
panic(fmt.Sprintf("Cannot redirect with status code %d", r.Code))
}
http.Redirect(w, r.Request, r.Location, r.Code)
return nil
} |
using System;
using LD28.Core;
using LD28.Scene;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
namespace LD28.Movables
{
<summary>
A dust cloud entity for making the player's movement more visible.
</summary>
public class DustCloud : Movable, IUpdatable, IRenderable
{
private readonly FastRandom _random = new FastRandom();
private GraphicsDevice _graphics;
private BasicEffect _basicEffect;
private RasterizerState _rasterizerState;
private float _particleSize;
private float _halfParticleSize;
private Vector2 _lastCameraPosition;
private bool _hasInitialized = false;
private Particle[] _particles;
private VertexPositionColor[] _particleVertices;
private struct Particle
{
public Vector2 Position;
public Color Color;
}
public DustCloud(int size = 100, string name = "DustCloud")
: base(name)
{
_particles = new Particle[size];
_particleVertices = new VertexPositionColor[size * 3];
_rasterizerState = new RasterizerState
{
CullMode = CullMode.None,
FillMode = FillMode.Solid
};
}
private void Initialize(ICamera camera)
{
// Retrieve the necessary data.
var vector3 = camera.SceneNode.Position;
var cameraPosition = new Vector2(vector3.X, vector3.Y);
var halfScreenSize = camera.ScreenSize / 2.0f;
_lastCameraPosition = cameraPosition;
// Use the viewport's and screen's height to determine our particle size since it's contstant.
// Particle size = 2 pixels.
_particleSize = camera.ScreenSize.Y / (float)camera.Viewport.Height * 2.0f;
_halfParticleSize = _particleSize / 2.0f;
// Initialize the particles.
for (int i = 0; i < _particles.Length; ++i)
{
var particle = new Particle
{
Position = new Vector2(
cameraPosition.X + halfScreenSize.X * _random.NextRangedFloat(),
cameraPosition.Y + halfScreenSize.Y * _random.NextRangedFloat()),
Color = new Color(
1.0f - _random.NextFloat() * 0.2f,
1.0f - _random.NextFloat() * 0.2f,
1.0f - _random.NextFloat() * 0.2f,
1.0f - _random.NextFloat() * 0.2f)
};
_particles[i] = particle;
RebuildPartice(i, ref particle);
}
_hasInitialized = true;
}
private void RebuildPartice(int index, ref Particle particle)
{
index = index * 3;
_particleVertices[index + 0] = new VertexPositionColor
{
Position = new Vector3(particle.Position.X, particle.Position.Y - _halfParticleSize, 0.0f),
Color = particle.Color
};
_particleVertices[index + 1] = new VertexPositionColor
{
Position = new Vector3(particle.Position.X - _halfParticleSize, particle.Position.Y + _halfParticleSize, 0.0f),
Color = particle.Color
};
_particleVertices[index + 2] = new VertexPositionColor
{
Position = new Vector3(particle.Position.X + _halfParticleSize, particle.Position.Y + _halfParticleSize, 0.0f),
Color = particle.Color
};
}
public void Update(GameTime time, ICamera camera)
{
// Check if we need to initialize.
if (_hasInitialized == false)
{
Initialize(camera);
}
// Retrieve the necessary data.
var vector3 = camera.SceneNode.Position;
var cameraPosition = new Vector2(vector3.X, vector3.Y);
var halfScreenSize = camera.ScreenSize / 2.0f;
var cameraDirection = cameraPosition - _lastCameraPosition;
var topLeft = cameraPosition - halfScreenSize;
var bottomRight = cameraPosition + halfScreenSize;
// Find any particles that moved of the screen.
for (int i = 0; i < _particles.Length; ++i)
{
var particle = _particles[i];
var position = particle.Position;
// Check if and how the particle left the viewport.
bool moved = false;
if (position.X < topLeft.X && cameraDirection.X > 0.0f)
{
position = new Vector2(
cameraPosition.X + halfScreenSize.X + (_random.NextFloat() * 20.0f),
cameraPosition.Y + (halfScreenSize.Y + 40.0f) * _random.NextRangedFloat());
moved = true;
}
else if (position.X > bottomRight.X && cameraDirection.X < 0.0f)
{
position = new Vector2(
cameraPosition.X - halfScreenSize.X - (_random.NextFloat() * 20.0f),
cameraPosition.Y + (halfScreenSize.Y + 40.0f) * _random.NextRangedFloat());
moved = true;
}
if (position.Y < topLeft.Y && cameraDirection.Y > 0.0f)
{
position = new Vector2(
cameraPosition.X + (halfScreenSize.X + 40.0f) * _random.NextRangedFloat(),
cameraPosition.Y + halfScreenSize.Y + (_random.NextFloat() * 20.0f));
moved = true;
}
else if (position.Y > bottomRight.Y && cameraDirection.Y < 0.0f)
{
position = new Vector2(
cameraPosition.X + (halfScreenSize.X + 40.0f) * _random.NextRangedFloat(),
cameraPosition.Y - halfScreenSize.Y - (_random.NextFloat() * 20.0f));
moved = true;
}
if (moved)
{
particle = new Particle
{
Position = position,
Color = new Color(
1.0f - _random.NextFloat() * 0.2f,
1.0f - _random.NextFloat() * 0.2f,
1.0f - _random.NextFloat() * 0.2f,
1.0f - _random.NextFloat() * 0.2f)
};
_particles[i] = particle;
RebuildPartice(i, ref particle);
}
}
_lastCameraPosition = cameraPosition;
}
public void LoadContent(IServiceProvider services)
{
// Get the necessary services.
_graphics = ((<API key>)services.GetService(typeof(<API key>))).GraphicsDevice;
// Create the effect.
_basicEffect = new BasicEffect(_graphics);
_basicEffect.DiffuseColor = Vector3.One;
_basicEffect.VertexColorEnabled = true;
}
public void UnloadContent()
{
if (_basicEffect != null)
{
_basicEffect.Dispose();
_basicEffect = null;
}
}
public void Render(GameTime gameTime, ICamera camera)
{
if (_basicEffect != null)
{
// Set the effect's parameters.
Matrix projectionMatrix, viewMatrix;
camera.GetMatrices(out projectionMatrix, out viewMatrix);
_basicEffect.Projection = projectionMatrix;
_basicEffect.View = viewMatrix;
_basicEffect.World = SceneNode.Transformation;
// Set the rasterizer state.
_graphics.DepthStencilState = DepthStencilState.Default;
_graphics.BlendState = BlendState.AlphaBlend;
_graphics.RasterizerState = _rasterizerState;
// Draw the vertex buffer.
foreach (var effectPass in _basicEffect.CurrentTechnique.Passes)
{
effectPass.Apply();
_graphics.DrawUserPrimitives(PrimitiveType.TriangleList, _particleVertices, 0, _particles.Length, VertexPositionColor.VertexDeclaration);
}
}
}
}
} |
body {
padding-top: 60px;
padding-bottom: 40px;
}
.hero-unit{
padding: 30px;
}
.section{
margin-bottom: 40px;
}
.section .span9{
margin-top: 5px;
}
.linklist{
list-style: none;
margin: 0;
}
.linklist li{
float: left;
margin-right: 20px;
} |
package org.ddd4j.infrastructure.scheduler;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicBoolean;
import org.ddd4j.infrastructure.Promise;
import org.ddd4j.util.Require;
import org.ddd4j.util.collection.RingBuffer;
import org.ddd4j.value.Nothing;
public class Agent<T> {
public interface Action<T> extends Task<T, Nothing> {
void execute(T target) throws Exception;
@Override
default Nothing perform(T target) throws Exception {
execute(target);
return Nothing.INSTANCE;
}
}
private class Job<R> {
private final Blocked<Promise<R>> task;
private final Promise.Deferred<R> deferred;
Job(Blocked<? extends Task<? super T, Promise<R>>> task, boolean blocked) {
this.task = blocked ? task.managed(t -> t.perform(target), this::isDoneWithAll) : task.map(t -> t.perform(target));
this.deferred = scheduler.<API key>();
}
void executeWithTimeout(long duration, TimeUnit unit) {
if (deferred.isDone()) {
return;
}
try {
task.execute(duration, unit).whenComplete(deferred::complete);
} catch (Throwable e) {
deferred.<API key>(e);
}
}
Promise.Cancelable<R> getPromise() {
return deferred;
}
boolean isDoneWithAll() {
return deferred.isDone() && jobs.isEmpty();
}
}
public interface Task<T, R> {
default Blocked<Task<T, R>> asBlocked() {
return (d, u) -> this;
}
default Task<T, Promise<R>> asPromised() {
return t -> Promise.completed(perform(t));
}
R perform(T target) throws Exception;
}
public static <T> Agent<T> create(Scheduler scheduler, T target, int jobBufferSize) {
return new Agent<>(scheduler, target, jobBufferSize);
}
private final Scheduler scheduler;
private final T target;
private ScheduledTask scheduledTask;
// TODO throw on overflow
private final RingBuffer<Job<?>> jobs;
private final AtomicBoolean scheduled;
public Agent(Scheduler scheduler, T target, int jobBufferSize) {
this.scheduler = Require.nonNull(scheduler);
this.target = Require.nonNull(target);
this.jobs = new RingBuffer<>(jobBufferSize);
this.scheduled = new AtomicBoolean(false);
}
public Promise.Cancelable<Nothing> execute(Action<? super T> action) {
return perform(action);
}
public Promise.Cancelable<Nothing> executeBlocked(Blocked<Action<? super T>> action) {
return performBlocked(action);
}
public <R> Promise.Cancelable<R> perform(Task<? super T, R> task) {
return scheduleIfNeeded(new Job<>(task.asPromised().asBlocked(), false)).getPromise();
}
public <R> Promise.Cancelable<R> performBlocked(Blocked<? extends Task<? super T, R>> blocked) {
return scheduleIfNeeded(new Job<R>(blocked.map(Task::asPromised), true)).getPromise();
}
private boolean run(long duration, TimeUnit unit) {
try {
int remaining = scheduler.getBurstProcessing();
Job<?> job = null;
while (remaining-- > 0 && (job = jobs.getOrNull()) != null) {
job.executeWithTimeout(duration, unit);
}
} finally {
if (jobs.isEmpty()) {
scheduled.set(false);
} else {
scheduler.execute(this::run);
}
}
return jobs.isEmpty();
}
private <R> Job<R> scheduleIfNeeded(Job<R> job) {
jobs.put(job);
if (scheduled.compareAndSet(false, true)) {
scheduler.execute(this::run);
}
return job;
}
} |
package main
import (
"reflect"
)
type Person struct {
name string "namestr"
age int
}
func ShowTag(i interface{}) {
switch t := reflect.TypeOf(i); t.Kind() {
case reflect.Ptr:
tag := t.Elem().Field(0).Tag
println(tag)
}
}
func show(i interface{}) {
switch i.(type) {
case *Person:
t := reflect.TypeOf(i)
v := reflect.ValueOf(i)
tag := t.Elem().Field(0).Tag
name := v.Elem().Field(0).String()
age := v.Elem().Field(1).Int()
println(tag)
println(name)
println(age)
}
}
func main() {
p := new(Person)
p.name = "test"
p.age = 18
ShowTag(p)
show(p)
} |
# <API key>
[ which provides similar functionality but for maven build system.
## Description
This gradle plugin allows you to define one or more contexts in YAML and push those through one or more mustache templates
during your gradle build
## Usage
All you need to make the plugin work is use ```template``` function where you define template, output target and properties. At this moment plugin not present in maven repostiry, you have to build it and export to your local repository.
buildscript {
repositories {
mavenLocal()
mavenCentral()
}
dependencies {
classpath group: 'com.github.kamkozlowski.gradle',
name: 'mustache',
version: '0.0.1'
}
}
repositories {
mavenCentral()
}
apply plugin: 'mustache-template'
mustache {
template( uri('src/main/resources/template.mustache'), uri('src/main/resources/output.txt'), uri('src/main/resources/props.yaml'))
} |
from django.conf.urls import patterns, include, url
from django.contrib import admin
admin.autodiscover()
urlpatterns = patterns('',
url(r'^$', 'Architect.views.home'),
# Include an application:
# url(r'^app_name/', include('app_name.urls', namespace="app_name")),
url(r'^admin/', include(admin.site.urls)),
) |
# MathJax editing
We added text editing capability to MathJax! Inspired by [LyX](www.lyx.org).
# Examples
## Selection and backspacing

## Fundamental theorem of calculus

## Black-Scholes equation

## Fourier transform

## Shannon entropy

## Wave equation

## Maxwell equation

# Credits
This project was started as part of Dropbox Hack Week in 2015 with @strikeskids, and continued afterwards. |
# AUTOGENERATED FILE
FROM balenalib/jetson-nano-debian:buster-run
ENV <API key>=Json
RUN apt-get update \
&& apt-get install -y --<API key> \
ca-certificates \
curl \
\
# .NET Core dependencies
libc6 \
libgcc1 \
libgssapi-krb5-2 \
libicu63 \
libssl1.1 \
libstdc++6 \
zlib1g \ |
# Install script for directory: /Users/vector/tmp/Cobalt/ext/emsdk_portable/clang/tag-e1.34.1/src/lib/Passes
# Set the install prefix
if(NOT DEFINED <API key>)
set(<API key> "/usr/local")
endif()
string(REGEX REPLACE "/$" "" <API key> "${<API key>}")
# Set the install configuration name.
if(NOT DEFINED <API key>)
if(BUILD_TYPE)
string(REGEX REPLACE "^[^A-Za-z0-9_]+" ""
<API key> "${BUILD_TYPE}")
else()
set(<API key> "RelWithDebInfo")
endif()
message(STATUS "Install configuration: \"${<API key>}\"")
endif()
# Set the component getting installed.
if(NOT <API key>)
if(COMPONENT)
message(STATUS "Install component: \"${COMPONENT}\"")
set(<API key> "${COMPONENT}")
else()
set(<API key>)
endif()
endif()
if(NOT <API key> OR "${<API key>}" STREQUAL "LLVMPasses")
file(INSTALL DESTINATION "${<API key>}/lib" TYPE STATIC_LIBRARY FILES "/Users/vector/tmp/Cobalt/ext/emsdk_portable/clang/tag-e1.34.1/build_tag-e1.34.1_64/lib/libLLVMPasses.a")
if(EXISTS "$ENV{DESTDIR}${<API key>}/lib/libLLVMPasses.a" AND
NOT IS_SYMLINK "$ENV{DESTDIR}${<API key>}/lib/libLLVMPasses.a")
execute_process(COMMAND "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib" "$ENV{DESTDIR}${<API key>}/lib/libLLVMPasses.a")
endif()
endif() |
package org.iotp.server.service.cluster.rpc;
import org.iotp.analytics.ruleengine.api.asset.<API key>;
import org.iotp.analytics.ruleengine.api.device.<API key>;
import org.iotp.analytics.ruleengine.common.msg.cluster.ToAllNodesMsg;
import org.iotp.analytics.ruleengine.common.msg.core.<API key>;
import org.iotp.analytics.ruleengine.common.msg.device.ToDeviceActorMsg;
import org.iotp.analytics.ruleengine.plugins.msg.ToPluginActorMsg;
import org.iotp.server.actors.rpc.RpcBroadcastMsg;
import org.iotp.server.actors.rpc.<API key>;
import org.iotp.server.actors.rpc.RpcSessionTellMsg;
public interface RpcMsgListener {
void onMsg(ToDeviceActorMsg msg);
void onMsg(<API key> msg);
void onMsg(<API key> msg);
void onMsg(<API key> msg);
void onMsg(ToAllNodesMsg nodeMsg);
void onMsg(ToPluginActorMsg msg);
void onMsg(<API key> msg);
void onMsg(RpcSessionTellMsg rpcSessionTellMsg);
void onMsg(RpcBroadcastMsg rpcBroadcastMsg);
} |
#include <iostream>
#include <string>
#include <QtWidgets>
#include <QDoubleSpinBox>
#include "testwidgets.h"
void TestWidgets::getDoubleValue_data()
{
QTest::addColumn<double>("values");
QTest::newRow("value 1") << (double)0;
QTest::newRow("value 2") << (double)500.0;
QTest::newRow("value 3") << (double)999.9;
}
void TestWidgets::getDoubleValue()
{
QFETCH(double, values);
int decimals = 2; // characters for the fractional part
double minrange = 0;
double maxrange = 999.9;
QDoubleSpinBox sb;
sb.setRange(minrange, maxrange);
sb.setDecimals(decimals);
sb.setValue(values);
/*
** Uncomment the next two lines to show the QDoubleSpinBox
*/
sb.show();
QTest::qWait(1000);
double value = sb.value();
QCOMPARE(value, values);
}
/*
** The first list of events stores the value 0 and key return, the second
** event stores the value 500.0 and the key return and the last one
** the value 900.0 and the key return.
*/
void TestWidgets::testSignal_data()
{
QTest::addColumn<QTestEventList>("events");
QTest::addColumn<double>("values");
int ms = 100;
QTestEventList list1;
list1.addKeyClick(Qt::Key_Delete);
list1.addKeyClick(Qt::Key_Delete);
list1.addKeyClick(Qt::Key_Delete);
list1.addKeyClick(Qt::Key_Delete);
list1.addKeyClick('0', Qt::NoModifier, ms);
list1.addKeyClick(Qt::Key_Return);
/*
** Note: QTest::newRow returns a QTestData reference that can be used
** to stream in data.
*/
QTest::newRow("Typing 0") << list1
<< (double)0;
QTestEventList list2;
/*
** We use addKeyClicks instead of addKeyClick, but the result
** is the same.
*/
list2.addKeyClick(Qt::Key_Delete);
list2.addKeyClick(Qt::Key_Delete);
list2.addKeyClick(Qt::Key_Delete);
list2.addKeyClick(Qt::Key_Delete);
list2.addKeyClicks("499.9", Qt::NoModifier, ms);
list2.addKeyClick(Qt::Key_Return);
QTest::newRow("Typing 499.9") << list2
<< (double)499.9;
QTestEventList list3;
list3.addKeyClick(Qt::Key_Delete);
list3.addKeyClick(Qt::Key_Delete);
list3.addKeyClick(Qt::Key_Delete);
list3.addKeyClick(Qt::Key_Delete);
list3.addKeyClick('9', Qt::NoModifier, ms);
list3.addKeyClick('9', Qt::NoModifier, ms);
list3.addKeyClick('9', Qt::NoModifier, ms);
list3.addKeyClick('.', Qt::NoModifier, ms);
list3.addKeyClick('9', Qt::NoModifier, ms);
list3.addKeyClick(Qt::Key_Return);
QTest::newRow("Typing 999.9") << list3
<< (double)999.9;
}
void TestWidgets::testSignal()
{
QFETCH(QTestEventList, events);
QFETCH(double, values);
int decimals = 2; // characters for the fractional part
double minrange = 0;
double maxrange = 500.0;
QDoubleSpinBox sb;
QSignalSpy spy(&sb,SIGNAL(valueChanged(double)));
sb.show();
sb.cleanText();
sb.setRange(minrange, maxrange);
sb.setDecimals(decimals);
QTest::qWait(1000);
events.simulate(&sb);
if (values <= maxrange) {
QCOMPARE(spy.count(), QString::number(values).size());
} else {
QCOMPARE(spy.count(), QString::number(sb.value()).size());
}
}
QTEST_MAIN(TestWidgets) |
package org.xmlcml.ami.visitor.chem;
import java.io.File;
import java.util.List;
import org.apache.log4j.Logger;
import org.xmlcml.ami.result.AbstractListElement;
import org.xmlcml.ami.result.SimpleResultList;
import org.xmlcml.ami.visitable.html.HtmlContainer;
import org.xmlcml.ami.visitable.svg.SVGContainer;
import org.xmlcml.ami.visitor.AbstractSearcher;
import org.xmlcml.ami.visitor.AbstractVisitor;
import org.xmlcml.html.HtmlSub;
import com.google.common.util.concurrent.<API key>;
public class ChemSearcher extends AbstractSearcher {
private final static Logger LOG = Logger.getLogger(ChemSearcher.class);
private static final int TIMEOUT = 350000000;
private static final String CHEM_SUB_DIRECTORY = "/"; // no subdirectory at present
File outputDirectory;
protected ChemSearcher(AbstractVisitor visitor) {
super(visitor);
}
@Override
protected void search(HtmlContainer htmlContainer) {
searchForSubscripts(htmlContainer);
}
@Override
protected void search(SVGContainer svgContainer) {
LOG.trace("ChemVisitor: now visiting an SVGVisitable");
outputDirectory = new File(visitor.<API key>().<API key>(), CHEM_SUB_DIRECTORY);
outputDirectory.mkdir();
try {
createAndSaveCML(svgContainer);
} catch (<API key> e) {
LOG.warn(e.getMessage());
}
throw new RuntimeException("chem search NYI");
}
private void createAndSaveCML(SVGContainer svgContainer) {
LOG.info("Working with svgContainer: "+ svgContainer.getName());
MoleculeCreator cmlCreator = new MoleculeCreator(svgContainer, TIMEOUT);
cmlCreator.<API key>();
try {
cmlCreator.<API key>(outputDirectory);
} catch (Throwable t) {
}
try {
cmlCreator.<API key>(outputDirectory);
} catch (Throwable t) {
}
}
/**
* This is just a test at present, especially as spaces are not correct yet.
* <p>
* HCO <sub>2</sub> H
*/
private void searchForSubscripts(HtmlContainer htmlContainer) {
List<HtmlSub> subList = HtmlSub.<API key>(htmlContainer.getHtmlElement());
LOG.debug("subscripts: "+subList.size());
}
@Override
protected AbstractListElement createListElement(SimpleResultList resultList) {
AbstractListElement listElement = new ChemListElement(resultList);
return listElement;
}
} |
#ifndef TIMER_H
#define TIMER_H
#include <map>
#include <time.h>
#include <sys/time.h>
#include <stdlib.h>
#include <assert.h>
#include <stdio.h>
typedef long long time_value;
struct timer_event {
time_value times;
void *arg;
int eventtype;
};
time_value get_now();
class timer_link {
static const int64_t mintimer = 1000 * 1;
public:
timer_link() {}
virtual ~timer_link() {}
// add new timer
int add_timer(void *, time_value);
void *get_timer(time_value tnow);
// remove timer
void remote_timer(void *);
time_value get_mintimer() const;
int get_arg_time_size() const { return timer_arg_time.size(); }
int get_time_arg_size() const { return timer_time_arg.size(); }
void show() const;
private:
std::multimap<void *, time_value> timer_arg_time;
std::multimap<time_value, void *> timer_time_arg;
};
#endif |
<!DOCTYPE HTML PUBLIC "-
<!-- NewPage -->
<html lang="en">
<head>
<!-- Generated by javadoc (1.8.0_144) on Tue Jul 03 11:45:03 CDT 2018 -->
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Negated</title>
<meta name="date" content="2018-07-03">
<meta name="keywords" content="edu.umn.biomedicus.modification.Negated class">
<meta name="keywords" content="getStartIndex()">
<meta name="keywords" content="getEndIndex()">
<meta name="keywords" content="getCueTerms()">
<meta name="keywords" content="component1()">
<meta name="keywords" content="component2()">
<meta name="keywords" content="component3()">
<meta name="keywords" content="copy()">
<meta name="keywords" content="toString()">
<meta name="keywords" content="hashCode()">
<meta name="keywords" content="equals()">
<link rel="stylesheet" type="text/css" href="../../../../stylesheet.css" title="Style">
<script type="text/javascript" src="../../../../script.js"></script>
</head>
<body>
<script type="text/javascript"><!
try {
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="Negated";
}
}
catch(err) {
}
var methods = {"i0":10,"i1":10,"i2":10,"i3":10,"i4":10,"i5":10,"i6":10,"i7":10,"i8":10,"i9":10};
var tabs = {65535:["t0","All Methods"],2:["t2","Instance Methods"],8:["t4","Concrete Methods"]};
var altColor = "altColor";
var rowColor = "rowColor";
var tableTab = "tableTab";
var activeTableTab = "activeTableTab";
</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
<div class="topNav"><a name="navbar.top">
</a>
<div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div>
<a name="navbar.top.firstrow">
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../overview-summary.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="navBarCell1Rev">Class</li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../index-all.html">Index</a></li>
<li><a href="../../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li><a href="../../../../edu/umn/biomedicus/modification/ModifiersModule.html" title="class in edu.umn.biomedicus.modification"><span class="typeNameLink">Prev Class</span></a></li>
<li><a href="../../../../edu/umn/biomedicus/modification/Probable.html" title="class in edu.umn.biomedicus.modification"><span class="typeNameLink">Next Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../../index.html?edu/umn/biomedicus/modification/Negated.html" target="_top">Frames</a></li>
<li><a href="Negated.html" target="_top">No Frames</a></li>
</ul>
<ul class="navList" id="<API key>">
<li><a href="../../../../allclasses-noframe.html">All Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!
allClassesLink = document.getElementById("<API key>");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
</script>
</div>
<div>
<ul class="subNavList">
<li>Summary: </li>
<li>Nested | </li>
<li>Field | </li>
<li><a href="#constructor.summary">Constr</a> | </li>
<li><a href="#method.summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail: </li>
<li>Field | </li>
<li><a href="#constructor.detail">Constr</a> | </li>
<li><a href="#method.detail">Method</a></li>
</ul>
</div>
<a name="skip.navbar.top">
</a></div>
<div class="header">
<div class="subTitle">edu.umn.biomedicus.modification</div>
<h2 title="Class Negated" class="title">Class Negated</h2>
</div>
<div class="contentContainer">
<ul class="inheritance">
<li>edu.umn.biomedicus.modification.Negated</li>
</ul>
<div class="description">
<ul class="blockList">
<li class="blockList">
<dl>
<dt>All Implemented Interfaces:</dt>
<dd><a href="../../../../edu/umn/biomedicus/modification/<API key>.html" title="interface in edu.umn.biomedicus.modification"><API key></a></dd>
</dl>
<hr>
<br>
<pre>public class <span class="typeNameLabel">Negated</span>
implements <a href="../../../../edu/umn/biomedicus/modification/<API key>.html" title="interface in edu.umn.biomedicus.modification"><API key></a></pre>
</li>
</ul>
</div>
<div class="summary">
<ul class="blockList">
<li class="blockList">
<ul class="blockList">
<li class="blockList"><a name="constructor.summary">
</a>
<h3>Constructor Summary</h3>
<table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Constructor Summary table, listing constructors, and an explanation">
<caption><span>Constructors</span><span class="tabEnd"> </span></caption>
<tr>
<th class="colOne" scope="col">Constructor and Description</th>
</tr>
<tr class="altColor">
<td class="colOne"><code><span class="memberNameLink"><a href="../../../../edu/umn/biomedicus/modification/Negated.html#<API key>-">Negated</a></span>(int startIndex,
int endIndex,
java.util.List<edu.umn.biomedicus.modification.ModificationCue> cueTerms)</code> </td>
</tr>
<tr class="rowColor">
<td class="colOne"><code><span class="memberNameLink"><a href="../../../../edu/umn/biomedicus/modification/Negated.html#<API key>-">Negated</a></span>(edu.umn.nlpengine.TextRange textRange,
java.util.List<edu.umn.biomedicus.modification.ModificationCue> cueTerms)</code> </td>
</tr>
</table>
</li>
</ul>
<ul class="blockList">
<li class="blockList"><a name="method.summary">
</a>
<h3>Method Summary</h3>
<table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Method Summary table, listing methods, and an explanation">
<caption><span id="t0" class="activeTableTab"><span>All Methods</span><span class="tabEnd"> </span></span><span id="t2" class="tableTab"><span><a href="javascript:show(2);">Instance Methods</a></span><span class="tabEnd"> </span></span><span id="t4" class="tableTab"><span><a href="javascript:show(8);">Concrete Methods</a></span><span class="tabEnd"> </span></span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Method and Description</th>
</tr>
<tr id="i0" class="altColor">
<td class="colFirst"><code>int</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../edu/umn/biomedicus/modification/Negated.html#component1--">component1</a></span>()</code> </td>
</tr>
<tr id="i1" class="rowColor">
<td class="colFirst"><code>int</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../edu/umn/biomedicus/modification/Negated.html#component2--">component2</a></span>()</code> </td>
</tr>
<tr id="i2" class="altColor">
<td class="colFirst"><code>java.util.List<edu.umn.biomedicus.modification.ModificationCue></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../edu/umn/biomedicus/modification/Negated.html#component3--">component3</a></span>()</code> </td>
</tr>
<tr id="i3" class="rowColor">
<td class="colFirst"><code><a href="../../../../edu/umn/biomedicus/modification/Negated.html" title="type parameter in Negated">Negated</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../edu/umn/biomedicus/modification/Negated.html#<API key>-">copy</a></span>(int startIndex,
int endIndex,
java.util.List<edu.umn.biomedicus.modification.ModificationCue> cueTerms)</code> </td>
</tr>
<tr id="i4" class="altColor">
<td class="colFirst"><code>boolean</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../edu/umn/biomedicus/modification/Negated.html#equals-p-">equals</a></span>(java.lang.Object p)</code> </td>
</tr>
<tr id="i5" class="rowColor">
<td class="colFirst"><code>java.util.List<edu.umn.biomedicus.modification.ModificationCue></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../edu/umn/biomedicus/modification/Negated.html#getCueTerms--">getCueTerms</a></span>()</code> </td>
</tr>
<tr id="i6" class="altColor">
<td class="colFirst"><code>int</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../edu/umn/biomedicus/modification/Negated.html#getEndIndex--">getEndIndex</a></span>()</code> </td>
</tr>
<tr id="i7" class="rowColor">
<td class="colFirst"><code>int</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../edu/umn/biomedicus/modification/Negated.html#getStartIndex--">getStartIndex</a></span>()</code> </td>
</tr>
<tr id="i8" class="altColor">
<td class="colFirst"><code>int</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../edu/umn/biomedicus/modification/Negated.html#hashCode--">hashCode</a></span>()</code> </td>
</tr>
<tr id="i9" class="rowColor">
<td class="colFirst"><code>java.lang.String</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../edu/umn/biomedicus/modification/Negated.html#toString--">toString</a></span>()</code> </td>
</tr>
</table>
<ul class="blockList">
<li class="blockList"><a name="methods.inherited.from.class.edu.umn.biomedicus.modification.<API key>">
</a>
<h3>Methods inherited from interface edu.umn.biomedicus.modification.<a href="../../../../edu/umn/biomedicus/modification/<API key>.html" title="interface in edu.umn.biomedicus.modification"><API key></a></h3>
<code><a href="../../../../edu/umn/biomedicus/modification/<API key>.html#getCueTerms--">getCueTerms</a></code></li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
<div class="details">
<ul class="blockList">
<li class="blockList">
<ul class="blockList">
<li class="blockList"><a name="constructor.detail">
</a>
<h3>Constructor Detail</h3>
<a name="<API key>-">
</a>
<ul class="blockList">
<li class="blockList">
<h4>Negated</h4>
<pre>public Negated(int startIndex,
int endIndex,
java.util.List<edu.umn.biomedicus.modification.ModificationCue> cueTerms)</pre>
</li>
</ul>
<a name="<API key>-">
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>Negated</h4>
<pre>public Negated(edu.umn.nlpengine.TextRange textRange,
java.util.List<edu.umn.biomedicus.modification.ModificationCue> cueTerms)</pre>
</li>
</ul>
</li>
</ul>
<ul class="blockList">
<li class="blockList"><a name="method.detail">
</a>
<h3>Method Detail</h3>
<a name="getStartIndex
</a>
<ul class="blockList">
<li class="blockList">
<h4>getStartIndex</h4>
<pre>public int getStartIndex()</pre>
</li>
</ul>
<a name="getEndIndex
</a>
<ul class="blockList">
<li class="blockList">
<h4>getEndIndex</h4>
<pre>public int getEndIndex()</pre>
</li>
</ul>
<a name="getCueTerms
</a>
<ul class="blockList">
<li class="blockList">
<h4>getCueTerms</h4>
<pre>public java.util.List<edu.umn.biomedicus.modification.ModificationCue> getCueTerms()</pre>
</li>
</ul>
<a name="component1
</a>
<ul class="blockList">
<li class="blockList">
<h4>component1</h4>
<pre>public int component1()</pre>
</li>
</ul>
<a name="component2
</a>
<ul class="blockList">
<li class="blockList">
<h4>component2</h4>
<pre>public int component2()</pre>
</li>
</ul>
<a name="component3
</a>
<ul class="blockList">
<li class="blockList">
<h4>component3</h4>
<pre>public java.util.List<edu.umn.biomedicus.modification.ModificationCue> component3()</pre>
</li>
</ul>
<a name="<API key>-">
</a>
<ul class="blockList">
<li class="blockList">
<h4>copy</h4>
<pre>public <a href="../../../../edu/umn/biomedicus/modification/Negated.html" title="type parameter in Negated">Negated</a> copy(int startIndex,
int endIndex,
java.util.List<edu.umn.biomedicus.modification.ModificationCue> cueTerms)</pre>
</li>
</ul>
<a name="toString
</a>
<ul class="blockList">
<li class="blockList">
<h4>toString</h4>
<pre>public java.lang.String toString()</pre>
</li>
</ul>
<a name="hashCode
</a>
<ul class="blockList">
<li class="blockList">
<h4>hashCode</h4>
<pre>public int hashCode()</pre>
</li>
</ul>
<a name="equals-p-">
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>equals</h4>
<pre>public boolean equals(java.lang.Object p)</pre>
</li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
</div>
<div class="bottomNav"><a name="navbar.bottom">
</a>
<div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div>
<a name="navbar.bottom.firstrow">
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../overview-summary.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="navBarCell1Rev">Class</li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../index-all.html">Index</a></li>
<li><a href="../../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li><a href="../../../../edu/umn/biomedicus/modification/ModifiersModule.html" title="class in edu.umn.biomedicus.modification"><span class="typeNameLink">Prev Class</span></a></li>
<li><a href="../../../../edu/umn/biomedicus/modification/Probable.html" title="class in edu.umn.biomedicus.modification"><span class="typeNameLink">Next Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../../index.html?edu/umn/biomedicus/modification/Negated.html" target="_top">Frames</a></li>
<li><a href="Negated.html" target="_top">No Frames</a></li>
</ul>
<ul class="navList" id="<API key>">
<li><a href="../../../../allclasses-noframe.html">All Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!
allClassesLink = document.getElementById("<API key>");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
</script>
</div>
<div>
<ul class="subNavList">
<li>Summary: </li>
<li>Nested | </li>
<li>Field | </li>
<li><a href="#constructor.summary">Constr</a> | </li>
<li><a href="#method.summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail: </li>
<li>Field | </li>
<li><a href="#constructor.detail">Constr</a> | </li>
<li><a href="#method.detail">Method</a></li>
</ul>
</div>
<a name="skip.navbar.bottom">
</a></div>
</body>
</html> |
title: Metric and label naming
sort_rank: 1
# Metric and label naming
The metric and label conventions presented in this document are not required
for using Prometheus, but can serve as both a style-guide and a collection of
best practices. Individual organizations may want to approach some of these
practices, e.g. naming conventions, differently.
## Metric names
A metric name...
* ...should have a (single-word) application prefix relevant to the domain the
metric belongs to. The prefix is sometimes referred to as `namespace` by
client libraries. For metrics specific to an application, the prefix is
usually the application name itself. Sometimes, however, metrics are more
generic, like standardized metrics exported by client libraries. Examples:
* <code><b>prometheus</b>\_notifications\_total</code>
(specific to the Prometheus server)
* <code><b>process</b>\_cpu\_seconds\_total</code>
(exported by many client libraries)
* <code><b>http</b>\_request\_duration\_seconds</code>
(for all HTTP requests)
* ...must have a single unit (i.e. do not mix seconds with milliseconds, or seconds with bytes).
* ...should use base units (e.g. seconds, bytes, meters - not milliseconds, megabytes, kilometers). See below for a list of base units.
* ...should have a suffix describing the unit, in plural form. Note that an accumulating count has `total` as a suffix, in addition to the unit if applicable.
* <code>http\_request\_duration\_<b>seconds</b></code>
* <code>node\_memory\_usage\_<b>bytes</b></code>
* <code>http\_requests\_<b>total</b></code>
(for a unit-less accumulating count)
* <code>process\_cpu\_<b>seconds\_total</b></code>
(for an accumulating count with unit)
* ...should represent the same logical <API key> across all label
dimensions.
* request duration
* bytes of data transfer
* instantaneous resource usage as a percentage
As a rule of thumb, either the `sum()` or the `avg()` over all dimensions of a
given metric should be meaningful (though not necessarily useful). If it is not
meaningful, split the data up into multiple metrics. For example, having the
capacity of various queues in one metric is good, while mixing the capacity of a
queue with the current number of elements in the queue is not.
## Labels
Use labels to differentiate the characteristics of the thing that is being measured:
* `<API key>` - differentiate request types: `type="create|update|delete"`
* `<API key>` - differentiate request stages: `stage="extract|transform|load"`
Do not put the label names in the metric name, as this introduces redundancy
and will cause confusion if the respective labels are aggregated away.
CAUTION: Remember that every unique combination of key-value label
pairs represents a new time series, which can dramatically increase the amount
of data stored. Do not use labels to store dimensions with high cardinality
(many different label values), such as user IDs, email addresses, or other
unbounded sets of values.
## Base units
Prometheus does not have any units hard coded. For better compability, base
units should be used. The following lists some metrics families with their base unit.
The list is not exhaustive.
| Family | Base unit | Remark |
|
| Time | seconds | |
| Temperature | celsius | Celsius is the most common one encountered in practice |
| Length | meters | |
| Bytes | bytes | |
| Bits | bytes | |
| Percent | ratio(*) | Values are 0-1. <br/> *) Usually 'ratio' is not used as suffix, but rather A\_per\_B. Exceptions are e.g. disk\_usage\_ratio |
| Voltage | volts | |
| Electric current | amperes | |
| Energy | joules | |
| Weight | grams | | |
# use onbuild variant, this will automatically copies the package source,
# fetches the application dependencies, builds the program,
# and configures it to run on startup
FROM golang:1.7.4-onbuild
MAINTAINER Zhang Wenqing "winking.zhang@grapecity.com"
EXPOSE 8081 |
package com.dsatab.view;
import android.content.Context;
import android.util.AttributeSet;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;
import com.dsatab.R;
import com.dsatab.data.items.Item;
import com.dsatab.data.items.ItemSpecification;
import com.dsatab.util.Debug;
import com.dsatab.util.DsaUtil;
import com.dsatab.util.ViewUtils;
import com.franlopez.flipcheckbox.FlipCheckBox;
public class ItemListItem extends <API key> {
public TextView text1, text2, text3;
public FlipCheckBox icon1;
public ImageView icon2;
public ItemListItem(Context context, AttributeSet attrs, int defStyle) {
super(context, attrs, defStyle);
init(attrs);
}
public ItemListItem(Context context, AttributeSet attrs) {
super(context, attrs);
init(attrs);
}
public ItemListItem(Context context) {
super(context);
init(null);
}
/**
* @param attrs
*/
private void init(AttributeSet attrs) {
}
/*
* (non-Javadoc)
*
* @see android.widget.TwoLineListItem#onFinishInflate()
*/
@Override
protected void onFinishInflate() {
text1 = (TextView) findViewById(android.R.id.text1);
text2 = (TextView) findViewById(android.R.id.text2);
icon1 = (FlipCheckBox) findViewById(android.R.id.checkbox);
icon2 = (ImageView) findViewById(android.R.id.icon2);
text3 = (TextView) findViewById(R.id.text3);
if (icon1 != null) {
icon1.setFocusable(false);
icon1.setClickable(false);
}
if (icon2 != null) {
icon2.setVisibility(View.GONE);
icon2.setFocusable(false);
icon2.setClickable(false);
}
super.onFinishInflate();
}
public void setItem(Item e) {
if (e != null) {
if (e.getSpecifications().isEmpty()) {
Debug.e("Item without spec found " + e.getName());
setItem(e, null);
} else {
setItem(e, e.getSpecifications().get(0));
}
} else {
setItem(null, null);
}
}
public void setItem(Item e, ItemSpecification spec) {
if (icon1 != null) {
icon1.setVisibility(View.VISIBLE);
if (e != null && e.getIconUri() != null)
icon1.setFrontDrawable(ViewUtils.circleIcon(icon1.getContext(), e.getIconUri()));
else if (spec != null)
icon1.setFrontDrawable(ViewUtils.circleIcon(icon1.getContext(), DsaUtil.getResourceId(spec)));
else
icon1.setFrontDrawable(null);
}
// Set value for the first text field
if (text1 != null) {
if (e != null) {
text1.setText(e.getTitle());
} else {
text1.setText(null);
}
}
// set value for the second text field
if (text2 != null) {
if (spec != null) {
text2.setText(spec.getInfo());
} else {
text2.setText(null);
}
}
}
} |
<!DOCTYPE html>
<html lang="en" xmlns="http:
xmlns:fb="http://ogp.me/ns/fb
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1.0" />
<meta property="og:image" content="assets/img/camel_banner.jpg" />
<title>JamPacked : Photo Booth</title>
<!-- Google font: Cookie-->
<link href="https://fonts.googleapis.com/css?family=Cookie" rel="stylesheet" type="text/css">
<!-- Google Icon Font-->
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet" type="text/css">
<!-- materialize.css-->
<link href="../materialize/css/materialize.min.css" type="text/css" rel="stylesheet" media="screen,projection" />
<!-- page css-->
<link href="../page-template.css" type="text/css" rel="stylesheet" media="screen,projection" />
<!-- favicons -->
<link rel="apple-touch-icon" sizes="180x180" href="/favicons/apple-touch-icon.png">
<link rel="icon" type="image/png" href="/favicons/favicon-32x32.png" sizes="32x32">
<link rel="icon" type="image/png" href="/favicons/favicon-16x16.png" sizes="16x16">
<link rel="manifest" href="/favicons/manifest.json">
<link rel="mask-icon" href="/favicons/safari-pinned-tab.svg" color="#5bbad5">
<link rel="shortcut icon" href="/favicons/favicon.ico">
<meta name="<API key>" content="/favicons/browserconfig.xml">
<meta name="theme-color" content="#ffffff">
</head>
<body>
<div class='section no-pad-bot' id='index-banner'>
<div class='container'> <img src='<API key>.jpg' height='480px' width='800px'></img>
<img src='<API key>.jpg' height='480px' width='800px'></img>
<img src='<API key>.jpg' height='480px' width='800px'></img>
<img src='<API key>.jpg' height='480px' width='800px'></img>
</div>
</div>
</body>
</html> |
package net
import (
"encoding/binary"
"fmt"
"log"
"net"
"os"
)
type TcpMessageHandler interface {
HandleMessage(clientCon *net.TCPConn, msgData []byte)
}
type TcpHost struct {
mliType MliType
addr *net.TCPAddr
handler TcpMessageHandler
log *log.Logger
}
func NewTcpHost(mliType MliType, tcpAddr *net.TCPAddr) *TcpHost {
newTcpHost := new(TcpHost)
newTcpHost.addr = tcpAddr
newTcpHost.mliType = mliType
newTcpHost.log = log.New(os.Stdout, "tcp_host ## ", log.LstdFlags)
return newTcpHost
}
func (tcpHost *TcpHost) SetHandler(handler TcpMessageHandler) {
tcpHost.handler = handler
}
func (tcpHost *TcpHost) Start() {
tcpListener, err := net.ListenTCP("tcp4", tcpHost.addr)
if err != nil {
fmt.Println("error listening at port -", tcpHost.addr.String(), err.Error())
return
}
logger.Printf("started tcp-ip host @ %s", tcpListener.Addr().String())
for {
clientConn, err := tcpListener.AcceptTCP()
if err != nil {
fmt.Println("error accepting client connection - ", err.Error())
}
logger.Printf("new connection from %s", clientConn.RemoteAddr().String())
go tcpHost.handleClient(clientConn)
}
}
func (tcpHost *TcpHost) handleClient(clientConn *net.TCPConn) {
//if any errors/panics handling the client, just recover and let
//others connected continue
defer func() {
str := recover()
if str != nil {
tcpHost.log.Printf("panic recovered. client connection will be closed.")
return
}
}()
mli := make([]byte, 2)
for {
n, err := clientConn.Read(mli)
if err != nil {
handleNetworkError(err, clientConn.RemoteAddr().String())
_ = clientConn.Close()
return
}
reqLen := binary.BigEndian.Uint16(mli)
if tcpHost.mliType == Mli2i {
reqLen = reqLen - 2
}
tcpHost.log.Printf("reading incoming message with %d bytes...\n", reqLen)
//all good, read rest of the message data
msgData := make([]byte, reqLen)
n, err = clientConn.Read(msgData)
if err != nil {
handleNetworkError(err, clientConn.RemoteAddr().String())
_ = clientConn.Close()
return
}
if uint16(n) != reqLen {
logger.Printf("not enough data - required: %d != actual %d\n", reqLen, n)
continue
}
go tcpHost.handler.HandleMessage(clientConn, msgData)
}
}
func handleNetworkError(err error, refMsg string) {
if err != nil {
if err.Error() == "EOF" {
log.Printf("client connection closed -[ref: %s]", refMsg)
} else {
logger.Printf("error on client connection. closing connection [Err: %s]\n", err.Error())
}
return
}
} |
<!DOCTYPE HTML PUBLIC "-
<!-- NewPage -->
<html lang="en">
<head>
<!-- Generated by javadoc (version 1.7.0_75) on Tue May 19 17:12:43 PDT 2015 -->
<meta http-equiv="Content-Type" content="text/html" charset="UTF-8">
<title>Uses of Package org.apache.hadoop.metrics2 (Apache Hadoop Main 2.6.0-cdh5.4.2 API)</title>
<meta name="date" content="2015-05-19">
<link rel="stylesheet" type="text/css" href="../../../../stylesheet.css" title="Style">
</head>
<body>
<script type="text/javascript"><!
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="Uses of Package org.apache.hadoop.metrics2 (Apache Hadoop Main 2.6.0-cdh5.4.2 API)";
}
</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
<div class="topNav"><a name="navbar_top">
</a><a href="#skip-navbar_top" title="Skip navigation links"></a><a name="navbar_top_firstrow">
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../overview-summary.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li>Class</li>
<li class="navBarCell1Rev">Use</li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../index-all.html">Index</a></li>
<li><a href="../../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li>Prev</li>
<li>Next</li>
</ul>
<ul class="navList">
<li><a href="../../../../index.html?org/apache/hadoop/metrics2/package-use.html" target="_top">Frames</a></li>
<li><a href="package-use.html" target="_top">No Frames</a></li>
</ul>
<ul class="navList" id="<API key>">
<li><a href="../../../../allclasses-noframe.html">All Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!
allClassesLink = document.getElementById("<API key>");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
</script>
</div>
<a name="skip-navbar_top">
</a></div>
<div class="header">
<h1 title="Uses of Package org.apache.hadoop.metrics2" class="title">Uses of Package<br>org.apache.hadoop.metrics2</h1>
</div>
<div class="contentContainer">
<ul class="blockList">
<li class="blockList">
<table border="0" cellpadding="3" cellspacing="0" summary="Use table, listing packages, and an explanation">
<caption><span>Packages that use <a href="../../../../org/apache/hadoop/metrics2/package-summary.html">org.apache.hadoop.metrics2</a></span><span class="tabEnd"> </span></caption>
<tr>
<th class="colFirst" scope="col">Package</th>
<th class="colLast" scope="col">Description</th>
</tr>
<tbody>
<tr class="altColor">
<td class="colFirst"><a href="#org.apache.hadoop.fs.azure.metrics">org.apache.hadoop.fs.azure.metrics</a></td>
<td class="colLast">
<div class="block">
Infrastructure for a Metrics2 source that provides information on Windows
Azure Filesystem for Hadoop instances.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><a href="#org.apache.hadoop.metrics2">org.apache.hadoop.metrics2</a></td>
<td class="colLast">
<div class="block">Metrics 2.0</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><a href="#org.apache.hadoop.metrics2.filter">org.apache.hadoop.metrics2.filter</a></td>
<td class="colLast">
<div class="block">Builtin metrics filters (to be used in metrics config files)</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><a href="#org.apache.hadoop.metrics2.lib">org.apache.hadoop.metrics2.lib</a></td>
<td class="colLast">
<div class="block">A collection of library classes for implementing metrics sources</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><a href="#org.apache.hadoop.metrics2.sink">org.apache.hadoop.metrics2.sink</a></td>
<td class="colLast">
<div class="block">Builtin metrics sinks</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><a href="#org.apache.hadoop.metrics2.util">org.apache.hadoop.metrics2.util</a></td>
<td class="colLast">
<div class="block">General helpers for implementing source and sinks</div>
</td>
</tr>
</tbody>
</table>
</li>
<li class="blockList"><a name="org.apache.hadoop.fs.azure.metrics">
</a>
<table border="0" cellpadding="3" cellspacing="0" summary="Use table, listing classes, and an explanation">
<caption><span>Classes in <a href="../../../../org/apache/hadoop/metrics2/package-summary.html">org.apache.hadoop.metrics2</a> used by <a href="../../../../org/apache/hadoop/fs/azure/metrics/package-summary.html">org.apache.hadoop.fs.azure.metrics</a></span><span class="tabEnd"> </span></caption>
<tr>
<th class="colOne" scope="col">Class and Description</th>
</tr>
<tbody>
<tr class="altColor">
<td class="colOne"><a href="../../../../org/apache/hadoop/metrics2/class-use/MetricsCollector.html#org.apache.hadoop.fs.azure.metrics">MetricsCollector</a>
<div class="block">The metrics collector interface</div>
</td>
</tr>
<tr class="rowColor">
<td class="colOne"><a href="../../../../org/apache/hadoop/metrics2/class-use/MetricsInfo.html#org.apache.hadoop.fs.azure.metrics">MetricsInfo</a>
<div class="block">Interface to provide immutable meta info for metrics</div>
</td>
</tr>
<tr class="altColor">
<td class="colOne"><a href="../../../../org/apache/hadoop/metrics2/class-use/MetricsSource.html#org.apache.hadoop.fs.azure.metrics">MetricsSource</a>
<div class="block">The metrics source interface</div>
</td>
</tr>
</tbody>
</table>
</li>
<li class="blockList"><a name="org.apache.hadoop.metrics2">
</a>
<table border="0" cellpadding="3" cellspacing="0" summary="Use table, listing classes, and an explanation">
<caption><span>Classes in <a href="../../../../org/apache/hadoop/metrics2/package-summary.html">org.apache.hadoop.metrics2</a> used by <a href="../../../../org/apache/hadoop/metrics2/package-summary.html">org.apache.hadoop.metrics2</a></span><span class="tabEnd"> </span></caption>
<tr>
<th class="colOne" scope="col">Class and Description</th>
</tr>
<tbody>
<tr class="altColor">
<td class="colOne"><a href="../../../../org/apache/hadoop/metrics2/class-use/AbstractMetric.html#org.apache.hadoop.metrics2">AbstractMetric</a>
<div class="block">The immutable metric</div>
</td>
</tr>
<tr class="rowColor">
<td class="colOne"><a href="../../../../org/apache/hadoop/metrics2/class-use/MetricsCollector.html#org.apache.hadoop.metrics2">MetricsCollector</a>
<div class="block">The metrics collector interface</div>
</td>
</tr>
<tr class="altColor">
<td class="colOne"><a href="../../../../org/apache/hadoop/metrics2/class-use/MetricsInfo.html#org.apache.hadoop.metrics2">MetricsInfo</a>
<div class="block">Interface to provide immutable meta info for metrics</div>
</td>
</tr>
<tr class="rowColor">
<td class="colOne"><a href="../../../../org/apache/hadoop/metrics2/class-use/MetricsPlugin.html#org.apache.hadoop.metrics2">MetricsPlugin</a>
<div class="block">The plugin interface for the metrics framework</div>
</td>
</tr>
<tr class="altColor">
<td class="colOne"><a href="../../../../org/apache/hadoop/metrics2/class-use/MetricsRecord.html#org.apache.hadoop.metrics2">MetricsRecord</a>
<div class="block">An immutable snapshot of metrics with a timestamp</div>
</td>
</tr>
<tr class="rowColor">
<td class="colOne"><a href="../../../../org/apache/hadoop/metrics2/class-use/<API key>.html#org.apache.hadoop.metrics2"><API key></a>
<div class="block">The metrics record builder interface</div>
</td>
</tr>
<tr class="altColor">
<td class="colOne"><a href="../../../../org/apache/hadoop/metrics2/class-use/MetricsSink.html#org.apache.hadoop.metrics2">MetricsSink</a>
<div class="block">The metrics sink interface.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colOne"><a href="../../../../org/apache/hadoop/metrics2/class-use/MetricsSource.html#org.apache.hadoop.metrics2">MetricsSource</a>
<div class="block">The metrics source interface</div>
</td>
</tr>
<tr class="altColor">
<td class="colOne"><a href="../../../../org/apache/hadoop/metrics2/class-use/MetricsSystem.html#org.apache.hadoop.metrics2">MetricsSystem</a>
<div class="block">The metrics system interface</div>
</td>
</tr>
<tr class="rowColor">
<td class="colOne"><a href="../../../../org/apache/hadoop/metrics2/class-use/MetricsSystemMXBean.html#org.apache.hadoop.metrics2">MetricsSystemMXBean</a>
<div class="block">The JMX interface to the metrics system</div>
</td>
</tr>
<tr class="altColor">
<td class="colOne"><a href="../../../../org/apache/hadoop/metrics2/class-use/MetricsTag.html#org.apache.hadoop.metrics2">MetricsTag</a>
<div class="block">Immutable tag for metrics (for grouping on host/queue/username etc.)</div>
</td>
</tr>
<tr class="rowColor">
<td class="colOne"><a href="../../../../org/apache/hadoop/metrics2/class-use/MetricsVisitor.html#org.apache.hadoop.metrics2">MetricsVisitor</a>
<div class="block">A visitor interface for metrics</div>
</td>
</tr>
</tbody>
</table>
</li>
<li class="blockList"><a name="org.apache.hadoop.metrics2.filter">
</a>
<table border="0" cellpadding="3" cellspacing="0" summary="Use table, listing classes, and an explanation">
<caption><span>Classes in <a href="../../../../org/apache/hadoop/metrics2/package-summary.html">org.apache.hadoop.metrics2</a> used by <a href="../../../../org/apache/hadoop/metrics2/filter/package-summary.html">org.apache.hadoop.metrics2.filter</a></span><span class="tabEnd"> </span></caption>
<tr>
<th class="colOne" scope="col">Class and Description</th>
</tr>
<tbody>
<tr class="altColor">
<td class="colOne"><a href="../../../../org/apache/hadoop/metrics2/class-use/MetricsFilter.html#org.apache.hadoop.metrics2.filter">MetricsFilter</a>
<div class="block">The metrics filter interface</div>
</td>
</tr>
<tr class="rowColor">
<td class="colOne"><a href="../../../../org/apache/hadoop/metrics2/class-use/MetricsPlugin.html#org.apache.hadoop.metrics2.filter">MetricsPlugin</a>
<div class="block">The plugin interface for the metrics framework</div>
</td>
</tr>
</tbody>
</table>
</li>
<li class="blockList"><a name="org.apache.hadoop.metrics2.lib">
</a>
<table border="0" cellpadding="3" cellspacing="0" summary="Use table, listing classes, and an explanation">
<caption><span>Classes in <a href="../../../../org/apache/hadoop/metrics2/package-summary.html">org.apache.hadoop.metrics2</a> used by <a href="../../../../org/apache/hadoop/metrics2/lib/package-summary.html">org.apache.hadoop.metrics2.lib</a></span><span class="tabEnd"> </span></caption>
<tr>
<th class="colOne" scope="col">Class and Description</th>
</tr>
<tbody>
<tr class="altColor">
<td class="colOne"><a href="../../../../org/apache/hadoop/metrics2/class-use/MetricsInfo.html#org.apache.hadoop.metrics2.lib">MetricsInfo</a>
<div class="block">Interface to provide immutable meta info for metrics</div>
</td>
</tr>
<tr class="rowColor">
<td class="colOne"><a href="../../../../org/apache/hadoop/metrics2/class-use/<API key>.html#org.apache.hadoop.metrics2.lib"><API key></a>
<div class="block">The metrics record builder interface</div>
</td>
</tr>
<tr class="altColor">
<td class="colOne"><a href="../../../../org/apache/hadoop/metrics2/class-use/MetricsSystem.html#org.apache.hadoop.metrics2.lib">MetricsSystem</a>
<div class="block">The metrics system interface</div>
</td>
</tr>
<tr class="rowColor">
<td class="colOne"><a href="../../../../org/apache/hadoop/metrics2/class-use/MetricsTag.html#org.apache.hadoop.metrics2.lib">MetricsTag</a>
<div class="block">Immutable tag for metrics (for grouping on host/queue/username etc.)</div>
</td>
</tr>
</tbody>
</table>
</li>
<li class="blockList"><a name="org.apache.hadoop.metrics2.sink">
</a>
<table border="0" cellpadding="3" cellspacing="0" summary="Use table, listing classes, and an explanation">
<caption><span>Classes in <a href="../../../../org/apache/hadoop/metrics2/package-summary.html">org.apache.hadoop.metrics2</a> used by <a href="../../../../org/apache/hadoop/metrics2/sink/package-summary.html">org.apache.hadoop.metrics2.sink</a></span><span class="tabEnd"> </span></caption>
<tr>
<th class="colOne" scope="col">Class and Description</th>
</tr>
<tbody>
<tr class="altColor">
<td class="colOne"><a href="../../../../org/apache/hadoop/metrics2/class-use/MetricsPlugin.html#org.apache.hadoop.metrics2.sink">MetricsPlugin</a>
<div class="block">The plugin interface for the metrics framework</div>
</td>
</tr>
<tr class="rowColor">
<td class="colOne"><a href="../../../../org/apache/hadoop/metrics2/class-use/MetricsRecord.html#org.apache.hadoop.metrics2.sink">MetricsRecord</a>
<div class="block">An immutable snapshot of metrics with a timestamp</div>
</td>
</tr>
<tr class="altColor">
<td class="colOne"><a href="../../../../org/apache/hadoop/metrics2/class-use/MetricsSink.html#org.apache.hadoop.metrics2.sink">MetricsSink</a>
<div class="block">The metrics sink interface.</div>
</td>
</tr>
</tbody>
</table>
</li>
<li class="blockList"><a name="org.apache.hadoop.metrics2.util">
</a>
<table border="0" cellpadding="3" cellspacing="0" summary="Use table, listing classes, and an explanation">
<caption><span>Classes in <a href="../../../../org/apache/hadoop/metrics2/package-summary.html">org.apache.hadoop.metrics2</a> used by <a href="../../../../org/apache/hadoop/metrics2/util/package-summary.html">org.apache.hadoop.metrics2.util</a></span><span class="tabEnd"> </span></caption>
<tr>
<th class="colOne" scope="col">Class and Description</th>
</tr>
<tbody>
<tr class="altColor">
<td class="colOne"><a href="../../../../org/apache/hadoop/metrics2/class-use/MetricsRecord.html#org.apache.hadoop.metrics2.util">MetricsRecord</a>
<div class="block">An immutable snapshot of metrics with a timestamp</div>
</td>
</tr>
<tr class="rowColor">
<td class="colOne"><a href="../../../../org/apache/hadoop/metrics2/class-use/MetricsTag.html#org.apache.hadoop.metrics2.util">MetricsTag</a>
<div class="block">Immutable tag for metrics (for grouping on host/queue/username etc.)</div>
</td>
</tr>
</tbody>
</table>
</li>
</ul>
</div>
<div class="bottomNav"><a name="navbar_bottom">
</a><a href="#skip-navbar_bottom" title="Skip navigation links"></a><a name="<API key>">
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../overview-summary.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li>Class</li>
<li class="navBarCell1Rev">Use</li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../index-all.html">Index</a></li>
<li><a href="../../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li>Prev</li>
<li>Next</li>
</ul>
<ul class="navList">
<li><a href="../../../../index.html?org/apache/hadoop/metrics2/package-use.html" target="_top">Frames</a></li>
<li><a href="package-use.html" target="_top">No Frames</a></li>
</ul>
<ul class="navList" id="<API key>">
<li><a href="../../../../allclasses-noframe.html">All Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!
allClassesLink = document.getElementById("<API key>");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
</script>
</div>
<a name="skip-navbar_bottom">
</a></div>
<p class="legalCopy"><small>Copyright &
</body>
</html> |
function checkNode(Node)
{
document.getElementById("myModalLabel").setAttribute('nodeName', Node );
var xhttp = new XMLHttpRequest();
xhttp.onreadystatechange = function() {
if (xhttp.readyState == 4 && xhttp.status == 200) {
var response = xhttp.responseText;
document.getElementById("listNodes").innerHTML = xhttp.responseText;
}}
var inputNode = document.getElementById('input'+Node).value;
var inputType = "Node";
var selectedGraphValue = getCookie('graphName');
if(inputNode.length<2)
{
document.getElementById("listNodes").innerHTML = "Your query should have two or more characters";
document.getElementById("listButton").className="btn btn-primary disabled"
$('#listButton').attr('disabled', 'true');
}
else
{
xhttp.open("GET", REST_API + "autoComplete/"+selectedGraphValue+"/"+inputNode+"/"+Node, true);
xhttp.send();
}
}
function checkEnable()
{
if(document.getElementById('divSearch').style.visibility == 'visible')
{
document.getElementById("btnSubmit").className="btn btn-success disabled";
}
else
{
if(document.getElementById("btnNode1").className=="btn btn-warning disabled" && document.getElementById("btnNode2").className=="btn btn-warning disabled")
{
document.getElementById("btnSubmit").className="btn btn-success";
}
else
{
document.getElementById("btnSubmit").className="btn btn-success disabled";
}
}
}
function deleteChoice(selectedNode)
{
document.getElementById("input"+selectedNode).value = '';
document.getElementById("div"+selectedNode).className="form-group";
$('#input'+selectedNode).removeAttr("disabled");
document.getElementById("btn"+selectedNode).className="btn btn-warning"
document.cookie="selected"+selectedNode+"=null";
checkEnable();
}
function deletePredicate(Predicate)
{
var elem = document.getElementById('li'+Predicate);
elem.parentNode.removeChild(elem);
}
function selectNode()
{
var selectedText = $('input[name="optradio"]:checked').val().split(":");
var selectedValue = selectedText[0];
var selectedURI = selectedText[1]+":"+selectedText[2];
var selectedNode = document.getElementById("myModalLabel").getAttribute('nodeName');
if(selectedNode == "Predicate")
{
document.getElementById("input"+selectedNode).value = "";
var ulPredicates = document.getElementById("predicatesUL");
var entry = document.createElement('li');
entry.innerHTML = '<a href=# class="badge" onclick="deletePredicate(\''+selectedValue+'\')">X</a>'+selectedValue;
entry.className = "list-group-item";
entry.setAttribute('fullName', selectedURI);
entry.id = "li"+selectedValue;
entry.style.color = 'gray';
ulPredicates.appendChild(entry);
closeDialog();
}
else
{
document.getElementById("input"+selectedNode).value = selectedValue+": "+selectedURI;
document.getElementById("div"+selectedNode).className="form-group has-success has-feedback";
$('#input'+selectedNode).attr('disabled', 'true');
document.cookie="selected"+selectedNode+"="+selectedURI;
document.getElementById("btn"+selectedNode).className="btn btn-warning disabled"
closeDialog();
if($('#pagetype').val() == "centrality"){
// this function is defined in centrality.html
<API key>();
}
else{
// it's conviewer
checkEnable();
}
}
}
function closeDialog()
{
document.getElementById("listButton").className="btn btn-primary"
$('#listButton').removeAttr("disabled");
document.getElementById("listNodes").innerHTML = "<p><span class=\"glyphicon glyphicon-search\" aria-hidden=\"true\"></span> Searching on graph for URIs that match your query.</p>";
document.getElementById("myModalLabel").setAttribute('nodeName', '');
}
function getGraphName()
{
var name = getCookie('graphName');
document.getElementById("GraphName").innerHTML = name;
}
function getCookie(name) {
var value = "; " + document.cookie;
var parts = value.split("; " + name + "=");
if (parts.length == 2) return parts.pop().split(";").shift();
}
function startJob()
{
document.getElementById('divSearch').style.visibility = 'visible';
var xhttp = new XMLHttpRequest();
var selectedGraphValue = getCookie('graphName');
var Node1 = getCookie('selectedNode1');
Node1 = Node1.replaceAll("/","$");
Node1 = Node1.replaceAll("
var Node2 = getCookie('selectedNode2');
Node2 = Node2.replaceAll("/","$");
Node2 = Node2.replaceAll("
var Predicate = $('input[name="radioPredicate"]:checked').val()+"
var ul = document.getElementById("predicatesUL");
var items = ul.<API key>("li");
for (var i = 0; i < items.length; ++i) {
var fullN = items[i].getAttribute('fullName');
fullN = fullN.replaceAll("/","$");
fullN = fullN.replaceAll("
Predicate += fullN+",";
}
var Pattern = "";
for (var i=1; i<=14; i++)
{
if($("#chPattern"+i).attr('checked')=="checked")
{
Pattern += "1,";
}
else
{
Pattern += "0,";
}
}
checkEnable();
xhttp.open("GET", REST_API + "connViewer/"+Node1+"/"+Node2+"/"+selectedGraphValue+"/"+Predicate+"/"+Pattern, true);
xhttp.send();
}
function getResult()
{
var xhttp = new XMLHttpRequest();
xhttp.onreadystatechange = function() {
if (xhttp.readyState == 4 && xhttp.status == 200) {
if(xhttp.responseText=="END")
{
document.getElementById('divSearch').style.visibility = 'hidden';
checkEnable();
}
else if(xhttp.responseText!="")
{
if(document.getElementById('code').value.length != xhttp.responseText.length)
{
document.getElementById('code').value = xhttp.responseText;
document.getElementById('code').focus();
var e = jQuery.Event("keydown");
e.which = 32; // # Some key code value
$("#code").trigger(e);
document.getElementById('editor').style.display = 'none';
document.getElementById('viewport').width = (parseInt($('#IDbardh').get(0).offsetWidth) - 100);
document.getElementById('dashboard').width = (parseInt($('#IDbardh').get(0).offsetWidth) - 100);
document.getElementById('viewport').height=500;
}
else
{
}
}
}
}
xhttp.open("GET", REST_API + "connViewerResult", true);
xhttp.send();
} |
import os
import json
import shlex
import pprint
import asyncio
import tempfile
import functools
import subprocess
import synapse.exc as s_exc
import synapse.common as s_common
import synapse.lib.cmd as s_cmd
import synapse.lib.cli as s_cli
ListHelp = '''
Lists all the keys underneath a particular key in the hive.
Syntax:
hive ls|list [path]
Notes:
If path is not specified, the root is listed.
'''
GetHelp = '''
Display or save to file the contents of a key in the hive.
Syntax:
hive get [--file] [--json] {path}
'''
DelHelp = '''
Deletes a key in the cell's hive.
Syntax:
hive rm|del {path}
Notes:
Delete will recursively delete all subkeys underneath path if they exist.
'''
EditHelp = '''
Edits or creates a key in the cell's hive.
Syntax:
hive edit|mod {path} [--string] ({value} | --editor | -f {filename})
Notes:
One may specify the value directly on the command line, from a file, or use an editor. For the --editor option,
the environment variable VISUAL or EDITOR must be set.
'''
class HiveCmd(s_cli.Cmd):
'''
Manipulates values in a cell's Hive.
A Hive is a hierarchy persistent storage mechanism typically used for configuration data.
'''
_cmd_name = 'hive'
_cmd_syntax = (
('line', {'type': 'glob'}), # type: ignore
)
def _make_argparser(self):
parser = s_cmd.Parser(prog='hive', outp=self, description=self.__doc__)
subparsers = parser.add_subparsers(title='subcommands', required=True, dest='cmd',
parser_class=functools.partial(s_cmd.Parser, outp=self))
parser_ls = subparsers.add_parser('list', aliases=['ls'], help="List entries in the hive", usage=ListHelp)
parser_ls.add_argument('path', nargs='?', help='Hive path')
parser_get = subparsers.add_parser('get', help="Get any entry in the hive", usage=GetHelp)
parser_get.add_argument('path', help='Hive path')
parser_get.add_argument('-f', '--file', default=False, action='store',
help='Save the data to a file.')
parser_get.add_argument('--json', default=False, action='store_true', help='Emit output as json')
parser_rm = subparsers.add_parser('del', aliases=['rm'], help='Delete a key in the hive', usage=DelHelp)
parser_rm.add_argument('path', help='Hive path')
parser_edit = subparsers.add_parser('edit', aliases=['mod'], help='Sets/creates a key', usage=EditHelp)
parser_edit.add_argument('--string', action='store_true', help="Edit value as a single string")
parser_edit.add_argument('path', help='Hive path')
group = parser_edit.<API key>(required=True)
group.add_argument('value', nargs='?', help='Value to set')
group.add_argument('--editor', default=False, action='store_true',
help='Opens an editor to set the value')
group.add_argument('--file', '-f', help='Copies the contents of the file to the path')
return parser
async def runCmdOpts(self, opts):
line = opts.get('line')
if line is None:
self.printf(self.__doc__)
return
core = self.getCmdItem()
try:
opts = self._make_argparser().parse_args(shlex.split(line))
except s_exc.ParserExit:
return
handlers = {
'list': self._handle_ls,
'ls': self._handle_ls,
'del': self._handle_rm,
'rm': self._handle_rm,
'get': self._handle_get,
'edit': self._handle_edit,
'mod': self._handle_edit,
}
await handlers[opts.cmd](core, opts)
@staticmethod
def parsepath(path):
''' Turn a slash-delimited path into a list that hive takes '''
return path.split('/')
async def _handle_ls(self, core, opts):
path = self.parsepath(opts.path) if opts.path is not None else None
keys = await core.listHiveKey(path=path)
if keys is None:
self.printf('Path not found')
return
for key in keys:
self.printf(key)
async def _handle_get(self, core, opts):
path = self.parsepath(opts.path)
valu = await core.getHiveKey(path)
if valu is None:
self.printf(f'{opts.path} not present')
return
if opts.json:
prend = json.dumps(valu, indent=4, sort_keys=True)
rend = prend.encode()
elif isinstance(valu, str):
rend = valu.encode()
prend = valu
elif isinstance(valu, bytes):
rend = valu
prend = pprint.pformat(valu)
else:
rend = json.dumps(valu, indent=4, sort_keys=True).encode()
prend = pprint.pformat(valu)
if opts.file:
with s_common.genfile(opts.file) as fd:
fd.truncate(0)
fd.write(rend)
self.printf(f'Saved the hive entry [{opts.path}] to {opts.file}')
return
self.printf(f'{opts.path}:\n{prend}')
async def _handle_rm(self, core, opts):
path = self.parsepath(opts.path)
await core.popHiveKey(path)
async def _handle_edit(self, core, opts):
path = self.parsepath(opts.path)
if opts.value is not None:
if opts.value[0] not in '([{"':
data = opts.value
else:
data = json.loads(opts.value)
await core.setHiveKey(path, data)
return
elif opts.file is not None:
with open(opts.file) as fh:
s = fh.read()
if len(s) == 0:
self.printf('Empty file. Not writing key.')
return
data = s if opts.string else json.loads(s)
await core.setHiveKey(path, data)
return
editor = os.getenv('VISUAL', (os.getenv('EDITOR', None)))
if editor is None or editor == '':
self.printf('Environment variable VISUAL or EDITOR must be set for --editor')
return
tnam = None
try:
with tempfile.NamedTemporaryFile(mode='w', delete=False) as fh:
old_valu = await core.getHiveKey(path)
if old_valu is not None:
if opts.string:
if not isinstance(old_valu, str):
self.printf('Existing value is not a string, therefore not editable as a string')
return
data = old_valu
else:
try:
data = json.dumps(old_valu, indent=4, sort_keys=True)
except (ValueError, TypeError):
self.printf('Value is not JSON-encodable, therefore not editable.')
return
fh.write(data)
tnam = fh.name
while True:
retn = subprocess.call(f'{editor} {tnam}', shell=True)
if retn != 0: # pragma: no cover
self.printf('Editor failed with non-zero code. Aborting.')
return
with open(tnam) as fh:
rawval = fh.read()
if len(rawval) == 0: # pragma: no cover
self.printf('Empty file. Not writing key.')
return
try:
valu = rawval if opts.string else json.loads(rawval)
except json.JSONDecodeError as e: # pragma: no cover
self.printf(f'JSON decode failure: [{e}]. Reopening.')
await asyncio.sleep(1)
continue
# We lose the tuple/list distinction in the telepath round trip, so tuplify everything to compare
if (opts.string and valu == old_valu) or (not opts.string and s_common.tuplify(valu) == old_valu):
self.printf('Valu not changed. Not writing key.')
return
await core.setHiveKey(path, valu)
break
finally:
if tnam is not None:
os.unlink(tnam) |
package com.simplegame.server.share.export;
import java.util.concurrent.TimeUnit;
/**
*
* @Author zeusgooogle@gmail.com
* @sine 201598 11:47:25
*
*/
public interface <API key> {
/**
*
*
* @param moduleName
* @param taskId
* @param command
* @param data
* @param delay
* @param timeUnit
*/
public void schedule(String moduleName, String taskId, String command, Object data, long delay, TimeUnit timeUnit);
/**
*
*
* @param moduleName
* @param taskId
* @param command
* @param roleId
* @param stageId
* @param data
* @param delay
* @param timeUnit
*/
public void schedule(String moduleName, String taskId, String command, String roleId, String stageId, Object data, long delay, TimeUnit timeUnit);
/**
*
*
* @param moduleName
* @param taskId
*/
public void cancelSchedule(String moduleName, String taskId);
} |
@font-face {
font-family: audiosa;
src: url("../fonts/big_noodle_titling.ttf");
}
@font-face {
font-family: OSB;
src: url("../fonts/OldSansBlack.ttf");
}
@font-face {
font-family: oswald;
src: url("../fonts/Oswald-Regular.ttf");
}
@font-face {
font-family: roboto;
src: url("../fonts/Roboto-Thin.ttf");
}
html {
margin: 0;
border: 0;
padding:0;
width: 100%;
height: 100%;
}
body {
margin: 0;
border: 0;
padding:0;
width: 100%;
height: 100%;
background: url("../img/fond/background.jpg") no-repeat center fixed;
-<API key>: cover; /* pour anciens Chrome et Safari */
background-size: cover;
}
h3 {
font-family: audiosa;
font-size: 32px;
margin: 0;
padding-top: 11px;
letter-spacing: 3px;
color: white;
}
#menu {
float: left;
height: 100%;
width: 22%;
background: #34495e;
}
#menu_content {
height: 35%;
}
#menu_scroll {
overflow: hidden !important;
}
#audiosa_title {
width: 100%;
height: 60px;
/*text-align: center;*/
color: white;
background-color: #e74c3c;
}
#utilisateur {
width: 30%;
text-align: center;
background-color: transparent;
float: right;
min-height: 8%;
}
.icon_navbar{
vertical-align: middle;
margin-right: 3%;
float: right;
width: 33px;
}
#image_utilisateur
{
width:33px;
margin-top: 3px;
}
#icon_logo {
vertical-align: middle;
width: 33px;
}
.<API key> {
width: 33px;
margin-top: 0px;
}
.icon_sidebar_cell {
width: 33px;
margin-top: 4px;
float: left;
}
.cellSideBar
{
font-family: oswald;
font-size: 23px;
height: 43px;
line-height: 43px;
}
.cellSideBar a
{
color: white;
text-decoration: none;
}
.ui-page-theme-b a:visited,
html .ui-bar-b a:visited,
html .ui-body-b a:visited,
html body .ui-group-theme-b a:visited {
color: white/*{b-link-visited}*/;
}
#view_more {
text-align: center;
background: #E74C3C;
height: 3%;
}
#web-player {
position: relative;
width: 100%;
height: 46%;
overflow: hidden;
background-image: url("../img/covers/defaultCover.jpg");
background-repeat: no-repeat;
background-position: center;
background-size: 174%;
-webkit-filter: blur(13px);
-moz-filter: blur(13px);
-o-filter: blur(13px);
-ms-filter: blur(13px);
filter: blur(13px);
background-color: #ccc;
}
#web-player-img {
width: 43%;
margin-left: 28.5%;
margin-top: 14%;
margin-bottom: 14%;
}
#web-player-onblur {
position: absolute;
width: 22%;
height: 54%;
overflow: visible;
}
#web-player-shuffle {
float: left;
width: 23px;
margin-top: 5px;
margin-left: 5%;
}
#web-player-sound {
float: right;
width: 23px;
margin-top: 5px;
margin-right: 5%;
}
#web-player-previous {
float: left;
width: 29px;
margin-top: 5px;
margin-left: 5%;
}
#web-player-play {
width: 29px;
margin-top: 5px;
}
#web-player-next {
float: right;
width: 29px;
margin-top: 5px;
margin-right: 5%;
}
#web-player-cmd {
height: 56.7%;
background-color: #484848;
border-top: 1px solid white;
}
/* Hide the number input */
.full-width-slider input {
display: none;
}
.full-width-slider .ui-slider-track {
margin-left: 15px;
}
.ui-slider-track .ui-btn.ui-slider-handle
{
border-color: transparent;
width: 1px;
margin: -9px 0 0 0px;
height: 15px;
background-color: white;
}
.ui-slider-track {
height: 0px;
background-color: white !important;
border-color: white !important;
}
div.ui-slider {
margin: 0 !important;
}
.player_cmds {
cursor: pointer;
}
#soundcontainer {
width: 100px;
height: 18px;
position: absolute;
float: right;
right: -4%;
margin-top: -6px;
}
#web-player-sound,
#onsound {
position: absolute;
top: 0;
margin-right: 5%;
}
#onsound {
z-index: 10;
/* float: left; */
width: 200px;
/*transform: rotate(-90deg);*/
left: -11px;
top: -87px;
}
#mediaPlayerTitle {
width: 60%;
overflow: hidden;
text-overflow: ellipsis;
float: left;
margin-left: 15%;
height: 24px;
white-space: nowrap;
margin-right: 15%;
} |
<!DOCTYPE html>
<html>
<meta charset="UTF-8">
<head>
<title>Topic 07 -- Abstracts with Biological Entities (English) - 75 Topics / Sub-Topic Model 59 - 15 Topics</title>
<style>
table {
font-family: "Trebuchet MS", Arial, Helvetica, sans-serif;
border-collapse: collapse;
width: 100%;
}
td, th {
border: 1px solid #ddd;
padding: 8px;
}
tr:nth-child(even){background-color: #f2f2f2;}
tr:hover {background-color: #ddd;}
th {
padding-top: 12px;
padding-bottom: 12px;
text-align: left;
background-color: #0099FF;
color: white;
}
</style>
</head>
<body>
<h2>Topic 07 -- Abstracts with Biological Entities (English) - 75 Topics / Sub-Topic Model 59 - 15 Topics</h2>
<table border="1" class="dataframe">
<thead>
<tr style="text-align: right;">
<th></th>
<th>cite ad</th>
<th>title</th>
<th>authors</th>
<th>publish year</th>
<th>publish time</th>
<th>dataset</th>
<th>abstract mentions covid</th>
<th>pmcid</th>
<th>pubmed id</th>
<th>doi</th>
<th>cord uid</th>
<th>topic weight</th>
<th>Similarity scispacy</th>
<th>Similarity specter</th>
</tr>
</thead>
<tbody>
<tr>
<th id="wh708hes";>1</th>
<td>Mocchegiani_2008</td>
<td>Role of Zinc and Selenium in Oxidative Stress and Immunosenescence: Implications for Healthy Ageing and Longevity</td>
<td>Mocchegiani, Eugenio; Malavolta, Marco</td>
<td>2008</td>
<td>2008-08-04</td>
<td>PMC</td>
<td>N</td>
<td><a href="https:
<td></td>
<td><a href="https://doi.org/10.1007/<API key>" target="_blank">10.1007/<API key></a></td>
<td>wh708hes</td>
<td>0.926241</td>
<td></td>
<td></td>
</tr>
<tr>
<th id="qjelz39y";>2</th>
<td>Mocchegiani_2002</td>
<td>Metallothioneins (I+II) and thyroid–thymus axis efficiency in old mice: role of corticosterone and zinc supply</td>
<td>Mocchegiani, Eugenio; Giacconi, Robertina; Cipriano, Catia; Gasparini, Nazzarena; Orlando, Fiorenza; Stecconi, Rosalia; Muzzioli, Mario; Isani, Gloria; Carpenè, Emilio</td>
<td>2002</td>
<td>2002-03-31</td>
<td>PMC</td>
<td>N</td>
<td><a href="https:
<td><a href="https:
<td><a href="https://doi.org/10.1016/s0047-6374(01)00414-6" target="_blank">10.1016/s0047-6374(01)00414-6</a></td>
<td>qjelz39y</td>
<td>0.923612</td>
<td></td>
<td><a href="Topic_07.html#wh708hes">Mocchegiani_2008</a>, <a href="Topic_07.html#qx6fo1x2">Cipriano_2003</a></td>
</tr>
<tr>
<th id="qx6fo1x2";>3</th>
<td>Cipriano_2003</td>
<td>Metallothionein (I+II) confers, via c-myc, immune plasticity in oldest mice: model of partial hepatectomy/liver regeneration</td>
<td>Cipriano, Catia; Giacconi, Robertina; Muzzioli, Mario; Gasparini, Nazzarena; Orlando, Fiorenza; Corradi, Attilio; Cabassi, Enrico; Mocchegiani, Eugenio</td>
<td>2003</td>
<td>2003-09-30</td>
<td>PMC</td>
<td>N</td>
<td><a href="https:
<td><a href="https:
<td><a href="https://doi.org/10.1016/s0047-6374(03)00146-5" target="_blank">10.1016/s0047-6374(03)00146-5</a></td>
<td>qx6fo1x2</td>
<td>0.880694</td>
<td></td>
<td><a href="Topic_07.html#qjelz39y">Mocchegiani_2002</a></td>
</tr>
<tr>
<th id="mu1socpf";>4</th>
<td>Roth_1987</td>
<td>Possible Association of Thymus Dysfunction with Fading Syndromes in Puppies and Kittens</td>
<td>Roth, James A.</td>
<td>1987</td>
<td>1987-05-31</td>
<td>PMC</td>
<td>N</td>
<td><a href="https:
<td><a href="https:
<td><a href="https://doi.org/10.1016/s0195-5616(87)50056-0" target="_blank">10.1016/s0195-5616(87)50056-0</a></td>
<td>mu1socpf</td>
<td>0.841335</td>
<td></td>
<td></td>
</tr>
<tr>
<th id="61seoqpz";>5</th>
<td>Kolb_2002</td>
<td>Engineering Immunity in the Mammary Gland</td>
<td>Kolb, Andreas F.</td>
<td>2002</td>
<td>2002-01-01</td>
<td>PMC</td>
<td>N</td>
<td><a href="https:
<td><a href="https:
<td><a href="https://doi.org/10.1023/a:1020395701887" target="_blank">10.1023/a:1020395701887</a></td>
<td>61seoqpz</td>
<td>0.785097</td>
<td></td>
<td></td>
</tr>
<tr>
<th id="y2uhnlpd";>6</th>
<td>Murdoch_1986</td>
<td>Diarrhoea in the dog and cat I. Acute diarrhoea</td>
<td>Murdoch, D.B.</td>
<td>1986</td>
<td>1986-08-31</td>
<td>PMC</td>
<td>N</td>
<td></td>
<td><a href="https:
<td><a href="https://doi.org/10.1016/0007-1935(86)90026-6" target="_blank">10.1016/0007-1935(86)90026-6</a></td>
<td>y2uhnlpd</td>
<td>0.777236</td>
<td></td>
<td></td>
</tr>
<tr>
<th id="njw3f4zn";>7</th>
<td>Barr_2016</td>
<td>Nutritional management of the foal with diarrhoea</td>
<td>Barr, B.</td>
<td>2016</td>
<td>2016-03-30</td>
<td>PMC</td>
<td>N</td>
<td><a href="https:
<td></td>
<td><a href="https://doi.org/10.1111/eve.12564" target="_blank">10.1111/eve.12564</a></td>
<td>njw3f4zn</td>
<td>0.759343</td>
<td></td>
<td></td>
</tr>
<tr>
<th id="a67st6gy";>8</th>
<td>Kolb_2011</td>
<td>Milk Lacking α-Casein Leads to Permanent Reduction in Body Size in Mice</td>
<td>Kolb, Andreas F.; Huber, Reinhard C.; Lillico, Simon G.; Carlisle, Ailsa; Robinson, Claire J.; Neil, Claire; Petrie, Linda; Sorensen, Dorte B.; Olsson, I. Anna S.; Whitelaw, C. Bruce A.</td>
<td>2011</td>
<td>2011-07-18</td>
<td>COMM-USE</td>
<td>N</td>
<td><a href="https:
<td><a href="https:
<td><a href="https://doi.org/10.1371/journal.pone.0021775" target="_blank">10.1371/journal.pone.0021775</a></td>
<td>a67st6gy</td>
<td>0.757210</td>
<td></td>
<td><a href="Topic_07.html#61seoqpz">Kolb_2002</a>, <a href="Topic_09.html#zsdymkjd">Gruse_2016</a></td>
</tr>
<tr>
<th id="ly4tndpp";>9</th>
<td>Austin_2018</td>
<td>The geometry of dependence: solitary bee larvae prioritize carbohydrate over protein in parentally provided pollen</td>
<td>Alexander J. Austin; James D. J. Gilbert</td>
<td>2018</td>
<td>2018-08-22</td>
<td>BioRxiv</td>
<td>N</td>
<td></td>
<td></td>
<td><a href="https://doi.org/10.1101/397802" target="_blank">10.1101/397802</a></td>
<td>ly4tndpp</td>
<td>0.694702</td>
<td></td>
<td></td>
</tr>
<tr>
<th id="qwhaesfk";>10</th>
<td>Hurley_2011</td>
<td>Perspectives on Immunoglobulins in Colostrum and Milk</td>
<td>Hurley, Walter L.; Theil, Peter K.</td>
<td>2011</td>
<td>2011-04-14</td>
<td>COMM-USE</td>
<td>N</td>
<td><a href="https:
<td><a href="https:
<td><a href="https://doi.org/10.3390/nu3040442" target="_blank">10.3390/nu3040442</a></td>
<td>qwhaesfk</td>
<td>0.645573</td>
<td></td>
<td><a href="Topic_03.html#jvopqecw">Quigley_2001</a></td>
</tr>
<tr>
<th id="3fuow9vn";>11</th>
<td>Stump_2015</td>
<td>Developmental toxicity in rats of a hemoglobin-based oxygen carrier results from impeded function of the inverted visceral yolk sac</td>
<td>Stump, D.G.; Holson, J.F.; Harris, C.; Pearce, L.B.; Watson, R.E.; DeSesso, J.M.</td>
<td>2015</td>
<td>2015-04-30</td>
<td>PMC</td>
<td>N</td>
<td><a href="https:
<td><a href="https:
<td><a href="https://doi.org/10.1016/j.reprotox.2015.01.005" target="_blank">10.1016/j.reprotox.2015.01.005</a></td>
<td>3fuow9vn</td>
<td>0.597018</td>
<td></td>
<td><a href="Topic_09.html#zsdymkjd">Gruse_2016</a></td>
</tr>
<tr>
<th id="4scgm53y";>12</th>
<td>Mila_2016</td>
<td>Natural and artificial hyperimmune solutions: Impact on health in puppies</td>
<td>Mila, H; Grellet, A; Mariani, C; Feugier, A; Guard, B; Suchodolski, J; Steiner, J; Chastant‐Maillard, S</td>
<td>2016</td>
<td>2016-11-15</td>
<td>PMC</td>
<td>N</td>
<td><a href="https:
<td><a href="https:
<td><a href="https://doi.org/10.1111/rda.12824" target="_blank">10.1111/rda.12824</a></td>
<td>4scgm53y</td>
<td>0.580941</td>
<td><a href="Topic_15.html#6uzt6hbh">Erickson_2020</a></td>
<td></td>
</tr>
<tr>
<th id="yva87e77";>13</th>
<td>Seegraber_1982</td>
<td>Effect of Soy Protein on Calves’ Intestinal Absorptive Ability and Morphology Determined by Scanning Electron Microscopy</td>
<td>Seegraber, F.J.; Morrill, J.L.</td>
<td>1982</td>
<td>1982-10-31</td>
<td>PMC</td>
<td>N</td>
<td><a href="https:
<td><a href="https:
<td><a href="https://doi.org/10.3168/jds.s0022-0302(82)82445-4" target="_blank">10.3168/jds.s0022-0302(82)82445-4</a></td>
<td>yva87e77</td>
<td>0.558507</td>
<td><a href="Topic_02.html#z3v7qoc6">Kuehn_1994</a>, <a href="Topic_02.html#waacoaeq">Eppard_1982</a>, <a href="Topic_03.html#3aijkdrj">Dezfouli_2006</a>, <a href="Topic_03.html#u23cjmwf">Franklin_2003</a>, <a href="Topic_07.html#o4c2i1q1">Seegraber_1986</a></td>
<td><a href="Topic_09.html#zsdymkjd">Gruse_2016</a>, <a href="Topic_07.html#o4c2i1q1">Seegraber_1986</a>, <a href="Topic_03.html#gzvfn4k0">Davenport_2000</a></td>
</tr>
<tr>
<th id="fwtymzo1";>14</th>
<td>Kegley_2016</td>
<td>BILL E. KUNKLE INTERDISCIPLINARY BEEF SYMPOSIUM: Impact of mineral and vitamin status on beef cattle immune function and health(,)</td>
<td>Kegley, E. B.; Ball, J. J.; Beck, P. A.</td>
<td>2016</td>
<td>2016-12-23</td>
<td>PMC</td>
<td>N</td>
<td><a href="https:
<td><a href="https:
<td><a href="https://doi.org/10.2527/jas.2016-0720" target="_blank">10.2527/jas.2016-0720</a></td>
<td>fwtymzo1</td>
<td>0.554284</td>
<td></td>
<td><a href="Topic_09.html#zsdymkjd">Gruse_2016</a>, <a href="Topic_03.html#g9fn8j0l">Wallace_2017</a>, <a href="Topic_01.html#p45x2kdl"><API key></a></td>
</tr>
<tr>
<th id="o4c2i1q1";>15</th>
<td>Seegraber_1986</td>
<td>Effect of Protein Source in Calf Milk Replacers on Morphology and Absorptive Ability of Small Intestine 1</td>
<td>Seegraber, F.J.; Morrill, J.L.</td>
<td>1986</td>
<td>1986-02-28</td>
<td>PMC</td>
<td>N</td>
<td><a href="https:
<td><a href="https:
<td><a href="https://doi.org/10.3168/jds.s0022-0302(86)80424-6" target="_blank">10.3168/jds.s0022-0302(86)80424-6</a></td>
<td>o4c2i1q1</td>
<td>0.553117</td>
<td><a href="Topic_02.html#z3v7qoc6">Kuehn_1994</a>, <a href="Topic_02.html#waacoaeq">Eppard_1982</a>, <a href="Topic_09.html#r623k00d">Medinsky_1982</a>, <a href="Topic_03.html#u23cjmwf">Franklin_2003</a></td>
<td><a href="Topic_03.html#gzvfn4k0">Davenport_2000</a>, <a href="Topic_07.html#yva87e77">Seegraber_1982</a>, <a href="Topic_09.html#zsdymkjd">Gruse_2016</a>, <a href="Topic_03.html#jvopqecw">Quigley_2001</a></td>
</tr>
<tr>
<th id="fl8fm8pp";>16</th>
<td>Weidemann_2015</td>
<td>Dietary Sodium Suppresses Digestive Efficiency via the Renin-Angiotensin System</td>
<td>Weidemann, Benjamin J.; Voong, Susan; Morales-Santiago, Fabiola I.; Kahn, Michael Z.; Ni, Jonathan; Littlejohn, Nicole K.; Claflin, Kristin E.; Burnett, Colin M.L.; Pearson, Nicole A.; Lutter, Michael L.; Grobe, Justin L.</td>
<td>2015</td>
<td>2015-06-11</td>
<td>COMM-USE</td>
<td>N</td>
<td><a href="https:
<td><a href="https:
<td><a href="https://doi.org/10.1038/srep11123" target="_blank">10.1038/srep11123</a></td>
<td>fl8fm8pp</td>
<td>0.552964</td>
<td><a href="Topic_09.html#r623k00d">Medinsky_1982</a></td>
<td><a href="Topic_09.html#zsdymkjd">Gruse_2016</a></td>
</tr>
<tr>
<th id="zmeu66h1";>17</th>
<td>Kroll_2020</td>
<td>Active fractions of mannoproteins derived from yeast cell wall stimulate innate and acquired immunity of adult and elderly dogs</td>
<td>Kroll, F.S.A.; Putarov, T.C.; Zaine, L.; Venturini, K.S.; Aoki, C.G.; Santos, J.P.F.; Pedrinelli, V.; Vendramini, T.H.A.; Brunetto, M.A.; Carciofi, A.C.</td>
<td>2020</td>
<td>2020-03-31</td>
<td>PMC</td>
<td>N</td>
<td><a href="https:
<td></td>
<td><a href="https://doi.org/10.1016/j.anifeedsci.2020.114392" target="_blank">10.1016/j.anifeedsci.2020.114392</a></td>
<td>zmeu66h1</td>
<td>0.455242</td>
<td></td>
<td></td>
</tr>
<tr>
<th id="yicl8711";>18</th>
<td>Chai_2014</td>
<td>High-dose dietary zinc oxide mitigates infection with transmissible gastroenteritis virus in piglets</td>
<td>Chai, Weidong; Zakrzewski, Silke S; Günzel, Dorothee; Pieper, Robert; Wang, Zhenya; Twardziok, Sven; Janczyk, Pawel; Osterrieder, Nikolaus; Burwinkel, Michael</td>
<td>2014</td>
<td>2014-03-28</td>
<td>COMM-USE</td>
<td>N</td>
<td><a href="https:
<td><a href="https:
<td><a href="https://doi.org/10.1186/1746-6148-10-75" target="_blank">10.1186/1746-6148-10-75</a></td>
<td>yicl8711</td>
<td>0.370909</td>
<td></td>
<td><a href="Topic_01.html#tsfxpaj6">Chai_2014</a></td>
</tr>
<tr>
<th id="7q7q8ssd";>19</th>
<td>Sabikhi_2007</td>
<td>Designer Milk</td>
<td>Sabikhi, Latha</td>
<td>2007</td>
<td>2007-12-31</td>
<td>PMC</td>
<td>N</td>
<td><a href="https:
<td><a href="https:
<td><a href="https://doi.org/10.1016/s1043-4526(07)53005-6" target="_blank">10.1016/s1043-4526(07)53005-6</a></td>
<td>7q7q8ssd</td>
<td>0.359415</td>
<td></td>
<td><a href="Topic_09.html#zsdymkjd">Gruse_2016</a>, <a href="Topic_07.html#61seoqpz">Kolb_2002</a>, <a href="Topic_07.html#a67st6gy">Kolb_2011</a></td>
</tr>
<tr>
<th id="tsfxpaj6";>20</th>
<td>Chai_2014</td>
<td>Elevated dietary zinc oxide levels do not have a substantial effect on porcine reproductive and respiratory syndrome virus (PPRSV) vaccination and infection</td>
<td>Chai, Weidong; Wang, Zhenya; Janczyk, Pawel; Twardziok, Sven; Blohm, Ulrike; Osterrieder, Nikolaus; Burwinkel, Michael</td>
<td>2014</td>
<td>2014-08-08</td>
<td>COMM-USE</td>
<td>N</td>
<td><a href="https:
<td><a href="https:
<td><a href="https://doi.org/10.1186/1743-422x-11-140" target="_blank">10.1186/1743-422x-11-140</a></td>
<td>tsfxpaj6</td>
<td>0.310978</td>
<td></td>
<td><a href="Topic_01.html#yicl8711">Chai_2014</a></td>
</tr>
</tbody>
</table>
</body>
</html> |
require 'test/unit'
require 'command_util'
class CommandTest < Test::Unit::TestCase
def test_run_command
StratosUtil.run_command('echo hello')
end
def <API key>
assert_raise RuntimeError do
StratosUtil.run_command('/bin/bash -c "exit 1"')
end
end
end |
<!DOCTYPE HTML PUBLIC "-
<!-- NewPage -->
<html lang="en">
<head>
<!-- Generated by javadoc (version 1.7.0_65) on Wed Nov 12 13:03:04 UTC 2014 -->
<meta http-equiv="Content-Type" content="text/html" charset="UTF-8">
<title>Uses of Interface com.hazelcast.cluster.JoinOperation (Hazelcast Root 3.3.3 API)</title>
<meta name="date" content="2014-11-12">
<link rel="stylesheet" type="text/css" href="../../../../stylesheet.css" title="Style">
</head>
<body>
<script type="text/javascript"><!
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="Uses of Interface com.hazelcast.cluster.JoinOperation (Hazelcast Root 3.3.3 API)";
}
</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
<div class="topNav"><a name="navbar_top">
</a><a href="#skip-navbar_top" title="Skip navigation links"></a><a name="navbar_top_firstrow">
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../overview-summary.html">Overview</a></li>
<li><a href="../package-summary.html">Package</a></li>
<li><a href="../../../../com/hazelcast/cluster/JoinOperation.html" title="interface in com.hazelcast.cluster">Class</a></li>
<li class="navBarCell1Rev">Use</li>
<li><a href="../package-tree.html">Tree</a></li>
<li><a href="../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../index-all.html">Index</a></li>
<li><a href="../../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li>Prev</li>
<li>Next</li>
</ul>
<ul class="navList">
<li><a href="../../../../index.html?com/hazelcast/cluster/class-use/JoinOperation.html" target="_top">Frames</a></li>
<li><a href="JoinOperation.html" target="_top">No Frames</a></li>
</ul>
<ul class="navList" id="<API key>">
<li><a href="../../../../allclasses-noframe.html">All Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!
allClassesLink = document.getElementById("<API key>");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
</script>
</div>
<a name="skip-navbar_top">
</a></div>
<div class="header">
<h2 title="Uses of Interface com.hazelcast.cluster.JoinOperation" class="title">Uses of Interface<br>com.hazelcast.cluster.JoinOperation</h2>
</div>
<div class="classUseContainer">
<ul class="blockList">
<li class="blockList">
<table border="0" cellpadding="3" cellspacing="0" summary="Use table, listing packages, and an explanation">
<caption><span>Packages that use <a href="../../../../com/hazelcast/cluster/JoinOperation.html" title="interface in com.hazelcast.cluster">JoinOperation</a></span><span class="tabEnd"> </span></caption>
<tr>
<th class="colFirst" scope="col">Package</th>
<th class="colLast" scope="col">Description</th>
</tr>
<tbody>
<tr class="altColor">
<td class="colFirst"><a href="#com.hazelcast.cluster">com.hazelcast.cluster</a></td>
<td class="colLast">
<div class="block">This package contains the cluster functionality.<br/></div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><a href="#com.hazelcast.partition.impl">com.hazelcast.partition.impl</a></td>
<td class="colLast">
<div class="block">Contains the actual implementation of the <a href="../../../../com/hazelcast/partition/<API key>.html" title="interface in com.hazelcast.partition"><code><API key></code></a>.</div>
</td>
</tr>
</tbody>
</table>
</li>
<li class="blockList">
<ul class="blockList">
<li class="blockList"><a name="com.hazelcast.cluster">
</a>
<h3>Uses of <a href="../../../../com/hazelcast/cluster/JoinOperation.html" title="interface in com.hazelcast.cluster">JoinOperation</a> in <a href="../../../../com/hazelcast/cluster/package-summary.html">com.hazelcast.cluster</a></h3>
<table border="0" cellpadding="3" cellspacing="0" summary="Use table, listing classes, and an explanation">
<caption><span>Classes in <a href="../../../../com/hazelcast/cluster/package-summary.html">com.hazelcast.cluster</a> that implement <a href="../../../../com/hazelcast/cluster/JoinOperation.html" title="interface in com.hazelcast.cluster">JoinOperation</a></span><span class="tabEnd"> </span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Class and Description</th>
</tr>
<tbody>
<tr class="altColor">
<td class="colFirst"><code>class </code></td>
<td class="colLast"><code><strong><a href="../../../../com/hazelcast/cluster/<API key>.html" title="class in com.hazelcast.cluster"><API key></a></strong></code> </td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>class </code></td>
<td class="colLast"><code><strong><a href="../../../../com/hazelcast/cluster/<API key>.html" title="class in com.hazelcast.cluster"><API key></a></strong></code> </td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>class </code></td>
<td class="colLast"><code><strong><a href="../../../../com/hazelcast/cluster/BindOperation.html" title="class in com.hazelcast.cluster">BindOperation</a></strong></code> </td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>class </code></td>
<td class="colLast"><code><strong><a href="../../../../com/hazelcast/cluster/<API key>.html" title="class in com.hazelcast.cluster"><API key></a></strong></code>
<div class="block">When a node wants to join the cluster, its sends its ConfigCheck to the cluster where it is validated.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>class </code></td>
<td class="colLast"><code><strong><a href="../../../../com/hazelcast/cluster/<API key>.html" title="class in com.hazelcast.cluster"><API key></a></strong></code> </td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>class </code></td>
<td class="colLast"><code><strong><a href="../../../../com/hazelcast/cluster/<API key>.html" title="class in com.hazelcast.cluster"><API key></a></strong></code> </td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>class </code></td>
<td class="colLast"><code><strong><a href="../../../../com/hazelcast/cluster/HeartbeatOperation.html" title="class in com.hazelcast.cluster">HeartbeatOperation</a></strong></code> </td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>class </code></td>
<td class="colLast"><code><strong><a href="../../../../com/hazelcast/cluster/JoinCheckOperation.html" title="class in com.hazelcast.cluster">JoinCheckOperation</a></strong></code> </td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>class </code></td>
<td class="colLast"><code><strong><a href="../../../../com/hazelcast/cluster/<API key>.html" title="class in com.hazelcast.cluster"><API key></a></strong></code> </td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>class </code></td>
<td class="colLast"><code><strong><a href="../../../../com/hazelcast/cluster/<API key>.html" title="class in com.hazelcast.cluster"><API key></a></strong></code> </td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>class </code></td>
<td class="colLast"><code><strong><a href="../../../../com/hazelcast/cluster/<API key>.html" title="class in com.hazelcast.cluster"><API key></a></strong></code> </td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>class </code></td>
<td class="colLast"><code><strong><a href="../../../../com/hazelcast/cluster/<API key>.html" title="class in com.hazelcast.cluster"><API key></a></strong></code> </td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>class </code></td>
<td class="colLast"><code><strong><a href="../../../../com/hazelcast/cluster/<API key>.html" title="class in com.hazelcast.cluster"><API key></a></strong></code> </td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>class </code></td>
<td class="colLast"><code><strong><a href="../../../../com/hazelcast/cluster/<API key>.html" title="class in com.hazelcast.cluster"><API key></a></strong></code> </td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>class </code></td>
<td class="colLast"><code><strong><a href="../../../../com/hazelcast/cluster/<API key>.html" title="class in com.hazelcast.cluster"><API key></a></strong></code> </td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>class </code></td>
<td class="colLast"><code><strong><a href="../../../../com/hazelcast/cluster/<API key>.html" title="class in com.hazelcast.cluster"><API key></a></strong></code> </td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>class </code></td>
<td class="colLast"><code><strong><a href="../../../../com/hazelcast/cluster/PostJoinOperation.html" title="class in com.hazelcast.cluster">PostJoinOperation</a></strong></code> </td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>class </code></td>
<td class="colLast"><code><strong><a href="../../../../com/hazelcast/cluster/<API key>.html" title="class in com.hazelcast.cluster"><API key></a></strong></code> </td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>class </code></td>
<td class="colLast"><code><strong><a href="../../../../com/hazelcast/cluster/SetMasterOperation.html" title="class in com.hazelcast.cluster">SetMasterOperation</a></strong></code> </td>
</tr>
</tbody>
</table>
</li>
<li class="blockList"><a name="com.hazelcast.partition.impl">
</a>
<h3>Uses of <a href="../../../../com/hazelcast/cluster/JoinOperation.html" title="interface in com.hazelcast.cluster">JoinOperation</a> in <a href="../../../../com/hazelcast/partition/impl/package-summary.html">com.hazelcast.partition.impl</a></h3>
<table border="0" cellpadding="3" cellspacing="0" summary="Use table, listing classes, and an explanation">
<caption><span>Classes in <a href="../../../../com/hazelcast/partition/impl/package-summary.html">com.hazelcast.partition.impl</a> that implement <a href="../../../../com/hazelcast/cluster/JoinOperation.html" title="interface in com.hazelcast.cluster">JoinOperation</a></span><span class="tabEnd"> </span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Class and Description</th>
</tr>
<tbody>
<tr class="altColor">
<td class="colFirst"><code>class </code></td>
<td class="colLast"><code><strong><a href="../../../../com/hazelcast/partition/impl/<API key>.html" title="class in com.hazelcast.partition.impl"><API key></a></strong></code> </td>
</tr>
</tbody>
</table>
</li>
</ul>
</li>
</ul>
</div>
<div class="bottomNav"><a name="navbar_bottom">
</a><a href="#skip-navbar_bottom" title="Skip navigation links"></a><a name="<API key>">
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../overview-summary.html">Overview</a></li>
<li><a href="../package-summary.html">Package</a></li>
<li><a href="../../../../com/hazelcast/cluster/JoinOperation.html" title="interface in com.hazelcast.cluster">Class</a></li>
<li class="navBarCell1Rev">Use</li>
<li><a href="../package-tree.html">Tree</a></li>
<li><a href="../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../index-all.html">Index</a></li>
<li><a href="../../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li>Prev</li>
<li>Next</li>
</ul>
<ul class="navList">
<li><a href="../../../../index.html?com/hazelcast/cluster/class-use/JoinOperation.html" target="_top">Frames</a></li>
<li><a href="JoinOperation.html" target="_top">No Frames</a></li>
</ul>
<ul class="navList" id="<API key>">
<li><a href="../../../../allclasses-noframe.html">All Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!
allClassesLink = document.getElementById("<API key>");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
</script>
</div>
<a name="skip-navbar_bottom">
</a></div>
<p class="legalCopy"><small>Copyright &
</body>
</html> |
package org.xbib.content.io;
import java.io.IOException;
import java.io.InputStream;
public class BytesStreamInput extends InputStream {
private byte[] buf;
private int pos;
private int count;
public BytesStreamInput(byte[] buf) {
this(buf, 0, buf.length);
}
public BytesStreamInput(byte[] buf, int offset, int length) {
this.buf = buf;
this.pos = offset;
this.count = Math.min(offset + length, buf.length);
}
@Override
public long skip(long n) throws IOException {
long res = n;
if (pos + res > count) {
res = (long) count - pos;
}
if (res < 0) {
return 0;
}
pos += res;
return res;
}
@Override
public int read() throws IOException {
return pos < count ? buf[pos++] & 0xff : -1;
}
@Override
public int read(byte[] b, int off, int len) throws IOException {
if (off < 0 || len < 0 || len > b.length - off) {
throw new <API key>();
}
if (pos >= count) {
return -1;
}
int l = len;
if (pos + l > count) {
l = count - pos;
}
if (l <= 0) {
return 0;
}
System.arraycopy(buf, pos, b, off, l);
pos += l;
return l;
}
@Override
public void reset() throws IOException {
pos = 0;
}
@Override
public void close() throws IOException {
// nothing to do
}
} |
<!DOCTYPE HTML PUBLIC "-
<!-- NewPage -->
<html lang="en">
<head>
<!-- Generated by javadoc (1.8.0_121) on Mon Mar 06 15:09:37 PST 2017 -->
<title>com.github.jessemull.microflex.bigintegerflex.math</title>
<meta name="date" content="2017-03-06">
<link rel="stylesheet" type="text/css" href="../../../../../../stylesheet.css" title="Style">
<script type="text/javascript" src="../../../../../../script.js"></script>
</head>
<body>
<script type="text/javascript"><!
try {
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="com.github.jessemull.microflex.bigintegerflex.math";
}
}
catch(err) {
}
</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
<div class="topNav"><a name="navbar.top">
</a>
<div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div>
<a name="navbar.top.firstrow">
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../../../overview-summary.html">Overview</a></li>
<li class="navBarCell1Rev">Package</li>
<li>Class</li>
<li><a href="package-use.html">Use</a></li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../../../index-files/index-1.html">Index</a></li>
<li><a href="../../../../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li><a href="../../../../../../com/github/jessemull/microflex/bigintegerflex/io/package-summary.html">Prev Package</a></li>
<li><a href="../../../../../../com/github/jessemull/microflex/bigintegerflex/plate/package-summary.html">Next Package</a></li>
</ul>
<ul class="navList">
<li><a href="../../../../../../index.html?com/github/jessemull/microflex/bigintegerflex/math/package-summary.html" target="_top">Frames</a></li>
<li><a href="package-summary.html" target="_top">No Frames</a></li>
</ul>
<ul class="navList" id="<API key>">
<li><a href="../../../../../../allclasses-noframe.html">All Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!
allClassesLink = document.getElementById("<API key>");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
</script>
</div>
<a name="skip.navbar.top">
</a></div>
<div class="header">
<h1 title="Package" class="title">Package com.github.jessemull.microflex.bigintegerflex.math</h1>
</div>
<div class="contentContainer">
<ul class="blockList">
<li class="blockList">
<table class="typeSummary" border="0" cellpadding="3" cellspacing="0" summary="Class Summary table, listing classes, and an explanation">
<caption><span>Class Summary</span><span class="tabEnd"> </span></caption>
<tr>
<th class="colFirst" scope="col">Class</th>
<th class="colLast" scope="col">Description</th>
</tr>
<tbody>
<tr class="altColor">
<td class="colFirst"><a href="../../../../../../com/github/jessemull/microflex/bigintegerflex/math/AdditionBigInteger.html" title="class in com.github.jessemull.microflex.bigintegerflex.math">AdditionBigInteger</a></td>
<td class="colLast">
<div class="block">This class performs addition operations with two arguments for BigInteger
plate stacks, plates, wells and well sets.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><a href="../../../../../../com/github/jessemull/microflex/bigintegerflex/math/ANDBigInteger.html" title="class in com.github.jessemull.microflex.bigintegerflex.math">ANDBigInteger</a></td>
<td class="colLast">
<div class="block">This class performs logical AND operations with two arguments for BigInteger
plate stacks, plates, wells and well sets.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><a href="../../../../../../com/github/jessemull/microflex/bigintegerflex/math/<API key>.html" title="class in com.github.jessemull.microflex.bigintegerflex.math"><API key></a></td>
<td class="colLast">
<div class="block">This class performs compliment operations with a single argument for BigInteger
plate stacks, plates, wells and well sets.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><a href="../../../../../../com/github/jessemull/microflex/bigintegerflex/math/DecrementBigInteger.html" title="class in com.github.jessemull.microflex.bigintegerflex.math">DecrementBigInteger</a></td>
<td class="colLast">
<div class="block">This class performs decrement operations with a single argument for BigInteger
plate stacks, plates, wells and well sets.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><a href="../../../../../../com/github/jessemull/microflex/bigintegerflex/math/DivisionBigInteger.html" title="class in com.github.jessemull.microflex.bigintegerflex.math">DivisionBigInteger</a></td>
<td class="colLast">
<div class="block">This class performs division operations with two arguments for BigInteger
plate stacks, plates, wells and well sets.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><a href="../../../../../../com/github/jessemull/microflex/bigintegerflex/math/IncrementBigInteger.html" title="class in com.github.jessemull.microflex.bigintegerflex.math">IncrementBigInteger</a></td>
<td class="colLast">
<div class="block">This class performs increment operations with a single argument for BigInteger
plate stacks, plates, wells and well sets.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><a href="../../../../../../com/github/jessemull/microflex/bigintegerflex/math/LeftShiftBigInteger.html" title="class in com.github.jessemull.microflex.bigintegerflex.math">LeftShiftBigInteger</a></td>
<td class="colLast">
<div class="block">This class performs a left shift operations for BigInteger plate stacks, plates,
wells and well sets.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><a href="../../../../../../com/github/jessemull/microflex/bigintegerflex/math/<API key>.html" title="class in com.github.jessemull.microflex.bigintegerflex.math"><API key></a></td>
<td class="colLast">
<div class="block">This class performs mathematical operations with two arguments for BigInteger
plate stacks, plates, wells and well sets.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><a href="../../../../../../com/github/jessemull/microflex/bigintegerflex/math/<API key>.html" title="class in com.github.jessemull.microflex.bigintegerflex.math"><API key></a></td>
<td class="colLast">
<div class="block">This class performs mathematical shift operations for BigInteger plate stacks,
plates, wells and well sets.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><a href="../../../../../../com/github/jessemull/microflex/bigintegerflex/math/<API key>.html" title="class in com.github.jessemull.microflex.bigintegerflex.math"><API key></a></td>
<td class="colLast">
<div class="block">This class performs mathematical operations with a single argument for BigInteger
plate stacks, plates, wells and well sets.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><a href="../../../../../../com/github/jessemull/microflex/bigintegerflex/math/ModulusBigInteger.html" title="class in com.github.jessemull.microflex.bigintegerflex.math">ModulusBigInteger</a></td>
<td class="colLast">
<div class="block">This class performs modulus operations with two arguments for BigInteger
plate stacks, plates, wells and well sets.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><a href="../../../../../../com/github/jessemull/microflex/bigintegerflex/math/<API key>.html" title="class in com.github.jessemull.microflex.bigintegerflex.math"><API key></a></td>
<td class="colLast">
<div class="block">This class performs multiplication operations with two arguments for BigInteger
plate stacks, plates, wells and well sets.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><a href="../../../../../../com/github/jessemull/microflex/bigintegerflex/math/ORBigInteger.html" title="class in com.github.jessemull.microflex.bigintegerflex.math">ORBigInteger</a></td>
<td class="colLast">
<div class="block">This class performs logical OR operations with two arguments for BigInteger
plate stacks, plates, wells and well sets.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><a href="../../../../../../com/github/jessemull/microflex/bigintegerflex/math/<API key>.html" title="class in com.github.jessemull.microflex.bigintegerflex.math"><API key></a></td>
<td class="colLast">
<div class="block">This class performs a right unsigned/arithmetic shift operations for BigInteger
plate stacks, plates, wells and well sets.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><a href="../../../../../../com/github/jessemull/microflex/bigintegerflex/math/<API key>.html" title="class in com.github.jessemull.microflex.bigintegerflex.math"><API key></a></td>
<td class="colLast">
<div class="block">This class performs subtraction operations with two arguments for BigInteger
plate stacks, plates, wells and well sets.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><a href="../../../../../../com/github/jessemull/microflex/bigintegerflex/math/XORBigInteger.html" title="class in com.github.jessemull.microflex.bigintegerflex.math">XORBigInteger</a></td>
<td class="colLast">
<div class="block">This class performs logical XOR operations with two arguments for BigInteger
plate stacks, plates, wells and well sets.</div>
</td>
</tr>
</tbody>
</table>
</li>
</ul>
</div>
<div class="bottomNav"><a name="navbar.bottom">
</a>
<div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div>
<a name="navbar.bottom.firstrow">
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../../../overview-summary.html">Overview</a></li>
<li class="navBarCell1Rev">Package</li>
<li>Class</li>
<li><a href="package-use.html">Use</a></li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../../../index-files/index-1.html">Index</a></li>
<li><a href="../../../../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li><a href="../../../../../../com/github/jessemull/microflex/bigintegerflex/io/package-summary.html">Prev Package</a></li>
<li><a href="../../../../../../com/github/jessemull/microflex/bigintegerflex/plate/package-summary.html">Next Package</a></li>
</ul>
<ul class="navList">
<li><a href="../../../../../../index.html?com/github/jessemull/microflex/bigintegerflex/math/package-summary.html" target="_top">Frames</a></li>
<li><a href="package-summary.html" target="_top">No Frames</a></li>
</ul>
<ul class="navList" id="<API key>">
<li><a href="../../../../../../allclasses-noframe.html">All Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!
allClassesLink = document.getElementById("<API key>");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
</script>
</div>
<a name="skip.navbar.bottom">
</a></div>
</body>
</html> |
# AUTOGENERATED FILE
FROM balenalib/<API key>:sid-run
ENV NODE_VERSION 14.15.4
ENV YARN_VERSION 1.22.4
RUN buildDeps='curl libatomic1' \
&& set -x \
&& for key in \
<API key> \
; do \
gpg --batch --keyserver pgp.mit.edu --recv-keys "$key" || \
gpg --batch --keyserver keyserver.pgp.com --recv-keys "$key" || \
gpg --batch --keyserver ha.pool.sks-keyservers.net --recv-keys "$key" ; \
done \
&& apt-get update && apt-get install -y $buildDeps --<API key> \ |
package org.drools.compiler.compiler;
import org.kie.internal.builder.KnowledgeBuilder;
import org.kie.internal.utils.ServiceRegistryImpl;
public class <API key> {
private static final String PROVIDER_CLASS = "org.jbpm.process.builder.<API key>";
private static <API key> provider;
public static ProcessBuilder newProcessBuilder(KnowledgeBuilder kBuilder) {
return <API key>().newProcessBuilder(kBuilder);
}
public static synchronized void <API key>(<API key> provider) {
<API key>.provider = provider;
}
public static synchronized <API key> <API key>() {
if (provider == null) {
loadProvider();
}
return provider;
}
private static void loadProvider() {
ServiceRegistryImpl.getInstance().addDefault( <API key>.class, PROVIDER_CLASS );
<API key>(ServiceRegistryImpl.getInstance().get( <API key>.class ) );
}
public static synchronized void loadProvider(ClassLoader cl) {
if (provider == null) {
try {
provider = (<API key>)Class.forName(PROVIDER_CLASS, true, cl).newInstance();
} catch (Exception e) { }
}
}
} |
package net.toolab.query.sql;
import java.io.Serializable;
import net.toolab.query.Operand;
import net.toolab.query.QueryUnitBuilder;
public class SqlQueryUnitBuilder extends QueryUnitBuilder {
private SqlQuerySetBuilder builder;
public SqlQueryUnitBuilder(Serializable key, SqlQuerySetBuilder builder) {
super(key);
this.builder = builder;
}
public SqlQuerySetBuilder is(Object value) {
setter(Operand.is, value);
return builder;
}
public SqlQuerySetBuilder not(Object value) {
setter(Operand.not, value);
return builder;
}
public SqlQuerySetBuilder gt(Object value) {
setter(Operand.gt, value);
return builder;
}
public SqlQuerySetBuilder ge(Object value) {
setter(Operand.ge, value);
return builder;
}
public SqlQuerySetBuilder lt(Object value) {
setter(Operand.lt, value);
return builder;
}
public SqlQuerySetBuilder le(Object value) {
setter(Operand.le, value);
return builder;
}
} |
using System;
using System.Linq;
using System.IO;
using System.Text;
using System.Text.RegularExpressions;
using System.Collections;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Runtime.Serialization;
using Newtonsoft.Json;
using Newtonsoft.Json.Converters;
using System.ComponentModel.DataAnnotations;
using <API key> = com.ultracart.admin.v2.Client.<API key>;
namespace com.ultracart.admin.v2.Model
{
<summary>
<API key>
</summary>
[DataContract]
public partial class <API key> : IEquatable<<API key>>, IValidatableObject
{
<summary>
Initializes a new instance of the <see cref="<API key>" /> class.
</summary>
<param name="paypalButtonAltText">PayPal button alt text.</param>
<param name="paypalButtonUrl">PayPal button URL.</param>
<param name="<API key>">PayPal Credit button URL.</param>
<param name="<API key>">PayPal Credit legal image URL.</param>
<param name="<API key>">PayPal Credit legal URL.</param>
public <API key>(string paypalButtonAltText = default(string), string paypalButtonUrl = default(string), string <API key> = default(string), string <API key> = default(string), string <API key> = default(string))
{
this.PaypalButtonAltText = paypalButtonAltText;
this.PaypalButtonUrl = paypalButtonUrl;
this.<API key> = <API key>;
this.<API key> = <API key>;
this.<API key> = <API key>;
}
<summary>
PayPal button alt text
</summary>
<value>PayPal button alt text</value>
[DataMember(Name="<API key>", EmitDefaultValue=false)]
public string PaypalButtonAltText { get; set; }
<summary>
PayPal button URL
</summary>
<value>PayPal button URL</value>
[DataMember(Name="paypal_button_url", EmitDefaultValue=false)]
public string PaypalButtonUrl { get; set; }
<summary>
PayPal Credit button URL
</summary>
<value>PayPal Credit button URL</value>
[DataMember(Name="<API key>", EmitDefaultValue=false)]
public string <API key> { get; set; }
<summary>
PayPal Credit legal image URL
</summary>
<value>PayPal Credit legal image URL</value>
[DataMember(Name="<API key>", EmitDefaultValue=false)]
public string <API key> { get; set; }
<summary>
PayPal Credit legal URL
</summary>
<value>PayPal Credit legal URL</value>
[DataMember(Name="<API key>", EmitDefaultValue=false)]
public string <API key> { get; set; }
<summary>
Returns the string presentation of the object
</summary>
<returns>String presentation of the object</returns>
public override string ToString()
{
var sb = new StringBuilder();
sb.Append("class <API key> {\n");
sb.Append(" PaypalButtonAltText: ").Append(PaypalButtonAltText).Append("\n");
sb.Append(" PaypalButtonUrl: ").Append(PaypalButtonUrl).Append("\n");
sb.Append(" <API key>: ").Append(<API key>).Append("\n");
sb.Append(" <API key>: ").Append(<API key>).Append("\n");
sb.Append(" <API key>: ").Append(<API key>).Append("\n");
sb.Append("}\n");
return sb.ToString();
}
<summary>
Returns the JSON string presentation of the object
</summary>
<returns>JSON string presentation of the object</returns>
public virtual string ToJson()
{
return JsonConvert.SerializeObject(this, Formatting.Indented);
}
<summary>
Returns true if objects are equal
</summary>
<param name="input">Object to be compared</param>
<returns>Boolean</returns>
public override bool Equals(object input)
{
return this.Equals(input as <API key>);
}
<summary>
Returns true if <API key> instances are equal
</summary>
<param name="input">Instance of <API key> to be compared</param>
<returns>Boolean</returns>
public bool Equals(<API key> input)
{
if (input == null)
return false;
return
(
this.PaypalButtonAltText == input.PaypalButtonAltText ||
(this.PaypalButtonAltText != null &&
this.PaypalButtonAltText.Equals(input.PaypalButtonAltText))
) &&
(
this.PaypalButtonUrl == input.PaypalButtonUrl ||
(this.PaypalButtonUrl != null &&
this.PaypalButtonUrl.Equals(input.PaypalButtonUrl))
) &&
(
this.<API key> == input.<API key> ||
(this.<API key> != null &&
this.<API key>.Equals(input.<API key>))
) &&
(
this.<API key> == input.<API key> ||
(this.<API key> != null &&
this.<API key>.Equals(input.<API key>))
) &&
(
this.<API key> == input.<API key> ||
(this.<API key> != null &&
this.<API key>.Equals(input.<API key>))
);
}
<summary>
Gets the hash code
</summary>
<returns>Hash code</returns>
public override int GetHashCode()
{
unchecked // Overflow is fine, just wrap
{
int hashCode = 41;
if (this.PaypalButtonAltText != null)
hashCode = hashCode * 59 + this.PaypalButtonAltText.GetHashCode();
if (this.PaypalButtonUrl != null)
hashCode = hashCode * 59 + this.PaypalButtonUrl.GetHashCode();
if (this.<API key> != null)
hashCode = hashCode * 59 + this.<API key>.GetHashCode();
if (this.<API key> != null)
hashCode = hashCode * 59 + this.<API key>.GetHashCode();
if (this.<API key> != null)
hashCode = hashCode * 59 + this.<API key>.GetHashCode();
return hashCode;
}
}
<summary>
To validate all properties of the instance
</summary>
<param name="validationContext">Validation context</param>
<returns>Validation Result</returns>
IEnumerable<System.ComponentModel.DataAnnotations.ValidationResult> IValidatableObject.Validate(ValidationContext validationContext)
{
yield break;
}
}
} |
package cn.jsprun.struts.foreg.actions;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import javax.servlet.ServletContext;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;
import cn.jsprun.domain.Members;
import cn.jsprun.domain.Tags;
import cn.jsprun.struts.action.BaseAction;
import cn.jsprun.utils.Common;
public class TagsAction extends BaseAction {
@SuppressWarnings("unchecked")
public ActionForward toDistags(ActionMapping mapping, ActionForm form,HttpServletRequest request, HttpServletResponse response) {
ServletContext context=servlet.getServletContext();
Map<String, String> settings = (Map<String, String>) context.getAttribute("settings");
int viewthreadtags=Common.toDigit(settings.get("viewthreadtags"));
List<Map<String,String>> hottaglist=dataBaseService.executeQuery("SELECT tagname,total FROM jrun_tags WHERE closed=0 ORDER BY total DESC LIMIT "+viewthreadtags);
if(hottaglist!=null&&hottaglist.size()>0){
for (Map<String, String> hottag : hottaglist) {
hottag.put("tagnameenc", Common.encode(hottag.get("tagname")));
}
request.setAttribute("hottaglist", hottaglist);
}
int count=Integer.valueOf(dataBaseService.executeQuery("SELECT count(*) count FROM jrun_tags WHERE closed=0").get(0).get("count"));
int randlimit=(count<=viewthreadtags)?0:Common.rand(count - viewthreadtags);
List<Map<String,String>> randtaglist=dataBaseService.executeQuery("SELECT tagname,total FROM jrun_tags WHERE closed=0 LIMIT "+randlimit+","+viewthreadtags);
if(randtaglist!=null&&randtaglist.size()>0){
for (Map<String, String> randtag : randtaglist) {
randtag.put("tagnameenc", Common.encode(randtag.get("tagname")));
}
request.setAttribute("randtaglist", randtaglist);
}
return mapping.findForward("todistags");
}
@SuppressWarnings("unchecked")
public ActionForward toThreadtags(ActionMapping mapping, ActionForm form,
HttpServletRequest request, HttpServletResponse response) {
String name = request.getParameter("name");
Tags tag = tagService.findTagsByName(name);
if(tag!=null&&tag.getClosed()>0){
request.setAttribute("resultInfo", getMessage(request,"tag_closed"));
return mapping.findForward("showMessage");
}
if (name != null && !name.equals("")) {
HttpSession session=request.getSession();
Members member=(Members)session.getAttribute("user");
ServletContext context=servlet.getServletContext();
Map<String, String> settings = (Map<String, String>) context.getAttribute("settings");
int count=Integer.valueOf(dataBaseService.executeQuery("SELECT count(*) count FROM jrun_threadtags WHERE tagname=?", Common.addslashes(name)).get(0).get("count"));
int tpp = member != null && member.getTpp() > 0 ? member.getTpp(): Integer.valueOf(settings.get("topicperpage"));
int page =Math.max(Common.intval(request.getParameter("page")), 1);
Map<String,Integer> multiInfo=Common.getMultiInfo(count, tpp, page);
page=multiInfo.get("curpage");
int start_limit=multiInfo.get("start_limit");
Map<String,Object> multi=Common.multi(count, tpp, page, "tag.jsp?name=" + Common.encode(name), 0, 10, true, false, null);
request.setAttribute("multi", multi);
List<Map<String,String>> dislist = null;int delcount = 0;
List<Map<String,String>> threadtaglist = dataBaseService.executeQuery("select s.tid as ttid,t.*,f.name from jrun_threadtags as s left join jrun_threads as t on s.tid=t.tid left join jrun_forums as f on t.fid=f.fid where s.tagname=? limit "+start_limit+","+tpp, Common.addslashes(name));
if (threadtaglist != null && threadtaglist.size() > 0) {
dislist = new ArrayList<Map<String,String>>();
for (Map<String,String> tags : threadtaglist) {
if (tags.get("subject") != null && !tags.get("subject").equals("")) {
dislist.add(tags);
}else{
delcount++;
dataBaseService.runQuery("delete from jrun_threadtags where tid="+tags.get("ttid"));
}
}
}
if(tag!=null && delcount>0){
if(tag.getTotal()>delcount){
tag.setTotal(tag.getTotal()-delcount);
tagService.updateTags(tag);
}else{
tagService.deleteTags(tag);
}
}
threadtaglist = null;
request.setAttribute("dislist", dislist);
request.setAttribute("name", Common.htmlspecialchars(name));
}
return mapping.findForward("todisthreads");
}
} |
<!DOCTYPE HTML PUBLIC "-
<!-- NewPage -->
<html lang="zh">
<head>
<!-- Generated by javadoc (version 1.7.0_79) on Sun Aug 23 11:24:24 CST 2015 -->
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title> org.apache.log4j.net.JMSSink (Apache Log4j 1.2.17 API)</title>
<meta name="date" content="2015-08-23">
<link rel="stylesheet" type="text/css" href="../../../../../stylesheet.css" title="Style">
</head>
<body>
<script type="text/javascript"><!
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="\u7C7B org.apache.log4j.net.JMSSink\u7684\u4F7F\u7528 (Apache Log4j 1.2.17 API)";
}
</script>
<noscript>
<div> JavaScript</div>
</noscript>
<div class="topNav"><a name="navbar_top">
</a><a href="#skip-navbar_top" title=""></a><a name="navbar_top_firstrow">
</a>
<ul class="navList" title="">
<li><a href="../../../../../overview-summary.html"></a></li>
<li><a href="../package-summary.html"></a></li>
<li><a href="../../../../../org/apache/log4j/net/JMSSink.html" title="org.apache.log4j.net"></a></li>
<li class="navBarCell1Rev"></li>
<li><a href="../package-tree.html"></a></li>
<li><a href="../../../../../deprecated-list.html"></a></li>
<li><a href="../../../../../index-all.html"></a></li>
<li><a href="../../../../../help-doc.html"></a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li></li>
<li></li>
</ul>
<ul class="navList">
<li><a href="../../../../../index.html?org/apache/log4j/net/class-use/JMSSink.html" target="_top"></a></li>
<li><a href="JMSSink.html" target="_top"></a></li>
</ul>
<ul class="navList" id="<API key>">
<li><a href="../../../../../allclasses-noframe.html"></a></li>
</ul>
<div>
<script type="text/javascript"><!
allClassesLink = document.getElementById("<API key>");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
</script>
</div>
<a name="skip-navbar_top">
</a></div>
<div class="header">
<h2 title=" org.apache.log4j.net.JMSSink " class="title"> org.apache.log4j.net.JMSSink<br></h2>
</div>
<div class="classUseContainer">org.apache.log4j.net.JMSSink</div>
<div class="bottomNav"><a name="navbar_bottom">
</a><a href="#skip-navbar_bottom" title=""></a><a name="<API key>">
</a>
<ul class="navList" title="">
<li><a href="../../../../../overview-summary.html"></a></li>
<li><a href="../package-summary.html"></a></li>
<li><a href="../../../../../org/apache/log4j/net/JMSSink.html" title="org.apache.log4j.net"></a></li>
<li class="navBarCell1Rev"></li>
<li><a href="../package-tree.html"></a></li>
<li><a href="../../../../../deprecated-list.html"></a></li>
<li><a href="../../../../../index-all.html"></a></li>
<li><a href="../../../../../help-doc.html"></a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li></li>
<li></li>
</ul>
<ul class="navList">
<li><a href="../../../../../index.html?org/apache/log4j/net/class-use/JMSSink.html" target="_top"></a></li>
<li><a href="JMSSink.html" target="_top"></a></li>
</ul>
<ul class="navList" id="<API key>">
<li><a href="../../../../../allclasses-noframe.html"></a></li>
</ul>
<div>
<script type="text/javascript"><!
allClassesLink = document.getElementById("<API key>");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
</script>
</div>
<a name="skip-navbar_bottom">
</a></div>
<p class="legalCopy"><small>Copyright &
</body>
</html> |
<html><head><title>Results for apim-server-startup</title></head>
<body>Select a result on the left-hand pane.</body></html> |
# test shuffle_batch - 6b
# generates a pair of files (color+bn)
# pending: make the tuple match
print("Loading tensorflow...")
import numpy as np
import matplotlib.pyplot as plt
import tensorflow as tf
import os
from libs import utils
import datetime
tf.set_random_seed(1)
def <API key>(files1, files2, batch_size, n_epochs, shape, crop_shape=None,
crop_factor=1.0, n_threads=1, seed=None):
producer1 = tf.train.<API key>(
files1, capacity=len(files1), shuffle=False)
producer2 = tf.train.<API key>(
files2, capacity=len(files2), shuffle=False)
# We need something which can open the files and read its contents.
reader = tf.WholeFileReader()
# We pass the filenames to this object which can read the file's contents.
# This will create another queue running which dequeues the previous queue.
keys1, vals1 = reader.read(producer1)
keys2, vals2 = reader.read(producer2)
# And then have to decode its contents as we know it is a jpeg image
imgs1 = tf.image.decode_jpeg(vals1, channels=3)
imgs2 = tf.image.decode_jpeg(vals2, channels=3)
# We have to explicitly define the shape of the tensor.
# This is because the decode_jpeg operation is still a node in the graph
# and doesn't yet know the shape of the image. Future operations however
# need explicit knowledge of the image's shape in order to be created.
imgs1.set_shape(shape)
imgs2.set_shape(shape)
# Next we'll centrally crop the image to the size of 100x100.
# This operation required explicit knowledge of the image's shape.
if shape[0] > shape[1]:
rsz_shape = [int(shape[0] / shape[1] * crop_shape[0] / crop_factor),
int(crop_shape[1] / crop_factor)]
else:
rsz_shape = [int(crop_shape[0] / crop_factor),
int(shape[1] / shape[0] * crop_shape[1] / crop_factor)]
rszs1 = tf.image.resize_images(imgs1, rsz_shape[0], rsz_shape[1])
rszs2 = tf.image.resize_images(imgs2, rsz_shape[0], rsz_shape[1])
crops1 = (tf.image.<API key>(
rszs1, crop_shape[0], crop_shape[1])
if crop_shape is not None
else imgs1)
crops2 = (tf.image.<API key>(
rszs2, crop_shape[0], crop_shape[1])
if crop_shape is not None
else imgs2)
# Now we'll create a batch generator that will also shuffle our examples.
# We tell it how many it should have in its buffer when it randomly
# permutes the order.
min_after_dequeue = len(files1)
# The capacity should be larger than min_after_dequeue, and determines how
# many examples are prefetched. TF docs recommend setting this value to:
# min_after_dequeue + (num_threads + a small safety margin) * batch_size
capacity = min_after_dequeue + (n_threads + 1) * batch_size
# Randomize the order and output batches of batch_size.
batch = tf.train.shuffle_batch([crops1, crops2],
enqueue_many=False,
batch_size=batch_size,
capacity=capacity,
min_after_dequeue=min_after_dequeue,
num_threads=n_threads,
#seed=seed,
)#shapes=(64,64,3))
# alternatively, we could use shuffle_batch_join to use multiple reader
# instances, or set shuffle_batch's n_threads to higher than 1.
return batch
def CELEByida(path):
fs = [os.path.join(path, f)
for f in os.listdir(path) if f.endswith('.jpg')]
fs=sorted(fs)
return fs
print("Loading celebrities...")
from libs.datasets import CELEB
files1 = CELEByida("../session-1/img_align_celeba/") # only 100
files2 = CELEByida("../session-1/img_align_celeba_n/") # only 100
from libs.dataset_utils import <API key>
batch_size = 8
n_epochs = 3
input_shape = [218, 178, 3]
crop_shape = [64, 64, 3]
crop_factor = 0.8
seed=15
batch1 = <API key>(
files1=files1, files2=files2,
batch_size=batch_size,
n_epochs=n_epochs,
crop_shape=crop_shape,
crop_factor=crop_factor,
shape=input_shape,
seed=seed)
mntg=[]
sess = tf.Session()
coord = tf.train.Coordinator()
threads = tf.train.start_queue_runners(sess=sess, coord=coord)
batres = sess.run(batch1)
batch_xs1=np.array(batres[0])
batch_xs2=np.array(batres[1])
for i in range(0,len(batch_xs1)):
img=batch_xs1[i] / 255.0
mntg.append(img)
img=batch_xs2[i] / 255.0
mntg.append(img)
TID=datetime.date.today().strftime("%Y%m%d")+"_"+datetime.datetime.now().time().strftime("%H%M%S")
m=utils.montage(mntg, saveto="montage_"+TID+".png")
# mntg[0]=color
# mntg[1]=b/n
plt.figure(figsize=(5, 5))
plt.imshow(m)
plt.show()
# eop |
<!DOCTYPE HTML PUBLIC "-
<!--NewPage
<HTML>
<HEAD>
<!-- Generated by javadoc (build 1.6.0_45) on Fri Mar 06 22:17:22 CST 2015 -->
<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
<TITLE>
All Classes (Apache Hadoop Distributed Copy 2.3.0 API)
</TITLE>
<META NAME="date" CONTENT="2015-03-06">
<LINK REL ="stylesheet" TYPE="text/css" HREF="stylesheet.css" TITLE="Style">
</HEAD>
<BODY BGCOLOR="white">
<FONT size="+1" CLASS="FrameHeadingFont">
<B>All Classes</B></FONT>
<BR>
<TABLE BORDER="0" WIDTH="100%" SUMMARY="">
<TR>
<TD NOWRAP><FONT CLASS="FrameItemFont"><A HREF="org/apache/hadoop/tools/mapred/CopyCommitter.html" title="class in org.apache.hadoop.tools.mapred" target="classFrame">CopyCommitter</A>
<BR>
<A HREF="org/apache/hadoop/tools/CopyListing.html" title="class in org.apache.hadoop.tools" target="classFrame">CopyListing</A>
<BR>
<A HREF="org/apache/hadoop/tools/mapred/CopyMapper.html" title="class in org.apache.hadoop.tools.mapred" target="classFrame">CopyMapper</A>
<BR>
<A HREF="org/apache/hadoop/tools/mapred/CopyMapper.Counter.html" title="enum in org.apache.hadoop.tools.mapred" target="classFrame">CopyMapper.Counter</A>
<BR>
<A HREF="org/apache/hadoop/tools/mapred/CopyOutputFormat.html" title="class in org.apache.hadoop.tools.mapred" target="classFrame">CopyOutputFormat</A>
<BR>
<A HREF="org/apache/hadoop/tools/DistCp.html" title="class in org.apache.hadoop.tools" target="classFrame">DistCp</A>
<BR>
<A HREF="org/apache/hadoop/tools/DistCpConstants.html" title="class in org.apache.hadoop.tools" target="classFrame">DistCpConstants</A>
<BR>
<A HREF="org/apache/hadoop/tools/DistCpOptions.html" title="class in org.apache.hadoop.tools" target="classFrame">DistCpOptions</A>
<BR>
<A HREF="org/apache/hadoop/tools/DistCpOptions.FileAttribute.html" title="enum in org.apache.hadoop.tools" target="classFrame">DistCpOptions.FileAttribute</A>
<BR>
<A HREF="org/apache/hadoop/tools/DistCpOptionSwitch.html" title="enum in org.apache.hadoop.tools" target="classFrame">DistCpOptionSwitch</A>
<BR>
<A HREF="org/apache/hadoop/tools/util/DistCpUtils.html" title="class in org.apache.hadoop.tools.util" target="classFrame">DistCpUtils</A>
<BR>
<A HREF="org/apache/hadoop/tools/mapred/lib/DynamicInputFormat.html" title="class in org.apache.hadoop.tools.mapred.lib" target="classFrame">DynamicInputFormat</A>
<BR>
<A HREF="org/apache/hadoop/tools/mapred/lib/DynamicRecordReader.html" title="class in org.apache.hadoop.tools.mapred.lib" target="classFrame">DynamicRecordReader</A>
<BR>
<A HREF="org/apache/hadoop/tools/<API key>.html" title="class in org.apache.hadoop.tools" target="classFrame"><API key></A>
<BR>
<A HREF="org/apache/hadoop/tools/GlobbedCopyListing.html" title="class in org.apache.hadoop.tools" target="classFrame">GlobbedCopyListing</A>
<BR>
<A HREF="org/apache/hadoop/tools/OptionsParser.html" title="class in org.apache.hadoop.tools" target="classFrame">OptionsParser</A>
<BR>
<A HREF="org/apache/hadoop/tools/util/RetriableCommand.html" title="class in org.apache.hadoop.tools.util" target="classFrame">RetriableCommand</A>
<BR>
<A HREF="org/apache/hadoop/tools/mapred/<API key>.html" title="class in org.apache.hadoop.tools.mapred" target="classFrame"><API key></A>
<BR>
<A HREF="org/apache/hadoop/tools/mapred/<API key>.html" title="class in org.apache.hadoop.tools.mapred" target="classFrame"><API key></A>
<BR>
<A HREF="org/apache/hadoop/tools/mapred/<API key>.CopyReadException.html" title="class in org.apache.hadoop.tools.mapred" target="classFrame"><API key>.CopyReadException</A>
<BR>
<A HREF="org/apache/hadoop/tools/SimpleCopyListing.html" title="class in org.apache.hadoop.tools" target="classFrame">SimpleCopyListing</A>
<BR>
<A HREF="org/apache/hadoop/tools/util/<API key>.html" title="class in org.apache.hadoop.tools.util" target="classFrame"><API key></A>
<BR>
<A HREF="org/apache/hadoop/tools/mapred/<API key>.html" title="class in org.apache.hadoop.tools.mapred" target="classFrame"><API key></A>
<BR>
</FONT></TD>
</TR>
</TABLE>
</BODY>
</HTML> |
FROM clojure:openjdk-8-lein
COPY target/cmr-mock-echo-app-0.1.<API key>.jar /app/
EXPOSE 3008
WORKDIR /app
CMD "java" "-classpath" "/app/cmr-mock-echo-app-0.1.<API key>.jar" "clojure.main" "-m" "cmr.mock-echo.runner" |
package kube
import (
"fmt"
"time"
"github.com/golang/glog"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/fields"
"k8s.io/apimachinery/pkg/labels"
apiv1 "k8s.io/client-go/pkg/api/v1"
policy "k8s.io/client-go/pkg/apis/policy/v1beta1"
)
const (
// KubeSystemNS is the kube-system namespace.
KubeSystemNS = "kube-system"
// ComponentLabelKey is the node label key used for component
ComponentLabelKey = "component"
// APIServerLabelValue is the node label value used for the apiserver component
APIServerLabelValue = "kube-apiserver"
// <API key> is the node annotation used to protect a node from
// being scaled down.
<API key> = "cluster-autoscaler.kubernetes.io/scale-down-disabled"
// <API key> is a taint that is placed on nodes prior to draining them to
// prevent new pods from being scheduled onto the node during the drain.
<API key> = "<API key>"
)
// NodeScaler is an entity capable of scaling down Kubernetes worker nodes in a graceful manner.
type NodeScaler interface {
// GetNode returns a particular node in the cluster or nil if no such node exists.
GetNode(name string) (*NodeInfo, error)
// ListNodes returns all nodes (masters and workers) currently in the Kubernetes cluster.
ListNodes() ([]*NodeInfo, error)
// WorkerNodes returns all worker nodes currently in the Kubernetes cluster.
ListWorkerNodes() ([]*NodeInfo, error)
// <API key> determines if a particular node is (reasonably) safe to scale down.
<API key>(node *NodeInfo) (bool, error)
// DeleteNode deletes a node from the Kubernetes cluster, akin to `kubectl delete node`.
DeleteNode(node *NodeInfo) error
// NodeLoad determines the load on a given node (according to some definition of
// load that the NodeScaler has been configured to use). This value can be used to
// determine which node is "cheapest" to scale down (requiring fewest migrations).
// A higher value represents a higher load on the node.
NodeLoad(node *NodeInfo) float64
// DrainNode evacutates a node by moving all pods hosted on the node to other nodes.
// During this operation, and after (on success), the node is marked as unschedulable
// to prevent new pods from being scheduled onto it. At that point the machine that the
// node is running on is safe to be terminated. Should the operation fail part-way through
// the node will be marked schedulable again. On failure some pods may have been migrated
// to other nodes, while some pods may remain on the node.
DrainNode(victimNode *NodeInfo) error
}
// <API key> is returned on <API key> to indicate
// that the given node is protected via a scale-down protection annotation
type <API key> struct {
NodeName string
}
func (e *<API key>) Error() string {
return fmt.Sprintf("node %s is protected from scale-down via %s annotation", e.NodeName, <API key>)
}
// <API key> is returned on <API key> to indicate
// that the given node is prevented from being scaled down by having one or more
// pods without controller (deployment/replica set), which would not get recreated
// on node evacuation.
type <API key> struct {
NodeName string
PodName string
}
func (e *<API key>) Error() string {
return fmt.Sprintf("pod %s on node %s does not have a (replication) controller and cannot be evacuated (it won't get recreated)", e.PodName, e.NodeName)
}
// <API key> is returned by <API key> to indicate
// that the given node is prevented from being scaled down by having one or more
// pods with a host-local storage volume.
type <API key> struct {
NodeName string
PodName string
}
func (e *<API key>) Error() string {
return fmt.Sprintf("pod %s on node %s has a node-local storage volume and cannot be evacuated", e.PodName, e.NodeName)
}
// <API key> is returned by <API key> to indicate
// that the given node cannot be safely evacuated.
type <API key> struct {
NodeName string
Reason error
}
func (e *<API key>) Error() string {
return fmt.Sprintf("not all pods on node %s can be safely evacuated: %s", e.NodeName, e.Reason)
}
// <API key> is returned by <API key> to indicate
// that the given node cannot be safely evacuated due to violating a pod
// disruption budget.
type <API key> struct {
PodDisruptionBudget string
RequiredDisruptions int32
AllowedDisruptions int32
}
func (e *<API key>) Error() string {
return fmt.Sprintf("pod disruption budget %s prevents node evacuation: "+
"disruptions required: %d, disruptions allowed: %d",
e.PodDisruptionBudget, e.RequiredDisruptions, e.AllowedDisruptions)
}
// <API key> is returned by <API key> to
// indicate a situation where a node cannot be scaled down since there are
// no available nodes to evacuate its pods to.
type <API key> struct{}
func (e *<API key>) Error() string {
return fmt.Sprintf("no other schedulable nodes to evacuate to")
}
// DefaultNodeScaler is capable of gracefully scaling down nodes (by first evacuating the pods
// hosted on the node).
type DefaultNodeScaler struct {
KubeClient KubeClient
}
// NewNodeScaler creates a new NodeScaler using a given kubernetes API server client.
func NewNodeScaler(kubeClient KubeClient) NodeScaler {
return &DefaultNodeScaler{KubeClient: kubeClient}
}
// GetNode returns a particular node in the cluster or nil if no such node exists.
func (scaler *DefaultNodeScaler) GetNode(name string) (*NodeInfo, error) {
return scaler.getNodeInfo(name)
}
// ListNodes returns all cluster nodes (including masters).
func (scaler *DefaultNodeScaler) ListNodes() ([]*NodeInfo, error) {
nodes, err := scaler.getNodeInfos()
if err != nil {
return nil, fmt.Errorf("failed to retrieve nodes from kubernetes: %s", err)
}
return nodes, nil
}
// ListWorkerNodes returns all non-master nodes.
func (scaler *DefaultNodeScaler) ListWorkerNodes() ([]*NodeInfo, error) {
nodes, err := scaler.ListNodes()
if err != nil {
return nil, err
}
nonMasterNodes := filterNodes(nodes, not(isMasterNode))
return nonMasterNodes, nil
}
// <API key> determines if a particular node is (reasonably) safe to scale down.
// If false, an error gives further explanation as to why the node was not deemed safe
// to scale down.
func (scaler *DefaultNodeScaler) <API key>(node *NodeInfo) (bool, error) {
// node cannot be marked with no scaledown
if node.Annotations[<API key>] == "true" {
return false, &<API key>{NodeName: node.Name}
}
// retrieve all nodes and their pods
nodes, err := scaler.getNodeInfos()
if err != nil {
return false, err
}
// get the remaining nodes that are available as potential destination for evacuated pods. filter out
// - master nodes
// - unschedulable nodes
// - victim node
// - nodes that are not ready
// - nodes that are unschedulable
<API key> := filterNodes(nodes,
not(isMasterNode), not(hasNodeName(node.Name)), isNodeReady, isNodeSchedulable)
if len(<API key>) == 0 {
return false, &<API key>{
NodeName: node.Name, Reason: &<API key>{},
}
}
glog.V(1).Infof("remaining worker nodes: %s", <API key>)
// filter out kube-system pods from victim pods
podsToEvacuate := filterPods(node.Pods, isNonSystemPod, isActivePod)
glog.V(1).Infof("node %s hosts %d active (non-system) pods", node.Name, len(podsToEvacuate))
for _, pod := range podsToEvacuate {
glog.V(2).Infof(" pod: %s/%s", pod.Namespace, pod.Name)
}
// Check that pods *can* be moved to a different node and aren't required to run on this node
for _, pod := range podsToEvacuate {
if hasNodeLocalStorage(pod) {
return false, &<API key>{NodeName: node.Name, PodName: pod.Name}
}
if !hasController(pod) {
return false, &<API key>{NodeName: node.Name, PodName: pod.Name}
}
}
PDBs, err := scaler.KubeClient.<API key>("")
if err != nil {
return false, fmt.Errorf("failed to list pod disruption budgets: %s", err)
}
if ok, err := scaler.<API key>(PDBs.Items, podsToEvacuate); !ok {
return false, &<API key>{NodeName: node.Name, Reason: err}
}
// make a simplified pod placement, similar to the one done by the kubernetes scheduler,
// to make an educated guess if evacuation and scale-down of this node is viable
err = scaler.<API key>(podsToEvacuate, <API key>)
if err != nil {
return false, &<API key>{NodeName: node.Name, Reason: err}
}
return true, nil
}
// <API key> makes an educated guess to indicate if
// a certain group pods can safely be scheduled onto a group of nodes. It does
// this by making a simplified pod scheduling, similar to the one done by the
// Kubernetes scheduler.
func (scaler *DefaultNodeScaler) <API key>(
podsToEvacuate []apiv1.Pod, schedulableNodes []*NodeInfo) error {
scheduler := NewQuasiScheduler(schedulableNodes, nil)
err := scheduler.<API key>(podsToEvacuate)
if err != nil {
return err
}
for _, podToEvacuate := range podsToEvacuate {
placement, err := scheduler.Schedule(podToEvacuate)
if err != nil {
return err
}
glog.V(1).Infof("quasi-scheduling: %s", placement)
}
return nil
}
// DeleteNode deletes a node from the Kubernetes cluster, akin to `kubectl delete node`.
func (scaler *DefaultNodeScaler) DeleteNode(node *NodeInfo) error {
err := scaler.KubeClient.DeleteNode(&node.Node)
if err != nil {
return fmt.Errorf("failed to delete node: %s", err)
}
return nil
}
// NodeLoad determines the load on a given node (according to some definition of
// load that the NodeScaler has been configured to use). This value can be used to
// determine which node is "cheapest" to scale down (requiring fewest migrations).
// A higher value represents a higher load on the node.
func (scaler *DefaultNodeScaler) NodeLoad(node *NodeInfo) float64 {
// let the quasi scheduler determine the node load
return NewQuasiScheduler([]*NodeInfo{}, nil).NodeLoad(node)
}
// DrainNode marks a node unschedulable (via a taint) and then drains the node by evicting all
// active, non-system pods scheduled onto the node.
// https://kubernetes.io/docs/tasks/administer-cluster/safely-drain-node/#the-eviction-api
func (scaler *DefaultNodeScaler) DrainNode(nodeToDrain *NodeInfo) error {
err := scaler.markUnschedulable(nodeToDrain)
if err != nil {
return fmt.Errorf("DrainNode: failed to mark node unschedulable: %s", err)
}
// evict all active non-system pods on node
podsToEvacuate := filterPods(nodeToDrain.Pods, isNonSystemPod, isActivePod)
for _, podToEvacuate := range podsToEvacuate {
glog.V(0).Infof("evicting %s/%s ...", podToEvacuate.Namespace, podToEvacuate.Name)
gracePeriodSeconds := podToEvacuate.<API key>()
eviction := &policy.Eviction{
ObjectMeta: metav1.ObjectMeta{
Name: podToEvacuate.Name,
Namespace: podToEvacuate.Namespace,
},
DeleteOptions: &metav1.DeleteOptions{
GracePeriodSeconds: gracePeriodSeconds,
},
}
evictionError := scaler.KubeClient.EvictPod(eviction)
// if evacuation fails, we remove unschedulable mark
defer func() {
if evictionError != nil {
glog.Infof("DrainNode: marking node schedulable again due to evacuation error: %s", evictionError)
if err := scaler.markSchedulable(nodeToDrain); err != nil {
glog.Errorf("DrainNode: failed to remove unschedulable taint after evacuation failure: %s", err)
}
}
}()
if evictionError != nil {
return fmt.Errorf("DrainNode: failed to evacuate pod %s: %s", podToEvacuate.Name, evictionError)
}
}
return nil
}
// markUnschedulable taints a node prior to draining it in order to make
// sure new pods are not scheduled onto it while draining.
func (scaler *DefaultNodeScaler) markUnschedulable(node *NodeInfo) error {
// need a fresh snapshot of node
freshNode, err := scaler.KubeClient.GetNode(node.Name)
if err != nil {
return fmt.Errorf("failed to refresh node metadata: %s", err)
}
taints := freshNode.Spec.Taints
for _, taint := range taints {
if taint.Key == <API key> {
glog.V(1).Infof("node %s already has taint %s", freshNode.Name, <API key>)
return nil
}
}
glog.V(0).Infof("marking node %s unschedulable by setting taint %s", freshNode.Name, <API key>)
unschedulableTaint := apiv1.Taint{
Key: <API key>,
Value: "true",
Effect: apiv1.<API key>,
TimeAdded: metav1.Time{Time: time.Now()},
}
freshNode.Spec.Taints = append(freshNode.Spec.Taints, unschedulableTaint)
err = scaler.KubeClient.UpdateNode(freshNode)
if err != nil {
return err
}
return nil
}
func (scaler *DefaultNodeScaler) markSchedulable(node *NodeInfo) error {
// Refresh node metadata
freshNode, err := scaler.KubeClient.GetNode(node.Name)
if err != nil {
return fmt.Errorf("markSchedulable: failed to get node: %s", err)
}
taints := freshNode.Spec.Taints
taintsToKeep := make([]apiv1.Taint, 0)
for _, taint := range taints {
if taint.Key != <API key> {
// keep taint
taintsToKeep = append(taintsToKeep, taint)
}
}
freshNode.Spec.Taints = taintsToKeep
err = scaler.KubeClient.UpdateNode(freshNode)
if err != nil {
return fmt.Errorf("markSchedulable: failed to remove %s taint: %s", <API key>, err)
}
return nil
}
// <API key> returns true if a given set of pods can be
// moved without violating a given set of disruption budgets
func (scaler *DefaultNodeScaler) <API key>(PDBs []policy.PodDisruptionBudget, nodePods []apiv1.Pod) (bool, error) {
for _, PDB := range PDBs {
pdbLabelSelector, err := metav1.<API key>(PDB.Spec.Selector)
if err != nil {
return false, fmt.Errorf("cannot parse label selector on PDB %s: %s", PDB.Name, err)
}
var numPDBMatchingPods int32
for _, pod := range nodePods {
if pdbLabelSelector.Matches(labels.Set(pod.ObjectMeta.Labels)) {
numPDBMatchingPods++
}
}
if numPDBMatchingPods > PDB.Status.<API key> {
return false, &<API key>{
PodDisruptionBudget: PDB.Name,
RequiredDisruptions: numPDBMatchingPods,
AllowedDisruptions: PDB.Status.<API key>}
}
}
return true, nil
}
func (scaler *DefaultNodeScaler) getNodeInfos() ([]*NodeInfo, error) {
nodeList, err := scaler.KubeClient.ListNodes()
if err != nil {
return nil, err
}
var nodeInfos []*NodeInfo
for _, node := range nodeList.Items {
nodeInfo, err := scaler.getNodeInfo(node.Name)
if err != nil {
return nil, err
}
nodeInfos = append(nodeInfos, nodeInfo)
}
return nodeInfos, nil
}
func (scaler *DefaultNodeScaler) getNodeInfo(nodeName string) (*NodeInfo, error) {
node, err := scaler.KubeClient.GetNode(nodeName)
if err != nil {
return nil, err
}
pods, err := scaler.getPodsOnNode(node)
if err != nil {
return nil, err
}
return &NodeInfo{*node, pods}, nil
}
func (scaler *DefaultNodeScaler) getPodsOnNode(node *apiv1.Node) ([]apiv1.Pod, error) {
podList, err := scaler.KubeClient.ListPods(
metav1.NamespaceAll,
metav1.ListOptions{FieldSelector: fields.SelectorFromSet(fields.Set{"spec.nodeName": node.Name}).String()})
if err != nil {
return nil, err
}
return podList.Items, nil
}
type nodePredicate func(*NodeInfo) bool
func not(predicate nodePredicate) nodePredicate {
return func(node *NodeInfo) bool {
return !predicate(node)
}
}
// isMasterNode is a node predicate that returns true for master Nodes.
// There is no foolproof way of determining this but we use the following heuristics:
// - a master has a pod with label "component": "kube-apiserver" (in kubernetes 1.7+)
// - a master has a pod with name "kube-apiserver-<nodename>"
func isMasterNode(node *NodeInfo) bool {
for _, pod := range node.Pods {
if pod.Namespace != KubeSystemNS {
continue
}
if val, ok := pod.Labels[ComponentLabelKey]; ok && (val == APIServerLabelValue) {
glog.V(2).Infof("node %s considered a master due to %s=%s label",
node.Name, ComponentLabelKey, APIServerLabelValue)
return true
}
<API key> := "kube-apiserver-" + node.Name
if pod.Name == <API key> {
glog.V(2).Infof("node %s considered a master due to pod %s",
node.Name, pod.Name)
return true
}
}
return false
}
// hasNodeName returns a node predicate that matches for any node that has
// a particular name
func hasNodeName(name string) nodePredicate {
return func(node *NodeInfo) bool {
return node.Name == name
}
}
// isNodeReady returns true if a given node is "Ready"
func isNodeReady(node *NodeInfo) bool {
for _, condition := range node.Status.Conditions {
if condition.Type == apiv1.NodeReady && condition.Status == apiv1.ConditionTrue {
return true
}
}
glog.V(2).Infof("node %s is not ready", node.Name)
return false
}
// isNodeSchedulable returns true for any node without the unschedulable field set
func isNodeSchedulable(node *NodeInfo) bool {
schedulable := !node.Spec.Unschedulable
if !schedulable {
glog.V(2).Infof("node %s is unschedulable", node.Name)
}
return schedulable
}
// filterNodes takes a list of nodes and returns a filtered list containing only
// the nodes that satisfy all predicates.
func filterNodes(nodes []*NodeInfo, predicates ...nodePredicate) []*NodeInfo {
var filtered []*NodeInfo
for _, node := range nodes {
<API key> := true
for _, predicate := range predicates {
if !predicate(node) {
<API key> = false
break
}
}
if <API key> {
filtered = append(filtered, node)
}
}
return filtered
}
type podPredicate func(apiv1.Pod) bool
// isNonSystemPod returns true for any pod that does not belong to the 'kube-system' namespace
func isNonSystemPod(pod apiv1.Pod) bool {
return pod.Namespace != KubeSystemNS
}
// isActivePod is a predicate that returns true for any pod that is in state 'Pending' or 'Running'
func isActivePod(pod apiv1.Pod) bool {
return pod.Status.Phase == apiv1.PodPending || pod.Status.Phase == apiv1.PodRunning
}
// hasNodeLocalStorage returns true for any pod with a volume that is local to its node
func hasNodeLocalStorage(pod apiv1.Pod) bool {
for _, vol := range pod.Spec.Volumes {
if vol.HostPath != nil || vol.EmptyDir != nil {
return true
}
}
return false
}
func hasController(pod apiv1.Pod) bool {
for _, ownerRef := range pod.ObjectMeta.OwnerReferences {
if *ownerRef.Controller {
return true
}
}
return false
}
// filterPods takes a list of pods and returns a filtered list containing
// only Pods that satisifies all predicates
func filterPods(pods []apiv1.Pod, predicates ...podPredicate) []apiv1.Pod {
filtered := make([]apiv1.Pod, 0)
for _, pod := range pods {
<API key> := true
for _, predicate := range predicates {
if !predicate(pod) {
<API key> = false
break
}
}
if <API key> {
filtered = append(filtered, pod)
}
}
return filtered
} |
layout : blocks/page-participant
title : Geoff Hill
type : participant
job-title : Threat Modeler
company : Tutamantic Ltd.
travel-from : United Kingdom
image : https://media.licdn.com/mpr/mpr/shrinknp_400_400/p/2/005/04d/266/048ec09.jpg
<API key>: 10942080
twitter : Tutamantic_Sec
facebook : TutamanticSec
email : geoff.hill@tutamantic.com
mobile : 07 858 955 963
status : done
ticket : 5x8h
working-sessions: Threat Modeling Diagramming Techniques, Threat Modeling OWASP Pages, Integrating Security into an Spotify Model, Maturity Models tool, Review and improve the 12 SAMM practices, SAMM Metrics for Enterprise, Threat Modeling Cheat Sheet & Lightweight Threat Modeling, Securing Legacy Applications, JIRA Risk Workflow, SAMM - Core Model Update 1 - Intro, SAMM - Maturity Models tool, GDPR and DPO AppSec implications, SAMM Metrics for Enterprises, Women in Cyber, Define Agile Security Practices, Using Security Risks to Measure Agile Practices, Integrating Security into a Portfolio Kanban
Founder of Artis-Secure (security consultancy, specifically sSDLC) and Tutamantic (software enabler).
Ex C/C++ developer.
Working deeply in appDev security, security architecture & design, and all things sSDLC-related since 2003.
Co-developed an early form of Microsoft SDL for Agile for use with the global Microsoft Service org. |
using System;
using System.Globalization;
using System.IO;
using System.Linq;
namespace NBench.Reporting
{
<summary>
TeamCity output formatter.
Complies with https://confluence.jetbrains.com/display/TCD10/Build+Script+Interaction+with+TeamCity#<API key>
to ensure that output reports from NBench render nicely on TeamCity.
</summary>
<remarks>
Can be enabled in the default NBench test runner by passing in the <code>teamcity=true</code> flag.
</remarks>
public sealed class <API key> : IBenchmarkOutput
{
private readonly TextWriter _outputWriter;
<summary>
Constructor that takes a <see cref="TextWriter"/> to use
as the output target.
</summary>
<param name="writer">Output target.</param>
public <API key>(TextWriter writer)
{
_outputWriter = writer;
}
<summary>
Default constructor. Uses <see cref="Console.Out"/> as the output target.
</summary>
public <API key>() : this(Console.Out)
{
}
public void WriteLine(string message)
{
// no-op
}
public void Warning(string message)
{
// no-op
}
public void Error(Exception ex, string message)
{
// no-op
}
public void Error(string message)
{
// no-op
}
public void StartBenchmark(string benchmarkName)
{
_outputWriter.WriteLine($"##teamcity[testStarted name=\'{Escape(benchmarkName)}\']");
}
public void SkipBenchmark(string benchmarkName)
{
_outputWriter.WriteLine($"##teamcity[testIgnored name=\'{Escape(benchmarkName)}\' message=\'skipped\']");
}
public void FinishBenchmark(string benchmarkName)
{
_outputWriter.WriteLine($"##teamcity[testFinished name=\'{Escape(benchmarkName)}\']");
}
public void WriteRun(BenchmarkRunReport report, bool isWarmup = false)
{
// no-op
}
public void WriteBenchmark(<API key> results)
{
BenchmarkStdOut(results, "DATA");
foreach (var metric in results.Data.StatsByMetric.Values)
{
BenchmarkStdOut(results, string.Format("{0}: Max: {2:n} {1}, Average: {3:n} {1}, Min: {4:n} {1}, StdDev: {5:n} {1}", metric.Name,
metric.Unit, metric.Stats.Max, metric.Stats.Average, metric.Stats.Min, metric.Stats.StandardDeviation));
BenchmarkStdOut(results, string.Format("{0}: Max / s: {2:n} {1}, Average / s: {3:n} {1}, Min / s: {4:n} {1}, StdDev / s: {5:n} {1}", metric.Name,
metric.Unit, metric.PerSecondStats.Max, metric.PerSecondStats.Average, metric.PerSecondStats.Min, metric.PerSecondStats.StandardDeviation));
}
if (results.AssertionResults.Count > 0)
{
BenchmarkStdOut(results, "ASSERTIONS");
foreach (var assertion in results.AssertionResults)
{
if(assertion.Passed)
BenchmarkStdOut(results, assertion.Message);
else
{
BenchmarkStdErr(results, assertion.Message);
}
}
}
if (results.Data.IsFaulted)
{
BenchmarkStdErr(results, "EXCEPTIONS");
foreach (var exception in results.Data.Exceptions)
{
BenchmarkStdErr(results, exception.ToString());
}
}
if (results.Data.IsFaulted || results.AssertionResults.Any(x => !x.Passed))
{
_outputWriter.WriteLine($"##teamcity[testFailed name=\'{Escape(results.BenchmarkName)}\' message=\'Failed at least one assertion or threw exception.\']");
}
}
private void BenchmarkStdOut(<API key> results, string str)
{
_outputWriter.WriteLine($"##teamcity[testStdOut name=\'{Escape(results.BenchmarkName)}\' out=\'{Escape(str)}\']");
}
private void BenchmarkStdErr(<API key> results, string str)
{
_outputWriter.WriteLine($"##teamcity[testStdErr name=\'{Escape(results.BenchmarkName)}\' out=\'{Escape(str)}\']");
}
private static string Escape(string input)
{
if (string.IsNullOrEmpty(input))
return string.Empty;
return input.Replace("|", "||")
.Replace("'", "|'")
.Replace("\n", "|n")
.Replace("\r", "|r")
.Replace(char.ConvertFromUtf32(int.Parse("0086", NumberStyles.HexNumber)), "|x")
.Replace(char.ConvertFromUtf32(int.Parse("2028", NumberStyles.HexNumber)), "|l")
.Replace(char.ConvertFromUtf32(int.Parse("2029", NumberStyles.HexNumber)), "|p")
.Replace("[", "|[")
.Replace("]", "|]");
}
}
} |
#pragma once
#include <string>
#include "envoy/http/header_map.h"
#include "common/common/singleton.h"
namespace Envoy {
namespace Http {
/**
* Constant HTTP headers and values. All lower case.
*/
class HeaderValues {
public:
const LowerCaseString Accept{"accept"};
const LowerCaseString Authorization{"authorization"};
const LowerCaseString ClientTraceId{"x-client-trace-id"};
const LowerCaseString Connection{"connection"};
const LowerCaseString ContentLength{"content-length"};
const LowerCaseString ContentType{"content-type"};
const LowerCaseString Cookie{"cookie"};
const LowerCaseString Date{"date"};
const LowerCaseString <API key>{"<API key>"};
const LowerCaseString <API key>{"<API key>"};
const LowerCaseString <API key>{"<API key>"};
const LowerCaseString EnvoyForceTrace{"x-envoy-force-trace"};
const LowerCaseString <API key>{"x-envoy-internal"};
const LowerCaseString EnvoyMaxRetries{"x-envoy-max-retries"};
const LowerCaseString EnvoyOriginalPath{"<API key>"};
const LowerCaseString EnvoyRetryOn{"x-envoy-retry-on"};
const LowerCaseString EnvoyRetryGrpcOn{"<API key>"};
const LowerCaseString <API key>{"<API key>"};
const LowerCaseString EnvoyUpstreamCanary{"<API key>"};
const LowerCaseString <API key>{
"<API key>"};
const LowerCaseString <API key>{"<API key>"};
const LowerCaseString <API key>{
"<API key>"};
const LowerCaseString <API key>{"<API key>"};
const LowerCaseString <API key>{"<API key>"};
const LowerCaseString <API key>{"<API key>"};
const LowerCaseString Expect{"expect"};
const LowerCaseString ForwardedFor{"x-forwarded-for"};
const LowerCaseString ForwardedProto{"x-forwarded-proto"};
const LowerCaseString GrpcMessage{"grpc-message"};
const LowerCaseString GrpcStatus{"grpc-status"};
const LowerCaseString GrpcAcceptEncoding{"<API key>"};
const LowerCaseString Host{":authority"};
const LowerCaseString HostLegacy{"host"};
const LowerCaseString KeepAlive{"keep-alive"};
const LowerCaseString Location{"location"};
const LowerCaseString Method{":method"};
const LowerCaseString OtSpanContext{"x-ot-span-context"};
const LowerCaseString Path{":path"};
const LowerCaseString ProxyConnection{"proxy-connection"};
const LowerCaseString RequestId{"x-request-id"};
const LowerCaseString Scheme{":scheme"};
const LowerCaseString Server{"server"};
const LowerCaseString Status{":status"};
const LowerCaseString TransferEncoding{"transfer-encoding"};
const LowerCaseString TE{"te"};
const LowerCaseString Upgrade{"upgrade"};
const LowerCaseString UserAgent{"user-agent"};
const LowerCaseString XB3TraceId{"x-b3-traceid"};
const LowerCaseString XB3SpanId{"x-b3-spanid"};
const LowerCaseString XB3ParentSpanId{"x-b3-parentspanid"};
const LowerCaseString XB3Sampled{"x-b3-sampled"};
const LowerCaseString XB3Flags{"x-b3-flags"};
struct {
const std::string Close{"close"};
} ConnectionValues;
struct {
const std::string Text{"text/plain"};
const std::string Grpc{"application/grpc"};
const std::string GrpcWeb{"application/grpc-web"};
const std::string GrpcWebProto{"application/grpc-web+proto"};
const std::string GrpcWebText{"application/grpc-web-text"};
const std::string GrpcWebTextProto{"application/grpc-web-text+proto"};
} ContentTypeValues;
struct {
const std::string True{"true"};
} <API key>;
struct {
const std::string _5xx{"5xx"};
const std::string ConnectFailure{"connect-failure"};
const std::string RefusedStream{"refused-stream"};
const std::string Retriable4xx{"retriable-4xx"};
} EnvoyRetryOnValues;
struct {
const std::string Cancelled{"cancelled"};
const std::string DeadlineExceeded{"deadline-exceeded"};
const std::string ResourceExhausted{"resource-exhausted"};
} <API key>;
struct {
const std::string _100Continue{"100-continue"};
} ExpectValues;
struct {
const std::string Get{"GET"};
const std::string Head{"HEAD"};
const std::string Post{"POST"};
} MethodValues;
struct {
const std::string Http{"http"};
const std::string Https{"https"};
} SchemeValues;
struct {
const std::string Chunked{"chunked"};
} <API key>;
struct {
const std::string EnvoyHealthChecker{"Envoy/HC"};
} UserAgentValues;
struct {
const std::string Default{"identity,deflate,gzip"};
} <API key>;
struct {
const std::string Trailers{"trailers"};
} TEValues;
};
typedef ConstSingleton<HeaderValues> Headers;
} // Http
} // Envoy |
package uk.ac.ebi.spot.goci.pussycat.manager;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Component;
import uk.ac.ebi.spot.goci.pussycat.exception.<API key>;
import uk.ac.ebi.spot.goci.pussycat.renderlet.RenderletNexus;
import uk.ac.ebi.spot.goci.pussycat.renderlet.<API key>;
import uk.ac.ebi.spot.goci.pussycat.session.PussycatSession;
import javax.servlet.http.HttpSession;
import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
import java.util.Set;
/**
* The default implementation of a {@link uk.ac.ebi.spot.goci.pussycat.manager.PussycatManager}. This implementation
* uses a single, preconfigured {@link PussycatSession} that is used to ensure data is only loaded once, and all
* requests go through this single pussycat session. This manager should also be prewired with a {@link
* uk.ac.ebi.spot.goci.pussycat.renderlet.<API key>} to construct any new, required instances of a renderlet
* nexus. The normal strategy is to generate one renderlet nexus per HTTP session, but to reuse one pussycat session
* across all sessions. This way, the data only needs to be obtained once but multiple different renderings of that
* data can occur.
*
* @author Tony Burdett
* @date 04/06/14
*/
@Component
@Qualifier("pussycatManager")
public class <API key> implements PussycatManager {
private <API key> nexusFactory;
private Set<PussycatSession> sessions;
private Map<String, PussycatSession> sessionMap;
private Map<String, RenderletNexus> nexusMap = new HashMap<String, RenderletNexus>();
private Logger log = LoggerFactory.getLogger(getClass());
public <API key>() {
this.sessions = new HashSet<PussycatSession>();
this.sessionMap = new HashMap<String, PussycatSession>();
this.nexusMap = new HashMap<String, RenderletNexus>();
}
protected Logger getLog() {
return log;
}
public <API key> getNexusFactory() {
return nexusFactory;
}
@Autowired
public void setNexusFactory(<API key> nexusFactory) {
this.nexusFactory = nexusFactory;
}
public Set<PussycatSession> getPussycatSessions() {
return sessions;
}
@Autowired
@Qualifier("cachingSession")
public void setPussycatSession(PussycatSession session) {
this.sessions = Collections.singleton(session);
}
public boolean <API key>(HttpSession session) {
return sessionMap.containsKey(session.getId());
}
public PussycatSession getPussycatSession(HttpSession session) {
return sessionMap.get(session.getId());
}
public PussycatSession bindPussycatSession(HttpSession session, PussycatSession pussycatSession) {
if (!sessions.contains(pussycatSession)) {
sessions.add(pussycatSession);
}
sessionMap.put(session.getId(), pussycatSession);
return pussycatSession;
}
@Override public boolean <API key>(HttpSession session) {
return nexusMap.containsKey(session.getId());
}
@Override public RenderletNexus getRenderletNexus(HttpSession session) {
return nexusMap.get(session.getId());
}
@Override public RenderletNexus bindRenderletNexus(HttpSession session, RenderletNexus renderletNexus) {
nexusMap.put(session.getId(), renderletNexus);
return renderletNexus;
}
@Override public boolean unbindResources(HttpSession session) {
boolean sessionUnbound = false;
boolean nexusUnbound = false;
if (sessionMap.containsKey(session.getId())) {
PussycatSession ps = sessionMap.remove(session.getId());
getLog().debug("PussycatSession '" + ps.getSessionID() + "' is no longer bound to " +
"HttpSession '" + session.getId() + "'");
sessionUnbound = true;
}
else {
getLog().debug("Cannot unbind PussycatSession for HttpSession '" + session.getId() + "' " +
"- no linked PussycatSession resource");
}
if (nexusMap.containsKey(session.getId())) {
RenderletNexus rn = nexusMap.remove(session.getId());
getLog().debug("RenderletNexus '" + rn + "' is no longer bound to " +
"HttpSession '" + session.getId() + "'");
nexusUnbound = true;
}
else {
getLog().debug("Cannot unbind RenderletNexus for HttpSession '" + session.getId() + "' " +
"- no linked RenderletNexus resource");
}
return sessionUnbound && nexusUnbound;
}
public PussycatSession <API key>() {
throw new <API key>(
"This implementation reuses a single, prewired Pussycat Session - new ones cannot be created");
}
@Override public RenderletNexus <API key>(PussycatSession session)
throws <API key> {
return getNexusFactory().<API key>(session);
}
} |
/*
* DO NOT EDIT. THIS FILE IS GENERATED FROM ../../../dist/idl\<API key>.idl
*/
#ifndef <API key>
#define <API key>
#ifndef <API key>
#include "nsIDOMElement.h"
#endif
#ifndef <API key>
#include "<API key>.h"
#endif
/* For IDL files that don't want to include root IDL files. */
#ifndef NS_NO_VTABLE
#define NS_NO_VTABLE
#endif
/* starting interface: <API key> */
#define <API key> "<API key>"
#define <API key> \
{0xc58a159f, 0xe27d, 0x40c8, \
{ 0x86, 0x5a, 0xd4, 0xdc, 0xfd, 0x92, 0x8f, 0x62 }}
class NS_NO_VTABLE <API key> : public <API key> {
public:
<API key>(<API key>)
/* attribute DOMString crop; */
NS_IMETHOD GetCrop(nsAString & aCrop) = 0;
NS_IMETHOD SetCrop(const nsAString & aCrop) = 0;
/* attribute DOMString image; */
NS_IMETHOD GetImage(nsAString & aImage) = 0;
NS_IMETHOD SetImage(const nsAString & aImage) = 0;
/* attribute DOMString label; */
NS_IMETHOD GetLabel(nsAString & aLabel) = 0;
NS_IMETHOD SetLabel(const nsAString & aLabel) = 0;
/* attribute DOMString accessKey; */
NS_IMETHOD GetAccessKey(nsAString & aAccessKey) = 0;
NS_IMETHOD SetAccessKey(const nsAString & aAccessKey) = 0;
/* attribute DOMString command; */
NS_IMETHOD GetCommand(nsAString & aCommand) = 0;
NS_IMETHOD SetCommand(const nsAString & aCommand) = 0;
};
<API key>(<API key>, <API key>)
/* Use this macro when declaring classes that implement this interface. */
#define <API key> \
NS_IMETHOD GetCrop(nsAString & aCrop) override; \
NS_IMETHOD SetCrop(const nsAString & aCrop) override; \
NS_IMETHOD GetImage(nsAString & aImage) override; \
NS_IMETHOD SetImage(const nsAString & aImage) override; \
NS_IMETHOD GetLabel(nsAString & aLabel) override; \
NS_IMETHOD SetLabel(const nsAString & aLabel) override; \
NS_IMETHOD GetAccessKey(nsAString & aAccessKey) override; \
NS_IMETHOD SetAccessKey(const nsAString & aAccessKey) override; \
NS_IMETHOD GetCommand(nsAString & aCommand) override; \
NS_IMETHOD SetCommand(const nsAString & aCommand) override;
/* Use this macro to declare functions that forward the behavior of this interface to another object. */
#define <API key>(_to) \
NS_IMETHOD GetCrop(nsAString & aCrop) override { return _to GetCrop(aCrop); } \
NS_IMETHOD SetCrop(const nsAString & aCrop) override { return _to SetCrop(aCrop); } \
NS_IMETHOD GetImage(nsAString & aImage) override { return _to GetImage(aImage); } \
NS_IMETHOD SetImage(const nsAString & aImage) override { return _to SetImage(aImage); } \
NS_IMETHOD GetLabel(nsAString & aLabel) override { return _to GetLabel(aLabel); } \
NS_IMETHOD SetLabel(const nsAString & aLabel) override { return _to SetLabel(aLabel); } \
NS_IMETHOD GetAccessKey(nsAString & aAccessKey) override { return _to GetAccessKey(aAccessKey); } \
NS_IMETHOD SetAccessKey(const nsAString & aAccessKey) override { return _to SetAccessKey(aAccessKey); } \
NS_IMETHOD GetCommand(nsAString & aCommand) override { return _to GetCommand(aCommand); } \
NS_IMETHOD SetCommand(const nsAString & aCommand) override { return _to SetCommand(aCommand); }
/* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
#define <API key>(_to) \
NS_IMETHOD GetCrop(nsAString & aCrop) override { return !_to ? <API key> : _to->GetCrop(aCrop); } \
NS_IMETHOD SetCrop(const nsAString & aCrop) override { return !_to ? <API key> : _to->SetCrop(aCrop); } \
NS_IMETHOD GetImage(nsAString & aImage) override { return !_to ? <API key> : _to->GetImage(aImage); } \
NS_IMETHOD SetImage(const nsAString & aImage) override { return !_to ? <API key> : _to->SetImage(aImage); } \
NS_IMETHOD GetLabel(nsAString & aLabel) override { return !_to ? <API key> : _to->GetLabel(aLabel); } \
NS_IMETHOD SetLabel(const nsAString & aLabel) override { return !_to ? <API key> : _to->SetLabel(aLabel); } \
NS_IMETHOD GetAccessKey(nsAString & aAccessKey) override { return !_to ? <API key> : _to->GetAccessKey(aAccessKey); } \
NS_IMETHOD SetAccessKey(const nsAString & aAccessKey) override { return !_to ? <API key> : _to->SetAccessKey(aAccessKey); } \
NS_IMETHOD GetCommand(nsAString & aCommand) override { return !_to ? <API key> : _to->GetCommand(aCommand); } \
NS_IMETHOD SetCommand(const nsAString & aCommand) override { return !_to ? <API key> : _to->SetCommand(aCommand); }
#if 0
/* Use the code below as a template for the implementation class for this interface. */
/* Header file */
class <API key> : public <API key>
{
public:
NS_DECL_ISUPPORTS
<API key>
<API key>();
private:
~<API key>();
protected:
/* additional members */
};
/* Implementation file */
NS_IMPL_ISUPPORTS(<API key>, <API key>)
<API key>::<API key>()
{
/* member initializers and constructor code */
}
<API key>::~<API key>()
{
/* destructor code */
}
/* attribute DOMString crop; */
NS_IMETHODIMP <API key>::GetCrop(nsAString & aCrop)
{
return <API key>;
}
NS_IMETHODIMP <API key>::SetCrop(const nsAString & aCrop)
{
return <API key>;
}
/* attribute DOMString image; */
NS_IMETHODIMP <API key>::GetImage(nsAString & aImage)
{
return <API key>;
}
NS_IMETHODIMP <API key>::SetImage(const nsAString & aImage)
{
return <API key>;
}
/* attribute DOMString label; */
NS_IMETHODIMP <API key>::GetLabel(nsAString & aLabel)
{
return <API key>;
}
NS_IMETHODIMP <API key>::SetLabel(const nsAString & aLabel)
{
return <API key>;
}
/* attribute DOMString accessKey; */
NS_IMETHODIMP <API key>::GetAccessKey(nsAString & aAccessKey)
{
return <API key>;
}
NS_IMETHODIMP <API key>::SetAccessKey(const nsAString & aAccessKey)
{
return <API key>;
}
/* attribute DOMString command; */
NS_IMETHODIMP <API key>::GetCommand(nsAString & aCommand)
{
return <API key>;
}
NS_IMETHODIMP <API key>::SetCommand(const nsAString & aCommand)
{
return <API key>;
}
/* End of implementation class template. */
#endif
#endif /* <API key> */ |
"""Agent foundation for conversation integration."""
from abc import ABC, abstractmethod
from typing import Optional
from homeassistant.helpers import intent
class <API key>(ABC):
"""Abstract conversation agent."""
@property
def attribution(self):
"""Return the attribution."""
return None
async def <API key>(self):
"""Get onboard data."""
return None
async def <API key>(self, shown):
"""Set onboard data."""
return True
@abstractmethod
async def async_process(
self, text: str, conversation_id: Optional[str] = None
) -> intent.IntentResponse:
"""Process a sentence.""" |
package info.folone.scala.poi
import org.specs2.mutable.Specification
import java.io.File
class PoiLoadFileSpec extends Specification {
val testBook = Workbook(
Set(
Sheet("test")(
Set(
Row(0)(Set(StringCell(0, "A1"), StringCell(1, "B1"), StringCell(2, "C1"))),
Row(1)(Set(StringCell(0, "A2"), StringCell(1, "B2"), StringCell(2, "C2"))),
Row(2)(Set(StringCell(0, "A3"), StringCell(1, "B3"), StringCell(2, "C3"))),
Row(3)(Set(StringCell(0, "A4"), StringCell(1, "B4"), StringCell(2, "C4")))
)
)
),
XSSF
)
val targetWorksheet = {
val testBookFile = File.createTempFile("tmp", "xlsx")
val testBookPath = testBookFile.getAbsolutePath
try {
new impure.WorkbookImpure(testBook).overwrite(testBookPath)
impure.load(testBookPath).sheets.head
} finally {
testBookFile.delete()
}
}
"LoadWorkbook" should {
"rows have size 4" in {
targetWorksheet.rows must have size (4)
}
"Acell have size 12" in {
targetWorksheet.rows.toList.map { _.cells.size }.sum === 12
}
"contains [A1...C4]" in {
val expect = Set("A1", "A2", "A3", "A4", "B1", "B2", "B3", "B4", "C1", "C2", "C3", "C4")
val actual =
for (
row <- targetWorksheet.rows;
StringCell(_, cell) <- row.cells
) yield cell
actual === expect
}
}
} |
using System;
using System.ComponentModel;
using System.Drawing;
using System.Windows.Forms;
using System.Collections.Generic;
namespace NuiEngine.NuiControl
{
<summary></summary>
public class <API key> : Component, <API key>, IDisposable {
private IGlossPainter gloss;
private <API key>.<API key> type;
private Image img;
private Color OffLit = Color.FromArgb(49, 69, 74);
private Pen pOffLit; // = new Pen(new SolidBrush(OffLit),1f);
private Color OffLitTop = Color.FromArgb(66, 85, 90);
private Pen pOffLitTop; // = new Pen(new SolidBrush(OffLitTop),1f);
private Color OffLitBot = Color.FromArgb(24, 48, 49);
private Pen pOffLitBot; // = new Pen(new SolidBrush(OffLitBot),1f);
private Color OffMid = Color.FromArgb(24, 48, 49);
private Pen pOffMid; // = new Pen(new SolidBrush(OffMid),1f);
private Color OffMidTop = Color.FromArgb(24, 48, 49);
private Pen pOffMidTop; // = new Pen(new SolidBrush(OffMidTop),1f);
private Color OffMidBot = Color.FromArgb(8, 28, 24);
private Pen pOffMidBot; // = new Pen(new SolidBrush(OffMidBot),1f);
private Color OffDrk = Color.FromArgb(0, 24, 24);
private Pen pOffDrk; // = new Pen(new SolidBrush(OffDrk),1f);
private Color OffDrkTop = Color.FromArgb(8, 28, 24);
private Pen pOffDrkTop; // = new Pen(new SolidBrush(OffDrkTop),1f);
private Color OffDrkBot = Color.FromArgb(0, 16, 16);
private Pen pOffDrkBot; // = new Pen(new SolidBrush(OffDrkBot),1f);
private EventHandler onPropertiesChanged;
<summary></summary>
public event EventHandler PropertiesChanged {
add {
if (onPropertiesChanged != null) {
foreach (Delegate d in onPropertiesChanged.GetInvocationList()) {
if (object.ReferenceEquals(d, value)) { return; }
}
}
onPropertiesChanged = (EventHandler)Delegate.Combine(onPropertiesChanged, value);
}
remove { onPropertiesChanged = (EventHandler)Delegate.Remove(onPropertiesChanged, value); }
}
private void FireChange() {
if (onPropertiesChanged != null) { onPropertiesChanged(this, EventArgs.Empty); }
}
<summary></summary>
<param name="sender"></param>
<param name="e"></param>
protected virtual void <API key>(object sender, EventArgs e) {
FireChange();
}
<summary></summary>
[Category("Painters"), Description("Gets or sets the chain of gloss painters"), Browsable(true)]
public IGlossPainter GlossPainter {
get { return this.gloss; }
set {
this.gloss = value;
if (this.gloss != null) { this.gloss.PropertiesChanged += new EventHandler(<API key>); }
FireChange();
}
}
<summary></summary>
[Category("Appearance"), Description("Gets or sets the type of FruityLoops progress style"), Browsable(true)]
public <API key>.<API key> FruityType {
get { return type; }
set {
type = value;
if (type == <API key>.<API key>.DoubleLayer) {
OffLit = Color.FromArgb(49, 69, 74);
pOffLit = new Pen(new SolidBrush(OffLit), 1f);
OffLitTop = Color.FromArgb(57, 77, 82);
pOffLitTop = new Pen(new SolidBrush(OffLitTop), 1f);
OffLitBot = Color.FromArgb(24, 48, 49);
pOffLitBot = new Pen(new SolidBrush(OffLitBot), 1f);
OffDrk = Color.FromArgb(24, 48, 49);
pOffDrk = new Pen(new SolidBrush(OffDrk), 1f);
OffDrkTop = Color.FromArgb(16, 40, 41);
pOffDrkTop = new Pen(new SolidBrush(OffDrkTop), 1f);
OffDrkBot = Color.FromArgb(8, 18, 24);
pOffDrkBot = new Pen(new SolidBrush(OffDrkBot), 1f);
} else if (type == <API key>.<API key>.TripleLayer) {
OffLit = Color.FromArgb(49, 69, 74);
pOffLit = new Pen(new SolidBrush(OffLit), 1f);
OffLitTop = Color.FromArgb(66, 85, 90);
pOffLitTop = new Pen(new SolidBrush(OffLitTop), 1f);
OffLitBot = Color.FromArgb(24, 48, 49);
pOffLitBot = new Pen(new SolidBrush(OffLitBot), 1f);
OffMid = Color.FromArgb(24, 48, 49);
pOffMid = new Pen(new SolidBrush(OffMid), 1f);
OffMidTop = Color.FromArgb(24, 48, 49);
pOffMidTop = new Pen(new SolidBrush(OffMidTop), 1f);
OffMidBot = Color.FromArgb(8, 28, 24);
pOffMidBot = new Pen(new SolidBrush(OffMidBot), 1f);
OffDrk = Color.FromArgb(0, 24, 24);
pOffDrk = new Pen(new SolidBrush(OffDrk), 1f);
OffDrkTop = Color.FromArgb(8, 28, 24);
pOffDrkTop = new Pen(new SolidBrush(OffDrkTop), 1f);
OffDrkBot = Color.FromArgb(0, 16, 16);
pOffDrkBot = new Pen(new SolidBrush(OffDrkBot), 1f);
}
FireChange();
}
}
<summary></summary>
<param name="box"></param>
<param name="g"></param>
public void PaintBackground(Rectangle box, Graphics g) {
if (img == null) {
if (type == <API key>.<API key>.DoubleLayer) {
PaintDouble(box, g);
} else if (type == <API key>.<API key>.TripleLayer) {
PaintTriple(box, g);
}
}
g.DrawImageUnscaled(img, 0, 0);
if (gloss != null) {
gloss.PaintGloss(box, g);
}
}
<summary></summary>
<param name="r"></param>
<param name="g"></param>
protected virtual void PaintDouble(Rectangle r, Graphics g) {
bool lite = true;
img = new Bitmap(r.Width + 1, r.Height + 1);
Graphics gi = Graphics.FromImage(img);
for (int i = 1; i < r.Width + 1; i++) {
if (lite) {
gi.DrawLine(pOffLitTop, i, r.Y, i, r.Y + 1);
gi.DrawLine(pOffLitBot, i, r.Height, i, r.Height - 1);
gi.DrawLine(pOffLit, i, r.Y + 1, i, r.Height - 1);
} else {
gi.DrawLine(pOffDrkTop, i, r.Y, i, r.Y + 1);
gi.DrawLine(pOffDrkBot, i, r.Height, i, r.Height - 1);
gi.DrawLine(pOffDrk, i, r.Y + 1, i, r.Height - 1);
}
lite = !lite;
}
gi.Dispose();
}
<summary></summary>
<param name="r"></param>
<param name="g"></param>
protected virtual void PaintTriple(Rectangle r, Graphics g) {
int lite = 1;
img = new Bitmap(r.Width + 1, r.Height + 1);
Graphics gi = Graphics.FromImage(img);
for (int i = 1; i < r.Width + 1; i++) {
if (lite == 2) {
gi.DrawLine(pOffLitTop, i, r.Y, i, r.Y + 1);
gi.DrawLine(pOffLitBot, i, r.Height, i, r.Height - 1);
gi.DrawLine(pOffLit, i, r.Y + 1, i, r.Height - 1);
lite = 0;
} else if (lite == 1) {
gi.DrawLine(pOffMidTop, i, r.Y, i, r.Y + 1);
gi.DrawLine(pOffMidBot, i, r.Height, i, r.Height - 1);
gi.DrawLine(pOffMid, i, r.Y + 1, i, r.Height - 1);
lite = 2;
} else if (lite == 0) {
gi.DrawLine(pOffDrkTop, i, r.Y, i, r.Y + 1);
gi.DrawLine(pOffDrkBot, i, r.Height, i, r.Height - 1);
gi.DrawLine(pOffDrk, i, r.Y + 1, i, r.Height - 1);
lite = 1;
}
}
gi.Dispose();
}
<summary></summary>
public void Resize(Rectangle box) {
img = null;
}
<summary></summary>
protected override void Dispose(bool disposing) {
base.Dispose(disposing);
if (img != null) { img.Dispose(); }
if (pOffLit != null) { pOffLit.Dispose(); }
if (pOffLitTop != null) { pOffLitTop.Dispose(); }
if (pOffLitBot != null) { pOffLitBot.Dispose(); }
if (pOffMid != null) { pOffMid.Dispose(); }
if (pOffMidTop != null) { pOffMidTop.Dispose(); }
if (pOffMidBot != null) { pOffMidBot.Dispose(); }
if (pOffDrk != null) { pOffDrk.Dispose(); }
if (pOffDrkTop != null) { pOffDrkTop.Dispose(); }
if (pOffDrkBot != null) { pOffDrkBot.Dispose(); }
}
}
} |
package com.intellij.execution.console;
import com.intellij.openapi.options.Configurable;
import com.intellij.openapi.options.<API key>;
import com.intellij.openapi.options.<API key>;
import com.intellij.openapi.ui.InputValidatorEx;
import com.intellij.openapi.ui.Messages;
import com.intellij.openapi.ui.Splitter;
import com.intellij.openapi.util.text.StringUtil;
import com.intellij.ui.<API key>;
import org.jetbrains.annotations.Nls;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import javax.swing.*;
import java.awt.*;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
/**
* @author peter
*/
public class <API key> implements <API key>, Configurable.NoScroll {
private JPanel myMainComponent;
private <API key> myPositivePanel;
private <API key> myNegativePanel;
private final <API key> mySettings = <API key>.getSettings();
@Override
public JComponent createComponent() {
if (myMainComponent == null) {
myMainComponent = new JPanel(new BorderLayout());
Splitter splitter = new Splitter(true);
myMainComponent.add(splitter);
myPositivePanel =
new <API key>("Fold console lines that contain", "Enter a substring of a console line you'd like to see folded:");
myNegativePanel = new <API key>("Exceptions", "Enter a substring of a console line you don't want to fold:");
splitter.setFirstComponent(myPositivePanel);
splitter.setSecondComponent(myNegativePanel);
myPositivePanel.getEmptyText().setText("Fold nothing");
myNegativePanel.getEmptyText().setText("No exceptions");
}
return myMainComponent;
}
public void addRule(@Nonnull String rule) {
myPositivePanel.addRule(rule);
}
@Override
public boolean isModified() {
return !Arrays.asList(myNegativePanel.getListItems()).equals(mySettings.getNegativePatterns()) ||
!Arrays.asList(myPositivePanel.getListItems()).equals(mySettings.getPositivePatterns());
}
@Override
public void apply() throws <API key> {
myNegativePanel.applyTo(mySettings.getNegativePatterns());
myPositivePanel.applyTo(mySettings.getPositivePatterns());
}
@Override
public void reset() {
myNegativePanel.resetFrom(mySettings.getNegativePatterns());
myPositivePanel.resetFrom(mySettings.getPositivePatterns());
}
@Override
public void disposeUIResources() {
myMainComponent = null;
myNegativePanel = null;
myPositivePanel = null;
}
@Override
@Nonnull
public String getId() {
return getDisplayName();
}
@Override
public Runnable enableSearch(String option) {
return null;
}
@Override
@Nls
public String getDisplayName() {
return "Console Folding";
}
private static class <API key> extends <API key><String> {
private final String myQuery;
public <API key>(String title, String query) {
super(title, new ArrayList<String>());
myQuery = query;
}
@Override
@Nullable
protected String findItemToAdd() {
return showEditDialog("");
}
@Nullable
private String showEditDialog(final String initialValue) {
return Messages.showInputDialog(this, myQuery, "Folding pattern", Messages.getQuestionIcon(), initialValue, new InputValidatorEx() {
@Override
public boolean checkInput(String inputString) {
return !StringUtil.isEmpty(inputString);
}
@Override
public boolean canClose(String inputString) {
return !StringUtil.isEmpty(inputString);
}
@Nullable
@Override
public String getErrorText(String inputString) {
if (!checkInput(inputString)) {
return "Console folding rule string cannot be empty";
}
return null;
}
});
}
void resetFrom(List<String> patterns) {
myListModel.clear();
for (String pattern : patterns) {
myListModel.addElement(pattern);
}
}
void applyTo(List<String> patterns) {
patterns.clear();
for (Object o : getListItems()) {
patterns.add((String)o);
}
}
public void addRule(String rule) {
addElement(rule);
}
@Override
public void setBounds(int x, int y, int width, int height) {
super.setBounds(x, y, width, height);
}
@Override
protected String editSelectedItem(String item) {
return showEditDialog(item);
}
}
} |
package com.peiliping.web.server.service;
import org.springframework.stereotype.Service;
@Service
public class TestService {
} |
package org.intellij.images.index;
import com.intellij.openapi.vfs.VfsUtil;
import com.intellij.openapi.vfs.VirtualFile;
import com.intellij.testFramework.fixtures.<API key>;
import com.intellij.util.indexing.FileBasedIndex;
import org.intellij.images.util.ImageInfo;
import java.io.IOException;
import static org.junit.Assert.assertNotEquals;
public class ImageInfoIndexTest extends <API key> {
public void <API key>() throws IOException {
VirtualFile file = myFixture.addFileToProject("image.svg", "<svg width='300' height='300' xmlns='http:
long stamp = getIndexStamp();
ImageInfo value = getIndexValue(file);
VfsUtil.saveText(file, "<svg width='500' height='300' xmlns='http:
assertNotEquals(stamp, getIndexStamp());
assertNotEquals(value, getIndexValue(file));
stamp = getIndexStamp();
value = getIndexValue(file);
VfsUtil.saveText(file, "<svg width='500' height='300' xmlns='http:
assertEquals(stamp, getIndexStamp());
assertEquals(value, getIndexValue(file));
}
private long getIndexStamp() {
return FileBasedIndex.getInstance().<API key>(ImageInfoIndex.INDEX_ID, myFixture.getProject());
}
private ImageInfo getIndexValue(VirtualFile file) {
return FileBasedIndex.getInstance().getFileData(ImageInfoIndex.INDEX_ID, file, myFixture.getProject()).values().iterator().next();
}
@Override
protected boolean <API key>() {
return true;
}
} |
package com.oce.springboot.training.d01.s04.controller;
import com.oce.springboot.training.d01.s04.service.ProductService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
/**
* A simple product {@link Controller}, which uses the {@link ProductService} as an {@link Autowired} collaborator
*
* @author bogdan.solga
*/
@Controller
public class ProductController {
private final ProductService productService;
@Autowired
public ProductController(final ProductService productService) {
this.productService = productService;
}
public void displayProducts() {
productService.displayProducts();
}
} |
# AUTOGENERATED FILE
FROM balenalib/artik533s-ubuntu:focal-build
RUN apt-get update \
&& DEBIAN_FRONTEND=noninteractive apt-get install -y --<API key> \
ca-certificates \
\
# .NET Core dependencies
libc6 \
libgcc1 \
libgssapi-krb5-2 \
libicu66 \
libssl1.1 \
libstdc++6 \
zlib1g \ |
function MashupsWindow(title) {
var self = Ti.UI.createWindow({
title:title,
backgroundColor:'white'
});
var isMobileWeb = Titanium.Platform.osname == 'mobileweb',
isTizen = Titanium.Platform.osname === 'tizen';
// create table view data object
var data = [
{title:'Twitter', hasChild:!isMobileWeb, test:'ui/common/mashups/twitter', title_image:'/images/<TwitterConsumerkey>.png', touchEnabled:!isMobileWeb, color:isMobileWeb?"#aaa":"#000"},
{title:'Foursquare', hasChild:!(isMobileWeb || isTizen), test:'ui/common/mashups/foursquare', title_image:'/images/<API key>.png', touchEnabled:!(isMobileWeb || isTizen), color:isMobileWeb?"#aaa":"#000"},
{title:'Facebook', hasChild:!isTizen, test:'ui/common/mashups/facebook_test', touchEnabled: !isTizen},
//{title:'Dojo Mobile', hasChild:true, test:'ui/common/mashups/dojomobile'},
//{title:'Sencha Touch', hasChild:true, test:'ui/common/mashups/senchatouch'},
//{title:'jQuery mobile', hasChild:true, test:'ui/common/mashups/jquery_mobile'},
{title:'YQL', hasChild:true, test:'ui/common/mashups/yql'}
];
//add iphone specific tests
if (Titanium.Platform.name == 'iPhone OS') {
data.push({title:'RSS', hasChild:true, test:'ui/handheld/ios/mashups/rss', barColor:'#b40000'});
}
data.push({title:'SOAP', hasChild:!isMobileWeb, test:'ui/common/mashups/soap', touchEnabled:!isMobileWeb, color:isMobileWeb?"#aaa":"#000"});
// create table view
for (var i = 0; i < data.length; i++ ) {
var d = data[i];
// On Android, if touchEnabled is not set explicitly, its value is undefined.
if (d.touchEnabled !== false) {
d.color = '#000';
}
d.font = {fontWeight:'bold'};
};
var tableview = Titanium.UI.createTableView({
data:data
});
// create table view event listener
tableview.addEventListener('click', function(e) {
if (e.rowData.test) {
var ExampleWindow = require(e.rowData.test),
win = new ExampleWindow({title:e.rowData.title,containingTab:self.containingTab});
if (e.rowData.barColor) {
win.barColor = e.rowData.barColor;
}
if (e.rowData.title_image) {
win.titleImage = e.rowData.title_image;
}
self.containingTab.open(win,{animated:true});
}
});
// add table view to the window
self.add(tableview);
return self;
};
module.exports = MashupsWindow; |
# skyring-vagrant
Vagrant+Docker for setting up Skyring |
var _sunSpiderStartDate = new Date();
function TreeNode(left,right,item){
this.left = left;
this.right = right;
this.item = item;
}
TreeNode.prototype.itemCheck = function(){
if (this.left==null) return this.item;
else return this.item + this.left.itemCheck() - this.right.itemCheck();
}
function bottomUpTree(item,depth){
if (depth>0){
return new TreeNode(
bottomUpTree(2*item-1, depth-1)
,bottomUpTree(2*item, depth-1)
,item
);
}
else {
return new TreeNode(null,null,item);
}
}
var ret;
for ( var n = 4; n <= 7; n += 1 ) {
var minDepth = 4;
var maxDepth = Math.max(minDepth + 2, n);
var stretchDepth = maxDepth + 1;
var check = bottomUpTree(0,stretchDepth).itemCheck();
var longLivedTree = bottomUpTree(0,maxDepth);
for (var depth=minDepth; depth<=maxDepth; depth+=2){
var iterations = 1 << (maxDepth - depth + minDepth);
check = 0;
for (var i=1; i<=iterations; i++){
check += bottomUpTree(i,depth).itemCheck();
check += bottomUpTree(-i,depth).itemCheck();
}
}
ret = longLivedTree.itemCheck();
}
var _sunSpiderInterval = new Date() - _sunSpiderStartDate;
TAJS_dumpValue(_sunSpiderInterval); |
package com.fiberlink.elasticsearch.batchmonitor.model;
public class ClusterHealth {
private String cluster_name;
private String status;
private String timed_out;
private String number_of_nodes;
private String <API key>;
private String <API key>;
private String active_shards;
private String relocating_shards;
private String initializing_shards;
private String unassigned_shards;
public String getCluster_name() {
return cluster_name;
}
public void setCluster_name(String cluster_name) {
this.cluster_name = cluster_name;
}
public String getStatus() {
return status;
}
public void setStatus(String status) {
this.status = status;
}
public String getTimed_out() {
return timed_out;
}
public void setTimed_out(String timed_out) {
this.timed_out = timed_out;
}
public String getNumber_of_nodes() {
return number_of_nodes;
}
public void setNumber_of_nodes(String number_of_nodes) {
this.number_of_nodes = number_of_nodes;
}
public String <API key>() {
return <API key>;
}
public void <API key>(String <API key>) {
this.<API key> = <API key>;
}
public String <API key>() {
return <API key>;
}
public void <API key>(String <API key>) {
this.<API key> = <API key>;
}
public String getActive_shards() {
return active_shards;
}
public void setActive_shards(String active_shards) {
this.active_shards = active_shards;
}
public String <API key>() {
return relocating_shards;
}
public void <API key>(String relocating_shards) {
this.relocating_shards = relocating_shards;
}
public String <API key>() {
return initializing_shards;
}
public void <API key>(String initializing_shards) {
this.initializing_shards = initializing_shards;
}
public String <API key>() {
return unassigned_shards;
}
public void <API key>(String unassigned_shards) {
this.unassigned_shards = unassigned_shards;
}
public void printInfo() {
System.out.println("
System.out.println("Cluster Name: " + cluster_name);
System.out.println("status: " + status);
System.out.println("Timed Out: " + timed_out);
System.out.println("Number of Nodes: " + number_of_nodes);
System.out.println("Number of Data Nodes: " + <API key>);
System.out.println("Active Primary Shards: "+ <API key>);
System.out.println("Active Shards: "+ active_shards);
System.out.println("Relocating Shards:" + relocating_shards);
System.out.println("Initializing Shards: "+ initializing_shards);
System.out.println("Unaasigned Shards: "+ unassigned_shards);
}
} |
package uk.dangrew.nuts.graphics.graph.custom;
import java.time.LocalDateTime;
import javafx.scene.chart.XYChart.Data;
import javafx.scene.chart.XYChart.Series;
import uk.dangrew.nuts.progress.custom.ProgressSeries;
public class GraphModelImpl implements GraphModel {
private final ProgressSeries progressSeries;
private final <API key> seriesModel;
public GraphModelImpl( ProgressSeries progressSeries ) {
this.progressSeries = progressSeries;
this.seriesModel = new <API key>( modelName() );
this.progressSeries.entries().forEach( this::updateDataPoint );
this.progressSeries.values().<API key>().whenProgressAdded( this::<API key> );
this.progressSeries.values().<API key>().whenProgressRemoved( this::<API key> );
this.progressSeries.values().<API key>().whenProgressUpdated( this::<API key> );
this.progressSeries.headers().<API key>().whenProgressAdded( this::<API key> );
this.progressSeries.headers().<API key>().whenProgressRemoved( this::<API key> );
this.progressSeries.headers().<API key>().whenProgressUpdated( this::<API key> );
this.progressSeries.notes().<API key>().whenProgressAdded( this::<API key> );
this.progressSeries.notes().<API key>().whenProgressRemoved( this::<API key> );
this.progressSeries.notes().<API key>().whenProgressUpdated( this::<API key> );
}//End Constructor
@Override public String modelName(){
return progressSeries.properties().nameProperty().get();
}//End Method
@Override public Series< Number, Number > series() {
return seriesModel.chartSeries();
}//End Method
@Override public void show() {
seriesModel.show();
}//End Method
@Override public void hide() {
seriesModel.hide();
}//End Method
private void <API key>( LocalDateTime timestamp, Object value ) {
updateDataPoint( timestamp );
}//End Method
private void updateDataPoint( LocalDateTime timestamp ) {
seriesModel.update(
timestamp,
progressSeries.values().entryFor( timestamp ),
progressSeries.headers().entryFor( timestamp ),
progressSeries.notes().entryFor( timestamp )
);
}//End Method
Data< Number, Number > dataFor( LocalDateTime recordTimestamp ) {
return seriesModel.pointFor( recordTimestamp );
}//End Method
}//End Class |
# -*- coding: utf-8 -*-
from operator import attrgetter
from pyangbind.lib.yangtypes import <API key>
from pyangbind.lib.yangtypes import RestrictedClassType
from pyangbind.lib.yangtypes import TypedListType
from pyangbind.lib.yangtypes import YANGBool
from pyangbind.lib.yangtypes import YANGListType
from pyangbind.lib.yangtypes import YANGDynClass
from pyangbind.lib.yangtypes import ReferenceType
from pyangbind.lib.base import PybindBase
from collections import OrderedDict
from decimal import Decimal
from bitarray import bitarray
import six
# PY3 support of some PY2 keywords (needs improved)
if six.PY3:
import builtins as __builtin__
long = int
elif six.PY2:
import __builtin__
class state(PybindBase):
"""
This class was auto-generated by the PythonClass plugin for PYANG
from YANG module <API key> - based on the path /network-instances/network-instance/mpls/signaling-protocols/rsvp-te/global/graceful-restart/state. Each member element of
the container is represented as a class variable - with a specific
YANG type.
YANG Description: State information associated with
RSVP graceful-restart
"""
__slots__ = (
"_path_helper", "_extmethods", "__enable", "__restart_time", "__recovery_time"
)
_yang_name = "state"
<API key> = "container"
def __init__(self, *args, **kwargs):
self._path_helper = False
self._extmethods = False
self.__enable = YANGDynClass(
base=YANGBool,
default=YANGBool("false"),
is_leaf=True,
yang_name="enable",
parent=self,
path_helper=self._path_helper,
extmethods=self._extmethods,
register_paths=True,
namespace="http://openconfig.net/yang/network-instance",
defining_module="<API key>",
yang_type="boolean",
is_config=False,
)
self.__restart_time = YANGDynClass(
base=RestrictedClassType(
base_type=long,
restriction_dict={"range": ["0..4294967295"]},
int_size=32,
),
is_leaf=True,
yang_name="restart-time",
parent=self,
path_helper=self._path_helper,
extmethods=self._extmethods,
register_paths=True,
namespace="http://openconfig.net/yang/network-instance",
defining_module="<API key>",
yang_type="uint32",
is_config=False,
)
self.__recovery_time = YANGDynClass(
base=RestrictedClassType(
base_type=long,
restriction_dict={"range": ["0..4294967295"]},
int_size=32,
),
is_leaf=True,
yang_name="recovery-time",
parent=self,
path_helper=self._path_helper,
extmethods=self._extmethods,
register_paths=True,
namespace="http://openconfig.net/yang/network-instance",
defining_module="<API key>",
yang_type="uint32",
is_config=False,
)
load = kwargs.pop("load", None)
if args:
if len(args) > 1:
raise TypeError("cannot create a YANG container with >1 argument")
all_attr = True
for e in self._pyangbind_elements:
if not hasattr(args[0], e):
all_attr = False
break
if not all_attr:
raise ValueError("Supplied object did not have the correct attributes")
for e in self._pyangbind_elements:
nobj = getattr(args[0], e)
if nobj._changed() is False:
continue
setmethod = getattr(self, "_set_%s" % e)
if load is None:
setmethod(getattr(args[0], e))
else:
setmethod(getattr(args[0], e), load=load)
def _path(self):
if hasattr(self, "_parent"):
return self._parent._path() + [self._yang_name]
else:
return [
"network-instances",
"network-instance",
"mpls",
"signaling-protocols",
"rsvp-te",
"global",
"graceful-restart",
"state",
]
def _get_enable(self):
"""
Getter method for enable, mapped from YANG variable /network_instances/network_instance/mpls/signaling_protocols/rsvp_te/global/graceful_restart/state/enable (boolean)
YANG Description: Enables graceful restart on the node.
"""
return self.__enable
def _set_enable(self, v, load=False):
"""
Setter method for enable, mapped from YANG variable /network_instances/network_instance/mpls/signaling_protocols/rsvp_te/global/graceful_restart/state/enable (boolean)
If this variable is read-only (config: false) in the
source YANG file, then _set_enable is considered as a private
method. Backends looking to populate this variable should
do so via calling thisObj._set_enable() directly.
YANG Description: Enables graceful restart on the node.
"""
if hasattr(v, "_utype"):
v = v._utype(v)
try:
t = YANGDynClass(
v,
base=YANGBool,
default=YANGBool("false"),
is_leaf=True,
yang_name="enable",
parent=self,
path_helper=self._path_helper,
extmethods=self._extmethods,
register_paths=True,
namespace="http://openconfig.net/yang/network-instance",
defining_module="<API key>",
yang_type="boolean",
is_config=False,
)
except (TypeError, ValueError):
raise ValueError(
{
"error-string": """enable must be of a type compatible with boolean""",
"defined-type": "boolean",
"generated-type": ,
}
)
self.__enable = t
if hasattr(self, "_set"):
self._set()
def _unset_enable(self):
self.__enable = YANGDynClass(
base=YANGBool,
default=YANGBool("false"),
is_leaf=True,
yang_name="enable",
parent=self,
path_helper=self._path_helper,
extmethods=self._extmethods,
register_paths=True,
namespace="http://openconfig.net/yang/network-instance",
defining_module="<API key>",
yang_type="boolean",
is_config=False,
)
def _get_restart_time(self):
"""
Getter method for restart_time, mapped from YANG variable /network_instances/network_instance/mpls/signaling_protocols/rsvp_te/global/graceful_restart/state/restart_time (uint32)
YANG Description: Graceful restart time (seconds).
"""
return self.__restart_time
def _set_restart_time(self, v, load=False):
"""
Setter method for restart_time, mapped from YANG variable /network_instances/network_instance/mpls/signaling_protocols/rsvp_te/global/graceful_restart/state/restart_time (uint32)
If this variable is read-only (config: false) in the
source YANG file, then _set_restart_time is considered as a private
method. Backends looking to populate this variable should
do so via calling thisObj._set_restart_time() directly.
YANG Description: Graceful restart time (seconds).
"""
if hasattr(v, "_utype"):
v = v._utype(v)
try:
t = YANGDynClass(
v,
base=RestrictedClassType(
base_type=long,
restriction_dict={"range": ["0..4294967295"]},
int_size=32,
),
is_leaf=True,
yang_name="restart-time",
parent=self,
path_helper=self._path_helper,
extmethods=self._extmethods,
register_paths=True,
namespace="http://openconfig.net/yang/network-instance",
defining_module="<API key>",
yang_type="uint32",
is_config=False,
)
except (TypeError, ValueError):
raise ValueError(
{
"error-string": """restart_time must be of a type compatible with uint32""",
"defined-type": "uint32",
"generated-type": ,
}
)
self.__restart_time = t
if hasattr(self, "_set"):
self._set()
def _unset_restart_time(self):
self.__restart_time = YANGDynClass(
base=RestrictedClassType(
base_type=long,
restriction_dict={"range": ["0..4294967295"]},
int_size=32,
),
is_leaf=True,
yang_name="restart-time",
parent=self,
path_helper=self._path_helper,
extmethods=self._extmethods,
register_paths=True,
namespace="http://openconfig.net/yang/network-instance",
defining_module="<API key>",
yang_type="uint32",
is_config=False,
)
def _get_recovery_time(self):
"""
Getter method for recovery_time, mapped from YANG variable /network_instances/network_instance/mpls/signaling_protocols/rsvp_te/global/graceful_restart/state/recovery_time (uint32)
YANG Description: RSVP state recovery time
"""
return self.__recovery_time
def _set_recovery_time(self, v, load=False):
"""
Setter method for recovery_time, mapped from YANG variable /network_instances/network_instance/mpls/signaling_protocols/rsvp_te/global/graceful_restart/state/recovery_time (uint32)
If this variable is read-only (config: false) in the
source YANG file, then _set_recovery_time is considered as a private
method. Backends looking to populate this variable should
do so via calling thisObj._set_recovery_time() directly.
YANG Description: RSVP state recovery time
"""
if hasattr(v, "_utype"):
v = v._utype(v)
try:
t = YANGDynClass(
v,
base=RestrictedClassType(
base_type=long,
restriction_dict={"range": ["0..4294967295"]},
int_size=32,
),
is_leaf=True,
yang_name="recovery-time",
parent=self,
path_helper=self._path_helper,
extmethods=self._extmethods,
register_paths=True,
namespace="http://openconfig.net/yang/network-instance",
defining_module="<API key>",
yang_type="uint32",
is_config=False,
)
except (TypeError, ValueError):
raise ValueError(
{
"error-string": """recovery_time must be of a type compatible with uint32""",
"defined-type": "uint32",
"generated-type": ,
}
)
self.__recovery_time = t
if hasattr(self, "_set"):
self._set()
def <API key>(self):
self.__recovery_time = YANGDynClass(
base=RestrictedClassType(
base_type=long,
restriction_dict={"range": ["0..4294967295"]},
int_size=32,
),
is_leaf=True,
yang_name="recovery-time",
parent=self,
path_helper=self._path_helper,
extmethods=self._extmethods,
register_paths=True,
namespace="http://openconfig.net/yang/network-instance",
defining_module="<API key>",
yang_type="uint32",
is_config=False,
)
enable = __builtin__.property(_get_enable)
restart_time = __builtin__.property(_get_restart_time)
recovery_time = __builtin__.property(_get_recovery_time)
_pyangbind_elements = OrderedDict(
[
("enable", enable),
("restart_time", restart_time),
("recovery_time", recovery_time),
]
)
class state(PybindBase):
"""
This class was auto-generated by the PythonClass plugin for PYANG
from YANG module <API key> - based on the path /network-instances/network-instance/mpls/signaling-protocols/rsvp-te/global/graceful-restart/state. Each member element of
the container is represented as a class variable - with a specific
YANG type.
YANG Description: State information associated with
RSVP graceful-restart
"""
__slots__ = (
"_path_helper", "_extmethods", "__enable", "__restart_time", "__recovery_time"
)
_yang_name = "state"
<API key> = "container"
def __init__(self, *args, **kwargs):
self._path_helper = False
self._extmethods = False
self.__enable = YANGDynClass(
base=YANGBool,
default=YANGBool("false"),
is_leaf=True,
yang_name="enable",
parent=self,
path_helper=self._path_helper,
extmethods=self._extmethods,
register_paths=True,
namespace="http://openconfig.net/yang/network-instance",
defining_module="<API key>",
yang_type="boolean",
is_config=False,
)
self.__restart_time = YANGDynClass(
base=RestrictedClassType(
base_type=long,
restriction_dict={"range": ["0..4294967295"]},
int_size=32,
),
is_leaf=True,
yang_name="restart-time",
parent=self,
path_helper=self._path_helper,
extmethods=self._extmethods,
register_paths=True,
namespace="http://openconfig.net/yang/network-instance",
defining_module="<API key>",
yang_type="uint32",
is_config=False,
)
self.__recovery_time = YANGDynClass(
base=RestrictedClassType(
base_type=long,
restriction_dict={"range": ["0..4294967295"]},
int_size=32,
),
is_leaf=True,
yang_name="recovery-time",
parent=self,
path_helper=self._path_helper,
extmethods=self._extmethods,
register_paths=True,
namespace="http://openconfig.net/yang/network-instance",
defining_module="<API key>",
yang_type="uint32",
is_config=False,
)
load = kwargs.pop("load", None)
if args:
if len(args) > 1:
raise TypeError("cannot create a YANG container with >1 argument")
all_attr = True
for e in self._pyangbind_elements:
if not hasattr(args[0], e):
all_attr = False
break
if not all_attr:
raise ValueError("Supplied object did not have the correct attributes")
for e in self._pyangbind_elements:
nobj = getattr(args[0], e)
if nobj._changed() is False:
continue
setmethod = getattr(self, "_set_%s" % e)
if load is None:
setmethod(getattr(args[0], e))
else:
setmethod(getattr(args[0], e), load=load)
def _path(self):
if hasattr(self, "_parent"):
return self._parent._path() + [self._yang_name]
else:
return [
"network-instances",
"network-instance",
"mpls",
"signaling-protocols",
"rsvp-te",
"global",
"graceful-restart",
"state",
]
def _get_enable(self):
"""
Getter method for enable, mapped from YANG variable /network_instances/network_instance/mpls/signaling_protocols/rsvp_te/global/graceful_restart/state/enable (boolean)
YANG Description: Enables graceful restart on the node.
"""
return self.__enable
def _set_enable(self, v, load=False):
"""
Setter method for enable, mapped from YANG variable /network_instances/network_instance/mpls/signaling_protocols/rsvp_te/global/graceful_restart/state/enable (boolean)
If this variable is read-only (config: false) in the
source YANG file, then _set_enable is considered as a private
method. Backends looking to populate this variable should
do so via calling thisObj._set_enable() directly.
YANG Description: Enables graceful restart on the node.
"""
if hasattr(v, "_utype"):
v = v._utype(v)
try:
t = YANGDynClass(
v,
base=YANGBool,
default=YANGBool("false"),
is_leaf=True,
yang_name="enable",
parent=self,
path_helper=self._path_helper,
extmethods=self._extmethods,
register_paths=True,
namespace="http://openconfig.net/yang/network-instance",
defining_module="<API key>",
yang_type="boolean",
is_config=False,
)
except (TypeError, ValueError):
raise ValueError(
{
"error-string": """enable must be of a type compatible with boolean""",
"defined-type": "boolean",
"generated-type": ,
}
)
self.__enable = t
if hasattr(self, "_set"):
self._set()
def _unset_enable(self):
self.__enable = YANGDynClass(
base=YANGBool,
default=YANGBool("false"),
is_leaf=True,
yang_name="enable",
parent=self,
path_helper=self._path_helper,
extmethods=self._extmethods,
register_paths=True,
namespace="http://openconfig.net/yang/network-instance",
defining_module="<API key>",
yang_type="boolean",
is_config=False,
)
def _get_restart_time(self):
"""
Getter method for restart_time, mapped from YANG variable /network_instances/network_instance/mpls/signaling_protocols/rsvp_te/global/graceful_restart/state/restart_time (uint32)
YANG Description: Graceful restart time (seconds).
"""
return self.__restart_time
def _set_restart_time(self, v, load=False):
"""
Setter method for restart_time, mapped from YANG variable /network_instances/network_instance/mpls/signaling_protocols/rsvp_te/global/graceful_restart/state/restart_time (uint32)
If this variable is read-only (config: false) in the
source YANG file, then _set_restart_time is considered as a private
method. Backends looking to populate this variable should
do so via calling thisObj._set_restart_time() directly.
YANG Description: Graceful restart time (seconds).
"""
if hasattr(v, "_utype"):
v = v._utype(v)
try:
t = YANGDynClass(
v,
base=RestrictedClassType(
base_type=long,
restriction_dict={"range": ["0..4294967295"]},
int_size=32,
),
is_leaf=True,
yang_name="restart-time",
parent=self,
path_helper=self._path_helper,
extmethods=self._extmethods,
register_paths=True,
namespace="http://openconfig.net/yang/network-instance",
defining_module="<API key>",
yang_type="uint32",
is_config=False,
)
except (TypeError, ValueError):
raise ValueError(
{
"error-string": """restart_time must be of a type compatible with uint32""",
"defined-type": "uint32",
"generated-type": ,
}
)
self.__restart_time = t
if hasattr(self, "_set"):
self._set()
def _unset_restart_time(self):
self.__restart_time = YANGDynClass(
base=RestrictedClassType(
base_type=long,
restriction_dict={"range": ["0..4294967295"]},
int_size=32,
),
is_leaf=True,
yang_name="restart-time",
parent=self,
path_helper=self._path_helper,
extmethods=self._extmethods,
register_paths=True,
namespace="http://openconfig.net/yang/network-instance",
defining_module="<API key>",
yang_type="uint32",
is_config=False,
)
def _get_recovery_time(self):
"""
Getter method for recovery_time, mapped from YANG variable /network_instances/network_instance/mpls/signaling_protocols/rsvp_te/global/graceful_restart/state/recovery_time (uint32)
YANG Description: RSVP state recovery time
"""
return self.__recovery_time
def _set_recovery_time(self, v, load=False):
"""
Setter method for recovery_time, mapped from YANG variable /network_instances/network_instance/mpls/signaling_protocols/rsvp_te/global/graceful_restart/state/recovery_time (uint32)
If this variable is read-only (config: false) in the
source YANG file, then _set_recovery_time is considered as a private
method. Backends looking to populate this variable should
do so via calling thisObj._set_recovery_time() directly.
YANG Description: RSVP state recovery time
"""
if hasattr(v, "_utype"):
v = v._utype(v)
try:
t = YANGDynClass(
v,
base=RestrictedClassType(
base_type=long,
restriction_dict={"range": ["0..4294967295"]},
int_size=32,
),
is_leaf=True,
yang_name="recovery-time",
parent=self,
path_helper=self._path_helper,
extmethods=self._extmethods,
register_paths=True,
namespace="http://openconfig.net/yang/network-instance",
defining_module="<API key>",
yang_type="uint32",
is_config=False,
)
except (TypeError, ValueError):
raise ValueError(
{
"error-string": """recovery_time must be of a type compatible with uint32""",
"defined-type": "uint32",
"generated-type": ,
}
)
self.__recovery_time = t
if hasattr(self, "_set"):
self._set()
def <API key>(self):
self.__recovery_time = YANGDynClass(
base=RestrictedClassType(
base_type=long,
restriction_dict={"range": ["0..4294967295"]},
int_size=32,
),
is_leaf=True,
yang_name="recovery-time",
parent=self,
path_helper=self._path_helper,
extmethods=self._extmethods,
register_paths=True,
namespace="http://openconfig.net/yang/network-instance",
defining_module="<API key>",
yang_type="uint32",
is_config=False,
)
enable = __builtin__.property(_get_enable)
restart_time = __builtin__.property(_get_restart_time)
recovery_time = __builtin__.property(_get_recovery_time)
_pyangbind_elements = OrderedDict(
[
("enable", enable),
("restart_time", restart_time),
("recovery_time", recovery_time),
]
) |
// Package infomaniak implements a DNS provider for solving the DNS-01 challenge using Infomaniak DNS.
package infomaniak
import (
"errors"
"fmt"
"net/http"
"strings"
"sync"
"time"
"github.com/go-acme/lego/v4/challenge/dns01"
"github.com/go-acme/lego/v4/platform/config/env"
"github.com/go-acme/lego/v4/providers/dns/infomaniak/internal"
)
// Environment variables names.
const (
envNamespace = "INFOMANIAK_"
EnvEndpoint = envNamespace + "ENDPOINT"
EnvAccessToken = envNamespace + "ACCESS_TOKEN"
EnvTTL = envNamespace + "TTL"
<API key> = envNamespace + "PROPAGATION_TIMEOUT"
EnvPollingInterval = envNamespace + "POLLING_INTERVAL"
EnvHTTPTimeout = envNamespace + "HTTP_TIMEOUT"
)
const defaultBaseURL = "https://api.infomaniak.com"
// Config is used to configure the creation of the DNSProvider.
type Config struct {
APIEndpoint string
AccessToken string
PropagationTimeout time.Duration
PollingInterval time.Duration
TTL int
HTTPClient *http.Client
}
// NewDefaultConfig returns a default configuration for the DNSProvider.
func NewDefaultConfig() *Config {
return &Config{
APIEndpoint: env.GetOrDefaultString(EnvEndpoint, defaultBaseURL),
TTL: env.GetOrDefaultInt(EnvTTL, 7200),
PropagationTimeout: env.GetOrDefaultSecond(<API key>, dns01.<API key>),
PollingInterval: env.GetOrDefaultSecond(EnvPollingInterval, dns01.<API key>),
HTTPClient: &http.Client{
Timeout: env.GetOrDefaultSecond(EnvHTTPTimeout, 30*time.Second),
},
}
}
// DNSProvider implements the challenge.Provider interface.
type DNSProvider struct {
config *Config
client *internal.Client
recordIDs map[string]string
recordIDsMu sync.Mutex
domainIDs map[string]uint64
domainIDsMu sync.Mutex
}
// NewDNSProvider returns a DNSProvider instance configured for Infomaniak.
// Credentials must be passed in the environment variables: <API key>.
func NewDNSProvider() (*DNSProvider, error) {
values, err := env.Get(EnvAccessToken)
if err != nil {
return nil, fmt.Errorf("infomaniak: %w", err)
}
config := NewDefaultConfig()
config.AccessToken = values[EnvAccessToken]
return <API key>(config)
}
// <API key> return a DNSProvider instance configured for Infomaniak.
func <API key>(config *Config) (*DNSProvider, error) {
if config == nil {
return nil, errors.New("infomaniak: the configuration of the DNS provider is nil")
}
if config.APIEndpoint == "" {
return nil, errors.New("infomaniak: missing API endpoint")
}
if config.AccessToken == "" {
return nil, errors.New("infomaniak: missing access token")
}
client := internal.New(config.APIEndpoint, config.AccessToken)
if config.HTTPClient != nil {
client.HTTPClient = config.HTTPClient
}
return &DNSProvider{
config: config,
client: client,
recordIDs: make(map[string]string),
domainIDs: make(map[string]uint64),
}, nil
}
// Present creates a TXT record to fulfill the dns-01 challenge.
func (d *DNSProvider) Present(domain, token, keyAuth string) error {
fqdn, value := dns01.GetRecord(domain, keyAuth)
authZone, err := getZone(fqdn)
if err != nil {
return fmt.Errorf("infomaniak: %w", err)
}
ikDomain, err := d.client.GetDomainByName(domain)
if err != nil {
return fmt.Errorf("infomaniak: could not get domain %q: %w", domain, err)
}
d.domainIDsMu.Lock()
d.domainIDs[token] = ikDomain.ID
d.domainIDsMu.Unlock()
record := internal.Record{
Source: extractRecordName(fqdn, authZone),
Target: value,
Type: "TXT",
TTL: d.config.TTL,
}
recordID, err := d.client.CreateDNSRecord(ikDomain, record)
if err != nil {
return fmt.Errorf("infomaniak: error when calling api to create DNS record: %w", err)
}
d.recordIDsMu.Lock()
d.recordIDs[token] = recordID
d.recordIDsMu.Unlock()
return nil
}
// CleanUp removes the TXT record matching the specified parameters.
func (d *DNSProvider) CleanUp(domain, token, keyAuth string) error {
fqdn, _ := dns01.GetRecord(domain, keyAuth)
d.recordIDsMu.Lock()
recordID, ok := d.recordIDs[token]
d.recordIDsMu.Unlock()
if !ok {
return fmt.Errorf("infomaniak: unknown record ID for '%s'", fqdn)
}
d.domainIDsMu.Lock()
domainID, ok := d.domainIDs[token]
d.domainIDsMu.Unlock()
if !ok {
return fmt.Errorf("infomaniak: unknown domain ID for '%s'", fqdn)
}
err := d.client.DeleteDNSRecord(domainID, recordID)
if err != nil {
return fmt.Errorf("infomaniak: could not delete record %q: %w", domain, err)
}
// Delete record ID from map
d.recordIDsMu.Lock()
delete(d.recordIDs, token)
d.recordIDsMu.Unlock()
// Delete domain ID from map
d.domainIDsMu.Lock()
delete(d.domainIDs, token)
d.domainIDsMu.Unlock()
return nil
}
// Timeout returns the timeout and interval to use when checking for DNS propagation.
// Adjusting here to cope with spikes in propagation times.
func (d *DNSProvider) Timeout() (timeout, interval time.Duration) {
return d.config.PropagationTimeout, d.config.PollingInterval
}
func getZone(fqdn string) (string, error) {
authZone, err := dns01.FindZoneByFqdn(fqdn)
if err != nil {
return "", err
}
return dns01.UnFqdn(authZone), nil
}
func extractRecordName(fqdn, zone string) string {
name := dns01.UnFqdn(fqdn)
if idx := strings.Index(name, "."+zone); idx != -1 {
return name[:idx]
}
return name
} |
package com.booksharer.view;
import android.content.Context;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.TextView;
import com.booksharer.R;
import com.booksharer.entity.BookCommunityLab;
import com.booksharer.entity.BookInfo;
import com.booksharer.entity.BookInfoLab;
import com.booksharer.util.MyApplication;
import com.booksharer.util.OkHttpUtil;
import java.util.Locale;
public class <API key> extends BaseAdapter<BookInfo> {
private Context mContext;
public <API key>(Context context) {
mContext = context;
}
@Override
public RecyclerView.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
View view = LayoutInflater.from(parent.getContext())
.inflate(R.layout.<API key>, parent, false);
<API key>.ViewHolder holder = new <API key>.ViewHolder(view);
return holder;
}
@Override
public void onBindViewHolder(RecyclerView.ViewHolder holder, int position) {
((<API key>.ViewHolder) holder).bindBook(BookInfoLab.get(MyApplication.getContext()).getmBookResults().get(position));
}
public class ViewHolder extends RecyclerView.ViewHolder implements View.OnClickListener{
View mBookView;
TextView mBookName,mBookAuthor,mBookPublisher;
ImageView mBookPic;
public ViewHolder(View itemView) {
super(itemView);
mBookView = itemView;
mBookView.setOnClickListener(this);
mBookName = (TextView) itemView.findViewById(R.id.book_name);
mBookAuthor = (TextView) itemView.findViewById(R.id.author_name);
mBookPublisher = (TextView) itemView.findViewById(R.id.publisher);
mBookPic = (ImageView) itemView.findViewById(R.id.book_pic);
}
@Override
public void onClick(View v) {
}
public void bindBook(BookInfo book) {
mBookName.setText(book.getBookName());
mBookAuthor.setText(book.getAuthor());
mBookPublisher.setText(book.getPublisher());
// OkHttpUtil.downloadBookImage(book.getBookPic());
// Bitmap bm = BitmapFactory.decodeFile("/sdcard/shuquan/"+book.getBookPic());
// mBookPic.setImageBitmap(bm);
}
}
} |
package test.model;
import javastrava.model.<API key>;
import test.utils.BeanTest;
/**
* Bean test for {@link <API key>}
*
* @author Dan Shannon
*
*/
public class <API key> extends BeanTest<<API key>> {
@Override
protected Class<<API key>> getClassUnderTest() {
return <API key>.class;
}
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.