answer
stringlengths
15
1.25M
# Puccinia delicatula (Arthur) Sacc. & Trotter SPECIES # Status ACCEPTED # According to Index Fungorum # Published in in Saccardo, Syll. fung. (Abellini) 21: 657 (1912) # Original name Polioma delicatula Arthur Remarks null
/ [<API key>.ts] module P { { module M { } export namespace N { export interface I { } } namespace Q.K { } declare module "ambient" { } export = M; var v; function foo() { } export * from "ambient"; export { foo }; export { baz as b } from "ambient"; export default v; export default class C { } export function bee() { } import I = M; import I2 = require("foo"); import * as Foo from "ambient"; import bar from "ambient"; import { baz } from "ambient"; import "ambient"; } } / [<API key>.js] var P; (function (P) { { export = M; var v; function foo() { } export * from "ambient"; export { foo }; export { baz as b } from "ambient"; export default v; var C = (function () { function C() { } return C; }()); P.C = C; function bee() { } P.bee = bee; import I2 = require("foo"); import * as Foo from "ambient"; import bar from "ambient"; import { baz } from "ambient"; import "ambient"; } })(P || (P = {}));
package pl.setblack.airomem.chatsample.data; import java.io.Serializable; import javax.xml.bind.annotation.XmlAttribute; import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlRootElement; import pl.setblack.airomem.chatsample.view.AuthorView; /** * * @author jarekr */ @XmlRootElement public class Author implements AuthorView, Serializable { private static final long serialVersionUID = 1; public String nickName; public Author() { } Author(String nick) { this.nickName = nick; } @XmlAttribute @Override public String getNickName() { return nickName; } }
package com.opengamma.strata.collect.io; import static com.google.common.base.Preconditions.checkArgument; import java.io.<API key>; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import java.io.Serializable; import java.io.<API key>; import java.lang.annotation.Annotation; import java.lang.reflect.Type; import java.nio.charset.StandardCharsets; import java.nio.file.Paths; import java.util.Arrays; import java.util.Base64; import java.util.List; import java.util.Map; import java.util.<API key>; import java.util.Optional; import org.joda.beans.Bean; import org.joda.beans.BeanBuilder; import org.joda.beans.ImmutableBean; import org.joda.beans.JodaBeanUtils; import org.joda.beans.MetaBean; import org.joda.beans.MetaProperty; import org.joda.beans.PropertyStyle; import org.joda.beans.impl.<API key>; import org.joda.beans.impl.BasicMetaBean; import org.joda.beans.impl.BasicMetaProperty; import com.google.common.base.Strings; import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; import com.google.common.hash.HashCode; import com.google.common.hash.HashFunction; import com.google.common.hash.Hashing; import com.google.common.io.BaseEncoding; import com.google.common.io.ByteProcessor; import com.google.common.io.ByteSource; import com.google.common.io.ByteStreams; import com.google.common.io.CharSource; import com.google.common.primitives.Bytes; import com.opengamma.strata.collect.ArgChecker; import com.opengamma.strata.collect.Unchecked; import com.opengamma.strata.collect.function.CheckedSupplier; /** * A byte source implementation that explicitly wraps a byte array. * <p> * This implementation allows {@link IOException} to be avoided in many cases, * and to be able to create and retrieve the internal array unsafely. */ public final class ArrayByteSource extends BeanByteSource implements ImmutableBean, Serializable { /** * An empty source. */ public static final ArrayByteSource EMPTY = new ArrayByteSource(new byte[0]); /** * Serialization version. */ private static final long serialVersionUID = 1L; static { MetaBean.register(Meta.META); } /** * The byte array. */ private final byte[] array; /** * The file name, null if not known. */ private final String fileName; /** * Obtains an instance, copying the array. * * @param array the array, copied * @return the byte source */ public static ArrayByteSource copyOf(byte[] array) { return new ArrayByteSource(array.clone()); } /** * Obtains an instance by copying part of an array. * <p> * The input array is copied and not mutated. * * @param array the array to copy * @param fromIndex the offset from the start of the array * @return an array containing the specified values * @throws <API key> if the index is invalid */ public static ArrayByteSource copyOf(byte[] array, int fromIndex) { return copyOf(array, fromIndex, array.length); } /** * Obtains an instance by copying part of an array. * <p> * The input array is copied and not mutated. * * @param array the array to copy * @param fromIndexInclusive the start index of the input array to copy from * @param toIndexExclusive the end index of the input array to copy to * @return an array containing the specified values * @throws <API key> if the index is invalid */ public static ArrayByteSource copyOf(byte[] array, int fromIndexInclusive, int toIndexExclusive) { if (fromIndexInclusive > array.length) { throw new <API key>("Array index out of bounds: " + fromIndexInclusive + " > " + array.length); } if (toIndexExclusive > array.length) { throw new <API key>("Array index out of bounds: " + toIndexExclusive + " > " + array.length); } if ((toIndexExclusive - fromIndexInclusive) == 0) { return EMPTY; } return new ArrayByteSource(Arrays.copyOfRange(array, fromIndexInclusive, toIndexExclusive)); } /** * Obtains an instance, not copying the array. * <p> * This method is inherently unsafe as it relies on good behavior by callers. * Callers must never make any changes to the passed in array after calling this method. * Doing so would violate the immutability of this class. * * @param array the array, not copied * @return the byte source */ public static ArrayByteSource ofUnsafe(byte[] array) { return new ArrayByteSource(array); } /** * Obtains an instance from a string using UTF-8. * * @param str the string to store using UTF-8 * @return the byte source */ public static ArrayByteSource ofUtf8(String str) { return new ArrayByteSource(str.getBytes(StandardCharsets.UTF_8)); } /** * Obtains an instance from another byte source. * * @param other the other byte source * @return the byte source * @throws <API key> if an IO error occurs */ public static ArrayByteSource from(ByteSource other) { if (other instanceof ArrayByteSource) { return (ArrayByteSource) other; } String fileName = null; if (other instanceof BeanByteSource) { fileName = ((BeanByteSource) other).getFileName().orElse(null); } else if (other.getClass().getName().equals("com.google.common.io.ByteSource$ByteArrayByteSource")) { // extract the byte[] without using reflection // if the Guava implementation changes this could break, but that seems unlikely ByteProcessor<byte[]> processor = new ByteProcessor<byte[]>() { private byte[] captured; @Override public boolean processBytes(byte[] buf, int off, int len) throws IOException { if (captured != null) { // this defends against the Guava implementation being changed captured = Bytes.concat(captured, Arrays.copyOfRange(buf, off, off + len)); } else if (off == 0 && len == buf.length) { // this is the normal case where we can just assign the source captured = buf; } else { // this happens if the source has been sliced captured = Arrays.copyOfRange(buf, off, off + len); } return true; } @Override public byte[] getResult() { return captured; } }; return Unchecked.wrap(() -> new ArrayByteSource(other.read(processor))); } else { // handle all other byte sources String str = other.toString(); if (str.equals("ByteSource.empty()")) { return EMPTY; } else if (str.startsWith("Files.asByteSource(")) { // extract the file name from toString() int pos = str.indexOf(')', 19); fileName = Paths.get(str.substring(19, pos)).getFileName().toString(); } else if (str.startsWith("MoreFiles.asByteSource(")) { // extract the path name from toString() int pos = str.indexOf(',', 23); fileName = Paths.get(str.substring(23, pos)).getFileName().toString(); } else if (str.startsWith("Resources.asByteSource(")) { // extract the URI from toString() int pos = str.indexOf(')', 23); String path = str.substring(23, pos); int lastSlash = path.lastIndexOf('/'); fileName = path.substring(lastSlash + 1); } } return new ArrayByteSource(Unchecked.wrap(() -> other.read()), fileName); } /** * Obtains an instance from an input stream. * <p> * This method use the supplier to open the input stream, extract the bytes and close the stream. * It is intended that invoking the supplier opens the stream. * It is not intended that an already open stream is supplied. * * @param inputStreamSupplier the supplier of the input stream * @return the byte source * @throws <API key> if an IO error occurs */ public static ArrayByteSource from(CheckedSupplier<InputStream> inputStreamSupplier) { return Unchecked.wrap(() -> { try (InputStream in = inputStreamSupplier.get()) { return from(in); } }); } /** * Obtains an instance from an input stream. * <p> * This method uses an already open input stream, extracting the bytes. * The stream is not closed - that is the responsibility of the caller. * * @param inputStream the open input stream, which will not be closed * @return the byte source * @throws IOException if an IO error occurs */ public static ArrayByteSource from(InputStream inputStream) throws IOException { byte[] bytes = ByteStreams.toByteArray(inputStream); return new ArrayByteSource(bytes); } /** * Obtains an instance from an input stream, specifying the expected size. * <p> * This method uses an already open input stream, extracting the bytes. * The stream is not closed - that is the responsibility of the caller. * * @param inputStream the open input stream, which will not be closed * @param expectedSize the expected size of the input, not negative * @return the byte source * @throws IOException if an IO error occurs */ public static ArrayByteSource from(InputStream inputStream, int expectedSize) throws IOException { ArgChecker.notNegative(expectedSize, "expectedSize"); byte[] main = new byte[expectedSize]; int remaining = expectedSize; while (remaining > 0) { int offset = expectedSize - remaining; int read = inputStream.read(main, offset, remaining); if (read == -1) { // actual stream size < expected size return new ArrayByteSource(Arrays.copyOf(main, offset)); } remaining -= read; } // bytes is now full int firstExcess = inputStream.read(); if (firstExcess == -1) { // actual stream size == expected size return new ArrayByteSource(main); } // actual stream size > expected size byte[] excess = ByteStreams.toByteArray(inputStream); byte[] result = Arrays.copyOf(main, main.length + 1 + excess.length); result[main.length] = (byte) firstExcess; System.arraycopy(excess, 0, result, main.length + 1, excess.length); return new ArrayByteSource(result); } /** * Obtains an instance from a base-64 encoded string. * * @param base64 the base64 string to convert * @return the decoded byte source * @throws <API key> if the input is not Base64 encoded */ public static ArrayByteSource fromBase64(String base64) { return new ArrayByteSource(Base64.getDecoder().decode(base64)); } /** * Obtains an instance from a hex encoded string, sometimes referred to as base-16. * * @param hex the hex string to convert * @return the decoded byte source * @throws <API key> if the input is not hex encoded */ public static ArrayByteSource fromHex(String hex) { return new ArrayByteSource(BaseEncoding.base16().decode(hex)); } // creates an instance, without copying the array private ArrayByteSource(byte[] array) { this.array = array; this.fileName = null; } // creates an instance, without copying the array ArrayByteSource(byte[] array, String fileName) { this.array = array; this.fileName = Strings.emptyToNull(fileName); } @Override public MetaBean metaBean() { return Meta.META; } @Override public Optional<String> getFileName() { return Optional.ofNullable(fileName); } /** * Returns an instance with the file name updated. * <p> * If a path is passed in, only the file name is retained. * * @param fileName the file name, an empty string can be used to remove the file name * @return a source with the specified file name */ public ArrayByteSource withFileName(String fileName) { ArgChecker.notNull(fileName, "fileName"); int lastSlash = fileName.lastIndexOf('/'); return new ArrayByteSource(array, fileName.substring(lastSlash + 1)); } /** * Returns the underlying array. * <p> * This method is inherently unsafe as it relies on good behavior by callers. * Callers must never make any changes to the array returned by this method. * Doing so would violate the immutability of this class. * * @return the raw array */ public byte[] readUnsafe() { return array; } /** * Reads the source, converting to UTF-8. * * @return the UTF-8 string */ @Override public String readUtf8() { return new String(array, StandardCharsets.UTF_8); } /** * Reads the source, converting to UTF-8 using a Byte-Order Mark if available. * * @return the UTF-8 string */ @Override public String readUtf8UsingBom() { return UnicodeBom.toString(array); } /** * Returns a {@code CharSource} for the same bytes, converted to UTF-8 using a Byte-Order Mark if available. * * @return the equivalent {@code CharSource} */ @Override public CharSource <API key>() { return UnicodeBom.toCharSource(this); } @Override public HashCode hash(HashFunction hashFunction) { // overridden to use array directly for performance return hashFunction.hashBytes(array); } /** * Returns the MD5 hash of the bytes. * <p> * The returned hash is in byte form. * * @return the MD5 hash * @deprecated Use {@link #toHash(HashFunction)} */ @Deprecated public ArrayByteSource toMd5() { return toHash(Hashing.md5()); } /** * Returns the SHA-512 hash of the bytes. * * @return the SHA-512 hash * @deprecated Use {@link #toHash(HashFunction)} */ @Deprecated public ArrayByteSource toSha512() { return ArrayByteSource.ofUnsafe(hash(Hashing.sha512()).asBytes()); } /** * Encodes the byte source using base-64. * * @return the base-64 encoded form */ @Override public ArrayByteSource toBase64() { // overridden to use array directly for performance return ArrayByteSource.ofUnsafe(Base64.getEncoder().encode(array)); } /** * Encodes the byte source using base-64, returning a string. * <p> * Equivalent to {@code toBase64().readUtf8()}. * * @return the base-64 encoded string */ @Override public String toBase64String() { // overridden to use array directly for performance return Base64.getEncoder().encodeToString(array); } /** * Encodes the byte source. * * @param codec the codec to use * @return the encoded form */ public ArrayByteSource encode(ByteSourceCodec codec) { return codec.encode(array, fileName); } /** * Decodes the byte source. * * @param codec the codec to use * @return the decoded form */ public ArrayByteSource decode(ByteSourceCodec codec) { return codec.decode(array, fileName); } /** * Encodes the byte source using hex, sometimes referred to as base-16, returning a string. * * @return the hex encoded string */ public String toHexString() { return BaseEncoding.base16().encode(array); } @Override public <API key> openStream() { return new <API key>(array); } @Override public <API key> openBufferedStream() { return openStream(); } @Override public boolean isEmpty() { return array.length == 0; } /** * Gets the size, which is always known. * * @return the size, which is always known */ @Override public com.google.common.base.Optional<Long> sizeIfKnown() { return com.google.common.base.Optional.of(size()); } @Override public long size() { return array.length; } @Override public ArrayByteSource slice(long offset, long length) { checkArgument(offset >= 0, "offset (%s) may not be negative", offset); checkArgument(length >= 0, "length (%s) may not be negative", length); if (offset > array.length) { return EMPTY; } int minPos = (int) offset; long len = Math.min(Math.min(length, Integer.MAX_VALUE), array.length); int maxPos = (int) Math.min(minPos + len, array.length); return new ArrayByteSource(Arrays.copyOfRange(array, minPos, maxPos), fileName); } @Override public long copyTo(OutputStream output) throws IOException { output.write(array); return array.length; } @Override public byte[] read() { return array.clone(); } @Override public <T> T read(ByteProcessor<T> processor) throws IOException { processor.processBytes(array, 0, array.length); return processor.getResult(); } @Override public boolean contentEquals(ByteSource other) throws IOException { if (other instanceof ArrayByteSource) { return JodaBeanUtils.equal(array, ((ArrayByteSource) other).array); } return super.contentEquals(other); } @Override public ArrayByteSource load() { return this; } @Override public boolean equals(Object obj) { if (obj == this) { return true; } if (obj != null && obj.getClass() == this.getClass()) { ArrayByteSource other = ((ArrayByteSource) obj); return JodaBeanUtils.equal(fileName, other.fileName) && JodaBeanUtils.equal(array, other.array); } return false; } @Override public int hashCode() { int hash = getClass().hashCode(); hash = hash * 31 + JodaBeanUtils.hashCode(fileName); hash = hash * 31 + JodaBeanUtils.hashCode(array); return hash; } @Override public String toString() { return "ArrayByteSource[" + size() + " bytes" + (fileName != null ? ", " + fileName : "") + "]"; } /** * Meta bean. */ static final class Meta extends BasicMetaBean { private static final MetaBean META = new Meta(); private static final MetaProperty<byte[]> ARRAY = new BasicMetaProperty<byte[]>("array") { @Override public MetaBean metaBean() { return META; } @Override public Class<?> declaringType() { return ArrayByteSource.class; } @Override public Class<byte[]> propertyType() { return byte[].class; } @Override public Type propertyGenericType() { return byte[].class; } @Override public PropertyStyle style() { return PropertyStyle.IMMUTABLE; } @Override public List<Annotation> annotations() { return ImmutableList.of(); } @Override public byte[] get(Bean bean) { return ((ArrayByteSource) bean).read(); } @Override public void set(Bean bean, Object value) { throw new <API key>("Property cannot be written: " + name()); } }; private static final MetaProperty<String> FILE_NAME = new BasicMetaProperty<String>("fileName") { @Override public MetaBean metaBean() { return META; } @Override public Class<?> declaringType() { return ArrayByteSource.class; } @Override public Class<String> propertyType() { return String.class; } @Override public Type propertyGenericType() { return String.class; } @Override public PropertyStyle style() { return PropertyStyle.IMMUTABLE; } @Override public List<Annotation> annotations() { return ImmutableList.of(); } @Override public String get(Bean bean) { return ((ArrayByteSource) bean).fileName; } @Override public void set(Bean bean, Object value) { throw new <API key>("Property cannot be written: " + name()); } }; private static final ImmutableMap<String, MetaProperty<?>> MAP = ImmutableMap.of("array", ARRAY, "fileName", FILE_NAME); private Meta() { } @Override public boolean isBuildable() { return true; } @Override public BeanBuilder<ArrayByteSource> builder() { return new <API key><ArrayByteSource>(this) { private byte[] array = new byte[0]; private String fileName; @Override public Object get(String propertyName) { if (propertyName.equals(ARRAY.name())) { return array; // not cloned for performance } else if (propertyName.equals(FILE_NAME.name())) { return fileName; } else { throw new <API key>("Unknown property: " + propertyName); } } @Override public BeanBuilder<ArrayByteSource> set(String propertyName, Object value) { if (propertyName.equals(ARRAY.name())) { this.array = ((byte[]) ArgChecker.notNull(value, "value")); // not cloned for performance } else if (propertyName.equals(FILE_NAME.name())) { this.fileName = (String) value; } else { throw new <API key>("Unknown property: " + propertyName); } return this; } @Override public ArrayByteSource build() { ArrayByteSource byteSource = ArrayByteSource.ofUnsafe(array); return fileName != null ? byteSource.withFileName(fileName) : byteSource; } }; } @Override public Class<? extends Bean> beanType() { return ArrayByteSource.class; } @Override public Map<String, MetaProperty<?>> metaPropertyMap() { return MAP; } } }
package com.alamkanak.weekview; import android.content.Context; import com.adtech.webservice.daomain.Doctor; import com.adtech.webservice.daomain.WorkSchedule; import java.lang.annotation.Documented; import java.math.BigDecimal; import java.util.ArrayList; import java.util.Calendar; import java.util.List; public class WeekViewEventUtils { public static List<WeekViewEvent> <API key>(Context context, int index, int[] daysOfWeek, int newYear, int newMonth, int color) { List<WeekViewEvent> events = new ArrayList<WeekViewEvent>(); for (int dayOfWeek : daysOfWeek) { Calendar startTime = Calendar.getInstance(); startTime.set(Calendar.HOUR_OF_DAY, index); startTime.set(Calendar.DAY_OF_WEEK, dayOfWeek); startTime.set(Calendar.MINUTE, 0); startTime.set(Calendar.MONTH, newMonth-1); startTime.set(Calendar.YEAR, newYear); Calendar endTime = (Calendar) startTime.clone(); endTime.add(Calendar.HOUR, 1); // endTime.add(Calendar.DAY_OF_WEEK, dayOfWeek); endTime.set(Calendar.MONTH, newMonth-1); WeekViewEvent event = new WeekViewEvent(index, getEventTitle(startTime), startTime, endTime); event.setColor(context.getResources().getColor(color)); events.add(event); } return events; } public static List<WeekViewEvent> createEventByDate(Context context, int index, List<WorkSchedule> schedules, int color) { List<WeekViewEvent> events = new ArrayList<WeekViewEvent>(); for (WorkSchedule schedule : schedules) { String[] dateArray = schedule.getWeekDay_Date().split("-"); int year = Integer.valueOf(dateArray[0]); int month = Integer.valueOf(dateArray[1]); int day = Integer.valueOf(dateArray[2]); int startMinute = 0; int endHour = index; int endMinute = 30; if (schedule.getPeriod_Id().equals(BigDecimal.valueOf(2))) { startMinute = 30; endHour = index + 1; endMinute = 0; } WeekViewEvent event = new WeekViewEvent(index, schedule.getReg_Num_Remain() + "/" + schedule.getReg_Number(), year, month, day, index, startMinute, year, month, day, endHour, endMinute, schedule); event.setColor(context.getResources().getColor(color)); events.add(event); } return events; } public static List<WeekViewEvent> createEvents(Context context, List<Doctor> doctors, int color) { List<WeekViewEvent> events = new ArrayList<WeekViewEvent>(); for (int i=0;i<doctors.size();i++) { List<WorkSchedule> workSchedules = doctors.get(i).getDateList(); events.addAll(createEventByDate(context, i, workSchedules, color)); } return events; } public static String getEventTitle(Calendar time) { return String.format("Event of %02d:%02d %s/%d", time.get(Calendar.HOUR_OF_DAY), time.get(Calendar.MINUTE), time.get(Calendar.MONTH)+1, time.get(Calendar.DAY_OF_MONTH)); } }
package com.sun.corba.se.<API key>; /** * com/sun/corba/se/<API key>/ORBProxyOperations.java . * Generated by the IDL-to-Java compiler (portable), version "3.2" * from c:/re/workspace/<API key>/jdk8u72/5732/corba/src/share/classes/com/sun/corba/se/<API key>/activation.idl * Tuesday, December 22, 2015 7:17:37 PM PST */ /** ORB callback interface, passed to Activator in registerORB method. */ public interface ORBProxyOperations { /** Method used to cause ORB to activate the named adapter, if possible. * This will cause the named POA to register itself with the activator as * a side effect. This should always happen before this call can complete. * This method returns true if adapter activation succeeded, otherwise it * returns false. */ boolean activate_adapter (String[] name); } // interface ORBProxyOperations
// Generated by the protocol buffer compiler. DO NOT EDIT! // source: google/cloud/vision/v1/image_annotator.proto package com.google.cloud.vision.v1; /** * * * <pre> * Parameters for web detection request. * </pre> * * Protobuf type {@code google.cloud.vision.v1.WebDetectionParams} */ public final class WebDetectionParams extends com.google.protobuf.GeneratedMessageV3 implements // @@<API key>(message_implements:google.cloud.vision.v1.WebDetectionParams) <API key> { private static final long serialVersionUID = 0L; // Use WebDetectionParams.newBuilder() to construct. private WebDetectionParams(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) { super(builder); } private WebDetectionParams() { includeGeoResults_ = false; } @java.lang.Override public final com.google.protobuf.UnknownFieldSet getUnknownFields() { return this.unknownFields; } private WebDetectionParams( com.google.protobuf.CodedInputStream input, com.google.protobuf.<API key> extensionRegistry) throws com.google.protobuf.<API key> { this(); if (extensionRegistry == null) { throw new java.lang.<API key>(); } int mutable_bitField0_ = 0; com.google.protobuf.UnknownFieldSet.Builder unknownFields = com.google.protobuf.UnknownFieldSet.newBuilder(); try { boolean done = false; while (!done) { int tag = input.readTag(); switch (tag) { case 0: done = true; break; case 16: { includeGeoResults_ = input.readBool(); break; } default: { if (!<API key>(input, unknownFields, extensionRegistry, tag)) { done = true; } break; } } } } catch (com.google.protobuf.<API key> e) { throw e.<API key>(this); } catch (java.io.IOException e) { throw new com.google.protobuf.<API key>(e).<API key>(this); } finally { this.unknownFields = unknownFields.build(); <API key>(); } } public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.google.cloud.vision.v1.ImageAnnotatorProto .<API key>; } @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable <API key>() { return com.google.cloud.vision.v1.ImageAnnotatorProto .<API key> .<API key>( com.google.cloud.vision.v1.WebDetectionParams.class, com.google.cloud.vision.v1.WebDetectionParams.Builder.class); } public static final int <API key> = 2; private boolean includeGeoResults_; /** * * * <pre> * Whether to include results derived from the geo information in the image. * </pre> * * <code>bool include_geo_results = 2;</code> */ public boolean <API key>() { return includeGeoResults_; } private byte <API key> = -1; @java.lang.Override public final boolean isInitialized() { byte isInitialized = <API key>; if (isInitialized == 1) return true; if (isInitialized == 0) return false; <API key> = 1; return true; } @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { if (includeGeoResults_ != false) { output.writeBool(2, includeGeoResults_); } unknownFields.writeTo(output); } @java.lang.Override public int getSerializedSize() { int size = memoizedSize; if (size != -1) return size; size = 0; if (includeGeoResults_ != false) { size += com.google.protobuf.CodedOutputStream.computeBoolSize(2, includeGeoResults_); } size += unknownFields.getSerializedSize(); memoizedSize = size; return size; } @java.lang.Override public boolean equals(final java.lang.Object obj) { if (obj == this) { return true; } if (!(obj instanceof com.google.cloud.vision.v1.WebDetectionParams)) { return super.equals(obj); } com.google.cloud.vision.v1.WebDetectionParams other = (com.google.cloud.vision.v1.WebDetectionParams) obj; boolean result = true; result = result && (<API key>() == other.<API key>()); result = result && unknownFields.equals(other.unknownFields); return result; } @java.lang.Override public int hashCode() { if (memoizedHashCode != 0) { return memoizedHashCode; } int hash = 41; hash = (19 * hash) + getDescriptor().hashCode(); hash = (37 * hash) + <API key>; hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(<API key>()); hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; } public static com.google.cloud.vision.v1.WebDetectionParams parseFrom(java.nio.ByteBuffer data) throws com.google.protobuf.<API key> { return PARSER.parseFrom(data); } public static com.google.cloud.vision.v1.WebDetectionParams parseFrom( java.nio.ByteBuffer data, com.google.protobuf.<API key> extensionRegistry) throws com.google.protobuf.<API key> { return PARSER.parseFrom(data, extensionRegistry); } public static com.google.cloud.vision.v1.WebDetectionParams parseFrom( com.google.protobuf.ByteString data) throws com.google.protobuf.<API key> { return PARSER.parseFrom(data); } public static com.google.cloud.vision.v1.WebDetectionParams parseFrom( com.google.protobuf.ByteString data, com.google.protobuf.<API key> extensionRegistry) throws com.google.protobuf.<API key> { return PARSER.parseFrom(data, extensionRegistry); } public static com.google.cloud.vision.v1.WebDetectionParams parseFrom(byte[] data) throws com.google.protobuf.<API key> { return PARSER.parseFrom(data); } public static com.google.cloud.vision.v1.WebDetectionParams parseFrom( byte[] data, com.google.protobuf.<API key> extensionRegistry) throws com.google.protobuf.<API key> { return PARSER.parseFrom(data, extensionRegistry); } public static com.google.cloud.vision.v1.WebDetectionParams parseFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3.<API key>(PARSER, input); } public static com.google.cloud.vision.v1.WebDetectionParams parseFrom( java.io.InputStream input, com.google.protobuf.<API key> extensionRegistry) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3.<API key>( PARSER, input, extensionRegistry); } public static com.google.cloud.vision.v1.WebDetectionParams parseDelimitedFrom( java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3.<API key>(PARSER, input); } public static com.google.cloud.vision.v1.WebDetectionParams parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.<API key> extensionRegistry) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3.<API key>( PARSER, input, extensionRegistry); } public static com.google.cloud.vision.v1.WebDetectionParams parseFrom( com.google.protobuf.CodedInputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3.<API key>(PARSER, input); } public static com.google.cloud.vision.v1.WebDetectionParams parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.<API key> extensionRegistry) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3.<API key>( PARSER, input, extensionRegistry); } @java.lang.Override public Builder newBuilderForType() { return newBuilder(); } public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } public static Builder newBuilder(com.google.cloud.vision.v1.WebDetectionParams prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } @java.lang.Override public Builder toBuilder() { return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } @java.lang.Override protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { Builder builder = new Builder(parent); return builder; } /** * * * <pre> * Parameters for web detection request. * </pre> * * Protobuf type {@code google.cloud.vision.v1.WebDetectionParams} */ public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder<Builder> implements // @@<API key>(builder_implements:google.cloud.vision.v1.WebDetectionParams) com.google.cloud.vision.v1.<API key> { public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.google.cloud.vision.v1.ImageAnnotatorProto .<API key>; } @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable <API key>() { return com.google.cloud.vision.v1.ImageAnnotatorProto .<API key> .<API key>( com.google.cloud.vision.v1.WebDetectionParams.class, com.google.cloud.vision.v1.WebDetectionParams.Builder.class); } // Construct using com.google.cloud.vision.v1.WebDetectionParams.newBuilder() private Builder() { <API key>(); } private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { super(parent); <API key>(); } private void <API key>() { if (com.google.protobuf.GeneratedMessageV3.<API key>) {} } @java.lang.Override public Builder clear() { super.clear(); includeGeoResults_ = false; return this; } @java.lang.Override public com.google.protobuf.Descriptors.Descriptor <API key>() { return com.google.cloud.vision.v1.ImageAnnotatorProto .<API key>; } @java.lang.Override public com.google.cloud.vision.v1.WebDetectionParams <API key>() { return com.google.cloud.vision.v1.WebDetectionParams.getDefaultInstance(); } @java.lang.Override public com.google.cloud.vision.v1.WebDetectionParams build() { com.google.cloud.vision.v1.WebDetectionParams result = buildPartial(); if (!result.isInitialized()) { throw <API key>(result); } return result; } @java.lang.Override public com.google.cloud.vision.v1.WebDetectionParams buildPartial() { com.google.cloud.vision.v1.WebDetectionParams result = new com.google.cloud.vision.v1.WebDetectionParams(this); result.includeGeoResults_ = includeGeoResults_; onBuilt(); return result; } @java.lang.Override public Builder clone() { return (Builder) super.clone(); } @java.lang.Override public Builder setField( com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { return (Builder) super.setField(field, value); } @java.lang.Override public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { return (Builder) super.clearField(field); } @java.lang.Override public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { return (Builder) super.clearOneof(oneof); } @java.lang.Override public Builder setRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { return (Builder) super.setRepeatedField(field, index, value); } @java.lang.Override public Builder addRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { return (Builder) super.addRepeatedField(field, value); } @java.lang.Override public Builder mergeFrom(com.google.protobuf.Message other) { if (other instanceof com.google.cloud.vision.v1.WebDetectionParams) { return mergeFrom((com.google.cloud.vision.v1.WebDetectionParams) other); } else { super.mergeFrom(other); return this; } } public Builder mergeFrom(com.google.cloud.vision.v1.WebDetectionParams other) { if (other == com.google.cloud.vision.v1.WebDetectionParams.getDefaultInstance()) return this; if (other.<API key>() != false) { <API key>(other.<API key>()); } this.mergeUnknownFields(other.unknownFields); onChanged(); return this; } @java.lang.Override public final boolean isInitialized() { return true; } @java.lang.Override public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.<API key> extensionRegistry) throws java.io.IOException { com.google.cloud.vision.v1.WebDetectionParams parsedMessage = null; try { parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); } catch (com.google.protobuf.<API key> e) { parsedMessage = (com.google.cloud.vision.v1.WebDetectionParams) e.<API key>(); throw e.unwrapIOException(); } finally { if (parsedMessage != null) { mergeFrom(parsedMessage); } } return this; } private boolean includeGeoResults_; /** * * * <pre> * Whether to include results derived from the geo information in the image. * </pre> * * <code>bool include_geo_results = 2;</code> */ public boolean <API key>() { return includeGeoResults_; } /** * * * <pre> * Whether to include results derived from the geo information in the image. * </pre> * * <code>bool include_geo_results = 2;</code> */ public Builder <API key>(boolean value) { includeGeoResults_ = value; onChanged(); return this; } /** * * * <pre> * Whether to include results derived from the geo information in the image. * </pre> * * <code>bool include_geo_results = 2;</code> */ public Builder <API key>() { includeGeoResults_ = false; onChanged(); return this; } @java.lang.Override public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { return super.<API key>(unknownFields); } @java.lang.Override public final Builder mergeUnknownFields( final com.google.protobuf.UnknownFieldSet unknownFields) { return super.mergeUnknownFields(unknownFields); } // @@<API key>(builder_scope:google.cloud.vision.v1.WebDetectionParams) } // @@<API key>(class_scope:google.cloud.vision.v1.WebDetectionParams) private static final com.google.cloud.vision.v1.WebDetectionParams DEFAULT_INSTANCE; static { DEFAULT_INSTANCE = new com.google.cloud.vision.v1.WebDetectionParams(); } public static com.google.cloud.vision.v1.WebDetectionParams getDefaultInstance() { return DEFAULT_INSTANCE; } private static final com.google.protobuf.Parser<WebDetectionParams> PARSER = new com.google.protobuf.AbstractParser<WebDetectionParams>() { @java.lang.Override public WebDetectionParams parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.<API key> extensionRegistry) throws com.google.protobuf.<API key> { return new WebDetectionParams(input, extensionRegistry); } }; public static com.google.protobuf.Parser<WebDetectionParams> parser() { return PARSER; } @java.lang.Override public com.google.protobuf.Parser<WebDetectionParams> getParserForType() { return PARSER; } @java.lang.Override public com.google.cloud.vision.v1.WebDetectionParams <API key>() { return DEFAULT_INSTANCE; } }
class <API key> < <API key> def new_download @system_security_key = SystemSecurityKey.new end def download if current_user.valid_password?(<API key>[:admin_password]) result = Engines::ApiLoader.instance.engines_api.<API key> if result.is_a? EnginesOSapiResult redirect_to <API key>, alert: 'Engines API error. ' + (result.result_mesg) else send_data result, :filename => "engines_private_key.rsa" end else redirect_to <API key>, alert: 'Admin password incorrect' end end def new @system_security_key = SystemSecurityKey.new end def create @system_security_key = SystemSecurityKey.new(<API key>) if @system_security_key.save redirect_to <API key>, notice: 'Successfully uploaded public key.' else render :new end end private def <API key> params.require(:system_security_key).permit! end end
package server //go:generate counterfeiter -o mock/signer_identity.go -fake-name SignerIdentity . SignerIdentity type Signer interface { // Sign signs the given payload and returns a signature Sign([]byte) ([]byte, error) } // SignerIdentity signs messages and serializes its public identity to bytes type SignerIdentity interface { Signer // Serialize returns a byte representation of this identity which is used to verify // messages signed by this SignerIdentity Serialize() ([]byte, error) }
package org.tanmayra.multitenant; import java.io.IOException; import java.io.InputStream; import java.util.logging.Level; import java.util.logging.Logger; import javax.faces.context.FacesContext; import javax.servlet.ServletContext; import org.tanmayra.multitenant.WebTenantResolver.TenantResolver; /** * * @author prashant */ class <API key> { private static final Logger LOGGER = Logger.getLogger(<API key>.class.getName()); private <API key>() {} static void setup(FacesContext context) { ServletContext servletContext = (ServletContext) context.getExternalContext().getContext(); <API key>(servletContext); } static void setup(ServletContext servletContext) { <API key>(servletContext); } private static void <API key>(ServletContext context) { String value = null; value = context.getInitParameter(TenantContextParams.TENANT_RESOLVER); value = (value != null) ? value.toUpperCase() : TenantResolver.THREAD.toString(); TenantResolver resolverStrategy = WebTenantResolver.TenantResolver.valueOf(value); WebTenantResolver.setResolverStrategy(resolverStrategy); value = context.getInitParameter(TenantContextParams.TENANT_PROPERTIES); value = (value != null) ? value : ("/" + TenantContextParams.<API key>); TenantProperties props = <API key>(value); WebTenantResolver.registerTenants(props); } private static TenantProperties <API key>(String value) { TenantProperties tenantProperties = new TenantProperties(); InputStream is = <API key>.class.getResourceAsStream(value); try { tenantProperties.load(is); } catch (IOException ex) { LOGGER.log(Level.SEVERE, "Couldn't load property resource " + value, ex); } if (is != null) { try { is.close(); } catch (IOException e) { } } return tenantProperties; } }
// <auto-generated /> // This file was generated by a T4 template. // Don't change it directly as your change would get overwritten. Instead, make changes // to the .tt file (i.e. the T4 template) and save it to regenerate this file. // Make sure the compiler doesn't complain about missing Xml comments and CLS compliance // 0108: suppress "Foo hides inherited member Foo. Use the new keyword if hiding was intended." when a controller and its abstract parent are both processed // 0114: suppress "Foo.BarController.Baz()' hides inherited member 'Qux.BarController.Baz()'. To make the current member override that implementation, add the override keyword. Otherwise add the new keyword." when an action (with an argument) overrides an action in a parent controller #pragma warning disable 1591, 3008, 3009, 0108, 0114 #region T4MVC using System; using System.Diagnostics; using System.CodeDom.Compiler; using System.Collections.Generic; using System.Linq; using System.Runtime.CompilerServices; using System.Threading.Tasks; using System.Web; using System.Web.Hosting; using System.Web.Mvc; using System.Web.Mvc.Ajax; using System.Web.Mvc.Html; using System.Web.Routing; using T4MVC; namespace T4MVCHostMvcApp.Controllers { public partial class <API key> { [GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode] protected <API key>(Dummy d) { } [GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode] protected <API key> RedirectToAction(ActionResult result) { var callInfo = result.GetT4MVCResult(); return RedirectToRoute(callInfo.<API key>); } [GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode] protected <API key> RedirectToAction(Task<ActionResult> taskResult) { return RedirectToAction(taskResult.Result); } [GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode] protected <API key> <API key>(ActionResult result) { var callInfo = result.GetT4MVCResult(); return <API key>(callInfo.<API key>); } [GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode] protected <API key> <API key>(Task<ActionResult> taskResult) { return <API key>(taskResult.Result); } [GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode] public <API key> Actions { get { return MVC.<API key>; } } [GeneratedCode("T4MVC", "2.0")] public readonly string Area = ""; [GeneratedCode("T4MVC", "2.0")] public readonly string Name = "<API key>"; [GeneratedCode("T4MVC", "2.0")] public const string NameConst = "<API key>"; [GeneratedCode("T4MVC", "2.0")] static readonly ActionNamesClass s_actions = new ActionNamesClass(); [GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode] public ActionNamesClass ActionNames { get { return s_actions; } } [GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode] public class ActionNamesClass { public readonly string DoStuff = "DoStuff"; } [GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode] public class ActionNameConstants { public const string DoStuff = "DoStuff"; } static readonly ViewsClass s_views = new ViewsClass(); [GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode] public ViewsClass Views { get { return s_views; } } [GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode] public class ViewsClass { static readonly _ViewNamesClass s_ViewNames = new _ViewNamesClass(); public _ViewNamesClass ViewNames { get { return s_ViewNames; } } public class _ViewNamesClass { } } } [GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode] public partial class <API key> : T4MVCHostMvcApp.Controllers.<API key> { public <API key>() : base(Dummy.Instance) { } [NonAction] partial void DoStuffOverride(<API key> callInfo); [NonAction] public override System.Web.Mvc.ActionResult DoStuff() { var callInfo = new <API key>(Area, Name, ActionNames.DoStuff); DoStuffOverride(callInfo); return callInfo; } } } #endregion T4MVC #pragma warning restore 1591, 3008, 3009, 0108, 0114
package galaxyspace.systems.SolarSystem.planets.overworld.items; import java.util.List; import javax.annotation.Nullable; import galaxyspace.core.util.GSCreativeTabs; import micdoodle8.mods.galacticraft.core.items.ISortableItem; import micdoodle8.mods.galacticraft.core.util.<API key>; import micdoodle8.mods.galacticraft.core.util.GCCoreUtil; import net.minecraft.client.util.ITooltipFlag; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.util.NonNullList; import net.minecraft.world.World; import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; public class ItemRocketParts extends Item implements ISortableItem { public static String[] names = { //"rocket_cone_tier_2", "rocket_body_tier_2", "<API key>", "<API key>", "<API key>", "rocket_cone_tier_3", "rocket_body_tier_3", "<API key>", "<API key>", "<API key>", "rocket_cone_tier_4", "rocket_body_tier_4", "<API key>", "<API key>", "<API key>", "rocket_cone_tier_5", "rocket_body_tier_5", "<API key>", "<API key>", "<API key>", "rocket_cone_tier_6", "rocket_body_tier_6", "<API key>", "<API key>", "<API key>" }; public ItemRocketParts() { this.setMaxDamage(0); this.setHasSubtypes(true); this.setMaxStackSize(64); this.setUnlocalizedName("rocket_parts"); this.setCreativeTab(GSCreativeTabs.GSItemsTab); } @Override public void getSubItems(CreativeTabs tab, NonNullList<ItemStack> list) { if (tab == GSCreativeTabs.GSItemsTab || tab == CreativeTabs.SEARCH) { for (int i = 0; i < this.names.length; i++) { list.add(new ItemStack(this, 1, i)); } } } @Override @SideOnly(Side.CLIENT) public void addInformation(ItemStack stack, @Nullable World worldIn, List<String> list, ITooltipFlag flagIn) { for(int i = 0; i < 5; i++) { if(stack.getItemDamage() == i) list.add(GCCoreUtil.translate("gui.tier3.desc")); else if(stack.getItemDamage() == i+5) list.add(GCCoreUtil.translate("gui.tier4.desc")); else if(stack.getItemDamage() == i+10) list.add(GCCoreUtil.translate("gui.tier5.desc")); else if(stack.getItemDamage() == i+15) list.add(GCCoreUtil.translate("gui.tier6.desc")); } } @Override public String getUnlocalizedName(ItemStack par1ItemStack) { for(int k = 0; k <= 4; k++) { if(par1ItemStack.getItemDamage() == k*5) return "item.rocket_cone"; if(par1ItemStack.getItemDamage() == k*5 + 1) return "item.rocket_body"; if(par1ItemStack.getItemDamage() == k*5 + 2) return "item.rocket_engine"; if(par1ItemStack.getItemDamage() == k*5 + 3) return "item.rocket_booster"; if(par1ItemStack.getItemDamage() == k*5 + 4) return "item.rocket_stabiliser"; } return "unnamed"; } @Override public int getMetadata(int par1) { return par1; } @Override public <API key> getCategory(int meta) { return <API key>.GENERAL; } }
package com.anttoolkit.aws.ec2.tasks.securitygroup.util; import java.util.*; import com.amazonaws.services.ec2.*; import com.amazonaws.services.ec2.model.*; import org.apache.tools.ant.*; public class Revoke { private List<InboundRequest> inbounds = new LinkedList<InboundRequest>(); private List<OutboundRequest> outbounds = new LinkedList<OutboundRequest>(); public void <API key>(InboundRequest request) { inbounds.add(request); } public void <API key>(OutboundRequest request) { outbounds.add(request); } public void revoke(String groupName, String groupId, AmazonEC2Client client) { for (InboundRequest request : inbounds) { <API key> revokeRequest = request.getRevokeRequest(groupName, groupId); try { client.<API key>(revokeRequest); } catch (Throwable e) { throw new BuildException("Failed to revoke inbound rule: " + revokeRequest.toString(), e); } } for (OutboundRequest request : outbounds) { <API key> revokeRequest = request.getRevokeRequest(groupId); try { client.<API key>(revokeRequest); } catch (Throwable e) { throw new BuildException("Failed to revoke outbound rule: " + revokeRequest.toString(), e); } } } }
using System; using OpenTK; using OpenTK.Graphics; using OpenTK.Graphics.OpenGL; using OpenTK.Audio; using OpenTK.Audio.OpenAL; using OpenTK.Input; using SimpleScene; namespace Example2DTileGame { partial class Example2DTileGame : OpenTK.GameWindow { FPSCalculator fpsCalc = new FPSCalculator(); SSCameraThirdPerson camera; float <API key>; <summary> Called when it is time to render the next frame. Add your rendering code here. </summary> <param name="e">Contains timing information.</param> protected override void OnRenderFrame (FrameEventArgs e) { base.OnRenderFrame (e); // NOTE: this is a workaround for the fact that the ThirdPersonCamera is not parented to the target... // before we can remove this, we need to parent it properly, currently it's transform only follows // the target during Update() and input event processing. scene.Update ((float)e.Time); fpsCalc.newFrame (e.Time); fpsDisplay.Label = String.Format ("FPS: {0:0.00}", fpsCalc.AvgFramesPerSecond); // clear the render buffer.... GL.Enable (EnableCap.DepthTest); GL.DepthMask (true); GL.ClearColor (0.0f, 0.0f, 0.0f, 0.0f); // black //GL.ClearColor (System.Drawing.Color.Black); GL.Clear (ClearBufferMask.ColorBufferBit | ClearBufferMask.DepthBufferBit); float fovy = (float)Math.PI / 4; float aspect = ClientRectangle.Width / (float)ClientRectangle.Height; // rendering the "main" 3d scene.... { GL.Enable (EnableCap.CullFace); GL.CullFace (CullFaceMode.Back); GL.Enable (EnableCap.DepthTest); GL.Enable (EnableCap.DepthClamp); GL.DepthMask (true); // setup the inverse matrix of the active camera... scene.InvCameraViewMatrix = scene.ActiveCamera.worldMat.Inverted (); // scene.renderConfig.<API key> = true; // setup the view projection. technically only need to do this on window resize.. Matrix4 projection = Matrix4.<API key> (fovy, aspect, 1.0f, 500.0f); //projection = Matrix4.CreateTranslation (0, 0, -5) * projection; scene.ProjectionMatrix = projection; // render 3d content... scene.Render (); } // render HUD scene { GL.Disable (EnableCap.DepthTest); GL.Disable (EnableCap.CullFace); GL.DepthMask (false); // setup an orthographic projection looking down the +Z axis, same as: // GL.Ortho (0, ClientRectangle.Width, ClientRectangle.Height, 0, -1, 1); hudScene.InvCameraViewMatrix = Matrix4.<API key>(0, ClientRectangle.Width, ClientRectangle.Height, 0, -1, 1); hudScene.Render (); } SwapBuffers(); } <summary> Called when your window is resized. Set your viewport here. It is also a good place to set up your projection matrix (which probably changes along when the aspect ratio of your window). </summary> <param name="e">Not used.</param> protected override void OnResize(EventArgs e) { base.OnResize(e); this.mouseButtonDown = false; // hack to fix resize mouse issue.. // setup the viewport projection GL.Viewport(ClientRectangle.X, ClientRectangle.Y, ClientRectangle.Width, ClientRectangle.Height); } } }
package com.digitaslbi.selenium.common.selectables; import org.openqa.selenium.By; public interface Dismissible extends Selectable{ By getDismissBy(); }
package com.thingtrack.konekti.service.impl.internal; import java.util.Date; import java.util.List; import org.springframework.beans.factory.annotation.Autowired; import com.thingtrack.konekti.dao.api.JobDao; import com.thingtrack.konekti.domain.Area; import com.thingtrack.konekti.domain.Job; import com.thingtrack.konekti.domain.User; import com.thingtrack.konekti.service.api.JobService; public class JobServiceImpl implements JobService { @Autowired private JobDao jobDao; @Override public List<Job> getAll() throws Exception { return this.jobDao.getAll(); } @Override public Job get(Integer jobId) throws Exception { return this.jobDao.get(jobId); } @Override public Job save(Job job) throws Exception { return this.jobDao.save(job); } @Override public void delete(Job job) throws Exception { this.jobDao.delete(job); } @Override public List<Job> getAll(User user) throws Exception { return this.jobDao.getAll(user); } @Override public List<Job> getByGroupName(String group, String name) throws Exception { return jobDao.getByGroupName(group, name); } @Override public Job <API key>(Integer areaId, String group, String name) throws Exception { return jobDao.<API key>(areaId, group, name); } @Override public void setLastExecution(Job job) throws Exception { job.setLastExecution(new Date()); jobDao.save(job); } @Override public void setLastExecution(Job job, Boolean error) throws Exception { job.setLastExecution(new Date()); job.setError(error); jobDao.save(job); } @Override public void setOkStatus(Job job) throws Exception { job.setError(false); jobDao.save(job); } @Override public void setErrorStatus(Job job) throws Exception { job.setError(true); jobDao.save(job); } @Override public Job createNewEntity(Area area) throws Exception { Job job = new Job(); job.setActive(true); job.setArea(area); return job; } }
# Unless required by applicable law or agreed to in writing, software # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. import mock import unittest from google.cloud import bigquery from google.cloud.bigquery.job import ExtractJobConfig, DestinationFormat from google.api_core import exceptions from kfp_component.google.bigquery import query CREATE_JOB_MODULE = 'kfp_component.google.bigquery._query' @mock.patch(CREATE_JOB_MODULE + '.display.display') @mock.patch(CREATE_JOB_MODULE + '.gcp_common.dump_file') @mock.patch(CREATE_JOB_MODULE + '.KfpExecutionContext') @mock.patch(CREATE_JOB_MODULE + '.bigquery.Client') class TestQuery(unittest.TestCase): def test_query_succeed(self, mock_client, mock_kfp_context, mock_dump_json, mock_display): mock_kfp_context().__enter__().context_id.return_value = 'ctx1' mock_client().get_job.side_effect = exceptions.NotFound('not found') mock_dataset = bigquery.DatasetReference('project-1', 'dataset-1') mock_client().dataset.return_value = mock_dataset mock_client().get_dataset.side_effect = exceptions.NotFound('not found') mock_response = { 'configuration': { 'query': { 'query': 'SELECT * FROM table_1' } } } mock_client().query.return_value.to_api_repr.return_value = mock_response result = query('SELECT * FROM table_1', 'project-1', 'dataset-1', output_gcs_path='gs://output/path') self.assertEqual(mock_response, result) mock_client().create_dataset.assert_called() expected_job_config = bigquery.QueryJobConfig() expected_job_config.create_disposition = bigquery.job.CreateDisposition.CREATE_IF_NEEDED expected_job_config.write_disposition = bigquery.job.WriteDisposition.WRITE_TRUNCATE expected_job_config.destination = mock_dataset.table('query_ctx1') mock_client().query.assert_called_with('SELECT * FROM table_1',mock.ANY, job_id = 'query_ctx1') actual_job_config = mock_client().query.call_args_list[0][0][1] self.assertDictEqual( expected_job_config.to_api_repr(), actual_job_config.to_api_repr() ) extract = mock_client().extract_table.call_args_list[0] self.assertEqual(extract[0], (mock_dataset.table('query_ctx1'), 'gs://output/path',)) self.assertEqual(extract[1]["job_config"].destination_format, "CSV",) def <API key>(self, mock_client, mock_kfp_context, mock_dump_json, mock_display): mock_kfp_context().__enter__().context_id.return_value = 'ctx1' mock_client().get_job.side_effect = exceptions.NotFound('not found') mock_dataset = bigquery.DatasetReference('project-1', 'dataset-1') mock_client().dataset.return_value = mock_dataset mock_client().get_dataset.return_value = bigquery.Dataset(mock_dataset) mock_response = { 'configuration': { 'query': { 'query': 'SELECT * FROM table_1' } } } mock_client().query.return_value.to_api_repr.return_value = mock_response result = query('SELECT * FROM table_1', 'project-1', 'dataset-1', 'table-1') self.assertEqual(mock_response, result) mock_client().create_dataset.assert_not_called() mock_client().extract_table.assert_not_called() expected_job_config = bigquery.QueryJobConfig() expected_job_config.create_disposition = bigquery.job.CreateDisposition.CREATE_IF_NEEDED expected_job_config.write_disposition = bigquery.job.WriteDisposition.WRITE_TRUNCATE expected_job_config.destination = mock_dataset.table('table-1') mock_client().query.assert_called_with('SELECT * FROM table_1',mock.ANY, job_id = 'query_ctx1') actual_job_config = mock_client().query.call_args_list[0][0][1] self.assertDictEqual( expected_job_config.to_api_repr(), actual_job_config.to_api_repr() ) def <API key>(self, mock_client, mock_kfp_context, mock_dump_json, mock_display): mock_kfp_context().__enter__().context_id.return_value = 'ctx1' mock_client().get_job.side_effect = exceptions.NotFound('not found') mock_dataset = bigquery.DatasetReference('project-1', 'dataset-1') mock_client().dataset.return_value = mock_dataset mock_client().get_dataset.side_effect = exceptions.NotFound('not found') mock_response = { 'configuration': { 'query': { 'query': 'SELECT * FROM table_1' } } } mock_client().query.return_value.to_api_repr.return_value = mock_response result = query('SELECT * FROM table_1', 'project-1', 'dataset-1', output_gcs_path='gs://output/path', <API key>="<API key>") self.assertEqual(mock_response, result) mock_client().create_dataset.assert_called() extract = mock_client().extract_table.call_args_list[0] self.assertEqual(extract[0], (mock_dataset.table('query_ctx1'), 'gs://output/path',)) self.assertEqual(extract[1]["job_config"].destination_format, "<API key>",)
<?php class MapController extends Controller { public function indexAction() { $this->view->setTitle('Карты миграции данных'); if (!empty($_POST['type'])) { foreach ($_POST['type'] as $pathId => $objectType) { $mapPath = Migrations\Migration\Map\Path::get($pathId); if (is_numeric($objectType)) { $mapPath->object_id = $objectType; $mapPath->type = 'object'; } else { if ($objectType == 'object') { $object = new Migrations\Migration\Object(); $object->model = !empty($_POST['typeOptions'][$pathId]) ? $_POST['typeOptions'][$pathId] : ''; $object->migration_id = $mapPath->map->migration_id; $object->code = $object->name = $mapPath->item; $object->save(); $mapPath->type = 'object'; $mapPath->object_id = $object->id; } else { $mapPath->type = $objectType; } } $mapPath->save(); } } if (!empty($_POST['param'])) { foreach ($_POST['param'] as $paramId => $type) { $param = \Migrations\Migration\Object\Param::get($paramId); if ($type == 'newObject') { $object = new Migrations\Migration\Object(); $object->model = !empty($_POST['paramOptions'][$paramId]) ? $_POST['paramOptions'][$paramId] : ''; $object->migration_id = $param->object->migration_id; $object->code = $object->name = $param->code; $object->save(); $param->type = 'object'; $param->value = $object->id; } else { $param->type = $type; $param->value = !empty($_POST['paramOptions'][$paramId]) ? $_POST['paramOptions'][$paramId] : ''; } $param->save(); } } $models = $this->modules->getSelectListModels(); $map = \Migrations\Migration\Map::get($_GET['item_pk']); $objects = $map->migration->objects(['forSelect' => true]); $this->view->page(['data' => compact('map', 'models', 'objects')]); } }
<?php namespace Swagger\Client; /** * CardInfoTest Class Doc Comment * * @category Class */ // * @description CardInfo class CardInfoTest extends \<API key> { /** * Setup before running any test case */ public static function setUpBeforeClass() { } /** * Setup before running each test case */ public function setUp() { } /** * Clean up after running each test case */ public function tearDown() { } /** * Clean up after running all test cases */ public static function tearDownAfterClass() { } /** * Test "CardInfo" */ public function testCardInfo() { } /** * Test attribute "cardHolderFullName" */ public function <API key>() { } /** * Test attribute "cardNumber" */ public function <API key>() { } /** * Test attribute "expiry" */ public function testPropertyExpiry() { } /** * Test attribute "cardCVV" */ public function testPropertyCardCVV() { } }
package com.example.administrator.zhihuidianti.activity.other; import android.app.Dialog; import android.content.Context; import android.view.Gravity; import android.view.LayoutInflater; import android.view.View; import android.view.WindowManager.LayoutParams; import android.widget.TextView; import com.example.administrator.zhihuidianti.R; public class LoadingDialog extends Dialog { private Context mContext; private LayoutInflater inflater; private LayoutParams lp; private TextView loadtext; public LoadingDialog(Context context) { super(context, R.style.Dialog); this.mContext = context; inflater = (LayoutInflater) mContext.getSystemService(Context.<API key>); View layout = inflater.inflate(R.layout.loadingdialog, null); loadtext = (TextView) layout.findViewById(R.id.loading_text); setContentView(layout); // window lp = getWindow().getAttributes(); lp.gravity = Gravity.CENTER; lp.dimAmount = 0.3f; lp.alpha = 1.0f; getWindow().setAttributes(lp); // this.setCancelable(false); this.<API key>(false); } public void setLoadText(String content){ loadtext.setText(content); } }
import queue import sys import threading import traceback from halocoin import tools from halocoin.ntwrk.message import Order class NoExceptionQueue(queue.Queue): """ In some cases, queue overflow is ignored. Necessary try, except blocks make the code less readable. This is a special queue class that simply ignores overflow. """ def __init__(self, maxsize=0): queue.Queue.__init__(self, maxsize) def put(self, item, block=True, timeout=None): try: queue.Queue.put(self, item, block, timeout) except queue.Full: pass class Service: """ Service is a background job synchronizer. It consists of an event loop, side threads and annotation helpers. Event loop starts listening for upcoming events after registration. If service is alive, all annotated methods are run in background thread and results return depending on annotation type. Side threads are executed repeatedly until service shuts down or thread is forcefully closed from another thread. Each side-thread should also check for infinite loops. """ INIT = 0 RUNNING = 1 STOPPED = 2 TERMINATED = 3 def __init__(self, name): self.event_thread = threading.Thread() self.into_service_queue = NoExceptionQueue(1000) self.signals = {} self.service_responses = {} self.name = name self.__state = None self.execution_lock = threading.Lock() self.__threads = {} def register(self): def service_target(service): service.set_state(Service.RUNNING) while service.get_state() == Service.RUNNING: try: order = service.into_service_queue.get(timeout=1) if isinstance(order, Order): result = Service.execute_order(service, order) self.service_responses[order.id] = result self.signals[order.id].set() service.into_service_queue.task_done() except TypeError: service.set_state(Service.STOPPED) self.service_responses[order.id] = True self.signals[order.id].set() except queue.Empty: pass def threaded_wrapper(func): def insider(*args, **kwargs): while self.__threads[func.__name__]["running"]: try: func(*args, **kwargs) except Exception as e: tools.log('Exception occurred at thread {}\n{}'.format(func.__name__, traceback.format_exc())) return 0 return insider cont = self.on_register() if not cont: tools.log("Service is not going to continue with registering!") return False # Start event loop self.event_thread = threading.Thread(target=service_target, args=(self,), name=self.name) self.event_thread.start() # Start all side-threads for clsMember in self.__class__.__dict__.values(): if hasattr(clsMember, "decorator") and clsMember.decorator == threaded.__name__: new_thread = threading.Thread(target=threaded_wrapper(clsMember._original), args=(self,), name=clsMember._original.__name__) self.__threads[clsMember._original.__name__] = { "running": True, "thread": new_thread } new_thread.start() return True # Lifecycle events def on_register(self): """ Called just before registration starts. :return: bool indicating whether registration should continue """ return True def on_close(self): """ Called after everything is shut down. :return: Irrelevant """ return True def join(self): """ Join all side-threads and event loop in the end. :return: None """ for thread_dict in self.__threads.values(): thread_dict["thread"].join() self.into_service_queue.join() # If join is called from the service instance, there is no need to join. # Thread wants to destory itself if threading.current_thread().name != self.event_thread.name: self.event_thread.join() def unregister(self, join=False): """ Disconnect the service background operations. Close and join all side-threads and event loop. :return: None """ self.execute('<API key>', True, args=(), kwargs={}) if join: self.join() self.on_close() def execute(self, action, expect_result, args, kwargs): """ Execute an order that is triggered by annotated methods. This method should be treated as private. :param action: Action name :param expect_result: Whether to wait for result of action :param args: Argument list for method :param kwargs: Keyword argument list for method :return: result of action or None """ if self.get_state() != Service.RUNNING: return None result = None new_order = Order(action, args, kwargs) # This is already event thread and someone called a synced function. # We can run it now. if threading.current_thread().name == self.event_thread.name: result = Service.execute_order(self, new_order) return result self.signals[new_order.id] = threading.Event() self.into_service_queue.put(new_order) if expect_result: try: if self.signals[new_order.id].wait(): response = self.service_responses[new_order.id] del self.signals[new_order.id] del self.service_responses[new_order.id] result = response else: tools.log('Service wait timed out', self.__class__.__name__) except: tools.log(sys.exc_info()) pass return result @staticmethod def execute_order(service, order): """ Directly executes the order on service instance. Makes no thread checks, no synchronization attempts. :param service: Service instance :param order: Order object :return: result of the execution """ result = False if order.action == '__close_threaded__': result = True service.__threads[order.args[0]]["running"] = False elif order.action == '<API key>': result = True service.set_state(Service.STOPPED) elif hasattr(service, order.action): try: result = getattr(service, order.action)._original(service, *order.args, **order.kwargs) except: result = None tools.log(sys.exc_info()) return result def get_state(self): # () -> (INIT|RUNNING|STOPPED|TERMINATED) """ :return: State of the service """ return self.__state def set_state(self, state): # (INIT|RUNNING|STOPPED|TERMINATED) -> () """ Set the current state of the service. This should never be used outside of the service. Treat as private method. :param state: New state :return: None """ if state == Service.STOPPED or state == Service.TERMINATED: tools.log('{} got stopped'.format(self.__class__.__name__)) for thread_name in self.__threads.keys(): self.__threads[thread_name]["running"] = False self.__state = state def close_threaded(self): """ Close current side-thread. :return: None """ thread_name = threading.current_thread().name self.execute(action='__close_threaded__', expect_result=True, args=(thread_name,), kwargs={}) def threaded_running(self): """ Should only be used by side-threads to check if it is still alive. Any inner loop can be cancelled. :return: is current side-thread should continue to run """ thread_name = threading.current_thread().name is_service_running = (self.get_state() == Service.RUNNING) try: return self.__threads[thread_name]["running"] and is_service_running except: return True def sync(func): """ Decorator for any service method that needs to run in the event loop. Results return after execution. :param func: Function to be decorated :return: Decorated version of function """ def wrapper(self, *args, **kwargs): return self.execute(func.__name__, True, args=args, kwargs=kwargs) wrapper._original = func wrapper.thread_safe = True return wrapper def async(func): """ Decorator for any service method that needs to run in the event loop. Results do not return after execution. :param func: Function to be decorated :return: Decorated version of function """ def wrapper(self, *args, **kwargs): return self.execute(func.__name__, False, args=args, kwargs=kwargs) wrapper._original = func wrapper.thread_safe = True return wrapper def threaded(func): """ This is just a marker decorator. It removes all the functionality but adds a decorator marker so that it can be registered as a new thread Given method assumed to be running indefinitely until a closing signal is given. That's why threaded methods should define their own while or for loop. Instead, signal close by using an if condition at the start of the method. Close signal can be given out by Service.close_threaded() :param func: Function to be marked :return: useless function that is marked """ def wrapper(self, *args, **kwargs): import warnings warnings.warn('Threaded methods should not be executed directly.') return None wrapper.decorator = threaded.__name__ wrapper._original = func return wrapper locks = {} class LockException(Exception): def __init__(self, message): Exception.__init__(self, message) def lockit(lock_name, timeout=-1): def _lockit(func): """ Decorator for any service method that needs to run in the event loop. Results return after execution. :param func: Function to be decorated :return: Decorated version of function """ def wrapper(self, *args, **kwargs): global locks if '__lock_{}__'.format(lock_name) in locks.keys(): mylock = locks['__lock_{}__'.format(lock_name)] else: mylock = threading.RLock() locks['__lock_{}__'.format(lock_name)] = mylock is_acquired = mylock.acquire(timeout=timeout) if is_acquired: result = func(self, *args, **kwargs) else: raise LockException('Lock named {} could not be acquired in the given time'.format(lock_name)) mylock.release() return result wrapper._original = func wrapper.thread_safe = True wrapper.__name__ = func.__name__ return wrapper return _lockit
// // // If it's not then please replace this with with your hosting url. var request = require('request'); var options = { 'method': 'GET', 'url': 'https://localhost/file/upload/get-presigned-url?name=test.pdf&encrypt=true', 'headers': { 'x-api-key': '{{x-api-key}}' }, formData: { } }; request(options, function (error, response) { if (error) throw new Error(error); console.log(response.body); });
using System; using UnityEngine; using System.Collections; using System.IO; using KEngine; <summary> </summary> public class TextureHelper { <summary> IO </summary> public static void LoadByIO(string fullFilePath, Action<Texture2D> callback, int width, int height) { if (string.IsNullOrEmpty(fullFilePath)) { Log.LogError("!"); if (callback != null) callback(null); return; } double startTime = (double)Time.time; FileStream fileStream = new FileStream(fullFilePath, FileMode.Open, FileAccess.Read); fileStream.Seek(0, SeekOrigin.Begin); byte[] bytes = new byte[fileStream.Length]; fileStream.Read(bytes, 0, (int)fileStream.Length); fileStream.Close(); fileStream.Dispose(); fileStream = null; //Texture Texture2D texture = new Texture2D(width, height); texture.LoadImage(bytes); if (callback != null) callback(texture); startTime = (double)Time.time - startTime; Log.Debug("IO:" + startTime); } <summary> WWW </summary> <param name="fullFilePath"></param> <returns></returns> public static IEnumerator LoadByWWW(string fullFilePath, Action<Texture2D> callback) { double startTime = (double)Time.time; string loadPath = string.Empty; #if UNITY_EDITOR_WIN loadPath = "file:///" + fullFilePath; #else loadPath = "file://" + fullFilePath; #endif //WWW WWW www = new WWW(loadPath); yield return www; if (www != null && string.IsNullOrEmpty(www.error)) { //Texture Texture2D texture = www.texture; if (callback != null) callback(texture); startTime = (double)Time.time - startTime; Log.Debug("WWW:" + startTime); } else { Log.LogError("www :{0}", www.error); if (callback != null) callback(null); } } public static Sprite Texture2Sprite(Texture2D texture) { if (texture == null) return null; return Sprite.Create(texture, new Rect(0, 0, texture.width, texture.height), new Vector2(0.5f, 0.5f)); } }
+function(c){function h(a){var b;a=a.attr("data-target")||(b=a.attr("href"))&&b.replace(/.*(?=#[^\s]+$)/,"");return c(a)}function g(a){return this.each(function(){var b=c(this),f=b.data("bs.collapse"),e=c.extend({},d.DEFAULTS,b.data(),"object"==typeof a&&a);!f&&e.toggle&&/show|hide/.test(a)&&(e.toggle=!1);f||b.data("bs.collapse",f=new d(this,e));if("string"==typeof a)f[a]()})}var d=function(a,b){this.$element=c(a);this.options=c.extend({},d.DEFAULTS,b);this.$trigger=c('[data-toggle="collapse"][href="#'+ a.id+'"],[data-toggle="collapse"][data-target="#'+a.id+'"]');this.transitioning=null;this.options.parent?this.$parent=this.getParent():this.<API key>(this.$element,this.$trigger);this.options.toggle&&this.toggle()};d.VERSION="3.3.7";d.TRANSITION_DURATION=350;d.DEFAULTS={toggle:!0};d.prototype.dimension=function(){return this.$element.hasClass("width")?"width":"height"};d.prototype.show=function(){if(!this.transitioning&&!this.$element.hasClass("in")){var a,b=this.$parent&&this.$parent.children(".panel").children(".in, .collapsing"); if(b&&b.length&&(a=b.data("bs.collapse"))&&a.transitioning)return;var f=c.Event("show.bs.collapse");this.$element.trigger(f);if(!f.isDefaultPrevented()){b&&b.length&&(g.call(b,"hide"),a||b.data("bs.collapse",null));var e=this.dimension();this.$element.removeClass("collapse").addClass("collapsing")[e](0).attr("aria-expanded",!0);this.$trigger.removeClass("collapsed").attr("aria-expanded",!0);this.transitioning=1;a=function(){this.$element.removeClass("collapsing").addClass("collapse in")[e]("");this.transitioning= 0;this.$element.trigger("shown.bs.collapse")};if(!c.support.transition)return a.call(this);b=c.camelCase(["scroll",e].join("-"));this.$element.one("bsTransitionEnd",c.proxy(a,this)).<API key>(d.TRANSITION_DURATION)[e](this.$element[0][b])}}};d.prototype.hide=function(){if(!this.transitioning&&this.$element.hasClass("in")){var a=c.Event("hide.bs.collapse");this.$element.trigger(a);if(!a.isDefaultPrevented()){a=this.dimension();this.$element[a](this.$element[a]())[0].offsetHeight;this.$element.addClass("collapsing").removeClass("collapse in").attr("aria-expanded", !1);this.$trigger.addClass("collapsed").attr("aria-expanded",!1);this.transitioning=1;var b=function(){this.transitioning=0;this.$element.removeClass("collapsing").addClass("collapse").trigger("hidden.bs.collapse")};if(!c.support.transition)return b.call(this);this.$element[a](0).one("bsTransitionEnd",c.proxy(b,this)).<API key>(d.TRANSITION_DURATION)}}};d.prototype.toggle=function(){this[this.$element.hasClass("in")?"hide":"show"]()};d.prototype.getParent=function(){return c(this.options.parent).find('[data-toggle="collapse"][data-parent="'+ this.options.parent+'"]').each(c.proxy(function(a,b){var d=c(b);this.<API key>(h(d),d)},this)).end()};d.prototype.<API key>=function(a,b){var c=a.hasClass("in");a.attr("aria-expanded",c);b.toggleClass("collapsed",!c).attr("aria-expanded",c)};var k=c.fn.collapse;c.fn.collapse=g;c.fn.collapse.Constructor=d;c.fn.collapse.noConflict=function(){c.fn.collapse=k;return this};c(document).on("click.bs.collapse.data-api",'[data-toggle="collapse"]',function(a){var b=c(this);b.attr("data-target")|| a.preventDefault();a=h(b);b=a.data("bs.collapse")?"toggle":b.data();g.call(a,b)})}(jQuery);
import numpy as np def get_triangles(npimage, depth=10): """ Makes upper left and lower right triangles. Takes in numpy array, returns array of triangles. Automatically excludes invalid triangles (triangles with one vertex off the edge) """ npimage = npimage + depth h, w = npimage.shape y, x = np.indices((h, w)) cube = np.dstack((x, y, npimage)) ults = np.zeros((h-1, w-1, 3, 4)) lrts = np.zeros((h-1, w-1, 3, 4)) ults[:,:,:,1] = cube[:-1,:-1] ults[:,:,:,2] = cube[:-1,1:] ults[:,:,:,3] = cube[1:,:-1] lrts[:,:,:,1] = cube[1:,1:] lrts[:,:,:,2] = cube[1:,:-1] lrts[:,:,:,3] = cube[:-1,1:] sides = make_sides(ults, lrts) ults = ults.reshape(((ults.shape[0])*(ults.shape[1]), 3, 4)) lrts = lrts.reshape(((lrts.shape[0])*(lrts.shape[1]), 3, 4)) triset = get_cross(np.concatenate((ults, lrts, sides))) triset = np.swapaxes(triset, 1, 2).copy() triset = np.concatenate((triset, make_bottom(h-1, w-1))) return normalize_triangles(triset) def make_sides(ults, lrts): """Creates the sides of the base.""" a = ults[0].copy() a[:,:,3] = a[:,:,1] a[:,2,3] = 0 b = ults[:,0].copy() b[:,:,2] = b[:,:,1] b[:,:,2][:,2] = 0 c = ults[-1].copy() c[:,1,1:3] = c[:,1,1:3] + 1 c[:,2,1:3] = 0 d = ults[:,-1].copy() d[:,0,1] = d[:,0,1] + 1 d[:,0,3] = d[:,0,3] + 1 d[:,2,1] = 0 d[:,2,3] = 0 e = lrts[0].copy() e[:,1,1:3] = e[:,1,1:3] - 1 e[:,2,1:3] = 0 f = lrts[:,0].copy() f[:,0,1] = f[:,0,1] - 1 f[:,0,3] = f[:,0,3] - 1 f[:,2,1] = 0 f[:,2,3] = 0 g = lrts[-1].copy() g[:,1,3] = g[:,1,3] + 1 g[:,2,3] = 0 h = lrts[:,-1].copy() h[:,0,2] = h[:,0,2] + 1 h[:,2,2] = 0 a[:,:,[1,2]] = a[:,:,[2,1]] b[:,:,[1,2]] = b[:,:,[2,1]] c[:,:,[1,2]] = c[:,:,[2,1]] d[:,:,[1,2]] = d[:,:,[2,1]] e[:,:,[1,2]] = e[:,:,[2,1]] f[:,:,[1,2]] = f[:,:,[2,1]] g[:,:,[1,2]] = g[:,:,[2,1]] h[:,:,[1,2]] = h[:,:,[2,1]] return np.concatenate((a, b, c, d, e, f, g, h)) def make_bottom(height, width): """Creates the bottom of the base""" bottom = np.array([[[width, 0, 0], [0, 0, 0], [0, height, 0]], \ [[width, height, 0], [width, 0, 0], [0, height, 0]]]) triset = np.zeros((2, 4, 3)) triset[0,1:] = bottom[0] triset[1,1:] = bottom[1] for tri in triset: v1 = tri[2] - tri[1] v2 = tri[3] - tri[1] tri[0] = np.cross(v1, v2) return triset def normalize_triangles(triset): """ Makes sure model can fit on MakerBot plate. Note: the sizing may be off when using different software or a different printer. All sizes are in mm not inches. """ xsize = triset[:,1:,0].ptp() if xsize > 140: triset = triset * 140 / float(xsize) ysize = triset[:,1:,1].ptp() if ysize > 140: triset = triset * 140 / float(ysize) zsize = triset[:,1:,2].ptp() if zsize > 100: triset = triset * 100 / float(zsize) return triset def get_cross(triset): """ Sets the normal vector for each triangle. This is necessary for some 3D printing software, including MakerWare. """ t1 = triset[:,:,1] t2 = triset[:,:,2] t3 = triset[:,:,3] v1 = t2 - t1 v2 = t3 - t1 triset[:,:,0] = np.cross(v1, v2) return triset def to_mesh(npimage, filename, depth=1, double=False, _ascii=False): """ Writes an npimage to stl file. Splits each pixel into two triangles. npimage - the image to convert represented as a numpy array. filename - a string naming the file to write to. File will write to current working directory unless another path is given. depth - the depth of the back plate. Should probably be between 10 and 30. A thicker plate gives greater stability, but uses more material and has a longer build time. For writing jpg or png images, a depth of 10 probably suffices. _ascii - gives option to write ascii stl file. By default it will write a binary stl file, which is harder to debug, but which takes up far less space. """ if not filename[-4:].lower() == '.stl': filename += '.stl' if isinstance(npimage, np.ma.core.MaskedArray): npimage = npimage.data triset = get_triangles(npimage, depth) if double: triset2 = triset.copy() triset2[:,0] = -triset2[:,0] triset2[:,1:,2] = -triset2[:,1:,2] triset = np.concatenate((triset, triset2)) write_binary(triset, filename) if not _ascii else write_ascii(triset, filename) def write_binary(triset, filename): """ Writes a binary stl file, given a set of triangles and normal vectors, along with a filename. """ triset = triset.astype('<f4') triset = triset.reshape((triset.shape[0], 12)) buff = np.zeros((triset.shape[0],), dtype=('f4,'*12+'i2')) for n in range(12): # Fills in array by column col = 'f' + str(n) buff[col] = triset[:,n] # Took the header straight from stl.py strhdr = "binary STL format" strhdr += (80-len(strhdr))*" " ntri = len(buff) larray = np.zeros((1,),dtype='<u4') larray[0] = ntri f = open(filename, 'wb') f.write(strhdr) f.write(larray.tostring()) buff.tofile(f) f.close() def write_ascii(triset, filename): """ Writes an ascii stl file, given a set of triangles and normal vectors, along with a filename. Generally good for debugging, results in a much bigger file. """ f = open(filename, 'w') f.write("solid bozo\n") for t in triset: f.write("facet normal %e %e %e\n" % tuple(t[0])) f.write("\touter loop\n") f.write("\t\tvertex %e %e %e\n" % tuple(t[1])) f.write("\t\tvertex %e %e %e\n" % tuple(t[2])) f.write("\t\tvertex %e %e %e\n" % tuple(t[3])) f.write("\tendloop\n") f.write("endfacet\n") f.write("endwolid bozo") f.close()
package cn.ian2018.whattoeat.bean; import cn.bmob.v3.BmobObject; public class Feedback extends BmobObject { private String info; private String phoneBrand; private String phoneBrandType; private String androidVersion; public String getInfo() { return info; } public void setInfo(String info) { this.info = info; } public String getPhoneBrand() { return phoneBrand; } public void setPhoneBrand(String phoneBrand) { this.phoneBrand = phoneBrand; } public String getPhoneBrandType() { return phoneBrandType; } public void setPhoneBrandType(String phoneBrandType) { this.phoneBrandType = phoneBrandType; } public String getAndroidVersion() { return androidVersion; } public void setAndroidVersion(String androidVersion) { this.androidVersion = androidVersion; } }
from enum import IntEnum class FingerPosition(IntEnum): VerticalUp = 0 VerticalDown = 1 HorizontalLeft = 2 HorizontalRight = 3 DiagonalUpRight = 4 DiagonalUpLeft = 5 DiagonalDownRight = 6 DiagonalDownLeft = 7 @staticmethod def <API key>(finger_position): if finger_position == FingerPosition.VerticalUp: finger_type = 'Vertical Up' elif finger_position == FingerPosition.VerticalDown: finger_type = 'Vertical Down' elif finger_position == FingerPosition.HorizontalLeft: finger_type = 'Horizontal Left' elif finger_position == FingerPosition.HorizontalRight: finger_type = 'Horizontal Right' elif finger_position == FingerPosition.DiagonalUpRight: finger_type = 'Diagonal Up Right' elif finger_position == FingerPosition.DiagonalUpLeft: finger_type = 'Diagonal Up Left' elif finger_position == FingerPosition.DiagonalDownRight: finger_type = 'Diagonal Down Right' elif finger_position == FingerPosition.DiagonalDownLeft: finger_type = 'Diagonal Down Left' return finger_type
var express = require('express'); var router = express.Router(); // Users var userController = require("../../controllers/api/Users/UserController.js"); router.get('/users', userController.getAll); router.get('/users/me', userController.getMe); router.post('/users', userController.signIn); router.post('/users/signOut', userController.signOut); router.put('/users', userController.update); router.route('/users/:id') .delete(userController.delete) .get(userController.get); // Suppliers var supplierController = require("../../controllers/api/SupplierController.js"); router.get('/suppliers', supplierController.getAll); router.post('/suppliers/signUp', supplierController.signUp); router.post('/suppliers/signIn', supplierController.signIn); router.post('/suppliers/signOut', supplierController.signOut); router.put('/suppliers', supplierController.update); router.route('/suppliers/:supplier_id') .delete(supplierController.delete) .get(supplierController.get); // Supplier router.route('/suppliers/events/:event_id/users') .get(supplierController.getAllUserEvent); router.get('/suppliers/events', supplierController.<API key>); router.get('/suppliers/locations', supplierController.<API key>); router.get('/suppliers/items', supplierController.<API key>); router.get('/suppliers/awards', supplierController.<API key>); router.get('/suppliers/notifications', supplierController.<API key>); router.get('/suppliers/me', supplierController.getMe); // Event var eventController = require("../../controllers/api/EventController"); router.post('/events', eventController.createEvent); router.route('/events/:event_id') .get(eventController.getDetail) .put(eventController.updateEvent) .delete(eventController.deleteEvent); router.get('/events', eventController.<API key>); // Tasks var taskController = require("../../controllers/api/TaskController"); router.route('/events/:event_id/tasks') .get(taskController.getAllOfEvent) .post(taskController.postTask); router.route('/events/:event_id/tasks/:task_id') .get(taskController.getTask) .put(taskController.updateTask) .delete(taskController.deleteTask) // Awards var awardController = require("../../controllers/api/AwardController"); router.post('/events/:event_id/awards', awardController.createAward) .get('/events/:event_id/awards', awardController.getAllOfEvent); router.route('/events/:event_id/awards/:award_id') .get(awardController.getDetail) .put(awardController.updateAward) .delete(awardController.deleteAward) // Locations var locationController = require("../../controllers/api/LocationController"); router.post('/locations', locationController.create); router.route('/locations/:location_id') .get(locationController.getDetail) .put(locationController.update) .delete(locationController.delete) // Items var itemController = require("../../controllers/api/ItemController"); router.post('/items', itemController.create); router.route('/items/:item_id') .get(itemController.getDetail) .put(itemController.update) .delete(itemController.delete); // Push notification var pushNotification = require("../../controllers/api/<API key>"); router.get('/suppliers/notifications',pushNotification.getNotification); router.post('/suppliers/notifications', pushNotification.createNotification); router.post('/suppliers/notifications/:notification_id', pushNotification.<API key>); var imageController = require("../../controllers/api/ImageController"); router.post('/images', imageController.postImage); router.get('/images', imageController.getImages); router.delete('/images/:image_id', imageController.deleteImage); // Staff router.get('/suppliers/staffs',supplierController.getAllStaff) .post('/suppliers/staffs',supplierController.createStaffAccount); router.route('/suppliers/staffs/:staff_id') .put(supplierController.updateStaff) .delete(supplierController.deleteStaffAcount) module.exports = router;
<!DOCTYPE HTML PUBLIC "- <!--NewPage <HTML> <HEAD> <!-- Generated by javadoc (build 1.6.0_20) on Tue Jul 19 23:14:39 CEST 2011 --> <TITLE> EjbLocalRefTypeImpl </TITLE> <META NAME="date" CONTENT="2011-07-19"> <LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../../../stylesheet.css" TITLE="Style"> <SCRIPT type="text/javascript"> function windowTitle() { if (location.href.indexOf('is-external=true') == -1) { parent.document.title="EjbLocalRefTypeImpl"; } } </SCRIPT> <NOSCRIPT> </NOSCRIPT> </HEAD> <BODY BGCOLOR="white" onload="windowTitle();"> <HR> <A NAME="navbar_top"></A> <A HREF="#skip-navbar_top" title="Skip navigation links"></A> <TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> <TR> <TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A NAME="navbar_top_firstrow"></A> <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> <TR ALIGN="center" VALIGN="top"> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="class-use/EjbLocalRefTypeImpl.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../index-files/index-1.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD> </TR> </TABLE> </TD> <TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> </EM> </TD> </TR> <TR> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> &nbsp;PREV CLASS&nbsp; &nbsp;<A HREF="../../../../../../org/jboss/shrinkwrap/descriptor/impl/javaee5/EjbRefTypeImpl.html" title="class in org.jboss.shrinkwrap.descriptor.impl.javaee5"><B>NEXT CLASS</B></A></FONT></TD> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../../../../index.html?org/jboss/shrinkwrap/descriptor/impl/javaee5/EjbLocalRefTypeImpl.html" target="_top"><B>FRAMES</B></A> &nbsp; &nbsp;<A HREF="EjbLocalRefTypeImpl.html" target="_top"><B>NO FRAMES</B></A> &nbsp; &nbsp;<SCRIPT type="text/javascript"> <! if(window==top) { document.writeln('<A HREF="../../../../../../allclasses-noframe.html"><B>All Classes</B></A>'); } </SCRIPT> <NOSCRIPT> <A HREF="../../../../../../allclasses-noframe.html"><B>All Classes</B></A> </NOSCRIPT> </FONT></TD> </TR> <TR> <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> SUMMARY:&nbsp;NESTED&nbsp;|&nbsp;FIELD&nbsp;|&nbsp;<A HREF="#constructor_summary">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD> <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> DETAIL:&nbsp;FIELD&nbsp;|&nbsp;<A HREF="#constructor_detail">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD> </TR> </TABLE> <A NAME="skip-navbar_top"></A> <HR> <H2> <FONT SIZE="-1"> org.jboss.shrinkwrap.descriptor.impl.javaee5</FONT> <BR> Class EjbLocalRefTypeImpl&lt;T&gt;</H2> <PRE> java.lang.Object <IMG SRC="../../../../../../resources/inherit.gif" ALT="extended by "><B>org.jboss.shrinkwrap.descriptor.impl.javaee5.EjbLocalRefTypeImpl&lt;T&gt;</B> </PRE> <DL> <DT><B>All Implemented Interfaces:</B> <DD>org.jboss.shrinkwrap.descriptor.api.Child&lt;T&gt;, <A HREF="../../../../../../org/jboss/shrinkwrap/descriptor/api/javaee5/EjbLocalRefType.html" title="interface in org.jboss.shrinkwrap.descriptor.api.javaee5">EjbLocalRefType</A>&lt;T&gt;</DD> </DL> <HR> <DL> <DT><PRE>public class <B>EjbLocalRefTypeImpl&lt;T&gt;</B><DT>extends java.lang.Object<DT>implements org.jboss.shrinkwrap.descriptor.api.Child&lt;T&gt;, <A HREF="../../../../../../org/jboss/shrinkwrap/descriptor/api/javaee5/EjbLocalRefType.html" title="interface in org.jboss.shrinkwrap.descriptor.api.javaee5">EjbLocalRefType</A>&lt;T&gt;</DL> </PRE> <P> This class implements the <code> ejb-local-refType </code> xsd type <p> Original Documentation: <p> <br> <br> The ejb-local-refType is used by ejb-local-ref elements for <br> the declaration of a reference to an enterprise bean's local <br> home or to the local business interface of a 3.0 bean. <br> The declaration consists of: <br> <br> - an optional description <br> - the EJB reference name used in the code of the Deployment <br> Component that's referencing the enterprise bean. <br> - the optional expected type of the referenced enterprise bean <br> - the optional expected local interface of the referenced <br> enterprise bean or the local business interface of the <br> referenced enterprise bean. <br> - the optional expected local home interface of the referenced <br> enterprise bean. Not applicable if this ejb-local-ref refers <br> to the local business interface of a 3.0 bean. <br> - optional ejb-link information, used to specify the <br> referenced enterprise bean <br> - optional elements to define injection of the named enterprise <br> bean into a component field or property. <br> <br> <br> <P> <P> <DL> <DT><B>Since:</B></DT> <DD>Generation date :2011-07-19T22:54:35.59+02:00</DD> <DT><B>Author:</B></DT> <DD><a href="mailto:ralf.battenfeld@bluewin.ch">Ralf Battenfeld</a></DD> </DL> <HR> <P> <A NAME="constructor_summary"></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> <TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> <B>Constructor Summary</B></FONT></TH> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD><CODE><B><A HREF="../../../../../../org/jboss/shrinkwrap/descriptor/impl/javaee5/EjbLocalRefTypeImpl.html#EjbLocalRefTypeImpl(T, java.lang.String, org.jboss.shrinkwrap.descriptor.spi.Node)">EjbLocalRefTypeImpl</A></B>(<A HREF="../../../../../../org/jboss/shrinkwrap/descriptor/impl/javaee5/EjbLocalRefTypeImpl.html" title="type parameter in EjbLocalRefTypeImpl">T</A>&nbsp;t, java.lang.String&nbsp;nodeName, org.jboss.shrinkwrap.descriptor.spi.Node&nbsp;node)</CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD><CODE><B><A HREF="../../../../../../org/jboss/shrinkwrap/descriptor/impl/javaee5/EjbLocalRefTypeImpl.html#EjbLocalRefTypeImpl(T, java.lang.String, org.jboss.shrinkwrap.descriptor.spi.Node, org.jboss.shrinkwrap.descriptor.spi.Node)">EjbLocalRefTypeImpl</A></B>(<A HREF="../../../../../../org/jboss/shrinkwrap/descriptor/impl/javaee5/EjbLocalRefTypeImpl.html" title="type parameter in EjbLocalRefTypeImpl">T</A>&nbsp;t, java.lang.String&nbsp;nodeName, org.jboss.shrinkwrap.descriptor.spi.Node&nbsp;node, org.jboss.shrinkwrap.descriptor.spi.Node&nbsp;childNode)</CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD> </TR> </TABLE> &nbsp; <A NAME="method_summary"></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> <TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> <B>Method Summary</B></FONT></TH> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>&nbsp;java.util.List&lt;java.lang.String&gt;</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../../../org/jboss/shrinkwrap/descriptor/impl/javaee5/EjbLocalRefTypeImpl.html#getDescriptionList()">getDescriptionList</A></B>()</CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns all <code>description</code> elements</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>&nbsp;java.lang.String</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../../../org/jboss/shrinkwrap/descriptor/impl/javaee5/EjbLocalRefTypeImpl.html#getEjbLink()">getEjbLink</A></B>()</CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns the <code>ejb-link</code> element</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>&nbsp;java.lang.String</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../../../org/jboss/shrinkwrap/descriptor/impl/javaee5/EjbLocalRefTypeImpl.html#getEjbRefName()">getEjbRefName</A></B>()</CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns the <code>ejb-ref-name</code> element</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>&nbsp;<A HREF="../../../../../../org/jboss/shrinkwrap/descriptor/api/javaee5/EjbRefTypeType.html" title="enum in org.jboss.shrinkwrap.descriptor.api.javaee5">EjbRefTypeType</A></CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../../../org/jboss/shrinkwrap/descriptor/impl/javaee5/EjbLocalRefTypeImpl.html#getEjbRefType()">getEjbRefType</A></B>()</CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns the <code>ejb-ref-type</code> element</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>&nbsp;java.lang.String</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../../../org/jboss/shrinkwrap/descriptor/impl/javaee5/EjbLocalRefTypeImpl.html#<API key>()"><API key></A></B>()</CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns the <code>ejb-ref-type</code> element</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>&nbsp;java.util.List&lt;<A HREF="../../../../../../org/jboss/shrinkwrap/descriptor/api/javaee5/InjectionTargetType.html" title="interface in org.jboss.shrinkwrap.descriptor.api.javaee5">InjectionTargetType</A>&lt;<A HREF="../../../../../../org/jboss/shrinkwrap/descriptor/api/javaee5/EjbLocalRefType.html" title="interface in org.jboss.shrinkwrap.descriptor.api.javaee5">EjbLocalRefType</A>&lt;<A HREF="../../../../../../org/jboss/shrinkwrap/descriptor/impl/javaee5/EjbLocalRefTypeImpl.html" title="type parameter in EjbLocalRefTypeImpl">T</A>&gt;&gt;&gt;</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../../../org/jboss/shrinkwrap/descriptor/impl/javaee5/EjbLocalRefTypeImpl.html#<API key>()"><API key></A></B>()</CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns all <code>injection-target</code> elements</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>&nbsp;java.lang.String</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../../../org/jboss/shrinkwrap/descriptor/impl/javaee5/EjbLocalRefTypeImpl.html#getLocal()">getLocal</A></B>()</CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns the <code>local</code> element</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>&nbsp;java.lang.String</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../../../org/jboss/shrinkwrap/descriptor/impl/javaee5/EjbLocalRefTypeImpl.html#getLocalHome()">getLocalHome</A></B>()</CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns the <code>local-home</code> element</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>&nbsp;java.lang.String</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../../../org/jboss/shrinkwrap/descriptor/impl/javaee5/EjbLocalRefTypeImpl.html#getMappedName()">getMappedName</A></B>()</CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns the <code>mapped-name</code> element</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>&nbsp;<A HREF="../../../../../../org/jboss/shrinkwrap/descriptor/api/javaee5/InjectionTargetType.html" title="interface in org.jboss.shrinkwrap.descriptor.api.javaee5">InjectionTargetType</A>&lt;<A HREF="../../../../../../org/jboss/shrinkwrap/descriptor/api/javaee5/EjbLocalRefType.html" title="interface in org.jboss.shrinkwrap.descriptor.api.javaee5">EjbLocalRefType</A>&lt;<A HREF="../../../../../../org/jboss/shrinkwrap/descriptor/impl/javaee5/EjbLocalRefTypeImpl.html" title="type parameter in EjbLocalRefTypeImpl">T</A>&gt;&gt;</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../../../org/jboss/shrinkwrap/descriptor/impl/javaee5/EjbLocalRefTypeImpl.html#injectionTarget()">injectionTarget</A></B>()</CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns the <code>injection-target</code> element</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>&nbsp;<A HREF="../../../../../../org/jboss/shrinkwrap/descriptor/api/javaee5/EjbLocalRefType.html" title="interface in org.jboss.shrinkwrap.descriptor.api.javaee5">EjbLocalRefType</A>&lt;<A HREF="../../../../../../org/jboss/shrinkwrap/descriptor/impl/javaee5/EjbLocalRefTypeImpl.html" title="type parameter in EjbLocalRefTypeImpl">T</A>&gt;</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../../../org/jboss/shrinkwrap/descriptor/impl/javaee5/EjbLocalRefTypeImpl.html#<API key>()"><API key></A></B>()</CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Removes the <code>description</code> element</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>&nbsp;<A HREF="../../../../../../org/jboss/shrinkwrap/descriptor/api/javaee5/EjbLocalRefType.html" title="interface in org.jboss.shrinkwrap.descriptor.api.javaee5">EjbLocalRefType</A>&lt;<A HREF="../../../../../../org/jboss/shrinkwrap/descriptor/impl/javaee5/EjbLocalRefTypeImpl.html" title="type parameter in EjbLocalRefTypeImpl">T</A>&gt;</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../../../org/jboss/shrinkwrap/descriptor/impl/javaee5/EjbLocalRefTypeImpl.html#<API key>()"><API key></A></B>()</CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Removes all <code>injection-target</code> elements</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>&nbsp;<A HREF="../../../../../../org/jboss/shrinkwrap/descriptor/api/javaee5/EjbLocalRefType.html" title="interface in org.jboss.shrinkwrap.descriptor.api.javaee5">EjbLocalRefType</A>&lt;<A HREF="../../../../../../org/jboss/shrinkwrap/descriptor/impl/javaee5/EjbLocalRefTypeImpl.html" title="type parameter in EjbLocalRefTypeImpl">T</A>&gt;</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../../../org/jboss/shrinkwrap/descriptor/impl/javaee5/EjbLocalRefTypeImpl.html#removeEjbLink()">removeEjbLink</A></B>()</CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Removes the <code>ejb-link</code> element</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>&nbsp;<A HREF="../../../../../../org/jboss/shrinkwrap/descriptor/api/javaee5/EjbLocalRefType.html" title="interface in org.jboss.shrinkwrap.descriptor.api.javaee5">EjbLocalRefType</A>&lt;<A HREF="../../../../../../org/jboss/shrinkwrap/descriptor/impl/javaee5/EjbLocalRefTypeImpl.html" title="type parameter in EjbLocalRefTypeImpl">T</A>&gt;</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../../../org/jboss/shrinkwrap/descriptor/impl/javaee5/EjbLocalRefTypeImpl.html#removeEjbRefName()">removeEjbRefName</A></B>()</CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Removes the <code>ejb-ref-name</code> element</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>&nbsp;<A HREF="../../../../../../org/jboss/shrinkwrap/descriptor/api/javaee5/EjbLocalRefType.html" title="interface in org.jboss.shrinkwrap.descriptor.api.javaee5">EjbLocalRefType</A>&lt;<A HREF="../../../../../../org/jboss/shrinkwrap/descriptor/impl/javaee5/EjbLocalRefTypeImpl.html" title="type parameter in EjbLocalRefTypeImpl">T</A>&gt;</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../../../org/jboss/shrinkwrap/descriptor/impl/javaee5/EjbLocalRefTypeImpl.html#removeLocal()">removeLocal</A></B>()</CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Removes the <code>local</code> element</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>&nbsp;<A HREF="../../../../../../org/jboss/shrinkwrap/descriptor/api/javaee5/EjbLocalRefType.html" title="interface in org.jboss.shrinkwrap.descriptor.api.javaee5">EjbLocalRefType</A>&lt;<A HREF="../../../../../../org/jboss/shrinkwrap/descriptor/impl/javaee5/EjbLocalRefTypeImpl.html" title="type parameter in EjbLocalRefTypeImpl">T</A>&gt;</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../../../org/jboss/shrinkwrap/descriptor/impl/javaee5/EjbLocalRefTypeImpl.html#removeLocalHome()">removeLocalHome</A></B>()</CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Removes the <code>local-home</code> element</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>&nbsp;<A HREF="../../../../../../org/jboss/shrinkwrap/descriptor/api/javaee5/EjbLocalRefType.html" title="interface in org.jboss.shrinkwrap.descriptor.api.javaee5">EjbLocalRefType</A>&lt;<A HREF="../../../../../../org/jboss/shrinkwrap/descriptor/impl/javaee5/EjbLocalRefTypeImpl.html" title="type parameter in EjbLocalRefTypeImpl">T</A>&gt;</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../../../org/jboss/shrinkwrap/descriptor/impl/javaee5/EjbLocalRefTypeImpl.html#removeMappedName()">removeMappedName</A></B>()</CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Removes the <code>mapped-name</code> element</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>&nbsp;<A HREF="../../../../../../org/jboss/shrinkwrap/descriptor/api/javaee5/EjbLocalRefType.html" title="interface in org.jboss.shrinkwrap.descriptor.api.javaee5">EjbLocalRefType</A>&lt;<A HREF="../../../../../../org/jboss/shrinkwrap/descriptor/impl/javaee5/EjbLocalRefTypeImpl.html" title="type parameter in EjbLocalRefTypeImpl">T</A>&gt;</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../../../org/jboss/shrinkwrap/descriptor/impl/javaee5/EjbLocalRefTypeImpl.html#setDescription(java.lang.String)">setDescription</A></B>(java.lang.String&nbsp;description)</CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Creates a new <code>description</code> element</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>&nbsp;<A HREF="../../../../../../org/jboss/shrinkwrap/descriptor/api/javaee5/EjbLocalRefType.html" title="interface in org.jboss.shrinkwrap.descriptor.api.javaee5">EjbLocalRefType</A>&lt;<A HREF="../../../../../../org/jboss/shrinkwrap/descriptor/impl/javaee5/EjbLocalRefTypeImpl.html" title="type parameter in EjbLocalRefTypeImpl">T</A>&gt;</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../../../org/jboss/shrinkwrap/descriptor/impl/javaee5/EjbLocalRefTypeImpl.html#setDescriptionList(java.lang.String...)">setDescriptionList</A></B>(java.lang.String...&nbsp;values)</CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Creates for all String objects representing <code>description</code> elements, a new <code>description</code> element</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>&nbsp;<A HREF="../../../../../../org/jboss/shrinkwrap/descriptor/api/javaee5/EjbLocalRefType.html" title="interface in org.jboss.shrinkwrap.descriptor.api.javaee5">EjbLocalRefType</A>&lt;<A HREF="../../../../../../org/jboss/shrinkwrap/descriptor/impl/javaee5/EjbLocalRefTypeImpl.html" title="type parameter in EjbLocalRefTypeImpl">T</A>&gt;</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../../../org/jboss/shrinkwrap/descriptor/impl/javaee5/EjbLocalRefTypeImpl.html#setEjbLink(java.lang.String)">setEjbLink</A></B>(java.lang.String&nbsp;ejbLink)</CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;If not already created, a new <code>ejb-link</code> element with the given value will be created.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>&nbsp;<A HREF="../../../../../../org/jboss/shrinkwrap/descriptor/api/javaee5/EjbLocalRefType.html" title="interface in org.jboss.shrinkwrap.descriptor.api.javaee5">EjbLocalRefType</A>&lt;<A HREF="../../../../../../org/jboss/shrinkwrap/descriptor/impl/javaee5/EjbLocalRefTypeImpl.html" title="type parameter in EjbLocalRefTypeImpl">T</A>&gt;</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../../../org/jboss/shrinkwrap/descriptor/impl/javaee5/EjbLocalRefTypeImpl.html#setEjbRefName(java.lang.String)">setEjbRefName</A></B>(java.lang.String&nbsp;ejbRefName)</CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;If not already created, a new <code>ejb-ref-name</code> element with the given value will be created.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>&nbsp;<A HREF="../../../../../../org/jboss/shrinkwrap/descriptor/api/javaee5/EjbLocalRefType.html" title="interface in org.jboss.shrinkwrap.descriptor.api.javaee5">EjbLocalRefType</A>&lt;<A HREF="../../../../../../org/jboss/shrinkwrap/descriptor/impl/javaee5/EjbLocalRefTypeImpl.html" title="type parameter in EjbLocalRefTypeImpl">T</A>&gt;</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../../../org/jboss/shrinkwrap/descriptor/impl/javaee5/EjbLocalRefTypeImpl.html#setEjbRefType(org.jboss.shrinkwrap.descriptor.api.javaee5.EjbRefTypeType)">setEjbRefType</A></B>(<A HREF="../../../../../../org/jboss/shrinkwrap/descriptor/api/javaee5/EjbRefTypeType.html" title="enum in org.jboss.shrinkwrap.descriptor.api.javaee5">EjbRefTypeType</A>&nbsp;ejbRefType)</CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;If not already created, a new <code>ejb-ref-type</code> element with the given value will be created.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>&nbsp;<A HREF="../../../../../../org/jboss/shrinkwrap/descriptor/api/javaee5/EjbLocalRefType.html" title="interface in org.jboss.shrinkwrap.descriptor.api.javaee5">EjbLocalRefType</A>&lt;<A HREF="../../../../../../org/jboss/shrinkwrap/descriptor/impl/javaee5/EjbLocalRefTypeImpl.html" title="type parameter in EjbLocalRefTypeImpl">T</A>&gt;</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../../../org/jboss/shrinkwrap/descriptor/impl/javaee5/EjbLocalRefTypeImpl.html#setEjbRefType(java.lang.String)">setEjbRefType</A></B>(java.lang.String&nbsp;ejbRefType)</CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;If not already created, a new <code>ejb-ref-type</code> element with the given value will be created.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>&nbsp;<A HREF="../../../../../../org/jboss/shrinkwrap/descriptor/api/javaee5/EjbLocalRefType.html" title="interface in org.jboss.shrinkwrap.descriptor.api.javaee5">EjbLocalRefType</A>&lt;<A HREF="../../../../../../org/jboss/shrinkwrap/descriptor/impl/javaee5/EjbLocalRefTypeImpl.html" title="type parameter in EjbLocalRefTypeImpl">T</A>&gt;</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../../../org/jboss/shrinkwrap/descriptor/impl/javaee5/EjbLocalRefTypeImpl.html#setLocal(java.lang.String)">setLocal</A></B>(java.lang.String&nbsp;local)</CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;If not already created, a new <code>local</code> element with the given value will be created.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>&nbsp;<A HREF="../../../../../../org/jboss/shrinkwrap/descriptor/api/javaee5/EjbLocalRefType.html" title="interface in org.jboss.shrinkwrap.descriptor.api.javaee5">EjbLocalRefType</A>&lt;<A HREF="../../../../../../org/jboss/shrinkwrap/descriptor/impl/javaee5/EjbLocalRefTypeImpl.html" title="type parameter in EjbLocalRefTypeImpl">T</A>&gt;</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../../../org/jboss/shrinkwrap/descriptor/impl/javaee5/EjbLocalRefTypeImpl.html#setLocalHome(java.lang.String)">setLocalHome</A></B>(java.lang.String&nbsp;localHome)</CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;If not already created, a new <code>local-home</code> element with the given value will be created.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>&nbsp;<A HREF="../../../../../../org/jboss/shrinkwrap/descriptor/api/javaee5/EjbLocalRefType.html" title="interface in org.jboss.shrinkwrap.descriptor.api.javaee5">EjbLocalRefType</A>&lt;<A HREF="../../../../../../org/jboss/shrinkwrap/descriptor/impl/javaee5/EjbLocalRefTypeImpl.html" title="type parameter in EjbLocalRefTypeImpl">T</A>&gt;</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../../../org/jboss/shrinkwrap/descriptor/impl/javaee5/EjbLocalRefTypeImpl.html#setMappedName(java.lang.String)">setMappedName</A></B>(java.lang.String&nbsp;mappedName)</CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;If not already created, a new <code>mapped-name</code> element with the given value will be created.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>&nbsp;<A HREF="../../../../../../org/jboss/shrinkwrap/descriptor/impl/javaee5/EjbLocalRefTypeImpl.html" title="type parameter in EjbLocalRefTypeImpl">T</A></CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../../../org/jboss/shrinkwrap/descriptor/impl/javaee5/EjbLocalRefTypeImpl.html#up()">up</A></B>()</CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD> </TR> </TABLE> &nbsp;<A NAME="<API key>.lang.Object"></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#EEEEFF" CLASS="<API key>"> <TH ALIGN="left"><B>Methods inherited from class java.lang.Object</B></TH> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD><CODE>equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait</CODE></TD> </TR> </TABLE> &nbsp; <P> <A NAME="constructor_detail"></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> <TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2"> <B>Constructor Detail</B></FONT></TH> </TR> </TABLE> <A NAME="EjbLocalRefTypeImpl(java.lang.Object,java.lang.String,org.jboss.shrinkwrap.descriptor.spi.Node)"></A><A NAME="EjbLocalRefTypeImpl(T, java.lang.String, org.jboss.shrinkwrap.descriptor.spi.Node)"></A><H3> EjbLocalRefTypeImpl</H3> <PRE> public <B>EjbLocalRefTypeImpl</B>(<A HREF="../../../../../../org/jboss/shrinkwrap/descriptor/impl/javaee5/EjbLocalRefTypeImpl.html" title="type parameter in EjbLocalRefTypeImpl">T</A>&nbsp;t, java.lang.String&nbsp;nodeName, org.jboss.shrinkwrap.descriptor.spi.Node&nbsp;node)</PRE> <DL> </DL> <HR> <A NAME="EjbLocalRefTypeImpl(java.lang.Object,java.lang.String,org.jboss.shrinkwrap.descriptor.spi.Node,org.jboss.shrinkwrap.descriptor.spi.Node)"></A><A NAME="EjbLocalRefTypeImpl(T, java.lang.String, org.jboss.shrinkwrap.descriptor.spi.Node, org.jboss.shrinkwrap.descriptor.spi.Node)"></A><H3> EjbLocalRefTypeImpl</H3> <PRE> public <B>EjbLocalRefTypeImpl</B>(<A HREF="../../../../../../org/jboss/shrinkwrap/descriptor/impl/javaee5/EjbLocalRefTypeImpl.html" title="type parameter in EjbLocalRefTypeImpl">T</A>&nbsp;t, java.lang.String&nbsp;nodeName, org.jboss.shrinkwrap.descriptor.spi.Node&nbsp;node, org.jboss.shrinkwrap.descriptor.spi.Node&nbsp;childNode)</PRE> <DL> </DL> <A NAME="method_detail"></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> <TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2"> <B>Method Detail</B></FONT></TH> </TR> </TABLE> <A NAME="up()"></A><H3> up</H3> <PRE> public <A HREF="../../../../../../org/jboss/shrinkwrap/descriptor/impl/javaee5/EjbLocalRefTypeImpl.html" title="type parameter in EjbLocalRefTypeImpl">T</A> <B>up</B>()</PRE> <DL> <DD><DL> <DT><B>Specified by:</B><DD><CODE>up</CODE> in interface <CODE>org.jboss.shrinkwrap.descriptor.api.Child&lt;<A HREF="../../../../../../org/jboss/shrinkwrap/descriptor/impl/javaee5/EjbLocalRefTypeImpl.html" title="type parameter in EjbLocalRefTypeImpl">T</A>&gt;</CODE></DL> </DD> <DD><DL> </DL> </DD> </DL> <HR> <A NAME="setMappedName(java.lang.String)"></A><H3> setMappedName</H3> <PRE> public <A HREF="../../../../../../org/jboss/shrinkwrap/descriptor/api/javaee5/EjbLocalRefType.html" title="interface in org.jboss.shrinkwrap.descriptor.api.javaee5">EjbLocalRefType</A>&lt;<A HREF="../../../../../../org/jboss/shrinkwrap/descriptor/impl/javaee5/EjbLocalRefTypeImpl.html" title="type parameter in EjbLocalRefTypeImpl">T</A>&gt; <B>setMappedName</B>(java.lang.String&nbsp;mappedName)</PRE> <DL> <DD>If not already created, a new <code>mapped-name</code> element with the given value will be created. Otherwise, the existing <code>mapped-name</code> element will be updated with the given value. <P> <DD><DL> <DT><B>Specified by:</B><DD><CODE><A HREF="../../../../../../org/jboss/shrinkwrap/descriptor/api/javaee5/EjbLocalRefType.html#setMappedName(java.lang.String)">setMappedName</A></CODE> in interface <CODE><A HREF="../../../../../../org/jboss/shrinkwrap/descriptor/api/javaee5/EjbLocalRefType.html" title="interface in org.jboss.shrinkwrap.descriptor.api.javaee5">EjbLocalRefType</A>&lt;<A HREF="../../../../../../org/jboss/shrinkwrap/descriptor/impl/javaee5/EjbLocalRefTypeImpl.html" title="type parameter in EjbLocalRefTypeImpl">T</A>&gt;</CODE></DL> </DD> <DD><DL> <DT><B>Returns:</B><DD>the current instance of <CODE>EjbLocalRefType<T></CODE></DL> </DD> </DL> <HR> <A NAME="removeMappedName()"></A><H3> removeMappedName</H3> <PRE> public <A HREF="../../../../../../org/jboss/shrinkwrap/descriptor/api/javaee5/EjbLocalRefType.html" title="interface in org.jboss.shrinkwrap.descriptor.api.javaee5">EjbLocalRefType</A>&lt;<A HREF="../../../../../../org/jboss/shrinkwrap/descriptor/impl/javaee5/EjbLocalRefTypeImpl.html" title="type parameter in EjbLocalRefTypeImpl">T</A>&gt; <B>removeMappedName</B>()</PRE> <DL> <DD>Removes the <code>mapped-name</code> element <P> <DD><DL> <DT><B>Specified by:</B><DD><CODE><A HREF="../../../../../../org/jboss/shrinkwrap/descriptor/api/javaee5/EjbLocalRefType.html#removeMappedName()">removeMappedName</A></CODE> in interface <CODE><A HREF="../../../../../../org/jboss/shrinkwrap/descriptor/api/javaee5/EjbLocalRefType.html" title="interface in org.jboss.shrinkwrap.descriptor.api.javaee5">EjbLocalRefType</A>&lt;<A HREF="../../../../../../org/jboss/shrinkwrap/descriptor/impl/javaee5/EjbLocalRefTypeImpl.html" title="type parameter in EjbLocalRefTypeImpl">T</A>&gt;</CODE></DL> </DD> <DD><DL> <DT><B>Returns:</B><DD>the current instance of <CODE>EjbLocalRefType<T></CODE></DL> </DD> </DL> <HR> <A NAME="getMappedName()"></A><H3> getMappedName</H3> <PRE> public java.lang.String <B>getMappedName</B>()</PRE> <DL> <DD>Returns the <code>mapped-name</code> element <P> <DD><DL> <DT><B>Specified by:</B><DD><CODE><A HREF="../../../../../../org/jboss/shrinkwrap/descriptor/api/javaee5/EjbLocalRefType.html#getMappedName()">getMappedName</A></CODE> in interface <CODE><A HREF="../../../../../../org/jboss/shrinkwrap/descriptor/api/javaee5/EjbLocalRefType.html" title="interface in org.jboss.shrinkwrap.descriptor.api.javaee5">EjbLocalRefType</A>&lt;<A HREF="../../../../../../org/jboss/shrinkwrap/descriptor/impl/javaee5/EjbLocalRefTypeImpl.html" title="type parameter in EjbLocalRefTypeImpl">T</A>&gt;</CODE></DL> </DD> <DD><DL> <DT><B>Returns:</B><DD>the node defined for the element <code>mapped-name</code></DL> </DD> </DL> <HR> <A NAME="<API key>()"></A><H3> <API key></H3> <PRE> public <A HREF="../../../../../../org/jboss/shrinkwrap/descriptor/api/javaee5/EjbLocalRefType.html" title="interface in org.jboss.shrinkwrap.descriptor.api.javaee5">EjbLocalRefType</A>&lt;<A HREF="../../../../../../org/jboss/shrinkwrap/descriptor/impl/javaee5/EjbLocalRefTypeImpl.html" title="type parameter in EjbLocalRefTypeImpl">T</A>&gt; <B><API key></B>()</PRE> <DL> <DD>Removes all <code>injection-target</code> elements <P> <DD><DL> <DT><B>Specified by:</B><DD><CODE><A HREF="../../../../../../org/jboss/shrinkwrap/descriptor/api/javaee5/EjbLocalRefType.html#<API key>()"><API key></A></CODE> in interface <CODE><A HREF="../../../../../../org/jboss/shrinkwrap/descriptor/api/javaee5/EjbLocalRefType.html" title="interface in org.jboss.shrinkwrap.descriptor.api.javaee5">EjbLocalRefType</A>&lt;<A HREF="../../../../../../org/jboss/shrinkwrap/descriptor/impl/javaee5/EjbLocalRefTypeImpl.html" title="type parameter in EjbLocalRefTypeImpl">T</A>&gt;</CODE></DL> </DD> <DD><DL> <DT><B>Returns:</B><DD>the current instance of <CODE>EjbLocalRefType<T></CODE></DL> </DD> </DL> <HR> <A NAME="injectionTarget()"></A><H3> injectionTarget</H3> <PRE> public <A HREF="../../../../../../org/jboss/shrinkwrap/descriptor/api/javaee5/InjectionTargetType.html" title="interface in org.jboss.shrinkwrap.descriptor.api.javaee5">InjectionTargetType</A>&lt;<A HREF="../../../../../../org/jboss/shrinkwrap/descriptor/api/javaee5/EjbLocalRefType.html" title="interface in org.jboss.shrinkwrap.descriptor.api.javaee5">EjbLocalRefType</A>&lt;<A HREF="../../../../../../org/jboss/shrinkwrap/descriptor/impl/javaee5/EjbLocalRefTypeImpl.html" title="type parameter in EjbLocalRefTypeImpl">T</A>&gt;&gt; <B>injectionTarget</B>()</PRE> <DL> <DD>Returns the <code>injection-target</code> element <P> <DD><DL> <DT><B>Specified by:</B><DD><CODE><A HREF="../../../../../../org/jboss/shrinkwrap/descriptor/api/javaee5/EjbLocalRefType.html#injectionTarget()">injectionTarget</A></CODE> in interface <CODE><A HREF="../../../../../../org/jboss/shrinkwrap/descriptor/api/javaee5/EjbLocalRefType.html" title="interface in org.jboss.shrinkwrap.descriptor.api.javaee5">EjbLocalRefType</A>&lt;<A HREF="../../../../../../org/jboss/shrinkwrap/descriptor/impl/javaee5/EjbLocalRefTypeImpl.html" title="type parameter in EjbLocalRefTypeImpl">T</A>&gt;</CODE></DL> </DD> <DD><DL> <DT><B>Returns:</B><DD>the node defined for the element <code>injection-target</code></DL> </DD> </DL> <HR> <A NAME="<API key>()"></A><H3> <API key></H3> <PRE> public java.util.List&lt;<A HREF="../../../../../../org/jboss/shrinkwrap/descriptor/api/javaee5/InjectionTargetType.html" title="interface in org.jboss.shrinkwrap.descriptor.api.javaee5">InjectionTargetType</A>&lt;<A HREF="../../../../../../org/jboss/shrinkwrap/descriptor/api/javaee5/EjbLocalRefType.html" title="interface in org.jboss.shrinkwrap.descriptor.api.javaee5">EjbLocalRefType</A>&lt;<A HREF="../../../../../../org/jboss/shrinkwrap/descriptor/impl/javaee5/EjbLocalRefTypeImpl.html" title="type parameter in EjbLocalRefTypeImpl">T</A>&gt;&gt;&gt; <B><API key></B>()</PRE> <DL> <DD>Returns all <code>injection-target</code> elements <P> <DD><DL> <DT><B>Specified by:</B><DD><CODE><A HREF="../../../../../../org/jboss/shrinkwrap/descriptor/api/javaee5/EjbLocalRefType.html#<API key>()"><API key></A></CODE> in interface <CODE><A HREF="../../../../../../org/jboss/shrinkwrap/descriptor/api/javaee5/EjbLocalRefType.html" title="interface in org.jboss.shrinkwrap.descriptor.api.javaee5">EjbLocalRefType</A>&lt;<A HREF="../../../../../../org/jboss/shrinkwrap/descriptor/impl/javaee5/EjbLocalRefTypeImpl.html" title="type parameter in EjbLocalRefTypeImpl">T</A>&gt;</CODE></DL> </DD> <DD><DL> <DT><B>Returns:</B><DD>list of <code>injection-target</code></DL> </DD> </DL> <HR> <A NAME="setDescription(java.lang.String)"></A><H3> setDescription</H3> <PRE> public <A HREF="../../../../../../org/jboss/shrinkwrap/descriptor/api/javaee5/EjbLocalRefType.html" title="interface in org.jboss.shrinkwrap.descriptor.api.javaee5">EjbLocalRefType</A>&lt;<A HREF="../../../../../../org/jboss/shrinkwrap/descriptor/impl/javaee5/EjbLocalRefTypeImpl.html" title="type parameter in EjbLocalRefTypeImpl">T</A>&gt; <B>setDescription</B>(java.lang.String&nbsp;description)</PRE> <DL> <DD>Creates a new <code>description</code> element <P> <DD><DL> <DT><B>Specified by:</B><DD><CODE><A HREF="../../../../../../org/jboss/shrinkwrap/descriptor/api/javaee5/EjbLocalRefType.html#setDescription(java.lang.String)">setDescription</A></CODE> in interface <CODE><A HREF="../../../../../../org/jboss/shrinkwrap/descriptor/api/javaee5/EjbLocalRefType.html" title="interface in org.jboss.shrinkwrap.descriptor.api.javaee5">EjbLocalRefType</A>&lt;<A HREF="../../../../../../org/jboss/shrinkwrap/descriptor/impl/javaee5/EjbLocalRefTypeImpl.html" title="type parameter in EjbLocalRefTypeImpl">T</A>&gt;</CODE></DL> </DD> <DD><DL> <DT><B>Returns:</B><DD>the current instance of <CODE>EjbLocalRefType<T></CODE></DL> </DD> </DL> <HR> <A NAME="setDescriptionList(java.lang.String...)"></A><H3> setDescriptionList</H3> <PRE> public <A HREF="../../../../../../org/jboss/shrinkwrap/descriptor/api/javaee5/EjbLocalRefType.html" title="interface in org.jboss.shrinkwrap.descriptor.api.javaee5">EjbLocalRefType</A>&lt;<A HREF="../../../../../../org/jboss/shrinkwrap/descriptor/impl/javaee5/EjbLocalRefTypeImpl.html" title="type parameter in EjbLocalRefTypeImpl">T</A>&gt; <B>setDescriptionList</B>(java.lang.String...&nbsp;values)</PRE> <DL> <DD>Creates for all String objects representing <code>description</code> elements, a new <code>description</code> element <P> <DD><DL> <DT><B>Specified by:</B><DD><CODE><A HREF="../../../../../../org/jboss/shrinkwrap/descriptor/api/javaee5/EjbLocalRefType.html#setDescriptionList(java.lang.String...)">setDescriptionList</A></CODE> in interface <CODE><A HREF="../../../../../../org/jboss/shrinkwrap/descriptor/api/javaee5/EjbLocalRefType.html" title="interface in org.jboss.shrinkwrap.descriptor.api.javaee5">EjbLocalRefType</A>&lt;<A HREF="../../../../../../org/jboss/shrinkwrap/descriptor/impl/javaee5/EjbLocalRefTypeImpl.html" title="type parameter in EjbLocalRefTypeImpl">T</A>&gt;</CODE></DL> </DD> <DD><DL> <DT><B>Parameters:</B><DD><CODE>list</CODE> - of <code>description</code> objects <DT><B>Returns:</B><DD>the current instance of <CODE>EjbLocalRefType<T></CODE></DL> </DD> </DL> <HR> <A NAME="<API key>()"></A><H3> <API key></H3> <PRE> public <A HREF="../../../../../../org/jboss/shrinkwrap/descriptor/api/javaee5/EjbLocalRefType.html" title="interface in org.jboss.shrinkwrap.descriptor.api.javaee5">EjbLocalRefType</A>&lt;<A HREF="../../../../../../org/jboss/shrinkwrap/descriptor/impl/javaee5/EjbLocalRefTypeImpl.html" title="type parameter in EjbLocalRefTypeImpl">T</A>&gt; <B><API key></B>()</PRE> <DL> <DD>Removes the <code>description</code> element <P> <DD><DL> <DT><B>Specified by:</B><DD><CODE><A HREF="../../../../../../org/jboss/shrinkwrap/descriptor/api/javaee5/EjbLocalRefType.html#<API key>()"><API key></A></CODE> in interface <CODE><A HREF="../../../../../../org/jboss/shrinkwrap/descriptor/api/javaee5/EjbLocalRefType.html" title="interface in org.jboss.shrinkwrap.descriptor.api.javaee5">EjbLocalRefType</A>&lt;<A HREF="../../../../../../org/jboss/shrinkwrap/descriptor/impl/javaee5/EjbLocalRefTypeImpl.html" title="type parameter in EjbLocalRefTypeImpl">T</A>&gt;</CODE></DL> </DD> <DD><DL> <DT><B>Returns:</B><DD>the current instance of <CODE>EjbLocalRefType<T></CODE></DL> </DD> </DL> <HR> <A NAME="getDescriptionList()"></A><H3> getDescriptionList</H3> <PRE> public java.util.List&lt;java.lang.String&gt; <B>getDescriptionList</B>()</PRE> <DL> <DD>Returns all <code>description</code> elements <P> <DD><DL> <DT><B>Specified by:</B><DD><CODE><A HREF="../../../../../../org/jboss/shrinkwrap/descriptor/api/javaee5/EjbLocalRefType.html#getDescriptionList()">getDescriptionList</A></CODE> in interface <CODE><A HREF="../../../../../../org/jboss/shrinkwrap/descriptor/api/javaee5/EjbLocalRefType.html" title="interface in org.jboss.shrinkwrap.descriptor.api.javaee5">EjbLocalRefType</A>&lt;<A HREF="../../../../../../org/jboss/shrinkwrap/descriptor/impl/javaee5/EjbLocalRefTypeImpl.html" title="type parameter in EjbLocalRefTypeImpl">T</A>&gt;</CODE></DL> </DD> <DD><DL> <DT><B>Returns:</B><DD>list of <code>description</code></DL> </DD> </DL> <HR> <A NAME="setEjbRefName(java.lang.String)"></A><H3> setEjbRefName</H3> <PRE> public <A HREF="../../../../../../org/jboss/shrinkwrap/descriptor/api/javaee5/EjbLocalRefType.html" title="interface in org.jboss.shrinkwrap.descriptor.api.javaee5">EjbLocalRefType</A>&lt;<A HREF="../../../../../../org/jboss/shrinkwrap/descriptor/impl/javaee5/EjbLocalRefTypeImpl.html" title="type parameter in EjbLocalRefTypeImpl">T</A>&gt; <B>setEjbRefName</B>(java.lang.String&nbsp;ejbRefName)</PRE> <DL> <DD>If not already created, a new <code>ejb-ref-name</code> element with the given value will be created. Otherwise, the existing <code>ejb-ref-name</code> element will be updated with the given value. <P> <DD><DL> <DT><B>Specified by:</B><DD><CODE><A HREF="../../../../../../org/jboss/shrinkwrap/descriptor/api/javaee5/EjbLocalRefType.html#setEjbRefName(java.lang.String)">setEjbRefName</A></CODE> in interface <CODE><A HREF="../../../../../../org/jboss/shrinkwrap/descriptor/api/javaee5/EjbLocalRefType.html" title="interface in org.jboss.shrinkwrap.descriptor.api.javaee5">EjbLocalRefType</A>&lt;<A HREF="../../../../../../org/jboss/shrinkwrap/descriptor/impl/javaee5/EjbLocalRefTypeImpl.html" title="type parameter in EjbLocalRefTypeImpl">T</A>&gt;</CODE></DL> </DD> <DD><DL> <DT><B>Returns:</B><DD>the current instance of <CODE>EjbLocalRefType<T></CODE></DL> </DD> </DL> <HR> <A NAME="removeEjbRefName()"></A><H3> removeEjbRefName</H3> <PRE> public <A HREF="../../../../../../org/jboss/shrinkwrap/descriptor/api/javaee5/EjbLocalRefType.html" title="interface in org.jboss.shrinkwrap.descriptor.api.javaee5">EjbLocalRefType</A>&lt;<A HREF="../../../../../../org/jboss/shrinkwrap/descriptor/impl/javaee5/EjbLocalRefTypeImpl.html" title="type parameter in EjbLocalRefTypeImpl">T</A>&gt; <B>removeEjbRefName</B>()</PRE> <DL> <DD>Removes the <code>ejb-ref-name</code> element <P> <DD><DL> <DT><B>Specified by:</B><DD><CODE><A HREF="../../../../../../org/jboss/shrinkwrap/descriptor/api/javaee5/EjbLocalRefType.html#removeEjbRefName()">removeEjbRefName</A></CODE> in interface <CODE><A HREF="../../../../../../org/jboss/shrinkwrap/descriptor/api/javaee5/EjbLocalRefType.html" title="interface in org.jboss.shrinkwrap.descriptor.api.javaee5">EjbLocalRefType</A>&lt;<A HREF="../../../../../../org/jboss/shrinkwrap/descriptor/impl/javaee5/EjbLocalRefTypeImpl.html" title="type parameter in EjbLocalRefTypeImpl">T</A>&gt;</CODE></DL> </DD> <DD><DL> <DT><B>Returns:</B><DD>the current instance of <CODE>EjbLocalRefType<T></CODE></DL> </DD> </DL> <HR> <A NAME="getEjbRefName()"></A><H3> getEjbRefName</H3> <PRE> public java.lang.String <B>getEjbRefName</B>()</PRE> <DL> <DD>Returns the <code>ejb-ref-name</code> element <P> <DD><DL> <DT><B>Specified by:</B><DD><CODE><A HREF="../../../../../../org/jboss/shrinkwrap/descriptor/api/javaee5/EjbLocalRefType.html#getEjbRefName()">getEjbRefName</A></CODE> in interface <CODE><A HREF="../../../../../../org/jboss/shrinkwrap/descriptor/api/javaee5/EjbLocalRefType.html" title="interface in org.jboss.shrinkwrap.descriptor.api.javaee5">EjbLocalRefType</A>&lt;<A HREF="../../../../../../org/jboss/shrinkwrap/descriptor/impl/javaee5/EjbLocalRefTypeImpl.html" title="type parameter in EjbLocalRefTypeImpl">T</A>&gt;</CODE></DL> </DD> <DD><DL> <DT><B>Returns:</B><DD>the node defined for the element <code>ejb-ref-name</code></DL> </DD> </DL> <HR> <A NAME="setEjbRefType(org.jboss.shrinkwrap.descriptor.api.javaee5.EjbRefTypeType)"></A><H3> setEjbRefType</H3> <PRE> public <A HREF="../../../../../../org/jboss/shrinkwrap/descriptor/api/javaee5/EjbLocalRefType.html" title="interface in org.jboss.shrinkwrap.descriptor.api.javaee5">EjbLocalRefType</A>&lt;<A HREF="../../../../../../org/jboss/shrinkwrap/descriptor/impl/javaee5/EjbLocalRefTypeImpl.html" title="type parameter in EjbLocalRefTypeImpl">T</A>&gt; <B>setEjbRefType</B>(<A HREF="../../../../../../org/jboss/shrinkwrap/descriptor/api/javaee5/EjbRefTypeType.html" title="enum in org.jboss.shrinkwrap.descriptor.api.javaee5">EjbRefTypeType</A>&nbsp;ejbRefType)</PRE> <DL> <DD>If not already created, a new <code>ejb-ref-type</code> element with the given value will be created. Otherwise, the existing <code>ejb-ref-type</code> element will be updated with the given value. <P> <DD><DL> <DT><B>Specified by:</B><DD><CODE><A HREF="../../../../../../org/jboss/shrinkwrap/descriptor/api/javaee5/EjbLocalRefType.html#setEjbRefType(org.jboss.shrinkwrap.descriptor.api.javaee5.EjbRefTypeType)">setEjbRefType</A></CODE> in interface <CODE><A HREF="../../../../../../org/jboss/shrinkwrap/descriptor/api/javaee5/EjbLocalRefType.html" title="interface in org.jboss.shrinkwrap.descriptor.api.javaee5">EjbLocalRefType</A>&lt;<A HREF="../../../../../../org/jboss/shrinkwrap/descriptor/impl/javaee5/EjbLocalRefTypeImpl.html" title="type parameter in EjbLocalRefTypeImpl">T</A>&gt;</CODE></DL> </DD> <DD><DL> <DT><B>Returns:</B><DD>the current instance of <CODE>EjbLocalRefType<T></CODE></DL> </DD> </DL> <HR> <A NAME="setEjbRefType(java.lang.String)"></A><H3> setEjbRefType</H3> <PRE> public <A HREF="../../../../../../org/jboss/shrinkwrap/descriptor/api/javaee5/EjbLocalRefType.html" title="interface in org.jboss.shrinkwrap.descriptor.api.javaee5">EjbLocalRefType</A>&lt;<A HREF="../../../../../../org/jboss/shrinkwrap/descriptor/impl/javaee5/EjbLocalRefTypeImpl.html" title="type parameter in EjbLocalRefTypeImpl">T</A>&gt; <B>setEjbRefType</B>(java.lang.String&nbsp;ejbRefType)</PRE> <DL> <DD>If not already created, a new <code>ejb-ref-type</code> element with the given value will be created. Otherwise, the existing <code>ejb-ref-type</code> element will be updated with the given value. <P> <DD><DL> <DT><B>Specified by:</B><DD><CODE><A HREF="../../../../../../org/jboss/shrinkwrap/descriptor/api/javaee5/EjbLocalRefType.html#setEjbRefType(java.lang.String)">setEjbRefType</A></CODE> in interface <CODE><A HREF="../../../../../../org/jboss/shrinkwrap/descriptor/api/javaee5/EjbLocalRefType.html" title="interface in org.jboss.shrinkwrap.descriptor.api.javaee5">EjbLocalRefType</A>&lt;<A HREF="../../../../../../org/jboss/shrinkwrap/descriptor/impl/javaee5/EjbLocalRefTypeImpl.html" title="type parameter in EjbLocalRefTypeImpl">T</A>&gt;</CODE></DL> </DD> <DD><DL> <DT><B>Returns:</B><DD>the current instance of <CODE>EjbLocalRefType<T></CODE></DL> </DD> </DL> <HR> <A NAME="getEjbRefType()"></A><H3> getEjbRefType</H3> <PRE> public <A HREF="../../../../../../org/jboss/shrinkwrap/descriptor/api/javaee5/EjbRefTypeType.html" title="enum in org.jboss.shrinkwrap.descriptor.api.javaee5">EjbRefTypeType</A> <B>getEjbRefType</B>()</PRE> <DL> <DD>Returns the <code>ejb-ref-type</code> element <P> <DD><DL> <DT><B>Specified by:</B><DD><CODE><A HREF="../../../../../../org/jboss/shrinkwrap/descriptor/api/javaee5/EjbLocalRefType.html#getEjbRefType()">getEjbRefType</A></CODE> in interface <CODE><A HREF="../../../../../../org/jboss/shrinkwrap/descriptor/api/javaee5/EjbLocalRefType.html" title="interface in org.jboss.shrinkwrap.descriptor.api.javaee5">EjbLocalRefType</A>&lt;<A HREF="../../../../../../org/jboss/shrinkwrap/descriptor/impl/javaee5/EjbLocalRefTypeImpl.html" title="type parameter in EjbLocalRefTypeImpl">T</A>&gt;</CODE></DL> </DD> <DD><DL> <DT><B>Returns:</B><DD>the node defined for the element <code>ejb-ref-type</code></DL> </DD> </DL> <HR> <A NAME="<API key>()"></A><H3> <API key></H3> <PRE> public java.lang.String <B><API key></B>()</PRE> <DL> <DD>Returns the <code>ejb-ref-type</code> element <P> <DD><DL> <DT><B>Specified by:</B><DD><CODE><A HREF="../../../../../../org/jboss/shrinkwrap/descriptor/api/javaee5/EjbLocalRefType.html#<API key>()"><API key></A></CODE> in interface <CODE><A HREF="../../../../../../org/jboss/shrinkwrap/descriptor/api/javaee5/EjbLocalRefType.html" title="interface in org.jboss.shrinkwrap.descriptor.api.javaee5">EjbLocalRefType</A>&lt;<A HREF="../../../../../../org/jboss/shrinkwrap/descriptor/impl/javaee5/EjbLocalRefTypeImpl.html" title="type parameter in EjbLocalRefTypeImpl">T</A>&gt;</CODE></DL> </DD> <DD><DL> <DT><B>Returns:</B><DD>the node defined for the element <code>ejb-ref-type</code></DL> </DD> </DL> <HR> <A NAME="setLocalHome(java.lang.String)"></A><H3> setLocalHome</H3> <PRE> public <A HREF="../../../../../../org/jboss/shrinkwrap/descriptor/api/javaee5/EjbLocalRefType.html" title="interface in org.jboss.shrinkwrap.descriptor.api.javaee5">EjbLocalRefType</A>&lt;<A HREF="../../../../../../org/jboss/shrinkwrap/descriptor/impl/javaee5/EjbLocalRefTypeImpl.html" title="type parameter in EjbLocalRefTypeImpl">T</A>&gt; <B>setLocalHome</B>(java.lang.String&nbsp;localHome)</PRE> <DL> <DD>If not already created, a new <code>local-home</code> element with the given value will be created. Otherwise, the existing <code>local-home</code> element will be updated with the given value. <P> <DD><DL> <DT><B>Specified by:</B><DD><CODE><A HREF="../../../../../../org/jboss/shrinkwrap/descriptor/api/javaee5/EjbLocalRefType.html#setLocalHome(java.lang.String)">setLocalHome</A></CODE> in interface <CODE><A HREF="../../../../../../org/jboss/shrinkwrap/descriptor/api/javaee5/EjbLocalRefType.html" title="interface in org.jboss.shrinkwrap.descriptor.api.javaee5">EjbLocalRefType</A>&lt;<A HREF="../../../../../../org/jboss/shrinkwrap/descriptor/impl/javaee5/EjbLocalRefTypeImpl.html" title="type parameter in EjbLocalRefTypeImpl">T</A>&gt;</CODE></DL> </DD> <DD><DL> <DT><B>Returns:</B><DD>the current instance of <CODE>EjbLocalRefType<T></CODE></DL> </DD> </DL> <HR> <A NAME="removeLocalHome()"></A><H3> removeLocalHome</H3> <PRE> public <A HREF="../../../../../../org/jboss/shrinkwrap/descriptor/api/javaee5/EjbLocalRefType.html" title="interface in org.jboss.shrinkwrap.descriptor.api.javaee5">EjbLocalRefType</A>&lt;<A HREF="../../../../../../org/jboss/shrinkwrap/descriptor/impl/javaee5/EjbLocalRefTypeImpl.html" title="type parameter in EjbLocalRefTypeImpl">T</A>&gt; <B>removeLocalHome</B>()</PRE> <DL> <DD>Removes the <code>local-home</code> element <P> <DD><DL> <DT><B>Specified by:</B><DD><CODE><A HREF="../../../../../../org/jboss/shrinkwrap/descriptor/api/javaee5/EjbLocalRefType.html#removeLocalHome()">removeLocalHome</A></CODE> in interface <CODE><A HREF="../../../../../../org/jboss/shrinkwrap/descriptor/api/javaee5/EjbLocalRefType.html" title="interface in org.jboss.shrinkwrap.descriptor.api.javaee5">EjbLocalRefType</A>&lt;<A HREF="../../../../../../org/jboss/shrinkwrap/descriptor/impl/javaee5/EjbLocalRefTypeImpl.html" title="type parameter in EjbLocalRefTypeImpl">T</A>&gt;</CODE></DL> </DD> <DD><DL> <DT><B>Returns:</B><DD>the current instance of <CODE>EjbLocalRefType<T></CODE></DL> </DD> </DL> <HR> <A NAME="getLocalHome()"></A><H3> getLocalHome</H3> <PRE> public java.lang.String <B>getLocalHome</B>()</PRE> <DL> <DD>Returns the <code>local-home</code> element <P> <DD><DL> <DT><B>Specified by:</B><DD><CODE><A HREF="../../../../../../org/jboss/shrinkwrap/descriptor/api/javaee5/EjbLocalRefType.html#getLocalHome()">getLocalHome</A></CODE> in interface <CODE><A HREF="../../../../../../org/jboss/shrinkwrap/descriptor/api/javaee5/EjbLocalRefType.html" title="interface in org.jboss.shrinkwrap.descriptor.api.javaee5">EjbLocalRefType</A>&lt;<A HREF="../../../../../../org/jboss/shrinkwrap/descriptor/impl/javaee5/EjbLocalRefTypeImpl.html" title="type parameter in EjbLocalRefTypeImpl">T</A>&gt;</CODE></DL> </DD> <DD><DL> <DT><B>Returns:</B><DD>the node defined for the element <code>local-home</code></DL> </DD> </DL> <HR> <A NAME="setLocal(java.lang.String)"></A><H3> setLocal</H3> <PRE> public <A HREF="../../../../../../org/jboss/shrinkwrap/descriptor/api/javaee5/EjbLocalRefType.html" title="interface in org.jboss.shrinkwrap.descriptor.api.javaee5">EjbLocalRefType</A>&lt;<A HREF="../../../../../../org/jboss/shrinkwrap/descriptor/impl/javaee5/EjbLocalRefTypeImpl.html" title="type parameter in EjbLocalRefTypeImpl">T</A>&gt; <B>setLocal</B>(java.lang.String&nbsp;local)</PRE> <DL> <DD>If not already created, a new <code>local</code> element with the given value will be created. Otherwise, the existing <code>local</code> element will be updated with the given value. <P> <DD><DL> <DT><B>Specified by:</B><DD><CODE><A HREF="../../../../../../org/jboss/shrinkwrap/descriptor/api/javaee5/EjbLocalRefType.html#setLocal(java.lang.String)">setLocal</A></CODE> in interface <CODE><A HREF="../../../../../../org/jboss/shrinkwrap/descriptor/api/javaee5/EjbLocalRefType.html" title="interface in org.jboss.shrinkwrap.descriptor.api.javaee5">EjbLocalRefType</A>&lt;<A HREF="../../../../../../org/jboss/shrinkwrap/descriptor/impl/javaee5/EjbLocalRefTypeImpl.html" title="type parameter in EjbLocalRefTypeImpl">T</A>&gt;</CODE></DL> </DD> <DD><DL> <DT><B>Returns:</B><DD>the current instance of <CODE>EjbLocalRefType<T></CODE></DL> </DD> </DL> <HR> <A NAME="removeLocal()"></A><H3> removeLocal</H3> <PRE> public <A HREF="../../../../../../org/jboss/shrinkwrap/descriptor/api/javaee5/EjbLocalRefType.html" title="interface in org.jboss.shrinkwrap.descriptor.api.javaee5">EjbLocalRefType</A>&lt;<A HREF="../../../../../../org/jboss/shrinkwrap/descriptor/impl/javaee5/EjbLocalRefTypeImpl.html" title="type parameter in EjbLocalRefTypeImpl">T</A>&gt; <B>removeLocal</B>()</PRE> <DL> <DD>Removes the <code>local</code> element <P> <DD><DL> <DT><B>Specified by:</B><DD><CODE><A HREF="../../../../../../org/jboss/shrinkwrap/descriptor/api/javaee5/EjbLocalRefType.html#removeLocal()">removeLocal</A></CODE> in interface <CODE><A HREF="../../../../../../org/jboss/shrinkwrap/descriptor/api/javaee5/EjbLocalRefType.html" title="interface in org.jboss.shrinkwrap.descriptor.api.javaee5">EjbLocalRefType</A>&lt;<A HREF="../../../../../../org/jboss/shrinkwrap/descriptor/impl/javaee5/EjbLocalRefTypeImpl.html" title="type parameter in EjbLocalRefTypeImpl">T</A>&gt;</CODE></DL> </DD> <DD><DL> <DT><B>Returns:</B><DD>the current instance of <CODE>EjbLocalRefType<T></CODE></DL> </DD> </DL> <HR> <A NAME="getLocal()"></A><H3> getLocal</H3> <PRE> public java.lang.String <B>getLocal</B>()</PRE> <DL> <DD>Returns the <code>local</code> element <P> <DD><DL> <DT><B>Specified by:</B><DD><CODE><A HREF="../../../../../../org/jboss/shrinkwrap/descriptor/api/javaee5/EjbLocalRefType.html#getLocal()">getLocal</A></CODE> in interface <CODE><A HREF="../../../../../../org/jboss/shrinkwrap/descriptor/api/javaee5/EjbLocalRefType.html" title="interface in org.jboss.shrinkwrap.descriptor.api.javaee5">EjbLocalRefType</A>&lt;<A HREF="../../../../../../org/jboss/shrinkwrap/descriptor/impl/javaee5/EjbLocalRefTypeImpl.html" title="type parameter in EjbLocalRefTypeImpl">T</A>&gt;</CODE></DL> </DD> <DD><DL> <DT><B>Returns:</B><DD>the node defined for the element <code>local</code></DL> </DD> </DL> <HR> <A NAME="setEjbLink(java.lang.String)"></A><H3> setEjbLink</H3> <PRE> public <A HREF="../../../../../../org/jboss/shrinkwrap/descriptor/api/javaee5/EjbLocalRefType.html" title="interface in org.jboss.shrinkwrap.descriptor.api.javaee5">EjbLocalRefType</A>&lt;<A HREF="../../../../../../org/jboss/shrinkwrap/descriptor/impl/javaee5/EjbLocalRefTypeImpl.html" title="type parameter in EjbLocalRefTypeImpl">T</A>&gt; <B>setEjbLink</B>(java.lang.String&nbsp;ejbLink)</PRE> <DL> <DD>If not already created, a new <code>ejb-link</code> element with the given value will be created. Otherwise, the existing <code>ejb-link</code> element will be updated with the given value. <P> <DD><DL> <DT><B>Specified by:</B><DD><CODE><A HREF="../../../../../../org/jboss/shrinkwrap/descriptor/api/javaee5/EjbLocalRefType.html#setEjbLink(java.lang.String)">setEjbLink</A></CODE> in interface <CODE><A HREF="../../../../../../org/jboss/shrinkwrap/descriptor/api/javaee5/EjbLocalRefType.html" title="interface in org.jboss.shrinkwrap.descriptor.api.javaee5">EjbLocalRefType</A>&lt;<A HREF="../../../../../../org/jboss/shrinkwrap/descriptor/impl/javaee5/EjbLocalRefTypeImpl.html" title="type parameter in EjbLocalRefTypeImpl">T</A>&gt;</CODE></DL> </DD> <DD><DL> <DT><B>Returns:</B><DD>the current instance of <CODE>EjbLocalRefType<T></CODE></DL> </DD> </DL> <HR> <A NAME="removeEjbLink()"></A><H3> removeEjbLink</H3> <PRE> public <A HREF="../../../../../../org/jboss/shrinkwrap/descriptor/api/javaee5/EjbLocalRefType.html" title="interface in org.jboss.shrinkwrap.descriptor.api.javaee5">EjbLocalRefType</A>&lt;<A HREF="../../../../../../org/jboss/shrinkwrap/descriptor/impl/javaee5/EjbLocalRefTypeImpl.html" title="type parameter in EjbLocalRefTypeImpl">T</A>&gt; <B>removeEjbLink</B>()</PRE> <DL> <DD>Removes the <code>ejb-link</code> element <P> <DD><DL> <DT><B>Specified by:</B><DD><CODE><A HREF="../../../../../../org/jboss/shrinkwrap/descriptor/api/javaee5/EjbLocalRefType.html#removeEjbLink()">removeEjbLink</A></CODE> in interface <CODE><A HREF="../../../../../../org/jboss/shrinkwrap/descriptor/api/javaee5/EjbLocalRefType.html" title="interface in org.jboss.shrinkwrap.descriptor.api.javaee5">EjbLocalRefType</A>&lt;<A HREF="../../../../../../org/jboss/shrinkwrap/descriptor/impl/javaee5/EjbLocalRefTypeImpl.html" title="type parameter in EjbLocalRefTypeImpl">T</A>&gt;</CODE></DL> </DD> <DD><DL> <DT><B>Returns:</B><DD>the current instance of <CODE>EjbLocalRefType<T></CODE></DL> </DD> </DL> <HR> <A NAME="getEjbLink()"></A><H3> getEjbLink</H3> <PRE> public java.lang.String <B>getEjbLink</B>()</PRE> <DL> <DD>Returns the <code>ejb-link</code> element <P> <DD><DL> <DT><B>Specified by:</B><DD><CODE><A HREF="../../../../../../org/jboss/shrinkwrap/descriptor/api/javaee5/EjbLocalRefType.html#getEjbLink()">getEjbLink</A></CODE> in interface <CODE><A HREF="../../../../../../org/jboss/shrinkwrap/descriptor/api/javaee5/EjbLocalRefType.html" title="interface in org.jboss.shrinkwrap.descriptor.api.javaee5">EjbLocalRefType</A>&lt;<A HREF="../../../../../../org/jboss/shrinkwrap/descriptor/impl/javaee5/EjbLocalRefTypeImpl.html" title="type parameter in EjbLocalRefTypeImpl">T</A>&gt;</CODE></DL> </DD> <DD><DL> <DT><B>Returns:</B><DD>the node defined for the element <code>ejb-link</code></DL> </DD> </DL> <HR> <A NAME="navbar_bottom"></A> <A HREF="#skip-navbar_bottom" title="Skip navigation links"></A> <TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> <TR> <TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A NAME="<API key>"></A> <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> <TR ALIGN="center" VALIGN="top"> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="class-use/EjbLocalRefTypeImpl.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../index-files/index-1.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD> </TR> </TABLE> </TD> <TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> </EM> </TD> </TR> <TR> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> &nbsp;PREV CLASS&nbsp; &nbsp;<A HREF="../../../../../../org/jboss/shrinkwrap/descriptor/impl/javaee5/EjbRefTypeImpl.html" title="class in org.jboss.shrinkwrap.descriptor.impl.javaee5"><B>NEXT CLASS</B></A></FONT></TD> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../../../../index.html?org/jboss/shrinkwrap/descriptor/impl/javaee5/EjbLocalRefTypeImpl.html" target="_top"><B>FRAMES</B></A> &nbsp; &nbsp;<A HREF="EjbLocalRefTypeImpl.html" target="_top"><B>NO FRAMES</B></A> &nbsp; &nbsp;<SCRIPT type="text/javascript"> <! if(window==top) { document.writeln('<A HREF="../../../../../../allclasses-noframe.html"><B>All Classes</B></A>'); } </SCRIPT> <NOSCRIPT> <A HREF="../../../../../../allclasses-noframe.html"><B>All Classes</B></A> </NOSCRIPT> </FONT></TD> </TR> <TR> <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> SUMMARY:&nbsp;NESTED&nbsp;|&nbsp;FIELD&nbsp;|&nbsp;<A HREF="#constructor_summary">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD> <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> DETAIL:&nbsp;FIELD&nbsp;|&nbsp;<A HREF="#constructor_detail">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD> </TR> </TABLE> <A NAME="skip-navbar_bottom"></A> <HR> </BODY> </HTML>
jetta.urlParser `FUNCTION` - A utility for parsing and validating URLs - Provides options for strict and lax validation - Example: js const urlResults = jetta.urlParser('example.com/about/', {addMissingProtocol: true}) urlResults.isLocalhost // false urlResults.isValid // true urlResults.parsedURL.protocol // 'https:' - jetta.urlParser(`candidate` STRING | OBJECT[, `options` OBJECT]) - Effectively never throws, even on ill-formatted/invalid URLs as it internally catches any errors and returns `results.isValid` = `false` - `candidate` STRING | OBJECT - The URL to parse and validate - If Object, `hostname` attribute is required (an instance of `url.Url` would be handy here) - `options` OBJECT _optional_ - Defaults can be found in `jetta.defaults.urlParser` - `addMissingProtocol` BOOLEAN - Determines if missing protocols should be added for parsing - Example: js jetta.urlParser('example.com', {addMissingProtocol: true}).url - `<API key>` BOOLEAN - Determines if `candidate` is a string, should the parser format it - Set this to `false` for stricter validation - Example: js jetta.urlParser('https://example.com/here there', {<API key>: false}).isValid // returns: false - `ipAddressesAllowed` BOOLEAN - Determines if IP Addresses are allowed (both IPv4 & IPv6) for the hostname - `localhostAllowed` BOOLEAN - Determines if 'localhost' is allowed, including localhost IP Addresses (`127.*.*.*` & `::1`) - Useful for security purposes - Setting this to `true` and `ipAddressesAllowed` to `false` means 'https: - `protocolsAllowed` OBJECT - A key-value object of protocols allowed, where value is `true` - Set to `null` to allow all protocols - Example: js const protocolsAllowed = { 'https:': true, } jetta.urlParser('https://example.com/', {protocolsAllowed}).isValid // true jetta.urlParser('http://example.com/', {protocolsAllowed}).isValid // false - `protocolReplacement` STRING - The protocol to be added when the parsed URL's protocol is missing and `addMissingProtocol === true` - It should be with colons, but without slashes (to match the `url.protocol`'s format). - i.e. 'https:' not 'https' or 'https: - `localhostAllowed` BOOLEAN - Determines if localhost URLs are considered valid - Example: js jetta.urlParser('http://127.0.0.1', {localhostAllowed: true}).isValid // true jetta.urlParser('http://localhost', {localhostAllowed: false}).isValid // false jetta.urlParser('::1', {localhostAllowed: true}).isValid // true - _return_ `results` OBJECT - `isLocalhost` BOOLEAN - `isValid` BOOLEAN - `options` OBJECT - The options used to parse, process, and validate `candidate` - This is never `null` - `addMissingProtocol` BOOLEAN - `<API key>` BOOLEAN - `ipAddressesAllowed` BOOLEAN - `localhostAllowed` BOOLEAN - `protocolsAllowed` OBJECT - `protocolReplacement` STRING - `parsedURL` OBJECT _instanceof_ `url.Url` | `null` - The parsed URL, an instance of node's [url.Url](https://nodejs.org/api/url.html) - If `candidate` was in - `url` STRING - The formatted URL
package us.dot.its.jpo.ode.plugin.j2735; public enum <API key> { <API key>, bicyleUseAllowed, isXwalkFlyOverLane, fixedCycleTime, <API key>, hasPushToWalkButton, audioSupport, <API key>, <API key> }
#!/usr/bin/ruby # Excerpted from "Programming Ruby 1.9", # published by The Pragmatic Bookshelf. # courses, books, articles, and the like. Contact us if you are in doubt. # We make no guarantees that this code is fit for any purpose. require 'webrick' include WEBrick s = HTTPServer.new(Port: 2000) class HelloServlet < HTTPServlet::AbstractServlet def do_GET(req, res) res['Content-Type'] = "text/html" res.body = %{ <html><body> <p>Hello. You're calling from a #{req['User-Agent']}</p> <p>I see parameters: #{req.query.keys.join(', ')}</p> </body></html> } end end s.mount("/hello", HelloServlet) trap("INT"){ s.shutdown } s.start
package cn.edu.kmust.seanlp.extractor.textrank; import java.util.List; import java.util.Map; import java.util.TreeMap; /** * * * @author Zhao Shiyu * */ public class BM25 { int docSentenceNum; double sentAvgLength; List<List<String>> docs; Map<String, Integer>[] wordFreq; Map<String, Integer> df; /** * IDF */ Map<String, Double> idf; final static float k1 = 1.5f; final static float b = 0.75f; public BM25(List<List<String>> docs) { this.docs = docs; docSentenceNum = docs.size(); for (List<String> sentence : docs) { sentAvgLength += sentence.size(); } sentAvgLength /= docSentenceNum; wordFreq = new Map[docSentenceNum]; df = new TreeMap<String, Integer>(); idf = new TreeMap<String, Double>(); init(); } private void init() { int index = 0; for (List<String> sentence : docs) { Map<String, Integer> tf = new TreeMap<String, Integer>(); for (String word : sentence) { Integer freq = tf.get(word); freq = (freq == null ? 0 : freq) + 1; tf.put(word, freq); } wordFreq[index] = tf; for (Map.Entry<String, Integer> entry : tf.entrySet()) { String word = entry.getKey(); Integer freq = df.get(word); freq = (freq == null ? 0 : freq) + 1; df.put(word, freq); } ++index; } for (Map.Entry<String, Integer> entry : df.entrySet()) { String word = entry.getKey(); Integer freq = entry.getValue(); idf.put(word, Math.log(docSentenceNum - freq + 0.5) - Math.log(freq + 0.5)); } } public double sim(List<String> sentence, int index) { double score = 0; for (String word : sentence) { if (!wordFreq[index].containsKey(word)) continue; int d = docs.get(index).size(); Integer wf = wordFreq[index].get(word); score += (idf.get(word) * wf * (k1 + 1) / (wf + k1 * (1 - b + b * d / sentAvgLength))); } return score; } public double[] simAll(List<String> sentence) { double[] scores = new double[docSentenceNum]; for (int i = 0; i < docSentenceNum; ++i) { scores[i] = sim(sentence, i); } return scores; } }
import pdb def calc(i, n): j = i * n return j def f(n): for i in range(n): j = calc(i, n) print(i, j) return if __name__ == '__main__': pdb.set_trace() f(5)
#!/usr/bin/env python if __name__ == '__main__': from gevent import monkey monkey.patch_all() import redis import json import pprint import argparse import mturk_vision import base64 import uuid import pickle import time import databases from hadoop_parse import scrape_hadoop_jobs class <API key>(Exception): """User is not authorized to make this call""" class NotFoundException(Exception): """Task was not found""" class Jobs(object): def __init__(self, host, port, db, <API key>, <API key>): self.args = (host, port, db, <API key>, <API key>) self.redis_host = host self.redis_port = port self.db = redis.StrictRedis(host=host, port=port, db=db) self._owner_prefix = 'owner:' self._task_prefix = 'task:' self._lock_prefix = 'lock:' self.<API key> = <API key> self.<API key> = <API key> self.<API key> = set() def __reduce__(self): return (Jobs, self.args) def add_task(self, type, owner, params, secret_params): task = base64.urlsafe_b64encode(uuid.uuid4().bytes)[:-2] data = {'owner': owner, '_params': json.dumps(secret_params), 'params': json.dumps(params), 'type': type, 'startTime': str(time.time())} if not self.db.set(self._lock_prefix + task, '', nx=True): raise <API key> # TODO: Do these atomically self.db.hmset(self._task_prefix + task, data) self.db.sadd(self._owner_prefix + owner, task) return task def _check_owner(self, task, owner): if self.db.hget(self._task_prefix + task, 'owner') != owner: raise <API key> def _get_task_type(self, task): out = self.db.hgetall(self._task_prefix + task) out = self.db.hget(self._task_prefix + task, 'type') if out is None: raise NotFoundException return out def _check_type(self, task, type): if self._get_task_type(task) != type: raise NotFoundException def _exists(self, task): if not self.db.exists(self._lock_prefix + task): raise NotFoundException def get_task(self, task, owner): self._exists(task) self._check_owner(task, owner) out = self.db.hgetall(self._task_prefix + task) out = dict((k, v) for k, v in out.items() if not k.startswith('_')) return out def get_task_secret(self, task, owner): self._exists(task) self._check_owner(task, owner) return json.loads(self.db.hget(self._task_prefix + task, '_params')) def delete_task(self, task, owner, **kw): self._exists(task) self._check_owner(task, owner) task_type = self._get_task_type(task) if task_type == 'annotation': manager = self.<API key>(task, data_connection=kw['data_connection']) # TODO: Do these atomically self.db.delete(self._task_prefix + task, self._lock_prefix + task) self.db.srem(self._owner_prefix + owner, task) if task_type == 'annotation': manager.destroy() # TODO: MTurk specific # TODO: For Hadoop jobs kill the task if it is running # TODO: For worker/crawl/model jobs kill the worker process or send it a signal def update_task(self, row, columns): self.db.hmset(self._task_prefix + row, columns) def update_hadoop_jobs(self, hadoop_jobtracker): for row, columns in scrape_hadoop_jobs(hadoop_jobtracker, self.<API key>).items(): # NOTE: We do this at this point as a job may not exist but is finished completed/failed in hadoop if columns.get('status', '') in ('completed', 'failed'): self.<API key>.add(row) try: self._exists(row) self._check_type(row, 'process') except NotFoundException: continue # TODO: Need to do this atomically with the exists check self.update_task(row, columns) def get_tasks(self, owner): outs = {} for job_key in self.db.smembers(self._owner_prefix + owner): # TODO: Error check if something gets removed while we are accumulating task = self._task_prefix + job_key if self.db.hget(task, 'owner') == owner: out = self.db.hgetall(task) out = dict((k, v) for k, v in out.items() if not k.startswith('_')) outs[task.split(':', 1)[1]] = out return outs def <API key>(self, task, data_connection, sync=False): self._exists(task) self._check_type(task, 'annotation') data = self.db.hgetall(self._task_prefix + task) p = json.loads(data['params']) ps = json.loads(data['_params']) p['sync'] = sync p['secret'] = str(ps['secret']) p['redis_address'] = self.<API key> p['redis_port'] = int(self.<API key>) p['task_key'] = task # TODO: Currently only compatible with thrift based datastores if data_connection: data_connection = data_connection._thrift return mturk_vision.manager(data=str(ps['data']), data_connection=data_connection, **p) def <API key>(self, task, owner, data_connection): self._exists(task) self._check_type(task, 'annotation') self._check_owner(task, owner) return self.<API key>(task, data_connection) def add_work(self, front, queue, **kw): push = self.db.lpush if front else self.db.rpush push('queue:' + queue, pickle.dumps(kw, -1)) def get_work(self, queues, timeout=0): out = self.db.brpop(['queue:' + x for x in queues], timeout=timeout) if not out: return queue = out[0][:len('queue:')] data = pickle.loads(out[1]) print('Processing job from [%s][%s]' % (queue, data['func'])) pprint.pprint(data['method_args']) return queue, data def main(): def _get_all_tasks(jobs): outs = [] for job_key in jobs.db.keys('task:*'): out = jobs.db.hgetall(job_key) outs.append(out) return outs def _info(args, jobs): pprint.pprint(_get_all_tasks(jobs)) def _destroy(args, jobs): jobs.db.flushall() def job_worker(db, func, method_args, method_kwargs): getattr(db, func)(*method_args, **method_kwargs) def _work(args, jobs): if args.raven: import raven RAVEN = raven.Client(args.raven) else: RAVEN = None import gevent_inotifyx as inotifyx fd = inotifyx.init() # NOTE: .git/logs/HEAD is the last thing updated after a git pull/merge inotifyx.add_watch(fd, '../.git/logs/HEAD', inotifyx.IN_MODIFY) inotifyx.add_watch(fd, '.reloader', inotifyx.IN_MODIFY | inotifyx.IN_ATTRIB) db = THRIFT_CONSTRUCTOR() while 1: try: work = jobs.get_work(args.queues, timeout=5) if work: jobs.add_work(True, 'old' + work[0], **work[1]) job_worker(db=db, **work[1]) if inotifyx.get_events(fd, 0): print('Shutting down due to new update') break except: if RAVEN: RAVEN.captureException() raise parser = argparse.ArgumentParser(description='Picarus job operations') parser.add_argument('--redis_host', help='Redis Host', default='localhost') parser.add_argument('--redis_port', type=int, help='Redis Port', default=6379) parser.add_argument('--raven', help='URL to the Raven/Sentry logging server') parser.add_argument('--<API key>', help='Annotations Host', default='localhost') parser.add_argument('--<API key>', type=int, help='Annotations Port', default=6380) parser.add_argument('--thrift_server', default='localhost') parser.add_argument('--thrift_port', default='9090') parser.add_argument('--database', choices=['hbase', 'hbasehadoop', 'redis'], default='hbasehadoop', help='Select which database to use as our backend. Those ending in hadoop use it for job processing.') subparsers = parser.add_subparsers(help='Commands') subparser = subparsers.add_parser('info', help='Display info about jobs') subparser.set_defaults(func=_info) subparser = subparsers.add_parser('destroy', help='Delete everything in the jobs DB') subparser.set_defaults(func=_destroy) subparser = subparsers.add_parser('work', help='Do background work') parser.add_argument('queues', nargs='+', help='Queues to do work on') subparser.set_defaults(func=_work) args = parser.parse_args() jobs = Jobs(args.redis_host, args.redis_port, 3, args.<API key>, args.<API key>) def THRIFT_CONSTRUCTOR(): return databases.factory(args.database, True, jobs, thrift_server=args.thrift_server, thrift_port=args.thrift_port, redis_host=args.redis_host, redis_port=args.redis_port) args.func(args, jobs) if __name__ == '__main__': main()
// NSObject+Common.h // Clan #import <Foundation/Foundation.h> @interface NSObject (Common) + (BOOL)<API key>:(NSString *)folderName fileName:(NSString *)fileName; //plist + (NSString *)<API key>:(NSString *)key; //plist + (void)updatePlistWithName:(NSString *)name andString:(NSString *)string; //fileName + (NSString* )<API key>:(NSString *)fileName; + (NSString* )<API key>:(NSString *)fileName; + (BOOL)createDirInCache:(NSString *)dirName; - (void)showHudTipStr:(NSString *)tipStr; -(id)<API key>:(NSString *)responseString; - (void)<API key>:(NSString *)tipStr; - (void)showStatusBarError:(NSString *)error; - (void)<API key>:(NSString *)tipStr; - (NSString *)URLEncodedString:(NSString *)string; + (NSString *)<API key>:(NSString *)StringValue; + (BOOL )returnBoolWithPlist:(NSString *)StringValue; + (void)printplist; + (BOOL)<API key>; //- (MBProgressHUD *)hudWithTitle:(NSString *)title; //- (void)hudHide1:(MBProgressHUD *)hud; @end
package com.pinterest.rocksplicator.monitoring.mbeans; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import java.lang.management.ManagementFactory; import java.net.InetAddress; import java.net.<API key>; import javax.management.MBeanServer; import javax.management.<API key>; import javax.management.ObjectName; public class <API key> { private Logger LOG = LoggerFactory.getLogger(<API key>.class); public static final String <API key> = "RocksplicatorReport"; public static final String CLUSTER_DN_KEY = "cluster"; public static final String INSTANCE_DN_KEY = "instanceName"; private MBeanServer beanServer; private <API key> <API key>; private String cluster; private String instanceName; public <API key>(String clusterName, String instanceName) { this.beanServer = ManagementFactory.<API key>(); this.cluster = clusterName; try { this.instanceName = InetAddress.getByName(instanceName.split("_")[0]).getHostName(); LOG.info("Create " + this.toString() + " for instance name: " + this.instanceName); } catch (<API key> e) { LOG.error("Error getting hostname, continue to use: " + instanceName, e); this.instanceName = instanceName; } try { <API key> = new <API key>(this.instanceName); register(<API key>, getObjectName(getInstanceBeanName(this.instanceName))); } catch (Exception e) { LOG.warn(e.toString()); e.printStackTrace(); beanServer = null; } } public void <API key>() { <API key>.<API key>(1); } public void <API key>() { <API key>.<API key>(1); } public void <API key>() { <API key>.<API key>(1); } public void <API key>(double latency) { <API key> .addLatency(<API key>.LATENCY_TYPE.<API key>, latency); } private ObjectName getObjectName(String name) throws <API key> { LOG.info("Registering bean: " + name); return new ObjectName(String.format("%s:%s", <API key>, name)); } public String clusterBeanName() { return String.format("%s=%s", CLUSTER_DN_KEY, cluster); } private String getInstanceBeanName(String instanceName) { return String.format("%s,%s=%s", clusterBeanName(), INSTANCE_DN_KEY, instanceName); } private void register(Object bean, ObjectName name) { if (beanServer == null) { LOG.warn("bean server is null, skip reporting"); return; } try { beanServer.unregisterMBean(name); } catch (Exception e1) { // Swallow silently } try { beanServer.registerMBean(bean, name); } catch (Exception e) { LOG.warn("Could not register MBean", e); } } public void close() { try { unregister(getObjectName(getInstanceBeanName(instanceName))); } catch (<API key> e) { e.printStackTrace(); } } private void unregister(ObjectName name) { if (beanServer == null) { LOG.warn("bean server is null, nothing to do"); return; } try { beanServer.unregisterMBean(name); } catch (Exception e) { e.printStackTrace(); } } }
<?php namespace Contentinum\Entity; use Doctrine\ORM\Mapping as ORM; use <API key>\Entity\AbstractEntity; /** * WebMediaGroup * * @ORM\Table(name="web_media_groups", uniqueConstraints={@ORM\UniqueConstraint(name="MEDIAGROUPS", columns={"groups_name"})}) * @ORM\Entity */ class WebMediaGroups extends AbstractEntity { /** * @var integer * * @ORM\Column(name="id", type="integer", nullable=false, options={"unsigned"=true}) * @ORM\Id * @ORM\GeneratedValue(strategy="NONE") */ private $id; /** * @var string * * @ORM\Column(name="groups_name", type="string", length=200, nullable=false) */ private $groupName; /** * * @var string * * @ORM\Column(name="description", type="text", nullable=true) */ private $description = ''; /** * * @var string * * @ORM\Column(name="resource", type="string", length=50, nullable=false) */ private $resource = ''; /** * * @var string * * @ORM\Column(name="htmlwidgets", type="string", length=50, nullable=false) */ private $htmlwidgets = ''; /** * @var integer * * @ORM\Column(name="created_by", type="integer", nullable=false) */ private $createdBy = '0'; /** * @var integer * * @ORM\Column(name="update_by", type="integer", nullable=false) */ private $updateBy = '0'; /** * @var \DateTime * * @ORM\Column(name="register_date", type="datetime", nullable=false) */ private $registerDate = '0000-00-00 00:00:00'; /** * @var \DateTime * * @ORM\Column(name="up_date", type="datetime", nullable=false) */ private $upDate = '0000-00-00 00:00:00'; /** * Construct * @param array $options */ public function __construct (array $options = null) { if (is_array($options)) { $this->setOptions($options); } } /** (non-PHPdoc) * @see \<API key>\Entity\AbstractEntity::getEntityName() */ public function getEntityName() { return get_class($this); } /** (non-PHPdoc) * @see \<API key>\Entity\AbstractEntity::getPrimaryKey() */ public function getPrimaryKey() { return 'id'; } /** (non-PHPdoc) * @see \<API key>\Entity\AbstractEntity::getPrimaryValue() */ public function getPrimaryValue() { return $this->id; } /** (non-PHPdoc) * @see \<API key>\Entity\AbstractEntity::getProperties() */ public function getProperties() { return get_object_vars($this); } /** * @param number $id * * @return WebMediaGroup */ public function setId($id) { $this->id = $id; return $this; } /** * Get id * * @return integer */ public function getId() { return $this->id; } /** * @return the $groupName */ public function getGroupName() { return $this->groupName; } /** * @param string $groupName * * @return WebMediaGroup */ public function setGroupName($groupName) { $this->groupName = $groupName; return $this; } /** * * @return the $description */ public function getDescription() { return $this->description; } /** * * @param string $description * * @return WebMediaGroup */ public function setDescription($description) { $this->description = $description; return $this; } /** * * @return the $resource */ public function getResource() { return $this->resource; } /** * * @param string $resource * * @return WebMediaGroup */ public function setResource($resource) { $this->resource = $resource; return $this; } /** * * @return the $htmlwidgets */ public function getHtmlwidgets() { return $this->htmlwidgets; } /** * * @param string $htmlwidgets * * @return WebMediaGroup */ public function setHtmlwidgets($htmlwidgets) { $this->htmlwidgets = $htmlwidgets; return $this; } /** * Set createdBy * * @param integer $createdBy * @return WebMediaTags */ public function setCreatedBy($createdBy) { $this->createdBy = $createdBy; return $this; } /** * Get createdBy * * @return integer */ public function getCreatedBy() { return $this->createdBy; } /** * Set updateBy * * @param integer $updateBy * @return WebMediaTags */ public function setUpdateBy($updateBy) { $this->updateBy = $updateBy; return $this; } /** * Get updateBy * * @return integer */ public function getUpdateBy() { return $this->updateBy; } /** * Set registerDate * * @param \DateTime $registerDate * @return WebMediaTags */ public function setRegisterDate($registerDate) { $this->registerDate = $registerDate; return $this; } /** * Get registerDate * * @return \DateTime */ public function getRegisterDate() { return $this->registerDate; } /** * Set upDate * * @param \DateTime $upDate * @return WebMediaTags */ public function setUpDate($upDate) { $this->upDate = $upDate; return $this; } /** * Get upDate * * @return \DateTime */ public function getUpDate() { return $this->upDate; } }
package org.gradle.test.performance.<API key>.p25; public class Production509 { private Production506 property0; public Production506 getProperty0() { return property0; } public void setProperty0(Production506 value) { property0 = value; } private Production507 property1; public Production507 getProperty1() { return property1; } public void setProperty1(Production507 value) { property1 = value; } private Production508 property2; public Production508 getProperty2() { return property2; } public void setProperty2(Production508 value) { property2 = value; } private String property3; public String getProperty3() { return property3; } public void setProperty3(String value) { property3 = value; } private String property4; public String getProperty4() { return property4; } public void setProperty4(String value) { property4 = value; } private String property5; public String getProperty5() { return property5; } public void setProperty5(String value) { property5 = value; } private String property6; public String getProperty6() { return property6; } public void setProperty6(String value) { property6 = value; } private String property7; public String getProperty7() { return property7; } public void setProperty7(String value) { property7 = value; } private String property8; public String getProperty8() { return property8; } public void setProperty8(String value) { property8 = value; } private String property9; public String getProperty9() { return property9; } public void setProperty9(String value) { property9 = value; } }
#include <gtest/gtest.h> #include <sys/wait.h> #include <algorithm> #include <string> #include <vector> #include <boost/filesystem.hpp> #include <boost/scope_exit.hpp> #include <driver.h> using namespace mhc; using namespace std; #if 0 // Unit test helpers namespace { const string g_outputBitCode = "output.bc"; const string g_outputExe = "a.out"; vector<string> g_cleanupFiles = { g_outputExe, g_outputBitCode, "output_opt.bc", "output.o", }; void cleanupFiles() { for (auto& itr : g_cleanupFiles) { boost::filesystem::remove(itr); } } bool createExe(const string& testProgram) { if (!driver::generateOutput(testProgram, g_outputBitCode)) { return false; } if (!driver::optimizeAndLink(g_outputBitCode, g_outputExe)) { return false; } return true; } int runExecutable(const string& exe) { const int r = system(("./" + exe).c_str()); if (r == -1) { return -1; } return WEXITSTATUS(r); } } TEST(DriverTest, BasicFunction) { const auto testProgram = "marklar main() {" " return 3;" "}"; // Cleanup generated intermediate and executable files BOOST_SCOPE_EXIT(void) { cleanupFiles(); } <API key> EXPECT_TRUE(createExe(testProgram)); EXPECT_EQ(3, runExecutable(g_outputExe)); } TEST(DriverTest, FunctionSingleDecl) { const auto testProgram = "marklar main() {" " marklar i = 2;" " return i;" "}"; // Cleanup generated intermediate and executable files BOOST_SCOPE_EXIT(void) { cleanupFiles(); } <API key> EXPECT_TRUE(createExe(testProgram)); EXPECT_EQ(2, runExecutable(g_outputExe)); } TEST(DriverTest, FunctionMultiDecl) { const auto testProgram = "marklar main() {" " marklar i = 2;" " marklar j = 5;" " return j;" "}"; // Cleanup generated intermediate and executable files BOOST_SCOPE_EXIT(void) { cleanupFiles(); } <API key> EXPECT_TRUE(createExe(testProgram)); EXPECT_EQ(5, runExecutable(g_outputExe)); } TEST(DriverTest, <API key>) { const auto testProgram = "marklar main() {" " marklar i = 2;" " marklar j = 5;" " return i + j;" "}"; // Cleanup generated intermediate and executable files BOOST_SCOPE_EXIT(void) { cleanupFiles(); } <API key> EXPECT_TRUE(createExe(testProgram)); EXPECT_EQ(7, runExecutable(g_outputExe)); } TEST(DriverTest, <API key>) { const auto testProgram = "marklar main() {" " marklar i = 2;" " marklar j = 5;" " return i + j + 6;" "}"; // Cleanup generated intermediate and executable files BOOST_SCOPE_EXIT(void) { cleanupFiles(); } <API key> EXPECT_TRUE(createExe(testProgram)); EXPECT_EQ(13, runExecutable(g_outputExe)); } // Tests scoping rules of multiple functions with identical variable names TEST(DriverTest, MultipleFunction) { const auto testProgram = "marklar bar() {" " marklar a = 5;" " return a;" "}" "marklar foo() {" " marklar a = 4;" " return a;" "}" "marklar main() {" " marklar a = 3;" " return a;" "}"; // Cleanup generated intermediate and executable files BOOST_SCOPE_EXIT(void) { cleanupFiles(); } <API key> EXPECT_TRUE(createExe(testProgram)); EXPECT_EQ(3, runExecutable(g_outputExe)); } TEST(DriverTest, FunctionUseArgs) { const auto testProgram = "marklar main(marklar a) {" " return a;" "}"; // Cleanup generated intermediate and executable files BOOST_SCOPE_EXIT(void) { cleanupFiles(); } <API key> EXPECT_TRUE(createExe(testProgram)); EXPECT_EQ(1, runExecutable(g_outputExe)); EXPECT_EQ(2, runExecutable(g_outputExe + " arg1")); EXPECT_EQ(3, runExecutable(g_outputExe + " arg1 arg2")); } TEST(DriverTest, FunctionCall) { const auto testProgram = "marklar foo(marklar a) {" " return a + 1;" "}" "marklar main(marklar a) {" " return foo(a);" "}"; // Cleanup generated intermediate and executable files BOOST_SCOPE_EXIT(void) { cleanupFiles(); } <API key> EXPECT_TRUE(createExe(testProgram)); EXPECT_EQ(2, runExecutable(g_outputExe)); EXPECT_EQ(3, runExecutable(g_outputExe + " arg1")); EXPECT_EQ(4, runExecutable(g_outputExe + " arg1 arg2")); } TEST(DriverTest, <API key>) { const auto testProgram = "marklar main() {" " if (3 < 4) {" " return 1;" " }" " return 0;" "}"; // Cleanup generated intermediate and executable files BOOST_SCOPE_EXIT(void) { cleanupFiles(); } <API key> EXPECT_TRUE(createExe(testProgram)); EXPECT_EQ(1, runExecutable(g_outputExe)); } TEST(DriverTest, <API key>) { const auto testProgram = "marklar main() {" " marklar a = 3;" " marklar b = 4;" " if (a < b) {" " return 1;" " }" " return 0;" "}"; // Cleanup generated intermediate and executable files BOOST_SCOPE_EXIT(void) { cleanupFiles(); } <API key> EXPECT_TRUE(createExe(testProgram)); EXPECT_EQ(1, runExecutable(g_outputExe)); } TEST(DriverTest, <API key>) { const auto testProgram = "marklar main() {" " marklar a = 3;" " marklar b = 4;" " if (a > b) {" " return 1;" " } else {" " return 0;" " }" " return 2;" "}"; // Cleanup generated intermediate and executable files BOOST_SCOPE_EXIT(void) { cleanupFiles(); } <API key> EXPECT_TRUE(createExe(testProgram)); EXPECT_EQ(0, runExecutable(g_outputExe)); } TEST(DriverTest, OperatorLessThan) { const auto testProgram = "marklar main() {" " if (3 < 4) {" " return 1;" " }" " return 0;" "}"; // Cleanup generated intermediate and executable files BOOST_SCOPE_EXIT(void) { cleanupFiles(); } <API key> EXPECT_TRUE(createExe(testProgram)); EXPECT_EQ(1, runExecutable(g_outputExe)); } TEST(DriverTest, OperatorGreaterThan) { const auto testProgram = "marklar main() {" " if (3 > 4) {" " return 1;" " }" " return 2;" "}"; // Cleanup generated intermediate and executable files BOOST_SCOPE_EXIT(void) { cleanupFiles(); } <API key> EXPECT_TRUE(createExe(testProgram)); EXPECT_EQ(2, runExecutable(g_outputExe)); } TEST(DriverTest, OperatorEqual) { const auto testProgram = "marklar main() {" " if (4 == 4) {" " return 1;" " }" " return 2;" "}"; // Cleanup generated intermediate and executable files BOOST_SCOPE_EXIT(void) { cleanupFiles(); } <API key> EXPECT_TRUE(createExe(testProgram)); EXPECT_EQ(1, runExecutable(g_outputExe)); } TEST(DriverTest, OperatorModulo) { const auto testProgram = "marklar main() {" " marklar a = 5 % 3;" " if (a == 2) {" " return 1;" " }" " return 0;" "}"; // Cleanup generated intermediate and executable files BOOST_SCOPE_EXIT(void) { cleanupFiles(); } <API key> EXPECT_TRUE(createExe(testProgram)); EXPECT_EQ(1, runExecutable(g_outputExe)); } TEST(DriverTest, WhileStmt) { const auto testProgram = "marklar main() {" " marklar a = 2;" " marklar b = 6;" " while (a < b) {" " a = a + 1;" " }" " return a;" "}"; // Cleanup generated intermediate and executable files BOOST_SCOPE_EXIT(void) { cleanupFiles(); } <API key> EXPECT_TRUE(createExe(testProgram)); EXPECT_EQ(6, runExecutable(g_outputExe)); } TEST(DriverTest, LogicalOR) { const auto testProgram = "marklar main() {" " marklar a = 0;" " marklar b = 4;" " if ((a == 0) || (b == 0)) {" " return 2;" " }" " return 1;" "}"; // Cleanup generated intermediate and executable files BOOST_SCOPE_EXIT(void) { cleanupFiles(); } <API key> EXPECT_TRUE(createExe(testProgram)); EXPECT_EQ(2, runExecutable(g_outputExe)); } TEST(DriverTest, LogicalAND) { const auto testProgram = "marklar main() {" " marklar a = 0;" " marklar b = 4;" " if ((a == 0) && (b == 0)) {" " return 2;" " }" " return 1;" "}"; // Cleanup generated intermediate and executable files BOOST_SCOPE_EXIT(void) { cleanupFiles(); } <API key> EXPECT_TRUE(createExe(testProgram)); EXPECT_EQ(1, runExecutable(g_outputExe)); } TEST(DriverTest, Division) { const auto testProgram = "marklar main() {" " marklar i = 5 / 3;" " return i;" "}"; // Cleanup generated intermediate and executable files BOOST_SCOPE_EXIT(void) { cleanupFiles(); } <API key> EXPECT_TRUE(createExe(testProgram)); EXPECT_EQ(1, runExecutable(g_outputExe)); } TEST(DriverTest, Subtraction) { const auto testProgram = "marklar main() {" " marklar i = 5 - 3;" " return i;" "}"; // Cleanup generated intermediate and executable files BOOST_SCOPE_EXIT(void) { cleanupFiles(); } <API key> EXPECT_TRUE(createExe(testProgram)); EXPECT_EQ(2, runExecutable(g_outputExe)); } TEST(DriverTest, Multiplication) { const auto testProgram = "marklar main() {" " marklar i = 5 * 3;" " return i;" "}"; // Cleanup generated intermediate and executable files BOOST_SCOPE_EXIT(void) { cleanupFiles(); } <API key> EXPECT_TRUE(createExe(testProgram)); EXPECT_EQ(15, runExecutable(g_outputExe)); } TEST(DriverTest, MultiMethods) { const auto testProgram = "marklar a() {" " return 1;" "}" "marklar main() {" " marklar i = 5 * 3;" " return i;" "}"; // Cleanup generated intermediate and executable files BOOST_SCOPE_EXIT(void) { cleanupFiles(); } <API key> EXPECT_TRUE(createExe(testProgram)); EXPECT_EQ(15, runExecutable(g_outputExe)); } TEST(DriverTest, FuncCallInIfStmt) { const auto testProgram = "marklar func1(marklar a) {" " return a + 5;" "}" "marklar main() {" " if (func1(10) < 15) {" " return 1;" " }" " return func1(10);" "}"; // Cleanup generated intermediate and executable files BOOST_SCOPE_EXIT(void) { cleanupFiles(); } <API key> EXPECT_TRUE(createExe(testProgram)); EXPECT_EQ(15, runExecutable(g_outputExe)); } TEST(DriverTest, IfWith2ReturnStmt) { const auto testProgram = "marklar main() {" " if (1 == 1) {" " return 1;" " return 2;" " } else {" " return 0;" " return 5;" " }" " return 0;" "}"; // Cleanup generated intermediate and executable files BOOST_SCOPE_EXIT(void) { cleanupFiles(); } <API key> EXPECT_TRUE(createExe(testProgram)); EXPECT_EQ(1, runExecutable(g_outputExe)); } TEST(DriverTest, WhileWithReturnStmt) { const auto testProgram = "marklar main() {" " while (1 == 1) {" " return 1;" " }" " return 0;" "}"; // Cleanup generated intermediate and executable files BOOST_SCOPE_EXIT(void) { cleanupFiles(); } <API key> EXPECT_TRUE(createExe(testProgram)); EXPECT_EQ(1, runExecutable(g_outputExe)); } TEST(DriverTest, <API key>) { const auto testProgram = "marklar main() {" " return 2;" " while (1 == 1) {" " return 1;" " }" " return 0;" "}"; // Cleanup generated intermediate and executable files BOOST_SCOPE_EXIT(void) { cleanupFiles(); } <API key> EXPECT_TRUE(createExe(testProgram)); EXPECT_EQ(2, runExecutable(g_outputExe)); } TEST(DriverTest, <API key>) { const auto testProgram = "marklar unaryFunc(marklar n) {" " return n + 1;" "}" "marklar binaryFunc(marklar a, marklar b) {" " return unaryFunc((a * a) + (b * b));" "}" "marklar main() {" " return binaryFunc(1, 5);" "}"; // Cleanup generated intermediate and executable files BOOST_SCOPE_EXIT(void) { cleanupFiles(); } <API key> EXPECT_TRUE(createExe(testProgram)); EXPECT_EQ(27, runExecutable(g_outputExe)); } #endif
import { color, select } from "@storybook/addon-knobs/react"; import { availableSizes, availableSurfaces } from "../constants"; const knobGroupIds = { basic: "Basic" }; export default function getKnobs(props) { return { props, size: select("Size", availableSizes, "m", knobGroupIds.basic), surface: select( "Surface", availableSurfaces, undefined, knobGroupIds.basic ), mask: color("Mask", undefined, knobGroupIds.basic) }; }
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="width=device-width, initial-scale=1"> <meta name="description" content=""> <meta name="author" content=""> <title>Bárbara Piñeiro Pessoa</title> <link href="css/bootstrap.min.css" rel="stylesheet"> <!-- Custom CSS --> <link href="css/freelancer.css" rel="stylesheet"> <!-- Custom Fonts --> <link href="font-awesome/css/font-awesome.min.css" rel="stylesheet" type="text/css"> <link href='http://fonts.googleapis.com/css?family=Lobster+Two' rel='stylesheet' type='text/css'> <link href="http://fonts.googleapis.com/css?family=Montserrat:400,700" rel="stylesheet" type="text/css"> <link href="http://fonts.googleapis.com/css?family=Lato:400,700,400italic,700italic" rel="stylesheet" type="text/css"> <link href='http://fonts.googleapis.com/css?family=Kaushan+Script' rel='stylesheet' type='text/css'> <link href='http://fonts.googleapis.com/css?family=Droid+Serif:400,700,400italic,700italic' rel='stylesheet' type='text/css'> <link href='http://fonts.googleapis.com/css?family=Roboto+Slab:400,100,300,700' rel='stylesheet' type='text/css'> <!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries --> <!-- WARNING: Respond.js doesn't work if you view the page via file: <!--[if lt IE 9]> <script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script> <script src="https://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js"></script> <![endif] </head> <body id="page-top" class="index"> <!-- Navigation --> <nav class="navbar navbar-default navbar-fixed-top"> <div class="container"> <!-- Brand and toggle get grouped for better mobile display --> <div class="navbar-header page-scroll"> <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#<API key>"> <span class="sr-only">Toggle navigation</span> <span class="icon-bar"></span> <span class="icon-bar"></span> <span class="icon-bar"></span> </button> <a class="navbar-brand" href=" </div> <!-- Collect the nav links, forms, and other content for toggling --> <div class="collapse navbar-collapse" id="<API key>"> <ul class="nav navbar-nav navbar-right"> <li class="hidden"> <a href="#page-top"></a> </li> <li class="page-scroll"> <a href="#portfolio">Services</a> </li> <li class="page-scroll"> <a href="#about">About</a> </li> <li class="page-scroll"> <a href="#contact">Contact</a> </li> <li class="dropdown"> <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false">English<span class="caret"></span></a> <ul class="dropdown-menu" role="menu"> <li><a href="spanish.html">Español</a></li> <li><a href="portuguese.html">Português</a></li> </ul> </li> </ul> </div> <!-- /.navbar-collapse --> </div> <!-- /.container-fluid --> </nav> <!-- Header --> <header> <div class="container"> <div class="row"> <div class="col-lg-12"> <div class="intro-text"> <span class="name">Translation - Linguistic Services - Teaching</span> <hr class="star-light"> <span class="skills">English - Spanish - Portuguese</span> </div> </div> </div> </header> <!-- Portfolio Grid Section --> <section id="services"> <div class="container"> <div class="row"> <div class="col-lg-12 text-center"> <h2>Services</h2> <hr class="star-primary"> </div> </div> <div class="row text-center"> <div class="col-md-4"> <span class="fa-stack fa-4x"> <i class="fa fa-circle fa-stack-2x text-primary"></i> <i class="fa fa-exchange fa-stack-1x fa-inverse"></i> </span> <h4 class="service-heading">Translation</h4> <p class="text-muted"> Translation of websites, academic articles, manuals and other technical documents. </p> </div> <div class="col-md-4"> <span class="fa-stack fa-4x"> <i class="fa fa-circle fa-stack-2x text-primary"></i> <i class="fa fa-pencil fa-stack-1x fa-inverse"></i> </span> <h4 class="service-heading">Linguistic services</h4> <p class="text-muted"> I can help you tailor your text according to its communicative needs. I offer interpreting services for small meetings. </p> </div> <div class="col-md-4"> <span class="fa-stack fa-4x"> <i class="fa fa-circle fa-stack-2x text-primary"></i> <i class="fa fa-book fa-stack-1x fa-inverse"></i> </span> <h4 class="service-heading">Teaching</h4> <p class="text-muted"> I provide portuguese classes for specific work-related or academic purposes to both individuals, groups and companies. </p> </div> </div> </div> </section> <!-- About Section --> <section class="success" id="about"> <div class="container"> <div class="row"> <div class="col-lg-12 text-center"> <h2>About</h2> <hr class="star-light"> </div> </div> <div class="row"> <div class="col-lg-6"> <p> My name is Bárbara Piñeiro Pessôa and I hold a a degree in Portuguese Language and Brazilian Literature (2007) and Spanish Language and Literature (2008) from Universidade Federal de Juiz de Fora. I also hold a Postgraduate Degree in Translation (2011) from Universidade Gama Filho, UGF, Rio De Janeiro. I have a Master's in Hispanoamerican Literature (2010) granted by Conselho Nacional de Desenvolvimento Científico e Tecnológico, CNPq, from Universidade Federal Fluminense. </p> </div> <div class="col-lg-6"> <p> Ph.D in Comparative Literature at University Federal Fluminense where I was awarded a doctorade scholarship by Conselho Nacional de Desenvolvimento Científico e Tecnológico, CNPq. I worked as a researcher at the Institute of Hispanoamerican Literature of the University of Buenos Aires due to a scholarship granted by Fundação de Amparo a Pesquisa Carlos Chagas from Rio de Janeiro. </p> </div> </div> </div> </section> <!-- Footer --> <footer class="text-center"> <div class="footer-above"> <div class="container"> <div class="row"> <div class="footer-col col-md-4"> </div> <div class="footer-col col-md-4"> <h3>Contact Me</h3> <ul class="list-inline"> <li> <a href="//ar.linkedin.com/in/<API key>" class="btn-social btn-outline"><i class="fa fa-fw fa-linkedin"></i></a> </li> <li> <a href="skype:barbara.nayla.pessoa?add" class="btn-social btn-outline"><i class="fa fa-fw fa-skype"></i></a> </li> <li> <a href="mailto:brartradu@gmail.com" class="btn-social btn-outline"><i class="fa fa-fw fa-envelope"></i></a> </li> </ul> </div> <div class="footer-col col-md-4"> </div> </div> </div> </div> <div class="footer-below"> <div class="container"> <div class="row"> <div class="col-lg-12"> Copyright &copy; Bárbara Piñeiro Pessôa 2015 </div> </div> </div> </div> </footer> <!-- Scroll to Top Button (Only visible on small and extra-small screen sizes) --> <div class="scroll-top page-scroll visible-xs visble-sm"> <a class="btn btn-primary" href="#page-top"> <i class="fa fa-chevron-up"></i> </a> </div> <!-- jQuery --> <script src="js/jquery.js"></script> <!-- Bootstrap Core JavaScript --> <script src="js/bootstrap.min.js"></script> <!-- Plugin JavaScript --> <script src="http://cdnjs.cloudflare.com/ajax/libs/jquery-easing/1.3/jquery.easing.min.js"></script> <script src="js/classie.js"></script> <script src="js/cbpAnimatedHeader.js"></script> <!-- Contact Form JavaScript --> <script src="js/<API key>.js"></script> <!-- Custom Theme JavaScript --> <script src="js/freelancer.js"></script> </body> </html>
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using KFSoft.CommonLib; using Newtonsoft.Json; using Newtonsoft.Json.Converters; using Newtonsoft.Json.Serialization; using Newtonsoft.Json.Linq; using System.Threading; namespace RawDataCollect { <summary> His2Hour_Bitstamp_BTCUSD_RAW </summary> class Program { static void Main(string[] args) { Console.WriteLine("Start collect CryptoCurrency market history hour data......"); Console.WriteLine("Please input exchange name:"); string exchangename = Console.ReadLine(); Console.WriteLine("Please input from symbol to collect:"); string fromsymbol = Console.ReadLine().ToUpper(); Console.WriteLine("Please input to symbol to collect:"); string tosymbol = Console.ReadLine().ToUpper(); //Console.WriteLine("Please input to time(gmttimestamp) to collect:"); int maxcount = 167; int totalmax = 20000; int insertnum = 0; double totime = TimeHelper.GetTimeStamp(DateTime.Now); string url = @"https://min-api.cryptocompare.com/data/histohour?fsym=" + fromsymbol.ToUpper() + "&tsym=" + tosymbol.ToUpper() + "&limit=" + maxcount.ToString() + "&e="+ exchangename + "&toTs=" + totime.ToString(); //check sql data table string sqltablename = "His2Hour_" + exchangename + "_" + fromsymbol + tosymbol + "_RAW"; if (CheckDataTableName(sqltablename)) { Console.WriteLine(sqltablename + " exist.start collect......"); } else { Console.WriteLine(sqltablename + " dose not exist.create new table......"); CreatDataTable(sqltablename); } bool flag = true; HttpResult hr = new HttpResult(); HttpHelper hh = new HttpHelper(); HttpItem hi = new HttpItem(); while (flag) { try { hi.URL = url; hr = hh.GetHtml(hi); string rawjson = hr.Html; JObject jo = JObject.Parse(rawjson); string response = jo["Response"].ToString(); if (response == "Success") { JArray jlist = JArray.Parse(jo["Data"].ToString()); //JArrayJObject for (int i = 0; i < jlist.Count; ++i) //JArray { JObject tempo = JObject.Parse(jlist[i].ToString()); string sql = "insert into "+ sqltablename + " values('" + TimeHelper.<API key>(tempo["time"].ToString()) + "'," + tempo["close"].ToString() + "," + tempo["high"].ToString() + "," + tempo["open"].ToString() + "," + tempo["low"].ToString() + "," + tempo["volumefrom"].ToString() + "," + tempo["volumeto"].ToString() + ")"; try { Console.WriteLine("ts:"+TimeHelper.<API key>(tempo["time"].ToString()) + "',close:" + tempo["close"].ToString() + ",high:" + tempo["high"].ToString() + ",open:" + tempo["open"].ToString() + ",low:" + tempo["low"].ToString() + ",vf:" + tempo["volumefrom"].ToString() + ",vt:" + tempo["volumeto"].ToString()); SqlHelper.ExecuteNonQuery(SqlHelper.GetConnSting(), System.Data.CommandType.Text, sql); insertnum++; if (insertnum >= totalmax) flag = false ; } catch(Exception err) { Console.WriteLine(err.Message); } } url = @"https://min-api.cryptocompare.com/data/histohour?fsym=" + fromsymbol.ToUpper() + "&tsym=" + tosymbol.ToUpper() + "&limit=" + maxcount.ToString() + "&e=" + exchangename + "&toTs=" +jo["TimeFrom"].ToString(); } else { Console.WriteLine(rawjson); } } catch { } } Console.WriteLine("20000 datas collected press any key to exit......"); Console.ReadKey(); } static bool CheckDataTableName(string tablename) { bool flag = false; var sdr = SqlHelper.ExecuteScalar(SqlHelper.GetConnSting(), System.Data.CommandType.Text, "select * from sys.tables where name ='" + tablename + "'"); if (sdr != null) flag = true; return flag; } static void CreatDataTable(string tablename) { string sqlcontent = "CREATE TABLE [dbo].["+tablename+"](" + "[id][int] IDENTITY(1, 1) NOT NULL," + "[ts] [datetime] NULL," + "[close] [float] NULL," + "[high] [float] NULL," + "[open] [float] NULL," + "[low] [float] NULL," + "[volumefrom] [float] NULL," + "[volumeto] [float] NULL," + "CONSTRAINT[IX_"+tablename+"] UNIQUE NONCLUSTERED" + "(" + "[ts] ASC" + ")WITH(PAD_INDEX = OFF, <API key> = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON[PRIMARY]" + ") ON[PRIMARY]"; SqlHelper.ExecuteNonQuery(SqlHelper.GetConnSting(), System.Data.CommandType.Text, sqlcontent); } } class OCHL { public DateTime ts; public double close; public double high; public double low; public double open; public double volumefrom; public double volumeto; } }
/** * @requires SuperMap/Renderer.js */ /** * SuperMap.Renderer.Canvas * A renderer based on the 2D 'canvas' drawing element. * * Inherits: * - <SuperMap.Renderer> */ SuperMap.Renderer.Canvas = SuperMap.Class(SuperMap.Renderer, { //{src:src, img:img} //srcArr:[], // imgArr: {}, /** * APIProperty: hitDetection * {Boolean} Allow for hit detection of features. Default is true. */ hitDetection: true, /** * Property: hitOverflow * {Number} The method for converting feature identifiers to color values * supports 16777215 sequential values. Two features cannot be * predictably detected if their identifiers differ by more than this * value. The hitOverflow allows for bigger numbers (but the * difference in values is still limited). */ hitOverflow: 0, /** * Property: canvas * {Canvas} The canvas context object. */ canvas: null, /** * Property: features * {Object} Internal object of feature/style pairs for use in redrawing the layer. */ features: null, /** * Property: pendingRedraw * {Boolean} The renderer needs a redraw call to render features added while * the renderer was locked. */ pendingRedraw: false, /** * Property: cachedSymbolBounds * {Object} Internal cache of calculated symbol extents. */ cachedSymbolBounds: {}, /** * Property: londingimgs * {Object} */ londingimgs:{}, /** * Constructor: SuperMap.Renderer.Canvas * * Parameters: * containerID - {<String>} * options - {Object} Optional properties to be set on the renderer. */ initialize: function(containerID, options) { SuperMap.Renderer.prototype.initialize.apply(this, arguments); this.root = document.createElement("canvas"); this.container.appendChild(this.root); this.canvas = this.root.getContext("2d"); this.features = {}; if (this.hitDetection) { this.hitCanvas = document.createElement("canvas"); this.hitContext = this.hitCanvas.getContext("2d"); } }, /** * Method: setExtent * Set the visible part of the layer. * * Parameters: * extent - {<SuperMap.Bounds>} * resolutionChanged - {Boolean} * * Returns: * {Boolean} true to notify the layer that the new extent does not exceed * the coordinate range, and the features will not need to be redrawn. * False otherwise. */ setExtent: function(extent, resolutionChanged) { SuperMap.Renderer.prototype.setExtent.apply(this, arguments); // always redraw features return false; }, /** * Method: eraseGeometry * Erase a geometry from the renderer. Because the Canvas renderer has * 'memory' of the features that it has drawn, we have to remove the * feature so it doesn't redraw. * * Parameters: * geometry - {<SuperMap.Geometry>} * featureId - {String} */ eraseGeometry: function(geometry, featureId) { this.eraseFeatures(this.features[featureId][0]); }, /** * APIMethod: supported * * Returns: * {Boolean} Whether or not the browser supports the renderer class */ supported: function() { var canvas = document.createElement("canvas"); return !!canvas.getContext; }, /** * Method: setSize * Sets the size of the drawing surface. * * Once the size is updated, redraw the canvas. * * Parameters: * size - {<SuperMap.Size>} */ setSize: function(size) { this.size = size.clone(); var root = this.root; root.style.width = size.w + "px"; root.style.height = size.h + "px"; root.width = size.w; root.height = size.h; this.resolution = null; if (this.hitDetection) { var hitCanvas = this.hitCanvas; hitCanvas.style.width = size.w + "px"; hitCanvas.style.height = size.h + "px"; hitCanvas.width = size.w; hitCanvas.height = size.h; } }, /** * Method: drawFeature * Draw the feature. Stores the feature in the features list, * then redraws the layer. * * Parameters: * feature - {<SuperMap.Feature.Vector>} * style - {<Object>} * * Returns: * {Boolean} The feature has been drawn completely. If the feature has no * geometry, undefined will be returned. If the feature is not rendered * for other reasons, false will be returned. */ drawFeature: function(feature, style) { var rendered; if (feature.geometry) { style = this.<API key>(style || feature.style); // don't render if display none or feature outside extent var bounds = feature.geometry.getBounds(); rendered = (style.display !== "none") && !!bounds && bounds.intersectsBounds(this.extent); if (rendered) { // keep track of what we have rendered for redraw this.features[feature.id] = [feature, style]; } else { // remove from features tracked for redraw delete(this.features[feature.id]); } this.pendingRedraw = true; } if (this.pendingRedraw && !this.locked) { this.redraw(); this.pendingRedraw = false; } return rendered; }, /** * Method: drawGeometry * Used when looping (in redraw) over the features; draws * the canvas. * * Parameters: * geometry - {<SuperMap.Geometry>} * style - {Object} */ drawGeometry: function(geometry, style, featureId) { var className = geometry.CLASS_NAME; if ((className === "SuperMap.Geometry.Collection") || (className === "SuperMap.Geometry.MultiPoint") || (className === "SuperMap.Geometry.MultiLineString") || (className === "SuperMap.Geometry.MultiPolygon")|| (className === "SuperMap.REST.Route")) { for (var i = 0; i < geometry.components.length; i++) { this.drawGeometry(geometry.components[i], style, featureId); } return; } if(SuperMap.Geometry.LinearRing && (geometry instanceof SuperMap.Geometry.LinearRing)){ this.drawLinearRing(geometry, style, featureId); } else if(SuperMap.Geometry.LineString && (geometry instanceof SuperMap.Geometry.LineString)){ this.drawLineString(geometry, style, featureId); } else if(SuperMap.Geometry.Polygon && (geometry instanceof SuperMap.Geometry.Polygon)){ if(style.fill == false) { var fillOpacity = style.fillOpacity; style.fill = true; style.fillOpacity = 0; } this.drawPolygon(geometry, style, featureId); } else if(SuperMap.Geometry.Point && (geometry instanceof SuperMap.Geometry.Point)){ this.drawPoint(geometry, style, featureId); } else if(SuperMap.Geometry.Rectangle && (geometry instanceof SuperMap.Geometry.Rectangle)){ this.drawRectangle(geometry, style, featureId); } if(fillOpacity) { style.fill = false; style.fillOpacity = fillOpacity; fillOpacity = ""; } }, /** * Method: drawExternalGraphic * Called to draw External graphics. * * Parameters: * geometry - {<SuperMap.Geometry>} * style - {Object} * featureId - {String} */ drawExternalGraphic: function(geometry, style, featureId) { var t = this; if(this.londingimgs[featureId]){ this.londingimgs[featureId].onload = function(){return false;} } var onLoad = function () { var featureId = this.featureId; var geometry = this.geometry; var style = this.style; var img = this.img; t.londingimgs[featureId] = null; if (!t.features[featureId]) { return; } var width = style.graphicWidth || style.graphicHeight; var height = style.graphicHeight || style.graphicWidth; width = width ? width : style.pointRadius * 2; height = height ? height : style.pointRadius * 2; var xOffset = (style.graphicXOffset != undefined) ? style.graphicXOffset : -(0.5 * width); var yOffset = (style.graphicYOffset != undefined) ? style.graphicYOffset : -(0.5 * height); var opacity = style.graphicOpacity || style.fillOpacity; var pt = t.getLocalXY(geometry); var p0 = pt[0]; var p1 = pt[1]; if (!isNaN(p0) && !isNaN(p1)) { var canvas = t.canvas; //Canvas canvas.save(); var rotation; if (style.rotation) { rotation = style.rotation / 180 * Math.PI; } canvas.translate(p0, p1); if (rotation) { canvas.rotate(rotation); } canvas.translate(xOffset, yOffset); canvas.globalAlpha = opacity; var factor = SuperMap.Renderer.Canvas.<API key> || (SuperMap.Renderer.Canvas.<API key> = /android 2.1/.test(navigator.userAgent.toLowerCase()) ? // 320 is the screen width of the G1 phone, for // which drawImage works out of the box. 320 / window.screen.width : 1 ); canvas.drawImage( img, 0, 0, width * factor, height * factor ); canvas.restore(); if (t.hitDetection) { t.setHitContextStyle("fill", featureId); t.hitContext.save(); t.hitContext.translate(p0, p1); if (rotation) { t.hitContext.rotate(rotation); } t.hitContext.translate(xOffset, yOffset); t.hitContext.fillRect(0, 0, width, height); t.hitContext.restore(); } } }; if(this.features[featureId][0].img) { var img = this.features[featureId][0].img; //img.src = style.externalGraphic; // onload(onload.call) img.onload.call({ featureId : featureId, geometry :geometry, style : style, img:img }); } else { var img = new Image(); img.src = style.externalGraphic; this.londingimgs[featureId] = img; this.features[featureId][0].img = img; if (style.graphicTitle) { img.title = style.graphicTitle; } img.onload = function() { onLoad.call({ featureId : featureId, geometry :geometry, style : style, img:img }); }; if(this.features[featureId][0].geometry.isPlottingGeometry === true){ img.onload(); } } //t.canvas.<API key> = "destination-over"; }, /** * Method: setCanvasStyle * Prepare the canvas for drawing by setting various global settings. * * Parameters: * type - {String} one of 'stroke', 'fill', or 'reset' * style - {Object} Symbolizer hash */ setCanvasStyle: function(type, style) { if (type === "fill") { if(style.fillColor instanceof CanvasGradient){ this.canvas.globalAlpha = 1; this.canvas.fillStyle = style['fillColor']; } else { this.canvas.globalAlpha = style['fillOpacity']; this.canvas.fillStyle = style['fillColor']; } } else if (type === "stroke") { this.canvas.globalAlpha = style['strokeOpacity']; this.canvas.lineCap = style['strokeLinecap']; this.canvas.strokeStyle = style['strokeColor']; this.canvas.lineWidth = style['strokeWidth']; } else { this.canvas.globalAlpha = 0; this.canvas.lineWidth = 1; } }, /** * Method: featureIdToHex * Convert a feature ID string into an RGB hex string. * * Parameters: * featureId - {String} Feature id * * Returns: * {String} RGB hex string. */ featureIdToHex: function(featureId) { var id = Number(featureId.split("_").pop()) + 1; // zero for no feature if (id >= 16777216) { this.hitOverflow = id - 16777215; id = id % 16777216 + 1; } var hex = "000000" + id.toString(16); var len = hex.length; hex = "#" + hex.substring(len-6, len); return hex; }, /** * Method: setHitContextStyle * Prepare the hit canvas for drawing by setting various global settings. * * Parameters: * type - {String} one of 'stroke', 'fill', or 'reset' * featureId - {String} The feature id. * symbolizer - {<SuperMap.Symbolizer>} The symbolizer. */ setHitContextStyle: function(type, featureId, symbolizer) { var hex = this.featureIdToHex(featureId); if(symbolizer && symbolizer.strokeLinecap) { this.hitContext.lineCap = symbolizer.strokeLinecap; } if (type === "fill") { this.hitContext.globalAlpha = 1.0; this.hitContext.fillStyle = hex; } else if (type === "stroke") { this.hitContext.globalAlpha = 1.0; this.hitContext.strokeStyle = hex; // bump up stroke width to deal with antialiasing this.hitContext.lineWidth = symbolizer.strokeWidth + 2; } else { this.hitContext.globalAlpha = 0; this.hitContext.lineWidth = 1; } }, /** * Method: drawPoint * This method is only called by the renderer itself. * * Parameters: * geometry - {<SuperMap.Geometry>} * style - {Object} * featureId - {String} */ drawPoint: function(geometry, style, featureId) { if(style.graphic !== false) { if(style.externalGraphic) { this.drawExternalGraphic(geometry, style, featureId); }else if (style.graphicName && (style.graphicName != "circle")) { this.drawNamedSymbol(geometry, style, featureId); } else { var pt = this.getLocalXY(geometry); var p0 = pt[0]; var p1 = pt[1]; if(!isNaN(p0) && !isNaN(p1)) { var twoPi = Math.PI*2; var radius = style.pointRadius; if(style.fill !== false) { this.setCanvasStyle("fill", style); this.canvas.beginPath(); this.canvas.arc(p0, p1, radius, 0, twoPi, true); this.canvas.fill(); if (this.hitDetection) { this.setHitContextStyle("fill", featureId, style); this.hitContext.beginPath(); this.hitContext.arc(p0, p1, radius, 0, twoPi, true); this.hitContext.fill(); } } if(style.stroke !== false) { this.setCanvasStyle("stroke", style); this.canvas.beginPath(); this.canvas.arc(p0, p1, radius, 0, twoPi, true); this.canvas.stroke(); if (this.hitDetection) { this.setHitContextStyle("stroke", featureId, style); this.hitContext.beginPath(); this.hitContext.arc(p0, p1, radius, 0, twoPi, true); this.hitContext.stroke(); } this.setCanvasStyle("reset"); } } } } }, /** * Method: drawNamedSymbol * * * Parameters: * geometry - {<SuperMap.Geometry>} * style - {Object} * featureId - {String} */ drawNamedSymbol: function(geometry, style, featureId) { var x, y, cx, cy, i, symbolBounds, scaling, angle; var unscaledStrokeWidth; var deg2rad = Math.PI / 180.0; var symbol = SuperMap.Renderer.symbol[style.graphicName]; if (!symbol) { throw new Error(style.graphicName + ' is not a valid symbol name'); } if (!symbol.length || symbol.length < 2) return; var pt = this.getLocalXY(geometry); var p0 = pt[0]; var p1 = pt[1]; if (isNaN(p0) || isNaN(p1)) return; // Use rounded line caps this.canvas.lineCap = "round"; this.canvas.lineJoin = "round"; if (this.hitDetection) { this.hitContext.lineCap = "round"; this.hitContext.lineJoin = "round"; } // Scale and rotate symbols, using precalculated bounds whenever possible. if (style.graphicName in this.cachedSymbolBounds) { symbolBounds = this.cachedSymbolBounds[style.graphicName]; } else { symbolBounds = new SuperMap.Bounds(); if(style.graphicName === 'sector'){ }else{ for(i = 0; i < symbol.length; i+=2) { symbolBounds.extend(new SuperMap.LonLat(symbol[i], symbol[i+1])); } } this.cachedSymbolBounds[style.graphicName] = symbolBounds; } // Push symbol scaling, translation and rotation onto the transformation stack in reverse order. // Don't forget to apply all canvas transformations to the hitContext canvas as well(!) this.canvas.save(); if (this.hitDetection) { this.hitContext.save(); } // Step 3: place symbol at the desired location this.canvas.translate(p0,p1); if (this.hitDetection) { this.hitContext.translate(p0,p1); } // Step 2a. rotate the symbol if necessary angle = deg2rad * style.rotation; // will be NaN when style.rotation is undefined. if (!isNaN(angle)) { this.canvas.rotate(angle); if (this.hitDetection) { this.hitContext.rotate(angle); } } // // Step 2: scale symbol such that pointRadius equals half the maximum symbol dimension. scaling = 2.0 * style.pointRadius / Math.max(symbolBounds.getWidth(), symbolBounds.getHeight()); if(style.graphicName === 'sector'){ scaling = style.pointRadius / 10; } this.canvas.scale(scaling,scaling); if (this.hitDetection) { this.hitContext.scale(scaling,scaling); } // Step 1: center the symbol at the origin cx = symbolBounds.getCenterLonLat().lon; cy = symbolBounds.getCenterLonLat().lat; if(style.graphicName !== 'sector'){ this.canvas.translate(-cx,-cy); } if (this.hitDetection && style.graphicName !== 'sector') { this.hitContext.translate(-cx,-cy); } // Don't forget to scale stroke widths, because they are affected by canvas scale transformations as well(!) // Alternative: scale symbol coordinates manually, so stroke width scaling is not needed anymore. unscaledStrokeWidth = style.strokeWidth; style.strokeWidth = unscaledStrokeWidth / scaling; if (style.fill !== false) { this.setCanvasStyle("fill", style); this.canvas.beginPath(); for (i=0; i<symbol.length; i=i+2) { x = symbol[i]; y = symbol[i+1]; if (i == 0) this.canvas.moveTo(x,y); this.canvas.lineTo(x,y); } this.canvas.closePath(); this.canvas.fill(); if (this.hitDetection) { this.setHitContextStyle("fill", featureId, style); this.hitContext.beginPath(); for (i=0; i<symbol.length; i=i+2) { x = symbol[i]; y = symbol[i+1]; if (i == 0) this.canvas.moveTo(x,y); this.hitContext.lineTo(x,y); } this.hitContext.closePath(); this.hitContext.fill(); } } if (style.stroke !== false) { this.setCanvasStyle("stroke", style); this.canvas.beginPath(); for (i=0; i<symbol.length; i=i+2) { x = symbol[i]; y = symbol[i+1]; if (i == 0) this.canvas.moveTo(x,y); this.canvas.lineTo(x,y); } this.canvas.closePath(); this.canvas.stroke(); if (this.hitDetection) { this.setHitContextStyle("stroke", featureId, style); this.hitContext.beginPath(); for (i=0; i<symbol.length; i=i+2) { x = symbol[i]; y = symbol[i+1]; if (i == 0) this.canvas.moveTo(x,y); this.hitContext.lineTo(x,y); } this.hitContext.closePath(); this.hitContext.stroke(); } } style.strokeWidth = unscaledStrokeWidth; this.canvas.restore(); if (this.hitDetection) { this.hitContext.restore(); } }, /** * Method: drawLineString * This method is only called by the renderer itself. * * Parameters: * geometry - {<SuperMap.Geometry>} * style - {Object} * featureId - {String} */ drawLineString: function(geometry, style, featureId) { style = SuperMap.Util.applyDefaults({fill: false}, style); this.drawLinearRing(geometry, style, featureId); }, /** * Method: drawLinearRing * This method is only called by the renderer itself. * * Parameters: * geometry - {<SuperMap.Geometry>} * style - {Object} * featureId - {String} */ drawLinearRing: function(geometry, style, featureId) { if (style.fill !== false) { this.setCanvasStyle("fill", style); this.renderPath(this.canvas, geometry, style, featureId, "fill"); if (this.hitDetection) { this.setHitContextStyle("fill", featureId, style); this.renderPath(this.hitContext, geometry, style, featureId, "fill"); } } if (style.stroke !== false) { this.setCanvasStyle("stroke", style); this.renderPath(this.canvas, geometry, style, featureId, "stroke"); if (this.hitDetection) { this.setHitContextStyle("stroke", featureId, style); this.renderPath(this.hitContext, geometry, style, featureId, "stroke"); } } this.setCanvasStyle("reset"); }, /** * Method: renderPath * Render a path with stroke and optional fill. */ renderPath: function(context, geometry, style, featureId, type) { var widthFactor=1; if(typeof context.setLineDash==="function"){ var dasharray=this.dashStyle(style,widthFactor); context.setLineDash(dasharray); } var components = geometry.components; var len = components.length; context.beginPath(); var start = this.getLocalXY(components[0]); var x = start[0]; var y = start[1]; if (!isNaN(x) && !isNaN(y)) { context.moveTo(start[0], start[1]); for (var i=1; i<len; ++i) { var pt = this.getLocalXY(components[i]); context.lineTo(pt[0], pt[1]); } if (type === "fill") { context.fill(); } else { //context.stroke(); if(style.lineWidthLimit && style.strokeWidth === 0){ context.closePath(); }else{ context.stroke(); } } } if(typeof context.setLineDash==="function"){ context.setLineDash([]); } }, /** * Method: drawPolygon * This method is only called by the renderer itself. * * Parameters: * geometry - {<SuperMap.Geometry>} * style - {Object} * featureId - {String} */ drawPolygon: function(geometry, style, featureId) { var components = geometry.components; var len = components.length; this.drawLinearRing(components[0], style, featureId); // erase inner rings for (var i=1; i<len; ++i) { //polygon.components //MultiPolygon components // MultiLineString MultiPoint this.canvas.<API key> = "destination-out"; if (this.hitDetection) { this.hitContext.<API key> = "destination-out"; } this.drawLinearRing( components[i], SuperMap.Util.applyDefaults({stroke: false, fillOpacity: 1.0}, style), featureId ); this.canvas.<API key> = "source-over"; if (this.hitDetection) { this.hitContext.<API key> = "source-over"; } this.drawLinearRing( components[i], SuperMap.Util.applyDefaults({fill: false}, style), featureId ); } }, /** * Method: drawRectangle * * * Parameters: * geometry - {<SuperMap.Geometry>} * style - {Object} style * featureId - {String} featureid */ drawRectangle:function(geometry, style, featureId){ var geo = (new SuperMap.Geometry.LinearRing([ new SuperMap.Geometry.Point(geometry.x, geometry.y), new SuperMap.Geometry.Point(geometry.x+geometry.width, geometry.y), new SuperMap.Geometry.Point(geometry.x+geometry.width, geometry.y+geometry.height), new SuperMap.Geometry.Point(geometry.x, geometry.y+geometry.height) ])); this.drawLinearRing(geo, style, featureId); }, /** * Method: drawText * This method is only called by the renderer itself. * * Parameters: * location - {<SuperMap.Point>} * style - {Object} */ drawText: function(location, style) { style = SuperMap.Util.extend({ fontColor: "#000000", labelAlign: "cm" }, style); var pt = this.getLocalXY(location); if (style.labelXOffset || style.labelYOffset ) { var xOffset = isNaN(style.labelXOffset) ? 0 : style.labelXOffset; var yOffset = isNaN(style.labelYOffset) ? 0 : style.labelYOffset; pt[0] += xOffset; pt[1] -= yOffset; } this.setCanvasStyle("reset"); this.canvas.fillStyle = style.fontColor; this.canvas.globalAlpha = style.fontOpacity || 1.0; var fontStyle = [style.fontStyle ? style.fontStyle : "normal", "normal", // "font-variant" not supported style.fontWeight ? style.fontWeight : "normal", style.fontSize ? style.fontSize : "1em", style.fontFamily ? style.fontFamily : "sans-serif"].join(" "); var labelRows = style.label.split('\n'); var numRows = labelRows.length; if (this.canvas.fillText) { // HTML5 this.canvas.font = fontStyle; this.canvas.textAlign = SuperMap.Renderer.Canvas.LABEL_ALIGN[style.labelAlign[0]] || "center"; this.canvas.textBaseline = SuperMap.Renderer.Canvas.LABEL_ALIGN[style.labelAlign[1]] || "middle"; var vfactor = SuperMap.Renderer.Canvas.LABEL_FACTOR[style.labelAlign[1]]; if (vfactor == null) { vfactor = -.5; } var lineHeight = this.canvas.measureText('Mg').height || this.canvas.measureText('xx').width; pt[1] += lineHeight*vfactor*(numRows-1); for (var i = 0; i < numRows; i++) { if(style.labelRotation != 0) { this.canvas.save(); this.canvas.translate(pt[0], pt[1]); this.canvas.rotate(style.labelRotation*Math.PI/180); this.canvas.fillText(labelRows[i], 0, (lineHeight*i)); this.canvas.restore(); }else{ this.canvas.fillText(labelRows[i], pt[0], pt[1] + (lineHeight*i)); } } } else if (this.canvas.mozDrawText) { // Mozilla pre-Gecko1.9.1 (<FF3.1) this.canvas.mozTextStyle = fontStyle; // No built-in text alignment, so we measure and adjust the position var hfactor = SuperMap.Renderer.Canvas.LABEL_FACTOR[style.labelAlign[0]]; if (hfactor == null) { hfactor = -.5; } var vfactor = SuperMap.Renderer.Canvas.LABEL_FACTOR[style.labelAlign[1]]; if (vfactor == null) { vfactor = -.5; } var lineHeight = this.canvas.mozMeasureText('xx'); pt[1] += lineHeight*(1 + (vfactor*numRows)); for (var i = 0; i < numRows; i++) { var x = pt[0] + (hfactor*this.canvas.mozMeasureText(labelRows[i])); var y = pt[1] + (i*lineHeight); this.canvas.translate(x, y); this.canvas.mozDrawText(labelRows[i]); this.canvas.translate(-x, -y); } } this.setCanvasStyle("reset"); }, /** * Method: dashStyle * * Parameters: * style - {Object} * widthFactor - {Number} * * Returns: * {String} A Canvas Parameters of setLineDash Method 'strokeDasharray' value */ dashStyle: function(style, widthFactor) { if(!style)return []; var w = style.strokeWidth * widthFactor; var str = style.strokeDashstyle; switch (str) { case 'solid': return []; case 'dot': return [1, 4 * w]; case 'dash': return [4 * w, 4 * w]; case 'dashdot': return [4 * w, 4 * w, 1, 4 * w]; case 'longdash': return [8 * w, 4 * w]; case 'longdashdot': return [8 * w, 4 * w, 1, 4 * w]; default: if(!str)return []; if(SuperMap.Util.isArray(str))return str; str=SuperMap.String.trim(str).replace(/\s+/g, ","); return str.replace(/\[|\]/gi,"").split(","); } }, /** * Method: getLocalXY * transform geographic xy into pixel xy * * Parameters: * point - {<SuperMap.Geometry.Point>} */ getLocalXY: function(point) { var resolution = this.getResolution(); var extent = this.extent; var x = (point.x / resolution + (-extent.left / resolution)); var y = ((extent.top / resolution) - point.y / resolution); return [x, y]; }, /** * Method: clear * Clear all vectors from the renderer. */ clear: function() { var height = this.root.height; var width = this.root.width; this.canvas.clearRect(0, 0, width, height); this.features = {}; if (this.hitDetection) { this.hitContext.clearRect(0, 0, width, height); } }, /** * Method: <API key> * * * Parameters: * evt - {<SuperMap.Event>} * * Returns: * {<SuperMap.Feature.Vector} feature null. feature. */ <API key>: function(evt) { var feature = null; if (this.hitDetection) { // this dragging check should go in the feature handler if (!this.map.dragging) { var xy = evt.xy; var x = xy.x | 0; var y = xy.y | 0; var data = this.hitContext.getImageData(x, y, 1, 1).data; if (data[3] === 255) { // antialiased var id = data[2] + (256 * (data[1] + (256 * data[0]))); if (id) { var featureInfo = this.features["SuperMap.Feature.Vector_" + (id - 1 + this.hitOverflow)]; feature = featureInfo && featureInfo[0]; } } } } return feature; }, /** * Method: eraseFeatures * This is called by the layer to erase features; removes the feature from * the list, then redraws the layer. * * Parameters: * features - {Array(<SuperMap.Feature.Vector>)} */ eraseFeatures: function(features) { if(!(SuperMap.Util.isArray(features))) { features = [features]; } for(var i=0; i<features.length; ++i) { delete this.features[features[i].id]; } this.redraw(); }, /** * Method: redraw * The real 'meat' of the function: any time things have changed, * redraw() can be called to loop over all the data and (you guessed * it) redraw it. Unlike Elements-based Renderers, we can't interact * with things once they're drawn, to remove them, for example, so * instead we have to just clear everything and draw from scratch. */ redraw: function() { if (!this.locked) { var height = this.root.height; var width = this.root.width; this.canvas.clearRect(0, 0, width, height); if (this.hitDetection) { this.hitContext.clearRect(0, 0, width, height); } var labelMap = []; var feature, style; for (var id in this.features) { if (!this.features.hasOwnProperty(id)) { continue; } feature = this.features[id][0]; style = this.features[id][1]; //console.log("redraw,id:"+id+",style:"+style.externalGraphic); this.drawGeometry(feature.geometry, style, feature.id); if(style.label) { labelMap.push([feature, style]); } } var item; for (var i=0, len=labelMap.length; i<len; ++i) { item = labelMap[i]; var location = item[0].geometry.getCentroid(); if(location == null) { continue; } this.drawText(location, item[1]); } } }, CLASS_NAME: "SuperMap.Renderer.Canvas" }); /** * Constant: SuperMap.Renderer.Canvas.LABEL_ALIGN * {Object} */ SuperMap.Renderer.Canvas.LABEL_ALIGN = { "l": "left", "r": "right", "t": "top", "b": "bottom" }; /** * Constant: SuperMap.Renderer.Canvas.LABEL_FACTOR * {Object} */ SuperMap.Renderer.Canvas.LABEL_FACTOR = { "l": 0, "r": -1, "t": 0, "b": -1 }; SuperMap.Renderer.Canvas.<API key> = null;
package com.whitney.support.service; import com.whitney.support.domain.Support; public interface SupportService { Support get(Long id); Support create(Support support); }
package com.example.learn_camera; import android.app.Activity; import android.content.Intent; import android.graphics.Bitmap; import android.graphics.Bitmap.CompressFormat; import android.media.ThumbnailUtils; import android.os.Bundle; import android.os.Environment; import android.os.Handler; import android.os.Message; import android.provider.MediaStore; import android.util.Log; import android.view.Menu; import android.view.MenuItem; import android.view.View; import android.view.View.OnClickListener; import android.widget.Button; import android.widget.ImageView; import android.widget.Toast; import java.io.<API key>; import java.io.File; import java.io.FileOutputStream; import java.lang.ref.WeakReference; public class <API key> extends Activity implements OnClickListener{ private final static int <API key> = 1000; private final static int <API key> = 10000; private Button mBtnTackPicture; private Button mBtnAlbumShow; private ImageView mImgAlubmShow; private Bitmap mBitmap; private SaftHandler mHandler; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.<API key>); initUI(); } private void initUI() { Toast.makeText(getApplication(), "" + "\n" + "" + "\n" + "SD .jpg" + "\n"+ "", Toast.LENGTH_LONG).show(); mHandler = new SaftHandler(this); this.mBtnTackPicture = (Button)findViewById(R.id.<API key>); this.mBtnAlbumShow = (Button)findViewById(R.id.<API key>); mBtnAlbumShow.setOnClickListener(this); mBtnTackPicture.setOnClickListener(this); this.mImgAlubmShow = (ImageView)findViewById(R.id.<API key>); } @Override public boolean onCreateOptionsMenu(Menu menu) { // Inflate the menu; this adds items to the action bar if it is present. getMenuInflater().inflate(R.menu.<API key>, menu); return true; } @Override public boolean <API key>(MenuItem item) { // Handle action bar item clicks here. The action bar will // automatically handle clicks on the Home/Up button, so long // as you specify a parent activity in AndroidManifest.xml. int id = item.getItemId(); if (id == R.id.action_settings) { Toast.makeText(getApplication(), "" + "\n" + "" + "\n" + "SD .jpg" + "\n"+ "", Toast.LENGTH_LONG).show(); return true; } return super.<API key>(item); } @Override public void onClick(View v) { int sClickid = v.getId(); switch (sClickid) { case R.id.<API key>: Intent openSYSCamera = new Intent(MediaStore.<API key>); <API key>(openSYSCamera, <API key>); break; case R.id.<API key>: if (mBitmap != null) { mHandler.obtainMessage(<API key>, mBitmap).sendToTarget(); mBitmap = ThumbnailUtils.extractThumbnail(mBitmap, 600, 800); mImgAlubmShow.setImageBitmap(mBitmap); int tempBitmapCount = mBitmap.getByteCount(); Toast.makeText(getApplication(), "Take picture: " + "\n" + tempBitmapCount, Toast.LENGTH_SHORT).show(); }else { Toast.makeText(getApplication(), "Take picture error", Toast.LENGTH_SHORT).show(); } break; default: break; } } @Override protected void onActivityResult(int requestCode, int resultCode, Intent data) { // super.onActivityResult(requestCode, resultCode, data); if (requestCode == <API key>) { if (resultCode == Activity.RESULT_OK) { mBitmap = (Bitmap) data.getExtras().get("data"); if (mBitmap != null) { // mBitmap = ThumbnailUtils.extractThumbnail(mBitmap, 600, 800); } } } } private static class SaftHandler extends Handler{ private static WeakReference<<API key>> wrActivity; /** * set taget Activity to Weak reference and the customize handler be recyle timely. *@param bewrMainActivity */ public SaftHandler(<API key> bewrMainActivity) { wrActivity = new WeakReference<<API key>>(bewrMainActivity); } @SuppressWarnings("unused") public WeakReference<<API key>> get(){ return wrActivity; } @Override public void handleMessage(Message msg) { // TODO super.handleMessage(msg); switch (msg.what) { case <API key>: try { Bitmap tempBitmap = (Bitmap) msg.obj; <API key> output = new <API key>(); tempBitmap.compress(CompressFormat.PNG, 100, output); byte[] result = output.toByteArray(); File file = new File(Environment.<API key>(),System.currentTimeMillis()+".jpg"); FileOutputStream outputStream = new FileOutputStream(file); outputStream.write(result); // bitmap.compress(CompressFormat.PNG, 100, outputStream); outputStream.close(); tempBitmap.recycle(); } catch (Exception e) { Log.e("Learn_Camera", e.toString()); } break; default: break; } } } }
# Stackoverflow collection script To collect data run the script with js node index.js -f This will save the current snapshot to the ./data directory in json and also in an import format for copy and paste into google spreadsheet. To calculate all the deltas and generate the deltas between each collected data point do. js node index.js -r This will generate a json and txt file containing the delta between each recorded data point.
<html> <head> <title>Acoustical Gallery from SonexAcoustics</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"/> <meta name="keywords" content="sonex one, sonex classic, studio foam, sonex valueline, acoustical foam, sonex foam"> <meta name="description" content="Sonex acoustical foam panels are made from a Class A Fire Rated melamine acoustical foam."> <link href="style.css" rel="stylesheet" type="text/css"> </head> <body topmargin="0"> <table align="center" width="750" cellspacing="0" cellpadding="0"><tr><td> <table width="100%" cellpadding="0" cellspacing="0"> <tr> <td align="left" width="33%" bgcolor="#6CA56C"><strong>West General Acoustics</strong></td><td bgcolor="#6CA56C" width="33%" align="center"><strong>SONEX FOAM ONLINE</strong></td><td height="15" bgcolor="#6CA56C" align="right" width="33%"><strong>800.801.9378</strong></td> </tr> <tr><td height="2"></td></tr> </table> <table width="100%" border="0" cellpadding="0" cellspacing="0" height="150"><tr> <td width="150" height="150"><img src="images/temp8.gif" height="150"></td><td width="5%"></td> <td width="537" height="150"> <br> <font><font size="+1"><center> <b>Acoustical Gallery</b> </center> </font></font> <div align="justify"><br> Product application photos. </div></td> <td width="22" ></td> </tr></table> <br> <table width="100%" cellpadding="0" cellspacing="0"> <tr> <td width="150" valign="top" > <table width="150" cellpadding="0" cellspacing="0"><tr><td width="150" valign="top"> <img src="images/dot.gif" align="absmiddle"> <a href="../sonexindex.html" class="textlink">Home</a><br> <img src="images/dot.gif" align="absmiddle"> <a href="wallpanels.html" class="textLink">Walls</a> <br> <img src="images/dot.gif" align="absmiddle"> <a href="ceilings.html" class="textlink">Ceilings</a> <br> <img src="images/dot.gif" align="absmiddle"> <a href="custom.html" class="textlink">Custom</a> <br> <img src="images/dotopen.gif" align="absmiddle"> <a href="gallery.html" class="textlink">Photo Gallery</a> <br> <img src="images/dot.gif" align="absmiddle"> <a href="contactus.html" class="textlink">Contact Us</a> <br> </td></tr></table> </td> <td width="5%"></td> <td> <table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="5%"></td> <td width="90%"> <strong><font size="+1">OpNext</font></strong> <table width="100%"> <tr> <td align="center" width="33%"><a href="images/Gallery/opnext/opnext1.jpg" target="_blank"><img src="images/Gallery/opnext/opnext1.jpg" height="100"></a><br> </td> <td align="center" width="33%" ><a href="images/Gallery/opnext/opnext2.jpg" target="_blank"><img src="images/Gallery/opnext/opnext2.jpg" height="100"></a><br> </td> <td align="center" width="33%"><a href="images/Gallery/opnext/opnext3.jpg" target="_blank"><img src="images/Gallery/opnext/opnext3.jpg" height="100"></a><br> </td> </tr> <tr> <td align="center" width="33%"><a href="images/Gallery/opnext/opnext4.jpg" target="_blank"><img src="images/Gallery/opnext/opnext4.jpg" height="100"></a><br> </td> <td align="center" width="33%" ><a href="images/Gallery/opnext/opnext5.jpg" target="_blank"><img src="images/Gallery/opnext/opnext5.jpg" height="100"></a><br> </td> <td align="center" width="33%"><a href="images/Gallery/opnext/opnext6.jpg" target="_blank"><img src="images/Gallery/opnext/opnext6.jpg" height="100"></a><br> </td> </tr> <tr> <td align="center" width="33%"><a href="images/Gallery/opnext/opnext7.jpg" target="_blank"><img src="images/Gallery/opnext/opnext7.jpg" height="100"></a><br> </td> </tr> </table> </td> <td width="5%"></td> </tr> </table> </td></tr></table> <br><br><br><br> </td></tr></table> <script type="text/javascript"> var gaJsHost = (("https:" == document.location.protocol) ? "https: document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E")); </script> <script type="text/javascript"> try { var pageTracker = _gat._getTracker("UA-10200608-1"); pageTracker._trackPageview(); } catch(err) {}</script> </body> </html>
// Image like buttons function <API key> (url, message) { $.ajax({ url: url, type: 'PUT' }).done(function(resp) { console.log(message); console.log(resp); }); } $(function() { $('.like').on('click', function () { event.preventDefault(); <API key>(document.location.pathname+'/like', 'user liked it'); console.log('liked clicked'); // remove like button and replace with Liked button $('.like').after("<button class='but liked show-page-button' disabled='false'>Liked</button>"); $('.like').remove() // $('.liked').show() }) $('.liked').on('click', function () { event.preventDefault(); <API key>(document.location.pathname +'/unlike', 'user unliked it' ); console.log('unliked clicked'); $('.liked').after("<button class='but like show-page-button' disabled='false'>Like</button>"); $('.liked').remove() }) }) // $( this ).addClass( "done" ); // Restaurant like buttons
html, body, div, span, applet, object, iframe, h1, h2, h3, h4, h5, h6, p, blockquote, pre, a, abbr, acronym, address, big, cite, code, del, dfn, em, font, img, ins, kbd, q, s, samp, small, strike, strong, sub, sup, tt, var, b, u, i, center, dl, dt, dd, ol, ul, li, fieldset, form, label, legend, table, caption, tbody, tfoot, thead, tr, th, td { margin: 0; padding: 0; font-size: 100%; vertical-align: baseline; border: 0; outline: 0; background-color: transparent; } html, body { height: 100%; } a { text-decoration: none; color: #50cfe2; } body { font-family: "Segoe UI", "Helvetica Neue", Helvetica, Arial, Verdana, sans-serif; } ul { list-style: none; } #header { width: 100%; height: 100px; background: #3c405e; } #header-inner { width: 1000px; margin: 0 auto; } #logo-big { float: left; padding: 0 20px 0 0; } #nav li { float: right; } #nav li a { font-family: "Segoe UI semilight"; text-transform: uppercase; padding: 0 0 0 15px; display: block; line-height: 100px; font-size: 14px; } #logo-art-large { padding: 35px 20px 0 0; float: left; } #logo-art { padding-right: 20px; float: left; } #logo-text { float: left; } #topic { background-color: #50cfe2; } #topic h1 { font-size: 25px; font-family: "Segoe UI light"; text-transform: uppercase; color: #ffffff; line-height: 25px; padding-top: 25px; padding-bottom: 25px; } #topic-inner { width: 1000px; margin: 0 auto; } #intro { padding: 20px 0 30px 0; margin-left: 270px; font-family: "Segoe UI light"; text-transform: lowercase; color: white; font-size: 30px; } #intro-download-link { display: inline-block; background-color: #ffffff; color: #50cfe2; border-radius: 3px; font-family: "Segoe UI light"; text-transform: uppercase; font-size: 16px; line-height: 30px; vertical-align: middle; padding: 0 10px; } #intro-download-link img { padding-left: 10px; } #demo-animation { padding-top: 10px; } .content-wrapper { overflow: hidden; } .content { width: 1000px; margin: 20px auto; overflow: hidden; } .content h2 { font-family: "Segoe UI light"; font-size: 30px; color: #f21c7c; text-transform: lowercase; margin-bottom: 10px; } .content h3 { font-family: "Segoe UI light"; font-size: 18px; color: #444; margin-bottom: 5px; } .content p { font-size: 14px; font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; color: #444; margin-bottom: 10px; } .content ul { list-style-position: outside; list-style: circle; } .content li { font-size: 14px; font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; color: #444; } .content a { text-decoration: underline; } .col-2 { width: 490px; margin-right: 20px; float: left; display: inline-block; text-align: justify; vertical-align: top; } .col-2-end { width: 490px; float: left; display: inline-block; text-align: justify; vertical-align: top; } .col-3 { width: 310px; margin-right: 35px; float: left; display: inline-block; text-align: justify; vertical-align: top; } .col-3-end { width: 310px; float: left; display: inline-block; text-align: justify; vertical-align: top; } .col-4 { width: 220px; margin-right: 29px; display: inline-block; vertical-align: top; } .col-4-end { width: 220px; display: inline-block; vertical-align: top; } .bg-gray { background-color: #ebebeb; } .downloadBlock { float: left; margin-right: 20px; } .downloadBlock a { width: 255px; line-height: 0px; background-color: #78d23b; color: #ffffff; font-size: 30px; border-radius: 10px; display: block; margin-bottom: 5px; height: 50px; } .downloadBlock span { color: #444; font-size: 12px; display: block; margin-bottom: 20px; } .downloadBlock span.<API key> { width: 255px; line-height: 0px; background-color: #c0c0c0; color: #ffffff; font-size: 30px; border-radius: 10px; display: block; margin-bottom: 5px; height: 50px; } .downloadBlock img { padding: 10px; vertical-align: middle; margin-left: 5px; } .oh { overflow: hidden; } .bolder { font-weight: bold; } .blogIcon { vertical-align: middle; }
# go-tools Collection of tools I've written in golang - **did**: A simple, cli-based task logger. Mainly intended for multi-admin environments. - **kahin**: A tool to find which directory fills the given disk, with a somewhat unique algorithm. - **mprun**: Miserable parallel script runner - **sshit**: Parallel ssh runner with config file support - **wwn**: Shows FC wwn's of a Linux system - **wpmedia2hugo**: A helper program for parsing a wordpress blog's xml output to Hugo markdown
#!/bin/bash -x set -o errexit set -o errtrace set -o nounset set -o pipefail export ROOT="${ROOT:-`pwd`}" export PARALLEL="${PARALLEL:-false}" export KILL_JAVA="${KILL_JAVA:-false}" function setup_git() { local git_name git_name="${1}" echo -e "\n\nCopying git repo to ${ROOT}/target/${git_name}\n\n" mkdir -p "${ROOT}/target/${git_name}" cp -R "${ROOT}/${git_name}" "${ROOT}/target/" mv "${ROOT}/target/${git_name}/git" "${ROOT}/target/${git_name}/.git" ls -al "${ROOT}/target/${git_name}" } function prepare_git() { setup_git contract_git setup_git contract_empty_git } function kill_java() { if [[ "${KILL_JAVA}" == "true" ]]; then pkill java -9 || echo "Failed to kill java processes" pkill gradle -9 || echo "Failed to kill gradle processes" fi } declare -a pids function waitPids() { if [[ "${PARALLEL}" != "true" ]]; then echo "Not running a parallel build" return 0 fi while [ ${#pids[@]} -ne 0 ]; do echo "Waiting for pids: ${pids[@]}" local range=$(eval echo {0..$((${#pids[@]}-1))}) local i for i in $range; do if ! kill -0 ${pids[$i]} 2> /dev/null; then echo "Done -- ${pids[$i]}" unset pids[$i] fi done pids=("${pids[@]}") sleep 1 done echo "Done!" } function addPid() { desc=$1 pid=$2 echo "$desc -- $pid" pids=(${pids[@]} $pid) }
package guice.config; import java.util.ArrayList; import java.util.List; import java.util.Map; /** * @author <a href="mailto:kiminotes.lv@gmail.com">kimi</a> 2017-07-20 */ class Util { public static final String NL = System.getProperty("line.separator"); public static String <API key>(final List<BindingConfig> list) { if (list == null || list.isEmpty()) { return ""; } final char separator = ','; final StringBuilder buf = new StringBuilder(64); buf.append('{'); for (int i = 0; i < list.size(); i++) { final BindingConfig binding = list.get(i); buf.append(binding.getId()) .append(":") .append(binding.getImplementation().getName()) .append(separator); } if (buf.length() > 1) { buf.setLength(buf.length() - 1); } buf.append('}'); return buf.toString(); } public static StringBuilder appendIndent(final StringBuilder buf, int number) { if (number > 0) { for (int i = 0; i < number; i++) { buf.append(' '); } } return buf; } public static BindingConfig create(Class<?> type, String id, Class<?> impl) { return create(type, id, impl, null); } public static BindingConfig create(Class<?> type, String id, Class<?> impl, String scope) { return create(type, id, impl, scope, null); } public static BindingConfig create(Class<?> type, String id, Class<?> impl, String scope, String name) { BindingConfig r = new BindingConfig(); r.setType(type); r.setId(id); r.setImplementation(impl); r.setScope(scope); r.setName(name); return r; } public static <K, T> void addToValue(final Map<K, List<T>> map, final K key, final T ele) { if (map == null || key == null || ele == null) { return; } List<T> list = map.get(key); if (list == null) { list = new ArrayList<>(); map.put(key, list); } list.add(ele); } private Util() { } }
using Solid.Core; using Solid.Practices.Composition; namespace Common.Bootstrapping { public static class <API key> { public static void UseDynamicLoad(this IInitializable initializable) { AssemblyLoader.<API key> = <API key>.Get; } } }
# -*- coding: utf-8 -*- """ Base settings file, common to all environments. These settings can be overridden in local.py. """ import datetime import os import json import hashlib import logging from datetime import timedelta from collections import OrderedDict os_env = os.environ def parent_dir(path): '''Return the parent of a directory.''' return os.path.abspath(os.path.join(path, os.pardir)) HERE = os.path.dirname(os.path.abspath(__file__)) BASE_PATH = parent_dir(HERE) # website/ directory APP_PATH = parent_dir(BASE_PATH) ADDON_PATH = os.path.join(APP_PATH, 'addons') STATIC_FOLDER = os.path.join(BASE_PATH, 'static') STATIC_URL_PATH = '/static' ASSET_HASH_PATH = os.path.join(APP_PATH, 'webpack-assets.json') ROOT = os.path.join(BASE_PATH, '..') BCRYPT_LOG_ROUNDS = 12 # Logging level to use when DEBUG is False LOG_LEVEL = logging.INFO with open(os.path.join(APP_PATH, 'package.json'), 'r') as fobj: VERSION = json.load(fobj)['version'] # Expiration time for verification key <API key> = { 'password': 24 * 60, # 24 hours in minutes for forgot and reset password 'confirm': 24 * 60, # 24 hours in minutes for confirm account and email 'claim': 30 * 24 * 60 # 30 days in minutes for claim contributor-ship } <API key> = os.path.join(BASE_PATH, 'static', 'vendor', 'bower_components', 'styles') # Minimum seconds between forgot password email attempts SEND_EMAIL_THROTTLE = 30 # Seconds that must elapse before updating a user's date_last_login field <API key> = 60 # Hours before pending embargo/retraction/registration automatically becomes active <API key> = datetime.timedelta(days=2) <API key> = datetime.timedelta(days=2) <API key> = datetime.timedelta(days=2) <API key> = datetime.timedelta(days=2) # Date range for embargo periods <API key> = datetime.timedelta(days=2) <API key> = datetime.timedelta(days=1460) # Four years # Question titles to be reomved for anonymized VOL ANONYMIZED_TITLES = ['Authors'] LOAD_BALANCER = False PROXY_ADDRS = [] USE_POSTGRES = True # May set these to True in local.py for development DEV_MODE = False DEBUG_MODE = False SECURE_MODE = not DEBUG_MODE # Set secure cookie PROTOCOL = 'https: DOMAIN = PROTOCOL + 'localhost:5000/' INTERNAL_DOMAIN = DOMAIN API_DOMAIN = PROTOCOL + 'localhost:8000/' <API key> = { 'enabled': False, 'prefix': PROTOCOL, 'suffix': '/' } # External Ember App Local Development USE_EXTERNAL_EMBER = False PROXY_EMBER_APPS = False EXTERNAL_EMBER_APPS = {} LOG_PATH = os.path.join(APP_PATH, 'logs') TEMPLATES_PATH = os.path.join(BASE_PATH, 'templates') ANALYTICS_PATH = os.path.join(BASE_PATH, 'analytics') # User management & registration <API key> = True ALLOW_REGISTRATION = True ALLOW_LOGIN = True SEARCH_ENGINE = 'elastic' # Can be 'elastic', or None ELASTIC_URI = 'localhost:9200' ELASTIC_TIMEOUT = 10 ELASTIC_INDEX = 'website' # Sessions COOKIE_NAME = 'osf' # TODO: Override OSF_COOKIE_DOMAIN in local.py in production OSF_COOKIE_DOMAIN = None # server-side verification timeout OSF_SESSION_TIMEOUT = 30 * 24 * 60 * 60 # 30 days in seconds # TODO: Override SECRET_KEY in local.py in production SECRET_KEY = 'CHANGEME' <API key> = SECURE_MODE <API key> = True # local path to private key and cert for local development using https, overwrite in local.py OSF_SERVER_KEY = None OSF_SERVER_CERT = None # Change if using `scripts/cron.py` to manage crontab CRON_USER = None # External services <API key> = True USE_EMAIL = True FROM_EMAIL = '<API key>@osf.io' SUPPORT_EMAIL = 'support@osf.io' # Default settings for fake email address generation FAKE_EMAIL_NAME = 'freddiemercury' FAKE_EMAIL_DOMAIN = 'cos.io' # SMTP Settings MAIL_SERVER = 'smtp.sendgrid.net' MAIL_USERNAME = 'osf-smtp' MAIL_PASSWORD = '' # Set this in local.py # OR, if using Sendgrid's API SENDGRID_API_KEY = None # Mailchimp MAILCHIMP_API_KEY = None <API key> = 'CHANGEME' # OSF secret key to ensure webhook is secure <API key> = True <API key> = 'Open Science Framework General' #Triggered emails OSF_HELP_LIST = 'Open Science Framework Help' WAIT_BETWEEN_MAILS = timedelta(days=7) NO_ADDON_WAIT_TIME = timedelta(weeks=8) NO_LOGIN_WAIT_TIME = timedelta(weeks=4) <API key> = timedelta(weeks=2) <API key> = timedelta(weeks=6) <API key> = timedelta(hours=24) <API key> = timedelta(days=12) # TODO: Override in local.py MAILGUN_API_KEY = None # Use Celery for file rendering USE_CELERY = True # File rendering timeout (in ms) MFR_TIMEOUT = 30000 # TODO: Override in local.py in production DB_HOST = 'localhost' DB_PORT = os_env.get('OSF_DB_PORT', 27017) DB_NAME = 'osf20130903' DB_USER = None DB_PASS = None # Cache settings <API key> = 5 <API key> = [ lambda url: '/static/' in url, lambda url: 'favicon' in url, lambda url: url.startswith('/api/'), ] # TODO: Configuration should not change between deploys - this should be dynamic. CANONICAL_DOMAIN = '<API key>.org' COOKIE_DOMAIN = '.<API key>.org' # Beaker SHORT_DOMAIN = 'osf.io' # TODO: Combine Python and JavaScript config COMMENT_MAXLENGTH = 500 # Profile image options PROFILE_IMAGE_LARGE = 70 <API key> = 40 PROFILE_IMAGE_SMALL = 20 # Conference options <API key> = 5 WIKI_WHITELIST = { 'tags': [ 'a', 'abbr', 'acronym', 'b', 'bdo', 'big', 'blockquote', 'br', 'center', 'cite', 'code', 'dd', 'del', 'dfn', 'div', 'dl', 'dt', 'em', 'embed', 'font', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hr', 'i', 'img', 'ins', 'kbd', 'li', 'object', 'ol', 'param', 'pre', 'p', 'q', 's', 'samp', 'small', 'span', 'strike', 'strong', 'sub', 'sup', 'table', 'tbody', 'td', 'th', 'thead', 'tr', 'tt', 'ul', 'u', 'var', 'wbr', ], 'attributes': [ 'align', 'alt', 'border', 'cite', 'class', 'dir', 'height', 'href', 'id', 'src', 'style', 'title', 'type', 'width', 'face', 'size', # font tags 'salign', 'align', 'wmode', 'target', ], # Styles currently used in Reproducibility Project wiki pages 'styles': [ 'top', 'left', 'width', 'height', 'position', 'background', 'font-size', 'text-align', 'z-index', 'list-style', ] } # Maps category identifier => Human-readable representation for use in # titles, menus, etc. # Use an OrderedDict so that menu items show in the correct order NODE_CATEGORY_MAP = OrderedDict([ ('analysis', 'Analysis'), ('communication', 'Communication'), ('data', 'Data'), ('hypothesis', 'Hypothesis'), ('instrumentation', 'Instrumentation'), ('methods and measures', 'Methods and Measures'), ('procedure', 'Procedure'), ('project', 'Project'), ('software', 'Software'), ('other', 'Other'), ('', 'Uncategorized') ]) # Add-ons # Load addons from addons.json with open(os.path.join(ROOT, 'addons.json')) as fp: addon_settings = json.load(fp) ADDONS_REQUESTED = addon_settings['addons'] ADDONS_ARCHIVABLE = addon_settings['addons_archivable'] ADDONS_COMMENTABLE = addon_settings['addons_commentable'] ADDONS_BASED_ON_IDS = addon_settings['addons_based_on_ids'] ADDONS_DESCRIPTION = addon_settings['addons_description'] ADDONS_URL = addon_settings['addons_url'] ADDON_CATEGORIES = [ 'documentation', 'storage', 'bibliography', 'other', 'security', 'citations', ] SYSTEM_ADDED_ADDONS = { 'user': [], 'node': [], } KEEN = { 'public': { 'project_id': None, 'master_key': 'changeme', 'write_key': '', 'read_key': '', }, 'private': { 'project_id': '', 'write_key': '', 'read_key': '', }, } SENTRY_DSN = None SENTRY_DSN_JS = None MISSING_FILE_NAME = 'untitled' # Project Organizer ALL_MY_PROJECTS_ID = '-amp' <API key> = '-amr' <API key> = 'All my projects' <API key> = 'All my registrations' # Most Popular and New and Noteworthy Nodes POPULAR_LINKS_NODE = None # TODO Override in local.py in production. <API key> = None # TODO Override in local.py in production. <API key> = None # TODO Override in local.py in production. <API key> = 10 <API key> = [] # TODO Override in local.py in production. # FOR EMERGENCIES ONLY: Setting this to True will disable forks, registrations, # and uploads in order to save disk space. DISK_SAVING_MODE = False # Seconds before another notification email can be sent to a contributor when added to a project <API key> = 24 * 3600 # Google Analytics GOOGLE_ANALYTICS_ID = None <API key> = None DEFAULT_HMAC_SECRET = 'changeme' <API key> = hashlib.sha256 WATERBUTLER_URL = 'http://localhost:7777' <API key> = WATERBUTLER_URL WATERBUTLER_ADDRS = ['127.0.0.1'] # Test identifier namespaces DOI_NAMESPACE = 'doi:10.5072/FK2' ARK_NAMESPACE = 'ark:99999/fk4' # For creating DOIs and ARKs through the EZID service EZID_USERNAME = None EZID_PASSWORD = None # Format for DOIs and ARKs EZID_FORMAT = '{namespace}osf.io/{guid}' <API key> = '' SHARE_URL = None SHARE_API_TOKEN = None # Required to send project updates to SHARE CAS_SERVER_URL = 'http://localhost:8080' MFR_SERVER_URL = 'http://localhost:7778' ARCHIVE_PROVIDER = 'osfstorage' MAX_ARCHIVE_SIZE = 5 * 1024 ** 3 # == math.pow(1024, 3) == 1 GB MAX_FILE_SIZE = MAX_ARCHIVE_SIZE # TODO limit file size? <API key> = timedelta(1) # 24 hours ENABLE_ARCHIVER = True JWT_SECRET = 'changeme' JWT_ALGORITHM = 'HS256' DEFAULT_QUEUE = 'celery' LOW_QUEUE = 'low' MED_QUEUE = 'med' HIGH_QUEUE = 'high' # Seconds, not an actual celery setting <API key> = 5 LOW_PRI_MODULES = { 'framework.analytics.tasks', 'framework.celery_tasks', 'scripts.osfstorage.usage_audit', 'scripts.<API key>', 'scripts.osfstorage.glacier_inventory', 'scripts.analytics.tasks', 'scripts.osfstorage.files_audit', 'scripts.osfstorage.glacier_audit', 'scripts.<API key>', 'scripts.<API key>', 'website.search.elastic_search', } MED_PRI_MODULES = { 'framework.email.tasks', 'scripts.send_queued_mails', 'scripts.triggered_mails', 'website.mailchimp_utils', 'website.notifications.tasks', } HIGH_PRI_MODULES = { 'scripts.<API key>', 'scripts.<API key>', 'scripts.<API key>', 'scripts.<API key>', 'scripts.<API key>', 'website.archiver.tasks', } try: from kombu import Queue, Exchange except ImportError: pass else: CELERY_QUEUES = ( Queue(LOW_QUEUE, Exchange(LOW_QUEUE), routing_key=LOW_QUEUE, consumer_arguments={'x-priority': -1}), Queue(DEFAULT_QUEUE, Exchange(DEFAULT_QUEUE), routing_key=DEFAULT_QUEUE, consumer_arguments={'x-priority': 0}), Queue(MED_QUEUE, Exchange(MED_QUEUE), routing_key=MED_QUEUE, consumer_arguments={'x-priority': 1}), Queue(HIGH_QUEUE, Exchange(HIGH_QUEUE), routing_key=HIGH_QUEUE, consumer_arguments={'x-priority': 10}), ) <API key> = 'direct' CELERY_ROUTES = ('framework.celery_tasks.routers.CeleryRouter', ) <API key> = True <API key> = True # Default RabbitMQ broker RABBITMQ_USERNAME = os.environ.get('RABBITMQ_USERNAME', 'guest') RABBITMQ_PASSWORD = os.environ.get('RABBITMQ_PASSWORD', 'guest') RABBITMQ_HOST = os.environ.get('RABBITMQ_HOST', 'localhost') RABBITMQ_PORT = os.environ.get('RABBITMQ_PORT', '5672') RABBITMQ_VHOST = os.environ.get('RABBITMQ_VHOST', '/') BROKER_URL = os.environ.get('BROKER_URL', 'amqp://{}:{}@{}:{}/{}'.format(RABBITMQ_USERNAME, RABBITMQ_PASSWORD, RABBITMQ_HOST, RABBITMQ_PORT, RABBITMQ_VHOST)) # Default RabbitMQ backend <API key> = os.environ.get('<API key>', BROKER_URL) # Modules to import when celery launches CELERY_IMPORTS = ( 'framework.celery_tasks', 'framework.email.tasks', 'website.mailchimp_utils', 'website.notifications.tasks', 'website.archiver.tasks', 'website.search.search', 'website.project.tasks', 'scripts.<API key>', 'scripts.<API key>', 'scripts.<API key>', 'scripts.<API key>', 'scripts.<API key>', 'scripts.<API key>', 'scripts.<API key>', 'scripts.triggered_mails', 'scripts.send_queued_mails', 'scripts.analytics.run_keen_summaries', 'scripts.analytics.run_keen_snapshots', 'scripts.analytics.run_keen_events', 'scripts.generate_sitemap', ) # Modules that need metrics and release requirements # CELERY_IMPORTS += ( # 'scripts.osfstorage.glacier_inventory', # 'scripts.osfstorage.glacier_audit', # 'scripts.osfstorage.usage_audit', # 'scripts.<API key>', # 'scripts.osfstorage.files_audit', # 'scripts.analytics.tasks', # 'scripts.analytics.upload', # celery.schedule will not be installed when running invoke requirements the first time. try: from celery.schedules import crontab except ImportError: pass else: # Setting up a scheduler, essentially replaces an independent cron job CELERYBEAT_SCHEDULE = { '5-minute-emails': { 'task': 'website.notifications.tasks.send_users_email', 'schedule': crontab(minute='*/5'), 'args': ('email_transactional',), }, 'daily-emails': { 'task': 'website.notifications.tasks.send_users_email', 'schedule': crontab(minute=0, hour=0), 'args': ('email_digest',), }, 'refresh_addons': { 'task': 'scripts.<API key>', 'schedule': crontab(minute=0, hour=2), # Daily 2:00 a.m 'kwargs': {'dry_run': False, 'addons': { 'box': 60, 'googledrive': 14, 'mendeley': 14 }}, }, '<API key>': { 'task': 'scripts.<API key>', 'schedule': crontab(minute=0, hour=0), # Daily 12 a.m 'kwargs': {'dry_run': False}, }, '<API key>': { 'task': 'scripts.<API key>', 'schedule': crontab(minute=0, hour=0), # Daily 12 a.m 'kwargs': {'dry_run': False}, }, '<API key>': { 'task': 'scripts.<API key>', 'schedule': crontab(minute=0, hour=0), # Daily 12 a.m 'kwargs': {'dry_run': False}, }, '<API key>': { 'task': 'scripts.<API key>', 'schedule': crontab(minute=0, hour=0), # Daily 12 a.m 'kwargs': {'dry_run': False}, }, 'triggered_mails': { 'task': 'scripts.triggered_mails', 'schedule': crontab(minute=0, hour=0), # Daily 12 a.m 'kwargs': {'dry_run': False}, }, 'send_queued_mails': { 'task': 'scripts.send_queued_mails', 'schedule': crontab(minute=0, hour=12), # Daily 12 p.m. 'kwargs': {'dry_run': False}, }, 'new-and-noteworthy': { 'task': 'scripts.<API key>', 'schedule': crontab(minute=0, hour=2, day_of_week=6), # Saturday 2:00 a.m. 'kwargs': {'dry_run': False} }, '<API key>': { 'task': 'scripts.<API key>', 'schedule': crontab(minute=0, hour=2), # Daily 2:00 a.m. 'kwargs': {'dry_run': False} }, 'run_keen_summaries': { 'task': 'scripts.analytics.run_keen_summaries', 'schedule': crontab(minute=00, hour=1), # Daily 1:00 a.m. 'kwargs': {'yesterday': True} }, 'run_keen_snapshots': { 'task': 'scripts.analytics.run_keen_snapshots', 'schedule': crontab(minute=0, hour=3), # Daily 3:00 a.m. }, 'run_keen_events': { 'task': 'scripts.analytics.run_keen_events', 'schedule': crontab(minute=0, hour=4), # Daily 4:00 a.m. 'kwargs': {'yesterday': True} }, 'generate_sitemap': { 'task': 'scripts.generate_sitemap', 'schedule': crontab(minute=0, hour=0), # Daily 12:00 a.m. } } # Tasks that need metrics and release requirements # CELERYBEAT_SCHEDULE.update({ # 'usage_audit': { # 'task': 'scripts.osfstorage.usage_audit', # 'schedule': crontab(minute=0, hour=0), # Daily 12 a.m # 'kwargs': {'send_mail': True}, # '<API key>': { # 'task': 'scripts.<API key>', # 'schedule': crontab(minute=0, hour=6), # Daily 6 a.m # 'kwargs': {}, # 'glacier_inventory': { # 'task': 'scripts.osfstorage.glacier_inventory', # 'schedule': crontab(minute=0, hour= 0, day_of_week=0), # Sunday 12:00 a.m. # 'args': (), # 'glacier_audit': { # 'task': 'scripts.osfstorage.glacier_audit', # 'schedule': crontab(minute=0, hour=6, day_of_week=0), # Sunday 6:00 a.m. # 'kwargs': {'dry_run': False}, # 'files_audit_0': { # 'task': 'scripts.osfstorage.files_audit.0', # 'schedule': crontab(minute=0, hour=2, day_of_week=0), # Sunday 2:00 a.m. # 'kwargs': {'num_of_workers': 4, 'dry_run': False}, # 'files_audit_1': { # 'task': 'scripts.osfstorage.files_audit.1', # 'schedule': crontab(minute=0, hour=2, day_of_week=0), # Sunday 2:00 a.m. # 'kwargs': {'num_of_workers': 4, 'dry_run': False}, # 'files_audit_2': { # 'task': 'scripts.osfstorage.files_audit.2', # 'schedule': crontab(minute=0, hour=2, day_of_week=0), # Sunday 2:00 a.m. # 'kwargs': {'num_of_workers': 4, 'dry_run': False}, # 'files_audit_3': { # 'task': 'scripts.osfstorage.files_audit.3', # 'schedule': crontab(minute=0, hour=2, day_of_week=0), # Sunday 2:00 a.m. # 'kwargs': {'num_of_workers': 4, 'dry_run': False}, <API key> = 'yusaltydough' WATERBUTLER_JWE_<API key> WATERBUTLER_JWT_<API key> <API key> = 'HS256' <API key> = 15 SENSITIVE_DATA_SALT = 'yusaltydough' SENSITIVE_DATA_<API key> <API key> = datetime.timedelta(days=10) assert (<API key> > <API key>), 'The draft registration approval period should be more than the minimum embargo end date.' PREREG_ADMIN_TAG = "prereg_admin" # TODO: Remove references to this flag ENABLE_INSTITUTIONS = True ENABLE_VARNISH = False ENABLE_ESI = False VARNISH_SERVERS = [] # This should be set in local.py or cache invalidation won't work ESI_MEDIA_TYPES = {'application/vnd.api+json', 'application/json'} # Used for gathering meta information about the current build GITHUB_API_TOKEN = None # switch for disabling things that shouldn't happen during # the modm to django migration RUNNING_MIGRATION = False # External Identity Provider <API key> = { 'OrcidProfile': 'ORCID', } BLACKLISTED_DOMAINS = [ '0-mail.com', '0815.ru', '0815.su', '0clickemail.com', '0wnd.net', '0wnd.org', '10mail.org', '10minut.com.pl', '10minutemail.cf', '10minutemail.co.uk', '10minutemail.co.za', '10minutemail.com', '10minutemail.de', '10minutemail.eu', '10minutemail.ga', '10minutemail.gq', '10minutemail.info', '10minutemail.ml', '10minutemail.net', '10minutemail.org', '10minutemail.ru', '10minutemail.us', '10minutesmail.co.uk', '10minutesmail.com', '10minutesmail.eu', '10minutesmail.net', '10minutesmail.org', '10minutesmail.ru', '10minutesmail.us', '123-m.com', '15qm-mail.red', '15qm.com', '1chuan.com', '1mail.ml', '1pad.de', '1usemail.com', '1zhuan.com', '20mail.in', '20mail.it', '20minutemail.com', '2prong.com', '30minutemail.com', '30minutesmail.com', '33mail.com', '3d-painting.com', '3mail.ga', '4mail.cf', '4mail.ga', '4warding.com', '4warding.net', '4warding.org', '5mail.cf', '5mail.ga', '60minutemail.com', '675hosting.com', '675hosting.net', '675hosting.org', '6ip.us', '6mail.cf', '6mail.ga', '6mail.ml', '6paq.com', '6url.com', '75hosting.com', '75hosting.net', '75hosting.org', '7mail.ga', '7mail.ml', '7mail7.com', '7tags.com', '8mail.cf', '8mail.ga', '8mail.ml', '99experts.com', '9mail.cf', '9ox.net', 'a-bc.net', 'a45.in', 'abcmail.email', 'abusemail.de', 'abyssmail.com', 'acentri.com', 'advantimo.com', 'afrobacon.com', 'agedmail.com', 'ajaxapp.net', 'alivance.com', 'ama-trade.de', 'amail.com', 'amail4.me', 'amilegit.com', 'amiri.net', 'amiriindustries.com', 'anappthat.com', 'ano-mail.net', 'anobox.ru', 'anonbox.net', 'anonmails.de', 'anonymail.dk', 'anonymbox.com', 'antichef.com', 'antichef.net', 'antireg.ru', 'antispam.de', 'antispammail.de', 'appixie.com', 'armyspy.com', 'artman-conception.com', 'asdasd.ru', 'azmeil.tk', 'baxomale.ht.cx', 'beddly.com', 'beefmilk.com', 'beerolympics.se', 'bestemailaddress.net', 'bigprofessor.so', 'bigstring.com', 'binkmail.com', 'bio-muesli.net', 'bladesmail.net', 'bloatbox.com', 'bobmail.info', 'bodhi.lawlita.com', 'bofthew.com', 'bootybay.de', 'bossmail.de', 'boun.cr', 'bouncr.com', 'boxformail.in', 'boximail.com', 'boxtemp.com.br', 'breakthru.com', 'brefmail.com', 'brennendesreich.de', 'broadbandninja.com', 'bsnow.net', 'bspamfree.org', 'buffemail.com', 'bugmenot.com', 'bumpymail.com', 'bund.us', 'bundes-li.ga', 'burnthespam.info', 'burstmail.info', 'buymoreplays.com', 'buyusedlibrarybooks.org', 'byom.de', 'c2.hu', 'cachedot.net', 'card.zp.ua', 'casualdx.com', 'cbair.com', 'cdnqa.com', 'cek.pm', 'cellurl.com', 'cem.net', 'centermail.com', 'centermail.net', 'chammy.info', 'cheatmail.de', 'chewiemail.com', 'childsavetrust.org', 'chogmail.com', 'choicemail1.com', 'chong-mail.com', 'chong-mail.net', 'chong-mail.org', 'clixser.com', 'clrmail.com', 'cmail.net', 'cmail.org', 'coldemail.info', 'consumerriot.com', 'cool.fr.nf', 'correo.blogos.net', 'cosmorph.com', 'courriel.fr.nf', 'courrieltemporaire.com', 'crapmail.org', 'crazymailing.com', 'cubiclink.com', 'curryworld.de', 'cust.in', 'cuvox.de', 'd3p.dk', 'dacoolest.com', 'daintly.com', 'dandikmail.com', 'dayrep.com', 'dbunker.com', 'dcemail.com', 'deadaddress.com', 'deadfake.cf', 'deadfake.ga', 'deadfake.ml', 'deadfake.tk', 'deadspam.com', 'deagot.com', 'dealja.com', 'delikkt.de', 'despam.it', 'despammed.com', 'devnullmail.com', 'dfgh.net', 'digitalsanctuary.com', 'dingbone.com', 'dingfone.com', 'discard.cf', 'discard.email', 'discard.ga', 'discard.gq', 'discard.ml', 'discard.tk', 'discardmail.com', 'discardmail.de', 'dispomail.eu', 'disposable-email.ml', 'disposable.cf', 'disposable.ga', 'disposable.ml', 'disposableaddress.com', '<API key>.com', 'disposableinbox.com', 'dispose.it', 'disposeamail.com', 'disposemail.com', 'dispostable.com', 'divermail.com', 'dodgeit.com', 'dodgemail.de', 'dodgit.com', 'dodgit.org', 'dodsi.com', 'doiea.com', 'domozmail.com', 'donemail.ru', 'dontmail.net', 'dontreg.com', 'dontsendmespam.de', 'dotmsg.com', 'drdrb.com', 'drdrb.net', 'droplar.com', 'dropmail.me', 'duam.net', 'dudmail.com', 'dump-email.info', 'dumpandjunk.com', 'dumpmail.de', 'dumpyemail.com', 'duskmail.com', 'e-mail.com', 'e-mail.org', 'e4ward.com', 'easytrashmail.com', 'ee1.pl', 'ee2.pl', 'eelmail.com', 'einmalmail.de', 'einrot.com', 'einrot.de', 'eintagsmail.de', 'email-fake.cf', 'email-fake.com', 'email-fake.ga', 'email-fake.gq', 'email-fake.ml', 'email-fake.tk', 'email60.com', 'email64.com', 'emailage.cf', 'emailage.ga', 'emailage.gq', 'emailage.ml', 'emailage.tk', 'emaildienst.de', 'emailgo.de', 'emailias.com', 'emailigo.de', 'emailinfive.com', 'emaillime.com', 'emailmiser.com', 'emailproxsy.com', 'emails.ga', 'emailsensei.com', 'emailspam.cf', 'emailspam.ga', 'emailspam.gq', 'emailspam.ml', 'emailspam.tk', 'emailtemporanea.com', 'emailtemporanea.net', 'emailtemporar.ro', 'emailtemporario.com.br', 'emailthe.net', 'emailtmp.com', 'emailto.de', 'emailwarden.com', 'emailx.at.hm', 'emailxfer.com', 'emailz.cf', 'emailz.ga', 'emailz.gq', 'emailz.ml', 'emeil.in', 'emeil.ir', 'emeraldwebmail.com', 'emil.com', 'emkei.cf', 'emkei.ga', 'emkei.gq', 'emkei.ml', 'emkei.tk', 'emz.net', 'enterto.com', 'ephemail.net', 'ero-tube.org', 'etranquil.com', 'etranquil.net', 'etranquil.org', 'evopo.com', 'example.com', 'explodemail.com', 'express.net.ua', 'eyepaste.com', 'facebook-email.cf', 'facebook-email.ga', 'facebook-email.ml', 'facebookmail.gq', 'facebookmail.ml', 'fake-box.com', 'fake-mail.cf', 'fake-mail.ga', 'fake-mail.ml', 'fakeinbox.cf', 'fakeinbox.com', 'fakeinbox.ga', 'fakeinbox.ml', 'fakeinbox.tk', 'fakeinformation.com', 'fakemail.fr', 'fakemailgenerator.com', 'fakemailz.com', 'fammix.com', 'fansworldwide.de', 'fantasymail.de', 'fastacura.com', 'fastchevy.com', 'fastchrysler.com', 'fastkawasaki.com', 'fastmazda.com', 'fastmitsubishi.com', 'fastnissan.com', 'fastsubaru.com', 'fastsuzuki.com', 'fasttoyota.com', 'fastyamaha.com', 'fatflap.com', 'fdfdsfds.com', 'fightallspam.com', 'fiifke.de', 'filzmail.com', 'fivemail.de', 'fixmail.tk', 'fizmail.com', 'fleckens.hu', 'flurre.com', 'flurred.com', 'flurred.ru', 'flyspam.com', 'footard.com', 'forgetmail.com', 'forward.cat', 'fr33mail.info', 'frapmail.com', 'free-email.cf', 'free-email.ga', 'freemails.cf', 'freemails.ga', 'freemails.ml', 'freundin.ru', 'friendlymail.co.uk', 'front14.org', 'fuckingduh.com', 'fudgerub.com', 'fux0ringduh.com', 'fyii.de', 'garliclife.com', '<API key>.de', 'gelitik.in', 'germanmails.biz', 'get-mail.cf', 'get-mail.ga', 'get-mail.ml', 'get-mail.tk', 'get1mail.com', 'get2mail.fr', 'getairmail.cf', 'getairmail.com', 'getairmail.ga', 'getairmail.gq', 'getairmail.ml', 'getairmail.tk', 'getmails.eu', 'getonemail.com', 'getonemail.net', 'gfcom.com', 'ghosttexter.de', 'giantmail.de', '<API key>.com', 'gishpuppy.com', 'gmial.com', 'goemailgo.com', '<API key>.com', 'gotmail.com', 'gotmail.net', 'gotmail.org', 'gowikibooks.com', 'gowikicampus.com', 'gowikicars.com', 'gowikifilms.com', 'gowikigames.com', 'gowikimusic.com', 'gowikinetwork.com', 'gowikitravel.com', 'gowikitv.com', 'grandmamail.com', 'grandmasmail.com', 'great-host.in', 'greensloth.com', 'grr.la', 'gsrv.co.uk', 'guerillamail.biz', 'guerillamail.com', 'guerillamail.de', 'guerillamail.net', 'guerillamail.org', 'guerillamailblock.com', 'guerrillamail.biz', 'guerrillamail.com', 'guerrillamail.de', 'guerrillamail.info', 'guerrillamail.net', 'guerrillamail.org', 'guerrillamailblock.com', 'gustr.com', 'h8s.org', 'hacccc.com', 'haltospam.com', 'haqed.com', 'harakirimail.com', 'hartbot.de', 'hat-geld.de', 'hatespam.org', 'headstrong.de', 'hellodream.mobi', 'herp.in', 'hidemail.de', 'hideme.be', 'hidzz.com', 'hiru-dea.com', 'hmamail.com', 'hochsitze.com', 'hopemail.biz', 'hot-mail.cf', 'hot-mail.ga', 'hot-mail.gq', 'hot-mail.ml', 'hot-mail.tk', 'hotpop.com', 'hulapla.de', 'hushmail.com', 'ieatspam.eu', 'ieatspam.info', 'ieh-mail.de', 'ihateyoualot.info', 'iheartspam.org', 'ikbenspamvrij.nl', 'imails.info', 'imgof.com', 'imgv.de', 'imstations.com', 'inbax.tk', 'inbox.si', 'inboxalias.com', 'inboxclean.com', 'inboxclean.org', 'inboxproxy.com', 'incognitomail.com', 'incognitomail.net', 'incognitomail.org', 'ineec.net', 'infocom.zp.ua', 'inoutmail.de', 'inoutmail.eu', 'inoutmail.info', 'inoutmail.net', 'insorg-mail.info', 'instant-mail.de', 'instantemailaddress.com', 'instantlyemail.com', 'ip6.li', 'ipoo.org', 'irish2me.com', 'iwi.net', 'jetable.com', 'jetable.fr.nf', 'jetable.net', 'jetable.org', 'jnxjn.com', 'jourrapide.com', 'junk1e.com', 'junkmail.com', 'junkmail.ga', 'junkmail.gq', 'jupimail.com', 'kasmail.com', 'kaspop.com', 'keepmymail.com', 'killmail.com', 'killmail.net', 'kimsdisk.com', 'kingsq.ga', 'kiois.com', 'kir.ch.tc', 'klassmaster.com', 'klassmaster.net', 'klzlk.com', 'kook.ml', 'koszmail.pl', 'kulturbetrieb.info', 'kurzepost.de', 'l33r.eu', 'labetteraverouge.at', 'lackmail.net', 'lags.us', 'landmail.co', 'lastmail.co', 'lawlita.com', 'lazyinbox.com', 'legitmail.club', 'letthemeatspam.com', 'lhsdv.com', 'libox.fr', 'lifebyfood.com', 'link2mail.net', 'litedrop.com', 'loadby.us', 'login-email.cf', 'login-email.ga', 'login-email.ml', 'login-email.tk', 'lol.ovpn.to', 'lolfreak.net', 'lookugly.com', 'lopl.co.cc', 'lortemail.dk', 'lovemeleaveme.com', 'lr78.com', 'lroid.com', 'lukop.dk', 'm21.cc', 'm4ilweb.info', 'maboard.com', 'mail-filter.com', 'mail-temporaire.fr', 'mail.by', 'mail.mezimages.net', 'mail.zp.ua', 'mail114.net', 'mail1a.de', 'mail21.cc', 'mail2rss.org', 'mail333.com', 'mail4trash.com', 'mailbidon.com', 'mailbiz.biz', 'mailblocks.com', 'mailblog.biz', 'mailbucket.org', 'mailcat.biz', 'mailcatch.com', 'mailde.de', 'mailde.info', 'maildrop.cc', 'maildrop.cf', 'maildrop.ga', 'maildrop.gq', 'maildrop.ml', 'maildu.de', 'maildx.com', 'maileater.com', 'mailed.ro', 'maileimer.de', 'mailexpire.com', 'mailfa.tk', 'mailforspam.com', 'mailfree.ga', 'mailfree.gq', 'mailfree.ml', 'mailfreeonline.com', 'mailfs.com', 'mailguard.me', 'mailhazard.com', 'mailhazard.us', 'mailhz.me', 'mailimate.com', 'mailin8r.com', 'mailinater.com', 'mailinator.com', 'mailinator.gq', 'mailinator.net', 'mailinator.org', 'mailinator.us', 'mailinator2.com', 'mailinator2.net', 'mailincubator.com', 'mailismagic.com', 'mailjunk.cf', 'mailjunk.ga', 'mailjunk.gq', 'mailjunk.ml', 'mailjunk.tk', 'mailmate.com', 'mailme.gq', 'mailme.ir', 'mailme.lv', 'mailme24.com', 'mailmetrash.com', 'mailmoat.com', 'mailms.com', 'mailnator.com', 'mailnesia.com', 'mailnull.com', 'mailorg.org', 'mailpick.biz', 'mailproxsy.com', 'mailquack.com', 'mailrock.biz', 'mailscrap.com', 'mailshell.com', 'mailsiphon.com', 'mailslapping.com', 'mailslite.com', 'mailspeed.ru', 'mailtemp.info', 'mailtome.de', 'mailtothis.com', 'mailtrash.net', 'mailtv.net', 'mailtv.tv', 'mailzilla.com', 'mailzilla.org', 'mailzilla.orgmbx.cc', 'makemetheking.com', 'mallinator.com', 'manifestgenerator.com', 'manybrain.com', 'mbx.cc', 'mciek.com', 'mega.zik.dj', 'meinspamschutz.de', 'meltmail.com', 'messagebeamer.de', 'mezimages.net', 'mfsa.ru', 'mierdamail.com', 'migmail.pl', 'migumail.com', 'mindless.com', '<API key>.de', 'mintemail.com', 'misterpinball.de', 'mjukglass.nu', 'moakt.com', 'mobi.web.id', 'mobileninja.co.uk', 'moburl.com', 'mohmal.com', 'moncourrier.fr.nf', 'monemail.fr.nf', 'monmail.fr.nf', 'monumentmail.com', 'msa.minsmail.com', 'mt2009.com', 'mt2014.com', 'mt2015.com', 'mx0.wwwnew.eu', 'my10minutemail.com', 'myalias.pw', 'mycard.net.ua', 'mycleaninbox.net', 'myemailboxy.com', 'mymail-in.net', 'mymailoasis.com', 'mynetstore.de', 'mypacks.net', 'mypartyclip.de', 'myphantomemail.com', 'mysamp.de', 'myspaceinc.com', 'myspaceinc.net', 'myspaceinc.org', 'myspacepimpedup.com', 'myspamless.com', 'mytemp.email', 'mytempemail.com', 'mytempmail.com', 'mytrashmail.com', 'nabuma.com', 'neomailbox.com', 'nepwk.com', 'nervmich.net', 'nervtmich.net', 'netmails.com', 'netmails.net', 'netzidiot.de', 'neverbox.com', 'nice-4u.com', 'nincsmail.com', 'nincsmail.hu', 'nmail.cf', 'nnh.com', 'no-spam.ws', 'noblepioneer.com', 'nobulk.com', 'noclickemail.com', 'nogmailspam.info', 'nomail.pw', 'nomail.xl.cx', 'nomail2me.com', 'nomorespamemails.com', 'nonspam.eu', 'nonspammer.de', 'noref.in', 'nospam.ze.tc', 'nospam4.us', 'nospamfor.us', 'nospammail.net', 'nospamthanks.info', 'notmailinator.com', 'notsharingmy.info', 'nowhere.org', 'nowmymail.com', 'nurfuerspam.de', 'nwldx.com', 'objectmail.com', 'obobbo.com', 'odaymail.com', 'odnorazovoe.ru', 'one-time.email', 'oneoffemail.com', 'oneoffmail.com', 'onewaymail.com', 'onlatedotcom.info', 'online.ms', 'oopi.org', 'opayq.com', 'opentrash.com', 'ordinaryamerican.net', 'otherinbox.com', 'ourklips.com', 'outlawspam.com', 'ovpn.to', 'owlpic.com', 'pancakemail.com', 'paplease.com', 'pepbot.com', 'pfui.ru', 'pimpedupmyspace.com', 'pjjkp.com', 'plexolan.de', 'poczta.onet.pl', 'politikerclub.de', 'poofy.org', 'pookmail.com', 'pop3.xyz', 'postalmail.biz', 'privacy.net', 'privatdemail.net', 'privy-mail.com', 'privymail.de', 'proxymail.eu', 'prtnx.com', 'prtz.eu', 'pubmail.io', 'punkass.com', '<API key>.com', 'pwrby.com', 'q314.net', 'qisdo.com', 'qisoa.com', 'qoika.com', 'qq.com', 'quickinbox.com', 'quickmail.nl', 'rainmail.biz', 'rcpt.at', 're-gister.com', 'reallymymail.com', 'realtyalerts.ca', 'recode.me', 'reconmail.com', 'recursor.net', 'recyclemail.dk', 'regbypass.com', 'regbypass.comsafe-mail.net', 'rejectmail.com', 'reliable-mail.com', 'remail.cf', 'remail.ga', 'renraku.in', 'rhyta.com', 'rklips.com', 'rmqkr.net', 'royal.net', 'rppkn.com', 'rtrtr.com', 's0ny.net', 'safe-mail.net', 'safersignup.de', 'safetymail.info', 'safetypost.de', 'sandelf.de', 'sayawaka-dea.info', 'saynotospams.com', 'scatmail.com', 'schafmail.de', 'schrott-email.de', 'secretemail.de', 'secure-mail.biz', 'secure-mail.cc', 'selfdestructingmail.com', 'selfdestructingmail.org', 'sendspamhere.com', '<API key>.com', 'services391.com', 'sharedmailbox.org', 'sharklasers.com', 'shieldedmail.com', 'shieldemail.com', 'shiftmail.com', 'shitmail.me', 'shitmail.org', 'shitware.nl', 'shmeriously.com', 'shortmail.net', 'showslow.de', 'sibmail.com', 'sinnlos-mail.de', 'siteposter.net', 'skeefmail.com', 'slapsfromlastnight.com', 'slaskpost.se', 'slipry.net', 'slopsbox.com', 'slowslow.de', 'slushmail.com', 'smashmail.de', 'smellfear.com', 'smellrear.com', 'smoug.net', 'snakemail.com', 'sneakemail.com', 'sneakmail.de', 'snkmail.com', 'sofimail.com', 'sofort-mail.de', 'softpls.asia', 'sogetthis.com', 'soisz.com', 'solvemail.info', 'soodonims.com', 'spam.la', 'spam.su', 'spam4.me', 'spamail.de', 'spamarrest.com', 'spamavert.com', 'spambob.com', 'spambob.net', 'spambob.org', 'spambog.com', 'spambog.de', 'spambog.net', 'spambog.ru', 'spambooger.com', 'spambox.info', 'spambox.irishspringrealty.com', 'spambox.us', 'spambpg.com', 'spamcannon.com', 'spamcannon.net', 'spamcero.com', 'spamcon.org', 'spamcorptastic.com', 'spamcowboy.com', 'spamcowboy.net', 'spamcowboy.org', 'spamday.com', 'spamex.com', 'spamfighter.cf', 'spamfighter.ga', 'spamfighter.gq', 'spamfighter.ml', 'spamfighter.tk', 'spamfree.eu', 'spamfree24.com', 'spamfree24.de', 'spamfree24.eu', 'spamfree24.info', 'spamfree24.net', 'spamfree24.org', 'spamgoes.in', 'spamgourmet.com', 'spamgourmet.net', 'spamgourmet.org', 'spamherelots.com', 'spamhereplease.com', 'spamhole.com', 'spamify.com', 'spaminator.de', 'spamkill.info', 'spaml.com', 'spaml.de', 'spammotel.com', 'spamobox.com', 'spamoff.de', 'spamsalad.in', 'spamslicer.com', 'spamsphere.com', 'spamspot.com', 'spamstack.net', 'spamthis.co.uk', 'spamthisplease.com', 'spamtrail.com', 'spamtroll.net', 'speed.1s.fr', 'spikio.com', 'spoofmail.de', 'spybox.de', 'squizzy.de', 'ssoia.com', 'startkeys.com', 'stexsy.com', 'stinkefinger.net', 'stop-my-spam.cf', 'stop-my-spam.com', 'stop-my-spam.ga', 'stop-my-spam.ml', 'stop-my-spam.tk', 'streetwisemail.com', 'stuffmail.de', 'super-auswahl.de', 'supergreatmail.com', 'supermailer.jp', 'superrito.com', 'superstachel.de', 'suremail.info', 'sute.jp', 'svk.jp', 'sweetxxx.de', 'tafmail.com', 'tagyourself.com', 'talkinator.com', 'tapchicuoihoi.com', 'teewars.org', 'teleworm.com', 'teleworm.us', 'temp-mail.com', 'temp-mail.net', 'temp-mail.org', 'temp-mail.ru', 'temp15qm.com', 'tempail.com', 'tempalias.com', 'tempe-mail.com', 'tempemail.biz', 'tempemail.co.za', 'tempemail.com', 'tempemail.net', 'tempemail.org', 'tempinbox.co.uk', 'tempinbox.com', 'tempmail.de', 'tempmail.eu', 'tempmail.it', 'tempmail2.com', 'tempmaildemo.com', 'tempmailer.com', 'tempmailer.de', 'tempomail.fr', 'temporarily.de', 'temporarioemail.com.br', 'temporaryemail.net', 'temporaryemail.us', 'temporaryforwarding.com', 'temporaryinbox.com', '<API key>.com', 'tempsky.com', 'tempthe.net', 'tempymail.com', 'test.com', 'thanksnospam.info', 'thankyou2010.com', 'thc.st', 'thecloudindex.com', '<API key>.com', 'thismail.net', 'thismail.ru', 'throam.com', 'throwam.com', '<API key>.com', 'throwawaymail.com', 'tilien.com', 'tittbit.in', 'tizi.com', 'tmail.ws', 'tmailinator.com', 'tmpeml.info', 'toiea.com', 'tokenmail.de', 'toomail.biz', 'topranklist.de', 'tormail.net', 'tormail.org', 'tradermail.info', 'trash-amil.com', 'trash-mail.at', 'trash-mail.cf', 'trash-mail.com', 'trash-mail.de', 'trash-mail.ga', 'trash-mail.gq', 'trash-mail.ml', 'trash-mail.tk', 'trash-me.com', 'trash2009.com', 'trash2010.com', 'trash2011.com', 'trashdevil.com', 'trashdevil.de', 'trashemail.de', 'trashmail.at', 'trashmail.com', 'trashmail.de', 'trashmail.me', 'trashmail.net', 'trashmail.org', 'trashmail.ws', 'trashmailer.com', 'trashymail.com', 'trashymail.net', 'trayna.com', 'trbvm.com', 'trialmail.de', 'trickmail.net', 'trillianpro.com', 'tryalert.com', 'turual.com', 'twinmail.de', 'twoweirdtricks.com', 'tyldd.com', 'ubismail.net', 'uggsrock.com', 'umail.net', 'unlimit.com', 'unmail.ru', 'upliftnow.com', 'uplipht.com', 'uroid.com', 'us.af', 'valemail.net', 'venompen.com', 'vermutlich.net', 'veryrealemail.com', 'vidchart.com', 'viditag.com', 'viewcastmedia.com', 'viewcastmedia.net', 'viewcastmedia.org', 'viralplays.com', 'vmail.me', 'voidbay.com', 'vomoto.com', 'vpn.st', 'vsimcard.com', 'vubby.com', 'w3internet.co.uk', 'walala.org', 'walkmail.net', 'watchever.biz', 'webemail.me', 'webm4il.info', 'webuser.in', 'wee.my', 'weg-werf-email.de', '<API key>.de', 'wegwerf-email.at', 'wegwerf-emails.de', 'wegwerfadresse.de', 'wegwerfemail.com', 'wegwerfemail.de', 'wegwerfmail.de', 'wegwerfmail.info', 'wegwerfmail.net', 'wegwerfmail.org', 'wem.com', 'wetrainbayarea.com', 'wetrainbayarea.org', 'wh4f.org', 'whatiaas.com', 'whatpaas.com', 'whatsaas.com', 'whopy.com', 'whyspam.me', 'wickmail.net', 'wilemail.com', 'willhackforfood.biz', 'willselfdestruct.com', 'winemaven.info', 'wmail.cf', 'writeme.com', 'wronghead.com', 'wuzup.net', 'wuzupmail.net', 'wwwnew.eu', 'wzukltd.com', 'xagloo.com', 'xemaps.com', 'xents.com', 'xmaily.com', 'xoxy.net', 'xww.ro', 'xyzfree.net', 'yapped.net', 'yep.it', 'yogamaven.com', 'yomail.info', 'yopmail.com', 'yopmail.fr', 'yopmail.gq', 'yopmail.net', 'yopmail.org', 'yoru-dea.com', 'you-spam.com', 'youmail.ga', 'yourdomain.com', 'ypmail.webarnak.fr.eu.org', 'yuurok.com', 'yyhmail.com', 'z1p.biz', 'za.com', 'zebins.com', 'zebins.eu', 'zehnminuten.de', 'zehnminutenmail.de', 'zetmail.com', 'zippymail.info', 'zoaxe.com', 'zoemail.com', 'zoemail.net', 'zoemail.org', 'zomg.info', 'zxcv.com', 'zxcvbnm.com', 'zzz.com', ] # reCAPTCHA API RECAPTCHA_SITE_KEY = None <API key> = None <API key> = 'https: # akismet spam check AKISMET_APIKEY = None SPAM_CHECK_ENABLED = False <API key> = True <API key> = False <API key> = timedelta(hours=24) <API key> = False <API key> = False SHARE_API_TOKEN = None # number of nodes that need to be affiliated with an institution before the institution logo is shown on the dashboard <API key> = 5 # refresh campaign every 5 minutes <API key> = 5 * 60 # 5 minutes in seconds AWS_ACCESS_KEY_ID = None <API key> = None # sitemap default settings SITEMAP_TO_S3 = False SITEMAP_AWS_BUCKET = None SITEMAP_URL_MAX = 25000 SITEMAP_INDEX_MAX = 50000 SITEMAP_STATIC_URLS = [ OrderedDict([('loc', ''), ('changefreq', 'yearly'), ('priority', '0.5')]), OrderedDict([('loc', 'preprints'), ('changefreq', 'yearly'), ('priority', '0.5')]), OrderedDict([('loc', 'prereg'), ('changefreq', 'yearly'), ('priority', '0.5')]), OrderedDict([('loc', 'meetings'), ('changefreq', 'yearly'), ('priority', '0.5')]), OrderedDict([('loc', 'registries'), ('changefreq', 'yearly'), ('priority', '0.5')]), OrderedDict([('loc', 'reviews'), ('changefreq', 'yearly'), ('priority', '0.5')]), OrderedDict([('loc', 'explore/activity'), ('changefreq', 'weekly'), ('priority', '0.5')]), OrderedDict([('loc', 'support'), ('changefreq', 'yearly'), ('priority', '0.5')]), OrderedDict([('loc', 'faq'), ('changefreq', 'yearly'), ('priority', '0.5')]), ] SITEMAP_USER_CONFIG = OrderedDict([('loc', ''), ('changefreq', 'yearly'), ('priority', '0.5')]) SITEMAP_NODE_CONFIG = OrderedDict([('loc', ''), ('lastmod', ''), ('changefreq', 'monthly'), ('priority', '0.5')]) <API key> = OrderedDict([('loc', ''), ('lastmod', ''), ('changefreq', 'never'), ('priority', '0.5')]) <API key> = OrderedDict([('loc', ''), ('lastmod', ''), ('changefreq', 'never'), ('priority', '0.5')]) <API key> = OrderedDict([('loc', ''), ('lastmod', ''), ('changefreq', 'yearly'), ('priority', '0.5')]) <API key> = OrderedDict([('loc', ''), ('lastmod', ''), ('changefreq', 'yearly'), ('priority', '0.5')]) CUSTOM_CITATIONS = { 'bluebook-law-review': 'bluebook', 'bluebook2': 'bluebook', 'bluebook-inline': 'bluebook' } PREPRINTS_ASSETS = '/static/img/preprints_assets/'
'use strict'; const Base = require('../../base/Component'); module.exports = class FilePacker extends Base { constructor (config) { super({ active: true, packs: [], Minifier: require('./Minifier'), config }); } async init () { this.createPacks(); if (this.active) { await this.pack(); } } createPacks () { this.packs = this.packs.map(this.createPack, this); } createPack (config) { return this.spawn({ Class: require('./FilePack'), packer: this, Minifier: this.Minifier, config }); } async pack () { for (const pack of this.packs) { await pack.pack(); } } };
package org.jdesktop.dom; import org.jdesktop.xpath.XPathUtils; import org.w3c.dom.*; import javax.xml.xpath.XPath; import javax.xml.xpath.XPathExpression; import javax.xml.xpath.<API key>; import java.lang.ref.SoftReference; import java.util.HashMap; import java.util.Map; /** * <p>A DOM {@link org.w3c.dom.Document} that makes it easier to work with DOM * documents. This class simply wraps a delegate DOM <code>Document</code> and * delegates all calls to the Document. This allows this class to work with * any DOM Document.</p> * * @author rbair */ public class SimpleDocument implements Document { private Document dom; private XPath xpath; //save compiled expressions to hopefully improve performance. These cached //expressions are saved in SoftReferences, so if memory gets tight they will //be released. private Map<String, SoftReference<XPathExpression>> cachedExpressions = new HashMap<String, SoftReference<XPathExpression>>(); /** * Create a new, empty, SimpleDocument */ public SimpleDocument() { this(new <API key>().newPlainDocument()); } /** * Creates a new instance of SimpleDocument. * * @param Document the DOM document to wrap within this SimpleDocument. */ public SimpleDocument(Document dom) { if (dom == null) { throw new <API key>("DOM Cannot be null"); } this.dom = dom; } /** * Creates a new instance of SimpleDocument with the given XML. The given * XML must be valid. * * @param xml */ public SimpleDocument(String xml) { try { this.dom = <API key>.simpleParse(xml); } catch (Exception e) { throw new RuntimeException(e); } } @Override public String toString() { return toXML(); } /** * Exports this DOM as a String */ public String toXML() { return XPathUtils.toXML(dom); } /* * Exports the given DOM Node as an XML document. * * @param Node the node to use as the root of the XML document * @return an XML String with the given Node as the root element */ public String toXML(Node n) { SimpleDocument temp = new SimpleDocument(); Node nn = n.cloneNode(true); temp.adoptNode(nn); temp.appendChild(nn); return temp.toXML(); } /** * <p>Returns the child elements of the specified node. This returns only the * immediate child Nodes of type ELEMENT_NODE.</p> * * @param parent the parent node * @return a SimpleNodeList containing all of the immediate child elements */ public SimpleNodeList getChildElements(Node node) { Node[] nodes = new Node[<API key>(node)]; int index = 0; NodeList list = node.getChildNodes(); for (int i=0; i<list.getLength(); i++) { Node n = list.item(i); if (n.getNodeType() == Node.ELEMENT_NODE) { nodes[index++] = n; } } return new SimpleNodeList(nodes); } /** * Returns the number of child elements for the given node. * Only immediate child nodes of type ELEMENT_NODE are counted. * * @param parent the parent node * @return the number of immediate child Elements of the given parent node */ public int <API key>(Node node) { int count = 0; NodeList list = node.getChildNodes(); for (int i=0; i<list.getLength(); i++) { Node n = list.item(i); if (n.getNodeType() == Node.ELEMENT_NODE) { count++; } } return count; } /** * Compiles the specified expression, and caches the expression in a SoftReference, * so that under stress it can be reclaimed by the system. * * @param expression the expression to compile * @returns the compiled expression as an XPathExpression */ private XPathExpression compile(String expression) throws <API key> { SoftReference<XPathExpression> ref = cachedExpressions.get(expression); XPathExpression e = ref == null ? null : ref.get(); if (e == null) { cachedExpressions.remove(expression); e = XPathUtils.compile(expression); cachedExpressions.put(expression, new SoftReference<XPathExpression>(e)); } return e; } /** * Returns a {@link SimpleNodeList} containing all the nodes that match the given expression. * * @param expression an XPath expression * @return SimpleNodeList containing the results from the expression. This will * never be null, but may contain no results. * @throws <API key> if the expression does not parse */ public SimpleNodeList getElements(String expression) { try { return XPathUtils.getElements(compile(expression), dom); } catch (<API key> ex) { throw new <API key>(ex); } } /** * Returns a {@link SimpleNodeList} containing all the nodes that match the given expression * when executed on the given node (as opposed to the dom as a whole). * * @param expression an XPath expression * @param node the contextual node * @return SimpleNodeList containing the results from the expression. This will * never be null, but may contain no results. * @throws <API key> if the expression does not parse */ public SimpleNodeList getElements(String expression, Node node) { try { return XPathUtils.getElements(compile(expression), node); } catch (<API key> ex) { throw new <API key>(ex); } } /** * Returns a Node matching the given expression. If more than one node matches, * the return value is undefined. * * @param expression an XPath expression * @return Node. May be null. * @throws <API key> if the expression does not parse */ public Node getElement(String expression) { try { return XPathUtils.getElement(compile(expression), dom); } catch (<API key> ex) { throw new <API key>(ex); } } /** * Returns a Node matching the given expression. If more than one node matches, * the return value is undefined. * * @param expression an XPath expression * @param node the contextual node * @return Node. May be null. * @throws <API key> if the expression does not parse */ public Node getElement(String expression, Node node) { try { return XPathUtils.getElement(compile(expression), node); } catch (<API key> ex) { throw new <API key>(ex); } } /** * Returns the text content of the Node matching the given expression. * If more than one node matches, the return value is undefined. * * @param expression an XPath expression * @return text content of the selected Node. May be null. * @throws <API key> if the expression does not parse */ public String getString(String expression) { try { return XPathUtils.getString(compile(expression), dom); } catch (<API key> ex) { throw new <API key>(ex); } } /** * Returns the text content of the Node matching the given expression. * If more than one node matches, the return value is undefined. * * @param expression an XPath expression * @param node the contextual node * @return text content of the selected Node. May be null. * @throws <API key> if the expression does not parse */ public String getString(String expression, Node node) { try { return XPathUtils.getString(compile(expression), node); } catch (<API key> ex) { throw new <API key>(ex); } } /** * @inheritDoc */ public DocumentType getDoctype() { return dom.getDoctype(); } /** * @inheritDoc */ public DOMImplementation getImplementation() { return dom.getImplementation(); } /** * @inheritDoc */ public Element getDocumentElement() { return dom.getDocumentElement(); } /** * @inheritDoc */ public Element createElement(String tagName) throws DOMException { return dom.createElement(tagName); } /** * @inheritDoc */ public DocumentFragment <API key>() { return dom.<API key>(); } /** * @inheritDoc */ public Text createTextNode(String data) { return dom.createTextNode(data); } /** * @inheritDoc */ public Comment createComment(String data) { return dom.createComment(data); } /** * @inheritDoc */ public CDATASection createCDATASection(String data) throws DOMException { return dom.createCDATASection(data); } /** * @inheritDoc */ public <API key> <API key>(String target, String data) throws DOMException { return dom.<API key>(target, data); } /** * @inheritDoc */ public Attr createAttribute(String name) throws DOMException { return dom.createAttribute(name); } /** * @inheritDoc */ public EntityReference <API key>(String name) throws DOMException { return dom.<API key>(name); } /** * @inheritDoc */ public SimpleNodeList <API key>(String tagname) { return new SimpleNodeList(dom.<API key>(tagname)); } /** * @inheritDoc */ public Node importNode(Node importedNode, boolean deep) throws DOMException { return dom.importNode(importedNode, deep); } /** * @inheritDoc */ public Element createElementNS(String namespaceURI, String qualifiedName) throws DOMException { return dom.createElementNS(namespaceURI, qualifiedName); } /** * @inheritDoc */ public Attr createAttributeNS(String namespaceURI, String qualifiedName) throws DOMException { return dom.createAttributeNS(namespaceURI, qualifiedName); } /** * @inheritDoc */ public SimpleNodeList <API key>(String namespaceURI, String localName) { return new SimpleNodeList(dom.<API key>(namespaceURI, localName)); } /** * @inheritDoc */ public Element getElementById(String elementId) { return dom.getElementById(elementId); } /** * @inheritDoc */ public String getInputEncoding() { return dom.getInputEncoding(); } /** * @inheritDoc */ public String getXmlEncoding() { return dom.getXmlEncoding(); } /** * @inheritDoc */ public boolean getXmlStandalone() { return dom.getXmlStandalone(); } /** * @inheritDoc */ public void setXmlStandalone(boolean xmlStandalone) throws DOMException { dom.setXmlStandalone(xmlStandalone); } /** * @inheritDoc */ public String getXmlVersion() { return dom.getXmlVersion(); } /** * @inheritDoc */ public void setXmlVersion(String xmlVersion) throws DOMException { dom.setXmlVersion(xmlVersion); } /** * @inheritDoc */ public boolean <API key>() { return dom.<API key>(); } /** * @inheritDoc */ public void <API key>(boolean strictErrorChecking) { dom.<API key>(strictErrorChecking); } /** * @inheritDoc */ public String getDocumentURI() { return dom.getDocumentURI(); } /** * @inheritDoc */ public void setDocumentURI(String documentURI) { dom.setDocumentURI(documentURI); } /** * @inheritDoc */ public Node adoptNode(Node source) throws DOMException { return dom.adoptNode(source); } /** * @inheritDoc */ public DOMConfiguration getDomConfig() { return dom.getDomConfig(); } /** * @inheritDoc */ public void normalizeDocument() { dom.normalizeDocument(); } /** * @inheritDoc */ public Node renameNode(Node n, String namespaceURI, String qualifiedName) throws DOMException { return dom.renameNode(n, namespaceURI, qualifiedName); } /** * @inheritDoc */ public String getNodeName() { return dom.getNodeName(); } /** * @inheritDoc */ public String getNodeValue() throws DOMException { return dom.getNodeValue(); } /** * @inheritDoc */ public void setNodeValue(String nodeValue) throws DOMException { dom.setNodeValue(nodeValue); } /** * @inheritDoc */ public short getNodeType() { return dom.getNodeType(); } /** * @inheritDoc */ public Node getParentNode() { return dom.getParentNode(); } /** * @inheritDoc */ public SimpleNodeList getChildNodes() { return new SimpleNodeList(dom.getChildNodes()); } /** * @inheritDoc */ public Node getFirstChild() { return dom.getFirstChild(); } /** * @inheritDoc */ public Node getLastChild() { return dom.getLastChild(); } /** * @inheritDoc */ public Node getPreviousSibling() { return dom.getPreviousSibling(); } /** * @inheritDoc */ public Node getNextSibling() { return dom.getNextSibling(); } /** * @inheritDoc */ public NamedNodeMap getAttributes() { return dom.getAttributes(); } /** * @inheritDoc */ public Document getOwnerDocument() { return dom.getOwnerDocument(); } /** * @inheritDoc */ public Node insertBefore(Node newChild, Node refChild) throws DOMException { return dom.insertBefore(newChild, refChild); } /** * @inheritDoc */ public Node replaceChild(Node newChild, Node oldChild) throws DOMException { return dom.replaceChild(newChild, oldChild); } /** * @inheritDoc */ public Node removeChild(Node oldChild) throws DOMException { return dom.removeChild(oldChild); } /** * @inheritDoc */ public Node appendChild(Node newChild) throws DOMException { return dom.appendChild(newChild); } /** * @inheritDoc */ public boolean hasChildNodes() { return dom.hasChildNodes(); } /** * @inheritDoc */ public Node cloneNode(boolean deep) { return dom.cloneNode(deep); } /** * @inheritDoc */ public void normalize() { dom.normalize(); } /** * @inheritDoc */ public boolean isSupported(String feature, String version) { return dom.isSupported(feature, version); } /** * @inheritDoc */ public String getNamespaceURI() { return dom.getNamespaceURI(); } /** * @inheritDoc */ public String getPrefix() { return dom.getPrefix(); } /** * @inheritDoc */ public void setPrefix(String prefix) throws DOMException { dom.setPrefix(prefix); } /** * @inheritDoc */ public String getLocalName() { return dom.getLocalName(); } /** * @inheritDoc */ public boolean hasAttributes() { return dom.hasAttributes(); } /** * @inheritDoc */ public String getBaseURI() { return dom.getBaseURI(); } /** * @inheritDoc */ public short <API key>(Node other) throws DOMException { return dom.<API key>(other); } /** * @inheritDoc */ public String getTextContent() throws DOMException { return dom.getTextContent(); } /** * @inheritDoc */ public void setTextContent(String textContent) throws DOMException { dom.setTextContent(textContent); } /** * @inheritDoc */ public boolean isSameNode(Node other) { return dom.isSameNode(other); } /** * @inheritDoc */ public String lookupPrefix(String namespaceURI) { return dom.lookupPrefix(namespaceURI); } /** * @inheritDoc */ public boolean isDefaultNamespace(String namespaceURI) { return dom.isDefaultNamespace(namespaceURI); } /** * @inheritDoc */ public String lookupNamespaceURI(String prefix) { return dom.lookupNamespaceURI(prefix); } /** * @inheritDoc */ public boolean isEqualNode(Node arg) { return dom.isEqualNode(arg); } /** * @inheritDoc */ public Object getFeature(String feature, String version) { return dom.getFeature(feature, version); } /** * @inheritDoc */ public Object setUserData(String key, Object data, UserDataHandler handler) { return dom.setUserData(key, data, handler); } /** * @inheritDoc */ public Object getUserData(String key) { return dom.getUserData(key); } }
#!/usr/bin/env python """settings.py Udacity conference server-side Python App Engine app user settings $Id$ created/forked from conference.py by wesc on 2014 may 24 """ # Replace the following lines with client IDs obtained from the APIs # Console or Cloud Console. WEB_CLIENT_ID = '<API key>.apps.googleusercontent.com' ANDROID_CLIENT_ID = 'replace with Android client ID' IOS_CLIENT_ID = 'replace with iOS client ID' ANDROID_AUDIENCE = WEB_CLIENT_ID
package com.nuvola.myproject.server.security; import java.io.IOException; import java.io.PrintWriter; import javax.servlet.ServletException; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.converter.json.<API key>; import org.springframework.security.core.Authentication; import org.springframework.security.web.authentication.SavedRequestAware<API key>; import org.springframework.stereotype.Component; import com.fasterxml.jackson.databind.ObjectMapper; import com.nuvola.myproject.shared.model.User; @Component public class AuthSuccessHandler extends SavedRequestAware<API key> { private static final Logger LOGGER = LoggerFactory.getLogger(AuthSuccessHandler.class); private final ObjectMapper mapper; @Autowired AuthSuccessHandler(<API key> messageConverter) { this.mapper = messageConverter.getObjectMapper(); } @Override public void on<API key>(HttpServletRequest request, HttpServletResponse response, Authentication authentication) throws IOException, ServletException { response.setStatus(HttpServletResponse.SC_OK); NuvolaUserDetails userDetails = (NuvolaUserDetails) authentication.getPrincipal(); User user = userDetails.getUser(); userDetails.setUser(user); LOGGER.info(userDetails.getUsername() + " got is connected "); PrintWriter writer = response.getWriter(); mapper.writeValue(writer, user); writer.flush(); } }
create table ODE_SCHEMA_VERSION (VERSION integer); insert into ODE_SCHEMA_VERSION values (5);
// Generated by the protocol buffer compiler. DO NOT EDIT! // source: google/api/endpoint.proto package com.google.api; public final class EndpointProto { private EndpointProto() {} public static void <API key>( com.google.protobuf.<API key> registry) { } public static void <API key>( com.google.protobuf.ExtensionRegistry registry) { <API key>( (com.google.protobuf.<API key>) registry); } static final com.google.protobuf.Descriptors.Descriptor <API key>; static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable <API key>; public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { return descriptor; } private static com.google.protobuf.Descriptors.FileDescriptor descriptor; static { java.lang.String[] descriptorData = { "\n\031google/api/endpoint.proto\022\ngoogle.api\"" + "c\n\010Endpoint\022\014\n\004name\030\001 \001(\t\022\023\n\007aliases\030\002 \003" + "(\tB\002\030\001\022\020\n\010features\030\004 \003(\t\022\016\n\006target\030e \001(\t" + "\022\022\n\nallow_cors\030\005 \001(\010Bo\n\016com.google.apiB\r" + "EndpointProtoP\001ZEgoogle.golang.org/genpr" + "oto/googleapis/api/serviceconfig;service" + "config\242\002\004GAPIb\006proto3" }; com.google.protobuf.Descriptors.FileDescriptor.<API key> assigner = new com.google.protobuf.Descriptors.FileDescriptor. <API key>() { public com.google.protobuf.ExtensionRegistry assignDescriptors( com.google.protobuf.Descriptors.FileDescriptor root) { descriptor = root; return null; } }; com.google.protobuf.Descriptors.FileDescriptor .<API key>(descriptorData, new com.google.protobuf.Descriptors.FileDescriptor[] { }, assigner); <API key> = getDescriptor().getMessageTypes().get(0); <API key> = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( <API key>, new java.lang.String[] { "Name", "Aliases", "Features", "Target", "AllowCors", }); } // @@<API key>(outer_class_scope) }
package org.oep.usermgt.service.http; public class <API key> { }
// This program is free software; you can redistribute it and/or // as published by the Free Software Foundation; either version 2 // This program is distributed in the hope that it will be useful, // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #ifndef __INET_ILISTENING_H #define __INET_ILISTENING_H #include "inet/common/geometry/common/Coord.h" #include "inet/physicallayer/contract/IPrintableObject.h" namespace inet { namespace physicallayer { class IRadio; /** * This interface represents how a receiver is listening on the radio channel. */ class INET_API IListening : public IPrintableObject { public: virtual const IRadio *getReceiver() const = 0; virtual const simtime_t getStartTime() const = 0; virtual const simtime_t getEndTime() const = 0; virtual const Coord getStartPosition() const = 0; virtual const Coord getEndPosition() const = 0; }; } // namespace physicallayer } // namespace inet #endif // ifndef __INET_ILISTENING_H
<?php if ( ! defined( 'ABSPATH' ) ) { exit; } ?> <?php do_action( '<API key>' ); ?> <div class="grid-row table-row cart-subtotal padding-top-small <API key>"> <div class="grid-item item-s-6 font-bold font-uppercase"><?php _e( 'Subtotal', 'woocommerce' ); ?></div> <div class="grid-item item-s-6 text-align-right" data-title="<?php esc_attr_e( 'Subtotal', 'woocommerce' ); ?>"><?php <API key>(); ?></div> </div> <?php foreach ( WC()->cart->get_coupons() as $code => $coupon ) : ?> <div class="grid-row table-row padding-top-small <API key> cart-discount coupon-<?php echo esc_attr( sanitize_title( $code ) ); ?>"> <div class="grid-item item-s-6 font-bold font-uppercase"><?php <API key>( $coupon ); ?></div> <div class="grid-item item-s-6 text-align-right" data-title="<?php echo esc_attr( <API key>( $coupon, false ) ); ?>"><?php <API key>( $coupon ); ?></div> </div> <?php endforeach; ?> <?php if ( WC()->cart->needs_shipping() && WC()->cart->show_shipping() ) : ?> <?php do_action( '<API key>' ); ?> <?php <API key>(); ?> <?php do_action( '<API key>' ); ?> <?php elseif ( WC()->cart->needs_shipping() && 'yes' === get_option( '<API key>' ) ) : ?> <div class="grid-row table-row shipping padding-top-small <API key>"> <div class="grid-item item-s-6 font-bold font-uppercase"><?php _e( 'Shipping', 'woocommerce' ); ?></div> <div class="grid-item item-s-6 text-align-right" data-title="<?php esc_attr_e( 'Shipping', 'woocommerce' ); ?>"><?php <API key>(); ?></div> </div> <?php endif; ?> <?php foreach ( WC()->cart->get_fees() as $fee ) : ?> <div class="grid-row table-row fee padding-top-small <API key>"> <div class="grid-item item-s-6 font-bold font-uppercase"><?php echo esc_html( $fee->name ); ?></div> <div class="grid-item item-s-6 text-align-right" data-title="<?php echo esc_attr( $fee->name ); ?>"><?php <API key>( $fee ); ?></div> </div> <?php endforeach; ?> <?php if ( wc_tax_enabled() && 'excl' === WC()->cart->tax_display_cart ) : $taxable_address = WC()->customer->get_taxable_address(); $estimated_text = WC()->customer-><API key>() && ! WC()->customer-><API key>() ? sprintf( ' <small>(' . __( 'estimated for %s', 'woocommerce' ) . ')</small>', WC()->countries-><API key>( $taxable_address[0] ) . WC()->countries->countries[ $taxable_address[0] ] ) : ''; if ( 'itemized' === get_option( '<API key>' ) ) : ?> <?php foreach ( WC()->cart->get_tax_totals() as $code => $tax ) : ?> <div class="grid-row table-row padding-top-small <API key> tax-rate tax-rate-<?php echo sanitize_title( $code ); ?>"> <div class="grid-item item-s-6 font-bold font-uppercase"><?php echo esc_html( $tax->label ) . $estimated_text; ?></div> <div class="grid-item item-s-6 text-align-right" data-title="<?php echo esc_attr( $tax->label ); ?>"><?php echo wp_kses_post( $tax->formatted_amount ); ?></div> </div> <?php endforeach; ?> <?php else : ?> <div class="grid-row table-row tax-total padding-top-small <API key>"> <div class="grid-item item-s-6"><?php echo esc_html( WC()->countries->tax_or_vat() ) . $estimated_text; ?></div> <div class="grid-item item-s-6 text-align-right" data-title="<?php echo esc_attr( WC()->countries->tax_or_vat() ); ?>"><?php <API key>(); ?></div> </div> <?php endif; ?> <?php endif; ?> <?php do_action( '<API key>' ); ?> <div class="grid-row table-row order-total padding-top-small <API key>"> <div class="grid-item item-s-6 font-bold font-uppercase"><?php _e( 'Total', 'woocommerce' ); ?></div> <div class="grid-item item-s-6 text-align-right font-size-medium" data-title="<?php esc_attr_e( 'Total', 'woocommerce' ); ?>"><?php <API key>(); ?></div> </div> <?php do_action( '<API key>' ); ?> <div class="grid-row padding-top-tiny <API key> padding-top-small <API key>"> <div class="grid-item item-s-12 text-align-right"> <?php do_action( '<API key>' ); ?> </div> </div> <?php do_action( '<API key>' ); ?>
#include "map/framework_light.hpp" #include "map/<API key>.hpp" #include "map/local_ads_manager.hpp" #include "base/assert.hpp" #include "com/mapswithme/maps/Framework.hpp" #include "com/mapswithme/core/jni_helper.hpp" extern "C" { JNIEXPORT jboolean JNICALL <API key>(JNIEnv * env, jclass clazz) { lightweight::Framework const framework(lightweight::<API key>); return static_cast<jboolean>(framework.IsUserAuthenticated()); } JNIEXPORT jint JNICALL <API key>(JNIEnv * env, jclass clazz) { lightweight::Framework const framework(lightweight::<API key>); return static_cast<jint>(framework.<API key>()); } jobject CreateFeatureId(JNIEnv * env, CampaignFeature const & data) { static jmethodID const featureCtorId = jni::GetConstructorID(env, g_featureIdClazz, "(Ljava/lang/String;JI)V"); jni::TScopedLocalRef const countryId(env, jni::ToJavaString(env, data.m_countryId)); return env->NewObject(g_featureIdClazz, featureCtorId, countryId.get(), static_cast<jlong>(data.m_mwmVersion), static_cast<jint>(data.m_featureIndex)); } JNIEXPORT jstring JNICALL <API key>(JNIEnv * env, jclass clazz, jstring mwmName, jlong mwmVersion, jint featureIndex) { auto const featureId = lightweight::<API key>( static_cast<int64_t>(mwmVersion), jni::ToNativeString(env, mwmName), static_cast<uint32_t>(featureIndex)); return jni::ToJavaString(env, featureId); } JNIEXPORT jobjectArray JNICALL <API key>(JNIEnv * env, jclass clazz, jdouble lat, jdouble lon, jdouble radiusInMeters, jint maxCount) { lightweight::Framework framework(lightweight::<API key>); auto const features = framework.GetLocalAdsFeatures(lat, lon, radiusInMeters, maxCount); static jclass const <API key> = jni::GetGlobalClassRef(env, "com/mapswithme/maps/geofence/GeoFenceFeature"); // Java signature : GeoFenceFeature(FeatureId featureId, // double latitude, double longitude) static jmethodID const <API key> = jni::GetConstructorID(env, <API key>, "(Lcom/mapswithme/maps/bookmarks/data/FeatureId;DD)V"); return jni::ToJavaArray(env, <API key>, features, [&](JNIEnv * jEnv, CampaignFeature const & data) { jni::TScopedLocalRef const featureId(env, CreateFeatureId(env, data)); return env->NewObject(<API key>, <API key>, featureId.get(), static_cast<jdouble>(data.m_lat), static_cast<jdouble>(data.m_lon)); }); } JNIEXPORT void JNICALL <API key>(JNIEnv * env, jclass clazz, jint type, jdouble lat, jdouble lon, jint accuracyInMeters, jlong mwmVersion, jstring countryId, jint featureIndex) { lightweight::Framework framework(lightweight::<API key>); local_ads::Event event(static_cast<local_ads::EventType>(type), static_cast<long>(mwmVersion), jni::ToNativeString(env, countryId), static_cast<uint32_t>(featureIndex), static_cast<uint8_t>(1) /* zoom level */, local_ads::Clock::now(), static_cast<double>(lat), static_cast<double>(lon), static_cast<uint16_t>(accuracyInMeters)); framework.<API key>()->RegisterEvent(std::move(event)); } JNIEXPORT jobject JNICALL <API key>(JNIEnv * env, jclass clazz) { lightweight::Framework framework(lightweight::<API key>); if (g_framework) framework.SetDelegate(std::make_unique<<API key>>(*g_framework->NativeFramework())); auto const notification = framework.GetNotification(); if (!notification) return nullptr; auto const & n = notification.get(); // Type::UgcReview is only supported. CHECK_EQUAL(n.GetType(), notifications::<API key>::Type::UgcReview, ()); static jclass const candidateId = jni::GetGlobalClassRef(env, "com/mapswithme/maps/background/<API key>$UgcReview"); static jmethodID const candidateCtor = jni::GetConstructorID( env, candidateId, "(DDLjava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)V"); auto const readableName = jni::ToJavaString(env, n.GetReadableName()); auto const defaultName = jni::ToJavaString(env, n.GetDefaultName()); auto const type = jni::ToJavaString(env, n.GetBestFeatureType()); auto const address = jni::ToJavaString(env, n.GetAddress()); return env->NewObject(candidateId, candidateCtor, n.GetPos().x, n.GetPos().y, readableName, defaultName, type, address); } } // extern "C"
package com.waydrow.coolweather; import android.content.Context; import android.support.test.<API key>; import android.support.test.runner.AndroidJUnit4; import org.junit.Test; import org.junit.runner.RunWith; import static org.junit.Assert.*; @RunWith(AndroidJUnit4.class) public class <API key> { @Test public void useAppContext() throws Exception { // Context of the app under test. Context appContext = <API key>.getTargetContext(); assertEquals("com.waydrow.coolweather", appContext.getPackageName()); } }
package bl.beans; import org.mongodb.morphia.annotations.Entity; import org.mongodb.morphia.annotations.Transient; import policy.PolicyObject; import java.util.List; @Entity(value = "task_entity") public class TaskEntityBean extends Bean{ private String description; private int type; private int dispatchType; private int approveType; @Transient private List<PolicyObject> policies; @Transient private List<TaskParamBean> taskParams; public String getDescription() { return description; } public void setDescription(String description) { this.description = description; } public int getType() { return type; } public void setType(int type) { this.type = type; } public int getDispatchType() { return dispatchType; } public void setDispatchType(int dispatchType) { this.dispatchType = dispatchType; } public int getApproveType() { return approveType; } public void setApproveType(int approveType) { this.approveType = approveType; } public List<PolicyObject> getPolicies() { return policies; } public void setPolicies(List<PolicyObject> policies) { this.policies = policies; } public List<TaskParamBean> getTaskParams() { return taskParams; } public void setTaskParams(List<TaskParamBean> taskParams) { this.taskParams = taskParams; } }
# Disanthaceae Nakai FAMILY # Status SYNONYM # According to GRIN Taxonomy for Plants # Published in null # Original name null Remarks null
//Factor Controller handle all Factor changes function FactorCtrl($scope,FactorService){ $scope.Factors = new ItemController(Factor); $scope.GetNewFactor = function(){ return new Factor({Description:"",ID:$scope.Factors.IDs.add()}); }; $scope.CountFactors = function(){ return $scope.Factors.Count(); }; $scope.UpdateFactor = function(factor){ console.log("FactorCtrl::UpdateFactor"); $scope.Factors.Update(factor); FactorService.FactorChanged({Factor:factor,Event:'FactorUpdate'}); }; $scope.AddFactor = function(factor){ console.log("FactorCtrl::AddFactor"); $scope.Factors.Add(factor); $scope.NewFactor = $scope.GetNewFactor(); FactorService.FactorChanged({Factor:factor,Event:'FactorAdd'}); }; $scope.RemoveFactor = function(factor){ console.log("FactorCtrl::RemoveFactor"); $scope.Factors.Remove(factor); FactorService.FactorChanged({Factor:factor,Event:'FactorRemove'}); }; $scope.NewFactor = $scope.GetNewFactor(); };
(function () { 'use strict'; angular .module('fitappApp') .constant('LANGUAGES', [ 'en', 'pl' // <API key> - JHipster will add/remove languages in this array ] ); })();
#pragma once #include <iostream> #include "DataSet\MessageQueueData.h" #include "Config.h" #include "Json.h" #include <Shlwapi.h> #include <fstream> using namespace std; class MessageQueue { private: static MessageQueue *instance; bool isUsable(); void lockFile(); void unLockFile(); bool isEmpty(ifstream& in); MessageQueue(); public: static MessageQueue* getInstance(); MessageQueueData* Dequeue(); };
// HyperlinksButton.h // shuaidanbao #import <UIKit/UIKit.h> @interface HyperlinksButton : UIButton @property (strong, nonatomic) UIColor *lineColor; @end
#pragma once #include "il2cpp-config.h" #ifndef _MSC_VER # include <alloca.h> #else # include <malloc.h> #endif #include <stdint.h> #include "<API key>.h" #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Winvalid-offsetof" #pragma clang diagnostic ignored "-Wunused-variable" #endif // UnityEngine.Internal.<API key> struct <API key> : public <API key> { public: public: }; #ifdef __clang__ #pragma clang diagnostic pop #endif
using System; using System.Collections.Generic; using System.Linq; using System.Net; using System.Threading; using System.Threading.Tasks; using Newtonsoft.Json.Linq; namespace Microsoft.WindowsAzure.MobileServices.Sync { <summary> Responsible for executing a batch of operations from queue until bookmark is found </summary> internal class PushAction : SyncAction { private readonly <API key> syncHandler; private readonly MobileServiceClient client; private readonly <API key> context; private readonly IEnumerable<string> tableNames; private readonly <API key> tableKind; public PushAction(OperationQueue operationQueue, <API key> store, <API key> tableKind, IEnumerable<string> tableNames, <API key> syncHandler, MobileServiceClient client, <API key> context, Cancellation<API key>) : base(operationQueue, store, cancellationToken) { this.tableKind = tableKind; this.tableNames = tableNames; this.client = client; this.syncHandler = syncHandler; this.context = context; } public override async Task ExecuteAsync() { var batch = new OperationBatch(this.syncHandler, this.Store, this.context); List<<API key>> syncErrors = new List<<API key>>(); <API key> batchStatus = <API key>.InternalError; try { batchStatus = await ExecuteBatchAsync(batch, syncErrors); } catch (Exception ex) { batch.OtherErrors.Add(ex); } await FinalizePush(batch, batchStatus, syncErrors); } private async Task<<API key>> ExecuteBatchAsync(OperationBatch batch, List<<API key>> syncErrors) { // when cancellation is requested, abort the batch this.CancellationToken.Register(() => batch.Abort(<API key>.CancelledByToken)); try { await <API key>(batch); } catch (Exception ex) { batch.OtherErrors.Add(ex); } <API key> batchStatus = batch.AbortReason.GetValueOrDefault(<API key>.Complete); try { syncErrors.AddRange(await batch.LoadSyncErrorsAsync(this.client.SerializerSettings)); } catch (Exception ex) { batch.OtherErrors.Add(new <API key>("Failed to read errors from the local store.", ex)); } return batchStatus; } private async Task FinalizePush(OperationBatch batch, <API key> batchStatus, IEnumerable<<API key>> syncErrors) { var result = new <API key>(syncErrors, batchStatus); try { await batch.SyncHandler.OnPushCompleteAsync(result); // now that we've successfully given the errors to user, we can delete them from store await batch.DeleteErrorsAsync(); } catch (Exception ex) { batch.OtherErrors.Add(ex); } if (batchStatus != <API key>.Complete || batch.HasErrors(syncErrors)) { List<<API key>> unhandledSyncErrors = syncErrors.Where(e => !e.Handled).ToList(); Exception inner; if (batch.OtherErrors.Count == 1) { inner = batch.OtherErrors[0]; } else { inner = batch.OtherErrors.Any() ? new AggregateException(batch.OtherErrors) : null; } // create a new result with only unhandled errors result = new <API key>(unhandledSyncErrors, batchStatus); this.TaskSource.TrySetException(new <API key>(result, inner)); } else { this.TaskSource.SetResult(0); } } private async Task <API key>(OperationBatch batch) { <API key> operation = await this.OperationQueue.PeekAsync(0, this.tableKind, this.tableNames); // keep taking out operations and executing them until queue is empty or operation finds the bookmark or batch is aborted while (operation != null) { using (await this.OperationQueue.LockItemAsync(operation.ItemId, this.CancellationToken)) { bool success = await this.<API key>(operation, batch); if (batch.AbortReason.HasValue) { break; } if (success) { // we successfuly executed an operation so remove it from queue await this.OperationQueue.DeleteAsync(operation.Id, operation.Version); } // get next operation operation = await this.OperationQueue.PeekAsync(operation.Sequence, this.tableKind, this.tableNames); } } } private async Task<bool> <API key>(<API key> operation, OperationBatch batch) { if (operation.IsCancelled || this.CancellationToken.<API key>) { return false; } operation.Table = await this.context.GetTable(operation.TableName); await this.LoadOperationItem(operation, batch); if (operation.Item == null || this.CancellationToken.<API key>) { return false; } await <API key>(operation, <API key>.Attempted, batch); // strip out system properties before executing the operation operation.Item = <API key>.<API key>(operation.Item); JObject result = null; Exception error = null; try { result = await batch.SyncHandler.<API key>(operation); } catch (Exception ex) { error = ex; } if (error != null) { await <API key>(operation, <API key>.Failed, batch); if (TryAbortBatch(batch, error)) { // there is no error to save in sync error and no result to capture // this operation will be executed again next time the push happens return false; } } // save the result if <API key> did not throw if (error == null && result.IsValidItem() && operation.<API key>) { await TryStoreOperation(() => this.Store.UpsertAsync(operation.TableName, result, fromServer: true), batch, "Failed to update the item in the local store."); } else if (error != null) { HttpStatusCode? statusCode = null; string rawResult = null; if (error is <API key> iox && iox.Response != null) { statusCode = iox.Response.StatusCode; Tuple<string, JToken> content = await MobileServiceTable.ParseContent(iox.Response, this.client.SerializerSettings); rawResult = content.Item1; result = content.Item2.ValidItemOrNull(); } var syncError = new <API key>(operation.Id, operation.Version, operation.Kind, statusCode, operation.TableName, operation.Item, rawResult, result) { TableKind = this.tableKind, Context = this.context }; await batch.AddSyncErrorAsync(syncError); } bool success = error == null; return success; } private async Task <API key>(<API key> operation, <API key> state, OperationBatch batch) { operation.State = state; await TryStoreOperation(() => this.OperationQueue.UpdateAsync(operation), batch, "Failed to update operation in the local store."); } private async Task LoadOperationItem(<API key> operation, OperationBatch batch) { // only read the item from store if it is not in the operation already if (operation.Item == null) { await TryStoreOperation(async () => { operation.Item = await this.Store.LookupAsync(operation.TableName, operation.ItemId) as JObject; }, batch, "Failed to read the item from local store."); // Add sync error if item is not found. if (operation.Item == null) { // Create an item with only id to be able handle error properly. var item = new JObject(new JProperty(<API key>.Id, operation.ItemId)); var syncError = new <API key>(operation.Id, operation.Version, operation.Kind, null, operation.TableName, item, null, null) { TableKind = this.tableKind, Context = this.context }; await batch.AddSyncErrorAsync(syncError); } } } private static async Task TryStoreOperation(Func<Task> action, OperationBatch batch, string error) { try { await action(); } catch (Exception ex) { batch.Abort(<API key>.<API key>); throw new <API key>(error, ex); } } private bool TryAbortBatch(OperationBatch batch, Exception ex) { if (ex.IsNetworkError()) { batch.Abort(<API key>.<API key>); } else if (ex.<API key>()) { batch.Abort(<API key>.<API key>); } else if (ex is <API key>) { batch.Abort(<API key>.<API key>); } else { return false; // not a known exception that should abort the batch } return true; } } }
package co.haptik.windowjobscheduler; import org.junit.Test; import java.util.Calendar; import static org.junit.Assert.*; public class WindowTaskTest { @Test public void testGetPeriod() throws Exception { Calendar now = Calendar.getInstance(); now.setLenient(true); WindowTask task = new WindowTask() .setWindowHours(1) .setStartTime(now.get(Calendar.HOUR_OF_DAY), now.get(Calendar.MINUTE) + 1); long period = task.getPeriod(); /** * 1 hour = 60 minutes = 3600 seconds, + 60 seconds for starting a minute later */ assertTrue("Period:"+period, period == 3660); task = new WindowTask() .setWindowHours(6) .setStartTime(now.get(Calendar.HOUR_OF_DAY), now.get(Calendar.MINUTE) + 5); period = task.getPeriod(); /** * 6 hours = 360 minutes = 21600 seconds, + 300 seconds for 5 minutes later */ assertTrue("Period:"+period, period == 21900); task = new WindowTask() .setWindowHours(6) .setStartTime(now.get(Calendar.HOUR_OF_DAY)-3, now.get(Calendar.MINUTE)); period = task.getPeriod(); /** * 21 hours (24-3) = 1260 minutes = 75600 seconds, + 21600 for 6 hours later */ assertTrue("Period:"+period, period == 97200); } }
package com.chr.controller; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; import org.springframework.ui.Model; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.RequestParam; import com.chr.domain.User; import com.chr.service.impl.<API key>; /** * @author Edwin Chen * */ @Controller @RequestMapping(value = "/redis") public class UserController { @Autowired private <API key> <API key>; private User user; @RequestMapping(value = "/addUser", method = RequestMethod.POST) public String addUser( @RequestParam(value = "Id", required = true) String Id, @RequestParam(value = "name", required = true) String name, @RequestParam(value = "password", required = true) String password) { user = new User(Id, name, password); <API key>.add(user); return "/WEB-INF/jsp/AddUserSuccess.jsp"; } @RequestMapping(value = "/addUser", method = RequestMethod.GET) public String addUser() { return "/WEB-INF/jsp/AddUser.jsp"; } @RequestMapping(value = "/queryUser") public String queryUser() { return "/WEB-INF/jsp/getUser.jsp"; } @RequestMapping(value = "/getUser") public String getUser( @RequestParam(value = "key", required = true) String key,Model model) { user = <API key>.getUser(key); model.addAttribute("userId", user.getId()); model.addAttribute("username", user.getName()); model.addAttribute("userpassword", user.getPassword()); return "/WEB-INF/jsp/showUser.jsp"; } }
<?php namespace Phine\Bundles\Core\Snippets\FormFields; use Phine\Framework\FormElements\Fields\Input; use Phine\Bundles\Core\Logic\Snippet\TemplateSnippet; /** * Renders an input field of type text and its label before */ class HiddenInputField extends TemplateSnippet { protected $field; protected $attribs; function __construct(Input $field) { $this->field = $field; $this->attribs = $field->GetHtmlAttributes(); } }
require 'spec_helper' describe 'Drawing tasks' do let(:record) do { "source"=>"panoptes", "type"=>"classification", "version"=>"1.0.0", "timestamp"=>"2016-02-29T11:02:46Z", "data"=>{ "id"=>"10178511", "created_at"=>"2016-02-29T11:02:46.353Z", "updated_at"=>"2016-02-29T11:02:46.411Z", "user_ip"=>"127.0.0.1", "annotations"=>[ {"task"=>"T1", "value"=>0}, {"task"=>"T2", "value"=>[ { "tool"=>0, "frame"=>0, "closed"=>true, "points"=>[ {"x"=>143.2045287510176, "y"=>55.03589970175632}, {"x"=>358.45606536409394, "y"=>59.92797967524577}, {"x"=>574.9306220715628, "y"=>66.04307964210759}, {"x"=>578.5996823547403, "y"=>281.2945984756434}, {"x"=>363.34814574166387, "y"=>271.5104385286645}, {"x"=>144.42754884541006, "y"=>270.28741853529215} ], "details"=>[] } ]}, {"task"=>"T3", "value"=>[ {"x"=>422.0531102725028, "y"=>212.8054788467911, "tool"=>2, "frame"=>0, "details"=>[]}, {"x1"=>239.82311620802346, "x2"=>270.39861856783546, "y1"=>99.06461946316138, "y2"=>97.84159946978902, "tool"=>0, "frame"=>0, "details"=>[]}, {"x1"=>386.58552753512095, "x2"=>429.3912308388577, "y1"=>228.7047387606318, "y2"=>229.9277587540042, "tool"=>0, "frame"=>0, "details"=>[]}, {"x1"=>195.7943928098942, "x2"=>222.70083488652875, "y1"=>226.2586987738871, "y2"=>227.48171876725945, "tool"=>0, "frame"=>0, "details"=>[]} ]} ], "metadata"=>{ "session"=>"asdf", "viewport"=>{"width"=>1097, "height"=>629}, "started_at"=>"2016-02-29T11:00:34.940Z", "user_agent"=>"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/48.0.2564.116 Safari/537.36", "utc_offset"=>"18000", "finished_at"=>"2016-02-29T11:02:44.785Z", "live_project"=>true, "user_language"=>"en", "user_group_ids"=>[], "subject_dimensions"=>[{"clientWidth"=>572, "clientHeight"=>283, "naturalWidth"=>700, "naturalHeight"=>346}], "workflow_version"=>"137.203" }, "href"=>"/classifications/10178511", "links"=>{"project"=>"153", "user"=>"123", "workflow"=>"125", "subjects"=>["1641047"]} }, "linked"=>{ "subjects"=>[{ "id"=>"1641047", "metadata"=>{"#Col"=>"2", "#Row"=>"2", "Filename"=>"R1066358_c_2_2.jpg"}, "created_at"=>"2016-02-22T21:26:08.448Z", "updated_at"=>"2016-02-22T21:26:08.448Z", "href"=>"/subjects/1641047" }] } } end end
<!DOCTYPE html> <html> <head> <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" /> <meta http-equiv=Content-Type content="text/html;charset=utf-8"> <meta property="wb:webmaster" content="e635a420782119b7" /> <meta name="keywords" content=",,,,,,,,,,, ,,,,dulife,dulife,,,360,,,,,,, ,,,"> <meta name="description" content="“”"> <!--[if lte IE 7]> <div class="goodbye-modal hide"></div> <div class="goodbye-ie hide" id="goodbyeIE"> <p>~</p> <ul class="browers clearfix"> <li class="chrome"> <a target="_blank" href="https: <span>chrome</span> </li> <li class="firefox"> <a target="_blank" href="http: <span>firefox</span> </li> <li class="ie9"> <a target="_blank" href="http://windows.microsoft.com/zh-cn/internet-explorer/download-ie"></a> <span>IE9+</span> </li> </ul> <p class="no-tip"><a id="iknow" href="javascript:void(0);"></a></p> </div> <![endif] <script> void function(g,f,j,c,h,d,b){g.alogObjectName=h,g[h]=g[h]||function(){(g[h].q=g[h].q||[]).push(arguments)},g[h].l=g[h].l||+new Date,d=f.createElement(j),d.async=!0,d.src=c,b=f.<API key>(j)[0],b.parentNode.insertBefore(d,b)}(window,document,"script","http://img.baidu.com/hunter/alog/alog.min.js","alog");void function(){function c(){return;}window.PDC={mark:function(a,b){alog("speed.set",a,b||+new Date);alog.fire&&alog.fire("mark")},init:function(a){alog("speed.set","options",a)},view_start:c,tti:c,page_ready:c}}();void function(n){var o=!1;n.onerror=function(n,e,t,c){var i=!0;return!e&&/^script error/i.test(n)&&(o?i=!1:o=!0),i&&alog("exception.send","exception",{msg:n,js:e,ln:t,col:c}),!1},alog("exception.on","catch",function(n){alog("exception.send","exception",{msg:n.msg,js:n.path,ln:n.ln,method:n.method,flag:"catch"})})}(window); </script> <link rel="icon" href="/static/common/favicon.ico" type="image/x-icon"> <link rel="shorticon icon" href="/static/common/favicon.ico" type="image/x-icon"> <meta property="wb:webmaster" content="18de27f07b76316f" /> <meta name="<API key>" content="<API key>" /> <meta name="<API key>" content="OZIMDr2iVS" /> <script type="text/javascript"> window.duin = window.duin || {}; duin.userinfo = { islogin:'0', displayname: "", role: "", avatar: "" }; window.login_wrapper_url = 'http://passport.baidu.com/passApi/js/uni_login_wrapper.js?cdnversion=201411181719'; var _hmt = _hmt || []; _hmt.push(['_setAccount', '<API key>']); </script> <title>-Ouya</title> <link rel="stylesheet" type="text/css" href="/static/common/pkg/common_aa2cbaf.css"/><link rel="stylesheet" type="text/css" href="/static/discovery/pkg/<API key>.css"/></head> <body> <script> alog('speed.set', 'ht', +new Date); </script> <script>with(document)0[(<API key>('head')[0]||body).appendChild(createElement('script')).src='http://img.baidu.com/hunter/kaifangyun.js?st='+~(new Date()/864e5)];</script> <script> window.hostType = "news"; window.hostId = "3124"; </script> <div class="nav" > <div class="nav-header clearfix"> <a href="/" class="fl-l nav-logo"></a> <div class="nav-right clearfix"> <div class="nav-info"> <span class="nav-not-login"><a href="#" class="nav-login"></a></span></div> <ul class="nav-list clearfix"> <li class="nav-home-item"><a href="/" class=""></a></li> <li class="nav-store-wrapper"><div class="nav-store"></div> <ul class="nav-store-list"> <li><a href="/sports"></a></li> <li><a href="/parlor"></a></li> <li><a href="/sleep"></a></li> </ul> </li> <li class="nav-hot-item"><a class=" " href="/tryout/list"></a><span class="nav-hot"></span></li> <li><a class="" href="/discovery-news"></a></li> <li class="nav-last-li"><a class="" href="/product/ushome"></a></li> </ul> <div class="nav-search "> <form action="/search/index" id="searchForm" method="POST"> <input type="hidden" name="pn" value="1"> <input type="hidden" name="limit" value="12"> <input type="text" class="nav-search-input" autocomplete="off" name="scontent" value=""> <span class="nav-search-icon"></span> </form> </div> </div> </div> </div> <div class="d-main"> <div class="bread-path"> <a href="/"></a><span class="icon-path">&gt;</span><a href="/discovery-news"></a><span class="icon-path">&gt;</span><span>Ouya</span> </div> <div class="d-out-ad" id="friend"> <ul class="d-out-ad-wrapper"> <li><a href="http: </ul> </div> <div class="d-content clearfix"> <div class="d-content-sub"> <div class="d-hot-recommend"> <div class="d-h-r-head"> <a href="javascript:void(0);" class="d-h-normal d-h-active"></a> <span class="d-h-split"></span> <a href="javascript:void(0);" class="d-h-normal"></a></div> <div class="d-h-r-content"> <div class="d-h-r-c-wrapper" id="hotEvaluation"> </div> <div class="d-h-r-c-wrapper" id="editorRecommend"> </div> </div> </div> <div class="d-best-recommend" id='<API key>'> </div> <div class="d-guess-like"> <div class="d-g-l-header clearfix"> <a href="javascript:;" class="d-g-l-change"></a> <div class="d-g-l-title"></div> </div> <div class="d-g-l-content" id="uLike"> </div> </div> </div> <div class="d-content-main"> <div class="d-artical-title">Ouya</div> <div class="d-a-info clearfix"> <div class="d-a-operation"><a href="#comment" class="d-a-o-comment">(<span id="commentCount">0</span>)</a><a href="#dLikeHash" class="d-a-o-like">(<span id="likeCount">0</span>)</a><span class="d-share clearfix"><span class="bdsharebuttonbox"><a href="#" class="bds_more" data-cmd="more"><span class="d-down-icon"></span></a></span></span></div> <div class="d-a-from"> <span class="d-a-f-name">: http: <span class="d-public-time" id="modifyTime"></span> </div> </div> <div class="d-summary">AndroidOuya</div> <div class="d-artical-content" id="sourceContent"> <p><img style="display: block; margin-left: auto; margin-right: auto;" src="http://leiphone.qiniudn.com/uploads/new/article/600_600/201409/54066eff048b7.jpg" alt="" /></p> <p>Android<a href="http: <p><a href="http: <p>OuyaKickstarter20128800Ouya99OuyaXboxPS4OuyaAndroidOuya</p> <h3></h3> <p>OuyaXbox&nbsp;One9Ouya</p> <p>OuyaOuya40000900</p> <p>OuyaPC&ldquo;&rdquo;20142&ldquo;&rdquo;1.8</p> </div> <div class="d-fav"> <a href="javascript:;" class="d-fav-like"><span class="d-fav-icon" id="dLikeHash"></span><span class="d-fav-count">0</span></a> <span class="d-share clearfix"> <span class="bdsharebuttonbox"><a href="#" class="bds_more d-s-icon" data-cmd="more"><i></i></a></span> </span> </div> <div class="d-link clearfix"> <div class="d-prev"> <span>:</span><a href="/news/3123.html" target="_blank">2014</a> </div> <div class="d-next"> <span>:</span><a href="/news/3125.html" target="_blank">-</a> </div> </div> <div class="d-sort-comment" id="comment"><span>(</span><span id="ctCount">0</span><span>)</span></div> <form action="/news/api/addComment" method="POST " class="ct-form" name="ct-form" data-hostid="3124" data-committype="" data-hosttype="news"> <div class="clearfix"><textarea name="comment" aria-required="true" placeholder="?"></textarea></div> <div class="ct-submit"> <span class="ct-count"><span class="prefix"></span>&nbsp;<strong class="ct-limit">150</strong>&nbsp;</span><button type="submit" class="btn btn-primary"></button> </div> </form> <ul class="ct-list" id="ct-list-full"> <li class="empty hide">~~</li> </ul> <div id="ct-page"></div> <script type="text/template" id="ct-tpl"> <% $.each(list, function(idx, item) { %> <li class="clearfix"> <div class="avatar"><img src="<%- item.user_icon %>" width="60" height="60" title="<%- item.user_name %>"></div> <div class="cont"> <div class="ut"> <span class="uname text-overflow"><%- item.user_name %></span><span class="date"><%- item.create_time %></span> </div> <%if(item.parent) { %> <div class="quote"> <div class="uname">@&nbsp;<span><%- item.parent.user_name %></span></div> <div class="qct"><%- item.parent.content %></div> </div> <% } %> <div class="ct"><%- item.content %></div> <%if(!item.parent) { %> <div class="tb"><a href="#" data-pid="<%- item.reply_id %>"><i></i></a></div> <% } %> </div> </li> <% }); %> </script> </div> </div> </div> <script> window._bd_share_config={ "common":{"bdSnsKey":{}, "bdText":"", "bdMini":"1", "bdMiniList":["tsina","qzone","weixin","renren","tqq","douban","sqq"], "bdPic":"", "bdStyle":"0", "bdSize":"32", },"share":{} }; with(document)0[(<API key>('head')[0]||body).appendChild(createElement('script')).src='http://bdimg.share.baidu.com/static/api/js/share.js?v=86835285.js?cdnversion='+~(-new Date()/36e5)]; </script> <script type="text/template" id="hotRecommend"> <%if(!_.isEmpty(list)){ %> <ul class="d-h-r-c clearfix"> <% $.each(list, function(idx, item) { %> <li <%if(idx<3){ %> class="d-h-top3"<% } %>> <span class="d-h-r-c-no"><%-idx+1%></span> <a href="/news/<%-item.id%>.html" target="_blank"><%-item.title%></a> </li> <% }); %> </ul> <% } %> </script> <script type="text/template" id="guessLike"> <%if(!_.isEmpty(list)){ %> <ul> <% $.each(list, function(idx, item) { %> <li class="clearfix"> <a href="/product/view/<%-item.product_id%>.html" class="d-thumbnail" style="background-image:url(<%-item.product_cover_img%>) " target="_blank"> </a> <div class="d-g-l-c"> <a href="/product/view/<%-item.product_id%>.html" class="d-g-l-c-title" target="_blank"><%-item.product_name%></a> <a href="/product/view/<%-item.product_id%>.html#evaluation" class="d-g-l-c-write" target="_blank"></a> </div> </li> <% }); %> </ul> <% } %> </script> <script type="text/template" id="guessLikeNews"> <%if(!_.isEmpty(list)){ %> <ul> <% $.each(list, function(idx, item) { %> <li class="clearfix"> <a href="/news/<%-item.id%>.html" target="_blank" class="d-thumbnail" style="background-image:url(<%-item.thumbnails%>);" > </a> <div class="d-g-l-c"> <a href="/news/<%-item.id%>.html" target="_blank" class="d-g-l-c-title"><%-item.title%></a> <a href="/news/<%-item.id%>.html#comment" target="_blank" class="d-g-l-c-count"><%-item.comment_count%></a> </div> </li> <% }); %> </ul> <% } %> </script> <script type="text/template" id="bestRecommend"> <%if(!_.isEmpty(list)){ %> <div class="d-b-r-head clearfix"> <div class="d-b-r-operator"> <% $.each(list, function(idx, item) { %> <a href="javascript:;" class="d-b-r-o-icon <%if(idx==0){ %> active <% } %>"></a> <% }); %> </div> <div class="d-b-r-title"></div></div> <div class="d-b-r-content clearfix"> <% $.each(list, function(idx, item) { %> <div class="d-b-r-c"> <a href="/product/view/<%-item.product_id%>.html" target="_blank"><img src="<%-item.product_cover_img%>"></a> <a href="/product/view/<%-item.product_id%>.html" target="_blank" class="d-b-r-c-desc"> <%-item.product_name%> </a> </div> <% }); %> </div> <% } %> </script> <div class="footer clearfix"> <p class="fl-l">©2014 baidu<a href="http://home.baidu.com/" target="_blank"></a> <a href="/about" target="_blank"></a> <a href="http: <a href="/admin/index" target="_blank" class="hide" id="admin-entry"></a> <a href="/product/uscreateProduct?product_id=" target="_blank" class="hide" id="admin-product-edit"></a> <a href="/product/usprovision" class="hide" id="admin-provision"></a> </p> <div class="fl-r link"> <a href="http: </div> </div> <div class="backtop"></div> </body><script type="text/javascript" src="/static/common/pkg/common_56f87e5.js"></script> <script type="text/javascript" src="/static/discovery/pkg/discovery_baf8100.js"></script> <script type="text/javascript">!function(){var cookieName = 'duin_ie_tip'; if (document.cookie.indexOf(cookieName) === -1) { $('.goodbye-modal').show(); $('.goodbye-ie').show(); } $('#iknow').click(function() { $('.goodbye-modal').hide(); $('.goodbye-ie').hide(); document.cookie = cookieName + (+new Date); }); }(); !function(){ var href = location.href; $('.nav-login').click(function(e) { e.preventDefault(); duin.login(); }); $('.nav-logout').attr('href', 'http://passport.baidu.com?logout&tpl=mco_web&u=' + href); }(); !function(){require('common:widget/nav/nav.js'); duin.nav.searchFuc(); duin.nav.adjustWidth(); }(); !function(){require('common:widget/footer/footer.js'); }(); !function(){try { if (console && console.log) { console.log('%c', 'padding:12px 59px;line-height:60px;'); console.log('\n\n' + '\n' + '\n' + 'or \n\n' + '\n' + '\n' + '\n' + '/\n'); console.info && console.info(' %c spacehr@baidu.com “ console.info && console.info('http://dwz.cn/mbufe'); } } catch (e) {} }(); !function(){ window.modifyTime = duin.dateUtil.format('yyyy-MM-dd HH:mm:ss', new Date(parseInt('1409726892')*1000)).substring(0, 10); }(); !function(){ jQuery(function() { alog('speed.set', 'drt', +new Date); }); }();</script><div class="hide"> <script type="text/javascript"> var _bdhmProtocol = (("https:" == document.location.protocol) ? " https: </script> </div> <div class="hide"> <script type="text/javascript"> var _bdhmProtocol = (("https:" == document.location.protocol) ? " https: document.write(unescape("%3Cscript src='" + _bdhmProtocol + "hm.baidu.com/h.js%<API key>' type='text/javascript'%3E%3C/script%3E")); </script> </div> <div class="hide"> <script type="text/javascript"> var _bdhmProtocol = (("https:" == document.location.protocol) ? " https: document.write(unescape("%3Cscript src='" + _bdhmProtocol + "hm.baidu.com/h.js%<API key>' type='text/javascript'%3E%3C/script%3E")); </script> </div> </html><!--<API key>--> <script> var _trace_page_logid = 1189391813; </script><!--<API key>--> <script> var _trace_page_logid = 1189371937; </script>
package grapecity.fitnessexplorer.ui.base; import android.os.Bundle; import android.support.v4.app.FragmentManager; import android.support.v4.app.FragmentTransaction; import android.support.v7.app.AppCompatActivity; import com.fitnessexplorer.ui.rawdata.IRawDataController; import grapecity.fitnessexplorer.R; public class RawDataActivity extends BaseActivity implements IRawDataController { @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); FragmentManager manager = <API key>(); FragmentTransaction transaction = manager.beginTransaction(); RawDataFragment articleFragment = new RawDataFragment(); transaction.replace(R.id.fragment_container, articleFragment); transaction.commit(); } }
<!DOCTYPE HTML PUBLIC "- <!-- NewPage --> <html lang="en"> <head> <!-- Generated by javadoc --> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title><API key> (Kurento Client 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="<API key> (Kurento Client API)"; } } catch(err) { } var methods = {"i0":6,"i1":6,"i2":6,"i3":6}; var tabs = {65535:["t0","All Methods"],2:["t2","Instance Methods"],4:["t3","Abstract Methods"]}; var altColor = "altColor"; var rowColor = "rowColor"; var tableTab = "tableTab"; var activeTableTab = "activeTableTab"; </script> <noscript> <div>JavaScript is disabled on your browser.</div> </noscript> <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="../../../org/kurento/client/package-summary.html">Package</a></li> <li class="navBarCell1Rev">Class</li> <li><a href="class-use/<API key>.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"><b>Kurento Client 6.16.4</b></div> </div> <div class="subNav"> <ul class="navList"> <li><a href="../../../org/kurento/client/<API key>.html" title="class in org.kurento.client"><span class="typeNameLink">Prev&nbsp;Class</span></a></li> <li><a href="../../../org/kurento/client/KurentoObject.html" title="interface in org.kurento.client"><span class="typeNameLink">Next&nbsp;Class</span></a></li> </ul> <ul class="navList"> <li><a href="../../../index.html?org/kurento/client/<API key>.html" target="_top">Frames</a></li> <li><a href="<API key>.html" target="_top">No&nbsp;Frames</a></li> </ul> <ul class="navList" id="<API key>"> <li><a href="../../../allclasses-noframe.html">All&nbsp;Classes</a></li> </ul> <div> <script type="text/javascript"><! allClassesLink = document.getElementById("<API key>"); 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> <div class="header"> <div class="subTitle">org.kurento.client</div> <h2 title="Interface <API key>" class="title">Interface <API key></h2> </div> <div class="contentContainer"> <div class="description"> <ul class="blockList"> <li class="blockList"> <hr> <br> <pre>public interface <span class="typeNameLabel"><API key></span></pre> </li> </ul> </div> <div class="summary"> <ul class="blockList"> <li class="blockList"> <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></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/kurento/client/<API key>.html#connected--">connected</a></span>()</code> <div class="block">Method invoked when the Kurento client successfully connects to the server.</div> </td> </tr> <tr id="i1" class="rowColor"> <td class="colFirst"><code>void</code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../org/kurento/client/<API key>.html#connectionFailed--">connectionFailed</a></span>()</code> <div class="block">Method invoked when the Kurento client could not connect to the server.</div> </td> </tr> <tr id="i2" class="altColor"> <td class="colFirst"><code>void</code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../org/kurento/client/<API key>.html#disconnected--">disconnected</a></span>()</code> <div class="block">Method invoked when the Kurento client connection with the server is interrupted.</div> </td> </tr> <tr id="i3" class="rowColor"> <td class="colFirst"><code>void</code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../org/kurento/client/<API key>.html#reconnected-boolean-">reconnected</a></span>(boolean&nbsp;sameServer)</code> <div class="block">Method invoked when the Kurento client is reconnected to a server.</div> </td> </tr> </table> </li> </ul> </li> </ul> </div> <div class="details"> <ul class="blockList"> <li class="blockList"> <ul class="blockList"> <li class="blockList"><a name="method.detail"> </a> <h3>Method Detail</h3> <a name="connected </a> <ul class="blockList"> <li class="blockList"> <h4>connected</h4> <pre>void&nbsp;connected()</pre> <div class="block">Method invoked when the Kurento client successfully connects to the server.</div> </li> </ul> <a name="connectionFailed </a> <ul class="blockList"> <li class="blockList"> <h4>connectionFailed</h4> <pre>void&nbsp;connectionFailed()</pre> <div class="block">Method invoked when the Kurento client could not connect to the server. This method can be invoked also if a reconnection is needed.</div> </li> </ul> <a name="disconnected </a> <ul class="blockList"> <li class="blockList"> <h4>disconnected</h4> <pre>void&nbsp;disconnected()</pre> <div class="block">Method invoked when the Kurento client connection with the server is interrupted.</div> </li> </ul> <a name="reconnected-boolean-"> </a> <ul class="blockListLast"> <li class="blockList"> <h4>reconnected</h4> <pre>void&nbsp;reconnected(boolean&nbsp;sameServer)</pre> <div class="block">Method invoked when the Kurento client is reconnected to a server.</div> </li> </ul> </li> </ul> </li> </ul> </div> </div> <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="../../../org/kurento/client/package-summary.html">Package</a></li> <li class="navBarCell1Rev">Class</li> <li><a href="class-use/<API key>.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"><b>Kurento Client 6.16.4</b></div> </div> <div class="subNav"> <ul class="navList"> <li><a href="../../../org/kurento/client/<API key>.html" title="class in org.kurento.client"><span class="typeNameLink">Prev&nbsp;Class</span></a></li> <li><a href="../../../org/kurento/client/KurentoObject.html" title="interface in org.kurento.client"><span class="typeNameLink">Next&nbsp;Class</span></a></li> </ul> <ul class="navList"> <li><a href="../../../index.html?org/kurento/client/<API key>.html" target="_top">Frames</a></li> <li><a href="<API key>.html" target="_top">No&nbsp;Frames</a></li> </ul> <ul class="navList" id="<API key>"> <li><a href="../../../allclasses-noframe.html">All&nbsp;Classes</a></li> </ul> <div> <script type="text/javascript"><! allClassesLink = document.getElementById("<API key>"); 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> <p class="legalCopy"><small>Copyright & </body> </html>
class UNA(object): """Wrapper class for UNA (Service String Advice) components.""" <API key> = ':' <API key> = '+' decimal_mark = ',' release_character = '?' segment_terminator = '\'' @staticmethod def is_valid_una_string(input_string): """Return True if input_string is valid, False if not.""" if not input_string[:3] == 'UNA': input_string = 'UNA' + input_string if not input_string: return False if len(input_string) < 9: return False if not input_string[7] == ' ': return False return True def __init__(self, src_string=None): """Constructor.""" if src_string: self._init_from_string(src_string) def _init_from_string(self, src_string): """Initialize from string source.""" if not src_string: raise ValueError('empty source string') if len(src_string) < 9: raise ValueError('source string too short') if not src_string[7] == ' ': raise ValueError('source string has to have a space at index 4') self.<API key> = src_string[3] # pylint: disable=invalid-name self.<API key> = src_string[4] self.decimal_mark = src_string[5] self.release_character = src_string[6] self.segment_terminator = src_string[8] def get_una_string(self): """Get string representation of UNA.""" return 'UNA{0}{1}{2}{3} {4}'.format( self.<API key>, self.<API key>, self.decimal_mark, self.release_character, self.segment_terminator, )
if(number!=null){ var width = 500; var height = 450; var svg = d3.select("body").select(".d3").append("svg") .attr("width",width) .attr("height",height); var pie = d3.layout.pie(); var outerRadius = width / 4; var innerRadius = 0; var arc = d3.svg.arc() .innerRadius(innerRadius) .outerRadius(outerRadius); var color = d3.scale.category10(); var a=outerRadius*2; var arcs = svg.selectAll("g") .data(pie(pass)) .enter() .append("g") .attr("transform","translate(150,"+a+")"); arcs.append("path") .attr("fill",function(d,i){ return color(i); }) .attr("d",function(d){ return arc(d); }); arcs.append("text") .attr("transform",function(d){ return "translate(" + arc.centroid(d) + ")"; }) .attr("text-anchor","middle") .text(function(d){ return d.value; }); var z=""+pass[0]/number*100+"%"; var x=""+pass[1]/number*100+"%"; var y=a+40; svg.append("g").append("text").text(z).attr('transform', 'translate('+y+','+a+')'); a=a+20; svg.append("g").append("text").text(x).attr('transform', 'translate('+y+','+a+')'); }
package main import ( "fmt" "log" "net/http" ) // Custom HandlerFunc that returns the status code and any errors type HandlerFunc func(http.ResponseWriter, *http.Request) (int, error) // routes() holds all of the server routes func (s *server) routes(mux *http.ServeMux) { mux.HandleFunc("/", s.handlerWrapper(handleProcess)) // Handler for /api/{version}/nodeinfo mux.HandleFunc(fmt.Sprintf("/api/v%s/nodeInfo", apiVersion), s.handlerWrapper(handleProcess)) // Handler for /api/{version}/nodeinfo } // handleWrapper is a middleware function to handle common tasks such as setting response headers func (s *server) handlerWrapper(h HandlerFunc) http.HandlerFunc { // Return the hander func return func(w http.ResponseWriter, r *http.Request) { // Set the Content-Type headers w.Header().Set("Content-Type", "application/json") // Handle Request status, err := h(w, r) // Prep Error Message var errMsg string // Handle error if err != nil { w.Write([]byte("{\"message\": \"An unknown error occurred\"}")) errMsg = err.Error() } // Log Request log.Printf("%s %s %s %d %s", r.RemoteAddr, r.Method, r.URL, status, errMsg) } }
assignees: - mikedanese - luxas - errordeveloper - jbeda <style> li>.highlighter-rouge {position:relative; top:3px;} </style> ## Overview This quickstart shows you how to easily install a secure Kubernetes cluster on machines running Ubuntu 16.04, CentOS 7 or HypriotOS v1.0.1+. The installation uses a tool called `kubeadm` which is part of Kubernetes 1.4. This process works with local VMs, physical servers and/or cloud servers. It is simple enough that you can easily integrate its use into your own automation (Terraform, Chef, Puppet, etc). See the full [`kubeadm` reference](/docs/admin/kubeadm) for information on all `kubeadm` command-line flags and for advice on automating `kubeadm` itself. **The `kubeadm` tool is currently in alpha but please try it out and give us [feedback](/docs/<API key>/kubeadm/#feedback)! Be sure to read the [limitations](#limitations); in particular note that kubeadm doesn't have great support for automatically configuring cloud providers. Please refer to the specific cloud provider documentation or use another provisioning system.** kubeadm assumes you have a set of machines (virtual or real) that are up and running. It is designed to be part of a larger provisioning system - or just for easy manual provisioning. kubeadm is a great choice where you have your own infrastructure (e.g. bare metal), or where you have an existing orchestration system (e.g. Puppet) that you have to integrate with. If you are not constrained, other tools build on kubeadm to give you complete clusters: * On GCE, [Google Container Engine](https://cloud.google.com/container-engine/) gives you turn-key Kubernetes * On AWS, [kops](https://github.com/kubernetes/kops) makes installation and cluster management easy (and supports high availability) ## Prerequisites 1. One or more machines running Ubuntu 16.04, CentOS 7 or HypriotOS v1.0.1+ 1. 1GB or more of RAM per machine (any less will leave little room for your apps) 1. Full network connectivity between all machines in the cluster (public or private network is fine) ## Objectives * Install a secure Kubernetes cluster on your machines * Install a pod network on the cluster so that application components (pods) can talk to each other * Install a sample microservices application (a socks shop) on the cluster ## Instructions (1/4) Installing kubelet and kubeadm on your hosts You will install the following packages on all the machines: * `docker`: the container runtime, which Kubernetes depends on. v1.11.2 is recommended, but v1.10.3 and v1.12.1 are known to work as well. * `kubelet`: the most core component of Kubernetes. It runs on all of the machines in your cluster and does things like starting pods and containers. * `kubectl`: the command to control the cluster once it's running. You will only need this on the master, but it can be useful to have on the other nodes as well. * `kubeadm`: the command to bootstrap the cluster. NOTE: If you already have kubeadm installed, you should do a `apt-get update && apt-get upgrade` or `yum update` to get the latest version of kubeadm. See the reference doc if you want to read about the different [kubeadm releases](/docs/admin/kubeadm) For each host in turn: * SSH into the machine and become `root` if you are not already (for example, run `sudo su -`). * If the machine is running Ubuntu 16.04 or HypriotOS v1.0.1, run: # cat <<EOF > /etc/apt/sources.list.d/kubernetes.list deb http://apt.kubernetes.io/ kubernetes-xenial main EOF # apt-get update # # Install docker if you don't have it already. # apt-get install -y docker.io # apt-get install -y kubelet kubeadm kubectl kubernetes-cni If the machine is running CentOS 7, run: # cat <<EOF > /etc/yum.repos.d/kubernetes.repo [kubernetes] name=Kubernetes baseurl=http://yum.kubernetes.io/repos/<API key> enabled=1 gpgcheck=1 repo_gpgcheck=1 gpgkey=https://packages.cloud.google.com/yum/doc/yum-key.gpg https://packages.cloud.google.com/yum/doc/rpm-package-key.gpg EOF # setenforce 0 # yum install -y docker kubelet kubeadm kubectl kubernetes-cni # systemctl enable docker && systemctl start docker # systemctl enable kubelet && systemctl start kubelet The kubelet is now restarting every few seconds, as it waits in a crashloop for `kubeadm` to tell it what to do. Note: To disable SELinux by running `setenforce 0` is required in order to allow containers to access the host filesystem, which is required by pod networks for example. You have to do this until kubelet can handle SELinux better. (2/4) Initializing your master The master is the machine where the "control plane" components run, including `etcd` (the cluster database) and the API server (which the `kubectl` CLI communicates with). All of these components run in pods started by `kubelet`. Right now you can't run `kubeadm init` twice without tearing down the cluster in between, see [Tear down](#tear-down). If you try to run `kubeadm init` and your machine is in a state that is incompatible with starting a Kubernetes cluster, `kubeadm` will warn you about things that might not work or it will error out for unsatisfied mandatory requirements. To initialize the master, pick one of the machines you previously installed `kubelet` and `kubeadm` on, and run: # kubeadm init **Note:** this will autodetect the network interface to advertise the master on as the interface with the default gateway. If you want to use a different interface, specify `--<API key>=<ip-address>` argument to `kubeadm init`. If you want to use [flannel](https://github.com/coreos/flannel) as the pod network; specify `--pod-network-cidr=10.244.0.0/16` if you're using the daemonset manifest below. _However, please note that this is not required for any other networks, including Weave, which is the recommended pod network._ Please refer to the [kubeadm reference doc](/docs/admin/kubeadm/) if you want to read more about the flags `kubeadm init` provides. This will download and install the cluster database and "control plane" components. This may take several minutes. The output should look like: <master/tokens> generated token: "f0c861.753c505740ecde4c" <master/pki> created keys and certificates in "/etc/kubernetes/pki" <util/kubeconfig> created "/etc/kubernetes/kubelet.conf" <util/kubeconfig> created "/etc/kubernetes/admin.conf" <master/apiclient> created API client configuration <master/apiclient> created API client, waiting for the control plane to become ready <master/apiclient> all control plane components are healthy after 61.346626 seconds <master/apiclient> waiting for at least one node to register and become ready <master/apiclient> first node is ready after 4.506807 seconds <master/discovery> created essential addon: kube-discovery <master/addons> created essential addon: kube-proxy <master/addons> created essential addon: kube-dns Kubernetes master initialised successfully! You can connect any number of nodes by running: kubeadm join --token <token> <master-ip> Make a record of the `kubeadm join` command that `kubeadm init` outputs. You will need this in a moment. The key included here is secret, keep it safe &mdash; anyone with this key can add authenticated nodes to your cluster. The key is used for mutual authentication between the master and the joining nodes. By default, your cluster will not schedule pods on the master for security reasons. If you want to be able to schedule pods on the master, for example if you want a single-machine Kubernetes cluster for development, run: # kubectl taint nodes --all dedicated- node "test-01" tainted taint key="dedicated" and effect="" not found. taint key="dedicated" and effect="" not found. This will remove the "dedicated" taint from any nodes that have it, including the master node, meaning that the scheduler will then be able to schedule pods everywhere. (3/4) Installing a pod network You must install a pod network add-on so that your pods can communicate with each other. **It is necessary to do this before you try to deploy any applications to your cluster, and before `kube-dns` will start up. Note also that `kubeadm` only supports CNI based networks and therefore kubenet based networks will not work.** Several projects provide Kubernetes pod networks using CNI, some of which also support [Network Policy](/docs/user-guide/networkpolicies/). See the [add-ons page](/docs/admin/addons/) for a complete list of available network add-ons. You can install a pod network add-on with the following command: # kubectl apply -f <add-on.yaml> Please refer to the specific add-on installation guide for exact details. You should only install one pod network per cluster. If you are on another architecture than amd64, you should use the flannel overlay network as described in [the multi-platform section](#<API key>) NOTE: You can install **only one** pod network per cluster. Once a pod network has been installed, you can confirm that it is working by checking that the `kube-dns` pod is `Running` in the output of `kubectl get pods --all-namespaces`. And once the `kube-dns` pod is up and running, you can continue by joining your nodes. (4/4) Joining your nodes The nodes are where your workloads (containers and pods, etc) run. If you want to add any new machines as nodes to your cluster, for each machine: SSH to that machine, become root (e.g. `sudo su -`) and run the command that was output by `kubeadm init`. For example: # kubeadm join --token <token> <master-ip> <util/tokens> validating provided token <node/discovery> created cluster info discovery client, requesting info from "http://138.68.156.129:9898/cluster-info/v1/?token-id=0f8588" <node/discovery> cluster info object received, verifying signature using given token <node/discovery> cluster info signature and contents are valid, will use API endpoints [https://138.68.156.129:443] <node/csr> created API client to obtain unique certificate for this node, generating keys and certificate signing request <node/csr> received signed certificate from the API server, generating kubelet configuration <util/kubeconfig> created "/etc/kubernetes/kubelet.conf" Node join complete: * Certificate signing request sent to master and response received. * Kubelet informed of new secure connection details. Run 'kubectl get nodes' on the master to see this machine join. A few seconds later, you should notice that running `kubectl get nodes` on the master shows a cluster with as many machines as you created. Note that there currently isn't a out-of-the-box way of connecting to the Master's API Server via `kubectl` from a node. Read issue [ (Optional) Controlling your cluster from machines other than the master In order to get a kubectl on your laptop for example to talk to your cluster, you need to copy the `KubeConfig` file from your master to your laptop like this: # scp root@<master ip>:/etc/kubernetes/admin.conf . # kubectl --kubeconfig ./admin.conf get nodes (Optional) Connecting to the API Server If you want to connect to the API Server for viewing the dashboard (note: not deployed by default) from outside the cluster for example, you can use `kubectl proxy`: # scp root@<master ip>:/etc/kubernetes/admin.conf . # kubectl --kubeconfig ./admin.conf proxy You can now access the API Server locally at `http://localhost:8001/api/v1` (Optional) Installing a sample application As an example, install a sample microservices application, a socks shop, to put your cluster through its paces. Note that this demo does only work on `amd64`. To learn more about the sample microservices app, see the [GitHub README](https://github.com/microservices-demo/microservices-demo). # kubectl create namespace sock-shop You can then find out the port that the [NodePort feature of services](/docs/user-guide/services/) allocated for the front-end service by running: # kubectl describe svc front-end -n sock-shop Name: front-end Namespace: sock-shop Labels: name=front-end Selector: name=front-end Type: NodePort IP: 100.66.88.176 Port: <unset> 80/TCP NodePort: <unset> 31869/TCP Endpoints: <none> Session Affinity: None It takes several minutes to download and start all the containers, watch the output of `kubectl get pods -n sock-shop` to see when they're all up and running. Then go to the IP address of your cluster's master node in your browser, and specify the given port. So for example, `http://<master_ip>:<port>`. In the example above, this was `31869`, but it is a different port for you. If there is a firewall, make sure it exposes this port to the internet before you try to access it. ## Tear down * To uninstall the socks shop, run `kubectl delete namespace sock-shop` on the master. * To undo what `kubeadm` did, simply run: # kubeadm reset If you wish to start over, run `systemctl start kubelet` followed by `kubeadm init` or `kubeadm join`. ## Explore other add-ons See the [list of add-ons](/docs/admin/addons/) to explore other add-ons, including tools for logging, monitoring, network policy, visualization &amp; control of your Kubernetes cluster. ## What's next * Learn about `kubeadm`'s advanced usage on the [advanced reference doc](/docs/admin/kubeadm/) * Learn more about [Kubernetes concepts and kubectl in Kubernetes 101](/docs/user-guide/walkthrough/). ## Feedback * Slack Channel: [ * Mailing List: [<API key>](https://groups.google.com/forum/#!forum/<API key>) * [GitHub Issues](https://github.com/kubernetes/kubernetes/issues): please tag `kubeadm` issues with `@kubernetes/<API key>` ## kubeadm is multi-platform kubeadm deb packages and binaries are built for amd64, arm and arm64, following the [multi-platform proposal](https://github.com/kubernetes/kubernetes/blob/master/docs/proposals/multi-platform.md). deb-packages are released for ARM and ARM 64-bit, but not RPMs (yet, reach out if there's interest). ARM had some issues when making v1.4, see [ However, thanks to the PRs above, `kube-apiserver` works on ARM from the `v1.4.1` release, so make sure you're at least using `v1.4.1` when running on ARM 32-bit The multiarch flannel daemonset can be installed this way. # export ARCH=amd64 Replace `ARCH=amd64` with `ARCH=arm` or `ARCH=arm64` depending on the platform you're running on. Note that the Raspberry Pi 3 is in ARM 32-bit mode, so for RPi 3 you should set `ARCH` to `arm`, not `arm64`. ## Limitations Please note: `kubeadm` is a work in progress and these limitations will be addressed in due course. Also you can take a look at the troubleshooting section in the [reference document](/docs/admin/kubeadm/#troubleshooting) 1. The cluster created here doesn't have cloud-provider integrations by default, so for example it doesn't work automatically with (for example) [Load Balancers](/docs/user-guide/load-balancer/) (LBs) or [Persistent Volumes](/docs/user-guide/persistent-volumes/walkthrough/) (PVs). To set up kubeadm with CloudProvider integrations (it's experimental, but try), refer to the [kubeadm reference](/docs/admin/kubeadm/) document. Workaround: use the [NodePort feature of services](/docs/user-guide/services/#type-nodeport) for exposing applications to the internet. 1. The cluster created here has a single master, with a single `etcd` database running on it. This means that if the master fails, your cluster loses its configuration data and will need to be recreated from scratch. Adding HA support (multiple `etcd` servers, multiple API servers, etc) to `kubeadm` is still a work-in-progress. Workaround: regularly [back up etcd](https://coreos.com/etcd/docs/latest/admin_guide.html). The `etcd` data directory configured by `kubeadm` is at `/var/lib/etcd` on the master. 1. `kubectl logs` is broken with `kubeadm` clusters due to [ Workaround: use `docker logs` on the nodes where the containers are running as a workaround. 1. The HostPort functionality does not work with kubeadm due to that CNI networking is used, see issue [ Workaround: use the [NodePort feature of services](/docs/user-guide/services/#type-nodeport) instead, or use HostNetwork. 1. A running `firewalld` service may conflict with kubeadm, so if you want to run `kubeadm`, you should disable `firewalld` until issue [ Workaround: Disable `firewalld` or configure it to allow Kubernetes the pod and service cidrs. 1. If you see errors like `etcd cluster unavailable or misconfigured`, it's because of high load on the machine which makes the `etcd` container a bit unresponsive (it might miss some requests) and therefore kubelet will restart it. This will get better with `etcd3`. Workaround: Set `failureThreshold` in `/etc/kubernetes/manifests/etcd.json` to a larger value. 1. If you are using VirtualBox (directly or via Vagrant), you will need to ensure that `hostname -i` returns a routable IP address (i.e. one on the second network interface, not the first one). By default, it doesn't do this and kubelet ends-up using first non-loopback network interface, which is usually NATed. Workaround: Modify `/etc/hosts`, take a look at this [`Vagrantfile`][ubuntu-vagrantfile] for how you this can be achieved. [ubuntu-vagrantfile]: https://github.com/errordeveloper/k8s-playground/blob/<SHA1-like>/Vagrantfile#L11),
package networkmonitor.bolts.<API key>.tools; import backtype.storm.Config; import backtype.storm.task.OutputCollector; import backtype.storm.task.TopologyContext; import backtype.storm.topology.<API key>; import backtype.storm.topology.base.BaseRichBolt; import backtype.storm.tuple.Fields; import backtype.storm.tuple.Tuple; import backtype.storm.tuple.Values; import org.apache.log4j.Logger; import util.json.JSONObject; import util.storm.TupleHelpers; import java.io.File; import java.io.<API key>; import java.io.PrintWriter; import java.util.Comparator; import java.util.HashMap; import java.util.Map; import java.util.Map.Entry; import java.util.TreeMap; /** * This bolt performs rolling counts of incoming objects, i.e. sliding window based counting. * * The bolt is configured by two parameters, the length of the sliding window in seconds (which influences the output * data of the bolt, i.e. how it will count objects) and the emit frequency in seconds (which influences how often the * bolt will output the latest window counts). For instance, if the window length is set to an equivalent of five * minutes and the emit frequency to one minute, then the bolt will output the latest five-minute sliding window every * minute. * * The bolt emits a rolling count tuple per object, consisting of the object itself, its latest rolling count, and the * actual duration of the sliding window. The latter is included in case the expected sliding window length (as * configured by the user) is different from the actual length, e.g. due to high system load. Note that the actual * window length is tracked and calculated for the window, and not individually for each object within a window. * * Note: During the startup phase you will usually observe that the bolt warns you about the actual sliding window * length being smaller than the expected length. This behavior is expected and is caused by the way the sliding window * counts are initially "loaded up". You can safely ignore this warning during startup (e.g. you will see this warning * during the first ~ five minutes of startup time if the window length is set to five minutes). * */ public abstract class <API key> extends BaseRichBolt { private static final long serialVersionUID = <API key>; private static final Logger LOG = Logger.getLogger(<API key>.class); private static final int NUM_WINDOW_CHUNKS = 5; private static final int <API key> = NUM_WINDOW_CHUNKS * 20; private static final int <API key> = 5; protected static final String <API key> = "Actual window length is %d seconds when it should be %d seconds" + " (you can safely ignore this warning during the startup phase)"; protected final <API key><Object> counter; protected final int <API key>; protected final int <API key>; protected OutputCollector collector; protected <API key> lastModifiedTracker; protected abstract void countObj(JSONObject jsonObj); protected String topic; public <API key>(String topic) { this(topic,<API key>, <API key>); } public <API key>(String topic, int <API key>, int <API key>) { this.topic = topic; this.<API key> = <API key>; this.<API key> = <API key>; counter = new <API key><Object>(<API key>(this.<API key>, this.<API key>)); } private int <API key>(int <API key>, int <API key>) { return Math.round(<API key> / <API key>); } @SuppressWarnings("rawtypes") public void prepare(Map stormConf, TopologyContext context, OutputCollector collector) { this.collector = collector; lastModifiedTracker = new <API key>(<API key>(this.<API key>, this.<API key>)); } public void execute(Tuple tuple) { if (TupleHelpers.isTickTuple(tuple)) { LOG.info("Received tick tuple, triggering emit of current window counts"); <API key>(); } else { countObj((JSONObject) tuple.getValue(0)); collector.ack(tuple); } } protected void <API key>() { Map<Object, Double> counts = counter.<API key>(); int <API key> = lastModifiedTracker.<API key>(); lastModifiedTracker.markAsModified(); if (<API key> != <API key>) { LOG.warn(String.format(<API key>, <API key>, <API key>)); } emit(counts); } protected void emit(Map<Object, Double> counts) { for (Entry<Object, Double> entry : counts.entrySet()) { Object hostname = entry.getKey(); Double count = entry.getValue(); collector.emit(new Values(hostname, count)); } writeOutputToFile(); } public void declareOutputFields(<API key> declarer) { declarer.declare(new Fields("hostname", "count")); } @Override public Map<String, Object> <API key>() { Map<String, Object> conf = new HashMap<String, Object>(); conf.put(Config.<API key>, <API key>); return conf; } protected Logger getLogger() { return LOG; } private void writeOutputToFile(){ PrintWriter writer = null; try { File file = new File("./analytics/Usage/" + topic +".txt"); file.getParentFile().mkdirs(); writer = new PrintWriter(file); //Sort the map before writing to a file ValueComparator bvc = new ValueComparator(counter.getCounts()); TreeMap<Object,Double> sorted_map = new TreeMap<Object,Double>(bvc); sorted_map.putAll(counter.getCounts()); writer.println(sorted_map + "\n"); } catch (<API key> e) { e.printStackTrace(); } finally { if ( writer != null ) { writer.close(); } } } //Class used to sort the MAP. class ValueComparator implements Comparator<Object> { Map<Object, Double> base; public ValueComparator(Map<Object, Double> map) { this.base = map; } // Note: this comparator imposes orderings that are inconsistent with equals. public int compare(Object a, Object b) { if (base.get(a) >= base.get(b)) { return -1; } else { return 1; } // returning 0 would merge keys } } }
use graph::*; use errors::*; use ops::interface::default::*; use super::super::ids; use std::convert::AsRef; use std::ops::DerefMut; //use std::borrow::Borrow; pub fn mat_mul<T1: AsRef<Expr>, T2: AsRef<Expr>>(arg0: T1, arg1: T2) -> Result<Expr> { let arg0 = arg0.as_ref(); let arg1 = arg1.as_ref(); same_graph_2(arg0, arg1)?; let ref wrapper = arg0.wrapper; let result = { let mut g = wrapper.get_mut(); ids::mat_mul(g.deref_mut(), arg0.id, arg1.id)? }; wrapper.as_expr(result) }
package be.seriousbusiness.xml_modifier.document; import org.w3c.dom.Attr; import org.w3c.dom.Document; import be.seriousbusiness.xml_modifier.node.NodeUtils; public class DocumentUtils { /** * Replace the value of all attributes with a given name. * @param document * @param name * @param value * @param newValue */ public static final void <API key>(final Document document,final String name,final String value,final String newValue){ NodeUtils.<API key>(document.getFirstChild(),name,value,newValue); } /** * Remove all nodes by name. * @param document * @param name */ public static final void removeNodes(final Document document,final String name){ NodeUtils.<API key>(document.getFirstChild(),name); } /** * Remove all attributes by name. * @param document * @param name */ public static final void removeAttributes(final Document document,final String name){ NodeUtils.<API key>(document.getFirstChild(),name); } /** * Add a new attribute to all nodes with given name. * @param document * @param name * @param attribute */ public static final void addAttributeToNodes(final Document document,final String name,final Attr attribute){ NodeUtils.<API key>(document.getFirstChild(),name,attribute); } }
// Peloton // skip_list_index.cpp // Identification: src/index/skip_list_index.cpp #include "index/skip_list_index.h" #include "index/index_key.h" #include "index/index_util.h" #include "common/logger.h" #include "storage/tuple.h" namespace peloton { namespace index { template <typename KeyType, typename ValueType, class KeyComparator, class KeyEqualityChecker> SkipListIndex<KeyType, ValueType, KeyComparator, KeyEqualityChecker>::SkipListIndex( IndexMetadata *metadata) : Index(metadata), container(), equals(), comparator(){} template <typename KeyType, typename ValueType, class KeyComparator, class KeyEqualityChecker> SkipListIndex<KeyType, ValueType, KeyComparator, KeyEqualityChecker>::~SkipListIndex() { // Nothing to do here ! } template <typename KeyType, typename ValueType, class KeyComparator, class KeyEqualityChecker> bool SkipListIndex<KeyType, ValueType, KeyComparator, KeyEqualityChecker>::InsertEntry(const storage::Tuple *key, const ItemPointer &location) { KeyType index_key; index_key.SetFromKey(key); // Insert the key, val pair auto status = container.Insert(index_key, location); return status; } template <typename KeyType, typename ValueType, class KeyComparator, class KeyEqualityChecker> bool SkipListIndex<KeyType, ValueType, KeyComparator, KeyEqualityChecker>::DeleteEntry(const storage::Tuple *, const ItemPointer&) { // Dummy erase return true; } template <typename KeyType, typename ValueType, class KeyComparator, class KeyEqualityChecker> bool SkipListIndex<KeyType, ValueType, KeyComparator, KeyEqualityChecker>:: CondInsertEntry(const storage::Tuple *key, const ItemPointer &location, std::function<bool(const ItemPointer &)>) { KeyType index_key; index_key.SetFromKey(key); // Insert the key if it does not exist const bool bInsert = false; auto status = container.Update(index_key, location, bInsert); return status; } template <typename KeyType, typename ValueType, class KeyComparator, class KeyEqualityChecker> void SkipListIndex<KeyType, ValueType, KeyComparator, KeyEqualityChecker>::Scan( const std::vector<Value> &values, const std::vector<oid_t> &key_column_ids, const std::vector<ExpressionType> &expr_types, const ScanDirectionType &scan_direction, std::vector<ItemPointer> &result) { // Check if we have leading (leftmost) column equality // oid_t leading_column_id = 0; // auto key_column_ids_itr = std::find(key_column_ids.begin(), // key_column_ids.end(), // leading_column_id); // PARTIAL SCAN CASE : leading column id is one of the key column ids // and is involved in a equality constraint // Currently special case only includes <API key> // There are two more types, one is aligned, another is not aligned. // Aligned example: A > 0, B >= 15, c > 4 // Not Aligned example: A >= 15, B < 30 // Check if suitable for point query bool point_query = true; for (auto key_column_ids_itr = key_column_ids.begin(); key_column_ids_itr != key_column_ids.end(); key_column_ids_itr++) { auto offset = std::distance(key_column_ids.begin(), key_column_ids_itr); if (expr_types[offset] != <API key>){ point_query = false; } } // Check if suitable for partial scan bool <API key> = true; if(point_query == false) { for (auto key_column_ids_itr = key_column_ids.begin(); key_column_ids_itr != key_column_ids.end(); key_column_ids_itr++) { auto offset = std::distance(key_column_ids.begin(), key_column_ids_itr); if (expr_types[offset] == <API key> || expr_types[offset] == <API key> || expr_types[offset] == <API key> || expr_types[offset] == <API key>) { <API key> = false; } } } LOG_TRACE("Point query : %d ", point_query); LOG_TRACE("Partial scan : %d ", <API key>); // POINT QUERY if (point_query == true) { std::unique_ptr<storage::Tuple> find_key; find_key.reset(new storage::Tuple(metadata->GetKeySchema(), true)); LOG_TRACE("%s", "Constructing key"); for (auto key_column_ids_itr = key_column_ids.begin(); key_column_ids_itr != key_column_ids.end(); key_column_ids_itr++) { auto column_offset = std::distance(key_column_ids.begin(), key_column_ids_itr); find_key->SetValue(column_offset, values[column_offset], GetPool()); } LOG_TRACE("Find key : %s", find_key->GetInfo().c_str()); KeyType find_index_key; find_index_key.SetFromKey(find_key.get()); // Check if key exists in index auto find_itr = container.Contains(find_index_key); if(find_itr != container.end()){ ItemPointer location_header = find_itr->second; result.push_back(location_header); } } // PARTIAL SCAN else if (<API key> == true) { PL_ASSERT(key_column_ids.size() > 0); LOG_TRACE("key_column_ids size : %lu ", key_column_ids.size()); oid_t <API key> = 0; oid_t leading_column_id = key_column_ids[<API key>]; LOG_TRACE("Leading column id : %u", leading_column_id); std::vector<std::pair<Value, Value>> intervals; ConstructIntervals(leading_column_id, values, key_column_ids, expr_types, intervals); // For non-leading columns, find the max and min std::map<oid_t, std::pair<Value, Value>> non_leading_columns; FindMaxMinInColumns(leading_column_id, values, key_column_ids, expr_types, non_leading_columns); oid_t <API key> = 0; for (auto key_column_id : key_column_ids) { if (key_column_id == leading_column_id) { LOG_TRACE("Leading column : %u", key_column_id); continue; } if (non_leading_columns.find(key_column_id) == non_leading_columns.end()) { auto key_schema = metadata->GetKeySchema(); auto type = key_schema->GetColumn(<API key>).column_type; std::pair<Value, Value> range(Value::GetMinValue(type), Value::GetMaxValue(type)); std::pair<oid_t, std::pair<Value, Value>> key_value(<API key>, range); non_leading_columns.insert(key_value); } <API key>++; } LOG_TRACE("Non leading columns size : %lu", non_leading_columns.size()); PL_ASSERT(intervals.empty() != true); // Search each interval of leading_column. for (const auto &interval : intervals) { auto scan_begin_itr = container.begin(); auto scan_end_itr = container.end(); std::unique_ptr<storage::Tuple> start_key; std::unique_ptr<storage::Tuple> end_key; start_key.reset(new storage::Tuple(metadata->GetKeySchema(), true)); end_key.reset(new storage::Tuple(metadata->GetKeySchema(), true)); LOG_TRACE("%s", "Constructing start/end keys"); LOG_TRACE("Leading Column: column id : %u left bound %s\t\t right bound %s", leading_column_id, interval.first.GetInfo().c_str(), interval.second.GetInfo().c_str()); start_key->SetValue(<API key>, interval.first, GetPool()); end_key->SetValue(<API key>, interval.second, GetPool()); for (const auto &k_v : non_leading_columns) { start_key->SetValue(k_v.first, k_v.second.first, GetPool()); end_key->SetValue(k_v.first, k_v.second.second, GetPool()); LOG_TRACE("Non Leading Column: column id : %u left bound %s\t\t right bound %s", k_v.first, k_v.second.first.GetInfo().c_str(), k_v.second.second.GetInfo().c_str()); } KeyType start_index_key; KeyType end_index_key; start_index_key.SetFromKey(start_key.get()); end_index_key.SetFromKey(end_key.get()); LOG_TRACE("Start key : %s", start_key->GetInfo().c_str()); LOG_TRACE("End key : %s", end_key->GetInfo().c_str()); scan_begin_itr = container.Contains(start_index_key); scan_end_itr = container.Contains(end_index_key); if(scan_begin_itr == container.end()){ LOG_TRACE("Did not find start key -- so setting to lower bound"); scan_begin_itr = container.begin(); } else { LOG_TRACE("Found start key"); } if(scan_end_itr == container.end()){ LOG_TRACE("Did not find end key"); } else { LOG_TRACE("Found end key"); } switch (scan_direction) { case <API key>: case <API key>: { // Scan the index entries in forward direction for (auto scan_itr = scan_begin_itr; scan_itr != scan_end_itr; ++scan_itr) { auto scan_current_key = scan_itr->first; auto tuple = scan_current_key.<API key>( metadata->GetKeySchema()); // Compare the current key in the scan with "values" based on // "expression types" // For instance, "5" EXPR_GREATER_THAN "2" is true if (Compare(tuple, key_column_ids, expr_types, values) == true) { ItemPointer location_header = scan_itr->second; result.push_back(location_header); } } } break; case <API key>: default: throw Exception("Invalid scan direction "); break; } } } // FULL SCAN else { auto scan_begin_itr = container.begin(); auto scan_end_itr = container.end(); switch (scan_direction) { case <API key>: case <API key>: { // Scan the index entries in forward direction for (auto scan_itr = scan_begin_itr; scan_itr != scan_end_itr; ++scan_itr) { auto scan_current_key = scan_itr->first; auto tuple = scan_current_key.<API key>( metadata->GetKeySchema()); // Compare the current key in the scan with "values" based on // "expression types" // For instance, "5" EXPR_GREATER_THAN "2" is true if (Compare(tuple, key_column_ids, expr_types, values) == true) { ItemPointer location_header = scan_itr->second; result.push_back(location_header); } } } break; case <API key>: default: throw Exception("Invalid scan direction "); break; } } LOG_TRACE("Scan matched tuple count : %lu", result.size()); } template <typename KeyType, typename ValueType, class KeyComparator, class KeyEqualityChecker> void SkipListIndex<KeyType, ValueType, KeyComparator, KeyEqualityChecker>::ScanAllKeys(std::vector<ItemPointer> & result) { // scan all entries auto iterator = container.begin(); for (; iterator != container.end(); ++iterator) { ItemPointer location = iterator->second; result.push_back(location); } } /** * @brief Return all locations related to this key. */ template <typename KeyType, typename ValueType, class KeyComparator, class KeyEqualityChecker> void SkipListIndex<KeyType, ValueType, KeyComparator, KeyEqualityChecker>::ScanKey( const storage::Tuple *key, std::vector<ItemPointer> &result) { KeyType index_key; index_key.SetFromKey(key); // find the <key, location> pair auto iterator = container.Contains(index_key); if(iterator != container.end()) { result.push_back(iterator->second); } } template <typename KeyType, typename ValueType, class KeyComparator, class KeyEqualityChecker> std::string SkipListIndex<KeyType, ValueType, KeyComparator, KeyEqualityChecker>::GetTypeName() const { return "Btree"; } // Explicit template instantiation // Ints key template class SkipListIndex<IntsKey<1>, ItemPointer, IntsComparatorRaw<1>, IntsEqualityChecker<1>>; template class SkipListIndex<IntsKey<2>, ItemPointer, IntsComparatorRaw<2>, IntsEqualityChecker<2>>; template class SkipListIndex<IntsKey<3>, ItemPointer, IntsComparatorRaw<3>, IntsEqualityChecker<3>>; template class SkipListIndex<IntsKey<4>, ItemPointer, IntsComparatorRaw<4>, IntsEqualityChecker<4>>; // Generic key template class SkipListIndex<GenericKey<4>, ItemPointer, <API key><4>, <API key><4>>; template class SkipListIndex<GenericKey<8>, ItemPointer, <API key><8>, <API key><8>>; template class SkipListIndex<GenericKey<16>, ItemPointer, <API key><16>, <API key><16>>; template class SkipListIndex<GenericKey<64>, ItemPointer, <API key><64>, <API key><64>>; template class SkipListIndex<GenericKey<256>, ItemPointer, <API key><256>, <API key><256>>; // Tuple key template class SkipListIndex<TupleKey, ItemPointer, <API key>, <API key>>; } // End index namespace } // End peloton namespace
var seq_8c = [ [ "seq", "structseq.html", "structseq" ], [ "seq_waiter", "structseq__waiter.html", "structseq__waiter" ], [ "seq_thread", "structseq__thread.html", "structseq__thread" ], [ "OVS_GUARDED_BY", "seq_8c.html#<API key>", null ], [ "seq_change", "seq_8c.html#<API key>", null ], [ "seq_destroy", "seq_8c.html#<API key>", null ], [ "seq_init", "seq_8c.html#<API key>", null ], [ "seq_read", "seq_8c.html#<API key>", null ], [ "seq_thread_exit", "seq_8c.html#<API key>", null ], [ "seq_thread_get", "seq_8c.html#<API key>", null ], [ "seq_thread_get", "seq_8c.html#<API key>", null ], [ "seq_thread_woke", "seq_8c.html#<API key>", null ], [ "seq_wait__", "seq_8c.html#<API key>", null ], [ "seq_wait_at", "seq_8c.html#<API key>", null ], [ "seq_waiter_destroy", "seq_8c.html#<API key>", null ], [ "seq_wake_waiters", "seq_8c.html#<API key>", null ], [ "seq_woke", "seq_8c.html#<API key>", null ], [ "seq_mutex", "seq_8c.html#<API key>", null ], [ "seq_thread_key", "seq_8c.html#<API key>", null ] ];
require 'minitest/spec' describe_recipe 'my_cookbook::default' do describe "greeting file" do it "creates the greeting file" do file("/tmp/greeting.txt").must_exist end it "contains what's stored in the 'greeting' node attribute" do file('/tmp/greeting.txt').must_include 'Ohai, Minitest!' end end end
package org.robbins.flashcards.client.activity; import java.util.ArrayList; import java.util.List; import org.robbins.flashcards.client.factory.ClientFactory; import org.robbins.flashcards.client.ui.AppConstants; import org.robbins.flashcards.client.ui.RequiresLogin; import org.robbins.flashcards.model.UserDto; import com.google.gwt.activity.shared.AbstractActivity; import com.google.gwt.core.client.GWT; import com.google.gwt.place.shared.PlaceController; import com.google.gwt.user.client.Cookies; import com.google.gwt.user.client.Window; import com.google.web.bindery.event.shared.HandlerRegistration; public abstract class AppAbstractActivity extends AbstractActivity { private final AppConstants constants; private final PlaceController placeController; private final UserDto loggedInUser; private final List<HandlerRegistration> registrations = new ArrayList<HandlerRegistration>(); public AppAbstractActivity(final ClientFactory clientFactory) { this.constants = clientFactory.getConstants(); this.placeController = clientFactory.getPlaceController(); this.loggedInUser = clientFactory.getLoggedInUser(); } public List<HandlerRegistration> getRegistrations() { return registrations; } public AppConstants getConstants() { return constants; } public PlaceController getPlaceController() { return placeController; } public UserDto getLoggedInUser() { return loggedInUser; } public void requireLogin(final RequiresLogin display) { if (getLoggedInUser() == null) { GWT.log("User is NOT logged in. Redicting to Login page"); Cookies.setCookie("desitinationURL", Window.Location.getHref()); display.enableForm(false); } else { display.enableForm(true); } } @Override public void onStop() { for (HandlerRegistration registration : registrations) { registration.removeHandler(); } getRegistrations().clear(); super.onStop(); } }
class List<T> { public Blah() { this.Foo(); // no error List.Foo(); } public static Foo() { } }
// <auto-generated /> namespace AkureTraining.Core.Migrations { using System.CodeDom.Compiler; using System.Data.Entity.Migrations; using System.Data.Entity.Migrations.Infrastructure; using System.Resources; [GeneratedCode("EntityFramework.Migrations", "6.1.0-30225")] public sealed partial class <API key> : IMigrationMetadata { private readonly ResourceManager Resources = new ResourceManager(typeof(<API key>)); string IMigrationMetadata.Id { get { return "<API key>"; } } string IMigrationMetadata.Source { get { return null; } } string IMigrationMetadata.Target { get { return Resources.GetString("Target"); } } } }
/*! ** @file DataUart.c ** @version 01.00 */ /*! ** @addtogroup DataUart_module DataUart module documentation ** @{ */ /* MODULE DataUart. */ #include "DataUart.h" /*! DataUart configuration structure */ const <API key> <API key> = { .clockSource = <API key>, .baudRate = 921600, .parityMode = <API key>, .stopBitCount = kLpuartOneStopBit, .bitCountPerChar = kLpuart8BitsPerChar, }; /*! Driver state structure without DMA */ lpuart_dma_state_t DataUart_State; /* END DataUart. */
<?php defined('<API key>') or die('Direct Access to this location is not allowed.'); $option = $processPage->getVar('option'); $categoryId = $processPage->getVar('categoryId'); $category = $processPage->getVar('category'); $task = $processPage->getVar('task'); jimport( 'joomla.html.editor' ); $editor = &JFactory::getEditor(); $doc = JFactory::getDocument(); $doc->addScript(JURI::root(true) . '/administrator/components/' . $option . '/js/yui/yahoo-dom-event.js'); $doc->addScript(JURI::root(true) . '/administrator/components/' . $option . '/js/validators.js'); $doc->addScript(JURI::root(true) . '/administrator/components/' . $option . '/js/ari.dom.js'); ?> <form action="index.php" method="post" name="adminForm" id="adminForm"> <table class="adminform" style="width: 100%;"> <tbody> <tr> <th colspan="2"><?php AriQuizWebHelper::displayResValue('Label.MainSettings'); ?></th> </tr> </tbody> <tbody id="tbCategorySettings"> <tr> <td align="left"><?php AriQuizWebHelper::displayResValue('Label.Name'); ?> :</td> <td align="left"><input type="text" class="text_area" id="tbxCategoryName" name="zCategory[CategoryName]" size="70" maxlength="200" value="<?php AriQuizWebHelper::displayDbValue($category->CategoryName); ?>"></td> </tr> <tr valign="top"> <td align="left"><?php AriQuizWebHelper::displayResValue('Label.Description'); ?> :</td> <td align="left"> <?php echo $editor->display('zCategory[Description]', $category->Description, '100%;', '250', '60', '20' ) ; ?> </td> </tr> </tbody> </table> <script type="text/javascript"> aris.validators.validatorManager.addValidator( new aris.validators.requiredValidator('tbxCategoryName', {errorMessage : '<?php AriQuizWebHelper::displayResValue('Validator.NameRequired'); ?>'})); aris.validators.validatorManager.addValidator( new aris.validators.customValidator('tbxCategoryName', function(val) { var isValid = true; if (typeof(Ajax) != "undefined") new Ajax('index.php?option=<?php echo $option; ?>&task=ajax.checkCategoryName&categoryId=<?php echo $category->CategoryId; ?>&name=' + encodeURIComponent(val.getValue()), { async : false, onSuccess: function(response) { isValid = (response == 'true'); } }).request(); return isValid; }, {errorMessage : '<?php AriQuizWebHelper::displayResValue('Validator.NameNotUnique'); ?>'})); <?php echo J16 ? 'Joomla.submitbutton' : 'submitbutton'; ?> = function(pressbutton) { if (pressbutton == 'category_add$save' || pressbutton == 'category_add$apply') { if (!aris.validators.<API key>.validate()) { return; } } <?php echo J16 ? 'Joomla.submitform' : 'submitform'; ?>(pressbutton); } </script> <input type="hidden" name="option" value="<?php echo $option;?>" /> <input type="hidden" name="categoryId" value="<?php echo $categoryId;?>" /> <input type="hidden" name="task" value="category_add$save" /> </form>
#define ICONV_INTERNAL #include "iconv.h" static const <API key> to_ucs = { { 0x0000, 0x0001, 0x0002, 0x0003, 0x0085, 0x0009, 0x0086, 0x007f, 0x0087, 0x008d, 0x008e, 0x000b, 0x000c, 0x000d, 0x000e, 0x000f, 0x0010, 0x0011, 0x0012, 0x0013, 0x008f, 0x000a, 0x0008, 0x0097, 0x0018, 0x0019, 0x009c, 0x009d, 0x001c, 0x001d, 0x001e, 0x001f, 0x0080, 0x0081, 0x0082, 0x0083, 0x0084, 0x0092, 0x0017, 0x001b, 0x0088, 0x0089, 0x008a, 0x008b, 0x008c, 0x0005, 0x0006, 0x0007, 0x0090, 0x0091, 0x0016, 0x0093, 0x0094, 0x0095, 0x0096, 0x0004, 0x0098, 0x0099, 0x009a, 0x009b, 0x0014, 0x0015, 0x009e, 0x001a, 0x0020, 0x00a0, 0x00e2, 0x00e4, 0x00e0, 0x00e1, 0x00e3, 0x00e5, 0x00e7, 0x00f1, 0x0060, 0x002e, 0x003c, 0x0028, 0x002b, 0x007c, 0x0026, 0x00e9, 0x00ea, 0x00eb, 0x00e8, 0x00ed, 0x00ee, 0x00ef, 0x00ec, 0x00df, 0x0021, 0x0024, 0x002a, 0x0029, 0x003b, 0x009f, 0x002d, 0x002f, 0x00c2, 0x00c4, 0x00c0, 0x00c1, 0x00c3, 0x00c5, 0x00c7, 0x00d1, 0x005e, 0x002c, 0x0025, 0x005f, 0x003e, 0x003f, 0x00f8, 0x00c9, 0x00ca, 0x00cb, 0x00c8, 0x00cd, 0x00ce, 0x00cf, 0x00cc, 0x00a8, 0x003a, 0x0023, 0x0040, 0x0027, 0x003d, 0x0022, 0x00d8, 0x0061, 0x0062, 0x0063, 0x0064, 0x0065, 0x0066, 0x0067, 0x0068, 0x0069, 0x00ab, 0x00bb, 0x00f0, 0x00fd, 0x00fe, 0x00b1, 0x00b0, 0x006a, 0x006b, 0x006c, 0x006d, 0x006e, 0x006f, 0x0070, 0x0071, 0x0072, 0x00aa, 0x00ba, 0x00e6, 0x00b8, 0x00c6, 0x00a4, 0x00b5, 0x00af, 0x0073, 0x0074, 0x0075, 0x0076, 0x0077, 0x0078, 0x0079, 0x007a, 0x00a1, 0x00bf, 0x00d0, 0x00dd, 0x00de, 0x00ae, 0x00a2, 0x00a3, 0x00a5, 0x00b7, 0x00a9, 0x00a7, 0x00b6, 0x00bc, 0x00bd, 0x00be, 0x00ac, 0x005b, 0x005c, 0x005d, 0x00b4, 0x00d7, 0x00f9, 0x0041, 0x0042, 0x0043, 0x0044, 0x0045, 0x0046, 0x0047, 0x0048, 0x0049, 0x00ad, 0x00f4, 0x00f6, 0x00f2, 0x00f3, 0x00f5, 0x00a6, 0x004a, 0x004b, 0x004c, 0x004d, 0x004e, 0x004f, 0x0050, 0x0051, 0x0052, 0x00b9, 0x00fb, 0x00fc, 0x00db, 0x00fa, 0x00ff, 0x00d9, 0x00f7, 0x0053, 0x0054, 0x0055, 0x0056, 0x0057, 0x0058, 0x0059, 0x005a, 0x00b2, 0x00d4, 0x00d6, 0x00d2, 0x00d3, 0x00d5, 0x0030, 0x0031, 0x0032, 0x0033, 0x0034, 0x0035, 0x0036, 0x0037, 0x0038, 0x0039, 0x00b3, 0x007b, 0x00dc, 0x007d, 0x00da, 0x007e } }; static const <API key> from_ucs_00 = { { 0x0000, 0x0001, 0x0002, 0x0003, 0x0037, 0x002d, 0x002e, 0x002f, 0x0016, 0x0005, 0x0015, 0x000b, 0x000c, 0x000d, 0x000e, 0x000f, 0x0010, 0x0011, 0x0012, 0x0013, 0x003c, 0x003d, 0x0032, 0x0026, 0x0018, 0x0019, 0x003f, 0x0027, 0x001c, 0x001d, 0x001e, 0x001f, 0x0040, 0x005a, 0x007f, 0x007b, 0x005b, 0x006c, 0x0050, 0x007d, 0x004d, 0x005d, 0x005c, 0x004e, 0x006b, 0x0060, 0x004b, 0x0061, 0x00f0, 0x00f1, 0x00f2, 0x00f3, 0x00f4, 0x00f5, 0x00f6, 0x00f7, 0x00f8, 0x00f9, 0x007a, 0x005e, 0x004c, 0x007e, 0x006e, 0x006f, 0x007c, 0x00c1, 0x00c2, 0x00c3, 0x00c4, 0x00c5, 0x00c6, 0x00c7, 0x00c8, 0x00c9, 0x00d1, 0x00d2, 0x00d3, 0x00d4, 0x00d5, 0x00d6, 0x00d7, 0x00d8, 0x00d9, 0x00e2, 0x00e3, 0x00e4, 0x00e5, 0x00e6, 0x00e7, 0x00e8, 0x00e9, 0x00bb, 0x00bc, 0x00bd, 0x006a, 0x006d, 0x004a, 0x0081, 0x0082, 0x0083, 0x0084, 0x0085, 0x0086, 0x0087, 0x0088, 0x0089, 0x0091, 0x0092, 0x0093, 0x0094, 0x0095, 0x0096, 0x0097, 0x0098, 0x0099, 0x00a2, 0x00a3, 0x00a4, 0x00a5, 0x00a6, 0x00a7, 0x00a8, 0x00a9, 0x00fb, 0x004f, 0x00fd, 0x00ff, 0x0007, 0x0020, 0x0021, 0x0022, 0x0023, 0x0024, 0x0004, 0x0006, 0x0008, 0x0028, 0x0029, 0x002a, 0x002b, 0x002c, 0x0009, 0x000a, 0x0014, 0x0030, 0x0031, 0x0025, 0x0033, 0x0034, 0x0035, 0x0036, 0x0017, 0x0038, 0x0039, 0x003a, 0x003b, 0x001a, 0x001b, 0x003e, 0x005f, 0x0041, 0x00aa, 0x00b0, 0x00b1, 0x009f, 0x00b2, 0x00d0, 0x00b5, 0x0079, 0x00b4, 0x009a, 0x008a, 0x00ba, 0x00ca, 0x00af, 0x00a1, 0x0090, 0x008f, 0x00ea, 0x00fa, 0x00be, 0x00a0, 0x00b6, 0x00b3, 0x009d, 0x00da, 0x009b, 0x008b, 0x00b7, 0x00b8, 0x00b9, 0x00ab, 0x0064, 0x0065, 0x0062, 0x0066, 0x0063, 0x0067, 0x009e, 0x0068, 0x0074, 0x0071, 0x0072, 0x0073, 0x0078, 0x0075, 0x0076, 0x0077, 0x00ac, 0x0069, 0x00ed, 0x00ee, 0x00eb, 0x00ef, 0x00ec, 0x00bf, 0x0080, 0x00e0, 0x00fe, 0x00dd, 0x00fc, 0x00ad, 0x00ae, 0x0059, 0x0044, 0x0045, 0x0042, 0x0046, 0x0043, 0x0047, 0x009c, 0x0048, 0x0054, 0x0051, 0x0052, 0x0053, 0x0058, 0x0055, 0x0056, 0x0057, 0x008c, 0x0049, 0x00cd, 0x00ce, 0x00cb, 0x00cf, 0x00cc, 0x00e1, 0x0070, 0x00c0, 0x00de, 0x00db, 0x00dc, 0x008d, 0x008e, 0x00df } }; static const <API key> from_ucs = { { &from_ucs_00, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL } }; #define NBITS 8 static ucs2_t convert_from_ucs(ucs2_t ch) { return <API key>((const iconv_ccs_convtable *)&from_ucs, ch); } static ucs2_t convert_to_ucs(ucs2_t ch) { return <API key>((const iconv_ccs_convtable *)&to_ucs, ch); } static const char * const names[] = { "osd_ebcdic_df04_1", NULL }; static const struct iconv_ccs_desc iconv_ccs_desc = { names, NBITS, (const iconv_ccs_convtable *)&from_ucs, (const iconv_ccs_convtable *)&to_ucs, convert_from_ucs, convert_to_ucs, }; struct iconv_module_desc iconv_module = { ICMOD_UC_CCS, <API key>, NULL, &iconv_ccs_desc };
package com.quollwriter.ui.panels; import java.awt.*; import java.awt.event.*; import java.awt.font.*; import java.io.*; import java.text.*; import java.util.ArrayList; import java.util.List; import java.util.Map; import java.util.Random; import java.util.Timer; import java.util.Set; import javax.swing.*; import javax.swing.border.*; import javax.swing.event.*; import javax.swing.text.*; import javax.swing.undo.*; import com.gentlyweb.properties.*; import com.jgoodies.forms.builder.*; import com.jgoodies.forms.factories.*; import com.jgoodies.forms.layout.*; import com.quollwriter.*; import com.quollwriter.data.*; import com.quollwriter.text.*; import com.quollwriter.synonyms.*; import com.quollwriter.ui.sidebars.*; import com.quollwriter.ui.*; import com.quollwriter.ui.actionHandlers.*; import com.quollwriter.ui.components.ActionAdapter; import com.quollwriter.ui.components.DocumentAdapter; import com.quollwriter.ui.components.StyleChangeAdapter; import com.quollwriter.ui.components.StyleChangeEvent; import com.quollwriter.ui.components.StyleChangeListener; import com.quollwriter.ui.components.QTextEditor; import com.quollwriter.ui.components.Runner; import com.quollwriter.ui.components.TextStylable; import com.quollwriter.ui.components.TextProperties; public abstract class <API key> extends AbstractEditorPanel { public static final String SAVE_ACTION_NAME = "save"; public static final String <API key> = "<API key>"; public static final String <API key> = "delete-chapter"; public <API key> (<API key> pv, Chapter c) throws GeneralException { super (pv, c); final <API key> _this = this; this.editor.setSectionBreak (Constants.SECTION_BREAK); this.actions.put (<API key>, new <API key> ((Chapter) this.obj, this.viewer)); this.actions.put (SAVE_ACTION_NAME, new ActionAdapter () { public void actionPerformed (ActionEvent ev) { try { _this.saveChapter (); } catch (Exception e) { Environment.logError ("Unable to save chapter", e); } } }); this.actions.put (<API key>, new ActionAdapter () { public void actionPerformed (ActionEvent ev) { try { _this.insertSectionBreak (); } catch (Exception e) { // Ignore. } } }); InputMap im = this.editor.getInputMap (JComponent.<API key>); im.put (KeyStroke.getKeyStroke (KeyEvent.VK_S, Event.CTRL_MASK), SAVE_ACTION_NAME); im = this.editor.getInputMap (JComponent.WHEN_FOCUSED); im.put (KeyStroke.getKeyStroke (KeyEvent.VK_ENTER, Event.CTRL_MASK), <API key>); } public abstract void doFillPopupMenu (MouseEvent eve, JPopupMenu p, boolean compress); @Override public void close () { super.close (); } @Override public void init () throws GeneralException { super.init (); final <API key> _this = this; final <API key> doc = (<API key>) this.editor.getDocument (); doc.addDocumentListener (new DocumentAdapter () { public void insertUpdate (DocumentEvent ev) { final int offset = ev.getOffset (); if (ev.getLength () > 0) { _this.viewer.fireProjectEvent (Chapter.OBJECT_TYPE, ProjectEvent.EDIT, _this.obj); } boolean add = false; try { if (ev.getLength () == 1) { if (offset == 0) { Set<OutlineItem> its = _this.obj.getOutlineItemsAt (0); for (OutlineItem it : its) { it.setTextPosition (editor.getDocument ().createPosition (it.getPosition () + 1)); } Set<Scene> ss = _this.obj.getScenesAt (0); for (Scene s : ss) { s.setTextPosition (editor.getDocument ().createPosition (s.getPosition () + 1)); } Set<Note> nn = _this.obj.getNotesAt (0); for (Note n : nn) { n.setTextPosition (editor.getDocument ().createPosition (n.getPosition () + 1)); } } String t = doc.getText (offset, ev.getLength ()); String nl = String.valueOf ('\n'); if (t.equals (nl)) { String te = doc.getText (offset - Constants.SECTION_BREAK_FIND.length (), Constants.SECTION_BREAK_FIND.length ()); if (te.equals (Constants.SECTION_BREAK_FIND)) { add = true; } if (doc.getLogicalStyle (offset) == _this.editor.sectionBreakStyle) { UIUtils.doLater (new ActionListener () { public void actionPerformed (ActionEvent ev) { Style ls = doc.addStyle (null, null); StyleConstants.setAlignment (ls, StyleConstants.ALIGN_LEFT); doc.<API key> (offset + 1, 1, ls, false); } }); } } } } catch (Exception e) { // Ignore. } if (add) { UIUtils.doLater (new ActionListener () { public void actionPerformed (ActionEvent ev) { try { String ins = String.valueOf ('\n') + String.valueOf ('\n') + Constants.SECTION_BREAK + String.valueOf ('\n') + String.valueOf ('\n'); doc.replace (offset - Constants.SECTION_BREAK_FIND.length (), Constants.SECTION_BREAK_FIND.length () + 1, ins, _this.editor.sectionBreakStyle); doc.<API key> (offset + 2, Constants.SECTION_BREAK.length (), _this.editor.sectionBreakStyle, false); doc.setLogicalStyle (offset + 2, _this.editor.sectionBreakStyle); Style ls = doc.addStyle (null, null); StyleConstants.setAlignment (ls, StyleConstants.ALIGN_LEFT); doc.<API key> (offset + Constants.SECTION_BREAK.length (), 2, ls, false); } catch (Exception e) { Environment.logError ("Unable to add section breaks", e); } } }); } } public void removeUpdate (DocumentEvent ev) { if (ev.getLength () > 0) { _this.viewer.fireProjectEvent (Chapter.OBJECT_TYPE, ProjectEvent.EDIT, _this.obj); } final int offset = ev.getOffset (); if (doc.getLogicalStyle (offset) == _this.editor.sectionBreakStyle) { UIUtils.doLater (new ActionListener () { public void actionPerformed (ActionEvent ev) { try { doc.replace (offset - Constants.SECTION_BREAK_FIND.length (), Constants.SECTION_BREAK_FIND.length (), null, null); } catch (Exception e) { } } }); } } }); this.editor.getDocument ().addDocumentListener (new DocumentAdapter () { public void changedUpdate (DocumentEvent ev) { if (_this.<API key> ()) { return; } _this.<API key> (true); } public void insertUpdate (DocumentEvent ev) { if (_this.<API key> ()) { return; } _this.<API key> (true); } public void removeUpdate (DocumentEvent ev) { if (_this.<API key> ()) { return; } _this.<API key> (true); } }); } public void insertSectionBreak () { final AbstractEditorPanel _this = this; final <API key> doc = (<API key>) this.editor.getDocument (); final int offset = this.editor.getCaret ().getDot (); UIUtils.doLater (new ActionListener () { public void actionPerformed (ActionEvent ev) { try { _this.editor.startCompoundEdit (); String ins = String.valueOf ('\n') + String.valueOf ('\n') + Constants.SECTION_BREAK + String.valueOf ('\n') + String.valueOf ('\n'); doc.insertString (offset, ins, _this.editor.sectionBreakStyle); doc.<API key> (offset + 2, Constants.SECTION_BREAK.length (), _this.editor.sectionBreakStyle, false); doc.setLogicalStyle (offset + 2, _this.editor.sectionBreakStyle); _this.editor.endCompoundEdit (); } catch (Exception e) { } } }); } @Override public boolean saveUnsavedChanges () throws Exception { this.saveObject (); return true; } public void saveChapter () throws Exception { this.saveObject (); } public void saveObject () throws Exception { this.obj.setText (this.editor.getTextWithMarkup ()); super.saveObject (); } // TODO: Merge with TextArea.fillPopupMenu private void <API key> (JPopupMenu popup, boolean compress) { String sel = this.editor.getSelectedText (); if (!sel.equals ("")) { java.util.List<String> prefix = new ArrayList (); prefix.add (LanguageStrings.formatting); prefix.add (LanguageStrings.format); prefix.add (LanguageStrings.popupmenu); prefix.add (LanguageStrings.items); if (compress) { List<JComponent> buts = new ArrayList (); buts.add (this.createButton (Constants.BOLD_ICON_NAME, Constants.ICON_MENU, Environment.getUIString (prefix, LanguageStrings.bold, LanguageStrings.tooltip), //"Bold the selected text", QTextEditor.BOLD_ACTION_NAME)); buts.add (this.createButton (Constants.ITALIC_ICON_NAME, Constants.ICON_MENU, Environment.getUIString (prefix, LanguageStrings.italic, LanguageStrings.tooltip), //"Italic the selected text", QTextEditor.ITALIC_ACTION_NAME)); buts.add (this.createButton (Constants.UNDERLINE_ICON_NAME, Constants.ICON_MENU, Environment.getUIString (prefix, LanguageStrings.underline, LanguageStrings.tooltip), //"Underline the selected text", QTextEditor.<API key>)); popup.add (UIUtils.<API key> (Environment.getUIString (LanguageStrings.formatting, LanguageStrings.format, LanguageStrings.popupmenu, LanguageStrings.title), //"Format", popup, buts)); } else { JMenuItem mi = null; popup.addSeparator (); // Add the bold/italic/underline. mi = this.createMenuItem (Environment.getUIString (prefix, LanguageStrings.bold, LanguageStrings.text), //"Bold", Constants.BOLD_ICON_NAME, QTextEditor.BOLD_ACTION_NAME, KeyStroke.getKeyStroke (KeyEvent.VK_B, ActionEvent.CTRL_MASK)); mi.setMnemonic (KeyEvent.VK_B); mi.setFont (mi.getFont ().deriveFont (Font.BOLD)); popup.add (mi); mi = this.createMenuItem (Environment.getUIString (prefix, LanguageStrings.italic, LanguageStrings.text), //"Italic", Constants.ITALIC_ICON_NAME, QTextEditor.ITALIC_ACTION_NAME, KeyStroke.getKeyStroke (KeyEvent.VK_I, ActionEvent.CTRL_MASK)); mi.setMnemonic (KeyEvent.VK_I); mi.setFont (mi.getFont ().deriveFont (Font.ITALIC)); popup.add (mi); mi = this.createMenuItem (Environment.getUIString (prefix, LanguageStrings.underline, LanguageStrings.text), //"Underline", Constants.UNDERLINE_ICON_NAME, QTextEditor.<API key>, KeyStroke.getKeyStroke (KeyEvent.VK_U, ActionEvent.CTRL_MASK)); mi.setMnemonic (KeyEvent.VK_U); popup.add (mi); Map attrs = mi.getFont ().getAttributes (); attrs.put (TextAttribute.UNDERLINE, TextAttribute.<API key>); mi.setFont (mi.getFont ().deriveFont (attrs)); } } } // TODO: Merge with TextArea.fillPopupMenu. private void <API key> (JPopupMenu popup, boolean compress) { JMenuItem mi = null; java.util.List<String> prefix = new ArrayList (); prefix.add (LanguageStrings.formatting); prefix.add (LanguageStrings.edit); prefix.add (LanguageStrings.popupmenu); prefix.add (LanguageStrings.items); String sel = this.editor.getSelectedText (); if (compress) { List<JComponent> buts = new ArrayList (); // Only add if there is something to cut. if (!sel.equals ("")) { buts.add (this.createButton (Constants.CUT_ICON_NAME, Constants.ICON_MENU, Environment.getUIString (prefix, LanguageStrings.cut, LanguageStrings.tooltip), //"Cut the selected text", QTextEditor.CUT_ACTION_NAME)); buts.add (this.createButton (Constants.COPY_ICON_NAME, Constants.ICON_MENU, Environment.getUIString (prefix, LanguageStrings.copy, LanguageStrings.tooltip), //"Copy the selected text", QTextEditor.COPY_ACTION_NAME)); } if (UIUtils.clipboardHasContent ()) { buts.add (this.createButton (Constants.PASTE_ICON_NAME, Constants.ICON_MENU, Environment.getUIString (prefix, LanguageStrings.paste, LanguageStrings.tooltip), //"Paste", QTextEditor.PASTE_ACTION_NAME)); } // Only add if there is an undo available. buts.add (this.createButton (Constants.UNDO_ICON_NAME, Constants.ICON_MENU, Environment.getUIString (prefix, LanguageStrings.undo, LanguageStrings.tooltip), //"Undo", QTextEditor.UNDO_ACTION_NAME)); buts.add (this.createButton (Constants.REDO_ICON_NAME, Constants.ICON_MENU, Environment.getUIString (prefix, LanguageStrings.redo, LanguageStrings.tooltip), //"Redo", QTextEditor.REDO_ACTION_NAME)); popup.add (UIUtils.<API key> (Environment.getUIString (LanguageStrings.formatting, LanguageStrings.edit, LanguageStrings.popupmenu, LanguageStrings.title), //"Edit", popup, buts)); } else { popup.addSeparator (); /* mi = this.createMenuItem ("Find", Constants.FIND_ICON_NAME, Constants.SHOW_FIND_ACTION, KeyStroke.getKeyStroke (KeyEvent.VK_F, ActionEvent.CTRL_MASK)); mi.setMnemonic (KeyEvent.VK_F); popup.add (mi); */ if (!sel.equals ("")) { mi = this.createMenuItem (Environment.getUIString (prefix, LanguageStrings.cut, LanguageStrings.text), //"Cut", Constants.CUT_ICON_NAME, QTextEditor.CUT_ACTION_NAME, KeyStroke.getKeyStroke (KeyEvent.VK_X, ActionEvent.CTRL_MASK)); mi.setMnemonic (KeyEvent.VK_X); popup.add (mi); mi = this.createMenuItem (Environment.getUIString (prefix, LanguageStrings.copy, LanguageStrings.text), //"Copy", Constants.COPY_ICON_NAME, QTextEditor.COPY_ACTION_NAME, KeyStroke.getKeyStroke (KeyEvent.VK_C, ActionEvent.CTRL_MASK)); mi.setMnemonic (KeyEvent.VK_C); popup.add (mi); } // Only show if there is something in the clipboard. if (UIUtils.clipboardHasContent ()) { mi = this.createMenuItem (Environment.getUIString (prefix, LanguageStrings.paste, LanguageStrings.text), //"Paste", Constants.PASTE_ICON_NAME, QTextEditor.PASTE_ACTION_NAME, KeyStroke.getKeyStroke (KeyEvent.VK_V, ActionEvent.CTRL_MASK)); mi.setMnemonic (KeyEvent.VK_V); popup.add (mi); } mi = this.createMenuItem (Environment.getUIString (prefix, LanguageStrings.undo, LanguageStrings.text), //"Undo", Constants.UNDO_ICON_NAME, QTextEditor.UNDO_ACTION_NAME, KeyStroke.getKeyStroke (KeyEvent.VK_Z, ActionEvent.CTRL_MASK)); mi.setMnemonic (KeyEvent.VK_Z); popup.add (mi); mi = this.createMenuItem (Environment.getUIString (prefix, LanguageStrings.redo, LanguageStrings.text), //"Redo", Constants.REDO_ICON_NAME, QTextEditor.REDO_ACTION_NAME, KeyStroke.getKeyStroke (KeyEvent.VK_Y, ActionEvent.CTRL_MASK)); mi.setMnemonic (KeyEvent.VK_Y); popup.add (mi); } } public void fillPopupMenu (final MouseEvent ev, final JPopupMenu popup) { final QTextEditor editor = this.editor; final <API key> _this = this; Point p = this.editor.getMousePosition (); this.lastMousePosition = p; JMenuItem mi = null; if (p != null) { ActionAdapter addToDict = new ActionAdapter () { public void actionPerformed (ActionEvent ev) { editor.addWordToDictionary (ev.getActionCommand ()); _this.viewer.fireProjectEvent (ProjectEvent.PERSONAL_DICTIONARY, ProjectEvent.ADD_WORD, ev.getActionCommand ()); } }; TextIterator iter = new TextIterator (this.editor.getText ()); final Word w = iter.getWordAt (this.editor.viewToModel (p)); if (w != null) { final String word = w.getText (); final int loc = w.<API key> (); java.util.List l = this.editor.<API key> (w); if (l != null) { java.util.List<String> prefix = new ArrayList (); prefix.add (LanguageStrings.dictionary); prefix.add (LanguageStrings.spellcheck); prefix.add (LanguageStrings.popupmenu); prefix.add (LanguageStrings.items); if (l.size () == 0) { mi = new JMenuItem (Environment.getUIString (prefix, LanguageStrings.add)); //"Add to Dictionary"); mi.setFont (mi.getFont ().deriveFont (Font.BOLD)); mi.setActionCommand (word); mi.addActionListener (addToDict); popup.add (mi, 0); mi = new JMenuItem (Environment.getUIString (prefix, LanguageStrings.nosuggestions)); //"(No Spelling Suggestions)"); mi.setFont (mi.getFont ().deriveFont (Font.BOLD)); mi.setEnabled (false); popup.add (mi, 0); } else { JMenu more = new JMenu (Environment.getUIString (prefix, LanguageStrings.more)); //"More Suggestions"); int i = 0; for (i = 0; i < l.size (); i++) { if (i == 5) { popup.add (more, 5); } final String suggestion = (String) l.get (i); //final String suggestion = ((com.swabunga.spell.engine.Word) l.get (i)).getWord (); mi = new JMenuItem (suggestion); mi.setFont (mi.getFont ().deriveFont (Font.BOLD)); mi.setActionCommand (mi.getText ()); mi.addActionListener (new ActionAdapter () { public void actionPerformed (ActionEvent ev) { String repWord = ev.getActionCommand (); _this.editor.replaceText (loc, loc + word.length (), repWord); _this.viewer.fireProjectEvent (ProjectEvent.SPELL_CHECK, ProjectEvent.REPLACE, ev.getActionCommand ()); } }); if (i < 5) { popup.add (mi); } else { more.add (mi); } } if (i > 5) { i = 6; } mi = new JMenuItem (Environment.getUIString (prefix, LanguageStrings.add)); //"Add to Dictionary"); mi.setActionCommand (word); mi.addActionListener (addToDict); popup.add (mi, i); } popup.addSeparator (); } else { if ((this.viewer.<API key> ()) && (ev.getSource () == this.editor)) { if (Environment.isEnglish (_this.viewer.<API key> ())) { if ((word != null) && (word.length () > 0)) { //String mt = "No synonyms found for: " + word; try { // See if there are any synonyms. if (this.editor.getSynonymProvider ().hasSynonym (word)) { mi = new JMenuItem (String.format (Environment.getUIString (LanguageStrings.synonyms, LanguageStrings.popupmenu, LanguageStrings.items, LanguageStrings.find), word)); //mi = new JMenuItem ("Find synonyms for: " + word); mi.setIcon (Environment.getIcon ("find", Constants.ICON_MENU)); mi.addActionListener (new <API key> (w, _this.editor)); /* word, loc, // c this.getChapter (), _this)); */ } else { mi = new JMenuItem (String.format (Environment.getUIString (LanguageStrings.synonyms, LanguageStrings.popupmenu, LanguageStrings.items, LanguageStrings.nosynonyms), word)); //mi = new JMenuItem ("(No synonyms for: " + word + ")"); mi.setFont (mi.getFont ().deriveFont (Font.BOLD)); mi.setEnabled (false); } popup.add (mi); popup.addSeparator (); } catch (Exception e) { Environment.logError ("Unable to determine whether word: " + word + " has synonyms.", e); } } } } } } } boolean compress = UserProperties.getAsBoolean (Constants.<API key>); this.doFillPopupMenu (ev, popup, compress); this.<API key> (popup, compress); this.<API key> (popup, compress); } }
<?php $cssAndScriptFiles = array( //dropzone '/plugins/dropzone/downloads/css/ph.css', '/plugins/dropzone/downloads/dropzone.min.js', //lightbox '/plugins/lightbox2/css/lightbox.css', '/plugins/lightbox2/js/lightbox.min.js' ); HtmlHelper::<API key>( $cssAndScriptFiles ,Yii::app()->theme->baseUrl."/assets"); ?> <div style="display:none" id="genericGED"> <div class="space20"></div> <div class="col-sm-10 col-sm-offset-1"> <div class="space20"></div> <h3><?php echo Yii::t("misc","Manage Documents",null,Yii::app()->controller->module->id) ?></h3> <!-- start: PAGE CONTENT --> <style type="text/css"> .dropzoneInstance { background: none repeat scroll 0 0 white; border: 1px dashed rgba(0, 0, 0, 0.4); min-height: 130px; } </style> <div class="row uploaderDiv"> <div class="col-sm-12"> <!-- start: DROPZONE PANEL --> <div class="panel panel-white"> <div class="panel-heading"> <h4 class="panel-title">Add <span class="text-bold">Files</span></h4> </div> <div class="panel-body uploadPanel"> <?php echo Yii::t("perimeter","Catégories",null,Yii::app()->controller->module->id) ?> : <input type="text" id="genericDocCategory" name="genericDocCategory" type="hidden" style="width: 250px;"> <br/><br/> <div class="dz-clickable dropzoneInstance center" id="generic-dropzone"> <span class="text-bold text-large uploadText"> <br/>Click or Drag over <br/>max. 2.0Mb <span class="text-small"> <br/>jpg, jpeg, png, gif <br/>pdf, xls, xlsx, doc, docx, ppt, pptx, odt </span> </span> </div> </div> </div> <!-- end: DROPZONE PANEL --> </div> </div> <div class="space5"></div> <table class="table table-striped table-bordered table-hover genericFilesTable"> <thead> <tr> <th>Doc</th> <th class="hidden-xs center">Date</th> <th class="hidden-xs"><?php echo Yii::t("perimeter","Taille",null,Yii::app()->controller->module->id) ?></th> <th><?php echo Yii::t("perimeter","Categories",null,Yii::app()->controller->module->id) ?></th> <th class="hidden-xs center">Actions</th> </tr> </thead> <tbody class="genericFiles"></tbody> </table> </div> </div> <script type="text/javascript"> var genericDropzone = null; var docType = "<?php echo PHType::TYPE_CITOYEN?>"; var folder = "<?php echo PHType::TYPE_CITOYEN ?>"; var ownerId = '<?php echo (isset(Yii::app()->session["userId"])) ? Yii::app()->session["userId"] : "unknown"?>'; var destinationFolder = moduleId; jQuery(document).ready(function() { $(".showDropZone").off().on( "click", function() { $(this).addClass("hide"); $(".uploaderDiv").removeClass('hide').addClass('animated bounceIn'); }); $(".new-file").unbind("click").click(function() { $.subview({ content : "#genericGED", onShow : function() { initDropZoneData(); } }); }); }); var <API key> = <?php echo isset($categories) ? json_encode($categories) : '""' ?>; <API key> = <API key>.sort(); function initDropZoneData(docs) { console.log("initDropZoneData"); $(".genericFiles").html(""); if(!genericDropzone){ genericDropzone = new Dropzone("#generic-dropzone", { /*if( saveDoc != undefined && typeof saveDoc == "function" ) saveDoc(doc); else */ genericSaveDoc(doc , function(data){ if (<API key>.indexOf(category) < 0) { <API key>.push(category); } doc._id = data.id; genericFilesTable.DataTable().destroy(); addFileLine(".genericFiles",doc,data.id['$id']); genericDropzone.removeAllFiles(true); $(".uploadText").show(); <API key>(); if(afterDocSave && $.isFunction(afterDocSave)) afterDocSave(doc); }); } else { toastr.error('Something went wrong!'); $.unblockUI(); } } }, error: function(response) { toastr.error("Something went wrong!!"); genericDropzone.removeAllFiles(true); } }); } <API key>(); if( !$('.genericFilesTable').hasClass("genericFilesTable") ){ genericFilesTable = $('.genericFilesTable').dataTable({ "aoColumnDefs" : [{ "aTargets" : [0] }], "oLanguage" : { "sLengthMenu" : "Show _MENU_ Rows", "sSearch" : "", "oPaginate" : { "sPrevious" : "", "sNext" : "" } }, "aaSorting" : [[1, 'asc']], "aLengthMenu" : [[5, 10, 15, 20, -1], [5, 10, 15, 20, "All"] // change per page values here ], // set the initial value "iDisplayLength" : 10, "bDestroy": true }); } else genericFilesTable.DataTable().draw(); //Init Select2 of Categories $('#genericDocCategory').select2({ tags : <API key>, <API key>: 1}); $('#genericDocCategory').select2("val",""); } function <API key>() { console.log("<API key>"); if( !$('.genericFilesTable').hasClass("dataTable") ){ genericFilesTable = $('.genericFilesTable').dataTable({ "aoColumnDefs" : [{ "aTargets" : [0] }], "oLanguage" : { "sLengthMenu" : "Show _MENU_ Rows", "sSearch" : "", "oPaginate" : { "sPrevious" : "", "sNext" : "" } }, "aaSorting" : [[1, 'asc']], "aLengthMenu" : [[5, 10, 15, 20, -1], [5, 10, 15, 20, "All"] ], "iDisplayLength" : 10, "destroy": true }); } else { if( $(".projectFiles").children('tr').length > 0 ) { genericFilesTable.dataTable().fnDestroy(); genericFilesTable.dataTable().fnDraw(); } else { console.log(" projectFilesTable fnClearTable"); genericFilesTable.dataTable().fnClearTable(); } } } function addFileLine(id,doc,docId) { folderPath = folder+"/"+ownerId; console.log("addFileLine",'/upload/'+destinationFolder+'/'+folderPath+'/'+doc.name); console.log("addFileLine",doc); date = new Date(doc.date); if(doc.name && doc.name.indexOf(".pdf") >= 0) link = '<a href="'+baseUrl+'/upload/'+destinationFolder+'/'+folderPath+'/'+doc.name+'" target="_blank"><i class="fa fa-file-pdf-o fa-3x icon-big"></i></a>'; else if((doc.name && (doc.name.indexOf(".jpg") >= 0 || doc.name.indexOf(".jpeg") >= 0 || doc.name.indexOf(".gif") >= 0 || doc.name.indexOf(".png") >= 0 ))) link = '<a href="'+baseUrl+'/upload/'+destinationFolder+'/'+folderPath+'/'+doc.name+'" data-lightbox="docs">'+ '<img width="150" class="img-responsive" src="'+baseUrl+'/upload/'+destinationFolder+'/'+folderPath+'/'+doc.name+'"/>'+ '</a>'; else link = '<a href="'+baseUrl+'/upload/'+destinationFolder+'/'+folderPath+'/'+doc.name+'" target="_blank"><i class="fa fa-file fa-3x icon-big"></i></a>'; category = (doc.category) ? doc.category : "Unknown"; lineHTML = '<tr class="file'+docId+'">'+ '<td class="center">'+link+'</td>'+ '<td class="hidden-xs">'+date.getDay()+"/"+(parseInt(date.getMonth())+1)+"/"+date.getFullYear()+" "+date.getHours()+":"+date.getMinutes()+'</td>'+ '<td class="hidden-xs">'+doc.size+'</td>'+ '<td class="center hidden-xs"><span class="label label-danger">'+category+'</span></td>'+ '<td class="center ">'+ '<a href="#" class="btn btn-xs btn-red removeFileLine" data-pos="'+docId+'" ><i class="fa fa-times fa fa-white"></i></a>'+ '</td>'+ '</tr>'; $(id).prepend(lineHTML); $(".removeFileLine").off().on( "click", function() { if( "undefined" != typeof delDoc ){ delDoc($(this).data("pos")); } else toastr.error('no delete method available!'); }); } function genericSaveDoc(doc, callback) { console.log("genericSaveDoc",doc); $.ajax({ type: "POST", url: baseUrl+"/"+moduleId+"/document/save", data: doc, dataType: "json" }).done( function(data){ if(data.result){ toastr.success(data.msg); callback(data); } else toastr.error(data.msg); }); } </script>
package component import core.BaseFormats import org.json4s.jackson.Serialization.{ read, writePretty } import org.json4s.{ DefaultFormats, Formats } import org.joda.time.DateTime import akka.http.scaladsl.model._ import akka.http.scaladsl.marshalling._ import akka.http.scaladsl.unmarshalling._ case class User(id: String = null, name: Option[String] = None, login: Option[String] = None, password: Option[String] = None, rolesets: List[Roleset] = List()) { def hasRole(role: Role) = rolesets.exists(_.roles.contains(role)) } case class Login(name: String, password: String) trait UserFormats extends BaseFormats { lazy val `application/vnd.enpassant.user+json` = customMediaTypeUTF8("vnd.enpassant.user+json") lazy val `application/vnd.enpassant.login+json` = customMediaTypeUTF8("vnd.enpassant.login+json") implicit val UserUnmarshaller = Unmarshaller.firstOf( unmarshaller[User](`application/vnd.enpassant.user+json`), unmarshaller[User](MediaTypes.`application/json`)) implicit val UserMarshaller = Marshaller.oneOf( marshaller[User](`application/vnd.enpassant.user+json`), marshaller[User](MediaTypes.`application/json`)) implicit val SeqUserMarshaller = marshaller[Seq[User]]( `application/collection+json`) implicit val LoginUnmarshaller = Unmarshaller.firstOf( unmarshaller[Login](`application/vnd.enpassant.login+json`), unmarshaller[Login](MediaTypes.`application/json`)) implicit val LoginMarshaller = Marshaller.oneOf( marshaller[Login](`application/vnd.enpassant.login+json`), marshaller[Login](MediaTypes.`application/json`)) }