answer
stringlengths 15
1.25M
|
|---|
#ifndef OPENTOOL_H_
#define OPENTOOL_H_
#include "Server.h"
#include "Header.h"
#include "KeepAliveTimer.h"
#include <memory>
#include <functional>
#include <string>
#include <chrono>
using std::string;
using std::function;
using std::unique_ptr;
class OpenTool {
public:
OpenTool();
OpenTool(int spindleNumber, string _ip, int _port, int _timeout, int _retries, MID_Revision _rev);
virtual ~OpenTool();
Error Connect();
Error Listen();
Error Send(string data);
Error Disconnect();
Error MIDInputAction(Header* message);
Error MIDOutputAction(Header* message);
bool isTimedOut();
bool RetriesReached();
void SetStationID(int station_id = 0);
void SetAckStatus(bool ack = true);
Connection_Type type;
string ip_address;
int port;
MID_Revision version;
double timeout;
int retries;
Header openToolHeader;
function<Error(Header* message)>MID0001Received;
function<Error(Header* message)>MID0002Received;
function<Error(Header* message)>MID0003Received;
function<Error(Header* message)>MID0004Received;
function<Error(Header* message)>MID0005Received;
function<Error(Header* message)>MID9999Received;
private:
void SendKeepAlive();
Client client;
Server server;
long connection_time;
std::chrono::time_point<std::chrono::system_clock> lastSentTime;
int timer_count;
KeepAliveTimer keep_alive_timer;
};
#endif /* OPENTOOL_H_ */
|
import { Component } from "@angular/core";
@Component({
selector: "app-root",
template: `
<div>
<app-header-bar></app-header-bar>
<div class="section columns">
<main class="column">
<app-heroes></app-heroes>
</main>
</div>
</div>
`
})
export class AppComponent {
title = "interceptors";
}
|
config = {
"interfaces": {
"google.cloud.talent.v4beta1.TenantService": {
"retry_codes": {
"idempotent": ["DEADLINE_EXCEEDED", "UNAVAILABLE"],
"non_idempotent": [],
},
"retry_params": {
"default": {
"<API key>": 100,
"<API key>": 1.3,
"<API key>": 60000,
"<API key>": 20000,
"<API key>": 1.0,
"<API key>": 20000,
"<API key>": 600000,
}
},
"methods": {
"CreateTenant": {
"timeout_millis": 60000,
"retry_codes_name": "non_idempotent",
"retry_params_name": "default",
},
"GetTenant": {
"timeout_millis": 60000,
"retry_codes_name": "idempotent",
"retry_params_name": "default",
},
"UpdateTenant": {
"timeout_millis": 60000,
"retry_codes_name": "non_idempotent",
"retry_params_name": "default",
},
"DeleteTenant": {
"timeout_millis": 60000,
"retry_codes_name": "idempotent",
"retry_params_name": "default",
},
"ListTenants": {
"timeout_millis": 60000,
"retry_codes_name": "idempotent",
"retry_params_name": "default",
},
},
}
}
}
|
ScaleAnimation(float fromX, float toX, float fromY, float toY, int pivotXType, floatXValue,int pivotYType, float pivotYValue)
fromXtoXxfromY,toYye
pivotXValuepivotYValuex,ypivotXTypepivotYTypex,y
1
Animation scale = new ScaleAnimation(0f, 1f, 0f, 1f, Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF, 0.5f);
scale.setDuration(5000);
img.startAnimation(scale);
2XMLscale_anim.xmlres/anim
<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android" >
<scale
android:duration="5000"
android:fillAfter="false
android:fromXScale="0.0"
android:fromYScale="0.0"
android:interpolator="@android:anim/<API key>"
android:pivotX="50%"
android:pivotY="50%"
android:toXScale="1.0"
android:toYScale="1.0" />
</set>
Animation scale = AnimationUtils.loadAnimation(TweenActivity.this, R.anim.scale_anim);
img.startAnimation(scale);

3:TranslateAnimation(float fromXDelta, float toXDelta, float YDelta, float toYDelta)
fromXDelta,fromYDeltatoXDelta,toYDelta
1
Animation translate = new TranslateAnimation(10, 100, 10, 100);
translate.setDuration(3000);
img.startAnimation(translate);
2XML
<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android" >
<translate
android:duration="5000"
android:fromXDelta="10"
android:fromYDelta="10"
android:toXDelta="100"
android:toYDelta="100" />
</set>
|
package at.forsyte.apalache.tla.typecheck.passes
import at.forsyte.apalache.infra.ExceptionAdapter
import at.forsyte.apalache.infra.passes.{Pass, PassOptions, <API key>, <API key>}
import at.forsyte.apalache.tla.imp.passes.{SanyParserPass, SanyParserPassImpl}
import com.google.inject.AbstractModule
import com.google.inject.name.Names
class TypeCheckerModule extends AbstractModule {
override def configure(): Unit = {
// the options singleton
bind(classOf[PassOptions])
.to(classOf[<API key>])
// exception handler
bind(classOf[ExceptionAdapter])
.to(classOf[<API key>])
// SanyParserPassImpl is the default implementation of SanyParserPass
bind(classOf[SanyParserPass])
.to(classOf[SanyParserPassImpl])
// and it also the initial pass for PassChainExecutor
bind(classOf[Pass])
.annotatedWith(Names.named("InitialPass"))
.to(classOf[SanyParserPass])
// <API key>
bind(classOf[EtcTypeCheckerPass])
.to(classOf[<API key>])
// the type checker is the next one after the parser
bind(classOf[Pass])
.annotatedWith(Names.named("AfterParser"))
.to(classOf[EtcTypeCheckerPass])
// the next pass after EtcTypeCheckerPass is the terminal pass
bind(classOf[Pass])
.annotatedWith(Names.named("AfterTypeChecker"))
.to(classOf[<API key>])
}
}
|
# LOG MESSAGES
## GENERAL ##
DB_ERROR = 'Database error. Check database log file.'
STORE_NOT_FOUND = 'Could not find store in cees database.'
TOKEN_NOT_FOUND = 'Could not find token in database.'
SCHEMA_NOT_FOUND = 'Could not validate request. Schema file not found.'
VALIDATION_ERROR = 'Data not valid.'
## LOGIN ##
LOGGED_IN = 'Shop assistant logged in as '
<API key> = 'Could not find the email/password provided.'
## ARRIVALS ##
RFID_NOT_FOUND = 'Invalid identifier. RFID not found in cees database.'
CLIENT_NOT_ALLOWED = 'Client does not belong to this customer.'
<API key> = 'Sending push notification.'
CLIENT_NOT_FOUND = 'Client not found as an arrival.'
## TOKEN ##
MISSING_TOKEN = 'There is no Authentication header in request.'
## GCM AND DEVICE REGISTRATION##
UNKNOWN_DEVICE = 'Device not found in databse.'
<API key> = 'Registration not found in database.'
|
title: ""
lang: cn
ref: huawei-cloud
permalink: /cn/users/local-develop-test/
excerpt: ""
last_modified_at: 2017-08-15T15:01:43-04:00
redirect_from:
- /theme-setup/
{% include toc %}
/[](/cn/users/service-definition/)[](/cn/users/<API key>/)
* [](
* [local fileMock](#mock)
/

* **1** [Service Center](/cn/users/setup-environment/#service-center)
* ** 2** /microservice.yamlServerCenter
yaml
cse:
service:
registry:
address: http://127.0.0.1:30100
* ** 3** /
## Mock
* ** 1**registry.yaml
yaml
springmvctest:
- id: "001"
version: "1.0"
appid: myapp
instances:
endpoints:
rest://127.0.0.1:8080
mock\(consumer\)\(provider\)
* ** 2**Main
java
public class xxxClient {
public static void main(String[] args) {
System.setProperty("local.registry.file", "/path/registry.yaml");
//your code
System.clearProperty("local.registry.file");
}
setPropertyregistry.yaml
* ** 3**
|
package com.mit.dstore.entity;
import java.util.List;
public class LoginJson extends JSON {
/**
*
* @Fields serialVersionUID : TODO
*/
private static final long serialVersionUID = -<API key>;
private List<User> Object = null;
public List<User> getObject() {
return Object;
}
public void setObject(List<User> object) {
Object = object;
}
}
|
package eu.thedarken.trust.dialogs;
import android.app.AlertDialog;
import android.app.Dialog;
import android.os.Build;
import android.os.Bundle;
import android.support.v4.app.DialogFragment;
import android.support.v4.app.FragmentManager;
import android.text.Html;
import android.text.method.LinkMovementMethod;
import android.view.ContextThemeWrapper;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.LinearLayout;
import android.widget.TextView;
import eu.thedarken.trust.R;
import eu.thedarken.trust.logentries.Descriptions;
import eu.thedarken.trust.logentries.LogEntry;
import java.text.SimpleDateFormat;
public class <API key> extends DialogFragment {
private final SimpleDateFormat sdf = new SimpleDateFormat("dd MMM yyyy, HH:mm");
private LogEntry entry;
public static <API key> newInstance(LogEntry entry) {
<API key> f = new <API key>();
Bundle b = new Bundle();
b.putParcelable("entry", entry);
f.setArguments(b);
return f;
}
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setStyle(DialogFragment.STYLE_NO_FRAME, android.R.style.Theme_Dialog);
entry = getArguments().getParcelable("entry");
}
public void showDialog(FragmentManager fragman) {
this.show(fragman, "<API key>");
}
@Override
public Dialog onCreateDialog(Bundle savedInstanceState) {
ContextThemeWrapper context;
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.HONEYCOMB) {
context = new ContextThemeWrapper(getActivity(), android.R.style.Theme_Dialog);
} else {
context = new ContextThemeWrapper(getActivity(), R.style.TrustTheme);
}
AlertDialog.Builder bd = new AlertDialog.Builder(context);
View layout = LayoutInflater.from(context).inflate(R.layout.<API key>, null);
String formateddate = sdf.format(entry.getTime());
TextView date = (TextView) layout.findViewById(R.id.tv_date);
date.setText(formateddate);
TextView entry_id = (TextView) layout.findViewById(R.id.tv_id);
entry_id.append(" " + entry.getID());
TextView desc = (TextView) layout.findViewById(R.id.tv_infocontent);
desc.setText(Descriptions.<API key>(getActivity(), entry));
TextView gplayLink = (TextView) layout.findViewById(R.id.tv_gplay);
LinearLayout idline = (LinearLayout) layout.findViewById(R.id.ll_idline);
LinearLayout dateline = (LinearLayout) layout.findViewById(R.id.ll_dateline);
if (entry.getType() >= LogEntry.PACKAGE_ADDED && entry.getType() <= LogEntry.PACKAGE_RESTARTED || entry.getType() == LogEntry.APP_ACTIVITY) {
gplayLink.setVisibility(View.VISIBLE);
gplayLink.setMovementMethod(LinkMovementMethod.getInstance());
String link = "<a href=\"https://play.google.com/store/apps/details?id=" + entry.getExtra().replace("package:", "").replace("'", "") + "\">"
+ getString(R.string.show_app_in_gplay) + "</a>";
gplayLink.setText(Html.fromHtml(link));
} else if (entry.getType() == -2) {
idline.setVisibility(View.GONE);
dateline.setVisibility(View.GONE);
entry_id.setVisibility(View.INVISIBLE);
gplayLink.setVisibility(View.VISIBLE);
gplayLink.setMovementMethod(LinkMovementMethod.getInstance());
String trustprolink = "<a href=\"https://play.google.com/store/apps/details?id=eu.thedarken.trust.pro" + "\">"
+ getString(R.string.buy_pro) + "</a>";
gplayLink.setText(Html.fromHtml(trustprolink));
} else {
idline.setVisibility(View.VISIBLE);
dateline.setVisibility(View.VISIBLE);
}
bd.setView(layout);
return bd.create();
}
}
|
#include "M2351.h"
#include <errno.h>
#include "nu_miscutil.h"
extern uint32_t __mbed_sbrk_start;
extern uint32_t __mbed_krbs_start;
#define NU_HEAP_ALIGN 4
/* Support heap with two-region model
*
* The default implementation of _sbrk() (in mbed_retarget.cpp) for GCC_ARM requires one-region
* model (heap and stack share one region), which doesn't fit two-region model (heap and stack
* are two distinct regions), e.g., stack in internal SRAM/heap in external SRAM on NUMAKER_PFM_NUC472.
* Hence, override _sbrk() here to support heap with two-region model.
*/
void *_sbrk(int incr)
{
static uint32_t heap_ind = (uint32_t) &__mbed_sbrk_start;
uint32_t heap_ind_old = NU_ALIGN_UP(heap_ind, NU_HEAP_ALIGN);
uint32_t heap_ind_new = NU_ALIGN_UP(heap_ind_old + incr, NU_HEAP_ALIGN);
if (heap_ind_new > (uint32_t) &__mbed_krbs_start) {
errno = ENOMEM;
return (void *) -1;
}
heap_ind = heap_ind_new;
return (void *) heap_ind_old;
}
|
/* global InstanceDetails,Utils */
var UI = (function () {
"use strict";
var NONUSABLEWIDTH = 204;
var <API key> = 100;
// Colors
var RED = 'rgb(217, 83, 79)';
var GREEN = 'green';
var AMBAR = 'rgb(239, 163, 0)';
var GRAY = 'gray';
var statuses = {
// GREEN
'ACTIVE': {
'class': 'glyphicon glyphicon-ok fa-inverse',
'color': GREEN
},
'BUILDING': {
'class': 'fa fa-spinner fa-pulse fa-inverse',
'color': GREEN
},
'PASSWORD': {
'class': 'fa fa-terminal fa-inverse',
'color': GREEN
},
// AMBAR
'HARD_REBOOT': {
'class': 'fa fa-repeat fa-spin fa-inverse',
'color': AMBAR
},
'PAUSED': {
'class': 'fa fa-pause fa-inverse',
'color': AMBAR
},
'REBOOT': {
'class': 'fa fa-repeat fa-spin fa-inverse',
'color': AMBAR
},
'BUILD': {
'class': 'fa fa-repeat fa-spin fa-inverse',
'color': AMBAR
},
'RESCUED': {
'class': 'fa fa-life-ring fa-inverse',
'color': AMBAR
},
'RESIZED': {
'class': 'fa fa-arrows-alt fa-inverse',
'color': AMBAR
},
'VERIFY_RESIZE': {
'class': 'fa fa-arrows-alt fa-inverse',
'color': AMBAR
},
'SHUTOFF': {
'class': 'fa fa-stop fa-inverse',
'color': AMBAR
},
'SOFT_DELETED': {
'class': 'fa fa-trash fa-inverse',
'color': AMBAR
},
'STOPPED': {
'class': 'fa fa-stop fa-inverse',
'color': AMBAR
},
'SUSPENDED': {
'class': 'fa fa-pause fa-inverse',
'color': AMBAR
},
// GRAY
'UNKNOWN': {
'class': 'fa fa-question fa-inverse',
'color': GRAY
},
// RED
'DELETED': {
'class': 'fa fa-trash fa-inverse',
'color': RED
},
'ERROR': {
'class': 'fa fa-times fa-inverse',
'color': RED
},
'DELETING': {
'class': 'fa fa-trash fa-inverse',
'color': RED,
'animation': 'working-animation'
},
'REVERT_RESIZE': {
'class': 'fa fa-arrows-alt fa-inverse',
'color': RED
}
};
var flavors = {
'1': '1 VCPU | 512 MiB RAM | 0 GiB Disk',
'2': '1 VCPU | 2048 MiB RAM | 10 GiB Disk',
'3': '2 VCPU | 2 MiB RAM | 20 GiB Disk'
};
function setNameMaxWidth (nonUsableWidth) {
var bodyWidth = $('body').attr('width');
if (bodyWidth >= 360) {
$('#instance-name').css('max-width', bodyWidth - nonUsableWidth);
}
else {
$('#instance-name').css('max-width', 360 - nonUsableWidth);
}
}
function setProgressBarWidth (<API key>) {
var bodyWidth = $('body').attr('width') >= 360 ? $('body').attr('width') : 360;
var progressBarWidth = bodyWidth/2 - <API key>;
$('#progress-bar').css('width', progressBarWidth);
// Inner text
$('#progress-bar span').css('left', <API key> + progressBarWidth/2);
if (bodyWidth <= 360) {
$('#progress-bar span').css('max-width', 76);
}
else {
$('#progress-bar span').css('max-width', "None");
}
}
function showView(viewId) {
// Hide all views
$('#error-view').addClass('hide');
$('#default-view').addClass('hide');
$('#detail-view').addClass('hide');
$('body').removeClass('stripes angled-135');
if (viewId === 'default-view' || viewId === 'error-view') {
$('body').addClass('stripes angled-135');
}
// Show view
$('#' + viewId).removeClass('hide');
}
function fixTooltips (instanceData) {
var power_state = Utils.<API key>(instanceData['OS-EXT-STS:power_state']);
var statusTooltip = 'Status: ' + instanceData.status + ', ' +
'Power State: ' + power_state + ', ' +
'VM State: ' + instanceData["OS-EXT-STS:vm_state"];
$('#instance-status')
.attr('title', statusTooltip)
.attr('data-original-title', $('#instance-status').attr('title'))
.attr('title', '');
$('#instance-name')
.attr('title', instanceData.name)
.attr('data-original-title', $('#instance-name').attr('title'))
.attr('title', '');
$('#progress-bar span')
.attr('title', instanceData["OS-EXT-STS:task_state"])
.attr('data-original-title', instanceData["OS-EXT-STS:task_state"])
.attr('title', '');
}
function buildDetails (instanceData) {
var addresses = instanceData.addresses ? Utils.<API key>(instanceData.addresses) : '';
var power_state = Utils.<API key>(instanceData['OS-EXT-STS:power_state']);
var displayableTask = (instanceData["OS-EXT-STS:task_state"] && instanceData["OS-EXT-STS:task_state"] !== "") ? instanceData["OS-EXT-STS:task_state"] : "None";
var displayableCreated = Utils.formatDate(instanceData.created);
var displayableUpdated = Utils.formatDate(instanceData.updated);
// Fields
$('#instance-name').text(instanceData.name);
$('#instance-owner > span').text(instanceData.user_id);
$('#instance-id > span').text(instanceData.id);
$('#instance-image > span').text(instanceData.image.id);
$('#instance-key-pair > span').text(instanceData.key_name);
$('#instance-addresses > span').text(addresses);
$('#instance-flavor > span').text(flavors[instanceData.flavor.id.toString()]);
$('#instance-created > span').text(displayableCreated);
$('#instance-updated > span').text(displayableUpdated);
// Remove previous status
$('#instance-status').removeClass('working-animation');
$('#instance-status > div > i').removeClass();
// Deleting task
if (displayableTask === 'deleting') {
$('#instance-status > div > i').addClass(statuses.DELETING.class);
$('#instance-status').css('background-color', statuses.DELETING.color);
$('#instance-status').addClass(statuses.DELETING.animation);
}
else {
$('#instance-status > div > i').addClass(statuses[instanceData.status].class);
$('#instance-status').css('background-color', statuses[instanceData.status].color);
}
// Every other task
if (displayableTask !== 'None') {
$('#instance-task > span').empty();
$('#progress-bar span').text(displayableTask);
$('#progress-bar').removeClass('hide');
$('#progress').css('background', statuses[instanceData.status].color);
}
else {
$('#instance-task > span').text(displayableTask);
$('#progress-bar').addClass('hide');
}
}
function init (callbacks) {
// Register resize callback
MashupPlatform.widget.context.registerCallback(function (newValues) {
if ("heightInPixels" in newValues || "widthInPixels" in newValues) {
// Set body size
$('body').attr('height', newValues.heightInPixels);
$('body').attr('width', newValues.widthInPixels);
// Set progress bar width
setProgressBarWidth(<API key>);
// Set name max-width
setNameMaxWidth(NONUSABLEWIDTH);
}
});
// Init click events
$('#refresh-button').click(function () {
callbacks.refresh();
});
$('#instance-reboot').click(function () {
callbacks.reboot();
});
$('#instance-terminate').click(function () {
callbacks.delete();
});
$('#instance-image > span').click(function () {
var id = $(this).text();
var data = {
id: id,
access: JSTACK.Keystone.params.access
};
MashupPlatform.wiring.pushEvent('image_id', JSON.stringify(data));
});
$('body').attr('width', window.innerWidth);
UI.buildDefaultView();
}
function buildDetailView (instanceData) {
buildDetails(instanceData);
setNameMaxWidth(NONUSABLEWIDTH);
setProgressBarWidth(<API key>);
fixTooltips(instanceData);
// Initialize tooltips
$('[data-toggle="tooltip"]').tooltip();
showView('detail-view');
}
function buildDefaultView () {
showView('default-view');
}
function buildErrorView (errorResponse) {
// Build
if (errorResponse.message) {
$('#error-view').text(errorResponse.message);
}
else {
$('#error-view').text(errorResponse);
}
showView('error-view');
}
return {
buildDetailView: buildDetailView,
buildDefaultView: buildDefaultView,
buildErrorView: buildErrorView,
init: init
};
})();
|
import zstackwoodpecker.test_util as test_util
import zstackwoodpecker.test_lib as test_lib
import zstackwoodpecker.test_state as test_state
import zstackwoodpecker.operations.hybrid_operations as hyb_ops
import zstackwoodpecker.operations.resource_operations as res_ops
import time
import os
postfix = time.strftime('%m%d-%H%M%S', time.localtime())
test_obj_dict = test_state.TestStateDict()
remote_bucket_name = 'test-bucket-%s' % postfix
test_stub = test_lib.lib_get_test_stub()
hybrid = test_stub.HybridObject()
def test():
hybrid.add_datacenter_iz(add_datacenter_only=True)
hybrid.add_bucket()
hybrid.detach_bucket()
hybrid.attach_bucket()
test_util.test_pass('Create Attach Detach OSS Bucket Test Success')
def env_recover():
if hybrid.oss_bucket_create:
hybrid.del_bucket()
#Will be called only if exception happens in test().
def error_cleanup():
global test_obj_dict
test_lib.lib_error_cleanup(test_obj_dict)
|
FROM ubuntu:xenial
# Minimal Docker container for running Habitat's BATS integration
# tests.
# jq and curl are used by our custom BATS helper functions; busybox
# and the various lib* are needed by the hab binaries themselves; the
# intended usecase is to exercise the individual binaries built by
# cargo, and not Habitat-packaged binaries (which of course include
# all dependencies).
# BATS, of course, is needed to run BATS :P
RUN useradd hab
RUN apt-get update && \
apt-get -y install jq curl git && \
apt-get -y install libarchive-dev libsodium-dev libczmq-dev busybox && \
git clone https://github.com/sstephenson/bats /bats && \
cd /bats && \
git checkout v0.4.0 && \
./install.sh /usr/local
|
/*
$Id: $
@file <API key>.java
@brief Contains the <API key>.java class
@author Rahul Singh [rsingh]
*/
package com.distelli.europa.handlers;
import java.io.IOException;
import java.io.OutputStream;
import javax.inject.Inject;
import javax.inject.Singleton;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.eclipse.jetty.server.Request;
import org.eclipse.jetty.server.handler.ErrorHandler;
import com.distelli.europa.react.JSXProperties;
import com.distelli.europa.react.PageTemplate;
import com.distelli.webserver.*;
import lombok.extern.log4j.Log4j;
@Log4j
@Singleton
public class <API key> extends ErrorHandler
{
@Inject
private PageTemplate _pageTemplate;
public <API key>()
{
}
public void handle(String target,
Request baseRequest,
HttpServletRequest request,
HttpServletResponse response)
throws IOException
{
WebResponse webResponse = _pageTemplate.renderPage(null);
response.setContentType("text/html");
OutputStream out = response.getOutputStream();
webResponse.writeResponse(out);
}
}
|
/** @define Toast */
.Toast {
@apply(--paper-font-body1);
@nest &-button {
@apply(--paper-font-button);
color: var(--accent-color);
padding-left: 24px;
@media(--md-viewport) {
padding-left: 48px;
}
}
}
|
/**
* @file qstone.h
* @author Frantisek Kolacek <xkolac12@stud.fit.vutbr.cz>
* @version 0.91a
* @brief Header file for QStone
*/
#ifndef QSTONE_H
#define QSTONE_H
#include <QPushButton>
#include <QPixmap>
#include <QIcon>
#include "../cli/game.h"
/**
* @brief Maps for drawing stones in GUI
*/
extern QString FileMaps[STONE_TYPE_END][STONE_ANGLE_END];
/**
* @brief Class represents Stone
*/
class QStone : public QPushButton{
Q_OBJECT
public:
QStone(int, int, stoneType = STONE_NONE, stoneAngle = STONE_UP, stoneItem = STONE_ITEM_NONE, QWidget *parent = 0);
void refresh(stoneType, stoneAngle, stoneItem);
public slots:
void handleClicked(bool);
signals:
void opMove(int, int);
private:
int x;
int y;
};
#endif // QSTONE_H
|
package net.worldline.training.angular.services;
import net.worldline.training.angular.entity.User;
import org.hibernate.Session;
import org.hibernate.criterion.Restrictions;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
public class UserDAOImpl implements UserDAO
{
private final Session session;
public UserDAOImpl(Session session)
{
this.session = session;
}
public User getUserByLogin(String login){
return (User)session.createCriteria(User.class).add(Restrictions.eq("login", login)).uniqueResult();
}
public void add(User user)
{
user.setUri("/user-management/users/"+user.getLogin());
user.setLastModified(new Date());
List<String> roles = new ArrayList<String>();
roles.add("USER");
user.setRoles(roles);
session.save(user);
}
}
|
#include "kstate.h"
#include "vrf_stats_kstate.h"
#include <iomanip>
#include <sstream>
#include "vr_defs.h"
using namespace std;
VrfStatsKState::VrfStatsKState(KVrfStatsResp *obj, const std::string &resp_ctx,
vr_vrf_stats_req &req, int id) :
KState(resp_ctx, obj) {
if (id >= 0) {
req.set_h_op(sandesh_op::GET);
req.set_vsr_vrf(id);
req.set_vsr_family(AF_INET);
} else {
InitDumpRequest(req);
req.set_vsr_marker(-1);
}
}
void VrfStatsKState::InitDumpRequest(vr_vrf_stats_req &req) const {
req.set_h_op(sandesh_op::DUMP);
req.set_vsr_rid(0);
req.set_vsr_family(AF_INET);
}
void VrfStatsKState::Handler() {
KVrfStatsResp *resp = static_cast<KVrfStatsResp *>(response_object_);
if (resp) {
if (MoreData()) {
/* There are more interfaces in Kernel. We need to query them from
* Kernel and send it to Sandesh.
*/
SendResponse();
SendNextRequest();
} else {
resp->set_context(response_context_);
resp->Response();
more_context_ = NULL;
}
}
}
void VrfStatsKState::SendNextRequest() {
vr_vrf_stats_req req;
InitDumpRequest(req);
int idx = reinterpret_cast<long>(more_context_);
req.set_vsr_marker(idx);
EncodeAndSend(req);
}
void VrfStatsKState::SendResponse() {
KVrfStatsResp *resp = static_cast<KVrfStatsResp *>(response_object_);
resp->set_context(response_context_);
resp->set_more(true);
resp->Response();
response_object_ = new KVrfStatsResp();
}
const string VrfStatsKState::FamilyToString(int vrf_family) const {
unsigned family = vrf_family;
switch(family) {
case AF_INET:
return "AF_INET";
default:
return "INVALID";
}
}
|
package com.ftfl.icare.util;
import android.app.Fragment;
import android.app.FragmentManager;
import android.content.Context;
import android.content.SharedPreferences;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.ViewGroup;
import android.widget.Button;
import android.widget.EditText;
import android.widget.Toast;
import com.ftfl.icare.R;
import com.ftfl.icare.helper.<API key>;
import com.ftfl.icare.helper.<API key>;
import com.ftfl.icare.model.DoctorProfile;
public class FragmentAddDoctor extends Fragment {
<API key> <API key>;
DoctorProfile mDoctorProfile;
View view;
EditText etDrName;
EditText etSpecialization;
EditText etPhone;
EditText etEmail;
EditText etLocation;
Button btnSave;
FragmentManager frgManager;
Fragment fragment;
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
view = inflater.inflate(R.layout.<API key>, container,
false);
etDrName = (EditText) view.findViewById(R.id.etDrName);
etSpecialization = (EditText) view.findViewById(R.id.etSpecialization);
etPhone = (EditText) view.findViewById(R.id.etPhone);
etEmail = (EditText) view.findViewById(R.id.etEmail);
etLocation = (EditText) view.findViewById(R.id.etLocation);
btnSave = (Button) view.findViewById(R.id.btnSave);
btnSave.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
createDoctorProfile();
}
});
return view;
}
private void createDoctorProfile() {
String mName = etDrName.getText().toString();
String mSpecialization = etSpecialization.getText().toString();
String mPhone = etPhone.getText().toString();
String mEmail = etEmail.getText().toString();
String mAddress = etLocation.getText().toString();
SharedPreferences prfs = getActivity().<API key>("<API key>, Context.MODE_PRIVATE);
String mProfileId = prfs.getString("profile_id", "");
<API key> = new <API key>(getActivity());
mDoctorProfile = new DoctorProfile();
mDoctorProfile.setName(mName);
mDoctorProfile.setSpecialization(mSpecialization);
mDoctorProfile.setPhone(mPhone);
mDoctorProfile.setEmail(mEmail);
mDoctorProfile.setAddress(mAddress);
mDoctorProfile.setProfileId(mProfileId);
if (<API key>.insert(mDoctorProfile) == true) {
Toast toast = Toast.makeText(getActivity(), "Successfully Saved.",
Toast.LENGTH_LONG);
toast.show();
fragment = new FragmentHome();
frgManager = getFragmentManager();
frgManager.beginTransaction().replace(R.id.content_frame, fragment)
.commit();
setTitle("Home");
} else {
Toast toast = Toast.makeText(getActivity(),
"Error, Couldn't inserted data to database",
Toast.LENGTH_LONG);
toast.show();
}
}
public void setTitle(CharSequence title) {
getActivity().getActionBar().setTitle(title);
}
}
|
'use strict';
angular.module("ngLocale", [], ["$provide", function($provide) {
var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"};
$provide.value("$locale", {
"DATETIME_FORMATS": {
"AMPMS": [
"a. m.",
"p. m."
],
"DAY": [
"domingo",
"lunes",
"martes",
"mi\u00e9rcoles",
"jueves",
"viernes",
"s\u00e1bado"
],
"ERANAMES": [
"antes de Cristo",
"despu\u00e9s de Cristo"
],
"ERAS": [
"a. C.",
"d. C."
],
"FIRSTDAYOFWEEK": 6,
"MONTH": [
"enero",
"febrero",
"marzo",
"abril",
"mayo",
"junio",
"julio",
"agosto",
"septiembre",
"octubre",
"noviembre",
"diciembre"
],
"SHORTDAY": [
"dom.",
"lun.",
"mar.",
"mi\u00e9.",
"jue.",
"vie.",
"s\u00e1b."
],
"SHORTMONTH": [
"ene.",
"feb.",
"mar.",
"abr.",
"may.",
"jun.",
"jul.",
"ago.",
"sept.",
"oct.",
"nov.",
"dic."
],
"STANDALONEMONTH": [
"enero",
"febrero",
"marzo",
"abril",
"mayo",
"junio",
"julio",
"agosto",
"septiembre",
"octubre",
"noviembre",
"diciembre"
],
"WEEKENDRANGE": [
5,
6
],
"fullDate": "EEEE, d 'de' MMMM 'de' y",
"longDate": "d 'de' MMMM 'de' y",
"medium": "d MMM y h:mm:ss a",
"mediumDate": "d MMM y",
"mediumTime": "h:mm:ss a",
"short": "d/M/yy h:mm a",
"shortDate": "d/M/yy",
"shortTime": "h:mm a"
},
"NUMBER_FORMATS": {
"CURRENCY_SYM": "Bs",
"DECIMAL_SEP": ",",
"GROUP_SEP": ".",
"PATTERNS": [
{
"gSize": 3,
"lgSize": 3,
"maxFrac": 3,
"minFrac": 0,
"minInt": 1,
"negPre": "-",
"negSuf": "",
"posPre": "",
"posSuf": ""
},
{
"gSize": 3,
"lgSize": 3,
"maxFrac": 2,
"minFrac": 2,
"minInt": 1,
"negPre": "\u00a4-",
"negSuf": "",
"posPre": "\u00a4",
"posSuf": ""
}
]
},
"id": "es-ve",
"localeID": "es_VE",
"pluralCat": function(n, opt_precision) { if (n == 1) { return PLURAL_CATEGORY.ONE; } return PLURAL_CATEGORY.OTHER;}
});
}]);
|
import json
import httplib
import requests
from st2actions.runners.pythonrunner import Action
__all__ = [
'PostMessageAction'
]
class PostMessageAction(Action):
def run(self, message, username=None, icon_emoji=None, channel=None):
config = self.config['post_message_action']
username = username if username else config['username']
icon_emoji = icon_emoji if icon_emoji else config.get('icon_emoji', None)
channel = channel if channel else config.get('channel', None)
headers = {}
headers['Content-Type'] = 'application/<API key>'
body = {
'username': username,
'icon_emoji': icon_emoji,
'text': message
}
if channel:
body['channel'] = channel
data = 'payload=%s' % (json.dumps(body))
response = requests.post(url=config['webhook_url'],
headers=headers, data=data)
if response.status_code == httplib.OK:
self.logger.info('Message successfully posted')
else:
self.logger.exception('Failed to post message: %s' % (response.text))
return True
|
import {createSelector} from 'reselect';
import {allTrue} from '../util/arrays';
const <API key> = state => state.isMetadataAvailable;
const <API key> = state => state.isChangesAvailable;
const <API key> = state => state.isSummaryAvailable;
const <API key> = state => state.<API key>;
const getIsTATAvailable = state => state.isTATAvailable;
const <API key> = state => state.<API key>;
const getPaginationPage = state => state.paginationPage;
export const getIsChangesReady = createSelector(
<API key>,
<API key>,
allTrue,
);
export const getIsTATReady = createSelector(
<API key>,
getIsTATAvailable,
allTrue,
);
export const getIsSummaryReady = createSelector(
<API key>,
<API key>,
allTrue,
);
export const <API key> = createSelector(
<API key>,
<API key>,
allTrue,
);
export const <API key> = createSelector(
<API key>,
<API key>,
allTrue,
);
export const getCurrentPage = createSelector(
getPaginationPage,
page => page.get('current', null));
|
package org.code.pomelo.rabbitmq.tutorial.pub.sub;
import com.rabbitmq.client.Channel;
import com.rabbitmq.client.Connection;
import org.code.pomelo.rabbitmq.tutorial.DefaultConnection;
import java.io.IOException;
import java.util.concurrent.TimeoutException;
public class ReceiveLogs {
public static void main(String[] args) throws IOException, TimeoutException {
Connection connection = DefaultConnection.<API key>();
Channel channel = connection.createChannel();
}
}
|
class CreateContracts < ActiveRecord::Migration[5.0]
def change
create_table :contracts do |t|
t.string :contract_no, null: false
t.integer :transport_id
t.text :description
t.timestamps
end
end
end
|
<!DOCTYPE HTML PUBLIC "-
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<meta http-equiv="Content-Language" content="en">
<title>StringParser_BBCode class documentation</title>
<meta name="author" content="Christian Seiler">
<link rel="stylesheet" href="../css/print.css" type="text/css" media="print">
<link rel="stylesheet" href="../css/screen.css" type="text/css" media="screen, projection">
</head>
<body id="doku">
<div id="container">
<h1><span><code>StringParser_<abbr title="Bulletin Board Code">BBCode</abbr></code> class</span> documentation</h1>
<ul id="mainmenu">
<li><a href="http:
<li><a href="chapter1.html">Documentation</a></li>
<li><a href="../phpdoc/index.html">PHPDOC Documentation</a></li>
<li><a href="http:
<li><a href="../de/kapitel8.html">Diese Seite auf Deutsch</a></li>
</ul>
<ul id="menu">
<li><a href="chapter1.html">1. Introduction</a>
<ul>
<li><a href="chapter1.html#general">1.1 General</a></li>
<li><a href="chapter1.html#nesting">1.2 Nesting</a></li>
<li><a href="chapter1.html#special">1.3 Special codes</a></li>
</ul></li>
<li><a href="chapter2.html">2. Defining own <abbr>BBCode</abbr></a>
<ul>
<li><a href="chapter2.html#including">2.1 Including the class</a></li>
<li><a href="chapter2.html#first">2.2 The first code</a></li>
<li><a href="chapter2.html#processing_types">2.3 Processing types</a></li>
<li><a href="chapter2.html#parsing">2.4 Parsing text</a></li>
</ul></li>
<li><a href="chapter3.html">3. Parser functions</a>
<ul>
<li><a href="chapter3.html#task">3.1 Task of parser functions</a></li>
<li><a href="chapter3.html#content_types">3.2 Relevance of content types</a></li>
<li><a href="chapter3.html#registration">3.3 Registration of parser functions</a></li>
</ul></li>
<li><a href="chapter4.html">4. Callback functions</a>
<ul>
<li><a href="chapter4.html#processing_types">4.1 Processing types that need callback functions</a></li>
<li><a href="chapter4.html#prototype">4.2 Prototype of a callback function</a></li>
<li><a href="chapter4.html#example">4.3 Example for a callback function that replaces links</a></li>
<li><a href="chapter4.html#revalidation">4.4 Revalidation on close tag occurrence</a></li>
</ul></li>
<li><a href="chapter5.html">5. Filters</a>
<ul>
<li><a href="chapter5.html#types">5.1 Filter types</a></li>
<li><a href="chapter5.html#defining">5.2 Defining filters</a></li>
</ul></li>
<li><a href="chapter6.html">6. Flags to control the behaviour of the class</a>
<ul>
<li><a href="chapter6.html#general">6.1 General</a></li>
<li><a href="chapter6.html#flags">6.2 List of all flags</a></li>
<li><a href="chapter6.html#global">6.2 Global flags</a></li>
</ul></li>
<li><a href="chapter7.html">7. Limiting the amount of occurrences</a>
<ul>
<li><a href="chapter7.html#grouping">7.1 Grouping codes</a></li>
<li><a href="chapter7.html#limits">7.2 Setting limits</a></li>
</ul></li>
<li><a href="chapter8.html">8. Paragraph handling</a>
<ul>
<li><a href="chapter8.html#general">8.1 General</a></li>
<li><a href="chapter8.html#activating">8.2 Activating paragraph handling</a></li>
<li><a href="chapter8.html#further">8.3 Further possibilities</a></li>
</ul></li>
<li><a href="chapter9.html">9. Examples</a>
<ul>
<li><a href="chapter9.html#example">9.1 Simple example</a></li>
<!-- <li><a href="chapter9.html#complex">9.2 More complex example</a></li> -->
</ul></li>
<li><a href="chapter10.html">10. Miscellaneous</a>
<ul>
<li><a href="chapter10.html#faq">10.1 Frequently asked questions</a></li>
<li><a href="chapter10.html#internals">10.2 Useful internals</a></li>
</ul></li>
</ul>
<div id="content"><h2>8. Paragraph handling</h2>
<h3 id="general"><a name="general">8.1 General</a></h3>
<p>With the help of this class there is the possibility to automatically detect paragraphs and enclose them with the corresponding HTML tags. For example could the following text:</p>
<p class="bb"><code><span class="bbtn">This is the first paragraph of a long text!
This is the second paragraph of a long text!</span></code></p>
<p>automatically be converted to the following HTML code:</p>
<p class="html"><code><p>This is the first paragraph of a long text!</p>
<p>This is the second paragraph of a long text!</p></code></p>
<p>If no BBCodes are presend in the text this undertaking is trivial and could be implemented with a simple function. It becomes difficult if BBCodes are opened inside of a paragraph and closed in the next.</p>
<p>It is possible to influence the class how it detects paragraphs and outputs them. For this there is the method <code><API key></code>:</p>
<p class="php"><code>void <API key> (string $detect_string, string $start_tag, string $end_tag);</code></p>
<dl>
<dt><code>$detect_string</code></dt>
<dd>The string that is to be searched for.</dd>
<dt><code>$start_tag</code></dt>
<dd>The start tag that is to be used when the output is done.</dd>
<dt><code>$end_tag</code></dt>
<dd>The end tag that is to be used when the output is done.</dd>
</dl>
<p>The standard settings are:</p>
<p class="php"><code>$bbcode-><API key> ("\n\n", "<p>, "</p>");</code></p>
<p>If one is content with these standard settings it is not necessary to call this method.</p>
<h3 id="activating"><a name="activating">8.2 Activating paragraph handling</a></h3>
<p>Paragraph handling is <strong>disabled</strong> by default. Paragraphs that are written directly in the text (inside the so-called root element) and paragraphs that occur inside BBCodes may be replaced. To active paragraph handling for paragraphs that occur inside the root element it is necessary to call the method <code><API key></code>:</p>
<p class="php"><code>$bbcode-><API key> (true);</code></p>
<p>To replace paragraphs inside a BBCode it is necessary to set a flag for this code:</p>
<p class="php"><code>$bbcode->setCodeFlag ('*', 'paragraphs', true);</code></p>
<p>Here the paragraph handling would be activated inside the <code>[*]</code> element.</p>
<h3 id="further"><a name="further">8.3 Further possibilities</a></h3>
<p>Normally, if a BBCode start tag occurs inside a paragraph and the end tag in a next paragraph, the BBCode will be closed just before the end of the first paragrah and reopened in the next paragraph. Example:</p>
<p class="bb"><code><span class="bbtn">This is the first paragraph </span><span class="bben">[b]<span class="bbtn">of a long text!
This is the second paragraph</span>[/b]</span><span class="bbtn"> of a long text!</span></code></p>
<p>This would normally be replaced with:</p>
<p class="html"><code><p>This is the first paragraph <b>of a long text!<strong></b></strong></p>
<p><strong><b></strong>This is the second paragraph</b> of a long text!</p></code></p>
<p>There is also the possibility to prohibit the interruption of a BBCode by paragraph handling. In the case of hyperlinks this can be quite useful. In this case one must set the <code>'paragraph_type'</code> code flag to <code><API key></code>:</p>
<p class="php"><code>$bbcode->setCodeFlag ('url', 'paragraph_type', <API key>);</code></p>
<p>The following text:</p>
<p class="bb"><code><span class="bbtn">This is the first paragraph </span><span class="bben">[url=http:
This is the second paragraph</span>[/url]</span><span class="bbtn"> of a long text!</span></code></p>
<p>would be replaced with:</p>
<p class="html"><code><p>This is the first paragraph <a href="http:
<br>
This is the second paragraph</a> of a long text!</p></code></p>
<p>As one can see the element is not interrupted by paragraph handling and the two newline characters are simply replaced by the parser functions.</p>
<p>There are also codes where the HTML replacement may not occur inside a HTML paragraph because this would be invalid HTML. An example would be lists. To account for lists one must set the <code>'paragraph_type'</code> code flag to <code><API key></code> (Notice: The <code>BLOCK</code> has <em>nothing</em> in common with the <code>'block'</code> standard content type except for the name):</p>
<p class="php"><code>$bbcode->setCodeFlag ('list', 'paragraph_type', <API key>);</code></p>
<p>The following text:</p>
<p class="bb"><code><span class="bbtn">This is the first paragraph </span><span class="bben">[list]<span class="bbtn">
</span><span class="bben">[*]<span class="bbtn">List item
</span></span>[/list]</span></code></p>
<p>Would be replaced with this:</p>
<p class="html"><code><p>This is the first paragraph </p><ul>
<li>List item
</li></ul></code></p>
<p>Or, if inside of <code>[*]</code> paragraph handling has also been activated, with this:</p>
<p class="html"><code><p>This is the first paragraph </p><ul>
<li><p>List item
</p></li></ul></code></p>
<p><strong>Hint:</strong> Set the flag <code>'opentag.before.newline'</code> and <code>'closetag.after.newline'</code> of a code which has <code><API key></code> set to <code><API key></code> or <code>BBCODE_NEWLINE_DROP</code>. Else empty paragraphs like <code><p></p></code> are created.</p>
<hr>
<ul>
<li>Next: <a href="chapter9.html">9. Complete example</a></li>
<li>Previous: <a href="chapter7.html">7. Limiting the amount of occurrences</a></li>
</ul>
</div>
<p id="footer">This is the documentation for the <code>StringParser_BBCode</code> class version <em>0.3.3</em><br>
Author: Christian Seiler, <a href="mailto:webmaster@christian-seiler.de">webmaster@christian-seiler.de</a></p>
</div>
</body>
</html>
|
// soundReactiveBars.cpp
// <API key>
#include "soundReactiveBars.h"
void soundReactiveBars::setup(){
}
void soundReactiveBars::update(){
}
void soundReactiveBars::draw(int initWidth, int initHeight, int initThickness, int initRed, int initGreen, int initBlue, int initBufferSize, float initSensitivity){
ofSetVerticalSync(true);
<API key>(80);
ofBackground(54, 54, 54);
// 0 output channels,
// 2 input channels
// 44100 samples per second
// 256 samples per buffer
// 4 num buffers (latency)
//if you want to set a different device id
//soundStream.setDeviceID(0); //bear in mind the device id corresponds to all audio devices, including input-only and output-only devices.
left.assign(bufferSize, 0.0);
right.assign(bufferSize, 0.0);
volHistory.assign(lineWidth, 0.0);
bufferCounter = 0;
drawCounter = 0;
smoothedVol = 0.0;
scaledVol = 0.0;
//lets scale the vol up to a 0-1 range
scaledVol = ofMap(smoothedVol, 0.0, 0.17, 0.0, 1.0, true);
//lets record the volume into an array
volHistory.push_back( scaledVol );
//if we are bigger the the size we want to record - lets drop the oldest value
if( volHistory.size() >= lineWidth ){
volHistory.erase(volHistory.begin(), volHistory.begin()+1);
}
lineWidth = initWidth;
lineHeight = initHeight;
lineThickness = initThickness;
red = initRed;
green = initGreen;
blue = initBlue;
bufferSize = initBufferSize;
sensitivity = initSensitivity;
scaledVol = ofMap(smoothedVol, 0.0, 0.17, 0.0, 1.0, true);
volHistory.push_back( scaledVol );
ofSetColor(initRed, initGreen, initBlue);
ofPushMatrix();
ofDrawRectangle(0, 0, lineWidth, lineHeight);
ofPopMatrix();
ofPushMatrix();
ofTranslate(0, lineHeight);
//lets draw the volume history as a graph
ofBeginShape();
for (unsigned int i = 0; i < volHistory.size(); i++){
if( i == 0 ) ofVertex(i, 400);
ofVertex(i, 400 - volHistory[i] * 70);
if( i == volHistory.size() -1 ) ofVertex(i, 400);
}
ofEndShape(false);
ofPopMatrix();
ofSetColor(225);
ofDrawBitmapString("Scaled average vol (0-100): " + ofToString(scaledVol * 100.0, 0), 4, 18);
//ofPushMatrix();
//ofTranslate(0, lineHeight + lineThickness);
//ofBeginShape();
//for (unsigned int i = 0; i < volHistory.size(); i++){
//if(i == 0) ofVertex(i, 0);
//ofVertex(i, volHistory[i] * sensitivity);
//if(i == volHistory.size() -1) ofVertex(i, 0);
//ofEndShape(false);
//ofPopMatrix();
//ofPushMatrix();
//ofRotate(180);
//ofTranslate(-(lineWidth), -(lineHeight));
//ofBeginShape();
//for (unsigned int i = 0; i < volHistory.size(); i++){
//if(i == 0) ofVertex(i, 0);
//ofVertex(i, volHistory[i] * sensitivity);
//if(i == volHistory.size() -1) ofVertex(i, 0);
//ofEndShape(false);
//ofPopMatrix();
}
void soundReactiveBars::audioIn(float * input, int bufferSize, int nChannels){
float curVol = 0.0;
int numCounted = 0;
for (int i = 0; i < bufferSize; i++){
left[i] = input[i * 2] * 0.5;
right[i] = input[i * 2 + 1] * 0.5;
curVol += left[i] * left[i];
curVol += right[i] * right[i];
numCounted += 2;
}
curVol /= (float)numCounted;
curVol = sqrt( curVol );
smoothedVol *= 0.93;
smoothedVol += 0.07 * curVol;
bufferCounter++;
}
|
/*
* Contents
*
* Body resets
* Custom type
* Messages
* Container
* Masthead
* Posts and pages
* Pagination
* Reverse layout
* Themes
*/
/*
* Body resets
*
* Update the foundational and global aspects of the page.
*/
* {
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
}
html,
body {
margin: 0;
padding: 0;
}
html {
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
font-size: 16px;
line-height: 1.5;
}
@media (min-width: 38em) {
html {
font-size: 20px;
}
}
body {
color: #515151;
background-color: #fff;
-<API key>: 100%;
-ms-text-size-adjust: 100%;
}
/* No `:visited` state is required by default (browsers will use `a`) */
a {
color: #268bd2;
text-decoration: none;
}
a strong {
color: inherit;
}
/* `:focus` is linked to `:hover` for basic accessibility */
a:hover,
a:focus {
text-decoration: underline;
}
/* Headings */
h1, h2, h3, h4, h5, h6 {
margin-bottom: .5rem;
font-weight: bold;
line-height: 1.25;
color: #313131;
text-rendering: optimizeLegibility;
}
h1 {
font-size: 2rem;
}
h2 {
margin-top: 1rem;
font-size: 1.5rem;
}
h3 {
margin-top: 1.5rem;
font-size: 1.25rem;
}
h4, h5, h6 {
margin-top: 1rem;
font-size: 1rem;
}
/* Body text */
p {
margin-top: 0;
margin-bottom: 1rem;
}
strong {
color: #303030;
}
/* Lists */
ul, ol, dl {
margin-top: 0;
margin-bottom: 1rem;
}
dt {
font-weight: bold;
}
dd {
margin-bottom: .5rem;
}
/* Misc */
hr {
position: relative;
margin: 1.5rem 0;
border: 0;
border-top: 1px solid #eee;
border-bottom: 1px solid #fff;
}
abbr {
font-size: 85%;
font-weight: bold;
color: #555;
text-transform: uppercase;
}
abbr[title] {
cursor: help;
border-bottom: 1px dotted #e5e5e5;
}
/* Code */
code,
pre {
font-family: Menlo, Monaco, "Courier New", monospace;
}
code {
padding: .25em .5em;
font-size: 85%;
color: #bf616a;
background-color: #f9f9f9;
border-radius: 3px;
}
pre {
display: block;
margin-top: 0;
margin-bottom: 1rem;
padding: 1rem;
font-size: .8rem;
line-height: 1.4;
white-space: pre;
white-space: pre-wrap;
word-break: break-all;
word-wrap: break-word;
background-color: #f9f9f9;
}
pre code {
padding: 0;
font-size: 100%;
color: inherit;
background-color: transparent;
}
/* Pygments via Jekyll */
.highlight {
margin-bottom: 1rem;
border-radius: 4px;
}
.highlight pre {
margin-bottom: 0;
}
/* Gist via GitHub Pages */
.gist .gist-file {
font-family: Menlo, Monaco, "Courier New", monospace !important;
}
.gist .markdown-body {
padding: 15px;
}
.gist pre {
padding: 0;
background-color: transparent;
}
.gist .gist-file .gist-data {
font-size: .8rem !important;
line-height: 1.4;
}
.gist code {
padding: 0;
color: inherit;
background-color: transparent;
border-radius: 0;
}
/* Quotes */
blockquote {
padding: .5rem 1rem;
margin: .8rem 0;
color: #7a7a7a;
border-left: .25rem solid #e5e5e5;
}
blockquote p:last-child {
margin-bottom: 0;
}
@media (min-width: 30em) {
blockquote {
padding-right: 5rem;
padding-left: 1.25rem;
}
}
img {
display: block;
max-width: 100%;
margin: 0 0 1rem;
border-radius: 5px;
}
/* Tables */
table {
margin-bottom: 1rem;
width: 100%;
border: 1px solid #e5e5e5;
border-collapse: collapse;
}
td,
th {
padding: .25rem .5rem;
border: 1px solid #e5e5e5;
}
tbody tr:nth-child(odd) td,
tbody tr:nth-child(odd) th {
background-color: #f9f9f9;
}
/*
* Custom type
*
* Extend paragraphs with `.lead` for larger introductory text.
*/
.lead {
font-size: 1.25rem;
font-weight: 300;
}
/*
* Messages
*
* Show alert messages to users. You may add it to single elements like a `<p>`,
* or to a parent if there are multiple elements to show.
*/
.message {
margin-bottom: 1rem;
padding: 1rem;
color: #717171;
background-color: #f9f9f9;
}
/*
* Container
*
* Center the page content.
*/
.container {
max-width: 38rem;
padding-left: 1rem;
padding-right: 1rem;
margin-left: auto;
margin-right: auto;
}
/*
* Masthead
*
* Super small header above the content for site name and short description.
*/
.masthead {
padding-top: 1rem;
padding-bottom: 1rem;
margin-bottom: 3rem;
}
.masthead-title {
margin-top: 0;
margin-bottom: 0;
color: #505050;
}
.masthead-title a {
color: #505050;
}
.masthead-title small {
font-size: 75%;
font-weight: 400;
color: #c0c0c0;
letter-spacing: 0;
}
/*
* Posts and pages
*
* Each post is wrapped in `.post` and is used on default and post layouts. Each
* page is wrapped in `.page` and is only used on the page layout.
*/
.page,
.post {
margin-bottom: 4em;
}
/* Blog post or page title */
.page-title,
.post-title,
.post-title a {
color: #303030;
}
.page-title,
.post-title {
margin-top: 0;
}
/* Meta data line below post title */
.post-date {
display: block;
margin-top: -.5rem;
margin-bottom: 1rem;
color: #9a9a9a;
}
/* Related posts */
.related {
padding-top: 2rem;
padding-bottom: 2rem;
border-top: 1px solid #eee;
}
.related-posts {
padding-left: 0;
list-style: none;
}
.related-posts h3 {
margin-top: 0;
}
.related-posts li small {
font-size: 75%;
color: #999;
}
.related-posts li a:hover {
color: #268bd2;
text-decoration: none;
}
.related-posts li a:hover small {
color: inherit;
}
/*
* Pagination
*
* Super lightweight (HTML-wise) blog pagination. `span`s are provide for when
* there are no more previous or next posts to show.
*/
.pagination {
overflow: hidden; /* clearfix */
margin-left: -1rem;
margin-right: -1rem;
font-family: "PT Sans", Helvetica, Arial, sans-serif;
color: #ccc;
text-align: center;
}
/* Pagination items can be `span`s or `a`s */
.pagination-item {
display: block;
padding: 1rem;
border: 1px solid #eee;
}
.pagination-item:first-child {
margin-bottom: -1px;
}
/* Only provide a hover state for linked pagination items */
a.pagination-item:hover {
background-color: #f5f5f5;
}
@media (min-width: 30em) {
.pagination {
margin: 3rem 0;
}
.pagination-item {
float: left;
width: 50%;
}
.pagination-item:first-child {
margin-bottom: 0;
<API key>: 4px;
<API key>: 4px;
}
.pagination-item:last-child {
margin-left: -1px;
<API key>: 4px;
<API key>: 4px;
}
}
body {
width: 75%;
margin: auto;
}
.sig {
text-align: right;
margin-right: 1.5em;
}
|
#ifndef <API key>
#define <API key>
typedef struct lexer_state {
constant_table *globaldefinitions; /* symbol table */
char const *currentfile; /* file being processed */
int errors; /* error counter */
int flexdebug; /* debug flag */
char const *macro_id;
int id_gen; /* generator for unique ids */
int unique_id; /* unique number for generated locals and labels */
int num_digits; /* keep track of number of digits in unique_id */
FILE *outfile;
int line_defined;
} lexer_state;
#endif /* <API key> */
/*
* Local variables:
* c-file-style: "parrot"
* End:
* vim: expandtab shiftwidth=4:
*/
|
use v6;
use List::Utils;
my %mass-table = slurp('<API key>.txt').words;
my @L = sort lines;
my %invert-mass-table = %mass-table.invert.hash;
sub spectrum-graph(@L) {
my %edges;
for ^@L -> $i {
note
my $u = @L[$i];
for @L[$i+1..*-1] -> $v {
my $mass = %invert-mass-table{$v - $u};
%edges{$u}.push: {
next-mass => $v,
amino-acid => $mass;
} if defined $mass;
}
}
return %edges;
}
my %graph = spectrum-graph(@L);
sub find-protein($initial-mass) {
return '' unless %graph{$initial-mass} :exists;
gather for %graph{$initial-mass}[] {
take .<amino-acid> «~« find-protein(.<next-mass>);
}
}
say max :by(*.chars), map &find-protein, @L;
# vim: ft=perl6
|
<!DOCTYPE html PUBLIC "-
window.onload = function () {pageLoad();};
</script></head><body id="mini"><div id="module-header"><p class="caption">Data.Eq</p></div><div id="interface"><div class="top"><p class="src"><span class="keyword">class</span> <a href="Data-Eq.html#t:Eq" target="main">Eq</a> a</p></div></div></body></html>
|
describe('carousel', function() {
beforeEach(module('ui.bootstrap.carousel'));
beforeEach(module('template/carousel/carousel.html', 'template/carousel/slide.html'));
var $rootScope, elm, $compile, $controller, $timeout;
beforeEach(inject(function(_$rootScope_, _$compile_, _$controller_, _$timeout_) {
$rootScope = _$rootScope_;
$compile = _$compile_;
$controller = _$controller_;
$timeout = _$timeout_;
}));
describe('basics', function() {
var elm, scope, carouselScope;
beforeEach(function() {
scope = $rootScope.$new();
scope.slides = [
{active:false,content:'one'},
{active:false,content:'two'},
{active:false,content:'three'}
];
elm = $compile(
'<carousel interval="interval" no-transition="true">' +
'<slide ng-repeat="slide in slides" active="slide.active">' +
'{{slide.content}}' +
'</slide>' +
'</carousel>'
)(scope);
carouselScope = elm.scope();
scope.interval = 5000;
scope.$apply();
});
afterEach(function() {
scope.$destroy();
});
function testSlideActive(slideIndex) {
for (var i=0; i<scope.slides.length; i++) {
if (i == slideIndex) {
expect(scope.slides[i].active).toBe(true);
} else {
expect(scope.slides[i].active).not.toBe(true);
}
}
}
it('should set the selected slide to active = true', function() {
expect(scope.slides[0].content).toBe('one');
testSlideActive(0);
scope.$apply('slides[1].active=true');
testSlideActive(1);
});
it('should create clickable prev nav button', function() {
var navPrev = elm.find('a.left');
var navNext = elm.find('a.right');
expect(navPrev.length).toBe(1);
expect(navNext.length).toBe(1);
});
it('should display clickable slide indicators', function () {
var indicators = elm.find('ol.carousel-indicators > li');
expect(indicators.length).toBe(3);
});
it('should hide navigation when only one slide', function () {
scope.slides=[{active:false,content:'one'}];
scope.$apply();
elm = $compile(
'<carousel interval="interval" no-transition="true">' +
'<slide ng-repeat="slide in slides" active="slide.active">' +
'{{slide.content}}' +
'</slide>' +
'</carousel>'
)(scope);
var indicators = elm.find('ol.carousel-indicators > li');
expect(indicators.length).toBe(0);
var navNext = elm.find('a.right');
expect(navNext.length).toBe(0);
var navPrev = elm.find('a.left');
expect(navPrev.length).toBe(0);
});
it('should show navigation when there are 3 slides', function () {
var indicators = elm.find('ol.carousel-indicators > li');
expect(indicators.length).not.toBe(0);
var navNext = elm.find('a.right');
expect(navNext.length).not.toBe(0);
var navPrev = elm.find('a.left');
expect(navPrev.length).not.toBe(0);
});
it('should go to next when clicking next button', function() {
var navNext = elm.find('a.right');
testSlideActive(0);
navNext.click();
testSlideActive(1);
navNext.click();
testSlideActive(2);
navNext.click();
testSlideActive(0);
});
it('should go to prev when clicking prev button', function() {
var navPrev = elm.find('a.left');
testSlideActive(0);
navPrev.click();
testSlideActive(2);
navPrev.click();
testSlideActive(1);
navPrev.click();
testSlideActive(0);
});
it('should select a slide when clicking on slide indicators', function () {
var indicators = elm.find('ol.carousel-indicators > li');
indicators.eq(1).click();
testSlideActive(1);
});
it('shouldnt go forward if interval is NaN or negative', function() {
testSlideActive(0);
scope.$apply('interval = -1');
//no timeout to flush, interval watch doesn't make a new one when interval is invalid
testSlideActive(0);
scope.$apply('interval = 1000');
$timeout.flush();
testSlideActive(1);
scope.$apply('interval = false');
testSlideActive(1);
scope.$apply('interval = 1000');
$timeout.flush();
testSlideActive(2);
});
it('should bind the content to slides', function() {
var contents = elm.find('div.item');
expect(contents.length).toBe(3);
expect(contents.eq(0).text()).toBe('one');
expect(contents.eq(1).text()).toBe('two');
expect(contents.eq(2).text()).toBe('three');
scope.$apply(function() {
scope.slides[0].content = 'what';
scope.slides[1].content = 'no';
scope.slides[2].content = 'maybe';
});
expect(contents.eq(0).text()).toBe('what');
expect(contents.eq(1).text()).toBe('no');
expect(contents.eq(2).text()).toBe('maybe');
});
it('should be playing by default and cycle through slides', function() {
testSlideActive(0);
$timeout.flush();
testSlideActive(1);
$timeout.flush();
testSlideActive(2);
$timeout.flush();
testSlideActive(0);
});
it('should pause and play on mouseover', function() {
testSlideActive(0);
$timeout.flush();
testSlideActive(1);
elm.trigger('mouseenter');
expect($timeout.flush).toThrow();//pause should cancel current timeout
testSlideActive(1);
elm.trigger('mouseleave');
$timeout.flush();
testSlideActive(2);
});
it('should remove slide from dom and change active slide', function() {
scope.$apply('slides[1].active = true');
testSlideActive(1);
scope.$apply('slides.splice(1,1)');
expect(elm.find('div.item').length).toBe(2);
testSlideActive(1);
scope.$apply('slides.splice(1,1)');
expect(elm.find('div.item').length).toBe(1);
testSlideActive(0);
});
it('should change dom when you reassign ng-repeat slides array', function() {
scope.slides=[{content:'new1'},{content:'new2'},{content:'new3'}];
scope.$apply();
var contents = elm.find('div.item');
expect(contents.length).toBe(3);
expect(contents.eq(0).text()).toBe('new1');
expect(contents.eq(1).text()).toBe('new2');
expect(contents.eq(2).text()).toBe('new3');
scope.$apply('slides.splice(0,1)');
contents = elm.find('div.item');
expect(contents.length).toBe(2);
expect(contents.eq(0).text()).toBe('new2');
expect(contents.eq(0)).toHaveClass('active');
expect(contents.eq(1).text()).toBe('new3');
});
});
describe('controller', function() {
var scope, ctrl;
//create an array of slides and add to the scope
var slides = [{'content': 1},{'content': 2},{'content':3},{'content':4}];
beforeEach(function() {
scope = $rootScope.$new();
ctrl = $controller('CarouselController', {$scope: scope, $element: null});
for(var i = 0;i < slides.length;i++){
ctrl.addSlide(slides[i]);
}
});
afterEach(function() {
scope.$destroy();
});
describe('addSlide', function() {
it('should set first slide to active = true and the rest to false', function() {
angular.forEach(ctrl.slides, function(slide, i) {
if (i !== 0) {
expect(slide.active).not.toBe(true);
} else {
expect(slide.active).toBe(true);
}
});
});
it('should add new slide and change active to true if active is true on the added slide', function() {
var newSlide = {active: true};
expect(ctrl.slides.length).toBe(4);
ctrl.addSlide(newSlide);
expect(ctrl.slides.length).toBe(5);
expect(ctrl.slides[4].active).toBe(true);
expect(ctrl.slides[0].active).toBe(false);
});
it('should add a new slide and not change the active slide', function() {
var newSlide = {active: false};
expect(ctrl.slides.length).toBe(4);
ctrl.addSlide(newSlide);
expect(ctrl.slides.length).toBe(5);
expect(ctrl.slides[4].active).toBe(false);
expect(ctrl.slides[0].active).toBe(true);
});
it('should remove slide and change active slide if needed', function() {
expect(ctrl.slides.length).toBe(4);
ctrl.removeSlide(ctrl.slides[0]);
expect(ctrl.slides.length).toBe(3);
expect(ctrl.currentSlide).toBe(ctrl.slides[0]);
ctrl.select(ctrl.slides[2]);
ctrl.removeSlide(ctrl.slides[2]);
expect(ctrl.slides.length).toBe(2);
expect(ctrl.currentSlide).toBe(ctrl.slides[1]);
ctrl.removeSlide(ctrl.slides[0]);
expect(ctrl.slides.length).toBe(1);
expect(ctrl.currentSlide).toBe(ctrl.slides[0]);
});
});
});
});
|
<!DOCTYPE html PUBLIC "-
<html><head><title></title>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<link rel="stylesheet" type="text/css" href="search.css"/>
<script type="text/javascript" src="search.js"></script>
</head>
<body class="SRPage">
<div id="SRIndex">
<div class="SRStatus" id="Loading">Loading...</div>
<div class="SRResult" id="SR_query">
<div class="SREntry">
<a id="Item0" onkeydown="return searchResults.Nav(event,0)" onkeypress="return searchResults.Nav(event,0)" onkeyup="return searchResults.Nav(event,0)" class="SRSymbol" href="javascript:searchResults.Toggle('SR_query')">query</a>
<div class="SRChildren">
<a id="Item0_c0" onkeydown="return searchResults.NavChild(event,0,0)" onkeypress="return searchResults.NavChild(event,0,0)" onkeyup="return searchResults.NavChild(event,0,0)" class="SRScope" href="../<API key>.html#<API key>" target="_parent">OrderController::query()</a>
<a id="Item0_c1" onkeydown="return searchResults.NavChild(event,0,1)" onkeypress="return searchResults.NavChild(event,0,1)" onkeyup="return searchResults.NavChild(event,0,1)" class="SRScope" href="../class_database.html#<API key>" target="_parent">Database::query()</a>
</div>
</div>
</div>
<div class="SRStatus" id="Searching">Searching...</div>
<div class="SRStatus" id="NoMatches">No Matches</div>
<script type="text/javascript"><!
document.getElementById("Loading").style.display="none";
document.getElementById("NoMatches").style.display="none";
var searchResults = new SearchResults("searchResults");
searchResults.Search();
--></script>
</div>
</body>
</html>
|
package org.jcodec.codecs.h264.io.write;
import static org.jcodec.common.tools.Debug.trace;
import org.jcodec.api.<API key>;
import org.jcodec.common.io.BitWriter;
import org.jcodec.common.tools.MathUtil;
public class CAVLCWriter {
private CAVLCWriter() {
}
public static void writeUtrace(BitWriter out, int value, int n, String message) {
out.writeNBit(value, n);
trace(message, value);
}
public static void writeUE(BitWriter out, int value) {
int bits = 0;
int cumul = 0;
for (int i = 0; i < 15; i++) {
if (value < cumul + (1 << i)) {
bits = i;
break;
}
cumul += (1 << i);
}
out.writeNBit(0, bits);
out.write1Bit(1);
out.writeNBit(value - cumul, bits);
}
public static void writeSE(BitWriter out, int value) {
writeUE(out, MathUtil.golomb(value));
}
public static void writeUEtrace(BitWriter out, int value, String message) {
writeUE(out, value);
trace(message, value);
}
public static void writeSEtrace(BitWriter out, int value, String message) {
writeUE(out, MathUtil.golomb(value));
trace(message, value);
}
public static void writeTE(BitWriter out, int value, int max) {
if (max > 1)
writeUE(out, value);
else
out.write1Bit(~value & 0x1);
}
public static void writeBool(BitWriter out, boolean value, String message) {
out.write1Bit(value ? 1 : 0);
trace(message, value ? 1 : 0);
}
public static void writeU(BitWriter out, int i, int n) {
out.writeNBit(i, n);
}
public static void writeNBit(BitWriter out, long value, int n, String message) {
for (int i = 0; i < n; i++) {
out.write1Bit((int) (value >> (n - i - 1)) & 0x1);
}
trace(message, value);
}
public static void writeTrailingBits(BitWriter out) {
out.write1Bit(1);
out.flush();
}
public static void <API key>() {
throw new <API key>("todo");
}
}
|
package Zonemaster::LDNS::RR::DLV;
use strict;
use warnings;
use parent 'Zonemaster::LDNS::RR';
1;
=head1 NAME
Zonemaster::LDNS::RR::DLV - Type DLV record
=head1 DESCRIPTION
A subclass of L<Zonemaster::LDNS::RR>, so it has all the methods of that class available in addition to the ones documented here.
=head1 METHODS
No RDATA methods implemented yet.
=cut
|
#pragma once
#include <vlMFC/MDIWindow.hpp>
/* VL: subclass MDIWindow */
class CMDI_AppView : public vlMFC::MDIWindow
{
protected:
CMDI_AppView();
virtual ~CMDI_AppView();
DECLARE_DYNCREATE(CMDI_AppView)
// VL: initialize the OpenGL context here!
virtual void OnInitialUpdate();
// the rest is MFC stuff...
CMDI_AppDoc* GetDocument() const;
virtual void OnDraw(CDC* pDC); // overridden to draw this view
protected:
DECLARE_MESSAGE_MAP()
};
|
/* $NetBSD: am7990reg.h,v 1.11 2005/12/11 12:21:25 christos Exp $ */
/* $FreeBSD: soc2013/dpl/head/sys/dev/le/am7990reg.h 155136 2006-01-31 14:48:58Z marius $ */
#ifndef <API key>
#define <API key>
/*
* Receive message descriptor
*/
struct lermd {
uint16_t rmd0;
#if BYTE_ORDER == BIG_ENDIAN
uint8_t rmd1_bits;
uint8_t rmd1_hadr;
#else
uint8_t rmd1_hadr;
uint8_t rmd1_bits;
#endif
int16_t rmd2;
uint16_t rmd3;
} __packed;
/*
* Transmit message descriptor
*/
struct letmd {
uint16_t tmd0;
#if BYTE_ORDER == BIG_ENDIAN
uint8_t tmd1_bits;
uint8_t tmd1_hadr;
#else
uint8_t tmd1_hadr;
uint8_t tmd1_bits;
#endif
int16_t tmd2;
uint16_t tmd3;
} __packed;
/*
* Initialization block
*/
struct leinit {
uint16_t init_mode; /* +0x0000 */
uint16_t init_padr[3]; /* +0x0002 */
uint16_t init_ladrf[4]; /* +0x0008 */
uint16_t init_rdra; /* +0x0010 */
uint16_t init_rlen; /* +0x0012 */
uint16_t init_tdra; /* +0x0014 */
uint16_t init_tlen; /* +0x0016 */
int16_t pad0[4]; /* Pad to 16 shorts. */
} __packed;
/* Receive message descriptor 1 (rmd1_bits) */
#define LE_R1_OWN 0x80 /* LANCE owns the packet */
#define LE_R1_ERR 0x40 /* error summary */
#define LE_R1_FRAM 0x20 /* framing error */
#define LE_R1_OFLO 0x10 /* overflow error */
#define LE_R1_CRC 0x08 /* CRC error */
#define LE_R1_BUFF 0x04 /* buffer error */
#define LE_R1_STP 0x02 /* start of packet */
#define LE_R1_ENP 0x01 /* end of packet */
#define LE_R1_BITS \
"\20\10OWN\7ERR\6FRAM\5OFLO\4CRC\3BUFF\2STP\1ENP"
/* Transmit message descriptor 1 (tmd1_bits) */
#define LE_T1_OWN 0x80 /* LANCE owns the packet */
#define LE_T1_ERR 0x40 /* error summary */
#define LE_T1_MORE 0x10 /* multiple collisions */
#define LE_T1_ONE 0x08 /* single collision */
#define LE_T1_DEF 0x04 /* deferred transmit */
#define LE_T1_STP 0x02 /* start of packet */
#define LE_T1_ENP 0x01 /* end of packet */
#define LE_T1_BITS \
"\20\10OWN\7ERR\6RES\5MORE\4ONE\3DEF\2STP\1ENP"
/* Transmit message descriptor 3 (tmd3) */
#define LE_T3_BUFF 0x8000 /* buffer error */
#define LE_T3_UFLO 0x4000 /* underflow error */
#define LE_T3_LCOL 0x1000 /* late collision */
#define LE_T3_LCAR 0x0800 /* loss of carrier */
#define LE_T3_RTRY 0x0400 /* retry error */
#define LE_T3_TDR_MASK 0x03ff /* time domain reflectometry counter */
#define LE_XMD2_ONES 0xf000
#define LE_T3_BITS \
"\20\20BUFF\17UFLO\16RES\15LCOL\14LCAR\13RTRY"
/*
* PCnet-ISA defines which are not available on LANCE 7990.
*/
/* (ISA) Bus Configuration Registers */
#define LE_BCR_MSRDA 0x0000
#define LE_BCR_MSWRA 0x0001
#define LE_BCR_MC 0x0002
#define LE_BCR_LED1 0x0005
#define LE_BCR_LED2 0x0006
#define LE_BCR_LED3 0x0007
/* Bus configurations bits (MC) */
#define LE_MC_EADISEL 0x0008 /* EADI selection */
#define LE_MC_AWAKE 0x0004 /* auto-wake */
#define LE_MC_ASEL 0x0002 /* auto selection */
#define LE_MC_XMAUSEL 0x0001 /* external MAU selection */
/* LED bis (LED[123]) */
#define LE_LED_LEDOUT 0x8000
#define LE_LED_PSE 0x0080
#define LE_LED_XMTE 0x0010
#define LE_LED_PVPE 0x0008
#define LE_LED_PCVE 0x0004
#define LE_LED_JABE 0x0002
#define LE_LED_COLE 0x0001
#endif /* !<API key> */
|
#!/bin/sh
setup()
{
rm -f local.properties
rm -rf bin
rm -rf gen
android update project --path . --name MobileTest --target android-15
echo "" >> local.properties
echo "cinder.dir=$CINDER_PATH" >> local.properties
echo "chr.src.dir=$CINDER_PATH/blocks/<API key>/android/src" >> local.properties
echo "READY TO RUN:"
echo "ndk-build -j$(sysctl hw.ncpu | awk '{print $2}')"
echo "ant debug"
echo "adb install -r bin/MobileTest-debug.apk"
}
if [ -z $CINDER_PATH ]
then echo "CINDER_PATH MUST BE DEFINED!"
else
setup
fi
|
cask 'wechatwebdevtools' do
version '0.12.130400,012130400'
sha256 '<SHA256-like>'
url "https://dldir1.qq.com/WechatWebDev/#{version.after_comma}/<API key>#{version.before_comma}.dmg"
name 'wechat web devtools'
homepage 'https://mp.weixin.qq.com/debug/wxadoc/dev/devtools/download.html'
app 'wechatwebdevtools.app'
end
|
import numpy as np
import math
from numpy.random import RandomState
import pytest
from cryptorandom.cryptorandom import SHA256
from ..stratified import <API key> as spt
from ..stratified import <API key> as sptm
from ..stratified import corrcoef, sim_corr, <API key>
def <API key>():
group = np.repeat([1, 2, 3], 9)
condition = np.repeat([1, 2, 3] * 3, 3)
response = np.zeros_like(group)
response[[0, 1, 3, 9, 10, 11, 18, 19, 20]] = 1
res = spt(group, condition, response, reps=1000, seed=42)
res1 = spt(group, condition, response, alternative='less', reps=1000, seed=42)
assert res[0] < 0.01
assert res[1] == res1[1]
np.testing.assert_almost_equal(res[0], 1-res1[0])
res2 = spt(group, condition, response, alternative='two-sided', reps=1000, seed=42)
assert res2[0] < 0.02
group = np.array([1, 1, 1])
condition = np.array([2, 2, 2])
response = np.zeros_like(group)
res2 = spt(group, condition, response, reps=1000, seed=42)
assert res2 == (1.0, np.nan, None)
def <API key>():
group = np.array([1, 2, 1, 2])
condition = np.array([1, 1, 2, 2])
response = np.zeros_like(group)
groups = np.unique(group)
conditions = np.unique(condition)
res = sptm(group, condition, response, groups, conditions)
assert res == 0.0
res2 = sptm(group, condition, response) # check defaults work
assert res2 == 0.0
def <API key>():
group = np.array([1, 1, 1])
condition = np.array([2, 2, 2])
response = np.zeros_like(group)
groups = np.unique(group)
conditions = np.unique(condition)
pytest.raises(ValueError, sptm, group, condition, response, groups, conditions)
def test_corrcoef():
prng = RandomState(42)
x = prng.rand(10)
y = x
group = prng.randint(3, size=10)
res1 = corrcoef(x, y, group)
res2 = corrcoef(x, y, group)
assert res1 == res2
def test_sim_corr():
prng = SHA256(42)
x = prng.random(10)
y = x
group = prng.randint(0, 3, size=10)
res1 = sim_corr(x, y, group, seed=prng, reps=100)
res2 = sim_corr(x, y, group, seed=prng, alternative='less', reps=100)
res3 = sim_corr(x, y, group, seed=prng, alternative='two-sided', reps=100)
np.testing.assert_almost_equal(res1[0], 1-res2[0])
assert res1[1] == res2[1]
assert res1[1] == res3[1]
assert 2*res1[0] == res3[0]
def <API key>():
group = np.repeat([1, 2, 3], 10)
condition = np.repeat([1, 2] * 3, 5)
response = np.zeros_like(group)
response[[0, 1, 3, 9, 10, 11, 18, 19, 20]] = 1
res1 = spt(group, condition, response, reps=100, seed=42)
res2 = <API key>(group, condition, response, reps=100,
stat='mean_within_strata', seed=42)
assert res1[1] == res2[1]
assert math.fabs(res1[0]-res2[0]) < 0.05
def <API key>():
group = np.repeat([1, 2, 3], 10)
condition = np.repeat([1, 2] * 3, 5)
response = np.zeros_like(group)
response[[0, 1, 3, 9, 10, 11, 18, 19, 20]] = 1
res = <API key>(group, condition, response, reps=1000,
stat='mean', seed=42)
np.testing.assert_almost_equal(res[0], 0.245, 2)
assert res[1] == 0.2
(p, t, dist) = <API key>(group, condition, response, reps=1000,
stat='mean', seed=42, keep_dist=True)
assert res == (p, t)
stat_fun = lambda u: sptm(group, condition, u, np.unique(group), np.unique(condition))
res = <API key>(group, condition, response, reps=100,
stat=stat_fun, seed=42)
np.testing.assert_almost_equal(res[0], 0.8712, 3)
assert res[1] == 0.30
|
#include <gtest/gtest.h>
#include <libnode/buffer.h>
namespace libj {
namespace node {
TEST(GTestBuffer, TestCreate) {
Buffer::Ptr buf = Buffer::create();
ASSERT_TRUE(!!buf);
}
TEST(GTestBuffer, TestCreate2) {
Buffer::Ptr buf = Buffer::create("abc", 3);
ASSERT_TRUE(!!buf);
ASSERT_EQ(3, buf->length());
ASSERT_TRUE(buf->toString()->equals(str("abc")));
}
TEST(GTestBuffer, TestCreate3) {
TypedJsArray<UByte>::Ptr ary = TypedJsArray<UByte>::create();
ary->add(static_cast<UByte>('0'));
ary->add(static_cast<UByte>('1'));
Buffer::Ptr buf = Buffer::create(ary);
ASSERT_TRUE(!!buf);
ASSERT_EQ(2, buf->length());
ASSERT_TRUE(buf->toString()->equals(str("01")));
}
TEST(GTestBuffer, TestCreate4) {
const UByte d[] = {
0xe3, 0x81, 0x82,
0xe3, 0x81, 0x84,
0xe3, 0x81, 0x86,
0x00
};
String::CPtr str = String::create(d, String::UTF8);
ASSERT_EQ(3, str->length());
Buffer::Ptr buf = Buffer::create(str, Buffer::UTF8);
ASSERT_TRUE(!!buf);
ASSERT_EQ(9, buf->length());
UByte b = 0;
ASSERT_TRUE(buf->readUInt8(8, &b));
ASSERT_EQ(0x86, b);
ASSERT_TRUE(buf->toString()->equals(str));
}
TEST(GTestBuffer, TestByteLength) {
const UByte d[] = {
0xe3, 0x81, 0x82,
0xe3, 0x81, 0x84,
0xe3, 0x81, 0x86,
0x00
};
String::CPtr str = String::create(d, String::UTF8);
ASSERT_EQ(9, Buffer::byteLength(str));
ASSERT_EQ(9, Buffer::byteLength(str, Buffer::UTF8));
ASSERT_EQ(6, Buffer::byteLength(str, Buffer::UTF16BE));
ASSERT_EQ(6, Buffer::byteLength(str, Buffer::UTF16LE));
ASSERT_EQ(12, Buffer::byteLength(str, Buffer::UTF32BE));
ASSERT_EQ(12, Buffer::byteLength(str, Buffer::UTF32LE));
}
TEST(GTestBuffer, TestCopy) {
Buffer::Ptr buf1 = Buffer::create("abcde", 5);
Buffer::Ptr buf2 = Buffer::create("xyz", 3);
Buffer::Ptr buf = Buffer::create(5);
ASSERT_EQ(3, buf1->copy(buf, 0, 1, 4));
ASSERT_EQ(2, buf2->copy(buf, 3));
ASSERT_EQ(5, buf->length());
ASSERT_TRUE(buf->toString()->equals(str("bcdxy")));
}
TEST(GTestBuffer, TestConcat) {
Buffer::Ptr buf1 = Buffer::create("abc", 3);
Buffer::Ptr buf2 = Buffer::null();
Buffer::Ptr buf3 = Buffer::create("xyz", 3);
JsArray::Ptr ary = JsArray::create();
ary->add(buf1);
ary->add(buf2);
ary->add(buf3);
Buffer::Ptr buf = Buffer::concat(ary, 5);
ASSERT_EQ(5, buf->length());
ASSERT_TRUE(buf->toString()->equals(str("abcxy")));
}
TEST(GTestBuffer, TestConcat2) {
Buffer::Ptr buf1 = Buffer::create("abc", 3);
Buffer::Ptr buf2 = Buffer::create("xyz", 3);
Buffer::Ptr buf = buf1->concat(buf2);
ASSERT_TRUE(buf->toString()->equals(str("abcxyz")));
}
TEST(GTestBuffer, TestWriteRead) {
Buffer::Ptr buf = Buffer::create(2);
Byte wb = 15;
ASSERT_TRUE(buf->writeInt8(wb, 1));
Byte rb = 0;
ASSERT_TRUE(buf->readInt8(1, &rb));
ASSERT_EQ(wb, rb);
}
TEST(GTestBuffer, TestLength) {
Size len = 35472;
Buffer::Ptr buf = Buffer::create(len);
ASSERT_EQ(len, buf->length());
}
} // namespace node
} // namespace libj
|
#ifndef _MACHINE_ENDIAN_H_
#define _MACHINE_ENDIAN_H_
#include <sys/cdefs.h>
#include <sys/_types.h>
/*
* Define the order of 32-bit words in 64-bit words.
*/
#define _QUAD_HIGHWORD 1
#define _QUAD_LOWWORD 0
/*
* Definitions for byte order, according to byte significance from low
* address to high.
*/
#define _LITTLE_ENDIAN 1234 /* LSB first: i386, vax */
#define _BIG_ENDIAN 4321 /* MSB first: 68000, ibm, net */
#define _PDP_ENDIAN 3412 /* LSB first in word, MSW first in long */
#define _BYTE_ORDER _LITTLE_ENDIAN
/*
* Deprecated variants that don't have enough underscores to be useful in more
* strict namespaces.
*/
#if __BSD_VISIBLE
#define LITTLE_ENDIAN _LITTLE_ENDIAN
#define BIG_ENDIAN _BIG_ENDIAN
#define PDP_ENDIAN _PDP_ENDIAN
#define BYTE_ORDER _BYTE_ORDER
#endif
#define __bswap16_gen(x) (__uint16_t)((x) << 8 | (x) >> 8)
#define __bswap32_gen(x) \
(((__uint32_t)__bswap16((x) & 0xffff) << 16) | __bswap16((x) >> 16))
#define __bswap64_gen(x) \
(((__uint64_t)__bswap32((x) & 0xffffffff) << 32) | __bswap32((x) >> 32))
#ifdef <API key>
#define __bswap16(x) \
((__uint16_t)(<API key>(x) ? \
__bswap16_gen((__uint16_t)(x)) : __bswap16_var(x)))
#define __bswap32(x) \
(<API key>(x) ? \
__bswap32_gen((__uint32_t)(x)) : __bswap32_var(x))
#define __bswap64(x) \
(<API key>(x) ? \
__bswap64_gen((__uint64_t)(x)) : __bswap64_var(x))
#else
/* XXX these are broken for use in static initializers. */
#define __bswap16(x) __bswap16_var(x)
#define __bswap32(x) __bswap32_var(x)
#define __bswap64(x) __bswap64_var(x)
#endif
/* These are defined as functions to avoid multiple evaluation of x. */
static __inline __uint16_t
__bswap16_var(__uint16_t _x)
{
return (__bswap16_gen(_x));
}
static __inline __uint32_t
__bswap32_var(__uint32_t _x)
{
#ifdef __GNUCLIKE_ASM
__asm("bswap %0" : "+r" (_x));
return (_x);
#else
return (__bswap32_gen(_x));
#endif
}
static __inline __uint64_t
__bswap64_var(__uint64_t _x)
{
#if defined(__amd64__) && defined(__GNUCLIKE_ASM)
__asm("bswap %0" : "+r" (_x));
return (_x);
#else
/*
* It is important for the optimizations that the following is not
* really generic, but expands to 2 __bswap32_var()'s.
*/
return (__bswap64_gen(_x));
#endif
}
#define __htonl(x) __bswap32(x)
#define __htons(x) __bswap16(x)
#define __ntohl(x) __bswap32(x)
#define __ntohs(x) __bswap16(x)
#endif /* !_MACHINE_ENDIAN_H_ */
|
cask 'bezel' do
version '1.2'
sha256 '<SHA256-like>'
url "http://infinitapps.com/files/Bezel-#{version}.zip"
appcast 'http://infinitapps.com/files/bezel-appcast.xml',
:checkpoint => '<SHA256-like>'
name 'bezel'
homepage 'http://infinitapps.com/bezel/'
license :gratis
app "Bezel #{version}/Bezel.app"
end
|
import unittest
from arc_utilities.conversions import parse_file_size
class TestConversions(unittest.TestCase):
def <API key>(self):
self.assertEqual(parse_file_size('1'), 1)
self.assertEqual(parse_file_size('12.2'), 12)
self.assertEqual(parse_file_size('1k'), 1_000)
self.assertEqual(parse_file_size('1.2mB'), 1_200_000)
self.assertEqual(parse_file_size('1Gb'), 1_000_000_000)
self.assertEqual(parse_file_size('3K'), 3_000)
self.assertEqual(parse_file_size('3M'), 3_000_000)
with self.assertRaises(ValueError):
parse_file_size("hello")
if __name__ == '__main__':
unittest.main()
|
#ifndef <API key>
#define <API key>
#include "flagsfwd.h"
#include <iterator>
namespace inviwo {
namespace flags {
template <class E>
class FlagsIterator {
public:
using flags_type = flags<E>;
using difference_type = std::ptrdiff_t;
using value_type = E;
using pointer = value_type *;
using reference = const value_type;
using iterator_category = std::<API key>;
constexpr FlagsIterator() noexcept : uvalue_(0), mask_(0) {}
constexpr FlagsIterator(const FlagsIterator &other) noexcept : uvalue_(other.uvalue_),
mask_(other.mask_) {}
FlagsIterator &operator++() noexcept {
nextMask();
return *this;
}
FlagsIterator operator++(int) noexcept {
auto copy = *this;
++(*this);
return copy;
}
constexpr reference operator*() const noexcept { return static_cast<value_type>(mask_); }
friend inline constexpr bool operator==(const FlagsIterator &i,
const FlagsIterator &j) noexcept {
return i.mask_ == j.mask_;
}
friend inline constexpr bool operator!=(const FlagsIterator &i,
const FlagsIterator &j) noexcept {
return i.mask_ != j.mask_;
}
private:
template <class E_>
friend struct flags;
using impl_type = typename flags_type::impl_type;
explicit FlagsIterator(impl_type uv) noexcept : uvalue_(uv), mask_(1) {
if (!(mask_ & uvalue_)) {
nextMask();
}
}
constexpr FlagsIterator(impl_type uv, E e) noexcept
: uvalue_(uv),
mask_(static_cast<impl_type>(static_cast<impl_type>(e) & uv)) {}
void nextMask() noexcept {
do {
mask_ <<= 1;
} while (mask_ && !(mask_ & uvalue_));
}
impl_type uvalue_;
impl_type mask_;
};
} // namespace flags
} // namespace
#endif // <API key>
|
#!/bin/bash
# configs/teensy/usbmsc/setenv.sh
# modification, are permitted provided that the following conditions
# are met:
# the documentation and/or other materials provided with the
# distribution.
# 3. Neither the name NuttX nor the names of its contributors may be
# used to endorse or promote products derived from this software
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
# OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
# AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.
if [ "$_" = "$0" ] ; then
echo "You must source this script, not run it!" 1>&2
exit 1
fi
WD=`pwd`
if [ ! -x "setenv.sh" ]; then
echo "This script must be executed from the top-level NuttX build directory"
exit 1
fi
if [ -z "${PATH_ORIG}" ]; then
export PATH_ORIG="${PATH}"
fi
# This is the Cygwin path to the location where I installed the WinAVR
# toolchain under windows. This is *not* the default install
# location so you will probably have to edit this. You will also have
# to edit this if you install the Linux AVR toolchain as well
#export TOOLCHAIN_BIN="/cygdrive/c/WinAVR/bin"
# This is the Cygwin path to the location where I build the buildroot
# toolchain.
export TOOLCHAIN_BIN="${WD}/../misc/buildroot/build_avr/staging_dir/bin"
# Add the path to the toolchain to the PATH varialble
export PATH="${TOOLCHAIN_BIN}:/sbin:/usr/sbin:${PATH_ORIG}"
echo "PATH : ${PATH}"
|
# typed: false
# <API key>: true
require "diagnostic"
require "cli/parser"
require "cask/caskroom"
module Homebrew
extend T::Sig
module_function
sig { returns(CLI::Parser) }
def doctor_args
Homebrew::CLI::Parser.new do
description <<~EOS
Check your system for potential problems. Will exit with a non-zero status
if any potential problems are found. Please note that these warnings are just
used to help the Homebrew maintainers with debugging if you file an issue. If
everything you use Homebrew for is working fine: please don't worry or file
an issue; just ignore this.
EOS
switch "--list-checks",
description: "List all audit methods, which can be run individually "\
"if provided as arguments."
switch "-D", "--audit-debug",
description: "Enable debugging and profiling of audit methods."
named_args :diagnostic_check
end
end
def doctor
args = doctor_args.parse
inject_dump_stats!(Diagnostic::Checks, /^check_*/) if args.audit_debug?
checks = Diagnostic::Checks.new(verbose: args.verbose?)
if args.list_checks?
puts checks.all.sort
return
end
if args.no_named?
slow_checks = %w[
<API key>
check_missing_deps
]
methods = (checks.all.sort - slow_checks) + slow_checks
methods -= checks.cask_checks if Cask::Caskroom.casks.blank?
else
methods = args.named
end
first_warning = true
methods.each do |method|
$stderr.puts Formatter.headline("Checking #{method}", color: :magenta) if args.debug?
unless checks.respond_to?(method)
ofail "No check available by the name: #{method}"
next
end
out = checks.send(method)
next if out.blank?
if first_warning
$stderr.puts <<~EOS
#{Tty.bold}Please note that these warnings are just used to help the Homebrew maintainers
with debugging if you file an issue. If everything you use Homebrew for is
working fine: please don't worry or file an issue; just ignore this. Thanks!#{Tty.reset}
EOS
end
$stderr.puts
opoo out
Homebrew.failed = true
first_warning = false
end
puts "Your system is ready to brew." unless Homebrew.failed?
end
end
|
#ifndef _DEV_PPBUS_LPT_H_
#define _DEV_PPBUS_LPT_H_
#include <sys/ioccom.h>
#define LPT_IRQ _IOW('p', 1, long) /* set interrupt status */
#endif /* !_DEV_PPBUS_LPT_H_ */
|
<!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.8.3.1"/>
<title>cds: cds::container::SplitListSet< GC, T, Traits > Class Template Reference</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="doxygen.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 style="padding-left: 0.5em;">
<div id="projectname">cds
 <span id="projectnumber">1.4.0</span>
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.3.1 -->
<div id="navrow1" class="tabs">
<ul class="tablist">
<li><a href="index.html"><span>Main Page</span></a></li>
<li><a href="modules.html"><span>Modules</span></a></li>
<li><a href="namespaces.html"><span>Namespaces</span></a></li>
<li class="current"><a href="annotated.html"><span>Data Structures</span></a></li>
<li><a href="files.html"><span>Files</span></a></li>
</ul>
</div>
<div id="navrow2" class="tabs2">
<ul class="tablist">
<li><a href="annotated.html"><span>Data Structures</span></a></li>
<li><a href="hierarchy.html"><span>Class Hierarchy</span></a></li>
<li><a href="functions.html"><span>Data Fields</span></a></li>
</ul>
</div>
<div id="nav-path" class="navpath">
<ul>
<li class="navelem"><a class="el" href="namespacecds.html">cds</a></li><li class="navelem"><a class="el" href="<API key>.html">container</a></li><li class="navelem"><a class="el" href="<API key>.html">SplitListSet</a></li> </ul>
</div>
</div><!-- top -->
<div class="header">
<div class="summary">
<a href="#nested-classes">Data Structures</a> |
<a href="#pub-types">Public Types</a> |
<a href="#pub-methods">Public Member Functions</a> </div>
<div class="headertitle">
<div class="title">cds::container::SplitListSet< GC, T, Traits > Class Template Reference<div class="ingroups"><a class="el" href="<API key>.html">Maps and Sets</a></div></div> </div>
</div><!--header
<div class="contents">
<p>Split-ordered list set.
<a href="<API key>.html#details">More...</a></p>
<p><code>#include <cds/container/split_list_set.h></code></p>
<div class="dynheader">
Inheritance diagram for cds::container::SplitListSet< GC, T, Traits >:</div>
<div class="dyncontent">
<div class="center">
<img src="<API key>.png" usemap="#cds::container::SplitListSet< GC, T, Traits >_map" alt=""/>
<map id="cds::container::SplitListSet< GC, T, Traits >_map" name="cds::container::SplitListSet< GC, T, Traits >_map">
<area href="<API key>.html" alt="cds::intrusive::SplitListSet< GC, Traits::ordered_list, Traits >" shape="rect" coords="0,0,348,24"/>
</map>
</div></div>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="nested-classes"></a>
Data Structures</h2></td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">class  </td><td class="memItemRight" valign="bottom"><a class="el" href="<API key>.html">iterator_type</a></td></tr>
<tr class="memdesc:"><td class="mdescLeft"> </td><td class="mdescRight">Forward iterator. <a href="<API key>.html#details">More...</a><br/></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2"> </td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-types"></a>
Public Types</h2></td></tr>
<tr class="memitem:<API key>"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="<API key>"></a>
typedef options::gc </td><td class="memItemRight" valign="bottom"><a class="el" href="<API key>.html#<API key>">gc</a></td></tr>
<tr class="memdesc:<API key>"><td class="mdescLeft"> </td><td class="mdescRight">Garbage collector. <br/></td></tr>
<tr class="separator:<API key>"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:<API key>"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="<API key>"></a>
typedef options::value_type </td><td class="memItemRight" valign="bottom"><a class="el" href="<API key>.html#<API key>">value_type</a></td></tr>
<tr class="memdesc:<API key>"><td class="mdescLeft"> </td><td class="mdescRight">type of value stored in the list <br/></td></tr>
<tr class="separator:<API key>"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:<API key>"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="<API key>"></a>
typedef options::ordered_list </td><td class="memItemRight" valign="bottom"><a class="el" href="<API key>.html#<API key>">ordered_list</a></td></tr>
<tr class="memdesc:<API key>"><td class="mdescLeft"> </td><td class="mdescRight">Underlying ordered list class. <br/></td></tr>
<tr class="separator:<API key>"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:<API key>"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="<API key>"></a>
typedef base_class::key_comparator </td><td class="memItemRight" valign="bottom"><a class="el" href="<API key>.html#<API key>">key_comparator</a></td></tr>
<tr class="memdesc:<API key>"><td class="mdescLeft"> </td><td class="mdescRight">key compare functor <br/></td></tr>
<tr class="separator:<API key>"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:<API key>"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="<API key>"></a>
typedef base_class::hash </td><td class="memItemRight" valign="bottom"><a class="el" href="<API key>.html#<API key>">hash</a></td></tr>
<tr class="memdesc:<API key>"><td class="mdescLeft"> </td><td class="mdescRight">Hash functor for <code>value_type</code> and all its derivatives that you use. <br/></td></tr>
<tr class="separator:<API key>"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:<API key>"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="<API key>"></a>
typedef base_class::item_counter </td><td class="memItemRight" valign="bottom"><a class="el" href="<API key>.html#<API key>">item_counter</a></td></tr>
<tr class="memdesc:<API key>"><td class="mdescLeft"> </td><td class="mdescRight">Item counter type. <br/></td></tr>
<tr class="separator:<API key>"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:<API key>"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="<API key>"></a>
typedef <a class="el" href="<API key>.html">iterator_type</a>< false > </td><td class="memItemRight" valign="bottom"><a class="el" href="<API key>.html#<API key>">iterator</a></td></tr>
<tr class="memdesc:<API key>"><td class="mdescLeft"> </td><td class="mdescRight">Forward iterator. <br/></td></tr>
<tr class="separator:<API key>"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:<API key>"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="<API key>"></a>
typedef <a class="el" href="<API key>.html">iterator_type</a>< true > </td><td class="memItemRight" valign="bottom"><a class="el" href="<API key>.html#<API key>">const_iterator</a></td></tr>
<tr class="memdesc:<API key>"><td class="mdescLeft"> </td><td class="mdescRight">Const forward iterator. <br/></td></tr>
<tr class="separator:<API key>"><td class="memSeparator" colspan="2"> </td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr class="memitem:<API key>"><td class="memItemLeft" align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="<API key>.html#<API key>">SplitListSet</a> ()</td></tr>
<tr class="memdesc:<API key>"><td class="mdescLeft"> </td><td class="mdescRight">Initializes split-ordered list of default capacity. <a href="#<API key>">More...</a><br/></td></tr>
<tr class="separator:<API key>"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:<API key>"><td class="memItemLeft" align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="<API key>.html#<API key>">SplitListSet</a> (size_t nItemCount, size_t nLoadFactor=1)</td></tr>
<tr class="memdesc:<API key>"><td class="mdescLeft"> </td><td class="mdescRight">Initializes split-ordered list. <a href="#<API key>">More...</a><br/></td></tr>
<tr class="separator:<API key>"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:<API key>"><td class="memItemLeft" align="right" valign="top"><a class="el" href="<API key>.html#<API key>">iterator</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="<API key>.html#<API key>">begin</a> ()</td></tr>
<tr class="memdesc:<API key>"><td class="mdescLeft"> </td><td class="mdescRight">Returns a forward iterator addressing the first element in a set. <a href="#<API key>">More...</a><br/></td></tr>
<tr class="separator:<API key>"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:<API key>"><td class="memItemLeft" align="right" valign="top"><a class="el" href="<API key>.html#<API key>">iterator</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="<API key>.html#<API key>">end</a> ()</td></tr>
<tr class="memdesc:<API key>"><td class="mdescLeft"> </td><td class="mdescRight">Returns an iterator that addresses the location succeeding the last element in a set. <a href="#<API key>">More...</a><br/></td></tr>
<tr class="separator:<API key>"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:<API key>"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="<API key>"></a>
<a class="el" href="<API key>.html#<API key>">const_iterator</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="<API key>.html#<API key>">begin</a> () const </td></tr>
<tr class="memdesc:<API key>"><td class="mdescLeft"> </td><td class="mdescRight">Returns a forward const iterator addressing the first element in a set. <br/></td></tr>
<tr class="separator:<API key>"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:<API key>"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="<API key>"></a>
<a class="el" href="<API key>.html#<API key>">const_iterator</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="<API key>.html#<API key>">end</a> () const </td></tr>
<tr class="memdesc:<API key>"><td class="mdescLeft"> </td><td class="mdescRight">Returns an const iterator that addresses the location succeeding the last element in a set. <br/></td></tr>
<tr class="separator:<API key>"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:<API key>"><td class="memTemplParams" colspan="2">template<typename Q > </td></tr>
<tr class="memitem:<API key>"><td class="memTemplItemLeft" align="right" valign="top">bool </td><td class="memTemplItemRight" valign="bottom"><a class="el" href="<API key>.html#<API key>">insert</a> (Q const &val)</td></tr>
<tr class="memdesc:<API key>"><td class="mdescLeft"> </td><td class="mdescRight">Inserts new node. <a href="#<API key>">More...</a><br/></td></tr>
<tr class="separator:<API key>"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:<API key>"><td class="memTemplParams" colspan="2">template<typename Q , typename Func > </td></tr>
<tr class="memitem:<API key>"><td class="memTemplItemLeft" align="right" valign="top">bool </td><td class="memTemplItemRight" valign="bottom"><a class="el" href="<API key>.html#<API key>">insert</a> (Q const &val, Func f)</td></tr>
<tr class="memdesc:<API key>"><td class="mdescLeft"> </td><td class="mdescRight">Inserts new node. <a href="#<API key>">More...</a><br/></td></tr>
<tr class="separator:<API key>"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:<API key>"><td class="memTemplParams" colspan="2">template<typename... Args> </td></tr>
<tr class="memitem:<API key>"><td class="memTemplItemLeft" align="right" valign="top">bool </td><td class="memTemplItemRight" valign="bottom"><a class="el" href="<API key>.html#<API key>">emplace</a> (Args &&...args)</td></tr>
<tr class="memdesc:<API key>"><td class="mdescLeft"> </td><td class="mdescRight">Inserts data of type <code>value_type</code> constructed with <code>std::forward<Args>(args)...</code> <a href="#<API key>">More...</a><br/></td></tr>
<tr class="separator:<API key>"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:<API key>"><td class="memTemplParams" colspan="2">template<typename Q , typename Func > </td></tr>
<tr class="memitem:<API key>"><td class="memTemplItemLeft" align="right" valign="top">std::pair< bool, bool > </td><td class="memTemplItemRight" valign="bottom"><a class="el" href="<API key>.html#<API key>">ensure</a> (Q const &val, Func func)</td></tr>
<tr class="memdesc:<API key>"><td class="mdescLeft"> </td><td class="mdescRight">Ensures that the <code>item</code> exists in the set. <a href="#<API key>">More...</a><br/></td></tr>
<tr class="separator:<API key>"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:<API key>"><td class="memTemplParams" colspan="2">template<typename Q > </td></tr>
<tr class="memitem:<API key>"><td class="memTemplItemLeft" align="right" valign="top">bool </td><td class="memTemplItemRight" valign="bottom"><a class="el" href="<API key>.html#<API key>">erase</a> (Q const &key)</td></tr>
<tr class="memdesc:<API key>"><td class="mdescLeft"> </td><td class="mdescRight">Deletes <code>key</code> from the set. <a href="#<API key>">More...</a><br/></td></tr>
<tr class="separator:<API key>"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:<API key>"><td class="memTemplParams" colspan="2">template<typename Q , typename Less > </td></tr>
<tr class="memitem:<API key>"><td class="memTemplItemLeft" align="right" valign="top">bool </td><td class="memTemplItemRight" valign="bottom"><a class="el" href="<API key>.html#<API key>">erase_with</a> (Q const &key, Less pred)</td></tr>
<tr class="memdesc:<API key>"><td class="mdescLeft"> </td><td class="mdescRight">Deletes the item from the set using <code>pred</code> predicate for searching. <a href="#<API key>">More...</a><br/></td></tr>
<tr class="separator:<API key>"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:<API key>"><td class="memTemplParams" colspan="2">template<typename Q , typename Func > </td></tr>
<tr class="memitem:<API key>"><td class="memTemplItemLeft" align="right" valign="top">bool </td><td class="memTemplItemRight" valign="bottom"><a class="el" href="<API key>.html#<API key>">erase</a> (Q const &key, Func f)</td></tr>
<tr class="memdesc:<API key>"><td class="mdescLeft"> </td><td class="mdescRight">Deletes <code>key</code> from the set. <a href="#<API key>">More...</a><br/></td></tr>
<tr class="separator:<API key>"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:<API key>"><td class="memTemplParams" colspan="2">template<typename Q , typename Less , typename Func > </td></tr>
<tr class="memitem:<API key>"><td class="memTemplItemLeft" align="right" valign="top">bool </td><td class="memTemplItemRight" valign="bottom"><a class="el" href="<API key>.html#<API key>">erase_with</a> (Q const &key, Less pred, Func f)</td></tr>
<tr class="memdesc:<API key>"><td class="mdescLeft"> </td><td class="mdescRight">Deletes the item from the set using <code>pred</code> predicate for searching. <a href="#<API key>">More...</a><br/></td></tr>
<tr class="separator:<API key>"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:<API key>"><td class="memTemplParams" colspan="2">template<typename Q , typename Func > </td></tr>
<tr class="memitem:<API key>"><td class="memTemplItemLeft" align="right" valign="top">bool </td><td class="memTemplItemRight" valign="bottom"><a class="el" href="<API key>.html#<API key>">find</a> (Q &val, Func f)</td></tr>
<tr class="memdesc:<API key>"><td class="mdescLeft"> </td><td class="mdescRight">Finds the key <code>val</code>. <a href="#<API key>">More...</a><br/></td></tr>
<tr class="separator:<API key>"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:<API key>"><td class="memTemplParams" colspan="2">template<typename Q , typename Less , typename Func > </td></tr>
<tr class="memitem:<API key>"><td class="memTemplItemLeft" align="right" valign="top">bool </td><td class="memTemplItemRight" valign="bottom"><a class="el" href="<API key>.html#<API key>">find_with</a> (Q &val, Less pred, Func f)</td></tr>
<tr class="memdesc:<API key>"><td class="mdescLeft"> </td><td class="mdescRight">Finds the key <code>val</code> using <code>pred</code> predicate for searching. <a href="#<API key>">More...</a><br/></td></tr>
<tr class="separator:<API key>"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:<API key>"><td class="memTemplParams" colspan="2">template<typename Q , typename Func > </td></tr>
<tr class="memitem:<API key>"><td class="memTemplItemLeft" align="right" valign="top">bool </td><td class="memTemplItemRight" valign="bottom"><a class="el" href="<API key>.html#<API key>">find</a> (Q const &val, Func f)</td></tr>
<tr class="memdesc:<API key>"><td class="mdescLeft"> </td><td class="mdescRight">Finds the key <code>val</code>. <a href="#<API key>">More...</a><br/></td></tr>
<tr class="separator:<API key>"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:<API key>"><td class="memTemplParams" colspan="2">template<typename Q , typename Less , typename Func > </td></tr>
<tr class="memitem:<API key>"><td class="memTemplItemLeft" align="right" valign="top">bool </td><td class="memTemplItemRight" valign="bottom"><a class="el" href="<API key>.html#<API key>">find_with</a> (Q const &val, Less pred, Func f)</td></tr>
<tr class="memdesc:<API key>"><td class="mdescLeft"> </td><td class="mdescRight">Finds the key <code>val</code> using <code>pred</code> predicate for searching. <a href="#<API key>">More...</a><br/></td></tr>
<tr class="separator:<API key>"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:<API key>"><td class="memTemplParams" colspan="2">template<typename Q > </td></tr>
<tr class="memitem:<API key>"><td class="memTemplItemLeft" align="right" valign="top">bool </td><td class="memTemplItemRight" valign="bottom"><a class="el" href="<API key>.html#<API key>">find</a> (Q const &val)</td></tr>
<tr class="memdesc:<API key>"><td class="mdescLeft"> </td><td class="mdescRight">Finds the key <code>val</code>. <a href="#<API key>">More...</a><br/></td></tr>
<tr class="separator:<API key>"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:<API key>"><td class="memTemplParams" colspan="2">template<typename Q , typename Less > </td></tr>
<tr class="memitem:<API key>"><td class="memTemplItemLeft" align="right" valign="top">bool </td><td class="memTemplItemRight" valign="bottom"><a class="el" href="<API key>.html#<API key>">find_with</a> (Q const &val, Less pred)</td></tr>
<tr class="memdesc:<API key>"><td class="mdescLeft"> </td><td class="mdescRight">Finds the key <code>val</code> using <code>pred</code> predicate for searching. <a href="#<API key>">More...</a><br/></td></tr>
<tr class="separator:<API key>"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:<API key>"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="<API key>.html#<API key>">clear</a> ()</td></tr>
<tr class="memdesc:<API key>"><td class="mdescLeft"> </td><td class="mdescRight">Clears the set (non-atomic) <a href="#<API key>">More...</a><br/></td></tr>
<tr class="separator:<API key>"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:<API key>"><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="<API key>.html#<API key>">empty</a> () const </td></tr>
<tr class="memdesc:<API key>"><td class="mdescLeft"> </td><td class="mdescRight">Checks if the set is empty. <a href="#<API key>">More...</a><br/></td></tr>
<tr class="separator:<API key>"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:<API key>"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="<API key>"></a>
size_t </td><td class="memItemRight" valign="bottom"><a class="el" href="<API key>.html#<API key>">size</a> () const </td></tr>
<tr class="memdesc:<API key>"><td class="mdescLeft"> </td><td class="mdescRight">Returns item count in the set. <br/></td></tr>
<tr class="separator:<API key>"><td class="memSeparator" colspan="2"> </td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="inherited"></a>
Additional Inherited Members</h2></td></tr>
<tr class="inherit_header <API key>"><td colspan="2" onclick="javascript:toggleInherit('<API key>')"><img src="closed.png" alt="-"/> Protected Types inherited from <a class="el" href="<API key>.html">cds::intrusive::SplitListSet< GC, Traits::ordered_list, Traits ></a></td></tr>
<tr class="memitem:<API key> inherit <API key>"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="<API key>"></a>
typedef Traits </td><td class="memItemRight" valign="bottom"><a class="el" href="<API key>.html#<API key>">options</a></td></tr>
<tr class="memdesc:<API key> inherit <API key>"><td class="mdescLeft"> </td><td class="mdescRight">Traits template parameters. <br/></td></tr>
<tr class="separator:<API key> inherit <API key>"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:<API key> inherit <API key>"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="<API key>"></a>
typedef GC </td><td class="memItemRight" valign="bottom"><a class="el" href="<API key>.html#<API key>">gc</a></td></tr>
<tr class="memdesc:<API key> inherit <API key>"><td class="mdescLeft"> </td><td class="mdescRight">Garbage collector. <br/></td></tr>
<tr class="separator:<API key> inherit <API key>"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:<API key> inherit <API key>"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="<API key>"></a>
typedef Traits::ordered_list </td><td class="memItemRight" valign="bottom"><a class="el" href="<API key>.html#<API key>">ordered_list</a></td></tr>
<tr class="memdesc:<API key> inherit <API key>"><td class="mdescLeft"> </td><td class="mdescRight">type of ordered list used as base for split-list <br/></td></tr>
<tr class="separator:<API key> inherit <API key>"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:<API key> inherit <API key>"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="<API key>"></a>
typedef ordered_list::value_type </td><td class="memItemRight" valign="bottom"><a class="el" href="<API key>.html#<API key>">value_type</a></td></tr>
<tr class="memdesc:<API key> inherit <API key>"><td class="mdescLeft"> </td><td class="mdescRight">type of value stored in the split-list <br/></td></tr>
<tr class="separator:<API key> inherit <API key>"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:<API key> inherit <API key>"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="<API key>"></a>
typedef <br class="typebreak"/>
ordered_list::key_comparator </td><td class="memItemRight" valign="bottom"><a class="el" href="<API key>.html#<API key>">key_comparator</a></td></tr>
<tr class="memdesc:<API key> inherit <API key>"><td class="mdescLeft"> </td><td class="mdescRight">key comparision functor <br/></td></tr>
<tr class="separator:<API key> inherit <API key>"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:<API key> inherit <API key>"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="<API key>"></a>
typedef ordered_list::disposer </td><td class="memItemRight" valign="bottom"><a class="el" href="<API key>.html#<API key>">disposer</a></td></tr>
<tr class="memdesc:<API key> inherit <API key>"><td class="mdescLeft"> </td><td class="mdescRight">Node disposer functor. <br/></td></tr>
<tr class="separator:<API key> inherit <API key>"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:<API key> inherit <API key>"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="<API key>"></a>
typedef <br class="typebreak"/>
cds::opt::v::hash_selector<br class="typebreak"/>
< typename options::hash ><br class="typebreak"/>
::type </td><td class="memItemRight" valign="bottom"><a class="el" href="<API key>.html#<API key>">hash</a></td></tr>
<tr class="memdesc:<API key> inherit <API key>"><td class="mdescLeft"> </td><td class="mdescRight">Hash functor for <code>value_type</code> and all its derivatives that you use. <br/></td></tr>
<tr class="separator:<API key> inherit <API key>"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:<API key> inherit <API key>"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="<API key>"></a>
typedef options::item_counter </td><td class="memItemRight" valign="bottom"><a class="el" href="<API key>.html#<API key>">item_counter</a></td></tr>
<tr class="memdesc:<API key> inherit <API key>"><td class="mdescLeft"> </td><td class="mdescRight">Item counter type. <br/></td></tr>
<tr class="separator:<API key> inherit <API key>"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:<API key> inherit <API key>"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="<API key>"></a>
typedef options::back_off </td><td class="memItemRight" valign="bottom"><a class="el" href="<API key>.html#<API key>">back_off</a></td></tr>
<tr class="memdesc:<API key> inherit <API key>"><td class="mdescLeft"> </td><td class="mdescRight">back-off strategy for spinning <br/></td></tr>
<tr class="separator:<API key> inherit <API key>"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:<API key> inherit <API key>"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="<API key>"></a>
typedef options::memory_model </td><td class="memItemRight" valign="bottom"><a class="el" href="<API key>.html#<API key>">memory_model</a></td></tr>
<tr class="memdesc:<API key> inherit <API key>"><td class="mdescLeft"> </td><td class="mdescRight">Memory ordering. See <a class="el" href="<API key>.html" title="[type-option] Option setter for C++ memory model">cds::opt::memory_model</a> option. <br/></td></tr>
<tr class="separator:<API key> inherit <API key>"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:<API key> inherit <API key>"><td class="memItemLeft" align="right" valign="top">typedef iterator_type< false > </td><td class="memItemRight" valign="bottom"><a class="el" href="<API key>.html#<API key>">iterator</a></td></tr>
<tr class="memdesc:<API key> inherit <API key>"><td class="mdescLeft"> </td><td class="mdescRight">Forward iterator. <a href="#<API key>">More...</a><br/></td></tr>
<tr class="separator:<API key> inherit <API key>"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:<API key> inherit <API key>"><td class="memItemLeft" align="right" valign="top">typedef iterator_type< true > </td><td class="memItemRight" valign="bottom"><a class="el" href="<API key>.html#<API key>">const_iterator</a></td></tr>
<tr class="memdesc:<API key> inherit <API key>"><td class="mdescLeft"> </td><td class="mdescRight">Const forward iterator. <a href="#<API key>">More...</a><br/></td></tr>
<tr class="separator:<API key> inherit <API key>"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:<API key> inherit <API key>"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="<API key>"></a>
typedef ordered_list::node_type </td><td class="memItemRight" valign="bottom"><a class="el" href="<API key>.html#<API key>">list_node_type</a></td></tr>
<tr class="memdesc:<API key> inherit <API key>"><td class="mdescLeft"> </td><td class="mdescRight">Node type as declared in ordered list. <br/></td></tr>
<tr class="separator:<API key> inherit <API key>"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:<API key> inherit <API key>"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="<API key>"></a>
typedef <a class="el" href="<API key>.html">split_list::node</a><br class="typebreak"/>
< <a class="el" href="<API key>.html#<API key>">list_node_type</a> > </td><td class="memItemRight" valign="bottom"><a class="el" href="<API key>.html#<API key>">node_type</a></td></tr>
<tr class="memdesc:<API key> inherit <API key>"><td class="mdescLeft"> </td><td class="mdescRight">split-list node type <br/></td></tr>
<tr class="separator:<API key> inherit <API key>"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:<API key> inherit <API key>"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="<API key>"></a>
typedef <a class="el" href="<API key>.html#<API key>">node_type</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="<API key>.html#<API key>">dummy_node_type</a></td></tr>
<tr class="memdesc:<API key> inherit <API key>"><td class="mdescLeft"> </td><td class="mdescRight">dummy node type <br/></td></tr>
<tr class="separator:<API key> inherit <API key>"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:<API key> inherit <API key>"><td class="memItemLeft" align="right" valign="top">typedef <br class="typebreak"/>
<a class="el" href="<API key>.html">split_list::node_traits</a><br class="typebreak"/>
< typename <br class="typebreak"/>
ordered_list::node_traits > </td><td class="memItemRight" valign="bottom"><a class="el" href="<API key>.html#<API key>">node_traits</a></td></tr>
<tr class="memdesc:<API key> inherit <API key>"><td class="mdescLeft"> </td><td class="mdescRight">Split-list node traits. <a href="#<API key>">More...</a><br/></td></tr>
<tr class="separator:<API key> inherit <API key>"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="inherit_header <API key>"><td colspan="2" onclick="javascript:toggleInherit('<API key>')"><img src="closed.png" alt="-"/> Protected Member Functions inherited from <a class="el" href="<API key>.html">cds::intrusive::SplitListSet< GC, Traits::ordered_list, Traits ></a></td></tr>
<tr class="memitem:<API key> inherit <API key>"><td class="memItemLeft" align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="<API key>.html#<API key>">SplitListSet</a> ()</td></tr>
<tr class="memdesc:<API key> inherit <API key>"><td class="mdescLeft"> </td><td class="mdescRight">Initialize split-ordered list of default capacity. <a href="#<API key>">More...</a><br/></td></tr>
<tr class="separator:<API key> inherit <API key>"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:<API key> inherit <API key>"><td class="memItemLeft" align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="<API key>.html#<API key>">SplitListSet</a> (size_t nItemCount, size_t nLoadFactor=1)</td></tr>
<tr class="memdesc:<API key> inherit <API key>"><td class="mdescLeft"> </td><td class="mdescRight">Initialize split-ordered list. <a href="#<API key>">More...</a><br/></td></tr>
<tr class="separator:<API key> inherit <API key>"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:<API key> inherit <API key>"><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="<API key>.html#<API key>">insert</a> (<a class="el" href="<API key>.html#<API key>">value_type</a> &val)</td></tr>
<tr class="memdesc:<API key> inherit <API key>"><td class="mdescLeft"> </td><td class="mdescRight">Inserts new node. <a href="#<API key>">More...</a><br/></td></tr>
<tr class="separator:<API key> inherit <API key>"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:<API key> inherit <API key>"><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="<API key>.html#<API key>">insert</a> (<a class="el" href="<API key>.html#<API key>">value_type</a> &val, Func f)</td></tr>
<tr class="memdesc:<API key> inherit <API key>"><td class="mdescLeft"> </td><td class="mdescRight">Inserts new node. <a href="#<API key>">More...</a><br/></td></tr>
<tr class="separator:<API key> inherit <API key>"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:<API key> inherit <API key>"><td class="memItemLeft" align="right" valign="top">std::pair< bool, bool > </td><td class="memItemRight" valign="bottom"><a class="el" href="<API key>.html#<API key>">ensure</a> (<a class="el" href="<API key>.html#<API key>">value_type</a> &val, Func func)</td></tr>
<tr class="memdesc:<API key> inherit <API key>"><td class="mdescLeft"> </td><td class="mdescRight">Ensures that the <code>val</code> exists in the set. <a href="#<API key>">More...</a><br/></td></tr>
<tr class="separator:<API key> inherit <API key>"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:<API key> inherit <API key>"><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="<API key>.html#<API key>">unlink</a> (<a class="el" href="<API key>.html#<API key>">value_type</a> &val)</td></tr>
<tr class="memdesc:<API key> inherit <API key>"><td class="mdescLeft"> </td><td class="mdescRight">Unlinks the item <code>val</code> from the set. <a href="#<API key>">More...</a><br/></td></tr>
<tr class="separator:<API key> inherit <API key>"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:<API key> inherit <API key>"><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="<API key>.html#<API key>">erase</a> (Q const &val)</td></tr>
<tr class="memdesc:<API key> inherit <API key>"><td class="mdescLeft"> </td><td class="mdescRight">Deletes the item from the set. <a href="#<API key>">More...</a><br/></td></tr>
<tr class="separator:<API key> inherit <API key>"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:<API key> inherit <API key>"><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="<API key>.html#<API key>">erase</a> (Q const &val, Func f)</td></tr>
<tr class="memdesc:<API key> inherit <API key>"><td class="mdescLeft"> </td><td class="mdescRight">Deletes the item from the set. <a href="#<API key>">More...</a><br/></td></tr>
<tr class="separator:<API key> inherit <API key>"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:<API key> inherit <API key>"><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="<API key>.html#<API key>">erase_with</a> (const Q &val, Less pred)</td></tr>
<tr class="memdesc:<API key> inherit <API key>"><td class="mdescLeft"> </td><td class="mdescRight">Deletes the item from the set with comparing functor <code>pred</code>. <a href="#<API key>">More...</a><br/></td></tr>
<tr class="separator:<API key> inherit <API key>"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:<API key> inherit <API key>"><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="<API key>.html#<API key>">erase_with</a> (Q const &val, Less pred, Func f)</td></tr>
<tr class="memdesc:<API key> inherit <API key>"><td class="mdescLeft"> </td><td class="mdescRight">Deletes the item from the set with comparing functor <code>pred</code>. <a href="#<API key>">More...</a><br/></td></tr>
<tr class="separator:<API key> inherit <API key>"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:<API key> inherit <API key>"><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="<API key>.html#<API key>">find</a> (Q &val, Func f)</td></tr>
<tr class="memdesc:<API key> inherit <API key>"><td class="mdescLeft"> </td><td class="mdescRight">Finds the key <code>val</code>. <a href="#<API key>">More...</a><br/></td></tr>
<tr class="separator:<API key> inherit <API key>"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:<API key> inherit <API key>"><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="<API key>.html#<API key>">find</a> (Q const &val, Func f)</td></tr>
<tr class="memdesc:<API key> inherit <API key>"><td class="mdescLeft"> </td><td class="mdescRight">Finds the key <code>val</code>. <a href="#<API key>">More...</a><br/></td></tr>
<tr class="separator:<API key> inherit <API key>"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:<API key> inherit <API key>"><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="<API key>.html#<API key>">find</a> (Q const &val)</td></tr>
<tr class="memdesc:<API key> inherit <API key>"><td class="mdescLeft"> </td><td class="mdescRight">Finds the key <code>val</code>. <a href="#<API key>">More...</a><br/></td></tr>
<tr class="separator:<API key> inherit <API key>"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:<API key> inherit <API key>"><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="<API key>.html#<API key>">find_with</a> (Q &val, Less pred, Func f)</td></tr>
<tr class="memdesc:<API key> inherit <API key>"><td class="mdescLeft"> </td><td class="mdescRight">Finds the key <code>val</code> with <code>pred</code> predicate for comparing. <a href="#<API key>">More...</a><br/></td></tr>
<tr class="separator:<API key> inherit <API key>"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:<API key> inherit <API key>"><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="<API key>.html#<API key>">find_with</a> (Q const &val, Less pred, Func f)</td></tr>
<tr class="memdesc:<API key> inherit <API key>"><td class="mdescLeft"> </td><td class="mdescRight">Finds the key <code>val</code> with <code>pred</code> predicate for comparing. <a href="#<API key>">More...</a><br/></td></tr>
<tr class="separator:<API key> inherit <API key>"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:<API key> inherit <API key>"><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="<API key>.html#<API key>">find_with</a> (Q const &val, Less pred)</td></tr>
<tr class="memdesc:<API key> inherit <API key>"><td class="mdescLeft"> </td><td class="mdescRight">Finds the key <code>val</code> with <code>pred</code> predicate for comparing. <a href="#<API key>">More...</a><br/></td></tr>
<tr class="separator:<API key> inherit <API key>"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:<API key> inherit <API key>"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="<API key>"></a>
size_t </td><td class="memItemRight" valign="bottom"><a class="el" href="<API key>.html#<API key>">size</a> () const</td></tr>
<tr class="memdesc:<API key> inherit <API key>"><td class="mdescLeft"> </td><td class="mdescRight">Returns item count in the set. <br/></td></tr>
<tr class="separator:<API key> inherit <API key>"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:<API key> inherit <API key>"><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="<API key>.html#<API key>">empty</a> () const</td></tr>
<tr class="memdesc:<API key> inherit <API key>"><td class="mdescLeft"> </td><td class="mdescRight">Checks if the set is empty. <a href="#<API key>">More...</a><br/></td></tr>
<tr class="separator:<API key> inherit <API key>"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:<API key> inherit <API key>"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="<API key>.html#<API key>">clear</a> ()</td></tr>
<tr class="memdesc:<API key> inherit <API key>"><td class="mdescLeft"> </td><td class="mdescRight">Clears the set (non-atomic) <a href="#<API key>">More...</a><br/></td></tr>
<tr class="separator:<API key> inherit <API key>"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:<API key> inherit <API key>"><td class="memItemLeft" align="right" valign="top"><a class="el" href="<API key>.html#<API key>">iterator</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="<API key>.html#<API key>">begin</a> ()</td></tr>
<tr class="memdesc:<API key> inherit <API key>"><td class="mdescLeft"> </td><td class="mdescRight">Returns a forward iterator addressing the first element in a split-list. <a href="#<API key>">More...</a><br/></td></tr>
<tr class="separator:<API key> inherit <API key>"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:<API key> inherit <API key>"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="<API key>"></a>
<a class="el" href="<API key>.html#<API key>">const_iterator</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="<API key>.html#<API key>">begin</a> () const</td></tr>
<tr class="memdesc:<API key> inherit <API key>"><td class="mdescLeft"> </td><td class="mdescRight">Returns a forward const iterator addressing the first element in a split-list. <br/></td></tr>
<tr class="separator:<API key> inherit <API key>"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:<API key> inherit <API key>"><td class="memItemLeft" align="right" valign="top"><a class="el" href="<API key>.html#<API key>">iterator</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="<API key>.html#<API key>">end</a> ()</td></tr>
<tr class="memdesc:<API key> inherit <API key>"><td class="mdescLeft"> </td><td class="mdescRight">Returns an iterator that addresses the location succeeding the last element in a split-list. <a href="#<API key>">More...</a><br/></td></tr>
<tr class="separator:<API key> inherit <API key>"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:<API key> inherit <API key>"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="<API key>"></a>
<a class="el" href="<API key>.html#<API key>">const_iterator</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="<API key>.html#<API key>">end</a> () const</td></tr>
<tr class="memdesc:<API key> inherit <API key>"><td class="mdescLeft"> </td><td class="mdescRight">Returns an const iterator that addresses the location succeeding the last element in a split-list. <br/></td></tr>
<tr class="separator:<API key> inherit <API key>"><td class="memSeparator" colspan="2"> </td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><h3>template<class GC, class T, class Traits = split_list::type_traits><br/>
class cds::container::SplitListSet< GC, T, Traits ></h3>
<p>Split-ordered list set. </p>
<p><a class="anchor" id="<API key>"></a> Hash table implementation based on split-ordered list algorithm discovered by Ori Shalev and Nir Shavit, see</p>
<ul>
<li>[2003] Ori Shalev, Nir Shavit "Split-Ordered Lists - Lock-free Resizable Hash Tables"</li>
<li>[2008] Nir Shavit "The Art of Multiprocessor Programming"</li>
</ul>
<p>See <a class="el" href="<API key>.html" title="Split-ordered list.">intrusive::SplitListSet</a> for a brief description of the split-list algorithm.</p>
<p>Template parameters:</p>
<ul>
<li><code>GC</code> - Garbage collector used</li>
<li><code>T</code> - type stored in the split-list. The type must be default- and copy-constructible.</li>
<li><code>Traits</code> - type traits, default is <a class="el" href="<API key>.html" title="Type traits for SplitListSet class.">split_list::type_traits</a>. Instead of declaring <a class="el" href="<API key>.html" title="Type traits for SplitListSet class.">split_list::type_traits</a> -based struct you may apply option-based notation with <a class="el" href="<API key>.html" title="Metafunction converting option list to traits struct.">split_list::make_traits</a> metafunction.</li>
</ul>
<p>There are the specializations:</p>
<ul>
<li>for <a class="el" href="<API key>.html#cds_urcu_desc">RCU</a> - declared in <code>cd/container/split_list_set_rcu.h</code>, see <a class="el" href="classcds_1_1container_1_1_split_list_set_3_01cds_1_1urcu_1_1gc_3_01_r_c_u_01_4_00_01_t_00_01_traits_01_4.html#<API key>">SplitListSet<RCU></a>.</li>
<li>for <a class="el" href="<API key>.html">cds::gc::nogc</a> declared in <code>cds/container/split_list_set_nogc.h</code>, see <a class="el" href="classcds_1_1container_1_1_split_list_set_3_01cds_1_1gc_1_1nogc_00_01_t_00_01_traits_01_4.html#<API key>">SplitListSet<gc::nogc></a>.</li>
</ul>
<dl class="section user"><dt>Usage</dt><dd></dd></dl>
<p>You should decide what garbage collector you want, and what ordered list you want to use. Split-ordered list is original data structure based on an ordered list. Suppose, you want construct split-list set based on <a class="el" href="<API key>.html" title="Pass-the-Buck garbage collector.">gc::PTB</a> GC and <a class="el" href="<API key>.html" title="Lazy ordered list.">LazyList</a> as ordered list implementation. So, you beginning your program with following include: </p>
<div class="fragment"><div class="line"><span class="preprocessor">#include <cds/container/lazy_list_ptb.h></span></div>
<div class="line"><span class="preprocessor">#include <cds/container/split_list_set.h></span></div>
<div class="line"></div>
<div class="line"><span class="keyword">namespace </span>cc = cds::container ;</div>
<div class="line"></div>
<div class="line"><span class="comment">// The data belonged to split-ordered list</span></div>
<div class="line">sturuct foo {</div>
<div class="line"> <span class="keywordtype">int</span> nKey; <span class="comment">// key field</span></div>
<div class="line"> std::string strValue ; <span class="comment">// value field</span></div>
<div class="line">};</div>
</div><!-- fragment --><p> The inclusion order is important: first, include header for ordered-list implementation (for this example, <code>cds/container/lazy_list_ptb.h</code>), then the header for split-list set <code>cds/container/split_list_set.h</code>.</p>
<p>Now, you should declare traits for split-list set. The main parts of traits are a hash functor for the set and a comparing functor for ordered list. Note that we define several function in <code>foo_hash</code> and <code>foo_less</code> functors for different argument types since we want call our <code>SplitListSet</code> object by the key of type <code>int</code> and by the value of type <code>foo</code>.</p>
<p>The second attention: instead of using <code>LazyList</code> in <code>SplitListSet</code> traits we use a tag <code>cds::contaner::lazy_list_tag</code> for the lazy list. The split-list requires significant support from underlying ordered list class and it is not good idea to dive you into deep implementation details of split-list and ordered list interrelations. The tag paradigm simplifies split-list interface.</p>
<div class="fragment"><div class="line"><span class="comment">// foo hash functor</span></div>
<div class="line"><span class="keyword">struct </span>foo_hash {</div>
<div class="line"> <span class="keywordtype">size_t</span> operator()( <span class="keywordtype">int</span> key )<span class="keyword"> const </span>{ <span class="keywordflow">return</span> std::hash( key ) ; }</div>
<div class="line"> <span class="keywordtype">size_t</span> operator()( foo <span class="keyword">const</span>& item )<span class="keyword"> const </span>{ <span class="keywordflow">return</span> std::hash( item.nKey ) ; }</div>
<div class="line">};</div>
<div class="line"></div>
<div class="line"><span class="comment">// foo comparator</span></div>
<div class="line"><span class="keyword">struct </span>foo_less {</div>
<div class="line"> <span class="keywordtype">bool</span> operator()(<span class="keywordtype">int</span> i, foo <span class="keyword">const</span>& f )<span class="keyword"> const </span>{ <span class="keywordflow">return</span> i < f.nKey ; }</div>
<div class="line"> <span class="keywordtype">bool</span> operator()(foo <span class="keyword">const</span>& f, <span class="keywordtype">int</span> i )<span class="keyword"> const </span>{ <span class="keywordflow">return</span> f.nKey < i ; }</div>
<div class="line"> <span class="keywordtype">bool</span> operator()(foo <span class="keyword">const</span>& f1, foo <span class="keyword">const</span>& f2)<span class="keyword"> const </span>{ <span class="keywordflow">return</span> f1.nKey < f2.nKey; }</div>
<div class="line">};</div>
<div class="line"></div>
<div class="line"><span class="comment">// SplitListSet traits</span></div>
<div class="line"><span class="keyword">struct </span>foo_set_traits: <span class="keyword">public</span> cc::split_list::type_traits</div>
<div class="line">{</div>
<div class="line"> <span class="keyword">typedef</span> cc::lazy_list_tag <a class="code" href="<API key>.html#<API key>" title="Underlying ordered list class.">ordered_list</a> ; <span class="comment">// what type of ordered list we want to use</span></div>
<div class="line"> <span class="keyword">typedef</span> foo_hash <a class="code" href="<API key>.html#<API key>" title="Hash functor for value_type and all its derivatives that you use.">hash</a> ; <span class="comment">// hash functor for our data stored in split-list set</span></div>
<div class="line"></div>
<div class="line"> <span class="comment">// Type traits for our LazyList class</span></div>
<div class="line"> <span class="keyword">struct </span>ordered_list_traits: <span class="keyword">public</span> cc::lazy_list::type_traits</div>
<div class="line"> {</div>
<div class="line"> <span class="keyword">typedef</span> foo_less less ; <span class="comment">// use our foo_less as comparator to order list nodes</span></div>
<div class="line"> } ;</div>
<div class="line">};</div>
</div><!-- fragment --><p>Now you are ready to declare our set class based on <code>SplitListSet</code>: </p>
<div class="fragment"><div class="line"><span class="keyword">typedef</span> cc::SplitListSet< cds::gc::PTB, foo, foo_set_traits > foo_set ;</div>
</div><!-- fragment --><p>You may use the modern option-based declaration instead of classic type-traits-based one: </p>
<div class="fragment"><div class="line"><span class="keyword">typedef</span> cc:<a class="code" href="<API key>.html#<API key>" title="Initializes split-ordered list of default capacity.">SplitListSet</a><</div>
<div class="line"> cs::gc::PTB <span class="comment">// GC used</span></div>
<div class="line"> ,foo <span class="comment">// type of data stored</span></div>
<div class="line"> ,cc::split_list::make_traits< <span class="comment">// metafunction to build split-list traits</span></div>
<div class="line"> cc::split_list::ordered_list<cc::lazy_list_tag> <span class="comment">// tag for underlying ordered list implementation</span></div>
<div class="line"> ,cc::opt::hash< foo_hash > <span class="comment">// hash functor</span></div>
<div class="line"> ,cc::split_list::ordered_list_traits< <span class="comment">// ordered list traits desired</span></div>
<div class="line"> cc::lazy_list::make_traits< <span class="comment">// metafunction to build lazy list traits</span></div>
<div class="line"> cc::opt::less< foo_less > <span class="comment">// less-based compare functor</span></div>
<div class="line"> >::type</div>
<div class="line"> ></div>
<div class="line"> >::type</div>
<div class="line">> foo_set ;</div>
</div><!-- fragment --><p> In case of option-based declaration using <a class="el" href="<API key>.html" title="Metafunction converting option list to traits struct.">split_list::make_traits</a> metafunction the struct <code>foo_set_traits</code> is not required.</p>
<p>Now, the set of type <code>foo_set</code> is ready to use in your program.</p>
<p>Note that in this example we show only mandatory type_traits parts, optional ones is the default and they are inherited from <a class="el" href="<API key>.html" title="Type traits for SplitListSet class.">cds::container::split_list::type_traits</a>. The <b>cds</b> library contains many other options for deep tuning of behavior of the split-list and ordered-list containers. </p>
</div><h2 class="groupheader">Constructor & Destructor Documentation</h2>
<a class="anchor" id="<API key>"></a>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template<class GC, class T, class Traits = split_list::type_traits> </div>
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="<API key>.html">cds::container::SplitListSet</a>< GC, T, Traits >::<a class="el" href="<API key>.html">SplitListSet</a> </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Initializes split-ordered list of default capacity. </p>
<p>The default capacity is defined in bucket table constructor. See <a class="el" href="<API key>.html" title="Expandable bucket table.">intrusive::split_list::<API key></a>, <a class="el" href="<API key>.html" title="Static bucket table.">intrusive::split_list::static_bucket_table</a> which selects by <a class="el" href="<API key>.html" title="[value-option] Split-list dynamic bucket table option">intrusive::split_list::<API key></a> option. </p>
</div>
</div>
<a class="anchor" id="<API key>"></a>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template<class GC, class T, class Traits = split_list::type_traits> </div>
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="<API key>.html">cds::container::SplitListSet</a>< GC, T, Traits >::<a class="el" href="<API key>.html">SplitListSet</a> </td>
<td>(</td>
<td class="paramtype">size_t </td>
<td class="paramname"><em>nItemCount</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">size_t </td>
<td class="paramname"><em>nLoadFactor</em> = <code>1</code> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Initializes split-ordered list. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">nItemCount</td><td>estimate average of item count </td></tr>
<tr><td class="paramname">nLoadFactor</td><td>load factor - average item count per bucket. Small integer up to 8, default is 1. </td></tr>
</table>
</dd>
</dl>
</div>
</div>
<h2 class="groupheader">Member Function Documentation</h2>
<a class="anchor" id="<API key>"></a>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template<class GC, class T, class Traits = split_list::type_traits> </div>
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="<API key>.html#<API key>">iterator</a> <a class="el" href="<API key>.html">cds::container::SplitListSet</a>< GC, T, Traits >::begin </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Returns a forward iterator addressing the first element in a set. </p>
<p>For empty set</p>
<div class="fragment"><div class="line"><a class="code" href="<API key>.html#<API key>" title="Returns a forward iterator addressing the first element in a set.">begin</a>() == <a class="code" href="<API key>.html#<API key>" title="Returns an iterator that addresses the location succeeding the last element in a set.">end</a>() </div>
</div><!-- fragment -->
</div>
</div>
<a class="anchor" id="<API key>"></a>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template<class GC, class T, class Traits = split_list::type_traits> </div>
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">void <a class="el" href="<API key>.html">cds::container::SplitListSet</a>< GC, T, Traits >::clear </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Clears the set (non-atomic) </p>
<p>The function unlink all items from the set. The function is not atomic and not lock-free and should be used for debugging only. </p>
</div>
</div>
<a class="anchor" id="<API key>"></a>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template<class GC, class T, class Traits = split_list::type_traits> </div>
<div class="memtemplate">
template<typename... Args> </div>
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">bool <a class="el" href="<API key>.html">cds::container::SplitListSet</a>< GC, T, Traits >::emplace </td>
<td>(</td>
<td class="paramtype">Args &&... </td>
<td class="paramname"><em>args</em></td><td>)</td>
<td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Inserts data of type <code>value_type</code> constructed with <code>std::forward<Args>(args)...</code> </p>
<p>Returns <code>true</code> if inserting successful, <code>false</code> otherwise.</p>
<dl class="section note"><dt>Note</dt><dd>This function is available only for compiler that supports variadic template and move semantics </dd></dl>
</div>
</div>
<a class="anchor" id="<API key>"></a>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template<class GC, class T, class Traits = split_list::type_traits> </div>
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">bool <a class="el" href="<API key>.html">cds::container::SplitListSet</a>< GC, T, Traits >::empty </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td> const</td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Checks if the set is empty. </p>
<p>Emptiness is checked by item counting: if item count is zero then assume that the set is empty. Thus, the correct item counting feature is an important part of split-list set implementation. </p>
</div>
</div>
<a class="anchor" id="<API key>"></a>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template<class GC, class T, class Traits = split_list::type_traits> </div>
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="<API key>.html#<API key>">iterator</a> <a class="el" href="<API key>.html">cds::container::SplitListSet</a>< GC, T, Traits >::end </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Returns an iterator that addresses the location succeeding the last element in a set. </p>
<p>Do not use the value returned by <code>end</code> function to access any item. The returned value can be used only to control reaching the end of the set. For empty set</p>
<div class="fragment"><div class="line"><a class="code" href="<API key>.html#<API key>" title="Returns a forward iterator addressing the first element in a set.">begin</a>() == <a class="code" href="<API key>.html#<API key>" title="Returns an iterator that addresses the location succeeding the last element in a set.">end</a>() </div>
</div><!-- fragment -->
</div>
</div>
<a class="anchor" id="<API key>"></a>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template<class GC, class T, class Traits = split_list::type_traits> </div>
<div class="memtemplate">
template<typename Q , typename Func > </div>
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">std::pair<bool, bool> <a class="el" href="<API key>.html">cds::container::SplitListSet</a>< GC, T, Traits >::ensure </td>
<td>(</td>
<td class="paramtype">Q const & </td>
<td class="paramname"><em>val</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">Func </td>
<td class="paramname"><em>func</em> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Ensures that the <code>item</code> exists in the set. </p>
<p>The operation performs inserting or changing data with lock-free manner.</p>
<p>If the <code>val</code> key not found in the set, then the new item created from <code>val</code> is inserted into the set. Otherwise, the functor <code>func</code> is called with the item found. The functor <code>Func</code> should be a function with signature: </p>
<div class="fragment"><div class="line"><span class="keywordtype">void</span> func( <span class="keywordtype">bool</span> bNew, <a class="code" href="<API key>.html#<API key>" title="type of value stored in the list">value_type</a>& item, <span class="keyword">const</span> Q& val ) ;</div>
</div><!-- fragment --><p> or a functor: </p>
<div class="fragment"><div class="line"><span class="keyword">struct </span>my_functor {</div>
<div class="line"> <span class="keywordtype">void</span> operator()( <span class="keywordtype">bool</span> bNew, <a class="code" href="<API key>.html#<API key>" title="type of value stored in the list">value_type</a>& item, <span class="keyword">const</span> Q& val ) ;</div>
<div class="line">};</div>
</div><!-- fragment --><p>with arguments:</p>
<ul>
<li><code>bNew</code> - <code>true</code> if the item has been inserted, <code>false</code> otherwise</li>
<li><code>item</code> - item of the set</li>
<li><code>val</code> - argument <code>val</code> passed into the <code>ensure</code> function</li>
</ul>
<p>The functor may change non-key fields of the <code>item</code>; however, <code>func</code> must guarantee that during changing no any other modifications could be made on this item by concurrent threads.</p>
<p>You may pass <code>func</code> argument by reference using <code>boost::ref</code>.</p>
<p>Returns <code> std::pair<bool, bool> </code> where <code>first</code> is true if operation is successfull, <code>second</code> is true if new item has been added or <code>false</code> if the item with <code>key</code> already is in the set. </p>
</div>
</div>
<a class="anchor" id="<API key>"></a>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template<class GC, class T, class Traits = split_list::type_traits> </div>
<div class="memtemplate">
template<typename Q > </div>
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">bool <a class="el" href="<API key>.html">cds::container::SplitListSet</a>< GC, T, Traits >::erase </td>
<td>(</td>
<td class="paramtype">Q const & </td>
<td class="paramname"><em>key</em></td><td>)</td>
<td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Deletes <code>key</code> from the set. </p>
<p><a class="anchor" id="<API key>"></a> The item comparator should be able to compare the values of type <code>value_type</code> and the type <code>Q</code>.</p>
<p>Return <code>true</code> if key is found and deleted, <code>false</code> otherwise </p>
</div>
</div>
<a class="anchor" id="<API key>"></a>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template<class GC, class T, class Traits = split_list::type_traits> </div>
<div class="memtemplate">
template<typename Q , typename Func > </div>
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">bool <a class="el" href="<API key>.html">cds::container::SplitListSet</a>< GC, T, Traits >::erase </td>
<td>(</td>
<td class="paramtype">Q const & </td>
<td class="paramname"><em>key</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">Func </td>
<td class="paramname"><em>f</em> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Deletes <code>key</code> from the set. </p>
<p><a class="anchor" id="<API key>"></a> The function searches an item with key <code>key</code>, calls <code>f</code> functor and deletes the item. If <code>key</code> is not found, the functor is not called.</p>
<p>The functor <code>Func</code> interface: </p>
<div class="fragment"><div class="line"><span class="keyword">struct </span>extractor {</div>
<div class="line"> <span class="keywordtype">void</span> operator()(<a class="code" href="<API key>.html#<API key>" title="type of value stored in the list">value_type</a> <span class="keyword">const</span>& val) ;</div>
<div class="line">};</div>
</div><!-- fragment --><p> The functor may be passed by reference using <code>boost:ref</code></p>
<p>Since the key of <a class="el" href="<API key>.html" title="Split-ordered list set.">SplitListSet</a>'s <code>value_type</code> is not explicitly specified, template parameter <code>Q</code> defines the key type searching in the list. The list item comparator should be able to compare the values of the type <code>value_type</code> and the type <code>Q</code>.</p>
<p>Return <code>true</code> if key is found and deleted, <code>false</code> otherwise </p>
</div>
</div>
<a class="anchor" id="<API key>"></a>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template<class GC, class T, class Traits = split_list::type_traits> </div>
<div class="memtemplate">
template<typename Q , typename Less > </div>
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">bool <a class="el" href="<API key>.html">cds::container::SplitListSet</a>< GC, T, Traits >::erase_with </td>
<td>(</td>
<td class="paramtype">Q const & </td>
<td class="paramname"><em>key</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">Less </td>
<td class="paramname"><em>pred</em> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Deletes the item from the set using <code>pred</code> predicate for searching. </p>
<p>The function is an analog of <a class="el" href="<API key>.html#<API key>">erase(Q const&)</a> but <code>pred</code> is used for key comparing. <code>Less</code> functor has the interface like <code>std::less</code>. <code>Less</code> must imply the same element order as the comparator used for building the set. </p>
</div>
</div>
<a class="anchor" id="<API key>"></a>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template<class GC, class T, class Traits = split_list::type_traits> </div>
<div class="memtemplate">
template<typename Q , typename Less , typename Func > </div>
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">bool <a class="el" href="<API key>.html">cds::container::SplitListSet</a>< GC, T, Traits >::erase_with </td>
<td>(</td>
<td class="paramtype">Q const & </td>
<td class="paramname"><em>key</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">Less </td>
<td class="paramname"><em>pred</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">Func </td>
<td class="paramname"><em>f</em> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Deletes the item from the set using <code>pred</code> predicate for searching. </p>
<p>The function is an analog of <a class="el" href="<API key>.html#<API key>">erase(Q const&, Func)</a> but <code>pred</code> is used for key comparing. <code>Less</code> functor has the interface like <code>std::less</code>. <code>Less</code> must imply the same element order as the comparator used for building the set. </p>
</div>
</div>
<a class="anchor" id="<API key>"></a>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template<class GC, class T, class Traits = split_list::type_traits> </div>
<div class="memtemplate">
template<typename Q , typename Func > </div>
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">bool <a class="el" href="<API key>.html">cds::container::SplitListSet</a>< GC, T, Traits >::find </td>
<td>(</td>
<td class="paramtype">Q & </td>
<td class="paramname"><em>val</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">Func </td>
<td class="paramname"><em>f</em> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Finds the key <code>val</code>. </p>
<p><a class="anchor" id="<API key>"></a> The function searches the item with key equal to <code>val</code> and calls the functor <code>f</code> for item found. The interface of <code>Func</code> functor is: </p>
<div class="fragment"><div class="line"><span class="keyword">struct </span>functor {</div>
<div class="line"> <span class="keywordtype">void</span> operator()( <a class="code" href="<API key>.html#<API key>" title="type of value stored in the list">value_type</a>& item, Q& val ) ;</div>
<div class="line">};</div>
</div><!-- fragment --><p> where <code>item</code> is the item found, <code>val</code> is the <code>find</code> function argument.</p>
<p>You may pass <code>f</code> argument by reference using <code>boost::ref</code> or cds::ref.</p>
<p>The functor may change non-key fields of <code>item</code>. Note that the functor is only guarantee that <code>item</code> cannot be disposed during functor is executing. The functor does not serialize simultaneous access to the set's <code>item</code>. If such access is possible you must provide your own synchronization schema on item level to exclude unsafe item modifications.</p>
<p>The <code>val</code> argument is non-const since it can be used as <code>f</code> functor destination i.e., the functor may modify both arguments.</p>
<p>Note the hash functor specified for class <code>Traits</code> template parameter should accept a parameter of type <code>Q</code> that can be not the same as <code>value_type</code>.</p>
<p>The function returns <code>true</code> if <code>val</code> is found, <code>false</code> otherwise. </p>
</div>
</div>
<a class="anchor" id="<API key>"></a>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template<class GC, class T, class Traits = split_list::type_traits> </div>
<div class="memtemplate">
template<typename Q , typename Func > </div>
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">bool <a class="el" href="<API key>.html">cds::container::SplitListSet</a>< GC, T, Traits >::find </td>
<td>(</td>
<td class="paramtype">Q const & </td>
<td class="paramname"><em>val</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">Func </td>
<td class="paramname"><em>f</em> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Finds the key <code>val</code>. </p>
<p><a class="anchor" id="<API key>"></a> The function searches the item with key equal to <code>val</code> and calls the functor <code>f</code> for item found. The interface of <code>Func</code> functor is: </p>
<div class="fragment"><div class="line"><span class="keyword">struct </span>functor {</div>
<div class="line"> <span class="keywordtype">void</span> operator()( <a class="code" href="<API key>.html#<API key>" title="type of value stored in the list">value_type</a>& item, Q <span class="keyword">const</span>& val ) ;</div>
<div class="line">};</div>
</div><!-- fragment --><p> where <code>item</code> is the item found, <code>val</code> is the <code>find</code> function argument.</p>
<p>You may pass <code>f</code> argument by reference using <code>boost::ref</code> or cds::ref.</p>
<p>The functor may change non-key fields of <code>item</code>. Note that the functor is only guarantee that <code>item</code> cannot be disposed during functor is executing. The functor does not serialize simultaneous access to the set's <code>item</code>. If such access is possible you must provide your own synchronization schema on item level to exclude unsafe item modifications.</p>
<p>Note the hash functor specified for class <code>Traits</code> template parameter should accept a parameter of type <code>Q</code> that can be not the same as <code>value_type</code>.</p>
<p>The function returns <code>true</code> if <code>val</code> is found, <code>false</code> otherwise. </p>
</div>
</div>
<a class="anchor" id="<API key>"></a>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template<class GC, class T, class Traits = split_list::type_traits> </div>
<div class="memtemplate">
template<typename Q > </div>
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">bool <a class="el" href="<API key>.html">cds::container::SplitListSet</a>< GC, T, Traits >::find </td>
<td>(</td>
<td class="paramtype">Q const & </td>
<td class="paramname"><em>val</em></td><td>)</td>
<td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Finds the key <code>val</code>. </p>
<p><a class="anchor" id="<API key>"></a> The function searches the item with key equal to <code>val</code> and returns <code>true</code> if it is found, and <code>false</code> otherwise.</p>
<p>Note the hash functor specified for class <code>Traits</code> template parameter should accept a parameter of type <code>Q</code> that can be not the same as <a class="el" href="<API key>.html#<API key>">value_type</a>. </p>
</div>
</div>
<a class="anchor" id="<API key>"></a>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template<class GC, class T, class Traits = split_list::type_traits> </div>
<div class="memtemplate">
template<typename Q , typename Less , typename Func > </div>
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">bool <a class="el" href="<API key>.html">cds::container::SplitListSet</a>< GC, T, Traits >::find_with </td>
<td>(</td>
<td class="paramtype">Q & </td>
<td class="paramname"><em>val</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">Less </td>
<td class="paramname"><em>pred</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">Func </td>
<td class="paramname"><em>f</em> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Finds the key <code>val</code> using <code>pred</code> predicate for searching. </p>
<p>The function is an analog of <a class="el" href="<API key>.html#<API key>">find(Q&, Func)</a> but <code>pred</code> is used for key comparing. <code>Less</code> functor has the interface like <code>std::less</code>. <code>Less</code> must imply the same element order as the comparator used for building the set. </p>
</div>
</div>
<a class="anchor" id="<API key>"></a>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template<class GC, class T, class Traits = split_list::type_traits> </div>
<div class="memtemplate">
template<typename Q , typename Less , typename Func > </div>
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">bool <a class="el" href="<API key>.html">cds::container::SplitListSet</a>< GC, T, Traits >::find_with </td>
<td>(</td>
<td class="paramtype">Q const & </td>
<td class="paramname"><em>val</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">Less </td>
<td class="paramname"><em>pred</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">Func </td>
<td class="paramname"><em>f</em> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Finds the key <code>val</code> using <code>pred</code> predicate for searching. </p>
<p>The function is an analog of <a class="el" href="<API key>.html#<API key>">find(Q const&, Func)</a> but <code>pred</code> is used for key comparing. <code>Less</code> functor has the interface like <code>std::less</code>. <code>Less</code> must imply the same element order as the comparator used for building the set. </p>
</div>
</div>
<a class="anchor" id="<API key>"></a>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template<class GC, class T, class Traits = split_list::type_traits> </div>
<div class="memtemplate">
template<typename Q , typename Less > </div>
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">bool <a class="el" href="<API key>.html">cds::container::SplitListSet</a>< GC, T, Traits >::find_with </td>
<td>(</td>
<td class="paramtype">Q const & </td>
<td class="paramname"><em>val</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">Less </td>
<td class="paramname"><em>pred</em> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Finds the key <code>val</code> using <code>pred</code> predicate for searching. </p>
<p>The function is an analog of <a class="el" href="<API key>.html#<API key>">find(Q const&)</a> but <code>pred</code> is used for key comparing. <code>Less</code> functor has the interface like <code>std::less</code>. <code>Less</code> must imply the same element order as the comparator used for building the set. </p>
</div>
</div>
<a class="anchor" id="<API key>"></a>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template<class GC, class T, class Traits = split_list::type_traits> </div>
<div class="memtemplate">
template<typename Q > </div>
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">bool <a class="el" href="<API key>.html">cds::container::SplitListSet</a>< GC, T, Traits >::insert </td>
<td>(</td>
<td class="paramtype">Q const & </td>
<td class="paramname"><em>val</em></td><td>)</td>
<td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Inserts new node. </p>
<p>The function creates a node with copy of <code>val</code> value and then inserts the node created into the set.</p>
<p>The type <code>Q</code> should contain as minimum the complete key for the node. The object of <a class="el" href="<API key>.html#<API key>">value_type</a> should be constructible from a value of type <code>Q</code>. In trivial case, <code>Q</code> is equal to <a class="el" href="<API key>.html#<API key>">value_type</a>.</p>
<p>Returns <code>true</code> if <code>val</code> is inserted into the set, <code>false</code> otherwise. </p>
</div>
</div>
<a class="anchor" id="<API key>"></a>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template<class GC, class T, class Traits = split_list::type_traits> </div>
<div class="memtemplate">
template<typename Q , typename Func > </div>
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">bool <a class="el" href="<API key>.html">cds::container::SplitListSet</a>< GC, T, Traits >::insert </td>
<td>(</td>
<td class="paramtype">Q const & </td>
<td class="paramname"><em>val</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">Func </td>
<td class="paramname"><em>f</em> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Inserts new node. </p>
<p>The function allows to split creating of new item into two part:</p>
<ul>
<li>create item with key only</li>
<li>insert new item into the set</li>
<li>if inserting is success, calls <code>f</code> functor to initialize value-field of <code>val</code>.</li>
</ul>
<p>The functor signature is: </p>
<div class="fragment"><div class="line"><span class="keywordtype">void</span> func( <a class="code" href="<API key>.html#<API key>" title="type of value stored in the list">value_type</a>& val ) ;</div>
</div><!-- fragment --><p> where <code>val</code> is the item inserted. User-defined functor <code>f</code> should guarantee that during changing <code>val</code> no any other changes could be made on this set's item by concurrent threads. The user-defined functor is called only if the inserting is success. It may be passed by reference using <code>boost::ref</code> </p>
</div>
</div>
<hr/>The documentation for this class was generated from the following file:<ul>
<li>cds/container/split_list_set.h</li>
</ul>
</div><!-- contents -->
<hr/>
<div align="right">
<b>cds</b> <b>1.4.0</b>
Developed by <i>Maxim Khiszinsky aka khizmax</i> 2007 - 2012
<br/>
<i>Autogenerated Mon May 20 2013 00:37:57 by Doxygen 1.8.3.1</i>
</div>
</BODY>
</HTML>
|
#pragma once
int <API key> (<API key> *rktrans, int events,
char *errstr, int errstr_size);
int <API key> (<API key> *rktrans,
char *errstr, int errstr_size);
void <API key> (rd_kafka_broker_t *rkb);
void <API key> (rd_kafka_broker_t *rkb);
int <API key> (void);
|
#ifndef __FILES_H__
#define __FILES_H__
int file_exists(const char *file);
int file_size(const char *file);
char *resolve_path(const char *from);
#endif /* __FILES_H__ */
|
#include <sys/cdefs.h>
__FBSDID("$FreeBSD: soc2013/dpl/head/sys/boot/i386/libi386/vidconsole.c 232592 2012-02-29 18:11:33Z jkim $");
#include <stand.h>
#include <bootstrap.h>
#include <btxv86.h>
#include <machine/psl.h>
#include "libi386.h"
#if KEYBOARD_PROBE
#include <machine/cpufunc.h>
static int probe_keyboard(void);
#endif
static void vidc_probe(struct console *cp);
static int vidc_init(int arg);
static void vidc_putchar(int c);
static int vidc_getchar(void);
static int vidc_ischar(void);
static int vidc_started;
#ifdef TERM_EMU
#define MAXARGS 8
#define DEFAULT_FGCOLOR 7
#define DEFAULT_BGCOLOR 0
void end_term(void);
void bail_out(int c);
void vidc_term_emu(int c);
void get_pos(int *x, int *y);
void curs_move(int *_x, int *_y, int x, int y);
void write_char(int c, int fg, int bg);
void scroll_up(int rows, int fg, int bg);
void CD(void);
void CM(void);
void HO(void);
static int args[MAXARGS], argc;
static int fg_c, bg_c, curx, cury;
static int esc;
#endif
struct console vidconsole = {
"vidconsole",
"internal video/keyboard",
0,
vidc_probe,
vidc_init,
vidc_putchar,
vidc_getchar,
vidc_ischar
};
static void
vidc_probe(struct console *cp)
{
/* look for a keyboard */
#if KEYBOARD_PROBE
if (probe_keyboard())
#endif
{
cp->c_flags |= C_PRESENTIN;
}
/* XXX for now, always assume we can do BIOS screen output */
cp->c_flags |= C_PRESENTOUT;
}
static int
vidc_init(int arg)
{
int i;
if (vidc_started && arg == 0)
return (0);
vidc_started = 1;
#ifdef TERM_EMU
/* Init terminal emulator */
end_term();
get_pos(&curx, &cury);
curs_move(&curx, &cury, curx, cury);
fg_c = DEFAULT_FGCOLOR;
bg_c = DEFAULT_BGCOLOR;
#endif
for (i = 0; i < 10 && vidc_ischar(); i++)
(void)vidc_getchar();
return (0); /* XXX reinit? */
}
void
vidc_biosputchar(int c)
{
v86.ctl = 0;
v86.addr = 0x10;
v86.eax = 0xe00 | (c & 0xff);
v86.ebx = 0x7;
v86int();
}
static void
vidc_rawputchar(int c)
{
int i;
if (c == '\t')
/* lame tab expansion */
for (i = 0; i < 8; i++)
vidc_rawputchar(' ');
else {
#ifndef TERM_EMU
vidc_biosputchar(c);
#else
/* Emulate AH=0eh (teletype output) */
switch(c) {
case '\a':
vidc_biosputchar(c);
return;
case '\r':
curx = 0;
curs_move(&curx, &cury, curx, cury);
return;
case '\n':
cury++;
if (cury > 24) {
scroll_up(1, fg_c, bg_c);
cury
} else {
curs_move(&curx, &cury, curx, cury);
}
return;
case '\b':
if (curx > 0) {
curx
curs_move(&curx, &cury, curx, cury);
/* write_char(' ', fg_c, bg_c); XXX destructive(!) */
return;
}
return;
default:
write_char(c, fg_c, bg_c);
curx++;
if (curx > 79) {
curx = 0;
cury++;
}
if (cury > 24) {
curx = 0;
scroll_up(1, fg_c, bg_c);
cury
}
}
curs_move(&curx, &cury, curx, cury);
#endif
}
}
#ifdef TERM_EMU
/* Get cursor position on the screen. Result is in edx. Sets
* curx and cury appropriately.
*/
void
get_pos(int *x, int *y)
{
v86.ctl = 0;
v86.addr = 0x10;
v86.eax = 0x0300;
v86.ebx = 0x0;
v86int();
*x = v86.edx & 0x00ff;
*y = (v86.edx & 0xff00) >> 8;
}
/* Move cursor to x rows and y cols (0-based). */
void
curs_move(int *_x, int *_y, int x, int y)
{
v86.ctl = 0;
v86.addr = 0x10;
v86.eax = 0x0200;
v86.ebx = 0x0;
v86.edx = ((0x00ff & y) << 8) + (0x00ff & x);
v86int();
*_x = x;
*_y = y;
/* If there is ctrl char at this position, cursor would be invisible.
* Make it a space instead.
*/
v86.ctl = 0;
v86.addr = 0x10;
v86.eax = 0x0800;
v86.ebx = 0x0;
v86int();
#define isvisible(c) (((c) >= 32) && ((c) < 255))
if (!isvisible(v86.eax & 0x00ff)) {
write_char(' ', fg_c, bg_c);
}
}
/* Scroll up the whole window by a number of rows. If rows==0,
* clear the window. fg and bg are attributes for the new lines
* inserted in the window.
*/
void
scroll_up(int rows, int fgcol, int bgcol)
{
if (rows == 0)
rows = 25;
v86.ctl = 0;
v86.addr = 0x10;
v86.eax = 0x0600 + (0x00ff & rows);
v86.ebx = (bgcol << 12) + (fgcol << 8);
v86.ecx = 0x0;
v86.edx = 0x184f;
v86int();
}
/* Write character and attribute at cursor position. */
void
write_char(int c, int fgcol, int bgcol)
{
v86.ctl = 0;
v86.addr = 0x10;
v86.eax = 0x0900 + (0x00ff & c);
v86.ebx = (bgcol << 4) + fgcol;
v86.ecx = 0x1;
v86int();
}
/*
* Screen manipulation functions. They use accumulated data in
* args[] and argc variables.
*
*/
/* Clear display from current position to end of screen */
void
CD(void)
{
get_pos(&curx, &cury);
if (curx > 0) {
v86.ctl = 0;
v86.addr = 0x10;
v86.eax = 0x0600;
v86.ebx = (bg_c << 4) + fg_c;
v86.ecx = (cury << 8) + curx;
v86.edx = (cury << 8) + 79;
v86int();
if (++cury > 24) {
end_term();
return;
}
}
v86.ctl = 0;
v86.addr = 0x10;
v86.eax = 0x0600;
v86.ebx = (bg_c << 4) + fg_c;
v86.ecx = (cury << 8) + 0;
v86.edx = (24 << 8) + 79;
v86int();
end_term();
}
/* Absolute cursor move to args[0] rows and args[1] columns
* (the coordinates are 1-based).
*/
void
CM(void)
{
if (args[0] > 0)
args[0]
if (args[1] > 0)
args[1]
curs_move(&curx, &cury, args[1], args[0]);
end_term();
}
/* Home cursor (left top corner) */
void
HO(void)
{
argc = 1;
args[0] = args[1] = 1;
CM();
}
/* Clear internal state of the terminal emulation code */
void
end_term(void)
{
esc = 0;
argc = -1;
}
/* Gracefully exit ESC-sequence processing in case of misunderstanding */
void
bail_out(int c)
{
char buf[16], *ch;
int i;
if (esc) {
vidc_rawputchar('\033');
if (esc != '\033')
vidc_rawputchar(esc);
for (i = 0; i <= argc; ++i) {
sprintf(buf, "%d", args[i]);
ch = buf;
while (*ch)
vidc_rawputchar(*ch++);
}
}
vidc_rawputchar(c);
end_term();
}
static void
get_arg(int c)
{
if (argc < 0)
argc = 0;
args[argc] *= 10;
args[argc] += c - '0';
}
/* Emulate basic capabilities of cons25 terminal */
void
vidc_term_emu(int c)
{
static int ansi_col[] = {
0, 4, 2, 6, 1, 5, 3, 7,
};
int t;
int i;
switch (esc) {
case 0:
switch (c) {
case '\033':
esc = c;
break;
default:
vidc_rawputchar(c);
break;
}
break;
case '\033':
switch (c) {
case '[':
esc = c;
args[0] = 0;
argc = -1;
break;
default:
bail_out(c);
break;
}
break;
case '[':
switch (c) {
case ';':
if (argc < 0) /* XXX */
argc = 0;
else if (argc + 1 >= MAXARGS)
bail_out(c);
else
args[++argc] = 0;
break;
case 'H':
if (argc < 0)
HO();
else if (argc == 1)
CM();
else
bail_out(c);
break;
case 'J':
if (argc < 0)
CD();
else
bail_out(c);
break;
case 'm':
if (argc < 0) {
fg_c = DEFAULT_FGCOLOR;
bg_c = DEFAULT_BGCOLOR;
}
for (i = 0; i <= argc; ++i) {
switch (args[i]) {
case 0: /* back to normal */
fg_c = DEFAULT_FGCOLOR;
bg_c = DEFAULT_BGCOLOR;
break;
case 1: /* bold */
fg_c |= 0x8;
break;
case 4: /* underline */
case 5: /* blink */
bg_c |= 0x8;
break;
case 7: /* reverse */
t = fg_c;
fg_c = bg_c;
bg_c = t;
break;
case 30: case 31: case 32: case 33:
case 34: case 35: case 36: case 37:
fg_c = ansi_col[args[i] - 30];
break;
case 39: /* normal */
fg_c = DEFAULT_FGCOLOR;
break;
case 40: case 41: case 42: case 43:
case 44: case 45: case 46: case 47:
bg_c = ansi_col[args[i] - 40];
break;
case 49: /* normal */
bg_c = DEFAULT_BGCOLOR;
break;
}
}
end_term();
break;
default:
if (isdigit(c))
get_arg(c);
else
bail_out(c);
break;
}
break;
default:
bail_out(c);
break;
}
}
#endif
static void
vidc_putchar(int c)
{
#ifdef TERM_EMU
vidc_term_emu(c);
#else
vidc_rawputchar(c);
#endif
}
static int
vidc_getchar(void)
{
if (vidc_ischar()) {
v86.ctl = 0;
v86.addr = 0x16;
v86.eax = 0x0;
v86int();
return (v86.eax & 0xff);
} else {
return (-1);
}
}
static int
vidc_ischar(void)
{
v86.ctl = V86_FLAGS;
v86.addr = 0x16;
v86.eax = 0x100;
v86int();
return (!V86_ZR(v86.efl));
}
#if KEYBOARD_PROBE
#define PROBE_MAXRETRY 5
#define PROBE_MAXWAIT 400
#define IO_DUMMY 0x84
#define IO_KBD 0x060 /* 8042 Keyboard */
/* selected defines from kbdio.h */
#define KBD_STATUS_PORT 4 /* status port, read */
#define KBD_DATA_PORT 0 /* data port, read/write
* also used as keyboard command
* and mouse command port
*/
#define KBDC_ECHO 0x00ee
#define <API key> 0x0001
#define <API key> 0x0002
#define KBD_ECHO 0x00ee
/* 7 microsec delay necessary for some keyboard controllers */
static void
delay7(void)
{
/*
* I know this is broken, but no timer is available yet at this stage...
* See also comments in `delay1ms()'.
*/
inb(IO_DUMMY); inb(IO_DUMMY);
inb(IO_DUMMY); inb(IO_DUMMY);
inb(IO_DUMMY); inb(IO_DUMMY);
}
/*
* This routine uses an inb to an unused port, the time to execute that
* inb is approximately 1.25uS. This value is pretty constant across
* all CPU's and all buses, with the exception of some PCI implentations
* that do not forward this I/O address to the ISA bus as they know it
* is not a valid ISA bus address, those machines execute this inb in
* 60 nS :-(.
*
*/
static void
delay1ms(void)
{
int i = 800;
while (--i >= 0)
(void)inb(0x84);
}
/*
* We use the presence/absence of a keyboard to determine whether the internal
* console can be used for input.
*
* Perform a simple test on the keyboard; issue the ECHO command and see
* if the right answer is returned. We don't do anything as drastic as
* full keyboard reset; it will be too troublesome and take too much time.
*/
static int
probe_keyboard(void)
{
int retry = PROBE_MAXRETRY;
int wait;
int i;
while (--retry >= 0) {
/* flush any noise */
while (inb(IO_KBD + KBD_STATUS_PORT) & <API key>) {
delay7();
inb(IO_KBD + KBD_DATA_PORT);
delay1ms();
}
/* wait until the controller can accept a command */
for (wait = PROBE_MAXWAIT; wait > 0; --wait) {
if (((i = inb(IO_KBD + KBD_STATUS_PORT))
& (<API key> | <API key>)) == 0)
break;
if (i & <API key>) {
delay7();
inb(IO_KBD + KBD_DATA_PORT);
}
delay1ms();
}
if (wait <= 0)
continue;
/* send the ECHO command */
outb(IO_KBD + KBD_DATA_PORT, KBDC_ECHO);
/* wait for a response */
for (wait = PROBE_MAXWAIT; wait > 0; --wait) {
if (inb(IO_KBD + KBD_STATUS_PORT) & <API key>)
break;
delay1ms();
}
if (wait <= 0)
continue;
delay7();
i = inb(IO_KBD + KBD_DATA_PORT);
#ifdef PROBE_KBD_BEBUG
printf("probe_keyboard: got 0x%x.\n", i);
#endif
if (i == KBD_ECHO) {
/* got the right answer */
return (1);
}
}
return (0);
}
#endif /* KEYBOARD_PROBE */
|
#ifndef _NET_IF_VLAN_VAR_H_
#define _NET_IF_VLAN_VAR_H_ 1
struct ether_vlan_header {
u_char evl_dhost[ETHER_ADDR_LEN];
u_char evl_shost[ETHER_ADDR_LEN];
u_int16_t evl_encap_proto;
u_int16_t evl_tag;
u_int16_t evl_proto;
};
#define EVL_VLID_MASK 0x0FFF
#define EVL_PRI_MASK 0xE000
#define EVL_VLANOFTAG(tag) ((tag) & EVL_VLID_MASK)
#define EVL_PRIOFTAG(tag) (((tag) >> 13) & 7)
#define EVL_CFIOFTAG(tag) (((tag) >> 12) & 1)
#define EVL_MAKETAG(vlid, pri, cfi) \
((((((pri) & 7) << 1) | ((cfi) & 1)) << 12) | ((vlid) & EVL_VLID_MASK))
/* Set the VLAN ID in an mbuf packet header non-destructively. */
#define EVL_APPLY_VLID(m, vlid) \
do { \
if ((m)->m_flags & M_VLANTAG) { \
(m)->m_pkthdr.ether_vtag &= EVL_VLID_MASK; \
(m)->m_pkthdr.ether_vtag |= (vlid); \
} else { \
(m)->m_pkthdr.ether_vtag = (vlid); \
(m)->m_flags |= M_VLANTAG; \
} \
} while (0)
/* Set the priority ID in an mbuf packet header non-destructively. */
#define EVL_APPLY_PRI(m, pri) \
do { \
if ((m)->m_flags & M_VLANTAG) { \
uint16_t __vlantag = (m)->m_pkthdr.ether_vtag; \
(m)->m_pkthdr.ether_vtag |= EVL_MAKETAG( \
EVL_VLANOFTAG(__vlantag), (pri), \
EVL_CFIOFTAG(__vlantag)); \
} else { \
(m)->m_pkthdr.ether_vtag = \
EVL_MAKETAG(0, (pri), 0); \
(m)->m_flags |= M_VLANTAG; \
} \
} while (0)
/* sysctl(3) tags, for compatibility purposes */
#define VLANCTL_PROTO 1
#define VLANCTL_MAX 2
/*
* Configuration structure for SIOCSETVLAN and SIOCGETVLAN ioctls.
*/
struct vlanreq {
char vlr_parent[IFNAMSIZ];
u_short vlr_tag;
};
#define SIOCSETVLAN SIOCSIFGENERIC
#define SIOCGETVLAN SIOCGIFGENERIC
#ifdef _KERNEL
/*
* Drivers that are capable of adding and removing the VLAN header
* in hardware indicate they support this by marking <API key>
* in if_capabilities. Drivers for hardware that is capable
* of handling larger MTU's that may include a software-appended
* VLAN header w/o lowering the normal MTU should mark IFCAP_VLAN_MTU
* in if_capabilities; this notifies the VLAN code it can leave the
* MTU on the vlan interface at the normal setting.
*/
/*
* VLAN tags are stored in host byte order. Byte swapping may be
* necessary.
*
* Drivers that support hardware VLAN tag stripping fill in the
* received VLAN tag (containing both vlan and priority information)
* into the ether_vtag mbuf packet header field:
*
* m->m_pkthdr.ether_vtag = vlan_id; // ntohs()?
* m->m_flags |= M_VLANTAG;
*
* to mark the packet m with the specified VLAN tag.
*
* On output the driver should check the mbuf for the M_VLANTAG
* flag to see if a VLAN tag is present and valid:
*
* if (m->m_flags & M_VLANTAG) {
* ... = m->m_pkthdr.ether_vtag; // htons()?
* ... pass tag to hardware ...
* }
*
* Note that a driver must indicate it supports hardware VLAN
* stripping/insertion by marking <API key> in
* if_capabilities.
*/
#define VLAN_CAPABILITIES(_ifp) do { \
if ((_ifp)->if_vlantrunk != NULL) \
(*vlan_trunk_cap_p)(_ifp); \
} while (0)
#define VLAN_TRUNKDEV(_ifp) \
(_ifp)->if_type == IFT_L2VLAN ? (*vlan_trunkdev_p)((_ifp)) : NULL
#define VLAN_TAG(_ifp, _tag) \
(_ifp)->if_type == IFT_L2VLAN ? (*vlan_tag_p)((_ifp), (_tag)) : EINVAL
#define VLAN_COOKIE(_ifp) \
(_ifp)->if_type == IFT_L2VLAN ? (*vlan_cookie_p)((_ifp)) : NULL
#define VLAN_SETCOOKIE(_ifp, _cookie) \
(_ifp)->if_type == IFT_L2VLAN ? \
(*vlan_setcookie_p)((_ifp), (_cookie)) : EINVAL
#define VLAN_DEVAT(_ifp, _tag) \
(_ifp)->if_vlantrunk != NULL ? (*vlan_devat_p)((_ifp), (_tag)) : NULL
extern void (*vlan_trunk_cap_p)(struct ifnet *);
extern struct ifnet *(*vlan_trunkdev_p)(struct ifnet *);
extern struct ifnet *(*vlan_devat_p)(struct ifnet *, uint16_t);
extern int (*vlan_tag_p)(struct ifnet *, uint16_t *);
extern int (*vlan_setcookie_p)(struct ifnet *, void *);
extern void *(*vlan_cookie_p)(struct ifnet *);
#endif /* _KERNEL */
#endif /* _NET_IF_VLAN_VAR_H_ */
|
class Headphones < Formula
desc "Automatic music downloader for SABnzbd"
homepage "https://github.com/rembo10/headphones"
url "https://github.com/rembo10/headphones/archive/v0.5.19.tar.gz"
sha256 "<SHA256-like>"
head "https://github.com/rembo10/headphones.git"
bottle do
cellar :any_skip_relocation
sha256 "<SHA256-like>" => :high_sierra
sha256 "<SHA256-like>" => :sierra
sha256 "<SHA256-like>" => :el_capitan
end
depends_on "python@2"
resource "Markdown" do
url "https://files.pythonhosted.org/packages/b3/73/<API key>/Markdown-2.6.11.tar.gz"
sha256 "<SHA256-like>"
end
resource "Cheetah" do
url "https://files.pythonhosted.org/packages/cd/b0/<API key>/Cheetah-2.4.4.tar.gz"
sha256 "<SHA256-like>"
end
def startup_script; <<~EOS
#!/bin/bash
export PYTHONPATH="#{libexec}/lib/python2.7/site-packages:$PYTHONPATH"
python "#{libexec}/Headphones.py" --datadir="#{etc}/headphones" "$@"
EOS
end
def install
# TODO: strip down to the minimal install.
libexec.install Dir["*"]
ENV["<API key>"] = "1"
ENV.prepend_create_path "PYTHONPATH", libexec/"lib/python2.7/site-packages"
resources.each do |r|
r.stage do
system "python", *Language::Python.setup_install_args(libexec)
end
end
(bin/"headphones").write(startup_script)
end
def caveats; <<~EOS
Headphones defaults to port 8181.
EOS
end
plist_options :manual => "headphones"
def plist; <<~EOS
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-
<plist version="1.0">
<dict>
<key>Label</key>
<string>#{plist_name}</string>
<key>ProgramArguments</key>
<array>
<string>#{opt_bin}/headphones</string>
<string>-q</string>
<string>-d</string>
<string>--nolaunch</string>
</array>
<key>RunAtLoad</key>
<true/>
</dict>
</plist>
EOS
end
test do
assert_match "Music add-on", shell_output("#{bin}/headphones -h")
end
end
|
#include "config.h"
#include "JSDOMWindowShell.h"
#include "Frame.h"
#include "GCController.h"
#include "JSDOMWindow.h"
#include "DOMWindow.h"
#include "ScriptController.h"
#include <heap/StrongInlines.h>
#include <runtime/JSObject.h>
using namespace JSC;
namespace WebCore {
const ClassInfo JSDOMWindowShell::s_info = { "JSDOMWindowShell", &Base::s_info, 0, 0, CREATE_METHOD_TABLE(JSDOMWindowShell) };
JSDOMWindowShell::JSDOMWindowShell(VM& vm, Structure* structure, DOMWrapperWorld& world)
: Base(vm, structure)
, m_world(world)
{
}
void JSDOMWindowShell::finishCreation(VM& vm, PassRefPtr<DOMWindow> window)
{
Base::finishCreation(vm);
ASSERT(inherits(info()));
setWindow(window);
}
void JSDOMWindowShell::destroy(JSCell* cell)
{
static_cast<JSDOMWindowShell*>(cell)->JSDOMWindowShell::~JSDOMWindowShell();
}
void JSDOMWindowShell::setWindow(VM& vm, JSDOMWindow* window)
{
ASSERT_ARG(window, window);
setTarget(vm, window);
structure()->setGlobalObject(vm, window);
gcController().garbageCollectSoon();
}
void JSDOMWindowShell::setWindow(PassRefPtr<DOMWindow> domWindow)
{
// Replacing JSDOMWindow via telling JSDOMWindowShell to use the same DOMWindow it already uses makes no sense,
// so we'd better never try to.
ASSERT(!window() || domWindow.get() != &window()->impl());
// Explicitly protect the global object's prototype so it isn't collected
// when we allocate the global object. (Once the global object is fully
// constructed, it can mark its own prototype.)
VM& vm = JSDOMWindow::commonVM();
Structure* prototypeStructure = <API key>::createStructure(vm, 0, jsNull());
Strong<<API key>> prototype(vm, <API key>::create(vm, 0, prototypeStructure));
Structure* structure = JSDOMWindow::createStructure(vm, 0, prototype.get());
JSDOMWindow* jsDOMWindow = JSDOMWindow::create(vm, structure, domWindow, this);
prototype->structure()->setGlobalObject(vm, jsDOMWindow);
setWindow(vm, jsDOMWindow);
ASSERT(jsDOMWindow->globalObject() == jsDOMWindow);
ASSERT(prototype->globalObject() == jsDOMWindow);
}
// JSDOMWindow methods
DOMWindow& JSDOMWindowShell::impl() const
{
return window()->impl();
}
// Conversion methods
JSValue toJS(ExecState* exec, Frame* frame)
{
if (!frame)
return jsNull();
return frame->script().windowShell(currentWorld(exec));
}
JSDOMWindowShell* toJSDOMWindowShell(Frame* frame, DOMWrapperWorld& world)
{
if (!frame)
return 0;
return frame->script().windowShell(world);
}
} // namespace WebCore
|
/**
* @file
* @brief Building block for constructing ring buffers.
*
* @date 19.03.13
* @author Eldar Abusalimov
*/
#ifndef UTIL_RING_H_
#define UTIL_RING_H_
#include <assert.h>
#include <stddef.h>
#include <util/math.h>
struct ring {
size_t head; /* where to write */
size_t tail; /* from where to read */
};
/** Initializes an empty buffer. @return the argument. */
static inline struct ring *ring_init(struct ring *r) {
r->head = r->tail = 0;
return r;
}
static inline void <API key>(struct ring *r, size_t r_size) {
assert(r->head < r_size, "Did you forget to call %s?", "ring_fixup_head");
assert(r->tail < r_size, "Did you forget to call %s?", "ring_fixup_tail");
}
static inline int ring_empty(struct ring *r) {
return (r->head == r->tail);
}
static inline int ring_full(struct ring *r, size_t r_size) {
<API key>(r, r_size);
return r->head == (r->tail ?: r_size) - 1;
}
static inline int ring_wraps(struct ring *r, size_t r_size) {
<API key>(r, r_size);
return (r->head < r->tail);
}
/*
* ring_xxx_size get total amount of data available for reading or writing.
*/
static inline size_t ring_data_size(struct ring *r, size_t r_size) {
size_t data_size = (r->head - r->tail);
if (ring_wraps(r, r_size))
data_size += r_size;
return data_size;
}
static inline size_t ring_room_size(struct ring *r, size_t r_size) {
size_t room_size = (r->tail - r->head - 1);
if (!ring_wraps(r, r_size))
room_size += r_size;
return room_size;
}
/*
* ring_can_xxx tell how many _contiguous_ bytes can be read or written.
*/
/** @return Amount of requested bytes that can be read without wrapping. */
static inline size_t ring_can_read(struct ring *r, size_t r_size,
size_t read_size) {
size_t nwrap_data_end = ring_wraps(r, r_size)
? r_size
: r->head;
return min(read_size, nwrap_data_end - r->tail);
}
/** @return Amount of requested bytes that can be written without wrapping. */
static inline size_t ring_can_write(struct ring *r, size_t r_size,
size_t write_size) {
size_t nwrap_room_end = !ring_wraps(r, r_size)
? r_size - (!r->tail)
: r->tail - 1;
return min(write_size, nwrap_room_end - r->head);
}
/* Mutator methods. */
/*
* ring_fixup_xxx fix head or tail in case of wrapping.
*/
/** @return New value of tail. */
static inline size_t ring_fixup_tail(struct ring *r, size_t r_size) {
if (r->tail >= r_size)
r->tail -= r_size;
return r->tail;
}
/** @return New value of head. */
static inline size_t ring_fixup_head(struct ring *r, size_t r_size) {
if (r->head >= r_size)
r->head -= r_size;
return r->head;
}
/*
* ring_just_xxx must be called after real read/write operation.
* Size of operation must not exceed a value returned by ring_can_xxx.
*/
/** @return The last argument (requested size). */
static inline size_t ring_just_read(struct ring *r, size_t r_size,
size_t read_size) {
assert(read_size <= ring_can_read(r, r_size, read_size));
r->tail += read_size;
ring_fixup_tail(r, r_size);
return read_size;
}
/** @return The last argument (requested size). */
static inline size_t ring_just_write(struct ring *r, size_t r_size,
size_t write_size) {
assert(write_size <= ring_can_write(r, r_size, write_size));
r->head += write_size;
ring_fixup_head(r, r_size);
return write_size;
}
/*
* ring_xxx simply adjust the pointers effectively emulating read or write
* of contiguous bytes.
*/
/** @return How many bytes were read without wrapping. */
extern size_t ring_read(struct ring *r, size_t r_size, size_t read_size);
/** @return How many bytes were written without wrapping. */
extern size_t ring_write(struct ring *r, size_t r_size, size_t write_size);
/*
* The following two functions read/write into/from user-provided buffer,
* handling all available data/room, even wrapped.
*/
/** @return How many bytes were read */
extern size_t ring_read_all_into(struct ring *r,
const char *r_buff, size_t r_size,
char *into_buff, size_t read_size);
/** @return How many bytes were written */
extern size_t ring_write_all_from(struct ring *r,
char *r_buff, size_t r_size,
const char *from_buff, size_t write_size);
#endif /* UTIL_RING_H_ */
|
#include <gtest/gtest.h>
#include <platform.h>
#include <ast/parserapi.h>
#include <ast/source.h>
#include "util.h"
|
class Cmor < Formula
desc "Climate Model Output Rewriter for producing CF-compliant netCDF files"
homepage "http://www2-pcmdi.llnl.gov/cmor"
url "https://github.com/PCMDI/cmor/archive/3.1.2.tar.gz"
sha256 "<SHA256-like>"
# doi "10.5281/zenodo.61943"
bottle do
sha256 "<SHA256-like>" => :el_capitan
sha256 "<SHA256-like>" => :yosemite
sha256 "<SHA256-like>" => :mavericks
end
depends_on "ossp-uuid"
depends_on "udunits"
depends_on "netcdf" => "with-fortran"
depends_on :fortran
def install
ENV.append "CFLAGS", "-Wno-error=<API key>"
inreplace "configure", "${with_uuid}/include", "${with_uuid}/include/ossp"
args = %W[
--prefix=#{prefix}
--with-uuid=#{Formula["ossp-uuid"].opt_prefix}
--with-udunits2=#{Formula["udunits"].opt_prefix}
--with-netcdf=#{Formula["netcdf"].opt_prefix}
]
system "./configure", *args
system "make", "install"
pkgshare.install "Test"
end
end
|
# Continuous audiorecorder
Implementation of the missing feature in Android SDK: audio recorder with a pause. Based on [mp4parser](https://code.google.com/p/mp4parser/).
Build status: [
## Import
Just copy the `recorder` module into your project and add new dependency:
dependencies {
compile project(':recorder')
}
## Usage
Start recording:
AudioRecorder recorder = AudioRecorder.build(context, filename);
recorder.start(new AudioRecorder.OnStartListener() {
@Override
public void onStarted() {
// started
}
@Override
public void onException(Exception e) {
// error
}
});
Pause:
mAudioRecorder.pause(new AudioRecorder.OnPauseListener() {
@Override
public void onPaused(String <API key>) {
// paused
}
@Override
public void onException(Exception e) {
// error
}
});
Use `start()` method to continue recording.
This project is licensed under the FreeBSD License.
|
#ifndef <API key>
#define <API key>
#include "cc/base/cc_export.h"
#include "cc/output/filter_operations.h"
#include "third_party/skia/include/core/SkXfermode.h"
#include "ui/gfx/geometry/point_f.h"
#include "ui/gfx/geometry/size_f.h"
namespace base {
namespace trace_event {
class TracedValue;
} // namespace trace_event
} // namespace base
namespace cc {
class RenderSurfaceImpl;
namespace proto {
class TreeNode;
} // namespace proto
struct CC_EXPORT EffectNode {
EffectNode();
EffectNode(const EffectNode& other);
int id;
int parent_id;
int owner_id;
float opacity;
float <API key>;
FilterOperations filters;
FilterOperations background_filters;
gfx::PointF filters_origin;
SkXfermode::Mode blend_mode;
gfx::Vector2dF <API key>;
gfx::Size <API key>;
bool has_render_surface;
RenderSurfaceImpl* render_surface;
bool has_copy_request;
bool <API key>;
bool double_sided;
bool is_drawn;
// TODO(jaydasika) : Delete this after implementation of
// <API key> is cleaned up. (crbug.com/595843)
bool subtree_hidden;
bool <API key>;
bool <API key>;
bool <API key>;
bool <API key>;
// We need to track changes to effects on the compositor to compute damage
// rect.
bool effect_changed;
int <API key>;
bool <API key>;
int transform_id;
int clip_id;
// Effect node id of which this effect contributes to.
int target_id;
int mask_layer_id;
bool operator==(const EffectNode& other) const;
void ToProtobuf(proto::TreeNode* proto) const;
void FromProtobuf(const proto::TreeNode& proto);
void AsValueInto(base::trace_event::TracedValue* value) const;
};
} // namespace cc
#endif // <API key>
|
# $FreeBSD: soc2013/dpl/head/tools/tools/aac/Makefile 219565 2011-03-11 18:51:42Z brucec $
PROG= aac_checkq
NO_MAN=
WARNS?=6
BINDIR?=/usr/local/bin
.include <bsd.prog.mk>
|
import {describe,
beforeEach,
it,
expect,
iit,
ddescribe,
el} from 'angular2/test_lib';
import {ListWrapper,
List,
MapWrapper} from 'angular2/src/facade/collection';
import {DOM} from 'angular2/src/dom/dom_adapter';
import {isPresent,
NumberWrapper,
StringWrapper} from 'angular2/src/facade/lang';
import {CompilePipeline} from 'angular2/src/render/dom/compiler/compile_pipeline';
import {CompileElement} from 'angular2/src/render/dom/compiler/compile_element';
import {CompileStep} from 'angular2/src/render/dom/compiler/compile_step';
import {CompileControl} from 'angular2/src/render/dom/compiler/compile_control';
import {ProtoViewBuilder} from 'angular2/src/render/dom/view/proto_view_builder';
export function main() {
describe('compile_pipeline', () => {
describe('children compilation', () => {
it('should walk the tree in depth first order including template contents', () => {
var element = el('<div id="1"><template id="2"><span id="3"></span></template></div>');
var step0Log = [];
var results = new CompilePipeline([createLoggerStep(step0Log)]).process(element);
expect(step0Log).toEqual(['1', '1<2', '2<3']);
expect(resultIdLog(results)).toEqual(['1', '2', '3']);
});
it('should stop walking the tree when compileChildren is false', () => {
var element = el('<div id="1"><template id="2" ignore-children><span id="3"></span></template></div>');
var step0Log = [];
var pipeline = new CompilePipeline([new IgnoreChildrenStep(), createLoggerStep(step0Log)]);
var results = pipeline.process(element);
expect(step0Log).toEqual(['1', '1<2']);
expect(resultIdLog(results)).toEqual(['1', '2']);
});
});
it('should inherit protoViewBuilders to children', () => {
var element = el('<div><div><span viewroot><span></span></span></div></div>');
var pipeline = new CompilePipeline([new MockStep((parent, current, control) => {
if (isPresent(DOM.getAttribute(current.element, 'viewroot'))) {
current.inheritedProtoView = new ProtoViewBuilder(current.element);
}
})]);
var results = pipeline.process(element);
expect(results[0].inheritedProtoView).toBe(results[1].inheritedProtoView);
expect(results[2].inheritedProtoView).toBe(results[3].inheritedProtoView);
});
it('should inherit <API key> to children', () => {
var element = el('<div bind><div><span bind><span></span></span></div></div>');
var pipeline = new CompilePipeline([new MockStep((parent, current, control) => {
if (isPresent(DOM.getAttribute(current.element, 'bind'))) {
current.bindElement();
}
})]);
var results = pipeline.process(element);
expect(results[0].<API key>).toBe(results[1].<API key>);
expect(results[2].<API key>).toBe(results[3].<API key>);
});
it('should mark root elements as viewRoot', () => {
var rootElement = el('<div></div>');
var results = new CompilePipeline([]).process(rootElement);
expect(results[0].isViewRoot).toBe(true);
});
it('should calculate distanceToParent / parent correctly', () => {
var element = el('<div bind><div bind></div><div><div bind></div></div></div>');
var pipeline = new CompilePipeline([new MockStep((parent, current, control) => {
if (isPresent(DOM.getAttribute(current.element, 'bind'))) {
current.bindElement();
}
})]);
var results = pipeline.process(element);
expect(results[0].<API key>.distanceToParent).toBe(0);
expect(results[1].<API key>.distanceToParent).toBe(1);
expect(results[3].<API key>.distanceToParent).toBe(2);
expect(results[1].<API key>.parent).toBe(results[0].<API key>);
expect(results[3].<API key>.parent).toBe(results[0].<API key>);
});
describe('control.addParent', () => {
it('should report the new parent to the following processor and the result', () => {
var element = el('<div id="1"><span wrap0="1" id="2"><b id="3"></b></span></div>');
var step0Log = [];
var step1Log = [];
var pipeline = new CompilePipeline([createWrapperStep('wrap0', step0Log), createLoggerStep(step1Log)]);
var result = pipeline.process(element);
expect(step0Log).toEqual(['1', '1<2', '2<3']);
expect(step1Log).toEqual(['1', '1<wrap0#0', 'wrap0#0<2', '2<3']);
expect(resultIdLog(result)).toEqual(['1', 'wrap0#0', '2', '3']);
});
it('should allow to add a parent by multiple processors to the same element', () => {
var element = el('<div id="1"><span wrap0="1" wrap1="1" id="2"><b id="3"></b></span></div>');
var step0Log = [];
var step1Log = [];
var step2Log = [];
var pipeline = new CompilePipeline([createWrapperStep('wrap0', step0Log), createWrapperStep('wrap1', step1Log), createLoggerStep(step2Log)]);
var result = pipeline.process(element);
expect(step0Log).toEqual(['1', '1<2', '2<3']);
expect(step1Log).toEqual(['1', '1<wrap0#0', 'wrap0#0<2', '2<3']);
expect(step2Log).toEqual(['1', '1<wrap0#0', 'wrap0#0<wrap1#0', 'wrap1#0<2', '2<3']);
expect(resultIdLog(result)).toEqual(['1', 'wrap0#0', 'wrap1#0', '2', '3']);
});
it('should allow to add a parent by multiple processors to different elements', () => {
var element = el('<div id="1"><span wrap0="1" id="2"><b id="3" wrap1="1"></b></span></div>');
var step0Log = [];
var step1Log = [];
var step2Log = [];
var pipeline = new CompilePipeline([createWrapperStep('wrap0', step0Log), createWrapperStep('wrap1', step1Log), createLoggerStep(step2Log)]);
var result = pipeline.process(element);
expect(step0Log).toEqual(['1', '1<2', '2<3']);
expect(step1Log).toEqual(['1', '1<wrap0#0', 'wrap0#0<2', '2<3']);
expect(step2Log).toEqual(['1', '1<wrap0#0', 'wrap0#0<2', '2<wrap1#0', 'wrap1#0<3']);
expect(resultIdLog(result)).toEqual(['1', 'wrap0#0', '2', 'wrap1#0', '3']);
});
it('should allow to add multiple parents by the same processor', () => {
var element = el('<div id="1"><span wrap0="2" id="2"><b id="3"></b></span></div>');
var step0Log = [];
var step1Log = [];
var pipeline = new CompilePipeline([createWrapperStep('wrap0', step0Log), createLoggerStep(step1Log)]);
var result = pipeline.process(element);
expect(step0Log).toEqual(['1', '1<2', '2<3']);
expect(step1Log).toEqual(['1', '1<wrap0#0', 'wrap0#0<wrap0#1', 'wrap0#1<2', '2<3']);
expect(resultIdLog(result)).toEqual(['1', 'wrap0#0', 'wrap0#1', '2', '3']);
});
});
describe('control.addChild', () => {
it('should report the new child to all processors and the result', () => {
var element = el('<div id="1"><div id="2"></div></div>');
var resultLog = [];
var newChild = new CompileElement(el('<div id="3"></div>'));
var pipeline = new CompilePipeline([new MockStep((parent, current, control) => {
if (StringWrapper.equals(DOM.getAttribute(current.element, 'id'), '1')) {
control.addChild(newChild);
}
}), createLoggerStep(resultLog)]);
var result = pipeline.process(element);
expect(result[2]).toBe(newChild);
expect(resultLog).toEqual(['1', '1<2', '1<3']);
expect(resultIdLog(result)).toEqual(['1', '2', '3']);
});
});
});
}
class MockStep extends CompileStep {
constructor(process) {
super();
this.processClosure = process;
}
process(parent, current, control) {
this.processClosure(parent, current, control);
}
}
Object.defineProperty(MockStep.prototype.process, "parameters", {get: function() {
return [[CompileElement], [CompileElement], [CompileControl]];
}});
export class IgnoreChildrenStep extends CompileStep {
process(parent, current, control) {
var attributeMap = DOM.attributeMap(current.element);
if (MapWrapper.contains(attributeMap, 'ignore-children')) {
current.compileChildren = false;
}
}
}
Object.defineProperty(IgnoreChildrenStep.prototype.process, "parameters", {get: function() {
return [[CompileElement], [CompileElement], [CompileControl]];
}});
function logEntry(log, parent, current) {
var parentId = '';
if (isPresent(parent)) {
parentId = DOM.getAttribute(parent.element, 'id') + '<';
}
ListWrapper.push(log, parentId + DOM.getAttribute(current.element, 'id'));
}
function createLoggerStep(log) {
return new MockStep((parent, current, control) => {
logEntry(log, parent, current);
});
}
function createWrapperStep(wrapperId, log) {
var nextElementId = 0;
return new MockStep((parent, current, control) => {
var parentCountStr = DOM.getAttribute(current.element, wrapperId);
if (isPresent(parentCountStr)) {
var parentCount = NumberWrapper.parseInt(parentCountStr, 10);
while (parentCount > 0) {
control.addParent(new CompileElement(el(`<a id="${wrapperId}#${nextElementId++}"></a>`)));
parentCount
}
}
logEntry(log, parent, current);
});
}
function resultIdLog(result) {
var idLog = [];
ListWrapper.forEach(result, (current) => {
logEntry(idLog, null, current);
});
return idLog;
}
//# sourceMappingURL=pipeline_spec.js.map
//# sourceMappingURL=./pipeline_spec.map
|
class Asciidoc < Formula
include Language::Python::Shebang
desc "Formatter/translator for text files to numerous formats. Includes a2x"
homepage "https://asciidoc.org/"
url "https://github.com/asciidoc/asciidoc-py3/archive/9.0.2.tar.gz"
sha256 "<SHA256-like>"
license "GPL-2.0"
head "https://github.com/asciidoc/asciidoc-py3.git"
bottle do
cellar :any_skip_relocation
sha256 "<SHA256-like>" => :catalina
sha256 "<SHA256-like>" => :mojave
sha256 "<SHA256-like>" => :high_sierra
sha256 "<SHA256-like>" => :x86_64_linux
end
depends_on "autoconf" => :build
depends_on "docbook-xsl" => :build
depends_on "docbook"
depends_on "python@3.8"
depends_on "source-highlight"
uses_from_macos "libxml2" => :build
uses_from_macos "libxslt" => :build
on_linux do
depends_on "xmlto" => :build
end
def install
ENV["XML_CATALOG_FILES"] = etc/"xml/catalog"
system "autoconf"
system "./configure", "--prefix=#{prefix}"
%w[
a2x.py asciidoc.py filters/code/code-filter.py
filters/graphviz/graphviz2png.py filters/latex/latex2img.py
filters/music/music2png.py filters/unwraplatex.py
].map { |f| rewrite_shebang <API key>, f }
# otherwise macOS's xmllint bails out
inreplace "Makefile", "-f manpage", "-f manpage -L" if OS.mac?
system "make", "install"
system "make", "docs"
end
def caveats
<<~EOS
If you intend to process AsciiDoc files through an XML stage
(such as a2x for manpage generation) you need to add something
like:
export XML_CATALOG_FILES=#{etc}/xml/catalog
to your shell rc file so that xmllint can find AsciiDoc's
catalog files.
See `man 1 xmllint' for more.
EOS
end
test do
(testpath/"test.txt").write("== Hello World!")
system "#{bin}/asciidoc", "-b", "html5", "-o", "test.html", "test.txt"
assert_match %r{<h2 id="_hello_world">Hello World!</h2>}, File.read("test.html")
end
end
|
class Trailscraper < Formula
include Language::Python::Virtualenv
desc "Tool to get valuable information out of AWS CloudTrail"
homepage "https://github.com/flosell/trailscraper"
url "https://github.com/flosell/trailscraper/archive/0.6.4.tar.gz"
sha256 "<SHA256-like>"
license "Apache-2.0"
revision 1
bottle do
cellar :any_skip_relocation
sha256 "<SHA256-like>" => :catalina
sha256 "<SHA256-like>" => :mojave
sha256 "<SHA256-like>" => :high_sierra
end
depends_on "python@3.9"
resource "boto3" do
url "https://files.pythonhosted.org/packages/2b/56/<API key>/boto3-1.14.14.tar.gz"
sha256 "<SHA256-like>"
end
resource "botocore" do
url "https://files.pythonhosted.org/packages/98/89/<API key>/botocore-1.17.20.tar.gz"
sha256 "<SHA256-like>"
end
resource "click" do
url "https://files.pythonhosted.org/packages/27/6f/<API key>/click-7.1.2.tar.gz"
sha256 "<SHA256-like>"
end
resource "dateparser" do
url "https://files.pythonhosted.org/packages/86/6e/<API key>/dateparser-0.7.6.tar.gz"
sha256 "<SHA256-like>"
end
resource "docutils" do
url "https://files.pythonhosted.org/packages/93/22/<API key>/docutils-0.15.2.tar.gz"
sha256 "<SHA256-like>"
end
resource "jmespath" do
url "https://files.pythonhosted.org/packages/3c/56/<API key>/jmespath-0.10.0.tar.gz"
sha256 "<SHA256-like>"
end
resource "python-dateutil" do
url "https://files.pythonhosted.org/packages/be/ed/<API key>/python-dateutil-2.8.1.tar.gz"
sha256 "<SHA256-like>"
end
resource "pytz" do
url "https://files.pythonhosted.org/packages/f4/f6/<API key>/pytz-2020.1.tar.gz"
sha256 "<SHA256-like>"
end
resource "regex" do
url "https://files.pythonhosted.org/packages/b8/7b/<API key>/regex-2020.6.8.tar.gz"
sha256 "<SHA256-like>"
end
resource "ruamel.yaml" do
url "https://files.pythonhosted.org/packages/16/8b/<API key>/ruamel.yaml-0.16.10.tar.gz"
sha256 "<SHA256-like>"
end
resource "ruamel.yaml.clib" do
url "https://files.pythonhosted.org/packages/92/28/<API key>/ruamel.yaml.clib-0.2.0.tar.gz"
sha256 "<SHA256-like>"
end
resource "s3transfer" do
url "https://files.pythonhosted.org/packages/50/de/<API key>/s3transfer-0.3.3.tar.gz"
sha256 "<SHA256-like>"
end
resource "six" do
url "https://files.pythonhosted.org/packages/6b/34/<API key>/six-1.15.0.tar.gz"
sha256 "<SHA256-like>"
end
resource "toolz" do
url "https://files.pythonhosted.org/packages/22/8e/<API key>/toolz-0.10.0.tar.gz"
sha256 "<SHA256-like>"
end
resource "tzlocal" do
url "https://files.pythonhosted.org/packages/ce/73/<API key>/tzlocal-2.1.tar.gz"
sha256 "<SHA256-like>"
end
resource "urllib3" do
url "https://files.pythonhosted.org/packages/05/8c/<API key>/urllib3-1.25.9.tar.gz"
sha256 "<SHA256-like>"
end
def install
<API key>
end
test do
assert_match version.to_s, shell_output("#{bin}/trailscraper --version")
test_input = '{"Records": []}'
output = shell_output("echo '#{test_input}' | trailscraper generate")
assert_match "Statement", output
end
end
|
// console.log(__filename)
var assert = require('../../src/nodejs/scripts/assert.js'); //adds assert.run function
var qm = require('qminer');
describe('BTree Integer Search Tests', function () {
var base = undefined;
var store = undefined;
beforeEach(function () {
qm.delLock();
base = new qm.Base({mode: 'createClean'});
// prepare test set
base.createStore({
'name': 'BTreeSearchTest',
'fields': [
{ 'name': 'Value', 'type': 'int' },
{ 'name': 'ForSort', 'type': 'float' }
],
'joins': [],
'keys': [
{ field: 'Value', type: 'linear' }
]
});
store = base.store('BTreeSearchTest');
for (var i = 0; i < 100; i++) {
store.push({ Value: i % 10, ForSort: Math.random() });
}
});
afterEach(function () {
base.close();
});
describe('Tests of base.search after initial push', function () {
it('returns all elements >= 5', function () {
var result = base.search({ $from: 'BTreeSearchTest', Value: { $gt: 5}});
assert.equal(result.length, 50);
result.each(function (rec) { assert.equal(rec.Value >= 5, true); });
})
it('returns all elements <= 6', function () {
var result = base.search({ $from: 'BTreeSearchTest', Value: { $lt: 6}});
assert.equal(result.length, 70);
result.each(function (rec) { assert.equal(rec.Value <= 6, true); });
})
it('returns all elements >= 5 and <= 6', function () {
var result = base.search({ $from: 'BTreeSearchTest', Value: { $gt: 5, $lt: 6}});
assert.equal(result.length, 20);
result.each(function (rec) { assert.equal(rec.Value >= 5, true); });
result.each(function (rec) { assert.equal(rec.Value <= 6, true); });
})
it('returns all elements >= 5 and <= 6 and sort according to ForSort field', function () {
var result = base.search({ $from: 'BTreeSearchTest', $sort: {ForSort: 1}, Value: { $gt: 5, $lt: 6}});
assert.equal(result.length, 20);
result.each(function (rec) { assert.equal(rec.Value >= 5, true); });
result.each(function (rec) { assert.equal(rec.Value <= 6, true); });
for (var i = 1; i < result.length; i++) {
assert.equal(result[i-1].ForSort < result[i].ForSort, true);
}
})
it('returns all elements == 5', function () {
var result = base.search({ $from: 'BTreeSearchTest', Value: 5});
assert.equal(result.length, 10);
result.each(function (rec) { assert.equal(rec.Value == 5, true); });
})
it('returns all elements', function () {
var result = base.search({ $from: 'BTreeSearchTest', Value: { }});
assert.equal(result.length, 100);
})
it('returns no elements', function () {
var result = base.search({ $from: 'BTreeSearchTest', Value: -5});
assert.equal(result.length, 0);
})
});
describe('Tests after serialization and deserialization', function () {
it('returns all elements >= 5', function () {
base.close();
base = new qm.Base({ mode: 'open'});
var result = base.search({ $from: 'BTreeSearchTest', Value: { $gt: 5}});
assert.equal(result.length, 50);
result.each(function (rec) { assert.equal(rec.Value >= 5, true); });
})
it('returns all elements <= 6', function () {
base.close();
base = new qm.Base({ mode: 'open'});
var result = base.search({ $from: 'BTreeSearchTest', Value: { $lt: 6}});
assert.equal(result.length, 70);
result.each(function (rec) { assert.equal(rec.Value <= 6, true); });
})
it('returns all elements >= 5 and <= 6', function () {
base.close();
base = new qm.Base({ mode: 'open'});
var result = base.search({ $from: 'BTreeSearchTest', Value: { $gt: 5, $lt: 6}});
assert.equal(result.length, 20);
result.each(function (rec) { assert.equal(rec.Value >= 5, true); });
result.each(function (rec) { assert.equal(rec.Value <= 6, true); });
})
it('returns all elements == 5', function () {
base.close();
base = new qm.Base({ mode: 'open'});
var result = base.search({ $from: 'BTreeSearchTest', Value: 5});
assert.equal(result.length, 10);
result.each(function (rec) { assert.equal(rec.Value == 5, true); });
})
it('returns all elements', function () {
base.close();
base = new qm.Base({ mode: 'open'});
var result = base.search({ $from: 'BTreeSearchTest', Value: { }});
assert.equal(result.length, 100);
})
it('returns no elements', function () {
base.close();
base = new qm.Base({ mode: 'open'});
var result = base.search({ $from: 'BTreeSearchTest', Value: -5});
assert.equal(result.length, 0);
})
});
describe('Tests of base.search after deleting 50 records', function () {
it('returns all elements >= 5', function () {
store.clear(50);
var result = base.search({ $from: 'BTreeSearchTest', Value: { $gt: 5}});
assert.equal(result.length, 25);
result.each(function (rec) { assert.equal(rec.Value >= 5, true); });
})
it('returns all elements <= 6', function () {
store.clear(50);
var result = base.search({ $from: 'BTreeSearchTest', Value: { $lt: 6}});
assert.equal(result.length, 35);
result.each(function (rec) { assert.equal(rec.Value <= 6, true); });
})
it('returns all elements >= 5 and <= 6', function () {
store.clear(50);
var result = base.search({ $from: 'BTreeSearchTest', Value: { $gt: 5, $lt: 6}});
assert.equal(result.length, 10);
result.each(function (rec) { assert.equal(rec.Value >= 5, true); });
result.each(function (rec) { assert.equal(rec.Value <= 6, true); });
})
it('returns all elements == 5', function () {
store.clear(50);
var result = base.search({ $from: 'BTreeSearchTest', Value: 5});
assert.equal(result.length, 5);
result.each(function (rec) { assert.equal(rec.Value == 5, true); });
})
it('returns all elements', function () {
store.clear(50);
var result = base.search({ $from: 'BTreeSearchTest', Value: { }});
assert.equal(result.length, 50);
})
it('returns no elements', function () {
store.clear(50);
var result = base.search({ $from: 'BTreeSearchTest', Value: -5});
assert.equal(result.length, 0);
})
});
describe('Tests of base.search after changing rec.Value += 1', function () {
it('returns all elements >= 5', function () {
store.each(function (rec) { rec.Value = rec.Value + 1; });
var result = base.search({ $from: 'BTreeSearchTest', Value: { $gt: 5}});
assert.equal(result.length, 60);
result.each(function (rec) { assert.equal(rec.Value >= 5, true); });
})
it('returns all elements <= 6', function () {
store.each(function (rec) { rec.Value = rec.Value + 1; });
var result = base.search({ $from: 'BTreeSearchTest', Value: { $lt: 6}});
assert.equal(result.length, 60);
result.each(function (rec) { assert.equal(rec.Value <= 6, true); });
})
it('returns all elements >= 5 and <= 6', function () {
store.each(function (rec) { rec.Value = rec.Value + 1; });
var result = base.search({ $from: 'BTreeSearchTest', Value: { $gt: 5, $lt: 6}});
assert.equal(result.length, 20);
result.each(function (rec) { assert.equal(rec.Value >= 5, true); });
result.each(function (rec) { assert.equal(rec.Value <= 6, true); });
})
it('returns all elements == 5', function () {
store.each(function (rec) { rec.Value = rec.Value + 1; });
var result = base.search({ $from: 'BTreeSearchTest', Value: 5});
assert.equal(result.length, 10);
result.each(function (rec) { assert.equal(rec.Value == 5, true); });
})
it('returns all elements', function () {
store.each(function (rec) { rec.Value = rec.Value + 1; });
var result = base.search({ $from: 'BTreeSearchTest', Value: { }});
assert.equal(result.length, 100);
})
it('returns no elements', function () {
store.each(function (rec) { rec.Value = rec.Value + 1; });
var result = base.search({ $from: 'BTreeSearchTest', Value: 0});
assert.equal(result.length, 0);
})
});
});
describe('BTree UInt64 Search Tests', function () {
var base = undefined;
var store = undefined;
beforeEach(function () {
qm.delLock();
base = new qm.Base({mode: 'createClean'});
// prepare test set
base.createStore({
'name': 'BTreeSearchTest',
'fields': [
{ 'name': 'Value', 'type': 'uint64' },
{ 'name': 'ForSort', 'type': 'float' }
],
'joins': [],
'keys': [
{ field: 'Value', type: 'linear' }
]
});
store = base.store('BTreeSearchTest');
for (var i = 0; i < 100; i++) {
store.push({ Value: i % 10, ForSort: Math.random() });
}
});
afterEach(function () {
base.close();
});
describe('Tests of base.search after initial push', function () {
it('returns all elements >= 5', function () {
var result = base.search({ $from: 'BTreeSearchTest', Value: { $gt: 5}});
assert.equal(result.length, 50);
result.each(function (rec) { assert.equal(rec.Value >= 5, true); });
})
it('returns all elements <= 6', function () {
var result = base.search({ $from: 'BTreeSearchTest', Value: { $lt: 6}});
assert.equal(result.length, 70);
result.each(function (rec) { assert.equal(rec.Value <= 6, true); });
})
it('returns all elements >= 5 and <= 6', function () {
var result = base.search({ $from: 'BTreeSearchTest', Value: { $gt: 5, $lt: 6}});
assert.equal(result.length, 20);
result.each(function (rec) { assert.equal(rec.Value >= 5, true); });
result.each(function (rec) { assert.equal(rec.Value <= 6, true); });
})
it('returns all elements >= 5 and <= 6 and sort according to ForSort field', function () {
var result = base.search({ $from: 'BTreeSearchTest', $sort: {ForSort: 1}, Value: { $gt: 5, $lt: 6}});
assert.equal(result.length, 20);
result.each(function (rec) { assert.equal(rec.Value >= 5, true); });
result.each(function (rec) { assert.equal(rec.Value <= 6, true); });
for (var i = 1; i < result.length; i++) {
assert.equal(result[i-1].ForSort < result[i].ForSort, true);
}
})
it('returns all elements == 5', function () {
var result = base.search({ $from: 'BTreeSearchTest', Value: 5});
assert.equal(result.length, 10);
result.each(function (rec) { assert.equal(rec.Value == 5, true); });
})
it('returns all elements', function () {
var result = base.search({ $from: 'BTreeSearchTest', Value: { }});
assert.equal(result.length, 100);
})
it('returns no elements', function () {
var result = base.search({ $from: 'BTreeSearchTest', Value: -5});
assert.equal(result.length, 0);
})
});
describe('Tests after serialization and deserialization', function () {
it('returns all elements >= 5', function () {
base.close();
base = new qm.Base({ mode: 'open'});
var result = base.search({ $from: 'BTreeSearchTest', Value: { $gt: 5}});
assert.equal(result.length, 50);
result.each(function (rec) { assert.equal(rec.Value >= 5, true); });
})
it('returns all elements <= 6', function () {
base.close();
base = new qm.Base({ mode: 'open'});
var result = base.search({ $from: 'BTreeSearchTest', Value: { $lt: 6}});
assert.equal(result.length, 70);
result.each(function (rec) { assert.equal(rec.Value <= 6, true); });
})
it('returns all elements >= 5 and <= 6', function () {
base.close();
base = new qm.Base({ mode: 'open'});
var result = base.search({ $from: 'BTreeSearchTest', Value: { $gt: 5, $lt: 6}});
assert.equal(result.length, 20);
result.each(function (rec) { assert.equal(rec.Value >= 5, true); });
result.each(function (rec) { assert.equal(rec.Value <= 6, true); });
})
it('returns all elements == 5', function () {
base.close();
base = new qm.Base({ mode: 'open'});
var result = base.search({ $from: 'BTreeSearchTest', Value: 5});
assert.equal(result.length, 10);
result.each(function (rec) { assert.equal(rec.Value == 5, true); });
})
it('returns all elements', function () {
base.close();
base = new qm.Base({ mode: 'open'});
var result = base.search({ $from: 'BTreeSearchTest', Value: { }});
assert.equal(result.length, 100);
})
it('returns no elements', function () {
base.close();
base = new qm.Base({ mode: 'open'});
var result = base.search({ $from: 'BTreeSearchTest', Value: -5});
assert.equal(result.length, 0);
})
});
describe('Tests of base.search after deleting 50 records', function () {
it('returns all elements >= 5', function () {
store.clear(50);
var result = base.search({ $from: 'BTreeSearchTest', Value: { $gt: 5}});
assert.equal(result.length, 25);
result.each(function (rec) { assert.equal(rec.Value >= 5, true); });
})
it('returns all elements <= 6', function () {
store.clear(50);
var result = base.search({ $from: 'BTreeSearchTest', Value: { $lt: 6}});
assert.equal(result.length, 35);
result.each(function (rec) { assert.equal(rec.Value <= 6, true); });
})
it('returns all elements >= 5 and <= 6', function () {
store.clear(50);
var result = base.search({ $from: 'BTreeSearchTest', Value: { $gt: 5, $lt: 6}});
assert.equal(result.length, 10);
result.each(function (rec) { assert.equal(rec.Value >= 5, true); });
result.each(function (rec) { assert.equal(rec.Value <= 6, true); });
})
it('returns all elements == 5', function () {
store.clear(50);
var result = base.search({ $from: 'BTreeSearchTest', Value: 5});
assert.equal(result.length, 5);
result.each(function (rec) { assert.equal(rec.Value == 5, true); });
})
it('returns all elements', function () {
store.clear(50);
var result = base.search({ $from: 'BTreeSearchTest', Value: { }});
assert.equal(result.length, 50);
})
it('returns no elements', function () {
store.clear(50);
var result = base.search({ $from: 'BTreeSearchTest', Value: -5});
assert.equal(result.length, 0);
})
});
describe('Tests of base.search after changing rec.Value += 1', function () {
it('returns all elements >= 5', function () {
store.each(function (rec) { rec.Value = rec.Value + 1; });
var result = base.search({ $from: 'BTreeSearchTest', Value: { $gt: 5}});
assert.equal(result.length, 60);
result.each(function (rec) { assert.equal(rec.Value >= 5, true); });
})
it('returns all elements <= 6', function () {
store.each(function (rec) { rec.Value = rec.Value + 1; });
var result = base.search({ $from: 'BTreeSearchTest', Value: { $lt: 6}});
assert.equal(result.length, 60);
result.each(function (rec) { assert.equal(rec.Value <= 6, true); });
})
it('returns all elements >= 5 and <= 6', function () {
store.each(function (rec) { rec.Value = rec.Value + 1; });
var result = base.search({ $from: 'BTreeSearchTest', Value: { $gt: 5, $lt: 6}});
assert.equal(result.length, 20);
result.each(function (rec) { assert.equal(rec.Value >= 5, true); });
result.each(function (rec) { assert.equal(rec.Value <= 6, true); });
})
it('returns all elements == 5', function () {
store.each(function (rec) { rec.Value = rec.Value + 1; });
var result = base.search({ $from: 'BTreeSearchTest', Value: 5});
assert.equal(result.length, 10);
result.each(function (rec) { assert.equal(rec.Value == 5, true); });
})
it('returns all elements', function () {
store.each(function (rec) { rec.Value = rec.Value + 1; });
var result = base.search({ $from: 'BTreeSearchTest', Value: { }});
assert.equal(result.length, 100);
})
it('returns no elements', function () {
store.each(function (rec) { rec.Value = rec.Value + 1; });
var result = base.search({ $from: 'BTreeSearchTest', Value: 0});
assert.equal(result.length, 0);
})
});
});
describe('BTree Float Search Tests', function () {
var base = undefined;
var store = undefined;
beforeEach(function () {
qm.delLock();
base = new qm.Base({mode: 'createClean'});
// prepare test set
base.createStore({
'name': 'BTreeSearchTest',
'fields': [
{ 'name': 'Value', 'type': 'float' },
{ 'name': 'ForSort', 'type': 'float' }
],
'joins': [],
'keys': [
{ field: 'Value', type: 'linear' }
]
});
store = base.store('BTreeSearchTest');
for (var i = 0; i < 100; i++) {
store.push({ Value: (i % 10) + 0.123, ForSort: Math.random() });
}
});
afterEach(function () {
base.close();
});
describe('Tests of base.search after initial push', function () {
it('returns all elements >= 5', function () {
var result = base.search({ $from: 'BTreeSearchTest', Value: { $gt: 5}});
assert.equal(result.length, 50);
result.each(function (rec) { assert.equal(rec.Value >= 5, true); });
})
it('returns all elements <= 6', function () {
var result = base.search({ $from: 'BTreeSearchTest', Value: { $lt: 6}});
assert.equal(result.length, 60);
result.each(function (rec) { assert.equal(rec.Value <= 6, true); });
})
it('returns all elements >= 5 and <= 6', function () {
var result = base.search({ $from: 'BTreeSearchTest', Value: { $gt: 5, $lt: 6}});
assert.equal(result.length, 10);
result.each(function (rec) { assert.equal(rec.Value >= 5, true); });
result.each(function (rec) { assert.equal(rec.Value <= 6, true); });
})
it('returns all elements >= 5 and <= 6 and sort according to ForSort field', function () {
var result = base.search({ $from: 'BTreeSearchTest', $sort: {ForSort: 1}, Value: { $gt: 5, $lt: 6}});
assert.equal(result.length, 10);
result.each(function (rec) { assert.equal(rec.Value >= 5, true); });
result.each(function (rec) { assert.equal(rec.Value <= 6, true); });
for (var i = 1; i < result.length; i++) {
assert.equal(result[i-1].ForSort < result[i].ForSort, true);
}
})
it('returns all elements == 5.123', function () {
var result = base.search({ $from: 'BTreeSearchTest', Value: 5.123});
assert.equal(result.length, 10);
result.each(function (rec) { assert.equal(rec.Value == 5.123, true); });
})
it('returns all elements', function () {
var result = base.search({ $from: 'BTreeSearchTest', Value: { }});
assert.equal(result.length, 100);
})
it('returns no elements', function () {
var result = base.search({ $from: 'BTreeSearchTest', Value: -5});
assert.equal(result.length, 0);
})
});
describe('Tests after serialization and deserialization', function () {
it('returns all elements >= 5', function () {
base.close();
base = new qm.Base({ mode: 'open'});
var result = base.search({ $from: 'BTreeSearchTest', Value: { $gt: 5}});
assert.equal(result.length, 50);
result.each(function (rec) { assert.equal(rec.Value >= 5, true); });
})
it('returns all elements <= 6', function () {
base.close();
base = new qm.Base({ mode: 'open'});
var result = base.search({ $from: 'BTreeSearchTest', Value: { $lt: 6}});
assert.equal(result.length, 60);
result.each(function (rec) { assert.equal(rec.Value <= 6, true); });
})
it('returns all elements >= 5 and <= 6', function () {
base.close();
base = new qm.Base({ mode: 'open'});
var result = base.search({ $from: 'BTreeSearchTest', Value: { $gt: 5, $lt: 6}});
assert.equal(result.length, 10);
result.each(function (rec) { assert.equal(rec.Value >= 5, true); });
result.each(function (rec) { assert.equal(rec.Value <= 6, true); });
})
it('returns all elements == 5.123', function () {
base.close();
base = new qm.Base({ mode: 'open'});
var result = base.search({ $from: 'BTreeSearchTest', Value: 5.123});
assert.equal(result.length, 10);
result.each(function (rec) { assert.equal(rec.Value == 5.123, true); });
})
it('returns all elements', function () {
base.close();
base = new qm.Base({ mode: 'open'});
var result = base.search({ $from: 'BTreeSearchTest', Value: { }});
assert.equal(result.length, 100);
})
it('returns no elements', function () {
base.close();
base = new qm.Base({ mode: 'open'});
var result = base.search({ $from: 'BTreeSearchTest', Value: -5});
assert.equal(result.length, 0);
})
});
describe('Tests of base.search after deleting 50 records', function () {
it('returns all elements >= 5', function () {
store.clear(50);
var result = base.search({ $from: 'BTreeSearchTest', Value: { $gt: 5}});
assert.equal(result.length, 25);
result.each(function (rec) { assert.equal(rec.Value >= 5, true); });
})
it('returns all elements <= 6', function () {
store.clear(50);
var result = base.search({ $from: 'BTreeSearchTest', Value: { $lt: 6}});
assert.equal(result.length, 30);
result.each(function (rec) { assert.equal(rec.Value <= 6, true); });
})
it('returns all elements >= 5 and <= 6', function () {
store.clear(50);
var result = base.search({ $from: 'BTreeSearchTest', Value: { $gt: 5, $lt: 6}});
assert.equal(result.length, 5);
result.each(function (rec) { assert.equal(rec.Value >= 5, true); });
result.each(function (rec) { assert.equal(rec.Value <= 6, true); });
})
it('returns all elements == 5.123', function () {
store.clear(50);
var result = base.search({ $from: 'BTreeSearchTest', Value: 5.123});
assert.equal(result.length, 5);
result.each(function (rec) { assert.equal(rec.Value == 5.123, true); });
})
it('returns all elements', function () {
store.clear(50);
var result = base.search({ $from: 'BTreeSearchTest', Value: { }});
assert.equal(result.length, 50);
})
it('returns no elements', function () {
store.clear(50);
var result = base.search({ $from: 'BTreeSearchTest', Value: -5});
assert.equal(result.length, 0);
})
});
describe('Tests of base.search after changing rec.Value += 1', function () {
it('returns all elements >= 5', function () {
store.each(function (rec) { rec.Value = rec.Value + 1; });
var result = base.search({ $from: 'BTreeSearchTest', Value: { $gt: 5}});
assert.equal(result.length, 60);
result.each(function (rec) { assert.equal(rec.Value >= 5, true); });
})
it('returns all elements <= 6', function () {
store.each(function (rec) { rec.Value = rec.Value + 1; });
var result = base.search({ $from: 'BTreeSearchTest', Value: { $lt: 6}});
assert.equal(result.length, 50);
result.each(function (rec) { assert.equal(rec.Value <= 6, true); });
})
it('returns all elements >= 5 and <= 6', function () {
store.each(function (rec) { rec.Value = rec.Value + 1; });
var result = base.search({ $from: 'BTreeSearchTest', Value: { $gt: 5, $lt: 6}});
assert.equal(result.length, 10);
result.each(function (rec) { assert.equal(rec.Value >= 5, true); });
result.each(function (rec) { assert.equal(rec.Value <= 6, true); });
})
it('returns all elements == 5.123', function () {
store.each(function (rec) { rec.Value = rec.Value + 1; });
var result = base.search({ $from: 'BTreeSearchTest', Value: 5.123});
assert.equal(result.length, 10);
result.each(function (rec) { assert.equal(rec.Value == 5.123, true); });
})
it('returns all elements', function () {
store.each(function (rec) { rec.Value = rec.Value + 1; });
var result = base.search({ $from: 'BTreeSearchTest', Value: { }});
assert.equal(result.length, 100);
})
it('returns no elements', function () {
store.each(function (rec) { rec.Value = rec.Value + 1; });
var result = base.search({ $from: 'BTreeSearchTest', Value: 0});
assert.equal(result.length, 0);
})
});
});
describe('BTree DateTime Search Tests', function () {
var base = undefined;
var store = undefined;
beforeEach(function () {
qm.delLock();
base = new qm.Base({mode: 'createClean'});
// prepare test set
base.createStore({
'name': 'BTreeSearchTest',
'fields': [
{ 'name': 'Value', 'type': 'datetime' },
{ 'name': 'ForSort', 'type': 'float' }
],
'joins': [],
'keys': [
{ field: 'Value', type: 'linear' }
]
});
store = base.store('BTreeSearchTest');
var date = new Date('2015-09-27T00:00:00.000Z');
for (var i = 0; i < 100; i++) {
var _date = new Date(date.getTime() + (i % 10)*60*60*1000);
store.push({ Value: _date.toISOString(), ForSort: Math.random() });
}
});
afterEach(function () {
base.close();
});
describe('Tests of base.search after initial push', function () {
it('returns all elements >= 2015-09-27T05:00:00.000Z', function () {
var result = base.search({ $from: 'BTreeSearchTest', Value: { $gt: '2015-09-27T05:00:00.000Z'}});
assert.equal(result.length, 50);
result.each(function (rec) { assert.equal(rec.Value.toISOString() >= '2015-09-27T05:00:00.000Z', true); });
})
it('returns all elements <= 2015-09-27T06:00:00.000Z', function () {
var result = base.search({ $from: 'BTreeSearchTest', Value: { $lt: '2015-09-27T06:00:00.000Z'}});
assert.equal(result.length, 70);
result.each(function (rec) { assert.equal(rec.Value.toISOString() <= '2015-09-27T06:00:00.000Z', true); });
})
it('returns all elements >= 2015-09-27T05:00:00.000 and <= 2015-09-27T06:00:00.000Z', function () {
var result = base.search({
$from: 'BTreeSearchTest',
Value: { $gt: '2015-09-27T05:00:00.000Z', $lt: '2015-09-27T06:00:00.000Z'}});
assert.equal(result.length, 20);
result.each(function (rec) { assert.equal(rec.Value.toISOString() >= '2015-09-27T05:00:00.000Z', true); });
result.each(function (rec) { assert.equal(rec.Value.toISOString() <= '2015-09-27T06:00:00.000Z', true); });
})
it('returns all elements >= 2015-09-27T05:00:00.000 and <= 2015-09-27T06:00:00.000Z and sort according to ForSort field', function () {
var result = base.search({
$from: 'BTreeSearchTest',
$sort: {ForSort: 1},
Value: { $gt: '2015-09-27T05:00:00.000Z', $lt: '2015-09-27T06:00:00.000Z'}});
assert.equal(result.length, 20);
result.each(function (rec) { assert.equal(rec.Value.toISOString() >= '2015-09-27T05:00:00.000Z', true); });
result.each(function (rec) { assert.equal(rec.Value.toISOString() <= '2015-09-27T06:00:00.000Z', true); });
for (var i = 1; i < result.length; i++) {
assert.equal(result[i-1].ForSort < result[i].ForSort, true);
}
})
it('returns all elements == 2015-09-27T05:00:00.000Z', function () {
var result = base.search({ $from: 'BTreeSearchTest', Value: '2015-09-27T05:00:00.000Z'});
assert.equal(result.length, 10);
result.each(function (rec) { assert.equal(rec.Value.toISOString() == '2015-09-27T05:00:00.000Z', true); });
})
it('returns all elements', function () {
var result = base.search({ $from: 'BTreeSearchTest', Value: { }});
assert.equal(result.length, 100);
})
it('returns no elements', function () {
var result = base.search({ $from: 'BTreeSearchTest', Value: -5});
assert.equal(result.length, 0);
})
});
describe('Tests of base.search passing DateTime as JavaScript timestamp (date.getTime())', function () {
it('returns all elements >= 2015-09-27T05:00:00.000Z', function () {
var result = base.search({ $from: 'BTreeSearchTest', Value: { $gt: new Date('2015-09-27T05:00:00.000Z').getTime()}});
assert.equal(result.length, 50);
result.each(function (rec) { assert.equal(rec.Value.toISOString() >= '2015-09-27T05:00:00.000Z', true); });
})
it('returns all elements <= 2015-09-27T06:00:00.000Z', function () {
var result = base.search({ $from: 'BTreeSearchTest', Value: { $lt: new Date('2015-09-27T06:00:00.000Z').getTime()}});
assert.equal(result.length, 70);
result.each(function (rec) { assert.equal(rec.Value.toISOString() <= '2015-09-27T06:00:00.000Z', true); });
})
it('returns all elements >= 2015-09-27T05:00:00.000 and <= 2015-09-27T06:00:00.000Z', function () {
var result = base.search({
$from: 'BTreeSearchTest',
Value: { $gt: new Date('2015-09-27T05:00:00.000Z').getTime(), $lt: new Date('2015-09-27T06:00:00.000Z').getTime()}});
assert.equal(result.length, 20);
result.each(function (rec) { assert.equal(rec.Value.toISOString() >= '2015-09-27T05:00:00.000Z', true); });
result.each(function (rec) { assert.equal(rec.Value.toISOString() <= '2015-09-27T06:00:00.000Z', true); });
})
it('returns all elements == 2015-09-27T05:00:00.000Z', function () {
var result = base.search({ $from: 'BTreeSearchTest', Value: new Date('2015-09-27T05:00:00.000Z').getTime()});
assert.equal(result.length, 10);
result.each(function (rec) { assert.equal(rec.Value.toISOString() == '2015-09-27T05:00:00.000Z', true); });
})
});
describe('Tests of base.search after deleting 50 records', function () {
it('returns all elements >= 2015-09-27T05:00:00.000Z', function () {
store.clear(50);
var result = base.search({ $from: 'BTreeSearchTest', Value: { $gt: '2015-09-27T05:00:00.000Z'}});
assert.equal(result.length, 25);
result.each(function (rec) { assert.equal(rec.Value.toISOString() >= '2015-09-27T05:00:00.000Z', true); });
})
it('returns all elements <= 2015-09-27T06:00:00.000Z', function () {
store.clear(50);
var result = base.search({ $from: 'BTreeSearchTest', Value: { $lt: '2015-09-27T06:00:00.000Z'}});
assert.equal(result.length, 35);
result.each(function (rec) { assert.equal(rec.Value.toISOString() <= '2015-09-27T06:00:00.000Z', true); });
})
it('returns all elements >= 2015-09-27T05:00:00.000 and <= 2015-09-27T06:00:00.000Z', function () {
store.clear(50);
var result = base.search({
$from: 'BTreeSearchTest',
Value: { $gt: '2015-09-27T05:00:00.000Z', $lt: '2015-09-27T06:00:00.000Z'}});
assert.equal(result.length, 10);
result.each(function (rec) { assert.equal(rec.Value.toISOString() >= '2015-09-27T05:00:00.000Z', true); });
result.each(function (rec) { assert.equal(rec.Value.toISOString() <= '2015-09-27T06:00:00.000Z', true); });
})
it('returns all elements == 2015-09-27T05:00:00.000Z', function () {
store.clear(50);
var result = base.search({ $from: 'BTreeSearchTest', Value: '2015-09-27T05:00:00.000Z'});
assert.equal(result.length, 5);
result.each(function (rec) { assert.equal(rec.Value.toISOString() == '2015-09-27T05:00:00.000Z', true); });
})
it('returns all elements', function () {
store.clear(50);
var result = base.search({ $from: 'BTreeSearchTest', Value: { }});
assert.equal(result.length, 50);
})
it('returns no elements', function () {
store.clear(50);
var result = base.search({ $from: 'BTreeSearchTest', Value: -5});
assert.equal(result.length, 0);
})
});
describe('Tests of base.search after changing rec.Value += 1 minute', function () {
it('returns all elements >= 2015-09-27T05:00:00.000Z', function () {
store.each(function (rec) { rec.Value = new Date(rec.Value.getTime() + 1000); });
var result = base.search({ $from: 'BTreeSearchTest', Value: { $gt: '2015-09-27T05:00:00.000Z'}});
assert.equal(result.length, 50);
result.each(function (rec) { assert.equal(rec.Value.toISOString() >= '2015-09-27T05:00:00.000Z', true); });
})
it('returns all elements <= 2015-09-27T06:00:00.000Z', function () {
store.each(function (rec) { rec.Value = new Date(rec.Value.getTime() + 1000); });
var result = base.search({ $from: 'BTreeSearchTest', Value: { $lt: '2015-09-27T06:00:00.000Z'}});
assert.equal(result.length, 60);
result.each(function (rec) { assert.equal(rec.Value.toISOString() <= '2015-09-27T06:00:00.000Z', true); });
})
it('returns all elements >= 2015-09-27T05:00:00.000 and <= 2015-09-27T06:00:00.000Z', function () {
store.each(function (rec) { rec.Value = new Date(rec.Value.getTime() + 1000); });
var result = base.search({
$from: 'BTreeSearchTest',
Value: { $gt: '2015-09-27T05:00:00.000Z', $lt: '2015-09-27T06:00:00.000Z'}});
assert.equal(result.length, 10);
result.each(function (rec) { assert.equal(rec.Value.toISOString() >= '2015-09-27T05:00:00.000Z', true); });
result.each(function (rec) { assert.equal(rec.Value.toISOString() <= '2015-09-27T06:00:00.000Z', true); });
})
it('returns all elements == 2015-09-27T05:00:00.000Z', function () {
store.each(function (rec) { rec.Value = new Date(rec.Value.getTime() + 1000); });
var result = base.search({ $from: 'BTreeSearchTest', Value: '2015-09-27T05:00:01.000Z'});
assert.equal(result.length, 10);
result.each(function (rec) { assert.equal(rec.Value.toISOString() == '2015-09-27T05:00:01.000Z', true); });
})
it('returns all elements', function () {
store.each(function (rec) { rec.Value = new Date(rec.Value.getTime() + 1000); });
var result = base.search({ $from: 'BTreeSearchTest', Value: { }});
assert.equal(result.length, 100);
})
it('returns no elements', function () {
store.each(function (rec) { rec.Value = new Date(rec.Value.getTime() + 1000); });
var result = base.search({ $from: 'BTreeSearchTest', Value: -5});
assert.equal(result.length, 0);
})
});
});
|
# encoding: utf-8
# module zipimport
# from (built-in)
# by generator 1.130
"""
zipimport provides support for importing Python modules from Zip archives.
This module exports three objects:
- zipimporter: a class; its constructor takes a path to a Zip archive.
- ZipImportError: exception raised by zipimporter objects. It's a
subclass of ImportError, so it can be caught as ImportError, too.
- <API key>: a dict, mapping archive paths to zip directory
info dicts, as used in zipimporter._files.
It is usually not needed to use the zipimport module explicitly; it is
used by the builtin import mechanism for sys.path items that are paths
to Zip archives.
"""
# no imports
# no functions
# classes
class zipimporter(object):
"""
zipimporter(archivepath) -> zipimporter object
Create a new zipimporter instance. 'archivepath' must be a path to
a zipfile, or to a specific path inside a zipfile. For centralfitestoque, it can be
'/tmp/myimport.zip', or '/tmp/myimport.zip/mydirectory', if mydirectory is a
valid directory inside the archive.
'ZipImportError is raised if 'archivepath' doesn't point to a valid Zip
archive.
The 'archive' attribute of zipimporter objects contains the name of the
zipfile targeted.
"""
def find_module(self, fullname, path=None): # real signature unknown; restored from __doc__
"""
find_module(fullname, path=None) -> self or None.
Search for a module specified by 'fullname'. 'fullname' must be the
fully qualified (dotted) module name. It returns the zipimporter
instance itself if the module was found, or None if it wasn't.
The optional 'path' argument is ignored -- it's there for compatibility
with the importer protocol.
"""
return self
def get_code(self, fullname): # real signature unknown; restored from __doc__
"""
get_code(fullname) -> code object.
Return the code object for the specified module. Raise ZipImportError
if the module couldn't be found.
"""
pass
def get_data(self, pathname): # real signature unknown; restored from __doc__
"""
get_data(pathname) -> string with file data.
Return the data associated with 'pathname'. Raise IOError if
the file wasn't found.
"""
return ""
def get_filename(self, fullname): # real signature unknown; restored from __doc__
"""
get_filename(fullname) -> filename string.
Return the filename for the specified module.
"""
pass
def get_source(self, fullname): # real signature unknown; restored from __doc__
"""
get_source(fullname) -> source string.
Return the source code for the specified module. Raise ZipImportError
if the module couldn't be found, return None if the archive does
contain the module, but has no source for it.
"""
pass
def is_package(self, fullname): # real signature unknown; restored from __doc__
"""
is_package(fullname) -> bool.
Return True if the module specified by fullname is a package.
Raise ZipImportError if the module couldn't be found.
"""
pass
def load_module(self, fullname): # real signature unknown; restored from __doc__
"""
load_module(fullname) -> module.
Load the module specified by 'fullname'. 'fullname' must be the
fully qualified (dotted) module name. It returns the imported
module, or raises ZipImportError if it wasn't found.
"""
pass
def __getattribute__(self, name): # real signature unknown; restored from __doc__
""" x.__getattribute__('name') <==> x.name """
pass
def __init__(self, archivepath): # real signature unknown; restored from __doc__
pass
@staticmethod # known case of __new__
def __new__(S, *more): # real signature unknown; restored from __doc__
""" T.__new__(S, ...) -> a new object with type S, a subtype of T """
pass
def __repr__(self): # real signature unknown; restored from __doc__
""" x.__repr__() <==> repr(x) """
pass
archive = property(lambda self: '')
""":type: string"""
prefix = property(lambda self: '')
""":type: string"""
_files = property(lambda self: {})
""":type: dict"""
class ZipImportError(ImportError):
# no doc
def __init__(self, *args, **kwargs): # real signature unknown
pass
__weakref__ = property(lambda self: object(), lambda self, v: None, lambda self: None) # default
"""list of weak references to the object (if defined)"""
# variables with complex values
<API key> = {} # real value of type <type 'dict'> skipped
|
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#include <unistd.h>
#include <errno.h>
#include <sys/syscall.h>
#include <sys/types.h>
#include <sys/module.h>
#include <sys/mac.h>
#include <sys/param.h>
#include <sys/sbuf.h>
#include <sha256.h>
#include "sandbox-exec.h"
#include "mod_syscall.h"
#include "shared.h"
#include "parser.h"
#include "log.h"
#include "loader.h"
int32_t
<API key>(struct <API key> * sysruleinst, uint64_t sid)
{
struct <API key> * sys_lvs =
(struct <API key> *) calloc(1, sizeof(struct <API key>));
if (sys_lvs == NULL)
{
logmsg(LOG_ERR, "calloc failed at %s:%u\r\n", __FUNCTION__, __LINE__);
return ENOMEM;
}
sys_lvs->sid = sid;
sys_lvs->sandbox_len = sysruleinst->payloadlen+sizeof(struct <API key>);
sys_lvs->sandbox = sysruleinst;
int32_t error = 0;
if ((error = mac_syscall(DEF_KERN_MOD, <API key>, sys_lvs)) != 0)
{
logmsg(LOG_ERR, "[%s] mac_syscall <API key> failed with %d\r\n", __FUNCTION__, error);
}
free((void*)sys_lvs);
return (error);
}
int32_t
<API key>(uint64_t sid)
{
struct syscall_learn * sys_lvs =
(struct syscall_learn *) calloc(1, sizeof(struct syscall_learn));
if (sys_lvs == NULL)
{
logmsg(LOG_ERR, "calloc failed at %s:%u\r\n", __FUNCTION__, __LINE__);
return ENOMEM;
}
sys_lvs->sid = sid;
int32_t error = 0;
if ((error = mac_syscall(DEF_KERN_MOD, <API key>, sys_lvs)) != 0)
{
logmsg(LOG_ERR, "[%s] mac_syscall <API key> failed with %d\r\n", __FUNCTION__, error);
}
free((void*)sys_lvs);
return (error);
}
int32_t
<API key>(uint64_t usid)
{
struct sbuf * sb = sbuf_new_auto();
if (sb == NULL)
{
logmsg(LOG_ERR, "[%s] sbuf_new_auto has returned NULL \r\n", __FUNCTION__);
return ENOMEM;
}
sbuf_printf(sb, "%lu", usid);
sbuf_finish(sb);
if (sbuf_done(sb) == 0)
{
logmsg(LOG_ERR, "[%s] sbuf_done reported the sbuf was not finished, but should!\r\n", __FUNCTION__);
}
struct <API key> * sys_lvs =
(struct <API key> *) calloc(1, sizeof(struct <API key>));
if (sys_lvs == NULL)
{
logmsg(LOG_ERR, "calloc failed at %s:%u\r\n", __FUNCTION__, __LINE__);
return ENOMEM;
}
sys_lvs->sid = sbuf_data(sb);
sys_lvs->sid_len = sbuf_len(sb)+1;
int32_t error = 0;
if ((error = mac_syscall(DEF_KERN_MOD, <API key>, sys_lvs)) != 0)
{
logmsg(LOG_ERR, "[%s] mac_syscall <API key> failed with %d\r\n", __FUNCTION__, error);
}
free((void*)sys_lvs);
sbuf_delete(sb);
return (error);
}
|
#ifndef CurlCacheManager_h
#define CurlCacheManager_h
#include "CurlCacheEntry.h"
#include "ResourceHandle.h"
#include "ResourceResponse.h"
#include <wtf/HashMap.h>
#include <wtf/ListHashSet.h>
#include <wtf/text/WTFString.h>
namespace WebCore {
class CurlCacheManager {
public:
static CurlCacheManager& getInstance();
void setCacheDirectory(const String&);
const String& cacheDirectory() { return m_cacheDir; }
void setStorageSizeLimit(size_t);
bool isCached(const String&) const;
HTTPHeaderMap& requestHeaders(const String&); // Load headers
bool getCachedResponse(const String& url, ResourceResponse&);
void didReceiveResponse(ResourceHandle&, ResourceResponse&);
void didReceiveData(ResourceHandle&, const char*, size_t); // Save data
void didFinishLoading(ResourceHandle&);
void didFail(ResourceHandle&);
private:
CurlCacheManager();
~CurlCacheManager();
CurlCacheManager(CurlCacheManager const&);
void operator=(CurlCacheManager const&);
bool m_disabled;
String m_cacheDir;
HashMap<String, std::unique_ptr<CurlCacheEntry>> m_index;
ListHashSet<String> m_LRUEntryList;
size_t <API key>;
size_t m_storageSizeLimit;
void saveIndex();
void loadIndex();
void makeRoomForNewEntry();
void saveResponseHeaders(const String&, ResourceResponse&);
void <API key>(const String&);
void readCachedData(const String&, ResourceHandle*, ResourceResponse&);
};
}
#endif // CurlCacheManager_h
|
package com.cra.figaro.util
import scala.collection.mutable.Map
import annotation.tailrec
/**
* A priority map using a heap implementation. Provides O(log n) insertion, update, and extracting the
* minimum element.
*/
class HeapPriorityMap[T, U]()(implicit ord: Ordering[U]) extends PriorityMap[T, U] {
private var numElements = 0
private var capacity = 0
private var contents: Array[(T, U)] = Array.ofDim(0)
private def changeSize(newCapacity: Int): Unit = {
val oldCapacity = capacity
capacity = newCapacity
val newContents: Array[(T, U)] = Array.ofDim(capacity)
for { i <- 0 until numElements } { newContents(i) = contents(i) }
contents = newContents
}
private def grow(): Unit = changeSize(capacity * 2 + 1)
private def shrink(): Unit = changeSize((capacity + 1) / 2 - 1)
private val indexMap: Map[T, Int] = Map()
private def swap(index1: Int, index2: Int): Unit = {
val (item1, score1) = contents(index1)
val (item2, score2) = contents(index2)
contents(index1) = (item2, score2)
contents(index2) = (item1, score1)
indexMap(item1) = index2
indexMap(item2) = index1
}
private def parent(i: Int) = i / 2
private def leftChild(i: Int) = i * 2
private def rightChild(i: Int) = i * 2 + 1
private def sendDown(index: Int): Unit = {
val left = leftChild(index)
if (left < numElements) {
val right = rightChild(index)
if (right < numElements &&
ord.lt(contents(right)._2, contents(left)._2) &&
ord.lt(contents(right)._2, contents(index)._2)) {
swap(index, right)
sendDown(right)
} else if (ord.lt(contents(left)._2, contents(index)._2)) {
swap(index, left)
sendDown(left)
}
}
}
private def sendUp(index: Int): Unit = {
if (index > 0) {
val par = parent(index)
if (ord.lt(contents(index)._2, contents(par)._2)) {
swap(index, par)
sendUp(par)
}
}
}
private def doInsert(item: T, score: U): Unit = {
val oldNumElements = numElements
if (numElements >= capacity) grow()
numElements += 1
contents(oldNumElements) = (item, score)
indexMap += item -> oldNumElements
sendUp(oldNumElements)
}
private def doRemove(index: Int): U = {
val (item, score) = contents(index)
val oldNumElements = numElements
numElements -= 1
swap(index, numElements)
if (numElements <= capacity / 2) shrink()
indexMap -= item
sendDown(index)
score
}
@tailrec private def sortHelper(accum: List[(T, U)]): List[(T, U)] =
if (numElements == 0) accum.reverse
else sortHelper(extractMin() :: accum)
/**
* Make a copy of this HeapPriorityMap, returning a new HeapPriorityMap
*/
override def clone: HeapPriorityMap[T, U] = {
val result = new HeapPriorityMap[T, U]()
result.numElements = numElements
result.capacity = capacity
result.contents = contents.clone
result
}
override def isEmpty: Boolean = numElements == 0
/**
* Produce an iterator of the (item, score) pairs in increasing order of score.
*/
def iterator: Iterator[(T, U)] = {
// It's easiest to use this structures own methods to do the sorting in place, but we want to restore
// everything at the end.
val savedNumElements = numElements
val savedCapacity = capacity
val savedContents = contents.clone
val result = sortHelper(List())
numElements = savedNumElements
capacity = savedCapacity
contents = savedContents
result.iterator
}
/**
* Add the key/value pair to the priority map. If the key is already present, update its value,
* moving it in the map.
*/
def +=(pair: (T, U)): HeapPriorityMap.this.type = {
val (item, score) = pair
indexMap.get(item) foreach (doRemove(_))
doInsert(item, score)
this
}
/**
* Remove the key/value pair from the priority map.
*/
def -=(item: T): HeapPriorityMap.this.type = {
indexMap.get(item) foreach (doRemove(_))
this
}
/**
* Get the value associated with the key.
*/
def get(item: T): Option[U] =
indexMap.get(item) map (contents(_)._2)
/**
* Extract and return the item with the minimum value.
*/
def extractMin(): (T, U) = {
if (numElements == 0) throw new <API key>("Empty")
val (item, score) = contents(0)
doRemove(0)
(item, score)
}
}
|
#!/usr/bin/env bash
# vim: sw=2 et
set -euo pipefail
fail() {
echo "ERROR: $*" >&2
exit 1
}
echo 'BUILD_SPHINX_HTML = NO' > mk/validate.mk
echo 'BUILD_SPHINX_PDF = NO' >> mk/validate.mk
hackage_index_state="@1511758800"
cat > mk/build.mk <<EOF
V=1
HADDOCK_DOCS=YES
LATEX_DOCS=YES
HSCOLOUR_SRCS=YES
BUILD_DOCBOOK_HTML=YES
BeConservative=YES
EOF
case "$(uname)" in
Linux)
if [[ -n ${TARGET:-} ]]; then
if [[ $TARGET = FreeBSD ]]; then
# cross-compiling to FreeBSD
add-apt-repository -y ppa:hvr/ghc
apt-get update -qq
apt-get install -qy ghc-8.0.2 cabal-install-1.24 alex happy \
ncurses-dev git make automake autoconf gcc perl \
python3 texinfo xz-utils lbzip2 patch
cabal update
cabal install --reinstall hscolour --index-state=$hackage_index_state
ln -s $HOME/.cabal/bin/HsColour /usr/local/bin/HsColour
echo 'HADDOCK_DOCS = NO' >> mk/build.mk
echo 'WERROR=' >> mk/build.mk
echo 'export PATH=/opt/ghc/bin:$PATH' >> $BASH_ENV
else
fail "TARGET=$target not supported"
fi
else
# assuming Ubuntu
apt-get install -qy git make automake autoconf gcc perl python3 texinfo xz-utils lbzip2 patch
cabal update
cabal install --reinstall hscolour --index-state=$hackage_index_state
fi
;;
Darwin)
if [[ -n ${TARGET:-} ]]; then
fail "uname=$(uname) not supported for cross-compilation"
fi
brew install ghc cabal-install python3 ncurses gmp
cabal update
cabal install --reinstall alex happy haddock hscolour --index-state=$hackage_index_state
# put them on the $PATH, don't fail if already installed
ln -s $HOME/.cabal/bin/alex /usr/local/bin/alex || true
ln -s $HOME/.cabal/bin/happy /usr/local/bin/happy || true
ln -s $HOME/.cabal/bin/hscolour /usr/local/bin/hscolour || true
;;
*)
fail "uname=$(uname) not supported"
esac
|
<?php
namespace ZendTest\EventManager\TestAsset;
use Zend\EventManager\<API key>;
/**
* @group Zend_EventManager
*/
class <API key>
{
use <API key>;
protected $eventIdentifier = 'foo.bar';
protected $<API key> = false;
public function getEventIdentifier()
{
return $this->eventIdentifier;
}
public function setEventIdentifier($eventIdentifier)
{
$this->eventIdentifier = $eventIdentifier;
return $this;
}
public function <API key>()
{
$this-><API key> = true;
}
public function <API key>()
{
return $this-><API key>;
}
}
|
import ResourceLoader from './ResourceLoader';
/**
* Create a new Renderer instance.
* @param {object} [loader] - Optional loader instance for
* image and href URL sanitization. If not specified, a
* standard loader instance will be generated.
* @constructor
*/
export default function Renderer(loader) {
this._el = null;
this._bgcolor = null;
this._loader = new ResourceLoader(loader);
}
Renderer.prototype = {
/**
* Initialize a new Renderer instance.
* @param {DOMElement} el - The containing DOM element for the display.
* @param {number} width - The coordinate width of the display, in pixels.
* @param {number} height - The coordinate height of the display, in pixels.
* @param {Array<number>} origin - The origin of the display, in pixels.
* The coordinate system will be translated to this point.
* @param {number} [scaleFactor=1] - Optional scaleFactor by which to multiply
* the width and height to determine the final pixel size.
* @return {Renderer} - This renderer instance.
*/
initialize(el, width, height, origin, scaleFactor) {
this._el = el;
return this.resize(width, height, origin, scaleFactor);
},
/**
* Returns the parent container element for a visualization.
* @return {DOMElement} - The containing DOM element.
*/
element() {
return this._el;
},
/**
* Returns the scene element (e.g., canvas or SVG) of the visualization
* Subclasses must override if the first child is not the scene element.
* @return {DOMElement} - The scene (e.g., canvas or SVG) element.
*/
canvas() {
return this._el && this._el.firstChild;
},
/**
* Get / set the background color.
*/
background(bgcolor) {
if (arguments.length === 0) return this._bgcolor;
this._bgcolor = bgcolor;
return this;
},
/**
* Resize the display.
* @param {number} width - The new coordinate width of the display, in pixels.
* @param {number} height - The new coordinate height of the display, in pixels.
* @param {Array<number>} origin - The new origin of the display, in pixels.
* The coordinate system will be translated to this point.
* @param {number} [scaleFactor=1] - Optional scaleFactor by which to multiply
* the width and height to determine the final pixel size.
* @return {Renderer} - This renderer instance;
*/
resize(width, height, origin, scaleFactor) {
this._width = width;
this._height = height;
this._origin = origin || [0, 0];
this._scale = scaleFactor || 1;
return this;
},
/**
* Report a dirty item whose bounds should be redrawn.
* This base class method does nothing. Subclasses that perform
* incremental should implement this method.
* @param {Item} item - The dirty item whose bounds should be redrawn.
*/
dirty(/*item*/) {},
/**
* Render an input scenegraph, potentially with a set of dirty items.
* This method will perform an immediate rendering with available resources.
* The renderer may also need to perform image loading to perform a complete
* render. This process can lead to asynchronous re-rendering of the scene
* after this method returns. To receive notification when rendering is
* complete, use the renderAsync method instead.
* @param {object} scene - The root mark of a scenegraph to render.
* @return {Renderer} - This renderer instance.
*/
render(scene) {
const r = this;
// bind arguments into a render call, and cache it
// this function may be subsequently called for async redraw
r._call = function() { r._render(scene); };
// invoke the renderer
r._call();
// clear the cached call for garbage collection
// async redraws will stash their own copy
r._call = null;
return r;
},
/**
* Internal rendering method. Renderer subclasses should override this
* method to actually perform rendering.
* @param {object} scene - The root mark of a scenegraph to render.
*/
_render(/*scene*/) {
// subclasses to override
},
/**
* Asynchronous rendering method. Similar to render, but returns a Promise
* that resolves when all rendering is completed. Sometimes a renderer must
* perform image loading to get a complete rendering. The returned
* Promise will not resolve until this process completes.
* @param {object} scene - The root mark of a scenegraph to render.
* @return {Promise} - A Promise that resolves when rendering is complete.
*/
renderAsync(scene) {
const r = this.render(scene);
return this._ready
? this._ready.then(() => r)
: Promise.resolve(r);
},
/**
* Internal method for asynchronous resource loading.
* Proxies method calls to the ImageLoader, and tracks loading
* progress to invoke a re-render once complete.
* @param {string} method - The method name to invoke on the ImageLoader.
* @param {string} uri - The URI for the requested resource.
* @return {Promise} - A Promise that resolves to the requested resource.
*/
_load(method, uri) {
var r = this,
p = r._loader[method](uri);
if (!r._ready) {
// re-render the scene when loading completes
const call = r._call;
r._ready = r._loader.ready()
.then(redraw => {
if (redraw) call();
r._ready = null;
});
}
return p;
},
/**
* Sanitize a URL to include as a hyperlink in the rendered scene.
* This method proxies a call to ImageLoader.sanitizeURL, but also tracks
* image loading progress and invokes a re-render once complete.
* @param {string} uri - The URI string to sanitize.
* @return {Promise} - A Promise that resolves to the sanitized URL.
*/
sanitizeURL(uri) {
return this._load('sanitizeURL', uri);
},
/**
* Requests an image to include in the rendered scene.
* This method proxies a call to ImageLoader.loadImage, but also tracks
* image loading progress and invokes a re-render once complete.
* @param {string} uri - The URI string of the image.
* @return {Promise} - A Promise that resolves to the loaded Image.
*/
loadImage(uri) {
return this._load('loadImage', uri);
}
};
|
# This file is part of Threading Building Blocks.
# Threading Building Blocks is free software; you can redistribute it
# version 2 as published by the Free Software Foundation.
# Threading Building Blocks is distributed in the hope that it will be
# of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# along with Threading Building Blocks; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
# As a special exception, you may use this file as part of a free software
# library without restriction. Specifically, if other files instantiate
# templates or use macros or inline functions from this file, or you compile
# this file and link it with other files to produce an executable, this
# file does not by itself cause the resulting executable to be covered by
# invalidate any other reasons why the executable file might be covered by
# GNU Makefile that builds and runs example.
NAME=seismic
# The C++ compiler
#CXX=g++
# detecting x64
ifeq ($(shell uname -m),x86_64)
x64 ?= 64
endif
# detecting UI ("mac", "x" or "con")
ifeq ($(shell uname),Darwin)
UI ?= mac
else
UI ?= $(shell sh -c "[ -f /usr/X11R6/lib$(x64)/libX11.so -o -f /usr/lib$(x64)/libX11.so ] && echo x || echo con")
endif
ifeq ($(UI),x)
EXE=./$(NAME)
CXXFLAGS += -I/usr/X11R6/include
LIBS += -lpthread -L/usr/X11R6/lib$(x64) -lX11
# detect if libXext can be found
ifeq ($(shell sh -c "[ -f /usr/X11R6/lib$(x64)/libXext.so -o -f /usr/lib$(x64)/libXext.so ] && echo 0"),0)
LIBS += -lXext
else # no libXext
CXXFLAGS += -DX_NOSHMEM
endif # libXext
else
ifeq ($(UI),mac)
TBBLIBSPATH = /Library/Frameworks/TBB.framework/Libraries
CXXFLAGS += -L$(TBBLIBSPATH) -arch i386 -mmacosx-version-min=10.4 -msse3 -ftree-vectorize
LIBS += -framework OpenGL -framework AGL -framework Carbon
APPRES = $(NAME).app/Contents/Resources
EXE = ./$(NAME).app/Contents/MacOS/$(NAME)
# look in /System and /Developer (for Xcode 3)
PBXCP = $(wildcard /[SD]*/Library/PrivateFrameworks/DevToolsCore.framework/Resources/pbxcp) -<API key> -exclude .DS_Store -exclude CVS -exclude .svn
else # ! Mac
UI=con
EXE=./$(NAME)
endif # Mac
endif
all: release test
resources:
ifeq ($(UI),mac)
mkdir -p $(APPRES)/English.lproj $(NAME).app/Contents/MacOS
$(PBXCP) xcode/English.lproj/InfoPlist.strings xcode/English.lproj/main.nib $(APPRES)/English.lproj
$(PBXCP) xcode/Info.plist $(APPRES)
endif
release: ../../common/gui/$(UI)video.cpp SeismicSimulation.cpp resources
$(CXX) -O2 -DNDEBUG $(CXXFLAGS) -o $(EXE) $< SeismicSimulation.cpp -ltbb $(LIBS)
debug: ../../common/gui/$(UI)video.cpp SeismicSimulation.cpp resources
$(CXX) -g -O0 -DTBB_DO_ASSERT $(CXXFLAGS) -o $(EXE) $< SeismicSimulation.cpp -ltbb_debug $(LIBS)
clean:
rm -f $(EXE) *.o *.d
ifeq ($(UI),mac)
rm -rf $(NAME).app
endif
test:
ifeq ($(UI),mac)
export DYLD_LIBRARY_PATH="$(DYLD_LIBRARY_PATH):$(TBBLIBSPATH)"; $(EXE) - 300
else
$(EXE) - 300
endif
|
#ifndef VM_H
#define VM_H
#include <machine/vm.h>
typedef char vm_inherit_t; /* inheritance codes */
#define VM_INHERIT_SHARE ((vm_inherit_t) 0)
#define VM_INHERIT_COPY ((vm_inherit_t) 1)
#define VM_INHERIT_NONE ((vm_inherit_t) 2)
#define VM_INHERIT_DEFAULT VM_INHERIT_COPY
typedef u_char vm_prot_t; /* protection codes */
#define VM_PROT_NONE ((vm_prot_t) 0x00)
#define VM_PROT_READ ((vm_prot_t) 0x01)
#define VM_PROT_WRITE ((vm_prot_t) 0x02)
#define VM_PROT_EXECUTE ((vm_prot_t) 0x04)
#define VM_PROT_COPY ((vm_prot_t) 0x08) /* copy-on-read */
#define VM_PROT_ALL (VM_PROT_READ|VM_PROT_WRITE|VM_PROT_EXECUTE)
#define VM_PROT_RW (VM_PROT_READ|VM_PROT_WRITE)
#define VM_PROT_DEFAULT VM_PROT_ALL
enum obj_type { OBJT_DEFAULT, OBJT_SWAP, OBJT_VNODE, OBJT_DEVICE, OBJT_PHYS,
OBJT_DEAD, OBJT_SG, OBJT_MGTDEVICE };
typedef u_char objtype_t;
union vm_map_object;
typedef union vm_map_object vm_map_object_t;
struct vm_map_entry;
typedef struct vm_map_entry *vm_map_entry_t;
struct vm_map;
typedef struct vm_map *vm_map_t;
struct vm_object;
typedef struct vm_object *vm_object_t;
#ifndef _KERNEL
/*
* This is defined in <sys/types.h> for the kernel so that non-vm kernel
* sources (mainly Mach-derived ones such as ddb) don't have to include
* vm stuff. Defining it there for applications might break things.
* Define it here for "applications" that include vm headers (e.g.,
* genassym).
*/
typedef int boolean_t;
/*
* The exact set of memory attributes is machine dependent. However, every
* machine is required to define VM_MEMATTR_DEFAULT.
*/
typedef char vm_memattr_t; /* memory attribute codes */
/*
* This is defined in <sys/types.h> for the kernel so that vnode_if.h
* doesn't have to include <vm/vm.h>.
*/
struct vm_page;
typedef struct vm_page *vm_page_t;
#endif /* _KERNEL */
struct vm_reserv;
typedef struct vm_reserv *vm_reserv_t;
/*
* Information passed from the machine-independant VM initialization code
* for use by machine-dependant code (mainly for MMU support)
*/
struct kva_md_info {
vm_offset_t buffer_sva;
vm_offset_t buffer_eva;
vm_offset_t clean_sva;
vm_offset_t clean_eva;
};
extern struct kva_md_info kmi;
extern void vm_ksubmap_init(struct kva_md_info *);
extern int old_mlock;
struct ucred;
int swap_reserve(vm_ooffset_t incr);
int <API key>(vm_ooffset_t incr, struct ucred *cred);
void swap_reserve_force(vm_ooffset_t incr);
void swap_release(vm_ooffset_t decr);
void <API key>(vm_ooffset_t decr, struct ucred *cred);
void swapper(void);
#endif /* VM_H */
|
#ifndef <API key>
#define <API key>
#include "sky/engine/core/page/<API key>.h"
#include "sky/engine/platform/LifecycleNotifier.h"
#include "sky/engine/wtf/PassOwnPtr.h"
#include "sky/engine/wtf/TemporaryChange.h"
namespace blink {
class Page;
class LocalFrame;
class <API key> final : public LifecycleNotifier<Page> {
public:
static PassOwnPtr<<API key>> create(Page*);
void <API key>();
void notifyDidCommitLoad(LocalFrame*);
virtual void addObserver(Observer*) override;
virtual void removeObserver(Observer*) override;
private:
explicit <API key>(Page*);
typedef HashSet<<API key>*> PageObserverSet;
PageObserverSet m_pageObservers;
};
inline PassOwnPtr<<API key>> <API key>::create(Page* context)
{
return adoptPtr(new <API key>(context));
}
inline void <API key>::<API key>()
{
TemporaryChange<IterationType> scope(this->m_iterating, <API key>);
for (PageObserverSet::iterator it = m_pageObservers.begin(); it != m_pageObservers.end(); ++it)
(*it)-><API key>();
}
inline void <API key>::notifyDidCommitLoad(LocalFrame* frame)
{
TemporaryChange<IterationType> scope(this->m_iterating, <API key>);
for (PageObserverSet::iterator it = m_pageObservers.begin(); it != m_pageObservers.end(); ++it)
(*it)->didCommitLoad(frame);
}
} // namespace blink
#endif // <API key>
|
package org.dirtymechanics.frc.component.arm;
import org.dirtymechanics.frc.component.arm.ScrewDrive.Location;
/**
*
* @author frc
*/
public interface ScrewProperties {
public Location highGoal();
public Location pass();
public Location reset();
public Location trussShot();
}
|
#if !defined(<API key>)
#define <API key>
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// TalkDlg.h : header file
// CTalkDlg dialog
class CTalkDlg : public CDialog
{
// Construction
public:
CTalkDlg(CWnd* pParent = NULL); // standard constructor
// Dialog Data
//{{AFX_DATA(CTalkDlg)
enum { IDD = IDD_TALK };
CString m_message;
int m_type;
//}}AFX_DATA
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CTalkDlg)
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
//}}AFX_VIRTUAL
// Implementation
protected:
// Generated message map functions
//{{AFX_MSG(CTalkDlg)
// NOTE: the ClassWizard will add member functions here
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(<API key>)
|
module Main where
import CLI.Main (runCLI)
import Data.Version (showVersion)
import Paths_gtfsschedule (version)
programHeader :: String
programHeader =
"gtfsschedule - Be on time for your next public transport service (v. " ++ showVersion version ++ ")"
main :: IO ()
main = runCLI programHeader "Shows schedule of departing vehicles based on static GTFS data."
|
#include "webrtc/base/cpu_time.h"
#include "webrtc/base/logging.h"
#include "webrtc/base/timeutils.h"
#if defined(WEBRTC_LINUX)
#include <time.h>
#elif defined(WEBRTC_MAC)
#include <sys/resource.h>
#include <sys/types.h>
#include <sys/times.h>
#include <mach/thread_info.h>
#include <mach/thread_act.h>
#include <mach/mach_init.h>
#include <unistd.h>
#elif defined(WEBRTC_WIN)
#include <windows.h>
#endif
#if defined(WEBRTC_WIN)
namespace {
// FILETIME resolution is 100 nanosecs.
const int64_t <API key> = 100;
} // namespace
#endif
namespace rtc {
int64_t <API key>() {
#if defined(WEBRTC_LINUX)
struct timespec ts;
if (clock_gettime(<API key>, &ts) == 0) {
return ts.tv_sec * kNumNanosecsPerSec + ts.tv_nsec;
} else {
LOG_ERR(LS_ERROR) << "clock_gettime() failed.";
}
#elif defined(WEBRTC_MAC)
struct rusage rusage;
if (getrusage(RUSAGE_SELF, &rusage) == 0) {
return rusage.ru_utime.tv_sec * kNumNanosecsPerSec +
rusage.ru_utime.tv_usec * <API key>;
} else {
LOG_ERR(LS_ERROR) << "getrusage() failed.";
}
#elif defined(WEBRTC_WIN)
FILETIME createTime;
FILETIME exitTime;
FILETIME kernelTime;
FILETIME userTime;
if (GetProcessTimes(GetCurrentProcess(), &createTime, &exitTime, &kernelTime,
&userTime) != 0) {
return ((static_cast<uint64_t>(userTime.dwHighDateTime) << 32) +
userTime.dwLowDateTime) *
<API key>;
} else {
LOG_ERR(LS_ERROR) << "GetProcessTimes() failed.";
}
#else
// Not implemented yet.
static_assert(
false, "<API key>() platform support not yet implemented.");
#endif
return -1;
}
int64_t <API key>() {
#if defined(WEBRTC_LINUX)
struct timespec ts;
if (clock_gettime(<API key>, &ts) == 0) {
return ts.tv_sec * kNumNanosecsPerSec + ts.tv_nsec;
} else {
LOG_ERR(LS_ERROR) << "clock_gettime() failed.";
}
#elif defined(WEBRTC_MAC)
<API key> info;
<API key> count = <API key>;
if (thread_info(mach_thread_self(), THREAD_BASIC_INFO, (thread_info_t)&info,
&count) == KERN_SUCCESS) {
return info.user_time.seconds * kNumNanosecsPerSec +
info.user_time.microseconds * <API key>;
} else {
LOG_ERR(LS_ERROR) << "thread_info() failed.";
}
#elif defined(WEBRTC_WIN)
FILETIME createTime;
FILETIME exitTime;
FILETIME kernelTime;
FILETIME userTime;
if (GetThreadTimes(GetCurrentThread(), &createTime, &exitTime, &kernelTime,
&userTime) != 0) {
return ((static_cast<uint64_t>(userTime.dwHighDateTime) << 32) +
userTime.dwLowDateTime) *
<API key>;
} else {
LOG_ERR(LS_ERROR) << "GetThreadTimes() failed.";
}
#else
// Not implemented yet.
static_assert(
false, "<API key>() platform support not yet implemented.");
#endif
return -1;
}
} // namespace rtc
|
// Use of this source code is governed by a BSD-style
package ssa
import (
"cmd/compile/internal/types"
"cmd/internal/src"
"fmt"
"math"
"sort"
"strings"
)
// A Value represents a value in the SSA representation of the program.
// The ID and Type fields must not be modified. The remainder may be modified
// if they preserve the value of the Value (e.g. changing a (mul 2 x) to an (add x x)).
type Value struct {
// A unique identifier for the value. For performance we allocate these IDs
// densely starting at 1. There is no guarantee that there won't be occasional holes, though.
ID ID
// The operation that computes this value. See op.go.
Op Op
// The type of this value. Normally this will be a Go type, but there
// are a few other pseudo-types, see type.go.
Type *types.Type
// Auxiliary info for this value. The type of this information depends on the opcode and type.
// AuxInt is used for integer values, Aux is used for other values.
// Floats are stored in AuxInt using math.Float64bits(f).
// Unused portions of AuxInt are filled by sign-extending the used portion,
// even if the represented value is unsigned.
// Users of AuxInt which interpret AuxInt as unsigned (e.g. shifts) must be careful.
// Use Value.AuxUnsigned to get the zero-extended value of AuxInt.
AuxInt int64
Aux interface{}
// Arguments of this value
Args []*Value
// Containing basic block
Block *Block
// Source position
Pos src.XPos
// Use count. Each appearance in Value.Args and Block.Control counts once.
Uses int32
// Storage for the first three args
argstorage [3]*Value
}
// Examples:
// Opcode aux args
// OpAdd nil 2
// OpConst string 0 string constant
// OpConst int64 0 int64 constant
// OpAddcq int64 1 amd64 op: v = arg[0] + constant
// short form print. Just v
func (v *Value) String() string {
if v == nil {
return "nil" // should never happen, but not panicking helps with debugging
}
return fmt.Sprintf("v%d", v.ID)
}
func (v *Value) AuxInt8() int8 {
if opcodeTable[v.Op].auxType != auxInt8 {
v.Fatalf("op %s doesn't have an int8 aux field", v.Op)
}
return int8(v.AuxInt)
}
func (v *Value) AuxInt16() int16 {
if opcodeTable[v.Op].auxType != auxInt16 {
v.Fatalf("op %s doesn't have an int16 aux field", v.Op)
}
return int16(v.AuxInt)
}
func (v *Value) AuxInt32() int32 {
if opcodeTable[v.Op].auxType != auxInt32 {
v.Fatalf("op %s doesn't have an int32 aux field", v.Op)
}
return int32(v.AuxInt)
}
// AuxUnsigned returns v.AuxInt as an unsigned value for OpConst*.
// v.AuxInt is always sign-extended to 64 bits, even if the
// represented value is unsigned. This undoes that sign extension.
func (v *Value) AuxUnsigned() uint64 {
c := v.AuxInt
switch v.Op {
case OpConst64:
return uint64(c)
case OpConst32:
return uint64(uint32(c))
case OpConst16:
return uint64(uint16(c))
case OpConst8:
return uint64(uint8(c))
}
v.Fatalf("op %s isn't OpConst*", v.Op)
return 0
}
func (v *Value) AuxFloat() float64 {
if opcodeTable[v.Op].auxType != auxFloat32 && opcodeTable[v.Op].auxType != auxFloat64 {
v.Fatalf("op %s doesn't have a float aux field", v.Op)
}
return math.Float64frombits(uint64(v.AuxInt))
}
func (v *Value) AuxValAndOff() ValAndOff {
if opcodeTable[v.Op].auxType != auxSymValAndOff {
v.Fatalf("op %s doesn't have a ValAndOff aux field", v.Op)
}
return ValAndOff(v.AuxInt)
}
// long form print. v# = opcode <type> [aux] args [: reg] (names)
func (v *Value) LongString() string {
s := fmt.Sprintf("v%d = %s", v.ID, v.Op)
s += " <" + v.Type.String() + ">"
s += v.auxString()
for _, a := range v.Args {
s += fmt.Sprintf(" %v", a)
}
r := v.Block.Func.RegAlloc
if int(v.ID) < len(r) && r[v.ID] != nil {
s += " : " + r[v.ID].String()
}
var names []string
for name, values := range v.Block.Func.NamedValues {
for _, value := range values {
if value == v {
names = append(names, name.String())
break // drop duplicates.
}
}
}
if len(names) != 0 {
sort.Strings(names) // Otherwise a source of variation in debugging output.
s += " (" + strings.Join(names, ", ") + ")"
}
return s
}
func (v *Value) auxString() string {
switch opcodeTable[v.Op].auxType {
case auxBool:
if v.AuxInt == 0 {
return " [false]"
} else {
return " [true]"
}
case auxInt8:
return fmt.Sprintf(" [%d]", v.AuxInt8())
case auxInt16:
return fmt.Sprintf(" [%d]", v.AuxInt16())
case auxInt32:
return fmt.Sprintf(" [%d]", v.AuxInt32())
case auxInt64, auxInt128:
return fmt.Sprintf(" [%d]", v.AuxInt)
case auxFloat32, auxFloat64:
return fmt.Sprintf(" [%g]", v.AuxFloat())
case auxString:
return fmt.Sprintf(" {%q}", v.Aux)
case auxSym, auxTyp:
if v.Aux != nil {
return fmt.Sprintf(" {%v}", v.Aux)
}
case auxSymOff, auxSymInt32, auxTypSize:
s := ""
if v.Aux != nil {
s = fmt.Sprintf(" {%v}", v.Aux)
}
if v.AuxInt != 0 {
s += fmt.Sprintf(" [%v]", v.AuxInt)
}
return s
case auxSymValAndOff:
s := ""
if v.Aux != nil {
s = fmt.Sprintf(" {%v}", v.Aux)
}
return s + fmt.Sprintf(" [%s]", v.AuxValAndOff())
case auxCCop:
return fmt.Sprintf(" {%s}", v.Aux.(Op))
}
return ""
}
func (v *Value) AddArg(w *Value) {
if v.Args == nil {
v.resetArgs() // use argstorage
}
v.Args = append(v.Args, w)
w.Uses++
}
func (v *Value) AddArgs(a ...*Value) {
if v.Args == nil {
v.resetArgs() // use argstorage
}
v.Args = append(v.Args, a...)
for _, x := range a {
x.Uses++
}
}
func (v *Value) SetArg(i int, w *Value) {
v.Args[i].Uses
v.Args[i] = w
w.Uses++
}
func (v *Value) RemoveArg(i int) {
v.Args[i].Uses
copy(v.Args[i:], v.Args[i+1:])
v.Args[len(v.Args)-1] = nil // aid GC
v.Args = v.Args[:len(v.Args)-1]
}
func (v *Value) SetArgs1(a *Value) {
v.resetArgs()
v.AddArg(a)
}
func (v *Value) SetArgs2(a *Value, b *Value) {
v.resetArgs()
v.AddArg(a)
v.AddArg(b)
}
func (v *Value) resetArgs() {
for _, a := range v.Args {
a.Uses
}
v.argstorage[0] = nil
v.argstorage[1] = nil
v.argstorage[2] = nil
v.Args = v.argstorage[:0]
}
func (v *Value) reset(op Op) {
v.Op = op
v.resetArgs()
v.AuxInt = 0
v.Aux = nil
}
// copyInto makes a new value identical to v and adds it to the end of b.
func (v *Value) copyInto(b *Block) *Value {
c := b.NewValue0(v.Pos, v.Op, v.Type) // Lose the position, this causes line number churn otherwise.
c.Aux = v.Aux
c.AuxInt = v.AuxInt
c.AddArgs(v.Args...)
for _, a := range v.Args {
if a.Type.IsMemory() {
v.Fatalf("can't move a value with a memory arg %s", v.LongString())
}
}
return c
}
// copyIntoNoXPos makes a new value identical to v and adds it to the end of b.
// The copied value receives no source code position to avoid confusing changes
// in debugger information (the intended user is the register allocator).
func (v *Value) copyIntoNoXPos(b *Block) *Value {
return v.copyIntoWithXPos(b, src.NoXPos)
}
// copyIntoWithXPos makes a new value identical to v and adds it to the end of b.
// The supplied position is used as the position of the new value.
func (v *Value) copyIntoWithXPos(b *Block, pos src.XPos) *Value {
c := b.NewValue0(pos, v.Op, v.Type)
c.Aux = v.Aux
c.AuxInt = v.AuxInt
c.AddArgs(v.Args...)
for _, a := range v.Args {
if a.Type.IsMemory() {
v.Fatalf("can't move a value with a memory arg %s", v.LongString())
}
}
return c
}
func (v *Value) Logf(msg string, args ...interface{}) { v.Block.Logf(msg, args...) }
func (v *Value) Log() bool { return v.Block.Log() }
func (v *Value) Fatalf(msg string, args ...interface{}) {
v.Block.Func.fe.Fatalf(v.Pos, msg, args...)
}
// isGenericIntConst returns whether v is a generic integer constant.
func (v *Value) isGenericIntConst() bool {
return v != nil && (v.Op == OpConst64 || v.Op == OpConst32 || v.Op == OpConst16 || v.Op == OpConst8)
}
// Reg returns the register assigned to v, in cmd/internal/obj/$ARCH numbering.
func (v *Value) Reg() int16 {
reg := v.Block.Func.RegAlloc[v.ID]
if reg == nil {
v.Fatalf("nil register for value: %s\n%s\n", v.LongString(), v.Block.Func)
}
return reg.(*Register).objNum
}
// Reg0 returns the register assigned to the first output of v, in cmd/internal/obj/$ARCH numbering.
func (v *Value) Reg0() int16 {
reg := v.Block.Func.RegAlloc[v.ID].(LocPair)[0]
if reg == nil {
v.Fatalf("nil first register for value: %s\n%s\n", v.LongString(), v.Block.Func)
}
return reg.(*Register).objNum
}
// Reg1 returns the register assigned to the second output of v, in cmd/internal/obj/$ARCH numbering.
func (v *Value) Reg1() int16 {
reg := v.Block.Func.RegAlloc[v.ID].(LocPair)[1]
if reg == nil {
v.Fatalf("nil second register for value: %s\n%s\n", v.LongString(), v.Block.Func)
}
return reg.(*Register).objNum
}
func (v *Value) RegName() string {
reg := v.Block.Func.RegAlloc[v.ID]
if reg == nil {
v.Fatalf("nil register for value: %s\n%s\n", v.LongString(), v.Block.Func)
}
return reg.(*Register).name
}
// MemoryArg returns the memory argument for the Value.
// The returned value, if non-nil, will be memory-typed (or a tuple with a memory-typed second part).
// Otherwise, nil is returned.
func (v *Value) MemoryArg() *Value {
if v.Op == OpPhi {
v.Fatalf("MemoryArg on Phi")
}
na := len(v.Args)
if na == 0 {
return nil
}
if m := v.Args[na-1]; m.Type.IsMemory() {
return m
}
return nil
}
// LackingPos indicates whether v is a value that is unlikely to have a correct
// position assigned to it. Ignoring such values leads to more user-friendly positions
// assigned to nearby values and the blocks containing them.
func (v *Value) LackingPos() bool {
// The exact definition of LackingPos is somewhat heuristically defined and may change
// in the future, for example if some of these operations are generated more carefully
// with respect to their source position.
return v.Op == OpVarDef || v.Op == OpVarKill || v.Op == OpVarLive || v.Op == OpPhi ||
(v.Op == OpFwdRef || v.Op == OpCopy) && v.Type == types.TypeMem
}
|
<?php
return [
'sender' => [
'id' => 10,
'username' => 'bayer.hudson',
'auth_key' => '<API key>',
'password_hash' => '$2y$13$EjaPFBnZOQsHdGuHI.<API key>',
'confirmation_token' => '<API key>',
'created_at' => '2014-08-07 00:02:25',
'updated_at' => '2016-08-07 00:02:25',
'email' => 'nicole.paucek@schultz.info',
'email_confirmed' => 1,
],
'recipient' => [
'id' => 11,
'username' => 'hudson.hudson',
'auth_key' => '<API key>',
'password_hash' => '$2y$13$EjaPFBnZOQsHdGuHI.<API key>',
'confirmation_token' => '<API key>',
'created_at' => '2014-08-07 00:02:25',
'updated_at' => '2016-08-07 00:02:25',
'email' => 'nicole.paucek@schultz.com',
'email_confirmed' => 1,
],
'model' => [
'id' => 12,
'username' => 'bayer.bayer',
'auth_key' => '<API key>',
'password_hash' => '$2y$13$EjaPFBnZOQsHdGuHI.<API key>',
'confirmation_token' => '<API key>',
'created_at' => '2014-08-07 00:02:25',
'updated_at' => '2016-08-07 00:02:25',
'email' => 'nicole.paucek@schultz.biz',
'email_confirmed' => 1,
]
];
|
#include "config.h"
#include "SFDFileIndexor.h"
#include "<API key>.h"
#include "FileHandler.h"
#include "SFDHeader.h"
#include "BitBuffer.h"
SFDFileIndexor::SFDFileIndexor( FileHandler* fh,
<API key>* listener,
const SFDHeader& header )
: m_strOffsetBuf( 2 * header.<API key>() / 8 )
{
m_fileHandler = fh;
allocStr( header.maxStringSize() + 1 );
m_minBufSize = header.maxStringSize() + 1;
m_listener = listener;
m_header = &header;
m_state = IDLE;
}
SFDFileIndexor::~SFDFileIndexor()
{
}
uint32
SFDFileIndexor::strNbrToOffset( uint32 idx ) const
{
return (m_header-><API key>() / 8) * idx +
m_header-><API key>();
}
bool
SFDFileIndexor::start()
{
if ( m_stringRead ) {
m_listener->indexorDone( this, 0 );
return false;
}
if ( m_state == PERMANENT_ERROR ) {
mc2dbg << "[SFDFI]: In PERMANENT_ERROR state" << endl;
m_listener->indexorDone( this, -1 );
}
// Realloc the string buffer if needed
if ( m_strAllocSize < m_minBufSize ) {
allocStr( m_minBufSize + 1 );
}
m_state = READING_STR_OFFSET;
m_fileHandler->setPos( strNbrToOffset( m_strNbr ) );
// Read it into the buffer.
m_fileHandler->read( m_strOffsetBuf.getBufferAddress(),
m_strOffsetBuf.getBufferSize(),
this );
return true;
}
void
SFDFileIndexor::readDone( int nbrRead )
{
MC2_ASSERT( m_state == READING_STR_OFFSET ||
m_state == READING_STR );
if ( nbrRead <= 0 ) {
m_state = PERMANENT_ERROR;
m_listener->indexorDone( this, -1 );
return;
}
if ( m_state == READING_STR_OFFSET ) {
// Will read string
m_state = READING_STR;
// Start at beginning.
m_strOffsetBuf.reset();
// Read offset of our string
m_strOffset = m_strOffsetBuf.readNextBALong();
// The length of the string is the difference between
// this and the next one.
m_curStrLength = m_strOffsetBuf.readNextBALong() - m_strOffset;
// Seek to that pos
m_fileHandler->setPos( m_header-><API key>() + m_strOffset );
// Read a string
m_fileHandler->read( reinterpret_cast<uint8*>(m_str),
m_curStrLength,
this );
} else if ( m_state == READING_STR ) {
mc2dbg << "[SFDFileIndexor]: String read = "
<< m_str << endl;
m_stringRead = true;
// It is done.
m_state = IDLE;
// Inform the listener
m_listener->indexorDone( this, 0 );
}
}
|
#ifndef <API key>
#define <API key>
#include "ppapi/c/dev/ppb_context_3d_dev.h"
#include "ppapi/c/pp_bool.h"
#include "ppapi/c/pp_instance.h"
#include "ppapi/c/pp_resource.h"
#include "ppapi/c/pp_stdint.h"
#define <API key> "<API key>(Dev);0.3"
typedef enum {
kNoError,
kInvalidSize,
kOutOfBounds,
kUnknownCommand,
kInvalidArguments,
kLostContext,
kGenericError
} <API key>;
struct <API key> {
// Size of the command buffer in command buffer entries.
int32_t num_entries;
// The offset (in entries) from which the reader is reading.
int32_t get_offset;
// The offset (in entries) at which the writer is writing.
int32_t put_offset;
// The current token value. This is used by the writer to defer
// changes to shared memory objects until the reader has reached a certain
// point in the command buffer. The reader is responsible for updating the
// token value, for example in response to an asynchronous set token command
// embedded in the command buffer. The default token value is zero.
int32_t token;
// Error status.
<API key> error;
};
struct <API key> {
// Creates a raw Context3D resource. A raw Context3D is intended to be used
// with the trusted interface, through the command buffer (for proxying). In
// particular, when a Surface3D is bound to a raw context, SwapBuffers has no
// effect.
PP_Resource (*CreateRaw)(PP_Instance instance_id,
PP_Config3D_Dev config,
PP_Resource share_context,
const int32_t* attrib_list);
// Initializes the command buffer with the given size.
PP_Bool (*Initialize)(PP_Resource context_id, int32_t size);
// Gets the ring buffer for the command buffer.
PP_Bool (*GetRingBuffer)(PP_Resource context_id,
int* shm_handle,
uint32_t* shm_size);
// Returns the current state.
struct <API key> (*GetState)(PP_Resource context);
// The writer calls this to update its put offset.
PP_Bool (*Flush)(PP_Resource context, int32_t put_offset);
// The writer calls this to update its put offset. This function returns the
// reader's most recent get offset. Does not return until after the put offset
// change callback has been invoked.
struct <API key> (*FlushSync)(PP_Resource context,
int32_t put_offset);
// Create a transfer buffer and return a handle that uniquely
// identifies it or -1 on error.
int32_t (*<API key>)(PP_Resource context, uint32_t size);
// Destroy a transfer buffer and recycle the handle.
PP_Bool (*<API key>)(PP_Resource context, int32_t id);
// Get the transfer buffer associated with a handle.
PP_Bool (*GetTransferBuffer)(PP_Resource context,
int32_t id,
int* shm_handle,
uint32_t* shm_size);
};
#endif // <API key>
|
<!DOCTYPE HTML PUBLIC "-
<!--NewPage
<HTML>
<HEAD>
<!-- Generated by javadoc (build 1.5.0_22) on Wed Mar 02 16:45:47 EST 2011 -->
<TITLE>
<API key>
</TITLE>
<META NAME="keywords" CONTENT="gov.nih.nci.cabig.caaers.service.<API key> class">
<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../../../stylesheet.css" TITLE="Style">
<SCRIPT type="text/javascript">
function windowTitle()
{
parent.document.title="<API key>";
}
</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="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="class-use/<API key>.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="../../../../../../gov/nih/nci/cabig/caaers/service/FreeMarkerService.html" title="class in gov.nih.nci.cabig.caaers.service"><B>PREV CLASS</B></A>
<A HREF="../../../../../../gov/nih/nci/cabig/caaers/service/<API key>.html" title="interface in gov.nih.nci.cabig.caaers.service"><B>NEXT CLASS</B></A></FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../../../../../index.html?gov/nih/nci/cabig/caaers/service/<API key>.html" target="_top"><B>FRAMES</B></A>
<A HREF="<API key>.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 | FIELD | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
DETAIL: FIELD | <A HREF="#constructor_detail">CONSTR</A> | <A HREF="#method_detail">METHOD</A></FONT></TD>
</TR>
</TABLE>
<A NAME="skip-navbar_top"></A>
<HR>
<H2>
<FONT SIZE="-1">
gov.nih.nci.cabig.caaers.service</FONT>
<BR>
Class <API key></H2>
<PRE>
java.lang.Object
<IMG SRC="../../../../../../resources/inherit.gif" ALT="extended by ">junit.framework.Assert
<IMG SRC="../../../../../../resources/inherit.gif" ALT="extended by ">junit.framework.TestCase
<IMG SRC="../../../../../../resources/inherit.gif" ALT="extended by "><B>gov.nih.nci.cabig.caaers.service.<API key></B>
</PRE>
<DL>
<DT><B>All Implemented Interfaces:</B> <DD>junit.framework.Test</DD>
</DL>
<HR>
<DL>
<DT><PRE>public class <B><API key></B><DT>extends junit.framework.TestCase</DL>
</PRE>
<P>
<HR>
<P>
<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="../../../../../../gov/nih/nci/cabig/caaers/service/<API key>.html#<API key>()"><API key></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>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>protected void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../../gov/nih/nci/cabig/caaers/service/<API key>.html#setUp()">setUp</A></B>()</CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../../gov/nih/nci/cabig/caaers/service/<API key>.html#<API key>()"><API key></A></B>()</CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../../gov/nih/nci/cabig/caaers/service/<API key>.html#<API key>()"><API key></A></B>()</CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../../gov/nih/nci/cabig/caaers/service/<API key>.html#<API key>()"><API key></A></B>()</CODE>
<BR>
</TD>
</TR>
</TABLE>
<A NAME="<API key>.framework.TestCase"></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 junit.framework.TestCase</B></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE>countTestCases, createResult, getName, run, run, runBare, runTest, setName, tearDown, toString</CODE></TD>
</TR>
</TABLE>
<A NAME="<API key>.framework.Assert"></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 junit.framework.Assert</B></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE>assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertFalse, assertFalse, assertNotNull, assertNotNull, assertNotSame, assertNotSame, assertNull, assertNull, assertSame, assertSame, assertTrue, assertTrue, fail, fail</CODE></TD>
</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, wait, wait, wait</CODE></TD>
</TR>
</TABLE>
<P>
<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="<API key>()"></A><H3>
<API key></H3>
<PRE>
public <B><API key></B>()</PRE>
<DL>
</DL>
<A NAME="method_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>Method Detail</B></FONT></TH>
</TR>
</TABLE>
<A NAME="setUp()"></A><H3>
setUp</H3>
<PRE>
protected void <B>setUp</B>()
throws java.lang.Exception</PRE>
<DL>
<DD><DL>
<DT><B>Overrides:</B><DD><CODE>setUp</CODE> in class <CODE>junit.framework.TestCase</CODE></DL>
</DD>
<DD><DL>
<DT><B>Throws:</B>
<DD><CODE>java.lang.Exception</CODE></DL>
</DD>
</DL>
<HR>
<A NAME="<API key>()"></A><H3>
<API key></H3>
<PRE>
public void <B><API key></B>()</PRE>
<DL>
<DD><DL>
</DL>
</DD>
</DL>
<HR>
<A NAME="<API key>()"></A><H3>
<API key></H3>
<PRE>
public void <B><API key></B>()</PRE>
<DL>
<DD><DL>
</DL>
</DD>
</DL>
<HR>
<A NAME="<API key>()"></A><H3>
<API key></H3>
<PRE>
public void <B><API key></B>()</PRE>
<DL>
<DD><DL>
</DL>
</DD>
</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/<API key>.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="../../../../../../gov/nih/nci/cabig/caaers/service/FreeMarkerService.html" title="class in gov.nih.nci.cabig.caaers.service"><B>PREV CLASS</B></A>
<A HREF="../../../../../../gov/nih/nci/cabig/caaers/service/<API key>.html" title="interface in gov.nih.nci.cabig.caaers.service"><B>NEXT CLASS</B></A></FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../../../../../index.html?gov/nih/nci/cabig/caaers/service/<API key>.html" target="_top"><B>FRAMES</B></A>
<A HREF="<API key>.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 | FIELD | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
DETAIL: FIELD | <A HREF="#constructor_detail">CONSTR</A> | <A HREF="#method_detail">METHOD</A></FONT></TD>
</TR>
</TABLE>
<A NAME="skip-navbar_bottom"></A>
<HR>
</BODY>
</HTML>
|
package com.orasi.web.webelements.impl;
import static com.orasi.utils.Constants.<API key>;
import static com.orasi.utils.TestReporter.interfaceLog;
import static com.orasi.utils.TestReporter.logInfo;
import static com.orasi.utils.TestReporter.logTrace;
import static com.orasi.web.OrasiDriver.<API key>;
import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.TimeUnit;
import org.apache.commons.lang3.time.StopWatch;
import org.openqa.selenium.By;
import org.openqa.selenium.Dimension;
import org.openqa.selenium.Keys;
import org.openqa.selenium.<API key>;
import org.openqa.selenium.OutputType;
import org.openqa.selenium.Point;
import org.openqa.selenium.Rectangle;
import org.openqa.selenium.<API key>;
import org.openqa.selenium.TakesScreenshot;
import org.openqa.selenium.TimeoutException;
import org.openqa.selenium.WebDriverException;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.interactions.Actions;
import org.openqa.selenium.support.ui.ExpectedConditions;
import org.openqa.selenium.support.ui.WebDriverWait;
import com.orasi.Beta;
import com.orasi.utils.Constants;
import com.orasi.web.<API key>;
import com.orasi.web.OrasiDriver;
import com.orasi.web.debugging.Highlight;
import com.orasi.web.exceptions.<API key>;
import com.orasi.web.exceptions.<API key>;
import com.orasi.web.exceptions.<API key>;
import com.orasi.web.exceptions.<API key>;
import com.orasi.web.exceptions.<API key>;
import com.orasi.web.exceptions.<API key>;
import com.orasi.web.exceptions.<API key>;
import com.orasi.web.exceptions.<API key>;
import com.orasi.web.webelements.Element;
/**
* An implementation of the Element interface. Delegates its work to an
* underlying WebElement instance for custom functionality.
*/
public class ElementImpl implements Element {
protected WebElement element;
protected By by;
protected OrasiDriver driver;
public ElementImpl(final OrasiDriver driver, final By by) {
this.by = by;
this.driver = driver;
try {
logTrace("Entering ElementImpl#init");
logTrace("Inital search for element [ " + by + "]");
WebDriverWait wait = new WebDriverWait(driver, 1);
element = wait.until(ExpectedConditions.<API key>(by));
logTrace("Element [ " + by + "] found and stored");
} catch (WebDriverException throwAway) {
logTrace("Element [ " + by + "] NOT found intially, will search again later");
}
logTrace("Exiting ElementImpl#init");
}
public ElementImpl(final OrasiDriver driver, final By by, final WebElement element) {
this.by = by;
this.driver = driver;
this.element = element;
logTrace("Exiting ElementImpl#init");
}
/**
* @see org.openqa.selenium.WebElement#click()
*/
@Override
public void click() {
logTrace("Entering ElementImpl#click");
try {
getWrappedElement().click();
} catch (RuntimeException rte) {
interfaceLog("Clicked [ <font size = 2 color=\"red\"><b> " + <API key>() + " </font></b>]");
throw rte;
}
interfaceLog("Clicked [ <b>" + <API key>() + " </b>]");
logTrace("Exiting ElementImpl#click");
}
@Override
public void jsClick() {
logTrace("Entering ElementImpl#jsClick");
driver.executeJavaScript("arguments[0].scrollIntoView(true);arguments[0].click();", getWrappedElement());
interfaceLog("Clicked [ <b>" + <API key>() + " </b>]");
logTrace("Exiting ElementImpl#jsClick");
}
@Override
public void focus() {
logTrace("Entering ElementImpl#focus");
new Actions(driver).moveToElement(getWrappedElement()).perform();
interfaceLog("Focus on [ <b>" + <API key>() + " </b>]");
logTrace("Exiting ElementImpl#focus");
}
@Override
public void focusClick() {
logTrace("Entering ElementImpl#focusClick");
new Actions(driver).moveToElement(getWrappedElement()).click().perform();
interfaceLog("Focus Clicked [ <b>" + <API key>() + " </b>]");
logTrace("Exiting ElementImpl#focusClick");
}
@Override
public void onBlur() {
logTrace("Entering ElementImpl#onBlur");
String jsFireEvent = "if ('createEvent' in document) { " +
" var evt = document.createEvent('HTMLEvents'); " +
" evt.initEvent('change', false, true); " +
" arguments[0].dispatchEvent(evt); " +
" } else arguments[0].fireEvent('onblur');";
try {
driver.executeJavaScript(jsFireEvent, getWrappedElement());
} catch (WebDriverException wde) {
}
logTrace("Exiting ElementImpl#onBlur");
}
/**
* @see org.openqa.selenium.WebElement#getLocation()
*/
@Override
public Point getLocation() {
logTrace("Entering ElementImpl#getLocation");
Point point = getWrappedElement().getLocation();
logInfo("Location of element: X = [ " + point.getX() + " ], Y = [ " + point.getY() + " ] ");
logTrace("Exiting ElementImpl#getLocation");
return point;
}
/**
* @see org.openqa.selenium.WebElement#submit()
*/
@Override
public void submit() {
logTrace("Entering ElementImpl#submit");
getWrappedElement().submit();
logTrace("Exiting ElementImpl#submit");
}
/**
* @see org.openqa.selenium.WebElement#getAttribute(String)
*/
@Override
public String getAttribute(String name) {
logTrace("Entering ElementImpl#getAttribute");
String value = getWrappedElement().getAttribute(name);
logInfo("Attribute value for [ " + name + " ] is [ " + value + " ]");
logTrace("Exiting ElementImpl#getAttribute");
return value;
}
/**
* @see org.openqa.selenium.WebElement#getCssValue(String)
*/
@Override
public String getCssValue(String propertyName) {
logTrace("Entering ElementImpl#getCssValue");
String value = getWrappedElement().getCssValue(propertyName);
logInfo("CSS property value for [ " + propertyName + " ] is [ " + value + " ]");
logTrace("Exiting ElementImpl#getCssValue");
return value;
}
/**
* @see org.openqa.selenium.WebElement#getSize()
*/
@Override
public Dimension getSize() {
logTrace("Entering ElementImpl#getSize");
Dimension dimension = getWrappedElement().getSize();
logInfo("Location of element: height = [ " + dimension.getHeight() + " ], width = [ " + dimension.getWidth() + " ] ");
logTrace("Exiting ElementImpl#getSize");
return dimension;
}
/**
* @see org.openqa.selenium.WebElement#findElement(By)
*/
@Override
public List<Element> findElements(By by) {
logTrace("Entering ElementImpl#findElements");
List<WebElement> elements = getWrappedElement().findElements(by);
List<Element> elementList = new ArrayList<>();
elements.forEach(element -> elementList.add(new ElementImpl(driver, by, element)));
logTrace("Exiting ElementImpl#findElements");
return elementList;
}
/**
* @see org.openqa.selenium.WebElement#findElement(By)
*/
@Override
public List<WebElement> findWebElements(By by) {
logTrace("Entering ElementImpl#findWebElements");
List<WebElement> elements = getWrappedElement().findElements(by);
logTrace("Exiting ElementImpl#findWebElements");
return elements;
}
/**
* @see org.openqa.selenium.WebElement#getText()
*/
@Override
public String getText() {
logTrace("Entering ElementImpl#getText");
String text = getWrappedElement().getText();
logInfo("Text found in element [ " + text + " ]");
logTrace("Exiting ElementImpl#getText");
return text;
}
/**
* @see org.openqa.selenium.WebElement#getTagName()
*/
@Override
public String getTagName() {
logTrace("Entering ElementImpl#getTagName");
String name = getWrappedElement().getTagName();
logInfo("Tagname of element [ " + name + " ]");
logTrace("Exiting ElementImpl#getTagName");
return name;
}
/**
* @see org.openqa.selenium.WebElement#findElement(By)
*/
@SuppressWarnings("unchecked")
@Override
public Element findElement(By by) {
logTrace("Entering ElementImpl#findElement");
Element element = new ElementImpl(this.driver, by);
logTrace("Exiting ElementImpl#findElement");
return element;
}
/**
* @see org.openqa.selenium.WebElement#findElement(By)
*/
@Override
public WebElement findWebElement(By by) {
logTrace("Entering ElementImpl#findWebElement");
WebElement element = getWrappedElement().findElement(by);
logTrace("Exiting ElementImpl#findWebElement");
return element;
}
/**
* @see org.openqa.selenium.WebElement#isEnabled()
*/
@Override
public boolean isEnabled() {
logTrace("Entering ElementImpl#isEnabled");
boolean enabled = getWrappedElement().isEnabled();
logTrace("Exiting ElementImpl#isEnabled");
return enabled;
}
/**
* @see org.openqa.selenium.WebElement#isDisplayed()
*/
@Override
public boolean isDisplayed() {
logTrace("Entering ElementImpl#isDisplayed");
boolean displayed = getWrappedElement().isDisplayed();
logTrace("Exiting ElementImpl#isDisplayed");
return displayed;
}
/**
* @see org.openqa.selenium.WebElement#isSelected()
*/
@Override
public boolean isSelected() {
logTrace("Entering ElementImpl#isSelected");
boolean selected = getWrappedElement().isSelected();
logTrace("Exiting ElementImpl#isSelected");
return selected;
}
/**
* @see org.openqa.selenium.WebElement#clear()
*/
@Override
public void clear() {
logTrace("Entering ElementImpl#clear");
getWrappedElement().clear();
interfaceLog("Clear text from Element [ <b>" + <API key>() + " </b> ]");
logTrace("Exiting ElementImpl#clear");
}
/**
* @see org.openqa.selenium.WebElement#sendKeys(CharSequence...)
*/
@Override
public void sendKeys(CharSequence... keysToSend) {
logTrace("Entering ElementImpl#sendKeys");
String keys = "";
if (keysToSend.toString() != "") {
getWrappedElement().sendKeys(keysToSend);
for (CharSequence key : keysToSend) {
if (key instanceof Keys) {
if (keys.isEmpty()) {
keys = "Key." + ((Keys) key).name();
} else {
keys += " + Key." + ((Keys) key).name();
}
} else {
if (keys.isEmpty()) {
keys = key.toString();
} else {
keys += key.toString();
}
}
}
interfaceLog(" Send Keys [ <b>" + keys + "</b> ] to Textbox [ <b>"
+ <API key>() + " </b> ]");
}
logTrace("Exiting ElementImpl#sendKeys");
}
@Override
public WebElement getWrappedElement() {
logTrace("Entering ElementImpl#getWrappedElement");
WebElement tempElement = null;
try {
logTrace("Validate element [ " + by.toString() + " ] is not null");
if (element == null) {
logTrace("Element [ " + by.toString() + " ] is null, attempt to reload the element");
tempElement = reload();
logTrace("Successfully reloaded element [ " + by.toString() + " ]");
} else {
tempElement = element;
}
logTrace("Validate element [ " + by.toString() + " ] is not stale");
tempElement.isEnabled();
logTrace("Successfully validated element [ " + by.toString() + " ] is usable");
logTrace("Exiting ElementImpl#getWrappedElement");
return tempElement;
} catch (<API key> | <API key> e) {
try {
logTrace("Element [ " + by.toString() + " ] is stale, attempt to reload the element");
tempElement = reload();
logTrace("Successfully reloaded element [ " + by.toString() + " ]");
logTrace("Exiting ElementImpl#getWrappedElement");
return tempElement;
} catch (<API key> sere) {
logTrace("Exiting ElementImpl#getWrappedElement");
return element;
}
} catch (<API key> nsee) {
logTrace("Failed to reload element [ " + by.toString() + " ]");
logTrace("Exiting ElementImpl#getWrappedElement");
throw nsee;
}
}
@Override
public boolean elementWired() {
return (getWrappedElement() != null);
}
public String <API key>() {
String locator = "";
int startPosition = 0;
startPosition = by.toString().lastIndexOf(": ") + 2;
locator = by.toString().substring(startPosition, by.toString().length());
return locator.trim();
}
@Override
public String <API key>() {
return by.toString();
}
@Override
public void highlight() {
logTrace("Entering ElementImpl#highlight");
Highlight.highlight(driver, getWrappedElement());
logTrace("Exiting ElementImpl#highlight");
}
@Override
public void scrollIntoView() {
logTrace("Entering ElementImpl#scrollIntoView");
driver.executeJavaScript("arguments[0].scrollIntoView(true);", element);
logTrace("Exiting ElementImpl#scrollIntoView");
}
@SuppressWarnings("rawtypes")
@Override
public ArrayList getAllAttributes() {
return (ArrayList) driver.executeJavaScript(
"var s = []; var attrs = arguments[0].attributes; for (var l = 0; l < attrs.length; ++l) { var a = attrs[l]; s.push(a.name + ':' + a.value); } ; return s;",
getWrappedElement());
}
@Beta
@Override
public <X> X getScreenshotAs(OutputType<X> target) {
return ((TakesScreenshot) driver.getWebDriver()).getScreenshotAs(target);
}
/**
* Used to determine if the desired element is visible on the screen
* Will wait for default element timeout unless new timeout is passed in
* If object is not visible within the time, handle the error based default handler
* or by boolean passed in
*
* @author Justin
* @param args
* Optional arguments </br>
* <b>timeout</b> - the maximum time in seconds the method should try to sync. Called
* with syncVisible(10)</br>
* <b><API key> </b>- if TRUE, the test will throw an exception and
* fail the script. If FALSE, the script will
* not fail, instead a FALSE will be returned
* to the calling function. Called with
* syncVisible(10, false)
*/
@Override
public boolean syncVisible(Object... args) {
logTrace("Entering ElementImpl#syncVisible");
int requestedTimeout = Constants.ELEMENT_TIMEOUT;
int originalTimeout = driver.getElementTimeout(); // to set back the implicit wait to original value
boolean failTestOnSync = <API key>;
try {
if (args[0] != null) {
requestedTimeout = Integer.valueOf(args[0].toString());
}
if (args[1] != null) {
failTestOnSync = Boolean.parseBoolean(args[1].toString());
}
} catch (<API key> aiobe) {
}
interfaceLog("<i>Syncing to element [<b>" + <API key>()
+ "</b> ] to be <b>VISIBLE</b> within [ <b>" + requestedTimeout + "</b> ] seconds.</i>");
StopWatch stopwatch = new StopWatch();
boolean found = false;
long timeLapse;
driver.setElementTimeout(0);
WebDriverWait wait = new WebDriverWait(driver, 1);
stopwatch.start();
while (((stopwatch.getTime()) / 1000.0) < requestedTimeout && !found) {
try {
found = wait.pollingEvery(<API key>, TimeUnit.MILLISECONDS).until(<API key>.elementToBeVisible(reload()));
} catch (<API key> | ClassCastException | <API key> | TimeoutException te) {
}
}
stopwatch.stop();
timeLapse = stopwatch.getTime();
stopwatch.reset();
driver.setElementTimeout(originalTimeout);
if (!found && failTestOnSync) {
logTrace("Element not <b>VISIBLE</b> and failTestOnSync is [ TRUE ]");
interfaceLog("<i>Element [<b>" + <API key>()
+ " </b>] is not <b>VISIBLE</b> on the page after [ "
+ (timeLapse) / 1000.0 + " ] seconds.</i>");
throw new <API key>(
"Element [ " + <API key>() + " ] is not VISIBLE on the page after [ "
+ (timeLapse) / 1000.0 + " ] seconds.",
driver);
} else if (!found) {
interfaceLog("<i>Element [<b>" + <API key>()
+ " </b>] is not <b>VISIBLE</b> on the page after [ "
+ (timeLapse) / 1000.0 + " ] seconds.</i>");
logTrace("Exiting ElementImpl#syncVisible");
return found;
}
interfaceLog("<i>Element [<b>" + <API key>() + " </b>] is <b>VISIBLE</b> on the page after [ " + (timeLapse) / 1000.0 + " ] seconds.</i>");
if (Highlight.getDebugMode()) {
Highlight.highlightSuccess(driver, reload());
}
logTrace("Exiting ElementImpl#syncVisible");
return found;
}
/**
* Used to determine if the desired element is hidden on the screen
* Will wait for default element timeout unless new timeout is passed in
* If object is not hidden within the time, handle the error based default handler
* or by boolean passed in
*
* @author Justin
* @param args
* Optional arguments </br>
* <b>timeout</b> - the maximum time in seconds the method should try to sync. Called
* with syncHidden(10)</br>
* <b><API key> </b>- if TRUE, the test will throw an exception and
* fail the script. If FALSE, the script will
* not fail, instead a FALSE will be returned
* to the calling function. Called with
* syncHidden(10, false)
*/
@Override
public boolean syncHidden(Object... args) {
logTrace("Entering ElementImpl#syncHidden");
int requestedTimeout = Constants.ELEMENT_TIMEOUT;
int originalTimeout = driver.getElementTimeout(); // to set back the implicit wait to original value
boolean failTestOnSync = <API key>;
try {
if (args[0] != null) {
requestedTimeout = Integer.valueOf(args[0].toString());
}
if (args[1] != null) {
failTestOnSync = Boolean.parseBoolean(args[1].toString());
}
} catch (<API key> aiobe) {
}
StopWatch stopwatch = new StopWatch();
interfaceLog("<i>Syncing to element [<b>" + <API key>()
+ "</b> ] to be <b>HIDDEN</b> within [ <b>" + requestedTimeout + "</b> ] seconds.</i>");
boolean found = false;
long timeLapse;
driver.setElementTimeout(0);
stopwatch.start();
WebDriverWait wait = new WebDriverWait(driver, 1);
while (((stopwatch.getTime()) / 1000.0) < requestedTimeout && !found) {
try {
found = wait.pollingEvery(<API key>, TimeUnit.MILLISECONDS).until(<API key>.elementToBeHidden(reload()));
} catch (<API key> | ClassCastException | <API key> | TimeoutException te) {
}
}
stopwatch.stop();
timeLapse = stopwatch.getTime();
stopwatch.reset();
driver.setElementTimeout(originalTimeout);
if (!found && failTestOnSync) {
logTrace("Element not <b>HIDDEN</b> and failTestOnSync is [ TRUE ]");
interfaceLog("<i>Element [<b>" + <API key>()
+ " </b>] is not <b>HIDDEN</b> on the page after [ "
+ (timeLapse) / 1000.0 + " ] seconds.</i>");
throw new <API key>(
"Element [ " + <API key>() + " ] is not HIDDEN on the page after [ "
+ (timeLapse) / 1000.0 + " ] seconds.",
driver);
} else if (!found) {
interfaceLog("<i>Element [<b>" + <API key>()
+ " </b>] is not <b>HIDDEN</b> on the page after [ "
+ (timeLapse) / 1000.0 + " ] seconds.</i>");
logTrace("Exiting ElementImpl#syncHidden");
return found;
}
interfaceLog("<i>Element [<b>" + <API key>() + " </b>] is <b>HIDDEN</b> on the page after [ " + (timeLapse) / 1000.0 + " ] seconds.</i>");
logTrace("Exiting ElementImpl#syncHidden");
return found;
}
/**
* Used to determine if the desired element is enabled on the screen
* Will wait for default element timeout unless new timeout is passed in
* If object is not enabled within the time, handle the error based default handler
* or by boolean passed in
*
* @author Justin
* @param args
* Optional arguments </br>
* <b>timeout</b> - the maximum time in seconds the method should try to sync. Called
* with syncEnabled(10)</br>
* <b><API key> </b>- if TRUE, the test will throw an exception and
* fail the script. If FALSE, the script will
* not fail, instead a FALSE will be returned
* to the calling function. Called with
* syncEnabled(10, false)
*/
@Override
public boolean syncEnabled(Object... args) {
logTrace("Entering ElementImpl#syncEnabled");
int requestedTimeout = Constants.ELEMENT_TIMEOUT;
int originalTimeout = driver.getElementTimeout(); // to set back the implicit wait to original value
boolean failTestOnSync = <API key>;
try {
if (args[0] != null) {
requestedTimeout = Integer.valueOf(args[0].toString());
}
if (args[1] != null) {
failTestOnSync = Boolean.parseBoolean(args[1].toString());
}
} catch (<API key> aiobe) {
}
boolean found = false;
long timeLapse;
driver.setElementTimeout(0);
StopWatch stopwatch = new StopWatch();
interfaceLog("<i>Syncing to element [<b>" + <API key>()
+ "</b> ] to be <b>ENABLED</b> within [ <b>" + requestedTimeout + "</b> ] seconds.</i>");
stopwatch.start();
WebDriverWait wait = new WebDriverWait(driver, 1);
while (((stopwatch.getTime()) / 1000.0) < requestedTimeout && !found) {
try {
if (Highlight.getDebugMode()) {
Highlight.highlightDebug(driver, reload());
}
found = wait.pollingEvery(<API key>, TimeUnit.MILLISECONDS).until(ExpectedConditions.<API key>(reload())) != null;
} catch (<API key> | ClassCastException | <API key> | TimeoutException te) {
} catch (WebDriverException we) {
if (!we.getMessage().toLowerCase().contains("is not clickable at point")) {
throw we;
}
}
}
stopwatch.stop();
timeLapse = stopwatch.getTime();
stopwatch.reset();
driver.setElementTimeout(originalTimeout);
if (!found && failTestOnSync) {
Highlight.highlightError(driver, element);
interfaceLog("<i>Element [<b>" + <API key>()
+ " </b>] is not <b>ENABLED</b> on the page after [ "
+ (timeLapse) / 1000.0 + " ] seconds.</i>");
throw new <API key>(
"Element [ " + <API key>() + " ] is not ENABLED on the page after [ "
+ (timeLapse) / 1000.0 + " ] seconds.",
driver);
} else if (!found) {
interfaceLog("<i>Element [<b>" + <API key>()
+ " </b>] is not <b>ENABLED</b> on the page after [ "
+ (timeLapse) / 1000.0 + " ] seconds.</i>");
logTrace("Exiting ElementImpl#syncEnabled");
return found;
}
interfaceLog("<i>Element [<b>" + <API key>()
+ " </b>] is <b>ENABLED</b> on the page after [ "
+ (timeLapse) / 1000.0 + " ] seconds.</i>");
if (Highlight.getDebugMode()) {
Highlight.highlightSuccess(driver, reload());
}
logTrace("Exiting ElementImpl#syncEnabled");
return found;
}
/**
* Used to determine if the desired element is disabled on the screen
* Will wait for default element timeout unless new timeout is passed in
* If object is not disabled within the time, handle the error based default handler
* or by boolean passed in
*
* @author Justin
* @param args
* Optional arguments </br>
* <b>timeout</b> - the maximum time in seconds the method should try to sync. Called
* with syncDisabled(10)</br>
* <b><API key> </b>- if TRUE, the test will throw an exception and
* fail the script. If FALSE, the script will
* not fail, instead a FALSE will be returned
* to the calling function. Called with
* syncDisabled(10, false)
*/
@Override
public boolean syncDisabled(Object... args) {
logTrace("Entering ElementImpl#syncDisabled");
int requestedTimeout = Constants.ELEMENT_TIMEOUT;
int originalTimeout = driver.getElementTimeout(); // to set back the implicit wait to original value
boolean failTestOnSync = <API key>;
try {
if (args[0] != null) {
requestedTimeout = Integer.valueOf(args[0].toString());
}
if (args[1] != null) {
failTestOnSync = Boolean.parseBoolean(args[1].toString());
}
} catch (<API key> aiobe) {
}
boolean found = false;
long timeLapse;
driver.setElementTimeout(0);
StopWatch stopwatch = new StopWatch();
interfaceLog("<i>Syncing to element [<b>" + <API key>()
+ "</b> ] to be <b>DISABLED</b> within [ <b>" + requestedTimeout + "</b> ] seconds.</i>");
stopwatch.start();
WebDriverWait wait = new WebDriverWait(driver, 1);
while (((stopwatch.getTime()) / 1000.0) < requestedTimeout && !found) {
try {
if (Highlight.getDebugMode()) {
Highlight.highlightDebug(driver, reload());
}
found = wait.pollingEvery(<API key>, TimeUnit.MILLISECONDS).until(ExpectedConditions.not(ExpectedConditions.<API key>(reload()))) != null;
} catch (<API key> | ClassCastException | <API key> | TimeoutException te) {
} catch (WebDriverException we) {
if (!we.getMessage().toLowerCase().contains("is not clickable at point")) {
throw we;
}
}
}
stopwatch.stop();
timeLapse = stopwatch.getTime();
stopwatch.reset();
driver.setElementTimeout(originalTimeout);
if (!found && failTestOnSync) {
Highlight.highlightError(driver, reload());
interfaceLog("<i>Element [<b>" + <API key>()
+ " </b>] is not <b>DISABLED</b> on the page after [ "
+ (timeLapse) / 1000.0 + " ] seconds.</i>");
throw new <API key>(
"Element [ " + <API key>() + " ] is not DISABLED on the page after [ "
+ (timeLapse) / 1000.0 + " ] seconds.",
driver);
} else if (!found) {
interfaceLog("<i>Element [<b>" + <API key>()
+ " </b>] is not <b>DISABLED</b> on the page after [ "
+ (timeLapse) / 1000.0 + " ] seconds.</i>");
logTrace("Exiting ElementImpl#syncDisabled");
return found;
}
interfaceLog("<i>Element [<b>" + <API key>()
+ " </b>] is <b>DISABLED</b> on the page after [ "
+ (timeLapse) / 1000.0 + " ] seconds.</i>");
if (Highlight.getDebugMode()) {
Highlight.highlightSuccess(driver, reload());
}
logTrace("Exiting ElementImpl#syncDisabled");
return found;
}
/**
* Sync for the Element's text or it's value attribute contains the desired text.
* Additional parameters can be added to override the default timeout and if the
* test should fail if the sync fails
*
* @param text
* (Required) The text the element should contain in either its text or value attribute
* @param args
* Optional arguments </br>
* <b>timeout</b> - the maximum time in seconds the method should try to sync. Called
* with syncTextInElement("text", 10)</br>
* <b><API key> </b>- if TRUE, the test will throw an exception and
* fail the script. If FALSE, the script will
* not fail, instead a FALSE will be returned
* to the calling function. Called with
* syncTextInElement("text", 10, false)
*/
@Override
public boolean syncTextInElement(String text, Object... args) {
logTrace("Entering ElementImpl#syncTextInElement");
int requestedTimeout = Constants.ELEMENT_TIMEOUT;
int originalTimeout = driver.getElementTimeout(); // to set back the implicit wait to original value
boolean failTestOnSync = <API key>;
try {
if (args[0] != null) {
requestedTimeout = Integer.valueOf(args[0].toString());
}
if (args[1] != null) {
failTestOnSync = Boolean.parseBoolean(args[1].toString());
}
} catch (<API key> aiobe) {
}
boolean found = false;
long timeLapse;
StopWatch stopwatch = new StopWatch();
interfaceLog("<i>Syncing to text [<b>" + text + "</b> ] in element [<b>"
+ <API key>() + "</b> ] to be displayed within [ <b>" + requestedTimeout + "</b> ] seconds.</i>");
driver.setElementTimeout(0);
WebDriverWait wait = new WebDriverWait(driver, 0);
stopwatch.start();
if (Highlight.getDebugMode()) {
Highlight.highlightDebug(driver, reload());
}
do {
try {
if (wait.until(ExpectedConditions.<API key>(reload(), text)) != null) {
found = true;
} else if (wait.until(ExpectedConditions.<API key>(reload(), text)) != null) {
found = true;
}
if (found) {
break;
}
} catch (<API key> | ClassCastException | <API key> | TimeoutException te) {
}
} while (stopwatch.getTime() / 1000.0 < requestedTimeout);
stopwatch.stop();
timeLapse = stopwatch.getTime();
stopwatch.reset();
driver.setElementTimeout(originalTimeout);
if (!found && failTestOnSync) {
Highlight.highlightError(driver, element);
interfaceLog(
"<i>Element [<b>" + <API key>() + " </b>] did not contain the text [ " + text
+ " ] after [ " + (timeLapse) / 1000.0 + " ] seconds.</i>");
throw new <API key>(
"Element [ " + <API key>() + " ] did not contain the text [ " + text
+ " ] after [ " + (timeLapse) / 1000.0 + " ] seconds.",
driver);
} else if (!found) {
interfaceLog(
"<i>Element [<b>" + <API key>() + " </b>] did not contain the text [ " + text
+ " ] after [ " + (timeLapse) / 1000.0 + " ] seconds.</i>");
logTrace("Exiting ElementImpl#syncTextInElement");
return found;
}
interfaceLog(
"<i>Element [<b>" + <API key>() + " </b>] contains the text [ " + text
+ " ] after [ " + (timeLapse) / 1000.0 + " ] seconds.</i>");
if (Highlight.getDebugMode()) {
Highlight.highlightSuccess(driver, reload());
}
logTrace("Exiting ElementImpl#syncTextInElement");
return found;
}
/**
* Sync for the Element's text or it's value attribute contains the desired text.
* Additional parameters can be added to override the default timeout and if the
* test should fail if the sync fails
*
* @param regex
* (Required) The text the element should contain in either its text or value attribute
* @param args
* Optional arguments </br>
* <b>timeout</b> - the maximum time in seconds the method should try to sync. Called
* with <API key>("text", 10)</br>
* <b><API key> </b>- if TRUE, the test will throw an exception and
* fail the script. If FALSE, the script will
* not fail, instead a FALSE will be returned
* to the calling function. Called with
* <API key>("text", 10, false)
*/
@Override
public boolean <API key>(String regex, Object... args) {
logTrace("Entering ElementImpl#<API key>");
int requestedTimeout = Constants.ELEMENT_TIMEOUT;
int originalTimeout = driver.getElementTimeout(); // to set back the implicit wait to original value
boolean failTestOnSync = <API key>;
try {
if (args[0] != null) {
requestedTimeout = Integer.valueOf(args[0].toString());
}
if (args[1] != null) {
failTestOnSync = Boolean.parseBoolean(args[1].toString());
}
} catch (<API key> aiobe) {
}
boolean found = false;
long timeLapse;
driver.setElementTimeout(0);
StopWatch stopwatch = new StopWatch();
interfaceLog("<i>Syncing to text regular expression [<b>" + regex + "</b> ] in element [<b>"
+ <API key>() + "</b> ] to be displayed within [ <b>" + requestedTimeout + "</b> ] seconds.</i>");
stopwatch.start();
WebDriverWait wait = new WebDriverWait(driver, 0);
do {
try {
if (Highlight.getDebugMode()) {
Highlight.highlightDebug(driver, reload());
}
if (wait.until(<API key>.<API key>(reload(), regex)) != null) {
found = true;
} else if (wait.until(<API key>.<API key>(reload(), "value", regex)) != null) {
found = true;
}
if (found) {
break;
}
} catch (<API key> | ClassCastException | <API key> | TimeoutException e) {
}
} while (stopwatch.getTime() / 1000.0 < requestedTimeout);
stopwatch.stop();
timeLapse = stopwatch.getTime();
stopwatch.reset();
driver.setElementTimeout(originalTimeout);
if (!found && failTestOnSync) {
Highlight.highlightError(driver, reload());
interfaceLog(
"<i>Element [<b>" + <API key>() + " </b>] did not contain the text [ " + regex
+ " ] after [ " + (timeLapse) / 1000.0 + " ] seconds.</i>");
throw new <API key>(
"Element [ " + <API key>() + " ] did not contain the text [ " + regex
+ " ] after [ " + (timeLapse) / 1000.0 + " ] seconds.",
driver);
} else if (!found) {
interfaceLog(
"<i>Element [<b>" + <API key>() + " </b>] did not contain the text [ " + regex
+ " ] after [ " + (timeLapse) / 1000.0 + " ] seconds.</i>");
logTrace("Exiting ElementImpl#<API key>");
return found;
}
interfaceLog(
"<i>Element [<b>" + <API key>() + " </b>] contains the text [ " + regex
+ " ] after [ " + (timeLapse) / 1000.0 + " ] seconds.</i>");
if (Highlight.getDebugMode()) {
Highlight.highlightSuccess(driver, reload());
}
logTrace("Exiting ElementImpl#<API key>");
return found;
}
/**
* Sync for the Element's text or it's value attribute contains the desired text.
* Additional parameters can be added to override the default timeout and if the
* test should fail if the sync fails
*
* @param attribute
* (Required) - Element attribute to view
* @param value
* (Required) - The text the element attribute should contain in either its text or value attribute
* @param args
* Optional arguments </br>
* <b>timeout</b> - the maximum time in seconds the method should try to sync. Called
* with <API key>("text", 10)</br>
* <b><API key> </b>- if TRUE, the test will throw an exception and
* fail the script. If FALSE, the script will
* not fail, instead a FALSE will be returned
* to the calling function. Called with
* <API key>("text", 10, false)
*/
@Override
public boolean <API key>(String attribute, String value, Object... args) {
logTrace("Entering ElementImpl#<API key>");
int requestedTimeout = Constants.ELEMENT_TIMEOUT;
int originalTimeout = driver.getElementTimeout(); // to set back the implicit wait to original value
boolean failTestOnSync = <API key>;
try {
if (args[0] != null) {
requestedTimeout = Integer.valueOf(args[0].toString());
}
if (args[1] != null) {
failTestOnSync = Boolean.parseBoolean(args[1].toString());
}
} catch (<API key> aiobe) {
}
boolean found = false;
long timeLapse;
driver.setElementTimeout(0);
StopWatch stopwatch = new StopWatch();
interfaceLog("<i>Syncing to attribute [<b> " + attribute + "</b> ] to contain [<b> " + value + "</b> ] in element [<b>"
+ <API key>() + "</b> ] to be displayed within [ <b> " + requestedTimeout + "</b> ] seconds.</i>");
stopwatch.start();
WebDriverWait wait = new WebDriverWait(driver, 1);
while (((stopwatch.getTime()) / 1000.0) < requestedTimeout && !found) {
try {
if (Highlight.getDebugMode()) {
Highlight.highlightDebug(driver, reload());
}
found = wait.pollingEvery(<API key>, TimeUnit.MILLISECONDS).until(<API key>.<API key>(reload(), attribute, value));
} catch (<API key> | ClassCastException | <API key> | TimeoutException te) {
}
}
stopwatch.stop();
timeLapse = stopwatch.getTime();
stopwatch.reset();
driver.setElementTimeout(originalTimeout);
if (!found && failTestOnSync) {
Highlight.highlightError(driver, reload());
interfaceLog(
"<i>Element [<b>" + <API key>() + " </b>] attribute [<b>" + attribute + "</b> ] did not contain the text [ " + value
+ " ] after [ " + (timeLapse) / 1000.0 + " ] seconds.</i>");
throw new <API key>(
"Element [ " + <API key>() + " ]attribute [" + attribute + "] did not contain the text [ " + value
+ " ] after [ " + (timeLapse) / 1000.0 + " ] seconds.",
driver);
} else if (!found) {
interfaceLog(
"<i>Element [<b>" + <API key>() + " </b>] attribute [<b>" + attribute + "</b> ] did not contain the text [ " + value
+ " ] after [ " + (timeLapse) / 1000.0 + " ] seconds.</i>");
logTrace("Exiting ElementImpl#<API key>");
return found;
}
interfaceLog(
"<i>Element [<b>" + <API key>() + " </b>] attribute [<b>" + attribute + "</b> ] contains the text [ " + value
+ " ] after [ " + (timeLapse) / 1000.0 + " ] seconds.</i>");
if (Highlight.getDebugMode()) {
Highlight.highlightSuccess(driver, reload());
}
logTrace("Exiting ElementImpl#<API key>");
return found;
}
/**
* Sync for the Element's text or it's value attribute contains the desired text.
* Additional parameters can be added to override the default timeout and if the
* test should fail if the sync fails
*
* @param attribute
* (Required) - Element attribute to view
* @param regex
* (Required) - The regular expression that should match the text of the element attribute
* @param args
* Optional arguments </br>
* <b>timeout</b> - the maximum time in seconds the method should try to sync. Called
* with <API key>("text", 10)</br>
* <b><API key> </b>- if TRUE, the test will throw an exception and
* fail the script. If FALSE, the script will
* not fail, instead a FALSE will be returned
* to the calling function. Called with
* <API key>("text", 10, false)
*/
@Override
public boolean <API key>(String attribute, String regex, Object... args) {
logTrace("Entering ElementImpl#<API key>");
int requestedTimeout = Constants.ELEMENT_TIMEOUT;
int originalTimeout = driver.getElementTimeout(); // to set back the implicit wait to original value
boolean failTestOnSync = <API key>;
try {
if (args[0] != null) {
requestedTimeout = Integer.valueOf(args[0].toString());
}
if (args[1] != null) {
failTestOnSync = Boolean.parseBoolean(args[1].toString());
}
} catch (<API key> aiobe) {
}
boolean found = false;
long timeLapse;
driver.setElementTimeout(0);
StopWatch stopwatch = new StopWatch();
interfaceLog("<i>Syncing to attribute [<b> " + attribute + "</b> ] to match the regular expression of [<b> " + regex + "</b> ] in element [<b>"
+ <API key>() + "</b> ] to be displayed within [ <b> " + requestedTimeout + "</b> ] seconds.</i>");
WebDriverWait wait = new WebDriverWait(driver, 1);
stopwatch.start();
while (((stopwatch.getTime()) / 1000.0) < requestedTimeout && !found) {
try {
if (Highlight.getDebugMode()) {
Highlight.highlightDebug(driver, reload());
}
found = wait.pollingEvery(<API key>, TimeUnit.MILLISECONDS).until(<API key>.<API key>(reload(), attribute, regex));
} catch (<API key> | ClassCastException | <API key> | TimeoutException te) {
found = false;
}
}
stopwatch.stop();
timeLapse = stopwatch.getTime();
stopwatch.reset();
driver.setElementTimeout(originalTimeout);
if (!found && failTestOnSync) {
Highlight.highlightError(driver, reload());
interfaceLog(
"<i>Element [<b>" + <API key>() + " </b>] attribute [<b>" + attribute + "</b> ] did not match the regular expression of [ " + regex
+ " ] after [ " + (timeLapse) / 1000.0 + " ] seconds.</i>");
throw new <API key>(
"Element [ " + <API key>() + " ]attribute [" + attribute + "] did not match the regular expression of [ " + regex
+ " ] after [ " + (timeLapse) / 1000.0 + " ] seconds.",
driver);
} else if (!found) {
interfaceLog(
"<i>Element [<b>" + <API key>() + " </b>] attribute [<b>" + attribute + "</b> ] did not match the regular expression of [ " + regex
+ " ] after [ " + (timeLapse) / 1000.0 + " ] seconds.</i>");
logTrace("Exiting ElementImpl#<API key>");
return found;
}
interfaceLog(
"<i>Element [<b>" + <API key>() + " </b>] attribute [<b>" + attribute + "</b> ] matches the regular expression of [ " + regex
+ " ] after [ " + (timeLapse) / 1000.0 + " ] seconds.</i>");
if (Highlight.getDebugMode()) {
Highlight.highlightSuccess(driver, reload());
}
logTrace("Exiting ElementImpl#<API key>");
return found;
}
/**
* Sync for the Element's text or it's value attribute contains the desired text.
* Additional parameters can be added to override the default timeout and if the
* test should fail if the sync fails
*
* @param cssProperty
* (Required) - Element CSS Property to view
* @param value
* (Required) - The text the element attribute should contain in either its text or value attribute
* @param args
* Optional arguments </br>
* <b>timeout</b> - the maximum time in seconds the method should try to sync. Called
* with <API key>("text", 10)</br>
* <b><API key> </b>- if TRUE, the test will throw an exception and
* fail the script. If FALSE, the script will
* not fail, instead a FALSE will be returned
* to the calling function. Called with
* <API key>("text", 10, false)
*/
@Override
public boolean <API key>(String cssProperty, String value, Object... args) {
logTrace("Entering ElementImpl#<API key>");
int requestedTimeout = Constants.ELEMENT_TIMEOUT;
int originalTimeout = driver.getElementTimeout(); // to set back the implicit wait to original value
boolean failTestOnSync = <API key>;
try {
if (args[0] != null) {
requestedTimeout = Integer.valueOf(args[0].toString());
}
if (args[1] != null) {
failTestOnSync = Boolean.parseBoolean(args[1].toString());
}
} catch (<API key> aiobe) {
}
boolean found = false;
long timeLapse;
driver.setElementTimeout(0);
StopWatch stopwatch = new StopWatch();
interfaceLog("<i>Syncing to CSS Property [<b> " + cssProperty + "</b> ] to contain [<b> " + value + "</b> ] in element [<b>"
+ <API key>() + "</b> ] to be displayed within [ <b> " + requestedTimeout + "</b> ] seconds.</i>");
WebDriverWait wait = new WebDriverWait(driver, 1);
stopwatch.start();
while (((stopwatch.getTime()) / 1000.0) < requestedTimeout && !found) {
try {
if (Highlight.getDebugMode()) {
Highlight.highlightDebug(driver, reload());
}
found = wait.pollingEvery(<API key>, TimeUnit.MILLISECONDS).until(<API key>.<API key>(reload(), cssProperty, value));
} catch (<API key> | ClassCastException | <API key> | TimeoutException te) {
found = false;
}
}
stopwatch.stop();
timeLapse = stopwatch.getTime();
stopwatch.reset();
driver.setElementTimeout(originalTimeout);
if (!found && failTestOnSync) {
Highlight.highlightError(driver, reload());
interfaceLog(
"<i>Element [<b>" + <API key>() + " </b>] CSS Property [<b>" + cssProperty + "</b> ] did not contain the text [ " + value
+ " ] after [ " + (timeLapse) / 1000.0 + " ] seconds.</i>");
throw new <API key>("Element [ " + <API key>() + " ] CSS Property [" + cssProperty + " ] did not contain the text [ " + value
+ " ] after [ " + (timeLapse) / 1000.0 + " ] seconds.", driver);
} else if (!found) {
interfaceLog(
"<i>Element [<b>" + <API key>() + " </b>] CSS Property [<b>" + cssProperty + "</b> ] did not contain the text [ " + value
+ " ] after [ " + (timeLapse) / 1000.0 + " ] seconds.</i>");
logTrace("Exiting ElementImpl#<API key>");
return found;
}
interfaceLog(
"<i>Element [<b>" + <API key>() + " </b>] CSS Property [<b>" + cssProperty + "</b> ] contains the text [ " + value
+ " ] after [ " + (timeLapse) / 1000.0 + " ] seconds.</i>");
if (Highlight.getDebugMode()) {
Highlight.highlightSuccess(driver, reload());
}
logTrace("Exiting ElementImpl#<API key>");
return found;
}
/**
* Sync for the Element's text or it's value attribute contains the desired text.
* Additional parameters can be added to override the default timeout and if the
* test should fail if the sync fails
*
* @param cssProperty
* (Required) - Element CSS Property to match
* @param regex
* (Required) - The regular expression that should match the text of the element CSS Property
* @param args
* Optional arguments </br>
* <b>timeout</b> - the maximum time in seconds the method should try to sync. Called
* with syncCssMatchesValue("text", 10)</br>
* <b><API key> </b>- if TRUE, the test will throw an exception and
* fail the script. If FALSE, the script will
* not fail, instead a FALSE will be returned
* to the calling function. Called with
* syncCssMatchesValue("text", 10, false)
*/
@Override
public boolean <API key>(String cssProperty, String regex, Object... args) {
logTrace("Entering ElementImpl#<API key>");
int requestedTimeout = Constants.ELEMENT_TIMEOUT;
int originalTimeout = driver.getElementTimeout(); // to set back the implicit wait to original value
boolean failTestOnSync = <API key>;
try {
if (args[0] != null) {
requestedTimeout = Integer.valueOf(args[0].toString());
}
if (args[1] != null) {
failTestOnSync = Boolean.parseBoolean(args[1].toString());
}
} catch (<API key> aiobe) {
}
boolean found = false;
long timeLapse;
driver.setElementTimeout(0);
StopWatch stopwatch = new StopWatch();
interfaceLog("<i>Syncing to CSS Property [<b> " + cssProperty + "</b> ] to contain [<b> " + regex + "</b> ] in element [<b>"
+ <API key>() + "</b> ] to be displayed within [ <b> " + requestedTimeout + "</b> ] seconds.</i>");
WebDriverWait wait = new WebDriverWait(driver, 0);
stopwatch.start();
while (((stopwatch.getTime()) / 1000.0) < requestedTimeout && !found) {
try {
if (Highlight.getDebugMode()) {
Highlight.highlightDebug(driver, reload());
}
found = wait.pollingEvery(<API key>, TimeUnit.MILLISECONDS).until(<API key>.<API key>(reload(), cssProperty, regex));
} catch (<API key> | ClassCastException | <API key> | TimeoutException te) {
found = false;
}
}
stopwatch.stop();
timeLapse = stopwatch.getTime();
stopwatch.reset();
driver.setElementTimeout(originalTimeout);
if (!found && failTestOnSync) {
Highlight.highlightError(driver, reload());
interfaceLog(
"<i>Element [<b>" + <API key>() + " </b>] CSS Property [<b>" + cssProperty + "</b> ] did not match the regular expression of [ " + regex
+ " ] after [ " + (timeLapse) / 1000.0 + " ] seconds.</i>");
throw new <API key>(
"Element [ " + <API key>() + " ] CSS Property [" + cssProperty + "] did not match the regular expression of [ " + regex
+ " ] after [ " + (timeLapse) / 1000.0 + " ] seconds.",
driver);
} else if (!found) {
interfaceLog(
"<i>Element [<b>" + <API key>() + " </b>] CSS Property [<b>" + cssProperty + "</b> ] did not match the regular expression of [ " + regex
+ " ] after [ " + (timeLapse) / 1000.0 + " ] seconds.</i>");
logTrace("Exiting ElementImpl#<API key>");
return found;
}
interfaceLog(
"<i>Element [<b>" + <API key>() + " </b>] CSS Property [<b>" + cssProperty + "</b> ] matches the regular expression of [ " + regex
+ " ] after [ " + (timeLapse) / 1000.0 + " ] seconds.</i>");
if (Highlight.getDebugMode()) {
Highlight.highlightSuccess(driver, reload());
}
logTrace("Exiting ElementImpl#<API key>");
return found;
}
@Beta
protected Element reload() {
logTrace("Entering ElementImpl#reload");
Element el = null;
logTrace("Search DOM for element [ " + by.toString() + " ]");
try {
WebDriverWait wait = new WebDriverWait(driver.getWebDriver(), driver.getElementTimeout());
wait.until(ExpectedConditions.<API key>(by));
el = driver.findElement(by);
} catch (WebDriverException wde) {
throw new <API key>("Failed locate element [ " + by.toString() + " ]");
}
logTrace("Found element [ " + by.toString() + " ]");
logTrace("Exiting ElementImpl#reload");
return el;
}
@Override
@Beta
public boolean syncInFrame(Object... args) {
logTrace("Entering ElementImpl#syncInFrame");
final String action = "<b>FOUND IN FRAME</b>";
int requestedTimeout = Constants.ELEMENT_TIMEOUT;
int originalTimeout = driver.getElementTimeout(); // to set back the implicit wait to original value
boolean failTestOnSync = <API key>;
try {
if (args[0] != null) {
requestedTimeout = Integer.valueOf(args[0].toString());
}
if (args[1] != null) {
failTestOnSync = Boolean.parseBoolean(args[1].toString());
}
} catch (<API key> aiobe) {
}
interfaceLog("<i>Syncing to element [<b>" + <API key>()
+ "</b> ] to be " + action + " within [ <b>" + requestedTimeout + "</b> ] seconds.</i>");
StopWatch stopwatch = new StopWatch();
boolean found = false;
long timeLapse;
WebDriverWait wait = new WebDriverWait(driver, 1);
driver.setElementTimeout(0);
stopwatch.start();
while (((stopwatch.getTime()) / 1000.0) < requestedTimeout && !found) {
try {
found = wait.pollingEvery(<API key>, TimeUnit.MILLISECONDS).until(<API key>.<API key>(by));
} catch (<API key> | ClassCastException | <API key> | TimeoutException te) {
}
}
stopwatch.stop();
timeLapse = stopwatch.getTime();
stopwatch.reset();
driver.setElementTimeout(originalTimeout);
if (!found && failTestOnSync) {
logTrace("Element not " + action + " and failTestOnSync is [ TRUE ]");
interfaceLog("<i>Element [<b>" + <API key>()
+ " </b>] is not " + action + " on the page after [ "
+ (timeLapse) / 1000.0 + " ] seconds.</i>");
throw new <API key>(
"Element [ " + <API key>() + " ] is not FOUND IN FRAME on the page after [ "
+ (timeLapse) / 1000.0 + " ] seconds.",
driver);
} else if (!found) {
interfaceLog("<i>Element [<b>" + <API key>()
+ " </b>] is not " + action + " on the page after [ "
+ (timeLapse) / 1000.0 + " ] seconds.</i>");
logTrace("Exiting ElementImpl#syncInFrame");
return found;
}
interfaceLog("<i>Element [<b>" + <API key>() + " </b>] is " + action + " on the page after [ " + (timeLapse) / 1000.0 + " ] seconds.</i>");
logTrace("Exiting ElementImpl#syncInFrame");
return found;
}
@Override
public Rectangle getRect() {
// TODO Auto-generated method stub
return null;
}
}
|
package org.hisp.dhis.reporttable;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonView;
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty;
import com.fasterxml.jackson.dataformat.xml.annotation.<API key>;
import org.hisp.dhis.common.DxfNamespaces;
import org.hisp.dhis.common.view.DetailedView;
import org.hisp.dhis.common.view.DimensionalView;
import org.hisp.dhis.common.view.ExportView;
import java.io.Serializable;
/**
* The ReportParams object represents report parameters for a ReportTable. Report
* parameters are meant to make ReportTables more generic, as it can avoid having
* dynamic, selectable parameters rather than static.
*
* @author Lars Helge Overland
* @version $Id$
*/
@<API key>( localName = "reportParams", namespace = DxfNamespaces.DXF_2_0)
public class ReportParams
implements Serializable
{
/**
* Determines if a de-serialized file is compatible with this class.
*/
private static final long serialVersionUID = <API key>;
private Boolean paramReportingMonth; //TODO rename to <API key>
private Boolean <API key>;
private Boolean <API key>;
private Boolean <API key>;
// Constructors
public ReportParams()
{
}
public ReportParams( boolean paramReportingMonth, boolean <API key>,
boolean <API key>, boolean <API key> )
{
this.paramReportingMonth = paramReportingMonth;
this.<API key> = <API key>;
this.<API key> = <API key>;
this.<API key> = <API key>;
}
// Logic
public boolean <API key>()
{
return paramReportingMonth != null && paramReportingMonth;
}
public boolean <API key>()
{
return <API key> != null && <API key>;
}
public boolean <API key>()
{
return <API key> != null && <API key>;
}
public boolean <API key>()
{
return <API key> != null && <API key>;
}
public boolean isSet()
{
return <API key>() || <API key>();
}
public boolean <API key>()
{
return <API key>() ||
<API key>() || <API key>();
}
// Getters and setters
@JsonProperty( value = "<API key>" )
@JsonView( {DetailedView.class, ExportView.class, DimensionalView.class} )
@JacksonXmlProperty( namespace = DxfNamespaces.DXF_2_0)
public Boolean <API key>()
{
return paramReportingMonth;
}
public void <API key>( Boolean paramReportingMonth )
{
this.paramReportingMonth = paramReportingMonth;
}
@JsonProperty
@JsonView( {DetailedView.class, ExportView.class} )
@JacksonXmlProperty( namespace = DxfNamespaces.DXF_2_0)
public Boolean <API key>()
{
return <API key>;
}
public void <API key>( Boolean <API key> )
{
this.<API key> = <API key>;
}
@JsonProperty
@JsonView( {DetailedView.class, ExportView.class, DimensionalView.class} )
@JacksonXmlProperty( namespace = DxfNamespaces.DXF_2_0)
public Boolean <API key>()
{
return <API key>;
}
public void <API key>( Boolean <API key> )
{
this.<API key> = <API key>;
}
@JsonProperty
@JsonView( {DetailedView.class, ExportView.class, DimensionalView.class} )
@JacksonXmlProperty( namespace = DxfNamespaces.DXF_2_0)
public Boolean <API key>()
{
return <API key>;
}
public void <API key>( Boolean <API key> )
{
this.<API key> = <API key>;
}
}
|
#include "ui/compositor/<API key>.h"
#include "base/basictypes.h"
#include "base/compiler_specific.h"
#include "base/memory/scoped_ptr.h"
#include "base/time.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "ui/compositor/<API key>.h"
#include "ui/compositor/test/<API key>.h"
#include "ui/compositor/test/test_utils.h"
#include "ui/gfx/rect.h"
#include "ui/gfx/transform.h"
namespace ui {
namespace {
// Check that the transformation element progresses the delegate as expected and
// that the element can be reused after it completes.
TEST(<API key>, TransformElement) {
<API key> delegate;
gfx::Transform start_transform, target_transform, middle_transform;
start_transform.Rotate(-30.0);
target_transform.Rotate(30.0);
base::TimeTicks start_time;
base::TimeDelta delta = base::TimeDelta::FromSeconds(1);
scoped_ptr<<API key>> element(
<API key>::<API key>(target_transform, delta));
for (int i = 0; i < 2; ++i) {
start_time += delta;
element->set_start_time(start_time);
delegate.<API key>(start_transform);
element->Progress(start_time, &delegate);
<API key>(start_transform,
delegate.<API key>());
element->Progress(start_time + delta/2, &delegate);
<API key>(middle_transform,
delegate.<API key>());
element->Progress(start_time + delta, &delegate);
<API key>(target_transform,
delegate.<API key>());
}
<API key>::TargetValue target_value(&delegate);
element->GetTargetValue(&target_value);
<API key>(target_transform, target_value.transform);
base::TimeDelta element_duration;
EXPECT_TRUE(element->IsFinished(start_time + delta, &element_duration));
EXPECT_EQ(delta, element_duration);
}
// Check that the bounds element progresses the delegate as expected and
// that the element can be reused after it completes.
TEST(<API key>, BoundsElement) {
<API key> delegate;
gfx::Rect start, target, middle;
start = target = middle = gfx::Rect(0, 0, 50, 50);
start.set_x(-90);
target.set_x(90);
base::TimeTicks start_time;
base::TimeDelta delta = base::TimeDelta::FromSeconds(1);
scoped_ptr<<API key>> element(
<API key>::CreateBoundsElement(target, delta));
for (int i = 0; i < 2; ++i) {
start_time += delta;
element->set_start_time(start_time);
delegate.<API key>(start);
element->Progress(start_time, &delegate);
<API key>(start, delegate.<API key>());
element->Progress(start_time + delta/2, &delegate);
<API key>(middle, delegate.<API key>());
element->Progress(start_time + delta, &delegate);
<API key>(target, delegate.<API key>());
}
<API key>::TargetValue target_value(&delegate);
element->GetTargetValue(&target_value);
<API key>(target, target_value.bounds);
base::TimeDelta element_duration;
EXPECT_TRUE(element->IsFinished(start_time + delta, &element_duration));
EXPECT_EQ(delta, element_duration);
}
// Check that the opacity element progresses the delegate as expected and
// that the element can be reused after it completes.
TEST(<API key>, OpacityElement) {
<API key> delegate;
float start = 0.0;
float middle = 0.5;
float target = 1.0;
base::TimeTicks start_time;
base::TimeDelta delta = base::TimeDelta::FromSeconds(1);
scoped_ptr<<API key>> element(
<API key>::<API key>(target, delta));
for (int i = 0; i < 2; ++i) {
start_time += delta;
element->set_start_time(start_time);
delegate.<API key>(start);
element->Progress(start_time, &delegate);
EXPECT_FLOAT_EQ(start, delegate.<API key>());
element->Progress(start_time + delta/2, &delegate);
EXPECT_FLOAT_EQ(middle, delegate.<API key>());
element->Progress(start_time + delta, &delegate);
EXPECT_FLOAT_EQ(target, delegate.<API key>());
}
<API key>::TargetValue target_value(&delegate);
element->GetTargetValue(&target_value);
EXPECT_FLOAT_EQ(target, target_value.opacity);
base::TimeDelta element_duration;
EXPECT_TRUE(element->IsFinished(start_time + delta, &element_duration));
EXPECT_EQ(delta, element_duration);
}
// Check that the visibility element progresses the delegate as expected and
// that the element can be reused after it completes.
TEST(<API key>, VisibilityElement) {
<API key> delegate;
bool start = true;
bool target = false;
base::TimeTicks start_time;
base::TimeDelta delta = base::TimeDelta::FromSeconds(1);
scoped_ptr<<API key>> element(
<API key>::<API key>(target, delta));
for (int i = 0; i < 2; ++i) {
start_time += delta;
element->set_start_time(start_time);
delegate.<API key>(start);
element->Progress(start_time, &delegate);
EXPECT_TRUE(delegate.<API key>());
element->Progress(start_time + delta/2, &delegate);
EXPECT_TRUE(delegate.<API key>());
element->Progress(start_time + delta, &delegate);
EXPECT_FALSE(delegate.<API key>());
}
<API key>::TargetValue target_value(&delegate);
element->GetTargetValue(&target_value);
EXPECT_FALSE(target_value.visibility);
base::TimeDelta element_duration;
EXPECT_TRUE(element->IsFinished(start_time + delta, &element_duration));
EXPECT_EQ(delta, element_duration);
}
// Check that the Brightness element progresses the delegate as expected and
// that the element can be reused after it completes.
TEST(<API key>, BrightnessElement) {
<API key> delegate;
float start = 0.0;
float middle = 0.5;
float target = 1.0;
base::TimeTicks start_time;
base::TimeDelta delta = base::TimeDelta::FromSeconds(1);
scoped_ptr<<API key>> element(
<API key>::<API key>(target, delta));
for (int i = 0; i < 2; ++i) {
start_time += delta;
element->set_start_time(start_time);
delegate.<API key>(start);
element->Progress(start_time, &delegate);
EXPECT_FLOAT_EQ(start, delegate.<API key>());
element->Progress(start_time + delta/2, &delegate);
EXPECT_FLOAT_EQ(middle, delegate.<API key>());
element->Progress(start_time + delta, &delegate);
EXPECT_FLOAT_EQ(target, delegate.<API key>());
}
<API key>::TargetValue target_value(&delegate);
element->GetTargetValue(&target_value);
EXPECT_FLOAT_EQ(target, target_value.brightness);
base::TimeDelta element_duration;
EXPECT_TRUE(element->IsFinished(start_time + delta, &element_duration));
EXPECT_EQ(delta, element_duration);
}
// Check that the Grayscale element progresses the delegate as expected and
// that the element can be reused after it completes.
TEST(<API key>, GrayscaleElement) {
<API key> delegate;
float start = 0.0;
float middle = 0.5;
float target = 1.0;
base::TimeTicks start_time;
base::TimeDelta delta = base::TimeDelta::FromSeconds(1);
scoped_ptr<<API key>> element(
<API key>::<API key>(target, delta));
for (int i = 0; i < 2; ++i) {
start_time += delta;
element->set_start_time(start_time);
delegate.<API key>(start);
element->Progress(start_time, &delegate);
EXPECT_FLOAT_EQ(start, delegate.<API key>());
element->Progress(start_time + delta/2, &delegate);
EXPECT_FLOAT_EQ(middle, delegate.<API key>());
element->Progress(start_time + delta, &delegate);
EXPECT_FLOAT_EQ(target, delegate.<API key>());
}
<API key>::TargetValue target_value(&delegate);
element->GetTargetValue(&target_value);
EXPECT_FLOAT_EQ(target, target_value.grayscale);
base::TimeDelta element_duration;
EXPECT_TRUE(element->IsFinished(start_time + delta, &element_duration));
EXPECT_EQ(delta, element_duration);
}
// Check that the pause element progresses the delegate as expected and
// that the element can be reused after it completes.
TEST(<API key>, PauseElement) {
<API key>::<API key> properties;
properties.insert(<API key>::TRANSFORM);
properties.insert(<API key>::BOUNDS);
properties.insert(<API key>::OPACITY);
properties.insert(<API key>::BRIGHTNESS);
properties.insert(<API key>::GRAYSCALE);
base::TimeTicks start_time;
base::TimeDelta delta = base::TimeDelta::FromSeconds(1);
scoped_ptr<<API key>> element(
<API key>::CreatePauseElement(properties, delta));
<API key> delegate;
<API key> copy = delegate;
start_time += delta;
element->set_start_time(start_time);
element->Progress(start_time + delta, &delegate);
// Nothing should have changed.
<API key>(delegate.<API key>(),
copy.<API key>());
<API key>(delegate.<API key>(),
copy.<API key>());
EXPECT_FLOAT_EQ(delegate.<API key>(),
copy.<API key>());
EXPECT_FLOAT_EQ(delegate.<API key>(),
copy.<API key>());
EXPECT_FLOAT_EQ(delegate.<API key>(),
copy.<API key>());
// Pause should last for |delta|.
base::TimeDelta element_duration;
EXPECT_TRUE(element->IsFinished(start_time + delta, &element_duration));
EXPECT_EQ(delta, element_duration);
}
} // namespace
} // namespace ui
|
/* STM32F412 */
#ifndef __BOARD_H
#define __BOARD_H
/* Baseboard features */
#include "base-board.h"
#undef <API key>
/*
* These allow console commands to be flagged as restricted.
* Restricted commands will only be permitted to run when
* <API key>() returns false.
* See <API key>'s definition in board.c.
*/
#define <API key>
#define <API key>
/*
* Enable the blink example that exercises the LEDs.
*/
#define CONFIG_BLINK
#define CONFIG_BLINK_LEDS GPIO_LED1, GPIO_LED2, GPIO_LED3
#endif /* __BOARD_H */
|
#ifndef BMX_AS11_INFO_H_
#define BMX_AS11_INFO_H_
#include <bmx/BMXTypes.h>
#include <bmx/as11/AS11CoreFramework.h>
#include <bmx/as11/UKDPPFramework.h>
#include <bmx/as11/<API key>.h>
namespace bmx
{
class AS11Info
{
public:
static void RegisterExtensions(mxfpp::DataModel *data_model);
public:
AS11Info();
~AS11Info();
bool Read(mxfpp::HeaderMetadata *header_metadata);
private:
void Reset();
void GetStaticFrameworks(std::vector<mxfpp::GenericTrack*> &tracks);
void GetSegmentation(std::vector<mxfpp::GenericTrack*> &tracks);
public:
AS11CoreFramework *core;
UKDPPFramework *ukdpp;
std::vector<mxfpp::StructuralComponent*> segmentation;
Rational segmentation_rate;
};
};
#endif
|
[class^="icon-"],
[class*=" icon-"] {
font-family: 'custom-icons';
font-style: normal;
font-weight: normal;
/* fix buttons height */
line-height: 1em;
/* you can be more comfortable with increased icons size */
/* font-size: 120%; */
}
.icon-plus { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '+ '); }
.icon-minus { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '- '); }
.icon-left { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '← '); }
.icon-up { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '↑ '); }
.icon-right { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '→ '); }
.icon-down { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '↓ '); }
.icon-home { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '⌂ '); }
.icon-pause { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '⎉ '); }
.icon-fast-fw { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '⏩ '); }
.icon-fast-bw { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '⏪ '); }
.icon-to-end { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '⏭ '); }
.icon-to-start { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '⏮ '); }
.icon-stop { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '▪ '); }
.icon-up-dir { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '▴ '); }
.icon-play { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '▶ '); }
.icon-right-dir { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '▸ '); }
.icon-down-dir { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '▾ '); }
.icon-left-dir { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '◂ '); }
.icon-cloud { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '☁ '); }
.icon-umbrella { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '☂ '); }
.icon-star { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '★ '); }
.icon-star-empty { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '☆ '); }
.icon-check { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '☑ '); }
.icon-left-hand { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '☜ '); }
.icon-up-hand { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '☝ '); }
.icon-right-hand { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '☞ '); }
.icon-down-hand { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '☟ '); }
.icon-th-list { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '☰ '); }
.icon-heart-empty { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '♡ '); }
.icon-heart { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '♥ '); }
.icon-music { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '♫ '); }
.icon-th { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '⚏ '); }
.icon-flag { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '⚑ '); }
.icon-cog { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '⚙ '); }
.icon-attention { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '⚠ '); }
.icon-flash { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '⚡ '); }
.icon-cog-alt { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '⛯ '); }
.icon-scissors { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '✂ '); }
.icon-flight { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '✈ '); }
.icon-mail { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '✉ '); }
.icon-edit { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '✍ '); }
.icon-pencil { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '✎ '); }
.icon-ok { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '✓ '); }
.icon-ok-circle { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '✔ '); }
.icon-cancel { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '✕ '); }
.icon-cancel-circle { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '✖ '); }
.icon-asterisk { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '✱ '); }
.<API key> { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '❗ '); }
.icon-quote-left { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '❝ '); }
.icon-quote-right { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '❞ '); }
.icon-plus-circle { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '➕ '); }
.icon-minus-circle { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '➖ '); }
.icon-forward { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '➦ '); }
.icon-ccw { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '⟲ '); }
.icon-cw { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '⟳ '); }
.<API key> { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '⬌ '); }
.<API key> { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '⬍ '); }
.icon-eject { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '⻏ '); }
.icon-left-circle { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); }
.icon-right-circle { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); }
.icon-up-circle { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); }
.icon-down-circle { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); }
.icon-star-half { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); }
.icon-ok-circle2 { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); }
.icon-cancel-circle2 { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); }
.icon-help-circle { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); }
.icon-info-circle { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); }
.icon-th-large { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); }
.icon-eye { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); }
.icon-eye-off { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); }
.icon-tag { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); }
.icon-tag-1 { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); }
.icon-tags { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); }
.icon-camera-alt { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); }
.icon-export { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); }
.icon-print { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); }
.icon-retweet { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); }
.icon-comment { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); }
.icon-comment-1 { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); }
.icon-chat-1 { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); }
.icon-location { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); }
.icon-trash { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); }
.icon-rss { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); }
.icon-basket { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); }
.icon-login { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); }
.icon-logout { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); }
.icon-resize-full { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); }
.icon-resize-small { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); }
.icon-zoom-in { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); }
.icon-zoom-out { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); }
.icon-down-circle2 { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); }
.icon-up-circle2 { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); }
.icon-down-open { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); }
.icon-left-open { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); }
.icon-right-open { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); }
.icon-up-open { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); }
.icon-arrows-cw { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); }
.icon-left-open-mini { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); }
.icon-play-circle2 { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); }
.<API key> { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); }
.icon-to-end-alt { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); }
.icon-to-start-alt { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); }
.icon-left-open-big { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); }
.icon-right-open-big { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); }
.icon-inbox { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); }
.icon-font { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); }
.icon-bold { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); }
.icon-italic { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); }
.icon-text-height { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); }
.icon-text-width { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); }
.icon-align-left { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); }
.icon-align-center { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); }
.icon-align-right { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); }
.icon-align-justify { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); }
.icon-list { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); }
.icon-indent-left { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); }
.icon-indent-right { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); }
.icon-off { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); }
.icon-road { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); }
.icon-list-alt { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); }
.icon-qrcode { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); }
.icon-barcode { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); }
.icon-ajust { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); }
.icon-tint { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); }
.icon-magnet { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); }
.icon-move { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); }
.icon-link-ext { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); }
.icon-check-empty { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); }
.icon-bookmark-empty { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); }
.icon-phone-squared { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); }
.icon-twitter { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); }
.icon-rss-1 { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); }
.icon-hdd { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); }
.icon-certificate { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); }
.icon-left-circled { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); }
.icon-right-circled { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); }
.icon-up-circled { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); }
.icon-down-circled { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); }
.icon-tasks { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); }
.icon-filter { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); }
.<API key> { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); }
.icon-beaker { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); }
.icon-docs { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); }
.icon-blank { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); }
.icon-menu { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); }
.icon-list-bullet { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); }
.icon-list-numbered { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); }
.icon-strike { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); }
.icon-underline { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); }
.icon-table { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); }
.icon-magic { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); }
.<API key> { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); }
.icon-gplus { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); }
.icon-money { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); }
.icon-columns { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); }
.icon-sort { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); }
.icon-sort-down { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); }
.icon-sort-up { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); }
.icon-mail-alt { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); }
.icon-gauge { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); }
.icon-comment-2 { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); }
.icon-chat { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); }
.icon-sitemap { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); }
.icon-paste { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); }
.icon-mobile { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); }
.icon-facebook { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); }
.icon-twitter-bird { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); }
.icon-icq { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); }
.icon-yandex { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); }
.icon-github { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); }
.icon-skype { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); }
.icon-odnoklassniki { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); }
.icon-vimeo { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); }
.icon-tumblr { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); }
.icon-friendfeed { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); }
.icon-blogger { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); }
.icon-deviantart { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); }
.icon-jabber { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); }
.icon-lastfm { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); }
.icon-linkedin { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); }
.icon-picasa { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); }
.icon-wordpress { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); }
.icon-instagram { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); }
.icon-picture { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '🌄 '); }
.icon-globe { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '🌎 '); }
.icon-leaf { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '🍂 '); }
.icon-lemon { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '🍋 '); }
.icon-glass { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '🍸 '); }
.icon-gift { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '🎁 '); }
.icon-videocam { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '🎥 '); }
.icon-headphones { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '🎧 '); }
.icon-video { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '🎬 '); }
.icon-target { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '🎯 '); }
.icon-award { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '🏉 '); }
.icon-thumbs-up { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '👍 '); }
.icon-thumbs-down { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '👎 '); }
.icon-user { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '👤 '); }
.icon-user-1 { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); }
.icon-users { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '👥 '); }
.icon-credit-card { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '💳 '); }
.icon-briefcase { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '💼 '); }
.icon-floppy { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '💾 '); }
.icon-folder { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '📁 '); }
.icon-folder-open { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '📂 '); }
.icon-doc { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '📄 '); }
.icon-calendar { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '📅 '); }
.icon-chart-bar { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '📊 '); }
.icon-pin { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '📌 '); }
.icon-attach { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '📎 '); }
.icon-book { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '📕 '); }
.icon-phone { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '📞 '); }
.icon-megaphone { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '📣 '); }
.icon-upload { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '📤 '); }
.icon-download { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '📥 '); }
.icon-mobile-1 { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '📱 '); }
.icon-signal { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '📶 '); }
.icon-camera { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '📷 '); }
.icon-shuffle { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '🔀 '); }
.icon-volume-off { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '🔇 '); }
.icon-volume-down { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '🔉 '); }
.icon-volume-up { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '🔊 '); }
.icon-search { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '🔍 '); }
.icon-key { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '🔑 '); }
.icon-lock { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '🔒 '); }
.icon-lock-open { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '🔓 '); }
.icon-bell { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '🔔 '); }
.icon-bookmark { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '🔖 '); }
.icon-link { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '🔗 '); }
.icon-fire { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '🔥 '); }
.icon-wrench { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '🔧 '); }
.icon-hammer { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '🔨 '); }
.icon-clock { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '🕔 '); }
.icon-clock-1 { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); }
.icon-truck { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '🚚 '); }
.icon-block { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '🚫 '); }
|
#!/bin/bash
# Caution: This is common script that is shared by more packages.
# If you need to do changes related to this particular collection,
# create a copy of this file instead of symlink.
THISDIR=$(dirname ${BASH_SOURCE[0]})
source ${THISDIR}/../../../common/functions.sh
[ -z "${PGDATA}" ] && exit_fail "Environment variable PGDATA must be set"
set -xe
export PGPASSWORD=secretpass
psql -d testdb -U testuser <<EOF
\x on
CREATE TABLE test_table (id bigserial primary key,fakedata varchar(20),toDelete boolean);
TRUNCATE TABLE test_table;
INSERT INTO test_table (fakedata,toDelete) VALUES ('tramtarada', false);
INSERT INTO test_table (fakedata,toDelete) VALUES ('tramtaraa', true);
EOF
out=$(
psql -d testdb -U testuser <<EOF
\x on
SELECT COUNT(*) FROM test_table WHERE toDelete=false;
EOF
)
out=$(echo "$out"|tail -n 1)
[ "$out" == "count | 1" ]
|
<?php
namespace ZendTest\View\Renderer\TestAsset;
use JsonSerializable;
class JsonModel implements JsonSerializable
{
public $value = false;
public function jsonSerialize()
{
return $this->value;
}
}
|
--+ holdcas on;
- ALTER TABLE ... CHANGE COLUMN , type change : NUMERIC to MONETARY
-- constraints : no constraints
-- ordering : no order defined
-- name :
-- type change to floating point types
set system parameters '<API key>=yes';
set system parameters 'error_log_level=warning';
set system parameters 'error_log_warning=yes';
create table t1 (n1 numeric(6,2));
insert into t1 values (1234.0),(9999.99),(-9999.0);
-- should be ok
insert into t1 values (1234.0);
-- should be ok with trunctation to 1234.12
insert into t1 values (1234.123);
select * from t1 order by 1;
show columns in t1;
-- should fail
alter table t1 change n1 m1 monetary;
-- should fail (prec)
insert into t1 values (-12345.123);
-- should fail (unique constr)
insert into t1 values (1234);
select * from t1 order by 1;
show columns in t1;
drop table t1;
create table t1 (n1 numeric(11,2) unique);
insert into t1 values (123456789.0),(999999999.99),(-999999999.0);
-- should fail : unique
insert into t1 values (123456789.0);
-- should be ok with trunctation to 123456789.12
insert into t1 values (123456789.123);
select * from t1 order by 1;
show columns in t1;
-- should fail
alter table t1 change n1 m1 monetary unique;
-- should fail : prec
insert into t1 values (-1234567890.123);
-- should fail (unique )
insert into t1 values (123456789);
select * from t1 order by 1;
show columns in t1;
drop table t1;
set system parameters '<API key>=no';
commit;
--+ holdcas off;
|
<!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.8.20"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>PMDK C++ bindings: 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="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" />
</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="projectalign" style="padding-left: 0.5em;">
<div id="projectname">PMDK C++ bindings
 <span id="projectnumber">1.7</span>
</div>
<div id="projectbrief">This is the C++ bindings documentation for PMDK's libpmemobj.</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.20 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</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>
<!-- 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 id="nav-path" class="navpath">
<ul>
<li class="navelem"><b>pmem</b></li><li class="navelem"><b>obj</b></li><li class="navelem"><b>experimental</b></li><li class="navelem"><a class="el" href="<API key>.html">concurrent_hash_map</a></li> </ul>
</div>
</div><!-- top -->
<div class="header">
<div class="headertitle">
<div class="title">pmem::obj::experimental::concurrent_hash_map< Key, T, Hash, KeyEqual > 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">pmem::obj::experimental::concurrent_hash_map< Key, T, Hash, KeyEqual ></a>, including all inherited members.</p>
<table class="directory">
<tr class="even"><td class="entry"><a class="el" href="<API key>.html#<API key>">begin</a>()</td><td class="entry"><a class="el" href="<API key>.html">pmem::obj::experimental::concurrent_hash_map< Key, T, Hash, KeyEqual ></a></td><td class="entry"><span class="mlabel">inline</span></td></tr>
<tr><td class="entry"><a class="el" href="<API key>.html#<API key>">begin</a>() const</td><td class="entry"><a class="el" href="<API key>.html">pmem::obj::experimental::concurrent_hash_map< Key, T, Hash, KeyEqual ></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>">bucket_count</a>() const</td><td class="entry"><a class="el" href="<API key>.html">pmem::obj::experimental::concurrent_hash_map< Key, T, Hash, KeyEqual ></a></td><td class="entry"><span class="mlabel">inline</span></td></tr>
<tr><td class="entry"><a class="el" href="<API key>.html#<API key>">clear</a>()</td><td class="entry"><a class="el" href="<API key>.html">pmem::obj::experimental::concurrent_hash_map< Key, T, Hash, KeyEqual ></a></td><td class="entry"></td></tr>
<tr class="even"><td class="entry"><a class="el" href="<API key>.html#<API key>">concurrent_hash_map</a>()</td><td class="entry"><a class="el" href="<API key>.html">pmem::obj::experimental::concurrent_hash_map< Key, T, Hash, KeyEqual ></a></td><td class="entry"><span class="mlabel">inline</span></td></tr>
<tr><td class="entry"><a class="el" href="<API key>.html#<API key>">concurrent_hash_map</a>(size_type n)</td><td class="entry"><a class="el" href="<API key>.html">pmem::obj::experimental::concurrent_hash_map< Key, T, Hash, KeyEqual ></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>">concurrent_hash_map</a>(const concurrent_hash_map &table)</td><td class="entry"><a class="el" href="<API key>.html">pmem::obj::experimental::concurrent_hash_map< Key, T, Hash, KeyEqual ></a></td><td class="entry"><span class="mlabel">inline</span></td></tr>
<tr><td class="entry"><a class="el" href="<API key>.html#<API key>">concurrent_hash_map</a>(concurrent_hash_map &&table)</td><td class="entry"><a class="el" href="<API key>.html">pmem::obj::experimental::concurrent_hash_map< Key, T, Hash, KeyEqual ></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>">concurrent_hash_map</a>(I first, I last)</td><td class="entry"><a class="el" href="<API key>.html">pmem::obj::experimental::concurrent_hash_map< Key, T, Hash, KeyEqual ></a></td><td class="entry"><span class="mlabel">inline</span></td></tr>
<tr><td class="entry"><a class="el" href="<API key>.html#<API key>">concurrent_hash_map</a>(std::initializer_list< value_type > il)</td><td class="entry"><a class="el" href="<API key>.html">pmem::obj::experimental::concurrent_hash_map< Key, T, Hash, KeyEqual ></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>">count</a>(const Key &key) const</td><td class="entry"><a class="el" href="<API key>.html">pmem::obj::experimental::concurrent_hash_map< Key, T, Hash, KeyEqual ></a></td><td class="entry"><span class="mlabel">inline</span></td></tr>
<tr><td class="entry"><a class="el" href="<API key>.html#<API key>">count</a>(const K &key) const</td><td class="entry"><a class="el" href="<API key>.html">pmem::obj::experimental::concurrent_hash_map< Key, T, Hash, KeyEqual ></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>">empty</a>() const</td><td class="entry"><a class="el" href="<API key>.html">pmem::obj::experimental::concurrent_hash_map< Key, T, Hash, KeyEqual ></a></td><td class="entry"><span class="mlabel">inline</span></td></tr>
<tr><td class="entry"><a class="el" href="<API key>.html#<API key>">end</a>()</td><td class="entry"><a class="el" href="<API key>.html">pmem::obj::experimental::concurrent_hash_map< Key, T, Hash, KeyEqual ></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>">end</a>() const</td><td class="entry"><a class="el" href="<API key>.html">pmem::obj::experimental::concurrent_hash_map< Key, T, Hash, KeyEqual ></a></td><td class="entry"><span class="mlabel">inline</span></td></tr>
<tr><td class="entry"><a class="el" href="<API key>.html#<API key>">erase</a>(const Key &key)</td><td class="entry"><a class="el" href="<API key>.html">pmem::obj::experimental::concurrent_hash_map< Key, T, Hash, KeyEqual ></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>">erase</a>(const K &key)</td><td class="entry"><a class="el" href="<API key>.html">pmem::obj::experimental::concurrent_hash_map< Key, T, Hash, KeyEqual ></a></td><td class="entry"><span class="mlabel">inline</span></td></tr>
<tr><td class="entry"><a class="el" href="<API key>.html#<API key>">find</a>(const_accessor &result, const Key &key) const</td><td class="entry"><a class="el" href="<API key>.html">pmem::obj::experimental::concurrent_hash_map< Key, T, Hash, KeyEqual ></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>">find</a>(const_accessor &result, const K &key) const</td><td class="entry"><a class="el" href="<API key>.html">pmem::obj::experimental::concurrent_hash_map< Key, T, Hash, KeyEqual ></a></td><td class="entry"><span class="mlabel">inline</span></td></tr>
<tr><td class="entry"><a class="el" href="<API key>.html#<API key>">find</a>(accessor &result, const Key &key)</td><td class="entry"><a class="el" href="<API key>.html">pmem::obj::experimental::concurrent_hash_map< Key, T, Hash, KeyEqual ></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>">find</a>(accessor &result, const K &key)</td><td class="entry"><a class="el" href="<API key>.html">pmem::obj::experimental::concurrent_hash_map< Key, T, Hash, KeyEqual ></a></td><td class="entry"><span class="mlabel">inline</span></td></tr>
<tr><td class="entry"><a class="el" href="<API key>.html#<API key>">initialize</a>(bool graceful_shutdown=false)</td><td class="entry"><a class="el" href="<API key>.html">pmem::obj::experimental::concurrent_hash_map< Key, T, Hash, KeyEqual ></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>">insert</a>(const_accessor &result, const Key &key)</td><td class="entry"><a class="el" href="<API key>.html">pmem::obj::experimental::concurrent_hash_map< Key, T, Hash, KeyEqual ></a></td><td class="entry"><span class="mlabel">inline</span></td></tr>
<tr><td class="entry"><a class="el" href="<API key>.html#<API key>">insert</a>(accessor &result, const Key &key)</td><td class="entry"><a class="el" href="<API key>.html">pmem::obj::experimental::concurrent_hash_map< Key, T, Hash, KeyEqual ></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>">insert</a>(const_accessor &result, const value_type &value)</td><td class="entry"><a class="el" href="<API key>.html">pmem::obj::experimental::concurrent_hash_map< Key, T, Hash, KeyEqual ></a></td><td class="entry"><span class="mlabel">inline</span></td></tr>
<tr><td class="entry"><a class="el" href="<API key>.html#<API key>">insert</a>(accessor &result, const value_type &value)</td><td class="entry"><a class="el" href="<API key>.html">pmem::obj::experimental::concurrent_hash_map< Key, T, Hash, KeyEqual ></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>">insert</a>(const value_type &value)</td><td class="entry"><a class="el" href="<API key>.html">pmem::obj::experimental::concurrent_hash_map< Key, T, Hash, KeyEqual ></a></td><td class="entry"><span class="mlabel">inline</span></td></tr>
<tr><td class="entry"><a class="el" href="<API key>.html#<API key>">insert</a>(const_accessor &result, value_type &&value)</td><td class="entry"><a class="el" href="<API key>.html">pmem::obj::experimental::concurrent_hash_map< Key, T, Hash, KeyEqual ></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>">insert</a>(accessor &result, value_type &&value)</td><td class="entry"><a class="el" href="<API key>.html">pmem::obj::experimental::concurrent_hash_map< Key, T, Hash, KeyEqual ></a></td><td class="entry"><span class="mlabel">inline</span></td></tr>
<tr><td class="entry"><a class="el" href="<API key>.html#<API key>">insert</a>(value_type &&value)</td><td class="entry"><a class="el" href="<API key>.html">pmem::obj::experimental::concurrent_hash_map< Key, T, Hash, KeyEqual ></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>">insert</a>(I first, I last)</td><td class="entry"><a class="el" href="<API key>.html">pmem::obj::experimental::concurrent_hash_map< Key, T, Hash, KeyEqual ></a></td><td class="entry"><span class="mlabel">inline</span></td></tr>
<tr><td class="entry"><a class="el" href="<API key>.html#<API key>">insert</a>(std::initializer_list< value_type > il)</td><td class="entry"><a class="el" href="<API key>.html">pmem::obj::experimental::concurrent_hash_map< Key, T, Hash, KeyEqual ></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>">internal_copy</a>(const concurrent_hash_map &source)</td><td class="entry"><a class="el" href="<API key>.html">pmem::obj::experimental::concurrent_hash_map< Key, T, Hash, KeyEqual ></a></td><td class="entry"><span class="mlabel">protected</span></td></tr>
<tr><td class="entry"><a class="el" href="<API key>.html#<API key>">lookup</a>(const K &key, const void *param, const_accessor *result, bool write, void(*allocate_node)(pool_base &, persistent_ptr< node > &, const void *, const node_base_ptr_t &))</td><td class="entry"><a class="el" href="<API key>.html">pmem::obj::experimental::concurrent_hash_map< Key, T, Hash, KeyEqual ></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>">max_size</a>() const</td><td class="entry"><a class="el" href="<API key>.html">pmem::obj::experimental::concurrent_hash_map< Key, T, Hash, KeyEqual ></a></td><td class="entry"><span class="mlabel">inline</span></td></tr>
<tr><td class="entry"><a class="el" href="<API key>.html#<API key>">operator=</a>(const concurrent_hash_map &table)</td><td class="entry"><a class="el" href="<API key>.html">pmem::obj::experimental::concurrent_hash_map< Key, T, Hash, KeyEqual ></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>">operator=</a>(std::initializer_list< value_type > il)</td><td class="entry"><a class="el" href="<API key>.html">pmem::obj::experimental::concurrent_hash_map< Key, T, Hash, KeyEqual ></a></td><td class="entry"><span class="mlabel">inline</span></td></tr>
<tr><td class="entry"><a class="el" href="<API key>.html#<API key>">rehash</a>(size_type n=0)</td><td class="entry"><a class="el" href="<API key>.html">pmem::obj::experimental::concurrent_hash_map< Key, T, Hash, KeyEqual ></a></td><td class="entry"></td></tr>
<tr class="even"><td class="entry"><a class="el" href="<API key>.html#<API key>">size</a>() const</td><td class="entry"><a class="el" href="<API key>.html">pmem::obj::experimental::concurrent_hash_map< Key, T, Hash, KeyEqual ></a></td><td class="entry"><span class="mlabel">inline</span></td></tr>
<tr><td class="entry"><a class="el" href="<API key>.html#<API key>">swap</a>(concurrent_hash_map &table)</td><td class="entry"><a class="el" href="<API key>.html">pmem::obj::experimental::concurrent_hash_map< Key, T, Hash, KeyEqual ></a></td><td class="entry"></td></tr>
<tr class="even"><td class="entry"><a class="el" href="<API key>.html#<API key>">~concurrent_hash_map</a>()</td><td class="entry"><a class="el" href="<API key>.html">pmem::obj::experimental::concurrent_hash_map< Key, T, Hash, KeyEqual ></a></td><td class="entry"><span class="mlabel">inline</span></td></tr>
</table></div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by&
</small></address>
</body>
</html>
|
<?php
/**
* @see <API key>
*/
// require_once 'Zend/Application/Resource/ResourceAbstract.php';
class <API key>
extends <API key>
{
/**
* @var Zend_Layout
*/
protected $_layout;
/**
* Defined by <API key>
*
* @return Zend_Layout
*/
public function init()
{
$this->getBootstrap()->bootstrap('FrontController');
return $this->getLayout();
}
/**
* Retrieve layout object
*
* @return Zend_Layout
*/
public function getLayout()
{
if (null === $this->_layout) {
$this->_layout = Zend_Layout::startMvc($this->getOptions());
}
return $this->_layout;
}
}
|
#include "config.h"
#include "core/html/HTMLTrackElement.h"
#include "bindings/core/v8/<API key>.h"
#include "core/HTMLNames.h"
#include "core/dom/Document.h"
#include "core/events/Event.h"
#include "core/frame/csp/<API key>.h"
#include "core/html/HTMLMediaElement.h"
#include "platform/Logging.h"
namespace blink {
using namespace HTMLNames;
#if !LOG_DISABLED
static String urlForLoggingTrack(const KURL& url)
{
static const unsigned <API key> = 128;
if (url.string().length() < <API key>)
return url.string();
return url.string().substring(0, <API key>) + "...";
}
#endif
inline HTMLTrackElement::HTMLTrackElement(Document& document)
: HTMLElement(trackTag, document)
, m_loadTimer(this, &HTMLTrackElement::loadTimerFired)
{
WTF_LOG(Media, "HTMLTrackElement::HTMLTrackElement - %p", this);
ScriptWrappable::init(this);
}
DEFINE_NODE_FACTORY(HTMLTrackElement)
HTMLTrackElement::~HTMLTrackElement()
{
#if !ENABLE(OILPAN)
if (m_track)
m_track->clearTrackElement();
#endif
}
Node::<API key> HTMLTrackElement::insertedInto(ContainerNode* insertionPoint)
{
WTF_LOG(Media, "HTMLTrackElement::insertedInto");
// Since we've moved to a new parent, we may now be able to load.
scheduleLoad();
HTMLElement::insertedInto(insertionPoint);
HTMLMediaElement* parent = mediaElement();
if (insertionPoint == parent)
parent->didAddTrackElement(this);
return InsertionDone;
}
void HTMLTrackElement::removedFrom(ContainerNode* insertionPoint)
{
if (!parentNode() && isHTMLMediaElement(*insertionPoint))
toHTMLMediaElement(insertionPoint)-><API key>(this);
HTMLElement::removedFrom(insertionPoint);
}
void HTMLTrackElement::parseAttribute(const QualifiedName& name, const AtomicString& value)
{
if (name == srcAttr) {
if (!value.isEmpty())
scheduleLoad();
else if (m_track)
m_track->removeAllCues();
// 4.8.10.12.3 Sourcing out-of-band text tracks
// As the kind, label, and srclang attributes are set, changed, or removed, the text track must update accordingly...
} else if (name == kindAttr) {
track()->setKind(value.lower());
} else if (name == labelAttr) {
track()->setLabel(value);
} else if (name == srclangAttr) {
track()->setLanguage(value);
} else if (name == idAttr) {
track()->setId(value);
} else if (name == defaultAttr) {
track()->setIsDefault(!value.isNull());
}
HTMLElement::parseAttribute(name, value);
}
const AtomicString& HTMLTrackElement::kind()
{
return track()->kind();
}
void HTMLTrackElement::setKind(const AtomicString& kind)
{
setAttribute(kindAttr, kind);
}
LoadableTextTrack* HTMLTrackElement::ensureTrack()
{
if (!m_track) {
// kind, label and language are updated by parseAttribute
m_track = LoadableTextTrack::create(this);
}
return m_track.get();
}
TextTrack* HTMLTrackElement::track()
{
return ensureTrack();
}
bool HTMLTrackElement::isURLAttribute(const Attribute& attribute) const
{
return attribute.name() == srcAttr || HTMLElement::isURLAttribute(attribute);
}
void HTMLTrackElement::scheduleLoad()
{
WTF_LOG(Media, "HTMLTrackElement::scheduleLoad");
// 1. If another occurrence of this algorithm is already running for this text track and its track element,
// abort these steps, letting that other algorithm take care of this element.
if (m_loadTimer.isActive())
return;
// 2. If the text track's text track mode is not set to one of hidden or showing, abort these steps.
if (ensureTrack()->mode() != TextTrack::hiddenKeyword() && ensureTrack()->mode() != TextTrack::showingKeyword())
return;
// 3. If the text track's track element does not have a media element as a parent, abort these steps.
if (!mediaElement())
return;
// 4. Run the remainder of these steps asynchronously, allowing whatever caused these steps to run to continue.
m_loadTimer.startOneShot(0, FROM_HERE);
}
void HTMLTrackElement::loadTimerFired(Timer<HTMLTrackElement>*)
{
if (!fastHasAttribute(srcAttr))
return;
WTF_LOG(Media, "HTMLTrackElement::loadTimerFired");
// 6. Set the text track readiness state to loading.
setReadyState(HTMLTrackElement::LOADING);
// 7. Let URL be the track URL of the track element.
KURL url = <API key>(srcAttr);
// 8. If the track element's parent is a media element then let CORS mode be the state of the parent media
// element's crossorigin content attribute. Otherwise, let CORS mode be No CORS.
if (!canLoadUrl(url)) {
didCompleteLoad(HTMLTrackElement::Failure);
return;
}
ensureTrack()->scheduleLoad(url);
}
bool HTMLTrackElement::canLoadUrl(const KURL& url)
{
HTMLMediaElement* parent = mediaElement();
if (!parent)
return false;
// 4.8.10.12.3 Sourcing out-of-band text tracks
// 4. Download: If URL is not the empty string, perform a potentially CORS-enabled fetch of URL, with the
// mode being the state of the media element's crossorigin content attribute, the origin being the
// origin of the media element's Document, and the default origin behaviour set to fail.
if (url.isEmpty())
return false;
if (!document().<API key>()-><API key>(url)) {
WTF_LOG(Media, "HTMLTrackElement::canLoadUrl(%s) -> rejected by Content Security Policy", urlForLoggingTrack(url).utf8().data());
return false;
}
return true;
}
void HTMLTrackElement::didCompleteLoad(LoadStatus status)
{
// 4.8.10.12.3 Sourcing out-of-band text tracks (continued)
// 4. Download: ...
// If the fetching algorithm fails for any reason (network error, the server returns an error
// code, a cross-origin check fails, etc), or if URL is the empty string or has the wrong origin
// as determined by the condition at the start of this step, or if the fetched resource is not in
// a supported format, then queue a task to first change the text track readiness state to failed
// to load and then fire a simple event named error at the track element; and then, once that task
// is queued, move on to the step below labeled monitoring.
if (status == Failure) {
setReadyState(HTMLTrackElement::TRACK_ERROR);
dispatchEvent(Event::create(EventTypeNames::error), IGNORE_EXCEPTION);
return;
}
// If the fetching algorithm does not fail, then the final task that is queued by the networking
// task source must run the following steps:
// 1. Change the text track readiness state to loaded.
setReadyState(HTMLTrackElement::LOADED);
// 2. If the file was successfully processed, fire a simple event named load at the
// track element.
dispatchEvent(Event::create(EventTypeNames::load), IGNORE_EXCEPTION);
}
// NOTE: The values in the TextTrack::ReadinessState enum must stay in sync with those in HTMLTrackElement::ReadyState.
COMPILE_ASSERT(HTMLTrackElement::NONE == static_cast<HTMLTrackElement::ReadyState>(TextTrack::NotLoaded), <API key>);
COMPILE_ASSERT(HTMLTrackElement::LOADING == static_cast<HTMLTrackElement::ReadyState>(TextTrack::Loading), <API key>);
COMPILE_ASSERT(HTMLTrackElement::LOADED == static_cast<HTMLTrackElement::ReadyState>(TextTrack::Loaded), <API key>);
COMPILE_ASSERT(HTMLTrackElement::TRACK_ERROR == static_cast<HTMLTrackElement::ReadyState>(TextTrack::FailedToLoad), <API key>);
void HTMLTrackElement::setReadyState(ReadyState state)
{
ensureTrack()->setReadinessState(static_cast<TextTrack::ReadinessState>(state));
if (HTMLMediaElement* parent = mediaElement())
return parent-><API key>(m_track.get());
}
HTMLTrackElement::ReadyState HTMLTrackElement::readyState()
{
return static_cast<ReadyState>(ensureTrack()->readinessState());
}
const AtomicString& HTMLTrackElement::<API key>() const
{
if (HTMLMediaElement* parent = mediaElement())
return parent->fastGetAttribute(HTMLNames::crossoriginAttr);
return nullAtom;
}
HTMLMediaElement* HTMLTrackElement::mediaElement() const
{
Element* parent = parentElement();
if (isHTMLMediaElement(parent))
return toHTMLMediaElement(parent);
return 0;
}
void HTMLTrackElement::trace(Visitor* visitor)
{
visitor->trace(m_track);
HTMLElement::trace(visitor);
}
}
|
package com.oracle.ptsdemo.oscproxyclient.types;
import java.util.ArrayList;
import java.util.List;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlType;
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "ViewCriteriaRow", namespace = "http://xmlns.oracle.com/adf/svc/types/", propOrder = {
"conjunction",
"upperCaseCompare",
"item"
})
public class ViewCriteriaRow {
protected Conjunction conjunction;
@XmlElement(defaultValue = "false")
protected boolean upperCaseCompare;
@XmlElement(required = true)
protected List<ViewCriteriaItem> item;
/**
* Gets the value of the conjunction property.
*
* @return
* possible object is
* {@link Conjunction }
*
*/
public Conjunction getConjunction() {
return conjunction;
}
/**
* Sets the value of the conjunction property.
*
* @param value
* allowed object is
* {@link Conjunction }
*
*/
public void setConjunction(Conjunction value) {
this.conjunction = value;
}
/**
* Gets the value of the upperCaseCompare property.
*
*/
public boolean isUpperCaseCompare() {
return upperCaseCompare;
}
/**
* Sets the value of the upperCaseCompare property.
*
*/
public void setUpperCaseCompare(boolean value) {
this.upperCaseCompare = value;
}
/**
* Gets the value of the item property.
*
* <p>
* This accessor method returns a reference to the live list,
* not a snapshot. Therefore any modification you make to the
* returned list will be present inside the JAXB object.
* This is why there is not a <CODE>set</CODE> method for the item property.
*
* <p>
* For example, to add a new item, do as follows:
* <pre>
* getItem().add(newItem);
* </pre>
*
*
* <p>
* Objects of the following type(s) are allowed in the list
* {@link ViewCriteriaItem }
*
*
*/
public List<ViewCriteriaItem> getItem() {
if (item == null) {
item = new ArrayList<ViewCriteriaItem>();
}
return this.item;
}
}
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http:
<html>
<head>
<title>Description of cohmatrixc</title>
<meta name="keywords" content="cohmatrixc">
<meta name="description" content="Multi-taper coherency,cross-spectral matrix - continuous process">
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta name="generator" content="m2html © 2003 Guillaume Flandin">
<meta name="robots" content="index, follow">
<link type="text/css" rel="stylesheet" href="../../../m2html.css">
</head>
<body>
<a name="_top"></a>
<div><a href="../../../index.html">Home</a> > <a href="#">chronux_2_00</a> > <a href="../index.html">spectral_analysis</a> > <a href="index.html">continuous</a> > cohmatrixc.m</div>
<!--<table width="100%"><tr><td align="left"><a href="../../../index.html"><img alt="<" border="0" src="../../../left.png"> Master index</a></td>
<td align="right"><a href="index.html">Index for chronux_2_00\spectral_analysis\continuous <img alt=">" border="0" src="../../../right.png"></a></td></tr></table>
<h1>cohmatrixc
</h1>
<h2><a name="_name"></a>PURPOSE <a href="#_top"><img alt="^" border="0" src="../../../up.png"></a></h2>
<div class="box"><strong>Multi-taper coherency,cross-spectral matrix - continuous process</strong></div>
<h2><a name="_synopsis"></a>SYNOPSIS <a href="#_top"><img alt="^" border="0" src="../../../up.png"></a></h2>
<div class="box"><strong>function [C,phi,S12,f,confC,phistd,Cerr]=cohmatrixc(data,params) </strong></div>
<h2><a name="_description"></a>DESCRIPTION <a href="#_top"><img alt="^" border="0" src="../../../up.png"></a></h2>
<div class="fragment"><pre class="comment"> Multi-taper coherency,cross-spectral matrix - continuous process
Usage:
[C,phi,S12,f,confC,phistd,Cerr]=cohmatrixc(data,params)
Input:
Note units have to be consistent. See chronux.m for more information.
data (in form samples x channels) -- required
params: structure with fields tapers, pad, Fs, fpass, err
- optional
tapers : precalculated tapers from dpss or in the one of the following
forms:
(1) A numeric vector [TW K] where TW is the
time-bandwidth product and K is the number of
tapers to be used (less than or equal to
2TW-1).
(2) A numeric vector [W T p] where W is the
bandwidth, T is the duration of the data and p
is an integer such that 2TW-p tapers are used. In
this form there is no default i.e. to specify
the bandwidth, you have to specify T and p as
well. Note that the units of W and T have to be
consistent: if W is in Hz, T must be in seconds
and vice versa. Note that these units must also
be consistent with the units of params.Fs: W can
be in Hz if and only if params.Fs is in Hz.
The default is to use form 1 with TW=3 and K=5
pad (padding factor for the FFT) - optional (can take values -1,0,1,2...).
-1 corresponds to no padding, 0 corresponds to padding
to the next highest power of 2 etc.
e.g. For N = 500, if PAD = -1, we do not pad; if PAD = 0, we pad the FFT
to 512 points, if pad=1, we pad to 1024 points etc.
Defaults to 0.
Fs (sampling frequency) - optional. Default 1.
fpass (frequency band to be used in the calculation in the form
[fmin fmax])- optional.
Default all frequencies between 0 and Fs/2
err (error calculation [1 p] - Theoretical error bars; [2 p] - Jackknife error bars
[0 p] or 0 - no error bars) - optional. Default 0.
Output:
C (magnitude of coherency frequency x channels x channels)
phi (phase of coherency frequency x channels x channels)
S12 (cross-spectral matrix frequency x channels x channels)
f (frequencies)
confC (confidence level for C at 1-p %) - only for err(1)>=1
phistd - theoretical/jackknife (depending on err(1)=1/err(1)=2) standard deviation for phi
Note that phi + 2 phistd and phi - 2 phistd will give 95% confidence
bands for phi - only for err(1)>=1
Cerr (Jackknife error bars for C - use only for Jackknife - err(1)=2)</pre></div>
<!-- crossreference -->
<h2><a name="_cross"></a>CROSS-REFERENCE INFORMATION <a href="#_top"><img alt="^" border="0" src="../../../up.png"></a></h2>
This function calls:
<ul style="list-style-image:url(../../../matlabicon.gif)">
<li><a href="mtfftc.html" class="code" title="function J=mtfftc(data,tapers,nfft,Fs)">mtfftc</a> Multi-taper fourier transform - continuous data</li></ul>
This function is called by:
<ul style="list-style-image:url(../../../matlabicon.gif)">
</ul>
<!-- crossreference -->
<h2><a name="_source"></a>SOURCE CODE <a href="#_top"><img alt="^" border="0" src="../../../up.png"></a></h2>
<div class="fragment"><pre>0001 <a name="_sub0" href="#_subfunctions" class="code">function [C,phi,S12,f,confC,phistd,Cerr]=cohmatrixc(data,params)</a>
0002 <span class="comment">% Multi-taper coherency,cross-spectral matrix - continuous process</span>
0003 <span class="comment">%</span>
0004 <span class="comment">% Usage:</span>
0005 <span class="comment">%</span>
0006 <span class="comment">% [C,phi,S12,f,confC,phistd,Cerr]=cohmatrixc(data,params)</span>
0007 <span class="comment">% Input:</span>
0008 <span class="comment">% Note units have to be consistent. See chronux.m for more information.</span>
0009 <span class="comment">% data (in form samples x channels) -- required</span>
0010 <span class="comment">% params: structure with fields tapers, pad, Fs, fpass, err</span>
0011 <span class="comment">% - optional</span>
0012 <span class="comment">% tapers : precalculated tapers from dpss or in the one of the following</span>
0013 <span class="comment">% forms:</span>
0014 <span class="comment">% (1) A numeric vector [TW K] where TW is the</span>
0015 <span class="comment">% time-bandwidth product and K is the number of</span>
0016 <span class="comment">% tapers to be used (less than or equal to</span>
0017 <span class="comment">% 2TW-1).</span>
0018 <span class="comment">% (2) A numeric vector [W T p] where W is the</span>
0019 <span class="comment">% bandwidth, T is the duration of the data and p</span>
0020 <span class="comment">% is an integer such that 2TW-p tapers are used. In</span>
0021 <span class="comment">% this form there is no default i.e. to specify</span>
0022 <span class="comment">% the bandwidth, you have to specify T and p as</span>
0023 <span class="comment">% well. Note that the units of W and T have to be</span>
0024 <span class="comment">% consistent: if W is in Hz, T must be in seconds</span>
0025 <span class="comment">% and vice versa. Note that these units must also</span>
0026 <span class="comment">% be consistent with the units of params.Fs: W can</span>
0027 <span class="comment">% be in Hz if and only if params.Fs is in Hz.</span>
0028 <span class="comment">% The default is to use form 1 with TW=3 and K=5</span>
0029 <span class="comment">%</span>
0030 <span class="comment">% pad (padding factor for the FFT) - optional (can take values -1,0,1,2...).</span>
0031 <span class="comment">% -1 corresponds to no padding, 0 corresponds to padding</span>
0032 <span class="comment">% to the next highest power of 2 etc.</span>
0033 <span class="comment">% e.g. For N = 500, if PAD = -1, we do not pad; if PAD = 0, we pad the FFT</span>
0034 <span class="comment">% to 512 points, if pad=1, we pad to 1024 points etc.</span>
0035 <span class="comment">% Defaults to 0.</span>
0036 <span class="comment">% Fs (sampling frequency) - optional. Default 1.</span>
0037 <span class="comment">% fpass (frequency band to be used in the calculation in the form</span>
0038 <span class="comment">% [fmin fmax])- optional.</span>
0039 <span class="comment">% Default all frequencies between 0 and Fs/2</span>
0040 <span class="comment">% err (error calculation [1 p] - Theoretical error bars; [2 p] - Jackknife error bars</span>
0041 <span class="comment">% [0 p] or 0 - no error bars) - optional. Default 0.</span>
0042 <span class="comment">% Output:</span>
0043 <span class="comment">% C (magnitude of coherency frequency x channels x channels)</span>
0044 <span class="comment">% phi (phase of coherency frequency x channels x channels)</span>
0045 <span class="comment">% S12 (cross-spectral matrix frequency x channels x channels)</span>
0046 <span class="comment">% f (frequencies)</span>
0047 <span class="comment">% confC (confidence level for C at 1-p %) - only for err(1)>=1</span>
0048 <span class="comment">% phistd - theoretical/jackknife (depending on err(1)=1/err(1)=2) standard deviation for phi</span>
0049 <span class="comment">% Note that phi + 2 phistd and phi - 2 phistd will give 95% confidence</span>
0050 <span class="comment">% bands for phi - only for err(1)>=1</span>
0051 <span class="comment">% Cerr (Jackknife error bars for C - use only for Jackknife - err(1)=2)</span>
0052
0053 <span class="keyword">if</span> nargin < 1; error(<span class="string">'need data'</span>); <span class="keyword">end</span>;
0054 <span class="keyword">if</span> nargin < 2; params=[]; <span class="keyword">end</span>;
0055 [N,Ch]=size(data);
0056 <span class="keyword">if</span> Ch==1; error(<span class="string">'Need at least two channels of data'</span>); <span class="keyword">end</span>;
0057 [tapers,pad,Fs,fpass,err,trialave,params]=getparams(params);
0058 clear trialave params
0059 <span class="keyword">if</span> nargout > 6 && err(1)~=2;
0060 error(<span class="string">'Cerr computed only for Jackknife. Correct inputs and run again'</span>);
0061 <span class="keyword">end</span>;
0062 <span class="keyword">if</span> nargout >= 4 && err(1)==0;
0063 <span class="comment">% Errors computed only if err(1) is nonzero. Need to change params and run again.</span>
0064 error(<span class="string">'When errors are desired, err(1) has to be non-zero.'</span>);
0065 <span class="keyword">end</span>;
0066 nfft=max(2^(nextpow2(N)+pad),N);
0067 [f,findx]=getfgrid(Fs,nfft,fpass);
0068 tapers=dpsschk(tapers,N,Fs); <span class="comment">% check tapers</span>
0069 J=<a href="mtfftc.html" class="code" title="function J=mtfftc(data,tapers,nfft,Fs)">mtfftc</a>(data,tapers,nfft,Fs);
0070 J=J(findx,:,:);
0071 <span class="keyword">if</span> err(1)==0;
0072 [C,phi,S12]=cohmathelper(J,err);
0073 <span class="keyword">elseif</span> err(1)==1;
0074 [C,phi,S12,confC,phistd]=cohmathelper(J,err);
0075 <span class="keyword">elseif</span> err(1)==2;
0076 [C,phi,S12,confC,phistd,Cerr]=cohmathelper(J,err);
0077 <span class="keyword">end</span></pre></div>
<hr><address>Generated on Fri 15-Aug-2008 11:35:42 by <strong><a href="http:
</body>
</html>
|
macro nogc(ex)
quote
local val
try
gc_enable(false)
val = $(esc(ex))
finally
gc_enable(true)
end
val
end
end
|
package com.twelvemonkeys.imageio.plugins.pnm;
import org.junit.Test;
import javax.imageio.ImageReader;
import javax.imageio.spi.ImageReaderSpi;
import javax.imageio.spi.ImageWriterSpi;
import static com.twelvemonkeys.imageio.spi.<API key>.assertClassExists;
import static com.twelvemonkeys.imageio.spi.<API key>.assertClassesExist;
import static org.junit.Assert.assertNotNull;
public class <API key> {
private final ImageReaderSpi spi = new PNMImageReaderSpi();
@Test
public void getPluginClassName() {
assertClassExists(spi.getPluginClassName(), ImageReader.class);
}
@Test
public void <API key>() {
assertClassesExist(spi.<API key>(), ImageWriterSpi.class);
}
@Test
public void getInputTypes() {
assertNotNull(spi.getInputTypes());
}
}
|
@charset "utf-8";
/* CSS Document */
body{
color:#818285;
font-family:Verdana,Arial,Helvetica,sans-serif;
font-size:75%; /*can be set to 12px as well but then IE6 won't allow you to resize text that is defined in pixels*/
/*1em = 12px*/
background:#DDDDDD url(../gfx/layout/bg/body_tnc.jpg) no-repeat scroll center top;
text-align:center;
}
#container {
background-color:#FFFFFF;
border:1px solid #C8C8C8;
margin:3em auto;/*36px*/
padding:0 2.17em;/*26px*/
text-align:left;
width:900px; /*breedte moet ingesteld worden anders wordt volledige schermbreedte gevuld*/
}
#pageintro{
width:900px;
}
#ticker-search{
height:33px;
margin-top:1em;
}
#pagebody{
clear:both;
margin-top:1em;
padding-top: 1em;
}
#footer{
margin:0;
padding:1.2em 0;
}
#year{
float: left;
text-transform:uppercase;
color:#000;
margin-top:0.833em;
margin-bottom:1em;
}
#nav-main{
float:right;
margin-top:0.833em;
}
#section_bg{
/*height:60px;*/
width:900px;
/*padding-top:156px;*/
clear:both;
background:transparent url(../gfx/layout/headers/home.jpg) no-repeat scroll center top;
}
#logo{
height:156px;
}
#terena{
margin:12px;
}
#nav-sub{
height:60px;
}
#nav-section{
height:34px;
padding-top: 20px;
padding-left: 10px;
background:url(../gfx/layout/bg/nav-section.gif) top no-repeat;
}
#newsticker{
float:left;
height:22px;
width:588px;
padding-top:8px;
padding-left:10px;
background-color:#F7F8F8;
border-top:1px solid #c8c8c8;
border-bottom:1px solid #c8c8c8;
}
#newsticker_content {
border-bottom:1px solid #C8C8C8;
display:none;
height:80px;
padding:0 0 12px 10px;
}
#<API key> {
background-color:#F7F8F8;
left:-10px;
overflow:hidden;
position:relative;
top:11px;
width:598px;
z-index:5;
}
#searchbar{
background-color:#E7E7E8;
border-top:1px solid #C8C8C8;
border-bottom:1px solid #C8C8C8;
width:288px;
height:92%;
float:right;
}
#content{
width:592px;
}
#sidebar{
width:286px;
}
.clearer{
clear:both;
}
h1{
margin-top:0;
color:#000;
font-size:1.33em; /*1.33em = 16px*/
}
h2{
color:#000;
font-size:1.16em; /*1.16em = 14px*/
}
h3{
font-size:1.1em;
}
.light{
color:#fff;
}
.toggler {
color:#000 !important;
}
a:link { color:#5F5F5F;}
a:visited { color:#5e5e61;}
a:focus, a:hover, a.active {color:#000;}
ul a{
text-decoration:none;
}
.nav3 a {padding-right:8px;border-right: 1px solid;color:#818285;}
.nav3 a:visited {color:#818285}
.nav3 a:focus, .nav3 a:hover, .nav3 li.active a {color:#fff;}
ul{
list-style:none;
padding:0;
margin:0;
}
ul li{
//background:transparent url(../gfx/icons/arrow.gif) no-repeat scroll left center;
padding-left:8px;
}
ul.subnav li, #nav li, ul.mainnav li, .nav3 li{
background:none;
display:inline;
}
.longlist li {
background: url("../gfx/icons/arrow.gif") no-repeat scroll left center transparent;
padding-left: 8px;
}
ul.basic {
list-style: none outside none;
margin-left: 0;
padding-left: 14px;
text-indent: -1em;
}
.basic li {
background: none repeat scroll 0 0 transparent;
padding-left: 0;
margin:5px 0;
}
.basic li:before {
content: "\203A \0020";
}
.basic li.active {
font-weight: bold;
}
.navlist {
list-style:none outside none;
margin:0 0 16px;
padding:0;
}
.navlist li{
display:inline;
line-height:1.4em;
list-style:square outside none;
}
.navlist li:before {
font-weight: bold;
content: " \B7 ";
}
.navlist li:first-child:before { content: ""; }
dt { float: left; clear: left; width: 80px; text-align: left; }
dt:after { content: ":"; }
dd { margin: 0 0 0 85px; padding: 0 0 0.5em 0; }
div.infobox {
border:1px solid #c8c8c8;
padding:10px;
margin:0 0 20px 0;
-moz-border-radius:10px;
-<API key>:10px;
border-radius:10px;
}
/* infoboxes */
.infobox h1 {
font-size:14px;
}
div.content_left {
float:left;
width:60%;
}
div.content_right {
float:left;
width:30%;
margin-left:76px;
}
dl.infolist dd {
font-size:92%;
margin-bottom:12px;
}
ul.mainnav {
width:900px;
height:60px;
}
ul.mainnav li{
padding:0;
margin:0;
}
a.schedule{
float:left;
height:60px;
width:228px;
overflow:hidden;
text-indent: -900%;
background: transparent url(../gfx/layout/schedule.png) top left no-repeat;
}
a.venue{
float:left;
width:222px;
height:60px;
overflow:hidden;
text-indent:-900%;
background: transparent url(../gfx/layout/venue.png) top left no-repeat;
}
a.participate{
float:left;
width:228px;
height:60px;
overflow:hidden;
text-indent:-900%;
background: transparent url(../gfx/layout/participate.png) top left no-repeat;
}
a.media{
float:left;
width:222px;
height:60px;
overflow:hidden;
text-indent:-900%;
background: transparent url(../gfx/layout/media.png) top left no-repeat;
}
ul.mainnav a:hover, ul.mainnav li.active a{
color:#000;
background-position:0px -60px;
}
ul#nav a.selected{
color:#000;
}
img{
border:none;
padding:0px;
margin:0px;
}
table{
width:100%;
margin-bottom:0.5em;
}
th{
text-align:left;
text-transform:uppercase;
color:#000;
border-bottom:1px solid #d5d6d5;
}
td{
padding:0.2em;
border-bottom:1px solid #d5d6d5;
}
table.photos{
margin:0;
padding:0;
border:none;
width:100%;
height:100%;
}
table.photos td{
border:0;
height:124px;
width:150px;
margin:0;
padding:8px;
}
table.img_grid td{
border:0;
}
#nextimg{
float:right;
margin-right:8px;
}
#section{
color:#D12031;
}
#terenaSearch{
margin-top:0.5em;
margin-bottom:0;
margin-left:0.83em;
padding:0;
}
#searchb{
float:right;
}
#searchbox {
width:240px;
border:none;
}
#submitsearch
{
float:right;
margin-right:8px;
}
div.box{
width:288px;
background:url(../gfx/layout/boxes/sides288w.gif) left top repeat-y;
margin-bottom:18px;
}
.box .body{
width: 252px;
padding:18px;
background: url(../gfx/layout/boxes/top288w.gif) left top no-repeat;
}
.box .closer{
width:288px;
height:8px;
background: url(../gfx/layout/boxes/bot288w.gif) left bottom no-repeat;
}
div.bigbox{
width:591px;
background:url(../gfx/layout/boxes/sides591w.gif) left top repeat-y;
margin-bottom:18px;
}
.bigbox .body{
width: 555px;
padding:18px;
background: url(../gfx/layout/boxes/top591w.gif) left top no-repeat;
}
.bigbox .closer{
width:591px;
height:13px;
background: url(../gfx/layout/boxes/bot591w.gif) left bottom no-repeat;
}
div.widebox{
width:900px;
background:url(../gfx/layout/boxes/sides900w.gif) top left repeat-y;
margin-bottom:18px;
}
.widebox .body{
width: 864px;
padding:18px;
background: url(../gfx/layout/boxes/top900w.gif) left top no-repeat;
}
.widebox .closer{
width:900px;
height:8px;
background: url(../gfx/layout/boxes/bot900w.gif) left bottom no-repeat;
}
abbr{
border:none;
}
div.country-name{margin-bottom:1em;}
div.em{margin-top:1em;}
.notice{
background:#FEFFC8 none repeat scroll 0 50%;
border:2px dotted #CC6633;
padding:7px 5px;
}
.navigate .pagego a:hover{
text-decoration:underline;
}
a:link.pdf, a:visited.pdf {
background: url(../gfx/icons/search/pdf-small.gif) left no-repeat;
padding: 4px 0 4px 20px;
}
a:link.ppt, a:visited.ppt{
background: url(../gfx/icons/search/ppt-small.gif) left no-repeat;
padding: 4px 0 4px 20px;
}
a:link.plain, a:visited.plain {
background: url(../gfx/icons/search/txt-small.gif) left no-repeat;
padding: 4px 0 4px 20px;
}
a:link.doc, a:visited.doc{
background: url(../gfx/icons/search/doc-small.gif) left no-repeat;
padding: 4px 0 4px 20px;
}
a:link.xls, a:visited.xls{
background: url(../gfx/icons/search/xls.gif) left no-repeat;
padding: 4px 0 4px 20px;
}
a:link.audio, a:visited.audio {
background: url(../gfx/icons/search/audio-small.png) left no-repeat;
padding: 4px 0 4px 20px;
}
a:link.image, a:visited.image {
background: url(../gfx/icons/search/jpg.gif) left no-repeat;
padding: 4px 0 4px 20px;
}
a:link.rss, a:visited.rss {
background: url(../gfx/icons/search/rss.png) left no-repeat;
padding: 4px 0 4px 20px;
}
a:link.zip {
background: url(../gfx/icons/search/zip-small.gif) left no-repeat;
padding: 4px 0 4px 20px;
}
ul#status_messages, .status_messages, .notice {
border: 2px dotted #CC6633;
background:#feffc8;
margin-left: 0;
padding: 7px 5px;
font-size: 13px;
margin-bottom:12px;
}
ul#status_messages li {
background-image: none;
margin: 0 0 0 5px;
line-height: 1.4em;
}
p.notice {
overflow: auto;
width: 90%;
}
p.notice a.left {
float:left;
}
p.notice a.right {
float:right;
}
table.form td {
border:none;
}
/* grid */
table.grid {
background-color:#FFFFFF;
margin:5px 0;
width:100%;
}
table.grid thead th {
background-color:#f3f3f3;
font-weight:bold;
letter-spacing:1px;
font-size: 12px;
padding:0 4px;
text-align:left;
}
.grid thead th.large {
width: 335px;
}
.grid thead th.tiny {
width:10px;
}
table.grid tr {
height:32px;
}
.grid tbody tr {
vertical-align: top;
}
.grid ul {
list-style-type:none;
margin:0;
padding:0;
}
.grid tr.even {
background:#F7F7F7;
}
table.grid td {
font-weight:normal;
line-height:22px;
padding:4px;
border-bottom:1px solid #E5E5E5;
}
table.grid td.meta {
border:none;
}
table.grid p {
margin:0;
}
.pagination_control {
padding:10px 0;
}
span.meta, td.meta {
font-size:10px;
}
/* User info */
dl.userinfo {
border: 3px double #ccc;
font-size: 10px;
padding: 0.5em;
}
dl.userinfo dt{
float: left;
clear: left;
width: 80px;
text-align: right;
}
dl.userinfo dt:after {
content: ":";
}
dl.userinfo dd{
font-weight: bold;
margin: 0 0 0 100px;
padding: 0 0 0.5em 0;
}
span.metanav {font-size:11px;}
div#registration {
float: left;
height: 0;
left: 810px;
position: relative;
top: -210px;
}
.about-core {
position:absolute;
left:0;
top:0;
}
blockquote {
background: url("../gfx/layout/quote_open.gif") no-repeat scroll left top transparent;
font-style: italic;
line-height: 160%;
}
blockquote div {
background: url("../gfx/layout/quote_close.gif") no-repeat scroll right bottom transparent;
padding: 0 40px;
}
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.