blob_id
stringlengths
40
40
directory_id
stringlengths
40
40
path
stringlengths
7
410
content_id
stringlengths
40
40
detected_licenses
listlengths
0
51
license_type
stringclasses
2 values
repo_name
stringlengths
5
132
snapshot_id
stringlengths
40
40
revision_id
stringlengths
40
40
branch_name
stringlengths
4
80
visit_date
timestamp[us]
revision_date
timestamp[us]
committer_date
timestamp[us]
github_id
int64
5.85k
684M
star_events_count
int64
0
209k
fork_events_count
int64
0
110k
gha_license_id
stringclasses
22 values
gha_event_created_at
timestamp[us]
gha_created_at
timestamp[us]
gha_language
stringclasses
132 values
src_encoding
stringclasses
34 values
language
stringclasses
1 value
is_vendor
bool
1 class
is_generated
bool
2 classes
length_bytes
int64
3
9.45M
extension
stringclasses
28 values
content
stringlengths
3
9.45M
authors
listlengths
1
1
author_id
stringlengths
0
352
f24a43f36f4f490e4827b59c278e2a7653e74e1c
667f6048e2235ac1c79e4293204a4af5e7fcf5dc
/src/main/java/monnef/core/external/javassist/bytecode/SignatureAttribute.java
2e5bb26c67949c6a59b51491525a445bed3b82d4
[]
no_license
mnn/monnefcore
980d1093d49a60827dd4d42a0be0d660c757d0d3
9091c5e6c94cd413069797fc45646514e50e81f5
refs/heads/master
2021-01-23T13:59:15.490686
2014-12-04T17:06:55
2014-12-04T17:06:55
null
0
0
null
null
null
null
UTF-8
Java
false
false
34,702
java
/* * Javassist, a Java-bytecode translator toolkit. * Copyright (C) 1999- Shigeru Chiba. All Rights Reserved. * * The contents of this file are subject to the Mozilla Public License Version * 1.1 (the "License"); you may not use this file except in compliance with * the License. Alternatively, the contents of this file may be used under * the terms of the GNU Lesser General Public License Version 2.1 or later, * or the Apache License Version 2.0. * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License * for the specific language governing rights and limitations under the * License. */ package monnef.core.external.javassist.bytecode; import monnef.core.external.javassist.CtClass; import java.io.DataInputStream; import java.io.IOException; import java.util.ArrayList; import java.util.Map; /** * <code>Signature_attribute</code>. */ public class SignatureAttribute extends AttributeInfo { /** * The name of this attribute <code>"Signature"</code>. */ public static final String tag = "Signature"; SignatureAttribute(ConstPool cp, int n, DataInputStream in) throws IOException { super(cp, n, in); } /** * Constructs a <code>Signature</code> attribute. * * @param cp a constant pool table. * @param signature the signature represented by this attribute. */ public SignatureAttribute(ConstPool cp, String signature) { super(cp, tag); int index = cp.addUtf8Info(signature); byte[] bvalue = new byte[2]; bvalue[0] = (byte)(index >>> 8); bvalue[1] = (byte)index; set(bvalue); } /** * Returns the generic signature indicated by <code>signature_index</code>. * * @see #toClassSignature(String) * @see #toMethodSignature(String) * @see #toFieldSignature(String) */ public String getSignature() { return getConstPool().getUtf8Info(ByteArray.readU16bit(get(), 0)); } /** * Sets <code>signature_index</code> to the index of the given generic signature, * which is added to a constant pool. * * @param sig new signature. * @since 3.11 */ public void setSignature(String sig) { int index = getConstPool().addUtf8Info(sig); ByteArray.write16bit(index, info, 0); } /** * Makes a copy. Class names are replaced according to the * given <code>Map</code> object. * * @param newCp the constant pool table used by the new copy. * @param classnames pairs of replaced and substituted * class names. */ public AttributeInfo copy(ConstPool newCp, Map classnames) { return new SignatureAttribute(newCp, getSignature()); } void renameClass(String oldname, String newname) { String sig = renameClass(getSignature(), oldname, newname); setSignature(sig); } void renameClass(Map classnames) { String sig = renameClass(getSignature(), classnames); setSignature(sig); } static String renameClass(String desc, String oldname, String newname) { Map map = new java.util.HashMap(); map.put(oldname, newname); return renameClass(desc, map); } static String renameClass(String desc, Map map) { if (map == null) return desc; StringBuilder newdesc = new StringBuilder(); int head = 0; int i = 0; for (;;) { int j = desc.indexOf('L', i); if (j < 0) break; StringBuilder nameBuf = new StringBuilder(); int k = j; char c; try { while ((c = desc.charAt(++k)) != ';') { nameBuf.append(c); if (c == '<') { while ((c = desc.charAt(++k)) != '>') nameBuf.append(c); nameBuf.append(c); } } } catch (IndexOutOfBoundsException e) { break; } i = k + 1; String name = nameBuf.toString(); String name2 = (String)map.get(name); if (name2 != null) { newdesc.append(desc.substring(head, j)); newdesc.append('L'); newdesc.append(name2); newdesc.append(c); head = i; } } if (head == 0) return desc; else { int len = desc.length(); if (head < len) newdesc.append(desc.substring(head, len)); return newdesc.toString(); } } private static boolean isNamePart(int c) { return c != ';' && c != '<'; } static private class Cursor { int position = 0; int indexOf(String s, int ch) throws BadBytecode { int i = s.indexOf(ch, position); if (i < 0) throw error(s); else { position = i + 1; return i; } } } /** * Class signature. */ public static class ClassSignature { TypeParameter[] params; ClassType superClass; ClassType[] interfaces; /** * Constructs a class signature. * * @param params type parameters. * @param superClass the super class. * @param interfaces the interface types. */ public ClassSignature(TypeParameter[] params, ClassType superClass, ClassType[] interfaces) { this.params = params == null ? new TypeParameter[0] : params; this.superClass = superClass == null ? ClassType.OBJECT : superClass; this.interfaces = interfaces == null ? new ClassType[0] : interfaces; } /** * Constructs a class signature. * * @param p type parameters. */ public ClassSignature(TypeParameter[] p) { this(p, null, null); } /** * Returns the type parameters. * * @return a zero-length array if the type parameters are not specified. */ public TypeParameter[] getParameters() { return params; } /** * Returns the super class. */ public ClassType getSuperClass() { return superClass; } /** * Returns the super interfaces. * * @return a zero-length array if the super interfaces are not specified. */ public ClassType[] getInterfaces() { return interfaces; } /** * Returns the string representation. */ public String toString() { StringBuffer sbuf = new StringBuffer(); TypeParameter.toString(sbuf, params); sbuf.append(" extends ").append(superClass); if (interfaces.length > 0) { sbuf.append(" implements "); Type.toString(sbuf, interfaces); } return sbuf.toString(); } /** * Returns the encoded string representing the method type signature. */ public String encode() { StringBuffer sbuf = new StringBuffer(); if (params.length > 0) { sbuf.append('<'); for (int i = 0; i < params.length; i++) params[i].encode(sbuf); sbuf.append('>'); } superClass.encode(sbuf); for (int i = 0; i < interfaces.length; i++) interfaces[i].encode(sbuf); return sbuf.toString(); } } /** * Method type signature. */ public static class MethodSignature { TypeParameter[] typeParams; Type[] params; Type retType; ObjectType[] exceptions; /** * Constructs a method type signature. Any parameter can be null * to represent <code>void</code> or nothing. * * @param tp type parameters. * @param params parameter types. * @param ret a return type, or null if the return type is <code>void</code>. * @param ex exception types. */ public MethodSignature(TypeParameter[] tp, Type[] params, Type ret, ObjectType[] ex) { typeParams = tp == null ? new TypeParameter[0] : tp; this.params = params == null ? new Type[0] : params; retType = ret == null ? new BaseType("void") : ret; exceptions = ex == null ? new ObjectType[0] : ex; } /** * Returns the formal type parameters. * * @return a zero-length array if the type parameters are not specified. */ public TypeParameter[] getTypeParameters() { return typeParams; } /** * Returns the types of the formal parameters. * * @return a zero-length array if no formal parameter is taken. */ public Type[] getParameterTypes() { return params; } /** * Returns the type of the returned value. */ public Type getReturnType() { return retType; } /** * Returns the types of the exceptions that may be thrown. * * @return a zero-length array if exceptions are never thrown or * the exception types are not parameterized types or type variables. */ public ObjectType[] getExceptionTypes() { return exceptions; } /** * Returns the string representation. */ public String toString() { StringBuffer sbuf = new StringBuffer(); TypeParameter.toString(sbuf, typeParams); sbuf.append(" ("); Type.toString(sbuf, params); sbuf.append(") "); sbuf.append(retType); if (exceptions.length > 0) { sbuf.append(" throws "); Type.toString(sbuf, exceptions); } return sbuf.toString(); } /** * Returns the encoded string representing the method type signature. */ public String encode() { StringBuffer sbuf = new StringBuffer(); if (typeParams.length > 0) { sbuf.append('<'); for (int i = 0; i < typeParams.length; i++) typeParams[i].encode(sbuf); sbuf.append('>'); } sbuf.append('('); for (int i = 0; i < params.length; i++) params[i].encode(sbuf); sbuf.append(')'); retType.encode(sbuf); if (exceptions.length > 0) for (int i = 0; i < exceptions.length; i++) { sbuf.append('^'); exceptions[i].encode(sbuf); } return sbuf.toString(); } } /** * Formal type parameters. * * @see TypeArgument */ public static class TypeParameter { String name; ObjectType superClass; ObjectType[] superInterfaces; TypeParameter(String sig, int nb, int ne, ObjectType sc, ObjectType[] si) { name = sig.substring(nb, ne); superClass = sc; superInterfaces = si; } /** * Constructs a <code>TypeParameter</code> representing a type parametre * like <code>&lt;T extends ... &gt;<code>. * * @param name parameter name. * @param superClass an upper bound class-type (or null). * @param superInterfaces an upper bound interface-type (or null). */ public TypeParameter(String name, ObjectType superClass, ObjectType[] superInterfaces) { this.name = name; this.superClass = superClass; if (superInterfaces == null) this.superInterfaces = new ObjectType[0]; else this.superInterfaces = superInterfaces; } /** * Constructs a <code>TypeParameter</code> representing a type parameter * like <code>&lt;T&gt;<code>. * * @param name parameter name. */ public TypeParameter(String name) { this(name, null, null); } /** * Returns the name of the type parameter. */ public String getName() { return name; } /** * Returns the class bound of this parameter. */ public ObjectType getClassBound() { return superClass; } /** * Returns the interface bound of this parameter. * * @return a zero-length array if the interface bound is not specified. */ public ObjectType[] getInterfaceBound() { return superInterfaces; } /** * Returns the string representation. */ public String toString() { StringBuffer sbuf = new StringBuffer(getName()); if (superClass != null) sbuf.append(" extends ").append(superClass.toString()); int len = superInterfaces.length; if (len > 0) { for (int i = 0; i < len; i++) { if (i > 0 || superClass != null) sbuf.append(" & "); else sbuf.append(" extends "); sbuf.append(superInterfaces[i].toString()); } } return sbuf.toString(); } static void toString(StringBuffer sbuf, TypeParameter[] tp) { sbuf.append('<'); for (int i = 0; i < tp.length; i++) { if (i > 0) sbuf.append(", "); sbuf.append(tp[i]); } sbuf.append('>'); } void encode(StringBuffer sb) { sb.append(name); if (superClass == null) sb.append(":Ljava/lang/Object;"); else { sb.append(':'); superClass.encode(sb); } for (int i = 0; i < superInterfaces.length; i++) { sb.append(':'); superInterfaces[i].encode(sb); } } } /** * Type argument. * * @see TypeParameter */ public static class TypeArgument { ObjectType arg; char wildcard; TypeArgument(ObjectType a, char w) { arg = a; wildcard = w; } /** * Constructs a <code>TypeArgument</code>. * A type argument is <code>&lt;String&gt;</code>, <code>&lt;int[]&gt;</code>, * or a type variable <code>&lt;T&gt;</code>, etc. * * @param t a class type, an array type, or a type variable. */ public TypeArgument(ObjectType t) { this(t, ' '); } /** * Constructs a <code>TypeArgument</code> representing <code>&lt;?&gt;</code>. */ public TypeArgument() { this(null, '*'); } /** * A factory method constructing a <code>TypeArgument</code> with an upper bound. * It represents <code>&lt;? extends ... &gt;</code> * * @param t an upper bound type. */ public static TypeArgument subclassOf(ObjectType t) { return new TypeArgument(t, '+'); } /** * A factory method constructing a <code>TypeArgument</code> with an lower bound. * It represents <code>&lt;? super ... &gt;</code> * * @param t an lower bbound type. */ public static TypeArgument superOf(ObjectType t) { return new TypeArgument(t, '-'); } /** * Returns the kind of this type argument. * * @return <code>' '</code> (not-wildcard), <code>'*'</code> (wildcard), <code>'+'</code> (wildcard with * upper bound), or <code>'-'</code> (wildcard with lower bound). */ public char getKind() { return wildcard; } /** * Returns true if this type argument is a wildcard type * such as <code>?</code>, <code>? extends String</code>, or <code>? super Integer</code>. */ public boolean isWildcard() { return wildcard != ' '; } /** * Returns the type represented by this argument * if the argument is not a wildcard type. Otherwise, this method * returns the upper bound (if the kind is '+'), * the lower bound (if the kind is '-'), or null (if the upper or lower * bound is not specified). */ public ObjectType getType() { return arg; } /** * Returns the string representation. */ public String toString() { if (wildcard == '*') return "?"; String type = arg.toString(); if (wildcard == ' ') return type; else if (wildcard == '+') return "? extends " + type; else return "? super " + type; } static void encode(StringBuffer sb, TypeArgument[] args) { sb.append('<'); for (int i = 0; i < args.length; i++) { TypeArgument ta = args[i]; if (ta.isWildcard()) sb.append(ta.wildcard); if (ta.getType() != null) ta.getType().encode(sb); } sb.append('>'); } } /** * Primitive types and object types. */ public static abstract class Type { abstract void encode(StringBuffer sb); static void toString(StringBuffer sbuf, Type[] ts) { for (int i = 0; i < ts.length; i++) { if (i > 0) sbuf.append(", "); sbuf.append(ts[i]); } } } /** * Primitive types. */ public static class BaseType extends Type { char descriptor; BaseType(char c) { descriptor = c; } /** * Constructs a <code>BaseType</code>. * * @param typeName <code>void</code>, <code>int</code>, ... */ public BaseType(String typeName) { this(Descriptor.of(typeName).charAt(0)); } /** * Returns the descriptor representing this primitive type. * * @see monnef.core.external.javassist.bytecode.Descriptor */ public char getDescriptor() { return descriptor; } /** * Returns the <code>CtClass</code> representing this * primitive type. */ public CtClass getCtlass() { return Descriptor.toPrimitiveClass(descriptor); } /** * Returns the string representation. */ public String toString() { return Descriptor.toClassName(Character.toString(descriptor)); } void encode(StringBuffer sb) { sb.append(descriptor); } } /** * Class types, array types, and type variables. * This class is also used for representing a field type. */ public static abstract class ObjectType extends Type { /** * Returns the encoded string representing the object type signature. */ public String encode() { StringBuffer sb = new StringBuffer(); encode(sb); return sb.toString(); } } /** * Class types. */ public static class ClassType extends ObjectType { String name; TypeArgument[] arguments; static ClassType make(String s, int b, int e, TypeArgument[] targs, ClassType parent) { if (parent == null) return new ClassType(s, b, e, targs); else return new NestedClassType(s, b, e, targs, parent); } ClassType(String signature, int begin, int end, TypeArgument[] targs) { name = signature.substring(begin, end).replace('/', '.'); arguments = targs; } /** * A class type representing <code>java.lang.Object</code>. */ public static ClassType OBJECT = new ClassType("java.lang.Object", null); /** * Constructs a <code>ClassType</code>. It represents * the name of a non-nested class. * * @param className a fully qualified class name. * @param args type arguments or null. */ public ClassType(String className, TypeArgument[] args) { name = className; arguments = args; } /** * Constructs a <code>ClassType</code>. It represents * the name of a non-nested class. * * @param className a fully qualified class name. */ public ClassType(String className) { this(className, null); } /** * Returns the class name. */ public String getName() { return name; } /** * Returns the type arguments. * * @return null if no type arguments are given to this class. */ public TypeArgument[] getTypeArguments() { return arguments; } /** * If this class is a member of another class, returns the * class in which this class is declared. * * @return null if this class is not a member of another class. */ public ClassType getDeclaringClass() { return null; } /** * Returns the string representation. */ public String toString() { StringBuffer sbuf = new StringBuffer(); ClassType parent = getDeclaringClass(); if (parent != null) sbuf.append(parent.toString()).append('.'); sbuf.append(name); if (arguments != null) { sbuf.append('<'); int n = arguments.length; for (int i = 0; i < n; i++) { if (i > 0) sbuf.append(", "); sbuf.append(arguments[i].toString()); } sbuf.append('>'); } return sbuf.toString(); } void encode(StringBuffer sb) { sb.append('L'); encode2(sb); sb.append(';'); } void encode2(StringBuffer sb) { ClassType parent = getDeclaringClass(); if (parent != null) { parent.encode2(sb); sb.append('$'); } sb.append(name.replace('.', '/')); if (arguments != null) TypeArgument.encode(sb, arguments); } } /** * Nested class types. */ public static class NestedClassType extends ClassType { ClassType parent; NestedClassType(String s, int b, int e, TypeArgument[] targs, ClassType p) { super(s, b, e, targs); parent = p; } /** * Constructs a <code>NestedClassType</code>. * * @param parent the class surrounding this class type. * @param className a simple class name. It does not include * a package name or a parent's class name. * @param args type parameters or null. */ public NestedClassType(ClassType parent, String className, TypeArgument[] args) { super(className, args); this.parent = parent; } /** * Returns the class that declares this nested class. * This nested class is a member of that declaring class. */ public ClassType getDeclaringClass() { return parent; } } /** * Array types. */ public static class ArrayType extends ObjectType { int dim; Type componentType; /** * Constructs an <code>ArrayType</code>. * * @param d dimension. * @param comp the component type. */ public ArrayType(int d, Type comp) { dim = d; componentType = comp; } /** * Returns the dimension of the array. */ public int getDimension() { return dim; } /** * Returns the component type. */ public Type getComponentType() { return componentType; } /** * Returns the string representation. */ public String toString() { StringBuffer sbuf = new StringBuffer(componentType.toString()); for (int i = 0; i < dim; i++) sbuf.append("[]"); return sbuf.toString(); } void encode(StringBuffer sb) { for (int i = 0; i < dim; i++) sb.append('['); componentType.encode(sb); } } /** * Type variables. */ public static class TypeVariable extends ObjectType { String name; TypeVariable(String sig, int begin, int end) { name = sig.substring(begin, end); } /** * Constructs a <code>TypeVariable</code>. * * @param name the name of a type variable. */ public TypeVariable(String name) { this.name = name; } /** * Returns the variable name. */ public String getName() { return name; } /** * Returns the string representation. */ public String toString() { return name; } void encode(StringBuffer sb) { sb.append('T').append(name).append(';'); } } /** * Parses the given signature string as a class signature. * * @param sig the signature obtained from the <code>SignatureAttribute</code> * of a <code>ClassFile</code>. * @return a tree-like data structure representing a class signature. It provides * convenient accessor methods. * @throws BadBytecode thrown when a syntactical error is found. * @see #getSignature() * @since 3.5 */ public static ClassSignature toClassSignature(String sig) throws BadBytecode { try { return parseSig(sig); } catch (IndexOutOfBoundsException e) { throw error(sig); } } /** * Parses the given signature string as a method type signature. * * @param sig the signature obtained from the <code>SignatureAttribute</code> * of a <code>MethodInfo</code>. * @return @return a tree-like data structure representing a method signature. It provides * convenient accessor methods. * @throws BadBytecode thrown when a syntactical error is found. * @see #getSignature() * @since 3.5 */ public static MethodSignature toMethodSignature(String sig) throws BadBytecode { try { return parseMethodSig(sig); } catch (IndexOutOfBoundsException e) { throw error(sig); } } /** * Parses the given signature string as a field type signature. * * @param sig the signature string obtained from the <code>SignatureAttribute</code> * of a <code>FieldInfo</code>. * @return the field type signature. * @throws BadBytecode thrown when a syntactical error is found. * @see #getSignature() * @since 3.5 */ public static ObjectType toFieldSignature(String sig) throws BadBytecode { try { return parseObjectType(sig, new Cursor(), false); } catch (IndexOutOfBoundsException e) { throw error(sig); } } /** * Parses the given signature string as a type signature. * The type signature is either the field type signature or a base type * descriptor including <code>void</code> type. * * @throws BadBytecode thrown when a syntactical error is found. * @since 3.18 */ public static Type toTypeSignature(String sig) throws BadBytecode { try { return parseType(sig, new Cursor()); } catch (IndexOutOfBoundsException e) { throw error(sig); } } private static ClassSignature parseSig(String sig) throws BadBytecode, IndexOutOfBoundsException { Cursor cur = new Cursor(); TypeParameter[] tp = parseTypeParams(sig, cur); ClassType superClass = parseClassType(sig, cur); int sigLen = sig.length(); ArrayList ifArray = new ArrayList(); while (cur.position < sigLen && sig.charAt(cur.position) == 'L') ifArray.add(parseClassType(sig, cur)); ClassType[] ifs = (ClassType[])ifArray.toArray(new ClassType[ifArray.size()]); return new ClassSignature(tp, superClass, ifs); } private static MethodSignature parseMethodSig(String sig) throws BadBytecode { Cursor cur = new Cursor(); TypeParameter[] tp = parseTypeParams(sig, cur); if (sig.charAt(cur.position++) != '(') throw error(sig); ArrayList params = new ArrayList(); while (sig.charAt(cur.position) != ')') { Type t = parseType(sig, cur); params.add(t); } cur.position++; Type ret = parseType(sig, cur); int sigLen = sig.length(); ArrayList exceptions = new ArrayList(); while (cur.position < sigLen && sig.charAt(cur.position) == '^') { cur.position++; ObjectType t = parseObjectType(sig, cur, false); if (t instanceof ArrayType) throw error(sig); exceptions.add(t); } Type[] p = (Type[])params.toArray(new Type[params.size()]); ObjectType[] ex = (ObjectType[])exceptions.toArray(new ObjectType[exceptions.size()]); return new MethodSignature(tp, p, ret, ex); } private static TypeParameter[] parseTypeParams(String sig, Cursor cur) throws BadBytecode { ArrayList typeParam = new ArrayList(); if (sig.charAt(cur.position) == '<') { cur.position++; while (sig.charAt(cur.position) != '>') { int nameBegin = cur.position; int nameEnd = cur.indexOf(sig, ':'); ObjectType classBound = parseObjectType(sig, cur, true); ArrayList ifBound = new ArrayList(); while (sig.charAt(cur.position) == ':') { cur.position++; ObjectType t = parseObjectType(sig, cur, false); ifBound.add(t); } TypeParameter p = new TypeParameter(sig, nameBegin, nameEnd, classBound, (ObjectType[])ifBound.toArray(new ObjectType[ifBound.size()])); typeParam.add(p); } cur.position++; } return (TypeParameter[])typeParam.toArray(new TypeParameter[typeParam.size()]); } private static ObjectType parseObjectType(String sig, Cursor c, boolean dontThrow) throws BadBytecode { int i; int begin = c.position; switch (sig.charAt(begin)) { case 'L' : return parseClassType2(sig, c, null); case 'T' : i = c.indexOf(sig, ';'); return new TypeVariable(sig, begin + 1, i); case '[' : return parseArray(sig, c); default : if (dontThrow) return null; else throw error(sig); } } private static ClassType parseClassType(String sig, Cursor c) throws BadBytecode { if (sig.charAt(c.position) == 'L') return parseClassType2(sig, c, null); else throw error(sig); } private static ClassType parseClassType2(String sig, Cursor c, ClassType parent) throws BadBytecode { int start = ++c.position; char t; do { t = sig.charAt(c.position++); } while (t != '$' && t != '<' && t != ';'); int end = c.position - 1; TypeArgument[] targs; if (t == '<') { targs = parseTypeArgs(sig, c); t = sig.charAt(c.position++); } else targs = null; ClassType thisClass = ClassType.make(sig, start, end, targs, parent); if (t == '$' || t == '.') { c.position--; return parseClassType2(sig, c, thisClass); } else return thisClass; } private static TypeArgument[] parseTypeArgs(String sig, Cursor c) throws BadBytecode { ArrayList args = new ArrayList(); char t; while ((t = sig.charAt(c.position++)) != '>') { TypeArgument ta; if (t == '*' ) ta = new TypeArgument(null, '*'); else { if (t != '+' && t != '-') { t = ' '; c.position--; } ta = new TypeArgument(parseObjectType(sig, c, false), t); } args.add(ta); } return (TypeArgument[])args.toArray(new TypeArgument[args.size()]); } private static ObjectType parseArray(String sig, Cursor c) throws BadBytecode { int dim = 1; while (sig.charAt(++c.position) == '[') dim++; return new ArrayType(dim, parseType(sig, c)); } private static Type parseType(String sig, Cursor c) throws BadBytecode { Type t = parseObjectType(sig, c, true); if (t == null) t = new BaseType(sig.charAt(c.position++)); return t; } private static BadBytecode error(String sig) { return new BadBytecode("bad signature: " + sig); } }
[ "moen@366.hopto.org" ]
moen@366.hopto.org
0deb3d28f307ca2df59114c0d320eb4cbaeb75f8
94979810799868172fc73d8a16fc7cc630cf7f30
/gc/CMS.java
7010caff06000b278065b9f744ca4b6bfdd2eb73
[]
no_license
shitsurei/JVM
6abce231355b0e077e16a121a5c0c6a1796b6b90
850d88bf11b6e8f513d38d5e1f7fb62a8691bbd3
refs/heads/master
2021-01-03T17:32:38.683448
2020-03-10T03:47:20
2020-03-10T03:47:20
240,170,861
1
0
null
null
null
null
UTF-8
Java
false
false
6,982
java
package gc; /** * 05 * 枚举根节点:当执行系统停下来之后并不需要一个不漏的检查所有执行上下文和全局引用的位置,虚拟机能够直接得知存放对象引用的地方,Hotspot中通过OopMap这一数据结构实现 * OopMap: * 安全点(SafePoint):在OopMap的帮助下Hotspot可以快速完成GC Root枚举,但是每条指令都生成OopMap空间成本较高,因此只在“安全点”记录;即程序执行过程中并非可以在任何位置暂停进行GC,只有到达安全点才可以 * 【安全点既不能太少(GC等待时间太长)又不能太多(运行负载高),选定标准:“是否具有让程序长时间运行的特征”,例如方法跳转、循环跳转、异常跳转等指令序列复用】 * 如何让GC发生时让所有线程(除了JNI)都跑到安全点上再停顿? * 1 抢占式中断(Preemptive Suspension) * 不需要线程的执行代码主动配合,GC发生时将所有业务线程中断,如果有线程不在安全点上,就让他恢复运行,跑到安全点上再停下来 * 2 主动式中断(Voluntary Suspension)【主流方式】 * GC需要中断线程时设置标志(轮询标志与安全点重合)供各个线程轮询,线程主动轮询主动中断挂起 * 安全区域(SafeRegion):用于解决线程处于休眠或阻塞状态,无法响应JVM的中断请求的状态 * * CMS(Concurrent Mark Sweep)并发【指GC线程可以和用户线程同时运行,不会出现较长时间的STW】 标记-清除GC * 以获取最短的回收停顿时间为目标,多用于互联网项目或B/S架构服务器系统中 * 步骤: * 1 初始标记(需要STW):只标记【GC Root引用或年轻代存活对象引用】的对象,速度很快 * 2 并发标记:进行GC Root Tracing,根据初始标记的对象找到所有被引用的存活对象(因为和用户线程并发,其引用关系可能发生改变) * 3 并发预清理 * 4 并发可失败的预清理 * 5 重新标记(需要STW):【修正并发标记期间因为用户程序运行导致的标记产生变动的记录】,速度慢于初始标记但远快于并发标记,通常会在新生代尽可能干净的情况下运行,可以避免连续的STW(新生代存活对象多也会导致老年代设计的存活对象多) * 6 并发清除 * 7 重置线程 * 优点:并发,低停顿 * 缺点: * 1 对CPU资源敏感 * 2 无法处理浮动垃圾:由于并发标记和并发清理阶段用户线程并未停止,此时生成新的垃圾对象只能留待下一次GC处理,如果老年代空间不足容纳新对象则会产生“Concurrent Mode Failure” * 【对于“Concurrent Mode Failure”,虚拟机会采用Serial Old收集器作为备选方案对老年代重新收集,这样STW停顿时间就会变长】 * 【参数-XX:CMSInitiatingOccupancyFraction=88用来设置老年代中对象占比超过多少百分比时触发CMS收集,该参数设置太小会频繁触发CMS,设置太大会产生“Concurrent Mode Failure”问题】 * 【JDK1.5中该参数默认为68,JDK1.6中提升至92】 * 3 收集结束后老年代会产生大量碎片:无连续空间存放大对象时容易触发Full GC(默认开启的参数-XX:+UseCMSCompactAtFullCollection用于在老年代触发Full GC之前先进行内存碎片整理,整理过程无法并发需等待) * * 空间分配担保:在发生Minor GC之前虚拟机会做一次判断,老年代最大可用连续空间是否大于新生代所有对象总大小? * 1 大于,此次GC时安全的,存在GC之后新生代大量对象都是存活的情况,Survivor空间无法容纳直接进入老年代 * 2 不足,触发Full GC(判断条件是以往晋升老年代的对象容量的平均值) */ public class CMS { /** * -verbose:gc * -Xms20m * -Xmx20m * -Xmn10m * -XX:+PrintGCDetails * -XX:SurvivorRatio=8 * -XX:+UseConcMarkSweepGC */ public static void main(String[] args) { int size = 1024 * 1024; byte[] myAlloc1 = new byte[4 * size]; // Thread.sleep(1000); System.out.println("-------1--------"); byte[] myAlloc2 = new byte[4 * size]; System.out.println("-------2--------"); byte[] myAlloc3 = new byte[4 * size]; System.out.println("-------3--------"); byte[] myAlloc4 = new byte[2 * size]; System.out.println("-------4--------"); } } /** * -------1-------- * [GC (Allocation Failure) [ParNew: 6109K->644K(9216K), 0.0044451 secs] 6109K->4742K(19456K), 0.0050749 secs] [Times: user=0.00 sys=0.00, real=0.01 secs] * -------2-------- * [GC (Allocation Failure) [ParNew: 4979K->248K(9216K), 0.0028341 secs] 9077K->9067K(19456K), 0.0028672 secs] [Times: user=0.00 sys=0.00, real=0.00 secs] * 【老年代初始标记】 * [GC (CMS Initial Mark) [1 CMS-initial-mark: 8819K(10240K)] 13163K(19456K), 0.0001764 secs] [Times: user=0.00 sys=0.00, real=0.00 secs] * 【老年代并发标记开始】 * [CMS-concurrent-mark-start] * -------3-------- * -------4-------- * [CMS-concurrent-mark: 0.001/0.001 secs] [Times: user=0.00 sys=0.00, real=0.00 secs] * 【老年代并发预清理开始】 * [CMS-concurrent-preclean-start] * [CMS-concurrent-preclean: 0.000/0.000 secs] [Times: user=0.00 sys=0.00, real=0.00 secs] * 【老年代可失败的并发预清理开始】 * [CMS-concurrent-abortable-preclean-start] * [CMS-concurrent-abortable-preclean: 0.000/0.000 secs] [Times: user=0.00 sys=0.00, real=0.00 secs] * 【老年代重新标记】 * [GC (CMS Final Remark) [YG occupancy: 6604 K (9216 K)][Rescan (parallel) , 0.0001322 secs][weak refs processing, 0.0000178 secs][class unloading, 0.0003763 secs][scrub symbol table, 0.0006500 secs][scrub string table, 0.0001478 secs][1 CMS-remark: 8819K(10240K)] 15423K(19456K), 0.0014295 secs] [Times: user=0.00 sys=0.00, real=0.00 secs] * 【老年代并发清除开始】 * [CMS-concurrent-sweep-start] * [CMS-concurrent-sweep: 0.000/0.000 secs] [Times: user=0.00 sys=0.00, real=0.00 secs] * 【老年代并发重置开始】 * [CMS-concurrent-reset-start] * [CMS-concurrent-reset: 0.000/0.000 secs] [Times: user=0.00 sys=0.00, real=0.00 secs] * Heap * par new generation total 9216K, used 6850K [0x00000000fec00000, 0x00000000ff600000, 0x00000000ff600000) * eden space 8192K, 80% used [0x00000000fec00000, 0x00000000ff272848, 0x00000000ff400000) * from space 1024K, 24% used [0x00000000ff400000, 0x00000000ff43e0d0, 0x00000000ff500000) * to space 1024K, 0% used [0x00000000ff500000, 0x00000000ff500000, 0x00000000ff600000) * concurrent mark-sweep generation total 10240K, used 8818K [0x00000000ff600000, 0x0000000100000000, 0x0000000100000000) * Metaspace used 3220K, capacity 4496K, committed 4864K, reserved 1056768K * class space used 349K, capacity 388K, committed 512K, reserved 1048576K */
[ "lfgewj21345@163.com" ]
lfgewj21345@163.com
da5b4f81bef4d8707c531b27b7f184fb4346e02e
73f8f8634e5d179ef32762ad953eeacbacb5a4db
/Thinking in Java(Fourth Edition)/chapter15/generator/coffee/Coffee.java
8e6cd37599f240368fc0914623e4246b8ad2e213
[]
no_license
yueban/java
46c1a41d86da424d16563a538b3cc5a87d3c002a
1023e5ae3cbba7db403a9b46fd8b1dafc82107c8
refs/heads/master
2021-01-25T04:02:54.017486
2014-11-21T02:47:46
2014-11-21T02:47:46
null
0
0
null
null
null
null
UTF-8
Java
false
false
198
java
package generator.coffee; public class Coffee{ private static long counter = 0; private final long id = counter++; public String toString(){ return getClass().getSimpleName() + " " + id; } }
[ "fanbaizhou@adeaz.com" ]
fanbaizhou@adeaz.com
8dbce498111449c9e9fc5c222fccdb9056755804
e44941d8e08cc06a5ae762517f088323dd47b05e
/L20-inheritance2/src/lesson20/inreitance2/Wolf.java
3cfd6f4f5853fb6aad2300583d4c8773b24b6339
[]
no_license
amitrofanov82/ItStepSharedWS
cf5ceb3389a04651ebb67038e008f89dadc2ddf7
5fe0a9bffaca4d1bfb695d1c0c69d8f7427c0ae4
refs/heads/master
2020-03-21T21:01:33.156587
2018-12-20T18:34:42
2018-12-20T18:34:42
139,042,600
0
1
null
null
null
null
UTF-8
Java
false
false
707
java
package lesson20.inreitance2; public final class Wolf extends Animal{ final static String S_FIELD = null; final static String S_FIELD2 = "str"; final static Object S_FIELD3 = new Cat(); final static int S_FIELD4 = 4; final Object oField = new Cat(); public Wolf() { } final public void makeSound() { System.out.println("Pppppppp"); } final public void feed(String foodType, final int massa) { final int i; if (foodType.equals("заяц")) { System.out.println("Спасибо, любимый хозяин"); } else { System.out.println("Сам это жри"); } } public void aport(){ System.out.println("Сам бегай за своей палкой"); } }
[ "mitrofanov_a@itstep.lan" ]
mitrofanov_a@itstep.lan
fa9b1f273ffe7aa82f8c1fe26b4d01afc5fbced7
d01ddc583cd4077dcf8cf338fcf2897908daa4ad
/jooby/src/main/java/org/jooby/internal/routes/CorsHandler.java
ef51180e8f9da00cdb9f98c5825ec70123656901
[ "Apache-2.0" ]
permissive
gustvn/jooby
61656793a2a8e753d962dffe414a8c668735c94c
d039d466be272c0c35a8ca9c78df4e04a27fc2f5
refs/heads/master
2021-01-24T16:48:43.300086
2015-07-30T19:42:29
2015-07-30T19:42:29
null
0
0
null
null
null
null
UTF-8
Java
false
false
5,057
java
/** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ package org.jooby.internal.routes; import static java.util.Objects.requireNonNull; import java.util.Collections; import java.util.List; import java.util.Optional; import org.jooby.Cors; import org.jooby.Request; import org.jooby.Response; import org.jooby.Route; import org.jooby.Route.Chain; import org.jooby.Status; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import com.google.common.base.Joiner; import com.google.common.base.Splitter; public class CorsHandler implements Route.Filter { private static final String ORIGIN = "Origin"; private static final String ANY_ORIGIN = "*"; private static final String AC_REQUEST_METHOD = "Access-Control-Request-Method"; private static final String AC_REQUEST_HEADERS = "Access-Control-Request-Headers"; private static final String AC_MAX_AGE = "Access-Control-Max-Age"; private static final String AC_EXPOSE_HEADERS = "Access-Control-Expose-Headers"; private static final String AC_ALLOW_ORIGIN = "Access-Control-Allow-Origin"; private static final String AC_ALLOW_HEADERS = "Access-Control-Allow-Headers"; private static final String AC_ALLOW_CREDENTIALS = "Access-Control-Allow-Credentials"; private static final String AC_ALLOW_METHODS = "Access-Control-Allow-Methods"; /** The logging system. */ private final Logger log = LoggerFactory.getLogger(Cors.class); private Optional<Cors> cors; public CorsHandler(final Optional<Cors> cors) { this.cors = requireNonNull(cors, "Cors is required."); } @Override public void handle(final Request req, final Response rsp, final Chain chain) throws Exception { Optional<String> origin = req.header("Origin").toOptional(); Cors cors = this.cors.orElseGet(() -> req.require(Cors.class)); if (cors.enabled() && origin.isPresent()) { cors(cors, req, rsp, origin.get()); } chain.next(req, rsp); } private void cors(final Cors cors, final Request req, final Response rsp, final String origin) throws Exception { if (cors.allowOrigin(origin)) { log.debug("allowed origin: {}", origin); if (preflight(req)) { log.debug("handling preflight for: {}", origin); preflight(cors, req, rsp, origin); } else { log.debug("handling simple cors for: {}", origin); if ("null".equals(origin)) { rsp.header(AC_ALLOW_ORIGIN, ANY_ORIGIN); } else { rsp.header(AC_ALLOW_ORIGIN, origin); if (!cors.anyOrigin()) { rsp.header("Vary", ORIGIN); } if (cors.credentials()) { rsp.header(AC_ALLOW_CREDENTIALS, true); } if (!cors.exposedHeaders().isEmpty()) { rsp.header(AC_EXPOSE_HEADERS, join(cors.exposedHeaders())); } } } } } private boolean preflight(final Request req) { return req.method().equals("OPTIONS") && req.header(AC_REQUEST_METHOD).isSet(); } private void preflight(final Cors cors, final Request req, final Response rsp, final String origin) { /** * Allowed method */ boolean allowMethod = req.header(AC_REQUEST_METHOD).toOptional() .map(cors::allowMethod) .orElse(false); if (!allowMethod) { return; } /** * Allowed headers */ List<String> headers = req.header(AC_REQUEST_HEADERS).toOptional().map(header -> Splitter.on(',').trimResults().omitEmptyStrings().splitToList(header) ).orElse(Collections.emptyList()); if (!cors.allowHeaders(headers)) { return; } /** * Allowed methods */ rsp.header(AC_ALLOW_METHODS, join(cors.allowedMethods())); List<String> allowedHeaders = cors.anyHeader() ? headers : cors.allowedHeaders(); rsp.header(AC_ALLOW_HEADERS, join(allowedHeaders)); /** * Allow credentials */ if (cors.credentials()) { rsp.header(AC_ALLOW_CREDENTIALS, true); } if (cors.maxAge() > 0) { rsp.header(AC_MAX_AGE, cors.maxAge()); } rsp.header(AC_ALLOW_ORIGIN, origin); if (!cors.anyOrigin()) { rsp.header("Vary", ORIGIN); } rsp.status(Status.OK).end(); } private String join(final List<String> values) { return Joiner.on(',').join(values); } }
[ "espina.edgar@gmail.com" ]
espina.edgar@gmail.com
a3379cc83228d8eee56e12161c2f6e53ff8cde48
85b13379de8d4142d5df878f916ff288f085e18e
/Printing n odd numbers/Main.java
e1f2243193546008c3ac63e21133e02b5fe381df
[]
no_license
THAMIZHINI/Playground
7dd0e30f69431186567712b8dcb04c46f294c379
dea7d940bc7cb120cae9d8440da417a14112e1bf
refs/heads/master
2020-06-01T11:56:23.147870
2019-06-14T10:06:23
2019-06-14T10:06:23
190,771,518
0
0
null
null
null
null
UTF-8
Java
false
false
145
java
#include <stdio.h> int main() { int n; scanf("%d",&n); for ( int i=1;i<=2*n;i++) { if(i%2==1) printf("%d\n",i); } return 0; }
[ "51488008+THAMIZHINI@users.noreply.github.com" ]
51488008+THAMIZHINI@users.noreply.github.com
4db3ace075e368e63592cb4566acec3a3c3d5756
0cc6bc0a0c92b9903b163a7aeb4f013c1a9fd795
/google-speech-protobuf/src/main/java/greco/DecoderEndpointerStreamParamsOuterClass.java
288b8980cf6e43056dff61da715353fe2d14fca4
[]
no_license
jackz314/SpeechRecognizer
fe34254727ae44ee3ddd83daad873257df1ac078
07ba8ec2a158830b37000bb3750a4f7c622b12d0
refs/heads/master
2023-04-08T09:24:19.079178
2021-04-12T23:55:33
2021-04-12T23:55:33
320,767,241
3
2
null
null
null
null
UTF-8
Java
false
true
97,247
java
// Generated by the protocol buffer compiler. DO NOT EDIT! // source: speech/greco3/decoder_endpointer/decoder_endpointer_stream_params.proto package greco; public final class DecoderEndpointerStreamParamsOuterClass { private DecoderEndpointerStreamParamsOuterClass() {} public static void registerAllExtensions( com.google.protobuf.ExtensionRegistryLite registry) { registry.add(greco.DecoderEndpointerStreamParamsOuterClass.DecoderEndpointerStreamParams.id); registry.add(greco.DecoderEndpointerStreamParamsOuterClass.EndpointOnDummyEvents.id); registry.add(greco.DecoderEndpointerStreamParamsOuterClass.EndpointOnFrameTimeForInitialSilence.id); registry.add(greco.DecoderEndpointerStreamParamsOuterClass.AddSilenceBeforeFirstSpeech.id); } public static void registerAllExtensions( com.google.protobuf.ExtensionRegistry registry) { registerAllExtensions( (com.google.protobuf.ExtensionRegistryLite) registry); } public interface DecoderEndpointerStreamParamsOrBuilder extends // @@protoc_insertion_point(interface_extends:greco.DecoderEndpointerStreamParams) com.google.protobuf.MessageOrBuilder { /** * <code>optional string mic_closer_stream_name = 1;</code> * @return Whether the micCloserStreamName field is set. */ boolean hasMicCloserStreamName(); /** * <code>optional string mic_closer_stream_name = 1;</code> * @return The micCloserStreamName. */ java.lang.String getMicCloserStreamName(); /** * <code>optional string mic_closer_stream_name = 1;</code> * @return The bytes for micCloserStreamName. */ com.google.protobuf.ByteString getMicCloserStreamNameBytes(); /** * <code>optional string prefetcher_stream_name = 2;</code> * @return Whether the prefetcherStreamName field is set. */ boolean hasPrefetcherStreamName(); /** * <code>optional string prefetcher_stream_name = 2;</code> * @return The prefetcherStreamName. */ java.lang.String getPrefetcherStreamName(); /** * <code>optional string prefetcher_stream_name = 2;</code> * @return The bytes for prefetcherStreamName. */ com.google.protobuf.ByteString getPrefetcherStreamNameBytes(); /** * <code>optional int32 preliminary_result_acoustic_silence_threshold_ms = 3;</code> * @return Whether the preliminaryResultAcousticSilenceThresholdMs field is set. */ boolean hasPreliminaryResultAcousticSilenceThresholdMs(); /** * <code>optional int32 preliminary_result_acoustic_silence_threshold_ms = 3;</code> * @return The preliminaryResultAcousticSilenceThresholdMs. */ int getPreliminaryResultAcousticSilenceThresholdMs(); /** * <code>optional float preliminary_result_sentence_end_cost_decision_threshold = 7 [default = 0];</code> * @return Whether the preliminaryResultSentenceEndCostDecisionThreshold field is set. */ boolean hasPreliminaryResultSentenceEndCostDecisionThreshold(); /** * <code>optional float preliminary_result_sentence_end_cost_decision_threshold = 7 [default = 0];</code> * @return The preliminaryResultSentenceEndCostDecisionThreshold. */ float getPreliminaryResultSentenceEndCostDecisionThreshold(); /** * <code>optional string decoder_endpointer_model_feature_stream_name = 4;</code> * @return Whether the decoderEndpointerModelFeatureStreamName field is set. */ boolean hasDecoderEndpointerModelFeatureStreamName(); /** * <code>optional string decoder_endpointer_model_feature_stream_name = 4;</code> * @return The decoderEndpointerModelFeatureStreamName. */ java.lang.String getDecoderEndpointerModelFeatureStreamName(); /** * <code>optional string decoder_endpointer_model_feature_stream_name = 4;</code> * @return The bytes for decoderEndpointerModelFeatureStreamName. */ com.google.protobuf.ByteString getDecoderEndpointerModelFeatureStreamNameBytes(); /** * <code>optional .greco.DecoderEndpointerModelParams decoder_endpointer_model_params = 5;</code> * @return Whether the decoderEndpointerModelParams field is set. */ boolean hasDecoderEndpointerModelParams(); /** * <code>optional .greco.DecoderEndpointerModelParams decoder_endpointer_model_params = 5;</code> * @return The decoderEndpointerModelParams. */ greco.DecoderEndpointerModelParamsOuterClass.DecoderEndpointerModelParams getDecoderEndpointerModelParams(); /** * <code>optional .greco.DecoderEndpointerModelParams decoder_endpointer_model_params = 5;</code> */ greco.DecoderEndpointerModelParamsOuterClass.DecoderEndpointerModelParamsOrBuilder getDecoderEndpointerModelParamsOrBuilder(); /** * <code>optional bool emit_end_of_speech_before_end_of_utterance = 6;</code> * @return Whether the emitEndOfSpeechBeforeEndOfUtterance field is set. */ boolean hasEmitEndOfSpeechBeforeEndOfUtterance(); /** * <code>optional bool emit_end_of_speech_before_end_of_utterance = 6;</code> * @return The emitEndOfSpeechBeforeEndOfUtterance. */ boolean getEmitEndOfSpeechBeforeEndOfUtterance(); } /** * Protobuf type {@code greco.DecoderEndpointerStreamParams} */ public static final class DecoderEndpointerStreamParams extends com.google.protobuf.GeneratedMessageV3 implements // @@protoc_insertion_point(message_implements:greco.DecoderEndpointerStreamParams) DecoderEndpointerStreamParamsOrBuilder { private static final long serialVersionUID = 0L; // Use DecoderEndpointerStreamParams.newBuilder() to construct. private DecoderEndpointerStreamParams(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) { super(builder); } private DecoderEndpointerStreamParams() { micCloserStreamName_ = ""; prefetcherStreamName_ = ""; decoderEndpointerModelFeatureStreamName_ = ""; } @java.lang.Override @SuppressWarnings({"unused"}) protected java.lang.Object newInstance( UnusedPrivateParameter unused) { return new DecoderEndpointerStreamParams(); } @java.lang.Override public final com.google.protobuf.UnknownFieldSet getUnknownFields() { return this.unknownFields; } public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return greco.DecoderEndpointerStreamParamsOuterClass.internal_static_greco_DecoderEndpointerStreamParams_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { return greco.DecoderEndpointerStreamParamsOuterClass.internal_static_greco_DecoderEndpointerStreamParams_fieldAccessorTable .ensureFieldAccessorsInitialized( greco.DecoderEndpointerStreamParamsOuterClass.DecoderEndpointerStreamParams.class, greco.DecoderEndpointerStreamParamsOuterClass.DecoderEndpointerStreamParams.Builder.class); } private int bitField0_; public static final int MIC_CLOSER_STREAM_NAME_FIELD_NUMBER = 1; private volatile java.lang.Object micCloserStreamName_; /** * <code>optional string mic_closer_stream_name = 1;</code> * @return Whether the micCloserStreamName field is set. */ @java.lang.Override public boolean hasMicCloserStreamName() { return ((bitField0_ & 0x00000001) != 0); } /** * <code>optional string mic_closer_stream_name = 1;</code> * @return The micCloserStreamName. */ @java.lang.Override public java.lang.String getMicCloserStreamName() { java.lang.Object ref = micCloserStreamName_; if (ref instanceof java.lang.String) { return (java.lang.String) ref; } else { com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; java.lang.String s = bs.toStringUtf8(); if (bs.isValidUtf8()) { micCloserStreamName_ = s; } return s; } } /** * <code>optional string mic_closer_stream_name = 1;</code> * @return The bytes for micCloserStreamName. */ @java.lang.Override public com.google.protobuf.ByteString getMicCloserStreamNameBytes() { java.lang.Object ref = micCloserStreamName_; if (ref instanceof java.lang.String) { com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8( (java.lang.String) ref); micCloserStreamName_ = b; return b; } else { return (com.google.protobuf.ByteString) ref; } } public static final int PREFETCHER_STREAM_NAME_FIELD_NUMBER = 2; private volatile java.lang.Object prefetcherStreamName_; /** * <code>optional string prefetcher_stream_name = 2;</code> * @return Whether the prefetcherStreamName field is set. */ @java.lang.Override public boolean hasPrefetcherStreamName() { return ((bitField0_ & 0x00000002) != 0); } /** * <code>optional string prefetcher_stream_name = 2;</code> * @return The prefetcherStreamName. */ @java.lang.Override public java.lang.String getPrefetcherStreamName() { java.lang.Object ref = prefetcherStreamName_; if (ref instanceof java.lang.String) { return (java.lang.String) ref; } else { com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; java.lang.String s = bs.toStringUtf8(); if (bs.isValidUtf8()) { prefetcherStreamName_ = s; } return s; } } /** * <code>optional string prefetcher_stream_name = 2;</code> * @return The bytes for prefetcherStreamName. */ @java.lang.Override public com.google.protobuf.ByteString getPrefetcherStreamNameBytes() { java.lang.Object ref = prefetcherStreamName_; if (ref instanceof java.lang.String) { com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8( (java.lang.String) ref); prefetcherStreamName_ = b; return b; } else { return (com.google.protobuf.ByteString) ref; } } public static final int PRELIMINARY_RESULT_ACOUSTIC_SILENCE_THRESHOLD_MS_FIELD_NUMBER = 3; private int preliminaryResultAcousticSilenceThresholdMs_; /** * <code>optional int32 preliminary_result_acoustic_silence_threshold_ms = 3;</code> * @return Whether the preliminaryResultAcousticSilenceThresholdMs field is set. */ @java.lang.Override public boolean hasPreliminaryResultAcousticSilenceThresholdMs() { return ((bitField0_ & 0x00000004) != 0); } /** * <code>optional int32 preliminary_result_acoustic_silence_threshold_ms = 3;</code> * @return The preliminaryResultAcousticSilenceThresholdMs. */ @java.lang.Override public int getPreliminaryResultAcousticSilenceThresholdMs() { return preliminaryResultAcousticSilenceThresholdMs_; } public static final int PRELIMINARY_RESULT_SENTENCE_END_COST_DECISION_THRESHOLD_FIELD_NUMBER = 7; private float preliminaryResultSentenceEndCostDecisionThreshold_; /** * <code>optional float preliminary_result_sentence_end_cost_decision_threshold = 7 [default = 0];</code> * @return Whether the preliminaryResultSentenceEndCostDecisionThreshold field is set. */ @java.lang.Override public boolean hasPreliminaryResultSentenceEndCostDecisionThreshold() { return ((bitField0_ & 0x00000008) != 0); } /** * <code>optional float preliminary_result_sentence_end_cost_decision_threshold = 7 [default = 0];</code> * @return The preliminaryResultSentenceEndCostDecisionThreshold. */ @java.lang.Override public float getPreliminaryResultSentenceEndCostDecisionThreshold() { return preliminaryResultSentenceEndCostDecisionThreshold_; } public static final int DECODER_ENDPOINTER_MODEL_FEATURE_STREAM_NAME_FIELD_NUMBER = 4; private volatile java.lang.Object decoderEndpointerModelFeatureStreamName_; /** * <code>optional string decoder_endpointer_model_feature_stream_name = 4;</code> * @return Whether the decoderEndpointerModelFeatureStreamName field is set. */ @java.lang.Override public boolean hasDecoderEndpointerModelFeatureStreamName() { return ((bitField0_ & 0x00000010) != 0); } /** * <code>optional string decoder_endpointer_model_feature_stream_name = 4;</code> * @return The decoderEndpointerModelFeatureStreamName. */ @java.lang.Override public java.lang.String getDecoderEndpointerModelFeatureStreamName() { java.lang.Object ref = decoderEndpointerModelFeatureStreamName_; if (ref instanceof java.lang.String) { return (java.lang.String) ref; } else { com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; java.lang.String s = bs.toStringUtf8(); if (bs.isValidUtf8()) { decoderEndpointerModelFeatureStreamName_ = s; } return s; } } /** * <code>optional string decoder_endpointer_model_feature_stream_name = 4;</code> * @return The bytes for decoderEndpointerModelFeatureStreamName. */ @java.lang.Override public com.google.protobuf.ByteString getDecoderEndpointerModelFeatureStreamNameBytes() { java.lang.Object ref = decoderEndpointerModelFeatureStreamName_; if (ref instanceof java.lang.String) { com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8( (java.lang.String) ref); decoderEndpointerModelFeatureStreamName_ = b; return b; } else { return (com.google.protobuf.ByteString) ref; } } public static final int DECODER_ENDPOINTER_MODEL_PARAMS_FIELD_NUMBER = 5; private greco.DecoderEndpointerModelParamsOuterClass.DecoderEndpointerModelParams decoderEndpointerModelParams_; /** * <code>optional .greco.DecoderEndpointerModelParams decoder_endpointer_model_params = 5;</code> * @return Whether the decoderEndpointerModelParams field is set. */ @java.lang.Override public boolean hasDecoderEndpointerModelParams() { return ((bitField0_ & 0x00000020) != 0); } /** * <code>optional .greco.DecoderEndpointerModelParams decoder_endpointer_model_params = 5;</code> * @return The decoderEndpointerModelParams. */ @java.lang.Override public greco.DecoderEndpointerModelParamsOuterClass.DecoderEndpointerModelParams getDecoderEndpointerModelParams() { return decoderEndpointerModelParams_ == null ? greco.DecoderEndpointerModelParamsOuterClass.DecoderEndpointerModelParams.getDefaultInstance() : decoderEndpointerModelParams_; } /** * <code>optional .greco.DecoderEndpointerModelParams decoder_endpointer_model_params = 5;</code> */ @java.lang.Override public greco.DecoderEndpointerModelParamsOuterClass.DecoderEndpointerModelParamsOrBuilder getDecoderEndpointerModelParamsOrBuilder() { return decoderEndpointerModelParams_ == null ? greco.DecoderEndpointerModelParamsOuterClass.DecoderEndpointerModelParams.getDefaultInstance() : decoderEndpointerModelParams_; } public static final int EMIT_END_OF_SPEECH_BEFORE_END_OF_UTTERANCE_FIELD_NUMBER = 6; private boolean emitEndOfSpeechBeforeEndOfUtterance_; /** * <code>optional bool emit_end_of_speech_before_end_of_utterance = 6;</code> * @return Whether the emitEndOfSpeechBeforeEndOfUtterance field is set. */ @java.lang.Override public boolean hasEmitEndOfSpeechBeforeEndOfUtterance() { return ((bitField0_ & 0x00000040) != 0); } /** * <code>optional bool emit_end_of_speech_before_end_of_utterance = 6;</code> * @return The emitEndOfSpeechBeforeEndOfUtterance. */ @java.lang.Override public boolean getEmitEndOfSpeechBeforeEndOfUtterance() { return emitEndOfSpeechBeforeEndOfUtterance_; } public static greco.DecoderEndpointerStreamParamsOuterClass.DecoderEndpointerStreamParams parseFrom( java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } public static greco.DecoderEndpointerStreamParamsOuterClass.DecoderEndpointerStreamParams parseFrom( java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } public static greco.DecoderEndpointerStreamParamsOuterClass.DecoderEndpointerStreamParams parseFrom( com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } public static greco.DecoderEndpointerStreamParamsOuterClass.DecoderEndpointerStreamParams parseFrom( com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } public static greco.DecoderEndpointerStreamParamsOuterClass.DecoderEndpointerStreamParams parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } public static greco.DecoderEndpointerStreamParamsOuterClass.DecoderEndpointerStreamParams parseFrom( byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } public static greco.DecoderEndpointerStreamParamsOuterClass.DecoderEndpointerStreamParams parseFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input); } public static greco.DecoderEndpointerStreamParamsOuterClass.DecoderEndpointerStreamParams parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input, extensionRegistry); } public static greco.DecoderEndpointerStreamParamsOuterClass.DecoderEndpointerStreamParams parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseDelimitedWithIOException(PARSER, input); } public static greco.DecoderEndpointerStreamParamsOuterClass.DecoderEndpointerStreamParams parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseDelimitedWithIOException(PARSER, input, extensionRegistry); } public static greco.DecoderEndpointerStreamParamsOuterClass.DecoderEndpointerStreamParams parseFrom( com.google.protobuf.CodedInputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input); } public static greco.DecoderEndpointerStreamParamsOuterClass.DecoderEndpointerStreamParams parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input, extensionRegistry); } @java.lang.Override public Builder newBuilderForType() { return newBuilder(); } public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } public static Builder newBuilder(greco.DecoderEndpointerStreamParamsOuterClass.DecoderEndpointerStreamParams 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; } /** * Protobuf type {@code greco.DecoderEndpointerStreamParams} */ public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder<Builder> implements // @@protoc_insertion_point(builder_implements:greco.DecoderEndpointerStreamParams) greco.DecoderEndpointerStreamParamsOuterClass.DecoderEndpointerStreamParamsOrBuilder { public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return greco.DecoderEndpointerStreamParamsOuterClass.internal_static_greco_DecoderEndpointerStreamParams_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { return greco.DecoderEndpointerStreamParamsOuterClass.internal_static_greco_DecoderEndpointerStreamParams_fieldAccessorTable .ensureFieldAccessorsInitialized( greco.DecoderEndpointerStreamParamsOuterClass.DecoderEndpointerStreamParams.class, greco.DecoderEndpointerStreamParamsOuterClass.DecoderEndpointerStreamParams.Builder.class); } // Construct using greco.DecoderEndpointerStreamParamsOuterClass.DecoderEndpointerStreamParams.newBuilder() private Builder() { maybeForceBuilderInitialization(); } private Builder( com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { super(parent); maybeForceBuilderInitialization(); } private void maybeForceBuilderInitialization() { if (com.google.protobuf.GeneratedMessageV3 .alwaysUseFieldBuilders) { getDecoderEndpointerModelParamsFieldBuilder(); } } @java.lang.Override public Builder clear() { super.clear(); micCloserStreamName_ = ""; bitField0_ = (bitField0_ & ~0x00000001); prefetcherStreamName_ = ""; bitField0_ = (bitField0_ & ~0x00000002); preliminaryResultAcousticSilenceThresholdMs_ = 0; bitField0_ = (bitField0_ & ~0x00000004); preliminaryResultSentenceEndCostDecisionThreshold_ = 0F; bitField0_ = (bitField0_ & ~0x00000008); decoderEndpointerModelFeatureStreamName_ = ""; bitField0_ = (bitField0_ & ~0x00000010); if (decoderEndpointerModelParamsBuilder_ == null) { decoderEndpointerModelParams_ = null; } else { decoderEndpointerModelParamsBuilder_.clear(); } bitField0_ = (bitField0_ & ~0x00000020); emitEndOfSpeechBeforeEndOfUtterance_ = false; bitField0_ = (bitField0_ & ~0x00000040); return this; } @java.lang.Override public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { return greco.DecoderEndpointerStreamParamsOuterClass.internal_static_greco_DecoderEndpointerStreamParams_descriptor; } @java.lang.Override public greco.DecoderEndpointerStreamParamsOuterClass.DecoderEndpointerStreamParams getDefaultInstanceForType() { return greco.DecoderEndpointerStreamParamsOuterClass.DecoderEndpointerStreamParams.getDefaultInstance(); } @java.lang.Override public greco.DecoderEndpointerStreamParamsOuterClass.DecoderEndpointerStreamParams build() { greco.DecoderEndpointerStreamParamsOuterClass.DecoderEndpointerStreamParams result = buildPartial(); if (!result.isInitialized()) { throw newUninitializedMessageException(result); } return result; } @java.lang.Override public greco.DecoderEndpointerStreamParamsOuterClass.DecoderEndpointerStreamParams buildPartial() { greco.DecoderEndpointerStreamParamsOuterClass.DecoderEndpointerStreamParams result = new greco.DecoderEndpointerStreamParamsOuterClass.DecoderEndpointerStreamParams(this); int from_bitField0_ = bitField0_; int to_bitField0_ = 0; if (((from_bitField0_ & 0x00000001) != 0)) { to_bitField0_ |= 0x00000001; } result.micCloserStreamName_ = micCloserStreamName_; if (((from_bitField0_ & 0x00000002) != 0)) { to_bitField0_ |= 0x00000002; } result.prefetcherStreamName_ = prefetcherStreamName_; if (((from_bitField0_ & 0x00000004) != 0)) { result.preliminaryResultAcousticSilenceThresholdMs_ = preliminaryResultAcousticSilenceThresholdMs_; to_bitField0_ |= 0x00000004; } if (((from_bitField0_ & 0x00000008) != 0)) { result.preliminaryResultSentenceEndCostDecisionThreshold_ = preliminaryResultSentenceEndCostDecisionThreshold_; to_bitField0_ |= 0x00000008; } if (((from_bitField0_ & 0x00000010) != 0)) { to_bitField0_ |= 0x00000010; } result.decoderEndpointerModelFeatureStreamName_ = decoderEndpointerModelFeatureStreamName_; if (((from_bitField0_ & 0x00000020) != 0)) { if (decoderEndpointerModelParamsBuilder_ == null) { result.decoderEndpointerModelParams_ = decoderEndpointerModelParams_; } else { result.decoderEndpointerModelParams_ = decoderEndpointerModelParamsBuilder_.build(); } to_bitField0_ |= 0x00000020; } if (((from_bitField0_ & 0x00000040) != 0)) { result.emitEndOfSpeechBeforeEndOfUtterance_ = emitEndOfSpeechBeforeEndOfUtterance_; to_bitField0_ |= 0x00000040; } result.bitField0_ = to_bitField0_; onBuilt(); return result; } @java.lang.Override public Builder clone() { return super.clone(); } @java.lang.Override public Builder setField( com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { return super.setField(field, value); } @java.lang.Override public Builder clearField( com.google.protobuf.Descriptors.FieldDescriptor field) { return super.clearField(field); } @java.lang.Override public Builder clearOneof( com.google.protobuf.Descriptors.OneofDescriptor oneof) { return super.clearOneof(oneof); } @java.lang.Override public Builder setRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { return super.setRepeatedField(field, index, value); } @java.lang.Override public Builder addRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { return super.addRepeatedField(field, value); } private int bitField0_; private java.lang.Object micCloserStreamName_ = ""; /** * <code>optional string mic_closer_stream_name = 1;</code> * @return Whether the micCloserStreamName field is set. */ public boolean hasMicCloserStreamName() { return ((bitField0_ & 0x00000001) != 0); } /** * <code>optional string mic_closer_stream_name = 1;</code> * @return The micCloserStreamName. */ public java.lang.String getMicCloserStreamName() { java.lang.Object ref = micCloserStreamName_; if (!(ref instanceof java.lang.String)) { com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; java.lang.String s = bs.toStringUtf8(); if (bs.isValidUtf8()) { micCloserStreamName_ = s; } return s; } else { return (java.lang.String) ref; } } /** * <code>optional string mic_closer_stream_name = 1;</code> * @return The bytes for micCloserStreamName. */ public com.google.protobuf.ByteString getMicCloserStreamNameBytes() { java.lang.Object ref = micCloserStreamName_; if (ref instanceof String) { com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8( (java.lang.String) ref); micCloserStreamName_ = b; return b; } else { return (com.google.protobuf.ByteString) ref; } } /** * <code>optional string mic_closer_stream_name = 1;</code> * @param value The micCloserStreamName to set. * @return This builder for chaining. */ public Builder setMicCloserStreamName( java.lang.String value) { if (value == null) { throw new NullPointerException(); } bitField0_ |= 0x00000001; micCloserStreamName_ = value; onChanged(); return this; } /** * <code>optional string mic_closer_stream_name = 1;</code> * @return This builder for chaining. */ public Builder clearMicCloserStreamName() { bitField0_ = (bitField0_ & ~0x00000001); micCloserStreamName_ = getDefaultInstance().getMicCloserStreamName(); onChanged(); return this; } /** * <code>optional string mic_closer_stream_name = 1;</code> * @param value The bytes for micCloserStreamName to set. * @return This builder for chaining. */ public Builder setMicCloserStreamNameBytes( com.google.protobuf.ByteString value) { if (value == null) { throw new NullPointerException(); } bitField0_ |= 0x00000001; micCloserStreamName_ = value; onChanged(); return this; } private java.lang.Object prefetcherStreamName_ = ""; /** * <code>optional string prefetcher_stream_name = 2;</code> * @return Whether the prefetcherStreamName field is set. */ public boolean hasPrefetcherStreamName() { return ((bitField0_ & 0x00000002) != 0); } /** * <code>optional string prefetcher_stream_name = 2;</code> * @return The prefetcherStreamName. */ public java.lang.String getPrefetcherStreamName() { java.lang.Object ref = prefetcherStreamName_; if (!(ref instanceof java.lang.String)) { com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; java.lang.String s = bs.toStringUtf8(); if (bs.isValidUtf8()) { prefetcherStreamName_ = s; } return s; } else { return (java.lang.String) ref; } } /** * <code>optional string prefetcher_stream_name = 2;</code> * @return The bytes for prefetcherStreamName. */ public com.google.protobuf.ByteString getPrefetcherStreamNameBytes() { java.lang.Object ref = prefetcherStreamName_; if (ref instanceof String) { com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8( (java.lang.String) ref); prefetcherStreamName_ = b; return b; } else { return (com.google.protobuf.ByteString) ref; } } /** * <code>optional string prefetcher_stream_name = 2;</code> * @param value The prefetcherStreamName to set. * @return This builder for chaining. */ public Builder setPrefetcherStreamName( java.lang.String value) { if (value == null) { throw new NullPointerException(); } bitField0_ |= 0x00000002; prefetcherStreamName_ = value; onChanged(); return this; } /** * <code>optional string prefetcher_stream_name = 2;</code> * @return This builder for chaining. */ public Builder clearPrefetcherStreamName() { bitField0_ = (bitField0_ & ~0x00000002); prefetcherStreamName_ = getDefaultInstance().getPrefetcherStreamName(); onChanged(); return this; } /** * <code>optional string prefetcher_stream_name = 2;</code> * @param value The bytes for prefetcherStreamName to set. * @return This builder for chaining. */ public Builder setPrefetcherStreamNameBytes( com.google.protobuf.ByteString value) { if (value == null) { throw new NullPointerException(); } bitField0_ |= 0x00000002; prefetcherStreamName_ = value; onChanged(); return this; } private int preliminaryResultAcousticSilenceThresholdMs_ ; /** * <code>optional int32 preliminary_result_acoustic_silence_threshold_ms = 3;</code> * @return Whether the preliminaryResultAcousticSilenceThresholdMs field is set. */ @java.lang.Override public boolean hasPreliminaryResultAcousticSilenceThresholdMs() { return ((bitField0_ & 0x00000004) != 0); } /** * <code>optional int32 preliminary_result_acoustic_silence_threshold_ms = 3;</code> * @return The preliminaryResultAcousticSilenceThresholdMs. */ @java.lang.Override public int getPreliminaryResultAcousticSilenceThresholdMs() { return preliminaryResultAcousticSilenceThresholdMs_; } /** * <code>optional int32 preliminary_result_acoustic_silence_threshold_ms = 3;</code> * @param value The preliminaryResultAcousticSilenceThresholdMs to set. * @return This builder for chaining. */ public Builder setPreliminaryResultAcousticSilenceThresholdMs(int value) { bitField0_ |= 0x00000004; preliminaryResultAcousticSilenceThresholdMs_ = value; onChanged(); return this; } /** * <code>optional int32 preliminary_result_acoustic_silence_threshold_ms = 3;</code> * @return This builder for chaining. */ public Builder clearPreliminaryResultAcousticSilenceThresholdMs() { bitField0_ = (bitField0_ & ~0x00000004); preliminaryResultAcousticSilenceThresholdMs_ = 0; onChanged(); return this; } private float preliminaryResultSentenceEndCostDecisionThreshold_ ; /** * <code>optional float preliminary_result_sentence_end_cost_decision_threshold = 7 [default = 0];</code> * @return Whether the preliminaryResultSentenceEndCostDecisionThreshold field is set. */ @java.lang.Override public boolean hasPreliminaryResultSentenceEndCostDecisionThreshold() { return ((bitField0_ & 0x00000008) != 0); } /** * <code>optional float preliminary_result_sentence_end_cost_decision_threshold = 7 [default = 0];</code> * @return The preliminaryResultSentenceEndCostDecisionThreshold. */ @java.lang.Override public float getPreliminaryResultSentenceEndCostDecisionThreshold() { return preliminaryResultSentenceEndCostDecisionThreshold_; } /** * <code>optional float preliminary_result_sentence_end_cost_decision_threshold = 7 [default = 0];</code> * @param value The preliminaryResultSentenceEndCostDecisionThreshold to set. * @return This builder for chaining. */ public Builder setPreliminaryResultSentenceEndCostDecisionThreshold(float value) { bitField0_ |= 0x00000008; preliminaryResultSentenceEndCostDecisionThreshold_ = value; onChanged(); return this; } /** * <code>optional float preliminary_result_sentence_end_cost_decision_threshold = 7 [default = 0];</code> * @return This builder for chaining. */ public Builder clearPreliminaryResultSentenceEndCostDecisionThreshold() { bitField0_ = (bitField0_ & ~0x00000008); preliminaryResultSentenceEndCostDecisionThreshold_ = 0F; onChanged(); return this; } private java.lang.Object decoderEndpointerModelFeatureStreamName_ = ""; /** * <code>optional string decoder_endpointer_model_feature_stream_name = 4;</code> * @return Whether the decoderEndpointerModelFeatureStreamName field is set. */ public boolean hasDecoderEndpointerModelFeatureStreamName() { return ((bitField0_ & 0x00000010) != 0); } /** * <code>optional string decoder_endpointer_model_feature_stream_name = 4;</code> * @return The decoderEndpointerModelFeatureStreamName. */ public java.lang.String getDecoderEndpointerModelFeatureStreamName() { java.lang.Object ref = decoderEndpointerModelFeatureStreamName_; if (!(ref instanceof java.lang.String)) { com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; java.lang.String s = bs.toStringUtf8(); if (bs.isValidUtf8()) { decoderEndpointerModelFeatureStreamName_ = s; } return s; } else { return (java.lang.String) ref; } } /** * <code>optional string decoder_endpointer_model_feature_stream_name = 4;</code> * @return The bytes for decoderEndpointerModelFeatureStreamName. */ public com.google.protobuf.ByteString getDecoderEndpointerModelFeatureStreamNameBytes() { java.lang.Object ref = decoderEndpointerModelFeatureStreamName_; if (ref instanceof String) { com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8( (java.lang.String) ref); decoderEndpointerModelFeatureStreamName_ = b; return b; } else { return (com.google.protobuf.ByteString) ref; } } /** * <code>optional string decoder_endpointer_model_feature_stream_name = 4;</code> * @param value The decoderEndpointerModelFeatureStreamName to set. * @return This builder for chaining. */ public Builder setDecoderEndpointerModelFeatureStreamName( java.lang.String value) { if (value == null) { throw new NullPointerException(); } bitField0_ |= 0x00000010; decoderEndpointerModelFeatureStreamName_ = value; onChanged(); return this; } /** * <code>optional string decoder_endpointer_model_feature_stream_name = 4;</code> * @return This builder for chaining. */ public Builder clearDecoderEndpointerModelFeatureStreamName() { bitField0_ = (bitField0_ & ~0x00000010); decoderEndpointerModelFeatureStreamName_ = getDefaultInstance().getDecoderEndpointerModelFeatureStreamName(); onChanged(); return this; } /** * <code>optional string decoder_endpointer_model_feature_stream_name = 4;</code> * @param value The bytes for decoderEndpointerModelFeatureStreamName to set. * @return This builder for chaining. */ public Builder setDecoderEndpointerModelFeatureStreamNameBytes( com.google.protobuf.ByteString value) { if (value == null) { throw new NullPointerException(); } bitField0_ |= 0x00000010; decoderEndpointerModelFeatureStreamName_ = value; onChanged(); return this; } private greco.DecoderEndpointerModelParamsOuterClass.DecoderEndpointerModelParams decoderEndpointerModelParams_; private com.google.protobuf.SingleFieldBuilderV3< greco.DecoderEndpointerModelParamsOuterClass.DecoderEndpointerModelParams, greco.DecoderEndpointerModelParamsOuterClass.DecoderEndpointerModelParams.Builder, greco.DecoderEndpointerModelParamsOuterClass.DecoderEndpointerModelParamsOrBuilder> decoderEndpointerModelParamsBuilder_; /** * <code>optional .greco.DecoderEndpointerModelParams decoder_endpointer_model_params = 5;</code> * @return Whether the decoderEndpointerModelParams field is set. */ public boolean hasDecoderEndpointerModelParams() { return ((bitField0_ & 0x00000020) != 0); } /** * <code>optional .greco.DecoderEndpointerModelParams decoder_endpointer_model_params = 5;</code> * @return The decoderEndpointerModelParams. */ public greco.DecoderEndpointerModelParamsOuterClass.DecoderEndpointerModelParams getDecoderEndpointerModelParams() { if (decoderEndpointerModelParamsBuilder_ == null) { return decoderEndpointerModelParams_ == null ? greco.DecoderEndpointerModelParamsOuterClass.DecoderEndpointerModelParams.getDefaultInstance() : decoderEndpointerModelParams_; } else { return decoderEndpointerModelParamsBuilder_.getMessage(); } } /** * <code>optional .greco.DecoderEndpointerModelParams decoder_endpointer_model_params = 5;</code> */ public Builder setDecoderEndpointerModelParams(greco.DecoderEndpointerModelParamsOuterClass.DecoderEndpointerModelParams value) { if (decoderEndpointerModelParamsBuilder_ == null) { if (value == null) { throw new NullPointerException(); } decoderEndpointerModelParams_ = value; onChanged(); } else { decoderEndpointerModelParamsBuilder_.setMessage(value); } bitField0_ |= 0x00000020; return this; } /** * <code>optional .greco.DecoderEndpointerModelParams decoder_endpointer_model_params = 5;</code> */ public Builder setDecoderEndpointerModelParams( greco.DecoderEndpointerModelParamsOuterClass.DecoderEndpointerModelParams.Builder builderForValue) { if (decoderEndpointerModelParamsBuilder_ == null) { decoderEndpointerModelParams_ = builderForValue.build(); onChanged(); } else { decoderEndpointerModelParamsBuilder_.setMessage(builderForValue.build()); } bitField0_ |= 0x00000020; return this; } /** * <code>optional .greco.DecoderEndpointerModelParams decoder_endpointer_model_params = 5;</code> */ public Builder mergeDecoderEndpointerModelParams(greco.DecoderEndpointerModelParamsOuterClass.DecoderEndpointerModelParams value) { if (decoderEndpointerModelParamsBuilder_ == null) { if (((bitField0_ & 0x00000020) != 0) && decoderEndpointerModelParams_ != null && decoderEndpointerModelParams_ != greco.DecoderEndpointerModelParamsOuterClass.DecoderEndpointerModelParams.getDefaultInstance()) { decoderEndpointerModelParams_ = greco.DecoderEndpointerModelParamsOuterClass.DecoderEndpointerModelParams.newBuilder(decoderEndpointerModelParams_).mergeFrom(value).buildPartial(); } else { decoderEndpointerModelParams_ = value; } onChanged(); } else { decoderEndpointerModelParamsBuilder_.mergeFrom(value); } bitField0_ |= 0x00000020; return this; } /** * <code>optional .greco.DecoderEndpointerModelParams decoder_endpointer_model_params = 5;</code> */ public Builder clearDecoderEndpointerModelParams() { if (decoderEndpointerModelParamsBuilder_ == null) { decoderEndpointerModelParams_ = null; onChanged(); } else { decoderEndpointerModelParamsBuilder_.clear(); } bitField0_ = (bitField0_ & ~0x00000020); return this; } /** * <code>optional .greco.DecoderEndpointerModelParams decoder_endpointer_model_params = 5;</code> */ public greco.DecoderEndpointerModelParamsOuterClass.DecoderEndpointerModelParams.Builder getDecoderEndpointerModelParamsBuilder() { bitField0_ |= 0x00000020; onChanged(); return getDecoderEndpointerModelParamsFieldBuilder().getBuilder(); } /** * <code>optional .greco.DecoderEndpointerModelParams decoder_endpointer_model_params = 5;</code> */ public greco.DecoderEndpointerModelParamsOuterClass.DecoderEndpointerModelParamsOrBuilder getDecoderEndpointerModelParamsOrBuilder() { if (decoderEndpointerModelParamsBuilder_ != null) { return decoderEndpointerModelParamsBuilder_.getMessageOrBuilder(); } else { return decoderEndpointerModelParams_ == null ? greco.DecoderEndpointerModelParamsOuterClass.DecoderEndpointerModelParams.getDefaultInstance() : decoderEndpointerModelParams_; } } /** * <code>optional .greco.DecoderEndpointerModelParams decoder_endpointer_model_params = 5;</code> */ private com.google.protobuf.SingleFieldBuilderV3< greco.DecoderEndpointerModelParamsOuterClass.DecoderEndpointerModelParams, greco.DecoderEndpointerModelParamsOuterClass.DecoderEndpointerModelParams.Builder, greco.DecoderEndpointerModelParamsOuterClass.DecoderEndpointerModelParamsOrBuilder> getDecoderEndpointerModelParamsFieldBuilder() { if (decoderEndpointerModelParamsBuilder_ == null) { decoderEndpointerModelParamsBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< greco.DecoderEndpointerModelParamsOuterClass.DecoderEndpointerModelParams, greco.DecoderEndpointerModelParamsOuterClass.DecoderEndpointerModelParams.Builder, greco.DecoderEndpointerModelParamsOuterClass.DecoderEndpointerModelParamsOrBuilder>( getDecoderEndpointerModelParams(), getParentForChildren(), isClean()); decoderEndpointerModelParams_ = null; } return decoderEndpointerModelParamsBuilder_; } private boolean emitEndOfSpeechBeforeEndOfUtterance_ ; /** * <code>optional bool emit_end_of_speech_before_end_of_utterance = 6;</code> * @return Whether the emitEndOfSpeechBeforeEndOfUtterance field is set. */ @java.lang.Override public boolean hasEmitEndOfSpeechBeforeEndOfUtterance() { return ((bitField0_ & 0x00000040) != 0); } /** * <code>optional bool emit_end_of_speech_before_end_of_utterance = 6;</code> * @return The emitEndOfSpeechBeforeEndOfUtterance. */ @java.lang.Override public boolean getEmitEndOfSpeechBeforeEndOfUtterance() { return emitEndOfSpeechBeforeEndOfUtterance_; } /** * <code>optional bool emit_end_of_speech_before_end_of_utterance = 6;</code> * @param value The emitEndOfSpeechBeforeEndOfUtterance to set. * @return This builder for chaining. */ public Builder setEmitEndOfSpeechBeforeEndOfUtterance(boolean value) { bitField0_ |= 0x00000040; emitEndOfSpeechBeforeEndOfUtterance_ = value; onChanged(); return this; } /** * <code>optional bool emit_end_of_speech_before_end_of_utterance = 6;</code> * @return This builder for chaining. */ public Builder clearEmitEndOfSpeechBeforeEndOfUtterance() { bitField0_ = (bitField0_ & ~0x00000040); emitEndOfSpeechBeforeEndOfUtterance_ = false; onChanged(); return this; } @java.lang.Override public final Builder setUnknownFields( final com.google.protobuf.UnknownFieldSet unknownFields) { return super.setUnknownFields(unknownFields); } @java.lang.Override public final Builder mergeUnknownFields( final com.google.protobuf.UnknownFieldSet unknownFields) { return super.mergeUnknownFields(unknownFields); } // @@protoc_insertion_point(builder_scope:greco.DecoderEndpointerStreamParams) } // @@protoc_insertion_point(class_scope:greco.DecoderEndpointerStreamParams) private static final greco.DecoderEndpointerStreamParamsOuterClass.DecoderEndpointerStreamParams DEFAULT_INSTANCE; static { DEFAULT_INSTANCE = new greco.DecoderEndpointerStreamParamsOuterClass.DecoderEndpointerStreamParams(); } public static greco.DecoderEndpointerStreamParamsOuterClass.DecoderEndpointerStreamParams getDefaultInstance() { return DEFAULT_INSTANCE; } @java.lang.Deprecated public static final com.google.protobuf.Parser<DecoderEndpointerStreamParams> PARSER = new com.google.protobuf.AbstractParser<DecoderEndpointerStreamParams>() { @java.lang.Override public DecoderEndpointerStreamParams parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { Builder builder = newBuilder(); try { builder.mergeFrom(input, extensionRegistry); } catch (com.google.protobuf.InvalidProtocolBufferException e) { throw e.setUnfinishedMessage(builder.buildPartial()); } catch (java.io.IOException e) { throw new com.google.protobuf.InvalidProtocolBufferException( e.getMessage()).setUnfinishedMessage( builder.buildPartial()); } return builder.buildPartial(); } }; public static com.google.protobuf.Parser<DecoderEndpointerStreamParams> parser() { return PARSER; } @java.lang.Override public com.google.protobuf.Parser<DecoderEndpointerStreamParams> getParserForType() { return PARSER; } @java.lang.Override public greco.DecoderEndpointerStreamParamsOuterClass.DecoderEndpointerStreamParams getDefaultInstanceForType() { return DEFAULT_INSTANCE; } public static final int ID_FIELD_NUMBER = 107528824; /** * <code>extend .greco.Params { ... }</code> */ public static final com.google.protobuf.GeneratedMessage.GeneratedExtension< greco.ParamsProto.Params, greco.DecoderEndpointerStreamParamsOuterClass.DecoderEndpointerStreamParams> id = com.google.protobuf.GeneratedMessage .newMessageScopedGeneratedExtension( greco.DecoderEndpointerStreamParamsOuterClass.DecoderEndpointerStreamParams.getDefaultInstance(), 0, greco.DecoderEndpointerStreamParamsOuterClass.DecoderEndpointerStreamParams.class, greco.DecoderEndpointerStreamParamsOuterClass.DecoderEndpointerStreamParams.getDefaultInstance()); } @java.lang.Deprecated public interface EndpointOnDummyEventsOrBuilder extends // @@protoc_insertion_point(interface_extends:greco.EndpointOnDummyEvents) com.google.protobuf.MessageOrBuilder { } /** * Protobuf type {@code greco.EndpointOnDummyEvents} */ @java.lang.Deprecated public static final class EndpointOnDummyEvents extends com.google.protobuf.GeneratedMessageV3 implements // @@protoc_insertion_point(message_implements:greco.EndpointOnDummyEvents) EndpointOnDummyEventsOrBuilder { private static final long serialVersionUID = 0L; // Use EndpointOnDummyEvents.newBuilder() to construct. private EndpointOnDummyEvents(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) { super(builder); } private EndpointOnDummyEvents() { } @java.lang.Override @SuppressWarnings({"unused"}) protected java.lang.Object newInstance( UnusedPrivateParameter unused) { return new EndpointOnDummyEvents(); } @java.lang.Override public final com.google.protobuf.UnknownFieldSet getUnknownFields() { return this.unknownFields; } public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return greco.DecoderEndpointerStreamParamsOuterClass.internal_static_greco_EndpointOnDummyEvents_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { return greco.DecoderEndpointerStreamParamsOuterClass.internal_static_greco_EndpointOnDummyEvents_fieldAccessorTable .ensureFieldAccessorsInitialized( greco.DecoderEndpointerStreamParamsOuterClass.EndpointOnDummyEvents.class, greco.DecoderEndpointerStreamParamsOuterClass.EndpointOnDummyEvents.Builder.class); } public static greco.DecoderEndpointerStreamParamsOuterClass.EndpointOnDummyEvents parseFrom( java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } public static greco.DecoderEndpointerStreamParamsOuterClass.EndpointOnDummyEvents parseFrom( java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } public static greco.DecoderEndpointerStreamParamsOuterClass.EndpointOnDummyEvents parseFrom( com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } public static greco.DecoderEndpointerStreamParamsOuterClass.EndpointOnDummyEvents parseFrom( com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } public static greco.DecoderEndpointerStreamParamsOuterClass.EndpointOnDummyEvents parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } public static greco.DecoderEndpointerStreamParamsOuterClass.EndpointOnDummyEvents parseFrom( byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } public static greco.DecoderEndpointerStreamParamsOuterClass.EndpointOnDummyEvents parseFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input); } public static greco.DecoderEndpointerStreamParamsOuterClass.EndpointOnDummyEvents parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input, extensionRegistry); } public static greco.DecoderEndpointerStreamParamsOuterClass.EndpointOnDummyEvents parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseDelimitedWithIOException(PARSER, input); } public static greco.DecoderEndpointerStreamParamsOuterClass.EndpointOnDummyEvents parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseDelimitedWithIOException(PARSER, input, extensionRegistry); } public static greco.DecoderEndpointerStreamParamsOuterClass.EndpointOnDummyEvents parseFrom( com.google.protobuf.CodedInputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input); } public static greco.DecoderEndpointerStreamParamsOuterClass.EndpointOnDummyEvents parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input, extensionRegistry); } @java.lang.Override public Builder newBuilderForType() { return newBuilder(); } public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } public static Builder newBuilder(greco.DecoderEndpointerStreamParamsOuterClass.EndpointOnDummyEvents 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; } /** * Protobuf type {@code greco.EndpointOnDummyEvents} */ public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder<Builder> implements // @@protoc_insertion_point(builder_implements:greco.EndpointOnDummyEvents) greco.DecoderEndpointerStreamParamsOuterClass.EndpointOnDummyEventsOrBuilder { public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return greco.DecoderEndpointerStreamParamsOuterClass.internal_static_greco_EndpointOnDummyEvents_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { return greco.DecoderEndpointerStreamParamsOuterClass.internal_static_greco_EndpointOnDummyEvents_fieldAccessorTable .ensureFieldAccessorsInitialized( greco.DecoderEndpointerStreamParamsOuterClass.EndpointOnDummyEvents.class, greco.DecoderEndpointerStreamParamsOuterClass.EndpointOnDummyEvents.Builder.class); } // Construct using greco.DecoderEndpointerStreamParamsOuterClass.EndpointOnDummyEvents.newBuilder() private Builder() { maybeForceBuilderInitialization(); } private Builder( com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { super(parent); maybeForceBuilderInitialization(); } private void maybeForceBuilderInitialization() { if (com.google.protobuf.GeneratedMessageV3 .alwaysUseFieldBuilders) { } } @java.lang.Override public Builder clear() { super.clear(); return this; } @java.lang.Override public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { return greco.DecoderEndpointerStreamParamsOuterClass.internal_static_greco_EndpointOnDummyEvents_descriptor; } @java.lang.Override public greco.DecoderEndpointerStreamParamsOuterClass.EndpointOnDummyEvents getDefaultInstanceForType() { return greco.DecoderEndpointerStreamParamsOuterClass.EndpointOnDummyEvents.getDefaultInstance(); } @java.lang.Override public greco.DecoderEndpointerStreamParamsOuterClass.EndpointOnDummyEvents build() { greco.DecoderEndpointerStreamParamsOuterClass.EndpointOnDummyEvents result = buildPartial(); if (!result.isInitialized()) { throw newUninitializedMessageException(result); } return result; } @java.lang.Override public greco.DecoderEndpointerStreamParamsOuterClass.EndpointOnDummyEvents buildPartial() { greco.DecoderEndpointerStreamParamsOuterClass.EndpointOnDummyEvents result = new greco.DecoderEndpointerStreamParamsOuterClass.EndpointOnDummyEvents(this); onBuilt(); return result; } @java.lang.Override public Builder clone() { return super.clone(); } @java.lang.Override public Builder setField( com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { return super.setField(field, value); } @java.lang.Override public Builder clearField( com.google.protobuf.Descriptors.FieldDescriptor field) { return super.clearField(field); } @java.lang.Override public Builder clearOneof( com.google.protobuf.Descriptors.OneofDescriptor oneof) { return super.clearOneof(oneof); } @java.lang.Override public Builder setRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { return super.setRepeatedField(field, index, value); } @java.lang.Override public Builder addRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { return super.addRepeatedField(field, value); } @java.lang.Override public final Builder setUnknownFields( final com.google.protobuf.UnknownFieldSet unknownFields) { return super.setUnknownFields(unknownFields); } @java.lang.Override public final Builder mergeUnknownFields( final com.google.protobuf.UnknownFieldSet unknownFields) { return super.mergeUnknownFields(unknownFields); } // @@protoc_insertion_point(builder_scope:greco.EndpointOnDummyEvents) } // @@protoc_insertion_point(class_scope:greco.EndpointOnDummyEvents) private static final greco.DecoderEndpointerStreamParamsOuterClass.EndpointOnDummyEvents DEFAULT_INSTANCE; static { DEFAULT_INSTANCE = new greco.DecoderEndpointerStreamParamsOuterClass.EndpointOnDummyEvents(); } public static greco.DecoderEndpointerStreamParamsOuterClass.EndpointOnDummyEvents getDefaultInstance() { return DEFAULT_INSTANCE; } @java.lang.Deprecated public static final com.google.protobuf.Parser<EndpointOnDummyEvents> PARSER = new com.google.protobuf.AbstractParser<EndpointOnDummyEvents>() { @java.lang.Override public EndpointOnDummyEvents parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { Builder builder = newBuilder(); try { builder.mergeFrom(input, extensionRegistry); } catch (com.google.protobuf.InvalidProtocolBufferException e) { throw e.setUnfinishedMessage(builder.buildPartial()); } catch (java.io.IOException e) { throw new com.google.protobuf.InvalidProtocolBufferException( e.getMessage()).setUnfinishedMessage( builder.buildPartial()); } return builder.buildPartial(); } }; public static com.google.protobuf.Parser<EndpointOnDummyEvents> parser() { return PARSER; } @java.lang.Override public com.google.protobuf.Parser<EndpointOnDummyEvents> getParserForType() { return PARSER; } @java.lang.Override public greco.DecoderEndpointerStreamParamsOuterClass.EndpointOnDummyEvents getDefaultInstanceForType() { return DEFAULT_INSTANCE; } public static final int ID_FIELD_NUMBER = 114998299; /** * <code>extend .greco.Params { ... }</code> */ public static final com.google.protobuf.GeneratedMessage.GeneratedExtension< greco.ParamsProto.Params, greco.DecoderEndpointerStreamParamsOuterClass.EndpointOnDummyEvents> id = com.google.protobuf.GeneratedMessage .newMessageScopedGeneratedExtension( greco.DecoderEndpointerStreamParamsOuterClass.EndpointOnDummyEvents.getDefaultInstance(), 0, greco.DecoderEndpointerStreamParamsOuterClass.EndpointOnDummyEvents.class, greco.DecoderEndpointerStreamParamsOuterClass.EndpointOnDummyEvents.getDefaultInstance()); } public interface EndpointOnFrameTimeForInitialSilenceOrBuilder extends // @@protoc_insertion_point(interface_extends:greco.EndpointOnFrameTimeForInitialSilence) com.google.protobuf.MessageOrBuilder { } /** * Protobuf type {@code greco.EndpointOnFrameTimeForInitialSilence} */ public static final class EndpointOnFrameTimeForInitialSilence extends com.google.protobuf.GeneratedMessageV3 implements // @@protoc_insertion_point(message_implements:greco.EndpointOnFrameTimeForInitialSilence) EndpointOnFrameTimeForInitialSilenceOrBuilder { private static final long serialVersionUID = 0L; // Use EndpointOnFrameTimeForInitialSilence.newBuilder() to construct. private EndpointOnFrameTimeForInitialSilence(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) { super(builder); } private EndpointOnFrameTimeForInitialSilence() { } @java.lang.Override @SuppressWarnings({"unused"}) protected java.lang.Object newInstance( UnusedPrivateParameter unused) { return new EndpointOnFrameTimeForInitialSilence(); } @java.lang.Override public final com.google.protobuf.UnknownFieldSet getUnknownFields() { return this.unknownFields; } public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return greco.DecoderEndpointerStreamParamsOuterClass.internal_static_greco_EndpointOnFrameTimeForInitialSilence_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { return greco.DecoderEndpointerStreamParamsOuterClass.internal_static_greco_EndpointOnFrameTimeForInitialSilence_fieldAccessorTable .ensureFieldAccessorsInitialized( greco.DecoderEndpointerStreamParamsOuterClass.EndpointOnFrameTimeForInitialSilence.class, greco.DecoderEndpointerStreamParamsOuterClass.EndpointOnFrameTimeForInitialSilence.Builder.class); } public static greco.DecoderEndpointerStreamParamsOuterClass.EndpointOnFrameTimeForInitialSilence parseFrom( java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } public static greco.DecoderEndpointerStreamParamsOuterClass.EndpointOnFrameTimeForInitialSilence parseFrom( java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } public static greco.DecoderEndpointerStreamParamsOuterClass.EndpointOnFrameTimeForInitialSilence parseFrom( com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } public static greco.DecoderEndpointerStreamParamsOuterClass.EndpointOnFrameTimeForInitialSilence parseFrom( com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } public static greco.DecoderEndpointerStreamParamsOuterClass.EndpointOnFrameTimeForInitialSilence parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } public static greco.DecoderEndpointerStreamParamsOuterClass.EndpointOnFrameTimeForInitialSilence parseFrom( byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } public static greco.DecoderEndpointerStreamParamsOuterClass.EndpointOnFrameTimeForInitialSilence parseFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input); } public static greco.DecoderEndpointerStreamParamsOuterClass.EndpointOnFrameTimeForInitialSilence parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input, extensionRegistry); } public static greco.DecoderEndpointerStreamParamsOuterClass.EndpointOnFrameTimeForInitialSilence parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseDelimitedWithIOException(PARSER, input); } public static greco.DecoderEndpointerStreamParamsOuterClass.EndpointOnFrameTimeForInitialSilence parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseDelimitedWithIOException(PARSER, input, extensionRegistry); } public static greco.DecoderEndpointerStreamParamsOuterClass.EndpointOnFrameTimeForInitialSilence parseFrom( com.google.protobuf.CodedInputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input); } public static greco.DecoderEndpointerStreamParamsOuterClass.EndpointOnFrameTimeForInitialSilence parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input, extensionRegistry); } @java.lang.Override public Builder newBuilderForType() { return newBuilder(); } public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } public static Builder newBuilder(greco.DecoderEndpointerStreamParamsOuterClass.EndpointOnFrameTimeForInitialSilence 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; } /** * Protobuf type {@code greco.EndpointOnFrameTimeForInitialSilence} */ public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder<Builder> implements // @@protoc_insertion_point(builder_implements:greco.EndpointOnFrameTimeForInitialSilence) greco.DecoderEndpointerStreamParamsOuterClass.EndpointOnFrameTimeForInitialSilenceOrBuilder { public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return greco.DecoderEndpointerStreamParamsOuterClass.internal_static_greco_EndpointOnFrameTimeForInitialSilence_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { return greco.DecoderEndpointerStreamParamsOuterClass.internal_static_greco_EndpointOnFrameTimeForInitialSilence_fieldAccessorTable .ensureFieldAccessorsInitialized( greco.DecoderEndpointerStreamParamsOuterClass.EndpointOnFrameTimeForInitialSilence.class, greco.DecoderEndpointerStreamParamsOuterClass.EndpointOnFrameTimeForInitialSilence.Builder.class); } // Construct using greco.DecoderEndpointerStreamParamsOuterClass.EndpointOnFrameTimeForInitialSilence.newBuilder() private Builder() { maybeForceBuilderInitialization(); } private Builder( com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { super(parent); maybeForceBuilderInitialization(); } private void maybeForceBuilderInitialization() { if (com.google.protobuf.GeneratedMessageV3 .alwaysUseFieldBuilders) { } } @java.lang.Override public Builder clear() { super.clear(); return this; } @java.lang.Override public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { return greco.DecoderEndpointerStreamParamsOuterClass.internal_static_greco_EndpointOnFrameTimeForInitialSilence_descriptor; } @java.lang.Override public greco.DecoderEndpointerStreamParamsOuterClass.EndpointOnFrameTimeForInitialSilence getDefaultInstanceForType() { return greco.DecoderEndpointerStreamParamsOuterClass.EndpointOnFrameTimeForInitialSilence.getDefaultInstance(); } @java.lang.Override public greco.DecoderEndpointerStreamParamsOuterClass.EndpointOnFrameTimeForInitialSilence build() { greco.DecoderEndpointerStreamParamsOuterClass.EndpointOnFrameTimeForInitialSilence result = buildPartial(); if (!result.isInitialized()) { throw newUninitializedMessageException(result); } return result; } @java.lang.Override public greco.DecoderEndpointerStreamParamsOuterClass.EndpointOnFrameTimeForInitialSilence buildPartial() { greco.DecoderEndpointerStreamParamsOuterClass.EndpointOnFrameTimeForInitialSilence result = new greco.DecoderEndpointerStreamParamsOuterClass.EndpointOnFrameTimeForInitialSilence(this); onBuilt(); return result; } @java.lang.Override public Builder clone() { return super.clone(); } @java.lang.Override public Builder setField( com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { return super.setField(field, value); } @java.lang.Override public Builder clearField( com.google.protobuf.Descriptors.FieldDescriptor field) { return super.clearField(field); } @java.lang.Override public Builder clearOneof( com.google.protobuf.Descriptors.OneofDescriptor oneof) { return super.clearOneof(oneof); } @java.lang.Override public Builder setRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { return super.setRepeatedField(field, index, value); } @java.lang.Override public Builder addRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { return super.addRepeatedField(field, value); } @java.lang.Override public final Builder setUnknownFields( final com.google.protobuf.UnknownFieldSet unknownFields) { return super.setUnknownFields(unknownFields); } @java.lang.Override public final Builder mergeUnknownFields( final com.google.protobuf.UnknownFieldSet unknownFields) { return super.mergeUnknownFields(unknownFields); } // @@protoc_insertion_point(builder_scope:greco.EndpointOnFrameTimeForInitialSilence) } // @@protoc_insertion_point(class_scope:greco.EndpointOnFrameTimeForInitialSilence) private static final greco.DecoderEndpointerStreamParamsOuterClass.EndpointOnFrameTimeForInitialSilence DEFAULT_INSTANCE; static { DEFAULT_INSTANCE = new greco.DecoderEndpointerStreamParamsOuterClass.EndpointOnFrameTimeForInitialSilence(); } public static greco.DecoderEndpointerStreamParamsOuterClass.EndpointOnFrameTimeForInitialSilence getDefaultInstance() { return DEFAULT_INSTANCE; } @java.lang.Deprecated public static final com.google.protobuf.Parser<EndpointOnFrameTimeForInitialSilence> PARSER = new com.google.protobuf.AbstractParser<EndpointOnFrameTimeForInitialSilence>() { @java.lang.Override public EndpointOnFrameTimeForInitialSilence parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { Builder builder = newBuilder(); try { builder.mergeFrom(input, extensionRegistry); } catch (com.google.protobuf.InvalidProtocolBufferException e) { throw e.setUnfinishedMessage(builder.buildPartial()); } catch (java.io.IOException e) { throw new com.google.protobuf.InvalidProtocolBufferException( e.getMessage()).setUnfinishedMessage( builder.buildPartial()); } return builder.buildPartial(); } }; public static com.google.protobuf.Parser<EndpointOnFrameTimeForInitialSilence> parser() { return PARSER; } @java.lang.Override public com.google.protobuf.Parser<EndpointOnFrameTimeForInitialSilence> getParserForType() { return PARSER; } @java.lang.Override public greco.DecoderEndpointerStreamParamsOuterClass.EndpointOnFrameTimeForInitialSilence getDefaultInstanceForType() { return DEFAULT_INSTANCE; } public static final int ID_FIELD_NUMBER = 127479911; /** * <code>extend .greco.Params { ... }</code> */ public static final com.google.protobuf.GeneratedMessage.GeneratedExtension< greco.ParamsProto.Params, greco.DecoderEndpointerStreamParamsOuterClass.EndpointOnFrameTimeForInitialSilence> id = com.google.protobuf.GeneratedMessage .newMessageScopedGeneratedExtension( greco.DecoderEndpointerStreamParamsOuterClass.EndpointOnFrameTimeForInitialSilence.getDefaultInstance(), 0, greco.DecoderEndpointerStreamParamsOuterClass.EndpointOnFrameTimeForInitialSilence.class, greco.DecoderEndpointerStreamParamsOuterClass.EndpointOnFrameTimeForInitialSilence.getDefaultInstance()); } @java.lang.Deprecated public interface AddSilenceBeforeFirstSpeechOrBuilder extends // @@protoc_insertion_point(interface_extends:greco.AddSilenceBeforeFirstSpeech) com.google.protobuf.MessageOrBuilder { } /** * Protobuf type {@code greco.AddSilenceBeforeFirstSpeech} */ @java.lang.Deprecated public static final class AddSilenceBeforeFirstSpeech extends com.google.protobuf.GeneratedMessageV3 implements // @@protoc_insertion_point(message_implements:greco.AddSilenceBeforeFirstSpeech) AddSilenceBeforeFirstSpeechOrBuilder { private static final long serialVersionUID = 0L; // Use AddSilenceBeforeFirstSpeech.newBuilder() to construct. private AddSilenceBeforeFirstSpeech(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) { super(builder); } private AddSilenceBeforeFirstSpeech() { } @java.lang.Override @SuppressWarnings({"unused"}) protected java.lang.Object newInstance( UnusedPrivateParameter unused) { return new AddSilenceBeforeFirstSpeech(); } @java.lang.Override public final com.google.protobuf.UnknownFieldSet getUnknownFields() { return this.unknownFields; } public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return greco.DecoderEndpointerStreamParamsOuterClass.internal_static_greco_AddSilenceBeforeFirstSpeech_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { return greco.DecoderEndpointerStreamParamsOuterClass.internal_static_greco_AddSilenceBeforeFirstSpeech_fieldAccessorTable .ensureFieldAccessorsInitialized( greco.DecoderEndpointerStreamParamsOuterClass.AddSilenceBeforeFirstSpeech.class, greco.DecoderEndpointerStreamParamsOuterClass.AddSilenceBeforeFirstSpeech.Builder.class); } public static greco.DecoderEndpointerStreamParamsOuterClass.AddSilenceBeforeFirstSpeech parseFrom( java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } public static greco.DecoderEndpointerStreamParamsOuterClass.AddSilenceBeforeFirstSpeech parseFrom( java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } public static greco.DecoderEndpointerStreamParamsOuterClass.AddSilenceBeforeFirstSpeech parseFrom( com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } public static greco.DecoderEndpointerStreamParamsOuterClass.AddSilenceBeforeFirstSpeech parseFrom( com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } public static greco.DecoderEndpointerStreamParamsOuterClass.AddSilenceBeforeFirstSpeech parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } public static greco.DecoderEndpointerStreamParamsOuterClass.AddSilenceBeforeFirstSpeech parseFrom( byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } public static greco.DecoderEndpointerStreamParamsOuterClass.AddSilenceBeforeFirstSpeech parseFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input); } public static greco.DecoderEndpointerStreamParamsOuterClass.AddSilenceBeforeFirstSpeech parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input, extensionRegistry); } public static greco.DecoderEndpointerStreamParamsOuterClass.AddSilenceBeforeFirstSpeech parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseDelimitedWithIOException(PARSER, input); } public static greco.DecoderEndpointerStreamParamsOuterClass.AddSilenceBeforeFirstSpeech parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseDelimitedWithIOException(PARSER, input, extensionRegistry); } public static greco.DecoderEndpointerStreamParamsOuterClass.AddSilenceBeforeFirstSpeech parseFrom( com.google.protobuf.CodedInputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input); } public static greco.DecoderEndpointerStreamParamsOuterClass.AddSilenceBeforeFirstSpeech parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input, extensionRegistry); } @java.lang.Override public Builder newBuilderForType() { return newBuilder(); } public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } public static Builder newBuilder(greco.DecoderEndpointerStreamParamsOuterClass.AddSilenceBeforeFirstSpeech 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; } /** * Protobuf type {@code greco.AddSilenceBeforeFirstSpeech} */ public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder<Builder> implements // @@protoc_insertion_point(builder_implements:greco.AddSilenceBeforeFirstSpeech) greco.DecoderEndpointerStreamParamsOuterClass.AddSilenceBeforeFirstSpeechOrBuilder { public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return greco.DecoderEndpointerStreamParamsOuterClass.internal_static_greco_AddSilenceBeforeFirstSpeech_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { return greco.DecoderEndpointerStreamParamsOuterClass.internal_static_greco_AddSilenceBeforeFirstSpeech_fieldAccessorTable .ensureFieldAccessorsInitialized( greco.DecoderEndpointerStreamParamsOuterClass.AddSilenceBeforeFirstSpeech.class, greco.DecoderEndpointerStreamParamsOuterClass.AddSilenceBeforeFirstSpeech.Builder.class); } // Construct using greco.DecoderEndpointerStreamParamsOuterClass.AddSilenceBeforeFirstSpeech.newBuilder() private Builder() { maybeForceBuilderInitialization(); } private Builder( com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { super(parent); maybeForceBuilderInitialization(); } private void maybeForceBuilderInitialization() { if (com.google.protobuf.GeneratedMessageV3 .alwaysUseFieldBuilders) { } } @java.lang.Override public Builder clear() { super.clear(); return this; } @java.lang.Override public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { return greco.DecoderEndpointerStreamParamsOuterClass.internal_static_greco_AddSilenceBeforeFirstSpeech_descriptor; } @java.lang.Override public greco.DecoderEndpointerStreamParamsOuterClass.AddSilenceBeforeFirstSpeech getDefaultInstanceForType() { return greco.DecoderEndpointerStreamParamsOuterClass.AddSilenceBeforeFirstSpeech.getDefaultInstance(); } @java.lang.Override public greco.DecoderEndpointerStreamParamsOuterClass.AddSilenceBeforeFirstSpeech build() { greco.DecoderEndpointerStreamParamsOuterClass.AddSilenceBeforeFirstSpeech result = buildPartial(); if (!result.isInitialized()) { throw newUninitializedMessageException(result); } return result; } @java.lang.Override public greco.DecoderEndpointerStreamParamsOuterClass.AddSilenceBeforeFirstSpeech buildPartial() { greco.DecoderEndpointerStreamParamsOuterClass.AddSilenceBeforeFirstSpeech result = new greco.DecoderEndpointerStreamParamsOuterClass.AddSilenceBeforeFirstSpeech(this); onBuilt(); return result; } @java.lang.Override public Builder clone() { return super.clone(); } @java.lang.Override public Builder setField( com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { return super.setField(field, value); } @java.lang.Override public Builder clearField( com.google.protobuf.Descriptors.FieldDescriptor field) { return super.clearField(field); } @java.lang.Override public Builder clearOneof( com.google.protobuf.Descriptors.OneofDescriptor oneof) { return super.clearOneof(oneof); } @java.lang.Override public Builder setRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { return super.setRepeatedField(field, index, value); } @java.lang.Override public Builder addRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { return super.addRepeatedField(field, value); } @java.lang.Override public final Builder setUnknownFields( final com.google.protobuf.UnknownFieldSet unknownFields) { return super.setUnknownFields(unknownFields); } @java.lang.Override public final Builder mergeUnknownFields( final com.google.protobuf.UnknownFieldSet unknownFields) { return super.mergeUnknownFields(unknownFields); } // @@protoc_insertion_point(builder_scope:greco.AddSilenceBeforeFirstSpeech) } // @@protoc_insertion_point(class_scope:greco.AddSilenceBeforeFirstSpeech) private static final greco.DecoderEndpointerStreamParamsOuterClass.AddSilenceBeforeFirstSpeech DEFAULT_INSTANCE; static { DEFAULT_INSTANCE = new greco.DecoderEndpointerStreamParamsOuterClass.AddSilenceBeforeFirstSpeech(); } public static greco.DecoderEndpointerStreamParamsOuterClass.AddSilenceBeforeFirstSpeech getDefaultInstance() { return DEFAULT_INSTANCE; } @java.lang.Deprecated public static final com.google.protobuf.Parser<AddSilenceBeforeFirstSpeech> PARSER = new com.google.protobuf.AbstractParser<AddSilenceBeforeFirstSpeech>() { @java.lang.Override public AddSilenceBeforeFirstSpeech parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { Builder builder = newBuilder(); try { builder.mergeFrom(input, extensionRegistry); } catch (com.google.protobuf.InvalidProtocolBufferException e) { throw e.setUnfinishedMessage(builder.buildPartial()); } catch (java.io.IOException e) { throw new com.google.protobuf.InvalidProtocolBufferException( e.getMessage()).setUnfinishedMessage( builder.buildPartial()); } return builder.buildPartial(); } }; public static com.google.protobuf.Parser<AddSilenceBeforeFirstSpeech> parser() { return PARSER; } @java.lang.Override public com.google.protobuf.Parser<AddSilenceBeforeFirstSpeech> getParserForType() { return PARSER; } @java.lang.Override public greco.DecoderEndpointerStreamParamsOuterClass.AddSilenceBeforeFirstSpeech getDefaultInstanceForType() { return DEFAULT_INSTANCE; } public static final int ID_FIELD_NUMBER = 114989147; /** * <code>extend .greco.Params { ... }</code> */ public static final com.google.protobuf.GeneratedMessage.GeneratedExtension< greco.ParamsProto.Params, greco.DecoderEndpointerStreamParamsOuterClass.AddSilenceBeforeFirstSpeech> id = com.google.protobuf.GeneratedMessage .newMessageScopedGeneratedExtension( greco.DecoderEndpointerStreamParamsOuterClass.AddSilenceBeforeFirstSpeech.getDefaultInstance(), 0, greco.DecoderEndpointerStreamParamsOuterClass.AddSilenceBeforeFirstSpeech.class, greco.DecoderEndpointerStreamParamsOuterClass.AddSilenceBeforeFirstSpeech.getDefaultInstance()); } private static final com.google.protobuf.Descriptors.Descriptor internal_static_greco_DecoderEndpointerStreamParams_descriptor; private static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internal_static_greco_DecoderEndpointerStreamParams_fieldAccessorTable; private static final com.google.protobuf.Descriptors.Descriptor internal_static_greco_EndpointOnDummyEvents_descriptor; private static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internal_static_greco_EndpointOnDummyEvents_fieldAccessorTable; private static final com.google.protobuf.Descriptors.Descriptor internal_static_greco_EndpointOnFrameTimeForInitialSilence_descriptor; private static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internal_static_greco_EndpointOnFrameTimeForInitialSilence_fieldAccessorTable; private static final com.google.protobuf.Descriptors.Descriptor internal_static_greco_AddSilenceBeforeFirstSpeech_descriptor; private static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internal_static_greco_AddSilenceBeforeFirstSpeech_fieldAccessorTable; public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { return descriptor; } private static com.google.protobuf.Descriptors.FileDescriptor descriptor; static { java.lang.String[] descriptorData = { "\nGspeech/greco3/decoder_endpointer/decod" + "er_endpointer_stream_params.proto\022\005greco" + "\032\037speech/greco3/core/params.proto\032Fspeec" + "h/greco3/decoder_endpointer/decoder_endp" + "ointer_model_params.proto\"\331\003\n\035DecoderEnd" + "pointerStreamParams\022\036\n\026mic_closer_stream" + "_name\030\001 \001(\t\022\036\n\026prefetcher_stream_name\030\002 " + "\001(\t\0228\n0preliminary_result_acoustic_silen" + "ce_threshold_ms\030\003 \001(\005\022B\n7preliminary_res" + "ult_sentence_end_cost_decision_threshold" + "\030\007 \001(\002:\0010\0224\n,decoder_endpointer_model_fe" + "ature_stream_name\030\004 \001(\t\022L\n\037decoder_endpo" + "inter_model_params\030\005 \001(\0132#.greco.Decoder" + "EndpointerModelParams\0222\n*emit_end_of_spe" + "ech_before_end_of_utterance\030\006 \001(\0102B\n\002id\022" + "\r.greco.Params\030\370\204\2433 \001(\0132$.greco.DecoderE" + "ndpointerStreamParams\"W\n\025EndpointOnDummy" + "Events2:\n\002id\022\r.greco.Params\030\233\370\3526 \001(\0132\034.g" + "reco.EndpointOnDummyEvents:\002\030\001\"q\n$Endpoi" + "ntOnFrameTimeForInitialSilence2I\n\002id\022\r.g" + "reco.Params\030\347\340\344< \001(\0132+.greco.EndpointOnF" + "rameTimeForInitialSilence\"c\n\033AddSilenceB" + "eforeFirstSpeech2@\n\002id\022\r.greco.Params\030\333\260" + "\3526 \001(\0132\".greco.AddSilenceBeforeFirstSpee" + "ch:\002\030\001B\002H\002" }; descriptor = com.google.protobuf.Descriptors.FileDescriptor .internalBuildGeneratedFileFrom(descriptorData, new com.google.protobuf.Descriptors.FileDescriptor[] { greco.ParamsProto.getDescriptor(), greco.DecoderEndpointerModelParamsOuterClass.getDescriptor(), }); internal_static_greco_DecoderEndpointerStreamParams_descriptor = getDescriptor().getMessageTypes().get(0); internal_static_greco_DecoderEndpointerStreamParams_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_greco_DecoderEndpointerStreamParams_descriptor, new java.lang.String[] { "MicCloserStreamName", "PrefetcherStreamName", "PreliminaryResultAcousticSilenceThresholdMs", "PreliminaryResultSentenceEndCostDecisionThreshold", "DecoderEndpointerModelFeatureStreamName", "DecoderEndpointerModelParams", "EmitEndOfSpeechBeforeEndOfUtterance", }); internal_static_greco_EndpointOnDummyEvents_descriptor = getDescriptor().getMessageTypes().get(1); internal_static_greco_EndpointOnDummyEvents_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_greco_EndpointOnDummyEvents_descriptor, new java.lang.String[] { }); internal_static_greco_EndpointOnFrameTimeForInitialSilence_descriptor = getDescriptor().getMessageTypes().get(2); internal_static_greco_EndpointOnFrameTimeForInitialSilence_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_greco_EndpointOnFrameTimeForInitialSilence_descriptor, new java.lang.String[] { }); internal_static_greco_AddSilenceBeforeFirstSpeech_descriptor = getDescriptor().getMessageTypes().get(3); internal_static_greco_AddSilenceBeforeFirstSpeech_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_greco_AddSilenceBeforeFirstSpeech_descriptor, new java.lang.String[] { }); greco.ParamsProto.getDescriptor(); greco.DecoderEndpointerModelParamsOuterClass.getDescriptor(); } // @@protoc_insertion_point(outer_class_scope) }
[ "zhangmengyu10@gmail.com" ]
zhangmengyu10@gmail.com
8fe3b03a5aaaa1a8df7af96bf60f2a8712e9b2e1
91c9cedc8ea067bdb719538031c7e4bf8d8cf6a3
/src/ShineyObjects.java
a83319e0b3d819b77608406f335157790df19060
[]
no_license
TJHL/Level_1
8cc0148ea5efa71e4413d75a3d1eb3a63279a3af
2f9ad3dbf0888e2a97d1376e10f1f061679093b8
refs/heads/master
2020-04-06T12:14:32.820204
2016-10-01T18:59:01
2016-10-01T18:59:01
36,262,585
0
0
null
null
null
null
UTF-8
Java
false
false
931
java
import java.net.URL; import javax.sound.sampled.AudioInputStream; import javax.sound.sampled.AudioSystem; import javax.sound.sampled.Clip; import javax.swing.JOptionPane; public class ShineyObjects { public static void main(String[] args) { // 2. Ask the user how many shiny objects they want String O= JOptionPane.showInputDialog("How many shiny objects they want."); // 3. Play the sound that many times int H =Integer.parseInt(O); for(int A=0;A < H;A++){ // 1. Call the method below playMisterZee();} } public static void playMisterZee() { try { AudioInputStream audioInputStream = AudioSystem .getAudioInputStream(new URL( "https://github.com/joonspoon/league-jars/blob/master/shiny%20objects.wav?raw=true")); Clip clip = AudioSystem.getClip(); clip.open(audioInputStream); clip.start(); Thread.sleep(3400); } catch (Exception ex) { ex.printStackTrace(); } } }
[ "tobylaskowski@WTS11.local" ]
tobylaskowski@WTS11.local
09609a078b9566e2f49df9cda126c4d0df7d9a91
44316a54755e5ee4118a3e82352094ea3a35358f
/no.sintef.bvr.table.resolution/src/no/sintef/bvr/table/resolution/custom/VirtualVClassifierImpl.java
73a9ac03f6303138ae17380150d28d665bb6cccb
[]
no_license
vassik/bvr
98a811ae7d21fbe5ea0701d04891d28b129f9e9b
3fa1a48d401aa29fabcd5ea4153c696e7e39da0e
refs/heads/master
2020-05-25T13:35:27.784701
2015-04-29T13:22:36
2015-04-29T13:22:36
34,623,094
0
0
null
2015-04-26T17:41:13
2015-04-26T17:41:12
null
UTF-8
Java
false
false
2,854
java
/** */ package no.sintef.bvr.table.resolution.custom; import org.eclipse.emf.common.notify.Notification; import org.eclipse.emf.ecore.EClass; import org.eclipse.emf.ecore.InternalEObject; import org.eclipse.emf.ecore.impl.ENotificationImpl; import bvr.BvrPackage; import bvr.VSpecResolution; import bvr.impl.VSpecResolutionImpl; /** * <!-- begin-user-doc --> An implementation of the model object ' * <em><b>VirtualVClassifier</b></em>'. <!-- end-user-doc --> * <p> * The following features are implemented: * <ul> * <li>{@link no.sintef.bvr.model.impl.VInstanceImpl#getType <em>Type</em>}</li> * </ul> * </p> * * @generated NOT */ public class VirtualVClassifierImpl extends VSpecResolutionImpl implements VirtualVClassifier { /** * The cached value of the '{@link #getType() <em>Type</em>}' reference. * <!-- begin-user-doc --> <!-- end-user-doc --> * * @see #getType() * @generated NOT * @ordered */ protected VSpecResolution parent; /** * <!-- begin-user-doc --> <!-- end-user-doc --> * * @generated NOT */ protected VirtualVClassifierImpl() { super(); } /** * <!-- begin-user-doc --> <!-- end-user-doc --> * * @generated NOT */ @Override protected EClass eStaticClass() { // This class is not in Bvr Model return null; } /** * <!-- begin-user-doc --> <!-- end-user-doc --> * * @generated */ public VSpecResolution getParent() { if (parent != null && parent.eIsProxy()) { InternalEObject oldType = (InternalEObject) parent; parent = (VSpecResolution) eResolveProxy(oldType); if (parent != oldType) { if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.RESOLVE, BvrPackage.VINSTANCE__TYPE, oldType, parent)); } } return parent; } /** * <!-- begin-user-doc --> <!-- end-user-doc --> * * @generated */ public VSpecResolution basicGetParent() { return parent; } /** * <!-- begin-user-doc --> <!-- end-user-doc --> * * @generated */ public void setParent(VSpecResolution newParent) { parent = newParent; } /** * <!-- begin-user-doc --> <!-- end-user-doc --> * * @generated NOT */ @Override public Object eGet(int featureID, boolean resolve, boolean coreType) { return super.eGet(featureID, resolve, coreType); } /** * <!-- begin-user-doc --> <!-- end-user-doc --> * * @generated NOT */ @Override public void eSet(int featureID, Object newValue) { super.eSet(featureID, newValue); } /** * <!-- begin-user-doc --> <!-- end-user-doc --> * * @generated NOT */ @Override public void eUnset(int featureID) { super.eUnset(featureID); } /** * <!-- begin-user-doc --> <!-- end-user-doc --> * * @generated NOT */ @Override public boolean eIsSet(int featureID) { return super.eIsSet(featureID); } } // VirtualVClassifierImpl
[ "Anatoly.Vasilevskiy@sintef.no" ]
Anatoly.Vasilevskiy@sintef.no
eae104ab7031310a2fa88dac9f88acd618c97083
ff3a0f87565e7b5ce523a59a29072b175a95fbd4
/Reltrabcfg/src/main/java/br/com/agrofauna/model/Empresa.java
a81c1cb1e92c65c8cc2af091ce73f27b010b4999
[]
no_license
wesleyhsm/ControleUsuarios
f1861129af9f14a69134fbbb50b7031ecc685359
a319701d52f156cf5cd0530e8e256d6e41773932
refs/heads/master
2021-01-20T09:54:46.471416
2017-05-04T19:13:26
2017-05-04T19:13:26
90,299,633
1
0
null
null
null
null
UTF-8
Java
false
false
5,082
java
package br.com.agrofauna.model; import java.io.Serializable; import java.util.Date; import java.util.List; import javax.persistence.Column; import javax.persistence.DiscriminatorValue; import javax.persistence.Entity; import javax.persistence.FetchType; import javax.persistence.NamedQueries; import javax.persistence.NamedQuery; import javax.persistence.OneToMany; import javax.persistence.PrePersist; import javax.persistence.PreUpdate; import javax.persistence.PrimaryKeyJoinColumn; import javax.persistence.Table; import javax.persistence.Temporal; import javax.persistence.TemporalType; import javax.validation.constraints.NotNull; import org.hibernate.annotations.Cache; import org.hibernate.annotations.CacheConcurrencyStrategy; import org.hibernate.validator.constraints.NotBlank; import br.com.agrofauna.model.Pessoa; @Entity @Table(name="empresa") @PrimaryKeyJoinColumn(name="id_pessoa") @DiscriminatorValue("EMPRESA") @Cache(usage = CacheConcurrencyStrategy.TRANSACTIONAL) @NamedQueries({ @NamedQuery(name="Empresa.todos", query="SELECT e FROM Empresa e"), @NamedQuery(name="Empresa.existeCnpj", query="SELECT e FROM Empresa e WHERE e.nmCnpjCpf = :cnpjcpf"), @NamedQuery(name="Empresa.id", query="SELECT e FROM Empresa e WHERE e.idPessoa=:idPessoa"), @NamedQuery(name="Empresa.email", query="SELECT e FROM Email e WHERE e.pessoa.idPessoa=:idPessoa"), @NamedQuery(name="Empresa.endereco", query="SELECT e FROM Endereco e join fetch e.estado WHERE e.pessoa.idPessoa=:idPessoa"), @NamedQuery(name="Empresa.telefone", query="SELECT e FROM Telefone e WHERE e.pessoa.idPessoa=:idPessoa"), @NamedQuery(name="Empresa.nfeConfiguraor", query="SELECT e FROM NfeConfiguracao e WHERE e.pessoa.idPessoa=:idPessoa"), @NamedQuery(name="Empresa.emailExcluir", query="DELETE FROM Email e WHERE e.pessoa.idPessoa=:idPessoa"), @NamedQuery(name="Empresa.enderecoExcluir", query="DELETE FROM Endereco e WHERE e.pessoa.idPessoa=:idPessoa"), @NamedQuery(name="Empresa.telefoneExcluir", query="DELETE FROM Telefone e WHERE e.pessoa.idPessoa=:idPessoa"), @NamedQuery(name="Empresa.nfeConfiguraorExcluir", query="DELETE FROM NfeConfiguracao e WHERE e.pessoa.idPessoa=:idPessoa"), @NamedQuery(name="Empresa.funcionarioEmpresas", query="SELECT e FROM Empresa e join e.usuarioEmpresas u WHERE u.usuario.idUsuario=:idUsuario") }) public class Empresa extends Pessoa implements Serializable{ private static final long serialVersionUID = 1L; private String nmRazaoSocial; private String nmFantasia; private String nmFilial; private String nmInscricaoEstadual; private Date dtFundacao; private Date dtCriacao; private Date dtAlteracao; private Boolean snStatus = true; private List<UsuarioEmpresa> usuarioEmpresas; @NotBlank @Column(name="nm_razao_social") public String getNmRazaoSocial() { return nmRazaoSocial; } public void setNmRazaoSocial(String nmRazaoSocial) { this.nmRazaoSocial = nmRazaoSocial; } @NotBlank @Column(name="nm_fantasia") public String getNmFantasia() { return nmFantasia; } public void setNmFantasia(String nmFantasia) { this.nmFantasia = nmFantasia; } @NotBlank @Column(name="nm_filial") public String getNmFilial() { return nmFilial; } public void setNmFilial(String nmFilial) { this.nmFilial = nmFilial; } @Column(name="nm_inscricao_estadual") public String getNmInscricaoEstadual() { return nmInscricaoEstadual; } public void setNmInscricaoEstadual(String nmInscricaoEstadual) { this.nmInscricaoEstadual = nmInscricaoEstadual; } @NotNull @Temporal(TemporalType.DATE) @Column(name="dt_fundacao") public Date getDtFundacao() { return dtFundacao; } public void setDtFundacao(Date dtFundacao) { this.dtFundacao = dtFundacao; } @NotNull @Temporal(TemporalType.TIMESTAMP) @Column(name="dt_criacao") public Date getDtCriacao() { return dtCriacao; } public void setDtCriacao(Date dtCriacao) { this.dtCriacao = dtCriacao; } @NotNull @Temporal(TemporalType.TIMESTAMP) @Column(name="dt_alteracao") public Date getDtAlteracao() { return dtAlteracao; } public void setDtAlteracao(Date dtAlteracao) { this.dtAlteracao = dtAlteracao; } @Column(name="sn_status") public Boolean getSnStatus() { return snStatus; } public void setSnStatus(Boolean snStatus) { this.snStatus = snStatus; } @OneToMany(mappedBy="empresa", fetch=FetchType.LAZY) public List<UsuarioEmpresa> getUsuarioEmpresas() { return usuarioEmpresas; } public void setUsuarioEmpresas(List<UsuarioEmpresa> usuarioEmpresas) { this.usuarioEmpresas = usuarioEmpresas; } @PrePersist @PreUpdate public void configuraDataCriacaoAlteracao(){ this.dtAlteracao = new Date(); if(this.dtCriacao == null){ this.dtCriacao = new Date(); } } @Override public String toString() { return "Empresa [nmRazaoSocial=" + nmRazaoSocial + ", nmFantasia=" + nmFantasia + ", nmFilial=" + nmFilial + ", nmInscricaoEstadual=" + nmInscricaoEstadual + ", dtFundacao=" + dtFundacao + ", dtCriacao=" + dtCriacao + ", dtAlteracao=" + dtAlteracao + ", snStatus=" + snStatus + "]"; } }
[ "wesleyhsm@hotmail.com" ]
wesleyhsm@hotmail.com
8be6e3cda3aa0c7af1a6ce2500dca93a5d414cc3
1159309a7bfffc255fa6d550c25df6a3dd7974b0
/maven/release/src/main/java/org/release/service/UserService.java
5e0daf566e0d84cba0a92cfe3f884c97aaa1dfb2
[]
no_license
KBLGC/study-repository
d2ccfba6943f50badad37f2a21d46ec15974cc6f
55f4ec5744adfccc318b4e489cb0e6881d6981db
refs/heads/master
2020-03-29T21:43:27.313975
2018-11-19T10:53:31
2018-11-19T10:53:31
150,383,416
0
0
null
null
null
null
UTF-8
Java
false
false
144
java
package org.release.service; import org.release.entity.User; public interface UserService { public User getUserById(Long id); }
[ "2996547275@qq.com" ]
2996547275@qq.com
bc79e6bfd66bbe05a80e6ac0c49030ef899a165f
f1e0b152f2b41b3f16dcbfea13c0a23dc3325008
/modules/MgkPortlet/MgkPortlet-api/src/main/java/com/mgk/portlet/service/PersonServiceUtil.java
d4ccebde91af47a4945cecfe7a94a8edc484ca2f
[]
no_license
021Mgk/liferay-portlet-mgk
9aa1b3d1fc1a46bbd67da3fae2c6034e88f813f5
25564484d628b30f7a7446a5847a47f0eb7ec3d5
refs/heads/master
2023-08-15T13:27:40.330736
2021-09-16T07:48:54
2021-09-16T07:48:54
401,022,694
0
1
null
2021-09-16T07:48:55
2021-08-29T11:19:17
Java
UTF-8
Java
false
false
2,144
java
/** * Copyright (c) 2000-present Liferay, Inc. All rights reserved. * * This library is free software; you can redistribute it and/or modify it under * the terms of the GNU Lesser General Public License as published by the Free * Software Foundation; either version 2.1 of the License, or (at your option) * any later version. * * This library is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more * details. */ package com.mgk.portlet.service; import org.osgi.framework.Bundle; import org.osgi.framework.FrameworkUtil; import org.osgi.util.tracker.ServiceTracker; /** * Provides the remote service utility for Person. This utility wraps * <code>com.mgk.portlet.service.impl.PersonServiceImpl</code> and is an * access point for service operations in application layer code running on a * remote server. Methods of this service are expected to have security checks * based on the propagated JAAS credentials because this service can be * accessed remotely. * * @author 021mgk * @see PersonService * @generated */ public class PersonServiceUtil { /* * NOTE FOR DEVELOPERS: * * Never modify this class directly. Add custom service methods to <code>com.mgk.portlet.service.impl.PersonServiceImpl</code> and rerun ServiceBuilder to regenerate this class. */ /** * Returns the OSGi service identifier. * * @return the OSGi service identifier */ public static String getOSGiServiceIdentifier() { return getService().getOSGiServiceIdentifier(); } public static PersonService getService() { return _serviceTracker.getService(); } private static ServiceTracker<PersonService, PersonService> _serviceTracker; static { Bundle bundle = FrameworkUtil.getBundle(PersonService.class); ServiceTracker<PersonService, PersonService> serviceTracker = new ServiceTracker<PersonService, PersonService>( bundle.getBundleContext(), PersonService.class, null); serviceTracker.open(); _serviceTracker = serviceTracker; } }
[ "mgk.021@gmail.com" ]
mgk.021@gmail.com
3b7aadab8a9614ee0300dd6667baaaec0a3c6116
1aa4e4f5354f85c9f5d0a653280fa75a48d9061f
/app/src/main/java/com/example/saket/blockcaller/Blacklist.java
198e935921081104ae0098fa19bde1e8bca57ac2
[]
no_license
saket147/BlockCaller
9b013acda53b6c86f06d34d09fe6358e95516cb4
e11f9d64684197178b0dfca36870f2c42991e57d
refs/heads/master
2021-06-05T17:14:39.865695
2016-10-14T22:20:50
2016-10-14T22:20:50
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,117
java
package com.example.saket.blockcaller; /** * Created by saket on 15-Oct-16. */ public class Blacklist { // Two mapping fields for the database table blacklist public long id; public String phoneNumber; // Default constructor public Blacklist() { } // To easily create Blacklist object, an alternative constructor public Blacklist(final String phoneMumber) { this.phoneNumber = phoneMumber; } // Overriding the default method to compare between the two objects bu phone number @Override public boolean equals(final Object obj) { // If passed object is an instance of Blacklist, then compare the phone numbers, else return false as they are not equal if(obj.getClass().isInstance(new Blacklist())) { // Cast the object to Blacklist final Blacklist bl = (Blacklist) obj; // Compare whether the phone numbers are same, if yes, it defines the objects are equal if(bl.phoneNumber.equalsIgnoreCase(this.phoneNumber)) return true; } return false; } }
[ "saket19954@gmail.com" ]
saket19954@gmail.com
88d64d84ff3ceb26ff09d3aeb3d591dbc664c539
1318f833a081b169f60a4002e1a629d65f652b22
/src/main/java/com/widget/apitest/Widget.java
1e1ccbcae8f5afb1f6c9988f3c013e157f60c38d
[]
no_license
JSiie/widgetapi_test
7537a8cb2c500f92d6d27528f28fbd54a8232910
4b68eea60cc4c261cfa4e37805528dbfb37d2246
refs/heads/master
2022-12-01T01:34:07.506686
2020-08-15T15:43:12
2020-08-15T15:43:12
287,637,748
0
0
null
null
null
null
UTF-8
Java
false
false
3,229
java
package com.widget.apitest; import java.util.Comparator; import java.util.Map; import java.util.UUID; import java.time.Instant; import java.time.ZoneId; import java.time.ZonedDateTime; public class Widget { //UUID is pratically unique. id could also be an atomic counter. But in case of a distributed system it can be tricky private UUID id; private int zindex, x, y, width, height; private Instant lastModified; public Widget() { this.id = UUID.randomUUID(); this.lastModified = Instant.now(); } public Widget(int x, int y, int width, int height, int zindex) { this.id = UUID.randomUUID(); this.x = x; this.y = y; this.width = width; this.height = height; this.zindex = zindex; this.lastModified = Instant.now(); } private void setX(int x) { this.x = x; this.lastModified = Instant.now(); } private void setY(int y) { this.y = y; this.lastModified = Instant.now(); } private void setWidth(int width) { this.width = width; this.lastModified = Instant.now(); } private void setHeight(int height) { this.height = height; this.lastModified = Instant.now(); } private void setZIndex(int zindex) { this.zindex = zindex; this.lastModified = Instant.now(); } public void set(Map<String, Integer> args) { synchronized(this) { if(args.containsKey("x")) { this.setX(args.get("x")); } if(args.containsKey("y")) { this.setY(args.get("y")); } if(args.containsKey("width")) { this.setWidth(args.get("width")); } if(args.containsKey("height")) { this.setHeight(args.get("height")); } if(args.containsKey("zindex")) { this.setZIndex(args.get("zindex")); } } return; } public UUID getId() { return this.id; } public int getX() { synchronized(this) { return this.x; } } public int getY() { synchronized(this) { return this.y; } } public int getWidth() { synchronized(this) { return this.width; } } public int getHeight() { synchronized(this) { return this.height; } } public int getZIndex() { synchronized(this) { return this.zindex; } } public ZonedDateTime getLastModified() { return ZonedDateTime.ofInstant(this.lastModified, ZoneId.of("Europe/Amsterdam")); } //sort by name public static Comparator<Widget> sortByZIndex = new Comparator<Widget>() { @Override public int compare(Widget wgt1, Widget wgt2) { //sort in ascending order if(wgt1.zindex < wgt2.zindex) return -1; else if (wgt1.zindex > wgt2.zindex) return 1; else return 0; } }; }
[ "me-gitlab@jonathan-sanchez.com" ]
me-gitlab@jonathan-sanchez.com
3d46059c1e191742e8e5c38dd7cbe3e91c4c9ff2
0ea4b7df1934507f2f98bfef98a171071bed14dc
/ArgsSeprator.java
ca8ce9bdd0bddcc690241dd23a00de3fb6ef14f9
[]
no_license
vishnumishra/wc_java
b99dfe35bd66e581abe805256d28e8b991bba734
e501098620fa92d52e392362429e792f62a80275
refs/heads/master
2016-09-06T19:31:19.643997
2015-02-20T15:04:24
2015-02-20T15:04:24
30,903,175
0
0
null
null
null
null
UTF-8
Java
false
false
818
java
import java.io.File; public class ArgsSeprator { public String[] files; public String[] flags; private String[] argvs; public ArgsSeprator(String[] argv){ this.argvs = argv; this.files = getFiles(); this.flags = getFlags(); }; private boolean isValidFlag(String str){ String validFlags[] = {"-l","-L","-w","-c"}; for(String flag:validFlags){ if(flag == str) return true; } return false; } public String[] getFlags(){ String[] flags = new String[argvs.length]; int i=0; for(String argv:argvs ){ if(isValidFlag(argv)){ flags[i] = argv; i++; } } return flags; } public String[] getFiles(){ String[] files = new String[argvs.length]; int i=0; for(String argv:argvs ){ if(new File(argv).isFile()){ files[i] = argv; i++; } } return files; } }
[ "vishnu143mishra@gmail.com" ]
vishnu143mishra@gmail.com
c9e5dd292a95beef2c9e8a48a4076a9859d5f8c3
bfb18fb441a97e4091eba85b0afff6d4d254337c
/2.JavaCore/src/com/javarush/task/task15/task1503/Solution.java
a2ce54acc6cab9dbfc54c4ff0453232d4ca972e1
[]
no_license
HappyRomio/JavaRushTasks
75a184f890e08d8b821594e65bbd4f8a5ac3df4b
4e0936eb6faacf170042b3a20ded5a589698486c
refs/heads/master
2021-04-17T09:55:07.472906
2020-03-23T13:37:31
2020-03-23T13:37:31
249,435,804
0
1
null
null
null
null
UTF-8
Java
false
false
1,463
java
package com.javarush.task.task15.task1503; /* ООП - машинки */ public class Solution { public static void main(String[] args) { new Solution.LuxuriousCar().printlnDesire(); new Solution.CheapCar().printlnDesire(); new Solution.Ferrari().printlnDesire(); new Solution.Lanos().printlnDesire(); } public static class Ferrari extends LuxuriousCar { public void printlnDesire() { System.out.println(Constants.WANT_STRING + Constants.FERRARI_NAME); } } public static class Lanos extends CheapCar { public void printlnDesire() { System.out.println(Constants.WANT_STRING + Constants.LANOS_NAME); } } public static class Constants { public static String WANT_STRING = "Я хочу ездить на "; public static String LUXURIOUS_CAR = "роскошной машине"; public static String CHEAP_CAR = "дешевой машине"; public static String FERRARI_NAME = "Феррари"; public static String LANOS_NAME = "Ланосе"; } public static class LuxuriousCar { protected void printlnDesire() { System.out.println(Constants.WANT_STRING + Constants.LUXURIOUS_CAR ); } } public static class CheapCar { protected void printlnDesire() { System.out.println(Constants.WANT_STRING + Constants.CHEAP_CAR); } } }
[ "maltsevroma@rambler.ru" ]
maltsevroma@rambler.ru
086f0d0a6ea076f813a0e0e7c004e1693b8a4cca
d2ca913dfff1a2faee30101feee5395fbcaf598d
/app/src/main/java/com/oddcn/screensharetobrowser/recorder/RecordService.java
4a3d17b345b33b2cff6e7c7b515c391e2d52790a
[ "Apache-2.0" ]
permissive
jedsada-gh/screen-share-to-browser
13a39996aa8847c74ab3064dba5a5c54c7d3b18b
48eebd1fae6532f92204bf5683e614911c15cb88
refs/heads/master
2023-05-25T06:19:42.774406
2019-01-02T07:57:52
2019-01-02T07:57:52
null
0
0
null
null
null
null
UTF-8
Java
false
false
10,834
java
package com.oddcn.screensharetobrowser.recorder; import android.app.Service; import android.content.Context; import android.content.Intent; import android.graphics.Bitmap; import android.graphics.PixelFormat; import android.hardware.display.DisplayManager; import android.hardware.display.VirtualDisplay; import android.media.Image; import android.media.ImageReader; import android.media.projection.MediaProjection; import android.os.Binder; import android.os.Handler; import android.os.HandlerThread; import android.os.IBinder; import android.os.Looper; import android.os.Message; import android.util.Log; import android.view.WindowManager; import com.oddcn.screensharetobrowser.RxBus; import java.io.ByteArrayOutputStream; import java.io.IOException; import java.nio.ByteBuffer; import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; import io.reactivex.Observable; import io.reactivex.Scheduler; import io.reactivex.disposables.CompositeDisposable; import io.reactivex.functions.Consumer; import io.reactivex.functions.Function; import io.reactivex.schedulers.Schedulers; public class RecordService extends Service { private static final String TAG = "RecordService"; private MediaProjection mediaProjection; private ImageReader imageReader; private VirtualDisplay virtualDisplay; private boolean running; private int width; private int height; private int dpi; private ScreenHandler screenHandler; private int threadCount; private ExecutorService executorService; private Scheduler scheduler; private long imgFlag = 0; private long postedImgFlag = 0; private RecordServiceListener recordServiceListener; public void setListener(RecordServiceListener listener) { recordServiceListener = listener; } public void removeListener() { recordServiceListener = null; } private CompositeDisposable compositeDisposable = new CompositeDisposable(); private class ScreenHandler extends Handler { public ScreenHandler(Looper looper) { super(looper); } @Override public void handleMessage(Message msg) { super.handleMessage(msg); } } @Override public IBinder onBind(Intent intent) { return new RecordBinder(); } @Override public int onStartCommand(Intent intent, int flags, int startId) { return START_STICKY; } @Override public void onCreate() { super.onCreate(); HandlerThread serviceThread = new HandlerThread("service_thread", android.os.Process.THREAD_PRIORITY_BACKGROUND); serviceThread.start(); running = false; threadCount = Runtime.getRuntime().availableProcessors(); Log.d(TAG, "onCreate: threadCount" + threadCount); executorService = Executors.newFixedThreadPool(threadCount); HandlerThread handlerThread = new HandlerThread("Screen Record"); handlerThread.start(); screenHandler = new ScreenHandler(handlerThread.getLooper()); //get the size of the window WindowManager mWindowManager = (WindowManager) getApplication().getSystemService(Context.WINDOW_SERVICE); // width = mWindowManager.getDefaultDisplay().getWidth() + 40; width = mWindowManager.getDefaultDisplay().getWidth(); height = mWindowManager.getDefaultDisplay().getHeight(); //height = 2300; Log.i(TAG, "onCreate: w is " + width + " h is " + height); imageReader = ImageReader.newInstance(width, height, PixelFormat.RGBA_8888, 2); scheduler = Schedulers.from(executorService); // Disposable disposable = // getByteBufferObservable() // .subscribeOn(Schedulers.io()) // .observeOn(scheduler) // .map(getBitmapFunction()) // .subscribe(getBitmapConsumer()); // compositeDisposable.add(disposable); } @Override public void onDestroy() { super.onDestroy(); stopRecord(); compositeDisposable.dispose(); } public void setMediaProject(MediaProjection project) { mediaProjection = project; } public boolean isRunning() { return running; } public void setConfig(int width, int height, int dpi) { this.width = width; this.height = height; this.dpi = dpi; } public boolean startRecord() { if (mediaProjection == null || running) { return false; } executorService = Executors.newFixedThreadPool(threadCount); imageReader = ImageReader.newInstance(width, height, PixelFormat.RGBA_8888, 2); createVirtualDisplayForImageReader(); running = true; if (recordServiceListener != null) { recordServiceListener.onRecorderStatusChanged(running); } return true; } public boolean stopRecord() { if (!running) { return false; } running = false; if (virtualDisplay != null) { virtualDisplay.release(); virtualDisplay = null; } if (mediaProjection != null) { mediaProjection.stop(); mediaProjection = null; } if (executorService != null && !executorService.isShutdown()) { executorService.shutdown(); executorService = null; } if (imageReader != null) imageReader.close(); if (recordServiceListener != null) { recordServiceListener.onRecorderStatusChanged(running); } return true; } private void createVirtualDisplayForImageReader() { virtualDisplay = mediaProjection.createVirtualDisplay("MainScreen", width, height, dpi , DisplayManager.VIRTUAL_DISPLAY_FLAG_PUBLIC, imageReader.getSurface() , null, screenHandler); imageReader.setOnImageAvailableListener(new ImageReader.OnImageAvailableListener() { @Override public void onImageAvailable(ImageReader imageReader) { try { Image img = imageReader.acquireLatestImage(); if (img != null) { Log.d(TAG, "onImageAvailable: "); int width = img.getWidth(); int height = img.getHeight(); Image.Plane[] planes = img.getPlanes(); ByteBuffer buffer = planes[0].getBuffer(); int pixelStride = planes[0].getPixelStride(); int rowStride = planes[0].getRowStride(); int rowPadding = rowStride - pixelStride * width; img.close(); ImageInfo imageInfo = new ImageInfo(width, height, buffer, pixelStride, rowPadding); Observable.just(new FlagImageInfo(imageInfo, imgFlag++)) .subscribeOn(scheduler) .observeOn(scheduler) .map(getBitmapFunction()) .subscribe(getBitmapConsumer()); } } catch (Exception e) { e.printStackTrace(); } } }, screenHandler); } // private ObservableEmitter<ImageInfo> imageInfoObservableEmitter; // // private Observable<ImageInfo> getByteBufferObservable() { // return Observable.create(new ObservableOnSubscribe<ImageInfo>() { // @Override // public void subscribe(ObservableEmitter<ImageInfo> e) throws Exception { // imageInfoObservableEmitter = e; // Log.d(TAG, "subscribe: " + Process.myTid()); // } // }); // } private Function<FlagImageInfo, FlagBitmap> getBitmapFunction() { return new Function<FlagImageInfo, FlagBitmap>() { @Override public FlagBitmap apply(FlagImageInfo flagImageInfo) throws Exception { ImageInfo imageInfo = flagImageInfo.imageInfo; Bitmap bitmap = Bitmap.createBitmap(imageInfo.width + imageInfo.rowPadding / imageInfo.pixelStride, imageInfo.height, Bitmap.Config.ARGB_8888); bitmap.copyPixelsFromBuffer(imageInfo.byteBuffer); bitmap = Bitmap.createBitmap(bitmap, 0, 0, width, height); return new FlagBitmap(bitmap, flagImageInfo.flag); } }; } private Consumer<FlagBitmap> getBitmapConsumer() { return new Consumer<FlagBitmap>() { @Override public void accept(FlagBitmap flagBitmap) throws Exception { Bitmap bitmap = flagBitmap.bitmap; ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream(); bitmap.compress(Bitmap.CompressFormat.JPEG, 10, byteArrayOutputStream); byte[] b = byteArrayOutputStream.toByteArray(); String base64Str = org.java_websocket.util.Base64.encodeBytes(b); if (flagBitmap.flag > postedImgFlag) { postedImgFlag = flagBitmap.flag; RxBus.getDefault().post(base64Str); } try { byteArrayOutputStream.flush(); byteArrayOutputStream.close(); } catch (IOException e) { e.printStackTrace(); } finally { bitmap.recycle(); } } }; } public class RecordBinder extends Binder { public RecordService getRecordService() { return RecordService.this; } } private class ImageInfo { private int width; private int height; private ByteBuffer byteBuffer; private int pixelStride; private int rowPadding; public ImageInfo(int width, int height, ByteBuffer byteBuffer, int pixelStride, int rowPadding) { this.width = width; this.height = height; this.byteBuffer = byteBuffer; this.pixelStride = pixelStride; this.rowPadding = rowPadding; } } private class FlagImageInfo { private ImageInfo imageInfo; private long flag; public FlagImageInfo(ImageInfo imageInfo, long flag) { this.imageInfo = imageInfo; this.flag = flag; } } private class FlagBitmap { private Bitmap bitmap; private long flag; public FlagBitmap(Bitmap bitmap, long flag) { this.bitmap = bitmap; this.flag = flag; } } }
[ "oddzheng@126.com" ]
oddzheng@126.com
7cb655e62792873dacb8ca032f7f4e8c8f57b6e1
eb5e537de5ecd144b9efcd34e5d6734f871f01d9
/mycode/mavencode/cocktail-service/src/main/java/com/liquidpresentaion/cocktailservice/services/AmazonClient.java
fad6613d7fc0419dfc68324bb0de1aee1dfa96ff
[]
no_license
tbiinfotech/pipeline
42a3a3a6182a1ef66563b1849d0d25265205987d
5cc43f64e50c32ae272f271e9de689fe14f11356
refs/heads/master
2023-08-09T18:29:04.612334
2020-02-20T07:07:22
2020-02-20T07:07:22
241,816,436
0
0
null
2023-07-23T06:15:17
2020-02-20T07:05:10
Java
UTF-8
Java
false
false
3,260
java
package com.liquidpresentaion.cocktailservice.services; import java.io.File; import java.io.FileOutputStream; import java.io.IOException; import java.io.InputStream; import java.util.Date; import javax.annotation.PostConstruct; import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Service; import org.springframework.web.multipart.MultipartFile; import com.amazonaws.auth.AWSCredentials; import com.amazonaws.auth.AWSStaticCredentialsProvider; import com.amazonaws.auth.BasicAWSCredentials; import com.amazonaws.services.s3.AmazonS3; import com.amazonaws.services.s3.AmazonS3ClientBuilder; import com.amazonaws.services.s3.model.CannedAccessControlList; import com.amazonaws.services.s3.model.ObjectMetadata; import com.amazonaws.services.s3.model.PutObjectRequest; @Service public class AmazonClient { private AmazonS3 s3client; @Value("${amazonProperties.endpointUrl}") private String endpointUrl; @Value("${amazonProperties.bucketName}") private String bucketName; @Value("${amazonProperties.accessKey}") private String accessKey; @Value("${amazonProperties.secretKey}") private String secretKey; @Value("${amazonProperties.region}") private String region; @PostConstruct private void initializeAmazon() { AWSCredentials credentials = new BasicAWSCredentials(this.accessKey, this.secretKey); this.s3client = AmazonS3ClientBuilder.standard().withCredentials(new AWSStaticCredentialsProvider(credentials)).withRegion(region).build(); } public String uploadFile(MultipartFile multipartFile) { String fileUrl = ""; try { File file = convertMultiPartToFile(multipartFile); String fileName = generateFileName(multipartFile); fileUrl = endpointUrl + "/" + fileName; uploadFileTos3bucket(fileName, file); file.delete(); } catch (Exception e) { e.printStackTrace(); } return fileUrl; } private void uploadFileTos3bucket(String fileName, File file) { s3client.putObject( new PutObjectRequest(bucketName, fileName, file).withCannedAcl(CannedAccessControlList.PublicRead)); } public String uploadImageInputStream(String fileName, InputStream inputStream, long length) { String fileUrl = ""; try { ObjectMetadata md = new ObjectMetadata(); md.setContentLength(length); md.setContentType("application/octet-stream"); fileUrl = endpointUrl + "/" + fileName; inputSteamTos3bucket(fileName, inputStream, md); } catch (Exception e) { e.printStackTrace(); } return fileUrl; } private void inputSteamTos3bucket(String fileName, InputStream inputStream, ObjectMetadata md) { s3client.putObject( new PutObjectRequest(bucketName, fileName, inputStream, md).withCannedAcl(CannedAccessControlList.PublicRead)); } private String generateFileName(MultipartFile multiPart) { return new Date().getTime() + "-" + multiPart.getOriginalFilename().replace(" ", "_"); } private File convertMultiPartToFile(MultipartFile file) throws IOException { File convFile = new File(file.getOriginalFilename()); FileOutputStream fos = new FileOutputStream(convFile); fos.write(file.getBytes()); fos.close(); return convFile; } }
[ "root@ip-172-31-86-77.ec2.internal" ]
root@ip-172-31-86-77.ec2.internal
3893c52bd484ccd851b9f9f5948669a21642775a
c5215075d6e2e91cb4f6cbe7706e3b379d111185
/src/main/java/com/lcc/service/impl/RolePermissionsServiceImpl.java
051cfece919a4422fbb9e34a5d99e8830a18fe42
[]
no_license
liangchengcheng/springmvc_admin_master
59e378271c5120a6fa18dbd12b771c3321fb4489
d57dece5045e4c457250c066b8a83a8a372a31d5
refs/heads/master
2021-01-12T07:05:06.173532
2016-12-24T06:16:35
2016-12-24T06:16:35
76,905,713
0
0
null
null
null
null
UTF-8
Java
false
false
3,807
java
package com.lcc.service.impl; import java.util.List; import com.lcc.bean.Result; import com.lcc.bean.entity.RcRolePermissions; import com.lcc.dao.RolePermissionsDao; import com.lcc.service.RolePermissionsService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @Service public class RolePermissionsServiceImpl implements RolePermissionsService { @Autowired private RolePermissionsDao dao; @Override public Result<RcRolePermissions> query(long id) { Result<RcRolePermissions> result = new Result<RcRolePermissions>(); if (id < 0) { result.setErrMsg("此id无效"); return result; } RcRolePermissions rcRolePermissions = dao.selectById(id); if (rcRolePermissions != null) { result.setErrCode(0); result.setStatus(true); result.setResultData(rcRolePermissions); } return result; } @Override public Result<List<RcRolePermissions>> queryByRoleId(long id) { Result<List<RcRolePermissions>> result = new Result<List<RcRolePermissions>>(); if (id < 0) { result.setErrMsg("此id无效"); return result; } List<RcRolePermissions> resultList = dao.selectByRoleId(id); if (resultList.size() > 0) { result.setErrCode(0); result.setStatus(true); result.setResultData(resultList); } return result; } @Override public Result<Integer> insert(RcRolePermissions rcRolePermissions) { Result<Integer> result = new Result<Integer>(); if (rcRolePermissions.getRoleId() < 0) { result.setErrMsg("此角色id无效"); return result; } if (rcRolePermissions.getPermissionId() < 0) { result.setErrMsg("此权限id无效"); return result; } int resultNum = dao.insert(rcRolePermissions); if (resultNum > 0) { result.setErrCode(0); result.setStatus(true); } return result; } @Override public Result<Integer> update(RcRolePermissions rcRolePermissions) { Result<Integer> result = new Result<Integer>(); if (rcRolePermissions.getRoleId() < 0) { result.setErrMsg("此角色id无效"); return result; } if (rcRolePermissions.getPermissionId() < 0) { result.setErrMsg("此权限id无效"); return result; } int resultNum = dao.update(rcRolePermissions); if (resultNum > 0) { result.setErrCode(0); result.setStatus(true); } return result; } @Override public Result<Integer> delete(long id) { Result<Integer> result = new Result<Integer>(); if (id < 0) { result.setErrMsg("此id无效"); return result; } int resultNum = dao.deleteById(id); if (resultNum > 0) { result.setErrCode(0); result.setStatus(true); } return result; } @Override public Result<Integer> deleteByRolePermissions(RcRolePermissions rcRolePermissions) { Result<Integer> result = new Result<Integer>(); if (rcRolePermissions.getRoleId() < 0) { result.setErrMsg("此角色id无效"); return result; } if (rcRolePermissions.getPermissionId() < 0) { result.setErrMsg("此权限id无效"); return result; } int resultNum = dao.delectByRolePermissions(rcRolePermissions); if (resultNum > 0) { result.setErrCode(0); result.setStatus(true); } return result; } }
[ "1038127753@qq.com" ]
1038127753@qq.com
385abbd3bafab21c11d337020da301450621b1df
e6d716fde932045d076ab18553203e2210c7bc44
/bluesky-pentaho-kettle/engine/src/main/java/org/pentaho/di/trans/steps/monetdbagilemart/MonetDBRowLimitException.java
9224432eb3d5e508b9b27a2e961659d272770fe3
[]
no_license
BlueCodeBoy/bluesky
d04032e6c0ce87a18bcbc037191ca20d03aa133e
6fc672455b6047979527da9ba8e3fc220d5cee37
refs/heads/master
2020-04-18T10:47:20.434313
2019-01-25T03:30:47
2019-01-25T03:30:47
167,478,568
6
0
null
null
null
null
UTF-8
Java
false
false
2,719
java
/*! ****************************************************************************** * * Pentaho Data Integration * * Copyright (C) 2002-2013 by Pentaho : http://www.pentaho.com * ******************************************************************************* * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ******************************************************************************/ package org.pentaho.di.trans.steps.monetdbagilemart; import org.pentaho.di.core.exception.KettleException; /** * Custom exception to indicate that the row limit has been reached User: RFellows Date: 10/31/12 */ public class MonetDBRowLimitException extends KettleException { private static final long serialVersionUID = -2456127057531651057L; /** * Constructs a new {@link Throwable} with null as its detail message. */ public MonetDBRowLimitException() { super(); } /** * Constructs a new {@link Throwable} with the specified detail message. * * @param message * - the detail message. The detail message is saved for later retrieval by the getMessage() method. */ public MonetDBRowLimitException( String message ) { super( message ); } /** * Constructs a new throwable with the specified cause and a detail message of (cause==null ? null : cause.toString()) * (which typically contains the class and detail message of cause). * * @param cause * the cause (which is saved for later retrieval by the getCause() method). (A null value is permitted, and * indicates that the cause is nonexistent or unknown.) */ public MonetDBRowLimitException( Throwable cause ) { super( cause ); } /** * Constructs a new throwable with the specified detail message and cause. * * @param message * the detail message (which is saved for later retrieval by the getMessage() method). * @param cause * the cause (which is saved for later retrieval by the getCause() method). (A null value is permitted, and * indicates that the cause is nonexistent or unknown.) */ public MonetDBRowLimitException( String message, Throwable cause ) { super( message, cause ); } }
[ "pp@gmail.com" ]
pp@gmail.com
248ccad401aff8752c9068621ff29fab3f0a2866
38517e4228e08bf295776219c6b213f6a074d9fb
/src/main/java/pjatk/project/Model/PriceValidator.java
99dd273d84a3573f79e6d8cb5d8d70704c85f7ea
[]
no_license
s20156/poprawa_poj
a26cf93a129b52647124387585cd3484c8897812
12c9a17066c4ecd0c79da83de2ba190b168fd2b0
refs/heads/master
2023-05-08T17:04:14.600066
2020-06-13T11:30:56
2020-06-13T11:30:56
271,972,679
0
0
null
2021-06-04T22:20:31
2020-06-13T08:47:00
Java
UTF-8
Java
false
false
412
java
package pjatk.project.Model; import javax.validation.ConstraintValidator; import javax.validation.ConstraintValidatorContext; public class PriceValidator implements ConstraintValidator<Price, Double> { @Override public void initialize(Price Price) {} @Override public boolean isValid(Double price, ConstraintValidatorContext constraintValidatorContext) { return price != null; } }
[ "s20156@pjwstk.edu.pl" ]
s20156@pjwstk.edu.pl
4cf779a18b5c65f523b869c1eb7ba86ddeda4e85
f9fcde801577e7b9d66b0df1334f718364fd7b45
/icepdf-5.0.3/icepdf/core/src/org/icepdf/core/pobjects/graphics/ImagePool.java
3d2a78bb889fecd987e5d505e06a5e2e3fac0650
[ "Apache-2.0" ]
permissive
numbnet/icepdf_FULL-versii
86d74147dc107e4f2239cd4ac312f15ebbeec473
b67e1ecb60aca88cacdca995d24263651cf8296b
refs/heads/master
2021-01-12T11:13:57.107091
2016-11-04T16:43:45
2016-11-04T16:43:45
72,880,329
1
1
null
null
null
null
UTF-8
Java
false
false
4,761
java
/* * Copyright 2006-2013 ICEsoft Technologies Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the * License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an "AS * IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language * governing permissions and limitations under the License. */ package org.icepdf.core.pobjects.graphics; import org.icepdf.core.pobjects.Reference; import org.icepdf.core.util.Defs; import java.awt.image.BufferedImage; import java.awt.image.DataBuffer; import java.util.LinkedHashMap; import java.util.Map; import java.util.logging.Logger; /** * The Image pool is a Map of the most recently used images. The pools size * by default is setup to be 1/4 the heap size. So as the pool grows it * will self trim to keep the memory foot print at the specified max. The * max pool size can be specified by using the org.icepdf.core.views.imagePoolSize * system property. The value is specified in MB. * <p/> * The pool also contains an executor pool for processing Images. The executor * allows the pageInitialization thread to continue while the executor processes * the image data on another thread. * * @since 5.0 */ public class ImagePool { private static final Logger log = Logger.getLogger(ImagePool.class.toString()); // Image pool private final LinkedHashMap<Reference, BufferedImage> fCache; private static int defaultSize; static { // Default size is 1/4 of heap size. defaultSize = (int) ((Runtime.getRuntime().maxMemory() / 1024L / 1024L) / 4L); defaultSize = Defs.intProperty("org.icepdf.core.views.imagePoolSize", defaultSize); } public ImagePool() { this(defaultSize * 1024 * 1024); } public ImagePool(long maxCacheSize) { fCache = new MemoryImageCache(maxCacheSize); } public void put(Reference ref, BufferedImage image) { // create a new reference so we don't have a hard link to the page // which will likely keep a page from being GC'd. fCache.put(new Reference(ref.getObjectNumber(), ref.getGenerationNumber()), image); } public BufferedImage get(Reference ref) { return fCache.get(ref); } private static class MemoryImageCache extends LinkedHashMap<Reference, BufferedImage> { private final long maxCacheSize; private long currentCacheSize; public MemoryImageCache(long maxCacheSize) { super(16, 0.75f, true); this.maxCacheSize = maxCacheSize; } @Override public BufferedImage put(Reference key, BufferedImage value) { if (containsKey(key)) { BufferedImage removed = remove(key); currentCacheSize = currentCacheSize - sizeOf(removed) + sizeOf(value); super.put(key, value); return removed; } else { currentCacheSize += sizeOf(value); return super.put(key, value); } } private long sizeOf(BufferedImage image) { if (image == null) { return 0L; } DataBuffer dataBuffer = image.getRaster().getDataBuffer(); int dataTypeSize; switch (dataBuffer.getDataType()) { case DataBuffer.TYPE_BYTE: dataTypeSize = 1; break; case DataBuffer.TYPE_SHORT: case DataBuffer.TYPE_USHORT: dataTypeSize = 2; break; case DataBuffer.TYPE_INT: case DataBuffer.TYPE_FLOAT: dataTypeSize = 4; break; case DataBuffer.TYPE_DOUBLE: case DataBuffer.TYPE_UNDEFINED: default: dataTypeSize = 8; break; } return dataBuffer.getSize() * dataTypeSize; } @Override protected boolean removeEldestEntry(Map.Entry<Reference, BufferedImage> eldest) { boolean remove = currentCacheSize > maxCacheSize; if (remove) { long size = sizeOf(eldest.getValue()); currentCacheSize -= size; } return remove; } } }
[ "patrick.corless@8668f098-c06c-11db-ba21-f49e70c34f74" ]
patrick.corless@8668f098-c06c-11db-ba21-f49e70c34f74
15fb0f1198ba99d2ceb62ccc9d1216b2cbe190c0
0a4131ea64c6c70148cc3dde4b87274a88f68e5b
/app/src/main/java/com/marco/santdelivery/MainActivity.java
6bb4c3cc31ec134a21c1163862c4834ffb82d86a
[]
no_license
MarcoAntonioMamani/appcliente
68dabfe25d2165774e4cfde183ad237015c13e36
301e7f6c6834275e53984da3dbacb7a415c0ff94
refs/heads/master
2022-09-24T09:37:19.916760
2020-06-01T02:45:55
2020-06-01T02:45:55
268,303,023
0
0
null
null
null
null
UTF-8
Java
false
false
14,048
java
package com.marco.santdelivery; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import android.Manifest; import android.app.AlertDialog; import android.arch.lifecycle.ViewModelProviders; import android.content.Context; import android.content.DialogInterface; import android.content.Intent; import android.content.SharedPreferences; import android.content.pm.PackageManager; import android.os.Handler; import android.preference.PreferenceManager; import android.support.annotation.NonNull; import android.support.design.widget.NavigationView; import android.support.v4.app.ActivityCompat; import android.support.v4.app.Fragment; import android.support.v4.app.FragmentManager; import android.support.v4.app.FragmentTransaction; import android.support.v4.view.GravityCompat; import android.support.v4.widget.DrawerLayout; import android.support.v7.app.ActionBar; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import android.support.v7.widget.Toolbar; import android.view.KeyEvent; import android.view.Menu; import android.view.MenuItem; import android.widget.TextView; import android.widget.Toast; import com.marco.santdelivery.Carrito.CarritoFragment; import com.marco.santdelivery.Empresas.EmpresasFragment; import com.marco.santdelivery.ShareUtil.DataCache; import com.marco.santdelivery.ShareUtil.DataPreferences; import com.marco.santdelivery.ShareUtil.LocationGeo; import java.util.List; import java.util.concurrent.ExecutionException; public class MainActivity extends AppCompatActivity { private DrawerLayout drawerLayout; private Toolbar toolbar; private ActionBar actionBar; private Handler switchHandler = new Handler(); private Context mContext; private NavigationView navigationView; boolean doubleBackToExitPressedOnce = false; private Boolean bolBienvenida =true; private TextView titleMenu; MenuItem menucli; @Override public void onResume() { super.onResume(); this.setTitle(""); } @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); LocationGeo.getInstance(getApplicationContext(),this); LocationGeo.PedirPermisoApp(); toolbar = (Toolbar) findViewById(R.id.toolbar); setSupportActionBar(toolbar); mContext = this; actionBar = getSupportActionBar(); actionBar.setHomeAsUpIndicator(R.mipmap.ic_menu_white_24dp); actionBar.setDisplayHomeAsUpEnabled(true); titleMenu=(TextView)findViewById(R.id.id_title_main); DataCache.tvTitleMenu =titleMenu; drawerLayout = (DrawerLayout) findViewById(R.id.navigation_drawer_layout); navigationView = (NavigationView) findViewById(R.id.id_navigation_view); if (navigationView != null) { setupNavigationDrawerContent(navigationView); } setupNavigationDrawerContent(navigationView); //First start (Inbox Fragment) setFragment(2); setupUserBox(); IniciarServicio(); menucli.setChecked(true); } public void IniciarServicio(){ if (ActivityCompat.checkSelfPermission(mContext, Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED && ActivityCompat.checkSelfPermission(mContext, Manifest.permission.ACCESS_COARSE_LOCATION) != PackageManager.PERMISSION_GRANTED) { ActivityCompat.requestPermissions(this, new String[]{Manifest.permission.ACCESS_FINE_LOCATION,}, 120); return; } } private void setupNavigationDrawerContent(NavigationView navigationView) { navigationView.setNavigationItemSelectedListener(new NavigationView.OnNavigationItemSelectedListener() { @Override public boolean onNavigationItemSelected(@NonNull MenuItem item) { // String roles = UserPrefs.getInstance(getApplicationContext()).getRoles(); switch (item.getItemId()) { case R.id.item_navigation_drawer_sincronizar: item.setChecked(true); setFragment(1); drawerLayout.closeDrawer(GravityCompat.START); return true; case R.id.item_store: item.setChecked(true); setFragment(2); drawerLayout.closeDrawer(GravityCompat.START); return true; case R.id.item_carrito: setFragment(3); item.setChecked(true); //setFragment(2); drawerLayout.closeDrawer(GravityCompat.START); return true; case R.id.item_navigation_drawer_entregados: setFragment(4); item.setChecked(true); //setFragment(2); drawerLayout.closeDrawer(GravityCompat.START); return true; case R.id.item_navigation_drawer_mapa: setFragment(5); item.setChecked(true); //setFragment(2); drawerLayout.closeDrawer(GravityCompat.START); return true; case R.id.item_navigation_drawer_help_and_feedback: item.setChecked(true); setFragment(21); drawerLayout.closeDrawer(GravityCompat.START); return true; } return true; } }); } public void setFragment(int position){ Fragment frag = null; String tag = ""; boolean switchFrag = true; switch (position){ case 0: loadWelcomeFragment(); break; case 1: returnToMain(); /* frag = new SincronizarFragment(); tag = Constantes.TAG_SINCRONIZACION;*/ break; case 2: returnToMain(); frag = new EmpresasFragment(); tag = "Empresas"; break; case 3: returnToMain(); frag = new CarritoFragment(); tag = "Ver Carrito"; break; case 4: returnToMain(); /*frag = new ListPedidosFragment(3); tag = Constantes.TAG_PEDIDOS;*/ break; case 21: AlertDialog.Builder builder = new AlertDialog.Builder(mContext); builder .setTitle("Tu Entrega") .setMessage("Está seguro(a) de finalizar la sesión?.") .setIcon(R.drawable.ic_iinfo) .setPositiveButton(mContext.getResources().getString(R.string.accept), new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int which) { MainActivity.this.runOnUiThread(new Runnable() { @Override public void run() { /*startActivity(new Intent(MainActivity.this, LoginActivity.class)); finish();*/ } }); } }) .setNegativeButton(mContext.getResources().getString(R.string.cancel), null) .show(); break; } if (switchFrag) { switchFragment(frag,tag); //addFragment(new WelcomeFragment(),frag,tag); } } public void switchFragment(final Fragment frag, final String tag){ switchHandler.postDelayed(new Runnable() { @Override public void run() { try{ FragmentManager fm = getSupportFragmentManager(); FragmentTransaction ft = fm.beginTransaction(); ft.setCustomAnimations(R.transition.left_in,R.transition.left_out); ft.addToBackStack(tag) .replace(R.id.fragmentMain, frag,tag) .commit(); }catch(Exception e){} } }, 100); } private void setupUserBox() { // TODO: Poblar más views, agregar más acciones // Poner email TextView userNameView = (TextView) navigationView.getHeaderView(0).findViewById(R.id.menu_name); TextView userEmailView = (TextView) navigationView.getHeaderView(0).findViewById(R.id.menu_email); /* String userName = UserPrefs.getInstance(mContext).getUserName(); String userEmail = UserPrefs.getInstance(mContext).getUserEmail();*/ String nameRepartidor= DataPreferences.getPref("cliente",getApplicationContext()); /*userNameView.setText("Bienvenido : "); userEmailView.setText(nameRepartidor);*/ userNameView.setText("Bienvenido : Usuario Invitado"); userEmailView.setText("Telf: S/N"); MenuItem menulcv = navigationView.getMenu().findItem(R.id.item_navigation_drawer_sincronizar); menucli= navigationView.getMenu().findItem(R.id.item_store); MenuItem menuped = navigationView.getMenu().findItem(R.id.item_carrito); MenuItem menuMapa = navigationView.getMenu().findItem(R.id.item_navigation_drawer_mapa); MenuItem menupedEntregados = navigationView.getMenu().findItem(R.id.item_navigation_drawer_entregados); menulcv.setVisible(true); menucli.setVisible(true); menuped.setVisible(true); menuMapa.setVisible(true); menupedEntregados.setVisible(true); } @Override public boolean onKeyUp(int keyCode, KeyEvent event) { switch (keyCode){ case KeyEvent.KEYCODE_BACK: if (drawerLayout.isDrawerOpen(GravityCompat.START)) { drawerLayout.closeDrawer(GravityCompat.START); } else if (getSupportFragmentManager().getBackStackEntryCount() > 1){ //getSupportFragmentManager().popBackStack("WELCOMEFRAGMENT", 0); getSupportFragmentManager().popBackStack(); } else { if (getSupportFragmentManager().getFragments().size() >1){ removeAllFragments(); loadWelcomeFragment(); return true; } if (doubleBackToExitPressedOnce){ super.onBackPressed(); finish(); return true; } this.doubleBackToExitPressedOnce = true; Toast.makeText(mContext, "Click nuevamente para salir.", Toast.LENGTH_SHORT).show(); //Please click BACK again to exit new Handler().postDelayed(new Runnable() { @Override public void run() { doubleBackToExitPressedOnce=false; } }, 2000); return true; } return true; default: return super.onKeyUp(keyCode, event); } } @Override public boolean onCreateOptionsMenu(Menu menu) { // Inflate the menu; this adds items to the action bar if it is present. getMenuInflater().inflate(R.menu.byte_code, menu); return true; } @Override public boolean onOptionsItemSelected(MenuItem item) { switch (item.getItemId()) { case android.R.id.home: drawerLayout.openDrawer(GravityCompat.START); return true; } return super.onOptionsItemSelected(item); } private void loadWelcomeFragment(){ /* switchHandler.post(new Runnable() { @Override public void run() { getSupportFragmentManager() .beginTransaction() .addToBackStack("WELCOMEFRAGMENT") .replace(R.id.fragmentMain, new EmpresasFragment()) .commit(); } });*/ } public void CambiarFragment(final Fragment fragmento, final String tag){ switchHandler.postDelayed(new Runnable() { @Override public void run() { try{ FragmentManager fm = getSupportFragmentManager(); FragmentTransaction ft = fm.beginTransaction(); ft.addToBackStack(tag) .replace(R.id.fragmentMain, fragmento,tag) .commit(); }catch(Exception e){} } }, 100); } public void returnToMain(){ //getSupportFragmentManager().popBackStack("WELCOMEFRAGMENT",0); removeAllFragments(); loadWelcomeFragment(); } public void removeAllFragments() { if (getSupportFragmentManager().getFragments().size() > 0) { FragmentManager fragmentManager = getSupportFragmentManager(); FragmentTransaction fragmentTransaction = fragmentManager.beginTransaction(); for (Fragment activeFragment : getSupportFragmentManager().getFragments()) { fragmentTransaction.remove(activeFragment); } getSupportFragmentManager().getFragments().clear(); fragmentTransaction.commit(); getSupportFragmentManager().popBackStackImmediate(); } } }
[ "marcoantoniomamanichura@gmail.com" ]
marcoantoniomamanichura@gmail.com
f916b6f19fe7963af1feec2ef236542f77c0a9fa
5862355bdd793c8fca35ab7fd559adffa7c1d16e
/src/test/java/com/test/DependencyGroupsTestUsingAnnotation.java
670f8e7f650cded10f534db4faf06a899b0134ba
[]
no_license
toddlerya/LearnTestNG
37d6120d76acaa320e2e31f4c8f2b36d14e9bbb8
68c254b4666131a8bcbdd0d7b2332d79c311f883
refs/heads/master
2021-01-05T21:27:39.794913
2020-02-22T16:05:24
2020-02-22T16:05:24
241,139,805
0
0
null
null
null
null
UTF-8
Java
false
false
936
java
package com.test; import com.demo.MessageUtil; import org.testng.Assert; import org.testng.annotations.Test; /** * @Author evi1 * @Create 2020/2/18 15:09 */ public class DependencyGroupsTestUsingAnnotation { String message = "Thor"; MessageUtil messageUtil = new MessageUtil(message); @Test(groups = {"init"}) public void testPrintMessage() { System.out.println("inside DependencyGroups testPrintMessage()"); Assert.assertEquals(messageUtil.printMessage(), message); } @Test(dependsOnGroups = {"init.*"}) public void testSalutationMessage() { System.out.println("inside DependencyGroups testSalutationMessage()"); message = "Hi!" + message; Assert.assertEquals(messageUtil.salutationMessage(), message); } @Test(groups = {"init"}) public void initEnvironmentTest() { System.out.println("This is DependencyGroups EnvironmentTest"); } }
[ "toddlerya@gmail.com" ]
toddlerya@gmail.com
bb729bd65f640f93c77056bec450d05093422872
0a8c35c200dd0b817979abd5913ef8fe468b7224
/app/src/main/java/com/example/archek/gamesinfo/PrefsConst.java
bac45d94bcc4f6e99250627d86edbeca2e39267f
[]
no_license
ArchkWay/GamesInfo
ec37486512c9785d486da0b9492f2db37a026dc4
c2eb3b7b421ded195d37c802f9a9e6e54175cac1
refs/heads/master
2020-03-22T04:57:32.839642
2018-09-21T10:02:32
2018-09-21T10:02:32
139,532,171
0
0
null
null
null
null
UTF-8
Java
false
false
236
java
package com.example.archek.gamesinfo; public interface PrefsConst { int SETTING_DEFAULT_AMOUNT = 10; String SETTINGS_GAME_AMOUNT = "SETTINGS_GAMES_AMOUNT"; String SETTINGS_COMPANIES_AMOUNT = "SETTINGS_COMPANIES_AMOUNT"; }
[ "Ovchinnikowork@gmail.com" ]
Ovchinnikowork@gmail.com
e601b7385b9e74dc57d2d0b1162c73c1db7aa0e1
f02d639343b03162226143600e47af59a4338d27
/src/main/java/dev/webapi/repository/CollaborateurRepository.java
0483140ed44f0d16806a161158e929317cbb2eb7
[]
no_license
hmerciol/sirh-gestion-personnel-webapi
7e7392711f25623e3db694b41baf17e4b55bcbca
4c83a8241f16c22a28eb59c395a7bd2dca85cc0c
refs/heads/master
2021-05-02T12:06:41.510915
2018-02-08T13:46:07
2018-02-08T13:46:07
120,736,746
0
0
null
null
null
null
UTF-8
Java
false
false
228
java
package dev.webapi.repository; import org.springframework.data.jpa.repository.JpaRepository; import dev.webapi.entite.Collaborateur; public interface CollaborateurRepository extends JpaRepository<Collaborateur, Integer> { }
[ "li.henri@merciol.fr" ]
li.henri@merciol.fr
626e9e09c53559568767f814660ac05b6c0f4f99
12e507dd7b7c5e8d379a8b8fb3c71ea367228414
/src/main/java/com/nam/_000/acmp_0006/Main.java
8c82e16885ec50791fb425aedcbafe8fbc40cb0f
[]
no_license
YershovAleksandr/Java_020_ACMP
20f4be6627da6fb6b8f499d1f57eabb58da343f3
0349206072fcb289fb46cc50c3f7a83412e04db0
refs/heads/master
2020-03-30T01:25:03.686715
2019-02-16T18:01:17
2019-02-16T18:01:17
150,574,834
0
0
null
null
null
null
UTF-8
Java
false
false
1,566
java
package com.nam._000.acmp_0006; import java.io.PrintWriter; import java.util.Scanner; public class Main { public static void main(String[] args){ Scanner in = new Scanner(System.in); PrintWriter out = new PrintWriter(System.out); String step = in.nextLine(); if (!isCorrectValue(step)){ out.println("ERROR"); } else if (isCorrectStep(step)){ out.println("YES"); } else { out.println("NO"); } out.flush(); } public static boolean isCorrectValue(String step){ if ((step.length() != 5) || (step.charAt(2) != '-') || step.charAt(0) < 'A' || step.charAt(0) > 'H' || step.charAt(3) < 'A' || step.charAt(3) > 'H' || step.charAt(1) < '1' || step.charAt(1) > '8' || step.charAt(4) < '1' || step.charAt(4) > '8'){ return false; } return true; } public static boolean isCorrectStep(String step) { int vStep = step.charAt(1) - step.charAt(4); int hStep = step.charAt(0) - step.charAt(3); if ((vStep == -2 && hStep == -1) || (vStep == -2 && hStep == 1) || (vStep == 2 && hStep == -1) || (vStep == 2 && hStep == 1) || (vStep == -1 && hStep == 2) || (vStep == -1 && hStep == -2) || (vStep == 1 && hStep == 2) || (vStep == 1 && hStep == -2)){ return true; } return false; } }
[ "namstudionsk@gmail.com" ]
namstudionsk@gmail.com
0b52bb906c2da04f88e62aa63de068928d41c74c
e096c758789d6091351d922a8f30f6f6fa5ed60c
/src/com/nv/youNeverWait/user/bl/validation/DoctorValidator.java
a1cdaf7b8efbe4ffeecd44b2695025b4c44c9cb4
[]
no_license
netvarth/netmdportal
0487f5221bdc6f7a0e9156f96d122dcea42ff191
a60171d76e82b02fbf074db4a7dd2814a10d0866
refs/heads/master
2021-03-16T09:54:50.043949
2016-08-04T10:53:34
2016-08-04T10:53:34
63,756,828
0
0
null
null
null
null
UTF-8
Java
false
false
10,668
java
/** * DoctorValidator.java * * Dec 19, 2012 * * @author Asha Chandran */ package com.nv.youNeverWait.user.bl.validation; import java.text.DateFormat; import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.Date; import com.nv.youNeverWait.common.Constants; import com.nv.youNeverWait.exception.ServiceException; import com.nv.youNeverWait.pl.entity.ErrorCodeEnum; import com.nv.youNeverWait.pl.entity.NetmdUserTypeEnum; import com.nv.youNeverWait.rs.dto.DoctorAchievementDTO; import com.nv.youNeverWait.rs.dto.DoctorDetail; import com.nv.youNeverWait.rs.dto.DoctorExperienceDTO; import com.nv.youNeverWait.rs.dto.DoctorExpertiseDTO; import com.nv.youNeverWait.rs.dto.DoctorMembershipDTO; import com.nv.youNeverWait.rs.dto.DoctorQualificationDTO; import com.nv.youNeverWait.rs.dto.HeaderDTO; import com.nv.youNeverWait.rs.dto.LoginDTO; import com.nv.youNeverWait.rs.dto.Parameter; public class DoctorValidator { /** * Validates userName and password * * @param userName * @param password */ public void validateUserNameAndPassword(String userName, String password) { if (userName == null || userName.isEmpty()) { ServiceException se = new ServiceException( ErrorCodeEnum.InvalidUserName); se.setDisplayErrMsg(true); throw se; } if (password == null || password.isEmpty()) { ServiceException se = new ServiceException( ErrorCodeEnum.InvalidPassword); se.setDisplayErrMsg(true); throw se; } } /** * Validates doctor details * * @param doctor * @param header */ public void validateCreateDoctor(DoctorDetail doctor, HeaderDTO header) { validateHeaderDetails(header); if (!isValidName(doctor.getFirstName())) { ServiceException se = new ServiceException( ErrorCodeEnum.InvalidName); se.setDisplayErrMsg(true); throw se; } if (!isValidName(doctor.getEmail())) { ServiceException se = new ServiceException(ErrorCodeEnum.EmailNull); se.setDisplayErrMsg(true); throw se; } if (doctor.getEmail() != null && !doctor.getEmail().equals("")) { if (!doctor .getEmail() .matches( "[_A-Za-z0-9-]+(\\.[_A-Za-z0-9-]+)*@[A-Za-z0-9]+(\\.[A-Za-z0-9]+)*(\\.[A-Za-z]{2,})")) { ServiceException se = new ServiceException( ErrorCodeEnum.InvalidMailId); se.setDisplayErrMsg(true); throw se; } } if (doctor.getPhone() != null && !doctor.getPhone().equals("")) { if (!doctor.getPhone().matches("^0?[1-9]{1}[0-9]{9}$")) { ServiceException se = new ServiceException( ErrorCodeEnum.InvalidPhoneFormat); se.setDisplayErrMsg(true); throw se; } } if (doctor.getMobile() != null && !doctor.getMobile().equals("")) { if (!doctor.getMobile().matches("\\d{10}")) { ServiceException se = new ServiceException( ErrorCodeEnum.InvalidMobileFormat); se.setDisplayErrMsg(true); throw se; } } if (doctor.getDateOfBirth() != null) { if (!doctor.getDateOfBirth().matches("\\d{4}-\\d{2}-\\d{2}")) { ServiceException se = new ServiceException( ErrorCodeEnum.InvalidDateFormat); se.setDisplayErrMsg(true); throw se; } DateFormat df = new SimpleDateFormat( Constants.DATE_FORMAT_WITHOUT_TIME); try { Date dob = df.parse(doctor.getDateOfBirth()); } catch (ParseException e) { e.printStackTrace(); ServiceException se = new ServiceException( ErrorCodeEnum.InvalidDateFormat); se.setDisplayErrMsg(true); throw se; } } if (!doctor.getDoctorExperience().isEmpty()) { for (DoctorExperienceDTO doctorExperience : doctor .getDoctorExperience()) { // Validate doctor experience details validateDoctorExperience(doctorExperience); } } if (!doctor.getDoctorQualifications().isEmpty()) { for (DoctorQualificationDTO doctorQualificaton : doctor .getDoctorQualifications()) { // Validate doctor educational qualification details validateDoctorQualification(doctorQualificaton); } } if (!doctor.getAchievement().isEmpty()) { for (DoctorAchievementDTO doctorAchievement : doctor .getAchievement()) { // Validate doctor achievemnet details validateDoctorAchievement(doctorAchievement); } } if (!doctor.getMembership().isEmpty()) { for (DoctorMembershipDTO doctorMembership : doctor.getMembership()) { // Validate doctor membership details validateDoctorMembership(doctorMembership); } } if (!doctor.getExpertise().isEmpty()) { for (DoctorExpertiseDTO doctorExpertise : doctor.getExpertise()) { // Validate doctor membership details validateDoctorExpertise(doctorExpertise); } } } /** * Validates doctor qualification details * * @param doctorQualificaton */ public void validateDoctorQualification( DoctorQualificationDTO doctorQualificaton) { if (doctorQualificaton.getPassedOutDate() == null) { ServiceException se = new ServiceException( ErrorCodeEnum.InvalidDateFormat); se.setDisplayErrMsg(true); throw se; } if (!isValidName(doctorQualificaton.getEducationalDegree())) { ServiceException se = new ServiceException( ErrorCodeEnum.InvalidName); se.setDisplayErrMsg(true); throw se; } if (!isValidName(doctorQualificaton.getInstitution())) { ServiceException se = new ServiceException( ErrorCodeEnum.InvalidName); se.setDisplayErrMsg(true); throw se; } } /** * Validates doctor experience details * * @param doctorExperience */ public void validateDoctorExperience(DoctorExperienceDTO doctorExperience) { if (doctorExperience.getFromDate() != null && doctorExperience.getToDate() != null) { if (!doctorExperience.getFromDate().matches("\\d{4}-\\d{2}-\\d{2}") || !doctorExperience.getToDate().matches( "\\d{4}-\\d{2}-\\d{2}")) { ServiceException se = new ServiceException( ErrorCodeEnum.InvalidDateFormat); se.setDisplayErrMsg(true); throw se; } DateFormat df1 = new SimpleDateFormat( Constants.DATE_FORMAT_WITHOUT_TIME); Date fromDate; Date toDate; try { fromDate = df1.parse(doctorExperience.getFromDate()); toDate = df1.parse(doctorExperience.getToDate()); if (fromDate.after(toDate)) { ServiceException se = new ServiceException( ErrorCodeEnum.InvalidFromToDate); se.setDisplayErrMsg(true); throw se; } } catch (ParseException e) { e.printStackTrace(); ServiceException se = new ServiceException( ErrorCodeEnum.InvalidDateFormat); se.setDisplayErrMsg(true); throw se; } } } /** * Validates doctor acheivement details * * @param doctorAchievement */ public void validateDoctorAchievement(DoctorAchievementDTO doctorAchievement) { if (!isValidName(doctorAchievement.getAchievement())) { ServiceException se = new ServiceException( ErrorCodeEnum.InvalidAchievement); se.setDisplayErrMsg(true); throw se; } } /** * Validates doctor membership details * * @param doctorMembership */ public void validateDoctorMembership(DoctorMembershipDTO doctorMembership) { if (!isValidName(doctorMembership.getMembership())) { ServiceException se = new ServiceException( ErrorCodeEnum.InvalidMemberShip); se.setDisplayErrMsg(true); throw se; } } /** * Validates doctor expertise details * * @param doctorExpertise */ public void validateDoctorExpertise(DoctorExpertiseDTO doctorExpertise) { if (!isValidName(doctorExpertise.getExpertise())) { ServiceException se = new ServiceException( ErrorCodeEnum.InvalidExpertise); se.setDisplayErrMsg(true); throw se; } } /** * Method performed to validate login details * * @param user * @return ErrorDTO */ public void validateCreateUser(LoginDTO user) { if (!isValidName(user.getUserName())) { ServiceException se = new ServiceException( ErrorCodeEnum.UserNameNull); se.setDisplayErrMsg(true); throw se; } if (!isValidName(user.getPassword())) { ServiceException se = new ServiceException( ErrorCodeEnum.PasswordNull); se.setDisplayErrMsg(true); throw se; } if (!isValidName(user.getUserType())) { ServiceException se = new ServiceException( ErrorCodeEnum.UserTypeNull); se.setDisplayErrMsg(true); throw se; } NetmdUserTypeEnum usertype= NetmdUserTypeEnum.getEnum(user.getUserType()); } /** * Method to validte doctor details for updation * * @param doctor * @param header * @return ErrorDTO */ public void validateUpdateDoctor(DoctorDetail doctor, HeaderDTO header) { if (doctor.getGlobalId() <= 0) { ServiceException se = new ServiceException( ErrorCodeEnum.InvalidGlobalId); se.setDisplayErrMsg(true); throw se; } validateCreateDoctor(doctor, header); } /** * Method for null checking * * @param value */ private boolean isValidName(String value) { if (value != null && !value.equals("")) { return true; } return false; } /** * Method to validate header details * * @param header * @return ErrorDTO */ public void validateHeaderDetails(HeaderDTO header) { if (header.getHeadOfficeId() <= 0) { ServiceException se = new ServiceException( ErrorCodeEnum.NetMdIdNull); se.setDisplayErrMsg(true); throw se; } if (header.getPassPhrase() == null || header.getPassPhrase().equals("")) { ServiceException se = new ServiceException( ErrorCodeEnum.PassPhraseNull); se.setDisplayErrMsg(true); throw se; } if (header.getBranchId() <= 0) { ServiceException se = new ServiceException( ErrorCodeEnum.BranchMissMatch); se.addParam(new Parameter(Constants.ID, Integer.toString(header.getBranchId()))); se.setDisplayErrMsg(true); throw se; } if (header.getMacId() == null || header.getMacId().equals("")) { ServiceException se = new ServiceException(ErrorCodeEnum.MacIdNull); se.setDisplayErrMsg(true); throw se; } } /** * Method to validate global Id and header details * * @param globalId * @param header * @return ErrorDTO */ public void validateGlobalId(int globalId) { if (globalId <= 0) { ServiceException se = new ServiceException( ErrorCodeEnum.InvalidGlobalId); se.setDisplayErrMsg(true); throw se; } } }
[ "manikandan@33b5678d-7e6b-764b-8695-d616d715c8b5" ]
manikandan@33b5678d-7e6b-764b-8695-d616d715c8b5
4d5faaa58e43ba47234d6e39298ff21c7effddda
7101fb712143092126af62835223dbc22394c08d
/app/src/main/java/it/unimib/librichepassione/SearchDetailFragment.java
b0fb5bec2519d6d092ec989f9246f5922af93838
[]
no_license
gmele9/LibriChePassione
31a9af7228a93dad42bfb65237cedf5a0f3eea9c
f8a3eb86152c9c1ae836a312165aa80a5e863b67
refs/heads/master
2022-11-28T15:48:06.137113
2020-07-16T15:46:04
2020-07-16T15:46:04
277,797,985
0
0
null
null
null
null
UTF-8
Java
false
false
7,175
java
package it.unimib.librichepassione; import android.app.AlertDialog; import android.content.Context; import android.content.Intent; import android.content.SharedPreferences; import android.os.Bundle; import androidx.annotation.NonNull; import androidx.annotation.Nullable; import androidx.fragment.app.Fragment; import androidx.fragment.app.FragmentActivity; import android.util.Log; import android.view.Gravity; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.Button; import android.widget.ImageView; import android.widget.TextView; import android.widget.Toast; import com.google.gson.Gson; import com.google.gson.reflect.TypeToken; import com.squareup.picasso.Picasso; import java.lang.reflect.Type; import java.util.ArrayList; import java.util.List; import it.unimib.librichepassione.model.BookInfo; public class SearchDetailFragment extends Fragment { private TextView textViewTitle; private TextView textViewAuthor; private TextView textViewPublisher; private TextView textViewPublisherDate; private TextView textViewISBN; private TextView textViewCategories; private ImageView imageViewThumbnail; private Button buttonAddPreferences; private SharedPreferences sp; private static final String TAG = "SearchDetailFragment"; @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { // Inflate the layout for this fragment return inflater.inflate(R.layout.fragment_search_detail, container, false); } @Override public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) { super.onViewCreated(view, savedInstanceState); textViewTitle = view.findViewById(R.id.textViewSearchDetailTitle); textViewAuthor = view.findViewById(R.id.textViewSearchDetailAuthor); textViewPublisher = view.findViewById(R.id.textViewSearchDetailPublisher); textViewPublisherDate = view.findViewById(R.id.textViewSearchDetailPublisherDate); textViewISBN = view.findViewById(R.id.textViewSearchDetailISBN); textViewCategories = view.findViewById(R.id.textViewSearchDetailCategories); imageViewThumbnail = view.findViewById(R.id.imageViewSearchDetail); BookInfo book = SearchDetailFragmentArgs.fromBundle(getArguments()).getBook(); Log.d(TAG, "book" + book); Log.d(TAG, "titolo: " + book.getTitle()); if(book.getTitle() != null) { textViewTitle.setText(book.getTitle()); } Log.d(TAG, "autore: " + book.getAuthor()); if(book.getAuthor() != null) { textViewAuthor.setText(book.getAuthor()); } Log.d(TAG, "publisher: " + book.getPublisher()); if(book.getPublisher() != null) { textViewPublisher.setText(book.getPublisher()); } Log.d(TAG, "data: " + book.getPublishedDate()); if(book.getPublishedDate() != null) { textViewPublisherDate.setText(book.getPublishedDate()); } Log.d(TAG, "cat: " + book.getCategories()); if(book.getCategories() != null) { textViewCategories.setText(book.getCategories()); } String isbn = ""; Log.d(TAG, "ID: " + book.getIndustryIdentifiers()); for (int i = 0; i < book.getIndustryIdentifiers().size(); i++) { if (i == book.getIndustryIdentifiers().size() - 1) { if(book.getIndustryIdentifiers().get(i).getType() != null) isbn = isbn + book.getIndustryIdentifiers().get(i).getType().replace("_", " ") + "= " + book.getIndustryIdentifiers().get(i).getIdentifier(); } else { if(book.getIndustryIdentifiers().get(i).getType() != null) isbn = isbn + book.getIndustryIdentifiers().get(i).getType().replace("_", " ") + "= " + book.getIndustryIdentifiers().get(i).getIdentifier() + "\n"; } } textViewISBN.setText(isbn); String url; if(book.getThumbnail() != null) { url = book.getThumbnail().replace("http", "https"); Picasso.get().load(url).into(imageViewThumbnail); } else{ url = "https://cdn1.iconfinder.com/data/icons/error-warning-triangles/24/more-alt-triangle-128.png"; Picasso.get().load(url).into(imageViewThumbnail); } buttonAddPreferences = view.findViewById(R.id.buttonAddPreferences); //SharedPreferences sharedPreferences = this.getActivity().getSharedPreferences("MY_USER_PREF", Context.MODE_PRIVATE); buttonAddPreferences.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { addFavorite(book); } }); } public void addFavorite(BookInfo bookInfo) { Boolean trovato = false; String gStringInput; List<BookInfo> bookInfoList = new ArrayList<>(); SharedPreferences sharedPreferences = this.getActivity().getSharedPreferences("MY_USER_PREF", Context.MODE_PRIVATE); String gString = sharedPreferences.getString("list", ""); Gson gson = new Gson(); Type type = new TypeToken<List<BookInfo>>() {}.getType(); bookInfoList = gson.fromJson(gString, type); Log.d(TAG, "booklist" + bookInfoList); if (bookInfoList != null) { for (int i = 0; i < bookInfoList.size(); i++) { if (bookInfo.getIndustryIdentifiers().get(0).getIdentifier() .equals(bookInfoList.get(i).getIndustryIdentifiers().get(0).getIdentifier())) { trovato = true; break; } } if (trovato) { AlertDialog.Builder builder = new AlertDialog.Builder(getActivity()); builder.setTitle(R.string.ErrorTitle); builder.setMessage("'" + bookInfo.getTitle() + "' " + getResources().getString(R.string.ErrorFavorites)); builder.show(); } else { Toast toast = Toast.makeText(getActivity(), bookInfo.getTitle() + " " + getResources().getString(R.string.AddedToFavorites), Toast.LENGTH_SHORT); toast.setGravity(Gravity.CENTER, 0, 0); toast.show(); bookInfoList.add(bookInfo); gStringInput = gson.toJson(bookInfoList); SharedPreferences.Editor editor = sharedPreferences.edit(); editor.putString("list", gStringInput); editor.commit(); } } else { Log.d(TAG,"dentro else"); List<BookInfo> infoList = new ArrayList<>(); infoList.add(bookInfo); gStringInput = gson.toJson(infoList); SharedPreferences.Editor editor = sharedPreferences.edit(); editor.putString("list", gStringInput); editor.commit(); } } }
[ "g.mele9@campus.unimib.it" ]
g.mele9@campus.unimib.it
b2bdcf36f1ecb47f7291a0520beb5f2fa991c9b2
b4cd00e9241dc52d97ae6052bf8b3b8c1adef350
/tes-tsvc/src/main/java/com/qingqing/test/client/PassportPiClient.java
9ccea9279458ea50cb506d45fc4f9760f3123ebf
[]
no_license
AntinZhu/QingTest
17aa1a8dbcaceb1de32a9d7d26688cd167ffef1d
6b4863db50b3e75f3b4570c5f387a1bcd5cf99f0
refs/heads/master
2022-06-29T11:38:35.367432
2021-08-18T02:32:40
2021-08-18T02:32:40
146,688,664
2
1
null
2022-06-22T19:15:01
2018-08-30T03:06:18
JavaScript
UTF-8
Java
false
false
1,860
java
package com.qingqing.test.client; import com.qingqing.api.passort.proto.PassportLoginProto.PassportLoginResponse; import com.qingqing.api.passort.proto.PassportLoginProto.PassportTkLoginRequestV2; import com.qingqing.api.passort.proto.PassportQueryProto.PassportQueryUserInfoRequest; import com.qingqing.api.passort.proto.PassportQueryProto.PassportQueryUserInfoResponse; import com.qingqing.api.passort.proto.PassportQueryProto.PassportQueryUserPhoneNumberRequest; import com.qingqing.api.passort.proto.PassportQueryProto.PassportQueryUserPhoneNumberResponse; import com.qingqing.common.web.protobuf.ProtoResponseBody; import com.qingqing.test.config.feign.MyPiFeignConfiguration; import org.springframework.cloud.netflix.feign.FeignClient; import org.springframework.web.bind.annotation.PostMapping; /** * Created by zhujianxing on 2017/8/15. */ @FeignClient(value = "passportPiClient", url = "http://gateway.{env}.idc.cedu.cn/passportsvc/api/pi", configuration = MyPiFeignConfiguration.class) public interface PassportPiClient { /* protobuf */ @PostMapping(value = "/v2/auth/refresh", consumes="application/x-protobuf", produces = "application/x-protobuf") @ProtoResponseBody PassportLoginResponse getTokenAndSession(PassportTkLoginRequestV2 request); /* protobuf */ @PostMapping(value = "/v1/account/query_user_phone_number", consumes="application/x-protobuf", produces = "application/x-protobuf") @ProtoResponseBody PassportQueryUserPhoneNumberResponse queryUserPhoneNumber(PassportQueryUserPhoneNumberRequest request); /* protobuf */ @PostMapping(value = "/v1/account/query_user_by_account", consumes="application/x-protobuf", produces = "application/x-protobuf") @ProtoResponseBody PassportQueryUserInfoResponse queryUserByAccount(PassportQueryUserInfoRequest request); }
[ "zhujianxing@changingedu.com" ]
zhujianxing@changingedu.com
264aa8aee030de451e17a5bbd8eb93299de7b7dd
9216ec7959de16732284c87372fe8ab388b5e384
/service/hive/src/main/java/org/saarus/service/sql/io/TableRCFileWriter.java
ee4e7a95016e00b25e7b1c8252a3e731e9d5debc
[]
no_license
tuan08/Saarus
9d4c3061052bea8dd0d79a2301d62966a33860ac
b7d6fca9ffe71ab813a58b44c002590772e1aeab
refs/heads/master
2020-07-15T11:34:04.654042
2015-02-15T12:34:20
2015-02-15T12:34:20
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,808
java
package org.saarus.service.sql.io; import java.io.IOException; import java.util.Iterator; import java.util.Map; import java.util.Properties; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.fs.FileSystem; import org.apache.hadoop.fs.Path; import org.apache.hadoop.hive.ql.io.RCFile; import org.apache.hadoop.hive.serde.serdeConstants; import org.apache.hadoop.hive.serde2.columnar.BytesRefArrayWritable; import org.apache.hadoop.hive.serde2.columnar.BytesRefWritable; import org.apache.hadoop.hive.serde2.columnar.ColumnarSerDe; import org.apache.hadoop.io.Text; import org.apache.hadoop.io.compress.DefaultCodec; public class TableRCFileWriter implements TableWriter { private FileSystem fs ; private String file ; private RCFile.Writer writer ; private ColumnarSerDe serDe ; public TableRCFileWriter(FileSystem fs, String file, String[] colNames, Map<String, String> meta) throws Exception { this.fs = fs ; this.file = file ; Configuration conf = fs.getConf() ; Text[] textHeader = null ; if(meta == null ) { textHeader = new Text[] {} ; } else { textHeader = new Text[meta.size() * 2] ; Iterator<Map.Entry<String, String>> i = meta.entrySet().iterator() ; int count = 0 ; while(i.hasNext()) { Map.Entry<String, String> entry = i.next() ; textHeader[count] = new Text(entry.getKey()) ; textHeader[count + 1] = new Text(entry.getValue()) ; count += 2 ; } } conf.setInt(RCFile.COLUMN_NUMBER_CONF_STR, colNames.length) ; writer = new RCFile.Writer(fs, conf, new Path(file), null, RCFile.createMetadata(textHeader), new DefaultCodec()); serDe = new ColumnarSerDe(); serDe.initialize(conf, createProperties()); } public void writeRow(String ... data) throws IOException { BytesRefArrayWritable bytes = new BytesRefArrayWritable(data.length); for(int i = 0; i < data.length; i++) { byte[] buf = null ; if(data[i] == null) buf = "NULL".getBytes("UTF-8"); else buf = data[i].getBytes("UTF-8") ; bytes.set(i, new BytesRefWritable(buf, 0, buf.length)); } writer.append(bytes); bytes.clear(); } public void close() throws IOException { writer.close() ; } static Properties createProperties() { Properties tbl = new Properties(); // Set the configuration parameters tbl.setProperty(serdeConstants.SERIALIZATION_FORMAT, "9"); tbl.setProperty("columns", "abyte,ashort,aint,along,adouble,astring,anullint,anullstring"); tbl.setProperty("columns.types","tinyint:smallint:int:bigint:double:string:int:string"); tbl.setProperty(serdeConstants.SERIALIZATION_NULL_FORMAT, "NULL"); return tbl; } }
[ "tuan08@gmail.com" ]
tuan08@gmail.com
e80109a0a4d096c0fee9040f91176265d553b525
b8f3536f21400859ea8163963c27dc090b96a9bf
/src/Enums/CookingInstruction.java
6b0653ce43347e8b2d9bd3b8e1474023068caaae
[]
no_license
Awesomium40/PizzaOrderingGUI
2cd2738720a803df841c93d3e97e72fcf796e3d6
051c5bf7d5dfa041ef84da12928de1225576e4ff
refs/heads/main
2023-06-20T11:37:27.016010
2021-07-14T02:41:27
2021-07-14T02:41:27
124,742,361
0
0
null
null
null
null
UTF-8
Java
false
false
298
java
package Enums; public enum CookingInstruction { NORMAL, LIGHT_BAKE, WELL_DONE; private static final String[] names = {"Normal Bake", "Light Bake", "Well Done"}; public boolean isDefault() { return this.ordinal() == 0; } public String toString() { return names[this.ordinal()]; } }
[ "justin.walthers@hotmail.com" ]
justin.walthers@hotmail.com
028263e3fca846d3a55a015ee5b550f1d8c8bbf2
4ea067acb246d315612ec24697f0c8739820a51a
/app/src/main/java/com/example/lhilf/leistungensammler/CameraActivity.java
899c1059557f30539a11bf87fe225c300c02316b
[]
no_license
Luke004/gerichtesammler
6da1f6203d0b3bc7e817c2be3d038e6acc0ae2c8
acee27765aab9252e72105fb744f923ab9f2ac8c
refs/heads/master
2022-12-08T17:22:57.777088
2020-08-31T14:44:41
2020-08-31T14:44:41
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,853
java
package com.example.lhilf.leistungensammler; import android.app.Activity; import android.content.Intent; import android.os.Bundle; import android.support.v7.app.AppCompatActivity; import java.io.File; import java.io.IOException; import io.fotoapparat.Fotoapparat; import io.fotoapparat.result.PendingResult; import io.fotoapparat.result.PhotoResult; import io.fotoapparat.view.CameraView; import kotlin.Unit; public class CameraActivity extends AppCompatActivity { private String m_current_photo_path; private Fotoapparat fotoapparat; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_camera); CameraView cameraView = findViewById(R.id.camera_view); fotoapparat = new Fotoapparat(this, cameraView); findViewById(R.id.take_photo_btn).setOnClickListener(v -> { PhotoResult photoResult = fotoapparat.takePicture(); File photoFile = null; try { photoFile = Helper.createImageFile(this); m_current_photo_path = photoFile.getAbsolutePath(); } catch (IOException ex) { // Error occurred while creating the File } PendingResult<Unit> pendingResult = photoResult.saveToFile(photoFile); pendingResult.whenDone(unit -> { Intent returnIntent = new Intent(); returnIntent.putExtra("photo_path", m_current_photo_path); setResult(Activity.RESULT_OK, returnIntent); finish(); }); }); } @Override protected void onStart() { super.onStart(); fotoapparat.start(); } @Override protected void onStop() { super.onStop(); fotoapparat.stop(); } }
[ "lukas.hilfrich@mni.thm.de" ]
lukas.hilfrich@mni.thm.de
6b8659a60f5903589a16e7aaa19df38b401cec7e
64bbfaab56176144560f000418fb3cb35e5eaff9
/src/main/java/com/uniovi/UvisClient/validator/WalletFormValidator.java
7bff75719c5bb5fc4a0e7cbd2651f323f4486bca
[]
no_license
PelayoDiaz/UvisClient
56253a8b67da05ad5c5e2e5486e39182f56bba4e
64047a27403ec40db703694ab98afad6d148a9ee
refs/heads/master
2022-12-15T11:45:25.313050
2019-11-20T21:07:08
2019-11-20T21:07:08
191,362,104
0
0
null
2022-12-04T21:16:23
2019-06-11T11:56:01
CSS
UTF-8
Java
false
false
1,444
java
package com.uniovi.UvisClient.validator; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; import org.springframework.validation.Errors; import org.springframework.validation.ValidationUtils; import org.springframework.validation.Validator; import com.uniovi.UvisClient.entities.Wallet; import com.uniovi.UvisClient.services.impl.WalletServiceImpl; import com.uniovi.UvisClient.services.security.SecurityService; /** * Validator for the create wallet form. * It checks if the data introduced is correct. * * @author Pelayo Díaz Soto * */ @Component public class WalletFormValidator implements Validator { @Autowired private WalletServiceImpl walletService; @Autowired private SecurityService securityService; @Override public boolean supports(Class<?> aClass) { return Wallet.class.equals(aClass); } @Override public void validate(Object target, Errors errors) { ValidationUtils.rejectIfEmptyOrWhitespace(errors, "name", "error.empty"); Wallet wallet = (Wallet) target; String loggedUsername = securityService.findLoggedInUsername(); if (wallet.getName().length() < 4 || wallet.getName().length() > 25) { errors.rejectValue("name", "error.wallet.name.length"); } if (this.walletService.getWalletByNameAndUsername(wallet.getName(), loggedUsername) != null) { errors.rejectValue("name", "error.wallet.name.duplicated"); } } }
[ "UO251000@uniovi.es" ]
UO251000@uniovi.es
1ade226a3b3f66c332774d2d3cc9228682275b39
c22461e080d694ab8495288995210223e4211b4a
/NeighborhoodSustainability/app/src/main/java/creu/neighborhoodsustainability/InformationDisplay.java
16d0913da232593a1d367cf846dc150cf9f0e5af
[]
no_license
HalcyonAura/CREU
938ad278cd3f3447f08b989f02d2d0cf002af86f
bc925b39a5571a3a0d8ed84c7d8cbe7dc44b3860
refs/heads/master
2021-01-21T11:36:54.284050
2018-05-06T01:59:16
2018-05-06T01:59:16
102,019,421
0
0
null
null
null
null
UTF-8
Java
false
false
4,290
java
package creu.neighborhoodsustainability; import android.content.Intent; import android.support.design.widget.FloatingActionButton; import android.support.design.widget.Snackbar; import android.support.v4.app.FragmentStatePagerAdapter; import android.support.v7.app.AppCompatActivity; import android.support.v7.widget.Toolbar; import android.support.v4.app.Fragment; import android.support.v4.app.FragmentManager; import android.support.v4.app.FragmentPagerAdapter; import android.support.v4.view.ViewPager; import android.os.Bundle; import android.util.Log; import android.view.LayoutInflater; import android.view.Menu; import android.view.MenuItem; import android.view.View; import android.view.ViewGroup; import android.widget.TextView; import android.widget.Toast; public class InformationDisplay extends AppCompatActivity { /* * This is the swipe tab view that will be populated with the * information from the server containing the links, * scoring, etc. */ /** * The {@link android.support.v4.view.PagerAdapter} that will provide * fragments for each of the sections. We use a * {@link FragmentPagerAdapter} derivative, which will keep every * loaded fragment in memory. If this becomes too memory intensive, it * may be best to switch to a * {@link android.support.v4.app.FragmentStatePagerAdapter}. */ private PagerAdapter mSectionsPagerAdapter; //private SectionsPagerAdapter mSectionsPagerAdapter; /** * The {@link ViewPager} that will host the section contents. */ private ViewPager mViewPager; String currentCity; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_information_display); Intent intent = getIntent(); int pageNum = intent.getIntExtra("PageNumber", 0); currentCity = intent.getStringExtra("CityName"); if (currentCity == null) currentCity = "CityName"; Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar); setSupportActionBar(toolbar); /*getSupportActionBar().setDisplayHomeAsUpEnabled(true);*/ // Create the adapter that will return a fragment for each of the three // primary sections of the activity. mSectionsPagerAdapter = new PagerAdapter(getSupportFragmentManager()); //mSectionsPagerAdapter = new SectionsPagerAdapter(getSupportFragmentManager()); // Set up the ViewPager with the sections adapter. mViewPager = (ViewPager) findViewById(R.id.container); mViewPager.setAdapter(mSectionsPagerAdapter); mViewPager.setCurrentItem(pageNum); Toast.makeText(this, "Swipe left/right to access more information", Toast.LENGTH_LONG).show(); } public class PagerAdapter extends FragmentPagerAdapter { int numTabs = 4; public PagerAdapter(FragmentManager fm) { super(fm); } @Override public Fragment getItem(int position) { //return EconomyFragment.newInstance(); switch (position) { case 0: //EconomyFragment economy = new EconomyFragment(); return EconomyFragment.newInstance(); case 1: //SocialFragment social = new SocialFragment(); return SocialFragment.newInstance(); case 2: //EcologyFragment ecology = new EcologyFragment(); return EcologyFragment.newInstance(); case 3: //OntologyFragment ontology = new OntologyFragment(); return OntologyFragment.newInstance(); default: return null; } } @Override public int getCount() { return numTabs; } } @Override public void onBackPressed(){ Intent intent = new Intent(InformationDisplay.this, BreakDown.class); intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP); intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); intent.putExtra("CityName", currentCity); Log.d("Information class", currentCity); startActivity(intent); } }
[ "laplace95@gmail.com" ]
laplace95@gmail.com
785013f80a756aa2d5847208afcaaebf40a8f813
e25797fe32281f11f3f773ab72949d88b80291e6
/src/controller/login.java
7bbd1cacfca116b6dcd24a111f2d46cdbe9cf832
[]
no_license
yylou15/Internet_plus
807d8beb308a8aa6ae1b7dd14448a6dd985c8588
edeac4fe3c041ececc2db586ae2098865914d448
refs/heads/master
2020-05-16T05:01:34.722003
2019-05-03T02:07:10
2019-05-03T02:07:10
182,799,597
0
0
null
null
null
null
UTF-8
Java
false
false
1,579
java
package controller; import javafx.fxml.FXML; import javafx.fxml.FXMLLoader; import javafx.scene.Parent; import javafx.scene.Scene; import javafx.scene.control.Alert; import javafx.scene.control.TextField; import javafx.stage.Stage; public class login { @FXML private TextField username; @FXML private TextField password; @FXML protected void loginButtonClick() throws Exception { if(username.getText().equals("")){ Alert alert = new Alert(Alert.AlertType.WARNING); alert.setContentText("请输入用户名"); alert.show();return; } if(password.getText().equals("")){ Alert alert = new Alert(Alert.AlertType.WARNING); alert.setContentText("请输入密码"); alert.show();return; } if(username.getText().equals("admin") && password.getText().equals("123456")){ Parent root = FXMLLoader.load(getClass().getResource("../view/main.fxml")); ((Stage) username.getScene().getWindow()).hide(); Stage mainStage = new Stage(); mainStage.setScene(new Scene(root,1000,500)); mainStage.setTitle("此处为系统名称"); mainStage.show(); mainStage.setResizable(false); // System.out.println("登录成功"); }else{ // System.out.println("登录失败"); Alert alert = new Alert(Alert.AlertType.ERROR); alert.setContentText("用户名或密码错误,请重试!"); alert.show(); } } }
[ "louyuanyang@outlook.com" ]
louyuanyang@outlook.com
48bff4deb0290cec8c8ef3763ca2e116c09351ae
18543d61b93bf20680ef4960c78c842552d2c830
/AbstractTree.java
540c0772d23581b9a7cc6f5d9153472d63475b0d
[]
no_license
Vazyri/stupid-fucking-morsey-translator
98f6ae029a609d3e4ba8ac960b87195d62c21523
64dbc14a2c6bad4071452d065c839c53a79ab555
refs/heads/main
2023-05-26T02:52:22.520135
2021-06-03T03:58:12
2021-06-03T03:58:12
373,373,426
0
0
null
null
null
null
UTF-8
Java
false
false
7,268
java
import java.util.ArrayList; import java.util.Iterator; import java.util.List; /** * Morsey * AbstractTree abstract class of generic type K implements Tree of generic type K * ElementIterator static inner class of generic type K implements Iterator of generic type K * @author Von Jamora */ public abstract class AbstractTree<K> implements Tree<K> { private class ElementIterator implements Iterator<K> { Iterator<Position<K>> posIterator = positions().iterator(); /** * Returns boolean based on whether Iterator has an element available after the current one it is accessing. * * @return boolean value */ public boolean hasNext() { return posIterator.hasNext(); } /** * Returns value of generic type K of the next element in Iterator. * * @return generic type K value */ public K next() { return posIterator.next().getElement(); } /** * Removes the last element returnec by Iterator. */ public void remove() { posIterator.remove(); } /** * Returns a String representation of ElementIterator. Includes all elements in Iterator. * * @return String value */ public String toString() { StringBuilder print = new StringBuilder(); while(posIterator.hasNext()) { print.append(posIterator.next() + ", "); } print.delete(print.length()-2, print.length()-1); return print.toString(); } }// end of inner ElementIterator class // ************************************************** Traversal ************************************************** /** * Returns Iterator object containing elements of each Node in tree. * * @return Iterator object of generic type K */ public Iterator<K> iterator() { return new ElementIterator(); } /** * Returns Iterable object with tree nodes in order defined by the chosen traversal method. * * @return Iterable object of type Position of generic type K */ public Iterable<Position<K>> positions() { return preorder(); // preorder traversal as default tree traversal method //return postorder(); // for postorder traversal //return breadthfirst(); // for breadth-first traversal } /** * Adds position of subtree rooted at provided Position to given snapshot. * * @param p Position object of generic type K * @param snappity List object of type Position of generic type K */ private void preorderSubtree(Position<K> p, List<Position<K>> snappity) { snappity.add(p); for(Position<K> c : children(p)) { preorderSubtree(c, snappity); } } /** * Returns Iterable collection containing Positions in tree reported in preorder. * * @return Iterable object of type Position of generic type K */ public Iterable<Position<K>> preorder() { List<Position<K>> snappity = new ArrayList<>(); if(!isEmpty()) { preorderSubtree(root(), snappity); } return snappity; } /** * Adds positions of subtree rooted at provided Position to given snapshot. * * @param p Position object of generic type K * @param snappity List object of type Position of generic type K */ private void postorderSubtree(Position<K> p, List<Position<K>> snappity) { for(Position<K> c : children(p)) { postorderSubtree(c, snappity); } snappity.add(p); // add p AFTER traversing subtrees } /** * Returns Iterable collection containing Positions in tree reported in postorder. * * @return Iterable object of type Position of generic type K */ public Iterable<Position<K>> postorder() { List<Position<K>> snappity = new ArrayList<>(); if(!isEmpty()) { postorderSubtree(root(), snappity); } return snappity; } /** * Returns Iterable collection containing Positions in tree reported in breadth-first order (traverse each node frmo left to right). * * @return Iterable object of type Position of generic type K */ public Iterable<Position<K>> breadthfirst() { List<Position<K>> snappity = new ArrayList<>(); if(!isEmpty()) { Queue<Position<K>> pringels = new ArrayQueue<>(); pringels.enqueue(root()); // starts with roots while(!pringels.isEmpty()) { Position<K> p = pringels.dequeue(); // remove from front snappity.add(p); // visited element for(Position<K> c : children(p)) { pringels.enqueue(c); // add children to queue } } } return snappity; } // ************************************************** Traversal ************************************************** /** * Returns boolean value based on whether the Node located at the provided Position object is an internal Node (atleast one child). * * Originates from Tree interface and is defined in AbstractTree abstract class. * * @param p Position object * @return boolean value */ public boolean isInternal(Position<K> p) { return numChildren(p) > 0; } /** * Returns boolean value based on whether the Node located at the provided Position object is an external Node (no children). * * Originates from Tree interface and is defined in AbstractTree abstract class. * * @param p Position object * @return boolean value */ public boolean isExternal(Position<K> p) { return numChildren(p) == 0; } /** * Returns boolean value based on whether the Node located at the provided Position object is the root of the tree. * * Originates from Tree interface and is defined in AbstractTree abstract class. * * @param p Position object * @return boolean value */ public boolean isRoot(Position<K> p) { return p == root(); } /** * Returns boolean based on whether tree has any Node objects. * * Originates from Tree interface and is defined in AbstractTree abstract class. * * @return boolean value */ public boolean isEmpty() { return size() == 0; } /** * Returns number of levels separating provided Position from root. * * @param p Position object of generic type K * @return integer value */ public int depth(Position<K> p) { if(isRoot(p)) { return 0; } else { return 1 + depth(parent(p)); } } /** * Returns height of subtree rooted at provided Position. * * @param p Position object of generic type K * @return integer value */ public int height(Position<K> p) { int h=0; for(Position<K> c : children(p)) { h = Math.max(h, 1 + height(c)); } return h; } }
[ "46606935+Vazyri@users.noreply.github.com" ]
46606935+Vazyri@users.noreply.github.com
798cde5205996caa33e4848617845dc04ee44321
29b7d5f853966195f2534514a79d1866b5f0881e
/src/main/java/com/example/pedidos/controller/dto/PedidoDto.java
b4236d6bbf0eb4ee0bb7bce4bb9f5a705926bbf0
[]
no_license
ruhangon/spring-pedidos
c29aab47780ffbea25b2ba9dc02c1ba55652ba7f
ea658a8cb2dd51b0792f830ff99c2ce72cad7c5a
refs/heads/master
2023-06-19T03:24:09.520305
2021-07-09T22:21:41
2021-07-09T22:21:41
382,085,822
0
0
null
null
null
null
UTF-8
Java
false
false
701
java
package com.example.pedidos.controller.dto; import java.time.LocalDate; import java.util.List; import java.util.stream.Collectors; import com.example.pedidos.model.Pedido; import lombok.Getter; @Getter public class PedidoDto { private Long id; private String nome; private String descricao; private String marca; private LocalDate data; public PedidoDto(Pedido pedido) { this.id = pedido.getId(); this.nome = pedido.getNome(); this.descricao = pedido.getDescricao(); this.marca = pedido.getMarca(); this.data = pedido.getData(); } public static List<PedidoDto> converter(List<Pedido> pedidos) { return pedidos.stream().map(PedidoDto::new).collect(Collectors.toList()); } }
[ "ruhan.goncalves@gmail.com" ]
ruhan.goncalves@gmail.com
d1f1f34f58997012761431fd464e7281d30b4d13
ca070e4ae34a73de18ef17d3dd009f4ed7f488a6
/2.2.3/sources/android/support/v7/widget/AppCompatEditText.java
125076b1c4199d0d481e47d2189d0792236f01b5
[]
no_license
stven0king/InstantRun-ApkParse
611c49fc56852d2e1538b477b1670813808e7316
5bc938ab615ae6bb3c4941f65b6c2c6d7d30a8d5
refs/heads/master
2020-03-17T20:21:20.221813
2018-05-18T05:21:52
2018-05-18T05:21:52
133,905,354
4
0
null
null
null
null
UTF-8
Java
false
false
3,487
java
package android.support.v7.widget; import android.content.Context; import android.content.res.ColorStateList; import android.graphics.PorterDuff.Mode; import android.graphics.drawable.Drawable; import android.support.annotation.DrawableRes; import android.support.annotation.Nullable; import android.support.annotation.RestrictTo; import android.support.annotation.RestrictTo.Scope; import android.support.v4.view.TintableBackgroundView; import android.support.v7.appcompat.R; import android.util.AttributeSet; import android.widget.EditText; public class AppCompatEditText extends EditText implements TintableBackgroundView { private AppCompatBackgroundHelper mBackgroundTintHelper; private AppCompatTextHelper mTextHelper; public AppCompatEditText(Context context) { this(context, null); } public AppCompatEditText(Context context, AttributeSet attrs) { this(context, attrs, R.attr.editTextStyle); } public AppCompatEditText(Context context, AttributeSet attrs, int defStyleAttr) { super(TintContextWrapper.wrap(context), attrs, defStyleAttr); this.mBackgroundTintHelper = new AppCompatBackgroundHelper(this); this.mBackgroundTintHelper.loadFromAttributes(attrs, defStyleAttr); this.mTextHelper = AppCompatTextHelper.create(this); this.mTextHelper.loadFromAttributes(attrs, defStyleAttr); this.mTextHelper.applyCompoundDrawablesTints(); } public void setBackgroundResource(@DrawableRes int resId) { super.setBackgroundResource(resId); if (this.mBackgroundTintHelper != null) { this.mBackgroundTintHelper.onSetBackgroundResource(resId); } } public void setBackgroundDrawable(Drawable background) { super.setBackgroundDrawable(background); if (this.mBackgroundTintHelper != null) { this.mBackgroundTintHelper.onSetBackgroundDrawable(background); } } @RestrictTo({Scope.LIBRARY_GROUP}) public void setSupportBackgroundTintList(@Nullable ColorStateList tint) { if (this.mBackgroundTintHelper != null) { this.mBackgroundTintHelper.setSupportBackgroundTintList(tint); } } @Nullable @RestrictTo({Scope.LIBRARY_GROUP}) public ColorStateList getSupportBackgroundTintList() { return this.mBackgroundTintHelper != null ? this.mBackgroundTintHelper.getSupportBackgroundTintList() : null; } @RestrictTo({Scope.LIBRARY_GROUP}) public void setSupportBackgroundTintMode(@Nullable Mode tintMode) { if (this.mBackgroundTintHelper != null) { this.mBackgroundTintHelper.setSupportBackgroundTintMode(tintMode); } } @Nullable @RestrictTo({Scope.LIBRARY_GROUP}) public Mode getSupportBackgroundTintMode() { return this.mBackgroundTintHelper != null ? this.mBackgroundTintHelper.getSupportBackgroundTintMode() : null; } protected void drawableStateChanged() { super.drawableStateChanged(); if (this.mBackgroundTintHelper != null) { this.mBackgroundTintHelper.applySupportBackgroundTint(); } if (this.mTextHelper != null) { this.mTextHelper.applyCompoundDrawablesTints(); } } public void setTextAppearance(Context context, int resId) { super.setTextAppearance(context, resId); if (this.mTextHelper != null) { this.mTextHelper.onSetTextAppearance(context, resId); } } }
[ "tanzhenxing@58ganji.com" ]
tanzhenxing@58ganji.com
666df82dc8fd20fa16571ceecfd6fbffc6359ec3
d977ad2b740b1bed5514810512d694acc0f95778
/Module 2/src/_qly_Sdt/commons/FileUtils.java
715a81c3276db6ae13bd129b8d1488e9fcc0ca80
[]
no_license
quoctrung1012/C0720G1-TruongQuocTrung
37385f3b81e02ffd014e408926ac5be17b928041
68de69a5126db4d591d6f97063d7eaaaff272596
refs/heads/master
2023-02-19T10:17:27.000968
2021-01-19T02:37:02
2021-01-19T02:37:02
282,783,074
0
0
null
null
null
null
UTF-8
Java
false
false
1,315
java
package _qly_Sdt.commons; import _qly_Sdt.models.TelephoneDirectory; import java.io.*; import java.util.ArrayList; import java.util.List; public class FileUtils { static FileWriter fileWriter; static BufferedWriter bufferedWriter; static FileReader fileReader; static BufferedReader bufferedReader; public static void writeFile(String pathFile, List<String> listLine) { try { fileWriter = new FileWriter(pathFile); bufferedWriter = new BufferedWriter(fileWriter); for (String line : listLine) { bufferedWriter.write(line); bufferedWriter.newLine(); } bufferedWriter.close(); } catch (IOException e) { e.printStackTrace(); } } public static List<String> readAllFile(String pathFile) { List<String> stringList = new ArrayList<>(); try { fileReader = new FileReader(pathFile); bufferedReader = new BufferedReader(fileReader); String line; while ((line = bufferedReader.readLine()) != null) { stringList.add(line); } bufferedReader.close(); } catch (IOException e) { e.printStackTrace(); } return stringList; } }
[ "quoctrung1012@gmail.comgit config --global user.name quoctrung1012" ]
quoctrung1012@gmail.comgit config --global user.name quoctrung1012
12da7cc2aecf06bf4610ccab160e83390b96dfec
d56c589262e9338ec9b917a954aeff798b01bd29
/app/src/test/java/bit/ihainan/me/bitunionforandroid/ExampleUnitTest.java
4dbc8f8a6bbd2c382658f69e5dc5f4756c12aaf9
[]
no_license
ztlm/BITUnion-for-Android
d7f2682739b06796c923fab3ebd8fb98e8c738a7
9aeb38ea27915a314df71df2f2f85b61b95a59bd
refs/heads/master
2021-01-12T21:36:07.255189
2016-03-20T14:03:57
2016-03-20T14:03:57
null
0
0
null
null
null
null
UTF-8
Java
false
false
340
java
package bit.ihainan.me.bitunionforandroid; import org.junit.Test; import static org.junit.Assert.*; /** * To work on unit tests, switch the Test Artifact in the Build Variants view. */ public class ExampleUnitTest { @Test public void addition_isCorrect() throws Exception { assertEquals(4, 2 + 2); } }
[ "ihainan72@gmail.com" ]
ihainan72@gmail.com
ef44a569bb16581ab6af79bd3dcad8fe2b35b5b2
76cc84817463d57da6ebfce3cc998b54f0ce608f
/src/Task03/Scanner_Practice.java
a3bdaec5c8c9b28f8a807230917f03215f51a2c7
[]
no_license
IssB20/Day3-Repo
0c19301b13ebcb51351f34440ec7d1e9e17a1bdc
99bfb2966afe65307bd93bc2f94da23b16e14ed9
refs/heads/main
2023-01-04T23:14:05.231470
2020-10-31T14:55:14
2020-10-31T14:55:14
308,898,843
0
0
null
null
null
null
UTF-8
Java
false
false
456
java
package Task03; import java.util.Scanner; public class Scanner_Practice { public static void main(String[] args) { Scanner scan = new Scanner(System.in); System.out.println("Enter your first number:"); int num1 = scan.nextInt(); System.out.println("enter you second number:"); int num2 = scan.nextInt(); int sum = num1+num2; System.out.println( "you total is:"+sum); } }
[ "islem_ouiddir@yahoo.fr" ]
islem_ouiddir@yahoo.fr
d929ec9956b736103a30cbe6a81ee724b8329dc3
4e409edb21bb1cd47b0d787cd6a03a8d9cf3f3d3
/SummerProject/src/main/java/pages/Programs.java
7f51941c3a98abb287c5bce8bb1fe0a8338325cb
[]
no_license
aman1310verma/TESTING-proj
9aa14796632050b72db55c385c80b2d9c856d6c4
28ca8f7103aafb11eb2e01526b77ebaf1c8966fc
refs/heads/master
2023-03-17T11:13:09.886333
2021-02-21T15:57:43
2021-02-21T15:57:43
340,939,301
0
0
null
null
null
null
UTF-8
Java
false
false
1,719
java
package pages; import java.util.ArrayList; import java.util.List; import org.openqa.selenium.By; import org.openqa.selenium.WebDriver; import org.openqa.selenium.WebElement; public class Programs { WebDriver driver; //Constructor that will be automatically called as soon as the object of the class is created public Programs(WebDriver driver) { this.driver=driver; } By lrnBtn = By.xpath("//a[@href='/programs/workshops/glimpses-for-kids-workshop/'][@class='button-w3layouts hvr-rectangle-out']"); By glimpsesPoster = By.xpath("//img[@src='/images/glimpses-poster.png']"); By mentorshipBtn = By.xpath("//li[@class='button-w3layouts hvr-rectangle-out tsf-button']//a[text()='Student Mentorship Program']"); By para = By.xpath("//div[@class='col-md-12 test-grid1']//p[@class='para-w3-agile']"); public void learnMore() { driver.findElement(lrnBtn).click(); //Storing window handles in an array list ArrayList<String> tabs = new ArrayList<String> (driver.getWindowHandles()); //Switching to the new tab driver.switchTo().window(tabs.get(1)); //Checking if the expected image is present boolean pstr = driver.findElement(glimpsesPoster).isDisplayed(); if(pstr=true) { System.out.println("The poster is present and we are on Glimpses for kidz page....."); } else { System.out.println("Looks like its not the page we were looking for!!!"); } //Closing the tab driver.close(); //Switching to the parent window driver.switchTo().window(tabs.get(0)); } public void mentorshipProgram() { driver.findElement(mentorshipBtn).click(); System.out.println("The quote on the page is - "+driver.findElement(para).getText()); } }
[ "aman1310verma@gmail.com" ]
aman1310verma@gmail.com
b5f36d5b59970d4626e4662239822ecf09a2d3dc
c5d93c0a4db767ba5333edf0b57767fa9b253f3c
/src/test/java/runners/ParallelRunner.java
740a1f54b4e1ff74aa82e678ca3fab8453fc2c32
[]
no_license
girijadeo/MRIautomation
b8c6729427dada26abd0b2a396fe31701fa2f08a
d26f78142df2d28905731106379486d8a4546ef3
refs/heads/master
2020-03-29T08:23:50.689956
2018-09-21T04:18:54
2018-09-21T04:18:54
149,709,045
0
0
null
null
null
null
UTF-8
Java
false
false
1,827
java
package runners; import com.cognizant.Craft.DriverScript; import com.cognizant.framework.selenium.*; import com.cognizant.framework.FrameworkParameters; /** * Class to facilitate parallel execution of test scripts * @author Cognizant */ class ParallelRunner implements Runnable { private final SeleniumTestParameters testParameters; private int testBatchStatus = 0; /** * Constructor to initialize the details of the test case to be executed * @param testParameters The {@link SeleniumTestParameters} object (passed from the {@link Allocator}) */ ParallelRunner(SeleniumTestParameters testParameters) { super(); this.testParameters = testParameters; } /** * Function to get the overall test batch status * @return The test batch status (0 = Success, 1 = Failure) */ public int getTestBatchStatus() { return testBatchStatus; } @Override public void run() { FrameworkParameters frameworkParameters = FrameworkParameters.getInstance(); String testReportName, executionTime, testStatus; if(frameworkParameters.getStopExecution()) { testReportName = "N/A"; executionTime = "N/A"; testStatus = "Aborted"; testBatchStatus = 1; // Non-zero outcome indicates failure } else { DriverScript driverScript = new DriverScript(this.testParameters); driverScript.driveTestExecution(); testReportName = driverScript.getReportName(); executionTime = driverScript.getExecutionTime(); testStatus = driverScript.getTestStatus(); if ("failed".equalsIgnoreCase(testStatus)) { testBatchStatus = 1; // Non-zero outcome indicates failure } } ResultSummaryManager resultSummaryManager = ResultSummaryManager.getInstance(); resultSummaryManager.updateResultSummary(testParameters, testReportName, executionTime, testStatus); } }
[ "32549451+girijadeo@users.noreply.github.com" ]
32549451+girijadeo@users.noreply.github.com
6377eeff013acaf4fe858c0c1f5b781a2b90ee97
667129f3278213ebe621ff2c67b400755d294d62
/aTalk/src/main/java/org/atalk/impl/neomedia/rtp/remotebitrateestimator/RemoteBitrateEstimatorAbsSendTime.java
2941c3dac2b844d4193c5e30b977178134debbd1
[ "Apache-2.0" ]
permissive
rutura/atalk-android
6f196d85d4a431a73bb65778700c63d86c2e067b
b4705cecb64b8f8c41ae18e0e6ab0ba64e44580e
refs/heads/master
2021-05-14T01:22:19.579096
2018-01-14T05:05:57
2018-01-14T05:05:57
116,563,805
1
0
null
2018-01-07T12:31:11
2018-01-07T12:31:11
null
UTF-8
Java
false
false
26,509
java
/* * Copyright @ 2015 Atlassian Pty Ltd * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.atalk.impl.neomedia.rtp.remotebitrateestimator; import org.ice4j.util.*; import org.atalk.service.neomedia.rtp.*; import org.atalk.util.Logger; import java.util.*; /** * webrtc.org abs_send_time implementation as of June 26, 2017. * commit ID: 23fbd2aa2c81d065b84d17b09b747e75672e1159 * * @author Julian Chukwu * @author George Politis */ public class RemoteBitrateEstimatorAbsSendTime implements RemoteBitrateEstimator { /** * The <tt>Logger</tt> used by the * <tt>RemoteBitrateEstimatorAbsSendTime</tt> class and its instances for * logging output. */ private static final Logger logger = Logger.getLogger(RemoteBitrateEstimatorAbsSendTime.class); /** * Defines the number of digits in the AST representation (24 bits, 6.18 * fixed point) after the radix. */ private final static int kAbsSendTimeFraction = 18; /** * Defines the upshift (left bit-shift) to apply to AST (24 bits, 6.18 fixed * point) to make it inter-arrival compatible (expanded AST, 32 bits, 6.26 * fixed point). */ private final static int kAbsSendTimeInterArrivalUpshift = 8; /** * This is used in the {@link InterArrival} computations. In this estimator * a timestamp group is defined as all packets with a timestamp which are at * most 5ms older than the first timestamp in that group. */ private final static int kTimestampGroupLengthMs = 5; /** * Defines the number of digits in the expanded AST representation (32 bits, * 6.26 fixed point) after the radix. */ private final static int kInterArrivalShift = kAbsSendTimeFraction + kAbsSendTimeInterArrivalUpshift; /** * Converts the {@link #kTimestampGroupLengthMs} into "ticks" for use with * the {@link InterArrival}. */ private static final long kTimestampGroupLengthTicks = (kTimestampGroupLengthMs << kInterArrivalShift) / 1000; /** * Defines the expanded AST (32 bits) to millis conversion rate. Units are * ms per timestamp */ private static final double kTimestampToMs = (double) 1000 / (1 << kInterArrivalShift); /** * Defines the maximum distance between the send time delta (of a probe * packet from the previous probe packet) and the cluster mean send time * delta above which the probe is no longer considered part of the cluster. */ private final static float kMaxSendTimeDeltaMsDistance = 2.5f; /** * Defines the minimum size of a packet to be considered a probe. We * currently assume that only packets larger than 200 bytes are paced by the * sender. */ private final static long kMinProbePacketSize = 200; /** * Defines the initial probing period (in millis) after the first packet is * received. */ private final static int kInitialProbingIntervalMs = 2000; /** * Defines the minimum cluster size for the cluster to be considered valid. */ private final static int kMinClusterSize = 4; /** * Defines the maximum number of probe packets. */ private final static int kMaxProbePackets = 15; /** * Defines the expected number of probe packets. */ private final static int kExpectedNumberOfProbes = 3; /** * Reduces the effects of allocations and garbage collection of the method * {@code incomingPacket}. */ private final long[] deltas = new long[3]; /** * Reduces the effects of allocations and garbage collection of the method * {@link #incomingPacketInfo(long, long, int, long)}} by promoting the * {@code RateControlInput} instance from a local variable to a field and * reusing the same instance across method invocations. (Consequently, the * default values used to initialize the field are of no importance because * they will be overwritten before they are actually used.) */ private final RateControlInput input = new RateControlInput(BandwidthUsage.kBwNormal, 0L, 0D); /** * The set of synchronization source identifiers (SSRCs) currently being * received. Represents an unmodifiable copy/snapshot of the current keys of * {@link #ssrcsMap} suitable for public access and introduced for * the purposes of reducing the number of allocations and the effects of * garbage collection. */ private Collection<Long> ssrcs = Collections.unmodifiableList(Collections.EMPTY_LIST); /** * A map of SSRCs -> time first seen (in millis). */ private final Map<Long, Long> ssrcsMap = new TreeMap<>(); /** * The list of probes that this instance has received. */ private final List<Probe> probes = new ArrayList<>(); /** * The total number of probing packets we've seen so far. */ private long totalProbesReceived; /** * The time (in millis) when we saw the first packet. Useful to determine * the probing period. */ private long firstPacketTimeMs; /** * Keeps track of the last time (in millis) that we updated the bitrate * estimate. */ private long lastUpdateMs; /** * The observer to notify on bitrate estimation changes. */ private final RemoteBitrateObserver observer; /** * The rate control implementation based on additive increases of bitrate * when no over-use is detected and multiplicative decreases when over-uses * are detected. */ private final AimdRateControl remoteRate = new AimdRateControl(); /** * Holds the {@link InterArrival}, {@link OveruseEstimator} and * {@link OveruseDetector} instances of this RBE. */ private Detector detector; /** * Keeps track of how much data we're receiving. */ private RateStatistics incomingBitrate; /** * Determines whether or not the incoming bitrate is initialized or not. */ private boolean incomingBitrateInitialized; /** * Ctor. * * @param observer the observer to notify on bitrate estimation changes. */ public RemoteBitrateEstimatorAbsSendTime(RemoteBitrateObserver observer) { this.observer = observer; this.incomingBitrate = new RateStatistics(kBitrateWindowMs, kBitrateScale); this.incomingBitrateInitialized = false; this.totalProbesReceived = 0; this.firstPacketTimeMs = -1; this.lastUpdateMs = -1; } /** * Determines whether a {@link Probe} belongs to a cluster or not, by * examining its send time delta distance from the cluster mean. * * @param sendDeltaMs the send time delta of the probe we examine (probe * send time - previous probe send time). * @param clusterAggregate the {@link Cluster} that aggregates the probes. * * @return true if the probe is within the cluster bounds, false otherwise. */ private static boolean isWithinClusterBounds( long sendDeltaMs, Cluster clusterAggregate) { if (clusterAggregate.count == 0) { return true; } double clusterMean = clusterAggregate.meanSendDeltaMs / (double) clusterAggregate.count; return Math.abs( (double) sendDeltaMs - clusterMean) < kMaxSendTimeDeltaMsDistance; } /** * Finalizes the cluster (computes the means from the sums) and adds it to * the clusters list. * * @param clusters the clusters list to add the cluster. * @param cluster the cluster to finalize and add to the clusters list. */ private static void addCluster(List<Cluster> clusters, Cluster cluster) { cluster.meanSendDeltaMs /= (double) cluster.count; cluster.meanRecvDeltaMs /= (double) cluster.count; cluster.meanSize /= cluster.count; clusters.add(cluster); } /** * Computes the list of clusters from the list of probes. * * @param probes the list of probes * @return the computed list of clusters. */ private static List<Cluster> computeClusters(List<Probe> probes) { List<Cluster> clusters = new ArrayList<>(); Cluster current = new Cluster(); long prevSendTime = -1; long prevRecvTime = -1; for (Probe probe : probes) { if (prevSendTime >= 0) { long sendDeltaMs = probe.sendTimeMs - prevSendTime; long recvDeltaMs = probe.recvTimeMs - prevRecvTime; if (sendDeltaMs >= 1 && recvDeltaMs >= 1) { ++current.numAboveMinDelta; } if (!isWithinClusterBounds(sendDeltaMs, current)) { if (current.count >= kMinClusterSize) { addCluster(clusters, current); } current = new Cluster(); } current.meanSendDeltaMs += sendDeltaMs; current.meanRecvDeltaMs += recvDeltaMs; current.meanSize += probe.payloadSize; ++current.count; } prevSendTime = probe.sendTimeMs; prevRecvTime = probe.recvTimeMs; } if (current.count >= kMinClusterSize) { addCluster(clusters, current); } return clusters; } /** * Finds the probe cluster with the highest bitrate. * * @param clusters the list of clusters * @return the cluster with the highest bitrate */ private static Cluster findBestProbe(List<Cluster> clusters) { long highestProbeBitrateBps = 0; Cluster bestIt = new Cluster(); for (Cluster cluster : clusters) { if (cluster.meanSendDeltaMs == 0 || cluster.meanRecvDeltaMs == 0) continue; if (cluster.numAboveMinDelta > cluster.count / 2 && (cluster.meanRecvDeltaMs - cluster.meanSendDeltaMs <= 2.0f && cluster.meanSendDeltaMs - cluster.meanRecvDeltaMs <= 5.0f)) { long probeBitrateBps = Math.min( cluster.getSendBitrateBps(), cluster.getRecvBitrateBps()); if (probeBitrateBps > highestProbeBitrateBps) { highestProbeBitrateBps = probeBitrateBps; bestIt = cluster; } } else { double sendBitrateBps = cluster.meanSize * 8 * 1000 / cluster.meanSendDeltaMs; double recvBitrateBps = cluster.meanSize * 8 * 1000 / cluster.meanRecvDeltaMs; logger.warn("Probe failed, sent at " + sendBitrateBps + " bps, received at " + recvBitrateBps + " bps. Mean send delta: " + cluster.meanSendDeltaMs + " ms, mean recv delta: " + cluster.meanRecvDeltaMs + " ms, num probes: " + cluster.count); break; } } return bestIt; } /** * Processes the received clusters and maybe updates the remote bitrate. * It returns the processing result. * * @param nowMs the current time in millis. * * @return true if the remote bitrate was updated, false otherwise. */ private synchronized boolean processClusters(long nowMs) { List<Cluster> clusters = computeClusters(probes); if (clusters.isEmpty()) { // If we reach the max number of probe packets and still // have no clusters, we will remove the oldest one. if (probes.size() >= kMaxProbePackets) { probes.remove(0); } return false; } Cluster bestProbe = findBestProbe(clusters); long probeBitrateBps = Math.min( bestProbe.getSendBitrateBps(), bestProbe.getRecvBitrateBps()); // Make sure that a probe sent on a lower bitrate than our estimate // can't reduce the estimate. if (isBitrateImproving(probeBitrateBps)) { logger.warn("Probe successful, sent at " + bestProbe.getSendBitrateBps() + " bps, received at " + bestProbe.getRecvBitrateBps() + " bps. Mean send delta: " + bestProbe.meanSendDeltaMs + " ms, mean recv delta: " + bestProbe.meanRecvDeltaMs + " ms, num probes: " + bestProbe.count); remoteRate.setEstimate(probeBitrateBps, nowMs); return true; } // Not probing and received non-probe packet, or finished with current // set of probes. if (clusters.size() >= kExpectedNumberOfProbes) { probes.clear(); } return false; } /** * Determines whether or not the specified bitrate is an improvement over * our current estimate. * * @param newBitrateBps the new bitrate to compare with our estimate. * * @return true if the bitrate is improving, false otherwise. */ private synchronized boolean isBitrateImproving(long newBitrateBps) { boolean initialProbe = !remoteRate.isValidEstimate() && newBitrateBps > 0; boolean bitrateAboveEstimate = remoteRate.isValidEstimate() && newBitrateBps > remoteRate.getLatestEstimate(); return initialProbe || bitrateAboveEstimate; } /** * Notifies this instance of an incoming packet. * * @param arrivalTimeMs the arrival time of the packet in millis. * @param sendTime24bits the send time of the packet in AST format * (24 bits, 6.18 fixed point). * @param payloadSize the payload size of the packet. * @param ssrc the SSRC of the packet. */ @Override public void incomingPacketInfo( long arrivalTimeMs, long sendTime24bits, int payloadSize, long ssrc) { if (logger.isTraceEnabled()) { logger.trace("incoming_packet," + hashCode() + "," + arrivalTimeMs + "," + sendTime24bits + "," + payloadSize + "," + ssrc); } // Shift up send time to use the full 32 bits that inter_arrival // works with, so wrapping works properly. long timestamp = sendTime24bits << kAbsSendTimeInterArrivalUpshift; // Convert the expanded AST (32 bits, 6.26 fixed point) to millis. long sendTimeMs = (long) (timestamp * kTimestampToMs); // XXX The arrival time should be the earliest we've seen this packet, // not now. In our code however, we don't have access to the arrival // time. long nowMs = System.currentTimeMillis(); // should be broken out from here. // Check if incoming bitrate estimate is valid, and if it // needs to be reset. long incomingBitrate_ = incomingBitrate.getRate(arrivalTimeMs); if (incomingBitrate_ != 0) { incomingBitrateInitialized = true; } else if (incomingBitrateInitialized) { // Incoming bitrate had a previous valid value, but now not // enough data point are left within the current window. // Reset incoming bitrate estimator so that the window // size will only contain new data points. incomingBitrate = new RateStatistics(kBitrateWindowMs, kBitrateScale); incomingBitrateInitialized = false; } incomingBitrate.update(payloadSize, arrivalTimeMs); if (firstPacketTimeMs == -1) { firstPacketTimeMs = nowMs; } boolean updateEstimate = false; long targetBitrateBps = 0; synchronized (this) { timeoutStreams(nowMs); ssrcsMap.put(ssrc, nowMs); if (!ssrcs.contains(ssrc)) { ssrcs = Collections.unmodifiableCollection(ssrcsMap.keySet()); } // For now only try to detect probes while we don't have a valid // estimate. if (payloadSize > kMinProbePacketSize && (!remoteRate.isValidEstimate() || nowMs - firstPacketTimeMs < kInitialProbingIntervalMs)) { if (totalProbesReceived < kMaxProbePackets) { long sendDeltaMs = -1; long recvDeltaMs = -1; if (!probes.isEmpty()) { sendDeltaMs = sendTimeMs - probes.get(probes.size() - 1).sendTimeMs; recvDeltaMs = arrivalTimeMs - probes.get(probes.size() - 1).recvTimeMs; } logger.warn("Probe packet received: send time=" + sendTimeMs + " ms, recv time=" + arrivalTimeMs + " ms, send delta=" + sendDeltaMs + " ms, recv delta=" + recvDeltaMs + " ms."); } probes.add( new Probe(sendTimeMs, arrivalTimeMs, payloadSize)); ++totalProbesReceived; // Make sure that a probe which updated the bitrate immediately // has an effect by calling the // OnReceiveBitrateChanged callback. if (processClusters(nowMs)) { updateEstimate = true; } } long[] deltas = this.deltas; /* long timestampDelta */ deltas[0] = 0; /* long timeDelta */ deltas[1] = 0; /* int sizeDelta */ deltas[2] = 0; if (detector == null) { detector = new Detector(new OverUseDetectorOptions(), true); if (logger.isTraceEnabled()) { logger.trace("new_detector," + hashCode() + "," + remoteRate.hashCode() + "," + detector.detector.hashCode() + "," + detector.estimator.hashCode() + "," + detector.interArrival.hashCode()); } } if (detector.interArrival.computeDeltas( timestamp, arrivalTimeMs, payloadSize, deltas, nowMs)) { double tsDeltaMs = deltas[0] * kTimestampToMs; detector.estimator.update( /* timeDelta */ deltas[1], /* timestampDelta */ tsDeltaMs, /* sizeDelta */ (int) deltas[2], detector.detector.getState(), nowMs); detector.detector.detect( detector.estimator.getOffset(), tsDeltaMs, detector.estimator.getNumOfDeltas(), arrivalTimeMs); } if (!updateEstimate) { // Check if it's time for a periodic update or if we // should update because of an over-use. if (lastUpdateMs == -1 || nowMs - lastUpdateMs > remoteRate.getFeedBackInterval()) { updateEstimate = true; } else if ( detector.detector.getState() == BandwidthUsage.kBwOverusing) { long incomingRate_ = incomingBitrate.getRate(arrivalTimeMs); if (incomingRate_ > 0 && remoteRate .isTimeToReduceFurther(nowMs, incomingBitrate_)) { updateEstimate = true; } } } if (updateEstimate) { // The first overuse should immediately trigger a new estimate. // We also have to update the estimate immediately if we are // overusing and the target bitrate is too high compared to // what we are receiving. input.bwState = detector.detector.getState(); input.incomingBitRate = incomingBitrate.getRate(arrivalTimeMs); input.noiseVar = detector.estimator.getVarNoise(); remoteRate.update(input, nowMs); targetBitrateBps = remoteRate.updateBandwidthEstimate(nowMs); updateEstimate = remoteRate.isValidEstimate(); } } if (updateEstimate) { lastUpdateMs = nowMs; if (observer != null) { observer.onReceiveBitrateChanged(getSsrcs(), targetBitrateBps); } } } /** * Timeouts SSRCs that have not received any data for * kTimestampGroupLengthMs millis. * * @param nowMs the current time in millis. */ private synchronized void timeoutStreams(long nowMs) { boolean removed = false; Iterator<Map.Entry<Long, Long>> itr = ssrcsMap.entrySet().iterator(); while (itr.hasNext()) { Map.Entry<Long, Long> entry = itr.next(); if ((nowMs - entry.getValue() > kStreamTimeOutMs)) { removed = true; itr.remove(); } } if (removed) { ssrcs = Collections.unmodifiableCollection(ssrcsMap.keySet()); } if (detector != null && ssrcsMap.isEmpty()) { // We can't update the estimate if we don't have any active streams. detector = null; // We deliberately don't reset the first_packet_time_ms_ // here for now since we only probe for bandwidth in the // beginning of a call right now. } } /** * {@inheritDoc} */ @Override public synchronized void onRttUpdate(long avgRttMs, long maxRttMs) { remoteRate.setRtt(avgRttMs); } /** * {@inheritDoc} */ @Override public synchronized long getLatestEstimate() { long bitrateBps; if (!remoteRate.isValidEstimate()) { return -1; } if (ssrcsMap.isEmpty()) { bitrateBps = 0; } else { bitrateBps = remoteRate.getLatestEstimate(); } return bitrateBps; } /** * {@inheritDoc} */ @Override public Collection<Long> getSsrcs() { return ssrcs; } /** * {@inheritDoc} */ @Override public synchronized void removeStream(long ssrc) { if (ssrcsMap.remove(ssrc) != null) { ssrcs = Collections.unmodifiableCollection(ssrcsMap.keySet()); } } /** * {@inheritDoc} */ @Override public synchronized void setMinBitrate(int minBitrateBps) { // Called from both the configuration thread and the network thread. // Shouldn't be called from the network thread in the future. remoteRate.setMinBitrate(minBitrateBps); } /** * Keeps meta information about a cluster of probes. */ private static class Cluster { double meanSendDeltaMs = 0L; double meanRecvDeltaMs = 0L; int meanSize = 0; int count = 0; int numAboveMinDelta = 0; Cluster() { } long getSendBitrateBps() { //RTC_CHECK_GT(this.meanSendDeltaMs, 0.0f); return (long) (this.meanSize * 8 * 1000 / meanSendDeltaMs); } long getRecvBitrateBps() { // RTC_CHECK_GT(this.meanRecvDeltaMs, 0.0f); return (long) (this.meanSize * 8 * 1000 / this.meanRecvDeltaMs); } } /** * Keeps meta information about a probe packet. */ private class Probe { long sendTimeMs = -1L; long recvTimeMs = -1L; long payloadSize = 0; Probe(long sendTimeMs, long recvTimeMs, long payloadSize) { this.sendTimeMs = sendTimeMs; this.recvTimeMs = recvTimeMs; this.payloadSize = payloadSize; } } /** * Holds the {@link InterArrival}, {@link OveruseEstimator} and * {@link OveruseDetector} instances that estimate the remote bitrate of a * stream. */ private static class Detector { /** * Computes the send-time and recv-time deltas to feed to the estimator. */ private InterArrival interArrival; /** * The Kalman filter implementation that estimates the jitter. */ private OveruseEstimator estimator; /** * The overuse detector that compares the jitter to an adaptive threshold. */ private final OveruseDetector detector; /** * Ctor. * * @param options * @param enableBurstGrouping */ public Detector(OverUseDetectorOptions options, boolean enableBurstGrouping) { this.interArrival = new InterArrival( kTimestampGroupLengthTicks, kTimestampToMs, enableBurstGrouping); this.estimator = new OveruseEstimator(options); this.detector = new OveruseDetector(options); } } /** * Converts rtp timestamps to 24bit timestamp equivalence * @param timeMs is the RTP timestamp e.g System.currentTimeMillis(). * @return time stamp representation in 24 bit representation. */ public static long convertMsTo24Bits(long timeMs) { return (((timeMs << kAbsSendTimeFraction) + 500) / 1000) & 0x00FFFFFF; } }
[ "cmeng.gm@gmail.com" ]
cmeng.gm@gmail.com
db7bf89c22e432b1dc4d1213b43086724dc5eab0
ef8e7192cc0366cad6aec24fb00187d7e1bc954d
/comet/CoCoLauncher/src/com/iLoong/launcher/SetupMenu/Actions/DesktopAction.java
5fefd9367c65a9b1a86e17b0f079c0f3d9988b85
[]
no_license
srsman/daima111
44c89d430d5e296f01663fcf02627ccc4a0ab8fd
b8c1fb8a75d390f6542c53eaec9e46c6c505f022
refs/heads/master
2021-01-22T16:31:23.754703
2015-03-26T05:40:59
2015-03-26T05:40:59
null
0
0
null
null
null
null
UTF-8
Java
false
false
24,853
java
package com.iLoong.launcher.SetupMenu.Actions; import java.io.File; import java.io.IOException; import java.util.Calendar; import android.app.AlertDialog; import android.app.AlertDialog.Builder; import android.content.DialogInterface; import android.content.DialogInterface.OnClickListener; import android.content.SharedPreferences; import android.content.res.Resources; import android.os.Bundle; import android.os.Message; import android.preference.CheckBoxPreference; import android.preference.ListPreference; import android.preference.Preference; import android.preference.Preference.OnPreferenceChangeListener; import android.preference.PreferenceActivity; import android.preference.PreferenceCategory; import android.preference.PreferenceManager; import android.preference.PreferenceScreen; import com.iLoong.launcher.Desktop3D.Log; import android.widget.Toast; import com.iLoong.RR; import com.iLoong.launcher.Desktop3D.DefaultLayout; import com.iLoong.launcher.Desktop3D.R3D; import com.iLoong.launcher.SetupMenu.CopyDirectory; import com.iLoong.launcher.SetupMenu.SetupMenu; import com.iLoong.launcher.UI3DEngine.ParticleManager; import com.iLoong.launcher.desktop.iLoongApplication; import com.iLoong.launcher.desktop.iLoongLauncher; import com.iLoong.launcher.update.UpdateTask; import com.umeng.analytics.MobclickAgent; public class DesktopAction extends Action { private static final String DATABASE_NAME = "launcher.db"; public DesktopAction(int actionid, String action) { super(actionid, action); putIntentAction(SetupMenu.getContext(), DesktopSettingActivity.class); } public static void Init() { SetupMenuActions.getInstance().RegisterAction( ActionSetting.ACTION_DESKTOP_SETTINGS, new DesktopAction(ActionSetting.ACTION_DESKTOP_SETTINGS, DesktopAction.class.getName())); } @Override protected void OnRunAction() { // ClingManager.getInstance().cancelSettingCling(); SynRunAction(); } @Override protected void OnActionFinish() { } @Override protected void OnPutValue(String key) { if (key.equals(SetupMenu.getKey(RR.string.setting_key_desktopeffects))) { mBundle.putInt(key, Integer.valueOf(PreferenceManager .getDefaultSharedPreferences(SetupMenu.getContext()) .getString(key, "0"))); } else if (key.equals(SetupMenu .getKey(RR.string.setting_key_appeffects))) { mBundle.putInt(key, Integer.valueOf(PreferenceManager .getDefaultSharedPreferences(SetupMenu.getContext()) .getString(key, "0"))); } else if (key.equals(DesktopSettingActivity .getKey(RR.string.setting_key_vibrator))) { int val = 0; val = PreferenceManager.getDefaultSharedPreferences( SetupMenu.getContext()).getBoolean(key, true) ? 1 : 0; mBundle.putInt(key, val); } else if (key.equals(DesktopSettingActivity .getKey(RR.string.setting_key_circled))) { int val = 0; val = PreferenceManager.getDefaultSharedPreferences( SetupMenu.getContext()).getBoolean(key, false) ? 1 : 0; mBundle.putInt(key, val); } else if (key.equals(DesktopSettingActivity .getKey(RR.string.setting_key_resetwizard))) { mBundle.putInt(key, 1); } else if (key.equals(DesktopSettingActivity .getKey(RR.string.setting_key_shake_wallpaper))) { mBundle.putBoolean(key, PreferenceManager .getDefaultSharedPreferences(SetupMenu.getContext()) .getBoolean(key, false)); } else if (key.equals(DesktopSettingActivity .getKey(RR.string.icon_size_key))) { mBundle.putString(key, PreferenceManager .getDefaultSharedPreferences(SetupMenu.getContext()) .getString(key, "-1")); // xiatian add start //Widget3D adaptation "Naked eye 3D" } else if (key.equals(DesktopSettingActivity .getKey(RR.string.setting_key_sensor)) && (DefaultLayout.show_sensor)) { mBundle.putBoolean(key, PreferenceManager .getDefaultSharedPreferences(SetupMenu.getContext()) .getBoolean(key, DefaultLayout.default_open_sensor)); // xiatian add end } else if (key.equals(DesktopSettingActivity // added by zhenNan.ye begin .getKey(RR.string.setting_key_particle))) { mBundle.putBoolean(key, PreferenceManager .getDefaultSharedPreferences(SetupMenu.getContext()) .getBoolean(key, ParticleManager.particleManagerEnable)); } // added by zhenNan.ye end //xiatian add start //Mainmenu Bg else if (key.equals(DesktopSettingActivity .getKey(RR.string.mainmenu_bg_key))) { mBundle.putString(key, PreferenceManager .getDefaultSharedPreferences(SetupMenu.getContext()) .getString(key, "-1")); } //xiatian add end } public static class DesktopSettingActivity extends PreferenceActivity implements OnPreferenceChangeListener, Preference.OnPreferenceClickListener { @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); addPreferencesFromResource(RR.xml.desktopsetting); showitem(); callback(); } private void callback() { if (findPreference(getKey(RR.string.setting_key_desktopeffects)) != null) findPreference(getKey(RR.string.setting_key_desktopeffects)) .setOnPreferenceClickListener(this); if (findPreference(getKey(RR.string.setting_key_appeffects)) != null) findPreference(getKey(RR.string.setting_key_appeffects)) .setOnPreferenceClickListener(this); if (findPreference(getKey(RR.string.setting_key_exit)) != null) findPreference(getKey(RR.string.setting_key_exit)) .setOnPreferenceClickListener(this); if (findPreference(getKey(RR.string.setting_key_backup)) != null) findPreference(getKey(RR.string.setting_key_backup)) .setOnPreferenceClickListener(this); if (findPreference(getKey(RR.string.setting_key_restore)) != null) findPreference(getKey(RR.string.setting_key_restore)) .setOnPreferenceClickListener(this); if (findPreference(getKey(RR.string.setting_key_restart)) != null) findPreference(getKey(RR.string.setting_key_restart)) .setOnPreferenceClickListener(this); if (findPreference(getKey(RR.string.setting_key_share)) != null) findPreference(getKey(RR.string.setting_key_share)) .setOnPreferenceClickListener(this); if (findPreference(getKey(RR.string.setting_key_update)) != null) findPreference(getKey(RR.string.setting_key_update)) .setOnPreferenceClickListener(this); if (findPreference(getKey(RR.string.setting_key_feedback)) != null) findPreference(getKey(RR.string.setting_key_feedback)) .setOnPreferenceClickListener(this); if (findPreference(getKey(RR.string.setting_key_vibrator)) != null) findPreference(getKey(RR.string.setting_key_vibrator)) .setOnPreferenceClickListener(this); if (findPreference(getKey(RR.string.setting_key_circled)) != null) findPreference(getKey(RR.string.setting_key_circled)) .setOnPreferenceClickListener(this); if (findPreference(getKey(RR.string.setting_key_installhelp)) != null) findPreference(getKey(RR.string.setting_key_installhelp)) .setOnPreferenceClickListener(this); if (findPreference(getKey(RR.string.setting_key_resetwizard)) != null) findPreference(getKey(RR.string.setting_key_resetwizard)) .setOnPreferenceClickListener(this); if (findPreference(getKey(RR.string.setting_key_shake_wallpaper)) != null) findPreference(getKey(RR.string.setting_key_shake_wallpaper)) .setOnPreferenceClickListener(this); if (findPreference(getKey(RR.string.icon_size_key)) != null) { findPreference(getKey(RR.string.icon_size_key)) .setOnPreferenceClickListener(this); } // xiatian add start //Widget3D adaptation "Naked eye 3D" if (findPreference(getKey(RR.string.setting_key_sensor)) != null && (DefaultLayout.show_sensor)) findPreference(getKey(RR.string.setting_key_sensor)) .setOnPreferenceClickListener(this); // xiatian add end if (findPreference(getKey(RR.string.setting_update_desktop)) != null) { findPreference(getKey(RR.string.setting_update_desktop)) .setOnPreferenceClickListener(this); } /************** added by zhenNan.ye begin*******************/ if (findPreference(getKey(RR.string.setting_key_particle)) != null) { findPreference(getKey(RR.string.setting_key_particle)) .setOnPreferenceClickListener(this); } /************** added by zhenNan.ye end*******************/ //xiatian add start //Mainmenu Bg if (findPreference(getKey(RR.string.mainmenu_bg_key)) != null) { findPreference(getKey(RR.string.mainmenu_bg_key)) .setOnPreferenceClickListener(this); } //xiatian add end } private void showitem() { Resources res = SetupMenu.getContext().getResources(); String key = res.getString(RR.string.setting_key_desktopeffects); ListPreference pf = (ListPreference) findPreference(key); pf.setOnPreferenceChangeListener(this); CharSequence[] summarys = pf.getEntries(); pf.setSummary(summarys[Integer.valueOf(PreferenceManager .getDefaultSharedPreferences(SetupMenu.getContext()) .getString(key, "0"))]); key = SetupMenu.getContext().getResources() .getString(RR.string.setting_key_appeffects); pf = (ListPreference) findPreference(key); pf.setOnPreferenceChangeListener(this); summarys = pf.getEntries(); pf.setSummary(summarys[Integer.valueOf(PreferenceManager .getDefaultSharedPreferences(SetupMenu.getContext()) .getString(key, "0"))]); SharedPreferences prefs = PreferenceManager .getDefaultSharedPreferences(this); boolean autoStart = prefs.getBoolean( res.getString(RR.string.setting_key_vibrator), true); CheckBoxPreference vibratorpf = (CheckBoxPreference) findPreference(res .getString(RR.string.setting_key_vibrator)); if (autoStart) { vibratorpf.setChecked(autoStart); } autoStart = prefs.getBoolean( res.getString(RR.string.setting_key_circled), false); vibratorpf = (CheckBoxPreference) findPreference(res .getString(RR.string.setting_key_circled)); if (DefaultLayout.disable_circled) { PreferenceCategory category = (PreferenceCategory) this .findPreference(res .getString(RR.string.setting_key_basic_setting)); if (vibratorpf != null) category.removePreference(vibratorpf); } else { if (autoStart) { vibratorpf.setChecked(autoStart); } } autoStart = prefs .getBoolean(res .getString(RR.string.setting_key_shake_wallpaper), false); CheckBoxPreference shake_wallpaper = (CheckBoxPreference) findPreference(res .getString(RR.string.setting_key_shake_wallpaper)); if (DefaultLayout.disable_shake_wallpaper) { PreferenceCategory category = (PreferenceCategory) this .findPreference(res .getString(RR.string.setting_key_basic_setting)); if (shake_wallpaper != null) category.removePreference(shake_wallpaper); } else { if (autoStart) { shake_wallpaper.setChecked(autoStart); } } key = res.getString(RR.string.icon_size_key); pf = (ListPreference) findPreference(key); if (pf != null) { pf.setOnPreferenceChangeListener(this); if (!DefaultLayout.show_icon_size) { PreferenceCategory category = (PreferenceCategory) this .findPreference(res .getString(RR.string.setting_key_effect_setting)); if (pf != null && category != null) category.removePreference(pf); } else { summarys = pf.getEntries(); pf.setSummary(summarys[Integer.valueOf(PreferenceManager .getDefaultSharedPreferences(SetupMenu.getContext()) .getString(key, "0"))]); } } // xiatian add start //Widget3D adaptation "Naked eye 3D" autoStart = prefs.getBoolean( res.getString(RR.string.setting_key_sensor), DefaultLayout.default_open_sensor); CheckBoxPreference sensorcbpf = (CheckBoxPreference) findPreference(res .getString(RR.string.setting_key_sensor)); if (!DefaultLayout.show_sensor) { PreferenceCategory category = (PreferenceCategory) this .findPreference(res .getString(RR.string.setting_key_basic_setting)); if (sensorcbpf != null) category.removePreference(sensorcbpf); } else { sensorcbpf.setOnPreferenceChangeListener(this); if (autoStart) { sensorcbpf.setChecked(autoStart); } } // xiatian add end /************** added by zhenNan.ye begin*******************/ autoStart = prefs.getBoolean(res.getString(RR.string.setting_key_particle), true); CheckBoxPreference particleCbpf = (CheckBoxPreference) findPreference(res .getString(RR.string.setting_key_particle)); if (!DefaultLayout.enable_particle || !ParticleManager.switchForTheme) { PreferenceCategory category = (PreferenceCategory) this.findPreference(res. getString(RR.string.setting_key_basic_setting)); if (particleCbpf != null) { category.removePreference(particleCbpf); } } else { if (autoStart) { particleCbpf.setChecked(autoStart); } } /************** added by zhenNan.ye end*******************/ if (DefaultLayout.hide_backup_and_restore) { PreferenceScreen screen = (PreferenceScreen) this .findPreference(res .getString(RR.string.setting_key_desktop_setting)); PreferenceCategory temp_category = (PreferenceCategory) this .findPreference(res .getString(RR.string.setting_key_backup_and_restore)); // Preference preference1 = (Preference) this // .findPreference(res // .getString(RR.string.backup_desktop)); // Preference preference2 = (Preference) this // .findPreference(res // .getString(RR.string.restore_desktop)); // temp_category.removePreference(preference1); // temp_category.removePreference(preference2); if (temp_category != null) screen.removePreference(temp_category); } else { key = res.getString(RR.string.setting_key_restore); Preference pfrestore = (Preference) findPreference(key); if (!checkBackup()) { pfrestore.setEnabled(false); } else { pfrestore.setEnabled(true); } } //xiatian add start //Mainmenu Bg key = res.getString(RR.string.mainmenu_bg_key); pf = (ListPreference) findPreference(key); if (pf != null) { pf.setOnPreferenceChangeListener(this); summarys = pf.getEntries(); pf.setSummary(summarys[Integer.valueOf(PreferenceManager .getDefaultSharedPreferences(SetupMenu.getContext()) .getString(key, DefaultLayout.defaultMainmenuBgIndex + ""))]); } //xiatian add end } private boolean checkBackup() { boolean bret = false; String key = SetupMenu.getContext().getResources() .getString(RR.string.setting_key_backup); Preference pf = (Preference) findPreference(key); File file = new File(iLoongApplication.getBackupPath(), DATABASE_NAME); String strSumm = new String(); if (file.exists()) { long createtime = file.lastModified(); Calendar cal = Calendar.getInstance(); cal.setTimeInMillis(createtime); strSumm = R3D.getString(RR.string.backup_latest) + " " + cal.getTime().toLocaleString(); bret = true; } else { strSumm = R3D.getString(RR.string.backup_no_back); } pf.setSummary(strSumm); return bret; } private void backdialog(String title, String msg) { AlertDialog.Builder builder = new Builder(this); builder.setMessage(msg); builder.setTitle(title); builder.setPositiveButton( R3D.getString(RR.string.circle_ok_action), new OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { dialog.dismiss(); bakcupdb(); showitem(); } }); builder.setNegativeButton( R3D.getString(RR.string.circle_cancel_action), new OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { dialog.dismiss(); } }); builder.create().show(); } private void restoredialog(String title, String msg) { AlertDialog.Builder builder = new Builder(this); builder.setMessage(msg); builder.setTitle(title); builder.setPositiveButton( R3D.getString(RR.string.circle_ok_action), new OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { dialog.dismiss(); if (restoredb()) { finish(); SetupMenuActions.getInstance().Handle( ActionSetting.ACTION_RESTART); } } }); builder.setNegativeButton( R3D.getString(RR.string.circle_cancel_action), new OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { dialog.dismiss(); } }); builder.create().show(); } private void resetClingdialog(String title, String msg) { AlertDialog.Builder builder = new Builder(this); builder.setMessage(msg); builder.setTitle(title); builder.setPositiveButton( R3D.getString(RR.string.circle_ok_action), new OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { dialog.dismiss(); finish(); SetupMenuActions.getInstance().Handle( ActionSetting.ACTION_RESET_WIZARD); SetupMenuActions.getInstance().Handle( ActionSetting.ACTION_RESTART); } }); builder.setNegativeButton( R3D.getString(RR.string.circle_cancel_action), new OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { dialog.dismiss(); } }); builder.create().show(); } public void bakcupdb() { String sourceDir = iLoongApplication.getInstance() .getDatabasePath(DATABASE_NAME).getParent(); String targetDir = iLoongApplication.getBackupPath(); // String sourcepath = // iLoongApplication.getInstance().getDatabasePath(DATABASE_NAME).getPath(); // String targetpath = iLoongApplication.getBackupPath() + "/" + // DATABASE_NAME; // File sourceFile = new File(sourcepath); // File targetFile = new File(targetpath); try { CopyDirectory.copyDirectiory(sourceDir, targetDir); // CopyDirectory.copyFile(sourceFile, targetFile); Toast.makeText(this, R3D.getString(RR.string.backup_success), Toast.LENGTH_SHORT).show(); } catch (IOException e) { e.printStackTrace(); Toast.makeText(this, R3D.getString(RR.string.backup_fail), Toast.LENGTH_SHORT).show(); } } public boolean restoredb() { boolean bret = true; String targetDir = iLoongApplication.getInstance() .getDatabasePath(DATABASE_NAME).getParent(); String sourceDir = iLoongApplication.getBackupPath(); // String targetpath = // iLoongApplication.getInstance().getDatabasePath(DATABASE_NAME).getPath(); // String sourcepath = iLoongApplication.getBackupPath() + "/" + // DATABASE_NAME; // File sourceFile = new File(sourcepath); // File targetFile = new File(targetpath); try { CopyDirectory.copyDirectiory(sourceDir, targetDir); // CopyDirectory.copyFile(sourceFile, targetFile); } catch (IOException e) { bret = false; Toast.makeText(this, R3D.getString(RR.string.restore_fail), Toast.LENGTH_SHORT).show(); e.printStackTrace(); } return bret; } private void updateDesktop() { UpdateTask updateTask = new UpdateTask(this); if (updateTask.IsHaveInternet(this) == false) { Toast.makeText(iLoongLauncher.getInstance(), RR.string.update_err, Toast.LENGTH_SHORT).show(); } else { updateTask.checkUpdate(1); } } public static String getKey(int key) { return SetupMenu.getKey(key); } @Override protected void onResume() { super.onResume(); //友盟统计 MobclickAgent.onResume(this); } @Override protected void onPause() { if (this.isFinishing()) { SetupMenuActions.getInstance().ActivityFinish( ActionSetting.ACTION_DESKTOP_SETTINGS); } super.onPause(); //友盟统计 MobclickAgent.onPause(this); } protected void onStop() { if (this.isFinishing()) { SetupMenuActions.getInstance().ActivityFinish( ActionSetting.ACTION_DESKTOP_SETTINGS); } super.onStop(); } @Override public boolean onPreferenceClick(Preference preference) { String key = preference.getKey(); if (key == null) return false; if (key.equals(getKey(RR.string.setting_key_exit))) { finish(); iLoongApplication.getInstance().StopServer(); Message msg = iLoongLauncher.getInstance().mMainHandler .obtainMessage(7777); iLoongLauncher.getInstance().mMainHandler.sendMessage(msg); } else if (key.equals(getKey(RR.string.setting_key_restart))) { finish(); SetupMenuActions.getInstance().Handle( ActionSetting.ACTION_RESTART); } else if (key.equals(getKey(RR.string.setting_key_backup))) { if (iLoongApplication.getSDPath() == null) { Toast.makeText(this, R3D.getString(RR.string.backup_pls_insert_SD), Toast.LENGTH_SHORT).show(); } else { backdialog(R3D.getString(RR.string.backup_title_back), R3D.getString(RR.string.backup_back_to_SD)); } } else if (key.equals(getKey(RR.string.setting_key_restore))) { restoredialog(R3D.getString(RR.string.backup_title_restore), R3D.getString(RR.string.backup_restore)); } else if (key.equals(getKey(RR.string.setting_key_update))) { finish(); SetupMenuActions.getInstance().Handle( ActionSetting.ACTION_UPDATE); } else if (key.equals(getKey(RR.string.setting_key_share))) { finish(); SetupMenuActions.getInstance().Handle( ActionSetting.ACTION_SHARE); } else if (key.equals(getKey(RR.string.setting_key_feedback))) { finish(); SetupMenuActions.getInstance().Handle( ActionSetting.ACTION_FEEDBACK); } else if (key.equals(getKey(RR.string.setting_key_desktopeffects)) || key.equals(getKey(RR.string.setting_key_appeffects)) || key.equals(getKey(RR.string.setting_key_vibrator)) || key.equals(getKey(RR.string.setting_key_circled)) || key.equals(getKey(RR.string.setting_key_shake_wallpaper)) || key.equals(getKey(RR.string.icon_size_key)) || (key.equals(getKey(RR.string.setting_key_sensor)) && (DefaultLayout.show_sensor))// xiatian // add // start // //Widget3D // adaptation // "Naked eye 3D" || key.equals(getKey(RR.string.setting_key_particle)) // added by zhenNan.ye || key.equals(getKey(RR.string.icon_size_key)) //xiatian add //Mainmenu Bg ) { mKey.add(key); } else if (key.equals(getKey(RR.string.setting_key_installhelp))) { // mKey.add(key); finish(); SetupMenuActions.getInstance().Handle( ActionSetting.ACTION_INSTALL_HELP); } else if (key.equals(getKey(RR.string.setting_key_resetwizard))) { resetClingdialog(R3D.getString(RR.string.guide_title), R3D.getString(RR.string.guide_proceed)); } else if (key.equals(getKey(RR.string.setting_update_desktop))) { updateDesktop(); } return false; } @Override public boolean onPreferenceChange(Preference preference, Object newValue) { Log.v("preference", "preference=" + preference + ";;newValue=" + newValue); String desktopkey = SetupMenu.getContext().getResources() .getString(RR.string.setting_key_desktopeffects); String appkey = SetupMenu.getContext().getResources() .getString(RR.string.setting_key_appeffects); String iconSizeKey = SetupMenu.getContext().getResources() .getString(RR.string.icon_size_key); // xiatian add start //Widget3D adaptation "Naked eye 3D" String sensorkey = SetupMenu.getContext().getResources() .getString(RR.string.setting_key_sensor); // xiatian add end String mainmenu_bg_key = SetupMenu.getContext().getResources() .getString(RR.string.mainmenu_bg_key); //xiatian add //Mainmenu Bg if (preference.getKey().equals(desktopkey) || preference.getKey().equals(appkey) || preference.getKey().equals(iconSizeKey) || preference.getKey().equals(mainmenu_bg_key) //xiatian add //Mainmenu Bg ) { ListPreference pf = (ListPreference) preference; CharSequence[] summarys = pf.getEntries(); pf.setSummary(summarys[Integer.valueOf((String) newValue)]); } // xiatian add start //Widget3D adaptation "Naked eye 3D" else if (preference.getKey().equals(sensorkey) && (DefaultLayout.show_sensor)) { if (!iLoongLauncher.getInstance().isPhoneSupportSensor()) { Toast.makeText( iLoongLauncher.getInstance(), SetupMenu.getContext().getResources() .getString(RR.string.sensor_not_supported), Toast.LENGTH_SHORT).show(); return false; } } // xiatian add end return true; } } }
[ "liangxiaoling@cooee.cn" ]
liangxiaoling@cooee.cn
496eaae2551c71576d1898d83efea13ecdf6a84c
fbcc22b603fdcfff37dfdf4da4c69b0096a44fa3
/springboot/SpringBoot-shiro/SpringBoot-Shiro-Vue/back/src/main/java/com/heeexy/example/config/exception/GlobalExceptionHandler.java
1b671326cee275e65c79361e72f32a253e2d1f27
[]
no_license
chunchengmeigui/dalyNote
0d4b40866ce142ec915f9aadb587f79bafe96b3a
deb9a4a634952d05e4a5a34bebc8cc51294a70b6
refs/heads/master
2021-06-15T07:10:48.307819
2021-04-23T09:54:03
2021-04-23T09:54:03
175,994,544
3
0
null
2020-12-14T15:45:13
2019-03-16T16:13:05
Java
UTF-8
Java
false
false
3,064
java
package com.heeexy.example.config.exception; import com.alibaba.fastjson.JSONObject; import com.heeexy.example.util.CommonUtil; import com.heeexy.example.util.constants.ErrorEnum; import org.apache.shiro.authz.UnauthenticatedException; import org.apache.shiro.authz.UnauthorizedException; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.web.HttpRequestMethodNotSupportedException; import org.springframework.web.bind.annotation.ControllerAdvice; import org.springframework.web.bind.annotation.ExceptionHandler; import org.springframework.web.bind.annotation.ResponseBody; import javax.servlet.http.HttpServletRequest; /** * @author: hxy * @description: 统一异常拦截 * @date: 2017/10/24 10:31 */ @ControllerAdvice @ResponseBody public class GlobalExceptionHandler { private Logger logger = LoggerFactory.getLogger(this.getClass().getName()); @ExceptionHandler(value = Exception.class) public JSONObject defaultErrorHandler(HttpServletRequest req, Exception e) { String errorPosition = ""; //如果错误堆栈信息存在 if (e.getStackTrace().length > 0) { StackTraceElement element = e.getStackTrace()[0]; String fileName = element.getFileName() == null ? "未找到错误文件" : element.getFileName(); int lineNumber = element.getLineNumber(); errorPosition = fileName + ":" + lineNumber; } JSONObject jsonObject = new JSONObject(); jsonObject.put("code", ErrorEnum.E_400.getErrorCode()); jsonObject.put("msg", ErrorEnum.E_400.getErrorMsg()); JSONObject errorObject = new JSONObject(); errorObject.put("errorLocation", e.toString() + " 错误位置:" + errorPosition); jsonObject.put("info", errorObject); logger.error("异常", e); return jsonObject; } /** * GET/POST请求方法错误的拦截器 * 因为开发时可能比较常见,而且发生在进入controller之前,上面的拦截器拦截不到这个错误 * 所以定义了这个拦截器 */ @ExceptionHandler(HttpRequestMethodNotSupportedException.class) public JSONObject httpRequestMethodHandler() { return CommonUtil.errorJson(ErrorEnum.E_500); } /** * 本系统自定义错误的拦截器 * 拦截到此错误之后,就返回这个类里面的json给前端 * 常见使用场景是参数校验失败,抛出此错,返回错误信息给前端 */ @ExceptionHandler(CommonJsonException.class) public JSONObject commonJsonExceptionHandler(CommonJsonException commonJsonException) { return commonJsonException.getResultJson(); } /** * 权限不足报错拦截 */ @ExceptionHandler(UnauthorizedException.class) public JSONObject unauthorizedExceptionHandler() { return CommonUtil.errorJson(ErrorEnum.E_502); } /** * 未登录报错拦截 * 在请求需要权限的接口,而连登录都还没登录的时候,会报此错 */ @ExceptionHandler(UnauthenticatedException.class) public JSONObject unauthenticatedException() { return CommonUtil.errorJson(ErrorEnum.E_20011); } }
[ "d903321643" ]
d903321643
b494f24246eb705c5cec191ad769b9711e8aabdb
919cb1eb0e9b0cc8605f909764f018172bcb3063
/app/src/main/java/com/example/toshiba/ternakku/ui/Startup.java
2a6a715fc02f968c8f8d8b89037d7711d7012b6f
[]
no_license
asywalulfikri/ternakku
94d668f4edbef85b3a88b38330e4e522fe7fb228
8f9a92fff22b7f9bdce69a54a0805567c6d0186b
refs/heads/master
2016-08-12T03:15:28.712963
2015-12-28T03:21:52
2015-12-28T03:21:52
47,543,057
0
0
null
null
null
null
UTF-8
Java
false
false
4,956
java
package com.example.toshiba.ternakku.ui; import android.app.Activity; import android.content.Context; import android.content.Intent; import android.net.ConnectivityManager; import android.net.NetworkInfo; import android.os.AsyncTask; import android.os.Bundle; import android.util.Log; import android.widget.EditText; import android.widget.ProgressBar; import com.example.toshiba.ternakku.R; import com.example.toshiba.ternakku.helper.AlertDialogManager; import java.io.BufferedInputStream; import java.io.IOException; import java.io.InputStream; import java.net.HttpURLConnection; import java.net.URL; import java.util.Scanner; import oauth.signpost.OAuthConsumer; import oauth.signpost.basic.DefaultOAuthConsumer; import oauth.signpost.exception.OAuthCommunicationException; import oauth.signpost.exception.OAuthExpectationFailedException; import oauth.signpost.exception.OAuthMessageSignerException; import oauth.signpost.http.HttpParameters; public class Startup extends Activity { // this for send message text using intent public final static String EXTRA_MESSAGE = "lisa"; EditText etRequestToken; String getToken, rawToken, tokenMessage; ProgressBar pbStartup; OAuthConsumer consumer; AlertDialogManager alert = new AlertDialogManager(); @SuppressWarnings("unchecked") @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.startup_layout); etRequestToken = (EditText) findViewById(R.id.etRequestToken); pbStartup = (ProgressBar) findViewById(R.id.pbStartup); // Check Connection if (isOnline()) { new getToken().execute(); } else { alert.showAlertDialog(Startup.this, "Error", "No Network Connection", false); } // This for move to Login Form Thread timer = new Thread() { public void run() { try { sleep(2000); } catch (InterruptedException e) { // TODO: handle exception e.printStackTrace(); }finally { Intent intent = new Intent(Startup.this, LoginActivity.class); // String message = etRequestToken.getText().toString(); String message = tokenMessage; intent.putExtra(EXTRA_MESSAGE, message); startActivity(intent); } } }; timer.start(); } @SuppressWarnings("rawtypes") private class getToken extends AsyncTask { @Override protected Object doInBackground(Object... params) { // TODO Auto-generated method stub // HttpManager manage = new HttpManager(); try { getRequestToken(); } catch (OAuthMessageSignerException e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (OAuthExpectationFailedException e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (OAuthCommunicationException e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } return null; } } // This for check Connection protected boolean isOnline() { ConnectivityManager cm = (ConnectivityManager) getSystemService(Context.CONNECTIVITY_SERVICE); NetworkInfo netInfo = cm.getActiveNetworkInfo(); if (netInfo != null && netInfo.isConnectedOrConnecting()) { return true; } else { return false; } } // This for get Request Token from REST API private void getRequestToken() throws IOException, OAuthMessageSignerException, OAuthExpectationFailedException, OAuthCommunicationException { final String uri = "https://accounts.8villages.com/oauth/request-token"; URL url = new URL(uri); HttpURLConnection urlConnection = (HttpURLConnection) url .openConnection(); urlConnection.setRequestProperty("Accept", "application/json"); urlConnection.setRequestMethod("POST"); urlConnection.setDoOutput(true); consumer = new DefaultOAuthConsumer("Ha4MbCabE3XBlALPUMIz5P0EUE0.", "Qr5cwJPq4pN0gil3SbmXLIsrYy_EpULHNa2bmpM9l0w."); HttpParameters doubleEncodedParams = new HttpParameters(); doubleEncodedParams.put("realm", uri); consumer.setAdditionalParameters(doubleEncodedParams); consumer.sign(urlConnection); try { int rawCode = urlConnection.getResponseCode(); String statusCode = String.valueOf(rawCode); Log.d("Status Code", statusCode); InputStream in = new BufferedInputStream( urlConnection.getInputStream()); @SuppressWarnings("resource") String inputStreamString = new Scanner(in, "UTF-8").useDelimiter( " ").next(); String[] temp = inputStreamString.split("&"); String tempToken = temp[0].toString(); rawToken = tempToken.substring(12, 40); Log.d("request token", rawToken); } catch (Exception e) { e.printStackTrace(); // TODO: handle exception } finally { urlConnection.disconnect(); } // etRequestToken.setText(rawToken); tokenMessage = rawToken; } // This for destroy app protected void onPause() { // TODO Auto-generated method stub super.onPause(); finish(); } }
[ "fikri@fupei.com" ]
fikri@fupei.com
0bc3edbde77d1bde3ea5a3c8cbecfed58dfbf378
8b656bbb29caa5a9538e9932d36c8267bd4af221
/GroupProject1/test/HareTest.java
c725bbe129c26176ff6918206ddbcea887bbbadb
[]
no_license
croznik/programmingskills2
90416599502db24311645d6524da331718679294
9af19e4faafebd70afb0163bd5582c820d6b3039
refs/heads/master
2021-03-12T20:40:52.942288
2014-11-07T13:36:03
2014-11-07T13:36:40
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,074
java
/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package testing; import groupproject.*; import org.junit.*; import static org.junit.Assert.*; /** * * @author Main */ public class HareTest { private Hare hare = new Hare(); private static double TOLERANCE = 1e-10; @Test public void testIsPrey(){ assertEquals("Test hare is prey", false, hare.isPredator()); } @Test public void testDefaultBirthRate(){ assertEquals("Test Default birth rate is 0.08",0.08,hare.getBirthRate(),TOLERANCE); } @Test public void testDefaultDiffusionRate(){ assertEquals("Test Default diffusion rate is 0.2",0.2,hare.getDiffusionRate(),TOLERANCE); } @Test public void testDefaultMortalityRate(){ assertEquals("Test default mortality rate is 0.00",0.00,hare.getMortalityRate(),TOLERANCE); } @Test public void testDefaultPredationRate(){ assertEquals("Test default predation rate is 0.00 ",0.00,hare.getPredationRate(),TOLERANCE); } }
[ "Main@main-Satellite-C660.(none)" ]
Main@main-Satellite-C660.(none)
4e508e17bd26c890f56e957b818e5dc2dae53d61
578a45a81f619d07be0b8ac615e8f92abf7b93bf
/src/main/java/com/thoughtworks/model/Jail.java
aeca72c4a8fae1bd4404c5b5ac89d68ec73d38f6
[]
no_license
nigamkartik96/monopoly
d9629c4d3a06b992a220e11d5812ff254d52173e
c63b3ac43f3c7d3c8d0bec0f40100c963789c9bb
refs/heads/master
2020-09-03T17:37:18.620697
2019-11-04T14:40:03
2019-11-04T14:40:03
219,522,501
0
0
null
null
null
null
UTF-8
Java
false
false
679
java
package com.thoughtworks.model; import com.thoughtworks.constants.Constants; import com.thoughtworks.game.Board; public class Jail extends Cell { @Override public void doAction(Player player, Board board) { if (player.getMoney().getAmount() < Constants.JAIL_FINE) { player.subMoney(Constants.JAIL_FINE); player.setCanContinue(false); System.err.println(player.getName() + " went broke!"); } else { System.out.println(player.getName() + " lost " + Constants.JAIL_FINE + " in Jail"); player.subMoney(Constants.JAIL_FINE); board.addMoneyToBank(Constants.JAIL_FINE); } } }
[ "kartik.nigam@paytm.com" ]
kartik.nigam@paytm.com
fd90f648bb782b36e03acc6e8e5c63ae49d961b8
3fbe8559e6690c360c4948521170df29a771c095
/SLA/src/main/java/com/inapp/cms/utils/RandomString.java
eda4403705e0d90afd0e8c549e783ba06a4a7721
[]
no_license
cibye221b/SLA
b6ddf25b7f5fa8d72b6ea2b2e06d4068e0af2132
624468806873e324546b5c2cb1670ea33d412a6e
refs/heads/master
2020-12-11T03:38:30.447001
2016-09-03T10:21:07
2016-09-03T10:21:07
null
0
0
null
null
null
null
UTF-8
Java
false
false
810
java
package com.inapp.cms.utils; /** * @author Jinesh George */ import java.util.Random; public class RandomString { private static char[] symbols; static { StringBuilder tmp = new StringBuilder(); for (char ch = '0'; ch <= '9'; ++ch) tmp.append(ch); for (char ch = 'a'; ch <= 'z'; ++ch) tmp.append(ch); symbols = tmp.toString().toCharArray(); } private final Random random = new Random(); private final char[] buf; public RandomString(int length) { if (length < 1) throw new IllegalArgumentException("length < 1: " + length); buf = new char[length]; } public String nextString() { for (int idx = 0; idx < buf.length; ++idx) buf[idx] = symbols[random.nextInt(symbols.length)]; return new String(buf); } }
[ "root@localhost.localdomain" ]
root@localhost.localdomain
bb3b0c7f74cd528b026f5d32889e653fffb30fee
439e0946983d314ed674ffec4e6a1e55a32d9bde
/app/src/main/java/com/digital/assignment/ValueFormatter.java
26299bde28a85136cb2e8ebc1efeee5a26c5e2c7
[]
no_license
MehmoodU-stratagile/ili.assignment
ed842f6dd7ab1c84e2a6a07c99eb91f07d695d2c
f0dc96e0f9b6cd30fb309b7e5ebd589b73494126
refs/heads/main
2023-03-01T09:23:30.065940
2021-02-12T07:51:44
2021-02-12T07:51:44
null
0
0
null
null
null
null
UTF-8
Java
false
false
4,850
java
package com.digital.assignment; import com.github.mikephil.charting.components.AxisBase; import com.github.mikephil.charting.data.BarEntry; import com.github.mikephil.charting.data.BubbleEntry; import com.github.mikephil.charting.data.CandleEntry; import com.github.mikephil.charting.data.Entry; import com.github.mikephil.charting.data.PieEntry; import com.github.mikephil.charting.data.RadarEntry; import com.github.mikephil.charting.formatter.IAxisValueFormatter; import com.github.mikephil.charting.formatter.IValueFormatter; import com.github.mikephil.charting.utils.ViewPortHandler; public abstract class ValueFormatter implements IAxisValueFormatter, IValueFormatter { /** * <b>DO NOT USE</b>, only for backwards compatibility and will be removed in future versions. * * @param value the value to be formatted * @param axis the axis the value belongs to * @return formatted string label */ @Override @Deprecated public String getFormattedValue(float value, AxisBase axis) { return getFormattedValue(value); } /** * <b>DO NOT USE</b>, only for backwards compatibility and will be removed in future versions. * @param value the value to be formatted * @param entry the entry the value belongs to - in e.g. BarChart, this is of class BarEntry * @param dataSetIndex the index of the DataSet the entry in focus belongs to * @param viewPortHandler provides information about the current chart state (scale, translation, ...) * @return formatted string label */ @Override @Deprecated public String getFormattedValue(float value, Entry entry, int dataSetIndex, ViewPortHandler viewPortHandler) { return getFormattedValue(value); } /** * Called when drawing any label, used to change numbers into formatted strings. * * @param value float to be formatted * @return formatted string label */ public String getFormattedValue(float value) { return String.valueOf(value); } /** * Used to draw axis labels, calls {@link #getFormattedValue(float)} by default. * * @param value float to be formatted * @param axis axis being labeled * @return formatted string label */ public String getAxisLabel(float value, AxisBase axis) { return getFormattedValue(value); } /** * Used to draw bar labels, calls {@link #getFormattedValue(float)} by default. * * @param barEntry bar being labeled * @return formatted string label */ public String getBarLabel(BarEntry barEntry) { return getFormattedValue(barEntry.getY()); } /** * Used to draw stacked bar labels, calls {@link #getFormattedValue(float)} by default. * * @param value current value to be formatted * @param stackedEntry stacked entry being labeled, contains all Y values * @return formatted string label */ public String getBarStackedLabel(float value, BarEntry stackedEntry) { return getFormattedValue(value); } /** * Used to draw line and scatter labels, calls {@link #getFormattedValue(float)} by default. * * @param entry point being labeled, contains X value * @return formatted string label */ public String getPointLabel(Entry entry) { return getFormattedValue(entry.getY()); } /** * Used to draw pie value labels, calls {@link #getFormattedValue(float)} by default. * * @param value float to be formatted, may have been converted to percentage * @param pieEntry slice being labeled, contains original, non-percentage Y value * @return formatted string label */ public String getPieLabel(float value, PieEntry pieEntry) { return getFormattedValue(value); } /** * Used to draw radar value labels, calls {@link #getFormattedValue(float)} by default. * * @param radarEntry entry being labeled * @return formatted string label */ public String getRadarLabel(RadarEntry radarEntry) { return getFormattedValue(radarEntry.getY()); } /** * Used to draw bubble size labels, calls {@link #getFormattedValue(float)} by default. * * @param bubbleEntry bubble being labeled, also contains X and Y values * @return formatted string label */ public String getBubbleLabel(BubbleEntry bubbleEntry) { return getFormattedValue(bubbleEntry.getSize()); } /** * Used to draw high labels, calls {@link #getFormattedValue(float)} by default. * * @param candleEntry candlestick being labeled * @return formatted string label */ public String getCandleLabel(CandleEntry candleEntry) { return getFormattedValue(candleEntry.getHigh()); } }
[ "36883202+Mehmood-usman@users.noreply.github.com" ]
36883202+Mehmood-usman@users.noreply.github.com
cf9e38356cdc9bb2d5cf3bc6f5c3dedf6e532a84
19f7e40c448029530d191a262e5215571382bf9f
/decompiled/instagram/sources/p000X/DD9.java
b81edb45a2f6db7c41d9296c77926e31a87b0d3e
[]
no_license
stanvanrooy/decompiled-instagram
c1fb553c52e98fd82784a3a8a17abab43b0f52eb
3091a40af7accf6c0a80b9dda608471d503c4d78
refs/heads/master
2022-12-07T22:31:43.155086
2020-08-26T03:42:04
2020-08-26T03:42:04
283,347,288
18
1
null
null
null
null
UTF-8
Java
false
false
1,393
java
package p000X; import com.facebook.react.uimanager.BaseViewManager; import java.nio.ByteBuffer; /* renamed from: X.DD9 */ public final class DD9 extends DDK implements C29869DEe { public final void ABR(ByteBuffer byteBuffer, int i) { int A00 = DD3.A00(byteBuffer, i, 0); if (A00 != 0) { byteBuffer.getInt(A00); } DDP ddp = (DDP) DD3.A02(byteBuffer, i, 1, DDP.class); if (ddp != null) { this.A03 = ddp; float f = BaseViewManager.CAMERA_DISTANCE_NORMALIZATION_MULTIPLIER; int A002 = DD3.A00(byteBuffer, i, 2); if (A002 != 0) { f = byteBuffer.getFloat(A002); } this.A01 = f; float f2 = BaseViewManager.CAMERA_DISTANCE_NORMALIZATION_MULTIPLIER; int A003 = DD3.A00(byteBuffer, i, 3); if (A003 != 0) { f2 = byteBuffer.getFloat(A003); } this.A00 = f2; C29846DDh dDh = (C29846DDh) DD3.A01(byteBuffer, i, 4, C29845DDg.class); if (dDh != null) { this.A02 = dDh; this.A04 = (C29877DEm[]) DD3.A08(byteBuffer, i, 5, DDI.class); return; } throw new IllegalArgumentException("root layer cannot be null"); } throw new IllegalArgumentException("size cannot be null"); } }
[ "stan@rooy.works" ]
stan@rooy.works
629fb4fee87cc4d8cb3dbf57516d04dcb04fcfaf
dd01522057d622e942cc7c9058cbca61377679aa
/hybris/bin/platform/bootstrap/gensrc/de/hybris/platform/acceleratorservices/data/RequestContextData.java
8707071e4001def71b524714a83db83a816acc4b
[]
no_license
grunya404/bp-core-6.3
7d73db4db81015e4ae69eeffd43730f564e17679
9bc11bc514bd0c35d7757a9e949af89b84be634f
refs/heads/master
2021-05-19T11:32:39.663520
2017-09-01T11:36:21
2017-09-01T11:36:21
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,065
java
/* * ---------------------------------------------------------------- * --- WARNING: THIS FILE IS GENERATED AND WILL BE OVERWRITTEN! * --- Generated at 25 Aug 2017 4:31:24 PM * ---------------------------------------------------------------- * * [y] hybris Platform * * Copyright (c) 2000-2016 SAP SE * All rights reserved. * * This software is the confidential and proprietary information of SAP * Hybris ("Confidential Information"). You shall not disclose such * Confidential Information and shall use it only in accordance with the * terms of the license agreement you entered into with SAP Hybris. */ package de.hybris.platform.acceleratorservices.data; import de.hybris.platform.category.model.CategoryModel; import de.hybris.platform.commerceservices.search.pagedata.SearchPageData; import de.hybris.platform.core.model.product.ProductModel; /** * Holds context data for rendering the current request */ public class RequestContextData implements java.io.Serializable { /** <i>Generated property</i> for <code>RequestContextData.product</code> property defined at extension <code>acceleratorcms</code>. */ private ProductModel product; /** <i>Generated property</i> for <code>RequestContextData.category</code> property defined at extension <code>acceleratorcms</code>. */ private CategoryModel category; /** <i>Generated property</i> for <code>RequestContextData.search</code> property defined at extension <code>acceleratorcms</code>. */ private SearchPageData search; public RequestContextData() { // default constructor } public void setProduct(final ProductModel product) { this.product = product; } public ProductModel getProduct() { return product; } public void setCategory(final CategoryModel category) { this.category = category; } public CategoryModel getCategory() { return category; } public void setSearch(final SearchPageData search) { this.search = search; } public SearchPageData getSearch() { return search; } }
[ "mashimbyek@gmail.com" ]
mashimbyek@gmail.com
7a477ddfad68dde9a04c363eb6a6ea2b8a26f938
ef57e360945d470583da667567b9befc3215ca80
/Lorry-master/app/src/main/java/name/marinchenko/lorryvision/util/net/NetView.java
2e2ff4921633b8e210e7e17de3a23cde4be2c565
[]
no_license
drill2010/LorryVision
a0e34ed6b8129408496481c7fc6d9efb9d0ce6c9
35e14507939257e65851c2430768b81ce078fb00
refs/heads/master
2020-04-15T02:15:58.861164
2019-02-24T13:07:03
2019-02-24T13:07:03
164,308,247
0
0
null
null
null
null
UTF-8
Java
false
false
4,747
java
package name.marinchenko.lorryvision.util.net; import android.os.Bundle; import java.util.ArrayList; import java.util.List; /** * NetView contains data for viewing in the networks list. */ public class NetView { public static String BUNDLE_KEY_LIST_SSID = "bundle_key_list_ssid"; public static String BUNDLE_KEY_LIST_TYPE = "bundle_key_list_type"; public static String BUNDLE_KEY_LIST_WAS_DETACHED = "bundle_key_list_was_detached"; public static String BUNDLE_KEY_LIST_HIGHLIGHTED = "bundle_key_list_highlighted"; public static String BUNDLE_KEY_LIST_LEVEL = "bundle_key_list_level"; private final String ssid; private final NetType type; private final boolean wasDetached; private final boolean highlighted; private final int level; public NetView(final String ssid, final boolean type, final boolean wasDetached, final boolean highlighted, final int level) { this.ssid = ssid; this.type = type ? NetType.lorryNetwork : NetType.wifiNetwork; this.wasDetached = wasDetached; this.highlighted = highlighted; this.level = level; } public String getSsid() { return this.ssid; } public NetType getType() { return this.type; } public boolean wasDetached() { return this.wasDetached; } public boolean getHighlighted() { return this.highlighted; } public int getSignalIcon() { if (this.level > -56) return 4; else if (this.level > -67) return 3; else if (this.level > -78) return 2; else if (this.level > -89) return 1; else return 0; } public static List<NetView> getNetViewList(final Bundle bundle) { final ArrayList<NetView> netViews = new ArrayList<>(); final ArrayList<String> ssidList = bundle.getStringArrayList(BUNDLE_KEY_LIST_SSID); final boolean typeArray[] = bundle.getBooleanArray(BUNDLE_KEY_LIST_TYPE); final boolean wasDetachedArray[] = bundle.getBooleanArray(BUNDLE_KEY_LIST_WAS_DETACHED); final boolean highlightedArray[] = bundle.getBooleanArray(BUNDLE_KEY_LIST_HIGHLIGHTED); final int levelArray[] = bundle.getIntArray(BUNDLE_KEY_LIST_LEVEL); if (ssidList != null && typeArray != null && wasDetachedArray != null && highlightedArray != null && levelArray != null) { for (int i = 0; i < ssidList.size(); i++) { netViews.add(new NetView( ssidList.get(i), typeArray[i], wasDetachedArray[i], highlightedArray[i], levelArray[i] )); } } return netViews; } public static Bundle getBundle(final List<Net> nets) { final Bundle bundle = new Bundle(); bundle.putStringArrayList(BUNDLE_KEY_LIST_SSID, getSsidList(nets)); bundle.putBooleanArray(BUNDLE_KEY_LIST_TYPE, getTypeArray(nets)); bundle.putBooleanArray(BUNDLE_KEY_LIST_WAS_DETACHED, getWasDetachedArray(nets)); bundle.putBooleanArray(BUNDLE_KEY_LIST_HIGHLIGHTED, getHighlightedArray(nets)); bundle.putIntArray(BUNDLE_KEY_LIST_LEVEL, getLevelArray(nets)); return bundle; } public static ArrayList<String> getSsidList(final List<Net> nets) { final ArrayList<String> ssidList = new ArrayList<>(); for (Net net : nets) { ssidList.add(net.getSsid()); } return ssidList; } public static boolean[] getTypeArray(final List<Net> nets) { final boolean typeArray[] = new boolean[nets.size()]; for (int i = 0; i < typeArray.length; i++) { typeArray[i] = nets.get(i).getType() == NetType.lorryNetwork; } return typeArray; } public static boolean[] getWasDetachedArray(final List<Net> nets) { final boolean wasDetachedArray[] = new boolean[nets.size()]; for (int i = 0; i < wasDetachedArray.length; i++) { wasDetachedArray[i] = nets.get(i).wasDetached(); } return wasDetachedArray; } public static boolean[] getHighlightedArray(final List<Net> nets) { final boolean higlightedArray[] = new boolean[nets.size()]; for (int i = 0; i < higlightedArray.length; i++) { higlightedArray[i] = nets.get(i).getHighlighted(); } return higlightedArray; } public static int[] getLevelArray(final List<Net> nets) { final int levelArray[] = new int[nets.size()]; for (int i = 0; i < levelArray.length; i++) { levelArray[i] = nets.get(i).getLevel(); } return levelArray; } }
[ "drill2010@yandex.ru" ]
drill2010@yandex.ru
49cb643999df005228f462b1d8dda2055bde584f
0fbd372915d09df44cf65271beae89a97d2fcdf2
/src/main/java/com/hermes/infrastructure/dataaccess/services/CargoServiceImpl.java
0c26522c83358a2bd870e60e09beea4c4270f0f1
[]
no_license
netcrackerschool/hermes
799811ff882ae857e707a4aab829d04fcb2b8daa
381bec35232c8ac6962b12884d40f552392ceb1c
refs/heads/master
2021-08-08T04:24:54.086142
2017-11-09T15:22:48
2017-11-09T15:22:48
110,107,630
0
0
null
null
null
null
UTF-8
Java
false
false
334
java
package com.hermes.infrastructure.dataaccess.services; import com.hermes.domain.cargo.AbstractCargo; /** * 05.10.15. */ public class CargoServiceImpl extends GenericServiceImpl<AbstractCargo> implements CargoService { public CargoServiceImpl(GenericRepository<AbstractCargo> repository) { super(repository); } }
[ "azanoviv02@gmail.com" ]
azanoviv02@gmail.com
43739054330747ae96669338b8dd575553059302
eeab34a5c9fd86be3fa22816842755c1098b284b
/arquillian-recorder-reporter/arquillian-recorder-reporter-impl/src/main/java/org/arquillian/recorder/reporter/impl/ReporterLifecycleObserver.java
67f07c36f4d745ae241c6027292a5a46c414a8a3
[ "Apache-2.0" ]
permissive
mattfred/arquillian-recorder
889df4494ecf6029f0fb31021c19e0cb6e602b0b
b117d5802ab809275b27caf168de791dfba440ac
refs/heads/master
2020-02-26T13:59:58.999600
2015-07-13T14:51:00
2015-07-13T14:51:00
38,843,571
0
0
null
2015-07-09T20:29:31
2015-07-09T20:29:30
null
UTF-8
Java
false
false
12,893
java
/* * JBoss, Home of Professional Open Source * Copyright 2014, Red Hat, Inc. and/or its affiliates, and individual * contributors by the @authors tag. See the copyright.txt in the * distribution for a full listing of individual contributors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * http://www.apache.org/licenses/LICENSE-2.0 * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.arquillian.recorder.reporter.impl; import org.arquillian.recorder.reporter.ReportFrequency; import org.arquillian.recorder.reporter.ReportMessage; import org.arquillian.recorder.reporter.Reporter; import org.arquillian.recorder.reporter.ReporterConfiguration; import org.arquillian.recorder.reporter.ReporterCursor; import org.arquillian.recorder.reporter.event.ExportReport; import org.arquillian.recorder.reporter.event.InTestResourceReport; import org.arquillian.recorder.reporter.event.PropertyReportEvent; import org.arquillian.recorder.reporter.model.ContainerReport; import org.arquillian.recorder.reporter.model.DeploymentReport; import org.arquillian.recorder.reporter.model.ExtensionReport; import org.arquillian.recorder.reporter.model.TestClassReport; import org.arquillian.recorder.reporter.model.TestMethodReport; import org.arquillian.recorder.reporter.model.TestSuiteReport; import org.jboss.arquillian.config.descriptor.api.ArquillianDescriptor; import org.jboss.arquillian.config.descriptor.api.ExtensionDef; import org.jboss.arquillian.container.spi.Container; import org.jboss.arquillian.container.spi.client.deployment.DeploymentDescription; import org.jboss.arquillian.container.spi.event.container.BeforeDeploy; import org.jboss.arquillian.container.test.api.OperateOnDeployment; import org.jboss.arquillian.container.test.api.RunAsClient; import org.jboss.arquillian.core.api.Event; import org.jboss.arquillian.core.api.Instance; import org.jboss.arquillian.core.api.annotation.Inject; import org.jboss.arquillian.core.api.annotation.Observes; import org.jboss.arquillian.test.spi.TestResult; import org.jboss.arquillian.test.spi.TestResult.Status; import org.jboss.arquillian.test.spi.event.suite.After; import org.jboss.arquillian.test.spi.event.suite.AfterClass; import org.jboss.arquillian.test.spi.event.suite.AfterSuite; import org.jboss.arquillian.test.spi.event.suite.AfterTestLifecycleEvent; import org.jboss.arquillian.test.spi.event.suite.BeforeClass; import org.jboss.arquillian.test.spi.event.suite.BeforeSuite; import org.jboss.arquillian.test.spi.event.suite.BeforeTestLifecycleEvent; import java.lang.annotation.Annotation; import java.lang.reflect.Method; import java.sql.Date; import java.util.ArrayList; import java.util.Collection; import java.util.HashMap; import java.util.List; import java.util.Map; /** * Observes events from Arquillian and delegates them to {@link Reporter} implementation.<br> * <br> * Fires: * <ul> * <li>{@link ExportReport} on observing {@link AfterSuite}</li> * </ul> * * @author <a href="smikloso@redhat.com">Stefan Miklosovic</a> * */ public class ReporterLifecycleObserver { private static final Map<Method, Integer> lifecycleCountRegister = new HashMap<Method, Integer>(); @Inject private Instance<Reporter> reporter; @Inject private Instance<ReporterConfiguration> configuration; @Inject private Instance<ArquillianDescriptor> descriptor; @Inject private Event<ExportReport> exportReportEvent; @Inject private Event<InTestResourceReport> inTestResourceReportEvent; public void observeBeforeSuite(@Observes(precedence = Integer.MAX_VALUE) BeforeSuite event) { TestSuiteReport testSuiteReport = new TestSuiteReport(); reporter.get().getReport().getTestSuiteReports().add(testSuiteReport); reporter.get().setTestSuiteReport(testSuiteReport); } public void observeBeforeStart(@Observes Container event) { ContainerReport containerReport = new ContainerReport(); containerReport.setQualifier(event.getName()); containerReport.setConfiguration(event.getContainerConfiguration().getContainerProperties()); reporter.get().getLastTestSuiteReport().getContainerReports().add(containerReport); reporter.get().setContainerReport(containerReport); } public void observeBeforeDeploy(@Observes BeforeDeploy event) { DeploymentReport deploymentReport = new DeploymentReport(); DeploymentDescription description = event.getDeployment(); deploymentReport.setArchiveName(description.getArchive().getName()); deploymentReport.setName(description.getName()); int order = description.getOrder(); if (order > 0) { deploymentReport.setOrder(order); } String protocol = description.getProtocol().getName(); if (!protocol.equals("_DEFAULT_")) { deploymentReport.setProtocol(protocol); } else { deploymentReport.setProtocol("_DEFAULT_"); } deploymentReport.setTarget(description.getTarget().getName()); boolean reported = false; for (ContainerReport containerReport : reporter.get().getLastTestSuiteReport().getContainerReports()) { if (containerReport.getQualifier().equals(deploymentReport.getTarget())) { containerReport.getDeploymentReports().add(deploymentReport); reported = true; break; } } if (!reported) { if (reporter.get().getLastTestSuiteReport().getContainerReports().size() == 1) { reporter.get().getLastTestSuiteReport().getContainerReports().get(0).getDeploymentReports().add(deploymentReport); } } } public void observeBeforeClass(@Observes(precedence = Integer.MAX_VALUE) BeforeClass event) { TestClassReport testClassReport = new TestClassReport(); testClassReport.setTestClassName(event.getTestClass().getName()); testClassReport.setRunAsClient(event.getTestClass().isAnnotationPresent(RunAsClient.class)); testClassReport.setReportMessage(ReportMessageParser.parseTestClassReportMessage(event.getTestClass().getJavaClass())); reporter.get().getLastTestSuiteReport().getTestClassReports().add(testClassReport); reporter.get().setTestClassReport(testClassReport); } public void observeBeforeTest(@Observes(precedence = Integer.MAX_VALUE) BeforeTestLifecycleEvent event) { Integer c = lifecycleCountRegister.get(event.getTestMethod()); int count = (c != null ? c.intValue() : 0); if (count == 0) { TestMethodReport testMethodReport = new TestMethodReport(); testMethodReport.setName(event.getTestMethod().getName()); if (event.getTestMethod().isAnnotationPresent(OperateOnDeployment.class)) { OperateOnDeployment ood = event.getTestMethod().getAnnotation(OperateOnDeployment.class); testMethodReport.setOperateOnDeployment(ood.value()); } else { testMethodReport.setOperateOnDeployment("_DEFAULT_"); } testMethodReport.setRunAsClient(event.getTestMethod().isAnnotationPresent(RunAsClient.class)); reporter.get().getLastTestClassReport().getTestMethodReports().add(testMethodReport); reporter.get().setTestMethodReport(testMethodReport); } lifecycleCountRegister.put(event.getTestMethod(), ++count); } public void observeAfterTest(@Observes(precedence = Integer.MIN_VALUE) AfterTestLifecycleEvent event, TestResult result) { System.out.println("Test: " + event.getTestMethod().getName() + "," + result.toString()); int count = lifecycleCountRegister.get(event.getTestMethod()); lifecycleCountRegister.put(event.getTestMethod(), --count); if (lifecycleCountRegister.get(event.getTestMethod()) == 0) { TestMethodReport testMethodReport = reporter.get().getLastTestMethodReport(); testMethodReport.setStatus(result.getStatus()); testMethodReport.setDuration(result.getEnd() - result.getStart()); testMethodReport.setReportMessage(ReportMessageParser.parseTestReportMessage(event.getTestMethod())); if (result.getStatus() == Status.FAILED && result.getThrowable() != null) { testMethodReport.setException(getStackTrace(result.getThrowable())); } inTestResourceReportEvent.fire(new InTestResourceReport()); reporter.get().setReporterCursor(new ReporterCursor(reporter.get().getLastTestClassReport())); report(event, descriptor.get()); lifecycleCountRegister.remove(event.getTestMethod()); } } public void observeAfterClass(@Observes(precedence = Integer.MIN_VALUE) AfterClass event) { reporter.get().setReporterCursor(new ReporterCursor(reporter.get().getLastTestSuiteReport())); report(event, descriptor.get()); } public void observeAfterSuite(@Observes(precedence = Integer.MIN_VALUE) AfterSuite event) { reporter.get().getLastTestClassReport().setStop(new Date(System.currentTimeMillis())); reporter.get().getLastTestSuiteReport().setStop(new Date(System.currentTimeMillis())); exportReportEvent.fire(new ExportReport(reporter.get().getReport())); } public void observeReportEvent(@Observes PropertyReportEvent event) { reporter.get().getReporterCursor().getCursor().getPropertyEntries().add(event.getPropertyEntry()); } private void report(org.jboss.arquillian.core.spi.event.Event event, ArquillianDescriptor descriptor) { if (shouldReport(event, configuration.get().getReportAfterEvery())) { List<ExtensionReport> extensionReports = reporter.get().getReport().getExtensionReports(); if (extensionReports.isEmpty()) { extensionReports.addAll(getExtensionReports(descriptor)); } reporter.get().getLastTestClassReport().setStop(new Date(System.currentTimeMillis())); reporter.get().getLastTestSuiteReport().setStop(new Date(System.currentTimeMillis())); exportReportEvent.fire(new ExportReport(reporter.get().getReport())); } } private boolean shouldReport(org.jboss.arquillian.core.spi.event.Event event, String frequency) { if (event instanceof AfterClass && ReportFrequency.CLASS.toString().equals(frequency)) { return true; } else if (event instanceof After && ReportFrequency.METHOD.toString().equals(frequency)) { return true; } return false; } private Collection<? extends ExtensionReport> getExtensionReports(ArquillianDescriptor descriptor) { List<ExtensionReport> extensionReports = new ArrayList<ExtensionReport>(); for (ExtensionDef extensionDef : descriptor.getExtensions()) { ExtensionReport extensionReport = new ExtensionReport(); extensionReport.setQualifier(extensionDef.getExtensionName()); extensionReport.setConfiguration(extensionDef.getExtensionProperties()); extensionReports.add(extensionReport); } return extensionReports; } private String getStackTrace(Throwable aThrowable) { StringBuilder sb = new StringBuilder(); String newLine = System.getProperty("line.separator"); sb.append(aThrowable.toString()); sb.append(newLine); for (StackTraceElement element : aThrowable.getStackTrace()) { sb.append(element); sb.append(newLine); } return sb.toString(); } private static final class ReportMessageParser { public static String parseTestReportMessage(Method testMethod) { return getReportMessage(testMethod.getAnnotations()); } public static String parseTestClassReportMessage(Class<?> testClass) { return getReportMessage(testClass.getAnnotations()); } private static String getReportMessage(Annotation[] annotations) { if (annotations != null) { for (Annotation annotation : annotations) { if (annotation.annotationType().isAssignableFrom(ReportMessage.class)) { return ((ReportMessage) annotation).value(); } } } return null; } } }
[ "matthew.frederick@cru.org" ]
matthew.frederick@cru.org
2555796136c5ad995574c4318f3ee1ff6998c64b
d8a24c4ee1406b4eef85c33ec852e133c51809c2
/mifuns-facade-system/src/main/java/com/mifuns/system/facade/entity/Role.java
05dca3bd2887c7a8d78299c2c5b1731df1b9864d
[]
no_license
cancheung/mifuns-project
71626b8be76552bfca47c511872116e82f89c4eb
d27e64f8b00d6102b0c9dfa6873fd75bad893de8
refs/heads/master
2021-01-18T17:53:58.147052
2017-03-13T03:17:52
2017-03-13T03:17:52
86,821,972
1
0
null
2017-03-31T13:27:12
2017-03-31T13:27:12
null
UTF-8
Java
false
false
3,994
java
package com.mifuns.system.facade.entity; import com.mifuns.common.page.PageBean; import java.util.Date; public class Role extends PageBean { /** * * sys_role.role_id * * @mbggenerated */ private Long roleId; /** * 角色 * sys_role.role_name * * @mbggenerated */ private String roleName; /** * 角色描述 * sys_role.description * * @mbggenerated */ private String description; /** * 1 有效 * sys_role.status * * @mbggenerated */ private Integer status; /** * 插入时间 * sys_role.insert_date * * @mbggenerated */ private Date insertDate; /** * 更新时间 * sys_role.update_date * * @mbggenerated */ private Date updateDate; public Role() { } public Role(Long roleId, Integer status, Date updateDate) { this.roleId = roleId; this.status = status; this.updateDate = updateDate; } /** * * sys_role.role_id * * @return sys_role.role_id * * @mbggenerated */ public Long getRoleId() { return roleId; } /** * * sys_role.role_id * * @param roleId sys_role.role_id * * @mbggenerated */ public void setRoleId(Long roleId) { this.roleId = roleId; } /** * 角色 * sys_role.role_name * * @return sys_role.role_name * * @mbggenerated */ public String getRoleName() { return roleName; } /** * 角色 * sys_role.role_name * * @param roleName sys_role.role_name * * @mbggenerated */ public void setRoleName(String roleName) { this.roleName = roleName == null ? null : roleName.trim(); } /** * 角色描述 * sys_role.description * * @return sys_role.description * * @mbggenerated */ public String getDescription() { return description; } /** * 角色描述 * sys_role.description * * @param description sys_role.description * * @mbggenerated */ public void setDescription(String description) { this.description = description == null ? null : description.trim(); } /** * 1 有效 * sys_role.status * * @return sys_role.status * * @mbggenerated */ public Integer getStatus() { return status; } /** * 1 有效 * sys_role.status * * @param status sys_role.status * * @mbggenerated */ public void setStatus(Integer status) { this.status = status; } /** * 插入时间 * sys_role.insert_date * * @return sys_role.insert_date * * @mbggenerated */ public Date getInsertDate() { return insertDate; } /** * 插入时间 * sys_role.insert_date * * @param insertDate sys_role.insert_date * * @mbggenerated */ public void setInsertDate(Date insertDate) { this.insertDate = insertDate; } /** * 更新时间 * sys_role.update_date * * @return sys_role.update_date * * @mbggenerated */ public Date getUpdateDate() { return updateDate; } /** * 更新时间 * sys_role.update_date * * @param updateDate sys_role.update_date * * @mbggenerated */ public void setUpdateDate(Date updateDate) { this.updateDate = updateDate; } @Override public String toString() { return "Role{" + "roleId=" + roleId + ", roleName='" + roleName + '\'' + ", description='" + description + '\'' + ", status=" + status + ", insertDate=" + insertDate + ", updateDate=" + updateDate + '}'; } }
[ "miguangying@01zhuanche.com" ]
miguangying@01zhuanche.com
2eb4b67737ad60f5bf67734c6be4882eb76d3801
dc1dbb7e5a4b95bf44170d2f51fd08b3814f2ac9
/data_defect4j/preprossed_method_corpus/Math/106/org/apache/commons/math/analysis/UnivariateRealIntegrator_setMaximalIterationCount_40.java
ba8399c48c8d00135ce328384028244d2017ef99
[]
no_license
hvdthong/NetML
dca6cf4d34c5799b400d718e0a6cd2e0b167297d
9bb103da21327912e5a29cbf9be9ff4d058731a5
refs/heads/master
2021-06-30T15:03:52.618255
2020-10-07T01:58:48
2020-10-07T01:58:48
150,383,588
1
1
null
2018-09-26T07:08:45
2018-09-26T07:08:44
null
UTF-8
Java
false
false
512
java
org apach common math analysi interfac univari real integr algorithm version revis date univari real integr univariaterealintegr set upper limit number iter high iter count converg problem reason vari wide case user advis code converg except convergenceexcept code thrown number exceed param count maximum number iter set maxim iter count setmaximaliterationcount count
[ "hvdthong@gmail.com" ]
hvdthong@gmail.com
5a304ba707dea4761bca6553de95e760e4b7cc58
c6de84d4fa400856bc1420cc1269024b97eb4fa0
/dynamic_programming/LongestCommonSubsequence.java
b6a123e4677307ad0422674e27189112d5ee02c5
[]
no_license
princewillzz/algorithms_and_data_structures
1ce662546f550c696485398d3a7058ed83b91925
abb3d6daef91bbb208885fa831d3eb768a8b8aa8
refs/heads/master
2021-10-08T04:15:01.676592
2021-10-03T11:27:46
2021-10-03T11:27:46
253,177,833
1
0
null
null
null
null
UTF-8
Java
false
false
2,391
java
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; public class LongestCommonSubsequence { public static void main(String argv[]) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); String str = br.readLine().trim(); String str2 = br.readLine().trim(); System.out.println( solve(str, str.length(), str2, str2.length(), new Integer[str.length() + 1][str2.length() + 1])); System.out.println(bottomUp(str, str2)); } static String string = new String(); static int bottomUp(String s1, String s2) { int memo[][] = new int[s1.length() + 1][s2.length() + 1]; for (int i = 0; i < memo.length; i++) { for (int j = 0; j < memo[i].length; j++) { if (i == 0 || j == 0) { memo[i][j] = 0; } else { if (s1.charAt(i - 1) == s2.charAt(j - 1)) { memo[i][j] = memo[i - 1][j - 1] + 1; } else { memo[i][j] = Math.max(memo[i - 1][j], memo[i][j - 1]); } } } } String s = ""; StringBuilder st = new StringBuilder(); int row = s1.length(), col = s2.length(); while (row > 0 && col > 0) { if (s1.charAt(row - 1) == s2.charAt(col - 1)) { s = s1.charAt(row - 1) + s; st.append(s1.charAt(row - 1)); row--; col--; } else { if (memo[row - 1][col] > memo[row][col - 1]) { row--; } else col--; } } System.out.println(s); System.out.println(st.reverse()); return memo[s1.length()][s2.length()]; } static int solve(String s1, int n1, String s2, int n2, Integer memo[][]) { if (n1 == 0 || n2 == 0) return 0; if (memo[n1][n2] != null) return memo[n1][n2]; if (s1.charAt(n1 - 1) == s2.charAt(n2 - 1)) { memo[n1][n2] = solve(s1, n1 - 1, s2, n2 - 1, memo) + 1; } else { memo[n1][n2] = Math.max(solve(s1, n1 - 1, s2, n2, memo), solve(s1, n1, s2, n2 - 1, memo)); } return memo[n1][n2]; } }
[ "princewillz2013@gmail.com" ]
princewillz2013@gmail.com
a9c2d26dc86e9fb6723b44056e2d60324cfc7bcc
f85f9ca71ccb631bba986635ba31439146c86faf
/P3_Patrones_Java/src/main/java/ec/edu/ups/Expression.java
bdc50bf2f9e314d73b02fa3c9c6701c3e99a6beb
[]
no_license
Jhon14DEA/P1_ProgramacionGenerica
93f63a6857a74cb8b13100fb364c1e1f11bf4f6e
4aa5feec43ddf2a2ff431edd2963e7a68be7e325
refs/heads/master
2023-01-24T16:07:48.326216
2020-12-04T00:21:41
2020-12-04T00:21:41
312,735,996
0
0
null
null
null
null
UTF-8
Java
false
false
1,199
java
/* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ package ec.edu.ups; /** * * @author ASUS */ public abstract class Expression { public abstract String one(); public abstract String four(); public abstract String five(); public abstract String nine(); public abstract int multiplier(); public void interpreter(Context context){ if (context.entrada.startsWith(nine())) { context.salida += 9*multiplier(); context.entrada = context.entrada.substring(2); } else if (context.entrada.startsWith(four())){ context.salida += (4*multiplier()); context.entrada = context.entrada.substring(2); }else if( context.entrada.startsWith(five())){ context.salida += 5* multiplier(); context.entrada = context.entrada.substring(1); }while (context.entrada.startsWith(one())){ context.salida += 1*multiplier(); context.entrada = context.entrada.substring(1); } } }
[ "64903359+Jhon14DEA@users.noreply.github.com" ]
64903359+Jhon14DEA@users.noreply.github.com
1207cf96b4725dfc84f584d68d5123df86be89ae
c6341ffd87bb65eba6ad0bd60e17b959a0cd7469
/src/test/java/com/chocol/arithmetic/aug2021/Day8Test.java
3ccbf14aa9ad66fa69f5ec946b69bd9c5040e634
[]
no_license
MrChocol/arithmetic-upgrade
34cdaa85ee28141e2c31a26d527f9034175a12fa
dac9170adda3117923d081e321c7590d8f651ce4
refs/heads/master
2023-08-01T05:38:20.566556
2021-09-27T14:46:20
2021-09-27T14:46:20
374,708,795
0
0
null
null
null
null
UTF-8
Java
false
false
1,806
java
package com.chocol.arithmetic.aug2021; import org.junit.Test; import org.springframework.boot.test.context.SpringBootTest; /** * Description: * * @author 陈力 * @date 2021/6/8 * @since */ @SpringBootTest public class Day8Test { @Test public void test01() { int[] nums = {1, 3, 5, 7, 9}; int result = numberOfArithmeticSlices(nums); assert result == 6; } /** * 如果一个数列 至少有三个元素 ,并且任意两个相邻元素之差相同,则称该数列为等差数列。 * * 例如,[1,3,5,7,9]、[7,7,7,7] 和 [3,-1,-5,-9] 都是等差数列。 给你一个整数数组 nums ,返回数组 nums 中所有为等差数组的 子数组 个数。 * * 子数组 是数组中的一个连续序列。 * * * 定义状态:dp[i]表示从nums[0]到nums[i]且以nums[i]为结尾的等差数列子数组的数量。 * * 状态转移方程:dp[i] = dp[i-1]+1 if nums[i]-nums[i-1]==nums[i-1]-nums[i-2] else 0 * * 解释:如果nums[i]能和nums[i-1]nums[i-2]组成等差数列,则以nums[i-1]结尾的等差数列均可以nums[i]结尾,且多了一个新等差数列[nums[i],nums[i-1],nums[i-2]] * * @param nums * @return */ public int numberOfArithmeticSlices(int[] nums) { if (nums == null || nums.length < 3) { return 0; } int[] memo = new int[nums.length]; if (nums[0] - nums[1] == nums[1] - nums[2]) { memo[2] = 1; } int res = memo[2]; for (int i = 3; i < nums.length; i++) { if (nums[i - 2] - nums[i - 1] == nums[i - 1] - nums[i]) { memo[i] = memo[i - 1] + 1; } res += memo[i]; } return res; } }
[ "314159715@qq.com" ]
314159715@qq.com
63512ef2e8919ed7ecc3daa78e93148fe69c93f9
2c4cc13e6089758b6088d1aad563ae98fbc11a59
/engine-config/src/main/java/com/datacloudsec/config/tools/DateUtil.java
9c6828c9f909c0710c12448bd632485a8ff0ca98
[ "MIT" ]
permissive
gumizy/flume-collector
df84cbad25255d5ffa78d3c7c9f567af8cd82c57
d392ece035623365e2ec6c770f5cb621a0dd9ca5
refs/heads/master
2020-04-29T02:29:00.460976
2019-04-01T08:28:17
2019-04-01T08:28:17
175,769,409
6
0
null
null
null
null
UTF-8
Java
false
false
2,021
java
package com.datacloudsec.config.tools; import java.text.DateFormat; import java.text.SimpleDateFormat; import java.util.Calendar; import java.util.Date; import java.util.Locale; public class DateUtil { private static final Locale[] locales = {Locale.CHINA, Locale.ENGLISH}; /** * 格式化日期 * * @param df SimpleDateFormat * @param dateStr dateStr * @return Date */ public static Date format(SimpleDateFormat df, String dateStr) { Calendar c = Calendar.getInstance(); String pattern = df.toPattern(); StringBuilder dateBuilder = new StringBuilder(dateStr); StringBuilder formatBuilder = new StringBuilder(pattern); if (!pattern.contains("yy")) { formatBuilder.append(" yyyy"); dateBuilder.append(" ").append(c.get(Calendar.YEAR)); } if (!pattern.contains("M")) { formatBuilder.append(" MM"); dateBuilder.append(" ").append(c.get(Calendar.MONTH) + 1); } if (!pattern.contains("d")) { formatBuilder.append(" dd"); dateBuilder.append(" ").append(c.get(Calendar.DAY_OF_MONTH)); } //当使用hKk格式时,避免多追加HH if (!pattern.contains("H") && !pattern.contains("h") && !pattern.contains("K") && !pattern.contains("k")) { formatBuilder.append(" HH"); dateBuilder.append(" ").append(c.get(Calendar.HOUR_OF_DAY)); } if (!pattern.contains("m")) { formatBuilder.append(" mm"); dateBuilder.append(" ").append(c.get(Calendar.MINUTE)); } Date d = null; for (Locale locale : locales) { try { DateFormat sdf = new SimpleDateFormat(formatBuilder.toString(), locale); sdf.setTimeZone(df.getTimeZone()); d = sdf.parse(dateBuilder.toString()); break; } catch (Exception e) { } } return d; } }
[ "guozhenyu@datacloudsec.com" ]
guozhenyu@datacloudsec.com
e54aa3fa7eb7a548ad6272156c82654d932d1ab7
eb5f5353f49ee558e497e5caded1f60f32f536b5
/org/omg/CORBA/UShortSeqHelper.java
2a423d8b9904c6dc3b96d0cc2f9350e8216ad7e7
[]
no_license
mohitrajvardhan17/java1.8.0_151
6fc53e15354d88b53bd248c260c954807d612118
6eeab0c0fd20be34db653f4778f8828068c50c92
refs/heads/master
2020-03-18T09:44:14.769133
2018-05-23T14:28:24
2018-05-23T14:28:24
134,578,186
0
2
null
null
null
null
UTF-8
Java
false
false
1,783
java
package org.omg.CORBA; import org.omg.CORBA.portable.InputStream; import org.omg.CORBA.portable.OutputStream; public abstract class UShortSeqHelper { private static String _id = "IDL:omg.org/CORBA/UShortSeq:1.0"; private static TypeCode __typeCode = null; public UShortSeqHelper() {} public static void insert(Any paramAny, short[] paramArrayOfShort) { OutputStream localOutputStream = paramAny.create_output_stream(); paramAny.type(type()); write(localOutputStream, paramArrayOfShort); paramAny.read_value(localOutputStream.create_input_stream(), type()); } public static short[] extract(Any paramAny) { return read(paramAny.create_input_stream()); } public static synchronized TypeCode type() { if (__typeCode == null) { __typeCode = ORB.init().get_primitive_tc(TCKind.tk_ushort); __typeCode = ORB.init().create_sequence_tc(0, __typeCode); __typeCode = ORB.init().create_alias_tc(id(), "UShortSeq", __typeCode); } return __typeCode; } public static String id() { return _id; } public static short[] read(InputStream paramInputStream) { short[] arrayOfShort = null; int i = paramInputStream.read_long(); arrayOfShort = new short[i]; paramInputStream.read_ushort_array(arrayOfShort, 0, i); return arrayOfShort; } public static void write(OutputStream paramOutputStream, short[] paramArrayOfShort) { paramOutputStream.write_long(paramArrayOfShort.length); paramOutputStream.write_ushort_array(paramArrayOfShort, 0, paramArrayOfShort.length); } } /* Location: C:\Program Files (x86)\Java\jre1.8.0_151\lib\rt.jar!\org\omg\CORBA\UShortSeqHelper.class * Java compiler version: 8 (52.0) * JD-Core Version: 0.7.1 */
[ "mohit.rajvardhan@ericsson.com" ]
mohit.rajvardhan@ericsson.com
619a1aa89abe22bc6ffefbaf96f5852f3a467b41
ab673fd010e3970a3cd26024244a5eb4bf43cb93
/app/src/main/java/com/xuexiang/xuidemo/fragment/expands/MaterialDesignFragment.java
7a820c43034632091e2337d78bb2c9b9b6ac9df5
[ "Apache-2.0" ]
permissive
dandycheung/XUI
9cbd03a7f28c2cdd3a05fbcfafc8e57688f5d102
111e6008ccd97978d892c6807be1a50f544908ee
refs/heads/master
2023-07-11T08:00:08.614364
2023-06-25T17:40:30
2023-06-25T17:40:30
239,179,628
0
0
Apache-2.0
2023-06-29T18:19:32
2020-02-08T18:08:35
Java
UTF-8
Java
false
false
3,842
java
package com.xuexiang.xuidemo.fragment.expands; import com.xuexiang.xpage.annotation.Page; import com.xuexiang.xpage.core.PageOption; import com.xuexiang.xuidemo.R; import com.xuexiang.xuidemo.activity.MaterialDesignThemeActivity; import com.xuexiang.xuidemo.activity.SettingsActivity; import com.xuexiang.xuidemo.base.BaseSimpleListFragment; import com.xuexiang.xuidemo.fragment.expands.materialdesign.BadgeDrawableFragment; import com.xuexiang.xuidemo.fragment.expands.materialdesign.BehaviorFragment; import com.xuexiang.xuidemo.fragment.expands.materialdesign.BottomSheetDialogFragment; import com.xuexiang.xuidemo.fragment.expands.materialdesign.ConstraintLayoutFragment; import com.xuexiang.xuidemo.fragment.expands.materialdesign.DrawerLayoutFragment; import com.xuexiang.xuidemo.fragment.expands.materialdesign.ItemTouchHelperFragment; import com.xuexiang.xuidemo.fragment.expands.materialdesign.MaterialButtonFragment; import com.xuexiang.xuidemo.fragment.expands.materialdesign.ShapeableImageViewFragment; import com.xuexiang.xuidemo.fragment.expands.materialdesign.TextInputLayoutFragment; import com.xuexiang.xuidemo.fragment.expands.materialdesign.ToolBarFragment; import com.xuexiang.xutil.app.ActivityUtils; import java.util.List; import static com.xuexiang.xuidemo.base.BaseActivity.KEY_SUPPORT_SLIDE_BACK; /** * @author xuexiang * @since 2019-05-07 23:30 */ @Page(name = "Material Design", extra = R.drawable.ic_expand_material_design) public class MaterialDesignFragment extends BaseSimpleListFragment { /** * 初始化例子 * * @param lists * @return */ @Override protected List<String> initSimpleData(List<String> lists) { lists.add("ToolBar使用"); lists.add("Behavior\n手势行为"); lists.add("DrawerLayout + NavigationView\n常见主页布局"); lists.add("ConstraintLayout\n约束布局"); lists.add("ItemTouchHelper+RecyclerView\n实现列表拖拽"); lists.add("AppCompatPreferenceActivity\n设置页面"); lists.add("BottomSheetDialog"); lists.add("BadgeDrawable"); lists.add("ShapeableImageView"); lists.add("MaterialButton"); lists.add("TextInputLayout"); return lists; } /** * 条目点击 * * @param position */ @Override protected void onItemClick(int position) { switch (position) { case 0: openPage(ToolBarFragment.class); break; case 1: openPage(BehaviorFragment.class); break; case 2: openNewPage(DrawerLayoutFragment.class, KEY_SUPPORT_SLIDE_BACK, false); break; case 3: openPage(ConstraintLayoutFragment.class); break; case 4: openPage(ItemTouchHelperFragment.class); break; case 5: ActivityUtils.startActivity(SettingsActivity.class); break; case 6: openPage(BottomSheetDialogFragment.class); break; case 7: PageOption.to(BadgeDrawableFragment.class) .setNewActivity(true, MaterialDesignThemeActivity.class) .open(this); break; case 8: openPage(ShapeableImageViewFragment.class); break; case 9: PageOption.to(MaterialButtonFragment.class) .setNewActivity(true, MaterialDesignThemeActivity.class) .open(this); break; case 10: openPage(TextInputLayoutFragment.class); break; default: break; } } }
[ "xuexiangjys@163.com" ]
xuexiangjys@163.com
72469fbde5698ca574537e1de26d4f5580d17340
bac5385d871c037f992e6c9466c6f371d1ab3be7
/test/java/com/donald/tests/PaymentDAOTests.java
8f17c7e7f062d1434ebd585cf6efa03c548f8903
[]
no_license
devwithdonald/Car_Dealership_Project
0327646bbe80444457c836f2dcb26e5a3f376366
cae2d39be6e64794a2c33864a6b89252ba0c7202
refs/heads/master
2022-09-24T14:05:08.782805
2019-06-18T19:13:56
2019-06-18T19:13:56
190,090,404
1
0
null
2022-09-08T01:00:56
2019-06-03T22:22:30
Java
UTF-8
Java
false
false
989
java
package com.donald.tests; import static org.junit.Assert.assertEquals; import java.util.List; import org.junit.After; import org.junit.AfterClass; import org.junit.Before; import org.junit.BeforeClass; import org.junit.Test; import com.donald.sqldao.PaymentPostgresDAOImpl; import com.donald.users.Payment; public class PaymentDAOTests { private static PaymentPostgresDAOImpl paymentDAO; @BeforeClass public static void setUpBeforeClass() throws Exception { paymentDAO = new PaymentPostgresDAOImpl(); } @AfterClass public static void tearDownAfterClass() throws Exception { } @Before public void setUp() throws Exception { } @After public void tearDown() throws Exception { } @Test public void testGetAllPayments() { List<Payment> result = paymentDAO.getAllPayments(); assertEquals(3, result.size()); } @Test public void testGetPaymentsByCustomerId() { List<Payment> result = paymentDAO.getAllPayments(); assertEquals(3, result.size()); } }
[ "hend.donald@gmail.com" ]
hend.donald@gmail.com
04c3ac77551ad3a54a85c88531ff0303ed4a17dd
e27942cce249f7d62b7dc8c9b86cd40391c1ddd4
/modules/adwords_appengine/src/main/java/com/google/api/ads/adwords/jaxws/v201702/mcm/AccountLabelServiceInterfacemutate.java
871d10b63295e44b7ea07805d0ddd508212eebe3
[ "Apache-2.0" ]
permissive
mo4ss/googleads-java-lib
b4b6178747d25d16ae6aa0c80d80ee18a2dfe01a
efaa9c3bd8a46a3ed4b00963dc9760c6dd8bd641
refs/heads/master
2022-12-05T00:30:56.740813
2022-11-16T10:47:15
2022-11-16T10:47:15
108,132,394
0
0
Apache-2.0
2022-11-16T10:47:16
2017-10-24T13:41:43
Java
UTF-8
Java
false
false
3,453
java
// Copyright 2017 Google Inc. All Rights Reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. package com.google.api.ads.adwords.jaxws.v201702.mcm; import java.util.ArrayList; import java.util.List; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlRootElement; import javax.xml.bind.annotation.XmlType; /** * * Possible actions: * <ul> * <li> Create a new label - create a new {@link Label} and call mutate with ADD operator * <li> Edit the label name - set the appropriate fields in your {@linkplain Label} and call * mutate with the SET operator. Null fields will be interpreted to mean "no change" * <li> Delete the label - call mutate with REMOVE operator * </ul> * * @param operations list of unique operations to be executed in a single transaction, in the * order specified. * @return the mutated labels, in the same order that they were in as the parameter * @throws ApiException if problems occurs while modifying label information * * * <p>Java class for mutate element declaration. * * <p>The following schema fragment specifies the expected content contained within this class. * * <pre> * &lt;element name="mutate"> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="operations" type="{https://adwords.google.com/api/adwords/mcm/v201702}AccountLabelOperation" maxOccurs="unbounded" minOccurs="0"/> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * &lt;/element> * </pre> * * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "", propOrder = { "operations" }) @XmlRootElement(name = "mutate") public class AccountLabelServiceInterfacemutate { protected List<AccountLabelOperation> operations; /** * Gets the value of the operations property. * * <p> * This accessor method returns a reference to the live list, * not a snapshot. Therefore any modification you make to the * returned list will be present inside the JAXB object. * This is why there is not a <CODE>set</CODE> method for the operations property. * * <p> * For example, to add a new item, do as follows: * <pre> * getOperations().add(newItem); * </pre> * * * <p> * Objects of the following type(s) are allowed in the list * {@link AccountLabelOperation } * * */ public List<AccountLabelOperation> getOperations() { if (operations == null) { operations = new ArrayList<AccountLabelOperation>(); } return this.operations; } }
[ "jradcliff@users.noreply.github.com" ]
jradcliff@users.noreply.github.com
42d9a2b060bacafffe587c6cc85627208c24673b
8a562f84ab27d847d89841851d3f904f2e684f35
/app/src/main/java/com/example/androidui/viewholder/ViewHolder.java
70764ded6b5eb8c1ac3c3e6ed5526a50d09aeca7
[]
no_license
OMP1024/AndroidUI
1f98c64a9f23dda0453dcd27bdea65d6592fde9c
60b3406407cc456a3fa81f1326323c40e6d84dda
refs/heads/master
2020-09-26T00:07:18.678383
2020-02-17T12:11:56
2020-02-17T12:11:56
226,118,638
0
0
null
null
null
null
UTF-8
Java
false
false
4,748
java
package com.example.androidui.viewholder; import android.app.Activity; import android.content.Intent; import android.content.pm.PackageManager; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.TextView; import androidx.annotation.NonNull; import androidx.recyclerview.widget.RecyclerView; import com.example.androidui.R; import com.example.androidui.activity.AnimationActivity; import com.example.androidui.activity.BroadcastActivity; import com.example.androidui.activity.DrawLayoutActivity; import com.example.androidui.activity.FileActivity; import com.example.androidui.activity.FragmentActivity; import com.example.androidui.activity.IncludeMergeViewStubActivity; import com.example.androidui.activity.KitkatActivity; import com.example.androidui.activity.LifeCycleActivity; import com.example.androidui.activity.TextViewActivity; import com.example.androidui.activity.ViewPagerActivity; import com.example.androidui.activity.WebViewActivity; import com.example.androidui.info.ItemInfo; import butterknife.BindView; import butterknife.ButterKnife; import butterknife.OnClick; public class ViewHolder extends RecyclerView.ViewHolder { private Activity mActivity; @BindView(R.id.title_tv) TextView titleTv; private ItemInfo mItemInfo; public static ViewHolder createViewHolder(Activity activity, ViewGroup parent) { return new ViewHolder(activity, LayoutInflater.from(activity).inflate(R.layout.item_view_holder, parent, false)); } private ViewHolder(Activity activity, @NonNull View itemView) { super(itemView); mActivity = activity; ButterKnife.bind(this, itemView); } public void bindData(ItemInfo info) { mItemInfo = info; titleTv.setText(info.getTitle()); } @OnClick(R.id.title_tv) public void onViewClicked() { switch (mItemInfo.getType()) { case VIEW: break; case WEBVIEW: break; case ACTIVITY: break; case FRAGMENT: FragmentActivity.launchFragmentActivity(mActivity); break; case VIEWPAGE: mActivity.startActivity(new Intent(mActivity, ViewPagerActivity.class)); break; case TABLAYOUT: break; case TEXT_VIEW: TextViewActivity.launchActivity(mActivity); break; case VIDEOVIEW: break; case BOTTOMSHEET: break; case PROGRESS_BAR: break; case RECYCLERVIEW: break; case DIALOGFRAGMENT: break; case LifeCycle: LifeCycleActivity.launchLifeCycleActivity(mActivity); break; case ViewAnimation: mActivity.startActivity(new Intent(mActivity, AnimationActivity.class)); break; case KitKat: mActivity.startActivity(new Intent(mActivity, KitkatActivity.class)); break; case WebView: mActivity.startActivity(new Intent(mActivity, WebViewActivity.class)); break; case Intent_FIlter: Intent intent = new Intent(); intent.setAction("my_action"); intent.addCategory("my_category"); mActivity.startActivity(intent); break; case PackageName: { PackageManager packageManager = mActivity.getPackageManager(); Intent intent1 = packageManager.getLaunchIntentForPackage("com.cari.promo.diskon"); if (intent1 != null && packageManager.resolveActivity(intent1, PackageManager.MATCH_DEFAULT_ONLY) != null) { try { mActivity.startActivity(intent1); } catch (Exception e) { e.printStackTrace(); } } } break; case Broadcast: { mActivity.startActivity(new Intent(mActivity, BroadcastActivity.class)); } break; case FILE: mActivity.startActivity(new Intent(mActivity, FileActivity.class)); break; case DrawLayout: mActivity.startActivity(new Intent(mActivity, DrawLayoutActivity.class)); break; case INCLUDEMERGEVIEWSTUB: mActivity.startActivity(new Intent(mActivity, IncludeMergeViewStubActivity.class)); break; } } }
[ "wangbo@newsinpalm.com" ]
wangbo@newsinpalm.com
57545f67b0a3558aadfbc9d2b75ca0ba77cbfac8
8b51ce5f66cbc7236faac4a9a205a58321cc7ee3
/JavaSample/src/try_catch_sample/throws_sample.java
3e7611319d0dc73c8f2ca78e85b15ba0bcdb0c41
[]
no_license
ayolabboy/java-study-
36836849d383c51506e257aa898f017fc4968a4c
7b4b116662b098dbebb84dbbec137bf78d6146da
refs/heads/master
2022-12-25T06:37:03.864710
2020-03-03T14:24:02
2020-03-03T14:24:02
235,958,304
1
0
null
2022-12-16T15:25:07
2020-01-24T07:32:00
JavaScript
UTF-8
Java
false
false
367
java
package try_catch_sample; public class throws_sample { public static void main(String[] args) { int a = 10; int b= 0; try { int k = divide(a,b); System.out.println(k); }catch(ArithmeticException e){ System.out.println(e.toString()); } } public static int divide(int a, int b) throws ArithmeticException{ return a/b; } }
[ "dong0901@gmail.com" ]
dong0901@gmail.com
8a05cbb299d054947900824366c5a9f1a1549c34
95e944448000c08dd3d6915abb468767c9f29d3c
/sources/com/p280ss/android/ugc/aweme/challenge/p1084c/C23678f.java
ff9fa9abe89c19c5078978a353b5a998e03e7106
[]
no_license
xrealm/tiktok-src
261b1faaf7b39d64bb7cb4106dc1a35963bd6868
90f305b5f981d39cfb313d75ab231326c9fca597
refs/heads/master
2022-11-12T06:43:07.401661
2020-07-04T20:21:12
2020-07-04T20:21:12
null
0
0
null
null
null
null
UTF-8
Java
false
false
3,713
java
package com.p280ss.android.ugc.aweme.challenge.p1084c; import android.os.Message; import android.text.TextUtils; import android.util.Log; import com.google.common.collect.C17777bq; import com.p280ss.android.ugc.aweme.base.C23397p; import com.p280ss.android.ugc.aweme.challenge.api.ChallengeApi; import com.p280ss.android.ugc.aweme.challenge.model.SearchChallenge; import com.p280ss.android.ugc.aweme.challenge.model.SearchChallengeList; import com.p280ss.android.ugc.aweme.common.C25640a; import com.p280ss.android.ugc.aweme.discover.model.Challenge; import com.p280ss.android.ugc.aweme.shortvideo.util.C41530am; import java.util.ArrayList; import java.util.concurrent.Callable; /* renamed from: com.ss.android.ugc.aweme.challenge.c.f */ public final class C23678f extends C25640a<SearchChallengeList> { public final boolean checkParams(Object... objArr) { if (objArr == null || objArr.length != 2) { return false; } return true; } /* access modifiers changed from: 0000 */ /* renamed from: a */ public final /* synthetic */ boolean mo61608a(SearchChallenge searchChallenge) { String str; if (searchChallenge.challenge == null) { str = null; } else { str = searchChallenge.challenge.getChallengeName(); } return TextUtils.equals(str, ((SearchChallengeList) this.mData).keyword); } public final boolean sendRequest(final Object... objArr) { if (!super.sendRequest(objArr)) { return false; } C23397p.m76735a().mo60807a(this.mHandler, new Callable() { public final Object call() throws Exception { C23678f.this.mIsLoading = false; return ChallengeApi.m77600a((String) objArr[0], 20, (String) objArr[1]); } }, 0); return true; } public final void handleMsg(Message message) { if (message.obj instanceof Exception) { Exception exc = (Exception) message.obj; if (exc.getMessage() != null) { StringBuilder sb = new StringBuilder("challenge search failed, message:"); sb.append(exc.getMessage()); C41530am.m132283b(sb.toString()); } StringBuilder sb2 = new StringBuilder("challenge search failed, stack trace:"); sb2.append(Log.getStackTraceString(exc)); C41530am.m132283b(sb2.toString()); } super.handleMsg(message); } /* access modifiers changed from: private */ /* renamed from: a */ public void handleData(SearchChallengeList searchChallengeList) { if (searchChallengeList != null) { this.mData = searchChallengeList; if (((SearchChallengeList) this.mData).items == null) { ((SearchChallengeList) this.mData).items = new ArrayList(); } if (!searchChallengeList.isMatch) { boolean isEmpty = ((SearchChallengeList) this.mData).items.isEmpty(); if (!isEmpty) { isEmpty = !C17777bq.m59104e(((SearchChallengeList) this.mData).items, new C23680g(this)).isPresent(); } if (isEmpty) { Challenge challenge = new Challenge(); challenge.setChallengeName(((SearchChallengeList) this.mData).keyword); SearchChallenge searchChallenge = new SearchChallenge(); searchChallenge.challenge = challenge; searchChallenge.isFake = true; ((SearchChallengeList) this.mData).items.add(0, searchChallenge); } } } } }
[ "65450641+Xyzdesk@users.noreply.github.com" ]
65450641+Xyzdesk@users.noreply.github.com
8355b1adf17cf8b4befcc9cd1c0d3a51c2aa21b8
ba7279b2abcd1a3630e464777d8ab219cbcd09b5
/app/src/main/java/com/renyu/androidcommonlibrary/activity/RetrofitActivity.java
1e65921a6517a92e36d12740b2605262a2656db9
[]
no_license
mingfenghappy/AndroidCommonLibrary
29995f66edc5c3e031c89bd5699e516a99d43c4a
eb0a8841ade570ed079f1b455875be03d0dcad74
refs/heads/master
2020-03-25T02:09:52.729433
2018-07-24T09:36:47
2018-07-24T09:36:47
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,630
java
package com.renyu.androidcommonlibrary.activity; import android.graphics.Color; import android.widget.Toast; import com.renyu.androidcommonlibrary.ExampleApp; import com.renyu.androidcommonlibrary.bean.AccessTokenResponse; import com.renyu.androidcommonlibrary.api.RetrofitImpl; import com.renyu.androidcommonlibrary.di.module.ReposModule; import com.renyu.commonlibrary.baseact.BaseActivity; import com.renyu.commonlibrary.commonutils.Utils; import com.renyu.commonlibrary.network.BaseObserver; import com.renyu.commonlibrary.network.Retrofit2Utils; import com.renyu.commonlibrary.network.RetryFunction; import com.trello.rxlifecycle2.android.ActivityEvent; import javax.inject.Inject; public class RetrofitActivity extends BaseActivity { @Inject RetrofitImpl retrofitImpl = null; @Override public void initParams() { ((ExampleApp) (com.blankj.utilcode.util.Utils.getApp())).appComponent.plusAct(new ReposModule()).inject(this); } @Override public int initViews() { return 0; } @Override public void loadData() { getAccessToken(); } @Override public int setStatusBarColor() { return Color.BLACK; } @Override public int setStatusBarTranslucent() { return 0; } private void getAccessToken() { int timestamp = (int) (System.currentTimeMillis() / 1000); String random = "abcdefghijklmn"; String signature = "app_id=46877648&app_secret=kCkrePwPpHOsYYSYWTDKzvczWRyvhknG&device_id=" + Utils.getUniquePsuedoID() + "&rand_str=" + random + "&timestamp=" + timestamp; retrofitImpl.getAccessToken("nj", timestamp, "46877648", random, Utils.getMD5(signature), Utils.getUniquePsuedoID(), "v1.0", 0, 1, 6000) .retryWhen(new RetryFunction(3, 3)) .compose(Retrofit2Utils.background()) .compose(bindUntilEvent(ActivityEvent.DESTROY)) .subscribe(new BaseObserver<AccessTokenResponse>(this) { @Override public void onNext(AccessTokenResponse accessTokenResponse) { String access_token = accessTokenResponse.getAccess_token(); Toast.makeText(RetrofitActivity.this, access_token, Toast.LENGTH_SHORT).show(); networkLoadingDialog.close(); } }); } }
[ "Yuren2@hotmail.com" ]
Yuren2@hotmail.com
d707217a55f81033dd02c0353c560780915f288b
3854926ac8f6c69228e3a6b5a3de15322c2de946
/Week_01/HelloClassLoader.java
2bde36ccccf6d299fd1c5bac4dedb442b05216d1
[]
no_license
thomas-fan/JAVA-000
c3bca4b492f3881b5b060021342deb6d8f45eba0
8984bf02dff8acdb1b33a7aaff39fdc1f7a2fe9e
refs/heads/main
2022-12-31T11:02:38.871504
2020-10-20T01:44:15
2020-10-20T01:44:15
303,265,212
0
0
null
2020-10-12T03:15:00
2020-10-12T03:14:59
null
UTF-8
Java
false
false
1,677
java
import java.io.*; import java.lang.reflect.Method; public class HelloClassLoader extends ClassLoader { public static void main(String[] args) throws Exception { HelloClassLoader myClassLoader = new HelloClassLoader(); final Class<?> hello = myClassLoader.findClass("Hello"); Method sayHello = hello.getMethod("hello"); Object hello1 = hello.newInstance(); System.out.println(sayHello.invoke(hello1)); } @Override protected Class<?> findClass(String name) throws ClassNotFoundException { Class clazz = null; String classFilename = name + ".xlass"; File classFile = new File(classFilename); if (classFile.exists()) { try { InputStream in = new FileInputStream(classFilename); ByteArrayOutputStream out = new ByteArrayOutputStream(); byte[] buffer = new byte[1024 * 4]; int n = 0; while ((n = in.read(buffer)) != -1) { out.write(buffer, 0, n); } byte[] bytes = out.toByteArray(); for (int i = 0; i < bytes.length; i++) { bytes[i] = (byte) (255 - bytes[i]); } clazz = defineClass(name, bytes, 0, bytes.length); } catch (FileNotFoundException e) { e.printStackTrace(); return null; } catch (IOException e) { e.printStackTrace(); return null; } } if (clazz == null) { throw new ClassNotFoundException(name); } return clazz; } }
[ "zhangfan@thomas-fan.com" ]
zhangfan@thomas-fan.com
134afb042d284b1eeac22b9514c61fba46bc0957
d28a6288bc313b8f0459fceba2ec6e5a9bbec752
/zsgc-parent/zsgc-core/src/main/java/com/zsgc/core/model/Bank.java
01362e8f4252c77d8dc63086eb8ab25006c986da
[]
no_license
WalkingSouls/zsgc
2db9fa2a08339c56a61854b7e6474a36f0e7b080
203ce8dcb1bee1d3859cf9e670c74d858f46bbd6
refs/heads/master
2020-05-20T03:54:25.273039
2019-05-07T09:34:02
2019-05-07T09:34:02
185,370,071
0
0
null
null
null
null
UTF-8
Java
false
false
6,792
java
package com.zsgc.core.model; import com.calanger.common.dao.AbstractPO; public class Bank extends AbstractPO { private static final long serialVersionUID = 1L; private java.lang.Integer id; private java.lang.String name; private java.lang.String code; private java.lang.String icon; private java.lang.String pcIcon; private java.lang.String backgroundImage; private java.lang.String pcBackgroundImage; private java.lang.Integer status; private java.lang.String singleLimit; private java.lang.String dailyAccumulativeLimit; private java.lang.String monthlyAccumulativeLimit; private java.lang.String conditionsOfUsage; private java.lang.String llpayCode; private java.lang.String bankNo; private java.lang.String issInsCd; public java.lang.Integer getId() { return id; } public void setId(java.lang.Integer id) { this.id = id; } public void setId(java.lang.Integer id, boolean forceUpdate) { setId(id); if (forceUpdate) { addForceUpdateProperty("id"); } } public java.lang.String getName() { return name; } public void setName(java.lang.String name) { this.name = name; } public void setName(java.lang.String name, boolean forceUpdate) { setName(name); if (forceUpdate) { addForceUpdateProperty("name"); } } public java.lang.String getCode() { return code; } public void setCode(java.lang.String code) { this.code = code; } public void setCode(java.lang.String code, boolean forceUpdate) { setCode(code); if (forceUpdate) { addForceUpdateProperty("code"); } } public java.lang.String getIcon() { return icon; } public void setIcon(java.lang.String icon) { this.icon = icon; } public void setIcon(java.lang.String icon, boolean forceUpdate) { setIcon(icon); if (forceUpdate) { addForceUpdateProperty("icon"); } } public java.lang.String getPcIcon() { return pcIcon; } public void setPcIcon(java.lang.String pcIcon) { this.pcIcon = pcIcon; } public void setPcIcon(java.lang.String pcIcon, boolean forceUpdate) { setPcIcon(pcIcon); if (forceUpdate) { addForceUpdateProperty("pcIcon"); } } public java.lang.String getBackgroundImage() { return backgroundImage; } public void setBackgroundImage(java.lang.String backgroundImage) { this.backgroundImage = backgroundImage; } public void setBackgroundImage(java.lang.String backgroundImage, boolean forceUpdate) { setBackgroundImage(backgroundImage); if (forceUpdate) { addForceUpdateProperty("backgroundImage"); } } public java.lang.String getPcBackgroundImage() { return pcBackgroundImage; } public void setPcBackgroundImage(java.lang.String pcBackgroundImage) { this.pcBackgroundImage = pcBackgroundImage; } public void setPcBackgroundImage(java.lang.String pcBackgroundImage, boolean forceUpdate) { setPcBackgroundImage(pcBackgroundImage); if (forceUpdate) { addForceUpdateProperty("pcBackgroundImage"); } } public java.lang.Integer getStatus() { return status; } public void setStatus(java.lang.Integer status) { this.status = status; } public void setStatus(java.lang.Integer status, boolean forceUpdate) { setStatus(status); if (forceUpdate) { addForceUpdateProperty("status"); } } public java.lang.String getSingleLimit() { return singleLimit; } public void setSingleLimit(java.lang.String singleLimit) { this.singleLimit = singleLimit; } public void setSingleLimit(java.lang.String singleLimit, boolean forceUpdate) { setSingleLimit(singleLimit); if (forceUpdate) { addForceUpdateProperty("singleLimit"); } } public java.lang.String getDailyAccumulativeLimit() { return dailyAccumulativeLimit; } public void setDailyAccumulativeLimit(java.lang.String dailyAccumulativeLimit) { this.dailyAccumulativeLimit = dailyAccumulativeLimit; } public void setDailyAccumulativeLimit(java.lang.String dailyAccumulativeLimit, boolean forceUpdate) { setDailyAccumulativeLimit(dailyAccumulativeLimit); if (forceUpdate) { addForceUpdateProperty("dailyAccumulativeLimit"); } } public java.lang.String getMonthlyAccumulativeLimit() { return monthlyAccumulativeLimit; } public void setMonthlyAccumulativeLimit(java.lang.String monthlyAccumulativeLimit) { this.monthlyAccumulativeLimit = monthlyAccumulativeLimit; } public void setMonthlyAccumulativeLimit(java.lang.String monthlyAccumulativeLimit, boolean forceUpdate) { setMonthlyAccumulativeLimit(monthlyAccumulativeLimit); if (forceUpdate) { addForceUpdateProperty("monthlyAccumulativeLimit"); } } public java.lang.String getConditionsOfUsage() { return conditionsOfUsage; } public void setConditionsOfUsage(java.lang.String conditionsOfUsage) { this.conditionsOfUsage = conditionsOfUsage; } public void setConditionsOfUsage(java.lang.String conditionsOfUsage, boolean forceUpdate) { setConditionsOfUsage(conditionsOfUsage); if (forceUpdate) { addForceUpdateProperty("conditionsOfUsage"); } } public java.lang.String getLlpayCode() { return llpayCode; } public void setLlpayCode(java.lang.String llpayCode) { this.llpayCode = llpayCode; } public void setLlpayCode(java.lang.String llpayCode, boolean forceUpdate) { setLlpayCode(llpayCode); if (forceUpdate) { addForceUpdateProperty("llpayCode"); } } public java.lang.String getBankNo() { return bankNo; } public void setBankNo(java.lang.String bankNo) { this.bankNo = bankNo; } public void setBankNo(java.lang.String bankNo, boolean forceUpdate) { setBankNo(bankNo); if (forceUpdate) { addForceUpdateProperty("bankNo"); } } public java.lang.String getIssInsCd() { return issInsCd; } public void setIssInsCd(java.lang.String issInsCd) { this.issInsCd = issInsCd; } public void setIssInsCd(java.lang.String issInsCd, boolean forceUpdate) { setIssInsCd(issInsCd); if (forceUpdate) { addForceUpdateProperty("issInsCd"); } } }
[ "15739297124@163.com" ]
15739297124@163.com
83c11d289a1955cb56af44bbea44c685f588237c
e48985fdf73f191445798e79ae2813e987cb150c
/src/ch08/_09_SpreadMain.java
4fb98b5fc014b919d296dfee845b29e962179362
[]
no_license
behappyleee/JavaTutorial
755212831fb2a79f614dbac3449118ab0b326633
83519e877fd8f236165ae0d672a0d5cbcce99366
refs/heads/master
2023-03-06T08:00:41.856955
2021-02-17T13:28:47
2021-02-17T13:28:47
339,708,368
0
0
null
null
null
null
UTF-8
Java
false
false
410
java
package ch08; public class _09_SpreadMain { public static void main(String[] args) { _09_SpreadArgs var = new _09_SpreadArgs(); var.callArg("샌드위치","연어스테이크" , "샐러드" , "ABC쥬스" ,"고구마"); //컴파일 시점에 배열이 생성됨(갯수는 상관x ==> 매개변수로 점3개를 줌 ...) var.callArg2("홍길동" , 60, 50 , 40); } }
[ "dhfhfkwhdk@naver.com" ]
dhfhfkwhdk@naver.com
4dc41787c1f780a6a24e9f9382db634a6e3de715
859f4ac4af996bfe2bb803d68fe72668d8c0d84e
/src/main/java/com/msp/givn/entity/PostType.java
55373baa06bf5c2a37ad2af92d60644178cfb6b4
[]
no_license
chaulong78/givn
467187cdae19e97cf271f5d81d62d64cb271cb04
22666ab92173e4102f8bc60fe615d97d92109ae7
refs/heads/master
2020-04-26T09:47:24.647473
2019-03-13T07:15:25
2019-03-13T07:15:25
171,267,346
0
0
null
null
null
null
UTF-8
Java
false
false
437
java
package com.msp.givn.entity; import lombok.Data; import javax.persistence.*; @Entity @Table(name = "post_type") @Data public class PostType { @Id @GeneratedValue(strategy = GenerationType.IDENTITY) @Column(name = "id") private int id; @Column(name = "name") private String name; @Column(name = "url_name") private String urlName; @Column(name = "description") private String description; }
[ "chaulongdbp7@gmail.com" ]
chaulongdbp7@gmail.com
6443048d407998ebd0e0eedae0e87afc74af7cf8
c8818ae02043a41118094ede25aa5f57213752c1
/app/src/main/java/com/amihealth/amihealth/Models/UserGeneral.java
93479c5345fe2df9fc2dc91e4e2166d577d586aa
[]
no_license
nielsen29/AmIhealth_v2.0
4556b30aae43debd333626e04b3410c173075abd
0c8d8734f16b1c9710eacab233f601936df5282e
refs/heads/master
2021-05-13T18:04:56.381219
2019-06-02T13:48:25
2019-06-02T13:48:25
116,850,596
0
0
null
null
null
null
UTF-8
Java
false
false
1,193
java
package com.amihealth.amihealth.Models; /** * Created by amihealthmel on 08/07/17. */ public class UserGeneral { public String nombre; public String cedula; public String apellido; public String fecha_nacimiento; public int sexo; public int id_etnia; public String getNombre() { return nombre; } public void setNombre(String nombre) { this.nombre = nombre; } public String getCedula() { return cedula; } public void setCedula(String cedula) { this.cedula = cedula; } public String getApellido() { return apellido; } public void setApellido(String apellido) { this.apellido = apellido; } public String getFecha_nacimiento() { return fecha_nacimiento; } public void setFecha_nacimiento(String fecha_nacimiento) { this.fecha_nacimiento = fecha_nacimiento; } public int getSexo() { return sexo; } public void setSexo(int sexo) { this.sexo = sexo; } public int getId_etnia() { return id_etnia; } public void setId_etnia(int id_etnia) { this.id_etnia = id_etnia; } }
[ "mel29nielsen@gmail.com" ]
mel29nielsen@gmail.com
7fbe586f9987881e4f0efda0aace05080f826eda
eef87b979d9d76465c8f026119b1c3a94268f36f
/src/main/java/com/oracle/xmlns/communications/ncc/_2009/_05/_15/pi/CCSCD1CHG.java
7b44804e0555c92825de4d78ecef58d3ce58f6b5
[]
no_license
amoiseyenko/crm
57f9a383bd17b705225b27d771bcffe3d7c40abe
85f757ba4071e462550f41ea1640eb7a1350cbb2
refs/heads/master
2016-09-06T19:34:44.046127
2015-08-06T10:45:39
2015-08-06T10:45:39
40,299,133
0
0
null
null
null
null
UTF-8
Java
false
false
15,681
java
// // This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.7 // See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> // Any modifications to this file will be lost upon recompilation of the source schema. // Generated on: 2015.06.28 at 05:35:49 PM CEST // package com.oracle.xmlns.communications.ncc._2009._05._15.pi; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlRootElement; import javax.xml.bind.annotation.XmlType; /** * <p>Java class for anonymous complex type. * * <p>The following schema fragment specifies the expected content contained within this class. * * <pre> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="AUTH" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/> * &lt;element name="username" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/> * &lt;element name="password" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/> * &lt;element name="MSISDN" type="{http://www.w3.org/2001/XMLSchema}string"/> * &lt;element name="BALANCE_EXPIRY_DATE" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/> * &lt;element name="BALANCE_EXPIRY" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/> * &lt;element name="BALANCE_TYPE" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/> * &lt;element name="BALANCE" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/> * &lt;element name="BALMODE" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/> * &lt;element name="CREDIT_LIMIT" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/> * &lt;element name="CURRENCY" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/> * &lt;element name="EXPMODE" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/> * &lt;element name="EXTRA_EDR" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/> * &lt;element name="LANGUAGE" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/> * &lt;element name="NEW_MSISDN" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/> * &lt;element name="PIN" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/> * &lt;element name="PRODUCT" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/> * &lt;element name="STATUS" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/> * &lt;element name="WALLET_EXPIRY_DATE" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/> * &lt;element name="WALLET_EXPIRY" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/> * &lt;element name="WALLET_REFERENCE" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/> * &lt;element name="WALLET_TYPE" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * </pre> * * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "", propOrder = { "auth", "username", "password", "msisdn", "balanceexpirydate", "balanceexpiry", "balancetype", "balance", "balmode", "creditlimit", "currency", "expmode", "extraedr", "language", "newmsisdn", "pin", "product", "status", "walletexpirydate", "walletexpiry", "walletreference", "wallettype" }) @XmlRootElement(name = "CCSCD1_CHG") public class CCSCD1CHG { @XmlElement(name = "AUTH") protected String auth; protected String username; protected String password; @XmlElement(name = "MSISDN", required = true) protected String msisdn; @XmlElement(name = "BALANCE_EXPIRY_DATE") protected String balanceexpirydate; @XmlElement(name = "BALANCE_EXPIRY") protected String balanceexpiry; @XmlElement(name = "BALANCE_TYPE") protected String balancetype; @XmlElement(name = "BALANCE") protected String balance; @XmlElement(name = "BALMODE") protected String balmode; @XmlElement(name = "CREDIT_LIMIT") protected String creditlimit; @XmlElement(name = "CURRENCY") protected String currency; @XmlElement(name = "EXPMODE") protected String expmode; @XmlElement(name = "EXTRA_EDR") protected String extraedr; @XmlElement(name = "LANGUAGE") protected String language; @XmlElement(name = "NEW_MSISDN") protected String newmsisdn; @XmlElement(name = "PIN") protected String pin; @XmlElement(name = "PRODUCT") protected String product; @XmlElement(name = "STATUS") protected String status; @XmlElement(name = "WALLET_EXPIRY_DATE") protected String walletexpirydate; @XmlElement(name = "WALLET_EXPIRY") protected String walletexpiry; @XmlElement(name = "WALLET_REFERENCE") protected String walletreference; @XmlElement(name = "WALLET_TYPE") protected String wallettype; /** * Gets the value of the auth property. * * @return * possible object is * {@link String } * */ public String getAUTH() { return auth; } /** * Sets the value of the auth property. * * @param value * allowed object is * {@link String } * */ public void setAUTH(String value) { this.auth = value; } /** * Gets the value of the username property. * * @return * possible object is * {@link String } * */ public String getUsername() { return username; } /** * Sets the value of the username property. * * @param value * allowed object is * {@link String } * */ public void setUsername(String value) { this.username = value; } /** * Gets the value of the password property. * * @return * possible object is * {@link String } * */ public String getPassword() { return password; } /** * Sets the value of the password property. * * @param value * allowed object is * {@link String } * */ public void setPassword(String value) { this.password = value; } /** * Gets the value of the msisdn property. * * @return * possible object is * {@link String } * */ public String getMSISDN() { return msisdn; } /** * Sets the value of the msisdn property. * * @param value * allowed object is * {@link String } * */ public void setMSISDN(String value) { this.msisdn = value; } /** * Gets the value of the balanceexpirydate property. * * @return * possible object is * {@link String } * */ public String getBALANCEEXPIRYDATE() { return balanceexpirydate; } /** * Sets the value of the balanceexpirydate property. * * @param value * allowed object is * {@link String } * */ public void setBALANCEEXPIRYDATE(String value) { this.balanceexpirydate = value; } /** * Gets the value of the balanceexpiry property. * * @return * possible object is * {@link String } * */ public String getBALANCEEXPIRY() { return balanceexpiry; } /** * Sets the value of the balanceexpiry property. * * @param value * allowed object is * {@link String } * */ public void setBALANCEEXPIRY(String value) { this.balanceexpiry = value; } /** * Gets the value of the balancetype property. * * @return * possible object is * {@link String } * */ public String getBALANCETYPE() { return balancetype; } /** * Sets the value of the balancetype property. * * @param value * allowed object is * {@link String } * */ public void setBALANCETYPE(String value) { this.balancetype = value; } /** * Gets the value of the balance property. * * @return * possible object is * {@link String } * */ public String getBALANCE() { return balance; } /** * Sets the value of the balance property. * * @param value * allowed object is * {@link String } * */ public void setBALANCE(String value) { this.balance = value; } /** * Gets the value of the balmode property. * * @return * possible object is * {@link String } * */ public String getBALMODE() { return balmode; } /** * Sets the value of the balmode property. * * @param value * allowed object is * {@link String } * */ public void setBALMODE(String value) { this.balmode = value; } /** * Gets the value of the creditlimit property. * * @return * possible object is * {@link String } * */ public String getCREDITLIMIT() { return creditlimit; } /** * Sets the value of the creditlimit property. * * @param value * allowed object is * {@link String } * */ public void setCREDITLIMIT(String value) { this.creditlimit = value; } /** * Gets the value of the currency property. * * @return * possible object is * {@link String } * */ public String getCURRENCY() { return currency; } /** * Sets the value of the currency property. * * @param value * allowed object is * {@link String } * */ public void setCURRENCY(String value) { this.currency = value; } /** * Gets the value of the expmode property. * * @return * possible object is * {@link String } * */ public String getEXPMODE() { return expmode; } /** * Sets the value of the expmode property. * * @param value * allowed object is * {@link String } * */ public void setEXPMODE(String value) { this.expmode = value; } /** * Gets the value of the extraedr property. * * @return * possible object is * {@link String } * */ public String getEXTRAEDR() { return extraedr; } /** * Sets the value of the extraedr property. * * @param value * allowed object is * {@link String } * */ public void setEXTRAEDR(String value) { this.extraedr = value; } /** * Gets the value of the language property. * * @return * possible object is * {@link String } * */ public String getLANGUAGE() { return language; } /** * Sets the value of the language property. * * @param value * allowed object is * {@link String } * */ public void setLANGUAGE(String value) { this.language = value; } /** * Gets the value of the newmsisdn property. * * @return * possible object is * {@link String } * */ public String getNEWMSISDN() { return newmsisdn; } /** * Sets the value of the newmsisdn property. * * @param value * allowed object is * {@link String } * */ public void setNEWMSISDN(String value) { this.newmsisdn = value; } /** * Gets the value of the pin property. * * @return * possible object is * {@link String } * */ public String getPIN() { return pin; } /** * Sets the value of the pin property. * * @param value * allowed object is * {@link String } * */ public void setPIN(String value) { this.pin = value; } /** * Gets the value of the product property. * * @return * possible object is * {@link String } * */ public String getPRODUCT() { return product; } /** * Sets the value of the product property. * * @param value * allowed object is * {@link String } * */ public void setPRODUCT(String value) { this.product = value; } /** * Gets the value of the status property. * * @return * possible object is * {@link String } * */ public String getSTATUS() { return status; } /** * Sets the value of the status property. * * @param value * allowed object is * {@link String } * */ public void setSTATUS(String value) { this.status = value; } /** * Gets the value of the walletexpirydate property. * * @return * possible object is * {@link String } * */ public String getWALLETEXPIRYDATE() { return walletexpirydate; } /** * Sets the value of the walletexpirydate property. * * @param value * allowed object is * {@link String } * */ public void setWALLETEXPIRYDATE(String value) { this.walletexpirydate = value; } /** * Gets the value of the walletexpiry property. * * @return * possible object is * {@link String } * */ public String getWALLETEXPIRY() { return walletexpiry; } /** * Sets the value of the walletexpiry property. * * @param value * allowed object is * {@link String } * */ public void setWALLETEXPIRY(String value) { this.walletexpiry = value; } /** * Gets the value of the walletreference property. * * @return * possible object is * {@link String } * */ public String getWALLETREFERENCE() { return walletreference; } /** * Sets the value of the walletreference property. * * @param value * allowed object is * {@link String } * */ public void setWALLETREFERENCE(String value) { this.walletreference = value; } /** * Gets the value of the wallettype property. * * @return * possible object is * {@link String } * */ public String getWALLETTYPE() { return wallettype; } /** * Sets the value of the wallettype property. * * @param value * allowed object is * {@link String } * */ public void setWALLETTYPE(String value) { this.wallettype = value; } }
[ "artem.moiseenko@hys-enterprise.com" ]
artem.moiseenko@hys-enterprise.com
cd3d23cfd1cb23c157100d03f84c7d216caf5d71
b4ba2cca922bcef1f3cd18fc033c7c7f0561f11a
/src/main/java/fi/vamk/e1900320/northwind/entity/PurchaseOrderDetails.java
cb400d4ec086116d0d0579d29595f49b4e4b2477
[]
no_license
AlonaTsk/northwind
10d6d1cdf46a8f211805171b4e3f7d20694fb11b
3e96af01ef3811b0f5e707666a39d008c1a44c8a
refs/heads/main
2023-03-17T10:27:40.291308
2021-02-28T13:12:12
2021-02-28T13:12:12
343,108,128
0
0
null
null
null
null
UTF-8
Java
false
false
1,030
java
package fi.vamk.e1900320.northwind.entity; import java.sql.*; import javax.persistence.*; import lombok.Data; @Data @Entity(name = "fi.vamk.e1900320.northwind.entity.PurchaseOrderDetails") @Table(name = "purchase_order_details") public class PurchaseOrderDetails { @Id @GeneratedValue(strategy = GenerationType.IDENTITY) @Column(name = "\"id\"", nullable = false) private Integer id; @Column(name = "\"purchase_order_id\"", nullable = false) private Integer purchaseOrderId; @Column(name = "\"product_id\"", nullable = true) private Integer productId; @Column(name = "\"quantity\"", nullable = false) private java.math.BigDecimal quantity; @Column(name = "\"unit_cost\"", nullable = false) private java.math.BigDecimal unitCost; @Column(name = "\"date_received\"", nullable = true) private Timestamp dateReceived; @Column(name = "\"posted_to_inventory\"", nullable = false) private boolean postedToInventory; @Column(name = "\"inventory_id\"", nullable = true) private Integer inventoryId; }
[ "aliona2709@icloud.com" ]
aliona2709@icloud.com
6502308533663c3e963055591309334672104f43
ee565366a225df85ebdf322370a8dd7fcbf0e111
/gmall-base/src/main/java/cn/chinatax/josewu/base/bean/Zsxx.java
920a56996bd98fefc80c3c3d3e70180605a3c758
[]
no_license
chinatax/gmall
fdcdc822b9c3977daaca7b3395e3e855900784a4
d34bc4fd1a0c48d1ded8703e67b26291c80eb288
refs/heads/master
2022-06-22T20:41:31.613002
2019-08-24T03:50:07
2019-08-24T03:50:07
200,834,489
0
0
null
null
null
null
UTF-8
Java
false
false
3,111
java
package cn.chinatax.josewu.base.bean; import java.io.Serializable; import java.math.BigDecimal; public class Zsxx implements Serializable { private Long id; private Short xh; private String dq; private BigDecimal jfrsSntq; private BigDecimal jfjsSntq; private BigDecimal jfjeSntq; private BigDecimal jfrsBq; private BigDecimal jfjsBq; private BigDecimal jfjeBq; private BigDecimal xj; private BigDecimal jvjf; private BigDecimal spgzkjjfe; private BigDecimal xsjfzchs; public Zsxx(Long id, Short xh, String dq, BigDecimal jfrsSntq, BigDecimal jfjsSntq, BigDecimal jfjeSntq, BigDecimal jfrsBq, BigDecimal jfjsBq, BigDecimal jfjeBq, BigDecimal xj, BigDecimal jvjf, BigDecimal spgzkjjfe, BigDecimal xsjfzchs) { this.id = id; this.xh = xh; this.dq = dq; this.jfrsSntq = jfrsSntq; this.jfjsSntq = jfjsSntq; this.jfjeSntq = jfjeSntq; this.jfrsBq = jfrsBq; this.jfjsBq = jfjsBq; this.jfjeBq = jfjeBq; this.xj = xj; this.jvjf = jvjf; this.spgzkjjfe = spgzkjjfe; this.xsjfzchs = xsjfzchs; } public Zsxx() { super(); } public Long getId() { return id; } public void setId(Long id) { this.id = id; } public Short getXh() { return xh; } public void setXh(Short xh) { this.xh = xh; } public String getDq() { return dq; } public void setDq(String dq) { this.dq = dq == null ? null : dq.trim(); } public BigDecimal getJfrsSntq() { return jfrsSntq; } public void setJfrsSntq(BigDecimal jfrsSntq) { this.jfrsSntq = jfrsSntq; } public BigDecimal getJfjsSntq() { return jfjsSntq; } public void setJfjsSntq(BigDecimal jfjsSntq) { this.jfjsSntq = jfjsSntq; } public BigDecimal getJfjeSntq() { return jfjeSntq; } public void setJfjeSntq(BigDecimal jfjeSntq) { this.jfjeSntq = jfjeSntq; } public BigDecimal getJfrsBq() { return jfrsBq; } public void setJfrsBq(BigDecimal jfrsBq) { this.jfrsBq = jfrsBq; } public BigDecimal getJfjsBq() { return jfjsBq; } public void setJfjsBq(BigDecimal jfjsBq) { this.jfjsBq = jfjsBq; } public BigDecimal getJfjeBq() { return jfjeBq; } public void setJfjeBq(BigDecimal jfjeBq) { this.jfjeBq = jfjeBq; } public BigDecimal getXj() { return xj; } public void setXj(BigDecimal xj) { this.xj = xj; } public BigDecimal getJvjf() { return jvjf; } public void setJvjf(BigDecimal jvjf) { this.jvjf = jvjf; } public BigDecimal getSpgzkjjfe() { return spgzkjjfe; } public void setSpgzkjjfe(BigDecimal spgzkjjfe) { this.spgzkjjfe = spgzkjjfe; } public BigDecimal getXsjfzchs() { return xsjfzchs; } public void setXsjfzchs(BigDecimal xsjfzchs) { this.xsjfzchs = xsjfzchs; } }
[ "446702119@qq.com" ]
446702119@qq.com
a7885bc87e9296d6c372c570762d0f6f35e2ba0c
43e53df958e4eae4c1af68845afad4111947479b
/app/src/androidTest/java/com/example/sehernurese/gezginapp/ExampleInstrumentedTest.java
08b774d9b64cfd9a5edb2deb8d056d17cc46133b
[]
no_license
ZuleyhaSehernurEse/GezginApp
45260501d5fb04c75a03ab135996f5e1f17c292a
a348b8de764f8f2c319101e9a4c004d456956e54
refs/heads/master
2020-05-16T05:43:17.407899
2019-04-22T16:19:19
2019-04-22T16:19:19
182,824,202
0
0
null
null
null
null
UTF-8
Java
false
false
750
java
package com.example.sehernurese.gezginapp; import android.content.Context; import android.support.test.InstrumentationRegistry; import android.support.test.runner.AndroidJUnit4; import org.junit.Test; import org.junit.runner.RunWith; import static org.junit.Assert.*; /** * Instrumented test, which will execute on an Android device. * * @see <a href="http://d.android.com/tools/testing">Testing documentation</a> */ @RunWith(AndroidJUnit4.class) public class ExampleInstrumentedTest { @Test public void useAppContext() { // Context of the app under test. Context appContext = InstrumentationRegistry.getTargetContext(); assertEquals("com.example.sehernurese.gezginapp", appContext.getPackageName()); } }
[ "313926@ogr.ktu.edu.tr" ]
313926@ogr.ktu.edu.tr
795bbea092cf9b34e0eeffd9b8fb32622721746b
48fd0b689f9cdb660ad06a191107e14d47542fd8
/Ada55/src/MinimumLogicStep.java
d1b1ccfa2bd459e215633a8565d881cbc0199ba5
[ "MIT" ]
permissive
chiendarrendor/AlbertsAdalogicalAenigmas
3dfc6616d47c361ad6911e2ee4e3a3ec24bb6b75
c6f91d4718999089686f3034a75a11b312fa1458
refs/heads/master
2022-08-28T11:34:02.261386
2022-07-08T22:45:24
2022-07-08T22:45:24
115,220,665
1
1
null
null
null
null
UTF-8
Java
false
false
2,134
java
import grid.graph.GridGraph; import grid.logic.LogicStatus; import grid.puzzlebits.Direction; import java.awt.*; import java.util.Set; // this class explores the behavior of the regions of the grid that we // know are connected by paths. public class MinimumLogicStep extends CommonLogicStep { public MinimumLogicStep() { super(true); } @Override public LogicStatus applyToGroup(Board thing, Set<Point> cells, Set<Point> numbers,GridGraph gg) { LogicStatus result = LogicStatus.STYMIED; if (numbers.size() > 2) return LogicStatus.CONTRADICTION; // all cells of a group must be connected to each other. for (Point p : cells) { for (Direction d: Utility.OPDIRS) { Point np = d.delta(p,1); if (!cells.contains(np)) continue; EdgeState es = thing.getEdge(p.x,p.y,d); if (es == EdgeState.WALL) return LogicStatus.CONTRADICTION; if (es == EdgeState.UNKNOWN) { result = LogicStatus.LOGICED; thing.setEdge(p.x,p.y,d,EdgeState.PATH); } } } int maxsize; if (numbers.size() < 2) maxsize = thing.getMax() - 1; else { int pairmax = numbers.stream().mapToInt(it->thing.getNumber(it.x,it.y)).max().getAsInt(); int pairmin = numbers.stream().mapToInt(it->thing.getNumber(it.x,it.y)).min().getAsInt(); if ((pairmax - pairmin) < 2) return LogicStatus.CONTRADICTION; maxsize = pairmax - 1; } if (cells.size() > maxsize) return LogicStatus.CONTRADICTION; /* BlastOut is breathtakingly expensive! if (numbers.size() > 0) { BlastOut bo = new BlastOut(thing,gg,cells,numbers); if (numbers.size() == 1) { LogicStatus bostat = bo.singleNumberExtend(thing); if (bostat == LogicStatus.CONTRADICTION) return LogicStatus.CONTRADICTION; if (bostat == LogicStatus.LOGICED) result = LogicStatus.LOGICED; } } */ return result; } }
[ "chiendarrendor@yahoo.com" ]
chiendarrendor@yahoo.com
5269df4c52f5de01cea33e811d5f30a19f886f98
baa08c46ff681b957217b0f8c06434986fbeb8e9
/Java OOP/b_Inheritance/person/Person.java
fbea39d2a9f35c1251c031037a8d3128a4ce35ea
[]
no_license
anayankova/SoftUni-Software-Engineering
c4b06034995e4da28f2ce7550b5d9a87fd0c59b6
377063b55a5a044f9f4954108366fa3989abdd2d
refs/heads/master
2022-06-24T17:58:58.121622
2020-04-05T09:30:38
2020-04-05T09:30:38
186,245,186
1
0
null
2022-06-21T03:04:59
2019-05-12T11:16:44
Java
UTF-8
Java
false
false
321
java
package b_Inheritance.person; public class Person { private String name; private int age; public Person(String name, int age) { this.name = name; this.age = age; } public String getName() { return this.name; } public int getAge() { return this.age; } }
[ "anayankova91@gmail.com" ]
anayankova91@gmail.com
942069aef56bd7fcdf586b8f5fd58601f8f39843
1ecae42ff90c437ce67b217b66856fee393e013f
/.JETEmitters/src/org/talend/designer/codegen/translators/business/marketo/TMarketoListOperationBeginJava.java
9ae02b2e3eaca6ac82b573a01bce53f27e4cbf8b
[]
no_license
dariofabbri/etl
e66233c970ab95a191816afe8c2ef64a8819562a
cb700ac6375ad57e5b78b8ab82958e4a3f9a09a7
refs/heads/master
2021-01-19T07:41:08.260696
2013-02-09T11:57:12
2013-02-09T11:57:12
null
0
0
null
null
null
null
UTF-8
Java
false
false
4,651
java
package org.talend.designer.codegen.translators.business.marketo; import org.talend.core.model.process.INode; import org.talend.core.model.process.ElementParameterParser; import org.talend.core.model.metadata.IMetadataTable; import org.talend.core.model.process.IConnection; import org.talend.core.model.process.IConnectionCategory; import org.talend.designer.codegen.config.CodeGeneratorArgument; import java.util.List; public class TMarketoListOperationBeginJava { protected static String nl; public static synchronized TMarketoListOperationBeginJava create(String lineSeparator) { nl = lineSeparator; TMarketoListOperationBeginJava result = new TMarketoListOperationBeginJava(); nl = null; return result; } public final String NL = nl == null ? (System.getProperties().getProperty("line.separator")) : nl; protected final String TEXT_1 = "int nb_call_"; protected final String TEXT_2 = " = 0;" + NL + "globalMap.put(\""; protected final String TEXT_3 = "_NB_CALL\",0); "; protected final String TEXT_4 = NL + "\t\t\t\t\tboolean firstList_"; protected final String TEXT_5 = " = true;" + NL + "\t\t\t\t\tString listTypeFlag_"; protected final String TEXT_6 = "=\"\";" + NL + "\t\t\t\t\tString listValueFlag_"; protected final String TEXT_7 = "=\"\";"; protected final String TEXT_8 = NL + "\t\t\t\torg.talend.marketo.Client client_"; protected final String TEXT_9 = " = new org.talend.marketo.Client("; protected final String TEXT_10 = ","; protected final String TEXT_11 = ","; protected final String TEXT_12 = ");" + NL + "\t\t\t\tclient_"; protected final String TEXT_13 = ".setTimeout("; protected final String TEXT_14 = ");" + NL + "\t\t\t\tjava.util.List<com.marketo.www.mktows.LeadKey> leadKeyList_"; protected final String TEXT_15 = " = new java.util.ArrayList<com.marketo.www.mktows.LeadKey>();" + NL + "\t\t\t\tcom.marketo.www.mktows.ResultListOperation resultListOperation_"; protected final String TEXT_16 = " = null;" + NL + "\t\t\t\t" + NL + "\t\t\t\tboolean whetherReject_"; protected final String TEXT_17 = " = false;"; public String generate(Object argument) { final StringBuffer stringBuffer = new StringBuffer(); CodeGeneratorArgument codeGenArgument = (CodeGeneratorArgument) argument; INode node = (INode)codeGenArgument.getArgument(); String cid = node.getUniqueName(); String endpoint = ElementParameterParser.getValue(node, "__ENDPOINT__"); String secretKey = ElementParameterParser.getValue(node, "__SECRET_KEY__"); String clientAccessID = ElementParameterParser.getValue(node, "__CLIENT_ACCESSID__"); String operation = ElementParameterParser.getValue(node, "__OPERATION__"); boolean mutipleOperation = ("true").equals(ElementParameterParser.getValue(node,"__MUTIPLE_OPERATION__")); boolean isMutiple = false; if(mutipleOperation&&!operation.equals("ISMEMBEROFLIST")){ isMutiple = true; } String timeout = ElementParameterParser.getValue(node, "__TIMEOUT__"); List<IMetadataTable> metadatas = node.getMetadataList(); stringBuffer.append(TEXT_1); stringBuffer.append(cid); stringBuffer.append(TEXT_2); stringBuffer.append(cid ); stringBuffer.append(TEXT_3); if ((metadatas!=null)&&(metadatas.size()>0)) {//1 IMetadataTable metadata = metadatas.get(0); if (metadata!=null) {//2 List< ? extends IConnection> conns = node.getIncomingConnections(); for (IConnection conn : conns) {//3 if (conn.getLineStyle().hasConnectionCategory(IConnectionCategory.DATA)) {//4 if(isMutiple){ stringBuffer.append(TEXT_4); stringBuffer.append(cid); stringBuffer.append(TEXT_5); stringBuffer.append(cid); stringBuffer.append(TEXT_6); stringBuffer.append(cid); stringBuffer.append(TEXT_7); } stringBuffer.append(TEXT_8); stringBuffer.append(cid); stringBuffer.append(TEXT_9); stringBuffer.append(endpoint); stringBuffer.append(TEXT_10); stringBuffer.append(secretKey); stringBuffer.append(TEXT_11); stringBuffer.append(clientAccessID); stringBuffer.append(TEXT_12); stringBuffer.append(cid); stringBuffer.append(TEXT_13); stringBuffer.append(timeout); stringBuffer.append(TEXT_14); stringBuffer.append(cid); stringBuffer.append(TEXT_15); stringBuffer.append(cid); stringBuffer.append(TEXT_16); stringBuffer.append(cid); stringBuffer.append(TEXT_17); } } } } return stringBuffer.toString(); } }
[ "danilo.brunamonti@gmail.com" ]
danilo.brunamonti@gmail.com
479b887b3642e7bf2c94fae5819bf3482f8217c3
96263713168150f58c3fe5b508570cd05ce4a70d
/src/com/cook/www/demo2.java
a7ff72ebfc9c513c8ec948c85887ed0a59b1a50c
[]
no_license
juejueisgood/test
40018f34764c085e3d3c8a3d854a9f7732227424
cd7cb5f6f07f0eee1fb4fcfc32ba77eb1c6c31bc
refs/heads/master
2021-01-21T23:20:16.735810
2017-06-24T04:25:54
2017-06-24T05:16:30
95,226,860
0
0
null
null
null
null
GB18030
Java
false
false
1,308
java
package com.cook.www; import java.io.IOException; import java.io.PrintWriter; import java.util.Date; import javax.servlet.ServletException; import javax.servlet.http.Cookie; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; public class demo2 extends HttpServlet { public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { response.setContentType("text/html;charset=UTF-8"); //得到响应输入流 PrintWriter out = response.getWriter(); //获取Cookie中用户最后一次访问时间 Cookie[] cookies = request.getCookies();//获取客户端所有Cookie保存在数组中 //判断当前cookies中的name是否是想要的cookies for (int i = 0;cookies!=null && i < cookies.length; i++) { //如果是想要的cookies if ("lastAccessTime".equals(cookies[i].getName())) { //则吧cookies中的value取出 Long l = Long.parseLong(cookies[i].getValue()); //yyyy-MM-dd out.write("最后一次登陆时间为:"+ new Date(l).toLocaleString()); } } } public void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { } }
[ "juejueisgood@163.com" ]
juejueisgood@163.com
2db4df00a76c59e5060c4123f5429927bac962db
26ea60ddcf4f3f682025ba5a1120c0cc269c8d6e
/app/src/main/java/my/zzm/minan/model/Call.java
df3e204a895abf39e538a9e0a0833a63d29b4e0d
[]
no_license
alexandaking/MinAn
dec8f146b044563b0f0cd61da4ad475a7f1bb8ac
4ecdb6bd4de633d90cd9eeb5704a881810f97666
refs/heads/master
2021-09-03T01:31:59.744829
2018-01-04T15:51:35
2018-01-04T15:51:35
116,269,564
3
1
null
null
null
null
UTF-8
Java
false
false
413
java
package my.zzm.minan.model; /** * Created by AlexanDaking on 17/7/3. */ public class Call { public String title; public String desc; public String imgurl; public String href; public String mask; @Override public String toString() { return "Call [title=" + title + ", desc=" + desc +", imgurl=" + imgurl + ", href=" + href + ", mask=" + mask + "]"; } }
[ "wangjian0716@hotmail.com" ]
wangjian0716@hotmail.com
4e93313644d4c687fc1f4b9b55d3ff79b0813d0f
8e77ed1d11d3ee6486976bdc6b7c5c1043c4d6df
/src/cn/com/oims/service/IEyelxdzxService.java
d92e5498c5955fc196783f3e960f3b7dc5234a20
[]
no_license
498473645/OIMS
e553f266629b7baf0e0dc31bd50edcd534c83c21
4477b5882e6478c3cac44c83a2d2539eb98e887a
refs/heads/main
2023-08-07T04:41:21.592563
2021-09-23T03:10:21
2021-09-23T03:10:21
409,429,603
0
0
null
null
null
null
UTF-8
Java
false
false
409
java
package cn.com.oims.service; import cn.com.oims.dao.pojo.Eyelxdzx; import java.io.Serializable; import org.springframework.stereotype.Service; @Service public interface IEyelxdzxService { void updateEyelxdzx(Eyelxdzx paramEyelxdzx); Serializable saveEyelxdzx(Eyelxdzx paramEyelxdzx); Eyelxdzx selectEyelxdzxByEyelxdzx(Eyelxdzx paramEyelxdzx); void deleteEyelxdzx(Eyelxdzx paramEyelxdzx); }
[ "545455716@qq.com" ]
545455716@qq.com
9304bc36c140c0dd7e21488e746d1f0723110990
0b627ad6d2575c6d54ff4cda086dd8e01aa700fc
/encryption-decription/src/main/java/com/verinite/filegenerator/controller/GenerateTokenController.java
774c990dca540aeb40b78ea90bdfaf59d5fbf7be
[]
no_license
Indrajeetsingh-Verinite/HistoryEncryptionTokenModule
8b6345bdde07896e7c86cfcc383387db73d34bfb
e3be412e155145abd3bbd769bd8cb99ebd055843
refs/heads/master
2023-04-05T08:28:18.371522
2021-04-09T06:18:36
2021-04-09T06:18:36
356,155,665
0
0
null
null
null
null
UTF-8
Java
false
false
3,209
java
package com.verinite.filegenerator.controller; import java.security.NoSuchAlgorithmException; import java.security.spec.InvalidKeySpecException; import com.nimbusds.jose.JOSEException; import com.verinite.filegenerator.authentication.ConvertKeys; import com.verinite.filegenerator.authentication.GenerateToken; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Value; import org.springframework.http.HttpHeaders; import org.springframework.http.MediaType; import org.springframework.web.bind.annotation.PatchMapping; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RestController; import org.springframework.web.reactive.function.client.WebClient; import reactor.core.publisher.Mono; @RestController public class GenerateTokenController { @Value("${authtoken.privatekey}") private String privateKey ; ConvertKeys convertKeys = new ConvertKeys(); @Autowired private WebClient.Builder webClientBuilder; @PostMapping("/generate") public String generate(@RequestBody String signedData) throws NoSuchAlgorithmException, InvalidKeySpecException, JOSEException{ GenerateToken tokenObject = new GenerateToken(); return tokenObject.getToken(signedData, 30000,convertKeys.stringToPrivateKey(privateKey)); } @PostMapping("/saveHistory") public Object saveHistory(@RequestBody String signedData) throws NoSuchAlgorithmException, InvalidKeySpecException, JOSEException{ GenerateToken tokenObject = new GenerateToken(); String token = tokenObject.getToken(signedData, 30000,convertKeys.stringToPrivateKey(privateKey)); return webClientBuilder.build() .post() .uri("http://localhost:8086/history") .header(HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_JSON_VALUE) .body(Mono.just(token), String.class) .retrieve() .bodyToMono(Object.class) .block(); } @PatchMapping("/updateHistory/{historyId}") public Object updateHistory(@RequestBody String signedData,@RequestParam Integer historyId) throws NoSuchAlgorithmException, InvalidKeySpecException, JOSEException{ GenerateToken tokenObject = new GenerateToken(); String token = tokenObject.getToken(signedData, 30000,convertKeys.stringToPrivateKey(privateKey)); return webClientBuilder.build() .patch() .uri("http://localhost:8086/history/"+historyId) .header(HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_JSON_VALUE) .body(Mono.just(token), String.class) .retrieve() .bodyToMono(Object.class) .block(); } }
[ "indrajeet@VERINITE1.local" ]
indrajeet@VERINITE1.local
19af8085180925ee8cbb7b0bb928451f21b98a65
60466de9cedb17661d691069b1486d11f139b8dd
/KevinA-Assignments/03-java-spring/01-spring-fundamentals/03-hello-human/src/test/java/com/kevin/hello/ApplicationTests.java
91c287a165e5a0f701f16649db816c0efd2f5245
[]
no_license
Kevin-Anderson13/java-bootcamp
babc91cafbb2b2237d416ce039708758371866f6
31676760b0459d488852fc7b24ff923540fddc38
refs/heads/main
2023-06-27T13:23:34.875456
2021-08-03T07:09:31
2021-08-03T07:09:31
392,224,185
0
0
null
null
null
null
UTF-8
Java
false
false
201
java
package com.kevin.hello; import org.junit.jupiter.api.Test; import org.springframework.boot.test.context.SpringBootTest; @SpringBootTest class ApplicationTests { @Test void contextLoads() { } }
[ "kevinand1113@gmail.com" ]
kevinand1113@gmail.com
2a7b1e9266892bdc9ceaa4fb2279433667e3c11a
986905768e2b11f431fdc895488a8e27b098d14d
/src/main/java/com/defysope/controller/DashboardController.java
6bd74be5876cc1b867ab6149ecd45f18ee93bf72
[]
no_license
bangalore-geek/myprj
2e2b80329535f5df680fdeaabb6376effa2f3f6c
5f99150e3f016cc2198af62e783fda34d994f1c1
refs/heads/master
2021-01-17T05:25:28.783390
2015-09-20T08:30:52
2015-09-20T08:30:52
33,488,696
0
0
null
null
null
null
UTF-8
Java
false
false
10,552
java
package com.defysope.controller; import java.util.HashMap; import java.util.List; import java.util.Map; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import net.sf.json.JSONObject; import org.apache.commons.lang.BooleanUtils; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.context.ApplicationContext; import org.springframework.security.access.annotation.Secured; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.ResponseBody; import org.springframework.web.servlet.ModelAndView; import com.defysope.model.User; import com.defysope.model.dashboard.DashboardItem; import com.defysope.model.dashboard.DashboardType; import com.defysope.model.dashboard.DashboardView; import com.defysope.providers.DashboardViewContext; import com.defysope.providers.DashboardViewProvider; import com.defysope.service.ApplicationUtils; import com.defysope.service.DashboardManager; import com.defysope.utils.NumberUtils; public class DashboardController { private static org.slf4j.Logger log = LoggerFactory .getLogger(DashboardController.class); @Autowired private DashboardManager dashboardManager; @Autowired private ApplicationUtils utils; @Autowired private ApplicationContext applicationContext; private Map<String, DashboardViewProvider> viewProviders; private Map<String, DashboardViewProvider> viewProviderMap = new HashMap<String, DashboardViewProvider>(); @RequestMapping("/v2/dashboard/dashlet-views/load") @Secured("ROLE_HOME_TAB") @ResponseBody public Object loadDashletViews(HttpServletRequest request, HttpServletResponse response, @RequestParam String type) { Map<String, Object> model = new HashMap<String, Object>(); try { User user = utils.getLoggedInUser(); List<DashboardView> items = dashboardManager.getViewableItems(user, type); model.put("views", items); model.put("success", true); } catch (RuntimeException e) { log.error(e.toString(), e); } catch (Exception e) { log.error(e.toString(), e); } return model; } @RequestMapping("/v2/dashboard/dashlet-view/view") @Secured("ROLE_HOME_TAB") public ModelAndView viewDashletView(HttpServletRequest request, HttpServletResponse response, @RequestParam("view") int viewId) { DashboardView view = dashboardManager.getObjectOrNull( DashboardView.class, viewId); /* * if (view == null) { throw new * Exception("Unable to find the requested resource."); } */ User user = utils.getLoggedInUser(); DashboardItem item = view.getItem(); /* * if (item == null || !user.hasRightToFeature(item.getFeatureCode())) { * throw new AccessDeniedException( * "Access to the specified resource is denied."); } */ DashboardViewProvider provider = getViewProvider(item); /* * if (provider == null) { throw new ResourceNotFoundException( * "Unable to find the requested resource."); } */ int height = NumberUtils.toInt(request.getParameter("height")); if (height != 0 && height >= view.getItem().getHeight()) { view.setHeight(height); dashboardManager.saveObject(view); } DashboardViewContext context = new DashboardViewContext(user, view, request); return provider.getModelAndView(context); } private DashboardViewProvider getViewProvider(DashboardItem item) { DashboardViewProvider provider = viewProviderMap.get(item.getName()); if (provider == null) { synchronized (this) { if (provider == null) { Map<String, DashboardViewProvider> viewProviders = getViewProviders(); for (DashboardViewProvider pv : viewProviders.values()) { if (pv.supports(item.getName())) { provider = pv; break; } } viewProviderMap.put(item.getName(), provider); } } } return provider; } private Map<String, DashboardViewProvider> getViewProviders() { if (viewProviders == null) { synchronized (this) { if (viewProviders == null) { viewProviders = applicationContext .getBeansOfType(DashboardViewProvider.class); } } } return viewProviders; } @RequestMapping("/v2/dashboard/dashlet-view/update") @Secured("ROLE_HOME_TAB") @ResponseBody public Object saveDashletView(HttpServletRequest request, HttpServletResponse response, @RequestParam("view") int viewId, @RequestParam int row, @RequestParam int column, @RequestParam int height) { Map<String, Object> model = new HashMap<String, Object>(); try { User user = utils.getLoggedInUser(); log.info("Updating dashlet {} to row {} column {} for user {}.", new Object[] { viewId, row, column, user.getUserName() }); DashboardView view = dashboardManager.getView(user, viewId); dashboardManager.updateView(user, viewId, row, column, height, BooleanUtils.toBoolean(request.getParameter("newRow")), NumberUtils.toInt(request.getParameter("deleteRow"), -1)); model.put("success", true); } catch (RuntimeException e) { log.error(e.toString(), e); } catch (Exception e) { log.error(e.toString(), e); } return model; } @RequestMapping(value = "/v2/dashboard/dashlet-view/add", method = RequestMethod.GET) @Secured("ROLE_HOME_TAB") public ModelAndView addDashlet(HttpServletRequest request, HttpServletResponse response, @RequestParam String type) { User user = utils.getLoggedInUser(); Map<String, Object> model = new HashMap<String, Object>(); List<DashboardItem> items = dashboardManager.getItems(user, type); model.put("items", items); return new ModelAndView("WEB-INF/freemarker/dashboard/add", model); } @RequestMapping(value = "/v2/dashboard/dashlet-view/add", method = RequestMethod.POST) @Secured("ROLE_HOME_TAB") @ResponseBody public Object addDashletView(HttpServletRequest request, HttpServletResponse response, @RequestParam String type, @RequestParam String item, @RequestParam int row, @RequestParam int column, @RequestParam boolean newRow) { Map<String, Object> model = new HashMap<String, Object>(); try { User user = utils.getLoggedInUser(); log.info("Creating view {} at row {} column {} for user {}.", new Object[] { item, row, column, user.getUserName() }); DashboardView view = new DashboardView(); view.setUserId(user == null ? 0 : user.getId()); view.setItem(dashboardManager.getItem(user, type, item)); view.setType(dashboardManager.getObjectOrNull(DashboardType.class, type)); view.setColumn(column); view.setRow(row); view.setHeight(NumberUtils.toInt(request.getParameter("height"))); dashboardManager.addView(user, view, newRow); DashboardItem dashletItem = view.getItem(); model.put("success", true); model.put("view", view); } catch (RuntimeException e) { log.error(e.toString(), e); } catch (Exception e) { log.error(e.toString(), e); } return model; } @RequestMapping("/v2/dashboard/dashlet-view/delete") @Secured("ROLE_HOME_TAB") @ResponseBody public Object deleteDashletView(HttpServletRequest request, HttpServletResponse response, @RequestParam("view") int viewId) { Map<String, Object> model = new HashMap<String, Object>(); try { User user = utils.getLoggedInUser(); log.info("Deleting dashlet {} for user {}.", new Object[] { viewId, user.getUserName() }); DashboardView view = dashboardManager.getObjectOrNull( DashboardView.class, viewId); if (view != null) { dashboardManager .removeObject(DashboardView.class, view.getId()); int deleteRow = NumberUtils.toInt( request.getParameter("deleteRow"), -1); if (deleteRow != -1) { dashboardManager.deleteRow(user, view.getType().getName(), deleteRow, -1); } } model.put("success", true); } catch (RuntimeException e) { log.error(e.toString(), e); } catch (Exception e) { log.error(e.toString(), e); } return model; } @RequestMapping(value = "/v2/dashboard/dashlet-view/options", method = RequestMethod.GET) @Secured("ROLE_HOME_TAB") public ModelAndView dashletOptions(HttpServletRequest request, HttpServletResponse response, @RequestParam("view") int viewId) { User user = utils.getLoggedInUser(); DashboardView view = dashboardManager.getView(user, viewId); /* * if (view == null || !view.getItem().isOptionsEnabled()) { throw new * ResourceNotFoundException( "Unable to find the requested resource."); * } */ DashboardViewProvider provider = getViewProvider(view.getItem()); /* * if (provider == null) { throw new ResourceNotFoundException( * "Unable to find the requested resource."); } * * saveStats(user, "dashlet-option-view", view.getItem().getName(), * "Viewed dashlet options for " + view.getItem().getCaption() + "."); */ DashboardViewContext context = new DashboardViewContext(user, view, request); return provider.getOptionModelAndView(context); } @RequestMapping(value = "/v2/dashboard/dashlet-view/options", method = RequestMethod.POST) @Secured("ROLE_HOME_TAB") @ResponseBody public Object dashletOptionsSave(HttpServletRequest request, HttpServletResponse response, @RequestParam("view") int viewId) { Map<String, Object> model = new HashMap<String, Object>(); try { User user = utils.getLoggedInUser(); DashboardView view = dashboardManager.getView(user, viewId); /* * if (view == null || !view.getItem().isOptionsEnabled()) { throw * new ResourceNotFoundException( * "Unable to find the requested resource."); } */ Map<String, String> params = new HashMap<String, String>(); @SuppressWarnings("unchecked") Map<String, String[]> parameterMap = request.getParameterMap(); for (Map.Entry<String, String[]> entry : parameterMap.entrySet()) { String[] value = entry.getValue(); params.put(entry.getKey(), value != null && value.length > 0 ? value[0] : null); } view.setOptions(JSONObject.fromObject(params).toString()); dashboardManager.saveObject(view); /* * saveStats(user, "dashlet-option", view.getItem().getName(), * "Saved dashlet options for " + view.getItem().getCaption() + * "."); */ model.put("success", true); } catch (RuntimeException e) { log.error(e.toString(), e); } catch (Exception e) { log.error(e.toString(), e); } return model; } }
[ "rathordeepak16@gmail.com" ]
rathordeepak16@gmail.com
5a92423acf846f09dedbed3022d012f6c9c918d5
fb12d15af0214af5532d58faba92480522569aac
/src/main/java/com/redhat/training/ad364/model/Student.java
386383d2be2ba9fdc9b75e519773ab2b4283f8ae
[]
no_license
finmahon/rules364-5.4-opt
f23d26489e2a13462eb0feec7172cd047f1b4bf4
74461071f53b5dd1e27bbaefcdc8b4554d2301e6
refs/heads/master
2023-07-03T20:45:46.520982
2021-08-10T23:12:20
2021-08-10T23:12:20
394,797,982
0
0
null
null
null
null
UTF-8
Java
false
false
1,525
java
package com.redhat.training.ad364.model; import java.util.List; import java.util.Objects; public class Student { private String name; private Boolean eligibleForFinanceAid; private Boolean appliedForFinanceAid; private List<Grade> grades; public Student() {} public Student(String name, List<Grade> grades) { this.name = name; this.grades = grades; } public String getName() { return name; } public void setName(String name) { this.name = name; } public Boolean getEligibleForFinanceAid() { return eligibleForFinanceAid; } public void setEligibleForFinanceAid(Boolean eligibleForFinanceAid) { this.eligibleForFinanceAid = eligibleForFinanceAid; } public Boolean getAppliedForFinanceAid() { return appliedForFinanceAid; } public void setAppliedForFinanceAid(Boolean appliedForFinanceAid) { this.appliedForFinanceAid = appliedForFinanceAid; } public List<Grade> getGrades() { return grades; } public void setGrades(List<Grade> grades) { this.grades = grades; } // @Override // public boolean equals(Object o) { // if (this == o) return true; // if (o == null || getClass() != o.getClass()) return false; // Student student = (Student) o; // return Objects.equals(name, student.name); // } // @Override // public int hashCode() { // return Objects.hash(name); // } }
[ "student@workstation.lab.example.com" ]
student@workstation.lab.example.com
0fdad9f539c80a680a5f13b33b4fd5e3fa510abc
bf8d8b0032982cbac8879691697c5361cf6f2e9a
/src/ZuoShen/Basic_class8/Code_04_Print_All_Permutations.java
8e1b6e447603f3ba0b669656b67d36fc8c589f56
[]
no_license
ddisacoder/ForBishi
41b2819708c798f61c41ef9629582053eb3c1c80
63d8770deb754ee7585b64503d98c4418159c6d3
refs/heads/master
2020-07-15T19:53:20.015429
2019-10-06T11:17:56
2019-10-06T11:17:56
205,637,373
1
0
null
null
null
null
UTF-8
Java
false
false
1,387
java
package ZuoShen.Basic_class8; import java.util.HashSet; public class Code_04_Print_All_Permutations { public static void printAllPermutations1(String str) { char[] chs = str.toCharArray(); process1(chs, 0); } public static void process1(char[] chs, int i) { if (i == chs.length) { System.out.println(String.valueOf(chs)); } for (int j = i; j < chs.length; j++) { swap(chs, i, j); process1(chs, i + 1); swap(chs, i, j); } } public static void printAllPermutations2(String str) { char[] chs = str.toCharArray(); process2(chs, 0); } public static void process2(char[] chs, int i) { if (i == chs.length) { System.out.println(String.valueOf(chs)); } HashSet<Character> set = new HashSet<Character>(); for (int j = i; j < chs.length; j++) { if (!set.contains(chs[j])) { set.add(chs[j]); swap(chs, i, j); process2(chs, i + 1); swap(chs, i, j); } } } public static void swap(char[] chs, int i, int j) { char tmp = chs[i]; chs[i] = chs[j]; chs[j] = tmp; } public static void main(String[] args) { String test1 = "abc"; printAllPermutations1(test1); System.out.println("======"); printAllPermutations2(test1); System.out.println("======"); String test2 = "acc"; printAllPermutations1(test2); System.out.println("======"); printAllPermutations2(test2); System.out.println("======"); } }
[ "861573320@qq.com" ]
861573320@qq.com
b24c20dc5776b78b8f7461f451481d33f6833658
ce44e9fec5f4ee3eff79c3e6fbb0064fbb94753d
/main/geo/test/boofcv/alg/distort/TestAddRadialNtoN_F64.java
39b4e086370c5266320b00b67859c810e323e159
[ "Apache-2.0" ]
permissive
wsjhnsn/BoofCV
74fc0687e29c45df1d2fc125b28d777cd91a8158
bdae47003090c03386b6b23e2a884bceba242241
refs/heads/master
2020-12-24T12:34:02.996379
2014-06-27T21:15:21
2014-06-27T21:15:21
21,334,100
1
0
null
null
null
null
UTF-8
Java
false
false
1,544
java
/* * Copyright (c) 2011-2013, Peter Abeles. All Rights Reserved. * * This file is part of BoofCV (http://boofcv.org). * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package boofcv.alg.distort; import georegression.struct.point.Point2D_F64; import org.junit.Test; import static org.junit.Assert.assertEquals; /** * @author Peter Abeles */ public class TestAddRadialNtoN_F64 { /** * Manually compute the distorted coordinate for a point and see if it matches */ @Test public void againstManual() { double radial[]= new double[]{0.01,-0.03}; Point2D_F64 orig = new Point2D_F64(0.1,-0.2); // manually compute the distortion double r2 = orig.x*orig.x + orig.y*orig.y; double mag = radial[0]*r2 + radial[1]*r2*r2; double distX = orig.x*(1+mag); double distY = orig.y*(1+mag); AddRadialNtoN_F64 alg = new AddRadialNtoN_F64(); alg.set(radial); Point2D_F64 found = new Point2D_F64(); alg.compute(orig.x,orig.y,found); assertEquals(distX,found.x,1e-4); assertEquals(distY,found.y,1e-4); } }
[ "peter.abeles@gmail.com" ]
peter.abeles@gmail.com
f90eefbda453e7cc79960eb136e664559bb91bf1
79be286d62804776986eb65c541e08618e41abe9
/app/src/main/java/com/mirkowu/baselibrarysample/api/TestService.java
7f4faa4517c07280ed400b76d3b883c8c019709d
[]
no_license
phpzysw/BaseLibrary
6f6772da5d5222f32a7ed147abb9538ce8d295ab
a64f614d6867ff5a6081fda26c823b071ded3a84
refs/heads/master
2020-04-28T04:03:39.201713
2019-03-08T04:23:00
2019-03-08T04:23:00
null
0
0
null
null
null
null
UTF-8
Java
false
false
654
java
package com.mirkowu.baselibrarysample.api; import com.mirkowu.baselibrarysample.bean.GoodsBean; import com.softgarden.baselibrary.network.BaseBean; import java.util.List; import io.reactivex.Observable; import retrofit2.http.POST; import retrofit2.http.Url; public interface TestService { /** * 测试接口 * * @return */ //接口有参数时 要写上该注解 // @FormUrlEncoded @POST(HostUrl.HOST_GOODSLIST) Observable<BaseBean<List<GoodsBean>>> getData(/*@Field("is_new") int is_new*/); @POST Observable<BaseBean<List<GoodsBean>>> getData(@Url String url/*@Field("is_new") int is_new*/); }
[ "709651717@qq.com" ]
709651717@qq.com
ce1f61f70d557b217c43cf9944a2cce7226ffd44
ceef55f93a25ea3a5a9be2132e11508d035f7132
/java-qi4j/marc-grue/dcisample_b/src/test/java/com/marcgrue/dcisample_b/context/test/booking/BookNewCargoTest.java
de36bc59fdb05f68aec02bf9b3696427c5478c6a
[ "Apache-2.0" ]
permissive
zeng910910903/dci-sample
72032b40a243290228ea43b7d8c13c5f31d5118e
780a8bf0f969163941e5e48d2a200314e883bd42
refs/heads/master
2020-05-17T23:56:30.912327
2011-11-27T16:51:31
2011-11-27T16:51:31
null
0
0
null
null
null
null
WINDOWS-1250
Java
false
false
6,119
java
package com.marcgrue.dcisample_b.context.test.booking; import com.marcgrue.dcisample_b.bootstrap.test.TestApplication; import com.marcgrue.dcisample_b.context.interaction.booking.BookNewCargo; import com.marcgrue.dcisample_b.data.entity.CargoEntity; import com.marcgrue.dcisample_b.data.factory.exception.CannotCreateCargoException; import com.marcgrue.dcisample_b.data.factory.exception.CannotCreateRouteSpecificationException; import org.junit.Test; import org.qi4j.api.constraint.ConstraintViolationException; import static com.marcgrue.dcisample_b.data.structure.delivery.RoutingStatus.NOT_ROUTED; import static com.marcgrue.dcisample_b.data.structure.delivery.TransportStatus.NOT_RECEIVED; import static com.marcgrue.dcisample_b.data.structure.handling.HandlingEventType.RECEIVE; import static org.hamcrest.CoreMatchers.equalTo; import static org.hamcrest.CoreMatchers.is; import static org.junit.Assert.assertThat; /** * {@link BookNewCargo} tests */ public class BookNewCargoTest extends TestApplication { @Test public void deviation_2a_OriginAndDestinationSame() throws Exception { thrown.expect( CannotCreateRouteSpecificationException.class, "Origin location can't be same as destination location." ); new BookNewCargo( CARGOS, HONGKONG, HONGKONG, DAY24 ).getTrackingId(); } @Test public void deviation_2b_DeadlineInThePastNotAccepted() throws Exception { thrown.expect( CannotCreateRouteSpecificationException.class, "Arrival deadline is in the past or Today." ); new BookNewCargo( CARGOS, HONGKONG, STOCKHOLM, day( -1 ) ).getTrackingId(); } @Test public void deviation_2b_DeadlineTodayIsTooEarly() throws Exception { thrown.expect( CannotCreateRouteSpecificationException.class, "Arrival deadline is in the past or Today." ); new BookNewCargo( CARGOS, HONGKONG, STOCKHOLM, day( 0 ) ).getTrackingId(); } @Test public void deviation_2b_DeadlineTomorrowIsOkay() throws Exception { new BookNewCargo( CARGOS, HONGKONG, STOCKHOLM, DAY1 ).getTrackingId(); } @Test public void step_2_CanCreateRouteSpecification() throws Exception { trackingId = new BookNewCargo( CARGOS, HONGKONG, STOCKHOLM, DAY24 ).getTrackingId(); cargo = uow.get( CargoEntity.class, trackingId.id().get() ); assertThat( cargo.routeSpecification().get().origin().get(), is( equalTo( HONGKONG ) ) ); assertThat( cargo.routeSpecification().get().destination().get(), is( equalTo( STOCKHOLM ) ) ); assertThat( cargo.routeSpecification().get().arrivalDeadline().get(), is( equalTo( DAY24 ) ) ); } @Test public void step_3_CanDeriveInitialDeliveryData() throws Exception { trackingId = new BookNewCargo( CARGOS, HONGKONG, STOCKHOLM, DAY24 ).getTrackingId(); cargo = uow.get( CargoEntity.class, trackingId.id().get() ); assertDelivery( null, null, null, null, NOT_RECEIVED, notArrived, NOT_ROUTED, directed, unknownETA, unknownLeg, RECEIVE, HONGKONG, noSpecificDate, noVoyage ); } @Test public void deviation_4a_TrackingIdTooShort() throws Exception { thrown.expect( ConstraintViolationException.class, "for value 'no'" ); new BookNewCargo( CARGOS, HONGKONG, STOCKHOLM, DAY24 ).withTrackingId( "no" ); } @Test public void deviation_4a_TrackingIdNotTooShort() throws Exception { trackingId = new BookNewCargo( CARGOS, HONGKONG, STOCKHOLM, DAY24 ).withTrackingId( "yes" ); cargo = uow.get( CargoEntity.class, trackingId.id().get() ); assertThat( cargo.trackingId().get().id().get(), is( equalTo( "yes" ) ) ); } @Test public void deviation_4a_TrackingIdTooLong() throws Exception { thrown.expect( ConstraintViolationException.class, "for value '1234567890123456789012345678901'" ); new BookNewCargo( CARGOS, HONGKONG, STOCKHOLM, DAY24 ).withTrackingId( "1234567890123456789012345678901" ); } @Test public void deviation_4a_TrackingIdNotTooLong() throws Exception { trackingId = new BookNewCargo( CARGOS, HONGKONG, STOCKHOLM, DAY24 ).withTrackingId( "123456789012345678901234567890" ); cargo = uow.get( CargoEntity.class, trackingId.id().get() ); assertThat( cargo.trackingId().get().id().get(), is( equalTo( "123456789012345678901234567890" ) ) ); } @Test public void deviation_4a_TrackingIdWithWrongCharacter() throws Exception { thrown.expect( ConstraintViolationException.class, "for value 'Gšteborg1234'" ); new BookNewCargo( CARGOS, HONGKONG, STOCKHOLM, DAY24 ).withTrackingId( "Gšteborg1234" ); } @Test public void deviation_4b_TrackingIdNotUnique() throws Exception { thrown.expect( CannotCreateCargoException.class, "Tracking id 'yes' is not unique." ); new BookNewCargo( CARGOS, HONGKONG, STOCKHOLM, DAY24 ).withTrackingId( "yes" ); } @Test public void step_4_CanAutoCreateTrackingIdFromEmptyString() throws Exception { new BookNewCargo( CARGOS, HONGKONG, STOCKHOLM, DAY24 ).withTrackingId( "" ); } @Test public void step_4_CanAutoCreateTrackingIdFromNull() throws Exception { new BookNewCargo( CARGOS, HONGKONG, STOCKHOLM, DAY24 ).withTrackingId( null ); } @Test public void success_BookNewCargo() throws Exception { trackingId = new BookNewCargo( CARGOS, HONGKONG, STOCKHOLM, DAY24 ).withTrackingId( "ABC" ); cargo = uow.get( CargoEntity.class, trackingId.id().get() ); assertThat( cargo.trackingId().get(), is( equalTo( trackingId ) ) ); assertThat( cargo.trackingId().get().id().get(), is( equalTo( "ABC" ) ) ); assertThat( cargo.origin().get(), is( equalTo( HONGKONG ) ) ); assertDelivery( null, null, null, null, NOT_RECEIVED, notArrived, NOT_ROUTED, directed, unknownETA, unknownLeg, RECEIVE, HONGKONG, noSpecificDate, noVoyage ); } }
[ "marc@grue.info" ]
marc@grue.info
1ddc505d60930171608f390a8f9f0ad62b173d82
0c66d0562f1aa58af7f6379ff031220234a4816a
/src/Samepackage/Same.java
7dfb3abae1afef40f46a8d52d87f0bf9cb06a5df
[]
no_license
parkchangju12/java_work
2ec23634b61b26d1a9c06573f8605cdfaf46e878
95a8f496575b359c657a97e38737c0f42337bc01
refs/heads/master
2023-06-07T11:19:30.607942
2021-07-06T02:22:34
2021-07-06T02:22:34
363,104,738
0
0
null
null
null
null
UTF-8
Java
false
false
291
java
package Samepackage; public class Same { private void _private() { System.out.println("private"); } void _default() { System.out.println("default"); } protected void _protected() { System.out.println("protected"); } public void _public() { System.out.println("public"); } }
[ "jusu0369@naver.com" ]
jusu0369@naver.com
a02b5b156042899e65b5708527795b62b010b313
366a05b3253bba82fb5b783512022ccc17cf7683
/RightBigSpikedTreeMiddleRight.java
605af28a23ede079d7558b10a97cfdec552c0d83
[]
no_license
Pasterian/Dead-Pixels
13367884a5b773746bb9fac0a28ebec70ca1f319
dbc8a340038a5c9d2e2cd774b27cd42a53d3358a
refs/heads/master
2023-03-09T22:18:53.867394
2021-02-24T01:11:43
2021-02-24T01:11:43
341,737,440
0
0
null
null
null
null
UTF-8
Java
false
false
548
java
import greenfoot.*; // (World, Actor, GreenfootImage, Greenfoot and MouseInfo) /** * Write a description of class RightBigSpikedTreeMiddleRight here. * * @author (your name) * @version (a version number or a date) */ public class RightBigSpikedTreeMiddleRight extends Tile { /** * Act - do whatever the RightBigSpikedTreeMiddleRight wants to do. This method is called whenever * the 'Act' or 'Run' button gets pressed in the environment. */ public void act() { // Add your action code here. } }
[ "lw518@kent.ac.uk" ]
lw518@kent.ac.uk
8f72eb54963bbc823fc70e6b37786d9ca0e3ce78
541d32ad782cb551c7c4aa689008023fc4b9cc7f
/app/src/main/java/my/edu/tarc/madassignment/QRCodeActivity.java
5c5e78548863443465790cc61c9f4821250665af
[]
no_license
LeeMunKit/MADassignment
fd2e5878f554bf1dad89915514c19fb00a4b080e
dae1c47d071bd17b2d2a12cb5b28704ef398112e
refs/heads/master
2021-05-05T22:16:17.232631
2018-01-05T07:11:13
2018-01-05T07:11:13
116,116,966
0
0
null
null
null
null
UTF-8
Java
false
false
652
java
package my.edu.tarc.madassignment; /** * Created by ASUS on 19/11/2017. */ import android.os.Bundle; import android.support.v4.app.Fragment; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.ArrayAdapter; import android.widget.ListView; public class QRCodeActivity extends Fragment{ @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View rootView = inflater.inflate(R.layout.fragment_join_code, container, false); return rootView; //return null; } }
[ "jackboy5177@gmail.com" ]
jackboy5177@gmail.com
027c01eebd67fccc618480180513b3630f97fbbd
5493ddc87a45e52cf5c290f7acfc0ce72439ec15
/app/src/main/java/com/mondyxue/xrouter/demo/interceptor/LoginInterceptor.java
f59111e70495bb9c950b2b956570ef6977109045
[]
no_license
mapleskip/XRouter
aa32d5dbc0bcf466bce1e79a9e44cf7e7c174ce5
912d80cb9e1b123de58936f925393dbe846266f9
refs/heads/master
2021-01-01T18:36:23.328860
2017-07-25T11:39:05
2017-07-25T11:39:05
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,925
java
package com.mondyxue.xrouter.demo.interceptor; import android.support.annotation.NonNull; import com.alibaba.android.arouter.facade.Postcard; import com.alibaba.android.arouter.facade.annotation.Interceptor; import com.alibaba.android.arouter.facade.callback.InterceptorCallback; import com.alibaba.android.arouter.facade.template.IInterceptor; import com.mondyxue.xrouter.XRouter; import com.mondyxue.xrouter.demo.callback.UserInfoCallback; import com.mondyxue.xrouter.demo.constant.Extras; import com.mondyxue.xrouter.demo.data.UserInfo; import com.mondyxue.xrouter.demo.navigator.DemoNavigator; import com.mondyxue.xrouter.navigator.Navigator; /** * <br>Created by MondyXue * <br>E-MAIL: mondyxue@gmial.com */ @Interceptor(priority = 4, name = "LoginInterceptor") public class LoginInterceptor extends com.mondyxue.xrouter.interceptor.LoginInterceptor implements IInterceptor{ @Override public boolean isLogin(){ return XRouter.getRouter() .create(DemoNavigator.class) .getUserService() .isLogin(); } @Override protected void onInterrupt(final Postcard postcard, final InterceptorCallback callback){ XRouter.getRouter() .create(DemoNavigator.class) .toLoginFragment() .startActivityForResult(new UserInfoCallback(){ @Override public void onResponse(@NonNull UserInfo data){ postcard.withSerializable(Extras.UserInfo, data); callback.onContinue(postcard); } @Override public void onError(Throwable throwable){ callback.onInterrupt(throwable); } @Override public void onCancel(){ callback.onInterrupt(new RuntimeException("login cancel!")); } }); } }
[ "mondyxue@gmail.com" ]
mondyxue@gmail.com
bf1926eb163f2403c967feaa339f0f77fab281b4
1374237fa0c18f6896c81fb331bcc96a558c37f4
/java/com/winnertel/ems/epon/iad/bbs4000/gui/r400/DeviceBaseQosMapTablePanel.java
d8f5c3c44c7952efb86a8d9606d5bf8d693abcc2
[]
no_license
fangniude/lct
0ae5bc550820676f05d03f19f7570dc2f442313e
adb490fb8d0c379a8b991c1a22684e910b950796
refs/heads/master
2020-12-02T16:37:32.690589
2017-12-25T01:56:32
2017-12-25T01:56:32
96,560,039
0
0
null
null
null
null
UTF-8
Java
false
false
7,070
java
/** * Created by Zhou Chao, 2010/5/26 */ package com.winnertel.ems.epon.iad.bbs4000.gui.r400; import com.winnertel.ems.epon.iad.bbs4000.mib.r400.DeviceBaseQosMapTable; import com.winnertel.em.framework.IApplication; import com.winnertel.em.framework.gui.swing.UPanel; import com.winnertel.em.standard.util.gui.layout.HSpacer; import com.winnertel.em.standard.util.gui.layout.NTLayout; import com.winnertel.em.standard.util.gui.layout.VSpacer; import javax.swing.*; import java.awt.*; import java.awt.event.ItemEvent; import java.awt.event.ItemListener; public class DeviceBaseQosMapTablePanel extends UPanel { private int[] baseQosMapRuleIndexVList = new int[]{1, 2, 3,}; private String[] baseQosMapRuleIndexTList = new String[]{ fStringMap.getString("cos"), //1 fStringMap.getString("tos"), //2 fStringMap.getString("diffserv"), //3 }; private JComboBox tfBaseQosMapRuleIndex = new JComboBox(baseQosMapRuleIndexTList); private String[] baseQosMapOctet8VList = null; private String[] baseQosMapOctet16VList = null; private String[] baseQosMapOctet64VList = null; private JComboBox[] tfBaseQosMapOctet = null; private final String baseQosMapRuleIndex = fStringMap.getString("deviceBaseQosMapRuleIndex") + " : "; private final String baseQosMapOctet = fStringMap.getString("deviceBaseQosMapOctet") + " : "; public DeviceBaseQosMapTablePanel(IApplication app) { super(app); init(); } public void initGui() { JPanel baseInfoPanel = new JPanel(); NTLayout layout = new NTLayout(1, 3, NTLayout.FILL, NTLayout.CENTER, 5, 5); layout.setMargins(6, 10, 6, 10); baseInfoPanel.setLayout(layout); baseInfoPanel.setBorder(BorderFactory.createEtchedBorder()); baseInfoPanel.add(new JLabel(baseQosMapRuleIndex)); baseInfoPanel.add(tfBaseQosMapRuleIndex); baseInfoPanel.add(new HSpacer()); tfBaseQosMapRuleIndex.setEnabled(false); //BaseQosMapOctet panel JPanel baseQosMapOctetPanel = new JPanel(); NTLayout layout1 = new NTLayout(16, 8, NTLayout.FILL, NTLayout.CENTER, 5, 5); layout1.setMargins(6, 10, 6, 10); baseQosMapOctetPanel.setLayout(layout1); baseQosMapOctetPanel.setBorder(BorderFactory.createTitledBorder(fStringMap.getString(baseQosMapOctet))); baseQosMapOctet8VList = new String[8]; for (int i = 0; i < baseQosMapOctet8VList.length; i++) { baseQosMapOctet8VList[i] = String.valueOf(i); } baseQosMapOctet16VList = new String[16]; for (int i = 0; i < baseQosMapOctet16VList.length; i++) { baseQosMapOctet16VList[i] = String.valueOf(i); } baseQosMapOctet64VList = new String[64]; for (int i = 0; i < baseQosMapOctet64VList.length; i++) { baseQosMapOctet64VList[i] = String.valueOf(i); } tfBaseQosMapOctet = new JComboBox[64]; for (int i = 0; i < tfBaseQosMapOctet.length; i++) { tfBaseQosMapOctet[i] = new JComboBox(); tfBaseQosMapOctet[i].setEnabled(false); baseQosMapOctetPanel.add(new JLabel(fStringMap.getString("priority") + i)); baseQosMapOctetPanel.add(tfBaseQosMapOctet[i]); } tfBaseQosMapRuleIndex.setSelectedItem(null); tfBaseQosMapRuleIndex.addItemListener(new ItemListener() { public void itemStateChanged(ItemEvent e) { int rule = tfBaseQosMapRuleIndex.getSelectedIndex() + 1; selectBaseQosMaoOctetPanel(rule); } }); JPanel allPanel = new JPanel(); layout = new NTLayout(3, 1, NTLayout.FILL, NTLayout.FILL, 5, 3); layout.setMargins(6, 10, 6, 10); allPanel.setLayout(layout); allPanel.add(baseInfoPanel); allPanel.add(baseQosMapOctetPanel); allPanel.add(new VSpacer()); setLayout(new BorderLayout()); add(new JScrollPane(allPanel), BorderLayout.CENTER); setPreferredSize(new Dimension(500, 400)); } protected void initForm() { } public void selectBaseQosMaoOctetPanel(int rule) { switch (rule) { case 1: //cos for (int i = 0; i < tfBaseQosMapOctet.length; i++) { tfBaseQosMapOctet[i].setModel(new DefaultComboBoxModel(baseQosMapOctet8VList)); tfBaseQosMapOctet[i].setEnabled(i < 8); } break; case 2: //tos for (int i = 0; i < tfBaseQosMapOctet.length; i++) { tfBaseQosMapOctet[i].setModel(new DefaultComboBoxModel(baseQosMapOctet16VList)); tfBaseQosMapOctet[i].setEnabled(i < 16); } break; default: //diffserv for (int i = 0; i < tfBaseQosMapOctet.length; i++) { tfBaseQosMapOctet[i].setModel(new DefaultComboBoxModel(baseQosMapOctet64VList)); tfBaseQosMapOctet[i].setEnabled(i < 64); } break; } } public void refresh() { DeviceBaseQosMapTable mbean = (DeviceBaseQosMapTable) getModel(); if (mbean == null) return; tfBaseQosMapRuleIndex.setSelectedIndex(getIndexFromValue(baseQosMapRuleIndexVList, mbean.getDeviceBaseQosMapRuleIndex())); //selectBaseQosMaoOctetPanel(mbean.getDeviceBaseQosMapRuleIndex()); //manually trigger 'addItemListener' setBaseQosMapOctet(mbean.getDeviceBaseQosMapRuleIndex(), mbean.getDeviceBaseQosMapOctet()); } public void updateModel() { DeviceBaseQosMapTable mbean = (DeviceBaseQosMapTable) getModel(); if (mbean == null) return; mbean.setDeviceBaseQosMapOctet(getBaseQosMapOctet(mbean.getDeviceBaseQosMapRuleIndex())); } private byte[] getBaseQosMapOctet(int rule) { int validLength = (rule == 1 ? 8 : rule == 2 ? 16 : 64); return getByteMap(tfBaseQosMapOctet, validLength); } private void setBaseQosMapOctet(int rule, byte[] queueMap) { int validLength = (rule == 1 ? 8 : rule == 2 ? 16 : 64); setByteMap(tfBaseQosMapOctet, validLength, queueMap); } private byte[] getByteMap(JComboBox[] boxes, int validLength) { byte[] b = new byte[validLength]; for (int i = 0; (i < validLength) && (i <= boxes.length); i++) b[i] = (byte) Integer.parseInt((String) boxes[i].getSelectedItem()); return b; } private void setByteMap(JComboBox[] boxes, int validLength, byte[] mibValue) { //for (int i = 0; i < boxes.length; i++) // boxes[i].setSelectedItem(-1); for (int i = 0; (i < validLength) && (i < mibValue.length); i++) boxes[i].setSelectedItem(Byte.toString(mibValue[i])); } public int getIndexFromValue(int[] list, int v) { for (int i = 0; i != list.length; i++) { if (list[i] == v) return i; } return 0; } }
[ "fangniude@gmail.com" ]
fangniude@gmail.com
144795189b00ec2e9e3a3d486dbf2a6dbb53b41b
9b15ca35add3763427813837008e5a259403211b
/android/app/src/main/java/io/flutter/plugins/GeneratedPluginRegistrant.java
79a7be2f4165dd3d8b74a7cc6ee53e4857f0c602
[]
no_license
Milimeter/aewebshop_employee
2b554d3e13cb0d65fc18fddc29585f46b6202321
8781dbb1762039b10093b515034f73ae572d868e
refs/heads/main
2023-06-07T14:18:23.199477
2021-07-02T14:38:39
2021-07-02T14:38:39
381,045,293
0
0
null
null
null
null
UTF-8
Java
false
false
3,224
java
package io.flutter.plugins; import androidx.annotation.Keep; import androidx.annotation.NonNull; import io.flutter.Log; import io.flutter.embedding.engine.FlutterEngine; /** * Generated file. Do not edit. * This file is generated by the Flutter tool based on the * plugins that support the Android platform. */ @Keep public final class GeneratedPluginRegistrant { private static final String TAG = "GeneratedPluginRegistrant"; public static void registerWith(@NonNull FlutterEngine flutterEngine) { try { flutterEngine.getPlugins().add(new io.flutter.plugins.firebase.firestore.FlutterFirebaseFirestorePlugin()); } catch(Exception e) { Log.e(TAG, "Error registering plugin cloud_firestore, io.flutter.plugins.firebase.firestore.FlutterFirebaseFirestorePlugin", e); } try { flutterEngine.getPlugins().add(new io.flutter.plugins.firebase.auth.FlutterFirebaseAuthPlugin()); } catch(Exception e) { Log.e(TAG, "Error registering plugin firebase_auth, io.flutter.plugins.firebase.auth.FlutterFirebaseAuthPlugin", e); } try { flutterEngine.getPlugins().add(new io.flutter.plugins.firebase.core.FlutterFirebaseCorePlugin()); } catch(Exception e) { Log.e(TAG, "Error registering plugin firebase_core, io.flutter.plugins.firebase.core.FlutterFirebaseCorePlugin", e); } try { flutterEngine.getPlugins().add(new io.flutter.plugins.firebase.storage.FlutterFirebaseStoragePlugin()); } catch(Exception e) { Log.e(TAG, "Error registering plugin firebase_storage, io.flutter.plugins.firebase.storage.FlutterFirebaseStoragePlugin", e); } try { flutterEngine.getPlugins().add(new io.flutter.plugins.flutter_plugin_android_lifecycle.FlutterAndroidLifecyclePlugin()); } catch(Exception e) { Log.e(TAG, "Error registering plugin flutter_plugin_android_lifecycle, io.flutter.plugins.flutter_plugin_android_lifecycle.FlutterAndroidLifecyclePlugin", e); } try { flutterEngine.getPlugins().add(new io.flutter.plugins.imagepicker.ImagePickerPlugin()); } catch(Exception e) { Log.e(TAG, "Error registering plugin image_picker, io.flutter.plugins.imagepicker.ImagePickerPlugin", e); } try { flutterEngine.getPlugins().add(new io.flutter.plugins.pathprovider.PathProviderPlugin()); } catch(Exception e) { Log.e(TAG, "Error registering plugin path_provider, io.flutter.plugins.pathprovider.PathProviderPlugin", e); } try { flutterEngine.getPlugins().add(new com.baseflow.permissionhandler.PermissionHandlerPlugin()); } catch(Exception e) { Log.e(TAG, "Error registering plugin permission_handler, com.baseflow.permissionhandler.PermissionHandlerPlugin", e); } try { flutterEngine.getPlugins().add(new bsi.iceman.searchable_dropdown.SearchableDropdownPlugin()); } catch(Exception e) { Log.e(TAG, "Error registering plugin searchable_dropdown, bsi.iceman.searchable_dropdown.SearchableDropdownPlugin", e); } try { flutterEngine.getPlugins().add(new com.tekartik.sqflite.SqflitePlugin()); } catch(Exception e) { Log.e(TAG, "Error registering plugin sqflite, com.tekartik.sqflite.SqflitePlugin", e); } } }
[ "razaqolad300@gmail.com" ]
razaqolad300@gmail.com