repo_name
stringlengths 6
101
| path
stringlengths 4
300
| text
stringlengths 7
1.31M
|
|---|---|---|
VIchenlei/git-client-cl
|
src/js/map/OlMapPersonCardsLayer.js
|
<filename>src/js/map/OlMapPersonCardsLayer.js
import OlMapWorkLayer from './OlMapWorkLayer.js'
import ol from 'openlayers'
import { getPolylineBYPoints, drawOLLine } from './OlMapUtils.js'
import {manages} from '../def/manage_def.js'
const POINTIME = 5 * 60 * 1000
export default class OlMapPersonCardsLayer extends OlMapWorkLayer {
constructor (workspace) {
super(workspace)
this.mapType = workspace.mapType
this.map = workspace.map
this.layerList = this.initLayerList()
this.pointList = this.initPointList()
this.registerGlobalEventHandlers()
}
registerGlobalEventHandlers () {
let self = this
xbus.on('DRAW-PERSON-TRACK', (msg) => {
self.clearLine()
if (msg.status) {
this.firstLine = false
this.secondLine = false
this.drawTrack(msg.row)
this.row = msg.row
this.alarmTrackLayer.setVisible(true)
this.alarmPointLayer.setVisible(true)
}
})
xbus.on('REPT-SHOW-RESULT', (msg) => {
if (msg.def.name === 'personCards') {
let sqlResult = msg.rows
this.drawLine(sqlResult[`'${this.firstName}'`], 'firstName', this.firstName)
this.drawLine(sqlResult[`'${this.secondName}'`], 'secondName', this.secondName)
this.drawPoint(sqlResult[`'${this.firstPointName}'`], 'firstPoint', this.firstPointName)
this.drawPoint(sqlResult[`'${this.secondPointName}'`], 'secondPoint', this.secondPointName)
this.firstLine = true
this.secondLine = true
if (this.firstLine && this.secondLine) {
window.xhint.close()
}
}
})
this.map.addEventListener('click', (evt) => {
let feature = this.map.forEachFeatureAtPixel(evt.pixel, (feature) => feature)
if (feature && (feature.getProperties()['data-type'] === 'startMarker' || feature.getProperties()['data-type'] === 'endMarker' || feature.getProperties()['data-type'] === 'alarmPoint')) {
this.showTips(evt, feature)
}
})
}
clearLine () {
this.alarmTrackSource.clear()
this.alarmPointSource.clear()
}
initLayerList (msg) {
this.alarmTrackSource = new ol.source.Vector()
this.alarmTrackLayer = new ol.layer.Vector({
source: this.alarmTrackSource
})
this.alarmTrackLayer.setVisible(false)
this.map.addLayer(this.alarmTrackLayer)
return this.alarmTrackLayer
}
initPointList () {
this.alarmPointSource = new ol.source.Vector()
this.alarmPointLayer = new ol.layer.Vector({
source: this.alarmPointSource
})
this.alarmPointLayer.setVisible(false)
this.map.addLayer(this.alarmPointLayer)
return this.alarmPointLayer
}
drawTrack (msg) {
window.xhint.show()
// let eventID = msg.event_id
let firstCard = msg.first_card
let secCard = msg.sec_card
let startTime = new Date(msg.limit_value).format('yyyy-MM-dd hh:mm:ss')
let endTime = new Date(msg.cur_value).format('yyyy-MM-dd hh:mm:ss')
let sqlmsg = {}
this.firstName = `${firstCard}card`
this.secondName = `${secCard}card`
this.firstPointName = `${firstCard}point`
this.secondPointName = `${secCard}point`
let firstsql = this.getSql(this.firstName, firstCard, startTime, endTime)
let secsql = this.getSql(this.secondName, secCard, startTime, endTime)
let firstPointsql = this.getPointsql(this.firstPointName, firstCard, startTime, endTime)
let secondPointsql = this.getPointsql(this.secondPointName, secCard, startTime, endTime)
sqlmsg[`'${this.firstName}'`] = firstsql
sqlmsg[`'${this.secondName}'`] = secsql
sqlmsg[`'${this.firstPointName}'`] = firstPointsql
sqlmsg[`'${this.secondPointName}'`] = secondPointsql
this.getData('personCards', sqlmsg)
}
getData (name, sql) {
let message = {
cmd: 'query',
data: {
name: name,
sql: sql
}
}
xbus.trigger('REPT-FETCH-DATA', {
req: message,
def: {
name: name
}
})
}
getSql (name, cardID, startTime, endTime) {
return `SELECT dse.card_id, begin_time, IFNULL(last_time, now()) as last_time, hl.begin_pt, speed, direction FROM his_location_staff_ hl INNER JOIN dat_staff_extend dse on hl.obj_id = dse.staff_id and dse.card_id = ${cardID} AND hl.ignore_flag = 0 WHERE begin_time >= '${startTime}' AND begin_time <= '${endTime}' ORDER BY begin_time;`
// this.getData(name, sql)
}
getPointsql (name, cardID, startTime, endTime) {
return `SELECT dse.card_id, begin_time, IFNULL(last_time, now()) as last_time, begin_pt, staff_id, speed, direction FROM his_location_staff_ hl, dat_staff_extend dse WHERE dse.card_id = ${cardID} AND hl.obj_id=dse.staff_id AND hl.ignore_flag = 0 and begin_time >= '${startTime}' AND begin_time <= '${endTime}' order by begin_time;`
// this.getData(name, sql)
}
drawLine (msg, name, idname) {
let rows = msg
if (rows && rows.length > 0) {
let path = getPolylineBYPoints(rows, 'begin_pt')
drawOLLine(this.alarmTrackSource, idname, path.pointCol, '', name, this.row)
}
}
drawPoint (msg, name, idname) {
let rows = msg
if (!rows) return
for (let i = 0, len = rows.length; i < len; i++) {
let row = rows[i]
let coordinate = row.begin_pt && row.begin_pt.split(',')
this.drawMapPoint(row, Number(coordinate[0]), Number(coordinate[1]), name)
}
}
setFeatureStyle (feature, name) {
let src = name === 'secondPoint' ? '../img/alarmpoint1.png' : '../img/alarmpoint.png'
return new ol.style.Style({
image: new ol.style.Icon(({
anchor: [0.55, 140],
anchorXUnits: 'fraction',
anchorYUnits: 'pixels',
src: src,
scale: 0.15
}))
})
}
drawMapPoint (row, x, y, name) {
let alarmPoint = new ol.geom.Point([x, -y])
let coordinate = row['begin_pt']
let feature = new ol.Feature({
geometry: new ol.geom.Point([0, 0]),
name: 'alarmPoint',
population: 4000,
rainfall: 500,
cardID: row.card_id,
time: row.begin_time,
x: Number(x),
y: Number(y),
'data-type': 'alarmPoint'
})
let id = `${row.card_id}-${row.begin_time}`
feature.setId(id)
feature.setStyle(this.setFeatureStyle(feature, name))
feature.setGeometry(alarmPoint)
this.alarmPointSource.addFeature(feature)
}
showTips (evt, feature) {
let type = feature.getProperties()['data-type']
let cardID, infoDef, formatedInfo
if (type === 'alarmPoint') {
cardID = feature.getProperties()['cardID']
name = xdata.metaStore.getCardBindObjectInfo(cardID) ? xdata.metaStore.getCardBindObjectInfo(cardID).name : '该卡没有绑定人员'
let curTime = feature.getProperties()['time']
infoDef = manages['alarmPoint']
formatedInfo = {
card_id: cardID,
name: name,
cur_time: curTime,
x: feature.getProperties()['x'],
y: feature.getProperties()['y']
}
} else {
cardID = feature.get('id').slice(0, 13)
name = xdata.metaStore.getCardBindObjectInfo(cardID) ? xdata.metaStore.getCardBindObjectInfo(cardID).name : '该卡没有绑定人员'
let startTime = feature.getProperties().msg.cur_time
let endTime = feature.getProperties().msg.cur_value
infoDef = feature.get('data-type') === 'startMarker' ? manages['personcardstart'] : manages['personcardend']
formatedInfo = feature.get('data-type') === 'startMarker' ? {
card_id: cardID,
name: name,
start_time: startTime
} : {
card_id: cardID,
name: name,
end_time: endTime
}
}
let coordinate = evt.coordinate
let msg = {
type: 'PERSONCARDS',
subtype: 'personcards',
id: cardID,
event: evt,
state: {
def: '',
rec: ''
},
info: {
def: infoDef,
rec: formatedInfo
},
coordinate: coordinate
}
xbus.trigger('MAP-TOOLTIPS-SHOW', msg)
}
}
|
Saif73012/nextbook
|
client/src/component/Element/DesktopNav.js
|
import React from "react";
import { Link } from "react-router-dom";
import "../../main.sass";
import homeIcon from "../../assets/img/navIcons/home.svg";
import aboutIcon from "../../assets/img/navIcons/about.svg";
import bookIcon from "../../assets/img/navIcons/books.svg";
import logoutIcon from "../../assets/img/navIcons/logout.svg";
import settingsIcon from "../../assets/img/navIcons/settings.svg";
function DesktopNav() {
return (
<>
<nav>
<ul>
<li>
<Link to="/home">
<button>
<span>Home</span>
<img src={homeIcon} alt="Home"></img>
</button>
</Link>
</li>
<li>
<Link to="/books">
<button>
<span>Bücher</span>
<img src={bookIcon} alt="Books"></img>
</button>
</Link>
</li>
<li>
<Link to="/settings">
<button>
<span>Einstellungen</span>
<img src={settingsIcon} alt="Einstellungen"></img>
</button>
</Link>
</li>
<li>
<Link
to="/"
onClick={() => {
localStorage.clear();
}}
>
<button>
<span>Ausloggen</span>
<img src={logoutIcon} alt="registrieren"></img>
</button>
</Link>
</li>
<li>
<Link to="/about" target="_blank">
<button>
<span>About</span>
<img src={aboutIcon} alt="about Nextbook"></img>
</button>
</Link>
</li>
</ul>
</nav>
</>
);
}
export default DesktopNav;
|
yueliangyi/SUNTANS_GVC
|
src/gridio.h
|
<reponame>yueliangyi/SUNTANS_GVC
/*
* File: physio.h
* Author: <NAME>
* Institution: Stanford University
* --------------------------------
* Header file for gridio.c.
*
* Copyright (C) 2005-2006 The Board of Trustees of the Leland Stanford Junior
* University. All Rights Reserved.
*
*/
#ifndef _gridio_h
#define _gridio_h
#include "grid.h"
#include "mympi.h"
void ReadGrid(gridT **grid, int myproc, int numprocs, MPI_Comm comm);
void OutputGridData(gridT *maingrid, gridT *grid, int myproc, int numprocs);
void ReadGridFileNames(int myproc);
void ReadDepth(gridT *grid, int myproc);
void ReadMainGrid(gridT *grid, int myproc);
#endif
|
phoenixeliot/design-system
|
src/MLIcon/PlaneSlashSolid.js
|
<reponame>phoenixeliot/design-system
import { wrapFontAwesomeIcon } from './icon-wrappers'
import { faPlaneSlash } from '@fortawesome/free-solid-svg-icons/faPlaneSlash'
const PlaneSlashSolid = wrapFontAwesomeIcon(faPlaneSlash, 'Solid')
export default PlaneSlashSolid
|
castor-software/rethread
|
code/drift/js/view/emojiView.js
|
export default class EmojiView {
constructor(container, model) {
this.model = model;
}
render() { }
addEmoji(data) {
const node = document.createElement("div");
const baseX = 25;
let time = 0;
let dist = 25;
node.className = "floating-emoji";
//${data.user.username}<br>
node.innerHTML = `<span class="">${data.emoji.emoji}</span>`;
node.style.top = window.innerHeight + "px";
node.style.right = `${dist}px`;
const interval = setInterval(() => {
time += 0.2;
dist = 25 + Math.sin(time) * baseX;
node.style.top = parseInt(node.style.top) - 5 + "px";
node.style.right = `${dist}px`;
if (parseInt(node.style.top) < -100) {
clearInterval(interval);
node.remove();
}
}, 33);
document.body.appendChild(node);
}
setIdentifications() { }
}
|
Y-D-Lu/rr_frameworks_base
|
core/java/android/accessibilityservice/AccessibilityServiceInfo.java
|
/*
* Copyright (C) 2009 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package android.accessibilityservice;
import static android.content.pm.PackageManager.FEATURE_FINGERPRINT;
import android.annotation.IntDef;
import android.content.ComponentName;
import android.content.Context;
import android.content.pm.PackageManager;
import android.content.pm.PackageManager.NameNotFoundException;
import android.content.pm.ResolveInfo;
import android.content.pm.ServiceInfo;
import android.content.res.Resources;
import android.content.res.TypedArray;
import android.content.res.XmlResourceParser;
import android.hardware.fingerprint.FingerprintManager;
import android.os.Parcel;
import android.os.Parcelable;
import android.util.AttributeSet;
import android.util.SparseArray;
import android.util.TypedValue;
import android.util.Xml;
import android.view.View;
import android.view.accessibility.AccessibilityEvent;
import android.view.accessibility.AccessibilityNodeInfo;
import com.android.internal.R;
import org.xmlpull.v1.XmlPullParser;
import org.xmlpull.v1.XmlPullParserException;
import java.io.IOException;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
/**
* This class describes an {@link AccessibilityService}. The system notifies an
* {@link AccessibilityService} for {@link android.view.accessibility.AccessibilityEvent}s
* according to the information encapsulated in this class.
*
* <div class="special reference">
* <h3>Developer Guides</h3>
* <p>For more information about creating AccessibilityServices, read the
* <a href="{@docRoot}guide/topics/ui/accessibility/index.html">Accessibility</a>
* developer guide.</p>
* </div>
*
* @attr ref android.R.styleable#AccessibilityService_accessibilityEventTypes
* @attr ref android.R.styleable#AccessibilityService_accessibilityFeedbackType
* @attr ref android.R.styleable#AccessibilityService_accessibilityFlags
* @attr ref android.R.styleable#AccessibilityService_canRequestEnhancedWebAccessibility
* @attr ref android.R.styleable#AccessibilityService_canRequestFilterKeyEvents
* @attr ref android.R.styleable#AccessibilityService_canRequestTouchExplorationMode
* @attr ref android.R.styleable#AccessibilityService_canRetrieveWindowContent
* @attr ref android.R.styleable#AccessibilityService_description
* @attr ref android.R.styleable#AccessibilityService_summary
* @attr ref android.R.styleable#AccessibilityService_notificationTimeout
* @attr ref android.R.styleable#AccessibilityService_packageNames
* @attr ref android.R.styleable#AccessibilityService_settingsActivity
* @see AccessibilityService
* @see android.view.accessibility.AccessibilityEvent
* @see android.view.accessibility.AccessibilityManager
*/
public class AccessibilityServiceInfo implements Parcelable {
private static final String TAG_ACCESSIBILITY_SERVICE = "accessibility-service";
/**
* Capability: This accessibility service can retrieve the active window content.
* @see android.R.styleable#AccessibilityService_canRetrieveWindowContent
*/
public static final int CAPABILITY_CAN_RETRIEVE_WINDOW_CONTENT = 0x00000001;
/**
* Capability: This accessibility service can request touch exploration mode in which
* touched items are spoken aloud and the UI can be explored via gestures.
* @see android.R.styleable#AccessibilityService_canRequestTouchExplorationMode
*/
public static final int CAPABILITY_CAN_REQUEST_TOUCH_EXPLORATION = 0x00000002;
/**
* @deprecated No longer used
*/
public static final int CAPABILITY_CAN_REQUEST_ENHANCED_WEB_ACCESSIBILITY = 0x00000004;
/**
* Capability: This accessibility service can request to filter the key event stream.
* @see android.R.styleable#AccessibilityService_canRequestFilterKeyEvents
*/
public static final int CAPABILITY_CAN_REQUEST_FILTER_KEY_EVENTS = 0x00000008;
/**
* Capability: This accessibility service can control display magnification.
* @see android.R.styleable#AccessibilityService_canControlMagnification
*/
public static final int CAPABILITY_CAN_CONTROL_MAGNIFICATION = 0x00000010;
/**
* Capability: This accessibility service can perform gestures.
* @see android.R.styleable#AccessibilityService_canPerformGestures
*/
public static final int CAPABILITY_CAN_PERFORM_GESTURES = 0x00000020;
/**
* Capability: This accessibility service can capture gestures from the fingerprint sensor
* @see android.R.styleable#AccessibilityService_canRequestFingerprintGestures
*/
public static final int CAPABILITY_CAN_REQUEST_FINGERPRINT_GESTURES = 0x00000040;
private static SparseArray<CapabilityInfo> sAvailableCapabilityInfos;
/**
* Denotes spoken feedback.
*/
public static final int FEEDBACK_SPOKEN = 0x0000001;
/**
* Denotes haptic feedback.
*/
public static final int FEEDBACK_HAPTIC = 0x0000002;
/**
* Denotes audible (not spoken) feedback.
*/
public static final int FEEDBACK_AUDIBLE = 0x0000004;
/**
* Denotes visual feedback.
*/
public static final int FEEDBACK_VISUAL = 0x0000008;
/**
* Denotes generic feedback.
*/
public static final int FEEDBACK_GENERIC = 0x0000010;
/**
* Denotes braille feedback.
*/
public static final int FEEDBACK_BRAILLE = 0x0000020;
/**
* Mask for all feedback types.
*
* @see #FEEDBACK_SPOKEN
* @see #FEEDBACK_HAPTIC
* @see #FEEDBACK_AUDIBLE
* @see #FEEDBACK_VISUAL
* @see #FEEDBACK_GENERIC
* @see #FEEDBACK_BRAILLE
*/
public static final int FEEDBACK_ALL_MASK = 0xFFFFFFFF;
/**
* If an {@link AccessibilityService} is the default for a given type.
* Default service is invoked only if no package specific one exists. In case of
* more than one package specific service only the earlier registered is notified.
*/
public static final int DEFAULT = 0x0000001;
/**
* If this flag is set the system will regard views that are not important
* for accessibility in addition to the ones that are important for accessibility.
* That is, views that are marked as not important for accessibility via
* {@link View#IMPORTANT_FOR_ACCESSIBILITY_NO} or
* {@link View#IMPORTANT_FOR_ACCESSIBILITY_NO_HIDE_DESCENDANTS} and views that are
* marked as potentially important for accessibility via
* {@link View#IMPORTANT_FOR_ACCESSIBILITY_AUTO} for which the system has determined
* that are not important for accessibility, are reported while querying the window
* content and also the accessibility service will receive accessibility events from
* them.
* <p>
* <strong>Note:</strong> For accessibility services targeting Android 4.1 (API level 16) or
* higher, this flag has to be explicitly set for the system to regard views that are not
* important for accessibility. For accessibility services targeting Android 4.0.4 (API level
* 15) or lower, this flag is ignored and all views are regarded for accessibility purposes.
* </p>
* <p>
* Usually views not important for accessibility are layout managers that do not
* react to user actions, do not draw any content, and do not have any special
* semantics in the context of the screen content. For example, a three by three
* grid can be implemented as three horizontal linear layouts and one vertical,
* or three vertical linear layouts and one horizontal, or one grid layout, etc.
* In this context, the actual layout managers used to achieve the grid configuration
* are not important; rather it is important that there are nine evenly distributed
* elements.
* </p>
*/
public static final int FLAG_INCLUDE_NOT_IMPORTANT_VIEWS = 0x0000002;
/**
* This flag requests that the system gets into touch exploration mode.
* In this mode a single finger moving on the screen behaves as a mouse
* pointer hovering over the user interface. The system will also detect
* certain gestures performed on the touch screen and notify this service.
* The system will enable touch exploration mode if there is at least one
* accessibility service that has this flag set. Hence, clearing this
* flag does not guarantee that the device will not be in touch exploration
* mode since there may be another enabled service that requested it.
* <p>
* For accessibility services targeting Android 4.3 (API level 18) or higher
* that want to set this flag have to declare this capability in their
* meta-data by setting the attribute
* {@link android.R.attr#canRequestTouchExplorationMode
* canRequestTouchExplorationMode} to true. Otherwise, this flag will
* be ignored. For how to declare the meta-data of a service refer to
* {@value AccessibilityService#SERVICE_META_DATA}.
* </p>
* <p>
* Services targeting Android 4.2.2 (API level 17) or lower will work
* normally. In other words, the first time they are run, if this flag is
* specified, a dialog is shown to the user to confirm enabling explore by
* touch.
* </p>
* @see android.R.styleable#AccessibilityService_canRequestTouchExplorationMode
*/
public static final int FLAG_REQUEST_TOUCH_EXPLORATION_MODE = 0x0000004;
/**
* @deprecated No longer used
*/
public static final int FLAG_REQUEST_ENHANCED_WEB_ACCESSIBILITY = 0x00000008;
/**
* This flag requests that the {@link AccessibilityNodeInfo}s obtained
* by an {@link AccessibilityService} contain the id of the source view.
* The source view id will be a fully qualified resource name of the
* form "package:id/name", for example "foo.bar:id/my_list", and it is
* useful for UI test automation. This flag is not set by default.
*/
public static final int FLAG_REPORT_VIEW_IDS = 0x00000010;
/**
* This flag requests from the system to filter key events. If this flag
* is set the accessibility service will receive the key events before
* applications allowing it implement global shortcuts.
* <p>
* Services that want to set this flag have to declare this capability
* in their meta-data by setting the attribute {@link android.R.attr
* #canRequestFilterKeyEvents canRequestFilterKeyEvents} to true,
* otherwise this flag will be ignored. For how to declare the meta-data
* of a service refer to {@value AccessibilityService#SERVICE_META_DATA}.
* </p>
* @see android.R.styleable#AccessibilityService_canRequestFilterKeyEvents
*/
public static final int FLAG_REQUEST_FILTER_KEY_EVENTS = 0x00000020;
/**
* This flag indicates to the system that the accessibility service wants
* to access content of all interactive windows. An interactive window is a
* window that has input focus or can be touched by a sighted user when explore
* by touch is not enabled. If this flag is not set your service will not receive
* {@link android.view.accessibility.AccessibilityEvent#TYPE_WINDOWS_CHANGED}
* events, calling AccessibilityService{@link AccessibilityService#getWindows()
* AccessibilityService.getWindows()} will return an empty list, and {@link
* AccessibilityNodeInfo#getWindow() AccessibilityNodeInfo.getWindow()} will
* return null.
* <p>
* Services that want to set this flag have to declare the capability
* to retrieve window content in their meta-data by setting the attribute
* {@link android.R.attr#canRetrieveWindowContent canRetrieveWindowContent} to
* true, otherwise this flag will be ignored. For how to declare the meta-data
* of a service refer to {@value AccessibilityService#SERVICE_META_DATA}.
* </p>
* @see android.R.styleable#AccessibilityService_canRetrieveWindowContent
*/
public static final int FLAG_RETRIEVE_INTERACTIVE_WINDOWS = 0x00000040;
/**
* This flag requests that all audio tracks system-wide with
* {@link android.media.AudioAttributes#USAGE_ASSISTANCE_ACCESSIBILITY} be controlled by the
* {@link android.media.AudioManager#STREAM_ACCESSIBILITY} volume.
*/
public static final int FLAG_ENABLE_ACCESSIBILITY_VOLUME = 0x00000080;
/**
* This flag indicates to the system that the accessibility service requests that an
* accessibility button be shown within the system's navigation area, if available.
*/
public static final int FLAG_REQUEST_ACCESSIBILITY_BUTTON = 0x00000100;
/**
* This flag requests that all fingerprint gestures be sent to the accessibility service.
* <p>
* Services that want to set this flag have to declare the capability
* to retrieve window content in their meta-data by setting the attribute
* {@link android.R.attr#canRequestFingerprintGestures} to
* true, otherwise this flag will be ignored. For how to declare the meta-data
* of a service refer to {@value AccessibilityService#SERVICE_META_DATA}.
* </p>
*
* @see android.R.styleable#AccessibilityService_canRequestFingerprintGestures
* @see AccessibilityService#getFingerprintGestureController()
*/
public static final int FLAG_REQUEST_FINGERPRINT_GESTURES = 0x00000200;
/** {@hide} */
public static final int FLAG_FORCE_DIRECT_BOOT_AWARE = 0x00010000;
/**
* The event types an {@link AccessibilityService} is interested in.
* <p>
* <strong>Can be dynamically set at runtime.</strong>
* </p>
* @see android.view.accessibility.AccessibilityEvent#TYPE_VIEW_CLICKED
* @see android.view.accessibility.AccessibilityEvent#TYPE_VIEW_LONG_CLICKED
* @see android.view.accessibility.AccessibilityEvent#TYPE_VIEW_FOCUSED
* @see android.view.accessibility.AccessibilityEvent#TYPE_VIEW_SELECTED
* @see android.view.accessibility.AccessibilityEvent#TYPE_VIEW_TEXT_CHANGED
* @see android.view.accessibility.AccessibilityEvent#TYPE_WINDOW_STATE_CHANGED
* @see android.view.accessibility.AccessibilityEvent#TYPE_NOTIFICATION_STATE_CHANGED
* @see android.view.accessibility.AccessibilityEvent#TYPE_TOUCH_EXPLORATION_GESTURE_START
* @see android.view.accessibility.AccessibilityEvent#TYPE_TOUCH_EXPLORATION_GESTURE_END
* @see android.view.accessibility.AccessibilityEvent#TYPE_VIEW_HOVER_ENTER
* @see android.view.accessibility.AccessibilityEvent#TYPE_VIEW_HOVER_EXIT
* @see android.view.accessibility.AccessibilityEvent#TYPE_VIEW_SCROLLED
* @see android.view.accessibility.AccessibilityEvent#TYPE_VIEW_TEXT_SELECTION_CHANGED
* @see android.view.accessibility.AccessibilityEvent#TYPE_WINDOW_CONTENT_CHANGED
* @see android.view.accessibility.AccessibilityEvent#TYPE_TOUCH_INTERACTION_START
* @see android.view.accessibility.AccessibilityEvent#TYPE_TOUCH_INTERACTION_END
* @see android.view.accessibility.AccessibilityEvent#TYPE_ANNOUNCEMENT
* @see android.view.accessibility.AccessibilityEvent#TYPE_GESTURE_DETECTION_START
* @see android.view.accessibility.AccessibilityEvent#TYPE_GESTURE_DETECTION_END
* @see android.view.accessibility.AccessibilityEvent#TYPE_VIEW_ACCESSIBILITY_FOCUSED
* @see android.view.accessibility.AccessibilityEvent#TYPE_VIEW_ACCESSIBILITY_FOCUS_CLEARED
* @see android.view.accessibility.AccessibilityEvent#TYPE_VIEW_TEXT_TRAVERSED_AT_MOVEMENT_GRANULARITY
* @see android.view.accessibility.AccessibilityEvent#TYPE_WINDOWS_CHANGED
*/
public int eventTypes;
/**
* The package names an {@link AccessibilityService} is interested in. Setting
* to <code>null</code> is equivalent to all packages.
* <p>
* <strong>Can be dynamically set at runtime.</strong>
* </p>
*/
public String[] packageNames;
/** @hide */
@IntDef(flag = true, prefix = { "FEEDBACK_" }, value = {
FEEDBACK_AUDIBLE,
FEEDBACK_GENERIC,
FEEDBACK_HAPTIC,
FEEDBACK_SPOKEN,
FEEDBACK_VISUAL,
FEEDBACK_BRAILLE
})
@Retention(RetentionPolicy.SOURCE)
public @interface FeedbackType {}
/**
* The feedback type an {@link AccessibilityService} provides.
* <p>
* <strong>Can be dynamically set at runtime.</strong>
* </p>
* @see #FEEDBACK_AUDIBLE
* @see #FEEDBACK_GENERIC
* @see #FEEDBACK_HAPTIC
* @see #FEEDBACK_SPOKEN
* @see #FEEDBACK_VISUAL
* @see #FEEDBACK_BRAILLE
*/
@FeedbackType
public int feedbackType;
/**
* The timeout, in milliseconds, after the most recent event of a given type before an
* {@link AccessibilityService} is notified.
* <p>
* <strong>Can be dynamically set at runtime.</strong>
* </p>
* <p>
* <strong>Note:</strong> The event notification timeout is useful to avoid propagating
* events to the client too frequently since this is accomplished via an expensive
* interprocess call. One can think of the timeout as a criteria to determine when
* event generation has settled down.
*/
public long notificationTimeout;
/**
* This field represents a set of flags used for configuring an
* {@link AccessibilityService}.
* <p>
* <strong>Can be dynamically set at runtime.</strong>
* </p>
* @see #DEFAULT
* @see #FLAG_INCLUDE_NOT_IMPORTANT_VIEWS
* @see #FLAG_REQUEST_TOUCH_EXPLORATION_MODE
* @see #FLAG_REQUEST_ENHANCED_WEB_ACCESSIBILITY
* @see #FLAG_REQUEST_FILTER_KEY_EVENTS
* @see #FLAG_REPORT_VIEW_IDS
* @see #FLAG_RETRIEVE_INTERACTIVE_WINDOWS
* @see #FLAG_ENABLE_ACCESSIBILITY_VOLUME
* @see #FLAG_REQUEST_ACCESSIBILITY_BUTTON
*/
public int flags;
/**
* Whether or not the service has crashed and is awaiting restart. Only valid from {@link
* android.view.accessibility.AccessibilityManager#getEnabledAccessibilityServiceList(int)},
* because that is populated from the internal list of running services.
*
* @hide
*/
public boolean crashed;
/**
* The component name the accessibility service.
*/
private ComponentName mComponentName;
/**
* The Service that implements this accessibility service component.
*/
private ResolveInfo mResolveInfo;
/**
* The accessibility service setting activity's name, used by the system
* settings to launch the setting activity of this accessibility service.
*/
private String mSettingsActivityName;
/**
* Bit mask with capabilities of this service.
*/
private int mCapabilities;
/**
* Resource id of the summary of the accessibility service.
*/
private int mSummaryResId;
/**
* Non-localized summary of the accessibility service.
*/
private String mNonLocalizedSummary;
/**
* Resource id of the description of the accessibility service.
*/
private int mDescriptionResId;
/**
* Non localized description of the accessibility service.
*/
private String mNonLocalizedDescription;
/**
* Creates a new instance.
*/
public AccessibilityServiceInfo() {
/* do nothing */
}
/**
* Creates a new instance.
*
* @param resolveInfo The service resolve info.
* @param context Context for accessing resources.
* @throws XmlPullParserException If a XML parsing error occurs.
* @throws IOException If a XML parsing error occurs.
*
* @hide
*/
public AccessibilityServiceInfo(ResolveInfo resolveInfo, Context context)
throws XmlPullParserException, IOException {
ServiceInfo serviceInfo = resolveInfo.serviceInfo;
mComponentName = new ComponentName(serviceInfo.packageName, serviceInfo.name);
mResolveInfo = resolveInfo;
XmlResourceParser parser = null;
try {
PackageManager packageManager = context.getPackageManager();
parser = serviceInfo.loadXmlMetaData(packageManager,
AccessibilityService.SERVICE_META_DATA);
if (parser == null) {
return;
}
int type = 0;
while (type != XmlPullParser.END_DOCUMENT && type != XmlPullParser.START_TAG) {
type = parser.next();
}
String nodeName = parser.getName();
if (!TAG_ACCESSIBILITY_SERVICE.equals(nodeName)) {
throw new XmlPullParserException( "Meta-data does not start with"
+ TAG_ACCESSIBILITY_SERVICE + " tag");
}
AttributeSet allAttributes = Xml.asAttributeSet(parser);
Resources resources = packageManager.getResourcesForApplication(
serviceInfo.applicationInfo);
TypedArray asAttributes = resources.obtainAttributes(allAttributes,
com.android.internal.R.styleable.AccessibilityService);
eventTypes = asAttributes.getInt(
com.android.internal.R.styleable.AccessibilityService_accessibilityEventTypes,
0);
String packageNamez = asAttributes.getString(
com.android.internal.R.styleable.AccessibilityService_packageNames);
if (packageNamez != null) {
packageNames = packageNamez.split("(\\s)*,(\\s)*");
}
feedbackType = asAttributes.getInt(
com.android.internal.R.styleable.AccessibilityService_accessibilityFeedbackType,
0);
notificationTimeout = asAttributes.getInt(
com.android.internal.R.styleable.AccessibilityService_notificationTimeout,
0);
flags = asAttributes.getInt(
com.android.internal.R.styleable.AccessibilityService_accessibilityFlags, 0);
mSettingsActivityName = asAttributes.getString(
com.android.internal.R.styleable.AccessibilityService_settingsActivity);
if (asAttributes.getBoolean(com.android.internal.R.styleable
.AccessibilityService_canRetrieveWindowContent, false)) {
mCapabilities |= CAPABILITY_CAN_RETRIEVE_WINDOW_CONTENT;
}
if (asAttributes.getBoolean(com.android.internal.R.styleable
.AccessibilityService_canRequestTouchExplorationMode, false)) {
mCapabilities |= CAPABILITY_CAN_REQUEST_TOUCH_EXPLORATION;
}
if (asAttributes.getBoolean(com.android.internal.R.styleable
.AccessibilityService_canRequestFilterKeyEvents, false)) {
mCapabilities |= CAPABILITY_CAN_REQUEST_FILTER_KEY_EVENTS;
}
if (asAttributes.getBoolean(com.android.internal.R.styleable
.AccessibilityService_canControlMagnification, false)) {
mCapabilities |= CAPABILITY_CAN_CONTROL_MAGNIFICATION;
}
if (asAttributes.getBoolean(com.android.internal.R.styleable
.AccessibilityService_canPerformGestures, false)) {
mCapabilities |= CAPABILITY_CAN_PERFORM_GESTURES;
}
if (asAttributes.getBoolean(com.android.internal.R.styleable
.AccessibilityService_canRequestFingerprintGestures, false)) {
mCapabilities |= CAPABILITY_CAN_REQUEST_FINGERPRINT_GESTURES;
}
TypedValue peekedValue = asAttributes.peekValue(
com.android.internal.R.styleable.AccessibilityService_description);
if (peekedValue != null) {
mDescriptionResId = peekedValue.resourceId;
CharSequence nonLocalizedDescription = peekedValue.coerceToString();
if (nonLocalizedDescription != null) {
mNonLocalizedDescription = nonLocalizedDescription.toString().trim();
}
}
peekedValue = asAttributes.peekValue(
com.android.internal.R.styleable.AccessibilityService_summary);
if (peekedValue != null) {
mSummaryResId = peekedValue.resourceId;
CharSequence nonLocalizedSummary = peekedValue.coerceToString();
if (nonLocalizedSummary != null) {
mNonLocalizedSummary = nonLocalizedSummary.toString().trim();
}
}
asAttributes.recycle();
} catch (NameNotFoundException e) {
throw new XmlPullParserException( "Unable to create context for: "
+ serviceInfo.packageName);
} finally {
if (parser != null) {
parser.close();
}
}
}
/**
* Updates the properties that an AccessibilitySerivice can change dynamically.
*
* @param other The info from which to update the properties.
*
* @hide
*/
public void updateDynamicallyConfigurableProperties(AccessibilityServiceInfo other) {
eventTypes = other.eventTypes;
packageNames = other.packageNames;
feedbackType = other.feedbackType;
notificationTimeout = other.notificationTimeout;
flags = other.flags;
}
/**
* @hide
*/
public void setComponentName(ComponentName component) {
mComponentName = component;
}
/**
* @hide
*/
public ComponentName getComponentName() {
return mComponentName;
}
/**
* The accessibility service id.
* <p>
* <strong>Generated by the system.</strong>
* </p>
* @return The id.
*/
public String getId() {
return mComponentName.flattenToShortString();
}
/**
* The service {@link ResolveInfo}.
* <p>
* <strong>Generated by the system.</strong>
* </p>
* @return The info.
*/
public ResolveInfo getResolveInfo() {
return mResolveInfo;
}
/**
* The settings activity name.
* <p>
* <strong>Statically set from
* {@link AccessibilityService#SERVICE_META_DATA meta-data}.</strong>
* </p>
* @return The settings activity name.
*/
public String getSettingsActivityName() {
return mSettingsActivityName;
}
/**
* Whether this service can retrieve the current window's content.
* <p>
* <strong>Statically set from
* {@link AccessibilityService#SERVICE_META_DATA meta-data}.</strong>
* </p>
* @return True if window content can be retrieved.
*
* @deprecated Use {@link #getCapabilities()}.
*/
public boolean getCanRetrieveWindowContent() {
return (mCapabilities & CAPABILITY_CAN_RETRIEVE_WINDOW_CONTENT) != 0;
}
/**
* Returns the bit mask of capabilities this accessibility service has such as
* being able to retrieve the active window content, etc.
*
* @return The capability bit mask.
*
* @see #CAPABILITY_CAN_RETRIEVE_WINDOW_CONTENT
* @see #CAPABILITY_CAN_REQUEST_TOUCH_EXPLORATION
* @see #CAPABILITY_CAN_REQUEST_FILTER_KEY_EVENTS
* @see #CAPABILITY_CAN_CONTROL_MAGNIFICATION
* @see #CAPABILITY_CAN_PERFORM_GESTURES
*/
public int getCapabilities() {
return mCapabilities;
}
/**
* Sets the bit mask of capabilities this accessibility service has such as
* being able to retrieve the active window content, etc.
*
* @param capabilities The capability bit mask.
*
* @see #CAPABILITY_CAN_RETRIEVE_WINDOW_CONTENT
* @see #CAPABILITY_CAN_REQUEST_TOUCH_EXPLORATION
* @see #CAPABILITY_CAN_REQUEST_FILTER_KEY_EVENTS
* @see #CAPABILITY_CAN_CONTROL_MAGNIFICATION
* @see #CAPABILITY_CAN_PERFORM_GESTURES
*
* @hide
*/
public void setCapabilities(int capabilities) {
mCapabilities = capabilities;
}
/**
* The localized summary of the accessibility service.
* <p>
* <strong>Statically set from
* {@link AccessibilityService#SERVICE_META_DATA meta-data}.</strong>
* </p>
* @return The localized summary if available, and {@code null} if a summary
* has not been provided.
*/
public CharSequence loadSummary(PackageManager packageManager) {
if (mSummaryResId == 0) {
return mNonLocalizedSummary;
}
ServiceInfo serviceInfo = mResolveInfo.serviceInfo;
CharSequence summary = packageManager.getText(serviceInfo.packageName,
mSummaryResId, serviceInfo.applicationInfo);
if (summary != null) {
return summary.toString().trim();
}
return null;
}
/**
* Gets the non-localized description of the accessibility service.
* <p>
* <strong>Statically set from
* {@link AccessibilityService#SERVICE_META_DATA meta-data}.</strong>
* </p>
* @return The description.
*
* @deprecated Use {@link #loadDescription(PackageManager)}.
*/
public String getDescription() {
return mNonLocalizedDescription;
}
/**
* The localized description of the accessibility service.
* <p>
* <strong>Statically set from
* {@link AccessibilityService#SERVICE_META_DATA meta-data}.</strong>
* </p>
* @return The localized description.
*/
public String loadDescription(PackageManager packageManager) {
if (mDescriptionResId == 0) {
return mNonLocalizedDescription;
}
ServiceInfo serviceInfo = mResolveInfo.serviceInfo;
CharSequence description = packageManager.getText(serviceInfo.packageName,
mDescriptionResId, serviceInfo.applicationInfo);
if (description != null) {
return description.toString().trim();
}
return null;
}
/** {@hide} */
public boolean isDirectBootAware() {
return ((flags & FLAG_FORCE_DIRECT_BOOT_AWARE) != 0)
|| mResolveInfo.serviceInfo.directBootAware;
}
/**
* {@inheritDoc}
*/
public int describeContents() {
return 0;
}
public void writeToParcel(Parcel parcel, int flagz) {
parcel.writeInt(eventTypes);
parcel.writeStringArray(packageNames);
parcel.writeInt(feedbackType);
parcel.writeLong(notificationTimeout);
parcel.writeInt(flags);
parcel.writeInt(crashed ? 1 : 0);
parcel.writeParcelable(mComponentName, flagz);
parcel.writeParcelable(mResolveInfo, 0);
parcel.writeString(mSettingsActivityName);
parcel.writeInt(mCapabilities);
parcel.writeInt(mSummaryResId);
parcel.writeString(mNonLocalizedSummary);
parcel.writeInt(mDescriptionResId);
parcel.writeString(mNonLocalizedDescription);
}
private void initFromParcel(Parcel parcel) {
eventTypes = parcel.readInt();
packageNames = parcel.readStringArray();
feedbackType = parcel.readInt();
notificationTimeout = parcel.readLong();
flags = parcel.readInt();
crashed = parcel.readInt() != 0;
mComponentName = parcel.readParcelable(this.getClass().getClassLoader());
mResolveInfo = parcel.readParcelable(null);
mSettingsActivityName = parcel.readString();
mCapabilities = parcel.readInt();
mSummaryResId = parcel.readInt();
mNonLocalizedSummary = parcel.readString();
mDescriptionResId = parcel.readInt();
mNonLocalizedDescription = parcel.readString();
}
@Override
public int hashCode() {
return 31 * 1 + ((mComponentName == null) ? 0 : mComponentName.hashCode());
}
@Override
public boolean equals(Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (getClass() != obj.getClass()) {
return false;
}
AccessibilityServiceInfo other = (AccessibilityServiceInfo) obj;
if (mComponentName == null) {
if (other.mComponentName != null) {
return false;
}
} else if (!mComponentName.equals(other.mComponentName)) {
return false;
}
return true;
}
@Override
public String toString() {
StringBuilder stringBuilder = new StringBuilder();
appendEventTypes(stringBuilder, eventTypes);
stringBuilder.append(", ");
appendPackageNames(stringBuilder, packageNames);
stringBuilder.append(", ");
appendFeedbackTypes(stringBuilder, feedbackType);
stringBuilder.append(", ");
stringBuilder.append("notificationTimeout: ").append(notificationTimeout);
stringBuilder.append(", ");
appendFlags(stringBuilder, flags);
stringBuilder.append(", ");
stringBuilder.append("id: ").append(getId());
stringBuilder.append(", ");
stringBuilder.append("resolveInfo: ").append(mResolveInfo);
stringBuilder.append(", ");
stringBuilder.append("settingsActivityName: ").append(mSettingsActivityName);
stringBuilder.append(", ");
stringBuilder.append("summary: ").append(mNonLocalizedSummary);
stringBuilder.append(", ");
appendCapabilities(stringBuilder, mCapabilities);
return stringBuilder.toString();
}
private static void appendFeedbackTypes(StringBuilder stringBuilder,
@FeedbackType int feedbackTypes) {
stringBuilder.append("feedbackTypes:");
stringBuilder.append("[");
while (feedbackTypes != 0) {
final int feedbackTypeBit = (1 << Integer.numberOfTrailingZeros(feedbackTypes));
stringBuilder.append(feedbackTypeToString(feedbackTypeBit));
feedbackTypes &= ~feedbackTypeBit;
if (feedbackTypes != 0) {
stringBuilder.append(", ");
}
}
stringBuilder.append("]");
}
private static void appendPackageNames(StringBuilder stringBuilder, String[] packageNames) {
stringBuilder.append("packageNames:");
stringBuilder.append("[");
if (packageNames != null) {
final int packageNameCount = packageNames.length;
for (int i = 0; i < packageNameCount; i++) {
stringBuilder.append(packageNames[i]);
if (i < packageNameCount - 1) {
stringBuilder.append(", ");
}
}
}
stringBuilder.append("]");
}
private static void appendEventTypes(StringBuilder stringBuilder, int eventTypes) {
stringBuilder.append("eventTypes:");
stringBuilder.append("[");
while (eventTypes != 0) {
final int eventTypeBit = (1 << Integer.numberOfTrailingZeros(eventTypes));
stringBuilder.append(AccessibilityEvent.eventTypeToString(eventTypeBit));
eventTypes &= ~eventTypeBit;
if (eventTypes != 0) {
stringBuilder.append(", ");
}
}
stringBuilder.append("]");
}
private static void appendFlags(StringBuilder stringBuilder, int flags) {
stringBuilder.append("flags:");
stringBuilder.append("[");
while (flags != 0) {
final int flagBit = (1 << Integer.numberOfTrailingZeros(flags));
stringBuilder.append(flagToString(flagBit));
flags &= ~flagBit;
if (flags != 0) {
stringBuilder.append(", ");
}
}
stringBuilder.append("]");
}
private static void appendCapabilities(StringBuilder stringBuilder, int capabilities) {
stringBuilder.append("capabilities:");
stringBuilder.append("[");
while (capabilities != 0) {
final int capabilityBit = (1 << Integer.numberOfTrailingZeros(capabilities));
stringBuilder.append(capabilityToString(capabilityBit));
capabilities &= ~capabilityBit;
if (capabilities != 0) {
stringBuilder.append(", ");
}
}
stringBuilder.append("]");
}
/**
* Returns the string representation of a feedback type. For example,
* {@link #FEEDBACK_SPOKEN} is represented by the string FEEDBACK_SPOKEN.
*
* @param feedbackType The feedback type.
* @return The string representation.
*/
public static String feedbackTypeToString(int feedbackType) {
StringBuilder builder = new StringBuilder();
builder.append("[");
while (feedbackType != 0) {
final int feedbackTypeFlag = 1 << Integer.numberOfTrailingZeros(feedbackType);
feedbackType &= ~feedbackTypeFlag;
switch (feedbackTypeFlag) {
case FEEDBACK_AUDIBLE:
if (builder.length() > 1) {
builder.append(", ");
}
builder.append("FEEDBACK_AUDIBLE");
break;
case FEEDBACK_HAPTIC:
if (builder.length() > 1) {
builder.append(", ");
}
builder.append("FEEDBACK_HAPTIC");
break;
case FEEDBACK_GENERIC:
if (builder.length() > 1) {
builder.append(", ");
}
builder.append("FEEDBACK_GENERIC");
break;
case FEEDBACK_SPOKEN:
if (builder.length() > 1) {
builder.append(", ");
}
builder.append("FEEDBACK_SPOKEN");
break;
case FEEDBACK_VISUAL:
if (builder.length() > 1) {
builder.append(", ");
}
builder.append("FEEDBACK_VISUAL");
break;
case FEEDBACK_BRAILLE:
if (builder.length() > 1) {
builder.append(", ");
}
builder.append("FEEDBACK_BRAILLE");
break;
}
}
builder.append("]");
return builder.toString();
}
/**
* Returns the string representation of a flag. For example,
* {@link #DEFAULT} is represented by the string DEFAULT.
*
* @param flag The flag.
* @return The string representation.
*/
public static String flagToString(int flag) {
switch (flag) {
case DEFAULT:
return "DEFAULT";
case FLAG_INCLUDE_NOT_IMPORTANT_VIEWS:
return "FLAG_INCLUDE_NOT_IMPORTANT_VIEWS";
case FLAG_REQUEST_TOUCH_EXPLORATION_MODE:
return "FLAG_REQUEST_TOUCH_EXPLORATION_MODE";
case FLAG_REQUEST_ENHANCED_WEB_ACCESSIBILITY:
return "FLAG_REQUEST_ENHANCED_WEB_ACCESSIBILITY";
case FLAG_REPORT_VIEW_IDS:
return "FLAG_REPORT_VIEW_IDS";
case FLAG_REQUEST_FILTER_KEY_EVENTS:
return "FLAG_REQUEST_FILTER_KEY_EVENTS";
case FLAG_RETRIEVE_INTERACTIVE_WINDOWS:
return "FLAG_RETRIEVE_INTERACTIVE_WINDOWS";
case FLAG_ENABLE_ACCESSIBILITY_VOLUME:
return "FLAG_ENABLE_ACCESSIBILITY_VOLUME";
case FLAG_REQUEST_ACCESSIBILITY_BUTTON:
return "FLAG_REQUEST_ACCESSIBILITY_BUTTON";
case FLAG_REQUEST_FINGERPRINT_GESTURES:
return "FLAG_REQUEST_FINGERPRINT_GESTURES";
default:
return null;
}
}
/**
* Returns the string representation of a capability. For example,
* {@link #CAPABILITY_CAN_RETRIEVE_WINDOW_CONTENT} is represented
* by the string CAPABILITY_CAN_RETRIEVE_WINDOW_CONTENT.
*
* @param capability The capability.
* @return The string representation.
*/
public static String capabilityToString(int capability) {
switch (capability) {
case CAPABILITY_CAN_RETRIEVE_WINDOW_CONTENT:
return "CAPABILITY_CAN_RETRIEVE_WINDOW_CONTENT";
case CAPABILITY_CAN_REQUEST_TOUCH_EXPLORATION:
return "CAPABILITY_CAN_REQUEST_TOUCH_EXPLORATION";
case CAPABILITY_CAN_REQUEST_ENHANCED_WEB_ACCESSIBILITY:
return "CAPABILITY_CAN_REQUEST_ENHANCED_WEB_ACCESSIBILITY";
case CAPABILITY_CAN_REQUEST_FILTER_KEY_EVENTS:
return "CAPABILITY_CAN_REQUEST_FILTER_KEY_EVENTS";
case CAPABILITY_CAN_CONTROL_MAGNIFICATION:
return "CAPABILITY_CAN_CONTROL_MAGNIFICATION";
case CAPABILITY_CAN_PERFORM_GESTURES:
return "CAPABILITY_CAN_PERFORM_GESTURES";
case CAPABILITY_CAN_REQUEST_FINGERPRINT_GESTURES:
return "CAPABILITY_CAN_REQUEST_FINGERPRINT_GESTURES";
default:
return "UNKNOWN";
}
}
/**
* @hide
* @return The list of {@link CapabilityInfo} objects.
* @deprecated The version that takes a context works better.
*/
public List<CapabilityInfo> getCapabilityInfos() {
return getCapabilityInfos(null);
}
/**
* @hide
* @param context A valid context
* @return The list of {@link CapabilityInfo} objects.
*/
public List<CapabilityInfo> getCapabilityInfos(Context context) {
if (mCapabilities == 0) {
return Collections.emptyList();
}
int capabilities = mCapabilities;
List<CapabilityInfo> capabilityInfos = new ArrayList<CapabilityInfo>();
SparseArray<CapabilityInfo> capabilityInfoSparseArray =
getCapabilityInfoSparseArray(context);
while (capabilities != 0) {
final int capabilityBit = 1 << Integer.numberOfTrailingZeros(capabilities);
capabilities &= ~capabilityBit;
CapabilityInfo capabilityInfo = capabilityInfoSparseArray.get(capabilityBit);
if (capabilityInfo != null) {
capabilityInfos.add(capabilityInfo);
}
}
return capabilityInfos;
}
private static SparseArray<CapabilityInfo> getCapabilityInfoSparseArray(Context context) {
if (sAvailableCapabilityInfos == null) {
sAvailableCapabilityInfos = new SparseArray<CapabilityInfo>();
sAvailableCapabilityInfos.put(CAPABILITY_CAN_RETRIEVE_WINDOW_CONTENT,
new CapabilityInfo(CAPABILITY_CAN_RETRIEVE_WINDOW_CONTENT,
R.string.capability_title_canRetrieveWindowContent,
R.string.capability_desc_canRetrieveWindowContent));
sAvailableCapabilityInfos.put(CAPABILITY_CAN_REQUEST_TOUCH_EXPLORATION,
new CapabilityInfo(CAPABILITY_CAN_REQUEST_TOUCH_EXPLORATION,
R.string.capability_title_canRequestTouchExploration,
R.string.capability_desc_canRequestTouchExploration));
sAvailableCapabilityInfos.put(CAPABILITY_CAN_REQUEST_FILTER_KEY_EVENTS,
new CapabilityInfo(CAPABILITY_CAN_REQUEST_FILTER_KEY_EVENTS,
R.string.capability_title_canRequestFilterKeyEvents,
R.string.capability_desc_canRequestFilterKeyEvents));
sAvailableCapabilityInfos.put(CAPABILITY_CAN_CONTROL_MAGNIFICATION,
new CapabilityInfo(CAPABILITY_CAN_CONTROL_MAGNIFICATION,
R.string.capability_title_canControlMagnification,
R.string.capability_desc_canControlMagnification));
sAvailableCapabilityInfos.put(CAPABILITY_CAN_PERFORM_GESTURES,
new CapabilityInfo(CAPABILITY_CAN_PERFORM_GESTURES,
R.string.capability_title_canPerformGestures,
R.string.capability_desc_canPerformGestures));
if ((context == null) || fingerprintAvailable(context)) {
sAvailableCapabilityInfos.put(CAPABILITY_CAN_REQUEST_FINGERPRINT_GESTURES,
new CapabilityInfo(CAPABILITY_CAN_REQUEST_FINGERPRINT_GESTURES,
R.string.capability_title_canCaptureFingerprintGestures,
R.string.capability_desc_canCaptureFingerprintGestures));
}
}
return sAvailableCapabilityInfos;
}
private static boolean fingerprintAvailable(Context context) {
return context.getPackageManager().hasSystemFeature(FEATURE_FINGERPRINT)
&& context.getSystemService(FingerprintManager.class).isHardwareDetected();
}
/**
* @hide
*/
public static final class CapabilityInfo {
public final int capability;
public final int titleResId;
public final int descResId;
public CapabilityInfo(int capability, int titleResId, int descResId) {
this.capability = capability;
this.titleResId = titleResId;
this.descResId = descResId;
}
}
/**
* @see Parcelable.Creator
*/
public static final Parcelable.Creator<AccessibilityServiceInfo> CREATOR =
new Parcelable.Creator<AccessibilityServiceInfo>() {
public AccessibilityServiceInfo createFromParcel(Parcel parcel) {
AccessibilityServiceInfo info = new AccessibilityServiceInfo();
info.initFromParcel(parcel);
return info;
}
public AccessibilityServiceInfo[] newArray(int size) {
return new AccessibilityServiceInfo[size];
}
};
}
|
bilde2910/IRCLinqed
|
src/main/java/info/varden/irclinqed/gui/GuiTimer.java
|
/*
Copyright 2014 <NAME>
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package info.varden.irclinqed.gui;
public class GuiTimer {
protected final ITimerGui gui;
protected int tickCount = 0;
private boolean run = true;
private boolean stop = false;
private int frequency;
private final int id;
public GuiTimer(ITimerGui gui, int id, int frequency) {
this.gui = gui;
this.frequency = frequency;
this.id = id;
Runnable r = new GuiTimerRunnable(this);
Thread t = new Thread(r);
t.start();
}
public void resume() {
this.run = true;
}
public void pause() {
this.run = false;
}
public void stop() {
this.stop = true;
}
public boolean isPaused() {
return this.run;
}
public boolean isStopped() {
return this.stop;
}
public int getFrequency() {
return this.frequency;
}
public int getTickCount() {
return this.tickCount;
}
public int getId() {
return this.id;
}
}
|
jmoody/LJS
|
Google/Models/Non-Managed/LjsGoogleNmoReverseGeocode.h
|
<reponame>jmoody/LJS
#import <Foundation/Foundation.h>
@class LjsLocation;
/**
Documentation
*/
@interface LjsGoogleNmoReverseGeocode : NSObject
/** @name Properties */
@property (nonatomic, strong) NSArray *types;
@property (nonatomic, copy) NSString *formattedAddress;
@property (nonatomic, strong) NSArray *addressComponents;
@property (nonatomic, strong) LjsLocation *location;
@property (nonatomic, copy) NSString *locationType;
@property (nonatomic, strong) NSDictionary *viewport;
@property (nonatomic, strong) NSDictionary *bounds;
/** @name Initializing Objects */
- (id) initWithDictionary:(NSDictionary *) aDictionary;
/** @name Handling Notifications, Requests, and Events */
/** @name Utility */
@end
|
glcnzude126/SeetaFace2
|
SeetaNet/src/include_inner/layers/SeetaNetExpCPU.h
|
#ifndef _SEETANET_EXP_CPU_H_
#define _SEETANET_EXP_CPU_H_
#include "SeetaNetBaseLayer.h"
#include <cmath>
#include <cstring>
template <class T>
class SeetaNetExpCPU : public SeetaNetBaseLayer<T>
{
public:
SeetaNetExpCPU();
~SeetaNetExpCPU();
int Init(seeta::SeetaNet_LayerParameter &inputparam, SeetaNetResource<T> *pNetResource);
int Process(std::vector<SeetaNetFeatureMap<T>*> input_data_map, std::vector<SeetaNetFeatureMap<T>*> &output_data_map);
public:
T m_scale_in;
T m_scale_out;
private:
int ProcessScaleInNotOne();
int ProcessScaleInOne();
int ProcessScaleOutNotOne();
};
template <class T>
SeetaNetExpCPU<T>::SeetaNetExpCPU()
{
}
template <class T>
SeetaNetExpCPU<T>::~SeetaNetExpCPU()
{
}
template <class T>
int SeetaNetExpCPU<T>::Init(seeta::SeetaNet_LayerParameter &inputparam, SeetaNetResource<T> *pNetResource)
{
seeta::SeetaNet_ExpParameter *msg = (seeta::SeetaNet_ExpParameter *)inputparam.msg.get();
m_scale_in = msg->scale;
m_scale_out = msg->shift;
int index = inputparam.bottom_index[0];
this->bottom_data_size.resize(1);
this->bottom_data_size[0] = pNetResource->feature_vector_size[index];
this->top_data_size.resize(1);
this->top_data_size[0] = this->bottom_data_size[0];
return 0;
}
template<typename T, typename FUNC>
static void each_do(T *arr, size_t size, FUNC func)
{
auto gun = orz::ctx::lite::ptr<orz::Shotgun>();
if (gun == nullptr || gun->size() <= 1)
{
for (size_t i = 0; i < size; ++i)
{
func(*arr);
++arr;
}
}
else
{
auto bins = orz::lsplit_bins(0, size, gun->size());
for (auto &bin : bins)
{
gun->fire([&, bin](int)
{
auto local_arr = arr + bin.first;
for (size_t i = bin.first; i < bin.second; ++i)
{
func(*local_arr);
++local_arr;
}
});
}
gun->join();
}
}
template <class T>
int SeetaNetExpCPU<T>::Process(std::vector<SeetaNetFeatureMap<T>*> input_data_map, std::vector<SeetaNetFeatureMap<T>*> &output_data_map)
{
input_data_map[0]->TransFormDataIn();
if (this->bottom_index[0] != this->top_index[0])
{
output_data_map[0]->data_shape = input_data_map[0]->data_shape;
memcpy(output_data_map[0]->m_cpu.dataMemoryPtr(), input_data_map[0]->m_cpu.dataMemoryPtr(), sizeof(T)*output_data_map[0]->count());
}
auto type = (m_scale_in != T(1) ? 0x01 : 0x00) | (m_scale_out != T(1) ? 0x02 : 0x00);
switch (type)
{
default:
case 0: // m_scale_in == 1, m_scale_out == 1,
each_do<T>(output_data_map[0]->m_cpu.dataMemoryPtr(), output_data_map[0]->count(), [&](T & val)
{
val = std::exp(val);
});
break;
case 1: // m_scale_in != 1, m_scale_out == 1,
each_do<T>(output_data_map[0]->m_cpu.dataMemoryPtr(), output_data_map[0]->count(), [&](T & val)
{
val = std::exp(val * m_scale_in);
});
break;
case 2: // m_scale_in == 1, m_scale_out != 1,
each_do<T>(output_data_map[0]->m_cpu.dataMemoryPtr(), output_data_map[0]->count(), [&](T & val)
{
val = std::exp(val) * m_scale_out;
});
break;
case 3: // m_scale_in != 1, m_scale_out != 1,
each_do<T>(output_data_map[0]->m_cpu.dataMemoryPtr(), output_data_map[0]->count(), [&](T & val)
{
val = std::exp(val * m_scale_in) * m_scale_out;
});
break;
}
output_data_map[0]->dwStorageType = DATA_CPU_WIDTH;
output_data_map[0]->data_shape[0] = input_data_map[0]->data_shape[0];
output_data_map[0]->data_shape[1] = input_data_map[0]->data_shape[1];
output_data_map[0]->data_shape[2] = input_data_map[0]->data_shape[2];
output_data_map[0]->data_shape[3] = input_data_map[0]->data_shape[3];
return 0;
};
#endif //!__EXP_LAYER_H__
|
iamvishnuks/Xmigrate
|
pkg/common/build.py
|
import os
from model.blueprint import *
from model.project import *
from model.disk import *
from model.discover import *
from utils.log_reader import *
from utils.dbconn import *
from utils.logger import *
from pkg.common import nodes as n
import time
from pkg.azure import network
from pkg.aws import disk as awsdisk
from pkg.gcp import disk as gcpdisk
from pkg.azure import disk
from pkg.azure import resource_group
from pkg.azure import compute
from pkg.gcp import compute as gcp_compute
from pkg.aws import ami
from pkg.aws import network as awsnw
from pkg.aws import ec2
from pkg.gcp import network as gcpnw
import asyncio
async def call_start_build(project):
await asyncio.create_task(start_build(project))
async def start_infra_build(project):
rg_created = resource_group.create_rg(project)
if rg_created:
disk_created = await disk.create_disk(project)
if disk_created:
network_created = network.create_nw(project)
if network_created:
vm_created = compute.create_vm(project)
if vm_created:
print("VM created")
else:
print("VM creation failed")
else:
print("Network creation failed")
else:
print("Disk creation failed")
else:
print("Resource group creation failed")
async def call_start_clone(project,hostname):
await asyncio.create_task(start_cloning(project,hostname))
async def start_cloning(project,hostname):
con = create_db_con()
p = Project.objects(name=project)
if len(p) > 0:
nodes = []
for host in Project.objects(name=project)[0]['public_ip']:
nodes.append(host)
username = Project.objects(name=project)[0]['username']
password = Project.objects(name=project)[0]['password']
if n.add_nodes(nodes,username,password, project, False) == False:
logger("Cloning couldn't start because inventory not created","error")
else:
if p[0]['provider'] == "azure":
logger("Cloning started","info")
print("****************Cloning awaiting*****************")
cloning_completed = await disk.start_cloning(project,hostname)
if cloning_completed:
print("****************Cloning completed*****************")
logger("Disk cloning completed","info")
else:
print("Disk cloning failed")
logger("Disk cloning failed","error")
elif p[0]['provider'] == "aws":
logger("Cloning started","info")
print("****************Cloning awaiting*****************")
cloning_completed = await awsdisk.start_cloning(project,hostname)
if cloning_completed:
print("****************Cloning completed*****************")
logger("Cloning completed","info")
else:
print("Disk cloning failed")
logger("Disk cloning failed","error")
elif p[0]['provider'] == "gcp":
logger("Cloning started","info")
print("****************Cloning awaiting*****************")
cloning_completed = await gcpdisk.start_cloning(project,hostname)
if cloning_completed:
print("****************Cloning completed*****************")
logger("Cloning completed","info")
else:
print("Disk cloning failed")
logger("Disk cloning failed","error")
async def call_start_convert(project,hostname):
await asyncio.create_task(start_convert(project,hostname))
async def start_convert(project,hostname):
p = Project.objects(name=project)
if len(p) > 0:
if p[0]['provider'] == "azure":
logger("Download started","info")
print("****************Download started*****************")
image_downloaded = await disk.start_downloading(project)
print("****************Conversion awaiting*****************")
logger("Conversion started","info")
if image_downloaded:
converted = await disk.start_conversion(project,hostname)
if converted:
print("****************Conversion completed*****************")
logger("Disk Conversion completed","info")
else:
print("Disk Conversion failed")
logger("Disk Conversion failed","error")
elif p[0]['provider'] == "aws":
logger("Conversion started","info")
print("****************Conversion awaiting*****************")
logger("AMI creation started","info")
ami_created = await ami.start_ami_creation(project,hostname)
if ami_created:
print("****************Conversion completed*****************")
logger("Conversion completed","info")
logger("AMI creation completed:"+str(ami_created),"info")
else:
print("Disk Conversion failed")
logger("Disk Conversion failed","error")
elif p[0]['provider'] == "gcp":
logger("Download started","info")
print("****************Download started*****************")
image_downloaded = await gcpdisk.start_downloading(project,hostname)
print("****************Conversion awaiting*****************")
logger("Conversion started","info")
if image_downloaded:
converted = await gcpdisk.start_conversion(project,hostname)
if converted:
print("****************Conversion completed*****************")
logger("Disk Conversion completed","info")
else:
print("Disk Conversion failed")
logger("Disk Conversion failed","error")
async def call_build_network(project):
await asyncio.create_task(start_network_build(project))
# why we are not return anything from here?
async def start_network_build(project):
con = create_db_con()
p = Project.objects(name=project).allow_filtering()
if len(p) > 0:
if p[0]['provider'] == "azure":
logger("Network build started","info")
print("****************Network build awaiting*****************")
rg_created = await resource_group.create_rg(project)
if rg_created:
logger("Resource group created","info")
network_created = await network.create_nw(project)
if network_created:
logger("Network created","info")
else:
logger("Network creation failed","error")
else:
print("Resource group creation failed")
logger("Resource group creation failed","error")
elif p[0]['provider'] == "aws":
logger("Network creation started","info")
network_created = await awsnw.create_nw(project)
if network_created:
logger("Network creation completed","info")
else:
print("Network creation failed")
logger("Network creation failed","error")
elif p[0]['provider'] == "gcp":
logger("Network creation started","info")
network_created = await gcpnw.create_nw(project)
if network_created:
logger("Network creation completed","info")
else:
print("Network creation failed")
logger("Network creation failed","error")
async def call_build_host(project,hostname):
await asyncio.create_task(start_host_build(project,hostname))
async def start_host_build(project,hostname):
con = create_db_con()
p = Project.objects(name=project)
if len(p) > 0:
if p[0]['provider'] == "azure":
logger("Host build started","info")
print("****************Host build awaiting*****************")
disk_created = await disk.create_disk(project,hostname)
if disk_created:
vm_created = await compute.create_vm(project, hostname)
else:
logger("Disk creation failed","error")
elif p[0]['provider'] == "aws":
logger("ec2 creation started","info")
ec2_created = await ec2.build_ec2(project, hostname)
if ec2_created:
logger("ec2 creation completed","info")
else:
print("ec2 creation failed")
logger("ec2 creation failed","error")
elif p[0]['provider'] == "gcp":
logger("gcp vm creation started","info")
disk_created = await gcpdisk.start_image_creation(project, hostname)
if disk_created:
vm_created = await gcp_compute.build_compute(project, hostname)
if vm_created:
logger("gcp vm creation completed","info")
else:
print("gcp vm creation failed")
logger("gcp vm creation failed","error")
else:
print("gcp disk creation failed")
logger("gcp disk creation failed","error")
async def start_build(project):
con = create_db_con()
p = Project.objects(name=project)
if len(p) > 0:
if p[0]['provider'] == "azure":
logger("Cloning started","info")
print("****************Cloning awaiting*****************")
cloning_completed = await disk.start_cloning(project)
print("****************Cloning completed*****************")
logger("Cloning completed","info")
if cloning_completed:
image_downloaded = await disk.start_downloading(project)
if image_downloaded:
converted = await disk.start_conversion(project)
if converted:
image_uploaded = await disk.start_uploading(project)
if image_uploaded:
rg_created = await resource_group.create_rg(project)
if rg_created:
disk_created = await disk.create_disk(project)
if disk_created:
network_created = await network.create_nw(project)
if network_created:
vm_created = await compute.create_vm(project)
if vm_created:
print("VM created")
logger("VM created","info")
else:
print("VM creation failed")
logger("VM creation failed","info")
else:
print("Network creation failed")
logger("Network creation failed","info")
else:
print("Disk creation failed")
logger("Disk creation failed","info")
else:
print("Resource group creation failed")
logger("Resource group creation failed","info")
else:
print("Image uploading failed")
logger("Image uploading failed","info")
else:
print("Disk conversion failed")
logger("Disk conversion failed","info")
else:
print("Image downloading failed")
logger("Image downloading failed","info")
else:
print("Disk cloning failed")
logger("Disk cloning failed","info")
elif p[0]['provider'] == "aws":
logger("Cloning started","info")
print("****************Cloning awaiting*****************")
cloning_completed = await awsdisk.start_cloning(project)
print("****************Cloning completed*****************")
logger("Cloning completed","info")
if cloning_completed:
logger("AMI creation started","info")
ami_created = await ami.start_ami_creation(project)
logger("AMI creation completed:"+str(ami_created),"info")
if ami_created:
logger("Network creation started","info")
network_created = await awsnw.create_nw(project)
logger("Network creation completed","info")
if network_created:
logger("EC2 creation started","info")
ec2_created = await ec2.build_ec2(project)
logger("EC2 creation completed","info")
if ec2_created:
print("ec2 creation successfull")
else:
print("ec2 creation failed")
else:
print("Network creation failed")
else:
print("ami creation failed")
else:
print("Cloning failed")
else:
print("No such provider")
else:
print("No such project")
|
ivanaairenee/blog
|
node_modules/vision/test/index.js
|
<filename>node_modules/vision/test/index.js<gh_stars>10-100
// Load modules
var Path = require('path');
var Code = require('code');
var Handlebars = require('handlebars');
var Hapi = require('hapi');
var Hoek = require('hoek');
var Jade = require('jade');
var Lab = require('lab');
var Vision = require('..');
// Declare internals
var internals = {};
// Test shortcuts
var lab = exports.lab = Lab.script();
var describe = lab.describe;
var it = lab.it;
var expect = Code.expect;
describe('handler()', function () {
it('handles routes to views', function (done) {
var server = new Hapi.Server({ minimal: true });
server.connection();
server.register(Vision, Hoek.ignore);
server.views({
engines: { html: require('handlebars') },
path: __dirname + '/templates'
});
server.route({ method: 'GET', path: '/{param}', handler: { view: 'valid/handler' } });
server.inject({
method: 'GET',
url: '/hello'
}, function (res) {
expect(res.result).to.contain('hello');
done();
});
});
it('handles custom context', function (done) {
var server = new Hapi.Server({ minimal: true });
server.connection();
server.register(Vision, Hoek.ignore);
server.views({
engines: { jade: Jade },
path: __dirname + '/templates'
});
server.route({ method: 'GET', path: '/', handler: { view: { template: 'valid/index', context: { message: 'heyloo' } } } });
server.inject('/', function (res) {
expect(res.result).to.contain('heyloo');
done();
});
});
it('handles custom options', function (done) {
var server = new Hapi.Server({ minimal: true });
server.connection();
server.register(Vision, Hoek.ignore);
server.views({
engines: { html: require('handlebars') },
path: __dirname + '/templates',
layoutPath: __dirname + '/templates/layout'
});
server.route({ method: 'GET', path: '/', handler: { view: { template: 'valid/options', options: { layout: 'elsewhere' } } } });
server.inject('/', function (res) {
expect(res.result).to.contain('+hello');
done();
});
});
it('includes prerequisites in the default view context', function (done) {
var pre = function (request, reply) {
reply('PreHello');
};
var server = new Hapi.Server({ minimal: true });
server.connection();
server.register(Vision, Hoek.ignore);
server.views({
engines: { html: require('handlebars') },
path: __dirname + '/templates'
});
server.route({
method: 'GET',
path: '/',
config: {
pre: [
{ method: pre, assign: 'p' }
],
handler: {
view: 'valid/handler'
}
}
});
server.inject('/', function (res) {
expect(res.result).to.contain('PreHello');
done();
});
});
it('handles both custom and default contexts', function (done) {
var server = new Hapi.Server({ minimal: true });
server.connection();
server.register(Vision, Hoek.ignore);
server.views({
engines: { html: require('handlebars') },
path: __dirname + '/templates'
});
server.route({ method: 'GET', path: '/', handler: { view: { template: 'valid/testContext', context: { message: 'heyloo' } } } });
server.inject('/?test=yes', function (res) {
expect(res.result).to.contain('heyloo');
expect(res.result).to.contain('yes');
done();
});
});
it('overrides default contexts when provided with context of same name', function (done) {
var server = new Hapi.Server({ minimal: true });
server.connection();
server.register(Vision, Hoek.ignore);
server.views({
engines: { html: require('handlebars') },
path: __dirname + '/templates'
});
server.route({ method: 'GET', path: '/', handler: { view: { template: 'valid/testContext', context: { message: 'heyloo', query: { test: 'no' } } } } });
server.inject('/?test=yes', function (res) {
expect(res.result).to.contain('heyloo');
expect(res.result).to.contain('no');
done();
});
});
it('handles a global context', function (done) {
var server = new Hapi.Server({ minimal: true });
server.connection();
server.register(Vision, Hoek.ignore);
server.views({
engines: { html: require('handlebars') },
path: __dirname + '/templates',
context: {
message: 'default message'
}
});
server.route({ method: 'GET', path: '/', handler: { view: { template: 'valid/testContext' } } });
server.inject('/', function (res) {
expect(res.result).to.contain('<h1></h1>');
expect(res.result).to.contain('<h1>default message</h1>');
done();
});
});
it('overrides the global context with the default handler context', function (done) {
var server = new Hapi.Server({ minimal: true });
server.connection();
server.register(Vision, Hoek.ignore);
server.views({
engines: { html: require('handlebars') },
path: __dirname + '/templates',
context: {
message: 'default message',
query: {
test: 'global'
}
}
});
server.route({ method: 'GET', path: '/', handler: { view: { template: 'valid/testContext' } } });
server.inject('/?test=yes', function (res) {
expect(res.result).to.contain('<h1>yes</h1>');
expect(res.result).to.contain('<h1>default message</h1>');
done();
});
});
it('overrides the global and default contexts with a custom handler context', function (done) {
var server = new Hapi.Server({ minimal: true });
server.connection();
server.register(Vision, Hoek.ignore);
server.views({
engines: { html: require('handlebars') },
path: __dirname + '/templates',
context: {
message: 'default message',
query: {
test: 'global'
}
}
});
server.route({ method: 'GET', path: '/', handler: { view: { template: 'valid/testContext', context: { message: 'override', query: { test: 'no' } } } } });
server.inject('/?test=yes', function (res) {
expect(res.result).to.contain('<h1>no</h1>');
expect(res.result).to.contain('<h1>override</h1>');
done();
});
});
it('throws on missing views', function (done) {
var server = new Hapi.Server({ minimal: true, debug: false });
server.register(Vision, Hoek.ignore);
server.connection();
server.route({
path: '/',
method: 'GET',
handler: function (request, reply) {
return reply.view('test', { message: 'steve' });
}
});
server.inject('/', function (res) {
expect(res.statusCode).to.equal(500);
done();
});
});
});
describe('render()', function () {
it('renders view (root)', function (done) {
var server = new Hapi.Server({ minimal: true });
server.connection();
server.register(Vision, Hoek.ignore);
server.views({
engines: { html: Handlebars },
path: __dirname + '/templates/valid'
});
server.render('test', { title: 'test', message: 'Hapi' }, function (err, rendered, config) {
expect(rendered).to.exist();
expect(rendered).to.contain('Hapi');
done();
});
});
it('renders view (root with options)', function (done) {
var server = new Hapi.Server({ minimal: true });
server.connection();
server.register(Vision, Hoek.ignore);
server.views({
engines: { html: Handlebars }
});
server.render('test', { title: 'test', message: 'Hapi' }, { path: Path.join(__dirname, '/templates/valid') }, function (err, rendered, config) {
expect(rendered).to.exist();
expect(rendered).to.contain('Hapi');
done();
});
});
it('renders view (plugin)', function (done) {
var test = function (server, options, next) {
server.views({
engines: { 'html': Handlebars },
relativeTo: Path.join(__dirname, '/templates/plugin')
});
var view = server.render('test', { message: 'steve' }, function (err, rendered, config) {
server.route([
{
path: '/view', method: 'GET', handler: function (request, reply) {
return reply(rendered);
}
}
]);
return next();
});
};
test.attributes = {
name: 'test'
};
var server = new Hapi.Server({ minimal: true });
server.connection();
server.register(Vision, Hoek.ignore);
server.register(test, function (err) {
expect(err).to.not.exist();
server.inject('/view', function (res) {
expect(res.result).to.equal('<h1>steve</h1>');
done();
});
});
});
it('renders view (plugin without views)', function (done) {
var test = function (server, options, next) {
var view = server.render('test', { message: 'steve' }, function (err, rendered, config) {
server.route([
{
path: '/view', method: 'GET', handler: function (request, reply) {
return reply(rendered);
}
}
]);
return next();
});
};
test.attributes = {
name: 'test'
};
var server = new Hapi.Server({ minimal: true });
server.connection();
server.register(Vision, Hoek.ignore);
server.views({
engines: { 'html': Handlebars },
relativeTo: Path.join(__dirname, '/templates/plugin')
});
server.register(test, function (err) {
expect(err).to.not.exist();
server.inject('/view', function (res) {
expect(res.result).to.equal('<h1>steve</h1>');
done();
});
});
});
it('renders view (plugin with options)', function (done) {
var test = function (server, options, next) {
server.views({
engines: { 'html': Handlebars }
});
var view = server.render('test', { message: 'steve' }, { relativeTo: Path.join(__dirname, '/templates/plugin') }, function (err, rendered, config) {
server.route([
{
path: '/view', method: 'GET', handler: function (request, reply) {
return reply(rendered);
}
}
]);
return next();
});
};
test.attributes = {
name: 'test'
};
var server = new Hapi.Server({ minimal: true });
server.connection();
server.register(Vision, Hoek.ignore);
server.register(test, function (err) {
expect(err).to.not.exist();
server.inject('/view', function (res) {
expect(res.result).to.equal('<h1>steve</h1>');
done();
});
});
});
it('throws on missing views', function (done) {
var server = new Hapi.Server({ minimal: true });
server.register(Vision, Hoek.ignore);
expect(function () {
server.render('test');
}).to.throw('Missing views manager');
done();
});
});
describe('views()', function () {
it('requires plugin with views', function (done) {
var test = function (server, options, next) {
server.path(__dirname);
var views = {
engines: { 'html': Handlebars },
path: './templates/plugin'
};
server.views(views);
if (Object.keys(views).length !== 2) {
return next(new Error('plugin.view() modified options'));
}
server.route([
{
path: '/view', method: 'GET', handler: function (request, reply) {
return reply.view('test', { message: options.message });
}
}
]);
server.ext('onRequest', function (request, reply) {
if (request.path === '/ext') {
return reply.view('test', { message: 'grabbed' });
}
return reply.continue();
});
return next();
};
test.attributes = {
name: 'test'
};
var server = new Hapi.Server({ minimal: true });
server.connection();
server.register(Vision, Hoek.ignore);
server.register({ register: test, options: { message: 'viewing it' } }, function (err) {
expect(err).to.not.exist();
server.inject('/view', function (res) {
expect(res.result).to.equal('<h1>viewing it</h1>');
server.inject('/ext', function (res) {
expect(res.result).to.equal('<h1>grabbed</h1>');
done();
});
});
});
});
it('requires plugin with views with specific relativeTo', function (done) {
var test = function (server, options, next) {
server.views({
engines: { 'html': Handlebars },
relativeTo: Path.join(__dirname, '/templates/plugin')
});
server.route([
{
path: '/view', method: 'GET', handler: function (request, reply) {
return reply.view('test', { message: 'steve' });
}
}
]);
return next();
};
test.attributes = {
name: 'test'
};
var server = new Hapi.Server({ minimal: true });
server.connection();
server.register(Vision, Hoek.ignore);
server.register(test, function (err) {
expect(err).to.not.exist();
server.inject('/view', function (res) {
expect(res.result).to.equal('<h1>steve</h1>');
done();
});
});
});
it('defaults to server views', function (done) {
var test = function (server, options, next) {
server.route({
path: '/view',
method: 'GET',
handler: function (request, reply) {
return reply.view('test', { message: options.message });
}
});
return next();
};
test.attributes = {
name: 'test'
};
var server = new Hapi.Server({ minimal: true });
server.connection();
server.register(Vision, Hoek.ignore);
server.path(__dirname);
var views = {
engines: { 'html': Handlebars },
path: './templates/plugin'
};
server.views(views);
server.register({ register: test, options: { message: 'viewing it' } }, function (err) {
expect(err).to.not.exist();
server.inject('/view', function (res) {
expect(res.result).to.equal('<h1>viewing it</h1>');
done();
});
});
});
it('throws on multiple views', function (done) {
var server = new Hapi.Server({ minimal: true });
server.register(Vision, Hoek.ignore);
server.views({ engines: { 'html': Handlebars } });
expect(function () {
server.views({ engines: { 'html': Handlebars } });
}).to.throw('Cannot set views manager more than once');
done();
});
});
|
devzendo/mini-miser
|
src/test/java/org/devzendo/minimiser/startupqueue/TestStartupQueue.java
|
<filename>src/test/java/org/devzendo/minimiser/startupqueue/TestStartupQueue.java<gh_stars>0
/**
* Copyright (C) 2008-2010 <NAME>, DevZendo.org <http://devzendo.org>
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.devzendo.minimiser.startupqueue;
import java.util.List;
import org.devzendo.commonapp.util.OrderMonitor;
import org.devzendo.commoncode.logging.LoggingUnittestHelper;
import org.junit.Assert;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;
/**
* Tests the startup queue.
*
* @author matt
*
*/
public final class TestStartupQueue {
private StartupQueue startupQueue;
private OrderMonitor orderMonitor;
/**
*
*/
@BeforeClass
public static void setupLogging() {
LoggingUnittestHelper.setupLogging();
}
/**
*
*/
@Before
public void getPrerequisites() {
startupQueue = new StartupQueue();
}
/**
*
*/
@Test
public void addedTaskGetsExecutedOnExecuteQueue() {
orderMonitor = new OrderMonitor();
final Runnable one = new Runnable() {
public void run() {
orderMonitor.add("one");
}
};
startupQueue.addRunnable(one);
final Runnable two = new Runnable() {
public void run() {
orderMonitor.add("two");
}
};
startupQueue.addRunnable(two);
startupQueue.executeQueue();
startupQueue.join();
final List<String> ordering = orderMonitor.getOrdering();
Assert.assertEquals(2, ordering.size());
Assert.assertEquals("one", ordering.get(0));
Assert.assertEquals("two", ordering.get(1));
}
/**
*
*/
@Test(expected = IllegalArgumentException.class)
public void cantAddNull() {
startupQueue.addRunnable(null);
}
/**
*
*/
@Test
public void addedTaskRunsOnOwnQueue() {
final Thread testRunnerThread = Thread.currentThread();
final Thread[] runningThread = new Thread[] {null};
final Runnable one = new Runnable() {
public void run() {
runningThread[0] = Thread.currentThread();
}
};
startupQueue.addRunnable(one);
startupQueue.executeQueue();
startupQueue.join();
Assert.assertNotNull(runningThread[0]);
Assert.assertNotSame(testRunnerThread, runningThread[0]);
}
}
|
gepesz/tech-hub
|
ManchesterEJB/ejbModule/com/vh/manchester/ejb/User.java
|
package com.vh.manchester.ejb;
/**
* Local interface for Enterprise Bean: User
*/
public interface User extends javax.ejb.EJBLocalObject {
public boolean update(java.lang.String username, java.lang.String password, java.lang.String email, com.vh.manchester.ejb.UserType aUserType, com.vh.manchester.ejb.Locale aLocale);
public boolean updateLastProject(com.vh.manchester.ejb.Project aLastProject);
/**
* Get accessor for persistent attribute: id
*/
public abstract java.lang.Integer getId();
/**
* Get accessor for persistent attribute: username
*/
public java.lang.String getUsername();
/**
* Set accessor for persistent attribute: username
*/
public void setUsername(java.lang.String newUsername);
/**
* Get accessor for persistent attribute: password
*/
public java.lang.String getPassword();
/**
* Set accessor for persistent attribute: password
*/
public void setPassword(java.lang.String newPassword);
/**
* Get accessor for persistent attribute: email
*/
public java.lang.String getEmail();
/**
* Set accessor for persistent attribute: email
*/
public void setEmail(java.lang.String newEmail);
/**
* Get accessor for persistent attribute: lastLogin
*/
public java.sql.Timestamp getLastLogin();
/**
* Set accessor for persistent attribute: lastLogin
*/
public void setLastLogin(java.sql.Timestamp newLastLogin);
/**
* Get accessor for persistent attribute: nofLogins
*/
public int getNofLogins();
/**
* Set accessor for persistent attribute: nofLogins
*/
public void setNofLogins(int newNofLogins);
/**
* This method was generated for supporting the relationship role named locale.
* It will be deleted/edited when the relationship is deleted/edited.
*/
public com.vh.manchester.ejb.Locale getLocale();
/**
* This method was generated for supporting the relationship role named locale.
* It will be deleted/edited when the relationship is deleted/edited.
*/
public void setLocale(com.vh.manchester.ejb.Locale aLocale);
/**
* This method was generated for supporting the relationship role named userType.
* It will be deleted/edited when the relationship is deleted/edited.
*/
public com.vh.manchester.ejb.UserType getUserType();
/**
* This method was generated for supporting the relationship role named userType.
* It will be deleted/edited when the relationship is deleted/edited.
*/
public void setUserType(com.vh.manchester.ejb.UserType anUserType);
/**
* This method was generated for supporting the relationship role named assignedTasks.
* It will be deleted/edited when the relationship is deleted/edited.
*/
public java.util.Collection getAssignedTasks();
/**
* This method was generated for supporting the relationship role named assignedTasks.
* It will be deleted/edited when the relationship is deleted/edited.
*/
public void setAssignedTasks(java.util.Collection anAssignedTasks);
/**
* This method was generated for supporting the relationship role named createdTasks.
* It will be deleted/edited when the relationship is deleted/edited.
*/
public java.util.Collection getCreatedTasks();
/**
* This method was generated for supporting the relationship role named createdTasks.
* It will be deleted/edited when the relationship is deleted/edited.
*/
public void setCreatedTasks(java.util.Collection aCreatedTasks);
/**
* This method was generated for supporting the relationship role named projectAccess.
* It will be deleted/edited when the relationship is deleted/edited.
*/
public java.util.Collection getProjectAccess();
/**
* This method was generated for supporting the relationship role named projectAccess.
* It will be deleted/edited when the relationship is deleted/edited.
*/
public void setProjectAccess(java.util.Collection aProjectAccess);
/**
* This method was generated for supporting the relationship role named lastProject.
* It will be deleted/edited when the relationship is deleted/edited.
*/
public com.vh.manchester.ejb.Project getLastProject();
/**
* This method was generated for supporting the relationship role named lastProject.
* It will be deleted/edited when the relationship is deleted/edited.
*/
public void setLastProject(com.vh.manchester.ejb.Project aLastProject);
}
|
hong-gang/ermasterr
|
src/org/insightech/er/editor/view/dialog/option/tab/EnvironmentTabWrapper.java
|
package org.insightech.er.editor.view.dialog.option.tab;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.ModifyEvent;
import org.eclipse.swt.events.ModifyListener;
import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.List;
import org.eclipse.swt.widgets.TabFolder;
import org.eclipse.swt.widgets.Text;
import org.insightech.er.common.dialog.ValidatableTabWrapper;
import org.insightech.er.common.exception.InputException;
import org.insightech.er.common.widgets.CompositeFactory;
import org.insightech.er.editor.model.settings.Environment;
import org.insightech.er.editor.model.settings.Settings;
import org.insightech.er.editor.view.dialog.option.OptionSettingDialog;
import org.insightech.er.util.Check;
public class EnvironmentTabWrapper extends ValidatableTabWrapper {
private List environmentList;
private Text nameText;
private Button addButton;
private Button editButton;
private Button deleteButton;
private final Settings settings;
private static final int LIST_HEIGHT = 230;
public EnvironmentTabWrapper(final OptionSettingDialog dialog, final TabFolder parent, final Settings settings) {
super(dialog, parent, "label.tablespace.environment");
this.settings = settings;
}
@Override
protected void initLayout(final GridLayout layout) {
super.initLayout(layout);
layout.numColumns = 3;
}
@Override
public void initComposite() {
createEnvironmentGroup(this);
nameText = CompositeFactory.createText(null, this, null, 3, true, false);
addButton = CompositeFactory.createSmallButton(this, "label.button.add");
editButton = CompositeFactory.createSmallButton(this, "label.button.edit");
deleteButton = CompositeFactory.createSmallButton(this, "label.button.delete");
buttonEnabled(false);
addButton.setEnabled(false);
}
private void createEnvironmentGroup(final Composite parent) {
final GridData gridData = new GridData();
gridData.horizontalAlignment = GridData.FILL;
gridData.grabExcessHorizontalSpace = true;
gridData.horizontalSpan = 3;
gridData.heightHint = LIST_HEIGHT;
environmentList = new List(parent, SWT.BORDER | SWT.V_SCROLL);
environmentList.setLayoutData(gridData);
}
@Override
protected void addListener() {
environmentList.addSelectionListener(new SelectionAdapter() {
/**
* {@inheritDoc}
*/
@Override
public void widgetSelected(final SelectionEvent e) {
final int targetIndex = environmentList.getSelectionIndex();
if (targetIndex == -1) {
return;
}
final Environment environment = settings.getEnvironmentSetting().getEnvironments().get(targetIndex);
nameText.setText(environment.getName());
buttonEnabled(true);
}
});
addButton.addSelectionListener(new SelectionAdapter() {
/**
* {@inheritDoc}
*/
@Override
public void widgetSelected(final SelectionEvent e) {
final String name = nameText.getText().trim();
if (!Check.isEmpty(name)) {
settings.getEnvironmentSetting().getEnvironments().add(new Environment(name));
setData();
environmentList.select(environmentList.getItemCount() - 1);
}
}
});
editButton.addSelectionListener(new SelectionAdapter() {
/**
* {@inheritDoc}
*/
@Override
public void widgetSelected(final SelectionEvent e) {
final int targetIndex = environmentList.getSelectionIndex();
if (targetIndex == -1) {
return;
}
final String name = nameText.getText().trim();
if (!Check.isEmpty(name)) {
final Environment environment = settings.getEnvironmentSetting().getEnvironments().get(targetIndex);
environment.setName(name);
setData();
environmentList.select(targetIndex);
}
}
});
deleteButton.addSelectionListener(new SelectionAdapter() {
/**
* {@inheritDoc}
*/
@Override
public void widgetSelected(final SelectionEvent e) {
final int targetIndex = environmentList.getSelectionIndex();
if (targetIndex == -1) {
return;
}
settings.getEnvironmentSetting().getEnvironments().remove(targetIndex);
setData();
if (settings.getEnvironmentSetting().getEnvironments().size() > targetIndex) {
environmentList.select(targetIndex);
final Environment environment = settings.getEnvironmentSetting().getEnvironments().get(targetIndex);
nameText.setText(environment.getName());
} else {
nameText.setText("");
buttonEnabled(false);
}
}
});
nameText.addModifyListener(new ModifyListener() {
@Override
public void modifyText(final ModifyEvent e) {
final String name = nameText.getText().trim();
if (name.length() == 0) {
addButton.setEnabled(false);
editButton.setEnabled(false);
} else {
addButton.setEnabled(true);
if (environmentList.getSelectionIndex() != -1) {
editButton.setEnabled(true);
} else {
editButton.setEnabled(false);
}
}
}
});
}
private void buttonEnabled(boolean enabled) {
editButton.setEnabled(enabled);
if (environmentList.getItemCount() <= 1) {
enabled = false;
}
deleteButton.setEnabled(enabled);
}
/**
* {@inheritDoc}
*/
@Override
public void validatePage() throws InputException {}
@Override
public void setInitFocus() {
environmentList.setFocus();
}
/**
* {@inheritDoc}
*/
@Override
protected void setData() {
super.setData();
environmentList.removeAll();
for (final Environment environment : settings.getEnvironmentSetting().getEnvironments()) {
environmentList.add(environment.getName());
}
}
@Override
public void perfomeOK() {}
}
|
aas-core-works/aas-core-codegen
|
test_data/parse_retree/unexpected/invalid_quantifier/between_3_and_x/source.py
|
<filename>test_data/parse_retree/unexpected/invalid_quantifier/between_3_and_x/source.py
"a{3,x}"
|
MJUDreamTeam/Client
|
directMessage/ChatWindow.js
|
import React from 'react';
import {KeyboardAvoidingView,StyleSheet,View,FlatList} from 'react-native';
import {Input,Item,Button,Icon,Text,Container,Header,Left,Right,Body,Title,Thumbnail} from 'native-base';
import {createStackNavigator} from '@react-navigation/stack';
import {NavigationContainer} from '@react-navigation/native';
// 카메라 스크린 임포트
import DMCamera from './DMCamera';
// 말풍선 컴포넌트 임포트
import MessageBubble from './MessageBubble';
import MyMessageBubble from './MyMessageBubble';
// Input Text 임포트
import ChatInputText from './ChatInputText';
// Input Text Hook 임포트
import ChatInputTextHook from './ChatInputTextHook'
const myID = 'meohyun2';
const Messages = [
{
id:1,
body: "안녕하세요",
time: "4 minutes ago",
senderID: "강영우",
},
{
id:2,
body: "방감습니다",
time: "4 minutes ago",
senderID: "장세영",
},
{
id:3,
body: "행복하세요",
time: "4 minutes ago",
senderID: "이민환",
},
{
id:4,
body: "이히리기우구추~",
time: "4 minutes ago",
senderID: "조지",
}
]
class ChatWindow extends React.Component{
//state엔 일단 대화 내역만 담는다.
constructor(props){
super(props);
this.state={
messageObject:Messages
};
}
//대화내용을 state에 저장하여 전달하는 메서드가 필요
//상단 헤더바 버튼 Listner
_OnPressArrowButton=()=>{
this.props.navigation.goBack();
}
_OnPressSettingButton=()=>{
// Setting 하는 Component 로 navigate 시킴
alert('navigate setting');
}
//Button Listener 각각 하나씩, Camera Button, Send Button
_OnPressSendButton=(text)=>{
this.setMessage(text);
}
//FlatList render 해줄 함수
_renderItem = ({item}) => {
if (item.senderID === myID) {
return (
<View style={styles.MessageBubbleMyID}>
<MyMessageBubble
DialogText={item.body}
/>
</View>
);
}
return(
<View style={styles.MessageBubbleOther}>
<MessageBubble
DialogText={item.body}
/>
</View>
);
}
//State에 Message를 전달하는 함수
setMessage = (message) => {
this.setState((prevState) => {
// 기존의 스테이트에 새로운 메시지 객체 추가
const newObject = {
id : this.state.messageObject[this.state.messageObject.length-1].id+1,
body : message,
time : 'now',
senderID : myID,
}
const newMessage = [...prevState.messageObject,newObject];
return { messageObject : newMessage };
});
}
render(){
const name = this.props.navigation.params.item.name;
return (
<Container>
<Header style={styles.HeaderStyle}>
<Left>
<Button transparent style={styles.CameraButton} onPress={this._OnPressArrowButton}>
<Icon name='arrowleft' type='AntDesign' style={{color:'black'}} />
</Button>
</Left>
<Body style = {styles.BodyStyle}>
<Thumbnail style={{margin:10}} small source={{uri: 'https://dimg.donga.com/wps/NEWS/IMAGE/2019/09/24/97555811.2.jpg'}} />
<Title style={{color:'black'}}>{JSON.stringify(name).replace(/\"/gi,'')}</Title>
</Body>
<Right style={styles.RightStyle} >
<Button transparent onPress={this._OnPressSettingButton} >
<Icon name='ellipsis1' type='AntDesign' style={{color:'black'}} />
</Button>
</Right>
</Header>
<FlatList
data={this.state.messageObject}
keyExtractor={(item)=>item.id}
renderItem ={this._renderItem}
ref = "flatList"
onContentSizeChange={()=> this.refs.flatList.scrollToEnd()}
/>
<KeyboardAvoidingView>
<ChatInputTextHook onPressSendInChat={this._OnPressSendButton} style={styles.ChatInputStyle}/>
</KeyboardAvoidingView>
</Container>
);
}
}
const styles = StyleSheet.create({
RightStyle:{
flex:1,
alignItems:'flex-end',
},
BodyStyle:{
flexDirection:'row',
justifyContent:'center',
alignItems:'center'
},
HeaderStyle: {
backgroundColor : 'white',
justifyContent:'center',
alignItems:'center'
},
ChatView: {
justifyContent:'flex-end'
},
ChatViewStyle : {
flex:1,
flexDirection:'column',
justifyContent:'flex-end'
},
ChatInputStyle : {
flex:1
},
MessageBubbleOther:{
flex:1,
alignItems:'flex-start'
},
MessageBubbleMyID:{
flex:1,
alignItems: 'flex-end',
}
});
const Stack = createStackNavigator();
function ChatWindowNavigation() {
return(
<NavigationContainer>
<Stack.Navigator initialRouteName = "ChatWindow">
<Stack.Screen name = "ChatWindow" component ={ChatWindow}/>
<Stack.Screen name = "DMCamera" component ={DMCamera}/>
</Stack.Navigator>
</NavigationContainer>
);
}
export default ChatWindowNavigation;
|
bavison/opensmalltalk-vm
|
platforms/Cross/plugins/Mpeg3Plugin/libmpeg/timecode.h
|
<reponame>bavison/opensmalltalk-vm
#ifndef TIMECODE_H
#define TIMECODE_H
typedef struct
{
long hour;
long minute;
long second;
long frame;
} mpeg3_timecode_t;
#endif
|
moul/client
|
go/vendor/github.com/keybase/go-framed-msgpack-rpc/message.go
|
package rpc
import (
"errors"
)
type message struct {
method string
seqno int
res interface{}
err interface{}
remainingFields int
decodeSlots []interface{}
}
func decodeIntoMessage(dec decoder, m *message) error {
for _, s := range m.decodeSlots {
if err := decodeMessage(dec, m, s); err != nil {
return err
}
}
return nil
}
func decodeMessage(dec decoder, m *message, i interface{}) error {
err := dec.Decode(i)
// TODO need to verify whether codec.Decode pulls from the reader if
// the decode fails, or whether the reader stays in the same state
// as before the Decode
m.remainingFields--
return err
}
func decodeToNull(dec decoder, m *message) error {
var err error
for err == nil && m.remainingFields > 0 {
i := new(interface{})
err = decodeMessage(dec, m, i)
}
return err
}
func decodeError(dec decoder, m *message, f ErrorUnwrapper) (appErr error, dispatchErr error) {
if f != nil {
arg := f.MakeArg()
err := decodeMessage(dec, m, arg)
if err != nil {
return nil, err
}
return f.UnwrapError(arg)
}
var s string
if dispatchErr = decodeMessage(dec, m, &s); dispatchErr == nil && len(s) > 0 {
appErr = errors.New(s)
}
return appErr, dispatchErr
}
|
RotaNova/asmoboot
|
rotanava-boot-module/rotanava-boot-module-system/src/main/java/com/rotanava/boot/system/module/system/task/StatisticsTask.java
|
<filename>rotanava-boot-module/rotanava-boot-module-system/src/main/java/com/rotanava/boot/system/module/system/task/StatisticsTask.java<gh_stars>10-100
package com.rotanava.boot.system.module.system.task;
import cn.hutool.core.convert.Convert;
import cn.hutool.core.date.DateTime;
import cn.hutool.core.date.DateUnit;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.NumberUtil;
import com.google.common.collect.Lists;
import com.rotanava.boot.system.api.DataCockpitService;
import com.rotanava.boot.system.api.module.constant.LoginStatus;
import com.rotanava.boot.system.api.module.system.bo.UserLoginInfo;
import com.rotanava.boot.system.api.module.system.bo.VisitorBackup;
import com.rotanava.boot.system.api.module.system.vo.VisitorVolumeVO;
import com.rotanava.boot.system.module.dao.UserLoginInfoMapper;
import com.rotanava.boot.system.module.dao.VisitorBackupMapper;
import com.rotanava.boot.system.module.system.impl.DataCockpitServiceImpl;
import com.xxl.job.core.biz.model.ReturnT;
import com.xxl.job.core.handler.annotation.XxlJob;
import com.xxl.job.core.log.XxlJobLogger;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import java.math.BigDecimal;
import java.util.*;
import java.util.stream.Collectors;
import java.util.stream.LongStream;
/**
* 统计任务
*
* @author WeiQiangMiao
* @date 2021-04-06
*/
@Slf4j
@Component
public class StatisticsTask {
@Autowired
private DataCockpitService dataCockpitService;
@Autowired
private UserLoginInfoMapper userLoginInfoMapper;
@Autowired
private VisitorBackupMapper visitorBackupMapper;
@XxlJob(value = "timingStatistics")
public ReturnT<String> timingStatistics(String data) {
final DateTime dateTime = DateUtil.yesterday();
final DateTime minLoginTime = DateUtil.beginOfDay(dateTime);
final DateTime maxLoginTime = DateUtil.endOfDay(dateTime);
List<UserLoginInfo> userLoginInfos = userLoginInfoMapper.findByLoginStatusAndLoginTimeBetweenEqual(LoginStatus.SUCCESS.getStatus(), minLoginTime, maxLoginTime);
//查询访客量
Long count = userLoginInfos.stream().map(UserLoginInfo::getLoginUserId).distinct().count();
//查询某天平均使用时间
long todayAverageUsageTime = getAverageUsageTime(userLoginInfos);
long minUsageTime = getLongStream(userLoginInfos).min().orElse(0L);
long maxUsageTime = getLongStream(userLoginInfos).max().orElse(0L);
visitorBackupMapper.insert(new VisitorBackup( count, todayAverageUsageTime, minUsageTime, maxUsageTime, dateTime));
return ReturnT.SUCCESS;
}
private static LongStream getLongStream(List<UserLoginInfo> todayUserLoginInfos) {
return todayUserLoginInfos.stream().mapToLong(
info -> {
long endOfDay = DateUtil.endOfDay(info.getLoginTime()).getTime();
long offlineTime = info.getOfflineTime() == null ? Math.min(System.currentTimeMillis(), endOfDay) : Math.min(info.getOfflineTime().getTime(), endOfDay);
if( offlineTime < info.getLoginTime().getTime() ){ return 1; }
return BigDecimal.valueOf(NumberUtil.div(offlineTime - info.getLoginTime().getTime(), DateUnit.MINUTE.getMillis())
).setScale(0, BigDecimal.ROUND_CEILING).longValue();
}
);
}
public static long getAverageUsageTime(List<UserLoginInfo> todayUserLoginInfos) {
return BigDecimal.valueOf(getLongStream(todayUserLoginInfos).average().orElse(-0.1)).setScale(2, BigDecimal.ROUND_HALF_UP).longValue();
}
}
|
sandcast/bayes-scala
|
src/test/scala/dk/bayes/clustergraph/infer/LoopyBPGettingStarted.scala
|
<filename>src/test/scala/dk/bayes/clustergraph/infer/LoopyBPGettingStarted.scala
package dk.bayes.clustergraph.infer
import org.junit._
import org.junit.Assert._
import dk.bayes.clustergraph.GenericClusterGraph
import dk.bayes.clustergraph.testutil.AssertUtil._
import dk.bayes.clustergraph.factor.Var
import dk.bayes.clustergraph.factor.Factor
import dk.bayes.clustergraph.infer.LoopyBP
class LoopyBPGettingStarted {
//Create variables
val difficultyVar = Var(1, 2)
val intelliVar = Var(2, 2)
val gradeVar = Var(3, 3)
val satVar = Var(4, 2)
val letterVar = Var(5, 2)
//Create factors
val difficultyFactor = Factor(difficultyVar, Array(0.6, 0.4))
val intelliFactor = Factor(intelliVar, Array(0.7, 0.3))
val gradeFactor = Factor(intelliVar, difficultyVar, gradeVar, Array(0.3, 0.4, 0.3, 0.05, 0.25, 0.7, 0.9, 0.08, 0.02, 0.5, 0.3, 0.2))
val satFactor = Factor(intelliVar, satVar, Array(0.95, 0.05, 0.2, 0.8))
val letterFactor = Factor(gradeVar, letterVar, Array(0.1, 0.9, 0.4, 0.6, 0.99, 0.01))
//Create cluster graph
val clusterGraph = GenericClusterGraph()
clusterGraph.addCluster(1, difficultyFactor)
clusterGraph.addCluster(2, intelliFactor)
clusterGraph.addCluster(3, gradeFactor)
clusterGraph.addCluster(4, satFactor)
clusterGraph.addCluster(5, letterFactor)
//Add edges between clusters in a cluster graph
clusterGraph.addEdges((1, 3), (2, 3), (2, 4), (3, 5))
//Calibrate cluster graph
val loopyBP = LoopyBP(clusterGraph)
loopyBP.calibrate()
@Test def compute_marginal_for_grade_variable:Unit = {
//Get marginal for Grade variable
val gradeMarginal = loopyBP.marginal(gradeVar.id)
gradeMarginal.getVariables() // Var(3,3)
gradeMarginal.getValues() // List(0.3620, 0.2884, 0.3496)
assertFactor(Factor(Var(3, 3), Array(0.3620, 0.2884, 0.3496)), gradeMarginal, 0.0001)
}
@Test def compute_marginal_for_grade_variable_given_SAT_is_high:Unit = {
loopyBP.setEvidence(satVar.id, 0)
loopyBP.calibrate()
val gradeMarginal = loopyBP.marginal(gradeVar.id)
gradeMarginal.getVariables() // Var(3,3)
gradeMarginal.getValues() // List(0.2446, 0.3257, 0.4295)
assertFactor(Factor(Var(3, 3), Array(0.2446, 0.3257, 0.4295)), gradeMarginal, 0.0001)
}
}
|
Pikuseru/parsley-interpreter
|
src/parsley/commands/core/CoreCommandFactory.java
|
package parsley.commands.core;
import parsley.commands.Command;
import parsley.commands.CommandFactory;
import parsley.exceptions.*;
import parsley.lexing.*;
import java.util.*;
public class CoreCommandFactory implements CommandFactory {
private Hashtable commands;
public CoreCommandFactory() {
commands = new Hashtable();
commands.put("push", new PushCommand());
commands.put("save", new SaveCommand());
commands.put("echo", new EchoCommand());
commands.put("done", new DoneCommand());
commands.put("proc", new ProcCommand());
commands.put("call", new CallCommand());
commands.put("labl", new LablCommand());
commands.put("jump", new JumpCommand());
commands.put("jint", new JintCommand());
commands.put("halt", new HaltCommand());
commands.put("gush", new GushCommand());
commands.put("gave", new GaveCommand());
commands.put("add", new AddCommand());
commands.put("sub", new SubCommand());
commands.put("dup", new DupCommand());
commands.put("neg", new NegCommand());
commands.put("mul", new MulCommand());
commands.put("div", new DivCommand());
commands.put("mod", new ModCommand());
commands.put("eq", new EqCommand());
}
public Command createCommand(String commandString, Tokens tokens) throws UnknownCommandException {
if (commands.containsKey(commandString)) {
return ((Command) commands.get(commandString)).initWithTokens(tokens);
} else {
throw new UnknownCommandException(commandString);
}
}
}
|
amigarulez/scala-server-toolkit
|
http4s-client-monix-catnap/src/main/scala/com/avast/sst/http4s/client/monix/catnap/HttpStatusClassifier.scala
|
<filename>http4s-client-monix-catnap/src/main/scala/com/avast/sst/http4s/client/monix/catnap/HttpStatusClassifier.scala
package com.avast.sst.http4s.client.monix.catnap
import org.http4s.Status
/** Classifies HTTP status as failure or not - for the purpose of circuit breaking. */
trait HttpStatusClassifier {
def isServerFailure(status: Status): Boolean
}
object HttpStatusClassifier {
private val defaultFailureStatuses = fromSet(Set(Status.TooManyRequests))
lazy val default: HttpStatusClassifier = s => status5xx.isServerFailure(s) || defaultFailureStatuses.isServerFailure(s)
lazy val status5xx: HttpStatusClassifier = _.code >= 500
def fromSet(failureStatuses: Set[Status]): HttpStatusClassifier = failureStatuses(_)
}
|
rockchip-linux/mediaserver
|
src/flows/flow_common.h
|
// Copyright 2019 Fuzhou Rockchip Electronics Co., Ltd. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef _RK_FLOW_NODE_H_
#define _RK_FLOW_NODE_H_
#include <iterator>
#include <list>
#include <vector>
#include "key_string.h"
#include "media_type.h"
#include "logger/log.h"
namespace rockchip {
namespace mediaserver {
#define FLOWS_CONF "/usr/share/mediaserver/mediaserver.conf"
#define FLOWS_CONF_BAK "/data/mediaserver.bak"
#define NODE_PIPE_ID "Pipe_"
#define NODE_FLOW_ID "Flow_"
#define NODE_FLOW_INDEX "flow_index"
#define NODE_FLOW_INDEX_FLOW_TYPE "flow_type"
#define NODE_FLOW_INDEX_STREAM_ID "stream_id"
#define NODE_FLOW_INDEX_STREAM_TYPE "stream_type"
#define NODE_FLOW_INDEX_FLOW_INDEX_NAME "flow_index_name"
#define NODE_FLOW_INDEX_UPFLOW_INDEX_NAME "upflow_index_name"
#define NODE_FLOW_INDEX_OUT_SLOT_INDEX "out_slot_index"
#define NODE_FLOW_INDEX_IN_SLOT_INDEX "in_slot_index_of_down"
#define NODE_FLOW_INDEX_OPEN_PIEP_ID "actual_open_pipe_id"
#define NODE_FLOW_INDEX_OPEN_FLOW_ID "actual_open_flow_id"
#define NODE_FLOW_INDEX_FIX_RESO "fix_resolution"
#define NODE_FLOW_INDEX_AJUST_RESO "ajust_resolution"
#define NODE_FLOW_NAME "flow_name"
#define NODE_FLOW_PARAM "flow_param"
#define NODE_FLOW_PARAM_STREAM_NAME "name"
#define NODE_FLOW_PARAM_PORT_NUM KEY_PORT_NUM
#define NODE_FLOW_PARAM_KEY_EVENT_PATH "key_event_path"
#define NODE_FLOW_PARAM_KEY_EVENT_CODE "key_event_code"
#define NODE_STREAM_PARAM "stream_param"
#define NODE_STREAM_PARAM_DEVICE KEY_DEVICE
#define NODE_STREAM_PARAM_INPUT_DATA_TYPE KEY_INPUTDATATYPE
#define NODE_STREAM_PARAM_OUTPUT_DATA_TYPE KEY_OUTPUTDATATYPE
#define NODE_STREAM_PARAM_SAMPLE_FORMAT KEY_SAMPLE_FMT
#define NODE_STREAM_PARAM_NEED_HW_DRAW KEY_NEED_HW_DRAW
#define NODE_STREAM_PARAM_ROCKX_MODEL KEY_ROCKX_MODEL
/*video param node*/
#define NODE_STREAM_PARAM_GOP KEY_VIDEO_GOP
#define NODE_STREAM_PARAM_BITRATE_MAX KEY_COMPRESS_BITRATE_MAX
#define NODE_STREAM_PARAM_BITRATE_MIN KEY_COMPRESS_BITRATE_MIN
#define NODE_STREAM_PARAM_BITRATE KEY_COMPRESS_BITRATE
#define NODE_STREAM_PARAM_STREAMSMOOTH "no_define"
#define NODE_STREAM_PARAM_FRAMERATE KEY_FPS
#define NODE_STREAM_PARAM_FRAMERATE_IN KEY_FPS_IN
#define NODE_STREAM_PARAM_WIDTH KEY_BUFFER_WIDTH
#define NODE_STREAM_PARAM_HEIGHT KEY_BUFFER_HEIGHT
#define NODE_STREAM_PARAM_VIR_WIDTH KEY_BUFFER_VIR_WIDTH
#define NODE_STREAM_PARAM_VIR_HEIGHT KEY_BUFFER_VIR_HEIGHT
#define NODE_STREAM_PARAM_IMAGE_QUALITY_INIT KEY_COMPRESS_QP_INIT
#define NODE_STREAM_PARAM_IMAGE_QUALITY_STEP KEY_COMPRESS_QP_STEP
#define NODE_STREAM_PARAM_IMAGE_QUALITY_MIN KEY_COMPRESS_QP_MIN
#define NODE_STREAM_PARAM_IMAGE_QUALITY_MAX KEY_COMPRESS_QP_MAX
#define NODE_STREAM_PARAM_IMAGE_QUALITY_MIN_I_QP KEY_COMPRESS_QP_MIN_I
#define NODE_STREAM_PARAM_IMAGE_QUALITY_MAX_I_QP KEY_COMPRESS_QP_MAX_I
#define NODE_STREAM_PARAM_RC_MODE KEY_COMPRESS_RC_MODE
#define NODE_STREAM_PARAM_RC_QUALITY KEY_COMPRESS_RC_QUALITY
#define NODE_STREAM_PARAM_H264_PROFILE KEY_PROFILE
#define NODE_STREAM_PARAM_CODECTYPE KEY_CODECTYPE
#define NODE_STREAM_PARAM_SMART "smart"
#define NODE_STREAM_PARAM_SVC "no_define"
#define NODE_STREAM_PARAM_VIDEO_TYPE "no_define"
#define NODE_STREAM_ROI_REGIONS KEY_ROI_REGIONS
#define NODE_STREAM_RI_REGIONS "ri_regions"
#define NODE_STREAM_PARAM_ENABLE KEY_ENABLE
#define NODE_STREAM_PARAM_REG_ENABLE KEY_ENABLE_FACE_REG
#define NODE_STREAM_PARAM_INTERVAL KEY_FRAME_INTERVAL
#define NODE_STREAM_PARAM_DURATION KEY_BODY_DURATION
#define NODE_STREAM_PARAM_PERCENTAGE KEY_BODY_PERCENTAGE
#define NODE_STREAM_PARAM_SENSITIVITY "Sensitivity"
#define NODE_STREAM_PARAM_DETECT_RECT "detect_rect"
#define NODE_STREAM_PARAM_FULL_RANGE KEY_FULL_RANGE
/*move detection param node*/
#define NODE_STREAM_PARAM_MD_SINGLE_REF KEY_MD_SINGLE_REF
#define NODE_STREAM_PARAM_MD_ORI_WIDTH KEY_MD_ORI_WIDTH
#define NODE_STREAM_PARAM_MD_ORI_HEIGHT KEY_MD_ORI_HEIGHT
#define NODE_STREAM_PARAM_MD_DS_WIDTH KEY_MD_DS_WIDTH
#define NODE_STREAM_PARAM_MD_DS_HEIGHT KEY_MD_DS_HEIGHT
#define NODE_STREAM_PARAM_MD_ROI_CNT KEY_MD_ROI_CNT
#define NODE_STREAM_PARAM_MD_ROI_RECT KEY_MD_ROI_RECT
/*audio param node*/
#define NODE_STREAM_PARAM_CHANNEL KEY_CHANNELS
#define NODE_STREAM_PARAM_SAMPLE_RATE KEY_SAMPLE_RATE
#define NODE_STREAM_PARAM_VOLUME "no_define"
#define NODE_STREAM_PARAM_AUDIO_SOURCE "no_define"
#define NODE_STREAM_PARAM_ENCODE_TYPE "no_define"
#define NODE_STREAM_PARAM_ANS "no_define"
/*rga param node*/
#define NODE_STREAM_PARAM_RECT KEY_BUFFER_RECT
/*muxer param node*/
#define NODE_FLOW_PARAM_FILE_PATH KEY_PATH
#define NODE_FLOW_PARAM_FILE_PREFIX "file_prefix"
/*muxer -> rstp type */
#define RTSP_DATA_TYPE_MPEGTS MUXER_MPEG_TS
/*flow name*/
#define RKMEDIA_FLOW_NAME_LIVE555_RTSP "live555_rtsp_server"
/*stream name*/
#define RKMEDIA_STREAM_NAME_RKMPP "rkmpp"
/*filter name*/
#define RKMEDIA_FILTER_NAME_RGA "rkrga"
#define RKMEDIA_FILTER_NAME_THROUGH "through_guard"
#define RKMEDIA_FILTER_ROCKFACE_DETECT "rockface_detect"
#define RKMEDIA_FILTER_ROCKFACE_BODYDETECT "rockface_bodydetect"
#define RKMEDIA_FILTER_ROCKFACE_RECOGNIZE "rockface_recognize"
#define RKMEDIA_FILTER_DRAW_FILTER "draw_filter"
#define RKMEDIA_FILTER_ROCKX_FILTER "rockx_filter"
#define RKMEDIA_FILTER_NN_INPUT "nn_result_input"
#define RKMEDIA_FILTER_FACE_CAPTURE "face_capture"
#define DB_VALUE_LEVEL_HIGHEST "highest"
#define DB_VALUE_LEVEL_HIGHER "higher"
#define DB_VALUE_LEVEL_HIGH "high"
#define DB_VALUE_LEVEL_MEDIUM "medium"
#define DB_VALUE_LEVEL_LOW "low"
#define DB_VALUE_LEVEL_LOWER "lower"
#define DB_VALUE_LEVEL_LOWEST "lowest"
#define DB_VALUE_H264_BASELINE "baseline"
#define DB_VALUE_H264_MAIN "main"
#define DB_VALUE_H264_HIGH "high"
#define DB_RC_MODE_CBR "CBR"
#define DB_RC_MODE_VBR "VBR"
#define DB_ENCORDE_TYPE_H264 "H.264"
#define DB_ENCORDE_TYPE_H265 "H.265"
#define DB_ENCORDE_TYPE_MJPEG "MJPEG"
#define DB_ENCORDE_TYPE_MPEG4 "MPEG4"
#define DB_SMART_VALUE_OPEN "open"
#define DB_SMART_VALUE_CLOSE "close"
#define DB_SMART_ENABLE "1"
#define DB_SMART_DISABLE "0"
#define PARAM_STRING_APPEND2(s, s1, s2) \
s.append(s1).append("=").append(s2).append("\n")
enum class FlowType { UNKNOW, SOURCE, IO, SINK };
enum class StreamType {
UNKNOW,
CAMERA,
VIDEO_ENCODER,
VIDEO_DECODER,
JPEG_THROUGH_GUARD,
JPEG_ENCODER,
JPEG_DECODER,
FILE,
AUDIO,
AUDIO_ENCODER,
RTSP,
LINK,
FILTER,
MUXER,
MOVE_DETEC,
GENERAL
};
#define MAX_CAM_NUM 4
#define MAX_SOUND_NUM 3
#define MAX_OSD_REGION_NUM 15
#define ROI_REGION_NUM 4
#define WEB_VIEW_RECT_W 704
#define WEB_VIEW_RECT_H 480
#define MAX_DAY_SCHEDULE_NUM 8
enum class StreamId {
MAIN_STREAM = 0,
SUB_STREAM,
THIRD_STREAM,
FOURTH_STREAM,
};
enum class VideoStreamType { UNKNOW, VIDEO_STREAM, VIDEO_COMPOSITE_STREAM };
typedef std::pair<std::string, std::string> prop_p;
typedef std::vector<std::pair<std::string, std::string>> props_v;
} // namespace mediaserver
} // namespace rockchip
#endif
|
Mazdallier/NuclearCraft
|
src/main/java/nc/block/fluid/BlockFluidCorium.java
|
<gh_stars>1-10
package nc.block.fluid;
import java.util.Random;
import javax.annotation.Nonnull;
import nc.capability.radiation.source.IRadiationSource;
import nc.fluid.FluidCorium;
import nc.radiation.*;
import nc.util.DamageSources;
import net.minecraft.block.state.IBlockState;
import net.minecraft.entity.Entity;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;
import net.minecraft.world.chunk.Chunk;
public class BlockFluidCorium extends BlockFluidFission {
public BlockFluidCorium(FluidCorium fluid) {
super(fluid);
}
@Override
public void onEntityCollision(World worldIn, BlockPos pos, IBlockState state, Entity entityIn) {
entityIn.attackEntityFrom(DamageSources.CORIUM_BURN, 4F);
super.onEntityCollision(worldIn, pos, state, entityIn);
}
@Override
public void updateTick(@Nonnull World world, @Nonnull BlockPos pos, @Nonnull IBlockState state, @Nonnull Random rand) {
Chunk chunk = world.getChunk(pos);
if (chunk.isLoaded()) {
IRadiationSource chunkSource = RadiationHelper.getRadiationSource(chunk);
if (chunkSource != null) {
RadiationHelper.addToSourceRadiation(chunkSource, RadSources.CORIUM * getQuantaValue(world, pos));
}
}
super.updateTick(world, pos, state, rand);
}
}
|
g-parki/bokeh
|
examples/plotting/file/markers.py
|
<reponame>g-parki/bokeh
''' A scatter plot showing every marker type.
.. bokeh-example-metadata::
:apis: bokeh.plotting.Figure.scatter, bokeh.plotting.Figure.text
:refs: :ref:`userguide_plotting` > :ref:`userguide_plotting_scatter_markers`
:keywords: scatter, markers
'''
from numpy.random import random
from bokeh.core.enums import MarkerType
from bokeh.plotting import figure, show
p = figure(title="Bokeh Markers", toolbar_location=None, output_backend="webgl")
p.grid.grid_line_color = None
p.background_fill_color = "#eeeeee"
p.axis.visible = False
p.y_range.flipped = True
N = 10
for i, marker in enumerate(MarkerType):
x = i % 4
y = (i // 4) * 4 + 1
p.scatter(random(N)+2*x, random(N)+y, marker=marker, size=14,
line_color="navy", fill_color="orange", alpha=0.5)
p.text(2*x+0.5, y+2.5, text=[marker],
text_color="firebrick", text_align="center", text_font_size="13px")
show(p)
|
jinlongchen/golang-utilities
|
baidu/face_set_user_add.go
|
<gh_stars>1-10
package baidu
import (
"encoding/base64"
"github.com/jinlongchen/golang-utilities/http"
"github.com/jinlongchen/golang-utilities/json"
"net/url"
)
type FaceSetUserAddRequest struct {
Image string `json:"image,omitempty"`
ImageType string `json:"image_type,omitempty"`
GroupID string `json:"group_id,omitempty"`
UserID string `json:"user_id,omitempty"`
UserInfo string `json:"user_info,omitempty"`
QualityControl string `json:"quality_control,omitempty"`
LivenessControl string `json:"liveness_control,omitempty"`
}
type FaceSetUserAddResponse struct {
ErrorCode int `json:"error_code" xml:"error_code"`
ErrorMsg string `json:"error_msg" xml:"error_msg"`
LogID uint64 `json:"log_id"`
FaceToken string `json:"face_token"`
Location struct {
Left int `json:"left"`
Top int `json:"top"`
Width int `json:"width"`
Height int `json:"height"`
Rotation int `json:"rotation"`
} `json:"location"`
}
func (bd *Baidu) FaceSetUserAdd(
userGroupId, userId string,
userInfo string,
imageData []byte,
appId, appSecret string) (*FaceSetUserAddResponse, error) {
accessToken, err := bd.GetAccessTokenBceByClient(appId, appSecret)
if err != nil {
bd.logf("cannot get access token(%v): %v", appId, err.Error())
return nil, err
}
bdReqURL, _ := url.Parse(`https://aip.baidubce.com/rest/2.0/face/v3/faceset/user/add`)
bdReqQuery := bdReqURL.Query()
bdReqQuery.Set("access_token", accessToken.AccessToken)
bdReqURL.RawQuery = bdReqQuery.Encode()
req := &FaceSetUserAddRequest{
Image: base64.StdEncoding.EncodeToString(imageData),
ImageType: "BASE64",
GroupID: userGroupId,
UserID: userId,
UserInfo: userInfo,
//QualityControl: "NORMAL",
//LivenessControl: "NORMAL",
}
bdRespData, err := http.PostData(bdReqURL.String(),
http.MIMEApplicationJSONCharsetUTF8,
json.ShouldMarshal(req),
)
if err != nil {
bd.logf("bd err: %v", err)
return nil, err
}
bdResp := &FaceSetUserAddResponse{}
err = json.Unmarshal(bdRespData, bdResp)
if err != nil {
bd.logf("bd err: %v", err)
return nil, err
}
return bdResp, nil
}
|
jedhsu/music
|
music/class_/audioa/f/base/minor.py
|
"""
*F Minor*
The key of F minor.
"""
from ..._mode import MinorKey
from ....scale import Diatonic
from ._key import F_Key
__all__ = ["F_Minor"]
class F_Minor(
F_Key,
MinorKey,
Diatonic,
):
pass
|
AssassinKO/Laravel-React-Demo
|
resources/js/src/routes/Components/CorematComponents/NotificationsDemo/DemoSettings.js
|
<reponame>AssassinKO/Laravel-React-Demo
import React, { useContext } from 'react';
import CorematContext from '../../../../@jumbo/components/contextProvider/CorematContext';
import { CollapsibleSection, SectionLegend, SettingsComponent } from '../../../../@jumbo/components/CorematDemosComponents';
import AppSwitch from '../../../../@jumbo/components/Common/formElements/AppSwitch';
const DemoSettings = () => {
const { showExtraMedia, setExtraMediaVisibility, showFooter, setFooterVisibility, loadMore, setLoadMore } = useContext(
CorematContext,
);
return (
<SettingsComponent title="Cmt Notifications">
<CollapsibleSection heading="Settings" open>
<SectionLegend displayAsColumn>
<AppSwitch
label="Show Extra Media"
checked={showExtraMedia}
onChange={event => setExtraMediaVisibility(event.target.checked)}
/>
<AppSwitch
label="Show Footer"
checked={showFooter}
onChange={event => setFooterVisibility(event.target.checked)}
/>
<AppSwitch
label="Show Loading more content"
checked={loadMore}
onChange={event => setLoadMore(event.target.checked)}
/>
</SectionLegend>
</CollapsibleSection>
</SettingsComponent>
);
};
export default DemoSettings;
|
gkzscs/CuteBoard
|
ui/element_editors/curves_xy_patron_editor.cpp
|
#include "curves_xy_patron_editor.h"
#include "ui_curves_xy_patron_editor.h"
CurvesXYPatronEditor::CurvesXYPatronEditor(QWidget *parent) :
QWidget(parent),
ui(new Ui::CurvesXYPatronEditor)
{
ui->setupUi(this);
ui->colorLineEdit->setEnabled(false);
}
CurvesXYPatronEditor::~CurvesXYPatronEditor()
{
delete ui;
}
void CurvesXYPatronEditor::on_importPushButton_clicked()
{
}
void CurvesXYPatronEditor::on_exportPushButton_clicked()
{
}
bool CurvesXYPatronEditor::checkName()
{
if(ui->nameLineEdit->text().isEmpty())
return false;
else
return true;
}
void CurvesXYPatronEditor::loadPatron(QSharedPointer<QTBCurvePatronConfiguration> patron)
{
mPatron = patron;
ui->nameLineEdit->setText(patron->name());
ui->colorLineEdit->setColor(patron->color());
ui->lineStyleComboBox->setCurrentIndex(int(patron->penStyle())-1);
QList<double> x,y;
x = patron->xValues();
y= patron->yValues();
ui->tableWidget->clearContents();
for(int i=0; i< x.count();i++) {
QTableWidgetItem *itemX = new QTableWidgetItem(QString::number(x.at(i)));
QTableWidgetItem *itemY = new QTableWidgetItem(QString::number(y.at(i)));
ui->tableWidget->setItem(i,0,itemX);
ui->tableWidget->setItem(i,1,itemY);
}
}
QSharedPointer<QTBCurvePatronConfiguration> CurvesXYPatronEditor::createPatron()
{
QSharedPointer<QTBCurvePatronConfiguration> patron(new QTBCurvePatronConfiguration());
patron->setName(ui->nameLineEdit->text());
patron->setColor(ui->colorLineEdit->color());
patron->setPenStyle(Qt::PenStyle(ui->lineStyleComboBox->currentIndex() + 1));
for(int i=0; i< ui->tableWidget->rowCount();i++) {
double x,y;
bool xOk=false, yOk=false;
if(ui->tableWidget->item(i,0))
x = ui->tableWidget->item(i,0)->text().toDouble(&xOk);
if(ui->tableWidget->item(i,1))
y = ui->tableWidget->item(i,1)->text().toDouble(&yOk);
if(xOk && yOk)
patron->addPoint(x,y);
}
return patron;
}
void CurvesXYPatronEditor::updatePatron()
{
mPatron->setName(ui->nameLineEdit->text());
mPatron->setColor(ui->colorLineEdit->color());
mPatron->setPenStyle(Qt::PenStyle(ui->lineStyleComboBox->currentIndex() + 1));
mPatron->clearPoints();
for(int i=0; i< ui->tableWidget->rowCount();i++) {
double x,y;
bool xOk=false, yOk=false;
if(ui->tableWidget->item(i,0))
x = ui->tableWidget->item(i,0)->text().toDouble(&xOk);
if(ui->tableWidget->item(i,1))
y = ui->tableWidget->item(i,1)->text().toDouble(&yOk);
if(xOk && yOk)
mPatron->addPoint(x,y);
}
}
void CurvesXYPatronEditor::on_colorPushButton_clicked()
{
QColor color = QColorDialog::getColor(ui->colorLineEdit->color());
if(color.isValid()) {
ui->colorLineEdit->setColor(color);
}
}
|
legumeinfo/intermine
|
bio/core/src/test/java/org/intermine/bio/dataconversion/GFF3RecordTest.java
|
package org.intermine.bio.dataconversion;
import java.io.IOException;
import java.util.Arrays;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import junit.framework.TestCase;
import org.intermine.bio.io.gff3.GFF3Record;
/*
* Copyright (C) 2002-2022 FlyMine
*
* This code may be freely distributed and modified under the
* terms of the GNU Lesser General Public Licence. This should
* be distributed with the code. See the LICENSE file for more
* information or http://www.gnu.org/copyleft/lesser.html.
*
*/
/**
* Tests for GFF3Record
*
* @author <NAME>
*/
public class GFF3RecordTest extends TestCase
{
public void testParse() throws Exception {
String gff =
"1\tfirstEF\tpromoter\t5\t100\t1000\t+\t.\tname1=value1,value2;ID=id%3Btest;name2=value2;name3=%26ggr%3B";
GFF3Record gff3Record = new GFF3Record(gff);
assertEquals("1", gff3Record.getSequenceID());
assertEquals("firstEF", gff3Record.getSource());
assertEquals("promoter", gff3Record.getType());
assertEquals(5, gff3Record.getStart());
assertEquals(100, gff3Record.getEnd());
assertEquals(new Double(1000.0), gff3Record.getScore());
assertEquals("+", gff3Record.getStrand());
assertNull(gff3Record.getPhase());
assertEquals("id;test", gff3Record.getId());
Map expectedAttributes = new LinkedHashMap();
expectedAttributes.put("name1", Arrays.asList(new Object[]{"value1", "value2"}));
expectedAttributes.put("ID", Arrays.asList(new Object[] {"id;test"}));
expectedAttributes.put("name2", Arrays.asList(new Object[] {"value2"}));
expectedAttributes.put("name3", Arrays.asList(new Object[] {"γ"}));
assertEquals(expectedAttributes, gff3Record.getAttributes());
}
/**
* Test that we throw an exception if an attribute contains an unescaped semicolon (FlyBase was
* doing this for a while)
*/
public void testSemiColonInAttr() throws Exception {
String gff =
"1\tfirstEF\tpromoter\t5\t100\t1000\t+\t.\tID=id;test";
try {
GFF3Record gff3Record = new GFF3Record(gff);
gff3Record.toString(); // avoid eclipse warning
fail("expected an IOException");
} catch (IOException e) {
// expected
}
}
public void testToString() throws Exception {
String gff =
"X\t.\tgene\t21115389\t21115496\t.\t+\t.\tID=CR32525;Dbxref=FlyBase:FBan0032525,FlyBase:FBgn0052525;cyto_range=19F3-19F3;dbxref_2nd=FlyBase:FBgn0012015,FlyBase:FBgn0060008;gbunit=AE003568;synonym=CR32525;synonym_2nd=AE002620.trna4-TyrGTA,CG32525,tRNA:tyr1:19F,tRNA%3Cup%3ETyr%3C%2Fup%3E%3Cdown%3E1%26gamma%3B%3C%2Fdown%3E,tRNA:Y1:19F,tRNA:Y:GTA:AE002620-b";
GFF3Record gff3Record = new GFF3Record(gff);
List synonym2ndList = (List) gff3Record.getAttributes().get("synonym_2nd");
assertEquals("tRNA<up>Tyr</up><down>1γ</down>", synonym2ndList.get(3));
assertEquals(gff, gff3Record.toGFF3());
}
/**
* Test URL encoding of sequence ID
*/
public void testToString2() throws Exception {
String gff =
"X%26gamma%3BY\t.\tgene\t21115389\t21115496\t.\t+\t.\tID=CR32525";
GFF3Record gff3Record = new GFF3Record(gff);
assertEquals("XγY", gff3Record.getSequenceID());
}
}
|
zealoussnow/chromium
|
components/metrics/android_metrics_provider.cc
|
// Copyright 2019 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "components/metrics/android_metrics_provider.h"
#include "base/metrics/histogram_macros.h"
#include "base/system/sys_info.h"
namespace metrics {
namespace {
void EmitLowRamDeviceHistogram() {
// Equivalent to UMA_HISTOGRAM_BOOLEAN with the stability flag set.
UMA_STABILITY_HISTOGRAM_ENUMERATION(
"MemoryAndroid.LowRamDevice", base::SysInfo::IsLowEndDevice() ? 1 : 0, 2);
}
} // namespace
AndroidMetricsProvider::AndroidMetricsProvider() {}
AndroidMetricsProvider::~AndroidMetricsProvider() {}
void AndroidMetricsProvider::ProvidePreviousSessionData(
metrics::ChromeUserMetricsExtension* uma_proto) {
// The low-ram device status is unlikely to change between browser restarts.
// Hence, it's safe and useful to attach this status to a previous session
// log.
EmitLowRamDeviceHistogram();
}
void AndroidMetricsProvider::ProvideCurrentSessionData(
metrics::ChromeUserMetricsExtension* uma_proto) {
EmitLowRamDeviceHistogram();
}
} // namespace metrics
|
miszczu1902/Sudoku
|
Model/src/main/java/pl/first/firstjava/model/SudokuObserver.java
|
package pl.first.firstjava.model;
import java.io.Serializable;
public interface SudokuObserver extends Serializable {
void update();
}
|
hYdos/TinkersConstruct
|
src/main/java/slimeknights/tconstruct/tools/modifiers/upgrades/LightspeedModifier.java
|
package slimeknights.tconstruct.tools.modifiers.upgrades;
import net.minecraft.core.BlockPos;
import net.minecraft.core.Direction;
import net.minecraft.world.level.LightLayer;
import net.minecraftforge.event.entity.player.PlayerEvent.BreakSpeed;
import slimeknights.tconstruct.library.modifiers.IncrementalModifier;
import slimeknights.tconstruct.library.tools.nbt.IModifierToolStack;
import slimeknights.tconstruct.library.tools.stat.ToolStats;
public class LightspeedModifier extends IncrementalModifier {
public LightspeedModifier() {
super(0xFFBC5E);
}
@Override
public int getPriority() {
return 125; // run before trait boosts such as dwarven
}
@Override
public void onBreakSpeed(IModifierToolStack tool, int level, BreakSpeed event, Direction sideHit, boolean isEffective, float miningSpeedModifier) {
if (!isEffective) {
return;
}
BlockPos pos = event.getPos();
if (pos != null) {
int light = event.getPlayer().getCommandSenderWorld().getBrightness(LightLayer.BLOCK, pos.relative(sideHit));
// bonus is +9 mining speed at light level 15, +3 at light level 10, +1 at light level 5
float boost = (float)(level * Math.pow(3, (light - 5) / 5f) * tool.getDefinition().getBaseStatDefinition().getModifier(ToolStats.MINING_SPEED) * miningSpeedModifier);
event.setNewSpeed(event.getNewSpeed() + boost);
}
}
}
|
febiosoftware/FEBioStudio
|
FEBioStudio/modelcheck.cpp
|
<reponame>febiosoftware/FEBioStudio<filename>FEBioStudio/modelcheck.cpp
/*This file is part of the FEBio Studio source code and is licensed under the MIT license
listed below.
See Copyright-FEBio-Studio.txt for details.
Copyright (c) 2020 University of Utah, The Trustees of Columbia University in
the City of New York, and others.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.*/
#include "stdafx.h"
#include "modelcheck.h"
#include <MeshTools/FEProject.h>
#include <PostGL/GLModel.h>
#include <GeomLib/GObject.h>
#include <FEMLib/FEMaterial.h>
#include <FEMLib/FERigidConstraint.h>
#include <FEMLib/FEBodyLoad.h>
#include <MeshTools/GModel.h>
#include <stdarg.h>
#include <sstream>
using std::stringstream;
// are there any objects?
void check_000(FEProject& prj, std::vector<FSObject*>& objList);
// are all geometries meshed?
void check_001(FEProject& prj, std::vector<FSObject*>& objList);
// are there any materials
void check_002(FEProject& prj, std::vector<FSObject*>& objList);
// is a material assigned to all parts ?
void check_003(FEProject& prj, std::vector<FSObject*>& objList);
// Are there any analysis steps?
void check_004(FEProject& prj, std::vector<FSObject*>& objList);
// check for unused materials
void check_005(FEProject& prj, std::vector<FSObject*>& objList);
// check for unconstrained rigid bodies
void check_006(FEProject& prj, std::vector<FSObject*>& objList);
// see if surfaces of solo interfaces are assigned.
void check_007(FEProject& prj, std::vector<FSObject*>& objList);
// see if surfaces of paired interfaces are assigned.
void check_008(FEProject& prj, std::vector<FSObject*>& objList);
// see if loads have assigned selections.
void check_009(FEProject& prj, std::vector<FSObject*>& objList);
// see if BCs have assigned selections.
void check_010(FEProject& prj, std::vector<FSObject*>& objList);
// see if ICs have assigned selections.
void check_011(FEProject& prj, std::vector<FSObject*>& objList);
// see if there are any output variables defined
void check_012(FEProject& prj, std::vector<FSObject*>& objList);
// see if shell thickness are zero for non-rigid parts
void check_013(FEProject& prj, std::vector<FSObject*>& objList);
// do rigid connectors have two different rigid bodies
void check_014(FEProject& prj, std::vector<FSObject*>& objList);
// do rigid connectors have two rigid bodies defined
void check_015(FEProject& prj, std::vector<FSObject*>& objList);
// check if a rigid interface was assigned a rigid body
void check_016(FEProject& prj, std::vector<FSObject*>& objList);
// check if parts have duplicate names
void check_017(FEProject& prj, std::vector<FSObject*>& objList);
typedef void(*ERROR_FUNC)(FEProject&, std::vector<FSObject*>&);
struct ERROR_DATA
{
ERROR_TYPE errType;
const char* errStr;
ERROR_FUNC errFnc;
};
vector<ERROR_DATA> error = {
{ CRITICAL, "This model does not contain any geometry.", check_000},
{ CRITICAL, "The object \"%s\" is not meshed." , check_001 },
{ CRITICAL, "There are no materials defined in this model.", check_002 },
{ CRITICAL, "Part \"%s\" does not have a material assigned.", check_003 },
{ CRITICAL, "There are no analysis steps defined.", check_004 },
{ WARNING , "Material \"%s\" is not assigned to any parts.", check_005 },
{ WARNING , "Rigid body \"%s\" might be underconstrained.", check_006 },
{ CRITICAL, "No selection was assigned to interface \"%s\".", check_007 },
{ CRITICAL, "One or both of the selections of interface \"%s\" is unassigned.", check_008 },
{ CRITICAL, "Load \"%s\" has no selection assigned.", check_009 },
{ CRITICAL, "Boundary condition \"%s\" has no selection assigned.", check_010 },
{ CRITICAL, "Initial condition \"%s\" has no selection assigned.", check_011 },
{ WARNING , "This model does not define any output variables.", check_012 },
{ CRITICAL, "Some shells in part \"%s\" have zero thickness.", check_013 },
{ WARNING , "Rigid connector \"%s\" connects the same rigid body.", check_014 },
{ CRITICAL, "Rigid connector \"%s\" does not connect two rigid bodies.", check_015 },
{ CRITICAL, "A rigid body was not assigned to rigid interface \"%s\".", check_016 },
{ WARNING , "Some parts have the same name. \"%s\".", check_017 }
};
const char* errorString(int error_code)
{
if (error_code >= error.size())
{
assert(false);
return "undefined error";
}
else return error[error_code].errStr;
}
MODEL_ERROR make_error(int error_code, FSObject* po = nullptr)
{
// make the message
char sztxt[1024] = { 0 };
if (po)
{
string s = po->GetName();
if (dynamic_cast<GPart*>(po))
{
GPart* pg = dynamic_cast<GPart*>(po);
GBaseObject* o = pg->Object();
if (o)
{
stringstream ss;
ss << po->GetName() + " (" + o->GetName() + ")";
s = ss.str();
}
}
sprintf(sztxt, error[error_code].errStr, s.c_str());
}
else
sprintf(sztxt, error[error_code].errStr, "(null)");
MODEL_ERROR err;
err.first = error[error_code].errType;
err.second = string(sztxt);
return err;
}
void checkModel(FEProject& prj, std::vector<MODEL_ERROR>& errorList)
{
for (size_t i = 0; i < error.size(); ++i)
{
vector<FSObject*> objList;
error[i].errFnc(prj, objList);
for (size_t j = 0; j < objList.size(); ++j)
{
errorList.push_back(make_error(i, objList[j]));
}
}
}
void check_000(FEProject& prj, std::vector<FSObject*>& objList)
{
// are there any objects?
GModel& mdl = prj.GetFEModel().GetModel();
if (mdl.Objects() == 0)
{
objList.push_back(&mdl);
}
}
void check_001(FEProject& prj, std::vector<FSObject*>& objList)
{
GModel& mdl = prj.GetFEModel().GetModel();
for (int i = 0; i < mdl.Objects(); ++i)
{
GObject* po = mdl.Object(i);
if (po->GetFEMesh() == nullptr)
{
objList.push_back(po);
}
}
}
void check_002(FEProject& prj, std::vector<FSObject*>& objList)
{
FEModel& fem = prj.GetFEModel();
if (fem.Materials() == 0)
{
objList.push_back(&fem);
}
}
void check_003(FEProject& prj, std::vector<FSObject*>& objList)
{
FEModel& fem = prj.GetFEModel();
// build a material lookup table
int minId, maxId;
for (int i = 0; i < fem.Materials(); ++i)
{
GMaterial* gm = fem.GetMaterial(i); assert(gm);
if (gm)
{
int matId = gm->GetID();
if ((i == 0) || (matId < minId)) minId = matId;
if ((i == 0) || (matId > maxId)) maxId = matId;
}
}
int mats = maxId - minId + 1;
vector<int> lut(mats, -1);
for (int i = 0; i < fem.Materials(); ++i)
{
GMaterial* gm = fem.GetMaterial(i); assert(gm);
if (gm)
{
int matId = gm->GetID() - minId;
assert(matId < mats);
if (matId < mats)
{
assert(lut[matId] == -1);
lut[matId] = i;
}
}
}
GModel& mdl = prj.GetFEModel().GetModel();
for (int i = 0; i < mdl.Objects(); ++i)
{
GObject* po = mdl.Object(i);
for (int j = 0; j < po->Parts(); ++j)
{
GPart* pj = po->Part(j);
int matId = pj->GetMaterialID() - minId;
if ((matId < 0) || (matId >= mats) || (lut[matId] == -1))
{
objList.push_back(pj);
}
}
}
}
void check_004(FEProject& prj, std::vector<FSObject*>& objList)
{
FEModel& fem = prj.GetFEModel();
if (fem.Steps() <= 1)
{
objList.push_back(&fem);
}
}
void check_005(FEProject& prj, std::vector<FSObject*>& objList)
{
FEModel& fem = prj.GetFEModel();
GModel& mdl = fem.GetModel();
for (int i = 0; i < fem.Materials(); ++i)
{
GMaterial* mat = fem.GetMaterial(i);
// see if this material is used
list<GPart*> partList = mdl.FindPartsFromMaterial(mat->GetID());
if (partList.empty())
{
objList.push_back(mat);
}
}
}
void check_006(FEProject& prj, std::vector<FSObject*>& objList)
{
FEModel& fem = prj.GetFEModel();
GModel& mdl = fem.GetModel();
for (int i = 0; i < fem.Materials(); ++i)
{
GMaterial* mat = fem.GetMaterial(i);
if (dynamic_cast<FERigidMaterial*>(mat->GetMaterialProperties()))
{
int matId = mat->GetID();
bool matUsed = false;
for (int n = 0; n < fem.Steps(); ++n)
{
FEStep* pstep = fem.GetStep(n);
// see if this material is referenced by any rigid constraints
for (int j = 0; j < pstep->RigidConstraints(); ++j)
{
FERigidConstraint* prc = pstep->RigidConstraint(j);
if (prc->GetMaterialID() == matId)
{
matUsed = true;
break;
}
}
if (matUsed) break;
// see if this material is referenced by any rigid connector
for (int j = 0; j < pstep->RigidConnectors(); ++j)
{
FERigidConnector* prc = pstep->RigidConnector(j);
if ((prc->m_rbA == matId) || (prc->m_rbB == matId))
{
matUsed = true;
break;
}
}
if (matUsed) break;
// see if this material is used by any rigid interface
for (int j = 0; j < pstep->Interfaces(); ++j)
{
FERigidInterface* ri = dynamic_cast<FERigidInterface*>(pstep->Interface(j));
if (ri && (ri->GetRigidBody() == mat))
{
matUsed = true;
break;
}
}
// see if this material is used by a part that is connected to another part
for (int j = 0; j < mdl.Objects(); ++j)
{
GObject* po = mdl.Object(j);
for (int k = 0; k < po->Faces(); ++k)
{
GFace* face = po->Face(k);
for (int l = 0; l < 3; ++l)
{
GPart* pgl = po->Part(face->m_nPID[l]);
if (pgl && (pgl->GetMaterialID() == matId))
{
matUsed = true;
}
}
}
if (matUsed) break;
}
if (matUsed) break;
}
if (matUsed == false)
{
objList.push_back(mat);
}
}
}
}
// see if surfaces of solo interfaces are assigned.
void check_007(FEProject& prj, std::vector<FSObject*>& objList)
{
FEModel& fem = prj.GetFEModel();
for (int i = 0; i < fem.Steps(); ++i)
{
FEStep* step = fem.GetStep(i);
for (int j = 0; j < step->Interfaces(); ++j)
{
FEInterface* pi = step->Interface(j);
if (dynamic_cast<FESoloInterface*>(pi))
{
FESoloInterface* psi = dynamic_cast<FESoloInterface*>(pi);
if (psi->GetItemList() == nullptr)
{
objList.push_back(pi);
}
}
}
}
}
// see if surfaces of paired interfaces are assigned.
void check_008(FEProject& prj, std::vector<FSObject*>& objList)
{
FEModel& fem = prj.GetFEModel();
for (int i = 0; i < fem.Steps(); ++i)
{
FEStep* step = fem.GetStep(i);
for (int j = 0; j < step->Interfaces(); ++j)
{
FEInterface* pi = step->Interface(j);
if (dynamic_cast<FEPairedInterface*>(pi))
{
FEPairedInterface* psi = dynamic_cast<FEPairedInterface*>(pi);
if ((psi->GetPrimarySurface() == nullptr) || (psi->GetSecondarySurface() == nullptr))
{
objList.push_back(pi);
}
}
}
}
}
// see if loads have assigned selections.
void check_009(FEProject& prj, std::vector<FSObject*>& objList)
{
FEModel& fem = prj.GetFEModel();
for (int i = 0; i < fem.Steps(); ++i)
{
FEStep* step = fem.GetStep(i);
for (int j = 0; j < step->Loads(); ++j)
{
FELoad* pl = step->Load(j);
if ((dynamic_cast<FEBodyLoad*>(pl) == nullptr) && (pl->GetItemList() == nullptr))
{
objList.push_back(pl);
}
}
}
}
// see if BCs have assigned selections.
void check_010(FEProject& prj, std::vector<FSObject*>& objList)
{
FEModel& fem = prj.GetFEModel();
for (int i = 0; i < fem.Steps(); ++i)
{
FEStep* step = fem.GetStep(i);
for (int j = 0; j < step->BCs(); ++j)
{
FEBoundaryCondition* pl = step->BC(j);
if (pl->GetItemList() == nullptr)
{
objList.push_back(pl);
}
}
}
}
// see if ICs have assigned selections.
void check_011(FEProject& prj, std::vector<FSObject*>& objList)
{
FEModel& fem = prj.GetFEModel();
for (int i = 0; i < fem.Steps(); ++i)
{
FEStep* step = fem.GetStep(i);
for (int j = 0; j < step->ICs(); ++j)
{
FEInitialNodalDOF* pl = dynamic_cast<FEInitialNodalDOF*>(step->IC(j));
if (pl && pl->GetItemList() == nullptr)
{
objList.push_back(pl);
}
}
}
}
// see if there are any output variables defined
void check_012(FEProject& prj, std::vector<FSObject*>& objList)
{
FEModel& fem = prj.GetFEModel();
CPlotDataSettings& plt = prj.GetPlotDataSettings();
// count the nr of active plot variables
int na = 0;
for (int i = 0; i<plt.PlotVariables(); ++i) if (plt.PlotVariable(i).isActive()) na++;
if (na == 0)
{
objList.push_back(&fem);
}
}
// see if shell thickness are zero for non-rigid parts
void check_013(FEProject& prj, std::vector<FSObject*>& objList)
{
FEModel& fem = prj.GetFEModel();
GModel& mdl = fem.GetModel();
for (int i = 0; i < mdl.Objects(); ++i)
{
GObject* obj_i = mdl.Object(i);
FEMesh* pm = obj_i->GetFEMesh();
if (pm)
{
int parts = obj_i->Parts();
for (int n = 0; n < parts; ++n)
{
GPart* pg = obj_i->Part(n);
int zeroShells = 0;
int NE = pm->Elements();
for (int j = 0; j < NE; ++j)
{
FEElement& el = pm->Element(j);
if (el.IsShell() && (el.m_gid == n))
{
int ne = el.Nodes();
for (int k = 0; k < ne; ++k)
{
if (el.m_h[k] == 0.0) zeroShells++;
}
}
if (zeroShells) break;
}
if (zeroShells > 0)
{
// see if the material is rigid
int mid = pg->GetMaterialID();
GMaterial* pm = fem.GetMaterialFromID(mid);
if (pm)
{
FEMaterial* mat = pm->GetMaterialProperties();
if (mat && (dynamic_cast<FERigidMaterial*>(mat)))
{
// we allow zero thickness for rigid parts
zeroShells = 0;
}
}
}
if (zeroShells)
{
objList.push_back(pg);
}
}
}
}
}
// do rigid connectors have two different rigid bodies
void check_014(FEProject& prj, std::vector<FSObject*>& objList)
{
FEModel& fem = prj.GetFEModel();
for (int i = 0; i < fem.Steps(); ++i)
{
FEStep* pstep = fem.GetStep(i);
int nrc = pstep->RigidConnectors();
for (int j = 0; j < nrc; ++j)
{
FERigidConnector* rc = pstep->RigidConnector(j);
if (rc->m_rbA == rc->m_rbB)
{
objList.push_back(rc);
}
}
}
}
// do rigid connectors have two rigid bodies defined
void check_015(FEProject& prj, std::vector<FSObject*>& objList)
{
FEModel& fem = prj.GetFEModel();
for (int i = 0; i < fem.Steps(); ++i)
{
FEStep* pstep = fem.GetStep(i);
int nrc = pstep->RigidConnectors();
for (int j = 0; j < nrc; ++j)
{
FERigidConnector* rc = pstep->RigidConnector(j);
if ((rc->m_rbA == -1) || (rc->m_rbB == -1))
{
objList.push_back(rc);
}
}
}
}
// check if a rigid interface was assigned a rigid body
void check_016(FEProject& prj, std::vector<FSObject*>& objList)
{
FEModel& fem = prj.GetFEModel();
for (int i = 0; i < fem.Steps(); ++i)
{
FEStep* pstep = fem.GetStep(i);
int ni = pstep->Interfaces();
for (int j = 0; j < ni; ++j)
{
FERigidInterface* ri = dynamic_cast<FERigidInterface*>(pstep->Interface(j));
if (ri && (ri->GetRigidBody() == nullptr))
{
objList.push_back(ri);
}
}
}
}
// check if parts have duplicate names
void check_017(FEProject& prj, std::vector<FSObject*>& objList)
{
FEModel& fem = prj.GetFEModel();
GModel& gm = fem.GetModel();
for (int i = 0; i < gm.Objects(); ++i)
{
GObject* poi = gm.Object(i);
for (int j = 0; j < poi->Parts(); ++j)
{
GPart* pj = poi->Part(j);
for (int k = 0; k < gm.Objects(); ++k)
{
GObject* pok = gm.Object(k);
for (int l = 0; l < pok->Parts(); ++l)
{
GPart* pl = pok->Part(l);
if ((pl != pj) && (pj->GetName() == pl->GetName()))
{
objList.push_back(pj);
}
}
}
}
}
}
|
PedroSFreire/LiftPR.Version
|
src/platform/vulkan/render_pass.cpp
|
<reponame>PedroSFreire/LiftPR.Version
#include "render_pass.h"
#include "depth_buffer.h"
#include "device.h"
#include "swap_chain.h"
#include <array>
namespace vulkan {
RenderPass::RenderPass(const class SwapChain& swap_chain,
const class DepthBuffer& depth_buffer,
const bool clear_color_buffer,
const bool clear_depth_buffer) :
swap_chain_(swap_chain),
depth_buffer_(depth_buffer) {
VkAttachmentDescription color_attachment = {};
color_attachment.format = swap_chain.format();
color_attachment.samples = VK_SAMPLE_COUNT_1_BIT;
color_attachment.loadOp = clear_color_buffer ? VK_ATTACHMENT_LOAD_OP_CLEAR : VK_ATTACHMENT_LOAD_OP_DONT_CARE;
color_attachment.storeOp = VK_ATTACHMENT_STORE_OP_STORE;
color_attachment.stencilLoadOp = VK_ATTACHMENT_LOAD_OP_DONT_CARE;
color_attachment.stencilStoreOp = VK_ATTACHMENT_STORE_OP_DONT_CARE;
color_attachment.initialLayout = VK_IMAGE_LAYOUT_UNDEFINED;
color_attachment.finalLayout = VK_IMAGE_LAYOUT_PRESENT_SRC_KHR;
VkAttachmentDescription depth_attachment = {};
depth_attachment.format = depth_buffer.format();
depth_attachment.samples = VK_SAMPLE_COUNT_1_BIT;
depth_attachment.loadOp = clear_depth_buffer ? VK_ATTACHMENT_LOAD_OP_CLEAR : VK_ATTACHMENT_LOAD_OP_DONT_CARE;
depth_attachment.storeOp = VK_ATTACHMENT_STORE_OP_DONT_CARE;
depth_attachment.stencilLoadOp = VK_ATTACHMENT_LOAD_OP_DONT_CARE;
depth_attachment.stencilStoreOp = VK_ATTACHMENT_STORE_OP_DONT_CARE;
depth_attachment.initialLayout = VK_IMAGE_LAYOUT_UNDEFINED;
depth_attachment.finalLayout = VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL;
VkAttachmentReference color_attachment_ref = {};
color_attachment_ref.attachment = 0;
color_attachment_ref.layout = VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL;
VkAttachmentReference depth_attachment_ref = {};
depth_attachment_ref.attachment = 1;
depth_attachment_ref.layout = VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL;
VkSubpassDescription subpass = {};
subpass.pipelineBindPoint = VK_PIPELINE_BIND_POINT_GRAPHICS;
subpass.colorAttachmentCount = 1;
subpass.pColorAttachments = &color_attachment_ref;
subpass.pDepthStencilAttachment = &depth_attachment_ref;
VkSubpassDependency dependency = {};
dependency.srcSubpass = VK_SUBPASS_EXTERNAL;
dependency.dstSubpass = 0;
dependency.srcStageMask = VK_PIPELINE_STAGE_COLOR_ATTACHMENT_OUTPUT_BIT;
dependency.srcAccessMask = 0;
dependency.dstStageMask = VK_PIPELINE_STAGE_COLOR_ATTACHMENT_OUTPUT_BIT;
dependency.dstAccessMask = VK_ACCESS_COLOR_ATTACHMENT_READ_BIT | VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT;
std::array<VkAttachmentDescription, 2> attachments = {color_attachment, depth_attachment};
VkRenderPassCreateInfo render_pass_info = {};
render_pass_info.sType = VK_STRUCTURE_TYPE_RENDER_PASS_CREATE_INFO;
render_pass_info.attachmentCount = static_cast<uint32_t>(attachments.size());
render_pass_info.pAttachments = attachments.data();
render_pass_info.subpassCount = 1;
render_pass_info.pSubpasses = &subpass;
render_pass_info.dependencyCount = 1;
render_pass_info.pDependencies = &dependency;
vulkanCheck(vkCreateRenderPass(swap_chain_.device().handle(), &render_pass_info, nullptr, &render_pass_),
"create render pass");
}
RenderPass::~RenderPass() {
if (render_pass_ != nullptr) {
vkDestroyRenderPass(swap_chain_.device().handle(), render_pass_, nullptr);
render_pass_ = nullptr;
}
}
} // namespace vulkan
|
rasp30024/roll20-api-scripts
|
ItsATrap_theme_Starfinder/3.1/TrapTheme.js
|
<filename>ItsATrap_theme_Starfinder/3.1/TrapTheme.js
(() => {
'use strict';
// A mapping of known attribute names for supported character sheets.
const SHEET_ATTRS = {
'Roll20': {
kac: 'kac',
eac: 'eac',
fortSaveModifier: 'fort',
refSaveModifier: 'ref',
willSaveModifier: 'will',
acm: 'cmd',
starshipAC: 'ac',
starshipTL: 'tl',
perceptionModifier: 'perception'
},
'Simple': {
kac: 'KAC',
eac: 'EAC',
fortSaveModifier: 'Fort',
refSaveModifier: 'Ref',
willSaveModifier: 'Will',
acm: 'ACM',
starshipAC: 'starship-ac-total',
starshipTL: 'starship-tl-total',
perceptionModifier: 'Perception'
},
custom: {}
};
/**
* Get the state for this script, creating it for the first time if
* necessary.
* @return The state.
*/
function getState() {
if (!state.itsatrapthemestarfinder)
state.itsatrapthemestarfinder = {
sheet: undefined,
trapSpotterAttempts: {}
};
return state.itsatrapthemestarfinder;
}
// Register the theme with ItsATrap.
on('ready', () => {
/**
* The concrete TrapTheme class.
*/
class TrapThemeStarfinder extends D20TrapTheme {
/**
* @inheritdoc
*/
get name() {
return 'Starfinder Generic';
}
/**
* @inheritdoc
*/
activateEffect(effect) {
let character = getObj('character', effect.victim.get('represents'));
let effectResults = effect.json;
// Automate trap attack/save mechanics.
Promise.resolve()
.then(() => {
effectResults.character = character;
if(character) {
if(effectResults.attack)
if(effectResults.attackVs === 'ACM')
return this._doTrapCombatManeuver(character, effectResults);
else if(effectResults.attackVs === 'EAC')
return this._doTrapEACAttack(character, effectResults);
else if(effectResults.attackVs === 'starship AC')
return this._doTrapStarshipACAttack(character, effectResults);
else if(effectResults.attackVs === 'starship TL')
return this._doTrapStarshipTLAttack(character, effectResults);
else
return this._doTrapKACAttack(character, effectResults);
else if(effectResults.save && effectResults.saveDC)
return this._doTrapSave(character, effectResults);
}
return effectResults;
})
.then(effectResults => {
let html = TrapThemeStarfinder.htmlTrapActivation(effectResults);
effect.announce(html.toString(TrapTheme.css));
})
.catch(err => {
sendChat('TrapTheme: ' + this.name, '/w gm ' + err.message);
log(err.stack);
});
}
/**
* Does a trap's Combat Maneuver roll.
* @private
*/
_doTrapCombatManeuver(character, effectResults) {
return Promise.all([
this.getACM(character),
CharSheetUtils.rollAsync('1d20 + ' + effectResults.attack)
])
.then(tuple => {
let ac = tuple[0] || 10;
let roll = tuple[1];
effectResults.ac = ac;
effectResults.roll = roll;
effectResults.trapHit = roll.total >= ac;
return effectResults;
});
}
/**
* Does a trap's attack vs Energy AC.
* @private
*/
_doTrapEACAttack(character, effectResults) {
return Promise.all([
this.getEAC(character),
CharSheetUtils.rollAsync('1d20 + ' + effectResults.attack)
])
.then(tuple => {
let ac = tuple[0] || 10;
let roll = tuple[1];
effectResults.ac = ac;
effectResults.roll = roll;
effectResults.trapHit = roll.total >= ac;
return effectResults;
});
}
/**
* Does a trap's attack vs Kinetic AC.
* @private
*/
_doTrapKACAttack(character, effectResults) {
return Promise.all([
this.getKAC(character),
CharSheetUtils.rollAsync('1d20 + ' + effectResults.attack)
])
.then(tuple => {
let ac = tuple[0] || 10;
let roll = tuple[1];
effectResults.ac = ac;
effectResults.roll = roll;
effectResults.trapHit = roll.total >= ac;
return effectResults;
});
}
/**
* Does a trap's attack vs starship AC.
* @private
*/
_doTrapStarshipACAttack(character, effectResults) {
return Promise.all([
this.getStarshipAC(character),
CharSheetUtils.rollAsync('1d20 + ' + effectResults.attack)
])
.then(tuple => {
let ac = tuple[0] || 10;
let roll = tuple[1];
effectResults.ac = ac;
effectResults.roll = roll;
effectResults.trapHit = roll.total >= ac;
return effectResults;
});
}
/**
* Does a trap's attack vs starship TL.
* @private
*/
_doTrapStarshipTLAttack(character, effectResults) {
return Promise.all([
this.getStarshipTL(character),
CharSheetUtils.rollAsync('1d20 + ' + effectResults.attack)
])
.then(tuple => {
let ac = tuple[0] || 10;
let roll = tuple[1];
effectResults.ac = ac;
effectResults.roll = roll;
effectResults.trapHit = roll.total >= ac;
return effectResults;
});
}
/**
* Gets the Combat Maneuver Defense for a character.
* @param {Character} character
* @return {Promise<number>}
*/
getACM(character) {
let sheet = this.getSheet();
sheet = SHEET_ATTRS[sheet];
let attrName = sheet.acm;
return CharSheetUtils.getSheetAttr(character, attrName);
}
/**
* @inheritdoc
*/
getEAC(character) {
let sheet = this.getSheet();
sheet = SHEET_ATTRS[sheet];
let attrName = sheet.eac;
return CharSheetUtils.getSheetAttr(character, attrName);
}
/**
* @inheritdoc
*/
getKAC(character) {
let sheet = this.getSheet();
sheet = SHEET_ATTRS[sheet];
let attrName = sheet.kac;
return CharSheetUtils.getSheetAttr(character, attrName);
}
/**
* @inheritdoc
*/
getStarshipAC(character) {
let sheet = this.getSheet();
sheet = SHEET_ATTRS[sheet];
let attrName = sheet.starshipAC;
return CharSheetUtils.getSheetAttr(character, attrName);
}
/**
* @inheritdoc
*/
getStarshipTL(character) {
let sheet = this.getSheet();
sheet = SHEET_ATTRS[sheet];
let attrName = sheet.starshipTL;
return CharSheetUtils.getSheetAttr(character, attrName);
}
/**
* @inheritdoc
*/
getPassivePerception(character) {
return this.getPerceptionModifier(character)
.then(value => {
return value + 10;
});
}
/**
* Gets the Perception modifier for a character.
* @param {Character} character
* @return {Promise<number>}
*/
getPerceptionModifier(character) {
let sheet = this.getSheet();
sheet = SHEET_ATTRS[sheet];
let attrName = sheet.perceptionModifier;
return CharSheetUtils.getSheetAttr(character, attrName);
}
/**
* @inheritdoc
*/
getSaveBonus(character, saveName) {
let sheet = this.getSheet();
sheet = SHEET_ATTRS[sheet];
let key = saveName + 'SaveModifier';
let attrName = sheet[key];
return CharSheetUtils.getSheetAttr(character, attrName);
}
/**
* Get the name of the character sheet being used, either by
* auto-detecting it, or having it set manually.
* @return The character sheet name.
*/
getSheet() {
let name = getState().sheet;
if (name) {
// If we're using a custom sheet, update the cached attributes from
// the state.
if (name === 'custom') {
if (!getState().customAttrs)
getState().customAttrs = {};
SHEET_ATTRS.custom = getState().customAttrs;
}
return name;
}
else {
if (!this._cachedSheet) {
if (this._getSheetTryRoll20())
this._cachedSheet = 'Roll20';
else if (this._getSheetTrySimple())
this._cachedSheet = 'Simple';
else
return undefined;
log("Starfinder trap theme - auto-detected character sheet: " +
this._cachedSheet);
}
return this._cachedSheet;
}
}
/**
* Try to auto-detect the Roll20 sheet.
*/
_getSheetTryRoll20() {
let result = findObjs({
_type: 'attribute',
name: 'sheet_type'
})[0] &&
findObjs({
_type: 'attribute',
name: 'tab_select'
})[0];
return !!result;
}
/**
* Try to auto-detect the Roll20 sheet.
*/
_getSheetTrySimple() {
let result = findObjs({
_type: 'attribute',
name: 'STR_show_options'
})[0] ||
findObjs({
_type: 'attribute',
name: 'DEX_show_options'
})[0] ||
findObjs({
_type: 'attribute',
name: 'CON_show_options'
})[0] ||
findObjs({
_type: 'attribute',
name: 'INT_show_options'
})[0] ||
findObjs({
_type: 'attribute',
name: 'WIS_show_options'
})[0] ||
findObjs({
_type: 'attribute',
name: 'CHA_show_options'
})[0];
return !!result;
}
/**
* @inheritdoc
*/
getThemeProperties(trapToken) {
let result = super.getThemeProperties(trapToken);
let trapEffect = (new TrapEffect(trapToken)).json;
// Prepend an option for specifying the character sheet.
result.unshift({
id: 'sheet',
name: 'Character Sheet',
desc: 'Specify the character sheet used in your game.',
value: (() => {
let sheet = getState().sheet;
if (sheet)
return sheet;
else {
sheet = this.getSheet();
if (!sheet) {
setTimeout(() => {
ItsATrap.Chat.whisperGM('Could not auto-detect Starfinder character sheet ' +
'for your game. Please set it manually from the trap properties ' +
'menu under Theme-Specific Properties.');
}, 100);
return 'auto-detect';
}
return `${sheet}<br/>(auto-detected)`;
}
})(),
options: ['Auto-detect', 'Roll20', 'Simple', 'custom']
});
// If the user is using a custom sheet or just bare-bones attributes,
// display another property to specify the attribute names.
if (this.getSheet() === 'custom') {
result.splice(1, 0, {
id: 'customAttrs',
name: 'Custom Sheet Attrs',
desc: (() => {
let attrKeys = _.keys(SHEET_ATTRS.custom);
if (_.size(attrKeys) === 0)
return 'Custom attributes not specified!';
else {
attrKeys.sort();
let result = '';
_.each(attrKeys, key => {
let value = SHEET_ATTRS.custom[key];
result += `${key}: ${value}<br/>`;
})
return result;
}
})(),
value: 'Mouse-over to view current settings.',
properties: [
{
id: 'kac',
name: 'Kinetic Armor Class',
desc: 'Specify attribute name for Kinetic Armor Class.'
},
{
id: 'eac',
name: 'Energy Armor Class',
desc: 'Specify attribute name for Energy Armor Class.'
},
{
id: 'fortSaveModifier',
name: 'Fort Save',
desc: 'Specify attribute name for Fortitude saving throw modifier.'
},
{
id: 'refSaveModifier',
name: 'Reflex Save',
desc: 'Specify attribute name for Reflex saving throw modifier.'
},
{
id: 'willSaveModifier',
name: 'Will Save',
desc: 'Specify attribute name for Will saving throw modifier.'
},
{
id: 'acm',
name: 'AC vs Combat Maneuvers',
desc: 'Specify attribute name for AC vs Combat Maneuvers.'
},
{
id: 'starshipAC',
name: 'Starship AC',
desc: 'Specify attribute name for Starship AC.'
},
{
id: 'starshipTL',
name: 'Starship TL',
desc: 'Specify attribute name for Starship TL.'
},
{
id: 'perceptionModifier',
name: 'Perception',
desc: 'Specify attribute name for Perception skill modifier.'
}
]
});
}
// Insert a global property for enabling passive perception for
// Starfinder (by default Starfinder doesn't have passive perception).
result.splice(1, 0, {
id: 'enablePassivePerception',
name: 'Enable Passive Perception?',
desc: 'Specify whether to globally enable passive perception for your Starfinder game.',
value: (() => {
if (getState().enablePassivePerception)
return 'yes';
else
return 'no';
})(),
options: ['yes', 'no']
});
// Modify the saving throw types.
_.find(result, item => {
if (item.id === 'save') {
item.properties[0].options = ['none', 'fort', 'ref', 'will'];
return true;
}
else
return false;
});
// Modify "attack" to include both the attack bonus and the attack VS.
_.find(result, item => {
if (item.id === 'attack') {
_.extend(item, {
name: 'Attack Roll',
value: (() => {
let atkBonus = trapEffect.attack;
let atkVs = trapEffect.attackVs;
if (atkBonus && atkVs) {
return `+${atkBonus} vs ${atkVs}`;
}
else
return 'none';
})(),
properties: [
{
id: 'bonus',
name: 'Attack Bonus',
desc: 'What is the trap attack bonus?'
},
{
id: 'vs',
name: 'AC type',
desc: 'Which AC is the attack against?',
options: ['KAC', 'EAC', 'ACM', "starship AC", "starship TL"]
}
]
});
return true;
}
else
return false;
});
return result;
}
/**
* Produces the HTML for a trap activation message for most d20 systems.
* @param {object} effectResults
* @return {HtmlBuilder}
*/
static htmlTrapActivation(effectResults) {
let content = new HtmlBuilder('div');
// Add the flavor message.
content.append('.paddedRow trapMessage', effectResults.message);
if(effectResults.character) {
var row = content.append('.paddedRow');
row.append('span.bold', 'Target:');
row.append('span', effectResults.character.get('name'));
// Add the attack roll message.
if(effectResults.attack) {
let rollResult = D20TrapTheme.htmlRollResult(effectResults.roll, '1d20 + ' + effectResults.attack);
let row = content.append('.paddedRow')
if(effectResults.attackVs === 'ACM') {
row.append('span.bold', 'Maneuver roll:');
row.append('span', rollResult);
row.append('span', ' vs ACM ' + effectResults.ac);
}
else if(effectResults.attackVs === 'EAC') {
row.append('span.bold', 'Attack roll:');
row.append('span', rollResult);
row.append('span', ' vs EAC ' + effectResults.ac);
}
else if(effectResults.attackVs === 'starship AC') {
row.append('span.bold', 'Attack roll:');
row.append('span', rollResult);
row.append('span', ' vs starship AC ' + effectResults.ac);
}
else if(effectResults.attackVs === 'starship TL') {
row.append('span.bold', 'Attack roll:');
row.append('span', rollResult);
row.append('span', ' vs starship TL ' + effectResults.ac);
}
else {
row.append('span.bold', 'Attack roll:');
row.append('span', rollResult);
row.append('span', ' vs KAC ' + effectResults.ac);
}
}
// Add the saving throw message.
if(effectResults.save) {
let rollResult = D20TrapTheme.htmlRollResult(effectResults.roll, '1d20 + ' + effectResults.saveBonus);
let saveMsg = new HtmlBuilder('.paddedRow');
saveMsg.append('span.bold', effectResults.save.toUpperCase() + ' save:');
saveMsg.append('span', rollResult);
saveMsg.append('span', ' vs DC ' + effectResults.saveDC);
// If the save result is a secret, whisper it to the GM.
if(effectResults.hideSave)
sendChat('<NAME>', '/w gm ' + saveMsg.toString(TrapTheme.css));
else
content.append(saveMsg);
}
// Add the hit/miss message.
if(effectResults.trapHit) {
let row = content.append('.paddedRow');
row.append('span.hit', 'HIT! ');
if(effectResults.damage)
row.append('span', 'Damage: [[' + effectResults.damage + ']]');
else
row.append('span', 'You fall prey to the ' + (effectResults.type || 'trap') + '\'s effects!');
}
else {
let row = content.append('.paddedRow');
row.append('span.miss', 'MISS! ');
if(effectResults.damage && effectResults.missHalf)
row.append('span', 'Half damage: [[floor((' + effectResults.damage + ')/2)]].');
}
}
return TrapTheme.htmlTable(content, '#a22', effectResults);
}
/**
* @inheritdoc
*/
modifyTrapProperty(trapToken, argv) {
super.modifyTrapProperty(trapToken, argv);
let trapEffect = (new TrapEffect(trapToken)).json;
let prop = argv[0];
let params = argv.slice(1);
if (prop === 'sheet') {
if (params[0] === 'Auto-detect')
getState().sheet = undefined;
else
getState().sheet = params[0];
}
if (prop === 'customAttrs') {
SHEET_ATTRS.custom = getState().customAttrs = {
kac: params[0],
eac: params[1],
fortSaveModifier: params[2],
refSaveModifier: params[3],
willSaveModifier: params[4],
acm: params[5],
starshipAC: params[6],
starshipTL: params[7],
perceptionModifier: params[8]
};
}
if (prop === 'enablePassivePerception') {
getState().enablePassivePerception = params[0] === 'yes';
}
// Parse both the attack bonus and the attack type from the 'attack' property.
if (prop === 'attack') {
let atkBonus = parseInt(params[0]);
let atkVs = params [1];
if (!atkBonus && atkBonus !== 0) {
trapEffect.attack = undefined;
trapEffect.attackVs = undefined;
}
else {
trapEffect.attack = atkBonus;
trapEffect.attackVs = atkVs;
}
}
trapToken.set('gmnotes', JSON.stringify(trapEffect));
}
/**
* @inheritdoc
*/
passiveSearch(trap, charToken) {
let passiveEnabled = getState().enablePassivePerception;
if(passiveEnabled)
super.passiveSearch(trap, charToken);
}
}
// Register the trap theme and try to auto-detect the sheet being used.
let themeInst = new TrapThemeStarfinder();
ItsATrap.registerTheme(themeInst);
themeInst.getSheet();
// Notify user about updates.
if (!getState().version) {
getState().version = '3.1';
sendChat("It's A Trap!", "/w gm <h2>Notice:</h2><p>The Starfinder trap theme has been updated to version 3.1. It now automatically detects which character sheet you're using so you don't have to set it yourself! Happy rolling!</p>");
}
});
})();
|
WSSDude420/RED4ext.SDK
|
include/RED4ext/Scripting/Natives/Generated/game/bb/AllScriptDefinitions.hpp
|
#pragma once
// This file is generated from the Game's Reflection data
#include <cstdint>
#include <RED4ext/Common.hpp>
#include <RED4ext/Scripting/IScriptable.hpp>
namespace RED4ext
{
namespace game::bb {
struct AllScriptDefinitions : IScriptable
{
static constexpr const char* NAME = "gamebbAllScriptDefinitions";
static constexpr const char* ALIAS = NAME;
};
RED4EXT_ASSERT_SIZE(AllScriptDefinitions, 0x40);
} // namespace game::bb
} // namespace RED4ext
|
eciesla/AliPhysics
|
PWGCF/FLOW/Forward/AliForwardNUATask.cxx
|
//
// Calculate flow in the forward and central regions using the Q cumulants method.
//
// Inputs:
// - AliAODEvent
//
// Outputs:
// - AnalysisResults.root or forward_flow.root
//
#include <iostream>
#include <TROOT.h>
#include <TSystem.h>
#include <TInterpreter.h>
#include <TList.h>
#include <THn.h>
#include "AliGenEventHeader.h"
#include "AliCollisionGeometry.h"
#include "AliLog.h"
#include "AliForwardNUATask.h"
#include "AliForwardQCumulantRun2.h"
#include "AliForwardGenericFramework.h"
#include "AliForwardFlowRun2Task.h"
#include "TObjectTable.h"
#include "AliAODForwardMult.h"
#include "AliAODCentralMult.h"
#include "AliAODEvent.h"
#include "AliForwardFlowUtil.h"
#include "AliVVZERO.h"
#include "AliAODVertex.h"
#include "AliCentrality.h"
#include "AliESDEvent.h"
#include "AliVTrack.h"
#include "AliESDtrack.h"
#include "AliAODTrack.h"
#include "AliAODTracklets.h"
#include "AliAnalysisFilter.h"
#include "AliMultSelection.h"
#include "AliMultiplicity.h"
#include "AliAnalysisManager.h"
#include "AliInputEventHandler.h"
#include "TMath.h"
using namespace std;
ClassImp(AliForwardNUATask)
#if 0
; // For emacs
#endif
//_____________________________________________________________________
AliForwardNUATask::AliForwardNUATask() : AliAnalysisTaskSE(),
fAOD(0), // input event
fOutputList(0), // output list
fEventList(0),
centralDist(),
refDist(),
forwardDist(),
nua_cen(),
nua_fmd(),
dNdeta(),
ev_val(),
fSettings(),
fUtil()
{
//
// Default constructor
//
}
//_____________________________________________________________________
AliForwardNUATask::AliForwardNUATask(const char* name) : AliAnalysisTaskSE(name),
fAOD(0), // input event
fOutputList(0),
fEventList(0),
centralDist(),
refDist(),
forwardDist(),
nua_cen(),
nua_fmd(),
dNdeta(),
ev_val(),
fSettings(),
fUtil()
{
//
// Constructor
//
// Parameters:
// name: Name of task
//
DefineInput(1, AliForwardTaskValidation::Class());
DefineOutput(1, TList::Class());
}
//_____________________________________________________________________
void AliForwardNUATask::UserCreateOutputObjects()
{
//
// Create output objects
//
fOutputList = new TList(); // the final output list
fOutputList->SetOwner(kTRUE); // memory stuff: the list is owner of all objects it contains and will delete them if requested
fEventList = new TList();
fEventList->Add(new TH1D("Vertex","Vertex",fSettings.fNZvtxBins,fSettings.fZVtxAcceptanceLowEdge,fSettings.fZVtxAcceptanceUpEdge));
fEventList->SetName("EventInfo");
Int_t centralEtaBins = (fSettings.useITS ? 200 : 400);
Int_t centralPhiBins = (fSettings.useITS ? 20 : 400);
Double_t centralEtaMin = (fSettings.useSPD ? -2.5 : fSettings.useITS ? -4 : -1.5);
Double_t centralEtaMax = (fSettings.useSPD ? 2.5 : fSettings.useITS ? 6 : 1.5);
Int_t forwardBinsEta = (fSettings.use_primaries_fwd ? 200 : 200);
Int_t forwardBinsPhi = (fSettings.use_primaries_fwd ? 20 : 20);
nua_cen = new TH3D("NUA_cen","NUA_cen", centralEtaBins, centralEtaMin, centralEtaMax, centralPhiBins, 0., 2*TMath::Pi(),fSettings.fNZvtxBins,fSettings.fZVtxAcceptanceLowEdge,fSettings.fZVtxAcceptanceUpEdge);
nua_fmd = new TH3D("NUA_fwd","NUA_fwd", forwardBinsEta, -4.0, 6.0, forwardBinsPhi, 0., 2*TMath::Pi(),fSettings.fNZvtxBins,fSettings.fZVtxAcceptanceLowEdge,fSettings.fZVtxAcceptanceUpEdge);
fOutputList->Add(nua_fmd);
fOutputList->Add(nua_cen);
dNdeta = new TH1F("dNdeta","dNdeta",100 /*fSettings.fNDiffEtaBins*/,fSettings.fEtaLowEdge,fSettings.fEtaUpEdge);
fOutputList->Add(dNdeta);
fOutputList->Add(fEventList);
PostData(1, fOutputList);
}
//_____________________________________________________________________
void AliForwardNUATask::UserExec(Option_t *)
{
//gObjectTable->Print();
//
// Analyses the event with use of the helper class AliForwardQCumulantRun2
//
// Parameters:
// option: Not used
//
// Get the event validation object
ev_val = dynamic_cast<AliForwardTaskValidation*>(this->GetInputData(1));
if (!ev_val->IsValidEvent()){
PostData(1, this->fOutputList);
return;
}
if (!fSettings.esd) {
fUtil.fAODevent = dynamic_cast<AliAODEvent*>(InputEvent());
if(!fUtil.fAODevent) throw std::runtime_error("Not AOD as expected");
}
fUtil.fevent = fInputEvent;
fUtil.fSettings = fSettings;
if (fSettings.mc) fUtil.fMCevent = this->MCEvent();
Int_t centralEtaBins = (fSettings.useITS ? 200 : 400);
Int_t centralPhiBins = (fSettings.useITS ? 20 : 400);
Double_t centralEtaMin = (fSettings.useSPD ? -2.5 : fSettings.useITS ? -4 : -1.5);
Double_t centralEtaMax = (fSettings.useSPD ? 2.5 : fSettings.useITS ? 6 : 1.5);
TH2D centralDist_tmp = TH2D("c","",centralEtaBins,centralEtaMin,centralEtaMax,centralPhiBins,0,2*TMath::Pi());
centralDist_tmp.SetDirectory(0);
TH2D refDist_tmp = TH2D("c","",centralEtaBins,centralEtaMin,centralEtaMax,centralPhiBins,0,2*TMath::Pi());
refDist_tmp.SetDirectory(0);
TH2D forwardTrRef ("ft","",200,-4,6,20,0,TMath::TwoPi());
TH2D forwardPrim ("fp","",400,-4,6,400,0,TMath::TwoPi());
forwardTrRef.SetDirectory(0);
forwardPrim.SetDirectory(0);
forwardDist = (fSettings.use_primaries_fwd ? &forwardPrim : &forwardTrRef);
forwardDist->SetDirectory(0);
centralDist = ¢ralDist_tmp;
centralDist->SetDirectory(0);
refDist = &refDist_tmp;
refDist->SetDirectory(0);
fUtil.dodNdeta = kTRUE;
fUtil.dNdeta = dNdeta;
fUtil.FillData(refDist,centralDist,forwardDist);
if (fUtil.dodNdeta){
for (Int_t etaBin = 1; etaBin <= centralDist->GetNbinsX(); etaBin++) {
for (Int_t phiBin = 1; phiBin <= centralDist->GetNbinsX(); phiBin++) {
dNdeta->Fill(centralDist->GetXaxis()->GetBinCenter(etaBin),centralDist->GetBinContent(etaBin, phiBin));
}
}
for (Int_t etaBin = 1; etaBin <= forwardDist->GetNbinsX(); etaBin++) {
for (Int_t phiBin = 1; phiBin <= forwardDist->GetNbinsX(); phiBin++) {
dNdeta->Fill(forwardDist->GetXaxis()->GetBinCenter(etaBin),forwardDist->GetBinContent(etaBin, phiBin));
}
}
}
Double_t zvertex = fUtil.GetZ();
//TList* eventList = static_cast<TList*>(fOutputList->FindObject("EventInfo"));
static_cast<TH1D*>(fEventList->FindObject("Vertex"))->Fill(zvertex);
// loop for the TPC
for (Int_t etaBin = 1; etaBin <= centralDist->GetNbinsX(); etaBin++) {
for (Int_t phiBin = 1; phiBin <= centralDist->GetNbinsY(); phiBin++) {
if (centralDist->GetBinContent(etaBin,phiBin) == 0) continue;//TH2D
nua_cen->Fill(centralDist->GetXaxis()->GetBinCenter(etaBin),centralDist->GetYaxis()->GetBinCenter(phiBin),zvertex,centralDist->GetBinContent(etaBin,phiBin)); //TH3D
}
}
if (fSettings.makeFakeHoles) fUtil.MakeFakeHoles(*forwardDist);
// loop for the FMD
for (Int_t etaBin = 1; etaBin <= forwardDist->GetNbinsX(); etaBin++) {
for (Int_t phiBin = 1; phiBin <= forwardDist->GetNbinsY(); phiBin++) {
Double_t weight = forwardDist->GetBinContent(etaBin,phiBin);
if (fSettings.nua_mode & fSettings.kInterpolate)
weight = InterpolateWeight(*forwardDist,phiBin,etaBin,weight);
if (weight == 0) continue;
nua_fmd->Fill(forwardDist->GetXaxis()->GetBinCenter(etaBin),forwardDist->GetYaxis()->GetBinCenter(phiBin),zvertex,weight);
}
}
PostData(1, fOutputList);
return;
}
Double_t AliForwardNUATask::InterpolateWeight(TH2D& forwarddNdedp,Int_t phiBin, Int_t etaBin, Double_t weight)
{
if ((phiBin == 17) && (etaBin >= 125 && etaBin <= 137)){
if (weight > 0 || forwarddNdedp.GetBinContent(etaBin, 18) > 0) return weight;
//if (forwarddNdedp.GetBinContent(etaBin - 1, phiBin) > 0 ) return weight;
//if (forwarddNdedp.GetBinContent(etaBin - 2, phiBin) > 0 ) return weight;
//if (forwarddNdedp.GetBinContent(etaBin - 3, phiBin) > 0 ) return weight;
// std::cout << "found hole, etaBin = " << etaBin << ", eta = " << eta << ", phiBin = " << phiBin << ", phi = " << phi << std::endl;
// if (detType == "forward") weight = 1.;
Double_t up = forwarddNdedp.GetBinContent(etaBin, 19);
Double_t low = forwarddNdedp.GetBinContent(etaBin, 16);
weight = ((up+low)/2+low)/2;
return weight;
//std::cout << weight << std::endl;
}
if ((phiBin == 18) && (etaBin >= 125 && etaBin <= 137)){
if (weight > 0 || forwarddNdedp.GetBinContent(etaBin, 17) > 0 ) return weight;
//if (forwarddNdedp.GetBinContent(etaBin - 1, phiBin) > 0 ) return weight;
//if (forwarddNdedp.GetBinContent(etaBin - 2, phiBin) > 0 ) return weight;
//if (forwarddNdedp.GetBinContent(etaBin - 3, phiBin) > 0 ) return weight;
// std::cout << "found hole, etaBin = " << etaBin << ", eta = " << eta << ", phiBin = " << phiBin << ", phi = " << phi << std::endl;
Double_t up = forwarddNdedp.GetBinContent(etaBin, 19);
Double_t low = forwarddNdedp.GetBinContent(etaBin, 16);
weight = ((up+low)/2+up)/2;
//std::cout << weight << std::endl;
}
if ((phiBin == 14) && (etaBin >= 168 && etaBin <= 185)){
if (weight > 0) return weight;
//if (forwarddNdedp.GetBinContent(etaBin + 1, phiBin) > 0 ) return weight;
//if (forwarddNdedp.GetBinContent(etaBin + 2, phiBin) > 0 ) return weight;
//if (forwarddNdedp.GetBinContent(etaBin + 3, phiBin) > 0 ) return weight;
// std::cout << "found hole, etaBin = " << etaBin << ", eta = " << eta << ", phiBin = " << phiBin << ", phi = " << phi << std::endl;
Double_t up = forwarddNdedp.GetBinContent(etaBin, 15);
Double_t low = forwarddNdedp.GetBinContent(etaBin, 13);
weight = (up+low)/2;
//std::cout << weight << std::endl;
}
return weight;
}
Double_t AliForwardNUATask::InterpolateWeight(TH2D*& forwarddNdedp,Int_t phiBin, Int_t etaBin, Double_t weight)
{
if ((phiBin == 17) && (etaBin >= 125 && etaBin <= 137)){
if (weight > 0 || forwarddNdedp->GetBinContent(etaBin, 18) > 0) return weight;
//if (forwarddNdedp.GetBinContent(etaBin - 1, phiBin) > 0 ) return weight;
//if (forwarddNdedp.GetBinContent(etaBin - 2, phiBin) > 0 ) return weight;
//if (forwarddNdedp.GetBinContent(etaBin - 3, phiBin) > 0 ) return weight;
// std::cout << "found hole, etaBin = " << etaBin << ", eta = " << eta << ", phiBin = " << phiBin << ", phi = " << phi << std::endl;
// if (detType == "forward") weight = 1.;
Double_t up = forwarddNdedp->GetBinContent(etaBin, 19);
Double_t low = forwarddNdedp->GetBinContent(etaBin, 16);
weight = ((up+low)/2+low)/2;
return weight;
//std::cout << weight << std::endl;
}
if ((phiBin == 18) && (etaBin >= 125 && etaBin <= 137)){
if (weight > 0 || forwarddNdedp->GetBinContent(etaBin, 17) > 0 ) return weight;
//if (forwarddNdedp.GetBinContent(etaBin - 1, phiBin) > 0 ) return weight;
//if (forwarddNdedp.GetBinContent(etaBin - 2, phiBin) > 0 ) return weight;
//if (forwarddNdedp.GetBinContent(etaBin - 3, phiBin) > 0 ) return weight;
// std::cout << "found hole, etaBin = " << etaBin << ", eta = " << eta << ", phiBin = " << phiBin << ", phi = " << phi << std::endl;
Double_t up = forwarddNdedp->GetBinContent(etaBin, 19);
Double_t low = forwarddNdedp->GetBinContent(etaBin, 16);
weight = ((up+low)/2+up)/2;
//std::cout << weight << std::endl;
}
if ((phiBin == 14) && (etaBin >= 168 && etaBin <= 185)){
if (weight > 0) return weight;
//if (forwarddNdedp.GetBinContent(etaBin + 1, phiBin) > 0 ) return weight;
//if (forwarddNdedp.GetBinContent(etaBin + 2, phiBin) > 0 ) return weight;
//if (forwarddNdedp.GetBinContent(etaBin + 3, phiBin) > 0 ) return weight;
// std::cout << "found hole, etaBin = " << etaBin << ", eta = " << eta << ", phiBin = " << phiBin << ", phi = " << phi << std::endl;
Double_t up = forwarddNdedp->GetBinContent(etaBin, 15);
Double_t low = forwarddNdedp->GetBinContent(etaBin, 13);
weight = (up+low)/2;
//std::cout << weight << std::endl;
}
return weight;
}
//_____________________________________________________________________
void AliForwardNUATask::Terminate(Option_t */*option*/)
{
return;
}
//_____________________________________________________________________
//
//
// EOF
|
majacQ/up
|
handler/handler_test.go
|
<gh_stars>1000+
package handler
import (
"net/http"
"net/http/httptest"
"os"
"testing"
"github.com/apex/up"
"github.com/tj/assert"
)
func newHandler(t testing.TB, c *up.Config) http.Handler {
h, err := FromConfig(c)
assert.NoError(t, err, "FromConfig")
h, err = New(c, h)
assert.NoError(t, err, "New")
return h
}
func TestNode(t *testing.T) {
os.Chdir("testdata/node")
defer os.Chdir("../..")
c, err := up.ReadConfig("up.json")
assert.NoError(t, err, "read config")
h := newHandler(t, c)
res := httptest.NewRecorder()
req := httptest.NewRequest("GET", "/", nil)
h.ServeHTTP(res, req)
actual := res.Header()
assert.NotEmpty(t, actual.Get("Date"), "date")
actual.Del("Date")
header := make(http.Header)
header.Add("X-Powered-By", "up")
header.Add("X-Robots-Tag", "none")
header.Add("X-Foo", "bar")
header.Add("Content-Length", "11")
header.Add("Content-Type", "text/plain; charset=utf-8")
header.Add("Vary", "Accept-Encoding")
assert.Equal(t, header, actual)
}
func TestStatic(t *testing.T) {
os.Chdir("testdata/static")
defer os.Chdir("../..")
c, err := up.ReadConfig("up.json")
assert.NoError(t, err, "read config")
h := newHandler(t, c)
res := httptest.NewRecorder()
req := httptest.NewRequest("GET", "/", nil)
h.ServeHTTP(res, req)
actual := res.Header()
assert.NotEmpty(t, actual.Get("Last-Modified"), "last-modified")
actual.Del("Last-Modified")
header := make(http.Header)
header.Add("X-Powered-By", "up")
header.Add("X-Robots-Tag", "none")
header.Add("Content-Length", "12")
header.Add("Content-Type", "text/html; charset=utf-8")
header.Add("Accept-Ranges", "bytes")
header.Add("Vary", "Accept-Encoding")
assert.Equal(t, header, actual)
}
func TestNodeWithPackage(t *testing.T) {
os.Chdir("testdata/node-pkg")
defer os.Chdir("../..")
c, err := up.ReadConfig("up.json")
assert.NoError(t, err, "read config")
h := newHandler(t, c)
res := httptest.NewRecorder()
req := httptest.NewRequest("GET", "/", nil)
h.ServeHTTP(res, req)
assert.Equal(t, "Hello World", res.Body.String())
}
func TestNodeWithPackageStart(t *testing.T) {
os.Chdir("testdata/node-pkg-start")
defer os.Chdir("../..")
c, err := up.ReadConfig("up.json")
assert.NoError(t, err, "read config")
h := newHandler(t, c)
res := httptest.NewRecorder()
req := httptest.NewRequest("GET", "/", nil)
h.ServeHTTP(res, req)
assert.Equal(t, "Hello World", res.Body.String())
}
func TestHandler_conditionalGet(t *testing.T) {
os.Chdir("testdata/static")
defer os.Chdir("../..")
c, err := up.ReadConfig("up.json")
assert.NoError(t, err, "read config")
h := newHandler(t, c)
res := httptest.NewRecorder()
req := httptest.NewRequest("GET", "/style.css", nil)
req.Header.Set("If-Modified-Since", "Thu, 27 Jul 2030 03:30:31 GMT")
h.ServeHTTP(res, req)
assert.Equal(t, 304, res.Code)
assert.Equal(t, "", res.Header().Get("Content-Length"))
assert.Equal(t, "", res.Body.String())
}
func TestHandler_rewrite(t *testing.T) {
os.Chdir("testdata/static-rewrites")
defer os.Chdir("../..")
c, err := up.ReadConfig("up.json")
assert.NoError(t, err, "read config")
h := newHandler(t, c)
res := httptest.NewRecorder()
req := httptest.NewRequest("GET", "/docs/ping/guides/alerts", nil)
h.ServeHTTP(res, req)
assert.Equal(t, 200, res.Code)
assert.Equal(t, "14", res.Header().Get("Content-Length"))
assert.Equal(t, "Alerting docs\n", res.Body.String())
}
func TestHandler_redirect(t *testing.T) {
os.Chdir("testdata/static-redirects")
defer os.Chdir("../..")
c, err := up.ReadConfig("up.json")
assert.NoError(t, err, "read config")
h := newHandler(t, c)
res := httptest.NewRecorder()
req := httptest.NewRequest("GET", "/docs/ping/guides/alerts/", nil)
h.ServeHTTP(res, req)
assert.Equal(t, "/help/ping/alerts", res.Header().Get("Location"))
assert.Equal(t, 302, res.Code)
assert.Equal(t, "Found\n", res.Body.String())
}
func TestHandler_spa(t *testing.T) {
os.Chdir("testdata/spa")
defer os.Chdir("../..")
c, err := up.ReadConfig("up.json")
assert.NoError(t, err, "read config")
h := newHandler(t, c)
t.Run("index", func(t *testing.T) {
res := httptest.NewRecorder()
req := httptest.NewRequest("GET", "/", nil)
h.ServeHTTP(res, req)
assert.Equal(t, 200, res.Code)
assert.Equal(t, "Index\n", res.Body.String())
})
t.Run("redirect", func(t *testing.T) {
res := httptest.NewRecorder()
req := httptest.NewRequest("GET", "/index.html", nil)
h.ServeHTTP(res, req)
assert.Equal(t, 301, res.Code)
})
t.Run("file does not exist", func(t *testing.T) {
res := httptest.NewRecorder()
req := httptest.NewRequest("GET", "/something/here", nil)
h.ServeHTTP(res, req)
assert.Equal(t, 200, res.Code)
assert.Equal(t, "Index\n", res.Body.String())
})
t.Run("file exists", func(t *testing.T) {
res := httptest.NewRecorder()
req := httptest.NewRequest("GET", "/app.js", nil)
h.ServeHTTP(res, req)
assert.Equal(t, 200, res.Code)
assert.Equal(t, "app js\n", res.Body.String())
})
t.Run("file exists nested", func(t *testing.T) {
res := httptest.NewRecorder()
req := httptest.NewRequest("GET", "/css/bar.css", nil)
h.ServeHTTP(res, req)
assert.Equal(t, 200, res.Code)
assert.Equal(t, "bar css\n", res.Body.String())
})
}
|
ZGYSYY/study-ActiveMQ
|
example-02/src/main/java/com/zgy/study/example02/JmsSender.java
|
package com.zgy.study.example02;
import org.apache.activemq.ActiveMQConnectionFactory;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import javax.jms.*;
/**
* @author ZGY
* @date 2019/12/13 11:14
* @description JmsSender,发送端。
*/
public class JmsSender {
private static final Logger LOGGER = LoggerFactory.getLogger(JmsSender.class);
public static void main(String[] args) {
// 创建连接工厂
ConnectionFactory connectionFactory = new ActiveMQConnectionFactory("tcp://192.168.1.166:61616");
Connection connection = null;
try {
// 创建连接
connection = connectionFactory.createConnection();
// 开始连接
connection.start();
// 创建会话
Session session = connection.createSession(Boolean.FALSE, Session.CLIENT_ACKNOWLEDGE);
// 创建目标
Destination destination = session.createQueue("queue");
// 创建生产者
MessageProducer producer = session.createProducer(destination);
// 创建消息
TextMessage textMessage = session.createTextMessage("Hello ActiveMQ");
// 发送消息
producer.send(textMessage);
LOGGER.info("发送成功,textMessage:[{}]", textMessage);
// 关闭会话
session.close();
} catch (JMSException e) {
LOGGER.error("创建连接异常!", e);
} finally {
if (connection != null) {
try {
connection.close();
} catch (JMSException e) {
LOGGER.error("关闭连接异常!", e);
}
}
}
}
}
|
kashishgrover/leaf-ui
|
src/Select/web/OptionListItem.js
|
import React from 'react';
import styled from 'styled-components';
import View from '../../View/web';
const styles = {
backgroundColor: (props) => {
if (props.isActive) {
return props.theme.color.translucent;
}
if (props.isSelected) {
return props.theme.color.primaryLighter;
}
return '';
},
};
const OptionListItem = styled(
({
isActive,
isSelected,
...props
}) => <View {...props} />,
)`
background-color: ${styles.backgroundColor};
cursor: ${(props) => props.onClick ? 'pointer' : ''};
pointer-events: ${(props) => props.disabled ? 'none' : ''};
opacity: ${(props) => props.disabled ? '0.5' : ''};
padding: ${(props) => props.theme.px(2)};
`;
export default OptionListItem;
|
junmin-zhu/chromium-rivertrail
|
ash/system/tray_accessibility.h
|
<reponame>junmin-zhu/chromium-rivertrail
// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef ASH_SYSTEM_TRAY_ACCESSIBILITY_H_
#define ASH_SYSTEM_TRAY_ACCESSIBILITY_H_
#include "ash/system/tray/tray_image_item.h"
namespace views {
class ImageView;
class View;
}
namespace ash {
class ASH_EXPORT AccessibilityObserver {
public:
virtual ~AccessibilityObserver() {}
// Notifies when accessibilty mode changes.
virtual void OnAccessibilityModeChanged(bool enabled) = 0;
};
namespace internal {
class TrayAccessibility : public TrayImageItem,
public AccessibilityObserver {
public:
TrayAccessibility();
virtual ~TrayAccessibility();
private:
// Overridden from TrayImageItem.
virtual bool GetInitialVisibility() OVERRIDE;
virtual views::View* CreateDefaultView(user::LoginStatus status) OVERRIDE;
virtual views::View* CreateDetailedView(user::LoginStatus status) OVERRIDE;
virtual void DestroyDefaultView() OVERRIDE;
virtual void DestroyDetailedView() OVERRIDE;
// Overridden from AccessibilityObserver.
virtual void OnAccessibilityModeChanged(bool enabled) OVERRIDE;
views::View* default_;
views::View* detailed_;
DISALLOW_COPY_AND_ASSIGN(TrayAccessibility);
};
} // namespace internal
} // namespace ash
#endif // ASH_SYSTEM_TRAY_ACCESSIBILITY_H_
|
lkostenarov/BugsTracker
|
BugsTrackerWeb/src/bg/bugstracker/web/beans/ListProjectsBean.java
|
package bg.bugstracker.web.beans;
import java.util.List;
import javax.annotation.PostConstruct;
import javax.ejb.EJB;
import javax.faces.bean.ManagedBean;
import javax.faces.bean.ViewScoped;
import bg.bugstracker.entity.ProjectModel;
import bg.bugstracker.service.ProjectServiceLocal;
@ManagedBean(name = "listProjectsBean")
@ViewScoped
public class ListProjectsBean {
@EJB
ProjectServiceLocal projectService;
@PostConstruct
public void init() {
}
public String editAction() {
return "/faces/editProject";
}
public String createAction() {
return "/faces/createProject";
}
public List<ProjectModel> getAllProjects() {
return projectService.findAllProjects();
}
}
|
khoatbui/daiminh.dabook.vn
|
server/models/adslist.model.js
|
<reponame>khoatbui/daiminh.dabook.vn<filename>server/models/adslist.model.js
var mongoose = require('mongoose')
var adsListSchema = new mongoose.Schema({
adsTypeId:{ type: mongoose.Schema.Types.ObjectId, ref: 'AdsType' },
adsCode: String,
adsName: String,
adsIntro: String,
startDate:Date,
endDate:Date,
lang:String,
createBy:String,
createDate:Date,
modifyBy:String,
modifyDate:Date,
adsImages:[{fileName:String,filePath:String,destination:String,size:Number}],
adsImagesWebp:[{fileName:String,filePath:String,destination:String,size:Number}],
order:Number,
keyword:String,
isUsed:Boolean,
isPromotion:Boolean,
adsIntros:[],
star:Number,
link:String,
linkMobile:String,
startDate:Date,
endDate:Date,
ctaId:{ type: mongoose.Schema.Types.ObjectId, ref: 'Cta' },
cta:{},
isAds:Boolean
});
var AdsList =mongoose.model('AdsList',adsListSchema,'adslist');
module.exports = AdsList;
|
MisterZhouZhou/pythonLearn
|
urldownload/DataOutput.py
|
# coding:utf-8
import codecs
class DataOutput(object):
def __init__(self):
self.datas = []
def store_data(self, data):
if data is None:
return
self.datas.append(data)
def output_html(self, path, data):
fout = codecs.open(path, 'w+', encoding='utf-8')
fout.write('<html>')
fout.write('<body>')
for t_data in data:
fout.write(str(t_data))
fout.write('</body>')
fout.write('</html>')
fout.close()
# def output_html(self, **kwargs):
# fout = codecs.open('baike.html', 'w', encoding='utf-8')
# fout.writer('<html>')
# fout.writer('<body>')
# for data in self.datas:
# fout.writer(data)
# fout.writer('</body>')
# fout.writer('</html>')
# fout.close()
|
mkby/cloudbreak
|
core/src/main/java/com/sequenceiq/cloudbreak/converter/stack/StackRequestToStackConverter.java
|
<gh_stars>0
package com.sequenceiq.cloudbreak.converter.stack;
import static com.gs.collections.impl.utility.StringIterate.isEmpty;
import static com.sequenceiq.cloudbreak.cloud.model.Platform.platform;
import static org.apache.commons.lang3.StringUtils.isNoneEmpty;
import java.util.Calendar;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.UUID;
import javax.inject.Inject;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.core.convert.ConversionService;
import org.springframework.stereotype.Component;
import com.google.api.client.repackaged.com.google.common.base.Strings;
import com.google.common.collect.Maps;
import com.sequenceiq.cloudbreak.api.model.DetailedStackStatus;
import com.sequenceiq.cloudbreak.api.model.stack.StackRequest;
import com.sequenceiq.cloudbreak.api.model.stack.instance.InstanceGroupRequest;
import com.sequenceiq.cloudbreak.api.model.stack.instance.InstanceGroupType;
import com.sequenceiq.cloudbreak.cloud.model.Platform;
import com.sequenceiq.cloudbreak.cloud.model.Region;
import com.sequenceiq.cloudbreak.cloud.model.StackInputs;
import com.sequenceiq.cloudbreak.cloud.model.StackTags;
import com.sequenceiq.cloudbreak.common.model.user.CloudbreakUser;
import com.sequenceiq.cloudbreak.common.service.DefaultCostTaggingService;
import com.sequenceiq.cloudbreak.common.type.OrchestratorConstants;
import com.sequenceiq.cloudbreak.controller.exception.BadRequestException;
import com.sequenceiq.cloudbreak.converter.AbstractConversionServiceAwareConverter;
import com.sequenceiq.cloudbreak.core.bootstrap.service.OrchestratorTypeResolver;
import com.sequenceiq.cloudbreak.domain.Credential;
import com.sequenceiq.cloudbreak.domain.FailurePolicy;
import com.sequenceiq.cloudbreak.domain.Network;
import com.sequenceiq.cloudbreak.domain.Orchestrator;
import com.sequenceiq.cloudbreak.domain.StackAuthentication;
import com.sequenceiq.cloudbreak.domain.json.Json;
import com.sequenceiq.cloudbreak.domain.stack.Stack;
import com.sequenceiq.cloudbreak.domain.stack.StackStatus;
import com.sequenceiq.cloudbreak.domain.stack.instance.InstanceGroup;
import com.sequenceiq.cloudbreak.service.CloudbreakException;
import com.sequenceiq.cloudbreak.service.RestRequestThreadLocalService;
import com.sequenceiq.cloudbreak.service.stack.CloudParameterService;
@Component
public class StackRequestToStackConverter extends AbstractConversionServiceAwareConverter<StackRequest, Stack> {
private static final Logger LOGGER = LoggerFactory.getLogger(StackRequestToStackConverter.class);
@Inject
@Qualifier("conversionService")
private ConversionService conversionService;
@Inject
private CloudParameterService cloudParameterService;
@Inject
private OrchestratorTypeResolver orchestratorTypeResolver;
@Inject
private DefaultCostTaggingService defaultCostTaggingService;
@Inject
private RestRequestThreadLocalService restRequestThreadLocalService;
@Value("${cb.platform.default.regions:}")
private String defaultRegions;
@Override
public Stack convert(StackRequest source) {
Stack stack = new Stack();
stack.setName(source.getName());
stack.setDisplayName(source.getName());
stack.setRegion(getRegion(source));
setPlatform(source);
stack.setCloudPlatform(source.getCloudPlatform());
Map<String, String> sourceTags = source.getApplicationTags();
stack.setTags(getTags(mergeTags(sourceTags, source.getUserDefinedTags(),
getDefaultTags(source, restRequestThreadLocalService.getCloudbreakUser()))));
stack.setInputs(getInputs(mergeInputs(source.getCustomInputs())));
preparateSharedServiceProperties(source, stack, sourceTags);
StackAuthentication stackAuthentication = conversionService.convert(source.getStackAuthentication(), StackAuthentication.class);
stack.setStackAuthentication(stackAuthentication);
validateStackAuthentication(source);
stack.setAvailabilityZone(source.getAvailabilityZone());
stack.setOnFailureActionAction(source.getOnFailureAction());
stack.setStackStatus(new StackStatus(stack, DetailedStackStatus.PROVISION_REQUESTED.getStatus(), "", DetailedStackStatus.PROVISION_REQUESTED));
stack.setFailurePolicy(getConversionService().convert(source.getFailurePolicy(), FailurePolicy.class));
stack.setCreated(Calendar.getInstance().getTimeInMillis());
stack.setPlatformVariant(source.getPlatformVariant());
stack.setOrchestrator(getConversionService().convert(source.getOrchestrator(), Orchestrator.class));
if (source.getCredential() != null) {
stack.setCredential(getConversionService().convert(source.getCredential(), Credential.class));
}
Set<InstanceGroup> instanceGroups = convertInstanceGroups(source, stack);
stack.setInstanceGroups(instanceGroups);
if (source.getNetwork() != null) {
stack.setNetwork(getConversionService().convert(source.getNetwork(), Network.class));
}
stack.setCustomDomain(source.getCustomDomain());
stack.setCustomHostname(source.getCustomHostname());
stack.setClusterNameAsSubdomain(source.isClusterNameAsSubdomain());
stack.setHostgroupNameAsHostname(source.isHostgroupNameAsHostname());
stack.setGatewayPort(source.getGatewayPort());
stack.setUuid(UUID.randomUUID().toString());
return stack;
}
private void preparateSharedServiceProperties(StackRequest source, Stack stack, Map<String, String> sourceTags) {
if (sourceTags != null && sourceTags.containsKey("datalakeId")) {
stack.setDatalakeId(Long.valueOf(String.valueOf(sourceTags.get("datalakeId"))));
} else if (source.getClusterToAttach() != null) {
stack.setDatalakeId(source.getClusterToAttach());
}
}
private void validateStackAuthentication(StackRequest source) {
if (source.getStackAuthentication() == null) {
throw new BadRequestException("You should define authentication for stack!");
} else if (Strings.isNullOrEmpty(source.getStackAuthentication().getPublicKey())
&& Strings.isNullOrEmpty(source.getStackAuthentication().getPublicKeyId())) {
throw new BadRequestException("You should define the publickey or publickeyid!");
} else if (source.getStackAuthentication() != null && source.getStackAuthentication().getLoginUserName() != null) {
throw new BadRequestException("You can not modify the default user!");
}
}
private Json getTags(StackTags tags) {
try {
if (tags == null) {
return new Json(new StackTags(new HashMap<>(), new HashMap<>(), new HashMap<>()));
}
return new Json(tags);
} catch (Exception ignored) {
throw new BadRequestException("Failed to convert dynamic tags.");
}
}
private Json getInputs(StackInputs stackInputs) {
try {
if (stackInputs == null) {
return new Json(new StackInputs(new HashMap<>(), new HashMap<>(), new HashMap<>()));
}
return new Json(stackInputs);
} catch (Exception ignored) {
throw new BadRequestException("Failed to convert dynamic inputs.");
}
}
private Map<String, String> getDefaultTags(StackRequest source, CloudbreakUser cbUser) {
Map<String, String> result = new HashMap<>();
try {
result.putAll(defaultCostTaggingService.prepareDefaultTags(cbUser, result, source.getCloudPlatform()));
} catch (Exception e) {
LOGGER.debug("Exception during reading default tags.", e);
}
return result;
}
private StackTags mergeTags(Map<String, String> applicationTags, Map<String, String> userDefinedTags, Map<String, String> defaultTags) {
return new StackTags(userDefinedTags, applicationTags, defaultTags);
}
private StackInputs mergeInputs(Map<String, Object> customInputs) {
return new StackInputs(customInputs, new HashMap<>(), new HashMap<>());
}
private String getRegion(StackRequest source) {
boolean containerOrchestrator;
try {
containerOrchestrator = orchestratorTypeResolver.resolveType(source.getOrchestrator().getType()).containerOrchestrator();
} catch (CloudbreakException ignored) {
throw new BadRequestException("Orchestrator not supported.");
}
if (OrchestratorConstants.YARN.equals(source.getOrchestrator().getType())) {
return OrchestratorConstants.YARN;
}
if (isEmpty(source.getRegion()) && !containerOrchestrator) {
Map<Platform, Region> regions = Maps.newHashMap();
if (isNoneEmpty(defaultRegions)) {
for (String entry : defaultRegions.split(",")) {
String[] keyValue = entry.split(":");
regions.put(platform(keyValue[0]), Region.region(keyValue[1]));
}
Region platformRegion = regions.get(platform(source.getCloudPlatform()));
if (platformRegion == null || isEmpty(platformRegion.value())) {
throw new BadRequestException(String.format("No default region specified for: %s. Region cannot be empty.", source.getCloudPlatform()));
}
return platformRegion.value();
} else {
throw new BadRequestException("No default region is specified. Region cannot be empty.");
}
}
return source.getRegion();
}
private void setPlatform(StackRequest source) {
if (isEmpty(source.getCloudPlatform())) {
if (!isEmpty(source.getPlatformVariant())) {
String platform = cloudParameterService.getPlatformByVariant(source.getPlatformVariant());
source.setCloudPlatform(platform);
}
}
}
private Set<InstanceGroup> convertInstanceGroups(StackRequest source, Stack stack) {
List<InstanceGroupRequest> instanceGroupRequests = source.getInstanceGroups();
Set<InstanceGroup> convertedSet = new HashSet<>();
for (InstanceGroupRequest instanceGroupRequest : instanceGroupRequests) {
InstanceGroup instanceGroup = getConversionService().convert(instanceGroupRequest, InstanceGroup.class);
if (instanceGroup != null) {
convertedSet.add(getConversionService().convert(instanceGroupRequest, InstanceGroup.class));
}
}
boolean gatewaySpecified = false;
for (InstanceGroup instanceGroup : convertedSet) {
instanceGroup.setStack(stack);
if (!gatewaySpecified && InstanceGroupType.GATEWAY.equals(instanceGroup.getInstanceGroupType())) {
gatewaySpecified = true;
}
}
boolean containerOrchestrator;
try {
containerOrchestrator = orchestratorTypeResolver.resolveType(source.getOrchestrator().getType()).containerOrchestrator();
} catch (CloudbreakException ignored) {
throw new BadRequestException("Orchestrator not supported.");
}
if (!gatewaySpecified && !containerOrchestrator) {
throw new BadRequestException("Ambari server must be specified");
}
return convertedSet;
}
}
|
MrRisoni/pbay
|
src/main/java/spring_repos/OrderItemTrackHistoryRepo.java
|
<filename>src/main/java/spring_repos/OrderItemTrackHistoryRepo.java<gh_stars>0
package spring_repos;
import models.orders.OrderItemTrackHistory;
import org.springframework.data.repository.CrudRepository;
import org.springframework.stereotype.Repository;
@Repository
public interface OrderItemTrackHistoryRepo extends CrudRepository<OrderItemTrackHistory,Long> {
}
|
CelestialSystem/ext-web-components
|
packages/ext-web-components-classic/dist/Ext/util/FilterCollection.js
|
import _createClass from "@babel/runtime/helpers/createClass";
import _inheritsLoose from "@babel/runtime/helpers/inheritsLoose";
import Ext_util_Collection from '../../Ext/util/Collection.js';
var Ext_util_FilterCollection = /*#__PURE__*/function (_Ext_util_Collection) {
_inheritsLoose(Ext_util_FilterCollection, _Ext_util_Collection);
Ext_util_FilterCollection.PROPERTIES = function PROPERTIES() {
return ['autoGroup', 'autoSort', 'decoder', 'defaultSortDirection', 'extraKeys', 'filters', 'groupConfig', 'grouper', 'groups', 'keyFn', 'listeners', 'multiSortLimit', 'rootProperty', 'sorters', 'source', 'trackGroups'];
};
Ext_util_FilterCollection.EVENTS = function EVENTS() {
return [{
name: 'add',
parameters: 'collection,details'
}, {
name: 'beforeitemchange',
parameters: 'collection,details'
}, {
name: 'beforesort',
parameters: 'collection,sorters'
}, {
name: 'beginupdate',
parameters: 'collection'
}, {
name: 'endupdate',
parameters: 'collection'
}, {
name: 'itemchange',
parameters: 'collection,details'
}, {
name: 'refresh',
parameters: 'collection'
}, {
name: 'remove',
parameters: 'collection,details'
}, {
name: 'sort',
parameters: 'collection'
}, {
name: 'updatekey',
parameters: 'collection,details'
}, {
name: 'ready',
parameters: 'cmp,cmpObj'
}, {
name: 'created',
parameters: 'cmp'
}];
};
Ext_util_FilterCollection.getProperties = function getProperties(properties) {
properties = properties.concat(Ext_util_FilterCollection.PROPERTIES());
return Ext_util_Collection.getProperties(properties);
};
Ext_util_FilterCollection.getEvents = function getEvents(events) {
events = events.concat(Ext_util_FilterCollection.EVENTS());
return Ext_util_Collection.getEvents(events);
};
_createClass(Ext_util_FilterCollection, null, [{
key: "observedAttributes",
get: function get() {
var attrs = _Ext_util_Collection.observedAttributes;
Ext_util_FilterCollection.PROPERTIES().forEach(function (property, index, array) {
attrs.push(property);
});
Ext_util_FilterCollection.EVENTS().forEach(function (eventparameter, index, array) {
attrs.push('on' + eventparameter.name);
});
return attrs;
}
}]);
function Ext_util_FilterCollection(properties, events) {
return _Ext_util_Collection.call(this, properties.concat(Ext_util_FilterCollection.PROPERTIES()), events.concat(Ext_util_FilterCollection.EVENTS())) || this;
}
var _proto = Ext_util_FilterCollection.prototype;
_proto.connectedCallback = function connectedCallback() {
_Ext_util_Collection.prototype.connectedCallback.call(this);
};
_proto.attributeChangedCallback = function attributeChangedCallback(attrName, oldVal, newVal) {
_Ext_util_Collection.prototype.attributeChangedCallback.call(this, attrName, oldVal, newVal);
};
return Ext_util_FilterCollection;
}(Ext_util_Collection);
export { Ext_util_FilterCollection as default };
|
alainDuguine/OCP12-ClickAndCollect-RestApi
|
clickandcollect-api-business/src/main/java/org/clickandcollect/business/impl/EmailServiceImpl.java
|
package org.clickandcollect.business.impl;
import lombok.extern.slf4j.Slf4j;
import org.clickandcollect.business.contract.EmailService;
import org.clickandcollect.model.entity.ClientOrder;
import org.clickandcollect.model.entity.MenuOrder;
import org.clickandcollect.model.entity.ProductOrder;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.mail.MailException;
import org.springframework.mail.javamail.JavaMailSender;
import org.springframework.mail.javamail.MimeMessageHelper;
import org.springframework.mail.javamail.MimeMessagePreparator;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Service;
import org.thymeleaf.TemplateEngine;
import org.thymeleaf.context.Context;
@Service
@Slf4j
public class EmailServiceImpl implements EmailService {
private final TemplateEngine templateEngine;
private final JavaMailSender mailSender;
@Value("${spring.mail.default-encoding}")
private String encoding;
@Value("${email.username}")
private String EMAIL_USERNAME;
public EmailServiceImpl(TemplateEngine templateEngine, JavaMailSender mailSender) {
this.templateEngine = templateEngine;
this.mailSender = mailSender;
}
private String buildEmailForClientNotification(ClientOrder clientOrder, String template) {
Context context = new Context();
context.setVariable("order", clientOrder);
context.setVariable("totalPrice", getOrderPrice(clientOrder));
return templateEngine.process(template, context);
}
private Double getOrderPrice(ClientOrder clientOrder) {
double price = 0D;
for (ProductOrder product : clientOrder.getProductOrders()) {
price += product.getProduct().getPrice() * product.getQuantity();
}
for (MenuOrder menu : clientOrder.getMenuOrders()) {
price += menu.getMenu().getPrice() * menu.getQuantity();
}
return price;
}
@Async
@Override
public void sendClientOrderNotification(ClientOrder order) {
log.info("Preparing email for client notification");
MimeMessagePreparator messagePreparator = mimeMessage -> {
MimeMessageHelper messageHelper = new MimeMessageHelper(mimeMessage, encoding);
messageHelper.setFrom(EMAIL_USERNAME);
messageHelper.setTo(order.getEmail());
messageHelper.setSubject("Click'n Collect : Votre commande est envoyée !");
String content = this.buildEmailForClientNotification(order, "clientOrderNotificationTemplate");
messageHelper.setText(content, true);
};
try {
log.info("Sending email to {}, for order '{}'", order.getEmail(), order.getId());
mailSender.send(messagePreparator);
} catch (MailException e) {
log.error("Error while sending email to {}, for order '{}'", order.getEmail(), order.getId());
log.error(e.getMessage());
}
}
@Async
@Override
public void sendRestaurantOrderNotification(ClientOrder order) {
log.info("Preparing email for restaurant notification");
MimeMessagePreparator messagePreparator = mimeMessage -> {
MimeMessageHelper messageHelper = new MimeMessageHelper(mimeMessage, encoding);
messageHelper.setFrom(EMAIL_USERNAME);
messageHelper.setTo(order.getRestaurant().getEmail());
messageHelper.setSubject("Click'n Collect : Vous avez reçu une nouvelle commande !");
String content = this.buildEmailForClientNotification(order, "restaurantOrderNotificationTemplate");
messageHelper.setText(content, true);
};
try {
log.info("Sending email to {}, for order '{}'", order.getRestaurant().getEmail(), order.getId());
mailSender.send(messagePreparator);
} catch (MailException e) {
log.error("Error while sending email to {}, for order '{}'", order.getRestaurant().getEmail(), order.getId());
log.error(e.getMessage());
}
}
}
|
MartinItsLinda/SparkyBot
|
src/main/java/uk/sparkydiscordbot/internal/caching/caches/LanguageCache.java
|
package uk.sparkydiscordbot.internal.caching.caches;
import com.google.common.cache.CacheLoader;
import org.jetbrains.annotations.NotNull;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import uk.sparkydiscordbot.api.entities.configuration.GuildSettings;
import uk.sparkydiscordbot.api.entities.language.I18n;
import uk.sparkydiscordbot.api.entities.language.Language;
import uk.sparkydiscordbot.api.entities.language.exception.LanguageNotSupportedException;
import uk.sparkydiscordbot.internal.caching.EntityLoadingCache;
public class LanguageCache extends EntityLoadingCache<String, I18n> {
public LanguageCache(){
super(new LanguageCacheLoader());
}
private static final class LanguageCacheLoader extends CacheLoader<String, I18n> {
private static final Logger LOGGER = LoggerFactory.getLogger(LanguageCacheLoader.class);
@Override
public I18n load(@NotNull(value = "key cannot be null") final String key) {
final GuildSettings settings = GuildSettings.getConfig(key);
final String code = settings.getString("language", "en_GB");
try {
return I18n.getI18n(Language.getByCode(code));
} catch (final LanguageNotSupportedException ignored) {
LOGGER.info(String.format("Guild %s requested an unsupported language: %s", key, code));
}
return I18n.getI18n(Language.ENGLISH);
}
}
}
|
Hillrunner2008/igb-fx
|
org.lorainelab.igb.bookmark/src/main/java/org/lorainelab/igb/bookmarks/manager/BookmarkManager.java
|
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package org.lorainelab.igb.bookmarks.manager;
import org.lorainelab.igb.bookmarks.data.Bookmark;
/**
*
* @author Devdatta
*/
public interface BookmarkManager {
Bookmark getRootBookmark();
void createBookmark();
void createBookmark(Bookmark relativePosition);
void restoreBookmark(Bookmark b);
}
|
maartenba/azure-tools-for-java
|
PluginsAndFeatures/azure-toolkit-for-intellij/azure-intellij-plugin-lib/src/main/java/com/microsoft/azure/toolkit/intellij/common/preload/AzurePreloadingActivity.java
|
/*
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*/
package com.microsoft.azure.toolkit.intellij.common.preload;
import com.intellij.openapi.application.ApplicationManager;
import com.intellij.openapi.application.PreloadingActivity;
import com.intellij.openapi.progress.ProgressIndicator;
import com.microsoft.azure.toolkit.lib.common.cache.Preloader;
import lombok.extern.java.Log;
@Log
public class AzurePreloadingActivity extends PreloadingActivity {
@Override
public void preload(@org.jetbrains.annotations.NotNull final ProgressIndicator indicator) {
// Using progress manager as azure task manager is not initialized
ApplicationManager.getApplication().executeOnPooledThread(Preloader::load);
}
}
|
guandjoy/redject
|
src/landing-page/src/components/docs/Menu.js
|
import React, { useState, useRef, useEffect } from 'react'
import SideBar from './SideBar'
import SandwichButton from './SandwichButton'
function Menu(props) {
const [isVisible, setIsVisible] = useState(false)
const sandwichBtnRef = useRef()
const sideBarRef = useRef()
const handleClickOutside = event => {
// Collapse on click outside of the menu
if (
sandwichBtnRef.current &&
!sandwichBtnRef.current.contains(event.target) &&
!sideBarRef.current.contains(event.target)
) {
setIsVisible(false)
}
}
const handleMenuClick = () => {
// Collapse on menu element click
setIsVisible(false)
}
useEffect(() => {
if (isVisible) {
document.addEventListener('mousedown', handleClickOutside)
} else {
document.removeEventListener('mousedown', handleClickOutside)
}
return () => {
document.removeEventListener('mousedown', handleClickOutside)
}
}, [isVisible])
return (
<div style={{ zIndex: isVisible && '8' }}>
<SideBar sideBarRef={sideBarRef} isVisible={isVisible} />
<SandwichButton
sandwichBtnRef={sandwichBtnRef}
isVisible={isVisible}
setIsVisible={setIsVisible}
/>
</div>
)
}
export default Menu
|
alteryx/alteryx-ui
|
packages/icons/src/icons/unlock.js
|
<gh_stars>1-10
import React from 'react';
import PropTypes from 'prop-types';
// Mui Example:
// https://github.com/mui-org/material-ui/blob/master/packages/material-ui/src/Avatar/Avatar.js#L38
// eslint-disable-next-line prefer-arrow-callback
const Unlock = React.forwardRef(function Unlock(props, ref) {
const { color, size, ...otherProps } = props;
const variantSizes = {
xsmall: 12,
small: 14,
medium: 16,
large: 20,
xlarge: 28,
xxlarge: 36,
};
const newSize = !isNaN(parseInt(size, 10))
? size
: variantSizes[size] !== undefined
? variantSizes[size]
: variantSizes['medium'];
return (
<svg
width={newSize}
height={newSize}
viewBox="0 0 24 24"
{...otherProps}
fill={color}
ref={ref}
>
<path d="M17.928 5.85a1.112 1.112 0 01-2.177.443 3.828 3.828 0 00-7.578.767l-.001 2.842h9.754A4.076 4.076 0 0122 13.98v4.942A4.076 4.076 0 0117.926 23H6.074A4.076 4.076 0 012 18.922V13.98c0-2.21 1.757-4.01 3.95-4.076V7.06a6.05 6.05 0 0111.978-1.21zm-.002 6.276H6.074c-1.023 0-1.852.83-1.852 1.854v4.942c0 1.024.83 1.854 1.852 1.854h11.852c1.023 0 1.852-.83 1.852-1.854V13.98c0-1.024-.83-1.854-1.852-1.854zM12 14.968a1.482 1.482 0 11-.001 2.965A1.482 1.482 0 0112 14.968z" />
</svg>
);
});
Unlock.propTypes = {
color: PropTypes.string,
size: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
};
Unlock.defaultProps = {
color: 'currentColor',
size: '16',
};
// Hard coding component names and render names
Unlock.name = Unlock.render.name || 'Unlock';
export default Unlock;
|
leoluzh/mqtt.client
|
src/test/java/com/lambdasys/iot/mqtt/client/entities/faultcode/FaultCodeMessageTest.java
|
package com.lambdasys.iot.mqtt.client.entities.faultcode;
import static org.testng.Assert.assertNotNull;
import java.io.IOException;
import java.io.Serializable;
import org.testng.annotations.AfterSuite;
import org.testng.annotations.BeforeSuite;
import org.testng.annotations.DataProvider;
import org.testng.annotations.Test;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.lambdasys.iot.mqtt.client.entities.faultcode.FaultCodeDataMessagePayload.FaultStatusCode;
/**
*
* @author <NAME>
* @version 0.1
* @since 11/06/2018
*
*
*/
@SuppressWarnings("serial")
public class FaultCodeMessageTest implements Serializable {
public static final boolean TEST_ENABLED = true;
protected FaultCodeMessage message;
@BeforeSuite(description="Inicializando recursos para teste de FaultCodeMessage...")
public void setUp() {
this.message = FaultCodeMessage.builder().build();;
}
@AfterSuite(description="Finalizando recursos para teste de FaultCodeMessage...")
public void tearDown() {
this.message = null;
}
@DataProvider(name="dataProviderJson")
public Object[][] dataProviderJson(){
//TODO: Verificar documento ... campo swVersion ou appVersion??
return new Object[][] { {
"{ \"data\": [ " +
"{ \"faultDes\": \"Fuel Volume Regulator Control Circuit/Open\", \"faultId\": \"00000001\", \"sysId\": \"ffffffff\", \"faultValue\": \"P0001\", \"faultStatus\": 3 }, " +
"{ \"faultDes\": \"Fuel Volume Regulator Control Circuit Range/Performance\", \"faultId\": \"00000002\", \"sysId\": \"ffffffff\", \"faultValue\": \"P0002\", \"faultStatus\": 3 } " +
" ], " +
"\"lon\": 114.05540500000001, \"lat\": 22.66381333333333, \"trip_sn\":\"123\", \"eventTime\": \"2017-05-03T08:57:11Z\" }"
}};
}
@DataProvider(name="dataProviderObject")
public Object[][] dataProviderObject(){
return new Object[][] {
//TODO: Find something to replace array to list ...
{ FaultCodeMessagePayload.builder()
.eventTime( message.strToDate("2017-05-03T08:57:11Z") ).longitude(114.05540500000001).latitude(22.66381333333333).tripSn("123")
.data( new FaultCodeDataMessagePayload[]{
FaultCodeDataMessagePayload.builder()
.faultDescription("Fuel Volume Regulator Control Circuit/Open")
.faultId("00000001")
.sysId("ffffffff")
.faultValue("P0001")
.faultStatus( FaultStatusCode.fromCode( 3 ) ).build() ,
FaultCodeDataMessagePayload.builder()
.faultDescription("Fuel Volume Regulator Control Circuit Range/Performance")
.faultId("00000002")
.sysId("ffffffff")
.faultValue("P0002")
.faultStatus( FaultStatusCode.fromCode( 3 ) ).build() ,
}).build() } ,
{ FaultCodeMessagePayload.builder()
.eventTime( message.strToDate("2017-05-03T08:57:11Z") ).longitude(114.05540500000001).latitude(22.66381333333333).tripSn("123")
.data( new FaultCodeDataMessagePayload[]{
FaultCodeDataMessagePayload.builder()
.faultDescription("Fuel Volume Regulator Control Circuit/Open")
.faultId("00000001")
.sysId("ffffffff")
.faultValue("P0001")
.faultStatus( FaultStatusCode.fromCode( 3 ) ).build() ,
FaultCodeDataMessagePayload.builder()
.faultDescription("Fuel Volume Regulator Control Circuit Range/Performance")
.faultId("00000002")
.sysId("ffffffff")
.faultValue("P0002")
.faultStatus( FaultStatusCode.fromCode( 3 ) ).build() ,
}).build() } ,
};
}
@Test(
dataProvider="dataProviderObject",
description="Testing Json serialization.",
enabled=FaultCodeMessageTest.TEST_ENABLED)
public void testSerialize( FaultCodeMessagePayload payload ) throws JsonProcessingException {
String json = message.serialize( payload );
System.out.println("Serialize result - " + json );
assertNotNull( json );
}
@Test(dataProvider="dataProviderJson",
description="Testing Json deserialization.",
enabled=FaultCodeMessageTest.TEST_ENABLED)
public void testDeserialize( String json ) throws IOException {
FaultCodeMessagePayload payload = message.deserialize( json );
System.out.println("Deserialize result - " + payload.toString() );
assertNotNull( payload );
}
}
|
jzonthemtn/nlp-building-blocks
|
idyl-e3-entity-extraction-engine/idyl-e3-model-validator/src/test/java/com/mtnfog/test/TestContext.java
|
<reponame>jzonthemtn/nlp-building-blocks
/*******************************************************************************
* Copyright 2019 Mountain Fog, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy
* of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations under
* the License.
******************************************************************************/
package com.mtnfog.test;
import java.util.UUID;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
import com.mtnfog.idyl.e3.metrics.DefaultMetricReporter;
import com.mtnfog.idyl.e3.model.metrics.MetricReporter;
import com.mtnfog.idyl.e3.services.DefaultStatusService;
import com.mtnfog.idyl.e3.stats.ConsoleStatsReporter;
import ai.idylnlp.model.ModelValidator;
import ai.idylnlp.model.nlp.ConfidenceFilter;
import ai.idylnlp.model.stats.StatsReporter;
import ai.idylnlp.nlp.filters.confidence.SimpleConfidenceFilter;
@Configuration
@ComponentScan("com.mtnfog.idyl.e3")
public class TestContext {
@Bean
public String systemId() {
return UUID.randomUUID().toString();
}
@Bean
public StatsReporter statsReporter() {
return new ConsoleStatsReporter(30);
}
@Bean
public ConfidenceFilter getConfidenceFilter() {
return new SimpleConfidenceFilter();
}
@Bean
public DefaultStatusService statusService() {
return new DefaultStatusService();
}
@Bean
public ModelValidator Validator() {
return new TestValidator(true);
}
@Bean
public MetricReporter metricReporter() {
return new DefaultMetricReporter();
}
}
|
corentin-glanum/pickingRoute
|
utils/cluster/simulation_cluster.py
|
<filename>utils/cluster/simulation_cluster.py
from utils.cluster.mapping_cluster import *
from utils.routing.routes import *
# Function
def simulation_wave(y_low, y_high, orders_number, df_orderlines, list_results, distance_threshold, mono_method, multi_method):
''' Simulate the distance for a number of orders per wave'''
# List to store values
[list_wid, list_dst, list_route, list_ord, list_lines, list_pcs, list_monomult] = [list_results[i] for i in range(len(list_results))]
# Variables to store total distance
distance_route = 0
origin_loc = [0, y_low]
# Mapping of orderlines with waves number
df_orderlines, waves_number = df_mapping(df_orderlines, orders_number, distance_threshold, mono_method, multi_method)
# Loop
for wave_id in range(waves_number):
# Listing of all locations for this wave
list_locs, n_locs, n_lines, n_pcs = locations_listing(df_orderlines, wave_id)
# Create picking route
wave_distance, list_chemin, distance_max = create_picking_route_cluster(origin_loc, list_locs, y_low, y_high)
# Total walking distance
distance_route = distance_route + wave_distance
# Results by wave
monomult = mono_method + '-' + multi_method
# Add the results
list_wid, list_dst, list_route, list_ord, list_lines, list_pcs, list_monomult = append_results(list_wid, list_dst, list_route, list_ord, list_lines,
list_pcs, list_monomult, wave_id, wave_distance, list_chemin, orders_number, n_lines, n_pcs, monomult)
# List results
list_results = [list_wid, list_dst, list_route, list_ord, list_lines, list_pcs, list_monomult]
return list_results, distance_route
def loop_wave(y_low, y_high, df_orderlines, list_results, n1, n2, distance_threshold, mono_method, multi_method):
''' Simulate all scenarios for each number of orders per wave'''
# Lists for records
list_ordnum, list_dstw = [], []
lines_number = len(df_orderlines)
# Test several values of orders per wave
for orders_number in range(n1, n2):
# Scenario of orders/wave = orders_number
list_results, distance_route = simulation_wave(y_low, y_high, orders_number, df_orderlines, list_results,
distance_threshold, mono_method, multi_method)
# Append results per Wave
list_ordnum.append(orders_number)
list_dstw.append(distance_route)
print("{} orders/wave: {:,} m".format(orders_number, distance_route))
# Output list
[list_wid, list_dst, list_route, list_ord, list_lines, list_pcs, list_monomult] = [list_results[i] for i in range(len(list_results))]
# Output results per wave
df_results, df_reswave = create_dataframe(list_wid, list_dst, list_route, list_ord,
distance_route, list_lines, list_pcs, list_monomult, list_ordnum, list_dstw)
return list_results, df_reswave
def simulation_cluster(y_low, y_high, df_orderlines, list_results, n1, n2, distance_threshold):
'''Simulate for three scenarios'''
# Loop_wave: Simulation 1
mono_method, multi_method = 'normal', 'normal'
list_results, df_reswave1 = loop_wave(y_low, y_high, df_orderlines, list_results, n1, n2,
distance_threshold, mono_method, multi_method)
# Loop_wave: Simulation 2
mono_method, multi_method = 'clustering', 'normal'
list_results, df_reswave2 = loop_wave(y_low, y_high, df_orderlines, list_results, n1, n2,
distance_threshold, mono_method, multi_method)
# Loop_wave: Simulation 3
mono_method, multi_method = 'clustering', 'clustering'
list_results, df_reswave3 = loop_wave(y_low, y_high, df_orderlines, list_results, n1, n2,
distance_threshold, mono_method, multi_method)
# Expand
[list_wid, list_dst, list_route, list_ord, list_lines, list_pcs, list_monomult] = [list_results[i] for i in range(len(list_results))]
lines_number = len(df_orderlines)
# Results
df_results = pd.DataFrame({'wave_number': list_wid,
'distance': list_dst,
'chemins': list_route,
'order_per_wave': list_ord,
'lines': list_lines,
'pcs': list_pcs,
'mono_multi':list_monomult})
# Final Processing
df_reswave = process_methods(df_reswave1, df_reswave2, df_reswave3, lines_number, distance_threshold)
return df_reswave, df_results
def create_dataframe(list_wid, list_dst, list_route, list_ord, distance_route, list_lines, list_pcs, list_monomult, list_ordnum, list_dstw):
''' Create Dataframes of results'''
# Results by Wave df
df_results = pd.DataFrame({'wave_number': list_wid,
'distance': list_dst,
'chemin': list_route,
'orders_per_wave': list_ord,
'lines': list_lines,
'pcs': list_pcs,
'mono_multi':list_monomult})
# Results by Wave_ID
df_reswave = pd.DataFrame({
'orders_number': list_ordnum,
'distance': list_dstw
})
return df_results, df_reswave
# Append Results
def append_results(list_wid, list_dst, list_route, list_ord, list_lines,
list_pcs, list_monomult, wave_id, wave_distance, list_chemin, orders_number, n_lines, n_pcs, monomult):
list_wid.append(wave_id)
list_dst.append(wave_distance)
list_route.append(list_chemin)
list_ord.append(orders_number)
list_lines.append(n_lines)
list_pcs.append(n_pcs)
list_monomult.append(monomult)
return list_wid, list_dst, list_route, list_ord, list_lines, list_pcs, list_monomult
def process_methods(df_reswave1, df_reswave2, df_reswave3, lines_number, distance_threshold):
''' Process the results of three methods'''
# Concatenate two dataframes for plot
df_reswave1.rename(columns={"distance": "distance_method_1"}, inplace = True)
df_reswave2.rename(columns={"distance": "distance_method_2"}, inplace = True)
df_reswave3.rename(columns={"distance": "distance_method_3"}, inplace = True)
df_reswave = df_reswave1.set_index('orders_number')
# Rename columns
df_reswave['distance_method_2'] = df_reswave2.set_index('orders_number')['distance_method_2']
df_reswave['distance_method_3'] = df_reswave3.set_index('orders_number')['distance_method_3']
df_reswave.reset_index().plot.bar(x = 'orders_number', y = ['distance_method_1', 'distance_method_2', 'distance_method_3'],
figsize=(10, 6), color = ['black', 'red', 'blue'])
plt.title("Picking Route Distance for {:,} Order lines / {} m distance threshold".format(lines_number, distance_threshold))
plt.ylabel('Walking Distance (m)')
plt.xlabel('Orders per Wave (Orders/Wave)')
plt.savefig("static/out/{}lines_{}m_3m.png".format(lines_number, distance_threshold))
plt.show()
return df_reswave
|
TyrfingX/TyrLib
|
com.tyrfing.games.tyrlib3/src/com/tyrfing/games/tyrlib3/view/graphics/materials/Material.java
|
package com.tyrfing.games.tyrlib3.view.graphics.materials;
import java.util.ArrayList;
import java.util.List;
import com.tyrfing.games.tyrlib3.model.graphics.VertexLayout;
import com.tyrfing.games.tyrlib3.model.math.Vector3F;
import com.tyrfing.games.tyrlib3.view.graphics.Mesh;
import com.tyrfing.games.tyrlib3.view.graphics.Param;
import com.tyrfing.games.tyrlib3.view.graphics.Program;
import com.tyrfing.games.tyrlib3.view.graphics.SceneManager;
import com.tyrfing.games.tyrlib3.view.graphics.TyrGL;
/**
* Defines how a mesh is rendered
* @author Sascha
*
*/
public class Material {
public static final int DEFAULT_POSITION_SIZE = 3;
public static final int DEFAULT_POSITION_OFFSET = 0;
/** Which program will be used for the rendering **/
protected Program program;
/** Handle to the position data **/
protected int positionHandle;
/** Layout of the vertices **/
protected VertexLayout vertexLayout = new VertexLayout();
/** Handle to the final display matrix **/
public int mvpMatrixHandle;
/** Name of this material **/
protected String name;
/** This material is affected by lights **/
private boolean lighted = false;
protected String mvpParamName;
protected String positionParamName;
/** Whether or not this material takes animation into account **/
private boolean animated = false;
/** Handle to the bone data **/
protected String boneParam;
/** Handle to the bones used for the vertex **/
protected String boneIndexParam;
/** Handlet to the bone weights used for the vertex **/
protected String boneWeightParam;
protected List<Param> params = new ArrayList<Param>();
/** Number of times an object with this material is required to be rendered **/
private int repeatRender = 1;
/** Flag whether or not to write to the depth buffer **/
public boolean nodepth = false;
/** Flag whether or not an object with this material can cast a shadow **/
protected boolean castShadow = true;
/** Flag indicating if objects with this material are visible **/
private boolean visible = true;
/** Flag indicating if backface culling is disabled or enabled **/
private boolean backfaceCulling = true;
public Material() {
}
public void render(Mesh mesh, float[] modelMatrix) {
setParams();
}
public void addParam(Param param) {
params.add(param);
param.setProgram(program.handle);
}
public void setParams() {
for (int i = 0; i < params.size(); ++i) {
if (params.get(i).paramHandle != -1) {
params.get(i).set(program.handle);
}
}
}
/**
* Sets up how this material will work with the vertex data, what will occur where, etc
* @param strideBytes
* @param positionOffset
* @param positionDataSize
*/
protected void init(int positionOffset, int positionDataSize,
String mvpParamName, String positionParamName) {
this.vertexLayout.setPos(VertexLayout.POSITION, positionOffset);
this.vertexLayout.setSize(VertexLayout.POSITION, positionDataSize);
this.mvpParamName = mvpParamName;
this.positionParamName = positionParamName;
if (!SceneManager.getInstance().getRenderer().isInServerMode()) {
updateHandles();
}
}
public int getByteStride() {
return vertexLayout.getByteStride();
}
public int getPositionOffset() {
return getInfoOffset(VertexLayout.POSITION);
}
public int getPositionSize() {
return getInfoSize(VertexLayout.POSITION);
}
public float[] createVertexData(Vector3F[] points, short[] drawOrder) {
float[] vertexData = new float[getByteStride() * points.length];
int byteStride = getByteStride();
int positionOffset = getPositionOffset();
// Populate the vertex data
for (int i = 0; i < points.length; ++i) {
int pos = byteStride * i + positionOffset;
vertexData[pos + positionOffset + 0] = points[i].x;
vertexData[pos + positionOffset + 1] = points[i].y;
vertexData[pos + positionOffset + 2] = points[i].z;
}
return vertexData;
}
public int getPositionHandle() {
return positionHandle;
}
public int getMVPMatrixHandle() {
return mvpMatrixHandle;
}
public Program getProgram() {
return program;
}
public String getBoneParam() {
return boneParam;
}
public String getBoneIndexParam() {
return boneIndexParam;
}
public String getBoneWeightParam() {
return boneWeightParam;
}
public void setAnimated(boolean animated) {
this.animated = animated;
}
public void setBackfaceCulling(boolean state) {
this.backfaceCulling = state;
}
public Material copy() {
return new Material();
}
public void setProgram(Program program) {
this.program = program;
updateHandles();
}
public void updateHandles() {
mvpMatrixHandle = TyrGL.glGetUniformLocation(program.handle, mvpParamName);
if (mvpMatrixHandle == -1) {
System.out.println("Error: No MVPMatrix with parameter name " + mvpParamName + " found in fragmentshader");
}
positionHandle = TyrGL.glGetAttribLocation(program.handle, positionParamName);
for (int i = 0; i < params.size(); ++i) {
params.get(i).setProgram(program.handle);
}
}
public int getInfoOffset(int info) {
return vertexLayout.getPos(info);
}
public int getInfoSize(int info) {
return vertexLayout.getSize(info);
}
public void addVertexInfo(int info, int offset, int size) {
vertexLayout.setPos(info, offset);
vertexLayout.setSize(info, size);
}
public VertexLayout getVertexLayout() {
return vertexLayout;
}
public void setVertexLayout(VertexLayout layout) {
this.vertexLayout = layout;
}
public void setVisible(boolean visible) {
this.visible = visible;
}
public void setCastShadow(boolean visible) {
this.castShadow = visible;
}
public boolean isCastShadow() {
return castShadow;
}
public boolean isVisible() {
return visible;
}
public boolean isAnimated() {
return animated;
}
public boolean isBackfaceCulling() {
return backfaceCulling;
}
public boolean isLighted() {
return lighted;
}
public void setLighted(boolean lighted) {
this.lighted = lighted;
}
public int getRepeatRender() {
return repeatRender;
}
public void setRepeatRender(int repeatRender) {
this.repeatRender = repeatRender;
}
}
|
FeiZhan/Algo-Collection
|
answers/leetcode/Word Search/Word Search.py
|
<reponame>FeiZhan/Algo-Collection
#@result TLE
class Solution(object):
def exist(self, board, word):
"""
:type board: List[List[str]]
:type word: str
:rtype: bool
"""
for i in range(len(board)):
for j in range(len(board[i])):
if self.dfs(i, j, board, 0, word):
return True
return False
def dfs(self, x, y, board, pos, word):
if x < 0 or x >= len(board) or y < 0 or y >= len(board[x]) or '.' == board[x][y] or pos < 0:
return False
elif pos >= len(word):
return True
elif board[x][y] != word[pos]:
return False
board[x][y] = '.'
if self.dfs(x - 1, y, board, pos + 1, word) or self.dfs(x + 1, y, board, pos + 1, word)or self.dfs(x, y - 1, board, pos + 1, word) or self.dfs(x, y + 1, board, pos + 1, word):
return True
board[x][y] = word[pos]
return False
|
cufyorg/framework
|
src/main/java/cufy/beans/AbstractFullBean.java
|
<gh_stars>1-10
/*
* Copyright 2020 Cufy
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package cufy.beans;
import java.io.IOException;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
import java.io.Serializable;
/**
* An abstraction for the interface {@link FullBean}.
*
* @param <K> the type of keys maintained by this map.
* @param <V> the type of mapped values.
* @author LSafer
* @version 0.1.5
* @since 0.0.1 ~2019.06.11
**/
public abstract class AbstractFullBean<K, V> implements FullBean<K, V>, Serializable {
/**
* A set of the entries of this.
*/
private transient PersistentEntrySet<K, V> entrySet;
/**
* A set of the keys in this.
*/
private transient PersistentKeySet<K> keySet;
/**
* A set of the values in this.
*/
private transient PersistentValues<V> values;
@Override
public EntrySet<K, V> entrySet() {
if (this.entrySet == null)
this.entrySet = PersistingMethods.entrySet(this, this);
return this.entrySet;
}
@Override
public boolean equals(Object object) {
return PersistingMethods.equals(this, this, object);
}
@Override
public int hashCode() {
return PersistingMethods.hashCode(this, this);
}
@Override
public KeySet<K> keySet() {
if (this.keySet == null)
this.keySet = PersistingMethods.keySet(this, this);
return this.keySet;
}
@Override
public String toString() {
return PersistingMethods.toString(this, this);
}
@Override
public Values<V> values() {
if (this.values == null)
this.values = PersistingMethods.values(this, this);
return this.values;
}
@SuppressWarnings("JavaDoc")
private void readObject(ObjectInputStream stream) throws ClassNotFoundException, IOException {
PersistingMethods.readObject(this, this, stream);
}
@SuppressWarnings("JavaDoc")
private void writeObject(ObjectOutputStream stream) throws IOException {
PersistingMethods.writeObject(this, this, stream);
}
}
|
hyurl/fron
|
test/maps/map.js
|
<gh_stars>1-10
Map([["abc","Hello, World!"],[{efg:"Hi, Ayon"},1]])
|
dlin172/Plange
|
source/plc/include/document/PRE_INC.hpp
|
// This file was generated using Parlex's cpp_generator
#ifndef INCLUDED_PRE_INC_HPP
#define INCLUDED_PRE_INC_HPP
#include <optional>
#include <variant>
#include <vector>
#include "erased.hpp"
#include "parlex/detail/abstract_syntax_tree.hpp"
#include "parlex/detail/builtins.hpp"
#include "parlex/detail/document.hpp"
#include "plange_grammar.hpp"
namespace plc {
struct EXPRESSION;
struct IC;
struct PRE_INC {
parlex::detail::document::text<literal_0x2B0x2B_t> dontCare0;
std::vector<erased<IC>> field_1;
erased<EXPRESSION> field_2;
explicit PRE_INC(
parlex::detail::document::text<literal_0x2B0x2B_t> && dontCare0, std::vector<erased<IC>> && field_1, erased<EXPRESSION> && field_2) : dontCare0(std::move(dontCare0)), field_1(std::move(field_1)), field_2(std::move(field_2)) {}
PRE_INC(PRE_INC const & other) = default;
PRE_INC(PRE_INC && move) = default;
static PRE_INC build(parlex::detail::ast_node const & n);
static parlex::detail::state_machine const & state_machine();
};
} // namespace plc
#endif //INCLUDED_PRE_INC_HPP
|
danihegglin/DynDCO
|
src/main/scala/com/signalcollect/util/IntDoubleHashMap.scala
|
/*
* @author <NAME>
*
* Copyright 2014 University of Zurich
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.signalcollect.util
/*
* HashMap Int keys and Double values.
*/
class IntDoubleHashMap(
initialSize: Int = 32768,
rehashFraction: Float = 0.5f) {
assert(initialSize > 0)
final var maxSize = nextPowerOfTwo(initialSize)
assert(1.0f >= rehashFraction && rehashFraction > 0.1f, "Unreasonable rehash fraction.")
assert(maxSize > 0 && maxSize >= initialSize, "Initial size is too large.")
private[this] final var maxElements: Int = (rehashFraction * maxSize).floor.toInt
private[this] final var values = new Array[Double](maxSize)
private[this] final var keys = new Array[Int](maxSize) // 0 means empty
private[this] final var mask = maxSize - 1
final def size: Int = numberOfElements
final def isEmpty: Boolean = numberOfElements == 0
private[this] final var numberOfElements = 0
final def clear {
keys = new Array[Int](maxSize)
numberOfElements = 0
}
def toScalaMap: Map[Int, Double] = {
keys.zip(values).filter(_._1 != 0).toMap
}
private[this] final def tryDouble {
// 1073741824 is the largest size and cannot be doubled anymore.
if (maxSize != 1073741824) {
val oldValues = values
val oldKeys = keys
val oldNumberOfElements = numberOfElements
maxSize *= 2
maxElements = (rehashFraction * maxSize).floor.toInt
values = new Array[Double](maxSize)
keys = new Array[Int](maxSize)
mask = maxSize - 1
numberOfElements = 0
var i = 0
var elementsMoved = 0
while (elementsMoved < oldNumberOfElements) {
val oldKey = oldKeys(i)
if (oldKey != 0) {
put(oldKey, oldValues(i))
elementsMoved += 1
}
i += 1
}
}
}
@inline final def foreach(f: (Int, Double) => Unit) {
var i = 0
var elementsProcessed = 0
while (elementsProcessed < numberOfElements) {
val key = keys(i)
if (key != 0) {
val value = values(i)
f(key, value)
elementsProcessed += 1
}
i += 1
}
}
/**
* Like foreach, but removes the entry after applying the function.
*/
@inline final def process(f: (Int, Double) => Unit) {
var i = 0
var elementsProcessed = 0
while (elementsProcessed < numberOfElements) {
val key = keys(i)
if (key != 0) {
val value = values(i)
f(key, value)
elementsProcessed += 1
keys(i) = 0
}
i += 1
}
numberOfElements = 0
}
final def remove(key: Int) {
remove(key, true)
}
private final def remove(key: Int, optimize: Boolean) {
var position = keyToPosition(key)
var keyAtPosition = keys(position)
while (keyAtPosition != 0 && (key != keyAtPosition)) {
position = (position + 1) & mask
keyAtPosition = keys(position)
}
// We can only remove the entry if it was found.
if (keyAtPosition != 0) {
keys(position) = 0
numberOfElements -= 1
if (optimize) {
optimizeFromPosition((position + 1) & mask)
}
}
}
// Try to reinsert all elements that are not optimally placed until an empty position is found.
// See http://stackoverflow.com/questions/279539/best-way-to-remove-an-entry-from-a-hash-table
private[this] final def optimizeFromPosition(startingPosition: Int) {
var currentPosition = startingPosition
var keyAtPosition = keys(currentPosition)
while (isCurrentPositionOccupied) {
val perfectPositionForEntry = keyToPosition(keyAtPosition)
if (perfectPositionForEntry != currentPosition) {
// We try to optimize the placement of the entry by removing and then reinserting it.
val value = values(currentPosition)
removeCurrentEntry
put(keyAtPosition, value)
}
advance
}
@inline def advance {
currentPosition = ((currentPosition + 1) & mask)
keyAtPosition = keys(currentPosition)
}
@inline def isCurrentPositionOccupied = {
keyAtPosition != 0
}
@inline def removeCurrentEntry {
keys(currentPosition) = 0
numberOfElements -= 1
}
}
@inline final def contains(key: Int): Boolean = {
var position = keyToPosition(key)
var keyAtPosition = keys(position)
while (keyAtPosition != 0 && key != keyAtPosition) {
position = (position + 1) & mask
keyAtPosition = keys(position)
}
if (keyAtPosition != 0) {
true
} else {
false
}
}
final def apply(key: Int) = get(key)
@inline final def get(key: Int): Double = {
var position = keyToPosition(key)
var keyAtPosition = keys(position)
while (keyAtPosition != 0 && key != keyAtPosition) {
position = (position + 1) & mask
keyAtPosition = keys(position)
}
if (keyAtPosition != 0) {
values(position)
} else {
0
}
}
final def update(key: Int, value: Double) {
put(key, value)
}
/**
* Adds 'delta' to the value for key 'key'. If that key had not value so far, assumes that its value was 0.
*/
final def addToValueForKey(key: Int, delta: Double) {
assert(key != 0, "Key cannot be 0")
var position = keyToPosition(key)
var keyAtPosition = keys(position)
while (keyAtPosition != 0 && key != keyAtPosition) {
position = (position + 1) & mask
keyAtPosition = keys(position)
}
val hadExistingEntryForKey = keyAtPosition == key
if (!hadExistingEntryForKey) {
keys(position) = key
values(position) = delta
numberOfElements += 1
if (numberOfElements >= maxElements) {
tryDouble
if (numberOfElements >= maxSize) {
throw new OutOfMemoryError("The hash map is full and cannot be expanded any further.")
}
}
} else {
values(position) = values(position) + delta
}
}
/**
* Key 0 is not allowed!
* Returns if an existing entry was overridden.
*/
def put(key: Int, value: Double): Boolean = {
assert(key != 0, "Key cannot be 0")
var position = keyToPosition(key)
var keyAtPosition = keys(position)
while (keyAtPosition != 0 && key != keyAtPosition) {
position = (position + 1) & mask
keyAtPosition = keys(position)
}
val hadExistingEntryForKey = keyAtPosition == key
if (!hadExistingEntryForKey) {
keys(position) = key
values(position) = value
numberOfElements += 1
if (numberOfElements >= maxElements) {
tryDouble
if (numberOfElements >= maxSize) {
throw new OutOfMemoryError("The hash map is full and cannot be expanded any further.")
}
}
} else {
values(position) = value
}
hadExistingEntryForKey
}
private[this] final def keyToPosition(key: Int) = {
key & mask
}
private[this] final def nextPowerOfTwo(x: Int): Int = {
var r = x - 1
r |= r >> 1
r |= r >> 2
r |= r >> 4
r |= r >> 8
r |= r >> 16
r + 1
}
}
|
apereo-tesuto/tesuto
|
tesuto-ui/src/main/resources/static/ui_lib/message-format/locales.js
|
var MessageFormat = MessageFormat || {};
(function () {
var english_locale = function (n) {
if (n === 1) {
return 'one';
}
return 'other';
};
MessageFormat.locale['none'] = english_locale;
MessageFormat.locale['es'] = english_locale;
})();
|
hewking/MaterialDesignPractice
|
thinkjava/src/main/java/com/example/designpartterns/abrstractfactory/SmsProvider.java
|
package com.example.designpartterns.abrstractfactory;
import com.example.designpartterns.factorymethod.Sender;
import com.example.designpartterns.factorymethod.SmsSender;
/**
* Created by hewking on 2016/11/1.
*/
public class SmsProvider implements Provider {
@Override
public Sender provide() {
return new SmsSender();
}
}
|
ctoesca/redjs
|
dist/Commands/BaseDataset.js
|
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const EventEmitter = require("events");
class BaseDataset extends EventEmitter {
constructor(opt) {
super();
}
getCommandsNames() {
return [];
}
checkArgCount(cmd, args, expected) {
if (args.length !== expected) {
throw new Error('ERR wrong number of arguments for \'' + cmd + '\' command');
}
}
checkMinArgCount(cmd, args, expected) {
if (args.length < expected) {
throw new Error('ERR wrong number of arguments for \'' + cmd + '\' command');
}
}
}
exports.BaseDataset = BaseDataset;
//# sourceMappingURL=BaseDataset.js.map
|
u014427391/ecshop
|
src/taoshop-manager/taoshop-manager-api/src/main/java/com/muses/taoshop/manager/entity/Menu.java
|
package com.muses.taoshop.manager.entity;
import lombok.Data;
import java.util.List;
/**
* <pre>
* 菜单信息实体类
* </pre>
*
* @author nicky
* @version 1.00.00
* <pre>
* 修改记录
* 修改后版本: 修改人: 修改日期: 2018.09.22 12:32 修改内容:
* </pre>
*/
@Data
public class Menu {
/**
* 菜单Id
**
*/
private int menuId;
/**
* 上级Id
*
*/
private int parentId;
/**
* 菜单名称
*
*/
private String menuName;
/**
* 菜单图标
*/
private String menuIcon;
/**
* 菜单uri
*/
private String menuUrl;
/**
* 菜单类型
*/
private String menuType;
/** 菜单排序**/
private String menuOrder;
/**
* 菜单排序
*/
private String menuStatus;
/**
* 子级菜单
*/
private List<Menu> subMenu;
private String target;
/**
* 是否有子级菜单
*/
private boolean hasSubMenu = false;
}
|
tfisher1226/ARIES
|
aries/common/common-jaxws/src/main/java/org/aries/service/jaxws/JAXWSServiceImpl.java
|
<reponame>tfisher1226/ARIES<filename>aries/common/common-jaxws/src/main/java/org/aries/service/jaxws/JAXWSServiceImpl.java
package org.aries.service.jaxws;
import java.lang.reflect.Method;
import javax.annotation.PostConstruct;
import javax.annotation.PreDestroy;
import javax.annotation.Resource;
import javax.jws.WebMethod;
import javax.jws.WebParam;
import javax.jws.WebResult;
import javax.jws.WebService;
import javax.xml.ws.WebServiceContext;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.aries.message.Message;
import org.aries.runtime.BeanContext;
import org.aries.service.ServiceRepository;
import org.aries.util.ReflectionUtil;
import org.aries.util.XStreamUtil;
//@HandlerChain(file = "handlers.xml")
@WebService(serviceName="PortalService", endpointInterface = "org.aries.jaxws.JAXWSService")
//@WebContext(contextRoot="/management-recording", urlPattern="/jaxwsSslService")
public class JAXWSServiceImpl implements JAXWSService {
private static Log log = LogFactory.getLog(JAXWSService.class);
@Resource
private WebServiceContext webServiceContext;
public JAXWSServiceImpl() {
//nothing yet
}
@PostConstruct
protected void postConstruct() {
log.info("postConstruct");
//nothing yet
}
@WebMethod(operationName="invoke", action="urn:invoke")
@WebResult(name = "response")
public String invoke(@WebParam String requestXML) throws Exception {
System.out.println("Received REQUEST:");
System.out.println(requestXML);
Message request = XStreamUtil.toObject(requestXML);
String serviceName = request.getPart("serviceName");
//lookup service of specified name, else return error
ServiceRepository serviceRepository = BeanContext.get("org.aries.serviceRepository");
Object service = serviceRepository.getServiceInstance(serviceName);
if (service == null) {
Message response = new Message();
response.addPart("result", "Service not found: "+serviceName);
String responseXML = XStreamUtil.toXML(response);
return responseXML;
}
//delegate to service for message processing
Message response = processMessage(service, request);
String responseXML = XStreamUtil.toXML(response);
System.out.println("Sending RESPONSE:");
System.out.println(responseXML);
return responseXML;
}
//TODO move this to shared class
protected org.aries.message.Message processMessage(Object service, org.aries.message.Message message) throws Exception {
String methodName = "process";
Class<?>[] parameterTypes = new Class<?>[] { org.aries.message.Message.class };
Object[] parameterValues = new Object[] { message };
Class<?> resultType = Message.class;
Method method = ReflectionUtil.findMethod(service.getClass(), methodName, parameterTypes, resultType);
Object result = ReflectionUtil.invokeMethod(service, method, parameterValues);
org.aries.message.Message response = (org.aries.message.Message) result;
return response;
}
@PreDestroy
protected void preDestroy() {
log.info("preDestroy");
//nothing yet
}
}
|
CubeEngine/Sponge
|
src/main/java/org/spongepowered/common/command/brigadier/context/SpongeCommandContextBuilder.java
|
<filename>src/main/java/org/spongepowered/common/command/brigadier/context/SpongeCommandContextBuilder.java<gh_stars>0
/*
* This file is part of Sponge, licensed under the MIT License (MIT).
*
* Copyright (c) SpongePowered <https://www.spongepowered.org>
* Copyright (c) contributors
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
package org.spongepowered.common.command.brigadier.context;
import com.google.common.collect.ImmutableMap;
import com.google.common.collect.ImmutableSet;
import com.mojang.brigadier.Command;
import com.mojang.brigadier.CommandDispatcher;
import com.mojang.brigadier.RedirectModifier;
import com.mojang.brigadier.context.CommandContextBuilder;
import com.mojang.brigadier.context.ParsedArgument;
import com.mojang.brigadier.context.ParsedCommandNode;
import com.mojang.brigadier.context.StringRange;
import com.mojang.brigadier.context.SuggestionContext;
import com.mojang.brigadier.tree.CommandNode;
import it.unimi.dsi.fastutil.objects.Object2IntOpenHashMap;
import net.kyori.adventure.identity.Identified;
import net.kyori.adventure.identity.Identity;
import net.kyori.adventure.text.Component;
import net.minecraft.command.CommandSource;
import org.checkerframework.checker.nullness.qual.NonNull;
import org.spongepowered.api.command.CommandCause;
import org.spongepowered.api.command.parameter.Parameter;
import org.spongepowered.api.command.parameter.managed.Flag;
import org.spongepowered.api.service.permission.Subject;
import org.spongepowered.common.command.brigadier.tree.SpongeArgumentCommandNode;
import org.spongepowered.common.command.parameter.SpongeParameterKey;
import java.util.ArrayDeque;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.Deque;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.NoSuchElementException;
import java.util.Optional;
import javax.annotation.Nonnull;
public final class SpongeCommandContextBuilder extends CommandContextBuilder<CommandSource>
implements org.spongepowered.api.command.parameter.CommandContext.Builder {
private final boolean isTransactionCopy;
// The Sponge system allows for multiple arguments to be put under the same key.
private final Object2IntOpenHashMap<String> flagMap = new Object2IntOpenHashMap<>();
private final Map<Parameter.Key<?>, Collection<?>> arguments = new HashMap<>();
private RedirectModifier<CommandSource> modifier;
private boolean forks;
private Deque<SpongeCommandContextBuilderTransaction> transaction = null;
private org.spongepowered.api.command.Command.Parameterized currentTargetCommand = null;
public SpongeCommandContextBuilder(
final CommandDispatcher<CommandSource> dispatcher,
final CommandSource source,
final CommandNode<CommandSource> root,
final int start) {
super(dispatcher, source, root, start);
this.isTransactionCopy = false;
}
public SpongeCommandContextBuilder(final SpongeCommandContextBuilder original) {
this(original, false);
}
public SpongeCommandContextBuilder(final SpongeCommandContextBuilder original, final boolean isTransactionCopy) {
super(original.getDispatcher(), original.getSource(), original.getRootNode(), original.getRange().getStart());
this.modifier = original.modifier;
this.forks = original.forks;
this.currentTargetCommand = original.currentTargetCommand;
this.getNodes().addAll(original.getNodes());
this.withChild(original.getChild());
this.withCommand(original.getCommand());
original.getArguments().forEach(this::withArgument);
for (final Map.Entry<Parameter.Key<?>, Collection<?>> arg : original.arguments.entrySet()) {
this.arguments.put(arg.getKey(), new ArrayList<>(arg.getValue()));
}
original.flagMap.object2IntEntrySet().fastForEach(x -> this.flagMap.put(x.getKey(), x.getIntValue()));
this.isTransactionCopy = isTransactionCopy;
}
@SuppressWarnings({"unchecked", "rawtypes"})
public void applySpongeElementsTo(final SpongeCommandContextBuilder builder, final boolean clear) {
if (clear) {
this.flagMap.clear();
this.arguments.clear();
}
this.flagMap.object2IntEntrySet().fastForEach(x -> builder.flagMap.put(x.getKey(), x.getIntValue()));
this.arguments.forEach((key, values) -> builder.arguments.computeIfAbsent(key, k -> new ArrayList<>()).addAll((Collection) values));
this.currentTargetCommand = builder.currentTargetCommand;
}
@Override
public StringRange getRange() {
if (this.transaction != null && !this.transaction.isEmpty()) {
return this.transaction.peek().getCopyBuilder().getRange();
}
return super.getRange();
}
@Override
public CommandSource getSource() {
if (this.transaction != null && !this.transaction.isEmpty()) {
return this.transaction.peek().getCopyBuilder().getSource();
}
return super.getSource();
}
@Override
public Map<String, ParsedArgument<CommandSource, ?>> getArguments() {
if (this.transaction != null && !this.transaction.isEmpty()) {
return this.transaction.peek().getCopyBuilder().getArguments();
}
return super.getArguments();
}
@Override
public CommandContextBuilder<CommandSource> getChild() {
if (this.transaction != null && !this.transaction.isEmpty()) {
return this.transaction.peek().getCopyBuilder().getChild();
}
return super.getChild();
}
@Override
public CommandContextBuilder<CommandSource> getLastChild() {
if (this.transaction != null && !this.transaction.isEmpty()) {
return this.transaction.peek().getCopyBuilder().getLastChild();
}
return super.getLastChild();
}
@Override
public Command<CommandSource> getCommand() {
if (this.transaction != null && !this.transaction.isEmpty()) {
return this.transaction.peek().getCopyBuilder().getCommand();
}
return super.getCommand();
}
@Override
public List<ParsedCommandNode<CommandSource>> getNodes() {
if (this.transaction != null && !this.transaction.isEmpty()) {
return this.transaction.peek().getCopyBuilder().getNodes();
}
return super.getNodes();
}
@Override
public SuggestionContext<CommandSource> findSuggestionContext(final int cursor) {
if (this.transaction != null && !this.transaction.isEmpty()) {
return this.transaction.peek().getCopyBuilder().findSuggestionContext(cursor);
}
// This is the original method, with field access swapped out for method calls
// where appropriate. There is one change marked below.
if (this.getRange().getStart() <= cursor) {
if (this.getRange().getEnd() < cursor) {
if (this.getChild() != null) {
return this.getChild().findSuggestionContext(cursor);
} else if (!this.getNodes().isEmpty()) {
final ParsedCommandNode<CommandSource> last = this.getNodes().get(this.getNodes().size() - 1);
return new SuggestionContext<>(last.getNode(), last.getRange().getEnd() + 1);
} else {
return new SuggestionContext<>(this.getRootNode(), this.getRange().getStart());
}
} else {
CommandNode<CommandSource> prev = this.getRootNode();
for (final ParsedCommandNode<CommandSource> node : this.getNodes()) {
final StringRange nodeRange = node.getRange();
// Sponge Start
if (SpongeCommandContextBuilder.checkNodeCannotBeEmpty(node.getNode(), nodeRange)) {
// Sponge End
if (nodeRange.getStart() <= cursor && cursor <= nodeRange.getEnd()) {
return new SuggestionContext<>(prev, nodeRange.getStart());
}
// Sponge Start: End if
}
// Sponge End
prev = node.getNode();
}
if (prev == null) {
throw new IllegalStateException("Can't find node before cursor");
}
return new SuggestionContext<>(prev, this.getRange().getStart());
}
}
throw new IllegalStateException("Can't find node before cursor");
}
@Override
public SpongeCommandContextBuilder withArgument(final String name, final ParsedArgument<CommandSource, ?> argument) {
// Generic wildcards begone!
return this.withArgumentInternal(name, argument, true);
}
public <T> SpongeCommandContextBuilder withArgumentInternal(final String name, final ParsedArgument<CommandSource, T> argument,
final boolean addToSpongeMap) {
if (this.transaction != null && !this.transaction.isEmpty()) {
return this.transaction.peek().withArgument(name, argument, addToSpongeMap);
}
if (addToSpongeMap) {
final Parameter.Key<T> objectKey = new SpongeParameterKey<>(name, argument.getResult().getClass());
this.addToArgumentMap(objectKey, argument.getResult());
}
super.withArgument(name, argument); // for getArguments and any mods that use this.
return this;
}
@Override
public SpongeCommandContextBuilder withSource(final CommandSource source) {
if (this.transaction != null && !this.transaction.isEmpty()) {
return this.transaction.peek().withSource(source);
}
super.withSource(source);
return this;
}
@Override
public CommandContextBuilder<CommandSource> withNode(final CommandNode<CommandSource> node, final StringRange range) {
if (this.transaction != null && !this.transaction.isEmpty()) {
return this.transaction.peek().withNode(node, range);
}
// Copied up as we need them later.
this.modifier = node.getRedirectModifier();
this.forks = node.isFork();
return super.withNode(node, range);
}
@Override
public CommandContextBuilder<CommandSource> withChild(final CommandContextBuilder<CommandSource> child) {
if (this.transaction != null && !this.transaction.isEmpty()) {
return this.transaction.peek().withChild(child);
}
return super.withChild(child);
}
@Override
public CommandContextBuilder<CommandSource> withCommand(final Command<CommandSource> command) {
if (this.transaction != null && !this.transaction.isEmpty()) {
return this.transaction.peek().withCommand(command);
}
return super.withCommand(command);
}
@Override
public SpongeCommandContextBuilder copy() {
if (this.transaction != null && !this.transaction.isEmpty()) {
return this.transaction.peek().getCopyBuilder().copy();
}
return new SpongeCommandContextBuilder(this);
}
@Override
@NonNull
public Optional<org.spongepowered.api.command.Command.Parameterized> getExecutedCommand() {
if (this.transaction != null && !this.transaction.isEmpty()) {
return this.transaction.peek().getCopyBuilder().getExecutedCommand();
}
return Optional.ofNullable(this.currentTargetCommand);
}
@Override
@NonNull
public CommandCause getCause() {
if (this.transaction != null && !this.transaction.isEmpty()) {
return this.transaction.peek().getCopyBuilder().getCause();
}
return (CommandCause) this.getSource();
}
@Override
public boolean hasFlag(@NonNull final String flagAlias) {
return this.flagMap.containsKey(flagAlias);
}
@Override
public boolean hasFlag(@NonNull final Flag flag) {
return this.flagMap.containsKey(flag.getUnprefixedAliases().iterator().next());
}
@Override
public int getFlagInvocationCount(@NonNull final String flagKey) {
return this.flagMap.getOrDefault(flagKey, 0);
}
@Override
public int getFlagInvocationCount(@NonNull final Flag flag) {
return this.flagMap.getOrDefault(flag.getUnprefixedAliases().iterator().next(), 0);
}
@Override
public boolean hasAny(final Parameter.@NonNull Key<?> key) {
if (this.transaction != null && !this.transaction.isEmpty()) {
return this.transaction.peek().getCopyBuilder().hasAny(key);
}
return this.arguments.containsKey(key);
}
@Override
@NonNull
@SuppressWarnings("unchecked")
public <T> Optional<T> getOne(final Parameter.@NonNull Key<T> key) {
final SpongeParameterKey<T> spongeParameterKey = SpongeParameterKey.getSpongeKey(key);
final Collection<?> collection = this.getFrom(spongeParameterKey);
if (collection.size() > 1) {
throw new IllegalArgumentException("More than one entry was found for " + spongeParameterKey.toString());
}
return Optional.ofNullable((T) collection.iterator().next());
}
@Override
@NonNull
@SuppressWarnings("unchecked")
public <T> T requireOne(final Parameter.@NonNull Key<T> key) throws NoSuchElementException, IllegalArgumentException {
final SpongeParameterKey<T> spongeParameterKey = SpongeParameterKey.getSpongeKey(key);
final Collection<?> collection = this.getFrom(spongeParameterKey);
if (collection.size() > 1) {
throw new IllegalArgumentException("More than one entry was found for " + spongeParameterKey.toString());
} else if (collection.isEmpty()) {
throw new NoSuchElementException("No entry was found for " + spongeParameterKey.toString());
}
return (T) collection.iterator().next();
}
@Override
@NonNull
@SuppressWarnings("unchecked")
public <T> Collection<? extends T> getAll(final Parameter.@NonNull Key<T> key) {
return (Collection<? extends T>) this.getFrom(SpongeParameterKey.getSpongeKey(key));
}
@Override
public boolean hasAny(Parameter.Value<?> parameter) {
return this.hasAny(parameter.getKey());
}
@Override
public <T> Optional<T> getOne(Parameter.Value<T> parameter) throws IllegalArgumentException {
return this.getOne(parameter.getKey());
}
@Override
public <T> T requireOne(Parameter.Value<T> parameter) throws NoSuchElementException, IllegalArgumentException {
return this.requireOne(parameter.getKey());
}
@Override
public <T> Collection<? extends T> getAll(Parameter.Value<T> parameter) {
return this.getAll(parameter.getKey());
}
@Override
public void sendMessage(@NonNull final Identified identity, @NonNull final Component message) {
this.getCause().sendMessage(identity, message);
}
@Override
public void sendMessage(@NonNull final Identity identity, @NonNull final Component message) {
this.getCause().sendMessage(identity, message);
}
Collection<?> getFrom(final SpongeParameterKey<?> key) {
if (this.transaction != null && !this.transaction.isEmpty()) {
return this.transaction.peek().getCopyBuilder().getFrom(key);
}
final Collection<?> collection = this.arguments.get(key);
if (collection == null) {
return ImmutableSet.of();
}
return collection;
}
void addFlagInvocation(@NonNull final String key, final int count) {
this.flagMap.addTo(key, count);
}
@Override
public void addFlagInvocation(@NonNull final Flag flag) {
if (this.transaction != null && !this.transaction.isEmpty()) {
this.transaction.peek().addFlagInvocation(flag);
} else {
flag.getUnprefixedAliases().forEach(x -> this.flagMap.addTo(x, 1));
}
}
@Override
public <T> void putEntry(final Parameter.@NonNull Key<T> key, @NonNull final T object) {
if (this.transaction != null && !this.transaction.isEmpty()) {
this.transaction.peek().putEntry(key, object);
} else {
this.addToArgumentMap(SpongeParameterKey.getSpongeKey(key), object);
}
}
public void setCurrentTargetCommand(final org.spongepowered.api.command.Command.Parameterized command) {
if (this.transaction != null && !this.transaction.isEmpty()) {
this.transaction.peek().setCurrentTargetCommand(command);
} else {
this.currentTargetCommand = command;
}
}
@Override
@NonNull
public Transaction startTransaction() {
if (this.isTransactionCopy) {
throw new IllegalStateException("Cannot start a transaction on a transaction!");
}
if (this.transaction == null) {
this.transaction = new ArrayDeque<>();
}
final SpongeCommandContextBuilderTransaction transaction = SpongeCommandContextBuilderTransaction.getTransactionFromPool(this);
this.transaction.addFirst(transaction);
return transaction;
}
@Override
@NonNull
public SpongeCommandContext build(@NonNull final String input) {
// Commit all transactions first.
while (this.transaction != null && !this.transaction.isEmpty()) {
this.commit(this.transaction.peek());
}
final CommandContextBuilder<CommandSource> child = this.getChild();
return new SpongeCommandContext(
this.getSource(),
input,
this.getArguments(),
ImmutableMap.copyOf(this.arguments),
this.getRootNode(),
this.flagMap,
this.getCommand(),
this.getNodes(),
this.getRange(),
child == null ? null : child.build(input),
this.modifier,
this.forks,
this.currentTargetCommand);
}
@Override
public void commit(@NonNull final Transaction transaction) throws IllegalArgumentException {
if (this.transaction != null && this.transaction.peek() == transaction) {
((SpongeCommandContextBuilderTransaction) transaction).commit();
this.removeTransaction(transaction);
} else {
throw new IllegalArgumentException("The supplied transaction is not the current transaction for this builder!");
}
}
@Override
public void rollback(@Nonnull final Transaction transaction) throws IllegalArgumentException {
if (this.transaction != null && this.transaction.peek() == transaction) {
((SpongeCommandContextBuilderTransaction) transaction).rollback();
this.removeTransaction(transaction);
} else {
throw new IllegalArgumentException("The supplied transaction is not the current transaction for this builder!");
}
}
private void removeTransaction(@NonNull final Transaction transaction) {
if (this.transaction != null && this.transaction.peek() == transaction) {
this.transaction.pop();
}
}
@SuppressWarnings("unchecked")
private <T> void addToArgumentMap(final Parameter.Key<T> key, final T value) {
((List<T>) this.arguments.computeIfAbsent(key, k -> new ArrayList<>())).add(value);
}
private static boolean checkNodeCannotBeEmpty(final CommandNode<CommandSource> node, final StringRange range) {
if (range.getStart() == range.getEnd()) {
return !(node instanceof SpongeArgumentCommandNode && ((SpongeArgumentCommandNode<?>) node).getParser().doesNotRead());
}
return true;
}
@Override
public Subject getSubject() {
return this.getCause().getSubject();
}
}
|
kevindiu/vald
|
internal/params/option.go
|
//
// Copyright (C) 2019-2020 Vdaas.org Vald team ( kpango, rinx, kmrmt )
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// https://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
// Package params provides implementation of Go API for argument parser
package params
type Option func(*parser)
var (
defaultOpts = []Option{
WithConfigFilePathKeys("f", "file", "c", "config"),
WithConfigFilePathDefault("/etc/server/config.yaml"),
WithConfigFileDescription("config file path"),
WithVersionKeys("v", "ver", "version"),
WithVersionFlagDefault(false),
WithVersionDescription("show server version"),
}
)
func WithConfigFilePathKeys(keys ...string) Option {
return func(p *parser) {
p.filePath.keys = append(p.filePath.keys, keys...)
}
}
func WithConfigFilePathDefault(path string) Option {
return func(p *parser) {
p.filePath.defaultPath = path
}
}
func WithConfigFileDescription(desc string) Option {
return func(p *parser) {
p.filePath.description = desc
}
}
func WithVersionKeys(keys ...string) Option {
return func(p *parser) {
p.version.keys = append(p.version.keys, keys...)
}
}
func WithVersionFlagDefault(flag bool) Option {
return func(p *parser) {
p.version.defaultFlag = flag
}
}
func WithVersionDescription(desc string) Option {
return func(p *parser) {
p.version.description = desc
}
}
|
htlcnn/ironpython-stubs
|
release/stubs.min/Autodesk/Revit/DB/__init___parts/InSessionPrintSetting.py
|
<reponame>htlcnn/ironpython-stubs
class InSessionPrintSetting(object,IPrintSetting,IDisposable):
""" Represents the in-session Print Setup (Application Menu->Print->Print Setup) within Autodesk Revit. """
def Dispose(self):
""" Dispose(self: InSessionPrintSetting) """
pass
def ReleaseUnmanagedResources(self,*args):
""" ReleaseUnmanagedResources(self: InSessionPrintSetting,disposing: bool) """
pass
def __enter__(self,*args):
""" __enter__(self: IDisposable) -> object """
pass
def __exit__(self,*args):
""" __exit__(self: IDisposable,exc_type: object,exc_value: object,exc_back: object) """
pass
def __init__(self,*args):
""" x.__init__(...) initializes x; see x.__class__.__doc__ for signaturex.__init__(...) initializes x; see x.__class__.__doc__ for signaturex.__init__(...) initializes x; see x.__class__.__doc__ for signature """
pass
def __repr__(self,*args):
""" __repr__(self: object) -> str """
pass
PrintParameters=property(lambda self: object(),lambda self,v: None,lambda self: None)
"""Returns the Parameters of Print Setup.
Get: PrintParameters(self: InSessionPrintSetting) -> PrintParameters
"""
|
klauza/prototype-animated-app
|
src/components/Secundo/views/Photoshop/CardCSS.js
|
<filename>src/components/Secundo/views/Photoshop/CardCSS.js
import styled from 'styled-components';
export const CardWrapper = styled.div`
width: 100%;
height: 100%;
display: flex;
align-items: center;
justify-content: center;
position: relative;
.c {
position: absolute;
top: 200px;
max-width: 500px;
max-height: 500px;
width: 50ch;
height: 50ch;
cursor: pointer;
// will-change: transform, opacity;
}
.front,
.back {
background-size: cover;
}
.back {
// background-image: url(https://images.unsplash.com/photo-1544511916-0148ccdeb877?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&w=1901&q=80i&auto=format&fit=crop);
}
.front {
// background-image: url(https://images.unsplash.com/photo-1540206395-68808572332f?ixlib=rb-1.2.1&w=1181&q=80&auto=format&fit=crop);
}
`;
|
TuftsVALT/Snowcat
|
node_middleware/socket_listeners/controllers/datasetC/index.js
|
const appRootPath = require("app-root-path");
const Dataset = require(appRootPath + "/Session/Dataset.js");
const Problem = require(appRootPath + "/Session/Problem.js");
const translate = require("./translate.js");
module.exports.set = function(session, socket) {
socket.on("newdataset", function(path) {
console.log("NEWDATASET CALLED!!");
// // "/home/cong/d3mapp/node_middleware/static/local_testing_data/185_baseball",
// let tempStrArr = path.split("/");
// let len = tempStrArr.length;
// let datasetName = tempStrArr[len - 1];
// let datasetPath = path + "/" + datasetName + "_dataset";
console.log("datasetRootPath:", path);
// console.log("datasetName:", datasetName);
const dataset = new Dataset(path);
session.setCurrentDataset(dataset);
let problemPath = dataset.getProblemPath();
if (problemPath) {
let isProblemPath = true;
let problem = new Problem(problemPath, isProblemPath);
session.setCurrentProblem(problem);
} else {
session.setCurrentProblem(null);
console.log("No problemDoc.json exists; not loading any problem.");
}
// try {
// let problem = new Problem(dataset.getProblemPath() + "/problemDoc.json");
// session.setCurrentProblem(problem);
// } catch(e) {
// session.setCurrentProblem(null);
// console.log("No problemDoc.json exists; not loading any problem.", e);
// }
// By Alex. Tell frontend that current dataset has been updated
let dataRoot = dataset.getDatasetPath();
socket.emit("updateCurrentDatasetRootPath", dataRoot);
console.log("updateCurrentDatasetRootPath emitted!!", dataRoot);
});
socket.on("setproblem", function(problemObj) {
console.log("SETPROBLEM CALLED!!");
console.log(">>>>====");
console.log("problemObj is", problemObj);
console.log("====<<<<");
let problemSchema = translate(problemObj, session.getCurrentDataset());
let isProblemPath = false;
session.setCurrentProblem(new Problem(problemSchema, isProblemPath));
});
};
|
kellbyhudson/FTM
|
app/controllers/CoachController.java
|
package controllers;
import com.google.common.io.Files;
import models.Coach;
import models.CoachDetail;
import models.Team;
import play.Logger;
import play.data.DynamicForm;
import play.data.FormFactory;
import play.db.jpa.JPAApi;
import play.db.jpa.Transactional;
import play.mvc.Controller;
import play.mvc.Http;
import play.mvc.Result;
import javax.inject.Inject;
import java.io.File;
import java.util.ArrayList;
import java.util.List;
public class CoachController extends Controller
{
private JPAApi jpaApi;
private FormFactory formFactory;
@Inject
public CoachController(JPAApi jpaApi, FormFactory formFactory)
{
this.jpaApi = jpaApi;
this.formFactory = formFactory;
}
public Result getAddCoach()
{
return ok(views.html.addcoach.render());
}
@Transactional
public Result postAddCoach()
{
DynamicForm form = formFactory.form().bindFromRequest();
String coachName = form.get("coachname");
Integer coachValue = Integer.parseInt(form.get("coachvalue"));
Integer coachSpecialtyId = Integer.parseInt(form.get("coachspecialtyid"));
Integer coachTier = Integer.parseInt(form.get("coachtier"));
String result;
if (coachName.length() <= 50)
{
Coach newCoach = new Coach();
newCoach.setCoachName(coachName);
newCoach.setCoachValue(coachValue);
newCoach.setCoachSpecialtyId(coachSpecialtyId);
newCoach.setCoachTier(coachTier);
Http.MultipartFormData<File> formData = request().body().asMultipartFormData();
Http.MultipartFormData.FilePart<File> filePart = formData.getFile("coachpicture");
File file = filePart.getFile();
byte[] picture;
try
{
picture = Files.toByteArray(file);
if (picture != null && picture.length > 0)
{
newCoach.setCoachPicture(picture);
}
} catch (Exception e)
{
picture = null;
}
jpaApi.em().persist(newCoach);
result = "saved";
}
else
{
result = "not saved";
}
return ok(result);
}
@Transactional
public Result getDraftCoach()
{
String coachSQL = "SELECT c FROM Coach c ORDER BY CoachName";
List<Coach> coaches = jpaApi.em().createQuery(coachSQL, Coach.class).getResultList();
List<CoachDetail> coachDetailList = new ArrayList<>();
for(Coach coach : coaches)
{
CoachDetail coachDetail = new CoachDetail();
coachDetail.setCoachId(coach.getCoachId());
coachDetail.setCoachName(coach.getCoachName());
coachDetail.setCoachTier(coach.getCoachTier());
coachDetail.setCoachValue(coach.getCoachValue());
coachDetail.setCoachSpecialtyId(coach.getCoachSpecialtyId());
coachDetail.setCoachPicture(coach.getCoachPicture());
coachDetailList.add(coachDetail);
}
return ok(views.html.draftcoach.render(coachDetailList));
}
@Transactional
public Result postDraftCoach()
{
DynamicForm form = formFactory.form().bindFromRequest();
String coachId = form.get("Id");
session().put("coachId", coachId);
String result = "";
String teamIdText = session().get("THISteamId");
if (teamIdText == null)
{
result = "/setupteam";
}
else
{
Integer teamId = Integer.parseInt(session().get("THISteamId"));
Logger.debug("teamId is " + teamId);
String teamSQL = "SELECT t FROM Team t WHERE teamId = :teamId ";
Team team = jpaApi.em().createQuery(teamSQL, Team.class).setParameter("teamId", teamId).getSingleResult();
team.setCoachId(Integer.parseInt(coachId));
jpaApi.em().persist(team);
try
{
if (session().get("THISteamId").equals(session().get("MYteamId")))
{
result = "/draftteam";
}
else
{
result = "/managethisteam/";
result += teamIdText;
}
}catch (Exception e)
{
result = "/draftteam";
}
}
return redirect(result);
}
@Transactional(readOnly = true)
public Result getCoachPicture(int coachId)
{
String sql = "SELECT c FROM Coach c WHERE coachId = :coachId";
Coach coach = jpaApi.em().createQuery(sql, Coach.class).setParameter("coachId", coachId).getSingleResult();
return ok(coach.getCoachPicture()).as("image/jpg");
}
@Transactional
public Result getManageCoach()
{
Logger.debug("teamId is " + session().get("MYteamId"));
String coachSQL = "SELECT c FROM Coach c ORDER BY CoachName";
List<Coach> coaches = jpaApi.em().createQuery(coachSQL, Coach.class).getResultList();
Integer teamId = Integer.parseInt(session().get("MYteamId"));
session().put("THISteamId", teamId.toString());
String coachDetailSQL = "SELECT coachId FROM Team t WHERE teamId = :teamId ";
Integer coachId = jpaApi.em().createQuery(coachDetailSQL, Integer.class).setParameter("teamId", teamId).getSingleResult();
CoachDetail coachDetail = new CoachDetail();
coachDetail.setCoachId(coachId);
return ok(views.html.managecoach.render(coaches, coachDetail));
}
public Result postManageCoach()
{
return redirect("/draftcoach");
}
@Transactional
public Result getManageThisCoach(Integer teamId)
{
String coachSQL = "SELECT c FROM Coach c ORDER BY CoachName";
List<Coach> coaches = jpaApi.em().createQuery(coachSQL, Coach.class).getResultList();
session().put("THISteamId", teamId.toString());
String coachDetailSQL = "SELECT coachId FROM Team t WHERE teamId = :teamId ";
Integer coachId = jpaApi.em().createQuery(coachDetailSQL, Integer.class).setParameter("teamId", teamId).getSingleResult();
CoachDetail coachDetail = new CoachDetail();
coachDetail.setCoachId(coachId);
return ok(views.html.managethiscoach.render(coaches, coachDetail));
}
public Result postManageThisCoach(Integer teamId)
{
return redirect("/draftcoach");
}
}
|
JonathanGailliez/azure-sdk-for-python
|
azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/operations/__init__.py
|
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
# --------------------------------------------------------------------------
from .protection_intent_operations import ProtectionIntentOperations
from .backup_status_operations import BackupStatusOperations
from .feature_support_operations import FeatureSupportOperations
from .backup_jobs_operations import BackupJobsOperations
from .job_details_operations import JobDetailsOperations
from .export_jobs_operation_results_operations import ExportJobsOperationResultsOperations
from .jobs_operations import JobsOperations
from .backup_policies_operations import BackupPoliciesOperations
from .backup_protected_items_operations import BackupProtectedItemsOperations
from .backup_usage_summaries_operations import BackupUsageSummariesOperations
from .backup_resource_vault_configs_operations import BackupResourceVaultConfigsOperations
from .backup_engines_operations import BackupEnginesOperations
from .protection_container_refresh_operation_results_operations import ProtectionContainerRefreshOperationResultsOperations
from .protectable_containers_operations import ProtectableContainersOperations
from .protection_containers_operations import ProtectionContainersOperations
from .backup_workload_items_operations import BackupWorkloadItemsOperations
from .protection_container_operation_results_operations import ProtectionContainerOperationResultsOperations
from .protected_items_operations import ProtectedItemsOperations
from .backups_operations import BackupsOperations
from .protected_item_operation_results_operations import ProtectedItemOperationResultsOperations
from .protected_item_operation_statuses_operations import ProtectedItemOperationStatusesOperations
from .recovery_points_operations import RecoveryPointsOperations
from .item_level_recovery_connections_operations import ItemLevelRecoveryConnectionsOperations
from .restores_operations import RestoresOperations
from .job_cancellations_operations import JobCancellationsOperations
from .job_operation_results_operations import JobOperationResultsOperations
from .backup_operation_results_operations import BackupOperationResultsOperations
from .backup_operation_statuses_operations import BackupOperationStatusesOperations
from .protection_policies_operations import ProtectionPoliciesOperations
from .protection_policy_operation_results_operations import ProtectionPolicyOperationResultsOperations
from .protection_policy_operation_statuses_operations import ProtectionPolicyOperationStatusesOperations
from .backup_protectable_items_operations import BackupProtectableItemsOperations
from .backup_protection_containers_operations import BackupProtectionContainersOperations
from .security_pi_ns_operations import SecurityPINsOperations
from .backup_resource_storage_configs_operations import BackupResourceStorageConfigsOperations
from .operations import Operations
__all__ = [
'ProtectionIntentOperations',
'BackupStatusOperations',
'FeatureSupportOperations',
'BackupJobsOperations',
'JobDetailsOperations',
'ExportJobsOperationResultsOperations',
'JobsOperations',
'BackupPoliciesOperations',
'BackupProtectedItemsOperations',
'BackupUsageSummariesOperations',
'BackupResourceVaultConfigsOperations',
'BackupEnginesOperations',
'ProtectionContainerRefreshOperationResultsOperations',
'ProtectableContainersOperations',
'ProtectionContainersOperations',
'BackupWorkloadItemsOperations',
'ProtectionContainerOperationResultsOperations',
'ProtectedItemsOperations',
'BackupsOperations',
'ProtectedItemOperationResultsOperations',
'ProtectedItemOperationStatusesOperations',
'RecoveryPointsOperations',
'ItemLevelRecoveryConnectionsOperations',
'RestoresOperations',
'JobCancellationsOperations',
'JobOperationResultsOperations',
'BackupOperationResultsOperations',
'BackupOperationStatusesOperations',
'ProtectionPoliciesOperations',
'ProtectionPolicyOperationResultsOperations',
'ProtectionPolicyOperationStatusesOperations',
'BackupProtectableItemsOperations',
'BackupProtectionContainersOperations',
'SecurityPINsOperations',
'BackupResourceStorageConfigsOperations',
'Operations',
]
|
dannyroberts/commcare-hq
|
custom/ilsgateway/tanzania/handlers/yes.py
|
from __future__ import absolute_import
from custom.ilsgateway.tanzania.handlers.keyword import KeywordHandler
from custom.ilsgateway.tanzania.reminders import YES_HELP
class YesHandler(KeywordHandler):
def help(self):
return self.handle()
def handle(self):
self.respond(YES_HELP)
return True
|
adeira/sx
|
src/__tests__/fixtures/pseudo-elements.js
|
<filename>src/__tests__/fixtures/pseudo-elements.js<gh_stars>1-10
// @flow
import type { SheetDefinitions } from '../../create';
export default ({
link: {
'textDecoration': 'none',
':hover': {
textDecoration: 'underline',
},
'::after': {
content: '"∞"',
},
'::before': {
content: '"∞"',
},
},
}: SheetDefinitions);
|
Mastaleru/OpenDSU
|
w3cdid/w3cvc/W3CVC_Mixin.js
|
<filename>w3cdid/w3cvc/W3CVC_Mixin.js
/*
JWT_VC the actual implementation of the a JWT based credential
The same approach/interface can be used with credentials represented in other formats
*/
function JWT_VC(){
let serialisation;
/*
Verify that the signature of the issuer is correct
*/
this.load = function(vcSerialisationDocument, callback){
serialisation = vcSerialisationDocument;
};
/*
Verify that the signature of the issuer is correct
*/
this.addClaims = function(claims){
serialisation = vcSerialisationDocument;
};
/*
Verify that the signature of the issuer is correct
*/
this.verify = function(callback){
};
/*
returns the credential in JWT format (signed by the issuerDID)
*/
this.toJWT = function(issuerDID){
};
}
module.exports = JWT_VC;
|
Robbbert/messui
|
src/devices/video/huc6260.h
|
// license:BSD-3-Clause
// copyright-holders:<NAME>
/**********************************************************************
Hudson/NEC HuC6260 interface and definitions
**********************************************************************/
#ifndef MAME_VIDEO_HUC6260_H
#define MAME_VIDEO_HUC6260_H
#pragma once
class huc6260_device : public device_t,
public device_palette_interface,
public device_video_interface
{
public:
static constexpr unsigned PALETTE_SIZE = 1024;
/* Screen timing stuff */
static constexpr unsigned WPF = 1365; // width of a line in frame including blanking areas
static constexpr unsigned LPF = 263; // max number of lines in a single frame
// construction/destruction
huc6260_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
auto next_pixel_data() { return m_next_pixel_data_cb.bind(); }
auto time_til_next_event() { return m_time_til_next_event_cb.bind(); }
auto vsync_changed() { return m_vsync_changed_cb.bind(); }
auto hsync_changed() { return m_hsync_changed_cb.bind(); }
void video_update(bitmap_ind16 &bitmap, const rectangle &cliprect);
uint8_t read(offs_t offset);
void write(offs_t offset, uint8_t data);
uint8_t palette_direct_read(offs_t offset);
void palette_direct_write(offs_t offset, uint8_t data);
protected:
// device-level overrides
virtual void device_start() override;
virtual void device_reset() override;
virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) override;
virtual uint32_t palette_entries() const override { return PALETTE_SIZE; }
private:
void palette_init();
int m_last_h;
int m_last_v;
int m_height;
/* Callback function to retrieve pixel data */
devcb_read16 m_next_pixel_data_cb;
/* TODO: Choose proper types */
/* Callback function to get time until next event */
devcb_read16 m_time_til_next_event_cb;
/* Callback function which gets called when vsync changes */
devcb_write_line m_vsync_changed_cb;
/* Callback function which gets called when hsync changes */
devcb_write_line m_hsync_changed_cb;
uint16_t m_palette[512];
uint16_t m_address;
uint16_t m_greyscales; /* Should the HuC6260 output grey or color graphics */
uint8_t m_blur; /* Should the edges of graphics be blurred/Select screen height 0=262, 1=263 */
uint8_t m_pixels_per_clock; /* Number of pixels to output per colour clock */
uint16_t m_pixel_data;
uint8_t m_pixel_clock;
emu_timer *m_timer;
std::unique_ptr<bitmap_ind16> m_bmp;
};
DECLARE_DEVICE_TYPE(HUC6260, huc6260_device)
#endif // MAME_VIDEO_HUC6260_H
|
olydis/autorest.java
|
test/azurefluent/src/main/java/fixtures/azureresource/implementation/ResourceCollectionInner.java
|
/**
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for
* license information.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is
* regenerated.
*/
package fixtures.azureresource.implementation;
import java.util.List;
import java.util.Map;
import com.fasterxml.jackson.annotation.JsonProperty;
/**
* The ResourceCollectionInner model.
*/
public class ResourceCollectionInner {
/**
* The productresource property.
*/
@JsonProperty(value = "productresource")
private FlattenedProductInner productresource;
/**
* The arrayofresources property.
*/
@JsonProperty(value = "arrayofresources")
private List<FlattenedProductInner> arrayofresources;
/**
* The dictionaryofresources property.
*/
@JsonProperty(value = "dictionaryofresources")
private Map<String, FlattenedProductInner> dictionaryofresources;
/**
* Get the productresource value.
*
* @return the productresource value
*/
public FlattenedProductInner productresource() {
return this.productresource;
}
/**
* Set the productresource value.
*
* @param productresource the productresource value to set
* @return the ResourceCollectionInner object itself.
*/
public ResourceCollectionInner withProductresource(FlattenedProductInner productresource) {
this.productresource = productresource;
return this;
}
/**
* Get the arrayofresources value.
*
* @return the arrayofresources value
*/
public List<FlattenedProductInner> arrayofresources() {
return this.arrayofresources;
}
/**
* Set the arrayofresources value.
*
* @param arrayofresources the arrayofresources value to set
* @return the ResourceCollectionInner object itself.
*/
public ResourceCollectionInner withArrayofresources(List<FlattenedProductInner> arrayofresources) {
this.arrayofresources = arrayofresources;
return this;
}
/**
* Get the dictionaryofresources value.
*
* @return the dictionaryofresources value
*/
public Map<String, FlattenedProductInner> dictionaryofresources() {
return this.dictionaryofresources;
}
/**
* Set the dictionaryofresources value.
*
* @param dictionaryofresources the dictionaryofresources value to set
* @return the ResourceCollectionInner object itself.
*/
public ResourceCollectionInner withDictionaryofresources(Map<String, FlattenedProductInner> dictionaryofresources) {
this.dictionaryofresources = dictionaryofresources;
return this;
}
}
|
yangra/SoftUni
|
Java-DB-Fundamentals/DatabasesFrameworks-Hibernate&SpringData/EXAMS/photography_workshops_exam/src/main/java/softuni/dto/Export/PhotographerLandscaperExportDto.java
|
<reponame>yangra/SoftUni
package softuni.dto.Export;
import com.google.gson.annotations.Expose;
import com.google.gson.annotations.SerializedName;
import softuni.entities.Camera;
import softuni.entities.Lens;
import java.util.Set;
public class PhotographerLandscaperExportDto {
@Expose
@SerializedName(value="FirstName")
private String firstName;
@Expose
@SerializedName(value="LastName")
private String lastName;
@Expose
@SerializedName(value="CameraMake")
private String primaryCameraMake;
@Expose
private Integer LensesCount;
public String getFirstName() {
return firstName;
}
public void setFirstName(String firstName) {
this.firstName = firstName;
}
public String getLastName() {
return lastName;
}
public void setLastName(String lastName) {
this.lastName = lastName;
}
public String getPrimaryCameraMake() {
return primaryCameraMake;
}
public void setPrimaryCameraMake(String primaryCameraMake) {
this.primaryCameraMake = primaryCameraMake;
}
public Integer getLensesCount() {
return LensesCount;
}
public void setLensesCount(Integer lensesCount) {
LensesCount = lensesCount;
}
}
|
akhishukla23/my-parfait
|
parfait-cxf/src/main/java/io/pcp/parfait/cxf/X.java
|
package io.pcp.parfait.cxf;
public class X {
}
|
Nexuscompute/aws-sdk-cpp
|
aws-cpp-sdk-pinpoint-sms-voice-v2/include/aws/pinpoint-sms-voice-v2/model/SendVoiceMessageRequest.h
|
<reponame>Nexuscompute/aws-sdk-cpp<filename>aws-cpp-sdk-pinpoint-sms-voice-v2/include/aws/pinpoint-sms-voice-v2/model/SendVoiceMessageRequest.h
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#pragma once
#include <aws/pinpoint-sms-voice-v2/PinpointSMSVoiceV2_EXPORTS.h>
#include <aws/pinpoint-sms-voice-v2/PinpointSMSVoiceV2Request.h>
#include <aws/core/utils/memory/stl/AWSString.h>
#include <aws/pinpoint-sms-voice-v2/model/VoiceMessageBodyTextType.h>
#include <aws/pinpoint-sms-voice-v2/model/VoiceId.h>
#include <aws/core/utils/memory/stl/AWSMap.h>
#include <utility>
namespace Aws
{
namespace PinpointSMSVoiceV2
{
namespace Model
{
/**
*/
class AWS_PINPOINTSMSVOICEV2_API SendVoiceMessageRequest : public PinpointSMSVoiceV2Request
{
public:
SendVoiceMessageRequest();
// Service request name is the Operation name which will send this request out,
// each operation should has unique request name, so that we can get operation's name from this request.
// Note: this is not true for response, multiple operations may have the same response name,
// so we can not get operation's name from response.
inline virtual const char* GetServiceRequestName() const override { return "SendVoiceMessage"; }
Aws::String SerializePayload() const override;
Aws::Http::HeaderValueCollection GetRequestSpecificHeaders() const override;
/**
* <p>The destination phone number in E.164 format.</p>
*/
inline const Aws::String& GetDestinationPhoneNumber() const{ return m_destinationPhoneNumber; }
/**
* <p>The destination phone number in E.164 format.</p>
*/
inline bool DestinationPhoneNumberHasBeenSet() const { return m_destinationPhoneNumberHasBeenSet; }
/**
* <p>The destination phone number in E.164 format.</p>
*/
inline void SetDestinationPhoneNumber(const Aws::String& value) { m_destinationPhoneNumberHasBeenSet = true; m_destinationPhoneNumber = value; }
/**
* <p>The destination phone number in E.164 format.</p>
*/
inline void SetDestinationPhoneNumber(Aws::String&& value) { m_destinationPhoneNumberHasBeenSet = true; m_destinationPhoneNumber = std::move(value); }
/**
* <p>The destination phone number in E.164 format.</p>
*/
inline void SetDestinationPhoneNumber(const char* value) { m_destinationPhoneNumberHasBeenSet = true; m_destinationPhoneNumber.assign(value); }
/**
* <p>The destination phone number in E.164 format.</p>
*/
inline SendVoiceMessageRequest& WithDestinationPhoneNumber(const Aws::String& value) { SetDestinationPhoneNumber(value); return *this;}
/**
* <p>The destination phone number in E.164 format.</p>
*/
inline SendVoiceMessageRequest& WithDestinationPhoneNumber(Aws::String&& value) { SetDestinationPhoneNumber(std::move(value)); return *this;}
/**
* <p>The destination phone number in E.164 format.</p>
*/
inline SendVoiceMessageRequest& WithDestinationPhoneNumber(const char* value) { SetDestinationPhoneNumber(value); return *this;}
/**
* <p>The origination identity to use for the voice call. This can be the
* PhoneNumber, PhoneNumberId, PhoneNumberArn, PoolId, or PoolArn.</p>
*/
inline const Aws::String& GetOriginationIdentity() const{ return m_originationIdentity; }
/**
* <p>The origination identity to use for the voice call. This can be the
* PhoneNumber, PhoneNumberId, PhoneNumberArn, PoolId, or PoolArn.</p>
*/
inline bool OriginationIdentityHasBeenSet() const { return m_originationIdentityHasBeenSet; }
/**
* <p>The origination identity to use for the voice call. This can be the
* PhoneNumber, PhoneNumberId, PhoneNumberArn, PoolId, or PoolArn.</p>
*/
inline void SetOriginationIdentity(const Aws::String& value) { m_originationIdentityHasBeenSet = true; m_originationIdentity = value; }
/**
* <p>The origination identity to use for the voice call. This can be the
* PhoneNumber, PhoneNumberId, PhoneNumberArn, PoolId, or PoolArn.</p>
*/
inline void SetOriginationIdentity(Aws::String&& value) { m_originationIdentityHasBeenSet = true; m_originationIdentity = std::move(value); }
/**
* <p>The origination identity to use for the voice call. This can be the
* PhoneNumber, PhoneNumberId, PhoneNumberArn, PoolId, or PoolArn.</p>
*/
inline void SetOriginationIdentity(const char* value) { m_originationIdentityHasBeenSet = true; m_originationIdentity.assign(value); }
/**
* <p>The origination identity to use for the voice call. This can be the
* PhoneNumber, PhoneNumberId, PhoneNumberArn, PoolId, or PoolArn.</p>
*/
inline SendVoiceMessageRequest& WithOriginationIdentity(const Aws::String& value) { SetOriginationIdentity(value); return *this;}
/**
* <p>The origination identity to use for the voice call. This can be the
* PhoneNumber, PhoneNumberId, PhoneNumberArn, PoolId, or PoolArn.</p>
*/
inline SendVoiceMessageRequest& WithOriginationIdentity(Aws::String&& value) { SetOriginationIdentity(std::move(value)); return *this;}
/**
* <p>The origination identity to use for the voice call. This can be the
* PhoneNumber, PhoneNumberId, PhoneNumberArn, PoolId, or PoolArn.</p>
*/
inline SendVoiceMessageRequest& WithOriginationIdentity(const char* value) { SetOriginationIdentity(value); return *this;}
/**
* <p>The text to convert to a voice message.</p>
*/
inline const Aws::String& GetMessageBody() const{ return m_messageBody; }
/**
* <p>The text to convert to a voice message.</p>
*/
inline bool MessageBodyHasBeenSet() const { return m_messageBodyHasBeenSet; }
/**
* <p>The text to convert to a voice message.</p>
*/
inline void SetMessageBody(const Aws::String& value) { m_messageBodyHasBeenSet = true; m_messageBody = value; }
/**
* <p>The text to convert to a voice message.</p>
*/
inline void SetMessageBody(Aws::String&& value) { m_messageBodyHasBeenSet = true; m_messageBody = std::move(value); }
/**
* <p>The text to convert to a voice message.</p>
*/
inline void SetMessageBody(const char* value) { m_messageBodyHasBeenSet = true; m_messageBody.assign(value); }
/**
* <p>The text to convert to a voice message.</p>
*/
inline SendVoiceMessageRequest& WithMessageBody(const Aws::String& value) { SetMessageBody(value); return *this;}
/**
* <p>The text to convert to a voice message.</p>
*/
inline SendVoiceMessageRequest& WithMessageBody(Aws::String&& value) { SetMessageBody(std::move(value)); return *this;}
/**
* <p>The text to convert to a voice message.</p>
*/
inline SendVoiceMessageRequest& WithMessageBody(const char* value) { SetMessageBody(value); return *this;}
/**
* <p>Specifies if the MessageBody field contains text or <a
* href="https://docs.aws.amazon.com/polly/latest/dg/what-is.html">speech synthesis
* markup language (SSML)</a>.</p> <ul> <li> <p>TEXT: This is the default value.
* When used the maximum character limit is 3000.</p> </li> <li> <p>SSML: When used
* the maximum character limit is 6000 including SSML tagging.</p> </li> </ul>
*/
inline const VoiceMessageBodyTextType& GetMessageBodyTextType() const{ return m_messageBodyTextType; }
/**
* <p>Specifies if the MessageBody field contains text or <a
* href="https://docs.aws.amazon.com/polly/latest/dg/what-is.html">speech synthesis
* markup language (SSML)</a>.</p> <ul> <li> <p>TEXT: This is the default value.
* When used the maximum character limit is 3000.</p> </li> <li> <p>SSML: When used
* the maximum character limit is 6000 including SSML tagging.</p> </li> </ul>
*/
inline bool MessageBodyTextTypeHasBeenSet() const { return m_messageBodyTextTypeHasBeenSet; }
/**
* <p>Specifies if the MessageBody field contains text or <a
* href="https://docs.aws.amazon.com/polly/latest/dg/what-is.html">speech synthesis
* markup language (SSML)</a>.</p> <ul> <li> <p>TEXT: This is the default value.
* When used the maximum character limit is 3000.</p> </li> <li> <p>SSML: When used
* the maximum character limit is 6000 including SSML tagging.</p> </li> </ul>
*/
inline void SetMessageBodyTextType(const VoiceMessageBodyTextType& value) { m_messageBodyTextTypeHasBeenSet = true; m_messageBodyTextType = value; }
/**
* <p>Specifies if the MessageBody field contains text or <a
* href="https://docs.aws.amazon.com/polly/latest/dg/what-is.html">speech synthesis
* markup language (SSML)</a>.</p> <ul> <li> <p>TEXT: This is the default value.
* When used the maximum character limit is 3000.</p> </li> <li> <p>SSML: When used
* the maximum character limit is 6000 including SSML tagging.</p> </li> </ul>
*/
inline void SetMessageBodyTextType(VoiceMessageBodyTextType&& value) { m_messageBodyTextTypeHasBeenSet = true; m_messageBodyTextType = std::move(value); }
/**
* <p>Specifies if the MessageBody field contains text or <a
* href="https://docs.aws.amazon.com/polly/latest/dg/what-is.html">speech synthesis
* markup language (SSML)</a>.</p> <ul> <li> <p>TEXT: This is the default value.
* When used the maximum character limit is 3000.</p> </li> <li> <p>SSML: When used
* the maximum character limit is 6000 including SSML tagging.</p> </li> </ul>
*/
inline SendVoiceMessageRequest& WithMessageBodyTextType(const VoiceMessageBodyTextType& value) { SetMessageBodyTextType(value); return *this;}
/**
* <p>Specifies if the MessageBody field contains text or <a
* href="https://docs.aws.amazon.com/polly/latest/dg/what-is.html">speech synthesis
* markup language (SSML)</a>.</p> <ul> <li> <p>TEXT: This is the default value.
* When used the maximum character limit is 3000.</p> </li> <li> <p>SSML: When used
* the maximum character limit is 6000 including SSML tagging.</p> </li> </ul>
*/
inline SendVoiceMessageRequest& WithMessageBodyTextType(VoiceMessageBodyTextType&& value) { SetMessageBodyTextType(std::move(value)); return *this;}
/**
* <p>The voice for the <a
* href="https://docs.aws.amazon.com/polly/latest/dg/what-is.html">Amazon Polly</a>
* service to use. By default this is set to "MATTHEW".</p>
*/
inline const VoiceId& GetVoiceId() const{ return m_voiceId; }
/**
* <p>The voice for the <a
* href="https://docs.aws.amazon.com/polly/latest/dg/what-is.html">Amazon Polly</a>
* service to use. By default this is set to "MATTHEW".</p>
*/
inline bool VoiceIdHasBeenSet() const { return m_voiceIdHasBeenSet; }
/**
* <p>The voice for the <a
* href="https://docs.aws.amazon.com/polly/latest/dg/what-is.html">Amazon Polly</a>
* service to use. By default this is set to "MATTHEW".</p>
*/
inline void SetVoiceId(const VoiceId& value) { m_voiceIdHasBeenSet = true; m_voiceId = value; }
/**
* <p>The voice for the <a
* href="https://docs.aws.amazon.com/polly/latest/dg/what-is.html">Amazon Polly</a>
* service to use. By default this is set to "MATTHEW".</p>
*/
inline void SetVoiceId(VoiceId&& value) { m_voiceIdHasBeenSet = true; m_voiceId = std::move(value); }
/**
* <p>The voice for the <a
* href="https://docs.aws.amazon.com/polly/latest/dg/what-is.html">Amazon Polly</a>
* service to use. By default this is set to "MATTHEW".</p>
*/
inline SendVoiceMessageRequest& WithVoiceId(const VoiceId& value) { SetVoiceId(value); return *this;}
/**
* <p>The voice for the <a
* href="https://docs.aws.amazon.com/polly/latest/dg/what-is.html">Amazon Polly</a>
* service to use. By default this is set to "MATTHEW".</p>
*/
inline SendVoiceMessageRequest& WithVoiceId(VoiceId&& value) { SetVoiceId(std::move(value)); return *this;}
/**
* <p>The name of the configuration set to use. This can be either the
* ConfigurationSetName or ConfigurationSetArn.</p>
*/
inline const Aws::String& GetConfigurationSetName() const{ return m_configurationSetName; }
/**
* <p>The name of the configuration set to use. This can be either the
* ConfigurationSetName or ConfigurationSetArn.</p>
*/
inline bool ConfigurationSetNameHasBeenSet() const { return m_configurationSetNameHasBeenSet; }
/**
* <p>The name of the configuration set to use. This can be either the
* ConfigurationSetName or ConfigurationSetArn.</p>
*/
inline void SetConfigurationSetName(const Aws::String& value) { m_configurationSetNameHasBeenSet = true; m_configurationSetName = value; }
/**
* <p>The name of the configuration set to use. This can be either the
* ConfigurationSetName or ConfigurationSetArn.</p>
*/
inline void SetConfigurationSetName(Aws::String&& value) { m_configurationSetNameHasBeenSet = true; m_configurationSetName = std::move(value); }
/**
* <p>The name of the configuration set to use. This can be either the
* ConfigurationSetName or ConfigurationSetArn.</p>
*/
inline void SetConfigurationSetName(const char* value) { m_configurationSetNameHasBeenSet = true; m_configurationSetName.assign(value); }
/**
* <p>The name of the configuration set to use. This can be either the
* ConfigurationSetName or ConfigurationSetArn.</p>
*/
inline SendVoiceMessageRequest& WithConfigurationSetName(const Aws::String& value) { SetConfigurationSetName(value); return *this;}
/**
* <p>The name of the configuration set to use. This can be either the
* ConfigurationSetName or ConfigurationSetArn.</p>
*/
inline SendVoiceMessageRequest& WithConfigurationSetName(Aws::String&& value) { SetConfigurationSetName(std::move(value)); return *this;}
/**
* <p>The name of the configuration set to use. This can be either the
* ConfigurationSetName or ConfigurationSetArn.</p>
*/
inline SendVoiceMessageRequest& WithConfigurationSetName(const char* value) { SetConfigurationSetName(value); return *this;}
/**
* <p>The maximum amount to spend per voice message, in US dollars.</p>
*/
inline const Aws::String& GetMaxPricePerMinute() const{ return m_maxPricePerMinute; }
/**
* <p>The maximum amount to spend per voice message, in US dollars.</p>
*/
inline bool MaxPricePerMinuteHasBeenSet() const { return m_maxPricePerMinuteHasBeenSet; }
/**
* <p>The maximum amount to spend per voice message, in US dollars.</p>
*/
inline void SetMaxPricePerMinute(const Aws::String& value) { m_maxPricePerMinuteHasBeenSet = true; m_maxPricePerMinute = value; }
/**
* <p>The maximum amount to spend per voice message, in US dollars.</p>
*/
inline void SetMaxPricePerMinute(Aws::String&& value) { m_maxPricePerMinuteHasBeenSet = true; m_maxPricePerMinute = std::move(value); }
/**
* <p>The maximum amount to spend per voice message, in US dollars.</p>
*/
inline void SetMaxPricePerMinute(const char* value) { m_maxPricePerMinuteHasBeenSet = true; m_maxPricePerMinute.assign(value); }
/**
* <p>The maximum amount to spend per voice message, in US dollars.</p>
*/
inline SendVoiceMessageRequest& WithMaxPricePerMinute(const Aws::String& value) { SetMaxPricePerMinute(value); return *this;}
/**
* <p>The maximum amount to spend per voice message, in US dollars.</p>
*/
inline SendVoiceMessageRequest& WithMaxPricePerMinute(Aws::String&& value) { SetMaxPricePerMinute(std::move(value)); return *this;}
/**
* <p>The maximum amount to spend per voice message, in US dollars.</p>
*/
inline SendVoiceMessageRequest& WithMaxPricePerMinute(const char* value) { SetMaxPricePerMinute(value); return *this;}
/**
* <p>How long the voice message is valid for. By default this is 72 hours.</p>
*/
inline int GetTimeToLive() const{ return m_timeToLive; }
/**
* <p>How long the voice message is valid for. By default this is 72 hours.</p>
*/
inline bool TimeToLiveHasBeenSet() const { return m_timeToLiveHasBeenSet; }
/**
* <p>How long the voice message is valid for. By default this is 72 hours.</p>
*/
inline void SetTimeToLive(int value) { m_timeToLiveHasBeenSet = true; m_timeToLive = value; }
/**
* <p>How long the voice message is valid for. By default this is 72 hours.</p>
*/
inline SendVoiceMessageRequest& WithTimeToLive(int value) { SetTimeToLive(value); return *this;}
/**
* <p>You can specify custom data in this field. If you do, that data is logged to
* the event destination.</p>
*/
inline const Aws::Map<Aws::String, Aws::String>& GetContext() const{ return m_context; }
/**
* <p>You can specify custom data in this field. If you do, that data is logged to
* the event destination.</p>
*/
inline bool ContextHasBeenSet() const { return m_contextHasBeenSet; }
/**
* <p>You can specify custom data in this field. If you do, that data is logged to
* the event destination.</p>
*/
inline void SetContext(const Aws::Map<Aws::String, Aws::String>& value) { m_contextHasBeenSet = true; m_context = value; }
/**
* <p>You can specify custom data in this field. If you do, that data is logged to
* the event destination.</p>
*/
inline void SetContext(Aws::Map<Aws::String, Aws::String>&& value) { m_contextHasBeenSet = true; m_context = std::move(value); }
/**
* <p>You can specify custom data in this field. If you do, that data is logged to
* the event destination.</p>
*/
inline SendVoiceMessageRequest& WithContext(const Aws::Map<Aws::String, Aws::String>& value) { SetContext(value); return *this;}
/**
* <p>You can specify custom data in this field. If you do, that data is logged to
* the event destination.</p>
*/
inline SendVoiceMessageRequest& WithContext(Aws::Map<Aws::String, Aws::String>&& value) { SetContext(std::move(value)); return *this;}
/**
* <p>You can specify custom data in this field. If you do, that data is logged to
* the event destination.</p>
*/
inline SendVoiceMessageRequest& AddContext(const Aws::String& key, const Aws::String& value) { m_contextHasBeenSet = true; m_context.emplace(key, value); return *this; }
/**
* <p>You can specify custom data in this field. If you do, that data is logged to
* the event destination.</p>
*/
inline SendVoiceMessageRequest& AddContext(Aws::String&& key, const Aws::String& value) { m_contextHasBeenSet = true; m_context.emplace(std::move(key), value); return *this; }
/**
* <p>You can specify custom data in this field. If you do, that data is logged to
* the event destination.</p>
*/
inline SendVoiceMessageRequest& AddContext(const Aws::String& key, Aws::String&& value) { m_contextHasBeenSet = true; m_context.emplace(key, std::move(value)); return *this; }
/**
* <p>You can specify custom data in this field. If you do, that data is logged to
* the event destination.</p>
*/
inline SendVoiceMessageRequest& AddContext(Aws::String&& key, Aws::String&& value) { m_contextHasBeenSet = true; m_context.emplace(std::move(key), std::move(value)); return *this; }
/**
* <p>You can specify custom data in this field. If you do, that data is logged to
* the event destination.</p>
*/
inline SendVoiceMessageRequest& AddContext(const char* key, Aws::String&& value) { m_contextHasBeenSet = true; m_context.emplace(key, std::move(value)); return *this; }
/**
* <p>You can specify custom data in this field. If you do, that data is logged to
* the event destination.</p>
*/
inline SendVoiceMessageRequest& AddContext(Aws::String&& key, const char* value) { m_contextHasBeenSet = true; m_context.emplace(std::move(key), value); return *this; }
/**
* <p>You can specify custom data in this field. If you do, that data is logged to
* the event destination.</p>
*/
inline SendVoiceMessageRequest& AddContext(const char* key, const char* value) { m_contextHasBeenSet = true; m_context.emplace(key, value); return *this; }
/**
* <p>When set to true, the message is checked and validated, but isn't sent to the
* end recipient.</p>
*/
inline bool GetDryRun() const{ return m_dryRun; }
/**
* <p>When set to true, the message is checked and validated, but isn't sent to the
* end recipient.</p>
*/
inline bool DryRunHasBeenSet() const { return m_dryRunHasBeenSet; }
/**
* <p>When set to true, the message is checked and validated, but isn't sent to the
* end recipient.</p>
*/
inline void SetDryRun(bool value) { m_dryRunHasBeenSet = true; m_dryRun = value; }
/**
* <p>When set to true, the message is checked and validated, but isn't sent to the
* end recipient.</p>
*/
inline SendVoiceMessageRequest& WithDryRun(bool value) { SetDryRun(value); return *this;}
private:
Aws::String m_destinationPhoneNumber;
bool m_destinationPhoneNumberHasBeenSet;
Aws::String m_originationIdentity;
bool m_originationIdentityHasBeenSet;
Aws::String m_messageBody;
bool m_messageBodyHasBeenSet;
VoiceMessageBodyTextType m_messageBodyTextType;
bool m_messageBodyTextTypeHasBeenSet;
VoiceId m_voiceId;
bool m_voiceIdHasBeenSet;
Aws::String m_configurationSetName;
bool m_configurationSetNameHasBeenSet;
Aws::String m_maxPricePerMinute;
bool m_maxPricePerMinuteHasBeenSet;
int m_timeToLive;
bool m_timeToLiveHasBeenSet;
Aws::Map<Aws::String, Aws::String> m_context;
bool m_contextHasBeenSet;
bool m_dryRun;
bool m_dryRunHasBeenSet;
};
} // namespace Model
} // namespace PinpointSMSVoiceV2
} // namespace Aws
|
dash-docs/dash-docs.github.io
|
en/doxygen/html/navtreeindex77.js
|
<gh_stars>1-10
var NAVTREEINDEX77 =
{
"validation_8cpp.html#ab6609feb69f04e862bc630153c9c2e8e":[34,0,0,165,145],
"validation_8cpp.html#ab6d68cfd5d324de04347be2061768643":[34,0,0,165,123],
"validation_8cpp.html#ab7a9bd34b5fe878a3623ac1f04e1105c":[34,0,0,165,17],
"validation_8cpp.html#ab8b93839d83c6b741d2264cdccdab90f":[34,0,0,165,10],
"validation_8cpp.html#ab8f57ba6a12959ba146b0f9d556fbd0a":[34,0,0,165,158],
"validation_8cpp.html#aba119985259de99f6ab0b55e91ecb67c":[34,0,0,165,58],
"validation_8cpp.html#abb5a9237942819b45c3159ee787bc79d":[34,0,0,165,131],
"validation_8cpp.html#abc9c65975a473d224b3b97b89d571942":[34,0,0,165,16],
"validation_8cpp.html#abd0f14dc45aa7646b0e081cd5824f8d8":[34,0,0,165,121],
"validation_8cpp.html#abea7dd6e39fc3fe079801b73182264b8":[34,0,0,165,81],
"validation_8cpp.html#ac199fda2eb2ecbe7dfa224eb2a0af8e1":[34,0,0,165,66],
"validation_8cpp.html#ac1b4bb80a66cfa9618210b854266ba69":[34,0,0,165,155],
"validation_8cpp.html#ac1c58e7ff985aa26a43c05aa802c1ed4":[34,0,0,165,112],
"validation_8cpp.html#ac301479b44855e32aa74450b8367aedb":[34,0,0,165,56],
"validation_8cpp.html#ac309099e8f5fdc0aca4fac91e4264dd2":[34,0,0,165,102],
"validation_8cpp.html#ac30ceb3802946c9ea0130be889fb4bc9":[34,0,0,165,110],
"validation_8cpp.html#ac38e65e42c4799a42e2e45c62cd91c19":[34,0,0,165,78],
"validation_8cpp.html#ac4b02ded910c76e51ef707a69115c70b":[34,0,0,165,115],
"validation_8cpp.html#ac89fece9169108d00dd6027169d8d081":[34,0,0,165,57],
"validation_8cpp.html#ac96fbd2931c7ebea9d4041cb9eb93413":[34,0,0,165,97],
"validation_8cpp.html#ac98b87e479f71b7be2b990a10c4ebc2d":[34,0,0,165,91],
"validation_8cpp.html#acb209b9d0e17f884e1fe6c8ee14ebc79":[34,0,0,165,21],
"validation_8cpp.html#acc6a734ed0e106c8fcfd4f0ab6501d0a":[34,0,0,165,108],
"validation_8cpp.html#aceaa7ea4645ff93c1635374e2bfcc2c9":[34,0,0,165,161],
"validation_8cpp.html#acf75b8285912440056948cbe644e1ea2":[34,0,0,165,107],
"validation_8cpp.html#acfbdea59afc1824d0d1c1ff10f17fd53":[34,0,0,165,159],
"validation_8cpp.html#ad16a624dfed17bddcd0901c6d32212ab":[34,0,0,165,84],
"validation_8cpp.html#ad330765289aaf618008089370b0abb5f":[34,0,0,165,143],
"validation_8cpp.html#ad6a438d8b190d5742cc471452da5d709":[34,0,0,165,25],
"validation_8cpp.html#ad8af4b01d966b18d48d8c21858cd7ffb":[34,0,0,165,130],
"validation_8cpp.html#ada1eab9ccd84d9a98f598eba9bd35330":[34,0,0,165,52],
"validation_8cpp.html#adb3030dc3fb35c34bb10776e7d391d1a":[34,0,0,165,23],
"validation_8cpp.html#adc87847be035fb67de8bf116d24ab957":[34,0,0,165,67],
"validation_8cpp.html#addec2c5d20c4c87669492568b6df6615":[34,0,0,165,138],
"validation_8cpp.html#adeb4b9151c69e22165f63162cc43e459":[34,0,0,165,6],
"validation_8cpp.html#adf70cddb5b3b3218a7f22da08dc4a456":[34,0,0,165,61],
"validation_8cpp.html#ae1607adf127df83982532a298fe0a216":[34,0,0,165,63],
"validation_8cpp.html#ae2877520fcc46d869b4f5e9768227e25":[34,0,0,165,8],
"validation_8cpp.html#ae2877520fcc46d869b4f5e9768227e25a5886980c58baf0c7f8c6ae29d210f38c":[34,0,0,165,8,3],
"validation_8cpp.html#ae2877520fcc46d869b4f5e9768227e25a6889d1fb85fcf9b5e11f1e48740efabf":[34,0,0,165,8,0],
"validation_8cpp.html#ae2877520fcc46d869b4f5e9768227e25a6a06c814025cd4514da2455ae3d5fa88":[34,0,0,165,8,2],
"validation_8cpp.html#ae2877520fcc46d869b4f5e9768227e25ad0ad58fd3314f311426789b0bb2a2cba":[34,0,0,165,8,1],
"validation_8cpp.html#ae88ea23b2e483753f7e055283007dd77":[34,0,0,165,53],
"validation_8cpp.html#ae9325f3e96da33dc144d24c88710c79c":[34,0,0,165,118],
"validation_8cpp.html#ae93c8ad45e2ef9438abff483ce5beb23":[34,0,0,165,22],
"validation_8cpp.html#ae9a204d0562eb6ecb002024a97ee8ca3":[34,0,0,165,71],
"validation_8cpp.html#ae9afb0553a9927e26785f4e4806a9892":[34,0,0,165,93],
"validation_8cpp.html#aeaef80b01ee5387f474a63ed23c9cc50":[34,0,0,165,7],
"validation_8cpp.html#aeaef80b01ee5387f474a63ed23c9cc50a4b6c24922aff8a510f83333397b4c9b3":[34,0,0,165,7,2],
"validation_8cpp.html#aeaef80b01ee5387f474a63ed23c9cc50a538a133d18fdc8786c4b0f0e6662f6c5":[34,0,0,165,7,1],
"validation_8cpp.html#aeaef80b01ee5387f474a63ed23c9cc50af732a362dae37684d825e000781628c4":[34,0,0,165,7,0],
"validation_8cpp.html#aeb58edf621890f752a9883c90a785ccf":[34,0,0,165,114],
"validation_8cpp.html#aeccc8c1b7fffcca5d6c0d8486cc9b48b":[34,0,0,165,124],
"validation_8cpp.html#aee79e45a0b167f9b312f83a23880cfbc":[34,0,0,165,83],
"validation_8cpp.html#aeec5391c3d81044fb887645b81803b4b":[34,0,0,165,90],
"validation_8cpp.html#af06f6511b635828ba236c124e00c19ce":[34,0,0,165,69],
"validation_8cpp.html#af415591e25b446badcd45771b5124295":[34,0,0,165,137],
"validation_8cpp.html#af43d57aa8b46a53839777e8b670c9d66":[34,0,0,165,37],
"validation_8cpp.html#af5164f3ffba42b258bac4ad736528029":[34,0,0,165,160],
"validation_8cpp.html#af66174e55ad9bafa7a92e4740db6b575":[34,0,0,165,132],
"validation_8cpp.html#af82c4c71e1b9d464a6663bab532dd7f3":[34,0,0,165,109],
"validation_8cpp.html#afbcd887803daf3d5d8383b6526c6f169":[34,0,0,165,149],
"validation_8cpp.html#afccc404d3f648d7834ee7522ca348b41":[34,0,0,165,79],
"validation_8cpp.html#affe35b6e8f309b357512b1f50c1a99ea":[34,0,0,165,148],
"validation_8cpp_source.html":[34,0,0,165],
"validation_8h.html":[34,0,0,166],
"validation_8h.html#a02b30c0388c5d5276100637f99bf6591":[34,0,0,166,14],
"validation_8h.html#a04e493dc156338a1b2f457f7a7feaaa9":[34,0,0,166,43],
"validation_8h.html#a07684dffd61827b4dc32c8301079feb1":[34,0,0,166,101],
"validation_8h.html#a08a488949c94331319f494baf9138533":[34,0,0,166,154],
"validation_8h.html#a08e44dbb6db8502639f09f72737afd19":[34,0,0,166,93],
"validation_8h.html#a0a0634a396d3b8ca22455aa4158daf48":[34,0,0,166,65],
"validation_8h.html#a0a5d20b52b37981fc0fdc0b9fb1af927":[34,0,0,166,116],
"validation_8h.html#a0bf92b1be4135700eeff6a48f01e3896":[34,0,0,166,143],
"validation_8h.html#a0c24c7dfe29eb0ea62f868e79f818493":[34,0,0,166,40],
"validation_8h.html#a0c4c31af4a876d52f31d171760a9b411":[34,0,0,166,108],
"validation_8h.html#a0d01c135cc5a05475e3dc3910c9888da":[34,0,0,166,17],
"validation_8h.html#a0da4d3bd457259c6128277ae599a5e97":[34,0,0,166,145],
"validation_8h.html#a110953ca9bda0878cda09b9636897335":[34,0,0,166,79],
"validation_8h.html#a1247e36989084fde2d2a7a4d9db74dbc":[34,0,0,166,151],
"validation_8h.html#a12c39e969c9077605ae8a91730fb78d3":[34,0,0,166,53],
"validation_8h.html#a14ff9fb82bd3b6a8d7887f68873cdc4d":[34,0,0,166,23],
"validation_8h.html#a152aa35cceda8e10042cdb2d1e6c3370":[34,0,0,166,61],
"validation_8h.html#a173f79e71650a53a095bc1d88d77d6f9":[34,0,0,166,47],
"validation_8h.html#a1a5a2a93201a25764e8f16b1385b26b2":[34,0,0,166,147],
"validation_8h.html#a1ed8285f0fe3c6799c53265ce72552c8":[34,0,0,166,69],
"validation_8h.html#a1eecd3058c45df997e0f3f9f0a1e13af":[34,0,0,166,98],
"validation_8h.html#a233b408b19b7de5f7508fd4779eed412":[34,0,0,166,66],
"validation_8h.html#a24ab6181de154b29fce977c505ab1142":[34,0,0,166,80],
"validation_8h.html#a255e9fc1ce92b27522640085d3a18494":[34,0,0,166,146],
"validation_8h.html#a274dc9f6f1763cf59469e094a7b546ba":[34,0,0,166,126],
"validation_8h.html#a276b0b56a72df733dda86cfe6322f604":[34,0,0,166,122],
"validation_8h.html#a2874c632b3b462164de12be5abcd9d43":[34,0,0,166,153],
"validation_8h.html#a290fce59049c0951b8eb73f0129bf6f0":[34,0,0,166,44],
"validation_8h.html#a2a4e47ba3a92986a1c2e931b9866dda9":[34,0,0,166,89],
"validation_8h.html#a2b1fec98f6318f76274f831b0d894ca2":[34,0,0,166,54],
"validation_8h.html#a3028c49720732b5f1b558552f468af72":[34,0,0,166,45],
"validation_8h.html#a31f8b0d3c96670151ba997019820e0f4":[34,0,0,166,140],
"validation_8h.html#a32c4ae3ae181d8510133629460c2bf20":[34,0,0,166,155],
"validation_8h.html#a34611d811dff8e38855a3623850c6115":[34,0,0,166,92],
"validation_8h.html#a3491e40b5a69cc8c83374c20080d2657":[34,0,0,166,115],
"validation_8h.html#a38412dd688f31cbca0f6d28a9adc0310":[34,0,0,166,33],
"validation_8h.html#a3843ee238d78926b03630c3e8383b6b1":[34,0,0,166,117],
"validation_8h.html#a38bb6e0c3dcc21268fba23887bde2f4e":[34,0,0,166,102],
"validation_8h.html#a3db9a6c313045e841191037a97268a96":[34,0,0,166,64],
"validation_8h.html#a3e3422927e48f363a50a343329e69bf4":[34,0,0,166,135],
"validation_8h.html#a3fc0c3aaa2c85bc5e3ff69870f69afb7":[34,0,0,166,28],
"validation_8h.html#a41af4f24e6f8ec02a4a6fd7e679acf3d":[34,0,0,166,95],
"validation_8h.html#a42afcf61a20d8754d8285f6a1f958134":[34,0,0,166,131],
"validation_8h.html#a4715ae09273b16a940176a0573764c9a":[34,0,0,166,19],
"validation_8h.html#a471bf3e03e001e88bac5a7e8f1a696be":[34,0,0,166,97],
"validation_8h.html#a4757562fa889f0f4f7e88e096d724adb":[34,0,0,166,103],
"validation_8h.html#a4b0f164432912c7b1b0e3535c13ad01c":[34,0,0,166,15],
"validation_8h.html#a4d4ecf661ddd26f7de646dc932f296b5":[34,0,0,166,81],
"validation_8h.html#a4e6712c44a9b994e9d588cbac295001a":[34,0,0,166,52],
"validation_8h.html#a4e99b85e9375a99204e97df1507d1910":[34,0,0,166,91],
"validation_8h.html#a5289ed91f1daf187bba005dd54d62649":[34,0,0,166,96],
"validation_8h.html#a531eb79ff695289ac9a4f8daf292273c":[34,0,0,166,42],
"validation_8h.html#a56d302143a8ee6c51ce6403af3a2ea7c":[34,0,0,166,127],
"validation_8h.html#a578c1df234b05798180f0235d469a5ba":[34,0,0,166,49],
"validation_8h.html#a57932935ee1c34ac949bd8ba30198208":[34,0,0,166,78],
"validation_8h.html#a5925a10baeee7d4bdce1982bdcbd3bd0":[34,0,0,166,136],
"validation_8h.html#a5b96e8574bd6321c809fcc2b01d16ce5":[34,0,0,166,20],
"validation_8h.html#a5caf4122a735df55a443242fa5ccb5cf":[34,0,0,166,134],
"validation_8h.html#a5d513fc954905589bc2a99da7d51e923":[34,0,0,166,8],
"validation_8h.html#a5df18e7f16a7c3cb6ac8ea991137c5db":[34,0,0,166,144],
"validation_8h.html#a5ed86cbbedb72d8fcec0524f2792ada8":[34,0,0,166,68],
"validation_8h.html#a5edcd96316574fd4a7f3ae0922a5cfd6":[34,0,0,166,36],
"validation_8h.html#a61b00efa2a8025aa5030639530c56a8f":[34,0,0,166,22],
"validation_8h.html#a65f5c61d9949e5fad4ea81f0b07e40cd":[34,0,0,166,130],
"validation_8h.html#a6a5f8bb0345ec6edd56c7ff2ee6665db":[34,0,0,166,12],
"validation_8h.html#a6b569217f0bbb0a69a42c8769df06a06":[34,0,0,166,112],
"validation_8h.html#a6b962fe256607627c8140021ae7a23e1":[34,0,0,166,3],
"validation_8h.html#a6c4cdbe1187f6a81a29994adb8791db1":[34,0,0,166,114],
"validation_8h.html#a6cb9692522ea533161204264849df858":[34,0,0,166,11],
"validation_8h.html#a6cee75436117a7a79d4e0bc5b87bc2a6":[34,0,0,166,124],
"validation_8h.html#a6df609da0bad1550cbb2cdc781ad2904":[34,0,0,166,10],
"validation_8h.html#a6f0b300ef73713f3150ec3dcf2ac23ce":[34,0,0,166,84],
"validation_8h.html#a6fa1de5affc196945a6b9a634f98d0ed":[34,0,0,166,24],
"validation_8h.html#a74fceefcae777a9b342194ecc25386dd":[34,0,0,166,88],
"validation_8h.html#a751114a714075a2a620f6bedfc36fef3":[34,0,0,166,149],
"validation_8h.html#a769a355f46457c5203bf33a3fe0be368":[34,0,0,166,142],
"validation_8h.html#a7725a9cdef7f65f84b084d43b4a312ef":[34,0,0,166,21],
"validation_8h.html#a77a17dcfb43cece2a434c0a9bfe9e441":[34,0,0,166,132],
"validation_8h.html#a81d9ced51eb72d4df66abddb00318b64":[34,0,0,166,7],
"validation_8h.html#a8404f26b97eec49682f6c6b64a3c8930":[34,0,0,166,34],
"validation_8h.html#a8483db75666c2a1d231108b125b0b3bf":[34,0,0,166,62],
"validation_8h.html#a86ed1d2d0837b905d74c2e4192b6c06a":[34,0,0,166,18],
"validation_8h.html#a876af1dac889f691c946ee77cb290217":[34,0,0,166,6],
"validation_8h.html#a8b6fddfd4e56e9c3e73c5dc0cf4de80c":[34,0,0,166,55],
"validation_8h.html#a90b905d0fe6143ea605a4b09ff0eed6a":[34,0,0,166,83],
"validation_8h.html#a937f07adefc02197ce8938461fef2fa0":[34,0,0,166,74],
"validation_8h.html#a94e4229be690e18de591c10b133a931a":[34,0,0,166,120],
"validation_8h.html#a96680fea6f816a51a18d938394f06394":[34,0,0,166,4],
"validation_8h.html#a972e7e14e99d20fdd0f7e19933e93fd0":[34,0,0,166,111],
"validation_8h.html#a98597d505d0e8c99870eeda3db92f42f":[34,0,0,166,63],
"validation_8h.html#a99eebc094a00665b02ab8656aec15490":[34,0,0,166,25],
"validation_8h.html#a9b7ddfd4f0d7209e290f1b5871b9b81e":[34,0,0,166,71],
"validation_8h.html#aa597978e5628b461b272c75aa28eb531":[34,0,0,166,38],
"validation_8h.html#aa8ed8d08421c7cdfb3acb22e585468fd":[34,0,0,166,106],
"validation_8h.html#aa94e6fe0feee1012d0865e1f5294d2ed":[34,0,0,166,59],
"validation_8h.html#ab09d93e1af00f3df58bd87bbb171e928":[34,0,0,166,118],
"validation_8h.html#ab3d3252ad7773f86035217d3a08f16ba":[34,0,0,166,107],
"validation_8h.html#aba119985259de99f6ab0b55e91ecb67c":[34,0,0,166,32],
"validation_8h.html#aba158ed531d2972c6679d272e3e12531":[34,0,0,166,73],
"validation_8h.html#abb5a9237942819b45c3159ee787bc79d":[34,0,0,166,138],
"validation_8h.html#abc71256f703e47c9254093e32ed2994c":[34,0,0,166,133],
"validation_8h.html#abea7dd6e39fc3fe079801b73182264b8":[34,0,0,166,48],
"validation_8h.html#ac199fda2eb2ecbe7dfa224eb2a0af8e1":[34,0,0,166,37],
"validation_8h.html#ac1b4bb80a66cfa9618210b854266ba69":[34,0,0,166,148],
"validation_8h.html#ac1c58e7ff985aa26a43c05aa802c1ed4":[34,0,0,166,104],
"validation_8h.html#ac301479b44855e32aa74450b8367aedb":[34,0,0,166,30],
"validation_8h.html#ac309099e8f5fdc0aca4fac91e4264dd2":[34,0,0,166,67],
"validation_8h.html#ac30cba28d8b99d42860e735cb56649cb":[34,0,0,166,121],
"validation_8h.html#ac3b9ab4f7df2c87ba020a0a455c929aa":[34,0,0,166,13],
"validation_8h.html#ac4b02ded910c76e51ef707a69115c70b":[34,0,0,166,110],
"validation_8h.html#ac7954adc09c56448d090edfd61dc4845":[34,0,0,166,82],
"validation_8h.html#ac89fece9169108d00dd6027169d8d081":[34,0,0,166,31],
"validation_8h.html#ac909f3ad4a4e10849acaa2e41a9f769b":[34,0,0,166,86],
"validation_8h.html#ac96fbd2931c7ebea9d4041cb9eb93413":[34,0,0,166,60],
"validation_8h.html#ac98b87e479f71b7be2b990a10c4ebc2d":[34,0,0,166,57],
"validation_8h.html#acc576d09fdf7bf11e878a178f15d4a1a":[34,0,0,166,125],
"validation_8h.html#acc6a734ed0e106c8fcfd4f0ab6501d0a":[34,0,0,166,100],
"validation_8h.html#acf75b8285912440056948cbe644e1ea2":[34,0,0,166,99],
"validation_8h.html#acfbdea59afc1824d0d1c1ff10f17fd53":[34,0,0,166,150],
"validation_8h.html#ad16a624dfed17bddcd0901c6d32212ab":[34,0,0,166,51],
"validation_8h.html#ad4d4718d1ec747708a31bc47aaa66578":[34,0,0,166,123],
"validation_8h.html#ad5b0498448ee44bbe095e908ef127d71":[34,0,0,166,70],
"validation_8h.html#ad6eb96b7e6ece92beb10db25e66ce607":[34,0,0,166,72],
"validation_8h.html#ad8af4b01d966b18d48d8c21858cd7ffb":[34,0,0,166,137],
"validation_8h.html#ada1eab9ccd84d9a98f598eba9bd35330":[34,0,0,166,26],
"validation_8h.html#ada8aee85537e2ecec5aaf34af8d56e67":[34,0,0,166,77],
"validation_8h.html#adb7b04c54228efef3b7bbafd0830839e":[34,0,0,166,39],
"validation_8h.html#adc3f70c72854e43426e097b125693cc5":[34,0,0,166,76],
"validation_8h.html#adea951730b49ef41e5390df5be8d3f1b":[34,0,0,166,41],
"validation_8h.html#adf3a2eef0a7ce0071f4d00a4ddf26943":[34,0,0,166,9],
"validation_8h.html#adf70cddb5b3b3218a7f22da08dc4a456":[34,0,0,166,35],
"validation_8h.html#ae034ec95ea656e6d994828c1f5d7d596":[34,0,0,166,75],
"validation_8h.html#ae3377c351f05649e07963776ba3a0499":[34,0,0,166,105],
"validation_8h.html#ae62f71fbc880d892968f6276e0b806aa":[34,0,0,166,29],
"validation_8h.html#ae88ea23b2e483753f7e055283007dd77":[34,0,0,166,27],
"validation_8h.html#ae90d2acb26fa19fdcd983626b0d37d0b":[34,0,0,166,128],
"validation_8h.html#ae9325f3e96da33dc144d24c88710c79c":[34,0,0,166,113],
"validation_8h.html#ae98e9fff288e3029a25765a7f924d960":[34,0,0,166,152],
"validation_8h.html#ae9afb0553a9927e26785f4e4806a9892":[34,0,0,166,58],
"validation_8h.html#aeb58edf621890f752a9883c90a785ccf":[34,0,0,166,109],
"validation_8h.html#aeccc8c1b7fffcca5d6c0d8486cc9b48b":[34,0,0,166,119],
"validation_8h.html#aedb9221f2ca4011d66300ae83cdb4ef4":[34,0,0,166,87],
"validation_8h.html#aee79e45a0b167f9b312f83a23880cfbc":[34,0,0,166,50],
"validation_8h.html#aeec5391c3d81044fb887645b81803b4b":[34,0,0,166,56],
"validation_8h.html#af25f847703143dc2fb6e0e6b9f912d10":[34,0,0,166,85],
"validation_8h.html#af43d57aa8b46a53839777e8b670c9d66":[34,0,0,166,16],
"validation_8h.html#af5d546187468b42e0b10bbe5fdeef2e0":[34,0,0,166,90],
"validation_8h.html#af66174e55ad9bafa7a92e4740db6b575":[34,0,0,166,141],
"validation_8h.html#af83a9cbb7b3fe9d34a7c4b43f2e040f8":[34,0,0,166,129],
"validation_8h.html#af85443f3a75c46fd4d5533943e664287":[34,0,0,166,5],
"validation_8h.html#af8945f7f19ea7e938baab1bd4c226c2f":[34,0,0,166,139],
"validation_8h.html#afcafeb9c0286f4d62a11fce48f46d625":[34,0,0,166,94],
"validation_8h.html#afccc404d3f648d7834ee7522ca348b41":[34,0,0,166,46],
"validation_8h_source.html":[34,0,0,166],
"validationinterface_8cpp.html":[34,0,0,167],
"validationinterface_8cpp.html#a0aaad62c8654cb1868295e0682b05866":[34,0,0,167,2],
"validationinterface_8cpp.html#a4deaca6ee57d3c8a69f04baef3f679aa":[34,0,0,167,7],
"validationinterface_8cpp.html#a581c542f0900a185a20a25d7df4b9c78":[34,0,0,167,1],
"validationinterface_8cpp.html#a5e1776de1f87b4d045e9e2a198236b63":[34,0,0,167,6],
"validationinterface_8cpp.html#a8fe3fbf8c47cc0419fd7b9a14e8b140d":[34,0,0,167,5],
"validationinterface_8cpp.html#ade8ef59282b5f7521ecfd870a8e3b137":[34,0,0,167,3],
"validationinterface_8cpp.html#aef788fda8c339bb297d6f97f431dfa88":[34,0,0,167,4],
"validationinterface_8cpp_source.html":[34,0,0,167],
"validationinterface_8h.html":[34,0,0,168],
"validationinterface_8h.html#a0aaad62c8654cb1868295e0682b05866":[34,0,0,168,3],
"validationinterface_8h.html#a581c542f0900a185a20a25d7df4b9c78":[34,0,0,168,2],
"validationinterface_8h.html#a5e1776de1f87b4d045e9e2a198236b63":[34,0,0,168,7],
"validationinterface_8h.html#a8fe3fbf8c47cc0419fd7b9a14e8b140d":[34,0,0,168,6],
"validationinterface_8h.html#ade8ef59282b5f7521ecfd870a8e3b137":[34,0,0,168,4],
"validationinterface_8h.html#aef788fda8c339bb297d6f97f431dfa88":[34,0,0,168,5],
"validationinterface_8h_source.html":[34,0,0,168],
"vector_8hpp.html":[34,0,0,7,18],
"vector_8hpp_source.html":[34,0,0,7,18],
"vector__transient_8hpp.html":[34,0,0,7,19],
"vector__transient_8hpp_source.html":[34,0,0,7,19],
"version_8h.html":[34,0,0,169],
"version_8h.html#a04ad229ffd8c41a83118551a4d395205":[34,0,0,169,1],
"version_8h.html#a1ec9354f400b7547d456bdd7816c5b36":[34,0,0,169,7],
"version_8h.html#a262584ad779f848883e0cc89ef2781f8":[34,0,0,169,10],
"version_8h.html#a2c4c900f5bd0c956cc1a64cd0cc1c318":[34,0,0,169,5],
"version_8h.html#a352cc543eb23823a6b16a5166c8db2c3":[34,0,0,169,6],
"version_8h.html#a43420c87666449f8132e21687abcfda9":[34,0,0,169,14],
"version_8h.html#a4e18717137ea36916ec24018040cf954":[34,0,0,169,13],
"version_8h.html#a4e2497f7c9c4319adcaf945159ec63f4":[34,0,0,169,11]
};
|
mikailweston/pyecog
|
pyecog/ndf/make_pdfs.py
|
'''
This module is not currently being used
'''
from __future__ import print_function
import pickle
import os
import matplotlib.pyplot as plt
import numpy as np
import matplotlib.font_manager as fm
dir = os.path.dirname(__file__)
filename = os.path.join(dir, '../HelveticaNeue-Light.otf')
prop = fm.FontProperties(fname=filename)
def plot_traces(to_plot,
start = 0,
labels = None,
savepath = None,
filename = None,
format_string = ".pdf",
prob_thresholds = None, verbose = False):
'''
Args:
to_plot: expecting this with
start:
labels: if None, traces are all assigned with 1's
savestring:
format_string:
prob_thresholds: if not None, used to color code the index (0-sure- "k", 1-unsure "r")
Returns:
'''
if labels is None:
labels = np.ones(to_plot.shape[0])
if prob_thresholds is None:
prob_thresholds = np.zeros(to_plot.shape[0]).astype(int)
colors = ['b','r','g','k']
colors = ['k','r','g','b','purple']
print('Plotting traces...')
for section in range(int(np.ceil(to_plot.shape[0]/40.0))):
fig = plt.figure(figsize=(8.27, 11.69), dpi=20)
plt.axis('off')
plt.title('Traces '+ str((section+start)*40)+ ':' + str(((section+start)+1)*40)+' 1:black 2:red 3:green 4:blue', fontproperties=prop, fontsize = 14)
time = np.linspace(1,10,to_plot.shape[1])
annotation_colors = ['k','r']
if section == to_plot.shape[0]/40:
n_plots = to_plot.shape[0]%40
if verbose:
print(str(section*40)+ ' : ' + str(((section)*40)+n_plots))
else:
n_plots = 40
if verbose:
print(str(section*40)+ ' : ' + str((section+1)*40)+',')
for i in [ii + (section)*40 for ii in range(n_plots)]:
ax = fig.add_subplot(20,2,(i%40)+1)
ax.plot(time,to_plot[i,:], color = colors[int(labels[i])-1], linewidth = 0.5)
ax.annotate(str(i+start), xy = (0,0.3), fontsize = 10, color = annotation_colors[prob_thresholds[i]], fontproperties=prop)
ax.axis('off')
ax.set_xlim((0,10))
ax.spines['top'].set_visible(False)
ax.spines['right'].set_visible(False)
ax.get_yaxis().tick_left()
ax.get_xaxis().tick_bottom()
if savepath:
plt.savefig(os.path.join(savepath,filename+'_'+str(section+ (start+1)/40)+format_string))
#plt.savefig(os.path.join(savepath,filename+'_'+str(section)+format_string))
else:
plt.show()
plt.close('all')
def plot_traces_hdf5(to_plot,
labels = None,
savepath = None,
filename = None,
format_string = ".pdf",
prob_thresholds = None,
trace_len_sec = 5,
verbose = False):
if not format_string.startswith('.'):
format_string = '.'+format_string
if labels is None:
labels = np.ones(to_plot.shape[0])
if prob_thresholds is None:
prob_thresholds = np.zeros(to_plot.shape[0]).astype(int)
colors = ['k','r','g','b','purple']
print('Plotting traces...')
for section in range(int(np.ceil(to_plot.shape[0]/40.0))):
fig = plt.figure(figsize=(8.27, 11.69), dpi=20)
plt.axis('off')
plt.title('Seconds '+ str(section*40*trace_len_sec)+ ':' + str((section+1)*40*trace_len_sec), fontsize = 14,fontproperties=prop)
time = np.linspace(1,10,to_plot.shape[1])
annotation_colors = ['k','r']
if section == to_plot.shape[0]/40:
n_plots = to_plot.shape[0]%40
if verbose:
print(str(section*40)+ ' : ' + str(((section)*40)+n_plots))
else:
n_plots = 40
if verbose:
print(str(section*40)+ ' : ' + str((section+1)*40)+',')
for i in [ii + (section)*40 for ii in range(n_plots)]:
ax = fig.add_subplot(20,2,(i%40)+1)
ax.annotate(str(i), xy = (0,0.5), fontsize = 10,color = 'black', fontproperties=prop)
ax.plot(time, to_plot[i,:], color = colors[int(labels[i])], linewidth = 0.5)
ax.set_title(str(i*trace_len_sec), fontsize = 8, fontproperties=prop)
ax.axis('off')
ax.set_xlim((0,10))
ax.spines['top'].set_visible(False)
ax.spines['right'].set_visible(False)
ax.get_yaxis().tick_left()
ax.get_xaxis().tick_bottom()
if savepath:
plt.savefig(os.path.join(savepath,filename+'_'+str(section)+format_string))
plt.close('all')
print('Done')
if __name__ == "__main__":
training_tuple = pickle.load(open('../training_label_traces_tuple','rb'))
training_tuple = pickle.load(open('../validation_label_traces_tuple','rb'))
labels = training_tuple[0]
data = training_tuple[1]
print('plotting '+ str(data.shape[0])+ 'traces')
plot_traces(data,labels,savestring='../validation ',format_string='.pdf')
|
ArthasZhang007/15418FinalProject
|
pin-3.22-98547-g7a303a835-gcc-linux/source/tools/Debugger/app-pause-in-app-thread-tool.cpp
|
/*
* Copyright (C) 2013-2021 Intel Corporation.
* SPDX-License-Identifier: MIT
*/
#include "pin.H"
#include <stdio.h>
#include <stdlib.h>
#include <assert.h>
#include <iostream>
using std::cerr;
using std::endl;
/*
The tool validates stopping threads API called in application thread.
*/
// Interval in instructions between PIN_StopApplicationThreads() calls.
#define PAUSE_INTERVAL 10000000
// Instruction data counters per thread
struct tdata
{
UINT64 icount;
UINT64 stopPoint;
} THREAD_DATA;
static TLS_KEY tls_key = INVALID_TLS_KEY;
tdata* get_tls(THREADID threadid)
{
tdata* data = static_cast< tdata* >(PIN_GetThreadData(tls_key, threadid));
if (!data)
{
cerr << "specified key is invalid or the given thread is not yet registered in the pin thread database" << endl;
PIN_ExitProcess(1);
}
return data;
}
VOID doPause(THREADID threadid)
{
tdata* data = get_tls(threadid);
++data->icount;
if (data->icount == data->stopPoint)
{
printf("Threads to be stopped by application thread %u\n", threadid);
fflush(stdout);
// Pause threads in each LOOPS/2 instructions
if (PIN_StopApplicationThreads(threadid))
{
printf("Threads stopped by application thread %u\n", threadid);
fflush(stdout);
UINT32 nThreads = PIN_GetStoppedThreadCount();
for (UINT32 i = 0; i < nThreads; i++)
{
THREADID tid = PIN_GetStoppedThreadId(i);
const CONTEXT* ctxt = PIN_GetStoppedThreadContext(tid);
printf(" Thread %u, IP = %llx\n", tid, (long long unsigned int)PIN_GetContextReg(ctxt, REG_INST_PTR));
}
PIN_ResumeApplicationThreads(threadid);
printf("Threads resumed by application thread %u\n", threadid);
fflush(stdout);
// Reset stop point, do not try to stop in this thread any more.
data->stopPoint = 0;
}
else
{
// Probably collision with other thread calling PIN_StopApplicationThreads()
// Update stop point.
data->stopPoint += PAUSE_INTERVAL;
}
}
return;
}
VOID insCallback(INS ins, void* v) { INS_InsertCall(ins, IPOINT_BEFORE, AFUNPTR(doPause), IARG_THREAD_ID, IARG_END); }
VOID ThreadStart(THREADID threadid, CONTEXT* ctxt, INT32 flags, VOID* v)
{
tdata* data = new tdata;
// Thread ID 0 reserved for main thread.
// This thread will not call PIN_StopApplicationThreads()
data->icount = 0;
data->stopPoint = PAUSE_INTERVAL * threadid;
if (PIN_SetThreadData(tls_key, data, threadid) == FALSE)
{
cerr << "PIN_SetThreadData failed" << endl;
PIN_ExitProcess(1);
}
}
VOID ThreadFini(THREADID threadid, const CONTEXT* ctxt, INT32 code, VOID* v)
{
tdata* data = get_tls(threadid);
delete data;
}
int main(int argc, char** argv)
{
PIN_Init(argc, argv);
tls_key = PIN_CreateThreadDataKey(NULL);
if (tls_key == INVALID_TLS_KEY)
{
cerr << "number of already allocated keys reached the MAX_CLIENT_TLS_KEYS limit" << endl;
PIN_ExitProcess(1);
}
INS_AddInstrumentFunction(insCallback, NULL);
PIN_AddThreadStartFunction(ThreadStart, NULL);
PIN_AddThreadFiniFunction(ThreadFini, NULL);
PIN_StartProgram();
return 1;
}
|
hdknr/paloma
|
src/paloma/migrations/0002_auto_20150309_1858.py
|
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('paloma', '0001_initial'),
]
operations = [
migrations.AlterModelOptions(
name='alias',
options={'verbose_name': 'Alias', 'verbose_name_plural': 'Alias'},
),
migrations.AlterField(
model_name='alias',
name='address',
field=models.CharField(max_length=100, verbose_name='Alias Address'),
preserve_default=True,
),
migrations.AlterField(
model_name='alias',
name='alias',
field=models.CharField(default='hoge', max_length=100, verbose_name='Alias Forward'),
preserve_default=False,
),
migrations.AlterUniqueTogether(
name='alias',
unique_together=set([('address', 'alias')]),
),
]
|
jorgediazjr/dials-dev20191018
|
modules/xia2/Handlers/Citations.py
|
<reponame>jorgediazjr/dials-dev20191018<filename>modules/xia2/Handlers/Citations.py
#!/usr/bin/env python
# Citations.py
# Copyright (C) 2006 CCLRC, <NAME>
#
# This code is distributed under the BSD license, a copy of which is
# included in the root directory of this package.
#
# A handler for management of program citations. This should initialise
# from a citations.xml file which can be found in a number of places...
# in particular $HOME or $USERDIR (I think, on Windows) .xia2,
# data etc...
#
# That would be %USERPROFILE%
from __future__ import absolute_import, division, print_function
import os
import xml.dom.minidom
class _Citations(object):
"""A class to track citations."""
def __init__(self):
self._citations = {}
self._cited = []
# set up the citations list...
dom = xml.dom.minidom.parse(
os.path.abspath(
os.path.join(os.path.dirname(__file__), "..", "Data", "citations.xml")
)
)
citations = dom.getElementsByTagName("citations")[0].getElementsByTagName(
"citation"
)
for citation in citations:
program = str(citation.attributes["program"].value)
citation_data = {}
for entry in citation.childNodes:
if entry.nodeType == entry.ELEMENT_NODE:
citation_data[entry.nodeName] = entry.childNodes[0].data
if "acta" not in citation_data:
# construct Acta style reference if necessary
citation_data["acta"] = self._bibtex_to_acta(citation_data["bibtex"])
if "url" not in citation_data:
# obtain URL from bibtex entry if possible
bibtex_data = self._parse_bibtex(citation_data["bibtex"])
if "url" in bibtex_data:
citation_data["url"] = bibtex_data["url"]
elif "doi" in bibtex_data:
citation_data["url"] = "https://doi.org/" + bibtex_data["doi"]
if program not in self._citations:
self._citations[program] = []
self._citations[program].append(citation_data)
def cite(self, program):
"""Cite a given program."""
if program not in self._cited:
self._cited.append(program)
def get_programs(self):
"""Get a list of all of the programs which have been cited."""
return sorted(self._cited)
def get_citations(self):
"""Get a list of bibtex records of citations."""
return [cit["bibtex"] for cit in self.get_citations_dicts()]
def get_citations_dicts(self):
"""Get a list of citations dictionary objects."""
result = []
for c in self._cited:
for b in self._citations.get(c, []):
result.append(b)
return result
def get_citations_acta(self):
"""Return a list of strings of Acta style references."""
# want them in alphabetical order
return sorted([cit["acta"] for cit in self.get_citations_dicts()])
def find_citations(self, program=None, acta=None):
"""Return a list of citations for a program name or an Acta style reference."""
results = []
if program:
results.extend(self._citations.get(program, []))
if acta:
results.extend(
citation
for citations in self._citations.itervalues()
for citation in citations
if citation.get("acta") == acta
)
return results
def _parse_bibtex(self, bibtex):
"""A jiffy to parse a bibtex entry."""
contents = {}
# default values
contents["volume"] = ""
for token in bibtex.split("\n"):
if "=" in token:
name, value = tuple(token.split("="))
# clean up the value...
value = value.replace("{", "").replace("}", "")
value = value.replace('"', "")
value = value.strip()
if value[-1] == ",":
value = value[:-1]
contents[name.strip()] = value
return contents
def _bibtex_to_acta(self, bibtex):
"""Construct an Acta-like formatted reference from a bibtex entry."""
data = self._parse_bibtex(bibtex)
actaformat = "%(author)s (%(year)s) %(journal)s %(volume)s."
# drop every 'and' but the last
data["author"] = data["author"].replace(
" and ", ", ", data["author"].count(" and ") - 1
)
if "pages" in data:
data["pages"] = data["pages"].replace("--", "-")
actaformat = "%(author)s (%(year)s) %(journal)s %(volume)s, %(pages)s."
return actaformat % data
Citations = _Citations()
if __name__ == "__main__":
print(Citations.find_citations(program="xia2"))
print(
Citations.find_citations(acta="<NAME>. (2010) J. Appl. Cryst. 43, 186-190.")
)
Citations.cite("labelit")
Citations.cite("denzo")
Citations.cite("mosflm")
Citations.cite("xds")
Citations.cite("xia2")
for citation in Citations.get_citations_acta():
print(citation)
print(Citations.get_programs())
|
bruceCzK/bilibili-helper
|
src/js/modules/videoAnchor/UI/index.js
|
/**
* Author: DrowsyFlesh
* Create: 2018/10/23
* Description:
*/
import React from 'react';
import ReactDOM from 'react-dom';
import ToolBtnBuilder from './ToolBtn';
import {UI} from 'Libs/UI.js';
export class VideoAnchorUI extends UI {
constructor() {
super({
name: 'videoAnchor',
});
}
load = () => {
return new Promise(resolve => {
const containerSelectors = [
'#bangumi_detail .func-module',
'#entryOld',
//'.video-info .video-title',
'.entry-old',
'#arc_toolbar_report',
'#viewlater-app .video-toolbar-module',
];
const newPage = document.querySelector('.video-data, .stardust-player');
const addUI = (container, callback) => {
if (document.querySelector('.bilibili-helper')) return;
const helperDOM = document.createElement('span');
helperDOM.setAttribute('class', 'bilibili-helper');
container.appendChild(helperDOM);
const ToolBtn = ToolBtnBuilder();
ReactDOM.render(<ToolBtn/>, document.querySelector('.bilibili-helper'), () => {
const helperContentDOM = document.querySelector('.bilibili-helper-content');
if (typeof callback === 'function') callback(container);
resolve(helperContentDOM);
});
};
if (newPage) { // 新页面要先判断b站代码是否跑完
document.querySelector('html').classList.add('new-page');
addUI(document.body);
} else { // 老页面
this.interval(containerSelectors).then(() => {
const retryMax = 10;
let retryTime = 0;
let timer = setInterval(() => {
if (retryTime > retryMax) {
clearInterval(timer);
return console.error(`Title for view has not changed or unknow page!`);
}
const favDOM = document.querySelector('.fav-box .num');
const bangumiDOM = document.querySelector('#bangumi_detail .func-module');
const favNum = favDOM ? favDOM.innerText : false;
if (favNum) {
clearInterval(timer);
addUI(document.querySelector('#arc_toolbar_report, #bangumi_detail .func-module, #viewlater-app .video-toolbar-module'));
} else if (bangumiDOM) {
addUI(bangumiDOM);
} else ++retryTime;
}, 1000);
});
}
});
};
};
|
JaneMandy/CS
|
org/apache/batik/css/engine/value/ListValue.java
|
package org.apache.batik.css.engine.value;
import org.w3c.dom.DOMException;
public class ListValue extends AbstractValue {
protected int length;
protected Value[] items = new Value[5];
protected char separator = ',';
public ListValue() {
}
public ListValue(char var1) {
this.separator = var1;
}
public char getSeparatorChar() {
return this.separator;
}
public short getCssValueType() {
return 2;
}
public String getCssText() {
StringBuffer var1 = new StringBuffer(this.length * 8);
if (this.length > 0) {
var1.append(this.items[0].getCssText());
}
for(int var2 = 1; var2 < this.length; ++var2) {
var1.append(this.separator);
var1.append(this.items[var2].getCssText());
}
return var1.toString();
}
public int getLength() throws DOMException {
return this.length;
}
public Value item(int var1) throws DOMException {
return this.items[var1];
}
public String toString() {
return this.getCssText();
}
public void append(Value var1) {
if (this.length == this.items.length) {
Value[] var2 = new Value[this.length * 2];
System.arraycopy(this.items, 0, var2, 0, this.length);
this.items = var2;
}
this.items[this.length++] = var1;
}
}
|
Suryanshg/ProjectManager
|
ProjectManager/src/main/java/projectmanager/http/ListAllProjectsResponse.java
|
<reponame>Suryanshg/ProjectManager
package projectmanager.http;
import java.util.ArrayList;
import java.util.List;
import projectmanager.model.Project;
public class ListAllProjectsResponse {
public String error;
public int statusCode;
public List<Project> projects;
// Success
public ListAllProjectsResponse(List<Project> projects, int statusCode) {
this.projects = projects;
this.statusCode = statusCode;
this.error = "";
}
// Failure
public ListAllProjectsResponse(int statusCode, String error) {
this.projects = new ArrayList<Project>();
this.statusCode = statusCode;
this.error = error;
}
}
|
daodao10/chart
|
hk/0003_d.js
|
<reponame>daodao10/chart
var data=[['20000103',2.5256],
['20000104',2.5017],
['20000105',2.4298],
['20000106',2.4325],
['20000107',2.5376],
['20000110',2.5615],
['20000111',2.4897],
['20000112',2.4538],
['20000113',2.4418],
['20000114',2.5256],
['20000117',2.5017],
['20000118',2.4897],
['20000119',2.4298],
['20000120',2.4657],
['20000121',2.4418],
['20000124',2.4298],
['20000125',2.4179],
['20000126',2.4418],
['20000127',2.4298],
['20000128',2.4059],
['20000131',2.382],
['20000201',2.3939],
['20000202',2.4179],
['20000203',2.4059],
['20000208',2.346],
['20000209',2.3341],
['20000210',2.358],
['20000211',2.2982],
['20000214',2.1067],
['20000215',2.1545],
['20000216',2.2982],
['20000217',2.3101],
['20000218',2.2264],
['20000221',2.2264],
['20000222',2.2264],
['20000223',2.2264],
['20000224',2.2623],
['20000225',2.2144],
['20000228',2.1665],
['20000229',2.1785],
['20000301',2.2982],
['20000302',2.2264],
['20000303',2.2503],
['20000306',2.2742],
['20000307',2.2503],
['20000308',2.2383],
['20000309',2.2383],
['20000310',2.2503],
['20000313',2.2383],
['20000314',2.2144],
['20000315',2.2144],
['20000316',2.2742],
['20000317',2.2623],
['20000320',2.2024],
['20000321',2.2024],
['20000322',2.2144],
['20000323',2.2264],
['20000324',2.2503],
['20000327',2.2383],
['20000328',2.2623],
['20000329',2.2503],
['20000330',2.2862],
['20000331',2.3341],
['20000403',2.3341],
['20000405',2.37],
['20000406',2.4777],
['20000407',2.3939],
['20000410',2.3939],
['20000411',2.4059],
['20000412',2.4418],
['20000413',2.4179],
['20000414',2.3568],
['20000417',2.2383],
['20000418',2.291],
['20000419',2.3305],
['20000420',2.3173],
['20000425',2.3305],
['20000426',2.291],
['20000427',2.3173],
['20000428',2.2383],
['20000502',2.2252],
['20000503',2.2252],
['20000504',2.3042],
['20000505',2.291],
['20000508',2.3042],
['20000509',2.3305],
['20000510',2.2797],
['20000512',2.3173],
['20000515',2.3173],
['20000516',2.291],
['20000517',2.291],
['20000518',2.2647],
['20000519',2.2515],
['20000522',2.3173],
['20000523',2.3305],
['20000524',2.3173],
['20000525',2.3042],
['20000526',2.291],
['20000529',2.2383],
['20000530',2.1988],
['20000531',2.2252],
['20000601',2.2515],
['20000602',2.291],
['20000605',2.291],
['20000607',2.3305],
['20000608',2.3305],
['20000609',2.3305],
['20000612',2.3173],
['20000613',2.2647],
['20000614',2.2647],
['20000615',2.3518],
['20000616',2.3042],
['20000619',2.291],
['20000620',2.291],
['20000621',2.2778],
['20000622',2.2252],
['20000623',2.2778],
['20000626',2.2647],
['20000627',2.2515],
['20000628',2.3042],
['20000629',2.2647],
['20000630',2.3173],
['20000703',2.3042],
['20000704',2.291],
['20000705',2.3042],
['20000706',2.2778],
['20000707',2.2515],
['20000710',2.2515],
['20000711',2.3173],
['20000712',2.3437],
['20000713',2.3107],
['20000714',2.2647],
['20000717',2.3305],
['20000718',2.3173],
['20000719',2.3832],
['20000720',2.4753],
['20000721',2.4622],
['20000724',2.4227],
['20000725',2.37],
['20000726',2.449],
['20000727',2.5148],
['20000728',2.4753],
['20000731',2.4095],
['20000801',2.4358],
['20000802',2.4753],
['20000803',2.4358],
['20000804',2.449],
['20000807',2.4358],
['20000808',2.4753],
['20000809',2.4227],
['20000810',2.4358],
['20000811',2.4753],
['20000814',2.4753],
['20000815',2.4885],
['20000816',2.4622],
['20000817',2.4358],
['20000818',2.449],
['20000821',2.4622],
['20000822',2.4622],
['20000823',2.4227],
['20000824',2.4227],
['20000825',2.4622],
['20000828',2.449],
['20000829',2.5017],
['20000830',2.528],
['20000831',2.5412],
['20000901',2.607],
['20000904',2.6202],
['20000905',2.6333],
['20000906',2.607],
['20000907',2.607],
['20000908',2.5807],
['20000911',2.5807],
['20000912',2.5807],
['20000914',2.5807],
['20000915',2.607],
['20000918',2.5675],
['20000919',2.6202],
['20000920',2.5675],
['20000921',2.5807],
['20000922',2.5938],
['20000925',2.607],
['20000926',2.5938],
['20000927',2.5675],
['20000928',2.5675],
['20000929',2.5675],
['20001003',2.5675],
['20001004',2.5675],
['20001005',2.5543],
['20001009',2.5412],
['20001010',2.5412],
['20001011',2.5017],
['20001012',2.4885],
['20001013',2.449],
['20001016',2.5017],
['20001017',2.4885],
['20001018',2.4753],
['20001019',2.4358],
['20001020',2.4227],
['20001023',2.37],
['20001024',2.37],
['20001025',2.37],
['20001026',2.5543],
['20001027',2.5412],
['20001030',2.5543],
['20001031',2.5938],
['20001101',2.5675],
['20001102',2.5148],
['20001103',2.449],
['20001106',2.4753],
['20001107',2.5148],
['20001108',2.5148],
['20001109',2.5412],
['20001110',2.5017],
['20001113',2.5017],
['20001114',2.5148],
['20001115',2.5148],
['20001116',2.4885],
['20001117',2.4753],
['20001120',2.5017],
['20001121',2.5148],
['20001122',2.4885],
['20001123',2.5807],
['20001124',2.5412],
['20001127',2.5675],
['20001128',2.5675],
['20001129',2.5148],
['20001130',2.5807],
['20001201',2.528],
['20001204',2.528],
['20001205',2.5807],
['20001206',2.5675],
['20001207',2.6202],
['20001208',2.6992],
['20001211',2.765],
['20001212',2.7123],
['20001213',2.7387],
['20001214',2.7123],
['20001215',2.7026],
['20001218',2.7518],
['20001219',2.7782],
['20001220',2.8177],
['20001221',2.8835],
['20001222',2.8966],
['20001227',3.002],
['20001228',2.9493],
['20001229',3.0283],
['20010102',2.9493],
['20010103',2.8703],
['20010104',2.7255],
['20010105',2.6992],
['20010108',2.7913],
['20010109',2.8966],
['20010110',2.8966],
['20010111',2.8308],
['20010112',2.8177],
['20010115',2.7255],
['20010116',2.7782],
['20010117',2.8835],
['20010118',2.8571],
['20010119',2.8177],
['20010122',2.8966],
['20010123',2.8703],
['20010129',2.8571],
['20010130',2.9361],
['20010131',2.9493],
['20010201',2.9361],
['20010202',2.9493],
['20010205',2.9361],
['20010206',2.9625],
['20010207',2.9493],
['20010208',3.081],
['20010209',3.1073],
['20010212',3.081],
['20010213',3.0678],
['20010214',3.0283],
['20010215',3.0283],
['20010216',2.9625],
['20010219',3.0151],
['20010220',3.0546],
['20010221',3.0678],
['20010222',3.0415],
['20010223',3.0415],
['20010226',3.0283],
['20010227',3.0283],
['20010228',3.0678],
['20010301',3.0283],
['20010302',3.1073],
['20010305',3.0546],
['20010306',3.081],
['20010307',3.0151],
['20010308',3.0162],
['20010309',3.0151],
['20010312',2.9361],
['20010313',2.844],
['20010314',2.765],
['20010315',2.9493],
['20010316',2.7913],
['20010319',2.8703],
['20010320',2.844],
['20010321',2.8177],
['20010322',2.7782],
['20010323',2.765],
['20010326',2.8308],
['20010327',2.8308],
['20010328',2.8045],
['20010329',2.7782],
['20010330',2.7913],
['20010402',2.7913],
['20010403',2.8403],
['20010404',2.8835],
['20010406',2.9888],
['20010409',2.9756],
['20010410',2.923],
['20010411',2.9256],
['20010412',2.8098],
['20010417',2.7808],
['20010418',2.7229],
['20010419',2.6504],
['20010420',2.6504],
['20010423',2.6939],
['20010424',2.6649],
['20010425',2.6794],
['20010426',2.7084],
['20010427',2.7084],
['20010502',2.7084],
['20010503',2.6939],
['20010504',2.7084],
['20010507',2.6794],
['20010508',2.7229],
['20010509',2.7373],
['20010510',2.7518],
['20010511',2.7518],
['20010514',2.7229],
['20010515',2.7373],
['20010516',2.7663],
['20010517',2.8387],
['20010518',2.7518],
['20010521',2.7808],
['20010522',2.7518],
['20010523',2.7373],
['20010524',2.7373],
['20010525',2.7084],
['20010528',2.6939],
['20010529',2.6794],
['20010530',2.6649],
['20010531',2.6504],
['20010601',2.636],
['20010604',2.6504],
['20010605',2.6504],
['20010606',2.6649],
['20010607',2.6649],
['20010608',2.6794],
['20010611',2.636],
['20010612',2.6649],
['20010613',2.6939],
['20010614',2.8242],
['20010615',2.8098],
['20010618',2.8242],
['20010619',2.8532],
['20010620',2.8387],
['20010621',2.8098],
['20010622',2.8098],
['20010626',2.7953],
['20010627',2.7808],
['20010628',2.8098],
['20010629',2.8532],
['20010703',2.7953],
['20010704',2.7808],
['20010705',2.7518],
['20010709',2.7229],
['20010710',2.7808],
['20010711',2.7808],
['20010712',2.8242],
['20010713',2.7808],
['20010716',2.7518],
['20010717',2.7373],
['20010718',2.7518],
['20010719',2.7229],
['20010720',2.6939],
['20010723',2.7663],
['20010724',2.7518],
['20010726',2.7373],
['20010727',2.7518],
['20010730',2.7518],
['20010731',2.8098],
['20010801',2.8387],
['20010802',2.8098],
['20010803',2.8387],
['20010806',2.7808],
['20010807',2.7953],
['20010808',2.7808],
['20010809',2.8098],
['20010810',2.7953],
['20010813',2.7808],
['20010814',2.7953],
['20010815',2.7953],
['20010816',2.7953],
['20010817',2.8098],
['20010820',2.8098],
['20010821',2.8387],
['20010822',2.8242],
['20010823',2.8098],
['20010824',2.8387],
['20010827',2.8387],
['20010828',2.8822],
['20010829',2.8387],
['20010830',2.8242],
['20010831',2.7953],
['20010903',2.8677],
['20010904',2.8532],
['20010905',2.8532],
['20010906',2.8242],
['20010907',2.8242],
['20010910',2.8098],
['20010911',2.8387],
['20010912',2.7084],
['20010913',2.7518],
['20010914',2.8242],
['20010917',2.7808],
['20010918',2.7518],
['20010919',2.7663],
['20010920',2.7084],
['20010921',2.6649],
['20010924',2.6504],
['20010925',2.6649],
['20010926',2.6939],
['20010927',2.7953],
['20010928',2.8242],
['20011003',2.8532],
['20011004',2.8532],
['20011005',2.8242],
['20011008',2.8242],
['20011009',2.8532],
['20011010',2.8242],
['20011011',2.7663],
['20011012',2.7663],
['20011015',2.8098],
['20011016',2.8387],
['20011017',2.8387],
['20011018',2.7663],
['20011019',2.7808],
['20011022',2.7808],
['20011023',2.8532],
['20011024',2.8242],
['20011026',2.7663],
['20011029',2.7808],
['20011030',2.8242],
['20011031',2.8242],
['20011101',2.8098],
['20011102',2.7953],
['20011105',2.8098],
['20011106',2.8098],
['20011107',2.7808],
['20011108',2.7953],
['20011109',2.7953],
['20011112',2.7808],
['20011113',2.8098],
['20011114',2.7953],
['20011115',2.7808],
['20011116',2.7663],
['20011119',2.7663],
['20011120',2.7373],
['20011121',2.7229],
['20011122',2.7518],
['20011123',2.7229],
['20011126',2.7229],
['20011127',2.7084],
['20011128',2.7373],
['20011129',2.7663],
['20011130',2.8387],
['20011203',2.7953],
['20011204',2.7663],
['20011205',2.7953],
['20011206',2.7373],
['20011207',2.7808],
['20011210',2.7663],
['20011211',2.7808],
['20011212',2.7373],
['20011213',2.7663],
['20011214',2.7808],
['20011217',2.7953],
['20011218',2.7663],
['20011219',2.7808],
['20011220',2.7808],
['20011221',2.7518],
['20011224',2.7953],
['20011227',2.7953],
['20011228',2.7953],
['20011231',2.7808],
['20020102',2.7808],
['20020103',2.7808],
['20020104',2.7808],
['20020107',2.7663],
['20020108',2.7808],
['20020109',2.7373],
['20020110',2.7808],
['20020111',2.7953],
['20020114',2.7953],
['20020115',2.7953],
['20020116',2.8098],
['20020117',2.8098],
['20020118',2.7808],
['20020121',2.8098],
['20020122',2.8098],
['20020123',2.7953],
['20020124',2.8098],
['20020125',2.8242],
['20020128',2.8387],
['20020129',2.8677],
['20020130',2.8387],
['20020131',2.8387],
['20020201',2.8387],
['20020204',2.8098],
['20020205',2.8387],
['20020206',2.9111],
['20020207',2.9256],
['20020208',2.998],
['20020211',3.056],
['20020215',2.9835],
['20020218',3.0125],
['20020219',2.9691],
['20020220',3.027],
['20020221',3.027],
['20020222',3.056],
['20020225',3.0704],
['20020226',3.1284],
['20020227',3.1573],
['20020228',3.1573],
['20020301',3.1284],
['20020304',3.1718],
['20020305',3.1863],
['20020306',3.1863],
['20020307',3.2298],
['20020308',3.2153],
['20020311',3.2877],
['20020312',3.2732],
['20020313',3.2153],
['20020314',3.2008],
['20020315',3.1863],
['20020318',3.1573],
['20020319',3.1863],
['20020320',3.1863],
['20020321',3.1429],
['20020322',3.1573],
['20020325',3.1284],
['20020326',3.1429],
['20020327',3.0994],
['20020328',3.1284],
['20020402',3.0994],
['20020403',3.0994],
['20020404',3.0415],
['20020408',3.056],
['20020409',3.056],
['20020410',3.0415],
['20020411',3.0849],
['20020412',3.0849],
['20020415',3.0994],
['20020416',3.0704],
['20020417',3.056],
['20020418',3.056],
['20020419',3.1139],
['20020422',3.0748],
['20020423',3.1226],
['20020424',3.0429],
['20020425',3.0589],
['20020426',3.0748],
['20020429',3.1067],
['20020430',3.1067],
['20020502',3.1545],
['20020503',3.1704],
['20020506',3.1385],
['20020507',3.1545],
['20020508',3.1863],
['20020509',3.25],
['20020510',3.3456],
['20020513',3.3297],
['20020514',3.3775],
['20020515',3.4412],
['20020516',3.4571],
['20020517',3.5209],
['20020521',3.4731],
['20020522',3.4412],
['20020523',3.489],
['20020524',3.4094],
['20020527',3.4253],
['20020528',3.4094],
['20020529',3.3616],
['20020530',3.3456],
['20020531',3.3138],
['20020603',3.3456],
['20020604',3.4094],
['20020605',3.3934],
['20020606',3.3456],
['20020607',3.3616],
['20020610',3.3775],
['20020611',3.4253],
['20020612',3.4094],
['20020613',3.4412],
['20020614',3.3934],
['20020617',3.3616],
['20020618',3.3297],
['20020619',3.2341],
['20020620',3.2978],
['20020621',3.2978],
['20020624',3.3456],
['20020625',3.3775],
['20020626',3.2819],
['20020627',3.2819],
['20020628',3.3138],
['20020702',3.266],
['20020703',3.2819],
['20020704',3.3138],
['20020705',3.3297],
['20020708',3.3297],
['20020709',3.3456],
['20020710',3.3616],
['20020711',3.3138],
['20020712',3.3456],
['20020715',3.3138],
['20020716',3.25],
['20020717',3.2182],
['20020718',3.266],
['20020719',3.25],
['20020722',3.25],
['20020723',3.3138],
['20020724',3.25],
['20020725',3.2819],
['20020726',3.2182],
['20020729',3.2022],
['20020730',3.2182],
['20020731',3.2182],
['20020801',3.2022],
['20020802',3.2022],
['20020805',3.1704],
['20020806',3.1385],
['20020807',3.1545],
['20020808',3.1545],
['20020809',3.1863],
['20020812',3.1067],
['20020813',3.1385],
['20020814',3.1704],
['20020815',3.25],
['20020816',3.25],
['20020819',3.2182],
['20020820',3.2341],
['20020821',3.2341],
['20020822',3.25],
['20020823',3.3297],
['20020826',3.3456],
['20020827',3.3456],
['20020828',3.3616],
['20020829',3.3297],
['20020830',3.3138],
['20020902',3.25],
['20020903',3.2341],
['20020904',3.3138],
['20020905',3.2819],
['20020906',3.3616],
['20020909',3.3775],
['20020910',3.4094],
['20020911',3.3616],
['20020912',3.3775],
['20020913',3.3138],
['20020916',3.3616],
['20020917',3.4094],
['20020918',3.3297],
['20020919',3.3456],
['20020920',3.3775],
['20020923',3.4731],
['20020924',3.4571],
['20020925',3.3616],
['20020926',3.3775],
['20020927',3.3616],
['20020930',3.3456],
['20021002',3.2819],
['20021003',3.3456],
['20021004',3.3297],
['20021007',3.3297],
['20021008',3.25],
['20021009',3.25],
['20021010',3.2341],
['20021011',3.25],
['20021015',3.2341],
['20021016',3.25],
['20021017',3.2341],
['20021018',3.2022],
['20021021',3.2182],
['20021022',3.2341],
['20021023',3.266],
['20021024',3.2819],
['20021025',3.2978],
['20021028',3.2978],
['20021029',3.2819],
['20021030',3.3138],
['20021031',3.266],
['20021101',3.2182],
['20021104',3.2341],
['20021105',3.2819],
['20021106',3.3616],
['20021107',3.3775],
['20021108',3.3297],
['20021111',3.2978],
['20021112',3.3297],
['20021113',3.3456],
['20021114',3.3297],
['20021115',3.3616],
['20021118',3.4253],
['20021119',3.4571],
['20021120',3.4731],
['20021121',3.4253],
['20021122',3.3456],
['20021125',3.3456],
['20021126',3.3456],
['20021127',3.3297],
['20021128',3.3456],
['20021129',3.2978],
['20021202',3.2819],
['20021203',3.2819],
['20021204',3.3138],
['20021205',3.3297],
['20021206',3.2978],
['20021209',3.2978],
['20021210',3.3138],
['20021211',3.2819],
['20021212',3.3138],
['20021213',3.2978],
['20021216',3.3138],
['20021217',3.266],
['20021218',3.25],
['20021219',3.2182],
['20021220',3.266],
['20021223',3.2341],
['20021224',3.266],
['20021227',3.2182],
['20021230',3.2022],
['20021231',3.2022],
['20030102',3.2022],
['20030103',3.1863],
['20030106',3.1704],
['20030107',3.1704],
['20030108',3.1545],
['20030109',3.1545],
['20030110',3.2022],
['20030113',3.2022],
['20030114',3.1704],
['20030115',3.2341],
['20030116',3.266],
['20030117',3.2182],
['20030120',3.2022],
['20030121',3.1704],
['20030122',3.2182],
['20030123',3.1863],
['20030124',3.1863],
['20030127',3.1704],
['20030128',3.1704],
['20030129',3.1067],
['20030130',3.1226],
['20030204',3.0907],
['20030205',3.1067],
['20030206',3.0589],
['20030207',3.0589],
['20030210',3.027],
['20030211',3.027],
['20030212',3.1067],
['20030213',3.0429],
['20030214',3.0589],
['20030217',3.0748],
['20030218',3.0589],
['20030219',3.0589],
['20030220',3.0589],
['20030221',3.0429],
['20030224',3.0748],
['20030225',3.0907],
['20030226',3.0907],
['20030227',3.0429],
['20030228',3.0589],
['20030303',3.0907],
['20030304',3.1067],
['20030305',3.0589],
['20030306',3.0589],
['20030307',3.0589],
['20030310',3.0589],
['20030311',3.0907],
['20030312',3.0589],
['20030313',3.0907],
['20030314',3.1067],
['20030317',3.0589],
['20030318',3.0748],
['20030319',3.0748],
['20030320',3.0748],
['20030321',3.1067],
['20030324',3.1385],
['20030325',3.1704],
['20030326',3.1226],
['20030327',3.0748],
['20030328',3.0907],
['20030331',3.0589],
['20030401',3.0429],
['20030402',3.0589],
['20030403',3.027],
['20030404',3.0907],
['20030407',3.1226],
['20030408',3.0907],
['20030409',3.0748],
['20030410',3.1226],
['20030411',3.0907],
['20030414',3.0429],
['20030415',3.0907],
['20030416',3.0748],
['20030417',3.0429],
['20030422',2.9951],
['20030423',2.9155],
['20030424',2.9951],
['20030425',2.9155],
['20030428',2.9155],
['20030429',2.9792],
['20030430',2.9314],
['20030502',2.9633],
['20030505',2.9792],
['20030506',2.9633],
['20030507',2.9951],
['20030509',3.0429],
['20030512',3.0589],
['20030513',3.0589],
['20030514',3.0907],
['20030515',3.1226],
['20030516',3.0907],
['20030519',3.1067],
['20030520',3.1385],
['20030521',3.1545],
['20030522',3.1545],
['20030523',3.1704],
['20030526',3.1545],
['20030527',3.1545],
['20030528',3.1226],
['20030529',3.1545],
['20030530',3.1067],
['20030602',3.1863],
['20030603',3.1863],
['20030605',3.1226],
['20030606',3.1226],
['20030609',3.1704],
['20030610',3.1545],
['20030611',3.1545],
['20030612',3.1863],
['20030613',3.1704],
['20030616',3.1863],
['20030617',3.1863],
['20030618',3.1863],
['20030619',3.1545],
['20030620',3.1863],
['20030623',3.1545],
['20030624',3.1385],
['20030625',3.1385],
['20030626',3.1545],
['20030627',3.1863],
['20030630',3.1385],
['20030702',3.1704],
['20030703',3.1545],
['20030704',3.1545],
['20030707',3.1545],
['20030708',3.1226],
['20030709',3.1385],
['20030710',3.1545],
['20030711',3.1545],
['20030714',3.2182],
['20030715',3.1545],
['20030716',3.1385],
['20030717',3.1704],
['20030718',3.1545],
['20030721',3.1704],
['20030722',3.1385],
['20030723',3.1226],
['20030724',3.1545],
['20030725',3.1385],
['20030728',3.1385],
['20030729',3.1067],
['20030730',3.1385],
['20030731',3.1704],
['20030801',3.2341],
['20030804',3.2022],
['20030805',3.25],
['20030806',3.1863],
['20030807',3.2022],
['20030808',3.1863],
['20030811',3.2182],
['20030812',3.25],
['20030813',3.2819],
['20030814',3.2819],
['20030815',3.2341],
['20030818',3.25],
['20030819',3.25],
['20030820',3.25],
['20030821',3.266],
['20030822',3.266],
['20030825',3.2978],
['20030826',3.266],
['20030827',3.2819],
['20030828',3.2978],
['20030829',3.3456],
['20030901',3.2819],
['20030902',3.3456],
['20030903',3.3297],
['20030904',3.3616],
['20030905',3.3616],
['20030908',3.3456],
['20030909',3.3456],
['20030910',3.3456],
['20030911',3.3616],
['20030915',3.3775],
['20030916',3.3775],
['20030917',3.3456],
['20030918',3.3456],
['20030919',3.3616],
['20030922',3.3616],
['20030923',3.3616],
['20030924',3.3934],
['20030925',3.3616],
['20030926',3.3297],
['20030929',3.2978],
['20030930',3.3138],
['20031002',3.3934],
['20031003',3.3775],
['20031006',3.4094],
['20031007',3.3775],
['20031008',3.3616],
['20031009',3.3934],
['20031010',3.3775],
['20031013',3.3138],
['20031014',3.3616],
['20031015',3.4094],
['20031016',3.4094],
['20031017',3.4094],
['20031020',3.3934],
['20031021',3.4094],
['20031022',3.4094],
['20031023',3.3775],
['20031024',3.3456],
['20031027',3.3934],
['20031028',3.4094],
['20031029',3.3775],
['20031030',3.4412],
['20031031',3.4253],
['20031103',3.4731],
['20031104',3.489],
['20031105',3.5527],
['20031106',3.5049],
['20031107',3.5049],
['20031110',3.489],
['20031111',3.5049],
['20031112',3.489],
['20031113',3.5209],
['20031114',3.5527],
['20031117',3.5209],
['20031118',3.5368],
['20031119',3.4731],
['20031120',3.5687],
['20031121',3.6802],
['20031124',3.6324],
['20031125',3.6483],
['20031126',3.6324],
['20031127',3.6483],
['20031128',3.6961],
['20031201',3.728],
['20031202',3.728],
['20031203',3.6643],
['20031204',3.728],
['20031205',3.7439],
['20031208',3.6961],
['20031209',3.7758],
['20031210',3.7121],
['20031211',3.7917],
['20031212',3.728],
['20031215',3.7598],
['20031216',3.6483],
['20031217',3.6165],
['20031218',3.6643],
['20031219',3.6961],
['20031222',3.728],
['20031223',3.728],
['20031224',3.728],
['20031229',3.7439],
['20031230',3.7598],
['20031231',3.7758],
['20040102',3.8395],
['20040105',3.7598],
['20040106',3.6802],
['20040107',3.7758],
['20040108',3.7439],
['20040109',3.7121],
['20040112',3.728],
['20040113',3.7917],
['20040114',3.8873],
['20040115',3.7917],
['20040116',3.8714],
['20040119',3.8395],
['20040120',3.8395],
['20040121',3.9032],
['20040126',3.9192],
['20040127',4.0307],
['20040128',4.0625],
['20040129',4.0307],
['20040130',4.0944],
['20040202',3.9988],
['20040203',3.9988],
['20040204',3.9829],
['20040205',3.9988],
['20040206',4.0307],
['20040209',4.0625],
['20040210',4.0466],
['20040211',4.0466],
['20040212',4.0944],
['20040213',4.0944],
['20040216',4.1263],
['20040217',4.2059],
['20040218',4.2378],
['20040219',4.1581],
['20040220',4.19],
['20040223',4.1422],
['20040224',4.2856],
['20040225',4.2378],
['20040226',4.2537],
['20040227',4.2856],
['20040301',4.429],
['20040302',4.3175],
['20040303',4.3015],
['20040304',4.3493],
['20040305',4.3175],
['20040308',4.2697],
['20040309',4.2856],
['20040310',4.1581],
['20040311',4.0944],
['20040312',4.1103],
['20040315',4.0785],
['20040316',4.0785],
['20040317',4.1422],
['20040318',4.1422],
['20040319',4.2219],
['20040322',4.2059],
['20040323',4.2219],
['20040324',4.1581],
['20040325',4.2219],
['20040326',4.2697],
['20040329',4.2219],
['20040330',4.3015],
['20040331',4.2378],
['20040401',4.3015],
['20040402',4.2537],
['20040406',4.2378],
['20040407',4.2697],
['20040408',4.19],
['20040413',4.3334],
['20040414',4.2697],
['20040415',4.2378],
['20040416',4.2219],
['20040419',4.2059],
['20040420',4.2537],
['20040421',4.2059],
['20040422',4.1741],
['20040423',4.2856],
['20040426',4.2697],
['20040427',4.2856],
['20040428',4.2378],
['20040429',4.2219],
['20040430',4.19],
['20040503',4.2219],
['20040504',4.2378],
['20040505',4.19],
['20040506',4.1581],
['20040507',4.1422],
['20040510',4.0466],
['20040511',4.0148],
['20040512',4.0307],
['20040513',3.951],
['20040514',3.9829],
['20040517',3.8076],
['20040518',3.6324],
['20040519',3.8236],
['20040520',3.728],
['20040521',3.951],
['20040524',3.8714],
['20040525',3.9192],
['20040527',3.9032],
['20040528',3.9192],
['20040531',3.967],
['20040601',3.9988],
['20040602',4.0307],
['20040603',3.9192],
['20040604',3.9829],
['20040607',4.0625],
['20040608',4.0944],
['20040609',4.0307],
['20040610',4.2378],
['20040611',4.2059],
['20040614',4.0148],
['20040615',4.0148],
['20040616',4.1263],
['20040617',4.1103],
['20040618',4.0148],
['20040621',3.9829],
['20040623',4.0307],
['20040624',4.1263],
['20040625',4.1103],
['20040628',4.0785],
['20040629',4.0307],
['20040630',4.0625],
['20040702',4.0944],
['20040705',4.0785],
['20040706',4.1422],
['20040707',4.19],
['20040708',4.1103],
['20040709',4.1263],
['20040712',4.1422],
['20040713',4.0625],
['20040714',4.0307],
['20040715',4.0625],
['20040716',4.0785],
['20040719',4.1103],
['20040720',4.2219],
['20040721',4.3334],
['20040722',4.3334],
['20040723',4.3493],
['20040726',4.3493],
['20040727',4.3015],
['20040728',4.3334],
['20040729',4.2697],
['20040730',4.3334],
['20040802',4.2697],
['20040803',4.3652],
['20040804',4.3334],
['20040805',4.3971],
['20040806',4.3971],
['20040809',4.3652],
['20040810',4.3334],
['20040811',4.3493],
['20040812',4.3493],
['20040813',4.3334],
['20040816',4.2697],
['20040817',4.2697],
['20040818',4.3015],
['20040819',4.3652],
['20040820',4.3334],
['20040823',4.3334],
['20040824',4.3812],
['20040825',4.413],
['20040826',4.3812],
['20040827',4.3971],
['20040830',4.4449],
['20040831',4.413],
['20040901',4.4768],
['20040902',4.4608],
['20040903',4.3971],
['20040906',4.429],
['20040907',4.429],
['20040908',4.3493],
['20040909',4.429],
['20040910',4.3971],
['20040913',4.4608],
['20040914',4.5246],
['20040915',4.5086],
['20040916',4.5405],
['20040917',4.4608],
['20040920',4.5724],
['20040921',4.6202],
['20040922',4.6679],
['20040923',4.6679],
['20040924',4.5724],
['20040927',4.6042],
['20040928',4.6042],
['20040930',4.6679],
['20041004',4.7476],
['20041005',4.7317],
['20041006',4.7157],
['20041007',4.7476],
['20041008',4.7635],
['20041011',4.7635],
['20041012',4.7476],
['20041013',4.7476],
['20041014',4.6839],
['20041015',4.6998],
['20041018',4.6998],
['20041019',4.7795],
['20041020',4.7635],
['20041021',4.7476],
['20041025',4.652],
['20041026',4.6998],
['20041027',4.6839],
['20041028',4.7795],
['20041029',4.7795],
['20041101',4.7954],
['20041102',4.9069],
['20041103',5.0822],
['20041104',5.0184],
['20041105',5.0184],
['20041108',5.0503],
['20041109',5.0503],
['20041110',5.2256],
['20041111',5.0662],
['20041112',5.0025],
['20041115',5.0025],
['20041116',4.9866],
['20041117',5.0344],
['20041118',5.0503],
['20041119',5.0822],
['20041122',5.114],
['20041123',5.1937],
['20041124',5.13],
['20041125',5.1459],
['20041126',5.0981],
['20041129',5.1618],
['20041130',5.114],
['20041201',5.13],
['20041202',5.1459],
['20041203',5.1618],
['20041206',5.2256],
['20041207',5.2096],
['20041208',5.1937],
['20041209',5.1618],
['20041210',5.0662],
['20041213',5.0981],
['20041214',5.0822],
['20041215',5.114],
['20041216',5.0662],
['20041217',5.1459],
['20041220',5.1778],
['20041221',5.2096],
['20041222',5.2096],
['20041223',5.1937],
['20041224',5.1459],
['20041228',5.1937],
['20041229',5.1937],
['20041230',5.13],
['20041231',5.13],
['20050103',5.1459],
['20050104',5.0184],
['20050105',4.9069],
['20050106',4.9547],
['20050107',4.9229],
['20050110',5.0025],
['20050111',4.9866],
['20050112',5.0822],
['20050113',5.0184],
['20050114',4.9866],
['20050117',5.0503],
['20050118',5.0344],
['20050119',5.0344],
['20050120',4.9547],
['20050121',4.9547],
['20050124',4.9388],
['20050125',4.9706],
['20050126',5.0184],
['20050127',5.0184],
['20050128',5.0822],
['20050131',5.1618],
['20050201',5.0662],
['20050202',5.0503],
['20050203',5.0025],
['20050204',5.0184],
['20050207',5.0981],
['20050208',5.13],
['20050214',5.1459],
['20050215',5.1778],
['20050216',5.1937],
['20050217',5.13],
['20050218',5.2574],
['20050221',5.1778],
['20050222',5.2574],
['20050223',5.1937],
['20050224',5.2415],
['20050225',5.2733],
['20050228',5.2733],
['20050301',5.1937],
['20050302',5.1618],
['20050303',5.114],
['20050304',5.0981],
['20050307',5.114],
['20050308',5.13],
['20050309',5.13],
['20050310',5.0822],
['20050311',5.0981],
['20050314',5.0822],
['20050315',5.0503],
['20050316',5.0981],
['20050317',5.0184],
['20050318',5.0184],
['20050321',5.0503],
['20050322',5.0184],
['20050323',4.9866],
['20050324',5.0025],
['20050329',4.891],
['20050330',4.8591],
['20050331',4.891],
['20050401',4.9069],
['20050404',4.9388],
['20050406',4.891],
['20050407',4.9388],
['20050408',4.9866],
['20050411',4.9706],
['20050412',4.9866],
['20050413',5.0025],
['20050414',4.9706],
['20050415',4.9229],
['20050418',4.7954],
['20050419',4.8432],
['20050420',4.8432],
['20050421',4.9547],
['20050422',4.9388],
['20050425',4.9388],
['20050426',4.9866],
['20050427',5.0025],
['20050428',5.0503],
['20050429',5.0822],
['20050503',5.114],
['20050504',5.13],
['20050505',5.1778],
['20050506',5.114],
['20050509',5.1459],
['20050510',5.1937],
['20050511',5.1778],
['20050512',5.2096],
['20050513',5.1618],
['20050517',5.0503],
['20050518',5.0025],
['20050519',5.0344],
['20050520',5.0184],
['20050523',5.0503],
['20050524',5.0822],
['20050525',4.9866],
['20050526',4.9866],
['20050527',4.9866],
['20050530',5.0184],
['20050531',5.0025],
['20050601',5.0184],
['20050602',5.0344],
['20050603',5.0184],
['20050606',5.0344],
['20050607',5.0184],
['20050608',5.0184],
['20050609',5.0344],
['20050610',5.0503],
['20050613',5.0503],
['20050614',5.0662],
['20050615',5.0503],
['20050616',5.0184],
['20050617',5.0344],
['20050620',5.0662],
['20050621',5.0662],
['20050622',5.0981],
['20050623',5.0344],
['20050624',5.0503],
['20050627',5.0184],
['20050628',5.0503],
['20050629',5.0662],
['20050630',5.0503],
['20050704',5.0662],
['20050705',5.0503],
['20050706',5.0503],
['20050707',5.0025],
['20050708',5.0025],
['20050711',5.0822],
['20050712',5.0344],
['20050713',5.0503],
['20050714',5.0662],
['20050715',5.1459],
['20050718',5.1618],
['20050719',5.13],
['20050720',5.1459],
['20050721',5.13],
['20050722',5.0981],
['20050725',5.1459],
['20050726',5.1459],
['20050727',5.1459],
['20050728',5.1778],
['20050729',5.1618],
['20050801',5.1778],
['20050802',5.1778],
['20050803',5.1459],
['20050804',5.1618],
['20050805',5.1778],
['20050808',5.13],
['20050809',5.13],
['20050810',5.1618],
['20050811',5.13],
['20050812',5.0184],
['20050815',5.1459],
['20050816',5.13],
['20050817',5.0981],
['20050818',5.0662],
['20050819',5.0344],
['20050822',5.0503],
['20050823',5.0344],
['20050824',5.0344],
['20050825',5.0025],
['20050826',5.0184],
['20050829',4.9706],
['20050830',5.0025],
['20050831',4.9706],
['20050901',5.0184],
['20050902',5.0025],
['20050905',5.0184],
['20050906',4.9547],
['20050907',5.0503],
['20050908',5.114],
['20050909',5.13],
['20050912',5.114],
['20050913',5.1618],
['20050914',5.1618],
['20050915',5.13],
['20050916',5.114],
['20050920',5.1618],
['20050921',5.1618],
['20050922',5.0981],
['20050923',5.0981],
['20050926',5.114],
['20050927',5.0981],
['20050928',5.0981],
['20050929',5.114],
['20050930',5.0981],
['20051003',5.114],
['20051004',5.1618],
['20051005',5.13],
['20051006',5.0981],
['20051007',5.114],
['20051010',5.1459],
['20051012',5.0662],
['20051013',5.0822],
['20051014',5.0822],
['20051017',5.0662],
['20051018',5.13],
['20051019',5.0662],
['20051020',5.0981],
['20051021',5.0822],
['20051024',5.0503],
['20051025',5.0662],
['20051026',5.0662],
['20051027',5.0662],
['20051028',5.0503],
['20051031',5.0822],
['20051101',5.1459],
['20051102',5.1459],
['20051103',5.13],
['20051104',5.0981],
['20051107',5.114],
['20051108',5.1937],
['20051109',5.2574],
['20051110',5.3371],
['20051111',5.3849],
['20051114',5.3371],
['20051115',5.2893],
['20051116',5.2574],
['20051117',5.3689],
['20051118',5.3689],
['20051121',5.3052],
['20051122',5.3052],
['20051123',5.3052],
['20051124',5.3371],
['20051125',5.3052],
['20051128',5.3052],
['20051129',5.2893],
['20051130',5.2096],
['20051201',5.2256],
['20051202',5.3052],
['20051205',5.2574],
['20051206',5.2574],
['20051207',5.3211],
['20051208',5.2415],
['20051209',5.2893],
['20051212',5.2893],
['20051213',5.2893],
['20051214',5.2893],
['20051215',5.3211],
['20051216',5.3052],
['20051219',5.3689],
['20051220',5.3689],
['20051221',5.4008],
['20051222',5.3849],
['20051223',5.4008],
['20051228',5.3371],
['20051229',5.353],
['20051230',5.2574],
['20060103',5.3052],
['20060104',5.4805],
['20060105',5.4486],
['20060106',5.4964],
['20060109',5.4805],
['20060110',5.4486],
['20060111',5.4327],
['20060112',5.5442],
['20060113',5.5442],
['20060116',5.5283],
['20060117',5.4805],
['20060118',5.4805],
['20060119',5.5442],
['20060120',5.3689],
['20060123',5.2733],
['20060124',5.3689],
['20060125',5.3849],
['20060126',5.3371],
['20060127',5.4327],
['20060201',5.353],
['20060202',5.353],
['20060203',5.3371],
['20060206',5.3689],
['20060207',5.3371],
['20060208',5.3211],
['20060209',5.3689],
['20060210',5.592],
['20060213',5.6716],
['20060214',5.8469],
['20060215',5.7832],
['20060216',5.7672],
['20060217',5.7832],
['20060220',5.7832],
['20060221',5.7832],
['20060222',5.815],
['20060223',6.1018],
['20060224',6.1018],
['20060227',6.1655],
['20060228',5.9265],
['20060301',6.0062],
['20060302',5.9425],
['20060303',5.9425],
['20060306',5.8947],
['20060307',5.7991],
['20060308',5.8469],
['20060309',5.7513],
['20060310',5.7194],
['20060313',5.7513],
['20060314',5.8628],
['20060315',5.9743],
['20060316',5.9743],
['20060317',5.9584],
['20060320',5.8309],
['20060321',5.8628],
['20060322',5.7991],
['20060323',5.7991],
['20060324',5.7832],
['20060327',5.8469],
['20060328',5.8947],
['20060329',5.8628],
['20060330',5.9265],
['20060331',5.9584],
['20060403',6.0381],
['20060404',5.9903],
['20060406',6.0381],
['20060407',5.9903],
['20060410',6.0221],
['20060411',6.0221],
['20060412',6.0221],
['20060413',6.054],
['20060418',6.0859],
['20060419',5.9265],
['20060420',5.9265],
['20060421',5.9106],
['20060424',5.8628],
['20060425',5.9106],
['20060426',5.9265],
['20060427',5.9106],
['20060428',5.8947],
['20060502',5.9743],
['20060503',6.0062],
['20060504',5.9584],
['20060508',5.9584],
['20060509',5.9743],
['20060510',5.9584],
['20060511',5.9743],
['20060512',5.9265],
['20060515',5.8787],
['20060516',5.815],
['20060517',5.7991],
['20060518',5.7513],
['20060519',5.7194],
['20060522',5.6398],
['20060523',5.6557],
['20060524',5.6079],
['20060525',5.5442],
['20060526',5.6079],
['20060529',5.6079],
['20060530',5.5283],
['20060601',5.4805],
['20060602',5.4964],
['20060605',5.4645],
['20060606',5.4805],
['20060607',5.4327],
['20060608',5.3849],
['20060609',5.3689],
['20060612',5.3849],
['20060613',5.3371],
['20060614',5.3211],
['20060615',5.3689],
['20060616',5.4327],
['20060619',5.4327],
['20060620',5.4167],
['20060621',5.3849],
['20060622',5.4327],
['20060623',5.4327],
['20060626',5.4327],
['20060627',5.3849],
['20060628',5.3689],
['20060629',5.353],
['20060630',5.4327],
['20060703',5.4645],
['20060704',5.4645],
['20060705',5.4645],
['20060706',5.5283],
['20060707',5.5283],
['20060710',5.5442],
['20060711',5.5442],
['20060712',5.5442],
['20060713',5.5601],
['20060714',5.5123],
['20060717',5.5283],
['20060718',5.5283],
['20060719',5.4645],
['20060720',5.5123],
['20060721',5.5283],
['20060724',5.5251],
['20060725',5.5633],
['20060726',5.5506],
['20060727',5.5952],
['20060728',5.5824],
['20060731',5.6079],
['20060801',5.5952],
['20060802',5.5888],
['20060803',5.576],
['20060804',5.5697],
['20060807',5.5824],
['20060808',5.5824],
['20060809',5.6143],
['20060810',5.6079],
['20060811',5.6079],
['20060814',5.6143],
['20060815',5.5952],
['20060816',5.6334],
['20060817',5.6334],
['20060818',5.6525],
['20060821',5.6079],
['20060822',5.6015],
['20060823',5.5888],
['20060824',5.6079],
['20060825',5.6079],
['20060828',5.6143],
['20060829',5.6398],
['20060830',5.6908],
['20060831',5.7672],
['20060901',5.8373],
['20060904',5.8182],
['20060905',5.8564],
['20060906',5.8373],
['20060907',5.8055],
['20060908',5.8373],
['20060911',5.8118],
['20060912',5.8118],
['20060913',5.8182],
['20060914',5.7672],
['20060915',5.7991],
['20060918',5.8437],
['20060919',5.8055],
['20060920',5.7991],
['20060921',5.8055],
['20060922',5.8118],
['20060925',5.8118],
['20060926',5.7545],
['20060927',5.8118],
['20060928',5.8373],
['20060929',5.8246],
['20061003',5.7991],
['20061004',5.7736],
['20061005',5.8182],
['20061006',5.7927],
['20061009',5.7736],
['20061010',5.7417],
['20061011',5.729],
['20061012',5.7354],
['20061013',5.7481],
['20061016',5.7162],
['20061017',5.7354],
['20061018',5.7417],
['20061019',5.7099],
['20061020',5.7035],
['20061023',5.678],
['20061024',5.6525],
['20061025',5.6461],
['20061026',5.6716],
['20061027',5.678],
['20061031',5.678],
['20061101',5.6461],
['20061102',5.7099],
['20061103',5.7035],
['20061106',5.6971],
['20061107',5.6908],
['20061108',5.6589],
['20061109',5.6461],
['20061110',5.6525],
['20061113',5.5952],
['20061114',5.5569],
['20061115',5.5697],
['20061116',5.5697],
['20061117',5.6015],
['20061120',5.5633],
['20061121',5.5633],
['20061122',5.6015],
['20061123',5.5824],
['20061124',5.5506],
['20061127',5.5314],
['20061128',5.4932],
['20061129',5.4741],
['20061130',5.4805],
['20061201',5.4358],
['20061204',5.4677],
['20061205',5.5187],
['20061206',5.5123],
['20061207',5.5314],
['20061208',5.4677],
['20061211',5.4932],
['20061212',5.4996],
['20061213',5.4741],
['20061214',5.5633],
['20061215',5.5888],
['20061218',5.6079],
['20061219',5.576],
['20061220',5.5952],
['20061221',5.5697],
['20061222',5.5824],
['20061227',5.5569],
['20061228',5.576],
['20061229',5.576],
['20070102',5.576],
['20070103',5.5442],
['20070104',5.4932],
['20070105',5.5378],
['20070108',5.5314],
['20070109',5.5569],
['20070110',5.6143],
['20070111',5.576],
['20070112',5.576],
['20070115',5.5633],
['20070116',5.5314],
['20070117',5.5697],
['20070118',5.5569],
['20070119',5.5633],
['20070122',5.627],
['20070123',5.627],
['20070124',5.6015],
['20070125',5.576],
['20070126',5.576],
['20070129',5.5633],
['20070130',5.576],
['20070131',5.5314],
['20070201',5.6207],
['20070202',5.6589],
['20070205',5.6143],
['20070206',5.6525],
['20070207',5.6334],
['20070208',5.627],
['20070209',5.5697],
['20070212',5.5569],
['20070213',5.5569],
['20070214',5.5378],
['20070215',5.5697],
['20070216',5.5506],
['20070221',5.5314],
['20070222',5.5697],
['20070223',5.5633],
['20070226',5.5569],
['20070227',5.5187],
['20070228',5.4486],
['20070301',5.3849],
['20070302',5.4104],
['20070305',5.3148],
['20070306',5.3721],
['20070307',5.3148],
['20070308',5.3211],
['20070309',5.4104],
['20070312',5.4104],
['20070313',5.353],
['20070314',5.2829],
['20070315',5.2956],
['20070316',5.2829],
['20070319',5.2829],
['20070320',5.4613],
['20070321',5.455],
['20070322',5.5059],
['20070323',5.5123],
['20070326',5.5952],
['20070327',5.7226],
['20070328',5.5697],
['20070329',5.5633],
['20070330',5.5633],
['20070402',5.6079],
['20070403',5.5824],
['20070404',5.6398],
['20070410',5.5952],
['20070411',5.6143],
['20070412',5.6079],
['20070413',5.678],
['20070416',5.7672],
['20070417',5.8373],
['20070418',5.9393],
['20070419',5.8756],
['20070420',5.9202],
['20070423',5.9265],
['20070424',5.8883],
['20070425',5.9393],
['20070426',5.9839],
['20070427',5.9839],
['20070430',5.9265],
['20070502',5.9839],
['20070503',6.0221],
['20070504',6.054],
['20070507',6.0667],
['20070508',6.0565],
['20070509',6.0215],
['20070510',6.0215],
['20070511',5.9304],
['20070514',5.9794],
['20070515',5.9163],
['20070516',5.8743],
['20070517',5.8813],
['20070518',5.8533],
['20070521',5.8112],
['20070522',5.8042],
['20070523',5.7972],
['20070525',5.7201],
['20070528',5.7761],
['20070529',5.7832],
['20070530',5.7271],
['20070531',5.7131],
['20070601',5.7271],
['20070604',5.7621],
['20070605',5.7621],
['20070606',5.7271],
['20070607',5.706],
['20070608',5.6359],
['20070611',5.7411],
['20070612',5.706],
['20070613',5.7201],
['20070614',5.8042],
['20070615',5.8112],
['20070618',5.7832],
['20070620',5.7411],
['20070621',5.7691],
['20070622',5.7271],
['20070625',5.678],
['20070626',5.7131],
['20070627',5.7832],
['20070628',5.7972],
['20070629',5.7761],
['20070703',5.7832],
['20070704',5.7832],
['20070705',5.8953],
['20070706',5.9093],
['20070709',5.9234],
['20070710',5.9444],
['20070711',6.2037],
['20070712',6.2458],
['20070713',6.5753],
['20070716',6.4211],
['20070717',6.3159],
['20070718',6.3369],
['20070719',6.407],
['20070720',6.4421],
['20070723',6.5262],
['20070724',6.407],
['20070725',6.4351],
['20070726',6.3369],
['20070727',6.2037],
['20070730',6.386],
['20070731',6.4],
['20070801',6.2248],
['20070802',6.3299],
['20070803',6.3089],
['20070806',6.3089],
['20070807',6.3089],
['20070808',6.3369],
['20070809',6.2949],
['20070810',6.2738],
['20070813',6.3089],
['20070814',6.3019],
['20070815',6.0986],
['20070816',6.0285],
['20070817',5.9724],
['20070820',5.9935],
['20070821',6.0565],
['20070822',6.2388],
['20070823',6.3369],
['20070824',6.2458],
['20070827',6.414],
['20070828',6.3299],
['20070829',6.2178],
['20070830',6.2458],
['20070831',6.3019],
['20070903',6.2668],
['20070904',6.3159],
['20070905',6.3159],
['20070906',6.379],
['20070907',6.4],
['20070910',6.3229],
['20070911',6.3159],
['20070912',6.393],
['20070913',6.4211],
['20070914',6.379],
['20070917',6.2738],
['20070918',6.2809],
['20070919',6.379],
['20070920',6.3439],
['20070921',6.372],
['20070924',6.358],
['20070925',6.3439],
['20070927',6.358],
['20070928',6.3439],
['20071003',6.9047],
['20071004',6.9047],
['20071005',6.9608],
['20071008',6.7575],
['20071009',6.8416],
['20071010',6.7996],
['20071011',6.7856],
['20071012',6.7856],
['20071015',6.7645],
['20071016',6.6874],
['20071017',6.7575],
['20071018',6.7014],
['20071022',6.5893],
['20071023',6.6313],
['20071024',6.5472],
['20071025',6.5893],
['20071026',6.8346],
['20071029',7.2027],
['20071030',7.1851],
['20071031',7.2728],
['20071101',7.2202],
['20071102',7.0099],
['20071105',6.9748],
['20071106',6.8767],
['20071107',7.2202],
['20071108',7.5707],
['20071109',7.816],
['20071112',7.9913],
['20071113',8.1139],
['20071114',8.2366],
['20071115',7.9387],
['20071116',7.5356],
['20071119',7.3779],
['20071120',7.5356],
['20071121',7.3253],
['20071122',7.0029],
['20071123',7.2202],
['20071126',7.6057],
['20071127',7.5882],
['20071128',7.7284],
['20071129',8.149],
['20071130',8.0263],
['20071203',8.2892],
['20071204',8.0789],
['20071205',8.3593],
['20071206',8.4294],
['20071207',7.9212],
['20071210',7.7634],
['20071211',8.1315],
['20071212',7.9737],
['20071213',7.6933],
['20071214',7.8335],
['20071217',7.5882],
['20071218',7.9737],
['20071219',8.0614],
['20071220',7.8686],
['20071221',8.0614],
['20071224',8.2717],
['20071227',8.149],
['20071228',8.0438],
['20071231',8.3768],
['20080102',8.3593],
['20080103',8.0789],
['20080104',8.4119],
['20080107',8.2191],
['20080108',8.149],
['20080109',8.3768],
['20080110',8.2191],
['20080111',8.0789],
['20080114',8.1315],
['20080115',8.2541],
['20080116',8.0964],
['20080117',8.2541],
['20080118',7.9913],
['20080121',7.7284],
['20080122',7.3253],
['20080123',7.5707],
['20080124',7.1501],
['20080125',7.2903],
['20080128',7.1676],
['20080129',7.3604],
['20080130',7.2903],
['20080131',7.483],
['20080201',7.6758],
['20080204',7.8335],
['20080205',7.8861],
['20080206',7.4305],
['20080211',7.3429],
['20080212',7.483],
['20080213',7.5531],
['20080214',7.7109],
['20080215',7.8335],
['20080218',7.5882],
['20080219',7.7459],
['20080220',7.5181],
['20080221',7.6933],
['20080222',7.6408],
['20080225',7.7634],
['20080226',7.9737],
['20080227',8.0789],
['20080228',8.149],
['20080229',7.9913],
['20080303',7.8861],
['20080304',7.9913],
['20080305',7.9913],
['20080306',7.9913],
['20080307',7.6583],
['20080310',7.8861],
['20080311',7.9913],
['20080312',7.9737],
['20080313',7.6408],
['20080314',7.8511],
['20080317',7.6758],
['20080318',7.7459],
['20080319',7.6232],
['20080320',7.6408],
['20080325',7.7985],
['20080326',7.6583],
['20080327',7.816],
['20080328',8.0088],
['20080331',8.2016],
['20080401',8.2717],
['20080402',8.1139],
['20080403',8.1315],
['20080407',7.8511],
['20080408',7.6933],
['20080409',7.6758],
['20080410',7.6057],
['20080411',7.6408],
['20080414',7.5006],
['20080415',7.6232],
['20080416',7.5882],
['20080417',7.6057],
['20080418',7.6758],
['20080421',7.7985],
['20080422',7.8861],
['20080423',7.7985],
['20080424',7.781],
['20080425',7.781],
['20080428',7.9387],
['20080429',8.0614],
['20080430',7.9913],
['20080502',8.1315],
['20080505',8.0386],
['20080506',7.8458],
['20080507',7.6415],
['20080508',7.7109],
['20080509',7.7109],
['20080513',7.7301],
['20080514',7.6569],
['20080515',7.5875],
['20080516',7.5875],
['20080519',7.5798],
['20080520',7.4024],
['20080521',7.5027],
['20080522',7.441],
['20080523',7.3639],
['20080526',7.4795],
['20080527',7.3716],
['20080528',7.5027],
['20080529',7.4795],
['20080530',7.4101],
['20080602',7.441],
['20080603',7.5027],
['20080604',7.5644],
['20080605',7.5412],
['20080606',7.5335],
['20080610',7.4101],
['20080611',7.4641],
['20080612',7.4641],
['20080613',7.441],
['20080616',7.4795],
['20080617',7.4333],
['20080618',7.4487],
['20080619',7.3716],
['20080620',7.3947],
['20080623',7.4101],
['20080624',7.3793],
['20080625',7.4179],
['20080626',7.3947],
['20080627',7.3099],
['20080630',7.148],
['20080702',7.1403],
['20080703',7.1017],
['20080704',7.1094],
['20080707',7.1171],
['20080708',6.9475],
['20080709',6.9244],
['20080710',6.8704],
['20080711',6.8318],
['20080714',6.8241],
['20080715',6.6082],
['20080716',6.7085],
['20080717',6.6622],
['20080718',6.7162],
['20080721',6.9012],
['20080722',6.8395],
['20080723',6.8935],
['20080724',6.8241],
['20080725',6.9089],
['20080728',6.8627],
['20080729',6.747],
['20080730',6.747],
['20080731',6.6545],
['20080801',6.7393],
['20080804',6.6622],
['20080805',6.562],
['20080807',6.6082],
['20080808',6.7624],
['20080811',6.8164],
['20080812',6.9089],
['20080813',6.9167],
['20080814',6.9167],
['20080815',6.9244],
['20080818',6.8935],
['20080819',6.801],
['20080820',6.8627],
['20080821',6.6699],
['20080825',6.8241],
['20080826',6.7779],
['20080827',6.855],
['20080828',6.7856],
['20080829',6.7933],
['20080901',6.747],
['20080902',6.8627],
['20080903',6.7856],
['20080904',6.747],
['20080905',6.7624],
['20080908',6.9089],
['20080909',7.0477],
['20080910',7.04],
['20080911',7.0554],
['20080912',7.0477],
['20080916',6.9629],
['20080917',6.9398],
['20080918',6.9475],
['20080919',6.8858],
['20080922',6.8241],
['20080923',6.7085],
['20080924',6.7085],
['20080925',6.7085],
['20080926',6.6776],
['20080929',6.7085],
['20080930',6.7701],
['20081002',6.8473],
['20081003',6.7779],
['20081006',6.4694],
['20081008',5.9374],
['20081009',6.1301],
['20081010',5.6289],
['20081013',5.9913],
['20081014',5.8603],
['20081015',5.5827],
['20081016',5.3591],
['20081017',5.0815],
['20081020',5.1586],
['20081021',5.0969],
['20081022',4.881],
['20081023',4.7191],
['20081024',4.3952],
['20081027',3.6203],
['20081028',4.3952],
['20081029',4.7345],
['20081030',5.2203],
['20081031',5.1586],
['20081103',5.2819],
['20081104',5.2048],
['20081105',5.1663],
['20081106',5.1277],
['20081107',5.7832],
['20081110',5.413],
['20081111',5.0969],
['20081112',5.2048],
['20081113',4.9658],
['20081114',5.1586],
['20081117',5.2203],
['20081118',5.0121],
['20081119',5.0121],
['20081120',4.881],
['20081121',5.1277],
['20081124',4.935],
['20081125',5.1894],
['20081126',5.2665],
['20081127',5.1663],
['20081128',5.3205],
['20081201',5.066],
['20081202',4.8501],
['20081203',4.7268],
['20081204',4.6497],
['20081205',4.7268],
['20081208',5.0892],
['20081209',4.8656],
['20081210',5.0121],
['20081211',4.9427],
['20081212',4.935],
['20081215',4.9658],
['20081216',4.9966],
['20081217',4.8116],
['20081218',4.7807],
['20081219',4.6574],
['20081222',4.588],
['20081223',4.5109],
['20081224',4.5571],
['20081229',4.5494],
['20081230',4.4569],
['20081231',4.5109],
['20090102',4.6574],
['20090105',4.6574],
['20090106',4.6111],
['20090107',4.6034],
['20090108',4.6497],
['20090109',4.7962],
['20090112',4.9118],
['20090113',4.9195],
['20090114',4.8039],
['20090115',4.6805],
['20090116',4.7191],
['20090119',4.827],
['20090120',4.8347],
['20090121',4.8501],
['20090122',4.7036],
['20090123',4.7036],
['20090129',4.6959],
['20090130',4.9118],
['20090202',4.7807],
['20090203',4.7885],
['20090204',4.8193],
['20090205',4.7962],
['20090206',4.7191],
['20090209',4.7345],
['20090210',4.6805],
['20090211',4.6805],
['20090212',4.6497],
['20090213',4.7113],
['20090216',4.7113],
['20090217',4.6265],
['20090218',4.6574],
['20090219',4.5571],
['20090220',4.4492],
['20090223',4.6497],
['20090224',4.5109],
['20090225',4.5725],
['20090226',4.6265],
['20090227',4.5494],
['20090302',4.4338],
['20090303',4.3952],
['20090304',4.4415],
['20090305',4.3644],
['20090306',4.241],
['20090309',4.1562],
['20090310',4.241],
['20090311',4.3181],
['20090312',4.3258],
['20090313',4.3798],
['20090316',4.5417],
['20090317',4.4338],
['20090318',4.3952],
['20090319',4.295],
['20090320',4.3335],
['20090323',4.5109],
['20090324',4.6188],
['20090325',4.6034],
['20090326',4.5571],
['20090327',4.6034],
['20090330',4.6111],
['20090331',4.7268],
['20090401',4.6265],
['20090402',4.7653],
['20090403',4.7345],
['20090406',4.8964],
['20090407',4.9735],
['20090408',5.066],
['20090409',5.2125],
['20090414',5.3668],
['20090415',5.2357],
['20090416',5.0429],
['20090417',5.2511],
['20090420',5.2819],
['20090421',5.3436],
['20090422',5.4979],
['20090423',5.4747],
['20090424',5.5056],
['20090427',5.4207],
['20090428',5.3436],
['20090429',5.4362],
['20090430',5.5827],
['20090504',5.6675],
['20090505',5.7138],
['20090506',5.7909],
['20090507',5.6752],
['20090508',5.7215],
['20090511',5.6983],
['20090512',5.9219],
['20090513',6.0068],
['20090514',5.9836],
['20090515',6.0068],
['20090518',6.2381],
['20090519',6.1764],
['20090520',5.9759],
['20090521',5.9451],
['20090522',5.8988],
['20090525',5.9451],
['20090526',5.8757],
['20090527',6.053],
['20090529',6.053],
['20090601',6.053],
['20090602',6.0068],
['20090603',5.9142],
['20090604',6.1301],
['20090605',6.2381],
['20090608',6.0607],
['20090609',6.0376],
['20090610',6.1224],
['20090611',6.053],
['20090612',6.107],
['20090615',6.0916],
['20090616',6.0607],
['20090617',6.0916],
['20090618',6.0685],
['20090619',6.0839],
['20090622',6.1224],
['20090623',6.1687],
['20090624',6.1379],
['20090625',6.346],
['20090626',6.4232],
['20090629',6.3769],
['20090630',6.2844],
['20090702',6.1533],
['20090703',6.1841],
['20090706',6.1456],
['20090707',6.1379],
['20090708',6.1687],
['20090709',6.3306],
['20090710',6.215],
['20090713',6.1995],
['20090714',6.2073],
['20090715',6.4771],
['20090716',6.4617],
['20090717',6.508],
['20090720',6.454],
['20090721',6.2921],
['20090722',6.4232],
['20090723',6.6622],
['20090724',6.5465],
['20090727',6.4386],
['20090728',6.454],
['20090729',6.4309],
['20090730',6.6391],
['20090731',6.6313],
['20090803',6.6622],
['20090804',6.5157],
['20090805',6.454],
['20090806',6.5311],
['20090807',6.4926],
['20090810',6.5311],
['20090811',6.5542],
['20090812',6.4694],
['20090813',6.5234],
['20090814',6.562],
['20090817',6.3923],
['20090818',6.4771],
['20090819',6.3769],
['20090820',6.4154],
['20090821',6.3538],
['20090824',6.4926],
['20090825',6.4694],
['20090826',6.3923],
['20090827',6.5851],
['20090828',6.5774],
['20090831',6.4771],
['20090901',6.6853],
['20090902',6.7007],
['20090903',6.7779],
['20090904',7.0477],
['20090907',7.1326],
['20090908',7.2791],
['20090909',7.3407],
['20090910',7.4487],
['20090911',7.3022],
['20090914',7.3253],
['20090915',7.387],
['20090916',7.5104],
['20090917',7.441],
['20090918',7.4024],
['20090921',7.2868],
['20090922',7.5027],
['20090923',7.4873],
['20090924',7.3253],
['20090925',7.3022],
['20090928',7.2791],
['20090929',7.3253],
['20090930',7.5489],
['20091002',7.4333],
['20091005',7.4795],
['20091006',7.3639],
['20091007',7.495],
['20091008',7.5181],
['20091009',7.5335],
['20091012',7.4179],
['20091013',7.5567],
['20091014',7.5721],
['20091015',7.6338],
['20091016',7.5875],
['20091019',7.6261],
['20091020',7.5798],
['20091021',7.4641],
['20091022',7.3947],
['20091023',7.5104],
['20091027',7.3639],
['20091028',7.3639],
['20091029',7.2791],
['20091030',7.2868],
['20091102',7.1171],
['20091103',6.8858],
['20091104',6.986],
['20091105',6.9089],
['20091106',6.9398],
['20091109',7.04],
['20091110',7.0863],
['20091111',7.1326],
['20091112',7.202],
['20091113',7.148],
['20091116',7.1171],
['20091117',7.0786],
['20091118',7.0632],
['20091119',7.1865],
['20091120',7.2097],
['20091123',7.2251],
['20091124',7.2714],
['20091125',7.3407],
['20091126',7.2636],
['20091127',6.9475],
['20091130',7.1326],
['20091201',7.2174],
['20091202',7.148],
['20091203',7.1788],
['20091204',7.1017],
['20091207',7.1942],
['20091208',7.2251],
['20091209',7.2097],
['20091210',7.2482],
['20091211',7.333],
['20091214',7.4179],
['20091215',7.495],
['20091216',7.4564],
['20091217',7.3639],
['20091218',7.3562],
['20091221',7.3022],
['20091222',7.2328],
['20091223',7.2945],
['20091224',7.3176],
['20091228',7.387],
['20091229',7.4487],
['20091230',7.5104],
['20091231',7.5258],
['20100104',7.5875],
['20100105',7.6029],
['20100106',7.5721],
['20100107',7.6183],
['20100108',7.6415],
['20100111',7.6183],
['20100112',7.4795],
['20100113',7.2945],
['20100114',7.2559],
['20100115',7.148],
['20100118',7.1788],
['20100119',7.1403],
['20100120',7.0477],
['20100121',7.0092],
['20100122',6.8781],
['20100125',7.0323],
['20100126',6.8858],
['20100127',6.7085],
['20100128',6.6622],
['20100129',6.5465],
['20100201',6.6005],
['20100202',6.6622],
['20100203',6.5697],
['20100204',6.4154],
['20100205',6.2689],
['20100208',6.4386],
['20100209',6.6082],
['20100210',6.508],
['20100211',6.562],
['20100212',6.5311],
['20100217',6.6082],
['20100218',6.6545],
['20100219',6.562],
['20100222',6.693],
['20100223',6.7239],
['20100224',6.7085],
['20100225',6.6468],
['20100226',6.747],
['20100301',6.8164],
['20100302',6.9089],
['20100303',6.9321],
['20100304',6.9167],
['20100305',7.0863],
['20100308',7.094],
['20100309',7.0632],
['20100310',7.202],
['20100311',7.1557],
['20100312',7.1326],
['20100315',7.1788],
['20100316',7.2174],
['20100317',7.4641],
['20100318',7.2714],
['20100319',7.4179],
['20100322',7.2945],
['20100323',7.3947],
['20100324',7.2868],
['20100325',7.2405],
['20100326',7.2868],
['20100329',7.3947],
['20100330',7.3485],
['20100331',7.4487],
['20100401',7.6338],
['20100407',7.6723],
['20100408',7.6261],
['20100409',7.9615],
['20100412',8.0964],
['20100413',8.0579],
['20100414',7.9808],
['20100415',7.9036],
['20100416',7.9036],
['20100419',7.9422],
['20100420',8],
['20100421',7.8651],
['20100422',7.9036],
['20100423',7.7109],
['20100426',7.8458],
['20100427',7.6569],
['20100428',7.5644],
['20100429',7.3253],
['20100430',7.3253],
['20100503',7.2868],
['20100504',7.2482],
['20100505',7.2097],
['20100506',7.2097],
['20100507',7.2636],
['20100510',7.2945],
['20100511',7.2559],
['20100512',7.3176],
['20100513',7.5952],
['20100514',7.4641],
['20100517',7.5065],
['20100518',7.3454],
['20100519',7.3199],
['20100520',7.2351],
['20100524',7.286],
['20100525',7.303],
['20100526',7.1757],
['20100527',7.3454],
['20100528',7.2436],
['20100531',7.3199],
['20100601',7.4047],
['20100602',7.4896],
['20100603',7.3708],
['20100604',7.4556],
['20100607',7.3623],
['20100608',7.4811],
['20100609',7.532],
['20100610',7.5829],
['20100611',7.6762],
['20100614',7.7355],
['20100615',7.7271],
['20100617',7.8458],
['20100618',8.0409],
['20100621',8.1427],
['20100622',8.1681],
['20100623',8.2105],
['20100624',8.2445],
['20100625',8.1851],
['20100628',8.1257],
['20100629',8.1172],
['20100630',8.2275],
['20100702',8.2869],
['20100705',8.2699],
['20100706',8.448],
['20100707',8.4226],
['20100708',8.3717],
['20100709',8.465],
['20100712',8.3717],
['20100713',8.2699],
['20100714',8.2699],
['20100715',8.1766],
['20100716',8.1936],
['20100719',8.1936],
['20100720',8.1936],
['20100721',8.1342],
['20100722',8.2445],
['20100723',8.236],
['20100726',8.2445],
['20100727',8.2699],
['20100728',8.2699],
['20100729',8.2614],
['20100730',8.2275],
['20100802',8.2699],
['20100803',8.236],
['20100804',8.2614],
['20100805',8.219],
['20100806',8.2275],
['20100809',8.219],
['20100810',8.1342],
['20100811',8.1766],
['20100812',8.0918],
['20100813',8.0239],
['20100816',8.1257],
['20100817',8.1087],
['20100818',7.99],
['20100819',7.9306],
['20100820',7.9476],
['20100823',8.0494],
['20100824',7.9221],
['20100825',7.8713],
['20100826',7.8797],
['20100827',7.9137],
['20100830',7.9646],
['20100831',7.973],
['20100901',7.9985],
['20100902',8.0748],
['20100903',8.0833],
['20100906',8.2529],
['20100907',8.2869],
['20100908',8.2784],
['20100909',8.2445],
['20100910',8.2699],
['20100913',8.2784],
['20100914',8.2105],
['20100915',8.2275],
['20100916',8.2529],
['20100917',8.2699],
['20100920',8.219],
['20100921',8.219],
['20100922',8.2275],
['20100924',8.236],
['20100927',8.236],
['20100928',8.2275],
['20100929',8.3547],
['20100930',8.3208],
['20101004',8.2529],
['20101005',8.2021],
['20101006',8.2021],
['20101007',8.1851],
['20101008',8.1681],
['20101011',8.1342],
['20101012',8.0663],
['20101013',8.1596],
['20101014',8.1003],
['20101015',8.0748],
['20101018',8.0239],
['20101019',8.1172],
['20101020',8.0918],
['20101021',8.0918],
['20101022',8.0239],
['20101025',8.0324],
['20101026',7.99],
['20101027',7.9815],
['20101028',7.9561],
['20101029',7.9221],
['20101101',8.0324],
['20101102',8.0579],
['20101103',8.1172],
['20101104',8.1257],
['20101105',8.0579],
['20101108',8.0494],
['20101109',8.0918],
['20101110',8.0918],
['20101111',8.1172],
['20101112',8.1172],
['20101115',8.1512],
['20101116',8.1172],
['20101117',8.0579],
['20101118',8.0579],
['20101119',8.0324],
['20101122',8.0833],
['20101123',8.007],
['20101124',8.0154],
['20101125',7.99],
['20101126',7.9985],
['20101129',8.0833],
['20101130',8.0239],
['20101201',8.0748],
['20101202',8.0579],
['20101203',7.9815],
['20101206',7.9815],
['20101207',7.9815],
['20101208',7.9221],
['20101209',8.007],
['20101210',8.007],
['20101213',7.99],
['20101214',7.99],
['20101215',7.9306],
['20101216',7.8797],
['20101217',7.9646],
['20101220',7.9221],
['20101221',7.9561],
['20101222',7.9306],
['20101223',7.8713],
['20101224',7.8458],
['20101228',7.761],
['20101229',7.9137],
['20101230',7.9052],
['20101231',7.8288],
['20110103',7.8373],
['20110104',7.8458],
['20110105',7.8458],
['20110106',7.7271],
['20110107',7.7355],
['20110110',7.6677],
['20110111',7.744],
['20110112',7.7271],
['20110113',7.6931],
['20110114',7.6507],
['20110117',7.6507],
['20110118',7.7016],
['20110119',7.7101],
['20110120',7.6931],
['20110121',7.6762],
['20110124',7.6253],
['20110125',7.6083],
['20110126',7.5829],
['20110127',7.5489],
['20110128',7.5744],
['20110131',7.4811],
['20110201',7.5235],
['20110202',7.6762],
['20110207',7.5659],
['20110208',7.5489],
['20110209',7.4302],
['20110210',7.3793],
['20110211',7.2945],
['20110214',7.269],
['20110215',7.3623],
['20110216',7.4217],
['20110217',7.3539],
['20110218',7.3793],
['20110221',7.498],
['20110222',7.4302],
['20110223',7.4726],
['20110224',7.303],
['20110225',7.4302],
['20110228',7.4302],
['20110301',7.5489],
['20110302',7.5235],
['20110303',7.5405],
['20110304',7.5998],
['20110307',7.532],
['20110308',7.6931],
['20110309',7.7186],
['20110310',7.7101],
['20110311',7.5914],
['20110314',7.6338],
['20110315',7.4472],
['20110316',7.6253],
['20110317',7.6677],
['20110318',7.6422],
['20110321',7.6931],
['20110322',7.7186],
['20110323',7.7525],
['20110324',7.7271],
['20110325',7.8034],
['20110328',7.9137],
['20110329',7.8543],
['20110330',7.99],
['20110331',7.8967],
['20110401',7.99],
['20110404',8.0748],
['20110406',8.1257],
['20110407',8.1003],
['20110408',8.1596],
['20110411',8.1003],
['20110412',7.9646],
['20110413',8.0409],
['20110414',8.0409],
['20110415',8.0663],
['20110418',8.1087],
['20110419',8.0918],
['20110420',8.0663],
['20110421',8.1427],
['20110426',8.0918],
['20110427',8.1342],
['20110428',8.2105],
['20110429',8.1766],
['20110503',8.219],
['20110504',8.2105],
['20110505',8.2275],
['20110506',8.1596],
['20110509',8.2699],
['20110511',8.2699],
['20110512',8.1766],
['20110513',8.2784],
['20110516',8.2954],
['20110517',8.3293],
['20110518',8.3293],
['20110519',8.2869],
['20110520',8.2614],
['20110523',8.0426],
['20110524',8.1546],
['20110525',8.2012],
['20110526',8.2479],
['20110527',8.2479],
['20110530',8.2385],
['20110531',8.3412],
['20110601',8.4251],
['20110602',8.3878],
['20110603',8.1546],
['20110607',8.2105],
['20110608',8.1452],
['20110609',8.1639],
['20110610',8.0892],
['20110613',8.1359],
['20110614',8.1359],
['20110615',8.0799],
['20110616',8.1546],
['20110617',8.0613],
['20110620',8.0426],
['20110621',8.0519],
['20110622',8.0333],
['20110623',8.0892],
['20110624',8.0613],
['20110627',8.0986],
['20110628',8.0986],
['20110629',8.0986],
['20110630',8.2479],
['20110704',8.3505],
['20110705',8.3785],
['20110706',8.3691],
['20110707',8.4624],
['20110708',8.5651],
['20110711',8.5557],
['20110712',8.3318],
['20110713',8.3691],
['20110714',8.3318],
['20110715',8.4065],
['20110718',8.3132],
['20110719',8.5091],
['20110720',8.5278],
['20110721',8.5371],
['20110722',8.5091],
['20110725',8.5371],
['20110726',8.6211],
['20110727',8.6397],
['20110728',8.6957],
['20110729',8.929],
['20110801',8.7424],
['20110802',8.7424],
['20110803',8.5091],
['20110804',8.4904],
['20110805',8.1172],
['20110808',8.1546],
['20110809',7.8653],
['20110810',7.9493],
['20110811',7.9773],
['20110812',8.0706],
['20110815',8.0146],
['20110816',8.0426],
['20110817',8.2199],
['20110818',8.1172],
['20110819',8.1359],
['20110822',8.4158],
['20110823',8.3225],
['20110824',8.2292],
['20110825',8.4251],
['20110826',8.4904],
['20110829',8.3598],
['20110830',8.3971],
['20110831',8.5371],
['20110901',8.5184],
['20110902',8.2852],
['20110905',8.2479],
['20110906',8.5557],
['20110907',8.649],
['20110908',8.5837],
['20110909',8.761],
['20110912',8.5651],
['20110914',8.6677],
['20110915',8.6957],
['20110916',8.6304],
['20110919',8.5557],
['20110920',8.677],
['20110921',8.677],
['20110922',8.5464],
['20110923',8.5371],
['20110926',8.3878],
['20110927',8.4345],
['20110928',8.2105],
['20110930',8.2479],
['20111003',8.2199],
['20111004',8.0426],
['20111006',7.9306],
['20111007',7.94],
['20111010',7.9679],
['20111011',7.8933],
['20111012',7.912],
['20111013',7.8467],
['20111014',7.9213],
['20111017',7.9306],
['20111018',7.8187],
['20111019',7.9493],
['20111020',8.0146],
['20111021',8.0613],
['20111024',8.2012],
['20111025',8.1639],
['20111026',8.1732],
['20111027',8.1546],
['20111028',8.2852],
['20111031',8.2199],
['20111101',8.3412],
['20111102',8.3505],
['20111103',8.2385],
['20111104',8.3691],
['20111107',8.4158],
['20111108',8.4531],
['20111109',8.5278],
['20111110',8.2852],
['20111111',8.3505],
['20111114',8.4158],
['20111115',8.3878],
['20111116',8.3225],
['20111117',8.4065],
['20111118',8.3691],
['20111121',8.3785],
['20111122',8.4251],
['20111123',8.2665],
['20111124',8.2665],
['20111125',8.2385],
['20111128',8.4438],
['20111129',8.2945],
['20111130',8.2572],
['20111201',8.3132],
['20111202',8.4345],
['20111205',8.3318],
['20111206',8.3598],
['20111207',8.3878],
['20111208',8.3691],
['20111209',8.2012],
['20111212',8.2665],
['20111213',8.2292],
['20111214',8.1825],
['20111215',8.1546],
['20111216',8.2572],
['20111219',8.2479],
['20111220',8.2665],
['20111221',8.3225],
['20111222',8.3225],
['20111223',8.3971],
['20111228',8.3785],
['20111229',8.3412],
['20111230',8.4065],
['20120103',8.3971],
['20120104',8.4251],
['20120105',8.4531],
['20120106',8.5091],
['20120109',8.6117],
['20120110',8.5744],
['20120111',8.4718],
['20120112',8.4065],
['20120113',8.3691],
['20120116',8.3225],
['20120117',8.4345],
['20120118',8.5464],
['20120119',8.3971],
['20120120',8.5371],
['20120126',8.5557],
['20120127',8.5278],
['20120130',8.5464],
['20120131',8.5931],
['20120201',8.5371],
['20120202',8.4904],
['20120203',8.5184],
['20120206',8.4904],
['20120207',8.5651],
['20120208',8.5557],
['20120209',8.5091],
['20120210',8.4998],
['20120213',8.5557],
['20120214',8.5371],
['20120215',8.6117],
['20120216',8.6677],
['20120217',8.8263],
['20120220',8.873],
['20120221',8.9103],
['20120222',8.8823],
['20120223',8.8636],
['20120224',8.9569],
['20120227',8.8916],
['20120228',9.0316],
['20120229',9.2555],
['20120301',9.1622],
['20120302',9.1062],
['20120305',9.2275],
['20120306',9.0502],
['20120307',8.9943],
['20120308',9.1809],
['20120309',9.1062],
['20120312',9.1529],
['20120313',9.2555],
['20120314',9.1622],
['20120315',9.1902],
['20120316',9.2275],
['20120319',9.1435],
['20120320',9.3208],
['20120321',9.4701],
['20120322',9.5634],
['20120323',9.3768],
['20120326',9.4934],
['20120327',9.4701],
['20120328',9.3768],
['20120329',9.4001],
['20120330',9.2555],
['20120402',9.4001],
['20120403',9.3768],
['20120405',9.5401],
['20120410',9.4001],
['20120411',9.3301],
['20120412',9.4001],
['20120413',9.4235],
['20120416',9.4934],
['20120417',9.4235],
['20120418',9.4468],
['20120419',9.5168],
['20120420',9.4468],
['20120423',9.3115],
['20120424',9.3115],
['20120425',9.2928],
['20120426',9.2555],
['20120427',9.2275],
['20120430',9.2555],
['20120502',9.2742],
['20120503',9.2462],
['20120504',9.2835],
['20120507',9.2182],
['20120508',9.2368],
['20120509',9.1529],
['20120510',9.1529],
['20120511',8.929],
['20120514',8.7424],
['20120515',8.733],
['20120516',8.5557],
['20120517',8.4811],
['20120518',8.4251],
['20120521',8.5091],
['20120522',8.733],
['20120523',8.5557],
['20120524',8.5464],
['20120525',8.5464],
['20120528',8.5464],
['20120529',8.5744],
['20120530',8.4998],
['20120531',8.5184],
['20120601',8.5464],
['20120604',8.5278],
['20120605',8.5931],
['20120606',8.6304],
['20120607',8.4774],
['20120608',8.2926],
['20120611',8.3953],
['20120612',8.3234],
['20120613',8.3029],
['20120614',8.344],
['20120615',8.4261],
['20120618',8.5082],
['20120619',8.4261],
['20120620',8.4466],
['20120621',8.4158],
['20120622',8.3747],
['20120625',8.4363],
['20120626',8.4158],
['20120627',8.4671],
['20120628',8.3337],
['20120629',8.4261],
['20120703',8.4979],
['20120704',8.7032],
['20120705',8.7853],
['20120706',8.7955],
['20120709',8.9084],
['20120710',8.9084],
['20120711',8.9392],
['20120712',8.8263],
['20120713',8.8982],
['20120716',8.9187],
['20120717',8.8879],
['20120718',9.0316],
['20120719',9.1445],
['20120720',9.1445],
['20120723',8.9392],
['20120724',9.0213],
['20120725',9.0111],
['20120726',8.97],
['20120727',9.0213],
['20120730',9.124],
['20120731',9.1958],
['20120801',9.165],
['20120802',9.2266],
['20120803',9.1445],
['20120806',9.1958],
['20120807',9.2061],
['20120808',9.1547],
['20120809',9.2574],
['20120810',9.3087],
['20120813',9.319],
['20120814',9.3497],
['20120815',9.3805],
['20120816',9.36],
['20120817',9.4318],
['20120820',9.4216],
['20120821',9.4832],
['20120822',9.4421],
['20120823',9.4216],
['20120824',9.4113],
['20120827',9.4524],
['20120828',9.4626],
['20120829',9.4524],
['20120830',9.3395],
['20120831',9.36],
['20120903',9.3703],
['20120904',9.2676],
['20120905',9.2163],
['20120906',9.2984],
['20120907',9.4524],
['20120910',9.5447],
['20120911',9.4832],
['20120912',9.5755],
['20120913',9.5755],
['20120914',9.7295],
['20120917',9.75],
['20120918',9.709],
['20120919',9.9347],
['20120920',9.904],
['20120921',9.8629],
['20120924',9.8937],
['20120925',9.8732],
['20120926',9.8937],
['20120927',10.0271],
['20120928',10.0271],
['20121003',10.3145],
['20121004',10.1503],
['20121005',10.099],
['20121008',10.2118],
['20121009',10.2426],
['20121010',10.3401],
['20121011',10.2888],
['20121012',10.1297],
['20121015',10.1092],
['20121016',10.0271],
['20121017',10.1605],
['20121018',10.1811],
['20121019',10.14],
['20121022',10.2529],
['20121024',10.5326],
['20121025',10.3915],
['20121026',10.4684],
['20121029',10.4941],
['20121030',10.5454],
['20121031',10.5967],
['20121101',10.4171],
['20121102',10.5197],
['20121105',10.5711],
['20121106',10.648],
['20121107',10.6095],
['20121108',10.4171],
['20121109',10.2632],
['20121112',10.2426],
['20121113',10.1297],
['20121114',10.1092],
['20121115',10.2118],
['20121116',10.3658],
['20121119',10.3401],
['20121120',10.3915],
['20121121',10.4428],
['20121122',10.5711],
['20121123',10.6993],
['20121126',10.7507],
['20121127',10.725],
['20121128',10.7507],
['20121129',10.9046],
['20121130',10.7763],
['20121203',10.802],
['20121204',10.7763],
['20121205',11.0329],
['20121206',10.9816],
['20121207',10.8276],
['20121210',10.9303],
['20121211',11.0072],
['20121212',10.8276],
['20121213',10.9046],
['20121214',10.9046],
['20121217',10.725],
['20121218',10.7507],
['20121219',10.7763],
['20121220',10.725],
['20121221',10.725],
['20121224',10.8276],
['20121227',10.8276],
['20121228',10.9046],
['20121231',10.802],
['20130102',11.0072],
['20130103',10.879],
['20130104',10.802],
['20130107',10.8276],
['20130108',10.9303],
['20130109',10.9046],
['20130110',10.8276],
['20130111',10.8276],
['20130114',10.879],
['20130115',10.8276],
['20130116',10.9046],
['20130117',10.9046],
['20130118',10.879],
['20130121',10.9046],
['20130122',10.9303],
['20130123',10.9816],
['20130124',11.0072],
['20130125',11.0586],
['20130128',11.0586],
['20130129',11.2382],
['20130130',11.3665],
['20130131',11.3151],
['20130201',11.3665],
['20130204',11.3921],
['20130205',11.1099],
['20130206',11.1355],
['20130207',11.0329],
['20130208',10.9816],
['20130214',11.0329],
['20130215',11.0842],
['20130218',11.0329],
['20130219',11.1868],
['20130220',11.3151],
['20130221',11.0586],
['20130222',11.1355],
['20130225',10.9816],
['20130226',11.0329],
['20130227',11.0329],
['20130228',11.1612],
['20130301',11.1099],
['20130304',11.0842],
['20130305',11.1099],
['20130306',11.1355],
['20130307',11.3408],
['20130308',11.3921],
['20130311',11.4434],
['20130312',11.3665],
['20130313',11.2895],
['20130314',11.4691],
['20130315',11.4178],
['20130318',11.4434],
['20130319',11.5974],
['20130320',11.3665],
['20130321',11.4178],
['20130322',11.3921],
['20130325',11.4947],
['20130326',11.4691],
['20130327',11.4947],
['20130328',11.5974],
['20130402',11.777],
['20130403',11.777],
['20130405',11.5204],
['20130408',11.5974],
['20130409',11.5461],
['20130410',11.623],
['20130411',11.6743],
['20130412',11.7257],
['20130415',11.5974],
['20130416',11.5717],
['20130417',11.5717],
['20130418',11.7257],
['20130419',11.854],
['20130422',11.9566],
['20130423',11.8026],
['20130424',11.8796],
['20130425',11.9566],
['20130426',12.0079],
['20130429',11.9822],
['20130430',12.0079],
['20130502',11.9053],
['20130503',12.0079],
['20130506',12.0336],
['20130507',11.854],
['20130508',11.9309],
['20130509',11.9309],
['20130510',12.0849],
['20130513',12.0592],
['20130514',11.9822],
['20130515',11.9309],
['20130516',11.9566],
['20130520',12.2132],
['20130521',12.1362],
['20130522',12.0336],
['20130523',11.8283],
['20130524',11.9566],
['20130527',11.854],
['20130528',11.854],
['20130529',11.7],
['20130530',11.2895],
['20130531',11.2895],
['20130603',11.2895],
['20130604',11.4178],
['20130605',11.2382],
['20130606',11.0842],
['20130607',10.7137],
['20130610',10.7815],
['20130611',10.5895],
['20130613',10.3186],
['20130614',10.4653],
['20130617',10.8718],
['20130618',10.7815],
['20130619',10.5895],
['20130620',10.3976],
['20130621',10.4089],
['20130624',10.3976],
['20130625',10.5331],
['20130626',10.5782],
['20130627',10.7815],
['20130628',10.7024],
['20130702',10.6234],
['20130703',10.4653],
['20130704',10.6347],
['20130705',11.0185],
['20130708',10.7815],
['20130709',10.9395],
['20130710',10.9621],
['20130711',11.2105],
['20130712',11.1201],
['20130715',10.9508],
['20130716',10.9056],
['20130717',10.9056],
['20130718',10.8718],
['20130719',10.7702],
['20130722',10.7476],
['20130723',11.1088],
['20130724',11.1879],
['20130725',11.1879],
['20130726',11.2217],
['20130729',11.1088],
['20130730',11.233],
['20130731',11.2105],
['20130801',11.3741],
['20130802',11.4024],
['20130805',11.3177],
['20130806',11.2556],
['20130807',11.2217],
['20130808',11.3459],
['20130809',11.3459],
['20130812',11.487],
['20130813',11.4306],
['20130815',11.3741],
['20130816',11.3459],
['20130819',11.4306],
['20130820',11.0298],
['20130821',10.7927],
['20130822',10.4879],
['20130823',10.4879],
['20130826',10.4315],
['20130827',10.3412],
['20130828',10.1267],
['20130829',10.138],
['20130830',10.1605],
['20130902',10.3073],
['20130903',10.4089],
['20130904',10.3186],
['20130905',10.4541],
['20130906',10.3412],
['20130909',10.2593],
['20130910',10.3186],
['20130911',10.2057],
['20130912',10.2847],
['20130913',10.3525],
['20130916',10.3637],
['20130917',10.3637],
['20130918',10.3976],
['20130919',10.4202],
['20130923',10.3863],
['20130924',10.4089],
['20130925',10.4653],
['20130926',10.4879],
['20130927',10.5105],
['20130930',10.4879],
['20131002',10.5782],
['20131003',10.5444],
['20131004',10.5105],
['20131007',10.375],
['20131008',10.4315],
['20131009',10.3863],
['20131010',10.3186],
['20131011',10.3299],
['20131015',10.3525],
['20131016',10.3299],
['20131017',10.2283],
['20131018',10.2621],
['20131021',10.2508],
['20131022',10.2621],
['20131023',10.2734],
['20131024',10.1944],
['20131025',10.1718],
['20131028',10.1831],
['20131029',10.1944],
['20131030',10.2847],
['20131031',10.2057],
['20131101',10.2621],
['20131104',10.3299],
['20131105',10.2621],
['20131106',10.217],
['20131107',10.1831],
['20131108',10.1718],
['20131111',10.1944],
['20131112',10.1944],
['20131113',10.1154],
['20131114',10.1041],
['20131115',10.1267],
['20131118',10.2734],
['20131119',10.217],
['20131120',10.296],
['20131121',10.2847],
['20131122',10.2734],
['20131125',10.2508],
['20131126',10.3637],
['20131127',10.3412],
['20131128',10.3525],
['20131129',10.3412],
['20131202',10.3863],
['20131203',10.4202],
['20131204',10.2508],
['20131205',10.1944],
['20131206',10.2057],
['20131209',10.2283],
['20131210',10.217],
['20131211',10.0928],
['20131212',10.138],
['20131213',10.1154],
['20131216',10.0815],
['20131217',10.0815],
['20131218',10.0138],
['20131219',9.8783],
['20131220',9.8557],
['20131223',9.8783],
['20131224',9.9799],
['20131227',10.0702],
['20131230',10.0251],
['20131231',10.0589],
['20140102',10.0589],
['20140103',9.8331],
['20140106',9.8218],
['20140107',9.7541],
['20140108',9.7202],
['20140109',9.6864],
['20140110',9.7767],
['20140113',9.6864],
['20140114',9.6412],
['20140115',9.6412],
['20140116',9.6299],
['20140117',9.7315],
['20140120',9.6412],
['20140121',9.5961],
['20140122',9.6073],
['20140123',9.5961],
['20140124',9.3477],
['20140127',9.1671],
['20140128',9.2235],
['20140129',9.1106],
['20140130',9.0203],
['20140204',8.9074],
['20140205',8.8058],
['20140206',8.8848],
['20140207',8.7493],
['20140210',8.659],
['20140211',8.8171],
['20140212',8.9977],
['20140213',8.9751],
['20140214',9.0542],
['20140217',9.1332],
['20140218',9.0655],
['20140219',9.0429],
['20140220',8.9751],
['20140221',9.1896],
['20140224',9.1106],
['20140225',9.2009],
['20140226',9.3364],
['20140227',9.4945],
['20140228',9.438],
['20140303',9.4154],
['20140304',9.4041],
['20140305',9.359],
['20140306',9.4719],
['20140307',9.4041],
['20140310',9.3703],
['20140311',9.3477],
['20140312',9.2912],
['20140313',9.2461],
['20140314',9.2574],
['20140317',9.2235],
['20140318',9.3703],
['20140319',9.2348],
['20140320',9.0767],
['20140321',9.0203],
['20140324',9.1671],
['20140325',9.2574],
['20140326',9.3703],
['20140327',9.5396],
['20140328',9.4719],
['20140331',9.5509],
['20140401',9.7202],
['20140402',9.5848],
['20140403',9.7315],
['20140404',9.7767],
['20140407',9.7767],
['20140408',9.8444],
['20140409',9.9347],
['20140410',10.0702],
['20140411',10.0702],
['20140414',10.138],
['20140415',10.0363],
['20140416',10.0589],
['20140417',10.0251],
['20140422',9.9799],
['20140423',9.9347],
['20140424',9.9573],
['20140425',9.7541],
['20140428',9.7993],
['20140429',10.1041],
['20140430',10.0928],
['20140502',10.0251],
['20140505',9.9122],
['20140507',9.8218],
['20140508',9.9799],
['20140509',9.8557],
['20140512',10.1041],
['20140513',10.1605],
['20140514',10.1831],
['20140515',10.217],
['20140516',10.217],
['20140519',10.3412],
['20140520',10.4541],
['20140521',10.4315],
['20140522',10.4653],
['20140523',10.5218],
['20140526',10.5444],
['20140527',10.6234],
['20140528',10.6686],
['20140529',10.6573],
['20140530',10.567],
['20140603',10.7137],
['20140604',10.7363],
['20140605',10.7476],
['20140606',10.4563],
['20140609',10.4066],
['20140610',10.5557],
['20140611',10.3942],
['20140612',10.4191],
['20140613',10.4687],
['20140616',10.4812],
['20140617',10.4687],
['20140618',10.4066],
['20140619',10.3942],
['20140620',10.4191],
['20140623',10.2576],
['20140624',10.357],
['20140625',10.3321],
['20140626',10.4812],
['20140627',10.5184],
['20140630',10.5432],
['20140702',10.655],
['20140703',10.5557],
['20140704',10.506],
['20140707',10.4687],
['20140708',10.4936],
['20140709',10.3818],
['20140710',10.4315],
['20140711',10.506],
['20140714',10.506],
['20140715',10.4936],
['20140716',10.506],
['20140717',10.4936],
['20140718',10.5184],
['20140721',10.4315],
['20140722',10.5184],
['20140723',10.5557],
['20140724',10.4936],
['20140725',10.4563],
['20140728',10.4563],
['20140729',10.4687],
['20140730',10.5557],
['20140731',10.5308],
['20140801',10.5805],
['20140804',10.5681],
['20140805',10.5929],
['20140806',10.6178],
['20140807',10.6302],
['20140808',10.6426],
['20140811',10.6674],
['20140812',10.6674],
['20140813',10.6798],
['20140814',10.7792],
['20140815',10.804],
['20140818',10.8164],
['20140819',11.0524],
['20140820',11.4001],
['20140821',11.2138],
['20140822',11.3877],
['20140825',11.3008],
['20140826',11.338],
['20140827',11.1021],
['20140828',11.0772],
['20140829',10.9158],
['20140901',10.9655],
['20140902',11.1766],
['20140903',11.3008],
['20140904',11.3132],
['20140905',11.1642],
['20140908',11.1766],
['20140910',11.0276],
['20140911',11.0276],
['20140912',11.0027],
['20140915',10.9282],
['20140916',10.8785],
['20140917',10.9903],
['20140918',10.8785],
['20140919',10.7544],
['20140922',10.7295],
['20140923',10.7295],
['20140924',10.9158],
['20140925',10.8661],
['20140926',10.8413],
['20140929',10.5681],
['20140930',10.4563],
['20141003',10.4812],
['20141006',10.5681],
['20141007',10.5308],
['20141008',10.5432],
['20141009',10.9034],
['20141010',10.8785],
['20141013',11.0027],
['20141014',11.1021],
['20141015',11.1393],
['20141016',11.1021],
['20141017',10.9903],
['20141020',11.04],
['20141021',11.0897],
['20141022',11.1642],
['20141023',11.1517],
['20141024',11.1517],
['20141027',11.0648],
['20141028',11.1766],
['20141029',11.1517],
['20141030',11.1642],
['20141031',11.2387],
['20141103',11.2883],
['20141104',11.2511],
['20141105',11.2759],
['20141106',11.3132],
['20141107',11.3008],
['20141110',11.3877],
['20141111',11.3629],
['20141112',11.4374],
['20141113',11.487],
['20141114',11.6361],
['20141117',11.6236],
['20141118',11.4001],
['20141119',11.3132],
['20141120',11.3877],
['20141121',11.6361],
['20141124',11.6361],
['20141125',11.6857],
['20141126',11.6857],
['20141127',11.5119],
['20141128',11.4125],
['20141201',11.04],
['20141202',11.2511],
['20141203',11.0897],
['20141204',11.0276],
['20141205',11.1393],
['20141208',11.0276],
['20141209',11.0897],
['20141210',10.9903],
['20141211',11.0276],
['20141212',10.9282],
['20141215',10.8413],
['20141216',10.7544],
['20141217',10.6426],
['20141218',10.6178],
['20141219',10.7171],
['20141222',10.804],
['20141223',10.7171],
['20141224',10.9158],
['20141229',11.1145],
['20141230',11.04],
['20141231',11.0276],
['20150102',11.0276],
['20150105',10.9034],
['20150106',10.7916],
['20150107',10.8289],
['20150108',11.0151],
['20150109',11.0027],
['20150112',10.8785],
['20150113',10.9282],
['20150114',10.891],
['20150115',11.0151],
['20150116',10.9531],
['20150119',11.1145],
['20150120',11.0648],
['20150121',10.9531],
['20150122',10.9531],
['20150123',11.0648],
['20150126',10.9779],
['20150127',11.0772],
['20150128',11.0648],
['20150129',11.1021],
['20150130',11.0524],
['20150202',11.0648],
['20150203',10.9655],
['20150204',10.9406],
['20150205',10.8537],
['20150206',10.8289],
['20150209',10.8164],
['20150210',10.8413],
['20150211',10.7792],
['20150212',10.7916],
['20150213',10.7419],
['20150216',10.7171],
['20150217',10.7916],
['20150218',10.8661],
['20150223',10.7792],
['20150224',10.7792],
['20150225',10.8661],
['20150226',10.891],
['20150227',10.8661],
['20150302',10.8289],
['20150303',10.891],
['20150304',10.9282],
['20150305',10.8785],
['20150306',10.9034],
['20150309',10.8289],
['20150310',10.7916],
['20150311',10.7047],
['20150312',10.6923],
['20150313',10.655],
['20150316',10.7295],
['20150317',10.7419],
['20150318',10.8537],
['20150319',10.9779],
['20150320',10.9158],
['20150323',10.9282],
['20150324',10.9779],
['20150325',11.0151],
['20150326',11.04],
['20150327',11.0648],
['20150330',11.0276],
['20150331',11.1393],
['20150401',11.0897],
['20150402',11.1517],
['20150408',11.338],
['20150409',11.6236],
['20150410',11.6733],
['20150413',11.723],
['20150414',11.7106],
['20150415',11.723],
['20150416',11.7106],
['20150417',11.6733],
['20150420',11.4125],
['20150421',11.487],
['20150422',11.4001],
['20150423',11.4746],
['20150424',11.5864],
['20150427',11.5988],
['20150428',11.5491],
['20150429',11.574],
['20150430',11.487],
['20150504',11.5367],
['20150505',11.5243],
['20150506',11.5491],
['20150507',11.5367],
['20150508',11.5243],
['20150511',11.5367],
['20150512',11.5119],
['20150513',11.4622],
['20150514',11.5367],
['20150515',11.6361],
['20150518',11.6361],
['20150519',11.6112],
['20150520',11.6485],
['20150521',11.5988],
['20150522',11.6112],
['20150526',11.6112],
['20150527',11.6236],
['20150528',11.5616],
['20150529',11.6112],
['20150601',11.6112],
['20150602',11.574],
['20150603',11.4473],
['20150604',11.42],
['20150605',11.338],
['20150608',11.1604],
['20150609',11.0102],
['20150610',10.8736],
['20150611',10.8463],
['20150612',10.9146],
['20150615',10.8053],
['20150616',10.7916],
['20150617',10.8326],
['20150618',10.8189],
['20150619',11.0102],
['20150622',11.1741],
['20150623',11.1468],
['20150624',11.0512],
['20150625',11.0375],
['20150626',10.9829],
['20150629',10.9829],
['20150630',11.1058],
['20150702',11.0238],
['20150703',10.9829],
['20150706',10.9282],
['20150707',10.8736],
['20150708',10.5457],
['20150709',10.655],
['20150710',10.6823],
['20150713',10.7916],
['20150714',10.7643],
['20150715',10.8872],
['20150716',10.8599],
['20150717',10.8189],
['20150720',10.8872],
['20150721',10.8326],
['20150722',10.737],
['20150723',10.8189],
['20150724',10.8053],
['20150727',10.7096],
['20150728',10.7643],
['20150729',10.7233],
['20150730',10.696],
['20150731',10.8053],
['20150803',10.7233],
['20150804',10.8872],
['20150805',10.9146],
['20150806',10.8189],
['20150807',10.7916],
['20150810',10.8463],
['20150811',10.8189],
['20150812',10.8463],
['20150813',10.8326],
['20150814',10.7506],
['20150817',10.696],
['20150818',10.655],
['20150819',10.3818],
['20150820',10.2589],
['20150821',10.1906],
['20150824',9.972],
['20150825',9.9857],
['20150826',9.9993],
['20150827',10.1769],
['20150828',9.972],
['20150831',9.9857],
['20150901',9.8627],
['20150902',9.8354],
['20150904',9.9037],
['20150907',9.8764],
['20150908',10.0403],
['20150909',10.5321],
['20150910',10.3272],
['20150911',10.1769],
['20150914',10.2725],
['20150915',10.2315],
['20150916',10.4091],
['20150917',10.2042],
['20150918',10.2042],
['20150921',10.2042],
['20150922',10.2862],
['20150923',10.1223],
['20150924',10.0813],
['20150925',10.0676],
['20150929',9.8627],
['20150930',9.9174],
['20151002',9.9857],
['20151005',10.1769],
['20151006',9.9993],
['20151007',10.2179],
['20151008',10.2998],
['20151009',10.1359],
['20151012',10.1359],
['20151013',10.3408],
['20151014',10.3818],
['20151015',10.4638],
['20151016',10.5047],
['20151019',10.573],
['20151020',10.696],
['20151022',10.7506],
['20151023',10.8599],
['20151026',10.9146],
['20151027',10.9419],
['20151028',10.9692],
['20151029',10.9282],
['20151030',10.7506],
['20151102',10.614],
['20151103',10.7506],
['20151104',10.9419],
['20151105',10.8189],
['20151106',10.6687],
['20151109',10.737],
['20151110',10.6413],
['20151111',10.7096],
['20151112',10.7779],
['20151113',10.6277],
['20151116',10.5594],
['20151117',10.6004],
['20151118',10.5867],
['20151119',10.6687],
['20151120',10.7916],
['20151123',10.7506],
['20151124',10.655],
['20151125',10.614],
['20151126',10.6413],
['20151127',10.5594],
['20151130',10.3955],
['20151201',10.5867],
['20151202',10.614],
['20151203',10.5184],
['20151204',10.4501],
['20151207',10.4364],
['20151208',10.3135],
['20151209',10.2589],
['20151210',10.2589],
['20151211',10.2042],
['20151214',10.1769],
['20151215',10.1086],
['20151216',10.1632],
['20151217',10.2315],
['20151218',10.1359],
['20151221',10.1496],
['20151222',10.1906],
['20151223',10.2589],
['20151224',10.2452],
['20151228',10.3408],
['20151229',10.3545],
['20151230',10.4228],
['20151231',10.3818],
['20160104',10.1906],
['20160105',10.1906],
['20160106',10.0676],
['20160107',10.0403],
['20160108',10.054],
['20160111',9.89],
['20160112',9.8354],
['20160113',9.89],
['20160114',9.9583],
['20160115',9.931],
['20160118',9.8491],
['20160119',9.8764],
['20160120',9.5622],
['20160121',9.166],
['20160122',9.2343],
['20160125',9.166],
['20160126',9.0841],
['20160127',9.0431],
['20160128',9.207],
['20160129',9.3026],
['20160201',9.1524],
['20160202',9.2753],
['20160203',9.2343],
['20160204',9.3983],
['20160205',9.4119],
['20160211',9.166],
['20160212',9.33],
['20160215',9.5212],
['20160216',9.4939],
['20160217',9.4119],
['20160218',9.4666],
['20160219',9.5075],
['20160222',9.6851],
['20160223',9.6168],
['20160224',9.4529],
['20160225',9.3436],
['20160226',9.5212],
['20160229',9.3436],
['20160301',9.33],
['20160302',9.6441],
['20160303',9.5075],
['20160304',9.5622],
['20160307',9.5895],
['20160308',9.4802],
['20160309',9.4392],
['20160310',9.4529],
['20160311',9.5349],
['20160314',9.6032],
['20160315',9.6032],
['20160316',9.6441],
['20160317',9.7808],
['20160318',9.6851],
['20160321',9.7671],
['20160322',9.6032],
['20160323',9.6032],
['20160324',9.6305],
['20160329',9.5895],
['20160330',9.8627],
['20160331',9.9037],
['20160401',9.7534],
['20160405',9.6441],
['20160406',9.6578],
['20160407',9.6988],
['20160408',9.7534],
['20160411',9.8081],
['20160412',9.9174],
['20160413',10.1632],
['20160414',10.1496],
['20160415',10.1769],
['20160418',10.1906],
['20160419',10.2862],
['20160420',9.972],
['20160421',10.1086],
['20160422',9.972],
['20160425',9.9583],
['20160426',10.013],
['20160427',9.931],
['20160428',10.013],
['20160429',9.89],
['20160503',9.7671],
['20160504',9.7944],
['20160505',9.8081],
['20160506',9.7808],
['20160509',9.931],
['20160510',9.9857],
['20160511',9.8764],
['20160512',9.8627],
['20160513',9.7808],
['20160516',9.7944],
['20160517',9.8627],
['20160518',9.8081],
['20160519',9.7671],
['20160520',9.8491],
['20160523',9.7808],
['20160524',9.89],
['20160525',9.9447],
['20160526',9.9857],
['20160527',10.0813],
['20160530',10.1359],
['20160531',10.1906],
['20160601',10.2452],
['20160602',10.4091],
['20160603',10.5321],
['20160606',10.6004],
['20160607',10.573],
['20160608',10.655],
['20160610',10.4884],
['20160613',10.2329],
['20160614',10.0526],
['20160615',10.1428],
['20160616',9.9174],
['20160617',9.9624],
['20160620',10.0676],
['20160621',10.1127],
['20160622',10.1428],
['20160623',10.0526],
['20160624',10.0827],
['20160627',10.3231],
['20160628',10.3231],
['20160629',10.4283],
['20160630',10.6236],
['20160704',10.7889],
['20160705',10.6386],
['20160706',10.6236],
['20160707',10.6537],
['20160708',10.4433],
['20160711',10.5935],
['20160712',10.5935],
['20160713',10.5034],
['20160714',10.6386],
['20160715',10.6386],
['20160718',10.7138],
['20160719',10.7288],
['20160720',10.7739],
['20160721',10.7889],
['20160722',10.849],
['20160725',10.834],
['20160726',10.9692],
['20160727',10.9842],
['20160728',10.879],
['20160729',10.8189],
['20160801',10.7889],
['20160803',10.6386],
['20160804',10.7288],
['20160805',10.7739],
['20160808',10.9392],
['20160809',10.9241],
['20160810',10.8941],
['20160811',10.9241],
['20160812',10.9692],
['20160815',11.0293],
['20160816',10.9692],
['20160817',10.9241],
['20160818',10.879],
['20160819',10.864],
['20160822',10.9542],
['20160823',10.9392],
['20160824',10.879],
['20160825',10.9091],
['20160826',10.9542],
['20160829',10.9692],
['20160830',11.0143],
['20160831',11.1195],
['20160901',11.0443],
['20160902',10.9542],
['20160905',10.9842],
['20160906',10.9692],
['20160907',10.9542],
['20160908',10.9993],
['20160909',11.1195],
['20160912',10.9241],
['20160913',10.7889],
['20160914',10.8039],
['20160915',11.0143],
['20160919',11.0744],
['20160920',11.1345],
['20160921',11.1495],
['20160922',11.1195],
['20160923',11.1645],
['20160926',11.0293],
['20160927',11.1195],
['20160928',11.1946],
['20160929',11.2247],
['20160930',10.9993],
['20161003',11.0293],
['20161004',11.0143],
['20161005',11.0443],
['20161006',11.0143],
['20161007',11.0143],
['20161011',11.0293],
['20161012',11.0744],
['20161013',10.9842],
['20161014',11.1044],
['20161017',11.0744],
['20161018',11.1495],
['20161019',11.1645],
['20161020',11.2096],
['20161024',11.2547],
['20161025',11.2998],
['20161026',11.2697],
['20161027',11.2547],
['20161028',11.2697],
['20161031',11.42],
['20161101',11.6454],
['20161102',11.5252],
['20161103',11.3899],
['20161104',11.3449],
['20161107',11.435],
['20161108',11.4651],
['20161109',11.3599],
['20161110',11.3899],
['20161111',10.9842],
['20161114',10.7588],
['20161115',10.864],
['20161116',10.7588],
['20161117',10.864],
['20161118',10.9241],
['20161121',10.7889],
['20161122',10.7889],
['20161123',10.8039],
['20161124',10.7889],
['20161125',10.864],
['20161128',10.849],
['20161129',10.8941],
['20161130',10.849],
['20161201',10.7438],
['20161202',10.6086],
['20161205',10.5935],
['20161206',10.6537],
['20161207',10.7588],
['20161208',10.7288],
['20161209',10.6236],
['20161212',10.5485],
['20161213',10.5485],
['20161214',10.5184],
['20161215',10.3682],
['20161216',10.3682],
['20161219',10.3231],
['20161220',10.308],
['20161221',10.293],
['20161222',10.263],
['20161223',10.2179],
['20161228',10.2179],
['20161229',10.2179],
['20161230',10.3231],
['20170103',10.3381],
['20170104',10.3231],
['20170105',10.3982],
['20170106',10.4132],
['20170109',10.5485],
['20170110',10.864],
['20170111',10.879],
['20170112',10.8189],
['20170113',10.8941],
['20170116',10.879],
['20170117',10.9091],
['20170118',10.9241],
['20170119',10.879],
['20170120',10.879],
['20170123',10.879],
['20170124',10.9241],
['20170125',10.9091],
['20170126',10.9392],
['20170127',11.0143],
['20170201',11.0293],
['20170202',10.9241],
['20170203',10.9993],
['20170206',11.0443],
['20170207',11.1345],
['20170208',11.2397],
['20170209',11.1946],
['20170210',11.2096],
['20170213',11.1195],
['20170214',11.1946],
['20170215',11.2096],
['20170216',11.1195],
['20170217',11.2247],
['20170220',11.2547],
['20170221',11.2547],
['20170222',11.2697],
['20170223',11.1796],
['20170224',11.2547],
['20170227',11.2697],
['20170228',11.2247],
['20170301',11.2547],
['20170302',11.405],
['20170303',11.3148],
['20170306',11.3298],
['20170307',11.2397],
['20170308',11.2848],
['20170309',11.1645],
['20170310',11.1796],
['20170313',11.2547],
['20170314',11.2247],
['20170315',11.2547],
['20170316',11.405],
['20170317',11.3298],
['20170320',11.405],
['20170321',11.3749],
['20170322',11.4951],
['20170323',11.5703],
['20170324',11.5703],
['20170327',11.6153],
['20170328',11.6454],
['20170329',11.6454],
['20170330',11.6754],
['20170331',11.6754],
['20170403',11.8107],
['20170405',11.8708],
['20170406',11.9008],
['20170407',11.9459],
['20170410',11.9459],
['20170411',11.7806],
['20170412',11.8858],
['20170413',11.8558],
['20170418',11.5552],
['20170419',11.45],
['20170420',11.5552],
['20170421',11.5552],
['20170424',11.5402],
['20170425',11.5552],
['20170426',11.6153],
['20170427',11.6153],
['20170428',11.6754],
['20170502',11.6454],
['20170504',11.6905],
['20170505',11.6153],
['20170508',11.6454],
['20170509',11.7656],
['20170510',11.7656],
['20170511',11.7957],
['20170512',11.8257],
['20170515',11.6454],
['20170516',11.7506],
['20170517',11.7957],
['20170518',11.8858],
['20170519',11.8107],
['20170522',11.8558],
['20170523',11.9008],
['20170524',12.006],
['20170525',12.006],
['20170526',12.021],
['20170529',12.2014],
['20170531',12.5169],
['20170601',12.547],
['20170602',12.547],
['20170605',12.577],
['20170606',12.577],
['20170607',12.547],
['20170608',12.6221],
['20170609',12.3967],
['20170612',12.1653],
['20170613',12.2149],
['20170614',12.0661],
['20170615',11.9669],
['20170616',12.0496],
['20170619',12.1488],
['20170620',12.1322],
['20170621',12.1488],
['20170622',12.2479],
['20170623',12.281],
['20170626',12.3306],
['20170627',12.2479],
['20170628',12.1818],
['20170629',12.281],
['20170630',12.1322],
['20170703',11.9835],
['20170704',11.9504],
['20170705',12.0165],
['20170706',12.0165],
['20170707',12.0165],
['20170710',12.0992],
['20170711',12.1488],
['20170712',12.2479],
['20170713',12.2975],
['20170714',12.3141],
['20170717',12.2975],
['20170718',12.2975],
['20170719',12.2149],
['20170720',12.1984],
['20170721',12.1653],
['20170724',12.1818],
['20170725',12.2645],
['20170726',12.1818],
['20170727',12.1653],
['20170728',12.2149],
['20170731',12.2149],
['20170801',12.2149],
['20170802',12.2314],
['20170803',12.2645],
['20170804',12.3141],
['20170807',12.3306],
['20170808',12.3141],
['20170809',12.2645],
['20170810',12.281],
['20170811',12.2149],
['20170814',12.2479],
['20170815',12.2645],
['20170816',12.281],
['20170817',12.3306],
['20170818',12.1984],
['20170821',12.281],
['20170822',12.1322],
['20170824',12.0827],
['20170825',12.1322],
['20170828',12.0992],
['20170829',12.1157],
['20170830',12.1488],
['20170831',12.2314],
['20170901',12.2149],
['20170904',12.2975],
['20170905',12.2975],
['20170906',12.281],
['20170907',12.281],
['20170908',12.3306],
['20170911',12.3636],
['20170912',12.2479],
['20170913',12.1818],
['20170914',12.1322],
['20170915',12.2645],
['20170918',12.2149],
['20170919',12.1984],
['20170920',12.1653],
['20170921',12.1818],
['20170922',12.1488],
['20170925',12.1157],
['20170926',12.1818],
['20170927',12.1653],
['20170928',12.1322],
['20170929',12.1322],
['20171003',12.1488],
['20171004',12.1322],
['20171006',12.1984],
['20171009',12.1984],
['20171010',12.1653],
['20171011',12.2149],
['20171012',12.2645],
['20171013',12.3141],
['20171016',12.281],
['20171017',12.281],
['20171018',12.3306],
['20171019',12.2645],
['20171020',12.3141],
['20171023',12.2975],
['20171024',12.2314],
['20171025',12.1984],
['20171026',12.2149],
['20171027',12.2645],
['20171030',12.2479],
['20171031',12.2149],
['20171101',12.2645],
['20171102',12.2149],
['20171103',12.2314],
['20171106',12.1488],
['20171107',12.1653],
['20171108',12.281],
['20171109',12.2479],
['20171110',12.2314],
['20171113',12.1818],
['20171114',12.2314],
['20171115',12.2479],
['20171116',12.2149],
['20171117',12.2314],
['20171120',12.1653],
['20171121',12.1984],
['20171122',12.2314],
['20171123',12.2975],
['20171124',12.3636],
['20171127',12.4959],
['20171128',12.6281],
['20171129',12.6281],
['20171130',12.595],
['20171201',12.7273],
['20171204',12.7769],
['20171205',12.8099],
['20171206',12.7273],
['20171207',12.6612],
['20171208',12.7273],
['20171211',12.6281],
['20171212',12.595],
['20171213',12.6116],
['20171214',12.6116],
['20171215',12.5455],
['20171218',12.4959],
['20171219',12.4793],
['20171220',12.5455],
['20171221',12.4793],
['20171222',12.5785],
['20171227',12.595],
['20171228',12.6942],
['20171229',12.6612],
['20180102',12.6446],
['20180103',12.7108],
['20180104',12.7769],
['20180105',12.8099],
['20180108',12.8099],
['20180109',12.843],
['20180110',12.7438],
['20180111',12.7108],
['20180112',12.6612],
['20180115',12.6777],
['20180116',12.7273],
['20180117',12.7769],
['20180118',12.7273],
['20180119',12.7273],
['20180122',12.6942],
['20180123',12.7108],
['20180124',12.6942],
['20180125',12.7603],
['20180126',12.7934],
['20180129',12.7769],
['20180130',12.8595],
['20180131',12.7769],
['20180201',12.7934],
['20180202',12.7603],
['20180205',12.6777],
['20180206',12.4463],
['20180207',12.3306],
['20180208',12.3636],
['20180209',12.1984],
['20180212',12.1488],
['20180213',12.1488],
['20180214',12.2645],
['20180215',12.2314],
['20180220',12.4959],
['20180221',12.5289],
['20180222',12.5785],
['20180223',12.6612],
['20180226',12.8926],
['20180227',12.8595],
['20180228',12.7934],
['20180301',12.8265],
['20180302',12.7603],
['20180305',12.6446],
['20180306',12.7438],
['20180307',12.7108],
['20180308',12.7934],
['20180309',12.876],
['20180312',12.9091],
['20180313',13.1405],
['20180314',13.2066],
['20180315',13.2066],
['20180316',13.2727],
['20180319',13.3223],
['20180320',13.3719],
['20180321',13.6033],
['20180322',13.5207],
['20180323',13.3554],
['20180326',13.3389],
['20180327',13.5537],
['20180328',13.405],
['20180329',13.3223],
['20180403',13.3554],
['20180404',13.2562],
['20180406',13.2727],
['20180409',13.3554],
['20180410',13.3719],
['20180411',13.3719],
['20180412',13.405],
['20180413',13.3884],
['20180416',13.3554],
['20180417',13.3554],
['20180418',13.3884],
['20180419',13.405],
['20180420',13.3554],
['20180423',13.405],
['20180424',13.405],
['20180425',13.3884],
['20180426',13.3884],
['20180427',13.3884],
['20180430',13.5868],
['20180502',13.7355],
['20180503',13.6529],
['20180504',13.6694],
['20180507',13.686],
['20180508',13.719],
['20180509',13.7355],
['20180510',13.7851],
['20180511',13.9174],
['20180514',14.1984],
['20180515',14.0827],
['20180516',13.9835],
['20180517',14.0331],
['20180518',14.0661],
['20180521',14.1653],
['20180523',14.0165],
['20180524',14.0992],
['20180525',14.1157],
['20180528',14.1322],
['20180529',14.0827],
['20180530',14],
['20180531',14.0165],
['20180601',14.0661],
['20180604',14.1818],
['20180605',14.281],
['20180606',14.3306],
['20180607',14.281],
['20180608',14.0727],
['20180611',13.9455],
['20180612',13.8182],
['20180613',13.6364],
['20180614',13.5091],
['20180615',13.5455],
['20180619',13.3091],
['20180620',13.5455],
['20180621',13.4909],
['20180622',13.5818],
['20180625',13.8],
['20180626',13.8727],
['20180627',13.7636],
['20180628',13.7091],
['20180629',13.6546],
['20180703',13.6546],
['20180704',13.6364],
['20180705',13.7091],
['20180706',13.7273],
['20180709',13.9091],
['20180710',13.9091],
['20180711',13.8546],
['20180712',13.8727],
['20180713',13.8727],
['20180716',13.9636],
['20180717',14.0909],
['20180718',14.3091],
['20180719',14.3636],
['20180720',14.7455],
['20180723',14.7455],
['20180724',14.7636],
['20180725',14.6727],
['20180726',14.6364],
['20180727',14.6546],
['20180730',14.6727],
['20180731',14.5636],
['20180801',14.3818],
['20180802',14.0727],
['20180803',14.1636],
['20180806',14.4364],
['20180807',14.6909],
['20180808',14.5818],
['20180809',14.5818],
['20180810',14.4546],
['20180813',14.4909],
['20180814',14.7091],
['20180815',14.5273],
['20180816',14.4182],
['20180817',14.3636],
['20180820',14.4546],
['20180821',14.3818],
['20180822',14.3455],
['20180823',14.3091],
['20180824',14.2364],
['20180827',14.4909],
['20180828',14.5273],
['20180829',14.5455],
['20180830',14.5455],
['20180831',14.6909],
['20180903',14.6364],
['20180904',14.6182],
['20180905',14.4364],
['20180906',14.3455],
['20180907',14.3273],
['20180910',14.2182],
['20180911',14.1273],
['20180912',14.2546],
['20180913',14.4727],
['20180914',14.4546],
['20180917',14.3455],
['20180918',14.3455],
['20180919',14.3273],
['20180920',14.2546],
['20180921',14.1636],
['20180924',14.1273],
['20180926',14.1636],
['20180927',14.1455],
['20180928',14.1273],
['20181002',13.8],
['20181003',13.7273],
['20181004',13.5636],
['20181005',13.5636],
['20181008',13.5455],
['20181009',13.5455],
['20181010',13.6546],
['20181011',13.4727],
['20181012',13.4727],
['20181015',13.3818],
['20181016',13.3818],
['20181018',13.4182],
['20181019',13.6546],
['20181022',13.7273],
['20181023',13.4364],
['20181024',13.4727],
['20181025',13.6],
['20181026',13.5273],
['20181029',13.6],
['20181030',13.5455],
['20181031',13.6],
['20181101',13.5091],
['20181102',13.7636],
['20181105',13.5818],
['20181106',13.6182],
['20181107',13.4909],
['20181108',13.5636],
['20181109',13.4727],
['20181112',13.6182],
['20181113',13.6909],
['20181114',13.7273],
['20181115',13.9636],
['20181116',13.8],
['20181119',13.8909],
['20181120',13.8909],
['20181121',13.9091],
['20181122',14.0727],
['20181123',14],
['20181126',14.2727],
['20181127',14.3273],
['20181128',14.4546],
['20181129',14.1818],
['20181130',14.3455],
['20181203',14.4727],
['20181204',14.5455],
['20181205',14.4727],
['20181206',14.5091],
['20181207',14.4909],
['20181210',14.4364],
['20181211',14.4364],
['20181212',14.4364],
['20181213',14.5091],
['20181214',14.6],
['20181217',14.6909],
['20181218',14.6],
['20181219',14.5636],
['20181220',14.5818],
['20181221',14.6],
['20181224',14.6909],
['20181227',14.7455],
['20181228',14.7091],
['20181231',14.7273],
['20190102',14.7818],
['20190103',14.7091],
['20190104',14.8],
['20190107',14.8909],
['20190108',14.9455],
['20190109',15.1273],
['20190110',15.0727],
['20190111',15.1455],
['20190114',15.1091],
['20190115',15.2364],
['20190116',15.2],
['20190117',15.1818],
['20190118',15.1818],
['20190121',15.2546],
['20190122',15.2727],
['20190123',15.3818],
['20190124',15.4364],
['20190125',15.5636],
['20190128',15.5455],
['20190129',15.5636],
['20190130',15.5273],
['20190131',15.4727],
['20190201',15.5455],
['20190204',15.5273],
['20190208',15.7636],
['20190211',15.9091],
['20190212',16.1636],
['20190213',16.2909],
['20190214',16.1455],
['20190215',15.9636],
['20190218',16.0364],
['20190219',15.9818],
['20190220',16.2364],
['20190221',16.2909],
['20190222',16.3455],
['20190225',16.1818],
['20190226',16.2],
['20190227',16.3636],
['20190228',16.5273],
['20190301',16.4546],
['20190304',16.4364],
['20190305',16.3818],
['20190306',16.3455],
['20190307',16.3636],
['20190308',16.4],
['20190311',16.5091],
['20190312',16.6],
['20190313',16.6182],
['20190314',16.6364],
['20190315',16.6],
['20190318',16.7091],
['20190319',16.6909],
['20190320',16.4],
['20190321',16.7273],
['20190322',16.6546],
['20190325',16.5636],
['20190326',16.6909],
['20190327',16.7455],
['20190328',16.8182],
['20190329',17.1091],
['20190401',17.3818],
['20190402',17.4],
['20190403',17.5091],
['20190404',17.3636],
['20190408',17.2546],
['20190409',17.2546],
['20190410',17.1636],
['20190411',17.0909],
['20190412',17.2],
['20190415',17],
['20190416',16.9636],
['20190417',16.8727],
['20190418',16.7818],
['20190423',17],
['20190424',16.9273],
['20190425',16.9273],
['20190426',17],
['20190429',17.1818],
['20190430',17.0182],
['20190502',17.0909],
['20190503',17.2182],
['20190506',17],
['20190507',17.1091],
['20190508',17],
['20190509',16.9091],
['20190510',17.0182],
['20190514',17.3091],
['20190515',17.2909],
['20190516',17.3636],
['20190517',17.2364],
['20190520',17.5455],
['20190521',17.6546],
['20190522',17.9091],
['20190523',17.9455],
['20190524',17.9818],
['20190527',17.8546],
['20190528',17.3818],
['20190529',17.5818],
['20190530',17.08],
['20190531',17.32],
['20190603',17.02],
['20190604',17],
['20190605',16.86],
['20190606',16.92],
['20190610',17.04],
['20190611',17.24],
['20190612',17.18],
['20190613',17.2],
['20190614',17.18],
['20190617',17.14],
['20190618',17.18],
['20190619',17.36],
['20190620',17.62],
['20190621',17.5],
['20190624',17.66],
['20190625',17.66],
['20190626',17.38],
['20190627',17.54],
['20190628',17.32],
['20190702',17.54],
['20190703',17.6],
['20190704',17.84],
['20190705',17.9],
['20190708',17.62],
['20190709',17.52],
['20190710',17.6],
['20190711',17.76],
['20190712',17.78],
['20190715',17.66],
['20190716',17.68],
['20190717',17.68],
['20190718',17.68],
['20190719',17.76],
['20190722',17.58],
['20190723',17.62],
['20190724',17.54],
['20190725',17.54],
['20190726',17.5],
['20190729',17.38],
['20190730',17.52],
['20190731',17.34],
['20190801',17.3],
['20190802',17.32],
['20190805',16.9],
['20190806',16.86],
['20190807',16.82],
['20190808',17.02],
['20190809',17.04],
['20190812',16.9],
['20190813',16.5],
['20190814',16.2],
['20190815',16.34],
['20190816',16.62],
['20190819',16.92],
['20190820',17.1],
['20190821',16.2],
['20190822',15.62],
['20190823',15.84],
['20190826',15.52],
['20190827',15.44],
['20190828',15.3],
['20190829',15.42],
['20190830',15.14]];
var source='finance.yahoo.com';
|
maxpark/Pynq-CV-OV5640
|
boards/src/ip/xilinx_com_hls_xf_dilation_accel_1_0/drivers/xf_dilation_accel_v1_0/src/xxf_dilation_accel_sinit.c
|
<gh_stars>10-100
// ==============================================================
// File generated on Fri Nov 22 15:18:28 +0800 2019
// Vivado(TM) HLS - High-Level Synthesis from C, C++ and SystemC v2018.3 (64-bit)
// SW Build 2405991 on Thu Dec 6 23:38:27 MST 2018
// IP Build 2404404 on Fri Dec 7 01:43:56 MST 2018
// Copyright 1986-2018 Xilinx, Inc. All Rights Reserved.
// ==============================================================
#ifndef __linux__
#include "xstatus.h"
#include "xparameters.h"
#include "xxf_dilation_accel.h"
extern XXf_dilation_accel_Config XXf_dilation_accel_ConfigTable[];
XXf_dilation_accel_Config *XXf_dilation_accel_LookupConfig(u16 DeviceId) {
XXf_dilation_accel_Config *ConfigPtr = NULL;
int Index;
for (Index = 0; Index < XPAR_XXF_DILATION_ACCEL_NUM_INSTANCES; Index++) {
if (XXf_dilation_accel_ConfigTable[Index].DeviceId == DeviceId) {
ConfigPtr = &XXf_dilation_accel_ConfigTable[Index];
break;
}
}
return ConfigPtr;
}
int XXf_dilation_accel_Initialize(XXf_dilation_accel *InstancePtr, u16 DeviceId) {
XXf_dilation_accel_Config *ConfigPtr;
Xil_AssertNonvoid(InstancePtr != NULL);
ConfigPtr = XXf_dilation_accel_LookupConfig(DeviceId);
if (ConfigPtr == NULL) {
InstancePtr->IsReady = 0;
return (XST_DEVICE_NOT_FOUND);
}
return XXf_dilation_accel_CfgInitialize(InstancePtr, ConfigPtr);
}
#endif
|
Surya-98/Snapcuit
|
NGSpice/ngspice-30/src/frontend/com_history.c
|
/**********
Copyright 1990 Regents of the University of California. All rights reserved.
Author: 1985 <NAME>, U. C. Berkeley CAD Group
**********/
/* Do history substitutions. */
#include "ngspice/ngspice.h"
#include "ngspice/cpdefs.h"
#include "com_history.h"
#ifdef HAVE_GNUREADLINE
/* Added GNU Readline Support -- <NAME> <<EMAIL>> */
#include <readline/readline.h>
#include <readline/history.h>
#endif
#ifdef HAVE_BSDEDITLINE
/* SJB added edit line support 2005-05-05 */
#include <editline/readline.h>
#endif
static wordlist *dohsubst(char *string);
static wordlist *dohmod(char **string, wordlist *wl);
static wordlist *hpattern(char *buf);
static wordlist *hprefix(char *buf);
static wordlist *getevent(int num);
#if !defined(HAVE_GNUREADLINE) && !defined(HAVE_BSDEDITLINE)
static void cp_hprint(int eventhi, int eventlo, bool rev);
static void freehist(int num);
#endif
static char *dohs(char *pat, char *str);
struct histent *cp_lastone = NULL;
int cp_maxhistlength = 10000; /* Chris Inbody */
char cp_hat = '^';
char cp_bang = '!';
bool cp_didhsubst;
static struct histent *histlist = NULL;
static int histlength = 0;
/* First check for a ^ at the beginning of the line, and then search
* each word for !. Following this can be any of string, number,
* ?string, -number ; then there may be a word specifier, the same as
* csh, and then the : modifiers. For the :s modifier, the syntax is
* :sXoooXnnnX, where X is any character, and ooo and nnn are strings
* not containing X.
*/
wordlist *
cp_histsubst(wordlist *wlist)
{
wordlist *nwl, *w, *n;
char *s, *b;
/* Replace ^old^new with !:s^old^new. */
cp_didhsubst = FALSE;
if (*wlist->wl_word == cp_hat) {
char *x = wlist->wl_word;
wlist->wl_word = tprintf("%c%c:s%s", cp_bang, cp_bang, wlist->wl_word);
tfree(x);
}
for (w = wlist; w; w = w->wl_next) {
b = w->wl_word;
for (s = b; *s; s++)
if (*s == cp_bang) {
cp_didhsubst = TRUE;
n = dohsubst(s + 1);
if (!n) {
wlist->wl_word = NULL;
return (wlist);
}
if (s > b) {
char *x = n->wl_word;
n->wl_word = tprintf("%.*s%s", (int)(s-b), b, n->wl_word);
tfree(x);
}
nwl = wl_splice(w, n);
if (wlist == w)
wlist = n;
w = nwl;
break;
}
}
return (wlist);
}
/* Do a history substitution on one word. Figure out which event is
* being referenced, then do word selections and modifications, and
* then stick anything left over on the end of the last word.
*/
static wordlist *
dohsubst(char *string)
{
wordlist *wl, *nwl;
char buf[BSIZE_SP], *s, *r = NULL, *t;
if (*string == cp_bang) {
if (cp_lastone) {
wl = cp_lastone->hi_wlist;
string++;
} else {
fprintf(cp_err, "0: event not found.\n");
return (NULL);
}
} else {
switch (*string) {
case '-':
wl = getevent(cp_event - scannum(++string));
if (!wl)
return (NULL);
while (isdigit_c(*string))
string++;
break;
case '?':
(void) strcpy(buf, string + 1);
if ((s = strchr(buf, '?')) != NULL)
*s = '\0';
wl = hpattern(buf);
if (!wl)
return (NULL);
if (s == NULL) /* No modifiers on this one. */
return (wl_copy(wl));
break;
case '\0': /* Maybe this should be cp_event. */
wl = wl_cons(copy("!"), NULL);
cp_didhsubst = FALSE;
return (wl);
default:
if (isdigit_c(*string)) {
wl = getevent(scannum(string));
if (!wl)
return (NULL);
while (isdigit_c(*string))
string++;
} else {
(void) strcpy(buf, string);
for (s = ":^$*-%"; *s; s++) {
t = strchr(buf, *s);
if (t && ((t < r) || !r)) {
r = t;
string += r - buf;
}
}
if (r)
*r = '\0';
else
while (*string)
string++;
if ((buf[0] == '\0') && cp_lastone)
wl = cp_lastone->hi_wlist;
else
wl = hprefix(buf);
if (!wl)
return (NULL);
}
}
}
if (wl == NULL) { /* Shouldn't happen. */
fprintf(cp_err, "Event not found.\n");
return (NULL);
}
nwl = dohmod(&string, wl_copy(wl));
if (!nwl)
return (NULL);
if (*string) {
char *x;
for (wl = nwl; wl->wl_next; wl = wl->wl_next)
;
x = wl->wl_word;
wl->wl_word = tprintf("%s%s", wl->wl_word, string);
tfree(x);
}
return (nwl);
}
static wordlist *
dohmod(char **string, wordlist *wl)
{
wordlist *w;
char *s;
char *r = NULL, *t;
int numwords, eventlo, eventhi, i;
bool globalsubst;
anothermod:
numwords = wl_length(wl);
globalsubst = FALSE;
eventlo = 0;
eventhi = numwords - 1;
/* Now we know what wordlist we want. Take care of modifiers now. */
r = NULL;
for (s = ":^$*-%"; *s; s++) {
t = strchr(*string, *s);
if (t && ((t < r) || (r == NULL)))
r = t;
}
if (!r) /* No more modifiers. */
return (wl);
*string = r;
if (**string == ':')
(*string)++;
switch (**string) {
case '$': /* Last word. */
eventhi = eventlo = numwords - 1;
break;
case '*': /* Words 1 through $ */
if (numwords == 1)
return (NULL);
eventlo = 1;
eventhi = numwords - 1;
break;
case '-': /* Words 0 through ... */
eventlo = 0;
if (*(*string + 1))
eventhi = scannum(*string + 1);
else
eventhi = numwords - 1;
if (eventhi > numwords - 1)
eventhi = numwords - 1;
break;
case 'p': /* Print the command and don't execute it.
* This doesn't work quite like csh.
*/
wl_print(wl, cp_out);
(void) putc('\n', cp_out);
return (NULL);
case 's': /* Do a substitution. */
for (w = wl; w; w = w->wl_next) {
s = dohs(*string + 1, w->wl_word);
if (s) {
tfree(w->wl_word);
w->wl_word = s;
if (globalsubst == FALSE) {
while (**string)
(*string)++;
break;
}
}
}
/* In case globalsubst is TRUE... */
while (**string)
(*string)++;
break;
default:
if (!isdigit_c(**string)) {
fprintf(cp_err, "Error: %s: bad modifier.\n",
*string);
return (NULL);
}
i = scannum(*string);
if (i > eventhi) {
fprintf(cp_err, "Error: bad event number %d\n",
i);
return (NULL);
}
eventhi = eventlo = i;
while (isdigit_c(**string))
(*string)++;
if (**string == '*')
eventhi = numwords - 1;
if (**string == '-') {
if (!isdigit_c(*(*string + 1))) {
eventhi = numwords - 1;
} else {
eventhi = scannum(++*string);
while (isdigit_c(**string))
(*string)++;
}
}
}
/* Now change the word list accordingly and make another pass
* if there is more of the substitute left.
*/
wl = wl_range(wl, eventlo, eventhi);
numwords = wl_length(wl);
if (**string && *++*string)
goto anothermod;
return (wl);
}
/* Look for an event with a pattern in it... */
static wordlist *
hpattern(char *buf)
{
struct histent *hi;
wordlist *wl;
if (*buf == '\0') {
fprintf(cp_err, "Bad pattern specification.\n");
return (NULL);
}
for (hi = cp_lastone; hi; hi = hi->hi_prev)
for (wl = hi->hi_wlist; wl; wl = wl->wl_next)
if (substring(buf, wl->wl_word))
return (hi->hi_wlist);
fprintf(cp_err, "%s: event not found.\n", buf);
return (NULL);
}
static wordlist *
hprefix(char *buf)
{
struct histent *hi;
if (*buf == '\0') {
fprintf(cp_err, "Bad pattern specification.\n");
return (NULL);
}
for (hi = cp_lastone; hi; hi = hi->hi_prev)
if (hi->hi_wlist && prefix(buf, hi->hi_wlist->wl_word))
return (hi->hi_wlist);
fprintf(cp_err, "%s: event not found.\n", buf);
return (NULL);
}
/* Add a wordlist to the history list. (Done after the first parse.) Note
* that if event numbers are given in a random order that's how they'll
* show up in the history list.
*/
void
cp_addhistent(int event, wordlist *wlist)
{
/* MW. This test is not needed if everything works right
if (cp_lastone && !cp_lastone->hi_wlist)
fprintf(cp_err, "Internal error: bad history list\n"); */
if (cp_lastone == NULL) {
/* MW. the begging - initialize histlength */
histlength = 1;
cp_lastone = histlist = TMALLOC(struct histent, 1);
cp_lastone->hi_prev = NULL;
} else {
cp_lastone->hi_next = TMALLOC(struct histent, 1);
cp_lastone->hi_next->hi_prev = cp_lastone;
cp_lastone = cp_lastone->hi_next;
}
cp_lastone->hi_next = NULL;
cp_lastone->hi_event = event;
cp_lastone->hi_wlist = wl_copy(wlist);
#if !defined(HAVE_GNUREADLINE) && !defined(HAVE_BSDEDITLINE)
freehist(histlength - cp_maxhistlength);
histlength++;
#endif
}
/* Get a copy of the wordlist associated with an event. Error if out
* of range.
*/
static wordlist *
getevent(int num)
{
struct histent *hi;
for (hi = histlist; hi; hi = hi->hi_next)
if (hi->hi_event == num)
break;
if (hi == NULL) {
fprintf(cp_err, "%d: event not found.\n", num);
return (NULL);
}
return (wl_copy(hi->hi_wlist));
}
#if !defined(HAVE_GNUREADLINE) && !defined(HAVE_BSDEDITLINE)
/* Print out history between eventhi and eventlo.
* This doesn't remember quoting, so 'hodedo' prints as hodedo.
*/
static void
cp_hprint(int eventhi, int eventlo, bool rev)
{
struct histent *hi;
if (rev) {
for (hi = histlist; hi->hi_next; hi = hi->hi_next)
;
for (; hi; hi = hi->hi_prev)
if ((hi->hi_event <= eventhi) &&
(hi->hi_event >= eventlo) &&
hi->hi_wlist)
{
fprintf(cp_out, "%d\t", hi->hi_event);
wl_print(hi->hi_wlist, cp_out);
(void) putc('\n', cp_out);
}
} else {
for (hi = histlist; hi; hi = hi->hi_next)
if ((hi->hi_event <= eventhi) &&
(hi->hi_event >= eventlo) &&
hi->hi_wlist)
{
fprintf(cp_out, "%d\t", hi->hi_event);
wl_print(hi->hi_wlist, cp_out);
(void) putc('\n', cp_out);
}
}
}
/* This just gets rid of the first num entries on the history list, and
* decrements histlength.
*/
static void
freehist(int num)
{
struct histent *hi;
if (num < 1)
return;
histlength -= num;
hi = histlist;
while (num-- && histlist->hi_next)
histlist = histlist->hi_next;
if (histlist->hi_prev) {
histlist->hi_prev->hi_next = NULL;
histlist->hi_prev = NULL;
} else {
fprintf(cp_err, "Internal error: history list mangled\n");
exit(0); /* <NAME> */
}
while (hi->hi_next) {
wl_free(hi->hi_wlist);
hi = hi->hi_next;
tfree(hi->hi_prev);
}
wl_free(hi->hi_wlist);
tfree(hi);
}
#endif /* !defined(HAVE_GNUREADLINE) && !defined(HAVE_BSDEDITLINE) */
/* Do a :s substitution. */
static char *
dohs(char *pat, char *str)
{
char schar, *s, *p, buf[BSIZE_SP];
int i = 0, plen;
bool ok = FALSE;
pat = copy(pat); /* Don't want to mangle anything. */
schar = *pat++;
s = strchr(pat, schar);
if (s == NULL) {
fprintf(cp_err, "Bad substitute.\n");
return (NULL);
}
*s++ = '\0';
p = strchr(s, schar);
if (p)
*p = '\0';
plen = (int) strlen(pat) - 1;
for (i = 0; *str; str++) {
if ((*str == *pat) && prefix(pat, str) && (ok == FALSE)) {
for (p = s; *p; p++)
buf[i++] = *p;
str += plen;
ok = TRUE;
} else {
buf[i++] = *str;
}
}
buf[i] = '\0';
if (ok)
return (copy(buf));
else
return (NULL);
}
/* The "history" command. history [-r] [number] */
void
com_history(wordlist *wl)
{
bool rev = FALSE;
if (wl && eq(wl->wl_word, "-r")) {
wl = wl->wl_next;
rev = TRUE;
}
#if defined(HAVE_GNUREADLINE) || defined(HAVE_BSDEDITLINE)
/* Added GNU Readline Support -- <NAME> <<EMAIL>> */
{
HIST_ENTRY *he;
int i, N;
N = (wl == NULL) ? history_length : atoi(wl->wl_word);
if (N < 0)
N = 0;
if (N > history_length)
N = history_length;
if (rev)
for (i = history_length; i > 0 && N; --i, --N) {
he = history_get(i);
if (!he)
return;
fprintf(cp_out, "%d\t%s\n", i, he->line);
}
else
for (i = history_length - N + 1; i <= history_length; ++i) {
he = history_get(i);
if (!he)
return;
fprintf(cp_out, "%d\t%s\n", i, he->line);
}
}
#else
if (wl == NULL)
cp_hprint(cp_event - 1, cp_event - histlength, rev);
else
cp_hprint(cp_event - 1, cp_event - 1 - atoi(wl->wl_word), rev);
#endif
}
|
evilmucedin/icfpc2020
|
src/common/geometry/d2/vector.h
|
#pragma once
#include "common/base.h"
#include "common/geometry/d2/point.h"
#include <cmath>
namespace geometry {
namespace d2 {
template <class T>
class Vector {
public:
using TSelf = Vector<T>;
T dx, dy;
Vector() : dx(), dy() {}
Vector(const T& _dx, const T& _dy) : dx(_dx), dy(_dy) {}
explicit Vector(const Point<T>& p) : dx(p.x), dy(p.y) {}
Point<T> ToPoint() const { return Point<T>(dx, dy); }
bool Empty() const { return (dx == 0) && (dy == 0); }
T LengthSquared() const { return dx * dx + dy * dy; }
T Length() const { return sqrt(LengthSquared()); }
TSelf& operator*=(const T& r) {
dx *= r;
dy *= r;
return *this;
}
TSelf& operator/=(const T& r) {
dx /= r;
dy /= r;
return *this;
}
TSelf operator*(const T& r) const { return TSelf(dx * r, dy * r); }
TSelf operator/(const T& r) const { return TSelf(dx / r, dy / r); }
TSelf operator-() const { return TSelf(-dx, -dy); }
TSelf& operator+=(const TSelf& r) {
dx += r.dx;
dy += r.dy;
return *this;
}
TSelf& operator-=(const TSelf& r) {
dx -= r.dx;
dy -= r.dy;
return *this;
}
TSelf operator+(const TSelf& r) const { return TSelf(dx + r.dx, dy + r.dy); }
TSelf operator-(const TSelf& r) const { return TSelf(dx - r.dx, dy - r.dy); }
T operator*(const TSelf& r) const { return dx * r.dx + dy * r.dy; }
T operator%(const TSelf& r) const { return dx * r.dy - dy * r.dx; }
void Normalize() {
assert(!Empty());
operator/=(Length());
}
bool UpperHalfPlane() const { return (dy > 0) || ((dy == 0) && (dx >= 0)); }
double Angle() const {
assert(!Empty());
return atan2(dy, dx);
}
};
} // namespace d2
} // namespace geometry
using D2Vector = geometry::d2::Vector<double>;
using I2Vector = geometry::d2::Vector<int64_t>;
|
iCHEF/gypcrete
|
packages/storybook/examples/core/Avatar.stories.js
|
<gh_stars>10-100
import React from 'react';
import Avatar from '@ichef/gypcrete/src/Avatar';
import FlexRow from 'utils/FlexRow';
export default {
title: '@ichef/gypcrete|Avatar',
component: Avatar,
};
export const basicUsage = () => (
<FlexRow>
<Avatar alt="Avatar of Design" src="https://api.adorable.io/avatars/285/design@ichef.tw" />
<Avatar type="square" alt="Avatar of RD" src="https://api.adorable.io/avatars/285/rd@ichef.tw" />
<Avatar type="rounded" alt="Avatar of Marketing" src="https://api.adorable.io/avatars/285/marketing@ichef.tw" />
<Avatar type="circle" alt="Avatar of Customer Service" src="https://api.adorable.io/avatars/285/customer_service@ichef.tw" />
</FlexRow>
);
|
knocknote/eevee
|
plugin/dao/interface.go
|
package dao
import (
"sync"
. "go.knocknote.io/eevee/code"
"go.knocknote.io/eevee/types"
)
const (
// ImportPlugin name for hook of Imports
ImportsPlugin = "imports"
// StructFieldsPlugin name for hook of StructFields
StructFieldsPlugin = "struct-fields"
// ConstructorDeclarePlugin name for hook of ConstructorDeclare
ConstructorDeclarePlugin = "constructor-declare"
// ConstructorPlugin name for hook of Constructor
ConstructorPlugin = "constructor"
// CreateDeclarePlugin name for hook of CreateDeclare
CreateDeclarePlugin = "create-declare"
// BeforeCreatePlugin name for hook of BeforeCreate
BeforeCreatePlugin = "before-create"
// CreatePlugin name for hook of Create
CreatePlugin = "create"
// AfterCreatePlugin name for hook of AfterCreate
AfterCreatePlugin = "after-create"
// UpdateDeclarePlugin name for hook of UpdateDeclare
UpdateDeclarePlugin = "update-declare"
// BeforeUpdatePlugin name for hook of BeforeUpdate
BeforeUpdatePlugin = "before-update"
// UpdatePlugin name for hook of Update
UpdatePlugin = "update"
// AfterUpdatePlugin name for hook of AfterUpdate
AfterUpdatePlugin = "after-update"
// DeleteDeclarePlugin name for hook of DeleteDeclare
DeleteDeclarePlugin = "delete-declare"
// BeforeDeletePlugin name for hook of BeforeDelete
BeforeDeletePlugin = "before-delete"
// DeletePlugin name for hook of Delete
DeletePlugin = "delete"
// AfterDeletePlugin name for hook of AfterDelete
AfterDeletePlugin = "after-delete"
// FindAllDeclarePlugin name for hook of FindAllDeclare
FindAllDeclarePlugin = "find-all-declare"
// BeforeFindAllPlugin name for hook of BeforeFindAll
BeforeFindAllPlugin = "before-find-all"
// FindAllPlugin name for hook of FindAll
FindAllPlugin = "find-all"
// AfterFindAllPlugin name for hook of AfterFindAll
AfterFindAllPlugin = "after-find-all"
// CountDeclarePlugin name for hook of CountDeclare
CountDeclarePlugin = "count-declare"
// BeforeCountPlugin name for hook of BeforeCount
BeforeCountPlugin = "before-count"
// CountPlugin name for hook of Count
CountPlugin = "count"
// AfterCountPlugin name for hook of AfterCount
AfterCountPlugin = "after-count"
// FindByDeclarePlugin name for hook of FindByDeclare
FindByDeclarePlugin = "findby-declare"
// BeforeFindByPlugin name for hook of BeforeFindBy
BeforeFindByPlugin = "before-findby"
// FindByPlugin name for hook of FindBy
FindByPlugin = "findby"
// AfterFindByPlugin name for hook of AfterFindBy
AfterFindByPlugin = "after-findby"
// FindByPluralDeclarePlugin name for hook of FindByPluralDeclare
FindByPluralDeclarePlugin = "findby-plural-declare"
// BeforeFindByPluralPlugin name for hook of BeforeFindByPlural
BeforeFindByPluralPlugin = "before-findby-plural"
// FindByPluralPlugin name for hook of FindByPlural
FindByPluralPlugin = "findby-plural"
// AfterFindByPluralPlugin name for hook of AfterFindByPlural
AfterFindByPluralPlugin = "after-findby-plural"
// UpdateByDeclarePlugin name for hook of UpdateByDeclare
UpdateByDeclarePlugin = "updateby-declare"
// BeforeUpdateByPlugin name for hook of BeforeUpdateBy
BeforeUpdateByPlugin = "before-updateby"
// UpdateByPlugin name for hook of UpdateBy
UpdateByPlugin = "updateby"
// AfterUpdateByPlugin name for hook of AfterUpdateBy
AfterUpdateByPlugin = "after-updateby"
// UpdateByPluralDeclarePlugin name for hook of UpdateByPluralDeclare
UpdateByPluralDeclarePlugin = "updateby-plural-declare"
// BeforeUpdateByPluralPlugin name for hook of BeforeUpdateByPlural
BeforeUpdateByPluralPlugin = "before-updateby-plural"
// UpdateByPluralPlugin name for hook of UpdateByPlural
UpdateByPluralPlugin = "updateby-plural"
// AfterUpdateByPluralPlugin name for hook of AfterUpdateByPlural
AfterUpdateByPluralPlugin = "after-updateby-plural"
// DeleteByDeclarePlugin name for hook of DeleteByDeclare
DeleteByDeclarePlugin = "deleteby-declare"
// BeforeDeleteByPlugin name for hook of BeforeDeleteBy
BeforeDeleteByPlugin = "before-deleteby"
// DeleteByPlugin name for hook of DeleteBy
DeleteByPlugin = "deleteby"
// AfterDeleteByPlugin name for hook of AfterDeleteBy
AfterDeleteByPlugin = "after-deleteby"
// DeleteByPluralDeclarePlugin name for hook of DeleteByPluralDeclare
DeleteByPluralDeclarePlugin = "deleteby-plural-declare"
// BeforeDeleteByPluralPlugin name for hook of BeforeDeleteByPlural
BeforeDeleteByPluralPlugin = "before-deleteby-plural"
// DeleteByPluralPlugin name for hook of DeleteByPlural
DeleteByPluralPlugin = "deleteby-plural"
// AfterDeleteByPluralPlugin name for hook of AfterDeleteByPlural
AfterDeleteByPluralPlugin = "after-deleteby-plural"
)
type DataStorePlugin interface {
// StructFields hook definition of data accessor structure
StructFields(*types.Class, types.StructFieldList) types.StructFieldList
// Imports hook import statement
Imports(types.ImportList) types.ImportList
// ConstructorDeclare hook declaration for NewXX interface
ConstructorDeclare(*types.ConstructorDeclare) error
// Constructor initialize data accessor
Constructor(*types.ConstructorParam) []Code
// Create exec insert query to database in default
Create(*types.CreateParam) []Code
// Update exec update query with 'where id = ?' to database in default
Update(*types.UpdateParam) []Code
// Delete exec delete query with 'where id = ?' to database in default
Delete(*types.DeleteParam) []Code
// FindAll exec select query without where statement to database in default
FindAll(*types.FindParam) []Code
// Count exec count query to database in default
Count(*types.CountParam) []Code
// FindBy exec select query to database in default
FindBy(*types.FindParam) []Code
// FindByPlural exec select query to database in default
FindByPlural(*types.FindParam) []Code
// UpdateBy exec update query to database in default
UpdateBy(*types.UpdateParam) []Code
// UpdateByPlural exec update query to database in default
UpdateByPlural(*types.UpdateParam) []Code
// DeleteBy exec delete query to database in default
DeleteBy(*types.DeleteParam) []Code
// DeleteByPlural exec delete query to database in default
DeleteByPlural(*types.DeleteParam) []Code
}
type DAOPlugin interface {
DataStorePlugin
// CreateDeclare hook declaration for Create interface
CreateDeclare(*types.MethodDeclare) error
// BeforeCreate insert some codes as first statement for Create
BeforeCreate(*types.CreateParam) []Code
// AfterCreate insert some codes in 'defer' function for Create
AfterCreate(*types.CreateParam) []Code
// UpdateDeclare hook declaration for Update interface
UpdateDeclare(*types.MethodDeclare) error
// BeforeUpdate insert some codes as first statement for Update
BeforeUpdate(*types.UpdateParam) []Code
// AfterUpdate insert some codes in 'defer' function for Update
AfterUpdate(*types.UpdateParam) []Code
// DeleteDeclare hook declaration for Delete interface
DeleteDeclare(*types.MethodDeclare) error
// BeforeDelete insert some codes as first statement for Delete
BeforeDelete(*types.DeleteParam) []Code
// AfterDelete insert some codes in 'defer' function for Delete
AfterDelete(*types.DeleteParam) []Code
// FindAllDeclare hook declaration for FindAll interface
FindAllDeclare(*types.MethodDeclare) error
// BeforeFindAll insert some codes as first statement for FindAll
BeforeFindAll(*types.FindParam) []Code
// AfterFindAll insert some codes in 'defer' function for FindAll
AfterFindAll(*types.FindParam) []Code
// CountDeclare hook declaration for Count interface
CountDeclare(*types.MethodDeclare) error
// BeforeCount insert some codes as first statement for Count
BeforeCount(*types.CountParam) []Code
// AfterCount insert some codes in 'defer' function for Count
AfterCount(*types.CountParam) []Code
// FindByDeclare hook declaration for FindBy interface
FindByDeclare(*types.MethodDeclare) error
// BeforeFindBy insert some codes as first statement for FindBy
BeforeFindBy(*types.FindParam) []Code
// AfterFindBy insert some codes in 'defer' function for FindBy
AfterFindBy(*types.FindParam) []Code
// FindByPluralDeclare hook declaration for FindByPlural interface
FindByPluralDeclare(*types.MethodDeclare) error
// BeforeFindByPlural insert some codes as first statement for FindByPlural
BeforeFindByPlural(*types.FindParam) []Code
// AfterFindByPlural insert some codes in 'defer' function for FindByPlural
AfterFindByPlural(*types.FindParam) []Code
// UpdateByDeclare hook declaration for UpdateBy interface
UpdateByDeclare(*types.MethodDeclare) error
// BeforeUpdateBy insert some codes as first statement for UpdateBy
BeforeUpdateBy(*types.UpdateParam) []Code
// AfterUpdateBy insert some codes in 'defer' function for UpdateBy
AfterUpdateBy(*types.UpdateParam) []Code
// UpdateByPluralDeclare hook declaration for UpdateByPlural interface
UpdateByPluralDeclare(*types.MethodDeclare) error
// BeforeUpdateByPlural insert some codes as first statement for UpdateByPlural
BeforeUpdateByPlural(*types.UpdateParam) []Code
// AfterUpdateByPlural insert some codes in 'defer' function for UpdateByPlural
AfterUpdateByPlural(*types.UpdateParam) []Code
// DeleteByDeclare hook declaration for DeleteBy interface
DeleteByDeclare(*types.MethodDeclare) error
// BeforeDeleteBy insert some codes as first statement for DeleteBy
BeforeDeleteBy(*types.DeleteParam) []Code
// AfterDeleteBy insert some codes in 'defer' function for DeleteBy
AfterDeleteBy(*types.DeleteParam) []Code
// DeleteByPluralDeclare hook declaration for DeleteByPlural interface
DeleteByPluralDeclare(*types.MethodDeclare) error
// BeforeDeleteByPlural insert some codes as first statement for DeleteByPlural
BeforeDeleteByPlural(*types.DeleteParam) []Code
// AfterDeleteByPlural insert some codes in 'defer' function for DeleteByPlural
AfterDeleteByPlural(*types.DeleteParam) []Code
}
var (
datastoresMu sync.RWMutex
pluginsMu sync.RWMutex
datastores = map[string]DataStorePlugin{}
plugins = map[string]DAOPlugin{}
)
func RegisterDataStore(name string, datastore DataStorePlugin) {
datastoresMu.Lock()
defer datastoresMu.Unlock()
datastores[name] = datastore
}
func Register(name string, plugin DAOPlugin) {
pluginsMu.Lock()
defer pluginsMu.Unlock()
plugins[name] = plugin
}
type DAOPluginMap map[string]func(types.DAOContext) ([]Code, error)
func DataStoreMap(name string) (DAOPluginMap, bool) {
datastore, ok := datastores[name]
if !ok {
return nil, ok
}
return map[string]func(types.DAOContext) ([]Code, error){
ConstructorDeclarePlugin: func(c types.DAOContext) ([]Code, error) {
return nil, datastore.ConstructorDeclare(c.(*types.ConstructorDeclare))
},
ConstructorPlugin: func(c types.DAOContext) ([]Code, error) {
return datastore.Constructor(c.(*types.ConstructorParam)), nil
},
CreatePlugin: func(c types.DAOContext) ([]Code, error) {
return datastore.Create(c.(*types.CreateParam)), nil
},
UpdatePlugin: func(c types.DAOContext) ([]Code, error) {
return datastore.Update(c.(*types.UpdateParam)), nil
},
DeletePlugin: func(c types.DAOContext) ([]Code, error) {
return datastore.Delete(c.(*types.DeleteParam)), nil
},
FindAllPlugin: func(c types.DAOContext) ([]Code, error) {
return datastore.FindAll(c.(*types.FindParam)), nil
},
CountPlugin: func(c types.DAOContext) ([]Code, error) {
return datastore.Count(c.(*types.CountParam)), nil
},
FindByPlugin: func(c types.DAOContext) ([]Code, error) {
return datastore.FindBy(c.(*types.FindParam)), nil
},
FindByPluralPlugin: func(c types.DAOContext) ([]Code, error) {
return datastore.FindByPlural(c.(*types.FindParam)), nil
},
UpdateByPlugin: func(c types.DAOContext) ([]Code, error) {
return datastore.UpdateBy(c.(*types.UpdateParam)), nil
},
UpdateByPluralPlugin: func(c types.DAOContext) ([]Code, error) {
return datastore.UpdateByPlural(c.(*types.UpdateParam)), nil
},
DeleteByPlugin: func(c types.DAOContext) ([]Code, error) {
return datastore.DeleteBy(c.(*types.DeleteParam)), nil
},
DeleteByPluralPlugin: func(c types.DAOContext) ([]Code, error) {
return datastore.DeleteByPlural(c.(*types.DeleteParam)), nil
},
}, ok
}
func PluginMap(name string) (DAOPluginMap, bool) {
plugin, ok := plugins[name]
if !ok {
return nil, ok
}
return map[string]func(types.DAOContext) ([]Code, error){
ConstructorDeclarePlugin: func(c types.DAOContext) ([]Code, error) {
return nil, plugin.ConstructorDeclare(c.(*types.ConstructorDeclare))
},
ConstructorPlugin: func(c types.DAOContext) ([]Code, error) {
return plugin.Constructor(c.(*types.ConstructorParam)), nil
},
CreateDeclarePlugin: func(c types.DAOContext) ([]Code, error) {
return nil, plugin.CreateDeclare(c.(*types.MethodDeclare))
},
BeforeCreatePlugin: func(c types.DAOContext) ([]Code, error) {
return plugin.BeforeCreate(c.(*types.CreateParam)), nil
},
CreatePlugin: func(c types.DAOContext) ([]Code, error) {
return plugin.Create(c.(*types.CreateParam)), nil
},
AfterCreatePlugin: func(c types.DAOContext) ([]Code, error) {
return plugin.AfterCreate(c.(*types.CreateParam)), nil
},
UpdateDeclarePlugin: func(c types.DAOContext) ([]Code, error) {
return nil, plugin.UpdateDeclare(c.(*types.MethodDeclare))
},
BeforeUpdatePlugin: func(c types.DAOContext) ([]Code, error) {
return plugin.BeforeUpdate(c.(*types.UpdateParam)), nil
},
UpdatePlugin: func(c types.DAOContext) ([]Code, error) {
return plugin.Update(c.(*types.UpdateParam)), nil
},
AfterUpdatePlugin: func(c types.DAOContext) ([]Code, error) {
return plugin.AfterUpdate(c.(*types.UpdateParam)), nil
},
DeleteDeclarePlugin: func(c types.DAOContext) ([]Code, error) {
return nil, plugin.DeleteDeclare(c.(*types.MethodDeclare))
},
BeforeDeletePlugin: func(c types.DAOContext) ([]Code, error) {
return plugin.BeforeDelete(c.(*types.DeleteParam)), nil
},
DeletePlugin: func(c types.DAOContext) ([]Code, error) {
return plugin.Delete(c.(*types.DeleteParam)), nil
},
AfterDeletePlugin: func(c types.DAOContext) ([]Code, error) {
return plugin.AfterDelete(c.(*types.DeleteParam)), nil
},
FindAllDeclarePlugin: func(c types.DAOContext) ([]Code, error) {
return nil, plugin.FindAllDeclare(c.(*types.MethodDeclare))
},
BeforeFindAllPlugin: func(c types.DAOContext) ([]Code, error) {
return plugin.BeforeFindAll(c.(*types.FindParam)), nil
},
FindAllPlugin: func(c types.DAOContext) ([]Code, error) {
return plugin.FindAll(c.(*types.FindParam)), nil
},
AfterFindAllPlugin: func(c types.DAOContext) ([]Code, error) {
return plugin.AfterFindAll(c.(*types.FindParam)), nil
},
CountDeclarePlugin: func(c types.DAOContext) ([]Code, error) {
return nil, plugin.CountDeclare(c.(*types.MethodDeclare))
},
BeforeCountPlugin: func(c types.DAOContext) ([]Code, error) {
return plugin.BeforeCount(c.(*types.CountParam)), nil
},
CountPlugin: func(c types.DAOContext) ([]Code, error) {
return plugin.Count(c.(*types.CountParam)), nil
},
AfterCountPlugin: func(c types.DAOContext) ([]Code, error) {
return plugin.AfterCount(c.(*types.CountParam)), nil
},
FindByDeclarePlugin: func(c types.DAOContext) ([]Code, error) {
return nil, plugin.FindByDeclare(c.(*types.MethodDeclare))
},
BeforeFindByPlugin: func(c types.DAOContext) ([]Code, error) {
return plugin.BeforeFindBy(c.(*types.FindParam)), nil
},
FindByPlugin: func(c types.DAOContext) ([]Code, error) {
return plugin.FindBy(c.(*types.FindParam)), nil
},
AfterFindByPlugin: func(c types.DAOContext) ([]Code, error) {
return plugin.AfterFindBy(c.(*types.FindParam)), nil
},
FindByPluralDeclarePlugin: func(c types.DAOContext) ([]Code, error) {
return nil, plugin.FindByPluralDeclare(c.(*types.MethodDeclare))
},
BeforeFindByPluralPlugin: func(c types.DAOContext) ([]Code, error) {
return plugin.BeforeFindByPlural(c.(*types.FindParam)), nil
},
FindByPluralPlugin: func(c types.DAOContext) ([]Code, error) {
return plugin.FindByPlural(c.(*types.FindParam)), nil
},
AfterFindByPluralPlugin: func(c types.DAOContext) ([]Code, error) {
return plugin.AfterFindByPlural(c.(*types.FindParam)), nil
},
UpdateByDeclarePlugin: func(c types.DAOContext) ([]Code, error) {
return nil, plugin.UpdateByDeclare(c.(*types.MethodDeclare))
},
BeforeUpdateByPlugin: func(c types.DAOContext) ([]Code, error) {
return plugin.BeforeUpdateBy(c.(*types.UpdateParam)), nil
},
UpdateByPlugin: func(c types.DAOContext) ([]Code, error) {
return plugin.UpdateBy(c.(*types.UpdateParam)), nil
},
AfterUpdateByPlugin: func(c types.DAOContext) ([]Code, error) {
return plugin.AfterUpdateBy(c.(*types.UpdateParam)), nil
},
UpdateByPluralDeclarePlugin: func(c types.DAOContext) ([]Code, error) {
return nil, plugin.UpdateByPluralDeclare(c.(*types.MethodDeclare))
},
BeforeUpdateByPluralPlugin: func(c types.DAOContext) ([]Code, error) {
return plugin.BeforeUpdateByPlural(c.(*types.UpdateParam)), nil
},
UpdateByPluralPlugin: func(c types.DAOContext) ([]Code, error) {
return plugin.UpdateByPlural(c.(*types.UpdateParam)), nil
},
AfterUpdateByPluralPlugin: func(c types.DAOContext) ([]Code, error) {
return plugin.AfterUpdateByPlural(c.(*types.UpdateParam)), nil
},
DeleteByDeclarePlugin: func(c types.DAOContext) ([]Code, error) {
return nil, plugin.DeleteByDeclare(c.(*types.MethodDeclare))
},
BeforeDeleteByPlugin: func(c types.DAOContext) ([]Code, error) {
return plugin.BeforeDeleteBy(c.(*types.DeleteParam)), nil
},
DeleteByPlugin: func(c types.DAOContext) ([]Code, error) {
return plugin.DeleteBy(c.(*types.DeleteParam)), nil
},
AfterDeleteByPlugin: func(c types.DAOContext) ([]Code, error) {
return plugin.AfterDeleteBy(c.(*types.DeleteParam)), nil
},
DeleteByPluralDeclarePlugin: func(c types.DAOContext) ([]Code, error) {
return nil, plugin.DeleteByPluralDeclare(c.(*types.MethodDeclare))
},
BeforeDeleteByPluralPlugin: func(c types.DAOContext) ([]Code, error) {
return plugin.BeforeDeleteByPlural(c.(*types.DeleteParam)), nil
},
DeleteByPluralPlugin: func(c types.DAOContext) ([]Code, error) {
return plugin.DeleteByPlural(c.(*types.DeleteParam)), nil
},
AfterDeleteByPluralPlugin: func(c types.DAOContext) ([]Code, error) {
return plugin.AfterDeleteByPlural(c.(*types.DeleteParam)), nil
},
}, ok
}
func DataStoreByName(name string) DataStorePlugin {
return datastores[name]
}
func DataStoreNames() []string {
names := []string{}
for name := range datastores {
names = append(names, name)
}
return names
}
func Plugin(name string) (DAOPlugin, bool) {
plugin, ok := plugins[name]
return plugin, ok
}
func Plugins() []DAOPlugin {
plgs := []DAOPlugin{}
for _, plg := range plugins {
plgs = append(plgs, plg)
}
return plgs
}
|
IvanIndaia/ProgramadorBR
|
Modulo_21/Node/MyProgram/index.js
|
let calc = require('math')
console.log(calc.areaQuad(8))
|
shmxybfq/TFDemos
|
demo-动画增长条/表格/FormView.h
|
//
// FormView.h
// 表格
//
// Created by ztf on 15/12/2.
// Copyright © 2015年 ztf. All rights reserved.
//
#import <UIKit/UIKit.h>
@class FormView;
@protocol FormViewDataSource <NSObject>
@required
-(NSInteger)FormView:(FormView *)formView numberOfRowsInSection:(NSInteger)section;
-(NSString *)FormView:(FormView *)formView LeftText:(NSIndexPath *)indexPath;
-(CGFloat)FormView:(FormView *)formView RightViewPercent:(NSIndexPath *)indexPath;
-(CGFloat)FormView:(FormView *)formView RightViewAnimationDurition:(NSIndexPath *)indexPath;
-(CGFloat)FormView:(FormView *)formView CellHeight:(NSIndexPath *)indexPath;
-(CGFloat)FormView:(FormView *)formView BottomMargin:(NSIndexPath *)indexPath;
-(CGFloat)FormView:(FormView *)formView TopMargin:(NSIndexPath *)indexPath;
@end
@interface FormView : UIScrollView
@property (nonatomic,assign)id<FormViewDataSource>dataSource;
-(void)reloadData;
@end
|
claudimarcruz/Curso-de-Poo
|
Curso de POO com Java/Vetor/src/vetor01/Vetor01.java
|
/*
* Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
* Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Main.java to edit this template
*/
package vetor01;
import java.util.Arrays;
/**
*
* @author claud
*/
public class Vetor01 {
/**
* @param args the command line arguments
*/
public static void main(String[] args) {
// TODO code application logic here
// int n[] = {3, 2, 8, 7, 5, 4};
/*for(int c=0; c<=n.length -1;c++){
System.out.print(n[c]);
}*/
/*
Arrays.sort(n);
int pos = Arrays.binarySearch(n, 3);
for(int valor: n){
System.out.print(valor + " ");
}
System.out.println("\n" + pos);*/
int vetor[] = new int[20];
Arrays.fill(vetor, 0);
for(int valores:vetor){
System.out.print(valores + " ");
}
}
}
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.