code
stringlengths
4
1.01M
language
stringclasses
2 values
/*jshint camelcase: false*/ module.exports = (grunt) => { 'use strict'; // load all grunt tasks require('time-grunt')(grunt); require('load-grunt-tasks')(grunt); // configurable paths const config = { app: 'app', dist: 'dist', distMac32: 'dist/MacOS32', distMac64: 'dist/MacOS64', distLinux32: 'dist/Linux32', distLinux64: 'dist/Linux64', distWin32: 'dist/Win32', distWin64: 'dist/Win64', distWin: 'dist/Win', tmp: 'buildTmp', resources: 'resources', appName: 'PlaylistPalace' }; grunt.initConfig({ config: config, clean: { dist: { files: [{ dot: true, src: [ `${ config.dist }/*`, `${ config.tmp }/*` ] }] }, distMac32: { files: [{ dot: true, src: [ `${ config.distMac32 }/*`, `${ config.tmp }/*` ] }] }, distMac64: { files: [{ dot: true, src: [ `${ config.distMac64 }/*`, `${ config.tmp }/*` ] }] }, distLinux64: { files: [{ dot: true, src: [ `${ config.distLinux64 }/*`, `${ config.tmp }/*` ] }] }, distLinux32: { files: [{ dot: true, src: [ `${ config.distLinux32 }/*`, `${ config.tmp }/*` ] }] }, distWin: { files: [{ dot: true, src: [ `${ config.distWin }/*`, `${ config.tmp }/*` ] }] }, distWin32: { files: [{ dot: true, src: [ `${ config.distWin32 }/*`, `${ config.tmp }/*` ] }] }, distWin64: { files: [{ dot: true, src: [ `${ config.distWin64 }/*`, `${ config.tmp }/*` ] }] } }, jshint: { options: { jshintrc: '.jshintrc' }, files: `${ config.app }/js/*.js` }, copy: { appLinux: { files: [{ expand: true, cwd: `${ config.app }`, dest: `${ config.distLinux64 }/app.nw`, src: '**' }] }, appLinux32: { files: [{ expand: true, cwd: `${ config.app }`, dest: `${ config.distLinux32 }/app.nw`, src: '**' }] }, appMacos32: { files: [{ expand: true, cwd: `${ config.app }`, dest: `${ config.distMac32 }/node-webkit.app/Contents/Resources/app.nw`, src: '**' }, { expand: true, cwd: `${ config.resources }/mac/`, dest: `${ config.distMac32 }/node-webkit.app/Contents/`, filter: 'isFile', src: '*.plist' }, { expand: true, cwd: `${ config.resources }/mac/`, dest: `${ config.distMac32 }/node-webkit.app/Contents/Resources/`, filter: 'isFile', src: '*.icns' }, { expand: true, cwd: `${ config.app }/../node_modules/`, dest: `${ config.distMac32 }/node-webkit.app/Contents/Resources/app.nw/node_modules/`, src: '**' }] }, appMacos64: { files: [{ expand: true, cwd: `${ config.app }`, dest: `${ config.distMac64 }/node-webkit.app/Contents/Resources/app.nw`, src: '**' }, { expand: true, cwd: `${ config.resources }/mac/`, dest: `${ config.distMac64 }/node-webkit.app/Contents/`, filter: 'isFile', src: '*.plist' }, { expand: true, cwd: `${ config.resources }/mac/`, dest: `${ config.distMac64 }/node-webkit.app/Contents/Resources/`, filter: 'isFile', src: '*.icns' }, { expand: true, cwd: `${ config.app }/../node_modules/`, dest: `${ config.distMac64 }/node-webkit.app/Contents/Resources/app.nw/node_modules/`, src: '**' }] }, webkit32: { files: [{ expand: true, cwd: `${ config.resources }/node-webkit/MacOS32`, dest: `${ config.distMac32 }/`, src: '**' }] }, webkit64: { files: [{ expand: true, cwd: `${ config.resources }/node-webkit/MacOS64`, dest: `${ config.distMac64 }/`, src: '**' }] }, copyWinToTmp: { files: [{ expand: true, cwd: `${ config.resources }/node-webkit/Windows/`, dest: `${ config.tmp }/`, src: '**' }] }, copyWin32ToTmp: { files: [{ expand: true, cwd: `${ config.resources }/node-webkit/Win32/`, dest: `${ config.tmp }/`, src: '**' }] }, copyWin64ToTmp: { files: [{ expand: true, cwd: `${ config.resources }/node-webkit/Win64/`, dest: `${ config.tmp }/`, src: '**' }] } }, compress: { appToTmp: { options: { archive: `${ config.tmp }/app.zip` }, files: [{ expand: true, cwd: `${ config.app }`, src: ['**'] }] }, finalWindowsApp: { options: { archive: `${ config.distWin }/${ config.appName }.zip` }, files: [{ expand: true, cwd: `${ config.tmp }`, src: ['**'] }] }, finalWindows32App: { options: { archive: `${ config.distWin32 }/${ config.appName }.zip` }, files: [{ expand: true, cwd: `${ config.tmp }`, src: ['**'] }] }, finalWindows64App: { options: { archive: `${ config.distWin64 }/${ config.appName }.zip` }, files: [{ expand: true, cwd: `${ config.tmp }`, src: ['**'] }] } }, rename: { macApp32: { files: [{ src: `${ config.distMac32 }/node-webkit.app`, dest: `${ config.distMac32 }/${ config.appName }.app` }] }, macApp64: { files: [{ src: `${ config.distMac64 }/node-webkit.app`, dest: `${ config.distMac64 }/${ config.appName }.app` }] }, zipToApp: { files: [{ src: `${ config.tmp }/app.zip`, dest: `${ config.tmp }/app.nw` }] } } }); grunt.registerTask('mkdir','Making directory if needed', () => { grunt.initConfig({ mkdir: { all: { options: { create: ['tmp_', 'test/ripper'] }, }, } }); }); grunt.registerTask('chmod32', 'Add lost Permissions.', () => { const fs = require('fs'), path = `./${config.distMac32}/${ config.appName}.app/Contents/`; console.log(path) fs.chmodSync(path + 'Frameworks/node-webkit Helper EH.app/Contents/MacOS/node-webkit Helper EH', '555') fs.chmodSync(path + 'Frameworks/node-webkit Helper NP.app/Contents/MacOS/node-webkit Helper NP', '555') fs.chmodSync(path + 'Frameworks/node-webkit Helper.app/Contents/MacOS/node-webkit Helper', '555') fs.chmodSync(path + 'MacOS/node-webkit', '555') }); grunt.registerTask('chmod64', 'Add lost Permissions.', () => { const fs = require('fs'), path = `${config.distMac64}/${ config.appName}.app/Contents/` fs.chmodSync(path + 'Frameworks/node-webkit Helper EH.app/Contents/MacOS/node-webkit Helper EH', '555') fs.chmodSync(path + 'Frameworks/node-webkit Helper NP.app/Contents/MacOS/node-webkit Helper NP', '555') fs.chmodSync(path + 'Frameworks/node-webkit Helper.app/Contents/MacOS/node-webkit Helper', '555') fs.chmodSync(path + 'MacOS/node-webkit', '555') }); grunt.registerTask('createLinuxApp', 'Create linux distribution.', (version) => { const done = this.async() const childProcess = require('child_process') const exec = childProcess.exec const path = './' + (version === 'Linux64' ? config.distLinux64 : config.distLinux32) exec(`mkdir -p ${path}; cp resources/node-webkit/${version}'/nw.pak ${path} && cp resources/node-webkit/${version}/nw ${path}/node-webkit`, (error, stdout, stderr) => { var result = true; if (stdout) { grunt.log.write(stdout); } if (stderr) { grunt.log.write(stderr); } if (error !== null) { grunt.log.error(error); result = false; } done(result); }); }); grunt.registerTask('createWindowsApp', 'Create windows distribution.', () => { const done = this.async(); const concat = require('concat-files'); concat([ 'buildTmp/nw.exe', 'buildTmp/app.nw' ], `buildTmp ${ config.appName }.exe`, function () { var fs = require('fs'); fs.unlink('buildTmp/app.nw', function (error, stdout, stderr) { if (stdout) { grunt.log.write(stdout); } if (stderr) { grunt.log.write(stderr); } if (error !== null) { grunt.log.error(error); done(false); } else { fs.unlink('buildTmp/nw.exe', (error, stdout, stderr) => { var result = true; if (stdout) { grunt.log.write(stdout); } if (stderr) { grunt.log.write(stderr); } if (error !== null) { grunt.log.error(error); result = false; } done(result); }); } }); }); }); grunt.registerTask('setVersion', 'Set version to all needed files', (version) => { const config = grunt.config.get(['config']) const appPath = config.app const resourcesPath = config.resources const mainPackageJSON = grunt.file.readJSON('package.json') const appPackageJSON = grunt.file.readJSON(`${appPath}/package.json`) const infoPlistTmp = grunt.file.read(`${resourcesPath}/mac/Info.plist.tmp`, { encoding: 'UTF8' }); const infoPlist = grunt.template.process(infoPlistTmp, { data: { version: version } }) mainPackageJSON.version = version appPackageJSON.version = version grunt.file.write('package.json', JSON.stringify(mainPackageJSON, null, 2), { encoding: 'UTF8' }) grunt.file.write(appPath + `${appPath}/package.json`, JSON.stringify(appPackageJSON, null, 2), { encoding: 'UTF8' }) grunt.file.write(resourcesPath + `${resourcesPath}/mac/Info.plist`, infoPlist, { encoding: 'UTF8' }) }) grunt.registerTask('dist-linux', [ 'clean:distLinux64', 'copy:appLinux', 'createLinuxApp:Linux64' ]) grunt.registerTask('dist-linux32', [ 'clean:distLinux32', 'copy:appLinux32', 'createLinuxApp:Linux32' ]) grunt.registerTask('dist-win', [ 'clean:distWin', 'copy:copyWinToTmp', 'compress:appToTmp', 'rename:zipToApp', 'createWindowsApp', 'compress:finalWindowsApp' ]) grunt.registerTask('dist-win32', [ 'clean:distWin32', 'copy:copyWin32ToTmp', 'compress:appToTmp', 'rename:zipToApp', 'createWindowsApp', 'compress:finalWindows32App' ]) grunt.registerTask('dist-win64', [ 'clean:distWin64', 'copy:copyWin64ToTmp', 'compress:appToTmp', 'rename:zipToApp', 'createWindowsApp', 'compress:finalWindows64App' ]) grunt.registerTask('dist-mac', [ 'clean:distMac64', 'copy:webkit64', 'copy:appMacos64', 'rename:macApp64', 'chmod64' ]) grunt.registerTask('dist-mac32', [ 'clean:distMac32', 'copy:webkit32', 'copy:appMacos32', 'rename:macApp32', 'chmod32' ]) grunt.registerTask('check', [ 'jshint' ]) grunt.registerTask('dmg', 'Create dmg from previously created app folder in dist.', () => { const p = new Promise( (resolve, reject) => { const createDmgCommand = `resources/mac/package.sh ${ config.appName }` require('child_process').exec(createDmgCommand, (error, stdout, stderr) => { if (stdout) { grunt.log.write(stdout) resolve(stdout) } if (stderr) { grunt.log.write(stderr) reject(stderr) } if (error !== null) { grunt.log.error(error) reject(error) } }) }) }) }
Java
package gui; //: gui/SubmitLabelManipulationTask.java import javax.swing.*; import java.util.concurrent.*; public class SubmitLabelManipulationTask { public static void main(String[] args) throws Exception { JFrame frame = new JFrame("Hello Swing"); final JLabel label = new JLabel("A Label"); frame.add(label); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); frame.setSize(300, 100); frame.setVisible(true); TimeUnit.SECONDS.sleep(1); SwingUtilities.invokeLater(new Runnable() { public void run() { label.setText("Hey! This is Different!"); } }); } } ///:~
Java
/** * Copyright 2006-2015 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.mybatis.generator.codegen.ibatis2.dao.elements; import java.util.Set; import java.util.TreeSet; import org.mybatis.generator.api.dom.java.FullyQualifiedJavaType; import org.mybatis.generator.api.dom.java.Interface; import org.mybatis.generator.api.dom.java.JavaVisibility; import org.mybatis.generator.api.dom.java.Method; import org.mybatis.generator.api.dom.java.Parameter; import org.mybatis.generator.api.dom.java.TopLevelClass; /** * * @author Jeff Butler * */ public class UpdateByExampleWithoutBLOBsMethodGenerator extends AbstractDAOElementGenerator { public UpdateByExampleWithoutBLOBsMethodGenerator() { super(); } @Override public void addImplementationElements(TopLevelClass topLevelClass) { Set<FullyQualifiedJavaType> importedTypes = new TreeSet<FullyQualifiedJavaType>(); Method method = getMethodShell(importedTypes); method .addBodyLine("UpdateByExampleParms parms = new UpdateByExampleParms(record, example);"); //$NON-NLS-1$ StringBuilder sb = new StringBuilder(); sb.append("int rows = "); //$NON-NLS-1$ sb.append(daoTemplate.getUpdateMethod(introspectedTable .getIbatis2SqlMapNamespace(), introspectedTable .getUpdateByExampleStatementId(), "parms")); //$NON-NLS-1$ method.addBodyLine(sb.toString()); method.addBodyLine("return rows;"); //$NON-NLS-1$ if (context.getPlugins() .clientUpdateByExampleWithoutBLOBsMethodGenerated(method, topLevelClass, introspectedTable)) { topLevelClass.addImportedTypes(importedTypes); topLevelClass.addMethod(method); } } @Override public void addInterfaceElements(Interface interfaze) { if (getExampleMethodVisibility() == JavaVisibility.PUBLIC) { Set<FullyQualifiedJavaType> importedTypes = new TreeSet<FullyQualifiedJavaType>(); Method method = getMethodShell(importedTypes); if (context.getPlugins() .clientUpdateByExampleWithoutBLOBsMethodGenerated(method, interfaze, introspectedTable)) { interfaze.addImportedTypes(importedTypes); interfaze.addMethod(method); } } } private Method getMethodShell(Set<FullyQualifiedJavaType> importedTypes) { FullyQualifiedJavaType parameterType; if (introspectedTable.getRules().generateBaseRecordClass()) { parameterType = new FullyQualifiedJavaType(introspectedTable .getBaseRecordType()); } else { parameterType = new FullyQualifiedJavaType(introspectedTable .getPrimaryKeyType()); } importedTypes.add(parameterType); Method method = new Method(); method.setVisibility(getExampleMethodVisibility()); method.setReturnType(FullyQualifiedJavaType.getIntInstance()); method.setName(getDAOMethodNameCalculator() .getUpdateByExampleWithoutBLOBsMethodName(introspectedTable)); method.addParameter(new Parameter(parameterType, "record")); //$NON-NLS-1$ method.addParameter(new Parameter(new FullyQualifiedJavaType( introspectedTable.getExampleType()), "example")); //$NON-NLS-1$ for (FullyQualifiedJavaType fqjt : daoTemplate.getCheckedExceptions()) { method.addException(fqjt); importedTypes.add(fqjt); } context.getCommentGenerator().addGeneralMethodComment(method, introspectedTable); return method; } }
Java
package jp.teraparser.transition; import java.util.Arrays; /** * Resizable-array implementation of Deque which works like java.util.ArrayDeque * * jp.teraparser.util * * @author Hiroki Teranishi */ public class Stack implements Cloneable { private static final int MIN_INITIAL_CAPACITY = 8; private int[] elements; private int head; private int tail; /** * Allocates empty array to hold the given number of elements. */ private void allocateElements(int numElements) { int initialCapacity = MIN_INITIAL_CAPACITY; // Find the best power of two to hold elements. // Tests "<=" because arrays aren't kept full. if (numElements >= initialCapacity) { initialCapacity = numElements; initialCapacity |= (initialCapacity >>> 1); initialCapacity |= (initialCapacity >>> 2); initialCapacity |= (initialCapacity >>> 4); initialCapacity |= (initialCapacity >>> 8); initialCapacity |= (initialCapacity >>> 16); initialCapacity++; if (initialCapacity < 0) { // Too many elements, must back off initialCapacity >>>= 1;// Good luck allocating 2 ^ 30 elements } } elements = new int[initialCapacity]; } /** * Doubles the capacity of this deque. Call only when full, i.e., * when head and tail have wrapped around to become equal. */ private void doubleCapacity() { assert head == tail; int p = head; int n = elements.length; int r = n - p; // number of elements to the right of p int newCapacity = n << 1; if (newCapacity < 0) { throw new IllegalStateException("Sorry, deque too big"); } int[] a = new int[newCapacity]; System.arraycopy(elements, p, a, 0, r); System.arraycopy(elements, 0, a, r, p); elements = a; head = 0; tail = n; } public Stack() { elements = new int[16]; } public Stack(int numElements) { allocateElements(numElements); } public void push(int e) { elements[head = (head - 1) & (elements.length - 1)] = e; if (head == tail) { doubleCapacity(); } } public int pop() { int h = head; int result = elements[h]; elements[h] = 0; head = (h + 1) & (elements.length - 1); return result; } public int top() { return elements[head]; } public int getFirst() { return top(); } public int get(int position, int defaultValue) { if (position < 0 || position >= size()) { return defaultValue; } int mask = elements.length - 1; int h = head; for (int i = 0; i < position; i++) { h = (h + 1) & mask; } return elements[h]; } public int size() { return (tail - head) & (elements.length - 1); } public boolean isEmpty() { return head == tail; } public Stack clone() { try { Stack result = (Stack) super.clone(); result.elements = Arrays.copyOf(elements, elements.length); return result; } catch (CloneNotSupportedException e) { throw new AssertionError(); } } }
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. */ /* * PdxObject.cpp * * Created on: Sep 29, 2011 * Author: npatel */ #include "PdxType.hpp" using namespace apache::geode::client; using namespace PdxTests; template <typename T1, typename T2> bool PdxTests::PdxType::genericValCompare(T1 value1, T2 value2) const { if (value1 != value2) return false; LOGINFO("PdxObject::genericValCompare Line_19"); return true; } template <typename T1, typename T2> bool PdxTests::PdxType::genericCompare(T1* value1, T2* value2, int length) const { int i = 0; while (i < length) { if (value1[i] != value2[i]) { return false; } else { i++; } } LOGINFO("PdxObject::genericCompare Line_34"); return true; } template <typename T1, typename T2> bool PdxTests::PdxType::generic2DCompare(T1** value1, T2** value2, int length, int* arrLengths) const { LOGINFO("generic2DCompare length = %d ", length); LOGINFO("generic2DCompare value1 = %d \t value2", value1[0][0], value2[0][0]); LOGINFO("generic2DCompare value1 = %d \t value2", value1[1][0], value2[1][0]); LOGINFO("generic2DCompare value1 = %d \t value2", value1[1][1], value2[1][1]); for (int j = 0; j < length; j++) { LOGINFO("generic2DCompare arrlength0 = %d ", arrLengths[j]); for (int k = 0; k < arrLengths[j]; k++) { LOGINFO("generic2DCompare arrlength = %d ", arrLengths[j]); LOGINFO("generic2DCompare value1 = %d \t value2 = %d ", value1[j][k], value2[j][k]); if (value1[j][k] != value2[j][k]) return false; } } LOGINFO("PdxObject::genericCompare Line_34"); return true; } // PdxType::~PdxObject() { //} void PdxTests::PdxType::toData(PdxWriterPtr pw) /*const*/ { // TODO:delete it later int* lengthArr = new int[2]; lengthArr[0] = 1; lengthArr[1] = 2; pw->writeArrayOfByteArrays("m_byteByteArray", m_byteByteArray, 2, lengthArr); pw->writeWideChar("m_char", m_char); pw->markIdentityField("m_char"); pw->writeBoolean("m_bool", m_bool); // 1 pw->markIdentityField("m_bool"); pw->writeBooleanArray("m_boolArray", m_boolArray, 3); pw->markIdentityField("m_boolArray"); pw->writeByte("m_byte", m_byte); pw->markIdentityField("m_byte"); pw->writeByteArray("m_byteArray", m_byteArray, 2); pw->markIdentityField("m_byteArray"); pw->writeWideCharArray("m_charArray", m_charArray, 2); pw->markIdentityField("m_charArray"); pw->writeObject("m_arraylist", m_arraylist); pw->writeObject("m_linkedlist", m_linkedlist); pw->markIdentityField("m_arraylist"); pw->writeObject("m_map", m_map); pw->markIdentityField("m_map"); pw->writeObject("m_hashtable", m_hashtable); pw->markIdentityField("m_hashtable"); pw->writeObject("m_vector", m_vector); pw->markIdentityField("m_vector"); pw->writeObject("m_chs", m_chs); pw->markIdentityField("m_chs"); pw->writeObject("m_clhs", m_clhs); pw->markIdentityField("m_clhs"); pw->writeString("m_string", m_string); pw->markIdentityField("m_string"); pw->writeDate("m_dateTime", m_date); pw->markIdentityField("m_dateTime"); pw->writeDouble("m_double", m_double); pw->markIdentityField("m_double"); pw->writeDoubleArray("m_doubleArray", m_doubleArray, 2); pw->markIdentityField("m_doubleArray"); pw->writeFloat("m_float", m_float); pw->markIdentityField("m_float"); pw->writeFloatArray("m_floatArray", m_floatArray, 2); pw->markIdentityField("m_floatArray"); pw->writeShort("m_int16", m_int16); pw->markIdentityField("m_int16"); pw->writeInt("m_int32", m_int32); pw->markIdentityField("m_int32"); pw->writeLong("m_long", m_long); pw->markIdentityField("m_long"); pw->writeIntArray("m_int32Array", m_int32Array, 4); pw->markIdentityField("m_int32Array"); pw->writeLongArray("m_longArray", m_longArray, 2); pw->markIdentityField("m_longArray"); pw->writeShortArray("m_int16Array", m_int16Array, 2); pw->markIdentityField("m_int16Array"); pw->writeByte("m_sbyte", m_sbyte); pw->markIdentityField("m_sbyte"); pw->writeByteArray("m_sbyteArray", m_sbyteArray, 2); pw->markIdentityField("m_sbyteArray"); // int* strlengthArr = new int[2]; // strlengthArr[0] = 5; // strlengthArr[1] = 5; pw->writeStringArray("m_stringArray", m_stringArray, 2); pw->markIdentityField("m_stringArray"); pw->writeShort("m_uint16", m_uint16); pw->markIdentityField("m_uint16"); pw->writeInt("m_uint32", m_uint32); pw->markIdentityField("m_uint32"); pw->writeLong("m_ulong", m_ulong); pw->markIdentityField("m_ulong"); pw->writeIntArray("m_uint32Array", m_uint32Array, 4); pw->markIdentityField("m_uint32Array"); pw->writeLongArray("m_ulongArray", m_ulongArray, 2); pw->markIdentityField("m_ulongArray"); pw->writeShortArray("m_uint16Array", m_uint16Array, 2); pw->markIdentityField("m_uint16Array"); pw->writeByteArray("m_byte252", m_byte252, 252); pw->markIdentityField("m_byte252"); pw->writeByteArray("m_byte253", m_byte253, 253); pw->markIdentityField("m_byte253"); pw->writeByteArray("m_byte65535", m_byte65535, 65535); pw->markIdentityField("m_byte65535"); pw->writeByteArray("m_byte65536", m_byte65536, 65536); pw->markIdentityField("m_byte65536"); pw->writeObject("m_pdxEnum", m_pdxEnum); pw->markIdentityField("m_pdxEnum"); pw->writeObject("m_address", m_objectArray); pw->writeObjectArray("m_objectArray", m_objectArray); pw->writeObjectArray("", m_objectArrayEmptyPdxFieldName); LOGDEBUG("PdxObject::writeObject() for enum Done......"); LOGDEBUG("PdxObject::toData() Done......"); // TODO:delete it later } void PdxTests::PdxType::fromData(PdxReaderPtr pr) { // TODO:temp added, delete later int32_t* Lengtharr; GF_NEW(Lengtharr, int32_t[2]); int32_t arrLen = 0; m_byteByteArray = pr->readArrayOfByteArrays("m_byteByteArray", arrLen, &Lengtharr); // TODO::need to write compareByteByteArray() and check for m_byteByteArray // elements m_char = pr->readWideChar("m_char"); // GenericValCompare m_bool = pr->readBoolean("m_bool"); // GenericValCompare m_boolArray = pr->readBooleanArray("m_boolArray", boolArrayLen); m_byte = pr->readByte("m_byte"); m_byteArray = pr->readByteArray("m_byteArray", byteArrayLen); m_charArray = pr->readWideCharArray("m_charArray", charArrayLen); m_arraylist = pr->readObject("m_arraylist"); m_linkedlist = dynCast<CacheableLinkedListPtr>(pr->readObject("m_linkedlist")); m_map = dynCast<CacheableHashMapPtr>(pr->readObject("m_map")); // TODO:Check for the size m_hashtable = pr->readObject("m_hashtable"); // TODO:Check for the size m_vector = pr->readObject("m_vector"); // TODO::Check for size m_chs = pr->readObject("m_chs"); // TODO::Size check m_clhs = pr->readObject("m_clhs"); // TODO:Size check m_string = pr->readString("m_string"); // GenericValCompare m_date = pr->readDate("m_dateTime"); // compareData m_double = pr->readDouble("m_double"); m_doubleArray = pr->readDoubleArray("m_doubleArray", doubleArrayLen); m_float = pr->readFloat("m_float"); m_floatArray = pr->readFloatArray("m_floatArray", floatArrayLen); m_int16 = pr->readShort("m_int16"); m_int32 = pr->readInt("m_int32"); m_long = pr->readLong("m_long"); m_int32Array = pr->readIntArray("m_int32Array", intArrayLen); m_longArray = pr->readLongArray("m_longArray", longArrayLen); m_int16Array = pr->readShortArray("m_int16Array", shortArrayLen); m_sbyte = pr->readByte("m_sbyte"); m_sbyteArray = pr->readByteArray("m_sbyteArray", byteArrayLen); m_stringArray = pr->readStringArray("m_stringArray", strLenArray); m_uint16 = pr->readShort("m_uint16"); m_uint32 = pr->readInt("m_uint32"); m_ulong = pr->readLong("m_ulong"); m_uint32Array = pr->readIntArray("m_uint32Array", intArrayLen); m_ulongArray = pr->readLongArray("m_ulongArray", longArrayLen); m_uint16Array = pr->readShortArray("m_uint16Array", shortArrayLen); // LOGINFO("PdxType::readInt() start..."); m_byte252 = pr->readByteArray("m_byte252", m_byte252Len); m_byte253 = pr->readByteArray("m_byte253", m_byte253Len); m_byte65535 = pr->readByteArray("m_byte65535", m_byte65535Len); m_byte65536 = pr->readByteArray("m_byte65536", m_byte65536Len); // TODO:Check for size m_pdxEnum = pr->readObject("m_pdxEnum"); m_address = pr->readObject("m_address"); // size chaeck m_objectArray = pr->readObjectArray("m_objectArray"); m_objectArrayEmptyPdxFieldName = pr->readObjectArray(""); // Check for individual elements // TODO:temp added delete it later LOGINFO("PdxObject::readObject() for enum Done..."); } CacheableStringPtr PdxTests::PdxType::toString() const { char idbuf[1024]; // sprintf(idbuf,"PdxObject: [ m_bool=%d ] [m_byte=%d] [m_int16=%d] // [m_int32=%d] [m_float=%f] [m_double=%lf] [ m_string=%s ]",m_bool, m_byte, // m_int16, m_int32, m_float, m_double, m_string); sprintf(idbuf, "PdxObject:[m_int32=%d]", m_int32); return CacheableString::create(idbuf); } bool PdxTests::PdxType::equals(PdxTests::PdxType& other, bool isPdxReadSerialized) const { PdxType* ot = dynamic_cast<PdxType*>(&other); if (ot == NULL) { return false; } if (ot == this) { return true; } genericValCompare(ot->m_int32, m_int32); genericValCompare(ot->m_bool, m_bool); genericValCompare(ot->m_byte, m_byte); genericValCompare(ot->m_int16, m_int16); genericValCompare(ot->m_long, m_long); genericValCompare(ot->m_float, m_float); genericValCompare(ot->m_double, m_double); genericValCompare(ot->m_sbyte, m_sbyte); genericValCompare(ot->m_uint16, m_uint16); genericValCompare(ot->m_uint32, m_uint32); genericValCompare(ot->m_ulong, m_ulong); genericValCompare(ot->m_char, m_char); if (strcmp(ot->m_string, m_string) != 0) { return false; } genericCompare(ot->m_byteArray, m_byteArray, byteArrayLen); genericCompare(ot->m_int16Array, m_int16Array, shortArrayLen); genericCompare(ot->m_int32Array, m_int32Array, intArrayLen); genericCompare(ot->m_longArray, m_longArray, longArrayLen); genericCompare(ot->m_doubleArray, m_doubleArray, doubleArrayLen); genericCompare(ot->m_floatArray, m_floatArray, floatArrayLen); genericCompare(ot->m_uint32Array, m_uint32Array, intArrayLen); genericCompare(ot->m_ulongArray, m_ulongArray, longArrayLen); genericCompare(ot->m_uint16Array, m_uint16Array, shortArrayLen); genericCompare(ot->m_sbyteArray, m_sbyteArray, shortArrayLen); genericCompare(ot->m_charArray, m_charArray, charArrayLen); // generic2DCompare(ot->m_byteByteArray, m_byteByteArray, byteByteArrayLen, // lengthArr); if (!isPdxReadSerialized) { for (int i = 0; i < m_objectArray->size(); i++) { Address* otherAddr1 = dynamic_cast<Address*>(ot->m_objectArray->at(i).ptr()); Address* myAddr1 = dynamic_cast<Address*>(m_objectArray->at(i).ptr()); if (!otherAddr1->equals(*myAddr1)) return false; } LOGINFO("PdxObject::equals isPdxReadSerialized = %d", isPdxReadSerialized); } // m_objectArrayEmptyPdxFieldName if (!isPdxReadSerialized) { for (int i = 0; i < m_objectArrayEmptyPdxFieldName->size(); i++) { Address* otherAddr1 = dynamic_cast<Address*>(ot->m_objectArray->at(i).ptr()); Address* myAddr1 = dynamic_cast<Address*>(m_objectArray->at(i).ptr()); if (!otherAddr1->equals(*myAddr1)) return false; } LOGINFO("PdxObject::equals Empty Field Name isPdxReadSerialized = %d", isPdxReadSerialized); } CacheableEnumPtr myenum = dynCast<CacheableEnumPtr>(m_pdxEnum); CacheableEnumPtr otenum = dynCast<CacheableEnumPtr>(ot->m_pdxEnum); if (myenum->getEnumOrdinal() != otenum->getEnumOrdinal()) return false; if (strcmp(myenum->getEnumClassName(), otenum->getEnumClassName()) != 0) { return false; } if (strcmp(myenum->getEnumName(), otenum->getEnumName()) != 0) return false; genericValCompare(ot->m_arraylist->size(), m_arraylist->size()); for (int k = 0; k < m_arraylist->size(); k++) { genericValCompare(ot->m_arraylist->at(k), m_arraylist->at(k)); } LOGINFO("Equals Linked List Starts"); genericValCompare(ot->m_linkedlist->size(), m_linkedlist->size()); for (int k = 0; k < m_linkedlist->size(); k++) { genericValCompare(ot->m_linkedlist->at(k), m_linkedlist->at(k)); } LOGINFO("Equals Linked List Finished"); genericValCompare(ot->m_vector->size(), m_vector->size()); for (int j = 0; j < m_vector->size(); j++) { genericValCompare(ot->m_vector->at(j), m_vector->at(j)); } LOGINFO("PdxObject::equals DOne Line_201"); return true; }
Java
package ppp.menu; import java.awt.image.BufferedImage; public abstract interface Menu { public abstract void up(); public abstract void down(); public abstract void enter(); public abstract void escape(); public abstract BufferedImage getImage(); }
Java
{% extends "horizon/common/_modal_form.html" %} {% load i18n %} {% block modal-body-right %} <div class="quota-dynamic"> <p>{% blocktrans %}Create a Consistency Group that will contain newly created volumes cloned from each of the snapshots in the source Consistency Group Snapshot.{% endblocktrans %}</p> {% include "admin/volumes/_volume_limits.html" with usages=usages %} </div> {% endblock %}
Java
require File.join(File.dirname(__FILE__), '..', 'cloudstack_rest') Puppet::Type.type(:cloudstack_network_provider).provide :rest, :parent => Puppet::Provider::CloudstackRest do desc "REST provider for Cloudstack Network Service Provider" mk_resource_methods def flush if @property_flush[:ensure] == :absent deleteNetworkServiceProvider return end if @property_flush[:ensure] != :absent return if createNetworkServiceProvider end if @property_flush[:ensure] == :enabled enableNetworkServiceProvider return end if @property_flush[:ensure] == :shutdown shutdownNetworkServiceProvider return end if @property_flush[:ensure] == :disabled disableNetworkServiceProvider return end updateNetworkServiceProvider end def self.instances result = Array.new list = get_objects(:listNetworkServiceProviders, "networkserviceprovider") if list != nil list.each do |object| map = getNetworkServiceProvider(object) if map != nil #Puppet.debug "Network Service Provider: "+map.inspect result.push(new(map)) end end end result end def self.getNetworkServiceProvider(object) if object["name"] != nil physicalnetwork = genericLookup(:listPhysicalNetworks, "physicalnetwork", 'id', object["physicalnetworkid"], {}, 'name') { :id => object["id"], :name => physicalnetwork+'_'+object["name"], :service_provider => object["name"], :physicalnetworkid => object["physicalnetworkid"], :physicalnetwork => physicalnetwork, :state => object["state"].downcase, :ensure => :present } end end # TYPE SPECIFIC def setState(state) @property_flush[:ensure] = state end def getState @property_hash[:state] end private def createNetworkServiceProvider if @property_hash.empty? Puppet.debug "Create Network Service Provider "+resource[:name] physicalnetworkid = self.class.genericLookup(:listPhysicalNetworks, "physicalnetwork", 'name', resource[:physicalnetwork], {}, 'id') params = { :name => resource[:service_provider], :physicalnetworkid => physicalnetworkid, } Puppet.debug "addNetworkServiceProvider PARAMS = "+params.inspect response = self.class.http_get('addNetworkServiceProvider', params) self.class.wait_for_async_call(response["jobid"]) return true end false end def deleteNetworkServiceProvider Puppet.debug "Delete Network Service Provider "+resource[:name] id = lookupId params = { :id => id, } Puppet.debug "deleteNetworkServiceProvider PARAMS = "+params.inspect # response = self.class.http_get('deleteNetworkServiceProvider', params) # self.class.wait_for_async_call(response["jobid"]) end def updateNetwork Puppet.debug "Update Network Service Provider "+resource[:name] raise "Network Service Provider only allows update for servicelist, which is currently not supported by this Puppet Module" end def updateState(state) id = lookupId params = { :id => id, :state => state, } Puppet.debug "updateNetworkServiceProvider PARAMS = "+params.inspect response = self.class.http_get('updateNetworkServiceProvider', params) self.class.wait_for_async_call(response["jobid"]) end def enableNetworkServiceProvider Puppet.debug "Enable Network Service Provider "+resource[:name] updateState('Enabled') end def disableNetworkServiceProvider Puppet.debug "Disable Network Service Provider "+resource[:name] updateState('Disabled') end def shutdownNetworkServiceProvider Puppet.debug "Shutdown Network Service Provider "+resource[:name] updateState('Shutdown') end def lookupId physicalnetworkid = self.class.genericLookup(:listPhysicalNetworks, "physicalnetwork", 'name', resource[:physicalnetwork], {}, 'id') params = { :physicalnetworkid => physicalnetworkid } return self.class.genericLookup(:listNetworkServiceProviders, "networkserviceprovider", 'name', resource[:service_provider], {}, 'id') end end
Java
package org.hablapps.meetup.common.logic object Domain{ case class User( uid: Option[Int] = None, name: String ) case class Group( id: Option[Int] = None, name: String, city: String, must_approve: Boolean ) case class Member( mid: Option[Int] = None, uid: Int, gid: Int ) case class JoinRequest( jid: Option[Int] = None, uid: Int, gid: Int ) type JoinResponse = Either[JoinRequest, Member] }
Java
/* * */ package org.utilities; import java.math.BigInteger; import java.security.MessageDigest; import java.security.NoSuchAlgorithmException; import java.util.concurrent.Callable; import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; import java.util.concurrent.Future; // TODO: Auto-generated Javadoc /** * The Class CUtils. */ public class CUtils { /** * Work. * * @param task * the task * @return the object */ public static Object work(Callable<?> task) { Future<?> futureTask = es.submit(task); return futureTask; } /** * Gets the random string. * * @param rndSeed the rnd seed * @return the random string */ public static String getRandomString(double rndSeed) { MessageDigest m; try { m = MessageDigest.getInstance("MD5"); byte[] data = ("" + rndSeed).getBytes(); m.update(data, 0, data.length); BigInteger i = new BigInteger(1, m.digest()); return String.format("%1$032X", i); } catch (NoSuchAlgorithmException e) { } return "" + rndSeed; } /** * Gets the random number. * * @param s the s * @return the random number * @throws Exception the exception */ public static int getRandomNumber(String s) throws Exception { MessageDigest m; try { m = MessageDigest.getInstance("MD5"); byte[] data = s.getBytes(); m.update(data, 0, data.length); BigInteger i = new BigInteger(1, m.digest()); return i.intValue(); } catch (NoSuchAlgorithmException e) { } throw new Exception("Cannot generate random number"); } /** The Constant es. */ private final static ExecutorService es = Executors.newCachedThreadPool(); /** * Instantiates a new c utils. */ private CUtils() { } }
Java
/* Copyright 2020 Telstra Open Source * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.openkilda.floodlight.switchmanager; import static java.util.Collections.singletonList; import static org.projectfloodlight.openflow.protocol.OFVersion.OF_12; import static org.projectfloodlight.openflow.protocol.OFVersion.OF_13; import net.floodlightcontroller.core.IOFSwitch; import net.floodlightcontroller.util.FlowModUtils; import org.projectfloodlight.openflow.protocol.OFFactory; import org.projectfloodlight.openflow.protocol.OFFlowMod; import org.projectfloodlight.openflow.protocol.OFMeterFlags; import org.projectfloodlight.openflow.protocol.OFMeterMod; import org.projectfloodlight.openflow.protocol.OFMeterModCommand; import org.projectfloodlight.openflow.protocol.action.OFAction; import org.projectfloodlight.openflow.protocol.action.OFActions; import org.projectfloodlight.openflow.protocol.instruction.OFInstruction; import org.projectfloodlight.openflow.protocol.instruction.OFInstructionApplyActions; import org.projectfloodlight.openflow.protocol.meterband.OFMeterBandDrop; import org.projectfloodlight.openflow.protocol.oxm.OFOxms; import org.projectfloodlight.openflow.types.DatapathId; import org.projectfloodlight.openflow.types.EthType; import org.projectfloodlight.openflow.types.MacAddress; import org.projectfloodlight.openflow.types.OFBufferId; import org.projectfloodlight.openflow.types.OFPort; import org.projectfloodlight.openflow.types.OFVlanVidMatch; import org.projectfloodlight.openflow.types.TableId; import org.projectfloodlight.openflow.types.TransportPort; import org.projectfloodlight.openflow.types.U64; import java.util.Arrays; import java.util.List; import java.util.Set; /** * Utils for switch flow generation. */ public final class SwitchFlowUtils { /** * OVS software switch manufacturer constant value. */ public static final String OVS_MANUFACTURER = "Nicira, Inc."; /** * Indicates the maximum size in bytes for a packet which will be send from switch to the controller. */ private static final int MAX_PACKET_LEN = 0xFFFFFFFF; private SwitchFlowUtils() { } /** * Create a MAC address based on the DPID. * * @param dpId switch object * @return {@link MacAddress} */ public static MacAddress convertDpIdToMac(DatapathId dpId) { return MacAddress.of(Arrays.copyOfRange(dpId.getBytes(), 2, 8)); } /** * Create sent to controller OpenFlow action. * * @param ofFactory OpenFlow factory * @return OpenFlow Action */ public static OFAction actionSendToController(OFFactory ofFactory) { OFActions actions = ofFactory.actions(); return actions.buildOutput().setMaxLen(MAX_PACKET_LEN).setPort(OFPort.CONTROLLER) .build(); } /** * Create an OFAction which sets the output port. * * @param ofFactory OF factory for the switch * @param outputPort port to set in the action * @return {@link OFAction} */ public static OFAction actionSetOutputPort(final OFFactory ofFactory, final OFPort outputPort) { OFActions actions = ofFactory.actions(); return actions.buildOutput().setMaxLen(MAX_PACKET_LEN).setPort(outputPort).build(); } /** * Create go to table OFInstruction. * * @param ofFactory OF factory for the switch * @param tableId tableId to go * @return {@link OFAction} */ public static OFInstruction instructionGoToTable(final OFFactory ofFactory, final TableId tableId) { return ofFactory.instructions().gotoTable(tableId); } /** * Create an OFInstructionApplyActions which applies actions. * * @param ofFactory OF factory for the switch * @param actionList OFAction list to apply * @return {@link OFInstructionApplyActions} */ public static OFInstructionApplyActions buildInstructionApplyActions(OFFactory ofFactory, List<OFAction> actionList) { return ofFactory.instructions().applyActions(actionList).createBuilder().build(); } /** * Create set destination MAC address OpenFlow action. * * @param ofFactory OpenFlow factory * @param macAddress MAC address to set * @return OpenFlow Action */ public static OFAction actionSetDstMac(OFFactory ofFactory, final MacAddress macAddress) { OFOxms oxms = ofFactory.oxms(); OFActions actions = ofFactory.actions(); return actions.buildSetField() .setField(oxms.buildEthDst().setValue(macAddress).build()).build(); } /** * Create set source MAC address OpenFlow action. * * @param ofFactory OpenFlow factory * @param macAddress MAC address to set * @return OpenFlow Action */ public static OFAction actionSetSrcMac(OFFactory ofFactory, final MacAddress macAddress) { return ofFactory.actions().buildSetField() .setField(ofFactory.oxms().ethSrc(macAddress)).build(); } /** * Create set UDP source port OpenFlow action. * * @param ofFactory OpenFlow factory * @param srcPort UDP src port to set * @return OpenFlow Action */ public static OFAction actionSetUdpSrcAction(OFFactory ofFactory, TransportPort srcPort) { OFOxms oxms = ofFactory.oxms(); return ofFactory.actions().setField(oxms.udpSrc(srcPort)); } /** * Create set UDP destination port OpenFlow action. * * @param ofFactory OpenFlow factory * @param dstPort UDP dst port to set * @return OpenFlow Action */ public static OFAction actionSetUdpDstAction(OFFactory ofFactory, TransportPort dstPort) { OFOxms oxms = ofFactory.oxms(); return ofFactory.actions().setField(oxms.udpDst(dstPort)); } /** * Create OpenFlow flow modification command builder. * * @param ofFactory OpenFlow factory * @param cookie cookie * @param priority priority * @param tableId table id * @return OpenFlow command builder */ public static OFFlowMod.Builder prepareFlowModBuilder(OFFactory ofFactory, long cookie, int priority, int tableId) { OFFlowMod.Builder fmb = ofFactory.buildFlowAdd(); fmb.setIdleTimeout(FlowModUtils.INFINITE_TIMEOUT); fmb.setHardTimeout(FlowModUtils.INFINITE_TIMEOUT); fmb.setBufferId(OFBufferId.NO_BUFFER); fmb.setCookie(U64.of(cookie)); fmb.setPriority(priority); fmb.setTableId(TableId.of(tableId)); return fmb; } /** * Create OpenFlow meter modification command. * * @param ofFactory OpenFlow factory * @param bandwidth bandwidth * @param burstSize burst size * @param meterId meter id * @param flags flags * @param commandType ADD, MODIFY or DELETE * @return OpenFlow command */ public static OFMeterMod buildMeterMod(OFFactory ofFactory, long bandwidth, long burstSize, long meterId, Set<OFMeterFlags> flags, OFMeterModCommand commandType) { OFMeterBandDrop.Builder bandBuilder = ofFactory.meterBands() .buildDrop() .setRate(bandwidth) .setBurstSize(burstSize); OFMeterMod.Builder meterModBuilder = ofFactory.buildMeterMod() .setMeterId(meterId) .setCommand(commandType) .setFlags(flags); if (ofFactory.getVersion().compareTo(OF_13) > 0) { meterModBuilder.setBands(singletonList(bandBuilder.build())); } else { meterModBuilder.setMeters(singletonList(bandBuilder.build())); } return meterModBuilder.build(); } /** * Create an OFAction to add a VLAN header. * * @param ofFactory OF factory for the switch * @param etherType ethernet type of the new VLAN header * @return {@link OFAction} */ public static OFAction actionPushVlan(final OFFactory ofFactory, final int etherType) { OFActions actions = ofFactory.actions(); return actions.buildPushVlan().setEthertype(EthType.of(etherType)).build(); } /** * Create an OFAction to change the outer most vlan. * * @param factory OF factory for the switch * @param newVlan final VLAN to be set on the packet * @return {@link OFAction} */ public static OFAction actionReplaceVlan(final OFFactory factory, final int newVlan) { OFOxms oxms = factory.oxms(); OFActions actions = factory.actions(); if (OF_12.compareTo(factory.getVersion()) == 0) { return actions.buildSetField().setField(oxms.buildVlanVid() .setValue(OFVlanVidMatch.ofRawVid((short) newVlan)) .build()).build(); } else { return actions.buildSetField().setField(oxms.buildVlanVid() .setValue(OFVlanVidMatch.ofVlan(newVlan)) .build()).build(); } } /** * Check switch is OVS. * * @param sw switch * @return true if switch is OVS */ public static boolean isOvs(IOFSwitch sw) { return OVS_MANUFACTURER.equals(sw.getSwitchDescription().getManufacturerDescription()); } }
Java
select fn_db_add_config_value('LiveSnapshotEnabled','false','2.2'); select fn_db_add_config_value('LiveSnapshotEnabled','false','3.0'); select fn_db_add_config_value('LiveSnapshotEnabled','true','3.1');
Java
package com.rasterfoundry.common.ast import cats.implicits._ import geotrellis.raster._ import geotrellis.raster.mapalgebra.focal._ import geotrellis.vector.MultiPolygon import java.util.UUID /** The ur-type for a recursive representation of MapAlgebra operations */ sealed trait MapAlgebraAST extends Product with Serializable { def id: UUID def args: List[MapAlgebraAST] def metadata: Option[NodeMetadata] def find(id: UUID): Option[MapAlgebraAST] def sources: Seq[MapAlgebraAST.MapAlgebraLeaf] def tileSources: Set[RFMLRaster] = { val tileList: List[RFMLRaster] = this match { case r: RFMLRaster => List(r) case _: MapAlgebraAST.MapAlgebraLeaf => List() case ast => ast.args.flatMap(_.tileSources) } tileList.toSet } def substitute(substitutions: Map[UUID, MapAlgebraAST]): Option[MapAlgebraAST] def withArgs(newArgs: List[MapAlgebraAST]): MapAlgebraAST def withMetadata(newMd: NodeMetadata): MapAlgebraAST def bufferedSources(buffered: Boolean = false): Set[UUID] = { val bufferList = this match { case f: MapAlgebraAST.FocalOperation => f.args.flatMap(_.bufferedSources(true)) case op: MapAlgebraAST.Operation => op.args.flatMap(_.bufferedSources(buffered)) // case MapAlgebraAST.Source(id, _) => if (buffered) List(id) else List() case _ => List() } bufferList.toSet } } object MapAlgebraAST { /** Map Algebra operations (nodes in this tree) */ sealed trait Operation extends MapAlgebraAST with Serializable { val symbol: String def find(id: UUID): Option[MapAlgebraAST] = if (this.id == id) Some(this) else { val matches = args.flatMap(_.find(id)) matches.headOption } def sources: Seq[MapAlgebraAST.MapAlgebraLeaf] = args.flatMap(_.sources).distinct def substitute( substitutions: Map[UUID, MapAlgebraAST]): Option[MapAlgebraAST] = { val updatedArgs: Option[List[MapAlgebraAST]] = this.args .map({ arg => arg.substitute(substitutions) }) .sequence updatedArgs.map({ newArgs => this.withArgs(newArgs) }) } } /** Operations which should only have one argument. */ final case class Addition(args: List[MapAlgebraAST], id: UUID, metadata: Option[NodeMetadata]) extends Operation { val symbol = "+" def withArgs(newArgs: List[MapAlgebraAST]): MapAlgebraAST = copy(args = newArgs) def withMetadata(newMd: NodeMetadata): MapAlgebraAST = copy(metadata = Some(newMd)) } final case class Subtraction(args: List[MapAlgebraAST], id: UUID, metadata: Option[NodeMetadata]) extends Operation { val symbol = "-" def withArgs(newArgs: List[MapAlgebraAST]): MapAlgebraAST = copy(args = newArgs) def withMetadata(newMd: NodeMetadata): MapAlgebraAST = copy(metadata = Some(newMd)) } final case class Multiplication(args: List[MapAlgebraAST], id: UUID, metadata: Option[NodeMetadata]) extends Operation { val symbol = "*" def withArgs(newArgs: List[MapAlgebraAST]): MapAlgebraAST = copy(args = newArgs) def withMetadata(newMd: NodeMetadata): MapAlgebraAST = copy(metadata = Some(newMd)) } final case class Division(args: List[MapAlgebraAST], id: UUID, metadata: Option[NodeMetadata]) extends Operation { val symbol = "/" def withArgs(newArgs: List[MapAlgebraAST]): MapAlgebraAST = copy(args = newArgs) def withMetadata(newMd: NodeMetadata): MapAlgebraAST = copy(metadata = Some(newMd)) } final case class Max(args: List[MapAlgebraAST], id: UUID, metadata: Option[NodeMetadata]) extends Operation { val symbol = "max" def withArgs(newArgs: List[MapAlgebraAST]): MapAlgebraAST = copy(args = newArgs) def withMetadata(newMd: NodeMetadata): MapAlgebraAST = copy(metadata = Some(newMd)) } final case class Min(args: List[MapAlgebraAST], id: UUID, metadata: Option[NodeMetadata]) extends Operation { val symbol = "min" def withArgs(newArgs: List[MapAlgebraAST]): MapAlgebraAST = copy(args = newArgs) def withMetadata(newMd: NodeMetadata): MapAlgebraAST = copy(metadata = Some(newMd)) } final case class Equality(args: List[MapAlgebraAST], id: UUID, metadata: Option[NodeMetadata]) extends Operation { val symbol = "==" def withArgs(newArgs: List[MapAlgebraAST]): MapAlgebraAST = copy(args = newArgs) def withMetadata(newMd: NodeMetadata): MapAlgebraAST = copy(metadata = Some(newMd)) } final case class Inequality(args: List[MapAlgebraAST], id: UUID, metadata: Option[NodeMetadata]) extends Operation { val symbol = "!=" def withArgs(newArgs: List[MapAlgebraAST]): MapAlgebraAST = copy(args = newArgs) def withMetadata(newMd: NodeMetadata): MapAlgebraAST = copy(metadata = Some(newMd)) } final case class Greater(args: List[MapAlgebraAST], id: UUID, metadata: Option[NodeMetadata]) extends Operation { val symbol = ">" def withArgs(newArgs: List[MapAlgebraAST]): MapAlgebraAST = copy(args = newArgs) def withMetadata(newMd: NodeMetadata): MapAlgebraAST = copy(metadata = Some(newMd)) } final case class GreaterOrEqual(args: List[MapAlgebraAST], id: UUID, metadata: Option[NodeMetadata]) extends Operation { val symbol = ">=" def withArgs(newArgs: List[MapAlgebraAST]): MapAlgebraAST = copy(args = newArgs) def withMetadata(newMd: NodeMetadata): MapAlgebraAST = copy(metadata = Some(newMd)) } final case class Less(args: List[MapAlgebraAST], id: UUID, metadata: Option[NodeMetadata]) extends Operation { val symbol = "<" def withArgs(newArgs: List[MapAlgebraAST]): MapAlgebraAST = copy(args = newArgs) def withMetadata(newMd: NodeMetadata): MapAlgebraAST = copy(metadata = Some(newMd)) } final case class LessOrEqual(args: List[MapAlgebraAST], id: UUID, metadata: Option[NodeMetadata]) extends Operation { val symbol = "<=" def withArgs(newArgs: List[MapAlgebraAST]): MapAlgebraAST = copy(args = newArgs) def withMetadata(newMd: NodeMetadata): MapAlgebraAST = copy(metadata = Some(newMd)) } final case class And(args: List[MapAlgebraAST], id: UUID, metadata: Option[NodeMetadata]) extends Operation { val symbol = "and" def withArgs(newArgs: List[MapAlgebraAST]): MapAlgebraAST = copy(args = newArgs) def withMetadata(newMd: NodeMetadata): MapAlgebraAST = copy(metadata = Some(newMd)) } final case class Or(args: List[MapAlgebraAST], id: UUID, metadata: Option[NodeMetadata]) extends Operation { val symbol = "or" def withArgs(newArgs: List[MapAlgebraAST]): MapAlgebraAST = copy(args = newArgs) def withMetadata(newMd: NodeMetadata): MapAlgebraAST = copy(metadata = Some(newMd)) } final case class Xor(args: List[MapAlgebraAST], id: UUID, metadata: Option[NodeMetadata]) extends Operation { val symbol = "xor" def withArgs(newArgs: List[MapAlgebraAST]): MapAlgebraAST = copy(args = newArgs) def withMetadata(newMd: NodeMetadata): MapAlgebraAST = copy(metadata = Some(newMd)) } final case class Pow(args: List[MapAlgebraAST], id: UUID, metadata: Option[NodeMetadata]) extends Operation { val symbol = "^" def withArgs(newArgs: List[MapAlgebraAST]): MapAlgebraAST = copy(args = newArgs) def withMetadata(newMd: NodeMetadata): MapAlgebraAST = copy(metadata = Some(newMd)) } final case class Atan2(args: List[MapAlgebraAST], id: UUID, metadata: Option[NodeMetadata]) extends Operation { val symbol = "atan2" def withArgs(newArgs: List[MapAlgebraAST]): MapAlgebraAST = copy(args = newArgs) def withMetadata(newMd: NodeMetadata): MapAlgebraAST = copy(metadata = Some(newMd)) } sealed trait UnaryOperation extends Operation with Serializable final case class Masking(args: List[MapAlgebraAST], id: UUID, metadata: Option[NodeMetadata], mask: MultiPolygon) extends UnaryOperation { val symbol = "mask" def withArgs(newArgs: List[MapAlgebraAST]): MapAlgebraAST = copy(args = newArgs) def withMetadata(newMd: NodeMetadata): MapAlgebraAST = copy(metadata = Some(newMd)) } final case class Classification(args: List[MapAlgebraAST], id: UUID, metadata: Option[NodeMetadata], classMap: ClassMap) extends UnaryOperation { val symbol = "classify" def withArgs(newArgs: List[MapAlgebraAST]): MapAlgebraAST = copy(args = newArgs) def withMetadata(newMd: NodeMetadata): MapAlgebraAST = copy(metadata = Some(newMd)) } final case class IsDefined(args: List[MapAlgebraAST], id: UUID, metadata: Option[NodeMetadata]) extends UnaryOperation { val symbol = "isdefined" def withArgs(newArgs: List[MapAlgebraAST]): MapAlgebraAST = copy(args = newArgs) def withMetadata(newMd: NodeMetadata): MapAlgebraAST = copy(metadata = Some(newMd)) } final case class IsUndefined(args: List[MapAlgebraAST], id: UUID, metadata: Option[NodeMetadata]) extends UnaryOperation { val symbol = "isundefined" def withArgs(newArgs: List[MapAlgebraAST]): MapAlgebraAST = copy(args = newArgs) def withMetadata(newMd: NodeMetadata): MapAlgebraAST = copy(metadata = Some(newMd)) } final case class SquareRoot(args: List[MapAlgebraAST], id: UUID, metadata: Option[NodeMetadata]) extends UnaryOperation { val symbol = "sqrt" def withArgs(newArgs: List[MapAlgebraAST]): MapAlgebraAST = copy(args = newArgs) def withMetadata(newMd: NodeMetadata): MapAlgebraAST = copy(metadata = Some(newMd)) } final case class Log(args: List[MapAlgebraAST], id: UUID, metadata: Option[NodeMetadata]) extends UnaryOperation { val symbol = "log" def withArgs(newArgs: List[MapAlgebraAST]): MapAlgebraAST = copy(args = newArgs) def withMetadata(newMd: NodeMetadata): MapAlgebraAST = copy(metadata = Some(newMd)) } final case class Log10(args: List[MapAlgebraAST], id: UUID, metadata: Option[NodeMetadata]) extends UnaryOperation { val symbol = "log10" def withArgs(newArgs: List[MapAlgebraAST]): MapAlgebraAST = copy(args = newArgs) def withMetadata(newMd: NodeMetadata): MapAlgebraAST = copy(metadata = Some(newMd)) } final case class Round(args: List[MapAlgebraAST], id: UUID, metadata: Option[NodeMetadata]) extends UnaryOperation { val symbol = "round" def withArgs(newArgs: List[MapAlgebraAST]): MapAlgebraAST = copy(args = newArgs) def withMetadata(newMd: NodeMetadata): MapAlgebraAST = copy(metadata = Some(newMd)) } final case class Floor(args: List[MapAlgebraAST], id: UUID, metadata: Option[NodeMetadata]) extends UnaryOperation { val symbol = "floor" def withArgs(newArgs: List[MapAlgebraAST]): MapAlgebraAST = copy(args = newArgs) def withMetadata(newMd: NodeMetadata): MapAlgebraAST = copy(metadata = Some(newMd)) } final case class Ceil(args: List[MapAlgebraAST], id: UUID, metadata: Option[NodeMetadata]) extends UnaryOperation { val symbol = "ceil" def withArgs(newArgs: List[MapAlgebraAST]): MapAlgebraAST = copy(args = newArgs) def withMetadata(newMd: NodeMetadata): MapAlgebraAST = copy(metadata = Some(newMd)) } final case class NumericNegation(args: List[MapAlgebraAST], id: UUID, metadata: Option[NodeMetadata]) extends UnaryOperation { val symbol = "neg" def withArgs(newArgs: List[MapAlgebraAST]): MapAlgebraAST = copy(args = newArgs) def withMetadata(newMd: NodeMetadata): MapAlgebraAST = copy(metadata = Some(newMd)) } final case class LogicalNegation(args: List[MapAlgebraAST], id: UUID, metadata: Option[NodeMetadata]) extends UnaryOperation { val symbol = "not" def withArgs(newArgs: List[MapAlgebraAST]): MapAlgebraAST = copy(args = newArgs) def withMetadata(newMd: NodeMetadata): MapAlgebraAST = copy(metadata = Some(newMd)) } final case class Abs(args: List[MapAlgebraAST], id: UUID, metadata: Option[NodeMetadata]) extends UnaryOperation { val symbol = "abs" def withArgs(newArgs: List[MapAlgebraAST]): MapAlgebraAST = copy(args = newArgs) def withMetadata(newMd: NodeMetadata): MapAlgebraAST = copy(metadata = Some(newMd)) } final case class Sin(args: List[MapAlgebraAST], id: UUID, metadata: Option[NodeMetadata]) extends UnaryOperation { val symbol = "sin" def withArgs(newArgs: List[MapAlgebraAST]): MapAlgebraAST = copy(args = newArgs) def withMetadata(newMd: NodeMetadata): MapAlgebraAST = copy(metadata = Some(newMd)) } final case class Cos(args: List[MapAlgebraAST], id: UUID, metadata: Option[NodeMetadata]) extends UnaryOperation { val symbol = "cos" def withArgs(newArgs: List[MapAlgebraAST]): MapAlgebraAST = copy(args = newArgs) def withMetadata(newMd: NodeMetadata): MapAlgebraAST = copy(metadata = Some(newMd)) } final case class Tan(args: List[MapAlgebraAST], id: UUID, metadata: Option[NodeMetadata]) extends UnaryOperation { val symbol = "tan" def withArgs(newArgs: List[MapAlgebraAST]): MapAlgebraAST = copy(args = newArgs) def withMetadata(newMd: NodeMetadata): MapAlgebraAST = copy(metadata = Some(newMd)) } final case class Sinh(args: List[MapAlgebraAST], id: UUID, metadata: Option[NodeMetadata]) extends UnaryOperation { val symbol = "sinh" def withArgs(newArgs: List[MapAlgebraAST]): MapAlgebraAST = copy(args = newArgs) def withMetadata(newMd: NodeMetadata): MapAlgebraAST = copy(metadata = Some(newMd)) } final case class Cosh(args: List[MapAlgebraAST], id: UUID, metadata: Option[NodeMetadata]) extends UnaryOperation { val symbol = "cosh" def withArgs(newArgs: List[MapAlgebraAST]): MapAlgebraAST = copy(args = newArgs) def withMetadata(newMd: NodeMetadata): MapAlgebraAST = copy(metadata = Some(newMd)) } final case class Tanh(args: List[MapAlgebraAST], id: UUID, metadata: Option[NodeMetadata]) extends UnaryOperation { val symbol = "tanh" def withArgs(newArgs: List[MapAlgebraAST]): MapAlgebraAST = copy(args = newArgs) def withMetadata(newMd: NodeMetadata): MapAlgebraAST = copy(metadata = Some(newMd)) } final case class Asin(args: List[MapAlgebraAST], id: UUID, metadata: Option[NodeMetadata]) extends UnaryOperation { val symbol = "asin" def withArgs(newArgs: List[MapAlgebraAST]): MapAlgebraAST = copy(args = newArgs) def withMetadata(newMd: NodeMetadata): MapAlgebraAST = copy(metadata = Some(newMd)) } final case class Acos(args: List[MapAlgebraAST], id: UUID, metadata: Option[NodeMetadata]) extends UnaryOperation { val symbol = "acos" def withArgs(newArgs: List[MapAlgebraAST]): MapAlgebraAST = copy(args = newArgs) def withMetadata(newMd: NodeMetadata): MapAlgebraAST = copy(metadata = Some(newMd)) } final case class Atan(args: List[MapAlgebraAST], id: UUID, metadata: Option[NodeMetadata]) extends UnaryOperation { val symbol = "atan" def withArgs(newArgs: List[MapAlgebraAST]): MapAlgebraAST = copy(args = newArgs) def withMetadata(newMd: NodeMetadata): MapAlgebraAST = copy(metadata = Some(newMd)) } sealed trait FocalOperation extends UnaryOperation { def neighborhood: Neighborhood } final case class FocalMax(args: List[MapAlgebraAST], id: UUID, metadata: Option[NodeMetadata], neighborhood: Neighborhood) extends FocalOperation { val symbol = "focalMax" def withArgs(newArgs: List[MapAlgebraAST]): MapAlgebraAST = copy(args = newArgs) def withMetadata(newMd: NodeMetadata): MapAlgebraAST = copy(metadata = Some(newMd)) } final case class FocalMin(args: List[MapAlgebraAST], id: UUID, metadata: Option[NodeMetadata], neighborhood: Neighborhood) extends FocalOperation { val symbol = "focalMin" def withArgs(newArgs: List[MapAlgebraAST]): MapAlgebraAST = copy(args = newArgs) def withMetadata(newMd: NodeMetadata): MapAlgebraAST = copy(metadata = Some(newMd)) } final case class FocalMean(args: List[MapAlgebraAST], id: UUID, metadata: Option[NodeMetadata], neighborhood: Neighborhood) extends FocalOperation { val symbol = "focalMean" def withArgs(newArgs: List[MapAlgebraAST]): MapAlgebraAST = copy(args = newArgs) def withMetadata(newMd: NodeMetadata): MapAlgebraAST = copy(metadata = Some(newMd)) } final case class FocalMedian(args: List[MapAlgebraAST], id: UUID, metadata: Option[NodeMetadata], neighborhood: Neighborhood) extends FocalOperation { val symbol = "focalMedian" def withArgs(newArgs: List[MapAlgebraAST]): MapAlgebraAST = copy(args = newArgs) def withMetadata(newMd: NodeMetadata): MapAlgebraAST = copy(metadata = Some(newMd)) } final case class FocalMode(args: List[MapAlgebraAST], id: UUID, metadata: Option[NodeMetadata], neighborhood: Neighborhood) extends FocalOperation { val symbol = "focalMode" def withArgs(newArgs: List[MapAlgebraAST]): MapAlgebraAST = copy(args = newArgs) def withMetadata(newMd: NodeMetadata): MapAlgebraAST = copy(metadata = Some(newMd)) } final case class FocalSum(args: List[MapAlgebraAST], id: UUID, metadata: Option[NodeMetadata], neighborhood: Neighborhood) extends FocalOperation { val symbol = "focalSum" def withArgs(newArgs: List[MapAlgebraAST]): MapAlgebraAST = copy(args = newArgs) def withMetadata(newMd: NodeMetadata): MapAlgebraAST = copy(metadata = Some(newMd)) } final case class FocalStdDev(args: List[MapAlgebraAST], id: UUID, metadata: Option[NodeMetadata], neighborhood: Neighborhood) extends FocalOperation { val symbol = "focalStdDev" def withArgs(newArgs: List[MapAlgebraAST]): MapAlgebraAST = copy(args = newArgs) def withMetadata(newMd: NodeMetadata): MapAlgebraAST = copy(metadata = Some(newMd)) } sealed trait MapAlgebraLeaf extends MapAlgebraAST { val `type`: String def args: List[MapAlgebraAST] = List.empty def find(id: UUID): Option[MapAlgebraAST] = if (this.id == id) Some(this) else None def withArgs(newArgs: List[MapAlgebraAST]): MapAlgebraAST = this } final case class Constant(id: UUID, constant: Double, metadata: Option[NodeMetadata]) extends MapAlgebraLeaf { val `type` = "const" def sources: Seq[MapAlgebraAST.MapAlgebraLeaf] = List() def substitute( substitutions: Map[UUID, MapAlgebraAST]): Option[MapAlgebraAST] = Some(this) def withMetadata(newMd: NodeMetadata): MapAlgebraAST = copy(metadata = Some(newMd)) } /** Map Algebra sources */ final case class LiteralTile(id: UUID, lt: Tile, metadata: Option[NodeMetadata]) extends MapAlgebraLeaf { val `type` = "rasterLiteral" def sources: Seq[MapAlgebraAST.MapAlgebraLeaf] = List(this) def substitute( substitutions: Map[UUID, MapAlgebraAST]): Option[MapAlgebraAST] = Some(this) def withMetadata(newMd: NodeMetadata): MapAlgebraAST = copy(metadata = Some(newMd)) } final case class ProjectRaster(id: UUID, projId: UUID, band: Option[Int], celltype: Option[CellType], metadata: Option[NodeMetadata]) extends MapAlgebraLeaf with RFMLRaster { val `type` = "projectSrc" def sources: Seq[MapAlgebraAST.MapAlgebraLeaf] = List(this) def substitute( substitutions: Map[UUID, MapAlgebraAST]): Option[MapAlgebraAST] = Some(this) def withMetadata(newMd: NodeMetadata): MapAlgebraAST = copy(metadata = Some(newMd)) } final case class LayerRaster(id: UUID, layerId: UUID, band: Option[Int], celltype: Option[CellType], metadata: Option[NodeMetadata]) extends MapAlgebraLeaf with RFMLRaster { val `type` = "layerSrc" def sources: Seq[MapAlgebraAST.MapAlgebraLeaf] = List(this) def substitute( substitutions: Map[UUID, MapAlgebraAST]): Option[MapAlgebraAST] = Some(this) def withMetadata(newMd: NodeMetadata): MapAlgebraAST = copy(metadata = Some(newMd)) } final case class ToolReference(id: UUID, toolId: UUID) extends MapAlgebraLeaf { val `type` = "ref" def metadata: Option[NodeMetadata] = None def sources: List[MapAlgebraAST.MapAlgebraLeaf] = Nil def substitute( substitutions: Map[UUID, MapAlgebraAST]): Option[MapAlgebraAST] = substitutions.get(toolId) def withMetadata(newMd: NodeMetadata): MapAlgebraAST = this } }
Java
/* Generated by camel build tools - do NOT edit this file! */ package org.apache.camel.component.nats; import java.util.Map; import org.apache.camel.CamelContext; import org.apache.camel.spi.GeneratedPropertyConfigurer; import org.apache.camel.spi.PropertyConfigurerGetter; import org.apache.camel.util.CaseInsensitiveMap; import org.apache.camel.support.component.PropertyConfigurerSupport; /** * Generated by camel build tools - do NOT edit this file! */ @SuppressWarnings("unchecked") public class NatsComponentConfigurer extends PropertyConfigurerSupport implements GeneratedPropertyConfigurer, PropertyConfigurerGetter { private static final Map<String, Object> ALL_OPTIONS; static { Map<String, Object> map = new CaseInsensitiveMap(); map.put("servers", java.lang.String.class); map.put("verbose", boolean.class); map.put("bridgeErrorHandler", boolean.class); map.put("lazyStartProducer", boolean.class); map.put("basicPropertyBinding", boolean.class); map.put("useGlobalSslContextParameters", boolean.class); ALL_OPTIONS = map; } @Override public boolean configure(CamelContext camelContext, Object obj, String name, Object value, boolean ignoreCase) { NatsComponent target = (NatsComponent) obj; switch (ignoreCase ? name.toLowerCase() : name) { case "basicpropertybinding": case "basicPropertyBinding": target.setBasicPropertyBinding(property(camelContext, boolean.class, value)); return true; case "bridgeerrorhandler": case "bridgeErrorHandler": target.setBridgeErrorHandler(property(camelContext, boolean.class, value)); return true; case "lazystartproducer": case "lazyStartProducer": target.setLazyStartProducer(property(camelContext, boolean.class, value)); return true; case "servers": target.setServers(property(camelContext, java.lang.String.class, value)); return true; case "useglobalsslcontextparameters": case "useGlobalSslContextParameters": target.setUseGlobalSslContextParameters(property(camelContext, boolean.class, value)); return true; case "verbose": target.setVerbose(property(camelContext, boolean.class, value)); return true; default: return false; } } @Override public Map<String, Object> getAllOptions(Object target) { return ALL_OPTIONS; } @Override public Object getOptionValue(Object obj, String name, boolean ignoreCase) { NatsComponent target = (NatsComponent) obj; switch (ignoreCase ? name.toLowerCase() : name) { case "basicpropertybinding": case "basicPropertyBinding": return target.isBasicPropertyBinding(); case "bridgeerrorhandler": case "bridgeErrorHandler": return target.isBridgeErrorHandler(); case "lazystartproducer": case "lazyStartProducer": return target.isLazyStartProducer(); case "servers": return target.getServers(); case "useglobalsslcontextparameters": case "useGlobalSslContextParameters": return target.isUseGlobalSslContextParameters(); case "verbose": return target.isVerbose(); default: return null; } } }
Java
from typing import List class Solution: def partitionLabels(self, S: str) -> List[int]: lastPos, seen, currMax = {}, set(), -1 res = [] for i in range(0, 26): c = chr(97+i) lastPos[c] = S.rfind(c) for i, c in enumerate(S): # Encounter new index higher than currMax if i > currMax: res.append(currMax+1) currMax = max(currMax, lastPos[c]) res.append(len(S)) ans = [res[i]-res[i-1] for i in range(1, len(res))] return ans
Java
package Paws::CloudWatchEvents::RemoveTargets; use Moose; has Ids => (is => 'ro', isa => 'ArrayRef[Str|Undef]', required => 1); has Rule => (is => 'ro', isa => 'Str', required => 1); use MooseX::ClassAttribute; class_has _api_call => (isa => 'Str', is => 'ro', default => 'RemoveTargets'); class_has _returns => (isa => 'Str', is => 'ro', default => 'Paws::CloudWatchEvents::RemoveTargetsResponse'); class_has _result_key => (isa => 'Str', is => 'ro'); 1; ### main pod documentation begin ### =head1 NAME Paws::CloudWatchEvents::RemoveTargets - Arguments for method RemoveTargets on Paws::CloudWatchEvents =head1 DESCRIPTION This class represents the parameters used for calling the method RemoveTargets on the Amazon CloudWatch Events service. Use the attributes of this class as arguments to method RemoveTargets. You shouldn't make instances of this class. Each attribute should be used as a named argument in the call to RemoveTargets. As an example: $service_obj->RemoveTargets(Att1 => $value1, Att2 => $value2, ...); Values for attributes that are native types (Int, String, Float, etc) can passed as-is (scalar values). Values for complex Types (objects) can be passed as a HashRef. The keys and values of the hashref will be used to instance the underlying object. =head1 ATTRIBUTES =head2 B<REQUIRED> Ids => ArrayRef[Str|Undef] The IDs of the targets to remove from the rule. =head2 B<REQUIRED> Rule => Str The name of the rule. =head1 SEE ALSO This class forms part of L<Paws>, documenting arguments for method RemoveTargets in L<Paws::CloudWatchEvents> =head1 BUGS and CONTRIBUTIONS The source code is located here: https://github.com/pplu/aws-sdk-perl Please report bugs to: https://github.com/pplu/aws-sdk-perl/issues =cut
Java
# Welcome to the yMatePlatform! # ![](https://github.com/suninformation/ymateplatform/wiki/images/ymp_logo.png) [![Build Status](https://travis-ci.org/suninformation/ymateplatform.png?branch=master)](https://travis-ci.org/suninformation/ymateplatform) YMP开发框架是一套轻量级的JAVA应用开发框架,具有统一的配置体系结构、系统与业务日志分离、插件化开发模式、简单轻量的MVC和持久化支持等特性; ## 文档目录 ## * [概述](https://github.com/suninformation/ymateplatform/wiki/Home) * [初始化配置文件详细说明](https://github.com/suninformation/ymateplatform/wiki/YMP框架初始化配置文件详细说明) * [配置体系模块使用详解](https://github.com/suninformation/ymateplatform/wiki/YMP框架配置体系模块使用详解) * [日志模块使用详解](https://github.com/suninformation/ymateplatform/wiki/YMP框架日志模块使用详解) * [插件模块使用详解](https://github.com/suninformation/ymateplatform/wiki/YMP框架插件模块使用详解) * [MVC模块使用详解](https://github.com/suninformation/ymateplatform/wiki/YMP框架MVC模块使用详解) * [持久化模块使用详解](https://github.com/suninformation/ymateplatform/wiki/YMP框架持久化模块使用详解) * [验证模块使用详解](https://github.com/suninformation/ymateplatform/wiki/YMP框架验证模块使用详解) * [模块管理器使用详解](https://github.com/suninformation/ymateplatform/wiki/YMP框架模块管理器使用详解) * [框架快速搭建手册](https://github.com/suninformation/ymateplatform/wiki/YMP框架快速搭建手册) * [持久化代码生成器使用详解](https://github.com/suninformation/ymateplatform/wiki/YMP框架持久化代码生成器使用详解)
Java
package ruboweb.pushetta.back.model; import java.security.MessageDigest; import java.security.NoSuchAlgorithmException; import java.security.SecureRandom; import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.Table; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.data.jpa.domain.AbstractPersistable; @Entity @Table(name = "user") public class User extends AbstractPersistable<Long> { private static final Logger logger = LoggerFactory.getLogger(User.class); private static final long serialVersionUID = 6088280461151862299L; @Column(nullable = false) private String name; @Column(nullable = false) private String token; public User() { } public User(String name) { this.name = name; this.token = this.generateToken(); } /** * @return the name */ public String getName() { return name; } /** * @param name * the name to set */ public void setName(String name) { this.name = name; } /** * @return the token */ public String getToken() { return token; } /** * @param token * the token to set */ public void setToken(String token) { this.token = token; } private String generateToken() { try { SecureRandom prng = SecureRandom.getInstance("SHA1PRNG"); String randomNum = new Integer(prng.nextInt()).toString(); MessageDigest sha = MessageDigest.getInstance("SHA-1"); byte[] bytes = sha.digest(randomNum.getBytes()); StringBuilder result = new StringBuilder(); char[] digits = { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f' }; byte b; for (int idx = 0; idx < bytes.length; ++idx) { b = bytes[idx]; result.append(digits[(b & 240) >> 4]); result.append(digits[b & 15]); } return result.toString(); } catch (NoSuchAlgorithmException ex) { logger.error("generateToken() -- " + ex.getMessage()); } return null; } }
Java
// // This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.8-b130911.1802 // 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: 2016.10.09 at 10:10:23 AM CST // package com.elong.nb.model.elong; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlElement; import java.util.List; import com.alibaba.fastjson.annotation.JSONField; import javax.xml.bind.annotation.XmlType; /** * <p>Java class for CommentResult complex type. * * <p>The following schema fragment specifies the expected content contained within this class. * * <pre> * &lt;complexType name="CommentResult"> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="Count" type="{http://www.w3.org/2001/XMLSchema}int"/> * &lt;element name="Comments" type="{}ArrayOfCommentInfo" minOccurs="0"/> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * </pre> * * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "CommentResult", propOrder = { "count", "comments" }) public class CommentResult { @JSONField(name = "Count") protected int count; @JSONField(name = "Comments") protected List<CommentInfo> comments; /** * Gets the value of the count property. * */ public int getCount() { return count; } /** * Sets the value of the count property. * */ public void setCount(int value) { this.count = value; } /** * Gets the value of the comments property. * * @return * possible object is * {@link List<CommentInfo> } * */ public List<CommentInfo> getComments() { return comments; } /** * Sets the value of the comments property. * * @param value * allowed object is * {@link List<CommentInfo> } * */ public void setComments(List<CommentInfo> value) { this.comments = value; } }
Java
<?php include_once 'functionCheckLogin.php'; $code_login = login_check($mysqli); if($code_login <0) { header('Location: /index.php'); } ?> <html> <head> <meta name='viewport' content='width=device-width'> <title>Impostazioni generali</title> <link rel='stylesheet' href='css/style_general_settings.css'> </head> <body> <div class='container'> <div id='settings-div'> <h3>Impostazioni generali</h3> <fieldset> <table align=center cellpadding=5> <tr><td><button onClick="location.assign('formChangePassword.php')">Cambia Password</button></td></tr> <tr><td><button onClick="location.assign('<?php if($code_login==1){echo "firstAdmin.php";} else{echo "firstUser.php";}?>')">Torna a Schede</button></td></tr> <?php if($code_login==1){echo "<tr><td><button onClick='location.assign(\"reboot.php\")'>Riavvia dispositivo</button></td></tr>";}?> <?php if($code_login==1){echo "<tr><td><button onClick='location.assign(\"shutdown.php\")'>Spegni dispositivo</button></td></tr>";}?> </table> </fieldset> </div> </div> </body> </html>
Java
// Copyright 2014 The Serviced Authors. // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. package org.zenoss.app.annotations; import org.springframework.stereotype.Component; /** * Mark an object as an API implementation. */ @Component public @interface API { }
Java
/* * Copyright 2021 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.google.ads.googleads.v9.services; import com.google.ads.googleads.v9.resources.OperatingSystemVersionConstant; import com.google.ads.googleads.v9.services.stub.OperatingSystemVersionConstantServiceStubSettings; import com.google.api.core.ApiFunction; import com.google.api.core.BetaApi; import com.google.api.gax.core.GoogleCredentialsProvider; import com.google.api.gax.core.InstantiatingExecutorProvider; import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider; import com.google.api.gax.rpc.ApiClientHeaderProvider; import com.google.api.gax.rpc.ClientContext; import com.google.api.gax.rpc.ClientSettings; import com.google.api.gax.rpc.StubSettings; import com.google.api.gax.rpc.TransportChannelProvider; import com.google.api.gax.rpc.UnaryCallSettings; import java.io.IOException; import java.util.List; import javax.annotation.Generated; // AUTO-GENERATED DOCUMENTATION AND CLASS. /** * Settings class to configure an instance of {@link OperatingSystemVersionConstantServiceClient}. * * <p>The default instance has everything set to sensible defaults: * * <ul> * <li> The default service address (googleads.googleapis.com) and default port (443) are used. * <li> Credentials are acquired automatically through Application Default Credentials. * <li> Retries are configured for idempotent methods but not for non-idempotent methods. * </ul> * * <p>The builder of this class is recursive, so contained classes are themselves builders. When * build() is called, the tree of builders is called to create the complete settings object. * * <p>For example, to set the total timeout of getOperatingSystemVersionConstant to 30 seconds: * * <pre>{@code * OperatingSystemVersionConstantServiceSettings.Builder * operatingSystemVersionConstantServiceSettingsBuilder = * OperatingSystemVersionConstantServiceSettings.newBuilder(); * operatingSystemVersionConstantServiceSettingsBuilder * .getOperatingSystemVersionConstantSettings() * .setRetrySettings( * operatingSystemVersionConstantServiceSettingsBuilder * .getOperatingSystemVersionConstantSettings() * .getRetrySettings() * .toBuilder() * .setTotalTimeout(Duration.ofSeconds(30)) * .build()); * OperatingSystemVersionConstantServiceSettings operatingSystemVersionConstantServiceSettings = * operatingSystemVersionConstantServiceSettingsBuilder.build(); * }</pre> */ @Generated("by gapic-generator-java") public class OperatingSystemVersionConstantServiceSettings extends ClientSettings<OperatingSystemVersionConstantServiceSettings> { /** Returns the object with the settings used for calls to getOperatingSystemVersionConstant. */ public UnaryCallSettings<GetOperatingSystemVersionConstantRequest, OperatingSystemVersionConstant> getOperatingSystemVersionConstantSettings() { return ((OperatingSystemVersionConstantServiceStubSettings) getStubSettings()) .getOperatingSystemVersionConstantSettings(); } public static final OperatingSystemVersionConstantServiceSettings create( OperatingSystemVersionConstantServiceStubSettings stub) throws IOException { return new OperatingSystemVersionConstantServiceSettings.Builder(stub.toBuilder()).build(); } /** Returns a builder for the default ExecutorProvider for this service. */ public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { return OperatingSystemVersionConstantServiceStubSettings.defaultExecutorProviderBuilder(); } /** Returns the default service endpoint. */ public static String getDefaultEndpoint() { return OperatingSystemVersionConstantServiceStubSettings.getDefaultEndpoint(); } /** Returns the default service scopes. */ public static List<String> getDefaultServiceScopes() { return OperatingSystemVersionConstantServiceStubSettings.getDefaultServiceScopes(); } /** Returns a builder for the default credentials for this service. */ public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { return OperatingSystemVersionConstantServiceStubSettings.defaultCredentialsProviderBuilder(); } /** Returns a builder for the default ChannelProvider for this service. */ public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { return OperatingSystemVersionConstantServiceStubSettings.defaultGrpcTransportProviderBuilder(); } public static TransportChannelProvider defaultTransportChannelProvider() { return OperatingSystemVersionConstantServiceStubSettings.defaultTransportChannelProvider(); } @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { return OperatingSystemVersionConstantServiceStubSettings .defaultApiClientHeaderProviderBuilder(); } /** Returns a new builder for this class. */ public static Builder newBuilder() { return Builder.createDefault(); } /** Returns a new builder for this class. */ public static Builder newBuilder(ClientContext clientContext) { return new Builder(clientContext); } /** Returns a builder containing all the values of this settings class. */ public Builder toBuilder() { return new Builder(this); } protected OperatingSystemVersionConstantServiceSettings(Builder settingsBuilder) throws IOException { super(settingsBuilder); } /** Builder for OperatingSystemVersionConstantServiceSettings. */ public static class Builder extends ClientSettings.Builder<OperatingSystemVersionConstantServiceSettings, Builder> { protected Builder() throws IOException { this(((ClientContext) null)); } protected Builder(ClientContext clientContext) { super(OperatingSystemVersionConstantServiceStubSettings.newBuilder(clientContext)); } protected Builder(OperatingSystemVersionConstantServiceSettings settings) { super(settings.getStubSettings().toBuilder()); } protected Builder(OperatingSystemVersionConstantServiceStubSettings.Builder stubSettings) { super(stubSettings); } private static Builder createDefault() { return new Builder(OperatingSystemVersionConstantServiceStubSettings.newBuilder()); } public OperatingSystemVersionConstantServiceStubSettings.Builder getStubSettingsBuilder() { return ((OperatingSystemVersionConstantServiceStubSettings.Builder) getStubSettings()); } /** * Applies the given settings updater function to all of the unary API methods in this service. * * <p>Note: This method does not support applying settings to streaming methods. */ public Builder applyToAllUnaryMethods( ApiFunction<UnaryCallSettings.Builder<?, ?>, Void> settingsUpdater) { super.applyToAllUnaryMethods( getStubSettingsBuilder().unaryMethodSettingsBuilders(), settingsUpdater); return this; } /** Returns the builder for the settings used for calls to getOperatingSystemVersionConstant. */ public UnaryCallSettings.Builder< GetOperatingSystemVersionConstantRequest, OperatingSystemVersionConstant> getOperatingSystemVersionConstantSettings() { return getStubSettingsBuilder().getOperatingSystemVersionConstantSettings(); } @Override public OperatingSystemVersionConstantServiceSettings build() throws IOException { return new OperatingSystemVersionConstantServiceSettings(this); } } }
Java
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <!-- NewPage --> <html lang="en"> <head> <!-- Generated by javadoc (version 1.6.0_27) on Thu Oct 17 21:44:59 EDT 2013 --> <meta http-equiv="Content-Type" content="text/html" charset="utf-8"> <title>Uses of Class org.apache.solr.update.processor.IgnoreFieldUpdateProcessorFactory (Solr 4.5.1 API)</title> <meta name="date" content="2013-10-17"> <link rel="stylesheet" type="text/css" href="../../../../../../stylesheet.css" title="Style"> </head> <body> <script type="text/javascript"><!-- if (location.href.indexOf('is-external=true') == -1) { parent.document.title="Uses of Class org.apache.solr.update.processor.IgnoreFieldUpdateProcessorFactory (Solr 4.5.1 API)"; } //--> </script> <noscript> <div>JavaScript is disabled on your browser.</div> </noscript> <!-- ========= START OF TOP NAVBAR ======= --> <div class="topNav"><a name="navbar_top"> <!-- --> </a><a href="#skip-navbar_top" title="Skip navigation links"></a><a name="navbar_top_firstrow"> <!-- --> </a> <ul class="navList" title="Navigation"> <li><a href="../../../../../../overview-summary.html">Overview</a></li> <li><a href="../package-summary.html">Package</a></li> <li><a href="../../../../../../org/apache/solr/update/processor/IgnoreFieldUpdateProcessorFactory.html" title="class in org.apache.solr.update.processor">Class</a></li> <li class="navBarCell1Rev">Use</li> <li><a href="../package-tree.html">Tree</a></li> <li><a href="../../../../../../deprecated-list.html">Deprecated</a></li> <li><a href="../../../../../../help-doc.html">Help</a></li> </ul> </div> <div class="subNav"> <ul class="navList"> <li>PREV</li> <li>NEXT</li> </ul> <ul class="navList"> <li><a href="../../../../../../index.html?org/apache/solr/update/processor//class-useIgnoreFieldUpdateProcessorFactory.html" target="_top">FRAMES</a></li> <li><a href="IgnoreFieldUpdateProcessorFactory.html" target="_top">NO FRAMES</a></li> </ul> <ul class="navList" id="allclasses_navbar_top"> <li><a href="../../../../../../allclasses-noframe.html">All Classes</a></li> </ul> <div> <script type="text/javascript"><!-- allClassesLink = document.getElementById("allclasses_navbar_top"); if(window==top) { allClassesLink.style.display = "block"; } else { allClassesLink.style.display = "none"; } //--> </script> </div> <a name="skip-navbar_top"> <!-- --> </a></div> <!-- ========= END OF TOP NAVBAR ========= --> <div class="header"> <h2 title="Uses of Class org.apache.solr.update.processor.IgnoreFieldUpdateProcessorFactory" class="title">Uses of Class<br>org.apache.solr.update.processor.IgnoreFieldUpdateProcessorFactory</h2> </div> <div class="classUseContainer">No usage of org.apache.solr.update.processor.IgnoreFieldUpdateProcessorFactory</div> <!-- ======= START OF BOTTOM NAVBAR ====== --> <div class="bottomNav"><a name="navbar_bottom"> <!-- --> </a><a href="#skip-navbar_bottom" title="Skip navigation links"></a><a name="navbar_bottom_firstrow"> <!-- --> </a> <ul class="navList" title="Navigation"> <li><a href="../../../../../../overview-summary.html">Overview</a></li> <li><a href="../package-summary.html">Package</a></li> <li><a href="../../../../../../org/apache/solr/update/processor/IgnoreFieldUpdateProcessorFactory.html" title="class in org.apache.solr.update.processor">Class</a></li> <li class="navBarCell1Rev">Use</li> <li><a href="../package-tree.html">Tree</a></li> <li><a href="../../../../../../deprecated-list.html">Deprecated</a></li> <li><a href="../../../../../../help-doc.html">Help</a></li> </ul> </div> <div class="subNav"> <ul class="navList"> <li>PREV</li> <li>NEXT</li> </ul> <ul class="navList"> <li><a href="../../../../../../index.html?org/apache/solr/update/processor//class-useIgnoreFieldUpdateProcessorFactory.html" target="_top">FRAMES</a></li> <li><a href="IgnoreFieldUpdateProcessorFactory.html" target="_top">NO FRAMES</a></li> </ul> <ul class="navList" id="allclasses_navbar_bottom"> <li><a href="../../../../../../allclasses-noframe.html">All Classes</a></li> </ul> <div> <script type="text/javascript"><!-- allClassesLink = document.getElementById("allclasses_navbar_bottom"); if(window==top) { allClassesLink.style.display = "block"; } else { allClassesLink.style.display = "none"; } //--> </script> </div> <a name="skip-navbar_bottom"> <!-- --> </a></div> <!-- ======== END OF BOTTOM NAVBAR ======= --> <p class="legalCopy"><small> <i>Copyright &copy; 2000-2013 Apache Software Foundation. All Rights Reserved.</i> <script src='../../../../../../prettify.js' type='text/javascript'></script> <script type='text/javascript'> (function(){ var oldonload = window.onload; if (typeof oldonload != 'function') { window.onload = prettyPrint; } else { window.onload = function() { oldonload(); prettyPrint(); } } })(); </script> </small></p> </body> </html>
Java
// This file is part of MLDB. Copyright 2015 mldb.ai inc. All rights reserved. /** git.cc Jeremy Barnes, 14 November 2015 Copyright (c) mldb.ai inc. All rights reserved. */ #include "mldb/core/procedure.h" #include "mldb/core/dataset.h" #include "mldb/base/per_thread_accumulator.h" #include "mldb/types/url.h" #include "mldb/types/structure_description.h" #include "mldb/types/vector_description.h" #include "mldb/types/any_impl.h" #include "mldb/vfs/fs_utils.h" #include "mldb/base/scope.h" #include "mldb/utils/distribution.h" #include "mldb/base/parallel.h" #include <boost/algorithm/string.hpp> #include "mldb/types/annotated_exception.h" #include "mldb/utils/log.h" #include "mldb/ext/libgit2/include/git2.h" #include "mldb/ext/libgit2/include/git2/revwalk.h" #include "mldb/ext/libgit2/include/git2/commit.h" #include "mldb/ext/libgit2/include/git2/diff.h" struct GitFileOperation { GitFileOperation() : insertions(0), deletions(0) { } int insertions; int deletions; std::string op; }; struct GitFileStats { GitFileStats() : insertions(0), deletions(0) { } std::map<std::string, GitFileOperation> files; int insertions; int deletions; }; int stats_by_file_each_file_cb(const git_diff_delta *delta, float progress, void *payload) { GitFileStats & stats = *((GitFileStats *)payload); GitFileOperation op; switch (delta->status) { case GIT_DELTA_UNMODIFIED: /** no changes */ return 0; case GIT_DELTA_ADDED: /** entry does not exist in old version */ op.op = "added"; break; case GIT_DELTA_DELETED: /** entry does not exist in new version */ op.op = "deleted"; break; case GIT_DELTA_MODIFIED: /** entry content changed between old and new */ op.op = "modified"; break; case GIT_DELTA_RENAMED: /** entry was renamed between old and new */ op.op = "renamed"; break; case GIT_DELTA_COPIED: /** entry was copied from another old entry */ op.op = "copied"; break; case GIT_DELTA_IGNORED: /** entry is ignored item in workdir */ return 0; case GIT_DELTA_UNTRACKED: /** entry is untracked item in workdir */ return 0; case GIT_DELTA_TYPECHANGE: /** type of entry changed between old and new */ return 0; default: throw std::logic_error("git status"); } if (delta->old_file.path) stats.files[delta->old_file.path] = op; return 0; } int stats_by_file_each_hunk_cb(const git_diff_delta *delta, const git_diff_hunk * hunk, void *payload) { GitFileStats & stats = *((GitFileStats *)payload); if (delta->old_file.path) stats.files[delta->old_file.path].deletions += hunk->old_lines; if (delta->new_file.path) stats.files[delta->new_file.path].insertions += hunk->new_lines; stats.insertions += hunk->new_lines; stats.deletions += hunk->old_lines; return 0; } GitFileStats git_diff_by_file(git_diff *diff) { GitFileStats result; int error = git_diff_foreach(diff, stats_by_file_each_file_cb, nullptr, /* binary callback */ stats_by_file_each_hunk_cb, nullptr, /* line callback */ &result); if (error < 0) { throw MLDB::AnnotatedException(400, "Error traversing diff: " + std::string(giterr_last()->message)); } return result; } using namespace std; namespace MLDB { /*****************************************************************************/ /* GIT IMPORTER */ /*****************************************************************************/ struct GitImporterConfig : ProcedureConfig { static constexpr const char * name = "import.git"; GitImporterConfig() : revisions({"HEAD"}), importStats(false), importTree(false), ignoreUnknownEncodings(true) { outputDataset.withType("sparse.mutable"); } Url repository; PolyConfigT<Dataset> outputDataset; std::vector<std::string> revisions; bool importStats; bool importTree; bool ignoreUnknownEncodings; // TODO // when // where // limit // offset // select (instead of importStats, importTree) }; DECLARE_STRUCTURE_DESCRIPTION(GitImporterConfig); DEFINE_STRUCTURE_DESCRIPTION(GitImporterConfig); GitImporterConfigDescription:: GitImporterConfigDescription() { addField("repository", &GitImporterConfig::repository, "Git repository to load from. This is currently limited to " "file:// urls which point to an already cloned repository on " "local disk. Remote repositories will need to be checked out " "beforehand using the git command line tools."); addField("outputDataset", &GitImporterConfig::outputDataset, "Output dataset for result. One row will be produced per commit. " "See the documentation for the output format.", PolyConfigT<Dataset>().withType("sparse.mutable")); std::vector<std::string> defaultRevisions = { "HEAD" }; addField("revisions", &GitImporterConfig::revisions, "Revisions to load from Git (eg, HEAD, HEAD~20..HEAD, tags/*). " "See the gitrevisions (7) documentation. Default is all revisions " "reachable from HEAD", defaultRevisions); addField("importStats", &GitImporterConfig::importStats, "If true, then import the stats (number of files " "changed, lines added and lines deleted)", false); addField("importTree", &GitImporterConfig::importTree, "If true, then import the tree (names of files changed)", false); addField("ignoreUnknownEncodings", &GitImporterConfig::ignoreUnknownEncodings, "If true (default), ignore commit messages with unknown encodings " "(supported are ISO-8859-1 and UTF-8) and replace with a " "placeholder. If false, messages with unknown encodings will " "cause the commit to abort."); addParent<ProcedureConfig>(); } struct GitImporter: public Procedure { GitImporter(MldbEngine * owner, PolyConfig config_, const std::function<bool (const Json::Value &)> & onProgress) : Procedure(owner) { config = config_.params.convert<GitImporterConfig>(); } GitImporterConfig config; std::string encodeOid(const git_oid & oid) const { char shortsha[10] = {0}; git_oid_tostr(shortsha, 9, &oid); return string(shortsha); }; // Process an individual commit std::vector<std::tuple<ColumnPath, CellValue, Date> > processCommit(git_repository * repo, const git_oid & oid) const { string sha = encodeOid(oid); auto checkError = [&] (int error, const char * msg) { if (error < 0) throw AnnotatedException(500, string(msg) + ": " + giterr_last()->message, "repository", config.repository, "commit", string(sha)); }; git_commit *commit; int error = git_commit_lookup(&commit, repo, &oid); checkError(error, "Error getting commit"); Scope_Exit(git_commit_free(commit)); const char *encoding = git_commit_message_encoding(commit); const char *messageStr = git_commit_message(commit); git_time_t time = git_commit_time(commit); int offset_in_min = git_commit_time_offset(commit); const git_signature *committer = git_commit_committer(commit); const git_signature *author = git_commit_author(commit); //const git_oid *tree_id = git_commit_tree_id(commit); git_diff *diff = nullptr; Scope_Exit(git_diff_free(diff)); Utf8String message; if (!encoding || strcmp(encoding, "UTF-8") == 0) { message = Utf8String(messageStr); } else if (strcmp(encoding,"ISO-8859-1") == 0) { message = Utf8String::fromLatin1(messageStr); } else if (config.ignoreUnknownEncodings) { message = "<<<couldn't decode message in " + string(encoding) + " character set>>>"; } else { throw AnnotatedException(500, "Can't decode unknown commit message encoding", "repository", config.repository, "commit", string(sha), "encoding", encoding); } vector<string> parents; unsigned int parentCount = git_commit_parentcount(commit); for (unsigned i = 0; i < parentCount; ++i) { const git_oid *nth_parent_id = git_commit_parent_id(commit, i); git_commit *nth_parent = nullptr; int error = git_commit_parent(&nth_parent, commit, i); checkError(error, "Error getting commit parent"); Scope_Exit(git_commit_free(nth_parent)); parents.emplace_back(encodeOid(*nth_parent_id)); if (i == 0 && parentCount == 1 && (config.importStats || config.importTree)) { const git_oid * parent_tree_id = git_commit_tree_id(nth_parent); if (parent_tree_id) { git_tree * tree = nullptr; git_tree * parentTree = nullptr; error = git_commit_tree(&tree, commit); checkError(error, "Error getting commit tree"); Scope_Exit(git_tree_free(tree)); error = git_commit_tree(&parentTree, nth_parent); checkError(error, "Error getting parent tree"); Scope_Exit(git_tree_free(parentTree)); error = git_diff_tree_to_tree(&diff, repo, tree, parentTree, NULL); checkError(error, "Error diffing commits"); git_diff_find_options opts = GIT_DIFF_FIND_OPTIONS_INIT; opts.flags = GIT_DIFF_FIND_RENAMES | GIT_DIFF_FIND_COPIES | GIT_DIFF_FIND_FOR_UNTRACKED; error = git_diff_find_similar(diff, &opts); checkError(error, "Error detecting renames"); } } } Date timestamp = Date::fromSecondsSinceEpoch(time + 60 * offset_in_min); Utf8String committerName(committer->name); Utf8String committerEmail(committer->email); Utf8String authorName(author->name); Utf8String authorEmail(author->email); std::vector<std::tuple<ColumnPath, CellValue, Date> > row; row.emplace_back(ColumnPath("committer"), committerName, timestamp); row.emplace_back(ColumnPath("committerEmail"), committerEmail, timestamp); row.emplace_back(ColumnPath("author"), authorName, timestamp); row.emplace_back(ColumnPath("authorEmail"), authorEmail, timestamp); row.emplace_back(ColumnPath("message"), message, timestamp); row.emplace_back(ColumnPath("parentCount"), parentCount, timestamp); for (auto & p: parents) row.emplace_back(ColumnPath("parent"), p, timestamp); int filesChanged = 0; int insertions = 0; int deletions = 0; if (diff) { GitFileStats stats = git_diff_by_file(diff); filesChanged = stats.files.size(); insertions = stats.insertions; deletions = stats.deletions; row.emplace_back(ColumnPath("insertions"), insertions, timestamp); row.emplace_back(ColumnPath("deletions"), deletions, timestamp); row.emplace_back(ColumnPath("filesChanged"), filesChanged, timestamp); for (auto & f: stats.files) { if (!config.importTree) break; Utf8String filename(f.first); row.emplace_back(ColumnPath("file"), filename, timestamp); if (f.second.insertions > 0) row.emplace_back(ColumnPath("file." + filename + ".insertions"), f.second.insertions, timestamp); if (f.second.deletions > 0) row.emplace_back(ColumnPath("file." + filename + ".deletions"), f.second.deletions, timestamp); if (!f.second.op.empty()) row.emplace_back(ColumnPath("file." + filename + ".op"), f.second.op, timestamp); } } DEBUG_MSG(logger) << "id " << sha << " had " << filesChanged << " changes, " << insertions << " insertions and " << deletions << " deletions " << message << " parents " << parentCount; return row; } virtual RunOutput run(const ProcedureRunConfig & run, const std::function<bool (const Json::Value &)> & onProgress) const { auto runProcConf = applyRunConfOverProcConf(config, run); auto checkError = [&] (int error, const char * msg) { if (error < 0) throw AnnotatedException(500, string(msg) + ": " + giterr_last()->message, "repository", runProcConf.repository); }; git_libgit2_init(); Scope_Exit(git_libgit2_shutdown()); git_repository * repo; Utf8String repoName(runProcConf.repository.toString()); repoName.removePrefix("file://"); int error = git_repository_open(&repo, repoName.rawData()); checkError(error, "Error opening git repository"); Scope_Exit(git_repository_free(repo)); // Create the output dataset std::shared_ptr<Dataset> output; if (!runProcConf.outputDataset.type.empty() || !runProcConf.outputDataset.id.empty()) { output = createDataset(engine, runProcConf.outputDataset, nullptr, true /*overwrite*/); } git_revwalk *walker; error = git_revwalk_new(&walker, repo); checkError(error, "Error creating commit walker"); Scope_Exit(git_revwalk_free(walker)); for (auto & r: runProcConf.revisions) { if (r.find("*") != string::npos) error = git_revwalk_push_glob(walker, r.c_str()); else if (r.find("..") != string::npos) error = git_revwalk_push_range(walker, r.c_str()); else error = git_revwalk_push_ref(walker, r.c_str()); if (error < 0) throw AnnotatedException(500, "Error adding revision: " + string(giterr_last()->message), "repository", runProcConf.repository, "revision", r); } vector<git_oid> oids; git_oid oid; while (!git_revwalk_next(&oid, walker)) { oids.push_back(oid); } struct Accum { Accum(const Utf8String & filename) { rows.reserve(1000); int error = git_repository_open(&repo, filename.rawData()); if (error < 0) throw AnnotatedException(400, "Error opening Git repo: " + string(giterr_last()->message)); } ~Accum() { git_repository_free(repo); } std::vector<std::pair<RowPath, std::vector<std::tuple<ColumnPath, CellValue, Date> > > > rows; git_repository * repo; }; PerThreadAccumulator<Accum> accum([&] () { return new Accum(repoName); }); INFO_MSG(logger) << "processing " << oids.size() << " commits"; auto doProcessCommit = [&] (int i) { if (i && i % 100 == 0) INFO_MSG(logger) << "imported commit " << i << " of " << oids.size(); Accum & threadAccum = accum.get(); auto row = processCommit(repo, oids[i]); threadAccum.rows.emplace_back(RowPath(encodeOid(oids[i])), std::move(row)); if (threadAccum.rows.size() == 1000) { output->recordRows(threadAccum.rows); threadAccum.rows.clear(); } }; parallelMap(0, oids.size(), doProcessCommit); for (auto & t: accum.threads) { output->recordRows(t->rows); } output->commit(); RunOutput result; return result; } virtual Any getStatus() const { return Any(); } GitImporterConfig procConfig; }; RegisterProcedureType<GitImporter, GitImporterConfig> regGit(builtinPackage(), "Import a Git repository's metadata into MLDB", "procedures/GitImporter.md.html"); } // namespace MLDB
Java
/* * Copyright 2016 Atanas Stoychev Kanchev * 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.atanas.kanchev.testframework.appium.tests.android.browser_tests; import io.appium.java_client.remote.AndroidMobileCapabilityType; import io.appium.java_client.remote.MobileBrowserType; import io.appium.java_client.remote.MobileCapabilityType; import org.junit.Test; import org.openqa.selenium.By; import org.openqa.selenium.Platform; import org.openqa.selenium.ScreenOrientation; import static com.atanas.kanchev.testframework.appium.accessors.AppiumAccessors.$appium; import static com.atanas.kanchev.testframework.selenium.accessors.SeleniumAccessors.$selenium; public class ChromeTest { @Test public void androidChromeTest() throws Exception { $appium().init().buildDefaultService(); $appium().init().startServer(); $appium().init() .setCap(MobileCapabilityType.BROWSER_NAME, MobileBrowserType.CHROME) .setCap(MobileCapabilityType.PLATFORM, Platform.ANDROID) .setCap(MobileCapabilityType.DEVICE_NAME, "ZY22398GL7") .setCap(MobileCapabilityType.PLATFORM_VERSION, "6.0.1") .setCap(MobileCapabilityType.NEW_COMMAND_TIMEOUT, 60) .setCap(MobileCapabilityType.FULL_RESET, false) .setCap(AndroidMobileCapabilityType.ANDROID_DEVICE_READY_TIMEOUT, 60) .setCap(AndroidMobileCapabilityType.ENABLE_PERFORMANCE_LOGGING, true); $appium().init().getAndroidDriver(); $selenium().goTo("https://bbc.co.uk"); $selenium().find().elementBy(By.id("idcta-link")); $appium().android().orientation().rotate(ScreenOrientation.LANDSCAPE); } }
Java
/* * Copyright 2006-2016 Edward Smith * * 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 root.json; import root.lang.StringExtractor; /** * * @author Edward Smith * @version 0.5 * @since 0.5 */ final class JSONBoolean extends JSONValue { // <><><><><><><><><><><><><>< Class Attributes ><><><><><><><><><><><><><> private final boolean value; // <><><><><><><><><><><><><><>< Constructors ><><><><><><><><><><><><><><> JSONBoolean(final boolean value) { this.value = value; } // <><><><><><><><><><><><><><> Public Methods <><><><><><><><><><><><><><> @Override public final void extract(final StringExtractor chars) { chars.append(this.value); } } // End JSONBoolean
Java
<html> <head> <link rel="stylesheet" type="text/css" href="style.css"> </head> <body> <span class='rank7 7.131076592273528'>?0</span> <span class='rank0 0.0'>1</span> <span class='rank3 2.8337620491379862'>lem</span> </br> <span class='rank0 0.0'>^</span> <span class='rank0 0.0'>w</span> <span class='rank0 0.0'>w</span> <span class='rank10 9.615983242061528'>Pf</span> <span class='rank5 5.380675333968457'>The</span> <span class='rank6 5.910214491268059'>New</span> <span class='rank5 5.027215308896533'>York</span> <span class='rank4 4.050174224831018'>copyright</span> <span class='rank2 1.7822710117187128'>reserved</span> <span class='rank3 2.5421264334187086'>Botanical</span> <span class='rank3 3.451197890939337'>Garden</span> </br> <span class='rank-13 -13.080231701061997'>Stewardson</span> <span class='rank3 2.873252492389657'>Brown</span> <span class='rank8 7.536541700381693'>N.</span> <span class='rank6 5.703960236633383'>L.</span> <span class='rank-2 -1.981923936421886'>Britton</span> </br> <span class='rank9 9.328301169609748'>E,</span> <span class='rank7 6.5714608043381055'>J.</span> <span class='rank-1 -1.1691379729473965'>WORTLEY</span> </br> <span class='rank0 0.2299845632248747'>COLLECTORS</span> </br> <span class='rank1 0.9568358528021363'>SEPT.,</span> <span class='rank3 2.9384859171035345'>1913</span> </br> <span class='rank5 5.23758013687111'>NEW</span> <span class='rank5 5.092407184714711'>YORK</span> <span class='rank4 4.3452095742978045'>BOTANICAL</span> <span class='rank5 4.836230413135688'>GARDEN</span> <span class='rank-2 -2.1799152267468287'>ACADEMY</span> <span class='rank6 6.171300748459634'>OF</span> <span class='rank-4 -4.137144714540511'>NATURAL</span> <span class='rank-4 -4.02435559334085'>SCIENCES</span> <span class='rank6 6.171300748459634'>OF</span> <span class='rank-7 -7.111065859143594'>PHILADELPHIA</span> <span class='rank2 2.4609470333207497'>BERMUDA</span> <span class='rank-14 -14.452837080563157'>DEPARTMENT</span> <span class='rank6 6.171300748459634'>OF</span> <span class='rank-13 -13.257555169685276'>AGRICULTURE</span> <span class='rank0 -0.025107939329515716'>EXPLORATION</span> <span class='rank6 6.171300748459634'>OF</span> <span class='rank2 2.4609470333207497'>BERMUDA</span> </br> <span class='rank0 0.0'>/</span> <span class='rank0 0.0'>V'r/?</span> </br> <span class='rank7 7.113163754051207'>NO.</span> <span class='rank0 0.0'>Ô</span> </br> <span class='rank42 42.26324703259235'>01530253</span> </br> </br></br> <strong>Legend - </strong> Level of confidence that token is an accurately-transcribed word</br> <span class='rank-13'>&nbsp;&nbsp;&nbsp;</span> extremely low <span class='rank-7'>&nbsp;&nbsp;&nbsp;</span> very low <span class='rank-1'>&nbsp;&nbsp;&nbsp;</span> low <span class='rank0'>&nbsp;&nbsp;&nbsp;</span> undetermined <span class='rank1'>&nbsp;&nbsp;&nbsp;</span> medium <span class='rank6'>&nbsp;&nbsp;&nbsp;</span> high <span class='rank16'>&nbsp;&nbsp;&nbsp;</span> very high</br> </body> </html>
Java
// // SendMessageRequest.h // ProximitySenseSDK // // Created by Vladimir Petrov on 31/08/2015. // Copyright (c) 2015 Blue Sense Networks. All rights reserved. // #import <Foundation/Foundation.h> @interface SendMessageRequest : NSObject @property (nonatomic, strong) NSString *message; @end
Java
Payments can be reversed for many reasons and many weeks after being received. When you reverse a payment, a window pops up to ask why. <figure> <img src="i/help/PaymentReversed.png" alt="PaymentReversed" width="700px"> <figcaption>Payment Reversed.</figcaption> </figure> Choose one of the following from the drop-down box. <figure> <img src="i/help/PaymentReverseReasonsValues.png" alt="PaymentReverseReasonsValues" width="700px"> <figcaption>Payment Reverse Reasons Values.</figcaption> </figure> <ul> <li>Applied to Wrong Account</li> <li> Bank Account Closed</li> <li>Data Entry Error</li> <li>No Acct/Cannot Locate</li> <li> Non-Sufficient Funds</li> <li>Account Details Page</li> <li>Stop Payment</li> </ul> Clicking the "Reverse" button will open a Microsoft Word document which is a letter to the claimant explaining why his payment was reversed and to expect a new invoice with a higher balance. <h2>Cancel</h2> Adjustments can be canceled for many reasons and many weeks after being entered. When you cancel a payment, a window pops up to ask why. Its drop-down box offers the same reasons as the reversals. <figure> <img src="i/help/PaymentCancel.png" alt="PaymentCancel" width="700px"> <figcaption>Payment Cancel.</figcaption> </figure> <figure> <img src="i/help/PaymentCancelledReasonsValues.png" alt="PaymentCancelledReasonsValues" width="700px"> <figcaption>Payment Cancel Reasons Values.</figcaption> </figure>
Java
package uk.co.listpoint.context; import javax.xml.bind.annotation.XmlEnum; import javax.xml.bind.annotation.XmlEnumValue; import javax.xml.bind.annotation.XmlType; /** * <p>Java class for Context6Type. * * <p>The following schema fragment specifies the expected content contained within this class. * <p> * <pre> * &lt;simpleType name="Context6Type"> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}string"> * &lt;enumeration value="Data Standard"/> * &lt;enumeration value="Application"/> * &lt;/restriction> * &lt;/simpleType> * </pre> * */ @XmlType(name = "Context6Type", namespace = "http://www.listpoint.co.uk/schemas/v6") @XmlEnum public enum Context6Type { @XmlEnumValue("Data Standard") DATA_STANDARD("Data Standard"), @XmlEnumValue("Application") APPLICATION("Application"); private final String value; Context6Type(String v) { value = v; } public String value() { return value; } public static Context6Type fromValue(String v) { for (Context6Type c: Context6Type.values()) { if (c.value.equals(v)) { return c; } } throw new IllegalArgumentException(v); } }
Java
/* Copyright 2017 The TensorFlow Authors. All Rights Reserved. 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. ==============================================================================*/ #ifndef TENSORFLOW_COMPILER_XLA_ARRAY3D_H_ #define TENSORFLOW_COMPILER_XLA_ARRAY3D_H_ #include <algorithm> #include <functional> #include <initializer_list> #include <iterator> #include <memory> #include <numeric> #include <random> #include "tensorflow/compiler/xla/array.h" #include "tensorflow/compiler/xla/types.h" #include "tensorflow/core/platform/logging.h" #include "tensorflow/core/platform/macros.h" #include "tensorflow/core/platform/types.h" namespace xla { // Simple 3D array structure. template <typename T> class Array3D : public Array<T> { public: Array3D() : Array<T>(std::vector<int64_t>{0, 0, 0}) {} // Creates an array of dimensions n1 x n2 x n3, uninitialized values. Array3D(const int64_t n1, const int64_t n2, const int64_t n3) : Array<T>(std::vector<int64_t>{n1, n2, n3}) {} // Creates an array of dimensions n1 x n2 x n3, initialized to value. Array3D(const int64_t n1, const int64_t n2, const int64_t n3, const T value) : Array<T>(std::vector<int64_t>{n1, n2, n3}, value) {} // Creates an array from the given nested initializer list. The outer // initializer list is the first dimension, and so on. // // For example {{{1, 2}, {3, 4}, {5, 6}, {7, 8}}, // {{9, 10}, {11, 12}, {13, 14}, {15, 16}}, // {{17, 18}, {19, 20}, {21, 22}, {23, 24}}} // results in an array with n1=3, n2=4, n3=2. Array3D(std::initializer_list<std::initializer_list<std::initializer_list<T>>> values) : Array<T>(values) {} // Creates an array of a floating-point type (half, bfloat16, float, // or double) from the given nested initializer list of float values. template <typename T2, typename = typename std::enable_if< (std::is_same<T, Eigen::half>::value || std::is_same<T, bfloat16>::value || std::is_same<T, float>::value || std::is_same<T, double>::value) && std::is_same<T2, float>::value>::type> Array3D( std::initializer_list<std::initializer_list<std::initializer_list<T2>>> values) : Array<T>(values) {} int64_t n1() const { return this->dim(0); } int64_t n2() const { return this->dim(1); } int64_t n3() const { return this->dim(2); } }; } // namespace xla #endif // TENSORFLOW_COMPILER_XLA_ARRAY3D_H_
Java
package com.example.customviewdemo; import android.app.Activity; import android.os.Bundle; import android.view.Menu; import android.view.MenuItem; public class DragViewActivity extends Activity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_drag_view); } }
Java
package com.gentics.mesh.core.schema.field; import static com.gentics.mesh.assertj.MeshAssertions.assertThat; import static com.gentics.mesh.core.field.FieldSchemaCreator.CREATEBINARY; import static com.gentics.mesh.core.field.FieldSchemaCreator.CREATEBOOLEAN; import static com.gentics.mesh.core.field.FieldSchemaCreator.CREATEBOOLEANLIST; import static com.gentics.mesh.core.field.FieldSchemaCreator.CREATEDATE; import static com.gentics.mesh.core.field.FieldSchemaCreator.CREATEDATELIST; import static com.gentics.mesh.core.field.FieldSchemaCreator.CREATEHTML; import static com.gentics.mesh.core.field.FieldSchemaCreator.CREATEHTMLLIST; import static com.gentics.mesh.core.field.FieldSchemaCreator.CREATEMICRONODE; import static com.gentics.mesh.core.field.FieldSchemaCreator.CREATEMICRONODELIST; import static com.gentics.mesh.core.field.FieldSchemaCreator.CREATENODE; import static com.gentics.mesh.core.field.FieldSchemaCreator.CREATENODELIST; import static com.gentics.mesh.core.field.FieldSchemaCreator.CREATENUMBER; import static com.gentics.mesh.core.field.FieldSchemaCreator.CREATENUMBERLIST; import static com.gentics.mesh.core.field.FieldSchemaCreator.CREATESTRING; import static com.gentics.mesh.core.field.FieldSchemaCreator.CREATESTRINGLIST; import static com.gentics.mesh.core.field.FieldTestHelper.NOOP; import static com.gentics.mesh.test.ElasticsearchTestMode.TRACKING; import static com.gentics.mesh.test.TestSize.FULL; import static org.assertj.core.api.Assertions.assertThat; import static org.junit.Assert.assertEquals; import java.util.concurrent.ExecutionException; import java.util.concurrent.TimeoutException; import org.junit.Test; import com.gentics.mesh.FieldUtil; import com.gentics.mesh.core.data.node.field.HibHtmlField; import com.gentics.mesh.core.field.html.HtmlFieldTestHelper; import com.gentics.mesh.test.MeshTestSetting; import com.gentics.mesh.util.IndexOptionHelper; @MeshTestSetting(elasticsearch = TRACKING, testSize = FULL, startServer = false) public class HtmlFieldMigrationTest extends AbstractFieldMigrationTest implements HtmlFieldTestHelper { @Test @Override public void testRemove() throws Exception { removeField(CREATEHTML, FILLTEXT, FETCH); } @Test @Override public void testChangeToBinary() throws Exception { changeType(CREATEHTML, FILLTEXT, FETCH, CREATEBINARY, (container, name) -> { assertThat(container.getBinary(name)).as(NEWFIELD).isNull(); }); } @Test @Override public void testEmptyChangeToBinary() throws Exception { changeType(CREATEHTML, NOOP, FETCH, CREATEBINARY, (container, name) -> { assertThat(container.getBinary(name)).as(NEWFIELD).isNull(); }); } @Test @Override public void testChangeToBoolean() throws Exception { changeType(CREATEHTML, FILLTRUE, FETCH, CREATEBOOLEAN, (container, name) -> { assertThat(container.getBoolean(name)).as(NEWFIELD).isNotNull(); assertThat(container.getBoolean(name).getBoolean()).as(NEWFIELDVALUE).isEqualTo(true); }); changeType(CREATEHTML, FILLFALSE, FETCH, CREATEBOOLEAN, (container, name) -> { assertThat(container.getBoolean(name)).as(NEWFIELD).isNotNull(); assertThat(container.getBoolean(name).getBoolean()).as(NEWFIELDVALUE).isEqualTo(false); }); changeType(CREATEHTML, FILL1, FETCH, CREATEBOOLEAN, (container, name) -> { assertThat(container.getBoolean(name)).as(NEWFIELD).isNotNull(); assertThat(container.getBoolean(name).getBoolean()).as(NEWFIELDVALUE).isEqualTo(true); }); changeType(CREATEHTML, FILL0, FETCH, CREATEBOOLEAN, (container, name) -> { assertThat(container.getBoolean(name)).as(NEWFIELD).isNotNull(); assertThat(container.getBoolean(name).getBoolean()).as(NEWFIELDVALUE).isEqualTo(false); }); changeType(CREATEHTML, FILLTEXT, FETCH, CREATEBOOLEAN, (container, name) -> { assertThat(container.getBoolean(name)).as(NEWFIELD).isNull(); }); } @Test @Override public void testEmptyChangeToBoolean() throws Exception { changeType(CREATEHTML, NOOP, FETCH, CREATEBOOLEAN, (container, name) -> { assertThat(container.getBoolean(name)).as(NEWFIELD).isNull(); }); } @Test @Override public void testChangeToBooleanList() throws Exception { changeType(CREATEHTML, FILLTRUE, FETCH, CREATEBOOLEANLIST, (container, name) -> { assertThat(container.getBooleanList(name)).as(NEWFIELD).isNotNull(); assertThat(container.getBooleanList(name).getValues()).as(NEWFIELDVALUE).containsExactly(true); }); changeType(CREATEHTML, FILLFALSE, FETCH, CREATEBOOLEANLIST, (container, name) -> { assertThat(container.getBooleanList(name)).as(NEWFIELD).isNotNull(); assertThat(container.getBooleanList(name).getValues()).as(NEWFIELDVALUE).containsExactly(false); }); changeType(CREATEHTML, FILL1, FETCH, CREATEBOOLEANLIST, (container, name) -> { assertThat(container.getBooleanList(name)).as(NEWFIELD).isNotNull(); assertThat(container.getBooleanList(name).getValues()).as(NEWFIELDVALUE).containsExactly(true); }); changeType(CREATEHTML, FILL0, FETCH, CREATEBOOLEANLIST, (container, name) -> { assertThat(container.getBooleanList(name)).as(NEWFIELD).isNotNull(); assertThat(container.getBooleanList(name).getValues()).as(NEWFIELDVALUE).containsExactly(false); }); changeType(CREATEHTML, FILLTEXT, FETCH, CREATEBOOLEANLIST, (container, name) -> { assertThat(container.getBooleanList(name)).as(NEWFIELD).isNull(); }); } @Test @Override public void testEmptyChangeToBooleanList() throws Exception { changeType(CREATEHTML, NOOP, FETCH, CREATEBOOLEANLIST, (container, name) -> { assertThat(container.getBooleanList(name)).as(NEWFIELD).isNull(); }); } @Test @Override public void testChangeToDate() throws Exception { changeType(CREATEHTML, FILL0, FETCH, CREATEDATE, (container, name) -> { assertThat(container.getDate(name)).as(NEWFIELD).isNotNull(); assertThat(container.getDate(name).getDate()).as(NEWFIELDVALUE).isEqualTo(0L); }); changeType(CREATEHTML, FILL1, FETCH, CREATEDATE, (container, name) -> { assertThat(container.getDate(name)).as(NEWFIELD).isNotNull(); // Internally timestamps are stored in miliseconds assertThat(container.getDate(name).getDate()).as(NEWFIELDVALUE).isEqualTo(1000L); }); changeType(CREATEHTML, FILLTEXT, FETCH, CREATEDATE, (container, name) -> { assertThat(container.getDate(name)).as(NEWFIELD).isNull(); }); } @Test @Override public void testEmptyChangeToDate() throws Exception { changeType(CREATEHTML, NOOP, FETCH, CREATEDATE, (container, name) -> { assertThat(container.getDate(name)).as(NEWFIELD).isNull(); }); } @Test @Override public void testChangeToDateList() throws Exception { changeType(CREATEHTML, FILL0, FETCH, CREATEDATELIST, (container, name) -> { assertThat(container.getDateList(name)).as(NEWFIELD).isNotNull(); assertThat(container.getDateList(name).getValues()).as(NEWFIELDVALUE).containsExactly(0L); }); changeType(CREATEHTML, FILL1, FETCH, CREATEDATELIST, (container, name) -> { assertThat(container.getDateList(name)).as(NEWFIELD).isNotNull(); // Internally timestamps are stored in miliseconds assertThat(container.getDateList(name).getValues()).as(NEWFIELDVALUE).containsExactly(1000L); }); changeType(CREATEHTML, FILLTEXT, FETCH, CREATEDATELIST, (container, name) -> { assertThat(container.getDateList(name)).as(NEWFIELD).isNull(); }); } @Test @Override public void testEmptyChangeToDateList() throws Exception { changeType(CREATEHTML, NOOP, FETCH, CREATEDATELIST, (container, name) -> { assertThat(container.getDateList(name)).as(NEWFIELD).isNull(); }); } @Test @Override public void testChangeToHtml() throws Exception { changeType(CREATEHTML, FILLTEXT, FETCH, CREATEHTML, (container, name) -> { assertThat(container.getHtml(name)).as(NEWFIELD).isNotNull(); assertThat(container.getHtml(name).getHTML()).as(NEWFIELDVALUE).isEqualTo("<b>HTML</b> content"); }); } @Test @Override public void testEmptyChangeToHtml() throws Exception { changeType(CREATEHTML, NOOP, FETCH, CREATEHTML, (container, name) -> { assertThat(container.getHtml(name)).as(NEWFIELD).isNull(); }); } @Test @Override public void testChangeToHtmlList() throws Exception { changeType(CREATEHTML, FILLTEXT, FETCH, CREATEHTMLLIST, (container, name) -> { assertThat(container.getHTMLList(name)).as(NEWFIELD).isNotNull(); assertThat(container.getHTMLList(name).getValues()).as(NEWFIELDVALUE).containsExactly("<b>HTML</b> content"); }); } @Test @Override public void testEmptyChangeToHtmlList() throws Exception { changeType(CREATEHTML, NOOP, FETCH, CREATEHTMLLIST, (container, name) -> { assertThat(container.getHTMLList(name)).as(NEWFIELD).isNull(); }); } @Test @Override public void testChangeToMicronode() throws Exception { changeType(CREATEHTML, FILLTEXT, FETCH, CREATEMICRONODE, (container, name) -> { assertThat(container.getMicronode(name)).as(NEWFIELD).isNull(); }); } @Test @Override public void testEmptyChangeToMicronode() throws Exception { changeType(CREATEHTML, NOOP, FETCH, CREATEMICRONODE, (container, name) -> { assertThat(container.getMicronode(name)).as(NEWFIELD).isNull(); }); } @Test @Override public void testChangeToMicronodeList() throws Exception { changeType(CREATEHTML, FILLTEXT, FETCH, CREATEMICRONODELIST, (container, name) -> { assertThat(container.getMicronodeList(name)).as(NEWFIELD).isNull(); }); } @Test @Override public void testEmptyChangeToMicronodeList() throws Exception { changeType(CREATEHTML, NOOP, FETCH, CREATEMICRONODELIST, (container, name) -> { assertThat(container.getMicronodeList(name)).as(NEWFIELD).isNull(); }); } @Test @Override public void testChangeToNode() throws Exception { changeType(CREATEHTML, FILLTEXT, FETCH, CREATENODE, (container, name) -> { assertThat(container.getNode(name)).as(NEWFIELD).isNull(); }); } @Test @Override public void testEmptyChangeToNode() throws Exception { changeType(CREATEHTML, NOOP, FETCH, CREATENODE, (container, name) -> { assertThat(container.getNode(name)).as(NEWFIELD).isNull(); }); } @Test @Override public void testChangeToNodeList() throws Exception { changeType(CREATEHTML, FILLTEXT, FETCH, CREATENODELIST, (container, name) -> { assertThat(container.getNodeList(name)).as(NEWFIELD).isNull(); }); } @Test @Override public void testEmptyChangeToNodeList() throws Exception { changeType(CREATEHTML, NOOP, FETCH, CREATENODELIST, (container, name) -> { assertThat(container.getNodeList(name)).as(NEWFIELD).isNull(); }); } @Test @Override public void testChangeToNumber() throws Exception { changeType(CREATEHTML, FILL0, FETCH, CREATENUMBER, (container, name) -> { assertThat(container.getNumber(name)).as(NEWFIELD).isNotNull(); assertThat(container.getNumber(name).getNumber().longValue()).as(NEWFIELDVALUE).isEqualTo(0L); }); changeType(CREATEHTML, FILL1, FETCH, CREATENUMBER, (container, name) -> { assertThat(container.getNumber(name)).as(NEWFIELD).isNotNull(); assertThat(container.getNumber(name).getNumber().longValue()).as(NEWFIELDVALUE).isEqualTo(1L); }); changeType(CREATEHTML, FILLTEXT, FETCH, CREATENUMBER, (container, name) -> { assertThat(container.getNumber(name)).as(NEWFIELD).isNull(); }); } @Test @Override public void testEmptyChangeToNumber() throws Exception { changeType(CREATEHTML, NOOP, FETCH, CREATENUMBER, (container, name) -> { assertThat(container.getNumber(name)).as(NEWFIELD).isNull(); }); } @Test @Override public void testChangeToNumberList() throws Exception { changeType(CREATEHTML, FILL0, FETCH, CREATENUMBERLIST, (container, name) -> { assertThat(container.getNumberList(name)).as(NEWFIELD).isNotNull(); assertThat(container.getNumberList(name).getValues()).as(NEWFIELDVALUE).containsExactly(0L); }); changeType(CREATEHTML, FILL1, FETCH, CREATENUMBERLIST, (container, name) -> { assertThat(container.getNumberList(name)).as(NEWFIELD).isNotNull(); assertThat(container.getNumberList(name).getValues()).as(NEWFIELDVALUE).containsExactly(1L); }); changeType(CREATEHTML, FILLTEXT, FETCH, CREATENUMBERLIST, (container, name) -> { assertThat(container.getNumberList(name)).as(NEWFIELD).isNull(); }); } @Test @Override public void testEmptyChangeToNumberList() throws Exception { changeType(CREATEHTML, NOOP, FETCH, CREATENUMBERLIST, (container, name) -> { assertThat(container.getNumberList(name)).as(NEWFIELD).isNull(); }); } @Test @Override public void testChangeToString() throws Exception { changeType(CREATEHTML, FILLTEXT, FETCH, CREATESTRING, (container, name) -> { assertThat(container.getString(name)).as(NEWFIELD).isNotNull(); assertThat(container.getString(name).getString()).as(NEWFIELDVALUE).isEqualTo("<b>HTML</b> content"); }); } @Test @Override public void testEmptyChangeToString() throws Exception { changeType(CREATEHTML, NOOP, FETCH, CREATESTRING, (container, name) -> { assertThat(container.getString(name)).as(NEWFIELD).isNull(); }); } @Test @Override public void testChangeToStringList() throws Exception { changeType(CREATEHTML, FILLTEXT, FETCH, CREATESTRINGLIST, (container, name) -> { assertThat(container.getStringList(name)).as(NEWFIELD).isNotNull(); assertThat(container.getStringList(name).getValues()).as(NEWFIELDVALUE).containsExactly("<b>HTML</b> content"); }); } @Test @Override public void testEmptyChangeToStringList() throws Exception { changeType(CREATEHTML, NOOP, FETCH, CREATESTRINGLIST, (container, name) -> { assertThat(container.getStringList(name)).as(NEWFIELD).isNull(); }); } @Test public void testIndexOptionAddRaw() throws InterruptedException, ExecutionException, TimeoutException { changeType(CREATEHTML, FILLLONGTEXT, FETCH, name -> FieldUtil.createHtmlFieldSchema(name).setElasticsearch(IndexOptionHelper.getRawFieldOption()), (container, name) -> { HibHtmlField htmlField = container.getHtml(name); assertEquals("The html field should not be truncated.", 40_000, htmlField.getHTML().length()); waitForSearchIdleEvent(); assertThat(trackingSearchProvider()).recordedStoreEvents(1); }); } }
Java
// Copyright 2015,2016,2017,2018,2019,2020 Commonwealth Bank of Australia // // 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 commbank.grimlock.test import commbank.grimlock.framework._ import commbank.grimlock.framework.content._ import commbank.grimlock.framework.encoding._ import commbank.grimlock.framework.environment.implicits._ import commbank.grimlock.framework.environment.tuner._ import commbank.grimlock.framework.metadata._ import commbank.grimlock.framework.position._ import shapeless.nat.{ _0, _1, _2 } trait TestMatrixGather extends TestMatrix { val result1 = data1.map { case c => c.position -> c.content }.toMap val result2 = Map( Position("foo") -> Map( Position(1) -> Content(OrdinalSchema[String](), "3.14"), Position(2) -> Content(ContinuousSchema[Double](), 6.28), Position(3) -> Content(NominalSchema[String](), "9.42"), Position(4) -> Content( DateSchema[java.util.Date](), DateValue((new java.text.SimpleDateFormat("yyyy-MM-dd hh:mm:ss")).parse("2000-01-01 12:56:00")) ) ), Position("bar") -> Map( Position(1) -> Content(OrdinalSchema[String](), "6.28"), Position(2) -> Content(ContinuousSchema[Double](), 12.56), Position(3) -> Content(OrdinalSchema[Long](), 19L) ), Position("baz") -> Map( Position(1) -> Content(OrdinalSchema[String](), "9.42"), Position(2) -> Content(DiscreteSchema[Long](), 19L) ), Position("qux") -> Map(Position(1) -> Content(OrdinalSchema[String](), "12.56")) ) val result3 = Map( Position(1) -> Map( Position("foo") -> Content(OrdinalSchema[String](), "3.14"), Position("bar") -> Content(OrdinalSchema[String](), "6.28"), Position("baz") -> Content(OrdinalSchema[String](), "9.42"), Position("qux") -> Content(OrdinalSchema[String](), "12.56") ), Position(2) -> Map( Position("foo") -> Content(ContinuousSchema[Double](), 6.28), Position("bar") -> Content(ContinuousSchema[Double](), 12.56), Position("baz") -> Content(DiscreteSchema[Long](), 19L) ), Position(3) -> Map( Position("foo") -> Content(NominalSchema[String](), "9.42"), Position("bar") -> Content(OrdinalSchema[Long](), 19L) ), Position(4) -> Map( Position("foo") -> Content( DateSchema[java.util.Date](), DateValue((new java.text.SimpleDateFormat("yyyy-MM-dd hh:mm:ss")).parse("2000-01-01 12:56:00")) ) ) ) val result4 = Map( Position(1) -> Map( Position("foo") -> Content(OrdinalSchema[String](), "3.14"), Position("bar") -> Content(OrdinalSchema[String](), "6.28"), Position("baz") -> Content(OrdinalSchema[String](), "9.42"), Position("qux") -> Content(OrdinalSchema[String](), "12.56") ), Position(2) -> Map( Position("foo") -> Content(ContinuousSchema[Double](), 6.28), Position("bar") -> Content(ContinuousSchema[Double](), 12.56), Position("baz") -> Content(DiscreteSchema[Long](), 19L) ), Position(3) -> Map( Position("foo") -> Content(NominalSchema[String](), "9.42"), Position("bar") -> Content(OrdinalSchema[Long](), 19L) ), Position(4) -> Map( Position("foo") -> Content( DateSchema[java.util.Date](), DateValue((new java.text.SimpleDateFormat("yyyy-MM-dd hh:mm:ss")).parse("2000-01-01 12:56:00")) ) ) ) val result5 = Map( Position("foo") -> Map( Position(1) -> Content(OrdinalSchema[String](), "3.14"), Position(2) -> Content(ContinuousSchema[Double](), 6.28), Position(3) -> Content(NominalSchema[String](), "9.42"), Position(4) -> Content( DateSchema[java.util.Date](), DateValue((new java.text.SimpleDateFormat("yyyy-MM-dd hh:mm:ss")).parse("2000-01-01 12:56:00")) ) ), Position("bar") -> Map( Position(1) -> Content(OrdinalSchema[String](), "6.28"), Position(2) -> Content(ContinuousSchema[Double](), 12.56), Position(3) -> Content(OrdinalSchema[Long](), 19L) ), Position("baz") -> Map( Position(1) -> Content(OrdinalSchema[String](), "9.42"), Position(2) -> Content(DiscreteSchema[Long](), 19L) ), Position("qux") -> Map(Position(1) -> Content(OrdinalSchema[String](), "12.56")) ) val result6 = Map( Position("foo") -> Map( Position(1, "xyz") -> Content(OrdinalSchema[String](), "3.14"), Position(2, "xyz") -> Content(ContinuousSchema[Double](), 6.28), Position(3, "xyz") -> Content(NominalSchema[String](), "9.42"), Position(4, "xyz") -> Content( DateSchema[java.util.Date](), DateValue((new java.text.SimpleDateFormat("yyyy-MM-dd hh:mm:ss")).parse("2000-01-01 12:56:00")) ) ), Position("bar") -> Map( Position(1, "xyz") -> Content(OrdinalSchema[String](), "6.28"), Position(2, "xyz") -> Content(ContinuousSchema[Double](), 12.56), Position(3, "xyz") -> Content(OrdinalSchema[Long](), 19L) ), Position("baz") -> Map( Position(1, "xyz") -> Content(OrdinalSchema[String](), "9.42"), Position(2, "xyz") -> Content(DiscreteSchema[Long](), 19L) ), Position("qux") -> Map(Position(1, "xyz") -> Content(OrdinalSchema[String](), "12.56")) ) val result7 = Map( Position(1, "xyz") -> Map( Position("foo") -> Content(OrdinalSchema[String](), "3.14"), Position("bar") -> Content(OrdinalSchema[String](), "6.28"), Position("baz") -> Content(OrdinalSchema[String](), "9.42"), Position("qux") -> Content(OrdinalSchema[String](), "12.56") ), Position(2, "xyz") -> Map( Position("foo") -> Content(ContinuousSchema[Double](), 6.28), Position("bar") -> Content(ContinuousSchema[Double](), 12.56), Position("baz") -> Content(DiscreteSchema[Long](), 19L) ), Position(3, "xyz") -> Map( Position("foo") -> Content(NominalSchema[String](), "9.42"), Position("bar") -> Content(OrdinalSchema[Long](), 19L) ), Position(4, "xyz") -> Map( Position("foo") -> Content( DateSchema[java.util.Date](), DateValue((new java.text.SimpleDateFormat("yyyy-MM-dd hh:mm:ss")).parse("2000-01-01 12:56:00")) ) ) ) val result8 = Map( Position(1) -> Map( Position("foo", "xyz") -> Content(OrdinalSchema[String](), "3.14"), Position("bar", "xyz") -> Content(OrdinalSchema[String](), "6.28"), Position("baz", "xyz") -> Content(OrdinalSchema[String](), "9.42"), Position("qux", "xyz") -> Content(OrdinalSchema[String](), "12.56") ), Position(2) -> Map( Position("foo", "xyz") -> Content(ContinuousSchema[Double](), 6.28), Position("bar", "xyz") -> Content(ContinuousSchema[Double](), 12.56), Position("baz", "xyz") -> Content(DiscreteSchema[Long](), 19L) ), Position(3) -> Map( Position("foo", "xyz") -> Content(NominalSchema[String](), "9.42"), Position("bar", "xyz") -> Content(OrdinalSchema[Long](), 19L) ), Position(4) -> Map( Position("foo", "xyz") -> Content( DateSchema[java.util.Date](), DateValue((new java.text.SimpleDateFormat("yyyy-MM-dd hh:mm:ss")).parse("2000-01-01 12:56:00")) ) ) ) val result9 = Map( Position("foo", "xyz") -> Map( Position(1) -> Content(OrdinalSchema[String](), "3.14"), Position(2) -> Content(ContinuousSchema[Double](), 6.28), Position(3) -> Content(NominalSchema[String](), "9.42"), Position(4) -> Content( DateSchema[java.util.Date](), DateValue((new java.text.SimpleDateFormat("yyyy-MM-dd hh:mm:ss")).parse("2000-01-01 12:56:00")) ) ), Position("bar", "xyz") -> Map( Position(1) -> Content(OrdinalSchema[String](), "6.28"), Position(2) -> Content(ContinuousSchema[Double](), 12.56), Position(3) -> Content(OrdinalSchema[Long](), 19L) ), Position("baz", "xyz") -> Map( Position(1) -> Content(OrdinalSchema[String](), "9.42"), Position(2) -> Content(DiscreteSchema[Long](), 19L) ), Position("qux", "xyz") -> Map(Position(1) -> Content(OrdinalSchema[String](), "12.56")) ) val result10 = Map( Position("xyz") -> Map( Position("foo", 1) -> Content(OrdinalSchema[String](), "3.14"), Position("bar", 1) -> Content(OrdinalSchema[String](), "6.28"), Position("baz", 1) -> Content(OrdinalSchema[String](), "9.42"), Position("qux", 1) -> Content(OrdinalSchema[String](), "12.56"), Position("foo", 2) -> Content(ContinuousSchema[Double](), 6.28), Position("bar", 2) -> Content(ContinuousSchema[Double](), 12.56), Position("baz", 2) -> Content(DiscreteSchema[Long](), 19L), Position("foo", 3) -> Content(NominalSchema[String](), "9.42"), Position("bar", 3) -> Content(OrdinalSchema[Long](), 19L), Position("foo", 4) -> Content( DateSchema[java.util.Date](), DateValue((new java.text.SimpleDateFormat("yyyy-MM-dd hh:mm:ss")).parse("2000-01-01 12:56:00")) ) ) ) val result11 = Map( Position("foo", 1) -> Map(Position("xyz") -> Content(OrdinalSchema[String](), "3.14")), Position("foo", 2) -> Map(Position("xyz") -> Content(ContinuousSchema[Double](), 6.28)), Position("foo", 3) -> Map(Position("xyz") -> Content(NominalSchema[String](), "9.42")), Position("foo", 4) -> Map( Position("xyz") -> Content( DateSchema[java.util.Date](), DateValue((new java.text.SimpleDateFormat("yyyy-MM-dd hh:mm:ss")).parse("2000-01-01 12:56:00")) ) ), Position("bar", 1) -> Map(Position("xyz") -> Content(OrdinalSchema[String](), "6.28")), Position("bar", 2) -> Map(Position("xyz") -> Content(ContinuousSchema[Double](), 12.56)), Position("bar", 3) -> Map(Position("xyz") -> Content(OrdinalSchema[Long](), 19L)), Position("baz", 1) -> Map(Position("xyz") -> Content(OrdinalSchema[String](), "9.42")), Position("baz", 2) -> Map(Position("xyz") -> Content(DiscreteSchema[Long](), 19L)), Position("qux", 1) -> Map(Position("xyz") -> Content(OrdinalSchema[String](), "12.56")) ) } class TestScalaMatrixGather extends TestMatrixGather with TestScala { import commbank.grimlock.scala.environment.implicits._ "A Matrix.gather" should "return its first over map in 1D" in { toU(data1) .gatherByPosition(Over(_0), Default()) shouldBe result1 } it should "return its first over map in 2D" in { toU(data2) .gatherByPosition(Over(_0), Default()) shouldBe result2 } it should "return its first along map in 2D" in { toU(data2) .gatherByPosition(Along(_0), Default()) shouldBe result3 } it should "return its second over map in 2D" in { toU(data2) .gatherByPosition(Over(_1), Default()) shouldBe result4 } it should "return its second along map in 2D" in { toU(data2) .gatherByPosition(Along(_1), Default()) shouldBe result5 } it should "return its first over map in 3D" in { toU(data3) .gatherByPosition(Over(_0), Default()) shouldBe result6 } it should "return its first along map in 3D" in { toU(data3) .gatherByPosition(Along(_0), Default()) shouldBe result7 } it should "return its second over map in 3D" in { toU(data3) .gatherByPosition(Over(_1), Default()) shouldBe result8 } it should "return its second along map in 3D" in { toU(data3) .gatherByPosition(Along(_1), Default()) shouldBe result9 } it should "return its third over map in 3D" in { toU(data3) .gatherByPosition(Over(_2), Default()) shouldBe result10 } it should "return its third along map in 3D" in { toU(data3) .gatherByPosition(Along(_2), Default()) shouldBe result11 } it should "return its empty map" in { toU(List[Cell[P3]]()) .gatherByPosition(Along(_2), Default()) shouldBe Map() } it should "return its compacted 1D" in { toU(data1) .gather() shouldBe result1 } it should "return its empty compacted" in { toU(List[Cell[P2]]()) .gather() shouldBe Map() } } class TestScaldingMatrixGather extends TestMatrixGather with TestScalding { import commbank.grimlock.scalding.environment.implicits._ "A Matrix.gather" should "return its first over map in 1D" in { toU(data1) .gatherByPosition(Over(_0), Default()).toTypedPipe .toList shouldBe List(result1) } it should "return its first over map in 2D" in { toU(data2) .gatherByPosition(Over(_0), Default(12)).toTypedPipe .toList shouldBe List(result2) } it should "return its first along map in 2D" in { toU(data2) .gatherByPosition(Along(_0), Default()).toTypedPipe .toList shouldBe List(result3) } it should "return its second over map in 2D" in { toU(data2) .gatherByPosition(Over(_1), Default(12)).toTypedPipe .toList shouldBe List(result4) } it should "return its second along map in 2D" in { toU(data2) .gatherByPosition(Along(_1), Default()).toTypedPipe .toList shouldBe List(result5) } it should "return its first over map in 3D" in { toU(data3) .gatherByPosition(Over(_0), Default(12)).toTypedPipe .toList shouldBe List(result6) } it should "return its first along map in 3D" in { toU(data3) .gatherByPosition(Along(_0), Default()).toTypedPipe .toList shouldBe List(result7) } it should "return its second over map in 3D" in { toU(data3) .gatherByPosition(Over(_1), Default(12)).toTypedPipe .toList shouldBe List(result8) } it should "return its second along map in 3D" in { toU(data3) .gatherByPosition(Along(_1), Default()).toTypedPipe .toList shouldBe List(result9) } it should "return its third over map in 3D" in { toU(data3) .gatherByPosition(Over(_2), Default(12)).toTypedPipe .toList shouldBe List(result10) } it should "return its third along map in 3D" in { toU(data3) .gatherByPosition(Along(_2), Default()).toTypedPipe .toList shouldBe List(result11) } it should "return its empty map" in { toU(List[Cell[P3]]()) .gatherByPosition(Along(_2), Default()).toTypedPipe .toList shouldBe List(Map()) } it should "return its compacted 1D" in { toU(data1) .gather().toTypedPipe .toList shouldBe List(result1) } it should "return its empty compacted" in { toU(List[Cell[P2]]()) .gather().toTypedPipe .toList shouldBe List(Map()) } } class TestSparkMatrixGather extends TestMatrixGather with TestSpark { import commbank.grimlock.spark.environment.implicits._ "A Matrix.gather" should "return its first over map in 1D" in { toU(data1) .gatherByPosition(Over(_0), Default()) shouldBe result1 } it should "return its first over map in 2D" in { toU(data2) .gatherByPosition(Over(_0), Default(12)) shouldBe result2 } it should "return its first along map in 2D" in { toU(data2) .gatherByPosition(Along(_0), Default()) shouldBe result3 } it should "return its second over map in 2D" in { toU(data2) .gatherByPosition(Over(_1), Default(12)) shouldBe result4 } it should "return its second along map in 2D" in { toU(data2) .gatherByPosition(Along(_1), Default()) shouldBe result5 } it should "return its first over map in 3D" in { toU(data3) .gatherByPosition(Over(_0), Default(12)) shouldBe result6 } it should "return its first along map in 3D" in { toU(data3) .gatherByPosition(Along(_0), Default()) shouldBe result7 } it should "return its second over map in 3D" in { toU(data3) .gatherByPosition(Over(_1), Default(12)) shouldBe result8 } it should "return its second along map in 3D" in { toU(data3) .gatherByPosition(Along(_1), Default()) shouldBe result9 } it should "return its third over map in 3D" in { toU(data3) .gatherByPosition(Over(_2), Default(12)) shouldBe result10 } it should "return its third along map in 3D" in { toU(data3) .gatherByPosition(Along(_2), Default()) shouldBe result11 } it should "return its empty map" in { toU(List[Cell[P3]]()) .gatherByPosition(Along(_2), Default()) shouldBe Map() } it should "return its compacted 1D" in { toU(data1) .gather() shouldBe result1 } it should "return its empty compacted" in { toU(List[Cell[P2]]()) .gather() shouldBe Map() } }
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 redis.common.container; import org.apache.commons.pool2.impl.GenericObjectPoolConfig; import redis.common.config.FlinkJedisClusterConfig; import redis.common.config.FlinkJedisConfigBase; import redis.common.config.FlinkJedisPoolConfig; import redis.common.config.FlinkJedisSentinelConfig; import redis.clients.jedis.JedisCluster; import redis.clients.jedis.JedisPool; import redis.clients.jedis.JedisSentinelPool; import redis.common.container.*; import redis.common.container.RedisCommandsContainer; import redis.common.container.RedisContainer; import java.util.Objects; /** * The builder for {@link redis.common.container.RedisCommandsContainer}. */ public class RedisCommandsContainerBuilder { /** * Initialize the {@link redis.common.container.RedisCommandsContainer} based on the instance type. * @param flinkJedisConfigBase configuration base * @return @throws IllegalArgumentException if jedisPoolConfig, jedisClusterConfig and jedisSentinelConfig are all null */ public static redis.common.container.RedisCommandsContainer build(FlinkJedisConfigBase flinkJedisConfigBase){ if(flinkJedisConfigBase instanceof FlinkJedisPoolConfig){ FlinkJedisPoolConfig flinkJedisPoolConfig = (FlinkJedisPoolConfig) flinkJedisConfigBase; return RedisCommandsContainerBuilder.build(flinkJedisPoolConfig); } else if (flinkJedisConfigBase instanceof FlinkJedisClusterConfig) { FlinkJedisClusterConfig flinkJedisClusterConfig = (FlinkJedisClusterConfig) flinkJedisConfigBase; return RedisCommandsContainerBuilder.build(flinkJedisClusterConfig); } else if (flinkJedisConfigBase instanceof FlinkJedisSentinelConfig) { FlinkJedisSentinelConfig flinkJedisSentinelConfig = (FlinkJedisSentinelConfig) flinkJedisConfigBase; return RedisCommandsContainerBuilder.build(flinkJedisSentinelConfig); } else { throw new IllegalArgumentException("Jedis configuration not found"); } } /** * Builds container for single Redis environment. * * @param jedisPoolConfig configuration for JedisPool * @return container for single Redis environment * @throws NullPointerException if jedisPoolConfig is null */ public static redis.common.container.RedisCommandsContainer build(FlinkJedisPoolConfig jedisPoolConfig) { Objects.requireNonNull(jedisPoolConfig, "Redis pool config should not be Null"); GenericObjectPoolConfig genericObjectPoolConfig = new GenericObjectPoolConfig(); genericObjectPoolConfig.setMaxIdle(jedisPoolConfig.getMaxIdle()); genericObjectPoolConfig.setMaxTotal(jedisPoolConfig.getMaxTotal()); genericObjectPoolConfig.setMinIdle(jedisPoolConfig.getMinIdle()); JedisPool jedisPool = new JedisPool(genericObjectPoolConfig, jedisPoolConfig.getHost(), jedisPoolConfig.getPort(), jedisPoolConfig.getConnectionTimeout(), jedisPoolConfig.getPassword(), jedisPoolConfig.getDatabase()); return new redis.common.container.RedisContainer(jedisPool); } /** * Builds container for Redis Cluster environment. * * @param jedisClusterConfig configuration for JedisCluster * @return container for Redis Cluster environment * @throws NullPointerException if jedisClusterConfig is null */ public static redis.common.container.RedisCommandsContainer build(FlinkJedisClusterConfig jedisClusterConfig) { Objects.requireNonNull(jedisClusterConfig, "Redis cluster config should not be Null"); GenericObjectPoolConfig genericObjectPoolConfig = new GenericObjectPoolConfig(); genericObjectPoolConfig.setMaxIdle(jedisClusterConfig.getMaxIdle()); genericObjectPoolConfig.setMaxTotal(jedisClusterConfig.getMaxTotal()); genericObjectPoolConfig.setMinIdle(jedisClusterConfig.getMinIdle()); JedisCluster jedisCluster = new JedisCluster(jedisClusterConfig.getNodes(), jedisClusterConfig.getConnectionTimeout(), jedisClusterConfig.getMaxRedirections(), genericObjectPoolConfig); return new redis.common.container.RedisClusterContainer(jedisCluster); } /** * Builds container for Redis Sentinel environment. * * @param jedisSentinelConfig configuration for JedisSentinel * @return container for Redis sentinel environment * @throws NullPointerException if jedisSentinelConfig is null */ public static RedisCommandsContainer build(FlinkJedisSentinelConfig jedisSentinelConfig) { Objects.requireNonNull(jedisSentinelConfig, "Redis sentinel config should not be Null"); GenericObjectPoolConfig genericObjectPoolConfig = new GenericObjectPoolConfig(); genericObjectPoolConfig.setMaxIdle(jedisSentinelConfig.getMaxIdle()); genericObjectPoolConfig.setMaxTotal(jedisSentinelConfig.getMaxTotal()); genericObjectPoolConfig.setMinIdle(jedisSentinelConfig.getMinIdle()); JedisSentinelPool jedisSentinelPool = new JedisSentinelPool(jedisSentinelConfig.getMasterName(), jedisSentinelConfig.getSentinels(), genericObjectPoolConfig, jedisSentinelConfig.getConnectionTimeout(), jedisSentinelConfig.getSoTimeout(), jedisSentinelConfig.getPassword(), jedisSentinelConfig.getDatabase()); return new RedisContainer(jedisSentinelPool); } }
Java
package fundamental.games.metropolis.connection.bluetooth; import android.bluetooth.BluetoothSocket; import java.io.ObjectInputStream; import java.io.ObjectOutputStream; import java.io.Serializable; import java.util.UUID; import fundamental.games.metropolis.connection.global.MessagesQueue; import fundamental.games.metropolis.connection.serializable.PlayerInitData; import fundamental.games.metropolis.global.WidgetsData; /** * Created by regair on 27.05.15. */ public class BluetoothServerConnection extends BluetoothConnection { private ObjectOutputStream writer; private ObjectInputStream reader; //******************************** public BluetoothServerConnection(BluetoothSocket socket, MessagesQueue<Serializable> queue, UUID uuid) { super(socket, queue, uuid); this.queue = new MessagesQueue<>(); deviceName = "SERVER"; } //******************************** @Override public void run() { working = true; } //******************************** @Override public void stopConnection() { super.stopConnection(); BluetoothServer.getInstance().removeConnection(this); } public MessagesQueue<Serializable> getQueue() { return queue; } //********************************** public void sendMessage(Serializable message) { if(message instanceof PlayerInitData) { setID(((PlayerInitData)message).ID); //ID = ((PlayerInitData)message).ID; BluetoothServer.getInstance().getIncomingQueue().addMessage(new PlayerInitData(WidgetsData.playerName, ID)); return; } queue.addMessage(message); } @Override public void setID(int id) { super.setID(id); BluetoothConnection.humanID = id; } }
Java
/* * Copyright 2016 The Closure Compiler Authors. * * 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. */ /** * @fileoverview Tests for user-defined Symbols. */ goog.require('goog.testing.jsunit'); const s1 = Symbol('example'); const s2 = Symbol('example'); /** @unrestricted */ const SymbolProps = class { [s1]() { return 's1'; } [s2]() { return 's2'; } } function testSymbols() { const sp = new SymbolProps(); assertEquals('s1', sp[s1]()); assertEquals('s2', sp[s2]()); } function testArrayIterator() { // Note: this test cannot pass in IE8 since we can't polyfill // Array.prototype methods and maintain correct for-in behavior. if (typeof Object.defineProperties !== 'function') return; const iter = [2, 4, 6][Symbol.iterator](); assertObjectEquals({value: 2, done: false}, iter.next()); assertObjectEquals({value: 4, done: false}, iter.next()); assertObjectEquals({value: 6, done: false}, iter.next()); assertTrue(iter.next().done); }
Java
// Reset $('.touch .client-wrap').click(function(event){ var target = $( event.target ); if ( target.hasClass( "client-close" ) ) { $('.client-wrap div.client').addClass('reset'); } else{ $('.client-wrap div.client').removeClass('reset'); } }); // David Walsh simple lazy loading [].forEach.call(document.querySelectorAll('img[data-src]'), function(img) { img.setAttribute('src', img.getAttribute('data-src')); img.onload = function() { img.removeAttribute('data-src'); }; });
Java
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <!-- NewPage --> <html lang="en"> <head> <!-- Generated by javadoc (version 1.7.0_51) on Sun Apr 20 22:40:20 SAST 2014 --> <title>Uses of Interface za.co.neilson.sqlite.orm.DatabaseDriverInterface</title> <meta name="date" content="2014-04-20"> <link rel="stylesheet" type="text/css" href="../../../../../../stylesheet.css" title="Style"> </head> <body> <script type="text/javascript"><!-- if (location.href.indexOf('is-external=true') == -1) { parent.document.title="Uses of Interface za.co.neilson.sqlite.orm.DatabaseDriverInterface"; } //--> </script> <noscript> <div>JavaScript is disabled on your browser.</div> </noscript> <!-- ========= START OF TOP NAVBAR ======= --> <div class="topNav"><a name="navbar_top"> <!-- --> </a><a href="#skip-navbar_top" title="Skip navigation links"></a><a name="navbar_top_firstrow"> <!-- --> </a> <ul class="navList" title="Navigation"> <li><a href="../../../../../../overview-summary.html">Overview</a></li> <li><a href="../package-summary.html">Package</a></li> <li><a href="../../../../../../za/co/neilson/sqlite/orm/DatabaseDriverInterface.html" title="interface in za.co.neilson.sqlite.orm">Class</a></li> <li class="navBarCell1Rev">Use</li> <li><a href="../package-tree.html">Tree</a></li> <li><a href="../../../../../../deprecated-list.html">Deprecated</a></li> <li><a href="../../../../../../index-files/index-1.html">Index</a></li> <li><a href="../../../../../../help-doc.html">Help</a></li> </ul> </div> <div class="subNav"> <ul class="navList"> <li>Prev</li> <li>Next</li> </ul> <ul class="navList"> <li><a href="../../../../../../index.html?za/co/neilson/sqlite/orm/class-use/DatabaseDriverInterface.html" target="_top">Frames</a></li> <li><a href="DatabaseDriverInterface.html" target="_top">No Frames</a></li> </ul> <ul class="navList" id="allclasses_navbar_top"> <li><a href="../../../../../../allclasses-noframe.html">All Classes</a></li> </ul> <div> <script type="text/javascript"><!-- allClassesLink = document.getElementById("allclasses_navbar_top"); if(window==top) { allClassesLink.style.display = "block"; } else { allClassesLink.style.display = "none"; } //--> </script> </div> <a name="skip-navbar_top"> <!-- --> </a></div> <!-- ========= END OF TOP NAVBAR ========= --> <div class="header"> <h2 title="Uses of Interface za.co.neilson.sqlite.orm.DatabaseDriverInterface" class="title">Uses of Interface<br>za.co.neilson.sqlite.orm.DatabaseDriverInterface</h2> </div> <div class="classUseContainer"> <ul class="blockList"> <li class="blockList"> <table border="0" cellpadding="3" cellspacing="0" summary="Use table, listing packages, and an explanation"> <caption><span>Packages that use <a href="../../../../../../za/co/neilson/sqlite/orm/DatabaseDriverInterface.html" title="interface in za.co.neilson.sqlite.orm">DatabaseDriverInterface</a></span><span class="tabEnd">&nbsp;</span></caption> <tr> <th class="colFirst" scope="col">Package</th> <th class="colLast" scope="col">Description</th> </tr> <tbody> <tr class="altColor"> <td class="colFirst"><a href="#za.co.neilson.sqlite.orm">za.co.neilson.sqlite.orm</a></td> <td class="colLast">&nbsp;</td> </tr> </tbody> </table> </li> <li class="blockList"> <ul class="blockList"> <li class="blockList"><a name="za.co.neilson.sqlite.orm"> <!-- --> </a> <h3>Uses of <a href="../../../../../../za/co/neilson/sqlite/orm/DatabaseDriverInterface.html" title="interface in za.co.neilson.sqlite.orm">DatabaseDriverInterface</a> in <a href="../../../../../../za/co/neilson/sqlite/orm/package-summary.html">za.co.neilson.sqlite.orm</a></h3> <table border="0" cellpadding="3" cellspacing="0" summary="Use table, listing fields, and an explanation"> <caption><span>Fields in <a href="../../../../../../za/co/neilson/sqlite/orm/package-summary.html">za.co.neilson.sqlite.orm</a> declared as <a href="../../../../../../za/co/neilson/sqlite/orm/DatabaseDriverInterface.html" title="interface in za.co.neilson.sqlite.orm">DatabaseDriverInterface</a></span><span class="tabEnd">&nbsp;</span></caption> <tr> <th class="colFirst" scope="col">Modifier and Type</th> <th class="colLast" scope="col">Field and Description</th> </tr> <tbody> <tr class="altColor"> <td class="colFirst"><code>private <a href="../../../../../../za/co/neilson/sqlite/orm/DatabaseDriverInterface.html" title="interface in za.co.neilson.sqlite.orm">DatabaseDriverInterface</a>&lt;<a href="../../../../../../za/co/neilson/sqlite/orm/DatabaseModel.html" title="type parameter in DatabaseModel">R</a>,<a href="../../../../../../za/co/neilson/sqlite/orm/DatabaseModel.html" title="type parameter in DatabaseModel">C</a>&gt;</code></td> <td class="colLast"><span class="strong">DatabaseModel.</span><code><strong><a href="../../../../../../za/co/neilson/sqlite/orm/DatabaseModel.html#databaseDriverInterface">databaseDriverInterface</a></strong></code>&nbsp;</td> </tr> </tbody> </table> <table border="0" cellpadding="3" cellspacing="0" summary="Use table, listing methods, and an explanation"> <caption><span>Methods in <a href="../../../../../../za/co/neilson/sqlite/orm/package-summary.html">za.co.neilson.sqlite.orm</a> that return <a href="../../../../../../za/co/neilson/sqlite/orm/DatabaseDriverInterface.html" title="interface in za.co.neilson.sqlite.orm">DatabaseDriverInterface</a></span><span class="tabEnd">&nbsp;</span></caption> <tr> <th class="colFirst" scope="col">Modifier and Type</th> <th class="colLast" scope="col">Method and Description</th> </tr> <tbody> <tr class="altColor"> <td class="colFirst"><code><a href="../../../../../../za/co/neilson/sqlite/orm/DatabaseDriverInterface.html" title="interface in za.co.neilson.sqlite.orm">DatabaseDriverInterface</a>&lt;<a href="../../../../../../za/co/neilson/sqlite/orm/DatabaseModel.html" title="type parameter in DatabaseModel">R</a>,<a href="../../../../../../za/co/neilson/sqlite/orm/DatabaseModel.html" title="type parameter in DatabaseModel">C</a>&gt;</code></td> <td class="colLast"><span class="strong">DatabaseModel.</span><code><strong><a href="../../../../../../za/co/neilson/sqlite/orm/DatabaseModel.html#getDatabaseDriverInterface()">getDatabaseDriverInterface</a></strong>()</code>&nbsp;</td> </tr> <tr class="rowColor"> <td class="colFirst"><code>protected abstract <a href="../../../../../../za/co/neilson/sqlite/orm/DatabaseDriverInterface.html" title="interface in za.co.neilson.sqlite.orm">DatabaseDriverInterface</a>&lt;<a href="../../../../../../za/co/neilson/sqlite/orm/DatabaseModel.html" title="type parameter in DatabaseModel">R</a>,<a href="../../../../../../za/co/neilson/sqlite/orm/DatabaseModel.html" title="type parameter in DatabaseModel">C</a>&gt;</code></td> <td class="colLast"><span class="strong">DatabaseModel.</span><code><strong><a href="../../../../../../za/co/neilson/sqlite/orm/DatabaseModel.html#onInitializeDatabaseDriverInterface(java.lang.Object...)">onInitializeDatabaseDriverInterface</a></strong>(java.lang.Object...&nbsp;args)</code>&nbsp;</td> </tr> </tbody> </table> </li> </ul> </li> </ul> </div> <!-- ======= START OF BOTTOM NAVBAR ====== --> <div class="bottomNav"><a name="navbar_bottom"> <!-- --> </a><a href="#skip-navbar_bottom" title="Skip navigation links"></a><a name="navbar_bottom_firstrow"> <!-- --> </a> <ul class="navList" title="Navigation"> <li><a href="../../../../../../overview-summary.html">Overview</a></li> <li><a href="../package-summary.html">Package</a></li> <li><a href="../../../../../../za/co/neilson/sqlite/orm/DatabaseDriverInterface.html" title="interface in za.co.neilson.sqlite.orm">Class</a></li> <li class="navBarCell1Rev">Use</li> <li><a href="../package-tree.html">Tree</a></li> <li><a href="../../../../../../deprecated-list.html">Deprecated</a></li> <li><a href="../../../../../../index-files/index-1.html">Index</a></li> <li><a href="../../../../../../help-doc.html">Help</a></li> </ul> </div> <div class="subNav"> <ul class="navList"> <li>Prev</li> <li>Next</li> </ul> <ul class="navList"> <li><a href="../../../../../../index.html?za/co/neilson/sqlite/orm/class-use/DatabaseDriverInterface.html" target="_top">Frames</a></li> <li><a href="DatabaseDriverInterface.html" target="_top">No Frames</a></li> </ul> <ul class="navList" id="allclasses_navbar_bottom"> <li><a href="../../../../../../allclasses-noframe.html">All Classes</a></li> </ul> <div> <script type="text/javascript"><!-- allClassesLink = document.getElementById("allclasses_navbar_bottom"); if(window==top) { allClassesLink.style.display = "block"; } else { allClassesLink.style.display = "none"; } //--> </script> </div> <a name="skip-navbar_bottom"> <!-- --> </a></div> <!-- ======== END OF BOTTOM NAVBAR ======= --> </body> </html>
Java
CardGames ========= Include some small card games.
Java
<html><head> <meta http-equiv="content-type" content="text/html; charset=UTF-8"><title>Variables and Types</title></head> <body bgcolor="#EFF1F0" link="#3A3966" vlink="#000000" alink="#000000"> <font face="Verdana, sans-serif" size="2"><p align="center"><b><font size="5">Variables and Types</font></b></p> <p><b>Variables declaration</b></p><blockquote> To declare a variable in PureBasic, simply type its name. You can also specify the type you want this variable to be. Variables do not need to be explicitly declared, as they can be used as "variables on-the-fly". The <a href="define.html">Define</a> keyword can be used to declare multiple variables in one statement. If you don't assign an initial value to the variable, their value will be 0. <p><b>示例</b></p><blockquote> <pre><font face="Courier New, Courier, mono"size="2"> a.b <font color="#3A3966">; Declare a variable called 'a' from byte (.b) type.</font> c.l = a*d.w <font color="#3A3966">; 'd' is declared here within the expression !</font> </font></pre> <u>Notes:</u> <blockquote> Variable names must not start with a number (0,1,...), contain operators (+,-,...) or special characters (????...). <br> <br> The variables in PureBasic are not case sensitive, so "pure" and "PURE" are the same variable. <br> <br> If you don't need to change the content of a variable during the program flow (e.g. you're using fixed values for ID's etc.), you can also take a look at <a href="general_rules.html">constants</a> as an alternative. <br> <br> To avoid typing errors etc. it's possible to force the PureBasic compiler to always want a declaration of variables, before they are first used. Just use <a href="compilerdirectives.html">EnableExplicit</a> keyword in your source code to enable this feature. </blockquote> </blockquote> <p><b>Basic types</b></p><blockquote> PureBasic allows many type variables which can be standard integers, float, double, quad and char numbers or even string characters. Here is the list of the native supported types and a brief description : <br> <br> <table width="75%" border="1" bordercolorlight="#FFFFFF" bordercolordark="#999900"> <tr> <td> <div align="center"><b><font face="Arial" size="2">Name</font></b></div> </td> <td> <div align="center"><b><font face="Arial" size="2">Extension</font></b></div> </td> <td> <div align="center"><b><font face="Arial" size="2">Memory consumption</font></b></div> </td> <td> <div align="center"><b><font face="Arial" size="2">Range</font></b></div> </td> </tr> <tr> <td><font face="Arial" size="2">Byte</font></td> <td><font face="Arial" size="2">.b</font></td> <td><font face="Arial" size="2">1 byte</font></td> <td><font face="Arial" size="2">-128 to +127</font></td> </tr> <tr> <td><font face="Arial" size="2">Ascii</font></td> <td><font face="Arial" size="2">.a</font></td> <td><font face="Arial" size="2">1 byte</font></td> <td><font face="Arial" size="2">0 to +255</font></td> </tr> <tr> <td><font face="Arial" size="2">Character</font></td> <td><font face="Arial" size="2">.c</font></td> <td><font face="Arial" size="2">1 byte (in ascii mode)</font></td> <td><font face="Arial" size="2">0 to +255</font></td> </tr> <tr> <td><font face="Arial" size="2">Character</font></td> <td><font face="Arial" size="2">.c</font></td> <td><font face="Arial" size="2">2 bytes (in unicode mode)</font></td> <td><font face="Arial" size="2">0 to +65535</font></td> </tr> <tr> <td><font face="Arial" size="2">Word</font></td> <td><font face="Arial" size="2">.w</font></td> <td><font face="Arial" size="2">2 bytes</font></td> <td><font face="Arial" size="2">-32768 to +32767</font></td> </tr> <tr> <td><font face="Arial" size="2">Unicode</font></td> <td><font face="Arial" size="2">.u</font></td> <td><font face="Arial" size="2">2 bytes</font></td> <td><font face="Arial" size="2">0 to +65535</font></td> </tr> <tr> <td><font face="Arial" size="2">Long</font></td> <td><font face="Arial" size="2">.l</font></td> <td><font face="Arial" size="2">4 bytes</font></td> <td><font face="Arial" size="2">-2147483648 to +2147483647</font></td> </tr> <tr> <td><font face="Arial" size="2">Integer</font></td> <td><font face="Arial" size="2">.i</font></td> <td><font face="Arial" size="2">4 bytes (using 32-bit compiler)</font></td> <td><font face="Arial" size="2">-2147483648 to +2147483647</font></td> </tr> <tr> <td><font face="Arial" size="2">Integer</font></td> <td><font face="Arial" size="2">.i</font></td> <td><font face="Arial" size="2">8 bytes (using 64-bit compiler)</font></td> <td><font face="Arial" size="2">-9223372036854775808 to +9223372036854775807</font></td> </tr> <tr> <td><font face="Arial" size="2">Float</font></td> <td><font face="Arial" size="2">.f</font></td> <td><font face="Arial" size="2">4 bytes</font></td> <td><font face="Arial" size="2">unlimited (see below)</font></td> </tr> <tr> <td><font face="Arial" size="2">Quad</font></td> <td><font face="Arial" size="2">.q</font></td> <td><font face="Arial" size="2">8 bytes</font></td> <td><font face="Arial" size="2">-9223372036854775808 to +9223372036854775807</font></td> </tr> <tr> <td><font face="Arial" size="2">Double</font></td> <td><font face="Arial" size="2">.d</font></td> <td><font face="Arial" size="2">8 bytes</font></td> <td><font face="Arial" size="2">unlimited (see below)</font></td> </tr> <tr> <td height="24"><font face="Arial" size="2">String</font></td> <td height="24"><font face="Arial" size="2">.s</font></td> <td height="24"><font face="Arial" size="2">string length + 1</font></td> <td height="24"><font face="Arial" size="2">unlimited</font></td> </tr> <tr> <td height="24"><font face="Arial" size="2">Fixed String</font></td> <td height="24"><font face="Arial" size="2">.s{Length}</font></td> <td height="24"><font face="Arial" size="2">string length</font></td> <td height="24"><font face="Arial" size="2">unlimited</font></td> </tr> </table> <br> <b>Unsigned variables</b>: Purebasic offers native support for unsigned variables with byte and word types via the ascii (.a) and unicode (.u) types. The character (.c) type is an unsigned byte in ascii and unsigned word in <a href="unicode.html">unicode</a> that may be used as an unsigned type. <br> <br> <b>Notation of string variables</b>: it is possible to use the '$' as last char of a variable name to mark it as string. This way you can use 'a$' and 'a.s' as different string variables. Please note, that the '$' belongs to the variable name and must be always attached, unlike the '.s' which is only needed when the string variable is declared the first time. <pre><font face="Courier New, Courier, mono"size="2"> a.s = "One string" a$ = "Another string" <b><font color="#3A3966">Debug</font></b> a <font color="#3A3966">; will give "One string"</font> <b><font color="#3A3966">Debug</font></b> a$ <font color="#3A3966">; will give "Another string"</font> </font></pre> <br> <b>Note</b>: The floating numbers (floats + doubles) can also be written like this: 123.5e-20 <pre><font face="Courier New, Courier, mono"size="2"> value.d = 123.5e-20 <b><font color="#3A3966">Debug</font></b> value <font color="#3A3966">; will give 0.000000000000000001235</font> </font></pre> </blockquote> <p><b>Operators</b></p><blockquote> Operators are the functions you can use in expressions to combine the variables, constants, and whatever else. The table below shows the operators you can use in PureBasic, in no particular order (LHS = Left Hand Side, RHS = Right Hand Side). <br> <br> <table border="1" bordercolorlight="#FFFFFF" bordercolordark="#999900"> <tr> <td><div align="center"><b>Operator</b></div></td> <td><div align="center"><b>Description / Example</b></div></td> </tr> <tr> <td><div align="center">=</div></td> <td><font face="Arial" size="2">Equals. This can be used in two ways. The first is to assign the value of the expression on the RHS to the variable on the LHS. The second way is when the result of the operator is used in an expression and is to test whether the values of the expressions on the LHS and RHS are the same (if they are the same this operator will return a true result, otherwise it will be false).<br> <br><i><b>Example:</b></i><br> <font face="Courier New, Courier, mono">a=b+c <font color="#006666">; Assign the value of the expression "b+c" to the variable "a"</font><br> <b><font color="#006666">If</font></b> abc=def <font color="#006666">; Test if the values of abc and def are the same, and use this result in the If command</font> </font> <br><br> When using with strings the '=' is used as assigning operator as well as operator for comparing. Note: the comparing of two strings is "Case-sensitive".<br> <br><i><b>Example:</b></i><br> <font face="Courier New, Courier, mono">a$ = b$ <font color="#006666">; Assign the content of the string "b$" to the string "a$" zu</font><br> <b><font color="#006666">If</font></b> a$ = b$ <font color="#006666">; Test, if the content of the strings a$ and b$ is equal, and use this result in the If command.</font> </font> </font></td> </tr> <tr> <td><div align="center">+</div></td> <td><font face="Arial" size="2">Plus. Gives a result of the value of the expression on the RHS added to the value of the expression on the LHS. If the result of this operator is not used and there is a variable on the LHS, then the value of the expression on the RHS will be added directly to the variable on the LHS.<br> <br><i><b>Example:</b></i><br> <font face="Courier New, Courier, mono"> number=something+2 <font color="#006666">; Adds the value 2 to "something" and uses the result with the equals operator</font><br> variable+expression <font color="#006666">; The value of "expression" will be added directly to the variable "variable"</font> </font> <br><br> With strings the '+' is also valid for combining the contents of two strings, where the result will be assigned to the string on the LHS with the '=' operator or will be directly stored into the string on the LHS. Numeric values are also accepted for combination with a string. It will behave like using Str(), Str() or StrD() with their defaults for the optional parameters.<br> <br><i><b>Example:</b></i><br> <font face="Courier New, Courier, mono"> a$ = b$ + " more" <font color="#006666">; Combines the content of the string "b$" with the string " more" and save this into the string "a$"</font><br> a$ + b$ <font color="#006666">; Attach the content of the string b$ directly to the string a$.</font> a$ = b$ + 123 </font> </font></td> </tr> <tr> <td><div align="center">-</div></td> <td><font face="Arial" size="2">Minus. Subtracts the value of the expression on the RHS from the value of the expression on the LHS. When there is no expression on the LHS this operator gives the negative value of the value of the expression on the RHS. If the result of this operator is not used and there is a variable on the LHS, then the value of the expression on the RHS will be subtracted directly from the variable on the LHS. This operator cannot be used with string type variables.<br> <br><i><b>Example:</b></i><br> <font face="Courier New, Courier, mono"> var=#MyConstant-foo <font color="#006666">; Subtracts the value of "foo" from "#MyConstant" and uses the result with the equals operator</font><br> another=another+ -var <font color="#006666">; Calculates the negative value of "var" and uses the result in the plus operator</font><br> variable-expression <font color="#006666">; The value of "expression" will be subtracted directly from the variable "variable"</font> </font></font></td> </tr> <tr> <td><div align="center">*</div></td> <td><font face="Arial" size="2">Multiplication. Multiplies the value of the expression on the LHS by the value of the expression on the RHS. If the result of this operator is not used and there is a variable on the LHS, then the value of the variable is directly multiplied by the value of the expression on the RHS. This operator cannot be used with string type variables.<br> <br><i><b>Example:</b></i><br> <font face="Courier New, Courier, mono"> total=price*count <font color="#006666">; Multiplies the value of "price" by the value of "count" and uses the result with the equals operator</font><br> variable*expression <font color="#006666">; "variable" will be multiplied directly by the value of "expression"</font> </font></font></td> </tr> <tr> <td><div align="center">/</div></td> <td><font face="Arial" size="2">Division. Divides the value of the expression on the LHS by the value of the expression on the RHS. If the result of this operator is not used and there is a variable on the LHS, then the value of the variable is directly divided by the value of the expression on the RHS. This operator cannot be used with string type variables.<br> <br><i><b>Example:</b></i><br> <font face="Courier New, Courier, mono"> count=total/price <font color="#006666">; Divides the value of "total" by the value of "price" and uses the result with the equals operator</font><br> variable/expression <font color="#006666">; "variable" will be divided directly by the value of "expression"</font> </font></font></td> </tr> <tr> <td><div align="center">&amp;</div></td> <td><font face="Arial" size="2">Bitwise AND. You should be familiar with binary numbers when using this operator. The result of this operator will be the value of the expression on the LHS anded with the value of the expression on the RHS, bit for bit. The value of each bit is set according to the table below. Additionally, if the result of the operator is not used and there is a variable on the LHS, then the result will be stored directly in that variable. This operator cannot be used with strings.<br> <font size="3"><pre>LHS | RHS | Result ------------------ 0 | 0 | 0 0 | 1 | 0 1 | 0 | 0 1 | 1 | 1</pre></font> <i><b>Example:</b></i><br> <font face="Courier New, Courier, mono"> <font color="#006666">; Shown using binary numbers as it will be easier to see the result</font><br> a.w = %1000 &amp; %0101 <font color="#006666">; Result will be 0</font><br> b.w = %1100 &amp; %1010 <font color="#006666">; Result will be %1000</font><br> bits = a &amp; b <font color="#006666">; AND each bit of a and b and use result in equals operator</font><br> a &amp; b <font color="#006666">; AND each bit of a and b and store result directly in variable "a"</font> </font></font></td> </tr> <tr> <td><div align="center">|</div></td> <td><font face="Arial" size="2">Bitwise OR. You should be familiar with binary numbers when using this operator. The result of this operator will be the value of the expression on the LHS or'ed with the value of the expression on the RHS, bit for bit. The value of each bit is set according to the table below. Additionally, if the result of the operator is not used and there is a variable on the LHS, then the result will be stored directly in that variable. This operator cannot be used with strings.<br> <font size="3"><pre>LHS | RHS | Result ------------------ 0 | 0 | 0 0 | 1 | 1 1 | 0 | 1 1 | 1 | 1</pre></font> <i><b>Example:</b></i><br> <font face="Courier New, Courier, mono"> <font color="#006666">; Shown using binary numbers as it will be easier to see the result</font><br> a.w = %1000 | %0101 <font color="#006666">; Result will be %1101</font><br> b.w = %1100 | %1010 <font color="#006666">; Result will be %1110</font><br> bits = a | b <font color="#006666">; OR each bit of a and b and use result in equals operator</font><br> a | b <font color="#006666">; OR each bit of a and b and store result directly in variable "a"</font> </font></font></td> </tr> <tr> <td><div align="center">!</div></td> <td><font face="Arial" size="2">Bitwise XOR. You should be familiar with binary numbers when using this operator. The result of this operator will be the value of the expression on the LHS xor'ed with the value of the expression on the RHS, bit for bit. The value of each bit is set according to the table below. Additionally, if the result of the operator is not used and there is a variable on the LHS, then the result will be stored directly in that variable. This operator cannot be used with strings.<br> <font size="3"><pre>LHS | RHS | Result ------------------ 0 | 0 | 0 0 | 1 | 1 1 | 0 | 1 1 | 1 | 0</pre></font> <i><b>Example:</b></i><br> <font face="Courier New, Courier, mono"> <font color="#006666">; Shown using binary numbers as it will be easier to see the result</font><br> a.w = %1000 ! %0101 <font color="#006666">; Result will be %1101</font><br> b.w = %1100 ! %1010 <font color="#006666">; Result will be %0110</font><br> bits = a ! b <font color="#006666">; XOR each bit of a and b and use result in equals operator</font><br> a ! b <font color="#006666">; XOR each bit of a and b and store result directly in variable "a"</font> </font></font></td> </tr> <tr> <td><div align="center">~</div></td> <td><font face="Arial" size="2">Bitwise NOT. You should be familiar with binary numbers when using this operator. The result of this operator will be the not'ed value of the expression on the RHS, bit for bit. The value of each bit is set according to the table below. This operator cannot be used with strings.<br> <font size="3"><pre>RHS | Result ---------- 0 | 1 1 | 0 </pre></font> <i><b>Example:</b></i><br> <font face="Courier New, Courier, mono"> <font color="#006666">; Shown using binary numbers as it will be easier to see the result</font><br> a.b = ~%1000 <font color="#006666">; In theory the result will be %0111 but in fact is %11110111 (= -9 because a byte is signed).</font><br> b.b = ~%1010 <font color="#006666">; In theory the result will be %0101 but in fact is %11110101 (= -11 because a byte is signed)</font><br> </font></font></td> </tr> <tr> <td><div align="center">()</div></td> <td><font face="Arial" size="2">Brackets. You can use sets of brackets to force part of an expression to be evaluated first, or in a certain order.<br> <br><i><b>Example:</b></i><br> <font face="Courier New, Courier, mono"> a = (5 + 6) * 3 <font color="#006666">; Result will be 33 since the 5+6 is evaluated first</font><br> b = 4 * (2 - (3 - 4)) <font color="#006666">; Result will be 12 since the 3-4 is evaluated first, then the 2-result, then the multiplication</font><br> </font></font></td> </tr> <tr> <td><div align="center">&lt;</div></td> <td><font face="Arial" size="2">Less than. This is used to compare the values of the expressions on the LHS and RHS. If the value of the expression on the LHS is less than the value of the expression on the RHS this operator will give a result of true, otherwise the result is false.<br> <br><i><b>Example:</b></i><br> <font face="Courier New, Courier, mono"> <b><font color="#006666">If</font></b> a &lt; b <font color="#006666">; Tests, if the value a is smaller than b, and uses this result in the If command</font> </font> <br> <br>Note: The comparing of strings will always be "case-sensitive". </font></td> </tr> <tr> <td><div align="center">&gt;</div></td> <td><font face="Arial" size="2">More than. This is used to compare the values of the expressions on the LHS and RHS. If the value of the expression on the LHS is more than the value of the expression on the RHS this operator will give a result of true, otherwise the result is false.<br> <br><i><b>Example:</b></i><br> <font face="Courier New, Courier, mono"> <b><font color="#006666">If</font></b> a &gt; b <font color="#006666">; Tests, if the value a is greater than b, and uses this result in the If command</font> </font> <br> <br>Note: The comparing of strings will always be "case-sensitive". </font></td> </tr> <tr> <td><div align="center">&lt;=</div></td> <td><font face="Arial" size="2">Less than or equal to. This is used to compare the values of the expressions on the LHS and RHS. If the value of the expression on the LHS is less than or equal to the value of the expression on the RHS this operator will give a result of true, otherwise the result is false.<br> <!-- <i><b>Example:</b></i><br> <font face="Courier New, Courier, mono"> </font>--> </font></td> </tr> <tr> <td><div align="center">&gt;=</div></td> <td><font face="Arial" size="2">More than or equal to. This is used to compare the values of the expressions on the LHS and RHS. If the value of the expression on the LHS is more than or equal to the value of the expression on the RHS this operator will give a result of true, otherwise the result is false.<br> <!-- <i><b>Example:</b></i><br> <font face="Courier New, Courier, mono"> </font>--> </font></td> </tr> <tr> <td><div align="center">&lt;&gt;</div></td> <td><font face="Arial" size="2">Not equal to. This is used to compare the values of the expressions on the LHS and RHS. If the value of the expression on the LHS is equal to the value of the expression on the RHS this operator will give a result of false, otherwise the result is true.<br> <!-- <i><b>Example:</b></i><br> <font face="Courier New, Courier, mono"> </font>--> </font></td> </tr> <tr> <td><div align="center">And</div></td> <td><font face="Arial" size="2">Logical AND. Can be used to combine the logical true and false results of the comparison operators to give a result shown in the following table.<br> <font size="3"><pre> LHS | RHS | Result ----------------------- false | false | false false | true | false true | false | false true | true | true</pre><!-- <i><b>Example:</b></i><br> <font face="Courier New, Courier, mono"> </font>--></font> </font></td> </tr> <tr> <td><div align="center">Or</div></td> <td><font face="Arial" size="2">Logical OR. Can be used to combine the logical true and false results of the comparison operators to give a result shown in the following table.<br> <font size="3"><pre> LHS | RHS | Result ----------------------- false | false | false false | true | true true | false | true true | true | true</pre><!-- <i><b>Example:</b></i><br> <font face="Courier New, Courier, mono"> </font>--></font> </font></td> </tr> <tr> <td><div align="center">XOr</div></td> <td><font face="Arial" size="2">Logical XOR. Can be used to combine the logical true ot false results of the comparison operators to give a result shown in the following table. This operator cannot be used with strings.<br> <font size="3"><pre> LHS | RHS | Result ----------------------- false | false | false false | true | true true | false | true true | true | false</pre><!-- <i><b>Example:</b></i><br> <font face="Courier New, Courier, mono"> </font>--></font> </font></td> </tr> <tr> <td><div align="center">Not</div></td> <td><font face="Arial" size="2">The result of this operator will be the not'ed value of the logical on the RHS. The value is set according to the table below. This operator cannot be used with strings.<br> <font size="3"><pre> RHS | Result --------------- false | true true | false </pre><!-- <i><b>Example:</b></i><br> <font face="Courier New, Courier, mono"> </font>--></font> </font></td> </tr> <tr> <td><div align="center">&lt;&lt;</div></td> <td><font face="Arial" size="2">Arithmetic shift left. Shifts each bit in the value of the expression on the LHS left by the number of places given by the value of the expression on the RHS. Additionally, when the result of this operator is not used and the LHS contains a variable, that variable will have its value shifted. It probably helps if you understand binary numbers when you use this operator, although you can use it as if each position you shift by is multiplying by an extra factor of 2.<br> <br><i><b>Example:</b></i><br> <font face="Courier New, Courier, mono"> a=%1011 &lt;&lt; 1 <font color="#006666">; The value of a will be %10110. %1011=11, %10110=22</font><br> b=%111 &lt;&lt; 4 <font color="#006666">; The value of b will be %1110000. %111=7, %1110000=112</font><br> c.l=$80000000 &lt;&lt; 1 <font color="#006666">; The value of c will be 0. Bits that are shifted off the left edge of the result are lost.</font><br> </font></font></td> </tr> <tr> <td><div align="center">&gt;&gt;</div></td> <td><font face="Arial" size="2">Arithmetic shift right. Shifts each bit in the value of the expression on the LHS right by the number of places given by the value of the expression on the RHS. Additionally, when the result of this operator is not used and the LHS contains a variable, that variable will have its value shifted. It probably helps if you understand binary numbers when you use this operator, although you can use it as if each position you shift by is dividing by an extra factor of 2.<br> <br><i><b>Example:</b></i><br> <font face="Courier New, Courier, mono"> d=16 &gt;&gt; 1 <font color="#006666">; The value of d will be 8. 16=%10000, 8=%1000</font><br> e.w=%10101010 &gt;&gt; 4 <font color="#006666">; The value of e will be %1010. %10101010=170, %1010=10. Bits shifted out of the right edge of the result are lost (which is why you do not see an equal division by 16)</font><br> f.b=-128 &gt;&gt; 1 <font color="#006666">; The value of f will be -64. -128=%10000000, -64=%11000000. When shifting to the right, the most significant bit is kept as it is.</font><br> </font></font></td> </tr> <tr> <td><div align="center">%</div></td> <td><font face="Arial" size="2">Modulo. Returns the remainder of the RHS by LHS integer division.<br> <br><i><b>Example:</b></i><br> <font face="Courier New, Courier, mono"> a=16 % 2 <font color="#006666">; The value of a will be 0 as 16/2 = 8 (no remainder)</font><br> b=17 % 2 <font color="#006666">; The value of a will be 1 as 17/2 = 8*2+1 (1 is remaining)</font><br> </font></font></td> </tr> </table> </blockquote> <p><b>Operators shorthands</b></p><blockquote> Every math operators can be used in a shorthand form. </blockquote><p><b>示例</b></p><blockquote> <pre><font face="Courier New, Courier, mono"size="2"> Value + 1 <font color="#3A3966">; The same as: Value = Value + 1</font> Value * 2 <font color="#3A3966">; The same as: Value = Value * 2</font> Value &lt;&lt; 1 <font color="#3A3966">; The same as: Value = Value &lt;&lt; 1</font> </font></pre> Note: this can lead to 'unexpected' results is some rare cases, if the assignment is modified before the affection. </blockquote><p><b>示例</b></p><blockquote> <pre><font face="Courier New, Courier, mono"size="2"> <b><font color="#3A3966">Dim</font></b> <font color="#3A3966">MyArray</font>(10) <font color="#3A3966"> MyArray</font>(<font color="#3A3966">Random</font>(10)) + 1 <font color="#3A3966">; The same as: MyArray(Random(10)) = MyArray(Random(10)) + 1, but here Random() won't return the same value for each call.</font> </font></pre> </blockquote> <p><b>Operators priorities</b></p><blockquote> <pre><font face="Courier New, Courier, mono"size="2"> Priority Level | Operators ---------------+--------------------- 8 (high) | ~, - 7 | &lt;&lt;, &gt;&gt;, %, ! 6 | |, &amp; 5 | *, / 4 | +, - 3 | &gt;, &gt;=, &lt;, &lt;=, =, &lt;&gt; 2 | Not 1 (low) | And, Or, XOr </font></pre> </blockquote> <p><b>Structured types</b></p><blockquote> Build structured types, via the <b><font color="#3A3966">Structure</font></b> keyword. More information can be found in the <a href="structures.html">structures chapter</a>. </blockquote> <p><b>Pointer types</b></p><blockquote> Pointers are declared with a '*' in front of the variable name. More information can be found in the <a href="memory.html">pointers chapter</a>. </blockquote> <p><b>Special information about Floats and Doubles</b></p><blockquote> A floating-point number is stored in a way that makes the binary point "float" around the number, so that it is possible to store very large numbers or very small numbers. However, you cannot store very large numbers with very high accuracy (big and small numbers at the same time, so to speak). <br> <br> Another limitation of floating-point numbers is that they still work in binary, so they can only store numbers exactly which can be made up of multiples and divisions of 2. This is especially important to realize when you try to print a floating-point number in a human readable form (or when performing operations on that float) - storing numbers like 0.5 or 0.125 is easy because they are divisions of 2. Storing numbers such as 0.11 are more difficult and may be stored as a number such as 0.10999999. You can try to display to only a limited range of digits, but do not be surprised if the number displays different from what you would expect! <br> <br> This applies to floating-point numbers in general, not just those in PureBasic. <br> <br> Like the name says the doubles have double-precision (64-bit) compared to the single-precision of the floats (32-bit). So if you need more accurate results with floating-point numbers use doubles instead of floats. <br> <br> The exact range of values, which can be used with floats and doubles to get correct results from arithmetic operations, looks as follows: <blockquote> Float: +- 1.175494e-38 till +- 3.402823e+38 <br> Double: +- 2.2250738585072013e-308 till +- 1.7976931348623157e+308 </blockquote> More information about the 'IEEE 754' standard you can get on <a href="http://en.wikipedia.org/wiki/IEEE_754">Wikipedia</a>. </body></html>
Java
package bookshop2.client.paymentService; import java.util.List; import org.aries.message.Message; import org.aries.message.MessageInterceptor; import org.aries.util.ExceptionUtil; import bookshop2.Payment; @SuppressWarnings("serial") public class PaymentServiceInterceptor extends MessageInterceptor<PaymentService> implements PaymentService { @Override public List<Payment> getAllPaymentRecords() { try { log.info("#### [admin]: getAllPaymentRecords() sending..."); Message request = createMessage("getAllPaymentRecords"); Message response = getProxy().invoke(request); List<Payment> result = response.getPart("result"); return result; } catch (Exception e) { throw ExceptionUtil.rewrap(e); } } @Override public Payment getPaymentRecordById(Long id) { try { log.info("#### [admin]: getPaymentRecordById() sending..."); Message request = createMessage("getPaymentRecordById"); request.addPart("id", id); Message response = getProxy().invoke(request); Payment result = response.getPart("result"); return result; } catch (Exception e) { throw ExceptionUtil.rewrap(e); } } @Override public List<Payment> getPaymentRecordsByPage(int pageIndex, int pageSize) { try { log.info("#### [admin]: getPaymentRecordsByPage() sending..."); Message request = createMessage("getPaymentRecordsByPage"); request.addPart("pageIndex", pageIndex); request.addPart("pageSize", pageSize); Message response = getProxy().invoke(request); List<Payment> result = response.getPart("result"); return result; } catch (Exception e) { throw ExceptionUtil.rewrap(e); } } @Override public Long addPaymentRecord(Payment payment) { try { log.info("#### [admin]: addPaymentRecord() sending..."); Message request = createMessage("addPaymentRecord"); request.addPart("payment", payment); Message response = getProxy().invoke(request); Long result = response.getPart("result"); return result; } catch (Exception e) { throw ExceptionUtil.rewrap(e); } } @Override public void savePaymentRecord(Payment payment) { try { log.info("#### [admin]: savePaymentRecord() sending..."); Message request = createMessage("savePaymentRecord"); request.addPart("payment", payment); getProxy().invoke(request); } catch (Exception e) { throw ExceptionUtil.rewrap(e); } } @Override public void removeAllPaymentRecords() { try { log.info("#### [admin]: removeAllPaymentRecords() sending..."); Message request = createMessage("removeAllPaymentRecords"); getProxy().invoke(request); } catch (Exception e) { throw ExceptionUtil.rewrap(e); } } @Override public void removePaymentRecord(Payment payment) { try { log.info("#### [admin]: removePaymentRecord() sending..."); Message request = createMessage("removePaymentRecord"); request.addPart("payment", payment); getProxy().invoke(request); } catch (Exception e) { throw ExceptionUtil.rewrap(e); } } @Override public void importPaymentRecords() { try { log.info("#### [admin]: importPaymentRecords() sending..."); Message request = createMessage("importPaymentRecords"); getProxy().invoke(request); } catch (Exception e) { throw ExceptionUtil.rewrap(e); } } }
Java
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html lang="en-GB" xml:lang="en-GB" xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="content-type" content="text/html; charset=utf-8"/> <title>Statistics of iobj in UD_Chinese-GSD</title> <link rel="root" href=""/> <!-- for JS --> <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.4.0/css/font-awesome.min.css"> <link rel="stylesheet" type="text/css" href="../../css/jquery-ui-redmond.css"/> <link rel="stylesheet" type="text/css" href="../../css/style.css"/> <link rel="stylesheet" type="text/css" href="../../css/style-vis.css"/> <link rel="stylesheet" type="text/css" href="../../css/hint.css"/> <script type="text/javascript" src="../../lib/ext/head.load.min.js"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/anchor-js/3.2.2/anchor.min.js"></script> <script>document.addEventListener("DOMContentLoaded", function(event) {anchors.add();});</script> <!-- Set up this custom Google search at https://cse.google.com/cse/business/settings?cx=001145188882102106025:dl1mehhcgbo --> <!-- DZ 2021-01-22: I am temporarily hiding the search field to find out whether it slows down loading of the title page. <script> (function() { var cx = '001145188882102106025:dl1mehhcgbo'; var gcse = document.createElement('script'); gcse.type = 'text/javascript'; gcse.async = true; gcse.src = 'https://cse.google.com/cse.js?cx=' + cx; var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(gcse, s); })(); </script> --> <!-- <link rel="shortcut icon" href="favicon.ico"/> --> </head> <body> <div id="main" class="center"> <div id="hp-header"> <table width="100%"><tr><td width="50%"> <span class="header-text"><a href="http://universaldependencies.org/#language-">home</a></span> <span class="header-text"><a href="https://github.com/universaldependencies/docs/edit/pages-source/treebanks/zh_gsd/zh_gsd-dep-iobj.md" target="#">edit page</a></span> <span class="header-text"><a href="https://github.com/universaldependencies/docs/issues">issue tracker</a></span> </td><td> <gcse:search></gcse:search> </td></tr></table> </div> <hr/> <div class="v2complete"> This page pertains to UD version 2. </div> <div id="content"> <noscript> <div id="noscript"> It appears that you have Javascript disabled. Please consider enabling Javascript for this page to see the visualizations. </div> </noscript> <!-- The content may include scripts and styles, hence we must load the shared libraries before the content. --> <script type="text/javascript"> console.time('loading libraries'); var root = '../../'; // filled in by jekyll head.js( // External libraries // DZ: Copied from embedding.html. I don't know which one is needed for what, so I'm currently keeping them all. root + 'lib/ext/jquery.min.js', root + 'lib/ext/jquery.svg.min.js', root + 'lib/ext/jquery.svgdom.min.js', root + 'lib/ext/jquery.timeago.js', root + 'lib/ext/jquery-ui.min.js', root + 'lib/ext/waypoints.min.js', root + 'lib/ext/jquery.address.min.js' ); </script> <h2 id="treebank-statistics-ud_chinese-gsd-relations-iobj">Treebank Statistics: UD_Chinese-GSD: Relations: <code class="language-plaintext highlighter-rouge">iobj</code></h2> <p>This relation is universal.</p> <p>78 nodes (0%) are attached to their parents as <code class="language-plaintext highlighter-rouge">iobj</code>.</p> <p>78 instances of <code class="language-plaintext highlighter-rouge">iobj</code> (100%) are left-to-right (parent precedes child). Average distance between parent and child is 2.12820512820513.</p> <p>The following 4 pairs of parts of speech are connected with <code class="language-plaintext highlighter-rouge">iobj</code>: <tt><a href="zh_gsd-pos-VERB.html">VERB</a></tt>-<tt><a href="zh_gsd-pos-NOUN.html">NOUN</a></tt> (49; 63% instances), <tt><a href="zh_gsd-pos-VERB.html">VERB</a></tt>-<tt><a href="zh_gsd-pos-PROPN.html">PROPN</a></tt> (11; 14% instances), <tt><a href="zh_gsd-pos-VERB.html">VERB</a></tt>-<tt><a href="zh_gsd-pos-PART.html">PART</a></tt> (10; 13% instances), <tt><a href="zh_gsd-pos-VERB.html">VERB</a></tt>-<tt><a href="zh_gsd-pos-PRON.html">PRON</a></tt> (8; 10% instances).</p> <pre><code class="language-conllu"># visual-style 22 bgColor:blue # visual-style 22 fgColor:white # visual-style 20 bgColor:blue # visual-style 20 fgColor:white # visual-style 20 22 iobj color:blue 1 2009 2009 NUM CD NumType=Card 2 nummod _ SpaceAfter=No 2 年 年 NOUN NNB _ 4 clf _ SpaceAfter=No 3 5 5 NUM CD NumType=Card 4 nummod _ SpaceAfter=No 4 月 月 NOUN NNB _ 9 nmod:tmod _ SpaceAfter=No 5 , , PUNCT , _ 9 punct _ SpaceAfter=No 6 國務 國務 NOUN NN _ 7 compound _ SpaceAfter=No 7 院 院 PART SFN _ 9 nsubj _ SpaceAfter=No 8 批複 批複 VERB VV _ 9 advcl _ SpaceAfter=No 9 同意 同意 VERB VV _ 0 root _ SpaceAfter=No 10 , , PUNCT , _ 9 punct _ SpaceAfter=No 11 撤銷 撤銷 VERB VV _ 20 advcl _ SpaceAfter=No 12 南匯 南匯 PROPN NNP _ 13 compound _ SpaceAfter=No 13 區 區 PART SFN _ 11 obj _ SpaceAfter=No 14 , , PUNCT , _ 20 punct _ SpaceAfter=No 15 將 將 ADP BB _ 18 case _ SpaceAfter=No 16 其 其 PRON PRP Person=3 18 nmod _ SpaceAfter=No 17 行政 行政 NOUN NN _ 18 nmod _ SpaceAfter=No 18 區域 區域 NOUN NN _ 20 obl:patient _ SpaceAfter=No 19 整體 整體 NOUN NN _ 20 advmod _ SpaceAfter=No 20 併入 併入 VERB VV _ 9 xcomp _ SpaceAfter=No 21 浦東 浦東 PROPN NNP _ 22 nmod _ SpaceAfter=No 22 新區 新區 NOUN NN _ 20 iobj _ SpaceAfter=No 23 。 。 PUNCT . _ 20 punct _ SpaceAfter=No </code></pre> <pre><code class="language-conllu"># visual-style 10 bgColor:blue # visual-style 10 fgColor:white # visual-style 9 bgColor:blue # visual-style 9 fgColor:white # visual-style 9 10 iobj color:blue 1 麥格林 麥格林 PROPN NNP _ 2 nmod _ SpaceAfter=No 2 神父 神父 NOUN NN _ 9 nsubj _ SpaceAfter=No 3 花 花 VERB VV _ 9 advcl _ SpaceAfter=No 4 了 了 AUX AS Aspect=Perf 3 aux _ SpaceAfter=No 5 相當 相當 ADV RB _ 6 advmod _ SpaceAfter=No 6 長 長 ADJ JJ _ 8 amod _ SpaceAfter=No 7 的 的 PART DEC _ 6 mark:rel _ SpaceAfter=No 8 時間 時間 NOUN NN _ 3 obj _ SpaceAfter=No 9 詢問 詢問 VERB VV _ 0 root _ SpaceAfter=No 10 路濟亞 路濟亞 PROPN NNP _ 9 iobj _ SpaceAfter=No 11 關於 關於 ADP IN _ 15 det _ SpaceAfter=No 12 聖母 聖母 PROPN NNP _ 13 nsubj _ SpaceAfter=No 13 顯靈 顯靈 VERB VV _ 11 ccomp _ SpaceAfter=No 14 的 的 PART DEC Case=Gen 11 case _ SpaceAfter=No 15 細節 細節 NOUN NN _ 9 obj _ SpaceAfter=No 16 。 。 PUNCT . _ 9 punct _ SpaceAfter=No </code></pre> <pre><code class="language-conllu"># visual-style 14 bgColor:blue # visual-style 14 fgColor:white # visual-style 12 bgColor:blue # visual-style 12 fgColor:white # visual-style 12 14 iobj color:blue 1 在 在 ADP IN _ 3 case _ SpaceAfter=No 2 1555 1555 NUM CD NumType=Card 3 nummod _ SpaceAfter=No 3 年 年 NOUN NNB _ 12 obl _ SpaceAfter=No 4 , , PUNCT , _ 12 punct _ SpaceAfter=No 5 哈布斯堡 哈布斯堡 PROPN NNP _ 6 nmod _ SpaceAfter=No 6 君主 君主 NOUN NN _ 12 nsubj _ SpaceAfter=No 7 簽署 簽署 VERB VV _ 12 advcl _ SpaceAfter=No 8 奧格斯堡 奧格斯堡 PROPN NNP _ 10 nmod _ SpaceAfter=No 9 宗教 宗教 NOUN NN _ 10 nmod _ SpaceAfter=No 10 和約 和約 NOUN NN _ 7 obj _ SpaceAfter=No 11 , , PUNCT , _ 12 punct _ SpaceAfter=No 12 授與 授與 VERB VV _ 0 root _ SpaceAfter=No 13 波希米亞 波希米亞 PROPN NNP _ 14 nsubj _ SpaceAfter=No 14 人 人 PART SFN _ 12 iobj _ SpaceAfter=No 15 宗教 宗教 NOUN NN _ 16 nmod _ SpaceAfter=No 16 自由 自由 NOUN NN _ 12 obj _ SpaceAfter=No 17 。 。 PUNCT . _ 12 punct _ SpaceAfter=No </code></pre> </div> <!-- support for embedded visualizations --> <script type="text/javascript"> var root = '../../'; // filled in by jekyll head.js( // We assume that external libraries such as jquery.min.js have already been loaded outside! // (See _layouts/base.html.) // brat helper modules root + 'lib/brat/configuration.js', root + 'lib/brat/util.js', root + 'lib/brat/annotation_log.js', root + 'lib/ext/webfont.js', // brat modules root + 'lib/brat/dispatcher.js', root + 'lib/brat/url_monitor.js', root + 'lib/brat/visualizer.js', // embedding configuration root + 'lib/local/config.js', // project-specific collection data root + 'lib/local/collections.js', // Annodoc root + 'lib/annodoc/annodoc.js', // NOTE: non-local libraries 'https://spyysalo.github.io/conllu.js/conllu.js' ); var webFontURLs = [ // root + 'static/fonts/Astloch-Bold.ttf', root + 'static/fonts/PT_Sans-Caption-Web-Regular.ttf', root + 'static/fonts/Liberation_Sans-Regular.ttf' ]; var setupTimeago = function() { jQuery("time.timeago").timeago(); }; head.ready(function() { setupTimeago(); // mark current collection (filled in by Jekyll) Collections.listing['_current'] = ''; // perform all embedding and support functions Annodoc.activate(Config.bratCollData, Collections.listing); }); </script> <!-- google analytics --> <script> (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){ (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o), m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m) })(window,document,'script','//www.google-analytics.com/analytics.js','ga'); ga('create', 'UA-55233688-1', 'auto'); ga('send', 'pageview'); </script> <div id="footer"> <p class="footer-text">&copy; 2014–2021 <a href="http://universaldependencies.org/introduction.html#contributors" style="color:gray">Universal Dependencies contributors</a>. Site powered by <a href="http://spyysalo.github.io/annodoc" style="color:gray">Annodoc</a> and <a href="http://brat.nlplab.org/" style="color:gray">brat</a></p>. </div> </div> </body> </html>
Java
/* * Copyright 2017-2022 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with * the License. A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file 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.amazonaws.services.redshift.model; import java.io.Serializable; import javax.annotation.Generated; import com.amazonaws.AmazonWebServiceRequest; /** * * @see <a href="http://docs.aws.amazon.com/goto/WebAPI/redshift-2012-12-01/DeleteAuthenticationProfile" * target="_top">AWS API Documentation</a> */ @Generated("com.amazonaws:aws-java-sdk-code-generator") public class DeleteAuthenticationProfileRequest extends com.amazonaws.AmazonWebServiceRequest implements Serializable, Cloneable { /** * <p> * The name of the authentication profile to delete. * </p> */ private String authenticationProfileName; /** * <p> * The name of the authentication profile to delete. * </p> * * @param authenticationProfileName * The name of the authentication profile to delete. */ public void setAuthenticationProfileName(String authenticationProfileName) { this.authenticationProfileName = authenticationProfileName; } /** * <p> * The name of the authentication profile to delete. * </p> * * @return The name of the authentication profile to delete. */ public String getAuthenticationProfileName() { return this.authenticationProfileName; } /** * <p> * The name of the authentication profile to delete. * </p> * * @param authenticationProfileName * The name of the authentication profile to delete. * @return Returns a reference to this object so that method calls can be chained together. */ public DeleteAuthenticationProfileRequest withAuthenticationProfileName(String authenticationProfileName) { setAuthenticationProfileName(authenticationProfileName); return this; } /** * Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be * redacted from this string using a placeholder value. * * @return A string representation of this object. * * @see java.lang.Object#toString() */ @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("{"); if (getAuthenticationProfileName() != null) sb.append("AuthenticationProfileName: ").append(getAuthenticationProfileName()); sb.append("}"); return sb.toString(); } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof DeleteAuthenticationProfileRequest == false) return false; DeleteAuthenticationProfileRequest other = (DeleteAuthenticationProfileRequest) obj; if (other.getAuthenticationProfileName() == null ^ this.getAuthenticationProfileName() == null) return false; if (other.getAuthenticationProfileName() != null && other.getAuthenticationProfileName().equals(this.getAuthenticationProfileName()) == false) return false; return true; } @Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getAuthenticationProfileName() == null) ? 0 : getAuthenticationProfileName().hashCode()); return hashCode; } @Override public DeleteAuthenticationProfileRequest clone() { return (DeleteAuthenticationProfileRequest) super.clone(); } }
Java
using Microsoft.AspNetCore.Antiforgery; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Identity; using Microsoft.AspNetCore.Mvc; using Microsoft.Extensions.Configuration; using Microsoft.Extensions.Logging; using Microsoft.Extensions.Options; using Newtonsoft.Json.Linq; using System; using System.Linq; using System.Net.Http; using System.Threading.Tasks; using tracktor.app.Models; namespace tracktor.app { [Produces("application/json")] [Route("api/account")] public class AccountController : Controller { private readonly UserManager<ApplicationUser> _userManager; private readonly SignInManager<ApplicationUser> _signInManager; private readonly ILogger _logger; private readonly IConfiguration _config; private readonly IAntiforgery _antiForgery; private readonly IEmailSender _emailSender; private readonly ITracktorService _client; public AccountController( UserManager<ApplicationUser> userManager, SignInManager<ApplicationUser> signInManager, ILoggerFactory loggerFactory, IAntiforgery antiForgery, IConfiguration config, IEmailSender emailSender, ITracktorService client) { _userManager = userManager; _signInManager = signInManager; _logger = loggerFactory.CreateLogger<AccountController>(); _antiForgery = antiForgery; _config = config; _emailSender = emailSender; _client = client; } private async Task<LoginDTO> CreateResponse(ApplicationUser user) { HttpContext.User = user != null ? await _signInManager.CreateUserPrincipalAsync(user) : null; var roles = user != null ? await _userManager.GetRolesAsync(user) : null; var afTokenSet = _antiForgery.GetAndStoreTokens(Request.HttpContext); return new LoginDTO { id = user?.Id, afToken = afTokenSet.RequestToken, afHeader = afTokenSet.HeaderName, email = user?.Email, roles = roles, timeZone = user?.TimeZone }; } private static bool IsPopulated(string v) { return !string.IsNullOrWhiteSpace(v); } /// <summary> /// Registers a new user /// </summary> /// <param name="dto">Required fields: email, password</param> /// <returns>LoginDTO</returns> [HttpPost("register")] [AllowAnonymous] public async Task<IActionResult> Register([FromBody]AccountDTO dto) { if(!IsPopulated(dto?.email) || !IsPopulated(dto?.password)) { return BadRequest(); } if(!EmailHelpers.Validate(dto.Username)) { return BadRequest(); } if(!Boolean.Parse(_config["Tracktor:RegistrationEnabled"])) { return BadRequest("@RegistrationDisabled"); } if (_config["Tracktor:RegistrationCode"] != dto.code) { return BadRequest("@BadCode"); } var user = new ApplicationUser { UserName = dto.Username, Email = dto.Username }; var result = await _userManager.CreateAsync(user, dto.password); if (result.Succeeded) { user = await _userManager.FindByEmailAsync(dto.Username); await _userManager.AddToRoleAsync(user, "User"); await _signInManager.SignInAsync(user, isPersistent: true); _logger.LogInformation(3, $"User {dto.Username} created a new account with a password"); // create user in tracktor user.TUserID = await _client.CreateUserAsync(user.Id); user.TimeZone = dto.timezone; await _userManager.UpdateAsync(user); return Ok(await CreateResponse(user)); } else if(result.Errors != null && result.Errors.Any(e => e.Code == "DuplicateUserName")) { return BadRequest("@UsernameTaken"); } else { _logger.LogWarning($"Unable to register user {dto.Username}: {string.Join(", ", result.Errors.Select(e => e.Description))}"); } return BadRequest("@UnableToRegister"); } /// <summary> /// Creates or logs in a user using external provider /// </summary> /// <param name="dto">Required fields: provider, code</param> /// <returns>LoginDTO</returns> [HttpPost("external")] [AllowAnonymous] public async Task<IActionResult> ExternalLogin([FromBody]AccountDTO dto) { if (!IsPopulated(dto?.code) || !IsPopulated(dto?.provider)) { return BadRequest(); } var appVerified = false; var emailVerified = false; switch (dto.provider) { case "Facebook": { try { var hc = new HttpClient(); var verifyUrl = _config["Facebook:VerifyUrl"]; var appId = _config["Facebook:AppId"]; var userUrl = _config["Facebook:UserUrl"]; if (string.IsNullOrWhiteSpace(verifyUrl) || string.IsNullOrWhiteSpace(userUrl)) { return BadRequest("@ProviderNotEnabled"); } var appString = await hc.GetStringAsync(verifyUrl + dto.code); var userString = await hc.GetStringAsync(userUrl + dto.code); if (!string.IsNullOrWhiteSpace(appString) && !string.IsNullOrWhiteSpace(userString)) { var appResult = Newtonsoft.Json.JsonConvert.DeserializeObject(appString) as JObject; var userResult = Newtonsoft.Json.JsonConvert.DeserializeObject(userString) as JObject; if (userResult["email"] != null) { dto.email = userResult["email"].ToString(); emailVerified = true; } if (appResult["id"] != null && appResult["id"].ToString() == appId) { appVerified = true; } } } catch(Exception ex) { _logger.LogError($"Unable to log via {dto.provider}: {ex.Message}"); return BadRequest("@UnableToLogin" + dto.provider); } } break; default: return BadRequest("@UnknownLoginProvider"); } if(string.IsNullOrWhiteSpace(dto.Username) || !emailVerified || !appVerified) { return BadRequest("@UnableToLogin" + dto.provider); } if (!EmailHelpers.Validate(dto.Username)) { return BadRequest(); } // create user if necessary var user = await _userManager.FindByEmailAsync(dto.Username); if (user == null) { if (!Boolean.Parse(_config["Tracktor:RegistrationEnabled"])) { return BadRequest("@RegistrationDisabled"); } user = new ApplicationUser { Email = dto.Username, UserName = dto.Username }; await _userManager.CreateAsync(user); await _userManager.AddToRoleAsync(user, "User"); } if (await _signInManager.CanSignInAsync(user)) { await _signInManager.SignInAsync(user, true); _logger.LogInformation(1, $"User {dto.Username} logged in from {Request.HttpContext.Connection.RemoteIpAddress} via Facebook"); return Ok(await CreateResponse(user)); } else { _logger.LogWarning(2, $"Invalid login attempt for user {dto.Username} from {Request.HttpContext.Connection.RemoteIpAddress}."); return BadRequest("@UnableToLogin" + dto.provider); } } /// <summary> /// Logs in a user using password /// </summary> /// <param name="dto">Required fields: email, password</param> /// <returns>LoginDTO</returns> [HttpPost("login")] [AllowAnonymous] public async Task<IActionResult> Login([FromBody]AccountDTO dto) { if (!IsPopulated(dto?.email) || !IsPopulated(dto?.password)) { return BadRequest(); } var result = await _signInManager.PasswordSignInAsync(dto.Username, dto.password, dto.remember, lockoutOnFailure: true); if (result.Succeeded) { var user = await _userManager.FindByEmailAsync(dto.Username); _logger.LogInformation(1, $"User {dto.Username} logged in from {Request.HttpContext.Connection.RemoteIpAddress}"); return Ok(await CreateResponse(user)); } if (result.IsLockedOut || result.IsNotAllowed) { _logger.LogWarning(2, $"User {dto.Username} is locked out."); return BadRequest("@LockedOut"); } else { _logger.LogWarning(2, $"Invalid login attempt for user {dto.Username} from {Request.HttpContext.Connection.RemoteIpAddress}."); return BadRequest("@InvalidAttempt"); } } /// <summary> /// Logs out current user /// </summary> /// <returns>LoginDTO</returns> [HttpPost("logout")] [IgnoreAntiforgeryToken] [Authorize] public async Task<IActionResult> Logout() { var userName = User.Identity.Name; await _signInManager.SignOutAsync(); _logger.LogInformation(4, $"User {userName} logged out"); return Ok(await CreateResponse(null)); } /// <summary> /// Requests a password reset email /// </summary> /// <param name="dto">Required fields: email</param> [HttpPost("forgot")] [AllowAnonymous] public async Task<IActionResult> Forgot([FromBody]AccountDTO dto) { if (!IsPopulated(dto?.email)) { return BadRequest(); } var user = await _userManager.FindByEmailAsync(dto.Username); if (user == null) { return BadRequest("@UnknownUser"); } var code = await _userManager.GeneratePasswordResetTokenAsync(user); var callbackUrl = UrlHelperExtensions.Action(Url, "Index", "Home", new { reset = dto.Username, code = code }, HttpContext.Request.Scheme); _logger.LogInformation(5, $"User {dto.Username} requested a password reset link."); var subject = dto.messages != null && dto.messages.Length > 0 && !string.IsNullOrWhiteSpace(dto.messages[0]) ? dto.messages[0] : "Tracktor - password reset"; var body = dto.messages != null && dto.messages.Length > 1 && !string.IsNullOrWhiteSpace(dto.messages[1]) ? dto.messages[1] : "Please click the link below to reset your password."; await _emailSender.SendEmailAsync(dto.Username, subject, body, callbackUrl); return Ok(); } /// <summary> /// Changes current user's password /// </summary> /// <param name="dto">Required fields: password, newPassword</param> /// <returns>LoginDTO</returns> [HttpPost("change")] [Authorize] public async Task<IActionResult> Change([FromBody]AccountDTO dto) { if (!IsPopulated(dto?.password) || !IsPopulated(dto?.newPassword)) { return BadRequest(); } var user = await _userManager.GetUserAsync(User); if (user == null) { // don't reveal anything return BadRequest("@UnknownUser"); } var result = await _userManager.ChangePasswordAsync(user, dto.password, dto.newPassword); if (result.Succeeded) { await _signInManager.SignInAsync(user, true); _logger.LogInformation(6, $"User {user.Email} has successfully changed password."); return Ok(await CreateResponse(user)); } return BadRequest("@InvalidChangeAttempt"); } /// <summary> /// Resets current user's password using a reset code /// </summary> /// <param name="dto">Required fields: email, password, code</param> /// <returns>LoginDTO</returns> [HttpPost("reset")] [AllowAnonymous] public async Task<IActionResult> Reset([FromBody]AccountDTO dto) { if (!IsPopulated(dto?.email) || !IsPopulated(dto?.password) || !IsPopulated(dto?.code)) { return BadRequest(); } var user = await _userManager.FindByEmailAsync(dto.Username); if (user == null) { // don't reveal anything return Ok(); } if (_signInManager.IsSignedIn(User)) { await _signInManager.SignOutAsync(); } var result = await _userManager.ResetPasswordAsync(user, dto.code, dto.password); _logger.LogInformation(6, $"User {dto.Username} has successfully reset password."); await _signInManager.SignInAsync(user, true); return Ok(await CreateResponse(user)); } /// <summary> /// Deletes current user and all their data /// </summary> /// <returns>LoginDTO</returns> [HttpPost("delete")] [Authorize] public async Task<IActionResult> Delete() { var user = await _userManager.GetUserAsync(User); await _signInManager.SignOutAsync(); var result = await _userManager.DeleteAsync(user); if (result.Succeeded) { _logger.LogInformation(6, $"User {user.Email} has been removed."); } return Ok(await CreateResponse(null)); } /// <summary> /// Initiate a new session /// </summary> /// <returns>LoginDTO</returns> [HttpGet("handshake")] [AllowAnonymous] public async Task<IActionResult> Handshake() { if (User.Identity?.IsAuthenticated ?? false) { var user = await _userManager.GetUserAsync(User); return Ok(await CreateResponse(user)); } return Ok(await CreateResponse(null)); } } }
Java
// Copyright 2020 The Tink-Rust Authors // // 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. // //////////////////////////////////////////////////////////////////////////////// use tink_streaming_aead::subtle; #[test] fn test_aes_ctr_hmac_encrypt_decrypt() { struct TestCase { name: &'static str, key_size_in_bytes: usize, tag_size_in_bytes: usize, segment_size: usize, first_segment_offset: usize, plaintext_size: usize, chunk_size: usize, } let test_cases = vec![ TestCase { name: "small-1", key_size_in_bytes: 16, tag_size_in_bytes: 12, segment_size: 256, first_segment_offset: 0, plaintext_size: 20, chunk_size: 64, }, TestCase { name: "small-2", key_size_in_bytes: 16, tag_size_in_bytes: 12, segment_size: 512, first_segment_offset: 0, plaintext_size: 400, chunk_size: 64, }, TestCase { name: "small-offset-1", key_size_in_bytes: 16, tag_size_in_bytes: 12, segment_size: 256, first_segment_offset: 8, plaintext_size: 20, chunk_size: 64, }, TestCase { name: "small-offset-2", key_size_in_bytes: 16, tag_size_in_bytes: 12, segment_size: 512, first_segment_offset: 8, plaintext_size: 400, chunk_size: 64, }, TestCase { name: "empty-1", key_size_in_bytes: 16, tag_size_in_bytes: 12, segment_size: 256, first_segment_offset: 0, plaintext_size: 0, chunk_size: 128, }, TestCase { name: "empty-2", key_size_in_bytes: 16, tag_size_in_bytes: 12, segment_size: 256, first_segment_offset: 8, plaintext_size: 0, chunk_size: 128, }, TestCase { name: "medium-1", key_size_in_bytes: 16, tag_size_in_bytes: 12, segment_size: 256, first_segment_offset: 0, plaintext_size: 1024, chunk_size: 128, }, TestCase { name: "medium-2", key_size_in_bytes: 16, tag_size_in_bytes: 12, segment_size: 512, first_segment_offset: 0, plaintext_size: 3086, chunk_size: 128, }, TestCase { name: "medium-3", key_size_in_bytes: 32, tag_size_in_bytes: 12, segment_size: 1024, first_segment_offset: 0, plaintext_size: 12345, chunk_size: 128, }, TestCase { name: "large-chunks-1", key_size_in_bytes: 16, tag_size_in_bytes: 12, segment_size: 256, first_segment_offset: 0, plaintext_size: 1024, chunk_size: 4096, }, TestCase { name: "large-chunks-2", key_size_in_bytes: 16, tag_size_in_bytes: 12, segment_size: 512, first_segment_offset: 0, plaintext_size: 5086, chunk_size: 4096, }, TestCase { name: "large-chunks-3", key_size_in_bytes: 32, tag_size_in_bytes: 12, segment_size: 1024, first_segment_offset: 0, plaintext_size: 12345, chunk_size: 5000, }, TestCase { name: "medium-offset-1", key_size_in_bytes: 16, tag_size_in_bytes: 12, segment_size: 256, first_segment_offset: 8, plaintext_size: 1024, chunk_size: 64, }, TestCase { name: "medium-offset-2", key_size_in_bytes: 16, tag_size_in_bytes: 12, segment_size: 512, first_segment_offset: 20, plaintext_size: 3086, chunk_size: 256, }, TestCase { name: "medium-offset-3", key_size_in_bytes: 32, tag_size_in_bytes: 12, segment_size: 1024, first_segment_offset: 10, plaintext_size: 12345, chunk_size: 5000, }, TestCase { name: "last-segment-full-1", key_size_in_bytes: 16, tag_size_in_bytes: 12, segment_size: 256, first_segment_offset: 0, plaintext_size: 216, chunk_size: 64, }, TestCase { name: "last-segment-full-2", key_size_in_bytes: 16, tag_size_in_bytes: 12, segment_size: 256, first_segment_offset: 16, plaintext_size: 200, chunk_size: 256, }, TestCase { name: "last-segment-full-3", key_size_in_bytes: 16, tag_size_in_bytes: 12, segment_size: 256, first_segment_offset: 16, plaintext_size: 440, chunk_size: 1024, }, TestCase { name: "single-byte-1", key_size_in_bytes: 16, tag_size_in_bytes: 12, segment_size: 256, first_segment_offset: 0, plaintext_size: 1024, chunk_size: 1, }, TestCase { name: "single-byte-2", key_size_in_bytes: 32, tag_size_in_bytes: 12, segment_size: 512, first_segment_offset: 0, plaintext_size: 5086, chunk_size: 1, }, ]; for tc in test_cases { let cipher = subtle::AesCtrHmac::new( super::IKM, tink_proto::HashType::Sha256, tc.key_size_in_bytes, tink_proto::HashType::Sha256, tc.tag_size_in_bytes, tc.segment_size, tc.first_segment_offset, ) .unwrap_or_else(|e| panic!("{}: cannot create cipher: {:?}", tc.name, e)); let (pt, ct) = super::encrypt(&cipher, super::AAD, tc.plaintext_size) .unwrap_or_else(|e| panic!("{}: failure during encryption: {:?}", tc.name, e)); assert!( super::decrypt(&cipher, super::AAD, &pt, &ct, tc.chunk_size).is_ok(), "{}: failure during decryption", tc.name ); } } #[test] fn test_aes_ctr_hmac_modified_ciphertext() { let ikm = hex::decode("000102030405060708090a0b0c0d0e0f00112233445566778899aabbccddeeff").unwrap(); let aad = hex::decode("aabbccddeeff").unwrap(); let key_size_in_bytes = 16; let tag_size_in_bytes = 12; let segment_size = 256; let first_segment_offset = 8; let plaintext_size = 1024; let chunk_size = 128; let cipher = subtle::AesCtrHmac::new( &ikm, tink_proto::HashType::Sha256, key_size_in_bytes, tink_proto::HashType::Sha256, tag_size_in_bytes, segment_size, first_segment_offset, ) .expect("Cannot create a cipher"); let (pt, ct) = super::encrypt(&cipher, &aad, plaintext_size).unwrap(); // truncate ciphertext for i in (0..ct.len()).step_by(8) { assert!( super::decrypt(&cipher, &aad, &pt, &ct[..i], chunk_size).is_err(), "expected error" ); } // append to ciphertext let sizes = vec![1, segment_size - ct.len() % segment_size, segment_size]; for size in sizes { let mut ct2 = ct.clone(); ct2.extend_from_slice(&vec![0; size]); assert!( super::decrypt(&cipher, &aad, &pt, &ct2, chunk_size).is_err(), "expected error" ); } // flip bits for i in 0..ct.len() { let mut ct2 = ct.clone(); ct2[i] ^= 0x01; assert!( super::decrypt(&cipher, &aad, &pt, &ct2, chunk_size).is_err(), "expected error" ); } // delete segments for i in 0..ct.len() / segment_size + 1 { let (start, mut end) = super::segment_pos( segment_size, first_segment_offset, cipher.header_length(), i, ); if start > ct.len() { break; } if end > ct.len() { end = ct.len() } let mut ct2 = ct[..start].to_vec(); ct2.extend_from_slice(&ct[end..]); assert!( super::decrypt(&cipher, &aad, &pt, &ct2, chunk_size).is_err(), "expected error" ); } // duplicate segments for i in 0..ct.len() / segment_size + 1 { let (start, mut end) = super::segment_pos( segment_size, first_segment_offset, cipher.header_length(), i, ); if start > ct.len() { break; } if end > ct.len() { end = ct.len() } let mut ct2 = (&ct[..end]).to_vec(); ct2.extend_from_slice(&ct[start..]); assert!( super::decrypt(&cipher, &aad, &pt, &ct2, chunk_size).is_err(), "expected error" ); } // modify aad for i in 0..aad.len() { let mut aad2 = aad.clone(); aad2[i] ^= 0x01; assert!( super::decrypt(&cipher, &aad2, &pt, &ct, chunk_size).is_err(), "expected error" ); } }
Java
using System; using System.Runtime.CompilerServices; namespace De.Osthus.Ambeth.Mapping { public class CompositIdentityClassKey { private readonly Object entity; private readonly Type type; private int hash; public CompositIdentityClassKey(Object entity, Type type) { this.entity = entity; this.type = type; hash = RuntimeHelpers.GetHashCode(entity) * 13; if (type != null) { hash += type.GetHashCode() * 23; } } public override bool Equals(Object obj) { if (!(obj is CompositIdentityClassKey)) { return false; } CompositIdentityClassKey otherKey = (CompositIdentityClassKey)obj; bool ee = entity == otherKey.entity; bool te = type == otherKey.type; return ee && te; } public override int GetHashCode() { return hash; } } }
Java
// Copyright 2017 Google Inc. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. package codeu.chat.client.core; import java.util.Arrays; import java.util.ArrayList; import java.util.Collection; import codeu.chat.common.BasicView; import codeu.chat.common.User; import codeu.chat.util.Uuid; import codeu.chat.util.connections.ConnectionSource; public final class Context { private final BasicView view; private final Controller controller; public Context(ConnectionSource source) { this.view = new View(source); this.controller = new Controller(source); } public UserContext create(String name) { final User user = controller.newUser(name); return user == null ? null : new UserContext(user, view, controller); } public Iterable<UserContext> allUsers() { final Collection<UserContext> users = new ArrayList<>(); for (final User user : view.getUsers()) { users.add(new UserContext(user, view, controller)); } return users; } }
Java
/* * Copyright 2015-2017 EMBL - European Bioinformatics Institute * * 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 uk.ac.ebi.eva.runner; import org.junit.Assert; import org.junit.Test; import org.junit.runner.RunWith; import org.springframework.batch.core.Job; import org.springframework.batch.core.JobExecution; import org.springframework.batch.core.JobParameters; import org.springframework.batch.core.launch.JobOperator; import org.springframework.batch.test.JobLauncherTestUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.test.annotation.DirtiesContext; import org.springframework.test.context.ContextConfiguration; import org.springframework.test.context.junit4.SpringRunner; import uk.ac.ebi.eva.pipeline.runner.ManageJobsUtils; import uk.ac.ebi.eva.test.configuration.AsynchronousBatchTestConfiguration; import uk.ac.ebi.eva.test.utils.AbstractJobRestartUtils; /** * Test to check if the ManageJobUtils.markLastJobAsFailed let us restart a job redoing all the steps. */ @RunWith(SpringRunner.class) @ContextConfiguration(classes = {AsynchronousBatchTestConfiguration.class}) @DirtiesContext(classMode = DirtiesContext.ClassMode.AFTER_EACH_TEST_METHOD) public class JobRestartForceTest extends AbstractJobRestartUtils { // Wait until the job has been launched properly. The launch operation is not transactional, and other // instances of the same job with the same parameter can throw exceptions in this interval. public static final int INITIALIZE_JOB_SLEEP = 100; public static final int STEP_TIME_DURATION = 1000; public static final int WAIT_FOR_JOB_TO_END = 2000; @Autowired private JobOperator jobOperator; @Test public void forceJobFailureEnsuresCleanRunEvenIfStepsNotRestartables() throws Exception { Job job = getTestJob(getQuickStep(false), getWaitingStep(false, STEP_TIME_DURATION)); JobLauncherTestUtils jobLauncherTestUtils = getJobLauncherTestUtils(job); JobExecution jobExecution = launchJob(jobLauncherTestUtils); Thread.sleep(INITIALIZE_JOB_SLEEP); jobOperator.stop(jobExecution.getJobId()); Thread.sleep(WAIT_FOR_JOB_TO_END); ManageJobsUtils.markLastJobAsFailed(getJobRepository(), job.getName(), new JobParameters()); jobExecution = launchJob(jobLauncherTestUtils); Thread.sleep(WAIT_FOR_JOB_TO_END); Assert.assertFalse(jobExecution.getStepExecutions().isEmpty()); } }
Java
<!DOCTYPE html> <html devsite=""> <head> <meta name="project_path" value="/dotnet/_project.yaml"> <meta name="book_path" value="/dotnet/_book.yaml"> </head> <body> {% verbatim %} <div> <article data-uid="Google.Cloud.Asset.V1.BigQueryDestination"> <h1 class="page-title">Class BigQueryDestination </h1> <div class="codewrapper"> <pre class="prettyprint"><code>public sealed class BigQueryDestination : IMessage&lt;BigQueryDestination&gt;, IEquatable&lt;BigQueryDestination&gt;, IDeepCloneable&lt;BigQueryDestination&gt;, IBufferMessage, IMessage</code></pre> </div> <div class="markdown level0 summary"><p>A BigQuery destination for exporting assets to.</p> </div> <div class="inheritance"> <h2>Inheritance</h2> <span><span class="xref">System.Object</span></span> <span> &gt; </span> <span class="xref">BigQueryDestination</span> </div> <div classs="implements"> <h2>Implements</h2> <span><span class="xref">Google.Protobuf.IMessage</span>&lt;<a class="xref" href="Google.Cloud.Asset.V1.BigQueryDestination.html">BigQueryDestination</a>&gt;,</span> <span><span class="xref">System.IEquatable</span>&lt;<a class="xref" href="Google.Cloud.Asset.V1.BigQueryDestination.html">BigQueryDestination</a>&gt;,</span> <span><span class="xref">Google.Protobuf.IDeepCloneable</span>&lt;<a class="xref" href="Google.Cloud.Asset.V1.BigQueryDestination.html">BigQueryDestination</a>&gt;,</span> <span><span class="xref">Google.Protobuf.IBufferMessage</span>,</span> <span><span class="xref">Google.Protobuf.IMessage</span></span> </div> <div class="inheritedMembers expandable"> <h2 class="showalways">Inherited Members</h2> <div> <span class="xref">System.Object.GetHashCode()</span> </div> <div> <span class="xref">System.Object.GetType()</span> </div> <div> <span class="xref">System.Object.MemberwiseClone()</span> </div> <div> <span class="xref">System.Object.ToString()</span> </div> </div> <h2>Namespace</h2> <a class="xref" href="Google.Cloud.Asset.V1.html">Google.Cloud.Asset.V1</a> <h2>Assembly</h2> <p>Google.Cloud.Asset.V1.dll</p> <h2 id="constructors">Constructors </h2> <a id="Google_Cloud_Asset_V1_BigQueryDestination__ctor_" data-uid="Google.Cloud.Asset.V1.BigQueryDestination.#ctor*"></a> <h3 id="Google_Cloud_Asset_V1_BigQueryDestination__ctor" data-uid="Google.Cloud.Asset.V1.BigQueryDestination.#ctor" class="notranslate">BigQueryDestination()</h3> <div class="codewrapper"> <pre class="prettyprint"><code>public BigQueryDestination()</code></pre> </div> <a id="Google_Cloud_Asset_V1_BigQueryDestination__ctor_" data-uid="Google.Cloud.Asset.V1.BigQueryDestination.#ctor*"></a> <h3 id="Google_Cloud_Asset_V1_BigQueryDestination__ctor_Google_Cloud_Asset_V1_BigQueryDestination_" data-uid="Google.Cloud.Asset.V1.BigQueryDestination.#ctor(Google.Cloud.Asset.V1.BigQueryDestination)" class="notranslate">BigQueryDestination(BigQueryDestination)</h3> <div class="codewrapper"> <pre class="prettyprint"><code>public BigQueryDestination(BigQueryDestination other)</code></pre> </div> <strong>Parameter</strong> <table class="responsive"> <tbody> <tr> <td><strong>Name</strong></td> <td><strong>Description</strong></td> </tr> <tr> <td><span class="parametername">other</span></td> <td><code><a class="xref" href="Google.Cloud.Asset.V1.BigQueryDestination.html">BigQueryDestination</a></code><br></td> </tr> </tbody> </table> <h2 id="properties">Properties </h2> <a id="Google_Cloud_Asset_V1_BigQueryDestination_Dataset_" data-uid="Google.Cloud.Asset.V1.BigQueryDestination.Dataset*"></a> <h3 id="Google_Cloud_Asset_V1_BigQueryDestination_Dataset" data-uid="Google.Cloud.Asset.V1.BigQueryDestination.Dataset" class="notranslate">Dataset</h3> <div class="codewrapper"> <pre class="prettyprint"><code>public string Dataset { get; set; }</code></pre> </div> <div class="markdown level1 summary"><p>Required. The BigQuery dataset in format &quot;projects/projectId/datasets/datasetId&quot;, to which the snapshot result should be exported. If this dataset does not exist, the export call returns an INVALID_ARGUMENT error.</p> </div> <strong>Property Value</strong> <table class="responsive"> <tbody> <tr> <td><strong>Type</strong></td> <td><strong>Description</strong></td> </tr> <tr> <td><span class="xref">System.String</span></td> <td></td> </tr> </tbody> </table> <a id="Google_Cloud_Asset_V1_BigQueryDestination_Force_" data-uid="Google.Cloud.Asset.V1.BigQueryDestination.Force*"></a> <h3 id="Google_Cloud_Asset_V1_BigQueryDestination_Force" data-uid="Google.Cloud.Asset.V1.BigQueryDestination.Force" class="notranslate">Force</h3> <div class="codewrapper"> <pre class="prettyprint"><code>public bool Force { get; set; }</code></pre> </div> <div class="markdown level1 summary"><p>If the destination table already exists and this flag is <code>TRUE</code>, the table will be overwritten by the contents of assets snapshot. If the flag is <code>FALSE</code> or unset and the destination table already exists, the export call returns an INVALID_ARGUMEMT error.</p> </div> <strong>Property Value</strong> <table class="responsive"> <tbody> <tr> <td><strong>Type</strong></td> <td><strong>Description</strong></td> </tr> <tr> <td><span class="xref">System.Boolean</span></td> <td></td> </tr> </tbody> </table> <a id="Google_Cloud_Asset_V1_BigQueryDestination_PartitionSpec_" data-uid="Google.Cloud.Asset.V1.BigQueryDestination.PartitionSpec*"></a> <h3 id="Google_Cloud_Asset_V1_BigQueryDestination_PartitionSpec" data-uid="Google.Cloud.Asset.V1.BigQueryDestination.PartitionSpec" class="notranslate">PartitionSpec</h3> <div class="codewrapper"> <pre class="prettyprint"><code>public PartitionSpec PartitionSpec { get; set; }</code></pre> </div> <div class="markdown level1 summary"><p>[partition_spec] determines whether to export to partitioned table(s) and how to partition the data.</p> <p>If [partition_spec] is unset or [partition_spec.partition_key] is unset or <code>PARTITION_KEY_UNSPECIFIED</code>, the snapshot results will be exported to non-partitioned table(s). [force] will decide whether to overwrite existing table(s).</p> <p>If [partition_spec] is specified. First, the snapshot results will be written to partitioned table(s) with two additional timestamp columns, readTime and requestTime, one of which will be the partition key. Secondly, in the case when any destination table already exists, it will first try to update existing table&apos;s schema as necessary by appending additional columns. Then, if [force] is <code>TRUE</code>, the corresponding partition will be overwritten by the snapshot results (data in different partitions will remain intact); if [force] is unset or <code>FALSE</code>, it will append the data. An error will be returned if the schema update or data appension fails.</p> </div> <strong>Property Value</strong> <table class="responsive"> <tbody> <tr> <td><strong>Type</strong></td> <td><strong>Description</strong></td> </tr> <tr> <td><a class="xref" href="Google.Cloud.Asset.V1.PartitionSpec.html">PartitionSpec</a></td> <td></td> </tr> </tbody> </table> <a id="Google_Cloud_Asset_V1_BigQueryDestination_SeparateTablesPerAssetType_" data-uid="Google.Cloud.Asset.V1.BigQueryDestination.SeparateTablesPerAssetType*"></a> <h3 id="Google_Cloud_Asset_V1_BigQueryDestination_SeparateTablesPerAssetType" data-uid="Google.Cloud.Asset.V1.BigQueryDestination.SeparateTablesPerAssetType" class="notranslate">SeparateTablesPerAssetType</h3> <div class="codewrapper"> <pre class="prettyprint"><code>public bool SeparateTablesPerAssetType { get; set; }</code></pre> </div> <div class="markdown level1 summary"><p>If this flag is <code>TRUE</code>, the snapshot results will be written to one or multiple tables, each of which contains results of one asset type. The [force] and [partition_spec] fields will apply to each of them.</p> <p>Field [table] will be concatenated with &quot;<em>&quot; and the asset type names (see <a href="https://cloud.google.com/asset-inventory/docs/supported-asset-types">https://cloud.google.com/asset-inventory/docs/supported-asset-types</a> for supported asset types) to construct per-asset-type table names, in which all non-alphanumeric characters like &quot;.&quot; and &quot;/&quot; will be substituted by &quot;</em>&quot;. Example: if field [table] is &quot;mytable&quot; and snapshot results contain &quot;storage.googleapis.com/Bucket&quot; assets, the corresponding table name will be &quot;mytable_storage_googleapis_com_Bucket&quot;. If any of these tables does not exist, a new table with the concatenated name will be created.</p> <p>When [content_type] in the ExportAssetsRequest is <code>RESOURCE</code>, the schema of each table will include RECORD-type columns mapped to the nested fields in the Asset.resource.data field of that asset type (up to the 15 nested level BigQuery supports (<a href="https://cloud.google.com/bigquery/docs/nested-repeated#limitations">https://cloud.google.com/bigquery/docs/nested-repeated#limitations</a>)). The fields in &gt;15 nested levels will be stored in JSON format string as a child column of its parent RECORD column.</p> <p>If error occurs when exporting to any table, the whole export call will return an error but the export results that already succeed will persist. Example: if exporting to table_type_A succeeds when exporting to table_type_B fails during one export call, the results in table_type_A will persist and there will not be partial results persisting in a table.</p> </div> <strong>Property Value</strong> <table class="responsive"> <tbody> <tr> <td><strong>Type</strong></td> <td><strong>Description</strong></td> </tr> <tr> <td><span class="xref">System.Boolean</span></td> <td></td> </tr> </tbody> </table> <a id="Google_Cloud_Asset_V1_BigQueryDestination_Table_" data-uid="Google.Cloud.Asset.V1.BigQueryDestination.Table*"></a> <h3 id="Google_Cloud_Asset_V1_BigQueryDestination_Table" data-uid="Google.Cloud.Asset.V1.BigQueryDestination.Table" class="notranslate">Table</h3> <div class="codewrapper"> <pre class="prettyprint"><code>public string Table { get; set; }</code></pre> </div> <div class="markdown level1 summary"><p>Required. The BigQuery table to which the snapshot result should be written. If this table does not exist, a new table with the given name will be created.</p> </div> <strong>Property Value</strong> <table class="responsive"> <tbody> <tr> <td><strong>Type</strong></td> <td><strong>Description</strong></td> </tr> <tr> <td><span class="xref">System.String</span></td> <td></td> </tr> </tbody> </table> </article> </div> {% endverbatim %} </body> </html>
Java
' Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. Imports System.Runtime.InteropServices Imports Microsoft.CodeAnalysis.CodeGen Imports Microsoft.CodeAnalysis.VisualBasic.Symbols Namespace Microsoft.CodeAnalysis.VisualBasic Friend NotInheritable Class Rewriter Public Shared Function LowerBodyOrInitializer( method As MethodSymbol, methodOrdinal As Integer, body As BoundBlock, previousSubmissionFields As SynthesizedSubmissionFields, compilationState As TypeCompilationState, diagnostics As DiagnosticBag, ByRef lazyVariableSlotAllocator As VariableSlotAllocator, lambdaDebugInfoBuilder As ArrayBuilder(Of LambdaDebugInfo), closureDebugInfoBuilder As ArrayBuilder(Of ClosureDebugInfo), ByRef delegateRelaxationIdDispenser As Integer, <Out> ByRef stateMachineTypeOpt As StateMachineTypeSymbol, allowOmissionOfConditionalCalls As Boolean, isBodySynthesized As Boolean) As BoundBlock Debug.Assert(Not body.HasErrors) Debug.Assert(compilationState.ModuleBuilderOpt IsNot Nothing) ' performs node-specific lowering. Dim sawLambdas As Boolean Dim symbolsCapturedWithoutCopyCtor As ISet(Of Symbol) = Nothing Dim rewrittenNodes As HashSet(Of BoundNode) = Nothing Dim flags = If(allowOmissionOfConditionalCalls, LocalRewriter.RewritingFlags.AllowOmissionOfConditionalCalls, LocalRewriter.RewritingFlags.Default) Dim loweredBody = LocalRewriter.Rewrite(body, method, compilationState, previousSubmissionFields, diagnostics, rewrittenNodes, sawLambdas, symbolsCapturedWithoutCopyCtor, flags, currentMethod:=Nothing) If loweredBody.HasErrors Then Return loweredBody End If #If DEBUG Then For Each node In rewrittenNodes.ToArray If node.Kind = BoundKind.Literal Then rewrittenNodes.Remove(node) End If Next #End If If lazyVariableSlotAllocator Is Nothing Then ' synthesized lambda methods are handled in LambdaRewriter.RewriteLambdaAsMethod Debug.Assert(TypeOf method IsNot SynthesizedLambdaMethod) lazyVariableSlotAllocator = compilationState.ModuleBuilderOpt.TryCreateVariableSlotAllocator(method, method) End If ' Lowers lambda expressions into expressions that construct delegates. Dim bodyWithoutLambdas = loweredBody If sawLambdas Then bodyWithoutLambdas = LambdaRewriter.Rewrite(loweredBody, method, methodOrdinal, lambdaDebugInfoBuilder, closureDebugInfoBuilder, delegateRelaxationIdDispenser, lazyVariableSlotAllocator, compilationState, If(symbolsCapturedWithoutCopyCtor, SpecializedCollections.EmptySet(Of Symbol)), diagnostics, rewrittenNodes) End If If bodyWithoutLambdas.HasErrors Then Return bodyWithoutLambdas End If Return RewriteIteratorAndAsync(bodyWithoutLambdas, method, methodOrdinal, compilationState, diagnostics, lazyVariableSlotAllocator, stateMachineTypeOpt) End Function Friend Shared Function RewriteIteratorAndAsync(bodyWithoutLambdas As BoundBlock, method As MethodSymbol, methodOrdinal As Integer, compilationState As TypeCompilationState, diagnostics As DiagnosticBag, slotAllocatorOpt As VariableSlotAllocator, <Out> ByRef stateMachineTypeOpt As StateMachineTypeSymbol) As BoundBlock Debug.Assert(compilationState.ModuleBuilderOpt IsNot Nothing) Dim iteratorStateMachine As IteratorStateMachine = Nothing Dim bodyWithoutIterators = IteratorRewriter.Rewrite(bodyWithoutLambdas, method, methodOrdinal, slotAllocatorOpt, compilationState, diagnostics, iteratorStateMachine) If bodyWithoutIterators.HasErrors Then Return bodyWithoutIterators End If Dim asyncStateMachine As AsyncStateMachine = Nothing Dim bodyWithoutAsync = AsyncRewriter.Rewrite(bodyWithoutIterators, method, methodOrdinal, slotAllocatorOpt, compilationState, diagnostics, asyncStateMachine) Debug.Assert(iteratorStateMachine Is Nothing OrElse asyncStateMachine Is Nothing) stateMachineTypeOpt = If(iteratorStateMachine, DirectCast(asyncStateMachine, StateMachineTypeSymbol)) Return bodyWithoutAsync End Function End Class End Namespace
Java
// // Diese Datei wurde mit der JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.3.2 generiert // Siehe <a href="https://javaee.github.io/jaxb-v2/">https://javaee.github.io/jaxb-v2/</a> // Änderungen an dieser Datei gehen bei einer Neukompilierung des Quellschemas verloren. // Generiert: 2020.03.13 um 12:48:52 PM CET // package net.opengis.ows._1; import java.util.ArrayList; import java.util.List; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlSeeAlso; import javax.xml.bind.annotation.XmlType; /** * Complete reference to a remote or local resource, allowing including metadata about that resource. * * <p>Java-Klasse für ReferenceType complex type. * * <p>Das folgende Schemafragment gibt den erwarteten Content an, der in dieser Klasse enthalten ist. * * <pre> * &lt;complexType name="ReferenceType"&gt; * &lt;complexContent&gt; * &lt;extension base="{http://www.opengis.net/ows/1.1}AbstractReferenceBaseType"&gt; * &lt;sequence&gt; * &lt;element ref="{http://www.opengis.net/ows/1.1}Identifier" minOccurs="0"/&gt; * &lt;element ref="{http://www.opengis.net/ows/1.1}Abstract" maxOccurs="unbounded" minOccurs="0"/&gt; * &lt;element name="Format" type="{http://www.opengis.net/ows/1.1}MimeType" minOccurs="0"/&gt; * &lt;element ref="{http://www.opengis.net/ows/1.1}Metadata" maxOccurs="unbounded" minOccurs="0"/&gt; * &lt;/sequence&gt; * &lt;/extension&gt; * &lt;/complexContent&gt; * &lt;/complexType&gt; * </pre> * * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "ReferenceType", propOrder = { "identifier", "_abstract", "format", "metadata" }) @XmlSeeAlso({ ServiceReferenceType.class }) public class ReferenceType extends AbstractReferenceBaseType { @XmlElement(name = "Identifier") protected CodeType identifier; @XmlElement(name = "Abstract") protected List<LanguageStringType> _abstract; @XmlElement(name = "Format") protected String format; @XmlElement(name = "Metadata") protected List<MetadataType> metadata; /** * Optional unique identifier of the referenced resource. * * @return * possible object is * {@link CodeType } * */ public CodeType getIdentifier() { return identifier; } /** * Legt den Wert der identifier-Eigenschaft fest. * * @param value * allowed object is * {@link CodeType } * */ public void setIdentifier(CodeType value) { this.identifier = value; } public boolean isSetIdentifier() { return (this.identifier!= null); } /** * Gets the value of the abstract property. * * <p> * This accessor method returns a reference to the live list, * not a snapshot. Therefore any modification you make to the * returned list will be present inside the JAXB object. * This is why there is not a <CODE>set</CODE> method for the abstract property. * * <p> * For example, to add a new item, do as follows: * <pre> * getAbstract().add(newItem); * </pre> * * * <p> * Objects of the following type(s) are allowed in the list * {@link LanguageStringType } * * */ public List<LanguageStringType> getAbstract() { if (_abstract == null) { _abstract = new ArrayList<LanguageStringType>(); } return this._abstract; } public boolean isSetAbstract() { return ((this._abstract!= null)&&(!this._abstract.isEmpty())); } public void unsetAbstract() { this._abstract = null; } /** * Ruft den Wert der format-Eigenschaft ab. * * @return * possible object is * {@link String } * */ public String getFormat() { return format; } /** * Legt den Wert der format-Eigenschaft fest. * * @param value * allowed object is * {@link String } * */ public void setFormat(String value) { this.format = value; } public boolean isSetFormat() { return (this.format!= null); } /** * Optional unordered list of additional metadata about this resource. A list of optional metadata elements for this ReferenceType could be specified in the Implementation Specification for each use of this type in a specific OWS. Gets the value of the metadata property. * * <p> * This accessor method returns a reference to the live list, * not a snapshot. Therefore any modification you make to the * returned list will be present inside the JAXB object. * This is why there is not a <CODE>set</CODE> method for the metadata property. * * <p> * For example, to add a new item, do as follows: * <pre> * getMetadata().add(newItem); * </pre> * * * <p> * Objects of the following type(s) are allowed in the list * {@link MetadataType } * * */ public List<MetadataType> getMetadata() { if (metadata == null) { metadata = new ArrayList<MetadataType>(); } return this.metadata; } public boolean isSetMetadata() { return ((this.metadata!= null)&&(!this.metadata.isEmpty())); } public void unsetMetadata() { this.metadata = null; } public void setAbstract(List<LanguageStringType> value) { this._abstract = value; } public void setMetadata(List<MetadataType> value) { this.metadata = value; } }
Java
package functionalProgramming.ad_hoc import functionalProgramming.ad_hoc import org.scalatest.{FunSuite, WordSpecLike} /** * Created by yujieshui on 2017/1/7. */ class GameOfKylesTest extends WordSpecLike { import GameOfKyles._ implicit val f: (Seq[Pin]) => Set[ad_hoc.GameOfKyles.Pin] = seq2set _ "enum" must { "1" in { assert(playGame(Seq(1))) } "2" in { assert(playGame(Seq(2))) } "3" in { assert(playGame(Seq(3))) } "10" in { 1 to 10 foreach (i => assert(playGame(Seq(i)), i)) } "1,2" in { assert(playGame(Seq(1, 2))) } "1,1,1" in { val seq = Seq(1, 1, 1) assert(playGame(seq)) } "1,2,1" in { val seq = Seq(1, 2, 1) assert(playGame(seq)) } "1,3,1" in { val seq = Seq(1, 3, 1) assert(playGame(seq)) } "1,2,2" in { val seq = Seq(1, 2, 2) assert(playGame(seq)) } "n,n" in { 1 to 6 foreach (i => assert(!playGame(Seq(i, i)), i)) } "1,2,3" in { assert(!playGame(Seq(1, 2, 3))) } "2,3,4" in { assert(!playGame(Seq(2, 3, 4))) } "1,2,3,4" in { assert(playGame(Seq(1, 2, 3, 4))) } "1,2,3,4,5" in { assert(playGame(Seq(1, 2, 3, 4, 5))) } "4,4,10" in { val seq = Seq(4, 4, 10) assert(playGame(seq)) } "12,34,56" in { // val seq = Seq(12, 34, 56) // assert(playGame(seq)) } "finish" in { println(result.mkString("\n")) } } "prode" must { "10 10" in { val x = for { a <- 1 to 20 b <- 1 to 20 } yield ((a, b), playGame(Seq(a, b)),Integer toBinaryString a | b , Integer.toBinaryString(a ^ b) ) // println(x.filter(_._2 == false).map(_._1).map(_._1)) // println(x.filter(_._2 == false).map(_._1).map(_._2)) println(x.mkString("\n")) } } "test case " must { "1" in { assert(playGame(line2Seq("IIXXIIIIII"))) assert(playGame(line2Seq("IXIXI"))) assert(!playGame(line2Seq("XXIXXI"))) assert(!playGame(line2Seq("IIXII"))) assert(playGame(line2Seq("XIXIIXII"))) assert(playGame(line2Seq("IIXIII"))) assert(playGame(line2Seq("IXXXX"))) assert(playGame(line2Seq("IXIXIII"))) assert(playGame(line2Seq("XIIIXIXXIX"))) } "xx" in { assert(playGame(Seq(7, 8, 9, 10))) assert(playGame(Seq(3, 5, 5, 10))) } "3" in { val x = for { a <- 1 to 20 b <- (a + 1) to 20 if 1 to 10 forall (i => playGame(Seq(a, b, i)) == playGame(Seq(b - a, i)) ) } yield { a -> b } println(x.map { case (a, b) => s"case $a :: $b :: other => enumAll(($b-$a)+:other) " }.mkString("\n")) } "case 3" in { println((line2Seq("IIXIIIIIIIXIIIIXIXIIIXIIXIIIIXIIIXIIXXIXXIIIXIIIIXIIIXIIIIIIIXIIXIIIIIIIIIXIIXXIIIIIIIIIIIIIXIXIIIXIIXIXIXIXIIIIXIIIIIXIIXIXIIXIIIIIIIIIXIIIIIIIXIXIIIIXIXIIIIIXXXIIIIIIIIIXIIIIIIIXIIIIXIIIIXIIXI"))) // println((line2Seq("IXXIIXXIXIIIIIIIXXIIIIIIIIXIIXIIIIIIIIIIIIIIIIIIIIIIIIIIIIIXXIIXIIIIIIXXIIIXIXIXIIIXIIXIIIIXIXIIIXIXIIIIIXXXIIIIIIIIIIIIIIIIIXIXIXIIIIIIIXIIIXIXIIIIIIXIIIIIXXIIIXIIIXIIIIIIXXIXXXXIIIIIIIIIIIXIIXIXII"))) // enumAll(Seq(1, 2, 1, 7, 8, 2, 29, 2, 6, 3, 1, 1, 3, 2, 4, 1, 3, 1, 5, 17, 1, 1, 7, 3, 1, 6, 5, 3, 3, 6, 1, 11, 2, 1, 2)) playGame(Seq(1, 4, 6, 8, 11, 17, 29)) } "10 to 20" in { val l = for { a <- 10 to 20 b <- (a + 1) to 20 } yield ((a, b), playGame(Seq(a, b))) l.filter(_._2 == false).foreach(println) } } }
Java
package io.github.varvelworld.var.ioc.core.annotation.meta.factory; import io.github.varvelworld.var.ioc.core.annotation.Resource; import io.github.varvelworld.var.ioc.core.meta.ParamResourceMeta; import io.github.varvelworld.var.ioc.core.meta.factory.ParamResourceMetaFactory; import java.lang.reflect.Parameter; /** * Created by luzhonghao on 2016/12/4. */ public class AnnotationParamResourceMetaFactoryImpl implements ParamResourceMetaFactory { private final ParamResourceMeta paramResourceMeta; public AnnotationParamResourceMetaFactoryImpl(Parameter parameter) { this(parameter, parameter.getAnnotation(Resource.class)); } public AnnotationParamResourceMetaFactoryImpl(Parameter parameter, Resource annotation) { String id = annotation.value(); if(id.isEmpty()) { if(parameter.isNamePresent()){ id = parameter.getName(); } else { throw new RuntimeException("id is empty"); } } this.paramResourceMeta = new ParamResourceMeta(id); } @Override public ParamResourceMeta paramResourceMeta() { return paramResourceMeta; } }
Java
[Spiffy UI Framework](http://www.spiffyui.org) - beautiful, fast, maintainable applications with GWT and REST ================================================== Spiffy UI is a framework for calling REST from GWT. Check out [www.spiffyui.org](http://www.spiffyui.org) for a lot more information and a sample application. Building and Running Spiffy UI -------------------------------------- Spiffy UI framework is built with [Apache Ant](http://ant.apache.org/) using [Apache Ivy](http://ant.apache.org/ivy/). Once you've installed Ant go to your Spiffy UI working copy and run this command: git clone git://github.com/spiffyui/spiffyui.git cd spiffyui <ANT HOME>/ant all run This will download the required libraries, build the Spiffy UI framework, and run it with an embedded web server. It will then provide intructions for accessing the running application. For information on all the build options run: <ANT HOME>/ant -p License -------------------------------------- The Spiffy UI Framework is available under the [Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.html). Get Help -------------------------------------- If you need some help with Spiffy UI post a message on the <a href="http://groups.google.com/group/spiffy-ui">Spiffy UI Google Group</a> Get The Samples -------------------------------------- Spiffy UI hosts sample applications on the <a href="https://github.com/spiffyui/">Spiffy UI GitHub page</a>. Build Status -------------------------------------- Spiffy UI uses a continuous integration server from <a href="http://www.cloudbees.com/">CloudBees</a>. Check the status of the build on the <a href="https://spiffyui.ci.cloudbees.com/">Spiffy UI continuous integration dashboard</a>. <img src="http://web-static-cloudfront.s3.amazonaws.com/images/badges/BuiltOnDEV.png" style="float: right;" border="0">
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.camel.processor.juel; import javax.naming.Context; import org.apache.camel.ContextTestSupport; import org.apache.camel.Exchange; import org.apache.camel.InvalidPayloadException; import org.apache.camel.Message; import org.apache.camel.Processor; import org.apache.camel.builder.RouteBuilder; import org.apache.camel.util.ExchangeHelper; import org.apache.camel.util.jndi.JndiContext; import static org.apache.camel.language.juel.JuelExpression.el; /** * @version */ public class SimulatorTest extends ContextTestSupport { protected Context createJndiContext() throws Exception { JndiContext answer = new JndiContext(); answer.bind("foo", new MyBean("foo")); answer.bind("bar", new MyBean("bar")); return answer; } public void testReceivesFooResponse() throws Exception { assertRespondsWith("foo", "Bye said foo"); } public void testReceivesBarResponse() throws Exception { assertRespondsWith("bar", "Bye said bar"); } protected void assertRespondsWith(final String value, String containedText) throws InvalidPayloadException { Exchange response = template.request("direct:a", new Processor() { public void process(Exchange exchange) throws Exception { Message in = exchange.getIn(); in.setBody("answer"); in.setHeader("cheese", value); } }); assertNotNull("Should receive a response!", response); String text = ExchangeHelper.getMandatoryOutBody(response, String.class); assertStringContains(text, containedText); } protected RouteBuilder createRouteBuilder() { return new RouteBuilder() { public void configure() { // START SNIPPET: example from("direct:a"). recipientList(el("bean:${in.headers.cheese}")); // END SNIPPET: example } }; } public static class MyBean { private String value; public MyBean(String value) { this.value = value; } public String doSomething(String in) { return "Bye said " + value; } } }
Java
package com.stf.bj.app.game.players; import java.util.Random; import com.stf.bj.app.game.bj.Spot; import com.stf.bj.app.game.server.Event; import com.stf.bj.app.game.server.EventType; import com.stf.bj.app.settings.AppSettings; import com.stf.bj.app.strategy.FullStrategy; public class RealisticBot extends BasicBot { private enum InsuranceStrategy { NEVER, EVEN_MONEY_ONLY, GOOD_HANDS_ONLY, RARELY, OFTEN; } private enum PlayAbility { PERFECT, NOOB, RANDOM; } private enum BetChanging { NEVER, RANDOM; } private final InsuranceStrategy insuranceStrategy; private final PlayAbility playAbility; private final Random r; private double wager = -1.0; private final BetChanging betChanging; private boolean insurancePlay = false; private boolean calculatedInsurancePlay = false; private boolean messUpNextPlay = false; public RealisticBot(AppSettings settings, FullStrategy strategy, Random r, Spot s) { super(settings, strategy, r, s); if (r == null) { r = new Random(System.currentTimeMillis()); } this.r = r; insuranceStrategy = InsuranceStrategy.values()[r.nextInt(InsuranceStrategy.values().length)]; playAbility = PlayAbility.values()[r.nextInt(PlayAbility.values().length)]; setBaseBet(); betChanging = BetChanging.RANDOM; } @Override public void sendEvent(Event e) { super.sendEvent(e); if (e.getType() == EventType.DECK_SHUFFLED) { if (betChanging == BetChanging.RANDOM && r.nextInt(2) == 0) { wager = 5; } } } @Override public double getWager() { if (delay > 0) { delay--; return -1; } return wager; } private void setBaseBet() { int rInt = r.nextInt(12); if (rInt < 6) { wager = 5.0 * (1 + rInt); } else if (rInt < 9) { wager = 10.0; } else { wager = 5.0; } } @Override public boolean getInsurancePlay() { if (insuranceStrategy == InsuranceStrategy.NEVER) { return false; } if (!calculatedInsurancePlay) { insurancePlay = calculateInsurancePlay(); calculatedInsurancePlay = true; } return insurancePlay; } private boolean calculateInsurancePlay() { switch (insuranceStrategy) { case EVEN_MONEY_ONLY: return getHandSoftTotal(0) == 21; case GOOD_HANDS_ONLY: return getHandSoftTotal(0) > 16 + r.nextInt(3); case OFTEN: return r.nextInt(2) == 0; case RARELY: return r.nextInt(5) == 0; default: throw new IllegalStateException(); } } @Override public Play getMove(int handIndex, boolean canDouble, boolean canSplit, boolean canSurrender) { if (delay > 0) { delay--; return null; } Play play = super.getMove(handIndex, canDouble, canSplit, canSurrender); if (messUpNextPlay) { if (play != Play.SPLIT && canSplit) { play = Play.SPLIT; } else if (play != Play.DOUBLEDOWN && canSplit) { play = Play.DOUBLEDOWN; } else if (play == Play.STAND) { play = Play.HIT; } else { play = Play.STAND; } } return play; } @Override protected void reset() { super.reset(); calculatedInsurancePlay = false; int random = r.nextInt(10); if (playAbility == PlayAbility.RANDOM) { messUpNextPlay = (random < 2); } if ((random == 2 || random == 3) && betChanging == BetChanging.RANDOM) { wager += 5; } else if (random == 4 && betChanging == BetChanging.RANDOM) { if (wager > 6) { wager -= 5; } } } }
Java
package me.marcosassuncao.servsim.job; import me.marcosassuncao.servsim.profile.RangeList; import com.google.common.base.MoreObjects; /** * {@link Reservation} represents a resource reservation request * made by a customer to reserve a given number of resources * from a provider. * * @see WorkUnit * @see DefaultWorkUnit * * @author Marcos Dias de Assuncao */ public class Reservation extends DefaultWorkUnit { private long reqStartTime = WorkUnit.TIME_NOT_SET; private RangeList rangeList; /** * Creates a reservation request to start at * <code>startTime</code> and with the given duration. * @param startTime the requested start time for the reservation * @param duration the duration of the reservation * @param numResources number of required resources */ public Reservation(long startTime, long duration, int numResources) { super(duration); super.setNumReqResources(numResources); this.reqStartTime = startTime; } /** * Creates a reservation request to start at * <code>startTime</code> and with the given duration and priority * @param startTime the requested start time for the reservation * @param duration the duration of the reservation * @param numResources the number of resources to be reserved * @param priority the reservation priority */ public Reservation(long startTime, long duration, int numResources, int priority) { super(duration, priority); super.setNumReqResources(numResources); this.reqStartTime = startTime; } /** * Returns the start time requested by this reservation * @return the requested start time */ public long getRequestedStartTime() { return reqStartTime; } /** * Sets the ranges of reserved resources * @param ranges the ranges of resources allocated for the reservation * @return <code>true</code> if the ranges have been set correctly, * <code>false</code> otherwise. */ public boolean setResourceRanges(RangeList ranges) { if (this.rangeList != null) { return false; } this.rangeList = ranges; return true; } /** * Gets the ranges of reserved resources * @return the ranges of reserved resources */ public RangeList getResourceRanges() { return rangeList; } @Override public String toString() { return MoreObjects.toStringHelper(this) .add("id", getId()) .add("submission time", getSubmitTime()) .add("start time", getStartTime()) .add("finish time", getFinishTime()) .add("duration", getDuration()) .add("priority", getPriority()) .add("status", getStatus()) .add("resources", rangeList) .toString(); } }
Java
# AUTOGENERATED FILE FROM balenalib/photon-xavier-nx-alpine:3.12-run ENV NODE_VERSION 14.15.4 ENV YARN_VERSION 1.22.4 # Install dependencies RUN apk add --no-cache libgcc libstdc++ libuv \ && apk add --no-cache libssl1.0 || apk add --no-cache libssl1.1 RUN buildDeps='curl' \ && set -x \ && for key in \ 6A010C5166006599AA17F08146C2130DFD2497F5 \ ; do \ gpg --keyserver pgp.mit.edu --recv-keys "$key" || \ gpg --keyserver keyserver.pgp.com --recv-keys "$key" || \ gpg --keyserver ha.pool.sks-keyservers.net --recv-keys "$key" ; \ done \ && apk add --no-cache $buildDeps \ && curl -SLO "http://resin-packages.s3.amazonaws.com/node/v$NODE_VERSION/node-v$NODE_VERSION-linux-alpine-aarch64.tar.gz" \ && echo "93e91093748c7287665d617cca0dc2ed9c26aa95dcf9152450a7961850e6d846 node-v$NODE_VERSION-linux-alpine-aarch64.tar.gz" | sha256sum -c - \ && tar -xzf "node-v$NODE_VERSION-linux-alpine-aarch64.tar.gz" -C /usr/local --strip-components=1 \ && rm "node-v$NODE_VERSION-linux-alpine-aarch64.tar.gz" \ && curl -fSLO --compressed "https://yarnpkg.com/downloads/$YARN_VERSION/yarn-v$YARN_VERSION.tar.gz" \ && curl -fSLO --compressed "https://yarnpkg.com/downloads/$YARN_VERSION/yarn-v$YARN_VERSION.tar.gz.asc" \ && gpg --batch --verify yarn-v$YARN_VERSION.tar.gz.asc yarn-v$YARN_VERSION.tar.gz \ && mkdir -p /opt/yarn \ && tar -xzf yarn-v$YARN_VERSION.tar.gz -C /opt/yarn --strip-components=1 \ && ln -s /opt/yarn/bin/yarn /usr/local/bin/yarn \ && ln -s /opt/yarn/bin/yarn /usr/local/bin/yarnpkg \ && rm yarn-v$YARN_VERSION.tar.gz.asc yarn-v$YARN_VERSION.tar.gz \ && npm config set unsafe-perm true -g --unsafe-perm \ && rm -rf /tmp/* CMD ["echo","'No CMD command was set in Dockerfile! Details about CMD command could be found in Dockerfile Guide section in our Docs. Here's the link: https://balena.io/docs"] RUN curl -SLO "https://raw.githubusercontent.com/balena-io-library/base-images/8accad6af708fca7271c5c65f18a86782e19f877/scripts/assets/tests/test-stack@node.sh" \ && echo "Running test-stack@node" \ && chmod +x test-stack@node.sh \ && bash test-stack@node.sh \ && rm -rf test-stack@node.sh RUN [ ! -d /.balena/messages ] && mkdir -p /.balena/messages; echo $'Here are a few details about this Docker image (For more information please visit https://www.balena.io/docs/reference/base-images/base-images/): \nArchitecture: ARM v8 \nOS: Alpine Linux 3.12 \nVariant: run variant \nDefault variable(s): UDEV=off \nThe following software stack is preinstalled: \nNode.js v14.15.4, Yarn v1.22.4 \nExtra features: \n- Easy way to install packages with `install_packages <package-name>` command \n- Run anywhere with cross-build feature (for ARM only) \n- Keep the container idling with `balena-idle` command \n- Show base image details with `balena-info` command' > /.balena/messages/image-info RUN echo $'#!/bin/bash\nbalena-info\nbusybox ln -sf /bin/busybox /bin/sh\n/bin/sh "$@"' > /bin/sh-shim \ && chmod +x /bin/sh-shim \ && ln -f /bin/sh /bin/sh.real \ && ln -f /bin/sh-shim /bin/sh
Java
# AUTOGENERATED FILE FROM balenalib/surface-pro-6-fedora:31-build ENV NODE_VERSION 14.15.4 ENV YARN_VERSION 1.22.4 RUN for key in \ 6A010C5166006599AA17F08146C2130DFD2497F5 \ ; do \ gpg --keyserver pgp.mit.edu --recv-keys "$key" || \ gpg --keyserver keyserver.pgp.com --recv-keys "$key" || \ gpg --keyserver ha.pool.sks-keyservers.net --recv-keys "$key" ; \ done \ && curl -SLO "http://nodejs.org/dist/v$NODE_VERSION/node-v$NODE_VERSION-linux-x64.tar.gz" \ && echo "b51c033d40246cd26e52978125a3687df5cd02ee532e8614feff0ba6c13a774f node-v$NODE_VERSION-linux-x64.tar.gz" | sha256sum -c - \ && tar -xzf "node-v$NODE_VERSION-linux-x64.tar.gz" -C /usr/local --strip-components=1 \ && rm "node-v$NODE_VERSION-linux-x64.tar.gz" \ && curl -fSLO --compressed "https://yarnpkg.com/downloads/$YARN_VERSION/yarn-v$YARN_VERSION.tar.gz" \ && curl -fSLO --compressed "https://yarnpkg.com/downloads/$YARN_VERSION/yarn-v$YARN_VERSION.tar.gz.asc" \ && gpg --batch --verify yarn-v$YARN_VERSION.tar.gz.asc yarn-v$YARN_VERSION.tar.gz \ && mkdir -p /opt/yarn \ && tar -xzf yarn-v$YARN_VERSION.tar.gz -C /opt/yarn --strip-components=1 \ && ln -s /opt/yarn/bin/yarn /usr/local/bin/yarn \ && ln -s /opt/yarn/bin/yarn /usr/local/bin/yarnpkg \ && rm yarn-v$YARN_VERSION.tar.gz.asc yarn-v$YARN_VERSION.tar.gz \ && npm config set unsafe-perm true -g --unsafe-perm \ && rm -rf /tmp/* CMD ["echo","'No CMD command was set in Dockerfile! Details about CMD command could be found in Dockerfile Guide section in our Docs. Here's the link: https://balena.io/docs"] RUN curl -SLO "https://raw.githubusercontent.com/balena-io-library/base-images/8accad6af708fca7271c5c65f18a86782e19f877/scripts/assets/tests/test-stack@node.sh" \ && echo "Running test-stack@node" \ && chmod +x test-stack@node.sh \ && bash test-stack@node.sh \ && rm -rf test-stack@node.sh RUN [ ! -d /.balena/messages ] && mkdir -p /.balena/messages; echo $'Here are a few details about this Docker image (For more information please visit https://www.balena.io/docs/reference/base-images/base-images/): \nArchitecture: Intel 64-bit (x86-64) \nOS: Fedora 31 \nVariant: build variant \nDefault variable(s): UDEV=off \nThe following software stack is preinstalled: \nNode.js v14.15.4, Yarn v1.22.4 \nExtra features: \n- Easy way to install packages with `install_packages <package-name>` command \n- Run anywhere with cross-build feature (for ARM only) \n- Keep the container idling with `balena-idle` command \n- Show base image details with `balena-info` command' > /.balena/messages/image-info RUN echo $'#!/bin/sh.real\nbalena-info\nrm -f /bin/sh\ncp /bin/sh.real /bin/sh\n/bin/sh "$@"' > /bin/sh-shim \ && chmod +x /bin/sh-shim \ && cp /bin/sh /bin/sh.real \ && mv /bin/sh-shim /bin/sh
Java
/* * Copyright (c) 2016, baihw (javakf@163.com). * * 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.yoya.rdf.router; /** * Created by baihw on 16-6-13. * * 统一的服务请求处理器规范接口,此接口用于标识类文件为请求处理器实现类,无必须实现的方法。 * * 实现类中所有符合public void xxx( IRequest request, IResponse response )签名规则的方法都将被自动注册到对应的请求处理器中。 * * 如下所示: * * public void login( IRequest request, IResponse response ){}; * * public void logout( IRequest request, IResponse response ){} ; * * 上边的login, logout将被自动注册到请求处理器路径中。 * * 假如类名为LoginHnadler, 则注册的处理路径为:/Loginhandler/login, /Loginhandler/logout. * * 注意:大小写敏感。 * */ public interface IRequestHandler{ /** * 当请求中没有明确指定处理方法时,默认执行的请求处理方法。 * * @param request 请求对象 * @param response 响应对象 */ void handle( IRequest request, IResponse response ); } // end class
Java
(function() { 'use strict'; angular .module('sentryApp') .controller('TimeFrameController', TimeFrameController); TimeFrameController.$inject = ['$scope', '$state', 'TimeFrame', 'ParseLinks', 'AlertService', 'paginationConstants', 'pagingParams']; function TimeFrameController ($scope, $state, TimeFrame, ParseLinks, AlertService, paginationConstants, pagingParams) { var vm = this; vm.loadPage = loadPage; vm.predicate = pagingParams.predicate; vm.reverse = pagingParams.ascending; vm.transition = transition; vm.itemsPerPage = paginationConstants.itemsPerPage; loadAll(); function loadAll () { TimeFrame.query({ page: pagingParams.page - 1, size: vm.itemsPerPage, sort: sort() }, onSuccess, onError); function sort() { var result = [vm.predicate + ',' + (vm.reverse ? 'asc' : 'desc')]; if (vm.predicate !== 'id') { result.push('id'); } return result; } function onSuccess(data, headers) { vm.links = ParseLinks.parse(headers('link')); vm.totalItems = headers('X-Total-Count'); vm.queryCount = vm.totalItems; vm.timeFrames = data; vm.page = pagingParams.page; } function onError(error) { AlertService.error(error.data.message); } } function loadPage(page) { vm.page = page; vm.transition(); } function transition() { $state.transitionTo($state.$current, { page: vm.page, sort: vm.predicate + ',' + (vm.reverse ? 'asc' : 'desc'), search: vm.currentSearch }); } } })();
Java
/* * Copyright 2010-2020 Alfresco Software, Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.activiti.spring.test.servicetask; import static org.assertj.core.api.Assertions.assertThat; import java.util.List; import org.activiti.engine.impl.test.JobTestHelper; import org.activiti.engine.runtime.ProcessInstance; import org.activiti.engine.test.Deployment; import org.activiti.spring.impl.test.SpringActivitiTestCase; import org.springframework.test.context.ContextConfiguration; /** */ @ContextConfiguration("classpath:org/activiti/spring/test/servicetask/servicetaskSpringTest-context.xml") public class ServiceTaskSpringDelegationTest extends SpringActivitiTestCase { private void cleanUp() { List<org.activiti.engine.repository.Deployment> deployments = repositoryService.createDeploymentQuery().list(); for (org.activiti.engine.repository.Deployment deployment : deployments) { repositoryService.deleteDeployment(deployment.getId(), true); } } @Override public void tearDown() { cleanUp(); } @Deployment public void testDelegateExpression() { ProcessInstance procInst = runtimeService.startProcessInstanceByKey("delegateExpressionToSpringBean"); assertThat(runtimeService.getVariable(procInst.getId(), "myVar")).isEqualTo("Activiti BPMN 2.0 process engine"); assertThat(runtimeService.getVariable(procInst.getId(), "fieldInjection")).isEqualTo("fieldInjectionWorking"); } @Deployment public void testAsyncDelegateExpression() throws Exception { ProcessInstance procInst = runtimeService.startProcessInstanceByKey("delegateExpressionToSpringBean"); assertThat(JobTestHelper.areJobsAvailable(managementService)).isTrue(); waitForJobExecutorToProcessAllJobs(5000, 500); Thread.sleep(1000); assertThat(runtimeService.getVariable(procInst.getId(), "myVar")).isEqualTo("Activiti BPMN 2.0 process engine"); assertThat(runtimeService.getVariable(procInst.getId(), "fieldInjection")).isEqualTo("fieldInjectionWorking"); } @Deployment public void testMethodExpressionOnSpringBean() { ProcessInstance procInst = runtimeService.startProcessInstanceByKey("methodExpressionOnSpringBean"); assertThat(runtimeService.getVariable(procInst.getId(), "myVar")).isEqualTo("ACTIVITI BPMN 2.0 PROCESS ENGINE"); } @Deployment public void testAsyncMethodExpressionOnSpringBean() { ProcessInstance procInst = runtimeService.startProcessInstanceByKey("methodExpressionOnSpringBean"); assertThat(JobTestHelper.areJobsAvailable(managementService)).isTrue(); waitForJobExecutorToProcessAllJobs(5000, 500); assertThat(runtimeService.getVariable(procInst.getId(), "myVar")).isEqualTo("ACTIVITI BPMN 2.0 PROCESS ENGINE"); } @Deployment public void testExecutionAndTaskListenerDelegationExpression() { ProcessInstance processInstance = runtimeService.startProcessInstanceByKey("executionAndTaskListenerDelegation"); assertThat(runtimeService.getVariable(processInstance.getId(), "executionListenerVar")).isEqualTo("working"); assertThat(runtimeService.getVariable(processInstance.getId(), "taskListenerVar")).isEqualTo("working"); assertThat(runtimeService.getVariable(processInstance.getId(), "executionListenerField")).isEqualTo("executionListenerInjection"); assertThat(runtimeService.getVariable(processInstance.getId(), "taskListenerField")).isEqualTo("taskListenerInjection"); } }
Java
/** * <copyright> * </copyright> * * $Id$ */ package de.hub.clickwatch.specificmodels.brn.sys_info_systeminfo.impl; import org.eclipse.emf.common.notify.Notification; import org.eclipse.emf.common.notify.NotificationChain; import org.eclipse.emf.ecore.EClass; import org.eclipse.emf.ecore.InternalEObject; import org.eclipse.emf.ecore.impl.ENotificationImpl; import org.eclipse.emf.ecore.impl.EObjectImpl; import org.eclipse.emf.ecore.util.EcoreUtil; import de.hub.clickwatch.specificmodels.brn.sys_info_systeminfo.Cpu_usage; import de.hub.clickwatch.specificmodels.brn.sys_info_systeminfo.Sys_info_systeminfoPackage; /** * <!-- begin-user-doc --> * An implementation of the model object '<em><b>Cpu usage</b></em>'. * <!-- end-user-doc --> * <p> * The following features are implemented: * <ul> * <li>{@link de.hub.clickwatch.specificmodels.brn.sys_info_systeminfo.impl.Cpu_usageImpl#getEContainer_cpu_usage <em>EContainer cpu usage</em>}</li> * <li>{@link de.hub.clickwatch.specificmodels.brn.sys_info_systeminfo.impl.Cpu_usageImpl#getReal <em>Real</em>}</li> * <li>{@link de.hub.clickwatch.specificmodels.brn.sys_info_systeminfo.impl.Cpu_usageImpl#getUser <em>User</em>}</li> * <li>{@link de.hub.clickwatch.specificmodels.brn.sys_info_systeminfo.impl.Cpu_usageImpl#getSys <em>Sys</em>}</li> * <li>{@link de.hub.clickwatch.specificmodels.brn.sys_info_systeminfo.impl.Cpu_usageImpl#getUnit <em>Unit</em>}</li> * </ul> * </p> * * @generated */ public class Cpu_usageImpl extends EObjectImpl implements Cpu_usage { /** * The default value of the '{@link #getReal() <em>Real</em>}' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @see #getReal() * @generated * @ordered */ protected static final double REAL_EDEFAULT = 0.0; /** * The cached value of the '{@link #getReal() <em>Real</em>}' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @see #getReal() * @generated * @ordered */ protected double real = REAL_EDEFAULT; /** * The default value of the '{@link #getUser() <em>User</em>}' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @see #getUser() * @generated * @ordered */ protected static final double USER_EDEFAULT = 0.0; /** * The cached value of the '{@link #getUser() <em>User</em>}' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @see #getUser() * @generated * @ordered */ protected double user = USER_EDEFAULT; /** * The default value of the '{@link #getSys() <em>Sys</em>}' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @see #getSys() * @generated * @ordered */ protected static final double SYS_EDEFAULT = 0.0; /** * The cached value of the '{@link #getSys() <em>Sys</em>}' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @see #getSys() * @generated * @ordered */ protected double sys = SYS_EDEFAULT; /** * The default value of the '{@link #getUnit() <em>Unit</em>}' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @see #getUnit() * @generated * @ordered */ protected static final String UNIT_EDEFAULT = null; /** * The cached value of the '{@link #getUnit() <em>Unit</em>}' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @see #getUnit() * @generated * @ordered */ protected String unit = UNIT_EDEFAULT; /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ protected Cpu_usageImpl() { super(); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override protected EClass eStaticClass() { return Sys_info_systeminfoPackage.Literals.CPU_USAGE; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public de.hub.clickwatch.specificmodels.brn.sys_info_systeminfo.System getEContainer_cpu_usage() { if (eContainerFeatureID() != Sys_info_systeminfoPackage.CPU_USAGE__ECONTAINER_CPU_USAGE) return null; return (de.hub.clickwatch.specificmodels.brn.sys_info_systeminfo.System)eContainer(); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public NotificationChain basicSetEContainer_cpu_usage(de.hub.clickwatch.specificmodels.brn.sys_info_systeminfo.System newEContainer_cpu_usage, NotificationChain msgs) { msgs = eBasicSetContainer((InternalEObject)newEContainer_cpu_usage, Sys_info_systeminfoPackage.CPU_USAGE__ECONTAINER_CPU_USAGE, msgs); return msgs; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public void setEContainer_cpu_usage(de.hub.clickwatch.specificmodels.brn.sys_info_systeminfo.System newEContainer_cpu_usage) { if (newEContainer_cpu_usage != eInternalContainer() || (eContainerFeatureID() != Sys_info_systeminfoPackage.CPU_USAGE__ECONTAINER_CPU_USAGE && newEContainer_cpu_usage != null)) { if (EcoreUtil.isAncestor(this, newEContainer_cpu_usage)) throw new IllegalArgumentException("Recursive containment not allowed for " + toString()); NotificationChain msgs = null; if (eInternalContainer() != null) msgs = eBasicRemoveFromContainer(msgs); if (newEContainer_cpu_usage != null) msgs = ((InternalEObject)newEContainer_cpu_usage).eInverseAdd(this, Sys_info_systeminfoPackage.SYSTEM__CPU_USAGE, de.hub.clickwatch.specificmodels.brn.sys_info_systeminfo.System.class, msgs); msgs = basicSetEContainer_cpu_usage(newEContainer_cpu_usage, msgs); if (msgs != null) msgs.dispatch(); } else if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.SET, Sys_info_systeminfoPackage.CPU_USAGE__ECONTAINER_CPU_USAGE, newEContainer_cpu_usage, newEContainer_cpu_usage)); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public double getReal() { return real; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public void setReal(double newReal) { double oldReal = real; real = newReal; if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.SET, Sys_info_systeminfoPackage.CPU_USAGE__REAL, oldReal, real)); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public double getUser() { return user; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public void setUser(double newUser) { double oldUser = user; user = newUser; if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.SET, Sys_info_systeminfoPackage.CPU_USAGE__USER, oldUser, user)); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public double getSys() { return sys; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public void setSys(double newSys) { double oldSys = sys; sys = newSys; if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.SET, Sys_info_systeminfoPackage.CPU_USAGE__SYS, oldSys, sys)); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public String getUnit() { return unit; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public void setUnit(String newUnit) { String oldUnit = unit; unit = newUnit; if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.SET, Sys_info_systeminfoPackage.CPU_USAGE__UNIT, oldUnit, unit)); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public NotificationChain eInverseAdd(InternalEObject otherEnd, int featureID, NotificationChain msgs) { switch (featureID) { case Sys_info_systeminfoPackage.CPU_USAGE__ECONTAINER_CPU_USAGE: if (eInternalContainer() != null) msgs = eBasicRemoveFromContainer(msgs); return basicSetEContainer_cpu_usage((de.hub.clickwatch.specificmodels.brn.sys_info_systeminfo.System)otherEnd, msgs); } return super.eInverseAdd(otherEnd, featureID, msgs); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { switch (featureID) { case Sys_info_systeminfoPackage.CPU_USAGE__ECONTAINER_CPU_USAGE: return basicSetEContainer_cpu_usage(null, msgs); } return super.eInverseRemove(otherEnd, featureID, msgs); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public NotificationChain eBasicRemoveFromContainerFeature(NotificationChain msgs) { switch (eContainerFeatureID()) { case Sys_info_systeminfoPackage.CPU_USAGE__ECONTAINER_CPU_USAGE: return eInternalContainer().eInverseRemove(this, Sys_info_systeminfoPackage.SYSTEM__CPU_USAGE, de.hub.clickwatch.specificmodels.brn.sys_info_systeminfo.System.class, msgs); } return super.eBasicRemoveFromContainerFeature(msgs); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public Object eGet(int featureID, boolean resolve, boolean coreType) { switch (featureID) { case Sys_info_systeminfoPackage.CPU_USAGE__ECONTAINER_CPU_USAGE: return getEContainer_cpu_usage(); case Sys_info_systeminfoPackage.CPU_USAGE__REAL: return getReal(); case Sys_info_systeminfoPackage.CPU_USAGE__USER: return getUser(); case Sys_info_systeminfoPackage.CPU_USAGE__SYS: return getSys(); case Sys_info_systeminfoPackage.CPU_USAGE__UNIT: return getUnit(); } return super.eGet(featureID, resolve, coreType); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public void eSet(int featureID, Object newValue) { switch (featureID) { case Sys_info_systeminfoPackage.CPU_USAGE__ECONTAINER_CPU_USAGE: setEContainer_cpu_usage((de.hub.clickwatch.specificmodels.brn.sys_info_systeminfo.System)newValue); return; case Sys_info_systeminfoPackage.CPU_USAGE__REAL: setReal((Double)newValue); return; case Sys_info_systeminfoPackage.CPU_USAGE__USER: setUser((Double)newValue); return; case Sys_info_systeminfoPackage.CPU_USAGE__SYS: setSys((Double)newValue); return; case Sys_info_systeminfoPackage.CPU_USAGE__UNIT: setUnit((String)newValue); return; } super.eSet(featureID, newValue); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public void eUnset(int featureID) { switch (featureID) { case Sys_info_systeminfoPackage.CPU_USAGE__ECONTAINER_CPU_USAGE: setEContainer_cpu_usage((de.hub.clickwatch.specificmodels.brn.sys_info_systeminfo.System)null); return; case Sys_info_systeminfoPackage.CPU_USAGE__REAL: setReal(REAL_EDEFAULT); return; case Sys_info_systeminfoPackage.CPU_USAGE__USER: setUser(USER_EDEFAULT); return; case Sys_info_systeminfoPackage.CPU_USAGE__SYS: setSys(SYS_EDEFAULT); return; case Sys_info_systeminfoPackage.CPU_USAGE__UNIT: setUnit(UNIT_EDEFAULT); return; } super.eUnset(featureID); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public boolean eIsSet(int featureID) { switch (featureID) { case Sys_info_systeminfoPackage.CPU_USAGE__ECONTAINER_CPU_USAGE: return getEContainer_cpu_usage() != null; case Sys_info_systeminfoPackage.CPU_USAGE__REAL: return real != REAL_EDEFAULT; case Sys_info_systeminfoPackage.CPU_USAGE__USER: return user != USER_EDEFAULT; case Sys_info_systeminfoPackage.CPU_USAGE__SYS: return sys != SYS_EDEFAULT; case Sys_info_systeminfoPackage.CPU_USAGE__UNIT: return UNIT_EDEFAULT == null ? unit != null : !UNIT_EDEFAULT.equals(unit); } return super.eIsSet(featureID); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public String toString() { if (eIsProxy()) return super.toString(); StringBuffer result = new StringBuffer(super.toString()); result.append(" (real: "); result.append(real); result.append(", user: "); result.append(user); result.append(", sys: "); result.append(sys); result.append(", unit: "); result.append(unit); result.append(')'); return result.toString(); } } //Cpu_usageImpl
Java
<!doctype html public "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd"> <html> <head> <title>PHPXRef 0.7.1 : Unnamed Project : /tests/simpletest/docs/fr/web_tester_documentation.html source</title> <link rel="stylesheet" href="../../../../sample.css" type="text/css"> <link rel="stylesheet" href="../../../../sample-print.css" type="text/css" media="print"> <style id="hilight" type="text/css"></style> <meta http-equiv="content-type" content="text/html;charset=iso-8859-1"> </head> <body bgcolor="#ffffff" text="#000000" link="#801800" vlink="#300540" alink="#ffffff"> <table class="pagetitle" width="100%"> <tr> <td valign="top" class="pagetitle"> [ <a href="../../../../index.html">Index</a> ] </td> <td align="right" class="pagetitle"> <h2 style="margin-bottom: 0px">PHP Cross Reference of Unnamed Project</h2> </td> </tr> </table> <!-- Generated by PHPXref 0.7.1 at Thu Oct 23 18:57:41 2014 --> <!-- PHPXref (c) 2000-2010 Gareth Watts - gareth@omnipotent.net --> <!-- http://phpxref.sourceforge.net/ --> <script src="../../../../phpxref.js" type="text/javascript"></script> <script language="JavaScript" type="text/javascript"> <!-- ext='.html'; relbase='../../../../'; subdir='tests/simpletest/docs/fr'; filename='web_tester_documentation.html.source.html'; cookiekey='phpxref'; handleNavFrame(relbase, subdir, filename); // --> </script> <script language="JavaScript" type="text/javascript"> if (gwGetCookie('xrefnav')=='off') document.write('<p class="navlinks">[ <a href="javascript:navOn()">Show Explorer<\/a> ]<\/p>'); else document.write('<p class="navlinks">[ <a href="javascript:navOff()">Hide Explorer<\/a> ]<\/p>'); </script> <noscript> <p class="navlinks"> [ <a href="../../../../nav.html" target="_top">Show Explorer</a> ] [ <a href="index.html" target="_top">Hide Navbar</a> ] </p> </noscript> <script language="JavaScript" type="text/javascript"> <!-- document.writeln('<table align="right" class="searchbox-link"><tr><td><a class="searchbox-link" href="javascript:void(0)" onMouseOver="showSearchBox()">Search</a><br>'); document.writeln('<table border="0" cellspacing="0" cellpadding="0" class="searchbox" id="searchbox">'); document.writeln('<tr><td class="searchbox-title">'); document.writeln('<a class="searchbox-title" href="javascript:showSearchPopup()">Search History +</a>'); document.writeln('<\/td><\/tr>'); document.writeln('<tr><td class="searchbox-body" id="searchbox-body">'); document.writeln('<form name="search" style="margin:0px; padding:0px" onSubmit=\'return jump()\'>'); document.writeln('<a class="searchbox-body" href="../../../../_classes/index.html">Class<\/a>: '); document.writeln('<input type="text" size=10 value="" name="classname"><br>'); document.writeln('<a id="funcsearchlink" class="searchbox-body" href="../../../../_functions/index.html">Function<\/a>: '); document.writeln('<input type="text" size=10 value="" name="funcname"><br>'); document.writeln('<a class="searchbox-body" href="../../../../_variables/index.html">Variable<\/a>: '); document.writeln('<input type="text" size=10 value="" name="varname"><br>'); document.writeln('<a class="searchbox-body" href="../../../../_constants/index.html">Constant<\/a>: '); document.writeln('<input type="text" size=10 value="" name="constname"><br>'); document.writeln('<a class="searchbox-body" href="../../../../_tables/index.html">Table<\/a>: '); document.writeln('<input type="text" size=10 value="" name="tablename"><br>'); document.writeln('<input type="submit" class="searchbox-button" value="Search">'); document.writeln('<\/form>'); document.writeln('<\/td><\/tr><\/table>'); document.writeln('<\/td><\/tr><\/table>'); // --> </script> <div id="search-popup" class="searchpopup"><p id="searchpopup-title" class="searchpopup-title">title</p><div id="searchpopup-body" class="searchpopup-body">Body</div><p class="searchpopup-close"><a href="javascript:gwCloseActive()">[close]</a></p></div> <h2 class="listing-heading"><a href="./index.html">/tests/simpletest/docs/fr/</a> -> <a href="web_tester_documentation.html.html">web_tester_documentation.html</a> (source)</h2> <div class="listing"> <p class="viewlinks">[<a href="web_tester_documentation.html.html">Summary view</a>] [<a href="javascript:window.print();">Print</a>] [<a href="web_tester_documentation.html.source.txt" target="_new">Text view</a>] </p> <pre> <a name="l1"><span class="linenum"> 1</span></a> &lt;html&gt; <a name="l2"><span class="linenum"> 2</span></a> &lt;head&gt; <a name="l3"><span class="linenum"> 3</span></a> &lt;meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=UTF-8&quot;&gt; <a name="l4"><span class="linenum"> 4</span></a> &lt;title&gt;Documentation SimpleTest : tester des scripts web&lt;/title&gt; <a name="l5"><span class="linenum"> 5</span></a> &lt;link rel=&quot;stylesheet&quot; type=&quot;text/css&quot; href=&quot;docs.css&quot; title=&quot;Styles&quot;&gt; <a name="l6"><span class="linenum"> 6</span></a> &lt;/head&gt; <a name="l7"><span class="linenum"> 7</span></a> &lt;body&gt; <a name="l8"><span class="linenum"> 8</span></a> &lt;div class=&quot;menu_back&quot;&gt;&lt;div class=&quot;menu&quot;&gt; <a name="l9"><span class="linenum"> 9</span></a> &lt;a href=&quot;index.html&quot;&gt;SimpleTest&lt;/a&gt; <a name="l10"><span class="linenum"> 10</span></a> | <a name="l11"><span class="linenum"> 11</span></a> &lt;a href=&quot;overview.html&quot;&gt;Overview&lt;/a&gt; <a name="l12"><span class="linenum"> 12</span></a> | <a name="l13"><span class="linenum"> 13</span></a> &lt;a href=&quot;unit_test_documentation.html&quot;&gt;Unit tester&lt;/a&gt; <a name="l14"><span class="linenum"> 14</span></a> | <a name="l15"><span class="linenum"> 15</span></a> &lt;a href=&quot;group_test_documentation.html&quot;&gt;Group tests&lt;/a&gt; <a name="l16"><span class="linenum"> 16</span></a> | <a name="l17"><span class="linenum"> 17</span></a> &lt;a href=&quot;mock_objects_documentation.html&quot;&gt;Mock objects&lt;/a&gt; <a name="l18"><span class="linenum"> 18</span></a> | <a name="l19"><span class="linenum"> 19</span></a> &lt;a href=&quot;partial_mocks_documentation.html&quot;&gt;Partial mocks&lt;/a&gt; <a name="l20"><span class="linenum"> 20</span></a> | <a name="l21"><span class="linenum"> 21</span></a> &lt;a href=&quot;reporter_documentation.html&quot;&gt;Reporting&lt;/a&gt; <a name="l22"><span class="linenum"> 22</span></a> | <a name="l23"><span class="linenum"> 23</span></a> &lt;a href=&quot;expectation_documentation.html&quot;&gt;Expectations&lt;/a&gt; <a name="l24"><span class="linenum"> 24</span></a> | <a name="l25"><span class="linenum"> 25</span></a> &lt;a href=&quot;web_tester_documentation.html&quot;&gt;Web tester&lt;/a&gt; <a name="l26"><span class="linenum"> 26</span></a> | <a name="l27"><span class="linenum"> 27</span></a> &lt;a href=&quot;form_testing_documentation.html&quot;&gt;Testing forms&lt;/a&gt; <a name="l28"><span class="linenum"> 28</span></a> | <a name="l29"><span class="linenum"> 29</span></a> &lt;a href=&quot;authentication_documentation.html&quot;&gt;Authentication&lt;/a&gt; <a name="l30"><span class="linenum"> 30</span></a> | <a name="l31"><span class="linenum"> 31</span></a> &lt;a href=&quot;browser_documentation.html&quot;&gt;Scriptable browser&lt;/a&gt; <a name="l32"><span class="linenum"> 32</span></a> &lt;/div&gt;&lt;/div&gt; <a name="l33"><span class="linenum"> 33</span></a> &lt;h1&gt;Documentation sur le testeur web&lt;/h1&gt; <a name="l34"><span class="linenum"> 34</span></a> This page... <a name="l35"><span class="linenum"> 35</span></a> &lt;ul&gt; <a name="l36"><span class="linenum"> 36</span></a> &lt;li&gt; <a name="l37"><span class="linenum"> 37</span></a> Réussir à &lt;a href=&quot;#telecharger&quot;&gt;télécharger une page web&lt;/a&gt; <a name="l38"><span class="linenum"> 38</span></a> &lt;/li&gt; <a name="l39"><span class="linenum"> 39</span></a> &lt;li&gt; <a name="l40"><span class="linenum"> 40</span></a> Tester le &lt;a href=&quot;#contenu&quot;&gt;contenu de la page&lt;/a&gt; <a name="l41"><span class="linenum"> 41</span></a> &lt;/li&gt; <a name="l42"><span class="linenum"> 42</span></a> &lt;li&gt; <a name="l43"><span class="linenum"> 43</span></a> &lt;a href=&quot;#navigation&quot;&gt;Naviguer sur un site web&lt;/a&gt; pendant le test <a name="l44"><span class="linenum"> 44</span></a> &lt;/li&gt; <a name="l45"><span class="linenum"> 45</span></a> &lt;li&gt; <a name="l46"><span class="linenum"> 46</span></a> Méthodes pour &lt;a href=&quot;#requete&quot;&gt;modifier une requête&lt;/a&gt; et pour déboguer <a name="l47"><span class="linenum"> 47</span></a> &lt;/li&gt; <a name="l48"><span class="linenum"> 48</span></a> &lt;/ul&gt; <a name="l49"><span class="linenum"> 49</span></a> &lt;div class=&quot;content&quot;&gt; <a name="l50"><span class="linenum"> 50</span></a> &lt;h2&gt; <a name="l51"><span class="linenum"> 51</span></a> &lt;a class=&quot;target&quot; name=&quot;telecharger&quot;&gt;&lt;/a&gt;Télécharger une page&lt;/h2&gt; <a name="l52"><span class="linenum"> 52</span></a> &lt;p&gt; <a name="l53"><span class="linenum"> 53</span></a> Tester des classes c'est très bien. <a name="l54"><span class="linenum"> 54</span></a> Reste que PHP est avant tout un langage <a name="l55"><span class="linenum"> 55</span></a> pour créer des fonctionnalités à l'intérieur de pages web. <a name="l56"><span class="linenum"> 56</span></a> Comment pouvons tester la partie de devant <a name="l57"><span class="linenum"> 57</span></a> -- celle de l'interface -- dans nos applications en PHP ? <a name="l58"><span class="linenum"> 58</span></a> Etant donné qu'une page web n'est constituée que de texte, <a name="l59"><span class="linenum"> 59</span></a> nous devrions pouvoir les examiner exactement <a name="l60"><span class="linenum"> 60</span></a> comme n'importe quelle autre donnée de test. <a name="l61"><span class="linenum"> 61</span></a> &lt;/p&gt; <a name="l62"><span class="linenum"> 62</span></a> &lt;p&gt; <a name="l63"><span class="linenum"> 63</span></a> Cela nous amène à une situation délicate. <a name="l64"><span class="linenum"> 64</span></a> Si nous testons dans un niveau trop bas, <a name="l65"><span class="linenum"> 65</span></a> vérifier des balises avec un motif ad hoc par exemple, <a name="l66"><span class="linenum"> 66</span></a> nos tests seront trop fragiles. Le moindre changement <a name="l67"><span class="linenum"> 67</span></a> dans la présentation pourrait casser un grand nombre de test. <a name="l68"><span class="linenum"> 68</span></a> Si nos tests sont situés trop haut, en utilisant <a name="l69"><span class="linenum"> 69</span></a> une version fantaisie du moteur de template pour <a name="l70"><span class="linenum"> 70</span></a> donner un cas précis, alors nous perdons complètement <a name="l71"><span class="linenum"> 71</span></a> la capacité à automatiser certaines classes de test. <a name="l72"><span class="linenum"> 72</span></a> Par exemple, l'interaction entre des formulaires <a name="l73"><span class="linenum"> 73</span></a> et la navigation devra être testé manuellement. <a name="l74"><span class="linenum"> 74</span></a> Ces types de test sont extrêmement fastidieux <a name="l75"><span class="linenum"> 75</span></a> et plutôt sensibles aux erreurs. <a name="l76"><span class="linenum"> 76</span></a> &lt;/p&gt; <a name="l77"><span class="linenum"> 77</span></a> &lt;p&gt; <a name="l78"><span class="linenum"> 78</span></a> SimpleTest comprend une forme spéciale de scénario <a name="l79"><span class="linenum"> 79</span></a> de test pour tester les actions d'une page web. <a name="l80"><span class="linenum"> 80</span></a> &lt;span class=&quot;new_code&quot;&gt;WebTestCase&lt;/span&gt; inclut des facilités pour la navigation, <a name="l81"><span class="linenum"> 81</span></a> des vérifications sur le contenu <a name="l82"><span class="linenum"> 82</span></a> et les cookies ainsi que la gestion des formulaires. <a name="l83"><span class="linenum"> 83</span></a> Utiliser ces scénarios de test ressemble <a name="l84"><span class="linenum"> 84</span></a> fortement à &lt;span class=&quot;new_code&quot;&gt;UnitTestCase&lt;/span&gt;... <a name="l85"><span class="linenum"> 85</span></a> &lt;pre&gt; <a name="l86"><span class="linenum"> 86</span></a> &lt;strong&gt;<span class="keyword">class </span><a class="class" onClick="logClass('TestOfLastcraft')" href="../../../../_classes/testoflastcraft.html" onMouseOver="classPopup(event,'testoflastcraft')">TestOfLastcraft</a> <span class="keyword">extends</span> <a class="class" onClick="logClass('WebTestCase')" href="../../../../_classes/webtestcase.html" onMouseOver="classPopup(event,'webtestcase')">WebTestCase</a> { <a name="l87"><span class="linenum"> 87</span></a> }&lt;/strong&gt; <a name="l88"><span class="linenum"> 88</span></a> &lt;/pre&gt; <a name="l89"><span class="linenum"> 89</span></a> Ici nous sommes sur le point de tester <a name="l90"><span class="linenum"> 90</span></a> le site de &lt;a href=&quot;http://www.lastcraft.com/&quot;&gt;Last Craft&lt;/a&gt;. <a name="l91"><span class="linenum"> 91</span></a> Si ce scénario de test est situé dans un fichier appelé <a name="l92"><span class="linenum"> 92</span></a> &lt;em&gt;lastcraft_test.php&lt;/em&gt; alors il peut être chargé <a name="l93"><span class="linenum"> 93</span></a> dans un script de lancement tout comme des tests unitaires... <a name="l94"><span class="linenum"> 94</span></a> &lt;pre&gt; <a name="l95"><span class="linenum"> 95</span></a> &amp;lt;?php <a name="l96"><span class="linenum"> 96</span></a> require_once('simpletest/autorun.php');&lt;strong&gt; <a name="l97"><span class="linenum"> 97</span></a> require_once('simpletest/web_tester.php');&lt;/strong&gt; <a name="l98"><span class="linenum"> 98</span></a> <a class="class" onClick="logClass('SimpleTest')" href="../../../../_classes/simpletest.html" onMouseOver="classPopup(event,'simpletest')">SimpleTest</a>::<a class="function" onClick="logFunction('prefer')" href="../../../../_functions/prefer.html" onMouseOver="funcPopup(event,'prefer')">prefer</a>(<span class="keyword">new </span><a class="class" onClick="logClass('TextReporter')" href="../../../../_classes/textreporter.html" onMouseOver="classPopup(event,'textreporter')">TextReporter</a>()); <a name="l99"><span class="linenum"> 99</span></a> <a name="l100"><span class="linenum"> 100</span></a> <span class="keyword">class </span><a class="class" onClick="logClass('WebTests')" href="../../../../_classes/webtests.html" onMouseOver="classPopup(event,'webtests')">WebTests</a> <span class="keyword">extends</span> <a class="class" onClick="logClass('TestSuite')" href="../../../../_classes/testsuite.html" onMouseOver="classPopup(event,'testsuite')">TestSuite</a> { <a name="l101"><span class="linenum"> 101</span></a> function <a class="function" onClick="logFunction('WebTests')" href="../../../../_functions/webtests.html" onMouseOver="funcPopup(event,'webtests')">WebTests</a>() { <a name="l102"><span class="linenum"> 102</span></a> <a class="var it7" onMouseOver="hilite(7)" onMouseOut="lolite()" onClick="logVariable('this')" href="../../../../_variables/this.html">$this</a>-&amp;gt;<a class="function" onClick="logFunction('TestSuite')" href="../../../../_functions/testsuite.html" onMouseOver="funcPopup(event,'testsuite')">TestSuite</a>('Web site tests');&lt;strong&gt; <a name="l103"><span class="linenum"> 103</span></a> <a class="var it7" onMouseOver="hilite(7)" onMouseOut="lolite()" onClick="logVariable('this')" href="../../../../_variables/this.html">$this</a>-&amp;gt;<a class="function" onClick="logFunction('addFile')" href="../../../../_functions/addfile.html" onMouseOver="funcPopup(event,'addfile')">addFile</a>('lastcraft_test.php');&lt;/strong&gt; <a name="l104"><span class="linenum"> 104</span></a> } <a name="l105"><span class="linenum"> 105</span></a> } <a name="l106"><span class="linenum"> 106</span></a> ?&amp;gt; <a name="l107"><span class="linenum"> 107</span></a> &lt;/pre&gt; <a name="l108"><span class="linenum"> 108</span></a> J'utilise ici le rapporteur en mode texte <a name="l109"><span class="linenum"> 109</span></a> pour mieux distinguer le contenu au format HTML <a name="l110"><span class="linenum"> 110</span></a> du résultat du test proprement dit. <a name="l111"><span class="linenum"> 111</span></a> &lt;/p&gt; <a name="l112"><span class="linenum"> 112</span></a> &lt;p&gt; <a name="l113"><span class="linenum"> 113</span></a> Rien n'est encore testé. Nous pouvons télécharger <a name="l114"><span class="linenum"> 114</span></a> la page d'accueil en utilisant la méthode &lt;span class=&quot;new_code&quot;&gt;<a class="function" onClick="logFunction('get')" href="../../../../_functions/get.html" onMouseOver="funcPopup(event,'get')">get</a>()&lt;/span&gt;... <a name="l115"><span class="linenum"> 115</span></a> &lt;pre&gt; <a name="l116"><span class="linenum"> 116</span></a> <span class="keyword">class </span><a class="class" onClick="logClass('TestOfLastcraft')" href="../../../../_classes/testoflastcraft.html" onMouseOver="classPopup(event,'testoflastcraft')">TestOfLastcraft</a> <span class="keyword">extends</span> <a class="class" onClick="logClass('WebTestCase')" href="../../../../_classes/webtestcase.html" onMouseOver="classPopup(event,'webtestcase')">WebTestCase</a> { <a name="l117"><span class="linenum"> 117</span></a> &lt;strong&gt; <a name="l118"><span class="linenum"> 118</span></a> function <a class="function" onClick="logFunction('testHomepage')" href="../../../../_functions/testhomepage.html" onMouseOver="funcPopup(event,'testhomepage')">testHomepage</a>() { <a name="l119"><span class="linenum"> 119</span></a> <a class="var it7" onMouseOver="hilite(7)" onMouseOut="lolite()" onClick="logVariable('this')" href="../../../../_variables/this.html">$this</a>-&amp;gt;<a class="function" onClick="logFunction('assertTrue')" href="../../../../_functions/asserttrue.html" onMouseOver="funcPopup(event,'asserttrue')">assertTrue</a>(<a class="var it7" onMouseOver="hilite(7)" onMouseOut="lolite()" onClick="logVariable('this')" href="../../../../_variables/this.html">$this</a>-&amp;gt;<a class="function" onClick="logFunction('get')" href="../../../../_functions/get.html" onMouseOver="funcPopup(event,'get')">get</a>('http://www.lastcraft.com/')); <a name="l120"><span class="linenum"> 120</span></a> }&lt;/strong&gt; <a name="l121"><span class="linenum"> 121</span></a> } <a name="l122"><span class="linenum"> 122</span></a> &lt;/pre&gt; <a name="l123"><span class="linenum"> 123</span></a> La méthode &lt;span class=&quot;new_code&quot;&gt;<a class="function" onClick="logFunction('get')" href="../../../../_functions/get.html" onMouseOver="funcPopup(event,'get')">get</a>()&lt;/span&gt; renverra &quot;true&quot; <a name="l124"><span class="linenum"> 124</span></a> uniquement si le contenu de la page a bien été téléchargé. <a name="l125"><span class="linenum"> 125</span></a> C'est un moyen simple, mais efficace pour vérifier <a name="l126"><span class="linenum"> 126</span></a> qu'une page web a bien été délivré par le serveur web. <a name="l127"><span class="linenum"> 127</span></a> Cependant le contenu peut révéler être une erreur 404 <a name="l128"><span class="linenum"> 128</span></a> et dans ce cas notre méthode &lt;span class=&quot;new_code&quot;&gt;<a class="function" onClick="logFunction('get')" href="../../../../_functions/get.html" onMouseOver="funcPopup(event,'get')">get</a>()&lt;/span&gt; renverrait encore un succès. <a name="l129"><span class="linenum"> 129</span></a> &lt;/p&gt; <a name="l130"><span class="linenum"> 130</span></a> &lt;p&gt; <a name="l131"><span class="linenum"> 131</span></a> En supposant que le serveur web pour le site Last Craft <a name="l132"><span class="linenum"> 132</span></a> soit opérationnel (malheureusement ce n'est pas toujours le cas), <a name="l133"><span class="linenum"> 133</span></a> nous devrions voir... <a name="l134"><span class="linenum"> 134</span></a> &lt;pre class=&quot;shell&quot;&gt; <a name="l135"><span class="linenum"> 135</span></a> Web site tests <a name="l136"><span class="linenum"> 136</span></a> OK <a name="l137"><span class="linenum"> 137</span></a> Test cases run: 1/1, Failures: 0, Exceptions: 0 <a name="l138"><span class="linenum"> 138</span></a> &lt;/pre&gt; <a name="l139"><span class="linenum"> 139</span></a> Nous avons vérifié qu'une page, de n'importe quel type, <a name="l140"><span class="linenum"> 140</span></a> a bien été renvoyée. Nous ne savons pas encore <a name="l141"><span class="linenum"> 141</span></a> s'il s'agit de celle que nous souhaitions. <a name="l142"><span class="linenum"> 142</span></a> &lt;/p&gt; <a name="l143"><span class="linenum"> 143</span></a> <a name="l144"><span class="linenum"> 144</span></a> &lt;h2&gt; <a name="l145"><span class="linenum"> 145</span></a> &lt;a class=&quot;target&quot; name=&quot;contenu&quot;&gt;&lt;/a&gt;Tester le contenu d'une page&lt;/h2&gt; <a name="l146"><span class="linenum"> 146</span></a> &lt;p&gt; <a name="l147"><span class="linenum"> 147</span></a> Pour obtenir la confirmation que la page téléchargée <a name="l148"><span class="linenum"> 148</span></a> est bien celle que nous attendions, <a name="l149"><span class="linenum"> 149</span></a> nous devons vérifier son contenu. <a name="l150"><span class="linenum"> 150</span></a> &lt;pre&gt; <a name="l151"><span class="linenum"> 151</span></a> <span class="keyword">class </span><a class="class" onClick="logClass('TestOfLastcraft')" href="../../../../_classes/testoflastcraft.html" onMouseOver="classPopup(event,'testoflastcraft')">TestOfLastcraft</a> <span class="keyword">extends</span> <a class="class" onClick="logClass('WebTestCase')" href="../../../../_classes/webtestcase.html" onMouseOver="classPopup(event,'webtestcase')">WebTestCase</a> { <a name="l152"><span class="linenum"> 152</span></a> <a name="l153"><span class="linenum"> 153</span></a> function <a class="function" onClick="logFunction('testHomepage')" href="../../../../_functions/testhomepage.html" onMouseOver="funcPopup(event,'testhomepage')">testHomepage</a>() {&lt;strong&gt; <a name="l154"><span class="linenum"> 154</span></a> <a class="var it7" onMouseOver="hilite(7)" onMouseOut="lolite()" onClick="logVariable('this')" href="../../../../_variables/this.html">$this</a>-&amp;gt;<a class="function" onClick="logFunction('get')" href="../../../../_functions/get.html" onMouseOver="funcPopup(event,'get')">get</a>('http://www.lastcraft.com/'); <a name="l155"><span class="linenum"> 155</span></a> <a class="var it7" onMouseOver="hilite(7)" onMouseOut="lolite()" onClick="logVariable('this')" href="../../../../_variables/this.html">$this</a>-&amp;gt;assertWantedPattern('/why the last craft/i');&lt;/strong&gt; <a name="l156"><span class="linenum"> 156</span></a> } <a name="l157"><span class="linenum"> 157</span></a> } <a name="l158"><span class="linenum"> 158</span></a> &lt;/pre&gt; <a name="l159"><span class="linenum"> 159</span></a> La page obtenue par le dernier téléchargement est <a name="l160"><span class="linenum"> 160</span></a> placée dans un buffer au sein même du scénario de test. <a name="l161"><span class="linenum"> 161</span></a> Il n'est donc pas nécessaire de s'y référer directement. <a name="l162"><span class="linenum"> 162</span></a> La correspondance du motif est toujours effectuée <a name="l163"><span class="linenum"> 163</span></a> par rapport à ce buffer. <a name="l164"><span class="linenum"> 164</span></a> &lt;/p&gt; <a name="l165"><span class="linenum"> 165</span></a> &lt;p&gt; <a name="l166"><span class="linenum"> 166</span></a> Voici une liste possible d'assertions sur le contenu... <a name="l167"><span class="linenum"> 167</span></a> &lt;table&gt;&lt;tbody&gt; <a name="l168"><span class="linenum"> 168</span></a> &lt;tr&gt; <a name="l169"><span class="linenum"> 169</span></a> &lt;td&gt;&lt;span class=&quot;new_code&quot;&gt;assertWantedPattern(<a class="var it943" onMouseOver="hilite(943)" onMouseOut="lolite()" onClick="logVariable('pattern')" href="../../../../_variables/pattern.html">$pattern</a>)&lt;/span&gt;&lt;/td&gt; <a name="l170"><span class="linenum"> 170</span></a> &lt;td&gt;Vérifier une correspondance sur le contenu via une expression rationnelle Perl&lt;/td&gt; <a name="l171"><span class="linenum"> 171</span></a> &lt;/tr&gt; <a name="l172"><span class="linenum"> 172</span></a> &lt;tr&gt; <a name="l173"><span class="linenum"> 173</span></a> &lt;td&gt;&lt;span class=&quot;new_code&quot;&gt;assertNoUnwantedPattern(<a class="var it943" onMouseOver="hilite(943)" onMouseOut="lolite()" onClick="logVariable('pattern')" href="../../../../_variables/pattern.html">$pattern</a>)&lt;/span&gt;&lt;/td&gt; <a name="l174"><span class="linenum"> 174</span></a> &lt;td&gt;Une expression rationnelle Perl pour vérifier une absence&lt;/td&gt; <a name="l175"><span class="linenum"> 175</span></a> &lt;/tr&gt; <a name="l176"><span class="linenum"> 176</span></a> &lt;tr&gt; <a name="l177"><span class="linenum"> 177</span></a> &lt;td&gt;&lt;span class=&quot;new_code&quot;&gt;<a class="function" onClick="logFunction('assertTitle')" href="../../../../_functions/asserttitle.html" onMouseOver="funcPopup(event,'asserttitle')">assertTitle</a>(<a class="var it756" onMouseOver="hilite(756)" onMouseOut="lolite()" onClick="logVariable('title')" href="../../../../_variables/title.html">$title</a>)&lt;/span&gt;&lt;/td&gt; <a name="l178"><span class="linenum"> 178</span></a> &lt;td&gt;Passe si le titre de la page correspond exactement&lt;/td&gt; <a name="l179"><span class="linenum"> 179</span></a> &lt;/tr&gt; <a name="l180"><span class="linenum"> 180</span></a> &lt;tr&gt; <a name="l181"><span class="linenum"> 181</span></a> &lt;td&gt;&lt;span class=&quot;new_code&quot;&gt;<a class="function" onClick="logFunction('assertLink')" href="../../../../_functions/assertlink.html" onMouseOver="funcPopup(event,'assertlink')">assertLink</a>(<a class="var it106" onMouseOver="hilite(106)" onMouseOut="lolite()" onClick="logVariable('label')" href="../../../../_variables/label.html">$label</a>)&lt;/span&gt;&lt;/td&gt; <a name="l182"><span class="linenum"> 182</span></a> &lt;td&gt;Passe si un lien avec ce texte est présent&lt;/td&gt; <a name="l183"><span class="linenum"> 183</span></a> &lt;/tr&gt; <a name="l184"><span class="linenum"> 184</span></a> &lt;tr&gt; <a name="l185"><span class="linenum"> 185</span></a> &lt;td&gt;&lt;span class=&quot;new_code&quot;&gt;<a class="function" onClick="logFunction('assertNoLink')" href="../../../../_functions/assertnolink.html" onMouseOver="funcPopup(event,'assertnolink')">assertNoLink</a>(<a class="var it106" onMouseOver="hilite(106)" onMouseOut="lolite()" onClick="logVariable('label')" href="../../../../_variables/label.html">$label</a>)&lt;/span&gt;&lt;/td&gt; <a name="l186"><span class="linenum"> 186</span></a> &lt;td&gt;Passe si aucun lien avec ce texte est présent&lt;/td&gt; <a name="l187"><span class="linenum"> 187</span></a> &lt;/tr&gt; <a name="l188"><span class="linenum"> 188</span></a> &lt;tr&gt; <a name="l189"><span class="linenum"> 189</span></a> &lt;td&gt;&lt;span class=&quot;new_code&quot;&gt;<a class="function" onClick="logFunction('assertLinkById')" href="../../../../_functions/assertlinkbyid.html" onMouseOver="funcPopup(event,'assertlinkbyid')">assertLinkById</a>(<a class="var it36" onMouseOver="hilite(36)" onMouseOut="lolite()" onClick="logVariable('id')" href="../../../../_variables/id.html">$id</a>)&lt;/span&gt;&lt;/td&gt; <a name="l190"><span class="linenum"> 190</span></a> &lt;td&gt;Passe si un lien avec cet attribut d'identification est présent&lt;/td&gt; <a name="l191"><span class="linenum"> 191</span></a> &lt;/tr&gt; <a name="l192"><span class="linenum"> 192</span></a> &lt;tr&gt; <a name="l193"><span class="linenum"> 193</span></a> &lt;td&gt;&lt;span class=&quot;new_code&quot;&gt;<a class="function" onClick="logFunction('assertField')" href="../../../../_functions/assertfield.html" onMouseOver="funcPopup(event,'assertfield')">assertField</a>(<a class="var it74" onMouseOver="hilite(74)" onMouseOut="lolite()" onClick="logVariable('name')" href="../../../../_variables/name.html">$name</a>, <a class="var it67" onMouseOver="hilite(67)" onMouseOut="lolite()" onClick="logVariable('value')" href="../../../../_variables/value.html">$value</a>)&lt;/span&gt;&lt;/td&gt; <a name="l194"><span class="linenum"> 194</span></a> &lt;td&gt;Passe si une balise input avec ce nom contient cette valeur&lt;/td&gt; <a name="l195"><span class="linenum"> 195</span></a> &lt;/tr&gt; <a name="l196"><span class="linenum"> 196</span></a> &lt;tr&gt; <a name="l197"><span class="linenum"> 197</span></a> &lt;td&gt;&lt;span class=&quot;new_code&quot;&gt;<a class="function" onClick="logFunction('assertFieldById')" href="../../../../_functions/assertfieldbyid.html" onMouseOver="funcPopup(event,'assertfieldbyid')">assertFieldById</a>(<a class="var it36" onMouseOver="hilite(36)" onMouseOut="lolite()" onClick="logVariable('id')" href="../../../../_variables/id.html">$id</a>, <a class="var it67" onMouseOver="hilite(67)" onMouseOut="lolite()" onClick="logVariable('value')" href="../../../../_variables/value.html">$value</a>)&lt;/span&gt;&lt;/td&gt; <a name="l198"><span class="linenum"> 198</span></a> &lt;td&gt;Passe si une balise input avec cet identifiant contient cette valeur&lt;/td&gt; <a name="l199"><span class="linenum"> 199</span></a> &lt;/tr&gt; <a name="l200"><span class="linenum"> 200</span></a> &lt;tr&gt; <a name="l201"><span class="linenum"> 201</span></a> &lt;td&gt;&lt;span class=&quot;new_code&quot;&gt;<a class="function" onClick="logFunction('assertResponse')" href="../../../../_functions/assertresponse.html" onMouseOver="funcPopup(event,'assertresponse')">assertResponse</a>(<a class="var it944" onMouseOver="hilite(944)" onMouseOut="lolite()" onClick="logVariable('codes')" href="../../../../_variables/codes.html">$codes</a>)&lt;/span&gt;&lt;/td&gt; <a name="l202"><span class="linenum"> 202</span></a> &lt;td&gt;Passe si la réponse HTTP trouve une correspondance dans la liste&lt;/td&gt; <a name="l203"><span class="linenum"> 203</span></a> &lt;/tr&gt; <a name="l204"><span class="linenum"> 204</span></a> &lt;tr&gt; <a name="l205"><span class="linenum"> 205</span></a> &lt;td&gt;&lt;span class=&quot;new_code&quot;&gt;<a class="function" onClick="logFunction('assertMime')" href="../../../../_functions/assertmime.html" onMouseOver="funcPopup(event,'assertmime')">assertMime</a>(<a class="var it945" onMouseOver="hilite(945)" onMouseOut="lolite()" onClick="logVariable('types')" href="../../../../_variables/types.html">$types</a>)&lt;/span&gt;&lt;/td&gt; <a name="l206"><span class="linenum"> 206</span></a> &lt;td&gt;Passe si le type MIME se retrouve dans cette liste&lt;/td&gt; <a name="l207"><span class="linenum"> 207</span></a> &lt;/tr&gt; <a name="l208"><span class="linenum"> 208</span></a> &lt;tr&gt; <a name="l209"><span class="linenum"> 209</span></a> &lt;td&gt;&lt;span class=&quot;new_code&quot;&gt;<a class="function" onClick="logFunction('assertAuthentication')" href="../../../../_functions/assertauthentication.html" onMouseOver="funcPopup(event,'assertauthentication')">assertAuthentication</a>(<a class="var it197" onMouseOver="hilite(197)" onMouseOut="lolite()" onClick="logVariable('protocol')" href="../../../../_variables/protocol.html">$protocol</a>)&lt;/span&gt;&lt;/td&gt; <a name="l210"><span class="linenum"> 210</span></a> &lt;td&gt;Passe si l'authentification provoquée est de ce type de protocole&lt;/td&gt; <a name="l211"><span class="linenum"> 211</span></a> &lt;/tr&gt; <a name="l212"><span class="linenum"> 212</span></a> &lt;tr&gt; <a name="l213"><span class="linenum"> 213</span></a> &lt;td&gt;&lt;span class=&quot;new_code&quot;&gt;<a class="function" onClick="logFunction('assertNoAuthentication')" href="../../../../_functions/assertnoauthentication.html" onMouseOver="funcPopup(event,'assertnoauthentication')">assertNoAuthentication</a>()&lt;/span&gt;&lt;/td&gt; <a name="l214"><span class="linenum"> 214</span></a> &lt;td&gt;Passe s'il n'y pas d'authentification provoquée en cours&lt;/td&gt; <a name="l215"><span class="linenum"> 215</span></a> &lt;/tr&gt; <a name="l216"><span class="linenum"> 216</span></a> &lt;tr&gt; <a name="l217"><span class="linenum"> 217</span></a> &lt;td&gt;&lt;span class=&quot;new_code&quot;&gt;<a class="function" onClick="logFunction('assertRealm')" href="../../../../_functions/assertrealm.html" onMouseOver="funcPopup(event,'assertrealm')">assertRealm</a>(<a class="var it74" onMouseOver="hilite(74)" onMouseOut="lolite()" onClick="logVariable('name')" href="../../../../_variables/name.html">$name</a>)&lt;/span&gt;&lt;/td&gt; <a name="l218"><span class="linenum"> 218</span></a> &lt;td&gt;Passe si le domaine provoqué correspond&lt;/td&gt; <a name="l219"><span class="linenum"> 219</span></a> &lt;/tr&gt; <a name="l220"><span class="linenum"> 220</span></a> &lt;tr&gt; <a name="l221"><span class="linenum"> 221</span></a> &lt;td&gt;&lt;span class=&quot;new_code&quot;&gt;<a class="function" onClick="logFunction('assertHeader')" href="../../../../_functions/assertheader.html" onMouseOver="funcPopup(event,'assertheader')">assertHeader</a>(<a class="var it251" onMouseOver="hilite(251)" onMouseOut="lolite()" onClick="logVariable('header')" href="../../../../_variables/header.html">$header</a>, <a class="var it603" onMouseOver="hilite(603)" onMouseOut="lolite()" onClick="logVariable('content')" href="../../../../_variables/content.html">$content</a>)&lt;/span&gt;&lt;/td&gt; <a name="l222"><span class="linenum"> 222</span></a> &lt;td&gt;Passe si une entête téléchargée correspond à cette valeur&lt;/td&gt; <a name="l223"><span class="linenum"> 223</span></a> &lt;/tr&gt; <a name="l224"><span class="linenum"> 224</span></a> &lt;tr&gt; <a name="l225"><span class="linenum"> 225</span></a> &lt;td&gt;&lt;span class=&quot;new_code&quot;&gt;assertNoUnwantedHeader(<a class="var it251" onMouseOver="hilite(251)" onMouseOut="lolite()" onClick="logVariable('header')" href="../../../../_variables/header.html">$header</a>)&lt;/span&gt;&lt;/td&gt; <a name="l226"><span class="linenum"> 226</span></a> &lt;td&gt;Passe si une entête n'a pas été téléchargé&lt;/td&gt; <a name="l227"><span class="linenum"> 227</span></a> &lt;/tr&gt; <a name="l228"><span class="linenum"> 228</span></a> &lt;tr&gt; <a name="l229"><span class="linenum"> 229</span></a> &lt;td&gt;&lt;span class=&quot;new_code&quot;&gt;assertHeaderPattern(<a class="var it251" onMouseOver="hilite(251)" onMouseOut="lolite()" onClick="logVariable('header')" href="../../../../_variables/header.html">$header</a>, <a class="var it943" onMouseOver="hilite(943)" onMouseOut="lolite()" onClick="logVariable('pattern')" href="../../../../_variables/pattern.html">$pattern</a>)&lt;/span&gt;&lt;/td&gt; <a name="l230"><span class="linenum"> 230</span></a> &lt;td&gt;Passe si une entête téléchargée correspond à cette expression rationnelle Perl&lt;/td&gt; <a name="l231"><span class="linenum"> 231</span></a> &lt;/tr&gt; <a name="l232"><span class="linenum"> 232</span></a> &lt;tr&gt; <a name="l233"><span class="linenum"> 233</span></a> &lt;td&gt;&lt;span class=&quot;new_code&quot;&gt;<a class="function" onClick="logFunction('assertCookie')" href="../../../../_functions/assertcookie.html" onMouseOver="funcPopup(event,'assertcookie')">assertCookie</a>(<a class="var it74" onMouseOver="hilite(74)" onMouseOut="lolite()" onClick="logVariable('name')" href="../../../../_variables/name.html">$name</a>, <a class="var it67" onMouseOver="hilite(67)" onMouseOut="lolite()" onClick="logVariable('value')" href="../../../../_variables/value.html">$value</a>)&lt;/span&gt;&lt;/td&gt; <a name="l234"><span class="linenum"> 234</span></a> &lt;td&gt;Passe s'il existe un cookie correspondant&lt;/td&gt; <a name="l235"><span class="linenum"> 235</span></a> &lt;/tr&gt; <a name="l236"><span class="linenum"> 236</span></a> &lt;tr&gt; <a name="l237"><span class="linenum"> 237</span></a> &lt;td&gt;&lt;span class=&quot;new_code&quot;&gt;<a class="function" onClick="logFunction('assertNoCookie')" href="../../../../_functions/assertnocookie.html" onMouseOver="funcPopup(event,'assertnocookie')">assertNoCookie</a>(<a class="var it74" onMouseOver="hilite(74)" onMouseOut="lolite()" onClick="logVariable('name')" href="../../../../_variables/name.html">$name</a>)&lt;/span&gt;&lt;/td&gt; <a name="l238"><span class="linenum"> 238</span></a> &lt;td&gt;Passe s'il n'y a pas de cookie avec un tel nom&lt;/td&gt; <a name="l239"><span class="linenum"> 239</span></a> &lt;/tr&gt; <a name="l240"><span class="linenum"> 240</span></a> &lt;/tbody&gt;&lt;/table&gt; <a name="l241"><span class="linenum"> 241</span></a> Comme d'habitude avec les assertions de SimpleTest, <a name="l242"><span class="linenum"> 242</span></a> elles renvoient toutes &quot;false&quot; en cas d'échec <a name="l243"><span class="linenum"> 243</span></a> et &quot;true&quot; si c'est un succès. <a name="l244"><span class="linenum"> 244</span></a> Elles renvoient aussi un message de test optionnel : <a name="l245"><span class="linenum"> 245</span></a> vous pouvez l'ajouter dans votre propre message en utilisant &quot;%s&quot;. <a name="l246"><span class="linenum"> 246</span></a> &lt;/p&gt; <a name="l247"><span class="linenum"> 247</span></a> &lt;p&gt; <a name="l248"><span class="linenum"> 248</span></a> A présent nous pourrions effectué le test sur le titre uniquement... <a name="l249"><span class="linenum"> 249</span></a> &lt;pre&gt; <a name="l250"><span class="linenum"> 250</span></a> &lt;strong&gt;<a class="var it7" onMouseOver="hilite(7)" onMouseOut="lolite()" onClick="logVariable('this')" href="../../../../_variables/this.html">$this</a>-&amp;gt;<a class="function" onClick="logFunction('assertTitle')" href="../../../../_functions/asserttitle.html" onMouseOver="funcPopup(event,'asserttitle')">assertTitle</a>('The Last Craft?');&lt;/strong&gt; <a name="l251"><span class="linenum"> 251</span></a> &lt;/pre&gt; <a name="l252"><span class="linenum"> 252</span></a> En plus d'une simple vérification sur le contenu HTML, <a name="l253"><span class="linenum"> 253</span></a> nous pouvons aussi vérifier que le type MIME est bien d'un type acceptable... <a name="l254"><span class="linenum"> 254</span></a> &lt;pre&gt; <a name="l255"><span class="linenum"> 255</span></a> &lt;strong&gt;<a class="var it7" onMouseOver="hilite(7)" onMouseOut="lolite()" onClick="logVariable('this')" href="../../../../_variables/this.html">$this</a>-&amp;gt;<a class="function" onClick="logFunction('assertMime')" href="../../../../_functions/assertmime.html" onMouseOver="funcPopup(event,'assertmime')">assertMime</a>(array('text/plain', 'text/html'));&lt;/strong&gt; <a name="l256"><span class="linenum"> 256</span></a> &lt;/pre&gt; <a name="l257"><span class="linenum"> 257</span></a> Plus intéressant encore est la vérification sur <a name="l258"><span class="linenum"> 258</span></a> le code de la réponse HTTP. Pareillement au type MIME, <a name="l259"><span class="linenum"> 259</span></a> nous pouvons nous assurer que le code renvoyé se trouve <a name="l260"><span class="linenum"> 260</span></a> bien dans un liste de valeurs possibles... <a name="l261"><span class="linenum"> 261</span></a> &lt;pre&gt; <a name="l262"><span class="linenum"> 262</span></a> <span class="keyword">class </span><a class="class" onClick="logClass('TestOfLastcraft')" href="../../../../_classes/testoflastcraft.html" onMouseOver="classPopup(event,'testoflastcraft')">TestOfLastcraft</a> <span class="keyword">extends</span> <a class="class" onClick="logClass('WebTestCase')" href="../../../../_classes/webtestcase.html" onMouseOver="classPopup(event,'webtestcase')">WebTestCase</a> { <a name="l263"><span class="linenum"> 263</span></a> <a name="l264"><span class="linenum"> 264</span></a> function <a class="function" onClick="logFunction('testHomepage')" href="../../../../_functions/testhomepage.html" onMouseOver="funcPopup(event,'testhomepage')">testHomepage</a>() { <a name="l265"><span class="linenum"> 265</span></a> <a class="var it7" onMouseOver="hilite(7)" onMouseOut="lolite()" onClick="logVariable('this')" href="../../../../_variables/this.html">$this</a>-&amp;gt;<a class="function" onClick="logFunction('get')" href="../../../../_functions/get.html" onMouseOver="funcPopup(event,'get')">get</a>('http://simpletest.sourceforge.net/');&lt;strong&gt; <a name="l266"><span class="linenum"> 266</span></a> <a class="var it7" onMouseOver="hilite(7)" onMouseOut="lolite()" onClick="logVariable('this')" href="../../../../_variables/this.html">$this</a>-&amp;gt;<a class="function" onClick="logFunction('assertResponse')" href="../../../../_functions/assertresponse.html" onMouseOver="funcPopup(event,'assertresponse')">assertResponse</a>(200);&lt;/strong&gt; <a name="l267"><span class="linenum"> 267</span></a> } <a name="l268"><span class="linenum"> 268</span></a> } <a name="l269"><span class="linenum"> 269</span></a> &lt;/pre&gt; <a name="l270"><span class="linenum"> 270</span></a> Ici nous vérifions que le téléchargement s'est <a name="l271"><span class="linenum"> 271</span></a> bien terminé en ne permettant qu'une réponse HTTP 200. <a name="l272"><span class="linenum"> 272</span></a> Ce test passera, mais ce n'est pas la meilleure façon de procéder. <a name="l273"><span class="linenum"> 273</span></a> Il n'existe aucune page sur &lt;em&gt;http://simpletest.sourceforge.net/&lt;/em&gt;, <a name="l274"><span class="linenum"> 274</span></a> à la place le serveur renverra une redirection vers <a name="l275"><span class="linenum"> 275</span></a> &lt;em&gt;http://www.lastcraft.com/simple_test.php&lt;/em&gt;. <a name="l276"><span class="linenum"> 276</span></a> &lt;span class=&quot;new_code&quot;&gt;WebTestCase&lt;/span&gt; suit automatiquement trois <a name="l277"><span class="linenum"> 277</span></a> de ces redirections. Les tests sont quelque peu plus <a name="l278"><span class="linenum"> 278</span></a> robustes de la sorte. Surtout qu'on est souvent plus intéressé <a name="l279"><span class="linenum"> 279</span></a> par l'interaction entre les pages que de leur simple livraison. <a name="l280"><span class="linenum"> 280</span></a> Si les redirections se révèlent être digne d'intérêt, <a name="l281"><span class="linenum"> 281</span></a> il reste possible de les supprimer... <a name="l282"><span class="linenum"> 282</span></a> &lt;pre&gt; <a name="l283"><span class="linenum"> 283</span></a> <span class="keyword">class </span><a class="class" onClick="logClass('TestOfLastcraft')" href="../../../../_classes/testoflastcraft.html" onMouseOver="classPopup(event,'testoflastcraft')">TestOfLastcraft</a> <span class="keyword">extends</span> <a class="class" onClick="logClass('WebTestCase')" href="../../../../_classes/webtestcase.html" onMouseOver="classPopup(event,'webtestcase')">WebTestCase</a> { <a name="l284"><span class="linenum"> 284</span></a> <a name="l285"><span class="linenum"> 285</span></a> function <a class="function" onClick="logFunction('testHomepage')" href="../../../../_functions/testhomepage.html" onMouseOver="funcPopup(event,'testhomepage')">testHomepage</a>() {&lt;strong&gt; <a name="l286"><span class="linenum"> 286</span></a> <a class="var it7" onMouseOver="hilite(7)" onMouseOut="lolite()" onClick="logVariable('this')" href="../../../../_variables/this.html">$this</a>-&amp;gt;<a class="function" onClick="logFunction('setMaximumRedirects')" href="../../../../_functions/setmaximumredirects.html" onMouseOver="funcPopup(event,'setmaximumredirects')">setMaximumRedirects</a>(0);&lt;/strong&gt; <a name="l287"><span class="linenum"> 287</span></a> <a class="var it7" onMouseOver="hilite(7)" onMouseOut="lolite()" onClick="logVariable('this')" href="../../../../_variables/this.html">$this</a>-&amp;gt;<a class="function" onClick="logFunction('get')" href="../../../../_functions/get.html" onMouseOver="funcPopup(event,'get')">get</a>('http://simpletest.sourceforge.net/'); <a name="l288"><span class="linenum"> 288</span></a> <a class="var it7" onMouseOver="hilite(7)" onMouseOut="lolite()" onClick="logVariable('this')" href="../../../../_variables/this.html">$this</a>-&amp;gt;<a class="function" onClick="logFunction('assertResponse')" href="../../../../_functions/assertresponse.html" onMouseOver="funcPopup(event,'assertresponse')">assertResponse</a>(200); <a name="l289"><span class="linenum"> 289</span></a> } <a name="l290"><span class="linenum"> 290</span></a> } <a name="l291"><span class="linenum"> 291</span></a> &lt;/pre&gt; <a name="l292"><span class="linenum"> 292</span></a> Alors l'assertion échoue comme prévue... <a name="l293"><span class="linenum"> 293</span></a> &lt;pre class=&quot;shell&quot;&gt; <a name="l294"><span class="linenum"> 294</span></a> Web site tests <a name="l295"><span class="linenum"> 295</span></a> 1) Expecting response in [200] got [302] <a name="l296"><span class="linenum"> 296</span></a> in testhomepage <a name="l297"><span class="linenum"> 297</span></a> in testoflastcraft <a name="l298"><span class="linenum"> 298</span></a> in lastcraft_test.php <a name="l299"><span class="linenum"> 299</span></a> FAILURES!!! <a name="l300"><span class="linenum"> 300</span></a> Test cases run: 1/1, Failures: 1, Exceptions: 0 <a name="l301"><span class="linenum"> 301</span></a> &lt;/pre&gt; <a name="l302"><span class="linenum"> 302</span></a> Nous pouvons modifier le test pour accepter les redirections... <a name="l303"><span class="linenum"> 303</span></a> &lt;pre&gt; <a name="l304"><span class="linenum"> 304</span></a> <span class="keyword">class </span><a class="class" onClick="logClass('TestOfLastcraft')" href="../../../../_classes/testoflastcraft.html" onMouseOver="classPopup(event,'testoflastcraft')">TestOfLastcraft</a> <span class="keyword">extends</span> <a class="class" onClick="logClass('WebTestCase')" href="../../../../_classes/webtestcase.html" onMouseOver="classPopup(event,'webtestcase')">WebTestCase</a> { <a name="l305"><span class="linenum"> 305</span></a> <a name="l306"><span class="linenum"> 306</span></a> function <a class="function" onClick="logFunction('testHomepage')" href="../../../../_functions/testhomepage.html" onMouseOver="funcPopup(event,'testhomepage')">testHomepage</a>() { <a name="l307"><span class="linenum"> 307</span></a> <a class="var it7" onMouseOver="hilite(7)" onMouseOut="lolite()" onClick="logVariable('this')" href="../../../../_variables/this.html">$this</a>-&amp;gt;<a class="function" onClick="logFunction('setMaximumRedirects')" href="../../../../_functions/setmaximumredirects.html" onMouseOver="funcPopup(event,'setmaximumredirects')">setMaximumRedirects</a>(0); <a name="l308"><span class="linenum"> 308</span></a> <a class="var it7" onMouseOver="hilite(7)" onMouseOut="lolite()" onClick="logVariable('this')" href="../../../../_variables/this.html">$this</a>-&amp;gt;<a class="function" onClick="logFunction('get')" href="../../../../_functions/get.html" onMouseOver="funcPopup(event,'get')">get</a>('http://simpletest.sourceforge.net/'); <a name="l309"><span class="linenum"> 309</span></a> <a class="var it7" onMouseOver="hilite(7)" onMouseOut="lolite()" onClick="logVariable('this')" href="../../../../_variables/this.html">$this</a>-&amp;gt;<a class="function" onClick="logFunction('assertResponse')" href="../../../../_functions/assertresponse.html" onMouseOver="funcPopup(event,'assertresponse')">assertResponse</a>(&lt;strong&gt;array(301, 302, 303, 307)&lt;/strong&gt;); <a name="l310"><span class="linenum"> 310</span></a> } <a name="l311"><span class="linenum"> 311</span></a> } <a name="l312"><span class="linenum"> 312</span></a> &lt;/pre&gt; <a name="l313"><span class="linenum"> 313</span></a> Maitenant ça passe. <a name="l314"><span class="linenum"> 314</span></a> &lt;/p&gt; <a name="l315"><span class="linenum"> 315</span></a> <a name="l316"><span class="linenum"> 316</span></a> &lt;h2&gt; <a name="l317"><span class="linenum"> 317</span></a> &lt;a class=&quot;target&quot; name=&quot;navigation&quot;&gt;&lt;/a&gt;Navigeur dans un site web&lt;/h2&gt; <a name="l318"><span class="linenum"> 318</span></a> &lt;p&gt; <a name="l319"><span class="linenum"> 319</span></a> Les utilisateurs ne naviguent pas souvent en tapant les URLs, <a name="l320"><span class="linenum"> 320</span></a> mais surtout en cliquant sur des liens et des boutons. <a name="l321"><span class="linenum"> 321</span></a> Ici nous confirmons que les informations sur le contact <a name="l322"><span class="linenum"> 322</span></a> peuvent être atteintes depuis la page d'accueil... <a name="l323"><span class="linenum"> 323</span></a> &lt;pre&gt; <a name="l324"><span class="linenum"> 324</span></a> <span class="keyword">class </span><a class="class" onClick="logClass('TestOfLastcraft')" href="../../../../_classes/testoflastcraft.html" onMouseOver="classPopup(event,'testoflastcraft')">TestOfLastcraft</a> <span class="keyword">extends</span> <a class="class" onClick="logClass('WebTestCase')" href="../../../../_classes/webtestcase.html" onMouseOver="classPopup(event,'webtestcase')">WebTestCase</a> { <a name="l325"><span class="linenum"> 325</span></a> ... <a name="l326"><span class="linenum"> 326</span></a> function <a class="function" onClick="logFunction('testContact')" href="../../../../_functions/testcontact.html" onMouseOver="funcPopup(event,'testcontact')">testContact</a>() { <a name="l327"><span class="linenum"> 327</span></a> <a class="var it7" onMouseOver="hilite(7)" onMouseOut="lolite()" onClick="logVariable('this')" href="../../../../_variables/this.html">$this</a>-&amp;gt;<a class="function" onClick="logFunction('get')" href="../../../../_functions/get.html" onMouseOver="funcPopup(event,'get')">get</a>('http://www.lastcraft.com/');&lt;strong&gt; <a name="l328"><span class="linenum"> 328</span></a> <a class="var it7" onMouseOver="hilite(7)" onMouseOut="lolite()" onClick="logVariable('this')" href="../../../../_variables/this.html">$this</a>-&amp;gt;<a class="function" onClick="logFunction('clickLink')" href="../../../../_functions/clicklink.html" onMouseOver="funcPopup(event,'clicklink')">clickLink</a>('About'); <a name="l329"><span class="linenum"> 329</span></a> <a class="var it7" onMouseOver="hilite(7)" onMouseOut="lolite()" onClick="logVariable('this')" href="../../../../_variables/this.html">$this</a>-&amp;gt;<a class="function" onClick="logFunction('assertTitle')" href="../../../../_functions/asserttitle.html" onMouseOver="funcPopup(event,'asserttitle')">assertTitle</a>('About Last Craft');&lt;/strong&gt; <a name="l330"><span class="linenum"> 330</span></a> } <a name="l331"><span class="linenum"> 331</span></a> } <a name="l332"><span class="linenum"> 332</span></a> &lt;/pre&gt; <a name="l333"><span class="linenum"> 333</span></a> Le paramètre est le texte du lien. <a name="l334"><span class="linenum"> 334</span></a> &lt;/p&gt; <a name="l335"><span class="linenum"> 335</span></a> &lt;p&gt; <a name="l336"><span class="linenum"> 336</span></a> Il l'objectif est un bouton plutôt qu'une balise ancre, <a name="l337"><span class="linenum"> 337</span></a> alors &lt;span class=&quot;new_code&quot;&gt;<a class="function" onClick="logFunction('clickSubmit')" href="../../../../_functions/clicksubmit.html" onMouseOver="funcPopup(event,'clicksubmit')">clickSubmit</a>()&lt;/span&gt; doit être utilisé avec <a name="l338"><span class="linenum"> 338</span></a> le titre du bouton... <a name="l339"><span class="linenum"> 339</span></a> &lt;pre&gt; <a name="l340"><span class="linenum"> 340</span></a> &lt;strong&gt;<a class="var it7" onMouseOver="hilite(7)" onMouseOut="lolite()" onClick="logVariable('this')" href="../../../../_variables/this.html">$this</a>-&amp;gt;<a class="function" onClick="logFunction('clickSubmit')" href="../../../../_functions/clicksubmit.html" onMouseOver="funcPopup(event,'clicksubmit')">clickSubmit</a>('Go!');&lt;/strong&gt; <a name="l341"><span class="linenum"> 341</span></a> &lt;/pre&gt; <a name="l342"><span class="linenum"> 342</span></a> &lt;/p&gt; <a name="l343"><span class="linenum"> 343</span></a> &lt;p&gt; <a name="l344"><span class="linenum"> 344</span></a> La liste des méthodes de navigation est... <a name="l345"><span class="linenum"> 345</span></a> &lt;table&gt;&lt;tbody&gt; <a name="l346"><span class="linenum"> 346</span></a> &lt;tr&gt; <a name="l347"><span class="linenum"> 347</span></a> &lt;td&gt;&lt;span class=&quot;new_code&quot;&gt;<a class="function" onClick="logFunction('get')" href="../../../../_functions/get.html" onMouseOver="funcPopup(event,'get')">get</a>(<a class="var it333" onMouseOver="hilite(333)" onMouseOut="lolite()" onClick="logVariable('url')" href="../../../../_variables/url.html">$url</a>, <a class="var it670" onMouseOver="hilite(670)" onMouseOut="lolite()" onClick="logVariable('parameters')" href="../../../../_variables/parameters.html">$parameters</a>)&lt;/span&gt;&lt;/td&gt; <a name="l348"><span class="linenum"> 348</span></a> &lt;td&gt;Envoie une requête GET avec ces paramètres&lt;/td&gt; <a name="l349"><span class="linenum"> 349</span></a> &lt;/tr&gt; <a name="l350"><span class="linenum"> 350</span></a> &lt;tr&gt; <a name="l351"><span class="linenum"> 351</span></a> &lt;td&gt;&lt;span class=&quot;new_code&quot;&gt;<a class="function" onClick="logFunction('post')" href="../../../../_functions/post.html" onMouseOver="funcPopup(event,'post')">post</a>(<a class="var it333" onMouseOver="hilite(333)" onMouseOut="lolite()" onClick="logVariable('url')" href="../../../../_variables/url.html">$url</a>, <a class="var it670" onMouseOver="hilite(670)" onMouseOut="lolite()" onClick="logVariable('parameters')" href="../../../../_variables/parameters.html">$parameters</a>)&lt;/span&gt;&lt;/td&gt; <a name="l352"><span class="linenum"> 352</span></a> &lt;td&gt;Envoie une requête POST avec ces paramètres&lt;/td&gt; <a name="l353"><span class="linenum"> 353</span></a> &lt;/tr&gt; <a name="l354"><span class="linenum"> 354</span></a> &lt;tr&gt; <a name="l355"><span class="linenum"> 355</span></a> &lt;td&gt;&lt;span class=&quot;new_code&quot;&gt;<a class="function" onClick="logFunction('head')" href="../../../../_functions/head.html" onMouseOver="funcPopup(event,'head')">head</a>(<a class="var it333" onMouseOver="hilite(333)" onMouseOut="lolite()" onClick="logVariable('url')" href="../../../../_variables/url.html">$url</a>, <a class="var it670" onMouseOver="hilite(670)" onMouseOut="lolite()" onClick="logVariable('parameters')" href="../../../../_variables/parameters.html">$parameters</a>)&lt;/span&gt;&lt;/td&gt; <a name="l356"><span class="linenum"> 356</span></a> &lt;td&gt;Envoie une requête HEAD sans remplacer le contenu de la page&lt;/td&gt; <a name="l357"><span class="linenum"> 357</span></a> &lt;/tr&gt; <a name="l358"><span class="linenum"> 358</span></a> &lt;tr&gt; <a name="l359"><span class="linenum"> 359</span></a> &lt;td&gt;&lt;span class=&quot;new_code&quot;&gt;<a class="function" onClick="logFunction('retry')" href="../../../../_functions/retry.html" onMouseOver="funcPopup(event,'retry')">retry</a>()&lt;/span&gt;&lt;/td&gt; <a name="l360"><span class="linenum"> 360</span></a> &lt;td&gt;Relance la dernière requête&lt;/td&gt; <a name="l361"><span class="linenum"> 361</span></a> &lt;/tr&gt; <a name="l362"><span class="linenum"> 362</span></a> &lt;tr&gt; <a name="l363"><span class="linenum"> 363</span></a> &lt;td&gt;&lt;span class=&quot;new_code&quot;&gt;<a class="function" onClick="logFunction('back')" href="../../../../_functions/back.html" onMouseOver="funcPopup(event,'back')">back</a>()&lt;/span&gt;&lt;/td&gt; <a name="l364"><span class="linenum"> 364</span></a> &lt;td&gt;Identique au bouton &quot;Précédent&quot; du navigateur&lt;/td&gt; <a name="l365"><span class="linenum"> 365</span></a> &lt;/tr&gt; <a name="l366"><span class="linenum"> 366</span></a> &lt;tr&gt; <a name="l367"><span class="linenum"> 367</span></a> &lt;td&gt;&lt;span class=&quot;new_code&quot;&gt;<a class="function" onClick="logFunction('forward')" href="../../../../_functions/forward.html" onMouseOver="funcPopup(event,'forward')">forward</a>()&lt;/span&gt;&lt;/td&gt; <a name="l368"><span class="linenum"> 368</span></a> &lt;td&gt;Identique au bouton &quot;Suivant&quot; du navigateur&lt;/td&gt; <a name="l369"><span class="linenum"> 369</span></a> &lt;/tr&gt; <a name="l370"><span class="linenum"> 370</span></a> &lt;tr&gt; <a name="l371"><span class="linenum"> 371</span></a> &lt;td&gt;&lt;span class=&quot;new_code&quot;&gt;<a class="function" onClick="logFunction('authenticate')" href="../../../../_functions/authenticate.html" onMouseOver="funcPopup(event,'authenticate')">authenticate</a>(<a class="var it74" onMouseOver="hilite(74)" onMouseOut="lolite()" onClick="logVariable('name')" href="../../../../_variables/name.html">$name</a>, <a class="var it11" onMouseOver="hilite(11)" onMouseOut="lolite()" onClick="logVariable('password')" href="../../../../_variables/password.html">$password</a>)&lt;/span&gt;&lt;/td&gt; <a name="l372"><span class="linenum"> 372</span></a> &lt;td&gt;Re-essaye avec une tentative d'authentification&lt;/td&gt; <a name="l373"><span class="linenum"> 373</span></a> &lt;/tr&gt; <a name="l374"><span class="linenum"> 374</span></a> &lt;tr&gt; <a name="l375"><span class="linenum"> 375</span></a> &lt;td&gt;&lt;span class=&quot;new_code&quot;&gt;<a class="function" onClick="logFunction('getFrameFocus')" href="../../../../_functions/getframefocus.html" onMouseOver="funcPopup(event,'getframefocus')">getFrameFocus</a>()&lt;/span&gt;&lt;/td&gt; <a name="l376"><span class="linenum"> 376</span></a> &lt;td&gt;Le nom de la fenêtre en cours d'utilisation&lt;/td&gt; <a name="l377"><span class="linenum"> 377</span></a> &lt;/tr&gt; <a name="l378"><span class="linenum"> 378</span></a> &lt;tr&gt; <a name="l379"><span class="linenum"> 379</span></a> &lt;td&gt;&lt;span class=&quot;new_code&quot;&gt;<a class="function" onClick="logFunction('setFrameFocusByIndex')" href="../../../../_functions/setframefocusbyindex.html" onMouseOver="funcPopup(event,'setframefocusbyindex')">setFrameFocusByIndex</a>(<a class="var it904" onMouseOver="hilite(904)" onMouseOut="lolite()" onClick="logVariable('choice')" href="../../../../_variables/choice.html">$choice</a>)&lt;/span&gt;&lt;/td&gt; <a name="l380"><span class="linenum"> 380</span></a> &lt;td&gt;Change le focus d'une fenêtre en commençant par 1&lt;/td&gt; <a name="l381"><span class="linenum"> 381</span></a> &lt;/tr&gt; <a name="l382"><span class="linenum"> 382</span></a> &lt;tr&gt; <a name="l383"><span class="linenum"> 383</span></a> &lt;td&gt;&lt;span class=&quot;new_code&quot;&gt;<a class="function" onClick="logFunction('setFrameFocus')" href="../../../../_functions/setframefocus.html" onMouseOver="funcPopup(event,'setframefocus')">setFrameFocus</a>(<a class="var it74" onMouseOver="hilite(74)" onMouseOut="lolite()" onClick="logVariable('name')" href="../../../../_variables/name.html">$name</a>)&lt;/span&gt;&lt;/td&gt; <a name="l384"><span class="linenum"> 384</span></a> &lt;td&gt;Change le focus d'une fenêtre en utilisant son nom&lt;/td&gt; <a name="l385"><span class="linenum"> 385</span></a> &lt;/tr&gt; <a name="l386"><span class="linenum"> 386</span></a> &lt;tr&gt; <a name="l387"><span class="linenum"> 387</span></a> &lt;td&gt;&lt;span class=&quot;new_code&quot;&gt;<a class="function" onClick="logFunction('clearFrameFocus')" href="../../../../_functions/clearframefocus.html" onMouseOver="funcPopup(event,'clearframefocus')">clearFrameFocus</a>()&lt;/span&gt;&lt;/td&gt; <a name="l388"><span class="linenum"> 388</span></a> &lt;td&gt;Revient à un traitement de toutes les fenêtres comme une seule&lt;/td&gt; <a name="l389"><span class="linenum"> 389</span></a> &lt;/tr&gt; <a name="l390"><span class="linenum"> 390</span></a> &lt;tr&gt; <a name="l391"><span class="linenum"> 391</span></a> &lt;td&gt;&lt;span class=&quot;new_code&quot;&gt;<a class="function" onClick="logFunction('clickSubmit')" href="../../../../_functions/clicksubmit.html" onMouseOver="funcPopup(event,'clicksubmit')">clickSubmit</a>(<a class="var it106" onMouseOver="hilite(106)" onMouseOut="lolite()" onClick="logVariable('label')" href="../../../../_variables/label.html">$label</a>)&lt;/span&gt;&lt;/td&gt; <a name="l392"><span class="linenum"> 392</span></a> &lt;td&gt;Clique sur le premier bouton avec cette étiquette&lt;/td&gt; <a name="l393"><span class="linenum"> 393</span></a> &lt;/tr&gt; <a name="l394"><span class="linenum"> 394</span></a> &lt;tr&gt; <a name="l395"><span class="linenum"> 395</span></a> &lt;td&gt;&lt;span class=&quot;new_code&quot;&gt;<a class="function" onClick="logFunction('clickSubmitByName')" href="../../../../_functions/clicksubmitbyname.html" onMouseOver="funcPopup(event,'clicksubmitbyname')">clickSubmitByName</a>(<a class="var it74" onMouseOver="hilite(74)" onMouseOut="lolite()" onClick="logVariable('name')" href="../../../../_variables/name.html">$name</a>)&lt;/span&gt;&lt;/td&gt; <a name="l396"><span class="linenum"> 396</span></a> &lt;td&gt;Clique sur le bouton avec cet attribut de nom&lt;/td&gt; <a name="l397"><span class="linenum"> 397</span></a> &lt;/tr&gt; <a name="l398"><span class="linenum"> 398</span></a> &lt;tr&gt; <a name="l399"><span class="linenum"> 399</span></a> &lt;td&gt;&lt;span class=&quot;new_code&quot;&gt;<a class="function" onClick="logFunction('clickSubmitById')" href="../../../../_functions/clicksubmitbyid.html" onMouseOver="funcPopup(event,'clicksubmitbyid')">clickSubmitById</a>(<a class="var it36" onMouseOver="hilite(36)" onMouseOut="lolite()" onClick="logVariable('id')" href="../../../../_variables/id.html">$id</a>)&lt;/span&gt;&lt;/td&gt; <a name="l400"><span class="linenum"> 400</span></a> &lt;td&gt;Clique sur le bouton avec cet attribut d'identification&lt;/td&gt; <a name="l401"><span class="linenum"> 401</span></a> &lt;/tr&gt; <a name="l402"><span class="linenum"> 402</span></a> &lt;tr&gt; <a name="l403"><span class="linenum"> 403</span></a> &lt;td&gt;&lt;span class=&quot;new_code&quot;&gt;<a class="function" onClick="logFunction('clickImage')" href="../../../../_functions/clickimage.html" onMouseOver="funcPopup(event,'clickimage')">clickImage</a>(<a class="var it106" onMouseOver="hilite(106)" onMouseOut="lolite()" onClick="logVariable('label')" href="../../../../_variables/label.html">$label</a>, <a class="var it259" onMouseOver="hilite(259)" onMouseOut="lolite()" onClick="logVariable('x')" href="../../../../_variables/x.html">$x</a>, <a class="var it903" onMouseOver="hilite(903)" onMouseOut="lolite()" onClick="logVariable('y')" href="../../../../_variables/y.html">$y</a>)&lt;/span&gt;&lt;/td&gt; <a name="l404"><span class="linenum"> 404</span></a> &lt;td&gt;Clique sur une balise input de type image par son titre (title=&quot;*&quot;) our son texte alternatif (alt=&quot;*&quot;)&lt;/td&gt; <a name="l405"><span class="linenum"> 405</span></a> &lt;/tr&gt; <a name="l406"><span class="linenum"> 406</span></a> &lt;tr&gt; <a name="l407"><span class="linenum"> 407</span></a> &lt;td&gt;&lt;span class=&quot;new_code&quot;&gt;<a class="function" onClick="logFunction('clickImageByName')" href="../../../../_functions/clickimagebyname.html" onMouseOver="funcPopup(event,'clickimagebyname')">clickImageByName</a>(<a class="var it74" onMouseOver="hilite(74)" onMouseOut="lolite()" onClick="logVariable('name')" href="../../../../_variables/name.html">$name</a>, <a class="var it259" onMouseOver="hilite(259)" onMouseOut="lolite()" onClick="logVariable('x')" href="../../../../_variables/x.html">$x</a>, <a class="var it903" onMouseOver="hilite(903)" onMouseOut="lolite()" onClick="logVariable('y')" href="../../../../_variables/y.html">$y</a>)&lt;/span&gt;&lt;/td&gt; <a name="l408"><span class="linenum"> 408</span></a> &lt;td&gt;Clique sur une balise input de type image par son attribut (name=&quot;*&quot;)&lt;/td&gt; <a name="l409"><span class="linenum"> 409</span></a> &lt;/tr&gt; <a name="l410"><span class="linenum"> 410</span></a> &lt;tr&gt; <a name="l411"><span class="linenum"> 411</span></a> &lt;td&gt;&lt;span class=&quot;new_code&quot;&gt;<a class="function" onClick="logFunction('clickImageById')" href="../../../../_functions/clickimagebyid.html" onMouseOver="funcPopup(event,'clickimagebyid')">clickImageById</a>(<a class="var it36" onMouseOver="hilite(36)" onMouseOut="lolite()" onClick="logVariable('id')" href="../../../../_variables/id.html">$id</a>, <a class="var it259" onMouseOver="hilite(259)" onMouseOut="lolite()" onClick="logVariable('x')" href="../../../../_variables/x.html">$x</a>, <a class="var it903" onMouseOver="hilite(903)" onMouseOut="lolite()" onClick="logVariable('y')" href="../../../../_variables/y.html">$y</a>)&lt;/span&gt;&lt;/td&gt; <a name="l412"><span class="linenum"> 412</span></a> &lt;td&gt;Clique sur une balise input de type image par son identifiant (id=&quot;*&quot;)&lt;/td&gt; <a name="l413"><span class="linenum"> 413</span></a> &lt;/tr&gt; <a name="l414"><span class="linenum"> 414</span></a> &lt;tr&gt; <a name="l415"><span class="linenum"> 415</span></a> &lt;td&gt;&lt;span class=&quot;new_code&quot;&gt;<a class="function" onClick="logFunction('submitFormById')" href="../../../../_functions/submitformbyid.html" onMouseOver="funcPopup(event,'submitformbyid')">submitFormById</a>(<a class="var it36" onMouseOver="hilite(36)" onMouseOut="lolite()" onClick="logVariable('id')" href="../../../../_variables/id.html">$id</a>)&lt;/span&gt;&lt;/td&gt; <a name="l416"><span class="linenum"> 416</span></a> &lt;td&gt;Soumet un formulaire sans valeur de soumission&lt;/td&gt; <a name="l417"><span class="linenum"> 417</span></a> &lt;/tr&gt; <a name="l418"><span class="linenum"> 418</span></a> &lt;tr&gt; <a name="l419"><span class="linenum"> 419</span></a> &lt;td&gt;&lt;span class=&quot;new_code&quot;&gt;<a class="function" onClick="logFunction('clickLink')" href="../../../../_functions/clicklink.html" onMouseOver="funcPopup(event,'clicklink')">clickLink</a>(<a class="var it106" onMouseOver="hilite(106)" onMouseOut="lolite()" onClick="logVariable('label')" href="../../../../_variables/label.html">$label</a>, <a class="var it370" onMouseOver="hilite(370)" onMouseOut="lolite()" onClick="logVariable('index')" href="../../../../_variables/index.html">$index</a>)&lt;/span&gt;&lt;/td&gt; <a name="l420"><span class="linenum"> 420</span></a> &lt;td&gt;Clique sur une ancre avec ce texte d'étiquette visible&lt;/td&gt; <a name="l421"><span class="linenum"> 421</span></a> &lt;/tr&gt; <a name="l422"><span class="linenum"> 422</span></a> &lt;tr&gt; <a name="l423"><span class="linenum"> 423</span></a> &lt;td&gt;&lt;span class=&quot;new_code&quot;&gt;<a class="function" onClick="logFunction('clickLinkById')" href="../../../../_functions/clicklinkbyid.html" onMouseOver="funcPopup(event,'clicklinkbyid')">clickLinkById</a>(<a class="var it36" onMouseOver="hilite(36)" onMouseOut="lolite()" onClick="logVariable('id')" href="../../../../_variables/id.html">$id</a>)&lt;/span&gt;&lt;/td&gt; <a name="l424"><span class="linenum"> 424</span></a> &lt;td&gt;Clique sur une ancre avec cet attribut d'identification&lt;/td&gt; <a name="l425"><span class="linenum"> 425</span></a> &lt;/tr&gt; <a name="l426"><span class="linenum"> 426</span></a> &lt;/tbody&gt;&lt;/table&gt; <a name="l427"><span class="linenum"> 427</span></a> &lt;/p&gt; <a name="l428"><span class="linenum"> 428</span></a> &lt;p&gt; <a name="l429"><span class="linenum"> 429</span></a> Les paramètres dans les méthodes &lt;span class=&quot;new_code&quot;&gt;<a class="function" onClick="logFunction('get')" href="../../../../_functions/get.html" onMouseOver="funcPopup(event,'get')">get</a>()&lt;/span&gt;, <a name="l430"><span class="linenum"> 430</span></a> &lt;span class=&quot;new_code&quot;&gt;<a class="function" onClick="logFunction('post')" href="../../../../_functions/post.html" onMouseOver="funcPopup(event,'post')">post</a>()&lt;/span&gt; et &lt;span class=&quot;new_code&quot;&gt;<a class="function" onClick="logFunction('head')" href="../../../../_functions/head.html" onMouseOver="funcPopup(event,'head')">head</a>()&lt;/span&gt; sont optionnels. <a name="l431"><span class="linenum"> 431</span></a> Le téléchargement via HTTP HEAD ne modifie pas <a name="l432"><span class="linenum"> 432</span></a> le contexte du navigateur, il se limite au chargement des cookies. <a name="l433"><span class="linenum"> 433</span></a> Cela peut être utilise lorsqu'une image ou une feuille de style <a name="l434"><span class="linenum"> 434</span></a> initie un cookie pour bloquer un robot trop entreprenant. <a name="l435"><span class="linenum"> 435</span></a> &lt;/p&gt; <a name="l436"><span class="linenum"> 436</span></a> &lt;p&gt; <a name="l437"><span class="linenum"> 437</span></a> Les commandes &lt;span class=&quot;new_code&quot;&gt;<a class="function" onClick="logFunction('retry')" href="../../../../_functions/retry.html" onMouseOver="funcPopup(event,'retry')">retry</a>()&lt;/span&gt;, &lt;span class=&quot;new_code&quot;&gt;<a class="function" onClick="logFunction('back')" href="../../../../_functions/back.html" onMouseOver="funcPopup(event,'back')">back</a>()&lt;/span&gt; <a name="l438"><span class="linenum"> 438</span></a> et &lt;span class=&quot;new_code&quot;&gt;<a class="function" onClick="logFunction('forward')" href="../../../../_functions/forward.html" onMouseOver="funcPopup(event,'forward')">forward</a>()&lt;/span&gt; fonctionnent exactement comme <a name="l439"><span class="linenum"> 439</span></a> dans un navigateur. Elles utilisent l'historique pour <a name="l440"><span class="linenum"> 440</span></a> relancer les pages. Une technique bien pratique pour <a name="l441"><span class="linenum"> 441</span></a> vérifier les effets d'un bouton retour sur vos formulaires. <a name="l442"><span class="linenum"> 442</span></a> &lt;/p&gt; <a name="l443"><span class="linenum"> 443</span></a> &lt;p&gt; <a name="l444"><span class="linenum"> 444</span></a> Les méthodes sur les fenêtres méritent une petite explication. <a name="l445"><span class="linenum"> 445</span></a> Par défaut, une page avec des fenêtres est traitée comme toutes <a name="l446"><span class="linenum"> 446</span></a> les autres. Le contenu sera vérifié à travers l'ensemble de <a name="l447"><span class="linenum"> 447</span></a> la &quot;frameset&quot;, par conséquent un lien fonctionnera, <a name="l448"><span class="linenum"> 448</span></a> peu importe la fenêtre qui contient la balise ancre. <a name="l449"><span class="linenum"> 449</span></a> Vous pouvez outrepassé ce comportement en exigeant <a name="l450"><span class="linenum"> 450</span></a> le focus sur une unique fenêtre. Si vous réalisez cela, <a name="l451"><span class="linenum"> 451</span></a> toutes les recherches et toutes les actions se limiteront <a name="l452"><span class="linenum"> 452</span></a> à cette unique fenêtre, y compris les demandes d'authentification. <a name="l453"><span class="linenum"> 453</span></a> Si un lien ou un bouton n'est pas dans la fenêtre en focus alors <a name="l454"><span class="linenum"> 454</span></a> il ne peut pas être cliqué. <a name="l455"><span class="linenum"> 455</span></a> &lt;/p&gt; <a name="l456"><span class="linenum"> 456</span></a> &lt;p&gt; <a name="l457"><span class="linenum"> 457</span></a> Tester la navigation sur des pages fixes ne vous alerte que <a name="l458"><span class="linenum"> 458</span></a> quand vous avez cassé un script entier. <a name="l459"><span class="linenum"> 459</span></a> Pour des pages fortement dynamiques, <a name="l460"><span class="linenum"> 460</span></a> un forum de discussion par exemple, <a name="l461"><span class="linenum"> 461</span></a> ça peut être crucial pour vérifier l'état de l'application. <a name="l462"><span class="linenum"> 462</span></a> Pour la plupart des applications cependant, <a name="l463"><span class="linenum"> 463</span></a> la logique vraiment délicate se situe dans la gestion <a name="l464"><span class="linenum"> 464</span></a> des formulaires et des sessions. <a name="l465"><span class="linenum"> 465</span></a> Heureusement SimpleTest aussi inclut <a name="l466"><span class="linenum"> 466</span></a> &lt;a href=&quot;form_testing_documentation.html&quot;&gt; <a name="l467"><span class="linenum"> 467</span></a> des outils pour tester des formulaires web&lt;/a&gt;. <a name="l468"><span class="linenum"> 468</span></a> &lt;/p&gt; <a name="l469"><span class="linenum"> 469</span></a> <a name="l470"><span class="linenum"> 470</span></a> &lt;h2&gt; <a name="l471"><span class="linenum"> 471</span></a> &lt;a class=&quot;target&quot; name=&quot;requete&quot;&gt;&lt;/a&gt;Modifier la requête&lt;/h2&gt; <a name="l472"><span class="linenum"> 472</span></a> &lt;p&gt; <a name="l473"><span class="linenum"> 473</span></a> Bien que SimpleTest n'ait pas comme objectif <a name="l474"><span class="linenum"> 474</span></a> de contrôler des erreurs réseau, il contient quand même <a name="l475"><span class="linenum"> 475</span></a> des méthodes pour modifier et déboguer les requêtes qu'il lance. <a name="l476"><span class="linenum"> 476</span></a> Voici une autre liste de méthode... <a name="l477"><span class="linenum"> 477</span></a> &lt;table&gt;&lt;tbody&gt; <a name="l478"><span class="linenum"> 478</span></a> &lt;tr&gt; <a name="l479"><span class="linenum"> 479</span></a> &lt;td&gt;&lt;span class=&quot;new_code&quot;&gt;<a class="function" onClick="logFunction('getTransportError')" href="../../../../_functions/gettransporterror.html" onMouseOver="funcPopup(event,'gettransporterror')">getTransportError</a>()&lt;/span&gt;&lt;/td&gt; <a name="l480"><span class="linenum"> 480</span></a> &lt;td&gt;La dernière erreur de socket&lt;/td&gt; <a name="l481"><span class="linenum"> 481</span></a> &lt;/tr&gt; <a name="l482"><span class="linenum"> 482</span></a> &lt;tr&gt; <a name="l483"><span class="linenum"> 483</span></a> &lt;td&gt;&lt;span class=&quot;new_code&quot;&gt;<a class="function" onClick="logFunction('getUrl')" href="../../../../_functions/geturl.html" onMouseOver="funcPopup(event,'geturl')">getUrl</a>()&lt;/span&gt;&lt;/td&gt; <a name="l484"><span class="linenum"> 484</span></a> &lt;td&gt;La localisation courante&lt;/td&gt; <a name="l485"><span class="linenum"> 485</span></a> &lt;/tr&gt; <a name="l486"><span class="linenum"> 486</span></a> &lt;tr&gt; <a name="l487"><span class="linenum"> 487</span></a> &lt;td&gt;&lt;span class=&quot;new_code&quot;&gt;<a class="function" onClick="logFunction('showRequest')" href="../../../../_functions/showrequest.html" onMouseOver="funcPopup(event,'showrequest')">showRequest</a>()&lt;/span&gt;&lt;/td&gt; <a name="l488"><span class="linenum"> 488</span></a> &lt;td&gt;Déverse la requête sortante&lt;/td&gt; <a name="l489"><span class="linenum"> 489</span></a> &lt;/tr&gt; <a name="l490"><span class="linenum"> 490</span></a> &lt;tr&gt; <a name="l491"><span class="linenum"> 491</span></a> &lt;td&gt;&lt;span class=&quot;new_code&quot;&gt;<a class="function" onClick="logFunction('showHeaders')" href="../../../../_functions/showheaders.html" onMouseOver="funcPopup(event,'showheaders')">showHeaders</a>()&lt;/span&gt;&lt;/td&gt; <a name="l492"><span class="linenum"> 492</span></a> &lt;td&gt;Déverse les entêtes d'entrée&lt;/td&gt; <a name="l493"><span class="linenum"> 493</span></a> &lt;/tr&gt; <a name="l494"><span class="linenum"> 494</span></a> &lt;tr&gt; <a name="l495"><span class="linenum"> 495</span></a> &lt;td&gt;&lt;span class=&quot;new_code&quot;&gt;<a class="function" onClick="logFunction('showSource')" href="../../../../_functions/showsource.html" onMouseOver="funcPopup(event,'showsource')">showSource</a>()&lt;/span&gt;&lt;/td&gt; <a name="l496"><span class="linenum"> 496</span></a> &lt;td&gt;Déverse le contenu brut de la page HTML&lt;/td&gt; <a name="l497"><span class="linenum"> 497</span></a> &lt;/tr&gt; <a name="l498"><span class="linenum"> 498</span></a> &lt;tr&gt; <a name="l499"><span class="linenum"> 499</span></a> &lt;td&gt;&lt;span class=&quot;new_code&quot;&gt;<a class="function" onClick="logFunction('ignoreFrames')" href="../../../../_functions/ignoreframes.html" onMouseOver="funcPopup(event,'ignoreframes')">ignoreFrames</a>()&lt;/span&gt;&lt;/td&gt; <a name="l500"><span class="linenum"> 500</span></a> &lt;td&gt;Ne recharge pas les framesets&lt;/td&gt; <a name="l501"><span class="linenum"> 501</span></a> &lt;/tr&gt; <a name="l502"><span class="linenum"> 502</span></a> &lt;tr&gt; <a name="l503"><span class="linenum"> 503</span></a> &lt;td&gt;&lt;span class=&quot;new_code&quot;&gt;<a class="phpfunction" onClick="logFunction('setCookie')" href="../../../../_functions/setcookie.html" onMouseOver="phpfuncPopup(event,'setcookie')">setCookie</a>(<a class="var it74" onMouseOver="hilite(74)" onMouseOut="lolite()" onClick="logVariable('name')" href="../../../../_variables/name.html">$name</a>, <a class="var it67" onMouseOver="hilite(67)" onMouseOut="lolite()" onClick="logVariable('value')" href="../../../../_variables/value.html">$value</a>)&lt;/span&gt;&lt;/td&gt; <a name="l504"><span class="linenum"> 504</span></a> &lt;td&gt;Initie un cookie à partir de maintenant&lt;/td&gt; <a name="l505"><span class="linenum"> 505</span></a> &lt;/tr&gt; <a name="l506"><span class="linenum"> 506</span></a> &lt;tr&gt; <a name="l507"><span class="linenum"> 507</span></a> &lt;td&gt;&lt;span class=&quot;new_code&quot;&gt;<a class="function" onClick="logFunction('addHeader')" href="../../../../_functions/addheader.html" onMouseOver="funcPopup(event,'addheader')">addHeader</a>(<a class="var it251" onMouseOver="hilite(251)" onMouseOut="lolite()" onClick="logVariable('header')" href="../../../../_variables/header.html">$header</a>)&lt;/span&gt;&lt;/td&gt; <a name="l508"><span class="linenum"> 508</span></a> &lt;td&gt;Ajoute toujours cette entête à la requête&lt;/td&gt; <a name="l509"><span class="linenum"> 509</span></a> &lt;/tr&gt; <a name="l510"><span class="linenum"> 510</span></a> &lt;tr&gt; <a name="l511"><span class="linenum"> 511</span></a> &lt;td&gt;&lt;span class=&quot;new_code&quot;&gt;<a class="function" onClick="logFunction('setMaximumRedirects')" href="../../../../_functions/setmaximumredirects.html" onMouseOver="funcPopup(event,'setmaximumredirects')">setMaximumRedirects</a>(<a class="var it905" onMouseOver="hilite(905)" onMouseOut="lolite()" onClick="logVariable('max')" href="../../../../_variables/max.html">$max</a>)&lt;/span&gt;&lt;/td&gt; <a name="l512"><span class="linenum"> 512</span></a> &lt;td&gt;S'arrête après autant de redirections&lt;/td&gt; <a name="l513"><span class="linenum"> 513</span></a> &lt;/tr&gt; <a name="l514"><span class="linenum"> 514</span></a> &lt;tr&gt; <a name="l515"><span class="linenum"> 515</span></a> &lt;td&gt;&lt;span class=&quot;new_code&quot;&gt;<a class="function" onClick="logFunction('setConnectionTimeout')" href="../../../../_functions/setconnectiontimeout.html" onMouseOver="funcPopup(event,'setconnectiontimeout')">setConnectionTimeout</a>(<a class="var it786" onMouseOver="hilite(786)" onMouseOut="lolite()" onClick="logVariable('timeout')" href="../../../../_variables/timeout.html">$timeout</a>)&lt;/span&gt;&lt;/td&gt; <a name="l516"><span class="linenum"> 516</span></a> &lt;td&gt;Termine la connexion après autant de temps entre les bytes&lt;/td&gt; <a name="l517"><span class="linenum"> 517</span></a> &lt;/tr&gt; <a name="l518"><span class="linenum"> 518</span></a> &lt;tr&gt; <a name="l519"><span class="linenum"> 519</span></a> &lt;td&gt;&lt;span class=&quot;new_code&quot;&gt;<a class="function" onClick="logFunction('useProxy')" href="../../../../_functions/useproxy.html" onMouseOver="funcPopup(event,'useproxy')">useProxy</a>(<a class="var it900" onMouseOver="hilite(900)" onMouseOut="lolite()" onClick="logVariable('proxy')" href="../../../../_variables/proxy.html">$proxy</a>, <a class="var it74" onMouseOver="hilite(74)" onMouseOut="lolite()" onClick="logVariable('name')" href="../../../../_variables/name.html">$name</a>, <a class="var it11" onMouseOver="hilite(11)" onMouseOut="lolite()" onClick="logVariable('password')" href="../../../../_variables/password.html">$password</a>)&lt;/span&gt;&lt;/td&gt; <a name="l520"><span class="linenum"> 520</span></a> &lt;td&gt;Effectue les requêtes à travers ce proxy d'URL&lt;/td&gt; <a name="l521"><span class="linenum"> 521</span></a> &lt;/tr&gt; <a name="l522"><span class="linenum"> 522</span></a> &lt;/tbody&gt;&lt;/table&gt; <a name="l523"><span class="linenum"> 523</span></a> &lt;/p&gt; <a name="l524"><span class="linenum"> 524</span></a> <a name="l525"><span class="linenum"> 525</span></a> &lt;/div&gt; <a name="l526"><span class="linenum"> 526</span></a> References and related information... <a name="l527"><span class="linenum"> 527</span></a> &lt;ul&gt; <a name="l528"><span class="linenum"> 528</span></a> &lt;li&gt; <a name="l529"><span class="linenum"> 529</span></a> La page du projet SimpleTest sur <a name="l530"><span class="linenum"> 530</span></a> &lt;a href=&quot;http://sourceforge.net/projects/simpletest/&quot;&gt;SourceForge&lt;/a&gt;. <a name="l531"><span class="linenum"> 531</span></a> &lt;/li&gt; <a name="l532"><span class="linenum"> 532</span></a> &lt;li&gt; <a name="l533"><span class="linenum"> 533</span></a> La page de téléchargement de SimpleTest sur <a name="l534"><span class="linenum"> 534</span></a> &lt;a href=&quot;http://www.lastcraft.com/simple_test.php&quot;&gt;LastCraft&lt;/a&gt;. <a name="l535"><span class="linenum"> 535</span></a> &lt;/li&gt; <a name="l536"><span class="linenum"> 536</span></a> &lt;li&gt; <a name="l537"><span class="linenum"> 537</span></a> &lt;a href=&quot;http://simpletest.org/api/&quot;&gt;L'API du développeur pour SimpleTest&lt;/a&gt; <a name="l538"><span class="linenum"> 538</span></a> donne tous les détails sur les classes et les assertions disponibles. <a name="l539"><span class="linenum"> 539</span></a> &lt;/li&gt; <a name="l540"><span class="linenum"> 540</span></a> &lt;/ul&gt; <a name="l541"><span class="linenum"> 541</span></a> &lt;div class=&quot;menu_back&quot;&gt;&lt;div class=&quot;menu&quot;&gt; <a name="l542"><span class="linenum"> 542</span></a> &lt;a href=&quot;index.html&quot;&gt;SimpleTest&lt;/a&gt; <a name="l543"><span class="linenum"> 543</span></a> | <a name="l544"><span class="linenum"> 544</span></a> &lt;a href=&quot;overview.html&quot;&gt;Overview&lt;/a&gt; <a name="l545"><span class="linenum"> 545</span></a> | <a name="l546"><span class="linenum"> 546</span></a> &lt;a href=&quot;unit_test_documentation.html&quot;&gt;Unit tester&lt;/a&gt; <a name="l547"><span class="linenum"> 547</span></a> | <a name="l548"><span class="linenum"> 548</span></a> &lt;a href=&quot;group_test_documentation.html&quot;&gt;Group tests&lt;/a&gt; <a name="l549"><span class="linenum"> 549</span></a> | <a name="l550"><span class="linenum"> 550</span></a> &lt;a href=&quot;mock_objects_documentation.html&quot;&gt;Mock objects&lt;/a&gt; <a name="l551"><span class="linenum"> 551</span></a> | <a name="l552"><span class="linenum"> 552</span></a> &lt;a href=&quot;partial_mocks_documentation.html&quot;&gt;Partial mocks&lt;/a&gt; <a name="l553"><span class="linenum"> 553</span></a> | <a name="l554"><span class="linenum"> 554</span></a> &lt;a href=&quot;reporter_documentation.html&quot;&gt;Reporting&lt;/a&gt; <a name="l555"><span class="linenum"> 555</span></a> | <a name="l556"><span class="linenum"> 556</span></a> &lt;a href=&quot;expectation_documentation.html&quot;&gt;Expectations&lt;/a&gt; <a name="l557"><span class="linenum"> 557</span></a> | <a name="l558"><span class="linenum"> 558</span></a> &lt;a href=&quot;web_tester_documentation.html&quot;&gt;Web tester&lt;/a&gt; <a name="l559"><span class="linenum"> 559</span></a> | <a name="l560"><span class="linenum"> 560</span></a> &lt;a href=&quot;form_testing_documentation.html&quot;&gt;Testing forms&lt;/a&gt; <a name="l561"><span class="linenum"> 561</span></a> | <a name="l562"><span class="linenum"> 562</span></a> &lt;a href=&quot;authentication_documentation.html&quot;&gt;Authentication&lt;/a&gt; <a name="l563"><span class="linenum"> 563</span></a> | <a name="l564"><span class="linenum"> 564</span></a> &lt;a href=&quot;browser_documentation.html&quot;&gt;Scriptable browser&lt;/a&gt; <a name="l565"><span class="linenum"> 565</span></a> &lt;/div&gt;&lt;/div&gt; <a name="l566"><span class="linenum"> 566</span></a> &lt;div class=&quot;copyright&quot;&gt; <a name="l567"><span class="linenum"> 567</span></a> Copyright&lt;br&gt;Marcus Baker 2006 <a name="l568"><span class="linenum"> 568</span></a> &lt;/div&gt; <a name="l569"><span class="linenum"> 569</span></a> &lt;/body&gt; <a name="l570"><span class="linenum"> 570</span></a> &lt;/html&gt; </pre> </div> <script language="JavaScript" type="text/javascript"> FUNC_DATA={ 'assertresponse': ['assertresponse', 'Checks the response code against a list of possible values. ', [['tests/simpletest','web_tester.php',1227]], 66], 'gettransporterror': ['gettransporterror', 'Gets the last response error. ', [['tests/simpletest','web_tester.php',518],['tests/simpletest','frames.php',230],['tests/simpletest','page.php',162],['tests/simpletest','browser.php',696]], 14], 'addheader': ['addheader', 'Adds a header to every fetch. ', [['tests/simpletest','web_tester.php',642],['tests/simpletest','user_agent.php',65],['tests/simpletest','browser.php',368]], 35], 'clicksubmitbyname': ['clicksubmitbyname', 'Clicks the submit button by name attribute. The owning form will be submitted by this. ', [['tests/simpletest','web_tester.php',905],['tests/simpletest','browser.php',909]], 11], 'forward': ['forward', 'Equivalent to hitting the forward button on the browser. ', [['tests/simpletest','web_tester.php',778],['tests/simpletest','browser.php',121],['tests/simpletest','browser.php',599]], 15], 'post': ['post', 'Fetch an item from the POST array ', [['bonfire/codeigniter/core','Input.php',164],['tests/simpletest','web_tester.php',703],['tests/simpletest','browser.php',507]], 194], 'setconnectiontimeout': ['setconnectiontimeout', 'Sets the socket timeout for opening a connection and receiving at least one byte of information. ', [['tests/simpletest','web_tester.php',666],['tests/simpletest','user_agent.php',143],['tests/simpletest','browser.php',446]], 9], 'assertlink': ['assertlink', 'Tests for the presence of a link label. Match is case insensitive with normalised space. ', [['tests/simpletest','web_tester.php',1043]], 13], 'clicksubmitbyid': ['clicksubmitbyid', 'Clicks the submit button by ID attribute. The owning form will be submitted by this. ', [['tests/simpletest','web_tester.php',918],['tests/simpletest','browser.php',927]], 9], 'assertfieldbyid': ['assertfieldbyid', 'Confirms that the form element is currently set to the expected value. A missing form will always fail. If no ID is given then only the existence of the field is checked. ', [['tests/simpletest','web_tester.php',1185]], 13], 'clickimagebyname': ['clickimagebyname', 'Clicks the submit image by the name. Usually the alt tag or the nearest equivalent. The owning form will be submitted by this. Clicking outside of the boundary of the coordinates will result in a failure. ', [['tests/simpletest','web_tester.php',961],['tests/simpletest','browser.php',979]], 7], 'assertcookie': ['assertcookie', 'Checks that a cookie is set for the current page and optionally checks the value. ', [['tests/simpletest','web_tester.php',1423]], 18], 'assertheader': ['assertheader', 'Checks each header line for the required value. If no value is given then only an existence check is made. ', [['tests/simpletest','web_tester.php',1314]], 7], 'useproxy': ['useproxy', 'Sets proxy to use on all requests for when testing from behind a firewall. Set URL to false to disable. ', [['tests/simpletest','web_tester.php',676],['tests/simpletest','simpletest.php',118],['tests/simpletest','user_agent.php',162],['tests/simpletest','browser.php',455]], 9], 'showheaders': ['showheaders', 'Dumps the current HTTP headers for debugging. ', [['tests/simpletest','web_tester.php',545]], 4], 'geturl': ['geturl', 'Resource name. ', [['tests/simpletest','http.php',35],['tests/simpletest','http.php',542],['tests/simpletest','web_tester.php',527],['tests/simpletest','frames.php',254],['tests/simpletest','page.php',135],['tests/simpletest','browser.php',81],['tests/simpletest','browser.php',743]], 44], 'clickimagebyid': ['clickimagebyid', 'Clicks the submit image by ID attribute. The owning form will be submitted by this. Clicking outside of the boundary of the coordinates will result in a failure. ', [['tests/simpletest','web_tester.php',979],['tests/simpletest','browser.php',1002]], 7], 'assertnolink': ['assertnolink', 'Tests for the non-presence of a link label. Match is case insensitive with normalised space. ', [['tests/simpletest','web_tester.php',1064]], 6], 'showsource': ['showsource', 'Dumps the current HTML source for debugging. ', [['tests/simpletest','web_tester.php',553]], 2], 'testcontact': ['testcontact', '', [['tests/simpletest/docs/en','web_tester_documentation.html',329],['tests/simpletest/docs/fr','web_tester_documentation.html',326]], 0], 'assertmime': ['assertmime', 'Checks the mime type against a list of possible values. ', [['tests/simpletest','web_tester.php',1244]], 5], 'head': ['head', 'Does a HTTP HEAD fetch, fetching only the page headers. The current base URL is unchanged by this. ', [['tests/simpletest','web_tester.php',745],['tests/simpletest','browser.php',468]], 9], 'prefer': ['prefer', 'Puts the object to the global pool of \'preferred\' objects which can be retrieved with SimpleTest :: preferred() method. Instances of the same class are overwritten. ', [['tests/simpletest','simpletest.php',69]], 4], 'assertauthentication': ['assertauthentication', 'Attempt to match the authentication type within the security realm we are currently matching. ', [['tests/simpletest','web_tester.php',1260]], 7], 'testhomepage': ['testhomepage', '', [['tests/simpletest/docs/en','web_tester_documentation.html',114],['tests/simpletest/docs/en','web_tester_documentation.html',148],['tests/simpletest/docs/en','web_tester_documentation.html',288],['tests/simpletest/docs/en','web_tester_documentation.html',309],['tests/simpletest/docs/fr','overview.html',81],['tests/simpletest/docs/fr','web_tester_documentation.html',118],['tests/simpletest/docs/fr','web_tester_documentation.html',153],['tests/simpletest/docs/fr','web_tester_documentation.html',264],['tests/simpletest/docs/fr','web_tester_documentation.html',285],['tests/simpletest/docs/fr','web_tester_documentation.html',306]], 0], 'assertnocookie': ['assertnocookie', 'Checks that no cookie is present or that it has been successfully cleared. ', [['tests/simpletest','web_tester.php',1446]], 11], 'clearframefocus': ['clearframefocus', 'Clears the frame focus. All frames will be searched for content. ', [['tests/simpletest','web_tester.php',859],['tests/simpletest','frames.php',152],['tests/simpletest','page.php',251],['tests/simpletest','browser.php',687]], 18], 'setmaximumredirects': ['setmaximumredirects', 'Sets the maximum number of redirects before the web page is loaded regardless. ', [['tests/simpletest','web_tester.php',652],['tests/simpletest','user_agent.php',152],['tests/simpletest','browser.php',426]], 19], 'retry': ['retry', 'Equivalent to hitting the retry button on the browser. Will attempt to repeat the page fetch. ', [['tests/simpletest','web_tester.php',757],['tests/simpletest','browser.php',555]], 27], 'clicklink': ['clicklink', 'Follows a link by name. Will click the first link found with this link text by default, or a later one if an index is given. Match is case insensitive with normalised space. ', [['tests/simpletest','web_tester.php',1019],['tests/simpletest','browser.php',1073]], 48], 'authenticate': ['authenticate', 'Retries a request after setting the authentication for the current realm. ', [['tests/simpletest','web_tester.php',789],['tests/simpletest','browser.php',619]], 19], 'assertnoauthentication': ['assertnoauthentication', 'Checks that no authentication is necessary to view the desired page. ', [['tests/simpletest','web_tester.php',1284]], 2], 'asserttrue': ['asserttrue', 'Called from within the test methods to register passes and failures. ', [['tests/simpletest','web_tester.php',1460],['tests/simpletest','unit_tester.php',39],['tests/simpletest/extensions','pear_test_case.php',114],['tests/simpletest','shell_tester.php',131]], 495], 'webtests': ['webtests', '', [['tests/simpletest/docs/en','web_tester_documentation.html',97],['tests/simpletest/docs/fr','web_tester_documentation.html',101]], 0], 'submitformbyid': ['submitformbyid', 'Submits a form by the ID. ', [['tests/simpletest','web_tester.php',1008],['tests/simpletest','browser.php',1035]], 6], 'assertfield': ['assertfield', 'Confirms that the form element is currently set to the expected value. A missing form will always fail. If no value is given then only the existence of the field is checked. ', [['tests/simpletest','web_tester.php',1149]], 57], 'clicklinkbyid': ['clicklinkbyid', 'Follows a link by id attribute. ', [['tests/simpletest','web_tester.php',1033],['tests/simpletest','browser.php',1102]], 8], 'get': ['get', 'Fetch from cache ', [['bonfire/libraries','BF_Cache_file.php',47],['tests/simpletest/docs/fr','mock_objects_documentation.html',310],['bonfire/codeigniter/database','DB_active_rec.php',937],['bonfire/libraries','JSMin.php',187],['bonfire/libraries','template.php',648],['bonfire/codeigniter/core','Input.php',136],['bonfire/codeigniter/libraries/Cache/drivers','Cache_apc.php',30],['tests/simpletest','web_tester.php',689],['tests/_support','database.php',31],['bonfire/codeigniter/libraries/Cache/drivers','Cache_memcached.php',42],['bonfire/codeigniter/libraries/Cache/drivers','Cache_file.php',47],['bonfire/codeigniter/libraries/Cache','Cache.php',54],['bonfire/codeigniter/libraries/Cache/drivers','Cache_dummy.php',30],['tests/simpletest/docs/en','mock_objects_documentation.html',291],['tests/simpletest','simpletest.php',299],['tests/simpletest','browser.php',489]], 432], 'showrequest': ['showrequest', 'Dumps the current request for debugging. ', [['tests/simpletest','web_tester.php',537]], 3], 'clickimage': ['clickimage', 'Clicks the submit image by some kind of label. Usually the alt tag or the nearest equivalent. The owning form will be submitted by this. Clicking outside of the boundary of the coordinates will result in a failure. ', [['tests/simpletest','web_tester.php',943],['tests/simpletest','browser.php',956]], 10], 'addfile': ['addfile', 'Builds a test suite from a library of test cases. The new suite is composed into this one. ', [['tests/simpletest','test_case.php',525]], 75], 'getframefocus': ['getframefocus', 'Accessor for current frame focus. Will be false if no frame has focus. ', [['tests/simpletest','web_tester.php',827],['tests/simpletest','frames.php',77],['tests/simpletest','page.php',221],['tests/simpletest','browser.php',655]], 24], 'back': ['back', 'Equivalent to hitting the back button on the browser. ', [['tests/simpletest','web_tester.php',767],['tests/simpletest','browser.php',107],['tests/simpletest','browser.php',579]], 19], 'setframefocusbyindex': ['setframefocusbyindex', 'Sets the focus by index. The integer index starts from 1. ', [['tests/simpletest','web_tester.php',839],['tests/simpletest','frames.php',110],['tests/simpletest','page.php',231],['tests/simpletest','browser.php',667]], 27], 'assertrealm': ['assertrealm', 'Attempts to match the current security realm. ', [['tests/simpletest','web_tester.php',1297]], 10], 'setframefocus': ['setframefocus', 'Sets the focus by name. ', [['tests/simpletest','web_tester.php',849],['tests/simpletest','frames.php',131],['tests/simpletest','page.php',241],['tests/simpletest','browser.php',677]], 62], 'clicksubmit': ['clicksubmit', 'Clicks the submit button by label. The owning form will be submitted by this. ', [['tests/simpletest','web_tester.php',891],['tests/simpletest','browser.php',890]], 65], 'ignoreframes': ['ignoreframes', 'Disables frames support. Frames will not be fetched and the frameset page will be used instead. ', [['tests/simpletest','web_tester.php',597],['tests/simpletest','browser.php',227]], 8], 'assertlinkbyid': ['assertlinkbyid', 'Tests for the presence of a link id attribute. ', [['tests/simpletest','web_tester.php',1080]], 3], 'testsuite': ['testsuite', 'Sets the name of the test suite. ', [['tests/simpletest','test_case.php',481]], 25], 'asserttitle': ['asserttitle', 'Tests the text between the title tags. ', [['tests/simpletest','web_tester.php',1347]], 49], 'setcookie': ['setcookie', '', [], 44]}; CLASS_DATA={ 'simpletest': ['simpletest', 'Registry and test context. Includes a few global options that I\'m slowly getting rid of. ', [['tests/simpletest','simpletest.php',17]], 90], 'webtestcase': ['webtestcase', 'Test case for testing of web pages. Allows fetching of pages, parsing of HTML and submitting forms. ', [['tests/simpletest','web_tester.php',426]], 67], 'webtests': ['webtests', '', [['tests/simpletest/docs/en','web_tester_documentation.html',96],['tests/simpletest/docs/fr','web_tester_documentation.html',100]], 0], 'testoflastcraft': ['testoflastcraft', '', [['tests/simpletest/docs/en','web_tester_documentation.html',112],['tests/simpletest/docs/en','web_tester_documentation.html',146],['tests/simpletest/docs/en','web_tester_documentation.html',266],['tests/simpletest/docs/en','web_tester_documentation.html',286],['tests/simpletest/docs/en','web_tester_documentation.html',307],['tests/simpletest/docs/en','web_tester_documentation.html',327],['tests/simpletest/docs/fr','web_tester_documentation.html',116],['tests/simpletest/docs/fr','web_tester_documentation.html',151],['tests/simpletest/docs/fr','web_tester_documentation.html',262],['tests/simpletest/docs/fr','web_tester_documentation.html',283],['tests/simpletest/docs/fr','web_tester_documentation.html',304],['tests/simpletest/docs/fr','web_tester_documentation.html',324]], 0], 'testsuite': ['testsuite', 'This is a composite test class for combining test cases and other RunnableTest classes into a group test. ', [['tests/simpletest','test_case.php',470]], 43], 'textreporter': ['textreporter', 'Sample minimal test displayer. Generates only failure messages and a pass count. For command line use. I\'ve tried to make it look like JUnit, but I wanted to output the errors as they arrived which meant dropping the dots. ', [['tests/simpletest','reporter.php',185]], 22]}; CONST_DATA={ }; </script> <div id="func-popup" class="funcpopup"><p id="func-title" class="popup-title">title</p><p id="func-desc" class="popup-desc">Description</p><p id="func-body" class="popup-body">Body</p></div> <div id="class-popup" class="funcpopup"><p id="class-title" class="popup-title">title</p><p id="class-desc" class="popup-desc">Description</p><p id="class-body" class="popup-body">Body</p></div> <div id="const-popup" class="funcpopup"><p id="const-title" class="popup-title">title</p><p id="const-desc" class="popup-desc">Description</p><p id="const-body" class="popup-body">Body</p></div> <div id="req-popup" class="funcpopup"><p id="req-title" class="popup-title">title</p><p id="req-body" class="popup-body">Body</p></div> <!-- A link to the phpxref site in your customized footer file is appreciated ;-) --> <br><hr> <table width="100%"> <tr><td>Generated: Thu Oct 23 18:57:41 2014</td> <td align="right"><i>Cross-referenced by <a href="http://phpxref.sourceforge.net/">PHPXref 0.7.1</a></i></td> </tr> </table> </body></html>
Java
# AUTOGENERATED FILE FROM balenalib/up-board-ubuntu:xenial-build ENV NODE_VERSION 14.18.3 ENV YARN_VERSION 1.22.4 RUN for key in \ 6A010C5166006599AA17F08146C2130DFD2497F5 \ ; do \ gpg --keyserver pgp.mit.edu --recv-keys "$key" || \ gpg --keyserver keyserver.pgp.com --recv-keys "$key" || \ gpg --keyserver keyserver.ubuntu.com --recv-keys "$key" ; \ done \ && curl -SLO "http://nodejs.org/dist/v$NODE_VERSION/node-v$NODE_VERSION-linux-x64.tar.gz" \ && echo "bd96f88e054801d1368787f7eaf77b49cd052b9543c56bd6bc0bfc90310e2756 node-v$NODE_VERSION-linux-x64.tar.gz" | sha256sum -c - \ && tar -xzf "node-v$NODE_VERSION-linux-x64.tar.gz" -C /usr/local --strip-components=1 \ && rm "node-v$NODE_VERSION-linux-x64.tar.gz" \ && curl -fSLO --compressed "https://yarnpkg.com/downloads/$YARN_VERSION/yarn-v$YARN_VERSION.tar.gz" \ && curl -fSLO --compressed "https://yarnpkg.com/downloads/$YARN_VERSION/yarn-v$YARN_VERSION.tar.gz.asc" \ && gpg --batch --verify yarn-v$YARN_VERSION.tar.gz.asc yarn-v$YARN_VERSION.tar.gz \ && mkdir -p /opt/yarn \ && tar -xzf yarn-v$YARN_VERSION.tar.gz -C /opt/yarn --strip-components=1 \ && ln -s /opt/yarn/bin/yarn /usr/local/bin/yarn \ && ln -s /opt/yarn/bin/yarn /usr/local/bin/yarnpkg \ && rm yarn-v$YARN_VERSION.tar.gz.asc yarn-v$YARN_VERSION.tar.gz \ && npm config set unsafe-perm true -g --unsafe-perm \ && rm -rf /tmp/* CMD ["echo","'No CMD command was set in Dockerfile! Details about CMD command could be found in Dockerfile Guide section in our Docs. Here's the link: https://balena.io/docs"] RUN curl -SLO "https://raw.githubusercontent.com/balena-io-library/base-images/8accad6af708fca7271c5c65f18a86782e19f877/scripts/assets/tests/test-stack@node.sh" \ && echo "Running test-stack@node" \ && chmod +x test-stack@node.sh \ && bash test-stack@node.sh \ && rm -rf test-stack@node.sh RUN [ ! -d /.balena/messages ] && mkdir -p /.balena/messages; echo 'Here are a few details about this Docker image (For more information please visit https://www.balena.io/docs/reference/base-images/base-images/): \nArchitecture: Intel 64-bit (x86-64) \nOS: Ubuntu xenial \nVariant: build variant \nDefault variable(s): UDEV=off \nThe following software stack is preinstalled: \nNode.js v14.18.3, Yarn v1.22.4 \nExtra features: \n- Easy way to install packages with `install_packages <package-name>` command \n- Run anywhere with cross-build feature (for ARM only) \n- Keep the container idling with `balena-idle` command \n- Show base image details with `balena-info` command' > /.balena/messages/image-info RUN echo '#!/bin/sh.real\nbalena-info\nrm -f /bin/sh\ncp /bin/sh.real /bin/sh\n/bin/sh "$@"' > /bin/sh-shim \ && chmod +x /bin/sh-shim \ && cp /bin/sh /bin/sh.real \ && mv /bin/sh-shim /bin/sh
Java
#include "pmlc/dialect/pxa/analysis/affine_expr.h" namespace mlir { AffineValueExpr::AffineValueExpr(AffineExpr expr, ValueRange operands) : expr(expr), operands(operands.begin(), operands.end()) {} AffineValueExpr::AffineValueExpr(MLIRContext *ctx, int64_t v) { expr = getAffineConstantExpr(v, ctx); } AffineValueExpr::AffineValueExpr(Value v) { operands.push_back(v); expr = getAffineDimExpr(0, v.getContext()); } AffineValueExpr::AffineValueExpr(AffineValueMap map, unsigned idx) : expr(map.getResult(idx)), operands(map.getOperands().begin(), map.getOperands().end()) {} AffineValueExpr AffineValueExpr::operator*(const AffineValueExpr &rhs) const { return AffineValueExpr(AffineExprKind::Mul, *this, rhs); } AffineValueExpr AffineValueExpr::operator*(int64_t rhs) const { auto cst = AffineValueExpr(expr.getContext(), rhs); return AffineValueExpr(AffineExprKind::Mul, *this, cst); } AffineValueExpr AffineValueExpr::operator+(const AffineValueExpr &rhs) const { return AffineValueExpr(AffineExprKind::Add, *this, rhs); } AffineValueExpr AffineValueExpr::operator+(int64_t rhs) const { auto cst = AffineValueExpr(expr.getContext(), rhs); return AffineValueExpr(AffineExprKind::Add, *this, cst); } AffineValueExpr AffineValueExpr::operator-(const AffineValueExpr &rhs) const { return *this + (rhs * -1); } AffineValueExpr AffineValueExpr::operator-(int64_t rhs) const { return *this - AffineValueExpr(expr.getContext(), rhs); } AffineExpr AffineValueExpr::getExpr() const { return expr; } ArrayRef<Value> AffineValueExpr::getOperands() const { return operands; } AffineValueExpr::AffineValueExpr(AffineExprKind kind, AffineValueExpr a, AffineValueExpr b) : operands(a.operands.begin(), a.operands.end()) { SmallVector<AffineExpr, 4> repl_b; for (auto v : b.operands) { auto it = std::find(operands.begin(), operands.end(), v); unsigned idx; if (it == operands.end()) { idx = operands.size(); operands.push_back(v); } else { idx = it - operands.begin(); } repl_b.push_back(getAffineDimExpr(idx, a.expr.getContext())); } auto new_b = b.expr.replaceDimsAndSymbols(repl_b, {}); expr = getAffineBinaryOpExpr(kind, a.expr, new_b); } AffineValueMap jointValueMap(MLIRContext *ctx, ArrayRef<AffineValueExpr> exprs) { DenseMap<Value, unsigned> jointSpace; for (const auto &expr : exprs) { for (Value v : expr.getOperands()) { if (!jointSpace.count(v)) { unsigned idx = jointSpace.size(); jointSpace[v] = idx; } } } SmallVector<AffineExpr, 4> jointExprs; for (const auto &expr : exprs) { SmallVector<AffineExpr, 4> repl; for (Value v : expr.getOperands()) { repl.push_back(getAffineDimExpr(jointSpace[v], ctx)); } jointExprs.push_back(expr.getExpr().replaceDimsAndSymbols(repl, {})); } SmallVector<Value, 4> jointOperands(jointSpace.size()); for (const auto &kvp : jointSpace) { jointOperands[kvp.second] = kvp.first; } auto map = AffineMap::get(jointSpace.size(), 0, jointExprs, ctx); return AffineValueMap(map, jointOperands); } } // End namespace mlir
Java
# Leptonia rodwayi Massee SPECIES #### Status ACCEPTED #### According to Index Fungorum #### Published in Bull. Misc. Inf. , Kew 124 (1898) #### Original name Leptonia rodwayi Massee ### Remarks null
Java
/** * * Copyright 2016 David Strawn * * 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 strawn.longleaf.relay.util; import java.io.FileInputStream; import java.io.IOException; import java.util.Properties; /** * * @author David Strawn * * This class loads configuration from the file system. * */ public class RelayConfigLoader { private static final String serverConfigLocation = "./resources/serverconfig.properties"; private static final String clientConfigLocation = "./resources/clientconfig.properties"; private final Properties properties; public RelayConfigLoader() { properties = new Properties(); } public void loadServerConfig() throws IOException { loadConfigFromPath(serverConfigLocation); } public void loadClientConfig() throws IOException { loadConfigFromPath(clientConfigLocation); } /** * Use this method if you want to use a different location for the configuration. * @param configFileLocation - location of the configuration file * @throws IOException */ public void loadConfigFromPath(String configFileLocation) throws IOException { FileInputStream fileInputStream = new FileInputStream(configFileLocation); properties.load(fileInputStream); fileInputStream.close(); } public int getPort() { return Integer.parseInt(properties.getProperty("port")); } public String getHost() { return properties.getProperty("host"); } }
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.oozie.executor.jpa; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.fs.Path; import org.apache.oozie.CoordinatorActionBean; import org.apache.oozie.CoordinatorJobBean; import org.apache.oozie.client.CoordinatorAction; import org.apache.oozie.client.CoordinatorJob; import org.apache.oozie.local.LocalOozie; import org.apache.oozie.service.JPAService; import org.apache.oozie.service.Services; import org.apache.oozie.test.XDataTestCase; import org.apache.oozie.util.XmlUtils; public class TestCoordActionGetForStartJPAExecutor extends XDataTestCase { Services services; @Override protected void setUp() throws Exception { super.setUp(); services = new Services(); services.init(); cleanUpDBTables(); } @Override protected void tearDown() throws Exception { services.destroy(); super.tearDown(); } public void testCoordActionGet() throws Exception { int actionNum = 1; String errorCode = "000"; String errorMessage = "Dummy"; String resourceXmlName = "coord-action-get.xml"; CoordinatorJobBean job = addRecordToCoordJobTable(CoordinatorJob.Status.RUNNING, false, false); CoordinatorActionBean action = createCoordAction(job.getId(), actionNum, CoordinatorAction.Status.WAITING, resourceXmlName, 0); // Add extra attributes for action action.setSlaXml(XDataTestCase.slaXml); action.setErrorCode(errorCode); action.setErrorMessage(errorMessage); // Insert the action insertRecordCoordAction(action); Path appPath = new Path(getFsTestCaseDir(), "coord"); String actionXml = getCoordActionXml(appPath, resourceXmlName); Configuration conf = getCoordConf(appPath); // Pass the expected values _testGetForStartX(action.getId(), job.getId(), CoordinatorAction.Status.WAITING, 0, action.getId() + "_E", XDataTestCase.slaXml, resourceXmlName, XmlUtils.prettyPrint(conf).toString(), actionXml, errorCode, errorMessage); } private void _testGetForStartX(String actionId, String jobId, CoordinatorAction.Status status, int pending, String extId, String slaXml, String resourceXmlName, String createdConf, String actionXml, String errorCode, String errorMessage) throws Exception { try { JPAService jpaService = Services.get().get(JPAService.class); assertNotNull(jpaService); CoordActionGetForStartJPAExecutor actionGetCmd = new CoordActionGetForStartJPAExecutor(actionId); CoordinatorActionBean action = jpaService.execute(actionGetCmd); assertNotNull(action); // Check for expected values assertEquals(actionId, action.getId()); assertEquals(jobId, action.getJobId()); assertEquals(status, action.getStatus()); assertEquals(pending, action.getPending()); assertEquals(createdConf, action.getCreatedConf()); assertEquals(slaXml, action.getSlaXml()); assertEquals(actionXml, action.getActionXml()); assertEquals(extId, action.getExternalId()); assertEquals(errorMessage, action.getErrorMessage()); assertEquals(errorCode, action.getErrorCode()); } catch (Exception ex) { ex.printStackTrace(); fail("Unable to GET a record for COORD Action By actionId =" + actionId); } } }
Java
// Modifications copyright (C) 2017, Baidu.com, Inc. // Copyright 2017 The Apache Software Foundation // 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. #include "util/palo_metrics.h" #include "util/debug_util.h" namespace palo { // Naming convention: Components should be separated by '.' and words should // be separated by '-'. const char* PALO_BE_START_TIME = "palo_be.start_time"; const char* PALO_BE_VERSION = "palo_be.version"; const char* PALO_BE_READY = "palo_be.ready"; const char* PALO_BE_NUM_FRAGMENTS = "palo_be.num_fragments"; const char* TOTAL_SCAN_RANGES_PROCESSED = "palo_be.scan_ranges.total"; const char* NUM_SCAN_RANGES_MISSING_VOLUME_ID = "palo_be.scan_ranges.num_missing_volume_id"; const char* MEM_POOL_TOTAL_BYTES = "palo_be.mem_pool.total_bytes"; const char* HASH_TABLE_TOTAL_BYTES = "palo_be.hash_table.total_bytes"; const char* OLAP_LRU_CACHE_LOOKUP_COUNT = "palo_be.olap.lru_cache.lookup_count"; const char* OLAP_LRU_CACHE_HIT_COUNT = "palo_be.olap.lru_cache.hit_count"; const char* PALO_PUSH_COUNT = "palo_be.olap.push_count"; const char* PALO_FETCH_COUNT = "palo_be.olap.fetch_count"; const char* PALO_REQUEST_COUNT = "palo_be.olap.request_count"; const char* BE_MERGE_DELTA_NUM = "palo_be.olap.be_merge.delta_num"; const char* BE_MERGE_SIZE = "palo_be.olap.be_merge_size"; const char* CE_MERGE_DELTA_NUM = "palo_be.olap.ce_merge.delta_num"; const char* CE_MERGE_SIZE = "palo_be.olap.ce_merge_size"; const char* IO_MGR_NUM_BUFFERS = "palo_be.io_mgr.num_buffers"; const char* IO_MGR_NUM_OPEN_FILES = "palo_be.io_mgr.num_open_files"; const char* IO_MGR_NUM_UNUSED_BUFFERS = "palo_be.io_mgr.num_unused_buffers"; // const char* IO_MGR_NUM_CACHED_FILE_HANDLES = "palo_be.io_mgr_num_cached_file_handles"; const char* IO_MGR_NUM_FILE_HANDLES_OUTSTANDING = "palo_be.io_mgr.num_file_handles_outstanding"; // const char* IO_MGR_CACHED_FILE_HANDLES_HIT_COUNT = "palo_be.io_mgr_cached_file_handles_hit_count"; // const char* IO_MGR_CACHED_FILE_HANDLES_MISS_COUNT = "palo_be.io_mgr_cached_file_handles_miss_count"; const char* IO_MGR_TOTAL_BYTES = "palo_be.io_mgr.total_bytes"; // const char* IO_MGR_BYTES_READ = "palo_be.io_mgr_bytes_read"; // const char* IO_MGR_LOCAL_BYTES_READ = "palo_be.io_mgr_local_bytes_read"; // const char* IO_MGR_CACHED_BYTES_READ = "palo_be.io_mgr_cached_bytes_read"; // const char* IO_MGR_SHORT_CIRCUIT_BYTES_READ = "palo_be.io_mgr_short_circuit_bytes_read"; const char* IO_MGR_BYTES_WRITTEN = "palo_be.io_mgr.bytes_written"; const char* NUM_QUERIES_SPILLED = "palo_be.num_queries_spilled"; // These are created by palo_be during startup. StringProperty* PaloMetrics::_s_palo_be_start_time = NULL; StringProperty* PaloMetrics::_s_palo_be_version = NULL; BooleanProperty* PaloMetrics::_s_palo_be_ready = NULL; IntCounter* PaloMetrics::_s_palo_be_num_fragments = NULL; IntCounter* PaloMetrics::_s_num_ranges_processed = NULL; IntCounter* PaloMetrics::_s_num_ranges_missing_volume_id = NULL; IntGauge* PaloMetrics::_s_mem_pool_total_bytes = NULL; IntGauge* PaloMetrics::_s_hash_table_total_bytes = NULL; IntCounter* PaloMetrics::_s_olap_lru_cache_lookup_count = NULL; IntCounter* PaloMetrics::_s_olap_lru_cache_hit_count = NULL; IntCounter* PaloMetrics::_s_palo_push_count = NULL; IntCounter* PaloMetrics::_s_palo_fetch_count = NULL; IntCounter* PaloMetrics::_s_palo_request_count = NULL; IntCounter* PaloMetrics::_s_be_merge_delta_num = NULL; IntCounter* PaloMetrics::_s_be_merge_size = NULL; IntCounter* PaloMetrics::_s_ce_merge_delta_num = NULL; IntCounter* PaloMetrics::_s_ce_merge_size = NULL; IntGauge* PaloMetrics::_s_io_mgr_num_buffers = NULL; IntGauge* PaloMetrics::_s_io_mgr_num_open_files = NULL; IntGauge* PaloMetrics::_s_io_mgr_num_unused_buffers = NULL; // IntGauge* PaloMetrics::_s_io_mgr_num_cached_file_handles = NULL; IntGauge* PaloMetrics::_s_io_mgr_num_file_handles_outstanding = NULL; // IntGauge* PaloMetrics::_s_io_mgr_cached_file_handles_hit_count = NULL; // IntGauge* PaloMetrics::_s_io_mgr_cached_file_handles_miss_count = NULL; IntGauge* PaloMetrics::_s_io_mgr_total_bytes = NULL; // IntGauge* PaloMetrics::_s_io_mgr_bytes_read = NULL; // IntGauge* PaloMetrics::_s_io_mgr_local_bytes_read = NULL; // IntGauge* PaloMetrics::_s_io_mgr_cached_bytes_read = NULL; // IntGauge* PaloMetrics::_s_io_mgr_short_circuit_bytes_read = NULL; IntCounter* PaloMetrics::_s_io_mgr_bytes_written = NULL; IntCounter* PaloMetrics::_s_num_queries_spilled = NULL; void PaloMetrics::create_metrics(MetricGroup* m) { // Initialize impalad metrics _s_palo_be_start_time = m->AddProperty<std::string>( PALO_BE_START_TIME, ""); _s_palo_be_version = m->AddProperty<std::string>( PALO_BE_VERSION, get_version_string(true)); _s_palo_be_ready = m->AddProperty(PALO_BE_READY, false); _s_palo_be_num_fragments = m->AddCounter(PALO_BE_NUM_FRAGMENTS, 0L); // Initialize scan node metrics _s_num_ranges_processed = m->AddCounter(TOTAL_SCAN_RANGES_PROCESSED, 0L); _s_num_ranges_missing_volume_id = m->AddCounter(NUM_SCAN_RANGES_MISSING_VOLUME_ID, 0L); // Initialize memory usage metrics _s_mem_pool_total_bytes = m->AddGauge(MEM_POOL_TOTAL_BYTES, 0L); _s_hash_table_total_bytes = m->AddGauge(HASH_TABLE_TOTAL_BYTES, 0L); // Initialize olap metrics _s_olap_lru_cache_lookup_count = m->AddCounter(OLAP_LRU_CACHE_LOOKUP_COUNT, 0L); _s_olap_lru_cache_hit_count = m->AddCounter(OLAP_LRU_CACHE_HIT_COUNT, 0L); // Initialize push_count, fetch_count, request_count metrics _s_palo_push_count = m->AddCounter(PALO_PUSH_COUNT, 0L); _s_palo_fetch_count = m->AddCounter(PALO_FETCH_COUNT, 0L); _s_palo_request_count = m->AddCounter(PALO_REQUEST_COUNT, 0L); // Initialize be/ce merge metrics _s_be_merge_delta_num = m->AddCounter(BE_MERGE_DELTA_NUM, 0L); _s_be_merge_size = m->AddCounter(BE_MERGE_SIZE, 0L); _s_ce_merge_delta_num = m->AddCounter(CE_MERGE_DELTA_NUM, 0L); _s_ce_merge_size = m->AddCounter(CE_MERGE_SIZE, 0L); // Initialize metrics relate to spilling to disk // _s_io_mgr_bytes_read // = m->AddGauge(IO_MGR_BYTES_READ, 0L); // _s_io_mgr_local_bytes_read // = m->AddGauge(IO_MGR_LOCAL_BYTES_READ, 0L); // _s_io_mgr_cached_bytes_read // = m->AddGauge(IO_MGR_CACHED_BYTES_READ, 0L); // _s_io_mgr_short_circuit_bytes_read // = m->AddGauge(IO_MGR_SHORT_CIRCUIT_BYTES_READ, 0L); _s_io_mgr_bytes_written = m->AddCounter(IO_MGR_BYTES_WRITTEN, 0L); _s_io_mgr_num_buffers = m->AddGauge(IO_MGR_NUM_BUFFERS, 0L); _s_io_mgr_num_open_files = m->AddGauge(IO_MGR_NUM_OPEN_FILES, 0L); _s_io_mgr_num_unused_buffers = m->AddGauge(IO_MGR_NUM_UNUSED_BUFFERS, 0L); _s_io_mgr_num_file_handles_outstanding = m->AddGauge(IO_MGR_NUM_FILE_HANDLES_OUTSTANDING, 0L); _s_io_mgr_total_bytes = m->AddGauge(IO_MGR_TOTAL_BYTES, 0L); _s_num_queries_spilled = m->AddCounter(NUM_QUERIES_SPILLED, 0L); } }
Java
// Copyright 2015 Christina Teflioudi // // 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. /* * File: PCATree.h * Author: chteflio * * Created on February 9, 2015, 10:30 AM */ #ifndef PCATREE_H #define PCATREE_H namespace mips { comp_type GenerateID() { static comp_type nNextID = 0; return nNextID++; } /* this files are for running the PCA-tree method AFTER the transformation of the input vectors. I.e. the datasets read need to be the transformed ones. */ struct PCA_tree { double median; col_type col; bool isLeaf; comp_type leaf_counter; PCA_tree* leftChild; PCA_tree* rightChild; VectorMatrix* leafData; // if depth=2 I will have levels 2(root) 1, 0(leaves) PCA_tree(const VectorMatrix& matrix, int depth, col_type col, std::vector<row_type>& ids, int k, std::vector<VectorMatrix*>& matricesInLeaves) : col(col), isLeaf(false), leafData(0) { std::vector<row_type> idsLeft, idsRight; if (ids.size() == 0 && col == 0) { // this is the root node ids.reserve(matrix.rowNum); for (int i = k; i < matrix.rowNum; i++) ids.push_back(i); matricesInLeaves.resize(pow(2, depth)); } if (depth == 0) {// this is a leaf isLeaf = true; leaf_counter = GenerateID(); leafData = new VectorMatrix(); leafData->addVectors(matrix, ids); matricesInLeaves[leaf_counter] = leafData; } else { // internal node if (ids.size() > 0) { std::vector<double> values; values.reserve(ids.size()); for (int i = 0; i < ids.size(); i++) { double val = matrix.getMatrixRowPtr(ids[i])[col]; values.push_back(val); } std::sort(values.begin(), values.end(), std::greater<double>()); row_type pos = ids.size() / 2; median = values[pos]; if (ids.size() % 2 == 0) { median += values[pos - 1]; median /= 2; } for (int i = 0; i < ids.size(); i++) { double val = matrix.getMatrixRowPtr(ids[i])[col]; if (val <= median) { idsLeft.push_back(ids[i]); } else { idsRight.push_back(ids[i]); } } } leftChild = new PCA_tree(matrix, depth - 1, col + 1, idsLeft, k, matricesInLeaves); rightChild = new PCA_tree(matrix, depth - 1, col + 1, idsRight, k, matricesInLeaves); } } inline comp_type findBucketForQuery(const double* query) { if (isLeaf) return leaf_counter; if (query[col] <= median) { leftChild->findBucketForQuery(query); } else { rightChild->findBucketForQuery(query); } } }; class PcaTree : public Mip { PCA_tree* root; VectorMatrix probeFirstk; VectorMatrix probeMatrix; std::vector<RetrievalArguments> retrArg; std::vector<VectorMatrix*> matricesInLeaves; PcaTreeArguments args; bool isTransformed; arma::mat U; arma::vec mu; inline void transformProbeMatrix(VectorMatrix& rightMatrix) { // transform probeMatrix (transform ||p|| to less than 1 and p = [sqrt(1- ||p|| * ||p||);p]) // we need the longest vector from probeMatrix double maxLen = 0; for (row_type i = 0; i < rightMatrix.rowNum; i++) { double len = calculateLength(rightMatrix.getMatrixRowPtr(i), rightMatrix.colNum); if (len > maxLen) { maxLen = len; } } arma::mat A(rightMatrix.colNum + 1, rightMatrix.rowNum); //cols x rows mu.zeros(rightMatrix.colNum + 1); #pragma omp parallel for schedule(static,1000) for (row_type i = 0; i < rightMatrix.rowNum; i++) { double* dProbe = rightMatrix.getMatrixRowPtr(i); A(0, i) = 0; for (col_type j = 0; j < rightMatrix.colNum; ++j) { A(j + 1, i) = dProbe[j]; } double len = arma::norm(A.unsafe_col(i)); A(0, i) = maxLen * maxLen - len * len; A(0, i) = (A(0, i) < 0) ? 0 : sqrt(A(0, i)); mu += A.unsafe_col(i); } mu /= rightMatrix.rowNum; #pragma omp parallel for schedule(static,1000) for (row_type i = 0; i < rightMatrix.rowNum; i++) { A.unsafe_col(i) -= mu; } arma::vec s; arma::mat V; bool isOk = arma::svd_econ(U, s, V, A, "left"); if (!isOk) { std::cout << "[ERROR] SVD failed " << std::endl; exit(1); } arma::inplace_trans(U); A = U*A; probeMatrix.rowNum = rightMatrix.rowNum; probeMatrix.colNum = rightMatrix.colNum + 1; probeMatrix.initializeBasics(probeMatrix.colNum, probeMatrix.rowNum, false); #pragma omp parallel for schedule(static,1000) for (row_type i = 0; i < probeMatrix.rowNum; i++) { double* dProbe = probeMatrix.getMatrixRowPtr(i); for (col_type j = 0; j < probeMatrix.colNum; ++j) { dProbe[j] = A(j, i); } probeMatrix.setLengthInData(i, 1); // set to 1 by the transformation } } inline void transformQueryMatrix(const VectorMatrix& leftMatrix, VectorMatrix& queryMatrix) { // transform queryMatrix (transform ||q|| to 1 and q = [0;q]) arma::mat A(leftMatrix.colNum + 1, leftMatrix.rowNum); //cols x rows #pragma omp parallel for schedule(static,1000) for (row_type i = 0; i < leftMatrix.rowNum; i++) { double* dProbe = leftMatrix.getMatrixRowPtr(i); A(0, i) = 0; for (col_type j = 0; j < leftMatrix.colNum; ++j) { A(j + 1, i) = dProbe[j]; } A.unsafe_col(i) -= mu; } A = U * A; queryMatrix.rowNum = leftMatrix.rowNum; queryMatrix.colNum = leftMatrix.colNum + 1; queryMatrix.initializeBasics(queryMatrix.colNum, queryMatrix.rowNum, false); #pragma omp parallel for schedule(static,1000) for (row_type i = 0; i < queryMatrix.rowNum; i++) { double* dQuery = queryMatrix.getMatrixRowPtr(i); for (col_type j = 0; j < queryMatrix.colNum; ++j) { dQuery[j] = A(j, i); } queryMatrix.setLengthInData(i, 1); // ||q|| = 1 } } inline void verify(const double* query, comp_type bucket, row_type tid, double& minScore) { for (row_type j = 0; j < matricesInLeaves[bucket]->rowNum; j++) { row_type probeId = matricesInLeaves[bucket]->lengthInfo[j].id; double euclideanDistance = matricesInLeaves[bucket]->L2Distance2(j, query); // std::cout<<"checking: "<<j<<" probe id: "<<probeId<<" result: "<<euclideanDistance<<std::endl; retrArg[tid].comparisons++; if (euclideanDistance < minScore) { std::pop_heap(retrArg[tid].heap.begin(), retrArg[tid].heap.end(), std::less<QueueElement>()); retrArg[tid].heap.pop_back(); retrArg[tid].heap.push_back(QueueElement(euclideanDistance, probeId)); std::push_heap(retrArg[tid].heap.begin(), retrArg[tid].heap.end(), std::less<QueueElement>()); minScore = retrArg[tid].heap.front().data; } } } inline void printAlgoName(const VectorMatrix& leftMatrix) { logging << "PCA_TREE" << "\t" << args.threads << "\t d(" << args.depth << ")\t"; std::cout << "[ALGORITHM] PCA_TREE with " << args.threads << " thread(s) and depth " << args.depth << std::endl; logging << "P(" << probeMatrix.rowNum << "x" << (0 + probeMatrix.colNum) << ")\t"; logging << "Q^T(" << leftMatrix.rowNum << "x" << (0 + leftMatrix.colNum) << ")\t"; } inline void initializeInternal(std::vector<VectorMatrix>& queryMatrices, const VectorMatrix& leftMatrix) { std::cout << "[RETRIEVAL] QueryMatrix contains " << leftMatrix.rowNum << " vectors with dimensionality " << (0 + leftMatrix.colNum) << std::endl; row_type myNumThreads = args.threads; if (leftMatrix.rowNum < args.threads) { myNumThreads = leftMatrix.rowNum; std::cout << "[WARNING] Query matrix contains too few elements. Suboptimal running with " << myNumThreads << " thread(s)" << std::endl; } omp_set_num_threads(myNumThreads); queryMatrices.resize(myNumThreads); timer.start(); if (!isTransformed) { std::cout << "[RETRIEVAL] QueryMatrix will be transformed" << std::endl; VectorMatrix queryMatrix; transformQueryMatrix(leftMatrix, queryMatrix); splitMatrices(queryMatrix, queryMatrices); } else { splitMatrices(leftMatrix, queryMatrices); } timer.stop(); dataPreprocessingTimeLeft += timer.elapsedTime().nanos(); retrArg.resize(myNumThreads); for (row_type i = 0; i < retrArg.size(); i++) { retrArg[i].initializeBasics(queryMatrices[i], probeMatrix, LEMP_L, args.theta, args.k, args.threads, 0, 0, 0, 0); retrArg[i].clear(); } } public: inline PcaTree(InputArguments& input, int depth, bool isTransformed) : root(nullptr), isTransformed(isTransformed) { args.copyInputArguments(input); args.depth = depth; // now do the logging logging.open(args.logFile.c_str(), std::ios_base::app); if (!logging.is_open()) { std::cout << "[WARNING] No log will be created!" << std::endl; } else { std::cout << "[INFO] Logging in " << args.logFile << std::endl; } omp_set_num_threads(args.threads); } inline ~PcaTree() { logging.close(); } inline void initialize(VectorMatrix& rightMatrix) { std::cout << "[INIT] ProbeMatrix contains " << rightMatrix.rowNum << " vectors with dimensionality " << (0 + rightMatrix.colNum) << std::endl; if (!isTransformed) { std::cout << "[INIT] ProbeMatrix will be transformed" << std::endl; timer.start(); transformProbeMatrix(rightMatrix); timer.stop(); dataPreprocessingTimeRight += timer.elapsedTime().nanos(); } else { probeMatrix = rightMatrix; } //create the tree std::vector<row_type> ids; timer.start(); root = new PCA_tree(probeMatrix, args.depth, 0, ids, args.k, matricesInLeaves); ids.clear(); for (int i = 0; i < args.k; i++) { ids.push_back(i); } probeFirstk.addVectors(probeMatrix, ids); timer.stop(); dataPreprocessingTimeRight = timer.elapsedTime().nanos(); } inline void runTopK(VectorMatrix& leftMatrix, Results& results) { printAlgoName(leftMatrix); std::vector<VectorMatrix> queryMatrices; initializeInternal(queryMatrices, leftMatrix); results.resultsVector.resize(args.threads); std::cout << "[RETRIEVAL] Retrieval (k = " << args.k << ") starts ..." << std::endl; logging << "k(" << args.k << ")\t"; timer.start(); for (row_type i = 0; i < retrArg.size(); i++) retrArg[i].allocTopkResults(); comp_type comparisons = 0; #pragma omp parallel reduction(+ : comparisons) { row_type tid = omp_get_thread_num(); double minScore = 0; for (row_type i = 0; i < queryMatrices[tid].rowNum; i++) { const double* query = queryMatrices[tid].getMatrixRowPtr(i); for (row_type j = 0; j < args.k; j++) { retrArg[tid].comparisons++; double euclideanDistance = probeFirstk.L2Distance2(j, query); // std::cout<<"checking: "<<j<<" probe id: "<<0<<" result: "<<euclideanDistance<<std::endl; retrArg[tid].heap[j] = QueueElement(euclideanDistance, j); } std::make_heap(retrArg[tid].heap.begin(), retrArg[tid].heap.end(), std::less<QueueElement>()); //make the heap; minScore = retrArg[tid].heap.front().data; // find bucket of query comp_type queryBucket = root->findBucketForQuery(query); verify(query, queryBucket, tid, minScore); // now scan also buckets in hamming distance=1 for (comp_type b = 0; b < matricesInLeaves.size(); b++) { if (queryBucket == b || matricesInLeaves[b]->rowNum == 0) continue; comp_type res = b ^ queryBucket; int hammingDistance = __builtin_popcountll(res); if (hammingDistance == 1) { // these guys are candidates verify(query, b, tid, minScore); } }// for each bucket // write the results back retrArg[tid].writeHeapToTopk(i); // std::cout << retrArg[tid].heap.front().data << " " << retrArg[tid].heap.front().id << std::endl; }// for each query retrArg[tid].extendIncompleteResultItems(); results.moveAppend(retrArg[tid].results, tid); comparisons += retrArg[tid].comparisons; } timer.stop(); retrievalTime += timer.elapsedTime().nanos(); totalComparisons += comparisons; std::cout << "[RETRIEVAL] ... and is finished with " << results.getResultSize() << " results" << std::endl; logging << results.getResultSize() << "\t"; outputStats(); } }; } #endif /* PCATREE_H */
Java
package leetcode.reverse_linked_list_ii; import common.ListNode; public class Solution { public ListNode reverseBetween(ListNode head, int m, int n) { if(head == null) return null; ListNode curRight = head; for(int len = 0; len < n - m; len++){ curRight = curRight.next; } ListNode prevLeft = null; ListNode curLeft = head; for(int len = 0; len < m - 1; len++){ prevLeft = curLeft; curLeft = curLeft.next; curRight = curRight.next; } if(prevLeft == null){ head = curRight; }else{ prevLeft.next = curRight; } for(int len = 0; len < n - m; len++){ ListNode next = curLeft.next; curLeft.next = curRight.next; curRight.next = curLeft; curLeft = next; } return head; } public static void dump(ListNode node){ while(node != null){ System.err.print(node.val + "->"); node = node.next; } System.err.println("null"); } public static void main(String[] args){ final int N = 10; ListNode[] list = new ListNode[N]; for(int m = 1; m <= N; m++){ for(int n = m; n <= N; n++){ for(int i = 0; i < N; i++){ list[i] = new ListNode(i); if(i > 0) list[i - 1].next = list[i]; } dump(new Solution().reverseBetween(list[0], m, n)); } } } }
Java
<!DOCTYPE html> <html> <head> <base href="http://fushenghua.github.io/GetHosp"> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <title>涪陵博生和美妇产医院</title> <meta name="viewport" content="width=device-width"> <meta name="description" content="GetHosp"> <link rel="canonical" href="http://fushenghua.github.io/GetHosphttp://fushenghua.github.io/GetHosp/%E5%85%B6%E4%BB%96/2016/05/03/%E6%B6%AA%E9%99%B5%E5%8D%9A%E7%94%9F%E5%92%8C%E7%BE%8E%E5%A6%87%E4%BA%A7%E5%8C%BB%E9%99%A2/"> <!-- Custom CSS --> <link rel="stylesheet" href="http://fushenghua.github.io/GetHosp/css/main.css"> </head> <body> <header class="site-header"> <div class="wrap"> <a class="site-title" href="http://fushenghua.github.io/GetHosp/">GetHosp</a> <nav class="site-nav"> <a href="#" class="menu-icon"> <svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 18 15" enable-background="new 0 0 18 15" xml:space="preserve"> <path fill="#505050" d="M18,1.484c0,0.82-0.665,1.484-1.484,1.484H1.484C0.665,2.969,0,2.304,0,1.484l0,0C0,0.665,0.665,0,1.484,0 h15.031C17.335,0,18,0.665,18,1.484L18,1.484z"/> <path fill="#505050" d="M18,7.516C18,8.335,17.335,9,16.516,9H1.484C0.665,9,0,8.335,0,7.516l0,0c0-0.82,0.665-1.484,1.484-1.484 h15.031C17.335,6.031,18,6.696,18,7.516L18,7.516z"/> <path fill="#505050" d="M18,13.516C18,14.335,17.335,15,16.516,15H1.484C0.665,15,0,14.335,0,13.516l0,0 c0-0.82,0.665-1.484,1.484-1.484h15.031C17.335,12.031,18,12.696,18,13.516L18,13.516z"/> </svg> </a> <div class="trigger"> <a class="page-link" href="http://fushenghua.github.io/GetHosp/about/">About</a> </div> </nav> </div> </header> <div class="page-content"> <div class="wrap"> <div class="post"> <header class="post-header"> <h1>涪陵博生和美妇产医院</h1> <p class="meta">May 3, 2016</p> </header> <article class="post-content"> <p>涪陵博生和美妇产医院</p> <p>信息</p> </article> </div> </div> </div> <footer class="site-footer"> <div class="wrap"> <h2 class="footer-heading">GetHosp</h2> <div class="footer-col-1 column"> <ul> <li>GetHosp</li> <li><a href="mailto:fushenghua2012@gmail.com">fushenghua2012@gmail.com</a></li> </ul> </div> <div class="footer-col-2 column"> <ul> <li> <a href="https://github.com/fushenghua"> <span class="icon github"> <svg version="1.1" class="github-icon-svg" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 16 16" enable-background="new 0 0 16 16" xml:space="preserve"> <path fill-rule="evenodd" clip-rule="evenodd" fill="#C2C2C2" d="M7.999,0.431c-4.285,0-7.76,3.474-7.76,7.761 c0,3.428,2.223,6.337,5.307,7.363c0.388,0.071,0.53-0.168,0.53-0.374c0-0.184-0.007-0.672-0.01-1.32 c-2.159,0.469-2.614-1.04-2.614-1.04c-0.353-0.896-0.862-1.135-0.862-1.135c-0.705-0.481,0.053-0.472,0.053-0.472 c0.779,0.055,1.189,0.8,1.189,0.8c0.692,1.186,1.816,0.843,2.258,0.645c0.071-0.502,0.271-0.843,0.493-1.037 C4.86,11.425,3.049,10.76,3.049,7.786c0-0.847,0.302-1.54,0.799-2.082C3.768,5.507,3.501,4.718,3.924,3.65 c0,0,0.652-0.209,2.134,0.796C6.677,4.273,7.34,4.187,8,4.184c0.659,0.003,1.323,0.089,1.943,0.261 c1.482-1.004,2.132-0.796,2.132-0.796c0.423,1.068,0.157,1.857,0.077,2.054c0.497,0.542,0.798,1.235,0.798,2.082 c0,2.981-1.814,3.637-3.543,3.829c0.279,0.24,0.527,0.713,0.527,1.437c0,1.037-0.01,1.874-0.01,2.129 c0,0.208,0.14,0.449,0.534,0.373c3.081-1.028,5.302-3.935,5.302-7.362C15.76,3.906,12.285,0.431,7.999,0.431z"/> </svg> </span> <span class="username">fushenghua</span> </a> </li> </ul> </div> <div class="footer-col-3 column"> <p class="text">GetHosp</p> </div> </div> </footer> </body> </html>
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.giraph.examples.io.formats; import com.google.common.collect.Lists; import org.apache.giraph.edge.Edge; import org.apache.giraph.edge.EdgeFactory; import org.apache.giraph.examples.utils.BrachaTouegDeadlockVertexValue; import org.apache.giraph.graph.Vertex; import org.apache.giraph.io.formats.TextVertexInputFormat; import org.apache.hadoop.io.LongWritable; import org.apache.hadoop.io.Text; import org.apache.hadoop.mapreduce.InputSplit; import org.apache.hadoop.mapreduce.TaskAttemptContext; import org.json.JSONArray; import org.json.JSONException; import java.io.IOException; import java.util.List; /** * VertexInputFormat for the Bracha Toueg Deadlock Detection algorithm * specified in JSON format. */ public class LongLongLongLongVertexInputFormat extends TextVertexInputFormat<LongWritable, LongWritable, LongWritable> { @Override public TextVertexReader createVertexReader(InputSplit split, TaskAttemptContext context) { return new JsonLongLongLongLongVertexReader(); } /** * VertexReader use for the Bracha Toueg Deadlock Detection Algorithm. * The files should be in the following JSON format: * JSONArray(<vertex id>, * JSONArray(JSONArray(<dest vertex id>, <edge tag>), ...)) * The tag is use for the N-out-of-M semantics. Two edges with the same tag * are considered to be combined and, hence, represent to combined requests * that need to be both satisfied to continue execution. * Here is an example with vertex id 1, and three edges (requests). * First edge has a destination vertex 2 with tag 0. * Second and third edge have a destination vertex respectively of 3 and 4 * with tag 1. * [1,[[2,0], [3,1], [4,1]]] */ class JsonLongLongLongLongVertexReader extends TextVertexReaderFromEachLineProcessedHandlingExceptions<JSONArray, JSONException> { @Override protected JSONArray preprocessLine(Text line) throws JSONException { return new JSONArray(line.toString()); } @Override protected LongWritable getId(JSONArray jsonVertex) throws JSONException, IOException { return new LongWritable(jsonVertex.getLong(0)); } @Override protected LongWritable getValue(JSONArray jsonVertex) throws JSONException, IOException { return new LongWritable(); } @Override protected Iterable<Edge<LongWritable, LongWritable>> getEdges(JSONArray jsonVertex) throws JSONException, IOException { JSONArray jsonEdgeArray = jsonVertex.getJSONArray(1); /* get the edges */ List<Edge<LongWritable, LongWritable>> edges = Lists.newArrayListWithCapacity(jsonEdgeArray.length()); for (int i = 0; i < jsonEdgeArray.length(); ++i) { LongWritable targetId; LongWritable tag; JSONArray jsonEdge = jsonEdgeArray.getJSONArray(i); targetId = new LongWritable(jsonEdge.getLong(0)); tag = new LongWritable((long) jsonEdge.getLong(1)); edges.add(EdgeFactory.create(targetId, tag)); } return edges; } @Override protected Vertex<LongWritable, LongWritable, LongWritable> handleException(Text line, JSONArray jsonVertex, JSONException e) { throw new IllegalArgumentException( "Couldn't get vertex from line " + line, e); } } }
Java
/* * Copyright 2013 Google Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software distributed under the License * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express * or implied. See the License for the specific language governing permissions and limitations under * the License. */ package com.google.api.client.googleapis.testing.json; import com.google.api.client.googleapis.json.GoogleJsonResponseException; import com.google.api.client.json.JsonFactory; import com.google.api.client.json.gson.GsonFactory; import java.io.IOException; import junit.framework.TestCase; /** * Tests {@link GoogleJsonResponseExceptionFactoryTesting} * * @author Eric Mintz */ public class GoogleJsonResponseExceptionFactoryTestingTest extends TestCase { private static final JsonFactory JSON_FACTORY = new GsonFactory(); private static final int HTTP_CODE_NOT_FOUND = 404; private static final String REASON_PHRASE_NOT_FOUND = "NOT FOUND"; public void testCreateException() throws IOException { GoogleJsonResponseException exception = GoogleJsonResponseExceptionFactoryTesting.newMock( JSON_FACTORY, HTTP_CODE_NOT_FOUND, REASON_PHRASE_NOT_FOUND); assertEquals(HTTP_CODE_NOT_FOUND, exception.getStatusCode()); assertEquals(REASON_PHRASE_NOT_FOUND, exception.getStatusMessage()); } }
Java
<html> <head> <meta name="viewport" content="width=device-width, initial-scale=1" charset="UTF-8"> <title>LOWER_HALF_BLOCK</title> <link href="../../../images/logo-icon.svg" rel="icon" type="image/svg"> <script>var pathToRoot = "../../../";</script> <script type="text/javascript" src="../../../scripts/sourceset_dependencies.js" async="async"></script> <link href="../../../styles/style.css" rel="Stylesheet"> <link href="../../../styles/logo-styles.css" rel="Stylesheet"> <link href="../../../styles/jetbrains-mono.css" rel="Stylesheet"> <link href="../../../styles/main.css" rel="Stylesheet"> <script type="text/javascript" src="../../../scripts/clipboard.js" async="async"></script> <script type="text/javascript" src="../../../scripts/navigation-loader.js" async="async"></script> <script type="text/javascript" src="../../../scripts/platform-content-handler.js" async="async"></script> <script type="text/javascript" src="../../../scripts/main.js" async="async"></script> </head> <body> <div id="container"> <div id="leftColumn"> <div id="logo"></div> <div id="paneSearch"></div> <div id="sideMenu"></div> </div> <div id="main"> <div id="leftToggler"><span class="icon-toggler"></span></div> <script type="text/javascript" src="../../../scripts/pages.js"></script> <script type="text/javascript" src="../../../scripts/main.js"></script> <div class="main-content" id="content" pageIds="org.hexworks.zircon.api.graphics/Symbols/LOWER_HALF_BLOCK/#/PointingToDeclaration//-755115832"> <div class="navigation-wrapper" id="navigation-wrapper"> <div class="breadcrumbs"><a href="../../index.html">zircon.core</a>/<a href="../index.html">org.hexworks.zircon.api.graphics</a>/<a href="index.html">Symbols</a>/<a href="-l-o-w-e-r_-h-a-l-f_-b-l-o-c-k.html">LOWER_HALF_BLOCK</a></div> <div class="pull-right d-flex"> <div class="filter-section" id="filter-section"><button class="platform-tag platform-selector common-like" data-active="" data-filter=":zircon.core:dokkaHtml/commonMain">common</button></div> <div id="searchBar"></div> </div> </div> <div class="cover "> <h1 class="cover"><span>L</span><wbr></wbr><span>O</span><wbr></wbr><span>W</span><wbr></wbr><span>E</span><wbr></wbr><span>R_</span><wbr></wbr><span>H</span><wbr></wbr><span>A</span><wbr></wbr><span>L</span><wbr></wbr><span>F_</span><wbr></wbr><span>B</span><wbr></wbr><span>L</span><wbr></wbr><span>O</span><wbr></wbr><span>C</span><wbr></wbr><span>K</span></h1> </div> <div class="divergent-group" data-filterable-current=":zircon.core:dokkaHtml/commonMain" data-filterable-set=":zircon.core:dokkaHtml/commonMain"><div class="with-platform-tags"><span class="pull-right"></span></div> <div> <div class="platform-hinted " data-platform-hinted="data-platform-hinted"><div class="content sourceset-depenent-content" data-active="" data-togglable=":zircon.core:dokkaHtml/commonMain"><div class="symbol monospace">const val <a href="-l-o-w-e-r_-h-a-l-f_-b-l-o-c-k.html">LOWER_HALF_BLOCK</a>: <a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-char/index.html">Char</a><span class="top-right-position"><span class="copy-icon"></span><div class="copy-popup-wrapper popup-to-left"><span class="copy-popup-icon"></span><span>Content copied to clipboard</span></div></span></div></div></div> </div> <p class="paragraph">▄</p></div> <h2 class="">Sources</h2> <div class="table" data-togglable="Sources"><a data-name="%5Borg.hexworks.zircon.api.graphics%2FSymbols%2FLOWER_HALF_BLOCK%2F%23%2FPointingToDeclaration%2F%5D%2FSource%2F-755115832" anchor-label="https://github.com/Hexworks/zircon/tree/master/zircon.core/src/commonMain/kotlin/org/hexworks/zircon/api/graphics/Symbols.kt#L474" id="%5Borg.hexworks.zircon.api.graphics%2FSymbols%2FLOWER_HALF_BLOCK%2F%23%2FPointingToDeclaration%2F%5D%2FSource%2F-755115832" data-filterable-set=":zircon.core:dokkaHtml/commonMain"></a> <div class="table-row" data-filterable-current=":zircon.core:dokkaHtml/commonMain" data-filterable-set=":zircon.core:dokkaHtml/commonMain"> <div class="main-subrow keyValue "> <div class=""><span class="inline-flex"><a href="https://github.com/Hexworks/zircon/tree/master/zircon.core/src/commonMain/kotlin/org/hexworks/zircon/api/graphics/Symbols.kt#L474">(source)</a><span class="anchor-wrapper"><span class="anchor-icon" pointing-to="%5Borg.hexworks.zircon.api.graphics%2FSymbols%2FLOWER_HALF_BLOCK%2F%23%2FPointingToDeclaration%2F%5D%2FSource%2F-755115832"></span> <div class="copy-popup-wrapper "><span class="copy-popup-icon"></span><span>Link copied to clipboard</span></div> </span></span></div> <div></div> </div> </div> </div> </div> <div class="footer"><span class="go-to-top-icon"><a href="#content"></a></span><span>© 2020 Copyright</span><span class="pull-right"><span>Sponsored and developed by dokka</span><a href="https://github.com/Kotlin/dokka"><span class="padded-icon"></span></a></span></div> </div> </div> </body> </html>
Java
//------------------------------------------------------------------------------ // <auto-generated> // このコードはツールによって生成されました。 // ランタイム バージョン:2.0.50727.8009 // // このファイルへの変更は、以下の状況下で不正な動作の原因になったり、 // コードが再生成されるときに損失したりします。 // </auto-generated> //------------------------------------------------------------------------------ namespace MsgPack.Serialization.GeneratedSerializers.MapBased { [System.CodeDom.Compiler.GeneratedCodeAttribute("MsgPack.Serialization.CodeDomSerializers.CodeDomSerializerBuilder", "0.6.0.0")] [System.Diagnostics.DebuggerNonUserCodeAttribute()] public class MsgPack_Serialization_PolymorphicMemberTypeKnownType_List_ListObjectItemPrivateSetterCollectionPropertySerializer : MsgPack.Serialization.MessagePackSerializer<MsgPack.Serialization.PolymorphicMemberTypeKnownType_List_ListObjectItemPrivateSetterCollectionProperty> { private MsgPack.Serialization.MessagePackSerializer<string> _serializer0; private MsgPack.Serialization.MessagePackSerializer<System.Collections.Generic.IList<object>> _serializer1; private System.Reflection.MethodBase _methodBasePolymorphicMemberTypeKnownType_List_ListObjectItemPrivateSetterCollectionProperty_set_ListObjectItem0; public MsgPack_Serialization_PolymorphicMemberTypeKnownType_List_ListObjectItemPrivateSetterCollectionPropertySerializer(MsgPack.Serialization.SerializationContext context) : base(context) { MsgPack.Serialization.PolymorphismSchema schema0 = default(MsgPack.Serialization.PolymorphismSchema); MsgPack.Serialization.PolymorphismSchema itemsSchema0 = default(MsgPack.Serialization.PolymorphismSchema); System.Collections.Generic.Dictionary<string, System.Type> itemsSchemaTypeMap0 = default(System.Collections.Generic.Dictionary<string, System.Type>); itemsSchemaTypeMap0 = new System.Collections.Generic.Dictionary<string, System.Type>(2); itemsSchemaTypeMap0.Add("0", typeof(MsgPack.Serialization.FileEntry)); itemsSchemaTypeMap0.Add("1", typeof(MsgPack.Serialization.DirectoryEntry)); itemsSchema0 = MsgPack.Serialization.PolymorphismSchema.ForPolymorphicObject(typeof(object), itemsSchemaTypeMap0); schema0 = MsgPack.Serialization.PolymorphismSchema.ForContextSpecifiedCollection(typeof(System.Collections.Generic.IList<object>), itemsSchema0); this._serializer0 = context.GetSerializer<string>(schema0); MsgPack.Serialization.PolymorphismSchema schema1 = default(MsgPack.Serialization.PolymorphismSchema); MsgPack.Serialization.PolymorphismSchema itemsSchema1 = default(MsgPack.Serialization.PolymorphismSchema); System.Collections.Generic.Dictionary<string, System.Type> itemsSchema1TypeMap0 = default(System.Collections.Generic.Dictionary<string, System.Type>); itemsSchema1TypeMap0 = new System.Collections.Generic.Dictionary<string, System.Type>(2); itemsSchema1TypeMap0.Add("0", typeof(MsgPack.Serialization.FileEntry)); itemsSchema1TypeMap0.Add("1", typeof(MsgPack.Serialization.DirectoryEntry)); itemsSchema1 = MsgPack.Serialization.PolymorphismSchema.ForPolymorphicObject(typeof(object), itemsSchema1TypeMap0); schema1 = MsgPack.Serialization.PolymorphismSchema.ForContextSpecifiedCollection(typeof(System.Collections.Generic.IList<object>), itemsSchema1); this._serializer1 = context.GetSerializer<System.Collections.Generic.IList<object>>(schema1); this._methodBasePolymorphicMemberTypeKnownType_List_ListObjectItemPrivateSetterCollectionProperty_set_ListObjectItem0 = typeof(MsgPack.Serialization.PolymorphicMemberTypeKnownType_List_ListObjectItemPrivateSetterCollectionProperty).GetMethod("set_ListObjectItem", (System.Reflection.BindingFlags.Instance | (System.Reflection.BindingFlags.Public | System.Reflection.BindingFlags.NonPublic)), null, new System.Type[] { typeof(System.Collections.Generic.IList<object>)}, null); } protected internal override void PackToCore(MsgPack.Packer packer, MsgPack.Serialization.PolymorphicMemberTypeKnownType_List_ListObjectItemPrivateSetterCollectionProperty objectTree) { packer.PackMapHeader(1); this._serializer0.PackTo(packer, "ListObjectItem"); this._serializer1.PackTo(packer, objectTree.ListObjectItem); } protected internal override MsgPack.Serialization.PolymorphicMemberTypeKnownType_List_ListObjectItemPrivateSetterCollectionProperty UnpackFromCore(MsgPack.Unpacker unpacker) { MsgPack.Serialization.PolymorphicMemberTypeKnownType_List_ListObjectItemPrivateSetterCollectionProperty result = default(MsgPack.Serialization.PolymorphicMemberTypeKnownType_List_ListObjectItemPrivateSetterCollectionProperty); result = new MsgPack.Serialization.PolymorphicMemberTypeKnownType_List_ListObjectItemPrivateSetterCollectionProperty(); if (unpacker.IsArrayHeader) { int unpacked = default(int); int itemsCount = default(int); itemsCount = MsgPack.Serialization.UnpackHelpers.GetItemsCount(unpacker); System.Collections.Generic.IList<object> nullable = default(System.Collections.Generic.IList<object>); if ((unpacked < itemsCount)) { if ((unpacker.Read() == false)) { throw MsgPack.Serialization.SerializationExceptions.NewMissingItem(0); } if (((unpacker.IsArrayHeader == false) && (unpacker.IsMapHeader == false))) { nullable = this._serializer1.UnpackFrom(unpacker); } else { MsgPack.Unpacker disposable = default(MsgPack.Unpacker); disposable = unpacker.ReadSubtree(); try { nullable = this._serializer1.UnpackFrom(disposable); } finally { if (((disposable == null) == false)) { disposable.Dispose(); } } } } if (((nullable == null) == false)) { if ((result.ListObjectItem == null)) { this._methodBasePolymorphicMemberTypeKnownType_List_ListObjectItemPrivateSetterCollectionProperty_set_ListObjectItem0.Invoke(result, new object[] { nullable}); } else { System.Collections.Generic.IEnumerator<object> enumerator = nullable.GetEnumerator(); object current; try { for ( ; enumerator.MoveNext(); ) { current = enumerator.Current; result.ListObjectItem.Add(current); } } finally { enumerator.Dispose(); } } } unpacked = (unpacked + 1); } else { int itemsCount0 = default(int); itemsCount0 = MsgPack.Serialization.UnpackHelpers.GetItemsCount(unpacker); for (int i = 0; (i < itemsCount0); i = (i + 1)) { string key = default(string); string nullable0 = default(string); nullable0 = MsgPack.Serialization.UnpackHelpers.UnpackStringValue(unpacker, typeof(MsgPack.Serialization.PolymorphicMemberTypeKnownType_List_ListObjectItemPrivateSetterCollectionProperty), "MemberName"); if (((nullable0 == null) == false)) { key = nullable0; } else { throw MsgPack.Serialization.SerializationExceptions.NewNullIsProhibited("MemberName"); } if ((key == "ListObjectItem")) { System.Collections.Generic.IList<object> nullable1 = default(System.Collections.Generic.IList<object>); if ((unpacker.Read() == false)) { throw MsgPack.Serialization.SerializationExceptions.NewMissingItem(i); } if (((unpacker.IsArrayHeader == false) && (unpacker.IsMapHeader == false))) { nullable1 = this._serializer1.UnpackFrom(unpacker); } else { MsgPack.Unpacker disposable0 = default(MsgPack.Unpacker); disposable0 = unpacker.ReadSubtree(); try { nullable1 = this._serializer1.UnpackFrom(disposable0); } finally { if (((disposable0 == null) == false)) { disposable0.Dispose(); } } } if (((nullable1 == null) == false)) { if ((result.ListObjectItem == null)) { this._methodBasePolymorphicMemberTypeKnownType_List_ListObjectItemPrivateSetterCollectionProperty_set_ListObjectItem0.Invoke(result, new object[] { nullable1}); } else { System.Collections.Generic.IEnumerator<object> enumerator0 = nullable1.GetEnumerator(); object current0; try { for ( ; enumerator0.MoveNext(); ) { current0 = enumerator0.Current; result.ListObjectItem.Add(current0); } } finally { enumerator0.Dispose(); } } } } else { unpacker.Skip(); } } } return result; } private static T @__Conditional<T>(bool condition, T whenTrue, T whenFalse) { if (condition) { return whenTrue; } else { return whenFalse; } } } }
Java
# Ageratina tomentella (Schrad.) R.M.King & H.Rob. SPECIES #### Status ACCEPTED #### According to International Plant Names Index #### Published in null #### Original name null ### Remarks null
Java
//============================================================================ // // Copyright (C) 2006-2022 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.google.drive.connection; import java.util.EnumSet; import java.util.Set; import org.talend.components.api.component.ConnectorTopology; import org.talend.components.api.component.runtime.ExecutionEngine; import org.talend.components.api.properties.ComponentProperties; import org.talend.components.google.drive.GoogleDriveComponentDefinition; import org.talend.daikon.runtime.RuntimeInfo; public class GoogleDriveConnectionDefinition extends GoogleDriveComponentDefinition { public static final String COMPONENT_NAME = "tGoogleDriveConnection"; //$NON-NLS-1$ public GoogleDriveConnectionDefinition() { super(COMPONENT_NAME); } @Override public Class<? extends ComponentProperties> getPropertyClass() { return GoogleDriveConnectionProperties.class; } @Override public Set<ConnectorTopology> getSupportedConnectorTopologies() { return EnumSet.of(ConnectorTopology.NONE); } @Override public RuntimeInfo getRuntimeInfo(ExecutionEngine engine, ComponentProperties properties, ConnectorTopology connectorTopology) { assertEngineCompatibility(engine); assertConnectorTopologyCompatibility(connectorTopology); return getRuntimeInfo(GoogleDriveConnectionDefinition.SOURCE_OR_SINK_CLASS); } @Override public boolean isStartable() { return true; } }
Java
package si.majeric.smarthouse.xstream.dao; public class SmartHouseConfigReadError extends RuntimeException { private static final long serialVersionUID = 1L; public SmartHouseConfigReadError(Exception e) { super(e); } }
Java
<!DOCTYPE html> <html> <meta charset="UTF-8"> <head> <title>Topic 06 -- Abstracts with Biological Entities (English) - 75 Topics / Sub-Topic Model 13 - 15 Topics</title> <style> table { font-family: "Trebuchet MS", Arial, Helvetica, sans-serif; border-collapse: collapse; width: 100%; } td, th { border: 1px solid #ddd; padding: 8px; } tr:nth-child(even){background-color: #f2f2f2;} tr:hover {background-color: #ddd;} th { padding-top: 12px; padding-bottom: 12px; text-align: left; background-color: #0099FF; color: white; } </style> </head> <body> <h2>Topic 06 -- Abstracts with Biological Entities (English) - 75 Topics / Sub-Topic Model 13 - 15 Topics</h2> <table border="1" class="dataframe"> <thead> <tr style="text-align: right;"> <th></th> <th>cite ad</th> <th>title</th> <th>authors</th> <th>publish year</th> <th>publish time</th> <th>dataset</th> <th>abstract mentions covid</th> <th>pmcid</th> <th>pubmed id</th> <th>doi</th> <th>cord uid</th> <th>topic weight</th> <th>Similarity scispacy</th> <th>Similarity specter</th> </tr> </thead> <tbody> <tr> <th id="ryychtqa";>1</th> <td>Zuniga_2007</td> <td>Attenuated measles virus as a vaccine vector</td> <td>Zuniga, Armando; Wang, ZiLi; Liniger, Matthias; Hangartner, Lars; Caballero, Michael; Pavlovic, Jovan; Wild, Peter; Viret, Jean Francois; Glueck, Reinhard; Billeter, Martin A.; Naim, Hussein Y.</td> <td>2007</td> <td>2007-04-20</td> <td>None</td> <td>N</td> <td><a href="https://www.ncbi.nlm.nih.gov/pmc/articles/PMC3707277" target="_blank">PMC3707277</a></td> <td><a href="https://www.ncbi.nlm.nih.gov/pubmed/17303293.0" target="_blank">17303293.0</a></td> <td><a href="https://doi.org/10.1016/j.vaccine.2007.01.064" target="_blank">10.1016/j.vaccine.2007.01.064</a></td> <td>ryychtqa</td> <td>0.647705</td> <td></td> <td><a href="Topic_06.html#cmbg0ty8">Mühlebach_2016</a>, <a href="Topic_01.html#3qdjmb2j">Mok_H_2012</a></td> </tr> <tr> <th id="u361oua5";>2</th> <td>Peruzzi_2009</td> <td>A novel Chimpanzee serotype-based adenoviral vector as delivery tool for cancer vaccines</td> <td>Peruzzi, Daniela; Dharmapuri, Sridhar; Cirillo, Agostino; Bruni, Bruno Ercole; Nicosia, Alfredo; Cortese, Riccardo; Colloca, Stefano; Ciliberto, Gennaro; La Monica, Nicola; Aurisicchio, Luigi</td> <td>2009</td> <td>2009-02-25</td> <td>PMC</td> <td>N</td> <td><a href="https://www.ncbi.nlm.nih.gov/pmc/articles/PMC7115565" target="_blank">PMC7115565</a></td> <td><a href="https://www.ncbi.nlm.nih.gov/pubmed/19162112.0" target="_blank">19162112.0</a></td> <td><a href="https://doi.org/10.1016/j.vaccine.2008.12.051" target="_blank">10.1016/j.vaccine.2008.12.051</a></td> <td>u361oua5</td> <td>0.627562</td> <td><a href="Topic_06.html#hrfbygub">Singh_2016</a>, <a href="Topic_07.html#nzuq0dk7">Schwartz_2007</a>, <a href="Topic_01.html#z2u5frvq">Montefiori_2007</a></td> <td></td> </tr> <tr> <th id="ctass7hz";>3</th> <td>Bull_2019</td> <td>Recombinant vector vaccine evolution</td> <td>Bull, James J.; Nuismer, Scott L.; Antia, Rustom</td> <td>2019</td> <td>2019-07-19</td> <td>COMM-USE</td> <td>N</td> <td><a href="https://www.ncbi.nlm.nih.gov/pmc/articles/PMC6668849" target="_blank">PMC6668849</a></td> <td><a href="https://www.ncbi.nlm.nih.gov/pubmed/31323032.0" target="_blank">31323032.0</a></td> <td><a href="https://doi.org/10.1371/journal.pcbi.1006857" target="_blank">10.1371/journal.pcbi.1006857</a></td> <td>ctass7hz</td> <td>0.626904</td> <td><a href="Topic_01.html#z2u5frvq">Montefiori_2007</a>, <a href="Topic_07.html#neclg3gb">Tripp_2014</a></td> <td><a href="Topic_06.html#3vssgben">Bull_2019</a>, <a href="Topic_06.html#cmbg0ty8">Mühlebach_2016</a>, <a href="Topic_06.html#ryychtqa">Zuniga_2007</a>, <a href="Topic_02.html#zs8urh6c">Nuismer_2019</a></td> </tr> <tr> <th id="v5n1gupw";>4</th> <td>Bangari_2006</td> <td>Development of nonhuman adenoviruses as vaccine vectors</td> <td>Bangari, Dinesh S.; Mittal, Suresh K.</td> <td>2006</td> <td>2006-02-13</td> <td>None</td> <td>N</td> <td><a href="https://www.ncbi.nlm.nih.gov/pmc/articles/PMC1462960" target="_blank">PMC1462960</a></td> <td><a href="https://www.ncbi.nlm.nih.gov/pubmed/16297508.0" target="_blank">16297508.0</a></td> <td><a href="https://doi.org/10.1016/j.vaccine.2005.08.101" target="_blank">10.1016/j.vaccine.2005.08.101</a></td> <td>v5n1gupw</td> <td>0.622664</td> <td><a href="Topic_02.html#aw8p35c5">Tatsis_2004</a></td> <td><a href="Topic_02.html#aw8p35c5">Tatsis_2004</a>, <a href="Topic_06.html#mxtry60e">Mittal_2016</a></td> </tr> <tr> <th id="3vssgben";>5</th> <td>Bull_2019</td> <td>Recombinant vector vaccines and within-host evolution</td> <td>James Bull; Scott L. Nuismer; Rustom Antia</td> <td>2019</td> <td>2019-02-08</td> <td>BioRxiv</td> <td>N</td> <td></td> <td></td> <td><a href="https://doi.org/10.1101/545087" target="_blank">10.1101/545087</a></td> <td>3vssgben</td> <td>0.609826</td> <td><a href="Topic_06.html#ctass7hz">Bull_2019</a></td> <td><a href="Topic_06.html#ctass7hz">Bull_2019</a>, <a href="Topic_06.html#cmbg0ty8">Mühlebach_2016</a>, <a href="Topic_02.html#zs8urh6c">Nuismer_2019</a>, <a href="Topic_06.html#ryychtqa">Zuniga_2007</a></td> </tr> <tr> <th id="s1zl9nbb";>6</th> <td>Bishop_1988</td> <td>The release into the environment of genetically engineered viruses, vaccines and viral pesticides</td> <td>Bishop, David H.L.</td> <td>1988</td> <td>1988-04-30</td> <td>PMC</td> <td>N</td> <td></td> <td></td> <td><a href="https://doi.org/10.1016/0169-5347(88)90130-9" target="_blank">10.1016/0169-5347(88)90130-9</a></td> <td>s1zl9nbb</td> <td>0.597917</td> <td><a href="Topic_02.html#lke4y02f">Bishop_1988</a></td> <td></td> </tr> <tr> <th id="mxtry60e";>7</th> <td>Mittal_2016</td> <td>19 Xenogenic Adenoviral Vectors</td> <td>Mittal, Suresh K.; Ahi, Yadvinder S.; Vemula, Sai V.</td> <td>2016</td> <td>2016-12-31</td> <td>PMC</td> <td>N</td> <td><a href="https://www.ncbi.nlm.nih.gov/pmc/articles/PMC7149625" target="_blank">PMC7149625</a></td> <td></td> <td><a href="https://doi.org/10.1016/b978-0-12-800276-6.00019-x" target="_blank">10.1016/b978-0-12-800276-6.00019-x</a></td> <td>mxtry60e</td> <td>0.569062</td> <td><a href="Topic_06.html#v5n1gupw">Bangari_2006</a></td> <td><a href="Topic_06.html#v5n1gupw">Bangari_2006</a>, <a href="Topic_02.html#u1xbkaq0">Ploquin_2013</a></td> </tr> <tr> <th id="uacon432";>8</th> <td>Liniger_2009</td> <td>Recombinant measles viruses expressing single or multiple antigens of human immunodeficiency virus (HIV-1) induce cellular and humoral immune responses</td> <td>Liniger, Matthias; Zuniga, Armando; Morin, Teldja Neige Azzouz; Combardiere, Behazine; Marty, Rene; Wiegand, Marian; Ilter, Orhan; Knuchel, Marlyse; Naim, Hussein Y.</td> <td>2009</td> <td>2009-05-26</td> <td>PMC</td> <td>N</td> <td><a href="https://www.ncbi.nlm.nih.gov/pmc/articles/PMC7115622" target="_blank">PMC7115622</a></td> <td><a href="https://www.ncbi.nlm.nih.gov/pubmed/19200842.0" target="_blank">19200842.0</a></td> <td><a href="https://doi.org/10.1016/j.vaccine.2009.01.057" target="_blank">10.1016/j.vaccine.2009.01.057</a></td> <td>uacon432</td> <td>0.555529</td> <td><a href="Topic_07.html#nzuq0dk7">Schwartz_2007</a>, <a href="Topic_03.html#k785hl1r">Lv_L_2014</a></td> <td><a href="Topic_01.html#3qdjmb2j">Mok_H_2012</a>, <a href="Topic_06.html#cmbg0ty8">Mühlebach_2016</a>, <a href="Topic_01.html#vct6xakc">Jiang_2006</a>, <a href="Topic_14.html#ngms51ie">Sawada_2011</a></td> </tr> <tr> <th id="zceca4c1";>9</th> <td>Roy_S_2007</td> <td>Rescue of chimeric adenoviral vectors to expand the serotype repertoire</td> <td>Roy, Soumitra; Clawson, David S.; Lavrukhin, Oleg; Sandhu, Arbans; Miller, Jim; Wilson, James M.</td> <td>2007</td> <td>2007-04-30</td> <td>None</td> <td>N</td> <td><a href="https://www.ncbi.nlm.nih.gov/pmc/articles/PMC1868475" target="_blank">PMC1868475</a></td> <td><a href="https://www.ncbi.nlm.nih.gov/pubmed/17197043.0" target="_blank">17197043.0</a></td> <td><a href="https://doi.org/10.1016/j.jviromet.2006.11.022" target="_blank">10.1016/j.jviromet.2006.11.022</a></td> <td>zceca4c1</td> <td>0.541514</td> <td></td> <td><a href="Topic_06.html#mxtry60e">Mittal_2016</a>, <a href="Topic_02.html#odeksech">Ertl_2016</a>, <a href="Topic_06.html#v5n1gupw">Bangari_2006</a></td> </tr> <tr> <th id="s27bp7ft";>10</th> <td>Bolton_2012</td> <td>Priming T-cell responses with recombinant measles vaccine vector in a heterologous prime-boost setting in non-human primates</td> <td>Bolton, Diane L.; Santra, Sampa; Swett-Tapia, Cindy; Custers, Jerome; Song, Kaimei; Balachandran, Harikrishnan; Mach, Linh; Naim, Hussein; Kozlowski, Pamela A.; Lifton, Michelle; Goudsmit, Jaap; Letvin, Norman; Roederer, Mario; Radošević, Katarina</td> <td>2012</td> <td>2012-09-07</td> <td>None</td> <td>N</td> <td><a href="https://www.ncbi.nlm.nih.gov/pmc/articles/PMC3425710" target="_blank">PMC3425710</a></td> <td><a href="https://www.ncbi.nlm.nih.gov/pubmed/22732429.0" target="_blank">22732429.0</a></td> <td><a href="https://doi.org/10.1016/j.vaccine.2012.06.029" target="_blank">10.1016/j.vaccine.2012.06.029</a></td> <td>s27bp7ft</td> <td>0.537387</td> <td><a href="Topic_01.html#z2u5frvq">Montefiori_2007</a>, <a href="Topic_07.html#nzuq0dk7">Schwartz_2007</a></td> <td><a href="Topic_01.html#f78ug0c6">Meng_2012</a>, <a href="Topic_01.html#6rcezxjx">Zakhartchouk_2005</a>, <a href="Topic_05.html#ctikde7d">Cervantes-Barragan_2010</a>, <a href="Topic_01.html#3qdjmb2j">Mok_H_2012</a></td> </tr> <tr> <th id="vr4c59hy";>11</th> <td>Xiao_2011</td> <td>A host-restricted viral vector for antigen-specific immunization against Lyme disease pathogen</td> <td>Xiao, Sa; Kumar, Manish; Yang, Xiuli; Akkoyunlu, Mustafa; Collins, Peter L.; Samal, Siba K.; Pal, Utpal</td> <td>2011</td> <td>2011-07-18</td> <td>None</td> <td>N</td> <td><a href="https://www.ncbi.nlm.nih.gov/pmc/articles/PMC3138909" target="_blank">PMC3138909</a></td> <td><a href="https://www.ncbi.nlm.nih.gov/pubmed/21600949.0" target="_blank">21600949.0</a></td> <td><a href="https://doi.org/10.1016/j.vaccine.2011.05.010" target="_blank">10.1016/j.vaccine.2011.05.010</a></td> <td>vr4c59hy</td> <td>0.533249</td> <td><a href="Topic_07.html#nzuq0dk7">Schwartz_2007</a>, <a href="Topic_03.html#k785hl1r">Lv_L_2014</a></td> <td><a href="Topic_10.html#ovoli9dr">Keshwara_2019</a></td> </tr> <tr> <th id="xaohrtq7";>12</th> <td>Lorin_2015</td> <td>Heterologous Prime-Boost Regimens with a Recombinant Chimpanzee Adenoviral Vector and Adjuvanted F4 Protein Elicit Polyfunctional HIV-1-Specific T-Cell Responses in Macaques</td> <td>Lorin, Clarisse; Vanloubbeeck, Yannick; Baudart, Sébastien; Ska, Michaël; Bayat, Babak; Brauers, Geoffroy; Clarinval, Géraldine; Donner, Marie-Noëlle; Marchand, Martine; Koutsoukos, Marguerite; Mettens, Pascal; Cohen, Joe; Voss, Gerald</td> <td>2015</td> <td>2015-04-09</td> <td>COMM-USE</td> <td>N</td> <td><a href="https://www.ncbi.nlm.nih.gov/pmc/articles/PMC4391709" target="_blank">PMC4391709</a></td> <td><a href="https://www.ncbi.nlm.nih.gov/pubmed/25856308.0" target="_blank">25856308.0</a></td> <td><a href="https://doi.org/10.1371/journal.pone.0122835" target="_blank">10.1371/journal.pone.0122835</a></td> <td>xaohrtq7</td> <td>0.505593</td> <td><a href="Topic_01.html#5lnehhu1">Mazeike_2012</a></td> <td><a href="Topic_06.html#s27bp7ft">Bolton_2012</a>, <a href="Topic_01.html#5hryh1ft">Azizi_2006</a>, <a href="Topic_06.html#270nzddu">Busch_2020</a></td> </tr> <tr> <th id="fie121ns";>13</th> <td>White_2018</td> <td>Development of improved therapeutic mesothelin-based vaccines for pancreatic cancer</td> <td>White, Michael; Freistaedter, Andrew; Jones, Gwendolyn J. B.; Zervos, Emmanuel; Roper, Rachel L.</td> <td>2018</td> <td>2018-02-23</td> <td>COMM-USE</td> <td>N</td> <td><a href="https://www.ncbi.nlm.nih.gov/pmc/articles/PMC5825036" target="_blank">PMC5825036</a></td> <td><a href="https://www.ncbi.nlm.nih.gov/pubmed/29474384.0" target="_blank">29474384.0</a></td> <td><a href="https://doi.org/10.1371/journal.pone.0193131" target="_blank">10.1371/journal.pone.0193131</a></td> <td>fie121ns</td> <td>0.498469</td> <td></td> <td></td> </tr> <tr> <th id="m4sp9sjn";>14</th> <td>Matthews_2010</td> <td>HIV Antigen Incorporation within Adenovirus Hexon Hypervariable 2 for a Novel HIV Vaccine Approach</td> <td>Matthews, Qiana L.; Fatima, Aiman; Tang, Yizhe; Perry, Brian A.; Tsuruta, Yuko; Komarova, Svetlana; Timares, Laura; Zhao, Chunxia; Makarova, Natalia; Borovjagin, Anton V.; Stewart, Phoebe L.; Wu, Hongju; Blackwell, Jerry L.; Curiel, David T.</td> <td>2010</td> <td>2010-07-27</td> <td>COMM-USE</td> <td>N</td> <td><a href="https://www.ncbi.nlm.nih.gov/pmc/articles/PMC2910733" target="_blank">PMC2910733</a></td> <td><a href="https://www.ncbi.nlm.nih.gov/pubmed/20676400.0" target="_blank">20676400.0</a></td> <td><a href="https://doi.org/10.1371/journal.pone.0011815" target="_blank">10.1371/journal.pone.0011815</a></td> <td>m4sp9sjn</td> <td>0.495758</td> <td><a href="Topic_01.html#z2u5frvq">Montefiori_2007</a>, <a href="Topic_01.html#vct6xakc">Jiang_2006</a>, <a href="Topic_06.html#hrfbygub">Singh_2016</a></td> <td><a href="Topic_06.html#p6ikd8ns">Hansra_2015</a>, <a href="Topic_06.html#u361oua5">Peruzzi_2009</a></td> </tr> <tr> <th id="4mt2v3ip";>15</th> <td>Bayer_2011</td> <td>Improved vaccine protection against retrovirus infection after co-administration of adenoviral vectors encoding viral antigens and type I interferon subtypes</td> <td>Bayer, Wibke; Lietz, Ruth; Ontikatze, Teona; Johrden, Lena; Tenbusch, Matthias; Nabi, Ghulam; Schimmer, Simone; Groitl, Peter; Wolf, Hans; Berry, Cassandra M; Überla, Klaus; Dittmer, Ulf; Wildner, Oliver</td> <td>2011</td> <td>2011-09-26</td> <td>COMM-USE</td> <td>N</td> <td><a href="https://www.ncbi.nlm.nih.gov/pmc/articles/PMC3193818" target="_blank">PMC3193818</a></td> <td><a href="https://www.ncbi.nlm.nih.gov/pubmed/21943056.0" target="_blank">21943056.0</a></td> <td><a href="https://doi.org/10.1186/1742-4690-8-75" target="_blank">10.1186/1742-4690-8-75</a></td> <td>4mt2v3ip</td> <td>0.491964</td> <td><a href="Topic_01.html#vct6xakc">Jiang_2006</a>, <a href="Topic_01.html#z2u5frvq">Montefiori_2007</a>, <a href="Topic_06.html#hrfbygub">Singh_2016</a></td> <td><a href="Topic_01.html#3qdjmb2j">Mok_H_2012</a>, <a href="Topic_06.html#s27bp7ft">Bolton_2012</a>, <a href="Topic_01.html#f78ug0c6">Meng_2012</a></td> </tr> <tr> <th id="mu4fdrel";>16</th> <td>Meseda_2004</td> <td>DNA immunization with a herpes simplex virus 2 bacterial artificial chromosome</td> <td>Meseda, Clement A.; Schmeisser, Falko; Pedersen, Robin; Woerner, Amy; Weir, Jerry P.</td> <td>2004</td> <td>2004-01-05</td> <td>PMC</td> <td>N</td> <td></td> <td><a href="https://www.ncbi.nlm.nih.gov/pubmed/14972567.0" target="_blank">14972567.0</a></td> <td><a href="https://doi.org/10.1016/j.virol.2003.09.033" target="_blank">10.1016/j.virol.2003.09.033</a></td> <td>mu4fdrel</td> <td>0.483117</td> <td></td> <td></td> </tr> <tr> <th id="yw8gubcy";>17</th> <td>Wang_2010</td> <td>Modified H5 promoter improves stability of insert genes while maintaining immunogenicity during extended passage of genetically engineered MVA vaccines</td> <td>Wang, Zhongde; Martinez, Joy; Zhou, Wendi; La Rosa, Corinna; Srivastava, Tumul; Dasgupta, Anindya; Rawal, Ravindra; Li, Zhongqui; Britt, William J.; Diamond, Don</td> <td>2010</td> <td>2010-02-10</td> <td>PMC</td> <td>N</td> <td></td> <td><a href="https://www.ncbi.nlm.nih.gov/pubmed/19969118.0" target="_blank">19969118.0</a></td> <td><a href="https://doi.org/10.1016/j.vaccine.2009.11.056" target="_blank">10.1016/j.vaccine.2009.11.056</a></td> <td>yw8gubcy</td> <td>0.477085</td> <td></td> <td></td> </tr> <tr> <th id="3894l9qi";>18</th> <td>Fausther-Bovendo_2014</td> <td>Pre-existing immunity against Ad vectors: Humoral, cellular, and innate response, what's important?</td> <td>Fausther-Bovendo, Hugues; Kobinger, Gary P</td> <td>2014</td> <td>2014-11-01</td> <td>NONCOMM</td> <td>N</td> <td><a href="https://www.ncbi.nlm.nih.gov/pmc/articles/PMC5443060" target="_blank">PMC5443060</a></td> <td><a href="https://www.ncbi.nlm.nih.gov/pubmed/25483662.0" target="_blank">25483662.0</a></td> <td><a href="https://doi.org/10.4161/hv.29594" target="_blank">10.4161/hv.29594</a></td> <td>3894l9qi</td> <td>0.475906</td> <td><a href="Topic_01.html#z2u5frvq">Montefiori_2007</a>, <a href="Topic_06.html#hrfbygub">Singh_2016</a></td> <td><a href="Topic_01.html#pr9i9swk">Croyle_2008</a>, <a href="Topic_01.html#eu80ccm6">Pandey_2012</a></td> </tr> <tr> <th id="270nzddu";>19</th> <td>Busch_2020</td> <td>Measles Vaccines Designed for Enhanced CD8(+) T Cell Activation</td> <td>Busch, Elena; Kubon, Kristina D.; Mayer, Johanna K. M.; Pidelaserra-Martí, Gemma; Albert, Jessica; Hoyler, Birgit; Heidbuechel, Johannes P. W.; Stephenson, Kyle B.; Lichty, Brian D.; Osen, Wolfram; Eichmüller, Stefan B.; Jäger, Dirk; Ungerechts, Guy; Engeland, Christine E.</td> <td>2020</td> <td>2020-02-21</td> <td>None</td> <td>N</td> <td><a href="https://www.ncbi.nlm.nih.gov/pmc/articles/PMC7077255" target="_blank">PMC7077255</a></td> <td><a href="https://www.ncbi.nlm.nih.gov/pubmed/32098134.0" target="_blank">32098134.0</a></td> <td><a href="https://doi.org/10.3390/v12020242" target="_blank">10.3390/v12020242</a></td> <td>270nzddu</td> <td>0.467243</td> <td><a href="Topic_01.html#z2u5frvq">Montefiori_2007</a></td> <td><a href="Topic_01.html#lcoo85s6">Kim_S_2012</a>, <a href="Topic_05.html#ctikde7d">Cervantes-Barragan_2010</a>, <a href="Topic_01.html#3qdjmb2j">Mok_H_2012</a></td> </tr> <tr> <th id="p6ikd8ns";>20</th> <td>Hansra_2015</td> <td>Exploration of New Sites in Adenovirus Hexon for Foreign Peptides Insertion</td> <td>Hansra, Satyender; Pujhari, Sujit; Zakhartchouk, Alexander N</td> <td>2015</td> <td>2015-05-29</td> <td>NONCOMM</td> <td>N</td> <td><a href="https://www.ncbi.nlm.nih.gov/pmc/articles/PMC4460227" target="_blank">PMC4460227</a></td> <td><a href="https://www.ncbi.nlm.nih.gov/pubmed/26069516.0" target="_blank">26069516.0</a></td> <td><a href="https://doi.org/10.2174/1874357901509010001" target="_blank">10.2174/1874357901509010001</a></td> <td>p6ikd8ns</td> <td>0.466283</td> <td></td> <td><a href="Topic_06.html#m4sp9sjn">Matthews_2010</a></td> </tr> <tr> <th id="591iufv1";>21</th> <td>Babiuk_2000</td> <td>Adenoviruses as vectors for delivering vaccines to mucosal surfaces</td> <td>Babiuk, L.A; Tikoo, S.K</td> <td>2000</td> <td>2000-09-29</td> <td>PMC</td> <td>N</td> <td><a href="https://www.ncbi.nlm.nih.gov/pmc/articles/PMC7126179" target="_blank">PMC7126179</a></td> <td><a href="https://www.ncbi.nlm.nih.gov/pubmed/11000466.0" target="_blank">11000466.0</a></td> <td><a href="https://doi.org/10.1016/s0168-1656(00)00314-x" target="_blank">10.1016/s0168-1656(00)00314-x</a></td> <td>591iufv1</td> <td>0.447938</td> <td><a href="Topic_01.html#z2u5frvq">Montefiori_2007</a></td> <td><a href="Topic_02.html#b8mfn6o9">Tarahomjoo_2011</a>, <a href="Topic_02.html#aw8p35c5">Tatsis_2004</a>, <a href="Topic_06.html#cmbg0ty8">Mühlebach_2016</a></td> </tr> <tr> <th id="cmbg0ty8";>22</th> <td>Mühlebach_2016</td> <td>Development of Recombinant Measles Virus-Based Vaccines</td> <td>Mühlebach, Michael D.; Hutzler, Stefan</td> <td>2016</td> <td>2016-11-26</td> <td>PMC</td> <td>N</td> <td><a href="https://www.ncbi.nlm.nih.gov/pmc/articles/PMC7121886" target="_blank">PMC7121886</a></td> <td><a href="https://www.ncbi.nlm.nih.gov/pubmed/28374248.0" target="_blank">28374248.0</a></td> <td><a href="https://doi.org/10.1007/978-1-4939-6869-5_9" target="_blank">10.1007/978-1-4939-6869-5_9</a></td> <td>cmbg0ty8</td> <td>0.447755</td> <td></td> <td><a href="Topic_06.html#ryychtqa">Zuniga_2007</a>, <a href="Topic_01.html#3qdjmb2j">Mok_H_2012</a></td> </tr> <tr> <th id="gqqzekfk";>23</th> <td>Lin_C_2012</td> <td>Enhancement of anti-murine colon cancer immunity by fusion of a SARS fragment to a low-immunogenic carcinoembryonic antigen</td> <td>Lin, Chen-Si; Kao, Shih-Han; Chen, Yu-Cheng; Li, Chi-Han; Hsieh, Yuan-Ting; Yang, Shang-Chih; Wu, Chang-Jer; Lee, Ru-Ping; Liao, Kuang-Wen</td> <td>2012</td> <td>2012-02-03</td> <td>COMM-USE</td> <td>N</td> <td><a href="https://www.ncbi.nlm.nih.gov/pmc/articles/PMC3298716" target="_blank">PMC3298716</a></td> <td><a href="https://www.ncbi.nlm.nih.gov/pubmed/22304896.0" target="_blank">22304896.0</a></td> <td><a href="https://doi.org/10.1186/1480-9222-14-2" target="_blank">10.1186/1480-9222-14-2</a></td> <td>gqqzekfk</td> <td>0.437763</td> <td><a href="Topic_01.html#xv0esvos">Azizi_2005</a>, <a href="Topic_01.html#z2u5frvq">Montefiori_2007</a>, <a href="Topic_06.html#hrfbygub">Singh_2016</a></td> <td><a href="Topic_01.html#lbx8tqws">Li_W_2013</a></td> </tr> <tr> <th id="tzq4i5xr";>24</th> <td>Bloom_2018</td> <td>Immunization by Replication-Competent Controlled Herpesvirus Vectors</td> <td>Bloom, David C.; Tran, Robert K.; Feller, Joyce; Voellmy, Richard</td> <td>2018</td> <td>2018-07-31</td> <td>COMM-USE</td> <td>N</td> <td><a href="https://www.ncbi.nlm.nih.gov/pmc/articles/PMC6069180" target="_blank">PMC6069180</a></td> <td><a href="https://www.ncbi.nlm.nih.gov/pubmed/29899091.0" target="_blank">29899091.0</a></td> <td><a href="https://doi.org/10.1128/jvi.00616-18" target="_blank">10.1128/jvi.00616-18</a></td> <td>tzq4i5xr</td> <td>0.437112</td> <td></td> <td><a href="Topic_06.html#cmbg0ty8">Mühlebach_2016</a>, <a href="Topic_01.html#qk2ureql">Maunder_2015</a></td> </tr> <tr> <th id="wi7qdbc7";>25</th> <td>Lawrence_2013</td> <td>Comparison of Heterologous Prime-Boost Strategies against Human Immunodeficiency Virus Type 1 Gag Using Negative Stranded RNA Viruses</td> <td>Lawrence, Tessa M.; Wanjalla, Celestine N.; Gomme, Emily A.; Wirblich, Christoph; Gatt, Anthony; Carnero, Elena; García-Sastre, Adolfo; Lyles, Douglas S.; McGettigan, James P.; Schnell, Matthias J.</td> <td>2013</td> <td>2013-06-26</td> <td>COMM-USE</td> <td>N</td> <td><a href="https://www.ncbi.nlm.nih.gov/pmc/articles/PMC3694142" target="_blank">PMC3694142</a></td> <td><a href="https://www.ncbi.nlm.nih.gov/pubmed/23840600.0" target="_blank">23840600.0</a></td> <td><a href="https://doi.org/10.1371/journal.pone.0067123" target="_blank">10.1371/journal.pone.0067123</a></td> <td>wi7qdbc7</td> <td>0.435406</td> <td><a href="Topic_07.html#nzuq0dk7">Schwartz_2007</a>, <a href="Topic_01.html#z2u5frvq">Montefiori_2007</a>, <a href="Topic_01.html#vct6xakc">Jiang_2006</a></td> <td><a href="Topic_06.html#s27bp7ft">Bolton_2012</a>, <a href="Topic_01.html#vct6xakc">Jiang_2006</a>, <a href="Topic_01.html#3qdjmb2j">Mok_H_2012</a></td> </tr> <tr> <th id="lke4y02f";>26</th> <td>Bishop_1988</td> <td>The release into the environment of genetically engineered viruses, vaccines and viral pesticides</td> <td>Bishop, David H.L.</td> <td>1988</td> <td>1988-04-30</td> <td>PMC</td> <td>N</td> <td></td> <td></td> <td><a href="https://doi.org/10.1016/0167-7799(88)90006-6" target="_blank">10.1016/0167-7799(88)90006-6</a></td> <td>lke4y02f</td> <td>0.428086</td> <td><a href="Topic_06.html#s1zl9nbb">Bishop_1988</a></td> <td></td> </tr> <tr> <th id="7a6q4d3h";>27</th> <td>Thacker_2009</td> <td>Strategies to overcome host immunity to adenovirus vectors in vaccine development</td> <td>Thacker, Erin E; Timares, Laura; Matthews, Qiana L</td> <td>2009</td> <td>2009-06-01</td> <td>PMC</td> <td>N</td> <td><a href="https://www.ncbi.nlm.nih.gov/pmc/articles/PMC3700409" target="_blank">PMC3700409</a></td> <td><a href="https://www.ncbi.nlm.nih.gov/pubmed/19485756.0" target="_blank">19485756.0</a></td> <td><a href="https://doi.org/10.1586/erv.09.29" target="_blank">10.1586/erv.09.29</a></td> <td>7a6q4d3h</td> <td>0.422274</td> <td><a href="Topic_01.html#z2u5frvq">Montefiori_2007</a>, <a href="Topic_07.html#fq78593b">Mooney_2013</a></td> <td><a href="Topic_02.html#7eqpb7ge">Borovjagin_2014</a>, <a href="Topic_02.html#aw8p35c5">Tatsis_2004</a>, <a href="Topic_06.html#v5n1gupw">Bangari_2006</a></td> </tr> <tr> <th id="dgeisr8h";>28</th> <td>Folegatti_2019</td> <td>Safety and Immunogenicity of a Novel Recombinant Simian Adenovirus ChAdOx2 as a Vectored Vaccine</td> <td>Folegatti, Pedro M.; Bellamy, Duncan; Roberts, Rachel; Powlson, Jonathan; Edwards, Nick J.; Mair, Catherine F.; Bowyer, Georgina; Poulton, Ian; Mitton, Celia H.; Green, Nicky; Berrie, Eleanor; Lawrie, Alison M.; Hill, Adrian V.S.; Ewer, Katie J.; Hermon-Taylor, John; Gilbert, Sarah C.</td> <td>2019</td> <td>2019-05-15</td> <td>COMM-USE</td> <td>N</td> <td><a href="https://www.ncbi.nlm.nih.gov/pmc/articles/PMC6630572" target="_blank">PMC6630572</a></td> <td><a href="https://www.ncbi.nlm.nih.gov/pubmed/31096710.0" target="_blank">31096710.0</a></td> <td><a href="https://doi.org/10.3390/vaccines7020040" target="_blank">10.3390/vaccines7020040</a></td> <td>dgeisr8h</td> <td>0.420425</td> <td><a href="Topic_07.html#nzuq0dk7">Schwartz_2007</a>, <a href="Topic_01.html#z2u5frvq">Montefiori_2007</a></td> <td><a href="Topic_02.html#u1xbkaq0">Ploquin_2013</a>, <a href="Topic_12.html#5zn2vrj5">Warimwe_2013</a></td> </tr> <tr> <th id="bmrfz8pz";>29</th> <td>Lopera-Madrid_2017</td> <td>Safety and immunogenicity of mammalian cell derived and Modified Vaccinia Ankara vectored African swine fever subunit antigens in swine</td> <td>Lopera-Madrid, Jaime; Osorio, Jorge E.; He, Yongqun; Xiang, Zuoshuang; Adams, L. Garry; Laughlin, Richard C.; Mwangi, Waithaka; Subramanya, Sandesh; Neilan, John; Brake, David; Burrage, Thomas G.; Brown, William Clay; Clavijo, Alfonso; Bounpheng, Mangkey A.</td> <td>2017</td> <td>2017-03-31</td> <td>PMC</td> <td>N</td> <td><a href="https://www.ncbi.nlm.nih.gov/pmc/articles/PMC7112906" target="_blank">PMC7112906</a></td> <td><a href="https://www.ncbi.nlm.nih.gov/pubmed/28241999.0" target="_blank">28241999.0</a></td> <td><a href="https://doi.org/10.1016/j.vetimm.2017.01.004" target="_blank">10.1016/j.vetimm.2017.01.004</a></td> <td>bmrfz8pz</td> <td>0.418540</td> <td><a href="Topic_07.html#nzuq0dk7">Schwartz_2007</a></td> <td><a href="Topic_01.html#f78ug0c6">Meng_2012</a>, <a href="Topic_14.html#ngms51ie">Sawada_2011</a>, <a href="Topic_01.html#yk0xxv16">Do_V_2020</a></td> </tr> <tr> <th id="2sg1tlrg";>30</th> <td>Clarke_2006</td> <td>Recombinant vesicular stomatitis virus as an HIV-1 vaccine vector</td> <td>Clarke, David K.; Cooper, David; Egan, Michael A.; Hendry, R. Michael; Parks, Christopher L.; Udem, Stephen A.</td> <td>2006</td> <td>2006-09-15</td> <td>PMC</td> <td>N</td> <td><a href="https://www.ncbi.nlm.nih.gov/pmc/articles/PMC7079905" target="_blank">PMC7079905</a></td> <td><a href="https://www.ncbi.nlm.nih.gov/pubmed/16977404.0" target="_blank">16977404.0</a></td> <td><a href="https://doi.org/10.1007/s00281-006-0042-3" target="_blank">10.1007/s00281-006-0042-3</a></td> <td>2sg1tlrg</td> <td>0.409973</td> <td><a href="Topic_07.html#nzuq0dk7">Schwartz_2007</a></td> <td><a href="Topic_12.html#i8xi0h4g">Akahata_2010</a>, <a href="Topic_01.html#3qdjmb2j">Mok_H_2012</a>, <a href="Topic_01.html#vct6xakc">Jiang_2006</a>, <a href="Topic_10.html#ovoli9dr">Keshwara_2019</a></td> </tr> <tr> <th id="zfuglf2e";>31</th> <td>Wyatt_2008</td> <td>Correlation of immunogenicities and in vitro expression levels of recombinant modified vaccinia virus Ankara HIV vaccines</td> <td>Wyatt, Linda S.; Earl, Patricia L.; Vogt, Jennifer; Eller, Leigh Anne; Chandran, Dev; Liu, Jinyan; Robinson, Harriet L.; Moss, Bernard</td> <td>2008</td> <td>2008-01-01</td> <td>PMC</td> <td>N</td> <td><a href="https://www.ncbi.nlm.nih.gov/pmc/articles/PMC2262837" target="_blank">PMC2262837</a></td> <td><a href="https://www.ncbi.nlm.nih.gov/pubmed/18155813.0" target="_blank">18155813.0</a></td> <td><a href="https://doi.org/10.1016/j.vaccine.2007.11.036" target="_blank">10.1016/j.vaccine.2007.11.036</a></td> <td>zfuglf2e</td> <td>0.383510</td> <td><a href="Topic_01.html#vct6xakc">Jiang_2006</a></td> <td><a href="Topic_01.html#8kvs0qw8">Hao_H_2008</a>, <a href="Topic_01.html#d9v2s9o4">Zhang_2011</a></td> </tr> <tr> <th id="axkdf5vu";>32</th> <td>Kim_S_2016</td> <td>Newcastle Disease Virus as a Vaccine Vector for Development of Human and Veterinary Vaccines</td> <td>Kim, Shin-Hee; Samal, Siba K.</td> <td>2016</td> <td>2016-07-04</td> <td>COMM-USE</td> <td>N</td> <td><a href="https://www.ncbi.nlm.nih.gov/pmc/articles/PMC4974518" target="_blank">PMC4974518</a></td> <td><a href="https://www.ncbi.nlm.nih.gov/pubmed/27384578.0" target="_blank">27384578.0</a></td> <td><a href="https://doi.org/10.3390/v8070183" target="_blank">10.3390/v8070183</a></td> <td>axkdf5vu</td> <td>0.383122</td> <td><a href="Topic_07.html#nzuq0dk7">Schwartz_2007</a></td> <td><a href="Topic_10.html#ovoli9dr">Keshwara_2019</a>, <a href="Topic_12.html#i8xi0h4g">Akahata_2010</a></td> </tr> <tr> <th id="1x1bnt5j";>33</th> <td>Huang_2005</td> <td>A differential proteome in tumors suppressed by an adenovirus-based skin patch vaccine encoding human carcinoembryonic antigen</td> <td>Huang, Chun-Ming; Shi, Zhongkai; DeSilva, Tivanka S.; Yamamoto, Masato; Van Kampen, Kent R.; Elmets, Craig A.; Tang, De-chu C.</td> <td>2005</td> <td>2005-03-01</td> <td>PMC</td> <td>N</td> <td><a href="https://www.ncbi.nlm.nih.gov/pmc/articles/PMC3035721" target="_blank">PMC3035721</a></td> <td><a href="https://www.ncbi.nlm.nih.gov/pubmed/15717328.0" target="_blank">15717328.0</a></td> <td><a href="https://doi.org/10.1002/pmic.200401114" target="_blank">10.1002/pmic.200401114</a></td> <td>1x1bnt5j</td> <td>0.381976</td> <td><a href="Topic_01.html#wxf60gww">Hu_M_2007</a>, <a href="Topic_01.html#8kvs0qw8">Hao_H_2008</a></td> <td><a href="Topic_01.html#8kvs0qw8">Hao_H_2008</a></td> </tr> <tr> <th id="vct6xakc";>34</th> <td>Jiang_2006</td> <td>Elicitation of neutralizing antibodies by intranasal administration of recombinant vesicular stomatitis virus expressing human immunodeficiency virus type 1 gp120</td> <td>Jiang, Pengfei; Liu, Yanxia; Yin, Xiaolei; Yuan, Fei; Nie, YuChun; Luo, Min; Aihua, Zheng; Liyin, Du; Ding, Mingxiao; Deng, Hongkui</td> <td>2006</td> <td>2006-01-13</td> <td>PMC</td> <td>N</td> <td><a href="https://www.ncbi.nlm.nih.gov/pmc/articles/PMC7092882" target="_blank">PMC7092882</a></td> <td><a href="https://www.ncbi.nlm.nih.gov/pubmed/16313884.0" target="_blank">16313884.0</a></td> <td><a href="https://doi.org/10.1016/j.bbrc.2005.11.067" target="_blank">10.1016/j.bbrc.2005.11.067</a></td> <td>vct6xakc</td> <td>0.380656</td> <td><a href="Topic_07.html#nzuq0dk7">Schwartz_2007</a></td> <td><a href="Topic_01.html#3qdjmb2j">Mok_H_2012</a>, <a href="Topic_01.html#5hryh1ft">Azizi_2006</a>, <a href="Topic_06.html#2sg1tlrg">Clarke_2006</a></td> </tr> <tr> <th id="u8y47qmd";>35</th> <td>Fedosyuk_2019</td> <td>Simian adenovirus vector production for early-phase clinical trials: A simple method applicable to multiple serotypes and using entirely disposable product-contact components</td> <td>Fedosyuk, Sofiya; Merritt, Thomas; Peralta-Alvarez, Marco Polo; Morris, Susan J; Lam, Ada; Laroudie, Nicolas; Kangokar, Anilkumar; Wright, Daniel; Warimwe, George M; Angell-Manning, Phillip; Ritchie, Adam J; Gilbert, Sarah C; Xenopoulos, Alex; Boumlic, Anissa; Douglas, Alexander D</td> <td>2019</td> <td>2019-11-08</td> <td>None</td> <td>N</td> <td><a href="https://www.ncbi.nlm.nih.gov/pmc/articles/PMC6949866" target="_blank">PMC6949866</a></td> <td><a href="https://www.ncbi.nlm.nih.gov/pubmed/31047679.0" target="_blank">31047679.0</a></td> <td><a href="https://doi.org/10.1016/j.vaccine.2019.04.056" target="_blank">10.1016/j.vaccine.2019.04.056</a></td> <td>u8y47qmd</td> <td>0.375573</td> <td><a href="Topic_02.html#pnl1acrj">Kopecky-Bromberg_2009</a>, <a href="Topic_07.html#neclg3gb">Tripp_2014</a></td> <td><a href="Topic_06.html#v5n1gupw">Bangari_2006</a>, <a href="Topic_02.html#aw8p35c5">Tatsis_2004</a>, <a href="Topic_06.html#489dpefx">Hammond_2005</a></td> </tr> <tr> <th id="hrfbygub";>36</th> <td>Singh_2016</td> <td>Heterologous Immunity between Adenoviruses and Hepatitis C Virus: A New Paradigm in HCV Immunity and Vaccines</td> <td>Singh, Shakti; Vedi, Satish; Samrat, Subodh Kumar; Li, Wen; Kumar, Rakesh; Agrawal, Babita</td> <td>2016</td> <td>2016-01-11</td> <td>COMM-USE</td> <td>N</td> <td><a href="https://www.ncbi.nlm.nih.gov/pmc/articles/PMC4709057" target="_blank">PMC4709057</a></td> <td><a href="https://www.ncbi.nlm.nih.gov/pubmed/26751211.0" target="_blank">26751211.0</a></td> <td><a href="https://doi.org/10.1371/journal.pone.0146404" target="_blank">10.1371/journal.pone.0146404</a></td> <td>hrfbygub</td> <td>0.359073</td> <td><a href="Topic_01.html#z2u5frvq">Montefiori_2007</a></td> <td><a href="Topic_01.html#3qdjmb2j">Mok_H_2012</a>, <a href="Topic_12.html#i8xi0h4g">Akahata_2010</a></td> </tr> <tr> <th id="aw8p35c5";>37</th> <td>Tatsis_2004</td> <td>Adenoviruses as vaccine vectors</td> <td>Tatsis, Nia; Ertl, Hildegund C.J.</td> <td>2004</td> <td>2004-10-31</td> <td>PMC</td> <td>N</td> <td><a href="https://www.ncbi.nlm.nih.gov/pmc/articles/PMC7106330" target="_blank">PMC7106330</a></td> <td><a href="https://www.ncbi.nlm.nih.gov/pubmed/15451446.0" target="_blank">15451446.0</a></td> <td><a href="https://doi.org/10.1016/j.ymthe.2004.07.013" target="_blank">10.1016/j.ymthe.2004.07.013</a></td> <td>aw8p35c5</td> <td>0.354678</td> <td><a href="Topic_01.html#z2u5frvq">Montefiori_2007</a>, <a href="Topic_06.html#v5n1gupw">Bangari_2006</a></td> <td><a href="Topic_06.html#v5n1gupw">Bangari_2006</a>, <a href="Topic_06.html#hrfbygub">Singh_2016</a>, <a href="Topic_02.html#7eqpb7ge">Borovjagin_2014</a>, <a href="Topic_06.html#mxtry60e">Mittal_2016</a></td> </tr> <tr> <th id="489dpefx";>38</th> <td>Hammond_2005</td> <td>Porcine adenovirus as a delivery system for swine vaccines and immunotherapeutics</td> <td>Hammond, Jef M.; Johnson, Michael A.</td> <td>2005</td> <td>2005-01-31</td> <td>PMC</td> <td>N</td> <td><a href="https://www.ncbi.nlm.nih.gov/pmc/articles/PMC7128824" target="_blank">PMC7128824</a></td> <td><a href="https://www.ncbi.nlm.nih.gov/pubmed/15683761.0" target="_blank">15683761.0</a></td> <td><a href="https://doi.org/10.1016/j.tvjl.2003.09.007" target="_blank">10.1016/j.tvjl.2003.09.007</a></td> <td>489dpefx</td> <td>0.345603</td> <td><a href="Topic_06.html#axkdf5vu">Kim_S_2016</a></td> <td></td> </tr> <tr> <th id="v812zn3r";>39</th> <td>Saxena_2013</td> <td>Pre-existing immunity against vaccine vectors – friend or foe?</td> <td>Saxena, Manvendra; Van, Thi Thu Hao; Baird, Fiona J.; Coloe, Peter J.; Smooker, Peter M.</td> <td>2013</td> <td>2013-01-23</td> <td>COMM-USE</td> <td>N</td> <td><a href="https://www.ncbi.nlm.nih.gov/pmc/articles/PMC3542731" target="_blank">PMC3542731</a></td> <td><a href="https://www.ncbi.nlm.nih.gov/pubmed/23175507.0" target="_blank">23175507.0</a></td> <td><a href="https://doi.org/10.1099/mic.0.049601-0" target="_blank">10.1099/mic.0.049601-0</a></td> <td>v812zn3r</td> <td>0.344349</td> <td><a href="Topic_01.html#z2u5frvq">Montefiori_2007</a>, <a href="Topic_07.html#neclg3gb">Tripp_2014</a></td> <td><a href="Topic_02.html#b8mfn6o9">Tarahomjoo_2011</a>, <a href="Topic_06.html#hrfbygub">Singh_2016</a>, <a href="Topic_01.html#2gt3fwpy">Meseda_2016</a></td> </tr> <tr> <th id="de0b27nq";>40</th> <td>Anraku_2008</td> <td>Kunjin replicon-based simian immunodeficiency virus gag vaccines</td> <td>Anraku, Itaru; Mokhonov, Vladislav V.; Rattanasena, Paweena; Mokhonova, Ekaterina I.; Leung, Jason; Pijlman, Gorben; Cara, Andrea; Schroder, Wayne A.; Khromykh, Alexander A.; Suhrbier, Andreas</td> <td>2008</td> <td>2008-06-19</td> <td>PMC</td> <td>N</td> <td><a href="https://www.ncbi.nlm.nih.gov/pmc/articles/PMC7115363" target="_blank">PMC7115363</a></td> <td><a href="https://www.ncbi.nlm.nih.gov/pubmed/18462846.0" target="_blank">18462846.0</a></td> <td><a href="https://doi.org/10.1016/j.vaccine.2008.04.001" target="_blank">10.1016/j.vaccine.2008.04.001</a></td> <td>de0b27nq</td> <td>0.340714</td> <td></td> <td><a href="Topic_09.html#0h5vgi5c">Dahiya_2012</a></td> </tr> <tr> <th id="7del8d2p";>41</th> <td>Callendret_2007</td> <td>Heterologous viral RNA export elements improve expression of severe acute respiratory syndrome (SARS) coronavirus spike protein and protective efficacy of DNA vaccines against SARS</td> <td>Callendret, Benoît; Lorin, Valérie; Charneau, Pierre; Marianneau, Philippe; Contamin, Hugues; Betton, Jean-Michel; van der Werf, Sylvie; Escriou, Nicolas</td> <td>2007</td> <td>2007-07-05</td> <td>PMC</td> <td>N</td> <td><a href="https://www.ncbi.nlm.nih.gov/pmc/articles/PMC7103356" target="_blank">PMC7103356</a></td> <td><a href="https://www.ncbi.nlm.nih.gov/pubmed/17331558.0" target="_blank">17331558.0</a></td> <td><a href="https://doi.org/10.1016/j.virol.2007.01.012" target="_blank">10.1016/j.virol.2007.01.012</a></td> <td>7del8d2p</td> <td>0.328733</td> <td></td> <td><a href="Topic_01.html#mghgvr76">Liu_R_2005</a>, <a href="Topic_01.html#ltyqrg81">Escriou_2014</a></td> </tr> <tr> <th id="dqvgng2s";>42</th> <td>Ohtsuka_2019</td> <td>A versatile platform technology for recombinant vaccines using non-propagative human parainfluenza virus type 2 vector</td> <td>Ohtsuka, Junpei; Fukumura, Masayuki; Furuyama, Wakako; Wang, Shujie; Hara, Kenichiro; Maeda, Mitsuyo; Tsurudome, Masato; Miyamoto, Hiroko; Kaito, Aika; Tsuda, Nobuyuki; Kataoka, Yosky; Mizoguchi, Akira; Takada, Ayato; Nosaka, Tetsuya</td> <td>2019</td> <td>2019-09-09</td> <td>COMM-USE</td> <td>N</td> <td><a href="https://www.ncbi.nlm.nih.gov/pmc/articles/PMC6733870" target="_blank">PMC6733870</a></td> <td><a href="https://www.ncbi.nlm.nih.gov/pubmed/31501502.0" target="_blank">31501502.0</a></td> <td><a href="https://doi.org/10.1038/s41598-019-49579-y" target="_blank">10.1038/s41598-019-49579-y</a></td> <td>dqvgng2s</td> <td>0.328249</td> <td><a href="Topic_01.html#vct6xakc">Jiang_2006</a>, <a href="Topic_07.html#nzuq0dk7">Schwartz_2007</a></td> <td><a href="Topic_01.html#8kvs0qw8">Hao_H_2008</a>, <a href="Topic_04.html#0czzjeop">Chen_2007</a></td> </tr> <tr> <th id="4vkag60z";>43</th> <td>Nakayama_2016</td> <td>Recombinant measles AIK-C vaccine strain expressing heterologous virus antigens</td> <td>Nakayama, Tetsuo; Sawada, Akihito; Yamaji, Yoshiaki; Ito, Takashi</td> <td>2016</td> <td>2016-01-04</td> <td>PMC</td> <td>N</td> <td><a href="https://www.ncbi.nlm.nih.gov/pmc/articles/PMC7115616" target="_blank">PMC7115616</a></td> <td><a href="https://www.ncbi.nlm.nih.gov/pubmed/26562316.0" target="_blank">26562316.0</a></td> <td><a href="https://doi.org/10.1016/j.vaccine.2015.10.127" target="_blank">10.1016/j.vaccine.2015.10.127</a></td> <td>4vkag60z</td> <td>0.325056</td> <td><a href="Topic_07.html#fq78593b">Mooney_2013</a></td> <td><a href="Topic_14.html#ngms51ie">Sawada_2011</a>, <a href="Topic_06.html#cmbg0ty8">Mühlebach_2016</a>, <a href="Topic_01.html#3qdjmb2j">Mok_H_2012</a></td> </tr> <tr> <th id="tjvjlyn9";>44</th> <td>Luke_2010</td> <td>Improved antibiotic-free plasmid vector design by incorporation of transient expression enhancers</td> <td>Luke, J M; Vincent, J M; Du, S X; Gerdemann, U; Leen, A M; Whalen, R G; Hodgson, C P; Williams, J A</td> <td>2010</td> <td>2010-11-25</td> <td>PMC</td> <td>N</td> <td><a href="https://www.ncbi.nlm.nih.gov/pmc/articles/PMC7091570" target="_blank">PMC7091570</a></td> <td><a href="https://www.ncbi.nlm.nih.gov/pubmed/21107439.0" target="_blank">21107439.0</a></td> <td><a href="https://doi.org/10.1038/gt.2010.149" target="_blank">10.1038/gt.2010.149</a></td> <td>tjvjlyn9</td> <td>0.320161</td> <td></td> <td></td> </tr> <tr> <th id="a3nzj6yh";>45</th> <td>Zhang_2016</td> <td>Adenoviral vector-based strategies against infectious disease and cancer</td> <td>Zhang, Chao; Zhou, Dongming</td> <td>2016</td> <td>2016-04-22</td> <td>NONCOMM</td> <td>N</td> <td><a href="https://www.ncbi.nlm.nih.gov/pmc/articles/PMC4994731" target="_blank">PMC4994731</a></td> <td><a href="https://www.ncbi.nlm.nih.gov/pubmed/27105067.0" target="_blank">27105067.0</a></td> <td><a href="https://doi.org/10.1080/21645515.2016.1165908" target="_blank">10.1080/21645515.2016.1165908</a></td> <td>a3nzj6yh</td> <td>0.305064</td> <td><a href="Topic_01.html#z2u5frvq">Montefiori_2007</a>, <a href="Topic_02.html#aw8p35c5">Tatsis_2004</a>, <a href="Topic_07.html#fq78593b">Mooney_2013</a></td> <td><a href="Topic_02.html#aw8p35c5">Tatsis_2004</a>, <a href="Topic_02.html#7eqpb7ge">Borovjagin_2014</a>, <a href="Topic_02.html#odeksech">Ertl_2016</a></td> </tr> <tr> <th id="l3ej1hdk";>46</th> <td>Patel_2010</td> <td>A Porcine Adenovirus with Low Human Seroprevalence Is a Promising Alternative Vaccine Vector to Human Adenovirus 5 in an H5N1 Virus Disease Model</td> <td>Patel, Ami; Tikoo, Suresh; Kobinger, Gary</td> <td>2010</td> <td>2010-12-16</td> <td>COMM-USE</td> <td>N</td> <td><a href="https://www.ncbi.nlm.nih.gov/pmc/articles/PMC3002947" target="_blank">PMC3002947</a></td> <td><a href="https://www.ncbi.nlm.nih.gov/pubmed/21179494.0" target="_blank">21179494.0</a></td> <td><a href="https://doi.org/10.1371/journal.pone.0015301" target="_blank">10.1371/journal.pone.0015301</a></td> <td>l3ej1hdk</td> <td>0.304688</td> <td><a href="Topic_07.html#nzuq0dk7">Schwartz_2007</a></td> <td><a href="Topic_01.html#f78ug0c6">Meng_2012</a>, <a href="Topic_12.html#5zn2vrj5">Warimwe_2013</a>, <a href="Topic_07.html#xdpajuit">Wu_P_2017</a></td> </tr> <tr> <th id="7mi07qm9";>47</th> <td>Hangalapura_2012</td> <td>CD40-targeted adenoviral cancer vaccines: the long and winding road to the clinic</td> <td>Hangalapura, Basav N.; Timares, Laura; Oosterhoff, Dinja; Scheper, Rik J.; Curiel, David T.; de Gruijl, Tanja D.</td> <td>2012</td> <td>2012-06-01</td> <td>PMC</td> <td>N</td> <td><a href="https://www.ncbi.nlm.nih.gov/pmc/articles/PMC3433169" target="_blank">PMC3433169</a></td> <td><a href="https://www.ncbi.nlm.nih.gov/pubmed/22228547.0" target="_blank">22228547.0</a></td> <td><a href="https://doi.org/10.1002/jgm.1648" target="_blank">10.1002/jgm.1648</a></td> <td>7mi07qm9</td> <td>0.304020</td> <td><a href="Topic_01.html#z2u5frvq">Montefiori_2007</a></td> <td><a href="Topic_05.html#tkzwzc57">Garu_2016</a>, <a href="Topic_05.html#ctikde7d">Cervantes-Barragan_2010</a></td> </tr> <tr> <th id="tbp3it7r";>48</th> <td>Liniger_2008</td> <td>Induction of neutralising antibodies and cellular immune responses against SARS coronavirus by recombinant measles viruses</td> <td>Liniger, Matthias; Zuniga, Armando; Tamin, Azaibi; Azzouz-Morin, Teldja N.; Knuchel, Marlyse; Marty, Rene R.; Wiegand, Marian; Weibel, Sara; Kelvin, David; Rota, Paul A.; Naim, Hussein Y.</td> <td>2008</td> <td>2008-04-16</td> <td>PMC</td> <td>N</td> <td><a href="https://www.ncbi.nlm.nih.gov/pmc/articles/PMC7115634" target="_blank">PMC7115634</a></td> <td><a href="https://www.ncbi.nlm.nih.gov/pubmed/18346823.0" target="_blank">18346823.0</a></td> <td><a href="https://doi.org/10.1016/j.vaccine.2008.01.057" target="_blank">10.1016/j.vaccine.2008.01.057</a></td> <td>tbp3it7r</td> <td>0.300148</td> <td><a href="Topic_07.html#nzuq0dk7">Schwartz_2007</a>, <a href="Topic_03.html#k785hl1r">Lv_L_2014</a></td> <td><a href="Topic_01.html#ltyqrg81">Escriou_2014</a></td> </tr> </tbody> </table> </body> </html>
Java
<!DOCTYPE html> <html xmlns:th="http://www.thymeleaf.org" xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout" xmlns:yq="http://www.yqboots.com" xmlns="http://www.w3.org/1999/xhtml" layout:decorator="layouts/layout"> <head> <title th:text="#{FSS0001}">File Management</title> </head> <body> <div layout:fragment="breadcrumbs"> <yq:breadcrumbs menu="FSS"/> </div> <div class="content content-sm height-600" layout:fragment="content"> <div class="container"> <yq:alert level="danger" /> <form class="sky-form" action="#" th:action="@{/fss/}" th:object="${model}" method="post" enctype="multipart/form-data"> <header th:text="#{FSS0012}">FSS Form</header> <fieldset> <section> <label class="label" th:text="#{FSS0013}">Input a File</label> <label class="input input-file"> <div class="button"> <input th:field="*{file}" type="file"/> <span th:text="#{FSS0014}">Browse</span> </div> <input type="text" readonly="readonly"/> </label> <p th:if="${#fields.hasErrors('file')}" th:errors="*{file}"></p> </section> <section> <label class="label" th:text="#{FSS0015}">Destination</label> <label class="select"> <select th:field="*{path}"> <option value="" th:text="#{FSS0016}">Please Select</option> <yq:options name="FSS_AVAILABLE_DIRS"/> </select> <i></i> </label> <p th:if="${#fields.hasErrors('path')}" th:errors="*{path}"></p> </section> <section> <label class="label" th:text="#{FSS0017}">Override</label> <input th:field="*{overrideExisting}" type="checkbox"/> <label th:for="${#ids.prev('overrideExisting')}" th:text="#{FSS0018}">Override Existing?</label> </section> </fieldset> <footer> <button class="btn-u rounded" type="submit" th:text="#{FSS0019}">Submit</button> <button class="btn-u rounded" id="cancel" type="reset" th:text="#{FSS0020}">Reset</button> </footer> </form> </div> </div> </body> </html>
Java
Osprey ====== [![Build Status](https://travis-ci.org/msmbuilder/osprey.svg?branch=master)](https://travis-ci.org/msmbuilder/osprey) [![Coverage Status](https://coveralls.io/repos/github/msmbuilder/osprey/badge.svg?branch=master)](https://coveralls.io/github/msmbuilder/osprey?branch=master) [![PyPi version](https://badge.fury.io/py/osprey.svg)](https://pypi.python.org/pypi/osprey/) [![License](https://img.shields.io/badge/license-ASLv2.0-red.svg?style=flat)](http://www.apache.org/licenses/LICENSE-2.0) [![DOI](http://joss.theoj.org/papers/10.21105/joss.00034/status.svg)](http://dx.doi.org/10.21105/joss.00034) [![Research software impact](http://depsy.org/api/package/pypi/osprey/badge.svg)](http://depsy.org/package/python/osprey) [![Documentation](https://img.shields.io/badge/docs-latest-blue.svg?style=flat)](http://msmbuilder.org/osprey) ![Logo](http://msmbuilder.org/osprey/development/_static/osprey.svg) Osprey is an easy-to-use tool for hyperparameter optimization for machine learning algorithms in python using scikit-learn (or using scikit-learn compatible APIs). Each Osprey experiment combines an dataset, an estimator, a search space (and engine), cross validation and asynchronous serialization for distributed parallel optimization of model hyperparameters. Documentation ------------ For full documentation, please visit the [Osprey homepage](http://msmbuilder.org/osprey/). Installation ------------ If you have an Anaconda Python distribution, installation is as easy as: ``` $ conda install -c omnia osprey ``` You can also install Osprey with `pip`: ``` $ pip install osprey ``` Alternatively, you can install directly from this GitHub repo: ``` $ git clone https://github.com/msmbuilder/osprey.git $ cd osprey && git checkout 1.1.0 $ python setup.py install ``` Example using [MSMBuilder](https://github.com/msmbuilder/msmbuilder) ------------------------------------------------------------- Below is an example of an osprey `config` file to cross validate Markov state models based on varying the number of clusters and dihedral angles used in a model: ```yaml estimator: eval_scope: msmbuilder eval: | Pipeline([ ('featurizer', DihedralFeaturizer(types=['phi', 'psi'])), ('cluster', MiniBatchKMeans()), ('msm', MarkovStateModel(n_timescales=5, verbose=False)), ]) search_space: cluster__n_clusters: min: 10 max: 100 type: int featurizer__types: choices: - ['phi', 'psi'] - ['phi', 'psi', 'chi1'] type: enum cv: 5 dataset_loader: name: mdtraj params: trajectories: ~/local/msmbuilder/Tutorial/XTC/*/*.xtc topology: ~/local/msmbuilder/Tutorial/native.pdb stride: 1 trials: uri: sqlite:///osprey-trials.db ``` Then run `osprey worker`. You can run multiple parallel instances of `osprey worker` simultaneously on a cluster too. ``` $ osprey worker config.yaml ... ---------------------------------------------------------------------- Beginning iteration 1 / 1 ---------------------------------------------------------------------- History contains: 0 trials Choosing next hyperparameters with random... {'cluster__n_clusters': 20, 'featurizer__types': ['phi', 'psi']} Fitting 5 folds for each of 1 candidates, totalling 5 fits [Parallel(n_jobs=1)]: Done 1 jobs | elapsed: 0.3s [Parallel(n_jobs=1)]: Done 5 out of 5 | elapsed: 1.8s finished --------------------------------- Success! Model score = 4.080646 (best score so far = 4.080646) --------------------------------- 1/1 models fit successfully. time: October 27, 2014 10:44 PM elapsed: 4 seconds. osprey worker exiting. ``` You can dump the database to JSON or CSV with `osprey dump`. Dependencies ------------ - `python>=2.7.11` - `six>=1.10.0` - `pyyaml>=3.11` - `numpy>=1.10.4` - `scipy>=0.17.0` - `scikit-learn>=0.17.0` - `sqlalchemy>=1.0.10` - `bokeh>=0.12.0` - `matplotlib>=1.5.0` - `pandas>=0.18.0` - `GPy` (optional, required for `gp` strategy) - `hyperopt` (optional, required for `hyperopt_tpe` strategy) - `nose` (optional, for testing) Contributing ------------ In case you encounter any issues with this package, please consider submitting a ticket to the [GitHub Issue Tracker](https://github.com/msmbuilder/osprey/issues). We also welcome any feature requests and highly encourage users to [submit pull requests](https://help.github.com/articles/creating-a-pull-request/) for bug fixes and improvements. For more detailed information, please refer to our [documentation](http://msmbuilder.org/osprey/development/contributing.html). Citing ------ If you use Osprey in your research, please cite: ```bibtex @misc{osprey, author = {Robert T. McGibbon and Carlos X. Hernández and Matthew P. Harrigan and Steven Kearnes and Mohammad M. Sultan and Stanislaw Jastrzebski and Brooke E. Husic and Vijay S. Pande}, title = {Osprey: Hyperparameter Optimization for Machine Learning}, month = sep, year = 2016, doi = {10.21105/joss.000341}, url = {http://dx.doi.org/10.21105/joss.00034} } ```
Java
import { Component } from '@angular/core'; import { Platform } from 'ionic-angular'; import { InAppBrowser } from '@ionic-native/in-app-browser'; @Component({ selector: 'page-apuntes', templateUrl: 'apuntes.html' }) export class ApuntesPage { constructor(public platform: Platform, private theInAppBrowser: InAppBrowser){} launch() { this.platform.ready().then(() => { this.theInAppBrowser.create("http://apuntes.lafuenteunlp.com.ar", '_self', 'location=yes'); }); } /* ionViewDidLoad() { this.confData.getMap().subscribe((mapData: any) => { let mapEle = this.mapElement.nativeElement; let map = new google.maps.Map(mapEle, { center: mapData.find((d: any) => d.center), zoom: 16 }); mapData.forEach((markerData: any) => { let infoWindow = new google.maps.InfoWindow({ content: `<h5>${markerData.name}</h5>` }); let marker = new google.maps.Marker({ position: markerData, map: map, title: markerData.name }); marker.addListener('click', () => { infoWindow.open(map, marker); }); }); google.maps.event.addListenerOnce(map, 'idle', () => { mapEle.classList.add('show-map'); }); }); } */ }
Java
/*price range*/ $('#sl2').slider(); var RGBChange = function() { $('#RGB').css('background', 'rgb('+r.getValue()+','+g.getValue()+','+b.getValue()+')') }; /*scroll to top*/ $(document).ready(function(){ $(function () { $.scrollUp({ scrollName: 'scrollUp', // Element ID scrollDistance: 300, // Distance from top/bottom before showing element (px) scrollFrom: 'top', // 'top' or 'bottom' scrollSpeed: 300, // Speed back to top (ms) easingType: 'linear', // Scroll to top easing (see http://easings.net/) animation: 'fade', // Fade, slide, none animationSpeed: 200, // Animation in speed (ms) scrollTrigger: false, // Set a custom triggering element. Can be an HTML string or jQuery object //scrollTarget: false, // Set a custom target element for scrolling to the top scrollText: '<i class="fa fa-angle-up"></i>', // Text for element, can contain HTML scrollTitle: false, // Set a custom <a> title if required. scrollImg: false, // Set true to use image activeOverlay: false, // Set CSS color to display scrollUp active point, e.g '#00FFFF' zIndex: 2147483647 // Z-Index for the overlay }); }); }); // Returns a random integer between min and max // Using Math.round() will give you a non-uniform distribution! function getRandomInt(min, max) { return Math.floor(Math.random() * (max - min + 1)) + min; } // Replace url parameter - WishlistItems function replaceUrlParam(url, paramName, paramValue) { var pattern = new RegExp('(' + paramName + '=).*?(&|$)') var newUrl = url if (url.search(pattern) >= 0) { newUrl = url.replace(pattern, '$1' + paramValue + '$2'); } else { newUrl = newUrl + (newUrl.indexOf('?') > 0 ? '&' : '?') + paramName + '=' + paramValue } return newUrl } // Scroll back to selected wishlist item if (window.location.hash != '') { var target = window.location.hash; //var $target = $(target); $('html, body').stop().animate({ //'scrollTop': $target.offset().top }, 900, 'swing', function () { window.location.hash = target; }); }
Java
import sys sys.path.insert(1,"../../../") import h2o from tests import pyunit_utils from h2o.estimators.gbm import H2OGradientBoostingEstimator def mnist_many_cols_gbm_large(): train = h2o.import_file(path=pyunit_utils.locate("bigdata/laptop/mnist/train.csv.gz")) train.tail() gbm_mnist = H2OGradientBoostingEstimator(ntrees=1, max_depth=1, min_rows=10, learn_rate=0.01) gbm_mnist.train(x=range(784), y=784, training_frame=train) gbm_mnist.show() if __name__ == "__main__": pyunit_utils.standalone_test(mnist_many_cols_gbm_large) else: mnist_many_cols_gbm_large()
Java
<?php use Phalcon\DI\FactoryDefault\CLI as CliDI, Phalcon\CLI\Console as ConsoleApp; define('VERSION', '1.0.0'); //使用CLI工厂类作为默认的服务容器 $di = new CliDI(); // 定义应用目录路径 defined('APP_PATH') || define('APP_PATH', realpath(dirname(dirname(__FILE__)))); /** * * 注册类自动加载器 */ $loader = new \Phalcon\Loader(); $loader->registerDirs( array( APP_PATH . '/tasks', APP_PATH . '/apps/models', ) ); $loader->register(); //加载配置文件(如果存在) if(is_readable(APP_PATH . '/config/config.php')) { $config = include APP_PATH . '/config/config.php'; $di->set('config', $config); $di->set('db', function() use ( $config, $di) { //新建一个事件管理器 $eventsManager = new \Phalcon\Events\Manager(); $profiler = new \Phalcon\Db\Profiler(); //监听所有的db事件 $eventsManager->attach('db', function($event, $connection) use ($profiler) { //一条语句查询之前事件,profiler开始记录sql语句 if ($event->getType() == 'beforeQuery') { $profiler->startProfile($connection->getSQLStatement()); } //一条语句查询结束,结束本次记录,记录结果会保存在profiler对象中 if ($event->getType() == 'afterQuery') { $profiler->stopProfile(); } }); $connection = new \Phalcon\Db\Adapter\Pdo\Mysql( [ "host" => $config->database->host, "username" => $config->database->username, "password" => $config->database->password, "dbname" => $config->database->dbname, "charset" => $config->database->charset ] ); //将事件管理器绑定到db实例中 $connection->setEventsManager($eventsManager); return $connection; }); } // 创建console应用 $console = new ConsoleApp(); $console->setDI($di); /** * 处理console应用参数 */ $arguments = array(); foreach($argv as $k => $arg) { if($k == 1) { $arguments['task'] = $arg; } elseif($k == 2) { $arguments['action'] = $arg; } elseif($k >= 3) { $arguments['params'][] = $arg; } } // 定义全局的参数, 设定当前任务及action define('CURRENT_TASK', (isset($argv[1]) ? $argv[1] : null)); define('CURRENT_ACTION', (isset($argv[2]) ? $argv[2] : null)); try { // 处理参数 $console->handle($arguments); } catch (\Phalcon\Exception $e) { echo $e->getMessage(); exit(255); }
Java
# Flagenium petrikense Ruhsam & A.P.Davis SPECIES #### Status ACCEPTED #### According to The Catalogue of Life, 3rd January 2011 #### Published in null #### Original name null ### Remarks null
Java
# Cephaelis dolichophylla Standl. SPECIES #### Status SYNONYM #### According to The Catalogue of Life, 3rd January 2011 #### Published in null #### Original name null ### Remarks null
Java
# Begonia cognata Irmsch. SPECIES #### Status ACCEPTED #### According to International Plant Names Index #### Published in Webbia 9:477. 1953 #### Original name null ### Remarks null
Java
# Siphoneranthemum alatum Kuntze SPECIES #### Status ACCEPTED #### According to International Plant Names Index #### Published in null #### Original name null ### Remarks null
Java
# Plectranthus mysurensis Heyne ex Wall. SPECIES #### Status ACCEPTED #### According to International Plant Names Index #### Published in null #### Original name null ### Remarks null
Java
# Brizopyrum boreale J.Presl SPECIES #### Status SYNONYM #### According to The Catalogue of Life, 3rd January 2011 #### Published in null #### Original name null ### Remarks null
Java
# Ziziphus cinnamomum Triana & Planch. SPECIES #### Status ACCEPTED #### According to International Plant Names Index #### Published in null #### Original name null ### Remarks null
Java
# Aurinia leucadea (Guss.) K. Koch SPECIES #### Status ACCEPTED #### According to The Catalogue of Life, 3rd January 2011 #### Published in null #### Original name Alyssum leucadeum Guss. ### Remarks null
Java
-- create in cinefiles_domain database, cinefiles_denorm schema CREATE OR REPLACE FUNCTION cinefiles_denorm.concat_worktitles (shortid VARCHAR) RETURNS VARCHAR AS $$ DECLARE titlestring VARCHAR(1000); preftitle VARCHAR(500); engltitle VARCHAR(500); prefcount INTEGER; englcount INTEGER; errormsg VARCHAR(500); BEGIN select into prefcount count(*) from works_common wc inner join hierarchy hwc on ( wc.id = hwc.parentid and hwc.primarytype = 'workTermGroup' and hwc.pos = 0) inner join worktermgroup wtg on (hwc.id = wtg.id) where wc.shortidentifier = $1; select into englcount count(*) from works_common wc inner join hierarchy hwc on ( wc.id = hwc.parentid and hwc.primarytype = 'workTermGroup' and hwc.pos > 0) inner join worktermgroup wtg on ( hwc.id = wtg.id and wtg.termlanguage like '%''English''%') where wc.shortidentifier = $1; IF prefcount = 0 THEN return NULL; ELSEIF prefcount > 1 THEN errormsg := 'There can be only one! But there are ' || prefcount::text || ' preferred titles!'; RAISE EXCEPTION '%', errormsg; ELSEIF prefcount = 1 THEN select into preftitle trim(wtg.termdisplayname) from works_common wc inner join hierarchy hwc on ( wc.id = hwc.parentid and hwc.primarytype = 'workTermGroup' and hwc.pos = 0) inner join worktermgroup wtg on (hwc.id = wtg.id) where wc.shortidentifier = $1; IF englcount = 0 THEN titlestring := preftitle; RETURN titlestring; ELSEIF englcount = 1 THEN select into engltitle trim(wtg.termdisplayname) from works_common wc inner join hierarchy hwc on ( wc.id = hwc.parentid and hwc.primarytype = 'workTermGroup' and hwc.pos > 0) inner join worktermgroup wtg on ( hwc.id = wtg.id and wtg.termlanguage like '%''English''%') where wc.shortidentifier = $1; titlestring := preftitle || ' (' || engltitle || ')'; RETURN titlestring; ELSEIF englcount > 1 THEN errormsg := 'There can be only one! But there are ' || englcount::text || ' non-preferred English titles!'; RAISE EXCEPTION '%', errormsg; ELSE errormsg := 'Unable to get a count of non-preferred English titles!'; RAISE EXCEPTION '%', errormsg; END IF; ELSE errormsg := 'Unable to get a count of preferred titles!'; RAISE EXCEPTION '%', errormsg; END IF; RETURN NULL; END; $$ LANGUAGE 'plpgsql' IMMUTABLE RETURNS NULL ON NULL INPUT; GRANT EXECUTE ON FUNCTION cinefiles_denorm.concat_worktitles (filmid VARCHAR) TO PUBLIC;
Java
--- layout: base title: 'Statistics of appos:nmod in UD_French-Spoken' udver: '2' --- ## Treebank Statistics: UD_French-Spoken: Relations: `appos:nmod` This relation is a language-specific subtype of . There are also 1 other language-specific subtypes of `appos`: <tt><a href="fr_spoken-dep-appos-conj.html">appos:conj</a></tt>. 101 nodes (0%) are attached to their parents as `appos:nmod`. 101 instances of `appos:nmod` (100%) are left-to-right (parent precedes child). Average distance between parent and child is 1.06930693069307. The following 4 pairs of parts of speech are connected with `appos:nmod`: <tt><a href="fr_spoken-pos-NOUN.html">NOUN</a></tt>-<tt><a href="fr_spoken-pos-PROPN.html">PROPN</a></tt> (95; 94% instances), <tt><a href="fr_spoken-pos-PROPN.html">PROPN</a></tt>-<tt><a href="fr_spoken-pos-PROPN.html">PROPN</a></tt> (4; 4% instances), <tt><a href="fr_spoken-pos-NOUN.html">NOUN</a></tt>-<tt><a href="fr_spoken-pos-NUM.html">NUM</a></tt> (1; 1% instances), <tt><a href="fr_spoken-pos-PRON.html">PRON</a></tt>-<tt><a href="fr_spoken-pos-PROPN.html">PROPN</a></tt> (1; 1% instances). ~~~ conllu # visual-style 7 bgColor:blue # visual-style 7 fgColor:white # visual-style 6 bgColor:blue # visual-style 6 fgColor:white # visual-style 6 7 appos:nmod color:blue 1 la le DET _ _ 2 det _ _ 2 foire foire NOUN _ _ 0 root _ _ 3 d' de ADP _ _ 4 case _ _ 4 empoigne empoigne NOUN _ _ 2 nmod _ _ 5 au à+le ADP _ _ 6 case _ _ 6 procès procès NOUN _ _ 2 nmod _ _ 7 Colonna Colonna PROPN _ _ 6 appos:nmod _ _ ~~~ ~~~ conllu # visual-style 7 bgColor:blue # visual-style 7 fgColor:white # visual-style 6 bgColor:blue # visual-style 6 fgColor:white # visual-style 6 7 appos:nmod color:blue 1 et et CCONJ _ _ 12 cc _ _ 2 puis puis ADV _ _ 1 fixed _ _ 3 après après ADP _ _ 12 obl:periph _ _ 4 rue rue NOUN _ _ 12 dislocated _ _ 5 du de+le ADP _ _ 6 case _ _ 6 Faubourg Faubourg PROPN _ _ 4 nmod _ _ 7 Saint Saint PROPN _ _ 6 appos:nmod _ _ 8 Antoine Antoine PROPN _ _ 7 flat _ _ 9 c' ce PRON _ _ 12 nsubj _ _ 10 est être AUX _ _ 12 cop _ _ 11 très très ADV _ _ 12 advmod _ _ 12 vivant vivant ADJ _ _ 0 root _ _ ~~~ ~~~ conllu # visual-style 5 bgColor:blue # visual-style 5 fgColor:white # visual-style 2 bgColor:blue # visual-style 2 fgColor:white # visual-style 2 5 appos:nmod color:blue 1 mes son DET _ _ 2 det _ _ 2 parents parent NOUN _ _ 7 nsubj _ _ 3 tous tout ADJ _ _ 5 amod _ _ 4 les le DET _ _ 5 det _ _ 5 deux deux NUM _ _ 2 appos:nmod _ _ 6 ont avoir AUX _ _ 7 aux _ _ 7 vécu vivre VERB _ _ 0 root _ _ 8 à à ADP _ _ 9 case _ _ 9 Paris Paris PROPN _ _ 7 obl:comp _ _ 10 jeunes jeune ADJ _ _ 7 advmod _ _ 11 hein hein INTJ _ _ 10 discourse _ _ ~~~
Java
<!DOCTYPE html> <html lang="en"> <head> <meta http-equiv="refresh" content="0;URL=constant.SDL_SCANCODE_LSHIFT.html"> </head> <body> <p>Redirecting to <a href="constant.SDL_SCANCODE_LSHIFT.html">constant.SDL_SCANCODE_LSHIFT.html</a>...</p> <script>location.replace("constant.SDL_SCANCODE_LSHIFT.html" + location.search + location.hash);</script> </body> </html>
Java
<?php namespace Google\AdsApi\AdWords\v201809\cm; /** * This file was generated from WSDL. DO NOT EDIT. */ class IdErrorReason { const NOT_FOUND = 'NOT_FOUND'; }
Java