answer stringlengths 15 1.25M |
|---|
#ifndef <API key>
#define <API key>
#define <API key> 1024
typedef pid_t nc_pid_t;
typedef struct {
int command;
nc_pid_t pid;
int slot;
int fd;
int len;
} nc_channel_msg_t;
/*
typedef struct {
int command;
nc_pid_t pid;
} nc_channel_msg_t;*/
int nc_write_channel(int s, nc_channel_msg_t *message, size_t size);
int nc_read_channel(int s, nc_channel_msg_t *message, size_t size);
void nc_close_channel(int *fd);
void <API key>(int signo);
#endif /* <API key> */ |
import json
import pytest
import requests
from globus_sdk.transfer.paging import PaginatedResource
from globus_sdk.transfer.response import <API key>
N = 25
class PagingSimulator:
def __init__(self, n):
self.n = n # the number of simulated items
def simulate_get(
self, path, params=None, headers=None, response_class=None, retry_401=True
):
"""
Simulates a paginated response from a Globus API get supporting limit,
offset, and has next page
"""
offset = params["offset"]
limit = params["limit"]
data = {} # dict that will be treated as the json data of a response
data["offset"] = offset
data["limit"] = limit
# fill data field
data["DATA"] = []
for i in range(offset, min(self.n, offset + limit)):
data["DATA"].append({"value": i})
# fill has_next_page field
data["has_next_page"] = (offset + limit) < self.n
# make the simulated response
response = requests.Response()
response._content = json.dumps(data).encode("utf-8")
response.headers["Content-Type"] = "application/json"
return <API key>(response)
@pytest.fixture
def paging_simulator():
return PagingSimulator(N)
def test_data(paging_simulator):
"""
Gets data from PaginatedResource objects based on paging_simulator,
confirms data is the expected range of numbers
tests num_results < n, num_results > n, num_results = None,
"""
# num_results < n
less_results = N - 7
pr_less = PaginatedResource(
paging_simulator.simulate_get,
"path",
{"params": {}},
<API key>=10,
num_results=less_results,
)
# confirm results
for item, expected in zip(pr_less.data, range(less_results)):
assert item["value"] == expected
assert pr_less.num_results_fetched == less_results
# num_results > n
more_results = N + 7
pr_more = PaginatedResource(
paging_simulator.simulate_get,
"path",
{"params": {}},
<API key>=10,
num_results=more_results,
)
# confirm results
for item, expected in zip(pr_more.data, range(N)):
assert item["value"] == expected
assert pr_more.num_results_fetched == N
# num_results = None (fetch all)
pr_none = PaginatedResource(
paging_simulator.simulate_get,
"path",
{"params": {}},
<API key>=10,
num_results=None,
)
# confirm results
for item, expected in zip(pr_none.data, range(N)):
assert item["value"] == expected
assert pr_none.num_results_fetched == N
# limit < N should show more results available
pr_more_available = PaginatedResource(
paging_simulator.simulate_get,
"path",
{"params": {}},
<API key>=10,
num_results=5,
)
# confirm results
for item, expected in zip(pr_more_available.data, range(N)):
assert item["value"] == expected
assert pr_more_available.<API key> is True
# limit > N should show no more results available
<API key> = PaginatedResource(
paging_simulator.simulate_get,
"path",
{"params": {}},
<API key>=10,
num_results=N,
)
# confirm results
for item, expected in zip(pr_more_available.data, range(N)):
assert item["value"] == expected
assert <API key>.<API key> is False
def test_iterable_func(paging_simulator):
"""
Gets the generator from a PaginatedResource's iterable_func,
sanity checks usage
"""
pr = PaginatedResource(
paging_simulator.simulate_get,
"path",
{"params": {}},
<API key>=10,
num_results=None,
)
generator = pr.iterable_func()
for i in range(N):
assert next(generator)["value"] == i
with pytest.raises(StopIteration):
next(generator) |
<!DOCTYPE html>
<html xmlns="http:
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<link rel="SHORTCUT ICON" href="../../../../../img/clover.ico" />
<link rel="stylesheet" href="../../../../../aui/css/aui.min.css" media="all"/>
<link rel="stylesheet" href="../../../../../aui/css/aui-experimental.min.css" media="all"/>
<!--[if IE 9]><link rel="stylesheet" href="../../../../../aui/css/aui-ie9.min.css" media="all"/><![endif]-->
<style type="text/css" media="all">
@import url('../../../../../style.css');
@import url('../../../../../tree.css');
</style>
<script src="../../../../../jquery-1.8.3.min.js" type="text/javascript"></script>
<script src="../../../../../aui/js/aui.min.js" type="text/javascript"></script>
<script src="../../../../../aui/js/aui-experimental.min.js" type="text/javascript"></script>
<script src="../../../../../aui/js/aui-soy.min.js" type="text/javascript"></script>
<script src="../../../../../package-nodes-tree.js" type="text/javascript"></script>
<script src="../../../../../clover-tree.js" type="text/javascript"></script>
<script src="../../../../../clover.js" type="text/javascript"></script>
<script src="../../../../../clover-descriptions.js" type="text/javascript"></script>
<script src="../../../../../cloud.js" type="text/javascript"></script>
<title>ABA Route Transit Number Validator 1.0.1-SNAPSHOT</title>
</head>
<body>
<div id="page">
<header id="header" role="banner">
<nav class="aui-header <API key>" role="navigation">
<div class="aui-header-inner">
<div class="aui-header-primary">
<h1 id="logo" class="aui-header-logo <API key>">
<a href="http://openclover.org" title="Visit OpenClover home page"><span class="<API key>">OpenClover</span></a>
</h1>
</div>
<div class="<API key>">
<ul class="aui-nav">
<li id="system-help-menu">
<a class="aui-nav-link" title="Open online documentation" target="_blank"
href="http://openclover.org/documentation">
<span class="aui-icon aui-icon-small aui-iconfont-help"> Help</span>
</a>
</li>
</ul>
</div>
</div>
</nav>
</header>
<div class="aui-page-panel">
<div class="<API key>">
<div class="aui-page-panel-nav <API key>">
<div class="<API key>" style="margin-bottom: 20px;">
<div class="<API key>">
<a href="http://cardatechnologies.com" target="_top">
<div class="aui-avatar aui-avatar-large aui-avatar-project">
<div class="aui-avatar-inner">
<img src="../../../../../img/clover_logo_large.png" alt="Clover icon"/>
</div>
</div>
</a>
</div>
<div class="<API key>" >
<h1>
<a href="http://cardatechnologies.com" target="_top">
ABA Route Transit Number Validator 1.0.1-SNAPSHOT
</a>
</h1>
</div>
</div>
<nav class="aui-navgroup <API key>">
<div class="aui-navgroup-inner">
<ul class="aui-nav">
<li class="">
<a href="../../../../../dashboard.html">Project overview</a>
</li>
</ul>
<div class="aui-nav-heading <API key>">
<strong>Packages</strong>
</div>
<div class="aui-nav project-packages">
<form method="get" action="#" class="aui <API key>">
<input type="text" autocomplete="off" class="package-filter text"
placeholder="Type to filter packages..." name="package-filter" id="package-filter"
title="Start typing package name (or part of the name) to search through the tree. Use arrow keys and the Enter key to navigate."/>
</form>
<p class="<API key> hidden">
<small>No results found.</small>
</p>
<div class="<API key>" data-root-relative="../../../../../" data-package-name="com.cardatechnologies.utils.validators.abaroutevalidator">
<div class="<API key>"></div>
<div class="<API key>"></div>
</div>
</div>
</div>
</nav> </div>
<section class="<API key>">
<div class="<API key>">
<div class="<API key>"><ol class="aui-nav aui-nav-breadcrumbs">
<li><a href="../../../../../dashboard.html"> Project Clover database Sat Aug 7 2021 12:29:33 MDT</a></li>
<li><a href="test-pkg-summary.html">Package com.cardatechnologies.utils.validators.abaroutevalidator</a></li>
<li><a href="<API key>.html">Class <API key></a></li>
</ol></div>
<h1 class="aui-h2-clover">
Test <API key>
</h1>
<table class="aui">
<thead>
<tr>
<th>Test</th>
<th><label title="The test result. Either a Pass, Fail or Error.">Status</label></th>
<th><label title="When the test execution was started">Start time</label></th>
<th><label title="The total time in seconds taken to run this test.">Time (seconds)</label></th>
<th><label title="A failure or error message if the test is not successful.">Message</label></th>
</tr>
</thead>
<tbody>
<tr>
<td>
<a href="../../../../../com/cardatechnologies/utils/validators/abaroutevalidator/<API key>.html?line=35669#src-35669" ><API key></a>
</td>
<td>
<span class="sortValue">1</span><span class="aui-lozenge aui-lozenge-success">PASS</span>
</td>
<td>
7 Aug 12:44:42
</td>
<td>
0.001 </td>
<td>
<div></div>
<div class="errorMessage"></div>
</td>
</tr>
</tbody>
</table>
<div> </div>
<table class="aui aui-table-sortable">
<thead>
<tr>
<th style="white-space:nowrap;"><label title="A class that was directly hit by this test.">Target Class</label></th>
<th colspan="4"><label title="The percentage of coverage contributed by each single test.">Coverage contributed by</label> <API key></th>
</tr>
</thead>
<tbody>
<tr>
<td>
<span class="sortValue">com.cardatechnologies.utils.validators.abaroutevalidator.AbaRouteValidator</span>
  <a href="../../../../../com/cardatechnologies/utils/validators/abaroutevalidator/AbaRouteValidator.html?id=11378#AbaRouteValidator" title="AbaRouteValidator" name="sl-47">com.cardatechnologies.utils.validators.abaroutevalidator.AbaRouteValidator</a>
</td>
<td>
<span class="sortValue">0.7352941</span>73.5%
</td>
<td class="align-middle" style="width: 100%" colspan="3">
<div>
<div title="73.5% Covered" style="min-width:40px;" class="barNegative contribBarNegative contribBarNegative"><div class="barPositive contribBarPositive contribBarPositive" style="width:73.5%"></div></div></div> </td>
</tr>
</tbody>
</table>
</div> <!-- class="<API key>" -->
<footer id="footer" role="contentinfo">
<section class="footer-body">
<ul>
<li>
Report generated by <a target="_new" href="http://openclover.org">OpenClover</a> v 4.4.1
on Sat Aug 7 2021 12:49:26 MDT using coverage data from Sat Aug 7 2021 12:47:23 MDT.
</li>
</ul>
<ul>
<li>OpenClover is free and open-source software. </li>
</ul>
</section>
</footer> </section> <!-- class="<API key>" -->
</div> <!-- class="<API key>" -->
</div> <!-- class="aui-page-panel" -->
</div> <!-- id="page" -->
</body>
</html> |
package org.cucina.sample.engine.client.app;
import org.cucina.engine.client.ProcessEngineFacade;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.Assert;
import javax.transaction.Transactional;
import java.util.Collection;
import java.util.Map;
/**
* @author vlevine
*/
@Service
public class ClientServiceImpl
implements ClientService {
private static final Logger LOG = LoggerFactory.getLogger(ClientServiceImpl.class);
@Autowired
private ItemRepository itemRepository;
@Autowired
private ProcessEngineFacade processEngineFacade;
/**
* @return .
*/
@Override
@Transactional
public Item create() {
Item item = new Item();
itemRepository.save(item);
if (LOG.isDebugEnabled()) {
LOG.debug("Starting for Item " + item.getId());
}
Assert.isTrue(processEngineFacade.startWorkflow(Item.class.getSimpleName(),
item.getId().toString(), null), "Failed to start process");
return item;
}
@Override
public Collection<Map<String, String>> loadTransitionInfo(String processName) {
return processEngineFacade.loadTransitionInfo(processName);
}
} |
using PeNet.FileParser;
namespace PeNet.Header.Net.MetaDataTables
{
public class TypeSpec : AbstractTable
{
public TypeSpec(IRawFile peFile, long offset, HeapSizes heapSizes, IndexSize indexSizes)
: base(peFile, offset, heapSizes, indexSizes)
{
Signature = ReadSize(HeapSizes.Blob);
}
public uint Signature {get;}
}
} |
using EmpMan.Data.Infrastructure;
using EmpMan.Model.Models;
namespace EmpMan.Data.Repositories
{
public interface <API key> : IRepository<ProductTag>
{
}
public class <API key> : RepositoryBase<ProductTag>, <API key>
{
public <API key>(IDbFactory dbFactory) : base(dbFactory)
{
}
}
} |
#!/bin/bash
if [ "$#" -ne 2 ]; then
echo "Usage: ./create_cluster.sh bucket-name region"
exit
fi
PROJECT=$(gcloud config get-value project)
BUCKET=$1
REGION=$2
INSTALL=gs://$BUCKET/flights/dataproc/install_on_cluster.sh
# upload install file
sed "s/CHANGE_TO_USER_NAME/$USER/g" install_on_cluster.sh > /tmp/install_on_cluster.sh
gsutil cp /tmp/install_on_cluster.sh $INSTALL
# create cluster
gcloud dataproc clusters create \
--num-workers=2 \
--scopes=cloud-platform \
--worker-machine-type=n1-standard-4 \
--master-machine-type=n1-standard-4 \
--image-version=1.4 \
--<API key> \
--optional-components=ANACONDA,JUPYTER \
--region=$REGION \
--<API key>=$INSTALL \
ch6cluster |
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using SuperSocket.SocketBase.Command;
using SuperSocket.SocketBase;
using SuperSocket.SocketBase.Protocol;
namespace SuperSocket.QuickStart.CommandFilter
{
[<API key>]
public class QUERY : StringCommandBase
{
public override void ExecuteCommand(AppSession session, StringRequestInfo commandData)
{
//Your code
}
}
} |
package com.qiantao.coordinatormenudemo;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.ImageView;
import com.qiantao.coordinatormenu.CoordinatorMenu;
public class MainActivity extends AppCompatActivity {
private ImageView mHeadIv;
private CoordinatorMenu mCoordinatorMenu;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
mHeadIv = (ImageView) findViewById(R.id.iv_head);
mCoordinatorMenu = (CoordinatorMenu) findViewById(R.id.menu);
mHeadIv.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
if (mCoordinatorMenu.isOpened()) {
mCoordinatorMenu.closeMenu();
} else {
mCoordinatorMenu.openMenu();
}
}
});
}
@Override
public void onBackPressed() {
if (mCoordinatorMenu.isOpened()) {
mCoordinatorMenu.closeMenu();
} else {
super.onBackPressed();
}
}
} |
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using SharpChan.Extensions.Common;
using SharpChan.Reflection;
using System.IO;
namespace <API key>.CommandLine {
<summary>
Class represents command line arguments for generator.
</summary>
class GeneratorArguments {
<summary>
Full path to assembly that will be translated
to C++.
</summary>
public string Assembly { get; private set; }
<summary>
Full path to output directory that will contain
generated files.
</summary>
public string OutputDirectory { get; private set; }
public GeneratorArguments(string[] args) {
if (args.IsNull())
throw new <API key>(Name.ForParameter(() => args));
<API key>(args);
}
private void <API key>(string[] args) {
if (args.Length != 2)
throw new <API key>("Invalid number of command line arguments!");
SetAssemblyName(args[0]);
SetOutputDirectory(args[1]);
}
private void SetOutputDirectory(string outputDirectory) {
CheckFileSystemPath(ref outputDirectory, "Invalid output directory name");
OutputDirectory = outputDirectory;
}
private void SetAssemblyName(string assembly) {
CheckFileSystemPath(ref assembly, "Invalid assembly name");
Assembly = assembly;
}
<summary>
Checks if given path is valid (non empty,
doesn't contains invalid characters, etc.). On invalid path throws
<see cref="T:<API key>"/> with specified message.
</summary>
<param name="path">Path to check, on return this will be changed
to FULL file system path.</param>
<param name="errorMessage"></param>
private void CheckFileSystemPath(ref string path, string errorMessage) {
bool invalid = String.IsNullOrWhiteSpace(path);
try {
if (!invalid)
path = Path.GetFullPath(path);
}
catch (Exception) {
invalid = true;
}
if (invalid)
throw new <API key>(errorMessage);
}
}
} |
package org.eclipse.jetty.servlet.listener;
import javax.servlet.ServletContextEvent;
import javax.servlet.<API key>;
/**
* IntrospectorCleaner
*
* Cleans a static cache of Methods held by java.beans.Introspector
* class when a context is undeployed.
*
* @see java.beans.Introspector
*/
public class IntrospectorCleaner implements <API key>
{
public void contextInitialized(ServletContextEvent sce)
{
}
public void contextDestroyed(ServletContextEvent sce)
{
java.beans.Introspector.flushCaches();
}
} |
package com.linkedin.thirdeye.detector.driver;
import static com.linkedin.thirdeye.detector.driver.<API key>.<API key>;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.Date;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import java.util.Queue;
import java.util.concurrent.TimeUnit;
import org.apache.commons.lang.StringUtils;
import org.apache.commons.lang.exception.ExceptionUtils;
import org.apache.commons.mail.EmailException;
import org.hibernate.Session;
import org.hibernate.SessionFactory;
import org.hibernate.Transaction;
import org.hibernate.context.internal.<API key>;
import org.joda.time.DateTime;
import org.joda.time.format.ISODateTimeFormat;
import org.quartz.Job;
import org.quartz.JobExecutionContext;
import org.quartz.<API key>;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.codahale.metrics.Histogram;
import com.codahale.metrics.MetricRegistry;
import com.google.common.collect.ImmutableList;
import com.linkedin.thirdeye.api.CollectionSchema;
import com.linkedin.thirdeye.api.DimensionKey;
import com.linkedin.thirdeye.api.MetricTimeSeries;
import com.linkedin.thirdeye.api.TimeGranularity;
import com.linkedin.thirdeye.client.MetricExpression;
import com.linkedin.thirdeye.client.MetricFunction;
import com.linkedin.thirdeye.client.timeseries.TimeSeriesHandler;
import com.linkedin.thirdeye.client.timeseries.TimeSeriesRequest;
import com.linkedin.thirdeye.client.timeseries.TimeSeriesResponse;
import com.linkedin.thirdeye.client.timeseries.<API key>;
import com.linkedin.thirdeye.dashboard.Utils;
import com.linkedin.thirdeye.detector.api.<API key>;
import com.linkedin.thirdeye.detector.api.AnomalyFunctionSpec;
import com.linkedin.thirdeye.detector.api.AnomalyResult;
import com.linkedin.thirdeye.detector.db.<API key>;
import com.linkedin.thirdeye.detector.db.AnomalyResultDAO;
import com.linkedin.thirdeye.detector.function.AnomalyFunction;
import com.linkedin.thirdeye.detector.lib.util.JobUtils;
public class AnomalyDetectionJob implements Job {
private static final Logger LOG = LoggerFactory.getLogger(AnomalyDetectionJob.class);
public static final String FUNCTION = "FUNCTION";
public static final String TIME_SERIES_HANDLER = "TIME_SERIES_HANDLER";
public static final String <API key> = "<API key>";
public static final String RESULT_DAO = "RESULT_DAO";
public static final String SESSION_FACTORY = "SESSION_FACTORY";
public static final String WINDOW_END = "WINDOW_END";
public static final String WINDOW_START = "WINDOW_START";
public static final String METRIC_REGISTRY = "METRIC_REGISTRY";
public static final String RELATION_DAO = "RELATION_DAO";
private AnomalyFunction anomalyFunction;
private TimeSeriesHandler timeSeriesHandler;
private <API key> <API key>;
private AnomalyResultDAO resultDAO;
private <API key> relationDAO;
private SessionFactory sessionFactory;
private MetricRegistry metricRegistry;
private Histogram histogram;
private String collection;
private List<String> <API key>;
private MetricFunction metricFunction;
private DateTime windowStart;
private DateTime windowEnd;
private List<AnomalyResult> knownAnomalies;
private int anomalyCounter;
@Override
public void execute(final JobExecutionContext context) throws <API key> {
anomalyFunction = (AnomalyFunction) context.getJobDetail().getJobDataMap().get(FUNCTION);
final <API key> failureEmailConfig =
(<API key>) context.getJobDetail().getJobDataMap()
.get(<API key>);
try {
run(context, anomalyFunction);
} catch (Throwable t) {
AnomalyFunctionSpec spec = anomalyFunction.getSpec();
LOG.error("Job failed with exception:", t);
long id = spec.getId();
String collection = spec.getCollection();
String metric = spec.getMetric();
String subject =
String.format("FAILED ANOMALY DETECTION JOB ID=%d (%s:%s)", id, collection, metric);
String textBody =
String.format("%s%n%nException:%s", spec.toString(), ExceptionUtils.getStackTrace(t));
try {
JobUtils.sendFailureEmail(failureEmailConfig, subject, textBody);
} catch (EmailException e) {
throw new <API key>(e);
}
}
}
private void run(JobExecutionContext context, AnomalyFunction anomalyFunction)
throws <API key> {
// thirdEyeClient = (ThirdEyeClient) context.getJobDetail().getJobDataMap().get(CLIENT);
AnomalyFunctionSpec spec = anomalyFunction.getSpec();
timeSeriesHandler =
(TimeSeriesHandler) context.getJobDetail().getJobDataMap().get(TIME_SERIES_HANDLER);
<API key> =
(<API key>) context.getJobDetail().getJobDataMap()
.get(<API key>);
resultDAO = (AnomalyResultDAO) context.getJobDetail().getJobDataMap().get(RESULT_DAO);
relationDAO =
(<API key>) context.getJobDetail().getJobDataMap().get(RELATION_DAO);
sessionFactory = (SessionFactory) context.getJobDetail().getJobDataMap().get(SESSION_FACTORY);
metricRegistry = (MetricRegistry) context.getJobDetail().getJobDataMap().get(METRIC_REGISTRY);
String windowEndProp = context.getJobDetail().getJobDataMap().getString(WINDOW_END);
String windowStartProp = context.getJobDetail().getJobDataMap().getString(WINDOW_START);
// Get histogram for this job execution time
String histogramName = context.getJobDetail().getKey().getName();
histogram = metricRegistry.getHistograms().get(histogramName);
if (histogram == null) {
histogram = metricRegistry.histogram(histogramName);
}
// Compute window end
if (windowEndProp == null) {
long delayMillis = 0;
if (spec.getWindowDelay() != null) {
delayMillis =
TimeUnit.MILLISECONDS.convert(spec.getWindowDelay(), spec.getWindowDelayUnit());
}
Date scheduledFireTime = context.<API key>();
windowEnd = new DateTime(scheduledFireTime).minus(delayMillis);
} else {
windowEnd = ISODateTimeFormat.dateTimeParser().parseDateTime(windowEndProp);
}
// Compute window start
if (windowStartProp == null) {
long windowMillis = TimeUnit.MILLISECONDS.convert(spec.getWindowSize(), spec.getWindowUnit());
windowStart = windowEnd.minus(windowMillis);
} else {
windowStart = ISODateTimeFormat.dateTimeParser().parseDateTime(windowStartProp);
}
// Compute metric function
TimeGranularity timeGranularity =
new TimeGranularity(spec.getBucketSize(), spec.getBucketUnit());
// TODO put sum into the function config
metricFunction = new MetricFunction(MetricFunction.SUM, spec.getMetric());
// Collection
collection = spec.getCollection();
try {
CollectionSchema collectionSchema =
timeSeriesHandler.getClient().getCollectionSchema(collection);
<API key> = collectionSchema.getDimensionNames();
} catch (Exception e) {
throw new <API key>(e);
}
// Get existing anomalies for this time range
knownAnomalies = <API key>();
// Seed request with top-level...
Queue<TimeSeriesRequest> <API key> = new LinkedList<>();
TimeSeriesRequest topLevelRequest = new TimeSeriesRequest();
topLevelRequest.setCollectionName(collection);
List<MetricFunction> metricFunctions = Collections.singletonList(metricFunction);
List<MetricExpression> metricExpressions = Utils.<API key>(metricFunctions);
topLevelRequest.<API key>(metricExpressions);
topLevelRequest.<API key>(timeGranularity);
topLevelRequest.setStart(windowStart);
topLevelRequest.setEnd(windowEnd);
// Filters are supported now. Now filter clauses can be specified in AnomalyFunctionSpec.
String filters = spec.getFilters();
if (StringUtils.isNotBlank(filters)) {
topLevelRequest.setFilterSet(spec.getFilterSet());
}
String <API key> = spec.<API key>();
if (StringUtils.isBlank(<API key>)) {
<API key>.add(topLevelRequest);
} else {
// And all the dimensions which we should explore
List<String> exploreDimensions = Arrays.asList(<API key>.split(","));
// Technically we should be able to pass in all exploration dimensions in one go and let the
// handler split the requests sent to the underlying client, but we explicitly split here to
// mimic previous behavior before the client api changes.
// TimeSeriesRequest groupByRequest = new TimeSeriesRequest(topLevelRequest);
// groupByRequest.<API key>(exploreDimensions);
for (String exploreDimension : exploreDimensions) {
TimeSeriesRequest groupByRequest = new TimeSeriesRequest(topLevelRequest);
groupByRequest.<API key>(Collections.singletonList(exploreDimension));
<API key>.add(groupByRequest);
}
}
while (!<API key>.isEmpty()) {
try {
List<TimeSeriesRequest> nextRequests = exploreCombination(<API key>.remove());
// TODO support further/deeper exploration
// <API key>.addAll(nextRequests);
} catch (Exception e) {
throw new <API key>(e);
}
}
LOG.info("{} anomalies found in total", anomalyCounter);
}
private List<TimeSeriesRequest> exploreCombination(TimeSeriesRequest request) throws Exception {
LOG.info("Exploring {}", request);
// Query server
TimeSeriesResponse response;
try {
LOG.debug("Executing {}", request);
response = timeSeriesHandler.handle(request);
} catch (Exception e) {
throw new <API key>(e);
}
Map<DimensionKey, MetricTimeSeries> res =
<API key>.toMap(response, <API key>);
for (Map.Entry<DimensionKey, MetricTimeSeries> entry : res.entrySet()) {
if (entry.getValue().getTimeWindowSet().size() < 2) {
LOG.warn("Insufficient data for {} to run anomaly detection function", entry.getKey());
continue;
}
try {
// Run algorithm
long startTime = System.currentTimeMillis();
List<AnomalyResult> results =
anomalyFunction.analyze(entry.getKey(), entry.getValue(), windowStart, windowEnd,
knownAnomalies);
long endTime = System.currentTimeMillis();
histogram.update(endTime - startTime);
// Handle results
handleResults(results);
// Remove any known anomalies
results.removeAll(knownAnomalies);
LOG.info("{} has {} anomalies in window {} to {}", entry.getKey(), results.size(),
windowStart, windowEnd);
anomalyCounter += results.size();
} catch (Exception e) {
LOG.error("Could not compute for {}", entry.getKey(), e);
}
}
return ImmutableList.of(); // TODO provide a more advanced exploration policy
}
private List<AnomalyResult> <API key>() {
List<AnomalyResult> results = new ArrayList<>();
Session session = sessionFactory.openSession();
try {
<API key>.bind(session);
Transaction transaction = session.beginTransaction();
try {
// The ones for this function
results.addAll(resultDAO.<API key>(collection, windowStart,
windowEnd, anomalyFunction.getSpec().getId()));
// The ones for any related functions
List<<API key>> relations =
relationDAO.findByParent(anomalyFunction.getSpec().getId());
for (<API key> relation : relations) {
results.addAll(resultDAO.<API key>(collection, windowStart,
windowEnd, relation.getChildId()));
}
transaction.commit();
} catch (Exception e) {
transaction.rollback();
throw new RuntimeException(e);
}
} finally {
session.close();
<API key>.unbind(sessionFactory);
}
return results;
}
private void handleResults(List<AnomalyResult> results) {
Session session = sessionFactory.openSession();
try {
<API key>.bind(session);
Transaction transaction = session.beginTransaction();
try {
for (AnomalyResult result : results) {
// Properties that always come from the function spec
AnomalyFunctionSpec spec = anomalyFunction.getSpec();
result.setFunctionId(spec.getId());
result.setFunctionType(spec.getType());
result.<API key>(spec.getProperties());
result.setCollection(spec.getCollection());
result.setMetric(spec.getMetric());
result.setFilters(spec.getFilters());
// make sure score and weight are valid numbers
result.setScore(normalize(result.getScore()));
result.setWeight(normalize(result.getWeight()));
resultDAO.create(result);
}
transaction.commit();
} catch (Exception e) {
transaction.rollback();
throw new RuntimeException(e);
}
} finally {
session.close();
<API key>.unbind(sessionFactory);
}
}
/** Handle any infinite or NaN values by replacing them with +/- max value or 0 */
private double normalize(double value) {
if (Double.isInfinite(value)) {
return (value > 0.0 ? 1 : -1) * Double.MAX_VALUE;
} else if (Double.isNaN(value)) {
return 0.0; // default?
} else {
return value;
}
}
} |
<!DOCTYPE HTML PUBLIC "-
<!--NewPage
<HTML>
<HEAD>
<!-- Generated by javadoc (build 1.6.0_51) on Tue Aug 27 20:57:03 WEST 2013 -->
<TITLE>
EventHistory.Event
</TITLE>
<META NAME="date" CONTENT="2013-08-27">
<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../stylesheet.css" TITLE="Style">
<SCRIPT type="text/javascript">
function windowTitle()
{
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="EventHistory.Event";
}
}
</SCRIPT>
<NOSCRIPT>
</NOSCRIPT>
</HEAD>
<BODY BGCOLOR="white" onload="windowTitle();">
<HR>
<A NAME="navbar_top"></A>
<A HREF="#skip-navbar_top" title="Skip navigation links"></A>
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
<TR>
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<A NAME="navbar_top_firstrow"></A>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
<TR ALIGN="center" VALIGN="top">
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD>
<TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="class-use/EventHistory.Event.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../index-files/index-1.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD>
</TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
</EM>
</TD>
</TR>
<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../../net/<API key>/util/EventHistory.EvAction.html" title="enum in net.<API key>.util"><B>PREV CLASS</B></A>
<A HREF="../../../net/<API key>/util/EventHistory.EvState.html" title="enum in net.<API key>.util"><B>NEXT CLASS</B></A></FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../../index.html?net/<API key>/util/EventHistory.Event.html" target="_top"><B>FRAMES</B></A>
<A HREF="EventHistory.Event.html" target="_top"><B>NO FRAMES</B></A>
<SCRIPT type="text/javascript">
<!
if(window==top) {
document.writeln('<A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A>');
}
</SCRIPT>
<NOSCRIPT>
<A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A>
</NOSCRIPT>
</FONT></TD>
</TR>
<TR>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
SUMMARY: NESTED | <A HREF="#field_summary">FIELD</A> | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#<API key>.lang.Object">METHOD</A></FONT></TD>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
DETAIL: <A HREF="#field_detail">FIELD</A> | <A HREF="#constructor_detail">CONSTR</A> | METHOD</FONT></TD>
</TR>
</TABLE>
<A NAME="skip-navbar_top"></A>
<HR>
<H2>
<FONT SIZE="-1">
net.<API key>.util</FONT>
<BR>
Class EventHistory.Event</H2>
<PRE>
java.lang.Object
<IMG SRC="../../../resources/inherit.gif" ALT="extended by "><B>net.<API key>.util.EventHistory.Event</B>
</PRE>
<DL>
<DT><B>Enclosing class:</B><DD><A HREF="../../../net/<API key>/util/EventHistory.html" title="class in net.<API key>.util">EventHistory</A><<A HREF="../../../net/<API key>/util/EventHistory.html" title="type parameter in EventHistory">T</A>></DD>
</DL>
<HR>
<DL>
<DT><PRE>public class <B>EventHistory.Event</B><DT>extends java.lang.Object</DL>
</PRE>
<P>
<HR>
<P>
<A NAME="field_summary"></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
<B>Field Summary</B></FONT></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> <A HREF="../../../net/<API key>/util/<API key>.html" title="class in net.<API key>.util"><API key></A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../net/<API key>/util/EventHistory.Event.html#base_info">base_info</A></B></CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> <A HREF="../../../net/<API key>/util/EventHistory.html" title="type parameter in EventHistory">T</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../net/<API key>/util/EventHistory.Event.html#info">info</A></B></CODE>
<BR>
</TD>
</TR>
</TABLE>
<A NAME="constructor_summary"></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
<B>Constructor Summary</B></FONT></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE><B><A HREF="../../../net/<API key>/util/EventHistory.Event.html#EventHistory.Event()">EventHistory.Event</A></B>()</CODE>
<BR>
</TD>
</TR>
</TABLE>
<A NAME="method_summary"></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
<B>Method Summary</B></FONT></TH>
</TR>
</TABLE>
<A NAME="<API key>.lang.Object"></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#EEEEFF" CLASS="<API key>">
<TH ALIGN="left"><B>Methods inherited from class java.lang.Object</B></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE>clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait</CODE></TD>
</TR>
</TABLE>
<P>
<A NAME="field_detail"></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2">
<B>Field Detail</B></FONT></TH>
</TR>
</TABLE>
<A NAME="base_info"></A><H3>
base_info</H3>
<PRE>
public <A HREF="../../../net/<API key>/util/<API key>.html" title="class in net.<API key>.util"><API key></A> <B>base_info</B></PRE>
<DL>
<DL>
</DL>
</DL>
<HR>
<A NAME="info"></A><H3>
info</H3>
<PRE>
public <A HREF="../../../net/<API key>/util/EventHistory.html" title="type parameter in EventHistory">T</A> <B>info</B></PRE>
<DL>
<DL>
</DL>
</DL>
<A NAME="constructor_detail"></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2">
<B>Constructor Detail</B></FONT></TH>
</TR>
</TABLE>
<A NAME="EventHistory.Event()"></A><H3>
EventHistory.Event</H3>
<PRE>
public <B>EventHistory.Event</B>()</PRE>
<DL>
</DL>
<HR>
<A NAME="navbar_bottom"></A>
<A HREF="#skip-navbar_bottom" title="Skip navigation links"></A>
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
<TR>
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<A NAME="<API key>"></A>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
<TR ALIGN="center" VALIGN="top">
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD>
<TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="class-use/EventHistory.Event.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../index-files/index-1.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD>
</TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
</EM>
</TD>
</TR>
<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../../net/<API key>/util/EventHistory.EvAction.html" title="enum in net.<API key>.util"><B>PREV CLASS</B></A>
<A HREF="../../../net/<API key>/util/EventHistory.EvState.html" title="enum in net.<API key>.util"><B>NEXT CLASS</B></A></FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../../index.html?net/<API key>/util/EventHistory.Event.html" target="_top"><B>FRAMES</B></A>
<A HREF="EventHistory.Event.html" target="_top"><B>NO FRAMES</B></A>
<SCRIPT type="text/javascript">
<!
if(window==top) {
document.writeln('<A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A>');
}
</SCRIPT>
<NOSCRIPT>
<A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A>
</NOSCRIPT>
</FONT></TD>
</TR>
<TR>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
SUMMARY: NESTED | <A HREF="#field_summary">FIELD</A> | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#<API key>.lang.Object">METHOD</A></FONT></TD>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
DETAIL: <A HREF="#field_detail">FIELD</A> | <A HREF="#constructor_detail">CONSTR</A> | METHOD</FONT></TD>
</TR>
</TABLE>
<A NAME="skip-navbar_bottom"></A>
<HR>
</BODY>
</HTML> |
package edu.harvard.we99.services;
import edu.harvard.we99.domain.Coordinate;
import edu.harvard.we99.domain.PlateDimension;
import edu.harvard.we99.domain.PlateMap;
import edu.harvard.we99.domain.PlateType;
import edu.harvard.we99.domain.WellMap;
import edu.harvard.we99.domain.WellType;
import edu.harvard.we99.test.LogTestRule;
import edu.harvard.we99.test.Scrubbers;
import edu.harvard.we99.util.ClientFactory;
import org.junit.AfterClass;
import org.junit.BeforeClass;
import org.junit.Rule;
import org.junit.Test;
import java.net.URL;
import java.util.function.Function;
import static edu.harvard.we99.test.BaseFixture.assertJsonEquals;
import static edu.harvard.we99.test.BaseFixture.load;
import static edu.harvard.we99.test.BaseFixture.name;
import static edu.harvard.we99.util.JacksonUtil.toJsonString;
import static org.junit.Assert.assertNotNull;
/**
* Integration tests for the PlateTemplate service.
*
* This test assumes that the server is running. You can run it as part of the
* WebAppIT test or via command line in maven.
*
* It's also possible to start the Jetty server manually (or any server at the
* configured endpoint) and run the test against that instance.
*
* @author mford
*/
public class PlateMapST {
@Rule
public LogTestRule logTestRule = new LogTestRule();
/**
* Proxy to the remote service
*/
private static PlateMapService plateMapService;
/**
* PlateType that we should use when creating the templates. We'll assign
* this value in our BeforeClass
*/
private static PlateType plateType;
/**
* JSON scrubbers to clean the payloads for our assertions
*/
private Function<String,String> jsonScrubber =
Scrubbers.pkey.andThen(Scrubbers.uuid);
/**
* Init our proxies and then create a new PlateType for use in the template
* @throws Exception
*/
@BeforeClass
public static void init() throws Exception {
URL url = new URL(WebAppIT.WE99_URL);
ClientFactory cf = new ClientFactory(url, WebAppIT.WE99_EMAIL, WebAppIT.WE99_PW);
// install some plate types
// install some compounds
plateMapService = cf.create(PlateMapService.class);
PlateTypeService plateTypeService = cf.create(PlateTypeService.class);
plateType = plateTypeService.create(new PlateType()
.setName(name("plateType"))
.setDim(new PlateDimension(4, 3))
.setManufacturer("Foo Inc."));
}
@AfterClass
public static void tearDown() throws Exception {
// delete all of the templates in the system
// delete all of the plate types
// delete all of the compounds
plateMapService = null;
plateType = null;
}
/**
* Makes a REST PUT call to create a new PlateTemplate and then asserts that
* the value it got back matches what we expected to see.
* @throws Exception
*/
@Test
public void create() throws Exception {
// create a new template
// assert that it comes back
// assert that we can get it
// Yes, this is making a REST PUT call, even though it looks like a simple Java call
PlateMap plateMap = createPlateMap();
PlateMap pt = plateMapService.create(plateMap);
assertNotNull(pt);
String actual = toJsonString(pt);
assertJsonEquals(load("/PlateMapIT/create.json"), actual, jsonScrubber);
}
@Test
public void update() throws Exception {
// create a new template
// update one or more values and wells
// assert the updated values
PlateMap plateMap = createPlateMap();
PlateMap pm = plateMapService.create(plateMap);
pm.setDescription("my modified description");
Coordinate coordinate = new Coordinate(0, 0);
WellMap well = new WellMap(coordinate)
.withLabel("loc", "well 0,0")
.setType(WellType.COMP);
pm.getWells().put(coordinate,well);
PlateMap updated = plateMapService.update(pm.getId(), pm);
String actual = toJsonString(updated);
assertJsonEquals(load("/PlateMapIT/updated.json"), actual, jsonScrubber);
}
private PlateMap createPlateMap() {
return new PlateMap()
.setName(name("plateMap-"))
.setDescription("my test plate")
.setDim(plateType.getDim());
}
} |
package org.devcon.android.adapter;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.<API key>;
import com.viewpagerindicator.IconPagerAdapter;
import java.util.List;
public class TestFragmentAdapter extends <API key> implements
IconPagerAdapter {
private List<Fragment> fragments;
public TestFragmentAdapter(FragmentManager fm, List<Fragment> fragments) {
super(fm);
this.fragments = fragments;
}
@Override
public Fragment getItem(int position) {
return this.fragments.get(position);
}
@Override
public int getCount() {
return fragments.size();
}
@Override
public int getIconResId(int index) {
return 0;
}
} |
// file at the top-level directory of this distribution and at
// option. This file may not be copied, modified, or distributed
// except according to those terms.
//! Operations and constants for unsigned 32-bits integers (`u32` type)
#![doc(primitive = "u32")]
uint_module!(u32, i32, 32) |
package com.coolweather.android;
import android.content.Intent;
import android.content.SharedPreferences;
import android.preference.PreferenceManager;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
public class MainActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
SharedPreferences sharedPreferences= PreferenceManager.<API key>(this);
String weatherString=sharedPreferences.getString("weather",null);
if (weatherString!=null){
Intent intent=new Intent(this,WeatherActivity.class);
startActivity(intent);
finish();
}
}
} |
package com.frameworkset.common.poolman.handle;
import com.frameworkset.common.poolman.Record;
import com.frameworkset.common.poolman.sql.<API key>;
import com.frameworkset.common.poolman.util.SQLUtil;
import com.frameworkset.orm.engine.model.SchemaType;
public abstract class RowHandler<T> {
/**
*
* @param rowValue recordjavaStringBufferxml
* @param record select id,name from test,Recordidname
*
* record.getInt("id");//id
* record.getInt("name");//name
*/
public abstract void handleRow(T rowValue,Record record) throws Exception;
// public abstract T handleField_(Record record) throws Exception;
protected <API key> meta;
protected String dbname;
public void init(<API key> meta,String dbname)
{
this.meta = meta;
this.dbname = dbname;
}
public void destroy()
{
this.meta = null;
this.dbname = null;
}
public SchemaType getSchemaType(int clindex)
{
if(meta == null)
{
throw new RowHandlerException("[meta],.");
}
try {
int sqltype = meta.getColumnType(clindex);
SchemaType schemaType = SQLUtil.getSchemaType(dbname, sqltype);
return schemaType;
} catch (Exception e) {
// e.printStackTrace();
throw new RowHandlerException(e);
}
}
public SchemaType getSchemaType(String colName)
{
if(meta == null)
{
throw new RowHandlerException("[meta],.");
}
try {
int index = seekIndex(colName);
int sqltype = meta.getColumnType(index + 1);
SchemaType schemaType = SQLUtil.getSchemaType(dbname, sqltype);
return schemaType;
}
catch(RowHandlerException e)
{
throw e;
}
catch (Exception e) {
// e.printStackTrace();
throw new RowHandlerException(e);
}
}
private int seekIndex(String colName)
{
// String temp = colName.toUpperCase();
// String[] columnLabel_uppers = meta.<API key>();
// for(int i = 0; i < columnLabel_uppers.length ; i ++)
// if(columnLabel_uppers[i].equals(temp))
// return i;
// throw new RowHandlerException("[" + colName + "].");
return meta.seekIndex(colName);
}
} |
<!DOCTYPE html PUBLIC "-
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
</head>
<body>
<form action="" enctype="multipart/form-data" method="post">
<input type="file" name="photo[]" /><br /> <input type="file"
name="photo[]" /><br /> <input type="submit" value="">
</form>
</body>
</html> |
#include "libos.h"
#include "httpc.h"
#include "harbor.h"
#include "listlib.h"
#define HARBOR_TIMEOUT (5)
typedef struct harbor_message_s{
list_head head;
char *msg;
int len;
int msgId;
}harbor_message_t;
typedef struct harbor_s{
list_head sendList;
httpc_t httpc;
char *szURL;
msg_callback callback;
bool isBusy;
}harbor_t;
static void harbor_continue(harbor_t *harbor);
static void harobr_httpHandler(void *pUsr, coutputer_t *output, int errorcode)
{
harbor_t *harbor = (harbor_t*)pUsr;
harbor_message_t *message = list_entry(harbor->sendList.next,harbor_message_t,head);
list_del(&message->head);
harbor->isBusy = false;
bool bRet = false;
harborMsg_t msg = {0};
if(errorcode != 0){
msg.msgId = message->msgId;
msg.errorcode = errorcode;
bRet = harbor->callback(harbor,EMSGTYPE_ERROR,&msg);
}else{
msg.msgId = message->msgId;
msg.message = output->buffer.data;
msg.len = output->buffer.size;
bRet = harbor->callback(harbor,EMSGTYPE_REMOTE,&msg);
}
free(message);
// If error, we reset the httpC
if(errorcode!=0){
httpc_clear(&harbor->httpc,false);
}
if(bRet){
harbor_continue(harbor);
}
}
static void harbor_continue(harbor_t *harbor)
{
if(harbor->isBusy||list_empty(&harbor->sendList)){
return;
}
harbor->isBusy = true;
harbor_message_t *message = list_entry(harbor->sendList.next,harbor_message_t,head);
bool bRet = httpc_load(&harbor->httpc,
harbor->szURL,
HTTP_POST,
HARBOR_TIMEOUT,
message->msg,
message->len,
EOUT_BUFF,
NULL,
harobr_httpHandler,
(void*)harbor);
if(!bRet){
harobr_httpHandler((void*)harbor,NULL,-5);
}
}
void harbor_send(void* handle, int msgId, char *msg, int len)
{
harbor_t *harbor = (harbor_t*)handle;
harbor_message_t *message = (harbor_message_t*)malloc(sizeof(harbor_message_t)+len+1);
memset(message,0x00,sizeof(harbor_message_t)+len+1);
message->msg = (char*)(message+1);
message->len = len;
message->msgId = msgId;
memcpy(message->msg,msg,len);
list_add_tail(&message->head,&harbor->sendList);
harbor_continue(harbor);
}
void* harbor_start(char *szURL, msg_callback callback)
{
harbor_t *harbor = (harbor_t*)malloc(sizeof(harbor_t));
memset(harbor,0x00,sizeof(harbor_t));
harbor->szURL = cmmn_strdup(szURL);
harbor->callback = callback;
INIT_LIST_HEAD(&harbor->sendList);
return harbor;
}
void harbor_stop(void* handle)
{
harbor_t *harbor = (harbor_t*)handle;
httpc_clear(&harbor->httpc,false);
struct list_head *pos=NULL,*_next=NULL;
list_for_each_safe(pos,_next,&harbor->sendList){
harbor_message_t *message = list_entry(pos,harbor_message_t,head);
free(message);
}
if(harbor->szURL){
free(harbor->szURL);
harbor->szURL = NULL;
}
free(harbor);
} |
/**
* Function.java
*
* This file was auto-generated from WSDL
* by the Apache Axis 1.4 Mar 02, 2009 (07:08:06 PST) WSDL2Java emitter.
*/
package com.google.api.ads.adwords.axis.v201601.cm;
/**
* Represents a function where its operator is applied to its argument
* operands
* resulting in a return value. It has the form
* (Operand... Operator Operand...). The type of the return
* value depends on
* the operator being applied and the type of the operands.
*
* <p class="special">Operands per function is limited to
* <b>20</b>.</p>
*
* <p>Here is a code example:</p>
*
* <pre><code>
*
* // For example "feed_attribute == 30" can be represented
* as:
* FeedId feedId = (FeedId of Feed associated with feed_attribute)
* FeedAttributeId feedAttributeId = (FeedAttributeId of feed_attribute)
* Function function = new Function();
* function.setLhsOperand(
* Arrays.asList((Operand) new <API key>(feedId,
* feedAttributeId)));
* function.setOperator(Operator.IN);
* function.setRhsOperand(
* Arrays.asList((Operand) new ConstantOperand(30L)));
*
* // Another example matching on multiple values:
* "feed_item_id IN (10, 20, 30)" can be represented as:
*
* Function function = new Function();
* function.setLhsOperand(
* Arrays.asList((Operand) new <API key>(ContextType.FEED_ITEM_ID)));
* function.setOperator(Operator.IN);
* function.setRhsOperand(Arrays.asList(
* (Operand) new ConstantOperand(10L), new ConstantOperand(20L),
* new ConstantOperand(30L)));
* </code></pre>
*/
public class Function implements java.io.Serializable {
/* Operator for a function.
* <span class="constraint Required">This field is required
* and should not be {@code null}.</span> */
private com.google.api.ads.adwords.axis.v201601.cm.FunctionOperator operator;
/* Operand on the LHS in the equation. This is also the operand
* to be used for
* single operand expressions such as NOT.
* <span class="constraint CollectionSize">The minimum
* size of this collection is 1.</span> */
private com.google.api.ads.adwords.axis.v201601.cm.<API key>[] lhsOperand;
/* Operand on the RHS of the equation. */
private com.google.api.ads.adwords.axis.v201601.cm.<API key>[] rhsOperand;
/* String representation of the {@code Function}.
*
* <p>For mutate actions, this field can be set instead
* of the {@code operator},
* {@code lhsOperand}, and {@code rhsOperand} fields.
* This field will be parsed and used to
* populate the other fields.
*
* <p>When {@code Function} objects are returned from
* get or mutate calls, this field contains the
* string representation of the {@code Function}. Note
* that because multiple strings may map to
* the same {@code Function} (whitespace and single versus
* double quotation marks, for example),
* the value returned may not be identical to the string
* sent in the request. */
private java.lang.String functionString;
public Function() {
}
public Function(
com.google.api.ads.adwords.axis.v201601.cm.FunctionOperator operator,
com.google.api.ads.adwords.axis.v201601.cm.<API key>[] lhsOperand,
com.google.api.ads.adwords.axis.v201601.cm.<API key>[] rhsOperand,
java.lang.String functionString) {
this.operator = operator;
this.lhsOperand = lhsOperand;
this.rhsOperand = rhsOperand;
this.functionString = functionString;
}
/**
* Gets the operator value for this Function.
*
* @return operator * Operator for a function.
* <span class="constraint Required">This field is required
* and should not be {@code null}.</span>
*/
public com.google.api.ads.adwords.axis.v201601.cm.FunctionOperator getOperator() {
return operator;
}
/**
* Sets the operator value for this Function.
*
* @param operator * Operator for a function.
* <span class="constraint Required">This field is required
* and should not be {@code null}.</span>
*/
public void setOperator(com.google.api.ads.adwords.axis.v201601.cm.FunctionOperator operator) {
this.operator = operator;
}
/**
* Gets the lhsOperand value for this Function.
*
* @return lhsOperand * Operand on the LHS in the equation. This is also the operand
* to be used for
* single operand expressions such as NOT.
* <span class="constraint CollectionSize">The minimum
* size of this collection is 1.</span>
*/
public com.google.api.ads.adwords.axis.v201601.cm.<API key>[] getLhsOperand() {
return lhsOperand;
}
/**
* Sets the lhsOperand value for this Function.
*
* @param lhsOperand * Operand on the LHS in the equation. This is also the operand
* to be used for
* single operand expressions such as NOT.
* <span class="constraint CollectionSize">The minimum
* size of this collection is 1.</span>
*/
public void setLhsOperand(com.google.api.ads.adwords.axis.v201601.cm.<API key>[] lhsOperand) {
this.lhsOperand = lhsOperand;
}
public com.google.api.ads.adwords.axis.v201601.cm.<API key> getLhsOperand(int i) {
return this.lhsOperand[i];
}
public void setLhsOperand(int i, com.google.api.ads.adwords.axis.v201601.cm.<API key> _value) {
this.lhsOperand[i] = _value;
}
/**
* Gets the rhsOperand value for this Function.
*
* @return rhsOperand * Operand on the RHS of the equation.
*/
public com.google.api.ads.adwords.axis.v201601.cm.<API key>[] getRhsOperand() {
return rhsOperand;
}
/**
* Sets the rhsOperand value for this Function.
*
* @param rhsOperand * Operand on the RHS of the equation.
*/
public void setRhsOperand(com.google.api.ads.adwords.axis.v201601.cm.<API key>[] rhsOperand) {
this.rhsOperand = rhsOperand;
}
public com.google.api.ads.adwords.axis.v201601.cm.<API key> getRhsOperand(int i) {
return this.rhsOperand[i];
}
public void setRhsOperand(int i, com.google.api.ads.adwords.axis.v201601.cm.<API key> _value) {
this.rhsOperand[i] = _value;
}
/**
* Gets the functionString value for this Function.
*
* @return functionString * String representation of the {@code Function}.
*
* <p>For mutate actions, this field can be set instead
* of the {@code operator},
* {@code lhsOperand}, and {@code rhsOperand} fields.
* This field will be parsed and used to
* populate the other fields.
*
* <p>When {@code Function} objects are returned from
* get or mutate calls, this field contains the
* string representation of the {@code Function}. Note
* that because multiple strings may map to
* the same {@code Function} (whitespace and single versus
* double quotation marks, for example),
* the value returned may not be identical to the string
* sent in the request.
*/
public java.lang.String getFunctionString() {
return functionString;
}
/**
* Sets the functionString value for this Function.
*
* @param functionString * String representation of the {@code Function}.
*
* <p>For mutate actions, this field can be set instead
* of the {@code operator},
* {@code lhsOperand}, and {@code rhsOperand} fields.
* This field will be parsed and used to
* populate the other fields.
*
* <p>When {@code Function} objects are returned from
* get or mutate calls, this field contains the
* string representation of the {@code Function}. Note
* that because multiple strings may map to
* the same {@code Function} (whitespace and single versus
* double quotation marks, for example),
* the value returned may not be identical to the string
* sent in the request.
*/
public void setFunctionString(java.lang.String functionString) {
this.functionString = functionString;
}
private java.lang.Object __equalsCalc = null;
public synchronized boolean equals(java.lang.Object obj) {
if (!(obj instanceof Function)) return false;
Function other = (Function) obj;
if (obj == null) return false;
if (this == obj) return true;
if (__equalsCalc != null) {
return (__equalsCalc == obj);
}
__equalsCalc = obj;
boolean _equals;
_equals = true &&
((this.operator==null && other.getOperator()==null) ||
(this.operator!=null &&
this.operator.equals(other.getOperator()))) &&
((this.lhsOperand==null && other.getLhsOperand()==null) ||
(this.lhsOperand!=null &&
java.util.Arrays.equals(this.lhsOperand, other.getLhsOperand()))) &&
((this.rhsOperand==null && other.getRhsOperand()==null) ||
(this.rhsOperand!=null &&
java.util.Arrays.equals(this.rhsOperand, other.getRhsOperand()))) &&
((this.functionString==null && other.getFunctionString()==null) ||
(this.functionString!=null &&
this.functionString.equals(other.getFunctionString())));
__equalsCalc = null;
return _equals;
}
private boolean __hashCodeCalc = false;
public synchronized int hashCode() {
if (__hashCodeCalc) {
return 0;
}
__hashCodeCalc = true;
int _hashCode = 1;
if (getOperator() != null) {
_hashCode += getOperator().hashCode();
}
if (getLhsOperand() != null) {
for (int i=0;
i<java.lang.reflect.Array.getLength(getLhsOperand());
i++) {
java.lang.Object obj = java.lang.reflect.Array.get(getLhsOperand(), i);
if (obj != null &&
!obj.getClass().isArray()) {
_hashCode += obj.hashCode();
}
}
}
if (getRhsOperand() != null) {
for (int i=0;
i<java.lang.reflect.Array.getLength(getRhsOperand());
i++) {
java.lang.Object obj = java.lang.reflect.Array.get(getRhsOperand(), i);
if (obj != null &&
!obj.getClass().isArray()) {
_hashCode += obj.hashCode();
}
}
}
if (getFunctionString() != null) {
_hashCode += getFunctionString().hashCode();
}
__hashCodeCalc = false;
return _hashCode;
}
// Type metadata
private static org.apache.axis.description.TypeDesc typeDesc =
new org.apache.axis.description.TypeDesc(Function.class, true);
static {
typeDesc.setXmlType(new javax.xml.namespace.QName("https://adwords.google.com/api/adwords/cm/v201601", "Function"));
org.apache.axis.description.ElementDesc elemField = new org.apache.axis.description.ElementDesc();
elemField.setFieldName("operator");
elemField.setXmlName(new javax.xml.namespace.QName("https://adwords.google.com/api/adwords/cm/v201601", "operator"));
elemField.setXmlType(new javax.xml.namespace.QName("https://adwords.google.com/api/adwords/cm/v201601", "Function.Operator"));
elemField.setMinOccurs(0);
elemField.setNillable(false);
typeDesc.addFieldDesc(elemField);
elemField = new org.apache.axis.description.ElementDesc();
elemField.setFieldName("lhsOperand");
elemField.setXmlName(new javax.xml.namespace.QName("https://adwords.google.com/api/adwords/cm/v201601", "lhsOperand"));
elemField.setXmlType(new javax.xml.namespace.QName("https://adwords.google.com/api/adwords/cm/v201601", "<API key>"));
elemField.setMinOccurs(0);
elemField.setNillable(false);
elemField.<API key>(true);
typeDesc.addFieldDesc(elemField);
elemField = new org.apache.axis.description.ElementDesc();
elemField.setFieldName("rhsOperand");
elemField.setXmlName(new javax.xml.namespace.QName("https://adwords.google.com/api/adwords/cm/v201601", "rhsOperand"));
elemField.setXmlType(new javax.xml.namespace.QName("https://adwords.google.com/api/adwords/cm/v201601", "<API key>"));
elemField.setMinOccurs(0);
elemField.setNillable(false);
elemField.<API key>(true);
typeDesc.addFieldDesc(elemField);
elemField = new org.apache.axis.description.ElementDesc();
elemField.setFieldName("functionString");
elemField.setXmlName(new javax.xml.namespace.QName("https://adwords.google.com/api/adwords/cm/v201601", "functionString"));
elemField.setXmlType(new javax.xml.namespace.QName("http:
elemField.setMinOccurs(0);
elemField.setNillable(false);
typeDesc.addFieldDesc(elemField);
}
/**
* Return type metadata object
*/
public static org.apache.axis.description.TypeDesc getTypeDesc() {
return typeDesc;
}
/**
* Get Custom Serializer
*/
public static org.apache.axis.encoding.Serializer getSerializer(
java.lang.String mechType,
java.lang.Class _javaType,
javax.xml.namespace.QName _xmlType) {
return
new org.apache.axis.encoding.ser.BeanSerializer(
_javaType, _xmlType, typeDesc);
}
/**
* Get Custom Deserializer
*/
public static org.apache.axis.encoding.Deserializer getDeserializer(
java.lang.String mechType,
java.lang.Class _javaType,
javax.xml.namespace.QName _xmlType) {
return
new org.apache.axis.encoding.ser.BeanDeserializer(
_javaType, _xmlType, typeDesc);
}
} |
<!DOCTYPE HTML PUBLIC "-
<!--NewPage
<HTML>
<HEAD>
<!-- Generated by javadoc (build 1.6.0_45) on Sat Sep 28 14:09:52 CEST 2013 -->
<META http-equiv="Content-Type" content="text/html; charset=utf-8">
<TITLE>
Uses of Class org.apache.solr.schema.IndexSchemaFactory (Solr 4.5.0 API)
</TITLE>
<META NAME="date" CONTENT="2013-09-28">
<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../../stylesheet.css" TITLE="Style">
<SCRIPT type="text/javascript">
function windowTitle()
{
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="Uses of Class org.apache.solr.schema.IndexSchemaFactory (Solr 4.5.0 API)";
}
}
</SCRIPT>
<NOSCRIPT>
</NOSCRIPT>
</HEAD>
<BODY BGCOLOR="white" onload="windowTitle();">
<HR>
<A NAME="navbar_top"></A>
<A HREF="#skip-navbar_top" title="Skip navigation links"></A>
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
<TR>
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<A NAME="navbar_top_firstrow"></A>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
<TR ALIGN="center" VALIGN="top">
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../org/apache/solr/schema/IndexSchemaFactory.html" title="class in org.apache.solr.schema"><FONT CLASS="NavBarFont1"><B>Class</B></FONT></A> </TD>
<TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Use</B></FONT> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD>
</TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
</EM>
</TD>
</TR>
<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
PREV
NEXT</FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../../../../index.html?org/apache/solr/schema//<API key>.html" target="_top"><B>FRAMES</B></A>
<A HREF="IndexSchemaFactory.html" target="_top"><B>NO FRAMES</B></A>
<SCRIPT type="text/javascript">
<!
if(window==top) {
document.writeln('<A HREF="../../../../../allclasses-noframe.html"><B>All Classes</B></A>');
}
</SCRIPT>
<NOSCRIPT>
<A HREF="../../../../../allclasses-noframe.html"><B>All Classes</B></A>
</NOSCRIPT>
</FONT></TD>
</TR>
</TABLE>
<A NAME="skip-navbar_top"></A>
<HR>
<CENTER>
<H2>
<B>Uses of Class<br>org.apache.solr.schema.IndexSchemaFactory</B></H2>
</CENTER>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
Packages that use <A HREF="../../../../../org/apache/solr/schema/IndexSchemaFactory.html" title="class in org.apache.solr.schema">IndexSchemaFactory</A></FONT></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><A HREF="#org.apache.solr.schema"><B>org.apache.solr.schema</B></A></TD>
<TD>
<A HREF="../../../../../org/apache/solr/schema/IndexSchema.html" title="class in org.apache.solr.schema"><CODE>IndexSchema</CODE></A> and <A HREF="../../../../../org/apache/solr/schema/FieldType.html" title="class in org.apache.solr.schema"><CODE>FieldType</CODE></A> implementations for powering schema.xml </TD>
</TR>
</TABLE>
<P>
<A NAME="org.apache.solr.schema"></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
Uses of <A HREF="../../../../../org/apache/solr/schema/IndexSchemaFactory.html" title="class in org.apache.solr.schema">IndexSchemaFactory</A> in <A HREF="../../../../../org/apache/solr/schema/package-summary.html">org.apache.solr.schema</A></FONT></TH>
</TR>
</TABLE>
<P>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="<API key>">
<TH ALIGN="left" COLSPAN="2">Subclasses of <A HREF="../../../../../org/apache/solr/schema/IndexSchemaFactory.html" title="class in org.apache.solr.schema">IndexSchemaFactory</A> in <A HREF="../../../../../org/apache/solr/schema/package-summary.html">org.apache.solr.schema</A></FONT></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> class</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/apache/solr/schema/<API key>.html" title="class in org.apache.solr.schema"><API key></A></B></CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> class</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/apache/solr/schema/<API key>.html" title="class in org.apache.solr.schema"><API key></A></B></CODE>
<BR>
Factory for ManagedIndexSchema</TD>
</TR>
</TABLE>
<P>
<HR>
<A NAME="navbar_bottom"></A>
<A HREF="#skip-navbar_bottom" title="Skip navigation links"></A>
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
<TR>
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<A NAME="<API key>"></A>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
<TR ALIGN="center" VALIGN="top">
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../org/apache/solr/schema/IndexSchemaFactory.html" title="class in org.apache.solr.schema"><FONT CLASS="NavBarFont1"><B>Class</B></FONT></A> </TD>
<TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Use</B></FONT> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD>
</TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
</EM>
</TD>
</TR>
<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
PREV
NEXT</FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../../../../index.html?org/apache/solr/schema//<API key>.html" target="_top"><B>FRAMES</B></A>
<A HREF="IndexSchemaFactory.html" target="_top"><B>NO FRAMES</B></A>
<SCRIPT type="text/javascript">
<!
if(window==top) {
document.writeln('<A HREF="../../../../../allclasses-noframe.html"><B>All Classes</B></A>');
}
</SCRIPT>
<NOSCRIPT>
<A HREF="../../../../../allclasses-noframe.html"><B>All Classes</B></A>
</NOSCRIPT>
</FONT></TD>
</TR>
</TABLE>
<A NAME="skip-navbar_bottom"></A>
<HR>
<i>Copyright © 2000-2013 Apache Software Foundation. All Rights Reserved.</i>
<script src='../../../../../prettify.js' type='text/javascript'></script>
<script type='text/javascript'>
(function(){
var oldonload = window.onload;
if (typeof oldonload != 'function') {
window.onload = prettyPrint;
} else {
window.onload = function() {
oldonload();
prettyPrint();
}
}
})();
</script>
</BODY>
</HTML> |
package com.elastisys.scale.commons.net.alerter.http;
import static org.hamcrest.CoreMatchers.is;
import static org.junit.Assert.assertThat;
import org.junit.Test;
import com.elastisys.scale.commons.net.ssl.BasicCredentials;
import com.elastisys.scale.commons.net.ssl.<API key>;
import com.elastisys.scale.commons.net.ssl.KeyStoreType;
/**
* Tests the {@link HttpAuthConfig} class.
*/
public class TestHttpAuthConfig {
private static final String KEYSTORE = "src/test/resources/security/server/server_keystore.p12";
private static final String KEYSTORE_PASSWORD = "serverpassword";
@Test
public void basicSanity() {
BasicCredentials basicCredentials = new BasicCredentials("user", "secret");
<API key> <API key> = new <API key>(KeyStoreType.PKCS12, KEYSTORE,
KEYSTORE_PASSWORD, KEYSTORE_PASSWORD);
// no auth
HttpAuthConfig noAuth = new HttpAuthConfig(null, null);
assertThat(noAuth.getBasicCredentials().isPresent(), is(false));
assertThat(noAuth.<API key>().isPresent(), is(false));
// basic auth
HttpAuthConfig basicAuth = new HttpAuthConfig(basicCredentials, null);
assertThat(basicAuth.getBasicCredentials().isPresent(), is(true));
assertThat(basicAuth.<API key>().isPresent(), is(false));
assertThat(basicAuth.getBasicCredentials().get(), is(basicCredentials));
// cert auth
HttpAuthConfig certAuth = new HttpAuthConfig(null, <API key>);
assertThat(certAuth.getBasicCredentials().isPresent(), is(false));
assertThat(certAuth.<API key>().isPresent(), is(true));
assertThat(certAuth.<API key>().get(), is(<API key>));
// basic + cert auth
HttpAuthConfig basicAndCertAuth = new HttpAuthConfig(basicCredentials, <API key>);
assertThat(basicAndCertAuth.getBasicCredentials().isPresent(), is(true));
assertThat(basicAndCertAuth.<API key>().isPresent(), is(true));
assertThat(basicAndCertAuth.getBasicCredentials().get(), is(basicCredentials));
assertThat(basicAndCertAuth.<API key>().get(), is(<API key>));
}
} |
#!/bin/bash
<API key>() {
results=`git diff --name-only HEAD~1`
contains=false
# Turn on for case-insensitive matching
# shopt -s nocasematch
for i in "$results"
do
:
if [[ ("$i" =~ $1) || "${<API key>}" =~ "[force build]" ]]; then
echo "Found a match against pattern $1. Commit message: ${<API key>}"
return 0
fi
done
return 1
}
<API key>() {
<API key> "\.(java|groovy|xml|properties|yml|json)"
return `(expr "$?" + 0)`
}
<API key>() {
<API key> "\.(java|groovy|xml)"
return `(expr "$?" + 0)`
}
<API key>() {
<API key> "\.(java|groovy)"
return `(expr "$?" + 0)`
}
<API key>() {
<API key> "\.md"
return `(expr "$?" + 0)`
}
<API key>() {
<API key> "\.(gradle|properties)"
return `(expr "$?" + 0)`
}
<API key>() {
<API key> "\.(java|groovy|yml|properties)"
return `(expr "$?" + 0)`
} |
#ifndef SettingsUnitH
#define SettingsUnitH
#include <Classes.hpp>
#include <Controls.hpp>
#include <StdCtrls.hpp>
#include <Forms.hpp>
#include "CSPIN.h"
#include <Buttons.hpp>
#include <ExtCtrls.hpp>
class TformSettings : public TForm
{
__published: // IDE-managed Components
TGroupBox *GroupBox1;
TLabeledEdit *leSubBufNum;
TBitBtn *BitBtn1;
TGroupBox *GroupBox2;
TLabeledEdit *leFreq;
TLabeledEdit *leAmp;
TCSpinButton *CSpinButton1;
TCSpinButton *CSpinButton2;
TGroupBox *GroupBox3;
TLabeledEdit *lePeriod;
TLabeledEdit *leDuration;
TCheckBox *cbPulseMod;
TCheckBox *cbLFM;
TLabeledEdit *leFreqRange;
TCSpinButton *CSpinButton3;
TCSpinButton *CSpinButton4;
TCSpinButton *CSpinButton5;
TCheckBox *cbUWB;
TGroupBox *GroupBox4;
TLabeledEdit *leGateDelay;
TLabeledEdit *leGateDuration;
TCheckBox *cbGate;
TGroupBox *GroupBox5;
TCheckBox *cbCont;
TCheckBox *cbCoherentAccum;
TCheckBox *cbDDSReset;
TGroupBox *GroupBox6;
TRadioButton *rbTxPolXX;
TRadioButton *rbTxPolXY;
TRadioButton *rbTxPolYX;
TRadioButton *rbTxPolYY;
TLabeledEdit *leTxAtt;
TCSpinButton *sbTxAtt;
TGroupBox *GroupBox7;
TRadioButton *rbRxPolXX;
TRadioButton *rbRxPolYY;
TRadioButton *rbRxPolXY;
TRadioButton *rbRxPolYX;
TLabeledEdit *leRxAtt;
TCSpinButton *sbRxAtt;
TPanel *Panel2;
TRadioButton *rbRxAnt0;
TRadioButton *rbRxAnt1;
TCSpinButton *sbMaxSubBufNum;
TLabeledEdit *leBurstLen;
TCSpinButton *CSpinButton6;
TRadioButton *rbDdsRstBurst;
TRadioButton *rbDdsRstPulse;
TCheckBox *cbLOGM;
TLabeledEdit *leGeterodin;
TCSpinButton *CSpinButton7;
TCheckBox *cbMGEN;
TCSpinEdit *seMLEN;
void __fastcall FormCreate(TObject *Sender);
void __fastcall cbPulseModClick(TObject *Sender);
void __fastcall CSpinButton1UpClick(TObject *Sender);
void __fastcall <API key>(TObject *Sender);
void __fastcall CSpinButton2UpClick(TObject *Sender);
void __fastcall <API key>(TObject *Sender);
void __fastcall CSpinButton3UpClick(TObject *Sender);
void __fastcall <API key>(TObject *Sender);
void __fastcall CSpinButton4UpClick(TObject *Sender);
void __fastcall <API key>(TObject *Sender);
void __fastcall CSpinButton5UpClick(TObject *Sender);
void __fastcall <API key>(TObject *Sender);
void __fastcall CSpinButton6UpClick(TObject *Sender);
void __fastcall <API key>(TObject *Sender);
void __fastcall sbTxAttUpClick(TObject *Sender);
void __fastcall sbTxAttDownClick(TObject *Sender);
void __fastcall sbRxAttUpClick(TObject *Sender);
void __fastcall sbRxAttDownClick(TObject *Sender);
void __fastcall rbTxPolXXClick(TObject *Sender);
void __fastcall rbTxPolXYClick(TObject *Sender);
void __fastcall rbTxPolYXClick(TObject *Sender);
void __fastcall rbTxPolYYClick(TObject *Sender);
void __fastcall rbRxPolXXClick(TObject *Sender);
void __fastcall rbRxPolXYClick(TObject *Sender);
void __fastcall rbRxPolYXClick(TObject *Sender);
void __fastcall rbRxPolYYClick(TObject *Sender);
void __fastcall rbRxAnt0Click(TObject *Sender);
void __fastcall rbRxAnt1Click(TObject *Sender);
void __fastcall cbContClick(TObject *Sender);
void __fastcall BitBtn1Click(TObject *Sender);
void __fastcall cbLFMClick(TObject *Sender);
void __fastcall cbUWBClick(TObject *Sender);
void __fastcall cbGateClick(TObject *Sender);
void __fastcall FormDestroy(TObject *Sender);
void __fastcall <API key>(TObject *Sender);
void __fastcall <API key>(TObject *Sender);
void __fastcall <API key>(TObject *Sender);
void __fastcall cbDDSResetClick(TObject *Sender);
void __fastcall cbLOGMClick(TObject *Sender);
void __fastcall CSpinButton7UpClick(TObject *Sender);
void __fastcall <API key>(TObject *Sender);
private:
public: // User declarations
__fastcall TformSettings(TComponent* Owner);
void __fastcall TformSettings::SaveConfig(AnsiString FileName);
void __fastcall TformSettings::LoadConfig(AnsiString FileName);
};
extern PACKAGE TformSettings *formSettings;
#endif |
<!DOCTYPE HTML PUBLIC "-
<!-- NewPage -->
<html lang="en">
<head>
<!-- Generated by javadoc (1.8.0_91) on Mon Aug 22 09:59:24 CST 2016 -->
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Uses of Class play.libs.I18N (Play! API)</title>
<meta name="date" content="2016-08-22">
<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="Uses of Class play.libs.I18N (Play! API)";
}
}
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><a href="../package-summary.html">Package</a></li>
<li><a href="../../../play/libs/I18N.html" title="class in play.libs">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?play/libs/class-use/I18N.html" target="_top">Frames</a></li>
<li><a href="I18N.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 Class play.libs.I18N" class="title">Uses of Class<br>play.libs.I18N</h2>
</div>
<div class="classUseContainer">No usage of play.libs.I18N</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><a href="../../../play/libs/I18N.html" title="class in play.libs">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?play/libs/class-use/I18N.html" target="_top">Frames</a></li>
<li><a href="I18N.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><a href=http:
</body>
</html> |
'use strict';
// BUILD
// The only purpose of this gulpfile is to build a XOS view and copy the correct files into
// .html => dashboards
// .js (minified and concat) => static/js
// The template are parsed and added to js with angular $templateCache
var gulp = require('gulp');
var ngAnnotate = require('gulp-ng-annotate');
var uglify = require('gulp-uglify');
var templateCache = require('<API key>');
var runSequence = require('run-sequence');
var concat = require('gulp-concat-util');
var del = require('del');
var wiredep = require('wiredep');
var angularFilesort = require('<API key>');
var _ = require('lodash');
var eslint = require('gulp-eslint');
var inject = require('gulp-inject');
var rename = require('gulp-rename');
var replace = require('gulp-replace');
var postcss = require('gulp-postcss');
var autoprefixer = require('autoprefixer');
var mqpacker = require('css-mqpacker');
var csswring = require('csswring');
var yaml = require('js-yaml');
var colors = require('colors/safe');
var fs = require('fs');
const TEMPLATE_FOOTER = `
angular.module('xos.serviceGrid')
.run(['$location', function(a){
a.path('/');
}])
`
module.exports = function(options){
// delete previous builded file
gulp.task('clean', function(){
return del(
[
options.dashboards + 'xosServiceGrid.html',
options.static + 'css/xosServiceGrid.css',
options.static + 'images/serviceGrid-icon.png',
options.static + 'images/<API key>.png'
],
{force: true}
);
});
// minify css
gulp.task('css', function () {
var processors = [
autoprefixer({browsers: ['last 1 version']}),
mqpacker,
csswring
];
gulp.src([
`${options.css}**/*.css`,
`!${options.css}dev.css`
])
.pipe(postcss(processors))
.pipe(gulp.dest(options.tmp + '/css/'));
});
// copy css in correct folder
gulp.task('copyCss', ['wait'], function(){
options.tmp + '**/*.js'
return gulp.src(['src/js*.js']) |
package esiv3
/*
200 ok object */
type <API key> struct {
/*
Number of NPC ships killed in this system */
NpcKills int32 `json:"npc_kills,omitempty"`
/*
Number of pods killed in this system */
PodKills int32 `json:"pod_kills,omitempty"`
/*
Number of player ships killed in this system */
ShipKills int32 `json:"ship_kills,omitempty"`
/*
system_id integer */
SystemId int32 `json:"system_id,omitempty"`
} |
package com.ekingsoft.core.json;
/**
* The <code>JSONString</code> interface allows a <code>toJSONString()</code>
* method so that a class can change the behavior of
* <code>JSONObject.toString()</code>, <code>JSONArray.toString()</code>,
* and <code>JSONWriter.value(</code>Object<code>)</code>. The
* <code>toJSONString</code> method will be used instead of the default behavior
* of using the Object's <code>toString()</code> method and quoting the result.
*/
public interface JSONString {
/**
* The <code>toJSONString</code> method allows a class to produce its own JSON
* serialization.
*
* @return A strictly syntactically correct JSON text.
*/
public String toJSONString();
} |
var NodeRSA = require('node-rsa');
exports.getRandomstring = function(length) {
var text = "";
var possible = "<API key>";
for (var i = 0; i < length; i++)
text += possible.charAt(Math.floor(Math.random() * possible.length));
return text;
}
exports.getHash = function(value) {
var crypto = require('crypto');
return crypto.createHash('sha256').update(value).digest('base64');
}
if (typeof process.env.OPENMONEY_API_KEY == 'undefined'){
process.env.OPENMONEY_<TwitterConsumerkey>+9tm5zBG0/P60ZPXz/MVh0+/vryhZ5z/X23tME3d0HuzhlB/<API key>++<API key>+paiyIZLs7jrjwxUVl1J+<API key>+A==';
}
// generate public key
const key = new NodeRSA({b: 1024});
exports.new_key = key
exports.testing_publicKey = key.exportKey('pkcs8-public-pem');
exports.clone = function(obj) {
if (null == obj || "object" != typeof obj) return obj;
var copy = obj.constructor();
for (var attr in obj) {
if (obj.hasOwnProperty(attr)) copy[attr] = obj[attr];
}
return copy;
}
var crypto = require('crypto');
// algorithm = 'aes-256-gcm',
// <API key>,
/ do not use a global iv for production,
/ generate a new one for each encryption
// iv = '60iP0h6vJoEa'
exports.encrypt = function encrypt(text, algorithm, password, iv) {
var cipher = crypto.createCipheriv(algorithm, password, iv);
var encrypted = cipher.update(JSON.stringify(text), 'utf8', 'hex');
encrypted += cipher.final('hex');
var tag = cipher.getAuthTag();
return {
content: encrypted,
tag: tag
};
}
exports.decrypt = function decrypt(encrypted, algorithm, password, iv) {
var decipher = crypto.createDecipheriv(algorithm, password, iv);
decipher.setAuthTag(encrypted.tag);
var dec = decipher.update(encrypted.content, 'hex', 'utf8');
dec += decipher.final('utf8');
return JSON.parse(dec);
} |
# Laschia javanica (Holterm.) Sacc. & Trotter SPECIES
# Status
ACCEPTED
# According to
Index Fungorum
# Published in
Syll. fung. (Abellini) 21: 358 (1912)
# Original name
Favolaschia javanica Holterm.
Remarks
null |
$(document).ready(function(){
$("#back").on('click',function(){
movemm(-1);
});
$("#forward").on('click',function(){
movemm(1);
});
});
function movemm(dir) {
var curr = $("#curr").val();
$("#newCurr").val(parseInt(curr) + dir);
$("#movemmfrm").submit();
} |
#!/bin/bash
# Restore a snapshot
# Configuration
REPO=<API key> # Name of snapshot repository
HOST=$1
PORT=$2
SNAPSHOT=$3
if [[ -z $HOST || -z $PORT || -z $SNAPSHOT ]]; then
echo "Usage: bash elastic-restore.sh <hostname> <port> <snapshot name>"
echo "ex. bash elastic-restore.sh localhost 9200 20160822-164139"
exit
else
INDEX=annotator
# Close the index
curl -XPOST "http://$HOST:$PORT/$INDEX/_close"
# Restore the snapshot
curl -XPOST "http://$HOST:$PORT/_snapshot/$REPO/$SNAPSHOT/_restore"
# Re-open the index
curl -XPOST "http://$HOST:$PORT/$INDEX/_open"
echo "Restore snapshot - Done!"
fi |
OUT = ex1
SRC = $(wildcard *.c)
OBJ = $(SRC:.c=.o)
CC := mpicc
CFLAGS := -std=c11 -O2 -pedantic -Wall -Wextra -lm $(CFLAGS)
LDFLAGS := $(LDFLAGS)
LDLIBS =
all: $(OUT)
strip: $(OUT)
strip --strip-all $(OUT)
clean:
$(RM) $(OUT) $(OBJ)
.PHONY: all clean |
namespace CJia.Health.Tools
{
partial class WinFrom
{
<summary>
Required designer variable.
</summary>
private System.ComponentModel.IContainer components = null;
<summary>
Clean up any resources being used.
</summary>
<param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
<summary>
Required method for Designer support - do not modify
the contents of this method with the code editor.
</summary>
private void InitializeComponent()
{
this.SuspendLayout();
// WinFrom
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(284, 217);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
this.Name = "WinFrom";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
this.Text = "WinFrom";
this.ResumeLayout(false);
}
#endregion
}
} |
#ifndef <API key>
#define <API key>
#include "base/memory/singleton.h"
#include "chrome/browser/profiles/<API key>.h"
class LoginUIService;
class Profile;
// Singleton that owns all LoginUIServices and associates them with
// Profiles. Listens for the Profile's destruction notification and cleans up
// the associated LoginUIService.
class <API key> : public <API key> {
public:
// Returns the instance of LoginUIService associated with this profile
// (creating one if none exists). Returns NULL if this profile cannot have a
// LoginUIService (for example, if |profile| is incognito).
static LoginUIService* GetForProfile(Profile* profile);
// Returns an instance of the <API key> singleton.
static <API key>* GetInstance();
private:
friend struct <API key><<API key>>;
<API key>();
virtual ~<API key>();
// <API key>:
virtual ProfileKeyedService* <API key>(
content::BrowserContext* profile) const OVERRIDE;
<API key>(<API key>);
};
#endif // <API key> |
package biz.bsoft.web.controller;
import biz.bsoft.orders.dao.ItemInfoRepository;
import biz.bsoft.orders.dao.OrderRepository;
import biz.bsoft.orders.model.*;
import biz.bsoft.orders.service.OrderService;
import biz.bsoft.users.service.UserService;
import biz.bsoft.web.View;
import biz.bsoft.web.dto.OrderItemError;
import com.fasterxml.jackson.annotation.JsonView;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.format.annotation.DateTimeFormat;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
import java.security.Principal;
import java.time.LocalDate;
import java.util.List;
@RestController
@RequestMapping("/orders")
public class <API key> {
@Autowired
OrderService orderService;
@Autowired
UserService userService;
@Autowired
private OrderRepository orderRepository;
@Autowired
private ItemInfoRepository itemInfoRepository;
private static final Logger logger =
LoggerFactory.getLogger(<API key>.class);
// @RequestMapping(value = "/{id}", method = RequestMethod.GET)
// public Order getOrder(@PathVariable("id") Integer id) {
// Order order = orderRepository.findOne(id);
// return order;
@RequestMapping(value = "/order")
public Order getOrder(@RequestParam("date") @DateTimeFormat(pattern = "dd.MM.yyyy") LocalDate date,
@RequestParam(name = "pos", required = false) Integer clientPosId,
Principal user) {
if(clientPosId==null)
clientPosId = userService.getCurrentUser().getClientPOS().getId();
else
userService.checkUserPos(user.getName(), clientPosId);
Order order = null;
try {
order = orderRepository.<API key>(clientPosId,date);
//orderService.findOrder(clientPosId, date);
} catch (Exception e) {
e.printStackTrace();
}
return order;
}
@RequestMapping(value = "/orderstatus")
public OrderGroupStatus getOrderStatus(@RequestParam("date") @DateTimeFormat(pattern = "dd.MM.yyyy") LocalDate date,
@RequestParam("group_id") Integer groupId,
@RequestParam(name = "pos", required = false) Integer clientPosId,
Principal user) {
if(clientPosId==null)
clientPosId = userService.getCurrentUser().getClientPOS().getId();
else
userService.checkUserPos(user.getName(), clientPosId);
OrderGroupStatus orderGroupStatus = orderService.getOrderGroupStatus(clientPosId,date,groupId);
return orderGroupStatus;
}
@RequestMapping(value = "/confirmorder", method = RequestMethod.POST)
public OrderGroupStatus confirmOrder(@RequestParam("date") @DateTimeFormat(pattern = "dd.MM.yyyy") LocalDate date,
@RequestParam("group_id") Integer groupId,
@RequestParam(name = "pos", required = false) Integer clientPosId,
Principal user) {
if(clientPosId==null)
clientPosId = userService.getCurrentUser().getClientPOS().getId();
else
userService.checkUserPos(user.getName(), clientPosId);
OrderGroupStatus orderGroupStatus = orderService.confirmOrder(clientPosId,date,groupId);
return orderGroupStatus;
}
@JsonView(View.ItemsAll.class)
@RequestMapping(value = "/items")
public List<Item> getAllItems() {
List<Item> items = null;
try {
items = orderService.getAllItems();
} catch (Exception e) {
e.printStackTrace();
}
return items;
}
@JsonView(View.ItemInfoShort.class)
@RequestMapping(value = "/items_info")
public List<ItemInfo> getAllItemInfo() {
return (List) itemInfoRepository.findAll();
}
@RequestMapping(value = "/item_groups")
public List<ItemGroup> getAllItemGroups() {
List<ItemGroup> itemGroups = null;
try {
itemGroups = orderService.getAllGroups();
} catch (Exception e) {
e.printStackTrace();
}
return itemGroups;
}
@JsonView(View.ItemsId.class)
@RequestMapping(value = "/orderitems")
public List<OrderItem> getOrderItems(@RequestParam("date") @DateTimeFormat(pattern = "dd.MM.yyyy") LocalDate date,
@RequestParam("group_id") Integer groupId,
@RequestParam(name = "pos", required = false) Integer clientPosId,
Principal user) {
if(clientPosId==null)
clientPosId = userService.getCurrentUser().getClientPOS().getId();
else
userService.checkUserPos(user.getName(), clientPosId);
List<OrderItem> items = null;
try {
items = orderService.getOrderItems(clientPosId, date, groupId);
} catch (Exception e) {
e.printStackTrace();
}
return items;
}
@RequestMapping(value = "/orderitems", method = RequestMethod.POST)
public List<OrderItemError> setOrderItems(@RequestBody List<OrderItem> orderItems,
@RequestParam("date") @DateTimeFormat(pattern = "dd.MM.yyyy") LocalDate date,
@RequestParam("group_id") Integer groupId,
@RequestParam(name = "pos", required = false) Integer clientPosId,
HttpServletResponse response,
Principal user) {
if(clientPosId==null)
clientPosId = userService.getCurrentUser().getClientPOS().getId();
else
userService.checkUserPos(user.getName(), clientPosId);
//TODO need to check if all items are from the group because you can delete all items from group and insert from other group
List<OrderItemError> orderItemErrors = orderService.validateItems(orderItems, clientPosId, date, groupId);
if (orderItemErrors.size()>0) {
response.setStatus( HttpServletResponse.SC_BAD_REQUEST );
return orderItemErrors;
}
// delete old items in orders
orderService.<API key>(clientPosId, date, groupId);
// add received items in orders
orderService.addItemsToOrder(orderItems, clientPosId, date, groupId);
return null;
}
@RequestMapping(value = "/item_photos")
public List<ItemPhoto> getItemPhotos(@RequestParam("item_id") Integer itemId) {
List<ItemPhoto> itemPhotos = null;
try {
itemPhotos = orderService.getItemPhotos(itemId);
} catch (Exception e) {
e.printStackTrace();
}
return itemPhotos;
}
@RequestMapping(value = "/items/{item_id}/photos", method = RequestMethod.GET)
public List<ItemPhoto> getItemPhotosPath(@PathVariable("item_id") Integer itemId) {
List<ItemPhoto> itemPhotos = null;
try {
itemPhotos = orderService.getItemPhotos(itemId);
} catch (Exception e) {
e.printStackTrace();
}
return itemPhotos;
}
@RequestMapping(value = "/items/{item_id}/thumb", method = RequestMethod.GET, produces = MediaType.IMAGE_JPEG_VALUE)
public byte[] getItemThumbPhoto(@PathVariable("item_id") Integer itemId) {
List<ItemPhoto> itemPhotos = null;
try {
itemPhotos = orderService.getItemPhotos(itemId);
} catch (Exception e) {
e.printStackTrace();
}
if (itemPhotos.size()>0)
return itemPhotos.get(0).getPhotoSmall();
else
return null;
}
@RequestMapping(value = "/items/{item_id}/info", method = RequestMethod.GET)
public ItemInfo getItemInfo(@PathVariable("item_id") Integer itemId) {
ItemInfo itemInfo = null;
try {
itemInfo = orderService.getItemInfo(itemId);
} catch (Exception e) {
e.printStackTrace();
}
return itemInfo;
}
} |
package com.simonov.teamfan.data;
import android.content.ContentProvider;
import android.content.ContentValues;
import android.content.UriMatcher;
import android.database.Cursor;
import android.database.sqlite.SQLiteDatabase;
import android.net.Uri;
import android.support.annotation.Nullable;
import android.util.Log;
public class GamesProvider extends ContentProvider {
private static final UriMatcher sUriMatcher = buildUriMatcher();
private static final String TAG = GamesProvider.class.getSimpleName();
private GamesDbHelper mOpenHelper;
static final int GAMES = 100;
private static UriMatcher buildUriMatcher() {
final UriMatcher matcher = new UriMatcher(UriMatcher.NO_MATCH);
matcher.addURI(GamesContract.CONTENT_AUTHORITY, GamesContract.PATH_GAMES, GAMES);
return matcher;
}
@Override
public boolean onCreate() {
mOpenHelper = new GamesDbHelper(getContext());
return true;
}
@Nullable
@Override
public Cursor query(Uri uri, String[] projection, String selection, String[] selectionArgs, String sortOrder) {
Cursor retCursor = mOpenHelper.getReadableDatabase().query(
GamesContract.GamesEntry.TABLE_NAME,
projection,
selection,
selectionArgs,
null,
null,
sortOrder
);
retCursor.setNotificationUri(getContext().getContentResolver(), uri); // that`s why data don`t fill at the first start of app
return retCursor;
}
@Nullable
@Override
public String getType(Uri uri) {
if (sUriMatcher.match(uri) == GAMES) {
return GamesContract.GamesEntry.CONTENT_TYPE;
} else {
throw new <API key>("Unknown uri: " + uri);
}
}
@Nullable
@Override
public Uri insert(Uri uri, ContentValues values) {
final SQLiteDatabase db = mOpenHelper.getWritableDatabase();
long _id = db.insert(GamesContract.GamesEntry.TABLE_NAME,null, values);
Uri returnUri = GamesContract.GamesEntry.buildScheduleUri();
return returnUri;
}
@Override
public int delete(Uri uri, String selection, String[] selectionArgs) {
final SQLiteDatabase db = mOpenHelper.getWritableDatabase();
if (null == selection) selection = "1";
int rowsDeleted = db.delete(GamesContract.GamesEntry.TABLE_NAME, selection, selectionArgs);
if (rowsDeleted != 0) {
getContext().getContentResolver().notifyChange(uri,null);
}
return rowsDeleted;
}
@Override
public int update(Uri uri, ContentValues values, String selection, String[] selectionArgs) {
final SQLiteDatabase db = mOpenHelper.getWritableDatabase();
int rowsUpdated = db.update(GamesContract.GamesEntry.TABLE_NAME, values, selection, selectionArgs);
if (rowsUpdated != 0) {
getContext().getContentResolver().notifyChange(uri, null);
}
return rowsUpdated;
}
@Override
public int bulkInsert(Uri uri, ContentValues[] values) {
Log.e(TAG, "Try insert: " + values.length);
final SQLiteDatabase db = mOpenHelper.getWritableDatabase();
db.beginTransaction();
int returnCount = 0;
try {
for (ContentValues value : values){
long _id = db.insert(GamesContract.GamesEntry.TABLE_NAME,null, value);
if (_id != -1) {
returnCount++;
}
}
db.<API key>();
} finally {
db.endTransaction();
}
getContext().getContentResolver().notifyChange(uri, null);
Log.d(TAG, " insert: " + returnCount + " uri:" + uri);
return returnCount;
}
} |
package com.assylias.jbloomberg;
import com.bloomberglp.blpapi.Event;
import com.bloomberglp.blpapi.Event.EventType;
import com.bloomberglp.blpapi.Message;
import com.bloomberglp.blpapi.impl.eB;
import java.util.Iterator;
import java.util.List;
import com.bloomberglp.blpapi.impl.iS;
import mockit.Mock;
public class MockEvent extends Event {
private final EventType type;
private final List<Message> messages;
public MockEvent(EventType type, List<Message> messages) {
this.type = type;
this.messages = messages;
}
@Mock
public EventType eventType() {
return type;
}
@Mock
public Iterator<Message> iterator() {
return messages.iterator();
}
@Override
public boolean isValid() {
throw new <API key>();
}
@Override
protected iS i() {
throw new <API key>();
}
} |
package galvin.swing.editor.style;
import galvin.swing.editor.Editor;
import galvin.swing.editor.EditorDocument;
import galvin.swing.text.DocumentUtils;
import galvin.swing.text.caret.InvisibleCaret;
import galvin.swing.text.style.StyleInfo;
import galvin.swing.text.style.StyleSet;
import galvin.swing.text.style.StyleUtils;
import java.awt.Color;
import java.awt.Font;
import java.awt.event.FocusEvent;
import java.awt.event.FocusListener;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import javax.swing.JTextPane;
import javax.swing.event.CaretEvent;
import javax.swing.event.CaretListener;
import javax.swing.text.<API key>;
import javax.swing.text.Element;
import javax.swing.text.Style;
import javax.swing.text.StyledDocument;
public class StyleManager
{
private List<StyledDocument> documents = new ArrayList();
private List<JTextPane> textPanes = new ArrayList();
private HashMap<JTextPane, TextPaneListener> textPaneListeners = new HashMap();
private JTextPane currentTextPane;
private StyleControlEditor styleControlEditor;
private EditorDocument styleDocument;
private StyleSet styleSet;
private <API key> <API key>;
private <API key> <API key>;
private List<<API key>> listeners = new ArrayList();
public StyleManager()
{
this( StyleUtils.getDefaultStyleSet() );
// this( StyleUtils.<API key>() );
}
public StyleManager( StyleSet styleSet )
{
styleControlEditor = new StyleControlEditor();
styleControlEditor.setEditable( false );
styleControlEditor.setCaret( new InvisibleCaret() );
styleDocument = styleControlEditor.getEditorDocument();
setStyleSet( styleSet );
<API key> = new <API key>();
<API key> = new <API key>();
}
public Editor <API key>()
{
return styleControlEditor;
}
public void addDocument( StyledDocument document )
{
if( ! documents.contains( document ) )
{
documents.add( document );
StyleUtils.updateStyles( styleSet, document );
}
}
public void removeDocument( StyledDocument document )
{
documents.remove( document );
}
public List<StyledDocument> getDocuments()
{
List<StyledDocument> result = new ArrayList();
result.addAll( documents );
return result;
}
public void addTextPane( JTextPane textPane )
{
if( ! textPanes.contains( textPane ) )
{
textPanes.add( textPane );
TextPaneListener <API key> = new TextPaneListener( textPane );
textPaneListeners.put( textPane, <API key> );
updateStyles( textPane );
}
}
public void removeTextPane( JTextPane textPane )
{
textPanes.remove( textPane );
TextPaneListener <API key> = textPaneListeners.get( textPane );
textPane.removeFocusListener( <API key> );
textPane.removeCaretListener( <API key> );
textPaneListeners.remove( textPane );
}
public List<JTextPane> getTextPanes()
{
List<JTextPane> result = new ArrayList();
result.addAll( textPanes );
return result;
}
public void addListener( <API key> listener )
{
listeners.add( listener );
}
public void removeListener( <API key> listener )
{
listeners.remove( listener );
}
public void notifyListeners( Style style )
{
for( int i = listeners.size() - 1; i >= 0; i
{
listeners.get( i ).styleSelected( this, style );
}
}
public void highlightStyle( String styleName )
{
<API key>.setListening( false );
styleControlEditor.<API key>( false );
List<Element> paragraphElements = DocumentUtils.<API key>( styleDocument );
for( Element paragraphElement : paragraphElements )
{
Style logicalStyle = styleDocument.getLogicalStyle( paragraphElement.getStartOffset() );
if( logicalStyle != null )
{
if( logicalStyle.getName().equals( styleName ) )
{
styleControlEditor.setCaretPosition( paragraphElement.getStartOffset() );
break;
}
}
}
<API key>.setListening( true );
styleControlEditor.<API key>( true );
styleControlEditor.repaint();
}
public void updateStyles()
{
for( StyledDocument document : documents )
{
StyleUtils.updateStyles( styleSet, document );
}
for( JTextPane textPane : textPanes )
{
updateStyles( textPane );
}
}
public void updateStyles( JTextPane textPane )
{
for( StyleInfo style : styleSet.getStyles() )
{
DocumentUtils.overrideStyle( style.getLogicalName(), textPane, style.getStyle() );
}
}
public StyleSet getStyleSet()
{
return styleSet;
}
public void setStyleSet( StyleSet styleSet )
{
try
{
this.styleSet = styleSet;
styleControlEditor.setText( "" );
String name = null;
int index = 0;
int length = 0;
for( StyleInfo styleInfo : styleSet.getStyles() )
{
if( index != 0 )
{
styleDocument.insertString( index, "\n", null );
index ++;
}
name = styleInfo.getDisplayName();
length = name.length();
styleDocument.insertString( index, name, null );
styleDocument.setLogicalStyle( index, styleInfo.getStyle() );
index += name.length();
}
updateStyles();
updateStyles( styleControlEditor );
styleControlEditor.setCaretPosition( 0 );
}
catch( <API key> ble )
{
ble.printStackTrace();
}
}
private class <API key>
implements CaretListener
{
private boolean listening = true;
public <API key>()
{
styleControlEditor.addCaretListener( this );
}
public void caretUpdate( CaretEvent caretEvent )
{
int position = caretEvent.getMark();
Style style = styleDocument.getLogicalStyle( position );
for( StyleInfo styleInfo : styleSet.getStyles() )
{
Style testStyle = styleInfo.getStyle();
if( testStyle.equals( style ) )
{
notifyListeners( style );
}
}
}
public boolean isListening()
{
return listening;
}
public void setListening( boolean listening )
{
this.listening = listening;
}
}
// Line Numbers
private static Font lineNumberFont = new Font( "Monospaced", 0, 14 );
public static Font getLineNumberFont()
{
return lineNumberFont;
}
private static Color lineNumberColor = new Color( 100, 100, 255 );
public static Color getLineNumberColor()
{
return lineNumberColor;
}
private static Color <API key> = new Color( 100, 200, 200 );
public static Color <API key>()
{
return <API key>;
}
private static Color currentLineColor = new Color( 225, 225, 225 );
public static Color getCurrentLineColor()
{
return currentLineColor;
}
private static Color currentBlockColor = new Color( 225, 225, 255 );
public static Color <API key>()
{
return currentBlockColor;
}
private class TextPaneListener
implements FocusListener, CaretListener
{
private JTextPane textPane;
public TextPaneListener( JTextPane textPane )
{
this.textPane = textPane;
textPane.addFocusListener( this );
textPane.addCaretListener( this );
}
public void focusGained( FocusEvent e )
{
currentTextPane = textPane;
}
public void focusLost( FocusEvent e )
{
}
public void caretUpdate( CaretEvent caretEvent )
{
int mark = caretEvent.getMark();
StyledDocument document = textPane.getStyledDocument();
Style style = document.getLogicalStyle( mark );
highlightStyle( style.getName() );
}
}
private class <API key>
implements <API key>
{
public <API key>()
{
StyleManager.this.addListener( this );
}
public void styleSelected( Object source, Style style )
{
if( currentTextPane != null )
{
StyledDocument document = currentTextPane.getStyledDocument();
if( documents.contains( document ) )
{
int start = currentTextPane.getSelectionStart();
int end = currentTextPane.getSelectionEnd();
List<Element> paragraphs = new ArrayList();
for( int index = start; index <= end; index ++ )
{
Element paragraph = document.getParagraphElement( index );
if( ! paragraphs.contains( paragraph ) )
{
paragraphs.add( paragraph );
//document.<API key>( paragraph.getStartOffset(), paragraph.getEndOffset()-1, style, true );
document.<API key>( paragraph.getStartOffset(), paragraph.getEndOffset()-1, StyleUtils.noAttributesStyle, true );
document.setLogicalStyle( index, style );
}
}
currentTextPane.setCaretPosition( start );
currentTextPane.moveCaretPosition( end );
currentTextPane.requestFocus();
}
}
}
}
private class StyleControlEditor
extends Editor
{
private boolean <API key>;
public boolean <API key>()
{
return <API key>;
}
public void <API key>( boolean <API key> )
{
this.<API key> = <API key>;
}
@Override
protected void fireCaretUpdate(CaretEvent e)
{
if( <API key> )
{
super.fireCaretUpdate( e );
}
}
}
} |
<div class="side-bar sticky-top" style="padding-top:90px">
<div class="card">
<div class="card-block">
<div style="padding-top: 1em; padding-bottom:1em">
{% include JB/ads-block.html %}</div>
</div>
</div>
<br />
<div class="card">
<div class="card-block">
<div style="padding-left:1em; padding-right:1em;">
{% include sidebar-sign-up.html %}
</div>
</div>
</div>
</div> |
layout: post
published: true
title: Vue2
category: web
tags:
- [vue]
excerpt: Vue Vue2.0
html
javascript
<div class="myHighchart" v-if="charBtn">
<div class="tabs">
<el-button>{{chart.money}}</el-button>
<el-button>{{chart.num}}</el-button>
</div>
<vue-highcharts :Highcharts="Highcharts" :options="chartOpt1" ref="lineCharts"
style="width: 82%;margin: 0 auto"></vue-highcharts>
</div>
export default {
data: function () {
return {
chartOpt1: {
xAxis: {
categories: []
},
yAxis: {
title: {
text: ''
},
labels: {
formatter: function () {
return this.value + '';
}
}
},
series: [{
name: '',
data: []
}]
},
charBtn:false,
chart:{
money:0,
num:0,
},
}
},
}
,datachartOpt1charBtn$nextTick
javascript
getBlockList(){
this.charBtn =false;
this.load_data = true;
let postData = {
page: this.curPage,
game_id:this.queryData.game_id,
};
this.$get(`${this.$url}thirdaccess/access-order/index`, postData).then((res) => {
let result = res.data;
let lineCharts = this.$refs.lineCharts;
if (result.code == 0) {
this.totalPage = result.data.odata.count;
this.items = result.data.odata.items;
Object.keys(result.data.game_id).forEach( key => {
this.queryData.game_listArr.push({id:String(key),val:result.data.game_id[key]})
});
this.chart.money = result.data.orderStatistics.total_amount;
this.chart.num = result.data.orderStatistics.total_people;
//json 1
this.chartOpt1.xAxis.categories = result.data.orderStatistics.unit;
this.chartOpt1.series = result.data.orderStatistics.list;
this.$nextTick(function () {
this.charBtn = true;
})
this.load_data = false;
}
});
},
,asyncDataObject.assigndatachartOpt1
javascript
const asyncData = {
xAxis: {
categories: []
},
yAxis: {
title: {
text: ''
},
labels: {
formatter: function () {
return this.value + '';
}
}
},
series: [{
name: '',
data: []
}]
}
export default {
data: function () {
return {
chartOpt1:{},
charBtn:false,
chart:{
money:0,
num:0,
},
}
}
}
getBlockList(){
this.charBtn =false;
this.load_data = true;
let postData = {
page: this.curPage,
game_id:this.queryData.game_id,
};
this.$get(`${this.$url}thirdaccess/access-order/index`, postData).then((res) => {
let result = res.data;
let lineCharts = this.$refs.lineCharts;
if (result.code == 0) {
this.totalPage = result.data.odata.count;
this.items = result.data.odata.items;
Object.keys(result.data.game_id).forEach( key => {
this.queryData.game_listArr.push({id:String(key),val:result.data.game_id[key]})
});
this.chart.money = result.data.orderStatistics.total_amount;
this.chart.num = result.data.orderStatistics.total_people;
//json 2
asyncData.xAxis.categories = result.data.orderStatistics.unit;
asyncData.series = result.data.orderStatistics.list;
this.chartOpt1 = Object.assign({}, this.chartOpt1, asyncData)
this.load_data = false;
}
});
}, |
#include <stdio.h>
#include <stdint.h>
#include <stddef.h>
#include <string.h>
#include "esp_wifi.h"
#include "esp_system.h"
#include "nvs_flash.h"
#include "esp_event.h"
#include "esp_netif.h"
#include "<API key>.h"
#include "freertos/FreeRTOS.h"
#include "freertos/task.h"
#include "freertos/semphr.h"
#include "freertos/queue.h"
#include "lwip/sockets.h"
#include "lwip/dns.h"
#include "lwip/netdb.h"
#include "esp_log.h"
#include "mqtt_client.h"
static const char *TAG = "MQTTS_EXAMPLE";
extern const uint8_t <API key>[] asm("<API key>");
extern const uint8_t client_cert_pem_end[] asm("<API key>");
extern const uint8_t <API key>[] asm("<API key>");
extern const uint8_t client_key_pem_end[] asm("<API key>");
static esp_err_t mqtt_event_handler(<API key> event)
{
<API key> client = event->client;
int msg_id;
// your_context_t *context = event->context;
switch (event->event_id) {
case <API key>:
ESP_LOGI(TAG, "<API key>");
msg_id = <API key>(client, "/topic/qos0", 0);
ESP_LOGI(TAG, "sent subscribe successful, msg_id=%d", msg_id);
msg_id = <API key>(client, "/topic/qos1", 1);
ESP_LOGI(TAG, "sent subscribe successful, msg_id=%d", msg_id);
msg_id = <API key>(client, "/topic/qos1");
ESP_LOGI(TAG, "sent unsubscribe successful, msg_id=%d", msg_id);
break;
case <API key>:
ESP_LOGI(TAG, "<API key>");
break;
case <API key>:
ESP_LOGI(TAG, "<API key>, msg_id=%d", event->msg_id);
msg_id = <API key>(client, "/topic/qos0", "data", 0, 0, 0);
ESP_LOGI(TAG, "sent publish successful, msg_id=%d", msg_id);
break;
case <API key>:
ESP_LOGI(TAG, "<API key>, msg_id=%d", event->msg_id);
break;
case <API key>:
ESP_LOGI(TAG, "<API key>, msg_id=%d", event->msg_id);
break;
case MQTT_EVENT_DATA:
ESP_LOGI(TAG, "MQTT_EVENT_DATA");
printf("TOPIC=%.*s\r\n", event->topic_len, event->topic);
printf("DATA=%.*s\r\n", event->data_len, event->data);
break;
case MQTT_EVENT_ERROR:
ESP_LOGI(TAG, "MQTT_EVENT_ERROR");
break;
default:
ESP_LOGI(TAG, "Other event id:%d", event->event_id);
break;
}
return ESP_OK;
}
static void mqtt_app_start(void)
{
const <API key> mqtt_cfg = {
.uri = "mqtts://test.mosquitto.org:8884",
.event_handle = mqtt_event_handler,
.client_cert_pem = (const char *)<API key>,
.client_key_pem = (const char *)<API key>,
};
ESP_LOGI(TAG, "[APP] Free memory: %d bytes", <API key>());
<API key> client = <API key>(&mqtt_cfg);
<API key>(client);
}
void app_main(void)
{
ESP_LOGI(TAG, "[APP] Startup..");
ESP_LOGI(TAG, "[APP] Free memory: %d bytes", <API key>());
ESP_LOGI(TAG, "[APP] IDF version: %s", esp_get_idf_version());
esp_log_level_set("*", ESP_LOG_INFO);
esp_log_level_set("MQTT_CLIENT", ESP_LOG_VERBOSE);
esp_log_level_set("TRANSPORT_TCP", ESP_LOG_VERBOSE);
esp_log_level_set("TRANSPORT_SSL", ESP_LOG_VERBOSE);
esp_log_level_set("TRANSPORT", ESP_LOG_VERBOSE);
esp_log_level_set("OUTBOX", ESP_LOG_VERBOSE);
ESP_ERROR_CHECK(nvs_flash_init());
ESP_ERROR_CHECK(esp_netif_init());
ESP_ERROR_CHECK(<API key>());
/* This helper function configures Wi-Fi or Ethernet, as selected in menuconfig.
* Read "Establishing Wi-Fi or Ethernet Connection" section in
* examples/protocols/README.md for more information about this function.
*/
ESP_ERROR_CHECK(example_connect());
mqtt_app_start();
} |
package com.konkerlabs.platform.registry.data.core.services.publishers;
import com.konkerlabs.platform.registry.business.model.*;
import com.konkerlabs.platform.registry.business.repositories.<API key>;
import com.konkerlabs.platform.registry.business.services.LocationTreeUtils;
import com.konkerlabs.platform.registry.business.services.api.<API key>;
import com.konkerlabs.platform.registry.business.services.api.<API key>;
import com.konkerlabs.platform.registry.business.services.api.ServiceResponse;
import com.konkerlabs.platform.registry.data.core.integration.gateway.RabbitGateway;
import com.konkerlabs.platform.registry.data.core.services.publishers.api.EventPublisher;
import com.konkerlabs.platform.registry.data.core.services.api.<API key>;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.config.BeanDefinition;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Service;
import java.net.URI;
import java.util.List;
import java.util.Map;
import java.util.Optional;
@Service(DeviceModelLocation.URI_SCHEME)
@Scope(BeanDefinition.SCOPE_SINGLETON)
public class <API key> implements EventPublisher {
private static final String EVENT_DROPPED = "Outgoing event has been dropped: [URI: {0}] - [Message: {1}]";
private static final Logger LOGGER = LoggerFactory.getLogger(<API key>.class);
public static final String DEVICE_MQTT_CHANNEL = "channel";
private RabbitGateway rabbitGateway;
private <API key> <API key>;
private <API key> <API key>;
private <API key> <API key>;
private <API key> <API key>;
private <API key> <API key>;
@Autowired
public <API key>(RabbitGateway rabbitGateway) {
this.rabbitGateway = rabbitGateway;
}
@Autowired
public void <API key>(<API key> <API key>) {
this.<API key> = <API key>;
}
@Autowired
public void <API key>(<API key> <API key>) {
this.<API key> = <API key>;
}
@Autowired
public void <API key>(<API key> <API key>) {
this.<API key> = <API key>;
}
@Autowired
public void <API key>(<API key> <API key>) {
this.<API key> = <API key>;
}
@Autowired
public void <API key>(<API key> <API key>) {
this.<API key> = <API key>;
}
@Override
public void send(Event outgoingEvent, URI destinationUri, Map<String, String> data, Tenant tenant, Application application)
throws Exception {
Optional.ofNullable(outgoingEvent)
.orElseThrow(() -> new <API key>("Event cannot be null"));
Optional.ofNullable(destinationUri)
.filter(uri -> !uri.toString().isEmpty())
.orElseThrow(() -> new <API key>("Destination URI cannot be null or empty"));
Optional.ofNullable(data)
.orElseThrow(() -> new <API key>("Data cannot be null"));
Optional.ofNullable(data.get(DEVICE_MQTT_CHANNEL))
.filter(s -> !s.isEmpty())
.orElseThrow(() -> new <API key>("A valid MQTT channel is required"));
Optional.ofNullable(tenant)
.orElseThrow(() -> new <API key>("Tenant cannot be null"));
Optional.ofNullable(application)
.orElseThrow(() -> new <API key>("Application cannot be null"));
String uriPath = destinationUri.getPath();
if (uriPath.startsWith("/")) {
uriPath = uriPath.substring(1);
}
String guids[] = uriPath.split("/");
if (guids.length < 2) {
LOGGER.warn("Invalid model location URI: {}", uriPath);
return;
}
String deviceModelGuid = guids[0];
String locationGuid = guids[1];
DeviceModel deviceModel = <API key>.<API key>(tenant.getId(), application.getName(), deviceModelGuid);
Optional.ofNullable(deviceModel)
.orElseThrow(() -> new <API key>("Device model cannot be null"));
ServiceResponse<Location> locationService = <API key>.findByGuid(tenant, application, locationGuid);
if (!locationService.isOk()) {
Optional.ofNullable(deviceModel)
.orElseThrow(() -> new <API key>("Invalid location"));
}
Location location = locationService.getResult();
locationService = <API key>.findByName(tenant, application, location.getName(), true);
if (!locationService.isOk()) {
Optional.ofNullable(deviceModel)
.orElseThrow(() -> new <API key>("Invalid location tree"));
}
List<Location> nodes = LocationTreeUtils.getNodesList(locationService.getResult());
ServiceResponse<List<Device>> devicesResponse = <API key>.findAll(tenant, application);
if (devicesResponse.isOk()) {
List<Device> devices = devicesResponse.getResult();
devices.parallelStream().forEach((outgoingDevice) -> {
if (<API key>(outgoingDevice, deviceModel, nodes) &&
!isIncomingDevice(outgoingEvent, outgoingDevice)) {
if (outgoingDevice.isActive()) {
<API key>.sendMessage(outgoingEvent, data, outgoingDevice);
}
}
});
}
}
private boolean isIncomingDevice(Event outgoingEvent, Device outgoingDevice) {
return outgoingEvent.getIncoming().getDeviceGuid().equals(outgoingDevice.getGuid());
}
private boolean <API key>(Device outgoingDevice, DeviceModel deviceModel, List<Location> nodes) {
if (outgoingDevice.getDeviceModel() == null) {
return false;
}
if (!outgoingDevice.getDeviceModel().getName().equals(deviceModel.getName())) {
return false;
}
for (Location locations: nodes) {
String deviceLocation = outgoingDevice.getLocation().getName();
if (locations.getName().equals(outgoingDevice.getLocation().getName())) {
return true;
}
}
return false;
}
} |
Model = typeof Model == 'undefined' ? {} : Model;
var runnable = function(fw){
cmodel.__reg('models', []);//echo
var modelTools = {
/**
* modelgetter/settermodeltemp
*/
defineProperty:function(property){
Object.defineProperty(this, property,{
get:function(){
return this.__smr__.dataMap[property];
},
set:function(v){
if(v!=this.__smr__.dataMap[property]){
this.__smr__.dataMap[property]=v;
this._setDirty();
}
}
});
},
setDefineProperties:function (targetObj,propertyMap,configueable,writable,enumerable){
var configueable = configueable||false,
writable = writable||false,
enumerable = enumerable||false;
if(typeof Object.defineProperty != 'undefined'){
for(var p in propertyMap){
Object.defineProperty(targetObj,p,
{
value:propertyMap[p],
configueable:configueable,
writable:writable,
enumerable:enumerable
}
);
}
}else{
for(var p in propertyMap){
targetObj[p] = propertyMap[p];
}
}
}
};
/**
* model function lib
* _
* model save
*/
var modelBaseProto = {
_isModel:true,
_idField : 'smr_id',
_clientIdField : '__clientId',
//return trueneed save
_isClean : function(){
return !this.__smr__.isDirty && !this.__smr__.isPhantom;
},
_isDeleted : function(){
return this.__smr__.isDeleted;
},
_setDirty : function(status){
status = typeof status == 'undefined' ? true : status;
this.__smr__.isDirty = !!status;
},
_setDeleted : function(status){
status = typeof status == 'undefined' ? true : status;
this.__smr__.isDeleted = !!status;
},
_setPhantom : function(status){
status = typeof status == 'undefined' ? true : status;
this.__smr__.isPhantom = status;
this.set(this._idField, 0);
this.set(this._clientIdField, fw.__random());
},
_setModelChain :function(parentModelChain,fieldKey){
this.__smr__.modelchain = parentModelChain.slice(0);
this.__smr__.modelchain.push(fieldKey);
},
_getModelChain :function(){
return this.__smr__.modelchain;
},
_delete : function(key){
this.__smr__.dataMap[key] = undefined;
},
/**
* clean
*/
_clean :function(){
this.__smr__.isDirty = false;
this.__smr__.isDeleted = false;
this.__smr__.isPhantom = false;
var key;
for (key in this._fieldsMap) {
var field = this._fieldsMap[key];
var fieldType = field['type'];
if(fieldType === 'model'){
this[key]._clean();
}
}
},
_getModelName : function(){
return this._modelName;
},
/**
* set,
*/
_baseSet : function(key,val){
this.__smr__.dataMap[key] = val;
},
/**
* valmodelcollection
* isDirty subModel
* isPhantom set fieldId
*/
_set : function(key, val, isDirty){
if (key in this._fieldsMap) {
var field = this._fieldsMap[key];
var fieldType = field['type'];
if(fieldType === 'model'){
var fieldModelName = field['model'];
var fieldModelRelation = field['relation'];
if(fieldModelRelation==='many'){
if(val._isCollection){
if(val._getModelName()===fieldModelName){
this._baseSet(key, val);
}else{
fw.log('model.set arguments format error');
}
}else{
if(this[key]._isCollection){
this[key].truncate();
}else{
this._baseSet(key, fw.collection.create({modelName:fieldModelName}));
}
var newModel;
for(var i = 0, l = val.length; i < l; i++){
//modeldataMap
if(val[i]._isModel){
newModel = val[i];
}else{
newModel = cmodel.create(fieldModelName,val[i]);
}
this[key].add(newModel);
}
}
}else{
if(val._isModel){
if(val._getModelName()===fieldModelName){
this._baseSet(key, val);
}else{
fw.log('model.set arguments format error');
}
}else{
this._baseSet(key, cmodel.create(fieldModelName,val));
}
}
}else{
if(this[key] === val){
return this;
}
this[key] = val;
if (key == this._idField && val != 0) {
this.__smr__.isPhantom = false;
};
}
this._setDirty(isDirty);
}
return this;
},
_setData:function(dataMap,isDirty){
var dataMap = dataMap || {};
for (var i in dataMap){
this._set(i, dataMap[i],isDirty);//modeldirty
}
this._setDirty(isDirty);
},
/**
* arguments:(key,val) dataMap
*/
set : function(key, val){
var argslen = arguments.length;
var dataMap;
if(argslen==1){
dataMap = arguments[0];
if(Library.objUtils.isObject(dataMap)){
for(var p in dataMap){
this._set(p, dataMap[p], true);
}
}
}else if(argslen==2){
this._set(key, val, true);
}
},
_setPilotId : function(pilotid){
this.__smr__.pilotid = pilotid;
},
_getPilotId : function(){
return typeof this.__smr__.pilotid == 'undefined' ? false:this.__smr__.pilotid;
},
_setStorable : function(){
fw.msgpilot.setPilot(this);
},
toJSON : function(){
var resuleJSON = {};
for(key in this.__smr__.dataMap){
if(this._fieldsMap[key]
&&this._fieldsMap[key]["type"]=="model"){
/**
* modelmodel/collection
* model/collectiongetJSON
*/
resuleJSON[key] = this.__smr__.dataMap[key].toJSON();
}else{
resuleJSON[key] = this.__smr__.dataMap[key];
}
}
return resuleJSON;
},
/**
* snapshot
*/
_takeSnapshot : function(){
this.__smr__.dataMapSnapshot = cmodel._extend({}, this.__smr__.dataMap);
},
_getSnapshot : function(){
return this.__smr__.dataMapSnapshot;
},
get : function(key){
return this.__smr__.dataMap[key];
},
getId : function(){
return this.__smr__.dataMap[this._idField];
},
getData : function(){
return this.toJSON();
},
destroy : function(){
this.__smr__.isDeleted = true;
this._setDirty();
},
/**
* key value validation
*/
validation : function(fieldKey){
if(!fw.config.get('clientValidation'))return true;
var resultObjs = [],oneField,label,validations,validation,validationMsg,type,value,resultObj;
var createFaildObj = function(key,value,validationResult){
var _obj = {};
_obj["key"] = key;
_obj["value"] = value;
_obj["msg"] = validationResult["msg"];
return _obj;
};
//modelcollectionfaild obj
var createSubFaildObj = function(key,value,faildObj){
var _obj = {}
_obj["key"] = key+"."+faildObj["key"];
/*_obj["value"] = [faildObj["value"][0]];//_obj["value"] = faildObj["value"];
_obj["value"].push(value);*/
_obj["value"] = faildObj["value"][0];
_obj["msg"] = faildObj["msg"];
return _obj;
};
//oneField
var oneFieldValidation = function(oneField){
var label = oneField["label"]||oneField['name'],
validation = oneField["validation"],
validationMsg = oneField["validationMsg"],
type = oneField["type"],
value = this[oneField['name']],
key = oneField['name'];
if(validation){
if(Library.objUtils.isString(validation)){
validations = validation.split("|");
}else{
validations = [validation];
}
for(var i=0,len = validations.length;i<len;i++){
//length
var _lengthMatch = (new RegExp("([min,max]*length)\\[([0-9]+)[\\,]*([0-9]*)\\]")).exec(validations[i]);
if(_lengthMatch){
if(_lengthMatch.length>=3){
_lengthMatch.shift();
_lengthMatch.unshift(value);
_lengthMatch.unshift(key);
_lengthMatch.unshift(label);
var validationResult = fw.validation.__load('_cvalidation').apply(this,_lengthMatch);
if(validationResult){
resultObjs.push(createFaildObj(key,value,validationResult));
}
}
}else{
var validationResult = fw.validation.__load('_cvalidation').call(this,label,key,value,validations[i]);
if(validationResult){
resultObjs.push(createFaildObj(key,value,validationResult));
}
}
}
}else if(type=="model"){
var _result = value.validation();
for(var k=0,klen=_result.length;k<klen;k++){
resultObj = createSubFaildObj(key,value,_result[k]);
resultObjs.push(resultObj);
}
}
};
if(typeof fieldKey != 'undefined'){
oneFieldValidation.call(this,this._fieldsMap[fieldKey]);
}else{
for(var p in this._fieldsMap){
oneField = this._fieldsMap[p];
oneFieldValidation.call(this,oneField);
}
}
var ispass = false;
if(resultObjs.length === 0){
ispass = true;
}
if(this.onValidation){
this.onValidation.call(this, ispass, 'client', resultObjs);
}
return resultObjs;
},
_save : function(callback, pubname, pilotid, isSubSave){
var pilotid = pilotid||this._getPilotId();
if(!pubname&&!pilotid){
this._setStorable();
pilotid = this._getPilotId();
}
//subSavevalidationvalidation
if(!isSubSave){
var validationResult = this.validation();
if(validationResult.length>0){
return validationResult;
}
}
callback = callback || function(){};
var self,//model
_self;//savemodel
if(!isSubSave){
self = this;
_self = cmodel._extend(createModel(this._getModelName()), self);
_self.__smr_assist__.__extendPointer = self;
_self.__smr_assist__.__pkgId = fw.__random();
}else{
_self = this;
self = _self.__smr_assist__.__sourcePointer[0];
}
var hasModel = false,
toSave = _self.__smr__.dataMap,
hasSaved = false,
//modelsave
doSave = function(callback){
//modelsave
for (var i in toSave) {
if (toSave[i]&&toSave[i]._isCollection) {
for (var x = 0, y = toSave[i].length; x < y; x++) {
if (toSave[i].get(x) && toSave[i].get(x)._isModel) {
if(toSave[i].get(x)._isClean()){
continue;
}
if (toSave[i].get(x).getData().isReference) {
continue;
};
// modelcallback
return;
}
}
}else if (toSave[i]&&toSave[i]._isModel) {
if(!toSave[i]._isClean() && !toSave[i].getData().isReference){
return;
}
}
}
//hasSaved savesubmodelcallback
if(hasSaved){
return;
}
hasSaved = true;
/*var _callback = function(callback,isSubSave){
return function(){
callback.apply(this,arguments);
if(!isSubSave){
if (typeof this.onSaved != 'undefined') {
this.onSaved.call(this);
};
}
};
}(callback,isSubSave);*/
var _callback = function(data){
callback.call(_self, data);
}
_self._proxy.save(_self, _callback, pubname, pilotid, _self._getModelChain().join('.'));
},
//save subModel
saveModel = function(_model){
var _model = _model;
//reference
if(_model._isClean()){
_model.__smr__.dataMap = {
isReference : true,
val : '::referenceID::' + _model._getModelName() + '::' + _model.getId()
};
return;
}
hasModel = true;
//saveiddirty
_model._save((function(_model){
return function(data){
var id = data.cnt.smr_id;
_model.__smr_assist__.__sourcePointer[0].set(_model._idField, id);
_model.__smr_assist__.__sourcePointer[0]._setDirty(false);
_model.__smr__.dataMap = {
isReference : true,
val : '::referenceID::' + _model._getModelName() + '::' + id
};
//sub modelsave callbackmain modelsave
doSave(callback);
}
})(_model), pubname, pilotid, true);
};
for (var i in toSave) {
if (toSave[i]&&toSave[i]._isCollection) {
for (var x = 0, y = toSave[i].length; x < y; x++) {
if (toSave[i].get(x)._isModel) {
toSave[i].get(x)._setModelChain(_self._getModelChain(),i);
saveModel(toSave[i].get(x));
}
}
if(toSave[i].length === 0){
//modelundefineddal
//delete toSave[i];
}
}else if(toSave[i]&&toSave[i]._isModel){
toSave[i]._setModelChain(_self._getModelChain(),i);
saveModel(toSave[i]);
}
}
if (!hasModel && !this._isClean()) {
doSave(callback);
}
return true;
},
save : function(callback, pubname, pilotid){
this._save(callback, pubname, pilotid, false);
},
/**
* @ispass true:'',false:'
* @runat 'client':,'server':
*/
onValidation : function(ispass, runat, validationResult){
}
}
/**
* model tamodlemodel template
*/
var modelBase = function(){
this._modelName = "";
this._dal = {type : 'live'};
this._proxy = {};
this._fieldsMap = {};
this._fieldsMap[this._idField] = {name : this._idField, type : 'int'};
this._fieldsMap[this._clientIdField] = {name : this._clientIdField, type : 'string'};
};
/**
* model
*/
modelTools.setDefineProperties(modelBase.prototype,modelBaseProto,false,false,true);
/**
* model
*/
var model = function(){
this.__smr__ = {
dataMap : {},
dataMapSnapshot : {},
//validationResult : {},
isDirty : false,
isPhantom : true,
isDeleted : false,
modelchain : []//modelmodel list
};
this.__smr_assist__ = {
__sourcePointer:null,
__extendPointer:null,
}
};
/**
* modelmodelcmodel.modelsmodel
*/
var getModelTemp = function(modelName){
if(typeof cmodel.models[modelName] == 'undefined' ){
//funcconfig
var exports = {},
modelDef = cmodel._getModelDef(modelName);
modelDef.call(this, exports);
modelDef = exports;
var newModelTemp = new modelBase();
newModelTemp._modelName = modelName;
if(typeof modelDef.config != 'undefined'){
var fields = modelDef.config.fields || [],
oneField;
//FIXME model_fieldsMap
//newModelTemp.fields = fields;
for(var i = 0, l = fields.length; i < l; i++){
oneField = fields[i];
newModelTemp._fieldsMap[oneField['name']] = oneField;
//FIXME validation
}
var dal = modelDef.config.layer || newModelTemp._dal;
newModelTemp._proxy = fw.__DAL.make(dal);
}
/**
* modeltempmodelbase
*/
for(var key in modelDef){
if(!modelDef.hasOwnProperty(key)){
continue;
}
if(key == 'config'){
continue;
}
newModelTemp[key] = modelDef[key];
}
cmodel.models[modelName] = newModelTemp;
}
return cmodel.models[modelName];
}
/**
* model
*/
var createModel = function(modelName,dataMap){
//model
var modelTemp = getModelTemp(modelName);
//modelmodel
var newModel = new model();
newModel.__proto__ = modelTemp;
var _fieldsMap = modelTemp._fieldsMap, oneField;
for(var p in _fieldsMap){
oneField = _fieldsMap[p];
//getter/settergetter/setter
modelTools.defineProperty.call(newModel,oneField['name']);
if(oneField['type'] === 'model' && typeof oneField['model'] !== 'undefined'){
if( typeof oneField['relation'] !== 'undefined' && oneField['relation']=='many'){
//Model
//collection
var subCollection = fw.collection.create({modelName : oneField['model']});
newModel[oneField['name']] = subCollection;
}else{
var subModel = cmodel.create(oneField['model']);
newModel[oneField['name']] = subModel;
}
} else {
if (oneField['type'] == 'datetime' && oneField['defaultValue'] == 'now()') {
//now()
newModel[oneField['name']] = fw.utils.getTimeStamp();
} else if(oneField['type'] == 'array'){
//FIXME arrayeval
newModel[oneField['name']] = eval(oneField['defaultValue']) || [];
} else if(oneField['type'] == 'object'){
newModel[oneField['name']] = fw.utils.parseJSON(oneField['defaultValue']) || [];
} else {
newModel[oneField['name']] = oneField['defaultValue'] || undefined; //undefined
}
}
}
newModel._setPhantom();
if(dataMap){
newModel._setData(dataMap,false);
}
return newModel;
};
/**
* ModelCollection
* param target,source-1,source-2...source-n
*/
var extendModel = function(){
var objUtils = Library.objUtils;
var options, name, src, copy, copyIsArray, copyIsCollection, copyIsModel, clone,
target = arguments[0] || {},
i = 1,
length = arguments.length;
// Handle case when target is a string or something (possible in deep copy)
if ( typeof target !== "object" && !objUtils.isFunction(target) ) {
target = {};
}
// if only one argument is passed, do nothing
if ( length === i ) {
return target;
}
for ( ; i < length; i++ ) {
// Only deal with non-null/undefined values
if ( (options = arguments[ i ]) != null ) {
// Extend the base object
for ( name in options ) {
if (!options.hasOwnProperty(name)) {
continue;
};
if(name == '__smr_assist__'){
continue;
}
src = target[ name ];
copy = options[ name ];
// Prevent never-ending loop
if ( target === copy ) {
continue;
}
// Recurse if we're merging model objects, collection objects or arrays
if ( copy && ( objUtils.isPlainObject(copy)
|| (copyIsCollection = copy._isCollection)
|| (copyIsModel = copy._isModel)
|| (copyIsArray = objUtils.isArray(copy)) ) ) {
if ( copyIsArray ) {
copyIsArray = false;
clone = src && objUtils.isArray(src) ? src : [];
} else if(copyIsCollection){
copyIsCollection = false;
clone = src && src._isCollection ? src : fw.collection.create({modelName : copy._getModelName()});
} else if(copyIsModel) {
copyIsModel = false;
clone = src && src._isModel ? src : cmodel.create(copy._getModelName());
clone.__smr_assist__.__sourcePointer = copy.__smr_assist__.__sourcePointer || [];
clone.__smr_assist__.__sourcePointer.push(copy);
} else {
clone = src && objUtils.isPlainObject(src) ? src : {};
}
// Never move original objects, clone them
target[ name ] = extendModel(clone, copy);
// Don't bring in undefined values
} else if ( copy !== undefined ) {
target[ name ] = copy;
}
}
}
}
// Return the modified object
return target;
}
cmodel.__reg('create', createModel);
cmodel.__reg('_extend', extendModel);
cmodel.__reg('_getModelTemp', getModelTemp);
};
var cmodel;
if(typeof module != 'undefined' && module.exports){//server
module.exports = function(_fw){
fw = _fw;
cmodel = fw.addSubPackage('model');
cmodel.__reg('_getModelDef', function(modelName){
if (modelName.search("Model.") != -1 ) {//modelName,Model.xxx,xxx
modelName = modelName.substr(6);
}
return Model[modelName];
});
//dal
if (typeof fw.__DAL == 'undefined'){
fw.__DAL = {};
fw.__DAL.make = function(){};
fw.__DAL.make.save = function(){};
}
runnable(fw);
}
}else{//client
cmodel = sumeru.addSubPackage('model');
//cmodel.__reg('models', []);//echo
cmodel.__reg('_getModelDef', function(modelName){
return eval(modelName);
});
runnable(sumeru);
}
//for node
/*if(typeof exports != 'undefined'){
exports.createModel = fw.__modelFactory;
}*/ |
package org.echoice.core.module.jpa;
import java.util.ArrayList;
import java.util.List;
import javax.persistence.criteria.CriteriaBuilder;
import javax.persistence.criteria.CriteriaQuery;
import javax.persistence.criteria.Predicate;
import javax.persistence.criteria.Root;
import org.springframework.data.jpa.domain.Specification;
public class Criteria<T> implements Specification<T>{
private List<Criterion> criterions = new ArrayList<Criterion>();
public Predicate toPredicate(Root<T> root, CriteriaQuery<?> query,
CriteriaBuilder builder) {
if (!criterions.isEmpty()) {
List<Predicate> predicates = new ArrayList<Predicate>();
for(Criterion c : criterions){
predicates.add(c.toPredicate(root, query,builder));
}
if (predicates.size() > 0) {
return builder.and(predicates.toArray(new Predicate[predicates.size()]));
}
}
return builder.conjunction();
}
public void add(Criterion criterion){
if(criterion!=null){
criterions.add(criterion);
}
}
} |
<!DOCTYPE HTML PUBLIC "-
<!-- NewPage -->
<html lang="en">
<head>
<!-- Generated by javadoc (version 1.7.0_07) on Tue Apr 16 09:12:46 CEST 2013 -->
<title>ext.ojalgo.jexcel.database</title>
<meta name="date" content="2013-04-16">
<link rel="stylesheet" type="text/css" href="../../../../stylesheet.css" title="Style">
</head>
<body>
<h1 class="bar"><a href="../../../../ext/ojalgo/jexcel/database/package-summary.html" target="classFrame">ext.ojalgo.jexcel.database</a></h1>
<div class="indexContainer">
<h2 title="Classes">Classes</h2>
<ul title="Classes">
<li><a href="BooleanColumn.html" title="class in ext.ojalgo.jexcel.database" target="classFrame">BooleanColumn</a></li>
<li><a href="Column.html" title="class in ext.ojalgo.jexcel.database" target="classFrame">Column</a></li>
<li><a href="Database.html" title="class in ext.ojalgo.jexcel.database" target="classFrame">Database</a></li>
<li><a href="DatabaseSpreadsheet.html" title="class in ext.ojalgo.jexcel.database" target="classFrame">DatabaseSpreadsheet</a></li>
<li><a href="DateColumn.html" title="class in ext.ojalgo.jexcel.database" target="classFrame">DateColumn</a></li>
<li><a href="NumberColumn.html" title="class in ext.ojalgo.jexcel.database" target="classFrame">NumberColumn</a></li>
<li><a href="StringColumn.html" title="class in ext.ojalgo.jexcel.database" target="classFrame">StringColumn</a></li>
<li><a href="Table.html" title="class in ext.ojalgo.jexcel.database" target="classFrame">Table</a></li>
</ul>
</div>
</body>
</html> |
(function() {
"use strict";
var parseErrors = [
{"description": "[basx572] Near-specials " + "(Conversion_syntax)", "string": "-9Inf"},
{
"description": "[basx516] The 'baddies' tests from DiagBigDecimal, plus some new ones " +
"(Conversion_syntax)",
"string": "-1-"
},
{
"description": "[basx533] The 'baddies' tests from DiagBigDecimal, plus some new ones " +
"(Conversion_syntax)",
"string": "0000.."
},
{
"description": "[basx534] The 'baddies' tests from DiagBigDecimal, plus some new ones " +
"(Conversion_syntax)",
"string": ".0000."
},
{
"description": "[basx535] The 'baddies' tests from DiagBigDecimal, plus some new ones " +
"(Conversion_syntax)",
"string": "00..00"
},
{"description": "[basx569] Near-specials " + "(Conversion_syntax)", "string": "0Inf"},
{"description": "[basx571] Near-specials " + "(Conversion_syntax)", "string": "-0Inf"},
{"description": "[basx575] Near-specials " + "(Conversion_syntax)", "string": "0sNaN"},
{
"description": "[basx503] The 'baddies' tests from DiagBigDecimal, plus some new ones " +
"(Conversion_syntax)",
"string": "++1"
},
{
"description": "[basx504] The 'baddies' tests from DiagBigDecimal, plus some new ones " +
"(Conversion_syntax)",
"string": "--1"
},
{
"description": "[basx505] The 'baddies' tests from DiagBigDecimal, plus some new ones " +
"(Conversion_syntax)",
"string": "-+1"
},
{
"description": "[basx506] The 'baddies' tests from DiagBigDecimal, plus some new ones " +
"(Conversion_syntax)",
"string": "+-1"
},
{
"description": "[basx510] The 'baddies' tests from DiagBigDecimal, plus some new ones " +
"(Conversion_syntax)",
"string": " +1"
},
{
"description": "[basx513] The 'baddies' tests from DiagBigDecimal, plus some new ones " +
"(Conversion_syntax)",
"string": " + 1"
},
{
"description": "[basx514] The 'baddies' tests from DiagBigDecimal, plus some new ones " +
"(Conversion_syntax)",
"string": " - 1"
},
{
"description": "[basx501] The 'baddies' tests from DiagBigDecimal, plus some new ones " +
"(Conversion_syntax)",
"string": "."
},
{
"description": "[basx502] The 'baddies' tests from DiagBigDecimal, plus some new ones " +
"(Conversion_syntax)",
"string": ".."
},
{
"description": "[basx519] The 'baddies' tests from DiagBigDecimal, plus some new ones " +
"(Conversion_syntax)",
"string": ""
},
{
"description": "[basx525] The 'baddies' tests from DiagBigDecimal, plus some new ones " +
"(Conversion_syntax)",
"string": "e100"
},
{
"description": "[basx549] The 'baddies' tests from DiagBigDecimal, plus some new ones " +
"(Conversion_syntax)",
"string": "e+1"
},
{
"description": "[basx577] some baddies with dots and Es and dots and specials " +
"(Conversion_syntax)",
"string": ".e+1"
},
{
"description": "[basx578] some baddies with dots and Es and dots and specials " +
"(Conversion_syntax)",
"string": "+.e+1"
},
{
"description": "[basx581] some baddies with dots and Es and dots and specials " +
"(Conversion_syntax)",
"string": "E+1"
},
{
"description": "[basx582] some baddies with dots and Es and dots and specials " +
"(Conversion_syntax)",
"string": ".E+1"
},
{
"description": "[basx583] some baddies with dots and Es and dots and specials " +
"(Conversion_syntax)",
"string": "+.E+1"
},
{
"description": "[basx579] some baddies with dots and Es and dots and specials " +
"(Conversion_syntax)",
"string": "-.e+"
},
{
"description": "[basx580] some baddies with dots and Es and dots and specials " +
"(Conversion_syntax)",
"string": "-.e"
},
{
"description": "[basx584] some baddies with dots and Es and dots and specials " +
"(Conversion_syntax)",
"string": "-.E+"
},
{
"description": "[basx585] some baddies with dots and Es and dots and specials " +
"(Conversion_syntax)",
"string": "-.E"
},
{
"description": "[basx589] some baddies with dots and Es and dots and specials " +
"(Conversion_syntax)",
"string": "+.Inf"
},
{
"description": "[basx586] some baddies with dots and Es and dots and specials " +
"(Conversion_syntax)",
"string": ".NaN"
},
{
"description": "[basx587] some baddies with dots and Es and dots and specials " +
"(Conversion_syntax)",
"string": "-.NaN"
},
{
"description": "[basx545] The 'baddies' tests from DiagBigDecimal, plus some new ones " +
"(Conversion_syntax)",
"string": "ONE"
},
{"description": "[basx561] Near-specials " + "(Conversion_syntax)", "string": "qNaN"},
{"description": "[basx573] Near-specials " + "(Conversion_syntax)", "string": "-sNa"},
{
"description": "[basx588] some baddies with dots and Es and dots and specials " +
"(Conversion_syntax)",
"string": "+.sNaN"
},
{
"description": "[basx544] The 'baddies' tests from DiagBigDecimal, plus some new ones " +
"(Conversion_syntax)",
"string": "ten"
},
{
"description": "[basx527] The 'baddies' tests from DiagBigDecimal, plus some new ones " +
"(Conversion_syntax)",
"string": "u0b65"
},
{
"description": "[basx526] The 'baddies' tests from DiagBigDecimal, plus some new ones " +
"(Conversion_syntax)",
"string": "u0e5a"
},
{
"description": "[basx515] The 'baddies' tests from DiagBigDecimal, plus some new ones " +
"(Conversion_syntax)",
"string": "x"
},
{"description": "[basx574] Near-specials " + "(Conversion_syntax)", "string": "xNaN"},
{
"description": "[basx530] The 'baddies' tests from DiagBigDecimal, plus some new ones " +
"(Conversion_syntax)",
"string": ".123.5"
},
{
"description": "[basx500] The 'baddies' tests from DiagBigDecimal, plus some new ones " +
"(Conversion_syntax)",
"string": "1..2"
},
{
"description": "[basx542] The 'baddies' tests from DiagBigDecimal, plus some new ones " +
"(Conversion_syntax)",
"string": "1e1.0"
},
{
"description": "[basx553] The 'baddies' tests from DiagBigDecimal, plus some new ones " +
"(Conversion_syntax)",
"string": "1E+1.2.3"
},
{
"description": "[basx543] The 'baddies' tests from DiagBigDecimal, plus some new ones " +
"(Conversion_syntax)",
"string": "1e123e"
},
{
"description": "[basx552] The 'baddies' tests from DiagBigDecimal, plus some new ones " +
"(Conversion_syntax)",
"string": "1E+1.2"
},
{
"description": "[basx546] The 'baddies' tests from DiagBigDecimal, plus some new ones " +
"(Conversion_syntax)",
"string": "1e.1"
},
{
"description": "[basx547] The 'baddies' tests from DiagBigDecimal, plus some new ones " +
"(Conversion_syntax)",
"string": "1e1."
},
{
"description": "[basx554] The 'baddies' tests from DiagBigDecimal, plus some new ones " +
"(Conversion_syntax)",
"string": "1E++1"
},
{
"description": "[basx555] The 'baddies' tests from DiagBigDecimal, plus some new ones " +
"(Conversion_syntax)",
"string": "1E--1"
},
{
"description": "[basx556] The 'baddies' tests from DiagBigDecimal, plus some new ones " +
"(Conversion_syntax)",
"string": "1E+-1"
},
{
"description": "[basx557] The 'baddies' tests from DiagBigDecimal, plus some new ones " +
"(Conversion_syntax)",
"string": "1E-+1"
},
{
"description": "[basx558] The 'baddies' tests from DiagBigDecimal, plus some new ones " +
"(Conversion_syntax)",
"string": "1E'1"
},
{
"description": "[basx559] The 'baddies' tests from DiagBigDecimal, plus some new ones " +
"(Conversion_syntax)",
"string": "1E\"1"
},
{
"description": "[basx520] The 'baddies' tests from DiagBigDecimal, plus some new ones " +
"(Conversion_syntax)",
"string": "1e-"
},
{
"description": "[basx560] The 'baddies' tests from DiagBigDecimal, plus some new ones " +
"(Conversion_syntax)",
"string": "1E"
},
{
"description": "[basx548] The 'baddies' tests from DiagBigDecimal, plus some new ones " +
"(Conversion_syntax)",
"string": "1ee"
},
{
"description": "[basx551] The 'baddies' tests from DiagBigDecimal, plus some new ones " +
"(Conversion_syntax)",
"string": "1.2.1"
},
{
"description": "[basx550] The 'baddies' tests from DiagBigDecimal, plus some new ones " +
"(Conversion_syntax)",
"string": "1.23.4"
},
{
"description": "[basx529] The 'baddies' tests from DiagBigDecimal, plus some new ones " +
"(Conversion_syntax)",
"string": "1.34.5"
},
{
"description": "[basx531] The 'baddies' tests from DiagBigDecimal, plus some new ones " +
"(Conversion_syntax)",
"string": "01.35."
},
{
"description": "[basx532] The 'baddies' tests from DiagBigDecimal, plus some new ones " +
"(Conversion_syntax)",
"string": "01.35-"
},
{
"description": "[basx518] The 'baddies' tests from DiagBigDecimal, plus some new ones " +
"(Conversion_syntax)",
"string": "3+"
},
{
"description": "[basx521] The 'baddies' tests from DiagBigDecimal, plus some new ones " +
"(Conversion_syntax)",
"string": "7e99999a"
},
{"description": "[basx570] Near-specials " + "(Conversion_syntax)", "string": "9Inf"},
{
"description": "[basx512] The 'baddies' tests from DiagBigDecimal, plus some new ones " +
"(Conversion_syntax)",
"string": "12 "
},
{
"description": "[basx517] The 'baddies' tests from DiagBigDecimal, plus some new ones " +
"(Conversion_syntax)",
"string": "12-"
},
{
"description": "[basx507] The 'baddies' tests from DiagBigDecimal, plus some new ones " +
"(Conversion_syntax)",
"string": "12e"
},
{
"description": "[basx508] The 'baddies' tests from DiagBigDecimal, plus some new ones " +
"(Conversion_syntax)",
"string": "12e++"
},
{
"description": "[basx509] The 'baddies' tests from DiagBigDecimal, plus some new ones " +
"(Conversion_syntax)",
"string": "12f4"
},
{
"description": "[basx536] The 'baddies' tests from DiagBigDecimal, plus some new ones " +
"(Conversion_syntax)",
"string": "111e*123"
},
{
"description": "[basx537] The 'baddies' tests from DiagBigDecimal, plus some new ones " +
"(Conversion_syntax)",
"string": "111e123-"
},
{
"description": "[basx540] The 'baddies' tests from DiagBigDecimal, plus some new ones " +
"(Conversion_syntax)",
"string": "111e1*23"
},
{
"description": "[basx538] The 'baddies' tests from DiagBigDecimal, plus some new ones " +
"(Conversion_syntax)",
"string": "111e+12+"
},
{
"description": "[basx539] The 'baddies' tests from DiagBigDecimal, plus some new ones " +
"(Conversion_syntax)",
"string": "111e1-3-"
},
{
"description": "[basx541] The 'baddies' tests from DiagBigDecimal, plus some new ones " +
"(Conversion_syntax)",
"string": "111E1e+3"
},
{
"description": "[basx528] The 'baddies' tests from DiagBigDecimal, plus some new ones " +
"(Conversion_syntax)",
"string": "123,65"
},
{
"description": "[basx523] The 'baddies' tests from DiagBigDecimal, plus some new ones " +
"(Conversion_syntax)",
"string": "7e12356789012x"
},
{
"description": "[basx522] The 'baddies' tests from DiagBigDecimal, plus some new ones " +
"(Conversion_syntax)",
"string": "7e123567890x"
}
];
parseErrors.forEach(function(testCase) {
print(`Test - ${testCase.description}`);
function test() {
NumberDecimal(testCase.string);
}
assert.throws(test, [], `[Test - ${testCase.description}] should have failed with error.`);
});
}()); |
package org.functionalkoans.forscala
import org.functionalkoans.forscala.support.KoanFunSuite
import org.scalatest.Matchers
class AboutApply extends KoanFunSuite with Matchers {
koan("""The apply method is a magical method in Scala, it is a method that doesn't require you
|to leave out the entire method name!""") {
class Counter(val seed:Int) {
def apply(n:Int) = new Counter(seed + n)
}
var a = new Counter(10)
a = a.apply(20)
a.seed should be (__)
a = a(40) //Whoa! Look Ma! No apply!
a.seed should be (__)
}
koan("""The apply method can also be used in singleton objects as well, in fact, it is the most common way
to create a factory method in an object""") {
class Employee (val firstName:String, val lastName:String) //private constructor!
object Employee {
def apply(firstName:String, lastName:String) = new Employee(firstName, lastName)
}
var a = Employee.apply("Aleksander", "Neufied")
a.firstName should be (__)
val b = Employee("Jamie", "Pindar")
a.lastName should be (__)
}
} |
package com.github.lynzabo.codegen.mavenplugin;
*//**
*//*
*//**
*//*
*//**
*//*
*//**
*//*
*//**
*//*
*//**
*//*
*//**
*//*
*//**
*//*
/*
*
* @goal count
*
* @phase process-sources
public class CountMojo extends AbstractMojo
{
private static final String[] INCLUDES_DEFAULT = {"java", "xml", "sql", "properties"};
private static final String[] RATIOS_DEFAULT = {"1.0", "0.25", "0.25", "0.25"};
private static final String DOT = ".";
* @parameter expression="${project.basedir}"
* @required
* @readonly
private File basedir;
* @parameter expression="${project.build.sourceDirectory}"
* @required
* @readonly
private File sourcedir;
* @parameter expression="${project.build.testSourceDirectory}"
* @required
* @readonly
private File testSourcedir;
* @parameter expression="${project.resources}"
* @required
* @readonly
private List<Resource> resources;
//private List<File> resources;
* @parameter expression="${project.testResources}"
* @required
* @readonly
private List<Resource> testResources;
//private List<File> testResources;
* @parameter
private String[] includes;
* @parameter
private String[] ratios;//TODO double[],xmljava.lang.ClassCastException: [D cannot be cast to [Ljava.lang.Object;
private Map<String, Double> ratioMap = new HashMap<String, Double>();
private long realTotal;
private long fakeTotal;
public void execute() throws <API key>
{
initRatioMap();
try{
countDir(sourcedir);
countDir(testSourcedir);
for(Resource res : resources){
countDir(new File(res.getDirectory()));
}
for(Resource res : testResources){
countDir(new File(res.getDirectory()));
}
getLog().info("TOTAL LINES:"+fakeTotal+ " ("+realTotal+")");
}catch (IOException e){
throw new <API key>("Unable to count lines of code", e);
}
}
private void initRatioMap() throws <API key>{
if(includes == null || includes.length == 0){
includes = INCLUDES_DEFAULT;
ratios = RATIOS_DEFAULT;
}
if(ratios == null || ratios.length == 0){
ratios = new String[includes.length];
for(int i=0; i<includes.length; i++){
ratios[i] = "1.0";
}
}
if(includes.length != ratios.length){
throw new <API key>("pom.xml error: the length of includes is inconsistent with ratios!");
}
ratioMap.clear();
for(int i=0; i<includes.length; i++){
ratioMap.put(includes[i].toLowerCase(), Double.parseDouble(ratios[i]));
}
}
private void countDir(File dir) throws IOException {
if(! dir.exists()){
return;
}
List<File> collected = new ArrayList<File>();
collectFiles(collected, dir);
int realLine = 0;
int fakeLine = 0;
for(File file : collected){
int[] line = countLine(file);
realLine += line[0];
fakeLine += line[1];
}
String path = dir.getAbsolutePath().substring(basedir.getAbsolutePath().length());
StringBuilder info = new StringBuilder().append(path).append(" : ").append(fakeLine).append(" ("+realLine+")")
.append(" lines of code in ").append(collected.size()).append(" files");
getLog().info(info.toString());
}
private void collectFiles(List<File> collected, File file)
throws IOException{
if(file.isFile()){
if(isFileTypeInclude(file)){
collected.add(file);
}
}else{
for(File files : file.listFiles()){
collectFiles(collected, files);
}
}
}
private int[] countLine(File file)
throws IOException{
BufferedReader reader = new BufferedReader(new FileReader(file));
int realLine = 0;
try{
while(reader.ready()){
reader.readLine();
realLine ++;
}
}finally{
reader.close();
}
int fakeLine = (int) (realLine * getRatio(file));
realTotal += realLine;
fakeTotal += fakeLine;
StringBuilder info = new StringBuilder().append(file.getName()).append(" : ").append(fakeLine).append(" ("+realLine+")")
.append(" lines");
getLog().debug(info.toString());
return new int[]{realLine, fakeLine};
}
private double getRatio(File file){
double ratio = 1.0;
String type = getFileType(file);
if(ratioMap.containsKey(type)){
ratio = ratioMap.get(type);
}
return ratio;
}
private boolean isFileTypeInclude(File file){
boolean result = false;
String fileType = getFileType(file);
if(fileType != null && ratioMap.keySet().contains(fileType.toLowerCase())){
result = true;
}
return result;
}
private String getFileType(File file){
String result = null;
String fname = file.getName();
int index = fname.lastIndexOf(DOT);
if(index > 0){
String type = fname.substring(index+1);
result = type.toLowerCase();
}
return result;
}
}*/ |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
from django.conf import settings
class Migration(migrations.Migration):
dependencies = [
migrations.<API key>(settings.AUTH_USER_MODEL),
]
operations = [
migrations.CreateModel(
name='Group',
fields=[
('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
('group', models.CharField(max_length=5)),
('course', models.IntegerField()),
],
),
migrations.CreateModel(
name='Job',
fields=[
('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
('name', models.CharField(max_length=100)),
('number', models.IntegerField(null=True, blank=True)),
],
),
migrations.CreateModel(
name='Log',
fields=[
('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
('mark', models.IntegerField()),
('date', models.DateField()),
('job', models.ForeignKey(to='home.Job')),
],
),
migrations.CreateModel(
name='Student',
fields=[
('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
('name', models.CharField(max_length=100)),
('patronymic', models.CharField(max_length=100)),
('surname', models.CharField(max_length=100)),
('group', models.ForeignKey(null=True, to='home.Group')),
('jobs', models.ManyToManyField(to='home.Job', through='home.Log')),
],
),
migrations.CreateModel(
name='Student_Subject',
fields=[
('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
('student', models.ForeignKey(to='home.Student')),
],
),
migrations.CreateModel(
name='Subject',
fields=[
('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
('name', models.CharField(max_length=100)),
],
),
migrations.CreateModel(
name='Teacher',
fields=[
('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
('name', models.CharField(max_length=100)),
('patronymic', models.CharField(max_length=100)),
('surname', models.CharField(max_length=100)),
('subjects', models.ManyToManyField(to='home.Subject')),
('user', models.OneToOneField(to=settings.AUTH_USER_MODEL, null=True)),
],
),
migrations.AddField(
model_name='student_subject',
name='subject',
field=models.ForeignKey(to='home.Subject'),
),
migrations.AddField(
model_name='student_subject',
name='teacher',
field=models.ForeignKey(to='home.Teacher'),
),
migrations.AddField(
model_name='student',
name='subjects',
field=models.ManyToManyField(to='home.Subject', through='home.Student_Subject'),
),
migrations.AddField(
model_name='student',
name='user',
field=models.OneToOneField(to=settings.AUTH_USER_MODEL, null=True),
),
migrations.AddField(
model_name='log',
name='student',
field=models.ForeignKey(to='home.Student'),
),
migrations.AddField(
model_name='job',
name='subject',
field=models.ForeignKey(to='home.Subject'),
),
] |
(function($){
function _1(_2,_3){
var w=0;
var b=true;
$(">div.tabs-header ul.tabs li",_2).each(function(){
if(this==_3){
b=false;
}
if(b==true){
w+=$(this).outerWidth(true);
}
});
return w;
};
function _4(_5){
var _6=$(">div.tabs-header",_5);
var _7=0;
$("ul.tabs li",_6).each(function(){
_7+=$(this).outerWidth(true);
});
var _8=$(".tabs-wrap",_6).width();
var _9=parseInt($(".tabs",_6).css("padding-left"));
return _7-_8+_9;
};
function _a(_b){
var _c=$(">div.tabs-header",_b);
var _d=0;
$("ul.tabs li",_c).each(function(){
_d+=$(this).outerWidth(true);
});
if(_d>_c.width()){
$(".tabs-scroller-left",_c).css("display","block");
$(".tabs-scroller-right",_c).css("display","block");
$(".tabs-wrap",_c).addClass("tabs-scrolling");
if($.boxModel==true){
$(".tabs-wrap",_c).css("left",2);
}else{
$(".tabs-wrap",_c).css("left",0);
}
var _e=_c.width()-$(".tabs-scroller-left",_c).outerWidth()-$(".tabs-scroller-right",_c).outerWidth();
$(".tabs-wrap",_c).width(_e);
}else{
$(".tabs-scroller-left",_c).css("display","none");
$(".tabs-scroller-right",_c).css("display","none");
$(".tabs-wrap",_c).removeClass("tabs-scrolling").scrollLeft(0);
$(".tabs-wrap",_c).width(_c.width());
$(".tabs-wrap",_c).css("left",0);
}
};
function _f(_10){
var _11=$.data(_10,"tabs").options;
var cc=$(_10);
if(_11.fit==true){
var p=cc.parent();
_11.width=p.width();
_11.height=p.height();
}
cc.width(_11.width).height(_11.height);
var _12=$(">div.tabs-header",_10);
if($.boxModel==true){
_12.width(cc.width()-(_12.outerWidth()-_12.width()));
}else{
_12.width(cc.width());
}
_a(_10);
var _13=$(">div.tabs-panels",_10);
var _14=_11.height;
if(!isNaN(_14)){
if($.boxModel==true){
var _15=_13.outerHeight()-_13.height();
_13.css("height",(_14-_12.outerHeight()-_15)||"auto");
}else{
_13.css("height",_14-_12.outerHeight());
}
}else{
_13.height("auto");
}
var _16=_11.width;
if(!isNaN(_16)){
if($.boxModel==true){
_13.width(_16-(_13.outerWidth()-_13.width()));
}else{
_13.width(_16);
}
}else{
_13.width("auto");
}
if($.parser){
setTimeout(function(){
$.parser.parse(_10);
},0);
}
};
function _17(_18){
var tab=$(">div.tabs-header ul.tabs li.tabs-selected",_18);
if(tab.length){
var _19=$.data(tab[0],"tabs.tab").id;
var _1a=$("
var _1b=$(">div.tabs-panels",_18);
if(_1b.css("height").toLowerCase()!="auto"){
if($.boxModel==true){
_1a.height(_1b.height()-(_1a.outerHeight()-_1a.height()));
_1a.width(_1b.width()-(_1a.outerWidth()-_1a.width()));
}else{
_1a.height(_1b.height());
_1a.width(_1b.width());
}
}
$(">div",_1a).triggerHandler("_resize");
}
};
function _1c(_1d){
$(_1d).addClass("tabs-container");
$(_1d).wrapInner("<div class=\"tabs-panels\"/>");
$("<div class=\"tabs-header\">"+"<div class=\"tabs-scroller-left\"></div>"+"<div class=\"tabs-scroller-right\"></div>"+"<div class=\"tabs-wrap\">"+"<ul class=\"tabs\"></ul>"+"</div>"+"</div>").prependTo(_1d);
var _1e=$(">div.tabs-header",_1d);
$(">div.tabs-panels>div",_1d).each(function(){
if(!$(this).attr("id")){
$(this).attr("id","gen-tabs-panel"+$.fn.tabs.defaults.idSeed++);
}
var _1f={id:$(this).attr("id"),title:$(this).attr("title"),content:null,href:$(this).attr("href"),closable:$(this).attr("closable")=="true",icon:$(this).attr("icon"),selected:$(this).attr("selected")=="true",cache:$(this).attr("cache")=="false"?false:true};
$(this).attr("title","");
_31(_1d,_1f);
});
$(".tabs-scroller-left, .tabs-scroller-right",_1e).hover(function(){
$(this).addClass("tabs-scroller-over");
},function(){
$(this).removeClass("tabs-scroller-over");
});
$(_1d).bind("_resize",function(){
var _20=$.data(_1d,"tabs").options;
if(_20.fit==true){
_f(_1d);
_17(_1d);
}
return false;
});
};
function _21(_22){
var _23=$.data(_22,"tabs").options;
var _24=$(">div.tabs-header",_22);
var _25=$(">div.tabs-panels",_22);
var _26=$("ul.tabs",_24);
if(_23.plain==true){
_24.addClass("tabs-header-plain");
}else{
_24.removeClass("tabs-header-plain");
}
if(_23.border==true){
_24.removeClass("<API key>");
_25.removeClass("<API key>");
}else{
_24.addClass("<API key>");
_25.addClass("<API key>");
}
$("li",_26).unbind(".tabs").bind("click.tabs",function(){
$(".tabs-selected",_26).removeClass("tabs-selected");
$(this).addClass("tabs-selected");
$(this).blur();
$(">div.tabs-panels>div",_22).css("display","none");
var _27=$(".tabs-wrap",_24);
var _28=_1(_22,this);
var _29=_28-_27.scrollLeft();
var _2a=_29+$(this).outerWidth();
if(_29<0||_2a>_27.innerWidth()){
var pos=Math.min(_28-(_27.width()-$(this).width())/2,_4(_22));
_27.animate({scrollLeft:pos},_23.scrollDuration);
}
var _2b=$.data(this,"tabs.tab");
var _2c=$("#"+_2b.id);
_2c.css("display","block");
if(_2b.href&&(!_2b.loaded||!_2b.cache)){
_2c.load(_2b.href,null,function(){
if($.parser){
$.parser.parse(_2c);
}
_23.onLoad.apply(this,arguments);
_2b.loaded=true;
});
}
_17(_22);
_23.onSelect.call(_2c,_2b.title);
});
$("a.tabs-close",_26).unbind(".tabs").bind("click.tabs",function(){
var _2d=$(this).parent()[0];
var _2e=$.data(_2d,"tabs.tab");
_3b(_22,_2e.title);
});
$(".tabs-scroller-left",_24).unbind(".tabs").bind("click.tabs",function(){
var _2f=$(".tabs-wrap",_24);
var pos=_2f.scrollLeft()-_23.scrollIncrement;
_2f.animate({scrollLeft:pos},_23.scrollDuration);
});
$(".tabs-scroller-right",_24).unbind(".tabs").bind("click.tabs",function(){
var _30=$(".tabs-wrap",_24);
var pos=Math.min(_30.scrollLeft()+_23.scrollIncrement,_4(_22));
_30.animate({scrollLeft:pos},_23.scrollDuration);
});
};
function _31(_32,_33){
var _34=$(">div.tabs-header",_32);
var _35=$("ul.tabs",_34);
var tab=$("<li></li>");
var _36=$("<span></span>").html(_33.title);
var _37=$("<a class=\"tabs-inner\"></a>").attr("href","javascript:void(0)").append(_36);
tab.append(_37).appendTo(_35);
if(_33.closable){
_36.addClass("tabs-closable");
_37.after("<a href=\"javascript:void(0)\" class=\"tabs-close\"></a>");
}
if(_33.icon){
_36.addClass("tabs-with-icon");
_36.after($("<span/>").addClass("tabs-icon").addClass(_33.icon));
}
if(_33.selected){
tab.addClass("tabs-selected");
}
if(_33.content){
$("#"+_33.id).html(_33.content);
}
$("#"+_33.id).removeAttr("title");
$.data(tab[0],"tabs.tab",{id:_33.id,title:_33.title,href:_33.href,loaded:false,cache:_33.cache});
};
function _38(_39,_3a){
_3a=$.extend({id:null,title:"",content:"",href:null,cache:true,icon:null,closable:false,selected:true,height:"auto",width:"auto"},_3a||{});
if(_3a.selected){
$(".tabs-header .tabs-wrap .tabs li",_39).removeClass("tabs-selected");
}
_3a.id=_3a.id||"gen-tabs-panel"+$.fn.tabs.defaults.idSeed++;
$("<div></div>").attr("id",_3a.id).attr("title",_3a.title).height(_3a.height).width(_3a.width).appendTo($(">div.tabs-panels",_39));
_31(_39,_3a);
};
function _3b(_3c,_3d){
var _3e=$.data(_3c,"tabs").options;
var _3f=$(">div.tabs-header li:has(a span:contains(\""+_3d+"\"))",_3c)[0];
if(!_3f){
return;
}
var _40=$.data(_3f,"tabs.tab");
var _41=$("#"+_40.id);
if(_3e.onClose.call(_41,_40.title)==false){
return;
}
var _42=$(_3f).hasClass("tabs-selected");
$.removeData(_3f,"tabs.tab");
$(_3f).remove();
_41.remove();
_f(_3c);
if(_42){
_43(_3c);
}else{
var _44=$(">div.tabs-header .tabs-wrap",_3c);
var pos=Math.min(_44.scrollLeft(),_4(_3c));
_44.animate({scrollLeft:pos},_3e.scrollDuration);
}
};
function _43(_45,_46){
if(_46){
var _47=$(">div.tabs-header li:has(a span:contains(\""+_46+"\"))",_45)[0];
if(_47){
$(_47).trigger("click");
}
}else{
var _48=$(">div.tabs-header ul.tabs",_45);
if($(".tabs-selected",_48).length==0){
$("li:first",_48).trigger("click");
}else{
$(".tabs-selected",_48).trigger("click");
}
}
};
function _49(_4a,_4b){
return $(">div.tabs-header li:has(a span:contains(\""+_4b+"\"))",_4a).length>0;
};
$.fn.tabs=function(_4c,_4d){
if(typeof _4c=="string"){
switch(_4c){
case "resize":
return this.each(function(){
_f(this);
_17(this);
});
case "add":
return this.each(function(){
_38(this,_4d);
$(this).tabs();
});
case "close":
return this.each(function(){
_3b(this,_4d);
});
case "select":
return this.each(function(){
_43(this,_4d);
});
case "exists":
return _49(this[0],_4d);
}
}
_4c=_4c||{};
return this.each(function(){
var _4e=$.data(this,"tabs");
var _4f;
if(_4e){
_4f=$.extend(_4e.options,_4c);
_4e.options=_4f;
}else{
var t=$(this);
_4f=$.extend({},$.fn.tabs.defaults,{width:(parseInt(t.css("width"))||undefined),height:(parseInt(t.css("height"))||undefined),fit:(t.attr("fit")?t.attr("fit")=="true":undefined),border:(t.attr("border")?t.attr("border")=="true":undefined),plain:(t.attr("plain")?t.attr("plain")=="true":undefined)},_4c);
_1c(this);
$.data(this,"tabs",{options:_4f});
}
_21(this);
_f(this);
_43(this);
});
};
$.fn.tabs.defaults={width:"auto",height:"auto",idSeed:0,plain:false,fit:false,border:true,scrollIncrement:100,scrollDuration:400,onLoad:function(){
},onSelect:function(_50){
},onClose:function(_51){
}};
})(jQuery); |
#!/usr/bin/env python
"""
builder plugin
Define the plugin base API for builders
for managing virtualenvs of various flavours
"""
import os
import re
import argparse
import subprocess
from collections import namedtuple
from cirrus.configuration import load_configuration
from cirrus.environment import repo_directory
from pluggage.factory_plugin import PluggagePlugin
from cirrus.logger import get_logger
from cirrus.invoke_helpers import local
LOGGER = get_logger()
PythonVersion = namedtuple("PythonVersion", "major minor micro")
<API key> = re.compile('^[0-9]{1}\.[0-9]{1}$')
<API key> = re.compile('^python[0-9]{1}\.[0-9]{1}$')
<API key> = re.compile('Python [0-9]+\.[0-9]+\.[0-9]+')
def <API key>(s):
"""
take the output of python -V and return
a version namedtuple
"""
x = <API key>.match(s.strip())
# split on space into Python/version/blah
elems = x.string.split()
vers = elems[1]
# parse version
maj, minor, micro = vers.split('.', 2)
return PythonVersion(int(maj), int(minor), int(micro))
def normalise_version(v):
if v is None:
return None
result = str(v)
if <API key>.match(str(v)):
result = 'python{}'.format(v)
if not <API key>.match(result):
msg = (
"Unable to reconcile python version from cirrus.conf build section:\n"
"Value in cirrus.conf [build]: python={v}\n"
"Expected either pythonX.Y or X.Y format"
)
LOGGER.error(msg)
raise RuntimeError(msg)
return result
def py_version_to_conda(v):
return v.replace('python', '')
def conda_version_to_py(v):
return 'python{}'.format(v)
class Builder(PluggagePlugin):
<API key> = 'builder'
def __init__(self):
super(Builder, self).__init__()
self.plugin_parser = argparse.ArgumentParser()
self.config = load_configuration()
self.build_config = self.config.get('build', {})
self.working_dir = repo_directory()
self.venv_name = self.build_config.get('virtualenv_name', 'venv')
self.reqs_name = self.build_config.get('requirements_file', 'requirements.txt')
self.extra_reqs = self.build_config.get('extra_requirements', [])
self.python_bin = self.build_config.get('python', None)
self.extra_reqs = self.str_to_list(self.extra_reqs)
self.venv_path = os.path.join(self.working_dir, self.venv_name)
def process_extra_args(self, extras):
opts, _ = self.plugin_parser.parse_known_args(extras)
return vars(opts)
def create(self, **kwargs):
"""
_create_
create a new python runtime environment
at the location provided
"""
pass
def clean(self, **kwargs):
"""
_clean_
remove the specified runtime environment
"""
pass
def activate(self):
"""
return a shell command string to activate the
runtime environment
"""
pass
def run_setup_develop(self):
LOGGER.info("Running setup.py develop...")
activate = self.activate()
local(
'{} && python setup.py develop'.format(
activate
)
)
def venv_python_version(self):
"""
get the python version from the virtualenv/conda env/pipenv
whatever
"""
command = "{} && python -V".format(self.activate())
outp = subprocess.getoutput(command)
return <API key>(outp)
@property
def python_bin_for_venv(self):
if not self.python_bin:
return self.python_bin
v = normalise_version(self.python_bin)
return v
@property
def <API key>(self):
if not self.python_bin:
return self.python_bin
v = normalise_version(self.python_bin)
return py_version_to_conda(v)
@classmethod
def str_to_list(cls, s, delim=','):
if isinstance(s, list):
return s
if delim in s:
return [x.strip() for x in s.split(delim) if x.strip()]
return [s] |
// ViewController.h
// TGFaceView
#import <UIKit/UIKit.h>
@interface ViewController : UIViewController
@end |
<!DOCTYPE HTML PUBLIC "-
<!-- NewPage -->
<html lang="en">
<head>
<!-- Generated by javadoc (1.8.0_151) on Mon Jan 15 08:36:52 MST 2018 -->
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Uses of Interface org.wildfly.swarm.config.webservices.PropertyConsumer (BOM: * : All 2018.1.0 API)</title>
<meta name="date" content="2018-01-15">
<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="Uses of Interface org.wildfly.swarm.config.webservices.PropertyConsumer (BOM: * : All 2018.1.0 API)";
}
}
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><a href="../package-summary.html">Package</a></li>
<li><a href="../../../../../../org/wildfly/swarm/config/webservices/PropertyConsumer.html" title="interface in org.wildfly.swarm.config.webservices">Class</a></li>
<li class="navBarCell1Rev">Use</li>
<li><a href="../../../../../../overview-tree.html">Tree</a></li>
<li><a href="../../../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../../../index-all.html">Index</a></li>
<li><a href="../../../../../../help-doc.html">Help</a></li>
</ul>
<div class="aboutLanguage">WildFly Swarm API, 2018.1.0</div>
</div>
<div class="subNav">
<ul class="navList">
<li>Prev</li>
<li>Next</li>
</ul>
<ul class="navList">
<li><a href="../../../../../../index.html?org/wildfly/swarm/config/webservices/class-use/PropertyConsumer.html" target="_top">Frames</a></li>
<li><a href="PropertyConsumer.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 org.wildfly.swarm.config.webservices.PropertyConsumer" class="title">Uses of Interface<br>org.wildfly.swarm.config.webservices.PropertyConsumer</h2>
</div>
<div class="classUseContainer">
<ul class="blockList">
<li class="blockList">
<table class="useSummary" border="0" cellpadding="3" cellspacing="0" summary="Use table, listing packages, and an explanation">
<caption><span>Packages that use <a href="../../../../../../org/wildfly/swarm/config/webservices/PropertyConsumer.html" title="interface in org.wildfly.swarm.config.webservices">PropertyConsumer</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.wildfly.swarm.config.webservices">org.wildfly.swarm.config.webservices</a></td>
<td class="colLast"> </td>
</tr>
</tbody>
</table>
</li>
<li class="blockList">
<ul class="blockList">
<li class="blockList"><a name="org.wildfly.swarm.config.webservices">
</a>
<h3>Uses of <a href="../../../../../../org/wildfly/swarm/config/webservices/PropertyConsumer.html" title="interface in org.wildfly.swarm.config.webservices">PropertyConsumer</a> in <a href="../../../../../../org/wildfly/swarm/config/webservices/package-summary.html">org.wildfly.swarm.config.webservices</a></h3>
<table class="useSummary" border="0" cellpadding="3" cellspacing="0" summary="Use table, listing methods, and an explanation">
<caption><span>Methods in <a href="../../../../../../org/wildfly/swarm/config/webservices/package-summary.html">org.wildfly.swarm.config.webservices</a> that return <a href="../../../../../../org/wildfly/swarm/config/webservices/PropertyConsumer.html" title="interface in org.wildfly.swarm.config.webservices">PropertyConsumer</a></span><span class="tabEnd"> </span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Method and Description</th>
</tr>
<tbody>
<tr class="altColor">
<td class="colFirst"><code>default <a href="../../../../../../org/wildfly/swarm/config/webservices/PropertyConsumer.html" title="interface in org.wildfly.swarm.config.webservices">PropertyConsumer</a><<a href="../../../../../../org/wildfly/swarm/config/webservices/PropertyConsumer.html" title="type parameter in PropertyConsumer">T</a>></code></td>
<td class="colLast"><span class="typeNameLabel">PropertyConsumer.</span><code><span class="memberNameLink"><a href="../../../../../../org/wildfly/swarm/config/webservices/PropertyConsumer.html#andThen-org.wildfly.swarm.config.webservices.PropertyConsumer-">andThen</a></span>(<a href="../../../../../../org/wildfly/swarm/config/webservices/PropertyConsumer.html" title="interface in org.wildfly.swarm.config.webservices">PropertyConsumer</a><<a href="../../../../../../org/wildfly/swarm/config/webservices/PropertyConsumer.html" title="type parameter in PropertyConsumer">T</a>> after)</code> </td>
</tr>
</tbody>
</table>
<table class="useSummary" border="0" cellpadding="3" cellspacing="0" summary="Use table, listing methods, and an explanation">
<caption><span>Methods in <a href="../../../../../../org/wildfly/swarm/config/webservices/package-summary.html">org.wildfly.swarm.config.webservices</a> with parameters of type <a href="../../../../../../org/wildfly/swarm/config/webservices/PropertyConsumer.html" title="interface in org.wildfly.swarm.config.webservices">PropertyConsumer</a></span><span class="tabEnd"> </span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Method and Description</th>
</tr>
<tbody>
<tr class="altColor">
<td class="colFirst"><code>default <a href="../../../../../../org/wildfly/swarm/config/webservices/PropertyConsumer.html" title="interface in org.wildfly.swarm.config.webservices">PropertyConsumer</a><<a href="../../../../../../org/wildfly/swarm/config/webservices/PropertyConsumer.html" title="type parameter in PropertyConsumer">T</a>></code></td>
<td class="colLast"><span class="typeNameLabel">PropertyConsumer.</span><code><span class="memberNameLink"><a href="../../../../../../org/wildfly/swarm/config/webservices/PropertyConsumer.html#andThen-org.wildfly.swarm.config.webservices.PropertyConsumer-">andThen</a></span>(<a href="../../../../../../org/wildfly/swarm/config/webservices/PropertyConsumer.html" title="interface in org.wildfly.swarm.config.webservices">PropertyConsumer</a><<a href="../../../../../../org/wildfly/swarm/config/webservices/PropertyConsumer.html" title="type parameter in PropertyConsumer">T</a>> after)</code> </td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code><a href="../../../../../../org/wildfly/swarm/config/webservices/ClientConfig.html" title="type parameter in ClientConfig">T</a></code></td>
<td class="colLast"><span class="typeNameLabel">ClientConfig.</span><code><span class="memberNameLink"><a href="../../../../../../org/wildfly/swarm/config/webservices/ClientConfig.html
<a href="../../../../../../org/wildfly/swarm/config/webservices/PropertyConsumer.html" title="interface in org.wildfly.swarm.config.webservices">PropertyConsumer</a> consumer)</code>
<div class="block">Create and configure a Property object to the list of subresources</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code><a href="../../../../../../org/wildfly/swarm/config/webservices/EndpointConfig.html" title="type parameter in EndpointConfig">T</a></code></td>
<td class="colLast"><span class="typeNameLabel">EndpointConfig.</span><code><span class="memberNameLink"><a href="../../../../../../org/wildfly/swarm/config/webservices/EndpointConfig.html
<a href="../../../../../../org/wildfly/swarm/config/webservices/PropertyConsumer.html" title="interface in org.wildfly.swarm.config.webservices">PropertyConsumer</a> consumer)</code>
<div class="block">Create and configure a Property object to the list of subresources</div>
</td>
</tr>
</tbody>
</table>
</li>
</ul>
</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><a href="../package-summary.html">Package</a></li>
<li><a href="../../../../../../org/wildfly/swarm/config/webservices/PropertyConsumer.html" title="interface in org.wildfly.swarm.config.webservices">Class</a></li>
<li class="navBarCell1Rev">Use</li>
<li><a href="../../../../../../overview-tree.html">Tree</a></li>
<li><a href="../../../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../../../index-all.html">Index</a></li>
<li><a href="../../../../../../help-doc.html">Help</a></li>
</ul>
<div class="aboutLanguage">WildFly Swarm API, 2018.1.0</div>
</div>
<div class="subNav">
<ul class="navList">
<li>Prev</li>
<li>Next</li>
</ul>
<ul class="navList">
<li><a href="../../../../../../index.html?org/wildfly/swarm/config/webservices/class-use/PropertyConsumer.html" target="_top">Frames</a></li>
<li><a href="PropertyConsumer.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> |
<!DOCTYPE HTML PUBLIC "-
<!-- NewPage -->
<html lang="en">
<head>
<!-- Generated by javadoc (1.8.0_151) on Wed Dec 04 18:43:09 MST 2019 -->
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Uses of Class org.wildfly.swarm.config.messaging.activemq.ExternalJMSQueue (BOM: * : All 2.5.1.Final-SNAPSHOT API)</title>
<meta name="date" content="2019-12-04">
<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="Uses of Class org.wildfly.swarm.config.messaging.activemq.ExternalJMSQueue (BOM: * : All 2.5.1.Final-SNAPSHOT API)";
}
}
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><a href="../package-summary.html">Package</a></li>
<li><a href="../../../../../../../org/wildfly/swarm/config/messaging/activemq/ExternalJMSQueue.html" title="class in org.wildfly.swarm.config.messaging.activemq">Class</a></li>
<li class="navBarCell1Rev">Use</li>
<li><a href="../../../../../../../overview-tree.html">Tree</a></li>
<li><a href="../../../../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../../../../index-all.html">Index</a></li>
<li><a href="../../../../../../../help-doc.html">Help</a></li>
</ul>
<div class="aboutLanguage">Thorntail API, 2.5.1.Final-SNAPSHOT</div>
</div>
<div class="subNav">
<ul class="navList">
<li>Prev</li>
<li>Next</li>
</ul>
<ul class="navList">
<li><a href="../../../../../../../index.html?org/wildfly/swarm/config/messaging/activemq/class-use/ExternalJMSQueue.html" target="_top">Frames</a></li>
<li><a href="ExternalJMSQueue.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 Class org.wildfly.swarm.config.messaging.activemq.ExternalJMSQueue" class="title">Uses of Class<br>org.wildfly.swarm.config.messaging.activemq.ExternalJMSQueue</h2>
</div>
<div class="classUseContainer">
<ul class="blockList">
<li class="blockList">
<table class="useSummary" border="0" cellpadding="3" cellspacing="0" summary="Use table, listing packages, and an explanation">
<caption><span>Packages that use <a href="../../../../../../../org/wildfly/swarm/config/messaging/activemq/ExternalJMSQueue.html" title="class in org.wildfly.swarm.config.messaging.activemq">ExternalJMSQueue</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.wildfly.swarm.config">org.wildfly.swarm.config</a></td>
<td class="colLast"> </td>
</tr>
<tr class="rowColor">
<td class="colFirst"><a href="#org.wildfly.swarm.config.messaging.activemq">org.wildfly.swarm.config.messaging.activemq</a></td>
<td class="colLast"> </td>
</tr>
</tbody>
</table>
</li>
<li class="blockList">
<ul class="blockList">
<li class="blockList"><a name="org.wildfly.swarm.config">
</a>
<h3>Uses of <a href="../../../../../../../org/wildfly/swarm/config/messaging/activemq/ExternalJMSQueue.html" title="class in org.wildfly.swarm.config.messaging.activemq">ExternalJMSQueue</a> in <a href="../../../../../../../org/wildfly/swarm/config/package-summary.html">org.wildfly.swarm.config</a></h3>
<table class="useSummary" border="0" cellpadding="3" cellspacing="0" summary="Use table, listing methods, and an explanation">
<caption><span>Methods in <a href="../../../../../../../org/wildfly/swarm/config/package-summary.html">org.wildfly.swarm.config</a> that return <a href="../../../../../../../org/wildfly/swarm/config/messaging/activemq/ExternalJMSQueue.html" title="class in org.wildfly.swarm.config.messaging.activemq">ExternalJMSQueue</a></span><span class="tabEnd"> </span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Method and Description</th>
</tr>
<tbody>
<tr class="altColor">
<td class="colFirst"><code><a href="../../../../../../../org/wildfly/swarm/config/messaging/activemq/ExternalJMSQueue.html" title="class in org.wildfly.swarm.config.messaging.activemq">ExternalJMSQueue</a></code></td>
<td class="colLast"><span class="typeNameLabel">MessagingActiveMQ.<API key>.</span><code><span class="memberNameLink"><a href="../../../../../../../org/wildfly/swarm/config/MessagingActiveMQ.<API key>.html
</tr>
</tbody>
</table>
<table class="useSummary" border="0" cellpadding="3" cellspacing="0" summary="Use table, listing methods, and an explanation">
<caption><span>Methods in <a href="../../../../../../../org/wildfly/swarm/config/package-summary.html">org.wildfly.swarm.config</a> that return types with arguments of type <a href="../../../../../../../org/wildfly/swarm/config/messaging/activemq/ExternalJMSQueue.html" title="class in org.wildfly.swarm.config.messaging.activemq">ExternalJMSQueue</a></span><span class="tabEnd"> </span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Method and Description</th>
</tr>
<tbody>
<tr class="altColor">
<td class="colFirst"><code><a href="https://docs.oracle.com/javase/8/docs/api/java/util/List.html?is-external=true" title="class or interface in java.util">List</a><<a href="../../../../../../../org/wildfly/swarm/config/messaging/activemq/ExternalJMSQueue.html" title="class in org.wildfly.swarm.config.messaging.activemq">ExternalJMSQueue</a>></code></td>
<td class="colLast"><span class="typeNameLabel">MessagingActiveMQ.<API key>.</span><code><span class="memberNameLink"><a href="../../../../../../../org/wildfly/swarm/config/MessagingActiveMQ.<API key>.html#externalJmsQueues--">externalJmsQueues</a></span>()</code>
<div class="block">Get the list of ExternalJMSQueue resources</div>
</td>
</tr>
</tbody>
</table>
<table class="useSummary" border="0" cellpadding="3" cellspacing="0" summary="Use table, listing methods, and an explanation">
<caption><span>Methods in <a href="../../../../../../../org/wildfly/swarm/config/package-summary.html">org.wildfly.swarm.config</a> with parameters of type <a href="../../../../../../../org/wildfly/swarm/config/messaging/activemq/ExternalJMSQueue.html" title="class in org.wildfly.swarm.config.messaging.activemq">ExternalJMSQueue</a></span><span class="tabEnd"> </span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Method and Description</th>
</tr>
<tbody>
<tr class="altColor">
<td class="colFirst"><code><a href="../../../../../../../org/wildfly/swarm/config/MessagingActiveMQ.html" title="type parameter in MessagingActiveMQ">T</a></code></td>
<td class="colLast"><span class="typeNameLabel">MessagingActiveMQ.</span><code><span class="memberNameLink"><a href="../../../../../../../org/wildfly/swarm/config/MessagingActiveMQ.html#<API key>.wildfly.swarm.config.messaging.activemq.ExternalJMSQueue-">externalJmsQueue</a></span>(<a href="../../../../../../../org/wildfly/swarm/config/messaging/activemq/ExternalJMSQueue.html" title="class in org.wildfly.swarm.config.messaging.activemq">ExternalJMSQueue</a> value)</code>
<div class="block">Add the ExternalJMSQueue object to the list of subresources</div>
</td>
</tr>
</tbody>
</table>
<table class="useSummary" border="0" cellpadding="3" cellspacing="0" summary="Use table, listing methods, and an explanation">
<caption><span>Method parameters in <a href="../../../../../../../org/wildfly/swarm/config/package-summary.html">org.wildfly.swarm.config</a> with type arguments of type <a href="../../../../../../../org/wildfly/swarm/config/messaging/activemq/ExternalJMSQueue.html" title="class in org.wildfly.swarm.config.messaging.activemq">ExternalJMSQueue</a></span><span class="tabEnd"> </span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Method and Description</th>
</tr>
<tbody>
<tr class="altColor">
<td class="colFirst"><code><a href="../../../../../../../org/wildfly/swarm/config/MessagingActiveMQ.html" title="type parameter in MessagingActiveMQ">T</a></code></td>
<td class="colLast"><span class="typeNameLabel">MessagingActiveMQ.</span><code><span class="memberNameLink"><a href="../../../../../../../org/wildfly/swarm/config/MessagingActiveMQ.html
<div class="block">Add all ExternalJMSQueue objects to this subresource</div>
</td>
</tr>
</tbody>
</table>
</li>
<li class="blockList"><a name="org.wildfly.swarm.config.messaging.activemq">
</a>
<h3>Uses of <a href="../../../../../../../org/wildfly/swarm/config/messaging/activemq/ExternalJMSQueue.html" title="class in org.wildfly.swarm.config.messaging.activemq">ExternalJMSQueue</a> in <a href="../../../../../../../org/wildfly/swarm/config/messaging/activemq/package-summary.html">org.wildfly.swarm.config.messaging.activemq</a></h3>
<table class="useSummary" border="0" cellpadding="3" cellspacing="0" summary="Use table, listing classes, and an explanation">
<caption><span>Classes in <a href="../../../../../../../org/wildfly/swarm/config/messaging/activemq/package-summary.html">org.wildfly.swarm.config.messaging.activemq</a> with type parameters of type <a href="../../../../../../../org/wildfly/swarm/config/messaging/activemq/ExternalJMSQueue.html" title="class in org.wildfly.swarm.config.messaging.activemq">ExternalJMSQueue</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><span class="memberNameLink"><a href="../../../../../../../org/wildfly/swarm/config/messaging/activemq/ExternalJMSQueue.html" title="class in org.wildfly.swarm.config.messaging.activemq">ExternalJMSQueue</a><T extends <a href="../../../../../../../org/wildfly/swarm/config/messaging/activemq/ExternalJMSQueue.html" title="class in org.wildfly.swarm.config.messaging.activemq">ExternalJMSQueue</a><T>></span></code>
<div class="block">Defines a JMS queue to a remote broker.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>interface </code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../../org/wildfly/swarm/config/messaging/activemq/<API key>.html" title="interface in org.wildfly.swarm.config.messaging.activemq"><API key></a><T extends <a href="../../../../../../../org/wildfly/swarm/config/messaging/activemq/ExternalJMSQueue.html" title="class in org.wildfly.swarm.config.messaging.activemq">ExternalJMSQueue</a><T>></span></code> </td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>interface </code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../../org/wildfly/swarm/config/messaging/activemq/<API key>.html" title="interface in org.wildfly.swarm.config.messaging.activemq"><API key></a><T extends <a href="../../../../../../../org/wildfly/swarm/config/messaging/activemq/ExternalJMSQueue.html" title="class in org.wildfly.swarm.config.messaging.activemq">ExternalJMSQueue</a>></span></code> </td>
</tr>
</tbody>
</table>
<table class="useSummary" border="0" cellpadding="3" cellspacing="0" summary="Use table, listing methods, and an explanation">
<caption><span>Methods in <a href="../../../../../../../org/wildfly/swarm/config/messaging/activemq/package-summary.html">org.wildfly.swarm.config.messaging.activemq</a> that return <a href="../../../../../../../org/wildfly/swarm/config/messaging/activemq/ExternalJMSQueue.html" title="class in org.wildfly.swarm.config.messaging.activemq">ExternalJMSQueue</a></span><span class="tabEnd"> </span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Method and Description</th>
</tr>
<tbody>
<tr class="altColor">
<td class="colFirst"><code><a href="../../../../../../../org/wildfly/swarm/config/messaging/activemq/ExternalJMSQueue.html" title="class in org.wildfly.swarm.config.messaging.activemq">ExternalJMSQueue</a></code></td>
<td class="colLast"><span class="typeNameLabel"><API key>.</span><code><span class="memberNameLink"><a href="../../../../../../../org/wildfly/swarm/config/messaging/activemq/<API key>.html#get--">get</a></span>()</code>
<div class="block">Constructed instance of ExternalJMSQueue resource</div>
</td>
</tr>
</tbody>
</table>
</li>
</ul>
</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><a href="../package-summary.html">Package</a></li>
<li><a href="../../../../../../../org/wildfly/swarm/config/messaging/activemq/ExternalJMSQueue.html" title="class in org.wildfly.swarm.config.messaging.activemq">Class</a></li>
<li class="navBarCell1Rev">Use</li>
<li><a href="../../../../../../../overview-tree.html">Tree</a></li>
<li><a href="../../../../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../../../../index-all.html">Index</a></li>
<li><a href="../../../../../../../help-doc.html">Help</a></li>
</ul>
<div class="aboutLanguage">Thorntail API, 2.5.1.Final-SNAPSHOT</div>
</div>
<div class="subNav">
<ul class="navList">
<li>Prev</li>
<li>Next</li>
</ul>
<ul class="navList">
<li><a href="../../../../../../../index.html?org/wildfly/swarm/config/messaging/activemq/class-use/ExternalJMSQueue.html" target="_top">Frames</a></li>
<li><a href="ExternalJMSQueue.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> |
using System.Collections.Generic;
using System.Collections.Immutable;
using System.Threading;
using System.Threading.Tasks;
using Microsoft.CodeAnalysis.Host;
namespace Microsoft.CodeAnalysis.Editor.Implementation.NavigateTo
{
internal interface <API key> : ILanguageService
{
Task<ImmutableArray<<API key>>> SearchProjectAsync(Project project, string searchPattern, Cancellation<API key>);
Task<ImmutableArray<<API key>>> SearchDocumentAsync(Document document, string searchPattern, Cancellation<API key>);
}
} |
#include <stdio.h>
#include <mpi.h>
#include "common.h"
char send_buf[MAX_SIZE];
int main(int argc, char **argv){
int i, me, target;
unsigned int size;
double t, t_max;
MPI_Win win;
MPI_Init(&argc, &argv);
MPI_Comm_rank(MPI_COMM_WORLD, &me);
MPI_Win_create(&send_buf, sizeof(char)*MAX_SIZE, 1, MPI_INFO_NULL, MPI_COMM_WORLD, &win);
MPI_Win_fence(0, win);
target = 1 - me;
init_buf(send_buf, me);
if(me==0) print_items();
for(size=1;size<MAX_SIZE+1;size*=2){
MPI_Barrier(MPI_COMM_WORLD);
for(i=0;i<LOOP+WARMUP;i++){
if(WARMUP == i)
t = wtime();
if(me == 0){
MPI_Put(send_buf, size, MPI_CHAR, target, 0, size, MPI_CHAR, win);
MPI_Win_fence(0, win);
MPI_Win_fence(0, win);
while(send_buf[0] == '0' || send_buf[size-1] == '0'){} // no need
send_buf[0] = '0'; send_buf[size-1] = '0'; // no need
}
else {
MPI_Win_fence(0, win);
while(send_buf[0] == '1' || send_buf[size-1] == '1'){} // no need
send_buf[0] = '1'; send_buf[size-1] = '1'; // no need
MPI_Put(send_buf, size, MPI_CHAR, target, 0, size, MPI_CHAR, win);
MPI_Win_fence(0, win);
}
} //end of LOOP
t = wtime() - t;
MPI_Reduce(&t, &t_max, 1, MPI_DOUBLE, MPI_MAX, 0, MPI_COMM_WORLD);
if(me == 0)
print_results(size, t_max);
}
MPI_Win_free(&win);
MPI_Finalize();
return 0;
} |
package io.digdag.standards.operator;
import com.google.common.base.Optional;
import com.google.inject.Inject;
import io.digdag.client.config.Config;
import io.digdag.client.config.ConfigElement;
import io.digdag.client.config.ConfigException;
import io.digdag.spi.Operator;
import io.digdag.spi.OperatorContext;
import io.digdag.spi.OperatorFactory;
import io.digdag.spi.TaskRequest;
import io.digdag.spi.TaskResult;
import io.digdag.spi.<API key>;
import io.digdag.util.Durations;
import io.digdag.util.Workspace;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.time.Duration;
import java.time.Instant;
import java.util.concurrent.TimeUnit;
public class WaitOperatorFactory
implements OperatorFactory {
@Inject
public WaitOperatorFactory()
{
}
@Override
public String getType()
{
return "wait";
}
@Override
public Operator newOperator(OperatorContext context)
{
return new WaitOperator(context);
}
private static class WaitOperator
implements Operator
{
private static final String <API key> = "<API key>";
private static final Logger logger = LoggerFactory.getLogger(WaitOperator.class);
private final OperatorContext context;
private final TaskRequest request;
private final Workspace workspace;
private WaitOperator(OperatorContext context)
{
this.context = context;
this.request = context.getTaskRequest();
this.workspace = Workspace.ofTaskRequest(context.getProjectPath(), request);
}
private Duration duration(Config config)
{
Duration duration;
try {
duration = Durations.parseDuration(config.get("_command", String.class));
}
catch (RuntimeException re) {
throw new ConfigException("Invalid configuration", re);
}
logger.debug("wait duration: {}", duration);
return duration;
}
private boolean blocking(Config config)
{
boolean blocking = config.get("blocking", boolean.class, false);
logger.debug("wait blocking mode: {}", blocking);
return blocking;
}
private Optional<Duration> pollInterval(Config config)
{
try {
Optional<Duration> pollInterval = config
.getOptional("poll_interval", String.class)
.transform(Durations::parseDuration);
if (pollInterval.isPresent()) {
logger.debug("wait poll_interval: {}", pollInterval.get());
}
return pollInterval;
}
catch (RuntimeException re) {
throw new ConfigException("Invalid configuration", re);
}
}
public TaskResult run()
{
Config config = request.getConfig();
Duration duration = duration(config);
boolean blocking = blocking(config);
Optional<Duration> pollInterval = pollInterval(config);
if (blocking && pollInterval.isPresent()) {
throw new ConfigException("poll_interval can't be specified with blocking:true");
}
Instant now = Instant.now();
Instant start = request.getLastStateParams()
.getOptional(<API key>, Long.class)
.transform(Instant::ofEpochMilli)
.or(now);
if (now.isAfter(start.plusMillis(duration.toMillis()))) {
logger.info("wait finished. start:{}", start);
return TaskResult.empty(request);
}
// Wait at least 1 second
long waitDurationSeconds = Math.max(
Duration.between(now, start.plusMillis(duration.toMillis())).getSeconds(),
1);
if (blocking) {
logger.debug("waiting for {}s", waitDurationSeconds);
try {
TimeUnit.SECONDS.sleep(waitDurationSeconds);
return TaskResult.empty(request);
}
catch (<API key> e) {
// The blocking wait task will be restarted from the beginning when interrupted.
// There is room to improve this behavior by making the task resume from when interrupted.
// But this operator, especially blocking mode, is for development use,
// so we'll go with this simple implementation for now.
throw new RuntimeException("`wait` operator with blocking mode is interrupted and this will be restarted from the beginning of the wait");
}
}
else {
if (pollInterval.isPresent()) {
waitDurationSeconds = pollInterval.get().getSeconds();
}
logger.debug("polling after {}s", waitDurationSeconds);
throw <API key>.ofNextPolling(
(int) waitDurationSeconds,
ConfigElement.copyOf(
request.getLastStateParams().set(<API key>, start.toEpochMilli())));
}
}
}
} |
package com.googlecode.common.admin.client;
import com.google.gwt.core.client.GWT;
import com.googlecode.common.client.app.AppInjector;
import com.googlecode.common.admin.client.ui.server.ServerBrowsePanel;
import com.googlecode.common.admin.client.ui.system.SystemBrowsePanel;
/**
* Admin DI definitions.
*/
public interface AdminInjector extends AppInjector {
static final AdminInjector INSTANCE = GWT.create(AdminInjector.class);
SystemBrowsePanel systemPanel();
ServerBrowsePanel serverPanel();
} |
const path = require('path');
const { expect } = require('../setup');
const { delay } = require('../lib/mocha-utils');
const cli = require('../lib/cli');
const fs = require('../lib/fs');
const {
PATH_TMP_DIR,
<API key>
} = require('../lib/env');
describe('Project Commands', () => {
const projName = 'test-proj';
const globalProjPath = path.join(<API key>, projName);
const localProjPath = path.join(PATH_TMP_DIR, projName);
const help = [
'Manage application projects',
'Usage: particle project <command>',
'Help: particle help project <command>',
'',
'Commands:',
' create Create a new project in the current or specified directory',
'',
'Global Options:',
' -v, --verbose Increases how much logging to display [count]',
' -q, --quiet Decreases how much logging to display [count]'
];
afterEach(async () => {
await fs.emptyDir(<API key>);
});
it('Shows `help` content', async () => {
const { stdout, stderr, exitCode } = await cli.run(['help', 'project']);
expect(stdout).to.equal('');
expect(stderr.split('\n')).to.include.members(help);
expect(exitCode).to.equal(0);
});
it('Shows `help` content when run without arguments', async () => {
const { stdout, stderr, exitCode } = await cli.run('project');
expect(stdout).to.equal('');
expect(stderr.split('\n')).to.include.members(help);
expect(exitCode).to.equal(0);
});
it('Shows `help` content when run with `--help` flag', async () => {
const { stdout, stderr, exitCode } = await cli.run(['project', '--help']);
expect(stdout).to.equal('');
expect(stderr.split('\n')).to.include.members(help);
expect(exitCode).to.equal(0);
});
describe('Project Create Subcommand', () => {
it('Creates a project', async () => {
const args = ['project', 'create', PATH_TMP_DIR];
const subprocess = cli.run(args);
await delay(1000);
subprocess.stdin.write(projName);
subprocess.stdin.end('\n');
const { stdout, stderr, exitCode } = await subprocess;
expect(await fs.exists(localProjPath)).to.equal(true);
expect(stdout).to.include(`Initializing project in directory ${localProjPath}...`);
expect(stdout).to.include(`A new project has been initialized in directory ${localProjPath}`);
expect(stderr).to.equal('');
expect(exitCode).to.equal(0);
const contents = await fs.<API key>(localProjPath, { maxDepth: 2 });
const stripRoot = (x) => x.replace(localProjPath + path.sep, '');
expect(contents.map(stripRoot)).to.eql([
'README.md',
'project.properties',
'src',
'src/test-proj.ino'
]);
});
it('Creates a project in the default location', async () => {
const args = ['project', 'create'];
const subprocess = cli.run(args);
await delay(1000);
subprocess.stdin.write(projName);
subprocess.stdin.write('\n');
await delay(1000);
subprocess.stdin.write('y');
subprocess.stdin.end('\n');
const { stdout, stderr, exitCode } = await subprocess;
expect(await fs.exists(globalProjPath)).to.equal(true);
expect(stdout).to.include(`Initializing project in directory ${globalProjPath}...`);
expect(stdout).to.include(`A new project has been initialized in directory ${globalProjPath}`);
expect(stderr).to.equal('');
expect(exitCode).to.equal(0);
const contents = await fs.<API key>(globalProjPath, { maxDepth: 2 });
const stripRoot = (x) => x.replace(globalProjPath + path.sep, '');
expect(contents.map(stripRoot)).to.eql([
'README.md',
'project.properties',
'src',
'src/test-proj.ino'
]);
});
it('Creates a project using the `--name` flag', async () => {
const args = ['project', 'create', '--name', projName, PATH_TMP_DIR];
const { stdout, stderr, exitCode } = await cli.run(args);
expect(await fs.exists(localProjPath)).to.equal(true);
expect(stdout).to.include(`Initializing project in directory ${localProjPath}...`);
expect(stdout).to.include(`A new project has been initialized in directory ${localProjPath}`);
expect(stderr).to.equal('');
expect(exitCode).to.equal(0);
const contents = await fs.<API key>(localProjPath, { maxDepth: 2 });
const stripRoot = (x) => x.replace(localProjPath + path.sep, '');
expect(contents.map(stripRoot)).to.eql([
'README.md',
'project.properties',
'src',
'src/test-proj.ino'
]);
});
});
}); |
<div id="portfolio-page" class="<API key>">
<div class="container">
<div class="portfolio-nav">
<div id="<API key>" class="<API key>">
<a href="#portfolio"><i class="fa fa-close"></i></a>
</div>
</div>
<div class="portfolio-title">
<h1>Sample Nodejs CRUD w/ MySQL</h1>
</div>
<div class="row">
<div class="col-sm-7 col-md-7 portfolio-block">
<div class="owl-carousel <API key>">
<div class="item">
<img src="images/portfolio/<API key>.png" alt="">
</div>
<div class="item">
<img src="images/portfolio/<API key>.png" alt="">
</div>
<div class="item">
<img src="images/portfolio/<API key>.png" alt="">
</div>
</div>
<script type="text/javascript">
jQuery(document).ready(function($){
$('.<API key>').owlCarousel({
smartSpeed:1200,
items: 1,
loop: true,
dots: true,
nav: true,
navText: false,
margin: 10
});
});
</script>
</div>
<div class="col-sm-5 col-md-5 portfolio-block">
<div class="block-title">
<h3>Descrição</h3>
</div>
<ul class="<API key>">
<li><p><i class="fa fa-user"></i> Pedro Augusto</p></li>
<li><p><i class="fa fa-globe"></i> <a href="https:
<li><p><i class="fa fa-github"></i> <a href="https:
<li><p><i class="fa fa-calendar"></i> 06 junho, 2017</p></li>
</ul>
<p class="text-justify">
Demonstração de uma aplicação de CRUD usando Bootstrap, NodeJS e MySQL como banco de dados.
</p>
<!-- /Project Description -->
<!-- Technology -->
<div class="tags-block">
<div class="block-title">
<h3>Tecnologias</h3>
</div>
<ul class="tags">
<li><a>NodeJS</a></li>
<li><a>Express</a></li>
<li><a>MySQL</a></li>
<li><a>CRUD</a></li>
<li><a>Bootstrap</a></li>
<li><a>HTML</a></li>
<li><a>CSS</a></li>
<li><a>JavaScript</a></li>
<li><a>JQuery</a></li>
</ul>
</div>
</div>
</div>
</div>
</div> |
sap.ui.define(['sap/ui/webc/common/thirdparty/base/asset-registries/Icons'], function (Icons) { 'use strict';
const name = "toaster-up";
const pathData = "M0 48q0-7 5-11.5T16 32h480q16 0 16 16t-16 16h-16v224q0 26-18.5 45T416 352v-32q14 0 <API key> 14 9.5 23t22.5 9v32q-26 <API key> 0-11-4.5T0 48zm112 48h288q16 0 16 16 0 6-4.5 11t-11.5 5H112q-6 0-11-5t-5-11q0-7 5-11.5t11-4.5zm0 64h96q16 0 16 16 0 6-4.5 11t-11.5 5h-96q-6 0-11-5t-5-11q0-7 5-11.5t11-4.5zm21 175l102-101q9-10 22-10 14 0 23 10l102 101q6 6 6 12 0 5-6 11-8 5-12 5-3 0-11-5l-87-87v225q0 16-16 16t-16-16V273l-85 85q-5 5-11 5-3 0-11-5-6-6-6-11 0-6 6-12z";
const ltr = false;
const collection = "SAP-icons";
const packageName = "@ui5/webcomponents-icons";
Icons.registerIcon(name, { pathData, ltr, collection, packageName });
var pathDataV5 = { pathData };
return pathDataV5;
}); |
from mysharky.writers import <API key>
#TODO should be able to pass parameters to conn fn
def mongo_conn(self):
from pymongo import MongoClient
m= MongoClient()['shark']['test']
return m
def mongo_processor(tweet, target_queue):
## TODO: recast datetime
target_queue.put(tweet)
def mongo_single_writer(self, doc):
self.batch.append(doc)
def mongo_batch_insert(self):
try:
self.conn.insert(doc for doc in self.batch)
self.beaver_shark_q.put(['info','%i documents inserted into MongoDB' % len(self.batch)])
self.batch=[]
except Exception, e:
self.beaver_shark_q.put(['exception',e])
mongo_writer= <API key>('mongo_writer')
mongo_writer.<API key>(mongo_conn)
mongo_writer.setProcessMessage(mongo_processor)
mongo_writer.setWriteOne(mongo_single_writer)
mongo_writer.setWriteBatch(mongo_batch_insert)
def csv_conn(self):
import csv
csvfile= open('tweets.csv', 'wb')
csvwriter= csv.writer(csvfile)
return csvwriter
def csv_processor(tweet, target_queue):
target_queue.put([tweet['id'], tweet['text'], tweet['user']['name']])
def csv_single_writer(self, doc):
self.batch.append(doc)
def csv_batch_insert(self):
try:
for row in self.batch:
try:
self.conn.writerow(row)
except Exception, e:
self.beaver_shark_q.put(['exception',e])
self.beaver_shark_q.put(['info','%i documents inserted into csv' % len(self.batch)])
self.batch=[]
except Exception, e:
self.beaver_shark_q.put(['exception',e])
csv_writer= <API key>('csv_writer')
csv_writer.<API key>(csv_conn)
csv_writer.setProcessMessage(csv_processor)
csv_writer.setWriteOne(csv_single_writer)
csv_writer.setWriteBatch(csv_batch_insert) |
(function () {
var initializing = false,
fnTest = /xyz/.test(function () {
var xyz;
}) ? /\b_super\b/ : /.*/;
// The base Class implementation (does nothing)
this.AnalyticsBase = function () {};
// Create a new Class that inherits from this class
AnalyticsBase.extend = function (prop) {
var _super = this.prototype;
// Instantiate a base class (but only create the instance,
// don't run the init constructor)
initializing = true;
var prototype = new this();
initializing = false;
// Copy the properties over onto the new prototype
for (var name in prop) {
// Check if we're overwriting an existing function
prototype[name] = typeof prop[name] == "function" && typeof _super[name] == "function" && fnTest.test(prop[name]) ? (function (name, fn) {
return function () {
var tmp = this._super;
// Add a new ._super() method that is the same method
// but on the super-class
this._super = _super[name];
// The method only need to be bound temporarily, so we
// remove it when we're done executing
var ret = fn.apply(this, arguments);
this._super = tmp;
return ret;
};
})(name, prop[name]) : prop[name];
}
// The dummy class constructor
function AnalyticsBase() {
// All construction is actually done in the init method
if (!initializing && this.init) this.init.apply(this, arguments);
}
// Populate our constructed prototype object
AnalyticsBase.prototype = prototype;
// Enforce the constructor to be what we expect
AnalyticsBase.constructor = AnalyticsBase;
// And make this class extendable
AnalyticsBase.extend = arguments.callee;
return AnalyticsBase;
};
})();
var Analytics = AnalyticsBase.extend({
//Constants
_PAGEVIEW: '__##PAGEVIEW##__',
_USER_AGENT: 'GoogleAnalytics/1.0 (' + Titanium.Platform.username + '; U; CPU ' + Titanium.Platform.name + ' ' + Titanium.Platform.version + ' like Mac OS X; ' + Titanium.Platform.locale + '-' + Titanium.Platform.countryCode + ')',
//Private properties
_accountId: undefined,
_db: undefined,
_session: undefined,
_storedEvents: 0,
_dispatcherIsBusy: false,
_httpClient: undefined,
//Public properties
enabled: true,
//Constructor: var analytics = new Analytics('UA-XXXXXXX-X');
init: function (accountId) {
this._accountId = accountId;
this._db = Titanium.Database.open('analytics');
this._initialize_db();
},
//Main public methods
start: function (dispatchPeriod) {
if (this.enabled) {
this._startNewVisit();
this._httpClient = Titanium.Network.createHTTPClient();
var context = this;
setInterval(function () {
context._dispatchEvents();
}, dispatchPeriod * 1000);
}
},
stop: function () {
this.enabled = false;
},
trackPageview: function (pageUrl) {
if (this._session && this.enabled) {
this._createEvent(this._PAGEVIEW, pageUrl, null, -1);
}
},
trackEvent: function (category, action, label, value) {
if (this._session && this.enabled) {
this._createEvent(category, action, label, value);
}
},
reset: function () {
Titanium.App.Properties.setString('analytics_session', null);
},
// Private methods
_initialize_db: function () {
this._db.execute('CREATE TABLE IF NOT EXISTS events (' + 'event_id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, ' + 'user_id INTEGER NOT NULL, ' + 'random_val INTEGER NOT NULL, ' + 'timestamp_first INTEGER NOT NULL, ' + 'timestamp_previous INTEGER NOT NULL, ' + 'timestamp_current INTEGER NOT NULL, ' + 'visits INTEGER NOT NULL, ' + 'category STRING NOT NULL, ' + 'action STRING NOT NULL, ' + 'label STRING NULL, ' + 'value INTEGER NOT NULL);');
var rowCount = this._db.execute('SELECT COUNT(*) FROM events');
while (rowCount.isValidRow()) {
this._storedEvents = rowCount.field(0);
rowCount.next();
}
rowCount.close();
},
_startNewVisit: function () {
var now = Math.round(new Date().getTime() / 1000);
if (!Titanium.App.Properties.hasProperty('analytics_session')) {
this._session = {
user_id: Math.floor(Math.random() * 9999999999),
timestamp_first: now,
timestamp_previous: now,
timestamp_current: now,
visits: 1
};
} else {
var oldSession = JSON.parse(Titanium.App.Properties.getString('analytics_session'));
this._session = {
user_id: oldSession.user_id,
timestamp_first: oldSession.timestamp_first,
timestamp_previous: oldSession.timestamp_current,
timestamp_current: now,
visits: oldSession.visits + 1
};
}
Titanium.App.Properties.setString('analytics_session', JSON.stringify(this._session));
},
_createEvent: function (category, action, label, value) {
if (this._storedEvents >= 1000) {
Titanium.API.warn('Analytics: Store full, not storing last event');
return;
}
var rnd = Math.floor(Math.random() * 999999999);
this._db.execute('INSERT INTO events (user_id, random_val, timestamp_first, timestamp_previous, timestamp_current, visits, category, action, label, value) VALUES (?,?,?,?,?,?,?,?,?,?)', this._session.user_id, rnd, this._session.timestamp_first, this._session.timestamp_previous, this._session.timestamp_current, this._session.visits, category, action, label, value);
this._storedEvents++;
},
_dispatchEvents: function () {
if (!this._dispatcherIsBusy && Titanium.Network.online) {
this._dispatcherIsBusy = true;
var eventRows = this._db.execute('SELECT * FROM events');
var eventsToDelete = [];
while (eventRows.isValidRow()) {
var event = {
event_id: eventRows.fieldByName('event_id'),
user_id: eventRows.fieldByName('user_id'),
random_val: eventRows.fieldByName('random_val'),
timestamp_first: eventRows.fieldByName('timestamp_first'),
timestamp_previous: eventRows.fieldByName('timestamp_previous'),
timestamp_current: eventRows.fieldByName('timestamp_current'),
visits: eventRows.fieldByName('visits'),
category: eventRows.fieldByName('category'),
action: eventRows.fieldByName('action'),
label: eventRows.fieldByName('label'),
value: eventRows.fieldByName('value')
};
var path = this.<API key>(event);
this._httpClient.open('GET', 'http:
this._httpClient.setRequestHeader('User-Agent', this._USER_AGENT);
this._httpClient.send();
eventsToDelete.push(event.event_id);
eventRows.next();
}
eventRows.close();
for (var i = 0; i < eventsToDelete.length; i++) {
this._db.execute('DELETE FROM events WHERE event_id = ?', eventsToDelete[i]);
}
this._dispatcherIsBusy = false;
}
},
<API key>: function (event) {
var path = new StringBuilder('/__utm.gif');
path.append('?utmwv=4.4mi');
path.append('&utmn=').append(event.random_val);
path.append('&utmcs=UTF-8');
path.append('&utmsr=' + Titanium.Platform.displayCaps.platformWidth + 'x' + Titanium.Platform.displayCaps.platformHeight);
path.append('&utmsc=24-bit');
path.append('&utmul=' + Titanium.Platform.locale + '-' + Titanium.Platform.countryCode);
path.append('&utmac=').append(this._accountId);
if (event.category == this._PAGEVIEW) {
//just page tracking
path.append('&utmp=').append(event.action);
} else {
//event tracking
var tmpValue = (event.value > 0) ? event.value : 1;
path.append('&utmt=event');
path.append('&utme=5(' + event.category + '*' + event.action + '*' + event.label + ')(' + tmpValue + ')');
}
path.append('&utmcc=');
var cookie = new StringBuilder('__utma=');
cookie.append('737325').append('.');
cookie.append(event.user_id).append('.');
cookie.append(event.timestamp_first).append(".");
cookie.append(event.timestamp_previous).append(".");
cookie.append(event.timestamp_current).append(".");
cookie.append(event.visits);
path.append(cookie.toString());
return path.toString();
}
});
// Initializes a new instance of the StringBuilder class
// and appends the given value if supplied
function StringBuilder(value) {
this.strings = new Array('');
this.append(value);
};
// Appends the given value to the end of this instance.
StringBuilder.prototype.append = function (value) {
if (value) {
this.strings.push(value);
}
return this;
};
// Clears the string buffer
StringBuilder.prototype.clear = function () {
this.strings.length = 1;
};
// Converts this instance to a String.
StringBuilder.prototype.toString = function () {
return this.strings.join('');
}; |
package com.webcohesion.enunciate.rt;
import com.webcohesion.enunciate.metadata.qname.XmlQNameEnum;
import com.webcohesion.enunciate.metadata.qname.XmlQNameEnumValue;
import com.webcohesion.enunciate.metadata.qname.<API key>;
import javax.xml.bind.annotation.XmlSchema;
import javax.xml.namespace.QName;
import java.lang.reflect.Field;
import java.net.URI;
import java.util.EnumMap;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.atomic.AtomicBoolean;
import java.util.concurrent.atomic.AtomicReference;
public class QNameEnumUtil {
private QNameEnumUtil() {}
private static final AtomicReference<String> DEFAULT_BASE_URI = new AtomicReference<String>();
private static final AtomicBoolean WRITE_RELATIVE_URIS = new AtomicBoolean(false);
private static final QName UNKNOWN_QNAME_ENUM = new QName("enunciate:qname-enum", "UNKNOWN");
private static final QName EXCLUDED_QNAME_ENUM = new QName("enunciate:qname-enum", "EXCLUDED");
private static final Map<Class<? extends Enum>, Map<? extends Enum, QName>> QNAME_CACHE = new ConcurrentHashMap<Class<? extends Enum>, Map<? extends Enum, QName>>();
/**
* Set the default base uri for resolving qname URIs.
*
* @param uri The default base URI.
*/
public static void setDefaultBaseUri(String uri) {
DEFAULT_BASE_URI.set(uri);
}
/**
* Get the default base uri for resolving qname URIs.
*
* @return The default base URI.
*/
public static String getDefaultBaseUri() {
return DEFAULT_BASE_URI.get();
}
/**
* Whether to write URI enums using relative URIs.
*
* @return Whether to write URI enums using relative URIs.
*/
public static boolean isWriteRelativeUris() {
return WRITE_RELATIVE_URIS.get();
}
/**
* Whether to write URI enums using relative URIs.
*
* @param writeRelativeUris Whether to write URI enums using relative URIs.
*/
public static void <API key>(boolean writeRelativeUris) {
WRITE_RELATIVE_URIS.set(writeRelativeUris);
}
public static <Q extends Enum<Q>> Q fromQName(final QName qname, Class<Q> clazz) {
if (qname == null) {
return null;
}
if (!clazz.isEnum()) {
throw new <API key>(String.format("Class %s isn't a QName enum.", clazz.getName()));
}
Map<? extends Enum, QName> qNameMap = QNAME_CACHE.get(clazz);
if (qNameMap == null) {
qNameMap = createQNameMap(clazz);
QNAME_CACHE.put(clazz, qNameMap);
}
XmlQNameEnum enumInfo = clazz.getAnnotation(XmlQNameEnum.class);
if (enumInfo.base() != XmlQNameEnum.BaseType.QNAME) {
throw new <API key>("Class " + clazz.getName() + " is supposed to be converted from a URI (not QName).");
}
Q defaultValue = null;
for (Map.Entry<? extends Enum, QName> qNameEntry : qNameMap.entrySet()) {
if (qNameEntry.getValue().equals(qname)) {
return (Q) qNameEntry.getKey();
}
else if (defaultValue == null && UNKNOWN_QNAME_ENUM.equals(qNameEntry.getValue())) {
defaultValue = (Q) qNameEntry.getKey();
}
}
return defaultValue;
}
public static QName toQName(Enum e) {
if (e == null) {
return null;
}
if (!e.getDeclaringClass().isEnum()) {
throw new <API key>(String.format("Class %s isn't a QName enum.", e.getDeclaringClass().getName()));
}
Class<Enum> clazz = e.getDeclaringClass();
Map<? extends Enum, QName> qNameMap = QNAME_CACHE.get(clazz);
if (qNameMap == null) {
qNameMap = createQNameMap(clazz);
QNAME_CACHE.put(clazz, qNameMap);
}
XmlQNameEnum enumInfo = clazz.getAnnotation(XmlQNameEnum.class);
if (enumInfo.base() != XmlQNameEnum.BaseType.QNAME) {
throw new <API key>("Class " + clazz.getName() + " is supposed to be converted from a URI (not QName).");
}
QName result = qNameMap.get(e);
if (result == null) {
throw new <API key>("Unable to find " + e.getDeclaringClass().getName() + "." + e + " as a QName enum value.");
}
else if (UNKNOWN_QNAME_ENUM.equals(result)) {
throw new <API key>(e.getDeclaringClass().getName() + "." + e + " is not a QName enum value.");
}
else if (EXCLUDED_QNAME_ENUM.equals(result)) {
throw new <API key>(e.getDeclaringClass().getName() + "." + e + " is excluded a QName enum value.");
}
else {
return result;
}
}
public static <Q extends Enum<Q>> Q fromURI(String uriValue, Class<Q> clazz) {
return fromURI(uriValue, clazz, getDefaultBaseUri());
}
public static <Q extends Enum<Q>> Q fromURI(String uriValue, Class<Q> clazz, String defaultBaseUri) {
if (uriValue == null) {
return null;
}
if (defaultBaseUri != null) {
uriValue = URI.create(defaultBaseUri).resolve(uriValue).toString();
}
if (!clazz.isEnum()) {
throw new <API key>(String.format("Class %s isn't a QName enum.", clazz.getName()));
}
Map<? extends Enum, QName> qNameMap = QNAME_CACHE.get(clazz);
if (qNameMap == null) {
qNameMap = createQNameMap(clazz);
QNAME_CACHE.put(clazz, qNameMap);
}
XmlQNameEnum enumInfo = clazz.getAnnotation(XmlQNameEnum.class);
if (enumInfo.base() != XmlQNameEnum.BaseType.URI) {
throw new <API key>("Class " + clazz.getName() + " is supposed to be converted to a QName (not URI).");
}
Q defaultValue = null;
for (Map.Entry<? extends Enum, QName> qNameEntry : qNameMap.entrySet()) {
String uri = qNameEntry.getValue().getNamespaceURI() + qNameEntry.getValue().getLocalPart();
if (uri.equals(uriValue)) {
return (Q) qNameEntry.getKey();
}
else if (defaultValue == null && UNKNOWN_QNAME_ENUM.equals(qNameEntry.getValue())) {
defaultValue = (Q) qNameEntry.getKey();
}
}
return defaultValue;
}
public static String toURI(Enum<?> e) {
return toURI(e, getDefaultBaseUri());
}
public static String toURI(Enum<?> e, String defaultBaseUri) {
if (e == null) {
return null;
}
if (!e.getDeclaringClass().isEnum()) {
throw new <API key>(String.format("Class %s isn't a QName enum.", e.getDeclaringClass().getName()));
}
Class<? extends Enum<?>> clazz = e.getDeclaringClass();
XmlQNameEnum enumInfo = clazz.getAnnotation(XmlQNameEnum.class);
if (enumInfo.base() != XmlQNameEnum.BaseType.URI) {
throw new <API key>("Class " + clazz.getName() + " is supposed to be converted to a QName (not URI).");
}
Map<? extends Enum, QName> qNameMap = QNAME_CACHE.get(clazz);
if (qNameMap == null) {
qNameMap = createQNameMap((Class<? extends Enum>) clazz);
QNAME_CACHE.put(clazz, qNameMap);
}
QName result = qNameMap.get(e);
if (result == null) {
throw new <API key>("Unable to find " + e.getDeclaringClass().getName() + "." + e + " as a QName enum value.");
}
else if (UNKNOWN_QNAME_ENUM.equals(result)) {
throw new <API key>(e.getDeclaringClass().getName() + "." + e + " is not a QName enum value.");
}
else if (EXCLUDED_QNAME_ENUM.equals(result)) {
throw new <API key>(e.getDeclaringClass().getName() + "." + e + " is excluded a QName enum value.");
}
else if (result.getNamespaceURI().equals(defaultBaseUri) && isWriteRelativeUris()) {
return result.getLocalPart();
}
else {
return result.getNamespaceURI() + result.getLocalPart();
}
}
private static <Q extends Enum<Q>> Map<? extends Enum, QName> createQNameMap(Class<Q> clazz) {
EnumMap<Q, QName> enumQNameEnumMap = new EnumMap<Q, QName>(clazz);
XmlQNameEnum enumInfo = clazz.getAnnotation(XmlQNameEnum.class);
if (enumInfo == null) {
throw new <API key>("Class " + clazz.getName() + " isn't a QName enum.");
}
String namespace = enumInfo.namespace();
if ("##default".equals(namespace)) {
Package pkg = clazz.getPackage();
if (pkg != null) {
XmlSchema schemaInfo = pkg.getAnnotation(XmlSchema.class);
namespace = schemaInfo.namespace();
}
}
Field[] fields = clazz.getDeclaredFields();
for (Q e : clazz.getEnumConstants()) {
for (Field field : fields) {
if (field.isEnumConstant() && field.getName().equals(e.name())) {
if (field.getAnnotation(<API key>.class) != null) {
enumQNameEnumMap.put(e, UNKNOWN_QNAME_ENUM);
break;
}
XmlQNameEnumValue enumValueInfo = field.getAnnotation(XmlQNameEnumValue.class);
String ns = namespace;
String localPart = field.getName();
if (enumValueInfo != null) {
if (enumValueInfo.exclude()) {
enumQNameEnumMap.put(e, EXCLUDED_QNAME_ENUM);
break;
}
else {
if (!"##default".equals(enumValueInfo.namespace())) {
ns = enumValueInfo.namespace();
}
if (!"##default".equals(enumValueInfo.localPart())) {
localPart = enumValueInfo.localPart();
}
}
}
enumQNameEnumMap.put(e, new QName(ns, localPart));
}
}
}
return enumQNameEnumMap;
}
} |
// IOEventDispatcher.h
// Library: IoT/Devices
// Package: Generated
// Module: IOEventDispatcher
// This file has been generated.
// Warning: All changes to this will be lost when the file is re-generated.
// <API key>: GPL-3.0-only
#ifndef <API key>
#define <API key>
#include "IoT/Devices/IORemoteObject.h"
#include "Poco/RemotingNG/EventDispatcher.h"
namespace IoT {
namespace Devices {
class IOEventDispatcher: public Poco::RemotingNG::EventDispatcher
The interface for general purpose input/output (GPIO)
ports.
This class represents a single GPIO pin.
Mapping to physical pins is configured when setting up
the specific IO implementation class, typically using a
configuration file.
Implementations supporting dynamically changing pin directions
should expose a string property named "direction" that takes the
values "in" and "out".
{
public:
IOEventDispatcher(IORemoteObject* pRemoteObject, const std::string& protocol);
Creates a IOEventDispatcher.
virtual ~IOEventDispatcher();
Destroys the IOEventDispatcher.
void event__stateChanged(const void* pSender, const bool& data);
void <API key>(const void* pSender, const IoT::Devices::DeviceStatusChange& data);
virtual const Poco::RemotingNG::Identifiable::TypeId& remoting__typeId() const;
private:
void <API key>(const std::string& subscriberURI, const bool& data);
void <API key>(const std::string& subscriberURI, const IoT::Devices::DeviceStatusChange& data);
static const std::string DEFAULT_NS;
IORemoteObject* _pRemoteObject;
};
inline const Poco::RemotingNG::Identifiable::TypeId& IOEventDispatcher::remoting__typeId() const
{
return IIO::remoting__typeId();
}
} // namespace Devices
} // namespace IoT
#endif // <API key> |
<!DOCTYPE HTML PUBLIC "-
<!--NewPage
<HTML>
<HEAD>
<!-- Generated by javadoc (build 1.5.0_16) on Thu Oct 02 15:35:30 BST 2008 -->
<META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<TITLE>
Uses of Class org.springframework.security.afterinvocation.AbstractAclProvider (Spring Security 2.0.4 API)
</TITLE>
<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../../stylesheet.css" TITLE="Style">
<SCRIPT type="text/javascript">
function windowTitle()
{
parent.document.title="Uses of Class org.springframework.security.afterinvocation.AbstractAclProvider (Spring Security 2.0.4 API)";
}
</SCRIPT>
<NOSCRIPT>
</NOSCRIPT>
</HEAD>
<BODY BGCOLOR="white" onload="windowTitle();">
<A NAME="navbar_top"></A>
<A HREF="#skip-navbar_top" title="Skip navigation links"></A>
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
<TR>
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<A NAME="navbar_top_firstrow"></A>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
<TR ALIGN="center" VALIGN="top">
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../org/springframework/security/afterinvocation/AbstractAclProvider.html" title="class in org.springframework.security.afterinvocation"><FONT CLASS="NavBarFont1"><B>Class</B></FONT></A> </TD>
<TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Use</B></FONT> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD>
</TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
Spring Security Framework</EM>
</TD>
</TR>
<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
PREV
NEXT</FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../../../../index.html?org/springframework/security/afterinvocation/class-use/AbstractAclProvider.html" target="_top"><B>FRAMES</B></A>
<A HREF="AbstractAclProvider.html" target="_top"><B>NO FRAMES</B></A>
<SCRIPT type="text/javascript">
<!
if(window==top) {
document.writeln('<A HREF="../../../../../allclasses-noframe.html"><B>All Classes</B></A>');
}
</SCRIPT>
<NOSCRIPT>
<A HREF="../../../../../allclasses-noframe.html"><B>All Classes</B></A>
</NOSCRIPT>
</FONT></TD>
</TR>
</TABLE>
<A NAME="skip-navbar_top"></A>
<HR>
<CENTER>
<H2>
<B>Uses of Class<br>org.springframework.security.afterinvocation.AbstractAclProvider</B></H2>
</CENTER>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
Packages that use <A HREF="../../../../../org/springframework/security/afterinvocation/AbstractAclProvider.html" title="class in org.springframework.security.afterinvocation">AbstractAclProvider</A></FONT></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><A HREF="#org.springframework.security.afterinvocation"><B>org.springframework.security.afterinvocation</B></A></TD>
<TD>Used for post-processing of an object returned from a secure object invocation. </TD>
</TR>
</TABLE>
<P>
<A NAME="org.springframework.security.afterinvocation"></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
Uses of <A HREF="../../../../../org/springframework/security/afterinvocation/AbstractAclProvider.html" title="class in org.springframework.security.afterinvocation">AbstractAclProvider</A> in <A HREF="../../../../../org/springframework/security/afterinvocation/package-summary.html">org.springframework.security.afterinvocation</A></FONT></TH>
</TR>
</TABLE>
<P>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="<API key>">
<TH ALIGN="left" COLSPAN="2">Subclasses of <A HREF="../../../../../org/springframework/security/afterinvocation/AbstractAclProvider.html" title="class in org.springframework.security.afterinvocation">AbstractAclProvider</A> in <A HREF="../../../../../org/springframework/security/afterinvocation/package-summary.html">org.springframework.security.afterinvocation</A></FONT></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> class</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/springframework/security/afterinvocation/<API key>.html" title="class in org.springframework.security.afterinvocation"><API key></A></B></CODE>
<BR>
Given a <code>Collection</code> of domain object instances returned from a secure object invocation, remove
any <code>Collection</code> elements the principal does not have appropriate permission to access as defined by the
<A HREF="../../../../../org/springframework/security/acls/AclService.html" title="interface in org.springframework.security.acls"><CODE>AclService</CODE></A>.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> class</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/springframework/security/afterinvocation/<API key>.html" title="class in org.springframework.security.afterinvocation"><API key></A></B></CODE>
<BR>
Given a domain object instance returned from a secure object invocation, ensures the principal has
appropriate permission as defined by the <A HREF="../../../../../org/springframework/security/acls/AclService.html" title="interface in org.springframework.security.acls"><CODE>AclService</CODE></A>.</TD>
</TR>
</TABLE>
<P>
<HR>
<A NAME="navbar_bottom"></A>
<A HREF="#skip-navbar_bottom" title="Skip navigation links"></A>
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
<TR>
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<A NAME="<API key>"></A>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
<TR ALIGN="center" VALIGN="top">
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../org/springframework/security/afterinvocation/AbstractAclProvider.html" title="class in org.springframework.security.afterinvocation"><FONT CLASS="NavBarFont1"><B>Class</B></FONT></A> </TD>
<TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Use</B></FONT> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD>
</TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
Spring Security Framework</EM>
</TD>
</TR>
<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
PREV
NEXT</FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../../../../index.html?org/springframework/security/afterinvocation/class-use/AbstractAclProvider.html" target="_top"><B>FRAMES</B></A>
<A HREF="AbstractAclProvider.html" target="_top"><B>NO FRAMES</B></A>
<SCRIPT type="text/javascript">
<!
if(window==top) {
document.writeln('<A HREF="../../../../../allclasses-noframe.html"><B>All Classes</B></A>');
}
</SCRIPT>
<NOSCRIPT>
<A HREF="../../../../../allclasses-noframe.html"><B>All Classes</B></A>
</NOSCRIPT>
</FONT></TD>
</TR>
</TABLE>
<A NAME="skip-navbar_bottom"></A>
<HR>
Copyright &
</BODY>
</HTML> |
# AUTOGENERATED FILE
FROM balenalib/n510-tx2-debian:jessie-run
ENV NODE_VERSION 10.24.0
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> \ |
# AUTOGENERATED FILE
FROM balenalib/armv7hf-debian:sid-run
ENV NODE_VERSION 12.22.9
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 keyserver.ubuntu.com --recv-keys "$key" ; \
done \
&& apt-get update && apt-get install -y $buildDeps --<API key> \ |
<!DOCTYPE HTML PUBLIC "-
<!-- NewPage -->
<html lang="de">
<head>
<title>Uses of Class org.deidentifier.arx.metric.v2.<API key> (ARX Developer Documentation)</title>
<link rel="stylesheet" type="text/css" href="../../../../../../stylesheet.css" title="Style">
</head>
<body>
<script type="text/javascript"><!
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="Uses of Class org.deidentifier.arx.metric.v2.<API key> (ARX Developer Documentation)";
}
</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="../../../../../../org/deidentifier/arx/metric/v2/<API key>.html" title="class in org.deidentifier.arx.metric.v2">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?org/deidentifier/arx/metric/v2/class-use/<API key>.html" target="_top">Frames</a></li>
<li><a href="<API key>.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 Class org.deidentifier.arx.metric.v2.<API key>" class="title">Uses of Class<br>org.deidentifier.arx.metric.v2.<API key></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="../../../../../../org/deidentifier/arx/metric/v2/<API key>.html" title="class in org.deidentifier.arx.metric.v2"><API key></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.deidentifier.arx.metric.v2">org.deidentifier.arx.metric.v2</a></td>
<td class="colLast"> </td>
</tr>
</tbody>
</table>
</li>
<li class="blockList">
<ul class="blockList">
<li class="blockList"><a name="org.deidentifier.arx.metric.v2">
</a>
<h3>Uses of <a href="../../../../../../org/deidentifier/arx/metric/v2/<API key>.html" title="class in org.deidentifier.arx.metric.v2"><API key></a> in <a href="../../../../../../org/deidentifier/arx/metric/v2/package-summary.html">org.deidentifier.arx.metric.v2</a></h3>
<table border="0" cellpadding="3" cellspacing="0" summary="Use table, listing methods, and an explanation">
<caption><span>Methods in <a href="../../../../../../org/deidentifier/arx/metric/v2/package-summary.html">org.deidentifier.arx.metric.v2</a> that return <a href="../../../../../../org/deidentifier/arx/metric/v2/<API key>.html" title="class in org.deidentifier.arx.metric.v2"><API key></a></span><span class="tabEnd"> </span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Method and Description</th>
</tr>
<tbody>
<tr class="altColor">
<td class="colFirst"><code><a href="../../../../../../org/deidentifier/arx/metric/v2/<API key>.html" title="class in org.deidentifier.arx.metric.v2"><API key></a></code></td>
<td class="colLast"><span class="strong"><API key>.</span><code><strong><a href="../../../../../../org/deidentifier/arx/metric/v2/<API key>.html#clone()">clone</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="../../../../../../org/deidentifier/arx/metric/v2/<API key>.html" title="class in org.deidentifier.arx.metric.v2">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?org/deidentifier/arx/metric/v2/class-use/<API key>.html" target="_top">Frames</a></li>
<li><a href="<API key>.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> |
using System.IO;
using System.IO.Compression;
using System.Threading.Tasks;
using NServiceBus.Logging;
using NServiceBus.MessageMutator;
#region <API key>
public class <API key> : <API key>, <API key>
{
static ILog log = LogManager.GetLogger("<API key>");
public Task MutateOutgoing(<API key> context)
{
log.Info("transportMessage.Body size before compression: " + context.OutgoingBody.Length);
MemoryStream mStream = new MemoryStream(context.OutgoingBody);
MemoryStream outStream = new MemoryStream();
using (GZipStream tinyStream = new GZipStream(outStream, CompressionMode.Compress))
{
mStream.CopyTo(tinyStream);
}
// copy the compressed buffer only after the GZipStream is disposed,
// otherwise, not all the compressed message will be copied.
context.OutgoingBody = outStream.ToArray();
context.OutgoingHeaders["IWasCompressed"]= "true";
log.Info("transportMessage.Body size after compression: " + context.OutgoingBody.Length);
return Task.FromResult(0);
}
public Task MutateIncoming(<API key> context)
{
if (!context.Headers.ContainsKey("IWasCompressed"))
{
return Task.FromResult(0);
}
using (GZipStream bigStream = new GZipStream(new MemoryStream(context.Body), CompressionMode.Decompress))
{
MemoryStream bigStreamOut = new MemoryStream();
bigStream.CopyTo(bigStreamOut);
context.Body = bigStreamOut.ToArray();
}
return Task.FromResult(0);
}
}
#endregion |
require "<API key>"
CodeClimate::TestReporter.start
# This file is copied to spec/ when you run 'rails generate rspec:install'
ENV["RAILS_ENV"] ||= 'test'
require File.expand_path("../../config/environment", __FILE__)
require 'rspec/rails'
require 'rspec/autorun'
require 'simplecov'
SimpleCov.start do
add_filter "app/assets/javascripts/application.js"
end
# Requires supporting ruby files with custom matchers and macros, etc,
# in spec/support/ and its subdirectories.
Dir[Rails.root.join("spec/support*.rb")].each { |f| require f }
# Checks for pending migrations before tests are run.
# If you are not using ActiveRecord, you can remove this line.
ActiveRecord::Migration.check_pending! if defined?(ActiveRecord::Migration)
RSpec.configure do |config|
# ## Mock Framework
# If you prefer to use mocha, flexmock or RR, uncomment the appropriate line:
# config.mock_with :mocha
# config.mock_with :flexmock
# config.mock_with :rr
# Remove this line if you're not using ActiveRecord or ActiveRecord fixtures
config.fixture_path = "#{::Rails.root}/spec/fixtures"
config.include FactoryGirl::Syntax::Methods
# If you're not using ActiveRecord, or you'd prefer not to run each of your
# examples within a transaction, remove the following line or assign false
# instead of true.
config.<API key> = true
# If true, the base class of anonymous controllers will be inferred
# automatically. This will be the default behavior in future versions of
# rspec-rails.
config.<API key> = false
# Run specs in random order to surface order dependencies. If you find an
# order dependency and want to debug it, you can fix the order by providing
# the seed, which is printed after each run.
# --seed 1234
config.order = "random"
end |
from math import ceil
def round(valor, n, max_value, precision):
result = int(ceil(valor / (max_value * (precision / n))))
return result
def calcular_mochila(items, pesoMax, precision):
n = len(items)
filtered_items = filter(lambda item: (item[1] <= pesoMax), items)
max_value = reduce(lambda item1, item2: item1 if item1[0] > item2[0] else item2, filtered_items)[0]
filtered_items = map(lambda item: [round(item[0], n, max_value, precision), item[1], item[2]], filtered_items)
resultado1, resultado2 = _calcular_mochila(filtered_items, pesoMax)
return reduce(lambda valor1, valor2: valor1 + valor2, [items[i][0] for i in resultado2]), resultado2
def sum_valores_hasta(items, pos):
total = 0
for i in xrange(pos):
total += items[i][0]
return total
def getValorMaxEnM(M, pesoMax, items):
valorMax = 0
n = len(items)-1
for valor in xrange(len(M[n])):
if M[n][valor] <= pesoMax and valor >= valorMax:
valorMax = valor
return valorMax
def _calcular_mochila(items, pesoMax):
sumVal = sum_valores_hasta(items, len(items))
n = len(items)
M = [[0]*sumVal]*len(items)
for i in xrange(1, sumVal):
M[0][i] = float("inf")
for i in xrange(1, n):
for valor in xrange(1, sumVal):
if items[i][0] <= valor:
M[i][valor] = min(M[i-1][valor], items[i][1] + M[i-1][valor - items[i][0]])
else:
M[i][valor] = M[i-1][valor]
valorMax = getValorMaxEnM(M, pesoMax, items)
return valorMax, getConjuntoSolucion(M, valorMax, items)
def getConjuntoSolucion(M, valorMax, items):
solucion = []
valor = valorMax
for i in xrange(len(items)-1, 0, -1):
if (items[i][0]) <= valor:
if (items[i][1] + M[i-1][valor - items[i][0]]) <= M[i-1][valor]:
solucion.append(i)
valor -= items[i][0]
return solucion |
package certgen.controller.action;
import java.awt.event.ActionEvent;
import java.awt.event.KeyEvent;
import javax.swing.AbstractAction;
import javax.swing.JOptionPane;
import javax.swing.KeyStroke;
import certgen.model.table.<API key>;
import certgen.util.ImageUtil;
import certgen.view.dialog.<API key>;
import certgen.view.frame.MainFrame;
public class <API key> extends AbstractAction {
private static final long serialVersionUID = -<API key>;
public <API key>() {
putValue(NAME, "New Certificate");
putValue(SHORT_DESCRIPTION, "Create new certificate in the current keystore");
putValue(SMALL_ICON, ImageUtil.loadImageIcon(getClass().getResource("/certgen/resource/img/<API key>.png"), 20, 20));
putValue(ACCELERATOR_KEY, KeyStroke.getKeyStroke(KeyEvent.VK_K, ActionEvent.CTRL_MASK));
}
@Override
public void actionPerformed(ActionEvent e) {
MainFrame mf = MainFrame.getInstance();
if (mf.getCurrentKS() != null) {
<API key> ncd = new <API key>(mf.getCurrentKS());
ncd.setVisible(true);
if (ncd.isCreated()) {
((<API key>) mf.getTblCertificate().getModel()).setRowCount(0);
((<API key>) mf.getTblCertificate().getModel()).addRows(mf.getCurrentKS());
mf.setChangedKS(true);
mf.refreshStatusBar();
}
ncd.dispose();
} else {
JOptionPane.showMessageDialog(null, "Thre is not current keystore. Create or open it first.", "Error", JOptionPane.ERROR_MESSAGE);
}
}
} |
package com.zhuinden.examplegithubclient.util;
import java.lang.annotation.Inherited;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
@Inherited
@Retention(RetentionPolicy.RUNTIME)
public @interface <API key> {
boolean value() default true;
} |
import os
import pandas as pd
from igf_data.utils.seqrunutils import <API key>
def _count_total_reads(data,seqrun_list):
'''
An internal function for counting total reads
required params:
:param data, A dictionary containing seqrun ids a key an read counts as values
:param seqrun_list, A list of sequencing runs
'''
try:
data['run_count'] = 0
if 'total_read' not in data:
data['total_read']=0
if len(seqrun_list) >1:
for run in seqrun_list:
if data[run] > 0:
data['run_count'] += 1
data['total_read'] += data[run]
#if data['run_count'] == 1:
# data['total_read'] = 0
return data
except:
raise
def <API key>(input_data,
sample_col='sample_igf_id',
read_count_col='attribute_value',
seqrun_col='flowcell_id'):
try:
if not isinstance(input_data, pd.DataFrame):
raise AttributeError('Expecting a pandas dataframe and got {0}'.\
format(type(input_data)))
input_data[read_count_col]=input_data[read_count_col].astype(float) # convert reac counts to int
processed_data=input_data.\
pivot_table(values=read_count_col,
index=[sample_col,
seqrun_col],
aggfunc='sum') # group data by sample id and seq runs
processed_data.\
reset_index([sample_col,
seqrun_col],
inplace=True) # reset index for processed data
intermediate_data=list() # define empty intermediate data structure
seqrun_set=set() # define empty seqrun set
for line in processed_data.to_dict(orient='records'): # reformat processed data to required structure
tmp_data=dict()
tmp_data.update({sample_col:line[sample_col],
line[seqrun_col]:line[read_count_col]})
seqrun_set.add(line[seqrun_col])
intermediate_data.append(tmp_data)
intermediate_data=pd.DataFrame(intermediate_data) # convert intermediate data to dataframe
intermediate_data.fillna(0,inplace=True) # replace NAN values with zero
intermediate_data=intermediate_data.\
pivot_table(index=sample_col,
aggfunc='sum').\
reset_index(sample_col) # group data by samples id
intermediate_data=intermediate_data.\
apply(lambda line: \
_count_total_reads(data=line,
seqrun_list=list(seqrun_set)),
axis=1) # count total reads for multiple seq runs
multiple_run_data=intermediate_data[intermediate_data['run_count'] > 1] # check for multi run projects
if len(multiple_run_data.index)==0 and \
'total_read' in multiple_run_data.columns:
intermediate_data.drop('total_read',axis=1,inplace=True) # drop the total read column if all samples are single run
if 'run_count' in intermediate_data.columns:
intermediate_data.drop('run_count',axis=1,inplace=True) # removing run_count column
intermediate_data.fillna(0,inplace=True) # fail safe for missing samples
description = {sample_col: ("string", "Sample ID")} # define description
if len(list(seqrun_set)) >1 and \
'total_read' in intermediate_data.columns:
description.update({"total_read":("number", "Total Reads")}) # add total read column for samples with multiple runs
intermediate_data['total_read']=intermediate_data['total_read'].\
astype(float) # convert column to number
for run in list(seqrun_set):
description.update({run:("number",run)}) # add seqrun columns
intermediate_data[run]=intermediate_data[run].\
astype(float) # convert column to number
column_list=[sample_col] # define column order
column_list.extend(list(seqrun_set))
if len(list(seqrun_set)) > 1 and \
'total_read' in intermediate_data.columns:
column_list.append('total_read') # total read is present only for multiple runs
intermediate_data=intermediate_data.to_dict(orient='records') # convert data frame to json
column_order=tuple(column_list)
return description,intermediate_data,column_order
except:
raise
def _modify_seqrun_data(data_series,seqrun_col,flowcell_col,path_col):
'''
An internal method for parsing seqrun dataframe and adding remote dir path
required columns: seqrun_igf_id, flowcell_id
:param seqrun_col, Column name for sequencing run id, default seqrun_igf_id
:param flowcell_col, Column namae for flowcell id, default flowcell_id
:param path_col, Column name for path, default path
returns a data series with following columns: flowcell_id, path
'''
try:
if not isinstance(data_series,pd.Series):
raise AttributeError('Expecting a pandas data series and got {0}'.\
format(type(data_series)))
seqrun_igf_id=data_series[seqrun_col]
flowcell_id=data_series[flowcell_col]
seqrun_date=<API key>(seqrun_igf_id)
data_series[path_col]=os.path.join(seqrun_date,flowcell_id) # adding path to data series
del data_series[seqrun_col]
return data_series
except:
raise
def <API key>(input_data,output_file,seqrun_col='seqrun_igf_id',
flowcell_col='flowcell_id',path_col='path'):
'''
A utility method for adding remote path to a dataframe for each sequencing runs
of a project
required params:
:param input_data, A input dataframe containing the following columns
seqrun_igf_id
flowcell_id
:param seqrun_col, Column name for sequencing run id, default seqrun_igf_id
:param flowcell_col, Column namae for flowcell id, default flowcell_id
:param path_col, Column name for path, default path
output_file: An output filepath for the json data
'''
try:
if not isinstance(input_data,pd.DataFrame):
raise AttributeError('Expecting a pandas dataframe and got {0}'.\
format(type(input_data)))
input_data.drop_duplicates(inplace=True) # remove duplicate entries
input_data=input_data.\
apply(lambda line: \
_modify_seqrun_data(data_series=line,
seqrun_col=seqrun_col,
flowcell_col=flowcell_col,
path_col=path_col),
axis=1) # add remote seqrun path
input_data=input_data.to_json(orient='records') # encode output json
with open(output_file,'w') as j_data:
j_data.write(input_data) # write output json file
except:
raise |
package com.yw.monitor.view.holder;
import android.content.Context;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.view.View;
import android.widget.TextView;
import com.yw.monitor.view.adapter.InnerViewHolders;
import com.yw.monitor.R;
import com.yw.monitor.event.LogEvent;
import com.yw.monitor.monitor.FloatMonitor;
import com.yw.monitor.monitor.MonitorUtils;
import com.yw.monitor.view.<API key>;
import java.util.ArrayList;
import java.util.List;
public class ConsoleHolder extends BaseMonitorHolder {
public static final List<LogEvent> mDatas = new ArrayList<>();
private RecyclerView <API key>;
private <API key><LogEvent> mViewEventAdapter;
public ConsoleHolder(Context mContext) {
super(mContext);
FloatMonitor.getIns().addLogListeners(mItem -> onReceiveViewEvent(mItem));
}
public void onReceiveViewEvent(LogEvent mViewEvent) {
addLogEvent(mViewEvent);
<API key>.<API key>(mDatas.size() - 1);
mViewEventAdapter.<API key>();
}
public static void addLogEvent(LogEvent mViewEvent) {
if (mDatas.isEmpty()) {
mDatas.add(mViewEvent);
} else {
if (!mDatas.get(mDatas.size() - 1).getBody().equals(mViewEvent.getBody())) {
mDatas.add(mViewEvent);
}
}
}
@Override
protected View getContentView(Context mContext) {
<API key> = new RecyclerView(mContext);
<API key>.setLayoutManager(new LinearLayoutManager(getContext()));
setViewEvent();
return <API key>;
}
@Override
public void reset() {
mDatas.clear();
mViewEventAdapter.<API key>();
}
@Override
public String getHolderTitle() {
return "Console";
}
@Override
public String <API key>() {
return "";
}
/**
* UIGuide
*/
private void setViewEvent() {
mViewEventAdapter = new <API key><LogEvent>(R.layout.item_layout_files, getContext(), mDatas) {
@Override
protected void convert(InnerViewHolders holder, int position, View convertView, LogEvent mViewEvent) {
String mItem = mViewEvent.getBody();
TextView mTvtitle = holder.findView(R.id.tv_file_title);
mTvtitle.setText(mItem);
mTvtitle.setTag(mTvtitle.getId(), mItem);
mTvtitle.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
String mitem = (String) v.getTag(v.getId());
try {
String[] mItems = mitem.split("\\.");
MonitorUtils.copyText(mItems[mItems.length - 1]);
} catch (Exception e) {
e.printStackTrace();
MonitorUtils.copyText(mitem);
}
MonitorUtils.showToast("");
}
});
}
};
mViewEventAdapter.setDatas(mDatas);
<API key>.setAdapter(mViewEventAdapter);
}
} |
using System;
using System.Collections.Generic;
using System.Linq;
using MonoTouch.Foundation;
using MonoTouch.UIKit;
using PixateFreestyleLib;
namespace HelloWorld
{
// The <API key> for the application. This class is responsible for launching the
// User Interface of the application, as well as listening (and optionally responding) to
// application events from iOS.
[Register ("AppDelegate")]
public partial class AppDelegate : <API key>
{
// class-level declarations
UIWindow window;
<API key> viewController;
// This method is invoked when the application has loaded and is ready to run. In this
// method you should instantiate the window, load the UI into it and then make the window
// visible.
// You have 17 seconds to return from this method, or iOS will terminate your application.
public override bool FinishedLaunching (UIApplication app, NSDictionary options)
{
window = new UIWindow (UIScreen.MainScreen.Bounds);
PixateFreestyle.<API key> ().MonitorChanges = true;
Console.WriteLine ("CSS FILE: " + PixateFreestyle.<API key> ().FilePath);
// Make the main window styleable
window.SetStyleMode (PXStylingMode.PXStylingNormal);
viewController = new <API key> ();
window.RootViewController = viewController;
// Show how to add two new CSS classes to the main view
viewController.View.AddStyleClass ("gray");
viewController.View.AddStyleClass ("bordered");
window.MakeKeyAndVisible ();
return true;
}
}
} |
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>proxy — Pilot 2 documentation</title>
<link rel="stylesheet" href="../../../_static/pygments.css" type="text/css" />
<link rel="stylesheet" href="../../../_static/alabaster.css" type="text/css" />
<script id="<API key>" data-url_root="../../../" src="../../../_static/<API key>.js"></script>
<script src="../../../_static/jquery.js"></script>
<script src="../../../_static/underscore.js"></script>
<script src="../../../_static/doctools.js"></script>
<link rel="index" title="Index" href="../../../genindex.html" />
<link rel="search" title="Search" href="../../../search.html" />
<link rel="next" title="generic" href="setup.html" />
<link rel="prev" title="memory" href="memory.html" />
<link rel="stylesheet" href="../../../_static/custom.css" type="text/css" />
<meta name="viewport" content="width=device-width, initial-scale=0.9, maximum-scale=0.9" />
</head><body>
<div class="document">
<div class="documentwrapper">
<div class="bodywrapper">
<div class="body" role="main">
<div class="section" id="module-pilot.user.generic.proxy">
<span id="proxy"></span><h1>proxy<a class="headerlink" href="
<dl class="py function">
<dt id="pilot.user.generic.proxy.verify_proxy">
<code class="sig-prename descclassname"><span class="pre">pilot.user.generic.proxy.</span></code><code class="sig-name descname"><span class="pre">verify_proxy</span></code><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">limit</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../../../_modules/pilot/user/generic/proxy.html
<dd><p>Check for a valid voms/grid proxy longer than N hours.
Use <code class="xref any docutils literal notranslate"><span class="pre">limit</span></code> to set required time limit.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>limit</strong> – time limit in hours (int).</p>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>exit code (NOPROXY or NOVOMSPROXY), diagnostics (error diagnostics string).</p>
</dd>
</dl>
</dd></dl>
</div>
</div>
</div>
</div>
<div class="sphinxsidebar" role="navigation" aria-label="main navigation">
<div class="<API key>">
<h1 class="logo"><a href="../../../index.html">Pilot 2</a></h1>
<h3>Navigation</h3>
<ul class="current">
<li class="toctree-l1"><a class="reference internal" href="../../../getting_started/index.html">Getting started</a></li>
<li class="toctree-l1 current"><a class="reference internal" href="../../index.html">Components</a><ul class="current">
<li class="toctree-l2"><a class="reference internal" href="../../api/index.html">api components</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../common/index.html">common components</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../control/index.html">control components</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../copytool/index.html">copytool components</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../eventservice/index.html">eventservice components</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../info/index.html">info components</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../resource/index.html">resource components</a></li>
<li class="toctree-l2 current"><a class="reference internal" href="../index.html">user components</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../util/index.html">util components</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../workflow/index.html">workflow components</a></li>
</ul>
</li>
</ul>
<div class="relations">
<h3>Related Topics</h3>
<ul>
<li><a href="../../../index.html">Documentation overview</a><ul>
<li><a href="../../index.html">Components</a><ul>
<li><a href="../index.html">user components</a><ul>
<li><a href="index.html">generic components</a><ul>
<li>Previous: <a href="memory.html" title="previous chapter">memory</a></li>
<li>Next: <a href="setup.html" title="next chapter">generic</a></li>
</ul></li>
</ul></li>
</ul></li>
</ul></li>
</ul>
</div>
<div role="note" aria-label="source link">
<h3>This Page</h3>
<ul class="this-page-menu">
<li><a href="../../../_sources/components/user/generic/proxy.rst.txt"
rel="nofollow">Show Source</a></li>
</ul>
</div>
<div id="searchbox" style="display: none" role="search">
<h3 id="searchlabel">Quick search</h3>
<div class="searchformwrapper">
<form class="search" action="../../../search.html" method="get">
<input type="text" name="q" aria-labelledby="searchlabel" />
<input type="submit" value="Go" />
</form>
</div>
</div>
<script>$('#searchbox').show(0);</script>
</div>
</div>
<div class="clearer"></div>
</div>
<div class="footer">
©2017, Paul Nilsson, Mario Lassnig, Daniil Drizhuk, ....
|
Powered by <a href="http://sphinx-doc.org/">Sphinx 3.5.4</a>
& <a href="https://github.com/bitprophet/alabaster">Alabaster 0.7.12</a>
|
<a href="../../../_sources/components/user/generic/proxy.rst.txt"
rel="nofollow">Page source</a>
</div>
</body>
</html> |
using System;
using System.Collections.Generic;
using Hawk.Core.Utils;
using Hawk.Core.Utils.Plugins;
namespace Hawk.Core.Connectors
{
[Interface( "" )]
public interface IFileConnector:<API key>
{
#region Properties
<summary>
</summary>
string ExtentFileName { get; }
<summary>
</summary>
string FileName { get; set; }
#endregion
EncodingType EncodingType { get; set; }
#region Public Methods
<summary>
</summary>
<param name="path"></param>
IEnumerable<IFreeDocument> WriteData(IEnumerable<IFreeDocument> datas );
<summary>
</summary>
<param name="fileName"></param>
<returns></returns>
IEnumerable<FreeDocument> ReadFile(Action<int> alreadyGetSize=null);
<summary>
</summary>
<param name="datas"></param>
<returns></returns>
string GetString(IEnumerable<IFreeDocument> datas);
#endregion
}
} |
package fr.excilys.formation.bowliwood.main;
import org.junit.Test;
import static org.junit.Assert.fail;
public class <API key> {
@Test
/**
* Failing test. Should be changed for CI.
*/
public void testFailure() {
fail();
}
} |
namespace artm.MvxPlugins.Fetcher.Tests.Common
{
public static class TestCategory
{
public const string Slow = "SLOW";
public const string Internet = "INTERNET";
}
} |
<!-- HTML header for doxygen 1.8.18-->
<!DOCTYPE html PUBLIC "-
<html xmlns="http:
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.9.2"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>OR-Tools: Member List</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
<link href="styleSheet.tmp.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr style="height: 56px;">
<td id="projectlogo"><img alt="Logo" src="orLogo.png"/></td>
<td id="projectalign" style="padding-left: 0.5em;">
<div id="projectname">OR-Tools
 <span id="projectnumber">9.2</span>
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.9.2 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",'Search','.html');
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
$(function() {
initMenu('',true,false,'search.php','Search');
$(document).ready(function() { init_search(); });
});
</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
<div id="nav-tree">
<div id="nav-tree-contents">
<div id="nav-sync" class="sync"></div>
</div>
</div>
<div id="splitbar" style="-moz-user-select:none;"
class="ui-resizable-handle">
</div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('<API key>.html',''); initResizable(); });
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>
<!-- iframe showing the search results (closed by default) -->
<div id="<API key>">
<iframe src="javascript:void(0)" frameborder="0"
name="MSearchResults" id="MSearchResults">
</iframe>
</div>
<div class="header">
<div class="headertitle"><div class="title">CLPInterface Member List</div></div>
</div><!--header
<div class="contents">
<p>This is the complete list of members for <a class="el" href="<API key>.html">CLPInterface</a>, including all inherited members.</p>
<table class="directory">
<tr class="even"><td class="entry"><a class="el" href="<API key>.html#<API key>"><API key></a>(MPConstraint *const ct)</td><td class="entry"><a class="el" href="<API key>.html">MPSolverInterface</a></td><td class="entry"><span class="mlabel">inline</span><span class="mlabel">virtual</span></td></tr>
<tr class="odd"><td class="entry"><a class="el" href="<API key>.html#<API key>">AddRowConstraint</a>(MPConstraint *const ct) override</td><td class="entry"><a class="el" href="<API key>.html">CLPInterface</a></td><td class="entry"><span class="mlabel">virtual</span></td></tr>
<tr class="even"><td class="entry"><a class="el" href="<API key>.html#<API key>">AddVariable</a>(MPVariable *const var) override</td><td class="entry"><a class="el" href="<API key>.html">CLPInterface</a></td><td class="entry"><span class="mlabel">virtual</span></td></tr>
<tr class="odd"><td class="entry"><a class="el" href="<API key>.html#<API key>"><API key></a>() const</td><td class="entry"><a class="el" href="<API key>.html">MPSolverInterface</a></td><td class="entry"></td></tr>
<tr class="even"><td class="entry"><a class="el" href="<API key>.html#<API key>"><API key></a></td><td class="entry"><a class="el" href="<API key>.html">MPSolverInterface</a></td><td class="entry"><span class="mlabel">protected</span></td></tr>
<tr class="odd"><td class="entry"><a class="el" href="<API key>.html#<API key>"><API key></a>(int var_index)</td><td class="entry"><a class="el" href="<API key>.html">MPSolverInterface</a></td><td class="entry"><span class="mlabel">inline</span><span class="mlabel">virtual</span></td></tr>
<tr class="even"><td class="entry"><a class="el" href="<API key>.html#<API key>">CheckSolutionExists</a>() const</td><td class="entry"><a class="el" href="<API key>.html">MPSolverInterface</a></td><td class="entry"><span class="mlabel">virtual</span></td></tr>
<tr class="odd"><td class="entry"><a class="el" href="<API key>.html#<API key>"><API key></a>() const</td><td class="entry"><a class="el" href="<API key>.html">MPSolverInterface</a></td><td class="entry"></td></tr>
<tr class="even"><td class="entry"><a class="el" href="<API key>.html#<API key>"><API key></a>() const</td><td class="entry"><a class="el" href="<API key>.html">MPSolverInterface</a></td><td class="entry"><span class="mlabel">inline</span></td></tr>
<tr class="odd"><td class="entry"><a class="el" href="<API key>.html#<API key>">ClearConstraint</a>(MPConstraint *const constraint) override</td><td class="entry"><a class="el" href="<API key>.html">CLPInterface</a></td><td class="entry"><span class="mlabel">virtual</span></td></tr>
<tr class="even"><td class="entry"><a class="el" href="<API key>.html#<API key>">ClearObjective</a>() override</td><td class="entry"><a class="el" href="<API key>.html">CLPInterface</a></td><td class="entry"><span class="mlabel">virtual</span></td></tr>
<tr class="odd"><td class="entry"><a class="el" href="<API key>.html#<API key>">CLPInterface</a>(MPSolver *const solver)</td><td class="entry"><a class="el" href="<API key>.html">CLPInterface</a></td><td class="entry"><span class="mlabel">explicit</span></td></tr>
<tr class="even"><td class="entry"><a class="el" href="<API key>.html#<API key>">column_status</a>(int variable_index) const override</td><td class="entry"><a class="el" href="<API key>.html">CLPInterface</a></td><td class="entry"><span class="mlabel">virtual</span></td></tr>
<tr class="odd"><td class="entry"><a class="el" href="<API key>.html#<API key>"><API key></a>() const</td><td class="entry"><a class="el" href="<API key>.html">MPSolverInterface</a></td><td class="entry"><span class="mlabel">virtual</span></td></tr>
<tr class="even"><td class="entry"><a class="el" href="<API key>.html#<API key>"><API key></a>(int ct_index) const</td><td class="entry"><a class="el" href="<API key>.html">MPSolverInterface</a></td><td class="entry"><span class="mlabel">inline</span></td></tr>
<tr class="odd"><td class="entry"><a class="el" href="<API key>.html#<API key>">DirectlySolveProto</a>(const MPModelRequest &request, std::atomic< bool > *interrupt)</td><td class="entry"><a class="el" href="<API key>.html">MPSolverInterface</a></td><td class="entry"><span class="mlabel">inline</span><span class="mlabel">virtual</span></td></tr>
<tr class="even"><td class="entry"><a class="el" href="<API key>.html#<API key>">ExtractModel</a>()</td><td class="entry"><a class="el" href="<API key>.html">MPSolverInterface</a></td><td class="entry"><span class="mlabel">protected</span></td></tr>
<tr class="odd"><td class="entry"><a class="el" href="<API key>.html#<API key>"><API key></a>() override</td><td class="entry"><a class="el" href="<API key>.html">CLPInterface</a></td><td class="entry"><span class="mlabel">virtual</span></td></tr>
<tr class="even"><td class="entry"><a class="el" href="<API key>.html#<API key>">ExtractNewVariables</a>() override</td><td class="entry"><a class="el" href="<API key>.html">CLPInterface</a></td><td class="entry"><span class="mlabel">virtual</span></td></tr>
<tr class="odd"><td class="entry"><a class="el" href="<API key>.html#<API key>">ExtractObjective</a>() override</td><td class="entry"><a class="el" href="<API key>.html">CLPInterface</a></td><td class="entry"><span class="mlabel">virtual</span></td></tr>
<tr class="even"><td class="entry"><a class="el" href="<API key>.html#<API key>">InterruptSolve</a>()</td><td class="entry"><a class="el" href="<API key>.html">MPSolverInterface</a></td><td class="entry"><span class="mlabel">inline</span><span class="mlabel">virtual</span></td></tr>
<tr class="odd"><td class="entry"><a class="el" href="<API key>.html#<API key>"><API key></a>()</td><td class="entry"><a class="el" href="<API key>.html">MPSolverInterface</a></td><td class="entry"><span class="mlabel">protected</span></td></tr>
<tr class="even"><td class="entry"><a class="el" href="<API key>.html#<API key>">IsContinuous</a>() const override</td><td class="entry"><a class="el" href="<API key>.html">CLPInterface</a></td><td class="entry"><span class="mlabel">inline</span><span class="mlabel">virtual</span></td></tr>
<tr class="odd"><td class="entry"><a class="el" href="<API key>.html#<API key>">IsLP</a>() const override</td><td class="entry"><a class="el" href="<API key>.html">CLPInterface</a></td><td class="entry"><span class="mlabel">inline</span><span class="mlabel">virtual</span></td></tr>
<tr class="even"><td class="entry"><a class="el" href="<API key>.html#<API key>">IsMIP</a>() const override</td><td class="entry"><a class="el" href="<API key>.html">CLPInterface</a></td><td class="entry"><span class="mlabel">inline</span><span class="mlabel">virtual</span></td></tr>
<tr class="odd"><td class="entry"><a class="el" href="<API key>.html#<API key>">iterations</a>() const override</td><td class="entry"><a class="el" href="<API key>.html">CLPInterface</a></td><td class="entry"><span class="mlabel">virtual</span></td></tr>
<tr class="even"><td class="entry"><a class="el" href="<API key>.html#<API key>">kDummyVariableIndex</a></td><td class="entry"><a class="el" href="<API key>.html">MPSolverInterface</a></td><td class="entry"><span class="mlabel">protected</span><span class="mlabel">static</span></td></tr>
<tr class="odd"><td class="entry"><a class="el" href="<API key>.html#<API key>"><API key></a></td><td class="entry"><a class="el" href="<API key>.html">MPSolverInterface</a></td><td class="entry"><span class="mlabel">static</span></td></tr>
<tr class="even"><td class="entry"><a class="el" href="<API key>.html#<API key>"><API key></a></td><td class="entry"><a class="el" href="<API key>.html">MPSolverInterface</a></td><td class="entry"><span class="mlabel">static</span></td></tr>
<tr class="odd"><td class="entry"><a class="el" href="<API key>.html#<API key>"><API key></a></td><td class="entry"><a class="el" href="<API key>.html">MPSolverInterface</a></td><td class="entry"><span class="mlabel">protected</span></td></tr>
<tr class="even"><td class="entry"><a class="el" href="<API key>.html#<API key>">last_variable_index</a>() const</td><td class="entry"><a class="el" href="<API key>.html">MPSolverInterface</a></td><td class="entry"><span class="mlabel">inline</span></td></tr>
<tr class="odd"><td class="entry"><a class="el" href="<API key>.html#<API key>"><API key></a></td><td class="entry"><a class="el" href="<API key>.html">MPSolverInterface</a></td><td class="entry"><span class="mlabel">protected</span></td></tr>
<tr class="even"><td class="entry"><a class="el" href="<API key>.html#<API key>">maximize_</a></td><td class="entry"><a class="el" href="<API key>.html">MPSolverInterface</a></td><td class="entry"><span class="mlabel">protected</span></td></tr>
<tr class="odd"><td class="entry"><a class="el" href="<API key>.html#<API key>">MODEL_SYNCHRONIZED</a> enum value</td><td class="entry"><a class="el" href="<API key>.html">MPSolverInterface</a></td><td class="entry"></td></tr>
<tr class="even"><td class="entry"><a class="el" href="<API key>.html#<API key>">MPSolverInterface</a>(MPSolver *const solver)</td><td class="entry"><a class="el" href="<API key>.html">MPSolverInterface</a></td><td class="entry"><span class="mlabel">explicit</span></td></tr>
<tr class="odd"><td class="entry"><a class="el" href="<API key>.html#<API key>">MUST_RELOAD</a> enum value</td><td class="entry"><a class="el" href="<API key>.html">MPSolverInterface</a></td><td class="entry"></td></tr>
<tr class="even"><td class="entry"><a class="el" href="<API key>.html#<API key>">NextSolution</a>()</td><td class="entry"><a class="el" href="<API key>.html">MPSolverInterface</a></td><td class="entry"><span class="mlabel">inline</span><span class="mlabel">virtual</span></td></tr>
<tr class="odd"><td class="entry"><a class="el" href="<API key>.html#<API key>">nodes</a>() const override</td><td class="entry"><a class="el" href="<API key>.html">CLPInterface</a></td><td class="entry"><span class="mlabel">virtual</span></td></tr>
<tr class="even"><td class="entry"><a class="el" href="<API key>.html#<API key>">objective_value</a>() const</td><td class="entry"><a class="el" href="<API key>.html">MPSolverInterface</a></td><td class="entry"></td></tr>
<tr class="odd"><td class="entry"><a class="el" href="<API key>.html#<API key>">objective_value_</a></td><td class="entry"><a class="el" href="<API key>.html">MPSolverInterface</a></td><td class="entry"><span class="mlabel">protected</span></td></tr>
<tr class="even"><td class="entry"><a class="el" href="<API key>.html#<API key>">quiet</a>() const</td><td class="entry"><a class="el" href="<API key>.html">MPSolverInterface</a></td><td class="entry"><span class="mlabel">inline</span></td></tr>
<tr class="odd"><td class="entry"><a class="el" href="<API key>.html#<API key>">quiet_</a></td><td class="entry"><a class="el" href="<API key>.html">MPSolverInterface</a></td><td class="entry"><span class="mlabel">protected</span></td></tr>
<tr class="even"><td class="entry"><a class="el" href="<API key>.html#<API key>">Reset</a>() override</td><td class="entry"><a class="el" href="<API key>.html">CLPInterface</a></td><td class="entry"><span class="mlabel">virtual</span></td></tr>
<tr class="odd"><td class="entry"><a class="el" href="<API key>.html#<API key>"><API key></a>()</td><td class="entry"><a class="el" href="<API key>.html">MPSolverInterface</a></td><td class="entry"><span class="mlabel">protected</span></td></tr>
<tr class="even"><td class="entry"><a class="el" href="<API key>.html#<API key>">result_status</a>() const</td><td class="entry"><a class="el" href="<API key>.html">MPSolverInterface</a></td><td class="entry"><span class="mlabel">inline</span></td></tr>
<tr class="odd"><td class="entry"><a class="el" href="<API key>.html#<API key>">result_status_</a></td><td class="entry"><a class="el" href="<API key>.html">MPSolverInterface</a></td><td class="entry"><span class="mlabel">protected</span></td></tr>
<tr class="even"><td class="entry"><a class="el" href="<API key>.html#<API key>">row_status</a>(int constraint_index) const override</td><td class="entry"><a class="el" href="<API key>.html">CLPInterface</a></td><td class="entry"><span class="mlabel">virtual</span></td></tr>
<tr class="odd"><td class="entry"><a class="el" href="<API key>.html#<API key>"><API key></a>(int ct_index, bool extracted)</td><td class="entry"><a class="el" href="<API key>.html">MPSolverInterface</a></td><td class="entry"><span class="mlabel">inline</span></td></tr>
<tr class="even"><td class="entry"><a class="el" href="<API key>.html#<API key>">set_quiet</a>(bool quiet_value)</td><td class="entry"><a class="el" href="<API key>.html">MPSolverInterface</a></td><td class="entry"><span class="mlabel">inline</span></td></tr>
<tr class="odd"><td class="entry"><a class="el" href="<API key>.html#<API key>"><API key></a>(int var_index, bool extracted)</td><td class="entry"><a class="el" href="<API key>.html">MPSolverInterface</a></td><td class="entry"><span class="mlabel">inline</span></td></tr>
<tr class="even"><td class="entry"><a class="el" href="<API key>.html#<API key>">SetCallback</a>(MPCallback *mp_callback)</td><td class="entry"><a class="el" href="<API key>.html">MPSolverInterface</a></td><td class="entry"><span class="mlabel">inline</span><span class="mlabel">virtual</span></td></tr>
<tr class="odd"><td class="entry"><a class="el" href="<API key>.html#<API key>">SetCoefficient</a>(MPConstraint *const constraint, const MPVariable *const variable, double new_value, double old_value) override</td><td class="entry"><a class="el" href="<API key>.html">CLPInterface</a></td><td class="entry"><span class="mlabel">virtual</span></td></tr>
<tr class="even"><td class="entry"><a class="el" href="<API key>.html#<API key>">SetCommonParameters</a>(const MPSolverParameters &param)</td><td class="entry"><a class="el" href="<API key>.html">MPSolverInterface</a></td><td class="entry"><span class="mlabel">protected</span></td></tr>
<tr class="odd"><td class="entry"><a class="el" href="<API key>.html#<API key>">SetConstraintBounds</a>(int row_index, double lb, double ub) override</td><td class="entry"><a class="el" href="<API key>.html">CLPInterface</a></td><td class="entry"><span class="mlabel">virtual</span></td></tr>
<tr class="even"><td class="entry"><a class="el" href="<API key>.html#<API key>"><API key></a>(MPSolverParameters::DoubleParam param, double value)</td><td class="entry"><a class="el" href="<API key>.html">MPSolverInterface</a></td><td class="entry"><span class="mlabel">protected</span></td></tr>
<tr class="odd"><td class="entry"><a class="el" href="<API key>.html#<API key>"><API key></a>(MPSolverParameters::IntegerParam param, int value)</td><td class="entry"><a class="el" href="<API key>.html">MPSolverInterface</a></td><td class="entry"><span class="mlabel">protected</span><span class="mlabel">virtual</span></td></tr>
<tr class="even"><td class="entry"><a class="el" href="<API key>.html#<API key>">SetMIPParameters</a>(const MPSolverParameters &param)</td><td class="entry"><a class="el" href="<API key>.html">MPSolverInterface</a></td><td class="entry"><span class="mlabel">protected</span></td></tr>
<tr class="odd"><td class="entry"><a class="el" href="<API key>.html#<API key>">SetNumThreads</a>(int num_threads)</td><td class="entry"><a class="el" href="<API key>.html">MPSolverInterface</a></td><td class="entry"><span class="mlabel">protected</span><span class="mlabel">virtual</span></td></tr>
<tr class="even"><td class="entry"><a class="el" href="<API key>.html#<API key>"><API key></a>(const MPVariable *const variable, double coefficient) override</td><td class="entry"><a class="el" href="<API key>.html">CLPInterface</a></td><td class="entry"><span class="mlabel">virtual</span></td></tr>
<tr class="odd"><td class="entry"><a class="el" href="<API key>.html#<API key>">SetObjectiveOffset</a>(double offset) override</td><td class="entry"><a class="el" href="<API key>.html">CLPInterface</a></td><td class="entry"><span class="mlabel">virtual</span></td></tr>
<tr class="even"><td class="entry"><a class="el" href="<API key>.html#<API key>"><API key></a>(bool maximize) override</td><td class="entry"><a class="el" href="<API key>.html">CLPInterface</a></td><td class="entry"><span class="mlabel">virtual</span></td></tr>
<tr class="odd"><td class="entry"><a class="el" href="<API key>.html#<API key>"><API key></a>(const std::string &parameters)</td><td class="entry"><a class="el" href="<API key>.html">MPSolverInterface</a></td><td class="entry"><span class="mlabel">protected</span><span class="mlabel">virtual</span></td></tr>
<tr class="even"><td class="entry"><a class="el" href="<API key>.html#<API key>">SetStartingLpBasis</a>(const std::vector< MPSolver::BasisStatus > &variable_statuses, const std::vector< MPSolver::BasisStatus > &constraint_statuses)</td><td class="entry"><a class="el" href="<API key>.html">MPSolverInterface</a></td><td class="entry"><span class="mlabel">inline</span><span class="mlabel">virtual</span></td></tr>
<tr class="odd"><td class="entry"><a class="el" href="<API key>.html#<API key>"><API key></a>(MPSolverParameters::DoubleParam param)</td><td class="entry"><a class="el" href="<API key>.html">MPSolverInterface</a></td><td class="entry"><span class="mlabel">protected</span></td></tr>
<tr class="even"><td class="entry"><a class="el" href="<API key>.html#<API key>"><API key></a>(MPSolverParameters::IntegerParam param)</td><td class="entry"><a class="el" href="<API key>.html">MPSolverInterface</a></td><td class="entry"><span class="mlabel">protected</span><span class="mlabel">virtual</span></td></tr>
<tr class="odd"><td class="entry"><a class="el" href="<API key>.html#<API key>">SetVariableBounds</a>(int var_index, double lb, double ub) override</td><td class="entry"><a class="el" href="<API key>.html">CLPInterface</a></td><td class="entry"><span class="mlabel">virtual</span></td></tr>
<tr class="even"><td class="entry"><a class="el" href="<API key>.html#<API key>">SetVariableInteger</a>(int var_index, bool integer) override</td><td class="entry"><a class="el" href="<API key>.html">CLPInterface</a></td><td class="entry"><span class="mlabel">virtual</span></td></tr>
<tr class="odd"><td class="entry"><a class="el" href="<API key>.html#<API key>"><API key></a> enum value</td><td class="entry"><a class="el" href="<API key>.html">MPSolverInterface</a></td><td class="entry"></td></tr>
<tr class="even"><td class="entry"><a class="el" href="<API key>.html#<API key>">Solve</a>(const MPSolverParameters &param) override</td><td class="entry"><a class="el" href="<API key>.html">CLPInterface</a></td><td class="entry"><span class="mlabel">virtual</span></td></tr>
<tr class="odd"><td class="entry"><a class="el" href="<API key>.html#<API key>">solver_</a></td><td class="entry"><a class="el" href="<API key>.html">MPSolverInterface</a></td><td class="entry"><span class="mlabel">protected</span></td></tr>
<tr class="even"><td class="entry"><a class="el" href="<API key>.html#<API key>">SolverVersion</a>() const override</td><td class="entry"><a class="el" href="<API key>.html">CLPInterface</a></td><td class="entry"><span class="mlabel">inline</span><span class="mlabel">virtual</span></td></tr>
<tr class="odd"><td class="entry"><a class="el" href="<API key>.html#<API key>">SupportsCallbacks</a>() const</td><td class="entry"><a class="el" href="<API key>.html">MPSolverInterface</a></td><td class="entry"><span class="mlabel">inline</span><span class="mlabel">virtual</span></td></tr>
<tr class="even"><td class="entry"><a class="el" href="<API key>.html#<API key>">sync_status_</a></td><td class="entry"><a class="el" href="<API key>.html">MPSolverInterface</a></td><td class="entry"><span class="mlabel">protected</span></td></tr>
<tr class="odd"><td class="entry"><a class="el" href="<API key>.html#<API key>"><API key></a> enum name</td><td class="entry"><a class="el" href="<API key>.html">MPSolverInterface</a></td><td class="entry"></td></tr>
<tr class="even"><td class="entry"><a class="el" href="<API key>.html#<API key>">underlying_solver</a>() override</td><td class="entry"><a class="el" href="<API key>.html">CLPInterface</a></td><td class="entry"><span class="mlabel">inline</span><span class="mlabel">virtual</span></td></tr>
<tr class="odd"><td class="entry"><a class="el" href="<API key>.html#<API key>"><API key></a>(int var_index) const</td><td class="entry"><a class="el" href="<API key>.html">MPSolverInterface</a></td><td class="entry"><span class="mlabel">inline</span></td></tr>
<tr class="even"><td class="entry"><a class="el" href="<API key>.html#<API key>">Write</a>(const std::string &filename)</td><td class="entry"><a class="el" href="<API key>.html">MPSolverInterface</a></td><td class="entry"><span class="mlabel">virtual</span></td></tr>
<tr class="odd"><td class="entry"><a class="el" href="<API key>.html#<API key>">~CLPInterface</a>() override</td><td class="entry"><a class="el" href="<API key>.html">CLPInterface</a></td><td class="entry"></td></tr>
<tr class="even"><td class="entry"><a class="el" href="<API key>.html#<API key>">~MPSolverInterface</a>()</td><td class="entry"><a class="el" href="<API key>.html">MPSolverInterface</a></td><td class="entry"><span class="mlabel">virtual</span></td></tr>
</table></div><!-- contents -->
</div><!-- doc-content -->
<!-- HTML footer for doxygen 1.8.18-->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
<ul>
<li class="footer">Generated by
<a href="http:
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.9.2 </li>
</ul>
</div>
</body>
</html> |
BUCKETNAME=alpha.droneshare.com
export AWS_DEFAULT_PROFILE=3dr
aws s3 mb s3://$BUCKETNAME
aws s3 sync --delete dist s3://$BUCKETNAME
# AngularJS applications prefer to get back index.html for any bad links
cat >s3website.json <<EOF
{
"IndexDocument": {
"Suffix": "index.html"
},
"RoutingRules": [
{
"Condition": {
"<API key>": "404"
},
"Redirect": {
"ReplaceKeyWith": "index.html"
}
}
]
}
EOF
aws s3api put-bucket-website --bucket $BUCKETNAME --<API key> file://s3website.json
cat > s3bucket-policy.json <<EOF
{
"Version":"2012-10-17",
"Statement":[{
"Sid":"PublicReadGetObject",
"Effect":"Allow",
"Principal": {
"AWS": "*"
},
"Action":["s3:GetObject"], |
/* $Xorg: save.c,v 1.5 2001/02/09 02:06:01 xorgcvs Exp $ */
/* $XFree86: xc/programs/xsm/save.c,v 3.3 2001/01/17 23:46:30 dawes Exp $ */
#include "xsm.h"
#include "save.h"
#include "saveutil.h"
#include "popup.h"
#include "info.h"
#include "lock.h"
#include "choose.h"
#include <X11/Shell.h>
#include <X11/Xaw/Form.h>
#include <X11/Xaw/List.h>
#include <X11/Xaw/Command.h>
#include <X11/Xaw/Toggle.h>
#include <X11/Xaw/AsciiText.h>
static Widget savePopup;
static Widget saveForm;
static Widget saveMessageLabel;
static Widget saveName;
static Widget saveTypeLabel;
static Widget saveTypeGlobal;
static Widget saveTypeLocal;
static Widget saveTypeBoth;
static Widget interactStyleLabel;
static Widget interactStyleNone;
static Widget interactStyleErrors;
static Widget interactStyleAny;
static Widget saveOkButton;
static Widget helpSaveButton;
static Widget saveCancelButton;
static Widget helpPopup;
static Widget helpForm;
static Widget helpSaveText;
static Widget helpSaveOkButton;
static Widget nameInUsePopup;
static Widget nameInUseForm;
static Widget nameInUseLabel;
static Widget <API key>;
static Widget <API key>;
static Widget badSavePopup;
static Widget badSaveForm;
static Widget badSaveLabel;
static Widget badSaveOkButton;
static Widget badSaveCancelButton;
static Widget badSaveListWidget;
static int saveTypeData[] = {
SmSaveLocal,
SmSaveGlobal,
SmSaveBoth
};
static int interactStyleData[] = {
SmInteractStyleNone,
<API key>,
SmInteractStyleAny
};
static String *failedNames = NULL;
static int numFailedNames = 0;
static Bool help_visible = False;
static String name_in_use = NULL;
static Bool name_locked = False;
static void
MakeCurrentSession(String new_name, Bool name_changed)
{
char title[256];
List *cl;
if (session_name)
{
/*
* In the old session, for any client that was not restarted by the
* session manager (previous ID was NULL), if we did not issue a
* checkpoint to this client after the initial startup, remove the
* client's checkpoint file using the discard command.
*/
for (cl = ListFirst (RunningList); cl; cl = ListNext (cl))
{
ClientRec *client = (ClientRec *) cl->thing;
if (!client->restarted &&
!client-><API key> &&
client->discardCommand)
{
<API key> (client->discardCommand);
XtFree (client->discardCommand);
client->discardCommand = NULL;
}
}
/*
* Unlock the old session.
*/
if (!<API key>)
UnlockSession (session_name);
}
if (name_changed)
{
if (session_name)
XtFree (session_name);
session_name = XtNewString (new_name);
}
LockSession (session_name, True);
snprintf (title, sizeof(title), "xsm: %s", session_name);
XtVaSetValues (topLevel,
XtNtitle, title,
NULL);
<API key> (session_name);
/*
* For each client, set the DiscardCommand ptr to NULL.
* This is so when we do a checkpoint with the new session
* name, we don't wipe out the checkpoint files needed by
* the previous session. We also set the <API key>
* flag to false for each client in the new session.
*/
for (cl = ListFirst (RunningList); cl; cl = ListNext (cl))
{
ClientRec *client = (ClientRec *) cl->thing;
client-><API key> = False;
if (client->discardCommand)
{
XtFree (client->discardCommand);
client->discardCommand = NULL;
}
}
<API key> = False;
}
#define NAME_OK 0
#define NAME_EMPTY 1
#define NAME_EXISTS 2
#define NAME_LOCKED 3
static int
GetSaveName(String *nameRet)
{
String new_name = NULL;
Bool name_changed;
/*
* Get the name of the session for the save
*/
XtVaGetValues (saveName,
XtNstring, &new_name,
NULL);
*nameRet = new_name;
if (!new_name || *new_name == '\0')
return (NAME_EMPTY);
/*
* See if this is a new session. If not return.
*/
name_changed = !session_name ||
(session_name && strcmp (session_name, new_name) != 0);
if (!<API key> && !name_changed)
return (NAME_OK);
/*
* Make sure the session name is unique.
*/
if (GetSessionNames (&sessionNameCount,
&sessionNamesShort, NULL, &sessionsLocked))
{
int i, no_good = 0, locked = 0;
for (i = 0; i < sessionNameCount; i++)
if (strcmp (new_name, sessionNamesShort[i]) == 0)
{
no_good = 1;
locked = sessionsLocked[i];
break;
}
FreeSessionNames (sessionNameCount,
sessionNamesShort, NULL, sessionsLocked);
if (no_good)
return (locked ? NAME_LOCKED : NAME_EXISTS);
}
MakeCurrentSession (new_name, name_changed);
return (NAME_OK);
}
static void
GetSaveOptions(int *saveType, int *interactStyle, Bool *fast)
{
XtPointer ptr;
if (help_visible)
{
XtPopdown (helpPopup);
help_visible = 0;
}
ptr = XawToggleGetCurrent (saveTypeLocal /* just 1 of the group */);
*saveType = *((int *) ptr);
ptr = XawToggleGetCurrent (interactStyleNone /* just 1 of the group */);
*interactStyle = *((int *) ptr);
*fast = False;
}
void
DoSave(int saveType, int interactStyle, Bool fast)
{
ClientRec *client;
List *cl;
const char *_saveType;
const char *_shutdown;
const char *_interactStyle;
if (saveType == SmSaveLocal)
_saveType = "Local";
else if (saveType == SmSaveGlobal)
_saveType = "Global";
else
_saveType = "Both";
if (wantShutdown)
_shutdown = "True";
else
_shutdown = "False";
if (interactStyle == SmInteractStyleNone)
_interactStyle = "None";
else if (interactStyle == <API key>)
_interactStyle = "Errors";
else
_interactStyle = "Any";
SetSaveSensitivity (False);
saveInProgress = True;
shutdownCancelled = False;
phase2InProgress = False;
if (ListCount (RunningList) == 0)
FinishUpSave ();
for (cl = ListFirst (RunningList); cl; cl = ListNext (cl))
{
client = (ClientRec *) cl->thing;
SmsSaveYourself (client->smsConn,
saveType, wantShutdown, interactStyle, fast);
ListAddLast (WaitForSaveDoneList, (char *) client);
client-><API key> = True;
client-><API key> = False;
if (verbose)
{
printf ("Client Id = %s, sent SAVE YOURSELF [", client->clientId);
printf ("Save Type = %s, Shutdown = %s, ", _saveType, _shutdown);
printf ("Interact Style = %s, Fast = False]\n", _interactStyle);
}
}
if (verbose)
{
printf ("\n");
printf ("Sent SAVE YOURSELF to all clients. Waiting for\n");
printf ("SAVE YOURSELF DONE, INTERACT REQUEST, or\n");
printf ("SAVE YOURSELF PHASE 2 REQUEST from each client.\n");
printf ("\n");
}
}
static void
SaveOkAction(Widget w, XEvent *event, String *params, Cardinal *num_params)
{
XtCallCallbacks (saveOkButton, XtNcallback, NULL);
}
static void
DelSaveWinAction(Widget w, XEvent *event, String *params, Cardinal *num_params)
{
XtCallCallbacks (saveCancelButton, XtNcallback, NULL);
}
static void
<API key>(Widget w, XEvent *event, String *params,
Cardinal *num_params)
{
XtCallCallbacks (<API key>, XtNcallback, NULL);
}
static void
DelBadSaveWinAction(Widget w, XEvent *event, String *params,
Cardinal *num_params)
{
if (XtIsManaged (badSaveCancelButton))
XtCallCallbacks (badSaveCancelButton, XtNcallback, NULL);
else
XtCallCallbacks (badSaveOkButton, XtNcallback, NULL);
}
static void
<API key>(Widget w, XEvent *event, String *params,
Cardinal *num_params)
{
XtCallCallbacks (helpSaveOkButton, XtNcallback, NULL);
}
static void
SaveOkXtProc(Widget w, XtPointer client_data, XtPointer callData)
{
String name = NULL;
char label[256];
int status;
static int first_time = 1;
int saveType;
int interactStyle;
Bool fast;
if ((status = GetSaveName (&name)) != NAME_OK)
{
#ifdef XKB
XkbStdBell(XtDisplay(topLevel),XtWindow(topLevel),0,XkbBI_BadValue);
#else
XBell (XtDisplay (topLevel), 0);
#endif
if (status == NAME_EXISTS || status == NAME_LOCKED)
{
name_in_use = name;
if (status == NAME_LOCKED)
{
name_locked = True;
snprintf (label, sizeof(label), "Another session by the name '%s' is active.\nChoose another name for the session.", name);
XtUnmanageChild (<API key>);
XtVaSetValues (<API key>,
XtNlabel, "OK",
XtNfromHoriz, NULL,
NULL);
}
else
{
name_locked = False;
snprintf (label, sizeof(label), "Another session by the name '%s' already exists.\nWould you like to overwrite it?", name);
XtManageChild (<API key>);
XtVaSetValues (<API key>,
XtNlabel, "Cancel",
XtNfromHoriz, <API key>,
NULL);
}
XtVaSetValues (nameInUseLabel,
XtNlabel, label,
NULL);
XtPopdown (savePopup);
PopupPopup (mainWindow, nameInUsePopup,
True, first_time, 25, 100, "<API key>()");
if (first_time)
first_time = 0;
}
return;
}
GetSaveOptions (&saveType, &interactStyle, &fast);
DoSave (saveType, interactStyle, fast);
}
void
LetClientInteract(List *cl)
{
ClientRec *client = (ClientRec *) cl->thing;
SmsInteract (client->smsConn);
<API key> (WaitForInteractList, (char *) client);
if (verbose)
{
printf ("Client Id = %s, sent INTERACT\n", client->clientId);
}
}
void
StartPhase2(void)
{
List *cl;
if (verbose)
{
printf ("\n");
printf ("Starting PHASE 2 of SAVE YOURSELF\n");
printf ("\n");
}
for (cl = ListFirst (WaitForPhase2List); cl; cl = ListNext (cl))
{
ClientRec *client = (ClientRec *) cl->thing;
<API key> (client->smsConn);
if (verbose)
{
printf ("Client Id = %s, sent SAVE YOURSELF PHASE 2",
client->clientId);
}
}
ListFreeAllButHead (WaitForPhase2List);
phase2InProgress = True;
}
void
FinishUpSave(void)
{
ClientRec *client;
List *cl;
if (verbose)
{
printf ("\n");
printf ("All clients issued SAVE YOURSELF DONE\n");
printf ("\n");
}
saveInProgress = False;
phase2InProgress = False;
/*
* Now execute discard commands
*/
for (cl = ListFirst (RunningList); cl; cl = ListNext (cl))
{
client = (ClientRec *) cl->thing;
if (!client-><API key>)
continue;
if (client->discardCommand)
{
<API key> (client->discardCommand);
XtFree (client->discardCommand);
client->discardCommand = NULL;
}
if (client->saveDiscardCommand)
{
client->discardCommand = client->saveDiscardCommand;
client->saveDiscardCommand = NULL;
}
}
/*
* Write the save file
*/
WriteSave (sm_id);
if (wantShutdown && shutdownCancelled)
{
shutdownCancelled = False;
}
else if (wantShutdown)
{
if (ListCount (RunningList) == 0)
EndSession (0);
shutdownInProgress = True;
for (cl = ListFirst (RunningList); cl; cl = ListNext (cl))
{
client = (ClientRec *) cl->thing;
SmsDie (client->smsConn);
if (verbose)
{
printf ("Client Id = %s, sent DIE\n", client->clientId);
}
}
}
else
{
for (cl = ListFirst (RunningList); cl; cl = ListNext (cl))
{
client = (ClientRec *) cl->thing;
SmsSaveComplete (client->smsConn);
if (verbose)
{
printf ("Client Id = %s, sent SAVE COMPLETE\n",
client->clientId);
}
}
}
if (!shutdownInProgress)
{
XtPopdown (savePopup);
SetAllSensitive (1);
if (<API key>)
<API key> = False;
}
}
static void
SaveCancelXtProc(Widget w, XtPointer client_data, XtPointer callData)
{
XtPopdown (savePopup);
if (help_visible)
{
XtPopdown (helpPopup);
help_visible = 0;
}
SetAllSensitive (1);
}
/*
* Add toggle button
*/
static Widget
AddToggle(char *widgetName, Widget parent, int state, Widget radioGroup,
XtPointer radioData, Widget fromHoriz, Widget fromVert)
{
Widget toggle;
toggle = <API key> (
widgetName, toggleWidgetClass, parent,
XtNstate, state,
XtNradioGroup, radioGroup,
XtNradioData, radioData,
XtNfromHoriz, fromHoriz,
XtNfromVert, fromVert,
NULL);
return (toggle);
}
void
SetSaveSensitivity(Bool on)
{
XtSetSensitive (savePopup, on);
#if 0
/*
* When we turn of sensitivity in the save dialog, we want to keep
* the cancel button sensitive (so the user can cancel in case of
* a problem). Unfortunately, we can not turn off the sensitivity on
* the save popup, and then just turn on sensitivity for the cancel
* button. We must do each widget individually.
*/
XtSetSensitive (saveTypeLabel, on);
XtSetSensitive (saveTypeGlobal, on);
XtSetSensitive (saveTypeLocal, on);
XtSetSensitive (saveTypeBoth, on);
XtSetSensitive (interactStyleLabel, on);
XtSetSensitive (interactStyleNone, on);
XtSetSensitive (interactStyleErrors, on);
XtSetSensitive (interactStyleAny, on);
XtSetSensitive (saveOkButton, on);
#endif
}
void
<API key>(Widget w, XtPointer closure, XEvent *event,
Boolean *<API key>)
{
if (event->type == MapNotify)
{
/*
* Now that the Save Dialog is back up, we can do the save.
*/
int saveType;
int interactStyle;
Bool fast;
if (name_locked)
{
/* Force shutdown */
}
DeleteSession (name_in_use);
MakeCurrentSession (name_in_use, True);
name_in_use = NULL;
GetSaveOptions (&saveType, &interactStyle, &fast);
DoSave (saveType, interactStyle, fast);
<API key> (savePopup, StructureNotifyMask, False,
<API key>, NULL);
}
}
static void
<API key>(Widget w, XtPointer client_data, XtPointer callData)
{
if (name_locked)
{
/* force shutdown not implemented yet */
return;
}
XtPopdown (nameInUsePopup);
/*
* We want to popup the Save dialog again. In order to avoid a race
* condition with the BadSave handler trying to pop down the Save Dialog,
* we wait for the MapNotify on the Save dialog, and then do the save.
*/
XtAddEventHandler (savePopup, StructureNotifyMask, False,
<API key>, NULL);
XtPopup (savePopup, XtGrabNone);
}
static void
<API key>(Widget w, XtPointer client_data, XtPointer callData)
{
XtPopdown (nameInUsePopup);
XtPopup (savePopup, XtGrabNone);
name_in_use = NULL;
}
static void
BadSaveOkXtProc(Widget w, XtPointer client_data, XtPointer callData)
{
ListFreeAllButHead (FailedSaveList);
XtPopdown (badSavePopup);
FinishUpSave ();
}
static void
BadSaveCancelXtProc(Widget w, XtPointer client_data, XtPointer callData)
{
ListFreeAllButHead (FailedSaveList);
XtPopdown (badSavePopup);
if (wantShutdown)
{
List *cl;
shutdownCancelled = True;
for (cl = ListFirst (RunningList); cl; cl = ListNext (cl))
{
ClientRec *client = (ClientRec *) cl->thing;
<API key> (client->smsConn);
if (verbose)
{
printf ("Client Id = %s, sent SHUTDOWN CANCELLED\n",
client->clientId);
}
}
}
FinishUpSave ();
}
static void
BadSaveListXtProc(Widget w, XtPointer client_data, XtPointer callData)
{
}
static void
HelpSaveXtProc(Widget w, XtPointer client_data, XtPointer callData)
{
static int first_time = 1;
if (help_visible)
{
/* Make sure it is visible */
XMapRaised (XtDisplay (topLevel), XtWindow (helpPopup));
}
else
{
PopupPopup (savePopup, helpPopup,
True, first_time, 50, 50, "<API key>()");
help_visible = 1;
if (first_time)
first_time = 0;
}
}
static void
HelpSaveOkXtProc(Widget w, XtPointer client_data, XtPointer callData)
{
XtPopdown (helpPopup);
help_visible = 0;
}
void
create_save_popup(void)
{
XtTranslations translations;
static XtActionsRec actions[] = {
{"SaveOkAction", SaveOkAction},
{"DelSaveWinAction", DelSaveWinAction},
{"<API key>", <API key>},
{"DelBadSaveWinAction", DelBadSaveWinAction},
{"<API key>", <API key>}
};
/*
* Pop up for Save Yourself button.
*/
savePopup = <API key> (
"savePopup", <API key>, topLevel,
XtNallowShellResize, True,
NULL);
saveForm = <API key> (
"saveForm", formWidgetClass, savePopup, NULL, 0);
saveMessageLabel = <API key> (
"saveMessageLabel", labelWidgetClass, saveForm,
XtNfromHoriz, NULL,
XtNfromVert, NULL,
XtNborderWidth, 0,
NULL);
saveName = <API key> (
"saveName", <API key>, saveForm,
XtNfromVert, NULL,
XtNeditType, XawtextEdit,
XtNresizable, True,
XtNresize, XawtextResizeWidth,
NULL);
saveTypeLabel = <API key> (
"saveTypeLabel", labelWidgetClass, saveForm,
XtNfromHoriz, NULL,
XtNfromVert, saveMessageLabel,
XtNborderWidth, 0,
XtNvertDistance, 20,
NULL);
saveTypeLocal = AddToggle (
"saveTypeLocal", /* widgetName */
saveForm, /* parent */
0, /* state */
NULL, /* radioGroup */
(XtPointer) &saveTypeData[0], /* radioData */
saveTypeLabel, /* fromHoriz */
saveMessageLabel /* fromVert */
);
saveTypeGlobal = AddToggle (
"saveTypeGlobal", /* widgetName */
saveForm, /* parent */
0, /* state */
saveTypeLocal, /* radioGroup */
(XtPointer) &saveTypeData[1], /* radioData */
saveTypeLocal, /* fromHoriz */
saveMessageLabel /* fromVert */
);
saveTypeBoth = AddToggle (
"saveTypeBoth", /* widgetName */
saveForm, /* parent */
1, /* state */
saveTypeLocal, /* radioGroup */
(XtPointer) &saveTypeData[2], /* radioData */
saveTypeGlobal, /* fromHoriz */
saveMessageLabel /* fromVert */
);
XtVaSetValues (saveName, XtNfromHoriz, saveTypeLabel, NULL);
XtVaSetValues (saveTypeLocal, XtNvertDistance, 20, NULL);
XtVaSetValues (saveTypeGlobal, XtNvertDistance, 20, NULL);
XtVaSetValues (saveTypeBoth, XtNvertDistance, 20, NULL);
interactStyleLabel = <API key> (
"interactStyleLabel", labelWidgetClass, saveForm,
XtNfromHoriz, NULL,
XtNfromVert, saveTypeLabel,
XtNborderWidth, 0,
NULL);
interactStyleNone = AddToggle (
"interactStyleNone", /* widgetName */
saveForm, /* parent */
0, /* state */
NULL, /* radioGroup */
(XtPointer) &interactStyleData[0], /* radioData */
saveTypeLabel, /* fromHoriz */
saveTypeLabel /* fromVert */
);
interactStyleErrors = AddToggle (
"interactStyleErrors", /* widgetName */
saveForm, /* parent */
0, /* state */
interactStyleNone, /* radioGroup */
(XtPointer) &interactStyleData[1], /* radioData */
interactStyleNone, /* fromHoriz */
saveTypeLabel /* fromVert */
);
interactStyleAny = AddToggle (
"interactStyleAny", /* widgetName */
saveForm, /* parent */
1, /* state */
interactStyleNone, /* radioGroup */
(XtPointer) &interactStyleData[2], /* radioData */
interactStyleErrors, /* fromHoriz */
saveTypeLabel /* fromVert */
);
saveOkButton = <API key> (
"saveOkButton", commandWidgetClass, saveForm,
XtNfromHoriz, NULL,
XtNfromVert, interactStyleLabel,
XtNvertDistance, 20,
XtNresizable, True,
NULL);
XtAddCallback (saveOkButton, XtNcallback, SaveOkXtProc, NULL);
helpSaveButton = <API key> (
"helpSaveButton", commandWidgetClass, saveForm,
XtNfromHoriz, saveOkButton,
XtNfromVert, interactStyleLabel,
XtNvertDistance, 20,
NULL);
XtAddCallback (helpSaveButton, XtNcallback, HelpSaveXtProc, NULL);
saveCancelButton = <API key> (
"saveCancelButton", commandWidgetClass, saveForm,
XtNfromHoriz, helpSaveButton,
XtNfromVert, interactStyleLabel,
XtNvertDistance, 20,
NULL);
XtAddCallback (saveCancelButton, XtNcallback, SaveCancelXtProc, NULL);
XtSetKeyboardFocus (saveForm, saveName);
XtAppAddActions (appContext, actions, XtNumber (actions));
translations = <API key>
("<Key>Return: SaveOkAction()\n");
<API key>(saveName, translations);
<API key> (saveForm, saveForm);
/*
* Pop up when user tries to save the session under an
* already used name.
*/
nameInUsePopup = <API key> (
"nameInUsePopup", <API key>, topLevel,
XtNallowShellResize, True,
NULL);
nameInUseForm = <API key> (
"nameInUseForm", formWidgetClass, nameInUsePopup,
NULL);
nameInUseLabel = <API key> (
"nameInUseLabel", labelWidgetClass, nameInUseForm,
XtNresizable, True,
XtNfromHoriz, NULL,
XtNfromVert, NULL,
XtNborderWidth, 0,
XtNtop, XawChainTop,
XtNbottom, XawChainTop,
NULL);
<API key> = <API key> (
"<API key>", commandWidgetClass, nameInUseForm,
XtNfromHoriz, NULL,
XtNfromVert, nameInUseLabel,
XtNtop, XawChainBottom,
XtNbottom, XawChainBottom,
NULL);
XtAddCallback (<API key>, XtNcallback,
<API key>, NULL);
<API key> = <API key> (
"<API key>", commandWidgetClass, nameInUseForm,
XtNresizable, True,
XtNfromHoriz, <API key>,
XtNfromVert, nameInUseLabel,
XtNtop, XawChainBottom,
XtNbottom, XawChainBottom,
NULL);
XtAddCallback (<API key>, XtNcallback,
<API key>, NULL);
/*
* Pop up for help.
*/
helpPopup = <API key> (
"helpPopup", <API key>, topLevel,
NULL);
helpForm = <API key> (
"helpForm", formWidgetClass, helpPopup,
NULL);
helpSaveText = <API key> (
"helpSaveText", labelWidgetClass, helpForm,
XtNfromHoriz, NULL,
XtNfromVert, NULL,
XtNtop, XawChainTop,
XtNbottom, XawChainTop,
NULL);
helpSaveOkButton = <API key> (
"helpSaveOkButton", commandWidgetClass, helpForm,
XtNfromHoriz, NULL,
XtNfromVert, helpSaveText,
XtNtop, XawChainBottom,
XtNbottom, XawChainBottom,
XtNvertDistance, 20,
NULL);
XtAddCallback (helpSaveOkButton, XtNcallback,
HelpSaveOkXtProc, NULL);
/*
* Pop up when not all clients returned SaveSuccess
*/
badSavePopup = <API key> (
"badSavePopup", <API key>, topLevel,
XtNallowShellResize, True,
NULL);
badSaveForm = <API key> (
"badSaveForm", formWidgetClass, badSavePopup,
NULL);
badSaveLabel = <API key> (
"badSaveLabel", labelWidgetClass, badSaveForm,
XtNfromHoriz, NULL,
XtNfromVert, NULL,
XtNborderWidth, 0,
XtNtop, XawChainTop,
XtNbottom, XawChainTop,
NULL);
badSaveListWidget = <API key> (
"badSaveListWidget", listWidgetClass, badSaveForm,
XtNresizable, True,
XtNdefaultColumns, 1,
XtNforceColumns, True,
XtNfromHoriz, NULL,
XtNfromVert, badSaveLabel,
XtNtop, XawChainTop,
XtNbottom, XawChainBottom,
NULL);
XtAddCallback (badSaveListWidget, XtNcallback, BadSaveListXtProc, NULL);
badSaveOkButton = <API key> (
"badSaveOkButton", commandWidgetClass, badSaveForm,
XtNfromHoriz, NULL,
XtNfromVert, badSaveListWidget,
XtNtop, XawChainBottom,
XtNbottom, XawChainBottom,
NULL);
XtAddCallback (badSaveOkButton, XtNcallback, BadSaveOkXtProc, NULL);
badSaveCancelButton = <API key> (
"badSaveCancelButton", commandWidgetClass, badSaveForm,
XtNfromHoriz, badSaveOkButton,
XtNfromVert, badSaveListWidget,
XtNtop, XawChainBottom,
XtNbottom, XawChainBottom,
NULL);
XtAddCallback (badSaveCancelButton, XtNcallback, BadSaveCancelXtProc, NULL);
<API key> (badSaveForm, badSaveForm);
}
void
PopupSaveDialog(void)
{
static int first_time = 1;
XtSetSensitive (mainWindow, 0);
XtSetSensitive (clientInfoPopup, 0);
XtSetSensitive (clientPropPopup, 0);
XawToggleSetCurrent (saveTypeBoth,
(XtPointer) &saveTypeData[2]);
XawToggleSetCurrent (interactStyleAny,
(XtPointer) &interactStyleData[2]);
XtVaSetValues (savePopup,
XtNtitle, wantShutdown ? "Shutdown" : "Checkpoint",
NULL);
XtVaSetValues (saveName,
XtNstring, <API key> ? "" : session_name,
NULL);
XtVaSetValues (saveOkButton,
XtNlabel, wantShutdown ? "Shutdown" : "Checkpoint",
NULL);
PopupPopup (mainWindow, savePopup,
True, first_time, 25, 100, "DelSaveWinAction()");
if (first_time)
first_time = 0;
}
void
CheckPointXtProc(Widget w, XtPointer client_data, XtPointer callData)
{
wantShutdown = False;
PopupSaveDialog ();
}
void
ShutdownSaveXtProc(Widget w, XtPointer client_data, XtPointer callData)
{
wantShutdown = True;
PopupSaveDialog ();
}
void
PopupBadSave(void)
{
ClientRec *client;
char *progName, *hostname, *tmp1, *tmp2;
String clientInfo;
int maxlen1, maxlen2;
char extraBuf1[80], extraBuf2[80];
char *<API key>;
List *cl, *pl;
int i, k;
static int first_time = 1;
if (failedNames)
{
/*
* Free the previous list of names. Xaw doesn't make a copy of
* our list, so we need to keep it around.
*/
for (i = 0; i < numFailedNames; i++)
XtFree (failedNames[i]);
XtFree ((char *) failedNames);
failedNames = NULL;
}
maxlen1 = maxlen2 = 0;
numFailedNames = 0;
for (cl = ListFirst (FailedSaveList); cl; cl = ListNext (cl))
{
client = (ClientRec *) cl->thing;
progName = NULL;
<API key> = NULL;
for (pl = ListFirst (client->props); pl; pl = ListNext (pl))
{
Prop *pprop = (Prop *) pl->thing;
List *vl = ListFirst (pprop->values);
PropValue *pval = (PropValue *) vl->thing;
if (strcmp (pprop->name, SmProgram) == 0)
{
progName = GetProgramName ((char *) pval->value);
if ((int) strlen (progName) > maxlen1)
maxlen1 = strlen (progName);
}
else if (strcmp (pprop->name, "_XC_RestartService") == 0)
{
<API key> = (char *) pval->value;
}
}
if (!progName)
continue;
if (<API key>)
tmp1 = <API key>;
else if (client->clientHostname)
tmp1 = client->clientHostname;
else
continue;
if ((tmp2 = (char *) strchr (tmp1, '/')) == NULL)
hostname = tmp1;
else
hostname = tmp2 + 1;
if ((int) strlen (hostname) > maxlen2)
maxlen2 = strlen (hostname);
numFailedNames++;
}
failedNames = (String *) XtMalloc (
numFailedNames * sizeof (String));
i = 0;
for (cl = ListFirst (FailedSaveList); cl; cl = ListNext (cl))
{
ClientRec *client = (ClientRec *) cl->thing;
int extra1, extra2;
progName = NULL;
<API key> = NULL;
for (pl = ListFirst (client->props); pl; pl = ListNext (pl))
{
Prop *pprop = (Prop *) pl->thing;
List *vl = ListFirst (pprop->values);
PropValue *pval = (PropValue *) vl->thing;
if (strcmp (pprop->name, SmProgram) == 0)
{
progName = GetProgramName ((char *) pval->value);
}
else if (strcmp (pprop->name, "_XC_RestartService") == 0)
{
<API key> = (char *) pval->value;
}
}
if (!progName)
continue;
if (<API key>)
tmp1 = <API key>;
else if (client->clientHostname)
tmp1 = client->clientHostname;
else
continue;
if ((tmp2 = (char *) strchr (tmp1, '/')) == NULL)
hostname = tmp1;
else
hostname = tmp2 + 1;
extra1 = maxlen1 - strlen (progName) + 5;
extra2 = maxlen2 - strlen (hostname);
for (k = 0; k < extra1; k++)
extraBuf1[k] = ' ';
extraBuf1[extra1] = '\0';
for (k = 0; k < extra2; k++)
extraBuf2[k] = ' ';
extraBuf2[extra2] = '\0';
XtAsprintf (&clientInfo, "%s%s (%s%s)", progName, extraBuf1,
hostname, extraBuf2);
failedNames[i++] = clientInfo;
if (client-><API key>)
{
FreeClient (client, True /* free props */);
}
}
XawListChange (badSaveListWidget,
failedNames, numFailedNames, 0, True);
XtPopdown (savePopup);
if (wantShutdown && !shutdownCancelled)
XtManageChild (badSaveCancelButton);
else
XtUnmanageChild (badSaveCancelButton);
PopupPopup (mainWindow, badSavePopup,
True, first_time, 25, 100, "DelBadSaveWinAction()");
if (first_time)
first_time = 0;
}
void
<API key>(Widget w, XtPointer client_data, XtPointer callData)
{
List *cl;
ClientRec *client;
if (ListCount (RunningList) == 0)
EndSession (0);
/*
* For any client that was not restarted by the session
* manager (previous ID was NULL), if we did not issue a
* checkpoint to this client, remove the client's checkpoint
* file using the discard command.
*/
for (cl = ListFirst (RunningList); cl; cl = ListNext (cl))
{
client = (ClientRec *) cl->thing;
if (!client->restarted &&
!client-><API key> &&
client->discardCommand)
{
<API key> (client->discardCommand);
XtFree (client->discardCommand);
client->discardCommand = NULL;
}
}
shutdownInProgress = True;
for (cl = ListFirst (RunningList); cl; cl = ListNext (cl))
{
client = (ClientRec *) cl->thing;
SmsDie (client->smsConn);
if (verbose)
{
printf ("Client Id = %s, sent DIE\n", client->clientId);
}
}
} |
# Aspicilia sublapponica (Zahlbr.) Oxner SPECIES
# Status
ACCEPTED
# According to
Index Fungorum
# Published in
Bryologist 82(3): 402 (1979)
# Original name
Lecanora sublapponica Zahlbr.
Remarks
null |
<?php
declare(strict_types=1);
class ThemeController extends Base\ApiController
{
public function getAction()
{
return $this->send($this->model->get());
}
} |
// Code generated by protoc-gen-liverpc v0.1, DO NOT EDIT.
// source: v1/AdminSilent.proto
/*
Package v1 is a generated liverpc stub package.
This code was generated with go-common/app/tool/liverpc/protoc-gen-liverpc v0.1.
It is generated from these files:
v1/AdminSilent.proto
v1/Shield.proto
v1/ShieldMng.proto
v1/Silent.proto
v1/SilentMng.proto
v1/SiteBlockMng.proto
*/
package v1
import context "context"
import proto "github.com/golang/protobuf/proto"
import "go-common/library/net/rpc/liverpc"
var _ proto.Message // generate to suppress unused imports
// Imports only used by utility functions:
// AdminSilent Interface
type AdminSilent interface {
GetShieldRule(context.Context, *<API key>) (*<API key>, error)
}
// AdminSilent Live Rpc Client
type <API key> struct {
client *liverpc.Client
}
// <API key> creates a Rpc client that implements the AdminSilent interface.
// It communicates using Rpc and can be configured with a custom HTTPClient.
func <API key>(client *liverpc.Client) AdminSilent {
return &<API key>{
client: client,
}
}
func (c *<API key>) GetShieldRule(ctx context.Context, in *<API key>) (*<API key>, error) {
out := new(<API key>)
err := doRpcRequest(ctx, c.client, 1, "AdminSilent.get_shield_rule", in, out)
if err != nil {
return nil, err
}
return out, nil
}
// Utils
func doRpcRequest(ctx context.Context, client *liverpc.Client, version int, method string, in, out proto.Message) (err error) {
err = client.Call(ctx, version, method, in, out)
return
} |
CREATE TABLE "ENTITY_A" (
"ID" NUMBER(9,0) NOT NULL,
"NAME" VARCHAR2(16 BYTE) NOT NULL,
"CREATED_ON" DATE,
"CREATED_BY" VARCHAR2(16 BYTE),
"UPDATED_ON" DATE,
"UPDATED_BY" VARCHAR2(16 BYTE),
"VERSION" NUMBER(9,0),
CONSTRAINT "ENTITY_A_PK" PRIMARY KEY ("ID") USING INDEX
);
CREATE SEQUENCE "ENTITY_A_SEQ" MINVALUE 1 MAXVALUE <API key> INCREMENT BY 1 START WITH 10000 CACHE 20 NOORDER NOCYCLE ;
CREATE TABLE "ENTITY_B" (
"ID" NUMBER(9,0) NOT NULL,
"NAME" VARCHAR2(16 BYTE) NOT NULL,
"ENTITY_A_ID" NUMBER(9,0),
"CREATED_ON" DATE,
"CREATED_BY" VARCHAR2(16 BYTE),
"UPDATED_ON" DATE,
"UPDATED_BY" VARCHAR2(16 BYTE),
"VERSION" NUMBER(9,0),
CONSTRAINT "ENTITY_B_PK" PRIMARY KEY ("ID") USING INDEX,
CONSTRAINT "<API key>" FOREIGN KEY ("ENTITY_A_ID") REFERENCES "ENTITY_A" ("ID") DEFERRABLE INITIALLY DEFERRED
);
CREATE SEQUENCE "ENTITY_B_SEQ" MINVALUE 1 MAXVALUE <API key> INCREMENT BY 1 START WITH 10000 CACHE 20 NOORDER NOCYCLE ; |
#! /usr/bin/perl
use strict;
use utf8;
use warnings;
use Bio::SeqIO;
die"perl $0 <cds.fa> > out.fa\n" unless(@ARGV eq 1);
my $in = Bio::SeqIO->new(-file=>"< $ARGV[0]",-format=>"fasta");
while (my $seq = $in->next_seq()){
my $reseq = $seq->revcom;
my $tmp_id = $seq->id;
my $tmp_seq = $seq->seq;
my $re_tmp_id = $reseq->id;
my $re_tmp_seq = $reseq->seq;
for(my $i = 1; $i <= 3; $i++){
my $tag = 7 - $i;
my $tmp_desc = "F$i";
my $re_tmp_desc = "F$tag";
print ">$tmp_id $tmp_desc\n$tmp_seq\n";
print ">$re_tmp_id $re_tmp_desc\n$re_tmp_seq\n";
$tmp_seq =~ s/^\w
$re_tmp_seq =~ s/^\w
}
} |
name "ufw"
maintainer "Cloudenablers"
maintainer_email "nagalakshmi.n@cloudenablers.com"
license "Apache 2.0"
description "Installs/Configures ufw"
long_description IO.read(File.join(File.dirname(__FILE__), 'README.md'))
version "0.7.5"
depends "firewall", ">= 0.9"
%w{ ubuntu }.each do |os|
supports os
end
attribute "firewall/rules",
:display_name => "List of firewall rules for the node.",
:description => "List of firewall rules for the node. Possibly set by node, roles or data bags.",
:type => "array"
attribute "firewall/securitylevel",
:display_name => "Security level of the node.",
:description => "Security level of the node, may be set by node, roles or environment." |
var http = require('http');
var gen = require('./<API key>');
var fs = require('fs');
var Vinyl = require('vinyl');
var config = {
type: "model",
moduleName: "SampleModule",
dependencyDir: "src/model*.js",
<API key>: true,
destDir: "src/test/specs",
formatContent: true,
dependencyDestDir: "src/test/mock"
};
var src = "src/model/Adjustment.js";
fs.readFile(src, 'utf8', function (err, data) {
if (err) throw err;
var file = new Vinyl({
cwd: '/',
base: '/',
path: src,
contents: new Buffer(data)
});
var generated = gen.generateSpecs(file, config);
fs.writeFile(generated.path, generated.contents, 'utf-8', function (err) {
if (err)
console.log(err);
});
});
// http.createServer(function (request, response) {
// // Send the HTTP header
// // HTTP Status: 200 : OK
// // Content Type: text/plain
// response.writeHead(200, { 'Content-Type': 'text/plain' });
// var path = "";
// var srFile = fs.open(src, 'r', function (err, fd) {
// if (err) {
// console.log(err);
// response.end('Error: ' + err);
// } else {
// //path = gen.generateSpecs(fd, config);
// path = esprima.parse("function hello() {console.log('dhello')}");
// console.log(path);
// response.end('Here\'s the generated path: ' + path);
// }).listen(8081);
// Console will print the message |
var a00942 =
[
[ "<API key>", "a00942.html#<API key>", null ],
[ "<API key>", "a00942.html#<API key>", null ]
]; |
# -*- coding: utf-8 -*-
# Generated by Django 1.9.4 on 2016-04-08 11:04
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('users', '<API key>'),
]
operations = [
migrations.AddField(
model_name='myuser',
name='email_me',
field=models.BooleanField(default=True),
),
] |
/** @flow */
import ActionType from '../../actions/ActionType'
module.exports = (state = {}, action) => {
switch (action.type) {
case ActionType.Gmail.Label.FETCH_ALL_SUCCESS:
let labelState = {};
action.labels.forEach(label => {
labelState[label.id] = label
});
return labelState;
case ActionType.Gmail.Label.CREATE_SUCCESS:
return {
state,
[action.label.id]: action.label
}
}
return state;
} |
package eu.reactivesystems.league.impl
import akka.Done
import akka.actor.ActorSystem
import akka.http.scaladsl.Http
import akka.stream.ActorMaterializer
import eu.reactivesystems.league.api.{Club, Game, LeagueService}
import scala.concurrent.Future
import scala.io.StdIn
object LeagueServiceImpl extends LeagueService {
implicit val system = ActorSystem("league-actorsystem")
implicit val materializer = ActorMaterializer()
implicit val executionContext = system.dispatcher
override def addClub(leagueId: String, club: Club): Future[Done] =
// get sharded instance
// send message using ask
// process result
Future.successful(Done)
override def addGame(leagueId: String, game: Game): Future[Done] =
Future.successful(Done)
override def changeGame(leagueId: String, game: Game): Future[Done] =
Future.successful(Done)
def main(args: Array[String]): Unit = {
val port =
system.settings.config.getInt("eu.reactivesystems.league.http.port")
val bindingFuture = Http().bindAndHandle(routes, "localhost", port)
println(
s"Server online at http://localhost:$port/\nPress RETURN to stop...")
StdIn.readLine() // let it run until user presses return
bindingFuture
.flatMap(_.unbind()) // trigger unbinding from the port
.onComplete(_ => system.terminate()) // and shutdown when done
}
} |
"""
Return data to a memcache server
To enable this returner the minion will need the python client for memcache
installed and the following values configured in the minion or master
config, these are the defaults.
.. code-block:: yaml
memcache.host: 'localhost'
memcache.port: '11211'
Alternative configuration values can be used by prefacing the configuration.
Any values not found in the alternative configuration will be pulled from
the default location.
.. code-block:: yaml
alternative.memcache.host: 'localhost'
alternative.memcache.port: '11211'
python2-memcache uses 'localhost' and '11211' as syntax on connection.
To use the memcache returner, append '--return memcache' to the salt command.
.. code-block:: bash
salt '*' test.ping --return memcache
To use the alternative configuration, append '--return_config alternative' to the salt command.
.. versionadded:: 2015.5.0
.. code-block:: bash
salt '*' test.ping --return memcache --return_config alternative
To override individual configuration items, append --return_kwargs '{"key:": "value"}' to the salt command.
.. versionadded:: 2016.3.0
.. code-block:: bash
salt '*' test.ping --return memcache --return_kwargs '{"host": "hostname.domain.com"}'
"""
import logging
import salt.returners
import salt.utils.jid
import salt.utils.json
log = logging.getLogger(__name__)
try:
import memcache
HAS_MEMCACHE = True
except ImportError:
HAS_MEMCACHE = False
# Define the module's virtual name
__virtualname__ = "memcache"
def __virtual__():
if not HAS_MEMCACHE:
return (
False,
"Could not import memcache returner; "
"memcache python client is not installed.",
)
return __virtualname__
def _get_options(ret=None):
"""
Get the memcache options from salt.
"""
attrs = {"host": "host", "port": "port"}
_options = salt.returners.<API key>(
__virtualname__, ret, attrs, __salt__=__salt__, __opts__=__opts__
)
return _options
def _get_serv(ret):
"""
Return a memcache server object
"""
_options = _get_options(ret)
host = _options.get("host")
port = _options.get("port")
log.debug("memcache server: %s:%s", host, port)
if not host or not port:
log.error("Host or port not defined in salt config")
return
# Combine host and port to conform syntax of python memcache client
memcacheoptions = (host, port)
return memcache.Client(["{}:{}".format(*memcacheoptions)], debug=0)
# # TODO: make memcacheoptions cluster aware
# Servers can be passed in two forms:
# 1. Strings of the form C{"host:port"}, which implies a default weight of 1
# 2. Tuples of the form C{("host:port", weight)}, where C{weight} is
# an integer weight value.
def _get_list(serv, key):
value = serv.get(key)
if value:
return value.strip(",").split(",")
return []
def _append_list(serv, key, value):
if value in _get_list(serv, key):
return
r = serv.append(key, "{},".format(value))
if not r:
serv.add(key, "{},".format(value))
def prep_jid(nocache=False, passed_jid=None): # pylint: disable=unused-argument
"""
Do any work necessary to prepare a JID, including sending a custom id
"""
return passed_jid if passed_jid is not None else salt.utils.jid.gen_jid(__opts__)
def returner(ret):
"""
Return data to a memcache data store
"""
serv = _get_serv(ret)
minion = ret["id"]
jid = ret["jid"]
fun = ret["fun"]
rets = salt.utils.json.dumps(ret)
serv.set("{}:{}".format(jid, minion), rets) # cache for get_jid
serv.set("{}:{}".format(fun, minion), rets) # cache for get_fun
# The following operations are neither efficient nor atomic.
# If there is a way to make them so, this should be updated.
_append_list(serv, "minions", minion)
_append_list(serv, "jids", jid)
def save_load(jid, load, minions=None):
"""
Save the load to the specified jid
"""
serv = _get_serv(ret=None)
serv.set(jid, salt.utils.json.dumps(load))
_append_list(serv, "jids", jid)
def save_minions(jid, minions, syndic_id=None): # pylint: disable=unused-argument
"""
Included for API consistency
"""
def get_load(jid):
"""
Return the load data that marks a specified jid
"""
serv = _get_serv(ret=None)
data = serv.get(jid)
if data:
return salt.utils.json.loads(data)
return {}
def get_jid(jid):
"""
Return the information returned when the specified job id was executed
"""
serv = _get_serv(ret=None)
minions = _get_list(serv, "minions")
returns = serv.get_multi(minions, key_prefix="{}:".format(jid))
# returns = {minion: return, minion: return, ...}
ret = {}
for minion, data in returns.items():
ret[minion] = salt.utils.json.loads(data)
return ret
def get_fun(fun):
"""
Return a dict of the last function called for all minions
"""
serv = _get_serv(ret=None)
minions = _get_list(serv, "minions")
returns = serv.get_multi(minions, key_prefix="{}:".format(fun))
# returns = {minion: return, minion: return, ...}
ret = {}
for minion, data in returns.items():
ret[minion] = salt.utils.json.loads(data)
return ret
def get_jids():
"""
Return a list of all job ids
"""
serv = _get_serv(ret=None)
jids = _get_list(serv, "jids")
loads = serv.get_multi(jids) # {jid: load, jid: load, ...}
ret = {}
for jid, load in loads.items():
ret[jid] = salt.utils.jid.format_jid_instance(jid, salt.utils.json.loads(load))
return ret
def get_minions():
"""
Return a list of minions
"""
serv = _get_serv(ret=None)
return _get_list(serv, "minions") |
<div *ngIf="contribution">
<br/>
<table>
<tr class="athing">
<td class="ind"></td>
<td valign="top"><!-- Show votes if logged in and not voted--></td>
<td class="default">
<div style="margin-top:2px; margin-bottom: -10px;">
<span class="comhead">
{{contribution.title}}
<a *ngIf="contribution.contr_subtype == 'url'" target="_blank" [href]="contribution.url">({{contribution.url}})</a>
<!-- Show url if not null-->
</span>
</div>
<br><p>{{contribution.upvote}} points by
<a [routerLink]="['UserDetail', {'id':contribution.user_id}]">{{contribution.user_name}}</a> created at
{{contribution.created_at}}</p>
<p *ngIf="contribution.contr_subtype == 'text'">{{contribution.content}}</p>
</tr>
<tr style="height:20px">
<td class="ind"></td>
<td></td>
<td>
<br/>
<span *ngIf="loggedIn()">
<textarea class="input_comment" [(ngModel)]="comment.content"></textarea>
<button (click)="postComment(comment.content, contribution.id)">Comment</button>
</span>
</td>
</tr>
<tr *ngFor="let comment of comments">
<td></td>
<td></td>
<td>
<br/>
<a [routerLink]="['UserDetail', {'id':comment.user_id}]">{{comment.user_name}}</a> created at {{comment.created_at}}<br/>
<span *ngIf="comment.canVote==undefined"><a (click)="vote(comment)">^</a> </span>{{comment.content}}<br/>
{{comment.upvote}} votes <a [routerLink]="['Reply', {'id':comment.id}]" *ngIf="loggedIn()">reply</a>
<br/>
<div class="reply" *ngFor="let reply of comment.comments">
<br/>
<a [routerLink]="['UserDetail', {'id':reply.user_id}]">{{reply.user_name}}</a> created at {{reply.created_at}}<br/>
<span *ngIf="reply.canVote==undefined"><a (click)="vote(reply)">^</a> </span>{{reply.content}}<br/>
{{reply.upvote}} votes
</div>
</td>
</tr>
<br/>
<tr>
</tr>
</table>
</div>
<!
Copyright 2016 Google Inc. All Rights Reserved.
Use of this source code is governed by an MIT-style license that
can be found in the LICENSE file at http: |
using System;
using System.Net.Http;
using Akka.Actor;
using QDFeedParser;
using SymbolLookup.Actors.Messages;
using SymbolLookup.YahooFinance;
using Failure = SymbolLookup.Actors.Messages.Failure;
using Newtonsoft.Json;
namespace SymbolLookup.Actors
{
//Actor responsible for fetching a stock
public class StockActor : TypedActor,
IHandle<<API key>>,
IHandle<<API key>>,
IHandle<DownloadSymbolData>
{
//these will get initialized during create/recreate
private ActorSelection _headlineActor = Context.ActorSelection("../symbolrss");
private ActorSelection _quoteActor = Context.ActorSelection("../symbolquotes");
private string _symbol;
private Quote _stockQuote;
private IFeed _headlines;
public void Handle(<API key> message)
{
_headlines = message.Feed;
//Finished processing! send the parent the full data payload
if (_headlines != null && _stockQuote != null)
Context.Parent.Tell(
new FullStockData() { Symbol = _symbol, Headlines = _headlines, Quote = _stockQuote });
}
public void Handle(<API key> message)
{
_stockQuote = message.Quote;
//Finished processing! send the parent the full data payload
if (_headlines != null && _stockQuote != null)
Context.Parent.Tell(
new FullStockData() { Symbol = _symbol, Headlines = _headlines, Quote = _stockQuote });
}
public void Handle(DownloadSymbolData message)
{
_symbol = message.Symbol;
_headlineActor.Tell(message);
_quoteActor.Tell(message);
}
}
public class SymbolRssActor : UntypedActor
{
private readonly IFeedFactory _feedFactory;
public SymbolRssActor(IFeedFactory feedFactory)
{
_feedFactory = feedFactory;
}
protected override void PreRestart(Exception cause, object message)
{
Context.Parent.Tell(new Failure(cause, Self));
}
protected override void OnReceive(object msg)
{
var symboldata = msg as DownloadSymbolData;
if (symboldata != null)
{
var feedTask = _feedFactory.CreateFeedAsync(StockUriHelper.<API key>(symboldata.Symbol));
feedTask.Wait();
Sender.Tell(new <API key>() {Feed = feedTask.Result, Symbol = symboldata.Symbol});
}
else
Unhandled(msg);
}
}
public class StockQuoteActor : UntypedActor
{
private readonly HttpClient _client;
public StockQuoteActor(HttpClient client)
{
_client = client;
}
protected override void PreRestart(Exception cause, object message)
{
Context.Parent.Tell(new Failure(cause, Self));
}
protected override void OnReceive(object msg)
{
var symboldata = msg as DownloadSymbolData;
if (symboldata != null)
{
var quoteStrTask = _client.GetStringAsync(StockUriHelper.CreateStockQuoteUri(symboldata.Symbol));
quoteStrTask.Wait();
var quoteStr = quoteStrTask.Result;
var quoteData = JsonConvert.DeserializeObject<RootObject>(quoteStr);
if (quoteData == null || quoteData.query == null || quoteData.query.results == null)
{
//request failed for whatever reason,
}
else
{
Sender.Tell(
new <API key>()
{
Quote = quoteData.query.results.quote,
Symbol = symboldata.Symbol
});
}
}
else
Unhandled(msg);
}
}
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.