repo_name
stringlengths 6
101
| path
stringlengths 4
300
| text
stringlengths 7
1.31M
|
|---|---|---|
MilovanTomasevic/OOP-JAVA
|
src/Cas10/oop10_jun2.2014.VelikiCeliBrojevi.Konzola/velikiCeliBrojevi_sabiranje/VelikiCeoBroj.java
|
<filename>src/Cas10/oop10_jun2.2014.VelikiCeliBrojevi.Konzola/velikiCeliBrojevi_sabiranje/VelikiCeoBroj.java
package velikiCeliBrojevi_sabiranje;
import java.util.ArrayList;
public class VelikiCeoBroj {
// znak broja
private char znak;
// lista cifara (cifre su objekti klase Integer)
private ArrayList<Integer> cifre;
// podrazumevani konstruktor pravi praznu listu cifara
public VelikiCeoBroj() {
cifre = new ArrayList<>();
}
// konstruktor koji pravi veliki ceo broj na osnovu
// pojedinacnih karaktera (koji su cifre) stringa linija
public VelikiCeoBroj(String linija) {
znak = '+';
if(linija.startsWith("-")) {
znak='-';
// uklanja se znak
linija = linija.replace("-", "");
}
// Okrecemo cifre kako bi na i-toj poziciji
// bila cifra i-te tezine
String broj = new StringBuilder(linija).reverse().toString();
cifre = new ArrayList<>();
for(int i = 0; i < broj.length(); i++)
cifre.add(broj.charAt(i)-'0');
}
public char getZnak() {
return znak;
}
public ArrayList<Integer> getCifre() {
return cifre;
}
public static VelikiCeoBroj saberi (VelikiCeoBroj vcb1, VelikiCeoBroj vcb2) {
VelikiCeoBroj rez = new VelikiCeoBroj();
// Ako su brojevi istog znaka
if(vcb1.znak == vcb2.znak){
if(absVeci(vcb1, vcb2) > 0) rez = absSabiranje(vcb1, vcb2);
else rez = absSabiranje(vcb2, vcb1);
//Rezultat je istog znaka kao i jedan od ova dva broja
rez.znak = vcb1.znak;
}
// Ako su brojevi razlicitog znaka
else {
if(absVeci(vcb1, vcb2) > 0) {
rez = absOduzimanje(vcb1, vcb2);
rez.znak = vcb1.znak;
}
else {
rez = absOduzimanje(vcb2, vcb1);
rez.znak = vcb2.znak;
}
}
return rez;
}
private static int absVeci(VelikiCeoBroj vcb1, VelikiCeoBroj vcb2){
if(vcb1.cifre.size() > vcb2.cifre.size()) return 1;
if(vcb1.cifre.size() < vcb2.cifre.size()) return -1;
for(int i = 0; i < vcb1.cifre.size(); i++){
if (vcb1.cifre.get(i) > vcb2.cifre.get(i)) return 1;
if (vcb1.cifre.get(i) < vcb2.cifre.get(i)) return -1;
}
return 0;
}
private static VelikiCeoBroj absSabiranje(VelikiCeoBroj veci, VelikiCeoBroj manji){
VelikiCeoBroj zbir = new VelikiCeoBroj();
int brCifaraManjeg = manji.cifre.size();
int brCifaraVeceg = veci.cifre.size();
int prenos = 0;
for(int i = 0; i < brCifaraVeceg; i++ ){
int c = veci.cifre.get(i)
+ ( brCifaraManjeg > i ? manji.cifre.get(i) : 0 )
+ prenos;
if(c >= 10){
prenos = 1;
c -= 10;
}
else
prenos = 0;
zbir.cifre.add(c);
}
if(prenos > 0)
zbir.cifre.add(prenos);
return zbir;
}
private static VelikiCeoBroj absOduzimanje(VelikiCeoBroj veci, VelikiCeoBroj manji) {
VelikiCeoBroj razlika = new VelikiCeoBroj();
int brCifaraManjeg = manji.cifre.size();
int brCifaraVeceg = veci.cifre.size();
int pozajmica = 0;
for( int i = 0; i < brCifaraVeceg; i++ ){
int c = veci.cifre.get(i) - (brCifaraManjeg > i ? manji.cifre.get(i) : 0) - pozajmica;
if(c < 0){
pozajmica = 1;
c += 10;
}
else pozajmica = 0;
razlika.cifre.add(c);
}
// brisemo vodece nule
while(razlika.cifre.size() > 1 && razlika.cifre.get(razlika.cifre.size()-1) == 0)
razlika.cifre.remove(razlika.cifre.size()-1);
return razlika;
}
public String toString(){
String broj = (znak == '-') ? "-" : "";
for(int i = cifre.size()-1; i >= 0; i--)
broj += cifre.get(i);
return broj;
}
}
|
mattermost/mattermost-cloud
|
internal/mocks/awat/doc.go
|
<gh_stars>10-100
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
// See LICENSE.txt for license information.
//
// Package mocks to create the mocks run go generate to regenerate this package.
package mocks
//go:generate /usr/bin/env bash -c "echo \"$(cat ../../../hack/boilerplate/boilerplate.generatego.txt)\n$(../../../bin/mockgen -package=mocks github.com/mattermost/mattermost-cloud/internal/supervisor AWATClient)\" > client.go"
|
scp504677840/Shiro
|
Authenticator/sh/src/main/java/com/sh/service/impl/UserRoleServiceImpl.java
|
<filename>Authenticator/sh/src/main/java/com/sh/service/impl/UserRoleServiceImpl.java
package com.sh.service.impl;
import com.sh.entities.UserRole;
import com.sh.mappers.UserRoleDynamicSqlSupport;
import com.sh.mappers.UserRoleMapper;
import com.sh.service.UserRoleService;
import org.mybatis.dynamic.sql.render.RenderingStrategy;
import org.mybatis.dynamic.sql.select.render.SelectStatementProvider;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.math.BigInteger;
import static com.sh.mappers.UserRoleDynamicSqlSupport.*;
import static org.mybatis.dynamic.sql.SqlBuilder.isEqualTo;
import static org.mybatis.dynamic.sql.SqlBuilder.select;
@Service
public class UserRoleServiceImpl implements UserRoleService {
@Autowired
private UserRoleMapper userRoleMapper;
@Override
public UserRole getUserRoleByUserId(BigInteger userId) {
SelectStatementProvider selectStatement = select(id, gmtCreate, gmtModified, UserRoleDynamicSqlSupport.userId, roleId)
.from(userRole)
.where(UserRoleDynamicSqlSupport.userId, isEqualTo(userId))
.build()
.render(RenderingStrategy.MYBATIS3);
return userRoleMapper.selectOne(selectStatement);
}
}
|
veosotano/lil
|
cpp/ast/LILNumberLiteral.h
|
/********************************************************************
*
* LIL Is a Language
*
* AUTHORS: <NAME>
*
* COPYRIGHT: ©2020-today: All Rights Reserved
*
* LICENSE: see LICENSE file
*
* This file represents a number written in the source code
*
********************************************************************/
#ifndef LILNUMBERLITERAL_H
#define LILNUMBERLITERAL_H
#include "LILTypedNode.h"
namespace LIL
{
class LILNumberLiteral : public LILTypedNode
{
public:
LILNumberLiteral();
LILNumberLiteral(const LILNumberLiteral & other);
std::shared_ptr<LILNumberLiteral> clone() const;
virtual ~LILNumberLiteral();
void receiveNodeData(const LIL::LILString &data);
bool equalTo(std::shared_ptr<LILNode> otherNode);
LILString getValue() const;
void setValue(LILString newValue);
private:
virtual std::shared_ptr<LILClonable> cloneImpl() const;
LILString _value;
};
}
#endif
|
is191308/sniffable
|
src/main/java/at/fhstp/bis19/prog4/snowdogs/sniffable/repo/ImageRepo.java
|
<filename>src/main/java/at/fhstp/bis19/prog4/snowdogs/sniffable/repo/ImageRepo.java<gh_stars>0
package at.fhstp.bis19.prog4.snowdogs.sniffable.repo;
import at.fhstp.bis19.prog4.snowdogs.sniffable.entity.Image;
public interface ImageRepo extends BaseCrudRepository<Image> {
}
|
iliesidaniel/image-classification
|
graphics/charts/_cc_main.py
|
<filename>graphics/charts/_cc_main.py
import tkinter as tk
from graphics.charts.column_chart import ColumnChart
from utils.charts.chart_entries import ChartEntries, ChartEntry
root = tk.Tk()
root.title('Column chart dev')
f_cc = ColumnChart(parent=root)
f_cc.pack(side='top',
fill='both',
expand=True)
ces = ChartEntries()
classes = [
'Airplane',
'Automobile',
'Bird',
'Cat',
'Deer',
'Dog',
'Frog',
'Horse',
'Ship',
'Truck',
'Airplane',
'Automobile',
'Bird',
'Cat',
'Deer',
'Dog',
'Frog',
'Horse',
'Ship',
'Truck'
]
for i in range(2):
tmp = ChartEntry()
tmp.identifier = classes[i]
tmp.x = 0
tmp.y = i * 20 + 20
ces.add(new_entry=tmp)
f_cc.update_values(ces)
# print(str(ces))
ces.clear()
for i in range(10):
tmp = ChartEntry()
tmp.identifier = classes[i]
tmp.x = 0
tmp.y = (i * 20) % 110
ces.add(new_entry=tmp)
f_cc.update_values(ces)
# print(str(ces))
RWidth = root.winfo_screenwidth()
RHeight = root.winfo_screenheight()
root.geometry('%dx%d' % (RWidth, RHeight))
root.update()
root.minsize(1700, 900)
# root.attributes('-fullscreen', True)
# root.state('zoomed')
# root.minsize(root.winfo_width(), root.winfo_height())
# root.maxsize(root.winfo_width(), root.winfo_height())
# root.resizable(0, 0)
root.mainloop()
|
ysmiles/leetcode-cpp
|
301-400/344-Reverse_String-e.cpp
|
<gh_stars>1-10
// Write a function that takes a string as input and returns the string
// reversed.
// Example:
// Given s = "hello", return "olleh".
class Solution {
public:
string reverseString(string s) {
int i = 0, j = s.size() - 1;
while (i < j)
std::swap(s[i++], s[j--]);
return s;
}
};
// MLE for very long string
// class Solution {
// public:
// string reverseString(string s) {
// if (s.size() < 2)
// return s;
// return s.back() + reverseString(s.substr(0, s.size() - 1));
// }
// };
|
jasonmit/ember-luxon
|
tests/integration/helpers/luxon-format-test.js
|
import { moduleForComponent, test } from 'ember-qunit';
import hbs from 'htmlbars-inline-precompile';
import { DateTime } from 'luxon';
moduleForComponent('luxon-format', 'helper:luxon-format', {
integration: true
});
test('applies a format', function(assert) {
let date = DateTime.local(2017, 5, 15, 8, 30);
this.set('date', date);
this.render(hbs`{{luxon-format date "yyyy LLL dd"}}`);
assert.equal(this.$().text().trim(), '2017 May 15');
});
test('defaults to locale when no format is specified', function(assert) {
let date = DateTime.local(2017, 5, 15, 8, 30);
this.set('date', date);
this.render(hbs`{{luxon-format date "yyyy LLL dd"}}`);
assert.equal(this.$().text().trim(), '2017 May 15');
});
|
LiamOSullivan/datacube-ows
|
tests/test_config_toolkit.py
|
<filename>tests/test_config_toolkit.py
# This file is part of datacube-ows, part of the Open Data Cube project.
# See https://opendatacube.org for more information.
#
# Copyright (c) 2017-2021 OWS Contributors
# SPDX-License-Identifier: Apache-2.0
from datacube_ows.config_toolkit import deepinherit
def test_deepinherit_shallow():
parent = {
"a": 72,
"b": "eagle",
"c": False
}
child = {
"a": 365
}
child = deepinherit(parent, child)
assert child['a'] == 365
assert child["b"] == "eagle"
assert not child["c"]
def test_deepinherit_deep():
parent = {
"a": 72,
"b": {
"fruit": "grapes",
"spice": "cummin",
"cake": "chocolate",
"y": ["some", "body", "once"],
"z": [44, 42, 53],
"c": {
"foo": "bar",
"wing": "wang"
}
}
}
child = {
"b": {
"spice": "nutmeg",
"c": {
"wing": "chicken"
},
"y": ["told", "me"],
"z": [11]
}
}
child = deepinherit(parent, child)
assert child["a"] == 72
assert child["b"]["spice"] == "nutmeg"
assert child["b"]["fruit"] == "grapes"
assert child["b"]["c"]["foo"] == "bar"
assert child["b"]["c"]["wing"] == "chicken"
assert child["b"]["z"] == [11]
assert child["b"]["y"] == ["some", "body", "once", "told", "me"]
|
JMedinilla/CondominApp
|
app/src/main/java/com/jmed/condominapp/presenters/IncidentPresenterImpl.java
|
<filename>app/src/main/java/com/jmed/condominapp/presenters/IncidentPresenterImpl.java
package com.jmed.condominapp.presenters;
import com.jmed.condominapp.R;
import com.jmed.condominapp.interfaces.IIncidentPresenter;
import com.jmed.condominapp.pojos.Pojo_Incident;
import com.jmed.condominapp.repositories.Repository_Incident;
import java.util.List;
public class IncidentPresenterImpl implements IIncidentPresenter {
private IIncidentPresenter.View view;
public IncidentPresenterImpl(IIncidentPresenter.View view) {
this.view = view;
}
@Override
/**
* Method to get all incidents
*/
public List<Pojo_Incident> selectIncidents() {
return Repository_Incident.getInstance().getIncidents();
}
@Override
/**
* Method to get an incident
*/
public Pojo_Incident selectIncident(String id) {
return null;
}
@Override
/**
* Method to add an incident
*/
public int insertIncident(Pojo_Incident incident) {
int result = -1;
if (!Repository_Incident.getInstance().contains(incident)) {
Repository_Incident.getInstance().add(incident);
result = 0;
view.showMessage(R.string.inserted, false);
} else {
view.showMessage(R.string.exists, false);
}
return result;
}
@Override
/**
* Method to update an incident
*/
public int updateIncident(Pojo_Incident incident) {
return 0;
}
@Override
/**
* Method to delete an incident
*/
public int deleteIncident(Pojo_Incident incident) {
int result = -1;
if (Repository_Incident.getInstance().getIncidents().remove(incident)) {
result = 0;
}
return result;
}
@Override
/**
* Method to validate an incident
*/
public boolean validateIncident(Pojo_Incident incident) {
boolean result;
if (incident.getIn_title().length() == 0) {
result = false;
view.showMessage(R.string.error_Title, true);
} else if (incident.getIn_description().length() == 0) {
result = false;
view.showMessage(R.string.error_Description, true);
} else {
result = true;
}
return result;
}
}
|
tzuyangliu/Xcode9-Runtime-Headers
|
IDEFoundation/IDEProvisioningMechanicContext.h
|
//
// Generated by class-dump 3.5 (64 bit) (Debug version compiled Sep 17 2017 16:24:48).
//
// class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2015 by <NAME>.
//
#import <objc/NSObject.h>
#import <IDEFoundation/DVTInvalidation-Protocol.h>
@class DVTStackBacktrace, IDEProvisioningMechanic, NSString;
@protocol IDEProvisioningMechanicContextProvider, IDEProvisioningTeamAccountPairProvider;
@interface IDEProvisioningMechanicContext : NSObject <DVTInvalidation>
{
BOOL _runningInIDE;
IDEProvisioningMechanic *_mechanic;
id <IDEProvisioningMechanicContextProvider> _provisioningManager;
id <IDEProvisioningTeamAccountPairProvider> _teamAccountPairProvider;
}
+ (void)initialize;
@property(nonatomic) BOOL runningInIDE; // @synthesize runningInIDE=_runningInIDE;
@property(retain, nonatomic) id <IDEProvisioningTeamAccountPairProvider> teamAccountPairProvider; // @synthesize teamAccountPairProvider=_teamAccountPairProvider;
@property(retain, nonatomic) id <IDEProvisioningMechanicContextProvider> provisioningManager; // @synthesize provisioningManager=_provisioningManager;
@property(retain, nonatomic) IDEProvisioningMechanic *mechanic; // @synthesize mechanic=_mechanic;
- (void).cxx_destruct;
- (id)makeRepairForRepairable:(id)arg1;
- (void)primitiveInvalidate;
- (id)init;
// Remaining properties
@property(retain) DVTStackBacktrace *creationBacktrace;
@property(readonly, copy) NSString *debugDescription;
@property(readonly, copy) NSString *description;
@property(readonly) unsigned long long hash;
@property(readonly) DVTStackBacktrace *invalidationBacktrace;
@property(readonly) Class superclass;
@property(readonly, nonatomic, getter=isValid) BOOL valid;
@end
|
GenaAiv/portfolio-website
|
node_modules/tslib/test/validateModuleExportsMatchCommonJS/index.js
|
<filename>node_modules/tslib/test/validateModuleExportsMatchCommonJS/index.js
// When on node 14, it validates that all of the commonjs exports
// are correctly re-exported for es modules importers.
const nodeMajor = Number(process.version.split(".")[0].slice(1))
if (nodeMajor < 14) {
console.log("Skipping because node does not support module exports.")
process.exit(0)
}
// ES Modules import via the ./modules folder
import * as esTSLib from "../../modules/index.js"
// Force a commonjs resolve
import { createRequire } from "module";
const commonJSTSLib = createRequire(import.meta.url)("../../tslib.js");
for (const key in commonJSTSLib) {
if (commonJSTSLib.hasOwnProperty(key)) {
if(!esTSLib[key]) throw new Error(`ESModules is missing ${key} - it needs to be re-exported in ./modules/index.js`)
}
}
console.log("All exports in commonjs are available for es module consumers.")
|
ecarm002/incubator-asterixdb
|
hyracks-fullstack/algebricks/algebricks-core/src/main/java/org/apache/hyracks/algebricks/core/algebra/operators/physical/InsertDeleteUpsertPOperator.java
|
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you 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.apache.hyracks.algebricks.core.algebra.operators.physical;
import java.util.ArrayList;
import java.util.List;
import org.apache.hyracks.algebricks.common.constraints.AlgebricksPartitionConstraint;
import org.apache.hyracks.algebricks.common.exceptions.AlgebricksException;
import org.apache.hyracks.algebricks.common.utils.Pair;
import org.apache.hyracks.algebricks.core.algebra.base.IHyracksJobBuilder;
import org.apache.hyracks.algebricks.core.algebra.base.ILogicalOperator;
import org.apache.hyracks.algebricks.core.algebra.base.IOptimizationContext;
import org.apache.hyracks.algebricks.core.algebra.base.LogicalVariable;
import org.apache.hyracks.algebricks.core.algebra.base.PhysicalOperatorTag;
import org.apache.hyracks.algebricks.core.algebra.expressions.IVariableTypeEnvironment;
import org.apache.hyracks.algebricks.core.algebra.metadata.IDataSource;
import org.apache.hyracks.algebricks.core.algebra.metadata.IMetadataProvider;
import org.apache.hyracks.algebricks.core.algebra.operators.logical.AbstractLogicalOperator;
import org.apache.hyracks.algebricks.core.algebra.operators.logical.IOperatorSchema;
import org.apache.hyracks.algebricks.core.algebra.operators.logical.InsertDeleteUpsertOperator;
import org.apache.hyracks.algebricks.core.algebra.operators.logical.InsertDeleteUpsertOperator.Kind;
import org.apache.hyracks.algebricks.core.algebra.properties.IPartitioningRequirementsCoordinator;
import org.apache.hyracks.algebricks.core.algebra.properties.IPhysicalPropertiesVector;
import org.apache.hyracks.algebricks.core.algebra.properties.PhysicalRequirements;
import org.apache.hyracks.algebricks.core.jobgen.impl.JobGenContext;
import org.apache.hyracks.algebricks.core.jobgen.impl.JobGenHelper;
import org.apache.hyracks.api.dataflow.IOperatorDescriptor;
import org.apache.hyracks.api.dataflow.value.RecordDescriptor;
import org.apache.hyracks.api.job.JobSpecification;
@SuppressWarnings("rawtypes")
public class InsertDeleteUpsertPOperator extends AbstractPhysicalOperator {
private final LogicalVariable payload;
private final List<LogicalVariable> keys;
private final IDataSource<?> dataSource;
private final List<LogicalVariable> additionalFilteringKeys;
private final List<LogicalVariable> additionalNonFilteringFields;
private final Kind operation;
public InsertDeleteUpsertPOperator(LogicalVariable payload, List<LogicalVariable> keys,
List<LogicalVariable> additionalFilteringKeys, IDataSource dataSource, Kind operation,
List<LogicalVariable> additionalNonFilteringFields) {
this.payload = payload;
this.keys = keys;
this.dataSource = dataSource;
this.additionalFilteringKeys = additionalFilteringKeys;
this.operation = operation;
this.additionalNonFilteringFields = additionalNonFilteringFields;
}
@Override
public PhysicalOperatorTag getOperatorTag() {
return PhysicalOperatorTag.INSERT_DELETE;
}
// Delivered Properties of this will be (Sorted on PK, Partitioned on PK)
@Override
public void computeDeliveredProperties(ILogicalOperator op, IOptimizationContext context) {
AbstractLogicalOperator op2 = (AbstractLogicalOperator) op.getInputs().get(0).getValue();
deliveredProperties = op2.getDeliveredPhysicalProperties().clone();
}
@Override
public PhysicalRequirements getRequiredPropertiesForChildren(ILogicalOperator op,
IPhysicalPropertiesVector reqdByParent, IOptimizationContext context) {
List<LogicalVariable> scanVariables = new ArrayList<LogicalVariable>();
scanVariables.addAll(keys);
scanVariables.add(payload);
if (additionalNonFilteringFields != null) {
scanVariables.addAll(additionalNonFilteringFields);
}
IPhysicalPropertiesVector r = dataSource.getPropertiesProvider().computePropertiesVector(scanVariables);
r.getLocalProperties().clear();
IPhysicalPropertiesVector[] requirements = new IPhysicalPropertiesVector[1];
requirements[0] = r;
return new PhysicalRequirements(requirements, IPartitioningRequirementsCoordinator.NO_COORDINATION);
}
@SuppressWarnings("unchecked")
@Override
public void contributeRuntimeOperator(IHyracksJobBuilder builder, JobGenContext context, ILogicalOperator op,
IOperatorSchema propagatedSchema, IOperatorSchema[] inputSchemas, IOperatorSchema outerPlanSchema)
throws AlgebricksException {
InsertDeleteUpsertOperator insertDeleteOp = (InsertDeleteUpsertOperator) op;
IMetadataProvider mp = context.getMetadataProvider();
IVariableTypeEnvironment typeEnv = context.getTypeEnvironment(op);
JobSpecification spec = builder.getJobSpec();
RecordDescriptor inputDesc = JobGenHelper.mkRecordDescriptor(
context.getTypeEnvironment(op.getInputs().get(0).getValue()), inputSchemas[0], context);
Pair<IOperatorDescriptor, AlgebricksPartitionConstraint> runtimeAndConstraints;
switch (operation) {
case INSERT:
runtimeAndConstraints = mp.getInsertRuntime(dataSource, propagatedSchema, typeEnv, keys, payload,
additionalFilteringKeys, additionalNonFilteringFields, inputDesc, context, spec, false);
break;
case DELETE:
runtimeAndConstraints = mp.getDeleteRuntime(dataSource, propagatedSchema, typeEnv, keys, payload,
additionalFilteringKeys, inputDesc, context, spec);
break;
case UPSERT:
runtimeAndConstraints = mp.getUpsertRuntime(dataSource, inputSchemas[0], typeEnv, keys, payload,
additionalFilteringKeys, additionalNonFilteringFields, inputDesc, context, spec);
break;
default:
throw new AlgebricksException("Unsupported Operation " + operation);
}
IOperatorDescriptor opDesc = runtimeAndConstraints.first;
opDesc.setSourceLocation(insertDeleteOp.getSourceLocation());
builder.contributeHyracksOperator(insertDeleteOp, opDesc);
builder.contributeAlgebricksPartitionConstraint(opDesc, runtimeAndConstraints.second);
ILogicalOperator src = insertDeleteOp.getInputs().get(0).getValue();
builder.contributeGraphEdge(src, 0, insertDeleteOp, 0);
}
@Override
public boolean isMicroOperator() {
return false;
}
@Override
public boolean expensiveThanMaterialization() {
return false;
}
}
|
NoYouShutup/CryptMeme
|
CryptMeme/apps/routerconsole/java/src/net/i2p/router/web/BanlistRenderer.java
|
<reponame>NoYouShutup/CryptMeme
package net.i2p.router.web;
/*
* free (adj.): unencumbered; not under the control of others
* Written by jrandom in 2003 and released into the public domain
* with no warranty of any kind, either expressed or implied.
* It probably won't make your computer catch on fire, or eat
* your children, but it might. Use at your own risk.
*
*/
import java.io.IOException;
import java.io.Serializable;
import java.io.Writer;
import java.util.Comparator;
import java.util.Map;
import java.util.Set;
import java.util.TreeMap;
import net.i2p.data.DataHelper;
import net.i2p.data.Hash;
import net.i2p.router.RouterContext;
import net.i2p.router.Banlist;
/**
* Moved from Banlist.java
*/
public class BanlistRenderer {
private final RouterContext _context;
public BanlistRenderer(RouterContext context) {
_context = context;
}
private static class HashComparator implements Comparator<Hash>, Serializable {
public int compare(Hash l, Hash r) {
return l.toBase64().compareTo(r.toBase64());
}
}
public void renderStatusHTML(Writer out) throws IOException {
StringBuilder buf = new StringBuilder(1024);
// move to the jsp
//buf.append("<h2>Banned Peers</h2>");
Map<Hash, Banlist.Entry> entries = new TreeMap<Hash, Banlist.Entry>(new HashComparator());
entries.putAll(_context.banlist().getEntries());
if (entries.isEmpty()) {
buf.append("<i>").append(_("none")).append("</i>");
out.write(buf.toString());
return;
}
buf.append("<ul>");
for (Map.Entry<Hash, Banlist.Entry> e : entries.entrySet()) {
Hash key = e.getKey();
Banlist.Entry entry = e.getValue();
long expires = entry.expireOn-_context.clock().now();
if (expires <= 0)
continue;
buf.append("<li>").append(_context.commSystem().renderPeerHTML(key));
buf.append(' ');
String expireString = DataHelper.formatDuration2(expires);
if (expires < 5l*24*60*60*1000)
buf.append(_("Temporary ban expiring in {0}", expireString));
else
buf.append(_("Banned until restart or in {0}", expireString));
Set<String> transports = entry.transports;
if ( (transports != null) && (!transports.isEmpty()) )
buf.append(" on the following transport: ").append(transports);
if (entry.cause != null) {
buf.append("<br>\n");
if (entry.causeCode != null)
buf.append(_(entry.cause, entry.causeCode));
else
buf.append(_(entry.cause));
}
buf.append(" (<a href=\"configpeer?peer=").append(key.toBase64())
.append("#unsh\">").append(_("unban now")).append("</a>)");
buf.append("</li>\n");
}
buf.append("</ul>\n");
out.write(buf.toString());
out.flush();
}
/** translate a string */
private String _(String s) {
return Messages.getString(s, _context);
}
/**
* translate a string with a parameter
* This is a lot more expensive than _(s), so use sparingly.
*
* @param s string to be translated containing {0}
* The {0} will be replaced by the parameter.
* Single quotes must be doubled, i.e. ' -> '' in the string.
* @param o parameter, not translated.
* To tranlslate parameter also, use _("foo {0} bar", _("baz"))
* Do not double the single quotes in the parameter.
* Use autoboxing to call with ints, longs, floats, etc.
*/
private String _(String s, Object o) {
return Messages.getString(s, o, _context);
}
}
|
Ashwin-Paudel/Tries
|
OSDev/Try-0/src/kernel/io/pic.h
|
<reponame>Ashwin-Paudel/Tries
//
// pic.h
// KripayaOS
//
#ifndef pic_h
#define pic_h
#include <libkern/stdint.h>
#define MASTER_PIC_CMD 0x0020
#define MASTER_PIC_DATA 0x0021
#define SLAVE_PIC_CMD 0x00A0
#define SLAVE_PIC_DATA 0x00A1
#define ICW4_8086 0x01
void pic_remap(uint32_t offset1, uint32_t offset2);
#endif /* pic_h */
|
AllaMaevskaya/AliRoot
|
MUON/MUONbase/AliMUONTOTCAStoreIterator.cxx
|
/**************************************************************************
* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
* *
* Author: The ALICE Off-line Project. *
* Contributors are mentioned in the code where appropriate. *
* *
* Permission to use, copy, modify and distribute this software and its *
* documentation strictly for non-commercial purposes is hereby granted *
* without fee, provided that the above copyright notice appears in all *
* copies and that both the copyright notice and this permission notice *
* appear in the supporting documentation. The authors make no claims *
* about the suitability of this software for any purpose. It is *
* provided "as is" without express or implied warranty. *
**************************************************************************/
// $Id$
//-----------------------------------------------------------------------------
/// \class AliMUONTOTCAStoreIterator
///
/// An iterator to access TObject stored in a TObjArray of TClonesArray
///
/// \author <NAME>, Subatech
//-----------------------------------------------------------------------------
#include "AliMUONTOTCAStoreIterator.h"
#include "AliLog.h"
#include <TClonesArray.h>
#include <TObjArray.h>
/// \cond CLASSIMP
ClassImp(AliMUONTOTCAStoreIterator)
/// \endcond
//_____________________________________________________________________________
AliMUONTOTCAStoreIterator::AliMUONTOTCAStoreIterator(const TObjArray* data,
Int_t firstChamberId,
Int_t lastChamberId)
:
TIterator(),
fkData(data),
fFirstChamberId(firstChamberId),
fLastChamberId(lastChamberId),
fCurrentTCA(0x0),
fCurrentTCAIndex(-1),
fCurrentChamberId(-1)
{
/// Standard constructor
Reset();
}
//_____________________________________________________________________________
AliMUONTOTCAStoreIterator&
AliMUONTOTCAStoreIterator::operator=(const TIterator& rhs)
{
/// Overriden operator= (imposed by Root's declaration of TIterator ?)
if ( this != &rhs )
{
if ( rhs.IsA() != AliMUONTOTCAStoreIterator::Class() )
{
AliErrorGeneral("AliMUONTOTCAStoreIterator::operator=","Wrong type");
}
else
{
const AliMUONTOTCAStoreIterator& rhs1 =
static_cast<const AliMUONTOTCAStoreIterator&>(rhs);
rhs1.CopyTo(*this);
}
}
return *this;
}
//_____________________________________________________________________________
AliMUONTOTCAStoreIterator::AliMUONTOTCAStoreIterator(const AliMUONTOTCAStoreIterator& rhs)
:
TIterator(rhs),
fkData(0x0),
fFirstChamberId(-1),
fLastChamberId(-1),
fCurrentTCA(0x0),
fCurrentTCAIndex(-1),
fCurrentChamberId(-1)
{
/// Copy constructor
rhs.CopyTo(*this);
}
//_____________________________________________________________________________
AliMUONTOTCAStoreIterator::~AliMUONTOTCAStoreIterator()
{
/// Destructor
}
//_____________________________________________________________________________
AliMUONTOTCAStoreIterator&
AliMUONTOTCAStoreIterator::operator=(const AliMUONTOTCAStoreIterator& rhs)
{
/// Assignment operator
rhs.CopyTo(*this);
return *this;
}
//_____________________________________________________________________________
void
AliMUONTOTCAStoreIterator::CopyTo(AliMUONTOTCAStoreIterator& destination) const
{
/// Copy *this to destination
destination.fkData=fkData;
destination.fFirstChamberId=fFirstChamberId;
destination.fLastChamberId=fLastChamberId;
destination.fCurrentTCAIndex=fCurrentTCAIndex;
destination.fCurrentChamberId=fCurrentChamberId;
destination.fCurrentTCA=fCurrentTCA;
}
//_____________________________________________________________________________
const TCollection*
AliMUONTOTCAStoreIterator::GetCollection() const
{
/// The top level collection we're iterating upon, i.e. a TObjArray
return fkData;
}
//_____________________________________________________________________________
TObject*
AliMUONTOTCAStoreIterator::Next()
{
/// Find and return next element in the store
if ( fCurrentTCA && fCurrentTCAIndex < fCurrentTCA->GetLast() )
{
++fCurrentTCAIndex;
}
else
{
fCurrentTCAIndex = 0;
fCurrentTCA = 0;
while ( ( !fCurrentTCA || fCurrentTCA->GetLast()==-1 ) &&
fCurrentChamberId < fLastChamberId )
{
++fCurrentChamberId;
fCurrentTCA = static_cast<TClonesArray*>(fkData->At(fCurrentChamberId));
}
}
if ( fCurrentTCA )
{
// get the pointer to be returned
return fCurrentTCA->At(fCurrentTCAIndex);
}
return 0x0;
}
//_____________________________________________________________________________
void
AliMUONTOTCAStoreIterator::Reset()
{
/// Reset the iterator
fCurrentTCAIndex = -1;
fCurrentChamberId = fFirstChamberId-1;
fCurrentTCA = 0x0;
}
|
daodao10/chart
|
sg/J36_d.js
|
var data=[['19950103',7.0000],
['19950104',7.5500],
['19950105',8.0500],
['19950106',7.8000],
['19950109',7.4500],
['19950110',7.6500],
['19950111',7.5500],
['19950112',7.4000],
['19950113',7.4500],
['19950116',7.9000],
['19950117',8.1500],
['19950118',7.9000],
['19950119',7.5500],
['19950120',7.4500],
['19950123',6.9000],
['19950124',6.6500],
['19950125',6.9500],
['19950126',7.0000],
['19950127',7.1000],
['19950130',7.1000],
['19950202',7.5000],
['19950203',7.6000],
['19950206',8.1000],
['19950207',8.2500],
['19950208',8.1500],
['19950209',8.0500],
['19950210',8.1000],
['19950213',8.3500],
['19950214',8.2000],
['19950215',8.4500],
['19950216',8.5500],
['19950217',8.4500],
['19950220',8.3000],
['19950221',8.4500],
['19950222',8.3000],
['19950223',8.5500],
['19950224',8.7500],
['19950227',8.6000],
['19950228',9.2000],
['19950301',8.7500],
['19950302',8.6000],
['19950306',8.5500],
['19950307',8.5500],
['19950308',8.2500],
['19950309',8.5500],
['19950310',8.8000],
['19950313',8.7000],
['19950314',8.4000],
['19950315',8.7500],
['19950316',8.7500],
['19950317',9.0500],
['19950320',9.0000],
['19950321',9.0000],
['19950322',8.6000],
['19950323',8.8000],
['19950324',8.7000],
['19950327',9.0000],
['19950328',8.9500],
['19950329',9.0000],
['19950330',9.0500],
['19950331',9.0000],
['19950403',8.3500],
['19950404',8.5000],
['19950405',8.4000],
['19950406',8.4000],
['19950407',8.3000],
['19950410',8.3500],
['19950411',8.4000],
['19950412',8.3500],
['19950413',8.4500],
['19950417',8.5000],
['19950418',8.5000],
['19950419',8.5000],
['19950420',8.8000],
['19950421',8.4000],
['19950424',8.6500],
['19950425',8.6000],
['19950426',8.3500],
['19950427',7.9500],
['19950428',7.9500],
['19950502',7.8500],
['19950503',7.9500],
['19950504',8.2000],
['19950505',8.0500],
['19950508',8.0500],
['19950509',8.0500],
['19950511',8.2500],
['19950512',8.4500],
['19950516',8.2500],
['19950517',8.2500],
['19950518',8.1500],
['19950519',7.9500],
['19950522',7.9500],
['19950523',7.9000],
['19950524',8.0500],
['19950525',7.9000],
['19950526',7.9500],
['19950529',7.7500],
['19950530',7.7000],
['19950531',7.8500],
['19950601',8.0000],
['19950602',8.3000],
['19950605',8.3500],
['19950606',8.3000],
['19950607',8.0000],
['19950608',7.8000],
['19950609',7.8500],
['19950612',7.7500],
['19950613',7.5500],
['19950614',7.7500],
['19950615',7.8500],
['19950616',7.8500],
['19950619',7.9000],
['19950620',7.6500],
['19950621',7.6000],
['19950622',7.6000],
['19950623',7.6000],
['19950626',7.6500],
['19950627',7.7500],
['19950628',7.5000],
['19950629',7.5000],
['19950630',7.3500],
['19950703',7.2500],
['19950704',7.3000],
['19950705',7.5500],
['19950706',7.2500],
['19950707',7.6000],
['19950710',7.4500],
['19950711',7.2500],
['19950712',7.5000],
['19950713',8.0000],
['19950714',8.0000],
['19950717',7.8000],
['19950718',7.7500],
['19950719',7.7000],
['19950720',7.5500],
['19950721',7.5000],
['19950724',7.6500],
['19950725',7.5000],
['19950726',7.5500],
['19950727',7.5000],
['19950728',7.4500],
['19950731',7.5000],
['19950801',7.4500],
['19950802',7.4500],
['19950803',7.4500],
['19950804',7.5000],
['19950807',7.7000],
['19950808',7.6000],
['19950810',7.4000],
['19950811',7.3000],
['19950814',7.2500],
['19950815',7.1000],
['19950816',7.1500],
['19950817',7.1000],
['19950818',7.1500],
['19950821',7.1500],
['19950822',7.2000],
['19950823',7.1500],
['19950824',7.0500],
['19950825',6.9000],
['19950828',7.0500],
['19950829',6.9500],
['19950830',7.1000],
['19950831',7.2000],
['19950901',7.5000],
['19950904',7.4000],
['19950905',7.4500],
['19950906',7.4000],
['19950907',7.5500],
['19950908',7.4000],
['19950911',7.4500],
['19950912',7.5500],
['19950913',7.3500],
['19950914',7.1500],
['19950915',7.3000],
['19950918',7.8000],
['19950919',7.7000],
['19950920',7.4000],
['19950921',7.3000],
['19950922',7.4000],
['19950925',7.1000],
['19950926',7.0500],
['19950927',6.8500],
['19950928',6.7000],
['19950929',6.7500],
['19951002',6.6500],
['19951003',6.7000],
['19951004',6.9000],
['19951005',6.9500],
['19951006',6.8500],
['19951009',7.0000],
['19951010',6.8500],
['19951011',6.8500],
['19951012',6.8500],
['19951013',6.9000],
['19951016',7.0500],
['19951017',7.0000],
['19951018',7.0000],
['19951019',6.9500],
['19951020',6.6500],
['19951024',6.2000],
['19951025',6.2500],
['19951026',6.2500],
['19951027',5.9500],
['19951030',5.9500],
['19951031',6.1000],
['19951101',6.2000],
['19951102',6.0500],
['19951103',6.0000],
['19951106',6.0000],
['19951107',6.0000],
['19951108',5.9500],
['19951109',5.9500],
['19951110',5.8000],
['19951113',5.7500],
['19951114',5.6500],
['19951115',5.5500],
['19951116',5.3000],
['19951117',5.8000],
['19951120',5.7000],
['19951121',5.7500],
['19951122',5.4500],
['19951123',5.6500],
['19951124',5.7000],
['19951127',5.6000],
['19951128',5.8500],
['19951129',5.8500],
['19951130',6.0500],
['19951201',6.2000],
['19951204',6.6000],
['19951205',6.6500],
['19951206',6.5500],
['19951207',6.5000],
['19951208',6.5000],
['19951211',6.6000],
['19951212',6.5000],
['19951213',6.6500],
['19951214',6.6000],
['19951215',6.5000],
['19951218',6.6500],
['19951219',6.6000],
['19951220',6.6500],
['19951221',6.7000],
['19951222',6.6000],
['19951226',6.8000],
['19951227',6.9000],
['19951228',6.9000],
['19951229',6.8500],
['19960102',6.9000],
['19960103',7.0500],
['19960104',7.1500],
['19960105',7.4500],
['19960108',7.5500],
['19960109',7.2500],
['19960110',7.3000],
['19960111',7.4000],
['19960112',7.5500],
['19960115',7.7500],
['19960116',7.6500],
['19960117',7.7500],
['19960118',7.7000],
['19960119',7.7500],
['19960122',8.1000],
['19960123',8.3500],
['19960124',8.3000],
['19960125',8.4500],
['19960126',8.4000],
['19960129',8.1000],
['19960130',8.4500],
['19960131',8.4500],
['19960201',8.1500],
['19960202',8.2000],
['19960205',8.2500],
['19960206',8.3500],
['19960207',8.3500],
['19960208',8.5000],
['19960209',8.4000],
['19960212',8.3500],
['19960213',8.4500],
['19960214',8.2000],
['19960215',8.2000],
['19960216',8.3500],
['19960222',7.8000],
['19960223',8.2000],
['19960226',8.3000],
['19960227',8.1500],
['19960228',8.1500],
['19960229',8.0000],
['19960301',7.9000],
['19960304',8.1500],
['19960305',8.2500],
['19960306',8.2500],
['19960307',8.1500],
['19960308',8.1500],
['19960311',7.5000],
['19960312',7.8000],
['19960313',7.4500],
['19960314',7.7000],
['19960315',7.7000],
['19960318',7.7500],
['19960319',7.6500],
['19960320',7.5000],
['19960321',8.0000],
['19960322',8.0500],
['19960325',8.2500],
['19960326',7.9500],
['19960327',7.9000],
['19960328',7.8000],
['19960329',7.8000],
['19960401',7.8000],
['19960402',8.0000],
['19960403',7.8000],
['19960404',7.9000],
['19960408',7.6500],
['19960409',7.9500],
['19960410',8.1000],
['19960411',8.1000],
['19960412',8.0000],
['19960415',7.8000],
['19960416',7.8500],
['19960417',7.9000],
['19960418',8.0500],
['19960419',8.0500],
['19960422',7.9500],
['19960423',7.8000],
['19960424',7.7500],
['19960425',7.9000],
['19960426',7.8000],
['19960430',8.0000],
['19960502',7.9000],
['19960503',8.1000],
['19960506',8.0000],
['19960507',8.1000],
['19960508',8.2000],
['19960509',8.3000],
['19960510',8.1000],
['19960513',8.1000],
['19960514',7.9500],
['19960515',8.1000],
['19960516',8.0500],
['19960517',8.0000],
['19960520',8.0000],
['19960521',8.1500],
['19960522',8.0000],
['19960523',7.9000],
['19960524',8.0500],
['19960527',8.1000],
['19960528',8.0500],
['19960529',7.8000],
['19960530',7.7000],
['19960603',7.6000],
['19960604',7.7000],
['19960605',7.6000],
['19960606',7.3000],
['19960607',7.2500],
['19960610',7.3500],
['19960611',7.1000],
['19960612',7.0000],
['19960613',6.6500],
['19960614',7.1500],
['19960617',7.1000],
['19960618',7.1500],
['19960619',7.0500],
['19960620',7.1000],
['19960621',7.0500],
['19960624',6.9500],
['19960625',6.8500],
['19960626',6.9000],
['19960627',7.0000],
['19960628',7.3500],
['19960701',7.3500],
['19960702',7.3500],
['19960703',7.0500],
['19960704',7.1000],
['19960705',7.0000],
['19960708',6.9000],
['19960709',6.9500],
['19960710',7.0000],
['19960711',7.0500],
['19960712',6.9500],
['19960715',6.8000],
['19960716',6.8500],
['19960717',6.8500],
['19960718',6.6500],
['19960719',6.7000],
['19960722',6.4500],
['19960723',6.1000],
['19960724',6.1000],
['19960725',6.1000],
['19960726',6.3000],
['19960729',6.3000],
['19960730',6.2500],
['19960731',6.0500],
['19960801',6.3000],
['19960802',6.5500],
['19960805',6.5500],
['19960806',6.5000],
['19960807',6.4500],
['19960808',6.4000],
['19960812',6.6500],
['19960813',6.6000],
['19960814',6.5500],
['19960815',6.5000],
['19960816',6.6500],
['19960819',6.3000],
['19960820',6.5500],
['19960821',6.3500],
['19960822',6.5000],
['19960823',6.5500],
['19960826',6.5000],
['19960827',6.5000],
['19960828',6.4500],
['19960829',6.5000],
['19960830',6.3000],
['19960902',6.1500],
['19960903',6.1500],
['19960904',6.4000],
['19960905',6.5500],
['19960906',6.4000],
['19960909',6.5000],
['19960910',6.6000],
['19960911',6.6000],
['19960912',6.5500],
['19960913',6.7500],
['19960916',6.7500],
['19960917',6.6500],
['19960918',6.7500],
['19960919',6.7000],
['19960920',6.6000],
['19960923',6.6000],
['19960924',6.5500],
['19960925',6.4500],
['19960926',6.4000],
['19960927',6.1500],
['19960930',6.2500],
['19961001',5.9000],
['19961002',5.7500],
['19961003',5.9000],
['19961004',5.9000],
['19961007',5.8000],
['19961008',5.7500],
['19961009',5.7500],
['19961010',5.8500],
['19961011',5.9000],
['19961014',5.8500],
['19961015',5.8000],
['19961016',5.7500],
['19961017',5.6000],
['19961018',5.7000],
['19961021',5.6500],
['19961022',5.6500],
['19961023',5.6000],
['19961024',5.8000],
['19961025',5.6000],
['19961028',5.6000],
['19961029',5.6000],
['19961030',5.6500],
['19961031',5.6500],
['19961101',5.6000],
['19961104',5.6500],
['19961105',5.7500],
['19961106',5.7500],
['19961107',5.8000],
['19961108',5.7500],
['19961112',5.7000],
['19961113',5.7000],
['19961114',5.7000],
['19961115',5.7500],
['19961118',5.9000],
['19961119',6.0000],
['19961120',6.1000],
['19961121',6.2500],
['19961122',6.6000],
['19961125',6.4500],
['19961126',6.7000],
['19961127',6.8000],
['19961128',6.8000],
['19961129',6.6000],
['19961202',6.7000],
['19961203',6.8000],
['19961204',6.8000],
['19961205',6.9000],
['19961206',6.7000],
['19961209',6.5500],
['19961210',6.6500],
['19961211',6.6500],
['19961212',6.5500],
['19961213',6.5500],
['19961216',6.4500],
['19961217',6.4500],
['19961218',6.4000],
['19961219',6.4000],
['19961220',6.3500],
['19961223',6.5000],
['19961224',6.5500],
['19961226',6.5500],
['19961227',6.5000],
['19961230',6.5000],
['19961231',6.6000],
['19970103',6.5500],
['19970106',6.7000],
['19970107',6.6500],
['19970108',6.7000],
['19970109',6.6500],
['19970110',6.5500],
['19970113',6.4500],
['19970114',6.3500],
['19970115',6.4000],
['19970116',6.1500],
['19970117',6.2000],
['19970120',6.1500],
['19970121',6.2000],
['19970122',6.0500],
['19970123',6.0500],
['19970124',6.2000],
['19970127',6.0500],
['19970128',5.9500],
['19970129',6.1000],
['19970130',6.0500],
['19970131',5.8500],
['19970203',6.0500],
['19970204',6.1000],
['19970205',6.0500],
['19970206',6.3000],
['19970211',6.1500],
['19970212',6.2000],
['19970213',6.0000],
['19970214',5.9000],
['19970217',6.0500],
['19970218',6.0500],
['19970219',5.9500],
['19970220',6.0000],
['19970221',6.0500],
['19970224',6.0500],
['19970225',6.1000],
['19970226',6.1000],
['19970227',6.0500],
['19970228',6.0500],
['19970303',6.1500],
['19970304',6.1500],
['19970305',6.0500],
['19970306',6.1000],
['19970307',6.1000],
['19970310',5.9000],
['19970311',6.1000],
['19970312',6.1000],
['19970313',5.9000],
['19970314',5.8500],
['19970317',5.9000],
['19970318',5.8000],
['19970319',5.8000],
['19970320',5.8000],
['19970321',5.8000],
['19970324',5.7500],
['19970325',5.7500],
['19970326',5.9000],
['19970327',5.9500],
['19970331',5.8000],
['19970401',5.9000],
['19970402',5.8500],
['19970403',6.0000],
['19970404',5.8500],
['19970407',5.6000],
['19970408',5.6500],
['19970409',5.6500],
['19970410',5.5500],
['19970411',5.5500],
['19970414',5.5000],
['19970415',5.4000],
['19970416',5.5000],
['19970417',5.5000],
['19970421',5.5500],
['19970422',5.7500],
['19970423',5.7000],
['19970424',5.6500],
['19970425',5.4000],
['19970428',5.3000],
['19970429',5.5000],
['19970430',5.5000],
['19970502',5.4500],
['19970505',5.4500],
['19970506',5.6000],
['19970507',5.7500],
['19970508',6.1000],
['19970509',6.7000],
['19970512',6.4500],
['19970513',6.3000],
['19970514',6.5500],
['19970515',6.4000],
['19970516',6.3000],
['19970519',6.3500],
['19970520',6.6500],
['19970522',6.9500],
['19970523',6.8500],
['19970526',6.8500],
['19970527',6.9500],
['19970528',6.9000],
['19970529',6.7500],
['19970530',6.8000],
['19970602',6.8500],
['19970603',6.8000],
['19970604',7.0500],
['19970605',7.3500],
['19970606',8.3000],
['19970609',8.0500],
['19970610',7.2500],
['19970611',7.3000],
['19970612',7.1500],
['19970613',7.4500],
['19970616',7.4500],
['19970617',7.4000],
['19970618',7.6000],
['19970619',7.8000],
['19970620',7.9500],
['19970623',7.7000],
['19970624',7.5000],
['19970625',7.4000],
['19970626',7.4000],
['19970627',7.3500],
['19970630',7.1000],
['19970701',7.2000],
['19970702',7.4000],
['19970703',7.6500],
['19970704',7.3500],
['19970707',7.2500],
['19970708',7.2500],
['19970709',7.1500],
['19970710',7.2000],
['19970711',7.1000],
['19970714',7.1500],
['19970715',7.2000],
['19970716',7.1000],
['19970717',7.1000],
['19970718',6.9500],
['19970721',7.0000],
['19970722',6.9500],
['19970723',6.8000],
['19970724',6.7500],
['19970725',6.7500],
['19970728',6.7000],
['19970729',6.7000],
['19970730',6.7500],
['19970731',6.9000],
['19970801',7.1000],
['19970804',7.0500],
['19970805',7.8500],
['19970806',8.2500],
['19970807',8.1000],
['19970808',7.9500],
['19970811',7.8500],
['19970812',8.0000],
['19970813',7.8500],
['19970814',7.8000],
['19970815',7.6500],
['19970818',6.7500],
['19970819',6.9500],
['19970820',7.6000],
['19970821',7.7500],
['19970822',7.6500],
['19970825',7.3500],
['19970826',7.1500],
['19970827',7.4500],
['19970828',7.3500],
['19970829',7.0000],
['19970901',6.6000],
['19970902',7.5000],
['19970903',7.9000],
['19970904',7.7000],
['19970905',7.9500],
['19970908',7.9000],
['19970909',7.9000],
['19970910',7.9500],
['19970911',7.8000],
['19970912',7.8000],
['19970915',7.9500],
['19970916',8.1500],
['19970917',8.3000],
['19970918',8.2000],
['19970919',8.0500],
['19970922',7.7500],
['19970923',7.4500],
['19970924',7.5500],
['19970925',7.7000],
['19970926',7.9500],
['19970929',7.8000],
['19970930',8.1000],
['19971001',8.1000],
['19971002',8.1000],
['19971003',8.2000],
['19971006',8.0000],
['19971007',7.8000],
['19971008',7.8500],
['19971009',7.8000],
['19971010',7.8000],
['19971013',7.9000],
['19971014',7.8500],
['19971015',7.2500],
['19971016',7.3000],
['19971017',7.4000],
['19971020',7.0000],
['19971021',6.2500],
['19971022',5.7000],
['19971023',5.7000],
['19971024',5.8000],
['19971027',6.0000],
['19971028',5.5500],
['19971029',6.2500],
['19971031',6.4000],
['19971103',7.0000],
['19971104',6.3000],
['19971105',6.9000],
['19971106',6.5500],
['19971107',5.9500],
['19971110',6.0000],
['19971111',6.0500],
['19971112',5.8000],
['19971113',5.6500],
['19971114',5.6500],
['19971117',5.6500],
['19971118',5.4500],
['19971119',5.2000],
['19971120',5.1500],
['19971121',5.4000],
['19971124',5.4000],
['19971125',5.3000],
['19971126',5.3500],
['19971127',5.4500],
['19971128',5.3000],
['19971201',5.2500],
['19971202',5.4000],
['19971203',5.5000],
['19971204',5.4500],
['19971205',5.4500],
['19971208',5.1500],
['19971209',4.9800],
['19971210',4.8200],
['19971211',4.4000],
['19971212',4.5600],
['19971215',4.6000],
['19971216',4.2200],
['19971217',4.4000],
['19971218',4.4600],
['19971219',4.4000],
['19971222',4.6200],
['19971223',4.8000],
['19971224',4.7000],
['19971226',4.6800],
['19971229',4.7800],
['19971230',5.0000],
['19971231',5.1000],
['19980102',5.0500],
['19980105',5.3000],
['19980106',5.5000],
['19980107',5.4000],
['19980108',4.7600],
['19980109',4.2800],
['19980112',4.2000],
['19980113',4.1400],
['19980114',4.2000],
['19980115',3.7200],
['19980116',4.1000],
['19980119',4.5200],
['19980120',4.4800],
['19980121',4.4600],
['19980122',4.2000],
['19980123',4.1000],
['19980126',4.2000],
['19980127',4.1800],
['19980202',5.1500],
['19980203',4.9800],
['19980204',4.6800],
['19980205',4.6000],
['19980206',4.9000],
['19980209',5.0000],
['19980210',4.8600],
['19980211',4.9200],
['19980212',4.9000],
['19980213',4.6600],
['19980216',4.6400],
['19980217',4.6800],
['19980218',4.7200],
['19980219',4.7000],
['19980220',4.7000],
['19980223',4.6000],
['19980224',4.7000],
['19980225',4.6600],
['19980226',4.7000],
['19980227',4.6800],
['19980302',4.6000],
['19980303',4.6000],
['19980304',4.7000],
['19980305',4.6000],
['19980306',4.5800],
['19980309',4.5000],
['19980310',4.5400],
['19980311',4.5400],
['19980312',4.6000],
['19980313',4.6000],
['19980316',4.5000],
['19980317',4.9000],
['19980318',4.8800],
['19980319',4.7400],
['19980320',4.6600],
['19980323',4.4600],
['19980324',4.4200],
['19980325',4.4400],
['19980326',4.5000],
['19980327',4.6400],
['19980330',4.5200],
['19980331',4.5400],
['19980401',4.5000],
['19980402',4.4800],
['19980403',4.2600],
['19980406',4.2400],
['19980408',4.2000],
['19980409',4.2000],
['19980413',4.2000],
['19980414',4.2200],
['19980415',4.2800],
['19980416',4.2000],
['19980417',4.2000],
['19980420',4.2200],
['19980421',4.2400],
['19980422',4.2400],
['19980423',4.2600],
['19980424',4.2800],
['19980427',4.2600],
['19980428',4.3000],
['19980429',4.2400],
['19980430',4.2200],
['19980504',4.2600],
['19980505',4.2200],
['19980506',4.0000],
['19980507',4.0800],
['19980508',4.0000],
['19980512',4.0000],
['19980513',3.9200],
['19980514',3.9400],
['19980515',3.9200],
['19980518',3.8600],
['19980519',3.6600],
['19980520',3.4600],
['19980521',3.3800],
['19980522',3.3400],
['19980525',3.3000],
['19980526',3.3400],
['19980527',3.1200],
['19980528',2.9600],
['19980529',3.0400],
['19980601',2.9900],
['19980602',2.9700],
['19980603',2.9700],
['19980604',2.9500],
['19980605',2.9000],
['19980608',2.9200],
['19980609',2.9200],
['19980610',2.8400],
['19980611',2.7800],
['19980612',2.7500],
['19980615',2.8100],
['19980616',2.6900],
['19980617',2.8500],
['19980618',2.9300],
['19980619',2.8600],
['19980622',2.6800],
['19980623',2.6400],
['19980624',2.6300],
['19980625',2.5800],
['19980626',2.6600],
['19980629',2.8000],
['19980630',2.7000],
['19980701',2.7400],
['19980702',3.0000],
['19980703',2.7400],
['19980706',2.7300],
['19980707',2.6900],
['19980708',2.7100],
['19980709',2.7100],
['19980710',2.6000],
['19980713',2.5400],
['19980714',2.5400],
['19980715',2.5400],
['19980716',2.5400],
['19980717',2.5900],
['19980720',2.6200],
['19980721',2.6000],
['19980722',2.5500],
['19980723',2.5400],
['19980724',2.5400],
['19980727',2.5500],
['19980728',2.5400],
['19980729',2.5100],
['19980730',2.5100],
['19980731',2.5100],
['19980803',2.4500],
['19980804',2.4500],
['19980805',2.4000],
['19980806',2.3800],
['19980807',2.3900],
['19980811',2.3400],
['19980812',2.2000],
['19980813',2.0400],
['19980814',2.0200],
['19980817',1.9400],
['19980818',2.0800],
['19980819',2.1000],
['19980820',2.0900],
['19980821',2.0400],
['19980824',1.9900],
['19980825',1.8500],
['19980826',1.8700],
['19980827',1.8000],
['19980828',1.6600],
['19980831',1.7800],
['19980901',1.5700],
['19980902',1.7500],
['19980903',1.7000],
['19980904',1.6900],
['19980907',1.8800],
['19980908',2.0400],
['19980909',2.0700],
['19980910',2.0000],
['19980911',1.9800],
['19980914',1.9900],
['19980915',2.1400],
['19980916',2.2600],
['19980917',2.2700],
['19980918',2.1000],
['19980921',2.0200],
['19980922',1.9900],
['19980923',1.9900],
['19980924',2.0300],
['19980925',1.9700],
['19980928',2.0000],
['19980929',1.9600],
['19980930',2.0500],
['19981001',1.9800],
['19981002',1.9500],
['19981005',1.9000],
['19981006',1.9600],
['19981007',2.0000],
['19981008',2.0900],
['19981009',2.1400],
['19981012',2.2400],
['19981013',2.4100],
['19981014',2.2500],
['19981015',2.3400],
['19981016',2.7800],
['19981020',2.6600],
['19981021',2.6800],
['19981022',2.5800],
['19981023',2.5200],
['19981026',2.5000],
['19981027',2.5500],
['19981028',2.6200],
['19981029',2.6200],
['19981030',2.8000],
['19981102',3.3600],
['19981103',3.2600],
['19981104',3.3000],
['19981105',3.2800],
['19981106',3.2800],
['19981109',2.9300],
['19981110',2.7800],
['19981111',2.9400],
['19981112',2.9000],
['19981113',3.0000],
['19981116',3.1000],
['19981117',3.0800],
['19981118',3.1400],
['19981119',3.3000],
['19981120',3.4000],
['19981123',3.7400],
['19981124',3.7000],
['19981125',3.5000],
['19981126',3.5200],
['19981127',3.4400],
['19981130',3.4000],
['19981201',3.3400],
['19981202',3.3400],
['19981203',3.0000],
['19981204',3.1400],
['19981207',3.1400],
['19981208',3.0000],
['19981209',2.8900],
['19981210',2.9000],
['19981211',2.7500],
['19981214',2.7300],
['19981215',2.7800],
['19981216',2.7700],
['19981217',2.7200],
['19981218',2.7700],
['19981221',2.8000],
['19981222',2.7900],
['19981223',2.6800],
['19981224',2.6100],
['19981228',2.5200],
['19981229',2.5000],
['19981230',2.5300],
['19981231',2.5800],
['19990104',2.5100],
['19990105',2.6100],
['19990106',3.1000],
['19990107',3.5800],
['19990108',3.4200],
['19990111',3.3200],
['19990112',3.2400],
['19990113',3.2200],
['19990114',3.0400],
['19990115',2.9900],
['19990118',3.1400],
['19990120',3.0400],
['19990121',3.0000],
['19990122',3.0000],
['19990125',2.9100],
['19990126',2.8200],
['19990127',2.8000],
['19990128',2.7000],
['19990129',2.6600],
['19990201',2.5600],
['19990202',2.5900],
['19990203',2.6100],
['19990204',2.6000],
['19990205',2.6600],
['19990208',2.6700],
['19990209',2.5700],
['19990210',2.5000],
['19990211',2.5400],
['19990212',2.7200],
['19990215',2.6600],
['19990218',2.7000],
['19990219',2.7700],
['19990222',2.7300],
['19990223',2.8000],
['19990224',2.7900],
['19990225',2.6800],
['19990226',2.6200],
['19990301',2.5900],
['19990302',2.5800],
['19990303',2.5800],
['19990304',2.7000],
['19990305',2.8000],
['19990308',2.9200],
['19990309',2.9100],
['19990310',2.9200],
['19990311',3.0400],
['19990312',3.2000],
['19990315',3.2000],
['19990316',3.1800],
['19990317',3.2600],
['19990318',3.3400],
['19990319',3.3400],
['19990322',3.6600],
['19990323',3.6000],
['19990324',3.4200],
['19990325',3.4600],
['19990326',3.2800],
['19990330',3.2200],
['19990331',3.0200],
['19990401',3.0400],
['19990405',3.1200],
['19990406',3.2800],
['19990407',3.1400],
['19990408',3.1400],
['19990409',3.0600],
['19990412',3.0400],
['19990413',3.1000],
['19990414',3.2000],
['19990415',3.1200],
['19990416',3.2600],
['19990419',3.6400],
['19990420',3.6600],
['19990421',3.9200],
['19990422',4.0000],
['19990423',4.1600],
['19990426',4.2000],
['19990427',4.1600],
['19990428',4.2600],
['19990429',4.2000],
['19990430',4.2600],
['19990503',4.3000],
['19990504',4.5000],
['19990505',4.5800],
['19990506',4.9000],
['19990507',4.5000],
['19990510',4.4400],
['19990511',4.4600],
['19990512',4.5600],
['19990513',4.4000],
['19990514',4.3600],
['19990517',4.2800],
['19990518',4.4000],
['19990519',4.2400],
['19990520',4.2600],
['19990521',4.4600],
['19990524',4.5200],
['19990525',4.5200],
['19990526',4.4600],
['19990527',4.4200],
['19990528',4.2800],
['19990531',4.1200],
['19990601',4.1400],
['19990602',4.1800],
['19990603',4.3600],
['19990604',4.3800],
['19990607',4.3600],
['19990608',4.4000],
['19990609',4.3600],
['19990610',4.3400],
['19990611',4.4200],
['19990614',4.4200],
['19990615',4.4400],
['19990616',4.4200],
['19990617',4.4200],
['19990618',4.4200],
['19990621',4.5400],
['19990622',4.6400],
['19990623',4.7200],
['19990624',5.5000],
['19990625',5.1000],
['19990628',4.9600],
['19990629',5.0500],
['19990630',5.0000],
['19990701',5.2000],
['19990702',5.4500],
['19990705',5.2000],
['19990706',5.2000],
['19990707',5.0000],
['19990708',5.2000],
['19990709',5.7000],
['19990712',5.8000],
['19990713',5.7500],
['19990714',5.8500],
['19990715',5.8000],
['19990716',5.4000],
['19990719',5.1000],
['19990720',5.1500],
['19990721',5.1000],
['19990722',5.1000],
['19990723',5.0500],
['19990726',4.9800],
['19990727',5.0500],
['19990728',5.0500],
['19990729',5.2500],
['19990730',5.1500],
['19990802',5.1500],
['19990803',5.2000],
['19990804',5.1000],
['19990805',5.0000],
['19990806',5.1000],
['19990810',5.0000],
['19990811',4.7200],
['19990812',4.5800],
['19990813',4.5800],
['19990816',4.8200],
['19990817',4.6800],
['19990818',4.8000],
['19990819',4.7000],
['19990820',4.6000],
['19990823',4.7000],
['19990824',4.8000],
['19990825',4.9000],
['19990826',4.9000],
['19990827',4.8600],
['19990830',4.9200],
['19990831',4.7800],
['19990901',4.7400],
['19990902',4.8000],
['19990903',4.6200],
['19990906',4.4000],
['19990907',4.3200],
['19990908',4.3800],
['19990909',4.4000],
['19990910',4.4400],
['19990913',4.4200],
['19990914',4.3400],
['19990915',4.3200],
['19990916',4.3600],
['19990917',4.3600],
['19990920',4.3200],
['19990921',4.4400],
['19990922',4.3000],
['19990923',4.3200],
['19990924',4.2400],
['19990927',4.0000],
['19990928',4.0600],
['19990929',4.0600],
['19990930',4.1000],
['19991001',4.3800],
['19991004',4.3800],
['19991005',4.5800],
['19991006',4.5000],
['19991007',4.5400],
['19991008',4.5200],
['19991011',4.5000],
['19991012',4.5000],
['19991013',4.4800],
['19991014',4.6000],
['19991015',4.4000],
['19991018',4.2400],
['19991019',4.2400],
['19991020',4.3600],
['19991021',4.3000],
['19991022',4.3000],
['19991025',4.3000],
['19991026',4.3200],
['19991027',4.3200],
['19991028',4.3200],
['19991029',4.3000],
['19991101',4.2800],
['19991102',4.3000],
['19991103',4.2800],
['19991104',4.2800],
['19991105',4.3400],
['19991109',4.3400],
['19991110',4.3200],
['19991111',4.3000],
['19991112',4.2400],
['19991115',4.3000],
['19991116',4.2800],
['19991117',4.3000],
['19991118',4.3200],
['19991119',4.3200],
['19991122',4.3200],
['19991123',4.3800],
['19991124',4.3600],
['19991125',4.3600],
['19991126',4.3600],
['19991129',4.2800],
['19991130',4.4400],
['19991201',4.3000],
['19991202',4.3000],
['19991203',4.3000],
['19991206',4.3000],
['19991207',4.2000],
['19991208',4.1800],
['19991209',4.1800],
['19991210',4.2200],
['19991213',4.2000],
['19991214',4.1200],
['19991215',4.2200],
['19991216',4.1600],
['19991217',4.1200],
['19991220',3.9800],
['19991221',3.9400],
['19991222',3.9200],
['19991223',3.8200],
['19991224',3.8000],
['19991227',3.9200],
['19991228',3.8400],
['19991229',3.9000],
['19991230',3.9400],
['20000103',3.8200],
['20000104',3.9000],
['20000105',4.0000],
['20000106',4.0800],
['20000107',4.2200],
['20000110',4.2000],
['20000111',4.1000],
['20000112',4.0000],
['20000113',3.9200],
['20000114',4.1000],
['20000117',4.0600],
['20000118',4.0600],
['20000119',4.0000],
['20000120',4.0000],
['20000121',4.0000],
['20000124',4.0400],
['20000125',3.9800],
['20000126',3.9000],
['20000127',3.7800],
['20000128',3.6600],
['20000131',3.6400],
['20000201',3.5800],
['20000202',3.6400],
['20000203',3.6400],
['20000204',3.5400],
['20000208',3.5200],
['20000209',3.5000],
['20000210',3.2600],
['20000211',3.1000],
['20000214',3.2000],
['20000215',3.2600],
['20000216',3.2600],
['20000217',3.2400],
['20000218',3.2000],
['20000221',3.1600],
['20000222',3.1800],
['20000223',3.2000],
['20000224',3.2600],
['20000225',3.3800],
['20000228',3.5000],
['20000229',3.5000],
['20000301',3.6800],
['20000302',3.6400],
['20000303',3.6600],
['20000306',3.6200],
['20000307',3.7000],
['20000308',3.6000],
['20000309',3.5200],
['20000310',3.5000],
['20000313',3.5200],
['20000314',3.6000],
['20000315',3.5600],
['20000317',3.6200],
['20000320',3.6000],
['20000321',3.6000],
['20000322',3.5800],
['20000323',3.7600],
['20000324',3.7400],
['20000327',3.7200],
['20000328',3.8200],
['20000329',3.8600],
['20000330',3.9800],
['20000331',3.8800],
['20000403',3.6600],
['20000404',3.7000],
['20000405',3.7600],
['20000406',3.8600],
['20000407',3.8200],
['20000410',3.8200],
['20000411',3.8400],
['20000412',3.8800],
['20000413',3.9200],
['20000414',3.8200],
['20000417',3.5000],
['20000418',3.6200],
['20000419',3.6800],
['20000420',3.7600],
['20000424',3.7800],
['20000425',3.8400],
['20000426',3.9800],
['20000427',4.0000],
['20000428',4.0000],
['20000502',4.0400],
['20000503',3.9800],
['20000504',3.9000],
['20000505',3.9000],
['20000508',4.0000],
['20000509',4.1600],
['20000510',4.2200],
['20000511',4.2200],
['20000512',4.4800],
['20000515',4.6000],
['20000516',4.6200],
['20000517',4.5600],
['20000519',4.6000],
['20000522',4.5000],
['20000523',4.4400],
['20000524',4.4000],
['20000525',4.3000],
['20000526',4.1400],
['20000529',4.2200],
['20000530',4.2600],
['20000531',4.2600],
['20000601',4.1000],
['20000602',4.0200],
['20000605',4.0200],
['20000606',4.0200],
['20000607',4.0800],
['20000608',4.0400],
['20000609',4.0400],
['20000612',4.2400],
['20000613',4.3800],
['20000614',4.5000],
['20000615',4.4400],
['20000616',4.2800],
['20000619',4.2600],
['20000620',4.1800],
['20000621',3.9600],
['20000622',3.9000],
['20000623',4.0200],
['20000626',4.1800],
['20000627',4.4000],
['20000628',4.5000],
['20000629',4.4000],
['20000630',4.3800],
['20000703',4.3000],
['20000704',4.3000],
['20000705',4.2400],
['20000706',4.4400],
['20000707',4.3800],
['20000710',4.3200],
['20000711',4.3600],
['20000712',4.4600],
['20000713',4.4400],
['20000714',4.3800],
['20000717',4.3600],
['20000718',4.3600],
['20000719',4.3800],
['20000720',4.4800],
['20000721',4.4600],
['20000724',4.4000],
['20000725',4.3400],
['20000726',4.3000],
['20000727',4.2200],
['20000728',4.2600],
['20000731',4.4200],
['20000801',4.5200],
['20000802',4.5800],
['20000803',4.5600],
['20000804',5.1500],
['20000807',5.1000],
['20000808',5.0500],
['20000810',5.0500],
['20000811',5.1000],
['20000814',5.0000],
['20000815',4.9600],
['20000816',5.0000],
['20000817',4.9800],
['20000818',4.9800],
['20000821',5.0500],
['20000822',5.0000],
['20000823',5.0000],
['20000824',5.0500],
['20000825',4.9800],
['20000828',4.9000],
['20000829',4.9000],
['20000830',4.9800],
['20000831',4.9000],
['20000901',4.9800],
['20000904',5.0500],
['20000905',5.1500],
['20000906',5.1000],
['20000907',5.1500],
['20000908',5.1000],
['20000911',5.1500],
['20000912',5.1000],
['20000913',5.2000],
['20000914',5.1000],
['20000915',4.7600],
['20000918',4.8600],
['20000919',4.8600],
['20000920',4.9000],
['20000921',5.0000],
['20000922',5.0000],
['20000925',5.3500],
['20000926',5.6500],
['20000927',6.0000],
['20000928',5.8000],
['20000929',5.8500],
['20001002',5.8000],
['20001003',5.3000],
['20001004',5.2000],
['20001005',5.3000],
['20001006',5.3000],
['20001009',5.2000],
['20001010',5.5000],
['20001011',5.2000],
['20001012',5.4500],
['20001013',5.5000],
['20001016',5.8000],
['20001017',5.4500],
['20001018',5.4500],
['20001019',5.5500],
['20001020',5.5500],
['20001023',5.7500],
['20001024',5.8000],
['20001025',5.7000],
['20001027',5.7000],
['20001030',5.7500],
['20001031',5.5500],
['20001101',5.7500],
['20001102',5.7000],
['20001103',5.7000],
['20001106',5.7500],
['20001107',5.6500],
['20001108',5.8000],
['20001109',5.7500],
['20001110',5.7500],
['20001113',5.7500],
['20001114',5.9500],
['20001115',5.9000],
['20001116',5.9000],
['20001117',5.8000],
['20001120',5.8000],
['20001121',6.0000],
['20001122',5.9500],
['20001123',5.8500],
['20001124',6.0000],
['20001127',6.2000],
['20001128',6.2000],
['20001129',6.2500],
['20001130',6.2500],
['20001201',6.2500],
['20001204',6.0500],
['20001205',6.1000],
['20001206',6.1000],
['20001207',6.0500],
['20001208',6.1000],
['20001211',6.1500],
['20001212',6.2000],
['20001213',6.6500],
['20001214',6.6000],
['20001215',6.8000],
['20001218',6.4000],
['20001219',6.3500],
['20001220',6.5500],
['20001221',6.3000],
['20001222',6.3000],
['20001226',6.0000],
['20001228',6.0500],
['20001229',6.1000],
['20010102',6.1000],
['20010103',6.1000],
['20010104',6.1000],
['20010105',6.2000],
['20010108',6.4000],
['20010109',6.1500],
['20010110',6.2500],
['20010111',6.2000],
['20010112',6.2000],
['20010115',6.1500],
['20010116',6.2000],
['20010117',6.3000],
['20010118',6.2500],
['20010119',6.1500],
['20010122',6.3000],
['20010123',6.2000],
['20010126',6.0500],
['20010129',6.1500],
['20010130',6.2000],
['20010131',6.2000],
['20010201',6.3000],
['20010202',6.3000],
['20010205',6.4000],
['20010206',6.4000],
['20010207',6.2500],
['20010208',6.2500],
['20010209',6.2500],
['20010212',6.4000],
['20010213',6.2000],
['20010214',6.2500],
['20010215',6.2500],
['20010216',6.2500],
['20010219',6.2000],
['20010220',6.3000],
['20010221',6.4000],
['20010222',6.4000],
['20010223',6.2500],
['20010226',6.2000],
['20010227',6.3000],
['20010228',6.4000],
['20010301',6.2500],
['20010302',6.3500],
['20010305',6.5000],
['20010307',6.7000],
['20010308',6.5000],
['20010309',6.5000],
['20010312',6.3000],
['20010313',6.4500],
['20010314',6.4500],
['20010315',6.6000],
['20010316',6.6000],
['20010319',6.4500],
['20010320',6.5000],
['20010321',6.3000],
['20010322',6.2500],
['20010323',6.1500],
['20010326',5.9500],
['20010327',6.0000],
['20010328',6.1000],
['20010329',6.3000],
['20010330',5.7500],
['20010402',5.9500],
['20010403',6.0000],
['20010404',5.9000],
['20010405',5.9500],
['20010406',5.8500],
['20010409',5.7500],
['20010410',5.6500],
['20010411',5.7000],
['20010412',5.5000],
['20010416',5.5500],
['20010417',5.8500],
['20010418',5.8000],
['20010419',5.8500],
['20010420',5.7500],
['20010423',6.1500],
['20010424',6.2000],
['20010425',6.0000],
['20010426',6.1000],
['20010427',6.0500],
['20010430',5.8000],
['20010502',5.8000],
['20010503',5.8500],
['20010504',5.9000],
['20010508',5.9000],
['20010509',6.0000],
['20010510',6.0500],
['20010511',6.0500],
['20010514',6.1000],
['20010515',5.8500],
['20010516',5.6000],
['20010517',6.0500],
['20010518',5.7500],
['20010521',5.9000],
['20010522',5.8000],
['20010523',5.8500],
['20010524',5.9000],
['20010525',5.9000],
['20010528',5.7500],
['20010529',5.7500],
['20010530',5.7000],
['20010531',5.8500],
['20010601',5.7500],
['20010604',5.8500],
['20010605',5.9500],
['20010606',5.7000],
['20010607',5.8000],
['20010608',5.8000],
['20010611',5.9500],
['20010612',5.9500],
['20010613',5.9500],
['20010614',5.9000],
['20010615',5.9500],
['20010618',6.0500],
['20010619',5.9500],
['20010620',6.0000],
['20010621',5.9500],
['20010622',5.9500],
['20010625',5.9500],
['20010626',5.9500],
['20010627',6.0000],
['20010628',5.9500],
['20010629',6.1500],
['20010702',5.9500],
['20010703',5.9500],
['20010704',6.0000],
['20010705',5.9500],
['20010706',5.8000],
['20010709',5.9000],
['20010710',5.9000],
['20010711',5.8000],
['20010712',5.8000],
['20010713',5.8000],
['20010716',5.9000],
['20010717',5.8500],
['20010718',5.9000],
['20010719',5.7500],
['20010720',5.7500],
['20010723',5.7500],
['20010724',5.7500],
['20010725',5.8000],
['20010726',5.8500],
['20010727',5.8000],
['20010730',5.8000],
['20010731',5.9000],
['20010801',6.0000],
['20010802',6.0000],
['20010803',5.9000],
['20010806',5.9500],
['20010807',5.8000],
['20010808',5.8000],
['20010810',6.0000],
['20010813',6.0000],
['20010814',6.0000],
['20010815',6.0000],
['20010816',6.0000],
['20010817',6.0000],
['20010820',6.0000],
['20010821',6.1000],
['20010822',6.0000],
['20010823',6.0000],
['20010824',6.0000],
['20010827',6.1000],
['20010828',6.0000],
['20010829',5.8500],
['20010830',5.9000],
['20010831',6.0000],
['20010903',6.0000],
['20010904',6.0000],
['20010905',6.0000],
['20010906',6.0000],
['20010907',6.0000],
['20010910',6.0000],
['20010911',6.0500],
['20010912',5.7000],
['20010913',5.8500],
['20010914',6.0000],
['20010917',6.0500],
['20010918',6.0000],
['20010919',5.9500],
['20010920',5.9000],
['20010921',5.6500],
['20010924',5.5000],
['20010925',5.7500],
['20010926',5.8500],
['20010927',5.8000],
['20010928',5.6500],
['20011001',5.7500],
['20011002',5.9000],
['20011003',5.8000],
['20011004',5.7500],
['20011005',5.8500],
['20011008',5.6500],
['20011009',5.6500],
['20011010',5.6000],
['20011011',5.6000],
['20011012',5.6000],
['20011015',5.6000],
['20011016',5.6500],
['20011017',5.7000],
['20011018',5.6000],
['20011019',5.6000],
['20011022',5.6000],
['20011023',5.8000],
['20011024',5.7000],
['20011025',5.6000],
['20011026',5.6000],
['20011029',5.6000],
['20011030',5.6500],
['20011031',5.6000],
['20011101',5.6000],
['20011102',5.6000],
['20011105',5.7500],
['20011106',5.7500],
['20011107',5.7500],
['20011108',5.6000],
['20011109',5.6000],
['20011112',5.7500],
['20011113',5.6500],
['20011115',5.8000],
['20011116',5.6000],
['20011119',5.8000],
['20011120',5.9500],
['20011121',6.0500],
['20011122',5.9500],
['20011123',6.1000],
['20011126',6.0000],
['20011127',6.1000],
['20011128',6.0000],
['20011129',6.0000],
['20011130',6.1500],
['20011203',6.0500],
['20011204',6.0000],
['20011205',6.3500],
['20011206',6.1000],
['20011207',6.0000],
['20011210',6.0000],
['20011211',5.9000],
['20011212',5.8000],
['20011213',5.8000],
['20011214',5.7500],
['20011218',5.8000],
['20011219',5.8500],
['20011220',5.9000],
['20011221',5.8500],
['20011224',5.8500],
['20011226',5.9500],
['20011227',5.9000],
['20011228',5.9000],
['20011231',5.9000],
['20020102',5.8500],
['20020103',5.9000],
['20020104',5.9000],
['20020107',5.8000],
['20020108',5.9000],
['20020109',5.8000],
['20020110',5.9000],
['20020111',5.8500],
['20020114',6.1000],
['20020115',5.8000],
['20020116',5.8000],
['20020117',5.8000],
['20020118',5.7500],
['20020121',5.8500],
['20020122',5.7500],
['20020123',5.7000],
['20020124',5.7000],
['20020125',5.8000],
['20020128',5.8500],
['20020129',5.9000],
['20020130',5.7500],
['20020131',5.8000],
['20020201',5.7000],
['20020204',5.6000],
['20020205',5.5000],
['20020206',5.6000],
['20020207',5.5500],
['20020208',5.6000],
['20020211',5.6000],
['20020214',5.5000],
['20020215',5.5000],
['20020218',5.6000],
['20020219',5.5000],
['20020220',5.5000],
['20020221',5.5000],
['20020222',5.5000],
['20020225',5.6000],
['20020226',5.6500],
['20020227',5.6000],
['20020228',5.6000],
['20020301',5.8000],
['20020304',5.9000],
['20020305',5.9500],
['20020306',5.9500],
['20020307',5.9000],
['20020308',5.7500],
['20020311',5.8500],
['20020312',5.8000],
['20020313',5.8500],
['20020314',5.5500],
['20020315',5.5500],
['20020318',5.5000],
['20020319',5.5000],
['20020320',5.5500],
['20020321',5.5000],
['20020322',5.5500],
['20020325',5.5000],
['20020326',5.5000],
['20020327',5.4000],
['20020328',5.5000],
['20020401',5.5000],
['20020402',5.7000],
['20020403',5.7500],
['20020404',5.7000],
['20020405',5.7500],
['20020408',5.7500],
['20020409',5.8000],
['20020410',5.8000],
['20020411',5.8500],
['20020412',5.8000],
['20020415',5.8500],
['20020416',5.9000],
['20020417',5.9000],
['20020418',5.9000],
['20020419',5.9000],
['20020422',5.9000],
['20020423',5.9000],
['20020424',5.9500],
['20020425',6.0000],
['20020426',5.9500],
['20020429',5.9500],
['20020430',6.0000],
['20020502',6.0500],
['20020503',6.0000],
['20020506',6.0500],
['20020507',5.9500],
['20020508',6.0000],
['20020509',6.0000],
['20020510',6.0000],
['20020513',6.0000],
['20020514',6.1000],
['20020515',6.0000],
['20020516',6.0000],
['20020517',6.1000],
['20020520',6.1000],
['20020521',6.1000],
['20020522',6.0500],
['20020523',6.0500],
['20020524',6.1000],
['20020528',6.0500],
['20020529',6.0500],
['20020530',6.0500],
['20020531',5.9500],
['20020603',5.9000],
['20020604',5.8500],
['20020605',5.9000],
['20020606',5.9000],
['20020607',6.0500],
['20020610',6.1000],
['20020611',6.0000],
['20020612',6.0500],
['20020613',5.9500],
['20020614',6.0000],
['20020617',5.9500],
['20020618',6.0500],
['20020619',6.0000],
['20020620',5.9500],
['20020621',5.9500],
['20020624',5.9500],
['20020625',6.0000],
['20020626',5.9500],
['20020627',5.9500],
['20020628',5.9500],
['20020701',6.0000],
['20020702',6.0000],
['20020703',5.9000],
['20020704',5.9500],
['20020705',5.9500],
['20020708',5.8500],
['20020709',6.1000],
['20020710',5.9000],
['20020711',5.8500],
['20020712',5.8500],
['20020715',5.8000],
['20020716',5.7500],
['20020717',5.7500],
['20020718',5.8500],
['20020719',5.8000],
['20020722',5.7500],
['20020723',5.7000],
['20020724',5.7000],
['20020725',5.3500],
['20020726',5.4500],
['20020729',5.5000],
['20020730',5.5000],
['20020731',5.5000],
['20020801',5.6500],
['20020802',5.6500],
['20020805',5.7000],
['20020806',5.7000],
['20020807',5.7000],
['20020808',5.7500],
['20020812',5.6500],
['20020813',5.6500],
['20020814',5.7500],
['20020815',5.7000],
['20020816',5.6500],
['20020819',5.7000],
['20020820',5.7500],
['20020821',5.7000],
['20020822',5.7500],
['20020823',5.7500],
['20020826',5.7500],
['20020827',5.8000],
['20020828',5.7500],
['20020829',5.7500],
['20020830',5.8000],
['20020902',5.9000],
['20020903',5.7500],
['20020904',5.9500],
['20020905',5.9500],
['20020906',6.0000],
['20020909',5.9000],
['20020910',5.8500],
['20020911',5.7500],
['20020912',5.7500],
['20020913',6.1000],
['20020916',5.8000],
['20020917',5.8000],
['20020918',5.8000],
['20020919',5.8000],
['20020920',5.7500],
['20020923',5.8000],
['20020924',5.7500],
['20020925',5.8000],
['20020926',5.7500],
['20020927',5.7500],
['20020930',5.7500],
['20021001',5.9000],
['20021002',5.8000],
['20021003',5.7500],
['20021004',5.7500],
['20021007',5.7500],
['20021008',5.8000],
['20021009',5.9500],
['20021010',6.0000],
['20021011',5.7500],
['20021014',5.7500],
['20021015',5.7500],
['20021016',5.7500],
['20021017',5.9000],
['20021018',5.9000],
['20021021',5.9000],
['20021022',6.0000],
['20021023',6.0000],
['20021024',5.9000],
['20021025',5.9000],
['20021028',6.0000],
['20021029',5.9500],
['20021030',6.0000],
['20021031',6.0500],
['20021101',6.0500],
['20021105',5.9000],
['20021106',6.0500],
['20021107',6.0000],
['20021108',5.9500],
['20021111',5.9500],
['20021112',6.0000],
['20021113',5.9000],
['20021114',5.9500],
['20021115',6.0500],
['20021118',5.9000],
['20021119',5.9500],
['20021120',5.9000],
['20021121',5.9000],
['20021122',5.9500],
['20021125',6.0000],
['20021126',6.1000],
['20021127',6.0000],
['20021128',5.9000],
['20021129',6.0000],
['20021202',6.0000],
['20021203',5.9500],
['20021204',5.9500],
['20021205',5.8500],
['20021209',5.9000],
['20021210',6.0500],
['20021211',6.2000],
['20021212',6.1500],
['20021213',6.2000],
['20021216',6.0500],
['20021217',6.2000],
['20021218',6.1000],
['20021219',6.3000],
['20021220',6.3000],
['20021223',6.2000],
['20021224',6.3500],
['20021226',6.3500],
['20021227',6.3500],
['20021230',6.3500],
['20021231',6.2500],
['20030102',6.1500],
['20030103',6.3500],
['20030106',6.3000],
['20030107',6.1000],
['20030108',6.0500],
['20030109',6.0500],
['20030110',6.0500],
['20030113',6.2000],
['20030114',6.1000],
['20030115',6.1000],
['20030116',6.1500],
['20030117',6.2000],
['20030120',6.2500],
['20030121',6.1000],
['20030122',6.2500],
['20030123',6.2000],
['20030124',6.1000],
['20030127',6.2500],
['20030128',6.2000],
['20030129',6.1000],
['20030130',6.0000],
['20030131',6.1500],
['20030204',6.0500],
['20030205',6.2000],
['20030206',6.0500],
['20030207',5.9000],
['20030210',5.8500],
['20030211',6.0000],
['20030213',5.7500],
['20030214',5.7000],
['20030217',5.8000],
['20030218',5.7500],
['20030219',5.7000],
['20030220',5.6000],
['20030221',5.7000],
['20030224',5.6500],
['20030225',5.8000],
['20030226',5.7500],
['20030227',5.6000],
['20030228',5.7000],
['20030303',5.7500],
['20030304',5.8000],
['20030305',5.9000],
['20030306',5.8000],
['20030307',5.8500],
['20030310',5.9000],
['20030311',5.8500],
['20030312',5.8500],
['20030313',5.8000],
['20030314',5.7500],
['20030317',5.7500],
['20030318',5.7500],
['20030319',5.9000],
['20030320',5.7500],
['20030321',5.7500],
['20030324',5.7500],
['20030325',5.7500],
['20030326',5.8000],
['20030327',5.8500],
['20030328',5.7500],
['20030331',5.5000],
['20030401',5.7000],
['20030402',5.7000],
['20030403',5.7500],
['20030404',5.8500],
['20030407',6.0000],
['20030408',5.9000],
['20030409',5.9000],
['20030410',5.9000],
['20030411',5.8000],
['20030414',5.7000],
['20030415',5.7500],
['20030416',5.7000],
['20030417',5.6500],
['20030421',5.5000],
['20030422',5.5500],
['20030423',5.5500],
['20030424',5.6000],
['20030425',5.6500],
['20030428',5.4500],
['20030429',5.6000],
['20030430',5.6500],
['20030502',5.7500],
['20030505',5.8500],
['20030506',5.9000],
['20030507',5.9000],
['20030508',6.1000],
['20030509',5.9500],
['20030512',6.1000],
['20030513',6.0000],
['20030514',6.0000],
['20030516',5.8500],
['20030519',5.8500],
['20030520',5.9000],
['20030521',6.1000],
['20030522',5.9000],
['20030523',5.9000],
['20030526',5.9500],
['20030527',6.0000],
['20030528',6.1500],
['20030529',6.0500],
['20030530',6.0500],
['20030602',6.2500],
['20030603',6.2500],
['20030604',6.2500],
['20030605',6.3500],
['20030606',6.2500],
['20030609',6.3000],
['20030610',6.4000],
['20030611',6.3000],
['20030612',6.2500],
['20030613',6.2500],
['20030616',6.2000],
['20030617',6.3000],
['20030618',6.2000],
['20030619',6.3500],
['20030620',6.3000],
['20030623',6.2500],
['20030624',6.1500],
['20030625',6.1500],
['20030626',6.3000],
['20030627',6.1000],
['20030630',6.1500],
['20030701',6.1500],
['20030702',6.3000],
['20030703',6.2500],
['20030704',6.3500],
['20030707',6.5000],
['20030708',6.4500],
['20030709',6.5000],
['20030710',6.5000],
['20030711',6.2500],
['20030714',6.3500],
['20030715',6.6000],
['20030716',6.7000],
['20030717',6.7000],
['20030718',6.7000],
['20030721',6.7000],
['20030722',6.7500],
['20030723',6.7500],
['20030724',6.5000],
['20030725',7.1000],
['20030728',7.1000],
['20030729',7.0000],
['20030730',7.1500],
['20030731',7.0500],
['20030801',6.6500],
['20030804',6.6500],
['20030805',6.7000],
['20030806',6.7000],
['20030807',6.7500],
['20030808',6.8000],
['20030811',6.8500],
['20030812',7.0000],
['20030813',7.0000],
['20030814',6.9000],
['20030815',6.8500],
['20030818',6.9000],
['20030819',6.9000],
['20030820',7.0000],
['20030821',7.1000],
['20030822',7.0000],
['20030825',7.1000],
['20030826',7.1000],
['20030827',7.0000],
['20030828',7.0000],
['20030829',7.1000],
['20030901',7.1000],
['20030902',7.1000],
['20030903',7.1500],
['20030904',7.1000],
['20030905',7.1500],
['20030908',7.0000],
['20030909',7.0000],
['20030910',7.0000],
['20030911',7.1000],
['20030912',6.9500],
['20030915',6.9500],
['20030916',6.9000],
['20030917',7.0000],
['20030918',6.9500],
['20030919',6.8500],
['20030922',7.1500],
['20030923',7.0000],
['20030924',7.0500],
['20030925',7.0500],
['20030926',7.0500],
['20030929',7.1000],
['20030930',7.2000],
['20031001',7.3000],
['20031002',7.0000],
['20031003',7.1000],
['20031006',7.2000],
['20031007',7.2500],
['20031008',7.2000],
['20031009',7.3500],
['20031010',7.2500],
['20031013',7.2000],
['20031014',7.2500],
['20031015',7.3500],
['20031016',7.3000],
['20031017',7.2500],
['20031020',7.1500],
['20031021',7.2500],
['20031022',7.3000],
['20031023',7.2000],
['20031027',7.3000],
['20031028',7.3000],
['20031029',7.0500],
['20031030',7.2500],
['20031031',7.3500],
['20031103',7.7000],
['20031104',8.5000],
['20031105',8.2000],
['20031106',8.2000],
['20031107',8.2000],
['20031110',8.3500],
['20031111',8.4000],
['20031112',8.4000],
['20031113',8.5500],
['20031114',8.6000],
['20031117',8.9500],
['20031118',8.8500],
['20031119',8.8500],
['20031120',8.8000],
['20031121',8.9000],
['20031124',8.8000],
['20031126',8.9000],
['20031127',8.8000],
['20031128',8.8000],
['20031201',8.8000],
['20031202',8.8000],
['20031203',8.6000],
['20031204',8.8000],
['20031205',8.6500],
['20031208',8.6500],
['20031209',8.6500],
['20031210',8.7000],
['20031211',8.6500],
['20031212',8.8000],
['20031215',8.8500],
['20031216',9.0000],
['20031217',9.1000],
['20031218',9.2000],
['20031219',9.0000],
['20031222',9.0500],
['20031223',9.0500],
['20031224',9.0000],
['20031226',9.0000],
['20031229',9.0000],
['20031230',9.1000],
['20031231',9.1000],
['20040102',9.1500],
['20040105',10.1000],
['20040106',9.8500],
['20040107',9.6500],
['20040108',9.4500],
['20040109',9.6500],
['20040112',9.7500],
['20040113',9.7500],
['20040114',9.6000],
['20040115',9.8500],
['20040116',9.5500],
['20040119',9.3000],
['20040120',9.4000],
['20040121',9.4000],
['20040126',9.5000],
['20040127',9.4000],
['20040128',9.4000],
['20040129',9.1500],
['20040130',8.5500],
['20040203',9.2000],
['20040204',9.0000],
['20040205',9.0500],
['20040206',9.7500],
['20040209',9.2500],
['20040210',9.5000],
['20040211',9.3000],
['20040212',9.4000],
['20040213',9.4000],
['20040216',9.5000],
['20040217',9.6500],
['20040218',9.4000],
['20040219',9.4500],
['20040220',9.4000],
['20040223',8.9000],
['20040224',8.8500],
['20040225',9.1500],
['20040226',9.5500],
['20040227',9.4500],
['20040301',9.8500],
['20040302',10.0000],
['20040303',10.3000],
['20040304',10.6000],
['20040305',11.1000],
['20040308',10.8000],
['20040309',10.8000],
['20040310',10.8000],
['20040311',10.0000],
['20040312',10.0000],
['20040315',10.0000],
['20040316',10.0000],
['20040317',10.3000],
['20040318',10.8000],
['20040319',10.8000],
['20040322',10.6000],
['20040323',10.4000],
['20040324',10.2000],
['20040325',10.1000],
['20040326',10.9000],
['20040329',10.6000],
['20040330',10.4000],
['20040331',10.9000],
['20040401',10.6000],
['20040402',10.9000],
['20040405',11.0000],
['20040406',11.5000],
['20040407',11.5000],
['20040408',11.6000],
['20040412',11.5000],
['20040413',11.3000],
['20040414',11.0000],
['20040415',10.6000],
['20040416',10.7000],
['20040419',10.6000],
['20040420',10.6000],
['20040421',10.6000],
['20040422',10.2000],
['20040423',10.3000],
['20040426',10.5000],
['20040427',10.6000],
['20040428',10.3000],
['20040429',10.2000],
['20040430',10.1000],
['20040503',10.4000],
['20040504',11.0000],
['20040505',11.0000],
['20040506',11.0000],
['20040507',10.9000],
['20040510',10.5000],
['20040511',10.3000],
['20040512',10.2000],
['20040513',10.1000],
['20040514',10.1000],
['20040517',9.8500],
['20040518',10.1000],
['20040519',10.0000],
['20040520',9.9000],
['20040521',9.9500],
['20040524',10.0000],
['20040525',10.0000],
['20040526',10.1000],
['20040527',10.3000],
['20040528',10.5000],
['20040531',10.3000],
['20040601',11.0000],
['20040603',10.9000],
['20040604',11.0000],
['20040607',10.9000],
['20040608',11.0000],
['20040609',10.8000],
['20040610',10.8000],
['20040611',10.8000],
['20040614',10.9000],
['20040615',10.9000],
['20040616',11.0000],
['20040617',10.9000],
['20040618',10.5000],
['20040621',10.6000],
['20040622',10.6000],
['20040623',10.6000],
['20040624',10.8000],
['20040625',10.7000],
['20040628',10.7000],
['20040629',11.0000],
['20040630',11.0000],
['20040701',11.1000],
['20040702',11.0000],
['20040705',12.0000],
['20040706',12.5000],
['20040707',12.0000],
['20040708',12.3000],
['20040709',11.8000],
['20040712',12.0000],
['20040713',12.1000],
['20040714',12.0000],
['20040715',12.0000],
['20040716',12.0000],
['20040719',12.0000],
['20040720',12.1000],
['20040721',11.9000],
['20040722',12.0000],
['20040723',12.0000],
['20040726',12.0000],
['20040727',12.2000],
['20040728',12.2000],
['20040729',12.2000],
['20040730',12.2000],
['20040802',12.4000],
['20040803',12.7000],
['20040804',12.6000],
['20040805',13.3000],
['20040806',13.4000],
['20040810',13.4000],
['20040811',13.8000],
['20040812',13.1000],
['20040813',13.0000],
['20040816',13.0000],
['20040817',12.9000],
['20040818',12.7000],
['20040819',13.0000],
['20040820',12.9000],
['20040823',12.8000],
['20040824',12.8000],
['20040825',13.0000],
['20040826',13.0000],
['20040827',13.0000],
['20040830',13.0000],
['20040831',13.0000],
['20040901',13.0000],
['20040902',13.2000],
['20040903',13.4000],
['20040906',13.7000],
['20040907',13.8000],
['20040908',13.8000],
['20040909',14.2000],
['20040910',14.0000],
['20040913',13.7000],
['20040914',13.8000],
['20040915',13.9000],
['20040916',14.5000],
['20040917',14.5000],
['20040920',14.4000],
['20040921',14.4000],
['20040922',14.2000],
['20040923',14.2000],
['20040924',13.6000],
['20040927',13.7000],
['20040928',13.9000],
['20040929',14.1000],
['20040930',14.1000],
['20041001',13.9000],
['20041004',14.3000],
['20041005',14.4000],
['20041006',14.0000],
['20041007',13.9000],
['20041008',14.1000],
['20041011',14.0000],
['20041012',14.0000],
['20041013',14.1000],
['20041014',14.3000],
['20041015',14.3000],
['20041018',14.3000],
['20041019',14.4000],
['20041020',14.8000],
['20041021',15.0000],
['20041022',15.0000],
['20041025',14.6000],
['20041026',14.6000],
['20041027',14.7000],
['20041028',14.6000],
['20041029',14.8000],
['20041101',14.9000],
['20041102',15.0000],
['20041103',15.3000],
['20041104',15.8000],
['20041105',15.8000],
['20041108',16.0000],
['20041109',16.0000],
['20041110',16.2000],
['20041112',16.6000],
['20041116',16.8000],
['20041117',16.5000],
['20041118',16.9000],
['20041119',16.9000],
['20041122',16.7000],
['20041123',16.2000],
['20041124',16.9000],
['20041125',16.8000],
['20041126',16.8000],
['20041129',16.8000],
['20041130',16.7000],
['20041201',16.7000],
['20041202',16.4000],
['20041203',16.5000],
['20041206',16.0000],
['20041207',15.6000],
['20041208',15.6000],
['20041209',15.9000],
['20041210',16.0000],
['20041213',16.0000],
['20041214',16.0000],
['20041215',16.2000],
['20041216',16.1000],
['20041217',16.2000],
['20041220',16.4000],
['20041221',16.6000],
['20041222',16.6000],
['20041223',16.7000],
['20041224',16.2000],
['20041227',16.4000],
['20041228',16.4000],
['20041229',16.1000],
['20041230',16.0000],
['20041231',15.9000],
['20050103',16.2000],
['20050104',16.2000],
['20050105',16.1000],
['20050106',16.4000],
['20050107',17.1000],
['20050110',17.4000],
['20050111',17.3000],
['20050112',17.1000],
['20050113',16.9000],
['20050114',16.4000],
['20050117',16.7000],
['20050118',16.8000],
['20050119',16.7000],
['20050120',16.3000],
['20050124',16.3000],
['20050125',15.7000],
['20050126',16.1000],
['20050127',16.0000],
['20050128',16.5000],
['20050131',16.4000],
['20050201',16.6000],
['20050202',17.3000],
['20050203',17.3000],
['20050204',17.2000],
['20050207',17.4000],
['20050208',17.4000],
['20050211',17.5000],
['20050214',17.5000],
['20050215',17.3000],
['20050216',17.5000],
['20050217',17.9000],
['20050218',18.0000],
['20050221',18.3000],
['20050222',18.3000],
['20050223',18.3000],
['20050224',18.4000],
['20050225',18.2000],
['20050228',17.9000],
['20050301',18.2000],
['20050302',18.3000],
['20050303',18.1000],
['20050304',18.7000],
['20050307',18.4000],
['20050308',18.2000],
['20050309',18.0000],
['20050310',17.7000],
['20050311',18.0000],
['20050314',18.1000],
['20050315',18.0000],
['20050316',17.9000],
['20050317',17.1000],
['20050318',17.6000],
['20050321',17.6000],
['20050322',17.6000],
['20050323',17.5000],
['20050324',17.6000],
['20050328',17.7000],
['20050329',17.5000],
['20050330',17.3000],
['20050331',17.4000],
['20050401',17.5000],
['20050404',17.5000],
['20050405',17.5000],
['20050406',17.5000],
['20050407',17.5000],
['20050408',17.5000],
['20050411',17.5000],
['20050412',17.6000],
['20050413',18.1000],
['20050414',17.9000],
['20050415',18.1000],
['20050418',17.6000],
['20050419',17.5000],
['20050420',17.7000],
['20050421',17.6000],
['20050422',17.9000],
['20050425',17.8000],
['20050426',18.2000],
['20050427',18.0000],
['20050428',18.0000],
['20050429',18.0000],
['20050503',17.9000],
['20050504',18.2000],
['20050505',18.2000],
['20050506',18.0000],
['20050509',18.1000],
['20050510',18.0000],
['20050511',17.7000],
['20050512',17.7000],
['20050513',17.7000],
['20050516',17.7000],
['20050517',17.4000],
['20050518',17.5000],
['20050519',17.5000],
['20050520',17.6000],
['20050524',17.7000],
['20050525',17.3000],
['20050526',17.3000],
['20050527',17.2000],
['20050530',17.2000],
['20050531',17.2000],
['20050601',17.5000],
['20050602',17.7000],
['20050603',17.7000],
['20050606',17.9000],
['20050607',18.3000],
['20050608',18.0000],
['20050609',17.9000],
['20050610',18.2000],
['20050613',18.0000],
['20050614',18.0000],
['20050615',18.1000],
['20050616',18.0000],
['20050617',17.8000],
['20050620',18.1000],
['20050621',17.8000],
['20050622',17.8000],
['20050623',18.0000],
['20050624',18.0000],
['20050627',17.9000],
['20050628',17.8000],
['20050629',17.7000],
['20050630',17.7000],
['20050701',17.6000],
['20050704',18.0000],
['20050705',17.8000],
['20050706',17.9000],
['20050707',17.9000],
['20050708',17.7000],
['20050711',17.5000],
['20050712',17.5000],
['20050713',17.7000],
['20050714',17.7000],
['20050715',17.7000],
['20050718',17.7000],
['20050719',17.9000],
['20050720',17.8000],
['20050721',18.0000],
['20050722',18.0000],
['20050725',17.9000],
['20050726',18.1000],
['20050727',18.4000],
['20050728',18.5000],
['20050729',18.3000],
['20050801',18.3000],
['20050802',18.5000],
['20050803',18.4000],
['20050804',18.5000],
['20050805',18.2000],
['20050808',18.1000],
['20050810',17.7000],
['20050811',18.0000],
['20050812',17.9000],
['20050815',17.6000],
['20050816',17.9000],
['20050817',17.7000],
['20050818',17.6000],
['20050819',17.3000],
['20050822',17.3000],
['20050823',17.0000],
['20050824',16.9000],
['20050825',16.9000],
['20050826',16.9000],
['20050829',16.6000],
['20050830',16.4000],
['20050831',16.6000],
['20050901',17.3000],
['20050902',17.1000],
['20050905',17.0000],
['20050906',17.0000],
['20050907',17.0000],
['20050908',17.0000],
['20050909',17.0000],
['20050912',17.2000],
['20050913',17.0000],
['20050914',17.0000],
['20050915',17.1000],
['20050916',16.7000],
['20050919',16.9000],
['20050920',16.5000],
['20050921',16.1000],
['20050922',16.2000],
['20050923',16.3000],
['20050926',16.9000],
['20050927',17.2000],
['20050928',17.4000],
['20050929',17.1000],
['20050930',17.1000],
['20051003',16.8000],
['20051004',17.1000],
['20051005',17.0000],
['20051006',16.4000],
['20051007',16.8000],
['20051010',16.9000],
['20051011',16.7000],
['20051012',16.6000],
['20051013',16.4000],
['20051014',16.5000],
['20051017',16.4000],
['20051018',16.3000],
['20051019',16.3000],
['20051020',16.1000],
['20051021',16.0000],
['20051024',15.9000],
['20051025',16.0000],
['20051026',15.9000],
['20051027',16.3000],
['20051028',16.0000],
['20051031',15.8000],
['20051102',16.0000],
['20051104',16.1000],
['20051107',16.1000],
['20051108',16.3000],
['20051109',16.1000],
['20051110',16.1000],
['20051111',16.1000],
['20051114',16.2000],
['20051115',16.3000],
['20051116',16.2000],
['20051117',15.8000],
['20051118',16.2000],
['20051121',16.1000],
['20051122',16.0000],
['20051123',16.3000],
['20051124',16.3000],
['20051125',16.2000],
['20051128',16.2000],
['20051129',16.2000],
['20051130',15.7000],
['20051201',15.9000],
['20051202',15.9000],
['20051205',15.9000],
['20051206',16.0000],
['20051207',16.3000],
['20051208',16.3000],
['20051209',16.7000],
['20051212',17.3000],
['20051213',16.9000],
['20051214',17.2000],
['20051215',17.4000],
['20051216',17.3000],
['20051219',17.4000],
['20051220',17.5000],
['20051221',17.2000],
['20051222',16.9000],
['20051223',16.8000],
['20051227',16.7000],
['20051228',16.8000],
['20051229',17.2000],
['20051230',17.2000],
['20060103',16.8000],
['20060104',16.9000],
['20060105',17.2000],
['20060106',17.3000],
['20060109',17.4000],
['20060111',17.2000],
['20060112',17.1000],
['20060113',17.1000],
['20060116',16.7000],
['20060117',16.1000],
['20060118',16.1000],
['20060119',16.2000],
['20060120',16.5000],
['20060123',16.5000],
['20060124',16.4000],
['20060125',16.4000],
['20060126',16.5000],
['20060127',17.0000],
['20060201',17.4000],
['20060202',17.1000],
['20060203',17.4000],
['20060206',17.4000],
['20060207',17.8000],
['20060208',17.9000],
['20060209',17.6000],
['20060210',17.7000],
['20060213',17.7000],
['20060214',17.8000],
['20060215',17.7000],
['20060216',17.7000],
['20060217',17.7000],
['20060220',17.9000],
['20060221',17.6000],
['20060222',17.7000],
['20060223',17.5000],
['20060224',17.5000],
['20060227',17.6000],
['20060228',17.7000],
['20060301',17.3000],
['20060302',17.7000],
['20060303',17.8000],
['20060306',17.9000],
['20060307',18.2000],
['20060308',19.1000],
['20060309',18.9000],
['20060310',18.8000],
['20060313',19.0000],
['20060314',19.0000],
['20060315',18.5000],
['20060316',18.4000],
['20060317',18.0000],
['20060320',18.3000],
['20060321',18.8000],
['20060322',18.5000],
['20060323',18.5000],
['20060324',18.6000],
['20060327',18.6000],
['20060328',18.5000],
['20060329',18.4000],
['20060330',18.3000],
['20060331',18.4000],
['20060403',18.3000],
['20060404',18.4000],
['20060405',18.4000],
['20060406',18.5000],
['20060407',18.6000],
['20060410',18.7000],
['20060411',18.5000],
['20060412',18.4000],
['20060413',18.4000],
['20060417',18.4000],
['20060418',18.4000],
['20060419',17.9000],
['20060420',18.0000],
['20060421',18.2000],
['20060424',18.1000],
['20060425',18.2000],
['20060426',18.4000],
['20060427',18.2000],
['20060428',18.1000],
['20060502',18.3000],
['20060503',18.7000],
['20060504',18.5000],
['20060505',18.8000],
['20060508',18.5000],
['20060509',18.8000],
['20060510',19.5000],
['20060511',19.2000],
['20060515',19.0000],
['20060516',18.5000],
['20060517',18.2000],
['20060518',17.7000],
['20060519',18.0000],
['20060522',17.7000],
['20060523',17.3000],
['20060524',17.8000],
['20060525',18.4000],
['20060526',17.8000],
['20060529',18.1000],
['20060530',18.3000],
['20060531',18.3000],
['20060601',19.0000],
['20060602',19.2000],
['20060605',19.2000],
['20060606',18.4000],
['20060607',17.9000],
['20060608',17.5000],
['20060609',17.7000],
['20060612',17.8000],
['20060613',17.5000],
['20060614',17.5000],
['20060615',17.5000],
['20060616',17.5000],
['20060619',17.8000],
['20060620',17.7000],
['20060621',17.3000],
['20060622',17.3000],
['20060623',16.9000],
['20060626',17.1000],
['20060627',17.0000],
['20060628',17.2000],
['20060629',17.5000],
['20060630',17.6000],
['20060703',17.6000],
['20060704',17.4000],
['20060705',17.9000],
['20060706',18.2000],
['20060707',18.0000],
['20060710',17.9000],
['20060711',17.7000],
['20060712',17.6000],
['20060713',17.4000],
['20060714',17.6000],
['20060717',17.7000],
['20060718',17.4000],
['20060719',17.9000],
['20060720',17.9000],
['20060721',17.7000],
['20060724',17.8000],
['20060725',18.4000],
['20060726',18.2000],
['20060727',18.6000],
['20060728',18.7000],
['20060731',19.0000],
['20060801',18.6000],
['20060802',18.9000],
['20060803',18.6000],
['20060804',18.5000],
['20060807',18.5000],
['20060808',18.4000],
['20060810',18.2000],
['20060811',18.1000],
['20060814',18.0000],
['20060815',18.0000],
['20060816',18.2000],
['20060817',18.3000],
['20060818',18.4000],
['20060821',18.4000],
['20060822',18.4000],
['20060823',18.3000],
['20060824',18.0000],
['20060825',17.4000],
['20060828',17.4000],
['20060829',17.6000],
['20060830',17.9000],
['20060831',17.6000],
['20060901',17.5000],
['20060904',17.7000],
['20060905',17.6000],
['20060906',17.7000],
['20060907',18.0000],
['20060908',17.8000],
['20060911',17.9000],
['20060912',17.7000],
['20060913',17.7000],
['20060914',18.0000],
['20060915',17.9000],
['20060918',18.0000],
['20060919',18.4000],
['20060920',18.1000],
['20060921',18.3000],
['20060922',18.2000],
['20060925',18.2000],
['20060926',18.2000],
['20060927',18.1000],
['20060928',18.2000],
['20060929',18.3000],
['20061002',18.2000],
['20061003',18.2000],
['20061004',18.2000],
['20061005',18.7000],
['20061006',19.0000],
['20061009',18.7000],
['20061010',18.9000],
['20061011',19.2000],
['20061012',19.0000],
['20061013',19.3000],
['20061016',19.7000],
['20061017',19.6000],
['20061018',20.0000],
['20061019',20.0000],
['20061020',19.7000],
['20061023',19.5000],
['20061025',19.3000],
['20061026',19.4000],
['20061027',19.5000],
['20061030',19.4000],
['20061031',20.0000],
['20061101',19.7000],
['20061102',20.0000],
['20061103',20.0000],
['20061106',19.8000],
['20061107',20.0000],
['20061108',19.5000],
['20061109',19.6000],
['20061110',19.6000],
['20061113',19.6000],
['20061114',19.6000],
['20061115',20.0000],
['20061116',19.8000],
['20061117',20.0000],
['20061120',19.9000],
['20061121',19.9000],
['20061122',19.6000],
['20061123',20.0000],
['20061124',19.6000],
['20061127',20.0000],
['20061128',19.9000],
['20061129',19.9000],
['20061130',19.8000],
['20061201',19.9000],
['20061204',19.9000],
['20061205',20.0000],
['20061206',20.1000],
['20061207',20.5000],
['20061208',20.4000],
['20061211',21.1000],
['20061212',21.1000],
['20061213',21.4000],
['20061214',21.5000],
['20061215',21.1000],
['20061218',21.5000],
['20061219',21.0000],
['20061220',21.4000],
['20061221',21.2000],
['20061222',21.3000],
['20061226',21.5000],
['20061227',21.3000],
['20061228',21.4000],
['20061229',21.4000],
['20070103',21.4000],
['20070104',21.5000],
['20070105',21.7000],
['20070108',22.0000],
['20070109',22.3000],
['20070110',22.2000],
['20070111',21.9000],
['20070112',22.1000],
['20070115',22.3000],
['20070116',22.5000],
['20070117',22.1000],
['20070118',22.1000],
['20070119',21.9000],
['20070122',22.2000],
['20070123',22.6000],
['20070124',22.9000],
['20070125',23.9000],
['20070126',23.4000],
['20070129',23.5000],
['20070130',23.5000],
['20070131',23.5000],
['20070201',23.5000],
['20070202',23.0000],
['20070205',23.6000],
['20070206',24.0000],
['20070207',23.6000],
['20070208',23.9000],
['20070209',23.6000],
['20070212',23.4000],
['20070213',23.4000],
['20070214',23.2000],
['20070215',22.9000],
['20070216',22.8000],
['20070221',22.8000],
['20070222',23.2000],
['20070223',23.7000],
['20070226',23.6000],
['20070227',23.1000],
['20070228',22.5000],
['20070301',21.6000],
['20070302',21.2000],
['20070305',20.5000],
['20070306',20.2000],
['20070307',21.0000],
['20070308',22.7000],
['20070309',21.7000],
['20070312',21.1000],
['20070313',22.0000],
['20070314',21.0000],
['20070315',20.5000],
['20070316',21.0000],
['20070319',21.0000],
['20070320',21.0000],
['20070321',20.7000],
['20070322',20.9000],
['20070323',21.0000],
['20070326',21.6000],
['20070327',21.2000],
['20070328',20.5000],
['20070329',21.0000],
['20070330',21.1000],
['20070402',22.4000],
['20070403',22.6000],
['20070404',22.4000],
['20070405',22.9000],
['20070409',22.8000],
['20070410',23.9000],
['20070411',24.5000],
['20070412',24.2000],
['20070413',23.2000],
['20070416',23.3000],
['20070417',23.7000],
['20070418',23.5000],
['20070419',23.5000],
['20070420',23.5000],
['20070423',23.2000],
['20070424',23.2000],
['20070425',23.1000],
['20070426',23.1000],
['20070427',23.6000],
['20070430',23.4000],
['20070502',24.5000],
['20070503',24.8000],
['20070504',25.0000],
['20070507',24.5000],
['20070508',24.0000],
['20070509',24.5000],
['20070510',26.0000],
['20070511',25.9000],
['20070514',25.1000],
['20070515',24.7000],
['20070516',24.8000],
['20070517',24.6000],
['20070518',24.0000],
['20070521',23.9000],
['20070522',24.0000],
['20070523',23.7000],
['20070524',23.7000],
['20070525',23.2000],
['20070528',24.2000],
['20070529',24.0000],
['20070530',24.0000],
['20070601',24.7000],
['20070604',24.5000],
['20070605',24.2000],
['20070606',24.0000],
['20070607',23.7000],
['20070608',23.7000],
['20070611',23.7000],
['20070612',23.8000],
['20070613',24.4000],
['20070614',24.8000],
['20070615',25.0000],
['20070618',24.3000],
['20070619',24.0000],
['20070620',24.3000],
['20070621',24.3000],
['20070622',23.4000],
['20070625',23.0000],
['20070626',22.1000],
['20070627',22.7000],
['20070628',23.5000],
['20070629',23.8000],
['20070702',24.0000],
['20070703',24.0000],
['20070704',24.5000],
['20070705',24.6000],
['20070706',24.1000],
['20070709',24.7000],
['20070710',25.0000],
['20070711',24.6000],
['20070712',25.1000],
['20070713',25.4000],
['20070716',25.4000],
['20070717',25.6000],
['20070718',25.0000],
['20070719',25.0000],
['20070720',25.0000],
['20070723',25.0000],
['20070724',25.0000],
['20070725',24.8000],
['20070726',24.4000],
['20070727',24.0000],
['20070730',24.2000],
['20070731',24.2000],
['20070801',23.2000],
['20070802',24.2000],
['20070803',23.9000],
['20070806',22.4000],
['20070807',22.7000],
['20070808',22.6000],
['20070810',23.0000],
['20070813',22.8000],
['20070814',22.6000],
['20070815',22.6000],
['20070816',23.1000],
['20070817',23.2000],
['20070820',24.5000],
['20070821',24.5000],
['20070822',24.1000],
['20070823',24.2000],
['20070824',24.5000],
['20070827',24.8000],
['20070828',24.6000],
['20070829',24.6000],
['20070830',24.3000],
['20070831',26.0000],
['20070903',26.5000],
['20070904',26.9000],
['20070905',28.7000],
['20070906',28.4000],
['20070907',27.6000],
['20070910',26.7000],
['20070911',27.3000],
['20070912',27.2000],
['20070913',27.2000],
['20070914',28.0000],
['20070917',28.0000],
['20070918',28.0000],
['20070919',28.5000],
['20070920',28.5000],
['20070921',28.6000],
['20070924',28.8000],
['20070925',28.5000],
['20070926',28.5000],
['20070927',28.5000],
['20070928',28.6000],
['20071001',28.6000],
['20071002',28.6000],
['20071003',28.6000],
['20071004',28.7000],
['20071005',29.0000],
['20071008',28.3000],
['20071009',28.9000],
['20071010',29.2000],
['20071011',29.1000],
['20071012',28.8000],
['20071015',28.6000],
['20071016',28.8000],
['20071017',28.6000],
['20071018',28.5000],
['20071019',28.4000],
['20071022',27.5000],
['20071023',28.0000],
['20071024',28.3000],
['20071025',28.3000],
['20071026',29.3000],
['20071029',29.2000],
['20071030',29.7000],
['20071031',30.5000],
['20071101',30.6000],
['20071102',30.5000],
['20071105',29.2000],
['20071106',27.7000],
['20071107',28.4000],
['20071109',27.6000],
['20071112',27.0000],
['20071113',26.9000],
['20071114',27.5000],
['20071115',27.5000],
['20071116',26.8000],
['20071119',26.6000],
['20071120',27.0000],
['20071121',27.0000],
['20071122',25.8000],
['20071123',26.0000],
['20071126',26.2000],
['20071127',26.0000],
['20071128',26.0000],
['20071129',27.5000],
['20071130',27.8000],
['20071203',29.8000],
['20071204',27.9000],
['20071205',27.8000],
['20071206',28.2000],
['20071207',28.0000],
['20071210',27.8000],
['20071211',27.3000],
['20071212',27.3000],
['20071213',26.3000],
['20071214',25.2000],
['20071217',25.5000],
['20071218',25.0000],
['20071219',25.2000],
['20071221',25.5000],
['20071224',25.9000],
['20071226',26.6200],
['20071227',27.6000],
['20071228',27.4000],
['20071231',27.7000],
['20080102',28.0000],
['20080103',27.9600],
['20080104',28.5000],
['20080107',27.5000],
['20080108',27.4600],
['20080109',26.7000],
['20080110',26.7000],
['20080111',27.5000],
['20080114',27.7000],
['20080115',27.5200],
['20080116',26.9000],
['20080117',26.9200],
['20080118',26.8800],
['20080121',26.0600],
['20080122',24.0000],
['20080123',25.9000],
['20080124',25.0000],
['20080125',26.5800],
['20080128',25.6000],
['20080129',25.5800],
['20080130',25.4800],
['20080131',25.4800],
['20080201',25.8200],
['20080204',26.4200],
['20080205',26.0200],
['20080206',25.4600],
['20080211',25.0000],
['20080212',24.9800],
['20080213',26.6000],
['20080214',28.0000],
['20080215',28.8800],
['20080218',29.4000],
['20080219',29.4000],
['20080220',28.2800],
['20080221',28.0000],
['20080222',30.4000],
['20080225',27.8600],
['20080226',26.7800],
['20080227',27.7400],
['20080228',27.9200],
['20080229',27.9000],
['20080303',27.7200],
['20080304',27.8600],
['20080305',28.3000],
['20080306',28.7000],
['20080307',28.1200],
['20080310',28.0000],
['20080311',26.8200],
['20080312',27.4200],
['20080313',26.9000],
['20080314',27.4000],
['20080317',28.0800],
['20080318',27.6000],
['20080319',28.0600],
['20080320',29.4600],
['20080324',30.1000],
['20080325',33.1600],
['20080326',31.0200],
['20080327',30.3200],
['20080328',31.8200],
['20080331',31.5800],
['20080401',30.5000],
['20080402',30.4800],
['20080403',30.5200],
['20080404',29.7600],
['20080407',30.0000],
['20080408',29.4000],
['20080409',29.9400],
['20080410',29.9400],
['20080411',29.4000],
['20080414',29.5600],
['20080415',29.6800],
['20080416',29.9800],
['20080417',31.1200],
['20080418',30.8000],
['20080421',31.0000],
['20080422',31.2000],
['20080423',31.7800],
['20080424',31.7800],
['20080425',31.9600],
['20080428',31.0000],
['20080429',30.8600],
['20080430',30.7400],
['20080502',32.9600],
['20080505',32.1000],
['20080506',31.4600],
['20080507',32.7000],
['20080508',34.1600],
['20080509',33.7800],
['20080512',32.7400],
['20080513',32.8400],
['20080514',34.6000],
['20080515',33.9600],
['20080516',35.6000],
['20080520',33.2400],
['20080521',33.0000],
['20080522',32.0200],
['20080523',32.7000],
['20080526',32.4000],
['20080527',32.6200],
['20080528',32.4400],
['20080529',32.1800],
['20080530',32.5000],
['20080602',32.4000],
['20080603',33.0000],
['20080604',32.6000],
['20080605',32.0400],
['20080606',33.0000],
['20080609',33.1400],
['20080610',32.2400],
['20080611',31.1000],
['20080612',30.5000],
['20080613',29.7000],
['20080616',30.0000],
['20080617',30.3800],
['20080618',30.3800],
['20080619',29.4600],
['20080620',30.6400],
['20080623',29.7200],
['20080624',28.6200],
['20080625',28.6600],
['20080626',28.6800],
['20080627',30.0000],
['20080630',31.0000],
['20080701',30.9000],
['20080702',30.4000],
['20080703',30.4200],
['20080704',30.4000],
['20080707',30.5000],
['20080708',30.6000],
['20080709',30.0200],
['20080710',29.2800],
['20080711',29.0200],
['20080714',28.7800],
['20080715',28.4800],
['20080716',29.0000],
['20080717',29.2800],
['20080718',30.4000],
['20080721',30.8800],
['20080722',30.3400],
['20080723',31.0000],
['20080724',31.0800],
['20080725',31.0000],
['20080728',31.0400],
['20080729',29.9400],
['20080730',30.4000],
['20080731',31.6000],
['20080801',31.9800],
['20080804',30.6000],
['20080805',30.4400],
['20080806',31.3000],
['20080807',31.1000],
['20080808',30.5800],
['20080811',31.0000],
['20080812',31.6200],
['20080813',31.4000],
['20080814',31.2200],
['20080815',31.1600],
['20080818',30.8000],
['20080819',30.2400],
['20080820',29.0000],
['20080821',28.8000],
['20080822',28.8000],
['20080825',29.0000],
['20080826',28.8800],
['20080827',28.5000],
['20080828',27.8600],
['20080829',28.8800],
['20080901',28.9000],
['20080902',28.9800],
['20080903',28.9000],
['20080904',28.5400],
['20080905',27.8400],
['20080908',28.0000],
['20080909',27.6000],
['20080910',27.7200],
['20080911',28.0000],
['20080912',27.7200],
['20080915',27.6800],
['20080916',27.7000],
['20080917',27.0000],
['20080918',25.9000],
['20080919',26.5000],
['20080922',27.4000],
['20080923',27.4000],
['20080924',27.3000],
['20080925',27.3600],
['20080926',27.4000],
['20080929',27.4000],
['20080930',26.0000],
['20081002',27.0000],
['20081003',25.5200],
['20081006',25.0000],
['20081007',24.4600],
['20081008',21.7400],
['20081009',22.4800],
['20081010',21.5000],
['20081013',23.0000],
['20081014',23.7000],
['20081015',24.0000],
['20081016',21.5000],
['20081017',19.5000],
['20081020',19.9200],
['20081021',20.1200],
['20081022',19.8400],
['20081023',18.5000],
['20081024',18.4400],
['20081028',17.0000],
['20081029',19.0000],
['20081030',22.4200],
['20081031',23.5000],
['20081103',23.4800],
['20081104',22.8000],
['20081105',22.7000],
['20081106',21.2400],
['20081107',20.5000],
['20081110',20.5000],
['20081111',20.5600],
['20081112',20.4800],
['20081113',21.2000],
['20081114',21.5000],
['20081117',19.0200],
['20081118',19.0200],
['20081119',18.5000],
['20081120',18.5000],
['20081121',18.5000],
['20081124',17.5400],
['20081125',17.7800],
['20081126',18.0000],
['20081127',17.6200],
['20081128',17.8000],
['20081201',17.6000],
['20081202',17.0000],
['20081203',16.5000],
['20081204',15.8000],
['20081205',16.2400],
['20081209',16.3800],
['20081210',17.2400],
['20081211',17.1800],
['20081212',16.6600],
['20081215',16.6000],
['20081216',17.2000],
['20081217',18.1000],
['20081218',18.8800],
['20081219',18.4200],
['20081222',18.4800],
['20081223',18.5000],
['20081224',18.0200],
['20081226',18.8000],
['20081229',18.8400],
['20081230',18.5000],
['20081231',18.5000],
['20090102',18.3400],
['20090105',19.4800],
['20090106',20.1400],
['20090107',20.7800],
['20090108',20.0000],
['20090109',20.5000],
['20090112',20.1400],
['20090113',20.0400],
['20090114',20.1600],
['20090115',19.9800],
['20090116',19.1000],
['20090119',19.6600],
['20090120',18.6200],
['20090121',18.4000],
['20090122',19.4000],
['20090123',19.6200],
['20090128',19.8400],
['20090129',19.8400],
['20090130',19.8200],
['20090202',19.9400],
['20090203',19.9200],
['20090204',19.2800],
['20090205',19.8400],
['20090206',19.7600],
['20090209',19.2200],
['20090210',19.9000],
['20090211',19.9600],
['20090212',19.2800],
['20090213',18.5000],
['20090216',17.7200],
['20090217',17.2600],
['20090218',17.0600],
['20090219',17.5000],
['20090220',16.8600],
['20090223',16.8000],
['20090224',17.0000],
['20090225',17.5000],
['20090226',17.1000],
['20090227',17.3000],
['20090302',17.1200],
['20090303',16.5000],
['20090304',16.2600],
['20090305',16.8000],
['20090306',16.7000],
['20090309',16.6000],
['20090310',16.2600],
['20090311',16.8600],
['20090312',16.9200],
['20090313',17.0200],
['20090316',17.0200],
['20090317',17.0000],
['20090318',17.0000],
['20090319',17.6000],
['20090320',18.0000],
['20090323',18.5000],
['20090324',18.1000],
['20090325',17.9000],
['20090326',18.8200],
['20090327',18.7400],
['20090330',18.4000],
['20090331',18.2000],
['20090401',18.0200],
['20090402',19.2000],
['20090403',20.5000],
['20090406',20.1600],
['20090407',19.8800],
['20090408',19.9600],
['20090409',19.8600],
['20090413',20.8000],
['20090414',22.0000],
['20090415',20.6800],
['20090416',20.7600],
['20090417',19.9600],
['20090420',19.8400],
['20090421',24.0000],
['20090422',19.9000],
['20090423',20.0400],
['20090424',20.9000],
['20090427',20.2000],
['20090428',20.5000],
['20090429',21.2200],
['20090430',22.7000],
['20090504',22.0000],
['20090505',22.7800],
['20090506',23.3000],
['20090507',23.3600],
['20090508',22.1600],
['20090511',23.4800],
['20090512',22.3000],
['20090513',22.3600],
['20090514',22.2400],
['20090515',22.0400],
['20090518',22.3000],
['20090519',22.1000],
['20090520',22.7400],
['20090521',23.5000],
['20090522',22.8000],
['20090525',23.7400],
['20090526',24.0000],
['20090527',24.4000],
['20090528',24.8000],
['20090529',25.6000],
['20090601',26.5600],
['20090602',25.9000],
['20090603',26.6000],
['20090604',26.1200],
['20090605',25.7200],
['20090608',25.0000],
['20090609',25.0600],
['20090610',25.0200],
['20090611',24.9400],
['20090612',26.1000],
['20090615',25.0000],
['20090616',24.7000],
['20090617',23.8600],
['20090618',23.4000],
['20090619',24.3000],
['20090622',26.1200],
['20090623',24.5000],
['20090624',24.7600],
['20090625',24.8000],
['20090626',25.2600],
['20090629',26.1200],
['20090630',27.4200],
['20090701',28.0000],
['20090702',27.8600],
['20090703',26.3000],
['20090706',26.2000],
['20090707',26.0400],
['20090708',25.5000],
['20090709',26.6400],
['20090710',26.6000],
['20090713',26.5400],
['20090714',26.4000],
['20090715',26.1800],
['20090716',26.2600],
['20090717',26.6000],
['20090720',27.2800],
['20090721',27.5200],
['20090722',27.5000],
['20090723',27.1000],
['20090724',27.3200],
['20090727',27.5600],
['20090728',28.1000],
['20090729',29.1800],
['20090730',28.7000],
['20090731',28.8000],
['20090803',30.0000],
['20090804',30.6000],
['20090805',31.0200],
['20090806',30.1600],
['20090807',29.5200],
['20090811',29.5000],
['20090812',29.6800],
['20090813',29.6800],
['20090814',29.7600],
['20090817',29.4000],
['20090818',29.0000],
['20090819',27.6200],
['20090820',28.3000],
['20090821',28.4000],
['20090824',28.9000],
['20090825',27.7800],
['20090826',28.0000],
['20090827',28.1200],
['20090828',28.1600],
['20090831',29.0000],
['20090901',28.8000],
['20090902',27.5200],
['20090903',27.5000],
['20090904',27.7200],
['20090907',27.6000],
['20090908',28.0800],
['20090909',28.6200],
['20090910',30.5400],
['20090911',30.0000],
['20090914',31.8000],
['20090915',30.2200],
['20090916',31.4800],
['20090917',30.1400],
['20090918',30.9800],
['20090922',31.6400],
['20090923',32.1000],
['20090924',31.3200],
['20090925',30.4400],
['20090928',29.6000],
['20090929',30.9000],
['20090930',30.4000],
['20091001',32.4000],
['20091002',30.9000],
['20091005',30.5400],
['20091006',30.7000],
['20091007',30.7000],
['20091008',30.8800],
['20091009',30.9800],
['20091012',30.4800],
['20091013',29.6000],
['20091014',30.3200],
['20091015',29.7200],
['20091016',30.0000],
['20091019',29.9600],
['20091020',29.5400],
['20091021',29.4000],
['20091022',30.0000],
['20091023',31.5600],
['20091026',31.4400],
['20091027',31.1200],
['20091028',30.0000],
['20091029',30.5000],
['20091030',29.9800],
['20091102',30.0000],
['20091103',30.8400],
['20091104',31.0000],
['20091105',31.0000],
['20091106',30.5000],
['20091109',30.6000],
['20091110',30.4800],
['20091111',30.2000],
['20091112',29.4200],
['20091113',29.7000],
['20091116',30.7000],
['20091117',29.9800],
['20091118',30.5000],
['20091119',30.8000],
['20091120',30.4800],
['20091123',30.7000],
['20091124',31.3800],
['20091125',30.5000],
['20091126',30.2400],
['20091130',29.5400],
['20091201',29.6400],
['20091202',29.9800],
['20091203',29.6200],
['20091204',29.8000],
['20091207',29.9200],
['20091208',29.6200],
['20091209',29.7800],
['20091210',29.3800],
['20091211',29.2400],
['20091214',29.2600],
['20091215',29.1600],
['20091216',28.7000],
['20091217',29.0000],
['20091218',28.8600],
['20091221',29.6000],
['20091222',30.4600],
['20091223',30.4400],
['20091224',30.1800],
['20091228',30.3600],
['20091229',30.2800],
['20091230',29.9800],
['20091231',30.1800],
['20100104',30.0000],
['20100105',29.8400],
['20100106',30.0000],
['20100107',30.4600],
['20100108',30.5800],
['20100111',30.1000],
['20100112',30.1800],
['20100113',30.2400],
['20100114',30.0000],
['20100115',30.8400],
['20100118',31.5000],
['20100119',31.7400],
['20100120',31.8200],
['20100121',30.5400],
['20100122',30.0000],
['20100125',29.8200],
['20100126',30.0200],
['20100127',29.9000],
['20100128',29.9800],
['20100129',30.0000],
['20100201',29.3000],
['20100202',29.5400],
['20100203',29.6200],
['20100204',30.8200],
['20100205',30.0000],
['20100208',30.0000],
['20100209',30.2400],
['20100210',30.3400],
['20100211',30.2000],
['20100212',29.9400],
['20100217',30.9000],
['20100218',30.7000],
['20100219',30.2000],
['20100222',29.8000],
['20100223',29.2800],
['20100224',28.6000],
['20100225',28.2800],
['20100226',27.3400],
['20100301',28.6000],
['20100302',29.2200],
['20100303',29.4600],
['20100304',29.5800],
['20100305',29.0000],
['20100308',30.2000],
['20100309',31.9400],
['20100310',32.2800],
['20100311',32.9800],
['20100312',33.4000],
['20100315',34.1000],
['20100316',33.7400],
['20100317',33.2000],
['20100318',33.5000],
['20100319',35.0000],
['20100322',34.5400],
['20100323',34.0000],
['20100324',34.1600],
['20100325',34.2000],
['20100326',34.2000],
['20100329',34.3000],
['20100330',33.0400],
['20100331',33.3000],
['20100401',34.1000],
['20100405',35.2000],
['20100406',35.5000],
['20100407',36.4800],
['20100408',35.3000],
['20100409',35.0000],
['20100412',35.1000],
['20100413',36.0000],
['20100414',35.3800],
['20100415',35.7800],
['20100416',36.6400],
['20100419',35.9800],
['20100420',36.5000],
['20100421',35.9800],
['20100422',35.7400],
['20100423',36.0600],
['20100426',36.4400],
['20100427',37.4000],
['20100428',36.2600],
['20100429',36.2800],
['20100430',36.8200],
['20100503',37.2000],
['20100504',37.3000],
['20100505',37.1200],
['20100506',34.7000],
['20100507',35.3800],
['20100510',35.6800],
['20100511',36.3000],
['20100512',36.4000],
['20100513',35.7000],
['20100514',35.6200],
['20100517',34.9800],
['20100518',35.3200],
['20100519',34.0200],
['20100520',34.4200],
['20100521',33.0400],
['20100524',33.3200],
['20100525',33.1600],
['20100526',34.3000],
['20100527',34.7400],
['20100531',35.0400],
['20100601',36.0000],
['20100602',35.0000],
['20100603',36.1000],
['20100604',36.9400],
['20100607',36.7000],
['20100608',36.5000],
['20100609',36.4800],
['20100610',37.2000],
['20100611',36.1400],
['20100614',36.7800],
['20100615',36.5400],
['20100616',36.6400],
['20100617',36.5000],
['20100618',36.1800],
['20100621',36.2200],
['20100622',36.0200],
['20100623',35.7000],
['20100624',36.2000],
['20100625',36.0000],
['20100628',35.7400],
['20100629',35.0000],
['20100630',35.1400],
['20100701',35.6000],
['20100702',36.4200],
['20100705',36.4400],
['20100706',37.3000],
['20100707',39.3400],
['20100708',40.5000],
['20100709',39.7000],
['20100712',40.5000],
['20100713',40.0000],
['20100714',40.0000],
['20100715',39.7200],
['20100716',40.3000],
['20100719',39.9400],
['20100720',40.0400],
['20100721',40.2000],
['20100722',41.4000],
['20100723',41.2400],
['20100726',40.8600],
['20100727',40.0600],
['20100728',40.0000],
['20100729',39.9800],
['20100730',39.6000],
['20100802',41.6000],
['20100803',41.0800],
['20100804',40.2800],
['20100805',41.1000],
['20100806',40.9600],
['20100810',41.1200],
['20100811',40.9000],
['20100812',41.1200],
['20100813',40.4000],
['20100816',40.2200],
['20100817',40.6000],
['20100818',40.4000],
['20100819',41.7400],
['20100820',42.6200],
['20100823',43.0000],
['20100824',43.5800],
['20100825',42.8200],
['20100826',43.1800],
['20100827',43.0000],
['20100830',44.0000],
['20100831',43.4000],
['20100901',43.1600],
['20100902',42.8200],
['20100903',43.4400],
['20100906',43.8000],
['20100907',43.3000],
['20100908',42.9600],
['20100909',42.8200],
['20100913',43.5400],
['20100914',43.8000],
['20100915',44.0600],
['20100916',44.1600],
['20100917',45.7000],
['20100920',46.3000],
['20100921',46.8400],
['20100922',46.9000],
['20100923',45.3200],
['20100924',45.3800],
['20100927',45.7000],
['20100928',45.5600],
['20100929',45.1000],
['20100930',45.1400],
['20101001',45.8000],
['20101004',46.5400],
['20101005',46.7000],
['20101006',47.1600],
['20101007',47.4000],
['20101008',47.4000],
['20101011',47.7000],
['20101012',47.6600],
['20101013',47.7000],
['20101014',47.3200],
['20101015',45.7400],
['20101018',44.6600],
['20101019',45.0200],
['20101020',45.3600],
['20101021',44.4000],
['20101022',44.9000],
['20101025',44.0600],
['20101026',44.9200],
['20101027',43.5800],
['20101028',44.0000],
['20101029',45.0000],
['20101101',46.0000],
['20101102',46.4400],
['20101103',47.5200],
['20101104',46.9600],
['20101108',48.0000],
['20101109',48.1000],
['20101110',49.5600],
['20101111',48.2200],
['20101112',48.2200],
['20101115',46.8200],
['20101116',47.0000],
['20101118',47.2800],
['20101119',47.4000],
['20101122',46.6000],
['20101123',45.3000],
['20101124',45.5000],
['20101125',45.5000],
['20101126',45.4000],
['20101129',45.4200],
['20101130',43.2400],
['20101201',44.6800],
['20101202',45.2000],
['20101203',44.7400],
['20101206',46.0000],
['20101207',44.9000],
['20101208',44.6200],
['20101209',44.8400],
['20101210',44.5000],
['20101213',44.5000],
['20101214',44.1000],
['20101215',43.8000],
['20101216',43.1800],
['20101217',43.5000],
['20101220',43.3600],
['20101221',43.2800],
['20101222',44.0600],
['20101223',44.3800],
['20101224',44.8000],
['20101227',44.5200],
['20101228',44.7800],
['20101229',44.4000],
['20101230',44.6200],
['20101231',44.0000],
['20110103',46.2000],
['20110104',47.5000],
['20110105',47.5000],
['20110106',47.5000],
['20110107',45.0000],
['20110110',45.1000],
['20110111',45.1000],
['20110112',45.0000],
['20110113',45.1000],
['20110114',46.4000],
['20110117',46.7600],
['20110118',45.7800],
['20110119',45.0000],
['20110120',45.5000],
['20110121',44.2000],
['20110124',45.0600],
['20110125',45.0000],
['20110126',45.0000],
['20110127',45.4000],
['20110128',47.0000],
['20110131',46.6200],
['20110201',46.9400],
['20110202',47.0000],
['20110207',45.8000],
['20110208',46.3400],
['20110209',46.3200],
['20110210',45.6600],
['20110211',44.9800],
['20110214',44.8000],
['20110215',44.6600],
['20110216',44.8200],
['20110217',44.8400],
['20110218',45.3800],
['20110221',45.8000],
['20110222',45.8600],
['20110223',45.0400],
['20110224',45.0200],
['20110225',45.0400],
['20110228',46.2000],
['20110301',46.8200],
['20110302',46.9200],
['20110303',47.3000],
['20110304',48.0000],
['20110307',47.0000],
['20110308',46.7000],
['20110309',46.8200],
['20110310',46.8000],
['20110311',46.8800],
['20110314',45.9200],
['20110315',45.0000],
['20110316',45.2000],
['20110317',46.0000],
['20110318',43.6000],
['20110321',43.8000],
['20110322',43.9800],
['20110323',43.5600],
['20110324',44.1200],
['20110325',44.1400],
['20110328',43.7800],
['20110329',43.5800],
['20110330',43.8800],
['20110331',44.5400],
['20110401',43.8200],
['20110404',44.5200],
['20110405',45.9000],
['20110406',46.3000],
['20110407',46.2800],
['20110408',45.8000],
['20110411',45.8000],
['20110412',45.8600],
['20110413',45.8800],
['20110414',45.2200],
['20110415',45.8800],
['20110418',46.5000],
['20110419',45.8800],
['20110420',47.1600],
['20110421',47.9200],
['20110425',48.0000],
['20110426',46.5400],
['20110427',46.6200],
['20110428',47.0000],
['20110429',48.0000],
['20110503',49.0800],
['20110504',48.0000],
['20110505',48.1000],
['20110506',47.9400],
['20110509',49.5000],
['20110510',49.4000],
['20110511',50.6600],
['20110512',51.0000],
['20110513',49.4600],
['20110516',49.4200],
['20110518',48.6200],
['20110519',50.8400],
['20110520',51.5600],
['20110523',51.7400],
['20110524',50.9000],
['20110525',51.4200],
['20110526',51.2000],
['20110527',50.9200],
['20110530',52.2400],
['20110531',52.4000],
['20110601',54.2600],
['20110602',54.3000],
['20110603',52.2000],
['20110606',53.3600],
['20110607',53.0000],
['20110608',51.8000],
['20110609',51.9600],
['20110610',51.7600],
['20110613',51.5000],
['20110614',51.3800],
['20110615',51.8000],
['20110616',51.5600],
['20110617',52.6600],
['20110620',53.2200],
['20110621',54.1000],
['20110622',54.7000],
['20110623',54.4000],
['20110624',54.4000],
['20110627',54.1000],
['20110628',53.8000],
['20110629',54.8800],
['20110630',57.3400],
['20110701',56.0200],
['20110704',55.3700],
['20110705',54.8500],
['20110706',55.8000],
['20110707',55.1400],
['20110708',56.0000],
['20110711',54.5600],
['20110712',53.4000],
['20110713',53.3400],
['20110714',54.7000],
['20110715',54.5000],
['20110718',54.5600],
['20110719',55.7100],
['20110720',56.0000],
['20110721',55.5000],
['20110722',58.4800],
['20110725',57.9500],
['20110726',58.0000],
['20110727',57.7000],
['20110728',59.0000],
['20110729',57.3100],
['20110801',56.2000],
['20110802',54.8300],
['20110803',54.0000],
['20110804',53.5600],
['20110805',53.2100],
['20110808',51.3000],
['20110810',52.7000],
['20110811',52.0000],
['20110812',51.3000],
['20110815',50.5100],
['20110816',51.5800],
['20110817',50.7200],
['20110818',51.5300],
['20110819',49.0700],
['20110822',48.4700],
['20110823',49.5500],
['20110824',50.0000],
['20110825',52.1500],
['20110826',51.3000],
['20110829',52.3300],
['20110831',55.4000],
['20110901',54.1800],
['20110902',54.0000],
['20110905',51.7600],
['20110906',50.7100],
['20110907',51.0000],
['20110908',52.8200],
['20110909',52.8000],
['20110912',50.7800],
['20110913',49.7500],
['20110914',49.2100],
['20110915',49.9000],
['20110916',50.2600],
['20110919',50.4000],
['20110920',49.7600],
['20110921',49.7500],
['20110922',47.7600],
['20110923',45.5900],
['20110926',45.2000],
['20110927',46.9800],
['20110928',47.2800],
['20110929',46.9500],
['20110930',45.9000],
['20111003',44.1000],
['20111004',42.9200],
['20111005',44.0000],
['20111006',45.4800],
['20111007',47.1200],
['20111010',47.3700],
['20111011',47.1000],
['20111012',47.5000],
['20111013',48.6000],
['20111014',50.1000],
['20111017',51.2000],
['20111018',50.8000],
['20111019',49.0100],
['20111020',49.9500],
['20111021',49.7600],
['20111024',50.5000],
['20111025',49.0000],
['20111027',49.0200],
['20111028',52.3200],
['20111031',50.7800],
['20111101',49.6600],
['20111102',50.4200],
['20111103',50.1800],
['20111104',51.6100],
['20111108',53.7500],
['20111109',53.4700],
['20111110',52.8500],
['20111111',52.8900],
['20111114',50.5000],
['20111115',51.0000],
['20111116',50.8900],
['20111117',50.8700],
['20111118',49.7000],
['20111121',49.6800],
['20111122',50.3500],
['20111123',48.9800],
['20111124',49.1500],
['20111125',48.9600],
['20111128',49.5700],
['20111129',49.5500],
['20111130',49.4800],
['20111201',49.7400],
['20111202',48.5000],
['20111205',48.1900],
['20111206',48.1000],
['20111207',49.8500],
['20111208',50.0000],
['20111209',48.9100],
['20111212',48.9700],
['20111213',47.5100],
['20111214',46.9300],
['20111215',46.2500],
['20111216',46.0900],
['20111219',45.5200],
['20111220',45.1400],
['20111221',47.1800],
['20111222',47.1400],
['20111223',46.9600],
['20111227',47.0000],
['20111228',47.3200],
['20111229',47.8500],
['20111230',47.0500],
['20120103',47.2800],
['20120104',47.5500],
['20120105',49.2700],
['20120106',48.8500],
['20120109',48.2200],
['20120110',48.1400],
['20120111',49.2700],
['20120112',49.2000],
['20120113',49.3800],
['20120116',49.6900],
['20120117',51.2700],
['20120118',52.0000],
['20120119',52.0000],
['20120120',52.0000],
['20120125',52.9900],
['20120126',53.2000],
['20120127',52.7800],
['20120130',52.0000],
['20120131',51.8000],
['20120201',52.2100],
['20120202',52.3000],
['20120203',52.4000],
['20120206',53.6700],
['20120207',54.0000],
['20120208',53.2200],
['20120209',52.7700],
['20120210',51.5000],
['20120213',51.0200],
['20120214',51.8800],
['20120215',51.2800],
['20120216',50.5300],
['20120217',53.0000],
['20120220',52.4000],
['20120221',52.0000],
['20120222',50.6900],
['20120223',48.6000],
['20120224',49.5000],
['20120227',48.3700],
['20120228',49.0000],
['20120229',51.0000],
['20120301',50.5200],
['20120302',50.4000],
['20120305',51.9000],
['20120306',50.6000],
['20120307',50.4300],
['20120308',50.9800],
['20120309',51.8700],
['20120312',51.3400],
['20120313',52.9600],
['20120314',53.0000],
['20120315',52.9500],
['20120316',51.2000],
['20120319',50.7700],
['20120320',51.6000],
['20120321',51.3100],
['20120322',49.8500],
['20120323',49.8400],
['20120326',49.9900],
['20120327',49.9700],
['20120328',50.0000],
['20120329',49.7000],
['20120330',50.0000],
['20120402',50.4100],
['20120403',51.2500],
['20120404',51.5000],
['20120405',51.8000],
['20120409',51.0000],
['20120410',51.9400],
['20120411',51.1200],
['20120412',51.8400],
['20120413',52.1200],
['20120416',51.8500],
['20120417',51.5100],
['20120418',51.8200],
['20120419',51.6900],
['20120420',50.5500],
['20120423',49.9600],
['20120424',50.0000],
['20120425',49.8000],
['20120426',50.0000],
['20120427',49.7500],
['20120430',49.6500],
['20120502',50.2100],
['20120503',49.5000],
['20120504',49.7500],
['20120507',49.2500],
['20120508',49.0000],
['20120509',48.5000],
['20120510',48.4800],
['20120511',48.4000],
['20120514',49.6600],
['20120515',50.0000],
['20120516',50.1000],
['20120517',49.7000],
['20120518',49.5000],
['20120521',49.8800],
['20120522',50.0900],
['20120523',50.0600],
['20120524',50.0400],
['20120525',49.0800],
['20120528',49.8200],
['20120529',49.5300],
['20120530',49.3000],
['20120531',48.4000],
['20120601',47.8000],
['20120604',47.4500],
['20120605',47.5000],
['20120606',48.8500],
['20120607',48.7900],
['20120608',48.4400],
['20120611',50.0000],
['20120612',48.9100],
['20120613',47.9800],
['20120614',48.0000],
['20120615',48.2000],
['20120618',48.3400],
['20120619',48.3500],
['20120620',48.1000],
['20120621',47.7500],
['20120622',49.7900],
['20120625',48.6400],
['20120626',48.4600],
['20120627',48.3500],
['20120628',48.3800],
['20120629',48.4000],
['20120702',50.3500],
['20120703',50.7500],
['20120704',50.6000],
['20120705',51.2800],
['20120706',51.0000],
['20120709',50.5800],
['20120710',51.7600],
['20120711',53.1500],
['20120712',53.8800],
['20120713',52.7600],
['20120716',52.0800],
['20120717',52.9900],
['20120718',53.0000],
['20120719',52.1500],
['20120720',51.3200],
['20120723',51.6900],
['20120724',51.7000],
['20120725',51.2000],
['20120726',52.9900],
['20120727',51.7000],
['20120730',52.3500],
['20120731',52.3500],
['20120801',51.7400],
['20120802',51.6000],
['20120803',53.4000],
['20120806',56.1600],
['20120807',56.3800],
['20120808',53.7000],
['20120810',54.2500],
['20120813',54.0000],
['20120814',54.0800],
['20120815',53.6500],
['20120816',53.8700],
['20120817',53.6500],
['20120821',54.1000],
['20120822',53.6500],
['20120823',54.5700],
['20120824',54.8500],
['20120827',54.9000],
['20120828',54.3800],
['20120829',53.5000],
['20120830',53.6800],
['20120831',53.8200],
['20120903',54.0000],
['20120904',54.1900],
['20120905',54.6000],
['20120906',54.2900],
['20120907',53.6500],
['20120910',53.8000],
['20120911',54.2000],
['20120912',53.8000],
['20120913',53.3800],
['20120914',54.5000],
['20120917',54.3000],
['20120918',54.7200],
['20120919',55.7100],
['20120920',55.5800],
['20120921',55.3000],
['20120924',56.8000],
['20120925',55.6500],
['20120926',55.7500],
['20120927',57.0000],
['20120928',56.9000],
['20121001',56.2000],
['20121002',58.2500],
['20121003',60.0000],
['20121004',59.5400],
['20121005',62.0000],
['20121008',60.2100],
['20121009',59.5000],
['20121010',57.6000],
['20121011',59.5800],
['20121012',61.1800],
['20121015',59.9700],
['20121016',59.0300],
['20121017',58.1200],
['20121018',58.9200],
['20121019',58.8000],
['20121022',59.4000],
['20121023',61.5000],
['20121024',61.7000],
['20121025',61.7000],
['20121029',61.0400],
['20121030',62.4000],
['20121031',61.6000],
['20121101',61.2800],
['20121102',61.0100],
['20121105',60.0600],
['20121106',59.8000],
['20121107',60.1100],
['20121108',59.1000],
['20121109',59.5900],
['20121112',58.9400],
['20121114',58.3000],
['20121115',58.5800],
['20121116',58.8400],
['20121119',58.8200],
['20121120',58.1300],
['20121121',58.3000],
['20121122',58.0000],
['20121123',57.9900],
['20121126',59.3600],
['20121127',59.3700],
['20121128',57.6500],
['20121129',58.0000],
['20121130',59.0200],
['20121203',60.9700],
['20121204',60.0400],
['20121205',60.0000],
['20121206',59.7500],
['20121207',59.1200],
['20121210',60.0000],
['20121211',60.5200],
['20121212',60.6500],
['20121213',62.0000],
['20121214',62.1000],
['20121217',61.8000],
['20121218',61.0000],
['20121219',59.8100],
['20121220',60.9900],
['20121221',61.7500],
['20121224',62.8600],
['20121226',63.0000],
['20121227',63.5500],
['20121228',63.6000],
['20121231',62.0000],
['20130102',62.3200],
['20130103',63.3000],
['20130104',63.5000],
['20130107',64.3600],
['20130108',64.0000],
['20130109',63.2700],
['20130110',62.1900],
['20130111',60.9000],
['20130114',62.8000],
['20130115',61.9500],
['20130116',61.9100],
['20130117',61.0300],
['20130118',62.0000],
['20130121',62.6500],
['20130122',63.5000],
['20130123',63.5000],
['20130124',64.0000],
['20130125',65.9000],
['20130128',65.0000],
['20130129',63.7000],
['20130130',64.7000],
['20130131',64.8100],
['20130201',64.4100],
['20130204',63.6300],
['20130205',61.5700],
['20130206',61.9300],
['20130207',60.6200],
['20130208',61.3000],
['20130213',62.5000],
['20130214',62.9000],
['20130215',62.8800],
['20130218',63.4900],
['20130219',63.2000],
['20130220',63.0000],
['20130221',62.6000],
['20130222',63.5000],
['20130225',63.7500],
['20130226',64.1900],
['20130227',64.1300],
['20130228',63.3200],
['20130301',65.5100],
['20130304',63.6900],
['20130305',62.8000],
['20130306',64.3000],
['20130307',66.5800],
['20130308',66.9800],
['20130311',67.0000],
['20130312',65.4000],
['20130313',64.5000],
['20130314',63.2300],
['20130315',64.5000],
['20130318',64.5600],
['20130319',64.7300],
['20130320',64.0000],
['20130321',64.5000],
['20130322',64.0700],
['20130325',63.7700],
['20130326',63.7700],
['20130327',64.1800],
['20130328',65.1000],
['20130401',66.4800],
['20130402',65.8400],
['20130403',65.7600],
['20130404',65.5100],
['20130405',66.8800],
['20130408',66.6500],
['20130409',65.3900],
['20130410',64.6500],
['20130411',65.0500],
['20130412',64.8100],
['20130415',65.9800],
['20130416',66.4900],
['20130417',66.5000],
['20130418',64.9500],
['20130419',65.0000],
['20130422',67.7900],
['20130423',68.0000],
['20130424',67.2900],
['20130425',65.5200],
['20130426',65.7600],
['20130429',65.4900],
['20130430',64.9300],
['20130502',65.0000],
['20130503',65.2000],
['20130506',65.3000],
['20130507',65.2200],
['20130508',67.4900],
['20130509',68.3500],
['20130510',68.3000],
['20130513',68.1000],
['20130514',66.7500],
['20130515',66.7000],
['20130516',68.9400],
['20130517',67.6200],
['20130520',66.3000],
['20130521',67.1900],
['20130522',66.0400],
['20130523',66.1500],
['20130527',66.4000],
['20130528',66.7000],
['20130529',66.3100],
['20130530',66.5900],
['20130531',65.7000],
['20130603',65.3500],
['20130604',64.3800],
['20130605',63.5300],
['20130606',62.5500],
['20130607',62.3200],
['20130610',62.5500],
['20130611',59.4000],
['20130612',61.7000],
['20130613',60.6300],
['20130614',59.4000],
['20130617',61.0100],
['20130618',62.2000],
['20130619',62.2100],
['20130620',59.7200],
['20130621',59.1100],
['20130624',58.9700],
['20130625',57.1000],
['20130626',57.0000],
['20130627',58.8000],
['20130628',60.5000],
['20130701',61.3000],
['20130702',61.0100],
['20130703',60.0000],
['20130704',60.3100],
['20130705',60.0000],
['20130708',60.0000],
['20130709',60.1000],
['20130710',58.5000],
['20130711',59.8400],
['20130712',60.0900],
['20130715',59.5000],
['20130716',59.0100],
['20130717',58.3500],
['20130718',59.0900],
['20130719',59.1000],
['20130722',58.4500],
['20130723',58.0300],
['20130724',58.1100],
['20130725',55.9000],
['20130726',54.9500],
['20130729',56.0900],
['20130730',56.1500],
['20130731',54.7300],
['20130801',53.7000],
['20130802',52.5700],
['20130805',53.0000],
['20130806',53.9500],
['20130807',54.0000],
['20130812',54.9000],
['20130813',55.0000],
['20130814',55.3100],
['20130815',56.5000],
['20130816',56.1100],
['20130819',53.6200],
['20130820',53.4000],
['20130821',54.1800],
['20130822',54.9800],
['20130823',55.6300],
['20130826',55.1000],
['20130827',52.2500],
['20130828',52.0000],
['20130829',52.5300],
['20130830',53.1200],
['20130902',53.0000],
['20130903',53.0000],
['20130904',53.0300],
['20130905',53.0000],
['20130906',53.0000],
['20130909',53.9900],
['20130910',57.0000],
['20130911',54.4600],
['20130912',54.0000],
['20130913',53.4000],
['20130916',55.3000],
['20130917',55.5500],
['20130918',56.6000],
['20130919',60.4400],
['20130920',58.0000],
['20130923',55.9000],
['20130924',56.6100],
['20130925',55.5000],
['20130926',55.0500],
['20130927',56.3000],
['20130930',54.9000],
['20131001',55.4900],
['20131002',53.6100],
['20131003',53.5000],
['20131004',53.9000],
['20131007',54.1300],
['20131008',54.4000],
['20131009',54.9300],
['20131010',55.6700],
['20131011',56.0800],
['20131014',54.7500],
['20131016',54.6300],
['20131017',55.4800],
['20131018',55.6200],
['20131021',54.0000],
['20131022',54.3000],
['20131023',54.7500],
['20131024',54.5900],
['20131025',55.1600],
['20131028',55.6800],
['20131029',54.5000],
['20131030',54.8000],
['20131031',54.4900],
['20131101',54.1500],
['20131104',54.5600],
['20131105',54.1600],
['20131106',53.5000],
['20131107',53.2600],
['20131108',52.4100],
['20131111',52.6500],
['20131112',52.2200],
['20131113',52.0900],
['20131114',52.4900],
['20131115',52.2900],
['20131118',53.0000],
['20131119',53.8800],
['20131120',53.5000],
['20131121',53.0400],
['20131122',52.0600],
['20131125',52.0600],
['20131126',51.0200],
['20131127',50.4000],
['20131128',50.8700],
['20131129',50.5200],
['20131202',52.1500],
['20131203',54.4000],
['20131204',53.5000],
['20131205',52.5400],
['20131206',51.6000],
['20131209',51.7900],
['20131210',51.8600],
['20131211',51.9100],
['20131212',50.6000],
['20131213',51.3900],
['20131216',51.1000],
['20131217',51.4400],
['20131218',51.2200],
['20131219',51.7300],
['20131220',51.5000],
['20131223',52.1200],
['20131224',51.6000],
['20131226',51.5100],
['20131227',51.9300],
['20131230',52.1000],
['20131231',52.3100],
['20140102',53.8400],
['20140103',53.1300],
['20140106',52.3400],
['20140107',53.0200],
['20140108',53.6600],
['20140109',53.8500],
['20140110',53.6100],
['20140113',54.1000],
['20140114',54.4900],
['20140115',55.8700],
['20140116',55.8100],
['20140117',56.9200],
['20140120',55.2000],
['20140121',56.1700],
['20140122',55.7000],
['20140123',54.5500],
['20140124',55.0000],
['20140127',53.1100],
['20140128',53.9700],
['20140129',53.7900],
['20140130',53.5800],
['20140203',52.3500],
['20140204',52.0000],
['20140205',52.0000],
['20140206',52.3500],
['20140207',52.9500],
['20140210',52.7000],
['20140211',53.0100],
['20140212',54.0000],
['20140213',53.5600],
['20140214',54.0600],
['20140217',54.7500],
['20140218',55.0000],
['20140219',55.8700],
['20140220',54.9400],
['20140221',56.0000],
['20140224',56.3000],
['20140225',55.9500],
['20140226',55.5000],
['20140227',55.3000],
['20140228',58.1000],
['20140303',57.7100],
['20140304',58.0000],
['20140305',60.0000],
['20140306',59.1000],
['20140307',59.9900],
['20140310',60.2800],
['20140311',60.0000],
['20140312',59.0400],
['20140313',58.4800],
['20140314',59.0100],
['20140317',59.6100],
['20140318',59.9000],
['20140319',58.9000],
['20140320',57.7000],
['20140321',55.5200],
['20140324',58.2800],
['20140325',57.9700],
['20140326',60.2600],
['20140327',61.8600],
['20140328',63.1000],
['20140331',63.0800],
['20140401',64.0100],
['20140402',63.1000],
['20140403',62.3500],
['20140404',61.9000],
['20140407',61.4900],
['20140408',61.1100],
['20140409',62.5000],
['20140410',60.3000],
['20140411',60.6600],
['20140414',61.2900],
['20140415',61.8000],
['20140416',61.9500],
['20140417',61.9600],
['20140421',62.0000],
['20140422',61.9600],
['20140423',61.9000],
['20140424',62.0500],
['20140425',62.0000],
['20140428',61.6300],
['20140429',61.4400],
['20140430',62.3000],
['20140502',61.4600],
['20140505',61.4600],
['20140506',61.8200],
['20140507',61.7500],
['20140508',61.0000],
['20140509',61.3000],
['20140512',60.0000],
['20140514',61.4200],
['20140515',61.5900],
['20140516',61.4000],
['20140519',60.6000],
['20140520',60.2000],
['20140521',59.5900],
['20140522',60.9000],
['20140523',61.0100],
['20140526',61.3700],
['20140527',61.5000],
['20140528',61.3100],
['20140529',61.5500],
['20140530',61.5000],
['20140602',61.5000],
['20140603',61.3600],
['20140604',59.8800],
['20140605',59.4100],
['20140606',60.3200],
['20140609',60.8000],
['20140610',60.0000],
['20140611',60.6600],
['20140612',60.5700],
['20140613',61.2100],
['20140616',61.5900],
['20140617',61.1500],
['20140618',60.2500],
['20140619',61.0300],
['20140620',61.0000],
['20140623',60.1800],
['20140624',60.2300],
['20140625',59.7600],
['20140626',60.7700],
['20140627',60.0000],
['20140630',59.3100],
['20140701',59.6800],
['20140702',60.0000],
['20140703',60.0600],
['20140704',59.5000],
['20140707',60.7000],
['20140708',60.7400],
['20140709',60.7000],
['20140710',60.5800],
['20140711',60.5000],
['20140714',59.8600],
['20140715',59.2200],
['20140716',59.6200],
['20140717',60.1000],
['20140718',59.7400],
['20140721',59.8200],
['20140722',59.9100],
['20140723',59.9000],
['20140724',60.0000],
['20140725',59.3400],
['20140729',59.9000],
['20140730',59.5800],
['20140731',59.9700],
['20140801',59.0400],
['20140804',59.5500],
['20140805',59.0400],
['20140806',59.1000],
['20140807',58.5200],
['20140808',58.3300],
['20140811',58.3100],
['20140812',58.5200],
['20140813',58.3300],
['20140814',58.3500],
['20140815',60.0000],
['20140818',61.0400],
['20140819',60.7100],
['20140820',60.0000],
['20140821',59.0000],
['20140822',59.8000],
['20140825',60.2400],
['20140826',59.7600],
['20140827',60.3400],
['20140828',60.8000],
['20140829',60.2600],
['20140901',60.0300],
['20140902',60.5500],
['20140903',62.4100],
['20140904',63.0900],
['20140905',62.7000],
['20140908',62.2800],
['20140909',62.8000],
['20140910',62.2000],
['20140911',62.6000],
['20140912',62.0300],
['20140915',61.9200],
['20140916',61.7300],
['20140917',61.9700],
['20140918',62.2000],
['20140919',62.4000],
['20140922',62.0700],
['20140923',61.4500],
['20140924',60.3000],
['20140925',60.3500],
['20140926',59.9600],
['20140929',59.1400],
['20140930',59.6000],
['20141001',59.1800],
['20141002',57.6000],
['20141003',58.8100],
['20141007',58.7500],
['20141008',57.9100],
['20141009',59.0100],
['20141010',58.2000],
['20141013',58.1900],
['20141014',58.4300],
['20141015',57.9400],
['20141016',57.5000],
['20141017',58.0000],
['20141020',58.6700],
['20141021',58.6700],
['20141023',59.6400],
['20141024',59.4000],
['20141027',59.6200],
['20141028',59.5600],
['20141029',60.4100],
['20141030',60.3000],
['20141031',59.9000],
['20141103',59.3500],
['20141104',59.5000],
['20141105',59.7800],
['20141106',59.8500],
['20141107',58.6500],
['20141110',58.5000],
['20141111',59.3500],
['20141112',59.9000],
['20141113',60.0500],
['20141114',59.4000],
['20141117',60.0000],
['20141118',60.7900],
['20141119',60.7100],
['20141120',61.2200],
['20141121',62.1800],
['20141124',61.8000],
['20141125',60.7800],
['20141126',61.1000],
['20141127',62.0000],
['20141128',62.2300],
['20141201',62.4000],
['20141202',62.0500],
['20141203',62.0500],
['20141204',61.6600],
['20141205',61.7000],
['20141208',60.1800],
['20141209',59.0000],
['20141210',58.4000],
['20141211',57.9900],
['20141212',58.1500],
['20141215',57.8000],
['20141216',57.6400],
['20141217',57.5100],
['20141218',58.3000],
['20141219',59.0000],
['20141222',59.7100],
['20141223',60.0500],
['20141224',60.0000],
['20141226',60.1900],
['20141229',60.3000],
['20141230',60.4000],
['20141231',60.9500],
['20150102',61.1200],
['20150105',60.6500],
['20150106',59.8300],
['20150107',59.3400],
['20150108',59.5500],
['20150109',61.0000],
['20150112',62.3200],
['20150113',62.9900],
['20150114',62.6400],
['20150115',62.7000],
['20150116',62.5000],
['20150119',63.0000],
['20150120',63.5000],
['20150121',63.6800],
['20150122',63.6800],
['20150123',65.0500],
['20150126',64.7400],
['20150127',67.2200],
['20150128',65.4400],
['20150129',65.3000],
['20150130',64.0700],
['20150202',64.8000],
['20150203',64.1800],
['20150204',63.7300],
['20150205',64.0900],
['20150206',64.9000],
['20150209',64.9000],
['20150210',66.2300],
['20150211',66.1600],
['20150212',66.0000],
['20150213',66.0000],
['20150216',66.0000],
['20150217',66.3900],
['20150218',66.5000],
['20150223',65.5000],
['20150224',64.3900],
['20150225',66.1000],
['20150226',65.2000],
['20150227',64.5000],
['20150302',64.5400],
['20150303',65.9900],
['20150304',65.6400],
['20150305',64.5400],
['20150306',65.7000],
['20150309',65.8200],
['20150310',65.0000],
['20150311',64.3800],
['20150312',63.3500],
['20150313',62.1200],
['20150316',62.3100],
['20150317',63.3500],
['20150318',62.9400],
['20150319',62.5000],
['20150320',62.9000],
['20150323',62.3500],
['20150324',62.7100],
['20150325',62.6800],
['20150326',63.0700],
['20150327',63.2200],
['20150330',63.0600],
['20150331',63.2000],
['20150401',62.9600],
['20150402',62.7000],
['20150406',62.5000],
['20150407',62.8200],
['20150408',61.9900],
['20150409',61.9600],
['20150410',62.1300],
['20150413',62.1100],
['20150414',61.7100],
['20150415',62.3800],
['20150416',62.6200],
['20150417',61.7600],
['20150420',61.0700],
['20150421',62.1100],
['20150422',62.1800],
['20150423',61.6000],
['20150424',61.4800],
['20150427',61.7200],
['20150428',61.4000],
['20150429',61.2400],
['20150430',61.9400],
['20150504',62.0000],
['20150505',61.5600],
['20150506',61.5300],
['20150507',60.6000],
['20150508',61.9000],
['20150511',62.2100],
['20150512',61.5000],
['20150513',62.2000],
['20150514',62.5000],
['20150515',62.5000],
['20150518',61.5300],
['20150519',60.8800],
['20150520',60.3000],
['20150521',60.0500],
['20150522',61.0000],
['20150525',61.5200],
['20150526',61.0100],
['20150527',62.0000],
['20150528',62.7200],
['20150529',61.4700],
['20150602',60.4300],
['20150603',60.0500],
['20150604',60.2100],
['20150605',60.0600],
['20150608',60.0000],
['20150609',57.5400],
['20150610',58.6400],
['20150611',58.7000],
['20150612',57.9000],
['20150615',57.1000],
['20150616',55.0000],
['20150617',56.1200],
['20150618',56.0100],
['20150619',56.0000],
['20150622',55.5000],
['20150623',56.4800],
['20150624',57.4600],
['20150625',56.8900],
['20150626',56.5300],
['20150629',55.3000],
['20150630',56.7500],
['20150701',56.6800],
['20150702',56.5700],
['20150703',55.9600],
['20150706',55.8500],
['20150707',55.4500],
['20150708',53.1000],
['20150709',53.8900],
['20150710',53.8700],
['20150713',53.9900],
['20150714',54.1000],
['20150715',56.4800],
['20150716',55.8200],
['20150720',56.2200],
['20150721',55.8800],
['20150722',56.4200],
['20150723',56.0000],
['20150724',55.1700],
['20150727',55.0500],
['20150728',55.0000],
['20150729',55.0000],
['20150730',54.9800],
['20150731',54.2600],
['20150803',54.0500],
['20150804',51.5900],
['20150805',52.0000],
['20150806',52.7800],
['20150811',53.5100],
['20150812',52.5900],
['20150813',52.4900],
['20150814',52.8200],
['20150817',52.6000],
['20150818',52.0000],
['20150819',52.0000],
['20150820',51.8000],
['20150821',51.1300],
['20150824',48.5700],
['20150825',47.4000],
['20150826',46.5100],
['20150827',48.7500],
['20150828',50.7400],
['20150831',49.9400],
['20150901',49.6800],
['20150902',49.4300],
['20150903',50.3200],
['20150904',49.2000],
['20150907',48.7200],
['20150908',48.9200],
['20150909',48.0000],
['20150910',48.7000],
['20150914',47.2500],
['20150915',46.2100],
['20150916',47.1200],
['20150917',47.5400],
['20150918',47.0000],
['20150921',47.0000],
['20150922',47.6000],
['20150923',47.3300],
['20150925',48.2600],
['20150928',47.5000],
['20150929',47.0000],
['20150930',47.2500],
['20151001',47.0100],
['20151002',46.9300],
['20151005',47.3000],
['20151006',49.4000],
['20151007',50.8500],
['20151008',50.6500],
['20151009',51.8500],
['20151012',51.3500],
['20151013',51.7500],
['20151014',52.1000],
['20151015',53.7000],
['20151016',54.0000],
['20151019',53.4300],
['20151020',53.0000],
['20151021',53.5200],
['20151022',53.0100],
['20151023',53.2600],
['20151026',54.0000],
['20151027',53.5400],
['20151028',54.1000],
['20151029',53.0400],
['20151030',54.5900],
['20151102',53.1500],
['20151103',53.0100],
['20151104',55.0100],
['20151105',53.4200],
['20151106',53.9700],
['20151109',53.7800],
['20151111',52.9300],
['20151112',51.5100],
['20151113',50.1500],
['20151116',50.5000],
['20151117',51.7400],
['20151118',51.1300],
['20151119',51.0300],
['20151120',50.6300],
['20151123',50.9200],
['20151124',50.9100],
['20151125',49.9200],
['20151126',49.2700],
['20151127',49.4500],
['20151130',49.9000],
['20151201',50.2000],
['20151202',50.2000],
['20151203',49.8400],
['20151204',49.7400],
['20151207',50.4000],
['20151208',49.6000],
['20151209',49.4000],
['20151210',48.6100],
['20151211',47.1700],
['20151214',46.4000],
['20151215',46.0200],
['20151216',46.8800],
['20151217',46.0300],
['20151218',47.4000],
['20151221',47.6800],
['20151222',48.0000],
['20151223',47.9300],
['20151224',47.4800],
['20151228',47.6800],
['20151229',47.9000],
['20151230',49.2100],
['20151231',48.7300],
['20160104',48.7300],
['20160105',49.0300],
['20160106',48.6100],
['20160107',49.0800],
['20160108',48.0300],
['20160111',48.1500],
['20160112',48.7600],
['20160113',51.0600],
['20160114',51.0000],
['20160115',52.9000],
['20160118',51.5000],
['20160119',51.7200],
['20160120',51.0000],
['20160121',50.4000],
['20160122',51.0000],
['20160125',51.2000],
['20160126',50.9500],
['20160127',51.0400],
['20160128',51.1900],
['20160129',52.5000],
['20160201',52.7000],
['20160202',53.1000],
['20160203',52.9000],
['20160204',52.2000],
['20160205',53.7000],
['20160210',54.0200],
['20160211',53.9800],
['20160212',53.2300],
['20160215',54.5000],
['20160216',55.8400],
['20160217',55.9000],
['20160218',56.0000],
['20160219',56.6000],
['20160222',57.1500],
['20160223',57.6000],
['20160224',57.7500],
['20160225',56.5000],
['20160226',56.5000],
['20160229',58.2200],
['20160301',57.0200],
['20160302',57.0200],
['20160303',57.7200],
['20160304',56.4900],
['20160307',54.4000],
['20160308',53.8900],
['20160309',53.2200],
['20160310',54.0000],
['20160311',54.1400],
['20160314',54.4100],
['20160315',54.3800],
['20160316',53.7600],
['20160317',54.7900],
['20160318',57.0000],
['20160321',56.6800],
['20160322',57.4000],
['20160323',57.3400],
['20160324',56.9500],
['20160328',56.4000],
['20160329',56.1200],
['20160330',56.2200],
['20160331',57.0800],
['20160401',56.2800],
['20160404',55.8500],
['20160405',57.0000],
['20160406',56.9500],
['20160407',59.2800],
['20160408',58.0300],
['20160411',58.4400],
['20160412',58.6200],
['20160413',58.0200],
['20160414',58.1800],
['20160415',58.2000],
['20160418',58.5000],
['20160419',58.4900],
['20160420',58.0800],
['20160421',60.9400],
['20160422',60.0000],
['20160425',58.1400],
['20160426',57.1000],
['20160427',56.4000],
['20160428',55.5500],
['20160429',55.3000],
['20160503',55.2000],
['20160504',55.0200],
['20160505',55.7000],
['20160506',54.7500],
['20160509',55.5800],
['20160510',55.0000],
['20160511',53.3000],
['20160512',53.3300],
['20160513',54.3400],
['20160516',53.8800],
['20160517',54.0000],
['20160518',54.6500],
['20160519',53.7800],
['20160520',53.6700],
['20160523',53.4800],
['20160524',53.4000],
['20160525',54.0900],
['20160526',54.2800],
['20160527',55.5000],
['20160530',56.0000],
['20160531',57.0000],
['20160601',56.6500],
['20160602',55.8500],
['20160603',54.9500],
['20160606',55.3900],
['20160607',56.3800],
['20160608',55.4800],
['20160609',55.4200],
['20160610',56.0000],
['20160613',55.5000],
['20160614',54.5500],
['20160615',54.6200],
['20160616',55.0000],
['20160617',55.3600],
['20160620',55.5000],
['20160621',55.9900],
['20160622',56.2300],
['20160623',55.9700],
['20160624',54.3000],
['20160627',54.5700],
['20160628',56.6500],
['20160629',57.0000],
['20160630',58.3100],
['20160701',58.0200],
['20160704',57.8400],
['20160705',57.6000],
['20160707',57.4900],
['20160708',57.4400],
['20160711',57.7000],
['20160712',58.0000],
['20160713',58.6800],
['20160714',57.6200],
['20160715',58.4400],
['20160718',58.0000],
['20160719',58.1900],
['20160720',59.2800],
['20160721',57.5000],
['20160722',57.5400],
['20160725',57.8900],
['20160726',57.5400],
['20160727',58.0000],
['20160728',58.6000],
['20160729',59.3000],
['20160801',57.8000],
['20160802',58.0000],
['20160803',57.7200],
['20160804',57.9200],
['20160805',57.6200],
['20160808',57.7600],
['20160810',57.8000],
['20160811',58.9000],
['20160812',60.2000],
['20160815',60.4900],
['20160816',59.5500],
['20160817',60.1800],
['20160818',60.1000],
['20160819',60.5000],
['20160822',60.1800],
['20160823',61.6000],
['20160824',61.0000],
['20160825',60.2000],
['20160826',60.4700],
['20160829',60.0000],
['20160830',60.3400],
['20160831',59.8500],
['20160901',60.0000],
['20160902',60.6500],
['20160905',62.5000],
['20160906',62.7100],
['20160907',62.5000],
['20160908',61.9900],
['20160909',61.4600],
['20160913',61.5000],
['20160914',60.4300],
['20160915',60.6900],
['20160916',60.1400],
['20160919',60.9000],
['20160920',62.5000],
['20160921',60.6000],
['20160922',59.4500],
['20160923',60.5000],
['20160926',60.7800],
['20160927',60.5000],
['20160928',60.2500],
['20160929',60.7900],
['20160930',60.6100],
['20161003',60.8200],
['20161004',61.4300],
['20161005',61.4900],
['20161006',61.0000],
['20161007',62.0000],
['20161010',62.1100],
['20161011',61.4200],
['20161012',61.4100],
['20161013',60.7700],
['20161014',61.3900],
['20161017',61.1400],
['20161018',61.1400],
['20161019',61.6800],
['20161020',61.0000],
['20161021',60.5000],
['20161024',61.0000],
['20161025',60.9100],
['20161026',61.3000],
['20161027',60.6300],
['20161028',60.6100],
['20161031',60.9100],
['20161101',60.8100],
['20161102',60.4900],
['20161103',59.7500],
['20161104',58.9500],
['20161107',57.1800],
['20161108',58.2000],
['20161109',56.9900],
['20161110',57.7300],
['20161111',56.8000],
['20161114',55.4700],
['20161115',55.2100],
['20161116',54.5000],
['20161117',55.4700],
['20161118',56.9700],
['20161121',55.4400],
['20161122',55.7200],
['20161123',55.3000],
['20161124',54.3700],
['20161125',53.5000],
['20161128',53.1300],
['20161129',53.7700],
['20161130',54.2000],
['20161201',54.4800],
['20161202',54.7900],
['20161205',54.9400],
['20161206',54.0800],
['20161207',53.6000],
['20161208',53.5100],
['20161209',55.0000],
['20161212',54.6700],
['20161213',54.9800],
['20161214',54.3100],
['20161215',54.0000],
['20161216',55.0500],
['20161219',54.0000],
['20161220',54.2700],
['20161221',54.7700],
['20161222',55.0800],
['20161223',54.6500],
['20161227',54.6500],
['20161228',55.9000],
['20161229',56.0500],
['20161230',55.2500],
['20170103',57.1200],
['20170104',57.5000],
['20170105',59.1000],
['20170106',58.9900],
['20170109',60.0000],
['20170110',60.0000],
['20170111',59.7000],
['20170112',58.7900],
['20170113',59.7000],
['20170116',60.1500],
['20170117',59.6000],
['20170118',59.4000],
['20170119',59.5100],
['20170120',59.3000],
['20170123',60.2000],
['20170124',61.1300],
['20170125',61.0900],
['20170126',60.6500],
['20170127',61.4800],
['20170131',61.7200],
['20170201',62.6800],
['20170202',62.3400],
['20170203',62.6800],
['20170206',62.5500],
['20170207',62.4000],
['20170208',62.4500],
['20170209',62.6900],
['20170210',63.1000],
['20170213',63.9300],
['20170214',64.1000],
['20170215',64.4400],
['20170216',64.8500],
['20170217',64.9500],
['20170220',63.8600],
['20170221',63.4000],
['20170222',62.9200],
['20170223',62.9800],
['20170224',62.9500],
['20170227',62.4100],
['20170228',62.1800],
['20170301',64.1300],
['20170302',65.6000],
['20170303',65.9900],
['20170306',65.6000],
['20170307',65.9600],
['20170308',66.1700],
['20170309',66.2200],
['20170310',65.0000],
['20170313',65.1600],
['20170314',65.3300],
['20170315',64.6000],
['20170316',65.8600],
['20170317',65.4500],
['20170320',67.0000],
['20170321',66.7500],
['20170322',65.4500],
['20170323',66.3200],
['20170324',66.0000],
['20170327',65.6000],
['20170328',66.4500],
['20170329',66.1100],
['20170330',64.4000],
['20170331',64.2500],
['20170403',65.1400],
['20170404',64.8800],
['20170405',64.8400],
['20170406',66.1300],
['20170407',66.7000],
['20170410',66.7800],
['20170411',65.7000],
['20170412',65.9000],
['20170413',65.4700],
['20170417',64.6500],
['20170418',65.0000],
['20170419',64.0300],
['20170420',65.5000],
['20170421',64.8000],
['20170424',64.7100],
['20170425',64.9000],
['20170426',64.6500],
['20170427',64.7700],
['20170428',64.5300],
['20170502',65.1700],
['20170503',65.0700],
['20170504',64.9900],
['20170505',63.7500],
['20170508',63.3200],
['20170509',63.6600],
['20170511',65.4800],
['20170512',65.3100],
['20170515',65.1000],
['20170516',62.2900],
['20170517',61.9000],
['20170518',64.1700],
['20170519',63.9200],
['20170522',64.1600],
['20170523',63.9500],
['20170524',64.2000],
['20170525',64.5000],
['20170526',63.8500],
['20170529',63.6800],
['20170530',63.9800],
['20170531',63.8900],
['20170601',64.9200],
['20170602',65.2000],
['20170605',65.8900],
['20170606',66.6900],
['20170607',65.9500],
['20170608',66.6000],
['20170609',66.6000],
['20170612',66.9600],
['20170613',66.3000],
['20170614',66.2400],
['20170615',66.5700],
['20170616',65.7700],
['20170619',65.2600],
['20170620',64.1000],
['20170621',62.7900],
['20170622',64.0700],
['20170623',64.5700],
['20170627',64.9000],
['20170628',64.2400],
['20170629',64.0300],
['20170630',64.2000],
['20170703',64.0000],
['20170704',63.8600],
['20170705',64.5000],
['20170706',64.5400],
['20170707',64.9500],
['20170710',64.1000],
['20170711',63.0500],
['20170712',62.7700],
['20170713',64.0000],
['20170714',64.3500],
['20170717',63.7500],
['20170718',63.4700],
['20170719',63.2000],
['20170720',63.6100],
['20170721',63.6700],
['20170724',63.5900],
['20170725',63.5500],
['20170726',63.8200],
['20170727',63.9500],
['20170728',63.8100],
['20170731',63.8100],
['20170801',63.2400],
['20170802',62.9600],
['20170803',63.8000],
['20170804',64.0000],
['20170807',65.5100],
['20170808',66.3700],
['20170810',66.0500],
['20170811',65.7000],
['20170814',66.9300],
['20170815',66.2900],
['20170816',64.9800],
['20170817',65.5100],
['20170818',65.2000],
['20170821',65.6600],
['20170822',67.1500],
['20170823',65.7800],
['20170824',67.3800],
['20170825',67.0600],
['20170828',65.6000],
['20170829',65.4400],
['20170830',65.4500],
['20170831',65.7100],
['20170904',65.0200],
['20170905',64.3500],
['20170906',65.3300],
['20170907',66.2400],
['20170908',66.0000],
['20170911',66.0300],
['20170912',66.3900],
['20170913',65.9600],
['20170914',65.7500],
['20170915',65.6600],
['20170918',66.1900],
['20170919',65.6700],
['20170920',65.2400],
['20170921',63.6500],
['20170922',64.4000],
['20170925',63.9600],
['20170926',63.2800],
['20170927',63.1000],
['20170928',63.5400],
['20170929',63.3600],
['20171002',64.5600],
['20171003',65.0700],
['20171004',64.0700],
['20171005',64.1900],
['20171006',65.6700],
['20171009',64.7800],
['20171010',64.5300],
['20171011',65.5500],
['20171012',65.5500],
['20171013',65.9700],
['20171016',66.2500],
['20171017',66.4900],
['20171019',66.9800],
['20171020',66.0300],
['20171023',66.3100],
['20171024',66.0900],
['20171025',64.5500],
['20171026',65.0000],
['20171027',65.1200],
['20171030',64.1500],
['20171031',64.0600],
['20171101',63.8000],
['20171102',63.6600],
['20171103',64.6600],
['20171106',65.9900],
['20171107',66.8500],
['20171108',68.0000],
['20171109',65.6900],
['20171110',67.0000],
['20171113',67.0800],
['20171114',67.1100],
['20171115',65.2200],
['20171116',64.9700],
['20171117',64.9500],
['20171120',65.0500],
['20171121',65.5500],
['20171122',64.6100],
['20171123',65.1900],
['20171124',64.9400],
['20171127',64.7500],
['20171128',64.8500],
['20171129',64.7900],
['20171130',62.4800],
['20171201',63.8300],
['20171204',63.5000],
['20171205',63.5000],
['20171206',63.5000],
['20171207',62.1000],
['20171208',62.1000],
['20171211',63.4700],
['20171212',63.1200],
['20171213',63.1400],
['20171214',62.3000],
['20171215',63.0400],
['20171218',62.5900],
['20171219',61.9300],
['20171220',61.0000],
['20171221',61.0700],
['20171222',61.1900],
['20171226',60.8800],
['20171227',60.7700],
['20171228',60.9100],
['20171229',60.7500],
['20180102',60.8200],
['20180103',60.8000],
['20180104',60.2800],
['20180105',60.0800],
['20180108',60.8500],
['20180109',62.2700],
['20180110',61.0000],
['20180111',61.1300],
['20180112',62.1400],
['20180115',62.2100],
['20180116',62.0200],
['20180117',62.4600],
['20180118',62.3800],
['20180119',62.5000],
['20180122',65.5000],
['20180123',64.4900],
['20180124',64.8500],
['20180125',63.9200],
['20180126',64.6200],
['20180129',64.6200],
['20180130',63.7900],
['20180131',63.4800],
['20180201',64.2400],
['20180202',64.9200],
['20180205',64.2000],
['20180206',62.1800],
['20180207',61.8100],
['20180208',61.9100],
['20180209',61.5000],
['20180212',61.6900],
['20180213',62.0000],
['20180214',61.6700],
['20180215',61.9800],
['20180219',62.0400],
['20180220',62.5900],
['20180221',62.5100],
['20180222',61.8300],
['20180223',62.1200],
['20180226',62.5000],
['20180227',63.7500],
['20180228',65.1500],
['20180301',63.6100],
['20180302',63.2400],
['20180305',62.3700],
['20180306',63.1900],
['20180307',62.0000],
['20180308',62.8000],
['20180309',62.8100],
['20180312',64.7200],
['20180313',63.5300],
['20180314',62.9500],
['20180315',62.7800],
['20180316',62.2300],
['20180319',62.6400],
['20180320',62.6400],
['20180321',61.5000],
['20180322',61.6200],
['20180323',61.1400],
['20180326',61.5000],
['20180327',61.7000],
['20180328',61.7000],
['20180329',61.6200],
['20180402',62.1600],
['20180403',62.0000],
['20180404',62.1100],
['20180405',62.0000],
['20180406',61.9200],
['20180409',61.5700],
['20180410',61.3300],
['20180411',61.5600],
['20180412',61.5000],
['20180413',61.7300],
['20180416',61.5000],
['20180417',60.6700],
['20180418',61.2200],
['20180419',61.5700],
['20180420',61.9600],
['20180423',61.5000],
['20180424',61.5000],
['20180425',61.5100],
['20180426',61.6300],
['20180427',60.4600],
['20180430',60.7300],
['20180502',60.7500],
['20180503',60.0200],
['20180504',60.1900],
['20180507',60.3000],
['20180508',60.8700],
['20180509',60.9600],
['20180510',61.3300],
['20180511',60.9000],
['20180514',61.8000],
['20180515',62.4200],
['20180516',62.2200],
['20180517',61.8000],
['20180518',62.4500],
['20180521',62.9000],
['20180522',64.8700],
['20180523',64.6800],
['20180524',64.8000],
['20180525',64.4700],
['20180528',65.5100],
['20180530',64.3300],
['20180531',62.4400],
['20180601',62.2800],
['20180604',62.1900],
['20180605',62.1400],
['20180606',62.7000],
['20180607',62.6900],
['20180608',62.4100],
['20180611',62.5900],
['20180612',62.5500],
['20180613',62.2000],
['20180614',62.7400],
['20180618',62.5000],
['20180619',62.0000],
['20180620',62.5400],
['20180621',62.7400],
['20180622',63.2300],
['20180625',62.5900],
['20180626',63.0100],
['20180627',63.0000],
['20180628',63.3000],
['20180629',63.1000],
['20180702',63.2000],
['20180703',63.2000],
['20180704',63.3000],
['20180705',63.4500],
['20180706',63.6000],
['20180709',63.3000],
['20180710',64.5100],
['20180711',64.7900],
['20180712',64.4700],
['20180713',64.9000],
['20180716',64.6700],
['20180717',65.0000],
['20180718',64.6100],
['20180719',65.5000],
['20180720',66.0600],
['20180723',66.1500],
['20180724',66.0800],
['20180725',66.2100],
['20180726',66.3000],
['20180727',66.1900],
['20180730',66.2700],
['20180731',67.5000],
['20180801',66.7400],
['20180802',66.7600],
['20180803',66.5500],
['20180806',66.7300],
['20180807',66.7000],
['20180808',66.3500],
['20180810',66.1000],
['20180813',66.2100],
['20180814',65.9000],
['20180815',65.6700],
['20180816',65.7500],
['20180817',64.9100],
['20180820',64.0300],
['20180821',63.3600],
['20180823',63.3500],
['20180824',63.7600],
['20180827',64.4500],
['20180828',64.4200],
['20180829',63.7500],
['20180830',62.5000],
['20180831',63.1200],
['20180903',62.5400],
['20180904',62.6000],
['20180905',61.0900],
['20180906',60.5400],
['20180907',60.7000],
['20180910',60.5000],
['20180911',60.4800],
['20180912',60.4800],
['20180913',60.7000],
['20180914',60.7900],
['20180917',60.5000],
['20180918',60.7000],
['20180919',62.9200],
['20180920',61.7200],
['20180921',61.8900],
['20180924',62.0000],
['20180925',61.8800],
['20180926',62.5500],
['20180927',62.0100],
['20180928',62.7500],
['20181001',62.8100],
['20181002',63.4000],
['20181003',63.3600],
['20181004',61.5000],
['20181005',61.2300],
['20181008',60.6300],
['20181009',60.6300],
['20181010',60.2000],
['20181011',57.9900],
['20181012',58.7100],
['20181015',58.6300],
['20181016',57.8800],
['20181017',58.4000],
['20181018',58.8000],
['20181019',58.9000],
['20181022',58.8800],
['20181023',58.2700],
['20181024',58.0000],
['20181025',56.8600],
['20181026',56.4400],
['20181029',57.2900],
['20181030',57.1700],
['20181031',57.7100],
['20181101',58.7300],
['20181102',58.6500],
['20181105',58.3900],
['20181107',58.5000],
['20181108',60.6800],
['20181109',60.3000],
['20181112',61.0000],
['20181113',61.7000],
['20181114',61.5700],
['20181115',62.9000],
['20181116',65.6000],
['20181119',63.6900],
['20181120',63.3300],
['20181121',63.5200],
['20181122',64.8300],
['20181123',64.5400],
['20181126',65.0000],
['20181127',65.3800],
['20181128',64.6100],
['20181129',64.9000],
['20181130',66.0300],
['20181203',66.9200],
['20181204',66.8300],
['20181205',66.9000],
['20181206',65.3400],
['20181207',65.6400],
['20181210',64.8200],
['20181211',64.7100],
['20181212',66.9600],
['20181213',65.9000],
['20181214',66.4500],
['20181217',67.4000],
['20181218',64.4300],
['20181219',65.7000],
['20181220',66.8800],
['20181221',66.1000],
['20181224',67.5000],
['20181226',66.9400],
['20181227',67.8000],
['20181228',68.3400],
['20181231',69.5800],
['20190102',67.5800],
['20190103',66.9200],
['20190104',68.5700],
['20190107',68.5000],
['20190108',67.8800],
['20190109',69.1700],
['20190110',68.6900],
['20190111',68.1000],
['20190114',67.9700],
['20190115',67.6000],
['20190116',66.8500],
['20190117',66.4700],
['20190118',66.8500],
['20190121',66.5800],
['20190122',66.8500],
['20190123',66.4700],
['20190124',66.8200],
['20190125',66.0100],
['20190128',65.8000],
['20190129',65.6100],
['20190130',65.8700],
['20190131',66.8200],
['20190201',66.6900],
['20190204',65.9500],
['20190207',66.8200],
['20190208',67.1800],
['20190211',68.6000],
['20190212',68.3300],
['20190213',70.0600],
['20190214',70.7000],
['20190215',70.5100],
['20190218',70.3000],
['20190219',71.0400],
['20190220',70.8500],
['20190221',70.9400],
['20190222',71.2100],
['20190225',69.9000],
['20190226',69.8600],
['20190227',71.2300],
['20190228',68.5600],
['20190301',68.4100],
['20190304',68.5300],
['20190305',67.7400],
['20190306',66.3500],
['20190307',66.9900],
['20190308',66.3000],
['20190311',66.4200],
['20190312',67.0700],
['20190313',67.2000],
['20190314',64.8400],
['20190315',64.0000],
['20190318',63.8500],
['20190319',63.2700],
['20190320',63.2700],
['20190321',63.7000],
['20190322',64.1500],
['20190325',64.0400],
['20190326',64.8000],
['20190327',64.4000],
['20190328',64.4100],
['20190329',62.3600],
['20190401',62.8500],
['20190402',63.2300],
['20190403',63.9500],
['20190404',63.2700],
['20190405',63.1800],
['20190408',62.3000],
['20190409',62.6300],
['20190410',63.1700],
['20190411',63.1000],
['20190412',63.4300],
['20190415',63.2900],
['20190416',63.3000],
['20190417',63.4500],
['20190418',63.6000],
['20190422',63.5000],
['20190423',63.7600],
['20190424',64.4400],
['20190425',63.7500],
['20190426',64.0000],
['20190429',64.9200],
['20190430',65.8000],
['20190502',65.1000],
['20190503',65.3900],
['20190506',64.9700],
['20190507',64.8800],
['20190508',65.1200],
['20190509',64.5200],
['20190510',64.3100],
['20190513',64.7000],
['20190514',63.5000],
['20190515',63.0500],
['20190516',62.4000],
['20190517',62.0000],
['20190521',60.5900],
['20190522',62.9500],
['20190523',61.9400],
['20190524',61.7000],
['20190527',61.7700],
['20190528',62.8300],
['20190529',63.0600],
['20190530',63.9000],
['20190531',64.1800],
['20190603',65.1000],
['20190604',65.1900],
['20190606',65.8500],
['20190607',65.7700],
['20190610',66.4000],
['20190611',65.5000],
['20190612',65.4500],
['20190613',65.5000],
['20190614',64.8000],
['20190617',62.7500],
['20190618',63.5000],
['20190619',63.6100],
['20190620',64.1000],
['20190621',64.1200],
['20190624',63.7100],
['20190625',63.7100],
['20190626',63.3700],
['20190627',64.3100],
['20190628',63.0200],
['20190701',63.1700],
['20190702',63.6000],
['20190703',63.7800],
['20190704',64.5600],
['20190705',64.8800],
['20190708',63.9100],
['20190709',64.0300],
['20190710',63.3900],
['20190711',63.7100],
['20190712',64.0000],
['20190715',63.7100],
['20190716',64.5900],
['20190717',63.5900],
['20190718',65.3800],
['20190719',65.2000],
['20190722',64.1700],
['20190723',64.3100],
['20190724',64.5900],
['20190725',64.7000],
['20190726',64.6500],
['20190729',63.6800],
['20190730',63.1000],
['20190731',60.8900],
['20190801',61.5800],
['20190802',60.8500],
['20190805',57.3800],
['20190806',56.8700],
['20190807',57.2100],
['20190808',55.0800],
['20190813',53.8500],
['20190814',53.2500],
['20190815',53.7300],
['20190816',53.5400],
['20190819',53.0000],
['20190820',53.4900],
['20190821',53.4000],
['20190822',54.1600],
['20190823',54.0000],
['20190826',52.6700],
['20190827',52.2400],
['20190828',52.1700],
['20190829',52.7300],
['20190830',54.3700],
['20190902',52.1200],
['20190903',52.5200],
['20190904',55.2400],
['20190905',55.8000],
['20190906',53.2900],
['20190909',53.7400],
['20190910',54.7000],
['20190911',57.7000],
['20190912',55.4200],
['20190913',56.1400],
['20190916',56.1700],
['20190917',55.5400],
['20190918',55.5800],
['20190919',55.2900],
['20190920',55.2600],
['20190923',55.8000],
['20190924',55.2000],
['20190925',54.6700],
['20190926',52.9700],
['20190927',53.6500],
['20190930',53.5000],
['20191001',53.7500],
['20191002',54.0400],
['20191003',53.6200],
['20191004',53.9500],
['20191007',53.1900],
['20191008',54.0400],
['20191009',52.9700],
['20191010',51.9200],
['20191011',51.8500],
['20191014',52.6500],
['20191015',52.9800],
['20191016',54.3000],
['20191017',53.6000],
['20191018',54.2700],
['20191021',56.4900],
['20191022',55.7900],
['20191023',55.0500],
['20191024',55.8900],
['20191025',56.6000],
['20191029',58.6500],
['20191030',57.9100],
['20191031',57.1200],
['20191101',56.9000],
['20191104',56.2700],
['20191105',56.3300],
['20191106',57.6500],
['20191107',58.4200],
['20191108',57.0000],
['20191111',57.4200],
['20191112',58.9000],
['20191113',57.0000],
['20191114',55.9400],
['20191115',56.9200],
['20191118',57.2000],
['20191119',56.0200],
['20191120',56.0100],
['20191121',56.2100],
['20191122',57.5900],
['20191125',58.0900],
['20191126',57.0000],
['20191127',56.9200],
['20191128',56.3200],
['20191129',56.2200],
['20191202',53.7000],
['20191203',53.9100],
['20191204',54.6100],
['20191205',54.9000],
['20191206',55.4900],
['20191209',55.0000],
['20191210',55.1100],
['20191211',54.7000],
['20191212',53.5700],
['20191213',54.0000],
['20191216',54.5300],
['20191217',54.8900],
['20191218',55.5300],
['20191219',55.0500],
['20191220',55.2200],
['20191223',54.6700],
['20191224',55.0000],
['20191226',55.5100],
['20191227',55.7000],
['20191230',55.8000],
['20191231',55.6000],
['20200102',56.3500],
['20200103',56.1500],
['20200106',56.2100],
['20200107',56.5100],
['20200108',56.3300],
['20200109',55.8300],
['20200110',56.0600],
['20200113',55.8300],
['20200114',57.9500],
['20200115',57.7800],
['20200116',57.4900],
['20200117',58.0600],
['20200120',58.0600],
['20200121',57.5000],
['20200122',57.4200],
['20200123',56.6300],
['20200124',56.6600],
['20200128',55.5600],
['20200129',55.7700],
['20200130',55.8400],
['20200131',55.9100],
['20200203',56.5100],
['20200204',57.3000],
['20200205',58.1700],
['20200206',58.7000],
['20200207',58.0000],
['20200210',58.4300],
['20200211',58.0000],
['20200212',58.0100],
['20200213',58.1100],
['20200214',58.0700],
['20200217',58.0000],
['20200218',58.0000],
['20200219',58.1100],
['20200220',58.0000],
['20200221',57.8200],
['20200224',57.1900],
['20200225',57.1000],
['20200226',56.1900],
['20200227',55.9200],
['20200228',54.4000],
['20200302',53.1000],
['20200303',52.4600],
['20200304',52.2200],
['20200305',52.4300],
['20200306',52.3900],
['20200309',50.1200],
['20200310',48.5000],
['20200311',49.6500],
['20200312',49.5000],
['20200313',53.0300],
['20200316',49.3300],
['20200317',50.2400],
['20200318',50.2200],
['20200319',46.6600],
['20200320',52.4400],
['20200323',46.7500],
['20200324',45.5500],
['20200325',45.2900],
['20200326',47.5000],
['20200327',48.7400],
['20200330',47.0000],
['20200331',50.0000],
['20200401',48.7500],
['20200402',48.1400],
['20200403',48.9600],
['20200406',49.9300],
['20200407',51.8700],
['20200408',49.9200],
['20200409',49.5100],
['20200413',49.3200],
['20200414',51.5000],
['20200415',52.5300],
['20200416',53.4700],
['20200417',53.6700],
['20200420',51.4800],
['20200421',50.4000],
['20200422',50.4200],
['20200423',49.9400],
['20200424',47.1100],
['20200427',44.9300],
['20200428',43.9200],
['20200429',43.7500],
['20200430',43.9600],
['20200504',43.9200],
['20200505',43.8000],
['20200506',44.6100],
['20200508',45.5000],
['20200511',44.0600],
['20200512',44.1900],
['20200513',44.6000],
['20200514',43.8200],
['20200515',44.1600],
['20200518',43.9800],
['20200519',43.8900],
['20200520',42.8200],
['20200521',42.6700],
['20200522',40.8900],
['20200526',40.9000],
['20200527',39.8900],
['20200528',40.0000],
['20200529',40.1500],
['20200601',41.2700],
['20200602',42.5200],
['20200603',42.0700],
['20200604',42.4900],
['20200605',44.5000],
['20200608',45.6500],
['20200609',46.0000],
['20200610',45.8100],
['20200611',43.5900],
['20200612',43.9600],
['20200615',43.1100],
['20200616',42.6100],
['20200617',43.2500],
['20200618',44.5600],
['20200619',43.4900],
['20200622',43.3600],
['20200623',41.5000],
['20200624',41.6600],
['20200625',41.9800],
['20200626',42.1000],
['20200629',42.0500],
['20200630',41.7400],
['20200701',42.1000],
['20200702',41.7800],
['20200703',41.8500],
['20200706',42.1000],
['20200707',42.5000],
['20200708',42.0000],
['20200709',41.7000],
['20200713',40.7300],
['20200714',40.5000],
['20200715',40.1600],
['20200716',40.4000],
['20200717',40.3600],
['20200720',39.9600],
['20200721',40.2800],
['20200722',39.9700],
['20200723',39.9500],
['20200724',40.0400],
['20200727',39.9500],
['20200728',41.3000],
['20200729',41.0000],
['20200730',40.9200],
['20200803',37.9600],
['20200804',39.3200],
['20200805',39.7400],
['20200806',40.3000],
['20200807',40.8000],
['20200811',41.0400],
['20200812',40.5700],
['20200813',41.4000],
['20200814',40.2500],
['20200817',40.2200],
['20200818',40.8800],
['20200819',40.7200],
['20200820',39.6500],
['20200821',40.1400],
['20200824',41.3500],
['20200825',41.8100],
['20200826',42.3000],
['20200827',42.1800],
['20200828',42.0200],
['20200831',42.0000],
['20200901',41.2500],
['20200902',40.8000],
['20200903',40.1700],
['20200904',40.1900],
['20200907',40.1700],
['20200908',39.8300],
['20200909',39.7600],
['20200910',39.3000],
['20200911',39.2000],
['20200914',39.0200],
['20200915',39.5800],
['20200916',42.0200],
['20200917',41.5000],
['20200918',40.5300],
['20200921',41.1700],
['20200922',41.7000],
['20200923',41.4700],
['20200924',40.0000],
['20200925',40.5000],
['20200928',39.9300],
['20200929',40.2900],
['20200930',39.6800],
['20201001',39.8100],
['20201002',39.9100],
['20201005',42.0400],
['20201006',42.5700],
['20201007',44.0400],
['20201008',43.5200],
['20201009',42.9300],
['20201012',43.1600],
['20201013',42.5700],
['20201014',42.6000],
['20201015',41.8200],
['20201016',40.7200],
['20201019',41.9600],
['20201020',41.9500],
['20201021',42.4900],
['20201022',43.0300],
['20201023',44.0000],
['20201026',45.4000],
['20201027',45.1200],
['20201028',44.4200],
['20201029',44.6700],
['20201030',44.0000],
['20201102',45.4200],
['20201103',46.1700],
['20201104',45.8300],
['20201105',45.8000],
['20201106',45.8000],
['20201109',46.3500],
['20201110',50.9100],
['20201111',50.3200],
['20201112',51.0000],
['20201113',51.0000],
['20201116',51.7000],
['20201117',52.9600],
['20201118',51.7100],
['20201119',51.2200],
['20201120',53.6800],
['20201123',54.2000],
['20201124',54.8500],
['20201125',54.4200],
['20201126',53.9900],
['20201127',52.9000],
['20201130',53.0700]];
var source='shareinvestor.com';
|
ratnania/caid
|
caid/quadrangles/quadrangles.py
|
<reponame>ratnania/caid
# -*- coding: UTF-8 -*-
import numpy as np
import matplotlib.tri as tri
import matplotlib.pyplot as plt
__all__ = ["Quadrangles", "QuadSticker"]
class Quadrangles(object):
def __init__(self, x, y, quads=None):
"""
a quadrangular mesh is represented by a triangulation. However, we must
pay attention to degenerated quadangles and those with an angle > pi
"""
self._x = x
self._y = y
if quads is None:
raise ValueError("quadrangles automatic construction from vertices not yet implemented")
self._quads = quads
self._triangles = None
self._triang = None
self._ancestors = None
self._sons = None
self._create_triangulation()
self._compute_neighbors()
@property
def x(self):
return self._x
@property
def y(self):
return self._y
@property
def quads(self):
return self._quads
@property
def triangles(self):
return self._triangles
@property
def triang(self):
return self._triang
@property
def ancestors(self):
return self._ancestors
@property
def neighbors(self):
return self._neighbors
@property
def sons(self):
return self._sons
@property
def n_vertices(self):
return self.x.shape[0]
@property
def n_quads(self):
return self.quads.shape[0]
def _uniform_split_quad(self, quad):
"""
splits a quadrangle into 2 triangles
Args:
quad: list of 4 vertices ids
Returns:
2 triangles
"""
I00,I10,I11,I01 = quad
T1 = [I00,I10,I11]
T2 = [I00,I11,I01]
return T1,T2
def _create_triangulation(self):
triangles = [] ; ancestors = [] ; sons = []
for enum,quad in enumerate(self.quads):
T1,T2 = self._uniform_split_quad(quad)
triangles.append(T1) ; ancestors.append(enum)
triangles.append(T2) ; ancestors.append(enum)
sons.append([2*enum, 2*enum+1])
self._triangles = np.asarray(triangles)
self._ancestors = np.asarray(ancestors)
self._sons = np.array(sons, dtype=np.int32)
self._triang = tri.Triangulation(self.x,self.y,self.triangles)
def _compute_neighbors(self):
n_quad = len(self.quads)
ancestors = self.ancestors
# print ancestors
_neighbors = []
for i in range(0, n_quad):
T1 = 2*i ; T2 = 2*i+1
ancestor = i
neighbors = list(self.triang.neighbors[T1][0:2]) \
+ list(self.triang.neighbors[T2][1:])
neighbors = np.array(neighbors, dtype=np.int32)
# print neighbors
quad_neighbors = -np.ones(4, dtype=np.int32)
for enum,T in enumerate(neighbors):
if T > -1:
quad_neighbors[enum] = ancestors[T]
_neighbors.append(quad_neighbors)
self._neighbors = np.array(_neighbors, dtype=np.int32)
# print "========="
# print self._neighbors
def plot(self, color="blue", lw=0.75):
plt.triplot(self.triang, '-', lw=lw, color=color)
class QuadSticker(object):
def __init__(self, quadrangles, find=False):
self._quadrangles = quadrangles
self._treated_elements = -np.ones(quadrangles.n_quads, dtype=np.int32)
self._dict_elements = {}
if find:
self.find_elements()
@property
def quadrangles(self):
return self._quadrangles
@property
def available_colors(self):
return np.unique(self.quadrangles.colors)
def tensor_elements(self,color):
return self._dict_elements[color]
def _distance_point_quad(self, quad, x, y):
"""
computes distances of a point to the 4 lines generated by a
quadrangle
"""
vertices_x = np.zeros((4,2))
vertices_y = np.zeros((4,2))
list_edgeb = [0,1,2,3]
list_edgee = [1,2,3,0]
for edge in range(0,4):
Vb = quad[list_edgeb[edge]]
Ve = quad[list_edgee[edge]]
vertices_x[edge,0] = self.quadrangles.x[Vb]
vertices_x[edge,1] = self.quadrangles.x[Ve]
vertices_y[edge,0] = self.quadrangles.y[Vb]
vertices_y[edge,1] = self.quadrangles.y[Ve]
distances = np.zeros(4)
for edge in range(0,4):
d = (vertices_x[edge,1]-vertices_x[edge,0]) \
* (vertices_y[edge,0]-y) \
- (vertices_y[edge,1]-vertices_y[edge,0]) \
* (vertices_x[edge,0]-x)
denom = (vertices_x[edge,1]-vertices_x[edge,0])**2 \
+ (vertices_y[edge,1]-vertices_y[edge,0])**2
distances[edge] = np.abs(d) / np.sqrt(denom)
return distances
def find_next_stage(self, color, stage):
"""
returns elements to be treated for the sticking algorithm
updates the array self._treated_elements
2: element has been treated and is inside the patch
1: new boundary patch elements
0: neighbors of the boundary patch elements
-1: remaining elements
"""
pass
def find_elements(self, color=None, str_color=None):
col = ["r","g","y","k","c"]
if color is None:
list_colors = self.available_colors
else:
list_colors = [color]
# ...
def _find_stage_elements(elmt, direction, marked_elements, stage, str_color=None):
e = elmt
marked_elements[e] = 1
if str_color is None:
str_color = col[stage % 5]
# plt.plot(x[quads[e]],y[quads[e]],"o"+str_color)
list_elements = [e]
ll_condition = True
while ll_condition:
# print mask
neighbors = self.quadrangles.neighbors[e]
e = neighbors[direction]
ll_condition = not (e == -1)
ll_condition = ll_condition \
and (self.quadrangles.colors[e]==color) \
and (marked_elements[e] == 0)
if ll_condition:
list_elements.append(e)
marked_elements[e] = 1
quad = quads[e]
# plt.plot(x[quad],y[quad],"o"+str_color)
# list_elements = list_elements[:10]
return list_elements
# ...
for color in list_colors:
x = self.quadrangles.x
y = self.quadrangles.y
quads = self.quadrangles.quads
list_all_elements = []
marked_elements = np.zeros(self.quadrangles.n_quads, dtype=np.int32)
elmts = self.quadrangles.extremal_elements(color)
elmt_base = elmts[0]
quad_base = quads[elmt_base]
mask = np.logical_and(self.quadrangles.neighbors[elmt_base] >= 0, \
self.quadrangles.colors[self.quadrangles.neighbors[elmt_base]]==color)
directions = np.where(mask)[0]
list_elements = _find_stage_elements(elmt_base, directions[0], marked_elements, 0, str_color=str_color)
# plt.show()
list_all_elements.append(list_elements)
ll_all_condition = True
i_stage = 1
while ll_all_condition:
direction = directions[1]
neighbors = self.quadrangles.neighbors[elmt_base]
elmt_base = neighbors[direction]
ll_all_condition = not (elmt_base == -1)
ll_all_condition = ll_all_condition \
and (self.quadrangles.colors[elmt_base]==color)\
and (marked_elements[elmt_base] == 0)
# ... TODO comment after debug
# ll_all_condition = ll_all_condition and (i_stage < 50)
if ll_all_condition:
# print i_stage
list_elements = _find_stage_elements(elmt_base, directions[0], marked_elements, i_stage, str_color=str_color)
list_all_elements.append(list_elements)
i_stage += 1
assert_condition = True
my_len = len(list_all_elements[0])
for all_elements in list_all_elements:
if len(all_elements) != my_len:
assert_condition = False
print ("Error. Not a tensor product structure")
assert(assert_condition)
self._dict_elements[color] = list_all_elements
|
alttch/evaHI
|
app/src/main/java/com/altertech/evahi/dialog/listeners/DialogCallBackDeleteCancel.java
|
<filename>app/src/main/java/com/altertech/evahi/dialog/listeners/DialogCallBackDeleteCancel.java
package com.altertech.evahi.dialog.listeners;
/**
* Created by oshevchuk on 25.05.2018
*/
public interface DialogCallBackDeleteCancel {
void dialogDelete(int position);
void dialogCancel(int position);
}
|
raspbian-packages/openmpi
|
ompi/mca/osc/rdma/osc_rdma_lock.h
|
/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */
/*
* Copyright (c) 2014-2015 Los Alamos National Security, LLC. All rights
* reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
*
* $HEADER$
*/
#if !defined(OMPI_OSC_RDMA_LOCK_H)
#define OMPI_OSC_RDMA_LOCK_H
#include "osc_rdma_types.h"
#include "osc_rdma_frag.h"
static inline int ompi_osc_rdma_trylock_local (volatile ompi_osc_rdma_lock_t *lock)
{
return !ompi_osc_rdma_lock_cmpset (lock, 0, OMPI_OSC_RDMA_LOCK_EXCLUSIVE);
}
static inline void ompi_osc_rdma_unlock_local (volatile ompi_osc_rdma_lock_t *lock)
{
(void) ompi_osc_rdma_lock_add (lock, -OMPI_OSC_RDMA_LOCK_EXCLUSIVE);
}
/**
* Dummy completion function for atomic operations
*/
void ompi_osc_rdma_atomic_complete (mca_btl_base_module_t *btl, struct mca_btl_base_endpoint_t *endpoint,
void *local_address, mca_btl_base_registration_handle_t *local_handle,
void *context, void *data, int status);
/**
* ompi_osc_rdma_lock_acquire_shared:
*
* @param[in] peer - owner of lock
* @param[in] value - increment value
* @param[in] offset - offset of lock in remote peer's state segment
*
* @returns OMPI_SUCCESS on success and another ompi error code on failure
*
* This function increments a remote shared lock. The value provided in
* {value} should be the negative of the one used for ompi_osc_rdma_lock_acquire_shared.
* It is erroneous to release a shared lock not held by the calling process.
*/
static inline int ompi_osc_rdma_lock_release_shared (ompi_osc_rdma_module_t *module, ompi_osc_rdma_peer_t *peer,
ompi_osc_rdma_lock_t value, ptrdiff_t offset)
{
uint64_t lock = (uint64_t) (intptr_t) peer->state + offset;
volatile bool atomic_complete = false;
void *temp = NULL;
int ret;
OSC_RDMA_VERBOSE(MCA_BASE_VERBOSE_DEBUG, "releasing shared lock %" PRIx64 " on peer %d. value 0x%lx", lock,
peer->rank, (unsigned long) value);
/* spin until the lock has been acquired */
if (!ompi_osc_rdma_peer_local_state (peer)) {
ompi_osc_rdma_frag_t *frag = NULL;
if (module->selected_btl->btl_flags & MCA_BTL_FLAGS_ATOMIC_OPS) {
ret = module->selected_btl->btl_atomic_op (module->selected_btl, peer->state_endpoint, (intptr_t) lock, peer->state_handle,
MCA_BTL_ATOMIC_ADD, value, 0, MCA_BTL_NO_ORDER, ompi_osc_rdma_atomic_complete,
(void *) &atomic_complete, NULL);
} else {
ret = ompi_osc_rdma_frag_alloc (module, 8, &frag, (char **) &temp);
if (OPAL_UNLIKELY(OPAL_SUCCESS != ret)) {
return ret;
}
ret = module->selected_btl->btl_atomic_fop (module->selected_btl, peer->state_endpoint, temp, (intptr_t) lock,
frag->handle, peer->state_handle, MCA_BTL_ATOMIC_ADD, value, 0,
MCA_BTL_NO_ORDER, ompi_osc_rdma_atomic_complete, (void *) &atomic_complete,
NULL);
}
if (OPAL_SUCCESS == ret) {
while (!atomic_complete) {
ompi_osc_rdma_progress (module);
}
} else if (1 == ret) {
ret = OMPI_SUCCESS;
}
if (frag) {
ompi_osc_rdma_frag_complete (frag);
}
return ret;
} else {
(void) ompi_osc_rdma_lock_add ((volatile ompi_osc_rdma_lock_t *) lock, value);
}
return OMPI_SUCCESS;
}
/**
* ompi_osc_rdma_lock_acquire_shared:
*
* @param[in] module - osc rdma module
* @param[in] peer - owner of lock
* @param[in] value - increment value
* @param[in] offset - offset of lock in remote peer's state segment
* @param[in] check - check value for success
*
* @returns OMPI_SUCCESS on success and another ompi error code on failure
*
* This function increments a remote shared lock and checks it against the
* check value in {check}. If any of the bits in the prior counter value
* match those in {check} the function decrements the value and tries again.
*/
static inline int ompi_osc_rdma_lock_acquire_shared (ompi_osc_rdma_module_t *module, ompi_osc_rdma_peer_t *peer,
ompi_osc_rdma_lock_t value, ptrdiff_t offset,
ompi_osc_rdma_lock_t check)
{
uint64_t lock = (uint64_t) peer->state + offset;
volatile bool atomic_complete;
ompi_osc_rdma_lock_t *temp = NULL;
int ret;
OSC_RDMA_VERBOSE(MCA_BASE_VERBOSE_DEBUG, "acquiring shared lock %" PRIx64 " on peer %d. value 0x%lx", lock,
peer->rank, (unsigned long) value);
/* spin until the lock has been acquired */
if (!ompi_osc_rdma_peer_local_state (peer)) {
ompi_osc_rdma_frag_t *frag;
ret = ompi_osc_rdma_frag_alloc (module, 8, &frag, (char **) &temp);
if (OPAL_UNLIKELY(OPAL_SUCCESS != ret)) {
return ret;
}
do {
atomic_complete = false;
ret = module->selected_btl->btl_atomic_fop (module->selected_btl, peer->state_endpoint, (void *) temp, lock, frag->handle,
peer->state_handle, MCA_BTL_ATOMIC_ADD, value, 0, MCA_BTL_NO_ORDER,
ompi_osc_rdma_atomic_complete, (void *) &atomic_complete, NULL);
if (OPAL_UNLIKELY(OPAL_SUCCESS > ret)) {
OSC_RDMA_VERBOSE(MCA_BASE_VERBOSE_DEBUG, "failed to increment shared lock. opal error code %d", ret);
return ret;
}
if (1 != ret) {
/* wait for completion of the atomic operation */
while (!atomic_complete) {
ompi_osc_rdma_progress (module);
}
}
OSC_RDMA_VERBOSE(MCA_BASE_VERBOSE_DEBUG, "shared lock incremented. old value 0x%lx", (unsigned long) *temp);
if (!(*temp & check)) {
break;
}
OSC_RDMA_VERBOSE(MCA_BASE_VERBOSE_DEBUG, "another peer has exclusive access to lock");
/* NTH: i think this is correct. backoff! */
ompi_osc_rdma_lock_release_shared (module, peer, -value, offset);
ompi_osc_rdma_progress (module);
} while (1);
ompi_osc_rdma_frag_complete (frag);
} else {
ompi_osc_rdma_lock_t lock_state;
do {
lock_state = ompi_osc_rdma_lock_add ((volatile ompi_osc_rdma_lock_t *) lock, value);
OSC_RDMA_VERBOSE(MCA_BASE_VERBOSE_DEBUG, "local shared lock incremented. old value 0x%lx",
(unsigned long) lock_state);
if (!(lock_state & check)) {
break;
}
(void) ompi_osc_rdma_lock_add ((volatile ompi_osc_rdma_lock_t *) lock, -value);
ompi_osc_rdma_progress (module);
} while (1);
}
OSC_RDMA_VERBOSE(MCA_BASE_VERBOSE_DEBUG, "shared lock acquired");
return OMPI_SUCCESS;
}
/**
* ompi_osc_rdma_lock_try_acquire_exclusive:
*
* @param[in] peer - peer to lock
* @param[in] temp - temporary registered location for lock result
* @param[in] temp_seg - registered segment for temp
* @param[in] offset - offset into the remote peer's state segment
*
* @returns 0 on success, 1 on failure
*
* This function attempts to lock the lock at {offset} on the remote
* peer. The buffer pointer to by {temp} must not be modified until
* this functions completes.
*/
static inline int ompi_osc_rdma_lock_try_acquire_exclusive (ompi_osc_rdma_module_t *module, ompi_osc_rdma_peer_t *peer,
ptrdiff_t offset)
{
uint64_t lock = (uint64_t) (uintptr_t) peer->state + offset;
ompi_osc_rdma_lock_t *temp = NULL;
volatile bool atomic_complete;
int ret;
OSC_RDMA_VERBOSE(MCA_BASE_VERBOSE_DEBUG, "trying to acquire exclusive lock %" PRIx64 " on peer %d", lock,
peer->rank);
if (!ompi_osc_rdma_peer_local_state (peer)) {
ompi_osc_rdma_frag_t *frag = NULL;
int result;
ret = ompi_osc_rdma_frag_alloc (module, 8, &frag, (char **) &temp);
if (OPAL_UNLIKELY(OPAL_SUCCESS != ret)) {
return ret;
}
/* set the temporary value so we can detect success. note that a lock should never be -1 */
atomic_complete = false;
*temp = 1;
ret = module->selected_btl->btl_atomic_cswap (module->selected_btl, peer->state_endpoint, temp, lock, frag->handle,
peer->state_handle, 0, OMPI_OSC_RDMA_LOCK_EXCLUSIVE, 0, 0,
ompi_osc_rdma_atomic_complete, (void *) &atomic_complete, NULL);
if (OPAL_UNLIKELY(OPAL_SUCCESS > ret)) {
return ret;
}
if (0 == ret) {
/* wait for the atomic operation to complete */
while (!atomic_complete) {
ompi_osc_rdma_progress (module);
}
}
#if OPAL_ENABLE_DEBUG
if (*temp == 0) {
OSC_RDMA_VERBOSE(MCA_BASE_VERBOSE_DEBUG, "exclusive lock acquired");
} else {
OSC_RDMA_VERBOSE(MCA_BASE_VERBOSE_DEBUG, "could not acquire exclusive lock");
}
#endif
result = (*temp != 0);
ompi_osc_rdma_frag_complete (frag);
return result;
}
return ompi_osc_rdma_trylock_local ((int64_t *)(intptr_t) lock);
}
/**
* ompi_osc_rdma_lock_acquire_exclusive:
*
* @param[in] peer - peer to lock
* @param[in] temp - temporary registered location for lock result
* @param[in] temp_seg - registered segment for temp
* @param[in] offset - offset into the remote peer's state segment
*
* @returns OMPI_SUCCESS on success or another ompi error code on failure
*
* This function locks the lock at {offset} on the remote peer. The
* buffer pointed to by {temp} must not be modified until this
* function completes.
*/
static inline int ompi_osc_rdma_lock_acquire_exclusive (ompi_osc_rdma_module_t *module, ompi_osc_rdma_peer_t *peer,
ptrdiff_t offset)
{
while (ompi_osc_rdma_lock_try_acquire_exclusive (module, peer, offset)) {
ompi_osc_rdma_progress (module);
}
return OMPI_SUCCESS;
}
/**
* ompi_osc_rdma_lock_release_exclusive:
*
* @param[in] peer - peer to unlock
* @param[in] offset - offset into the remote peer's state segment
*
* @returns OMPI_SUCCESS on success or another ompi error code on failure
*
* This function unlocks the lock at {offset} in the remote peer's state
* structure. It is illegal to call this function unless this process
* holds the lock.
*/
static inline int ompi_osc_rdma_lock_release_exclusive (ompi_osc_rdma_module_t *module, ompi_osc_rdma_peer_t *peer,
ptrdiff_t offset)
{
uint64_t lock = (uint64_t) (intptr_t) peer->state + offset;
volatile bool atomic_complete = false;
void *temp = NULL;
int ret;
OSC_RDMA_VERBOSE(MCA_BASE_VERBOSE_DEBUG, "releasing exclusive lock %" PRIx64 " on peer %d", lock, peer->rank);
if (!ompi_osc_rdma_peer_local_state (peer)) {
ompi_osc_rdma_frag_t *frag = NULL;
if (module->selected_btl->btl_flags & MCA_BTL_FLAGS_ATOMIC_OPS) {
ret = module->selected_btl->btl_atomic_op (module->selected_btl, peer->state_endpoint, lock, peer->state_handle, MCA_BTL_ATOMIC_ADD,
-OMPI_OSC_RDMA_LOCK_EXCLUSIVE, 0, MCA_BTL_NO_ORDER, ompi_osc_rdma_atomic_complete,
(void *) &atomic_complete, NULL);
} else {
ret = ompi_osc_rdma_frag_alloc (module, 8, &frag, (char **) &temp);
if (OPAL_UNLIKELY(OPAL_SUCCESS != ret)) {
return ret;
}
ret = module->selected_btl->btl_atomic_fop (module->selected_btl, peer->state_endpoint, temp, lock, frag->handle,
peer->state_handle, MCA_BTL_ATOMIC_ADD, -OMPI_OSC_RDMA_LOCK_EXCLUSIVE, 0,
MCA_BTL_NO_ORDER, ompi_osc_rdma_atomic_complete, (void *) &atomic_complete, NULL);
}
if (OPAL_SUCCESS == ret) {
while (!atomic_complete) {
ompi_osc_rdma_progress (module);
}
} else if (1 == ret) {
ret = OMPI_SUCCESS;
}
if (frag) {
ompi_osc_rdma_frag_complete (frag);
}
} else {
ompi_osc_rdma_unlock_local ((volatile ompi_osc_rdma_lock_t *)(intptr_t) lock);
}
OSC_RDMA_VERBOSE(MCA_BASE_VERBOSE_DEBUG, "exclusive lock released");
return OMPI_SUCCESS;
}
#endif /* OMPI_OSC_RDMA_LOCK_H */
|
sitedata/gantry5
|
platforms/common/application/positions/cards.js
|
<reponame>sitedata/gantry5<filename>platforms/common/application/positions/cards.js<gh_stars>0
"use strict";
var $ = require('elements'),
zen = require('elements/zen'),
ready = require('elements/domready'),
trim = require('mout/string/trim'),
keys = require('mout/object/keys'),
modal = require('../ui').modal,
toastr = require('../ui').toastr,
request = require('agent'),
getAjaxSuffix = require('../utils/get-ajax-suffix'),
parseAjaxURI = require('../utils/get-ajax-url').parse,
getAjaxURL = require('../utils/get-ajax-url').global,
Eraser = require('../ui/eraser'),
simpleSort = require('sortablejs'),
flags = require('../utils/flags-state');
var PositionsField = '[name="page[head][atoms][_json]"]',
groupOptions = [
{ name: 'positions', pull: true, put: true },
{ name: 'positions', pull: false, put: false }
];
var Positions = {
eraser: null,
lists: [],
state: [],
init: function(position) {
Positions.state = Positions.serialize(position);
return Positions.state;
},
equals: function() {
return Positions.state === Positions.serialize();
},
updatePendingChanges: function() {
var different = false,
equals = Positions.equals(),
save = $('[data-save="Positions"]'),
icon = save.find('i'),
indicator = save.find('.changes-indicator');
if (equals && indicator) { save.hideIndicator(); }
if (!equals && !indicator) { save.showIndicator('changes-indicator fa fa-fw fa-circle-o') }
flags.set('pending', !equals);
},
serialize: function(position) {
var data,
output = [],
positions = $(position) || $('[data-g5-position]');
if (!positions) {
return '[]';
}
positions.forEach(function(position) {
position = $(position);
data = JSON.parse(position.data('g5-position'));
data.modules = [];
// collect positions items
(position.search('[data-pm-data]') || []).forEach(function(item) {
item = $(item);
data.modules.push(JSON.parse(item.data('pm-data') || '{}'));
});
output.push(data);
position.data('g5-position', JSON.stringify(data));
});
return JSON.stringify(output).replace(/\//g, '\\/');
},
attachEraser: function() {
if (Positions.eraser) {
Positions.eraser.element = $('[data-g5-positions-erase]');
Positions.eraser.hide('fast');
return;
}
Positions.eraser = new Eraser('[data-g5-positions-erase]');
},
createSortables: function(element) {
var list, sort;
Positions.attachEraser();
groupOptions.forEach(function(groupOption, i) {
list = !i ? '[data-g5-position] ul' : '#trash';
list = $(list);
list.forEach(function(element, listIndex) {
sort = simpleSort.create(element, {
sort: !i,
filter: '[data-g5-position-ignore]',
group: groupOption,
scroll: true,
forceFallback: true,
animation: 100,
onStart: function(event) {
Positions.attachEraser();
var item = $(event.item);
item.addClass('position-dragging');
Positions.eraser.show();
},
onEnd: function(event) {
var item = $(event.item),
trash = $('#trash'),
target = $(this.originalEvent.target),
touchTrash = false;
// workaround for touch devices
if (this.originalEvent.type === 'touchend') {
var trashSize = trash[0].getBoundingClientRect(),
oE = this.originalEvent,
position = (oE.pageY || oE.changedTouches[0].pageY) - window.scrollY;
touchTrash = position <= trashSize.height;
}
if (target.matches('#trash') || target.parent('#trash') || touchTrash) {
item.remove();
Positions.eraser.hide();
this.options.onSort(event);
return;
}
item.removeClass('position-dragging');
Positions.eraser.hide();
},
onSort: function(event) {
var from = $(event.from),
to = $(event.to),
lists = [from.parent('[data-g5-position]'), to.parent('[data-g5-position]')];
if (event.from[0] === event.to[0]) {
lists.shift();
}
Positions.serialize(lists);
Positions.updatePendingChanges();
},
onOver: function(event) {
if (!$(event.from).matches('ul')) { return; }
var over = $(event.newIndex);
if (over.matches('#trash') || over.parent('#trash')) {
Positions.eraser.over();
} else {
Positions.eraser.out();
}
}
});
if (!i) {
if (!Positions.lists[listIndex]) {
Positions.lists[listIndex] = sort;
}
}
});
if (!i) {
element.SimpleSort = sort;
}
});
}
};
var AttachSortablePositions = function(positions) {
if (!positions) { return; }
if (!positions.SimpleSort) { Positions.createSortables(positions); }
};
ready(function() {
var positions = $('#positions');
$('body').delegate('mouseover', '#positions', function(event, element) {
AttachSortablePositions(element);
});
AttachSortablePositions(positions);
});
module.exports = Positions;
|
alcidesrh/autobusesfuentedelnorte.com
|
web/bundles/acmebackend/js/autorizacionInterna.js
|
autorizacionInterna = {
funcionesAddOnload : function() {
console.debug("autorizacionInterna.funcionesAddOnload-init");
this._init();
this._conectEvents();
console.debug("autorizacionInterna.funcionesAddOnload-end");
},
_init : function() {
var href = $(".generatePinHidden").val();
var html = $('<a class="btn sonata-action-element changePin" href="'+ href +'"><i class="icon-refresh"></i>Cambiar pin</div></a>');
$("input[id*='codigo']").parent().append(html);
},
_conectEvents : function() {
$(".changePin").bind("click", this.changePin);
},
changePin : function(event) {
console.debug("changePin-init");
$.get($(this).attr("href") , function( data ) {
$( "input[id*='codigo']" ).val(data);
});
event.preventDefault();
console.debug("changePin-end");
},
}
|
paolofrb/cotson
|
src/abaeterno/parsing/nic_token_parser.cpp
|
<filename>src/abaeterno/parsing/nic_token_parser.cpp<gh_stars>0
// (C) Copyright 2006-2009 Hewlett-Packard Development Company, L.P.
//
// 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.
//
// $Id$
#include "abaeterno_config.h"
#include "nic_token_parser.h"
#include "logger.h"
#include "error.h"
NicTokenParser::NicTokenParser(TokenQueue* q) :
queue(new CircularTokenQueue(q))
{
q->anything=this;
}
NicTokenParser::~NicTokenParser()
{
if(queue)
delete queue;
}
void NicTokenParser::run()
{
LOG("nic token parser run: ",queue->size());
queue->clear();
}
|
whble/trunk
|
target/linux/ar71xx/files/drivers/spi/spi-vsc7385.c
|
/*
* SPI driver for the Vitesse VSC7385 ethernet switch
*
* Copyright (C) 2009 <NAME> <<EMAIL>>
*
* Parts of this file are based on Atheros' 2.6.15 BSP
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 as published
* by the Free Software Foundation.
*/
#include <linux/types.h>
#include <linux/kernel.h>
#include <linux/init.h>
#include <linux/module.h>
#include <linux/delay.h>
#include <linux/device.h>
#include <linux/bitops.h>
#include <linux/firmware.h>
#include <linux/spi/spi.h>
#include <linux/spi/vsc7385.h>
#define DRV_NAME "spi-vsc7385"
#define DRV_DESC "Vitesse VSC7385 Gbit ethernet switch driver"
#define DRV_VERSION "0.1.0"
#define VSC73XX_BLOCK_MAC 0x1
#define VSC73XX_BLOCK_2 0x2
#define VSC73XX_BLOCK_MII 0x3
#define VSC73XX_BLOCK_4 0x4
#define VSC73XX_BLOCK_5 0x5
#define VSC73XX_BLOCK_SYSTEM 0x7
#define VSC73XX_SUBBLOCK_PORT_0 0
#define VSC73XX_SUBBLOCK_PORT_1 1
#define VSC73XX_SUBBLOCK_PORT_2 2
#define VSC73XX_SUBBLOCK_PORT_3 3
#define VSC73XX_SUBBLOCK_PORT_4 4
#define VSC73XX_SUBBLOCK_PORT_MAC 6
/* MAC Block registers */
#define VSC73XX_MAC_CFG 0x0
#define VSC73XX_ADVPORTM 0x19
#define VSC73XX_RXOCT 0x50
#define VSC73XX_TXOCT 0x51
#define VSC73XX_C_RX0 0x52
#define VSC73XX_C_RX1 0x53
#define VSC73XX_C_RX2 0x54
#define VSC73XX_C_TX0 0x55
#define VSC73XX_C_TX1 0x56
#define VSC73XX_C_TX2 0x57
#define VSC73XX_C_CFG 0x58
/* MAC_CFG register bits */
#define VSC73XX_MAC_CFG_WEXC_DIS (1 << 31)
#define VSC73XX_MAC_CFG_PORT_RST (1 << 29)
#define VSC73XX_MAC_CFG_TX_EN (1 << 28)
#define VSC73XX_MAC_CFG_SEED_LOAD (1 << 27)
#define VSC73XX_MAC_CFG_FDX (1 << 18)
#define VSC73XX_MAC_CFG_GIGE (1 << 17)
#define VSC73XX_MAC_CFG_RX_EN (1 << 16)
#define VSC73XX_MAC_CFG_VLAN_DBLAWR (1 << 15)
#define VSC73XX_MAC_CFG_VLAN_AWR (1 << 14)
#define VSC73XX_MAC_CFG_100_BASE_T (1 << 13)
#define VSC73XX_MAC_CFG_TX_IPG(x) (((x) & 0x1f) << 6)
#define VSC73XX_MAC_CFG_MAC_RX_RST (1 << 5)
#define VSC73XX_MAC_CFG_MAC_TX_RST (1 << 4)
#define VSC73XX_MAC_CFG_BIT2 (1 << 2)
#define VSC73XX_MAC_CFG_CLK_SEL(x) ((x) & 0x3)
/* ADVPORTM register bits */
#define VSC73XX_ADVPORTM_IFG_PPM (1 << 7)
#define VSC73XX_ADVPORTM_EXC_COL_CONT (1 << 6)
#define VSC73XX_ADVPORTM_EXT_PORT (1 << 5)
#define VSC73XX_ADVPORTM_INV_GTX (1 << 4)
#define VSC73XX_ADVPORTM_ENA_GTX (1 << 3)
#define VSC73XX_ADVPORTM_DDR_MODE (1 << 2)
#define VSC73XX_ADVPORTM_IO_LOOPBACK (1 << 1)
#define VSC73XX_ADVPORTM_HOST_LOOPBACK (1 << 0)
/* MII Block registers */
#define VSC73XX_MII_STAT 0x0
#define VSC73XX_MII_CMD 0x1
#define VSC73XX_MII_DATA 0x2
/* System Block registers */
#define VSC73XX_ICPU_SIPAD 0x01
#define VSC73XX_ICPU_CLOCK_DELAY 0x05
#define VSC73XX_ICPU_CTRL 0x10
#define VSC73XX_ICPU_ADDR 0x11
#define VSC73XX_ICPU_SRAM 0x12
#define VSC73XX_ICPU_MBOX_VAL 0x15
#define VSC73XX_ICPU_MBOX_SET 0x16
#define VSC73XX_ICPU_MBOX_CLR 0x17
#define VSC73XX_ICPU_CHIPID 0x18
#define VSC73XX_ICPU_GPIO 0x34
#define VSC73XX_ICPU_CTRL_CLK_DIV (1 << 8)
#define VSC73XX_ICPU_CTRL_SRST_HOLD (1 << 7)
#define VSC73XX_ICPU_CTRL_BOOT_EN (1 << 3)
#define VSC73XX_ICPU_CTRL_EXT_ACC_EN (1 << 2)
#define VSC73XX_ICPU_CTRL_CLK_EN (1 << 1)
#define VSC73XX_ICPU_CTRL_SRST (1 << 0)
#define VSC73XX_ICPU_CHIPID_ID_SHIFT 12
#define VSC73XX_ICPU_CHIPID_ID_MASK 0xffff
#define VSC73XX_ICPU_CHIPID_REV_SHIFT 28
#define VSC73XX_ICPU_CHIPID_REV_MASK 0xf
#define VSC73XX_ICPU_CHIPID_ID_7385 0x7385
#define VSC73XX_ICPU_CHIPID_ID_7395 0x7395
#define VSC73XX_CMD_MODE_READ 0
#define VSC73XX_CMD_MODE_WRITE 1
#define VSC73XX_CMD_MODE_SHIFT 4
#define VSC73XX_CMD_BLOCK_SHIFT 5
#define VSC73XX_CMD_BLOCK_MASK 0x7
#define VSC73XX_CMD_SUBBLOCK_MASK 0xf
#define VSC7385_CLOCK_DELAY ((3 << 4) | 3)
#define VSC7385_CLOCK_DELAY_MASK ((3 << 4) | 3)
#define VSC73XX_ICPU_CTRL_STOP (VSC73XX_ICPU_CTRL_SRST_HOLD | \
VSC73XX_ICPU_CTRL_BOOT_EN | \
VSC73XX_ICPU_CTRL_EXT_ACC_EN)
#define VSC73XX_ICPU_CTRL_START (VSC73XX_ICPU_CTRL_CLK_DIV | \
VSC73XX_ICPU_CTRL_BOOT_EN | \
VSC73XX_ICPU_CTRL_CLK_EN | \
VSC73XX_ICPU_CTRL_SRST)
#define VSC7385_ADVPORTM_MASK (VSC73XX_ADVPORTM_IFG_PPM | \
VSC73XX_ADVPORTM_EXC_COL_CONT | \
VSC73XX_ADVPORTM_EXT_PORT | \
VSC73XX_ADVPORTM_INV_GTX | \
VSC73XX_ADVPORTM_ENA_GTX | \
VSC73XX_ADVPORTM_DDR_MODE | \
VSC73XX_ADVPORTM_IO_LOOPBACK | \
VSC73XX_ADVPORTM_HOST_LOOPBACK)
#define VSC7385_ADVPORTM_INIT (VSC73XX_ADVPORTM_EXT_PORT | \
VSC73XX_ADVPORTM_ENA_GTX | \
VSC73XX_ADVPORTM_DDR_MODE)
#define VSC7385_MAC_CFG_RESET (VSC73XX_MAC_CFG_PORT_RST | \
VSC73XX_MAC_CFG_MAC_RX_RST | \
VSC73XX_MAC_CFG_MAC_TX_RST)
#define VSC73XX_MAC_CFG_INIT (VSC73XX_MAC_CFG_TX_EN | \
VSC73XX_MAC_CFG_FDX | \
VSC73XX_MAC_CFG_GIGE | \
VSC73XX_MAC_CFG_RX_EN)
#define VSC73XX_RESET_DELAY 100
struct vsc7385 {
struct spi_device *spi;
struct mutex lock;
struct vsc7385_platform_data *pdata;
};
static int vsc7385_is_addr_valid(u8 block, u8 subblock)
{
switch (block) {
case VSC73XX_BLOCK_MAC:
switch (subblock) {
case 0 ... 4:
case 6:
return 1;
}
break;
case VSC73XX_BLOCK_2:
case VSC73XX_BLOCK_SYSTEM:
switch (subblock) {
case 0:
return 1;
}
break;
case VSC73XX_BLOCK_MII:
case VSC73XX_BLOCK_4:
case VSC73XX_BLOCK_5:
switch (subblock) {
case 0 ... 1:
return 1;
}
break;
}
return 0;
}
static inline u8 vsc7385_make_addr(u8 mode, u8 block, u8 subblock)
{
u8 ret;
ret = (block & VSC73XX_CMD_BLOCK_MASK) << VSC73XX_CMD_BLOCK_SHIFT;
ret |= (mode & 1) << VSC73XX_CMD_MODE_SHIFT;
ret |= subblock & VSC73XX_CMD_SUBBLOCK_MASK;
return ret;
}
static int vsc7385_read(struct vsc7385 *vsc, u8 block, u8 subblock, u8 reg,
u32 *value)
{
u8 cmd[4];
u8 buf[4];
struct spi_transfer t[2];
struct spi_message m;
int err;
if (!vsc7385_is_addr_valid(block, subblock))
return -EINVAL;
spi_message_init(&m);
memset(&t, 0, sizeof(t));
t[0].tx_buf = cmd;
t[0].len = sizeof(cmd);
spi_message_add_tail(&t[0], &m);
t[1].rx_buf = buf;
t[1].len = sizeof(buf);
spi_message_add_tail(&t[1], &m);
cmd[0] = vsc7385_make_addr(VSC73XX_CMD_MODE_READ, block, subblock);
cmd[1] = reg;
cmd[2] = 0;
cmd[3] = 0;
mutex_lock(&vsc->lock);
err = spi_sync(vsc->spi, &m);
mutex_unlock(&vsc->lock);
if (err)
return err;
*value = (((u32) buf[0]) << 24) | (((u32) buf[1]) << 16) |
(((u32) buf[2]) << 8) | ((u32) buf[3]);
return 0;
}
static int vsc7385_write(struct vsc7385 *vsc, u8 block, u8 subblock, u8 reg,
u32 value)
{
u8 cmd[2];
u8 buf[4];
struct spi_transfer t[2];
struct spi_message m;
int err;
if (!vsc7385_is_addr_valid(block, subblock))
return -EINVAL;
spi_message_init(&m);
memset(&t, 0, sizeof(t));
t[0].tx_buf = cmd;
t[0].len = sizeof(cmd);
spi_message_add_tail(&t[0], &m);
t[1].tx_buf = buf;
t[1].len = sizeof(buf);
spi_message_add_tail(&t[1], &m);
cmd[0] = vsc7385_make_addr(VSC73XX_CMD_MODE_WRITE, block, subblock);
cmd[1] = reg;
buf[0] = (value >> 24) & 0xff;
buf[1] = (value >> 16) & 0xff;
buf[2] = (value >> 8) & 0xff;
buf[3] = value & 0xff;
mutex_lock(&vsc->lock);
err = spi_sync(vsc->spi, &m);
mutex_unlock(&vsc->lock);
return err;
}
static inline int vsc7385_write_verify(struct vsc7385 *vsc, u8 block,
u8 subblock, u8 reg, u32 value,
u32 read_mask, u32 read_val)
{
struct spi_device *spi = vsc->spi;
u32 t;
int err;
err = vsc7385_write(vsc, block, subblock, reg, value);
if (err)
return err;
err = vsc7385_read(vsc, block, subblock, reg, &t);
if (err)
return err;
if ((t & read_mask) != read_val) {
dev_err(&spi->dev, "register write error\n");
return -EIO;
}
return 0;
}
static inline int vsc7385_set_clock_delay(struct vsc7385 *vsc, u32 val)
{
return vsc7385_write(vsc, VSC73XX_BLOCK_SYSTEM, 0,
VSC73XX_ICPU_CLOCK_DELAY, val);
}
static inline int vsc7385_get_clock_delay(struct vsc7385 *vsc, u32 *val)
{
return vsc7385_read(vsc, VSC73XX_BLOCK_SYSTEM, 0,
VSC73XX_ICPU_CLOCK_DELAY, val);
}
static inline int vsc7385_icpu_stop(struct vsc7385 *vsc)
{
return vsc7385_write(vsc, VSC73XX_BLOCK_SYSTEM, 0, VSC73XX_ICPU_CTRL,
VSC73XX_ICPU_CTRL_STOP);
}
static inline int vsc7385_icpu_start(struct vsc7385 *vsc)
{
return vsc7385_write(vsc, VSC73XX_BLOCK_SYSTEM, 0, VSC73XX_ICPU_CTRL,
VSC73XX_ICPU_CTRL_START);
}
static inline int vsc7385_icpu_reset(struct vsc7385 *vsc)
{
int rc;
rc = vsc7385_write(vsc, VSC73XX_BLOCK_SYSTEM, 0, VSC73XX_ICPU_ADDR,
0x0000);
if (rc)
dev_err(&vsc->spi->dev,
"could not reset microcode, err=%d\n", rc);
return rc;
}
static int vsc7385_upload_ucode(struct vsc7385 *vsc)
{
struct spi_device *spi = vsc->spi;
const struct firmware *firmware;
char *ucode_name;
unsigned char *dp;
unsigned int curVal;
int i;
int diffs;
int rc;
ucode_name = (vsc->pdata->ucode_name) ? vsc->pdata->ucode_name
: "vsc7385_ucode.bin";
rc = request_firmware(&firmware, ucode_name, &spi->dev);
if (rc) {
dev_err(&spi->dev, "request_firmware failed, err=%d\n",
rc);
return rc;
}
rc = vsc7385_icpu_stop(vsc);
if (rc)
goto out;
rc = vsc7385_icpu_reset(vsc);
if (rc)
goto out;
dev_info(&spi->dev, "uploading microcode...\n");
dp = (unsigned char *) firmware->data;
for (i = 0; i < firmware->size; i++) {
rc = vsc7385_write(vsc, VSC73XX_BLOCK_SYSTEM, 0,
VSC73XX_ICPU_SRAM, *dp++);
if (rc) {
dev_err(&spi->dev, "could not load microcode, err=%d\n",
rc);
goto out;
}
}
rc = vsc7385_icpu_reset(vsc);
if (rc)
goto out;
dev_info(&spi->dev, "verifying microcode...\n");
dp = (unsigned char *) firmware->data;
diffs = 0;
for (i = 0; i < firmware->size; i++) {
rc = vsc7385_read(vsc, VSC73XX_BLOCK_SYSTEM, 0,
VSC73XX_ICPU_SRAM, &curVal);
if (rc) {
dev_err(&spi->dev, "could not read microcode %d\n",
rc);
goto out;
}
if (curVal > 0xff) {
dev_err(&spi->dev, "bad val read: %04x : %02x %02x\n",
i, *dp, curVal);
rc = -EIO;
goto out;
}
if ((curVal & 0xff) != *dp) {
diffs++;
dev_err(&spi->dev, "verify error: %04x : %02x %02x\n",
i, *dp, curVal);
if (diffs > 4)
break;
}
dp++;
}
if (diffs) {
dev_err(&spi->dev, "microcode verification failed\n");
rc = -EIO;
goto out;
}
dev_info(&spi->dev, "microcode uploaded\n");
rc = vsc7385_icpu_start(vsc);
out:
release_firmware(firmware);
return rc;
}
static int vsc7385_setup(struct vsc7385 *vsc)
{
struct vsc7385_platform_data *pdata = vsc->pdata;
u32 t;
int err;
err = vsc7385_write_verify(vsc, VSC73XX_BLOCK_SYSTEM, 0,
VSC73XX_ICPU_CLOCK_DELAY,
VSC7385_CLOCK_DELAY,
VSC7385_CLOCK_DELAY_MASK,
VSC7385_CLOCK_DELAY);
if (err)
goto err;
err = vsc7385_write_verify(vsc, VSC73XX_BLOCK_MAC,
VSC73XX_SUBBLOCK_PORT_MAC, VSC73XX_ADVPORTM,
VSC7385_ADVPORTM_INIT,
VSC7385_ADVPORTM_MASK,
VSC7385_ADVPORTM_INIT);
if (err)
goto err;
err = vsc7385_write(vsc, VSC73XX_BLOCK_MAC, VSC73XX_SUBBLOCK_PORT_MAC,
VSC73XX_MAC_CFG, VSC7385_MAC_CFG_RESET);
if (err)
goto err;
t = VSC73XX_MAC_CFG_INIT;
t |= VSC73XX_MAC_CFG_TX_IPG(pdata->mac_cfg.tx_ipg);
t |= VSC73XX_MAC_CFG_CLK_SEL(pdata->mac_cfg.clk_sel);
if (pdata->mac_cfg.bit2)
t |= VSC73XX_MAC_CFG_BIT2;
err = vsc7385_write(vsc, VSC73XX_BLOCK_MAC, VSC73XX_SUBBLOCK_PORT_MAC,
VSC73XX_MAC_CFG, t);
if (err)
goto err;
return 0;
err:
return err;
}
static int vsc7385_detect(struct vsc7385 *vsc)
{
struct spi_device *spi = vsc->spi;
u32 t;
u32 id;
u32 rev;
int err;
err = vsc7385_read(vsc, VSC73XX_BLOCK_SYSTEM, 0,
VSC73XX_ICPU_MBOX_VAL, &t);
if (err) {
dev_err(&spi->dev, "unable to read mailbox, err=%d\n", err);
return err;
}
if (t == 0xffffffff) {
dev_dbg(&spi->dev, "assert chip reset\n");
if (vsc->pdata->reset)
vsc->pdata->reset();
}
err = vsc7385_read(vsc, VSC73XX_BLOCK_SYSTEM, 0,
VSC73XX_ICPU_CHIPID, &t);
if (err) {
dev_err(&spi->dev, "unable to read chip id, err=%d\n", err);
return err;
}
id = (t >> VSC73XX_ICPU_CHIPID_ID_SHIFT) & VSC73XX_ICPU_CHIPID_ID_MASK;
switch (id) {
case VSC73XX_ICPU_CHIPID_ID_7385:
case VSC73XX_ICPU_CHIPID_ID_7395:
break;
default:
dev_err(&spi->dev, "unsupported chip, id=%04x\n", id);
return -ENODEV;
}
rev = (t >> VSC73XX_ICPU_CHIPID_REV_SHIFT) &
VSC73XX_ICPU_CHIPID_REV_MASK;
dev_info(&spi->dev, "VSC%04X (rev. %d) switch found\n", id, rev);
return 0;
}
static int vsc7385_probe(struct spi_device *spi)
{
struct vsc7385 *vsc;
struct vsc7385_platform_data *pdata;
int err;
printk(KERN_INFO DRV_DESC " version " DRV_VERSION"\n");
pdata = spi->dev.platform_data;
if (!pdata) {
dev_err(&spi->dev, "no platform data specified\n");
return -ENODEV;
}
vsc = kzalloc(sizeof(*vsc), GFP_KERNEL);
if (!vsc) {
dev_err(&spi->dev, "no memory for private data\n");
return -ENOMEM;
}
mutex_init(&vsc->lock);
vsc->pdata = pdata;
vsc->spi = spi_dev_get(spi);
dev_set_drvdata(&spi->dev, vsc);
spi->mode = SPI_MODE_0;
spi->bits_per_word = 8;
err = spi_setup(spi);
if (err) {
dev_err(&spi->dev, "spi_setup failed, err=%d\n", err);
goto err_drvdata;
}
err = vsc7385_detect(vsc);
if (err) {
dev_err(&spi->dev, "no chip found, err=%d\n", err);
goto err_drvdata;
}
err = vsc7385_upload_ucode(vsc);
if (err)
goto err_drvdata;
err = vsc7385_setup(vsc);
if (err)
goto err_drvdata;
return 0;
err_drvdata:
dev_set_drvdata(&spi->dev, NULL);
kfree(vsc);
return err;
}
static int vsc7385_remove(struct spi_device *spi)
{
struct vsc7385_data *vsc;
vsc = dev_get_drvdata(&spi->dev);
dev_set_drvdata(&spi->dev, NULL);
kfree(vsc);
return 0;
}
static struct spi_driver vsc7385_driver = {
.driver = {
.name = DRV_NAME,
.bus = &spi_bus_type,
.owner = THIS_MODULE,
},
.probe = vsc7385_probe,
.remove = vsc7385_remove,
};
static int __init vsc7385_init(void)
{
return spi_register_driver(&vsc7385_driver);
}
module_init(vsc7385_init);
static void __exit vsc7385_exit(void)
{
spi_unregister_driver(&vsc7385_driver);
}
module_exit(vsc7385_exit);
MODULE_DESCRIPTION(DRV_DESC);
MODULE_VERSION(DRV_VERSION);
MODULE_AUTHOR("<NAME> <<EMAIL>>");
MODULE_LICENSE("GPL v2");
|
zettadb/zettalib
|
src/vendor/mariadb-10.6.7/libmariadb/libmariadb/ma_net.c
|
/* Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult AB
2012-2016 SkySQL AB, MariaDB Corporation AB
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with this library; if not, write to the Free
Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
MA 02111-1301, USA */
/* Write and read of logical packets to/from socket
** Writes are cached into net_buffer_length big packets.
** Read packets are reallocated dynamically when reading big packets.
** Each logical packet has the following pre-info:
** 3 byte length & 1 byte package-number.
*/
#include <ma_global.h>
#include <mysql.h>
#include <ma_pvio.h>
#include <ma_sys.h>
#include <ma_string.h>
#include "mysql.h"
#include "ma_server_error.h"
#include <signal.h>
#include <errno.h>
#include <sys/types.h>
#include <ma_pvio.h>
#include <ma_common.h>
#ifndef _WIN32
#include <poll.h>
#endif
#define MAX_PACKET_LENGTH (256L*256L*256L-1)
/* net_buffer_length and max_allowed_packet are defined in mysql.h
See bug conc-57
*/
#undef net_buffer_length
#undef max_allowed_packet
ulong max_allowed_packet=1024L * 1024L * 1024L;
ulong net_read_timeout= NET_READ_TIMEOUT;
ulong net_write_timeout= NET_WRITE_TIMEOUT;
ulong net_buffer_length= 8192; /* Default length. Enlarged if necessary */
#if !defined(_WIN32)
#include <sys/socket.h>
#else
#undef MYSQL_SERVER /* Win32 can't handle interrupts */
#endif
#if !defined(_WIN32) && !defined(HAVE_BROKEN_NETINET_INCLUDES) && !defined(__BEOS__)
#include <netinet/in_systm.h>
#include <netinet/in.h>
#include <netinet/ip.h>
#if !defined(alpha_linux_port)
#include <netinet/tcp.h>
#endif
#endif
/*
** Give error if a too big packet is found
** The server can change this with the -O switch, but because the client
** can't normally do this the client should have a bigger max-buffer.
*/
static int ma_net_write_buff(NET *net,const char *packet, size_t len);
/* Init with packet info */
int ma_net_init(NET *net, MARIADB_PVIO* pvio)
{
if (!(net->buff=(uchar*) malloc(net_buffer_length)))
return 1;
if (!net->extension)
return 1;
memset(net->buff, 0, net_buffer_length);
net->max_packet_size= MAX(net_buffer_length, max_allowed_packet);
net->buff_end=net->buff+(net->max_packet=net_buffer_length);
net->pvio = pvio;
net->error=0; net->return_status=0;
net->read_timeout=(uint) net_read_timeout; /* Timeout for read */
net->compress_pkt_nr= net->pkt_nr= 0;
net->write_pos=net->read_pos = net->buff;
net->last_error[0]= net->sqlstate[0] =0;
net->compress=0; net->reading_or_writing=0;
net->where_b = net->remain_in_buf=0;
net->last_errno=0;
if (pvio != 0) /* If real connection */
{
ma_pvio_get_handle(pvio, &net->fd);
ma_pvio_blocking(pvio, 1, 0);
ma_pvio_fast_send(pvio);
}
return 0;
}
void ma_net_end(NET *net)
{
free(net->buff);
net->buff=0;
}
/* Realloc the packet buffer */
static my_bool net_realloc(NET *net, size_t length)
{
uchar *buff;
size_t pkt_length;
if (length >= net->max_packet_size)
{
net->error=1;
net->last_errno=ER_NET_PACKET_TOO_LARGE;
return(1);
}
pkt_length = (length+IO_SIZE-1) & ~(IO_SIZE-1);
/* reallocate buffer:
size= pkt_length + NET_HEADER_SIZE + COMP_HEADER_SIZE */
if (!(buff=(uchar*) realloc(net->buff,
pkt_length + NET_HEADER_SIZE + COMP_HEADER_SIZE)))
{
net->error=1;
return(1);
}
net->buff=net->write_pos=buff;
net->buff_end=buff+(net->max_packet=(unsigned long)pkt_length);
return(0);
}
/* Remove unwanted characters from connection */
void ma_net_clear(NET *net)
{
if (net->extension->multi_status > COM_MULTI_OFF)
return;
net->compress_pkt_nr= net->pkt_nr=0; /* Ready for new command */
net->write_pos=net->buff;
return;
}
/* Flush write_buffer if not empty. */
int ma_net_flush(NET *net)
{
int error=0;
/* don't flush if pipelined query is in progress */
if (net->extension->multi_status > COM_MULTI_OFF)
return 0;
if (net->buff != net->write_pos)
{
error=ma_net_real_write(net,(char*) net->buff,
(size_t) (net->write_pos - net->buff));
net->write_pos=net->buff;
}
if (net->compress)
net->pkt_nr= net->compress_pkt_nr;
return(error);
}
/*****************************************************************************
** Write something to server/client buffer
*****************************************************************************/
/*
** Write a logical packet with packet header
** Format: Packet length (3 bytes), packet number(1 byte)
** When compression is used a 3 byte compression length is added
** NOTE: If compression is used the original package is destroyed!
*/
int ma_net_write(NET *net, const uchar *packet, size_t len)
{
uchar buff[NET_HEADER_SIZE];
while (len >= MAX_PACKET_LENGTH)
{
const ulong max_len= MAX_PACKET_LENGTH;
int3store(buff,max_len);
buff[3]= (uchar)net->pkt_nr++;
if (ma_net_write_buff(net,(char*) buff,NET_HEADER_SIZE) ||
ma_net_write_buff(net, (char *)packet, max_len))
return 1;
packet+= max_len;
len-= max_len;
}
/* write last remaining packet, size can be zero */
int3store(buff, len);
buff[3]= (uchar)net->pkt_nr++;
if (ma_net_write_buff(net,(char*) buff,NET_HEADER_SIZE) ||
ma_net_write_buff(net, (char *)packet, len))
return 1;
return 0;
}
int ma_net_write_command(NET *net, uchar command,
const char *packet, size_t len,
my_bool disable_flush)
{
uchar buff[NET_HEADER_SIZE+1];
size_t buff_size= NET_HEADER_SIZE + 1;
size_t length= 1 + len; /* 1 extra byte for command */
int rc;
buff[NET_HEADER_SIZE]= 0;
buff[4]=command;
if (length >= MAX_PACKET_LENGTH)
{
len= MAX_PACKET_LENGTH - 1;
do
{
int3store(buff, MAX_PACKET_LENGTH);
buff[3]= (net->compress) ? 0 : (uchar) (net->pkt_nr++);
if (ma_net_write_buff(net, (char *)buff, buff_size) ||
ma_net_write_buff(net, packet, len))
return(1);
packet+= len;
length-= MAX_PACKET_LENGTH;
len= MAX_PACKET_LENGTH;
buff_size= NET_HEADER_SIZE; /* don't send command for further packets */
} while (length >= MAX_PACKET_LENGTH);
len= length;
}
int3store(buff,length);
buff[3]= (net->compress) ? 0 :(uchar) (net->pkt_nr++);
rc= test (ma_net_write_buff(net,(char *)buff, buff_size) ||
ma_net_write_buff(net,packet,len));
if (!rc && !disable_flush)
return test(ma_net_flush(net));
return rc;
}
static int ma_net_write_buff(NET *net,const char *packet, size_t len)
{
size_t left_length;
if (!len)
return 0;
if (net->max_packet > MAX_PACKET_LENGTH &&
net->compress)
left_length= (size_t)(MAX_PACKET_LENGTH - (net->write_pos - net->buff));
else
left_length=(size_t) (net->buff_end - net->write_pos);
if (len > left_length)
{
if (net->write_pos != net->buff)
{
memcpy((char*) net->write_pos,packet,left_length);
if (ma_net_real_write(net,(char*) net->buff,
(size_t)(net->write_pos - net->buff) + left_length))
return 1;
packet+=left_length;
len-=left_length;
net->write_pos= net->buff;
}
if (net->compress)
{
/* uncompressed length is stored in 3 bytes,so
packet can't be > 0xFFFFFF */
left_length= MAX_PACKET_LENGTH;
while (len > left_length)
{
if (ma_net_real_write(net, packet, left_length))
return 1;
packet+= left_length;
len-= left_length;
}
}
if (len > net->max_packet)
return(test(ma_net_real_write(net, packet, len)));
}
memcpy((char*) net->write_pos,packet,len);
net->write_pos+=len;
return 0;
}
unsigned char *mysql_net_store_length(unsigned char *packet, size_t length);
/* Read and write using timeouts */
int ma_net_real_write(NET *net, const char *packet, size_t len)
{
ssize_t length;
char *pos,*end;
if (net->error == 2)
return(-1); /* socket can't be used */
net->reading_or_writing=2;
#ifdef HAVE_COMPRESS
if (net->compress)
{
size_t complen;
uchar *b;
uint header_length=NET_HEADER_SIZE+COMP_HEADER_SIZE;
if (!(b=(uchar*) malloc(len + NET_HEADER_SIZE + COMP_HEADER_SIZE + 1)))
{
net->last_errno=ER_OUT_OF_RESOURCES;
net->error=2;
net->reading_or_writing=0;
return(1);
}
memcpy(b+header_length,packet,len);
if (_mariadb_compress((unsigned char*) b+header_length,&len,&complen))
{
complen=0;
}
int3store(&b[NET_HEADER_SIZE],complen);
int3store(b,len);
b[3]=(uchar) (net->compress_pkt_nr++);
len+= header_length;
packet= (char*) b;
}
#endif /* HAVE_COMPRESS */
pos=(char*) packet; end=pos+len;
while (pos != end)
{
if ((length=ma_pvio_write(net->pvio,(uchar *)pos,(size_t) (end-pos))) <= 0)
{
net->error=2; /* Close socket */
net->last_errno= ER_NET_ERROR_ON_WRITE;
net->reading_or_writing=0;
#ifdef HAVE_COMPRESS
if (net->compress)
free((char*) packet);
#endif
return(1);
}
pos+=length;
}
#ifdef HAVE_COMPRESS
if (net->compress)
free((char*) packet);
#endif
net->reading_or_writing=0;
return(((int) (pos != end)));
}
/*****************************************************************************
** Read something from server/clinet
*****************************************************************************/
static ulong ma_real_read(NET *net, size_t *complen)
{
uchar *pos;
ssize_t length;
uint i;
ulong len=packet_error;
size_t remain= (net->compress ? NET_HEADER_SIZE+COMP_HEADER_SIZE :
NET_HEADER_SIZE);
*complen = 0;
net->reading_or_writing=1;
pos = net->buff + net->where_b; /* net->packet -4 */
for (i=0 ; i < 2 ; i++)
{
while (remain > 0)
{
/* First read is done with non blocking mode */
if ((length=ma_pvio_cache_read(net->pvio, pos,remain)) <= 0L)
{
len= packet_error;
net->error=2; /* Close socket */
goto end;
}
remain -= (ulong) length;
pos+= (ulong) length;
}
if (i == 0)
{ /* First parts is packet length */
ulong helping;
net->pkt_nr= net->buff[net->where_b + 3];
net->compress_pkt_nr= ++net->pkt_nr;
#ifdef HAVE_COMPRESS
if (net->compress)
{
/* complen is > 0 if package is really compressed */
*complen=uint3korr(&(net->buff[net->where_b + NET_HEADER_SIZE]));
}
#endif
len=uint3korr(net->buff+net->where_b);
if (!len)
goto end;
helping = max(len,(ulong)*complen) + net->where_b;
/* The necessary size of net->buff */
if (helping >= net->max_packet)
{
if (net_realloc(net, helping))
{
len= packet_error; /* Return error */
goto end;
}
}
pos=net->buff + net->where_b;
remain = len;
}
}
end:
net->reading_or_writing=0;
return(len);
}
ulong ma_net_read(NET *net)
{
size_t len,complen;
#ifdef HAVE_COMPRESS
if (!net->compress)
{
#endif
len = ma_real_read (net,(size_t *)&complen);
if (len == MAX_PACKET_LENGTH)
{
/* multi packet read */
size_t length= 0;
ulong last_pos= net->where_b;
do
{
length+= len;
net->where_b+= (unsigned long)len;
len= ma_real_read(net, &complen);
} while (len == MAX_PACKET_LENGTH);
net->where_b= last_pos;
if (len != packet_error)
len+= length;
}
net->read_pos = net->buff + net->where_b;
if (len != packet_error)
net->read_pos[len]=0; /* Safeguard for mysql_use_result */
return (ulong)len;
#ifdef HAVE_COMPRESS
}
else
{
/*
compressed protocol:
--------------------------------------
packet_length 3
sequence_id 1
uncompressed_length 3
--------------------------------------
compressed data packet_length - 7
--------------------------------------
Another packet will follow if:
packet_length == MAX_PACKET_LENGTH
Last package will be identified by
- packet_length is zero (special case)
- packet_length < MAX_PACKET_LENGTH
*/
size_t packet_length,
buffer_length;
size_t current= 0, start= 0;
my_bool is_multi_packet= 0;
/* check if buffer is empty */
if (!net->remain_in_buf)
{
buffer_length= 0;
}
else
{
/* save position and restore \0 character */
buffer_length= net->buf_length;
current= net->buf_length - net->remain_in_buf;
start= current;
net->buff[net->buf_length - net->remain_in_buf]=net->save_char;
}
for (;;)
{
if (buffer_length - current >= 4)
{
uchar *pos= net->buff + current;
packet_length= uint3korr(pos);
/* check if we have last package (special case: zero length) */
if (!packet_length)
{
current+= 4; /* length + sequence_id,
no more data will follow */
break;
}
if (packet_length + 4 <= buffer_length - current)
{
if (!is_multi_packet)
{
current= current + packet_length + 4;
}
else
{
/* remove packet_header */
memmove(net->buff + current,
net->buff + current + 4,
buffer_length - current);
buffer_length-= 4;
current+= packet_length;
}
/* do we have last packet ? */
if (packet_length != MAX_PACKET_LENGTH)
{
is_multi_packet= 0;
break;
}
else
is_multi_packet= 1;
if (start)
{
memmove(net->buff, net->buff + start,
buffer_length - start);
/* decrease buflen*/
buffer_length-= start;
start= 0;
}
continue;
}
}
if (start)
{
memmove(net->buff, net->buff + start, buffer_length - start);
/* decrease buflen and current */
current -= start;
buffer_length-= start;
start= 0;
}
net->where_b=(unsigned long)buffer_length;
if ((packet_length = ma_real_read(net,(size_t *)&complen)) == packet_error)
return packet_error;
if (_mariadb_uncompress((unsigned char*) net->buff + net->where_b, &packet_length, &complen))
{
net->error=2; /* caller will close socket */
net->last_errno=ER_NET_UNCOMPRESS_ERROR;
break;
return packet_error;
}
buffer_length+= complen;
}
/* set values */
net->buf_length= (unsigned long)buffer_length;
net->remain_in_buf= (unsigned long)(buffer_length - current);
net->read_pos= net->buff + start + 4;
len= current - start - 4;
if (is_multi_packet)
len-= 4;
net->save_char= net->read_pos[len]; /* Must be saved */
net->read_pos[len]=0; /* Safeguard for mysql_use_result */
}
#endif
return (ulong)len;
}
int net_add_multi_command(NET *net, uchar command, const uchar *packet,
size_t length)
{
if (net->extension->multi_status == COM_MULTI_OFF)
{
return(1);
}
/* don't increase packet number */
net->compress_pkt_nr= net->pkt_nr= 0;
return ma_net_write_command(net, command, (const char *)packet, length, 1);
}
|
SlimKatLegacy/android_external_chromium_org
|
skia/ext/lazy_pixel_ref.cc
|
// 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.
#include "skia/ext/lazy_pixel_ref.h"
namespace skia {
#ifdef SK_SUPPORT_LEGACY_PIXELREF_CONSTRUCTOR
// DEPRECATED -- will remove after blink updates to pass info
LazyPixelRef::LazyPixelRef() {
}
#endif
LazyPixelRef::LazyPixelRef(const SkImageInfo& info) : SkPixelRef(info) {
}
LazyPixelRef::~LazyPixelRef() {
}
} // namespace skia
|
MihanixA/ydb-python-sdk
|
kikimr/public/api/grpc/draft/dummy_pb2_grpc.py
|
<reponame>MihanixA/ydb-python-sdk
# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
import grpc
from kikimr.public.api.grpc.draft import dummy_pb2 as kikimr_dot_public_dot_api_dot_grpc_dot_draft_dot_dummy__pb2
class DummyServiceStub(object):
# missing associated documentation comment in .proto file
pass
def __init__(self, channel):
"""Constructor.
Args:
channel: A grpc.Channel.
"""
self.Ping = channel.unary_unary(
'/Draft.Dummy.DummyService/Ping',
request_serializer=kikimr_dot_public_dot_api_dot_grpc_dot_draft_dot_dummy__pb2.PingRequest.SerializeToString,
response_deserializer=kikimr_dot_public_dot_api_dot_grpc_dot_draft_dot_dummy__pb2.PingResponse.FromString,
)
self.Infinite = channel.unary_unary(
'/Draft.Dummy.DummyService/Infinite',
request_serializer=kikimr_dot_public_dot_api_dot_grpc_dot_draft_dot_dummy__pb2.InfiniteRequest.SerializeToString,
response_deserializer=kikimr_dot_public_dot_api_dot_grpc_dot_draft_dot_dummy__pb2.InfiniteResponse.FromString,
)
self.BiStreamPing = channel.stream_stream(
'/Draft.Dummy.DummyService/BiStreamPing',
request_serializer=kikimr_dot_public_dot_api_dot_grpc_dot_draft_dot_dummy__pb2.PingRequest.SerializeToString,
response_deserializer=kikimr_dot_public_dot_api_dot_grpc_dot_draft_dot_dummy__pb2.PingResponse.FromString,
)
class DummyServiceServicer(object):
# missing associated documentation comment in .proto file
pass
def Ping(self, request, context):
# missing associated documentation comment in .proto file
pass
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def Infinite(self, request, context):
# missing associated documentation comment in .proto file
pass
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def BiStreamPing(self, request_iterator, context):
# missing associated documentation comment in .proto file
pass
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def add_DummyServiceServicer_to_server(servicer, server):
rpc_method_handlers = {
'Ping': grpc.unary_unary_rpc_method_handler(
servicer.Ping,
request_deserializer=kikimr_dot_public_dot_api_dot_grpc_dot_draft_dot_dummy__pb2.PingRequest.FromString,
response_serializer=kikimr_dot_public_dot_api_dot_grpc_dot_draft_dot_dummy__pb2.PingResponse.SerializeToString,
),
'Infinite': grpc.unary_unary_rpc_method_handler(
servicer.Infinite,
request_deserializer=kikimr_dot_public_dot_api_dot_grpc_dot_draft_dot_dummy__pb2.InfiniteRequest.FromString,
response_serializer=kikimr_dot_public_dot_api_dot_grpc_dot_draft_dot_dummy__pb2.InfiniteResponse.SerializeToString,
),
'BiStreamPing': grpc.stream_stream_rpc_method_handler(
servicer.BiStreamPing,
request_deserializer=kikimr_dot_public_dot_api_dot_grpc_dot_draft_dot_dummy__pb2.PingRequest.FromString,
response_serializer=kikimr_dot_public_dot_api_dot_grpc_dot_draft_dot_dummy__pb2.PingResponse.SerializeToString,
),
}
generic_handler = grpc.method_handlers_generic_handler(
'Draft.Dummy.DummyService', rpc_method_handlers)
server.add_generic_rpc_handlers((generic_handler,))
|
CoOwner/VisualPvP
|
com/google/common/io/Closeables.java
|
<gh_stars>0
package com.google.common.io;
import com.google.common.annotations.Beta;
import java.io.Closeable;
import java.io.IOException;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.annotation.Nullable;
@Beta
public final class Closeables
{
private static final Logger logger = Logger.getLogger(Closeables.class.getName());
private Closeables() {}
public static void close(@Nullable Closeable closeable, boolean swallowIOException)
throws IOException
{
if (closeable == null) {
return;
}
try {
closeable.close();
} catch (IOException e) {
if (swallowIOException) {
logger.log(Level.WARNING, "IOException thrown while closing Closeable.", e);
}
else {
throw e;
}
}
}
public static void closeQuietly(@Nullable Closeable closeable)
{
try
{
close(closeable, true);
} catch (IOException e) {
logger.log(Level.SEVERE, "IOException should not have been thrown.", e);
}
}
}
|
bplommer/trace4cats
|
modules/fs2/src/main/scala/io/janstenpickle/trace4cats/fs2/package.scala
|
package io.janstenpickle.trace4cats
import _root_.fs2.Stream
import cats.data.WriterT
package object fs2 {
type TracedStream[F[_], A] = WriterT[Stream[F, *], Span[F], A]
}
|
kodePhile/jacklyn-codebase
|
jacklyn-statistics/src/main/java/com/tcdng/jacklyn/statistics/data/QuickCategoryVisual.java
|
/*
* Copyright 2018-2020 The Code Department
*
* 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.tcdng.jacklyn.statistics.data;
/**
* Object with quick category visualization.
*
* @author <NAME>
* @since 1.0
*/
public class QuickCategoryVisual {
private QuickCategory quickCategory;
private byte[] presentation;
public QuickCategoryVisual(QuickCategory quickCategory, byte[] presentation) {
this.quickCategory = quickCategory;
this.presentation = presentation;
}
public QuickCategory getQuickCategory() {
return quickCategory;
}
public byte[] getPresentation() {
return presentation;
}
}
|
tanjunchen/GoLearn
|
GoProgramming/Chapter04/practice4.2_test.go
|
<gh_stars>1-10
package Chapter03
import (
"crypto/sha256"
"crypto/sha512"
"fmt"
"hash"
"os"
"strconv"
"testing"
)
func encrypt(s string, b int64) string {
var h hash.Hash
switch b {
case 384:
h = sha512.New384()
case 512:
h = sha512.New()
default:
h = sha256.New()
}
h.Write([]byte(s))
return string(h.Sum(nil))
}
// go test -v -run Test042 practice4.2_test.go -args 384 hello
func Test042(t *testing.T) {
bs := os.Args[4]
s := os.Args[5]
b, _ := strconv.ParseInt(bs, 10, 64)
fmt.Println(encrypt(s, b))
}
|
DomenART/stroydrevgroup
|
src/components/Landing/LandingBanners.js
|
<gh_stars>1-10
import React from 'react'
import styles from './LandingBanners.module.sass'
import SvgIcon from '../UI/SvgIcon'
const LandingBanners = () =>
<div className={styles.banners}>
<div className="uk-grid uk-grid-small" data-uk-grid>
<div className="uk-width-1-2@s uk-width-1-4@l">
<div className={`${styles.banner} ${styles.banner_orange}`}>
<div className={styles.left}>
<div className={styles.icon}>
<SvgIcon name="banner-1" style={{
fontSize: `${47 / 18}em`,
marginTop: `-${3 / 47}em`
}} />
</div>
</div>
<div className={styles.right}>
<div className={styles.addTitle}>Водоснабжение + отопление<br /> + электричество</div>
<div className={styles.addLink}>Дополнительные услуги</div>
</div>
</div>
</div>
<div className="uk-width-1-2@s uk-width-1-4@l">
<div className={`${styles.banner} ${styles.banner_red}`}>
<div className={styles.left}>
<div className={styles.icon}>
<SvgIcon name="banner-2" style={{
fontSize: `${56 / 18}em`,
marginTop: `-${1 / 56}em`
}} />
</div>
</div>
<div className={styles.right}>
<div className={styles.category}>При заказе</div>
<div className={styles.title}>Дом+Баня</div>
<div className={styles.info}>только до 28 мая 2018</div>
</div>
</div>
</div>
<div className="uk-width-1-2@s uk-width-1-4@l">
<div
className={`${styles.banner} ${styles.banner_green}`}
data-uk-toggle="target: #CalculationIndividual"
>
<div className={styles.left}>
<div className={styles.icon}>
<SvgIcon name="banner-3" style={{
fontSize: `${38 / 18}em`
}} />
</div>
</div>
<div className={styles.right}>
<div className={styles.indLink}>Индивидуальный расчет</div>
<div className={styles.indDesc}>
вашего проекта
<SvgIcon name="label-free" />
</div>
<div className={styles.indLoad}>Загрузите проект, мы рассчитаем его цену</div>
</div>
</div>
</div>
<div className="uk-width-1-2@s uk-width-1-4@l">
<div className={`${styles.banner} ${styles.banner_pink}`}>
<div className={styles.left}>
<div className={styles.icon}>
<SvgIcon name="banner-4" style={{
fontSize: `${43 / 18}em`,
marginTop: `-${1 / 43}em`
}} />
</div>
</div>
<div className={styles.right}>
<div className={styles.category}>выгодные условия</div>
<div className={styles.title}>Доставка</div>
<div className={styles.info}>Уточняйте у менеджеров</div>
</div>
</div>
</div>
</div>
</div>
export default LandingBanners
|
Alenichel/MartinaNichelini-DistributedJobScheduling
|
src/main/java/Messages/Message.java
|
<reponame>Alenichel/MartinaNichelini-DistributedJobScheduling
package Messages;
import Enumeration.MessageType;
import java.io.Serializable;
public abstract class Message implements Serializable {
protected MessageType type;
public Message(){
this.type = type;
}
public MessageType getType(){
return this.type;
}
@Override
public String toString() {
return this.type.toString();
}
}
|
smallcarp/ebean
|
src/test/java/com/avaje/tests/model/embedded/EInvoice.java
|
package com.avaje.tests.model.embedded;
import com.avaje.ebean.annotation.Cache;
import java.util.Date;
import javax.persistence.AttributeOverride;
import javax.persistence.AttributeOverrides;
import javax.persistence.Column;
import javax.persistence.Embedded;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.ManyToOne;
import javax.persistence.Version;
@Cache
@Entity
public class EInvoice {
public enum State {
New, Processing, Approved
}
@Id
Long id;
@Version
Long version;
Date invoiceDate;
State state;
@ManyToOne
EPerson person;
@Embedded
@AttributeOverrides({
@AttributeOverride(name = "street", column = @Column(name = "ship_street")),
@AttributeOverride(name = "suburb", column = @Column(name = "ship_suburb")),
@AttributeOverride(name = "city", column = @Column(name = "ship_city"))
})
EAddress shipAddress;
@Embedded
EAddress billAddress;
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public Long getVersion() {
return version;
}
public void setVersion(Long version) {
this.version = version;
}
public State getState() {
return state;
}
public void setState(State state) {
this.state = state;
}
public Date getInvoiceDate() {
return invoiceDate;
}
public void setInvoiceDate(Date invoiceDate) {
this.invoiceDate = invoiceDate;
}
public EPerson getPerson() {
return person;
}
public void setPerson(EPerson person) {
this.person = person;
}
public EAddress getShipAddress() {
return shipAddress;
}
public void setShipAddress(EAddress shipAddress) {
this.shipAddress = shipAddress;
}
public EAddress getBillAddress() {
return billAddress;
}
public void setBillAddress(EAddress billAddress) {
this.billAddress = billAddress;
}
}
|
StaticMian/jstorm
|
jstorm-core/src/main/java/com/alibaba/jstorm/metric/MetricDef.java
|
/**
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you 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.alibaba.jstorm.metric;
import java.util.HashSet;
import java.util.Set;
public class MetricDef {
// metric name for task
public static final String QUEUE_TYPE = "Queue";
public static final String TIME_TYPE = "Time";
public static final String DESERIALIZE_THREAD = "Deserialize";
public static final String DESERIALIZE_QUEUE = DESERIALIZE_THREAD + QUEUE_TYPE;
public static final String DESERIALIZE_TIME = DESERIALIZE_THREAD + TIME_TYPE;
public static final String SERIALIZE_THREAD = "Serialize";
public static final String SERIALIZE_QUEUE = SERIALIZE_THREAD + QUEUE_TYPE;
public static final String SERIALIZE_TIME = SERIALIZE_THREAD + TIME_TYPE;
public static final String EXECUTE_THREAD = "Executor";
public static final String EXECUTE_QUEUE = EXECUTE_THREAD + QUEUE_TYPE;
public static final String EXECUTE_TIME = EXECUTE_THREAD + TIME_TYPE;
public static final String ACKER_TIME = "AckerTime";
public static final String EMPTY_CPU_RATIO = "EmptyCpuRatio";
public static final String PENDING_MAP = "PendingNum";
public static final String COLLECTOR_EMIT_TIME = "EmitTime";
public static final String TUPLE_LIEF_CYCLE = "TupleLifeCycle";
public static final String CAPACITY = "Capacity";
public static final String CONTROL_THREAD = "Ctrl";
public static final String CONTROL_QUEUE = CONTROL_THREAD + QUEUE_TYPE;
public static final String TASK_BATCH_INTERVAL_TIME = "BatchInterTime";
public static final String RECV_CTRL_QUEUE = "RecvCtrl" + QUEUE_TYPE;
public static final String RECV_THREAD = "RecvCtrl";
public static final String BATCH_RECV_THREAD = "BatchRecvCtrl";
public static final String BATCH_RECV_QUEUE = BATCH_RECV_THREAD + QUEUE_TYPE;
public static final String SEND_THREAD = "SendCtrl";
public static final String BATCH_SEND_THREAD = "BatchSendCtrl";
public static final String BATCH_SEND_QUEUE = BATCH_SEND_THREAD + QUEUE_TYPE;
public static final String SEND_QUEUE = "SendCtrl" + QUEUE_TYPE;
public static final String NETWORK_MSG_DECODE_TIME = "MsgDecodeTime";
// all tag start with "Netty" will be specially display in Web UI
public static final String NETTY = "Netty";
public static final String NETTY_CLI = NETTY + "Cli";
public static final String NETTY_SRV = NETTY + "Srv";
public static final String NETTY_CLI_SEND_SPEED = NETTY_CLI + "SendSpeed";
public static final String NETTY_SRV_RECV_SPEED = NETTY_SRV + "RecvSpeed";
public static final String NETTY_CLI_SEND_TIME = NETTY_CLI + "SendTime";
public static final String NETTY_CLI_BATCH_SIZE = NETTY_CLI + "SendBatchSize";
public static final String NETTY_CLI_SEND_PENDING = NETTY_CLI + "SendPending";
public static final String NETTY_CLI_SYNC_BATCH_QUEUE = NETTY_CLI + "SyncBatchQ";
public static final String NETTY_CLI_SYNC_DISR_QUEUE = NETTY_CLI + "SyncDisrQ";
public static final String NETTY_CLI_CACHE_SIZE = NETTY_CLI + "CacheSize";
public static final String NETTY_CLI_CONNECTION = NETTY_CLI + "ConnCheck";
// metric name for worker
public static final String NETTY_SRV_MSG_TRANS_TIME = NETTY_SRV + "TransmitTime";
public static final String CPU_USED_RATIO = "CpuUsedRatio";
public static final String MEMORY_USED = "MemoryUsed";
public static final String HEAP_MEMORY_USED = "HeapMemory";
public static final String MEMORY_USAGE = "MemoryUsage";
public static final String DISK_USAGE = "DiskUsage";
public static final String EMMITTED_NUM = "Emitted";
public static final String ACKED_NUM = "Acked";
public static final String FAILED_NUM = "Failed";
public static final String SEND_TPS = "SendTps";
public static final String RECV_TPS = "RecvTps";
public static final String PROCESS_LATENCY = "ProcessLatency";
public static final String FULL_GC = "FullGc";
public static final String NETSENDSPEED = "NetSendSpeed";
public static final String NETRECVSPEED = "NetRecvSpeed";
public static final Set<String> MERGE_SUM_TAG = new HashSet<String>();
static {
MERGE_SUM_TAG.add(MetricDef.EMMITTED_NUM);
MERGE_SUM_TAG.add(MetricDef.SEND_TPS);
MERGE_SUM_TAG.add(MetricDef.RECV_TPS);
MERGE_SUM_TAG.add(MetricDef.ACKED_NUM);
MERGE_SUM_TAG.add(MetricDef.FAILED_NUM);
}
public static final Set<String> MERGE_AVG_TAG = new HashSet<String>();
static {
MERGE_AVG_TAG.add(PROCESS_LATENCY);
}
public static final double FULL_RATIO = 100.0;
public static final String QEUEU_IS_FULL = "queue is full";
public static final Set<String> TASK_QUEUE_SET = new HashSet<String>();
static {
TASK_QUEUE_SET.add(DESERIALIZE_QUEUE);
TASK_QUEUE_SET.add(SERIALIZE_QUEUE);
TASK_QUEUE_SET.add(EXECUTE_QUEUE);
TASK_QUEUE_SET.add(CONTROL_QUEUE);
}
public static final Set<String> WORKER_QUEUE_SET = new HashSet<String>();
static {
WORKER_QUEUE_SET.add(RECV_CTRL_QUEUE);
WORKER_QUEUE_SET.add(SEND_QUEUE);
}
public static final int NETTY_METRICS_PACKAGE_SIZE = 200;
public static boolean isNettyDetails(String metricName) {
Set<String> specialNettySet = new HashSet<String>();
specialNettySet.add(MetricDef.NETTY_CLI_SEND_SPEED);
specialNettySet.add(MetricDef.NETTY_SRV_RECV_SPEED);
if (specialNettySet.contains(metricName)) {
return false;
}
if (metricName.startsWith(MetricDef.NETTY)) {
return true;
}
return false;
}
}
|
mdop-wh/pulumi-aws
|
sdk/python/pulumi_aws/datasync/nfs_location.py
|
<gh_stars>0
# coding=utf-8
# *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Dict, List, Mapping, Optional, Tuple, Union
from .. import _utilities, _tables
from . import outputs
from ._inputs import *
__all__ = ['NfsLocation']
class NfsLocation(pulumi.CustomResource):
def __init__(__self__,
resource_name: str,
opts: Optional[pulumi.ResourceOptions] = None,
on_prem_config: Optional[pulumi.Input[pulumi.InputType['NfsLocationOnPremConfigArgs']]] = None,
server_hostname: Optional[pulumi.Input[str]] = None,
subdirectory: Optional[pulumi.Input[str]] = None,
tags: Optional[pulumi.Input[Mapping[str, pulumi.Input[str]]]] = None,
__props__=None,
__name__=None,
__opts__=None):
"""
Manages an NFS Location within AWS DataSync.
> **NOTE:** The DataSync Agents must be available before creating this resource.
## Example Usage
```python
import pulumi
import pulumi_aws as aws
example = aws.datasync.NfsLocation("example",
server_hostname="nfs.example.com",
subdirectory="/exported/path",
on_prem_config=aws.datasync.NfsLocationOnPremConfigArgs(
agent_arns=[aws_datasync_agent["example"]["arn"]],
))
```
:param str resource_name: The name of the resource.
:param pulumi.ResourceOptions opts: Options for the resource.
:param pulumi.Input[pulumi.InputType['NfsLocationOnPremConfigArgs']] on_prem_config: Configuration block containing information for connecting to the NFS File System.
:param pulumi.Input[str] server_hostname: Specifies the IP address or DNS name of the NFS server. The DataSync Agent(s) use this to mount the NFS server.
:param pulumi.Input[str] subdirectory: Subdirectory to perform actions as source or destination. Should be exported by the NFS server.
:param pulumi.Input[Mapping[str, pulumi.Input[str]]] tags: Key-value pairs of resource tags to assign to the DataSync Location.
"""
if __name__ is not None:
warnings.warn("explicit use of __name__ is deprecated", DeprecationWarning)
resource_name = __name__
if __opts__ is not None:
warnings.warn("explicit use of __opts__ is deprecated, use 'opts' instead", DeprecationWarning)
opts = __opts__
if opts is None:
opts = pulumi.ResourceOptions()
if not isinstance(opts, pulumi.ResourceOptions):
raise TypeError('Expected resource options to be a ResourceOptions instance')
if opts.version is None:
opts.version = _utilities.get_version()
if opts.id is None:
if __props__ is not None:
raise TypeError('__props__ is only valid when passed in combination with a valid opts.id to get an existing resource')
__props__ = dict()
if on_prem_config is None:
raise TypeError("Missing required property 'on_prem_config'")
__props__['on_prem_config'] = on_prem_config
if server_hostname is None:
raise TypeError("Missing required property 'server_hostname'")
__props__['server_hostname'] = server_hostname
if subdirectory is None:
raise TypeError("Missing required property 'subdirectory'")
__props__['subdirectory'] = subdirectory
__props__['tags'] = tags
__props__['arn'] = None
__props__['uri'] = None
super(NfsLocation, __self__).__init__(
'aws:datasync/nfsLocation:NfsLocation',
resource_name,
__props__,
opts)
@staticmethod
def get(resource_name: str,
id: pulumi.Input[str],
opts: Optional[pulumi.ResourceOptions] = None,
arn: Optional[pulumi.Input[str]] = None,
on_prem_config: Optional[pulumi.Input[pulumi.InputType['NfsLocationOnPremConfigArgs']]] = None,
server_hostname: Optional[pulumi.Input[str]] = None,
subdirectory: Optional[pulumi.Input[str]] = None,
tags: Optional[pulumi.Input[Mapping[str, pulumi.Input[str]]]] = None,
uri: Optional[pulumi.Input[str]] = None) -> 'NfsLocation':
"""
Get an existing NfsLocation resource's state with the given name, id, and optional extra
properties used to qualify the lookup.
:param str resource_name: The unique name of the resulting resource.
:param pulumi.Input[str] id: The unique provider ID of the resource to lookup.
:param pulumi.ResourceOptions opts: Options for the resource.
:param pulumi.Input[str] arn: Amazon Resource Name (ARN) of the DataSync Location.
:param pulumi.Input[pulumi.InputType['NfsLocationOnPremConfigArgs']] on_prem_config: Configuration block containing information for connecting to the NFS File System.
:param pulumi.Input[str] server_hostname: Specifies the IP address or DNS name of the NFS server. The DataSync Agent(s) use this to mount the NFS server.
:param pulumi.Input[str] subdirectory: Subdirectory to perform actions as source or destination. Should be exported by the NFS server.
:param pulumi.Input[Mapping[str, pulumi.Input[str]]] tags: Key-value pairs of resource tags to assign to the DataSync Location.
"""
opts = pulumi.ResourceOptions.merge(opts, pulumi.ResourceOptions(id=id))
__props__ = dict()
__props__["arn"] = arn
__props__["on_prem_config"] = on_prem_config
__props__["server_hostname"] = server_hostname
__props__["subdirectory"] = subdirectory
__props__["tags"] = tags
__props__["uri"] = uri
return NfsLocation(resource_name, opts=opts, __props__=__props__)
@property
@pulumi.getter
def arn(self) -> pulumi.Output[str]:
"""
Amazon Resource Name (ARN) of the DataSync Location.
"""
return pulumi.get(self, "arn")
@property
@pulumi.getter(name="onPremConfig")
def on_prem_config(self) -> pulumi.Output['outputs.NfsLocationOnPremConfig']:
"""
Configuration block containing information for connecting to the NFS File System.
"""
return pulumi.get(self, "on_prem_config")
@property
@pulumi.getter(name="serverHostname")
def server_hostname(self) -> pulumi.Output[str]:
"""
Specifies the IP address or DNS name of the NFS server. The DataSync Agent(s) use this to mount the NFS server.
"""
return pulumi.get(self, "server_hostname")
@property
@pulumi.getter
def subdirectory(self) -> pulumi.Output[str]:
"""
Subdirectory to perform actions as source or destination. Should be exported by the NFS server.
"""
return pulumi.get(self, "subdirectory")
@property
@pulumi.getter
def tags(self) -> pulumi.Output[Optional[Mapping[str, str]]]:
"""
Key-value pairs of resource tags to assign to the DataSync Location.
"""
return pulumi.get(self, "tags")
@property
@pulumi.getter
def uri(self) -> pulumi.Output[str]:
return pulumi.get(self, "uri")
def translate_output_property(self, prop):
return _tables.CAMEL_TO_SNAKE_CASE_TABLE.get(prop) or prop
def translate_input_property(self, prop):
return _tables.SNAKE_TO_CAMEL_CASE_TABLE.get(prop) or prop
|
duranfatih/ccd-data-store-api
|
src/main/java/uk/gov/hmcts/ccd/domain/service/search/global/LocationCollector.java
|
package uk.gov.hmcts.ccd.domain.service.search.global;
import uk.gov.hmcts.ccd.domain.model.refdata.BuildingLocation;
import uk.gov.hmcts.ccd.domain.model.refdata.LocationLookup;
import java.util.Set;
import java.util.function.BiConsumer;
import java.util.function.BinaryOperator;
import java.util.function.Function;
import java.util.function.Supplier;
import java.util.stream.Collector;
import static java.util.stream.Collector.Characteristics.IDENTITY_FINISH;
import static java.util.stream.Collector.Characteristics.UNORDERED;
public class LocationCollector implements Collector<BuildingLocation, LocationLookup, LocationLookup> {
@Override
public Supplier<LocationLookup> supplier() {
return LocationLookup::new;
}
@Override
public BiConsumer<LocationLookup, BuildingLocation> accumulator() {
return LocationLookup::add;
}
@Override
public BinaryOperator<LocationLookup> combiner() {
return (LocationLookup::combine);
}
@Override
public Function<LocationLookup, LocationLookup> finisher() {
return Function.identity();
}
@Override
public Set<Characteristics> characteristics() {
return Set.of(IDENTITY_FINISH, UNORDERED);
}
public static LocationCollector toLocationLookup() {
return new LocationCollector();
}
}
|
kemitix/kemitix-checkstyle-ruleset
|
builder/src/main/java/net/kemitix/checkstyle/ruleset/builder/SourcesProperties.java
|
package net.kemitix.checkstyle.ruleset.builder;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Configuration;
import java.util.ArrayList;
import java.util.List;
import java.util.Optional;
/**
* Properties defining the sources.
*
* @author <NAME> (<EMAIL>)
*/
@Configuration
@ConfigurationProperties("")
class SourcesProperties {
private final List<RuleSource> sources = new ArrayList<>();
public void setSources(final List<RuleSource> sources) {
this.sources.clear();
this.sources.addAll(sources);
}
public List<RuleSource> getSources() {
return new ArrayList<>(sources);
}
/**
* Search for a RuleSource by name.
*
* @param sourceName the name of the source
* @return an Optional containing the RuleSource if found
*/
public Optional<RuleSource> findSource(final String sourceName) {
return sources.stream()
.filter(ruleSource -> ruleSource.getName().equals(sourceName))
.findFirst();
}
}
|
david-house-harvard/canvas_python_sdk
|
canvas_sdk/methods/comm_messages.py
|
<filename>canvas_sdk/methods/comm_messages.py<gh_stars>10-100
from canvas_sdk import client, utils
def list_of_commmessages_for_user(request_ctx, user_id, start_time=None, end_time=None, per_page=None, **request_kwargs):
"""
Retrieve messages sent to a user.
:param request_ctx: The request context
:type request_ctx: :class:RequestContext
:param user_id: (required) The user id for whom you want to retrieve CommMessages
:type user_id: string
:param start_time: (optional) The beginning of the time range you want to retrieve message from.
:type start_time: datetime or None
:param end_time: (optional) The end of the time range you want to retrieve messages for.
:type end_time: datetime or None
:param per_page: (optional) Set how many results canvas should return, defaults to config.LIMIT_PER_PAGE
:type per_page: integer or None
:return: List of CommMessages for a user
:rtype: requests.Response (with array data)
"""
if per_page is None:
per_page = request_ctx.per_page
path = '/v1/comm_messages'
payload = {
'user_id' : user_id,
'start_time' : start_time,
'end_time' : end_time,
'per_page' : per_page,
}
url = request_ctx.base_api_url + path.format()
response = client.get(request_ctx, url, payload=payload, **request_kwargs)
return response
|
IronPans/vary-admin
|
src/base/vary-ui/components/color-picker/index.js
|
export {default} from './color-picker';
|
flexiodata/flexio-sdk-js
|
examples-src/examples/pipe/render/index.js
|
import render_a_webpage from './render-a-webpage'
export default {
title: 'Render',
descripton: '',
items: [
render_a_webpage
]
}
|
LiskHQ/lisk-service
|
tests/regression/api_v2/testnet/rpc/blocks.test.js
|
/*
* LiskHQ/lisk-service
* Copyright © 2021 Lisk Foundation
*
* See the LICENSE file at the top-level directory of this distribution
* for licensing information.
*
* Unless otherwise agreed in a custom licensing agreement with the Lisk Foundation,
* no part of this software, including this file, may be copied, modified,
* propagated, or distributed except according to the terms contained in the
* LICENSE file.
*
* Removal or modification of this copyright notice is prohibited.
*
*/
const config = require('../../../../config');
const { request } = require('../../../../helpers/socketIoRpcRequest');
const {
genesisBlock,
blockByHeight,
blocksBetweenHeight,
blocksBetweenTimestamp,
blocksByGeneratorAddress,
blocksByGeneratorPublicKey,
blocksByGeneratorUsername,
} = require('../expectedResponse/rpc/blocks');
const wsRpcUrl = `${config.SERVICE_ENDPOINT}/rpc-v2`;
const getBlocks = async params => request(wsRpcUrl, 'get.blocks', params);
describe('Blocks API', () => {
it(`Retrieve genesis block by height: ${genesisBlock.result.data[0].height}`, async () => {
const genesisHeight = `${genesisBlock.result.data[0].height}`;
const response = await getBlocks({ height: genesisHeight });
expect(response).toStrictEqual(genesisBlock);
});
it(`Retrieve genesis block by blockId: ${genesisBlock.result.data[0].id}`, async () => {
const genesisBlockId = `${genesisBlock.result.data[0].id}`;
const response = await getBlocks({ blockId: genesisBlockId });
expect(response).toStrictEqual(genesisBlock);
});
it(`Retrieve a block by height: ${blockByHeight.result.data[0].height}`, async () => {
const blockHeight = `${blockByHeight.result.data[0].height}`;
const response = await getBlocks({ height: blockHeight });
expect(response).toStrictEqual(blockByHeight);
});
it('Retrieve a block between heights', async () => {
const fromHeight = blocksBetweenHeight.result.data[0].height
- (blocksBetweenHeight.result.meta.total - 1);
const toHeight = blocksBetweenHeight.result.data[0].height;
const response = await getBlocks({ height: `${fromHeight}:${toHeight}` });
expect(response).toStrictEqual(blocksBetweenHeight);
});
it('Retrieve a block between timestamps', async () => {
const toTime = blocksBetweenTimestamp.result.data[0].timestamp;
const fromTime = toTime - blocksBetweenTimestamp.result.meta.total * 10;
const response = await getBlocks({ timestamp: `${fromTime}:${toTime}` });
expect(response).toStrictEqual(blocksBetweenTimestamp);
});
it('Retrieve blocks by generatorAddress', async () => {
const { generatorAddress } = blocksByGeneratorAddress.result.data[0];
const response = await getBlocks({ generatorAddress, sort: 'timestamp:asc' });
// response.data
expect(response.result.data).toStrictEqual(blocksByGeneratorAddress.result.data);
// response.meta
expect(response.result.meta.count).toStrictEqual(blocksByGeneratorAddress.result.meta.count);
expect(response.result.meta.offset).toStrictEqual(blocksByGeneratorAddress.result.meta.offset);
expect(response.result.meta.total)
.toBeGreaterThanOrEqual(blocksByGeneratorAddress.result.meta.total);
});
it('Retrieve blocks by generatorPublicKey', async () => {
const { generatorPublicKey } = blocksByGeneratorPublicKey.result.data[0];
const response = await getBlocks({ generatorPublicKey, sort: 'timestamp:asc' });
// response.data
expect(response.result.data).toStrictEqual(blocksByGeneratorPublicKey.result.data);
// response.meta
expect(response.result.meta.count).toStrictEqual(blocksByGeneratorPublicKey.result.meta.count);
expect(response.result.meta.offset)
.toStrictEqual(blocksByGeneratorPublicKey.result.meta.offset);
expect(response.result.meta.total)
.toBeGreaterThanOrEqual(blocksByGeneratorPublicKey.result.meta.total);
});
it('Retrieve blocks by generatorUsername', async () => {
const { generatorUsername } = blocksByGeneratorUsername.result.data[0];
const response = await getBlocks({ generatorUsername, sort: 'timestamp:asc' });
// response.data
expect(response.result.data).toStrictEqual(blocksByGeneratorUsername.result.data);
// response.meta
expect(response.result.meta.count).toStrictEqual(blocksByGeneratorUsername.result.meta.count);
expect(response.result.meta.offset).toStrictEqual(blocksByGeneratorUsername.result.meta.offset);
expect(response.result.meta.total)
.toBeGreaterThanOrEqual(blocksByGeneratorUsername.result.meta.total);
});
});
|
Half-Shot/FarnApp
|
src/android/support/v4/view/MotionEventCompat$EclairMotionEventVersionImpl.java
|
<gh_stars>1-10
// Decompiled by Jad v1.5.8e. Copyright 2001 <NAME>.
// Jad home page: http://www.geocities.com/kpdus/jad.html
// Decompiler options: braces fieldsfirst space lnc
package android.support.v4.view;
import android.view.MotionEvent;
// Referenced classes of package android.support.v4.view:
// MotionEventCompatEclair, MotionEventCompat
static class
implements
{
public int findPointerIndex(MotionEvent motionevent, int i)
{
return MotionEventCompatEclair.findPointerIndex(motionevent, i);
}
public int getPointerCount(MotionEvent motionevent)
{
return MotionEventCompatEclair.getPointerCount(motionevent);
}
public int getPointerId(MotionEvent motionevent, int i)
{
return MotionEventCompatEclair.getPointerId(motionevent, i);
}
public float getX(MotionEvent motionevent, int i)
{
return MotionEventCompatEclair.getX(motionevent, i);
}
public float getY(MotionEvent motionevent, int i)
{
return MotionEventCompatEclair.getY(motionevent, i);
}
()
{
}
}
|
xana43/CodeLyokoMod-1.12.2
|
OriginalMappings/com/Ultra_Nerd/CodeLyokoLegacy/Entity/rend/OverboardRenderer.java
|
package com.Ultra_Nerd.CodeLyokoLegacy.Entity.rend;
import com.Ultra_Nerd.CodeLyokoLegacy.CodeLyokoMain;
import com.Ultra_Nerd.CodeLyokoLegacy.Entity.model.ModelOverboard;
import com.Ultra_Nerd.CodeLyokoLegacy.Entity.vehicle.OverboardEntity;
import net.minecraft.client.MinecraftClient;
import net.minecraft.client.render.OverlayTexture;
import net.minecraft.client.render.VertexConsumer;
import net.minecraft.client.render.VertexConsumerProvider;
import net.minecraft.client.render.entity.EntityRenderer;
import net.minecraft.client.render.entity.EntityRendererFactory;
import net.minecraft.client.render.entity.model.EntityModel;
import net.minecraft.client.util.math.MatrixStack;
import net.minecraft.util.Identifier;
import net.minecraft.util.math.Vec3f;
import org.jetbrains.annotations.NotNull;
import javax.annotation.Nonnull;
public final class OverboardRenderer<T extends OverboardEntity> extends EntityRenderer<T> {
private final @NotNull EntityModel<T> OverBoardModel;
public OverboardRenderer(EntityRendererFactory.@NotNull Context renderManager) {
super(renderManager);
this.shadowRadius = 1f;
this.OverBoardModel = new ModelOverboard<>(renderManager.getPart(ModelOverboard.LAYER_LOCATION));
}
private static final Identifier OVERBOARD_TEX = CodeLyokoMain.CodeLyokoPrefix("textures/entity/overboard/overboarduv.png");
@Override
public Identifier getTexture(final T entity) {
return OVERBOARD_TEX;
}
@Override
public void render(@Nonnull T entityIn, float entityYaw, float partialTicks, @Nonnull MatrixStack matrixStackIn, @Nonnull VertexConsumerProvider bufferIn, int packedLightIn) {
super.render(entityIn, entityYaw, partialTicks, matrixStackIn, bufferIn, packedLightIn);
matrixStackIn.push();
matrixStackIn.scale(-2F, -2F, 2.0F);
matrixStackIn.translate(0, -1.5f, 0);
matrixStackIn.multiply(Vec3f.POSITIVE_Y.getDegreesQuaternion(360 + entityYaw));
//assert MinecraftClient.getInstance().player != null;
//this.OverBoardModel.setAngles(entityIn, 0, 0, 0, 0, 0);
final VertexConsumer vertexBuilder = bufferIn.getBuffer(this.OverBoardModel.getLayer(this.getTexture(entityIn)));
this.OverBoardModel.render(matrixStackIn, vertexBuilder, packedLightIn, OverlayTexture.DEFAULT_UV, 1, 1, 1, 1);
matrixStackIn.pop();
}
}
|
nameless323/DXRplayground
|
DXRplayground/Source/DXrenderer/ResourceDX.h
|
#pragma once
#include "External/Dx12Helpers/d3dx12.h"
#include "DXrenderer/DXhelpers.h"
namespace DirectxPlayground
{
class ResourceDX
{
public:
ResourceDX() = default;
ResourceDX(D3D12_RESOURCE_STATES initialState);
~ResourceDX() = default;
ID3D12Resource* Get() const;
ID3D12Resource* Get();
ID3D12Resource** GetAddressOf();
void SetName(const std::string& name);
void SetName(const std::wstring& name);
void SetInitialState(D3D12_RESOURCE_STATES state);
D3D12_RESOURCE_STATES GetCurrentState() const;
bool GetBarrier(D3D12_RESOURCE_STATES after, CD3DX12_RESOURCE_BARRIER& transition);
CD3DX12_RESOURCE_BARRIER GetBarrier(D3D12_RESOURCE_STATES after);
void Transition(ID3D12GraphicsCommandList* cmdList, D3D12_RESOURCE_STATES after);
Microsoft::WRL::ComPtr<ID3D12Resource>& GetWrlPtr();
private:
Microsoft::WRL::ComPtr<ID3D12Resource> m_resource = nullptr;
D3D12_RESOURCE_STATES m_state = D3D12_RESOURCE_STATE_GENERIC_READ;
bool m_initialStateSet = false;
};
inline ResourceDX::ResourceDX(D3D12_RESOURCE_STATES initialState) : m_state(initialState), m_initialStateSet(true)
{}
inline ID3D12Resource* ResourceDX::Get() const
{
return m_resource.Get();
}
inline ID3D12Resource* ResourceDX::Get()
{
return m_resource.Get();
}
inline ID3D12Resource** ResourceDX::GetAddressOf()
{
return m_resource.GetAddressOf();
}
inline void ResourceDX::SetName(const std::string& name)
{
std::wstring n{ name.begin(), name.end() };
SetName(n);
}
inline void ResourceDX::SetName(const std::wstring& name)
{
SetDXobjectName(Get(), name.c_str());
}
inline void ResourceDX::SetInitialState(D3D12_RESOURCE_STATES state)
{
m_state = state;
m_initialStateSet = true;
}
inline D3D12_RESOURCE_STATES ResourceDX::GetCurrentState() const
{
assert(m_initialStateSet);
return m_state;
}
inline bool ResourceDX::GetBarrier(D3D12_RESOURCE_STATES after, CD3DX12_RESOURCE_BARRIER& transition)
{
assert(m_initialStateSet);
if (after == m_state)
return false;
transition = CD3DX12_RESOURCE_BARRIER::Transition(Get(), m_state, after);
m_state = after;
return true;
}
inline CD3DX12_RESOURCE_BARRIER ResourceDX::GetBarrier(D3D12_RESOURCE_STATES after)
{
assert(m_initialStateSet);
assert(m_state != after);
m_state = after;
return CD3DX12_RESOURCE_BARRIER::Transition(Get(), m_state, after);
}
inline void ResourceDX::Transition(ID3D12GraphicsCommandList* cmdList, D3D12_RESOURCE_STATES after)
{
assert(m_initialStateSet);
assert(after != m_state);
CD3DX12_RESOURCE_BARRIER barrier = CD3DX12_RESOURCE_BARRIER::Transition(Get(), m_state, after);
m_state = after;
cmdList->ResourceBarrier(1, &barrier);
}
inline Microsoft::WRL::ComPtr<ID3D12Resource>& ResourceDX::GetWrlPtr()
{
return m_resource;
}
}
|
ria-ee/monitor
|
opendata_module/anonymizer/tests/test_anonymizer.py
|
<gh_stars>1-10
import os
import datetime
import unittest
from unittest.mock import Mock
from ..anonymizer import Anonymizer
from ..iio.mongodb_manager import PreviousRunManager
ROOT_DIR = os.path.abspath(os.path.dirname(__file__))
class TestAnonymizer(unittest.TestCase):
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
self.maxDiff = None
def test_allowed_fields_parsing(self):
anonymizer_instance = Mock()
allowed_fields = Anonymizer._get_allowed_fields(
anonymizer_instance, os.path.join(ROOT_DIR, 'data', 'test_field_translations.list'))
expected_allowed_fields = ['client.requestInTs', 'producer.requestInTs', 'client.securityServerType', 'totalDuration']
self.assertCountEqual(expected_allowed_fields, allowed_fields)
def test_hiding_rules_parsing(self):
self.assertTrue(True)
def test_hiding_rules_parsing(self):
self.assertTrue(True)
def test_substitution_rules_parsing(self):
self.assertTrue(True)
def test_transformers_parsing(self):
self.assertTrue(True)
def test_field_translation_parsing(self):
anonymizer_instance = Mock()
field_translations = Anonymizer._get_field_translations(
anonymizer_instance, os.path.join(ROOT_DIR, 'data', 'test_field_translations.list'))
expected_field_translations = {
'client': {
'requestInTs': 'requestInTs',
'securityServerType': 'securityServerType',
},
'producer': {
'requestInTs': 'requestInTs',
},
'totalDuration': 'totalDuration',
}
self.assertEqual(expected_field_translations, field_translations)
def test_field_value_mask_parsing(self):
anonymizer_instance = Mock()
field_agent_masks = Anonymizer._get_field_value_masks(
anonymizer_instance, os.path.join(ROOT_DIR, 'data', 'test_field_data.yaml'))
expected_field_agent_masks = {'client': set(['producerDurationProducerView']), 'producer': set(['totalDuration'])}
self.assertEqual(expected_field_agent_masks, field_agent_masks)
# def test_last_anonymization_timestamp_storing(self):
# new_sqlite_db_path = 'temp.db'
# previous_run_manager = PreviousRunManager(new_sqlite_db_path)
#
# current_time = datetime.datetime.now().timestamp()
# previous_run_manager.set_previous_run(current_time)
#
# fetched_time = previous_run_manager.get_previous_run()
#
# self.assertEqual(current_time, fetched_time)
#
# os.remove(new_sqlite_db_path)
|
vlad-roid/OneSignal-Android-SDK
|
OneSignalSDK/unittest/src/test/java/com/onesignal/ShadowNotificationLimitManager.java
|
package com.onesignal;
import org.robolectric.annotation.Implements;
@Implements(NotificationLimitManager.class)
public class ShadowNotificationLimitManager {
private static int MAX_NUMBER_OF_NOTIFICATIONS_INT = 2;
public static int getMaxNumberOfNotificationsInt() {
return MAX_NUMBER_OF_NOTIFICATIONS_INT;
}
public static String getMaxNumberOfNotificationsString() {
return Integer.toString(MAX_NUMBER_OF_NOTIFICATIONS_INT);
}
}
|
gputtley/cmssw
|
Geometry/MTCCTrackerCommonData/plugins/DDTIBLayerAlgo_MTCC.cc
|
<reponame>gputtley/cmssw
///////////////////////////////////////////////////////////////////////////////
// File: DDTIBLayerAlgo_MTCC.cc
// Description: Makes a TIB layer and position the strings with a tilt angle
///////////////////////////////////////////////////////////////////////////////
#include <cmath>
#include <algorithm>
#include "FWCore/MessageLogger/interface/MessageLogger.h"
#include "DetectorDescription/Core/interface/DDLogicalPart.h"
#include "DetectorDescription/Core/interface/DDSolid.h"
#include "DetectorDescription/Core/interface/DDMaterial.h"
#include "DetectorDescription/Core/interface/DDCurrentNamespace.h"
#include "DetectorDescription/Core/interface/DDSplit.h"
#include "Geometry/MTCCTrackerCommonData/plugins/DDTIBLayerAlgo_MTCC.h"
#include "CLHEP/Units/GlobalPhysicalConstants.h"
#include "CLHEP/Units/GlobalSystemOfUnits.h"
DDTIBLayerAlgo_MTCC::DDTIBLayerAlgo_MTCC() : ribW(0), ribPhi(0) {
LogDebug("TIBGeom") << "DDTIBLayerAlgo_MTCC info: Creating an instance";
}
DDTIBLayerAlgo_MTCC::~DDTIBLayerAlgo_MTCC() {}
void DDTIBLayerAlgo_MTCC::initialize(const DDNumericArguments& nArgs,
const DDVectorArguments& vArgs,
const DDMapArguments&,
const DDStringArguments& sArgs,
const DDStringVectorArguments&) {
idNameSpace = DDCurrentNamespace::ns();
genMat = sArgs["GeneralMaterial"];
DDName parentName = parent().name();
LogDebug("TIBGeom") << "DDTIBLayerAlgo_MTCC debug: Parent " << parentName << " NameSpace " << idNameSpace
<< " General Material " << genMat;
detectorTilt = nArgs["DetectorTilt"];
layerL = nArgs["LayerL"];
detectorTol = nArgs["LayerTolerance"];
detectorW = nArgs["DetectorWidth"];
detectorT = nArgs["DetectorThickness"];
coolTubeW = nArgs["CoolTubeWidth"];
coolTubeT = nArgs["CoolTubeThickness"];
LogDebug("TIBGeom") << "DDTIBLayerAlgo_MTCC debug: Tilt Angle " << detectorTilt / CLHEP::deg
<< " Layer Length/tolerance " << layerL << " " << detectorTol << " Detector layer Width/Thick "
<< detectorW << ", " << detectorT << " Cooling Tube/Cable layer Width/Thick " << coolTubeW << ", "
<< coolTubeT;
radiusLo = nArgs["RadiusLo"];
phioffLo = nArgs["PhiOffsetLo"];
phiMinLo = nArgs["PhiMinimumLo"];
phiMaxLo = nArgs["PhiMaximumLo"];
stringsLo = int(nArgs["StringsLo"]);
stringLoList = vArgs["StringLoList"];
detectorLo = sArgs["StringDetLoName"];
emptyDetectorLo = sArgs["EmptyStringDetLoName"];
roffDetLo = nArgs["ROffsetDetLo"];
coolCableLo = sArgs["StringCabLoName"];
emptyCoolCableLo = sArgs["EmptyStringCabLoName"];
roffCableLo = nArgs["ROffsetCabLo"];
LogDebug("TIBGeom") << "DDTIBLayerAlgo_MTCC debug: Lower layer Radius " << radiusLo << " Phi offset "
<< phioffLo / CLHEP::deg << " min " << phiMinLo / CLHEP::deg << " max " << phiMaxLo / CLHEP::deg
<< " Number " << stringsLo << " String " << detectorLo << " at offset " << roffDetLo << " String "
<< coolCableLo << " at offset " << roffCableLo << " Strings filled: ";
for (unsigned int i = 0; i < stringLoList.size(); i++) {
LogDebug("TIBGeom") << "String " << i << " " << (int)stringLoList[i];
}
LogDebug("TIBGeom") << " Empty String " << emptyDetectorLo << " at offset " << roffDetLo << " Empty String "
<< emptyCoolCableLo << " at offset " << roffCableLo;
radiusUp = nArgs["RadiusUp"];
phioffUp = nArgs["PhiOffsetUp"];
phiMinUp = nArgs["PhiMinimumUp"];
phiMaxUp = nArgs["PhiMaximumUp"];
stringsUp = int(nArgs["StringsUp"]);
stringUpList = vArgs["StringUpList"];
detectorUp = sArgs["StringDetUpName"];
emptyDetectorUp = sArgs["EmptyStringDetUpName"];
roffDetUp = nArgs["ROffsetDetUp"];
coolCableUp = sArgs["StringCabUpName"];
emptyCoolCableUp = sArgs["EmptyStringCabUpName"];
roffCableUp = nArgs["ROffsetCabUp"];
LogDebug("TIBGeom") << "DDTIBLayerAlgo_MTCC debug: Upper layer Radius " << radiusUp << " Phi offset "
<< phioffUp / CLHEP::deg << " min " << phiMinUp / CLHEP::deg << " max " << phiMaxUp / CLHEP::deg
<< " Number " << stringsUp << " String " << detectorUp << " at offset " << roffDetUp << " String "
<< coolCableUp << " at offset " << roffCableUp << " Strings filled: ";
for (unsigned int i = 0; i < stringUpList.size(); i++) {
LogDebug("TIBGeom") << "String " << i << " " << (int)stringUpList[i];
}
LogDebug("TIBGeom") << " Empty String " << emptyDetectorUp << " at offset " << roffDetUp << " Empty String "
<< emptyCoolCableUp << " at offset " << roffCableUp;
cylinderT = nArgs["CylinderThickness"];
cylinderMat = sArgs["CylinderMaterial"];
supportW = nArgs["SupportWidth"];
supportT = nArgs["SupportThickness"];
supportMat = sArgs["SupportMaterial"];
ribMat = sArgs["RibMaterial"];
ribW = vArgs["RibWidth"];
ribPhi = vArgs["RibPhi"];
LogDebug("TIBGeom") << "DDTIBLayerAlgo_MTCC debug: Cylinder Material/"
<< "thickness " << cylinderMat << " " << cylinderT << " Support Wall Material/Width/Thickness "
<< supportMat << " " << supportW << " " << supportT << " Rib Material " << ribMat << " at "
<< ribW.size() << " positions with width/phi";
for (unsigned int i = 0; i < ribW.size(); i++)
LogDebug("TIBGeom") << "Rib " << i << " " << ribW[i] << " " << ribPhi[i] / CLHEP::deg;
dohmN = int(nArgs["DOHMPhiNumber"]);
dohmCarrierW = nArgs["DOHMCarrierWidth"];
dohmCarrierT = nArgs["DOHMCarrierThickness"];
dohmCarrierR = nArgs["DOHMCarrierRadialHeight"];
dohmCarrierMaterial = sArgs["DOHMCarrierMaterial"];
dohmCableMaterial = sArgs["DOHMCableMaterial"];
dohmPrimW = nArgs["DOHMPRIMWidth"];
dohmPrimL = nArgs["DOHMPRIMLength"];
dohmPrimT = nArgs["DOHMPRIMThickness"];
dohmPrimMaterial = sArgs["DOHMPRIMMaterial"];
dohmAuxW = nArgs["DOHMAUXWidth"];
dohmAuxL = nArgs["DOHMAUXLength"];
dohmAuxT = nArgs["DOHMAUXThickness"];
dohmAuxMaterial = sArgs["DOHMAUXMaterial"];
dohmList = vArgs["DOHMList"];
LogDebug("TIBGeom") << "DDTIBLayerAlgo_MTCC debug: DOHM PRIMary " << dohmN << " Width/Length/Thickness "
<< " Material " << dohmPrimMaterial << " " << dohmPrimW << " " << dohmPrimL << " " << dohmPrimT
<< " at positions:";
for (unsigned int i = 0; i < dohmList.size(); i++) {
if ((int)dohmList[i] > 0)
LogDebug("TIBGeom") << i + 1 << ",";
}
LogDebug("TIBGeom") << "DDTIBLayerAlgo_MTCC debug: DOHM AUXiliary "
<< " Material " << dohmAuxMaterial << " " << dohmAuxW << " " << dohmAuxL << " " << dohmAuxT
<< " at positions:";
for (unsigned int i = 0; i < dohmList.size(); i++) {
if ((int)dohmList[i] == 2)
LogDebug("TIBGeom") << i + 1 << ",";
}
LogDebug("TIBGeom") << " in Carrier Width/Thickness/Radius " << dohmCarrierW << " " << dohmCarrierT << " "
<< dohmCarrierR << " Carrier Material " << dohmCarrierMaterial
<< "\n with cables and connectors Material " << dohmCableMaterial << "\n"
<< "DDTIBLayerAlgo_MTCC debug: no DOHM "
<< " at positions: ";
for (unsigned int i = 0; i < dohmList.size(); i++) {
if ((int)dohmList[i] == 0)
LogDebug("TIBGeom") << i + 1 << ",";
}
}
void DDTIBLayerAlgo_MTCC::execute(DDCompactView& cpv) {
LogDebug("TIBGeom") << "==>> Constructing DDTIBLayerAlgo_MTCC...";
//Parameters for the tilt of the layer
double rotsi = std::abs(detectorTilt);
double redgd1 = 0.5 * (detectorW * sin(rotsi) + detectorT * cos(rotsi));
double redgd2 = 0.5 * (detectorW * cos(rotsi) - detectorT * sin(rotsi));
double redgc1 = 0.5 * (coolTubeW * sin(rotsi) + coolTubeT * cos(rotsi));
double redgc2 = 0.5 * (coolTubeW * cos(rotsi) - coolTubeT * sin(rotsi));
LogDebug("TIBGeom") << "DDTIBLayerAlgo_MTCC test DeltaR (Detector Tilt) " << redgd1 << ", " << redgd2
<< " DeltaR (Cable+Cool) " << redgc1 << ", " << redgc2;
DDName parentName = parent().name();
const std::string& idName = parentName.name();
double rmin = radiusLo + roffDetLo - redgd1 - detectorTol;
double rmax = sqrt((radiusUp + roffDetUp + redgd1) * (radiusUp + roffDetUp + redgd1) + redgd2 * redgd2) + detectorTol;
DDSolid solid = DDSolidFactory::tubs(DDName(idName, idNameSpace), 0.5 * layerL, rmin, rmax, 0, CLHEP::twopi);
LogDebug("TIBGeom") << "DDTIBLayerAlgo_MTCC test: " << DDName(idName, idNameSpace) << " Tubs made of " << genMat
<< " from 0 to " << CLHEP::twopi / CLHEP::deg << " with Rin " << rmin << " Rout " << rmax
<< " ZHalf " << 0.5 * layerL;
DDMaterial matter(DDName(DDSplit(genMat).first, DDSplit(genMat).second));
DDLogicalPart layer(solid.ddname(), matter, solid);
//Lower part first
double rin = rmin;
double rout = 0.5 * (radiusLo + radiusUp - cylinderT);
std::string name = idName + "Down";
solid = DDSolidFactory::tubs(DDName(name, idNameSpace), 0.5 * layerL, rin, rout, 0, CLHEP::twopi);
LogDebug("TIBGeom") << "DDTIBLayerAlgo_MTCC test: " << DDName(name, idNameSpace) << " Tubs made of " << genMat
<< " from 0 to " << CLHEP::twopi / CLHEP::deg << " with Rin " << rin << " Rout " << rout
<< " ZHalf " << 0.5 * layerL;
DDLogicalPart layerIn(solid.ddname(), matter, solid);
cpv.position(layerIn, layer, 1, DDTranslation(0.0, 0.0, 0.0), DDRotation());
LogDebug("TIBGeom") << "DDTIBLayerAlgo_MTCC test: " << layerIn.name() << " number 1 positioned in " << layer.name()
<< " at (0,0,0) with no rotation";
double rposdet = radiusLo + roffDetLo;
double rposcab = rposdet + roffCableLo;
double dphi = CLHEP::twopi / stringsLo;
DDName detIn(DDSplit(detectorLo).first, DDSplit(detectorLo).second);
DDName cabIn(DDSplit(coolCableLo).first, DDSplit(coolCableLo).second);
for (int n = 0; n < stringsLo; n++) {
double phi = phioffLo + n * dphi;
if (phi >= phiMinLo && phi < phiMaxLo) { // phi range
double phix = phi - detectorTilt + 90 * CLHEP::deg;
double phideg = phix / CLHEP::deg;
DDRotation rotation;
if (phideg != 0) {
double theta = 90 * CLHEP::deg;
double phiy = phix + 90. * CLHEP::deg;
std::string rotstr = idName + std::to_string(phideg * 10.);
rotation = DDRotation(DDName(rotstr, idNameSpace));
if (!rotation) {
LogDebug("TIBGeom") << "DDTIBLayer_MTCC test: Creating a new "
<< "rotation: " << rotstr << "\t90., " << phix / CLHEP::deg << ", 90.,"
<< phiy / CLHEP::deg << ", 0, 0";
rotation = DDrot(DDName(rotstr, idNameSpace), theta, phix, theta, phiy, 0., 0.);
}
}
// fill strings in the stringLoList with modules, the others with only structure
bool empty = true;
for (double i : stringLoList) {
if (n + 1 == (int)i) {
empty = false;
}
}
if (empty) {
if (emptyDetectorLo != "nothing") {
DDName emptyDetIn(DDSplit(emptyDetectorLo).first, DDSplit(emptyDetectorLo).second);
DDTranslation trdet(rposdet * cos(phi), rposdet * sin(phi), 0);
cpv.position(emptyDetIn, layerIn, n + 1, trdet, rotation);
LogDebug("TIBGeom") << "DDTIBLayer_MTCC test " << emptyDetIn.name() << " number " << n + 1
<< " positioned in " << layerIn.name() << " at " << trdet << " with " << rotation;
}
if (emptyCoolCableLo != "nothing") {
DDName emptyCabIn(DDSplit(emptyCoolCableLo).first, DDSplit(emptyCoolCableLo).second);
DDTranslation trcab(rposcab * cos(phi), rposcab * sin(phi), 0);
cpv.position(emptyCabIn, layerIn, n + 1, trcab, rotation);
LogDebug("TIBGeom") << "DDTIBLayer_MTCC test " << emptyCabIn.name() << " number " << n + 1
<< " positioned in " << layerIn.name() << " at " << trcab << " with " << rotation;
}
} else {
DDTranslation trdet(rposdet * cos(phi), rposdet * sin(phi), 0);
cpv.position(detIn, layerIn, n + 1, trdet, rotation);
LogDebug("TIBGeom") << "DDTIBLayer_MTCC test " << detIn.name() << " number " << n + 1 << " positioned in "
<< layerIn.name() << " at " << trdet << " with " << rotation;
DDTranslation trcab(rposcab * cos(phi), rposcab * sin(phi), 0);
cpv.position(cabIn, layerIn, n + 1, trcab, rotation);
LogDebug("TIBGeom") << "DDTIBLayer_MTCC test " << cabIn.name() << " number " << n + 1 << " positioned in "
<< layerIn.name() << " at " << trcab << " with " << rotation;
}
//
} // phi range
}
//Now the upper part
rin = 0.5 * (radiusLo + radiusUp + cylinderT);
rout = rmax;
name = idName + "Up";
solid = DDSolidFactory::tubs(DDName(name, idNameSpace), 0.5 * layerL, rin, rout, 0, CLHEP::twopi);
LogDebug("TIBGeom") << "DDTIBLayerAlgo_MTCC test: " << DDName(name, idNameSpace) << " Tubs made of " << genMat
<< " from 0 to " << CLHEP::twopi / CLHEP::deg << " with Rin " << rin << " Rout " << rout
<< " ZHalf " << 0.5 * layerL;
DDLogicalPart layerOut(solid.ddname(), matter, solid);
cpv.position(layerOut, layer, 1, DDTranslation(0.0, 0.0, 0.0), DDRotation());
LogDebug("TIBGeom") << "DDTIBLayerAlgo_MTCC test: " << layerOut.name() << " number 1 positioned in " << layer.name()
<< " at (0,0,0) with no rotation";
rposdet = radiusUp + roffDetUp;
rposcab = rposdet + roffCableUp;
dphi = CLHEP::twopi / stringsUp;
DDName detOut(DDSplit(detectorUp).first, DDSplit(detectorUp).second);
DDName cabOut(DDSplit(coolCableUp).first, DDSplit(coolCableUp).second);
for (int n = 0; n < stringsUp; n++) {
double phi = phioffUp + n * dphi;
if (phi >= phiMinUp && phi < phiMaxUp) { // phi range
double phix = phi - detectorTilt - 90 * CLHEP::deg;
double phideg = phix / CLHEP::deg;
DDRotation rotation;
if (phideg != 0) {
double theta = 90 * CLHEP::deg;
double phiy = phix + 90. * CLHEP::deg;
std::string rotstr = idName + std::to_string(phideg * 10.);
rotation = DDRotation(DDName(rotstr, idNameSpace));
if (!rotation) {
LogDebug("TIBGeom") << "DDTIBLayer_MTCC test: Creating a new "
<< "rotation: " << rotstr << "\t90., " << phix / CLHEP::deg << ", 90.,"
<< phiy / CLHEP::deg << ", 0, 0";
rotation = DDrot(DDName(rotstr, idNameSpace), theta, phix, theta, phiy, 0., 0.);
}
}
// fill strings in the stringUpList with modules, the others with only structure
bool empty = true;
for (double i : stringUpList) {
if (n + 1 == (int)i) {
empty = false;
}
}
if (empty) {
if (emptyDetectorUp != "nothing") {
DDName emptyDetOut(DDSplit(emptyDetectorUp).first, DDSplit(emptyDetectorUp).second);
DDTranslation trdet(rposdet * cos(phi), rposdet * sin(phi), 0);
cpv.position(emptyDetOut, layerOut, n + 1, trdet, rotation);
LogDebug("TIBGeom") << "DDTIBLayer test " << emptyDetOut.name() << " number " << n + 1 << " positioned in "
<< layerOut.name() << " at " << trdet << " with " << rotation;
}
if (emptyCoolCableUp != "nothing") {
DDName emptyCabOut(DDSplit(emptyCoolCableUp).first, DDSplit(emptyCoolCableUp).second);
DDTranslation trcab(rposcab * cos(phi), rposcab * sin(phi), 0);
cpv.position(emptyCabOut, layerOut, n + 1, trcab, rotation);
LogDebug("TIBGeom") << "DDTIBLayer_MTCC test " << emptyCabOut.name() << " number " << n + 1
<< " positioned in " << layerOut.name() << " at " << trcab << " with " << rotation;
}
} else {
DDTranslation trdet(rposdet * cos(phi), rposdet * sin(phi), 0);
cpv.position(detOut, layerOut, n + 1, trdet, rotation);
LogDebug("TIBGeom") << "DDTIBLayer test " << detOut.name() << " number " << n + 1 << " positioned in "
<< layerOut.name() << " at " << trdet << " with " << rotation;
DDTranslation trcab(rposcab * cos(phi), rposcab * sin(phi), 0);
cpv.position(cabOut, layerOut, n + 1, trcab, rotation);
LogDebug("TIBGeom") << "DDTIBLayer_MTCC test " << cabOut.name() << " number " << n + 1 << " positioned in "
<< layerOut.name() << " at " << trcab << " with " << rotation;
}
//
} // phi range
}
double phiMin = phiMinUp - phioffUp; // lower phi for cylinders
double phiMax = phiMaxUp - phioffUp; // upper phi for cylinders
double phidiff = fabs(phiMax - phiMin); // cylinders will not be twopi but phidiff
//Finally the inner cylinder, support wall and ribs
rin = 0.5 * (radiusLo + radiusUp - cylinderT);
rout = 0.5 * (radiusLo + radiusUp + cylinderT);
name = idName + "Cylinder";
solid = DDSolidFactory::tubs(DDName(name, idNameSpace), 0.25 * layerL, rin, rout, phiMin, phidiff);
LogDebug("TIBGeom") << "DDTIBLayerAlgo_MTCC test: " << DDName(name, idNameSpace) << " Tubs made of " << cylinderMat
<< " from " << phiMin / CLHEP::deg << " to " << (phiMin + phidiff) / CLHEP::deg << " with Rin "
<< rin << " Rout " << rout << " ZHalf " << 0.25 * layerL;
DDMaterial matcyl(DDName(DDSplit(cylinderMat).first, DDSplit(cylinderMat).second));
DDLogicalPart cylinder(solid.ddname(), matcyl, solid);
cpv.position(cylinder, layer, 1, DDTranslation(0.0, 0.0, 0.25 * layerL), DDRotation());
LogDebug("TIBGeom") << "DDTIBLayerAlgo_MTCC test: " << cylinder.name() << " number 1 positioned in " << layer.name()
<< " at (0,0," << 0.25 * layerL << ") with no rotation";
rin += supportT;
rout -= supportT;
name = idName + "CylinderIn";
solid = DDSolidFactory::tubs(DDName(name, idNameSpace), 0.5 * layerL, rin, rout, phiMin, phidiff);
LogDebug("TIBGeom") << "DDTIBLayerAlgo_MTCC test: " << DDName(name, idNameSpace) << " Tubs made of " << genMat
<< " from " << phiMin / CLHEP::deg << " to " << (phiMin + phidiff) / CLHEP::deg
<< phidiff / CLHEP::deg << " with Rin " << rin << " Rout " << rout << " ZHalf " << 0.5 * layerL;
DDLogicalPart cylinderIn(solid.ddname(), matter, solid);
cpv.position(cylinderIn, cylinder, 1, DDTranslation(0.0, 0.0, -0.25 * layerL), DDRotation());
LogDebug("TIBGeom") << "DDTIBLayerAlgo_MTCC test: " << cylinderIn.name() << " number 1 positioned in "
<< cylinder.name() << " at (0,0," << -0.25 * layerL << ") with no rotation";
name = idName + "CylinderInSup";
solid = DDSolidFactory::tubs(DDName(name, idNameSpace), 0.5 * supportW, rin, rout, phiMin, phidiff);
LogDebug("TIBGeom") << "DDTIBLayerAlgo_MTCC test: " << DDName(name, idNameSpace) << " Tubs made of " << genMat
<< " from " << phiMin / CLHEP::deg << " to " << (phiMin + phidiff) / CLHEP::deg << " with Rin "
<< rin << " Rout " << rout << " ZHalf " << 0.5 * supportW;
DDMaterial matsup(DDName(DDSplit(supportMat).first, DDSplit(supportMat).second));
DDLogicalPart cylinderSup(solid.ddname(), matsup, solid);
cpv.position(cylinderSup, cylinderIn, 1, DDTranslation(0., 0., 0.), DDRotation());
LogDebug("TIBGeom") << "DDTIBLayerAlgo_MTCC test: " << cylinderSup.name() << " number 1 positioned in "
<< cylinderIn.name() << " at (0,0,0) with no rotation";
DDMaterial matrib(DDName(DDSplit(ribMat).first, DDSplit(ribMat).second));
for (unsigned int i = 0; i < ribW.size(); i++) {
name = idName + "Rib" + std::to_string(i);
double width = 2. * ribW[i] / (rin + rout);
double dz = 0.25 * (layerL - supportW);
solid = DDSolidFactory::tubs(DDName(name, idNameSpace), dz, rin, rout, -0.5 * width, width);
LogDebug("TIBGeom") << "DDTIBLayerAlgo_MTCC test: " << DDName(name, idNameSpace) << " Tubs made of " << ribMat
<< " from " << -0.5 * width / CLHEP::deg << " to " << 0.5 * width / CLHEP::deg << " with Rin "
<< rin << " Rout " << rout << " ZHalf " << dz;
DDLogicalPart cylinderRib(solid.ddname(), matrib, solid);
double phix = ribPhi[i];
double phideg = phix / CLHEP::deg;
if (phideg >= phiMin / CLHEP::deg && phideg < phiMax / CLHEP::deg) { // phi range
DDRotation rotation;
if (phideg != 0) {
double theta = 90 * CLHEP::deg;
double phiy = phix + 90. * CLHEP::deg;
std::string rotstr = idName + std::to_string(phideg * 10.);
rotation = DDRotation(DDName(rotstr, idNameSpace));
if (!rotation) {
LogDebug("TIBGeom") << "DDTIBLayer_MTCC test: Creating a new "
<< "rotation: " << rotstr << "\t90., " << phix / CLHEP::deg << ", 90.,"
<< phiy / CLHEP::deg << ", 0, 0";
rotation = DDrot(DDName(rotstr, idNameSpace), theta, phix, theta, phiy, 0., 0.);
}
}
DDTranslation tran(0, 0, +0.25 * (layerL + supportW));
cpv.position(cylinderRib, cylinderIn, 1, tran, rotation);
LogDebug("TIBGeom") << "DDTIBLayer_MTCC test " << cylinderRib.name() << " number 1 positioned in "
<< cylinderIn.name() << " at " << tran << " with " << rotation;
} // phi range
}
// DOHM + carrier (portadohm)
double dz_dohm = 0.5 * dohmCarrierW;
double dphi_dohm = CLHEP::twopi / ((double)dohmN);
double rout_dohm = 0.5 * (radiusLo + radiusUp + cylinderT) + dohmCarrierR;
// DOHM Carrier TIB+ & TIB-
// lower
name = idName + "DOHMCarrier_lo";
double rin_lo = rout_dohm;
double rout_lo = rin_lo + dohmCarrierT;
solid = DDSolidFactory::tubs(DDName(name, idNameSpace), dz_dohm, rin_lo, rout_lo, -0.5 * dphi_dohm, dphi_dohm);
LogDebug("TIBGeom") << "DDTIBLayerAlgo_MTCC test: " << DDName(name, idNameSpace) << " Tubs made of "
<< dohmCarrierMaterial << " from " << -0.5 * (dphi_dohm) / CLHEP::deg << " to "
<< +0.5 * (dphi_dohm) / CLHEP::deg << " with Rin " << rin_lo << " Rout " << rout_lo << " ZHalf "
<< dz_dohm;
// create different name objects for only PRIMary DOHMs and PRIMary+AUXiliary DOHM Carriers
std::string name_lo_r = name + "_PRIM_AUX" + "_lo" + "_r";
std::string name_lo_l = name + "_PRIM_AUX" + "_lo" + "_l";
DDLogicalPart dohmCarrierPrimAux_lo_r(name_lo_r, DDMaterial(dohmCarrierMaterial), solid);
DDLogicalPart dohmCarrierPrimAux_lo_l(name_lo_l, DDMaterial(dohmCarrierMaterial), solid);
name_lo_r = name + "_PRIM" + "_lo" + "_r";
name_lo_l = name + "_PRIM" + "_lo" + "_l";
DDLogicalPart dohmCarrierPrim_lo_r(name_lo_r, DDMaterial(dohmCarrierMaterial), solid);
DDLogicalPart dohmCarrierPrim_lo_l(name_lo_l, DDMaterial(dohmCarrierMaterial), solid);
// upper
name = idName + "DOHMCarrier_up";
double rin_up = rout_lo + 2. * dohmAuxT;
double rout_up = rin_up + dohmCarrierT;
solid = DDSolidFactory::tubs(DDName(name, idNameSpace), dz_dohm, rin_up, rout_up, -0.5 * dphi_dohm, dphi_dohm);
LogDebug("TIBGeom") << "DDTIBLayerAlgo_MTCC test: " << DDName(name, idNameSpace) << " Tubs made of "
<< dohmCarrierMaterial << " from " << -0.5 * (dphi_dohm) / CLHEP::deg << " to "
<< +0.5 * (dphi_dohm) / CLHEP::deg << " with Rin " << rin_up << " Rout " << rout_up << " ZHalf "
<< dz_dohm;
// create different name objects for only PRIMary DOHMs and PRIMary+AUXiliary DOHM Carriers
std::string name_up_r = name + "_PRIM_AUX" + "_up" + "_r";
std::string name_up_l = name + "_PRIM_AUX" + "_up" + "_l";
DDLogicalPart dohmCarrierPrimAux_up_r(name_up_r, DDMaterial(dohmCarrierMaterial), solid);
DDLogicalPart dohmCarrierPrimAux_up_l(name_up_l, DDMaterial(dohmCarrierMaterial), solid);
name_up_r = name + "_PRIM" + "_up" + "_r";
name_up_l = name + "_PRIM" + "_up" + "_l";
DDLogicalPart dohmCarrierPrim_up_r(name_up_r, DDMaterial(dohmCarrierMaterial), solid);
DDLogicalPart dohmCarrierPrim_up_l(name_up_l, DDMaterial(dohmCarrierMaterial), solid);
//
for (unsigned int i = 0; i < (unsigned int)dohmN; i++) {
DDLogicalPart dohmCarrier_lo_r;
DDLogicalPart dohmCarrier_lo_l;
DDLogicalPart dohmCarrier_up_r;
DDLogicalPart dohmCarrier_up_l;
// create different name objects for only PRIMary DOHMs and PRIMary+AUXiliary DOHMs
bool prim = false;
bool aux = false;
if ((unsigned int)dohmList[i] == 2) {
prim = true;
aux = true;
} else if ((unsigned int)dohmList[i] == 1) {
prim = true;
aux = false;
} else {
prim = false;
aux = false;
}
if (prim) {
dohmCarrier_lo_r = dohmCarrierPrim_lo_r;
dohmCarrier_lo_l = dohmCarrierPrim_lo_l;
dohmCarrier_up_r = dohmCarrierPrim_up_r;
dohmCarrier_up_l = dohmCarrierPrim_up_l;
}
if (prim && aux) {
dohmCarrier_lo_r = dohmCarrierPrimAux_lo_r;
dohmCarrier_lo_l = dohmCarrierPrimAux_lo_l;
dohmCarrier_up_r = dohmCarrierPrimAux_up_r;
dohmCarrier_up_l = dohmCarrierPrimAux_up_l;
}
//
if (prim) {
double phix = ((double)i + 0.5) * dphi_dohm;
double phideg = phix / CLHEP::deg;
// if( phideg>=phiMin/CLHEP::deg && phideg<phiMax/CLHEP::deg ) { // phi range
DDRotation rotation;
if (phideg != 0) {
double theta = 90 * CLHEP::deg;
double phiy = phix + 90. * CLHEP::deg;
std::string rotstr = idName + std::to_string(phideg * 10.);
rotation = DDRotation(DDName(rotstr, idNameSpace));
if (!rotation) {
LogDebug("TIBGeom") << "DDTIBLayer_MTCC test: Creating a new "
<< "rotation: " << rotstr << "\t90., " << phix / CLHEP::deg << ", 90.,"
<< phiy / CLHEP::deg << ", 0, 0";
rotation = DDrot(DDName(rotstr, idNameSpace), theta, phix, theta, phiy, 0., 0.);
}
}
// TIB+ DOHM Carrier - lower
DDTranslation tran(0, 0, 0.5 * layerL - dz_dohm);
cpv.position(dohmCarrier_lo_r, parent(), i + 1, tran, rotation);
LogDebug("TIBGeom") << "DDTIBLayer_MTCC test " << dohmCarrier_lo_r.name() << " z+ number " << i + 1
<< " positioned in " << parent().name() << " at " << tran << " with " << rotation;
// TIB+ DOHM Carrier - upper
cpv.position(dohmCarrier_up_r, parent(), i + 1 + (unsigned int)dohmN, tran, rotation);
LogDebug("TIBGeom") << "DDTIBLayer_MTCC test " << dohmCarrier_up_r.name() << " z+ number " << i + 1
<< " positioned in " << parent().name() << " at " << tran << " with " << rotation;
}
// } // phi range
}
// DOHM only PRIMary
double dx = 0.5 * dohmPrimT;
double dy = 0.5 * dohmPrimW;
double dz = 0.5 * dohmPrimL;
name = idName + "DOHM_PRIM";
solid = DDSolidFactory::box(DDName(name, idNameSpace), dx, dy, dz);
DDLogicalPart dohmPrim(solid.ddname(), DDMaterial(dohmPrimMaterial), solid);
LogDebug("TIBGeom") << "DDTIBLayerAlgo_MTCC test: " << DDName(name, idNameSpace) << " Box made of "
<< dohmPrimMaterial << " of dimensions " << dx << ", " << dy << ", " << dz;
name = idName + "DOHM_PRIM_Cable";
double dx_cable = 0.25 * dohmPrimT;
double dy_cable = 0.40 * dohmPrimW;
double dz_cable = 0.5 * dohmPrimL;
solid = DDSolidFactory::box(DDName(name, idNameSpace), dx_cable, dy_cable, dz_cable);
DDLogicalPart dohmCablePrim(solid.ddname(), DDMaterial(dohmCableMaterial), solid);
LogDebug("TIBGeom") << "DDTIBLayerAlgo_MTCC test: " << DDName(name, idNameSpace) << " Box made of "
<< dohmCableMaterial << " of dimensions " << dx_cable << ", " << dy_cable << ", " << dz_cable;
// TIB+ DOHM
DDTranslation tran(rout_dohm + 0.5 * dohmPrimT, 0., 0.);
cpv.position(dohmPrim, dohmCarrierPrim_lo_r, 1, tran, DDRotation());
LogDebug("TIBGeom") << "DDTIBLayer_MTCC test " << dohmPrim.name() << " z+ number " << 1 << " positioned in "
<< dohmCarrierPrim_lo_r.name() << " at " << tran << " with no rotation";
tran = DDTranslation(rout_dohm + dx_cable, 0.5 * dohmPrimW, 0.);
cpv.position(dohmCablePrim, dohmCarrierPrim_lo_r, 1, tran, DDRotation());
LogDebug("TIBGeom") << "DDTIBLayer_MTCC test " << dohmCablePrim.name() << " copy number " << 1 << " positioned in "
<< dohmCarrierPrim_lo_r.name() << " at " << tran << " with no rotation";
tran = DDTranslation(rout_dohm + dx_cable, -0.5 * dohmPrimW, 0.);
cpv.position(dohmCablePrim, dohmCarrierPrim_lo_r, 2, tran, DDRotation());
LogDebug("TIBGeom") << "DDTIBLayer_MTCC test " << dohmCablePrim.name() << " copy number " << 2 << " positioned in "
<< dohmCarrierPrim_lo_r.name() << " at " << tran << " with no rotation";
// DOHM PRIMary + AUXiliary
dx = 0.5 * dohmPrimT;
dy = 0.5 * dohmPrimW;
dz = 0.5 * dohmPrimL;
name = idName + "DOHM_PRIM";
solid = DDSolidFactory::box(DDName(name, idNameSpace), dx, dy, dz);
LogDebug("TIBGeom") << "DDTIBLayerAlgo_MTCC test: " << DDName(name, idNameSpace) << " Box made of "
<< dohmPrimMaterial << " of dimensions " << dx << ", " << dy << ", " << dz;
dohmPrim = DDLogicalPart(solid.ddname(), DDMaterial(dohmPrimMaterial), solid);
name = idName + "DOHM_PRIM_Cable";
dx_cable = 0.25 * dohmPrimT;
dy_cable = 0.40 * dohmPrimW;
dz_cable = 0.5 * dohmPrimL;
solid = DDSolidFactory::box(DDName(name, idNameSpace), dx_cable, dy_cable, dz_cable);
dohmCablePrim = DDLogicalPart(solid.ddname(), DDMaterial(dohmCableMaterial), solid);
LogDebug("TIBGeom") << "DDTIBLayerAlgo_MTCC test: " << DDName(name, idNameSpace) << " Box made of "
<< dohmCableMaterial << " of dimensions " << dx_cable << ", " << dy_cable << ", " << dz_cable;
dx = 0.5 * dohmAuxT;
dy = 0.5 * dohmAuxW;
dz = 0.5 * dohmAuxL;
name = idName + "DOHM_AUX";
solid = DDSolidFactory::box(DDName(name, idNameSpace), dx, dy, dz);
DDLogicalPart dohmAux(solid.ddname(), DDMaterial(dohmAuxMaterial), solid);
LogDebug("TIBGeom") << "DDTIBLayerAlgo_MTCC test: " << DDName(name, idNameSpace) << " Box made of " << dohmAuxMaterial
<< " of dimensions " << dx << ", " << dy << ", " << dz;
name = idName + "DOHM_AUX_Cable";
solid = DDSolidFactory::box(DDName(name, idNameSpace), dx_cable, dy_cable, dz_cable);
DDLogicalPart dohmCableAux(solid.ddname(), DDMaterial(dohmCableMaterial), solid);
LogDebug("TIBGeom") << "DDTIBLayerAlgo_MTCC test: " << DDName(name, idNameSpace) << " Box made of "
<< dohmCableMaterial << " of dimensions " << dx_cable << ", " << dy_cable << ", " << dz_cable;
// TIB+ DOHM
tran = DDTranslation(rout_dohm + 0.5 * dohmPrimT, -0.75 * dohmPrimW, 0.);
cpv.position(dohmPrim, dohmCarrierPrimAux_lo_r, 1, tran, DDRotation());
LogDebug("TIBGeom") << "DDTIBLayer_MTCC test " << dohmAux.name() << " z+ number " << 1 << " positioned in "
<< dohmCarrierPrimAux_lo_r.name() << " at " << tran << " with no rotation";
tran = DDTranslation(rout_dohm + dx_cable, -0.75 * dohmPrimW + 0.5 * dohmPrimW, 0.);
cpv.position(dohmCablePrim, dohmCarrierPrimAux_lo_r, 1, tran, DDRotation());
LogDebug("TIBGeom") << "DDTIBLayer_MTCC test " << dohmCablePrim.name() << " copy number " << 1 << " positioned in "
<< dohmCarrierPrimAux_lo_r.name() << " at " << tran << " with no rotation";
tran = DDTranslation(rout_dohm + dx_cable, -0.75 * dohmPrimW - 0.5 * dohmPrimW, 0.);
cpv.position(dohmCablePrim, dohmCarrierPrimAux_lo_r, 2, tran, DDRotation());
LogDebug("TIBGeom") << "DDTIBLayer_MTCC test " << dohmCablePrim.name() << " copy number " << 2 << " positioned in "
<< dohmCarrierPrimAux_lo_r.name() << " at " << tran << " with no rotation";
tran = DDTranslation(rout_dohm + 0.5 * dohmAuxT, 0.75 * dohmAuxW, 0.);
cpv.position(dohmAux, dohmCarrierPrimAux_lo_r, 1, tran, DDRotation());
LogDebug("TIBGeom") << "DDTIBLayer_MTCC test " << dohmAux.name() << " z+ number " << 1 << " positioned in "
<< dohmCarrierPrimAux_lo_r.name() << " at (0,0,0) with no rotation";
tran = DDTranslation(rout_dohm + dx_cable, 0.75 * dohmAuxW + 0.5 * dohmPrimW, 0.);
cpv.position(dohmCableAux, dohmCarrierPrimAux_lo_r, 1, tran, DDRotation());
LogDebug("TIBGeom") << "DDTIBLayer_MTCC test " << dohmCableAux.name() << " copy number " << 1 << " positioned in "
<< dohmCarrierPrimAux_lo_r.name() << " at " << tran << " with no rotation";
}
|
Whitecoin-XWC/penguin_node
|
pkg/topology/mock/mock.go
|
// Copyright 2020 The Penguin Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package mock
import (
"context"
"sync"
"github.com/penguintop/penguin/pkg/penguin"
"github.com/penguintop/penguin/pkg/topology"
)
type mock struct {
peers []penguin.Address
closestPeer penguin.Address
closestPeerErr error
peersErr error
addPeersErr error
isWithinFunc func(c penguin.Address) bool
marshalJSONFunc func() ([]byte, error)
mtx sync.Mutex
}
func WithPeers(peers ...penguin.Address) Option {
return optionFunc(func(d *mock) {
d.peers = peers
})
}
func WithAddPeersErr(err error) Option {
return optionFunc(func(d *mock) {
d.addPeersErr = err
})
}
func WithClosestPeer(addr penguin.Address) Option {
return optionFunc(func(d *mock) {
d.closestPeer = addr
})
}
func WithClosestPeerErr(err error) Option {
return optionFunc(func(d *mock) {
d.closestPeerErr = err
})
}
func WithMarshalJSONFunc(f func() ([]byte, error)) Option {
return optionFunc(func(d *mock) {
d.marshalJSONFunc = f
})
}
func WithIsWithinFunc(f func(penguin.Address) bool) Option {
return optionFunc(func(d *mock) {
d.isWithinFunc = f
})
}
func NewTopologyDriver(opts ...Option) topology.Driver {
d := new(mock)
for _, o := range opts {
o.apply(d)
}
return d
}
func (d *mock) AddPeers(addrs ...penguin.Address) {
d.mtx.Lock()
defer d.mtx.Unlock()
d.peers = append(d.peers, addrs...)
}
func (d *mock) Connected(ctx context.Context, addr penguin.Address) error {
d.AddPeers(addr)
return nil
}
func (d *mock) Disconnected(penguin.Address) {
panic("todo")
}
func (d *mock) Peers() []penguin.Address {
return d.peers
}
func (d *mock) ClosestPeer(addr penguin.Address, _ bool, skipPeers ...penguin.Address) (peerAddr penguin.Address, err error) {
if len(skipPeers) == 0 {
if d.closestPeerErr != nil {
return d.closestPeer, d.closestPeerErr
}
if !d.closestPeer.Equal(penguin.ZeroAddress) {
return d.closestPeer, nil
}
}
d.mtx.Lock()
defer d.mtx.Unlock()
if len(d.peers) == 0 {
return peerAddr, topology.ErrNotFound
}
skipPeer := false
for _, p := range d.peers {
for _, a := range skipPeers {
if a.Equal(p) {
skipPeer = true
break
}
}
if skipPeer {
skipPeer = false
continue
}
if peerAddr.IsZero() {
peerAddr = p
}
if cmp, _ := penguin.DistanceCmp(addr.Bytes(), p.Bytes(), peerAddr.Bytes()); cmp == 1 {
peerAddr = p
}
}
if peerAddr.IsZero() {
return peerAddr, topology.ErrNotFound
}
return peerAddr, nil
}
func (d *mock) SubscribePeersChange() (c <-chan struct{}, unsubscribe func()) {
return c, unsubscribe
}
func (*mock) NeighborhoodDepth() uint8 {
return 0
}
func (m *mock) IsWithinDepth(addr penguin.Address) bool {
if m.isWithinFunc != nil {
return m.isWithinFunc(addr)
}
return false
}
func (m *mock) EachNeighbor(f topology.EachPeerFunc) error {
return m.EachPeer(f)
}
func (*mock) EachNeighborRev(topology.EachPeerFunc) error {
panic("not implemented") // TODO: Implement
}
// EachPeer iterates from closest bin to farthest
func (d *mock) EachPeer(f topology.EachPeerFunc) (err error) {
d.mtx.Lock()
defer d.mtx.Unlock()
if d.peersErr != nil {
return d.peersErr
}
for i, p := range d.peers {
_, _, err = f(p, uint8(i))
if err != nil {
return
}
}
return nil
}
// EachPeerRev iterates from farthest bin to closest
func (d *mock) EachPeerRev(f topology.EachPeerFunc) (err error) {
d.mtx.Lock()
defer d.mtx.Unlock()
for i := len(d.peers) - 1; i >= 0; i-- {
_, _, err = f(d.peers[i], uint8(i))
if err != nil {
return
}
}
return nil
}
func (d *mock) Snapshot() *topology.KadParams {
return new(topology.KadParams)
}
func (d *mock) Halt() {}
func (d *mock) Close() error { return nil }
type Option interface {
apply(*mock)
}
type optionFunc func(*mock)
func (f optionFunc) apply(r *mock) { f(r) }
|
vdrokov/components-1
|
core/components-adapter-beam/test/main/java/org/talend/components/adapter/beam/example/FixedFlowReader.java
|
// ============================================================================
//
// Copyright (C) 2006-2017 Talend Inc. - www.talend.com
//
// This source code is available under agreement available at
// %InstallDIR%\features\org.talend.rcp.branding.%PRODUCTNAME%\%PRODUCTNAME%license.txt
//
// You should have received a copy of the agreement
// along with this program; if not, write to Talend SA
// 9 rue Pages 92150 Suresnes, France
//
// ============================================================================
package org.talend.components.adapter.beam.example;
import java.io.IOException;
import java.util.Arrays;
import java.util.Iterator;
import java.util.Map;
import java.util.NoSuchElementException;
import org.apache.avro.Schema;
import org.apache.avro.generic.IndexedRecord;
import org.talend.components.api.component.runtime.AbstractBoundedReader;
import org.talend.components.api.component.runtime.BoundedSource;
import org.talend.daikon.avro.converter.IndexedRecordConverter;
public class FixedFlowReader extends AbstractBoundedReader<IndexedRecord> {
private FixedFlowProperties properties;
private Iterator<String> rows;
private String row;
public FixedFlowReader(BoundedSource source, FixedFlowProperties properties) {
super(source);
this.properties = properties;
}
@Override
public boolean start() throws IOException {
rows = Arrays.asList(properties.data.getValue().split(properties.rowDelimited.getValue())).iterator();
return advance();
}
@Override
public boolean advance() throws IOException {
boolean hasNext = rows.hasNext();
if (hasNext) {
row = rows.next();
}
return hasNext;
}
@Override
public IndexedRecord getCurrent() throws NoSuchElementException {
return new FixedFlowIndexedRecord(row);
}
@Override
public Map<String, Object> getReturnValues() {
return null;
}
private class FixedFlowIndexedRecord implements IndexedRecord {
String value;
public FixedFlowIndexedRecord(String value) {
this.value = value;
}
@Override
public void put(int i, Object v) {
throw new IndexedRecordConverter.UnmodifiableAdapterException();
}
@Override
public Object get(int i) {
return value;
}
@Override
public Schema getSchema() {
return properties.schema.getValue();
}
}
}
|
intj-t/openvmsft
|
WRK-V1.2/TOOLS/crt/src/drivemap.c
|
/***
*drivemap.c - _getdrives
*
* Copyright (c) Microsoft Corporation. All rights reserved.
*
*Purpose:
* defines _getdrives()
*
*******************************************************************************/
#include <cruntime.h>
#include <oscalls.h>
#include <direct.h>
#if !defined (_WIN32)
#error ERROR - ONLY WIN32 TARGET SUPPORTED!
#endif /* !defined (_WIN32) */
/***
*void _getdrivemap(void) - Get bit map of all available drives
*
*Purpose:
*
*Entry:
*
*Exit:
* drive map with drive A in bit 0, B in 1, etc.
*
*Exceptions:
*
*******************************************************************************/
#if defined (CRTDLL) && !defined (_SYSCRT)
/*
* Note that we are renaming _getdrives to __getdrives so that we can take dependency on msvcrt.dll. We will still export _getdrive using = trick in msvcrt.def file.
*/
unsigned long __cdecl __getdrives()
#else /* defined (CRTDLL) && !defined (_SYSCRT) */
unsigned long __cdecl _getdrives()
#endif /* defined (CRTDLL) && !defined (_SYSCRT) */
{
return (GetLogicalDrives());
}
|
nutonchain/Deeplearning
|
deeplearning4j/deeplearning4j-nn/src/main/java/org/deeplearning4j/nn/conf/layers/ZeroPadding3DLayer.java
|
<filename>deeplearning4j/deeplearning4j-nn/src/main/java/org/deeplearning4j/nn/conf/layers/ZeroPadding3DLayer.java
/*******************************************************************************
* Copyright (c) 2015-2018 Skymind, Inc.
*
* This program and the accompanying materials are made available under the
* terms of the Apache License, Version 2.0 which is available 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.
*
* SPDX-License-Identifier: Apache-2.0
******************************************************************************/
package org.deeplearning4j.nn.conf.layers;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import org.deeplearning4j.nn.api.ParamInitializer;
import org.deeplearning4j.nn.conf.InputPreProcessor;
import org.deeplearning4j.nn.conf.NeuralNetConfiguration;
import org.deeplearning4j.nn.conf.inputs.InputType;
import org.deeplearning4j.nn.conf.memory.LayerMemoryReport;
import org.deeplearning4j.nn.conf.memory.MemoryReport;
import org.deeplearning4j.nn.params.EmptyParamInitializer;
import org.deeplearning4j.optimize.api.IterationListener;
import org.deeplearning4j.optimize.api.TrainingListener;
import org.nd4j.linalg.api.ndarray.INDArray;
import java.util.Arrays;
import java.util.Collection;
import java.util.Map;
/**
* Zero padding 3D layer for convolutional neural networks.
* Allows padding to be done separately for "left" and "right"
* in all three spatial dimensions.
*
* @author <NAME>
*/
@Data
@NoArgsConstructor
@EqualsAndHashCode(callSuper = true)
public class ZeroPadding3DLayer extends NoParamLayer {
private int[] padding; // [padLeftD, padRightD, padLeftH, padRightH, padLeftW, padRightW]
private ZeroPadding3DLayer(Builder builder) {
super(builder);
this.padding = builder.padding;
}
@Override
public org.deeplearning4j.nn.api.Layer instantiate(NeuralNetConfiguration conf,
Collection<TrainingListener> iterationListeners,
int layerIndex, INDArray layerParamsView,
boolean initializeParams) {
org.deeplearning4j.nn.layers.convolution.ZeroPadding3DLayer ret =
new org.deeplearning4j.nn.layers.convolution.ZeroPadding3DLayer(conf);
ret.setListeners(iterationListeners);
ret.setIndex(layerIndex);
Map<String, INDArray> paramTable = initializer().init(conf, layerParamsView, initializeParams);
ret.setParamTable(paramTable);
ret.setConf(conf);
return ret;
}
@Override
public ParamInitializer initializer() {
return EmptyParamInitializer.getInstance();
}
@Override
public InputType getOutputType(int layerIndex, InputType inputType) {
if (inputType == null || inputType.getType() != InputType.Type.CNN3D) {
throw new IllegalStateException("Invalid input for 3D CNN layer (layer index = " + layerIndex
+ ", layer name = \"" + getLayerName() + "\"): expect CNN3D input type with size > 0. Got: "
+ inputType);
}
InputType.InputTypeConvolutional3D c = (InputType.InputTypeConvolutional3D) inputType;
return InputType.convolutional3D(
c.getDepth() + padding[0] + padding[1],
c.getHeight() + padding[2] + padding[3],
c.getWidth() + padding[4] + padding[5],
c.getChannels());
}
@Override
public void setNIn(InputType inputType, boolean override) {
//No op
}
@Override
public InputPreProcessor getPreProcessorForInputType(InputType inputType) {
if (inputType == null) {
throw new IllegalStateException("Invalid input for ZeroPadding3DLayer layer (layer name=\"" + getLayerName()
+ "\"): input is null");
}
return InputTypeUtil.getPreProcessorForInputTypeCnn3DLayers(inputType, getLayerName());
}
@Override
public double getL1ByParam(String paramName) {
return 0;
}
@Override
public double getL2ByParam(String paramName) {
return 0;
}
@Override
public boolean isPretrainParam(String paramName) {
throw new UnsupportedOperationException("ZeroPadding3DLayer does not contain parameters");
}
@Override
public LayerMemoryReport getMemoryReport(InputType inputType) {
InputType outputType = getOutputType(-1, inputType);
return new LayerMemoryReport.Builder(layerName, ZeroPadding3DLayer.class, inputType, outputType)
.standardMemory(0, 0) //No params
.workingMemory(0, 0, MemoryReport.CACHE_MODE_ALL_ZEROS,
MemoryReport.CACHE_MODE_ALL_ZEROS)
.cacheMemory(MemoryReport.CACHE_MODE_ALL_ZEROS, MemoryReport.CACHE_MODE_ALL_ZEROS) //No caching
.build();
}
public static class Builder extends Layer.Builder<Builder> {
private int[] padding = new int[]{0, 0, 0, 0, 0, 0}; // [padLeftD, padRightD, padLeftH, padRightH, padLeftW, padRightW]
/**
* @param padding Padding for both the left and right in all three spatial dimensions
*/
public Builder(int padding) {
this(padding, padding, padding, padding, padding, padding);
}
/**
* Use same padding for left and right boundaries in depth, height and width.
*
* @param padDepth padding used for both depth boundaries
* @param padHeight padding used for both height boundaries
* @param padWidth padding used for both width boudaries
*/
public Builder(int padDepth, int padHeight, int padWidth) {
this(padDepth, padDepth, padHeight, padHeight, padWidth, padWidth);
}
/**
* Explicit padding of left and right boundaries in depth, height and width dimensions
*
* @param padLeftD Depth padding left
* @param padRightD Depth padding right
* @param padLeftH Height padding left
* @param padRightH Height padding right
* @param padLeftW Width padding left
* @param padRightW Width padding right
*/
public Builder(int padLeftD, int padRightD,
int padLeftH, int padRightH,
int padLeftW, int padRightW) {
this(new int[]{padLeftD, padRightD, padLeftH, padRightH, padLeftW, padRightW});
}
public Builder(int[] padding) {
if (padding.length == 3) {
this.padding = new int[]{padding[0], padding[0], padding[1], padding[1], padding[2], padding[2]};
} else if (padding.length == 6) {
this.padding = padding;
} else if (padding.length == 1) {
this.padding = new int[]{padding[0], padding[0], padding[0], padding[0], padding[0], padding[0]};
} else {
throw new IllegalStateException("Padding length has to be either 1, 3 or 6, got " + padding.length);
}
}
@Override
@SuppressWarnings("unchecked")
public ZeroPadding3DLayer build() {
for (int p : padding) {
if (p < 0)
throw new IllegalStateException("Invalid zero padding layer config: padding [left, right]"
+ " must be > 0 for all elements. Got: " + Arrays.toString(padding));
}
return new ZeroPadding3DLayer(this);
}
}
}
|
premium-runner-benchmark/isle-editor
|
app/components/data-table/main.js
|
<gh_stars>0
/*
* Dragging behavior adapted from code by:
*
* Copyright (c) 2019 by <NAME> (https://codepen.io/mattlockyer/pen/LydeLj)
*
* 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.
*/
// MODULES //
import React, { Component, Fragment } from 'react';
import PropTypes from 'prop-types';
import { findDOMNode } from 'react-dom';
import logger from 'debug';
import { withTranslation } from 'react-i18next';
import ReactTable from 'react-table';
import unique from 'uniq';
import Alert from 'react-bootstrap/Alert';
import ButtonToolbar from 'react-bootstrap/ButtonToolbar';
import Button from 'react-bootstrap/Button';
import Modal from 'react-bootstrap/Modal';
import Tooltip from 'components/tooltip';
import markdownit from 'markdown-it';
import isDigitString from '@stdlib/assert/is-digit-string';
import isTypedArray from '@stdlib/assert/is-typed-array';
import hasOwnProp from '@stdlib/assert/has-own-property';
import contains from '@stdlib/assert/contains';
import lowercase from '@stdlib/string/lowercase';
import floor from '@stdlib/math/base/special/floor';
import ceil from '@stdlib/math/base/special/ceil';
import isNumberArray from '@stdlib/assert/is-number-array';
import isEmptyArray from '@stdlib/assert/is-empty-array';
import isEmptyObject from '@stdlib/assert/is-empty-object';
import isObject from '@stdlib/assert/is-object';
import isArray from '@stdlib/assert/is-array';
import { isPrimitive as isNumber } from '@stdlib/assert/is-number';
import isNull from '@stdlib/assert/is-null';
import objectKeys from '@stdlib/utils/keys';
import min from 'utils/statistic/min';
import max from 'utils/statistic/max';
import generateUID from 'utils/uid';
import saveAs from 'utils/file-saver';
import SessionContext from 'session/context.js';
import { TABLE_SORT, TABLE_FILTER, TABLE_RESET } from 'constants/actions.js';
import NINF from '@stdlib/constants/math/float64-ninf';
import SelectInput from 'components/input/select';
import { components } from 'react-select';
import TutorialButton from './tutorial-button/index.js';
import ColumnTitle from './column_title.js';
import FilterInputRange from './input_range.js';
import './load_translations.js';
import 'react-table/react-table.css';
import './input_range.css';
import './react_table_height.css';
import './data_table.css';
// VARIABLES //
const md = markdownit({
html: true,
xhtmlOut: true,
breaks: true,
typographer: false
});
const debug = logger( 'isle:data-table' );
const uid = generateUID( 'data-table' );
const collator = new Intl.Collator( 'en', { numeric: true, sensitivity: 'base' });
const RE_NUMBER = /[0-9.,]+/;
// FUNCTIONS //
function numericComparer( a, b ) {
a = ( a === null || a === void 0 || a === 'NA' ) ? NINF : a;
b = ( b === null || b === void 0 || b === 'NA' ) ? NINF : b;
return a - b;
}
function generalComparer( a, b ) {
a = ( a === null || a === void 0 || a === 'NA' ) ? NINF : a;
b = ( b === null || b === void 0 || b === 'NA' ) ? NINF : b;
return collator.compare( a, b );
}
function createDescriptions( descriptions, t ) {
const strTable = [];
for ( let varName in descriptions ) {
if ( hasOwnProp( descriptions, varName ) ) {
strTable.push( <tr key={varName} >
<td>{varName}</td><td>{descriptions[varName]}</td>
</tr>);
}
}
return ( <table className="table-bordered table-condensed" style={{ width: '100%' }} >
<thead>
<tr><th>{t('name')}</th><th>{t('description')}</th></tr>
</thead>
<tbody>
{strTable}
</tbody>
</table> );
}
function filterMethodStrings( filter, row ) {
const rowValue = row[ filter.id ];
if ( !rowValue && filter.value ) {
return false;
}
if ( isArray( filter.value ) ) {
return contains( filter.value, rowValue );
}
// Check whether string contains search phrase:
return contains( lowercase( rowValue ), lowercase( filter.value ) );
}
function filterMethodNumbers( filter, row ) {
const val = row[ filter.id ];
return val >= filter.value.min && val <= filter.value.max;
}
function filterMethodCategories( filter, row, column ) {
if ( !filter.value || isEmptyArray( filter.value ) ) {
return true;
}
const id = filter.pivotId || filter.id;
if ( row[ id ] === void 0 ) {
return true;
}
if ( isArray( filter.value ) ) {
return contains( filter.value, String( row[ id ] ) );
}
return String( row[ id ] ) === filter.value;
}
function createRows( data ) {
if ( isEmptyObject( data ) ) {
return [];
}
const keys = objectKeys( data );
const nRows = data[ keys[ 0 ] ].length;
const rows = new Array( nRows );
for ( let i = 0; i < nRows; i++ ) {
rows[ i ] = {};
for ( let j = 0; j < keys.length; j++ ) {
let key = keys[ j ];
rows[ i ][ key ] = data[ key ][ i ];
}
}
return rows;
}
const CustomIndicator = () => {
return <div />;
};
function adjustWidth( event ) {
event.target.style.width = (event.target.value.length+1) + 'ch';
}
function createColumns( props, state ) {
debug( 'Create columns...' );
const t = props.t;
const columns = state.keys.filter( key => key !== 'id' ).map( ( key, idx ) => {
let header = key;
const hasDescription = props.dataInfo &&
props.dataInfo.variables &&
props.dataInfo.variables[ key ];
const out = {
id: key,
accessor: ( d ) => isNull( d[ key ] ) ? 'NA' : String( d[ key ] ),
minWidth: hasDescription ? 125 : 150
};
if ( hasDescription ) {
header = <ColumnTitle title={key} tooltip={props.dataInfo.variables[ key ]} />;
} else if ( props.deletable && !contains( props.undeletableVars, key ) ) {
header = <div style={{ backgroundColor: 'papayawhip' }}>
<Tooltip placement="left" tooltip={t('rename-variable')} >
<span>
<input type="text" className="header-text-input"
style={{
width: `${key.length+1}ch`
}}
defaultValue={key}
onBlur={( e ) => {
const newKey = e.target.value;
document.getElementById( `header-${key}`).setAttribute( 'draggable', true );
if ( newKey.length > 0 && key !== newKey ) {
props.onColumnNameChange( key, newKey );
}
}}
onMouseEnter={( e ) => {
// Update draggable attribute to handle Firefox bug (https://stackoverflow.com/questions/21680363/prevent-drag-event-to-interfere-with-input-elements-in-firefox-using-html5-drag)
document.getElementById( `header-${key}`).setAttribute( 'draggable', false );
}}
onChange={adjustWidth}
onClick={( e ) => {
e.stopPropagation();
}}
/>
</span>
</Tooltip>
<Tooltip placement="left" tooltip={t('remove-variable')} >
<button className="fa fa-times delete-button" onClick={( evt ) => {
evt.stopPropagation();
props.onColumnDelete( key );
}} />
</Tooltip>
</div>;
}
out.Header = header;
if ( contains( props.editable, key ) ) {
out.Cell = this.renderEditable;
}
let vals;
if ( !isArray( props.data ) ) {
vals = props.data[ key ].slice();
} else {
vals = new Array( state.rows.length );
for ( let i = 0; i < state.rows.length; i++ ) {
vals[ i ] = props.data[ i ][ key ];
}
}
if ( props.filterable ) {
let isNumColumn = false;
let uniqueValues;
if ( isTypedArray( vals ) ) {
isNumColumn = true;
uniqueValues = vals;
} else {
vals = vals.filter( x => !isNull( x ) && x !== '' && x !== 'NA' );
uniqueValues = unique( vals );
const activeFilter = props.filters.filter( x => x.id === key )[ 0 ];
if ( activeFilter && isNumber( activeFilter.value.min ) && isNumber( activeFilter.value.max ) ) {
isNumColumn = true;
} else {
isNumColumn = isNumberArray( vals ) && uniqueValues.length > 2;
}
}
if ( isNumColumn ) {
out[ 'filterMethod' ] = filterMethodNumbers;
out[ 'sortMethod' ] = numericComparer;
out[ 'style' ] = {
textAlign: 'right'
};
out[ 'Filter' ] = ({ filter, onChange }) => {
const maxValue = ceil( max( uniqueValues ) );
const minValue = floor( min( uniqueValues ) );
const defaultVal = {
max: maxValue,
min: minValue
};
return ( <FilterInputRange
defaultValue={filter ? filter.value : defaultVal}
onChange={onChange} maxValue={maxValue} minValue={minValue}
/> );
};
} else if ( uniqueValues.length <= 50 ) {
// Cast values to strings for select component to work and sort:
uniqueValues = uniqueValues.map( x => String( x ) ).sort( generalComparer );
if ( isDigitString( uniqueValues[ 0 ] ) ) {
out[ 'style' ] = {
textAlign: 'right'
};
}
out[ 'filterMethod' ] = filterMethodCategories;
out[ 'sortMethod' ] = generalComparer;
out[ 'Filter' ] = ({ filter, onChange }) => {
return (
<SelectInput
onChange={( vals ) => {
if ( vals && vals.length > 0 && uniqueValues.length > 3 ) {
out.minWidth = 300;
} else {
out.minWidth = 125;
}
onChange( vals );
}}
style={{ width: '100%' }}
value={filter ? filter.value : null}
searchable={false}
options={uniqueValues}
menuPlacement="auto"
multi
placeholder={t('show-all')}
components={{
DropdownIndicator: CustomIndicator,
MultiValueLabel: props => {
const invertSelection = () => {
onChange( uniqueValues.filter( x => x !== props.children ) );
};
return (
<Tooltip tooltip={t('select-others')} placement="bottom" >
<span
role="button" tabIndex={0}
onClick={invertSelection}
onKeyPress={invertSelection}
onMouseDown={( event ) => {
// See: https://github.com/JedWatson/react-select/issues/3117
event.preventDefault();
event.stopPropagation();
}}
style={{ cursor: 'cursor' }}
>
<components.MultiValueLabel {...props} />
</span>
</Tooltip>
);
}
}}
escapeClearsValue
closeMenuOnSelect={uniqueValues.length <= 2}
menuPortalTarget={document.body}
styles={{
menuPortal: base => ({ ...base, zIndex: 9999 })
}}
/>
);
};
} else {
out[ 'filterMethod' ] = filterMethodStrings;
out[ 'sortMethod' ] = generalComparer;
}
}
return out;
});
return columns;
}
// MAIN //
/**
* A component rendering data in a tabular display. Built on top of [react-table](https://react-table.js.org/).
*
* @property {(Object|Array)} data - A data object or array to be viewed. If it is an object, the keys correspond to column values while an array will expect an array of objects with a named field corresponding to each column
* @property {Object} dataInfo - object with `info` string array describing the data set, the `name` of the dataset, an `object` of `variables` with keys corresponding to variable names and values to variable descriptions, an a `showOnStartup` boolean controlling whether to display the info modal on startup
* @property {Array} editable - array of names for columns that shall be editable
* @property {boolean} deletable - controls whether columns for which no `info` exist have a button which when clicked calls the `onColumnDelete` callback function
* @property {Array<string>} undeletableVars - array of variable names of columns which may not be deleted
* @property {boolean} filterable - controls whether columns are filterable
* @property {boolean} showRemove - indicates whether to display checkboxes for rows to be removed
* @property {boolean} disableDownload - whether to hide the button to download the data as a CSV or JSON file
* @property {boolean} showIdColumn - controls whether to show an ID column
* @property {string} className - class name
* @property {Object} style - An object allowing for custom css styling. Defaults to an empty object
* @property {Function} getTrProps - callback function executed for each row to customize its styling (passed table state, row info,
column, and the table instance)
* @property {Function} onColumnNameChange - function invoked when a column has been renamed (called with the old name as first and new name as second argument)
* @property {Function} onColumnDrag - function invoked when a column has been dragged to a different position
* @property {Function} onClickRemove - function specifying an action to take for rows removed from the data (defaults to an empty function)
* @property {Function} onColumnDelete - function invoked with the name of a column when the respective delete button for a column is clicked
* @property {Function} onFilteredChange - function invoked with the current filters after data has been filtered by user
* @property {Function} onEdit - function invoked with the updated data set after the value of a cell was changed by the user (only applies when table is `editable`)
* @property {Function} onTutorialCompletion - function invoked when user has completed the data table tutorial
*/
class DataTable extends Component {
constructor( props ) {
super( props );
debug( 'Constructor is invoked...' );
this.id = props.id || uid( props );
const dataInfo = props.dataInfo || {};
this.dragged = null;
this.reorder = [];
this.state = {
showInfo: !!dataInfo.showOnStartup,
dataInfo: {
info: dataInfo.info || [],
name: dataInfo.name || '',
variables: dataInfo.variables || null,
showOnStartup: dataInfo.showOnStartup || null
},
showSaveModal: false
};
}
static getDerivedStateFromProps( nextProps, prevState ) {
debug( 'Generating derived state...' );
const newState = {};
if ( nextProps.data !== prevState.data ) {
debug( 'Data is new...' );
let rows;
let keys;
let isArr = isArray( nextProps.data );
if ( isArr || isObject( nextProps.data ) ) {
if ( isArr ) {
// Case: `data` is already an array of observations
rows = nextProps.data.slice();
keys = objectKeys( rows[ 0 ] );
} else {
// Case: `data` is an object with keys for the various variables
rows = createRows( nextProps.data );
keys = objectKeys( nextProps.data );
}
debug( 'Created a `rows` array of length: '+rows.length );
if ( contains( keys, 'id' ) ) {
// Do not attach `id` column:
for ( let i = 0; i < rows.length; i++ ) {
if ( nextProps.showRemove && !rows[ i ][ 'remove' ]) {
rows[ i ][ 'remove' ] = false;
}
}
} else {
// Attach `id` column:
for ( let i = 0; i < rows.length; i++ ) {
if ( nextProps.showRemove && !rows[ i ][ 'remove' ]) {
rows[ i ][ 'remove' ] = false;
}
rows[ i ][ 'id' ] = i + 1;
}
keys.push( 'id' );
}
newState.rows = rows;
newState.keys = keys;
newState.filtered = nextProps.filters;
newState.showTooltip = false;
newState.data = nextProps.data;
newState.columns = createColumns( nextProps, newState );
}
}
if ( nextProps.dataInfo !== prevState.dataInfo ) {
debug( 'Data information has changed...' );
if ( nextProps.dataInfo ) {
newState.dataInfo = {
info: nextProps.dataInfo.info || [],
name: nextProps.dataInfo.name || '',
variables: nextProps.dataInfo.variables || null,
showOnStartup: nextProps.dataInfo.showOnStartup || null
};
}
}
if ( isEmptyObject( newState ) ) {
return null;
}
return newState;
}
componentDidMount() {
debug( 'Component has mounted...' );
if ( this.table ) {
const thead = findDOMNode( this.table ).getElementsByClassName( 'rt-thead' )[ 0 ];
const theadControls = findDOMNode( this.table ).getElementsByClassName( 'rt-thead' )[ 1 ];
const tbody = findDOMNode( this.table ).getElementsByClassName( 'rt-tbody' )[0];
tbody.addEventListener( 'scroll', () => {
thead.scrollLeft = tbody.scrollLeft;
theadControls.scrollLeft = tbody.scrollLeft;
});
}
}
componentDidUpdate( prevProps, prevState ) {
debug( 'Component has updated...' );
let newState = {};
if (
this.props.filters &&
(
this.props.filters !== prevProps.filters ||
this.props.filters.length !== prevProps.filters.length
)
) {
debug( `Data table now has ${this.props.filters.length} filters...` );
newState.filtered = this.props.filters;
}
if (
this.props.data !== prevProps.data &&
this.state.keys.length !== prevState.keys.length
) {
const thead = findDOMNode( this.table ).getElementsByClassName( 'rt-thead' )[ 0 ];
const theadControls = findDOMNode( this.table ).getElementsByClassName( 'rt-thead' )[ 1 ];
const tbody = findDOMNode( this.table ).getElementsByClassName( 'rt-tbody' )[0];
thead.scrollLeft = thead.scrollWidth;
theadControls.scrollLeft = theadControls.scrollWidth;
tbody.scrollLeft = tbody.scrollWidth;
}
if ( !isEmptyObject( newState ) ) {
debug( 'Trigger a state change after update...' );
this.setState( newState );
}
}
renderEditable = ( cellInfo ) => {
return (
<div
style={{ backgroundColor: '#fafafa' }}
contentEditable
suppressContentEditableWarning
onBlur={e => {
const rows = [...this.state.rows ];
const val = e.target.innerHTML;
rows[ cellInfo.index ][ cellInfo.column.id ] = RE_NUMBER.test( val ) ? Number( val ) : val;
this.setState({ rows }, () => {
this.props.onEdit( rows );
});
}}
/* eslint-disable-next-line react/no-danger */
dangerouslySetInnerHTML={{
__html: this.state.rows[ cellInfo.index ][ cellInfo.column.id ]
}}
/>
);
}
renderCheckboxRemovable = ( cellInfo ) => {
return (
<input
id="checkBox"
type="checkbox"
key={`${cellInfo.index}-${cellInfo.column.id}-${this.state.rows.length}`}
onClick={e => {
const rows = [ ...this.state.rows ];
rows[ cellInfo.index ][ cellInfo.column.id ] = e.target.checked;
this.setState({ rows });
this.props.onClickRemove( rows );
}}
/>
);
}
handleFilterChange = ( filtered, column ) => {
const tbody = findDOMNode( this.table ).getElementsByClassName( 'rt-tbody' )[0];
tbody.scrollTop = 0;
const session = this.context;
session.log({
id: this.id,
type: TABLE_FILTER,
value: column.id
});
this.setState({
filtered
}, () => {
this.props.onFilteredChange( this.state.filtered.filter( x => !isNull( x.value ) ) );
});
}
handleSortedChange = ( sorted, column ) => {
const session = this.context;
session.log({
id: this.id,
type: TABLE_SORT,
value: column.id
});
this.setState({
sorted
});
}
showDescriptions = () => {
this.setState({
showVarModal: true
});
}
reset = () => {
const session = this.context;
session.log({
id: this.id,
type: TABLE_RESET,
value: ''
});
this.setState({
filtered: [],
sorted: []
}, () => {
this.props.onFilteredChange( this.state.filtered );
});
}
showInfo = () => {
debug( 'Show dataset information...' );
this.setState({
showInfo: true
});
}
toggleSaveModal = () => {
this.setState({
showSaveModal: !this.state.showSaveModal
});
}
saveJSON = () => {
const blob = new Blob([ JSON.stringify( this.state.data ) ], {
type: 'application/json'
});
const dataInfo = this.props.dataInfo;
let name;
if ( !dataInfo || !dataInfo.name ) {
name = 'dataset.json';
} else {
name = dataInfo.name;
}
saveAs( blob, name );
}
saveCSV = () => {
const session = this.context;
import( 'csv-stringify' ).then( main => {
const stringify = main.default;
stringify( this.state.rows, {
header: true
}, ( err, output ) => {
if ( err ) {
return session.addNotification({
title: this.props.t('error-encountered'),
message: this.props.t('error-csv')+err.message,
level: 'error',
position: 'tl'
});
}
const blob = new Blob([ output ], {
type: 'text/plain'
});
const dataInfo = this.props.dataInfo;
let name;
if ( !dataInfo || !dataInfo.name ) {
name = 'dataset.csv';
} else {
name = `${dataInfo.name}.csv`;
}
saveAs( blob, name );
});
});
}
render() {
debug( 'Rendering component' );
let { rows, dataInfo } = this.state;
if ( !rows ) {
return <Alert variant="danger">{this.props.t('no-data')}</Alert>;
}
let modal = null;
if ( this.state.showVarModal ) {
modal = <Modal
dialogClassName="modal-50w"
show={this.state.showVarModal}
onHide={()=>{
this.setState({ showVarModal: false });
}}>
<Modal.Header closeButton>
<Modal.Title>
{this.props.t('variables')}
</Modal.Title>
</Modal.Header>
<Modal.Body>
{createDescriptions( dataInfo.variables, this.props.t )}
</Modal.Body>
</Modal>;
} else if ( this.state.showInfo ) {
debug( 'Rendering dataset information modal...' );
modal = <Modal
show={this.state.showInfo}
dialogClassName="modal-50w"
onHide={()=>{
this.setState({
showInfo: false
});
}}>
<Modal.Header closeButton>
<Modal.Title>
{dataInfo.name} {this.props.t('description')}
</Modal.Title>
</Modal.Header>
<Modal.Body dangerouslySetInnerHTML={{ // eslint-disable-line react/no-danger
__html: md.render( isArray( dataInfo.info ) ? dataInfo.info.join( '\n' ) : dataInfo.info )
}}>
</Modal.Body>
</Modal>;
}
let cols = this.state.columns.slice();
// Run re-order events:
this.reorder.forEach( o => {
cols[ o.a ] = cols.splice( o.b, 1, cols[o.a] )[ 0 ];
});
cols = cols.map( ( col, i ) => {
if ( col.Header === 'id' ) {
return col;
}
return ({
...col,
Header: <span
className="draggable-header" id={`header-${col.id}`}
draggable="true"
onDragStart={e => {
e.stopPropagation();
e.dataTransfer.setData( 'Text', i );
this.dragged = i;
}}
onDrag={e => e.stopPropagation}
onDragEnd={e => {
e.stopPropagation();
setTimeout(() => {
this.dragged = null;
}, 100 );
}}
onDragOver={e => {
e.preventDefault();
e.dataTransfer.dropEffect = 'move';
}}
onDrop={e => {
e.preventDefault();
let a = i;
let b = this.dragged;
const keys = this.state.columns.map( x => x.id );
keys.shift();
const tmp = keys[ a ];
keys[ a ] = keys[ b ];
keys[ b ] = tmp;
this.props.onColumnDrag( keys );
this.reorder.push({ a, b });
this.forceUpdate();
}}
>{col.Header}</span>
});
});
if ( this.props.showIdColumn ) {
cols.unshift({
Header: 'id',
accessor: 'id',
className: 'frozen',
headerClassName: 'frozen',
filterable: false,
resizable: false,
width: 50
});
}
if ( this.props.showRemove ) {
cols.push({
Header: this.props.t('remove'),
accessor: 'remove',
Cell: this.renderCheckboxRemovable,
filterable: false
});
}
cols.push({
Header: '',
className: 'table_last_col',
filterable: false,
sortable: false,
resizable: false,
width: 30
});
const saveButton = <Tooltip placement="bottom" tooltip={this.props.disableDownload ? this.props.t('download-disabled') : this.props.t('download-data')} >
<Button className="save-button" variant="light" onClick={this.toggleSaveModal} disabled={this.props.disableDownload} >
<i className="fas fa-download"></i>
</Button>
</Tooltip>;
return (
<Fragment>
<div className="data-table-wrapper" id={this.id} style={this.props.style} >
<div className='data-table-header-wrapper'>
<Tooltip placement="bottom" tooltip={this.props.t('open-description')} show={dataInfo.info.length > 0} >
<Button
variant="light"
disabled={dataInfo.info.length === 0}
onClick={this.showInfo}
className='data-table-title-button'
style={{
cursor: dataInfo.info.length > 0 ? 'pointer' : 'inherit'
}}
>
<h4 className='data-table-title-button-h4'>
{dataInfo.name ? dataInfo.name : this.props.t('data')}
</h4>
</Button>
</Tooltip>
{saveButton}
<TutorialButton
id={this.id}
session={this.context}
onTutorialCompletion={this.props.onTutorialCompletion}
t={this.props.t}
/>
</div>
<ReactTable
id={this.id}
data={rows}
columns={cols}
showPagination={true}
sortable={true}
resizable={true}
filterable={this.props.filterable}
filtered={this.state.filtered}
sorted={this.state.sorted}
showPageSizeOptions={false}
defaultPageSize={50}
onFilteredChange={this.handleFilterChange}
onSortedChange={this.handleSortedChange}
style={this.props.style}
getTableProps={() => {
return {
onScroll: e => {
let left = e.target.scrollLeft > 0 ? e.target.scrollLeft : 0;
for ( let i = 0; i < this.frozenElems.length; i++ ) {
this.frozenElems[ i ].style.left = `${left}px`;
}
}
};
}}
getTrProps={( state, rowInfo, column, table ) => {
let out;
if ( this.props.getTrProps ) {
out = this.props.getTrProps( state, rowInfo, column, table );
} else {
out = {};
}
if ( !out.style ) {
out.style = {};
}
out.style.width = 'max-content !important';
return out;
}}
previousText={this.props.t('previous')}
nextText={this.props.t('next')}
loadingText={this.props.t('loading')}
noDataText={this.props.t('no-rows-found')}
pageText={this.props.t('page')}
ofText={this.props.t('of')}
rowsText={this.props.t('rows')}
>
{( state, makeTable, instance ) => {
const selectedRows = state.sortedData.length;
return (
<div ref={( table ) => {
if ( table ) {
this.table = table;
this.frozenElems = findDOMNode( this.table ).getElementsByClassName( 'frozen' );
}
}} >
<ButtonToolbar className="data-table-header-toolbar">
{ dataInfo.variables ? <Tooltip placement="right" tooltip={this.props.t('variable-descriptions-tooltip')} ><Button
onClick={this.showDescriptions}
variant="light"
size="xsmall"
className="variable-descriptions-button"
>
{this.props.t('variable-descriptions')}
</Button></Tooltip> : null }
{ ( selectedRows !== rows.length ) || ( this.state.sorted && this.state.sorted.length > 0 ) ?
<Tooltip placement="left" tooltip={this.props.t('reset-display-tooltip')} >
<Button
onClick={this.reset}
variant="light"
size="xsmall"
className="reset-button"
>
{this.props.t('reset-display')}
</Button>
</Tooltip> : null }
</ButtonToolbar>
{makeTable()}
<label className="label-number-rows">
<i>{this.props.t('number-rows')}: {selectedRows} ({this.props.t('total')}: {rows.length})</i>
</label>
</div>
);
}}
</ReactTable>
</div>
{modal}
{this.state.showSaveModal ?
<Modal
show={this.state.showSaveModal}
onHide={this.toggleSaveModal}
>
<Modal.Header closeButton>
<Modal.Title>
{this.props.t('download-data')}
</Modal.Title>
</Modal.Header>
<Modal.Body>
{this.props.t('download-data-body')}
</Modal.Body>
<Modal.Footer>
<Button onClick={() => {
this.saveCSV();
this.toggleSaveModal();
}} >{this.props.t('save-csv')}</Button>
<Button onClick={() => {
this.saveJSON();
this.toggleSaveModal();
}} >{this.props.t('save-json')}</Button>
</Modal.Footer>
</Modal> : null }
</Fragment>
);
}
}
// PROPERTIES //
DataTable.defaultProps = {
dataInfo: {
'info': [],
'name': '',
'variables': null,
'showOnStartup': false
},
deletable: false,
undeletableVars: [],
filterable: true,
editable: [],
getTrProps: void 0,
onColumnDrag() {},
onColumnDelete() {},
onColumnNameChange() {},
onClickRemove() {},
onEdit() {},
onFilteredChange() {},
onTutorialCompletion() {},
filters: [],
showRemove: false,
showIdColumn: true,
disableDownload: false,
className: '',
style: {}
};
/* eslint-disable react/no-unused-prop-types */
DataTable.propTypes = {
data: PropTypes.oneOfType([
PropTypes.array,
PropTypes.object
]).isRequired,
dataInfo: PropTypes.object,
deletable: PropTypes.bool,
undeletableVars: PropTypes.arrayOf( PropTypes.string ),
filterable: PropTypes.bool,
editable: PropTypes.array,
getTrProps: PropTypes.func,
onColumnDrag: PropTypes.func,
onColumnDelete: PropTypes.func,
onColumnNameChange: PropTypes.func,
onClickRemove: PropTypes.func,
onEdit: PropTypes.func,
onTutorialCompletion: PropTypes.func,
filters: PropTypes.array,
onFilteredChange: PropTypes.func,
showRemove: PropTypes.bool,
showIdColumn: PropTypes.bool,
disableDownload: PropTypes.bool,
className: PropTypes.string,
style: PropTypes.object
};
DataTable.contextType = SessionContext;
// EXPORTS //
export default withTranslation( 'data-table' )( DataTable );
|
neha-b2001/wildfly-core
|
testsuite/domain/src/test/java/org/jboss/as/test/integration/respawn/RespawnTestCase.java
|
/*
* JBoss, Home of Professional Open Source.
* Copyright 2011, Red Hat, Inc., and individual contributors
* as indicated by the @author tags. See the copyright.txt file in the
* distribution for a full listing of individual contributors.
*
* This is free software; you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as
* published by the Free Software Foundation; either version 2.1 of
* the License, or (at your option) any later version.
*
* This software is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this software; if not, write to the Free
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
*/
package org.jboss.as.test.integration.respawn;
import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.HOST;
import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.MASTER;
import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.NAME;
import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.OP;
import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.OP_ADDR;
import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.OUTCOME;
import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.READ_ATTRIBUTE_OPERATION;
import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.READ_RESOURCE_OPERATION;
import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.RESTART;
import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.RESULT;
import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.RUNNING_SERVER;
import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.SERVER_CONFIG;
import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.SHUTDOWN;
import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.SUCCESS;
import static org.jboss.as.test.integration.domain.management.util.Authentication.getCallbackHandler;
import java.io.BufferedInputStream;
import java.io.BufferedOutputStream;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.net.URISyntaxException;
import java.net.URL;
import java.nio.charset.StandardCharsets;
import java.nio.file.Files;
import java.security.NoSuchAlgorithmException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Set;
import org.jboss.as.controller.PathAddress;
import org.jboss.as.controller.PathElement;
import org.jboss.as.controller.descriptions.ModelDescriptionConstants;
import org.jboss.as.process.Main;
import org.jboss.as.process.ProcessController;
import org.jboss.as.test.integration.domain.management.util.DomainTestSupport;
import org.jboss.as.test.shared.TestSuiteEnvironment;
import org.jboss.dmr.ModelNode;
import org.jboss.logging.Logger;
import org.junit.AfterClass;
import org.junit.Assert;
import org.junit.BeforeClass;
import org.junit.Test;
import org.wildfly.security.sasl.util.UsernamePasswordHashUtil;
import org.xnio.IoUtils;
/**
* RespawnTestCase
*
* @author <a href="mailto:<EMAIL>"><NAME></a>
*/
public class RespawnTestCase {
private static final int TIMEOUT = 120000;
private static final String HOST_CONTROLLER = Main.HOST_CONTROLLER_PROCESS_NAME;
private static final String PROCESS_CONTROLLER = "Process";
private static final String SERVER_ONE = "respawn-one";
private static final String SERVER_TWO = "respawn-two";
private static final int HC_PORT = 9999;
static ProcessController processController;
static ProcessUtil processUtil;
static File domainConfigDir;
static File hostXml;
static TestControllerUtils utils;
static TestControllerClient client;
private static final Logger log = Logger.getLogger(RespawnTestCase.class);
@BeforeClass
public static void createProcessController() throws IOException, URISyntaxException, NoSuchAlgorithmException {
// Setup client
utils = TestControllerUtils.create(DomainTestSupport.masterAddress, HC_PORT, getCallbackHandler());
client = new TestControllerClient(utils.getConfiguration(), utils.getExecutor());
final String testName = RespawnTestCase.class.getSimpleName();
final File domains = new File("target" + File.separator + "domains" + File.separator + testName);
final File masterDir = new File(domains, "master");
final String masterDirPath = masterDir.getAbsolutePath();
domainConfigDir = new File(masterDir, "configuration");
// TODO this should not be necessary
domainConfigDir.mkdirs();
if (File.pathSeparatorChar == ':'){
processUtil = new UnixProcessUtil();
} else {
processUtil = new WindowsProcessUtil();
}
String jbossHome = System.getProperty("jboss.home");
if (jbossHome == null) {
throw new IllegalStateException("-Djboss.home must be set");
}
ClassLoader tccl = Thread.currentThread().getContextClassLoader();
URL url = tccl.getResource("domain-configs/domain-respawn.xml");
Assert.assertNotNull(url);
File domainXml = new File(url.toURI());
url = tccl.getResource("host-configs/respawn-master.xml");
hostXml = new File(url.toURI());
Assert.assertTrue(domainXml.exists());
Assert.assertTrue(hostXml.exists());
copyFile(domainXml, domainConfigDir);
copyFile(hostXml, domainConfigDir);
// No point backing up the file in a test scenario, just write what we need.
File usersFile = new File(domainConfigDir, "mgmt-users.properties");
Files.write(usersFile.toPath(),
("slave=" + new UsernamePasswordHashUtil().generateHashedHexURP("slave", "ManagementRealm", "slave_user_password".toCharArray())+"\n")
.getBytes(StandardCharsets.UTF_8));
String localRepo = System.getProperty("settings.localRepository");
final String address = System.getProperty("jboss.test.host.master.address", "127.0.0.1");
List<String> args = new ArrayList<String>();
args.add("-jboss-home");
args.add(jbossHome);
args.add("-jvm");
args.add(processUtil.getJavaCommand());
args.add("--");
if(localRepo != null) {
args.add("-Dmaven.repo.local=" + localRepo);
}
args.add("-Dorg.jboss.boot.log.file=" + masterDirPath + "/log/host-controller.log");
args.add("-Dlogging.configuration=file:" + jbossHome + "/domain/configuration/logging.properties");
args.add("-Djboss.test.host.master.address=" + address);
TestSuiteEnvironment.getIpv6Args(args);
args.add("-Xms64m");
args.add("-Xmx512m");
args.add("-XX:MaxMetaspaceSize=256m");
String cliJvmArgs = System.getProperty("cli.jvm.args");
if (cliJvmArgs != null && !cliJvmArgs.trim().isEmpty()) {
args.addAll(Arrays.asList(cliJvmArgs.split("\\s+")));
}
args.add("--");
args.add("-default-jvm");
args.add(processUtil.getJavaCommand());
args.add("--host-config=" + hostXml.getName());
args.add("--domain-config=" + domainXml.getName());
args.add("-Djboss.test.host.master.address=" + address);
args.add("-Djboss.domain.base.dir=" + masterDir.getAbsolutePath());
if(localRepo != null) {
args.add("-Dmaven.repo.local=" + localRepo);
}
args.add("--interprocess-hc-address");
args.add(address);
args.add("--pc-address");
args.add(address);
log.info(args.toString());
processController = Main.start(args.toArray(new String[args.size()]));
}
@AfterClass
public static void destroyProcessController(){
if (processController != null){
processController.shutdown();
processController = null;
}
IoUtils.safeClose(client);
IoUtils.safeClose(utils);
}
@Test
public void testDomainRespawn() throws Exception {
System.out.println("testDomainRespawn()");
//Make sure everything started
List<RunningProcess> processes = waitForAllProcessesFullyStarted();
//Kill the master HC and make sure that it gets restarted
RunningProcess originalHc = processUtil.getProcess(processes, HOST_CONTROLLER);
Assert.assertNotNull(originalHc);
processUtil.killProcess(originalHc);
processes = waitForAllProcesses();
RunningProcess respawnedHc = processUtil.getProcess(processes, HOST_CONTROLLER);
Assert.assertNotNull(respawnedHc);
Assert.assertFalse(originalHc.getProcessId().equals(respawnedHc.getProcessId()));
readHostControllerServers();
}
@Test
public void testReloadHc() throws Exception {
System.out.println("testReloadHc()");
List<RunningProcess> original = waitForAllProcessesFullyStarted();
Set<String> serverIds = new HashSet<String>();
for (RunningProcess proc : original) {
if (!proc.getProcess().equals(HOST_CONTROLLER)) {
serverIds.add(proc.getProcessId());
}
}
executeReloadOperation(null, null);
List<RunningProcess> reloaded = waitForAllProcesses(serverIds);
Assert.assertEquals(original.size(), reloaded.size());
//Check new processes different from old, apart from HC
for (RunningProcess reloadedProc : reloaded) {
RunningProcess orig = findProcess(original, reloadedProc.getProcess());
if (reloadedProc.getProcess().equals(HOST_CONTROLLER)) {
Assert.assertTrue(reloadedProc.getProcessId().equals(orig.getProcessId()));
} else {
Assert.assertFalse(reloadedProc.getProcessId().equals(orig.getProcessId()));
}
}
}
@Test
public void testReloadHcButNotServers() throws Exception {
System.out.println("testReloadHcButNotServers()");
List<RunningProcess> original = waitForAllProcessesFullyStarted();
//Execute reload w/ restart-servers=false, admin-only=true
executeReloadOperation(false, true);
//Read HC model until there are no servers
long start = System.currentTimeMillis();
long timeout = start + TIMEOUT;
long minCheckPeriod = start + 5000;
while (true) {
Thread.sleep(500);
if (lookupServerInModel(MASTER, SERVER_ONE) || lookupServerInModel(MASTER, SERVER_TWO)) {
if (System.currentTimeMillis() >= timeout) {
Assert.fail("Should not have servers in restarted admin-only HC model");
}
} else if (System.currentTimeMillis() >= minCheckPeriod) {
break;
} // else loop and retest in case the server reconnects w/in minCheckPeriod
}
System.out.println("reloaded into admin-only after " + (System.currentTimeMillis() - start) + " ms");
//Execute reload w/ restart-servers=false, admin-only=false
executeReloadOperation(false, false);
System.out.println("reloaded out of admin-only; waiting for servers");
//Wait for servers
readHostControllerServers();
//Check all processes are the same
List<RunningProcess> reloaded = waitForAllProcesses();
Assert.assertEquals(original.size(), reloaded.size());
//Check new processes different from old, apart from HC
for (RunningProcess reloadedProc : reloaded) {
RunningProcess orig = findProcess(original, reloadedProc.getProcess());
Assert.assertTrue(reloadedProc.getProcessId().equals(orig.getProcessId()));
}
}
@Test
public void testReloadHcButNotServersWithFailedServer() throws Exception {
System.out.println("testReloadHcButNotServersWithFailedServer()");
List<RunningProcess> original = waitForAllProcessesFullyStarted();
RunningProcess serverOne = processUtil.getProcess(original, SERVER_ONE);
Assert.assertNotNull(serverOne);
System.out.println("killing respawn-one: " + serverOne);
processUtil.killProcess(serverOne);
//Execute reload w/ restart-servers=false, admin-only=false
executeReloadOperation(false, false);
//Wait for servers
readHostControllerServer(SERVER_TWO);
// we need to wait for the master being in running state before execute this operation
awaitHostController(MASTER);
manageServer("stop", SERVER_ONE);
Thread.sleep(5000);
readHostControllerServer(SERVER_TWO);
manageServer("start", SERVER_ONE);
//Check all processes are the same
List<RunningProcess> reloaded = waitForAllProcesses();
Assert.assertEquals(original.size(), reloaded.size());
}
@Test
public void testStartKilledServer() throws Exception {
List<RunningProcess> original = waitForAllProcessesFullyStarted();
RunningProcess serverOne = processUtil.getProcess(original, SERVER_ONE);
Assert.assertNotNull(serverOne);
System.out.println("killing respawn-one: " + serverOne);
processUtil.killProcess(serverOne);
manageServer("start", SERVER_ONE);
readHostControllerServer(SERVER_ONE);
//Check all processes are the same
List<RunningProcess> reloaded = waitForAllProcesses();
Assert.assertEquals(original.size(), reloaded.size());
}
@Test
public void testHCReloadAbortPreservesServers() throws Exception {
System.out.println("testHCReloadAbortPreservesServers()");
List<RunningProcess> original = waitForAllProcessesFullyStarted();
try {
// Replace host.xml with an invalid doc
File toBreak = new File(domainConfigDir, hostXml.getName());
Files.write(toBreak.toPath(), "<host/>\n".getBytes(StandardCharsets.UTF_8));
// Execute reload w/ restart-servers=false, admin-only=false
// The reload should abort the HC due to bad xml
executeReloadOperation(false, false);
long deadline = System.currentTimeMillis() + 30000;
boolean origHCGone;
do {
// Check that the originalHC process doesn't exist and
// both original servers still exist. The originalHC still existing
// is not a failure condition until we hit the deadline
origHCGone = true;
Set<RunningProcess> updated = new HashSet<RunningProcess>(waitForProcesses(SERVER_ONE, SERVER_TWO));
for (RunningProcess process : original) {
if (!process.getProcess().equals(HOST_CONTROLLER)) {
Assert.assertTrue(process.getProcess() + " is missing", updated.contains(process));
} else {
origHCGone = !updated.contains(process);
}
}
if (!origHCGone) {
Thread.sleep(100);
}
} while (!origHCGone && System.currentTimeMillis() < deadline);
if (!origHCGone) {
Assert.fail("Original HC process did not terminate within 30 seconds");
}
} finally {
copyFile(hostXml, domainConfigDir);
waitForAllProcesses();
}
}
private RunningProcess findProcess(List<RunningProcess> processes, String name) {
RunningProcess proc = null;
for (RunningProcess cur : processes) {
if (cur.getProcess().equals(name)) {
Assert.assertNull(proc);
proc = cur;
}
}
Assert.assertNotNull(proc);
return proc;
}
private void executeReloadOperation(Boolean restartServers, Boolean adminOnly) throws Exception {
ModelNode operation = new ModelNode();
operation.get(OP).set("reload");
operation.get(OP_ADDR).set(PathAddress.pathAddress(PathElement.pathElement(HOST, "master")).toModelNode());
if (restartServers != null) {
operation.get(ModelDescriptionConstants.RESTART_SERVERS).set(restartServers);
}
if (adminOnly != null) {
operation.get(ModelDescriptionConstants.ADMIN_ONLY).set(adminOnly);
}
final TestControllerClient client = getControllerClient();
try {
Assert.assertEquals(SUCCESS, client.executeAwaitClosed(operation).get(OUTCOME).asString());
} catch (IOException canHappenWhenShuttingDownController) {
}
}
private void shutdownHostController(boolean restart) throws Exception {
final ModelNode operation = new ModelNode();
operation.get(OP).set(SHUTDOWN);
operation.get(OP_ADDR).set(PathAddress.pathAddress(PathElement.pathElement(HOST, "master")).toModelNode());
operation.get(RESTART).set(restart);
}
private void manageServer(String operationName, String serverName) throws Exception {
ModelNode operation = new ModelNode();
operation.get(OP).set(operationName);
operation.get(OP_ADDR).set(getHostControllerServerConfigAddress(MASTER, serverName));
operation.get("blocking").set(true);
try {
Assert.assertEquals(SUCCESS, getControllerClient().execute(operation).get(OUTCOME).asString());
} catch (IOException canHappenWhenShuttingDownController) {
}
}
private void readHostControllerServer(String serverName) throws Exception {
final long time = System.currentTimeMillis() + TIMEOUT;
boolean hasOne = false;
do {
Thread.sleep(250);
hasOne = lookupServerInModel(MASTER, serverName);
if (hasOne) {
break;
}
} while (System.currentTimeMillis() < time);
Assert.assertTrue(hasOne);
}
private void readHostControllerServers() throws Exception {
final long time = System.currentTimeMillis() + TIMEOUT;
boolean hasOne = false;
boolean hasTwo = false;
do {
Thread.sleep(250);
hasOne = lookupServerInModel(MASTER, SERVER_ONE);
hasTwo = lookupServerInModel(MASTER, SERVER_TWO);
if (hasOne && hasTwo) {
break;
}
} while (System.currentTimeMillis() < time);
Assert.assertTrue(hasOne);
Assert.assertTrue(hasTwo);
}
private boolean lookupServerInModel(String host, String server) throws Exception {
final ModelNode operation = new ModelNode();
operation.get(OP).set(READ_RESOURCE_OPERATION);
operation.get(OP_ADDR).set(getHostControllerServerAddress(host, server));
try {
final ModelNode result = getControllerClient().execute(operation);
if (result.get(OUTCOME).asString().equals(SUCCESS)){
final ModelNode model = result.require(RESULT);
if (model.hasDefined(NAME) && model.get(NAME).asString().equals(server)) {
return true;
}
}
} catch (IOException e) {
//
}
return false;
}
private ModelNode getHostControllerServerAddress(String host, String server) {
return PathAddress.pathAddress(PathElement.pathElement(HOST, host), PathElement.pathElement(RUNNING_SERVER, server)).toModelNode();
}
private ModelNode getHostControllerServerConfigAddress(String host, String server) {
return PathAddress.pathAddress(PathElement.pathElement(HOST, host), PathElement.pathElement(SERVER_CONFIG, server)).toModelNode();
}
private List<RunningProcess> waitForAllProcesses() throws Exception {
return waitForProcesses(HOST_CONTROLLER, SERVER_ONE, SERVER_TWO);
}
private List<RunningProcess> waitForAllProcessesFullyStarted() throws Exception {
List<RunningProcess> result = waitForProcesses(HOST_CONTROLLER, SERVER_ONE, SERVER_TWO);
readHostControllerServers();
return result;
}
private List<RunningProcess> waitForProcesses(String... requiredNames) throws Exception {
final long time = System.currentTimeMillis() + TIMEOUT;
List<RunningProcess> runningProcesses;
do {
Thread.sleep(200);
runningProcesses = processUtil.getRunningProcesses();
if (processUtil.containsProcesses(runningProcesses, requiredNames)){
return runningProcesses;
}
} while(System.currentTimeMillis() < time);
Assert.fail("Did not have all running processes " + runningProcesses);
return null;
}
private List<RunningProcess> waitForAllProcesses(Set<String> excludedProcessIds) throws Exception {
final long time = System.currentTimeMillis() + TIMEOUT;
List<RunningProcess> runningProcesses;
do {
Thread.sleep(200);
runningProcesses = processUtil.getRunningProcesses();
for (Iterator<RunningProcess> it = runningProcesses.iterator() ; it.hasNext() ; ) {
RunningProcess proc = it.next();
if (excludedProcessIds.contains(proc.getProcessId())) {
it.remove();
}
}
if (processUtil.containsProcesses(runningProcesses, HOST_CONTROLLER, SERVER_ONE, SERVER_TWO)){
return runningProcesses;
}
} while(System.currentTimeMillis() < time);
Assert.fail("Did not have all running processes " + runningProcesses);
return null;
}
private static void copyFile(File file, File directory) throws IOException{
File tgt = new File(directory, file.getName());
if (tgt.exists()) {
if (!tgt.delete()) {
throw new IllegalStateException("Could not delete file " + tgt.getAbsolutePath());
}
}
final InputStream in = new BufferedInputStream(new FileInputStream(file));
try {
final OutputStream out = new BufferedOutputStream(new FileOutputStream(tgt));
try {
int i = in.read();
while (i != -1) {
out.write(i);
i = in.read();
}
} finally {
IoUtils.safeClose(out);
}
} finally {
IoUtils.safeClose(in);
}
}
static TestControllerClient getControllerClient() throws IOException {
client.connect(); // Ensure connected
return client;
}
private void awaitHostController(String hostControllerName) throws Exception {
final long time = System.currentTimeMillis() + TIMEOUT;
do {
Thread.sleep(250);
final ModelNode operation = new ModelNode();
operation.get(OP).set(READ_ATTRIBUTE_OPERATION);
PathAddress pathElements = PathAddress.pathAddress(PathElement.pathElement(HOST, hostControllerName));
operation.get(OP_ADDR).set(pathElements.toModelNode());
operation.get(NAME).set("host-state");
try {
final ModelNode result = getControllerClient().execute(operation);
if (result.get(OUTCOME).asString().equals(SUCCESS)) {
if ("running".equals(result.require(RESULT).asString())) {
break;
}
}
} catch (IOException e) {
//
}
} while (System.currentTimeMillis() < time);
}
private abstract static class ProcessUtil {
List<String> initialProcessIds;
ProcessUtil(){
initialProcessIds = getInitialProcessIds();
}
List<String> getInitialProcessIds(){
List<String> processes = listProcesses();
List<String> ids = new ArrayList<String>();
for (String proc : processes){
ids.add(parseProcessId(proc));
}
return ids;
}
String parseProcessId(String proc){
proc = proc.trim();
int i = proc.indexOf(' ');
return proc.substring(0, i);
}
List<RunningProcess> getRunningProcesses(){
List<RunningProcess> running = new ArrayList<RunningProcess>();
List<String> processes = listProcesses();
for (String proc : processes){
String id = parseProcessId(proc);
if (!initialProcessIds.contains(id)){
if (proc.contains(SERVER_ONE)){
running.add(new RunningProcess(id, SERVER_ONE));
} else if (proc.contains(SERVER_TWO)){
running.add(new RunningProcess(id, SERVER_TWO));
} else if (proc.contains(HOST_CONTROLLER) && !proc.contains(PROCESS_CONTROLLER)){
running.add(new RunningProcess(id, HOST_CONTROLLER));
}
}
}
return running;
}
List<String> listProcesses() {
final Process p;
try {
p = Runtime.getRuntime().exec(getJpsCommand());
} catch (IOException e) {
throw new RuntimeException(e);
}
List<String> processes = new ArrayList<String>();
BufferedReader input = new BufferedReader(new InputStreamReader(p.getInputStream()));
try {
String line;
while ((line = input.readLine()) != null) {
if (line.contains("jboss-modules.jar")) {
processes.add(line);
}
}
} catch (IOException e) {
throw new RuntimeException(e);
} finally {
IoUtils.safeClose(input);
}
return processes;
}
void killProcess(RunningProcess process) {
try {
Runtime.getRuntime().exec(getKillCommand(process));
} catch (IOException e) {
throw new RuntimeException(e);
}
final long time = System.currentTimeMillis() + TIMEOUT;
do {
try {
Thread.sleep(200);
} catch (InterruptedException e) {
throw new RuntimeException(e);
}
List<RunningProcess> runningProcesses = processUtil.getRunningProcesses();
if (processUtil.getProcessById(runningProcesses, process.getProcessId()) == null){
return;
}
} while(System.currentTimeMillis() < time);
Assert.fail("Did not kill process " + process + " " + processUtil.getRunningProcesses());
}
abstract String[] getJpsCommand();
abstract String getJavaCommand();
abstract String getKillCommand(RunningProcess process);
private boolean containsProcesses(List<RunningProcess> runningProcesses, String...names){
for (String name : names){
boolean found = false;
for (RunningProcess proc : runningProcesses) {
if (proc.getProcess().equals(name)){
found = true;
continue;
}
}
if (!found){
return false;
}
}
return true;
}
private RunningProcess getProcess(List<RunningProcess> runningProcesses, String name){
for (RunningProcess proc : runningProcesses){
if (proc.getProcess().equals(name)){
return proc;
}
}
return null;
}
private RunningProcess getProcessById(List<RunningProcess> runningProcesses, String id){
for (RunningProcess proc : runningProcesses){
if (proc.getProcessId().equals(id)){
return proc;
}
}
return null;
}
}
private static class UnixProcessUtil extends ProcessUtil {
@Override
String[] getJpsCommand() {
final File jreHome = new File(System.getProperty("java.home"));
Assert.assertTrue("JRE home not found. File: " + jreHome.getAbsoluteFile(), jreHome.exists());
if (TestSuiteEnvironment.isIbmJvm()) {
return new String[] { "sh", "-c", "ps -ef | awk '{$1=\"\"; print $0}'" };
} else {
File jpsExe = new File(jreHome, "bin/jps");
if (!jpsExe.exists()) {
jpsExe = new File(jreHome, "../bin/jps");
}
Assert.assertTrue("JPS executable not found. File: " + jpsExe, jpsExe.exists());
return new String[] { jpsExe.getAbsolutePath(), "-l", "-v" };
}
}
@Override
String getJavaCommand() {
return System.getProperty("java.home") + "/bin/java";
}
@Override
String getKillCommand(RunningProcess process) {
return "kill -9 " + process.getProcessId();
}
}
private static class WindowsProcessUtil extends ProcessUtil {
@Override
String[] getJpsCommand() {
final File jreHome = new File(System.getProperty("java.home"));
Assert.assertTrue("JRE home not found. File: " + jreHome.getAbsoluteFile(), jreHome.exists());
File jpsExe = new File(jreHome, "bin/jps.exe");
if (!jpsExe.exists()) {
jpsExe = new File(jreHome, "../bin/jps.exe");
}
Assert.assertTrue("JPS executable not found. File: " + jpsExe, jpsExe.exists());
return new String[] { jpsExe.getAbsolutePath(), "-l", "-v" };
}
@Override
String getJavaCommand() {
return System.getProperty("java.home") + "/bin/java.exe";
}
@Override
String getKillCommand(RunningProcess process) {
return "taskkill /f /pid " + process.getProcessId();
}
}
private static class RunningProcess {
final String processId;
final String process;
private RunningProcess(String processId, String process) {
this.processId = processId;
this.process = process;
}
public String getProcessId() {
return processId;
}
public String getProcess() {
return process;
}
@Override
public int hashCode() {
return processId.hashCode();
}
@Override
public boolean equals(Object obj) {
return obj instanceof RunningProcess && ((RunningProcess) obj).processId.equals(processId);
}
@Override
public String toString() {
return "Process{id=" + processId + ", process=" + process + "}";
}
}
}
|
GenaAiv/portfolio-website
|
node_modules/eslint-plugin-flowtype/dist/utilities/isFlowFileAnnotation.js
|
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _lodash = require('lodash');
var _lodash2 = _interopRequireDefault(_lodash);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var FLOW_MATCHER = /^@(?:no)?flow$/;
exports.default = function (comment, strict) {
// eslint-disable-next-line flowtype/require-valid-file-annotation
// The flow parser splits comments with the following regex to look for the @flow flag.
// See https://github.com/facebook/flow/blob/a96249b93541f2f7bfebd8d62085bf7a75de02f2/src/parsing/docblock.ml#L39
return _lodash2.default.some(comment.split(/[ \t\r\n\\*/]+/), function (commentPart) {
var match = commentPart.match(FLOW_MATCHER);
if (match === null) {
return false;
}
return !strict || match[0] === '@flow';
});
};
module.exports = exports.default;
|
bangra1/final
|
A_Team-finalproject-3c34732ca41925ce8300b7051cc05707ac4c330d/src/net/sf/freecol/common/model/mission/Mission.java
|
/**
* Copyright (C) 2002-2015 The FreeCol Team
*
* This file is part of FreeCol.
*
* FreeCol is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* FreeCol is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTLIMIT or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with FreeCol. If not, see <http://www.gnu.org/licenses/>.
*/
package net.sf.freecol.common.model.mission;
import javax.xml.stream.XMLStreamException;
import net.sf.freecol.common.io.FreeColXMLWriter;
import net.sf.freecol.common.model.Unit;
/**
* The Mission interface describes some kind of order that can be
* given to a {@link Unit}, such as the order to move to a certain
* Tile, attack a certain Unit, or build a TileImprovement, for
* example. Missions can be atomic, or combine a number of simpler
* Missions.
*/
public interface Mission {
public static enum MissionState {
/**
* Mission is in progress.
*/
OK,
/**
* Mission has been completed.
*/
COMPLETED,
/**
* Mission is temporarily blocked, e.g. by another Unit.
*/
BLOCKED,
/**
* Mission has been aborted, e.g. because a target or
* destination has been destroyed.
*/
ABORTED
};
/**
* Attempts to carry out the mission and returns an appropriate
* MissionState.
*
* @return a <code>MissionState</code> value
*/
public MissionState doMission();
/**
* Returns true if the mission is still valid. This might not be
* the case if its target or destination have been destroyed, or
* if the Unit this mission was assigned to was destroyed or
* changed owner, for example.
*
* @return a <code>boolean</code> value
*/
public boolean isValid();
/**
* Return the Unit this mission was assigned to.
*
* @return an <code>Unit</code> value
*/
public Unit getUnit();
/**
* This method writes an XML-representation of this object to
* the given stream.
*
* @param xw The <code>FreeColXMLWriter</code> to write to.
* @throws XMLStreamException if there are any problems writing
* to the stream.
*/
public void toXML(FreeColXMLWriter xw) throws XMLStreamException;
}
|
mrbrazzi/django-misclientes
|
misclientes/migrations/0024_auto_20190217_1813.py
|
# Generated by Django 2.0.6 on 2019-02-17 17:13
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('misclientes', '0023_remove_cliente_signature'),
]
operations = [
migrations.RemoveField(
model_name='enterprise',
name='pic',
),
migrations.AlterField(
model_name='cliente',
name='idnum',
field=models.IntegerField(null=True, unique=True),
),
]
|
NLeSC/Platinum
|
ptk-vbrowser-ui/src/main/java/nl/esciencecenter/ptk/vbrowser/ui/dnd/ViewNodeContainerDragListener.java
|
<reponame>NLeSC/Platinum
/*
* Copyright 2012-2014 Netherlands eScience Center.
*
* 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 the following location:
*
* 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.
*
* For the full license, see: LICENSE.txt (located in the root folder of this distribution).
* ---
*/
// source:
package nl.esciencecenter.ptk.vbrowser.ui.dnd;
import java.awt.Cursor;
import java.awt.dnd.DnDConstants;
import java.awt.dnd.DragGestureEvent;
import java.awt.dnd.DragGestureListener;
import java.awt.dnd.DragSource;
import java.awt.event.InputEvent;
import javax.swing.JComponent;
import javax.swing.TransferHandler;
import nl.esciencecenter.ptk.vbrowser.ui.model.ViewNodeComponent;
import nl.esciencecenter.ptk.vbrowser.ui.model.ViewNodeContainer;
import nl.esciencecenter.vbrowser.vrs.vrl.VRL;
/**
* Drag Gesture listener for ViewNodeComponents. Drag Recognized event comes from the Global Drag
* Gesture Recognizer.
*
* This Drag listener checks and selects the actual selected ViewNode inside a ViewNodeContainer.
*
* @author <NAME>
*/
public class ViewNodeContainerDragListener implements DragGestureListener {
public ViewNodeContainerDragListener() {
// no parent needed as this is installed on ViewNodeComponent only.
// source Component of DragGestureEvent (getComponent) MUST be of this
// type.
}
public void dragGestureRecognized(DragGestureEvent dge) {
// DnDUtil.errorPrintf("dragGestureRecognized:%s\n", dge);
// DnD Stuff:
int action = dge.getDragAction();
// Use DragSource ?
InputEvent trigger = dge.getTriggerEvent();
// non swing not supported
JComponent comp = (JComponent) dge.getComponent();
// Global.debugPrintln(this, "source comp="+comp);
boolean multi = ((dge.getTriggerEvent().getModifiersEx() & InputEvent.CTRL_DOWN_MASK) != 0);
if ((comp instanceof ViewNodeComponent) == false) {
DnDUtil.errorPrintf(this.getClass() + ":Actual component is not a ViewNode:%s\n", comp);
return;
}
//
{
ViewNodeComponent node = (ViewNodeComponent) comp;
// node could be the parent itself!
ViewNodeContainer parent = node.getViewContainer();
DnDUtil.debugPrintf("Drag from ViewNode!:%s\n", node.getViewNode().getVRL());
// Redirect Drag Selection to Parent to enable multi-select.
if (parent != null) {
if (multi == true)
// When starting a multi selected drage: Include CURRENT
// Selection.
parent.setNodeSelection(node.getViewNode(), true);
else {
// Unselect ALL if a drag is started WIHTOUT the CTRL
// modifier
parent.clearNodeSelection();
// update to single selection:
parent.setNodeSelection(node.getViewNode(), true);
}
} else {
// single ViewNode component:
}
}
VRL vri = ((ViewNodeComponent) comp).getViewNode().getVRL();
DnDUtil.debugPrintf("Drag Vri:%s\n", vri);
// Swing way to initiate a Drag:
TransferHandler trans = comp.getTransferHandler();
if (trans != null) {
trans.exportAsDrag(comp, trigger, DnDConstants.ACTION_COPY);
} else {
DnDUtil.errorPrintf("***Fatal: NULL TransferHandler for:%s\n" + comp);
}
}
private Cursor selectCursor(int action) {
return (action == DnDConstants.ACTION_MOVE) ? DragSource.DefaultMoveDrop
: DragSource.DefaultCopyDrop;
}
}
|
omarathon/tabula
|
common/src/main/scala/uk/ac/warwick/tabula/data/model/Mark.scala
|
package uk.ac.warwick.tabula.data.model
import java.sql.Types
import javax.persistence._
import javax.validation.constraints.NotNull
import org.hibernate.annotations.{Proxy, Type}
import org.joda.time.DateTime
@Entity
@Proxy
@Access(AccessType.FIELD)
class Mark extends GeneratedId {
@OneToOne(fetch = FetchType.LAZY, optional = false, cascade = Array())
@JoinColumn(name = "feedback_id", nullable = false)
@ForeignKey(name = "none")
var feedback: Feedback = _
@NotNull
var uploaderId: String = _
@NotNull
var uploadedDate: DateTime = _
@Column(name = "marktype")
@Type(`type` = "uk.ac.warwick.tabula.data.model.MarkTypeUserType")
var markType: MarkType = _
@NotNull
var mark: Int = _
@Type(`type` = "uk.ac.warwick.tabula.data.model.OptionStringUserType")
var grade: Option[String] = None
@NotNull
var reason: String = _
var comments: String = _
}
sealed abstract class MarkType(val code: String, val description: String) {
// for Spring
def getCode: String = code
def getDescription: String = description
override def toString: String = description
}
object MarkType {
case object Adjustment extends MarkType("adjustment", "Adjustment")
case object PrivateAdjustment extends MarkType("private", "Private Adjustment")
// manual collection - keep in sync with the case objects above
val members = Seq(Adjustment, PrivateAdjustment)
def fromCode(code: String): MarkType =
if (code == null) null
else members.find(_.code == code) match {
case Some(caseObject) => caseObject
case None => throw new IllegalArgumentException()
}
def fromDescription(description: String): MarkType =
if (description == null) null
else members.find(_.description == description) match {
case Some(caseObject) => caseObject
case None => throw new IllegalArgumentException()
}
}
class MarkTypeUserType extends AbstractStringUserType[MarkType] {
override def sqlTypes: Array[Int] = Array(Types.VARCHAR)
override def convertToObject(string: String): MarkType = MarkType.fromCode(string)
override def convertToValue(format: MarkType): String = format.code
}
|
shabbyrobe/golib
|
iotools/readeratfwdbuf_test.go
|
package iotools
import (
"bytes"
"io"
"testing"
)
type readCountingReaderAt struct {
inner io.ReaderAt
reads int
}
func (r *readCountingReaderAt) ReadAt(p []byte, off int64) (n int, err error) {
r.reads++
return r.inner.ReadAt(p, off)
}
func readAll(inner io.ReaderAt, scratch []byte) ([]byte, error) {
var pos int64
var out []byte
for {
n, err := inner.ReadAt(scratch, pos)
out = append(out, scratch[:n]...)
if err == io.EOF {
if n == 0 {
return out, nil
}
} else if err != nil {
return out, err
}
pos += int64(n)
}
}
func TestReaderAtFwd(t *testing.T) {
src := []byte{1, 2, 3, 4, 5, 6, 7, 8}
inner := &readCountingReaderAt{inner: bytes.NewReader(src)}
rdrScratchSize := 3
readAllScratchSize := 3
expectedReads := 4 // 3 data reads and an EOF
rdrScratch := make([]byte, rdrScratchSize)
rdr := NewReaderAtFwdBuffer(inner, rdrScratch)
readAllScratch := make([]byte, readAllScratchSize)
b, err := readAll(rdr, readAllScratch)
if err != nil {
t.Fatal(err)
}
if !bytes.Equal(b, src) {
t.Fatal(b, "!=", src)
}
if inner.reads != expectedReads {
t.Fatal("reads", inner.reads, "!=", expectedReads)
}
}
|
aaarsene/o3de
|
Code/Legacy/CryCommon/CryAssert_Mac.h
|
<filename>Code/Legacy/CryCommon/CryAssert_Mac.h
/*
* Copyright (c) Contributors to the Open 3D Engine Project. For complete copyright and license terms please see the LICENSE at the root of this distribution.
*
* SPDX-License-Identifier: Apache-2.0 OR MIT
*
*/
// Description : Assert dialog box for Mac OS X
#ifndef CRYINCLUDE_CRYCOMMON_CRYASSERT_MAC_H
#define CRYINCLUDE_CRYCOMMON_CRYASSERT_MAC_H
#pragma once
#if defined(USE_CRY_ASSERT) && defined(MAC)
#include <AzCore/NativeUI/NativeUIRequests.h>
static char gs_szMessage[MAX_PATH];
void CryAssertTrace(const char* szFormat, ...)
{
if (gEnv == 0)
{
return;
}
if (!gEnv->bIgnoreAllAsserts)
{
if (szFormat == NULL)
{
gs_szMessage[0] = '\0';
}
else
{
va_list args;
va_start(args, szFormat);
vsnprintf(gs_szMessage, sizeof(gs_szMessage), szFormat, args);
va_end(args);
}
}
}
bool CryAssert(const char* szCondition, const char* szFile, unsigned int line, bool* pIgnore)
{
if (!gEnv)
{
return false;
}
#if defined(CRY_ASSERT_DIALOG_ONLY_IN_DEBUG) && !defined(AZ_DEBUG_BUILD)
// we are in a non-debug build, so we should turn this into a warning instead.
if ((gEnv) && (gEnv->pLog))
{
if (!gEnv->bIgnoreAllAsserts)
{
gEnv->pLog->LogWarning("%s(%u): Assertion failed - \"%s\"", szFile, line, szCondition);
}
}
if (pIgnore)
{
// avoid showing the same one repeatedly.
*pIgnore = true;
}
return false;
#endif
static const int max_len = 4096;
static char gs_command_str[4096];
static CryLockT<CRYLOCK_RECURSIVE> lock;
gEnv->pSystem->OnAssert(szCondition, gs_szMessage, szFile, line);
size_t file_len = strlen(szFile);
if (!gEnv->bNoAssertDialog && !gEnv->bIgnoreAllAsserts)
{
AZ::NativeUI::AssertAction result;
EBUS_EVENT_RESULT(result, AZ::NativeUI::NativeUIRequestBus, DisplayAssertDialog, gs_szMessage);
switch(result)
{
case AZ::NativeUI::AssertAction::IGNORE_ASSERT:
return false;
case AZ::NativeUI::AssertAction::IGNORE_ALL_ASSERTS:
gEnv->bNoAssertDialog = true;
gEnv->bIgnoreAllAsserts = true;
return false;
case AZ::NativeUI::AssertAction::BREAK:
return true;
default:
break;
}
// For asserts on the Mac always trigger a debug break. Annoying but at least it does not kill the thread like assert() does.
__asm__("int $3");
}
return false;
}
#endif
#endif // CRYINCLUDE_CRYCOMMON_CRYASSERT_MAC_H
|
IKholopov/checkers-rl
|
CheckersUI/Checkers/Checkers/Utils.h
|
// Автор: <NAME>.
#pragma once
#include <Board.h>
#include <GameState.h>
std::shared_ptr<GameState> BoardToGameState( const CBoard&, bool american, Team team );
CBoard GameStateToBoard( const GameState& );
|
HewlettPackard/SimpliVity-Citrix-VCenter-Plugin
|
HTML5/dev/simplivity-citrixplugin-service/src/main/java/com/vmware/vim25/ArrayOfUserProfile.java
|
<reponame>HewlettPackard/SimpliVity-Citrix-VCenter-Plugin<filename>HTML5/dev/simplivity-citrixplugin-service/src/main/java/com/vmware/vim25/ArrayOfUserProfile.java<gh_stars>0
//
// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.6
// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
// Any modifications to this file will be lost upon recompilation of the source schema.
// Generated on: 2019.06.12 at 09:16:35 AM EDT
//
package com.vmware.vim25;
/**
*
*/
@SuppressWarnings("all")
public class ArrayOfUserProfile {
private final static com.vmware.vim25.UserProfile[] NULL_USER_PROFILE_ARRAY = new com.vmware.vim25.UserProfile[ 0 ] ;
public com.vmware.vim25.UserProfile[] UserProfile;
public com.vmware.vim25.UserProfile[] getUserProfile() {
if ((UserProfile) == null) {
return (NULL_USER_PROFILE_ARRAY);
}
return UserProfile;
}
public void setUserProfile(com.vmware.vim25.UserProfile[] UserProfile) {
this.UserProfile = UserProfile;
}
}
|
utgw/programming-contest
|
aoj/1186.cpp
|
#include <cstdio>
#define REP(i,n) for(int i=0;i<n;i++)
int main(void) {
const int inf = 889464;
while(1){
int x,y,h,w;
scanf("%d%d\n",&h,&w);
if(h==0&&w==0)break;
int dia=h*h+w*w;
int diam=inf;
REP(i,150){
for(int j=1;j<i;j++){
int a=i*i+j*j;
if((dia<a||(dia==a&&j>h))&&a<=diam){
y=j;
x=i;
diam=a;
}
}
}
printf("%d %d\n",y,x);
}
return 0;
}
|
cpreh/spacegameengine
|
libs/imagecolor/include/sge/image/color/any/print.hpp
|
<gh_stars>1-10
// Copyright <NAME> 2006 - 2019.
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
#ifndef SGE_IMAGE_COLOR_ANY_PRINT_HPP_INCLUDED
#define SGE_IMAGE_COLOR_ANY_PRINT_HPP_INCLUDED
#include <sge/image/color/tag.hpp>
#include <sge/image/pixel/declare_object_output.hpp>
SGE_IMAGE_PIXEL_DECLARE_OBJECT_OUTPUT(sge::image::color::tag);
#endif
|
HereSinceres/atlaskit-mk-2
|
packages/core/analytics/src/__tests__/unit/AnalyticsListener.test.js
|
// @flow
/* eslint-disable react/no-multi-comp */
/* eslint-disable react/prop-types */
import React, { Component } from 'react';
import { shallow, mount } from 'enzyme';
import { AnalyticsListener, cleanProps, withAnalytics } from '../..';
const Button = withAnalytics(
class B extends Component<{
fireAnalyticsEvent: (eventName: string) => {},
firePrivateAnalyticsEvent: (eventName: string, eventData?: Object) => {},
}> {
onClick = () => {
this.props.fireAnalyticsEvent('click');
this.props.firePrivateAnalyticsEvent('private.button.click', {
one: 1,
});
};
render() {
const props = cleanProps(this.props);
return <button {...props} onClick={this.onClick} />;
}
},
);
describe('AnalyticsListener', () => {
it('should create a listener component', () => {
const component = shallow(
<AnalyticsListener onEvent={() => {}}>
<div />
</AnalyticsListener>,
);
expect(component).not.toBe(undefined);
});
it('should send public event', () => {
const spy = jest.fn();
const listener = mount(
<AnalyticsListener onEvent={spy}>
<Button analyticsId="button" analyticsData={{ one: 1 }} />
</AnalyticsListener>,
);
listener.find(Button).simulate('click');
expect(spy).toHaveBeenCalledTimes(1);
expect(spy).toHaveBeenCalledWith('button.click', { one: 1 });
});
it('should be nestable with other AnalyticsListeners', () => {
const spy1 = jest.fn();
const spy2 = jest.fn();
const listener = mount(
<AnalyticsListener onEvent={spy2}>
<AnalyticsListener onEvent={spy1}>
<Button analyticsId="button" analyticsData={{ one: 1 }} />
</AnalyticsListener>
</AnalyticsListener>,
);
listener.find(Button).simulate('click');
expect(spy1).toHaveBeenCalledTimes(1);
expect(spy1).toHaveBeenCalledWith('button.click', { one: 1 });
expect(spy2).toHaveBeenCalledTimes(1);
expect(spy2).toHaveBeenCalledWith('button.click', { one: 1 });
});
it('should send private event when matchPrivate is true', () => {
const spy = jest.fn();
const listener = mount(
<AnalyticsListener onEvent={spy} matchPrivate>
<Button analyticsId="button" analyticsData={{ one: 1 }} />
</AnalyticsListener>,
);
listener.find(Button).simulate('click');
expect(spy).toHaveBeenCalledTimes(1);
expect(spy).toHaveBeenCalledWith('private.button.click', { one: 1 });
});
it('should send private and public events when nested', () => {
const privateSpy = jest.fn();
const publicSpy = jest.fn();
const listener = mount(
<AnalyticsListener onEvent={privateSpy} matchPrivate>
<AnalyticsListener onEvent={publicSpy}>
<Button analyticsId="button" analyticsData={{ one: 1 }} />
</AnalyticsListener>
</AnalyticsListener>,
);
listener.find(Button).simulate('click');
expect(privateSpy).toHaveBeenCalledTimes(1);
expect(privateSpy).toHaveBeenCalledWith('private.button.click', { one: 1 });
expect(publicSpy).toHaveBeenCalledTimes(1);
expect(publicSpy).toHaveBeenCalledWith('button.click', { one: 1 });
});
it('should send event when partial string match is true', () => {
const spy = jest.fn();
const listener = mount(
<AnalyticsListener onEvent={spy} match="button.">
<Button analyticsId="button" analyticsData={{ one: 1 }} />
</AnalyticsListener>,
);
listener.find(Button).simulate('click');
expect(spy).toHaveBeenCalledTimes(1);
expect(spy).toHaveBeenCalledWith('button.click', { one: 1 });
});
it('should send event when full string match is true', () => {
const spy = jest.fn();
const listener = mount(
<AnalyticsListener onEvent={spy} match="button.click">
<Button analyticsId="button" analyticsData={{ one: 1 }} />
</AnalyticsListener>,
);
listener.find(Button).simulate('click');
expect(spy).toHaveBeenCalledTimes(1);
expect(spy).toHaveBeenCalledWith('button.click', { one: 1 });
});
it('should not send event when string match is false', () => {
const spy = jest.fn();
const listener = mount(
<AnalyticsListener onEvent={spy} match="no">
<Button analyticsId="button" analyticsData={{ one: 1 }} />
</AnalyticsListener>,
);
listener.find(Button).simulate('click');
expect(spy).toHaveBeenCalledTimes(0);
});
it('should send event when regex match is true', () => {
const spy = jest.fn();
const listener = mount(
<AnalyticsListener onEvent={spy} match={/^bu.*$/}>
<Button analyticsId="button" analyticsData={{ one: 1 }} />
</AnalyticsListener>,
);
listener.find(Button).simulate('click');
expect(spy).toHaveBeenCalledTimes(1);
expect(spy).toHaveBeenCalledWith('button.click', { one: 1 });
});
it('should not send event when regex match is false', () => {
const spy = jest.fn();
const listener = mount(
<AnalyticsListener onEvent={spy} match={/^no.*$/}>
<Button analyticsId="button" analyticsData={{ one: 1 }} />
</AnalyticsListener>,
);
listener.find(Button).simulate('click');
expect(spy).toHaveBeenCalledTimes(0);
});
it('should send event when function match is true', () => {
const spy = jest.fn();
const listener = mount(
<AnalyticsListener onEvent={spy} match={() => true}>
<Button analyticsId="button" analyticsData={{ one: 1 }} />
</AnalyticsListener>,
);
listener.find(Button).simulate('click');
expect(spy).toHaveBeenCalledTimes(1);
expect(spy).toHaveBeenCalledWith('button.click', { one: 1 });
});
it('should not send event when function match is false', () => {
const spy = jest.fn();
const listener = mount(
<AnalyticsListener onEvent={spy} match={() => false}>
<Button analyticsId="button" analyticsData={{ one: 1 }} />
</AnalyticsListener>,
);
listener.find(Button).simulate('click');
expect(spy).toHaveBeenCalledTimes(0);
});
});
|
takashifujii/annict
|
spec/requests/api/v1/organizations_spec.rb
|
<gh_stars>0
# frozen_string_literal: true
describe "Api::V1::Organizations" do
let(:access_token) { create(:oauth_access_token) }
let!(:organization) { create(:organization) }
describe "GET /v1/organizations" do
before do
get api("/v1/organizations", access_token: access_token.token)
end
context "when added no parameters" do
it "responses 200" do
expect(response.status).to eq(200)
end
it "gets organization info" do
expected_hash = {
"id" => organization.id,
"name" => organization.name,
"name_kana" => organization.name_kana,
"name_en" => organization.name_en,
"url" => organization.url,
"url_en" => organization.url_en,
"wikipedia_url" => organization.wikipedia_url,
"wikipedia_url_en" => organization.wikipedia_url_en,
"twitter_username" => organization.twitter_username,
"twitter_username_en" => organization.twitter_username_en,
"favorite_organizations_count" => organization.favorite_organizations_count,
"staffs_count" => organization.staffs_count
}
expect(json["organizations"][0]).to include(expected_hash)
expect(json["total_count"]).to eq(1)
expect(json["next_page"]).to eq(nil)
expect(json["prev_page"]).to eq(nil)
end
end
end
end
|
Sajaki/intellij-community
|
platform/analysis-impl/src/com/intellij/codeInsight/dataflow/SetUtil.java
|
package com.intellij.codeInsight.dataflow;
import java.util.HashSet;
import java.util.Set;
/**
* @author: oleg
*/
public class SetUtil {
private SetUtil() {
}
/**
* Intersects two sets
*/
public static <T> Set<T> intersect(final Set<? extends T> set1, final Set<? extends T> set2) {
if (set1.equals(set2)){
return (Set<T>)set1;
}
Set<T> result = new HashSet<>();
Set<? extends T> minSet;
Set<? extends T> otherSet;
if (set1.size() < set2.size()){
minSet = set1;
otherSet = set2;
} else {
minSet = set2;
otherSet = set1;
}
for (T s : minSet) {
if (otherSet.contains(s)){
result.add(s);
}
}
return result;
}
}
|
assembla/fluent-bit
|
lib/chunkio/deps/crc32/crc32.c
|
<gh_stars>1-10
/**
* \file
* Functions and types for CRC checks.
*
* Generated on Tue Oct 30 22:09:40 2018
* by pycrc v0.9.1, https://pycrc.org
* using the configuration:
* - Width = 32
* - Poly = 0x04c11db7
* - XorIn = 0xffffffff
* - ReflectIn = True
* - XorOut = 0xffffffff
* - ReflectOut = True
* - Algorithm = table-driven
* - SliceBy = 8
*/
#include "crc32.h" /* include the header file generated with pycrc */
#include <stdlib.h>
#include <stdint.h>
#ifdef __APPLE__
# include <machine/endian.h>
# include <libkern/OSByteOrder.h>
# define htobe16(x) OSSwapHostToBigInt16(x)
# define htole16(x) OSSwapHostToLittleInt16(x)
# define be16toh(x) OSSwapBigToHostInt16(x)
# define le16toh(x) OSSwapLittleToHostInt16(x)
#elif defined(_WIN32)
# define htobe16(x) htons(x)
# define htole16(x) (x)
# define be16toh(x) ntohs(x)
# define le16toh(x) (x)
#elif defined(__FreeBSD__)
# include <sys/endian.h>
#else
# include <endian.h>
#endif
/**
* Static table used for the table_driven implementation.
*/
static const crc_t crc_table[8][256] = {
{
0x00000000, 0x77073096, 0xee0e612c, 0x990951ba, 0x076dc419, 0x706af48f, 0xe963a535, 0x9e6495a3,
0x0edb8832, 0x79dcb8a4, 0xe0d5e91e, 0x97d2d988, 0x09b64c2b, 0x7eb17cbd, 0xe7b82d07, 0x90bf1d91,
0x1db71064, 0x6ab020f2, 0xf3b97148, 0x84be41de, 0x1adad47d, 0x6ddde4eb, 0xf4d4b551, 0x83d385c7,
0x136c9856, 0x646ba8c0, 0xfd62f97a, 0x8a65c9ec, 0x14015c4f, 0x63066cd9, 0xfa0f3d63, 0x8d080df5,
0x3b6e20c8, 0x4c69105e, 0xd56041e4, 0xa2677172, 0x3c03e4d1, 0x4b04d447, 0xd20d85fd, 0xa50ab56b,
0x35b5a8fa, 0x42b2986c, 0xdbbbc9d6, 0xacbcf940, 0x32d86ce3, 0x45df5c75, 0xdcd60dcf, 0xabd13d59,
0x26d930ac, 0x51de003a, 0xc8d75180, 0xbfd06116, 0x21b4f4b5, 0x56b3c423, 0xcfba9599, 0xb8bda50f,
0x2802b89e, 0x5f058808, 0xc60cd9b2, 0xb10be924, 0x2f6f7c87, 0x58684c11, 0xc1611dab, 0xb6662d3d,
0x76dc4190, 0x01db7106, 0x98d220bc, 0xefd5102a, 0x71b18589, 0x06b6b51f, 0x9fbfe4a5, 0xe8b8d433,
0x7807c9a2, 0x0f00f934, 0x9609a88e, 0xe10e9818, 0x7f6a0dbb, 0x086d3d2d, 0x91646c97, 0xe6635c01,
0x6b6b51f4, 0x1c6c6162, 0x856530d8, 0xf262004e, 0x6c0695ed, 0x1b01a57b, 0x8208f4c1, 0xf50fc457,
0x65b0d9c6, 0x12b7e950, 0x8bbeb8ea, 0xfcb9887c, 0x62dd1ddf, 0x15da2d49, 0x8cd37cf3, 0xfbd44c65,
0x4db26158, 0x3ab551ce, 0xa3bc0074, 0xd4bb30e2, 0x4adfa541, 0x3dd895d7, 0xa4d1c46d, 0xd3d6f4fb,
0x4369e96a, 0x346ed9fc, 0xad678846, 0xda60b8d0, 0x44042d73, 0x33031de5, 0xaa0a4c5f, 0xdd0d7cc9,
0x5005713c, 0x270241aa, 0xbe0b1010, 0xc90c2086, 0x5768b525, 0x206f85b3, 0xb966d409, 0xce61e49f,
0x5edef90e, 0x29d9c998, 0xb0d09822, 0xc7d7a8b4, 0x59b33d17, 0x2eb40d81, 0xb7bd5c3b, 0xc0ba6cad,
0xedb88320, 0x9abfb3b6, 0x03b6e20c, 0x74b1d29a, 0xead54739, 0x9dd277af, 0x04db2615, 0x73dc1683,
0xe3630b12, 0x94643b84, 0x0d6d6a3e, 0x7a6a5aa8, 0xe40ecf0b, 0x9309ff9d, 0x0a00ae27, 0x7d079eb1,
0xf00f9344, 0x8708a3d2, 0x1e01f268, 0x6906c2fe, 0xf762575d, 0x806567cb, 0x196c3671, 0x6e6b06e7,
0xfed41b76, 0x89d32be0, 0x10da7a5a, 0x67dd4acc, 0xf9b9df6f, 0x8ebeeff9, 0x17b7be43, 0x60b08ed5,
0xd6d6a3e8, 0xa1d1937e, 0x38d8c2c4, 0x4fdff252, 0xd1bb67f1, 0xa6bc5767, 0x3fb506dd, 0x48b2364b,
0xd80d2bda, 0xaf0a1b4c, 0x36034af6, 0x41047a60, 0xdf60efc3, 0xa867df55, 0x316e8eef, 0x4669be79,
0xcb61b38c, 0xbc66831a, 0x256fd2a0, 0x5268e236, 0xcc0c7795, 0xbb0b4703, 0x220216b9, 0x5505262f,
0xc5ba3bbe, 0xb2bd0b28, 0x2bb45a92, 0x5cb36a04, 0xc2d7ffa7, 0xb5d0cf31, 0x2cd99e8b, 0x5bdeae1d,
0x9b64c2b0, 0xec63f226, 0x756aa39c, 0x026d930a, 0x9c0906a9, 0xeb0e363f, 0x72076785, 0x05005713,
0x95bf4a82, 0xe2b87a14, 0x7bb12bae, 0x0cb61b38, 0x92d28e9b, 0xe5d5be0d, 0x7cdcefb7, 0x0bdbdf21,
0x86d3d2d4, 0xf1d4e242, 0x68ddb3f8, 0x1fda836e, 0x81be16cd, 0xf6b9265b, 0x6fb077e1, 0x18b74777,
0x88085ae6, 0xff0f6a70, 0x66063bca, 0x11010b5c, 0x8f659eff, 0xf862ae69, 0x616bffd3, 0x166ccf45,
0xa00ae278, 0xd70dd2ee, 0x4e048354, 0x3903b3c2, 0xa7672661, 0xd06016f7, 0x4969474d, 0x3e6e77db,
0xaed16a4a, 0xd9d65adc, 0x40df0b66, 0x37d83bf0, 0xa9bcae53, 0xdebb9ec5, 0x47b2cf7f, 0x30b5ffe9,
0xbdbdf21c, 0xcabac28a, 0x53b39330, 0x24b4a3a6, 0xbad03605, 0xcdd70693, 0x54de5729, 0x23d967bf,
0xb3667a2e, 0xc4614ab8, 0x5d681b02, 0x2a6f2b94, 0xb40bbe37, 0xc30c8ea1, 0x5a05df1b, 0x2d02ef8d
},
{
0x00000000, 0x191b3141, 0x32366282, 0x2b2d53c3, 0x646cc504, 0x7d77f445, 0x565aa786, 0x4f4196c7,
0xc8d98a08, 0xd1c2bb49, 0xfaefe88a, 0xe3f4d9cb, 0xacb54f0c, 0xb5ae7e4d, 0x9e832d8e, 0x87981ccf,
0x4ac21251, 0x53d92310, 0x78f470d3, 0x61ef4192, 0x2eaed755, 0x37b5e614, 0x1c98b5d7, 0x05838496,
0x821b9859, 0x9b00a918, 0xb02dfadb, 0xa936cb9a, 0xe6775d5d, 0xff6c6c1c, 0xd4413fdf, 0xcd5a0e9e,
0x958424a2, 0x8c9f15e3, 0xa7b24620, 0xbea97761, 0xf1e8e1a6, 0xe8f3d0e7, 0xc3de8324, 0xdac5b265,
0x5d5daeaa, 0x44469feb, 0x6f6bcc28, 0x7670fd69, 0x39316bae, 0x202a5aef, 0x0b07092c, 0x121c386d,
0xdf4636f3, 0xc65d07b2, 0xed705471, 0xf46b6530, 0xbb2af3f7, 0xa231c2b6, 0x891c9175, 0x9007a034,
0x179fbcfb, 0x0e848dba, 0x25a9de79, 0x3cb2ef38, 0x73f379ff, 0x6ae848be, 0x41c51b7d, 0x58de2a3c,
0xf0794f05, 0xe9627e44, 0xc24f2d87, 0xdb541cc6, 0x94158a01, 0x8d0ebb40, 0xa623e883, 0xbf38d9c2,
0x38a0c50d, 0x21bbf44c, 0x0a96a78f, 0x138d96ce, 0x5ccc0009, 0x45d73148, 0x6efa628b, 0x77e153ca,
0xbabb5d54, 0xa3a06c15, 0x888d3fd6, 0x91960e97, 0xded79850, 0xc7cca911, 0xece1fad2, 0xf5facb93,
0x7262d75c, 0x6b79e61d, 0x4054b5de, 0x594f849f, 0x160e1258, 0x0f152319, 0x243870da, 0x3d23419b,
0x65fd6ba7, 0x7ce65ae6, 0x57cb0925, 0x4ed03864, 0x0191aea3, 0x188a9fe2, 0x33a7cc21, 0x2abcfd60,
0xad24e1af, 0xb43fd0ee, 0x9f12832d, 0x8609b26c, 0xc94824ab, 0xd05315ea, 0xfb7e4629, 0xe2657768,
0x2f3f79f6, 0x362448b7, 0x1d091b74, 0x04122a35, 0x4b53bcf2, 0x52488db3, 0x7965de70, 0x607eef31,
0xe7e6f3fe, 0xfefdc2bf, 0xd5d0917c, 0xcccba03d, 0x838a36fa, 0x9a9107bb, 0xb1bc5478, 0xa8a76539,
0x3b83984b, 0x2298a90a, 0x09b5fac9, 0x10aecb88, 0x5fef5d4f, 0x46f46c0e, 0x6dd93fcd, 0x74c20e8c,
0xf35a1243, 0xea412302, 0xc16c70c1, 0xd8774180, 0x9736d747, 0x8e2de606, 0xa500b5c5, 0xbc1b8484,
0x71418a1a, 0x685abb5b, 0x4377e898, 0x5a6cd9d9, 0x152d4f1e, 0x0c367e5f, 0x271b2d9c, 0x3e001cdd,
0xb9980012, 0xa0833153, 0x8bae6290, 0x92b553d1, 0xddf4c516, 0xc4eff457, 0xefc2a794, 0xf6d996d5,
0xae07bce9, 0xb71c8da8, 0x9c31de6b, 0x852aef2a, 0xca6b79ed, 0xd37048ac, 0xf85d1b6f, 0xe1462a2e,
0x66de36e1, 0x7fc507a0, 0x54e85463, 0x4df36522, 0x02b2f3e5, 0x1ba9c2a4, 0x30849167, 0x299fa026,
0xe4c5aeb8, 0xfdde9ff9, 0xd6f3cc3a, 0xcfe8fd7b, 0x80a96bbc, 0x99b25afd, 0xb29f093e, 0xab84387f,
0x2c1c24b0, 0x350715f1, 0x1e2a4632, 0x07317773, 0x4870e1b4, 0x516bd0f5, 0x7a468336, 0x635db277,
0xcbfad74e, 0xd2e1e60f, 0xf9ccb5cc, 0xe0d7848d, 0xaf96124a, 0xb68d230b, 0x9da070c8, 0x84bb4189,
0x03235d46, 0x1a386c07, 0x31153fc4, 0x280e0e85, 0x674f9842, 0x7e54a903, 0x5579fac0, 0x4c62cb81,
0x8138c51f, 0x9823f45e, 0xb30ea79d, 0xaa1596dc, 0xe554001b, 0xfc4f315a, 0xd7626299, 0xce7953d8,
0x49e14f17, 0x50fa7e56, 0x7bd72d95, 0x62cc1cd4, 0x2d8d8a13, 0x3496bb52, 0x1fbbe891, 0x06a0d9d0,
0x5e7ef3ec, 0x4765c2ad, 0x6c48916e, 0x7553a02f, 0x3a1236e8, 0x230907a9, 0x0824546a, 0x113f652b,
0x96a779e4, 0x8fbc48a5, 0xa4911b66, 0xbd8a2a27, 0xf2cbbce0, 0xebd08da1, 0xc0fdde62, 0xd9e6ef23,
0x14bce1bd, 0x0da7d0fc, 0x268a833f, 0x3f91b27e, 0x70d024b9, 0x69cb15f8, 0x42e6463b, 0x5bfd777a,
0xdc656bb5, 0xc57e5af4, 0xee530937, 0xf7483876, 0xb809aeb1, 0xa1129ff0, 0x8a3fcc33, 0x9324fd72
},
{
0x00000000, 0x01c26a37, 0x0384d46e, 0x0246be59, 0x0709a8dc, 0x06cbc2eb, 0x048d7cb2, 0x054f1685,
0x0e1351b8, 0x0fd13b8f, 0x0d9785d6, 0x0c55efe1, 0x091af964, 0x08d89353, 0x0a9e2d0a, 0x0b5c473d,
0x1c26a370, 0x1de4c947, 0x1fa2771e, 0x1e601d29, 0x1b2f0bac, 0x1aed619b, 0x18abdfc2, 0x1969b5f5,
0x1235f2c8, 0x13f798ff, 0x11b126a6, 0x10734c91, 0x153c5a14, 0x14fe3023, 0x16b88e7a, 0x177ae44d,
0x384d46e0, 0x398f2cd7, 0x3bc9928e, 0x3a0bf8b9, 0x3f44ee3c, 0x3e86840b, 0x3cc03a52, 0x3d025065,
0x365e1758, 0x379c7d6f, 0x35dac336, 0x3418a901, 0x3157bf84, 0x3095d5b3, 0x32d36bea, 0x331101dd,
0x246be590, 0x25a98fa7, 0x27ef31fe, 0x262d5bc9, 0x23624d4c, 0x22a0277b, 0x20e69922, 0x2124f315,
0x2a78b428, 0x2bbade1f, 0x29fc6046, 0x283e0a71, 0x2d711cf4, 0x2cb376c3, 0x2ef5c89a, 0x2f37a2ad,
0x709a8dc0, 0x7158e7f7, 0x731e59ae, 0x72dc3399, 0x7793251c, 0x76514f2b, 0x7417f172, 0x75d59b45,
0x7e89dc78, 0x7f4bb64f, 0x7d0d0816, 0x7ccf6221, 0x798074a4, 0x78421e93, 0x7a04a0ca, 0x7bc6cafd,
0x6cbc2eb0, 0x6d7e4487, 0x6f38fade, 0x6efa90e9, 0x6bb5866c, 0x6a77ec5b, 0x68315202, 0x69f33835,
0x62af7f08, 0x636d153f, 0x612bab66, 0x60e9c151, 0x65a6d7d4, 0x6464bde3, 0x662203ba, 0x67e0698d,
0x48d7cb20, 0x4915a117, 0x4b531f4e, 0x4a917579, 0x4fde63fc, 0x4e1c09cb, 0x4c5ab792, 0x4d98dda5,
0x46c49a98, 0x4706f0af, 0x45404ef6, 0x448224c1, 0x41cd3244, 0x400f5873, 0x4249e62a, 0x438b8c1d,
0x54f16850, 0x55330267, 0x5775bc3e, 0x56b7d609, 0x53f8c08c, 0x523aaabb, 0x507c14e2, 0x51be7ed5,
0x5ae239e8, 0x5b2053df, 0x5966ed86, 0x58a487b1, 0x5deb9134, 0x5c29fb03, 0x5e6f455a, 0x5fad2f6d,
0xe1351b80, 0xe0f771b7, 0xe2b1cfee, 0xe373a5d9, 0xe63cb35c, 0xe7fed96b, 0xe5b86732, 0xe47a0d05,
0xef264a38, 0xeee4200f, 0xeca29e56, 0xed60f461, 0xe82fe2e4, 0xe9ed88d3, 0xebab368a, 0xea695cbd,
0xfd13b8f0, 0xfcd1d2c7, 0xfe976c9e, 0xff5506a9, 0xfa1a102c, 0xfbd87a1b, 0xf99ec442, 0xf85cae75,
0xf300e948, 0xf2c2837f, 0xf0843d26, 0xf1465711, 0xf4094194, 0xf5cb2ba3, 0xf78d95fa, 0xf64fffcd,
0xd9785d60, 0xd8ba3757, 0xdafc890e, 0xdb3ee339, 0xde71f5bc, 0xdfb39f8b, 0xddf521d2, 0xdc374be5,
0xd76b0cd8, 0xd6a966ef, 0xd4efd8b6, 0xd52db281, 0xd062a404, 0xd1a0ce33, 0xd3e6706a, 0xd2241a5d,
0xc55efe10, 0xc49c9427, 0xc6da2a7e, 0xc7184049, 0xc25756cc, 0xc3953cfb, 0xc1d382a2, 0xc011e895,
0xcb4dafa8, 0xca8fc59f, 0xc8c97bc6, 0xc90b11f1, 0xcc440774, 0xcd866d43, 0xcfc0d31a, 0xce02b92d,
0x91af9640, 0x906dfc77, 0x922b422e, 0x93e92819, 0x96a63e9c, 0x976454ab, 0x9522eaf2, 0x94e080c5,
0x9fbcc7f8, 0x9e7eadcf, 0x9c381396, 0x9dfa79a1, 0x98b56f24, 0x99770513, 0x9b31bb4a, 0x9af3d17d,
0x8d893530, 0x8c4b5f07, 0x8e0de15e, 0x8fcf8b69, 0x8a809dec, 0x8b42f7db, 0x89044982, 0x88c623b5,
0x839a6488, 0x82580ebf, 0x801eb0e6, 0x81dcdad1, 0x8493cc54, 0x8551a663, 0x8717183a, 0x86d5720d,
0xa9e2d0a0, 0xa820ba97, 0xaa6604ce, 0xaba46ef9, 0xaeeb787c, 0xaf29124b, 0xad6fac12, 0xacadc625,
0xa7f18118, 0xa633eb2f, 0xa4755576, 0xa5b73f41, 0xa0f829c4, 0xa13a43f3, 0xa37cfdaa, 0xa2be979d,
0xb5c473d0, 0xb40619e7, 0xb640a7be, 0xb782cd89, 0xb2cddb0c, 0xb30fb13b, 0xb1490f62, 0xb08b6555,
0xbbd72268, 0xba15485f, 0xb853f606, 0xb9919c31, 0xbcde8ab4, 0xbd1ce083, 0xbf5a5eda, 0xbe9834ed
},
{
0x00000000, 0xb8bc6765, 0xaa09c88b, 0x12b5afee, 0x8f629757, 0x37def032, 0x256b5fdc, 0x9dd738b9,
0xc5b428ef, 0x7d084f8a, 0x6fbde064, 0xd7018701, 0x4ad6bfb8, 0xf26ad8dd, 0xe0df7733, 0x58631056,
0x5019579f, 0xe8a530fa, 0xfa109f14, 0x42acf871, 0xdf7bc0c8, 0x67c7a7ad, 0x75720843, 0xcdce6f26,
0x95ad7f70, 0x2d111815, 0x3fa4b7fb, 0x8718d09e, 0x1acfe827, 0xa2738f42, 0xb0c620ac, 0x087a47c9,
0xa032af3e, 0x188ec85b, 0x0a3b67b5, 0xb28700d0, 0x2f503869, 0x97ec5f0c, 0x8559f0e2, 0x3de59787,
0x658687d1, 0xdd3ae0b4, 0xcf8f4f5a, 0x7733283f, 0xeae41086, 0x525877e3, 0x40edd80d, 0xf851bf68,
0xf02bf8a1, 0x48979fc4, 0x5a22302a, 0xe29e574f, 0x7f496ff6, 0xc7f50893, 0xd540a77d, 0x6dfcc018,
0x359fd04e, 0x8d23b72b, 0x9f9618c5, 0x272a7fa0, 0xbafd4719, 0x0241207c, 0x10f48f92, 0xa848e8f7,
0x9b14583d, 0x23a83f58, 0x311d90b6, 0x89a1f7d3, 0x1476cf6a, 0xaccaa80f, 0xbe7f07e1, 0x06c36084,
0x5ea070d2, 0xe61c17b7, 0xf4a9b859, 0x4c15df3c, 0xd1c2e785, 0x697e80e0, 0x7bcb2f0e, 0xc377486b,
0xcb0d0fa2, 0x73b168c7, 0x6104c729, 0xd9b8a04c, 0x446f98f5, 0xfcd3ff90, 0xee66507e, 0x56da371b,
0x0eb9274d, 0xb6054028, 0xa4b0efc6, 0x1c0c88a3, 0x81dbb01a, 0x3967d77f, 0x2bd27891, 0x936e1ff4,
0x3b26f703, 0x839a9066, 0x912f3f88, 0x299358ed, 0xb4446054, 0x0cf80731, 0x1e4da8df, 0xa6f1cfba,
0xfe92dfec, 0x462eb889, 0x549b1767, 0xec277002, 0x71f048bb, 0xc94c2fde, 0xdbf98030, 0x6345e755,
0x6b3fa09c, 0xd383c7f9, 0xc1366817, 0x798a0f72, 0xe45d37cb, 0x5ce150ae, 0x4e54ff40, 0xf6e89825,
0xae8b8873, 0x1637ef16, 0x048240f8, 0xbc3e279d, 0x21e91f24, 0x99557841, 0x8be0d7af, 0x335cb0ca,
0xed59b63b, 0x55e5d15e, 0x47507eb0, 0xffec19d5, 0x623b216c, 0xda874609, 0xc832e9e7, 0x708e8e82,
0x28ed9ed4, 0x9051f9b1, 0x82e4565f, 0x3a58313a, 0xa78f0983, 0x1f336ee6, 0x0d86c108, 0xb53aa66d,
0xbd40e1a4, 0x05fc86c1, 0x1749292f, 0xaff54e4a, 0x322276f3, 0x8a9e1196, 0x982bbe78, 0x2097d91d,
0x78f4c94b, 0xc048ae2e, 0xd2fd01c0, 0x6a4166a5, 0xf7965e1c, 0x4f2a3979, 0x5d9f9697, 0xe523f1f2,
0x4d6b1905, 0xf5d77e60, 0xe762d18e, 0x5fdeb6eb, 0xc2098e52, 0x7ab5e937, 0x680046d9, 0xd0bc21bc,
0x88df31ea, 0x3063568f, 0x22d6f961, 0x9a6a9e04, 0x07bda6bd, 0xbf01c1d8, 0xadb46e36, 0x15080953,
0x1d724e9a, 0xa5ce29ff, 0xb77b8611, 0x0fc7e174, 0x9210d9cd, 0x2aacbea8, 0x38191146, 0x80a57623,
0xd8c66675, 0x607a0110, 0x72cfaefe, 0xca73c99b, 0x57a4f122, 0xef189647, 0xfdad39a9, 0x45115ecc,
0x764dee06, 0xcef18963, 0xdc44268d, 0x64f841e8, 0xf92f7951, 0x41931e34, 0x5326b1da, 0xeb9ad6bf,
0xb3f9c6e9, 0x0b45a18c, 0x19f00e62, 0xa14c6907, 0x3c9b51be, 0x842736db, 0x96929935, 0x2e2efe50,
0x2654b999, 0x9ee8defc, 0x8c5d7112, 0x34e11677, 0xa9362ece, 0x118a49ab, 0x033fe645, 0xbb838120,
0xe3e09176, 0x5b5cf613, 0x49e959fd, 0xf1553e98, 0x6c820621, 0xd43e6144, 0xc68bceaa, 0x7e37a9cf,
0xd67f4138, 0x6ec3265d, 0x7c7689b3, 0xc4caeed6, 0x591dd66f, 0xe1a1b10a, 0xf3141ee4, 0x4ba87981,
0x13cb69d7, 0xab770eb2, 0xb9c2a15c, 0x017ec639, 0x9ca9fe80, 0x241599e5, 0x36a0360b, 0x8e1c516e,
0x866616a7, 0x3eda71c2, 0x2c6fde2c, 0x94d3b949, 0x090481f0, 0xb1b8e695, 0xa30d497b, 0x1bb12e1e,
0x43d23e48, 0xfb6e592d, 0xe9dbf6c3, 0x516791a6, 0xccb0a91f, 0x740cce7a, 0x66b96194, 0xde0506f1
},
{
0x00000000, 0x3d6029b0, 0x7ac05360, 0x47a07ad0, 0xf580a6c0, 0xc8e08f70, 0x8f40f5a0, 0xb220dc10,
0x30704bc1, 0x0d106271, 0x4ab018a1, 0x77d03111, 0xc5f0ed01, 0xf890c4b1, 0xbf30be61, 0x825097d1,
0x60e09782, 0x5d80be32, 0x1a20c4e2, 0x2740ed52, 0x95603142, 0xa80018f2, 0xefa06222, 0xd2c04b92,
0x5090dc43, 0x6df0f5f3, 0x2a508f23, 0x1730a693, 0xa5107a83, 0x98705333, 0xdfd029e3, 0xe2b00053,
0xc1c12f04, 0xfca106b4, 0xbb017c64, 0x866155d4, 0x344189c4, 0x0921a074, 0x4e81daa4, 0x73e1f314,
0xf1b164c5, 0xccd14d75, 0x8b7137a5, 0xb6111e15, 0x0431c205, 0x3951ebb5, 0x7ef19165, 0x4391b8d5,
0xa121b886, 0x9c419136, 0xdbe1ebe6, 0xe681c256, 0x54a11e46, 0x69c137f6, 0x2e614d26, 0x13016496,
0x9151f347, 0xac31daf7, 0xeb91a027, 0xd6f18997, 0x64d15587, 0x59b17c37, 0x1e1106e7, 0x23712f57,
0x58f35849, 0x659371f9, 0x22330b29, 0x1f532299, 0xad73fe89, 0x9013d739, 0xd7b3ade9, 0xead38459,
0x68831388, 0x55e33a38, 0x124340e8, 0x2f236958, 0x9d03b548, 0xa0639cf8, 0xe7c3e628, 0xdaa3cf98,
0x3813cfcb, 0x0573e67b, 0x42d39cab, 0x7fb3b51b, 0xcd93690b, 0xf0f340bb, 0xb7533a6b, 0x8a3313db,
0x0863840a, 0x3503adba, 0x72a3d76a, 0x4fc3feda, 0xfde322ca, 0xc0830b7a, 0x872371aa, 0xba43581a,
0x9932774d, 0xa4525efd, 0xe3f2242d, 0xde920d9d, 0x6cb2d18d, 0x51d2f83d, 0x167282ed, 0x2b12ab5d,
0xa9423c8c, 0x9422153c, 0xd3826fec, 0xeee2465c, 0x5cc29a4c, 0x61a2b3fc, 0x2602c92c, 0x1b62e09c,
0xf9d2e0cf, 0xc4b2c97f, 0x8312b3af, 0xbe729a1f, 0x0c52460f, 0x31326fbf, 0x7692156f, 0x4bf23cdf,
0xc9a2ab0e, 0xf4c282be, 0xb362f86e, 0x8e02d1de, 0x3c220dce, 0x0142247e, 0x46e25eae, 0x7b82771e,
0xb1e6b092, 0x8c869922, 0xcb26e3f2, 0xf646ca42, 0x44661652, 0x79063fe2, 0x3ea64532, 0x03c66c82,
0x8196fb53, 0xbcf6d2e3, 0xfb56a833, 0xc6368183, 0x74165d93, 0x49767423, 0x0ed60ef3, 0x33b62743,
0xd1062710, 0xec660ea0, 0xabc67470, 0x96a65dc0, 0x248681d0, 0x19e6a860, 0x5e46d2b0, 0x6326fb00,
0xe1766cd1, 0xdc164561, 0x9bb63fb1, 0xa6d61601, 0x14f6ca11, 0x2996e3a1, 0x6e369971, 0x5356b0c1,
0x70279f96, 0x4d47b626, 0x0ae7ccf6, 0x3787e546, 0x85a73956, 0xb8c710e6, 0xff676a36, 0xc2074386,
0x4057d457, 0x7d37fde7, 0x3a978737, 0x07f7ae87, 0xb5d77297, 0x88b75b27, 0xcf1721f7, 0xf2770847,
0x10c70814, 0x2da721a4, 0x6a075b74, 0x576772c4, 0xe547aed4, 0xd8278764, 0x9f87fdb4, 0xa2e7d404,
0x20b743d5, 0x1dd76a65, 0x5a7710b5, 0x67173905, 0xd537e515, 0xe857cca5, 0xaff7b675, 0x92979fc5,
0xe915e8db, 0xd475c16b, 0x93d5bbbb, 0xaeb5920b, 0x1c954e1b, 0x21f567ab, 0x66551d7b, 0x5b3534cb,
0xd965a31a, 0xe4058aaa, 0xa3a5f07a, 0x9ec5d9ca, 0x2ce505da, 0x11852c6a, 0x562556ba, 0x6b457f0a,
0x89f57f59, 0xb49556e9, 0xf3352c39, 0xce550589, 0x7c75d999, 0x4115f029, 0x06b58af9, 0x3bd5a349,
0xb9853498, 0x84e51d28, 0xc34567f8, 0xfe254e48, 0x4c059258, 0x7165bbe8, 0x36c5c138, 0x0ba5e888,
0x28d4c7df, 0x15b4ee6f, 0x521494bf, 0x6f74bd0f, 0xdd54611f, 0xe03448af, 0xa794327f, 0x9af41bcf,
0x18a48c1e, 0x25c4a5ae, 0x6264df7e, 0x5f04f6ce, 0xed242ade, 0xd044036e, 0x97e479be, 0xaa84500e,
0x4834505d, 0x755479ed, 0x32f4033d, 0x0f942a8d, 0xbdb4f69d, 0x80d4df2d, 0xc774a5fd, 0xfa148c4d,
0x78441b9c, 0x4524322c, 0x028448fc, 0x3fe4614c, 0x8dc4bd5c, 0xb0a494ec, 0xf704ee3c, 0xca64c78c
},
{
0x00000000, 0xcb5cd3a5, 0x4dc8a10b, 0x869472ae, 0x9b914216, 0x50cd91b3, 0xd659e31d, 0x1d0530b8,
0xec53826d, 0x270f51c8, 0xa19b2366, 0x6ac7f0c3, 0x77c2c07b, 0xbc9e13de, 0x3a0a6170, 0xf156b2d5,
0x03d6029b, 0xc88ad13e, 0x4e1ea390, 0x85427035, 0x9847408d, 0x531b9328, 0xd58fe186, 0x1ed33223,
0xef8580f6, 0x24d95353, 0xa24d21fd, 0x6911f258, 0x7414c2e0, 0xbf481145, 0x39dc63eb, 0xf280b04e,
0x07ac0536, 0xccf0d693, 0x4a64a43d, 0x81387798, 0x9c3d4720, 0x57619485, 0xd1f5e62b, 0x1aa9358e,
0xebff875b, 0x20a354fe, 0xa6372650, 0x6d6bf5f5, 0x706ec54d, 0xbb3216e8, 0x3da66446, 0xf6fab7e3,
0x047a07ad, 0xcf26d408, 0x49b2a6a6, 0x82ee7503, 0x9feb45bb, 0x54b7961e, 0xd223e4b0, 0x197f3715,
0xe82985c0, 0x23755665, 0xa5e124cb, 0x6ebdf76e, 0x73b8c7d6, 0xb8e41473, 0x3e7066dd, 0xf52cb578,
0x0f580a6c, 0xc404d9c9, 0x4290ab67, 0x89cc78c2, 0x94c9487a, 0x5f959bdf, 0xd901e971, 0x125d3ad4,
0xe30b8801, 0x28575ba4, 0xaec3290a, 0x659ffaaf, 0x789aca17, 0xb3c619b2, 0x35526b1c, 0xfe0eb8b9,
0x0c8e08f7, 0xc7d2db52, 0x4146a9fc, 0x8a1a7a59, 0x971f4ae1, 0x5c439944, 0xdad7ebea, 0x118b384f,
0xe0dd8a9a, 0x2b81593f, 0xad152b91, 0x6649f834, 0x7b4cc88c, 0xb0101b29, 0x36846987, 0xfdd8ba22,
0x08f40f5a, 0xc3a8dcff, 0x453cae51, 0x8e607df4, 0x93654d4c, 0x58399ee9, 0xdeadec47, 0x15f13fe2,
0xe4a78d37, 0x2ffb5e92, 0xa96f2c3c, 0x6233ff99, 0x7f36cf21, 0xb46a1c84, 0x32fe6e2a, 0xf9a2bd8f,
0x0b220dc1, 0xc07ede64, 0x46eaacca, 0x8db67f6f, 0x90b34fd7, 0x5bef9c72, 0xdd7beedc, 0x16273d79,
0xe7718fac, 0x2c2d5c09, 0xaab92ea7, 0x61e5fd02, 0x7ce0cdba, 0xb7bc1e1f, 0x31286cb1, 0xfa74bf14,
0x1eb014d8, 0xd5ecc77d, 0x5378b5d3, 0x98246676, 0x852156ce, 0x4e7d856b, 0xc8e9f7c5, 0x03b52460,
0xf2e396b5, 0x39bf4510, 0xbf2b37be, 0x7477e41b, 0x6972d4a3, 0xa22e0706, 0x24ba75a8, 0xefe6a60d,
0x1d661643, 0xd63ac5e6, 0x50aeb748, 0x9bf264ed, 0x86f75455, 0x4dab87f0, 0xcb3ff55e, 0x006326fb,
0xf135942e, 0x3a69478b, 0xbcfd3525, 0x77a1e680, 0x6aa4d638, 0xa1f8059d, 0x276c7733, 0xec30a496,
0x191c11ee, 0xd240c24b, 0x54d4b0e5, 0x9f886340, 0x828d53f8, 0x49d1805d, 0xcf45f2f3, 0x04192156,
0xf54f9383, 0x3e134026, 0xb8873288, 0x73dbe12d, 0x6eded195, 0xa5820230, 0x2316709e, 0xe84aa33b,
0x1aca1375, 0xd196c0d0, 0x5702b27e, 0x9c5e61db, 0x815b5163, 0x4a0782c6, 0xcc93f068, 0x07cf23cd,
0xf6999118, 0x3dc542bd, 0xbb513013, 0x700de3b6, 0x6d08d30e, 0xa65400ab, 0x20c07205, 0xeb9ca1a0,
0x11e81eb4, 0xdab4cd11, 0x5c20bfbf, 0x977c6c1a, 0x8a795ca2, 0x41258f07, 0xc7b1fda9, 0x0ced2e0c,
0xfdbb9cd9, 0x36e74f7c, 0xb0733dd2, 0x7b2fee77, 0x662adecf, 0xad760d6a, 0x2be27fc4, 0xe0beac61,
0x123e1c2f, 0xd962cf8a, 0x5ff6bd24, 0x94aa6e81, 0x89af5e39, 0x42f38d9c, 0xc467ff32, 0x0f3b2c97,
0xfe6d9e42, 0x35314de7, 0xb3a53f49, 0x78f9ecec, 0x65fcdc54, 0xaea00ff1, 0x28347d5f, 0xe368aefa,
0x16441b82, 0xdd18c827, 0x5b8cba89, 0x90d0692c, 0x8dd55994, 0x46898a31, 0xc01df89f, 0x0b412b3a,
0xfa1799ef, 0x314b4a4a, 0xb7df38e4, 0x7c83eb41, 0x6186dbf9, 0xaada085c, 0x2c4e7af2, 0xe712a957,
0x15921919, 0xdececabc, 0x585ab812, 0x93066bb7, 0x8e035b0f, 0x455f88aa, 0xc3cbfa04, 0x089729a1,
0xf9c19b74, 0x329d48d1, 0xb4093a7f, 0x7f55e9da, 0x6250d962, 0xa90c0ac7, 0x2f987869, 0xe4c4abcc
},
{
0x00000000, 0xa6770bb4, 0x979f1129, 0x31e81a9d, 0xf44f2413, 0x52382fa7, 0x63d0353a, 0xc5a73e8e,
0x33ef4e67, 0x959845d3, 0xa4705f4e, 0x020754fa, 0xc7a06a74, 0x61d761c0, 0x503f7b5d, 0xf64870e9,
0x67de9cce, 0xc1a9977a, 0xf0418de7, 0x56368653, 0x9391b8dd, 0x35e6b369, 0x040ea9f4, 0xa279a240,
0x5431d2a9, 0xf246d91d, 0xc3aec380, 0x65d9c834, 0xa07ef6ba, 0x0609fd0e, 0x37e1e793, 0x9196ec27,
0xcfbd399c, 0x69ca3228, 0x582228b5, 0xfe552301, 0x3bf21d8f, 0x9d85163b, 0xac6d0ca6, 0x0a1a0712,
0xfc5277fb, 0x5a257c4f, 0x6bcd66d2, 0xcdba6d66, 0x081d53e8, 0xae6a585c, 0x9f8242c1, 0x39f54975,
0xa863a552, 0x0e14aee6, 0x3ffcb47b, 0x998bbfcf, 0x5c2c8141, 0xfa5b8af5, 0xcbb39068, 0x6dc49bdc,
0x9b8ceb35, 0x3dfbe081, 0x0c13fa1c, 0xaa64f1a8, 0x6fc3cf26, 0xc9b4c492, 0xf85cde0f, 0x5e2bd5bb,
0x440b7579, 0xe27c7ecd, 0xd3946450, 0x75e36fe4, 0xb044516a, 0x16335ade, 0x27db4043, 0x81ac4bf7,
0x77e43b1e, 0xd19330aa, 0xe07b2a37, 0x460c2183, 0x83ab1f0d, 0x25dc14b9, 0x14340e24, 0xb2430590,
0x23d5e9b7, 0x85a2e203, 0xb44af89e, 0x123df32a, 0xd79acda4, 0x71edc610, 0x4005dc8d, 0xe672d739,
0x103aa7d0, 0xb64dac64, 0x87a5b6f9, 0x21d2bd4d, 0xe47583c3, 0x42028877, 0x73ea92ea, 0xd59d995e,
0x8bb64ce5, 0x2dc14751, 0x1c295dcc, 0xba5e5678, 0x7ff968f6, 0xd98e6342, 0xe86679df, 0x4e11726b,
0xb8590282, 0x1e2e0936, 0x2fc613ab, 0x89b1181f, 0x4c162691, 0xea612d25, 0xdb8937b8, 0x7dfe3c0c,
0xec68d02b, 0x4a1fdb9f, 0x7bf7c102, 0xdd80cab6, 0x1827f438, 0xbe50ff8c, 0x8fb8e511, 0x29cfeea5,
0xdf879e4c, 0x79f095f8, 0x48188f65, 0xee6f84d1, 0x2bc8ba5f, 0x8dbfb1eb, 0xbc57ab76, 0x1a20a0c2,
0x8816eaf2, 0x2e61e146, 0x1f89fbdb, 0xb9fef06f, 0x7c59cee1, 0xda2ec555, 0xebc6dfc8, 0x4db1d47c,
0xbbf9a495, 0x1d8eaf21, 0x2c66b5bc, 0x8a11be08, 0x4fb68086, 0xe9c18b32, 0xd82991af, 0x7e5e9a1b,
0xefc8763c, 0x49bf7d88, 0x78576715, 0xde206ca1, 0x1b87522f, 0xbdf0599b, 0x8c184306, 0x2a6f48b2,
0xdc27385b, 0x7a5033ef, 0x4bb82972, 0xedcf22c6, 0x28681c48, 0x8e1f17fc, 0xbff70d61, 0x198006d5,
0x47abd36e, 0xe1dcd8da, 0xd034c247, 0x7643c9f3, 0xb3e4f77d, 0x1593fcc9, 0x247be654, 0x820cede0,
0x74449d09, 0xd23396bd, 0xe3db8c20, 0x45ac8794, 0x800bb91a, 0x267cb2ae, 0x1794a833, 0xb1e3a387,
0x20754fa0, 0x86024414, 0xb7ea5e89, 0x119d553d, 0xd43a6bb3, 0x724d6007, 0x43a57a9a, 0xe5d2712e,
0x139a01c7, 0xb5ed0a73, 0x840510ee, 0x22721b5a, 0xe7d525d4, 0x41a22e60, 0x704a34fd, 0xd63d3f49,
0xcc1d9f8b, 0x6a6a943f, 0x5b828ea2, 0xfdf58516, 0x3852bb98, 0x9e25b02c, 0xafcdaab1, 0x09baa105,
0xfff2d1ec, 0x5985da58, 0x686dc0c5, 0xce1acb71, 0x0bbdf5ff, 0xadcafe4b, 0x9c22e4d6, 0x3a55ef62,
0xabc30345, 0x0db408f1, 0x3c5c126c, 0x9a2b19d8, 0x5f8c2756, 0xf9fb2ce2, 0xc813367f, 0x6e643dcb,
0x982c4d22, 0x3e5b4696, 0x0fb35c0b, 0xa9c457bf, 0x6c636931, 0xca146285, 0xfbfc7818, 0x5d8b73ac,
0x03a0a617, 0xa5d7ada3, 0x943fb73e, 0x3248bc8a, 0xf7ef8204, 0x519889b0, 0x6070932d, 0xc6079899,
0x304fe870, 0x9638e3c4, 0xa7d0f959, 0x01a7f2ed, 0xc400cc63, 0x6277c7d7, 0x539fdd4a, 0xf5e8d6fe,
0x647e3ad9, 0xc209316d, 0xf3e12bf0, 0x55962044, 0x90311eca, 0x3646157e, 0x07ae0fe3, 0xa1d90457,
0x579174be, 0xf1e67f0a, 0xc00e6597, 0x66796e23, 0xa3de50ad, 0x05a95b19, 0x34414184, 0x92364a30
},
{
0x00000000, 0xccaa009e, 0x4225077d, 0x8e8f07e3, 0x844a0efa, 0x48e00e64, 0xc66f0987, 0x0ac50919,
0xd3e51bb5, 0x1f4f1b2b, 0x91c01cc8, 0x5d6a1c56, 0x57af154f, 0x9b0515d1, 0x158a1232, 0xd92012ac,
0x7cbb312b, 0xb01131b5, 0x3e9e3656, 0xf23436c8, 0xf8f13fd1, 0x345b3f4f, 0xbad438ac, 0x767e3832,
0xaf5e2a9e, 0x63f42a00, 0xed7b2de3, 0x21d12d7d, 0x2b142464, 0xe7be24fa, 0x69312319, 0xa59b2387,
0xf9766256, 0x35dc62c8, 0xbb53652b, 0x77f965b5, 0x7d3c6cac, 0xb1966c32, 0x3f196bd1, 0xf3b36b4f,
0x2a9379e3, 0xe639797d, 0x68b67e9e, 0xa41c7e00, 0xaed97719, 0x62737787, 0xecfc7064, 0x205670fa,
0x85cd537d, 0x496753e3, 0xc7e85400, 0x0b42549e, 0x01875d87, 0xcd2d5d19, 0x43a25afa, 0x8f085a64,
0x562848c8, 0x9a824856, 0x140d4fb5, 0xd8a74f2b, 0xd2624632, 0x1ec846ac, 0x9047414f, 0x5ced41d1,
0x299dc2ed, 0xe537c273, 0x6bb8c590, 0xa712c50e, 0xadd7cc17, 0x617dcc89, 0xeff2cb6a, 0x2358cbf4,
0xfa78d958, 0x36d2d9c6, 0xb85dde25, 0x74f7debb, 0x7e32d7a2, 0xb298d73c, 0x3c17d0df, 0xf0bdd041,
0x5526f3c6, 0x998cf358, 0x1703f4bb, 0xdba9f425, 0xd16cfd3c, 0x1dc6fda2, 0x9349fa41, 0x5fe3fadf,
0x86c3e873, 0x4a69e8ed, 0xc4e6ef0e, 0x084cef90, 0x0289e689, 0xce23e617, 0x40ace1f4, 0x8c06e16a,
0xd0eba0bb, 0x1c41a025, 0x92cea7c6, 0x5e64a758, 0x54a1ae41, 0x980baedf, 0x1684a93c, 0xda2ea9a2,
0x030ebb0e, 0xcfa4bb90, 0x412bbc73, 0x8d81bced, 0x8744b5f4, 0x4beeb56a, 0xc561b289, 0x09cbb217,
0xac509190, 0x60fa910e, 0xee7596ed, 0x22df9673, 0x281a9f6a, 0xe4b09ff4, 0x6a3f9817, 0xa6959889,
0x7fb58a25, 0xb31f8abb, 0x3d908d58, 0xf13a8dc6, 0xfbff84df, 0x37558441, 0xb9da83a2, 0x7570833c,
0x533b85da, 0x9f918544, 0x111e82a7, 0xddb48239, 0xd7718b20, 0x1bdb8bbe, 0x95548c5d, 0x59fe8cc3,
0x80de9e6f, 0x4c749ef1, 0xc2fb9912, 0x0e51998c, 0x04949095, 0xc83e900b, 0x46b197e8, 0x8a1b9776,
0x2f80b4f1, 0xe32ab46f, 0x6da5b38c, 0xa10fb312, 0xabcaba0b, 0x6760ba95, 0xe9efbd76, 0x2545bde8,
0xfc65af44, 0x30cfafda, 0xbe40a839, 0x72eaa8a7, 0x782fa1be, 0xb485a120, 0x3a0aa6c3, 0xf6a0a65d,
0xaa4de78c, 0x66e7e712, 0xe868e0f1, 0x24c2e06f, 0x2e07e976, 0xe2ade9e8, 0x6c22ee0b, 0xa088ee95,
0x79a8fc39, 0xb502fca7, 0x3b8dfb44, 0xf727fbda, 0xfde2f2c3, 0x3148f25d, 0xbfc7f5be, 0x736df520,
0xd6f6d6a7, 0x1a5cd639, 0x94d3d1da, 0x5879d144, 0x52bcd85d, 0x9e16d8c3, 0x1099df20, 0xdc33dfbe,
0x0513cd12, 0xc9b9cd8c, 0x4736ca6f, 0x8b9ccaf1, 0x8159c3e8, 0x4df3c376, 0xc37cc495, 0x0fd6c40b,
0x7aa64737, 0xb60c47a9, 0x3883404a, 0xf42940d4, 0xfeec49cd, 0x32464953, 0xbcc94eb0, 0x70634e2e,
0xa9435c82, 0x65e95c1c, 0xeb665bff, 0x27cc5b61, 0x2d095278, 0xe1a352e6, 0x6f2c5505, 0xa386559b,
0x061d761c, 0xcab77682, 0x44387161, 0x889271ff, 0x825778e6, 0x4efd7878, 0xc0727f9b, 0x0cd87f05,
0xd5f86da9, 0x19526d37, 0x97dd6ad4, 0x5b776a4a, 0x51b26353, 0x9d1863cd, 0x1397642e, 0xdf3d64b0,
0x83d02561, 0x4f7a25ff, 0xc1f5221c, 0x0d5f2282, 0x079a2b9b, 0xcb302b05, 0x45bf2ce6, 0x89152c78,
0x50353ed4, 0x9c9f3e4a, 0x121039a9, 0xdeba3937, 0xd47f302e, 0x18d530b0, 0x965a3753, 0x5af037cd,
0xff6b144a, 0x33c114d4, 0xbd4e1337, 0x71e413a9, 0x7b211ab0, 0xb78b1a2e, 0x39041dcd, 0xf5ae1d53,
0x2c8e0fff, 0xe0240f61, 0x6eab0882, 0xa201081c, 0xa8c40105, 0x646e019b, 0xeae10678, 0x264b06e6
}
};
crc_t crc_update(crc_t crc, const void *data, size_t data_len)
{
const unsigned char *d = (const unsigned char *)data;
unsigned int tbl_idx;
const uint32_t *d32 = (const uint32_t *)d;
while (data_len >= 8)
{
#if __BYTE_ORDER == __BIG_ENDIAN
crc_t d1 = *d32++ ^ le16toh(crc);
crc_t d2 = *d32++;
crc =
crc_table[0][d2 & 0xffu] ^
crc_table[1][(d2 >> 8) & 0xffu] ^
crc_table[2][(d2 >> 16) & 0xffu] ^
crc_table[3][(d2 >> 24) & 0xffu] ^
crc_table[4][d1 & 0xffu] ^
crc_table[5][(d1 >> 8) & 0xffu] ^
crc_table[6][(d1 >> 16) & 0xffu] ^
crc_table[7][(d1 >> 24) & 0xffu];
#else
crc_t d1 = *d32++ ^ crc;
crc_t d2 = *d32++;
crc =
crc_table[0][(d2 >> 24) & 0xffu] ^
crc_table[1][(d2 >> 16) & 0xffu] ^
crc_table[2][(d2 >> 8) & 0xffu] ^
crc_table[3][d2 & 0xffu] ^
crc_table[4][(d1 >> 24) & 0xffu] ^
crc_table[5][(d1 >> 16) & 0xffu] ^
crc_table[6][(d1 >> 8) & 0xffu] ^
crc_table[7][d1 & 0xffu];
#endif
data_len -= 8;
}
/* Remaining bytes with the standard algorithm */
d = (const unsigned char *)d32;
while (data_len--) {
tbl_idx = (crc ^ *d) & 0xff;
crc = (crc_table[0][tbl_idx] ^ (crc >> 8)) & 0xffffffff;
d++;
}
return crc & 0xffffffff;
}
|
imlewc/huaweicloud-sdk-go-v3
|
services/bss/v2/model/model_amount_infomation_v2.go
|
<gh_stars>0
/*
* CSBPartnerOpenAPI
*
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
*/
package model
import (
"encoding/json"
"strings"
)
type AmountInfomationV2 struct {
// |参数名称:费用项。具体请参见表 DiscountItemV2。| |参数约束以及描述:费用项。具体请参见表 DiscountItemV2。|
Discounts *[]DiscountItemV2 `json:"discounts,omitempty"`
// |参数名称:现金券金额,预留。| |参数的约束及描述:现金券金额,预留。|
FlexipurchaseCouponAmount *float64 `json:"flexipurchase_coupon_amount,omitempty"`
// |参数名称:代金券金额。| |参数的约束及描述:代金券金额。|
CouponAmount *float64 `json:"coupon_amount,omitempty"`
// |参数名称:储值卡金额,预留。| |参数的约束及描述:储值卡金额,预留。|
StoredCardAmount *float64 `json:"stored_card_amount,omitempty"`
// |参数名称:手续费(仅退订订单存在)。| |参数的约束及描述:手续费(仅退订订单存在)。|
CommissionAmount *float64 `json:"commission_amount,omitempty"`
// |参数名称:消费金额(仅退订订单存在)。| |参数的约束及描述:消费金额(仅退订订单存在)。|
ConsumedAmount *float64 `json:"consumed_amount,omitempty"`
}
func (o AmountInfomationV2) String() string {
data, _ := json.Marshal(o)
return strings.Join([]string{"AmountInfomationV2", string(data)}, " ")
}
|
randolphwong/mcsema
|
boost/boost/spirit/home/classic/utility/rule_parser.hpp
|
/*==============================================================================
Copyright (c) 2006 <NAME>
http://spirit.sourceforge.net/
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
==============================================================================*/
// The comment below contains a unnamed 'namespace {', which is flagged by the
// Boost inspect tool as a violation of common C++ programming rules. Since it's
// in a comment, well, we switch it off :-P
// boostinspect:nounnamed
//
// About:
// =====
//
// Using a typeof operator or Boost.Typeof to automatically set the type of
// variables (as done in the Spirit example demonstrating typeof) is by far not
// all we can do to tighten up our grammars as there are some significant
// drawbacks of this approach:
// - the types complexity scales with the complexity of the grammar (sooner or
// later hitting the limits of the compiler),
// - recursive grammars are not possible, and
// - all parser objects are embedded by value.
//
// The Spirit documentation therefore recommends creating custom parser classes
// (derived from the a sub_grammar template):
//
// http://www.boost.org/libs/spirit/doc/techniques.html#no_rules
// http://www.boost.org/libs/spirit/doc/techniques.html#typeof
//
// In practice manually applying this technique leads to rather lengthy code and
// overthis requires the user to have a solid understanding of Spirit details.
//
// Here is a generalized, macro-based approach to easily create typeof-based
// grammars that can be recursive and arbitrarily complex.
//
//
// Quick manual:
// ============
//
// 1. Setup
//
// Before the rule parser macro (the protagonist of the facility) can be used
// the the user must define the macro BOOST_SPIRIT__NAMESPACE (note the double
// underscore characeter) and setup a registration group for Boost.Typeof.
//
// Examples:
//
// // should come after regular #includeS
// #include BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP()
//
// // [...]
//
// #define BOOST_SPIRIT__NAMESPACE (2,(my_project, my_module))
// // | | +- outer +- inner
// // ! space ! -+ | namespace namespace
// // |
// // +--- number of nested namespaces
//
// namespace my_project { namespace my_module {
//
// // [...]
//
// ---
//
// // should come after regular #includeS
// #include BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP()
//
// // [...]
//
// #define BOOST_SPIRIT__NAMESPACE (2,(my_project, (anonymous) ))
//
// namespace my_project { namespace {
//
// // [...]
//
// ---
//
// // should come after regular #includeS
// #include BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP()
//
// // [...]
//
//
// #define BOOST_SPIRIT__NAMESPACE -
// // we're working at root namespace
//
//
// Why do I have to do this?
//
// Boost.Typeof needs to assign a unique ID for each registration. This ID is
// created composed of the line number and the registration group. The
// facility performs Typeof registration and thus requires the source file to
// have its own registration group. Further Boost.Typeof requires registration
// to happen at root namespace so we have to close and reopen the namespace
// we're in.
//
//
// 2. The rule parser macro
//
// A simple rule parser definition looks like that:
//
// // we're at namespace scope here
//
// // Skip parser for C/C++ comments and whitespace
// BOOST_SPIRIT_RULE_PARSER(skipper,
// -,-,-,
//
// +( confix_p("//",*anychar_p,eol_p)
// | confix_p("/*",*anychar_p,"*/")
// | space_p
// )
// )
//
// Now we can use 'skipper' in other Spirit expressions.
//
// The code above creates a parser (template) class 'skpper_t' and (in this
// case, because there are no parameters) a static const instance 'skipper' of
// that class. The class is automatically registered with Boost.Typeof. The type
// name our parser is skipper_t here.
//
//
// 2.1. Parametrized rule parsers
//
// Rule parser definitions can have parameters.
//
// Parameters are passed to the BOOST_SPIRIT_RULE_PARSER macro as its second
// argument (just pass '-' if there are no parameters) with the following
// format:
//
// (N,( param1,param2, / ... / paramN ))
// +-- number of parameters
//
// Example of a whole rule parser:
//
// BOOST_SPIRIT_RULE_PARSER(new_name,
// (1,( symbol_table )),-,-,
//
// lexeme_d[ (alpha_p >> *alnum_p)[ symbol_table.add ] ]
// )
//
// The expression 'new_name(my_symbols)' parses a string literal and adds it to
// the symbol table 'my_symbols'.
//
// The rule parser macro creates a function template as called 'new_name' that
// takes one parameter of deduced reference type and returns a specialization of
// 'new_name_t' in this case.
//
// Since parsers that require to be fast and lightweight often also require to
// be reentrant, it's quite common to pass in some semantic controller (the
// symbol table in the example above).
// However, parameters are templated so they can be anything (including parsers
// of course) so refactoring tasks can be abstracted with rule parsers as well.
//
// BOOST_SPIRIT_RULE_PARSER(enumeration_parser,
// (2,( element_parser, delimiter_parser )),-,-,
//
// element_parser >> *(delimiter_parser >> element_parser)
// )
//
// The expression 'enumeration_parser(int_p[ some_action ], ',')' creates a
// parser for a comma-separated list of integers.
//
//
// 2.2. Rule parsrs and semantic actions
//
// While semantic actions can be globally attached to a rule parser or passed
// to a parametrized rule parser as (part of) an argument, even more control is
// possible by using action placeholders. E.g:
//
// BOOST_SPIRIT_ACTION_PLACEHOLDER(int_action)
//
// BOOST_SPIRIT_RULE_PARSER(int_list,
// -,(1,( int_action )),-,
//
// int_p[ int_action ] >> *(',' >> int_p[ int_action ])
// )
//
// The expression 'int_list[ my_action ]' parses a comma separated list of
// integers and calls 'my_action' for every integer parsed therein.
//
// Of course multiple actions can be attached to one placeholder as usual (in
// this case 'int_list[ my_action1 ][ my_action2 ] would call two actions).
//
// Further there can be multiple action placeholders for a single rule parser:
//
// BOOST_SPIRIT_ACTION_PLACEHOLDER(feed_int)
// BOOST_SPIRIT_ACTION_PLACEHOLDER(next_int)
//
// BOOST_SPIRIT_RULE_PARSER(int_list,
// -,(2,( feed_int, next_int )),-,
//
// int_p[ feed_int ] >> *(',' >> int_p[ next_int ][ feed_int ])
// )
//
// The expression 'int_list[ (feed_int = my_action1), (next_int = my_action2) ]'
// creates a parser for a comma separated list of integers with the actions
// attached appropriately.
//
// int_list[ feed_int = my_action1,my_action2, next_int = my_action3 ]
//
// works too (in this case the action placeholder 'feed_int' has two actions
// attached to it).
//
// You can both override and append actions associated with an action
// placeholder:
//
// var = int_list[ feed_int = my_action1, next_int = my_action2 ]
//
// // [...]
//
// ... var[ feed_int = another_action ]
// // 'another_action' overrides the actions previously attached to 'feed_int'
//
// ... var[ next_int += another_action ]
// // 'another_action' is appended to the list of actions attached to
// // 'next_int'
//
// Action placeholders are not entirely for free -- they add to the size and the
// initialization time of the rule parser. However, the impact on an already
// initialized rule parser instance should be quite small.
//
//
// 2.3. Member variables
//
// You can add member variables to the rule parser class using the third
// parameter of the rule parser macro:
//
// BOOST_SPIRIT_RULE_PARSER( calc,
// -,
// -,
// (3,( ((subrule<0>),expression,()),
// ((subrule<1>),term,()),
// ((subrule<2>),factor,() )) ),
//
// // [...]
//
// adds three subrules to the rule parser.
// Each parameter must have the following type to allow commas to be handled
// safely from within the preprocessing code:
//
// ((type)),name,(constructor argument(s)))
//
//
// 2.4. The opaque rule parser
//
// Rule parsers usually are templates. Building large grammars pushes the
// compiler really hard (and eventually to its limits) because of the
// metafunction complexity involved.
// If a rule parser without parameters and action placeholders is defined, a
// non-template class is created. Non-templated rule parsers can also be created
// explicitly by using BOOST_SPIRIT_OPAQUE_RULE_PARSER.
// Opaque rule parsers can have parameters and member variables (note: no action
// placeholders are possible). The parameters of an opaque rule parsers are
// strictly typed, e.g:
//
// BOOST_SPIRIT_OPAQUE_RULE_PARSER(new_identifier,
// (1,( ((my_symbol_table_t &),symbol_table) ))
// ,-,
// (alpha_p >> *alnum_p) [ symbol_table.add ]
// )
//
// Note it's also possible to have opaque rule parsers accept parameters of
// non-const reference types which is not possible with regular rule parsers.
//
//
// 3. Utilities for by-reference embedding
//
// When using parsers mutiple times or recursively it can be helpful to embed
// them by-reference into the final parser expression.
// For this purpose the library provides a wrapper template 'parser_reference'.
// There is also a function template to create a wrapped parser which can deduce
// the parser's type from its argument.
//
// --- --- - - --- - - --- - - - - --- - - - - - - - - - - - - - - - - - - - - -
#if !defined(BOOST_SPIRIT_UTILITY_RULE_PARSER_HPP_INCLUDED)
# define BOOST_SPIRIT_UTILITY_RULE_PARSER_HPP_INCLUDED
//==============================================================================
// Dependencies
//==============================================================================
# include <boost/config.hpp>
# include <boost/detail/workaround.hpp>
# include <boost/call_traits.hpp>
# include <boost/typeof/typeof.hpp>
# include <boost/spirit/home/classic/namespace.hpp>
# include <boost/spirit/home/classic/core/parser.hpp>
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# include <boost/preprocessor/cat.hpp>
# include <boost/preprocessor/seq/seq.hpp>
# include <boost/preprocessor/seq/for_each_i.hpp>
# include <boost/preprocessor/tuple/eat.hpp>
# include <boost/preprocessor/tuple/to_seq.hpp>
# include <boost/preprocessor/array/size.hpp>
# include <boost/preprocessor/control/if.hpp>
# include <boost/preprocessor/control/iif.hpp>
# include <boost/preprocessor/control/expr_iif.hpp>
# include <boost/preprocessor/logical/or.hpp>
# include <boost/preprocessor/logical/nor.hpp>
# include <boost/preprocessor/logical/not.hpp>
# include <boost/preprocessor/logical/compl.hpp>
# include <boost/preprocessor/arithmetic/inc.hpp>
# include <boost/preprocessor/arithmetic/dec.hpp>
# include <boost/preprocessor/arithmetic/add.hpp>
# include <boost/preprocessor/detail/is_unary.hpp>
# include <boost/preprocessor/detail/is_binary.hpp>
# include <boost/preprocessor/repetition/repeat.hpp>
# include <boost/preprocessor/repetition/enum_params.hpp>
# include <boost/preprocessor/repetition/enum_binary_params.hpp>
# include <boost/preprocessor/repetition/enum_shifted_params.hpp>
# include <boost/preprocessor/repetition/enum_trailing_params.hpp>
# include <boost/preprocessor/punctuation/comma.hpp>
# include <boost/preprocessor/punctuation/comma_if.hpp>
# include <boost/preprocessor/facilities/empty.hpp>
# include <boost/preprocessor/facilities/identity.hpp>
# include <boost/preprocessor/facilities/intercept.hpp>
//==============================================================================
// Interface
//==============================================================================
// Creates a rule parser. Use at namespace scope.
# define BOOST_SPIRIT_RULE_PARSER(name,params,actions,members,rule) \
BOOST_SPIRIT_RP_IMPL_I(name,params,actions,members,rule)
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
// Creates a non-templated rule parser. Use at namespace scope.
# define BOOST_SPIRIT_OPAQUE_RULE_PARSER(name,params,members,rule) \
BOOST_SPIRIT_RP_OPAQUE_IMPL_I(name,params,members,rule)
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
// Defines an action placeholder. Use at namespace scope.
# define BOOST_SPIRIT_ACTION_PLACEHOLDER(name) \
BOOST_SPIRIT_RP_AP_IMPL(name,::BOOST_SPIRIT_CLASSIC_NS::type_of)
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
// Utilities to embed parsers by reference.
namespace boost
{
namespace spirit
{
BOOST_SPIRIT_CLASSIC_NAMESPACE_BEGIN
template<class P> class parser_reference;
template<class P> parser_reference<P> embed_by_reference(parser<P> const &);
BOOST_SPIRIT_CLASSIC_NAMESPACE_END
}
}
//==============================================================================
// Implementation
//==============================================================================
#include BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP()
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
// RP_REGISTER_TEMPLATE
//
// Boost.Typeof registration from within BOOST_SPIRIT__NAMESPACE
# define BOOST_SPIRIT_RP_REGISTER_TEMPLATE(name,params) \
BOOST_SPIRIT_RP_EMIT(NS_CLOSE,BOOST_SPIRIT__NAMESPACE,-) \
BOOST_TYPEOF_REGISTER_TEMPLATE( \
BOOST_SPIRIT_RP_EMIT(NS_QUALIFY,BOOST_SPIRIT__NAMESPACE,-) name, \
params) \
BOOST_SPIRIT_RP_EMIT(NS_OPEN,BOOST_SPIRIT__NAMESPACE,-)
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
// RP_REGISTER_TYPE
//
// Boost.Typeof registration from within BOOST_SPIRIT__NAMESPACE
# define BOOST_SPIRIT_RP_REGISTER_TYPE(name) \
BOOST_SPIRIT_RP_EMIT(NS_CLOSE,BOOST_SPIRIT__NAMESPACE,-) \
BOOST_TYPEOF_REGISTER_TYPE( \
BOOST_SPIRIT_RP_EMIT(NS_QUALIFY,BOOST_SPIRIT__NAMESPACE,-) name ) \
BOOST_SPIRIT_RP_EMIT(NS_OPEN,BOOST_SPIRIT__NAMESPACE,-)
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
// RP_AP_IMPL
//
// The action placeholder definition
# define BOOST_SPIRIT_RP_AP_IMPL(name,ns) \
namespace __action_placeholder \
{ \
struct name \
{ \
template<typename Action> \
ns :: action_chain< name, ns :: replace, Action> \
operator=(Action const & __a) const \
{ return ns :: action_chain< name, ns :: replace, Action>(__a); } \
\
template<typename Action> \
ns :: action_chain< name, ns :: append, Action> \
operator+=(Action const & __a) const \
{ return ns :: action_chain< name, ns :: append, Action> (__a); } \
}; \
} \
__action_placeholder:: name const name = __action_placeholder:: name ();
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
// RP_IMPL_I
//
// Does some precalculation so RP_IMPL_II can look cleaner
# define BOOST_SPIRIT_RP_IMPL_I(name,pars,acts,mbrs,expr) \
BOOST_SPIRIT_RP_IMPL_II(name, name ## _t , \
pars, BOOST_SPIRIT_RP_ARRAY_SIZE(pars), \
acts, BOOST_SPIRIT_RP_ARRAY_SIZE(acts), \
mbrs, BOOST_SPIRIT_RP_ARRAY_SIZE(mbrs), expr)
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
// RP_IMPL_II
# define BOOST_SPIRIT_RP_IMPL_II(name,name_t,pars,np,acts,na,mbrs,nm,x) \
BOOST_PP_IIF(BOOST_PP_OR(np,na),BOOST_SPIRIT_RP_IMPL_III, \
BOOST_SPIRIT_RP_OPAQUE_IMPL_II) \
(name,name_t,pars,np,acts,na,mbrs,nm,x)
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
// RP_IMPL_III
//
// The rule parser definition
# define BOOST_SPIRIT_RP_IMPL_III(name,name_t,pars,np,acts,na,mbrs,nm,x) \
\
template< BOOST_SPIRIT_RP_TPL_PARAMS(pars,acts,typename __,1) > \
class name_t \
: public ::BOOST_SPIRIT_CLASSIC_NS::parser< name_t \
< BOOST_SPIRIT_RP_TPL_PARAMS(pars,acts,__,0) > > \
{ \
class __rule \
{ \
BOOST_SPIRIT_RP_EMIT(PM_STATIC,pars,__T) \
BOOST_SPIRIT_RP_EMIT(AP_STATIC,acts,-) \
BOOST_SPIRIT_RP_EMIT(MV_STATIC,mbrs,BOOST_PP_IDENTITY(typename)) \
public: \
BOOST_TYPEOF_NESTED_TYPEDEF_TPL(__expr, \
::BOOST_SPIRIT_CLASSIC_NS::type_of::depend_on_type<__Dummy>(x) ) \
}; \
\
public: \
\
typedef name_t self_t; \
typedef typename __rule::__expr::type::parser_category_t \
parser_category_t; \
\
BOOST_PP_EXPR_IIF(BOOST_PP_NOR(np,na),typedef self_t const & embed_t;) \
\
protected: \
\
BOOST_SPIRIT_RP_EMIT(MV_NONSTATIC,mbrs,BOOST_PP_IDENTITY(typename)) \
BOOST_SPIRIT_RP_IF(na,SPIRIT_RP_AP_EXTRA_MBRS,2)(np,na) \
\
typename __rule::__expr::type::embed_t __parser; \
\
public: \
\
explicit name_t ( BOOST_SPIRIT_RP_CTOR(PARAMS,pars,np,acts) ) \
: BOOST_SPIRIT_RP_EMIT(MV_CTOR_INIT_LIST,mbrs,-) \
BOOST_PP_COMMA_IF(nm) \
BOOST_SPIRIT_RP_IF(na,SPIRIT_RP_CTOR_COMMA,4)(INIT_LIST,pars,np,acts)\
__parser(x) \
{ } \
\
name_t( name_t const & that) \
: BOOST_SPIRIT_RP_EMIT(MV_CTOR_COPY_INIT_LIST,mbrs,that) \
BOOST_PP_COMMA_IF(nm) \
BOOST_SPIRIT_RP_IF(na,SPIRIT_RP_CTOR_COMMA,4) \
(COPY_INIT_LIST,pars,np,acts) \
__parser(that.__parser) \
{ } \
\
template<typename Scanner> struct result \
{ \
typedef typename ::BOOST_SPIRIT_CLASSIC_NS::parser_result< \
typename __rule::__expr::type, Scanner>::type type; \
}; \
\
template<typename Scanner> \
typename ::BOOST_SPIRIT_CLASSIC_NS::parser_result<self_t, Scanner>::type \
parse(Scanner const & s) const { return __parser.parse(s); } \
\
BOOST_SPIRIT_RP_IF(na,SPIRIT_RP_AP_HANDLER,5) \
(name_t,np,acts,na,::BOOST_SPIRIT_CLASSIC_NS::type_of) \
}; \
\
BOOST_PP_IF(np,BOOST_SPIRIT_RP_GEN_FUNC,BOOST_SPIRIT_RP_GLOB_VAR) \
(name,name_t,np,na) \
BOOST_SPIRIT_RP_REGISTER_TEMPLATE \
(name_t,BOOST_PP_INC(BOOST_PP_ADD(np,na)))
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
// RP_OPAQUE_IMPL_I
//
# define BOOST_SPIRIT_RP_OPAQUE_IMPL_I(name,pars,mbrs,expr) \
BOOST_SPIRIT_RP_OPAQUE_IMPL_II(name, name ## _t, \
pars,BOOST_SPIRIT_RP_ARRAY_SIZE(pars),-,-,\
mbrs,BOOST_SPIRIT_RP_ARRAY_SIZE(mbrs),expr)
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
// RP_OPAQUE_IMPL_II
//
# define BOOST_SPIRIT_RP_OPAQUE_IMPL_II(name,name_t,pars,np,_1,_2,mbrs,nm,x) \
class name_t; \
\
BOOST_SPIRIT_RP_REGISTER_TYPE(name_t) \
\
class name_t \
: public ::BOOST_SPIRIT_CLASSIC_NS::parser< name_t > \
{ \
class __rule \
{ \
BOOST_SPIRIT_RP_EMIT(PM_OPAQUE_STATIC,pars,-) \
BOOST_SPIRIT_RP_EMIT(MV_STATIC,mbrs,BOOST_PP_EMPTY) \
public: \
BOOST_TYPEOF_NESTED_TYPEDEF(__expr,x) \
}; \
\
public: \
\
typedef name_t self_t; \
typedef __rule::__expr::type::parser_category_t parser_category_t; \
BOOST_PP_EXPR_IIF(BOOST_PP_NOT(np),typedef self_t const & embed_t;) \
\
protected: \
\
BOOST_SPIRIT_RP_EMIT(MV_NONSTATIC,mbrs,BOOST_PP_EMPTY) \
\
__rule::__expr::type::embed_t __parser; \
\
public: \
\
explicit name_t (BOOST_SPIRIT_RP_EMIT(PM_OPAQUE_CTOR_PARAMS,pars,-)) \
: BOOST_SPIRIT_RP_EMIT(MV_CTOR_INIT_LIST,mbrs,-) \
BOOST_PP_COMMA_IF(nm) __parser(x) \
{ } \
\
name_t(name_t const & that) \
: BOOST_SPIRIT_RP_EMIT(MV_CTOR_COPY_INIT_LIST,mbrs,that) \
BOOST_PP_COMMA_IF(nm) __parser(that.__parser) \
{ } \
\
template<typename Scanner> struct result \
{ \
typedef typename ::BOOST_SPIRIT_CLASSIC_NS::parser_result< \
__rule::__expr::type, Scanner>::type type; \
}; \
\
template<typename Scanner> \
typename ::BOOST_SPIRIT_CLASSIC_NS::parser_result<self_t, Scanner>::type \
parse(Scanner const & s) const { return __parser.parse(s); } \
}; \
\
BOOST_PP_IF(np,BOOST_SPIRIT_RP_GEN_OPAQUE,BOOST_SPIRIT_RP_GLOB_OPAQUE) \
(name,name_t,np,pars)
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
// RP_AP_HANDLER
//
// Part of the rule parser definition for handling action placeholders
# define BOOST_SPIRIT_RP_AP_HANDLER(name_t,np,acts,na,ns) \
private: \
template<typename A> struct __rebound_1st \
{ \
typedef name_t < void BOOST_PP_ENUM_TRAILING_PARAMS(np,__T) , \
typename ns ::action_concatenator<__A0,A>::type \
BOOST_PP_COMMA_IF(BOOST_PP_DEC(na)) \
BOOST_PP_ENUM_SHIFTED_PARAMS(na,__A) \
> type; \
}; \
\
template<typename X> struct __rebound \
{ \
typedef name_t < \
void BOOST_PP_ENUM_TRAILING_PARAMS(np,__T) \
BOOST_SPIRIT_RP_EMIT(AP_REBOUND_TPL_ARGS,acts,X) \
> type; \
}; \
public: \
template<typename A> \
typename __rebound_1st<A>::type const operator[](A const & a) const \
{ \
return typename __rebound_1st<A>::type ( \
BOOST_PP_ENUM_PARAMS(np,__p) BOOST_PP_COMMA_IF(np) \
ns ::concatenate_actions(__a0,a) \
BOOST_PP_COMMA_IF(BOOST_PP_DEC(na)) \
BOOST_PP_ENUM_SHIFTED_PARAMS(na,__a) ); \
} \
template<class PH, ns ::action_chain_mode M, typename A> \
typename __rebound< ns ::action_chain<PH,M,A> >::type const \
operator[]( ns ::action_chain<PH,M,A> const & x) const \
{ \
return typename __rebound< ns ::action_chain<PH,M,A> >::type ( \
BOOST_PP_ENUM_PARAMS(np,__p) BOOST_PP_COMMA_IF(np) \
BOOST_SPIRIT_RP_EMIT(AP_REBOUND_ARGS,acts,x) ); \
} \
template<class Head, class Tail> \
typename __rebound< ns ::action_chains<Head,Tail> >::type const \
operator[]( ns ::action_chains<Head,Tail> const & x) const \
{ \
return typename __rebound< ns ::action_chains<Head,Tail> >::type ( \
BOOST_PP_ENUM_PARAMS(np,__p) BOOST_PP_COMMA_IF(np) \
BOOST_SPIRIT_RP_EMIT(AP_REBOUND_ARGS,acts,x) ); \
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
// RP_AP_EXTRA_MBRS
//
// Extra members we need for rebinding if there are action placeholders
# define BOOST_SPIRIT_RP_AP_EXTRA_MBRS(np,na) \
private: \
BOOST_PP_REPEAT(np,BOOST_SPIRIT_RP_PM_MBRS,-) \
BOOST_PP_REPEAT(na,BOOST_SPIRIT_RP_AP_MBRS,-)
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
// RP_PM_MBRS
//
// Member variables to remember parameters if there are action placeholder
# define BOOST_SPIRIT_RP_PM_MBRS(z,i,d) __T ## i __p ## i ;
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
// RP_AP_MBRS
//
// Member variables to remember action placeholder substitutes
# define BOOST_SPIRIT_RP_AP_MBRS(z,i,d) __A ## i __a ## i ;
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
// RP_CTOR
//
// Expands to a fragment of a constructor (parameters or init-list)
# define BOOST_SPIRIT_RP_CTOR(what,pars,np,acts) \
BOOST_SPIRIT_RP_EMIT(PM_CTOR_ ## what,pars,__T) \
BOOST_SPIRIT_RP_EMIT(AP_CTOR_ ## what,acts,np)
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
// RP_CTOR_COMMA
//
// RP_CTOR with a trailing comma
# define BOOST_SPIRIT_RP_CTOR_COMMA(what,pars,np,acts) \
BOOST_SPIRIT_RP_CTOR(what,pars,np,acts) ,
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
// RP_TPL_PARAMS
//
// Expands to the template parameters or arguments of the rule parser template
# define BOOST_SPIRIT_RP_TPL_PARAMS(pars,acts,prefix,defaults) \
prefix ## Dummy \
BOOST_SPIRIT_RP_EMIT(PM_TEMPLATE_PARAMS,pars,prefix ## T) \
BOOST_SPIRIT_RP_EMIT(AP_TEMPLATE_PARAMS,acts,(prefix ## A,defaults))
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
// RP_GEN_FUNC
//
// Generator function
# define BOOST_SPIRIT_RP_GEN_FUNC(name,name_t,np,na) \
template< BOOST_PP_ENUM_PARAMS(np,typename T) > \
inline name_t < void BOOST_PP_ENUM_TRAILING_PARAMS(np,T) > \
name( BOOST_PP_ENUM_BINARY_PARAMS(np,T, const & p) ) \
{ return name_t < void BOOST_PP_ENUM_TRAILING_PARAMS(np,T) > \
(BOOST_PP_ENUM_PARAMS(np,p) BOOST_PP_ENUM_TRAILING_PARAMS(na, \
::BOOST_SPIRIT_CLASSIC_NS::type_of::nop_functor() BOOST_PP_INTERCEPT) ); \
}
// RP_GEN_OPAQUE
//
// non-templated version for opaque rule parsers.
# define BOOST_SPIRIT_RP_GEN_OPAQUE(name,name_t,np,pars) \
inline name_t name( BOOST_SPIRIT_RP_EMIT(PM_OPAQUE_GEN_PARAMS,pars,p)) \
{ return name_t (BOOST_PP_ENUM_PARAMS(np,p)); }
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
// RP_GLOB_VAR
//
// Global variable -- used instead of the generator function if there are no
// parameters
# define BOOST_SPIRIT_RP_GLOB_VAR(name,name_t,np,na) \
static name_t <void> const name = name_t <void>(BOOST_PP_ENUM_PARAMS(na, \
::BOOST_SPIRIT_CLASSIC_NS::type_of::nop_functor() BOOST_PP_INTERCEPT) );
// RP_GLOB_OPAQUE
//
// non-templated version for opaque rule parsers.
# define BOOST_SPIRIT_RP_GLOB_OPAQUE(name,name_t,np,pars) \
static name_t const name = name_t () ;
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
// PP_EMIT operations (fragment emittion based on array input)
// - - Namespace handling
// NS_OPEN
# define BOOST_SPIRIT_RP__NS_OPEN(r,data,i,elem) \
namespace BOOST_SPIRIT_RP_OPTIONAL(elem) {
// NS_QUALIFY
# define BOOST_SPIRIT_RP__NS_QUALIFY(r,data,i,elem) \
BOOST_SPIRIT_RP_OPTIONAL(elem ::)
// NS_CLOSE
# define BOOST_SPIRIT_RP__NS_CLOSE(r,data,i,elem) }
// - - Parameter handling
// PM_STATIC
# define BOOST_SPIRIT_RP__PM_STATIC(r,data,i,elem) \
static typename ::boost::call_traits< data ## i >::reference elem ;
// PM_CTOR_PARAMS
# define BOOST_SPIRIT_RP__PM_CTOR_PARAMS(r,data,i,elem) \
BOOST_PP_COMMA_IF(i) \
typename ::boost::call_traits< data ## i >::param_type elem
// PM_CTOR_ARGS
# define BOOST_SPIRIT_RP__PM_CTOR_ARGS(r,data,i,elem) \
BOOST_PP_COMMA_IF(i) elem
// PM_CTOR_INIT_LIST
# define BOOST_SPIRIT_RP__PM_CTOR_INIT_LIST(r,data,i,elem) \
BOOST_PP_COMMA_IF(i) __p ## i ( elem )
// PM_CTOR_COPY_INIT_LIST
# define BOOST_SPIRIT_RP__PM_CTOR_COPY_INIT_LIST(r,data,i,elem) \
BOOST_PP_COMMA_IF(i) __p ## i ( that. __p ## i )
// PM_TEMPLATE_PARAMS
# define BOOST_SPIRIT_RP__PM_TEMPLATE_PARAMS(r,data,i,elem) , data ## i
// - strictly typed parameters of the opaque rule_parser
// PM_OPAQUE_STATIC
# define BOOST_SPIRIT_RP__PM_OPAQUE_STATIC(r,data,i,elem) \
static ::boost::call_traits< \
BOOST_SPIRIT_RP_TYPE(BOOST_PP_TUPLE_ELEM(2,0,elem)) \
>::reference BOOST_PP_TUPLE_ELEM(2,1,elem) ;
// PM_OPAQUE_CTOR_PARAMS
# define BOOST_SPIRIT_RP__PM_OPAQUE_CTOR_PARAMS(r,data,i,elem) \
BOOST_PP_COMMA_IF(i) ::boost::call_traits< \
BOOST_SPIRIT_RP_TYPE(BOOST_PP_TUPLE_ELEM(2,0,elem)) \
>::param_type BOOST_PP_TUPLE_ELEM(2,1,elem)
// PM_OPAQUE_GEN_PARAMS
# define BOOST_SPIRIT_RP__PM_OPAQUE_GEN_PARAMS(r,data,i,elem) \
BOOST_PP_COMMA_IF(i) ::boost::call_traits< \
BOOST_SPIRIT_RP_TYPE(BOOST_PP_TUPLE_ELEM(2,0,elem)) \
>::param_type data ## i
// - - Member variable handling
// MV_NONSTATIC
# define BOOST_SPIRIT_RP__MV_NONSTATIC(r,data,i,elem) \
data() BOOST_SPIRIT_RP_TYPE(BOOST_PP_TUPLE_ELEM(3,0,elem)) \
BOOST_PP_TUPLE_ELEM(3,1,elem) ;
// MV_STATIC
# define BOOST_SPIRIT_RP__MV_STATIC(r,data,i,elem) \
static data() ::boost::call_traits< \
data() BOOST_SPIRIT_RP_TYPE(BOOST_PP_TUPLE_ELEM(3,0,elem)) \
>::reference BOOST_PP_TUPLE_ELEM(3,1,elem) ;
// MV_CTOR_INIT_LIST
# define BOOST_SPIRIT_RP__MV_CTOR_INIT_LIST(r,data,i,elem) \
BOOST_PP_COMMA_IF(i) \
BOOST_PP_TUPLE_ELEM(3,1,elem) BOOST_PP_TUPLE_ELEM(3,2,elem)
// MV_CTOR_COPY_INIT_LIST
# define BOOST_SPIRIT_RP__MV_CTOR_COPY_INIT_LIST(r,data,i,elem) \
BOOST_PP_COMMA_IF(i) \
BOOST_PP_TUPLE_ELEM(3,1,elem) (data . BOOST_PP_TUPLE_ELEM(3,1,elem))
// - - Action placeholder handling
// AP_STATIC
# define BOOST_SPIRIT_RP__AP_STATIC(r,data,i,elem) static __A ## i & elem ;
// AP_CTOR_PARAMS
# define BOOST_SPIRIT_RP__AP_CTOR_PARAMS(r,data,i,elem) \
BOOST_SPIRIT_RP_COMMA_IF_OR(data,i) \
typename ::boost::call_traits< __A ## i >::param_type elem
// AP_CTOR_ARGS
# define BOOST_SPIRIT_RP__AP_CTOR_ARGS(r,data,i,elem) \
BOOST_SPIRIT_RP_COMMA_IF_OR(data,i) elem
// AP_CTOR_INIT_LIST
# define BOOST_SPIRIT_RP__AP_CTOR_INIT_LIST(r,data,i,elem) \
BOOST_SPIRIT_RP_COMMA_IF_OR(data,i) __a ## i ( elem )
// AP_CTOR_COPY_INIT_LIST
# define BOOST_SPIRIT_RP__AP_CTOR_COPY_INIT_LIST(r,data,i,elem) \
BOOST_SPIRIT_RP_COMMA_IF_OR(data,i) __a ## i ( that. __a ## i )
// AP_TEMPLATE_PARAMS
# define BOOST_SPIRIT_RP__AP_TEMPLATE_PARAMS(r,data,i,elem) \
, BOOST_PP_CAT(BOOST_PP_TUPLE_ELEM(2,0,data),i) \
BOOST_PP_EXPR_IIF(BOOST_PP_TUPLE_ELEM(2,1,data), \
= ::BOOST_SPIRIT_CLASSIC_NS::type_of::nop_functor)
// AP_REBOUND_ARGS
# define BOOST_SPIRIT_RP__AP_REBOUND_ARGS(r,data,i,elem) \
BOOST_PP_COMMA_IF(i) \
::BOOST_SPIRIT_CLASSIC_NS::type_of::get_placeholdee< __action_placeholder:: elem > \
( __a ## i , data )
// AP_REBOUND_TPL_ARGS
# define BOOST_SPIRIT_RP__AP_REBOUND_TPL_ARGS(r,data,i,elem) \
, typename ::BOOST_SPIRIT_CLASSIC_NS::type_of::placeholdee< \
__action_placeholder:: elem , __A ## i, data >::type
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
// PP_EMIT
//
// Performs one of the operations in the above section on an optional array.
//
# define BOOST_SPIRIT_RP_EMIT(op, array, data) \
BOOST_SPIRIT_RP_ARRAY_FOR_EACH_I(BOOST_SPIRIT_RP__ ## op,data,array)
// --- --- - - --- - - --- - - - - --- - - - - - - - - - - - - - - - - - - - - -
// RP_ARRAY_FOR_EACH_I
//
// Iterates an optional array. That is you can pass e.g.'-' or 'none' to denote
// emptiness.
# define BOOST_SPIRIT_RP_ARRAY_FOR_EACH_I(macro,data,optional_array) \
BOOST_PP_IIF(BOOST_PP_IS_BINARY(optional_array), \
BOOST_SPIRIT_RP_ARRAY_FOR_EACH_I_IMPL, \
BOOST_PP_TUPLE_EAT(3))(macro,data,optional_array)
// RP_ARRAY_FOR_EACH_I_IMPL
# define BOOST_SPIRIT_RP_ARRAY_FOR_EACH_I_IMPL(macro,data,array) \
BOOST_SPIRIT_RP_IF(BOOST_PP_ARRAY_SIZE(array),PP_SEQ_FOR_EACH_I,3) \
(macro,data, BOOST_SPIRIT_RP_IF(BOOST_PP_ARRAY_SIZE(array), \
PP_TUPLE_TO_SEQ,2) array)
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
// RP_ARRAY_SIZE
//
// Expands to the size of an "optional array".
//
// Examples:
//
// BOOST_SPIRIT_RP_ARRAY_SIZE( (2,(a,b)) ) // 2
// BOOST_SPIRIT_RP_ARRAY_SIZE( (0,()) ) // 0
// BOOST_SPIRIT_RP_ARRAY_SIZE( none ) // 0
// BOOST_SPIRIT_RP_ARRAY_SIZE( - ) // 0
//
# define BOOST_SPIRIT_RP_ARRAY_SIZE(optional_array) \
BOOST_PP_IIF(BOOST_PP_IS_BINARY(optional_array), \
BOOST_PP_ARRAY_SIZE, 0 BOOST_PP_TUPLE_EAT(1))(optional_array)
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
// RP_OPTIONAL
//
// Expands to nothing if the argument is parenthesized.
//
// Examples:
//
// BOOST_SPIRIT_RP_OPTIONAL( foobar ) // foobar
// BOOST_SPIRIT_RP_OPTIONAL( (none) ) // evaluates to nothing
//
# define BOOST_SPIRIT_RP_OPTIONAL(elem) \
BOOST_PP_EXPR_IIF(BOOST_PP_COMPL(BOOST_PP_IS_UNARY(elem)),elem)
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
// RP_COMMA_IF_OR
//
// Expands to nothing if both arguments are zero, otherwise expands to a comma.
//
# define BOOST_SPIRIT_RP_COMMA_IF_OR(a,b) \
BOOST_PP_IIF(BOOST_PP_OR(a,b),BOOST_PP_COMMA,BOOST_PP_EMPTY)()
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
// RP_IF
//
// BOOST_SPIRIT_RP_IF(cond,name,arity)
//
// is equivalent to:
//
// BOOST_PP_IF(cond,BOOST_name,BOOST_PP_TUPLE_EAT(arity))
//
# define BOOST_SPIRIT_RP_IF(cond,name,arity) \
BOOST_PP_IF(cond,BOOST_ ## name,BOOST_PP_TUPLE_EAT(arity))
//------------------------------------------------------------------------------
// Wrapper and gernator function to embed a parser by reference
//------------------------------------------------------------------------------
namespace boost { namespace spirit {
BOOST_SPIRIT_CLASSIC_NAMESPACE_BEGIN
// Wrapper to embed a parser by reference
template<class P> class parser_reference
: public parser< parser_reference<P> >
{
P const & ref_that;
public:
parser_reference(P & that)
// we allow implicit conversion but forbid temporaries.
: ref_that(that)
{ }
typedef parser_reference<P> self_t;
typedef self_t const & embed_t;
typedef typename P::parser_category_t parser_category_t;
template<typename ScannerT> struct result
{ typedef typename P::BOOST_NESTED_TEMPLATE result<ScannerT>::type type; };
template<typename ScannerT>
typename result<ScannerT>::type
parse(ScannerT const & scan) const
{ return this->ref_that.parse(scan); }
};
template<class P> parser_reference<P>
embed_by_reference(::BOOST_SPIRIT_CLASSIC_NS::parser<P> & p)
{ return p; }
BOOST_SPIRIT_CLASSIC_NAMESPACE_END
} } // namespace ::BOOST_SPIRIT_CLASSIC_NS
BOOST_TYPEOF_REGISTER_TEMPLATE(BOOST_SPIRIT_CLASSIC_NS::parser_reference, 1)
//------------------------------------------------------------------------------
// Expression templates for action placeholders.
//------------------------------------------------------------------------------
namespace boost { namespace spirit {
BOOST_SPIRIT_CLASSIC_NAMESPACE_BEGIN
namespace type_of {
// No-operation functor
struct nop_functor
{
template<typename T>
bool operator()(T const &) const
{ return false; }
template<typename T, typename U>
bool operator()(T const &, U const &) const
{ return false; }
typedef bool result_type;
};
// Composite action
template<typename Action1, typename Action2>
class composite_action
{
Action1 fnc_a1;
Action2 fnc_a2;
public:
composite_action(Action1 const & a1, Action2 const & a2)
: fnc_a1(a1), fnc_a2(a2)
{ }
template<typename T>
void operator()(T const & inp) const
{ fnc_a1(inp); fnc_a2(inp); }
template<typename T, typename U>
void operator()(T const & inp1, U const inp2) const
{ fnc_a1(inp1, inp2); fnc_a2(inp1, inp2); }
};
// Action concatenation (and optimize away nop_functorS)
template<typename Action1, typename Action2>
struct action_concatenator
{
typedef composite_action<Action1,Action2> type;
static type concatenate(Action1 const & a1, Action2 const & a2)
{ return composite_action<Action1,Action2>(a1,a2); }
};
template<typename Action> struct action_concatenator<nop_functor, Action>
{
typedef Action type;
static type concatenate(nop_functor const &, Action const & a)
{ return a; }
};
template<typename Action> struct action_concatenator<Action, nop_functor>
{
typedef Action type;
static type concatenate(Action const & a, nop_functor const &)
{ return a; }
};
template<> struct action_concatenator<nop_functor, nop_functor>
{
typedef nop_functor type;
static type concatenate(nop_functor const &, nop_functor const &)
{ return nop_functor(); }
};
template<typename Action1, typename Action2>
typename action_concatenator<Action1,Action2>::type
concatenate_actions(Action1 const & a1, Action2 const & a2)
{
return action_concatenator<Action1,Action2>::concatenate(a1,a2);
}
// Action chains
enum action_chain_mode { replace, append };
template<class Placeholder, action_chain_mode Mode, typename Action>
class action_chain
{
Action fnc_action;
public:
action_chain(Action const & a)
: fnc_action(a)
{ }
typedef Action action_type;
Action const & action() const { return fnc_action; }
};
// This operator adds actions to an action chain definition
template<class PH, action_chain_mode M, typename A1, typename A2>
action_chain<PH, M, typename action_concatenator<A1,A2>::type>
operator, (action_chain<PH,M,A1> const & chain, A2 const & a)
{
return action_chain<PH,M,typename action_concatenator<A1,A2>::type>
( concatenate_actions(chain.action(), a) );
}
// Expression template for mutiple action chain assignments
template<class ChainOrChains, class LastChain>
class action_chains
{
ChainOrChains obj_head;
LastChain obj_tail;
public:
action_chains(ChainOrChains const & head, LastChain const & tail)
: obj_head(head), obj_tail(tail)
{ }
typedef ChainOrChains head_type;
typedef LastChain tail_type;
head_type const & head() const { return obj_head; }
tail_type const & tail() const { return obj_tail; }
};
// Action chain concatenation
template<class Head, class Tail>
action_chains<Head,Tail> make_chain(Head const & h, Tail const & t)
{ return action_chains<Head,Tail>(h,t); }
template<class PH1, action_chain_mode M1, typename A1,
class PH2, action_chain_mode M2, typename A2>
action_chains< action_chain<PH1,M1,A1>, action_chain<PH2,M2,A2> >
operator, (action_chain<PH1,M1,A1> const & h,
action_chain<PH2,M2,A2> const & t)
{ return make_chain(h,t); }
template<class Head, class Tail,class PH, action_chain_mode M, typename A>
action_chains< action_chains<Head,Tail>, action_chain<PH,M,A> >
operator, (action_chains<Head,Tail> const & h, action_chain<PH,M,A> const & t)
{ return make_chain(h,t); }
// Extract the (maybe composite) action associated with an action
// placeholders from the chains with a fold algorithm.
template<class Placeholder, typename StartAction, class NewChainOrChains>
struct placeholdee
{
typedef StartAction type;
static type get(StartAction const & a, NewChainOrChains const &)
{ return a; }
};
template<class Placeholder, // <-- non-deduced
typename StartAction, class NewChainOrChains>
typename placeholdee<Placeholder,StartAction,NewChainOrChains>::type
get_placeholdee(StartAction const & a, NewChainOrChains const & c)
{ return placeholdee<Placeholder,StartAction,NewChainOrChains>::get(a,c); }
template<class Placeholder, typename StartAction, class Head, class Tail>
struct placeholdee
< Placeholder, StartAction, action_chains<Head,Tail> >
{
typedef typename placeholdee<Placeholder,
typename placeholdee<Placeholder,StartAction,Head>::type, Tail >::type
type;
static type get(StartAction const & a, action_chains<Head,Tail> const & c)
{
return get_placeholdee<Placeholder>(
get_placeholdee<Placeholder>(a,c.head()), c.tail() );
}
};
template<class Placeholder, typename StartAction, typename A>
struct placeholdee
< Placeholder, StartAction, action_chain<Placeholder,replace,A> >
{
typedef A type;
static type get(StartAction const &,
action_chain<Placeholder,replace,A> const & c)
{ return c.action(); }
};
template<class Placeholder, typename StartAction, typename A>
struct placeholdee
< Placeholder, StartAction, action_chain<Placeholder,append,A> >
{
typedef typename action_concatenator<StartAction,A>::type type;
static type get(StartAction const & a,
action_chain<Placeholder,append,A> const & c)
{ return concatenate_actions(a,c.action()); }
};
}
BOOST_SPIRIT_CLASSIC_NAMESPACE_END
} } // namespace ::BOOST_SPIRIT_CLASSIC_NS::type_of
BOOST_TYPEOF_REGISTER_TYPE(BOOST_SPIRIT_CLASSIC_NS::type_of::nop_functor)
BOOST_TYPEOF_REGISTER_TEMPLATE(BOOST_SPIRIT_CLASSIC_NS::type_of::composite_action,2)
//------------------------------------------------------------------------------
// Misc.utilities
//------------------------------------------------------------------------------
namespace boost { namespace spirit {
BOOST_SPIRIT_CLASSIC_NAMESPACE_BEGIN
namespace type_of {
// Utility function to create a dependency to a template argument.
template<typename T, typename X>
X const & depend_on_type(X const & x)
{ return x; }
// Utility to allow use parenthesized type expressions with commas inside
// as a type within macros. Thanks to <NAME> for telling me this nice
// trick.
#define BOOST_SPIRIT_RP_TYPE(x) \
::BOOST_SPIRIT_CLASSIC_NS::type_of::remove_special_fptr \
< ::BOOST_SPIRIT_CLASSIC_NS::type_of::special_result & (*) x >::type
struct special_result;
template<typename T> struct remove_special_fptr { };
template<typename T> struct remove_special_fptr< special_result & (*)(T) >
{ typedef T type; };
}
BOOST_SPIRIT_CLASSIC_NAMESPACE_END
} } // namespace ::BOOST_SPIRIT_CLASSIC_NS::type_of
//------------------------------------------------------------------------------
#endif
//------------------------------------------------------------------------------
|
pintoXD/stm32wb55LoRaFuota
|
Middlewares/ST/STM32_WPAN/ble/mesh/Src/serial_prvn.c
|
<filename>Middlewares/ST/STM32_WPAN/ble/mesh/Src/serial_prvn.c
/**
******************************************************************************
* @file serial_prvn.c
* @date 06-12-2019
* @brief Embedded provisioner Serial Control file
******************************************************************************
* @attention
*
* <h2><center>© Copyright (c) 2020 STMicroelectronics.
* All rights reserved.</center></h2>
*
* This software component is licensed by ST under Ultimate Liberty license
* SLA0044, the "License"; You may not use this file except in compliance with
* the License. You may obtain a copy of the License at:
* www.st.com/SLA0044
*
******************************************************************************
*/
/* Includes ------------------------------------------------------------------*/
#include <string.h>
#include <stdio.h>
#include <errno.h>
#include "hal_common.h"
#include "serial_if.h"
#include "serial_ctrl.h"
#include "mesh_cfg.h"
#include "ble_mesh.h"
#include "appli_config_client.h"
#include "serial_prvn.h"
#include "appli_mesh.h"
/** @addtogroup BlueNRG_Mesh
* @{
*/
/** @addtogroup Middlewares_Serial_Interface
* @{
*/
/* Private define ------------------------------------------------------------*/
/* Private macro -------------------------------------------------------------*/
/* Private variables ---------------------------------------------------------*/
static neighbor_params_t NeighborTable[5];
static MOBLEUINT8 NoOfNeighborPresent;
static MOBLEUINT8 PrvningInProcess = 0;
static MOBLEUINT16 PrvndNodeAddress = 0;
extern MOBLEUINT16 nodeAddressOffset;
/* Private function prototypes -----------------------------------------------*/
static MOBLE_RESULT SerialPrvn_ProvisionDevice(char *text);
static MOBLE_RESULT SerialPrvn_UnProvisionDevice(char *text);
static MOBLE_RESULT SerialPrvn_ScanDevices(char *text);
/* Private functions ---------------------------------------------------------*/
/**
* @brief This function scans and prints unprovisioned devices
* @param unprovDeviceArray: Pointer of an array for filling unprovisioned device UUIDs
* @param noOfUnprovDevices: Pointer to take total count of nearby unprovisioned devices
* @retval MOBLE_RESULT
*/
__weak MOBLE_RESULT BLEMesh_ScanDevices(neighbor_params_t *unprovDeviceArray, MOBLEUINT8 *noOfUnprovDevices)
{
return MOBLE_RESULT_NOTIMPL;
}
/**
* @brief This function returns starts the provisioning of one of the devices
* @param unprovDeviceArray: Pointer of an array having unprovisioned device UUIDs
* @param index: Index of the device to be provisioned
* @retval MOBLE_RESULT
*/
__weak MOBLE_RESULT BLEMesh_ProvisionDevice(neighbor_params_t *unprovDeviceArray, MOBLEUINT16 index)
{
return MOBLE_RESULT_NOTIMPL;
}
/**
* @brief This function is used to parse the string given by the user
* @param rcvdStringBuff: buffer to store input string
* @param rcvdStringSize: length of the input string
* @retval void
*/
void SerialPrvn_Process(char *rcvdStringBuff, uint16_t rcvdStringSize)
{
MOBLE_RESULT result = MOBLE_RESULT_INVALIDARG;
/* Command to make a devices as Root node which creates Mesh network credentials */
if (!strncmp(rcvdStringBuff+COMMAND_OFFSET, "ROOT",4))
{
#if defined (ENABLE_PROVISIONER_FEATURE) || defined(DYNAMIC_PROVISIONER)
/* Initializes Mesh network parameters */
Appli_StartProvisionerMode(1);
result = MOBLE_RESULT_SUCCESS;
#endif
}
/* Command to scan the unprovisioned devices */
else if (!strncmp(rcvdStringBuff+COMMAND_OFFSET, "SCAN",4))
{
result = SerialPrvn_ScanDevices(rcvdStringBuff+COMMAND_OFFSET);
}
/* Command to start the unprovisioned devices */
else if (!strncmp(rcvdStringBuff+COMMAND_OFFSET, "PRVN-",4))
{
if(!PrvningInProcess)
{
result = SerialPrvn_ProvisionDevice(rcvdStringBuff+COMMAND_OFFSET);
}
else
{
BLEMesh_PrintStringCb("Link opened already. Wait.\r\n");
result = MOBLE_RESULT_FAIL;
}
}
else if (!strncmp(rcvdStringBuff+COMMAND_OFFSET, "UNPV",4))
{
result = SerialPrvn_UnProvisionDevice(rcvdStringBuff+COMMAND_OFFSET);
}
/* Command to start the unprovisioned devices */
else if (!strncmp(rcvdStringBuff+COMMAND_OFFSET, "RESET",5))
{
BLEMesh_PrintStringCb("Reseting Board...\r\n");
NVIC_SystemReset();
}
/* Command to scan the unprovisioned devices - Used By node only */
else if (!strncmp(rcvdStringBuff+COMMAND_OFFSET, "NDSCAN",4))
{
result = BLEMesh_ScanDevices(NeighborTable, &NoOfNeighborPresent);
}
/* Command to start the unprovisioned devices - Used By node only */
else if (!strncmp(rcvdStringBuff+COMMAND_OFFSET, "NDPRVN-",4))
{
MOBLEINT16 index = 0;
sscanf(rcvdStringBuff, "PRVN-%hd", &index);
result = BLEMesh_ProvisionDevice(NeighborTable, index);
}
else
{
BLEMesh_PrintStringCb("Invalid Command\r\n");
return;
}
/* Check the result of command processing */
if(result == MOBLE_RESULT_SUCCESS)
{
BLEMesh_PrintStringCb("Test command executed successfully\r\n");
}
else if(result == MOBLE_RESULT_OUTOFMEMORY)
{
BLEMesh_PrintStringCb("Test command Failed. Out of memory\r\n");
}
else if(result == MOBLE_RESULT_INVALIDARG)
{
BLEMesh_PrintStringCb("Test command Failed. Invalid Argument\r\n");
}
else
{
BLEMesh_PrintStringCb("Test command Failed.\r\n");
}
}
/**
* @brief This function returns starts the provisioning of one of the devices
* @param text: received array
* @retval MOBLE_RESULT
*/
static MOBLE_RESULT SerialPrvn_ProvisionDevice(char *text)
{
MOBLE_RESULT result = MOBLE_RESULT_SUCCESS;
#if defined (ENABLE_PROVISIONER_FEATURE) || defined(DYNAMIC_PROVISIONER)
MOBLEINT16 index = 0;
// MOBLEINT16 na = 0;
// sscanf(text, "PRVN-%hd %hd", &index, &na);
sscanf(text, "PRVN-%hd", &index);
// if(na>1)
{ /* Address 1 is reserved for the Provisioner */
result = BLEMesh_ProvisionRemote(NeighborTable[index].uuid);
/* Make copy of the UUID */
memcpy (NodeUnderProvisionParam.NewProvNodeUUID,
NeighborTable[index].uuid,
UUID_SIZE);
}
// else
// {
// result = MOBLE_RESULT_INVALIDARG;
// }
#endif
return result;
}
/**
* @brief This function Un-Provision one of the devices
* @param text: received array
* @retval MOBLE_RESULT
*/
static MOBLE_RESULT SerialPrvn_UnProvisionDevice(char *text)
{
MOBLEINT16 na = 0;
MOBLE_RESULT result = MOBLE_RESULT_SUCCESS;
sscanf(text, "UNPV %hd", &na);
if(na>1)
{
result = ConfigClient_NodeReset(na);
}
else
{
result = MOBLE_RESULT_INVALIDARG;
}
return result;
}
/**
* @brief This function scans and prints unprovisioned devices
* @param text: received array
* @retval MOBLE_RESULT
*/
static MOBLE_RESULT SerialPrvn_ScanDevices(char *text)
{
MOBLE_RESULT result;
result = BLEMesh_GetNeighborState(NeighborTable,&NoOfNeighborPresent);
/* Check if any unprovisioned device is available */
if(!NoOfNeighborPresent)
{
TRACE_I(TF_PROVISION,"No Unprovisioned Device Nearby\r\n");
}
else
{
for(MOBLEINT8 count=0; count < NoOfNeighborPresent; count++)
{
BLEMesh_PrintStringCb("");
TRACE_I(TF_PROVISION,"Device-%d -> ", count);
BLEMesh_PrintDataCb(NeighborTable[count].uuid, 16);
}
}
return result;
}
/**
* @brief This funcrion is used to update the status of the provisioning
* @retval void
*/
void SerialPrvn_ProvisioningStatusUpdateCb(uint8_t flagPrvningInProcess, MOBLEUINT16 nodeAddress)
{
PrvningInProcess = flagPrvningInProcess;
PrvndNodeAddress = nodeAddress;
}
/**
* @}
*/
/**
* @}
*/
/******************* (C) COPYRIGHT 2020 STMicroelectronics *****END OF FILE****/
|
UsernameForGerman/tiktune
|
src/comp/Desktop/Trends/TrendsPageContainer.js
|
<reponame>UsernameForGerman/tiktune
import TrendsPage from "./TrendsPage";
import React, {useEffect} from "react";
import {connect} from "react-redux";
import trendsSelector from "../../../selectors/trendsSelector";
import {getTrendSongsThunk} from "../../../reducers/trendsReducer";
import renderList from "../../../utils/desktopRenderer";
let TrendsPageContainer = (props) => {
useEffect(() => {
props.getTrends();
}, props.songsList.length);
let list = renderList(props.songsList);
window.scrollTo(0,0);
return(
<TrendsPage list={list} isFetching={props.isFetching}/>
)
}
let mapStateToProps = (state) => {
return {
isFetching : trendsSelector.isFetching(state),
songsList : trendsSelector.getList(state),
err : trendsSelector.getError(state)
}
}
let mapDispatchToProps = (dispatch) => {
return {
getTrends : () => {
dispatch(getTrendSongsThunk())
}
}
}
export default connect(mapStateToProps, mapDispatchToProps)(TrendsPageContainer);
|
slusek/OG-Platform
|
projects/OG-Engine/src/test/java/com/opengamma/engine/view/compilation/InvalidTargetDependencyNodeFilterTest.java
|
/**
* Copyright (C) 2013 - present by OpenGamma Inc. and the OpenGamma group of companies
*
* Please see distribution for license.
*/
package com.opengamma.engine.view.compilation;
import static org.testng.Assert.assertFalse;
import static org.testng.Assert.assertTrue;
import java.util.Set;
import org.testng.annotations.Test;
import com.google.common.collect.ImmutableSet;
import com.opengamma.engine.ComputationTargetSpecification;
import com.opengamma.engine.depgraph.DependencyNode;
import com.opengamma.engine.target.ComputationTargetType;
import com.opengamma.id.UniqueId;
import com.opengamma.util.test.TestGroup;
/**
* Unit test for the {@link InvalidTargetDependencyNodeFilter} class.
*/
@Test(groups = TestGroup.UNIT)
public class InvalidTargetDependencyNodeFilterTest {
public void testAccept() {
final Set<UniqueId> invalid = ImmutableSet.of(UniqueId.of("Sec", "1"), UniqueId.of("Pos", "2"), UniqueId.of("Pos", "3", "X"));
final InvalidTargetDependencyNodeFilter filter = new InvalidTargetDependencyNodeFilter(invalid);
assertTrue(filter.accept(new DependencyNode(new ComputationTargetSpecification(ComputationTargetType.POSITION, UniqueId.of("Pos", "1")))));
assertFalse(filter.accept(new DependencyNode(new ComputationTargetSpecification(ComputationTargetType.POSITION, UniqueId.of("Pos", "2")))));
assertTrue(filter.accept(new DependencyNode(new ComputationTargetSpecification(ComputationTargetType.POSITION, UniqueId.of("Pos", "2", "V")))));
assertTrue(filter.accept(new DependencyNode(new ComputationTargetSpecification(ComputationTargetType.POSITION, UniqueId.of("Pos", "3")))));
assertFalse(filter.accept(new DependencyNode(new ComputationTargetSpecification(ComputationTargetType.POSITION, UniqueId.of("Pos", "3", "X")))));
assertTrue(filter.accept(new DependencyNode(new ComputationTargetSpecification(ComputationTargetType.POSITION, UniqueId.of("Pos", "3", "Y")))));
assertTrue(filter.accept(new DependencyNode(ComputationTargetSpecification.NULL)));
}
}
|
iamandyjones/spotter-app
|
src/components/WorkoutForm.js
|
<gh_stars>0
import React, { Component, Fragment } from 'react';
import PropTypes from 'prop-types';
import { Redirect } from 'react-router-dom';
import Dialog from './Dialog';
import TextField from './TextField';
class WorkoutForm extends Component {
constructor(props){
super(props);
this.state = { title: this.props.title || '', redirectToWorkout: null };
this.handleSubmit = this.handleSubmit.bind(this);
this.handleTitleChange = this.handleTitleChange.bind(this);
this.triggerNotification = this.triggerNotification.bind(this);
this.handleFormClose = this.handleFormClose.bind(this);
}
handleSubmit(){
this.props.onFormSubmit({ title: this.state.title })
.then(id => this.setState({ redirectToWorkout: id }, this.triggerNotification))
.catch(err => console.log(err));
}
handleTitleChange(e){
this.setState({title: e.target.value});
}
triggerNotification(){
this.props.onNotify(`${this.state.title} workout ${this.props.id ? 'updated' : 'added'}`);
}
handleFormClose(){
if(this.props.id){
this.setState({ redirectToWorkout: this.props.id });
} else {
this.props.onFormClose();
}
}
render(){
const { id } = this.props;
const submitText = id ? 'Edit' : 'Create';
const titleText = id ? 'Edit' : 'New';
return (
<Fragment>
<Dialog
onCancel={this.handleFormClose}
onSubmit={this.handleSubmit}
title={titleText + " Workout"}
labelCancel="Cancel"
labelSubmit={submitText}>
<TextField
label="What are you training today?"
id="title"
name="title"
value={this.state.title}
onValueChange={this.handleTitleChange}
autoFocus
/>
</Dialog>
{this.state.redirectToWorkout && <Redirect push={id ? false : true} to={`/workouts/${this.state.redirectToWorkout}`} />}
</Fragment>
)
}
}
WorkoutForm.propTypes = {
id: PropTypes.string,
title: PropTypes.string,
onFormSubmit: PropTypes.func.isRequired,
onFormClose: PropTypes.func,
onNotify: PropTypes.func.isRequired
}
export default WorkoutForm;
|
HeRaNO/OI-ICPC-Codes
|
UESTC/2503.cpp
|
#include <bits/stdc++.h>
using namespace std;
int n,x;
int main()
{
scanf("%d",&n);
for (int i=1;i<=n;i++)
{
scanf("%d",&x);
if (x&1) return puts("Alice"),0;
}
puts("Bob");
return 0;
}
|
yeeeeeeti/3D_feature_extract
|
src/asiUI/datum/asiUI_DatumViewBase.cpp
|
//-----------------------------------------------------------------------------
// Created on: 22 February 2019
//-----------------------------------------------------------------------------
// Copyright (c) 2019-present, <NAME>, <NAME>
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are met:
//
// * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above copyright
// notice, this list of conditions and the following disclaimer in the
// documentation and/or other materials provided with the distribution.
// * Neither the name of the copyright holder(s) nor the
// names of all contributors may be used to endorse or promote products
// derived from this software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
// DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE FOR ANY
// DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//-----------------------------------------------------------------------------
// asiUI includes
#include <asiUI_Common.h>
#include <asiUI_DatumViewBase.h>
#include <asiUI_DatumViewItem.h>
#include <asiUI_ItemRoles.h>
// asiAlgo includes
#include <asiAlgo_DictionaryItem.h>
#include <asiAlgo_Dictionary.h>
// Qt includes
#pragma warning(push, 0)
#include <QKeyEvent>
#include <QApplication>
#include <QAbstractProxyModel>
#include <QStandardItem>
#include <QTreeView>
#include <QTableView>
#include <QAbstractProxyModel>
#pragma warning(pop)
//! Default constructor.
//! Initialization of common functionality.
//! \param theFactory [in] the widget factory to instantiate datum editors.
//! \param theParent [in] parent widget to take ownership of the view.
template <typename ParentItemViewClass>
asiUI_DatumViewBase<ParentItemViewClass>::asiUI_DatumViewBase(QWidget* theParent)
: ParentItemViewClass(theParent),
m_bShowUnits(true)
{
}
//! Get flag indicating whether the datum editor's units should be
//! displayed in headers.
//! The column(row) headers use dictionary labels of the column(row) datums.
//! If the headers uses user-defined labels, the units are not shown.
//! \return the boolean flag.
template <typename ParentItemViewClass>
bool asiUI_DatumViewBase<ParentItemViewClass>::IsShowUnitsInLabel() const
{
return m_bShowUnits;
}
//! Set flag indicating whether the datum editor's units should be
//! displayed in headers.
//! If the header uses user-defined labels, the units are not shown.
//! The column(row) headers use dictionary labels of the column(row) datums.
//! By default, this option is switched on.
//! \param theIsShown [in] the boolean flag.
template <typename ParentItemViewClass>
void asiUI_DatumViewBase<ParentItemViewClass>::SetShowUnitsInLabel(const bool theIsShown)
{
m_bShowUnits = theIsShown;
refreshUnitsInLabels();
}
//! Access value conversion datum instance associated with the specified
//! model index. This methods is used by data model layer to access datum
//! as value formatting and conversion tool.
//! \param theIndex [in] the model index.
template <typename ParentItemViewClass>
asiUI_Datum* asiUI_DatumViewBase<ParentItemViewClass>::AccessViewDatum(const QModelIndex& theIndex)
{
if ( !theIndex.isValid() )
return NULL;
actualizeDatum(theIndex);
QString aDatumId = m_ActualDatumMap.value( theIndex, QString() );
if ( aDatumId.isNull() )
return NULL;
return m_DatumEntityMap.value(aDatumId, NULL);
}
//! Return datum dictionary identification string assigned
//! for the specified item model index.
//! \param theIndex [in] the item model index.
//! \return data dictionary id, or empty string if no datum assigned.
template <typename ParentItemViewClass>
QString asiUI_DatumViewBase<ParentItemViewClass>::DatumId(const QModelIndex& theIndex) const
{
return this->getItemDatum(theIndex);
}
//! Return datum dictionary identification string assigned for the specified header index.
//! \param theHeader [in] the header type.
//! \param theIndex [in] the item model index.
//! \return data dictionary id, or empty string if no datum assigned.
template <typename ParentItemViewClass>
QString asiUI_DatumViewBase<ParentItemViewClass>::HeaderDatumId(const Qt::Orientation theHeader,
const asiUI_HeaderIndex& theIndex) const
{
return this->getHeaderDatum(theHeader, theIndex);
}
//! Access widget factory to create datum instances.
template <typename ParentItemViewClass>
Handle(asiUI_WidgetFactory) asiUI_DatumViewBase<ParentItemViewClass>::AccessFactory() const
{
return this->widgetFactory();
}
//! Enable editing items by a single click.
//! By default, the edit by a single click is enabled.
//! \param theIsEdit [in] boolean flag indicating whether the single click
//! editing is enabled or not.
template <typename ParentItemViewClass>
void asiUI_DatumViewBase<ParentItemViewClass>::SetEditByClick(const bool theIsEdit) const
{
m_pEventHandler->EnableEditByClickHandling(theIsEdit);
}
//! Return signal event handler for attaching unit change signal by widget factory.
//! \return the associated event handler.
template <typename ParentItemViewClass>
asiUI_DatumViewEventHandler* asiUI_DatumViewBase<ParentItemViewClass>::GetEventHandler() const
{
return m_pEventHandler;
}
//! Process notification from datum view delegate notifying that the
//! editor has been created and used.
//! \param theEditor [in] the created editor.
//! \param theIndex [in] the edited model index.
template <typename ParentItemViewClass>
void asiUI_DatumViewBase<ParentItemViewClass>::NotifyDelegateEditorCreated(
QWidget* theEditor,
const QModelIndex& theIndex)
{
m_EditorMap.insert(theIndex, theEditor);
this->showStatusTip(theIndex);
this->emitValueChanging(theIndex, theEditor);
}
//! Process notification from datum view delegate notifying
//! that the custom selector is triggered.
//! \param theIndex [in] the edited model index.
template <typename ParentItemViewClass>
void asiUI_DatumViewBase<ParentItemViewClass>::NotifyCustomSelectorTriggered(
const QModelIndex& theIndex)
{
this->emitCustomSelectorTriggered(theIndex);
}
//! Notification method, tells that local system of units has changed, so the
//! contents of datum view should be refreshed.
template <typename ParentItemViewClass>
void asiUI_DatumViewBase<ParentItemViewClass>::NotifyUnitsChanged()
{
this->updateItems(true);
this->updateHeaderItems();
this->refreshUnitsInLabels();
}
//! Checks if there any proxy set for the datum view internal data.
//! \return TRUE if proxy model was set.
template <typename ParentItemViewClass>
bool asiUI_DatumViewBase<ParentItemViewClass>::IsProxyModel() const
{
if ( qobject_cast<QAbstractProxyModel*>( model() ) )
{
return true;
}
return false;
}
//! Set new item prototype.
//! Recursively changes prototype of already created model items.
//! \param thePrototype [in] the item prototype.
template <typename ParentItemViewClass>
void asiUI_DatumViewBase<ParentItemViewClass>::setItemPrototype(
const asiUI_DatumViewItem* thePrototype)
{
asiUI_DatumViewModel* anItemModel = itemModel();
anItemModel->setItemPrototype(thePrototype);
anItemModel->SetHeaderItemPrototype(thePrototype);
resetItemPrototype(anItemModel->invisibleRootItem(), thePrototype);
}
//! Access item from the specified index.
//! \param theIndex [in] the index to access the item.
//! \return item under the specified model index.
template <typename ParentItemViewClass>
asiUI_DatumViewItem* asiUI_DatumViewBase<ParentItemViewClass>::accessItem(
const QModelIndex& theIndex) const
{
asiUI_DatumViewModel* aModel = itemModel();
QStandardItem* anItem = aModel->itemFromIndex(theIndex);
if ( theIndex.isValid() && anItem == NULL )
{
aModel->setData( theIndex, QVariant() ); // init item internally
anItem = aModel->itemFromIndex(theIndex);
}
return dynamic_cast<asiUI_DatumViewItem*>(anItem);
}
//! Get interface to implementation of internal item model.
//! \return pointer to data model of appropriate type.
template <typename ParentItemViewClass>
asiUI_DatumViewModel* asiUI_DatumViewBase<ParentItemViewClass>::itemModel() const
{
return itemModel( model() );
}
//! Access item model wrapped by the given proxy model.
//! \param theModel [in] the proxy model.
//! \return item model or this if the given model is not a proxy.
template <typename ParentItemViewClass>
asiUI_DatumViewModel* asiUI_DatumViewBase<ParentItemViewClass>::itemModel(QAbstractItemModel* theModel) const
{
asiUI_DatumViewModel* aModelStandard = qobject_cast<asiUI_DatumViewModel*>(theModel);
if ( aModelStandard )
{
return aModelStandard;
}
QAbstractProxyModel* aQtModernProxy = qobject_cast<QAbstractProxyModel*>(theModel);
if ( aQtModernProxy )
{
return qobject_cast<asiUI_DatumViewModel*>( aQtModernProxy->sourceModel() );
}
return NULL;
}
//! Returns source index from the proxy model.
//! \param theProxy [in] the proxy index.
//! \return index source.
template <typename ParentItemViewClass>
QModelIndex asiUI_DatumViewBase<ParentItemViewClass>::sourceIndex(const QModelIndex& theProxy) const
{
if ( theProxy.model() == itemModel() )
{
return theProxy;
}
if ( theProxy.model() != model() )
{
return theProxy;
}
QAbstractProxyModel* aQtModernProxy = qobject_cast<QAbstractProxyModel*>( model() );
if ( aQtModernProxy )
{
return aQtModernProxy->mapToSource(theProxy);
}
return theProxy;
}
//! Initialize model and internal delegate and item types.
//! Call this method from constructor to set initial model, delegate type and prototype.
//! \param theCreator [in] the widget factory.
//! \param theItemModel [in] the model for data items.
//! \param thePrototype [in] the model items prototype.
//! \param theDelegate [in] the model editing delegate.
template <typename ParentItemViewClass>
void asiUI_DatumViewBase<ParentItemViewClass>::init(const Handle(asiUI_WidgetFactory)& theCreator,
asiUI_DatumViewModel* theItemModel,
asiUI_DatumViewItem* thePrototype,
asiUI_DatumViewDelegate* theDelegate)
{
m_pWidgetFactory = theCreator;
m_pEventHandler = new asiUI_DatumViewEventHandler(this);
setVerticalScrollMode(QAbstractItemView::ScrollPerPixel);
setHorizontalScrollMode(QAbstractItemView::ScrollPerPixel);
setSelectionBehavior(QAbstractItemView::SelectItems);
setSelectionMode(QAbstractItemView::ExtendedSelection);
setTabKeyNavigation(true);
setStyle( new asiUI_ViewStyleProxy(NULL) );
setEditTriggers(QAbstractItemView::EditKeyPressed |
QAbstractItemView::DoubleClicked |
QAbstractItemView::AnyKeyPressed);
SetEditByClick(false);
if ( theItemModel )
{
theItemModel->setParent(this);
setModel(theItemModel);
}
if ( theDelegate )
{
theDelegate->setParent(this);
setItemDelegate(theDelegate);
}
if ( thePrototype )
{
setItemPrototype(thePrototype);
}
}
//! Sets model and installs expanded header selection model.
//! \param theModel [in] the model.
template <typename ParentItemViewClass>
void asiUI_DatumViewBase<ParentItemViewClass>::setModel(QAbstractItemModel* theModel)
{
ParentItemViewClass::setModel(theModel);
asiUI_DatumViewSelectionModel* aSelectionModel = new asiUI_DatumViewSelectionModel( model() );
aSelectionModel->setParent(this);
connect( model(), SIGNAL( destroyed() ), aSelectionModel, SLOT( deleteLater() ) );
setSelectionModel(aSelectionModel);
}
//! Get value for datum view item's index.
//! If the datum is assigned, the returned value is the one converted to the SI
//! unit system. This value can differ with the displayed string.
//! \param theIndex [in] the item model index.
//! \return SI unit system value or 0 if invalid index specified.
template <typename ParentItemViewClass>
QVariant asiUI_DatumViewBase<ParentItemViewClass>::getValue(const QModelIndex& theIndex) const
{
QStandardItem* anItem = itemModel()->itemFromIndex(theIndex);
if ( !anItem )
return QVariant();
return anItem->data(DatumViewRole_ModelValue);
}
//! Set value for datum view item's index.
//! If the datum is assigned, the value will be considered as the one converted to the
//! SI unit system. This value can differ with the displayed string.
//! \param theIndex [in] the item model index.
//! \param theValue [in] the SI unit system value.
template <typename ParentItemViewClass>
void asiUI_DatumViewBase<ParentItemViewClass>::setValue(const QModelIndex& theIndex,
const QVariant& theValue)
{
if ( !theIndex.isValid() )
return;
itemModel()->setData(theIndex, theValue, DatumViewRole_ModelValue);
}
//! Get displayed string for datum view item's index.
//! The value corresponds to the editor's contents that corresponds to the value
//! converted to local unit system.
//! \param theIndex [in] the item model index.
//! \return displayed string or null string if invalid index is specified
template <typename ParentItemViewClass>
QString asiUI_DatumViewBase<ParentItemViewClass>::getString(const QModelIndex& theIndex) const
{
QStandardItem* anItem = itemModel()->itemFromIndex(theIndex);
if ( !anItem )
return QString();
return anItem->data(Qt::DisplayRole).toString();
}
//! Set displayed string for datum view item's index.
//! The value corresponds to the editor's contents which is a value converted
//! to local unit system.
//! \param theIndex [in] the item model index.
//! \param theString [in] the string to set.
template <typename ParentItemViewClass>
void asiUI_DatumViewBase<ParentItemViewClass>::setString(const QModelIndex& theIndex,
const QString& theString)
{
if ( !theIndex.isValid() )
return;
itemModel()->setData(theIndex, theString, Qt::DisplayRole);
}
//! Access widget factory instance.
//! \return shared pointer to the widget factory instance.
template <typename ParentItemViewClass>
Handle(asiUI_WidgetFactory) asiUI_DatumViewBase<ParentItemViewClass>::widgetFactory() const
{
return m_pWidgetFactory;
}
//! Update every item state, displayed and internal data.
//! \param theSkipEdited [in] the boolean flag that defines whether
//! the edited item should be skipped or not.
template <typename ParentItemViewClass>
void asiUI_DatumViewBase<ParentItemViewClass>::updateItems(const bool theSkipEdited)
{
QModelIndexList aIndexes;
collectIndexes( QModelIndex(), aIndexes, true );
updateItems(aIndexes, theSkipEdited);
}
//! Update every item of the extended header views.
//! The method is usually called when overall refresh is
//! requested, e.g. on changing system of units.
template <typename ParentItemViewClass>
void asiUI_DatumViewBase<ParentItemViewClass>::updateHeaderItems()
{
asiUI_DatumViewModel* aItemModel = itemModel();
for ( int aCol = 0; aCol < aItemModel->columnCount(); ++aCol )
{
// update items of horizontal band header view
for ( int aBandRow = 0; aBandRow < aItemModel->BandRowsCount(Qt::Horizontal); ++aBandRow )
{
asiUI_HeaderIndex aIndex = asiUI_HeaderIndex::Band(aCol, aBandRow);
asiUI_DatumViewItem* aDatumItem =
dynamic_cast<asiUI_DatumViewItem*>( aItemModel->HeaderItem(Qt::Horizontal, aIndex) );
if ( !aDatumItem )
{
continue;
}
aDatumItem->Update();
}
}
for ( int aRow = 0; aRow < aItemModel->rowCount(); ++aRow )
{
// update items of vertical band header view
for ( int aBandRow = 0; aBandRow < aItemModel->BandRowsCount(Qt::Vertical); ++aBandRow )
{
asiUI_HeaderIndex aIndex = asiUI_HeaderIndex::Band(aRow, aBandRow);
asiUI_DatumViewItem* aDatumItem =
dynamic_cast<asiUI_DatumViewItem*>( aItemModel->HeaderItem(Qt::Vertical, aIndex) );
if ( !aDatumItem )
{
continue;
}
aDatumItem->Update();
}
}
}
//! Update item state, displayed and internal data for the specified
//! model indexes list.
//! \param theIndexes [in] the list of indexes to update.
//! \param theSkipEdited [in] the boolean flag that defines whether
//! the edited item should be skipped or not.
template <typename ParentItemViewClass>
void asiUI_DatumViewBase<ParentItemViewClass>::updateItems(
const QModelIndexList& theIndexes,
const bool theSkipEdited)
{
// Increase performance by avoiding view updates when changing single item
bool isModelBlocked = ParentItemViewClass::model()->blockSignals(true);
QModelIndexList::ConstIterator anIt = theIndexes.constBegin();
for ( ; anIt != theIndexes.constEnd(); anIt++ )
{
asiUI_DatumViewItem* anItem = accessItem(*anIt);
if ( !anItem )
continue;
actualizeDatum(*anIt);
if ( !theSkipEdited || !m_EditorMap.contains(*anIt) )
anItem->Update();
}
// Unblock model and update view with single call
ParentItemViewClass::model()->blockSignals(isModelBlocked);
}
//! Generate appropriate label string by the
//! dictionary id and title string specified.
//! \param theDictId [in] dictionary id of associated editor.
//! \param theTitle [in] the user-override title.
//! \return generated label string.
template <typename ParentItemViewClass>
QString asiUI_DatumViewBase<ParentItemViewClass>::labelString(
const QString& theDictId,
const QString& theTitle) const
{
bool isUnits = IsShowUnitsInLabel();
QString aLabel = theTitle;
QString aUnits = QString();
if ( theTitle.isEmpty() || isUnits )
{
Handle(asiAlgo_DictionaryItem) anItem =
asiAlgo_Dictionary::GetDictionaryItem( QStr2ExtStr(theDictId) );
if ( theTitle.isNull() )
{
aLabel = anItem.IsNull() ?
QString() : ExtStr2QStr( anItem->GetLabel() );
}
if ( isUnits && !anItem.IsNull() )
{
aUnits = AsciiStr2QStr( anItem->GetUnits() );
}
}
if ( !aUnits.isEmpty() )
aLabel += " [" + aUnits + "]";
return aLabel;
}
//! Actualize datum conversion entity created for internal data conversion
//! for the specified model index.
//! Create new datums if not yet instantiated and removes outdated datums.
//! \param theIndex [in] the item model index to refresh the datum for.
template <typename ParentItemViewClass>
void asiUI_DatumViewBase<ParentItemViewClass>::actualizeDatum(const QModelIndex& theIndex)
{
QString aRequiredDatum = getItemDatum(theIndex);
QString aPrevDatum = m_ActualDatumMap.value(theIndex, QString() );
// the same datum as already registered
if ( !aRequiredDatum.isNull() && aPrevDatum == aRequiredDatum )
{
return;
}
// --------------------------------------------------------------------------
// this code executes only if datum definition is outdated, or changed
// --------------------------------------------------------------------------
// remove old, outdated value conversion datum
if ( !aPrevDatum.isNull() && aPrevDatum != aRequiredDatum )
{
m_ActualDatumMap.remove(theIndex);
Datum2IndexList::Iterator anIt = m_ActualDatumRefs.find(aPrevDatum);
if ( anIt != m_ActualDatumRefs.end() )
{
// decrease references
IndexList& aIndexList = *anIt;
aIndexList.removeAll(theIndex);
// if no more references - remove
if ( aIndexList.size() == 0 )
m_ActualDatumRefs.remove(aPrevDatum);
}
// release memory if not needed
if ( !m_ActualDatumRefs.contains(aPrevDatum)
&& m_DatumEntityMap.contains(aPrevDatum) )
{
m_DatumEntityMap.take(aPrevDatum)->deleteLater();
}
}
// datum of the required type is already created,
// just add a new reference
if ( m_DatumEntityMap.contains(aRequiredDatum) )
{
m_ActualDatumMap.insert(theIndex, aRequiredDatum);
m_ActualDatumRefs[aRequiredDatum].append(theIndex);
return;
}
// --------------------------------------------------------------------------
// this block is case of creating new value conversion datum instance
// --------------------------------------------------------------------------
// create new instance, register and return it
asiUI_Datum* aNewDatum = widgetFactory()->CreateEditor(aRequiredDatum, this, asiUI_Datum::Control);
if ( aNewDatum )
{
aNewDatum->Hide();
m_ActualDatumMap.insert(theIndex, aRequiredDatum);
m_ActualDatumRefs.insert(aRequiredDatum, IndexList() );
m_ActualDatumRefs[aRequiredDatum].append(theIndex);
m_DatumEntityMap.insert(aRequiredDatum, aNewDatum);
}
}
//! Invoked when data model data changes.
//! \param theTopLeft [in] the top left index of the changed range.
//! \param theBottomRight [in] the bottom right index of the changed range.
template <typename ParentItemViewClass>
void asiUI_DatumViewBase<ParentItemViewClass>::dataChanged(
const QModelIndex &theTopLeft,
const QModelIndex &theBottomRight,
const QVector<int> &roles)
{
ParentItemViewClass::dataChanged(theTopLeft, theBottomRight, roles);
QModelIndex aSrcIndex = sourceIndex(theTopLeft);
this->emitValueChanged( aSrcIndex, aSrcIndex.data(DatumViewRole_ModelValue) );
}
//! Unregister editors.
//! \param theEditor [in] the editor.
//! \param theEndHint [in] closing hint.
template <typename ParentItemViewClass>
void asiUI_DatumViewBase<ParentItemViewClass>::closeEditor(
QWidget* theEditor,
QAbstractItemDelegate::EndEditHint theEndHint)
{
QModelIndex aCurIndex;
Index2EditorMap::Iterator aMapIt = m_EditorMap.begin();
for ( ; aMapIt != m_EditorMap.end(); aMapIt++ )
{
if ( theEditor == aMapIt.value() )
{
aCurIndex = aMapIt.key();
m_EditorMap.erase(aMapIt);
break;
}
}
ParentItemViewClass::closeEditor(theEditor, theEndHint);
this->hideStatusTip(aCurIndex);
this->emitDatumClosed(aCurIndex, theEditor);
}
//! Emit selection change signal to listeners.
//! \param theSelected [in] the selected items.
//! \param theDeselected [in] the deselected items.
template <typename ParentItemViewClass>
void asiUI_DatumViewBase<ParentItemViewClass>::selectionChanged(
const QItemSelection& theSelected,
const QItemSelection& theDeselected)
{
QAbstractItemView::selectionChanged(theSelected, theDeselected);
this->emitSelectionChanged(theSelected, theDeselected);
}
//! Handle backspace key appropriately for editing purposes.
//! \param theEvent [in] the event.
template <typename ParentItemViewClass>
void asiUI_DatumViewBase<ParentItemViewClass>::keyPressEvent(QKeyEvent *theEvent)
{
switch ( theEvent->key() )
{
case Qt::Key_Backspace :
{
if ( edit( currentIndex(), AnyKeyPressed, theEvent ) )
theEvent->ignore();
else
theEvent->accept();
break;
}
case Qt::Key_Enter :
case Qt::Key_Return :
{
if ( state() != EditingState )
{
if ( theEvent->modifiers() == Qt::ShiftModifier )
setCurrentIndex( moveCursor( QAbstractItemView::MovePrevious, Qt::NoModifier) );
else
setCurrentIndex( moveCursor( QAbstractItemView::MoveNext, Qt::NoModifier) );
}
break;
}
default:
ParentItemViewClass::keyPressEvent(theEvent);
}
}
//! Triggered when modification starts on any cell of datum view.
//! \param theIndex [in] the index of triggered item.
template <typename ParentItemViewClass>
void asiUI_DatumViewBase<ParentItemViewClass>::showStatusTip(const QModelIndex& theIndex)
{
QString aTip = itemModel()->data(theIndex, DatumViewRole_StatusUnits).toString();
QStatusTipEvent aTipEvent(aTip);
QApplication::sendEvent(this->parent(), &aTipEvent);
}
//! Triggered when modification finishes on any cell of datum view.
//! \param theIndex [in] the index of triggered item.
template <typename ParentItemViewClass>
void asiUI_DatumViewBase<ParentItemViewClass>::hideStatusTip(const QModelIndex& theIndex)
{
asiUI_NotUsed(theIndex);
QString aTip = QString::null;
QStatusTipEvent aTipEvent(aTip);
QApplication::sendEvent(this->parent(), &aTipEvent);
}
//! Reset internal data and table state.
template <typename ParentItemViewClass>
void asiUI_DatumViewBase<ParentItemViewClass>::Reset()
{
if ( itemModel() )
{
itemModel()->clear();
}
ParentItemViewClass::reset();
}
//! Forces update of data loaded from model.
//! You can use this method in pair with blocked
//! update of item model.
template <typename ParentItemViewClass>
void asiUI_DatumViewBase<ParentItemViewClass>::RefreshData()
{
this->updateEditorData();
this->doItemsLayout();
}
//! Resets item prototypes of child items created for the specified root.
//! \param theRoot [in] the root item.
//! \param thePrototype [in] the prototype to replace with.
template <typename ParentItemViewClass>
void asiUI_DatumViewBase<ParentItemViewClass>::resetItemPrototype(
QStandardItem* theRoot,
const asiUI_DatumViewItem* thePrototype) const
{
QStandardItem* aRootToReplace = thePrototype->clone();
int aRows = theRoot->rowCount();
int aCols = theRoot->columnCount();
aRootToReplace->setRowCount(aRows);
aRootToReplace->setColumnCount(aCols);
for ( int aRowIt = 0; aRowIt < aRows; aRowIt++ )
{
for ( int aColIt = 0; aColIt < aCols; aColIt++ )
{
// change item type to prototype first
QStandardItem* aToReset = theRoot->takeChild(aRowIt, aColIt);
if ( !aToReset )
continue;
// replace bottom level childs directly
if ( !aToReset->hasChildren() )
{
theRoot->setChild( aRowIt, aColIt, thePrototype->clone() );
}
else
{
resetItemPrototype(aToReset, thePrototype);
}
// reparent child to new prototype root
aRootToReplace->setChild(aRowIt, aColIt, aToReset);
}
}
// replace root where possible
QStandardItem* aRootParent = theRoot->parent();
if ( !aRootParent )
return;
int aRootRow = theRoot->row();
int aRootCol = theRoot->column();
aRootParent->takeChild(aRootRow, aRootCol);
aRootParent->setChild(aRootRow, aRootCol, aRootToReplace);
}
//! Collect list of model indexes persistent in data model.
//! \param theParentIndex [in] the parent index to start from.
//! \param theIndexes [out] list of collected indexes.
//! \param theIsRecursive [in] boolean flag defines whether the
//! indexes should be collected for subchildrens or not.
template <typename ParentItemViewClass>
void asiUI_DatumViewBase<ParentItemViewClass>::collectIndexes(
const QModelIndex& theParentIndex,
QModelIndexList& theIndexes,
const bool theIsRecursive) const
{
QStandardItem* aParentItem = theParentIndex.isValid() ?
itemModel()->itemFromIndex(theParentIndex) :
itemModel()->invisibleRootItem();
const int aRows = aParentItem->rowCount();
const int aCols = aParentItem->columnCount();
for ( int aRowIt = 0; aRowIt < aRows; aRowIt++ )
{
for ( int aColIt = 0; aColIt < aCols; aColIt++ )
{
QModelIndex aChildAt = aParentItem->child(aRowIt, aColIt)->index();
theIndexes.append(aChildAt);
if ( theIsRecursive )
collectIndexes(aChildAt, theIndexes, true);
}
}
}
// ============================================================================
// Base layer signals and events handler
// ============================================================================
//! Default constructor.
//! \param theHandled [in] the handled item view.
asiUI_DatumViewEventHandler::asiUI_DatumViewEventHandler(QAbstractItemView* theHandled)
: QObject(theHandled)
{
//
}
//! Enabled or disable edit by click mode handling.
//! \param theIsEnabled [in] boolean flag that turns on/off the handling state.
void asiUI_DatumViewEventHandler::EnableEditByClickHandling(const bool theIsEnabled)
{
QAbstractItemView* aView = qobject_cast<QAbstractItemView*>( parent() );
if ( !aView )
return;
if ( theIsEnabled )
{
connect( aView, SIGNAL( pressed(const QModelIndex&) ),
this, SLOT( onItemPressed(const QModelIndex&) ) );
connect( aView, SIGNAL(activated(const QModelIndex&) ),
this, SLOT( onItemActivated(const QModelIndex&) ) );
}
else
{
disconnect( aView, SIGNAL( pressed(const QModelIndex&) ),
this, SLOT( onItemPressed(const QModelIndex&) ) );
disconnect( aView, SIGNAL( activated(const QModelIndex&) ),
this, SLOT( onItemActivated(const QModelIndex&) ) );
}
}
//! Invoke datum view's callback when system of units changes.
//! This slot is attached by widget factory to gui framework's
//! units system manager's signal.
void asiUI_DatumViewEventHandler::onUnitsChanged()
{
asiUI_DatumViewBaseInterface* aViewBaseApi =
dynamic_cast<asiUI_DatumViewBaseInterface*>( parent() );
if ( !aViewBaseApi )
return;
aViewBaseApi->NotifyUnitsChanged();
}
//! Remember pressed item with left mouse button.
//! \param theIndex [in] index of the pressed item.
void asiUI_DatumViewEventHandler::onItemPressed(const QModelIndex& theIndex)
{
// no modifiers allowed
if ( QApplication::keyboardModifiers() != Qt::NoModifier
|| QApplication::mouseButtons() != Qt::LeftButton )
{
m_LastPressIdx = QModelIndex();
return;
}
m_LastPressIdx = theIndex;
}
//! Trigger editing when item activated to support "edit on single click" feature.
//! Single click activation is provided by special style hint.
//! \sa asiUI_ViewStyleProxy.
//! \param theIndex [in] the clicked index.
void asiUI_DatumViewEventHandler::onItemActivated(const QModelIndex& theIndex)
{
if ( m_LastPressIdx == theIndex )
{
QAbstractItemView* aView = qobject_cast<QAbstractItemView*>( parent() );
if ( aView )
{
aView->setCurrentIndex(theIndex);
aView->edit(theIndex);
}
}
m_LastPressIdx = QModelIndex();
}
// ============================================================================
// Common template declaration
// ============================================================================
template asiUI_DatumViewBase<QTableView>;
template asiUI_DatumViewBase<QTreeView>;
|
miursdf56g/sdfsdfds
|
x/thorchain/types/type_liquidity_provider.go
|
<reponame>miursdf56g/sdfsdfds<filename>x/thorchain/types/type_liquidity_provider.go
package types
import (
"errors"
"fmt"
"github.com/cosmos/cosmos-sdk/codec"
"gitlab.com/thorchain/thornode/common"
)
var _ codec.ProtoMarshaler = &LiquidityProvider{}
// LiquidityProviders a list of liquidity providers
type LiquidityProviders []LiquidityProvider
// Valid check whether lp represent valid information
func (m *LiquidityProvider) Valid() error {
if m.LastAddHeight == 0 {
return errors.New("last add liquidity height cannot be empty")
}
if m.AssetAddress.IsEmpty() && m.RuneAddress.IsEmpty() {
return errors.New("asset address and rune address cannot be empty")
}
return nil
}
func (lp LiquidityProvider) GetAddress() common.Address {
if !lp.RuneAddress.IsEmpty() {
return lp.RuneAddress
}
return lp.AssetAddress
}
// Key return a string which can be used to identify lp
func (lp LiquidityProvider) Key() string {
return fmt.Sprintf("%s/%s", lp.Asset.String(), lp.GetAddress().String())
}
|
rsms/gosched-cpp
|
sched/src/m.h
|
// M – machine (worker thread)
#pragma once
#include "atomic.h"
#include "t.h" // for M::t0, might be able to work around this
#include "os.h"
#include "note.h"
struct P;
using MCallFun = void(*)(M&,T&);
struct M {
T t0; // task with scheduling stack
T* curt = nullptr; // current running task
uint32_t locks = 0; // number of locks held to this M
T* lockedt = nullptr;// task locked to this M
P* p = nullptr; // attached p for executing Ts (null if not executing)
P* nextp = nullptr;
T* deadq = nullptr; // dead tasks waiting to be reclaimed (TDead)
bool spinning = false; // m is out of work and is actively looking for work
bool blocked = false; // m is blocked on a note
TUnlockFun waitunlockf = nullptr;
intptr_t waitunlockv = 0;
M* schedlink = nullptr;
uint32_t fastrand = 0; // next value for m_fastrand()
Note parknote;
// Platform-specific fields
Sema waitsema;
M();
};
// Switch to ct.m.t0's stack and call fn(m,t)
void m_call(T& ct, MCallFun fn);
// Returns M for the current T, with +1 refcount
M& m_acquire();
// Release m previosuly m_acquire()'d
void m_release(M&);
// Schedules gp to run on the current M.
// If inheritTime is true, gp inherits the remaining time in the
// current time slice. Otherwise, it starts a new time slice.
// Never returns.
void m_execute(M&, T&, bool inheritTime);
// One round of scheduler: find a runnable goroutine and execute it.
// Never returns.
void m_schedule(M&);
T* m_findrunnable(bool& inheritTime);
// Return a pseudo-random integer. Only for sceduling randomization etc.
uint32_t m_fastrand(M&);
// Stops execution of M until new work is available.
// Returns with acquired P. M must be M==t_get().m
void m_stop(M&);
// —————————————————————————————
inline __attribute__((always_inline)) M& m_acquire() {
T& t = t_get();
++t.m->locks;
return *t.m;
}
inline void m_release(M& m) {
--m.locks;
}
|
levendlee/leetcode
|
c++/leetcode/0206-Reverse_Linked_List-E.cpp
|
// 206 Reverse Linked List
// https://leetcode.com/problems/reverse-linked-list
// version: 1; create time: 2020-01-12 12:05:27;
/**
* Definition for singly-linked list.
* struct ListNode {
* int val;
* ListNode *next;
* ListNode(int x) : val(x), next(NULL) {}
* };
*/
class Solution {
public:
ListNode* reverseList(ListNode* head) {
if (!head || !head->next) return head;
auto pre = head, cur = head->next;
pre->next = nullptr;
while (cur) {
auto tmp = cur->next; // tmp is the 3rd
cur->next = pre; // 2nd points 1st
pre = cur; // 2nd become 1st
cur = tmp; // 3rd become 2nd
}
return pre;
}
};
|
hv6erT/WebIdea
|
editor/codemirror.js
|
const {EditorState} = require("@codemirror/state");
const {EditorView} = require("@codemirror/view");
const {HighlightStyle, tags} = require("@codemirror/highlight");
module.exports = {EditorView, EditorState, HighlightStyle, tags};
|
ilinksolutionsbr/kettle-beam
|
src/main/java/org/kettle/beam/steps/io/BeamInput.java
|
<filename>src/main/java/org/kettle/beam/steps/io/BeamInput.java<gh_stars>0
package org.kettle.beam.steps.io;
import com.google.cloud.storage.contrib.nio.CloudStorageFileSystem;
import org.kettle.beam.core.util.Strings;
import org.kettle.beam.metastore.FieldDefinition;
import org.kettle.beam.metastore.FileDefinition;
import org.pentaho.di.core.exception.KettleException;
import org.pentaho.di.core.row.ValueMetaInterface;
import org.pentaho.di.trans.Trans;
import org.pentaho.di.trans.TransMeta;
import org.pentaho.di.trans.step.*;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Path;
import java.sql.Timestamp;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.stream.Stream;
public class BeamInput extends BaseStep implements StepInterface {
private String fileName;
private Boolean isLocalFile;
private File file;
/**
* This is the base step that forms that basis for all steps. You can derive from this class to implement your own
* steps.
*
* @param stepMeta The StepMeta object to run.
* @param stepDataInterface the data object to store temporary data, database connections, caches, result sets,
* hashtables etc.
* @param copyNr The copynumber for this step.
* @param transMeta The TransInfo of which the step stepMeta is part of.
* @param trans The (running) transformation to obtain information shared among the steps.
*/
public BeamInput( StepMeta stepMeta, StepDataInterface stepDataInterface, int copyNr, TransMeta transMeta,
Trans trans ) {
super( stepMeta, stepDataInterface, copyNr, transMeta, trans );
}
@Override public boolean processRow( StepMetaInterface smi, StepDataInterface sdi ) throws KettleException {
BeamInputMeta meta = (BeamInputMeta)smi;
FileDefinition fileDefinition = meta.parseFileDefinition();
if(this.isLocalFile(meta)){
this.readLocalFile(meta, fileDefinition);
}else{
this.readGSFile(meta, fileDefinition);
}
return false;
}
private String getFileName(BeamInputMeta meta) throws KettleException {
if(!Strings.isNullOrEmpty(this.fileName)){return this.fileName;}
String inputLocation = this.getParentVariableSpace().environmentSubstitute(meta.getInputLocation());
this.fileName = inputLocation;
if(Strings.isNullOrEmpty(this.fileName)){throw new KettleException("Arquivo não informado.");}
this.fileName = this.fileName.trim();
return this.fileName;
}
private Boolean isLocalFile(BeamInputMeta meta) throws KettleException {
if(this.isLocalFile != null){return this.isLocalFile;}
this.isLocalFile = !this.getFileName(meta).toLowerCase().startsWith("gs://");
return this.isLocalFile;
}
private File getFile(BeamInputMeta meta) throws KettleException{
if(this.file != null){return this.file;}
this.file = new File(this.getFileName(meta));
return this.file;
}
private void readLocalFile(BeamInputMeta meta, FileDefinition fileDefinition) throws KettleException{
File file = this.getFile(meta);
if (file == null){throw new KettleException("Arquivo não acessado.");}
try (Stream<String> stream = Files.lines(file.toPath())) {
stream.forEach(l -> processLine(l, fileDefinition));
this.setOutputDone();
} catch (Exception ex){
throw new KettleException(ex.getMessage(), ex);
}
}
private void readGSFile(BeamInputMeta meta, FileDefinition fileDefinition) throws KettleException{
String fileName = this.getFileName(meta);
if (fileName == null){throw new KettleException("Arquivo não acessado.");}
String bucketName = fileName.substring(fileName.indexOf("gs://") + 5, fileName.lastIndexOf("/"));
String shortFileName = fileName.substring(fileName.lastIndexOf("/") + 1);
try (CloudStorageFileSystem fs = CloudStorageFileSystem.forBucket(bucketName)) {
Path path = fs.getPath(shortFileName);
try (Stream<String> stream = Files.lines(path)) {
stream.forEach(l -> processLine(l, fileDefinition));
}
this.setOutputDone();
}catch (Exception ex){
throw new KettleException(ex.getMessage(), ex);
}
}
private void processLine(String line, FileDefinition fileDefinition) {
String[] arr;
Object[] row = new Object[fileDefinition.getFieldDefinitions().size()];
int i = 0;
try {
boolean hasFieldEnclosure = fileDefinition.getEnclosure() != null && !fileDefinition.getEnclosure().isEmpty();
int index = 0;
int arrPos = 0;
arr = new String[fileDefinition.getFieldDefinitions().size()];
Arrays.fill(arr, "");
if(fileDefinition.getSeparator() != null && !fileDefinition.getSeparator().isEmpty()) {
if(hasFieldEnclosure) {
line = line.replace(fileDefinition.getEnclosure(), "");
}
if(line.contains(fileDefinition.getSeparator())) {
if(arr.length != 0) {
String[] arrAux = line.split(fileDefinition.getSeparator());
System.arraycopy(arrAux, 0, arr, 0, arr.length - 1);
} else {
arr = line.split(fileDefinition.getSeparator());
}
} else {
log.logError("A linha especificada não possui o separador de campo especificado na definição de arquivo.");
throw new Exception("A linha especificada não possui o separador de campo especificado na definição de arquivo.");
}
} else if(hasFieldEnclosure) {
List<String> list = new ArrayList<>(Arrays.asList(line.split("'")));
list.removeIf(e -> e.equals(""));
arr = list.toArray(new String[0]);
} else {
if(!fileDefinition.getFieldDefinitions().isEmpty()) {
for(FieldDefinition field: fileDefinition.getFieldDefinitions()) {
if(field.getLength() != -1) {
arr[arrPos] = line.substring(index, index + field.getLength()).trim();
arrPos++;
index = index + field.getLength();
} else {
log.logError("Todos os campos devem possuir tamanho definido quando não existir separador ou fechador de campo");
throw new Exception("Todos os campos devem possuir tamanho definido quando não existir separador ou fechador de campo");
}
}
} else {
log.logError("Nao foi possivel segmentar a linha com as configuracoes informadas");
throw new Exception("Nao foi possivel segmentar a linha com as configuracoes informadas");
}
}
for(FieldDefinition field: fileDefinition.getFieldDefinitions()) {
Object value;
switch (field.getValueMeta().getType()) {
case ValueMetaInterface.TYPE_STRING:
case ValueMetaInterface.TYPE_INET:
case ValueMetaInterface.TYPE_NONE:
case ValueMetaInterface.TYPE_SERIALIZABLE:
value = Strings.convert(arr[i], String.class);
break;
case ValueMetaInterface.TYPE_INTEGER:
value = Strings.convert(arr[i], Integer.class);
break;
case ValueMetaInterface.TYPE_NUMBER:
value = Strings.convert(arr[i], Double.class);
break;
case ValueMetaInterface.TYPE_BIGNUMBER:
value = Strings.convert(arr[i], Float.class);
break;
case ValueMetaInterface.TYPE_BOOLEAN:
value = Strings.convert(arr[i], Boolean.class);
break;
case ValueMetaInterface.TYPE_DATE:
if(field.getFormatMask() != null) {
if(!arr[i].isEmpty()) {
DateTimeFormatter formatter = DateTimeFormatter.ofPattern(field.getFormatMask());
LocalDate date = LocalDate.parse(arr[i], formatter);
value = java.sql.Date.valueOf(date);
} else {
value = null;
}
break;
} else {
logError("Campo de data sem formato especificado");
throw new Exception("Campo de data sem formato especificado");
}
case ValueMetaInterface.TYPE_TIMESTAMP:
if(field.getFormatMask() != null) {
if(!arr[i].isEmpty()) {
DateTimeFormatter formatter = DateTimeFormatter.ofPattern(field.getFormatMask());
LocalDateTime timestamp = LocalDateTime.parse(arr[i], formatter);
value = Timestamp.valueOf(timestamp);
} else {
value = null;
}
break;
} else {
logError("Campo de timestamp sem formato especificado");
throw new Exception("Campo de timestamp sem formato especificado");
}
default:
value = Strings.convert(arr[i], String.class);
}
row[i] = value;
i++;
}
this.putRow(fileDefinition.getRowMeta(), row);
} catch (Exception e) {
logError(e.getMessage(), e);
}
}
}
|
Lemon42/resolve-ai-mobile
|
src/routes/auth.routes.js
|
<gh_stars>0
import React from 'react';
import {createStackNavigator} from '@react-navigation/stack';
// Pages
import FrontPage from '../pages/FrontPage';
import CreateAccount from '../pages/CreateAccount';
import SignIn from '../pages/SignIn';
const Stack = createStackNavigator();
function AuthStack() {
return (
<Stack.Navigator screenOptions={{ headerShown: false }}>
<Stack.Screen name="FrontPage" component={FrontPage} />
<Stack.Screen name="CreateAccount" component={CreateAccount} />
<Stack.Screen name="SignIn" component={SignIn} />
</Stack.Navigator>
);
}
export default AuthStack;
|
omikabir/omEngin
|
Z_ALL_FILE/Py1/semqry_test.py
|
<filename>Z_ALL_FILE/Py1/semqry_test.py
import pandas as pd
import cx_Oracle
import time
import os
from datetime import date
import win32com.client
pt = os.getcwd() + '//T.csv'
conn = cx_Oracle.connect('SEMHEDB', 'SEMHEDB', 'ossam-cluster-scan.robi.com.bd:1721/RBPB.robi.com.bd')
Qr1 = "SELECT IDENTIFIER,CUSTOMATTR15,SUMMARY,LASTOCCURRENCE FROM alerts_status WHERE Severity!='0'"
print(Qr1)
df = pd.read_sql(Qr1, con=conn)
end = time.time()
print('TIme Required: ')
print(end - start)
df.to_csv(pt)
print("file name: " + pt)
|
ghiloufibelgacem/jornaldev
|
CoreJavaProjects/CoreJavaExamples/src/com/journaldev/log/LoggingExample.java
|
<reponame>ghiloufibelgacem/jornaldev
package com.journaldev.log;
import java.io.FileInputStream;
import java.io.IOException;
import java.util.logging.ConsoleHandler;
import java.util.logging.FileHandler;
import java.util.logging.Handler;
import java.util.logging.Level;
import java.util.logging.LogManager;
import java.util.logging.Logger;
public class LoggingExample {
static Logger logger = Logger.getLogger(LoggingExample.class.getName());
public static void main(String[] args) {
try {
LogManager.getLogManager().readConfiguration(new FileInputStream("mylogging.properties"));
} catch (SecurityException | IOException e1) {
e1.printStackTrace();
}
logger.setLevel(Level.FINE);
logger.addHandler(new ConsoleHandler());
//adding custom handler
logger.addHandler(new MyHandler());
try {
//FileHandler file name with max size and number of log files limit
Handler fileHandler = new FileHandler("/Users/pankaj/tmp/logger.log", 2000, 5);
fileHandler.setFormatter(new MyFormatter());
//setting custom filter for FileHandler
fileHandler.setFilter(new MyFilter());
logger.addHandler(fileHandler);
for(int i=0; i<1000; i++){
//logging messages
logger.log(Level.INFO, "Msg"+i);
}
logger.log(Level.CONFIG, "Config data");
} catch (SecurityException | IOException e) {
e.printStackTrace();
}
}
}
|
noahhusby/Sledgehammer
|
bungeecord/src/main/java/com/noahhusby/sledgehammer/proxy/config/SledgehammerConfig.java
|
/*
* MIT License
*
* Copyright 2020-2021 noahhusby
*
* 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 com.noahhusby.sledgehammer.proxy.config;
import com.noahhusby.lib.application.config.Config;
import com.noahhusby.lib.application.config.Config.Comment;
import com.noahhusby.lib.application.config.Config.Type;
import java.util.UUID;
/**
* @author <NAME>
*/
@SuppressWarnings("CanBeFinal")
@Config(name = "sledgehammer", type = Type.HOCON)
public class SledgehammerConfig {
@Comment({
"General options for sledgehammer"
})
public static GeneralOptions general = new GeneralOptions();
@SuppressWarnings("CanBeFinal")
public static class GeneralOptions {
@Comment({
"Generate a new key using https://uuidgenerator.net/version4",
"All corresponding sledgehammer clients must have the same code",
"Don't share this key with anyone you don't trust as it will allow anybody to run any command on connected servers." })
public String authenticationCode = UUID.randomUUID().toString();
@Comment({
"The Id of the proxy. The first proxy starts at zero. Leave at zero if this is a single-proxy configuration"
})
public int proxyId = 0;
@Comment({
"The total amount of proxies, if a multi-server setup. Zero includes first proxy.",
"Set this to -1 if this is a single-proxy configuration"
})
public int proxyTotal = -1;
@Comment({
"The prefix of messages broadcast to players from the proxy."
})
public String messagePrefix = "&9&lBTE &8&l> ";
@Comment({
"Set this to false to disable global tpll. [/tpll & /cs tpll]"
})
public boolean globalTpll = true;
@Comment({
"When enabled, the default 'This command is not available!' is replaced with 'Unknown Command.'"
})
public boolean replaceNotAvailable = false;
}
@Comment({
"Settings for the MySQL Database"
})
public static DatabaseOptions database = new DatabaseOptions();
@SuppressWarnings("CanBeFinal")
public static class DatabaseOptions {
@Comment({
"Should SQL be used to synchronize/store data?"
})
public boolean useSql = false;
@Comment({
"The host IP for the database."
})
public String sqlHost = "127.0.0.1";
@Comment({
"The port for the database."
})
public int sqlPort = 3306;
@Comment({
"The username for the database."
})
public String sqlUser = "";
@Comment({
"The password for the database."
})
public String sqlPassword = "";
@Comment({
"The name of the database."
})
public String sqlDb = "";
@Comment({
"How often SH should automatically refresh storage data (in seconds)."
})
public long autoLoad = 30;
}
@Comment({
"Options for warps"
})
public static WarpOptions warps = new WarpOptions();
@SuppressWarnings("CanBeFinal")
public static class WarpOptions {
@Comment({
"The command for network-wide warping. Leave blank to disable"
})
public String warpCommand = "nwarp";
@Comment({
"Local warp allows for each individual server to set their own warps.",
"Standard warp [false] is a shared pool of warps for the entire network.",
"All warps are accessible regardless of warp mode."
})
public boolean localWarp = false;
@Comment({
"This will open the interactive GUI by default when the warp command is called.",
"Otherwise `/[warp command] menu` is required to open the menu."
})
public boolean warpMenuDefault = false;
@Comment({
"This is the main page that will be shown upon the warp menu opening.",
"Use `local` to show the warps on the current server (or groups of servers)",
"Use `all` to show all the warps by default",
"Use `servers` to show all the warps sorted by server",
"Use `groups` to show all the warps sorted by group",
"If local is used, but no local warps are found, the GUI will default to showing all warps."
})
public String warpMenuPage = "";
}
@Comment({
"Options for OpenStreetMaps and Teleportation"
})
public static GeographyOptions geography = new GeographyOptions();
@SuppressWarnings("CanBeFinal")
public static class GeographyOptions {
@Comment({
"Zoom detail level for OSM requests."
})
public int zoom = 12;
@Comment({
"Set false for fetching the latest data from OSM (more up to date), or true for using a downloaded database.",
"Please follow the guide on https://github.com/noahhusby/Sledgehammer/wiki/Border-Offline-Database about downloading and configuring the offline database."
})
public boolean useOfflineMode = false;
@Comment({
"Set to false to disable automatic border teleportation, or true to enable it. Border teleportation requires the offline database to be configured."
})
public boolean borderTeleportation = false;
}
@Comment({
"Terramap Addon Configuration"
})
public static TerramapOptions terramap = new TerramapOptions();
@SuppressWarnings("CanBeFinal")
public static class TerramapOptions {
@Comment({
"Enables Terramap integration"
})
public boolean terramapEnabled = true;
@Comment({
"Whether or not to synchronize players from server to client so everyone appears on the map, no matter the distance."
})
public boolean terramapSyncPlayers = true;
@Comment({
"The time interval, in milliseconds at which to synchronize players with clients."
})
public int terramapSyncInterval = 500;
@Comment({
"The default time interval, in milliseconds, before a clients needs to register again to continue getting player position updates."
})
public int terramapSyncTimeout = 120000;
@Comment({
"If player sync is enabled, should players be displayed by default (true) or should they explicitly opt-in with /terrashow (false)"
})
public boolean terramapPlayersDisplayDefault = true;
@Comment({
"Set to false if you do not want to send custom maps to clients. This is only for testing, as if you don't want to send map styles to client, the first thing to do is to not configure any."
})
public boolean terramapSendCustomMapsToClient = true;
@Comment({
"Set this to false to only allow players to use the map when they are on an Earth world."
})
public boolean terramapGlobalMap = true;
@Comment({
"Set this to true is you want client's settings to be saved for the entire network instead of per-world."
})
public boolean terramapGlobalSettings = false;
@Comment({
"A UUID v4 that will be used by Terramap clients to identify this network when saving settings. DO NOT PUT YOUR NETWORK AUTHENTIFICATION CODE IN HERE, THIS IS SHARED WITH CLIENTS! You want this to be the same on all your network's proxies. The default value is randomly generated."
})
public String terramapProxyUUID = UUID.randomUUID().toString();
}
}
|
spartan263/vizio_oss
|
directfb/Source/DirectFB/gfxdrivers/cyber5k/cyber5k_alpha.c
|
/*
(c) Copyright 2001-2009 The world wide DirectFB Open Source Community (directfb.org)
(c) Copyright 2000-2004 Convergence (integrated media) GmbH
All rights reserved.
Written by <NAME> <<EMAIL>>,
<NAME> <<EMAIL>>,
<NAME> <<EMAIL>>,
<NAME> <<EMAIL>> and
<NAME> <<EMAIL>>.
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the
Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA.
*/
#include "cyber5k.h"
#include "cyber5k_alpha.h"
#include "regs.h"
void cyber_cleanup_alpha(void)
{
int i;
cyber_grphw(0xfa, 0);
for (i=0; i<16; i++) {
if (i == 0x0A) {/*Don't clean up SyncLock video path if there is one*/
cyber_out8(cyber_mmio, SEQINDEX, 0x40 + i);
cyber_out8(cyber_mmio, SEQDATA, cyber_in8(cyber_mmio, SEQDATA) & 0x08);
}
else {
cyber_out8(cyber_mmio, SEQINDEX, 0x40 + i);
cyber_out8(cyber_mmio, SEQDATA, 0x00);
}
}
cyber_grphw(0xfa, 8);
for (i=0; i<16; i++) {
if(i==0x0F) {/*Just in case there is a SyncLock video*/
cyber_out8(cyber_mmio, SEQINDEX, 0x40 + i);
cyber_out8(cyber_mmio, SEQDATA, 0x00);
cyber_out8(cyber_mmio, SEQDATA, cyber_in8(cyber_mmio, SEQDATA) | 0xC0);
}
else {
cyber_out8(cyber_mmio, SEQINDEX, 0x40 + i);
cyber_out8(cyber_mmio, SEQDATA, 0x00);
}
}
cyber_grphw(0xfa, 0x10);
for (i=0; i<16; i++) {
cyber_out8(cyber_mmio, SEQINDEX, 0x40 + i);
cyber_out8(cyber_mmio, SEQDATA, 0x00);
}
cyber_grphw(0xfa, 0x18);
for (i=0; i<16; i++) {
cyber_out8(cyber_mmio, SEQINDEX, 0x40 + i);
cyber_out8(cyber_mmio, SEQDATA, 0x00);
}
cyber_grphw(0xfa, 0x20);
for (i=0; i<16; i++) {
cyber_out8(cyber_mmio, SEQINDEX, 0x40 + i);
cyber_out8(cyber_mmio, SEQDATA, 0x00);
}
cyber_out8(cyber_mmio, SEQINDEX, 0xA6);
/*for video capture*/
cyber_out8(cyber_mmio, SEQDATA, cyber_in8(cyber_mmio, SEQDATA) & 0xF0);
#if 0
/*for 8-bit Index mode*/
if(bEnabled8Bit) /*if we are in 8-bit alpha-blending mode, remember to disable it*/
EnablePaletteMode(0);
#endif
cyber_out8(cyber_mmio, GRAINDEX, 0xfa);
cyber_out8(cyber_mmio, GRADATA, 0x80);
cyber_out8(cyber_mmio, GRAINDEX, 0xe0);
cyber_out8(cyber_mmio, GRADATA, cyber_in8(cyber_mmio, 0x03cf) | 0x04);
cyber_out8(cyber_mmio, GRAINDEX, 0xfa);
cyber_out8(cyber_mmio, GRADATA, 0x00);
}
void cyber_enable_alpha(int enable)
{
cyber_grphw(0xfa, 0);
cyber_out8(cyber_mmio, SEQINDEX, 0x4b);
if (enable)
cyber_out8(cyber_mmio, SEQDATA, (cyber_in8(cyber_mmio, SEQDATA) | 0x80));
else
cyber_out8(cyber_mmio, SEQDATA, (cyber_in8(cyber_mmio, SEQDATA) & 0x7F));
}
void cyber_enable_fullscreen_alpha(int enable)
{
cyber_grphw(0xfa, 0);
cyber_out8(cyber_mmio, SEQINDEX, 0x4b);
if (enable)
cyber_out8(cyber_mmio, SEQDATA, (cyber_in8(cyber_mmio, SEQDATA) | 0x40));
else
cyber_out8(cyber_mmio, SEQDATA, (cyber_in8(cyber_mmio, SEQDATA) & 0xBF));
}
void cyber_select_blend_src1(int src)
{
cyber_grphw(0xfa, 0);
cyber_out8(cyber_mmio, SEQINDEX, 0x49);
cyber_out8(cyber_mmio, SEQDATA, (cyber_in8(cyber_mmio, SEQDATA) & ~0x03) | src);
}
void cyber_select_blend_src2(int src)
{
cyber_grphw(0xfa, 0);
cyber_out8(cyber_mmio, SEQINDEX, 0x4d);
cyber_out8(cyber_mmio, SEQDATA, (cyber_in8(cyber_mmio, SEQDATA) & ~0x30) | (src << 4));
if(src == SRC2_OVERLAY1) { /*if source is Overlay one only, disable Overlay 2*/
cyber_out8(cyber_mmio, GRAINDEX, 0xfa);
cyber_out8(cyber_mmio, GRADATA, 0x08);
cyber_out8(cyber_mmio, SEQINDEX, 0x4f);
cyber_out8(cyber_mmio, SEQDATA, cyber_in8(cyber_mmio, SEQDATA) | 0x08);
cyber_out8(cyber_mmio, GRADATA, 0x00);
}
}
void cyber_select_alpha_src(int src)
{
cyber_grphw(0xfa, 0);
cyber_out8(cyber_mmio, SEQINDEX, 0x49);
cyber_out8(cyber_mmio, SEQDATA, (cyber_in8(cyber_mmio, SEQDATA) & ~0x60) | (src << 5));
/*if alpha source comes form Overlay2, we need to disable Overlay2 color key function*/
if(src == ALPHA_OVERLAY2) {
/*Disable Overlay 2 in Source B path*/
cyber_out8(cyber_mmio, GRAINDEX, 0xfa);
cyber_out8(cyber_mmio, GRADATA, 0x08);
cyber_out8(cyber_mmio, SEQINDEX, 0x4f);
cyber_out8(cyber_mmio, SEQDATA, cyber_in8(cyber_mmio, SEQDATA) | 0x08);
/*Disable V2 generally */
cyber_out8(cyber_mmio, GRADATA, 0x20);
cyber_out8(cyber_mmio, SEQINDEX, 0x47);
cyber_out8(cyber_mmio, SEQDATA, cyber_in8(cyber_mmio, SEQDATA) | 0x02);
cyber_out8(cyber_mmio, GRADATA, 0x00);
}
}
void cyber_set_alpha_reg(unsigned char r, unsigned char g, unsigned char b)
{
cyber_grphw(0xfa, 0);
cyber_seqw(0x46, r);
cyber_seqw(0x47, g);
cyber_seqw(0x48, b);
}
void cyber_set_magic_match_reg( unsigned char bR, unsigned char bG, unsigned char bB )
{
cyber_out8(cyber_mmio, GRAINDEX, 0xfa);
cyber_out8(cyber_mmio, GRADATA, 8);
/*Disable range feature first*/
cyber_out8(cyber_mmio, SEQINDEX, 0x46);
cyber_out8(cyber_mmio, SEQDATA, cyber_in8(cyber_mmio, SEQDATA) & 0x7F);
cyber_out8(cyber_mmio, SEQINDEX, 0x40);
cyber_out8(cyber_mmio, SEQDATA, bR);
cyber_out8(cyber_mmio, SEQINDEX, 0x41);
cyber_out8(cyber_mmio, SEQDATA, bG);
cyber_out8(cyber_mmio, SEQINDEX, 0x42);
cyber_out8(cyber_mmio, SEQDATA, bB);
}
void cyber_set_alpha_RAM_reg( unsigned char bIndex, unsigned char bR, unsigned char bG, unsigned char bB)
{
unsigned char bData;
cyber_out8(cyber_mmio, GRAINDEX, 0xfa);
cyber_out8(cyber_mmio, GRADATA, 0);
cyber_out8(cyber_mmio, SEQINDEX, 0x49);
bData = cyber_in8(cyber_mmio, SEQDATA);
cyber_out8(cyber_mmio, SEQDATA, 0x18); /*select CPU to write*/
cyber_out8(cyber_mmio, SEQINDEX, 0x4e); /*enable index of alpha RAM R*/
cyber_out8(cyber_mmio, SEQDATA, 0x20+bIndex);
cyber_out8(cyber_mmio, SEQINDEX, 0x4f); /*RAM data port*/
cyber_out8(cyber_mmio, SEQDATA, bR);
cyber_out8(cyber_mmio, SEQINDEX, 0x4e); /*enable index of alpha RAM G*/
cyber_out8(cyber_mmio, SEQDATA, 0x40+bIndex);
cyber_out8(cyber_mmio, SEQINDEX, 0x4f); /*RAM data port*/
cyber_out8(cyber_mmio, SEQDATA, bG);
cyber_out8(cyber_mmio, SEQINDEX, 0x4e); /*enable index of alpha RAM B*/
cyber_out8(cyber_mmio, SEQDATA, 0x80+bIndex);
cyber_out8(cyber_mmio, SEQINDEX, 0x4f); /*RAM data port*/
cyber_out8(cyber_mmio, SEQDATA, bB);
cyber_out8(cyber_mmio, SEQINDEX, 0x49);
cyber_out8(cyber_mmio, SEQDATA, bData);
cyber_out8(cyber_mmio, SEQINDEX, 0x4e); /*Set index of alpha RAM */
cyber_out8(cyber_mmio, SEQDATA, bIndex);
}
void cyber_select_RAM_addr( unsigned char bRAMAddrSel )
{
cyber_out8(cyber_mmio, GRAINDEX, 0xfa);
cyber_out8(cyber_mmio, GRADATA, 0);
cyber_out8(cyber_mmio, SEQINDEX, 0x49);
cyber_out8(cyber_mmio, SEQDATA, (cyber_in8(cyber_mmio, SEQDATA) & ~0x18) | (bRAMAddrSel << 3));
}
void cyber_enable_magic_alpha_blend( unsigned char enable )
{
cyber_out8(cyber_mmio, GRAINDEX, 0xfa);
cyber_out8(cyber_mmio, GRADATA, 8);
cyber_out8(cyber_mmio, SEQINDEX, 0x46);
if (enable)
cyber_out8(cyber_mmio, SEQDATA, (cyber_in8(cyber_mmio, SEQDATA) | 0x01));
else
cyber_out8(cyber_mmio, SEQDATA, (cyber_in8(cyber_mmio, SEQDATA) & 0xFE));
cyber_out8(cyber_mmio, GRAINDEX, 0xfa);
cyber_out8(cyber_mmio, GRADATA, 0x20);
cyber_out8(cyber_mmio, SEQINDEX, 0x47);
cyber_out8(cyber_mmio, SEQDATA, cyber_in8(cyber_mmio, SEQDATA) & 0x7F);
cyber_out8(cyber_mmio, GRADATA, 0x00);
}
void cyber_select_magic_alpha_src( unsigned char bAlphaSrc )
{
cyber_out8(cyber_mmio, GRAINDEX, 0xfa);
cyber_out8(cyber_mmio, GRADATA, 8);
cyber_out8(cyber_mmio, SEQINDEX, 0x46);
cyber_out8(cyber_mmio, SEQDATA, (cyber_in8(cyber_mmio, SEQDATA) & ~0x0C) | (bAlphaSrc << 2));
}
|
tdiesler/gravia
|
repository/src/test/java/org/jboss/test/gravia/repository/MemoryRepositoryStorageTestCase.java
|
package org.jboss.test.gravia.repository;
/*
* #%L
* Gravia :: Repository
* %%
* Copyright (C) 2012 - 2014 JBoss by Red Hat
* %%
* 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.
* #L%
*/
import java.util.Collection;
import org.jboss.gravia.repository.RepositoryReader;
import org.jboss.gravia.repository.RepositoryStorage;
import org.jboss.gravia.repository.spi.MemoryRepositoryStorage;
import org.jboss.gravia.resource.Capability;
import org.jboss.gravia.resource.DefaultRequirementBuilder;
import org.jboss.gravia.resource.IdentityNamespace;
import org.jboss.gravia.resource.Requirement;
import org.jboss.gravia.resource.RequirementBuilder;
import org.jboss.gravia.resource.Resource;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
/**
* Test the {@link MemoryRepositoryStorage}
*
* @author <EMAIL>
* @since 16-Jan-2012
*/
public class MemoryRepositoryStorageTestCase extends AbstractRepositoryTest {
private RepositoryStorage storage;
@Before
public void setUp() throws Exception {
storage = new MemoryRepositoryStorage(null);
RepositoryReader reader = getRepositoryReader("xml/sample-repository.xml");
storage.addResource(reader.nextResource());
}
@Test
public void testRequireResource() throws Exception {
RepositoryReader reader = storage.getRepositoryReader();
Resource resource = reader.nextResource();
Assert.assertNotNull("Resource not null", resource);
Assert.assertNull("One resource only", reader.nextResource());
RequirementBuilder builder = new DefaultRequirementBuilder(IdentityNamespace.IDENTITY_NAMESPACE, "org.acme.pool");
Requirement req = builder.getRequirement();
Collection<Capability> providers = storage.findProviders(req);
Assert.assertNotNull("Providers not null", providers);
Assert.assertEquals("One provider", 1, providers.size());
Capability cap = providers.iterator().next();
Assert.assertNotNull("Capability not null", cap);
Assert.assertSame(resource, cap.getResource());
}
}
|
RealTimeChris/DiscordCoreAPI
|
Headers/ReactionEntities.hpp
|
<gh_stars>100-1000
// ReactionEntities.hpp - Header for the Reaction related classes and structs.
// May 13, 2021
// <NAME>.
// https://github.com/RealTimeChris
#pragma once
#include "IndexInitial.hpp"
#include "FoundationEntities.hpp"
#include "UserEntities.hpp"
#include "JSONIfier.hpp"
namespace DiscordCoreAPI {
/**
* \addtogroup foundation_entities
* @{
*/
/// For creating a single Reaction. \brief For creating a single Reaction.
struct DiscordCoreAPI_Dll CreateReactionData {
string channelId{ "" };///< The Channel for which to add the Reaction.
string messageId{ "" };///< The Message on which to add the Reaction.
string emojiName{ "" };///< The emoji name of the Reaction to add.
string emojiId{ "" };///< The emoji id of the Reaction to add.
};
/// For deleting one's own Reaction. \brief For deleting one's own Reaction.
struct DiscordCoreAPI_Dll DeleteOwnReactionData {
string channelId{ "" }; ///< The Channel from which to remove the Reaction.
string messageId{ "" };///< The Message from which to remove the Reaction.
string emojiName{ "" };///< The emoji name for which to remove the emoji.
string emojiId{ "" };///< The emoji id for which to remove the emoji.
};
/// For deleting a reaction, by User. \brief For deleting a reaction, by User.
struct DiscordCoreAPI_Dll DeleteUserReactionData {
string channelId{ "" };///< The Channel from which to remove the Reaction.
string messageId{ "" };///< The Message from which to remove the Reaction.
string emojiName{ "" };///< The name of which emoji to remove.
string emojiId{ "" };///< The id of which emoji to remove.
string userId{ "" };///< The User id for whom to remove their emoji.
};
/// For getting all of the Reactions. \brief For getting all of the Reactions.
struct DiscordCoreAPI_Dll GetReactionsData {
string channelId{ "" };///< The Channel from which to acquire the reactors.
string messageId{ "" };///< The Message from which to acquire the reactors.
string afterId{ "" };///< Get users after this user ID.
string emoji{ "" };///< The emoji name for which to acquire the reactors.
int32_t limit{ 0 };///< The maximum number of reactors to collect.
};
/// For deleting all of the Reactions on a particular Message. \brief For deleting all of the Reactions on a particular Message.
struct DiscordCoreAPI_Dll DeleteAllReactionsData {
string channelId{ "" };///< The Channel from which you would like to remove the emoji.
string messageId{ "" };///< The Message from which you would like to remove the emoji.
};
/// For deleting all of the Reactions of a particular Emoji. \brief For deleting all of the Reactions of a particular Emoji.
struct DiscordCoreAPI_Dll DeleteReactionsByEmojiData {
string channelId{ "" };///< The Channel from which you would like to remove the emoji.
string messageId{ "" };///< The Message from which you would like to remove the emoji.
string emojiName{ "" };///< The name of which emoji to remove.
string emojiId{ "" };///< The id of which emoji to remove.
};
/// For collecting a list of Emoji from a Guild.
struct DiscordCoreAPI_Dll GetEmojiListData {
string guildId{ "" };///< The id of the chosen Guild.
};
/// For collecting a single Guild Emoji.
struct DiscordCoreAPI_Dll GetGuildEmojiData {
string guildId{ "" };///< The id of the chosen Guild.
string emojiId{ "" };///< The id of the chosen Emoji
};
enum class ImageType {
JPG = 0,
PNG = 1,
GIF = 2,
};
/// For creating a new Guild Emoji.
struct DiscordCoreAPI_Dll CreateGuildEmojiData {
friend string DiscordCoreInternal::JSONIFY(CreateGuildEmojiData dataPackage);
friend class Reactions;
vector<uint8_t> imageData{};///< The image responseData.
vector<string> roles{};///< Roles that can use this Emoji.
string guildId{ "" };///< The Guild within which to create the Emoji.
string reason{ "" };///< Reason for creating the new Emoji.
string name{ "" };///< Name of the emoji.
ImageType type{};///< The type of image being uploaded.
protected:
string imageDataFinal{};
};
/// For modifying a Guild Emoji.
struct DiscordCoreAPI_Dll ModifyGuildEmojiData {
vector<string> roles{};///< Roles that can use this Emoji.
string guildId{ "" };///< The Guild within which to modify the Emoji.
string emojiId{ "" };///< The id of the Emoji to modify.
string reason{ "" };///< Reason for modifying the Emoji.
string name{ "" };///< Name of the Emoji.
};
/// For deleting a Guild Emoji.
struct DiscordCoreAPI_Dll DeleteGuildEmojiData {
string guildId{ "" };///< The Guild within which to delete the Emoji.
string emojiId{ "" };///< The id of the Emoji to delete.
string reason{ "" };///< Reason for deleting the Emoji.
};
/// A single Reaction. \brief A single Reaction.
class DiscordCoreAPI_Dll Reaction : public ReactionData {
public:
Reaction();
Reaction(ReactionData dataNew);
};
/**@}*/
/**
* \addtogroup main_endpoints
* @{
*/
/// An interface class for the Reaction related Discord endpoints. \brief An interface class for the Reaction related Discord endpoints.
class DiscordCoreAPI_Dll Reactions {
public:
/// Creates a Reaction on a Message. \brief Creates a Reaction on a Message.
/// \param dataPackage A CreateReactionData structure.
/// \returns A CoRoutine containing a Reaction.
static CoRoutine<Reaction> createReactionAsync(CreateReactionData dataPackage);
/// Deletes your own Reactions from a given Message. \brief Deletes your own Reactions from a given Message.
/// \param dataPackage A DeleteOwnReactionData structure.
/// \returns A CoRoutine containing void.
static CoRoutine<void> deleteOwnReactionAsync(DeleteOwnReactionData dataPackage);
/// Deletes all of the Reactions by a specific User from a given Message. \brief Deletes all of the Reactions by a specific User from a given Message.
/// \param dataPackage A DeleteUserReactionData structure.
/// \returns A CoRoutine containing void.
static CoRoutine<void> deleteUserReactionAsync(DeleteUserReactionData dataPackage);
/// Get a list of users that reacted with this emoji. Returns an array of user objects on success. \brief Get a list of users that reacted with this emoji. Returns an array of user objects on success.
/// \param dataPackage A GetReactionsData structure.
/// \returns A CoRoutine containing a vector<User>.
static CoRoutine<vector<User>> getReactionsAsync(GetReactionsData dataPackage);
/// Deletes all of the Reactions from a given Message. \brief Deletes all of the Reactions from a given Message.
/// \param dataPackage A DeleteAllReactionsData structure.
/// \returns A CoRoutine containing void.
static CoRoutine<void> deleteAllReactionsAsync(DeleteAllReactionsData dataPackage);
/// Deletes all of the Reactions by a specific emoji from a given Message. \brief Deletes all of the Reactions by a specific emoji from a given Message.
/// \param dataPackage A DeleteReactionsByEmojiData structure.
/// \returns A CoRoutine containing void.
static CoRoutine<void> deleteReactionsByEmojiAsync(DeleteReactionsByEmojiData dataPackage);
/// Collects a list of Guild Emoji from a chosen Guild. \brief Collects a list of Guild Emoji from a chosen Guild.
/// \param dataPackage A GetEmojiListData structure.
/// \returns A CoRoutine containing a vector<EmojiData>.
static CoRoutine<vector<EmojiData>> getEmojiListAsync(GetEmojiListData dataPackage);
/// Collects a single Guild Emoji from a chosen Guild. \brief Collects a single Guild Emoji from a chosen Guild.
/// \param dataPackage A GetGuildEmojiData structure.
/// \returns A CoRoutine containing an EmojiData.
static CoRoutine<EmojiData> getGuildEmojiAsync(GetGuildEmojiData dataPackage);
/// Creates a single Guild Emoji within a chosen Guild. \brief Creates a single Guild Emoji within a chosen Guild.
/// \param dataPackage A CreateGuildEmojiData structure.
/// \returns A CoRoutine containing an EmojiData.
static CoRoutine<EmojiData> createGuildEmojiAsync(CreateGuildEmojiData dataPackage);
/// Modifies a single Guild Emoji within a chosen Guild. \brief Modifies a single Guild Emoji within a chosen Guild.
/// \param dataPackage A ModifyGuildEmojiData structure.
/// \returns A CoRoutine containing an EmojiData.
static CoRoutine<EmojiData> modifyGuildEmojiAsync(ModifyGuildEmojiData dataPackage);
/// Deletes a single Guild Emoji within a chosen Guild. \brief Deletes a single Guild Emoji within a chosen Guild.
/// \param dataPackage A DeleteGuildEmojiData structure.
/// \returns A CoRoutine containing void.
static CoRoutine<void> deleteGuildEmojiAsync(DeleteGuildEmojiData dataPackage);
};
/**@}*/
}
|
JeppeDruedahl/IOGE
|
HousingModel.py
|
# -*- coding: utf-8 -*-
"""HousingModel
Main model class
"""
import time
import numpy as np
import pandas as pd
# consav package
from consav import ModelClass
from consav.misc import elapsed, nonlinspace, markov_rouwenhorst
# local
import post_decision
import negm
import nvfi
import simulate
def solve_model(model,t_min=0,do_print=True):
""" solve the model """
par = model.par
sol = model.sol
t0_outer = time.time()
# a. re-set up grids
t0 = time.time()
model.create_grids()
if do_print: print(f'setup grids in {elapsed(t0)}')
# c. time loop
for t in reversed(range(t_min,par.T)):
t0 = time.time()
# i. post-decions
t0_pd = time.time()
post_decision.compute_wq_renters(par,sol,t)
post_decision.compute_wq_owners(par,sol,t)
t_pd = elapsed(t0_pd)
# ii. negm
t0_negm = time.time()
negm.solve_renters(par,sol,t)
negm.solve_owners(par,sol,t)
t_negm = elapsed(t0_negm)
# iii. evaluate values of each discrete choice
t0_evaluate = time.time()
nvfi.evaluate_rt(par,sol,t)
nvfi.evaluate_ft(par,sol,t)
nvfi.evaluate_bt(par,sol,t)
t_evaluate = elapsed(t0_evaluate)
# iv. final nvfi
t0_nvfi = time.time()
nvfi.solve_renters(par,sol,t)
t_nvfi_r = elapsed(t0_nvfi)
t0_nvfi = time.time()
nvfi.solve_owners(par,sol,t)
t_nvfi_o = elapsed(t0_nvfi)
if do_print:
msg = f't = {t:2d} solved in {elapsed(t0)}'
msg += f'[pd: {t_pd}, negm: {t_negm}, evaluate: {t_evaluate}, nvfi_r: {t_nvfi_r}, nvfi_o: {t_nvfi_o}]'
print(msg)
if do_print: print(f'model solved in {elapsed(t0_outer)}')
def simulate_model(model,do_print=True,seed=1986):
""" simulate the model """
if not seed is None: np.random.seed(seed)
par = model.par
sol = model.sol
sim = model.sim
t0_outer = time.time()
# a. draw random numbers
sim.i_beta[:] = np.random.choice(par.Nbeta,size=par.simN) # preferences
sim.a0[:] = np.random.gamma(par.a0_shape,par.a0_scale,size=par.simN) # initial assets
sim.pi_p[:] = np.random.uniform(size=(par.simN,par.T)) # income process
sim.pi_c[:] = np.random.uniform(size=(par.simN,par.T)) # discrete choice
# b. simulate
simulate.simulate(par,sol,sim)
if do_print: print(f'model simulated in {elapsed(t0_outer)}')
# class
class HousingModelClass(ModelClass):
def setup(self):
""" set baseline parameters in .par """
par = self.par
# specify list over parameters, which are allowed not to be floats
self.not_float_list = ['T','TR','age_min','t_min','Delta_iota',
'Nbeta','Na','Niota','Nh','Nht','Np','NLTV','Nm','Nx','Nz',
'Nrt','Nbt','Nft','Nkt','Ncr','Nco','do_sim','simN']
# a. economic parameters
# life-cycle
par.T = 55 # life-span from age_min
par.TR = 37 # working-life-span from age_min
par.age_min = 25 # only used in figures
par.t_min = 0 # used when solving
# income
par.rho_p = 0.99 # persistence of income shocks
par.sigma_p = 0.30 # std. of income shocks
par.G = np.ones(par.T) # age-specific growth factors of income
par.G[:20] = 1.066
par.G[20:par.TR] = 1.015
par.G[par.TR:] = 0.96
par.retirement_drop = 1.00 # drop in income at retirement
# assets and housing
par.ra = 0.035 # return on liquid assets
par.rm = 0.040 # mortgage interest rate
par.rb = 0.070 # bank loan interest rate
par.ph = 1.000 # housing price
par.rh = 0.045 # rental price
par.delta = 0.0075 # mortgage interest only spread
par.gamma_m = 0.050 # mortgage repayment rate
par.gamma_b = 0.100 # bank loan repayment rate
par.tau_f = 0.100 # loan refinancing cost
par.tau_h = 0.200 # moving-in cost for owners
par.tau_ht = 0.010 # moving-in cost for renters
par.kappa_p = 4.00 # loan-to-income ratio
par.kappa_h = 0.95 # loan-to-value ratio
par.kappa_h_mortgage = 0.80 # loan-to-value ratio (mortgage)
par.grid_h = np.array([2.0,4.0,6.0,8.0,10.0,15.0,20.0,25.0,30.0,35.0],dtype=np.float_) # housing choices
par.grid_ht = par.grid_h.copy()
par.Niota = 2 # maximum interest only period
par.Delta_iota = 0 # = 0 permanent interest only possible, else = 1
# preferences
par.beta_mean = 0.96
par.beta_low = 0.85
par.beta_high = 0.99
par.rho = 2.0 # CRRA parameter
par.nu = 20.0 # bequest utility multiplicative scaling
par.zeta = 8.0 # bequest utility additive scaling
par.alpha = 0.70 # non-durable weight
par.omega = 1.20 # homeowner bonus
par.sigma = 0.025 # smoothing
par.sigma_agg = 0.050 # smoothing
# b. computational parameters
par.Nbeta = 3 # grid for beta
par.Np = 7 # grid for p
par.NLTV = 20 # grid for LTV
par.LTV_phi = 1.0 # 1 -> equally spaced, > 1 more points closer to kappa_p
par.Na = 100 # grid for a
par.a_min = 0.0
par.a_max = 50.0
par.a_phi = 1.25 # 1 -> equally spaced, > 1 more points closer to min
par.Nx = 200 # grid for x
par.x_min = 0.0
par.x_max = 80.0
par.x_phi = 1.25 # 1 -> equally spaced, > 1 more points closer to min
par.Nz = 200 # grid for z
par.z_min = 0.0
par.z_max = 50.0
par.z_phi = 1.25 # 1 -> equally spaced, > 1 more points closer to min
# c. simulation parameters
par.do_sim = True
par.a0_shape = 0.1
par.a0_scale = 5.0
par.simN = 100_000
def create_grids(self):
""" create grids """
par = self.par
assert par.Delta_iota in [0,1]
# a. states
if par.Nbeta == 1:
par.grid_beta = np.array([par.beta_mean])
else:
par.grid_beta = np.array([par.beta_low,par.beta_mean,par.beta_high])
assert par.Nbeta == par.grid_beta.size
par.grid_LTV = np.flip(par.kappa_h-nonlinspace(0.0,par.kappa_h,par.NLTV,par.LTV_phi))
par.grid_a = nonlinspace(par.a_min,par.a_max,par.Na,par.a_phi)
par.grid_z = nonlinspace(0,par.z_max,par.Nz,par.z_phi)
par.grid_x = nonlinspace(0,par.x_max,par.Nx,par.x_phi)
# inferred size of housing grids
par.Nh = par.grid_h.size # owners
par.Nht = par.grid_ht.size # renters
# infered number of discrete choices
par.Nrt = par.Nht # number of choices for renters
par.Nkt = 1 # number of choices for keepers
par.Nft = par.Niota*par.NLTV # number of choices for refinancers
par.Nbt = par.Niota*par.Nh*par.NLTV # number of choices for buyers
par.Ncr = par.Nht + par.Nbt # number of choices for lagged renters
par.Nco = par.Nht + par.Nbt + par.Nft + par.Nkt # number of choices for lagged owners
# renters
par.r_i_ht = -1*np.ones(par.Ncr,dtype=np.int_)
par.r_iota = -1*np.ones(par.Ncr,dtype=np.int_)
par.r_i_h = -1*np.ones(par.Ncr,dtype=np.int_)
par.r_i_LTV = -1*np.ones(par.Ncr,dtype=np.int_)
par.r_d = -1*np.ones(par.Ncr,dtype=np.int_)
# owners
par.o_i_ht = -1*np.ones(par.Nco,dtype=np.int_)
par.o_iota = -1*np.ones(par.Nco,dtype=np.int_)
par.o_i_h = -1*np.ones(par.Nco,dtype=np.int_)
par.o_i_LTV = -1*np.ones(par.Nco,dtype=np.int_)
par.o_d = -1*np.ones(par.Nco,dtype=np.int_)
# rt
i = 0
for i_ht in range(par.Nht):
par.r_i_ht[i] = i_ht
par.r_d[i] = 0
par.o_i_ht[i] = i_ht
par.o_d[i] = 0
i += 1
# bt
for iota in range(par.Niota):
for i_h in range(par.Nh):
for i_LTV in range(par.NLTV):
par.r_iota[i] = iota
par.r_i_h[i] = i_h
par.r_i_LTV[i] = i_LTV
par.r_d[i] = 1
par.o_iota[i] = iota
par.o_i_h[i] = i_h
par.o_i_LTV[i] = i_LTV
par.o_d[i] = 1
i += 1
# ft
for iota in range(par.Niota):
for i_LTV in range(par.NLTV):
par.o_iota[i] = iota
par.o_i_LTV[i] = i_LTV
par.o_d[i] = 2
i += 1
# kt
par.o_d[i] = 3
# b. income
out_ = markov_rouwenhorst(par.rho_p,par.sigma_p,par.Np)
par.grid_p, par.trans_p, par.ergodic_p, par.trans_cs_p, par.ergodic_cs_p = out_
par.Gamma = np.empty(par.T)
for t in range(par.T):
if t == 0: par.Gamma[t] = 1
else: par.Gamma[t] = par.G[t]*par.Gamma[t-1]
if t == par.TR: par.Gamma[t] *= par.retirement_drop
def allocate(self):
""" create grids and allocate memory for .par, .sol and .sim """
par = self.par
sol = self.sol
sim = self.sim
# a. parameters
self.create_grids()
# b. solution
# post-decison
post_r_shape = (par.T,par.Nbeta,par.Nht,par.Np,par.Na)
sol.r_q = np.nan*np.ones(post_r_shape)
sol.r_w = np.nan*np.ones(post_r_shape)
sol.r_inv_w = np.nan*np.ones(post_r_shape)
post_o_shape = (par.T,par.Nbeta,par.Niota,par.Nh,par.Np,par.NLTV,par.Na)
sol.o_q = np.nan*np.ones(post_o_shape)
sol.o_w = np.nan*np.ones(post_o_shape)
sol.o_inv_w = np.nan*np.ones(post_o_shape)
# consumption
negm_r_shape = (par.T,par.Nbeta,par.Nht,par.Np,par.Nz)
sol.r_inv_vbar = np.nan*np.ones(negm_r_shape)
sol.r_inv_mubar = np.nan*np.ones(negm_r_shape)
sol.r_cbar = np.nan*np.ones(negm_r_shape)
negm_o_shape = (par.T,par.Nbeta,par.Niota,par.Nh,par.Np,par.NLTV,par.Nz)
sol.o_inv_vbar = np.nan*np.ones(negm_o_shape)
sol.o_inv_mubar = np.nan*np.ones(negm_o_shape)
sol.o_cbar = np.nan*np.ones(negm_o_shape)
# intermediary
rt_shape = (par.T,par.Nbeta,par.Nht+1,par.Np,par.Nx,par.Nht)
sol.rt_inv_v = np.nan*np.ones(rt_shape)
sol.rt_inv_mu = np.nan*np.ones(rt_shape)
bt_shape = (par.T,par.Nbeta,par.Np,par.Nx,par.Niota,par.Nh,par.NLTV)
sol.bt_inv_v = np.nan*np.ones(bt_shape)
sol.bt_inv_mu = np.nan*np.ones(bt_shape)
ft_shape = (par.T,par.Nbeta,par.Nh,par.Np,par.Nx,par.Niota,par.NLTV)
sol.ft_inv_v = np.nan*np.ones(ft_shape)
sol.ft_inv_mu = np.nan*np.ones(ft_shape)
# final
final_r_shape = (par.T,par.Nbeta,par.Nht,par.Np,par.Na)
sol.r_v = np.nan*np.ones(final_r_shape)
sol.r_mu = np.nan*np.ones(final_r_shape)
sol.r_d = np.nan*np.ones(final_r_shape,dtype=np.int_)
final_o_shape = (par.T,par.Nbeta,par.Niota,par.Nh,par.Np,par.NLTV,par.Na)
sol.o_v = np.nan*np.ones(final_o_shape)
sol.o_mu = np.nan*np.ones(final_o_shape)
sol.o_d = np.nan*np.ones(final_o_shape,dtype=np.int_)
# b. simulation
sim_shape = (par.simN,par.T)
sim.d = -1*np.ones(sim_shape,dtype=np.int_)
sim.iota = -1*np.ones(sim_shape,dtype=np.int_)
sim.i_h = -1*np.ones(sim_shape,dtype=np.int_)
sim.i_ht = -1*np.ones(sim_shape,dtype=np.int_)
sim.i_p = -1*np.ones(sim_shape,dtype=np.int_)
sim.LTV = np.nan*np.ones(sim_shape)
sim.a = np.nan*np.ones(sim_shape)
sim.c = np.nan*np.ones(sim_shape)
sim.Nc = np.nan*np.ones(sim_shape)
sim.x = np.nan*np.ones(sim_shape)
sim.i_beta = -1*np.ones(par.simN,dtype=np.int_)
sim.a0 = np.nan*np.ones(par.simN)
sim.pi_p = np.nan*np.ones(sim_shape)
sim.pi_c = np.nan*np.ones(sim_shape)
def load_data(self):
self.owner = dict()
self.renter = dict()
self.full = dict()
stats = ['count', 'mean', 'p10', 'p25', 'p50', 'p75', 'p90']
for stat in stats:
self.owner[stat] = pd.read_csv(f'moments/{stat}_by_age_owner.txt', index_col='fam_age')
self.renter[stat] = pd.read_csv(f'moments/{stat}_by_age_renter.txt', index_col='fam_age')
self.full[stat] = pd.read_csv(f'moments/{stat}_by_age_all.txt', index_col='fam_age')
solve = solve_model
simulate = simulate_model
def test(self):
""" used for testing parallel possibilities """
solve_model(self,t_min=0,do_print=True)
self.simulate()
|
hajadelmas/homners
|
src/templates/operation.js
|
<reponame>hajadelmas/homners
import React from "react"
import Layout from "../components/layout"
import SEO from "../components/seo"
import { graphql, Link } from "gatsby"
import Slider from "react-slick"
import { GatsbyImage } from 'gatsby-plugin-image'
import "slick-carousel/slick/slick.css";
import "slick-carousel/slick/slick-theme.css";
import "./operation.scss"
function SampleNextArrow(props) {
const { className, style, onClick } = props;
return (
<div
className={className}
style={{ ...style, display: "none" }}
onClick={onClick}
/>
);
}
function SamplePrevArrow(props) {
const { className, style, onClick } = props;
return (
<div
className={className}
style={{ ...style, display: "none" }}
onClick={onClick}
/>
);
}
const operation = ({ data }) => {
// const { title, date } = data.markdownRemark.frontmatter
// const __html = data.markdownRemark.html
// const { prev, next } = pageContext
var settings = {
dots: true,
infinite: true,
speed: 500,
slidesToShow: 1,
slidesToScroll: 1,
// adaptiveHeight: true
nextArrow: <SampleNextArrow />,
prevArrow: <SamplePrevArrow />,
};
const { titre, description, commune, photos, lienLeboncoin, descriptionNode, prix,
typeDeBien,
typeDeTransaction,
bienEnCopropriete,
nombreLotCopropriete,
procedureDiligente,
nombrePieces,
chambres,
typeChauffage,
modeChauffage,
calme,
clair,
jardin,
neufAncien,
etatGeneral,
surface,
surfaceTerrain } = data.datoCmsOperation
return (
<Layout>
<SEO title={titre + commune} description={description} />
<div className='container_product'>
<div className='container_slider'>
<Slider {...settings} className='slider_custom'>
<GatsbyImage image={photos[0].gatsbyImageData} alt='' className='' />
<GatsbyImage image={photos[1].gatsbyImageData} alt='' className='' />
<GatsbyImage image={photos[2].gatsbyImageData} alt='' className='' />
</Slider>
</div>
<div className='container_desc'>
<h1>{titre}</h1>
<p>Commune : {commune}</p>
<div className='' dangerouslySetInnerHTML={{ __html: descriptionNode.childMarkdownRemark.html, }}>
</div>
{/* <h3>Pour plus de détails, <Link to={lienLeboncoin}>Cliquez ici.</Link></h3> */}
</div>
</div>
<div className="tableau">
<table>
<tbody>
<h3>Informations générales</h3>
<tr>
<th>Type de bien</th>
<td>{typeDeBien}</td>
</tr>
<tr>
<th>Type de transaction</th>
<td>{typeDeTransaction}</td>
</tr>
<h3>Localisation</h3>
<tr>
<th>localisation</th>
<td>{commune}</td>
</tr>
<h3>Aspect financier</h3>
<tr>
<th>Prix</th>
<td>{prix} €</td>
</tr>
<h3>Copropriété</h3>
<tr>
<th>Bien en copropriété</th>
<td>{bienEnCopropriete ? "oui" : "non"}</td>
</tr>
<tr>
<th>Nombre de lots copro</th>
<td>{nombreLotCopropriete}</td>
</tr>
<tr>
<th>Procédures diligentées</th>
<td>{procedureDiligente}</td>
</tr>
<h3>Intérieur</h3>
<tr>
<th>Nombre de pieces</th>
<td>{nombrePieces}</td>
</tr>
<tr>
<th>Chambres</th>
<td>{chambres}</td>
</tr>
<tr>
<th>Type de chauffage</th>
<td>{typeChauffage}</td>
</tr>
<tr>
<th>Mode de chauffage</th>
<td>{modeChauffage}</td>
</tr>
<tr>
<th>Calme</th>
<td>{calme ? "oui" : "non"}</td>
</tr>
<tr>
<th>Clair</th>
<td>{clair ? "oui" : "non"}</td>
</tr>
<h3>Extérieur</h3>
<tr>
<th>Jardin</th>
<td>{jardin ? "oui" : "non"}</td>
</tr>
<tr>
<th>Neuf - Ancien</th>
<td>{neufAncien}</td>
</tr>
<tr>
<th>Etat général</th>
<td>{etatGeneral}</td>
</tr>
<h3>Surfaces</h3>
<tr>
<th>Surface</th>
<td>{surface}</td>
</tr>
<tr>
<th>Surface terrain</th>
<td>{surfaceTerrain}</td>
</tr>
</tbody>
</table>
</div>
</Layout>
)
}
export default operation
export const query = graphql`
query MyOperation($slug: String!) {
datoCmsOperation(slug: { eq: $slug }) {
commune
description
photos {
gatsbyImageData(width: 300)
}
prix
slug
titre
lienLeboncoin
id
descriptionNode {
childMarkdownRemark {
html
timeToRead
}
}
typeDeBien
typeDeTransaction
bienEnCopropriete
nombreLotCopropriete
procedureDiligente
nombrePieces
chambres
typeChauffage
modeChauffage
calme
clair
jardin
neufAncien
etatGeneral
surface
surfaceTerrain
}
}
`
|
mauryakrishna/experiences-client
|
src/utils/didExperienceContainsText.js
|
<filename>src/utils/didExperienceContainsText.js<gh_stars>0
/**
* input => editor JSON
* output => Boolean if any of text property has value
*/
const isContainText = (valueChildren) => {
const childrensLen = valueChildren.length
for(let i=0; i<=childrensLen-1; i++) {
const child = valueChildren[i]
if(child.text && child.text.length > 0) {
return true
}
else if(child.children) {
return isContainText(child.children);
}
}
return false
}
export default isContainText
|
leetobin/firebrick
|
coreboot/src/vendorcode/amd/agesa/f15/Proc/CPU/Feature/cpuSlit.c
|
<reponame>leetobin/firebrick
/* $NoKeywords:$ */
/**
* @file
*
* AMD SLIT, ACPI table related API functions.
*
* Contains code that generates the SLIT table
*
* @xrefitem bom "File Content Label" "Release Content"
* @e project: AGESA
* @e sub-project: CPU
* @e \$Revision: 54901 $ @e \$Date: 2011-06-13 21:51:47 -0600 (Mon, 13 Jun 2011) $
*
*/
/*
******************************************************************************
*
* Copyright (C) 2012 Advanced Micro Devices, Inc.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* * Neither the name of Advanced Micro Devices, Inc. nor the names of
* its contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL ADVANCED MICRO DEVICES, INC. BE LIABLE FOR ANY
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
******************************************************************************
*/
/*----------------------------------------------------------------------------
* This file provides functions, that will generate SLIT tables
*----------------------------------------------------------------------------
*/
/*----------------------------------------------------------------------------------------
* M O D U L E S U S E D
*----------------------------------------------------------------------------------------
*/
#include "AGESA.h"
#include "amdlib.h"
#include "OptionSlit.h"
#include "heapManager.h"
#include "cpuLateInit.h"
#include "cpuRegisters.h"
#include "Ids.h"
#include "cpuFeatures.h"
#include "cpuFamilyTranslation.h"
#include "cpuL3Features.h"
#include "Filecode.h"
CODE_GROUP (G3_DXE)
RDATA_GROUP (G3_DXE)
#define FILECODE PROC_CPU_FEATURE_CPUSLIT_FILECODE
/*----------------------------------------------------------------------------------------
* D E F I N I T I O N S A N D M A C R O S
*----------------------------------------------------------------------------------------
*/
extern OPTION_SLIT_CONFIGURATION OptionSlitConfiguration; // global user config record
STATIC ACPI_TABLE_HEADER ROMDATA CpuSlitHdrStruct =
{
{'S','L','I','T'},
0,
1,
0,
{'A','M','D',' ',' ',' '},
{'A','G','E','S','A',' ',' ',' '},
1,
{'A','M','D',' '},
1
};
/*----------------------------------------------------------------------------------------
* T Y P E D E F S A N D S T R U C T U R E S
*----------------------------------------------------------------------------------------
*/
/*----------------------------------------------------------------------------------------
* P R O T O T Y P E S O F L O C A L F U N C T I O N S
*----------------------------------------------------------------------------------------
*/
VOID
STATIC
AcpiSlitHBufferFind (
IN OUT AMD_CONFIG_PARAMS *StdHeader,
IN UINT8 **SocketTopologyPtr
);
/*----------------------------------------------------------------------------------------
* P R O T O T Y P E S O F E X P O R T E D F U N C T I O N S
*----------------------------------------------------------------------------------------
*/
AGESA_STATUS
GetAcpiSlitStub (
IN OUT AMD_CONFIG_PARAMS *StdHeader,
IN PLATFORM_CONFIGURATION *PlatformConfig,
IN OUT VOID **SlitPtr
);
AGESA_STATUS
GetAcpiSlitMain (
IN OUT AMD_CONFIG_PARAMS *StdHeader,
IN PLATFORM_CONFIGURATION *PlatformConfig,
IN OUT VOID **SlitPtr
);
AGESA_STATUS
ReleaseSlitBufferStub (
IN OUT AMD_CONFIG_PARAMS *StdHeader
);
AGESA_STATUS
ReleaseSlitBuffer (
IN OUT AMD_CONFIG_PARAMS *StdHeader
);
/*----------------------------------------------------------------------------------------
* E X P O R T E D F U N C T I O N S
*----------------------------------------------------------------------------------------
*/
extern CPU_FAMILY_SUPPORT_TABLE L3FeatureFamilyServiceTable;
/*---------------------------------------------------------------------------------------*/
/**
*
* This function generates a complete SLIT table into a memory buffer.
* After completion, this table must be set by the system BIOS into its
* internal ACPI namespace, and linked into the RSDT/XSDT
*
* @param[in, out] StdHeader Standard Head Pointer
* @param[in] PlatformConfig Config handle for platform specific information
* @param[in, out] SlitPtr Point to Slit Struct including buffer address and length
*
* @retval UINT32 AGESA_STATUS
*/
AGESA_STATUS
CreateAcpiSlit (
IN OUT AMD_CONFIG_PARAMS *StdHeader,
IN PLATFORM_CONFIGURATION *PlatformConfig,
IN OUT VOID **SlitPtr
)
{
AGESA_TESTPOINT (TpProcCpuEntrySlit, StdHeader);
return ((*(OptionSlitConfiguration.SlitFeature)) (StdHeader, PlatformConfig, SlitPtr));
}
/*---------------------------------------------------------------------------------------*/
/**
*
* This is the default routine for use when the SLIT option is NOT requested.
*
* The option install process will create and fill the transfer vector with
* the address of the proper routine (Main or Stub). The link optimizer will
* strip out of the .DLL the routine that is not used.
*
* @param[in, out] StdHeader Standard Head Pointer
* @param[in] PlatformConfig Config handle for platform specific information
* @param[in, out] SlitPtr Point to Slit Struct including buffer address and length
*
* @retval AGESA_STATUS
*/
AGESA_STATUS
GetAcpiSlitStub (
IN OUT AMD_CONFIG_PARAMS *StdHeader,
IN PLATFORM_CONFIGURATION *PlatformConfig,
IN OUT VOID **SlitPtr
)
{
return AGESA_UNSUPPORTED;
}
/*---------------------------------------------------------------------------------------*/
/**
*
* This function generates a complete SLIT table into a memory buffer.
* After completion, this table must be set by the system BIOS into its
* internal ACPI namespace, and linked into the RSDT/XSDT
*
* @param[in, out] StdHeader Standard Head Pointer
* @param[in] PlatformConfig Config handle for platform specific information
* @param[in, out] SlitPtr Point to Slit Struct including buffer address and length
*
* @retval UINT32 AGESA_STATUS
*/
AGESA_STATUS
GetAcpiSlitMain (
IN OUT AMD_CONFIG_PARAMS *StdHeader,
IN PLATFORM_CONFIGURATION *PlatformConfig,
IN OUT VOID **SlitPtr
)
{
UINT8 MaxHops;
UINT8 SocketNum;
UINT8 i;
UINT8 j;
UINT8 *BufferPtr;
UINT8 *SocketTopologyDataPtr;
UINT8 *SocketTopologyPtr;
UINT32 Socket;
BOOLEAN IsProbeFilterEnabled;
ACPI_TABLE_HEADER *CpuSlitHeaderStructPtr;
AGESA_STATUS Flag;
ALLOCATE_HEAP_PARAMS AllocStruct;
L3_FEATURE_FAMILY_SERVICES *FamilyServices;
MaxHops = 0;
SocketTopologyPtr = NULL;
Flag = AGESA_ERROR;
IsProbeFilterEnabled = FALSE;
// find out the pointer to the BufferHandle which contains
// Node Topology information
AcpiSlitHBufferFind (StdHeader, &SocketTopologyPtr);
if (SocketTopologyPtr == 0) {
return (Flag);
}
SocketNum = *SocketTopologyPtr;
IDS_HDT_CONSOLE (CPU_TRACE, " SLIT is created\n");
// create a buffer by calling IBV callout routine
AllocStruct.RequestedBufferSize = (SocketNum * SocketNum) + AMD_ACPI_SLIT_SOCKET_NUM_LENGTH + sizeof (ACPI_TABLE_HEADER);
AllocStruct.BufferHandle = AMD_ACPI_SLIT_BUFFER_HANDLE;
AllocStruct.Persist = HEAP_SYSTEM_MEM;
if (HeapAllocateBuffer (&AllocStruct, StdHeader) != AGESA_SUCCESS) {
return (Flag);
}
*SlitPtr = AllocStruct.BufferPtr;
//SLIT header
LibAmdMemCopy (*SlitPtr, (VOID *) &CpuSlitHdrStruct, (UINTN) (sizeof (ACPI_TABLE_HEADER)), StdHeader);
CpuSlitHeaderStructPtr = (ACPI_TABLE_HEADER *) *SlitPtr;
CpuSlitHeaderStructPtr->TableLength = (UINT32) AllocStruct.RequestedBufferSize;
BufferPtr = *SlitPtr;
Flag = AGESA_SUCCESS;
// SLIT body
// Check if Probe Filter is enabled
if (IsFeatureEnabled (L3Features, PlatformConfig, StdHeader)) {
IsProbeFilterEnabled = TRUE;
for (Socket = 0; Socket < GetPlatformNumberOfSockets (); Socket++) {
if (IsProcessorPresent (Socket, StdHeader)) {
GetFeatureServicesOfSocket (&L3FeatureFamilyServiceTable, Socket, (CONST VOID **)&FamilyServices, StdHeader);
if ((FamilyServices == NULL) || (!FamilyServices->IsHtAssistSupported (FamilyServices, PlatformConfig, StdHeader))) {
IsProbeFilterEnabled = FALSE;
break;
}
}
}
}
if (!IsProbeFilterEnabled) {
// probe filter is disabled
// get MaxHops
SocketTopologyDataPtr = SocketTopologyPtr + sizeof (SocketNum);
for (i = 0; i < SocketNum; i++) {
for (j = 0; j < SocketNum; j++) {
if (*SocketTopologyDataPtr > MaxHops) {
MaxHops = *SocketTopologyDataPtr;
}
SocketTopologyDataPtr++;
}
}
// the Max hop entries have a value of 13
// and all other entries have 10.
SocketTopologyDataPtr = SocketTopologyPtr + sizeof (SocketNum);
for (i = 0; i < SocketNum; i++) {
for (j = 0; j < SocketNum; j++) {
if (*SocketTopologyDataPtr++ == MaxHops) {
*(BufferPtr + sizeof (ACPI_TABLE_HEADER) +
AMD_ACPI_SLIT_SOCKET_NUM_LENGTH + (i * SocketNum) + j) = 13;
} else {
*(BufferPtr + sizeof (ACPI_TABLE_HEADER) +
AMD_ACPI_SLIT_SOCKET_NUM_LENGTH + (i * SocketNum) + j) = 10;
}
}
}
} else {
// probe filter is enabled
// formula : num_hops * 6 + 10
SocketTopologyDataPtr = SocketTopologyPtr + sizeof (SocketNum);
for (i = 0; i < SocketNum; i++) {
for (j = 0; j < SocketNum; j++) {
*(BufferPtr + sizeof (ACPI_TABLE_HEADER) +
AMD_ACPI_SLIT_SOCKET_NUM_LENGTH + (i * SocketNum) + j) =
((*SocketTopologyDataPtr++) * 6) + 10;
}
}
}
BufferPtr += sizeof (ACPI_TABLE_HEADER);
*((UINT64 *) BufferPtr) = (UINT64) SocketNum;
//Update SLIT header Checksum
ChecksumAcpiTable ((ACPI_TABLE_HEADER *) *SlitPtr, StdHeader);
return (Flag);
}
/*---------------------------------------------------------------------------------------
* L O C A L F U N C T I O N S
*---------------------------------------------------------------------------------------
*/
/*---------------------------------------------------------------------------------------*/
/**
*
* Find out the pointer to the BufferHandle which contains
* Node Topology information
*
* @param[in, out] StdHeader Standard Head Pointer
* @param[in] SocketTopologyPtr Point to the address of Socket Topology
*
*/
VOID
STATIC
AcpiSlitHBufferFind (
IN OUT AMD_CONFIG_PARAMS *StdHeader,
IN UINT8 **SocketTopologyPtr
)
{
LOCATE_HEAP_PTR LocateBuffer;
LocateBuffer.BufferHandle = HOP_COUNT_TABLE_HANDLE;
if (HeapLocateBuffer (&LocateBuffer, StdHeader) == AGESA_SUCCESS) {
*SocketTopologyPtr = (UINT8 *) LocateBuffer.BufferPtr;
}
return;
}
/* -----------------------------------------------------------------------------*/
/**
* ReleaseSlitBufferStub
*
* Description:
* This is the default routine for use when the SLIT option is NOT requested.
*
* Parameters:
* @param[in, out] *StdHeader
*
* @retval AGESA_STATUS
*
*/
AGESA_STATUS
ReleaseSlitBufferStub (
IN OUT AMD_CONFIG_PARAMS *StdHeader
)
{
return AGESA_UNSUPPORTED;
}
/* -----------------------------------------------------------------------------*/
/**
* ReleaseSlitBuffer
*
* Description:
* Deallocate SLIT buffer
*
* Parameters:
* @param[in, out] *StdHeader
*
* @retval AGESA_STATUS
*
*/
AGESA_STATUS
ReleaseSlitBuffer (
IN OUT AMD_CONFIG_PARAMS *StdHeader
)
{
HeapDeallocateBuffer ((UINT32) HOP_COUNT_TABLE_HANDLE, StdHeader);
return AGESA_SUCCESS;
}
|
priestkings/znhg
|
wechatapp/pages/index/index.js
|
var mta= require('../../analysis/mta_analysis.js')
var api = require('../../api.js');
var app = getApp();
var share_count = 0;
var width = 260;
var int = 1;
Page({
data: {
x: wx.getSystemInfoSync().windowWidth,
y: wx.getSystemInfoSync().windowHeight,
left: 0,
show_notice: false,
animationData: {},
indicatorDots: true,
vertical: false,
autoplay: false,
interval: 2000,
duration: 500,
incolor:'#FF9966',
activeColor:'#FF5E62',
isopen:false
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
app.pageOnLoad(this);
this.loadData(options);
var page = this;
var parent_id = 0;
var user_id = options.user_id;
var scene = decodeURIComponent(options.scene);
if (user_id != undefined) {
parent_id = user_id;
}
else if (scene != undefined) {
parent_id = scene;
}
console.log(options)
console.log('console.log(parent_id)------------------'+parent_id+'user_id'+user_id)
app.loginBindParent({ parent_id: parent_id });
console.log('console.log(loginBindParent)------------------')
},
/**
* 加载页面数据
*/
loadData: function (options) {
var page = this;
var pages_index_index = wx.getStorageSync('pages_index_index');
if (pages_index_index) {
page.setData(pages_index_index);
}
app.request({
url: api.default.index,
success: function (res) {
if (res.code == 0) {
page.setData(res.data);
wx.setStorageSync('pages_index_index', res.data);
wx.setStorageSync('store', res.data.store);
page.seckillTimer();
page.bookmall_seckillTimer();
page.crowdc_seckillTimer();
}
},
complete: function () {
wx.stopPullDownRefresh();
}
});
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
app.pageOnShow(this);
share_count = 0;
var store = wx.getStorageSync("store");
if (store && store.name) {
wx.setNavigationBarTitle({
title: store.name,
});
}
clearInterval(int);
this.notice();
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {
this.loadData();
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function (options) {
var page = this;
var user_info = wx.getStorageSync("user_info");
return {
path: "/pages/index/index?user_id=" + user_info.id,
success: function (e) {
share_count++;
if (share_count == 1)
app.shareSendCoupon(page);
}
};
},
receive: function (e) {
var page = this;
var id = e.currentTarget.dataset.index;
wx.showLoading({
title: '领取中',
mask: true,
})
if (!page.hideGetCoupon) {
page.hideGetCoupon = function (e) {
var url = e.currentTarget.dataset.url || false;
page.setData({
get_coupon_list: null,
});
if (url) {
wx.navigateTo({
url: url,
});
}
};
}
app.request({
url: api.coupon.receive,
data: { id: id },
success: function (res) {
wx.hideLoading();
if (res.code == 0) {
page.setData({
get_coupon_list: res.data.list,
coupon_list: res.data.coupon_list
});
} else {
wx.showToast({
title: res.msg,
duration: 2000
})
page.setData({
coupon_list: res.data.coupon_list
});
}
},
// complete: function () {
// wx.hideLoading();
// }
});
},
navigatorClick: function (e) {
var page = this;
var open_type = e.currentTarget.dataset.open_type;
var url = e.currentTarget.dataset.url;
if (open_type != 'wxapp')
return true;
//console.log(url);
url = parseQueryString(url);
url.path = url.path ? decodeURIComponent(url.path) : "";
console.log("Open New App");
wx.navigateToMiniProgram({
appId: url.appId,
path: url.path,
complete: function (e) {
console.log(e);
}
});
return false;
function parseQueryString(url) {
var reg_url = /^[^\?]+\?([\w\W]+)$/,
reg_para = /([^&=]+)=([\w\W]*?)(&|$|#)/g,
arr_url = reg_url.exec(url),
ret = {};
if (arr_url && arr_url[1]) {
var str_para = arr_url[1], result;
while ((result = reg_para.exec(str_para)) != null) {
ret[result[1]] = result[2];
}
}
return ret;
}
},
closeCouponBox: function (e) {
this.setData({
get_coupon_list: ""
});
},
notice: function () {
var page = this;
var notice = page.data.notice;
if (notice == undefined) {
return;
}
var length = notice.length * 14;
return ;
var left = 0;
var right = 260;
var new_width = width * (page.data.x) / 375;
console.log(length)
if (length < new_width) {
return;
}
int = setInterval(function () {
// if (left + new_width >= length) {
// left = 0;
// } else {
// left += 10;
// }
// page.setData({
// left: -left
// });
left += 2;
if (left + new_width >= length) {
var l = left + new_width;
right -= 2;
page.setData({
show_second: true,
});
if (right <= 0) {
left = 0;
right = 260;
page.setData({
show_second: false,
});
}
}
page.setData({
left: -left,
right: right
});
}, 250);
},
seckillTimer: function () {
var page = this;
if (!page.data.seckill || !page.data.seckill.rest_time)
return;
var timer = setInterval(function () {
if (page.data.seckill.rest_time > 0) {
page.data.seckill.rest_time = page.data.seckill.rest_time - 1;
} else {
clearInterval(timer);
return;
}
page.data.seckill.times = page.getTimesBySecond(page.data.seckill.rest_time);
page.setData({
seckill: page.data.seckill,
});
}, 1000);
},
bookmall_seckillTimer: function () {
var page = this;
console.log(page.data.bookmall_seckill);
if (!page.data.bookmall_seckill || !page.data.bookmall_seckill.rest_time)
return;
var timer = setInterval(function () {
if (page.data.bookmall_seckill.rest_time > 0) {
page.data.bookmall_seckill.rest_time = page.data.bookmall_seckill.rest_time - 1;
} else {
clearInterval(timer);
return;
}
page.data.bookmall_seckill.times = page.getTimesBySecond(page.data.bookmall_seckill.rest_time);
page.setData({
bookmall_seckill: page.data.bookmall_seckill,
});
}, 1000);
},
crowdc_seckillTimer: function () {
var page = this;
console.log(page.data.crowdc_seckill);
if (!page.data.crowdc_seckill || !page.data.crowdc_seckill.rest_time)
return;
var timer = setInterval(function () {
if (page.data.crowdc_seckill.rest_time > 0) {
page.data.crowdc_seckill.rest_time = page.data.crowdc_seckill.rest_time - 1;
} else {
clearInterval(timer);
return;
}
page.data.crowdc_seckill.times = page.getTimesBySecond(page.data.crowdc_seckill.rest_time);
page.setData({
crowdc_seckill: page.data.crowdc_seckill,
});
}, 1000);
},
onHide: function () {
app.pageOnHide(this);
clearInterval(int);
},
onUnload: function () {
app.pageOnUnload(this);
clearInterval(int);
},
showNotice: function (e) {
console.log(e)
mta.Event.stat('buy',{'price':'true'})
this.setData({
show_notice: true
});
},
closeNotice: function () {
this.setData({
show_notice: false
});
},
getTimesBySecond: function (s) {
s = parseInt(s);
if (isNaN(s))
return {
h: '00',
m: '00',
s: '00',
};
var _h = parseInt(s / 3600);
var _m = parseInt((s % 3600) / 60);
var _s = s % 60;
return {
h: _h < 10 ? ('0' + _h) : ('' + _h),
m: _m < 10 ? ('0' + _m) : ('' + _m),
s: _s < 10 ? ('0' + _s) : ('' + _s),
};
},
tabOpen:function(){
this.setData({
isopen:!this.data.isopen
})
},
yushou: function () {
var user_info = wx.getStorageSync("user_info");
if(user_info.coupon<0){
wx.navigateTo({
url: '/pages/fair/fair',
})
}else {
wx.navigateTo({
url: '/pages/mall/mall',
})
}
},
});
|
ScalablyTyped/SlinkyTyped
|
w/winrt/src/main/scala/typingsSlinky/winrt/Windows/Graphics/Imaging/BitmapFlip.scala
|
<reponame>ScalablyTyped/SlinkyTyped<filename>w/winrt/src/main/scala/typingsSlinky/winrt/Windows/Graphics/Imaging/BitmapFlip.scala
package typingsSlinky.winrt.Windows.Graphics.Imaging
import org.scalablytyped.runtime.StObject
import scala.scalajs.js
import scala.scalajs.js.`|`
import scala.scalajs.js.annotation.{JSGlobalScope, JSGlobal, JSImport, JSName, JSBracketAccess}
@js.native
sealed trait BitmapFlip extends StObject
@JSGlobal("Windows.Graphics.Imaging.BitmapFlip")
@js.native
object BitmapFlip extends StObject {
@js.native
sealed trait horizontal extends BitmapFlip
@js.native
sealed trait none extends BitmapFlip
@js.native
sealed trait vertical extends BitmapFlip
}
|
sail-ml/sail
|
sail/csrc/python/py_dtypes/py_dtype_def.h
|
<reponame>sail-ml/sail
#pragma once
#include <Python.h>
#include <structmember.h>
#include <chrono>
#include <iostream>
#include "core/dtypes.h"
#include "numpy/arrayobject.h"
#include "../macros.h"
typedef struct {
PyObject_HEAD PyObject *base_object = NULL;
Dtype dtype;
int dt_val;
} PyDtype;
///////////// REPR ////////////////////////////
static PyObject *PyDtype_Repr(PyDtype *obj) {
if (obj->dt_val == 11) {
return PyUnicode_FromString("<class 'sail.float32'>");
} else if (obj->dt_val == 12) {
return PyUnicode_FromString("<class 'sail.float64'>");
} else if (obj->dt_val == 1) {
return PyUnicode_FromString("<class 'sail.int8'>");
} else if (obj->dt_val == 2) {
return PyUnicode_FromString("<class 'sail.uint8'>");
} else if (obj->dt_val == 3) {
return PyUnicode_FromString("<class 'sail.int16'>");
} else if (obj->dt_val == 4) {
return PyUnicode_FromString("<class 'sail.uint16'>");
} else if (obj->dt_val == 5) {
return PyUnicode_FromString("<class 'sail.int32'>");
} else if (obj->dt_val == 6) {
return PyUnicode_FromString("<class 'sail.uint32'>");
} else if (obj->dt_val == 7) {
return PyUnicode_FromString("<class 'sail.int64'>");
} else if (obj->dt_val == 8) {
return PyUnicode_FromString("<class 'sail.uint64'>");
} else {
return PyUnicode_FromString("<class 'sail.dtype'>");
}
}
static int PyDtype_traverse(PyDtype *self, visitproc visit, void *arg);
static int PyDtype_clear(PyDtype *self);
static void PyDtype_dealloc(PyDtype *self);
static PyTypeObject PyDtypeBase = {
PyVarObject_HEAD_INIT(NULL, 0) "sail.dtype", /* tp_name */
sizeof(PyDtype), /* tp_basicsize */
0, /* tp_itemsize */
(destructor)PyDtype_dealloc, /* tp_dealloc */
0, /* tp_print */
0, /* tp_getattr */
0, /* tp_setattr */
0, /* tp_reserved */
(reprfunc)PyDtype_Repr, /* tp_repr */
0, /* tp_as_number */
0, /* tp_as_sequence */
0, /* tp_as_mapping */
0, /* tp_hash */
0, /* tp_call */
0, /* tp_str */
0, /* tp_getattro */
0, /* tp_setattro */
0, /* tp_as_buffer */
Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE |
Py_TPFLAGS_HAVE_GC, /* tp_flags */
"Custom objects", /* tp_doc */
(traverseproc)PyDtype_traverse, /* tp_traverse */
(inquiry)PyDtype_clear, /* tp_clear */
0, /* tp_richcompare */
0, /* tp_weaklistoffset */
0, // (getiterfunc)Chromosone_getiter, /* tp_iter */
0, /* tp_iter */
0, /* tp_iternext */
0, /* tp_methods */
0, /* tp_members */
0, // PyTensor_getsetters, /* tp_getset */
0, /* tp_base */
0, /* tp_dict */
0, /* tp_descr_get */
0, /* tp_descr_set */
0, /* tp_dictoffset */
0, //(initproc)PyDtype_init, /* tp_init */
0, /* tp_alloc */
0,
};
|
jultar2000/Underwater_Drone
|
Dron/src/Macierz.cpp
|
#include "Macierz.hh"
#include "Wektor.hh"
using namespace std;
/*
* Tutaj nalezy zdefiniowac odpowiednie metody
* klasy Macierz<Typ,SWymiar>, ktore zawieraja wiecej kodu
* niz dwie linijki.
* Mniejsze metody mozna definiwac w ciele klasy.
*/
template<class Typ, int SWymiar>
Macierz <Typ,SWymiar>::Macierz() //konstruktor domyslny
{
Wektor<Typ,SWymiar> a;
for(int i; i<SWymiar;i++)
{
tab1[i]=a;
}
}
template<class Typ, int SWymiar>
Wektor<Typ,SWymiar> & Macierz<Typ,SWymiar>::operator[](int index)
{
if (index < 0 || index >= SWymiar)
{
cerr << "poza zakresem" << endl;
exit(1);
}
return tab1[index];
}
template<class Typ, int SWymiar>
const Wektor<Typ,SWymiar> & Macierz <Typ,SWymiar>::operator[](int index) const
{
if (index < 0 || index >= SWymiar)
{
cerr << "poza zakresem" << endl;
exit(1);
}
return tab1[index];
}
template<class Typ, int SWymiar>
Macierz<Typ,SWymiar> Macierz<Typ,SWymiar>::transponuj() const //transpozycja Macierz<Typ,SWymiar>y
{
Macierz<Typ,SWymiar> mac;
int i;
int j;
for(i=0;i<SWymiar;i++)
{
for(j=0;j<SWymiar;j++)
{
mac[i][j]=tab1[j][i];
}
}
return mac;
}
template<class Typ, int SWymiar>
Wektor<Typ,SWymiar> Macierz<Typ,SWymiar>::operator*(const Wektor<Typ,SWymiar> & w1) const // operator Macierz<Typ,SWymiar> razy wektor
{
Wektor<Typ,SWymiar> wekt;
int i;
for(i=0;i<=2;i++)
{
wekt[i]=tab1[i]*w1;
}
return wekt;
}
template<class Typ, int SWymiar>
Macierz<Typ,SWymiar> Macierz<Typ,SWymiar>::operator *(Macierz<Typ,SWymiar> B) const // operator Macierz<Typ,SWymiar> razy Macierz<Typ,SWymiar>
{
Macierz<Typ,SWymiar> mac2;
Macierz<Typ,SWymiar> mac;
int i;
mac2=*this;
mac2=mac2.transponuj();
for(i=0;i<SWymiar;i++)
{
mac[i]=mac2*B[i];
}
return mac;
}
template<class Typ, int SWymiar>
Typ Macierz<Typ,SWymiar>::wyznacznik_sarrusa() const
{
Typ Wynik;
Wynik=tab1[0][0]*tab1[1][1]*tab1[2][2]+tab1[0][1]*tab1[1][2]*tab1[2][0]+tab1[0][2]*tab1[1][0]*tab1[2][1]-tab1[2][0]*tab1[1][1]*tab1[0][2]-tab1[2][1]*tab1[1][2]*tab1[0][0]-tab1[2][2]*tab1[1][0]*tab1[0][1];
return Wynik;
}
template<class Typ, int SWymiar>
Typ Macierz<Typ,SWymiar>::wyznacznik_1() const
{
Typ a;
Typ Wynik;
a=0;
Wynik=1;
Macierz <Typ,SWymiar> mac = (*this);
for ( int i = 0; i < SWymiar; ++i){
for ( int j = i+1; j < SWymiar; ++j){
a = mac[j][i]/mac[i][i];
for ( int k = i; k < SWymiar; ++k){
mac[j][k]=mac[j][k] - a*mac[i][k];
}
}
}
for ( int g = 0; g < SWymiar; ++g){
Wynik = mac[g][g]*Wynik;
}
return Wynik;
}
template<class Typ, int SWymiar>
Macierz<Typ,SWymiar> Macierz<Typ,SWymiar>::operator +(Macierz<Typ,SWymiar> B) const // operator dodawania Macierz<Typ,SWymiar>y
{
Macierz<Typ,SWymiar> mac;
int i;
for(i=0;i<SWymiar;i++)
{
mac[i]=tab1[i]+B[i];
}
return mac;
}
template<class Typ, int SWymiar>
Macierz<Typ,SWymiar> Macierz<Typ,SWymiar>::operator -(Macierz<Typ,SWymiar> B) const // operator odejmowania Macierz<Typ,SWymiar>y
{
Macierz<Typ,SWymiar> mac;
int i;
for(i=0;i<SWymiar;i++)
{
mac[i]=tab1[i]-B[i];
}
return mac;
}
template<class Typ, int SWymiar>
Macierz<Typ,SWymiar> Macierz<Typ,SWymiar>::operator *(Typ B) const // operator mnozenia Macierz<Typ,SWymiar>y przez liczbe
{
Macierz<Typ,SWymiar> mac;
int i;
for(i=0;i<SWymiar;i++)
{
mac[i]=tab1[i]*B;
}
return mac;
}
template<class Typ, int SWymiar>
bool Macierz<Typ,SWymiar>::operator== (const Macierz<Typ,SWymiar> & W2) const //porownanie Macierz<Typ,SWymiar>y
{
int i;
for(i=0;i<SWymiar;i++){
W2[i]==tab1[i];
return true;
}
return false;
}
template<class Typ, int SWymiar>
bool Macierz<Typ,SWymiar>::operator!= (const Macierz<Typ,SWymiar> & W2) const // Operator sprawdzenia nierownosci
{
return !(*this==W2);
}
template<class Typ, int SWymiar>
std::istream& operator >> (std::istream &Strm, Macierz<Typ,SWymiar> &Mac) // przeciazenie wejscia Macierz<Typ,SWymiar>y
{
int i;
for(i=0;i<SWymiar;i++)
{
Strm>>Mac[i];
}
return Strm;
}
template<class Typ, int SWymiar>
std::ostream& operator << (std::ostream &Strm, const Macierz<Typ,SWymiar> &Mac) // przeciazenie wyjscia Macierz<Typ,SWymiar>y
{
int i;
for(i=0;i<SWymiar;i++)
{
Strm<<Mac[i];
cout <<endl;
}
return Strm;
}
|
bartekpacia/informatyka
|
zbior/65/reader.py
|
def read_data() -> list[tuple[str, str, float]]:
ulamki: list[tuple[str, str, float]] = []
with open("dane_ulamki.txt") as f:
for line in f:
sline = line.strip()
licznik, mianownik = sline.split()
ulamek_wartosc = int(licznik) / int(mianownik)
ulamek = (licznik, mianownik, ulamek_wartosc)
ulamki.append(ulamek)
return ulamki
|
Aaron1011/Glowstone
|
src/main/java/net/glowstone/net/message/play/entity/EntityMetadataMessage.java
|
<filename>src/main/java/net/glowstone/net/message/play/entity/EntityMetadataMessage.java
package net.glowstone.net.message.play.entity;
import com.flowpowered.networking.Message;
import net.glowstone.entity.meta.MetadataMap;
import java.util.List;
public final class EntityMetadataMessage implements Message {
private final int id;
private final List<MetadataMap.Entry> entries;
public EntityMetadataMessage(int id, List<MetadataMap.Entry> entries) {
this.id = id;
this.entries = entries;
}
public int getId() {
return id;
}
public List<MetadataMap.Entry> getEntries() {
return entries;
}
@Override
public String toString() {
StringBuilder build = new StringBuilder("EntityMetadataMessage{id=");
build.append(id);
for (MetadataMap.Entry entry : entries) {
build.append(',').append(entry.index).append('=').append(entry.value);
}
build.append('}');
return build.toString();
}
}
|
SRavit1/esp-dl
|
3PXNet_models/face_detection/3pxnet-model-autogen/old/onet_ternarized_low/bn1.h
|
<gh_stars>0
#define bn1_thresh {\
-13107, \
109226, \
-139810, \
30583, \
-157286, \
83012, \
-205346, \
-214084, \
61166, \
-4369, \
144179, \
292727, \
-401954, \
235929, \
-139810, \
0, \
166024, \
166024, \
-109226, \
-78643, \
-43690, \
218453, \
-249036, \
266513, \
-4369, \
-104857, \
-87381, \
292727, \
-209715, \
83012, \
-96119, \
-21845, \
100488, \
-43690, \
200977, \
74274, \
-39321, \
-166024, \
-332049, \
-126702, \
-126702, \
209715, \
-209715, \
30583, \
-26214, \
-4369, \
144179, \
135441, \
183500, \
100488, \
113595, \
13107, \
275251, \
-170393, \
104857, \
83012, \
-109226, \
-65536, \
100488, \
-56797, \
-34952, \
-161655, \
-231560, \
69905, \
266513, \
-69905, \
65536, \
305834, \
48059, \
-205346, \
69905, \
148548, \
-214084, \
-96119, \
91750, \
96119, \
52428, \
-183500, \
96119, \
-91750, \
148548, \
-222822, \
-39321, \
126702, \
-283989, \
-48059, \
34952, \
43690, \
-39321, \
183500, \
26214, \
100488, \
144179, \
87381, \
-100488, \
-17476, \
166024, \
-109226, \
-244667, \
-179131, \
13107, \
-192238, \
-96119, \
-323310, \
-13107, \
96119, \
48059, \
-148548, \
227191, \
-4369, \
87381, \
227191, \
-113595, \
-30583, \
126702, \
297096, \
17476, \
30583, \
-91750, \
388846, \
187869, \
-17476, \
-21845, \
-61166, \
297096, \
-78643, \
34952, \
96119, \
}
#define bn1_sign {\
0xffffffff, \
0xffffffff, \
0xffffffff, \
0xffffffff, \
}
#define bn1_offset {\
616526, \
893391, \
462636, \
257460, \
404522, \
1431377, \
460776, \
1280609, \
806474, \
439791, \
508062, \
147030, \
667802, \
364300, \
1443330, \
1607035, \
196971, \
575200, \
1035869, \
1222031, \
1604539, \
841910, \
227967, \
1591639, \
1415688, \
506369, \
858079, \
835766, \
831300, \
257460, \
676747, \
460776, \
236596, \
569195, \
769408, \
411539, \
319046, \
856075, \
1184432, \
282895, \
282895, \
801845, \
1047961, \
771638, \
103621, \
895312, \
344921, \
780493, \
1077065, \
1970262, \
419805, \
918673, \
404522, \
1381084, \
359553, \
273634, \
178678, \
1288411, \
297690, \
849022, \
575200, \
183422, \
484405, \
716213, \
1302557, \
451358, \
981947, \
891466, \
381199, \
1025032, \
839867, \
626660, \
357957, \
996994, \
1277699, \
106349, \
1020553, \
474853, \
595741, \
1277699, \
912418, \
779024, \
628940, \
1891974, \
771638, \
357957, \
528503, \
637532, \
1476670, \
927976, \
266208, \
1728254, \
852723, \
475456, \
787068, \
717412, \
888570, \
340745, \
958335, \
257460, \
62173, \
439791, \
147030, \
772750, \
506369, \
772750, \
806474, \
812840, \
566169, \
1100211, \
589945, \
604330, \
1546751, \
840889, \
592850, \
1166896, \
555447, \
1163210, \
513109, \
563126, \
877872, \
575200, \
1019149, \
891466, \
2008690, \
830266, \
201285, \
1058022, \
}
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.