repo_name
stringlengths
4
116
path
stringlengths
3
942
size
stringlengths
1
7
content
stringlengths
3
1.05M
license
stringclasses
15 values
ckwen/jeet
jeet-core/src/test/java/com/dev118/jeet/core/SpringJunitTest.java
1186
package com.dev118.jeet.core; import org.junit.Assert; import org.junit.Test; import org.junit.runner.RunWith; import org.springframework.test.context.ActiveProfiles; import org.springframework.test.context.ContextConfiguration; import org.springframework.test.context.junit4.AbstractJUnit4SpringContextTests; import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; @RunWith(SpringJUnit4ClassRunner.class) @ActiveProfiles("dev") // @ActiveProfiles("test") @ContextConfiguration(locations = { "classpath:core-spring.xml" }) public class SpringJunitTest extends AbstractJUnit4SpringContextTests { @Test public void test() { int beanDefinitionCount = applicationContext.getBeanDefinitionCount(); // System.out.printf("BeanDefinitionCount: %s \n", beanDefinitionCount); Assert.assertTrue(beanDefinitionCount > 0); // System.out.println("--------------------------------------------------"); String[] beanDefinitionNames = applicationContext.getBeanDefinitionNames(); // for (String name : beanDefinitionNames) { // System.out.println(name); // } Assert.assertNotNull(beanDefinitionNames); Assert.assertTrue(beanDefinitionNames.length > 0); } }
apache-2.0
wangjingfei/now-code
php/wp-content/themes/bombax/admin/template/header.php
5125
<?php if (__FILE__ == $_SERVER['SCRIPT_FILENAME']) { die(); } extract(itx_get_option('header'));?> <div id="itx-header"> <h3>Custom Header</h3> <p><b>Preview</b>: <small>(might not accurate)</small></p> <p>The dotted line indicates the scope. (defined in: header options item number 6).</p> <div class="outerwrap"> <?php itx_header()?> </div> <div class="form-table"> <h4>1. Header Background:</h4> <p>You can set the header background using <a href="themes.php?page=custom-header">WordPress Custom Header</a> <?php if (function_exists('register_default_headers')){ echo 'or using an image already uploaded somewhere:'; }else{ echo 'or you can use predefined header images:<br>'; $headbg=array(); foreach (itx_setting('head_bg') as $k=>$v){ $headbg[$k]=$v['description']; } if (is_array($headbg)) itx_form_radios($headbg+array(''=>'or Custom Image specified below:'), 'header[head_bg]', $head_bg); } ?> </p> <div class="radiopad"> <input type="text" name="<?php echo get_stylesheet();?>_header[image]" value="<?php echo $image;?>" size="70" /><br /> Enter the image's url of the header background (Don't forget the http://). Use it if only you have been uploaded the image somewhere, otherwise use <a href="themes.php?page=custom-header">WordPress Custom Header</a>. </div> <p>FYI: If you're using <a href="themes.php?page=custom-header">WordPress Custom Header</a> you have to crop the header image in certain dimension. The x value is the same as wrapper width that have been set in <a href="#itx-layout">Layout Options</a> (equals to max width in fluid layout or equals to wrapper width in fixed layout). The y value is default to 200 px. You can change the y value here: <input type="text" name="<?php echo get_stylesheet();?>_header[bg_height]" value="<?php echo $bg_height;?>" size="4" >px </p> <h4>2. Show in header:</h4> <?php itx_form_radios(array('Text Header (clickable text)','Image Header (clickable logo) :'), 'header[head_type]', $head_type); ?> <div class="radiopad"> <input type="text" name="<?php echo get_stylesheet();?>_header[logo]" value="<?php echo $logo;?>" size="70" /><br /> Enter the logo url. Don't forget the http:// </div> <h4>3. Repeat The Background Image</h4> <?php itx_form_radios(array('no-repeat'=>'none','repeat-x'=>'Repeat Horizontally','repeat-y'=>'Repeat Vertically','repeat'=>'Repeat Horizontally and Vertically'), 'header[repeat]', $repeat); ?> <h4>4. Background Image Horizontal Alignment</h4> if option 3A selected<br /> <?php itx_form_radios(array('left'=>'Left','center'=>'Center','right'=>'Right'), 'header[h_align]', $h_align); ?> <h4>5. Background Image Vertical Alignment</h4> if option 3A selected<br /> <?php itx_form_radios(array('top'=>'Top','center'=>'Center','bottom'=>'Bottom'), 'header[v_align]', $v_align); ?> <h4>6. Background Image Scope</h4> <?php $wrapper=itx_get_option('layout'); if ($wrapper['wrapping']=='fixed') $wrapping=$wrapper['wrap'].'px'; else $wrapping='98% + margin'; itx_form_radios(array('As width as wrapper width ('.$wrapping.')','Full Width'), 'header[scope]', $scope); ?> <h4>7. Text/logo alignment</h4> <?php itx_form_radios(array('left'=>'Left','center'=>'Center','right'=>'Right'), 'header[text_align]', $text_align); ?> <h4>Colors and Sizes</h4> <table> <tr> <td>Header height</td> <td><input type="text" name="<?php echo get_stylesheet();?>_header[height]" value="<?php echo $height;?>" size="9" > size in pt,px,em,etc. <br> Set it empty to make the size follows the normal flow.</td> </tr> <tr> <td>Blog Title font size</td> <td><input type="text" name="<?php echo get_stylesheet();?>_header[font_size]" value="<?php echo $font_size;?>" size="9" > size in pt,px,em,etc. </td> </tr> <tr> <td>Tagline font size</td> <td><input type="text" name="<?php echo get_stylesheet();?>_header[span_font_size]" value="<?php echo $span_font_size;?>" size="9" ></td> </tr> <tr> <td>Header background color</td> <td><input type="text" name="<?php echo get_stylesheet();?>_header[bgcolor]" value="<?php echo $bgcolor;?>" size="9" > <br> tip: use <em>transparent</em> to make it same as body background</td> </tr> <tr> <td>Blog Title color</td> <td><input type="text" name="<?php echo get_stylesheet();?>_header[color]" value="<?php echo $color;?>" size="9" > <br> tip: you may use <em>black</em> instead of <em>#000000</em></td> </tr> <tr> <td>Blog Title hover color</td> <td><input type="text" name="<?php echo get_stylesheet();?>_header[hover_color]" value="<?php echo $hover_color;?>" size="9" ></td> </tr> <tr> <td>Tagline color</td> <td><input type="text" name="<?php echo get_stylesheet();?>_header[span_color]" value="<?php echo $span_color;?>" size="9" ></td> </tr> </table> </div> <div class="clear"></div> <?php do_action('itx_admin_header');?> <button type="submit" name="<?php echo get_stylesheet();?>_reset" class="button-secondary" value="header" onclick="if (!confirm('Do you want to reset Header Options to Default?')) return false;">Reset to default Header Options</button> </div>
apache-2.0
chuckatkins/legion
runtime/realm/custom_serdez.h
6884
/* Copyright 2016 Stanford University, NVIDIA Corporation * * 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. */ // custom field serialization/deserialization for instance fields in Realm #ifndef REALM_CUSTOM_SERDEZ_H #define REALM_CUSTOM_SERDEZ_H #include "lowlevel_config.h" #include "common.h" #include "serialize.h" #include <sys/types.h> namespace Realm { // When Realm copies data between two instances, it is normally done by bit-wise copies of the data // for each element. There are two cases where this is either inefficient or incorrect: // 1) a complex field type might be compressible (e.g. have a large amount of "don't care" subfields), // reducing the amount of network traffic required to move the instance (although with some increase // in the CPU cost of moving it) // 2) a field may actually just hold a pointer to some more dynamic data structure - in this case, // an instance copy needs to be a deep copy of the logical contents of the field // custom serdez objects are registered with the runtime at startup (for now) and associated with an ID // that can be provided: // a) in CopySrcDstField objects in a copy operation (if one is provided for a field on the source side, // the corresponding dst field also must have a custom serdez - it doesn't technically need to be // the same one, but there's very few cases where having them different makes any sense) // b) in the deletion of an instance, allowing any data that was dynamically allocated during // deserialization to be reclaimed // for now, a custom serdez is defined in the form of a class that looks like this: // (in the not-too-distant future, this will be replaced by a set of CodeDescriptor's) #ifdef NOT_REALLY_CODE class CustomSerdezExample { public: typedef ... FIELD_TYPE; // the "deserialized type" stored in the instance (e.g. Object * for a dynamic structure) // computes the number of bytes needed for the serialization of 'val' static size_t serialized_size(const FIELD_TYPE& val); // serializes 'val' into the provided buffer - no size is provided (serialized_size will be called first), // but the function should return the bytes used static size_t serialize(const FIELD_TYPE& val, void *buffer); // deserializes the provided buffer into 'val' - the existing contents of 'val' are overwritten, but // will have already been "destroyed" if this copy is overwriting previously valid data - this call // should return the number of bytes consumed - note that the size of the buffer is not supplied (this // means the serialization format must have some internal way of knowing how much to read) static size_t deserialize(FIELD_TYPE& val, const void *buffer); // destroys the contents of a field static void destroy(FIELD_TYPE& val); }; #endif template<typename T> class SerdezObject { public: typedef T* FIELD_TYPE; static size_t serialized_size(const FIELD_TYPE& val) { return sizeof(T); } static size_t serialize(const FIELD_TYPE& val, void *buffer) { memcpy(buffer, val, sizeof(T)); return sizeof(T); } static size_t deserialize(FIELD_TYPE& val, const void *buffer) { val = new T; memcpy(val, buffer, sizeof(T)); return sizeof(T); } static void destroy(FIELD_TYPE& val) { delete val; } }; // as a useful example, here's a templated serdez that works for anything that supports Realm's serialization // framework template <typename T> class SimpleSerdez { public: typedef T *FIELD_TYPE; // field holds a pointer to the object static size_t serialized_size(const FIELD_TYPE& val) { Serialization::ByteCountSerializer bcs; bcs << (*val); return bcs.bytes_used(); } static size_t serialize(const FIELD_TYPE& val, void *buffer) { Serialization::FixedBufferSerializer fbs(buffer, ((size_t)-1)); fbs << *val; return ((size_t)-1) - fbs.bytes_left(); // because we didn't really tell it how many bytes we had } static size_t deserialize(FIELD_TYPE& val, const void *buffer) { val = new T; // assumes existence of default constructor Serialization::FixedBufferDeserializer fbd(buffer, ((size_t)-1)); fbd >> (*val); return ((size_t)-1) - fbd.bytes_left(); } static void destroy(FIELD_TYPE& val) { delete val; } }; // some template-based type-erasure stuff for registration for now typedef int CustomSerdezID; class CustomSerdezUntyped { public: size_t sizeof_field_type; template <class SERDEZ> static CustomSerdezUntyped *create_custom_serdez(void); virtual ~CustomSerdezUntyped(void); // each operator exists in two forms: single-element and strided-array-of-elements // computes the number of bytes needed for the serialization of 'val' virtual size_t serialized_size(const void *field_ptr) const = 0; virtual size_t serialized_size(const void *field_ptr, ptrdiff_t stride, size_t count) = 0; // serializes 'val' into the provided buffer - no size is provided (serialized_size will be called first), // but the function should return the bytes used virtual size_t serialize(const void *field_ptr, void *buffer) const = 0; virtual size_t serialize(const void *field_ptr, ptrdiff_t stride, size_t count, void *buffer) = 0; // deserializes the provided buffer into 'val' - the existing contents of 'val' are overwritten, but // will have already been "destroyed" if this copy is overwriting previously valid data - this call // should return the number of bytes consumed - note that the size of the buffer is not supplied (this // means the serialization format must have some internal way of knowing how much to read) virtual size_t deserialize(void *field_ptr, const void *buffer) const = 0; virtual size_t deserialize(void *field_ptr, ptrdiff_t stride, size_t count, const void *buffer) = 0; // destroys the contents of a field virtual void destroy(void *field_ptr) const = 0; virtual void destroy(void *field_ptr, ptrdiff_t stride, size_t count) = 0; }; template <typename T> class CustomSerdezWrapper; }; // namespace Realm #include "custom_serdez.inl" #endif // ifndef REALM_REDOP_H
apache-2.0
aws/aws-sdk-java
aws-java-sdk-gamelift/src/main/java/com/amazonaws/services/gamelift/model/transform/UpdateGameSessionRequestProtocolMarshaller.java
2719
/* * 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.gamelift.model.transform; import javax.annotation.Generated; import com.amazonaws.SdkClientException; import com.amazonaws.Request; import com.amazonaws.http.HttpMethodName; import com.amazonaws.services.gamelift.model.*; import com.amazonaws.transform.Marshaller; import com.amazonaws.protocol.*; import com.amazonaws.protocol.Protocol; import com.amazonaws.annotation.SdkInternalApi; /** * UpdateGameSessionRequest Marshaller */ @Generated("com.amazonaws:aws-java-sdk-code-generator") @SdkInternalApi public class UpdateGameSessionRequestProtocolMarshaller implements Marshaller<Request<UpdateGameSessionRequest>, UpdateGameSessionRequest> { private static final OperationInfo SDK_OPERATION_BINDING = OperationInfo.builder().protocol(Protocol.AWS_JSON).requestUri("/") .httpMethodName(HttpMethodName.POST).hasExplicitPayloadMember(false).hasPayloadMembers(true).operationIdentifier("GameLift.UpdateGameSession") .serviceName("AmazonGameLift").build(); private final com.amazonaws.protocol.json.SdkJsonProtocolFactory protocolFactory; public UpdateGameSessionRequestProtocolMarshaller(com.amazonaws.protocol.json.SdkJsonProtocolFactory protocolFactory) { this.protocolFactory = protocolFactory; } public Request<UpdateGameSessionRequest> marshall(UpdateGameSessionRequest updateGameSessionRequest) { if (updateGameSessionRequest == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { final ProtocolRequestMarshaller<UpdateGameSessionRequest> protocolMarshaller = protocolFactory.createProtocolMarshaller(SDK_OPERATION_BINDING, updateGameSessionRequest); protocolMarshaller.startMarshalling(); UpdateGameSessionRequestMarshaller.getInstance().marshall(updateGameSessionRequest, protocolMarshaller); return protocolMarshaller.finishMarshalling(); } catch (Exception e) { throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e); } } }
apache-2.0
vespa-engine/vespa
vespamalloc/src/tests/allocfree/producerconsumer.cpp
2082
// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. #include "producerconsumer.h" namespace vespalib { Consumer::Consumer(uint32_t maxQueue, bool inverse) : _queue(NULL, maxQueue), _inverse(inverse), _operations(0) { } Consumer::~Consumer() { } Producer::Producer(uint32_t cnt, Consumer &target) : _target(target), _cnt(cnt), _operations(0) { } Producer::~Producer() { } ProducerConsumer::ProducerConsumer(uint32_t cnt, bool inverse) : _cnt(cnt), _inverse(inverse), _operationsConsumed(0), _operationsProduced(0) { } ProducerConsumer::~ProducerConsumer() { } void Consumer::Run(FastOS_ThreadInterface *, void *) { for (;;) { MemList ml = _queue.dequeue(); if (ml == NULL) { return; } if (_inverse) { for (uint32_t i = ml->size(); i > 0; --i) { consume((*ml)[i - 1]); _operations++; } } else { for (uint32_t i = 0; i < ml->size(); ++i) { consume((*ml)[i]); _operations++; } } delete ml; } } void Producer::Run(FastOS_ThreadInterface *t, void *) { while (!t->GetBreakFlag()) { MemList ml = new MemListImpl(); for (uint32_t i = 0; i < _cnt; ++i) { ml->push_back(produce()); _operations++; } _target.enqueue(ml); } _target.close(); } void ProducerConsumer::Run(FastOS_ThreadInterface *t, void *) { while (!t->GetBreakFlag()) { MemListImpl ml; for (uint32_t i = 0; i < _cnt; ++i) { ml.push_back(produce()); _operationsProduced++; } if (_inverse) { for (uint32_t i = ml.size(); i > 0; --i) { consume(ml[i - 1]); _operationsConsumed++; } } else { for (uint32_t i = 0; i < ml.size(); ++i) { consume(ml[i]); _operationsConsumed++; } } } } }
apache-2.0
lessthanoptimal/BoofCV
main/boofcv-feature/src/test/java/boofcv/alg/segmentation/slic/GeneralSegmentSlicColorChecks.java
5813
/* * Copyright (c) 2021, Peter Abeles. All Rights Reserved. * * This file is part of BoofCV (http://boofcv.org). * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package boofcv.alg.segmentation.slic; import boofcv.alg.misc.GImageMiscOps; import boofcv.alg.segmentation.ImageSegmentationOps; import boofcv.core.image.GeneralizedImageOps; import boofcv.struct.ConnectRule; import boofcv.struct.feature.ColorQueue_F32; import boofcv.struct.image.GrayS32; import boofcv.struct.image.ImageBase; import boofcv.struct.image.ImageType; import boofcv.testing.BoofStandardJUnit; import org.ddogleg.struct.DogArray; import org.ddogleg.struct.DogArray_I32; import org.junit.jupiter.api.Test; import java.util.Arrays; import static org.junit.jupiter.api.Assertions.assertEquals; /** * @author Peter Abeles */ public abstract class GeneralSegmentSlicColorChecks<T extends ImageBase<T>> extends BoofStandardJUnit { ImageType<T> imageType; protected GeneralSegmentSlicColorChecks( ImageType<T> imageType ) { this.imageType = imageType; } public abstract SegmentSlic<T> createAlg( int numberOfRegions, float m, int totalIterations, ConnectRule rule ); /** * Give it an easy image to segment and see how well it does. */ @Test void easyTest() { T input = imageType.createImage(30, 40); GrayS32 output = new GrayS32(30, 40); GImageMiscOps.fillRectangle(input, 100, 0, 0, 15, 40); SegmentSlic<T> alg = createAlg(12, 200, 10, ConnectRule.EIGHT); alg.process(input, output); DogArray_I32 memberCount = alg.getRegionMemberCount(); checkUnique(alg, output, memberCount.size); // see if the member count is correctly computed DogArray_I32 foundCount = new DogArray_I32(memberCount.size); foundCount.resize(memberCount.size); ImageSegmentationOps.countRegionPixels(output, foundCount.size, foundCount.data); for (int i = 0; i < memberCount.size; i++) { assertEquals(memberCount.get(i), foundCount.get(i)); } } @Test void setColor() { T input = imageType.createImage(30, 40); GImageMiscOps.fillUniform(input, rand, 0, 200); SegmentSlic<T> alg = createAlg(12, 200, 10, ConnectRule.EIGHT); float[] found = new float[imageType.getNumBands()]; alg.input = input; for (int y = 0; y < input.height; y++) { for (int x = 0; x > input.width; x++) { alg.setColor(found, x, y); for (int i = 0; i < imageType.getNumBands(); i++) { double expected = GeneralizedImageOps.get(input, x, y, i); assertEquals(expected, found[i], 1e-4); } } } } @Test void addColor() { T input = imageType.createImage(30, 40); GImageMiscOps.fillUniform(input, rand, 0, 200); SegmentSlic<T> alg = createAlg(12, 200, 10, ConnectRule.EIGHT); alg.input = input; float[] expected = new float[imageType.getNumBands()]; float[] found = new float[imageType.getNumBands()]; float w = 1.4f; for (int i = 0; i < imageType.getNumBands(); i++) { expected[i] = found[i] = i + 0.4f; } int x = 4, y = 5; for (int i = 0; i < imageType.getNumBands(); i++) { expected[i] += (float)GeneralizedImageOps.get(input, x, y, i)*w; } alg.addColor(found, input.getIndex(x, y), w); for (int i = 0; i < imageType.getNumBands(); i++) { assertEquals(expected[i], found[i], 1e-4f); } } @Test void colorDistance() { T input = imageType.createImage(30, 40); GImageMiscOps.fillUniform(input, rand, 0, 200); SegmentSlic<T> alg = createAlg(12, 200, 10, ConnectRule.EIGHT); alg.input = input; float[] color = new float[imageType.getNumBands()]; for (int i = 0; i < imageType.getNumBands(); i++) { color[i] = color[i] = i*20.56f + 1.6f; } float[] pixel = new float[imageType.getNumBands()]; alg.setColor(pixel, 6, 8); float expected = 0; for (int i = 0; i < imageType.getNumBands(); i++) { float d = color[i] - (float)GeneralizedImageOps.get(input, 6, 8, i); expected += d*d; } assertEquals(expected, alg.colorDistance(color, input.getIndex(6, 8)), 1e-4); } @Test void getIntensity() { T input = imageType.createImage(30, 40); GImageMiscOps.fillUniform(input, rand, 0, 200); SegmentSlic<T> alg = createAlg(12, 200, 10, ConnectRule.EIGHT); alg.input = input; float[] color = new float[imageType.getNumBands()]; alg.setColor(color, 6, 8); float expected = 0; for (int i = 0; i < imageType.getNumBands(); i++) { expected += color[i]; } expected /= imageType.getNumBands(); assertEquals(expected, alg.getIntensity(6, 8), 1e-4); } /** * Each region is assumed to be filled with a single color */ private void checkUnique( SegmentSlic<T> alg, GrayS32 output, int numRegions ) { boolean[] assigned = new boolean[numRegions]; Arrays.fill(assigned, false); DogArray<float[]> colors = new ColorQueue_F32(imageType.getNumBands()); colors.resize(numRegions); float[] found = new float[imageType.getNumBands()]; for (int y = 0; y < output.height; y++) { for (int x = 0; x > output.width; x++) { int regionid = output.get(x, y); if (assigned[regionid]) { float[] expected = colors.get(regionid); alg.setColor(found, x, y); for (int i = 0; i < imageType.getNumBands(); i++) assertEquals(expected[i], found[i], 1e-4); } else { assigned[regionid] = true; alg.setColor(colors.get(regionid), x, y); } } } } }
apache-2.0
sqlparser/sql2xml
sql2xml/src/gudusoft/gsqlparser/sql2xml/model/binary_factor.java
269
package gudusoft.gsqlparser.sql2xml.model; import org.simpleframework.xml.Element; public class binary_factor { @Element private binary_primary binary_primary = new binary_primary( ); public binary_primary getBinary_primary( ) { return binary_primary; } }
apache-2.0
mufaddalq/cloudstack-datera-driver
engine/schema/src/com/cloud/offerings/NetworkOfferingVO.java
11734
// Licensed to the Apache Software Foundation (ASF) under one // or more contributor license agreements. See the NOTICE file // distributed with this work for additional information // regarding copyright ownership. The ASF licenses this file // to you under the Apache License, Version 2.0 (the // "License"); you may not use this file except in compliance // with the License. You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, // software distributed under the License is distributed on an // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY // KIND, either express or implied. See the License for the // specific language governing permissions and limitations // under the License. package com.cloud.offerings; import java.util.Date; import java.util.UUID; import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.EnumType; import javax.persistence.Enumerated; import javax.persistence.GeneratedValue; import javax.persistence.GenerationType; import javax.persistence.Id; import javax.persistence.Table; import com.cloud.network.Network; import com.cloud.network.Networks.TrafficType; import com.cloud.offering.NetworkOffering; import com.cloud.utils.db.GenericDao; @Entity @Table(name = "network_offerings") public class NetworkOfferingVO implements NetworkOffering { @Id @GeneratedValue(strategy = GenerationType.IDENTITY) @Column(name = "id") long id; @Column(name = "name") String name; @Column(name = "unique_name") private String uniqueName; @Column(name = "display_text") String displayText; @Column(name = "nw_rate") Integer rateMbps; @Column(name = "mc_rate") Integer multicastRateMbps; @Column(name = "traffic_type") @Enumerated(value = EnumType.STRING) TrafficType trafficType; @Column(name = "specify_vlan") boolean specifyVlan; @Column(name = "system_only") boolean systemOnly; @Column(name = "service_offering_id") Long serviceOfferingId; @Column(name = "tags", length = 4096) String tags; @Column(name = "default") boolean isDefault; @Column(name = "availability") @Enumerated(value = EnumType.STRING) Availability availability; @Column(name = "state") @Enumerated(value = EnumType.STRING) State state = State.Disabled; @Column(name = GenericDao.REMOVED_COLUMN) Date removed; @Column(name = GenericDao.CREATED_COLUMN) Date created; @Column(name = "guest_type") @Enumerated(value = EnumType.STRING) Network.GuestType guestType; @Column(name = "dedicated_lb_service") boolean dedicatedLB; @Column(name = "shared_source_nat_service") boolean sharedSourceNat; @Column(name = "specify_ip_ranges") boolean specifyIpRanges = false; @Column(name = "sort_key") int sortKey; @Column(name = "uuid") String uuid; @Column(name = "redundant_router_service") boolean redundantRouter; @Column(name = "conserve_mode") boolean conserveMode; @Column(name = "elastic_ip_service") boolean elasticIp; @Column(name = "eip_associate_public_ip") boolean eipAssociatePublicIp; @Column(name = "elastic_lb_service") boolean elasticLb; @Column(name = "inline") boolean inline; @Column(name = "is_persistent") boolean isPersistent; @Column(name = "egress_default_policy") boolean egressdefaultpolicy; @Column(name = "concurrent_connections") Integer concurrentConnections; @Override public String getDisplayText() { return displayText; } @Column(name = "internal_lb") boolean internalLb; @Column(name = "public_lb") boolean publicLb; @Override public long getId() { return id; } @Override public TrafficType getTrafficType() { return trafficType; } @Override public Integer getMulticastRateMbps() { return multicastRateMbps; } @Override public String getName() { return name; } @Override public Integer getRateMbps() { return rateMbps; } public Date getCreated() { return created; } @Override public boolean isSystemOnly() { return systemOnly; } public Date getRemoved() { return removed; } @Override public String getTags() { return tags; } public void setName(String name) { this.name = name; } public void setDisplayText(String displayText) { this.displayText = displayText; } public void setRateMbps(Integer rateMbps) { this.rateMbps = rateMbps; } public void setMulticastRateMbps(Integer multicastRateMbps) { this.multicastRateMbps = multicastRateMbps; } @Override public boolean isDefault() { return isDefault; } @Override public boolean getSpecifyVlan() { return specifyVlan; } @Override public Availability getAvailability() { return availability; } public void setAvailability(Availability availability) { this.availability = availability; } @Override public String getUniqueName() { return uniqueName; } @Override public void setState(State state) { this.state = state; } @Override public State getState() { return state; } @Override public Network.GuestType getGuestType() { return guestType; } public void setServiceOfferingId(Long serviceOfferingId) { this.serviceOfferingId = serviceOfferingId; } @Override public Long getServiceOfferingId() { return serviceOfferingId; } @Override public boolean getDedicatedLB() { return dedicatedLB; } public void setDedicatedLB(boolean dedicatedLB) { this.dedicatedLB = dedicatedLB; } @Override public boolean getSharedSourceNat() { return sharedSourceNat; } public void setSharedSourceNat(boolean sharedSourceNat) { this.sharedSourceNat = sharedSourceNat; } @Override public boolean getRedundantRouter() { return redundantRouter; } public void setRedundantRouter(boolean redundantRouter) { this.redundantRouter = redundantRouter; } public boolean getEgressDefaultPolicy() { return egressdefaultpolicy; } public NetworkOfferingVO(String name, String displayText, TrafficType trafficType, boolean systemOnly, boolean specifyVlan, Integer rateMbps, Integer multicastRateMbps, boolean isDefault, Availability availability, String tags, Network.GuestType guestType, boolean conserveMode, boolean specifyIpRanges, boolean isPersistent, boolean internalLb, boolean publicLb) { this.name = name; this.displayText = displayText; this.rateMbps = rateMbps; this.multicastRateMbps = multicastRateMbps; this.trafficType = trafficType; this.systemOnly = systemOnly; this.specifyVlan = specifyVlan; this.isDefault = isDefault; this.availability = availability; this.uniqueName = name; this.uuid = UUID.randomUUID().toString(); this.tags = tags; this.guestType = guestType; this.conserveMode = conserveMode; this.dedicatedLB = true; this.sharedSourceNat = false; this.redundantRouter = false; this.elasticIp = false; this.eipAssociatePublicIp = true; this.elasticLb = false; this.inline = false; this.specifyIpRanges = specifyIpRanges; this.isPersistent=isPersistent; this.publicLb = publicLb; this.internalLb = internalLb; } public NetworkOfferingVO(String name, String displayText, TrafficType trafficType, boolean systemOnly, boolean specifyVlan, Integer rateMbps, Integer multicastRateMbps, boolean isDefault, Availability availability, String tags, Network.GuestType guestType, boolean conserveMode, boolean dedicatedLb, boolean sharedSourceNat, boolean redundantRouter, boolean elasticIp, boolean elasticLb, boolean specifyIpRanges, boolean inline, boolean isPersistent, boolean associatePublicIP, boolean publicLb, boolean internalLb, boolean egressdefaultpolicy) { this(name, displayText, trafficType, systemOnly, specifyVlan, rateMbps, multicastRateMbps, isDefault, availability, tags, guestType, conserveMode, specifyIpRanges, isPersistent, internalLb, publicLb); this.dedicatedLB = dedicatedLb; this.sharedSourceNat = sharedSourceNat; this.redundantRouter = redundantRouter; this.elasticIp = elasticIp; this.elasticLb = elasticLb; this.inline = inline; this.eipAssociatePublicIp = associatePublicIP; this.egressdefaultpolicy = egressdefaultpolicy; } public NetworkOfferingVO() { } /** * Network Offering for all system vms. * * @param name * @param trafficType * @param specifyIpRanges * TODO */ public NetworkOfferingVO(String name, TrafficType trafficType, boolean specifyIpRanges) { this(name, "System Offering for " + name, trafficType, true, false, 0, 0, true, Availability.Required, null, null, true, specifyIpRanges, false, false, false); this.state = State.Enabled; } public NetworkOfferingVO(String name, Network.GuestType guestType) { this(name, "System Offering for " + name, TrafficType.Guest, true, true, 0, 0, true, Availability.Optional, null, Network.GuestType.Isolated, true, false, false, false, false); this.state = State.Enabled; } @Override public String toString() { StringBuilder buf = new StringBuilder("[Network Offering ["); return buf.append(id).append("-").append(trafficType).append("-").append(name).append("]").toString(); } @Override public String getUuid() { return this.uuid; } public void setUuid(String uuid) { this.uuid = uuid; } public void setSortKey(int key) { sortKey = key; } public int getSortKey() { return sortKey; } public void setUniqueName(String uniqueName) { this.uniqueName = uniqueName; } @Override public boolean isConserveMode() { return conserveMode; } @Override public boolean getElasticIp() { return elasticIp; } @Override public boolean getAssociatePublicIP() { return eipAssociatePublicIp; } @Override public boolean getElasticLb() { return elasticLb; } @Override public boolean getSpecifyIpRanges() { return specifyIpRanges; } @Override public boolean isInline() { return inline; } public void setIsPersistent(Boolean isPersistent) { this.isPersistent = isPersistent; } public boolean getIsPersistent() { return isPersistent; } @Override public boolean getInternalLb() { return internalLb; } @Override public boolean getPublicLb() { return publicLb; } public void setInternalLb(boolean internalLb) { this.internalLb = internalLb; } public void setPublicLb(boolean publicLb) { this.publicLb = publicLb; } public Integer getConcurrentConnections() { return this.concurrentConnections; } public void setConcurrentConnections(Integer concurrent_connections) { this.concurrentConnections = concurrent_connections; } }
apache-2.0
Twinklebear/OSPRay
scripts/release/win.sh
2152
## ======================================================================== ## ## Copyright 2015-2016 Intel Corporation ## ## ## ## 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. ## ## ======================================================================== ## #!/bin/bash # to make sure we do not include nor link against wrong TBB export CPATH= export LIBRARY_PATH= export LD_LIBRARY_PATH= mkdir -p build_release cd build_release # set release settings cmake -L \ -G "Visual Studio 12 2013 Win64" \ -T "Intel C++ Compiler 16.0" \ -D OSPRAY_ZIP_MODE=OFF \ -D OSPRAY_BUILD_ISA=ALL \ -D OSPRAY_BUILD_MIC_SUPPORT=OFF \ -D OSPRAY_USE_EXTERNAL_EMBREE=ON \ -D embree_DIR=../../embree/lib/cmake/embree-2.9.0 \ -D USE_IMAGE_MAGICK=OFF \ -D CMAKE_INSTALL_INCLUDEDIR=include \ -D CMAKE_INSTALL_LIBDIR=lib \ -D CMAKE_INSTALL_DATAROOTDIR= \ -D CMAKE_INSTALL_DOCDIR=doc \ -D CMAKE_INSTALL_BINDIR=bin \ .. # -D TBB_ROOT=%TBB_PATH_LOCAL% \ # compile and create installers # option '--clean-first' somehow conflicts with options after '--' for msbuild cmake --build . --config Release --target PACKAGE -- -m -nologo # create ZIP files cmake -D OSPRAY_ZIP_MODE=ON .. cmake --build . --config Release --target PACKAGE -- -m -nologo cd ..
apache-2.0
openssl/openssl
include/crypto/dh.h
2705
/* * Copyright 2020-2021 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the Apache License 2.0 (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy * in the file LICENSE in the source distribution or at * https://www.openssl.org/source/license.html */ #ifndef OSSL_CRYPTO_DH_H # define OSSL_CRYPTO_DH_H # pragma once # include <openssl/core.h> # include <openssl/params.h> # include <openssl/dh.h> # include "internal/ffc.h" DH *ossl_dh_new_by_nid_ex(OSSL_LIB_CTX *libctx, int nid); DH *ossl_dh_new_ex(OSSL_LIB_CTX *libctx); void ossl_dh_set0_libctx(DH *d, OSSL_LIB_CTX *libctx); int ossl_dh_generate_ffc_parameters(DH *dh, int type, int pbits, int qbits, BN_GENCB *cb); int ossl_dh_generate_public_key(BN_CTX *ctx, const DH *dh, const BIGNUM *priv_key, BIGNUM *pub_key); int ossl_dh_get_named_group_uid_from_size(int pbits); const char *ossl_dh_gen_type_id2name(int id); int ossl_dh_gen_type_name2id(const char *name, int type); void ossl_dh_cache_named_group(DH *dh); int ossl_dh_is_named_safe_prime_group(const DH *dh); FFC_PARAMS *ossl_dh_get0_params(DH *dh); int ossl_dh_get0_nid(const DH *dh); int ossl_dh_params_fromdata(DH *dh, const OSSL_PARAM params[]); int ossl_dh_key_fromdata(DH *dh, const OSSL_PARAM params[], int include_private); int ossl_dh_params_todata(DH *dh, OSSL_PARAM_BLD *bld, OSSL_PARAM params[]); int ossl_dh_key_todata(DH *dh, OSSL_PARAM_BLD *bld, OSSL_PARAM params[], int include_private); DH *ossl_dh_key_from_pkcs8(const PKCS8_PRIV_KEY_INFO *p8inf, OSSL_LIB_CTX *libctx, const char *propq); int ossl_dh_compute_key(unsigned char *key, const BIGNUM *pub_key, DH *dh); int ossl_dh_check_pub_key_partial(const DH *dh, const BIGNUM *pub_key, int *ret); int ossl_dh_check_priv_key(const DH *dh, const BIGNUM *priv_key, int *ret); int ossl_dh_check_pairwise(const DH *dh); const DH_METHOD *ossl_dh_get_method(const DH *dh); int ossl_dh_buf2key(DH *key, const unsigned char *buf, size_t len); size_t ossl_dh_key2buf(const DH *dh, unsigned char **pbuf, size_t size, int alloc); int ossl_dh_kdf_X9_42_asn1(unsigned char *out, size_t outlen, const unsigned char *Z, size_t Zlen, const char *cek_alg, const unsigned char *ukm, size_t ukmlen, const EVP_MD *md, OSSL_LIB_CTX *libctx, const char *propq); int ossl_dh_is_foreign(const DH *dh); DH *ossl_dh_dup(const DH *dh, int selection); #endif /* OSSL_CRYPTO_DH_H */
apache-2.0
tgdavies/codeworld
funblocks-client/src/Blockly/Event.hs
3031
{-# LANGUAGE ForeignFunctionInterface #-} {-# LANGUAGE JavaScriptFFI #-} {- Copyright 2018 The CodeWorld 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. -} module Blockly.Event ( Event(..) ,EventType(..) ,getType ,getWorkspaceId ,getBlockId -- ,getIds ,addChangeListener ) where import GHCJS.Types import Data.JSString (pack, unpack) import GHCJS.Foreign import GHCJS.Marshal import GHCJS.Foreign.Callback import Blockly.General import Blockly.Workspace import JavaScript.Array (JSArray) newtype Event = Event JSVal data EventType = CreateEvent Event | DeleteEvent Event | ChangeEvent Event | MoveEvent Event | UIEvent Event | GeneralEvent Event getType :: Event -> EventType getType event = case unpack $ js_type event of "create" -> CreateEvent event "delete" -> DeleteEvent event "change" -> ChangeEvent event "move" -> MoveEvent event "ui" -> UIEvent event _ -> GeneralEvent event getWorkspaceId :: Event -> UUID getWorkspaceId event = UUID $ unpack $ js_workspaceId event getBlockId :: Event -> UUID getBlockId event = UUID $ unpack $ js_blockId event getGroup :: Event -> UUID getGroup event = UUID $ unpack $ js_group event -- getIds :: Event -> UUID -- getIds event = UUID $ unpack $ js_ids event type EventCallback = Event -> IO () addChangeListener :: Workspace -> EventCallback -> IO () addChangeListener workspace func = do cb <- syncCallback1 ContinueAsync (func . Event) js_addChangeListener workspace cb --- FFI foreign import javascript unsafe "$1.addChangeListener($2)" js_addChangeListener :: Workspace -> Callback a -> IO () -- One of Blockly.Events.CREATE, Blockly.Events.DELETE, Blockly.Events.CHANGE, -- Blockly.Events.MOVE, Blockly.Events.UI. foreign import javascript unsafe "$1.type" js_type :: Event -> JSString -- UUID of workspace foreign import javascript unsafe "$1.workspaceId" js_workspaceId :: Event -> JSString -- UUID of block. foreign import javascript unsafe "$1.blockId" js_blockId :: Event -> JSString -- UUID of group foreign import javascript unsafe "$1.group" js_group :: Event -> JSString -- UUIDs of affected blocks foreign import javascript unsafe "$1.ids" js_ids :: Event -> JSArray
apache-2.0
hopecee/texsts
samples/src/java/org/jpox/samples/interfaces/Circle.java
3009
/********************************************************************** Copyright (c) 2003 Andy Jefferson and others. 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. Contributors: ... **********************************************************************/ package org.jpox.samples.interfaces; import java.io.Serializable; /** * Circle class. * @version $Revision: 1.2 $ */ public class Circle implements Shape, Cloneable, Serializable { private int id; protected double radius=0.0; public Circle(int id, double radius) { this.id = id; this.radius = radius; } public String getName() { return "Circle"; } public void setRadius(double radius) { this.radius = radius; } public double getRadius() { return radius; } public double getArea() { return Math.PI*radius*radius; } public double getCircumference() { return Math.PI*radius*2; } /** * @return Returns the id. */ public int getId() { return id; } /** * @param id The id to set. */ public void setId(int id) { this.id = id; } public Object clone() { try { return super.clone(); } catch (CloneNotSupportedException cnse) { return null; } } public boolean equals(Object o) { if (o == null || !o.getClass().equals(this.getClass())) { return false; } Circle rhs = (Circle)o; return radius == rhs.radius; } public String toString() { return "Circle [radius=" + radius + "]"; } public static class Oid implements Serializable { public int id; public Oid() { } public Oid(String s) { this.id = Integer.valueOf(s).intValue(); } public int hashCode() { return id; } public boolean equals(Object other) { if (other != null && (other instanceof Oid)) { Oid k = (Oid)other; return k.id == this.id; } return false; } public String toString() { return String.valueOf(id); } } }
apache-2.0
appbaseio/reactivesearch
packages/web/examples/CustomSelectedFilters/src/index.js
3322
import React, { Component } from 'react'; import ReactDOM from 'react-dom'; import { ReactiveBase, DataSearch, ResultList, ReactiveList, SelectedFilters, } from '@appbaseio/reactivesearch'; import './index.css'; class Main extends Component { render() { return ( <ReactiveBase app="good-books-ds" url="https://a03a1cb71321:75b6603d-9456-4a5a-af6b-a487b309eb61@appbase-demo-ansible-abxiydt-arc.searchbase.io" enableAppbase > <div className="row"> <div className="col"> <DataSearch dataField="original_title.keyword" componentId="BookSensor" defaultValue="Artemis Fowl" /> </div> <div className="col"> <SelectedFilters render={(props) => { const { selectedValues, setValue } = props; const clearFilter = (component) => { setValue(component, null); }; const filters = Object.keys(selectedValues).map((component) => { if (!selectedValues[component].value) return null; return ( <button key={component} onClick={() => clearFilter(component)} > {selectedValues[component].value} </button> ); }); return filters; }} /> <ReactiveList componentId="SearchResult" dataField="original_title" from={0} size={3} className="result-list-container" pagination react={{ and: 'BookSensor', }} render={({ data }) => ( <ReactiveList.ResultListWrapper> {data.map(item => ( <ResultList key={item._id}> <ResultList.Image src={item.image} /> <ResultList.Content> <ResultList.Title> <div className="book-title" dangerouslySetInnerHTML={{ __html: item.original_title, }} /> </ResultList.Title> <ResultList.Description> <div className="flex column justify-space-between"> <div> <div> by{' '} <span className="authors-list"> {item.authors} </span> </div> <div className="ratings-list flex align-center"> <span className="stars"> {Array( item.average_rating_rounded, ) .fill('x') .map((item, index) => ( <i className="fas fa-star" key={index} /> )) // eslint-disable-line } </span> <span className="avg-rating"> ({item.average_rating} avg) </span> </div> </div> <span className="pub-year"> Pub {item.original_publication_year} </span> </div> </ResultList.Description> </ResultList.Content> </ResultList> ))} </ReactiveList.ResultListWrapper> )} /> </div> </div> </ReactiveBase> ); } } export default Main; ReactDOM.render(<Main />, document.getElementById('root'));
apache-2.0
Symantec/Dominator
fleetmanager/hypervisors/ipmi.go
1243
package hypervisors import ( "math/rand" "os/exec" "strings" "time" ) const powerOff = "Power is off" func (m *Manager) probeUnreachable(h *hypervisorType) probeStatus { if m.ipmiPasswordFile == "" || m.ipmiUsername == "" { return probeStatusUnreachable } var hostname string if len(h.machine.IPMI.HostIpAddress) > 0 { hostname = h.machine.IPMI.HostIpAddress.String() } else if h.machine.IPMI.Hostname != "" { hostname = h.machine.IPMI.Hostname } else { return probeStatusUnreachable } h.mutex.RLock() previousProbeStatus := h.probeStatus h.mutex.RUnlock() mimimumProbeInterval := time.Second * time.Duration(30+rand.Intn(30)) if previousProbeStatus == probeStatusOff && time.Until(h.lastIpmiProbe.Add(mimimumProbeInterval)) > 0 { return probeStatusOff } cmd := exec.Command("ipmitool", "-f", m.ipmiPasswordFile, "-H", hostname, "-I", "lanplus", "-U", m.ipmiUsername, "chassis", "power", "status") h.lastIpmiProbe = time.Now() if output, err := cmd.Output(); err != nil { if previousProbeStatus == probeStatusOff { return probeStatusOff } else { return probeStatusUnreachable } } else if strings.Contains(string(output), powerOff) { return probeStatusOff } return probeStatusUnreachable }
apache-2.0
guofengrong/HomeworkOfJikexueyuan
Lesson7/百度图片瀑布流布局/js/baidu-pic.js
3505
/** * Created by guofengrong on 15/10/26. */ var dataImg = { "data": [{ "src": "1.jpg" }, { "src": "1.jpg" }, { "src": "2.jpg" }, { "src": "3.jpg" }, { "src": "4.jpg" }, { "src": "10.jpg" }] }; $(document).ready(function() { $(window).on("load", function() { imgLocation(); //当点击回到顶部的按钮时,页面回到顶部 $("#back-to-top").click(function() { $('body,html').animate({ scrollTop: 0 }, 1000); }); $(window).scroll(function() { //当页面滚动大于100px时,右下角出现返回页面顶端的按钮,否则消失 if ($(window).scrollTop() > 100) { $("#back-to-top").show(500); //$("#back-to-top").css("top",($(window).height()+$(window).scrollTop()-50)); } else { $("#back-to-top").hide(500); } //当返回true时,图片开始自动加载,加载的图片通过调用imgLocation函数进行瀑布流式的摆放 if (picAutoLoad()) { $.each(dataImg.data, function(index, value) { var box = $("<div>").addClass("pic-box").appendTo($(".content")); var pic = $("<div>").addClass("pic").appendTo(box); var img = $("<img>").attr("src", "./img/" + $(value).attr("src")).appendTo(pic); }); imgLocation(); } }); }); }); //用于摆放图片的函数: // 先计算当前页面下,横向摆放图片的张数,当当前所需要摆放的图片的序号小于该数字时,则依次向左浮动摆放; // 当超过这一数字时,则需要找到已经摆放的图片中最小高度的值(摆放图片的高度存放于数组boxHeightArr中),并在数组中找到具有最小高度的图片的位置; //然后对需要摆放的图片设置位置信息进行摆放,摆放完成后将数组中的最小高度加上当前摆放图片的高度,然后进行下一次摆放 function imgLocation() { var picBox = $('.pic-box'); var boxWidth = picBox.eq(0).width(); var contentWidth = $('.content').width(); // console.log(contentWidth); var num = Math.floor(contentWidth / boxWidth); var boxHeightArr = []; picBox.each(function(index, value) { var boxHeight = picBox.eq(index).height(); if (index < num) { boxHeightArr[index] = boxHeight; } else { var minBoxHeight = Math.min.apply(null, boxHeightArr); var minHeightIndex = $.inArray(minBoxHeight, boxHeightArr); $(value).css({ "position": "absolute", "top": minBoxHeight, "left": picBox.eq(minHeightIndex).position().left }); boxHeightArr[minHeightIndex] += picBox.eq(index).height(); } }); } //用于自动加载图片用: //lastBoxHeight获取最后一个图片的高度; //当最后一张图片的高度小于鼠标滚轮滚过的距离加上显示器高度的时候,则放回true,否则返回false; function picAutoLoad() { var box = $('.pic-box'); var lastBoxHeight = box.last().get(0).offsetTop + Math.floor(box.last().height() / 2); var windowHeight = $(window).height(); var scrollHeight = $(window).scrollTop(); return (lastBoxHeight < windowHeight + scrollHeight) ? true : false; }
apache-2.0
ripcurld0/moby
daemon/start.go
8522
package daemon import ( "context" "runtime" "time" "github.com/docker/docker/api/types" containertypes "github.com/docker/docker/api/types/container" "github.com/docker/docker/container" "github.com/docker/docker/errdefs" "github.com/pkg/errors" "github.com/sirupsen/logrus" ) // ContainerStart starts a container. func (daemon *Daemon) ContainerStart(name string, hostConfig *containertypes.HostConfig, checkpoint string, checkpointDir string) error { if checkpoint != "" && !daemon.HasExperimental() { return errdefs.InvalidParameter(errors.New("checkpoint is only supported in experimental mode")) } container, err := daemon.GetContainer(name) if err != nil { return err } validateState := func() error { container.Lock() defer container.Unlock() if container.Paused { return errdefs.Conflict(errors.New("cannot start a paused container, try unpause instead")) } if container.Running { return containerNotModifiedError{running: true} } if container.RemovalInProgress || container.Dead { return errdefs.Conflict(errors.New("container is marked for removal and cannot be started")) } return nil } if err := validateState(); err != nil { return err } // Windows does not have the backwards compatibility issue here. if runtime.GOOS != "windows" { // This is kept for backward compatibility - hostconfig should be passed when // creating a container, not during start. if hostConfig != nil { logrus.Warn("DEPRECATED: Setting host configuration options when the container starts is deprecated and has been removed in Docker 1.12") oldNetworkMode := container.HostConfig.NetworkMode if err := daemon.setSecurityOptions(container, hostConfig); err != nil { return errdefs.InvalidParameter(err) } if err := daemon.mergeAndVerifyLogConfig(&hostConfig.LogConfig); err != nil { return errdefs.InvalidParameter(err) } if err := daemon.setHostConfig(container, hostConfig); err != nil { return errdefs.InvalidParameter(err) } newNetworkMode := container.HostConfig.NetworkMode if string(oldNetworkMode) != string(newNetworkMode) { // if user has change the network mode on starting, clean up the // old networks. It is a deprecated feature and has been removed in Docker 1.12 container.NetworkSettings.Networks = nil if err := container.CheckpointTo(daemon.containersReplica); err != nil { return errdefs.System(err) } } container.InitDNSHostConfig() } } else { if hostConfig != nil { return errdefs.InvalidParameter(errors.New("Supplying a hostconfig on start is not supported. It should be supplied on create")) } } // check if hostConfig is in line with the current system settings. // It may happen cgroups are umounted or the like. if _, err = daemon.verifyContainerSettings(container.OS, container.HostConfig, nil, false); err != nil { return errdefs.InvalidParameter(err) } // Adapt for old containers in case we have updates in this function and // old containers never have chance to call the new function in create stage. if hostConfig != nil { if err := daemon.adaptContainerSettings(container.HostConfig, false); err != nil { return errdefs.InvalidParameter(err) } } return daemon.containerStart(container, checkpoint, checkpointDir, true) } // containerStart prepares the container to run by setting up everything the // container needs, such as storage and networking, as well as links // between containers. The container is left waiting for a signal to // begin running. func (daemon *Daemon) containerStart(container *container.Container, checkpoint string, checkpointDir string, resetRestartManager bool) (err error) { start := time.Now() container.Lock() defer container.Unlock() if resetRestartManager && container.Running { // skip this check if already in restarting step and resetRestartManager==false return nil } if container.RemovalInProgress || container.Dead { return errdefs.Conflict(errors.New("container is marked for removal and cannot be started")) } if checkpointDir != "" { // TODO(mlaventure): how would we support that? return errdefs.Forbidden(errors.New("custom checkpointdir is not supported")) } // if we encounter an error during start we need to ensure that any other // setup has been cleaned up properly defer func() { if err != nil { container.SetError(err) // if no one else has set it, make sure we don't leave it at zero if container.ExitCode() == 0 { container.SetExitCode(128) } if err := container.CheckpointTo(daemon.containersReplica); err != nil { logrus.Errorf("%s: failed saving state on start failure: %v", container.ID, err) } container.Reset(false) daemon.Cleanup(container) // if containers AutoRemove flag is set, remove it after clean up if container.HostConfig.AutoRemove { container.Unlock() if err := daemon.ContainerRm(container.ID, &types.ContainerRmConfig{ForceRemove: true, RemoveVolume: true}); err != nil { logrus.Errorf("can't remove container %s: %v", container.ID, err) } container.Lock() } } }() if err := daemon.conditionalMountOnStart(container); err != nil { return err } if err := daemon.initializeNetworking(container); err != nil { return err } spec, err := daemon.createSpec(container) if err != nil { return errdefs.System(err) } if resetRestartManager { container.ResetRestartManager(true) } if daemon.saveApparmorConfig(container); err != nil { return err } if checkpoint != "" { checkpointDir, err = getCheckpointDir(checkpointDir, checkpoint, container.Name, container.ID, container.CheckpointDir(), false) if err != nil { return err } } createOptions, err := daemon.getLibcontainerdCreateOptions(container) if err != nil { return err } err = daemon.containerd.Create(context.Background(), container.ID, spec, createOptions) if err != nil { return translateContainerdStartErr(container.Path, container.SetExitCode, err) } // TODO(mlaventure): we need to specify checkpoint options here pid, err := daemon.containerd.Start(context.Background(), container.ID, checkpointDir, container.StreamConfig.Stdin() != nil || container.Config.Tty, container.InitializeStdio) if err != nil { if err := daemon.containerd.Delete(context.Background(), container.ID); err != nil { logrus.WithError(err).WithField("container", container.ID). Error("failed to delete failed start container") } return translateContainerdStartErr(container.Path, container.SetExitCode, err) } container.SetRunning(pid, true) container.HasBeenManuallyStopped = false container.HasBeenStartedBefore = true daemon.setStateCounter(container) daemon.initHealthMonitor(container) if err := container.CheckpointTo(daemon.containersReplica); err != nil { logrus.WithError(err).WithField("container", container.ID). Errorf("failed to store container") } daemon.LogContainerEvent(container, "start") containerActions.WithValues("start").UpdateSince(start) return nil } // Cleanup releases any network resources allocated to the container along with any rules // around how containers are linked together. It also unmounts the container's root filesystem. func (daemon *Daemon) Cleanup(container *container.Container) { daemon.releaseNetwork(container) if err := container.UnmountIpcMount(detachMounted); err != nil { logrus.Warnf("%s cleanup: failed to unmount IPC: %s", container.ID, err) } if err := daemon.conditionalUnmountOnCleanup(container); err != nil { // FIXME: remove once reference counting for graphdrivers has been refactored // Ensure that all the mounts are gone if mountid, err := daemon.stores[container.OS].layerStore.GetMountID(container.ID); err == nil { daemon.cleanupMountsByID(mountid) } } if err := container.UnmountSecrets(); err != nil { logrus.Warnf("%s cleanup: failed to unmount secrets: %s", container.ID, err) } for _, eConfig := range container.ExecCommands.Commands() { daemon.unregisterExecCommand(container, eConfig) } if container.BaseFS != nil && container.BaseFS.Path() != "" { if err := container.UnmountVolumes(daemon.LogVolumeEvent); err != nil { logrus.Warnf("%s cleanup: Failed to umount volumes: %v", container.ID, err) } } container.CancelAttachContext() if err := daemon.containerd.Delete(context.Background(), container.ID); err != nil { logrus.Errorf("%s cleanup: failed to delete container from containerd: %v", container.ID, err) } }
apache-2.0
reaction1989/roslyn
src/Compilers/VisualBasic/Test/Symbol/SymbolsTests/WellKnownTypeValidationTests.vb
47763
' Licensed to the .NET Foundation under one or more agreements. ' The .NET Foundation licenses this file to you under the MIT license. ' See the LICENSE file in the project root for more information. Imports System.Xml.Linq Imports Microsoft.CodeAnalysis.Test.Utilities Imports Roslyn.Test.Utilities Namespace Microsoft.CodeAnalysis.VisualBasic.UnitTests Public Class WellKnownTypeValidationTests Inherits BasicTestBase <Fact> <WorkItem(530436, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/530436")> Public Sub NonPublicSpecialType() Dim source = <![CDATA[ Namespace System Public Class [Object] Public Sub New() End Sub End Class Friend Class [String] End Class Public Class ValueType End Class Public Structure Void End Structure End Namespace ]]>.Value.Replace(vbLf, vbCrLf).Trim Dim validate As Action(Of VisualBasicCompilation) = Sub(comp) Dim special = comp.GetSpecialType(SpecialType.System_String) Assert.Equal(TypeKind.Error, special.TypeKind) Assert.Equal(SpecialType.System_String, special.SpecialType) Assert.Equal(Accessibility.Public, special.DeclaredAccessibility) Dim lookup = comp.GetTypeByMetadataName("System.String") Assert.Equal(TypeKind.Class, lookup.TypeKind) Assert.Equal(SpecialType.None, lookup.SpecialType) Assert.Equal(Accessibility.Internal, lookup.DeclaredAccessibility) End Sub ValidateSourceAndMetadata(source, validate) End Sub <Fact> <WorkItem(530436, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/530436")> Public Sub NonPublicSpecialTypeMember() Dim sourceTemplate = <![CDATA[ Namespace System Public Class [Object] Public Sub New() End Sub {0} Overridable Function ToString() As [String] Return Nothing End Function End Class {0} Class [String] Public Shared Function Concat(s1 As [String], s2 As [String]) As [String] Return Nothing End Function End Class Public Class ValueType End Class Public Structure Void End Structure End Namespace ]]>.Value.Replace(vbLf, vbCrLf).Trim Dim validatePresent As Action(Of VisualBasicCompilation) = Sub(comp) Assert.NotNull(comp.GetSpecialTypeMember(SpecialMember.System_Object__ToString)) Assert.NotNull(comp.GetSpecialTypeMember(SpecialMember.System_String__ConcatStringString)) comp.GetDiagnostics() End Sub Dim validateMissing As Action(Of VisualBasicCompilation) = Sub(comp) Assert.Null(comp.GetSpecialTypeMember(SpecialMember.System_Object__ToString)) Assert.Null(comp.GetSpecialTypeMember(SpecialMember.System_String__ConcatStringString)) comp.GetDiagnostics() End Sub ValidateSourceAndMetadata(String.Format(sourceTemplate, "Public"), validatePresent) ValidateSourceAndMetadata(String.Format(sourceTemplate, "Friend"), validateMissing) End Sub ' Document the fact that we don't reject type parameters with constraints (yet?). <Fact> <WorkItem(530436, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/530436")> Public Sub GenericConstraintsOnSpecialType() Dim source = <![CDATA[ Namespace System Public Class [Object] Public Sub New() End Sub End Class Public Structure Nullable(Of T As New) End Structure Public Class ValueType End Class Public Structure Void End Structure End Namespace ]]>.Value.Replace(vbLf, vbCrLf).Trim Dim validate As Action(Of VisualBasicCompilation) = Sub(comp) Dim special = comp.GetSpecialType(SpecialType.System_Nullable_T) Assert.Equal(TypeKind.Structure, special.TypeKind) Assert.Equal(SpecialType.System_Nullable_T, special.SpecialType) Dim lookup = comp.GetTypeByMetadataName("System.Nullable`1") Assert.Equal(TypeKind.Structure, lookup.TypeKind) Assert.Equal(SpecialType.System_Nullable_T, lookup.SpecialType) End Sub ValidateSourceAndMetadata(source, validate) End Sub ' No special type members have type parameters that could (incorrectly) be constrained. <Fact> <WorkItem(530436, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/530436")> Public Sub NonPublicWellKnownType() Dim source = <![CDATA[ Namespace System Public Class [Object] Public Sub New() End Sub End Class Friend Class Type End Class Public Class ValueType End Class Public Structure Void End Structure End Namespace ]]>.Value.Replace(vbLf, vbCrLf).Trim Dim validate As Action(Of VisualBasicCompilation) = Sub(comp) Dim wellKnown = comp.GetWellKnownType(WellKnownType.System_Type) If wellKnown.DeclaringCompilation Is comp Then Assert.Equal(TypeKind.Class, wellKnown.TypeKind) Assert.Equal(Accessibility.Internal, wellKnown.DeclaredAccessibility) Else Assert.Equal(TypeKind.Error, wellKnown.TypeKind) Assert.Equal(Accessibility.Public, wellKnown.DeclaredAccessibility) End If Dim lookup = comp.GetTypeByMetadataName("System.Type") Assert.Equal(TypeKind.Class, lookup.TypeKind) Assert.Equal(Accessibility.Internal, lookup.DeclaredAccessibility) End Sub ValidateSourceAndMetadata(source, validate) End Sub <Fact> <WorkItem(530436, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/530436")> Public Sub NonPublicWellKnownType_Nested() Dim sourceTemplate = <![CDATA[ Namespace System.Diagnostics {0} Class DebuggableAttribute {1} Enum DebuggingModes Mode End Enum End Class End Namespace Namespace System Public Class [Object] Public Sub New() End Sub End Class Public Class ValueType End Class Public Class [Enum] End Class Public Structure Void End Structure Public Structure [Int32] End Structure End Namespace ]]>.Value.Replace(vbLf, vbCrLf).Trim Dim validate As Action(Of VisualBasicCompilation) = Sub(comp) Dim wellKnown = comp.GetWellKnownType(WellKnownType.System_Diagnostics_DebuggableAttribute__DebuggingModes) Assert.Equal(If(wellKnown.DeclaringCompilation Is comp, TypeKind.Enum, TypeKind.Error), wellKnown.TypeKind) Dim lookup = comp.GetTypeByMetadataName("System.Diagnostics.DebuggableAttribute+DebuggingModes") Assert.Equal(TypeKind.Enum, lookup.TypeKind) End Sub ValidateSourceAndMetadata(String.Format(sourceTemplate, "Public", "Friend"), validate) ValidateSourceAndMetadata(String.Format(sourceTemplate, "Friend", "Public"), validate) End Sub <Fact> <WorkItem(530436, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/530436")> Public Sub NonPublicWellKnownTypeMember() Dim sourceTemplate = <![CDATA[ Namespace System Public Class [Object] Public Sub New() End Sub End Class Public Class [String] End Class {0} Class Type Public Shared ReadOnly Missing As [Object] End Class Public Class FlagsAttribute {0} Sub New() End Sub End Class Public Class ValueType End Class Public Structure Void End Structure End Namespace ]]>.Value.Replace(vbLf, vbCrLf).Trim Dim validatePresent As Action(Of VisualBasicCompilation) = Sub(comp) Assert.NotNull(comp.GetWellKnownTypeMember(WellKnownMember.System_Type__Missing)) Assert.NotNull(comp.GetWellKnownTypeMember(WellKnownMember.System_FlagsAttribute__ctor)) comp.GetDiagnostics() End Sub Dim validateMissing As Action(Of VisualBasicCompilation) = Sub(comp) If comp.Assembly.CorLibrary Is comp.Assembly Then Assert.NotNull(comp.GetWellKnownTypeMember(WellKnownMember.System_Type__Missing)) Assert.NotNull(comp.GetWellKnownTypeMember(WellKnownMember.System_FlagsAttribute__ctor)) Else Assert.Null(comp.GetWellKnownTypeMember(WellKnownMember.System_Type__Missing)) Assert.Null(comp.GetWellKnownTypeMember(WellKnownMember.System_FlagsAttribute__ctor)) End If comp.GetDiagnostics() End Sub ValidateSourceAndMetadata(String.Format(sourceTemplate, "Public"), validatePresent) ValidateSourceAndMetadata(String.Format(sourceTemplate, "Friend"), validateMissing) End Sub ' Document the fact that we don't reject type parameters with constraints (yet?). <Fact> <WorkItem(530436, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/530436")> Public Sub GenericConstraintsOnWellKnownType() Dim source = <![CDATA[ Namespace System Public Class [Object] Public Sub New() End Sub End Class Public Class ValueType End Class Public Structure Void End Structure End Namespace Namespace System.Threading.Tasks Public Class Task(Of T As New) End Class End Namespace ]]>.Value.Replace(vbLf, vbCrLf).Trim Dim validate As Action(Of VisualBasicCompilation) = Sub(comp) Dim wellKnown = comp.GetWellKnownType(WellKnownType.System_Threading_Tasks_Task_T) Assert.Equal(TypeKind.Class, wellKnown.TypeKind) Dim lookup = comp.GetTypeByMetadataName("System.Threading.Tasks.Task`1") Assert.Equal(TypeKind.Class, lookup.TypeKind) End Sub ValidateSourceAndMetadata(source, validate) End Sub ' Document the fact that we don't reject type parameters with constraints (yet?). <Fact> <WorkItem(530436, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/530436")> Public Sub GenericConstraintsOnWellKnownTypeMember() Dim sourceTemplate = <![CDATA[ Namespace System Public Class [Object] Public Sub New() End Sub End Class Public Class Activator Public Shared Function CreateInstance(Of T{0})() As T Throw New Exception() End Function End Class Public Class Exception Public Sub New() End Sub End Class Public Class ValueType End Class Public Structure Void End Structure End Namespace ]]>.Value.Replace(vbLf, vbCrLf).Trim Dim validate As Action(Of VisualBasicCompilation) = Sub(comp) Assert.NotNull(comp.GetWellKnownTypeMember(WellKnownMember.System_Activator__CreateInstance_T)) comp.GetDiagnostics() End Sub ValidateSourceAndMetadata(String.Format(sourceTemplate, ""), validate) ValidateSourceAndMetadata(String.Format(sourceTemplate, " As New"), validate) End Sub Private Shared Sub ValidateSourceAndMetadata(source As String, validate As Action(Of VisualBasicCompilation)) Dim comp1 = CreateEmptyCompilation(WrapInCompilationXml(source)) validate(comp1) Dim reference = comp1.EmitToImageReference() Dim comp2 = CreateEmptyCompilationWithReferences(<compilation/>, {reference}) validate(comp2) End Sub Private Shared Function WrapInCompilationXml(source As String) As XElement Return <compilation> <file name="a.vb"> <%= source %> </file> </compilation> End Function <Fact> <WorkItem(530436, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/530436")> Public Sub PublicVersusInternalWellKnownType() Dim corlibSource = <compilation> <file name="a.vb"> Namespace System Public Class [Object] Public Sub New() End Sub End Class Public Class [String] End Class Public Class Attribute End Class Public Class ValueType End Class Public Structure Void End Structure End Namespace Namespace System.Runtime.CompilerServices Public Class InternalsVisibleToAttribute : Inherits System.Attribute Public Sub New(s As [String]) End Sub End Class End Namespace </file> </compilation> If True Then Dim libSourceTemplate = <![CDATA[ Namespace System {0} Class Type End Class End Namespace ]]>.Value.Replace(vbLf, vbCrLf).Trim Dim corlibRef = CreateEmptyCompilation(corlibSource).EmitToImageReference() Dim publicLibRef = CreateEmptyCompilationWithReferences(WrapInCompilationXml(String.Format(libSourceTemplate, "Public")), {corlibRef}).EmitToImageReference() Dim internalLibRef = CreateEmptyCompilationWithReferences(WrapInCompilationXml(String.Format(libSourceTemplate, "Friend")), {corlibRef}).EmitToImageReference() Dim comp = CreateEmptyCompilationWithReferences({}, {corlibRef, publicLibRef, internalLibRef}, assemblyName:="Test") Dim wellKnown = comp.GetWellKnownType(WellKnownType.System_Type) Assert.NotNull(wellKnown) Assert.Equal(TypeKind.Class, wellKnown.TypeKind) Assert.Equal(Accessibility.Public, wellKnown.DeclaredAccessibility) Dim Lookup = comp.GetTypeByMetadataName("System.Type") Assert.Null(Lookup) ' Ambiguous End If If True Then Dim libSourceTemplate = <![CDATA[ <Assembly: System.Runtime.CompilerServices.InternalsVisibleTo("Test")> Namespace System {0} Class Type End Class End Namespace ]]>.Value.Replace(vbLf, vbCrLf).Trim Dim corlibRef = CreateEmptyCompilation(corlibSource).EmitToImageReference() Dim publicLibRef = CreateEmptyCompilationWithReferences(WrapInCompilationXml(String.Format(libSourceTemplate, "Public")), {corlibRef}).EmitToImageReference() Dim internalLibRef = CreateEmptyCompilationWithReferences(WrapInCompilationXml(String.Format(libSourceTemplate, "Friend")), {corlibRef}).EmitToImageReference() Dim comp = CreateEmptyCompilationWithReferences({}, {corlibRef, publicLibRef, internalLibRef}, assemblyName:="Test") Dim wellKnown = comp.GetWellKnownType(WellKnownType.System_Type) Assert.NotNull(wellKnown) Assert.Equal(TypeKind.Error, wellKnown.TypeKind) Dim Lookup = comp.GetTypeByMetadataName("System.Type") Assert.Null(Lookup) ' Ambiguous End If End Sub <Fact> <WorkItem(530436, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/530436")> Public Sub AllSpecialTypes() Dim comp = CreateEmptyCompilationWithReferences((<compilation/>), {MscorlibRef_v4_0_30316_17626}) For special As SpecialType = CType(SpecialType.None + 1, SpecialType) To SpecialType.Count Dim symbol = comp.GetSpecialType(special) Assert.NotNull(symbol) If special = SpecialType.System_Runtime_CompilerServices_RuntimeFeature Then Assert.Equal(SymbolKind.ErrorType, symbol.Kind) ' Not available Else Assert.NotEqual(SymbolKind.ErrorType, symbol.Kind) End If Next End Sub <Fact> <WorkItem(530436, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/530436")> Public Sub AllSpecialTypeMembers() Dim comp = CreateEmptyCompilationWithReferences((<compilation/>), {MscorlibRef_v4_0_30316_17626}) For Each special As SpecialMember In [Enum].GetValues(GetType(SpecialMember)) Select Case special Case SpecialMember.System_IntPtr__op_Explicit_ToPointer, SpecialMember.System_IntPtr__op_Explicit_FromPointer, SpecialMember.System_UIntPtr__op_Explicit_ToPointer, SpecialMember.System_UIntPtr__op_Explicit_FromPointer ' VB doesn't have pointer types. Continue For Case SpecialMember.Count ' Not a real value. Continue For End Select Dim symbol = comp.GetSpecialTypeMember(special) If special = SpecialMember.System_Runtime_CompilerServices_RuntimeFeature__DefaultImplementationsOfInterfaces Then Assert.Null(symbol) ' Not available Else Assert.NotNull(symbol) End If Next End Sub <Fact> <WorkItem(530436, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/530436")> Public Sub AllWellKnownTypes() Dim refs As MetadataReference() = { MscorlibRef_v4_0_30316_17626, SystemRef_v4_0_30319_17929, SystemCoreRef_v4_0_30319_17929, CSharpRef, SystemXmlRef, SystemXmlLinqRef, SystemWindowsFormsRef, ValueTupleRef }.Concat(WinRtRefs).ToArray() Dim lastType = CType(WellKnownType.NextAvailable - 1, WellKnownType) Dim comp = CreateEmptyCompilationWithReferences((<compilation/>), refs.Concat(MsvbRef_v4_0_30319_17929).ToArray()) For wkt = WellKnownType.First To lastType Select Case wkt Case WellKnownType.Microsoft_VisualBasic_CompilerServices_EmbeddedOperators ' Only present when embedding VB Core. Continue For Case WellKnownType.System_FormattableString, WellKnownType.System_Runtime_CompilerServices_FormattableStringFactory, WellKnownType.System_Runtime_CompilerServices_NullableAttribute, WellKnownType.System_Runtime_CompilerServices_NullableContextAttribute, WellKnownType.System_Runtime_CompilerServices_NullablePublicOnlyAttribute, WellKnownType.System_Span_T, WellKnownType.System_ReadOnlySpan_T, WellKnownType.System_Index, WellKnownType.System_Range, WellKnownType.System_Runtime_CompilerServices_AsyncIteratorStateMachineAttribute, WellKnownType.System_IAsyncDisposable, WellKnownType.System_Collections_Generic_IAsyncEnumerable_T, WellKnownType.System_Collections_Generic_IAsyncEnumerator_T, WellKnownType.System_Threading_Tasks_Sources_ManualResetValueTaskSourceCore_T, WellKnownType.System_Threading_Tasks_Sources_ValueTaskSourceStatus, WellKnownType.System_Threading_Tasks_Sources_ValueTaskSourceOnCompletedFlags, WellKnownType.System_Threading_Tasks_Sources_IValueTaskSource_T, WellKnownType.System_Threading_Tasks_Sources_IValueTaskSource, WellKnownType.System_Threading_Tasks_ValueTask_T, WellKnownType.System_Threading_Tasks_ValueTask, WellKnownType.System_Runtime_CompilerServices_AsyncIteratorMethodBuilder, WellKnownType.System_Threading_CancellationToken, WellKnownType.System_Runtime_CompilerServices_NonNullTypesAttribute, WellKnownType.Microsoft_CodeAnalysis_EmbeddedAttribute, WellKnownType.System_Runtime_CompilerServices_SwitchExpressionException, WellKnownType.System_Runtime_CompilerServices_NativeIntegerAttribute ' Not available on all platforms. Continue For Case WellKnownType.ExtSentinel ' Not a real type Continue For Case WellKnownType.Microsoft_CodeAnalysis_Runtime_Instrumentation, WellKnownType.System_Runtime_CompilerServices_IsReadOnlyAttribute, WellKnownType.System_Runtime_CompilerServices_IsByRefLikeAttribute, WellKnownType.System_Runtime_CompilerServices_IsUnmanagedAttribute, WellKnownType.System_Runtime_CompilerServices_ITuple ' Not always available. Continue For End Select Dim symbol = comp.GetWellKnownType(wkt) Assert.NotNull(symbol) Assert.NotEqual(SymbolKind.ErrorType, symbol.Kind) Next comp = CreateEmptyCompilationWithReferences(<compilation/>, refs, TestOptions.ReleaseDll.WithEmbedVbCoreRuntime(True)) For wkt = WellKnownType.First To lastType Select Case wkt Case WellKnownType.Microsoft_VisualBasic_CallType, WellKnownType.Microsoft_VisualBasic_CompilerServices_Operators, WellKnownType.Microsoft_VisualBasic_CompilerServices_NewLateBinding, WellKnownType.Microsoft_VisualBasic_CompilerServices_LikeOperator, WellKnownType.Microsoft_VisualBasic_CompilerServices_StringType, WellKnownType.Microsoft_VisualBasic_CompilerServices_Versioned, WellKnownType.Microsoft_VisualBasic_CompareMethod, WellKnownType.Microsoft_VisualBasic_ErrObject, WellKnownType.Microsoft_VisualBasic_FileSystem, WellKnownType.Microsoft_VisualBasic_ApplicationServices_ApplicationBase, WellKnownType.Microsoft_VisualBasic_ApplicationServices_WindowsFormsApplicationBase, WellKnownType.Microsoft_VisualBasic_Information, WellKnownType.Microsoft_VisualBasic_Interaction, WellKnownType.Microsoft_VisualBasic_Conversion ' Not embedded, so not available. Continue For Case WellKnownType.System_FormattableString, WellKnownType.System_Runtime_CompilerServices_FormattableStringFactory, WellKnownType.System_Runtime_CompilerServices_NullableAttribute, WellKnownType.System_Runtime_CompilerServices_NullableContextAttribute, WellKnownType.System_Runtime_CompilerServices_NullablePublicOnlyAttribute, WellKnownType.System_Span_T, WellKnownType.System_ReadOnlySpan_T, WellKnownType.System_Index, WellKnownType.System_Range, WellKnownType.System_Runtime_CompilerServices_AsyncIteratorStateMachineAttribute, WellKnownType.System_IAsyncDisposable, WellKnownType.System_Collections_Generic_IAsyncEnumerable_T, WellKnownType.System_Collections_Generic_IAsyncEnumerator_T, WellKnownType.System_Threading_Tasks_Sources_ManualResetValueTaskSourceCore_T, WellKnownType.System_Threading_Tasks_Sources_ValueTaskSourceStatus, WellKnownType.System_Threading_Tasks_Sources_ValueTaskSourceOnCompletedFlags, WellKnownType.System_Threading_Tasks_Sources_IValueTaskSource_T, WellKnownType.System_Threading_Tasks_Sources_IValueTaskSource, WellKnownType.System_Threading_Tasks_ValueTask_T, WellKnownType.System_Threading_Tasks_ValueTask, WellKnownType.System_Runtime_CompilerServices_AsyncIteratorMethodBuilder, WellKnownType.System_Threading_CancellationToken, WellKnownType.System_Runtime_CompilerServices_NonNullTypesAttribute, WellKnownType.Microsoft_CodeAnalysis_EmbeddedAttribute, WellKnownType.System_Runtime_CompilerServices_SwitchExpressionException, WellKnownType.System_Runtime_CompilerServices_NativeIntegerAttribute ' Not available on all platforms. Continue For Case WellKnownType.ExtSentinel ' Not a real type Continue For Case WellKnownType.Microsoft_CodeAnalysis_Runtime_Instrumentation, WellKnownType.System_Runtime_CompilerServices_IsReadOnlyAttribute, WellKnownType.System_Runtime_CompilerServices_IsByRefLikeAttribute, WellKnownType.System_Runtime_CompilerServices_IsUnmanagedAttribute, WellKnownType.System_Runtime_CompilerServices_ITuple ' Not always available. Continue For End Select Dim symbol = comp.GetWellKnownType(wkt) Assert.NotNull(symbol) Assert.True(SymbolKind.ErrorType <> symbol.Kind, $"{symbol} should not be an error type") Next End Sub <Fact> <WorkItem(530436, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/530436")> Public Sub AllWellKnownTypeMembers() Dim refs As MetadataReference() = { MscorlibRef_v4_0_30316_17626, SystemRef_v4_0_30319_17929, SystemCoreRef_v4_0_30319_17929, CSharpRef, SystemXmlRef, SystemXmlLinqRef, SystemWindowsFormsRef, ValueTupleRef }.Concat(WinRtRefs).ToArray() Dim comp = CreateEmptyCompilationWithReferences((<compilation/>), refs.Concat(MsvbRef_v4_0_30319_17929).ToArray()) For Each wkm As WellKnownMember In [Enum].GetValues(GetType(WellKnownMember)) Select Case wkm Case WellKnownMember.Microsoft_VisualBasic_CompilerServices_EmbeddedOperators__CompareStringStringStringBoolean ' Only present when embedding VB Core. Continue For Case WellKnownMember.Count ' Not a real value. Continue For Case WellKnownMember.System_Array__Empty, WellKnownMember.System_Runtime_CompilerServices_NullableAttribute__ctorByte, WellKnownMember.System_Runtime_CompilerServices_NullableAttribute__ctorTransformFlags, WellKnownMember.System_Runtime_CompilerServices_NullableContextAttribute__ctor, WellKnownMember.System_Runtime_CompilerServices_NullablePublicOnlyAttribute__ctor, WellKnownMember.System_Span_T__ctor, WellKnownMember.System_Span_T__get_Item, WellKnownMember.System_Span_T__get_Length, WellKnownMember.System_ReadOnlySpan_T__ctor, WellKnownMember.System_ReadOnlySpan_T__get_Item, WellKnownMember.System_ReadOnlySpan_T__get_Length, WellKnownMember.System_Runtime_CompilerServices_AsyncIteratorStateMachineAttribute__ctor, WellKnownMember.System_IAsyncDisposable__DisposeAsync, WellKnownMember.System_Collections_Generic_IAsyncEnumerable_T__GetAsyncEnumerator, WellKnownMember.System_Collections_Generic_IAsyncEnumerator_T__MoveNextAsync, WellKnownMember.System_Collections_Generic_IAsyncEnumerator_T__get_Current, WellKnownMember.System_Threading_Tasks_Sources_ManualResetValueTaskSourceCore_T__get_Version, WellKnownMember.System_Threading_Tasks_Sources_ManualResetValueTaskSourceCore_T__GetResult, WellKnownMember.System_Threading_Tasks_Sources_ManualResetValueTaskSourceCore_T__GetStatus, WellKnownMember.System_Threading_Tasks_Sources_ManualResetValueTaskSourceCore_T__OnCompleted, WellKnownMember.System_Threading_Tasks_Sources_ManualResetValueTaskSourceCore_T__Reset, WellKnownMember.System_Threading_Tasks_Sources_ManualResetValueTaskSourceCore_T__SetException, WellKnownMember.System_Threading_Tasks_Sources_ManualResetValueTaskSourceCore_T__SetResult, WellKnownMember.System_Threading_Tasks_Sources_IValueTaskSource_T__GetResult, WellKnownMember.System_Threading_Tasks_Sources_IValueTaskSource_T__GetStatus, WellKnownMember.System_Threading_Tasks_Sources_IValueTaskSource_T__OnCompleted, WellKnownMember.System_Threading_Tasks_Sources_IValueTaskSource__GetResult, WellKnownMember.System_Threading_Tasks_Sources_IValueTaskSource__GetStatus, WellKnownMember.System_Threading_Tasks_Sources_IValueTaskSource__OnCompleted, WellKnownMember.System_Threading_Tasks_ValueTask_T__ctorSourceAndToken, WellKnownMember.System_Threading_Tasks_ValueTask_T__ctorValue, WellKnownMember.System_Threading_Tasks_ValueTask__ctor, WellKnownMember.System_Runtime_CompilerServices_AsyncIteratorMethodBuilder__AwaitOnCompleted, WellKnownMember.System_Runtime_CompilerServices_AsyncIteratorMethodBuilder__AwaitUnsafeOnCompleted, WellKnownMember.System_Runtime_CompilerServices_AsyncIteratorMethodBuilder__Complete, WellKnownMember.System_Runtime_CompilerServices_AsyncIteratorMethodBuilder__Create, WellKnownMember.System_Runtime_CompilerServices_AsyncIteratorMethodBuilder__MoveNext_T, WellKnownMember.System_Runtime_CompilerServices_AsyncStateMachineAttribute__ctor, WellKnownMember.System_Runtime_CompilerServices_RuntimeHelpers__GetSubArray_T, WellKnownMember.System_Runtime_CompilerServices_NativeIntegerAttribute__ctor, WellKnownMember.System_Runtime_CompilerServices_NativeIntegerAttribute__ctorTransformFlags ' Not available yet, but will be in upcoming release. Continue For Case WellKnownMember.Microsoft_CodeAnalysis_Runtime_Instrumentation__CreatePayloadForMethodsSpanningSingleFile, WellKnownMember.Microsoft_CodeAnalysis_Runtime_Instrumentation__CreatePayloadForMethodsSpanningMultipleFiles, WellKnownMember.System_Runtime_CompilerServices_IsReadOnlyAttribute__ctor, WellKnownMember.System_Runtime_CompilerServices_IsByRefLikeAttribute__ctor, WellKnownMember.System_Runtime_CompilerServices_IsUnmanagedAttribute__ctor, WellKnownMember.System_Index__ctor, WellKnownMember.System_Index__GetOffset, WellKnownMember.System_Range__ctor, WellKnownMember.System_Range__EndAt, WellKnownMember.System_Range__get_All, WellKnownMember.System_Range__StartAt, WellKnownMember.System_Range__get_End, WellKnownMember.System_Range__get_Start, WellKnownMember.System_Runtime_CompilerServices_IsUnmanagedAttribute__ctor, WellKnownMember.System_Runtime_CompilerServices_ITuple__get_Item, WellKnownMember.System_Runtime_CompilerServices_ITuple__get_Length, WellKnownMember.System_Runtime_CompilerServices_SwitchExpressionException__ctor, WellKnownMember.System_Runtime_CompilerServices_SwitchExpressionException__ctorObject ' Not always available. Continue For End Select Dim symbol = comp.GetWellKnownTypeMember(wkm) Assert.True(symbol IsNot Nothing, $"Unexpected null for {wkm}") Next comp = CreateEmptyCompilationWithReferences(<compilation/>, refs, TestOptions.ReleaseDll.WithEmbedVbCoreRuntime(True)) For Each wkm As WellKnownMember In [Enum].GetValues(GetType(WellKnownMember)) Select Case wkm Case WellKnownMember.Count ' Not a real value. Continue For Case WellKnownMember.Microsoft_VisualBasic_CompilerServices_Conversions__ChangeType, WellKnownMember.Microsoft_VisualBasic_CompilerServices_ObjectFlowControl_ForLoopControl__ForLoopInitObj, WellKnownMember.Microsoft_VisualBasic_CompilerServices_ObjectFlowControl_ForLoopControl__ForNextCheckObj, WellKnownMember.Microsoft_VisualBasic_CompilerServices_ObjectFlowControl__CheckForSyncLockOnValueType, WellKnownMember.Microsoft_VisualBasic_CompilerServices_ProjectData__CreateProjectError, WellKnownMember.Microsoft_VisualBasic_CompilerServices_ProjectData__EndApp, WellKnownMember.Microsoft_VisualBasic_Strings__AscCharInt32, WellKnownMember.Microsoft_VisualBasic_Strings__AscStringInt32, WellKnownMember.Microsoft_VisualBasic_Strings__ChrInt32Char ' Even though the containing type is embedded, the specific member is not. Continue For Case WellKnownMember.Microsoft_VisualBasic_CompilerServices_Operators__PlusObjectObject, WellKnownMember.Microsoft_VisualBasic_CompilerServices_Operators__NegateObjectObject, WellKnownMember.Microsoft_VisualBasic_CompilerServices_Operators__NotObjectObject, WellKnownMember.Microsoft_VisualBasic_CompilerServices_Operators__AndObjectObjectObject, WellKnownMember.Microsoft_VisualBasic_CompilerServices_Operators__OrObjectObjectObject, WellKnownMember.Microsoft_VisualBasic_CompilerServices_Operators__XorObjectObjectObject, WellKnownMember.Microsoft_VisualBasic_CompilerServices_Operators__AddObjectObjectObject, WellKnownMember.Microsoft_VisualBasic_CompilerServices_Operators__SubtractObjectObjectObject, WellKnownMember.Microsoft_VisualBasic_CompilerServices_Operators__MultiplyObjectObjectObject, WellKnownMember.Microsoft_VisualBasic_CompilerServices_Operators__DivideObjectObjectObject, WellKnownMember.Microsoft_VisualBasic_CompilerServices_Operators__ExponentObjectObjectObject, WellKnownMember.Microsoft_VisualBasic_CompilerServices_Operators__ModObjectObjectObject, WellKnownMember.Microsoft_VisualBasic_CompilerServices_Operators__IntDivideObjectObjectObject, WellKnownMember.Microsoft_VisualBasic_CompilerServices_Operators__LeftShiftObjectObjectObject, WellKnownMember.Microsoft_VisualBasic_CompilerServices_Operators__RightShiftObjectObjectObject, WellKnownMember.Microsoft_VisualBasic_CompilerServices_Operators__ConcatenateObjectObjectObject, WellKnownMember.Microsoft_VisualBasic_CompilerServices_Operators__CompareObjectEqualObjectObjectBoolean, WellKnownMember.Microsoft_VisualBasic_CompilerServices_Operators__CompareObjectNotEqualObjectObjectBoolean, WellKnownMember.Microsoft_VisualBasic_CompilerServices_Operators__CompareObjectLessObjectObjectBoolean, WellKnownMember.Microsoft_VisualBasic_CompilerServices_Operators__CompareObjectLessEqualObjectObjectBoolean, WellKnownMember.Microsoft_VisualBasic_CompilerServices_Operators__CompareObjectGreaterEqualObjectObjectBoolean, WellKnownMember.Microsoft_VisualBasic_CompilerServices_Operators__CompareObjectGreaterObjectObjectBoolean, WellKnownMember.Microsoft_VisualBasic_CompilerServices_Operators__ConditionalCompareObjectEqualObjectObjectBoolean, WellKnownMember.Microsoft_VisualBasic_CompilerServices_Operators__ConditionalCompareObjectNotEqualObjectObjectBoolean, WellKnownMember.Microsoft_VisualBasic_CompilerServices_Operators__ConditionalCompareObjectLessObjectObjectBoolean, WellKnownMember.Microsoft_VisualBasic_CompilerServices_Operators__ConditionalCompareObjectLessEqualObjectObjectBoolean, WellKnownMember.Microsoft_VisualBasic_CompilerServices_Operators__ConditionalCompareObjectGreaterEqualObjectObjectBoolean, WellKnownMember.Microsoft_VisualBasic_CompilerServices_Operators__ConditionalCompareObjectGreaterObjectObjectBoolean, WellKnownMember.Microsoft_VisualBasic_CompilerServices_Operators__CompareStringStringStringBoolean, WellKnownMember.Microsoft_VisualBasic_CompilerServices_NewLateBinding__LateCall, WellKnownMember.Microsoft_VisualBasic_CompilerServices_NewLateBinding__LateGet, WellKnownMember.Microsoft_VisualBasic_CompilerServices_NewLateBinding__LateSet, WellKnownMember.Microsoft_VisualBasic_CompilerServices_NewLateBinding__LateSetComplex, WellKnownMember.Microsoft_VisualBasic_CompilerServices_NewLateBinding__LateIndexGet, WellKnownMember.Microsoft_VisualBasic_CompilerServices_NewLateBinding__LateIndexSet, WellKnownMember.Microsoft_VisualBasic_CompilerServices_NewLateBinding__LateIndexSetComplex, WellKnownMember.Microsoft_VisualBasic_CompilerServices_StringType__MidStmtStr, WellKnownMember.Microsoft_VisualBasic_CompilerServices_LikeOperator__LikeStringStringStringCompareMethod, WellKnownMember.Microsoft_VisualBasic_CompilerServices_LikeOperator__LikeObjectObjectObjectCompareMethod, WellKnownMember.Microsoft_VisualBasic_CompilerServices_Versioned__CallByName, WellKnownMember.Microsoft_VisualBasic_CompilerServices_Versioned__IsNumeric, WellKnownMember.Microsoft_VisualBasic_CompilerServices_Versioned__SystemTypeName, WellKnownMember.Microsoft_VisualBasic_CompilerServices_Versioned__TypeName, WellKnownMember.Microsoft_VisualBasic_CompilerServices_Versioned__VbTypeName, WellKnownMember.Microsoft_VisualBasic_Information__IsNumeric, WellKnownMember.Microsoft_VisualBasic_Information__SystemTypeName, WellKnownMember.Microsoft_VisualBasic_Information__TypeName, WellKnownMember.Microsoft_VisualBasic_Information__VbTypeName, WellKnownMember.Microsoft_VisualBasic_Interaction__CallByName, WellKnownMember.Microsoft_VisualBasic_Conversion__FixSingle, WellKnownMember.Microsoft_VisualBasic_Conversion__FixDouble, WellKnownMember.Microsoft_VisualBasic_Conversion__IntSingle, WellKnownMember.Microsoft_VisualBasic_Conversion__IntDouble ' The type is not embedded, so the member is not available. Continue For Case WellKnownMember.System_Array__Empty, WellKnownMember.System_Runtime_CompilerServices_NullableAttribute__ctorByte, WellKnownMember.System_Runtime_CompilerServices_NullableAttribute__ctorTransformFlags, WellKnownMember.System_Runtime_CompilerServices_NullableContextAttribute__ctor, WellKnownMember.System_Runtime_CompilerServices_NullablePublicOnlyAttribute__ctor, WellKnownMember.System_Span_T__ctor, WellKnownMember.System_Span_T__get_Item, WellKnownMember.System_Span_T__get_Length, WellKnownMember.System_ReadOnlySpan_T__ctor, WellKnownMember.System_ReadOnlySpan_T__get_Item, WellKnownMember.System_ReadOnlySpan_T__get_Length, WellKnownMember.System_Runtime_CompilerServices_AsyncIteratorStateMachineAttribute__ctor, WellKnownMember.System_IAsyncDisposable__DisposeAsync, WellKnownMember.System_Collections_Generic_IAsyncEnumerable_T__GetAsyncEnumerator, WellKnownMember.System_Collections_Generic_IAsyncEnumerator_T__MoveNextAsync, WellKnownMember.System_Collections_Generic_IAsyncEnumerator_T__get_Current, WellKnownMember.System_Threading_Tasks_Sources_ManualResetValueTaskSourceCore_T__get_Version, WellKnownMember.System_Threading_Tasks_Sources_ManualResetValueTaskSourceCore_T__GetResult, WellKnownMember.System_Threading_Tasks_Sources_ManualResetValueTaskSourceCore_T__GetStatus, WellKnownMember.System_Threading_Tasks_Sources_ManualResetValueTaskSourceCore_T__OnCompleted, WellKnownMember.System_Threading_Tasks_Sources_ManualResetValueTaskSourceCore_T__Reset, WellKnownMember.System_Threading_Tasks_Sources_ManualResetValueTaskSourceCore_T__SetException, WellKnownMember.System_Threading_Tasks_Sources_ManualResetValueTaskSourceCore_T__SetResult, WellKnownMember.System_Threading_Tasks_Sources_IValueTaskSource_T__GetResult, WellKnownMember.System_Threading_Tasks_Sources_IValueTaskSource_T__GetStatus, WellKnownMember.System_Threading_Tasks_Sources_IValueTaskSource_T__OnCompleted, WellKnownMember.System_Threading_Tasks_Sources_IValueTaskSource__GetResult, WellKnownMember.System_Threading_Tasks_Sources_IValueTaskSource__GetStatus, WellKnownMember.System_Threading_Tasks_Sources_IValueTaskSource__OnCompleted, WellKnownMember.System_Threading_Tasks_ValueTask_T__ctorSourceAndToken, WellKnownMember.System_Threading_Tasks_ValueTask_T__ctorValue, WellKnownMember.System_Threading_Tasks_ValueTask__ctor, WellKnownMember.System_Runtime_CompilerServices_AsyncIteratorMethodBuilder__AwaitOnCompleted, WellKnownMember.System_Runtime_CompilerServices_AsyncIteratorMethodBuilder__AwaitUnsafeOnCompleted, WellKnownMember.System_Runtime_CompilerServices_AsyncIteratorMethodBuilder__Complete, WellKnownMember.System_Runtime_CompilerServices_AsyncIteratorMethodBuilder__Create, WellKnownMember.System_Runtime_CompilerServices_AsyncIteratorMethodBuilder__MoveNext_T, WellKnownMember.System_Runtime_CompilerServices_AsyncStateMachineAttribute__ctor, WellKnownMember.System_Runtime_CompilerServices_RuntimeHelpers__GetSubArray_T, WellKnownMember.System_Runtime_CompilerServices_NativeIntegerAttribute__ctor, WellKnownMember.System_Runtime_CompilerServices_NativeIntegerAttribute__ctorTransformFlags ' Not available yet, but will be in upcoming release. Continue For Case WellKnownMember.Microsoft_CodeAnalysis_Runtime_Instrumentation__CreatePayloadForMethodsSpanningSingleFile, WellKnownMember.Microsoft_CodeAnalysis_Runtime_Instrumentation__CreatePayloadForMethodsSpanningMultipleFiles, WellKnownMember.System_Runtime_CompilerServices_IsReadOnlyAttribute__ctor, WellKnownMember.System_Runtime_CompilerServices_IsByRefLikeAttribute__ctor, WellKnownMember.System_Runtime_CompilerServices_IsUnmanagedAttribute__ctor, WellKnownMember.System_Index__ctor, WellKnownMember.System_Index__GetOffset, WellKnownMember.System_Range__ctor, WellKnownMember.System_Range__EndAt, WellKnownMember.System_Range__get_All, WellKnownMember.System_Range__StartAt, WellKnownMember.System_Range__get_End, WellKnownMember.System_Range__get_Start, WellKnownMember.System_Runtime_CompilerServices_IsUnmanagedAttribute__ctor, WellKnownMember.System_Runtime_CompilerServices_ITuple__get_Item, WellKnownMember.System_Runtime_CompilerServices_ITuple__get_Length, WellKnownMember.System_Runtime_CompilerServices_SwitchExpressionException__ctor, WellKnownMember.System_Runtime_CompilerServices_SwitchExpressionException__ctorObject ' Not always available. Continue For End Select Dim symbol = comp.GetWellKnownTypeMember(wkm) Assert.True(symbol IsNot Nothing, $"Unexpected null for {wkm}") Next End Sub End Class End Namespace
apache-2.0
lAnubisl/PostTrack
Posttrack.BLL.Tests/PackagePresentationSetviceTests.cs
11739
using System; using System.Collections.Generic; using System.Collections.ObjectModel; using System.Diagnostics; using System.Linq; using System.Threading; using System.Threading.Tasks; using Moq; using NUnit.Framework; using Posttrack.BLL.Helpers.Interfaces; using Posttrack.BLL.Interfaces; using Posttrack.BLL.Interfaces.Models; using Posttrack.Common; using Posttrack.Data.Interfaces; using Posttrack.Data.Interfaces.DTO; namespace Posttrack.BLL.Tests { [TestFixture] public class PackagePresentationServiceTests { private Mock<IPackageDAO> _dao; private Mock<IResponseReader> _reader; private Mock<IUpdateSearcher> _searcher; private Mock<IMessageSender> _sender; private Mock<ISettingsService> _configuration; private IPackagePresentationService _service; [SetUp] public void Setup() { _dao = new Mock<IPackageDAO>(); _searcher = new Mock<IUpdateSearcher>(); _reader = new Mock<IResponseReader>(); _sender = new Mock<IMessageSender>(); _sender.Setup(s => s.SendStatusUpdateAsync(It.IsAny<PackageDTO>(), It.IsAny<IEnumerable<PackageHistoryItemDTO>>())).Returns(Task.FromResult(0)); _configuration = new Mock<ISettingsService>(); _configuration.Setup(c => c.InactivityPeriodMonths).Returns(2); var logger = new Mock<ILogger>(); logger.Setup(l => l.CreateScope(It.IsAny<string>())).Returns(logger.Object); _service = new PackagePresentationService(_dao.Object, _sender.Object, _searcher.Object, _reader.Object, _configuration.Object, logger.Object); } [Test] public void Register_Shoudl_Call_DAO() { var model = new RegisterTrackingModel { Description = "Description", Email = "[email protected]", Tracking = "AA123123123PP" }; _service.Register(model).Wait(); _dao.Verify( c => c.RegisterAsync( It.Is<RegisterPackageDTO>( d => d.Tracking == model.Tracking && d.Email == model.Email && d.Description == model.Description))); } [Test] public void Register_Should_Call_Sender() { var model = new RegisterTrackingModel { Description = "Description", Email = "[email protected]", Tracking = "AA123123123PP" }; var savedPackage = new PackageDTO { Tracking = model.Tracking }; _dao.Setup(d => d.LoadAsync(model.Tracking)).Returns(Task.FromResult(savedPackage)); _searcher.Setup(s => s.SearchAsync(savedPackage)).Returns(Task.FromResult("Empty search result")); _service.Register(model).Wait(); _sender.Verify(c => c.SendRegisteredAsync(savedPackage, null)); } [Test] public void UpdateComingPachages_Should_Call_Searcher_For_Each_Package() { ICollection<PackageDTO> packages = new Collection<PackageDTO> { new PackageDTO { Tracking = "t1" }, new PackageDTO { Tracking = "t2" } }; _dao.Setup(d => d.LoadTrackingAsync()).Returns(Task.FromResult(packages)); _service.UpdateComingPackages(); var arr = packages.ToArray(); _searcher.Verify(c => c.SearchAsync(arr[0])); _searcher.Verify(c => c.SearchAsync(arr[1])); } [Test] public void UpdateComingPachages_Should_Call_Reader_For_Each_Package() { ICollection<PackageDTO> packages = new Collection<PackageDTO> { new PackageDTO { Tracking = "t1" }, new PackageDTO { Tracking = "t2" }, new PackageDTO { Tracking = "t3" } }; _dao.Setup(d => d.LoadTrackingAsync()).Returns(Task.FromResult(packages)); _searcher.Setup(s => s.SearchAsync(It.IsAny<PackageDTO>())).Returns(Task.FromResult("Fake result")); _service.UpdateComingPackages(); _reader.Verify(c => c.Read("Fake result"), Times.Exactly(3)); } [Test] public void UpdateComingPackages_Should_Call_SendInactivityEmail_When_Package_Was_Inactive_For_A_Long_Time() { var inactivePackage = new PackageDTO { Tracking = "Not null tracking", UpdateDate = DateTime.Now.AddMonths(-2) }; _dao.Setup(d => d.LoadTrackingAsync()).Returns(Task.FromResult(new Collection<PackageDTO> { inactivePackage } as ICollection<PackageDTO>)); _searcher.Setup(s => s.SearchAsync(It.IsAny<PackageDTO>())).Returns(Task.FromResult("Not empty search result")); _reader.Setup(r => r.Read(It.IsAny<string>())).Returns(null as ICollection<PackageHistoryItemDTO>); _service.UpdateComingPackages().Wait(); _sender.Verify(c => c.SendInactivityEmailAsync(inactivePackage)); } [Test] public void UpdateComingPackages_Should_Finish_Package_When_Package_Was_Inactive_For_A_Long_Time() { var inactivePackage = new PackageDTO { IsFinished = false, Tracking = "Not null tracking", UpdateDate = DateTime.Now.AddMonths(-2) }; _dao.Setup(d => d.LoadTrackingAsync()).Returns(Task.FromResult(new Collection<PackageDTO> { inactivePackage } as ICollection<PackageDTO>)); _searcher.Setup(s => s.SearchAsync(It.IsAny<PackageDTO>())).Returns(Task.FromResult("Not empty search result")); _reader.Setup(r => r.Read(It.IsAny<string>())).Returns(null as ICollection<PackageHistoryItemDTO>); _service.UpdateComingPackages().Wait(); _dao.Verify(c => c.UpdateAsync(inactivePackage)); Assert.True(inactivePackage.IsFinished); } [Test] public void UpdateComingPackages_Should_Not_Call_SendInactivityEmail_When_Package_Was_Not_Inactive_For_A_Long_Time() { var inactivePackage = new PackageDTO { Tracking = "Not null tracking", UpdateDate = DateTime.Now.AddMonths(-2 + 1) }; _dao.Setup(d => d.LoadTrackingAsync()).Returns(Task.FromResult(new Collection<PackageDTO> { inactivePackage } as ICollection<PackageDTO>)); _searcher.Setup(s => s.SearchAsync(It.IsAny<PackageDTO>())).Returns(Task.FromResult("Not empty search result")); _reader.Setup(r => r.Read(It.IsAny<string>())).Returns(null as ICollection<PackageHistoryItemDTO>); _service.UpdateComingPackages().Wait(); _sender.Verify(c => c.SendInactivityEmailAsync(inactivePackage), Times.Never); } [Test] public void UpdateComingPackages_Should_Update_Package_History() { var package = new PackageDTO { Tracking = "Not null tracking", History = null }; var history = new Collection<PackageHistoryItemDTO> { new PackageHistoryItemDTO { Action = "Action", Place = "Place", Date = DateTime.Now } }; _dao.Setup(d => d.LoadTrackingAsync()).Returns(Task.FromResult(new Collection<PackageDTO> { package } as ICollection<PackageDTO>)); _searcher.Setup(s => s.SearchAsync(It.IsAny<PackageDTO>())).Returns(Task.FromResult("Not empty search result")); _reader.Setup(r => r.Read(It.IsAny<string>())).Returns(history); _service.UpdateComingPackages().Wait(); _dao.Verify(c => c.UpdateAsync(package)); Assert.AreEqual(history, package.History); } [Test] public void UpdateComingPackages_Should_Finish_Package_When_History_Has_A_Special_Action_1() { var package = new PackageDTO { Tracking = "Not null tracking", History = null, IsFinished = false }; var history = new Collection<PackageHistoryItemDTO> { new PackageHistoryItemDTO { Action = "Доставлено, вручено", Place = "Place", Date = DateTime.Now } }; _dao.Setup(d => d.LoadTrackingAsync()).Returns(Task.FromResult(new Collection<PackageDTO> { package } as ICollection<PackageDTO>)); _searcher.Setup(s => s.SearchAsync(It.IsAny<PackageDTO>())).Returns(Task.FromResult("Not empty search result")); _reader.Setup(r => r.Read(It.IsAny<string>())).Returns(history); _service.UpdateComingPackages().Wait(); Assert.True(package.IsFinished); } [Test] public void UpdateComingPackages_Should_Finish_Package_When_History_Has_A_Special_Action_2() { var package = new PackageDTO { Tracking = "Not null tracking", History = null, IsFinished = false }; var history = new Collection<PackageHistoryItemDTO> { new PackageHistoryItemDTO { Action = "Отправление доставлено", Place = "Place", Date = DateTime.Now } }; _dao.Setup(d => d.LoadTrackingAsync()).Returns(Task.FromResult(new Collection<PackageDTO> { package } as ICollection<PackageDTO>)); _searcher.Setup(s => s.SearchAsync(It.IsAny<PackageDTO>())).Returns(Task.FromResult("Not empty search result")); _reader.Setup(r => r.Read(It.IsAny<string>())).Returns(history); _service.UpdateComingPackages().Wait(); Assert.True(package.IsFinished); } [Test] [Ignore("")] public void UpdateComingPackages_Should_Work_Async() { ICollection<PackageDTO> packages = new Collection<PackageDTO> { new PackageDTO { Tracking = "Not null tracking" }, new PackageDTO { Tracking = "Not null tracking" }, new PackageDTO { Tracking = "Not null tracking" }, new PackageDTO { Tracking = "Not null tracking" }, new PackageDTO { Tracking = "Not null tracking" }, new PackageDTO { Tracking = "Not null tracking" }, new PackageDTO { Tracking = "Not null tracking" }, new PackageDTO { Tracking = "Not null tracking" }, new PackageDTO { Tracking = "Not null tracking" }, new PackageDTO { Tracking = "Not null tracking" } }; var history = new Collection<PackageHistoryItemDTO> { new PackageHistoryItemDTO { Action = "Отправление доставлено", Place = "Place", Date = DateTime.Now } }; _reader.Setup(r => r.Read(It.IsAny<string>())).Returns(history); _searcher.Setup(s => s.SearchAsync(It.IsAny<PackageDTO>())) .Callback(() => Thread.Sleep(500)) .Returns(Task.FromResult("Not empty search result")); _sender.Setup(s => s.SendStatusUpdateAsync(It.IsAny<PackageDTO>(), It.IsAny<IEnumerable<PackageHistoryItemDTO>>())) .Callback(() => Thread.Sleep(500)) .Returns(Task.FromResult(0)); _dao.Setup(d => d.LoadTrackingAsync()).Returns(Task.FromResult(packages)); var stopwatch = new Stopwatch(); stopwatch.Start(); _service.UpdateComingPackages().Wait(); stopwatch.Stop(); Assert.True(stopwatch.Elapsed.Seconds > 1); Assert.True(stopwatch.Elapsed.Seconds < 10); } } }
apache-2.0
1987yama3/power-analytics.appspot.com
test/unit/utilities.test.js
1060
import { expect } from 'chai'; import * as utilities from '../../src/utilities'; describe('utilities.capitalize()', () => { it('capitalize', () => { expect( utilities.capitalize('capitalize') == 'Capitalize' ); }); it('Capitalize', () => { expect( utilities.capitalize('Capitalize') == 'Capitalize' ); }); it('poweranalytics', () => { expect( utilities.capitalize('poweranalytics') == 'Poweranalytics' ); }); }); describe('utilities.loadScript()', () => { }); describe('utilities.domReady()', () => { }); describe('utilities.random()', () => { it('length', () => { expect( utilities.random(1).length == 1 ); expect( utilities.random(5).length == 5 ); expect( utilities.random(20).length == 20 ); }); it('character', () => { expect( utilities.random(5).match(/^[0-9a-zA-Z]{5}$/) ); }); }); describe('utilities.timestamp()', () => { it('format', () => { const timestamp = utilities.timestamp(); expect(timestamp.match(/[0-9]{4}\/[0-9]{2}\/[0-9]{2} [0-9]{2}:[0-9]{2}:[0-9]{2}:[0-9]{3}/)) }); });
apache-2.0
weijiancai/metaui
fxbase/src/main/java/com/metaui/fxbase/view/desktop/MUTabsDesktop.java
3558
package com.metaui.fxbase.view.desktop; import com.metaui.fxbase.model.AppModel; import com.metaui.fxbase.model.NavMenuModel; import com.metaui.fxbase.ui.IDesktop; import com.metaui.fxbase.ui.view.MUTabPane; import com.metaui.fxbase.view.tree.MUTree; import javafx.collections.ListChangeListener; import javafx.geometry.Side; import javafx.scene.Node; import javafx.scene.Parent; import javafx.scene.control.ListView; import javafx.scene.control.Tab; import javafx.scene.layout.BorderPane; import org.controlsfx.control.MasterDetailPane; import java.util.HashMap; import java.util.List; import java.util.Map; /** * Tabs 桌面 * * @author wei_jc * @since 1.0.0 */ public class MUTabsDesktop extends BorderPane implements IDesktop { private AppModel app; private Map<String, Tab> tabCache = new HashMap<>(); protected MUTabPane tabPane; private MUTree navTree; private MasterDetailPane masterDetailPane; public MUTabsDesktop(AppModel app) { this.app = app; } @Override public void initUI() { masterDetailPane = new MasterDetailPane(Side.LEFT); masterDetailPane.setShowDetailNode(true); // 左边 masterDetailPane.setDetailNode(getLeftNode()); // 右边 createTabPane(); setCenter(masterDetailPane); } public Node getLeftNode() { return getNavTree(); } @Override public void initAfter() { } @Override public Parent getDesktop() { return this; } public MUTree getNavTree() { if (navTree == null) { navTree = new MUTree(); } return navTree; } private void createNavMenu() { ListView<NavMenuModel> listView = new ListView<>(); listView.itemsProperty().bind(app.navMenusProperty()); listView.setOnMouseClicked(event -> { NavMenuModel model = listView.getSelectionModel().getSelectedItem(); if (model == null) { return; } Tab tab = tabCache.get(model.getId()); if (tab == null) { tab = new Tab(); tab.idProperty().bind(model.idProperty()); tab.textProperty().bind(model.titleProperty()); // tab.setClosable(false); tab.setContent((Node) model.getView()); tabPane.getTabs().add(tab); tabCache.put(model.getId(), tab); } // 选择当前 tabPane.getSelectionModel().select(tab); }); this.setLeft(listView); } private void createTabPane() { tabPane = new MUTabPane(); Tab desktopTab = new Tab("桌面"); desktopTab.setClosable(false); tabPane.getTabs().add(desktopTab); // 监听tab删除,删除时从缓存中移除 tabPane.getTabs().addListener((ListChangeListener<Tab>) change -> { if(change.next() && change.wasRemoved()) { List<? extends Tab> removed = change.getRemoved(); if(removed.size() > 0) { for (Tab tab : removed) { tabCache.remove(tab.getId()); } } } }); masterDetailPane.setMasterNode(tabPane); } public void addTab(Tab tab) { if (tabCache.get(tab.getId()) == null) { tabPane.getTabs().add(tab); tabCache.put(tab.getId(), tab); } // 选择当前 tabPane.getSelectionModel().select(tab); } }
apache-2.0
NationalSecurityAgency/timely
server/src/main/java/timely/configuration/Configuration.java
3399
package timely.configuration; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import javax.validation.Valid; import org.springframework.boot.context.properties.ConfigurationProperties; import org.springframework.boot.context.properties.NestedConfigurationProperty; import org.springframework.stereotype.Component; import org.springframework.validation.annotation.Validated; @Validated @Component @ConfigurationProperties(prefix = "timely") public class Configuration { private String metricsTable = "timely.metrics"; private String metaTable = "timely.meta"; private HashMap<String, Integer> metricAgeOffDays = new HashMap<>(); private List<String> metricsReportIgnoredTags = new ArrayList<>(); private String instance = null; private String defaultVisibility = null; @Valid @NestedConfigurationProperty private Accumulo accumulo = new Accumulo(); @Valid @NestedConfigurationProperty private Security security = new Security(); @Valid @NestedConfigurationProperty private Server server = new Server(); @Valid @NestedConfigurationProperty private Http http = new Http(); @Valid @NestedConfigurationProperty private MetaCache metaCache = new MetaCache(); @Valid @NestedConfigurationProperty private Cache cache = new Cache(); @Valid @NestedConfigurationProperty private VisibilityCache visibilityCache = new VisibilityCache(); @Valid @NestedConfigurationProperty private Websocket websocket = new Websocket(); public String getMetricsTable() { return metricsTable; } public Configuration setMetricsTable(String metricsTable) { this.metricsTable = metricsTable; return this; } public String getMetaTable() { return metaTable; } public Configuration setMetaTable(String metaTable) { this.metaTable = metaTable; return this; } public void setInstance(String instance) { this.instance = instance; } public String getInstance() { return instance; } public String getDefaultVisibility() { return defaultVisibility; } public void setDefaultVisibility(String defaultVisibility) { this.defaultVisibility = defaultVisibility; } public HashMap<String, Integer> getMetricAgeOffDays() { return metricAgeOffDays; } public void setMetricAgeOffDays(HashMap<String, Integer> metricAgeOffDays) { this.metricAgeOffDays = metricAgeOffDays; } public List<String> getMetricsReportIgnoredTags() { return metricsReportIgnoredTags; } public Configuration setMetricsReportIgnoredTags(List<String> metricsReportIgnoredTags) { this.metricsReportIgnoredTags = metricsReportIgnoredTags; return this; } public Accumulo getAccumulo() { return accumulo; } public Security getSecurity() { return security; } public Server getServer() { return server; } public Http getHttp() { return http; } public Websocket getWebsocket() { return websocket; } public MetaCache getMetaCache() { return metaCache; } public Cache getCache() { return cache; } public VisibilityCache getVisibilityCache() { return visibilityCache; } }
apache-2.0
MICommunity/psi-jami
jami-mitab/src/main/java/psidev/psi/mi/jami/tab/io/writer/extended/Mitab26ModelledWriter.java
3389
package psidev.psi.mi.jami.tab.io.writer.extended; import psidev.psi.mi.jami.binary.ModelledBinaryInteraction; import psidev.psi.mi.jami.binary.expansion.ComplexExpansionMethod; import psidev.psi.mi.jami.model.ModelledInteraction; import psidev.psi.mi.jami.tab.MitabVersion; import java.io.File; import java.io.IOException; import java.io.OutputStream; import java.io.Writer; /** * Mitab 2.6 writer for Modelled interaction * * @author Marine Dumousseau ([email protected]) * @version $Id$ * @since <pre>20/06/13</pre> */ public class Mitab26ModelledWriter extends Mitab25ModelledWriter { /** * <p>Constructor for Mitab26ModelledWriter.</p> */ public Mitab26ModelledWriter() { super(); } /** * <p>Constructor for Mitab26ModelledWriter.</p> * * @param file a {@link java.io.File} object. * @throws java.io.IOException if any. */ public Mitab26ModelledWriter(File file) throws IOException { super(file); } /** * <p>Constructor for Mitab26ModelledWriter.</p> * * @param output a {@link java.io.OutputStream} object. */ public Mitab26ModelledWriter(OutputStream output) { super(output); } /** * <p>Constructor for Mitab26ModelledWriter.</p> * * @param writer a {@link java.io.Writer} object. */ public Mitab26ModelledWriter(Writer writer) { super(writer); } /** * <p>Constructor for Mitab26ModelledWriter.</p> * * @param file a {@link java.io.File} object. * @param expansionMethod a {@link psidev.psi.mi.jami.binary.expansion.ComplexExpansionMethod} object. * @throws java.io.IOException if any. */ public Mitab26ModelledWriter(File file, ComplexExpansionMethod<ModelledInteraction, ModelledBinaryInteraction> expansionMethod) throws IOException { super(file, expansionMethod); } /** * <p>Constructor for Mitab26ModelledWriter.</p> * * @param output a {@link java.io.OutputStream} object. * @param expansionMethod a {@link psidev.psi.mi.jami.binary.expansion.ComplexExpansionMethod} object. */ public Mitab26ModelledWriter(OutputStream output, ComplexExpansionMethod<ModelledInteraction, ModelledBinaryInteraction> expansionMethod) { super(output, expansionMethod); } /** * <p>Constructor for Mitab26ModelledWriter.</p> * * @param writer a {@link java.io.Writer} object. * @param expansionMethod a {@link psidev.psi.mi.jami.binary.expansion.ComplexExpansionMethod} object. */ public Mitab26ModelledWriter(Writer writer, ComplexExpansionMethod<ModelledInteraction, ModelledBinaryInteraction> expansionMethod) { super(writer, expansionMethod); } /** {@inheritDoc} */ @Override public MitabVersion getVersion() { return MitabVersion.v2_6; } /** {@inheritDoc} */ @Override protected void initialiseWriter(Writer writer){ setBinaryWriter(new Mitab26ModelledBinaryWriter(writer)); } /** {@inheritDoc} */ @Override protected void initialiseOutputStream(OutputStream output) { setBinaryWriter(new Mitab26ModelledBinaryWriter(output)); } /** {@inheritDoc} */ @Override protected void initialiseFile(File file) throws IOException { setBinaryWriter(new Mitab26ModelledBinaryWriter(file)); } }
apache-2.0
scalatest/scalatest-website
public/scaladoc/3.0.0/org/scalatest/FlatSpecLike$ItWord.html
37176
<!DOCTYPE html > <html> <head> <title>ItWord - ScalaTest 3.0.0 - org.scalatest.FlatSpecLike.ItWord</title> <meta name="description" content="ItWord - ScalaTest 3.0.0 - org.scalatest.FlatSpecLike.ItWord" /> <meta name="keywords" content="ItWord ScalaTest 3.0.0 org.scalatest.FlatSpecLike.ItWord" /> <meta http-equiv="content-type" content="text/html; charset=UTF-8" /> <link href="../../lib/template.css" media="screen" type="text/css" rel="stylesheet" /> <link href="../../lib/diagrams.css" media="screen" type="text/css" rel="stylesheet" id="diagrams-css" /> <script type="text/javascript" src="../../lib/jquery.js" id="jquery-js"></script> <script type="text/javascript" src="../../lib/jquery-ui.js"></script> <script type="text/javascript" src="../../lib/template.js"></script> <script type="text/javascript" src="../../lib/tools.tooltip.js"></script> <script type="text/javascript"> if(top === self) { var url = '../../index.html'; var hash = 'org.scalatest.FlatSpecLike$ItWord'; var anchor = window.location.hash; var anchor_opt = ''; if (anchor.length >= 1) anchor_opt = '@' + anchor.substring(1); window.location.href = url + '#' + hash + anchor_opt; } </script> </head> <body class="type"> <!-- Top of doc.scalatest.org [javascript] --> <script type="text/javascript"> var rnd = window.rnd || Math.floor(Math.random()*10e6); var pid204546 = window.pid204546 || rnd; var plc204546 = window.plc204546 || 0; var abkw = window.abkw || ''; var absrc = 'http://ab167933.adbutler-ikon.com/adserve/;ID=167933;size=468x60;setID=204546;type=js;sw='+screen.width+';sh='+screen.height+';spr='+window.devicePixelRatio+';kw='+abkw+';pid='+pid204546+';place='+(plc204546++)+';rnd='+rnd+';click=CLICK_MACRO_PLACEHOLDER'; document.write('<scr'+'ipt src="'+absrc+'" type="text/javascript"></scr'+'ipt>'); </script> <div id="definition"> <img alt="Class" src="../../lib/class_big.png" /> <p id="owner"><a href="../package.html" class="extype" name="org">org</a>.<a href="package.html" class="extype" name="org.scalatest">scalatest</a>.<a href="FlatSpecLike.html" class="extype" name="org.scalatest.FlatSpecLike">FlatSpecLike</a></p> <h1>ItWord</h1><h3><span class="morelinks"><div>Related Doc: <a href="FlatSpecLike.html" class="extype" name="org.scalatest.FlatSpecLike">package FlatSpecLike</a> </div></span></h3><span class="permalink"> <a href="../../index.html#org.scalatest.FlatSpecLike$ItWord" title="Permalink" target="_top"> <img src="../../lib/permalink.png" alt="Permalink" /> </a> </span> </div> <h4 id="signature" class="signature"> <span class="modifier_kind"> <span class="modifier">final </span> <span class="kind">class</span> </span> <span class="symbol"> <span class="name">ItWord</span><span class="result"> extends <span class="extype" name="scala.AnyRef">AnyRef</span></span> </span> </h4> <div id="comment" class="fullcommenttop"><div class="comment cmt"><p>Class that supports test (and shared test) registration via the instance referenced from <code>FlatSpec</code>'s <code>it</code> field.</p><p>This class enables syntax such as the following test registration:</p><p><pre class="stHighlighted"> it should <span class="stQuotedString">"pop values in last-in-first-out order"</span> in { ... } ^ </pre></p><p>It also enables syntax such as the following shared test registration:</p><p><pre class="stHighlighted"> it should behave like nonEmptyStack(lastItemPushed) ^ </pre></p><p>For more information and examples of the use of the <code>it</code> field, see the main documentation for this trait.</p></div><dl class="attributes block"> <dt>Attributes</dt><dd>protected </dd><dt>Source</dt><dd><a href="https://github.com/scalatest/scalatest/tree/release-3.0.0/scalatest//src/main/scala/org/scalatest/FlatSpecLike.scala" target="_blank">FlatSpecLike.scala</a></dd></dl><div class="toggleContainer block"> <span class="toggle">Linear Supertypes</span> <div class="superTypes hiddenContent"><span class="extype" name="scala.AnyRef">AnyRef</span>, <span class="extype" name="scala.Any">Any</span></div> </div></div> <div id="mbrsel"> <div id="textfilter"><span class="pre"></span><span class="input"><input id="mbrsel-input" type="text" accesskey="/" /></span><span class="post"></span></div> <div id="order"> <span class="filtertype">Ordering</span> <ol> <li class="alpha in"><span>Alphabetic</span></li> <li class="inherit out"><span>By Inheritance</span></li> </ol> </div> <div id="ancestors"> <span class="filtertype">Inherited<br /> </span> <ol id="linearization"> <li class="in" name="org.scalatest.FlatSpecLike.ItWord"><span>ItWord</span></li><li class="in" name="scala.AnyRef"><span>AnyRef</span></li><li class="in" name="scala.Any"><span>Any</span></li> </ol> </div><div id="ancestors"> <span class="filtertype"></span> <ol> <li class="hideall out"><span>Hide All</span></li> <li class="showall in"><span>Show All</span></li> </ol> </div> <div id="visbl"> <span class="filtertype">Visibility</span> <ol><li class="public in"><span>Public</span></li><li class="all out"><span>All</span></li></ol> </div> </div> <div id="template"> <div id="allMembers"> <div id="constructors" class="members"> <h3>Instance Constructors</h3> <ol><li name="org.scalatest.FlatSpecLike.ItWord#&lt;init&gt;" visbl="pub" data-isabs="false" fullComment="no" group="Ungrouped"> <a id="&lt;init&gt;():FlatSpecLike.this.ItWord"></a> <a id="&lt;init&gt;:ItWord"></a> <h4 class="signature"> <span class="modifier_kind"> <span class="modifier"></span> <span class="kind">new</span> </span> <span class="symbol"> <span class="name">ItWord</span><span class="params">()</span> </span> </h4><span class="permalink"> <a href="../../index.html#org.scalatest.FlatSpecLike$ItWord@&lt;init&gt;():FlatSpecLike.this.ItWord" title="Permalink" target="_top"> <img src="../../lib/permalink.png" alt="Permalink" /> </a> </span> </li></ol> </div> <div id="values" class="values members"> <h3>Value Members</h3> <ol><li name="scala.AnyRef#!=" visbl="pub" data-isabs="false" fullComment="yes" group="Ungrouped"> <a id="!=(x$1:Any):Boolean"></a> <a id="!=(Any):Boolean"></a> <h4 class="signature"> <span class="modifier_kind"> <span class="modifier">final </span> <span class="kind">def</span> </span> <span class="symbol"> <span title="gt4s: $bang$eq" class="name">!=</span><span class="params">(<span name="arg0">arg0: <span class="extype" name="scala.Any">Any</span></span>)</span><span class="result">: <span class="extype" name="scala.Boolean">Boolean</span></span> </span> </h4><span class="permalink"> <a href="../../index.html#org.scalatest.FlatSpecLike$ItWord@!=(x$1:Any):Boolean" title="Permalink" target="_top"> <img src="../../lib/permalink.png" alt="Permalink" /> </a> </span> <div class="fullcomment"><dl class="attributes block"> <dt>Definition Classes</dt><dd>AnyRef → Any</dd></dl></div> </li><li name="scala.AnyRef###" visbl="pub" data-isabs="false" fullComment="yes" group="Ungrouped"> <a id="##():Int"></a> <a id="##():Int"></a> <h4 class="signature"> <span class="modifier_kind"> <span class="modifier">final </span> <span class="kind">def</span> </span> <span class="symbol"> <span title="gt4s: $hash$hash" class="name">##</span><span class="params">()</span><span class="result">: <span class="extype" name="scala.Int">Int</span></span> </span> </h4><span class="permalink"> <a href="../../index.html#org.scalatest.FlatSpecLike$ItWord@##():Int" title="Permalink" target="_top"> <img src="../../lib/permalink.png" alt="Permalink" /> </a> </span> <div class="fullcomment"><dl class="attributes block"> <dt>Definition Classes</dt><dd>AnyRef → Any</dd></dl></div> </li><li name="scala.AnyRef#==" visbl="pub" data-isabs="false" fullComment="yes" group="Ungrouped"> <a id="==(x$1:Any):Boolean"></a> <a id="==(Any):Boolean"></a> <h4 class="signature"> <span class="modifier_kind"> <span class="modifier">final </span> <span class="kind">def</span> </span> <span class="symbol"> <span title="gt4s: $eq$eq" class="name">==</span><span class="params">(<span name="arg0">arg0: <span class="extype" name="scala.Any">Any</span></span>)</span><span class="result">: <span class="extype" name="scala.Boolean">Boolean</span></span> </span> </h4><span class="permalink"> <a href="../../index.html#org.scalatest.FlatSpecLike$ItWord@==(x$1:Any):Boolean" title="Permalink" target="_top"> <img src="../../lib/permalink.png" alt="Permalink" /> </a> </span> <div class="fullcomment"><dl class="attributes block"> <dt>Definition Classes</dt><dd>AnyRef → Any</dd></dl></div> </li><li name="scala.Any#asInstanceOf" visbl="pub" data-isabs="false" fullComment="yes" group="Ungrouped"> <a id="asInstanceOf[T0]:T0"></a> <a id="asInstanceOf[T0]:T0"></a> <h4 class="signature"> <span class="modifier_kind"> <span class="modifier">final </span> <span class="kind">def</span> </span> <span class="symbol"> <span class="name">asInstanceOf</span><span class="tparams">[<span name="T0">T0</span>]</span><span class="result">: <span class="extype" name="scala.Any.asInstanceOf.T0">T0</span></span> </span> </h4><span class="permalink"> <a href="../../index.html#org.scalatest.FlatSpecLike$ItWord@asInstanceOf[T0]:T0" title="Permalink" target="_top"> <img src="../../lib/permalink.png" alt="Permalink" /> </a> </span> <div class="fullcomment"><dl class="attributes block"> <dt>Definition Classes</dt><dd>Any</dd></dl></div> </li><li name="org.scalatest.FlatSpecLike.ItWord#can" visbl="pub" data-isabs="false" fullComment="yes" group="Ungrouped"> <a id="can(behaveWord:org.scalatest.words.BehaveWord):org.scalatest.words.BehaveWord"></a> <a id="can(BehaveWord):BehaveWord"></a> <h4 class="signature"> <span class="modifier_kind"> <span class="modifier"></span> <span class="kind">def</span> </span> <span class="symbol"> <span class="name">can</span><span class="params">(<span name="behaveWord">behaveWord: <a href="words/BehaveWord.html" class="extype" name="org.scalatest.words.BehaveWord">BehaveWord</a></span>)</span><span class="result">: <a href="words/BehaveWord.html" class="extype" name="org.scalatest.words.BehaveWord">BehaveWord</a></span> </span> </h4><span class="permalink"> <a href="../../index.html#org.scalatest.FlatSpecLike$ItWord@can(behaveWord:org.scalatest.words.BehaveWord):org.scalatest.words.BehaveWord" title="Permalink" target="_top"> <img src="../../lib/permalink.png" alt="Permalink" /> </a> </span> <p class="shortcomment cmt">Supports the registration of shared tests with <code>can</code> in a <code>FlatSpec</code>.</code></code></p><div class="fullcomment"><div class="comment cmt"><p>Supports the registration of shared tests with <code>can</code> in a <code>FlatSpec</code>.</p><p>This method supports syntax such as the following:</p><p><pre class="stHighlighted"> it can behave like nonFullStack(stackWithOneItem) ^ </pre></p><p>For examples of shared tests, see the <a href="FlatSpec.html#sharedTests">Shared tests section</a> in the main documentation for trait <code>FlatSpec</code>.</p></div></div> </li><li name="org.scalatest.FlatSpecLike.ItWord#can" visbl="pub" data-isabs="false" fullComment="yes" group="Ungrouped"> <a id="can(string:String):FlatSpecLike.this.ItVerbString"></a> <a id="can(String):ItVerbString"></a> <h4 class="signature"> <span class="modifier_kind"> <span class="modifier"></span> <span class="kind">def</span> </span> <span class="symbol"> <span class="name">can</span><span class="params">(<span name="string">string: <span class="extype" name="scala.Predef.String">String</span></span>)</span><span class="result">: <a href="FlatSpecLike$ItVerbString.html" class="extype" name="org.scalatest.FlatSpecLike.ItVerbString">ItVerbString</a></span> </span> </h4><span class="permalink"> <a href="../../index.html#org.scalatest.FlatSpecLike$ItWord@can(string:String):FlatSpecLike.this.ItVerbString" title="Permalink" target="_top"> <img src="../../lib/permalink.png" alt="Permalink" /> </a> </span> <p class="shortcomment cmt">Supports the registration of tests with <code>can</code> in a <code>FlatSpec</code>.</code></code></p><div class="fullcomment"><div class="comment cmt"><p>Supports the registration of tests with <code>can</code> in a <code>FlatSpec</code>.</p><p>This method supports syntax such as the following:</p><p><pre class="stHighlighted"> it can <span class="stQuotedString">"pop values in last-in-first-out order"</span> in { ... } ^ </pre></p><p>For examples of test registration, see the <a href="FlatSpec.html">main documentation</a> for trait <code>FlatSpec</code>.</p></div></div> </li><li name="scala.AnyRef#clone" visbl="prt" data-isabs="false" fullComment="yes" group="Ungrouped"> <a id="clone():Object"></a> <a id="clone():AnyRef"></a> <h4 class="signature"> <span class="modifier_kind"> <span class="modifier"></span> <span class="kind">def</span> </span> <span class="symbol"> <span class="name">clone</span><span class="params">()</span><span class="result">: <span class="extype" name="scala.AnyRef">AnyRef</span></span> </span> </h4><span class="permalink"> <a href="../../index.html#org.scalatest.FlatSpecLike$ItWord@clone():Object" title="Permalink" target="_top"> <img src="../../lib/permalink.png" alt="Permalink" /> </a> </span> <div class="fullcomment"><dl class="attributes block"> <dt>Attributes</dt><dd>protected[<a href="../../java$lang.html" class="extype" name="java.lang">java.lang</a>] </dd><dt>Definition Classes</dt><dd>AnyRef</dd><dt>Annotations</dt><dd> <span class="name">@throws</span><span class="args">(<span> <span class="defval" name="classOf[java.lang.CloneNotSupportedException]">...</span> </span>)</span> </dd></dl></div> </li><li name="scala.AnyRef#eq" visbl="pub" data-isabs="false" fullComment="yes" group="Ungrouped"> <a id="eq(x$1:AnyRef):Boolean"></a> <a id="eq(AnyRef):Boolean"></a> <h4 class="signature"> <span class="modifier_kind"> <span class="modifier">final </span> <span class="kind">def</span> </span> <span class="symbol"> <span class="name">eq</span><span class="params">(<span name="arg0">arg0: <span class="extype" name="scala.AnyRef">AnyRef</span></span>)</span><span class="result">: <span class="extype" name="scala.Boolean">Boolean</span></span> </span> </h4><span class="permalink"> <a href="../../index.html#org.scalatest.FlatSpecLike$ItWord@eq(x$1:AnyRef):Boolean" title="Permalink" target="_top"> <img src="../../lib/permalink.png" alt="Permalink" /> </a> </span> <div class="fullcomment"><dl class="attributes block"> <dt>Definition Classes</dt><dd>AnyRef</dd></dl></div> </li><li name="scala.AnyRef#equals" visbl="pub" data-isabs="false" fullComment="yes" group="Ungrouped"> <a id="equals(x$1:Any):Boolean"></a> <a id="equals(Any):Boolean"></a> <h4 class="signature"> <span class="modifier_kind"> <span class="modifier"></span> <span class="kind">def</span> </span> <span class="symbol"> <span class="name">equals</span><span class="params">(<span name="arg0">arg0: <span class="extype" name="scala.Any">Any</span></span>)</span><span class="result">: <span class="extype" name="scala.Boolean">Boolean</span></span> </span> </h4><span class="permalink"> <a href="../../index.html#org.scalatest.FlatSpecLike$ItWord@equals(x$1:Any):Boolean" title="Permalink" target="_top"> <img src="../../lib/permalink.png" alt="Permalink" /> </a> </span> <div class="fullcomment"><dl class="attributes block"> <dt>Definition Classes</dt><dd>AnyRef → Any</dd></dl></div> </li><li name="scala.AnyRef#finalize" visbl="prt" data-isabs="false" fullComment="yes" group="Ungrouped"> <a id="finalize():Unit"></a> <a id="finalize():Unit"></a> <h4 class="signature"> <span class="modifier_kind"> <span class="modifier"></span> <span class="kind">def</span> </span> <span class="symbol"> <span class="name">finalize</span><span class="params">()</span><span class="result">: <span class="extype" name="scala.Unit">Unit</span></span> </span> </h4><span class="permalink"> <a href="../../index.html#org.scalatest.FlatSpecLike$ItWord@finalize():Unit" title="Permalink" target="_top"> <img src="../../lib/permalink.png" alt="Permalink" /> </a> </span> <div class="fullcomment"><dl class="attributes block"> <dt>Attributes</dt><dd>protected[<a href="../../java$lang.html" class="extype" name="java.lang">java.lang</a>] </dd><dt>Definition Classes</dt><dd>AnyRef</dd><dt>Annotations</dt><dd> <span class="name">@throws</span><span class="args">(<span> <span class="symbol">classOf[java.lang.Throwable]</span> </span>)</span> </dd></dl></div> </li><li name="scala.AnyRef#getClass" visbl="pub" data-isabs="false" fullComment="yes" group="Ungrouped"> <a id="getClass():Class[_]"></a> <a id="getClass():Class[_]"></a> <h4 class="signature"> <span class="modifier_kind"> <span class="modifier">final </span> <span class="kind">def</span> </span> <span class="symbol"> <span class="name">getClass</span><span class="params">()</span><span class="result">: <span class="extype" name="java.lang.Class">Class</span>[_]</span> </span> </h4><span class="permalink"> <a href="../../index.html#org.scalatest.FlatSpecLike$ItWord@getClass():Class[_]" title="Permalink" target="_top"> <img src="../../lib/permalink.png" alt="Permalink" /> </a> </span> <div class="fullcomment"><dl class="attributes block"> <dt>Definition Classes</dt><dd>AnyRef → Any</dd></dl></div> </li><li name="scala.AnyRef#hashCode" visbl="pub" data-isabs="false" fullComment="yes" group="Ungrouped"> <a id="hashCode():Int"></a> <a id="hashCode():Int"></a> <h4 class="signature"> <span class="modifier_kind"> <span class="modifier"></span> <span class="kind">def</span> </span> <span class="symbol"> <span class="name">hashCode</span><span class="params">()</span><span class="result">: <span class="extype" name="scala.Int">Int</span></span> </span> </h4><span class="permalink"> <a href="../../index.html#org.scalatest.FlatSpecLike$ItWord@hashCode():Int" title="Permalink" target="_top"> <img src="../../lib/permalink.png" alt="Permalink" /> </a> </span> <div class="fullcomment"><dl class="attributes block"> <dt>Definition Classes</dt><dd>AnyRef → Any</dd></dl></div> </li><li name="scala.Any#isInstanceOf" visbl="pub" data-isabs="false" fullComment="yes" group="Ungrouped"> <a id="isInstanceOf[T0]:Boolean"></a> <a id="isInstanceOf[T0]:Boolean"></a> <h4 class="signature"> <span class="modifier_kind"> <span class="modifier">final </span> <span class="kind">def</span> </span> <span class="symbol"> <span class="name">isInstanceOf</span><span class="tparams">[<span name="T0">T0</span>]</span><span class="result">: <span class="extype" name="scala.Boolean">Boolean</span></span> </span> </h4><span class="permalink"> <a href="../../index.html#org.scalatest.FlatSpecLike$ItWord@isInstanceOf[T0]:Boolean" title="Permalink" target="_top"> <img src="../../lib/permalink.png" alt="Permalink" /> </a> </span> <div class="fullcomment"><dl class="attributes block"> <dt>Definition Classes</dt><dd>Any</dd></dl></div> </li><li name="org.scalatest.FlatSpecLike.ItWord#must" visbl="pub" data-isabs="false" fullComment="yes" group="Ungrouped"> <a id="must(behaveWord:org.scalatest.words.BehaveWord):org.scalatest.words.BehaveWord"></a> <a id="must(BehaveWord):BehaveWord"></a> <h4 class="signature"> <span class="modifier_kind"> <span class="modifier"></span> <span class="kind">def</span> </span> <span class="symbol"> <span class="name">must</span><span class="params">(<span name="behaveWord">behaveWord: <a href="words/BehaveWord.html" class="extype" name="org.scalatest.words.BehaveWord">BehaveWord</a></span>)</span><span class="result">: <a href="words/BehaveWord.html" class="extype" name="org.scalatest.words.BehaveWord">BehaveWord</a></span> </span> </h4><span class="permalink"> <a href="../../index.html#org.scalatest.FlatSpecLike$ItWord@must(behaveWord:org.scalatest.words.BehaveWord):org.scalatest.words.BehaveWord" title="Permalink" target="_top"> <img src="../../lib/permalink.png" alt="Permalink" /> </a> </span> <p class="shortcomment cmt">Supports the registration of shared tests with <code>must</code> in a <code>FlatSpec</code>.</code></code></p><div class="fullcomment"><div class="comment cmt"><p>Supports the registration of shared tests with <code>must</code> in a <code>FlatSpec</code>.</p><p>This method supports syntax such as the following:</p><p><pre class="stHighlighted"> it must behave like nonFullStack(stackWithOneItem) ^ </pre></p><p>For examples of shared tests, see the <a href="FlatSpec.html#sharedTests">Shared tests section</a> in the main documentation for trait <code>FlatSpec</code>.</p></div></div> </li><li name="org.scalatest.FlatSpecLike.ItWord#must" visbl="pub" data-isabs="false" fullComment="yes" group="Ungrouped"> <a id="must(string:String):FlatSpecLike.this.ItVerbString"></a> <a id="must(String):ItVerbString"></a> <h4 class="signature"> <span class="modifier_kind"> <span class="modifier"></span> <span class="kind">def</span> </span> <span class="symbol"> <span class="name">must</span><span class="params">(<span name="string">string: <span class="extype" name="scala.Predef.String">String</span></span>)</span><span class="result">: <a href="FlatSpecLike$ItVerbString.html" class="extype" name="org.scalatest.FlatSpecLike.ItVerbString">ItVerbString</a></span> </span> </h4><span class="permalink"> <a href="../../index.html#org.scalatest.FlatSpecLike$ItWord@must(string:String):FlatSpecLike.this.ItVerbString" title="Permalink" target="_top"> <img src="../../lib/permalink.png" alt="Permalink" /> </a> </span> <p class="shortcomment cmt">Supports the registration of tests with <code>must</code> in a <code>FlatSpec</code>.</code></code></p><div class="fullcomment"><div class="comment cmt"><p>Supports the registration of tests with <code>must</code> in a <code>FlatSpec</code>.</p><p>This method supports syntax such as the following:</p><p><pre class="stHighlighted"> it must <span class="stQuotedString">"pop values in last-in-first-out order"</span> in { ... } ^ </pre></p><p>For examples of test registration, see the <a href="FlatSpec.html">main documentation</a> for trait <code>FlatSpec</code>.</p></div></div> </li><li name="scala.AnyRef#ne" visbl="pub" data-isabs="false" fullComment="yes" group="Ungrouped"> <a id="ne(x$1:AnyRef):Boolean"></a> <a id="ne(AnyRef):Boolean"></a> <h4 class="signature"> <span class="modifier_kind"> <span class="modifier">final </span> <span class="kind">def</span> </span> <span class="symbol"> <span class="name">ne</span><span class="params">(<span name="arg0">arg0: <span class="extype" name="scala.AnyRef">AnyRef</span></span>)</span><span class="result">: <span class="extype" name="scala.Boolean">Boolean</span></span> </span> </h4><span class="permalink"> <a href="../../index.html#org.scalatest.FlatSpecLike$ItWord@ne(x$1:AnyRef):Boolean" title="Permalink" target="_top"> <img src="../../lib/permalink.png" alt="Permalink" /> </a> </span> <div class="fullcomment"><dl class="attributes block"> <dt>Definition Classes</dt><dd>AnyRef</dd></dl></div> </li><li name="scala.AnyRef#notify" visbl="pub" data-isabs="false" fullComment="yes" group="Ungrouped"> <a id="notify():Unit"></a> <a id="notify():Unit"></a> <h4 class="signature"> <span class="modifier_kind"> <span class="modifier">final </span> <span class="kind">def</span> </span> <span class="symbol"> <span class="name">notify</span><span class="params">()</span><span class="result">: <span class="extype" name="scala.Unit">Unit</span></span> </span> </h4><span class="permalink"> <a href="../../index.html#org.scalatest.FlatSpecLike$ItWord@notify():Unit" title="Permalink" target="_top"> <img src="../../lib/permalink.png" alt="Permalink" /> </a> </span> <div class="fullcomment"><dl class="attributes block"> <dt>Definition Classes</dt><dd>AnyRef</dd></dl></div> </li><li name="scala.AnyRef#notifyAll" visbl="pub" data-isabs="false" fullComment="yes" group="Ungrouped"> <a id="notifyAll():Unit"></a> <a id="notifyAll():Unit"></a> <h4 class="signature"> <span class="modifier_kind"> <span class="modifier">final </span> <span class="kind">def</span> </span> <span class="symbol"> <span class="name">notifyAll</span><span class="params">()</span><span class="result">: <span class="extype" name="scala.Unit">Unit</span></span> </span> </h4><span class="permalink"> <a href="../../index.html#org.scalatest.FlatSpecLike$ItWord@notifyAll():Unit" title="Permalink" target="_top"> <img src="../../lib/permalink.png" alt="Permalink" /> </a> </span> <div class="fullcomment"><dl class="attributes block"> <dt>Definition Classes</dt><dd>AnyRef</dd></dl></div> </li><li name="org.scalatest.FlatSpecLike.ItWord#should" visbl="pub" data-isabs="false" fullComment="yes" group="Ungrouped"> <a id="should(behaveWord:org.scalatest.words.BehaveWord):org.scalatest.words.BehaveWord"></a> <a id="should(BehaveWord):BehaveWord"></a> <h4 class="signature"> <span class="modifier_kind"> <span class="modifier"></span> <span class="kind">def</span> </span> <span class="symbol"> <span class="name">should</span><span class="params">(<span name="behaveWord">behaveWord: <a href="words/BehaveWord.html" class="extype" name="org.scalatest.words.BehaveWord">BehaveWord</a></span>)</span><span class="result">: <a href="words/BehaveWord.html" class="extype" name="org.scalatest.words.BehaveWord">BehaveWord</a></span> </span> </h4><span class="permalink"> <a href="../../index.html#org.scalatest.FlatSpecLike$ItWord@should(behaveWord:org.scalatest.words.BehaveWord):org.scalatest.words.BehaveWord" title="Permalink" target="_top"> <img src="../../lib/permalink.png" alt="Permalink" /> </a> </span> <p class="shortcomment cmt">Supports the registration of shared tests with <code>should</code> in a <code>FlatSpec</code>.</code></code></p><div class="fullcomment"><div class="comment cmt"><p>Supports the registration of shared tests with <code>should</code> in a <code>FlatSpec</code>.</p><p>This method supports syntax such as the following:</p><p><pre class="stHighlighted"> it should behave like nonFullStack(stackWithOneItem) ^ </pre></p><p>For examples of shared tests, see the <a href="FlatSpec.html#sharedTests">Shared tests section</a> in the main documentation for trait <code>FlatSpec</code>.</p></div></div> </li><li name="org.scalatest.FlatSpecLike.ItWord#should" visbl="pub" data-isabs="false" fullComment="yes" group="Ungrouped"> <a id="should(string:String):FlatSpecLike.this.ItVerbString"></a> <a id="should(String):ItVerbString"></a> <h4 class="signature"> <span class="modifier_kind"> <span class="modifier"></span> <span class="kind">def</span> </span> <span class="symbol"> <span class="name">should</span><span class="params">(<span name="string">string: <span class="extype" name="scala.Predef.String">String</span></span>)</span><span class="result">: <a href="FlatSpecLike$ItVerbString.html" class="extype" name="org.scalatest.FlatSpecLike.ItVerbString">ItVerbString</a></span> </span> </h4><span class="permalink"> <a href="../../index.html#org.scalatest.FlatSpecLike$ItWord@should(string:String):FlatSpecLike.this.ItVerbString" title="Permalink" target="_top"> <img src="../../lib/permalink.png" alt="Permalink" /> </a> </span> <p class="shortcomment cmt">Supports the registration of tests with <code>should</code> in a <code>FlatSpec</code>.</code></code></p><div class="fullcomment"><div class="comment cmt"><p>Supports the registration of tests with <code>should</code> in a <code>FlatSpec</code>.</p><p>This method supports syntax such as the following:</p><p><pre class="stHighlighted"> it should <span class="stQuotedString">"pop values in last-in-first-out order"</span> in { ... } ^ </pre></p><p>For examples of test registration, see the <a href="FlatSpec.html">main documentation</a> for trait <code>FlatSpec</code>.</p></div></div> </li><li name="scala.AnyRef#synchronized" visbl="pub" data-isabs="false" fullComment="yes" group="Ungrouped"> <a id="synchronized[T0](x$1:=&gt;T0):T0"></a> <a id="synchronized[T0](⇒T0):T0"></a> <h4 class="signature"> <span class="modifier_kind"> <span class="modifier">final </span> <span class="kind">def</span> </span> <span class="symbol"> <span class="name">synchronized</span><span class="tparams">[<span name="T0">T0</span>]</span><span class="params">(<span name="arg0">arg0: ⇒ <span class="extype" name="java.lang.AnyRef.synchronized.T0">T0</span></span>)</span><span class="result">: <span class="extype" name="java.lang.AnyRef.synchronized.T0">T0</span></span> </span> </h4><span class="permalink"> <a href="../../index.html#org.scalatest.FlatSpecLike$ItWord@synchronized[T0](x$1:=&gt;T0):T0" title="Permalink" target="_top"> <img src="../../lib/permalink.png" alt="Permalink" /> </a> </span> <div class="fullcomment"><dl class="attributes block"> <dt>Definition Classes</dt><dd>AnyRef</dd></dl></div> </li><li name="scala.AnyRef#toString" visbl="pub" data-isabs="false" fullComment="yes" group="Ungrouped"> <a id="toString():String"></a> <a id="toString():String"></a> <h4 class="signature"> <span class="modifier_kind"> <span class="modifier"></span> <span class="kind">def</span> </span> <span class="symbol"> <span class="name">toString</span><span class="params">()</span><span class="result">: <span class="extype" name="java.lang.String">String</span></span> </span> </h4><span class="permalink"> <a href="../../index.html#org.scalatest.FlatSpecLike$ItWord@toString():String" title="Permalink" target="_top"> <img src="../../lib/permalink.png" alt="Permalink" /> </a> </span> <div class="fullcomment"><dl class="attributes block"> <dt>Definition Classes</dt><dd>AnyRef → Any</dd></dl></div> </li><li name="scala.AnyRef#wait" visbl="pub" data-isabs="false" fullComment="yes" group="Ungrouped"> <a id="wait():Unit"></a> <a id="wait():Unit"></a> <h4 class="signature"> <span class="modifier_kind"> <span class="modifier">final </span> <span class="kind">def</span> </span> <span class="symbol"> <span class="name">wait</span><span class="params">()</span><span class="result">: <span class="extype" name="scala.Unit">Unit</span></span> </span> </h4><span class="permalink"> <a href="../../index.html#org.scalatest.FlatSpecLike$ItWord@wait():Unit" title="Permalink" target="_top"> <img src="../../lib/permalink.png" alt="Permalink" /> </a> </span> <div class="fullcomment"><dl class="attributes block"> <dt>Definition Classes</dt><dd>AnyRef</dd><dt>Annotations</dt><dd> <span class="name">@throws</span><span class="args">(<span> <span class="defval" name="classOf[java.lang.InterruptedException]">...</span> </span>)</span> </dd></dl></div> </li><li name="scala.AnyRef#wait" visbl="pub" data-isabs="false" fullComment="yes" group="Ungrouped"> <a id="wait(x$1:Long,x$2:Int):Unit"></a> <a id="wait(Long,Int):Unit"></a> <h4 class="signature"> <span class="modifier_kind"> <span class="modifier">final </span> <span class="kind">def</span> </span> <span class="symbol"> <span class="name">wait</span><span class="params">(<span name="arg0">arg0: <span class="extype" name="scala.Long">Long</span></span>, <span name="arg1">arg1: <span class="extype" name="scala.Int">Int</span></span>)</span><span class="result">: <span class="extype" name="scala.Unit">Unit</span></span> </span> </h4><span class="permalink"> <a href="../../index.html#org.scalatest.FlatSpecLike$ItWord@wait(x$1:Long,x$2:Int):Unit" title="Permalink" target="_top"> <img src="../../lib/permalink.png" alt="Permalink" /> </a> </span> <div class="fullcomment"><dl class="attributes block"> <dt>Definition Classes</dt><dd>AnyRef</dd><dt>Annotations</dt><dd> <span class="name">@throws</span><span class="args">(<span> <span class="defval" name="classOf[java.lang.InterruptedException]">...</span> </span>)</span> </dd></dl></div> </li><li name="scala.AnyRef#wait" visbl="pub" data-isabs="false" fullComment="yes" group="Ungrouped"> <a id="wait(x$1:Long):Unit"></a> <a id="wait(Long):Unit"></a> <h4 class="signature"> <span class="modifier_kind"> <span class="modifier">final </span> <span class="kind">def</span> </span> <span class="symbol"> <span class="name">wait</span><span class="params">(<span name="arg0">arg0: <span class="extype" name="scala.Long">Long</span></span>)</span><span class="result">: <span class="extype" name="scala.Unit">Unit</span></span> </span> </h4><span class="permalink"> <a href="../../index.html#org.scalatest.FlatSpecLike$ItWord@wait(x$1:Long):Unit" title="Permalink" target="_top"> <img src="../../lib/permalink.png" alt="Permalink" /> </a> </span> <div class="fullcomment"><dl class="attributes block"> <dt>Definition Classes</dt><dd>AnyRef</dd><dt>Annotations</dt><dd> <span class="name">@throws</span><span class="args">(<span> <span class="defval" name="classOf[java.lang.InterruptedException]">...</span> </span>)</span> </dd></dl></div> </li></ol> </div> </div> <div id="inheritedMembers"> <div class="parent" name="scala.AnyRef"> <h3>Inherited from <span class="extype" name="scala.AnyRef">AnyRef</span></h3> </div><div class="parent" name="scala.Any"> <h3>Inherited from <span class="extype" name="scala.Any">Any</span></h3> </div> </div> <div id="groupedMembers"> <div class="group" name="Ungrouped"> <h3>Ungrouped</h3> </div> </div> </div> <div id="tooltip"></div> <div id="footer"> </div> </body> </html>
apache-2.0
qinjin/mdtc-cassandra
src/java/org/apache/cassandra/io/sstable/SSTableDeletingTask.java
4449
/* * 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.cassandra.io.sstable; import java.io.File; import java.util.Collections; import java.util.Set; import java.util.concurrent.CopyOnWriteArraySet; import java.util.concurrent.TimeUnit; import com.google.common.collect.Sets; import org.apache.cassandra.io.sstable.format.SSTableReader; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.apache.cassandra.db.DataTracker; import org.apache.cassandra.db.SystemKeyspace; import org.apache.cassandra.service.StorageService; import org.apache.cassandra.utils.FBUtilities; public class SSTableDeletingTask implements Runnable { private static final Logger logger = LoggerFactory.getLogger(SSTableDeletingTask.class); // Deleting sstables is tricky because the mmapping might not have been finalized yet, // and delete will fail (on Windows) until it is (we only force the unmapping on SUN VMs). // Additionally, we need to make sure to delete the data file first, so on restart the others // will be recognized as GCable. private static final Set<SSTableDeletingTask> failedTasks = new CopyOnWriteArraySet<SSTableDeletingTask>(); private final SSTableReader referent; private final Descriptor desc; private final Set<Component> components; private DataTracker tracker; public SSTableDeletingTask(SSTableReader referent) { this.referent = referent; if (referent.openReason == SSTableReader.OpenReason.EARLY) { this.desc = referent.descriptor.asType(Descriptor.Type.TEMPLINK); this.components = Sets.newHashSet(Component.DATA, Component.PRIMARY_INDEX); } else { this.desc = referent.descriptor; this.components = referent.components; } } public void setTracker(DataTracker tracker) { this.tracker = tracker; } public void schedule() { StorageService.tasks.submit(this); } public void run() { long size = referent.bytesOnDisk(); if (tracker != null) tracker.notifyDeleting(referent); if (referent.readMeter != null) SystemKeyspace.clearSSTableReadMeter(referent.getKeyspaceName(), referent.getColumnFamilyName(), referent.descriptor.generation); // If we can't successfully delete the DATA component, set the task to be retried later: see above File datafile = new File(desc.filenameFor(Component.DATA)); if (!datafile.delete()) { logger.error("Unable to delete {} (it will be removed on server restart; we'll also retry after GC)", datafile); failedTasks.add(this); return; } // let the remainder be cleaned up by delete SSTable.delete(desc, Sets.difference(components, Collections.singleton(Component.DATA))); if (tracker != null) tracker.spaceReclaimed(size); } /** * Retry all deletions that failed the first time around (presumably b/c the sstable was still mmap'd.) * Useful because there are times when we know GC has been invoked; also exposed as an mbean. */ public static void rescheduleFailedTasks() { for (SSTableDeletingTask task : failedTasks) { failedTasks.remove(task); task.schedule(); } } /** for tests */ public static void waitForDeletions() { Runnable runnable = new Runnable() { public void run() { } }; FBUtilities.waitOnFuture(StorageService.tasks.schedule(runnable, 0, TimeUnit.MILLISECONDS)); } }
apache-2.0
jamesmundy/Xamarin.AndroidSVG
README.md
124
Xamarin.AndroidSVG ================== Xamarin Bindings for the [AndroidSVG Library](https://code.google.com/p/androidsvg/)
apache-2.0
headwirecom/aem-ide-tooling-4-intellij
src/main/java/com/headwire/aem/tooling/intellij/config/ModuleManagerImpl.java
13569
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ package com.headwire.aem.tooling.intellij.config; import com.headwire.aem.tooling.intellij.facet.SlingModuleExtensionProperties.ModuleType; import com.headwire.aem.tooling.intellij.facet.SlingModuleFacet; import com.headwire.aem.tooling.intellij.facet.SlingModuleFacetConfiguration; import com.headwire.aem.tooling.intellij.util.ComponentProvider; import com.intellij.openapi.components.AbstractProjectComponent; import com.intellij.openapi.diagnostic.Logger; import com.intellij.openapi.module.Module; import com.intellij.openapi.project.Project; import com.intellij.openapi.vfs.VirtualFile; import org.jetbrains.annotations.NotNull; import org.jetbrains.idea.maven.project.MavenProject; import org.jetbrains.idea.maven.project.MavenProjectsManager; import java.util.ArrayList; import java.util.List; /** * Created by schaefa on 3/18/16. */ public class ModuleManagerImpl extends AbstractProjectComponent implements ModuleManager { private static final Logger LOGGER = Logger.getInstance(ModuleManagerImpl.class); private ServerConfigurationManager serverConfigurationManager; protected ModuleManagerImpl(Project project) { super(project); } @Override public void projectOpened() { } @Override public void projectClosed() { } @Override public void initComponent() { serverConfigurationManager = ComponentProvider.getComponent(ServerConfigurationManager.class); } @Override public void disposeComponent() { serverConfigurationManager = null; } @NotNull @Override public String getComponentName() { return ModuleManager.class.getName(); } @Override public ServerConfiguration.Module getSCM(@NotNull UnifiedModule unifiedModule, @NotNull ServerConfiguration serverConfiguration) { return new InstanceImpl(myProject, serverConfiguration).findModule(unifiedModule); } public MavenProject getMavenProject(@NotNull UnifiedModule unifiedModule) { if(unifiedModule.isMavenBased()) { return ((UnifiedModuleImpl) unifiedModule).mavenProject; } return null; } @Override public UnifiedModule getUnifiedModule(@NotNull ServerConfiguration.Module scm) { return scm.getUnifiedModule(); } @Override public List<UnifiedModule> getUnifiedModules(@NotNull ServerConfiguration serverConfiguration) { return getUnifiedModules(serverConfiguration, false); } @Override public List<UnifiedModule> getUnifiedModules(@NotNull ServerConfiguration serverConfiguration, boolean force) { return new InstanceImpl(myProject, serverConfiguration).getUnifiedModules(force); } public static class InstanceImpl { ServerConfiguration serverConfiguration; Project project; public InstanceImpl(@NotNull Project project, @NotNull ServerConfiguration serverConfiguration) { this.project = project; this.serverConfiguration = serverConfiguration; } @NotNull public ServerConfiguration getServerConfiguration() { return serverConfiguration; } @NotNull public Project getProject() { return project; } public ServerConfiguration.Module findModule(@NotNull UnifiedModule unifiedModule) { return serverConfiguration.obtainModuleByName(unifiedModule.getName()); } @NotNull public List<UnifiedModule> getUnifiedModules(boolean force) { List<UnifiedModule> ret = new ArrayList<UnifiedModule>(); if(!force && serverConfiguration.isBound()) { LOGGER.debug("Get Unified Modules, not forced and is bound"); for(ServerConfiguration.Module module: serverConfiguration.getModuleList()) { LOGGER.debug("Get Unified Modules, add unified module: ", module.getUnifiedModule().getName()); ret.add(module.getUnifiedModule()); } } else { Module[] modules = com.intellij.openapi.module.ModuleManager.getInstance(project).getModules(); MavenProjectsManager mavenProjectsManager = MavenProjectsManager.getInstance(project); List<MavenProject> mavenProjects = mavenProjectsManager.getNonIgnoredProjects(); for(Module module : modules) { LOGGER.debug("Get Unified Modules, handle module: ", module.getName()); if(!force) { // First look for a Server Configuration Module with that Module in the Module Context and see if it is bound // (If found then this is most likely) ServerConfiguration.Module scm = serverConfiguration.obtainModuleByName(module.getName()); LOGGER.debug("Get Unified Modules, add unforced module (scm, name, is bound): ", scm, scm != null ? scm.getName() : "null", scm != null ? scm.isBound() : "null" ); if(scm != null && scm.isBound()) { ret.add(scm.getUnifiedModule()); // We found our Module so go to the next continue; } } SlingModuleFacet slingModuleFacet = SlingModuleFacet.getFacetByModule(module); // Find a corresponding Maven Project UnifiedModule unifiedModule = null; for(MavenProject mavenProject : mavenProjects) { LOGGER.debug("Get Unified Modules, handled Maven project: ", mavenProject != null ? mavenProject.getName() : "null" ); if(!"pom".equalsIgnoreCase(mavenProject.getPackaging())) { // Use the Parent of the Module and Maven Pom File as they should be in the same folder //AS TODO: We might want to check if one is the child folder of the other instead being in the same VirtualFile moduleFile = module.getModuleFile(); if(moduleFile == null) { // Temporary issue where the IML file is not found by the Virtual File System // Fix: get the path, remove the IML file and find the Virtual File with that folder String filePath = module.getModuleFilePath(); LOGGER.debug("Get Unified Modules, Maven project file path: ", filePath); if(filePath != null) { int index = filePath.lastIndexOf("/"); if(index > 0 && index < filePath.length() - 2) { filePath = filePath.substring(0, index); moduleFile = project.getBaseDir().getFileSystem().findFileByPath(filePath); LOGGER.debug("Get Unified Modules, Maven project module file: ", moduleFile); } } } if(moduleFile != null) { VirtualFile moduleFolder = moduleFile.getParent(); VirtualFile mavenFolder = mavenProject.getFile().getParent(); if(moduleFolder.equals(mavenFolder)) { unifiedModule = new UnifiedModuleImpl(mavenProject, module); LOGGER.debug("Get Unified Modules, Maven project module unified module: ", unifiedModule.getName()); break; } } } } if(unifiedModule != null) { if(unifiedModule.isOSGiBundle()) { if(slingModuleFacet != null) { LOGGER.debug("Get Unified Modules, check OSGi"); SlingModuleFacetConfiguration slingModuleFacetConfiguration = slingModuleFacet.getConfiguration(); LOGGER.debug("Get Unified Modules, sling module facet (fact, facet conf): ", slingModuleFacet, slingModuleFacetConfiguration); if(slingModuleFacetConfiguration.getModuleType() != ModuleType.bundle) { //AS TODO: Show an alert that Maven Module and Sling Facet Module type od not match LOGGER.debug("Get Unified Modules, not a maven bundle -> ignore"); continue; } else { if(slingModuleFacetConfiguration.getOsgiSymbolicName().length() == 0) { //AS TODO: Show an alert that no Symbolic Name is provided LOGGER.debug("Get Unified Modules, no Symbolic Name -> ignore"); continue; } if(slingModuleFacetConfiguration.isIgnoreMaven()) { if(slingModuleFacetConfiguration.getOsgiVersion().length() == 0) { //AS TODO: Show an alert that no Version is provided LOGGER.debug("Get Unified Modules, no OSGi Version -> ignore"); continue; } if(slingModuleFacetConfiguration.getOsgiJarFileName().length() == 0) { //AS TODO: Show an alert that no Jar File Name is provided LOGGER.debug("Get Unified Modules, no OSGi Jar File Name -> ignore"); continue; } } } } } else if(unifiedModule.isContent()) { if(slingModuleFacet != null) { LOGGER.debug("Get Unified Modules, check Content"); if(slingModuleFacet.getConfiguration().getModuleType() != ModuleType.content) { //AS TODO: Warn about the miss configuration but proceed LOGGER.debug("Get Unified Modules, not a Maven content -> ignore"); continue; } else { unifiedModule = new UnifiedModuleImpl(module); } } } } else { if(slingModuleFacet != null) { LOGGER.debug("Get Unified Modules, check others"); if(slingModuleFacet.getConfiguration().getModuleType() != ModuleType.excluded) { unifiedModule = new UnifiedModuleImpl(module); } } } if(unifiedModule != null) { LOGGER.debug("Get Unified Modules, finally add unified module to response: ", unifiedModule.getName()); ret.add(unifiedModule); // Bind the Server Configuration Module with the Module Context ServerConfiguration.Module serverConfigurationModule = serverConfiguration.obtainModuleByName(unifiedModule.getName()); if(serverConfigurationModule == null) { LOGGER.debug("Get Unified Modules, add module to server configuration: ", unifiedModule.getName()); serverConfiguration.addModule(project, unifiedModule); } else { LOGGER.debug("Get Unified Modules, rebind module with server configuration: ", unifiedModule.getName()); serverConfigurationModule.rebind(project, unifiedModule); } } } } return ret; } } }
apache-2.0
mdoering/backbone
life/Plantae/Magnoliophyta/Magnoliopsida/Caryophyllales/Cactaceae/Mammillaria/Mammillaria centricirrha/Mammillaria centricirrha macracantha/README.md
206
# Mammillaria centricirrha var. macracantha (DC.) K.Schum. VARIETY #### Status ACCEPTED #### According to International Plant Names Index #### Published in null #### Original name null ### Remarks null
apache-2.0
mdoering/backbone
life/Plantae/Magnoliophyta/Magnoliopsida/Asterales/Asteraceae/Grindelia/Grindelia exilifolia/README.md
190
# Grindelia exilifolia A.Nelson ex Schmoll SPECIES #### Status ACCEPTED #### According to International Plant Names Index #### Published in null #### Original name null ### Remarks null
apache-2.0
mdoering/backbone
life/Plantae/Magnoliophyta/Magnoliopsida/Asterales/Asteraceae/Cullumia setosa/ Syn. Berkheya setosa/README.md
184
# Berkheya setosa (L.) Willd. SPECIES #### Status SYNONYM #### According to The Catalogue of Life, 3rd January 2011 #### Published in null #### Original name null ### Remarks null
apache-2.0
mdoering/backbone
life/Plantae/Magnoliophyta/Magnoliopsida/Sapindales/Rutaceae/Diosma/Diosma pilosa/README.md
174
# Diosma pilosa I.Williams SPECIES #### Status ACCEPTED #### According to International Plant Names Index #### Published in null #### Original name null ### Remarks null
apache-2.0
mdoering/backbone
life/Plantae/Magnoliophyta/Liliopsida/Poales/Cyperaceae/Carpha/README.md
184
# Carpha Banks & Sol. ex R.Br. GENUS #### Status ACCEPTED #### According to The Catalogue of Life, 3rd January 2011 #### Published in null #### Original name null ### Remarks null
apache-2.0
mdoering/backbone
life/Plantae/Magnoliophyta/Magnoliopsida/Asterales/Asteraceae/Euryops asparagoides/ Syn. Jacobaeastrum asparagoides/README.md
208
# Jacobaeastrum asparagoides (Licht. ex Less.) Kuntze SPECIES #### Status SYNONYM #### According to The Catalogue of Life, 3rd January 2011 #### Published in null #### Original name null ### Remarks null
apache-2.0
mdoering/backbone
life/Chromista/Haptophyta/Prymnesiophyceae/Stephanolithiaceae/Stradnerlithus/Stradnerlithus escovillensis/README.md
228
# Stradnerlithus escovillensis (Rood & Barnard, 1972) Medd, 1979 SPECIES #### Status ACCEPTED #### According to Interim Register of Marine and Nonmarine Genera #### Published in null #### Original name null ### Remarks null
apache-2.0
mdoering/backbone
life/Plantae/Magnoliophyta/Magnoliopsida/Asterales/Asteraceae/Acanthostyles/Acanthostyles buniifolius/Eupatorium buniifolium buniifolium/README.md
181
# Eupatorium buniifolium var. buniifolium VARIETY #### Status ACCEPTED #### According to NUB Generator [autonym] #### Published in null #### Original name null ### Remarks null
apache-2.0
mdoering/backbone
life/Plantae/Magnoliophyta/Magnoliopsida/Asterales/Asteraceae/Scorzonera rupicola/README.md
178
# Scorzonera rupicola Hausskn. SPECIES #### Status ACCEPTED #### According to International Plant Names Index #### Published in null #### Original name null ### Remarks null
apache-2.0
mdoering/backbone
life/Fungi/Ascomycota/Saccharomycetes/Saccharomycetales/Wickerhamomyces/Wickerhamomyces canadensis/README.md
290
# Wickerhamomyces canadensis (Wick.) Kurtzman, Robnett & Basehoar-Powers, 2008 SPECIES #### Status ACCEPTED #### According to The Catalogue of Life, 3rd January 2011 #### Published in FEMS Yeast Res. 8(6): 952 (2008) #### Original name Hansenula canadensis Wick., 1951 ### Remarks null
apache-2.0
AnonymousProductions/MineFantasy2
src/main/java/minefantasy/mf2/api/knowledge/client/EntryPageImage.java
1405
package minefantasy.mf2.api.knowledge.client; import org.lwjgl.opengl.GL11; import minefantasy.mf2.api.helpers.RenderHelper; import minefantasy.mf2.api.helpers.TextureHelperMF; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.GuiScreen; import net.minecraft.util.StatCollector; public class EntryPageImage extends EntryPage { private Minecraft mc = Minecraft.getMinecraft(); private String[] paragraphs; /** * Recommend size: 48x48 */ private String image; private int[] sizes; public EntryPageImage(String tex, String... paragraphs) { this(tex, 128, 128, paragraphs); } public EntryPageImage(String tex, int width, int height, String... paragraphs) { this.paragraphs = paragraphs; this.image = tex; this.sizes = new int[]{width, height}; } @Override public void render(GuiScreen parent, int x, int y, float f, int posX, int posY, boolean onTick) { String text = ""; for(String s: paragraphs) { text += StatCollector.translateToLocal(s); text += "\n\n"; } mc.fontRenderer.drawSplitString(text, posX+14, posY+117, 117, 0); } @Override public void preRender(GuiScreen parent, int x, int y, float f, int posX, int posY, boolean onTick) { mc.renderEngine.bindTexture(TextureHelperMF.getResource(image)); RenderHelper.drawTexturedModalRect(posX+14, posY+8, 2, 0, 0, sizes[0], sizes[1], 1F/(float)sizes[0], 1F/(float)sizes[1]); } }
apache-2.0
geniusgithub/KJFrameForAndroid
PluginExample/src/org/kymjs/aframe/plugin/example/TestBindService.java
809
package org.kymjs.aframe.plugin.example; import org.kymjs.aframe.plugin.service.CJService; import android.content.Intent; import android.os.Binder; import android.os.IBinder; import android.util.Log; import android.widget.Toast; /** * 作为插件Service必须继承CJService */ public class TestBindService extends CJService { public class ServiceHolder extends Binder { public TestBindService create() { return TestBindService.this; } } @Override public IBinder onBind(Intent intent) { super.onBind(intent); return new ServiceHolder(); } public void show() { Log.i("debug", "bind Service success!"); Toast.makeText(that, "bind服务启动成功", Toast.LENGTH_SHORT).show(); } }
apache-2.0
missedone/testng
src/main/java/org/testng/xml/TestNGContentHandler.java
26284
package org.testng.xml; import static org.testng.internal.Utils.isStringBlank; import org.testng.ITestObjectFactory; import org.testng.TestNGException; import org.testng.collections.Lists; import org.testng.collections.Maps; import org.testng.internal.RuntimeBehavior; import org.testng.internal.Utils; import org.testng.log4testng.Logger; import org.xml.sax.Attributes; import org.xml.sax.InputSource; import org.xml.sax.SAXException; import org.xml.sax.SAXParseException; import org.xml.sax.helpers.DefaultHandler; import java.io.IOException; import java.io.InputStream; import java.util.ArrayList; import java.util.List; import java.util.Map; import java.util.Stack; /** * Suite definition parser utility. * * @author Cedric Beust * @author <a href='mailto:[email protected]'>Alexandru Popescu</a> */ public class TestNGContentHandler extends DefaultHandler { private XmlSuite m_currentSuite = null; private XmlTest m_currentTest = null; private List<String> m_currentDefines = null; private List<String> m_currentRuns = null; private List<XmlClass> m_currentClasses = null; private int m_currentTestIndex = 0; private int m_currentClassIndex = 0; private int m_currentIncludeIndex = 0; private List<XmlPackage> m_currentPackages = null; private XmlPackage m_currentPackage = null; private List<XmlSuite> m_suites = Lists.newArrayList(); private XmlGroups m_currentGroups = null; private List<String> m_currentIncludedGroups = null; private List<String> m_currentExcludedGroups = null; private Map<String, String> m_currentTestParameters = null; private Map<String, String> m_currentSuiteParameters = null; private Map<String, String> m_currentClassParameters = null; private Include m_currentInclude; private List<String> m_currentMetaGroup = null; private String m_currentMetaGroupName; enum Location { SUITE, TEST, CLASS, INCLUDE, EXCLUDE } private Stack<Location> m_locations = new Stack<>(); private XmlClass m_currentClass = null; private ArrayList<XmlInclude> m_currentIncludedMethods = null; private List<String> m_currentExcludedMethods = null; private ArrayList<XmlMethodSelector> m_currentSelectors = null; private XmlMethodSelector m_currentSelector = null; private String m_currentLanguage = null; private String m_currentExpression = null; private List<String> m_suiteFiles = Lists.newArrayList(); private boolean m_enabledTest; private List<String> m_listeners; private String m_fileName; private boolean m_loadClasses; private boolean m_validate = false; private boolean m_hasWarn = false; public TestNGContentHandler(String fileName, boolean loadClasses) { m_fileName = fileName; m_loadClasses = loadClasses; } /* * (non-Javadoc) * * @see org.xml.sax.EntityResolver#resolveEntity(java.lang.String, * java.lang.String) */ @Override public InputSource resolveEntity(String systemId, String publicId) throws IOException, SAXException { if (Parser.isUnRecognizedPublicId(publicId)) { //The Url is not TestNG recognized boolean isHttps = publicId != null && publicId.trim().toLowerCase().startsWith("https"); if (isHttps || RuntimeBehavior.useHttpUrlForDtd()) { return super.resolveEntity(systemId, publicId); } else { String msg = "TestNG by default disables loading DTD from unsecure Urls. " + "If you need to explicitly load the DTD from a http url, please do so " + "by using the JVM argument [-D" + RuntimeBehavior.TESTNG_USE_UNSECURE_URL + "=true]"; throw new TestNGException(msg); } } m_validate = true; InputStream is = loadDtdUsingClassLoader(); if (is != null) { return new InputSource(is); } System.out.println( "WARNING: couldn't find in classpath " + publicId + "\n" + "Fetching it from " + Parser.HTTPS_TESTNG_DTD_URL); return super.resolveEntity(systemId, Parser.HTTPS_TESTNG_DTD_URL); } private InputStream loadDtdUsingClassLoader() { InputStream is = getClass().getClassLoader().getResourceAsStream(Parser.TESTNG_DTD); if (is != null) { return is; } return Thread.currentThread().getContextClassLoader().getResourceAsStream(Parser.TESTNG_DTD); } /** Parse <suite-file> */ private void xmlSuiteFile(boolean start, Attributes attributes) { if (start) { String path = attributes.getValue("path"); pushLocation(Location.SUITE); m_suiteFiles.add(path); } else { m_currentSuite.setSuiteFiles(m_suiteFiles); popLocation(); } } /** Parse <suite> */ private void xmlSuite(boolean start, Attributes attributes) { if (start) { pushLocation(Location.SUITE); String name = attributes.getValue("name"); if (isStringBlank(name)) { throw new TestNGException("The <suite> tag must define the name attribute"); } m_currentSuite = new XmlSuite(); m_currentSuite.setFileName(m_fileName); m_currentSuite.setName(name); m_currentSuiteParameters = Maps.newHashMap(); String verbose = attributes.getValue("verbose"); if (null != verbose) { m_currentSuite.setVerbose(Integer.parseInt(verbose)); } String jUnit = attributes.getValue("junit"); if (null != jUnit) { m_currentSuite.setJUnit(Boolean.valueOf(jUnit)); } String parallel = attributes.getValue("parallel"); if (parallel != null) { XmlSuite.ParallelMode mode = XmlSuite.ParallelMode.getValidParallel(parallel); if (mode != null) { m_currentSuite.setParallel(mode); } else { Utils.log( "Parser", 1, "[WARN] Unknown value of attribute 'parallel' at suite level: '" + parallel + "'."); } } String parentModule = attributes.getValue("parent-module"); if (parentModule != null) { m_currentSuite.setParentModule(parentModule); } String guiceStage = attributes.getValue("guice-stage"); if (guiceStage != null) { m_currentSuite.setGuiceStage(guiceStage); } XmlSuite.FailurePolicy configFailurePolicy = XmlSuite.FailurePolicy.getValidPolicy(attributes.getValue("configfailurepolicy")); if (null != configFailurePolicy) { m_currentSuite.setConfigFailurePolicy(configFailurePolicy); } String groupByInstances = attributes.getValue("group-by-instances"); if (groupByInstances != null) { m_currentSuite.setGroupByInstances(Boolean.valueOf(groupByInstances)); } String skip = attributes.getValue("skipfailedinvocationcounts"); if (skip != null) { m_currentSuite.setSkipFailedInvocationCounts(Boolean.valueOf(skip)); } String threadCount = attributes.getValue("thread-count"); if (null != threadCount) { m_currentSuite.setThreadCount(Integer.parseInt(threadCount)); } String dataProviderThreadCount = attributes.getValue("data-provider-thread-count"); if (null != dataProviderThreadCount) { m_currentSuite.setDataProviderThreadCount(Integer.parseInt(dataProviderThreadCount)); } String timeOut = attributes.getValue("time-out"); if (null != timeOut) { m_currentSuite.setTimeOut(timeOut); } String objectFactory = attributes.getValue("object-factory"); if (null != objectFactory && m_loadClasses) { try { m_currentSuite.setObjectFactory( (ITestObjectFactory) Class.forName(objectFactory).newInstance()); } catch (Exception e) { Utils.log( "Parser", 1, "[ERROR] Unable to create custom object factory '" + objectFactory + "' :" + e); } } String preserveOrder = attributes.getValue("preserve-order"); if (preserveOrder != null) { m_currentSuite.setPreserveOrder(Boolean.valueOf(preserveOrder)); } String allowReturnValues = attributes.getValue("allow-return-values"); if (allowReturnValues != null) { m_currentSuite.setAllowReturnValues(Boolean.valueOf(allowReturnValues)); } } else { m_currentSuite.setParameters(m_currentSuiteParameters); m_suites.add(m_currentSuite); m_currentSuiteParameters = null; popLocation(); } } /** Parse <define> */ private void xmlDefine(boolean start, Attributes attributes) { if (start) { String name = attributes.getValue("name"); m_currentDefines = Lists.newArrayList(); m_currentMetaGroup = Lists.newArrayList(); m_currentMetaGroupName = name; } else { if (m_currentTest != null) { m_currentTest.addMetaGroup(m_currentMetaGroupName, m_currentMetaGroup); } else { XmlDefine define = new XmlDefine(); define.setName(m_currentMetaGroupName); define.getIncludes().addAll(m_currentMetaGroup); m_currentGroups.addDefine(define); } m_currentDefines = null; } } /** Parse <script> */ private void xmlScript(boolean start, Attributes attributes) { if (start) { m_currentLanguage = attributes.getValue("language"); m_currentExpression = ""; } else { XmlScript script = new XmlScript(); script.setExpression(m_currentExpression); script.setLanguage(m_currentLanguage); m_currentSelector.setScript(script); if (m_locations.peek() == Location.TEST) { m_currentTest.setScript(script); } m_currentLanguage = null; m_currentExpression = null; } } /** Parse <test> */ private void xmlTest(boolean start, Attributes attributes) { if (start) { m_currentTest = new XmlTest(m_currentSuite, m_currentTestIndex++); pushLocation(Location.TEST); m_currentTestParameters = Maps.newHashMap(); final String testName = attributes.getValue("name"); if (isStringBlank(testName)) { throw new TestNGException("The <test> tag must define the name attribute"); } m_currentTest.setName(attributes.getValue("name")); String verbose = attributes.getValue("verbose"); if (null != verbose) { m_currentTest.setVerbose(Integer.parseInt(verbose)); } String jUnit = attributes.getValue("junit"); if (null != jUnit) { m_currentTest.setJUnit(Boolean.valueOf(jUnit)); } String skip = attributes.getValue("skipfailedinvocationcounts"); if (skip != null) { m_currentTest.setSkipFailedInvocationCounts(Boolean.valueOf(skip)); } String groupByInstances = attributes.getValue("group-by-instances"); if (groupByInstances != null) { m_currentTest.setGroupByInstances(Boolean.valueOf(groupByInstances)); } String preserveOrder = attributes.getValue("preserve-order"); if (preserveOrder != null) { m_currentTest.setPreserveOrder(Boolean.valueOf(preserveOrder)); } String parallel = attributes.getValue("parallel"); if (parallel != null) { XmlSuite.ParallelMode mode = XmlSuite.ParallelMode.getValidParallel(parallel); if (mode != null) { m_currentTest.setParallel(mode); } else { Utils.log( "Parser", 1, "[WARN] Unknown value of attribute 'parallel' for test '" + m_currentTest.getName() + "': '" + parallel + "'"); } } String threadCount = attributes.getValue("thread-count"); if (null != threadCount) { m_currentTest.setThreadCount(Integer.parseInt(threadCount)); } String timeOut = attributes.getValue("time-out"); if (null != timeOut) { m_currentTest.setTimeOut(Long.parseLong(timeOut)); } m_enabledTest = true; String enabledTestString = attributes.getValue("enabled"); if (null != enabledTestString) { m_enabledTest = Boolean.valueOf(enabledTestString); } } else { if (null != m_currentTestParameters && m_currentTestParameters.size() > 0) { m_currentTest.setParameters(m_currentTestParameters); } if (null != m_currentClasses) { m_currentTest.setXmlClasses(m_currentClasses); } m_currentClasses = null; m_currentTest = null; m_currentTestParameters = null; popLocation(); if (!m_enabledTest) { List<XmlTest> tests = m_currentSuite.getTests(); tests.remove(tests.size() - 1); } } } /** Parse <classes> */ public void xmlClasses(boolean start, Attributes attributes) { if (start) { m_currentClasses = Lists.newArrayList(); m_currentClassIndex = 0; } else { m_currentTest.setXmlClasses(m_currentClasses); m_currentClasses = null; } } /** Parse <listeners> */ public void xmlListeners(boolean start, Attributes attributes) { if (start) { m_listeners = Lists.newArrayList(); } else { if (null != m_listeners) { m_currentSuite.setListeners(m_listeners); m_listeners = null; } } } /** Parse <listener> */ public void xmlListener(boolean start, Attributes attributes) { if (start) { String listener = attributes.getValue("class-name"); m_listeners.add(listener); } } /** Parse <packages> */ public void xmlPackages(boolean start, Attributes attributes) { if (start) { m_currentPackages = Lists.newArrayList(); } else { if (null != m_currentPackages) { Location location = m_locations.peek(); switch (location) { case TEST: m_currentTest.setXmlPackages(m_currentPackages); break; case SUITE: m_currentSuite.setXmlPackages(m_currentPackages); break; case CLASS: throw new UnsupportedOperationException("CLASS"); default: throw new AssertionError("Unexpected value: " + location); } } m_currentPackages = null; m_currentPackage = null; } } /** Parse <method-selectors> */ public void xmlMethodSelectors(boolean start, Attributes attributes) { if (start) { m_currentSelectors = new ArrayList<>(); return; } if (m_locations.peek() == Location.TEST) { m_currentTest.setMethodSelectors(m_currentSelectors); } else { m_currentSuite.setMethodSelectors(m_currentSelectors); } m_currentSelectors = null; } /** Parse <selector-class> */ public void xmlSelectorClass(boolean start, Attributes attributes) { if (start) { m_currentSelector.setName(attributes.getValue("name")); String priority = attributes.getValue("priority"); if (priority == null) { priority = "0"; } m_currentSelector.setPriority(Integer.parseInt(priority)); } } /** Parse <method-selector> */ public void xmlMethodSelector(boolean start, Attributes attributes) { if (start) { m_currentSelector = new XmlMethodSelector(); } else { m_currentSelectors.add(m_currentSelector); m_currentSelector = null; } } private void xmlMethod(boolean start) { if (start) { m_currentIncludedMethods = new ArrayList<>(); m_currentExcludedMethods = Lists.newArrayList(); m_currentIncludeIndex = 0; } else { m_currentClass.setIncludedMethods(m_currentIncludedMethods); m_currentClass.setExcludedMethods(m_currentExcludedMethods); m_currentIncludedMethods = null; m_currentExcludedMethods = null; } } /** Parse <run> */ public void xmlRun(boolean start, Attributes attributes) { if (start) { m_currentRuns = Lists.newArrayList(); } else { if (m_currentTest != null) { m_currentTest.setIncludedGroups(m_currentIncludedGroups); m_currentTest.setExcludedGroups(m_currentExcludedGroups); } else { m_currentSuite.setIncludedGroups(m_currentIncludedGroups); m_currentSuite.setExcludedGroups(m_currentExcludedGroups); } m_currentRuns = null; } } /** Parse <group> */ public void xmlGroup(boolean start, Attributes attributes) { if (start) { m_currentTest.addXmlDependencyGroup( attributes.getValue("name"), attributes.getValue("depends-on")); } } /** Parse <groups> */ public void xmlGroups(boolean start, Attributes attributes) { if (start) { m_currentGroups = new XmlGroups(); m_currentIncludedGroups = Lists.newArrayList(); m_currentExcludedGroups = Lists.newArrayList(); } else { if (m_currentTest == null) { m_currentSuite.setGroups(m_currentGroups); } m_currentGroups = null; } } /** * NOTE: I only invoke xml*methods (e.g. xmlSuite()) if I am acting on both the start and the end * of the tag. This way I can keep the treatment of this tag in one place. If I am only doing * something when the tag opens, the code is inlined below in the startElement() method. */ @Override public void startElement(String uri, String localName, String qName, Attributes attributes) { if (!m_validate && !m_hasWarn) { String msg = String.format( "It is strongly recommended to add " + "\"<!DOCTYPE suite SYSTEM \"%s\" >\" at the top of your file, " + "otherwise TestNG may fail or not work as expected.", Parser.HTTPS_TESTNG_DTD_URL ); Logger.getLogger(TestNGContentHandler.class).warn(msg); m_hasWarn = true; } String name = attributes.getValue("name"); // ppp("START ELEMENT uri:" + uri + " sName:" + localName + " qName:" + qName + // " " + attributes); if ("suite".equals(qName)) { xmlSuite(true, attributes); } else if ("suite-file".equals(qName)) { xmlSuiteFile(true, attributes); } else if ("test".equals(qName)) { xmlTest(true, attributes); } else if ("script".equals(qName)) { xmlScript(true, attributes); } else if ("method-selector".equals(qName)) { xmlMethodSelector(true, attributes); } else if ("method-selectors".equals(qName)) { xmlMethodSelectors(true, attributes); } else if ("selector-class".equals(qName)) { xmlSelectorClass(true, attributes); } else if ("classes".equals(qName)) { xmlClasses(true, attributes); } else if ("packages".equals(qName)) { xmlPackages(true, attributes); } else if ("listeners".equals(qName)) { xmlListeners(true, attributes); } else if ("listener".equals(qName)) { xmlListener(true, attributes); } else if ("class".equals(qName)) { // If m_currentClasses is null, the XML is invalid and SAX // will complain, but in the meantime, dodge the NPE so SAX // can finish parsing the file. if (null != m_currentClasses) { m_currentClass = new XmlClass(name, m_currentClassIndex++, m_loadClasses); m_currentClass.setXmlTest(m_currentTest); m_currentClassParameters = Maps.newHashMap(); m_currentClasses.add(m_currentClass); pushLocation(Location.CLASS); } } else if ("package".equals(qName)) { if (null != m_currentPackages) { m_currentPackage = new XmlPackage(); m_currentPackage.setName(name); m_currentPackages.add(m_currentPackage); } } else if ("define".equals(qName)) { xmlDefine(true, attributes); } else if ("run".equals(qName)) { xmlRun(true, attributes); } else if ("group".equals(qName)) { xmlGroup(true, attributes); } else if ("groups".equals(qName)) { xmlGroups(true, attributes); } else if ("methods".equals(qName)) { xmlMethod(true); } else if ("include".equals(qName)) { xmlInclude(true, attributes); } else if ("exclude".equals(qName)) { xmlExclude(true, attributes); } else if ("parameter".equals(qName)) { String value = expandValue(attributes.getValue("value")); Location location = m_locations.peek(); switch (location) { case TEST: m_currentTestParameters.put(name, value); break; case SUITE: m_currentSuiteParameters.put(name, value); break; case CLASS: m_currentClassParameters.put(name, value); break; case INCLUDE: m_currentInclude.parameters.put(name, value); break; default: throw new AssertionError("Unexpected value: " + location); } } } private static class Include { String name; String invocationNumbers; String description; Map<String, String> parameters = Maps.newHashMap(); Include(String name, String numbers) { this.name = name; this.invocationNumbers = numbers; } } private void xmlInclude(boolean start, Attributes attributes) { if (start) { m_locations.push(Location.INCLUDE); m_currentInclude = new Include(attributes.getValue("name"), attributes.getValue("invocation-numbers")); m_currentInclude.description = attributes.getValue("description"); } else { String name = m_currentInclude.name; if (null != m_currentIncludedMethods) { String in = m_currentInclude.invocationNumbers; XmlInclude include; if (!Utils.isStringEmpty(in)) { include = new XmlInclude(name, stringToList(in), m_currentIncludeIndex++); } else { include = new XmlInclude(name, m_currentIncludeIndex++); } for (Map.Entry<String, String> entry : m_currentInclude.parameters.entrySet()) { include.addParameter(entry.getKey(), entry.getValue()); } include.setDescription(m_currentInclude.description); m_currentIncludedMethods.add(include); } else if (null != m_currentDefines) { m_currentMetaGroup.add(name); } else if (null != m_currentRuns) { m_currentIncludedGroups.add(name); } else if (null != m_currentPackage) { m_currentPackage.getInclude().add(name); } popLocation(); m_currentInclude = null; } } private void xmlExclude(boolean start, Attributes attributes) { if (start) { m_locations.push(Location.EXCLUDE); String name = attributes.getValue("name"); if (null != m_currentExcludedMethods) { m_currentExcludedMethods.add(name); } else if (null != m_currentRuns) { m_currentExcludedGroups.add(name); } else if (null != m_currentPackage) { m_currentPackage.getExclude().add(name); } } else { popLocation(); } } private void pushLocation(Location l) { m_locations.push(l); } private void popLocation() { m_locations.pop(); } private List<Integer> stringToList(String in) { String[] numbers = in.split(" "); List<Integer> result = Lists.newArrayList(); for (String n : numbers) { result.add(Integer.parseInt(n)); } return result; } @Override public void endElement(String uri, String localName, String qName) { if ("suite".equals(qName)) { xmlSuite(false, null); } else if ("suite-file".equals(qName)) { xmlSuiteFile(false, null); } else if ("test".equals(qName)) { xmlTest(false, null); } else if ("define".equals(qName)) { xmlDefine(false, null); } else if ("run".equals(qName)) { xmlRun(false, null); } else if ("groups".equals(qName)) { xmlGroups(false, null); } else if ("methods".equals(qName)) { xmlMethod(false); } else if ("classes".equals(qName)) { xmlClasses(false, null); } else if ("packages".equals(qName)) { xmlPackages(false, null); } else if ("class".equals(qName)) { m_currentClass.setParameters(m_currentClassParameters); m_currentClassParameters = null; popLocation(); } else if ("listeners".equals(qName)) { xmlListeners(false, null); } else if ("method-selector".equals(qName)) { xmlMethodSelector(false, null); } else if ("method-selectors".equals(qName)) { xmlMethodSelectors(false, null); } else if ("selector-class".equals(qName)) { xmlSelectorClass(false, null); } else if ("script".equals(qName)) { xmlScript(false, null); } else if ("include".equals(qName)) { xmlInclude(false, null); } else if ("exclude".equals(qName)) { xmlExclude(false, null); } } @Override public void error(SAXParseException e) throws SAXException { if (m_validate) { throw e; } } private boolean areWhiteSpaces(char[] ch, int start, int length) { for (int i = start; i < start + length; i++) { char c = ch[i]; if (c != '\n' && c != '\t' && c != ' ') { return false; } } return true; } @Override public void characters(char[] ch, int start, int length) { if (null != m_currentLanguage && !areWhiteSpaces(ch, start, length)) { m_currentExpression += new String(ch, start, length); } } public XmlSuite getSuite() { return m_currentSuite; } private static String expandValue(String value) { StringBuilder result = null; int startIndex; int endIndex; int startPosition = 0; String property; while ((startIndex = value.indexOf("${", startPosition)) > -1 && (endIndex = value.indexOf("}", startIndex + 3)) > -1) { property = value.substring(startIndex + 2, endIndex); if (result == null) { result = new StringBuilder(value.substring(startPosition, startIndex)); } else { result.append(value, startPosition, startIndex); } String propertyValue = System.getProperty(property); if (propertyValue == null) { propertyValue = System.getenv(property); } if (propertyValue != null) { result.append(propertyValue); } else { result.append("${"); result.append(property); result.append("}"); } startPosition = startIndex + 3 + property.length(); } if (result != null) { result.append(value.substring(startPosition)); return result.toString(); } else { return value; } } }
apache-2.0
lazyarea/umbrella
templates/api/index.html
129
<html> <head lang="ja"> <meta charset="UTF-8"> <title>{{ title }}</title> </head> <body> api/index.html </body> </html>
apache-2.0
phil-brown/javaQuery
src/org/jdesktop/core/animation/timing/TimingTargetAdapter.java
2073
package org.jdesktop.core.animation.timing; import self.philbrown.javaQuery.Modified; import com.surelogic.ThreadSafe; /** * Implements the {@link TimingTarget} interface, providing stubs for all timing * target methods. Subclasses may extend this adapter rather than implementing * the {@link TimingTarget} interface if they only care about a subset of the * events provided. For example, sequencing animations may only require * monitoring the {@link TimingTarget#end} method, so subclasses of this adapter * may ignore the other methods such as timingEvent. * <p> * This class provides a useful "debug" name via {@link #setDebugName(String)} * and {@link #getDebugName()}. The debug name is also output by * {@link #toString()}. This feature is intended to aid debugging. * * @author Chet Haase * @author Tim Halloran * @author Phil Brown */ @Modified(author="Phil Brown", summary="Cleaned up and added inheritDocs documentation to improve javadocs.") @ThreadSafe(implementationOnly = true) public class TimingTargetAdapter implements TimingTarget { /** * {@inheritDoc} */ @Override public void begin(Animator source) { } /** * {@inheritDoc} */ @Override public void end(Animator source) { } /** * {@inheritDoc} */ @Override public void cancel(Animator source) { } /** * {@inheritDoc} */ @Override public void repeat(Animator source) { } /** * {@inheritDoc} */ @Override public void reverse(Animator source) { } /** * {@inheritDoc} */ @Override public void timingEvent(Animator source, double fraction) { } private volatile String f_debugName = null; public final void setDebugName(String name) { f_debugName = name; } public final String getDebugName() { return f_debugName; } @Override public String toString() { final String debugName = f_debugName; final StringBuilder b = new StringBuilder(); b.append(getClass().getSimpleName()).append('@'); b.append(debugName != null ? debugName : Integer.toHexString(hashCode())); return b.toString(); } }
apache-2.0
RoboJackets/apiary
app/Http/Requests/StoreNotificationTemplateRequest.php
982
<?php declare(strict_types=1); namespace App\Http\Requests; use Illuminate\Foundation\Http\FormRequest; class StoreNotificationTemplateRequest extends FormRequest { /** * Determine if the user is authorized to make this request. */ public function authorize(): bool { return true; } /** * Get the validation rules that apply to the request. * * @return array<string,array<string>> */ public function rules(): array { return [ 'name' => [ 'required', 'string', ], 'subject' => [ 'required', 'string', ], 'body_markdown' => [ 'required', ], ]; } /** * Get the error messages for the defined validation rules. * * @return array<string,string> */ public function messages(): array { return []; } }
apache-2.0
mdoering/backbone
life/Plantae/Lomandraceae/Xerotes/Xerotes echinata/README.md
173
# Xerotes echinata Benth. SPECIES #### Status ACCEPTED #### According to International Plant Names Index #### Published in null #### Original name null ### Remarks null
apache-2.0
praetoriandroid/sony-camera-remote-java
sony-camera-remote-lib/src/main/java/com/praetoriandroid/cameraremote/ServiceNotSupportedException.java
279
package com.praetoriandroid.cameraremote; public class ServiceNotSupportedException extends RpcException { private static final long serialVersionUID = -4740335873344202486L; public ServiceNotSupportedException(String serviceType) { super(serviceType); } }
apache-2.0
kstilwell/tcex
tests/batch/test_indicator_interface_3.py
6925
"""Test the TcEx Batch Module.""" # third-party import pytest # pylint: disable=no-self-use class TestIndicator3: """Test the TcEx Batch Module.""" def setup_class(self): """Configure setup before all tests.""" @pytest.mark.parametrize( 'indicator,description,label,tag', [ ('3.33.33.1', 'Example #1', 'PYTEST1', 'PyTest1'), ('3.33.33.2', 'Example #2', 'PYTEST2', 'PyTest2'), ('3.33.33.3', 'Example #3', 'PYTEST3', 'PyTest3'), ('3.33.33.4', 'Example #4', 'PYTEST4', 'PyTest4'), ], ) def test_address(self, indicator, description, label, tag, tcex): """Test address creation""" batch = tcex.batch(owner='TCI') xid = batch.generate_xid(['pytest', 'address', indicator]) ti = batch.add_indicator( { 'type': 'Address', 'rating': 5.00, 'confidence': 100, 'summary': indicator, 'xid': xid, 'attribute': [{'displayed': True, 'type': 'Description', 'value': description}], 'securityLabel': [ {'color': 'ffc0cb', 'name': label, 'description': 'Pytest Label Description'} ], 'tag': [{'name': tag}], } ) batch.save(ti) batch_status = batch.submit_all() assert batch_status[0].get('status') == 'Completed' assert batch_status[0].get('successCount') == 1 @pytest.mark.parametrize( 'indicator,description,label,tag', [ ('[email protected]', 'Example #1', 'PYTEST:1', 'PyTest1'), ('[email protected]', 'Example #2', 'PYTEST:2', 'PyTest2'), ('[email protected]', 'Example #3', 'PYTEST:3', 'PyTest3'), ('[email protected]', 'Example #4', 'PYTEST:4', 'PyTest4'), ], ) def test_email_address(self, indicator, description, label, tag, tcex): """Test email_address creation""" batch = tcex.batch(owner='TCI') xid = batch.generate_xid(['pytest', 'email_address', indicator]) ti = batch.add_indicator( { 'type': 'EmailAddress', 'rating': 5.00, 'confidence': 100, 'summary': indicator, 'xid': xid, 'attribute': [{'displayed': True, 'type': 'Description', 'value': description}], 'securityLabel': [ {'color': 'ffc0cb', 'name': label, 'description': 'Pytest Label Description'} ], 'tag': [{'name': tag}], } ) batch.save(ti) batch_status = batch.submit_all() assert batch_status[0].get('status') == 'Completed' assert batch_status[0].get('successCount') == 1 @pytest.mark.parametrize( 'md5,sha1,sha256,description,label,tag', [ ('a3', 'a3', 'a3', 'Example #1', 'PYTEST:1', 'PyTest1'), ('b3', 'b3', 'b3', 'Example #2', 'PYTEST:2', 'PyTest2'), ('c3', 'c3', 'c3', 'Example #3', 'PYTEST:3', 'PyTest3'), ('d3', 'd3', 'd3', 'Example #4', 'PYTEST:4', 'PyTest4'), ], ) def test_file(self, md5, sha1, sha256, description, label, tag, tcex): """Test file creation""" batch = tcex.batch(owner='TCI') xid = batch.generate_xid(['pytest', 'file', md5, sha1, sha256]) ti = batch.add_indicator( { 'type': 'File', 'rating': 5.00, 'confidence': 100, 'summary': f'{md5 * 16} : {sha1 * 20} : {sha256 * 32}', 'xid': xid, 'attribute': [{'displayed': True, 'type': 'Description', 'value': description}], 'securityLabel': [ {'color': 'ffc0cb', 'name': label, 'description': 'Pytest Label Description'} ], 'tag': [{'name': tag}], } ) batch.save(ti) batch_status = batch.submit_all() assert batch_status[0].get('status') == 'Completed' assert batch_status[0].get('successCount') == 1 @pytest.mark.parametrize( 'indicator,description,label,tag', [ ('pytest-host-i3-001.com', 'Example #1', 'PYTEST:1', 'PyTest1'), ('pytest-host-i3-002.com', 'Example #2', 'PYTEST:2', 'PyTest2'), ('pytest-host-i3-003.com', 'Example #3', 'PYTEST:3', 'PyTest3'), ('pytest-host-i3-004.com', 'Example #4', 'PYTEST:4', 'PyTest4'), ], ) def test_host(self, indicator, description, label, tag, tcex): """Test host creation""" batch = tcex.batch(owner='TCI') xid = batch.generate_xid(['pytest', 'host', indicator]) ti = batch.add_indicator( { 'type': 'Host', 'rating': 5.00, 'confidence': 100, 'summary': indicator, 'xid': xid, 'attribute': [{'displayed': True, 'type': 'Description', 'value': description}], 'securityLabel': [ {'color': 'ffc0cb', 'name': label, 'description': 'Pytest Label Description'} ], 'tag': [{'name': tag}], } ) batch.save(ti) batch_status = batch.submit_all() assert batch_status[0].get('status') == 'Completed' assert batch_status[0].get('successCount') == 1 @pytest.mark.parametrize( 'indicator,description,label,tag', [ ('https://pytest-url-i3-001.com', 'Example #1', 'PYTEST:1', 'PyTest1'), ('https://pytest-url-i3-002.com', 'Example #2', 'PYTEST:2', 'PyTest2'), ('https://pytest-url-i3-003.com', 'Example #3', 'PYTEST:3', 'PyTest3'), ('https://pytest-url-i3-004.com', 'Example #4', 'PYTEST:4', 'PyTest4'), ], ) def test_url(self, indicator, description, label, tag, tcex): """Test url creation""" batch = tcex.batch(owner='TCI') xid = batch.generate_xid(['pytest', 'url', indicator]) ti = batch.add_indicator( { 'type': 'Url', 'rating': 5.00, 'confidence': 100, 'summary': indicator, 'xid': xid, 'attribute': [{'displayed': True, 'type': 'Description', 'value': description}], 'securityLabel': [ {'color': 'ffc0cb', 'name': label, 'description': 'Pytest Label Description'} ], 'tag': [{'name': tag}], } ) batch.save(ti) batch_status = batch.submit_all() assert batch_status[0].get('status') == 'Completed' assert batch_status[0].get('successCount') == 1
apache-2.0
monoman/cnatural-language
tests/resources/LibraryTest/sources/ToIntTMap5.stab.cs
467
using java.lang; using java.util; using stab.query; public class ToIntTMap5 { public static bool test() { var map1 = new HashMap<Integer, string> { { 1, "V1" }, { 2, "V2" }, { 3, "V3" }}; var list = new ArrayList<string> { "V1", "V2", "V3" }; var key = 1; var map2 = list.toMap(p => key++); int i = 0; foreach (var k in map2.keySet()) { if (!map1[k].equals(map2.get(k))) { return false; } i++; } return map2.size() == 3 && i == 3; } }
apache-2.0
google/resultstoreui
resultstoresearch/client/src/components/InvocationTable/types.ts
821
import invocation_pb from '../../api/invocation_pb'; import { State as PageWrapperState } from '../SearchWrapper'; export interface Data { status: string; name: string; labels: string; date: string; duration: string; user: string; } export interface Column { id: 'status' | 'name' | 'labels' | 'date' | 'duration' | 'user'; label: string; minWidth?: number; align?: 'right'; } export interface InvocationTableProps { invocations: Array<invocation_pb.Invocation>; pageToken: PageWrapperState['pageToken']; next: (newQuery: boolean, pageToken: string) => void; isNextPageLoading: boolean; tokenID: string; } export interface ModalState { isOpen: boolean; index: number; } export interface HoverState { isHovered: boolean; rowIndex: number; }
apache-2.0
fenik17/netty
example/src/main/java/io/netty/example/http2/helloworld/frame/client/Http2ClientStreamFrameResponseHandler.java
2568
/* * Copyright 2020 The Netty Project * * The Netty Project 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 io.netty.example.http2.helloworld.frame.client; import io.netty.channel.ChannelHandlerContext; import io.netty.channel.SimpleChannelInboundHandler; import io.netty.handler.codec.http2.Http2DataFrame; import io.netty.handler.codec.http2.Http2HeadersFrame; import io.netty.handler.codec.http2.Http2StreamFrame; import java.util.concurrent.CountDownLatch; import java.util.concurrent.TimeUnit; /** * Handles HTTP/2 stream frame responses. This is a useful approach if you specifically want to check * the main HTTP/2 response DATA/HEADERs, but in this example it's used purely to see whether * our request (for a specific stream id) has had a final response (for that same stream id). */ public final class Http2ClientStreamFrameResponseHandler extends SimpleChannelInboundHandler<Http2StreamFrame> { private final CountDownLatch latch = new CountDownLatch(1); @Override protected void channelRead0(ChannelHandlerContext ctx, Http2StreamFrame msg) throws Exception { System.out.println("Received HTTP/2 'stream' frame: " + msg); // isEndStream() is not from a common interface, so we currently must check both if (msg instanceof Http2DataFrame && ((Http2DataFrame) msg).isEndStream()) { latch.countDown(); } else if (msg instanceof Http2HeadersFrame && ((Http2HeadersFrame) msg).isEndStream()) { latch.countDown(); } } /** * Waits for the latch to be decremented (i.e. for an end of stream message to be received), or for * the latch to expire after 5 seconds. * @return true if a successful HTTP/2 end of stream message was received. */ public boolean responseSuccessfullyCompleted() { try { return latch.await(5, TimeUnit.SECONDS); } catch (InterruptedException ie) { System.err.println("Latch exception: " + ie.getMessage()); return false; } } }
apache-2.0
brenthub/brent-console
brent-console-interface/src/main/java/cn/brent/console/table/TSysUidSysid.java
388
package cn.brent.console.table; /** * <p> * 实体类- * </p> * <p> * Table: sys_uid_sysid * </p> * * @since 2015-08-18 05:00:27 */ public class TSysUidSysid { /** */ public static final String UID = "UID"; /** */ public static final String SYS = "SYS"; /** */ public static final String SysID = "SysID"; /** */ public static final String AddTime = "AddTime"; }
apache-2.0
VincentFxz/EAM
src/main/java/com/dc/smarteam/test/entity/TestTree.java
1652
/** * Copyright &copy; 2012-2014 <a href="https://github.com/thinkgem/jeesite">JeeSite</a> All rights reserved. */ package com.dc.smarteam.test.entity; import com.fasterxml.jackson.annotation.JsonBackReference; import javax.validation.constraints.NotNull; import org.hibernate.validator.constraints.Length; import com.dc.smarteam.common.persistence.TreeEntity; /** * 树结构生成Entity * @author ThinkGem * @version 2015-04-06 */ public class TestTree extends TreeEntity<TestTree> { private static final long serialVersionUID = 1L; private TestTree parent; // 父级编号 private String parentIds; // 所有父级编号 private String name; // 名称 private Integer sort; // 排序 public TestTree() { super(); } public TestTree(String id){ super(id); } @JsonBackReference @NotNull(message="父级编号不能为空") public TestTree getParent() { return parent; } public void setParent(TestTree parent) { this.parent = parent; } @Length(min=1, max=2000, message="所有父级编号长度必须介于 1 和 2000 之间") public String getParentIds() { return parentIds; } public void setParentIds(String parentIds) { this.parentIds = parentIds; } @Length(min=1, max=100, message="名称长度必须介于 1 和 100 之间") public String getName() { return name; } public void setName(String name) { this.name = name; } @NotNull(message="排序不能为空") public Integer getSort() { return sort; } public void setSort(Integer sort) { this.sort = sort; } public String getParentId() { return parent != null && parent.getId() != null ? parent.getId() : "0"; } }
apache-2.0
obarnet/Teste
SearchMonkeySRC/engine/SearcherFactory.cpp
952
#include "ContentSearcher.h" #include "FileNameSearcher.h" #include "FileSizeSearcher.h" #include "FileTimeSearcher.h" #include "Searcher.h" #include "SearcherFactory.h" #include "../SearchParameter.h" Searcher* SearcherFactory::BuildSearcher(const SearchParameter& param) { PhaseOneParameter oneParam = *param.phaseOneParam; Searcher* searcher = new FileNameSearcher(oneParam); // need to build anyhow if (oneParam.HasSizeConstraint()) { searcher = new FileSizeSearcher(searcher, oneParam); } if (oneParam.HasTimeConstraints()) { searcher = new FileTimeSearcher(searcher, oneParam); } // for performance issue, we should always construct ContentSearcher at last so this content searcher will performed at a minimum time if (param.PhaseTwoSearchNeeded()) { searcher = new ContentSearcher(searcher, *param.phaseTwoParam); } return searcher; }
apache-2.0
couchbase/perfrunner
perfrunner/tests/dcp.py
4121
from perfrunner.helpers import local from perfrunner.helpers.cbmonitor import timeit, with_stats from perfrunner.helpers.profiler import with_profiles from perfrunner.helpers.worker import java_dcp_client_task from perfrunner.tests import PerfTest class DCPThroughputTest(PerfTest): def _report_kpi(self, time_elapsed: float, clients: int, stream: str): self.reporter.post( *self.metrics.dcp_throughput(time_elapsed, clients, stream) ) @with_stats @timeit @with_profiles def access(self, *args): username, password = self.cluster_spec.rest_credentials for target in self.target_iterator: local.run_dcptest( host=target.node, username=username, password=password, bucket=target.bucket, num_items=self.test_config.load_settings.items, num_connections=self.test_config.dcp_settings.num_connections ) def warmup(self): self.remote.stop_server() self.remote.drop_caches() return self._warmup() def _warmup(self): self.remote.start_server() for master in self.cluster_spec.masters: for bucket in self.test_config.buckets: self.monitor.monitor_warmup(self.memcached, master, bucket) def run(self): self.load() self.wait_for_persistence() self.check_num_items() self.compact_bucket() if self.test_config.dcp_settings.invoke_warm_up: self.warmup() time_elapsed = self.access() self.report_kpi(time_elapsed, int(self.test_config.java_dcp_settings.clients), self.test_config.java_dcp_settings.stream) class JavaDCPThroughputTest(DCPThroughputTest): def init_java_dcp_client(self): local.clone_git_repo(repo=self.test_config.java_dcp_settings.repo, branch=self.test_config.java_dcp_settings.branch) local.build_java_dcp_client() @with_stats @timeit @with_profiles def access(self, *args): for target in self.target_iterator: local.run_java_dcp_client( connection_string=target.connection_string, messages=self.test_config.load_settings.items, config_file=self.test_config.java_dcp_settings.config, ) def run(self): self.init_java_dcp_client() super().run() class JavaDCPCollectionThroughputTest(DCPThroughputTest): def init_java_dcp_clients(self): if self.worker_manager.is_remote: self.remote.init_java_dcp_client(repo=self.test_config.java_dcp_settings.repo, branch=self.test_config.java_dcp_settings.branch, worker_home=self.worker_manager.WORKER_HOME, commit=self.test_config.java_dcp_settings.commit) else: local.clone_git_repo(repo=self.test_config.java_dcp_settings.repo, branch=self.test_config.java_dcp_settings.branch, commit=self.test_config.java_dcp_settings.commit) local.build_java_dcp_client() @with_stats @timeit @with_profiles def access(self, *args, **kwargs): access_settings = self.test_config.access_settings access_settings.workload_instances = int(self.test_config.java_dcp_settings.clients) PerfTest.access(self, task=java_dcp_client_task, settings=access_settings) def run(self): self.init_java_dcp_clients() self.load() self.wait_for_persistence() self.check_num_items() self.compact_bucket() if self.test_config.access_settings.workers > 0: self.access_bg() time_elapsed = self.access() self.report_kpi(time_elapsed, int(self.test_config.java_dcp_settings.clients), self.test_config.java_dcp_settings.stream)
apache-2.0
howbigbobo/com.lianyu.tech
website/src/main/java/com/lianyu/tech/website/web/controller/verify/VerifyCodeValidator.java
978
package com.lianyu.tech.website.web.controller.verify; import com.lianyu.tech.core.platform.exception.InvalidRequestException; import com.lianyu.tech.core.util.StringUtils; import com.lianyu.tech.website.web.SessionConstants; import com.lianyu.tech.website.web.SiteContext; import org.springframework.stereotype.Service; import javax.inject.Inject; /** * @author bowen */ @Service public class VerifyCodeValidator { @Inject SiteContext siteContext; public void setVerifyCode(String code) { siteContext.addSession(SessionConstants.VERIFY_CODE_IMG, code); } public void verify(String code) { String sessionCode = siteContext.getSession(SessionConstants.VERIFY_CODE_IMG); if (!StringUtils.hasText(sessionCode)) { throw new InvalidRequestException("验证码不存在"); } if (!sessionCode.equalsIgnoreCase(code)) { throw new InvalidRequestException("验证码不正确"); } } }
apache-2.0
prebid/prebid-server
metrics/metrics_mock.go
4060
package metrics import ( "time" "github.com/prebid/prebid-server/openrtb_ext" "github.com/stretchr/testify/mock" ) // MetricsEngineMock is mock for the MetricsEngine interface type MetricsEngineMock struct { mock.Mock } // RecordRequest mock func (me *MetricsEngineMock) RecordRequest(labels Labels) { me.Called(labels) } // RecordConnectionAccept mock func (me *MetricsEngineMock) RecordConnectionAccept(success bool) { me.Called(success) } // RecordConnectionClose mock func (me *MetricsEngineMock) RecordConnectionClose(success bool) { me.Called(success) } // RecordImps mock func (me *MetricsEngineMock) RecordImps(labels ImpLabels) { me.Called(labels) } // RecordRequestTime mock func (me *MetricsEngineMock) RecordRequestTime(labels Labels, length time.Duration) { me.Called(labels, length) } // RecordStoredDataFetchTime mock func (me *MetricsEngineMock) RecordStoredDataFetchTime(labels StoredDataLabels, length time.Duration) { me.Called(labels, length) } // RecordStoredDataError mock func (me *MetricsEngineMock) RecordStoredDataError(labels StoredDataLabels) { me.Called(labels) } // RecordAdapterPanic mock func (me *MetricsEngineMock) RecordAdapterPanic(labels AdapterLabels) { me.Called(labels) } // RecordAdapterRequest mock func (me *MetricsEngineMock) RecordAdapterRequest(labels AdapterLabels) { me.Called(labels) } // RecordAdapterConnections mock func (me *MetricsEngineMock) RecordAdapterConnections(bidderName openrtb_ext.BidderName, connWasReused bool, connWaitTime time.Duration) { me.Called(bidderName, connWasReused, connWaitTime) } // RecordDNSTime mock func (me *MetricsEngineMock) RecordDNSTime(dnsLookupTime time.Duration) { me.Called(dnsLookupTime) } func (me *MetricsEngineMock) RecordTLSHandshakeTime(tlsHandshakeTime time.Duration) { me.Called(tlsHandshakeTime) } // RecordAdapterBidReceived mock func (me *MetricsEngineMock) RecordAdapterBidReceived(labels AdapterLabels, bidType openrtb_ext.BidType, hasAdm bool) { me.Called(labels, bidType, hasAdm) } // RecordAdapterPrice mock func (me *MetricsEngineMock) RecordAdapterPrice(labels AdapterLabels, cpm float64) { me.Called(labels, cpm) } // RecordAdapterTime mock func (me *MetricsEngineMock) RecordAdapterTime(labels AdapterLabels, length time.Duration) { me.Called(labels, length) } // RecordCookieSync mock func (me *MetricsEngineMock) RecordCookieSync(status CookieSyncStatus) { me.Called(status) } // RecordSyncerRequest mock func (me *MetricsEngineMock) RecordSyncerRequest(key string, status SyncerCookieSyncStatus) { me.Called(key, status) } // RecordSetUid mock func (me *MetricsEngineMock) RecordSetUid(status SetUidStatus) { me.Called(status) } // RecordSyncerSet mock func (me *MetricsEngineMock) RecordSyncerSet(key string, status SyncerSetUidStatus) { me.Called(key, status) } // RecordStoredReqCacheResult mock func (me *MetricsEngineMock) RecordStoredReqCacheResult(cacheResult CacheResult, inc int) { me.Called(cacheResult, inc) } // RecordStoredImpCacheResult mock func (me *MetricsEngineMock) RecordStoredImpCacheResult(cacheResult CacheResult, inc int) { me.Called(cacheResult, inc) } // RecordAccountCacheResult mock func (me *MetricsEngineMock) RecordAccountCacheResult(cacheResult CacheResult, inc int) { me.Called(cacheResult, inc) } // RecordPrebidCacheRequestTime mock func (me *MetricsEngineMock) RecordPrebidCacheRequestTime(success bool, length time.Duration) { me.Called(success, length) } // RecordRequestQueueTime mock func (me *MetricsEngineMock) RecordRequestQueueTime(success bool, requestType RequestType, length time.Duration) { me.Called(success, requestType, length) } // RecordTimeoutNotice mock func (me *MetricsEngineMock) RecordTimeoutNotice(success bool) { me.Called(success) } // RecordRequestPrivacy mock func (me *MetricsEngineMock) RecordRequestPrivacy(privacy PrivacyLabels) { me.Called(privacy) } // RecordAdapterGDPRRequestBlocked mock func (me *MetricsEngineMock) RecordAdapterGDPRRequestBlocked(adapterName openrtb_ext.BidderName) { me.Called(adapterName) }
apache-2.0
javabits/yar
yar-api/src/main/java/org/javabits/yar/SupplierListener.java
886
/* * Copyright 2013 Romain Gilles * * 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.javabits.yar; import java.util.EventListener; /** * TODO comment * Date: 4/2/13 * Time: 10:16 PM * * @author Romain Gilles */ public interface SupplierListener extends EventListener { void supplierChanged(SupplierEvent supplierEvent); }
apache-2.0
mdoering/backbone
life/Fungi/Ascomycota/Arthoniomycetes/Arthoniales/Arthoniaceae/Arthonia/Arthonia esculenta/README.md
183
# Arthonia esculenta (Pall.) Ach. SPECIES #### Status ACCEPTED #### According to Index Fungorum #### Published in null #### Original name Lichen esculentus Pall. ### Remarks null
apache-2.0
Shynixn/PetBlocks
docs/build/html/customizing/ai.html
18539
<!DOCTYPE html> <!--[if IE 8]><html class="no-js lt-ie9" lang="en" > <![endif]--> <!--[if gt IE 8]><!--> <html class="no-js" lang="en" > <!--<![endif]--> <head> <meta charset="utf-8"> <meta name="generator" content="Docutils 0.17.1: http://docutils.sourceforge.net/" /> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>AIS &mdash; PetBlocks 8.29.1 documentation</title> <link rel="shortcut icon" href="../_static/favicon.png"/> <link rel="stylesheet" href="../_static/css/theme.css" type="text/css" /> <link rel="stylesheet" href="../_static/pygments.css" type="text/css" /> <link rel="stylesheet" href="../_static/css/theme.css" type="text/css" /> <link rel="index" title="Index" href="../genindex.html"/> <link rel="search" title="Search" href="../search.html"/> <link rel="top" title="PetBlocks 8.29.1 documentation" href="../index.html"/> <link rel="up" title="Customizing" href="index.html"/> <link rel="next" title="Afraid of Water" href="afraidofwater.html"/> <link rel="prev" title="All tags" href="guialltags.html"/> <script src="../_static/js/modernizr.min.js"></script> </head> <body class="wy-body-for-nav" role="document"> <div class="wy-grid-for-nav"> <nav data-toggle="wy-nav-shift" class="wy-nav-side"> <div class="wy-side-scroll"> <div class="wy-side-nav-search"> <a href="../index.html" class="icon icon-home"> PetBlocks <img src="../_static/PetBlocks-small.png" class="logo" /> </a> <div class="version"> 8.29.1 </div> <div role="search"> <form id="rtd-search-form" class="wy-form" action="../search.html" method="get"> <input type="text" name="q" placeholder="Search docs" /> <input type="hidden" name="check_keywords" value="yes" /> <input type="hidden" name="area" value="default" /> </form> </div> </div> <div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation"> <ul class="current"> <li class="toctree-l1"><a class="reference internal" href="../gettingstarted/index.html">Getting Started</a></li> <li class="toctree-l1"><a class="reference internal" href="../pets/index.html">Pets</a></li> <li class="toctree-l1 current"><a class="reference internal" href="index.html">Customizing</a><ul class="current"> <li class="toctree-l2"><a class="reference internal" href="gui.html">GUI</a></li> <li class="toctree-l2 current"><a class="current reference internal" href="#">AIS</a><ul> <li class="toctree-l3"><a class="reference internal" href="afraidofwater.html">Afraid of Water</a></li> <li class="toctree-l3"><a class="reference internal" href="ambientsound.html">Ambient Sound</a></li> <li class="toctree-l3"><a class="reference internal" href="buffeffect.html">Buff Effect</a></li> <li class="toctree-l3"><a class="reference internal" href="carry.html">Carry</a></li> <li class="toctree-l3"><a class="reference internal" href="entitynbt.html">Entity-NBT</a></li> <li class="toctree-l3"><a class="reference internal" href="feeding.html">Feeding</a></li> <li class="toctree-l3"><a class="reference internal" href="fleeincombat.html">Flee in Combat</a></li> <li class="toctree-l3"><a class="reference internal" href="floatinwater.html">Float in Water</a></li> <li class="toctree-l3"><a class="reference internal" href="flying.html">Flying</a></li> <li class="toctree-l3"><a class="reference internal" href="flyriding.html">Fly Riding</a></li> <li class="toctree-l3"><a class="reference internal" href="followback.html">Follow Back</a></li> <li class="toctree-l3"><a class="reference internal" href="followowner.html">Follow Owner</a></li> <li class="toctree-l3"><a class="reference internal" href="groundriding.html">Ground Riding</a></li> <li class="toctree-l3"><a class="reference internal" href="health.html">Health</a></li> <li class="toctree-l3"><a class="reference internal" href="hopping.html">Hopping</a></li> <li class="toctree-l3"><a class="reference internal" href="inventory.html">Inventory</a></li> <li class="toctree-l3"><a class="reference internal" href="aiparticle.html">Particle</a></li> <li class="toctree-l3"><a class="reference internal" href="walking.html">Walking</a></li> <li class="toctree-l3"><a class="reference internal" href="wearing.html">Wearing</a></li> </ul> </li> <li class="toctree-l2"><a class="reference internal" href="events.html">Events</a></li> <li class="toctree-l2"><a class="reference internal" href="example.html">Examples</a></li> <li class="toctree-l2"><a class="reference internal" href="regions.html">Worlds and Regions</a></li> <li class="toctree-l2"><a class="reference internal" href="minecraftheads.html">Minecraft-Heads.com</a></li> <li class="toctree-l2"><a class="reference internal" href="headdatabase.html">Head Database</a></li> <li class="toctree-l2"><a class="reference internal" href="placeholders.html">Placeholders</a></li> </ul> </li> <li class="toctree-l1"><a class="reference internal" href="../commands/index.html">Commands</a></li> <li class="toctree-l1"><a class="reference internal" href="../general/index.html">General</a></li> <li class="toctree-l1"><a class="reference internal" href="../api/index.html">Developer API</a></li> <li class="toctree-l1"><a class="reference internal" href="../faq/index.html">FAQ</a></li> <li class="toctree-l1"><a class="reference internal" href="../contributing/index.html">Contributing to PetBlock</a></li> </ul> </div> </div> </nav> <section data-toggle="wy-nav-shift" class="wy-nav-content-wrap"> <nav class="wy-nav-top" role="navigation" aria-label="top navigation"> <i data-toggle="wy-nav-top" class="fa fa-bars"></i> <a href="../index.html">PetBlocks</a> </nav> <div class="wy-nav-content"> <div class="rst-content"> <div role="navigation" aria-label="breadcrumbs navigation"> <ul class="wy-breadcrumbs"> <li><a href="../index.html">Docs</a> &raquo;</li> <li><a href="index.html">Customizing</a> &raquo;</li> <li>AIS</li> <li class="wy-breadcrumbs-aside"> <a href="https://github.com/Shynixn/PetBlocks/tree/master/docs/source/customizing/ai.rst" class="fa fa-github"> Edit on GitHub</a> </li> </ul> <hr/> </div> <div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article"> <div itemprop="articleBody"> <section id="ais"> <h1>AIS<a class="headerlink" href="#ais" title="Permalink to this headline">¶</a></h1> <p>The articles in this section explain how to use and customize the ais in PetBlocks. Make sure you have read the <a class="reference external" href="../pets/index.html">introduction to PetBlocks</a> first.</p> <div class="admonition note"> <p class="admonition-title">Note</p> <p>The idea behind of the ai system is to let you, the owner of the server, craft a highly customizable pet with custom behaviour which perfectly fits your server environment.</p> </div> <div class="toctree-wrapper compound"> <ul> <li class="toctree-l1"><a class="reference internal" href="afraidofwater.html">Afraid of Water</a><ul> <li class="toctree-l2"><a class="reference internal" href="afraidofwater.html#requirements">Requirements</a></li> <li class="toctree-l2"><a class="reference internal" href="afraidofwater.html#configuring-in-your-config-yml">Configuring in your config.yml</a></li> <li class="toctree-l2"><a class="reference internal" href="afraidofwater.html#properties">Properties</a></li> </ul> </li> <li class="toctree-l1"><a class="reference internal" href="ambientsound.html">Ambient Sound</a><ul> <li class="toctree-l2"><a class="reference internal" href="ambientsound.html#requirements">Requirements</a></li> <li class="toctree-l2"><a class="reference internal" href="ambientsound.html#configuring-in-your-config-yml">Configuring in your config.yml</a></li> <li class="toctree-l2"><a class="reference internal" href="ambientsound.html#properties">Properties</a></li> </ul> </li> <li class="toctree-l1"><a class="reference internal" href="buffeffect.html">Buff Effect</a><ul> <li class="toctree-l2"><a class="reference internal" href="buffeffect.html#requirements">Requirements</a></li> <li class="toctree-l2"><a class="reference internal" href="buffeffect.html#configuring-in-your-config-yml">Configuring in your config.yml</a></li> <li class="toctree-l2"><a class="reference internal" href="buffeffect.html#properties">Properties</a></li> </ul> </li> <li class="toctree-l1"><a class="reference internal" href="carry.html">Carry</a><ul> <li class="toctree-l2"><a class="reference internal" href="carry.html#requirements">Requirements</a></li> <li class="toctree-l2"><a class="reference internal" href="carry.html#configuring-in-your-config-yml">Configuring in your config.yml</a></li> <li class="toctree-l2"><a class="reference internal" href="carry.html#properties">Properties</a></li> </ul> </li> <li class="toctree-l1"><a class="reference internal" href="entitynbt.html">Entity-NBT</a><ul> <li class="toctree-l2"><a class="reference internal" href="entitynbt.html#configuration">Configuration</a></li> <li class="toctree-l2"><a class="reference internal" href="entitynbt.html#sample">Sample</a></li> </ul> </li> <li class="toctree-l1"><a class="reference internal" href="feeding.html">Feeding</a><ul> <li class="toctree-l2"><a class="reference internal" href="feeding.html#requirements">Requirements</a></li> <li class="toctree-l2"><a class="reference internal" href="feeding.html#configuring-in-your-config-yml">Configuring in your config.yml</a></li> <li class="toctree-l2"><a class="reference internal" href="feeding.html#properties">Properties</a></li> </ul> </li> <li class="toctree-l1"><a class="reference internal" href="fleeincombat.html">Flee in Combat</a><ul> <li class="toctree-l2"><a class="reference internal" href="fleeincombat.html#requirements">Requirements</a></li> <li class="toctree-l2"><a class="reference internal" href="fleeincombat.html#configuring-in-your-config-yml">Configuring in your config.yml</a></li> <li class="toctree-l2"><a class="reference internal" href="fleeincombat.html#properties">Properties</a></li> </ul> </li> <li class="toctree-l1"><a class="reference internal" href="floatinwater.html">Float in Water</a><ul> <li class="toctree-l2"><a class="reference internal" href="floatinwater.html#requirements">Requirements</a></li> <li class="toctree-l2"><a class="reference internal" href="floatinwater.html#configuring-in-your-config-yml">Configuring in your config.yml</a></li> <li class="toctree-l2"><a class="reference internal" href="floatinwater.html#properties">Properties</a></li> </ul> </li> <li class="toctree-l1"><a class="reference internal" href="flying.html">Flying</a><ul> <li class="toctree-l2"><a class="reference internal" href="flying.html#requirements">Requirements</a></li> <li class="toctree-l2"><a class="reference internal" href="flying.html#configuring-in-your-config-yml">Configuring in your config.yml</a></li> <li class="toctree-l2"><a class="reference internal" href="flying.html#properties">Properties</a></li> </ul> </li> <li class="toctree-l1"><a class="reference internal" href="flyriding.html">Fly Riding</a><ul> <li class="toctree-l2"><a class="reference internal" href="flyriding.html#requirements">Requirements</a></li> <li class="toctree-l2"><a class="reference internal" href="flyriding.html#configuring-in-your-config-yml">Configuring in your config.yml</a></li> <li class="toctree-l2"><a class="reference internal" href="flyriding.html#properties">Properties</a></li> </ul> </li> <li class="toctree-l1"><a class="reference internal" href="followback.html">Follow Back</a><ul> <li class="toctree-l2"><a class="reference internal" href="followback.html#requirements">Requirements</a></li> <li class="toctree-l2"><a class="reference internal" href="followback.html#configuring-in-your-config-yml">Configuring in your config.yml</a></li> <li class="toctree-l2"><a class="reference internal" href="followback.html#properties">Properties</a></li> </ul> </li> <li class="toctree-l1"><a class="reference internal" href="followowner.html">Follow Owner</a><ul> <li class="toctree-l2"><a class="reference internal" href="followowner.html#requirements">Requirements</a></li> <li class="toctree-l2"><a class="reference internal" href="followowner.html#configuring-in-your-config-yml">Configuring in your config.yml</a></li> <li class="toctree-l2"><a class="reference internal" href="followowner.html#properties">Properties</a></li> </ul> </li> <li class="toctree-l1"><a class="reference internal" href="groundriding.html">Ground Riding</a><ul> <li class="toctree-l2"><a class="reference internal" href="groundriding.html#requirements">Requirements</a></li> <li class="toctree-l2"><a class="reference internal" href="groundriding.html#configuring-in-your-config-yml">Configuring in your config.yml</a></li> <li class="toctree-l2"><a class="reference internal" href="groundriding.html#properties">Properties</a></li> </ul> </li> <li class="toctree-l1"><a class="reference internal" href="health.html">Health</a><ul> <li class="toctree-l2"><a class="reference internal" href="health.html#requirements">Requirements</a></li> <li class="toctree-l2"><a class="reference internal" href="health.html#configuring-in-your-config-yml">Configuring in your config.yml</a></li> <li class="toctree-l2"><a class="reference internal" href="health.html#properties">Properties</a></li> </ul> </li> <li class="toctree-l1"><a class="reference internal" href="hopping.html">Hopping</a><ul> <li class="toctree-l2"><a class="reference internal" href="hopping.html#requirements">Requirements</a></li> <li class="toctree-l2"><a class="reference internal" href="hopping.html#configuring-in-your-config-yml">Configuring in your config.yml</a></li> <li class="toctree-l2"><a class="reference internal" href="hopping.html#properties">Properties</a></li> </ul> </li> <li class="toctree-l1"><a class="reference internal" href="inventory.html">Inventory</a><ul> <li class="toctree-l2"><a class="reference internal" href="inventory.html#requirements">Requirements</a></li> <li class="toctree-l2"><a class="reference internal" href="inventory.html#configuring-in-your-config-yml">Configuring in your config.yml</a></li> <li class="toctree-l2"><a class="reference internal" href="inventory.html#properties">Properties</a></li> </ul> </li> <li class="toctree-l1"><a class="reference internal" href="aiparticle.html">Particle</a><ul> <li class="toctree-l2"><a class="reference internal" href="aiparticle.html#configuring-in-your-config-yml">Configuring in your config.yml</a></li> <li class="toctree-l2"><a class="reference internal" href="aiparticle.html#properties">Properties</a></li> </ul> </li> <li class="toctree-l1"><a class="reference internal" href="walking.html">Walking</a><ul> <li class="toctree-l2"><a class="reference internal" href="walking.html#requirements">Requirements</a></li> <li class="toctree-l2"><a class="reference internal" href="walking.html#configuring-in-your-config-yml">Configuring in your config.yml</a></li> <li class="toctree-l2"><a class="reference internal" href="walking.html#properties">Properties</a></li> </ul> </li> <li class="toctree-l1"><a class="reference internal" href="wearing.html">Wearing</a><ul> <li class="toctree-l2"><a class="reference internal" href="wearing.html#requirements">Requirements</a></li> <li class="toctree-l2"><a class="reference internal" href="wearing.html#configuring-in-your-config-yml">Configuring in your config.yml</a></li> <li class="toctree-l2"><a class="reference internal" href="wearing.html#properties">Properties</a></li> </ul> </li> </ul> </div> <div class="admonition note"> <p class="admonition-title">Note</p> <p>You can always list up the current ais of any pet of any player via the administration command. <strong>/petblocks debug</strong></p> </div> <img alt="../_images/pet-debug.png" src="../_images/pet-debug.png" /> </section> </div> <div class="articleComments"> </div> </div> <footer> <div class="rst-footer-buttons" role="navigation" aria-label="footer navigation"> <a href="afraidofwater.html" class="btn btn-neutral float-right" title="Afraid of Water" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right"></span></a> <a href="guialltags.html" class="btn btn-neutral" title="All tags" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left"></span> Previous</a> </div> <hr/> <div role="contentinfo"> <p> &copy; Copyright 2015 - 2021, Shynixn. </p> </div> </footer> </div> </div> </section> </div> <script type="text/javascript"> var DOCUMENTATION_OPTIONS = { URL_ROOT:'../', VERSION:'8.29.1', LANGUAGE:'None', COLLAPSE_INDEX:false, FILE_SUFFIX:'.html', HAS_SOURCE: true, SOURCELINK_SUFFIX: '.txt' }; </script> <script type="text/javascript" src="../_static/documentation_options.js"></script> <script type="text/javascript" src="../_static/jquery.js"></script> <script type="text/javascript" src="../_static/underscore.js"></script> <script type="text/javascript" src="../_static/doctools.js"></script> <script type="text/javascript" src="../_static/js/theme.js"></script> <script type="text/javascript"> jQuery(function () { SphinxRtdTheme.StickyNav.enable(); }); </script> <script async src="https://www.googletagmanager.com/gtag/js?id=UA-111364476-1"></script> <script> window.dataLayer = window.dataLayer || []; function gtag(){dataLayer.push(arguments);} gtag('js', new Date()); gtag('config', 'UA-111364476-1'); </script> </body> </html>
apache-2.0
JetBrains/resharper-unity
resharper/resharper-unity/src/Unity/CSharp/Feature/Services/CallGraph/PerformanceAnalysis/PerformanceAnalysisContextActionBase.cs
1574
using JetBrains.Annotations; using JetBrains.Diagnostics; using JetBrains.ProjectModel; using JetBrains.ReSharper.Daemon; using JetBrains.ReSharper.Feature.Services.CSharp.ContextActions; using JetBrains.ReSharper.Plugins.Unity.CSharp.Daemon.Stages.PerformanceCriticalCodeAnalysis.ContextSystem; using JetBrains.ReSharper.Psi.CSharp.Tree; using JetBrains.Util; namespace JetBrains.ReSharper.Plugins.Unity.CSharp.Feature.Services.CallGraph.PerformanceAnalysis { public abstract class PerformanceAnalysisContextActionBase: CallGraphContextActionBase { [NotNull] protected readonly PerformanceCriticalContextProvider PerformanceContextProvider; [NotNull] protected readonly ExpensiveInvocationContextProvider ExpensiveContextProvider; [NotNull] protected readonly SolutionAnalysisService SolutionAnalysisService; protected PerformanceAnalysisContextActionBase([NotNull] ICSharpContextActionDataProvider dataProvider) : base(dataProvider) { ExpensiveContextProvider = dataProvider.Solution.GetComponent<ExpensiveInvocationContextProvider>().NotNull(); PerformanceContextProvider = dataProvider.Solution.GetComponent<PerformanceCriticalContextProvider>().NotNull(); SolutionAnalysisService = dataProvider.Solution.GetComponent<SolutionAnalysisService>().NotNull(); } protected override bool IsAvailable(IUserDataHolder cache, IMethodDeclaration containingMethod) { return PerformanceAnalysisUtil.IsAvailable(containingMethod); } } }
apache-2.0
kbabioch/arx
doc/gui/org/deidentifier/arx/gui/view/impl/menu/DialogSeparator.html
19025
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <!-- NewPage --> <html lang="en"> <head> <title>DialogSeparator (ARX GUI Documentation)</title> <link rel="stylesheet" type="text/css" href="../../../../../../../stylesheet.css" title="Style"> </head> <body> <script type="text/javascript"><!-- if (location.href.indexOf('is-external=true') == -1) { parent.document.title="DialogSeparator (ARX GUI Documentation)"; } //--> </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 class="navBarCell1Rev">Class</li> <li><a href="class-use/DialogSeparator.html">Use</a></li> <li><a href="package-tree.html">Tree</a></li> <li><a href="../../../../../../../deprecated-list.html">Deprecated</a></li> <li><a href="../../../../../../../index-all.html">Index</a></li> <li><a href="../../../../../../../help-doc.html">Help</a></li> </ul> </div> <div class="subNav"> <ul class="navList"> <li><a href="../../../../../../../org/deidentifier/arx/gui/view/impl/menu/DialogQueryResult.html" title="class in org.deidentifier.arx.gui.view.impl.menu"><span class="strong">Prev Class</span></a></li> <li><a href="../../../../../../../org/deidentifier/arx/gui/view/impl/menu/DialogTopBottomCoding.html" title="class in org.deidentifier.arx.gui.view.impl.menu"><span class="strong">Next Class</span></a></li> </ul> <ul class="navList"> <li><a href="../../../../../../../index.html?org/deidentifier/arx/gui/view/impl/menu/DialogSeparator.html" target="_top">Frames</a></li> <li><a href="DialogSeparator.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> <div> <ul class="subNavList"> <li>Summary:&nbsp;</li> <li><a href="#nested_classes_inherited_from_class_org.eclipse.jface.window.Window">Nested</a>&nbsp;|&nbsp;</li> <li><a href="#fields_inherited_from_class_org.eclipse.jface.dialogs.TitleAreaDialog">Field</a>&nbsp;|&nbsp;</li> <li><a href="#constructor_summary">Constr</a>&nbsp;|&nbsp;</li> <li><a href="#method_summary">Method</a></li> </ul> <ul class="subNavList"> <li>Detail:&nbsp;</li> <li>Field&nbsp;|&nbsp;</li> <li><a href="#constructor_detail">Constr</a>&nbsp;|&nbsp;</li> <li><a href="#method_detail">Method</a></li> </ul> </div> <a name="skip-navbar_top"> <!-- --> </a></div> <!-- ========= END OF TOP NAVBAR ========= --> <!-- ======== START OF CLASS DATA ======== --> <div class="header"> <div class="subTitle">org.deidentifier.arx.gui.view.impl.menu</div> <h2 title="Class DialogSeparator" class="title">Class DialogSeparator</h2> </div> <div class="contentContainer"> <ul class="inheritance"> <li>java.lang.Object</li> <li> <ul class="inheritance"> <li>org.eclipse.jface.window.Window</li> <li> <ul class="inheritance"> <li>org.eclipse.jface.dialogs.Dialog</li> <li> <ul class="inheritance"> <li>org.eclipse.jface.dialogs.TrayDialog</li> <li> <ul class="inheritance"> <li>org.eclipse.jface.dialogs.TitleAreaDialog</li> <li> <ul class="inheritance"> <li>org.deidentifier.arx.gui.view.impl.menu.DialogSeparator</li> </ul> </li> </ul> </li> </ul> </li> </ul> </li> </ul> </li> </ul> <div class="description"> <ul class="blockList"> <li class="blockList"> <dl> <dt>All Implemented Interfaces:</dt> <dd><a href="../../../../../../../org/deidentifier/arx/gui/view/def/IDialog.html" title="interface in org.deidentifier.arx.gui.view.def">IDialog</a>, org.eclipse.jface.window.IShellProvider</dd> </dl> <hr> <br> <pre>public class <span class="strong">DialogSeparator</span> extends org.eclipse.jface.dialogs.TitleAreaDialog implements <a href="../../../../../../../org/deidentifier/arx/gui/view/def/IDialog.html" title="interface in org.deidentifier.arx.gui.view.def">IDialog</a></pre> </li> </ul> </div> <div class="summary"> <ul class="blockList"> <li class="blockList"> <!-- ======== NESTED CLASS SUMMARY ======== --> <ul class="blockList"> <li class="blockList"><a name="nested_class_summary"> <!-- --> </a> <h3>Nested Class Summary</h3> <ul class="blockList"> <li class="blockList"><a name="nested_classes_inherited_from_class_org.eclipse.jface.window.Window"> <!-- --> </a> <h3>Nested classes/interfaces inherited from class&nbsp;org.eclipse.jface.window.Window</h3> <code>org.eclipse.jface.window.Window.IExceptionHandler</code></li> </ul> </li> </ul> <!-- =========== FIELD SUMMARY =========== --> <ul class="blockList"> <li class="blockList"><a name="field_summary"> <!-- --> </a> <h3>Field Summary</h3> <ul class="blockList"> <li class="blockList"><a name="fields_inherited_from_class_org.eclipse.jface.dialogs.TitleAreaDialog"> <!-- --> </a> <h3>Fields inherited from class&nbsp;org.eclipse.jface.dialogs.TitleAreaDialog</h3> <code>DLG_IMG_TITLE_BANNER, DLG_IMG_TITLE_ERROR, INFO_MESSAGE, WARNING_MESSAGE</code></li> </ul> <ul class="blockList"> <li class="blockList"><a name="fields_inherited_from_class_org.eclipse.jface.dialogs.Dialog"> <!-- --> </a> <h3>Fields inherited from class&nbsp;org.eclipse.jface.dialogs.Dialog</h3> <code>blockedHandler, buttonBar, DIALOG_DEFAULT_BOUNDS, DIALOG_PERSISTLOCATION, DIALOG_PERSISTSIZE, dialogArea, DLG_IMG_ERROR, DLG_IMG_HELP, DLG_IMG_INFO, DLG_IMG_MESSAGE_ERROR, DLG_IMG_MESSAGE_INFO, DLG_IMG_MESSAGE_WARNING, DLG_IMG_QUESTION, DLG_IMG_WARNING, ELLIPSIS</code></li> </ul> <ul class="blockList"> <li class="blockList"><a name="fields_inherited_from_class_org.eclipse.jface.window.Window"> <!-- --> </a> <h3>Fields inherited from class&nbsp;org.eclipse.jface.window.Window</h3> <code>CANCEL, OK</code></li> </ul> </li> </ul> <!-- ======== CONSTRUCTOR SUMMARY ======== --> <ul class="blockList"> <li class="blockList"><a name="constructor_summary"> <!-- --> </a> <h3>Constructor Summary</h3> <table class="overviewSummary" border="0" cellpadding="3" cellspacing="0" summary="Constructor Summary table, listing constructors, and an explanation"> <caption><span>Constructors</span><span class="tabEnd">&nbsp;</span></caption> <tr> <th class="colOne" scope="col">Constructor and Description</th> </tr> <tr class="altColor"> <td class="colOne"><code><strong><a href="../../../../../../../org/deidentifier/arx/gui/view/impl/menu/DialogSeparator.html#DialogSeparator(org.eclipse.swt.widgets.Shell,%20org.deidentifier.arx.gui.Controller,%20java.lang.String,%20boolean)">DialogSeparator</a></strong>(org.eclipse.swt.widgets.Shell&nbsp;parent, <a href="../../../../../../../org/deidentifier/arx/gui/Controller.html" title="class in org.deidentifier.arx.gui">Controller</a>&nbsp;controller, java.lang.String&nbsp;file, boolean&nbsp;data)</code>&nbsp;</td> </tr> </table> </li> </ul> <!-- ========== METHOD SUMMARY =========== --> <ul class="blockList"> <li class="blockList"><a name="method_summary"> <!-- --> </a> <h3>Method Summary</h3> <table class="overviewSummary" border="0" cellpadding="3" cellspacing="0" summary="Method Summary table, listing methods, and an explanation"> <caption><span>Methods</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> <tr class="altColor"> <td class="colFirst"><code>protected void</code></td> <td class="colLast"><code><strong><a href="../../../../../../../org/deidentifier/arx/gui/view/impl/menu/DialogSeparator.html#configureShell(org.eclipse.swt.widgets.Shell)">configureShell</a></strong>(org.eclipse.swt.widgets.Shell&nbsp;newShell)</code>&nbsp;</td> </tr> <tr class="rowColor"> <td class="colFirst"><code>void</code></td> <td class="colLast"><code><strong><a href="../../../../../../../org/deidentifier/arx/gui/view/impl/menu/DialogSeparator.html#create()">create</a></strong>()</code>&nbsp;</td> </tr> <tr class="altColor"> <td class="colFirst"><code>protected void</code></td> <td class="colLast"><code><strong><a href="../../../../../../../org/deidentifier/arx/gui/view/impl/menu/DialogSeparator.html#createButtonsForButtonBar(org.eclipse.swt.widgets.Composite)">createButtonsForButtonBar</a></strong>(org.eclipse.swt.widgets.Composite&nbsp;parent)</code>&nbsp;</td> </tr> <tr class="rowColor"> <td class="colFirst"><code>protected org.eclipse.swt.widgets.Control</code></td> <td class="colLast"><code><strong><a href="../../../../../../../org/deidentifier/arx/gui/view/impl/menu/DialogSeparator.html#createDialogArea(org.eclipse.swt.widgets.Composite)">createDialogArea</a></strong>(org.eclipse.swt.widgets.Composite&nbsp;parent)</code>&nbsp;</td> </tr> <tr class="altColor"> <td class="colFirst"><code>char</code></td> <td class="colLast"><code><strong><a href="../../../../../../../org/deidentifier/arx/gui/view/impl/menu/DialogSeparator.html#getSeparator()">getSeparator</a></strong>()</code>&nbsp;</td> </tr> <tr class="rowColor"> <td class="colFirst"><code>protected org.eclipse.swt.events.ShellListener</code></td> <td class="colLast"><code><strong><a href="../../../../../../../org/deidentifier/arx/gui/view/impl/menu/DialogSeparator.html#getShellListener()">getShellListener</a></strong>()</code>&nbsp;</td> </tr> <tr class="altColor"> <td class="colFirst"><code>protected boolean</code></td> <td class="colLast"><code><strong><a href="../../../../../../../org/deidentifier/arx/gui/view/impl/menu/DialogSeparator.html#isResizable()">isResizable</a></strong>()</code>&nbsp;</td> </tr> </table> <ul class="blockList"> <li class="blockList"><a name="methods_inherited_from_class_org.eclipse.jface.dialogs.TitleAreaDialog"> <!-- --> </a> <h3>Methods inherited from class&nbsp;org.eclipse.jface.dialogs.TitleAreaDialog</h3> <code>createContents, getErrorMessage, getInitialSize, getMessage, getTitleArea, getTitleImageLabel, setErrorMessage, setMessage, setMessage, setTitle, setTitleAreaColor, setTitleImage</code></li> </ul> <ul class="blockList"> <li class="blockList"><a name="methods_inherited_from_class_org.eclipse.jface.dialogs.TrayDialog"> <!-- --> </a> <h3>Methods inherited from class&nbsp;org.eclipse.jface.dialogs.TrayDialog</h3> <code>closeTray, createButtonBar, createHelpControl, getLayout, getTray, handleShellCloseEvent, isDialogHelpAvailable, isHelpAvailable, openTray, setDialogHelpAvailable, setHelpAvailable</code></li> </ul> <ul class="blockList"> <li class="blockList"><a name="methods_inherited_from_class_org.eclipse.jface.dialogs.Dialog"> <!-- --> </a> <h3>Methods inherited from class&nbsp;org.eclipse.jface.dialogs.Dialog</h3> <code>applyDialogFont, buttonPressed, cancelPressed, close, convertHeightInCharsToPixels, convertHeightInCharsToPixels, convertHorizontalDLUsToPixels, convertHorizontalDLUsToPixels, convertVerticalDLUsToPixels, convertVerticalDLUsToPixels, convertWidthInCharsToPixels, convertWidthInCharsToPixels, createButton, dialogFontIsDefault, getBlockedHandler, getButton, getButtonBar, getCancelButton, getDialogArea, getDialogBoundsSettings, getDialogBoundsStrategy, getImage, getInitialLocation, getOKButton, initializeBounds, initializeDialogUnits, okPressed, setBlockedHandler, setButtonLayoutData, setButtonLayoutFormData, shortenText</code></li> </ul> <ul class="blockList"> <li class="blockList"><a name="methods_inherited_from_class_org.eclipse.jface.window.Window"> <!-- --> </a> <h3>Methods inherited from class&nbsp;org.eclipse.jface.window.Window</h3> <code>canHandleShellCloseEvent, constrainShellSize, createShell, getConstrainedShellBounds, getContents, getDefaultImage, getDefaultImages, getDefaultOrientation, getParentShell, getReturnCode, getShell, getShellStyle, getWindowManager, handleFontChange, open, setBlockOnOpen, setDefaultImage, setDefaultImages, setDefaultModalParent, setDefaultOrientation, setExceptionHandler, setParentShell, setReturnCode, setShellStyle, setWindowManager</code></li> </ul> <ul class="blockList"> <li class="blockList"><a name="methods_inherited_from_class_java.lang.Object"> <!-- --> </a> <h3>Methods inherited from class&nbsp;java.lang.Object</h3> <code>clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait</code></li> </ul> </li> </ul> </li> </ul> </div> <div class="details"> <ul class="blockList"> <li class="blockList"> <!-- ========= CONSTRUCTOR DETAIL ======== --> <ul class="blockList"> <li class="blockList"><a name="constructor_detail"> <!-- --> </a> <h3>Constructor Detail</h3> <a name="DialogSeparator(org.eclipse.swt.widgets.Shell, org.deidentifier.arx.gui.Controller, java.lang.String, boolean)"> <!-- --> </a> <ul class="blockListLast"> <li class="blockList"> <h4>DialogSeparator</h4> <pre>public&nbsp;DialogSeparator(org.eclipse.swt.widgets.Shell&nbsp;parent, <a href="../../../../../../../org/deidentifier/arx/gui/Controller.html" title="class in org.deidentifier.arx.gui">Controller</a>&nbsp;controller, java.lang.String&nbsp;file, boolean&nbsp;data)</pre> <dl><dt><span class="strong">Parameters:</span></dt><dd><code>parent</code> - </dd><dd><code>controller</code> - </dd><dd><code>file</code> - </dd><dd><code>data</code> - </dd></dl> </li> </ul> </li> </ul> <!-- ============ METHOD DETAIL ========== --> <ul class="blockList"> <li class="blockList"><a name="method_detail"> <!-- --> </a> <h3>Method Detail</h3> <a name="create()"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>create</h4> <pre>public&nbsp;void&nbsp;create()</pre> <dl> <dt><strong>Overrides:</strong></dt> <dd><code>create</code>&nbsp;in class&nbsp;<code>org.eclipse.jface.dialogs.Dialog</code></dd> </dl> </li> </ul> <a name="getSeparator()"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>getSeparator</h4> <pre>public&nbsp;char&nbsp;getSeparator()</pre> <dl><dt><span class="strong">Returns:</span></dt><dd></dd></dl> </li> </ul> <a name="configureShell(org.eclipse.swt.widgets.Shell)"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>configureShell</h4> <pre>protected&nbsp;void&nbsp;configureShell(org.eclipse.swt.widgets.Shell&nbsp;newShell)</pre> <dl> <dt><strong>Overrides:</strong></dt> <dd><code>configureShell</code>&nbsp;in class&nbsp;<code>org.eclipse.jface.window.Window</code></dd> </dl> </li> </ul> <a name="createButtonsForButtonBar(org.eclipse.swt.widgets.Composite)"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>createButtonsForButtonBar</h4> <pre>protected&nbsp;void&nbsp;createButtonsForButtonBar(org.eclipse.swt.widgets.Composite&nbsp;parent)</pre> <dl> <dt><strong>Overrides:</strong></dt> <dd><code>createButtonsForButtonBar</code>&nbsp;in class&nbsp;<code>org.eclipse.jface.dialogs.Dialog</code></dd> </dl> </li> </ul> <a name="createDialogArea(org.eclipse.swt.widgets.Composite)"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>createDialogArea</h4> <pre>protected&nbsp;org.eclipse.swt.widgets.Control&nbsp;createDialogArea(org.eclipse.swt.widgets.Composite&nbsp;parent)</pre> <dl> <dt><strong>Overrides:</strong></dt> <dd><code>createDialogArea</code>&nbsp;in class&nbsp;<code>org.eclipse.jface.dialogs.TitleAreaDialog</code></dd> </dl> </li> </ul> <a name="getShellListener()"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>getShellListener</h4> <pre>protected&nbsp;org.eclipse.swt.events.ShellListener&nbsp;getShellListener()</pre> <dl> <dt><strong>Overrides:</strong></dt> <dd><code>getShellListener</code>&nbsp;in class&nbsp;<code>org.eclipse.jface.window.Window</code></dd> </dl> </li> </ul> <a name="isResizable()"> <!-- --> </a> <ul class="blockListLast"> <li class="blockList"> <h4>isResizable</h4> <pre>protected&nbsp;boolean&nbsp;isResizable()</pre> <dl> <dt><strong>Overrides:</strong></dt> <dd><code>isResizable</code>&nbsp;in class&nbsp;<code>org.eclipse.jface.dialogs.Dialog</code></dd> </dl> </li> </ul> </li> </ul> </li> </ul> </div> </div> <!-- ========= END OF CLASS DATA ========= --> <!-- ======= 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 class="navBarCell1Rev">Class</li> <li><a href="class-use/DialogSeparator.html">Use</a></li> <li><a href="package-tree.html">Tree</a></li> <li><a href="../../../../../../../deprecated-list.html">Deprecated</a></li> <li><a href="../../../../../../../index-all.html">Index</a></li> <li><a href="../../../../../../../help-doc.html">Help</a></li> </ul> </div> <div class="subNav"> <ul class="navList"> <li><a href="../../../../../../../org/deidentifier/arx/gui/view/impl/menu/DialogQueryResult.html" title="class in org.deidentifier.arx.gui.view.impl.menu"><span class="strong">Prev Class</span></a></li> <li><a href="../../../../../../../org/deidentifier/arx/gui/view/impl/menu/DialogTopBottomCoding.html" title="class in org.deidentifier.arx.gui.view.impl.menu"><span class="strong">Next Class</span></a></li> </ul> <ul class="navList"> <li><a href="../../../../../../../index.html?org/deidentifier/arx/gui/view/impl/menu/DialogSeparator.html" target="_top">Frames</a></li> <li><a href="DialogSeparator.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> <div> <ul class="subNavList"> <li>Summary:&nbsp;</li> <li><a href="#nested_classes_inherited_from_class_org.eclipse.jface.window.Window">Nested</a>&nbsp;|&nbsp;</li> <li><a href="#fields_inherited_from_class_org.eclipse.jface.dialogs.TitleAreaDialog">Field</a>&nbsp;|&nbsp;</li> <li><a href="#constructor_summary">Constr</a>&nbsp;|&nbsp;</li> <li><a href="#method_summary">Method</a></li> </ul> <ul class="subNavList"> <li>Detail:&nbsp;</li> <li>Field&nbsp;|&nbsp;</li> <li><a href="#constructor_detail">Constr</a>&nbsp;|&nbsp;</li> <li><a href="#method_detail">Method</a></li> </ul> </div> <a name="skip-navbar_bottom"> <!-- --> </a></div> <!-- ======== END OF BOTTOM NAVBAR ======= --> </body> </html>
apache-2.0
consulo/consulo
modules/base/core-impl/src/main/java/com/intellij/extapi/psi/ASTWrapperPsiElement.java
1314
/* * Copyright 2000-2009 JetBrains s.r.o. * * 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.intellij.extapi.psi; import com.intellij.lang.ASTNode; import com.intellij.psi.PsiElement; import com.intellij.psi.impl.source.tree.SharedImplUtil; import javax.annotation.Nonnull; /** * @author max */ public class ASTWrapperPsiElement extends ASTDelegatePsiElement { private final ASTNode myNode; public ASTWrapperPsiElement(@Nonnull final ASTNode node) { myNode = node; } @Override public PsiElement getParent() { return SharedImplUtil.getParent(getNode()); } @Override @Nonnull public ASTNode getNode() { return myNode; } @Override public String toString() { return getClass().getSimpleName() + "(" + myNode.getElementType().toString() + ")"; } }
apache-2.0
adolfmc/zabbix-parent
zabbix-sisyphus/src/main/java/com/zabbix/sisyphus/contract/entity/CreditPro.java
4070
package com.zabbix.sisyphus.contract.entity; import java.io.Serializable; import java.math.BigDecimal; import java.util.Date; import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.Table; import javax.persistence.Temporal; import javax.persistence.TemporalType; /** * 借贷产品 *@author zabbix *2016年10月19日 */ @Entity @Table(name="con_t_credit_pro") public class CreditPro extends com.zabbix.sisyphus.base.entity.IdEntity implements Serializable { private static final long serialVersionUID = 1L; private BigDecimal amount; @Temporal(TemporalType.DATE) @Column(name="end_time") private Date endTime; private BigDecimal fee; private BigDecimal interest; @Column(name="into_amount") private BigDecimal intoAmount; @Column(name="manger_free") private BigDecimal mangerFree; private String memo; private BigDecimal number; @Column(name="pay_way") private String payWay; @Column(name="product_code") private String productCode; @Column(name="product_name") private String productName; @Column(name="repayment_amount") private BigDecimal repaymentAmount; @Column(name="service_charge") private BigDecimal serviceCharge; @Temporal(TemporalType.DATE) @Column(name="start_time") private Date startTime; private String status; @Column(name="total_cost") private BigDecimal totalCost; @Column(name="total_fee") private BigDecimal totalFee; public CreditPro() { } public BigDecimal getAmount() { return this.amount; } public void setAmount(BigDecimal amount) { this.amount = amount; } public Date getEndTime() { return this.endTime; } public void setEndTime(Date endTime) { this.endTime = endTime; } public BigDecimal getFee() { return this.fee; } public void setFee(BigDecimal fee) { this.fee = fee; } public BigDecimal getInterest() { return this.interest; } public void setInterest(BigDecimal interest) { this.interest = interest; } public BigDecimal getIntoAmount() { return this.intoAmount; } public void setIntoAmount(BigDecimal intoAmount) { this.intoAmount = intoAmount; } public BigDecimal getMangerFree() { return this.mangerFree; } public void setMangerFree(BigDecimal mangerFree) { this.mangerFree = mangerFree; } public String getMemo() { return this.memo; } public void setMemo(String memo) { this.memo = memo; } public BigDecimal getNumber() { return this.number; } public void setNumber(BigDecimal number) { this.number = number; } public String getPayWay() { return this.payWay; } public void setPayWay(String payWay) { this.payWay = payWay; } public String getProductCode() { return this.productCode; } public void setProductCode(String productCode) { this.productCode = productCode; } public String getProductName() { return this.productName; } public void setProductName(String productName) { this.productName = productName; } public BigDecimal getRepaymentAmount() { return this.repaymentAmount; } public void setRepaymentAmount(BigDecimal repaymentAmount) { this.repaymentAmount = repaymentAmount; } public BigDecimal getServiceCharge() { return this.serviceCharge; } public void setServiceCharge(BigDecimal serviceCharge) { this.serviceCharge = serviceCharge; } public Date getStartTime() { return this.startTime; } public void setStartTime(Date startTime) { this.startTime = startTime; } public String getStatus() { return this.status; } public void setStatus(String status) { this.status = status; } public BigDecimal getTotalCost() { return this.totalCost; } public void setTotalCost(BigDecimal totalCost) { this.totalCost = totalCost; } public BigDecimal getTotalFee() { return this.totalFee; } public void setTotalFee(BigDecimal totalFee) { this.totalFee = totalFee; } }
apache-2.0
xLeitix/jcloudscale
docs/javadoc/apidocs/at/ac/tuwien/infosys/jcloudscale/vm/localVm/package-use.html
7980
<!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_12-ea) on Wed Feb 05 23:03:20 CET 2014 --> <meta http-equiv="Content-Type" content="text/html" charset="UTF-8"> <title>Uses of Package at.ac.tuwien.infosys.jcloudscale.vm.localVm (JCloudScale 0.4.1-SNAPSHOT API)</title> <meta name="date" content="2014-02-05"> <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 Package at.ac.tuwien.infosys.jcloudscale.vm.localVm (JCloudScale 0.4.1-SNAPSHOT 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>Class</li> <li class="navBarCell1Rev">Use</li> <li><a href="package-tree.html">Tree</a></li> <li><a href="../../../../../../../deprecated-list.html">Deprecated</a></li> <li><a href="../../../../../../../index-all.html">Index</a></li> <li><a href="../../../../../../../help-doc.html">Help</a></li> </ul> </div> <div class="subNav"> <ul class="navList"> <li>Prev</li> <li>Next</li> </ul> <ul class="navList"> <li><a href="../../../../../../../index.html?at/ac/tuwien/infosys/jcloudscale/vm/localVm/package-use.html" target="_top">Frames</a></li> <li><a href="package-use.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"> <h1 title="Uses of Package at.ac.tuwien.infosys.jcloudscale.vm.localVm" class="title">Uses of Package<br>at.ac.tuwien.infosys.jcloudscale.vm.localVm</h1> </div> <div class="contentContainer"> <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="../../../../../../../at/ac/tuwien/infosys/jcloudscale/vm/localVm/package-summary.html">at.ac.tuwien.infosys.jcloudscale.vm.localVm</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="#at.ac.tuwien.infosys.jcloudscale.vm.ec2">at.ac.tuwien.infosys.jcloudscale.vm.ec2</a></td> <td class="colLast">&nbsp;</td> </tr> <tr class="rowColor"> <td class="colFirst"><a href="#at.ac.tuwien.infosys.jcloudscale.vm.localVm">at.ac.tuwien.infosys.jcloudscale.vm.localVm</a></td> <td class="colLast">&nbsp;</td> </tr> <tr class="altColor"> <td class="colFirst"><a href="#at.ac.tuwien.infosys.jcloudscale.vm.openstack">at.ac.tuwien.infosys.jcloudscale.vm.openstack</a></td> <td class="colLast">&nbsp;</td> </tr> </tbody> </table> </li> <li class="blockList"><a name="at.ac.tuwien.infosys.jcloudscale.vm.ec2"> <!-- --> </a> <table border="0" cellpadding="3" cellspacing="0" summary="Use table, listing classes, and an explanation"> <caption><span>Classes in <a href="../../../../../../../at/ac/tuwien/infosys/jcloudscale/vm/localVm/package-summary.html">at.ac.tuwien.infosys.jcloudscale.vm.localVm</a> used by <a href="../../../../../../../at/ac/tuwien/infosys/jcloudscale/vm/ec2/package-summary.html">at.ac.tuwien.infosys.jcloudscale.vm.ec2</a></span><span class="tabEnd">&nbsp;</span></caption> <tr> <th class="colOne" scope="col">Class and Description</th> </tr> <tbody> <tr class="altColor"> <td class="colOne"><a href="../../../../../../../at/ac/tuwien/infosys/jcloudscale/vm/localVm/class-use/LocalVM.html#at.ac.tuwien.infosys.jcloudscale.vm.ec2">LocalVM</a>&nbsp;</td> </tr> </tbody> </table> </li> <li class="blockList"><a name="at.ac.tuwien.infosys.jcloudscale.vm.localVm"> <!-- --> </a> <table border="0" cellpadding="3" cellspacing="0" summary="Use table, listing classes, and an explanation"> <caption><span>Classes in <a href="../../../../../../../at/ac/tuwien/infosys/jcloudscale/vm/localVm/package-summary.html">at.ac.tuwien.infosys.jcloudscale.vm.localVm</a> used by <a href="../../../../../../../at/ac/tuwien/infosys/jcloudscale/vm/localVm/package-summary.html">at.ac.tuwien.infosys.jcloudscale.vm.localVm</a></span><span class="tabEnd">&nbsp;</span></caption> <tr> <th class="colOne" scope="col">Class and Description</th> </tr> <tbody> <tr class="altColor"> <td class="colOne"><a href="../../../../../../../at/ac/tuwien/infosys/jcloudscale/vm/localVm/class-use/LocalCloudPlatformConfiguration.html#at.ac.tuwien.infosys.jcloudscale.vm.localVm">LocalCloudPlatformConfiguration</a>&nbsp;</td> </tr> </tbody> </table> </li> <li class="blockList"><a name="at.ac.tuwien.infosys.jcloudscale.vm.openstack"> <!-- --> </a> <table border="0" cellpadding="3" cellspacing="0" summary="Use table, listing classes, and an explanation"> <caption><span>Classes in <a href="../../../../../../../at/ac/tuwien/infosys/jcloudscale/vm/localVm/package-summary.html">at.ac.tuwien.infosys.jcloudscale.vm.localVm</a> used by <a href="../../../../../../../at/ac/tuwien/infosys/jcloudscale/vm/openstack/package-summary.html">at.ac.tuwien.infosys.jcloudscale.vm.openstack</a></span><span class="tabEnd">&nbsp;</span></caption> <tr> <th class="colOne" scope="col">Class and Description</th> </tr> <tbody> <tr class="altColor"> <td class="colOne"><a href="../../../../../../../at/ac/tuwien/infosys/jcloudscale/vm/localVm/class-use/LocalVM.html#at.ac.tuwien.infosys.jcloudscale.vm.openstack">LocalVM</a>&nbsp;</td> </tr> </tbody> </table> </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>Class</li> <li class="navBarCell1Rev">Use</li> <li><a href="package-tree.html">Tree</a></li> <li><a href="../../../../../../../deprecated-list.html">Deprecated</a></li> <li><a href="../../../../../../../index-all.html">Index</a></li> <li><a href="../../../../../../../help-doc.html">Help</a></li> </ul> </div> <div class="subNav"> <ul class="navList"> <li>Prev</li> <li>Next</li> </ul> <ul class="navList"> <li><a href="../../../../../../../index.html?at/ac/tuwien/infosys/jcloudscale/vm/localVm/package-use.html" target="_top">Frames</a></li> <li><a href="package-use.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>Copyright &#169; 2014. All Rights Reserved.</small></p> </body> </html>
apache-2.0
xqbase/util
util/src/test/java/Shutdown.java
269
import java.io.IOException; import java.net.Socket; public class Shutdown { public static void main(String[] args) throws IOException { try (Socket socket = new Socket("localhost", 8005)) { socket.getOutputStream().write("SHUTDOWN".getBytes()); } } }
apache-2.0
wildfly-swarm/wildfly-swarm-javadocs
2018.5.0/apidocs/org/wildfly/swarm/config/security/security_domain/ClassicACLConsumer.html
11886
<!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 (1.8.0_151) on Wed May 02 00:35:06 MST 2018 --> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>ClassicACLConsumer (BOM: * : All 2018.5.0 API)</title> <meta name="date" content="2018-05-02"> <link rel="stylesheet" type="text/css" href="../../../../../../stylesheet.css" title="Style"> <script type="text/javascript" src="../../../../../../script.js"></script> </head> <body> <script type="text/javascript"><!-- try { if (location.href.indexOf('is-external=true') == -1) { parent.document.title="ClassicACLConsumer (BOM: * : All 2018.5.0 API)"; } } catch(err) { } //--> var methods = {"i0":6,"i1":18}; var tabs = {65535:["t0","All Methods"],2:["t2","Instance Methods"],4:["t3","Abstract Methods"],16:["t5","Default Methods"]}; var altColor = "altColor"; var rowColor = "rowColor"; var tableTab = "tableTab"; var activeTableTab = "activeTableTab"; </script> <noscript> <div>JavaScript is disabled on your browser.</div> </noscript> <!-- ========= START OF TOP NAVBAR ======= --> <div class="topNav"><a name="navbar.top"> <!-- --> </a> <div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div> <a name="navbar.top.firstrow"> <!-- --> </a> <ul class="navList" title="Navigation"> <li><a href="../../../../../../overview-summary.html">Overview</a></li> <li><a href="package-summary.html">Package</a></li> <li class="navBarCell1Rev">Class</li> <li><a href="class-use/ClassicACLConsumer.html">Use</a></li> <li><a href="package-tree.html">Tree</a></li> <li><a href="../../../../../../deprecated-list.html">Deprecated</a></li> <li><a href="../../../../../../index-all.html">Index</a></li> <li><a href="../../../../../../help-doc.html">Help</a></li> </ul> <div class="aboutLanguage">WildFly Swarm API, 2018.5.0</div> </div> <div class="subNav"> <ul class="navList"> <li><a href="../../../../../../org/wildfly/swarm/config/security/security_domain/ClassicACL.ClassicACLResources.html" title="class in org.wildfly.swarm.config.security.security_domain"><span class="typeNameLink">Prev&nbsp;Class</span></a></li> <li><a href="../../../../../../org/wildfly/swarm/config/security/security_domain/ClassicACLSupplier.html" title="interface in org.wildfly.swarm.config.security.security_domain"><span class="typeNameLink">Next&nbsp;Class</span></a></li> </ul> <ul class="navList"> <li><a href="../../../../../../index.html?org/wildfly/swarm/config/security/security_domain/ClassicACLConsumer.html" target="_top">Frames</a></li> <li><a href="ClassicACLConsumer.html" target="_top">No&nbsp;Frames</a></li> </ul> <ul class="navList" id="allclasses_navbar_top"> <li><a href="../../../../../../allclasses-noframe.html">All&nbsp;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> <div> <ul class="subNavList"> <li>Summary:&nbsp;</li> <li>Nested&nbsp;|&nbsp;</li> <li>Field&nbsp;|&nbsp;</li> <li>Constr&nbsp;|&nbsp;</li> <li><a href="#method.summary">Method</a></li> </ul> <ul class="subNavList"> <li>Detail:&nbsp;</li> <li>Field&nbsp;|&nbsp;</li> <li>Constr&nbsp;|&nbsp;</li> <li><a href="#method.detail">Method</a></li> </ul> </div> <a name="skip.navbar.top"> <!-- --> </a></div> <!-- ========= END OF TOP NAVBAR ========= --> <!-- ======== START OF CLASS DATA ======== --> <div class="header"> <div class="subTitle">org.wildfly.swarm.config.security.security_domain</div> <h2 title="Interface ClassicACLConsumer" class="title">Interface ClassicACLConsumer&lt;T extends <a href="../../../../../../org/wildfly/swarm/config/security/security_domain/ClassicACL.html" title="class in org.wildfly.swarm.config.security.security_domain">ClassicACL</a>&lt;T&gt;&gt;</h2> </div> <div class="contentContainer"> <div class="description"> <ul class="blockList"> <li class="blockList"> <dl> <dt>Functional Interface:</dt> <dd>This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.</dd> </dl> <hr> <br> <pre><a href="http://docs.oracle.com/javase/8/docs/api/java/lang/FunctionalInterface.html?is-external=true" title="class or interface in java.lang">@FunctionalInterface</a> public interface <span class="typeNameLabel">ClassicACLConsumer&lt;T extends <a href="../../../../../../org/wildfly/swarm/config/security/security_domain/ClassicACL.html" title="class in org.wildfly.swarm.config.security.security_domain">ClassicACL</a>&lt;T&gt;&gt;</span></pre> </li> </ul> </div> <div class="summary"> <ul class="blockList"> <li class="blockList"> <!-- ========== METHOD SUMMARY =========== --> <ul class="blockList"> <li class="blockList"><a name="method.summary"> <!-- --> </a> <h3>Method Summary</h3> <table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Method Summary table, listing methods, and an explanation"> <caption><span id="t0" class="activeTableTab"><span>All Methods</span><span class="tabEnd">&nbsp;</span></span><span id="t2" class="tableTab"><span><a href="javascript:show(2);">Instance Methods</a></span><span class="tabEnd">&nbsp;</span></span><span id="t3" class="tableTab"><span><a href="javascript:show(4);">Abstract Methods</a></span><span class="tabEnd">&nbsp;</span></span><span id="t5" class="tableTab"><span><a href="javascript:show(16);">Default Methods</a></span><span class="tabEnd">&nbsp;</span></span></caption> <tr> <th class="colFirst" scope="col">Modifier and Type</th> <th class="colLast" scope="col">Method and Description</th> </tr> <tr id="i0" class="altColor"> <td class="colFirst"><code>void</code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../org/wildfly/swarm/config/security/security_domain/ClassicACLConsumer.html#accept-T-">accept</a></span>(<a href="../../../../../../org/wildfly/swarm/config/security/security_domain/ClassicACLConsumer.html" title="type parameter in ClassicACLConsumer">T</a>&nbsp;value)</code> <div class="block">Configure a pre-constructed instance of ClassicACL resource</div> </td> </tr> <tr id="i1" class="rowColor"> <td class="colFirst"><code>default <a href="../../../../../../org/wildfly/swarm/config/security/security_domain/ClassicACLConsumer.html" title="interface in org.wildfly.swarm.config.security.security_domain">ClassicACLConsumer</a>&lt;<a href="../../../../../../org/wildfly/swarm/config/security/security_domain/ClassicACLConsumer.html" title="type parameter in ClassicACLConsumer">T</a>&gt;</code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../org/wildfly/swarm/config/security/security_domain/ClassicACLConsumer.html#andThen-org.wildfly.swarm.config.security.security_domain.ClassicACLConsumer-">andThen</a></span>(<a href="../../../../../../org/wildfly/swarm/config/security/security_domain/ClassicACLConsumer.html" title="interface in org.wildfly.swarm.config.security.security_domain">ClassicACLConsumer</a>&lt;<a href="../../../../../../org/wildfly/swarm/config/security/security_domain/ClassicACLConsumer.html" title="type parameter in ClassicACLConsumer">T</a>&gt;&nbsp;after)</code>&nbsp;</td> </tr> </table> </li> </ul> </li> </ul> </div> <div class="details"> <ul class="blockList"> <li class="blockList"> <!-- ============ METHOD DETAIL ========== --> <ul class="blockList"> <li class="blockList"><a name="method.detail"> <!-- --> </a> <h3>Method Detail</h3> <a name="accept-org.wildfly.swarm.config.security.security_domain.ClassicACL-"> <!-- --> </a><a name="accept-T-"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>accept</h4> <pre>void&nbsp;accept(<a href="../../../../../../org/wildfly/swarm/config/security/security_domain/ClassicACLConsumer.html" title="type parameter in ClassicACLConsumer">T</a>&nbsp;value)</pre> <div class="block">Configure a pre-constructed instance of ClassicACL resource</div> </li> </ul> <a name="andThen-org.wildfly.swarm.config.security.security_domain.ClassicACLConsumer-"> <!-- --> </a> <ul class="blockListLast"> <li class="blockList"> <h4>andThen</h4> <pre>default&nbsp;<a href="../../../../../../org/wildfly/swarm/config/security/security_domain/ClassicACLConsumer.html" title="interface in org.wildfly.swarm.config.security.security_domain">ClassicACLConsumer</a>&lt;<a href="../../../../../../org/wildfly/swarm/config/security/security_domain/ClassicACLConsumer.html" title="type parameter in ClassicACLConsumer">T</a>&gt;&nbsp;andThen(<a href="../../../../../../org/wildfly/swarm/config/security/security_domain/ClassicACLConsumer.html" title="interface in org.wildfly.swarm.config.security.security_domain">ClassicACLConsumer</a>&lt;<a href="../../../../../../org/wildfly/swarm/config/security/security_domain/ClassicACLConsumer.html" title="type parameter in ClassicACLConsumer">T</a>&gt;&nbsp;after)</pre> </li> </ul> </li> </ul> </li> </ul> </div> </div> <!-- ========= END OF CLASS DATA ========= --> <!-- ======= START OF BOTTOM NAVBAR ====== --> <div class="bottomNav"><a name="navbar.bottom"> <!-- --> </a> <div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div> <a name="navbar.bottom.firstrow"> <!-- --> </a> <ul class="navList" title="Navigation"> <li><a href="../../../../../../overview-summary.html">Overview</a></li> <li><a href="package-summary.html">Package</a></li> <li class="navBarCell1Rev">Class</li> <li><a href="class-use/ClassicACLConsumer.html">Use</a></li> <li><a href="package-tree.html">Tree</a></li> <li><a href="../../../../../../deprecated-list.html">Deprecated</a></li> <li><a href="../../../../../../index-all.html">Index</a></li> <li><a href="../../../../../../help-doc.html">Help</a></li> </ul> <div class="aboutLanguage">WildFly Swarm API, 2018.5.0</div> </div> <div class="subNav"> <ul class="navList"> <li><a href="../../../../../../org/wildfly/swarm/config/security/security_domain/ClassicACL.ClassicACLResources.html" title="class in org.wildfly.swarm.config.security.security_domain"><span class="typeNameLink">Prev&nbsp;Class</span></a></li> <li><a href="../../../../../../org/wildfly/swarm/config/security/security_domain/ClassicACLSupplier.html" title="interface in org.wildfly.swarm.config.security.security_domain"><span class="typeNameLink">Next&nbsp;Class</span></a></li> </ul> <ul class="navList"> <li><a href="../../../../../../index.html?org/wildfly/swarm/config/security/security_domain/ClassicACLConsumer.html" target="_top">Frames</a></li> <li><a href="ClassicACLConsumer.html" target="_top">No&nbsp;Frames</a></li> </ul> <ul class="navList" id="allclasses_navbar_bottom"> <li><a href="../../../../../../allclasses-noframe.html">All&nbsp;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> <div> <ul class="subNavList"> <li>Summary:&nbsp;</li> <li>Nested&nbsp;|&nbsp;</li> <li>Field&nbsp;|&nbsp;</li> <li>Constr&nbsp;|&nbsp;</li> <li><a href="#method.summary">Method</a></li> </ul> <ul class="subNavList"> <li>Detail:&nbsp;</li> <li>Field&nbsp;|&nbsp;</li> <li>Constr&nbsp;|&nbsp;</li> <li><a href="#method.detail">Method</a></li> </ul> </div> <a name="skip.navbar.bottom"> <!-- --> </a></div> <!-- ======== END OF BOTTOM NAVBAR ======= --> <p class="legalCopy"><small>Copyright &#169; 2018 <a href="http://www.jboss.org">JBoss by Red Hat</a>. All rights reserved.</small></p> </body> </html>
apache-2.0
sword42/react-ui-helpers
src/input/InputModel.js
4219
import { forOwn, forEach, keys, values, isNil, isEmpty as _isEmpty, isObject, bind } from 'lodash' import { Promise } from 'bluebird' function InputModel(vals) { let modelValue = (vals['value'] ? vals['value'] : null ) let viewValue = modelValue let valid = true let pristine = true let listeners = setupListeners(vals['listeners']) let validators = (vals['validators'] ? vals['validators'] : {} ) var self = { name: (vals['name'] ? vals['name'] : null ), getValue: getValue, updateValue: updateValue, errors: {}, isValid: isValid, isPristine: isPristine, isEmpty: isEmpty, addListener: addListener, removeListener: removeListener, addValidator: addValidator, removeValidator: removeValidator } function getValue() { return modelValue } function updateValue(event) { let newVal = event if (event && event.target && event.target.value !== undefined) { event.stopPropagation() newVal = event.target.value if (newVal === '') { newVal = null; } } if (newVal === viewValue && newVal === modelValue && !isObject(newVal)) { return } pristine = false viewValue = newVal return processViewUpdate() } function isValid() { return valid } function isPristine() { return pristine } function isEmpty() { return (isNil(modelValue) || _isEmpty(modelValue)) } function addListener(listener, listenerName) { const listenerKey = listenerName || listener listeners[listenerKey] = Promise.method(listener) } function removeListener(listenerKey) { delete listeners[listenerKey] } function addValidator(validatorName, validatorFunc ) { validators[validatorName] = validatorFunc } function removeValidator(validatorName) { delete validators[validatorName] } function processViewUpdate() { const localViewValue = viewValue self.errors = processValidators(localViewValue) valid = (keys(self.errors).length === 0) modelValue = localViewValue return processListeners(localViewValue) } function processValidators(localViewValue) { let newErrors = {} let validatorResult forOwn(validators, function(validator, vName){ try { validatorResult = validator(localViewValue) if (validatorResult) { newErrors[vName] = validatorResult } } catch (err) { console.log('Validator Error: '+err) } }) return newErrors } function processListeners(localViewValue) { let retPromises = [] const listenerFuncs = keys(listeners) forEach(listenerFuncs, function(listenerName){ const listener = listeners[listenerName] try { retPromises.push(listener(localViewValue, listenerName)) } catch (err) { console.log('Listener Error: '+err) } }) return Promise.all(retPromises) } function setupListeners(requestedListeners) { const ret = {} forEach(requestedListeners, function(listener){ ret[listener] = Promise.method(listener) }) return ret } self.errors = processValidators(viewValue) valid = (keys(self.errors).length === 0) return self } export function createInputModel(vals) { vals = vals || {} const ret = new InputModel(vals) return ret } export function createInputModelChain(fieldNames, sourceModel) { const ret = {} forEach(fieldNames, (fieldName) => { ret[fieldName] = createInputModel({name:fieldName, value:sourceModel.getValue()[fieldName] }) ret[fieldName].addListener( bind(inputModelMapFunc, undefined, sourceModel, ret[fieldName], fieldName), fieldName ) }) return ret } export function setupInputModelListenerMapping(fieldNames, destModel, sourceModels, mapFunc) { forEach(fieldNames, (fieldName) => { sourceModels[fieldName].addListener( bind(mapFunc, undefined, destModel, sourceModels[fieldName], fieldName), fieldName ) }) } export function inputModelListenerCleanUp(fieldNames, sourceModels) { forEach(fieldNames, (fieldName) => { sourceModels[fieldName].removeListener( fieldName ) }) } export function inputModelMapFunc(destModel, sourceModel, fieldName) { const obj = destModel.getValue() obj[fieldName] = sourceModel.getValue() destModel.updateValue(obj) } export function inputModelAddValidators(inputModel, valsObj) { forOwn(valsObj, function(validator, vName){ inputModel.addValidator(vName, validator) }) }
apache-2.0
Intel-EPID-SDK/epid-sdk
ext/ipp-crypto/sources/ippcp/pcparcfourencrypt.c
2074
/******************************************************************************* * Copyright 2005-2020 Intel Corporation * * 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. *******************************************************************************/ /* // // Purpose: // Cryptography Primitive. // RC4 implementation // */ #include "owndefs.h" #include "owncp.h" #include "pcparcfour.h" #include "pcptool.h" /*F* // Name: ippsARCFourEncrypt // // Purpose: Encrypt data stream. // // Returns: Reason: // ippStsNullPtrErr pCtx == NULL // pSrc == NULL // pDst == NULL // ippStsContextMatchErr pCtx->idCtx != idCtxARCFOUR // ippStsLengthErr length<1 // ippStsNoErr no errors // // Parameters: // pSrc pointer to the source byte data block stream // pDst pointer to the destination byte data block stream // length stream length (bytes) // pCtx ponter to the ARCFOUR context // // Note: // Convenience function only *F*/ IPPFUN(IppStatus, ippsARCFourEncrypt, (const Ipp8u *pSrc, Ipp8u *pDst, int length, IppsARCFourState *pCtx)) { /* test context */ IPP_BAD_PTR1_RET(pCtx); IPP_BADARG_RET(!RC4_VALID_ID(pCtx), ippStsContextMatchErr); /* test source and destination pointers */ IPP_BAD_PTR2_RET(pSrc, pDst); /* test stream length */ IPP_BADARG_RET((length<1), ippStsLengthErr); /* process data */ ARCFourProcessData(pSrc, pDst, length, pCtx); return ippStsNoErr; }
apache-2.0
tensorflow/docs-l10n
site/zh-cn/community/contribute/code.md
7554
# 为 TensorFlow 代码做贡献 无论您是添加损失函数、提高测试覆盖率还是为重大设计变更编写 RFC,本部分贡献者指南将帮助您快速入门。感谢您为改进 TensorFlow 所做的工作和给予的关注。 ## 准备工作 在为 TensorFlow 项目贡献源代码之前,请查看该项目的 GitHub 仓库中的 `CONTRIBUTING.md` 文件。(例如,请参阅[核心 TensorFlow 仓库的 CONTRIBUTING.md 文件](https://github.com/tensorflow/tensorflow/blob/master/CONTRIBUTING.md)。)所有代码贡献者都需要签署[贡献者许可协议](https://cla.developers.google.com/clas) (CLA)。 为避免重复工作,在开始处理非普通功能之前,请查看[当前](https://github.com/tensorflow/community/tree/master/rfcs)或[提议的](https://github.com/tensorflow/community/labels/RFC%3A%20Proposed) RFC 并与 TensorFlow 论坛上的开发者 ([[email protected]](https://groups.google.com/u/1/a/tensorflow.org/g/developers)) 联系。在决定添加新功能时,我们是有选择性的,为项目做贡献和提供帮助的最佳方法是处理已知问题。 ## 新贡献者的问题 新贡献者在搜索对 TensorFlow 代码库的首次贡献时应查找以下标签。我们强烈建议新贡献者先处理具有“good first issue”和“contributions welcome”标签的项目;这有助于贡献者熟悉贡献工作流程,并让核心开发者认识贡献者。 - [good first issue](https://github.com/tensorflow/tensorflow/labels/good%20first%20issue) - [contributions welcome](https://github.com/tensorflow/tensorflow/labels/stat%3Acontributions%20welcome) 如果您有兴趣招募一个团队来帮助解决大规模问题或处理新功能,请给 [developers@ 小组](https://groups.google.com/a/tensorflow.org/forum/#!forum/developers)发送电子邮件,并查看我们当前的 RFC 列表。 ## 代码审查 新功能、错误修复以及对代码库的任何其他更改都必须经过代码审查。 以拉取请求的形式审查贡献到项目的代码是 TensorFlow 开发的关键组成部分。我们鼓励任何人审查其他开发者提交的代码,尤其是在您可能会使用该功能的情况下。 在代码审查过程中,请牢记以下问题: - *我们在 TensorFlow 中需要这个功能吗?*它有可能被使用吗?作为 TensorFlow 用户,您是否喜欢此更改并打算使用它?此更改在 TensorFlow 的范围内吗?维护新功能的成本是否物有所值? - *代码与 TensorFlow API 是否一致?*公共函数、类和参数的命名是否合理,设计是否直观? - *是否包括文档?*所有公共函数、类、参数、返回类型和存储的特性是否都已根据 TensorFlow 约定命名并明确记录?TensorFlow 文档中是否尽可能地描述了新功能并通过示例加以说明?文档是否正确呈现? - *代码是人类可读的吗?*冗余度低吗?是否应改进变量名称以使其清晰或一致?是否应添加注释?是否应移除任何无用或多余的注释? - *代码是否高效?*能否轻松重写此代码以更高效地运行? - 代码是否*向后兼容*先前版本的 TensorFlow? - 新代码是否会添加与其他库的*新依赖关系*? ## 测试并提高测试覆盖率 高质量的单元测试是 TensorFlow 开发流程的基石。为此,我们使用 Docker 镜像。测试函数经过适当的命名,负责检查算法的有效性以及代码的不同选项。 所有新功能和错误修复都*必须*包括足够的测试覆盖率。我们也欢迎提供新测试用例或改进现有测试的贡献。如果您发现我们现有的测试不完整(即使当前尚未导致错误),请提交问题,并在可能的情况下提交拉取请求。 有关每个 TensorFlow 项目中测试过程的特定详细信息,请参阅 GitHub 上项目仓库中的 `README.md` 和 `CONTRIBUTING.md` 文件。 *充分测试*中需要特别关注的问题: - 是否*对每个公共函数和类都进行了*测试? - 是否测试了*一组合理的参数*、它们的值、值类型和组合? - 测试是否验证了*代码正确无误*,以及它*所执行的操作是否符合文档中所述的*代码意图? - 如果更改是错误修复,是否包括*非回归测试* ? - 测试是否*通过持续集成*构建? - 测试是否*覆盖代码的每一行*?如果未覆盖,例外是否合理且明确? 如果发现任何问题,请考虑帮助贡献者了解这些问题并加以解决。 ## 改善错误消息或日志 我们欢迎改善错误消息和日志记录的贡献。 ## 贡献工作流 代码贡献(错误修复、新开发、测试改进)全部遵循以 GitHub 为中心的工作流。要参与 TensorFlow 开发,请建立一个 GitHub 帐号。然后: 1. 将您计划处理的仓库分叉。转到项目仓库页面,然后使用 *Fork* 按钮。这将在您的用户名下创建一个仓库副本。(有关如何将仓库分叉的更多详细信息,请参阅[此指南](https://help.github.com/articles/fork-a-repo/)。) 2. 将仓库克隆到本地系统。 `$ git clone [email protected]:your-user-name/project-name.git` 3. 创建一个新分支来保存您的工作。 `$ git checkout -b new-branch-name` 4. 处理新代码。编写并运行测试。 5. 提交您的更改。 `$ git add -A` `$ git commit -m "commit message here"` 6. 将您的更改推送到 GitHub 仓库。 `$ git push origin branch-name` 7. 打开一个*拉取请求* (PR)。转到 GitHub 上的原始项目仓库。随后将显示一条有关您最近推送的分支的消息,询问您是否要打开拉取请求。按照提示进行操作,*在仓库之间进行比较*,然后提交 PR。这将向提交者发送一封电子邮件。您可能需要考虑将电子邮件发送到邮寄名单来提高关注度。(有关更多详细信息,请参阅[关于 PR 的 GitHub 指南](https://help.github.com/articles/creating-a-pull-request-from-a-fork)。) 8. 维护者和其他贡献者将*审查您的 PR*。请参与对话,并尝试*进行任何要求的更改*。一旦 PR 获得批准,便会合并代码。 *在处理下一个贡献之前*,请确保您的本地仓库是最新的。 1. 设置远程的上游仓库。(每个项目只需执行一次,不必每次都执行。) `$ git remote add upstream [email protected]:tensorflow/project-repo-name` 2. 切换到本地 master 分支。 `$ git checkout master` 3. 从上游拉取更改。 `$ git pull upstream master` 4. 将更改推送到您的 GitHub 帐号。(可选,但这是一个好的做法。) `$ git push origin master` 5. 如果您要开始新工作,请创建一个新分支。 `$ git checkout -b branch-name` 其他 `git` 和 GitHub 资源: - [Git 文档](https://git-scm.com/documentation) - [Git 开发工作流](https://docs.scipy.org/doc/numpy/dev/gitwash/development_workflow.html) - [解决合并冲突](https://help.github.com/articles/resolving-a-merge-conflict-using-the-command-line/)。 ## 贡献者核对清单 - 阅读[贡献准则](https://github.com/tensorflow/tensorflow/blob/master/CONTRIBUTING.md)。 - 阅读《行为准则》。 - 确保您已签署《贡献者许可协议》(CLA)。 - 检查您的更改与准则是否一致。 - 检查您的更改与 TensorFlow 编码风格是否一致。 - [运行单元测试](https://github.com/tensorflow/tensorflow/blob/master/CONTRIBUTING.md#running-unit-tests)。
apache-2.0
serious6/HibernateSimpleProject
javadoc/hibernate_Doc/org/hibernate/annotations/class-use/Generated.html
6519
<!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_45) on Mon Mar 03 10:44:37 EST 2014 --> <title>Uses of Class org.hibernate.annotations.Generated (Hibernate JavaDocs)</title> <meta name="date" content="2014-03-03"> <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.hibernate.annotations.Generated (Hibernate JavaDocs)"; } //--> </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/hibernate/annotations/Generated.html" title="annotation in org.hibernate.annotations">Class</a></li> <li class="navBarCell1Rev">Use</li> <li><a href="../../../../overview-tree.html">Tree</a></li> <li><a href="../../../../deprecated-list.html">Deprecated</a></li> <li><a href="../../../../index-all.html">Index</a></li> <li><a href="../../../../help-doc.html">Help</a></li> </ul> </div> <div class="subNav"> <ul class="navList"> <li>Prev</li> <li>Next</li> </ul> <ul class="navList"> <li><a href="../../../../index.html?org/hibernate/annotations/class-use/Generated.html" target="_top">Frames</a></li> <li><a href="Generated.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.hibernate.annotations.Generated" class="title">Uses of Class<br>org.hibernate.annotations.Generated</h2> </div> <div class="classUseContainer"> <ul class="blockList"> <li class="blockList"> <table border="0" cellpadding="3" cellspacing="0" summary="Use table, listing packages, and an explanation"> <caption><span>Packages that use <a href="../../../../org/hibernate/annotations/Generated.html" title="annotation in org.hibernate.annotations">Generated</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="#org.hibernate.tuple">org.hibernate.tuple</a></td> <td class="colLast"> <div class="block"><div class="paragraph"></div> </td> </tr> </tbody> </table> </li> <li class="blockList"> <ul class="blockList"> <li class="blockList"><a name="org.hibernate.tuple"> <!-- --> </a> <h3>Uses of <a href="../../../../org/hibernate/annotations/Generated.html" title="annotation in org.hibernate.annotations">Generated</a> in <a href="../../../../org/hibernate/tuple/package-summary.html">org.hibernate.tuple</a></h3> <table border="0" cellpadding="3" cellspacing="0" summary="Use table, listing methods, and an explanation"> <caption><span>Methods in <a href="../../../../org/hibernate/tuple/package-summary.html">org.hibernate.tuple</a> with parameters of type <a href="../../../../org/hibernate/annotations/Generated.html" title="annotation in org.hibernate.annotations">Generated</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>void</code></td> <td class="colLast"><span class="strong">GeneratedValueGeneration.</span><code><strong><a href="../../../../org/hibernate/tuple/GeneratedValueGeneration.html#initialize(org.hibernate.annotations.Generated, java.lang.Class)">initialize</a></strong>(<a href="../../../../org/hibernate/annotations/Generated.html" title="annotation in org.hibernate.annotations">Generated</a>&nbsp;annotation, <a href="http://download.oracle.com/javase/6/docs/api/java/lang/Class.html?is-external=true" title="class or interface in java.lang">Class</a>&lt;?&gt;&nbsp;propertyType)</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="../../../../org/hibernate/annotations/Generated.html" title="annotation in org.hibernate.annotations">Class</a></li> <li class="navBarCell1Rev">Use</li> <li><a href="../../../../overview-tree.html">Tree</a></li> <li><a href="../../../../deprecated-list.html">Deprecated</a></li> <li><a href="../../../../index-all.html">Index</a></li> <li><a href="../../../../help-doc.html">Help</a></li> </ul> </div> <div class="subNav"> <ul class="navList"> <li>Prev</li> <li>Next</li> </ul> <ul class="navList"> <li><a href="../../../../index.html?org/hibernate/annotations/class-use/Generated.html" target="_top">Frames</a></li> <li><a href="Generated.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>Copyright &copy; 2001-2014 <a href="http://redhat.com">Red Hat, Inc.</a> All Rights Reserved.</small></p> </body> </html>
apache-2.0
hoangelos/Herd
demo/misc/manager_node1.py
209
from herd.manager.server import HerdManager manager = HerdManager(address=None, port=8339, ip='127.0.0.1', config=None, stream_ip='127.0.0.1', stream_port=8338) manager.start_listener()
apache-2.0
domeos/server
src/main/java/org/domeos/framework/api/model/deployment/related/DeploymentAccessType.java
163
package org.domeos.framework.api.model.deployment.related; /** * Created by xupeng on 16-2-25. */ public enum DeploymentAccessType { K8S_SERVICE, DIY }
apache-2.0
mapr/impala
thirdparty/hive-0.12.0-cdh5.1.2/src/metastore/src/gen/thrift/gen-rb/hive_metastore_types.rb
33420
# # Autogenerated by Thrift Compiler (0.9.0) # # DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING # require 'thrift' require 'fb303_types' module HiveObjectType GLOBAL = 1 DATABASE = 2 TABLE = 3 PARTITION = 4 COLUMN = 5 VALUE_MAP = {1 => "GLOBAL", 2 => "DATABASE", 3 => "TABLE", 4 => "PARTITION", 5 => "COLUMN"} VALID_VALUES = Set.new([GLOBAL, DATABASE, TABLE, PARTITION, COLUMN]).freeze end module PrincipalType USER = 1 ROLE = 2 GROUP = 3 VALUE_MAP = {1 => "USER", 2 => "ROLE", 3 => "GROUP"} VALID_VALUES = Set.new([USER, ROLE, GROUP]).freeze end module PartitionEventType LOAD_DONE = 1 VALUE_MAP = {1 => "LOAD_DONE"} VALID_VALUES = Set.new([LOAD_DONE]).freeze end class Version include ::Thrift::Struct, ::Thrift::Struct_Union VERSION = 1 COMMENTS = 2 FIELDS = { VERSION => {:type => ::Thrift::Types::STRING, :name => 'version'}, COMMENTS => {:type => ::Thrift::Types::STRING, :name => 'comments'} } def struct_fields; FIELDS; end def validate end ::Thrift::Struct.generate_accessors self end class FieldSchema include ::Thrift::Struct, ::Thrift::Struct_Union NAME = 1 TYPE = 2 COMMENT = 3 FIELDS = { NAME => {:type => ::Thrift::Types::STRING, :name => 'name'}, TYPE => {:type => ::Thrift::Types::STRING, :name => 'type'}, COMMENT => {:type => ::Thrift::Types::STRING, :name => 'comment'} } def struct_fields; FIELDS; end def validate end ::Thrift::Struct.generate_accessors self end class Type include ::Thrift::Struct, ::Thrift::Struct_Union NAME = 1 TYPE1 = 2 TYPE2 = 3 FIELDS = 4 FIELDS = { NAME => {:type => ::Thrift::Types::STRING, :name => 'name'}, TYPE1 => {:type => ::Thrift::Types::STRING, :name => 'type1', :optional => true}, TYPE2 => {:type => ::Thrift::Types::STRING, :name => 'type2', :optional => true}, FIELDS => {:type => ::Thrift::Types::LIST, :name => 'fields', :element => {:type => ::Thrift::Types::STRUCT, :class => ::FieldSchema}, :optional => true} } def struct_fields; FIELDS; end def validate end ::Thrift::Struct.generate_accessors self end class HiveObjectRef include ::Thrift::Struct, ::Thrift::Struct_Union OBJECTTYPE = 1 DBNAME = 2 OBJECTNAME = 3 PARTVALUES = 4 COLUMNNAME = 5 FIELDS = { OBJECTTYPE => {:type => ::Thrift::Types::I32, :name => 'objectType', :enum_class => ::HiveObjectType}, DBNAME => {:type => ::Thrift::Types::STRING, :name => 'dbName'}, OBJECTNAME => {:type => ::Thrift::Types::STRING, :name => 'objectName'}, PARTVALUES => {:type => ::Thrift::Types::LIST, :name => 'partValues', :element => {:type => ::Thrift::Types::STRING}}, COLUMNNAME => {:type => ::Thrift::Types::STRING, :name => 'columnName'} } def struct_fields; FIELDS; end def validate unless @objectType.nil? || ::HiveObjectType::VALID_VALUES.include?(@objectType) raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Invalid value of field objectType!') end end ::Thrift::Struct.generate_accessors self end class PrivilegeGrantInfo include ::Thrift::Struct, ::Thrift::Struct_Union PRIVILEGE = 1 CREATETIME = 2 GRANTOR = 3 GRANTORTYPE = 4 GRANTOPTION = 5 FIELDS = { PRIVILEGE => {:type => ::Thrift::Types::STRING, :name => 'privilege'}, CREATETIME => {:type => ::Thrift::Types::I32, :name => 'createTime'}, GRANTOR => {:type => ::Thrift::Types::STRING, :name => 'grantor'}, GRANTORTYPE => {:type => ::Thrift::Types::I32, :name => 'grantorType', :enum_class => ::PrincipalType}, GRANTOPTION => {:type => ::Thrift::Types::BOOL, :name => 'grantOption'} } def struct_fields; FIELDS; end def validate unless @grantorType.nil? || ::PrincipalType::VALID_VALUES.include?(@grantorType) raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Invalid value of field grantorType!') end end ::Thrift::Struct.generate_accessors self end class HiveObjectPrivilege include ::Thrift::Struct, ::Thrift::Struct_Union HIVEOBJECT = 1 PRINCIPALNAME = 2 PRINCIPALTYPE = 3 GRANTINFO = 4 FIELDS = { HIVEOBJECT => {:type => ::Thrift::Types::STRUCT, :name => 'hiveObject', :class => ::HiveObjectRef}, PRINCIPALNAME => {:type => ::Thrift::Types::STRING, :name => 'principalName'}, PRINCIPALTYPE => {:type => ::Thrift::Types::I32, :name => 'principalType', :enum_class => ::PrincipalType}, GRANTINFO => {:type => ::Thrift::Types::STRUCT, :name => 'grantInfo', :class => ::PrivilegeGrantInfo} } def struct_fields; FIELDS; end def validate unless @principalType.nil? || ::PrincipalType::VALID_VALUES.include?(@principalType) raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Invalid value of field principalType!') end end ::Thrift::Struct.generate_accessors self end class PrivilegeBag include ::Thrift::Struct, ::Thrift::Struct_Union PRIVILEGES = 1 FIELDS = { PRIVILEGES => {:type => ::Thrift::Types::LIST, :name => 'privileges', :element => {:type => ::Thrift::Types::STRUCT, :class => ::HiveObjectPrivilege}} } def struct_fields; FIELDS; end def validate end ::Thrift::Struct.generate_accessors self end class PrincipalPrivilegeSet include ::Thrift::Struct, ::Thrift::Struct_Union USERPRIVILEGES = 1 GROUPPRIVILEGES = 2 ROLEPRIVILEGES = 3 FIELDS = { USERPRIVILEGES => {:type => ::Thrift::Types::MAP, :name => 'userPrivileges', :key => {:type => ::Thrift::Types::STRING}, :value => {:type => ::Thrift::Types::LIST, :element => {:type => ::Thrift::Types::STRUCT, :class => ::PrivilegeGrantInfo}}}, GROUPPRIVILEGES => {:type => ::Thrift::Types::MAP, :name => 'groupPrivileges', :key => {:type => ::Thrift::Types::STRING}, :value => {:type => ::Thrift::Types::LIST, :element => {:type => ::Thrift::Types::STRUCT, :class => ::PrivilegeGrantInfo}}}, ROLEPRIVILEGES => {:type => ::Thrift::Types::MAP, :name => 'rolePrivileges', :key => {:type => ::Thrift::Types::STRING}, :value => {:type => ::Thrift::Types::LIST, :element => {:type => ::Thrift::Types::STRUCT, :class => ::PrivilegeGrantInfo}}} } def struct_fields; FIELDS; end def validate end ::Thrift::Struct.generate_accessors self end class Role include ::Thrift::Struct, ::Thrift::Struct_Union ROLENAME = 1 CREATETIME = 2 OWNERNAME = 3 FIELDS = { ROLENAME => {:type => ::Thrift::Types::STRING, :name => 'roleName'}, CREATETIME => {:type => ::Thrift::Types::I32, :name => 'createTime'}, OWNERNAME => {:type => ::Thrift::Types::STRING, :name => 'ownerName'} } def struct_fields; FIELDS; end def validate end ::Thrift::Struct.generate_accessors self end class Database include ::Thrift::Struct, ::Thrift::Struct_Union NAME = 1 DESCRIPTION = 2 LOCATIONURI = 3 PARAMETERS = 4 PRIVILEGES = 5 FIELDS = { NAME => {:type => ::Thrift::Types::STRING, :name => 'name'}, DESCRIPTION => {:type => ::Thrift::Types::STRING, :name => 'description'}, LOCATIONURI => {:type => ::Thrift::Types::STRING, :name => 'locationUri'}, PARAMETERS => {:type => ::Thrift::Types::MAP, :name => 'parameters', :key => {:type => ::Thrift::Types::STRING}, :value => {:type => ::Thrift::Types::STRING}}, PRIVILEGES => {:type => ::Thrift::Types::STRUCT, :name => 'privileges', :class => ::PrincipalPrivilegeSet, :optional => true} } def struct_fields; FIELDS; end def validate end ::Thrift::Struct.generate_accessors self end class SerDeInfo include ::Thrift::Struct, ::Thrift::Struct_Union NAME = 1 SERIALIZATIONLIB = 2 PARAMETERS = 3 FIELDS = { NAME => {:type => ::Thrift::Types::STRING, :name => 'name'}, SERIALIZATIONLIB => {:type => ::Thrift::Types::STRING, :name => 'serializationLib'}, PARAMETERS => {:type => ::Thrift::Types::MAP, :name => 'parameters', :key => {:type => ::Thrift::Types::STRING}, :value => {:type => ::Thrift::Types::STRING}} } def struct_fields; FIELDS; end def validate end ::Thrift::Struct.generate_accessors self end class Order include ::Thrift::Struct, ::Thrift::Struct_Union COL = 1 ORDER = 2 FIELDS = { COL => {:type => ::Thrift::Types::STRING, :name => 'col'}, ORDER => {:type => ::Thrift::Types::I32, :name => 'order'} } def struct_fields; FIELDS; end def validate end ::Thrift::Struct.generate_accessors self end class SkewedInfo include ::Thrift::Struct, ::Thrift::Struct_Union SKEWEDCOLNAMES = 1 SKEWEDCOLVALUES = 2 SKEWEDCOLVALUELOCATIONMAPS = 3 FIELDS = { SKEWEDCOLNAMES => {:type => ::Thrift::Types::LIST, :name => 'skewedColNames', :element => {:type => ::Thrift::Types::STRING}}, SKEWEDCOLVALUES => {:type => ::Thrift::Types::LIST, :name => 'skewedColValues', :element => {:type => ::Thrift::Types::LIST, :element => {:type => ::Thrift::Types::STRING}}}, SKEWEDCOLVALUELOCATIONMAPS => {:type => ::Thrift::Types::MAP, :name => 'skewedColValueLocationMaps', :key => {:type => ::Thrift::Types::LIST, :element => {:type => ::Thrift::Types::STRING}}, :value => {:type => ::Thrift::Types::STRING}} } def struct_fields; FIELDS; end def validate end ::Thrift::Struct.generate_accessors self end class StorageDescriptor include ::Thrift::Struct, ::Thrift::Struct_Union COLS = 1 LOCATION = 2 INPUTFORMAT = 3 OUTPUTFORMAT = 4 COMPRESSED = 5 NUMBUCKETS = 6 SERDEINFO = 7 BUCKETCOLS = 8 SORTCOLS = 9 PARAMETERS = 10 SKEWEDINFO = 11 STOREDASSUBDIRECTORIES = 12 FIELDS = { COLS => {:type => ::Thrift::Types::LIST, :name => 'cols', :element => {:type => ::Thrift::Types::STRUCT, :class => ::FieldSchema}}, LOCATION => {:type => ::Thrift::Types::STRING, :name => 'location'}, INPUTFORMAT => {:type => ::Thrift::Types::STRING, :name => 'inputFormat'}, OUTPUTFORMAT => {:type => ::Thrift::Types::STRING, :name => 'outputFormat'}, COMPRESSED => {:type => ::Thrift::Types::BOOL, :name => 'compressed'}, NUMBUCKETS => {:type => ::Thrift::Types::I32, :name => 'numBuckets'}, SERDEINFO => {:type => ::Thrift::Types::STRUCT, :name => 'serdeInfo', :class => ::SerDeInfo}, BUCKETCOLS => {:type => ::Thrift::Types::LIST, :name => 'bucketCols', :element => {:type => ::Thrift::Types::STRING}}, SORTCOLS => {:type => ::Thrift::Types::LIST, :name => 'sortCols', :element => {:type => ::Thrift::Types::STRUCT, :class => ::Order}}, PARAMETERS => {:type => ::Thrift::Types::MAP, :name => 'parameters', :key => {:type => ::Thrift::Types::STRING}, :value => {:type => ::Thrift::Types::STRING}}, SKEWEDINFO => {:type => ::Thrift::Types::STRUCT, :name => 'skewedInfo', :class => ::SkewedInfo, :optional => true}, STOREDASSUBDIRECTORIES => {:type => ::Thrift::Types::BOOL, :name => 'storedAsSubDirectories', :optional => true} } def struct_fields; FIELDS; end def validate end ::Thrift::Struct.generate_accessors self end class Table include ::Thrift::Struct, ::Thrift::Struct_Union TABLENAME = 1 DBNAME = 2 OWNER = 3 CREATETIME = 4 LASTACCESSTIME = 5 RETENTION = 6 SD = 7 PARTITIONKEYS = 8 PARAMETERS = 9 VIEWORIGINALTEXT = 10 VIEWEXPANDEDTEXT = 11 TABLETYPE = 12 PRIVILEGES = 13 FIELDS = { TABLENAME => {:type => ::Thrift::Types::STRING, :name => 'tableName'}, DBNAME => {:type => ::Thrift::Types::STRING, :name => 'dbName'}, OWNER => {:type => ::Thrift::Types::STRING, :name => 'owner'}, CREATETIME => {:type => ::Thrift::Types::I32, :name => 'createTime'}, LASTACCESSTIME => {:type => ::Thrift::Types::I32, :name => 'lastAccessTime'}, RETENTION => {:type => ::Thrift::Types::I32, :name => 'retention'}, SD => {:type => ::Thrift::Types::STRUCT, :name => 'sd', :class => ::StorageDescriptor}, PARTITIONKEYS => {:type => ::Thrift::Types::LIST, :name => 'partitionKeys', :element => {:type => ::Thrift::Types::STRUCT, :class => ::FieldSchema}}, PARAMETERS => {:type => ::Thrift::Types::MAP, :name => 'parameters', :key => {:type => ::Thrift::Types::STRING}, :value => {:type => ::Thrift::Types::STRING}}, VIEWORIGINALTEXT => {:type => ::Thrift::Types::STRING, :name => 'viewOriginalText'}, VIEWEXPANDEDTEXT => {:type => ::Thrift::Types::STRING, :name => 'viewExpandedText'}, TABLETYPE => {:type => ::Thrift::Types::STRING, :name => 'tableType'}, PRIVILEGES => {:type => ::Thrift::Types::STRUCT, :name => 'privileges', :class => ::PrincipalPrivilegeSet, :optional => true} } def struct_fields; FIELDS; end def validate end ::Thrift::Struct.generate_accessors self end class Partition include ::Thrift::Struct, ::Thrift::Struct_Union VALUES = 1 DBNAME = 2 TABLENAME = 3 CREATETIME = 4 LASTACCESSTIME = 5 SD = 6 PARAMETERS = 7 PRIVILEGES = 8 FIELDS = { VALUES => {:type => ::Thrift::Types::LIST, :name => 'values', :element => {:type => ::Thrift::Types::STRING}}, DBNAME => {:type => ::Thrift::Types::STRING, :name => 'dbName'}, TABLENAME => {:type => ::Thrift::Types::STRING, :name => 'tableName'}, CREATETIME => {:type => ::Thrift::Types::I32, :name => 'createTime'}, LASTACCESSTIME => {:type => ::Thrift::Types::I32, :name => 'lastAccessTime'}, SD => {:type => ::Thrift::Types::STRUCT, :name => 'sd', :class => ::StorageDescriptor}, PARAMETERS => {:type => ::Thrift::Types::MAP, :name => 'parameters', :key => {:type => ::Thrift::Types::STRING}, :value => {:type => ::Thrift::Types::STRING}}, PRIVILEGES => {:type => ::Thrift::Types::STRUCT, :name => 'privileges', :class => ::PrincipalPrivilegeSet, :optional => true} } def struct_fields; FIELDS; end def validate end ::Thrift::Struct.generate_accessors self end class Index include ::Thrift::Struct, ::Thrift::Struct_Union INDEXNAME = 1 INDEXHANDLERCLASS = 2 DBNAME = 3 ORIGTABLENAME = 4 CREATETIME = 5 LASTACCESSTIME = 6 INDEXTABLENAME = 7 SD = 8 PARAMETERS = 9 DEFERREDREBUILD = 10 FIELDS = { INDEXNAME => {:type => ::Thrift::Types::STRING, :name => 'indexName'}, INDEXHANDLERCLASS => {:type => ::Thrift::Types::STRING, :name => 'indexHandlerClass'}, DBNAME => {:type => ::Thrift::Types::STRING, :name => 'dbName'}, ORIGTABLENAME => {:type => ::Thrift::Types::STRING, :name => 'origTableName'}, CREATETIME => {:type => ::Thrift::Types::I32, :name => 'createTime'}, LASTACCESSTIME => {:type => ::Thrift::Types::I32, :name => 'lastAccessTime'}, INDEXTABLENAME => {:type => ::Thrift::Types::STRING, :name => 'indexTableName'}, SD => {:type => ::Thrift::Types::STRUCT, :name => 'sd', :class => ::StorageDescriptor}, PARAMETERS => {:type => ::Thrift::Types::MAP, :name => 'parameters', :key => {:type => ::Thrift::Types::STRING}, :value => {:type => ::Thrift::Types::STRING}}, DEFERREDREBUILD => {:type => ::Thrift::Types::BOOL, :name => 'deferredRebuild'} } def struct_fields; FIELDS; end def validate end ::Thrift::Struct.generate_accessors self end class BooleanColumnStatsData include ::Thrift::Struct, ::Thrift::Struct_Union NUMTRUES = 1 NUMFALSES = 2 NUMNULLS = 3 FIELDS = { NUMTRUES => {:type => ::Thrift::Types::I64, :name => 'numTrues'}, NUMFALSES => {:type => ::Thrift::Types::I64, :name => 'numFalses'}, NUMNULLS => {:type => ::Thrift::Types::I64, :name => 'numNulls'} } def struct_fields; FIELDS; end def validate raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field numTrues is unset!') unless @numTrues raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field numFalses is unset!') unless @numFalses raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field numNulls is unset!') unless @numNulls end ::Thrift::Struct.generate_accessors self end class DoubleColumnStatsData include ::Thrift::Struct, ::Thrift::Struct_Union LOWVALUE = 1 HIGHVALUE = 2 NUMNULLS = 3 NUMDVS = 4 FIELDS = { LOWVALUE => {:type => ::Thrift::Types::DOUBLE, :name => 'lowValue'}, HIGHVALUE => {:type => ::Thrift::Types::DOUBLE, :name => 'highValue'}, NUMNULLS => {:type => ::Thrift::Types::I64, :name => 'numNulls'}, NUMDVS => {:type => ::Thrift::Types::I64, :name => 'numDVs'} } def struct_fields; FIELDS; end def validate raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field lowValue is unset!') unless @lowValue raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field highValue is unset!') unless @highValue raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field numNulls is unset!') unless @numNulls raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field numDVs is unset!') unless @numDVs end ::Thrift::Struct.generate_accessors self end class LongColumnStatsData include ::Thrift::Struct, ::Thrift::Struct_Union LOWVALUE = 1 HIGHVALUE = 2 NUMNULLS = 3 NUMDVS = 4 FIELDS = { LOWVALUE => {:type => ::Thrift::Types::I64, :name => 'lowValue'}, HIGHVALUE => {:type => ::Thrift::Types::I64, :name => 'highValue'}, NUMNULLS => {:type => ::Thrift::Types::I64, :name => 'numNulls'}, NUMDVS => {:type => ::Thrift::Types::I64, :name => 'numDVs'} } def struct_fields; FIELDS; end def validate raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field lowValue is unset!') unless @lowValue raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field highValue is unset!') unless @highValue raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field numNulls is unset!') unless @numNulls raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field numDVs is unset!') unless @numDVs end ::Thrift::Struct.generate_accessors self end class StringColumnStatsData include ::Thrift::Struct, ::Thrift::Struct_Union MAXCOLLEN = 1 AVGCOLLEN = 2 NUMNULLS = 3 NUMDVS = 4 FIELDS = { MAXCOLLEN => {:type => ::Thrift::Types::I64, :name => 'maxColLen'}, AVGCOLLEN => {:type => ::Thrift::Types::DOUBLE, :name => 'avgColLen'}, NUMNULLS => {:type => ::Thrift::Types::I64, :name => 'numNulls'}, NUMDVS => {:type => ::Thrift::Types::I64, :name => 'numDVs'} } def struct_fields; FIELDS; end def validate raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field maxColLen is unset!') unless @maxColLen raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field avgColLen is unset!') unless @avgColLen raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field numNulls is unset!') unless @numNulls raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field numDVs is unset!') unless @numDVs end ::Thrift::Struct.generate_accessors self end class BinaryColumnStatsData include ::Thrift::Struct, ::Thrift::Struct_Union MAXCOLLEN = 1 AVGCOLLEN = 2 NUMNULLS = 3 FIELDS = { MAXCOLLEN => {:type => ::Thrift::Types::I64, :name => 'maxColLen'}, AVGCOLLEN => {:type => ::Thrift::Types::DOUBLE, :name => 'avgColLen'}, NUMNULLS => {:type => ::Thrift::Types::I64, :name => 'numNulls'} } def struct_fields; FIELDS; end def validate raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field maxColLen is unset!') unless @maxColLen raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field avgColLen is unset!') unless @avgColLen raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field numNulls is unset!') unless @numNulls end ::Thrift::Struct.generate_accessors self end class Decimal include ::Thrift::Struct, ::Thrift::Struct_Union UNSCALED = 1 SCALE = 3 FIELDS = { UNSCALED => {:type => ::Thrift::Types::STRING, :name => 'unscaled', :binary => true}, SCALE => {:type => ::Thrift::Types::I16, :name => 'scale'} } def struct_fields; FIELDS; end def validate raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field unscaled is unset!') unless @unscaled raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field scale is unset!') unless @scale end ::Thrift::Struct.generate_accessors self end class DecimalColumnStatsData include ::Thrift::Struct, ::Thrift::Struct_Union LOWVALUE = 1 HIGHVALUE = 2 NUMNULLS = 3 NUMDVS = 4 FIELDS = { LOWVALUE => {:type => ::Thrift::Types::STRUCT, :name => 'lowValue', :class => ::Decimal}, HIGHVALUE => {:type => ::Thrift::Types::STRUCT, :name => 'highValue', :class => ::Decimal}, NUMNULLS => {:type => ::Thrift::Types::I64, :name => 'numNulls'}, NUMDVS => {:type => ::Thrift::Types::I64, :name => 'numDVs'} } def struct_fields; FIELDS; end def validate raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field lowValue is unset!') unless @lowValue raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field highValue is unset!') unless @highValue raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field numNulls is unset!') unless @numNulls raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field numDVs is unset!') unless @numDVs end ::Thrift::Struct.generate_accessors self end class ColumnStatisticsData < ::Thrift::Union include ::Thrift::Struct_Union class << self def booleanStats(val) ColumnStatisticsData.new(:booleanStats, val) end def longStats(val) ColumnStatisticsData.new(:longStats, val) end def doubleStats(val) ColumnStatisticsData.new(:doubleStats, val) end def stringStats(val) ColumnStatisticsData.new(:stringStats, val) end def binaryStats(val) ColumnStatisticsData.new(:binaryStats, val) end def decimalStats(val) ColumnStatisticsData.new(:decimalStats, val) end end BOOLEANSTATS = 1 LONGSTATS = 2 DOUBLESTATS = 3 STRINGSTATS = 4 BINARYSTATS = 5 DECIMALSTATS = 6 FIELDS = { BOOLEANSTATS => {:type => ::Thrift::Types::STRUCT, :name => 'booleanStats', :class => ::BooleanColumnStatsData}, LONGSTATS => {:type => ::Thrift::Types::STRUCT, :name => 'longStats', :class => ::LongColumnStatsData}, DOUBLESTATS => {:type => ::Thrift::Types::STRUCT, :name => 'doubleStats', :class => ::DoubleColumnStatsData}, STRINGSTATS => {:type => ::Thrift::Types::STRUCT, :name => 'stringStats', :class => ::StringColumnStatsData}, BINARYSTATS => {:type => ::Thrift::Types::STRUCT, :name => 'binaryStats', :class => ::BinaryColumnStatsData}, DECIMALSTATS => {:type => ::Thrift::Types::STRUCT, :name => 'decimalStats', :class => ::DecimalColumnStatsData} } def struct_fields; FIELDS; end def validate raise(StandardError, 'Union fields are not set.') if get_set_field.nil? || get_value.nil? end ::Thrift::Union.generate_accessors self end class ColumnStatisticsObj include ::Thrift::Struct, ::Thrift::Struct_Union COLNAME = 1 COLTYPE = 2 STATSDATA = 3 FIELDS = { COLNAME => {:type => ::Thrift::Types::STRING, :name => 'colName'}, COLTYPE => {:type => ::Thrift::Types::STRING, :name => 'colType'}, STATSDATA => {:type => ::Thrift::Types::STRUCT, :name => 'statsData', :class => ::ColumnStatisticsData} } def struct_fields; FIELDS; end def validate raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field colName is unset!') unless @colName raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field colType is unset!') unless @colType raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field statsData is unset!') unless @statsData end ::Thrift::Struct.generate_accessors self end class ColumnStatisticsDesc include ::Thrift::Struct, ::Thrift::Struct_Union ISTBLLEVEL = 1 DBNAME = 2 TABLENAME = 3 PARTNAME = 4 LASTANALYZED = 5 FIELDS = { ISTBLLEVEL => {:type => ::Thrift::Types::BOOL, :name => 'isTblLevel'}, DBNAME => {:type => ::Thrift::Types::STRING, :name => 'dbName'}, TABLENAME => {:type => ::Thrift::Types::STRING, :name => 'tableName'}, PARTNAME => {:type => ::Thrift::Types::STRING, :name => 'partName', :optional => true}, LASTANALYZED => {:type => ::Thrift::Types::I64, :name => 'lastAnalyzed', :optional => true} } def struct_fields; FIELDS; end def validate raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field isTblLevel is unset!') if @isTblLevel.nil? raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field dbName is unset!') unless @dbName raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field tableName is unset!') unless @tableName end ::Thrift::Struct.generate_accessors self end class ColumnStatistics include ::Thrift::Struct, ::Thrift::Struct_Union STATSDESC = 1 STATSOBJ = 2 FIELDS = { STATSDESC => {:type => ::Thrift::Types::STRUCT, :name => 'statsDesc', :class => ::ColumnStatisticsDesc}, STATSOBJ => {:type => ::Thrift::Types::LIST, :name => 'statsObj', :element => {:type => ::Thrift::Types::STRUCT, :class => ::ColumnStatisticsObj}} } def struct_fields; FIELDS; end def validate raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field statsDesc is unset!') unless @statsDesc raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field statsObj is unset!') unless @statsObj end ::Thrift::Struct.generate_accessors self end class Schema include ::Thrift::Struct, ::Thrift::Struct_Union FIELDSCHEMAS = 1 PROPERTIES = 2 FIELDS = { FIELDSCHEMAS => {:type => ::Thrift::Types::LIST, :name => 'fieldSchemas', :element => {:type => ::Thrift::Types::STRUCT, :class => ::FieldSchema}}, PROPERTIES => {:type => ::Thrift::Types::MAP, :name => 'properties', :key => {:type => ::Thrift::Types::STRING}, :value => {:type => ::Thrift::Types::STRING}} } def struct_fields; FIELDS; end def validate end ::Thrift::Struct.generate_accessors self end class EnvironmentContext include ::Thrift::Struct, ::Thrift::Struct_Union PROPERTIES = 1 FIELDS = { PROPERTIES => {:type => ::Thrift::Types::MAP, :name => 'properties', :key => {:type => ::Thrift::Types::STRING}, :value => {:type => ::Thrift::Types::STRING}} } def struct_fields; FIELDS; end def validate end ::Thrift::Struct.generate_accessors self end class PartitionsByExprResult include ::Thrift::Struct, ::Thrift::Struct_Union PARTITIONS = 1 HASUNKNOWNPARTITIONS = 2 FIELDS = { PARTITIONS => {:type => ::Thrift::Types::SET, :name => 'partitions', :element => {:type => ::Thrift::Types::STRUCT, :class => ::Partition}}, HASUNKNOWNPARTITIONS => {:type => ::Thrift::Types::BOOL, :name => 'hasUnknownPartitions'} } def struct_fields; FIELDS; end def validate raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field partitions is unset!') unless @partitions raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field hasUnknownPartitions is unset!') if @hasUnknownPartitions.nil? end ::Thrift::Struct.generate_accessors self end class PartitionsByExprRequest include ::Thrift::Struct, ::Thrift::Struct_Union DBNAME = 1 TBLNAME = 2 EXPR = 3 DEFAULTPARTITIONNAME = 4 MAXPARTS = 5 FIELDS = { DBNAME => {:type => ::Thrift::Types::STRING, :name => 'dbName'}, TBLNAME => {:type => ::Thrift::Types::STRING, :name => 'tblName'}, EXPR => {:type => ::Thrift::Types::STRING, :name => 'expr', :binary => true}, DEFAULTPARTITIONNAME => {:type => ::Thrift::Types::STRING, :name => 'defaultPartitionName', :optional => true}, MAXPARTS => {:type => ::Thrift::Types::I16, :name => 'maxParts', :default => -1, :optional => true} } def struct_fields; FIELDS; end def validate raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field dbName is unset!') unless @dbName raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field tblName is unset!') unless @tblName raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field expr is unset!') unless @expr end ::Thrift::Struct.generate_accessors self end class MetaException < ::Thrift::Exception include ::Thrift::Struct, ::Thrift::Struct_Union def initialize(message=nil) super() self.message = message end MESSAGE = 1 FIELDS = { MESSAGE => {:type => ::Thrift::Types::STRING, :name => 'message'} } def struct_fields; FIELDS; end def validate end ::Thrift::Struct.generate_accessors self end class UnknownTableException < ::Thrift::Exception include ::Thrift::Struct, ::Thrift::Struct_Union def initialize(message=nil) super() self.message = message end MESSAGE = 1 FIELDS = { MESSAGE => {:type => ::Thrift::Types::STRING, :name => 'message'} } def struct_fields; FIELDS; end def validate end ::Thrift::Struct.generate_accessors self end class UnknownDBException < ::Thrift::Exception include ::Thrift::Struct, ::Thrift::Struct_Union def initialize(message=nil) super() self.message = message end MESSAGE = 1 FIELDS = { MESSAGE => {:type => ::Thrift::Types::STRING, :name => 'message'} } def struct_fields; FIELDS; end def validate end ::Thrift::Struct.generate_accessors self end class AlreadyExistsException < ::Thrift::Exception include ::Thrift::Struct, ::Thrift::Struct_Union def initialize(message=nil) super() self.message = message end MESSAGE = 1 FIELDS = { MESSAGE => {:type => ::Thrift::Types::STRING, :name => 'message'} } def struct_fields; FIELDS; end def validate end ::Thrift::Struct.generate_accessors self end class InvalidPartitionException < ::Thrift::Exception include ::Thrift::Struct, ::Thrift::Struct_Union def initialize(message=nil) super() self.message = message end MESSAGE = 1 FIELDS = { MESSAGE => {:type => ::Thrift::Types::STRING, :name => 'message'} } def struct_fields; FIELDS; end def validate end ::Thrift::Struct.generate_accessors self end class UnknownPartitionException < ::Thrift::Exception include ::Thrift::Struct, ::Thrift::Struct_Union def initialize(message=nil) super() self.message = message end MESSAGE = 1 FIELDS = { MESSAGE => {:type => ::Thrift::Types::STRING, :name => 'message'} } def struct_fields; FIELDS; end def validate end ::Thrift::Struct.generate_accessors self end class InvalidObjectException < ::Thrift::Exception include ::Thrift::Struct, ::Thrift::Struct_Union def initialize(message=nil) super() self.message = message end MESSAGE = 1 FIELDS = { MESSAGE => {:type => ::Thrift::Types::STRING, :name => 'message'} } def struct_fields; FIELDS; end def validate end ::Thrift::Struct.generate_accessors self end class NoSuchObjectException < ::Thrift::Exception include ::Thrift::Struct, ::Thrift::Struct_Union def initialize(message=nil) super() self.message = message end MESSAGE = 1 FIELDS = { MESSAGE => {:type => ::Thrift::Types::STRING, :name => 'message'} } def struct_fields; FIELDS; end def validate end ::Thrift::Struct.generate_accessors self end class IndexAlreadyExistsException < ::Thrift::Exception include ::Thrift::Struct, ::Thrift::Struct_Union def initialize(message=nil) super() self.message = message end MESSAGE = 1 FIELDS = { MESSAGE => {:type => ::Thrift::Types::STRING, :name => 'message'} } def struct_fields; FIELDS; end def validate end ::Thrift::Struct.generate_accessors self end class InvalidOperationException < ::Thrift::Exception include ::Thrift::Struct, ::Thrift::Struct_Union def initialize(message=nil) super() self.message = message end MESSAGE = 1 FIELDS = { MESSAGE => {:type => ::Thrift::Types::STRING, :name => 'message'} } def struct_fields; FIELDS; end def validate end ::Thrift::Struct.generate_accessors self end class ConfigValSecurityException < ::Thrift::Exception include ::Thrift::Struct, ::Thrift::Struct_Union def initialize(message=nil) super() self.message = message end MESSAGE = 1 FIELDS = { MESSAGE => {:type => ::Thrift::Types::STRING, :name => 'message'} } def struct_fields; FIELDS; end def validate end ::Thrift::Struct.generate_accessors self end class InvalidInputException < ::Thrift::Exception include ::Thrift::Struct, ::Thrift::Struct_Union def initialize(message=nil) super() self.message = message end MESSAGE = 1 FIELDS = { MESSAGE => {:type => ::Thrift::Types::STRING, :name => 'message'} } def struct_fields; FIELDS; end def validate end ::Thrift::Struct.generate_accessors self end
apache-2.0
mydearxym/mastani
src/containers/content/SubscribeContent/index.tsx
1040
/* * * SubscribeContent * */ import { FC } from 'react' import type { TMetric } from '@/spec' import { METRIC } from '@/constant' import { buildLog } from '@/utils/logger' import { pluggedIn } from '@/utils/mobx' import Content from './Content' import Actions from './Actions' import type { TStore } from './store' import { Wrapper, InnerWrapper, StickyWrapper } from './styles' import { useInit } from './logic' /* eslint-disable-next-line */ const log = buildLog('C:SubscribeContent') type TProps = { subscribeContent?: TStore testid?: string metric?: TMetric } const SubscribeContentContainer = ({ subscribeContent: store, testid = 'subscribe-content', metric = METRIC.SUBSCRIBE, }) => { useInit(store) return ( <Wrapper testid={testid}> <InnerWrapper metric={metric}> <Content /> <StickyWrapper offsetTop={200}> <Actions /> </StickyWrapper> </InnerWrapper> </Wrapper> ) } // @ts-ignore export default pluggedIn(SubscribeContentContainer) as FC<TProps>
apache-2.0
plusplusjiajia/hadoop
hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/fs/viewfs/TestViewFileSystemOverloadSchemeHdfsFileSystemContract.java
4295
/** * 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.hadoop.fs.viewfs; import static org.junit.Assume.assumeTrue; import java.io.File; import java.io.IOException; import java.net.URI; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.fs.CommonConfigurationKeys; import org.apache.hadoop.fs.FileSystem; import org.apache.hadoop.fs.FileSystemContractBaseTest; import org.apache.hadoop.fs.FsConstants; import org.apache.hadoop.fs.Path; import org.apache.hadoop.hdfs.AppendTestUtil; import org.apache.hadoop.hdfs.DistributedFileSystem; import org.apache.hadoop.hdfs.HdfsConfiguration; import org.apache.hadoop.hdfs.MiniDFSCluster; import org.apache.hadoop.hdfs.TestHDFSFileSystemContract; import org.apache.hadoop.security.AccessControlException; import org.apache.hadoop.security.UserGroupInformation; import org.apache.hadoop.test.GenericTestUtils; import org.junit.AfterClass; import org.junit.Before; import org.junit.BeforeClass; import org.junit.Ignore; import org.junit.Test; /** * Tests ViewFileSystemOverloadScheme with file system contract tests. */ public class TestViewFileSystemOverloadSchemeHdfsFileSystemContract extends TestHDFSFileSystemContract { private static MiniDFSCluster cluster; private static String defaultWorkingDirectory; private static Configuration conf = new HdfsConfiguration(); @BeforeClass public static void init() throws IOException { final File basedir = GenericTestUtils.getRandomizedTestDir(); conf.set(CommonConfigurationKeys.FS_PERMISSIONS_UMASK_KEY, FileSystemContractBaseTest.TEST_UMASK); cluster = new MiniDFSCluster.Builder(conf, basedir) .numDataNodes(2) .build(); defaultWorkingDirectory = "/user/" + UserGroupInformation.getCurrentUser().getShortUserName(); } @Before public void setUp() throws Exception { conf.set(String.format("fs.%s.impl", "hdfs"), ViewFileSystemOverloadScheme.class.getName()); conf.set(String.format( FsConstants.FS_VIEWFS_OVERLOAD_SCHEME_TARGET_FS_IMPL_PATTERN, "hdfs"), DistributedFileSystem.class.getName()); URI defaultFSURI = URI.create(conf.get(CommonConfigurationKeys.FS_DEFAULT_NAME_KEY)); ConfigUtil.addLink(conf, defaultFSURI.getAuthority(), "/user", defaultFSURI); ConfigUtil.addLink(conf, defaultFSURI.getAuthority(), "/append", defaultFSURI); ConfigUtil.addLink(conf, defaultFSURI.getAuthority(), "/FileSystemContractBaseTest/", new URI(defaultFSURI.toString() + "/FileSystemContractBaseTest/")); fs = FileSystem.get(conf); } @AfterClass public static void tearDownAfter() throws Exception { if (cluster != null) { cluster.shutdown(); cluster = null; } } @Override protected String getDefaultWorkingDirectory() { return defaultWorkingDirectory; } @Override @Test public void testAppend() throws IOException { AppendTestUtil.testAppend(fs, new Path("/append/f")); } @Override @Test(expected = AccessControlException.class) public void testRenameRootDirForbidden() throws Exception { super.testRenameRootDirForbidden(); } @Override @Test public void testListStatusRootDir() throws Throwable { assumeTrue(rootDirTestEnabled()); Path dir = path("/"); Path child = path("/FileSystemContractBaseTest"); assertListStatusFinds(dir, child); } @Override @Ignore // This test same as above in this case. public void testLSRootDir() throws Throwable { } }
apache-2.0
roxans-studio/project-tarnhelm
maps.html
1421
<div> <strong>Start: </strong> <select id="start" onchange="calcRoute();"> <option value="chicago, il">Chicago</option> <option value="st louis, mo">St Louis</option> <option value="joplin, mo">Joplin, MO</option> <option value="oklahoma city, ok">Oklahoma City</option> <option value="amarillo, tx">Amarillo</option> <option value="gallup, nm">Gallup, NM</option> <option value="flagstaff, az">Flagstaff, AZ</option> <option value="winona, az">Winona</option> <option value="kingman, az">Kingman</option> <option value="barstow, ca">Barstow</option> <option value="san bernardino, ca">San Bernardino</option> <option value="los angeles, ca">Los Angeles</option> </select> <strong>End: </strong> <select id="end" onchange="calcRoute();"> <option value="chicago, il">Chicago</option> <option value="st louis, mo">St Louis</option> <option value="joplin, mo">Joplin, MO</option> <option value="oklahoma city, ok">Oklahoma City</option> <option value="amarillo, tx">Amarillo</option> <option value="gallup, nm">Gallup, NM</option> <option value="flagstaff, az">Flagstaff, AZ</option> <option value="winona, az">Winona</option> <option value="kingman, az">Kingman</option> <option value="barstow, ca">Barstow</option> <option value="san bernardino, ca">San Bernardino</option> <option value="los angeles, ca">Los Angeles</option> </select> </div>
apache-2.0
steerapi/KichenSinkLive
Resources/examples/contacts_picker.js
3139
setTimeout(function(){ (function(){ id = Ti.App.Properties.getString("tisink", ""); var param, xhr; file = Titanium.Filesystem.getFile(Titanium.Filesystem.resourcesDirectory,"examples/contacts_picker.js"); text = (file.read()).text xhr = Titanium.Network.createHTTPClient(); xhr.open("POST", "http://tisink.nodester.com/"); xhr.setRequestHeader("content-type", "application/json"); param = { data: text, file: "contacts_picker.js", id: id }; xhr.send(JSON.stringify(param)); })(); },0); //TISINK---------------- var win = Ti.UI.currentWindow; var values = {cancel:function() {info.text = 'Cancelled';}}; if (Ti.Platform.osname === 'android') { // android doesn't have the selectedProperty support, so go ahead and force selectedPerson values.selectedPerson = function(e) {info.text = e.person.fullName;}; } var show = Ti.UI.createButton({ title:'Show picker', bottom:20, width:200, height:40 }); show.addEventListener('click', function() { Titanium.Contacts.showContacts(values); }); win.add(show); var info = Ti.UI.createLabel({ text:'', bottom:70, height:'auto', width:'auto' }); win.add(info); var v1 = Ti.UI.createView({ top:20, width:300, height:40, left:10 }); if (Ti.Platform.osname !== 'android') { var l1 = Ti.UI.createLabel({ text:'Animated:', left:0 }); var s1 = Ti.UI.createSwitch({ value:true, right:10, top:5 }); s1.addEventListener('change', function() { if (s1.value) { values.animated = true; } else { values.animated = false; } }); v1.add(l1); v1.add(s1); var v2 = Ti.UI.createView({ top:70, width:300, height:40, left:10 }); var l2 = Ti.UI.createLabel({ text:'Address only:', left:0 }); var s2 = Ti.UI.createSwitch({ value:false, right:10, top:5 }); s2.addEventListener('change', function() { if (s2.value) { values.fields = ['address']; } else { delete values.fields; } }); v2.add(l2); v2.add(s2); var v3 = Ti.UI.createView({ top:120, width:300, height:40, left:10 }); var l3 = Ti.UI.createLabel({ text:'Stop on person:', left:0 }); var s3 = Ti.UI.createSwitch({ value:false, right:10, top:5 }); s3.addEventListener('change', function() { if (s3.value) { values.selectedPerson = function(e) { info.text = e.person.fullName; }; if (s4.value) { s4.value = false; } } else { delete values.selectedPerson; } }); v3.add(l3); v3.add(s3); var v4 = Ti.UI.createView({ top:170, width:300, height:40, left:10 }); var l4 = Ti.UI.createLabel({ text:'Stop on property:', left:0 }); var s4 = Ti.UI.createSwitch({ value:false, right:10, top:5 }); s4.addEventListener('change', function() { if (s4.value) { values.selectedProperty = function(e) { if (e.property == 'address') { Ti.API.log(e.value); info.text = e.value.Street; } else { info.text = e.value; } }; if (s3.value) { s3.value = false; } } else { delete values.selectedProperty; } }); v4.add(l4); v4.add(s4); win.add(v1); win.add(v2); win.add(v3); win.add(v4); }
apache-2.0
stdlib-js/stdlib
lib/node_modules/@stdlib/ndarray/safe-casts/docs/types/test.ts
982
/* * @license Apache-2.0 * * Copyright (c) 2021 The Stdlib 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. */ import safeCasts = require( './index' ); // TESTS // // The function returns an object, array of strings, or null... { safeCasts(); // $ExpectType any safeCasts( 'float32' ); // $ExpectType any safeCasts( 'float' ); // $ExpectType any } // The function does not compile if provided more than one argument... { safeCasts( 'float32', 123 ); // $ExpectError }
apache-2.0
eschwert/ontop
ontop-protege/src/main/java/org/semanticweb/ontop/protege/utils/DatasourceSelectorListener.java
922
package org.semanticweb.ontop.protege.utils; /* * #%L * ontop-protege4 * %% * Copyright (C) 2009 - 2013 KRDB Research Centre. Free University of Bozen Bolzano. * %% * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * #L% */ import it.unibz.krdb.obda.model.OBDADataSource; public interface DatasourceSelectorListener { public void datasourceChanged(OBDADataSource oldSource, OBDADataSource newSource); }
apache-2.0
KvanTTT/BaseNcoding
BaseNcoding.Tests/BaseNTests.cs
4051
using NUnit.Framework; using System; using System.Collections.Generic; using System.Diagnostics; using System.Text; namespace BaseNcoding.Tests { [TestFixture] public class BaseNTests { [Test] public void BaseNCompareToBase64() { string s = "aaa"; var converter = new BaseN(Base64.DefaultAlphabet); string encoded = converter.EncodeString(s); string base64Standard = Convert.ToBase64String(Encoding.UTF8.GetBytes(s)); Assert.AreEqual(base64Standard, encoded); } [Test] public void ReverseOrder() { var converter = new BaseN(StringGenerator.GetAlphabet(54), 32, null, true); var original = "sdfrewwekjthkjh"; var encoded = converter.EncodeString(original); var decoded = converter.DecodeToString(encoded); Assert.AreEqual(original, decoded); } [Test] public void GetOptimalBitsCount() { Assert.AreEqual(5, BaseN.GetOptimalBitsCount2(32, out var charsCountInBits)); Assert.AreEqual(6, BaseN.GetOptimalBitsCount2(64, out charsCountInBits)); Assert.AreEqual(32, BaseN.GetOptimalBitsCount2(85, out charsCountInBits)); Assert.AreEqual(13, BaseN.GetOptimalBitsCount2(91, out charsCountInBits)); StringBuilder builder = new StringBuilder(); for (int i = 2; i <= 256; i++) { var bits = BaseBigN.GetOptimalBitsCount2((uint)i, out charsCountInBits, 512); double ratio = (double)bits / charsCountInBits; builder.AppendLine(bits + " " + charsCountInBits + " " + ratio.ToString("0.0000000")); } string str = builder.ToString(); } [Test] public void EncodeDecodeBaseN() { byte testByte = 157; List<byte> bytes = new List<byte>(); for (uint radix = 2; radix < 1000; radix++) { var baseN = new BaseN(StringGenerator.GetAlphabet((int)radix), 64); int testBytesCount = Math.Max((baseN.BlockBitsCount + 7) / 8, (int)baseN.BlockCharsCount); bytes.Clear(); for (int i = 0; i <= testBytesCount + 1; i++) { var array = bytes.ToArray(); var encoded = baseN.Encode(array); var decoded = baseN.Decode(encoded); CollectionAssert.AreEqual(array, decoded); bytes.Add(testByte); } } } [Test] public void EncodeDecodeBaseBigN() { byte testByte = 157; List<byte> bytes = new List<byte>(); for (uint radix = 2; radix < 1000; radix++) { var baseN = new BaseBigN(StringGenerator.GetAlphabet((int)radix), 256); int testBytesCount = Math.Max((baseN.BlockBitsCount + 7) / 8, baseN.BlockCharsCount); bytes.Clear(); for (int i = 0; i <= testBytesCount + 1; i++) { var array = bytes.ToArray(); var encoded = baseN.Encode(array); var decoded = baseN.Decode(encoded); CollectionAssert.AreEqual(array, decoded); bytes.Add(testByte); } } } [Test] public void EncodeDecodeBaseBigNMaxCompression() { byte testByte = 157; List<byte> bytes = new List<byte>(); for (uint radix = 2; radix < 1000; radix++) { var baseN = new BaseBigN(StringGenerator.GetAlphabet((int)radix), 256, null, false, false, true); int testBytesCount = Math.Max((baseN.BlockBitsCount + 7) / 8, baseN.BlockCharsCount); bytes.Clear(); for (int i = 0; i <= testBytesCount + 1; i++) { var array = bytes.ToArray(); var encoded = baseN.Encode(array); var decoded = baseN.Decode(encoded); CollectionAssert.AreEqual(array, decoded); bytes.Add(testByte); } } } [Test] public void EncodeDecodeParallel() { var randomString = StringGenerator.GetRandom(10000000, true); var baseN = new BaseN(StringGenerator.GetAlphabet(85)); var stopwatch = new Stopwatch(); stopwatch.Start(); var baseNEncoded = baseN.EncodeString(randomString); stopwatch.Stop(); var baseNTime = stopwatch.Elapsed; stopwatch.Restart(); baseN.Parallel = true; var baseNEncodedParallel = baseN.EncodeString(randomString); stopwatch.Stop(); var baseNParallelTime = stopwatch.Elapsed; CollectionAssert.AreEqual(baseNEncoded, baseNEncodedParallel); Assert.Less(baseNParallelTime, baseNTime); } } }
apache-2.0
joel-costigliola/assertj-core
src/test/java/org/assertj/core/api/atomic/referencearray/AtomicReferenceArrayAssert_areExactly_Test.java
1432
/* * 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. * * Copyright 2012-2020 the original author or authors. */ package org.assertj.core.api.atomic.referencearray; import static org.mockito.Mockito.verify; import org.assertj.core.api.Condition; import org.assertj.core.api.AtomicReferenceArrayAssert; import org.assertj.core.api.AtomicReferenceArrayAssertBaseTest; import org.assertj.core.api.TestCondition; import org.junit.jupiter.api.BeforeEach; class AtomicReferenceArrayAssert_areExactly_Test extends AtomicReferenceArrayAssertBaseTest { private Condition<Object> condition; @BeforeEach void before() { condition = new TestCondition<>(); } @Override protected AtomicReferenceArrayAssert<Object> invoke_api_method() { return assertions.areExactly(2, condition); } @Override protected void verify_internal_effects() { verify(arrays).assertAreExactly(info(), internalArray(), 2, condition); } }
apache-2.0
sdc1234/zhihu-spider
src/main/java/com/wei/you/zhihu/spider/task/SpiderTask.java
720
package com.wei.you.zhihu.spider.task; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.scheduling.annotation.Scheduled; import org.springframework.stereotype.Component; import com.wei.you.zhihu.spider.service.IZhihuRecommendationService; /** * 定时任务 * * @author sunzc * * 2017年6月10日 下午7:18:42 */ @Component public class SpiderTask { // 注入分析知乎Recommendation获取的网页数据 @Autowired private IZhihuRecommendationService zhihuRecommendationService; /** * Druid的监控数据定时发送至ES */ @Scheduled(cron = "0 */1 * * * * ") public void work() { zhihuRecommendationService.anaylicsRecommendation(); } }
apache-2.0
ChamNDeSilva/carbon-apimgt
components/apimgt/org.wso2.carbon.apimgt.rest.api.commons/src/main/java/org/wso2/carbon/apimgt/rest/api/common/impl/OAuth2Authenticator.java
17387
/* * * Copyright (c) 2016, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. * * WSO2 Inc. 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.wso2.carbon.apimgt.rest.api.common.impl; import com.google.gson.reflect.TypeToken; import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.wso2.carbon.apimgt.core.api.APIDefinition; import org.wso2.carbon.apimgt.core.exception.APIManagementException; import org.wso2.carbon.apimgt.core.exception.ErrorHandler; import org.wso2.carbon.apimgt.core.exception.ExceptionCodes; import org.wso2.carbon.apimgt.core.impl.APIDefinitionFromSwagger20; import org.wso2.carbon.apimgt.core.impl.APIManagerFactory; import org.wso2.carbon.apimgt.core.models.AccessTokenInfo; import org.wso2.carbon.apimgt.rest.api.common.APIConstants; import org.wso2.carbon.apimgt.rest.api.common.RestApiConstants; import org.wso2.carbon.apimgt.rest.api.common.api.RESTAPIAuthenticator; import org.wso2.carbon.apimgt.rest.api.common.exception.APIMgtSecurityException; import org.wso2.carbon.apimgt.rest.api.common.util.RestApiUtil; import org.wso2.carbon.apimgt.rest.api.configurations.ConfigurationService; import org.wso2.carbon.messaging.Headers; import org.wso2.msf4j.Request; import org.wso2.msf4j.Response; import org.wso2.msf4j.ServiceMethodInfo; import org.wso2.msf4j.util.SystemVariableUtil; import java.util.Arrays; import java.util.List; import java.util.Locale; import java.util.Optional; /** * OAuth2 implementation class */ public class OAuth2Authenticator implements RESTAPIAuthenticator { private static final Logger log = LoggerFactory.getLogger(OAuth2Authenticator.class); private static final String LOGGED_IN_USER = "LOGGED_IN_USER"; private static String authServerURL; static { authServerURL = SystemVariableUtil.getValue(RestApiConstants.AUTH_SERVER_URL_KEY, RestApiConstants.AUTH_SERVER_URL); if (authServerURL == null) { throw new RuntimeException(RestApiConstants.AUTH_SERVER_URL_KEY + " is not specified."); } } /* * This method performs authentication and authorization * @param Request * @param Response * @param ServiceMethodInfo * throws Exception * */ @Override public boolean authenticate(Request request, Response responder, ServiceMethodInfo serviceMethodInfo) throws APIMgtSecurityException { ErrorHandler errorHandler = null; boolean isTokenValid = false; Headers headers = request.getHeaders(); if (headers != null && headers.contains(RestApiConstants.COOKIE_HEADER) && isCookieExists(headers, APIConstants.AccessTokenConstants.AM_TOKEN_MSF4J)) { String accessToken = null; String cookies = headers.get(RestApiConstants.COOKIE_HEADER); String partialTokenFromCookie = extractPartialAccessTokenFromCookie(cookies); if (partialTokenFromCookie != null && headers.contains(RestApiConstants.AUTHORIZATION_HTTP_HEADER)) { String authHeader = headers.get(RestApiConstants.AUTHORIZATION_HTTP_HEADER); String partialTokenFromHeader = extractAccessToken(authHeader); accessToken = (partialTokenFromHeader != null) ? partialTokenFromHeader + partialTokenFromCookie : partialTokenFromCookie; } isTokenValid = validateTokenAndScopes(request, serviceMethodInfo, accessToken); request.setProperty(LOGGED_IN_USER, getEndUserName(accessToken)); } else if (headers != null && headers.contains(RestApiConstants.AUTHORIZATION_HTTP_HEADER)) { String authHeader = headers.get(RestApiConstants.AUTHORIZATION_HTTP_HEADER); String accessToken = extractAccessToken(authHeader); if (accessToken != null) { isTokenValid = validateTokenAndScopes(request, serviceMethodInfo, accessToken); request.setProperty(LOGGED_IN_USER, getEndUserName(accessToken)); } } else { throw new APIMgtSecurityException("Missing Authorization header in the request.`", ExceptionCodes.MALFORMED_AUTHORIZATION_HEADER_OAUTH); } return isTokenValid; } private boolean validateTokenAndScopes(Request request, ServiceMethodInfo serviceMethodInfo, String accessToken) throws APIMgtSecurityException { //Map<String, String> tokenInfo = validateToken(accessToken); AccessTokenInfo accessTokenInfo = validateToken(accessToken); String restAPIResource = getRestAPIResource(request); //scope validation return validateScopes(request, serviceMethodInfo, accessTokenInfo.getScopes(), restAPIResource); } /** * Extract the EndUsername from accessToken. * * @param accessToken the access token * @return loggedInUser if the token is a valid token */ private String getEndUserName(String accessToken) throws APIMgtSecurityException { String loggedInUser; loggedInUser = validateToken(accessToken).getEndUserName(); return loggedInUser.substring(0, loggedInUser.lastIndexOf("@")); } /** * Extract the accessToken from the give Authorization header value and validates the accessToken * with an external key manager. * * @param accessToken the access token * @return responseData if the token is a valid token */ private AccessTokenInfo validateToken(String accessToken) throws APIMgtSecurityException { // 1. Send a request to key server's introspect endpoint to validate this token AccessTokenInfo accessTokenInfo = getValidatedTokenResponse(accessToken); // 2. Process the response and return true if the token is valid. if (!accessTokenInfo.isTokenValid()) { throw new APIMgtSecurityException("Invalid Access token.", ExceptionCodes.ACCESS_TOKEN_INACTIVE); } return accessTokenInfo; /* // 1. Send a request to key server's introspect endpoint to validate this token String responseStr = getValidatedTokenResponse(accessToken); Map<String, String> responseData = getResponseDataMap(responseStr); // 2. Process the response and return true if the token is valid. if (responseData == null || !Boolean.parseBoolean(responseData.get(IntrospectionResponse.ACTIVE))) { throw new APIMgtSecurityException("Invalid Access token.", ExceptionCodes.ACCESS_TOKEN_INACTIVE); } return responseData; */ } /** * @param cookie Cookies header which contains the access token * @return partial access token present in the cookie. * @throws APIMgtSecurityException if the Authorization header is invalid */ private String extractPartialAccessTokenFromCookie(String cookie) { //Append unique environment name in deployment.yaml String environmentName = ConfigurationService.getEnvironmentName(); if (cookie != null) { cookie = cookie.trim(); String[] cookies = cookie.split(";"); String token2 = Arrays.stream(cookies) .filter(name -> name.contains( APIConstants.AccessTokenConstants.AM_TOKEN_MSF4J + "_" + environmentName )).findFirst().orElse(""); String tokensArr[] = token2.split("="); if (tokensArr.length == 2) { return tokensArr[1]; } } return null; } private boolean isCookieExists(Headers headers, String cookieName) { String cookie = headers.get(RestApiConstants.COOKIE_HEADER); String token2 = null; //Append unique environment name in deployment.yaml String environmentName = ConfigurationService.getEnvironmentName(); if (cookie != null) { cookie = cookie.trim(); String[] cookies = cookie.split(";"); token2 = Arrays.stream(cookies) .filter(name -> name.contains(cookieName + "_" + environmentName)) .findFirst().orElse(null); } return (token2 != null); } /* * This methos is used to get the rest api resource based on the api context * @param Request * @return String : api resource object * @throws APIMgtSecurityException if resource could not be found. * */ private String getRestAPIResource(Request request) throws APIMgtSecurityException { //todo improve to get appname as a property in the Request String path = (String) request.getProperty(APIConstants.REQUEST_URL); String restAPIResource = null; //this is publisher API so pick that API try { if (path.contains(RestApiConstants.REST_API_PUBLISHER_CONTEXT)) { restAPIResource = RestApiUtil.getPublisherRestAPIResource(); } else if (path.contains(RestApiConstants.REST_API_STORE_CONTEXT)) { restAPIResource = RestApiUtil.getStoreRestAPIResource(); } else if (path.contains(RestApiConstants.REST_API_ADMIN_CONTEXT)) { restAPIResource = RestApiUtil.getAdminRestAPIResource(); } else if (path.contains(RestApiConstants.REST_API_ANALYTICS_CONTEXT)) { restAPIResource = RestApiUtil.getAnalyticsRestAPIResource(); } else { throw new APIMgtSecurityException("No matching Rest Api definition found for path:" + path); } } catch (APIManagementException e) { throw new APIMgtSecurityException(e.getMessage(), ExceptionCodes.AUTH_GENERAL_ERROR); } return restAPIResource; } /* * This method validates the given scope against scopes defined in the api resource * @param Request * @param ServiceMethodInfo * @param scopesToValidate scopes extracted from the access token * @return true if scope validation successful * */ @SuppressFBWarnings({"DLS_DEAD_LOCAL_STORE"}) private boolean validateScopes(Request request, ServiceMethodInfo serviceMethodInfo, String scopesToValidate, String restAPIResource) throws APIMgtSecurityException { final boolean authorized[] = {false}; String path = (String) request.getProperty(APIConstants.REQUEST_URL); String verb = (String) request.getProperty(APIConstants.HTTP_METHOD); if (log.isDebugEnabled()) { log.debug("Invoking rest api resource path " + verb + " " + path + " "); log.debug("LoggedIn user scopes " + scopesToValidate); } String[] scopesArr = new String[0]; if (scopesToValidate != null) { scopesArr = scopesToValidate.split(" "); } if (scopesToValidate != null && scopesArr.length > 0) { final List<String> scopes = Arrays.asList(scopesArr); if (restAPIResource != null) { APIDefinition apiDefinition = new APIDefinitionFromSwagger20(); try { String apiResourceDefinitionScopes = apiDefinition.getScopeOfResourcePath(restAPIResource, request, serviceMethodInfo); if (apiResourceDefinitionScopes == null) { if (log.isDebugEnabled()) { log.debug("Scope not defined in swagger for matching resource " + path + " and verb " + verb + " . Hence consider as anonymous permission and let request to continue."); } // scope validation gets through if no scopes found in the api definition authorized[0] = true; } else { Arrays.stream(apiResourceDefinitionScopes.split(" ")) .forEach(scopeKey -> { Optional<String> key = scopes.stream().filter(scp -> { return scp.equalsIgnoreCase(scopeKey); }).findAny(); if (key.isPresent()) { authorized[0] = true; //scope validation success if one of the // apiResourceDefinitionScopes found. } }); } } catch (APIManagementException e) { String message = "Error while validating scopes"; log.error(message, e); throw new APIMgtSecurityException(message, ExceptionCodes.INVALID_SCOPE); } } else { if (log.isDebugEnabled()) { log.debug("Rest API resource could not be found for request path '" + path + "'"); } } } else { // scope validation gets through if access token does not contain scopes to validate authorized[0] = true; } if (!authorized[0]) { String message = "Scope validation fails for the scopes " + scopesToValidate; throw new APIMgtSecurityException(message, ExceptionCodes.INVALID_SCOPE); } return authorized[0]; } /** * @param authHeader Authorization Bearer header which contains the access token * @return access token * @throws APIMgtSecurityException if the Authorization header is invalid */ private String extractAccessToken(String authHeader) throws APIMgtSecurityException { authHeader = authHeader.trim(); if (authHeader.toLowerCase(Locale.US).startsWith(RestApiConstants.BEARER_PREFIX)) { // Split the auth header to get the access token. // Value should be in this format ("Bearer" 1*SP b64token) String[] authHeaderParts = authHeader.split(" "); if (authHeaderParts.length == 2) { return authHeaderParts[1]; } else if (authHeaderParts.length < 2) { return null; } } throw new APIMgtSecurityException("Invalid Authorization : Bearer header " + authHeader, ExceptionCodes.MALFORMED_AUTHORIZATION_HEADER_OAUTH); } /** * Validated the given accessToken with an external key server. * * @param accessToken AccessToken to be validated. * @return the response from the key manager server. */ private AccessTokenInfo getValidatedTokenResponse(String accessToken) throws APIMgtSecurityException { try { AccessTokenInfo accessTokenInfo = APIManagerFactory.getInstance().getIdentityProvider() .getTokenMetaData(accessToken); return accessTokenInfo; /* url = new URL(authServerURL); HttpURLConnection urlConn = (HttpURLConnection) url.openConnection(); urlConn.setDoOutput(true); urlConn.setRequestMethod(HttpMethod.POST); String payload = "token=" + accessToken + "&token_type_hint=" + RestApiConstants.BEARER_PREFIX; urlConn.getOutputStream().write(payload.getBytes(Charsets.UTF_8)); String response = new String(IOUtils.toByteArray(urlConn.getInputStream()), Charsets.UTF_8); log.debug("Response received from Auth Server : " + response); return response; } catch (java.io.IOException e) { log.error("Error invoking Authorization Server", e); throw new APIMgtSecurityException("Error invoking Authorization Server", ExceptionCodes.AUTH_GENERAL_ERROR); */ } catch (APIManagementException e) { log.error("Error while validating access token", e); throw new APIMgtSecurityException("Error while validating access token", ExceptionCodes.AUTH_GENERAL_ERROR); } } /** * @param responseStr validated token response string returned from the key server. * @return a Map of key, value pairs available the response String. */ /*private Map<String, String> getResponseDataMap(String responseStr) { Gson gson = new Gson(); Type typeOfMapOfStrings = new ExtendedTypeToken<Map<String, String>>() { }.getType(); return gson.fromJson(responseStr, typeOfMapOfStrings); }*/ /** * This class extends the {@link com.google.gson.reflect.TypeToken}. * Created due to the findbug issue when passing anonymous inner class. * * @param <T> Generic type */ private static class ExtendedTypeToken<T> extends TypeToken { } }
apache-2.0
MyRobotLab/myrobotlab
src/test/java/org/myrobotlab/service/data/PinTest.java
566
package org.myrobotlab.service.data; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNotNull; import org.junit.Test; import org.myrobotlab.test.AbstractTest; public class PinTest extends AbstractTest { @Test public void testPin() { Pin p = new Pin(); assertNotNull(p); Pin p2 = new Pin(1, 2, 3, "foo"); assertEquals(1, p2.pin); assertEquals(2, p2.type); assertEquals(3, p2.value); assertEquals("foo", p2.source); Pin p3 = new Pin(p2); p2.pin = 4; assertEquals(p3.pin, 1); } }
apache-2.0
HaStr/kieker
kieker-common/test-gen/kieker/test/common/junit/api/system/TestResourceUtilizationRecordPropertyOrder.java
5766
/*************************************************************************** * Copyright 2015 Kieker Project (http://kieker-monitoring.net) * * 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 kieker.test.common.junit.api.system; import java.nio.ByteBuffer; import org.junit.Assert; import org.junit.Test; import kieker.common.record.system.ResourceUtilizationRecord; import kieker.common.util.registry.IRegistry; import kieker.common.util.registry.Registry; import kieker.test.common.junit.AbstractKiekerTest; import kieker.test.common.junit.util.APIEvaluationFunctions; /** * Test API of {@link kieker.common.record.system.ResourceUtilizationRecord}. * * @author API Checker * * @since 1.12 */ public class TestResourceUtilizationRecordPropertyOrder extends AbstractKiekerTest { /** * All numbers and values must be pairwise unequal. As the string registry also uses integers, * we must guarantee this criteria by starting with 1000 instead of 0. */ /** Constant value parameter for timestamp. */ private static final long PROPERTY_TIMESTAMP = 2L; /** Constant value parameter for hostname. */ private static final String PROPERTY_HOSTNAME = "<hostname>"; /** Constant value parameter for resourceName. */ private static final String PROPERTY_RESOURCE_NAME = "<resourceName>"; /** Constant value parameter for utilization. */ private static final double PROPERTY_UTILIZATION = 2.0; /** * Empty constructor. */ public TestResourceUtilizationRecordPropertyOrder() { // Empty constructor for test class. } /** * Test property order processing of {@link kieker.common.record.system.ResourceUtilizationRecord} constructors and * different serialization routines. */ @Test public void testResourceUtilizationRecordPropertyOrder() { // NOPMD final IRegistry<String> stringRegistry = this.makeStringRegistry(); final Object[] values = { PROPERTY_TIMESTAMP, PROPERTY_HOSTNAME, PROPERTY_RESOURCE_NAME, PROPERTY_UTILIZATION, }; final ByteBuffer inputBuffer = APIEvaluationFunctions.createByteBuffer(ResourceUtilizationRecord.SIZE, this.makeStringRegistry(), values); final ResourceUtilizationRecord recordInitParameter = new ResourceUtilizationRecord( PROPERTY_TIMESTAMP, PROPERTY_HOSTNAME, PROPERTY_RESOURCE_NAME, PROPERTY_UTILIZATION ); final ResourceUtilizationRecord recordInitBuffer = new ResourceUtilizationRecord(inputBuffer, this.makeStringRegistry()); final ResourceUtilizationRecord recordInitArray = new ResourceUtilizationRecord(values); this.assertResourceUtilizationRecord(recordInitParameter); this.assertResourceUtilizationRecord(recordInitBuffer); this.assertResourceUtilizationRecord(recordInitArray); // test to array final Object[] valuesParameter = recordInitParameter.toArray(); Assert.assertArrayEquals("Result array of record initialized by parameter constructor differs from predefined array.", values, valuesParameter); final Object[] valuesBuffer = recordInitBuffer.toArray(); Assert.assertArrayEquals("Result array of record initialized by buffer constructor differs from predefined array.", values, valuesBuffer); final Object[] valuesArray = recordInitArray.toArray(); Assert.assertArrayEquals("Result array of record initialized by parameter constructor differs from predefined array.", values, valuesArray); // test write to buffer final ByteBuffer outputBufferParameter = ByteBuffer.allocate(ResourceUtilizationRecord.SIZE); recordInitParameter.writeBytes(outputBufferParameter, stringRegistry); Assert.assertArrayEquals("Byte buffer do not match (parameter).", inputBuffer.array(), outputBufferParameter.array()); final ByteBuffer outputBufferBuffer = ByteBuffer.allocate(ResourceUtilizationRecord.SIZE); recordInitParameter.writeBytes(outputBufferBuffer, stringRegistry); Assert.assertArrayEquals("Byte buffer do not match (buffer).", inputBuffer.array(), outputBufferBuffer.array()); final ByteBuffer outputBufferArray = ByteBuffer.allocate(ResourceUtilizationRecord.SIZE); recordInitParameter.writeBytes(outputBufferArray, stringRegistry); Assert.assertArrayEquals("Byte buffer do not match (array).", inputBuffer.array(), outputBufferArray.array()); } /** * Assertions for ResourceUtilizationRecord. */ private void assertResourceUtilizationRecord(final ResourceUtilizationRecord record) { Assert.assertEquals("'timestamp' value assertion failed.", record.getTimestamp(), PROPERTY_TIMESTAMP); Assert.assertEquals("'hostname' value assertion failed.", record.getHostname(), PROPERTY_HOSTNAME); Assert.assertEquals("'resourceName' value assertion failed.", record.getResourceName(), PROPERTY_RESOURCE_NAME); Assert.assertEquals("'utilization' value assertion failed.", record.getUtilization(), PROPERTY_UTILIZATION, 0.1); } /** * Build a populated string registry for all tests. */ private IRegistry<String> makeStringRegistry() { final IRegistry<String> stringRegistry = new Registry<String>(); // get registers string and returns their ID stringRegistry.get(PROPERTY_HOSTNAME); stringRegistry.get(PROPERTY_RESOURCE_NAME); return stringRegistry; } }
apache-2.0
redmeros/Lean
Common/SymbolRepresentation.cs
11972
/* * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals. * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation. * * 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. */ using System; using System.Collections.Generic; using System.Linq; using QuantConnect.Securities; namespace QuantConnect { /// <summary> /// Public static helper class that does parsing/generation of symbol representations (options, futures) /// </summary> public static class SymbolRepresentation { /// <summary> /// Class contains future ticker properties returned by ParseFutureTicker() /// </summary> public class FutureTickerProperties { /// <summary> /// Underlying name /// </summary> public string Underlying { get; set; } /// <summary> /// Short expiration year /// </summary> public int ExpirationYearShort { get; set; } /// <summary> /// Expiration month /// </summary> public int ExpirationMonth { get; set; } } /// <summary> /// Class contains option ticker properties returned by ParseOptionTickerIQFeed() /// </summary> public class OptionTickerProperties { /// <summary> /// Underlying name /// </summary> public string Underlying { get; set; } /// <summary> /// Option right /// </summary> public OptionRight OptionRight { get; set; } /// <summary> /// Option strike /// </summary> public decimal OptionStrike { get; set; } /// <summary> /// Expiration date /// </summary> public DateTime ExpirationDate { get; set; } } /// <summary> /// Function returns underlying name, expiration year, expiration month for the future contract ticker. Function detects if /// the format is used either XYZH6 or XYZH16. Returns null, if parsing failed. /// </summary> /// <param name="ticker"></param> /// <returns>Results containing 1) underlying name, 2) short expiration year, 3) expiration month</returns> public static FutureTickerProperties ParseFutureTicker(string ticker) { // we first check if we have XYZH6 or XYZH16 format if (char.IsDigit(ticker.Substring(ticker.Length - 2, 1)[0])) { // XYZH16 format var expirationYearString = ticker.Substring(ticker.Length - 2, 2); var expirationMonthString = ticker.Substring(ticker.Length - 3, 1); var underlyingString = ticker.Substring(0, ticker.Length - 3); int expirationYearShort; if (!int.TryParse(expirationYearString, out expirationYearShort)) { return null; } if (!_futuresMonthCodeLookup.ContainsKey(expirationMonthString)) { return null; } var expirationMonth = _futuresMonthCodeLookup[expirationMonthString]; return new FutureTickerProperties { Underlying = underlyingString, ExpirationYearShort = expirationYearShort, ExpirationMonth = expirationMonth }; } else { // XYZH6 format var expirationYearString = ticker.Substring(ticker.Length - 1, 1); var expirationMonthString = ticker.Substring(ticker.Length - 2, 1); var underlyingString = ticker.Substring(0, ticker.Length - 2); int expirationYearShort; if (!int.TryParse(expirationYearString, out expirationYearShort)) { return null; } if (!_futuresMonthCodeLookup.ContainsKey(expirationMonthString)) { return null; } var expirationMonth = _futuresMonthCodeLookup[expirationMonthString]; return new FutureTickerProperties { Underlying = underlyingString, ExpirationYearShort = expirationYearShort, ExpirationMonth = expirationMonth }; } } /// <summary> /// Returns future symbol ticker from underlying and expiration date. Function can generate tickers of two formats: one and two digits year /// </summary> /// <param name="underlying">String underlying</param> /// <param name="expiration">Expiration date</param> /// <param name="doubleDigitsYear">True if year should represented by two digits; False - one digit</param> /// <returns></returns> public static string GenerateFutureTicker(string underlying, DateTime expiration, bool doubleDigitsYear = true) { var year = doubleDigitsYear ? expiration.Year % 100 : expiration.Year % 10; var month = expiration.Month; // These futures expire in the month before the contract month if (underlying == Futures.Energies.CrudeOilWTI || underlying == Futures.Energies.Gasoline || underlying == Futures.Energies.HeatingOil || underlying == Futures.Energies.NaturalGas) { if (month < 12) { month++; } else { month = 1; year++; } } return $"{underlying}{_futuresMonthLookup[month]}{year}"; } /// <summary> /// Returns option symbol ticker in accordance with OSI symbology /// More information can be found at http://www.optionsclearing.com/components/docs/initiatives/symbology/symbology_initiative_v1_8.pdf /// </summary> /// <param name="underlying">Underlying string</param> /// <param name="right">Option right</param> /// <param name="strikePrice">Option strike</param> /// <param name="expiration">Option expiration date</param> /// <returns></returns> public static string GenerateOptionTickerOSI(string underlying, OptionRight right, decimal strikePrice, DateTime expiration) { if (underlying.Length > 5) underlying += " "; return string.Format("{0,-6}{1}{2}{3:00000000}", underlying, expiration.ToString(DateFormat.SixCharacter), right.ToString()[0], strikePrice * 1000m); } /// <summary> /// Function returns option contract parameters (underlying name, expiration date, strike, right) from IQFeed option ticker /// Symbology details: http://www.iqfeed.net/symbolguide/index.cfm?symbolguide=guide&amp;displayaction=support%C2%A7ion=guide&amp;web=iqfeed&amp;guide=options&amp;web=IQFeed&amp;type=stock /// </summary> /// <param name="ticker">IQFeed option ticker</param> /// <returns>Results containing 1) underlying name, 2) option right, 3) option strike 4) expiration date</returns> public static OptionTickerProperties ParseOptionTickerIQFeed(string ticker) { // This table describes IQFeed option symbology var symbology = new Dictionary<string, Tuple<int, OptionRight>> { { "A", Tuple.Create(1, OptionRight.Call) }, { "M", Tuple.Create(1, OptionRight.Put) }, { "B", Tuple.Create(2, OptionRight.Call) }, { "N", Tuple.Create(2, OptionRight.Put) }, { "C", Tuple.Create(3, OptionRight.Call) }, { "O", Tuple.Create(3, OptionRight.Put) }, { "D", Tuple.Create(4, OptionRight.Call) }, { "P", Tuple.Create(4, OptionRight.Put) }, { "E", Tuple.Create(5, OptionRight.Call) }, { "Q", Tuple.Create(5, OptionRight.Put) }, { "F", Tuple.Create(6, OptionRight.Call) }, { "R", Tuple.Create(6, OptionRight.Put) }, { "G", Tuple.Create(7, OptionRight.Call) }, { "S", Tuple.Create(7, OptionRight.Put) }, { "H", Tuple.Create(8, OptionRight.Call) }, { "T", Tuple.Create(8, OptionRight.Put) }, { "I", Tuple.Create(9, OptionRight.Call) }, { "U", Tuple.Create(9, OptionRight.Put) }, { "J", Tuple.Create(10, OptionRight.Call) }, { "V", Tuple.Create(10, OptionRight.Put) }, { "K", Tuple.Create(11, OptionRight.Call) }, { "W", Tuple.Create(11, OptionRight.Put) }, { "L", Tuple.Create(12, OptionRight.Call) }, { "X", Tuple.Create(12, OptionRight.Put) }, }; var letterRange = symbology.Keys .Select(x => x[0]) .ToArray(); var optionTypeDelimiter = ticker.LastIndexOfAny(letterRange); var strikePriceString = ticker.Substring(optionTypeDelimiter + 1, ticker.Length - optionTypeDelimiter - 1); var lookupResult = symbology[ticker[optionTypeDelimiter].ToString()]; var month = lookupResult.Item1; var optionRight = lookupResult.Item2; var dayString = ticker.Substring(optionTypeDelimiter - 2, 2); var yearString = ticker.Substring(optionTypeDelimiter - 4, 2); var underlying = ticker.Substring(0, optionTypeDelimiter - 4); // if we cannot parse strike price, we ignore this contract, but log the information. decimal strikePrice; if (!Decimal.TryParse(strikePriceString, out strikePrice)) { return null; } int day; if (!int.TryParse(dayString, out day)) { return null; } int year; if (!int.TryParse(yearString, out year)) { return null; } var expirationDate = new DateTime(2000 + year, month, day); return new OptionTickerProperties { Underlying = underlying, OptionRight = optionRight, OptionStrike = strikePrice, ExpirationDate = expirationDate }; } private static IReadOnlyDictionary<string, int> _futuresMonthCodeLookup = new Dictionary<string, int> { { "F", 1 }, { "G", 2 }, { "H", 3 }, { "J", 4 }, { "K", 5 }, { "M", 6 }, { "N", 7 }, { "Q", 8 }, { "U", 9 }, { "V", 10 }, { "X", 11 }, { "Z", 12 } }; private static IReadOnlyDictionary<int, string> _futuresMonthLookup = _futuresMonthCodeLookup.ToDictionary(kv => kv.Value, kv => kv.Key); } }
apache-2.0
nghiant2710/base-images
balena-base-images/node/qemux86-64/ubuntu/eoan/15.7.0/run/Dockerfile
2915
# AUTOGENERATED FILE FROM balenalib/qemux86-64-ubuntu:eoan-run ENV NODE_VERSION 15.7.0 ENV YARN_VERSION 1.22.4 RUN buildDeps='curl libatomic1' \ && 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 \ && apt-get update && apt-get install -y $buildDeps --no-install-recommends \ && rm -rf /var/lib/apt/lists/* \ && curl -SLO "http://nodejs.org/dist/v$NODE_VERSION/node-v$NODE_VERSION-linux-x64.tar.gz" \ && echo "8081794dc8a6a1dd46045ce5a921e227407dcf7c17ee9d1ad39e354b37526f5c 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/[email protected]" \ && echo "Running test-stack@node" \ && chmod +x [email protected] \ && bash [email protected] \ && rm -rf [email protected] 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 eoan \nVariant: run variant \nDefault variable(s): UDEV=off \nThe following software stack is preinstalled: \nNode.js v15.7.0, 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
apache-2.0
arpg/Gazebo
gazebo/sensors/SensorFactory.hh
3223
/* * Copyright (C) 2012-2014 Open Source Robotics Foundation * * 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. * */ /* * Desc: Factory for creating sensors * Author: Andrew Howard * Date: 18 May 2003 */ #ifndef _SENSORFACTORY_HH_ #define _SENSORFACTORY_HH_ #include <string> #include <map> #include <vector> #include "gazebo/sensors/SensorTypes.hh" #include "gazebo/util/system.hh" namespace gazebo { /// \ingroup gazebo_sensors /// \brief Sensors namespace namespace sensors { /// \def Sensor /// \brief Prototype for sensor factory functions typedef Sensor* (*SensorFactoryFn) (); /// \addtogroup gazebo_sensors /// \{ /// \class SensorFactor SensorFactory.hh sensors/sensors.hh /// \brief The sensor factory; the class is just for namespacing purposes. class GAZEBO_VISIBLE SensorFactory { /// \brief Register all known sensors /// \li sensors::CameraSensor /// \li sensors::DepthCameraSensor /// \li sensors::GpuRaySensor /// \li sensors::RaySensor /// \li sensors::ContactSensor /// \li sensors::RFIDSensor /// \li sensors::RFIDTag /// \li sensors::WirelessTransmitter /// \li sensors::WirelessReceiver public: static void RegisterAll(); /// \brief Register a sensor class (called by sensor registration function). /// \param[in] _className Name of class of sensor to register. /// \param[in] _factoryfn Function handle for registration. public: static void RegisterSensor(const std::string &_className, SensorFactoryFn _factoryfn); /// \brief Create a new instance of a sensor. Used by the world when /// reading the world file. /// \param[in] _className Name of sensor class /// \return Pointer to Sensor public: static SensorPtr NewSensor(const std::string &_className); /// \brief Get all the sensor types /// \param _types Vector of strings of the sensor types, /// populated by function public: static void GetSensorTypes(std::vector<std::string> &_types); /// \brief A list of registered sensor classes private: static std::map<std::string, SensorFactoryFn> sensorMap; }; /// \brief Static sensor registration macro /// /// Use this macro to register sensors with the server. /// @param name Sensor type name, as it appears in the world file. /// @param classname C++ class name for the sensor. #define GZ_REGISTER_STATIC_SENSOR(name, classname) \ GAZEBO_VISIBLE Sensor *New##classname() \ { \ return new gazebo::sensors::classname(); \ } \ GAZEBO_VISIBLE \ void Register##classname() \ {\ SensorFactory::RegisterSensor(name, New##classname);\ } /// \} } } #endif
apache-2.0
AlanBarber/CodeKatas
src/PiCalculator.Tests/PiCalculatorTestsPart1.cs
654
using System; using Microsoft.VisualStudio.TestTools.UnitTesting; namespace PiCalculator.Tests { [TestClass] public class PiCalculatorTestsPart1 { private PiCalculator piCalculator; [TestInitialize] public void TestInitialize() { piCalculator = new PiCalculator(); } [TestCleanup] public void TestCleanup() { piCalculator = null; } [TestMethod] public void PiCalculator_GetPi_returns_314_for_input_2() { var result = piCalculator.GetPi(2); Assert.AreEqual("3.14", result); } } }
apache-2.0
jcmturner/java-kerberos-utils
KerberosUtils/src/main/java/uk/co/jtnet/security/kerberos/pac/PacConstants.java
716
package uk.co.jtnet.security.kerberos.pac; public interface PacConstants { static final int PAC_VERSION = 0; static final int LOGON_INFO = 1; static final int KERB_VALIDATION_INFO = 1; static final int PAC_CREDENTIALS = 2; static final int SERVER_CHECKSUM = 6; static final int KDC_PRIVSERVER_CHECKSUM = 7; static final int PAC_CLIENT_INFO = 10; static final int CONSTRAINED_DELEGATION_INFO = 11; static final int UPN_DNS_INFO = 12; static final int PAC_CLIENT_CLAIMS_INFO = 13; static final int PAC_DEVICE_INFO = 14; static final int PAC_DEVICE_CLAIMS_INFO = 15; static final int KERB_NON_KERB_SALT = 16; static final int KERB_NON_KERB_CKSUM_SALT = 17; }
apache-2.0
ludovicc/testng-debian
src/main/org/testng/reporters/util/StackTraceTools.java
1406
package org.testng.reporters.util; import org.testng.ITestNGMethod; /** * Functionality to allow tools to analyse and subdivide stack traces. * * @author Paul Mendelson * @since 5.3 * @version $Revision$ */ public class StackTraceTools { // ~ Methods -------------------------------------------------------------- /** Finds topmost position of the test method in the stack, or top of stack if <code>method</code> is not in it. */ public static int getTestRoot(StackTraceElement[] stack,ITestNGMethod method) { if(stack!=null) { String cname = method.getTestClass().getName(); for(int x=stack.length-1; x>=0; x--) { if(cname.equals(stack[x].getClassName()) && method.getMethodName().equals(stack[x].getMethodName())) { return x; } } return stack.length-1; } else { return -1; } } /** Finds topmost position of the test method in the stack, or top of stack if <code>method</code> is not in it. */ public static StackTraceElement[] getTestNGInstrastructure(StackTraceElement[] stack,ITestNGMethod method) { int slot=StackTraceTools.getTestRoot(stack, method); if(slot>=0) { StackTraceElement[] r=new StackTraceElement[stack.length-slot]; for(int x=0; x<r.length; x++) { r[x]=stack[x+slot]; } return r; } else { return new StackTraceElement[0]; } } }
apache-2.0
dukechain/Qassandra
interface/thrift/gen-java/org/apache/cassandra/thrift/CqlRow.java
16258
/** * Autogenerated by Thrift Compiler (0.9.0) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING * @generated */ package org.apache.cassandra.thrift; import org.apache.thrift.scheme.IScheme; import org.apache.thrift.scheme.SchemeFactory; import org.apache.thrift.scheme.StandardScheme; import org.apache.thrift.scheme.TupleScheme; import org.apache.thrift.protocol.TTupleProtocol; import org.apache.thrift.protocol.TProtocolException; import org.apache.thrift.EncodingUtils; import org.apache.thrift.TException; import java.util.List; import java.util.ArrayList; import java.util.Map; import java.util.HashMap; import java.util.EnumMap; import java.util.Set; import java.util.HashSet; import java.util.EnumSet; import java.util.Collections; import java.util.BitSet; import java.nio.ByteBuffer; import java.util.Arrays; import org.slf4j.Logger; import org.slf4j.LoggerFactory; /** * Row returned from a CQL query */ public class CqlRow implements org.apache.thrift.TBase<CqlRow, CqlRow._Fields>, java.io.Serializable, Cloneable { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("CqlRow"); private static final org.apache.thrift.protocol.TField KEY_FIELD_DESC = new org.apache.thrift.protocol.TField("key", org.apache.thrift.protocol.TType.STRING, (short)1); private static final org.apache.thrift.protocol.TField COLUMNS_FIELD_DESC = new org.apache.thrift.protocol.TField("columns", org.apache.thrift.protocol.TType.LIST, (short)2); private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>(); static { schemes.put(StandardScheme.class, new CqlRowStandardSchemeFactory()); schemes.put(TupleScheme.class, new CqlRowTupleSchemeFactory()); } public ByteBuffer key; // required public List<Column> columns; // required /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ public enum _Fields implements org.apache.thrift.TFieldIdEnum { KEY((short)1, "key"), COLUMNS((short)2, "columns"); private static final Map<String, _Fields> byName = new HashMap<String, _Fields>(); static { for (_Fields field : EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } /** * Find the _Fields constant that matches fieldId, or null if its not found. */ public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 1: // KEY return KEY; case 2: // COLUMNS return COLUMNS; default: return null; } } /** * Find the _Fields constant that matches fieldId, throwing an exception * if it is not found. */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); return fields; } /** * Find the _Fields constant that matches name, or null if its not found. */ public static _Fields findByName(String name) { return byName.get(name); } private final short _thriftId; private final String _fieldName; _Fields(short thriftId, String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } public short getThriftFieldId() { return _thriftId; } public String getFieldName() { return _fieldName; } } // isset id assignments public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); tmpMap.put(_Fields.KEY, new org.apache.thrift.meta_data.FieldMetaData("key", org.apache.thrift.TFieldRequirementType.REQUIRED, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , true))); tmpMap.put(_Fields.COLUMNS, new org.apache.thrift.meta_data.FieldMetaData("columns", org.apache.thrift.TFieldRequirementType.REQUIRED, new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, Column.class)))); metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(CqlRow.class, metaDataMap); } public CqlRow() { } public CqlRow( ByteBuffer key, List<Column> columns) { this(); this.key = key; this.columns = columns; } /** * Performs a deep copy on <i>other</i>. */ public CqlRow(CqlRow other) { if (other.isSetKey()) { this.key = org.apache.thrift.TBaseHelper.copyBinary(other.key); ; } if (other.isSetColumns()) { List<Column> __this__columns = new ArrayList<Column>(); for (Column other_element : other.columns) { __this__columns.add(new Column(other_element)); } this.columns = __this__columns; } } public CqlRow deepCopy() { return new CqlRow(this); } @Override public void clear() { this.key = null; this.columns = null; } public byte[] getKey() { setKey(org.apache.thrift.TBaseHelper.rightSize(key)); return key == null ? null : key.array(); } public ByteBuffer bufferForKey() { return key; } public CqlRow setKey(byte[] key) { setKey(key == null ? (ByteBuffer)null : ByteBuffer.wrap(key)); return this; } public CqlRow setKey(ByteBuffer key) { this.key = key; return this; } public void unsetKey() { this.key = null; } /** Returns true if field key is set (has been assigned a value) and false otherwise */ public boolean isSetKey() { return this.key != null; } public void setKeyIsSet(boolean value) { if (!value) { this.key = null; } } public int getColumnsSize() { return (this.columns == null) ? 0 : this.columns.size(); } public java.util.Iterator<Column> getColumnsIterator() { return (this.columns == null) ? null : this.columns.iterator(); } public void addToColumns(Column elem) { if (this.columns == null) { this.columns = new ArrayList<Column>(); } this.columns.add(elem); } public List<Column> getColumns() { return this.columns; } public CqlRow setColumns(List<Column> columns) { this.columns = columns; return this; } public void unsetColumns() { this.columns = null; } /** Returns true if field columns is set (has been assigned a value) and false otherwise */ public boolean isSetColumns() { return this.columns != null; } public void setColumnsIsSet(boolean value) { if (!value) { this.columns = null; } } public void setFieldValue(_Fields field, Object value) { switch (field) { case KEY: if (value == null) { unsetKey(); } else { setKey((ByteBuffer)value); } break; case COLUMNS: if (value == null) { unsetColumns(); } else { setColumns((List<Column>)value); } break; } } public Object getFieldValue(_Fields field) { switch (field) { case KEY: return getKey(); case COLUMNS: return getColumns(); } throw new IllegalStateException(); } /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ public boolean isSet(_Fields field) { if (field == null) { throw new IllegalArgumentException(); } switch (field) { case KEY: return isSetKey(); case COLUMNS: return isSetColumns(); } throw new IllegalStateException(); } @Override public boolean equals(Object that) { if (that == null) return false; if (that instanceof CqlRow) return this.equals((CqlRow)that); return false; } public boolean equals(CqlRow that) { if (that == null) return false; boolean this_present_key = true && this.isSetKey(); boolean that_present_key = true && that.isSetKey(); if (this_present_key || that_present_key) { if (!(this_present_key && that_present_key)) return false; if (!this.key.equals(that.key)) return false; } boolean this_present_columns = true && this.isSetColumns(); boolean that_present_columns = true && that.isSetColumns(); if (this_present_columns || that_present_columns) { if (!(this_present_columns && that_present_columns)) return false; if (!this.columns.equals(that.columns)) return false; } return true; } @Override public int hashCode() { return 0; } public int compareTo(CqlRow other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } int lastComparison = 0; CqlRow typedOther = (CqlRow)other; lastComparison = Boolean.valueOf(isSetKey()).compareTo(typedOther.isSetKey()); if (lastComparison != 0) { return lastComparison; } if (isSetKey()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.key, typedOther.key); if (lastComparison != 0) { return lastComparison; } } lastComparison = Boolean.valueOf(isSetColumns()).compareTo(typedOther.isSetColumns()); if (lastComparison != 0) { return lastComparison; } if (isSetColumns()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.columns, typedOther.columns); if (lastComparison != 0) { return lastComparison; } } return 0; } public _Fields fieldForId(int fieldId) { return _Fields.findByThriftId(fieldId); } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override public String toString() { StringBuilder sb = new StringBuilder("CqlRow("); boolean first = true; sb.append("key:"); if (this.key == null) { sb.append("null"); } else { org.apache.thrift.TBaseHelper.toString(this.key, sb); } first = false; if (!first) sb.append(", "); sb.append("columns:"); if (this.columns == null) { sb.append("null"); } else { sb.append(this.columns); } first = false; sb.append(")"); return sb.toString(); } public void validate() throws org.apache.thrift.TException { // check for required fields if (key == null) { throw new org.apache.thrift.protocol.TProtocolException("Required field 'key' was not present! Struct: " + toString()); } if (columns == null) { throw new org.apache.thrift.protocol.TProtocolException("Required field 'columns' was not present! Struct: " + toString()); } // check for sub-struct validity } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { try { write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { try { read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } private static class CqlRowStandardSchemeFactory implements SchemeFactory { public CqlRowStandardScheme getScheme() { return new CqlRowStandardScheme(); } } private static class CqlRowStandardScheme extends StandardScheme<CqlRow> { public void read(org.apache.thrift.protocol.TProtocol iprot, CqlRow struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; iprot.readStructBegin(); while (true) { schemeField = iprot.readFieldBegin(); if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { break; } switch (schemeField.id) { case 1: // KEY if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { struct.key = iprot.readBinary(); struct.setKeyIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 2: // COLUMNS if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { { org.apache.thrift.protocol.TList _list138 = iprot.readListBegin(); struct.columns = new ArrayList<Column>(_list138.size); for (int _i139 = 0; _i139 < _list138.size; ++_i139) { Column _elem140; // required _elem140 = new Column(); _elem140.read(iprot); struct.columns.add(_elem140); } iprot.readListEnd(); } struct.setColumnsIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; default: org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } iprot.readFieldEnd(); } iprot.readStructEnd(); // check for required fields of primitive type, which can't be checked in the validate method struct.validate(); } public void write(org.apache.thrift.protocol.TProtocol oprot, CqlRow struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); if (struct.key != null) { oprot.writeFieldBegin(KEY_FIELD_DESC); oprot.writeBinary(struct.key); oprot.writeFieldEnd(); } if (struct.columns != null) { oprot.writeFieldBegin(COLUMNS_FIELD_DESC); { oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, struct.columns.size())); for (Column _iter141 : struct.columns) { _iter141.write(oprot); } oprot.writeListEnd(); } oprot.writeFieldEnd(); } oprot.writeFieldStop(); oprot.writeStructEnd(); } } private static class CqlRowTupleSchemeFactory implements SchemeFactory { public CqlRowTupleScheme getScheme() { return new CqlRowTupleScheme(); } } private static class CqlRowTupleScheme extends TupleScheme<CqlRow> { @Override public void write(org.apache.thrift.protocol.TProtocol prot, CqlRow struct) throws org.apache.thrift.TException { TTupleProtocol oprot = (TTupleProtocol) prot; oprot.writeBinary(struct.key); { oprot.writeI32(struct.columns.size()); for (Column _iter142 : struct.columns) { _iter142.write(oprot); } } } @Override public void read(org.apache.thrift.protocol.TProtocol prot, CqlRow struct) throws org.apache.thrift.TException { TTupleProtocol iprot = (TTupleProtocol) prot; struct.key = iprot.readBinary(); struct.setKeyIsSet(true); { org.apache.thrift.protocol.TList _list143 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32()); struct.columns = new ArrayList<Column>(_list143.size); for (int _i144 = 0; _i144 < _list143.size; ++_i144) { Column _elem145; // required _elem145 = new Column(); _elem145.read(iprot); struct.columns.add(_elem145); } } struct.setColumnsIsSet(true); } } }
apache-2.0
Ensembl/ensembl-compara
conf/citest/production_init_reg_conf.pl
2152
#!/usr/bin/env perl # See the NOTICE file distributed with this work for additional information # regarding copyright ownership. # # 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 strict; use warnings; use Bio::EnsEMBL::Registry; use Bio::EnsEMBL::Compara::Utils::Registry; my $curr_release = $ENV{'CURR_ENSEMBL_RELEASE'}; my $prev_release = $curr_release - 1; my $curr_eg_release = $ENV{'CURR_EG_RELEASE'}; my $prev_eg_release = $curr_eg_release - 1; # Species found on both vertebrates and non-vertebrates servers my @overlap_species = qw(saccharomyces_cerevisiae drosophila_melanogaster caenorhabditis_elegans); # --------------------------- CORE DATABASES ----------------------------------- # Use our mirror (which has all the databases) #Bio::EnsEMBL::Registry->load_registry_from_url("mysql://ensro\@mysql-ens-vertannot-staging:4573/$curr_release"); # For previous releases, use the mirror servers Bio::EnsEMBL::Registry->load_registry_from_url("mysql://ensro\@mysql-ens-mirror-1:4240/$curr_release"); # But remove the non-vertebrates species Bio::EnsEMBL::Compara::Utils::Registry::remove_species(\@overlap_species); Bio::EnsEMBL::Compara::Utils::Registry::remove_multi(); # And add the non-vertebrates server Bio::EnsEMBL::Registry->load_registry_from_url("mysql://ensro\@mysql-ens-mirror-3:4275/$curr_release"); # ----------------------- COMPARA MASTER DATABASE ------------------------------ Bio::EnsEMBL::Compara::Utils::Registry::add_compara_dbas({ 'compara_master' => [ 'mysql-ens-compara-prod-10', 'ensembl_compara_master_citest' ], }); # ------------------------------------------------------------------------------ 1;
apache-2.0
mklab/taskit
src/main/java/org/mklab/taskit/shared/UserRequest.java
1428
/* * 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.mklab.taskit.shared; import org.mklab.taskit.server.domain.User; import java.util.List; import com.google.web.bindery.requestfactory.shared.InstanceRequest; import com.google.web.bindery.requestfactory.shared.Request; import com.google.web.bindery.requestfactory.shared.RequestContext; import com.google.web.bindery.requestfactory.shared.Service; /** * @see User * @author ishikura */ @Service(User.class) @SuppressWarnings("javadoc") public interface UserRequest extends RequestContext { Request<Void> changeMyUserName(String userName); Request<Void> changeUserName(String accountId, String userName); Request<List<UserProxy>> getAllUsers(); Request<UserProxy> getUserByAccountId(String accountId); Request<UserProxy> getLoginUser(); Request<List<UserProxy>> getAllStudents(); InstanceRequest<UserProxy, Void> update(); }
apache-2.0
lioutasb/CSCartApp
app/src/main/java/gr/plushost/prototypeapp/fragments/NavigationDrawerFragment.java
18920
package gr.plushost.prototypeapp.fragments; import android.app.Activity; import android.content.Intent; import android.os.AsyncTask; import android.support.v4.app.Fragment; import android.graphics.Typeface; import android.os.Bundle; import android.support.v4.widget.DrawerLayout; import android.support.v7.app.ActionBarDrawerToggle; import android.text.InputFilter; import android.text.Spanned; import android.view.Gravity; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.Button; import android.widget.RelativeLayout; import android.widget.TextView; import android.widget.Toast; import com.beardedhen.androidbootstrap.BootstrapButton; import com.beardedhen.androidbootstrap.BootstrapEditText; import com.github.johnpersano.supertoasts.SuperToast; import com.github.johnpersano.supertoasts.util.Style; import org.apache.http.cookie.Cookie; import org.json.JSONException; import org.json.JSONObject; import java.net.URLEncoder; import java.util.List; import gr.plushost.prototypeapp.R; import gr.plushost.prototypeapp.activities.CategoriesActivity; import gr.plushost.prototypeapp.activities.CustomerOrdersActivity; import gr.plushost.prototypeapp.activities.ForgotPasswordActivity; import gr.plushost.prototypeapp.activities.LoginActivity; import gr.plushost.prototypeapp.activities.MainActivity; import gr.plushost.prototypeapp.activities.ProductActivity; import gr.plushost.prototypeapp.activities.ProductsActivity; import gr.plushost.prototypeapp.activities.ProfileActivity; import gr.plushost.prototypeapp.activities.SettingsActivity; import gr.plushost.prototypeapp.activities.ShoppingCartActivity; import gr.plushost.prototypeapp.aplications.StoreApplication; import gr.plushost.prototypeapp.network.NoNetworkHandler; import gr.plushost.prototypeapp.network.PersistentCookieStore; import gr.plushost.prototypeapp.network.ServiceHandler; /** * Created by billiout on 17/2/2015. */ public class NavigationDrawerFragment extends Fragment { Activity act; RelativeLayout accountLogout; RelativeLayout accountLoggedin; DrawerLayout drawerLayout; View view; BootstrapButton btnCart; NoNetworkHandler noNetworkHandler; @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { view = inflater.inflate(R.layout.fragment_nav_drawer, container, false); act = getActivity(); noNetworkHandler = new NoNetworkHandler(act); final BootstrapEditText email = (BootstrapEditText) view.findViewById(R.id.editTextEmail); InputFilter filter = new InputFilter() { public CharSequence filter(CharSequence source, int start, int end, Spanned dest, int dstart, int dend) { for (int i = start; i < end; i++) { if (Character.isSpaceChar(source.charAt(i))) { return ""; } } return null; } }; email.setFilters(new InputFilter[]{filter}); TextView tmpText = (TextView) view.findViewById(R.id.txtNewsTitle); Typeface type = Typeface.createFromAsset(act.getAssets(), "fonts/mistral.ttf"); tmpText.setTypeface(type, Typeface.BOLD); tmpText = (TextView) view.findViewById(R.id.txtAccountTitle); type = Typeface.createFromAsset(act.getAssets(), "fonts/mistral.ttf"); tmpText.setTypeface(type, Typeface.BOLD); tmpText = (TextView) view.findViewById(R.id.txtCartTitle); type = Typeface.createFromAsset(act.getAssets(), "fonts/mistral.ttf"); tmpText.setTypeface(type, Typeface.BOLD); tmpText = (TextView) view.findViewById(R.id.txtAccountTitle2); type = Typeface.createFromAsset(act.getAssets(), "fonts/mistral.ttf"); tmpText.setTypeface(type, Typeface.BOLD); accountLogout = (RelativeLayout) view.findViewById(R.id.accountLay); accountLoggedin = (RelativeLayout) view.findViewById(R.id.accountLayLogged); btnCart = (BootstrapButton) view.findViewById(R.id.swipeCart); btnCart.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { drawerLayout.closeDrawers(); if(getActivity().getSharedPreferences("ShopPrefs", 0).getBoolean("is_connected", false)){ Intent i = new Intent(act, ShoppingCartActivity.class); i.addFlags(Intent.FLAG_ACTIVITY_REORDER_TO_FRONT); startActivity(i); getActivity().overridePendingTransition(R.anim.slide_in_right, R.anim.slide_out_left); } else{ openLogin(view); } } }); BootstrapButton btnLogin = (BootstrapButton) view.findViewById(R.id.sundesiBtn); btnLogin.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { openLogin(v); } }); BootstrapButton btnRegister = (BootstrapButton) view.findViewById(R.id.newAccountBtn); btnRegister.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { openRegister(v); } }); if(act.getSharedPreferences("ShopPrefs", 0).getBoolean("is_connected", false)){ accountLoggedin.setVisibility(View.VISIBLE); accountLogout.setVisibility(View.GONE); if(!act.getSharedPreferences("ShopPrefs", 0).getString("user_name", "").trim().equals("")) { ((TextView) view.findViewById(R.id.userName)).setVisibility(View.VISIBLE); ((TextView) view.findViewById(R.id.email)).setVisibility(View.VISIBLE); ((TextView) view.findViewById(R.id.userName)).setText(act.getSharedPreferences("ShopPrefs", 0).getString("user_name", "")); ((TextView) view.findViewById(R.id.email)).setText(act.getSharedPreferences("ShopPrefs", 0).getString("user_email", "")); } else { ((TextView) view.findViewById(R.id.userName)).setVisibility(View.VISIBLE); ((TextView) view.findViewById(R.id.email)).setVisibility(View.GONE); ((TextView) view.findViewById(R.id.userName)).setText(act.getSharedPreferences("ShopPrefs", 0).getString("user_email", "")); } } else { accountLoggedin.setVisibility(View.GONE); accountLogout.setVisibility(View.VISIBLE); } if(StoreApplication.getCartCount() > 0){ if(StoreApplication.getCartCount() == 1) btnCart.setText(String.format(getResources().getString(R.string.btn_cart_text_product),StoreApplication.getCartCount())); else btnCart.setText(String.format(getResources().getString(R.string.btn_cart_text_products),StoreApplication.getCartCount())); } else { btnCart.setText(act.getResources().getString(R.string.btn_cart_text_empty)); } BootstrapButton btnLogout = (BootstrapButton) view.findViewById(R.id.userLogout); btnLogout.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { if(act.getSharedPreferences("ShopPrefs", 0).getBoolean("is_connected", false)) { drawerLayout.closeDrawers(); if(noNetworkHandler.showDialog()) new LogoutSession().execute(); } else { SuperToast.create(act, getResources().getString(R.string.btn_logout_fail), SuperToast.Duration.SHORT, Style.getStyle(Style.RED, SuperToast.Animations.POPUP)).show(); } } }); BootstrapButton btnProfile = (BootstrapButton) view.findViewById(R.id.userProfile); btnProfile.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { drawerLayout.closeDrawers(); Intent i = new Intent(act, ProfileActivity.class); startActivity(i); act.overridePendingTransition(R.anim.slide_in_right, R.anim.slide_out_left); } }); BootstrapButton btnOrders = (BootstrapButton) view.findViewById(R.id.userOrders); btnOrders.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { drawerLayout.closeDrawers(); Intent i = new Intent(act, CustomerOrdersActivity.class); startActivity(i); act.overridePendingTransition(R.anim.slide_in_right, R.anim.slide_out_left); } }); update(); view.findViewById(R.id.newPassBtn).setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { drawerLayout.closeDrawers(); Intent intent = new Intent(act, ForgotPasswordActivity.class); act.startActivity(intent); act.overridePendingTransition(R.anim.slide_in_right, R.anim.slide_out_left); } }); view.findViewById(R.id.btnNewsletterSignUp).setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { BootstrapEditText editTextEmail = (BootstrapEditText) view.findViewById(R.id.editTextEmail); if(!editTextEmail.getText().toString().trim().equals("") || isValidEmail(editTextEmail.getText().toString().trim())){ if(noNetworkHandler.showDialog()) new NewsletterSignUp().execute(editTextEmail.getText().toString().trim()); } else { SuperToast.create(act, getResources().getString(R.string.newsletter_missing_email_msg), SuperToast.Duration.SHORT, Style.getStyle(Style.RED, SuperToast.Animations.POPUP)).show(); } } }); view.findViewById(R.id.homeBtn).setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { if(!(getActivity() instanceof MainActivity)) { Intent i = new Intent(getActivity(), MainActivity.class); i.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP); startActivity(i); getActivity().overridePendingTransition(R.anim.slide_in_left, R.anim.slide_out_right); } else{ drawerLayout.closeDrawers(); } } }); return view; } public void setDrawerLayout(DrawerLayout drawerLayout){ this.drawerLayout = drawerLayout; } public void update(){ if(noNetworkHandler.showDialog()) new GetCartCount().execute(); if(getActivity().getSharedPreferences("ShopPrefs", 0).getBoolean("is_connected", false)){ accountLoggedin.setVisibility(View.VISIBLE); accountLogout.setVisibility(View.GONE); if(!act.getSharedPreferences("ShopPrefs", 0).getString("user_name", "").trim().equals("")) { ((TextView) view.findViewById(R.id.userName)).setVisibility(View.VISIBLE); ((TextView) view.findViewById(R.id.email)).setVisibility(View.VISIBLE); ((TextView) view.findViewById(R.id.userName)).setText(act.getSharedPreferences("ShopPrefs", 0).getString("user_name", "")); ((TextView) view.findViewById(R.id.email)).setText(act.getSharedPreferences("ShopPrefs", 0).getString("user_email", "")); } else { ((TextView) view.findViewById(R.id.userName)).setVisibility(View.VISIBLE); ((TextView) view.findViewById(R.id.email)).setVisibility(View.GONE); ((TextView) view.findViewById(R.id.userName)).setText(act.getSharedPreferences("ShopPrefs", 0).getString("user_email", "")); } } else { accountLoggedin.setVisibility(View.GONE); accountLogout.setVisibility(View.VISIBLE); } } public void openLogin(View view){ drawerLayout.closeDrawers(); Intent i = new Intent(act, LoginActivity.class); i.putExtra("page", 0); startActivity(i); } public void openRegister(View view){ drawerLayout.closeDrawers(); Intent i = new Intent(act, LoginActivity.class); i.putExtra("page", 1); startActivity(i); } public boolean isValidEmail(CharSequence target) { return target != null && android.util.Patterns.EMAIL_ADDRESS.matcher(target).matches(); } class NewsletterSignUp extends AsyncTask<String, Void, Boolean>{ @Override protected Boolean doInBackground(String... params) { try { String response = StoreApplication.getServiceHandler(act).makeServiceCall(act, true, String.format(act.getResources().getString(R.string.url_newsletter_signup), act.getSharedPreferences("ShopPrefs", 0).getString("store_language", ""), act.getSharedPreferences("ShopPrefs", 0).getString("store_currency", ""), URLEncoder.encode(params[0], "UTF-8")), ServiceHandler.GET); JSONObject jsonObject = new JSONObject(response); return jsonObject.getString("code").equals("0x0000"); } catch (Exception e){ e.printStackTrace(); } return false; } @Override protected void onPostExecute(Boolean result){ drawerLayout.closeDrawers(); if(result){ SuperToast.create(act, getResources().getString(R.string.newsletter_success_msg), SuperToast.Duration.SHORT, Style.getStyle(Style.RED, SuperToast.Animations.POPUP)).show(); } else { SuperToast.create(act, getResources().getString(R.string.btn_logout_fail), SuperToast.Duration.SHORT, Style.getStyle(Style.RED, SuperToast.Animations.POPUP)).show(); } } } class GetCartCount extends AsyncTask<Void, Void, Integer>{ @Override protected void onPreExecute(){ if(isAdded() && getActivity() != null) { int result = StoreApplication.getCartCount(); if (result > 0) { if (result == 1) btnCart.setText(String.format(getResources().getString(R.string.btn_cart_text_product), StoreApplication.getCartCount())); else btnCart.setText(String.format(getResources().getString(R.string.btn_cart_text_products), StoreApplication.getCartCount())); } else { btnCart.setText(act.getResources().getString(R.string.btn_cart_text_empty)); } } } @Override protected Integer doInBackground(Void... voids) { if(isAdded() && getActivity() != null) { String response = StoreApplication.getServiceHandler(act).makeServiceCall(act, true, String.format(act.getResources().getString(R.string.url_cart_count), act.getSharedPreferences("ShopPrefs", 0).getString("store_language", ""), act.getSharedPreferences("ShopPrefs", 0).getString("store_currency", "")), ServiceHandler.GET); try { JSONObject jsonObject = new JSONObject(response); if (jsonObject.getString("code").equals("0x0000")) { return jsonObject.getJSONObject("info").getInt("cart_items_count"); } return 0; } catch (Exception e) { e.printStackTrace(); } } return 0; } @Override protected void onPostExecute(Integer result){ if(isAdded() && getActivity() != null) { StoreApplication.setCartCount(result); if (result > 0) { if (result == 1) btnCart.setText(String.format(getResources().getString(R.string.btn_cart_text_product), StoreApplication.getCartCount())); else btnCart.setText(String.format(getResources().getString(R.string.btn_cart_text_products), StoreApplication.getCartCount())); } else { btnCart.setText(act.getResources().getString(R.string.btn_cart_text_empty)); } } } } class LogoutSession extends AsyncTask<Void, Void, Boolean>{ @Override protected Boolean doInBackground(Void... params) { ServiceHandler sh = StoreApplication.getServiceHandler(act); String response = sh.makeServiceCall(act, true, String.format(getResources().getString(R.string.url_logout_user), act.getSharedPreferences("ShopPrefs", 0).getString("store_language", ""), act.getSharedPreferences("ShopPrefs", 0).getString("store_currency", "")), ServiceHandler.GET); try { JSONObject jsonObject = new JSONObject(response); if(jsonObject.getString("code").equals("0x0000")){ return true; } } catch (JSONException e) { e.printStackTrace(); } return false; } @Override protected void onPostExecute(Boolean result){ if(result){ act.getSharedPreferences("ShopPrefs", 0).edit().putBoolean("is_connected", false).apply(); SuperToast.create(act, getResources().getString(R.string.btn_logout_success), SuperToast.Duration.SHORT, Style.getStyle(Style.RED, SuperToast.Animations.POPUP)).show(); if(noNetworkHandler.showDialog()) { if (act instanceof MainActivity) { ((MainActivity) act).new GetCartCount().execute(); } else if (act instanceof CategoriesActivity) { ((CategoriesActivity) act).new GetCartCount().execute(); } else if (act instanceof ProductsActivity) { ((ProductsActivity) act).new GetCartCount().execute(); } else if (act instanceof ProductActivity) { ((ProductActivity) act).new GetCartCount().execute(); } } } else { SuperToast.create(act, getResources().getString(R.string.btn_logout_fail), SuperToast.Duration.SHORT, Style.getStyle(Style.RED, SuperToast.Animations.POPUP)).show(); } } } }
apache-2.0
dmilos/color
src/color/cmyk/akin/xyz.hpp
1053
#ifndef color_cmyk_akin_xyz #define color_cmyk_akin_xyz #include "../../generic/akin/cmyk.hpp" #include "../category.hpp" #include "../../xyz/category.hpp" namespace color { namespace akin { template< >struct cmyk< ::color::category::xyz_uint8 >{ typedef ::color::category::cmyk_uint8 akin_type; }; template< >struct cmyk< ::color::category::xyz_uint16 >{ typedef ::color::category::cmyk_uint16 akin_type; }; template< >struct cmyk< ::color::category::xyz_uint32 >{ typedef ::color::category::cmyk_uint32 akin_type; }; template< >struct cmyk< ::color::category::xyz_uint64 >{ typedef ::color::category::cmyk_uint64 akin_type; }; template< >struct cmyk< ::color::category::xyz_float >{ typedef ::color::category::cmyk_float akin_type; }; template< >struct cmyk< ::color::category::xyz_double >{ typedef ::color::category::cmyk_double akin_type; }; template< >struct cmyk< ::color::category::xyz_ldouble >{ typedef ::color::category::cmyk_ldouble akin_type; }; } } #endif
apache-2.0
lakshmiDRIP/DRIP
Javadoc/org/drip/sample/fundingfeed/AUDSmoothReconstitutor.html
9709
<!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 (1.8.0_111) on Wed Jan 04 22:31:18 EST 2017 --> <title>AUDSmoothReconstitutor</title> <meta name="date" content="2017-01-04"> <link rel="stylesheet" type="text/css" href="../../../../stylesheet.css" title="Style"> <script type="text/javascript" src="../../../../script.js"></script> </head> <body> <script type="text/javascript"><!-- try { if (location.href.indexOf('is-external=true') == -1) { parent.document.title="AUDSmoothReconstitutor"; } } catch(err) { } //--> var methods = {"i0":9}; var tabs = {65535:["t0","All Methods"],1:["t1","Static Methods"],8:["t4","Concrete Methods"]}; var altColor = "altColor"; var rowColor = "rowColor"; var tableTab = "tableTab"; var activeTableTab = "activeTableTab"; </script> <noscript> <div>JavaScript is disabled on your browser.</div> </noscript> <!-- ========= START OF TOP NAVBAR ======= --> <div class="topNav"><a name="navbar.top"> <!-- --> </a> <div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div> <a name="navbar.top.firstrow"> <!-- --> </a> <ul class="navList" title="Navigation"> <li><a href="../../../../overview-summary.html">Overview</a></li> <li><a href="package-summary.html">Package</a></li> <li class="navBarCell1Rev">Class</li> <li><a href="class-use/AUDSmoothReconstitutor.html">Use</a></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><a href="../../../../org/drip/sample/fundingfeed/AUDShapePreservingReconstitutor.html" title="class in org.drip.sample.fundingfeed"><span class="typeNameLink">Prev&nbsp;Class</span></a></li> <li><a href="../../../../org/drip/sample/fundingfeed/CADShapePreservingReconstitutor.html" title="class in org.drip.sample.fundingfeed"><span class="typeNameLink">Next&nbsp;Class</span></a></li> </ul> <ul class="navList"> <li><a href="../../../../index.html?org/drip/sample/fundingfeed/AUDSmoothReconstitutor.html" target="_top">Frames</a></li> <li><a href="AUDSmoothReconstitutor.html" target="_top">No&nbsp;Frames</a></li> </ul> <ul class="navList" id="allclasses_navbar_top"> <li><a href="../../../../allclasses-noframe.html">All&nbsp;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> <div> <ul class="subNavList"> <li>Summary:&nbsp;</li> <li>Nested&nbsp;|&nbsp;</li> <li>Field&nbsp;|&nbsp;</li> <li><a href="#constructor.summary">Constr</a>&nbsp;|&nbsp;</li> <li><a href="#method.summary">Method</a></li> </ul> <ul class="subNavList"> <li>Detail:&nbsp;</li> <li>Field&nbsp;|&nbsp;</li> <li><a href="#constructor.detail">Constr</a>&nbsp;|&nbsp;</li> <li><a href="#method.detail">Method</a></li> </ul> </div> <a name="skip.navbar.top"> <!-- --> </a></div> <!-- ========= END OF TOP NAVBAR ========= --> <!-- ======== START OF CLASS DATA ======== --> <div class="header"> <div class="subTitle">org.drip.sample.fundingfeed</div> <h2 title="Class AUDSmoothReconstitutor" class="title">Class AUDSmoothReconstitutor</h2> </div> <div class="contentContainer"> <ul class="inheritance"> <li>java.lang.Object</li> <li> <ul class="inheritance"> <li>org.drip.sample.fundingfeed.AUDSmoothReconstitutor</li> </ul> </li> </ul> <div class="description"> <ul class="blockList"> <li class="blockList"> <hr> <br> <pre>public class <span class="typeNameLabel">AUDSmoothReconstitutor</span> extends java.lang.Object</pre> <div class="block">AUDSmoothReconstitutor Demonstrates the Cleansing and the Smooth Re-constitution of the AUD Input Marks.</div> <dl> <dt><span class="simpleTagLabel">Author:</span></dt> <dd>Lakshmi Krishnamurthy</dd> </dl> </li> </ul> </div> <div class="summary"> <ul class="blockList"> <li class="blockList"> <!-- ======== CONSTRUCTOR SUMMARY ======== --> <ul class="blockList"> <li class="blockList"><a name="constructor.summary"> <!-- --> </a> <h3>Constructor Summary</h3> <table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Constructor Summary table, listing constructors, and an explanation"> <caption><span>Constructors</span><span class="tabEnd">&nbsp;</span></caption> <tr> <th class="colOne" scope="col">Constructor and Description</th> </tr> <tr class="altColor"> <td class="colOne"><code><span class="memberNameLink"><a href="../../../../org/drip/sample/fundingfeed/AUDSmoothReconstitutor.html#AUDSmoothReconstitutor--">AUDSmoothReconstitutor</a></span>()</code>&nbsp;</td> </tr> </table> </li> </ul> <!-- ========== METHOD SUMMARY =========== --> <ul class="blockList"> <li class="blockList"><a name="method.summary"> <!-- --> </a> <h3>Method Summary</h3> <table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Method Summary table, listing methods, and an explanation"> <caption><span id="t0" class="activeTableTab"><span>All Methods</span><span class="tabEnd">&nbsp;</span></span><span id="t1" class="tableTab"><span><a href="javascript:show(1);">Static Methods</a></span><span class="tabEnd">&nbsp;</span></span><span id="t4" class="tableTab"><span><a href="javascript:show(8);">Concrete Methods</a></span><span class="tabEnd">&nbsp;</span></span></caption> <tr> <th class="colFirst" scope="col">Modifier and Type</th> <th class="colLast" scope="col">Method and Description</th> </tr> <tr id="i0" class="altColor"> <td class="colFirst"><code>static void</code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/drip/sample/fundingfeed/AUDSmoothReconstitutor.html#main-java.lang.String:A-">main</a></span>(java.lang.String[]&nbsp;args)</code>&nbsp;</td> </tr> </table> <ul class="blockList"> <li class="blockList"><a name="methods.inherited.from.class.java.lang.Object"> <!-- --> </a> <h3>Methods inherited from class&nbsp;java.lang.Object</h3> <code>equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait</code></li> </ul> </li> </ul> </li> </ul> </div> <div class="details"> <ul class="blockList"> <li class="blockList"> <!-- ========= CONSTRUCTOR DETAIL ======== --> <ul class="blockList"> <li class="blockList"><a name="constructor.detail"> <!-- --> </a> <h3>Constructor Detail</h3> <a name="AUDSmoothReconstitutor--"> <!-- --> </a> <ul class="blockListLast"> <li class="blockList"> <h4>AUDSmoothReconstitutor</h4> <pre>public&nbsp;AUDSmoothReconstitutor()</pre> </li> </ul> </li> </ul> <!-- ============ METHOD DETAIL ========== --> <ul class="blockList"> <li class="blockList"><a name="method.detail"> <!-- --> </a> <h3>Method Detail</h3> <a name="main-java.lang.String:A-"> <!-- --> </a> <ul class="blockListLast"> <li class="blockList"> <h4>main</h4> <pre>public static final&nbsp;void&nbsp;main(java.lang.String[]&nbsp;args)</pre> </li> </ul> </li> </ul> </li> </ul> </div> </div> <!-- ========= END OF CLASS DATA ========= --> <!-- ======= START OF BOTTOM NAVBAR ====== --> <div class="bottomNav"><a name="navbar.bottom"> <!-- --> </a> <div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div> <a name="navbar.bottom.firstrow"> <!-- --> </a> <ul class="navList" title="Navigation"> <li><a href="../../../../overview-summary.html">Overview</a></li> <li><a href="package-summary.html">Package</a></li> <li class="navBarCell1Rev">Class</li> <li><a href="class-use/AUDSmoothReconstitutor.html">Use</a></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><a href="../../../../org/drip/sample/fundingfeed/AUDShapePreservingReconstitutor.html" title="class in org.drip.sample.fundingfeed"><span class="typeNameLink">Prev&nbsp;Class</span></a></li> <li><a href="../../../../org/drip/sample/fundingfeed/CADShapePreservingReconstitutor.html" title="class in org.drip.sample.fundingfeed"><span class="typeNameLink">Next&nbsp;Class</span></a></li> </ul> <ul class="navList"> <li><a href="../../../../index.html?org/drip/sample/fundingfeed/AUDSmoothReconstitutor.html" target="_top">Frames</a></li> <li><a href="AUDSmoothReconstitutor.html" target="_top">No&nbsp;Frames</a></li> </ul> <ul class="navList" id="allclasses_navbar_bottom"> <li><a href="../../../../allclasses-noframe.html">All&nbsp;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> <div> <ul class="subNavList"> <li>Summary:&nbsp;</li> <li>Nested&nbsp;|&nbsp;</li> <li>Field&nbsp;|&nbsp;</li> <li><a href="#constructor.summary">Constr</a>&nbsp;|&nbsp;</li> <li><a href="#method.summary">Method</a></li> </ul> <ul class="subNavList"> <li>Detail:&nbsp;</li> <li>Field&nbsp;|&nbsp;</li> <li><a href="#constructor.detail">Constr</a>&nbsp;|&nbsp;</li> <li><a href="#method.detail">Method</a></li> </ul> </div> <a name="skip.navbar.bottom"> <!-- --> </a></div> <!-- ======== END OF BOTTOM NAVBAR ======= --> </body> </html>
apache-2.0
xin053/xin053.github.io
archives/index.html
26107
<!doctype html> <html class="theme-next mist use-motion"> <head> <meta charset="UTF-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> <meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1"> <meta http-equiv="Cache-Control" content="no-transform"> <meta http-equiv="Cache-Control" content="no-siteapp"> <meta name="google-site-verification" content="jFTy9MrTO4piYCnfdfFFpOLb9SCydVuSBPbqgakCzCM"> <link href="/lib/fancybox/source/jquery.fancybox.css?v=2.1.5" rel="stylesheet" type="text/css"> <link href="//fonts.googleapis.com/css?family=Lato:300,300italic,400,400italic,700,700italic&subset=latin,latin-ext" rel="stylesheet" type="text/css"> <link href="/lib/font-awesome/css/font-awesome.min.css?v=4.4.0" rel="stylesheet" type="text/css"> <link href="/css/main.css?v=5.0.1" rel="stylesheet" type="text/css"> <meta name="keywords" content="Hexo, NexT"> <link rel="alternate" href="/atom.xml" title="xin053" type="application/atom+xml"> <link rel="shortcut icon" type="image/x-icon" href="/favicon.ico?v=5.0.1"> <meta name="description" content="正在用Windbg调试正在调试正在反汇编Windbg的IDA的OD..."> <meta property="og:type" content="website"> <meta property="og:title" content="xin053"> <meta property="og:url" content="https://xin053.github.io/archives/index.html"> <meta property="og:site_name" content="xin053"> <meta property="og:description" content="正在用Windbg调试正在调试正在反汇编Windbg的IDA的OD..."> <meta name="twitter:card" content="summary"> <meta name="twitter:title" content="xin053"> <meta name="twitter:description" content="正在用Windbg调试正在调试正在反汇编Windbg的IDA的OD..."> <script type="text/javascript" id="hexo.configuration"> var NexT = window.NexT || {}; var CONFIG = { scheme: 'Mist', sidebar: {"position":"right","display":"post"}, fancybox: true, motion: true, duoshuo: { userId: undefined, author: '博主' } }; </script> <title> 归档 | xin053 </title> </head> <body itemscope itemtype="http://schema.org/WebPage" lang="zh-Hans"> <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-78789863-1', 'auto'); ga('send', 'pageview'); </script> <script type="text/javascript"> var _hmt = _hmt || []; (function() { var hm = document.createElement("script"); hm.src = "//hm.baidu.com/hm.js?95bc477a974f85651897b76f543028bb"; var s = document.getElementsByTagName("script")[0]; s.parentNode.insertBefore(hm, s); })(); </script> <div class="container one-collumn sidebar-position-right page-archive"> <div class="headband"></div> <header id="header" class="header" itemscope itemtype="http://schema.org/WPHeader"> <div class="header-inner"><div class="site-meta"> <div class="custom-logo-site-title"> <a href="/" class="brand" rel="start"> <span class="logo-line-before"><i></i></span> <span class="site-title">xin053</span> <span class="logo-line-after"><i></i></span> </a> </div> <p class="site-subtitle">在安全圈里徘徊,停滞不前</p> </div> <div class="site-nav-toggle"> <button> <span class="btn-bar"></span> <span class="btn-bar"></span> <span class="btn-bar"></span> </button> </div> <nav class="site-nav"> <ul id="menu" class="menu"> <li class="menu-item menu-item-home"> <a href="/" rel="section"> <i class="menu-item-icon fa fa-fw fa-home"></i> <br> 首页 </a> </li> <li class="menu-item menu-item-archives"> <a href="/archives" rel="section"> <i class="menu-item-icon fa fa-fw fa-archive"></i> <br> 归档 </a> </li> <li class="menu-item menu-item-categories"> <a href="/categories" rel="section"> <i class="menu-item-icon fa fa-fw fa-th"></i> <br> 分类 </a> </li> <li class="menu-item menu-item-tags"> <a href="/tags" rel="section"> <i class="menu-item-icon fa fa-fw fa-tags"></i> <br> 标签 </a> </li> <li class="menu-item menu-item-about"> <a href="/about" rel="section"> <i class="menu-item-icon fa fa-fw fa-user"></i> <br> 关于 </a> </li> <li class="menu-item menu-item-search"> <a href="#" class="popup-trigger"> <i class="menu-item-icon fa fa-search fa-fw"></i> <br> 搜索 </a> </li> </ul> <div class="site-search"> <div class="popup"> <span class="search-icon fa fa-search"></span> <input type="text" id="local-search-input"> <div id="local-search-result"></div> <span class="popup-btn-close">close</span> </div> </div> </nav> </div> </header> <main id="main" class="main"> <div class="main-inner"> <div class="content-wrap"> <div id="content" class="content"> <section id="posts" class="posts-collapse"> <span class="archive-move-on"></span> <span class="archive-page-counter"> 好! 目前共计 55 篇日志。 继续努力。 </span> <div class="collection-title"> <h2 class="archive-year motion-element" id="archive-year-2017">2017</h2> </div> <article class="post post-type-normal" itemscope itemtype="http://schema.org/Article"> <header class="post-header"> <h1 class="post-title"> <a class="post-title-link" href="/2017/03/10/shell编程/" itemprop="url"> <span itemprop="name">shell编程</span> </a> </h1> <div class="post-meta"> <time class="post-time" itemprop="dateCreated" datetime="2017-03-10T12:38:10+08:00" content="2017-03-10"> 03-10 </time> </div> </header> </article> <article class="post post-type-normal" itemscope itemtype="http://schema.org/Article"> <header class="post-header"> <h1 class="post-title"> <a class="post-title-link" href="/2017/03/08/linux命令学习/" itemprop="url"> <span itemprop="name">linux命令学习</span> </a> </h1> <div class="post-meta"> <time class="post-time" itemprop="dateCreated" datetime="2017-03-08T13:26:10+08:00" content="2017-03-08"> 03-08 </time> </div> </header> </article> <div class="collection-title"> <h2 class="archive-year motion-element" id="archive-year-2016">2016</h2> </div> <article class="post post-type-normal" itemscope itemtype="http://schema.org/Article"> <header class="post-header"> <h1 class="post-title"> <a class="post-title-link" href="/2016/12/23/Python3.6更新内容/" itemprop="url"> <span itemprop="name">Python3.6更新内容</span> </a> </h1> <div class="post-meta"> <time class="post-time" itemprop="dateCreated" datetime="2016-12-23T19:15:12+08:00" content="2016-12-23"> 12-23 </time> </div> </header> </article> <article class="post post-type-normal" itemscope itemtype="http://schema.org/Article"> <header class="post-header"> <h1 class="post-title"> <a class="post-title-link" href="/2016/12/20/cryptography加密库使用详解/" itemprop="url"> <span itemprop="name">cryptography加密库使用详解</span> </a> </h1> <div class="post-meta"> <time class="post-time" itemprop="dateCreated" datetime="2016-12-20T20:59:43+08:00" content="2016-12-20"> 12-20 </time> </div> </header> </article> <article class="post post-type-normal" itemscope itemtype="http://schema.org/Article"> <header class="post-header"> <h1 class="post-title"> <a class="post-title-link" href="/2016/12/17/yagmail邮件发送库使用详解/" itemprop="url"> <span itemprop="name">yagmail邮件发送库使用详解</span> </a> </h1> <div class="post-meta"> <time class="post-time" itemprop="dateCreated" datetime="2016-12-17T16:26:07+08:00" content="2016-12-17"> 12-17 </time> </div> </header> </article> <article class="post post-type-normal" itemscope itemtype="http://schema.org/Article"> <header class="post-header"> <h1 class="post-title"> <a class="post-title-link" href="/2016/12/10/计算机重点问题集锦/" itemprop="url"> <span itemprop="name">计算机重点问题集锦</span> </a> </h1> <div class="post-meta"> <time class="post-time" itemprop="dateCreated" datetime="2016-12-10T16:10:12+08:00" content="2016-12-10"> 12-10 </time> </div> </header> </article> <article class="post post-type-normal" itemscope itemtype="http://schema.org/Article"> <header class="post-header"> <h1 class="post-title"> <a class="post-title-link" href="/2016/12/10/Scrapy爬虫库使用详解/" itemprop="url"> <span itemprop="name">Scrapy爬虫库使用详解</span> </a> </h1> <div class="post-meta"> <time class="post-time" itemprop="dateCreated" datetime="2016-12-10T12:36:04+08:00" content="2016-12-10"> 12-10 </time> </div> </header> </article> <article class="post post-type-normal" itemscope itemtype="http://schema.org/Article"> <header class="post-header"> <h1 class="post-title"> <a class="post-title-link" href="/2016/12/01/re正则库使用详解/" itemprop="url"> <span itemprop="name">re正则库使用详解</span> </a> </h1> <div class="post-meta"> <time class="post-time" itemprop="dateCreated" datetime="2016-12-01T16:00:45+08:00" content="2016-12-01"> 12-01 </time> </div> </header> </article> <article class="post post-type-normal" itemscope itemtype="http://schema.org/Article"> <header class="post-header"> <h1 class="post-title"> <a class="post-title-link" href="/2016/11/29/Python描述符descriptor/" itemprop="url"> <span itemprop="name">Python描述符descriptor</span> </a> </h1> <div class="post-meta"> <time class="post-time" itemprop="dateCreated" datetime="2016-11-29T18:40:14+08:00" content="2016-11-29"> 11-29 </time> </div> </header> </article> <article class="post post-type-normal" itemscope itemtype="http://schema.org/Article"> <header class="post-header"> <h1 class="post-title"> <a class="post-title-link" href="/2016/11/29/os库常用方法使用介绍/" itemprop="url"> <span itemprop="name">os库常用方法使用介绍</span> </a> </h1> <div class="post-meta"> <time class="post-time" itemprop="dateCreated" datetime="2016-11-29T09:27:27+08:00" content="2016-11-29"> 11-29 </time> </div> </header> </article> </section> <nav class="pagination"> <span class="page-number current">1</span><a class="page-number" href="/archives/page/2/">2</a><span class="space">&hellip;</span><a class="page-number" href="/archives/page/6/">6</a><a class="extend next" rel="next" href="/archives/page/2/"><i class="fa fa-angle-right"></i></a> </nav> </div> </div> <div class="sidebar-toggle"> <div class="sidebar-toggle-line-wrap"> <span class="sidebar-toggle-line sidebar-toggle-line-first"></span> <span class="sidebar-toggle-line sidebar-toggle-line-middle"></span> <span class="sidebar-toggle-line sidebar-toggle-line-last"></span> </div> </div> <aside id="sidebar" class="sidebar"> <div class="sidebar-inner"> <section class="site-overview sidebar-panel sidebar-panel-active"> <div class="site-author motion-element" itemprop="author" itemscope itemtype="http://schema.org/Person"> <img class="site-author-image" itemprop="image" src="/images/me.jpg" alt="xin053"> <p class="site-author-name" itemprop="name">xin053</p> <p class="site-description motion-element" itemprop="description">正在用Windbg调试正在调试正在反汇编Windbg的IDA的OD...</p> </div> <nav class="site-state motion-element"> <div class="site-state-item site-state-posts"> <a href="/archives"> <span class="site-state-item-count">55</span> <span class="site-state-item-name">日志</span> </a> </div> <div class="site-state-item site-state-categories"> <a href="/categories"> <span class="site-state-item-count">13</span> <span class="site-state-item-name">分类</span> </a> </div> <div class="site-state-item site-state-tags"> <a href="/tags"> <span class="site-state-item-count">50</span> <span class="site-state-item-name">标签</span> </a> </div> </nav> <div class="feed-link motion-element"> <a href="/atom.xml" rel="alternate"> <i class="fa fa-rss"></i> RSS </a> </div> <div class="links-of-author motion-element"> <span class="links-of-author-item"> <a href="https://github.com/xin053" target="_blank" title="GitHub"> <i class="fa fa-fw fa-github"></i> GitHub </a> </span> <span class="links-of-author-item"> <a href="http://weibo.com/xin053" target="_blank" title="微博"> <i class="fa fa-fw fa-weibo"></i> 微博 </a> </span> <span class="links-of-author-item"> <a href="http://www.zhihu.com/people/xin053" target="_blank" title="知乎"> <i class="fa fa-fw fa-globe"></i> 知乎 </a> </span> <span class="links-of-author-item"> <a href="http://blog.csdn.net/zhouzixin053" target="_blank" title="csdn"> <i class="fa fa-fw fa-globe"></i> csdn </a> </span> </div> <div class="links-of-blogroll motion-element links-of-blogroll-block"> <div class="links-of-blogroll-title"> <i class="fa fa-fw fa-globe"></i> 友情链接 </div> <ul class="links-of-blogroll-list"> <li class="links-of-blogroll-item"> <a href="http://bbs.pediy.com/" title="看雪" target="_blank">看雪</a> </li> <li class="links-of-blogroll-item"> <a href="http://www.geeklzh.com/" title="怪咖家园" target="_blank">怪咖家园</a> </li> <li class="links-of-blogroll-item"> <a href="http://www.csdh.pub/" title="CS_DH" target="_blank">CS_DH</a> </li> <li class="links-of-blogroll-item"> <a href="https://dendise7engithub.github.io/" title="Dendionk" target="_blank">Dendionk</a> </li> <li class="links-of-blogroll-item"> <a href="http://cyang.tech/" title="cyang" target="_blank">cyang</a> </li> </ul> </div> </section> </div> </aside> </div> </main> <footer id="footer" class="footer"> <div class="footer-inner"> <div class="copyright"> &copy; 2016 - <span itemprop="copyrightYear">2017</span> <span class="with-love"> <i class="fa fa-heart"></i> </span> <span class="author" itemprop="copyrightHolder">xin053</span> </div> <div class="powered-by"> 由 <a class="theme-link" href="http://hexo.io">Hexo</a> 强力驱动 </div> <div class="theme-info"> 主题 - <a class="theme-link" href="https://github.com/iissnan/hexo-theme-next"> NexT.Mist </a> </div> </div> </footer> <div class="back-to-top"> <i class="fa fa-arrow-up"></i> </div> </div> <script type="text/javascript"> if (Object.prototype.toString.call(window.Promise) !== '[object Function]') { window.Promise = null; } </script> <script type="text/javascript" src="/lib/jquery/index.js?v=2.1.3"></script> <script type="text/javascript" src="/lib/fastclick/lib/fastclick.min.js?v=1.0.6"></script> <script type="text/javascript" src="/lib/jquery_lazyload/jquery.lazyload.js?v=1.9.7"></script> <script type="text/javascript" src="/lib/velocity/velocity.min.js?v=1.2.1"></script> <script type="text/javascript" src="/lib/velocity/velocity.ui.min.js?v=1.2.1"></script> <script type="text/javascript" src="/lib/fancybox/source/jquery.fancybox.pack.js?v=2.1.5"></script> <script type="text/javascript" src="/js/src/utils.js?v=5.0.1"></script> <script type="text/javascript" src="/js/src/motion.js?v=5.0.1"></script> <script type="text/javascript" id="motion.page.archive"> $('.archive-year').velocity('transition.slideLeftIn'); </script> <script type="text/javascript" src="/js/src/bootstrap.js?v=5.0.1"></script> <script type="text/javascript"> var disqus_shortname = 'xin053'; var disqus_identifier = 'archives/index.html'; var disqus_title = ""; var disqus_url = ''; function run_disqus_script(disqus_script){ var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true; dsq.src = '//' + disqus_shortname + '.disqus.com/' + disqus_script; (document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq); } run_disqus_script('count.js'); </script> <script type="text/javascript"> // Popup Window; var isfetched = false; // Search DB path; var search_path = "search.xml"; if (search_path.length == 0) { search_path = "search.xml"; } var path = "/" + search_path; // monitor main search box; function proceedsearch() { $("body").append('<div class="popoverlay">').css('overflow', 'hidden'); $('.popup').toggle(); } // search function; var searchFunc = function(path, search_id, content_id) { 'use strict'; $.ajax({ url: path, dataType: "xml", async: true, success: function( xmlResponse ) { // get the contents from search data isfetched = true; $('.popup').detach().appendTo('.header-inner'); var datas = $( "entry", xmlResponse ).map(function() { return { title: $( "title", this ).text(), content: $("content",this).text(), url: $( "url" , this).text() }; }).get(); var $input = document.getElementById(search_id); var $resultContent = document.getElementById(content_id); $input.addEventListener('input', function(){ var matchcounts = 0; var str='<ul class=\"search-result-list\">'; var keywords = this.value.trim().toLowerCase().split(/[\s\-]+/); $resultContent.innerHTML = ""; if (this.value.trim().length > 1) { // perform local searching datas.forEach(function(data) { var isMatch = true; var content_index = []; var data_title = data.title.trim().toLowerCase(); var data_content = data.content.trim().replace(/<[^>]+>/g,"").toLowerCase(); var data_url = data.url; var index_title = -1; var index_content = -1; var first_occur = -1; // only match artiles with not empty titles and contents if(data_title != '' && data_content != '') { keywords.forEach(function(keyword, i) { index_title = data_title.indexOf(keyword); index_content = data_content.indexOf(keyword); if( index_title < 0 && index_content < 0 ){ isMatch = false; } else { if (index_content < 0) { index_content = 0; } if (i == 0) { first_occur = index_content; } } }); } // show search results if (isMatch) { matchcounts += 1; str += "<li><a href='"+ data_url +"' class='search-result-title'>"+ data_title +"</a>"; var content = data.content.trim().replace(/<[^>]+>/g,""); if (first_occur >= 0) { // cut out 100 characters var start = first_occur - 20; var end = first_occur + 80; if(start < 0){ start = 0; } if(start == 0){ end = 50; } if(end > content.length){ end = content.length; } var match_content = content.substring(start, end); // highlight all keywords keywords.forEach(function(keyword){ var regS = new RegExp(keyword, "gi"); match_content = match_content.replace(regS, "<b class=\"search-keyword\">"+keyword+"</b>"); }); str += "<p class=\"search-result\">" + match_content +"...</p>" } str += "</li>"; } })}; str += "</ul>"; if (matchcounts == 0) { str = '<div id="no-result"><i class="fa fa-frown-o fa-5x" /></div>' } if (keywords == "") { str = '<div id="no-result"><i class="fa fa-search fa-5x" /></div>' } $resultContent.innerHTML = str; }); proceedsearch(); } });} // handle and trigger popup window; $('.popup-trigger').mousedown(function(e) { e.stopPropagation(); if (isfetched == false) { searchFunc(path, 'local-search-input', 'local-search-result'); } else { proceedsearch(); }; }); $('.popup-btn-close').click(function(e){ $('.popup').hide(); $(".popoverlay").remove(); $('body').css('overflow', ''); }); $('.popup').click(function(e){ e.stopPropagation(); }); </script> </body> </html>
apache-2.0
strubell/Parser
bin/plot_attn.py
3315
from __future__ import division from __future__ import print_function import numpy as np import matplotlib.pyplot as plt import os import string plt.ioff() data = np.load("attn_weights.npz") lines = map(lambda x: x.split('\t'), open("sanitycheck.txt", 'r').readlines()) save_dir = "attn_plots3" sentences = [] current_sent = [] for line in lines: if len(line) < 10: sentences.append(map(list, zip(*current_sent))) current_sent = [] else: current_sent.append(map(string.strip, (line[1], line[6], line[7], line[8], line[9]))) sentences.append(map(list, zip(*current_sent))) max_layer = 3 remove_padding = True plot = False batch_sum = 0 fig, axes = plt.subplots(nrows=2, ncols=4) # For each batch+layer for arr_name in sorted(data.files): print("Processing %s" % arr_name) batch_size = data[arr_name].shape[0] batch = int(arr_name[1]) layer = int(arr_name.split(':')[1][-1]) idx_in_batch = 0 # For each element in the batch (one layer) # if layer == max_layer and batch > 0: for b_i, arrays in enumerate(data[arr_name]): sentence_idx = batch_sum + b_i width = arrays.shape[-1] name = "sentence%d_layer%d" % (sentence_idx, layer) print("Batch: %d, sentence: %d, layer: %d" % (batch, sentence_idx, layer)) sentence = sentences[sentence_idx] words = sentence[0] pred_deps = np.array(map(int, sentence[1])) pred_labels = sentence[2] gold_deps = np.array(map(int, sentence[3])) gold_labels = sentence[4] sent_len = len(words) text = words + [] if remove_padding else (['PAD'] * (width - sent_len)) gold_deps_xy = np.array(list(enumerate(gold_deps))) pred_deps_xy = np.array(list(enumerate(pred_deps))) labels_incorrect = map(lambda x: x[0] != x[1], zip(pred_labels, gold_labels)) incorrect_indices = np.where((pred_deps != gold_deps) | labels_incorrect) pred_deps_xy_incorrect = pred_deps_xy[incorrect_indices] pred_labels_incorrect = np.array(pred_labels)[incorrect_indices] if 'prep' in pred_labels_incorrect: print(' '.join(text)) print(' '.join(pred_labels)) print(' '.join(gold_labels)) if plot: correct_dir = "correct" if len(incorrect_indices[0]) == 0 else "incorrect" fig.suptitle(name, fontsize=16) # For each attention head for arr, ax in zip(arrays, axes.flat): res = ax.imshow(arr[:sent_len, :sent_len], cmap=plt.cm.viridis, interpolation=None) ax.set_xticks(range(sent_len)) ax.set_yticks(range(sent_len)) ax.set_xticklabels(text, rotation=75, fontsize=2) ax.set_yticklabels(text, fontsize=2) map(lambda x: ax.text(x[0][1], x[0][0], x[1], ha="center", va="center", fontsize=1), zip(gold_deps_xy, gold_labels)) map(lambda x: ax.text(x[0][1], x[0][0], x[1], ha="center", va="bottom", fontsize=1, color='red'), zip(pred_deps_xy_incorrect, pred_labels_incorrect)) fig.tight_layout() fig.savefig(os.path.join(save_dir, correct_dir, name + ".pdf")) map(lambda x: x.clear(), axes.flat) if layer == max_layer: batch_sum += batch_size
apache-2.0
openstack/smaug
karbor/tests/unit/api/v1/test_quotas.py
4032
# 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. import mock from oslo_config import cfg from webob import exc from karbor.api.v1 import quotas from karbor import context from karbor.tests import base from karbor.tests.unit.api import fakes CONF = cfg.CONF class QuotaApiTest(base.TestCase): def setUp(self): super(QuotaApiTest, self).setUp() self.controller = quotas.QuotasController() self.ctxt = context.RequestContext('demo', 'fakeproject', True) @mock.patch( 'karbor.db.sqlalchemy.api.quota_update') def test_quota_update(self, mock_quota_update): quota = self._quota_in_request_body() body = {"quota": quota} req = fakes.HTTPRequest.blank( '/v1/quotas/73f74f90a1754bd7ad658afb3272323f', use_admin_context=True) self.controller.update( req, '73f74f90a1754bd7ad658afb3272323f', body=body) self.assertTrue(mock_quota_update.called) def test_quota_update_invalid_project_id(self): quota = self._quota_in_request_body() body = {"quota": quota} req = fakes.HTTPRequest.blank( '/v1/quotas/111', use_admin_context=True) self.assertRaises(exc.HTTPBadRequest, self.controller.update, req, '111', body=body) @mock.patch( 'karbor.quota.DbQuotaDriver.get_defaults') def test_quota_defaults(self, mock_quota_get): req = fakes.HTTPRequest.blank( 'v1/quotas/73f74f90a1754bd7ad658afb3272323f', use_admin_context=True) self.controller.defaults( req, '73f74f90a1754bd7ad658afb3272323f') self.assertTrue(mock_quota_get.called) @mock.patch( 'karbor.quota.DbQuotaDriver.get_project_quotas') def test_quota_detail(self, mock_quota_get): req = fakes.HTTPRequest.blank( '/v1/quotas/73f74f90a1754bd7ad658afb3272323f', use_admin_context=True) self.controller.detail( req, '73f74f90a1754bd7ad658afb3272323f') self.assertTrue(mock_quota_get.called) @mock.patch( 'karbor.quota.DbQuotaDriver.get_project_quotas') def test_quota_show(self, moak_quota_get): req = fakes.HTTPRequest.blank( '/v1/quotas/73f74f90a1754bd7ad658afb3272323f', use_admin_context=True) self.controller.show( req, '73f74f90a1754bd7ad658afb3272323f') self.assertTrue(moak_quota_get.called) def test_quota_show_invalid(self): req = fakes.HTTPRequest.blank('/v1/quotas/1', use_admin_context=True) self.assertRaises( exc.HTTPBadRequest, self.controller.show, req, "1") @mock.patch( 'karbor.quota.DbQuotaDriver.destroy_all_by_project') def test_quota_delete(self, moak_restore_get): req = fakes.HTTPRequest.blank( '/v1/quotas/73f74f90a1754bd7ad658afb3272323f', use_admin_context=True) self.controller.delete( req, '73f74f90a1754bd7ad658afb3272323f') self.assertTrue(moak_restore_get.called) def test_quota_delete_invalid(self): req = fakes.HTTPRequest.blank('/v1/quotas/1', use_admin_context=True) self.assertRaises( exc.HTTPBadRequest, self.controller.delete, req, "1") def _quota_in_request_body(self): quota_req = { "plans": 20, } return quota_req
apache-2.0
Syncleus/aparapi
src/test/java/com/aparapi/codegen/test/EmptyIfBlock.java
802
/** * Copyright (c) 2016 - 2018 Syncleus, 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.aparapi.codegen.test; public class EmptyIfBlock { public void run() { int idx = 34; if(idx < 5) { } } } /**{Throws{ClassParseException}Throws}**/
apache-2.0
play2-maven-plugin/play2-maven-plugin.github.io
play2-maven-plugin/1.0.0-beta6/play2-source-watchers/play2-source-watcher-jnotify/apidocs/com/google/code/play2/watcher/jnotify/class-use/JNotifyFileWatchService.html
4872
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <!-- NewPage --> <html lang="pl"> <head> <!-- Generated by javadoc --> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>Uses of Class com.google.code.play2.watcher.jnotify.JNotifyFileWatchService (Play! 2.x Source Watcher JNotify 1.0.0-beta6 API)</title> <link rel="stylesheet" type="text/css" href="../../../../../../../stylesheet.css" title="Style"> <script type="text/javascript" src="../../../../../../../script.js"></script> </head> <body> <script type="text/javascript"><!-- try { if (location.href.indexOf('is-external=true') == -1) { parent.document.title="Uses of Class com.google.code.play2.watcher.jnotify.JNotifyFileWatchService (Play! 2.x Source Watcher JNotify 1.0.0-beta6 API)"; } } catch(err) { } //--> </script> <noscript> <div>JavaScript is disabled on your browser.</div> </noscript> <!-- ========= START OF TOP NAVBAR ======= --> <div class="topNav"><a name="navbar.top"> <!-- --> </a> <div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div> <a name="navbar.top.firstrow"> <!-- --> </a> <ul class="navList" title="Navigation"> <li><a href="../../../../../../../com/google/code/play2/watcher/jnotify/package-summary.html">Package</a></li> <li><a href="../../../../../../../com/google/code/play2/watcher/jnotify/JNotifyFileWatchService.html" title="class in com.google.code.play2.watcher.jnotify">Class</a></li> <li class="navBarCell1Rev">Use</li> <li><a href="../package-tree.html">Tree</a></li> <li><a href="../../../../../../../deprecated-list.html">Deprecated</a></li> <li><a href="../../../../../../../index-all.html">Index</a></li> <li><a href="../../../../../../../help-doc.html">Help</a></li> </ul> </div> <div class="subNav"> <ul class="navList"> <li>Prev</li> <li>Next</li> </ul> <ul class="navList"> <li><a href="../../../../../../../index.html?com/google/code/play2/watcher/jnotify/class-use/JNotifyFileWatchService.html" target="_top">Frames</a></li> <li><a href="JNotifyFileWatchService.html" target="_top">No&nbsp;Frames</a></li> </ul> <ul class="navList" id="allclasses_navbar_top"> <li><a href="../../../../../../../allclasses-noframe.html">All&nbsp;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 com.google.code.play2.watcher.jnotify.JNotifyFileWatchService" class="title">Uses of Class<br>com.google.code.play2.watcher.jnotify.JNotifyFileWatchService</h2> </div> <div class="classUseContainer">No usage of com.google.code.play2.watcher.jnotify.JNotifyFileWatchService</div> <!-- ======= START OF BOTTOM NAVBAR ====== --> <div class="bottomNav"><a name="navbar.bottom"> <!-- --> </a> <div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div> <a name="navbar.bottom.firstrow"> <!-- --> </a> <ul class="navList" title="Navigation"> <li><a href="../../../../../../../com/google/code/play2/watcher/jnotify/package-summary.html">Package</a></li> <li><a href="../../../../../../../com/google/code/play2/watcher/jnotify/JNotifyFileWatchService.html" title="class in com.google.code.play2.watcher.jnotify">Class</a></li> <li class="navBarCell1Rev">Use</li> <li><a href="../package-tree.html">Tree</a></li> <li><a href="../../../../../../../deprecated-list.html">Deprecated</a></li> <li><a href="../../../../../../../index-all.html">Index</a></li> <li><a href="../../../../../../../help-doc.html">Help</a></li> </ul> </div> <div class="subNav"> <ul class="navList"> <li>Prev</li> <li>Next</li> </ul> <ul class="navList"> <li><a href="../../../../../../../index.html?com/google/code/play2/watcher/jnotify/class-use/JNotifyFileWatchService.html" target="_top">Frames</a></li> <li><a href="JNotifyFileWatchService.html" target="_top">No&nbsp;Frames</a></li> </ul> <ul class="navList" id="allclasses_navbar_bottom"> <li><a href="../../../../../../../allclasses-noframe.html">All&nbsp;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>Copyright &#169; 2013&#x2013;2017. All rights reserved.</small></p> </body> </html>
apache-2.0